<!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>[44713] trunk/src: TinyMCE: Update to 4.9.2</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 { white-space: pre-line; 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/44713">44713</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/44713","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>iseulde</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2019-01-29 20:18:33 +0000 (Tue, 29 Jan 2019)</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.9.2
https://github.com/tinymce/tinymce-dist/compare/4.8.0...4.9.2
Fixes <a href="https://core.trac.wordpress.org/ticket/46094">#46094</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcjs_enqueuesvendorREADMEmd">trunk/src/js/_enqueues/vendor/README.md</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcepluginscharmappluginjs">trunk/src/js/_enqueues/vendor/tinymce/plugins/charmap/plugin.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcepluginscolorpickerpluginjs">trunk/src/js/_enqueues/vendor/tinymce/plugins/colorpicker/plugin.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcepluginsdirectionalitypluginjs">trunk/src/js/_enqueues/vendor/tinymce/plugins/directionality/plugin.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcepluginsfullscreenpluginjs">trunk/src/js/_enqueues/vendor/tinymce/plugins/fullscreen/plugin.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcepluginshrpluginjs">trunk/src/js/_enqueues/vendor/tinymce/plugins/hr/plugin.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcepluginsimagepluginjs">trunk/src/js/_enqueues/vendor/tinymce/plugins/image/plugin.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcepluginsimagepluginminjs">trunk/src/js/_enqueues/vendor/tinymce/plugins/image/plugin.min.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcepluginslinkpluginjs">trunk/src/js/_enqueues/vendor/tinymce/plugins/link/plugin.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcepluginslistspluginjs">trunk/src/js/_enqueues/vendor/tinymce/plugins/lists/plugin.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcepluginslistspluginminjs">trunk/src/js/_enqueues/vendor/tinymce/plugins/lists/plugin.min.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcepluginsmediapluginjs">trunk/src/js/_enqueues/vendor/tinymce/plugins/media/plugin.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcepluginspastepluginjs">trunk/src/js/_enqueues/vendor/tinymce/plugins/paste/plugin.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcepluginspastepluginminjs">trunk/src/js/_enqueues/vendor/tinymce/plugins/paste/plugin.min.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcepluginstabfocuspluginjs">trunk/src/js/_enqueues/vendor/tinymce/plugins/tabfocus/plugin.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcepluginstextcolorpluginjs">trunk/src/js/_enqueues/vendor/tinymce/plugins/textcolor/plugin.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcepluginstextcolorpluginminjs">trunk/src/js/_enqueues/vendor/tinymce/plugins/textcolor/plugin.min.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymceskinslightgrayfontstinymcesvg">trunk/src/js/_enqueues/vendor/tinymce/skins/lightgray/fonts/tinymce.svg</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymceskinslightgrayskinmincss">trunk/src/js/_enqueues/vendor/tinymce/skins/lightgray/skin.min.css</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcethemesinlitethemejs">trunk/src/js/_enqueues/vendor/tinymce/themes/inlite/theme.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcethemesinlitethememinjs">trunk/src/js/_enqueues/vendor/tinymce/themes/inlite/theme.min.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcethemesmodernthemejs">trunk/src/js/_enqueues/vendor/tinymce/themes/modern/theme.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcethemesmodernthememinjs">trunk/src/js/_enqueues/vendor/tinymce/themes/modern/theme.min.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcetinymcejs">trunk/src/js/_enqueues/vendor/tinymce/tinymce.js</a></li>
<li><a href="#trunksrcjs_enqueuesvendortinymcetinymceminjs">trunk/src/js/_enqueues/vendor/tinymce/tinymce.min.js</a></li>
<li><a href="#trunksrcwpincludesversionphp">trunk/src/wp-includes/version.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcjs_enqueuesvendorREADMEmd"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/README.md</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/README.md 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/README.md 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -12,7 +12,48 @@
</span><span class="cx" style="display: block; padding: 0 10px"> - plupload: https://github.com/moxiecode/plupload
</span><span class="cx" style="display: block; padding: 0 10px"> - swfupload: https://github.com/WordPress/secure-swfupload
</span><span class="cx" style="display: block; padding: 0 10px"> - thickbox: http://codylindley.com/thickbox/
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-- tinymce: https://github.com/tinymce/tinymce
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+- tinymce: https://www.tiny.cloud/get-tiny/self-hosted/
+ - Download "TinyMCE Dev Package". This package is needed because it includes
+ the `compat3x` plugin.
+ - Open the package and go to `js/tinymce`.
+ - Replace all the following files and folders:
+ * license.txt
+ * plugins
+ * charmap
+ * colorpicker
+ * compat3x
+ * directionality
+ * fullscreen
+ * hr
+ * image
+ * link
+ * lists
+ * media
+ * paste
+ * tabfocus
+ * textcolor
+ * skins
+ * lightgray
+ * themes
+ * inlite
+ * modern
+ * tinymce.js
+ * tinymce.min.js
+ - Go to the `compat3x` plugin folder and move `tiny_mce_popup.js` and `utils`
+ to the root directory. Delete the `img` folder. Revert `css/dialog.css`.
+ - Go to the `lightgray` skin folder and delete `content.mobile.min.css`,
+ `fonts/tinymce-mobile.woff`, `skin.min.css.map`, `skin.mobile.min.css` and
+ `skin.mobile.min.css.map`.
+ - After all these steps, there should normally not be any file additions or
+ deletions when you run `svn status`, only file modifications. If there are,
+ make sure it's intentional.
+ - Update the TinyMCE version in `src/wp-includes/version.php`. Use the
+ following format:
+ - Major version number.
+ - Minor version number.
+ - Patch version number, holding 2 places.
+ - A dash "-".
+ - The date: YYYYMMDD.
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> ## Single file dependencies
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcjs_enqueuesvendortinymcepluginscharmappluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/plugins/charmap/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/plugins/charmap/plugin.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/plugins/charmap/plugin.js 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,1275 +1,1275 @@
</span><span class="cx" style="display: block; padding: 0 10px"> (function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var charmap = (function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'use strict';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'use strict';
</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 global = tinymce.util.Tools.resolve('tinymce.PluginManager');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global = tinymce.util.Tools.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">- var fireInsertCustomChar = function (editor, chr) {
- return editor.fire('insertCustomChar', { chr: chr });
- };
- var $_ce2ncy9qjjgwebhk = { fireInsertCustomChar: fireInsertCustomChar };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fireInsertCustomChar = function (editor, chr) {
+ return editor.fire('insertCustomChar', { chr: chr });
+ };
+ var Events = { fireInsertCustomChar: fireInsertCustomChar };
</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 insertChar = function (editor, chr) {
- var evtChr = $_ce2ncy9qjjgwebhk.fireInsertCustomChar(editor, chr).chr;
- editor.execCommand('mceInsertContent', false, evtChr);
- };
- var $_el68bd9pjjgwebhj = { insertChar: insertChar };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var insertChar = function (editor, chr) {
+ var evtChr = Events.fireInsertCustomChar(editor, chr).chr;
+ editor.execCommand('mceInsertContent', false, evtChr);
+ };
+ var Actions = { insertChar: insertChar };
</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 global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$1 = tinymce.util.Tools.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">- var getCharMap = function (editor) {
- return editor.settings.charmap;
- };
- var getCharMapAppend = function (editor) {
- return editor.settings.charmap_append;
- };
- var $_5e4nos9tjjgwebhr = {
- getCharMap: getCharMap,
- getCharMapAppend: getCharMapAppend
- };
-
- var isArray = global$1.isArray;
- var getDefaultCharMap = function () {
- 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 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'
- ],
- [
- '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'
- ],
- [
- '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'
- ],
- [
- '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'
- ],
- [
- '8501',
- 'alef symbol'
- ],
- [
- '982',
- 'pi symbol'
- ],
- [
- '8476',
- 'real part symbol'
- ],
- [
- '978',
- 'upsilon - hook symbol'
- ],
- [
- '8472',
- 'Weierstrass p'
- ],
- [
- '8465',
- 'imaginary part'
- ],
- [
- '8592',
- 'leftwards arrow'
- ],
- [
- '8593',
- 'upwards arrow'
- ],
- [
- '8594',
- 'rightwards arrow'
- ],
- [
- '8595',
- 'downwards arrow'
- ],
- [
- '8596',
- 'left right arrow'
- ],
- [
- '8629',
- 'carriage return'
- ],
- [
- '8656',
- 'leftwards double arrow'
- ],
- [
- '8657',
- 'upwards double arrow'
- ],
- [
- '8658',
- 'rightwards double arrow'
- ],
- [
- '8659',
- 'downwards double arrow'
- ],
- [
- '8660',
- 'left right double arrow'
- ],
- [
- '8756',
- 'therefore'
- ],
- [
- '8834',
- 'subset of'
- ],
- [
- '8835',
- 'superset of'
- ],
- [
- '8836',
- 'not a subset of'
- ],
- [
- '8838',
- 'subset of or equal to'
- ],
- [
- '8839',
- 'superset of or equal to'
- ],
- [
- '8853',
- 'circled plus'
- ],
- [
- '8855',
- 'circled times'
- ],
- [
- '8869',
- 'perpendicular'
- ],
- [
- '8901',
- 'dot operator'
- ],
- [
- '8968',
- 'left ceiling'
- ],
- [
- '8969',
- 'right ceiling'
- ],
- [
- '8970',
- 'left floor'
- ],
- [
- '8971',
- 'right floor'
- ],
- [
- '9001',
- 'left-pointing angle bracket'
- ],
- [
- '9002',
- 'right-pointing angle bracket'
- ],
- [
- '9674',
- 'lozenge'
- ],
- [
- '9824',
- 'black spade suit'
- ],
- [
- '9827',
- 'black club suit'
- ],
- [
- '9829',
- 'black heart suit'
- ],
- [
- '9830',
- 'black diamond suit'
- ],
- [
- '8194',
- 'en space'
- ],
- [
- '8195',
- 'em space'
- ],
- [
- '8201',
- 'thin space'
- ],
- [
- '8204',
- 'zero width non-joiner'
- ],
- [
- '8205',
- 'zero width joiner'
- ],
- [
- '8206',
- 'left-to-right mark'
- ],
- [
- '8207',
- 'right-to-left mark'
- ]
- ];
- };
- var charmapFilter = function (charmap) {
- return global$1.grep(charmap, function (item) {
- return isArray(item) && item.length === 2;
- });
- };
- var getCharsFromSetting = function (settingValue) {
- if (isArray(settingValue)) {
- return [].concat(charmapFilter(settingValue));
- }
- if (typeof settingValue === 'function') {
- return settingValue();
- }
- return [];
- };
- var extendCharMap = function (editor, charmap) {
- var userCharMap = $_5e4nos9tjjgwebhr.getCharMap(editor);
- if (userCharMap) {
- charmap = getCharsFromSetting(userCharMap);
- }
- var userCharMapAppend = $_5e4nos9tjjgwebhr.getCharMapAppend(editor);
- if (userCharMapAppend) {
- return [].concat(charmap).concat(getCharsFromSetting(userCharMapAppend));
- }
- return charmap;
- };
- var getCharMap$1 = function (editor) {
- return extendCharMap(editor, getDefaultCharMap());
- };
- var $_dc8shd9rjjgwebhl = { getCharMap: getCharMap$1 };
-
- var get = function (editor) {
- var getCharMap = function () {
- return $_dc8shd9rjjgwebhl.getCharMap(editor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getCharMap = function (editor) {
+ return editor.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">- var insertChar = function (chr) {
- $_el68bd9pjjgwebhj.insertChar(editor, chr);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getCharMapAppend = function (editor) {
+ return editor.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">- return {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Settings = {
</ins><span class="cx" style="display: block; padding: 0 10px"> getCharMap: getCharMap,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- insertChar: insertChar
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ getCharMapAppend: getCharMapAppend
</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 $_gbufu29ojjgwebhf = { get: get };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var getHtml = function (charmap) {
- var gridHtml, x, y;
- var width = Math.min(charmap.length, 25);
- var height = Math.ceil(charmap.length / width);
- gridHtml = '<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';
- for (y = 0; y < height; y++) {
- gridHtml += '<tr>';
- for (x = 0; x < width; x++) {
- var index = y * width + x;
- if (index < charmap.length) {
- var chr = charmap[index];
- var charCode = parseInt(chr[0], 10);
- var chrText = chr ? String.fromCharCode(charCode) : ' ';
- gridHtml += '<td title="' + chr[1] + '">' + '<div tabindex="-1" title="' + chr[1] + '" role="button" data-chr="' + charCode + '">' + chrText + '</div>' + '</td>';
- } else {
- gridHtml += '<td />';
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isArray = global$1.isArray;
+ var getDefaultCharMap = function () {
+ 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 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'
+ ],
+ [
+ '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'
+ ],
+ [
+ '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'
+ ],
+ [
+ '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'
+ ],
+ [
+ '8501',
+ 'alef symbol'
+ ],
+ [
+ '982',
+ 'pi symbol'
+ ],
+ [
+ '8476',
+ 'real part symbol'
+ ],
+ [
+ '978',
+ 'upsilon - hook symbol'
+ ],
+ [
+ '8472',
+ 'Weierstrass p'
+ ],
+ [
+ '8465',
+ 'imaginary part'
+ ],
+ [
+ '8592',
+ 'leftwards arrow'
+ ],
+ [
+ '8593',
+ 'upwards arrow'
+ ],
+ [
+ '8594',
+ 'rightwards arrow'
+ ],
+ [
+ '8595',
+ 'downwards arrow'
+ ],
+ [
+ '8596',
+ 'left right arrow'
+ ],
+ [
+ '8629',
+ 'carriage return'
+ ],
+ [
+ '8656',
+ 'leftwards double arrow'
+ ],
+ [
+ '8657',
+ 'upwards double arrow'
+ ],
+ [
+ '8658',
+ 'rightwards double arrow'
+ ],
+ [
+ '8659',
+ 'downwards double arrow'
+ ],
+ [
+ '8660',
+ 'left right double arrow'
+ ],
+ [
+ '8756',
+ 'therefore'
+ ],
+ [
+ '8834',
+ 'subset of'
+ ],
+ [
+ '8835',
+ 'superset of'
+ ],
+ [
+ '8836',
+ 'not a subset of'
+ ],
+ [
+ '8838',
+ 'subset of or equal to'
+ ],
+ [
+ '8839',
+ 'superset of or equal to'
+ ],
+ [
+ '8853',
+ 'circled plus'
+ ],
+ [
+ '8855',
+ 'circled times'
+ ],
+ [
+ '8869',
+ 'perpendicular'
+ ],
+ [
+ '8901',
+ 'dot operator'
+ ],
+ [
+ '8968',
+ 'left ceiling'
+ ],
+ [
+ '8969',
+ 'right ceiling'
+ ],
+ [
+ '8970',
+ 'left floor'
+ ],
+ [
+ '8971',
+ 'right floor'
+ ],
+ [
+ '9001',
+ 'left-pointing angle bracket'
+ ],
+ [
+ '9002',
+ 'right-pointing angle bracket'
+ ],
+ [
+ '9674',
+ 'lozenge'
+ ],
+ [
+ '9824',
+ 'black spade suit'
+ ],
+ [
+ '9827',
+ 'black club suit'
+ ],
+ [
+ '9829',
+ 'black heart suit'
+ ],
+ [
+ '9830',
+ 'black diamond suit'
+ ],
+ [
+ '8194',
+ 'en space'
+ ],
+ [
+ '8195',
+ 'em space'
+ ],
+ [
+ '8201',
+ 'thin space'
+ ],
+ [
+ '8204',
+ 'zero width non-joiner'
+ ],
+ [
+ '8205',
+ 'zero width joiner'
+ ],
+ [
+ '8206',
+ 'left-to-right mark'
+ ],
+ [
+ '8207',
+ 'right-to-left mark'
+ ]
+ ];
+ };
+ var charmapFilter = function (charmap) {
+ return global$1.grep(charmap, function (item) {
+ return isArray(item) && item.length === 2;
+ });
+ };
+ var getCharsFromSetting = function (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">- gridHtml += '</tr>';
- }
- gridHtml += '</tbody></table>';
- return gridHtml;
- };
- var $_6avwgq9wjjgwebi2 = { getHtml: getHtml };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (typeof settingValue === 'function') {
+ return settingValue();
+ }
+ return [];
+ };
+ var extendCharMap = function (editor, charmap) {
+ var userCharMap = Settings.getCharMap(editor);
+ if (userCharMap) {
+ charmap = getCharsFromSetting(userCharMap);
+ }
+ var userCharMapAppend = Settings.getCharMapAppend(editor);
+ if (userCharMapAppend) {
+ return [].concat(charmap).concat(getCharsFromSetting(userCharMapAppend));
+ }
+ return charmap;
+ };
+ var getCharMap$1 = function (editor) {
+ return extendCharMap(editor, getDefaultCharMap());
+ };
+ var CharMap = { getCharMap: getCharMap$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">- var getParentTd = function (elm) {
- while (elm) {
- if (elm.nodeName === 'TD') {
- return elm;
- }
- elm = elm.parentNode;
- }
- };
- var open = function (editor) {
- var win;
- var charMapPanel = {
- type: 'container',
- html: $_6avwgq9wjjgwebi2.getHtml($_dc8shd9rjjgwebhl.getCharMap(editor)),
- onclick: function (e) {
- var target = e.target;
- if (/^(TD|DIV)$/.test(target.nodeName)) {
- var charDiv = getParentTd(target).firstChild;
- if (charDiv && charDiv.hasAttribute('data-chr')) {
- var charCodeString = charDiv.getAttribute('data-chr');
- var charCode = parseInt(charCodeString, 10);
- if (!isNaN(charCode)) {
- $_el68bd9pjjgwebhj.insertChar(editor, String.fromCharCode(charCode));
- }
- if (!e.ctrlKey) {
- win.close();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var get = function (editor) {
+ var getCharMap = function () {
+ return CharMap.getCharMap(editor);
+ };
+ var insertChar = function (chr) {
+ Actions.insertChar(editor, chr);
+ };
+ return {
+ getCharMap: getCharMap,
+ insertChar: insertChar
+ };
+ };
+ var Api = { get: get };
+
+ var getHtml = function (charmap) {
+ var gridHtml, x, y;
+ var width = Math.min(charmap.length, 25);
+ var height = Math.ceil(charmap.length / width);
+ gridHtml = '<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>';
+ for (y = 0; y < height; y++) {
+ gridHtml += '<tr>';
+ for (x = 0; x < width; x++) {
+ var index = y * width + x;
+ if (index < charmap.length) {
+ var chr = charmap[index];
+ var charCode = parseInt(chr[0], 10);
+ var chrText = chr ? String.fromCharCode(charCode) : ' ';
+ gridHtml += '<td title="' + chr[1] + '">' + '<div tabindex="-1" title="' + chr[1] + '" role="button" data-chr="' + charCode + '">' + chrText + '</div>' + '</td>';
+ } else {
+ gridHtml += '<td />';
</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">- },
- onmouseover: function (e) {
- var td = getParentTd(e.target);
- 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">+ gridHtml += '</tr>';
+ }
+ gridHtml += '</tbody></table>';
+ return gridHtml;
+ };
+ var GridHtml = { getHtml: getHtml };
+
+ var getParentTd = function (elm) {
+ while (elm) {
+ if (elm.nodeName === 'TD') {
+ return elm;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><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><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: 'spacer',
- minHeight: 20
- },
- {
- type: 'label',
- name: 'previewTitle',
- text: ' ',
- style: 'white-space: pre-wrap;',
- border: 1,
- minWidth: 140
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var open = function (editor) {
+ var win;
+ var charMapPanel = {
+ type: 'container',
+ html: GridHtml.getHtml(CharMap.getCharMap(editor)),
+ onclick: function (e) {
+ var target = e.target;
+ if (/^(TD|DIV)$/.test(target.nodeName)) {
+ var charDiv = getParentTd(target).firstChild;
+ if (charDiv && charDiv.hasAttribute('data-chr')) {
+ var charCodeString = charDiv.getAttribute('data-chr');
+ var charCode = parseInt(charCodeString, 10);
+ if (!isNaN(charCode)) {
+ Actions.insertChar(editor, String.fromCharCode(charCode));
+ }
+ if (!e.ctrlKey) {
+ 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">- ]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ },
+ onmouseover: function (e) {
+ var td = getParentTd(e.target);
+ 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">- ],
- buttons: [{
- text: 'Close',
- onclick: function () {
- win.close();
</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: 'spacer',
+ minHeight: 20
+ },
+ {
+ type: 'label',
+ name: 'previewTitle',
+ text: ' ',
+ style: 'white-space: pre-wrap;',
+ border: 1,
+ minWidth: 140
+ }
+ ]
</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 $_3eaa3c9vjjgwebht = { open: open };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ],
+ buttons: [{
+ text: 'Close',
+ onclick: function () {
+ win.close();
+ }
+ }]
+ });
+ };
+ var Dialog = { open: open };
</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 register = function (editor) {
- editor.addCommand('mceShowCharmap', function () {
- $_3eaa3c9vjjgwebht.open(editor);
- });
- };
- var $_b5cdu19ujjgwebhs = { register: register };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register = function (editor) {
+ editor.addCommand('mceShowCharmap', function () {
+ Dialog.open(editor);
+ });
+ };
+ var Commands = { register: register };
</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 register$1 = function (editor) {
- editor.addButton('charmap', {
- icon: 'charmap',
- tooltip: 'Special character',
- cmd: 'mceShowCharmap'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register$1 = function (editor) {
+ editor.addButton('charmap', {
+ icon: 'charmap',
+ tooltip: 'Special character',
+ cmd: 'mceShowCharmap'
+ });
+ editor.addMenuItem('charmap', {
+ icon: 'charmap',
+ text: 'Special character',
+ cmd: 'mceShowCharmap',
+ context: 'insert'
+ });
+ };
+ var Buttons = { register: register$1 };
+
+ global.add('charmap', function (editor) {
+ Commands.register(editor);
+ Buttons.register(editor);
+ return Api.get(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">- editor.addMenuItem('charmap', {
- icon: 'charmap',
- text: 'Special character',
- cmd: 'mceShowCharmap',
- context: 'insert'
- });
- };
- var $_19iu2m9xjjgwebi3 = { register: register$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function Plugin () {
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global.add('charmap', function (editor) {
- $_b5cdu19ujjgwebhs.register(editor);
- $_19iu2m9xjjgwebi3.register(editor);
- return $_gbufu29ojjgwebhf.get(editor);
- });
- function Plugin () {
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Plugin;
</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 Plugin;
-
</del><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="trunksrcjs_enqueuesvendortinymcepluginscolorpickerpluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/plugins/colorpicker/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/plugins/colorpicker/plugin.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/plugins/colorpicker/plugin.js 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,126 +1,126 @@
</span><span class="cx" style="display: block; padding: 0 10px"> (function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var colorpicker = (function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'use strict';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'use strict';
</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 global = tinymce.util.Tools.resolve('tinymce.PluginManager');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global = tinymce.util.Tools.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">- var global$1 = tinymce.util.Tools.resolve('tinymce.util.Color');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$1 = tinymce.util.Tools.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">- var showPreview = function (win, hexColor) {
- win.find('#preview')[0].getEl().style.background = hexColor;
- };
- var setColor = function (win, value) {
- var color = global$1(value), rgb = color.toRgb();
- win.fromJSON({
- r: rgb.r,
- g: rgb.g,
- b: rgb.b,
- hex: color.toHex().substr(1)
- });
- showPreview(win, color.toHex());
- };
- var open = function (editor, callback, value) {
- 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();
- 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(win, this.value());
- }
- }
- },
- {
- type: 'form',
- padding: 0,
- labelGap: 5,
- defaults: {
- type: 'textbox',
- size: 7,
- value: '0',
- flex: 1,
- spellcheck: false,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var showPreview = function (win, hexColor) {
+ win.find('#preview')[0].getEl().style.background = hexColor;
+ };
+ var setColor = function (win, value) {
+ var color = global$1(value), rgb = color.toRgb();
+ win.fromJSON({
+ r: rgb.r,
+ g: rgb.g,
+ b: rgb.b,
+ hex: color.toHex().substr(1)
+ });
+ showPreview(win, color.toHex());
+ };
+ var open = function (editor, callback, value) {
+ 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,
</ins><span class="cx" style="display: block; padding: 0 10px"> onchange: function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var colorPickerCtrl = win.find('colorpicker')[0];
- var name, value;
- name = this.name();
- value = this.value();
- if (name === 'hex') {
- value = '#' + value;
- setColor(win, value);
- colorPickerCtrl.value(value);
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var rgb = this.rgb();
+ 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(win, 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">- value = {
- r: win.find('#r').value(),
- g: win.find('#g').value(),
- b: win.find('#b').value()
- };
- colorPickerCtrl.value(value);
- setColor(win, value);
</del><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">- items: [
- {
- name: 'r',
- label: 'R',
- autofocus: 1
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ {
+ 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;
+ name = this.name();
+ value = this.value();
+ if (name === 'hex') {
+ value = '#' + value;
+ setColor(win, value);
+ colorPickerCtrl.value(value);
+ return;
+ }
+ value = {
+ r: win.find('#r').value(),
+ g: win.find('#g').value(),
+ b: win.find('#b').value()
+ };
+ colorPickerCtrl.value(value);
+ setColor(win, 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">- {
- name: 'g',
- label: 'G'
- },
- {
- name: 'b',
- label: 'B'
- },
- {
- name: 'hex',
- label: '#',
- value: '000000'
- },
- {
- name: 'preview',
- type: 'container',
- border: 1
- }
- ]
- }
- ]
- },
- onSubmit: function () {
- callback('#' + win.toJSON().hex);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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('#' + win.toJSON().hex);
+ }
+ });
+ setColor(win, value);
+ };
+ var Dialog = { open: open };
+
+ global.add('colorpicker', function (editor) {
+ if (!editor.settings.color_picker_callback) {
+ editor.settings.color_picker_callback = function (callback, value) {
+ Dialog.open(editor, callback, value);
+ };
</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">- setColor(win, value);
- };
- var $_2gqaphanjjgwebmu = { open: open };
-
- global.add('colorpicker', function (editor) {
- if (!editor.settings.color_picker_callback) {
- editor.settings.color_picker_callback = function (callback, value) {
- $_2gqaphanjjgwebmu.open(editor, callback, value);
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function Plugin () {
</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 Plugin () {
- }
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return Plugin;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Plugin;
</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="trunksrcjs_enqueuesvendortinymcepluginsdirectionalitypluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/plugins/directionality/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/plugins/directionality/plugin.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/plugins/directionality/plugin.js 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,66 +1,66 @@
</span><span class="cx" style="display: block; padding: 0 10px"> (function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var directionality = (function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'use strict';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'use strict';
</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 global = tinymce.util.Tools.resolve('tinymce.PluginManager');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global = tinymce.util.Tools.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">- var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$1 = tinymce.util.Tools.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">- var setDir = function (editor, dir) {
- var dom = editor.dom;
- var curDir;
- var blocks = editor.selection.getSelectedBlocks();
- if (blocks.length) {
- curDir = dom.getAttrib(blocks[0], 'dir');
- global$1.each(blocks, function (block) {
- if (!dom.getParent(block.parentNode, '*[dir="' + dir + '"]', dom.getRoot())) {
- dom.setAttrib(block, 'dir', curDir !== dir ? dir : null);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setDir = function (editor, dir) {
+ var dom = editor.dom;
+ var curDir;
+ var blocks = editor.selection.getSelectedBlocks();
+ if (blocks.length) {
+ curDir = dom.getAttrib(blocks[0], 'dir');
+ global$1.each(blocks, function (block) {
+ if (!dom.getParent(block.parentNode, '*[dir="' + dir + '"]', dom.getRoot())) {
+ dom.setAttrib(block, 'dir', curDir !== dir ? dir : null);
+ }
+ });
+ editor.nodeChanged();
+ }
+ };
+ var Direction = { setDir: setDir };
+
+ var register = function (editor) {
+ editor.addCommand('mceDirectionLTR', function () {
+ Direction.setDir(editor, 'ltr');
</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();
- }
- };
- var $_fd54yfb4jjgwebo5 = { setDir: setDir };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.addCommand('mceDirectionRTL', function () {
+ Direction.setDir(editor, 'rtl');
+ });
+ };
+ var Commands = { register: register };
</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 register = function (editor) {
- editor.addCommand('mceDirectionLTR', function () {
- $_fd54yfb4jjgwebo5.setDir(editor, 'ltr');
- });
- editor.addCommand('mceDirectionRTL', function () {
- $_fd54yfb4jjgwebo5.setDir(editor, 'rtl');
- });
- };
- var $_cpb3fob3jjgwebo4 = { register: register };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var generateSelector = function (dir) {
+ var selector = [];
+ global$1.each('h1 h2 h3 h4 h5 h6 div p'.split(' '), function (name) {
+ selector.push(name + '[dir=' + dir + ']');
+ });
+ return selector.join(',');
+ };
+ var register$1 = function (editor) {
+ editor.addButton('ltr', {
+ title: 'Left to right',
+ cmd: 'mceDirectionLTR',
+ stateSelector: generateSelector('ltr')
+ });
+ editor.addButton('rtl', {
+ title: 'Right to left',
+ cmd: 'mceDirectionRTL',
+ stateSelector: generateSelector('rtl')
+ });
+ };
+ var Buttons = { register: register$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">- var generateSelector = function (dir) {
- var selector = [];
- global$1.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">+ global.add('directionality', function (editor) {
+ Commands.register(editor);
+ Buttons.register(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 selector.join(',');
- };
- var register$1 = function (editor) {
- editor.addButton('ltr', {
- title: 'Left to right',
- cmd: 'mceDirectionLTR',
- stateSelector: generateSelector('ltr')
- });
- editor.addButton('rtl', {
- title: 'Right to left',
- cmd: 'mceDirectionRTL',
- stateSelector: generateSelector('rtl')
- });
- };
- var $_8ch9fzb6jjgwebo7 = { register: register$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function Plugin () {
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global.add('directionality', function (editor) {
- $_cpb3fob3jjgwebo4.register(editor);
- $_8ch9fzb6jjgwebo7.register(editor);
- });
- function Plugin () {
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Plugin;
</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 Plugin;
-
</del><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="trunksrcjs_enqueuesvendortinymcepluginsfullscreenpluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/plugins/fullscreen/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/plugins/fullscreen/plugin.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/plugins/fullscreen/plugin.js 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,177 +1,177 @@
</span><span class="cx" style="display: block; padding: 0 10px"> (function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var fullscreen = (function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'use strict';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'use strict';
</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 Cell = function (initial) {
- var value = initial;
- var get = function () {
- return value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Cell = function (initial) {
+ var value = initial;
+ var get = function () {
+ return value;
+ };
+ var set = function (v) {
+ value = v;
+ };
+ var clone = function () {
+ return Cell(get());
+ };
+ return {
+ get: get,
+ set: set,
+ clone: clone
+ };
</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 set = function (v) {
- value = v;
- };
- var clone = function () {
- return Cell(get());
- };
- return {
- get: get,
- set: set,
- clone: clone
- };
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global = tinymce.util.Tools.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">- var get = function (fullscreenState) {
- return {
- isFullscreen: function () {
- return fullscreenState.get() !== null;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var get = function (fullscreenState) {
+ return {
+ isFullscreen: function () {
+ return fullscreenState.get() !== 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">- };
- var $_6qfcwucejjgwebu0 = { get: get };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Api = { get: get };
</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 global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$1 = tinymce.util.Tools.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">- var fireFullscreenStateChanged = function (editor, state) {
- editor.fire('FullscreenStateChanged', { state: state });
- };
- var $_en5ltwcijjgwebu6 = { fireFullscreenStateChanged: fireFullscreenStateChanged };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fireFullscreenStateChanged = function (editor, state) {
+ editor.fire('FullscreenStateChanged', { state: state });
+ };
+ var Events = { fireFullscreenStateChanged: fireFullscreenStateChanged };
</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 DOM = global$1.DOM;
- var getWindowSize = function () {
- var w;
- var h;
- var win = window;
- var doc = document;
- var body = doc.body;
- if (body.offsetWidth) {
- w = body.offsetWidth;
- h = body.offsetHeight;
- }
- if (win.innerWidth && win.innerHeight) {
- w = win.innerWidth;
- h = win.innerHeight;
- }
- return {
- w: w,
- h: h
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var DOM = global$1.DOM;
+ var getWindowSize = function () {
+ var w;
+ var h;
+ var win = window;
+ var doc = document;
+ var body = doc.body;
+ if (body.offsetWidth) {
+ w = body.offsetWidth;
+ h = body.offsetHeight;
+ }
+ if (win.innerWidth && win.innerHeight) {
+ w = win.innerWidth;
+ h = win.innerHeight;
+ }
+ 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">- };
- var getScrollPos = function () {
- var vp = DOM.getViewPort();
- return {
- x: vp.x,
- y: vp.y
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getScrollPos = function () {
+ var vp = DOM.getViewPort();
+ 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">- };
- var setScrollPos = function (pos) {
- window.scrollTo(pos.x, pos.y);
- };
- var toggleFullscreen = function (editor, fullscreenState) {
- var body = document.body;
- var documentElement = document.documentElement;
- var editorContainerStyle;
- var editorContainer, iframe, iframeStyle;
- var fullscreenInfo = fullscreenState.get();
- var resize = function () {
- DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setScrollPos = function (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">- var removeResize = function () {
- DOM.unbind(window, 'resize', resize);
- };
- editorContainer = editor.getContainer();
- editorContainerStyle = editorContainer.style;
- iframe = editor.getContentAreaContainer().firstChild;
- iframeStyle = iframe.style;
- if (!fullscreenInfo) {
- var newFullScreenInfo = {
- scrollPos: getScrollPos(),
- containerWidth: editorContainerStyle.width,
- containerHeight: editorContainerStyle.height,
- iframeWidth: iframeStyle.width,
- iframeHeight: iframeStyle.height,
- resizeHandler: resize,
- removeHandler: removeResize
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var toggleFullscreen = function (editor, fullscreenState) {
+ var body = document.body;
+ var documentElement = document.documentElement;
+ var editorContainerStyle;
+ var editorContainer, iframe, iframeStyle;
+ var fullscreenInfo = fullscreenState.get();
+ var resize = function () {
+ 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">- iframeStyle.width = iframeStyle.height = '100%';
- editorContainerStyle.width = editorContainerStyle.height = '';
- DOM.addClass(body, 'mce-fullscreen');
- DOM.addClass(documentElement, 'mce-fullscreen');
- DOM.addClass(editorContainer, 'mce-fullscreen');
- DOM.bind(window, 'resize', resize);
- editor.on('remove', removeResize);
- resize();
- fullscreenState.set(newFullScreenInfo);
- $_en5ltwcijjgwebu6.fireFullscreenStateChanged(editor, true);
- } else {
- iframeStyle.width = fullscreenInfo.iframeWidth;
- iframeStyle.height = fullscreenInfo.iframeHeight;
- if (fullscreenInfo.containerWidth) {
- editorContainerStyle.width = fullscreenInfo.containerWidth;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var removeResize = function () {
+ DOM.unbind(window, 'resize', resize);
+ };
+ editorContainer = editor.getContainer();
+ editorContainerStyle = editorContainer.style;
+ iframe = editor.getContentAreaContainer().firstChild;
+ iframeStyle = iframe.style;
+ if (!fullscreenInfo) {
+ var newFullScreenInfo = {
+ scrollPos: getScrollPos(),
+ containerWidth: editorContainerStyle.width,
+ containerHeight: editorContainerStyle.height,
+ iframeWidth: iframeStyle.width,
+ iframeHeight: iframeStyle.height,
+ resizeHandler: resize,
+ removeHandler: removeResize
+ };
+ iframeStyle.width = iframeStyle.height = '100%';
+ editorContainerStyle.width = editorContainerStyle.height = '';
+ DOM.addClass(body, 'mce-fullscreen');
+ DOM.addClass(documentElement, 'mce-fullscreen');
+ DOM.addClass(editorContainer, 'mce-fullscreen');
+ DOM.bind(window, 'resize', resize);
+ editor.on('remove', removeResize);
+ resize();
+ fullscreenState.set(newFullScreenInfo);
+ Events.fireFullscreenStateChanged(editor, true);
+ } else {
+ iframeStyle.width = fullscreenInfo.iframeWidth;
+ iframeStyle.height = fullscreenInfo.iframeHeight;
+ if (fullscreenInfo.containerWidth) {
+ editorContainerStyle.width = fullscreenInfo.containerWidth;
+ }
+ if (fullscreenInfo.containerHeight) {
+ editorContainerStyle.height = fullscreenInfo.containerHeight;
+ }
+ DOM.removeClass(body, 'mce-fullscreen');
+ DOM.removeClass(documentElement, 'mce-fullscreen');
+ DOM.removeClass(editorContainer, 'mce-fullscreen');
+ setScrollPos(fullscreenInfo.scrollPos);
+ DOM.unbind(window, 'resize', fullscreenInfo.resizeHandler);
+ editor.off('remove', fullscreenInfo.removeHandler);
+ fullscreenState.set(null);
+ Events.fireFullscreenStateChanged(editor, 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 (fullscreenInfo.containerHeight) {
- editorContainerStyle.height = fullscreenInfo.containerHeight;
- }
- DOM.removeClass(body, 'mce-fullscreen');
- DOM.removeClass(documentElement, 'mce-fullscreen');
- DOM.removeClass(editorContainer, 'mce-fullscreen');
- setScrollPos(fullscreenInfo.scrollPos);
- DOM.unbind(window, 'resize', fullscreenInfo.resizeHandler);
- editor.off('remove', fullscreenInfo.removeHandler);
- fullscreenState.set(null);
- $_en5ltwcijjgwebu6.fireFullscreenStateChanged(editor, false);
- }
- };
- var $_dvg07kcgjjgwebu3 = { toggleFullscreen: toggleFullscreen };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var Actions = { toggleFullscreen: 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">- var register = function (editor, fullscreenState) {
- editor.addCommand('mceFullScreen', function () {
- $_dvg07kcgjjgwebu3.toggleFullscreen(editor, fullscreenState);
- });
- };
- var $_bebdcrcfjjgwebu1 = { register: register };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register = function (editor, fullscreenState) {
+ editor.addCommand('mceFullScreen', function () {
+ Actions.toggleFullscreen(editor, fullscreenState);
+ });
+ };
+ var Commands = { register: register };
</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 postRender = function (editor) {
- return function (e) {
- var ctrl = e.control;
- editor.on('FullscreenStateChanged', function (e) {
- ctrl.active(e.state);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var postRender = function (editor) {
+ return function (e) {
+ var ctrl = e.control;
+ editor.on('FullscreenStateChanged', function (e) {
+ ctrl.active(e.state);
+ });
+ };
+ };
+ var register$1 = function (editor) {
+ editor.addMenuItem('fullscreen', {
+ text: 'Fullscreen',
+ shortcut: 'Ctrl+Shift+F',
+ selectable: true,
+ cmd: 'mceFullScreen',
+ onPostRender: postRender(editor),
+ context: 'view'
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.addButton('fullscreen', {
+ active: false,
+ tooltip: 'Fullscreen',
+ cmd: 'mceFullScreen',
+ onPostRender: postRender(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">- };
- var register$1 = function (editor) {
- editor.addMenuItem('fullscreen', {
- text: 'Fullscreen',
- shortcut: 'Ctrl+Shift+F',
- selectable: true,
- cmd: 'mceFullScreen',
- onPostRender: postRender(editor),
- context: 'view'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Buttons = { register: register$1 };
+
+ global.add('fullscreen', function (editor) {
+ var fullscreenState = Cell(null);
+ if (editor.settings.inline) {
+ return Api.get(fullscreenState);
+ }
+ Commands.register(editor, fullscreenState);
+ Buttons.register(editor);
+ editor.addShortcut('Ctrl+Shift+F', '', 'mceFullScreen');
+ return Api.get(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.addButton('fullscreen', {
- active: false,
- tooltip: 'Fullscreen',
- cmd: 'mceFullScreen',
- onPostRender: postRender(editor)
- });
- };
- var $_tne4sckjjgwebuo = { register: register$1 };
-
- global.add('fullscreen', function (editor) {
- var fullscreenState = Cell(null);
- if (editor.settings.inline) {
- return $_6qfcwucejjgwebu0.get(fullscreenState);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function Plugin () {
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_bebdcrcfjjgwebu1.register(editor, fullscreenState);
- $_tne4sckjjgwebuo.register(editor);
- editor.addShortcut('Ctrl+Shift+F', '', 'mceFullScreen');
- return $_6qfcwucejjgwebu0.get(fullscreenState);
- });
- function Plugin () {
- }
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return Plugin;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Plugin;
</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="trunksrcjs_enqueuesvendortinymcepluginshrpluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/plugins/hr/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/plugins/hr/plugin.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/plugins/hr/plugin.js 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,39 +1,39 @@
</span><span class="cx" style="display: block; padding: 0 10px"> (function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var hr = (function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'use strict';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'use strict';
</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 global = tinymce.util.Tools.resolve('tinymce.PluginManager');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global = tinymce.util.Tools.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">- var register = function (editor) {
- editor.addCommand('InsertHorizontalRule', function () {
- editor.execCommand('mceInsertContent', false, '<hr />');
- });
- };
- var $_cqh592cnjjgwebvk = { register: register };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register = function (editor) {
+ editor.addCommand('InsertHorizontalRule', function () {
+ editor.execCommand('mceInsertContent', false, '<hr />');
+ });
+ };
+ var Commands = { register: register };
</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 register$1 = function (editor) {
- editor.addButton('hr', {
- icon: 'hr',
- tooltip: 'Horizontal line',
- cmd: 'InsertHorizontalRule'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register$1 = function (editor) {
+ editor.addButton('hr', {
+ icon: 'hr',
+ tooltip: 'Horizontal line',
+ cmd: 'InsertHorizontalRule'
+ });
+ editor.addMenuItem('hr', {
+ icon: 'hr',
+ text: 'Horizontal line',
+ cmd: 'InsertHorizontalRule',
+ context: 'insert'
+ });
+ };
+ var Buttons = { register: register$1 };
+
+ global.add('hr', function (editor) {
+ Commands.register(editor);
+ Buttons.register(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">- editor.addMenuItem('hr', {
- icon: 'hr',
- text: 'Horizontal line',
- cmd: 'InsertHorizontalRule',
- context: 'insert'
- });
- };
- var $_13g834cojjgwebvl = { register: register$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function Plugin () {
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global.add('hr', function (editor) {
- $_cqh592cnjjgwebvk.register(editor);
- $_13g834cojjgwebvl.register(editor);
- });
- function Plugin () {
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Plugin;
</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 Plugin;
-
</del><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="trunksrcjs_enqueuesvendortinymcepluginsimagepluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/plugins/image/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/plugins/image/plugin.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/plugins/image/plugin.js 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,1211 +1,1204 @@
</span><span class="cx" style="display: block; padding: 0 10px"> (function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var image = (function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'use strict';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'use strict';
</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 global = tinymce.util.Tools.resolve('tinymce.PluginManager');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global = tinymce.util.Tools.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">- var hasDimensions = function (editor) {
- return editor.settings.image_dimensions === false ? false : true;
- };
- var hasAdvTab = function (editor) {
- return editor.settings.image_advtab === true ? true : false;
- };
- var getPrependUrl = function (editor) {
- return editor.getParam('image_prepend_url', '');
- };
- var getClassList = function (editor) {
- return editor.getParam('image_class_list');
- };
- var hasDescription = function (editor) {
- return editor.settings.image_description === false ? false : true;
- };
- var hasImageTitle = function (editor) {
- return editor.settings.image_title === true ? true : false;
- };
- var hasImageCaption = function (editor) {
- return editor.settings.image_caption === true ? true : false;
- };
- var getImageList = function (editor) {
- return editor.getParam('image_list', false);
- };
- var hasUploadUrl = function (editor) {
- return editor.getParam('images_upload_url', false);
- };
- var hasUploadHandler = function (editor) {
- return editor.getParam('images_upload_handler', false);
- };
- var getUploadUrl = function (editor) {
- return editor.getParam('images_upload_url');
- };
- var getUploadHandler = function (editor) {
- return editor.getParam('images_upload_handler');
- };
- var getUploadBasePath = function (editor) {
- return editor.getParam('images_upload_base_path');
- };
- var getUploadCredentials = function (editor) {
- return editor.getParam('images_upload_credentials');
- };
- var $_1dn8wtctjjgwebvz = {
- hasDimensions: hasDimensions,
- hasAdvTab: hasAdvTab,
- getPrependUrl: getPrependUrl,
- getClassList: getClassList,
- hasDescription: hasDescription,
- hasImageTitle: hasImageTitle,
- hasImageCaption: hasImageCaption,
- getImageList: getImageList,
- hasUploadUrl: hasUploadUrl,
- hasUploadHandler: hasUploadHandler,
- getUploadUrl: getUploadUrl,
- getUploadHandler: getUploadHandler,
- getUploadBasePath: getUploadBasePath,
- getUploadCredentials: getUploadCredentials
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasDimensions = function (editor) {
+ return editor.settings.image_dimensions === false ? false : true;
+ };
+ var hasAdvTab = function (editor) {
+ return editor.settings.image_advtab === true ? true : false;
+ };
+ var getPrependUrl = function (editor) {
+ return editor.getParam('image_prepend_url', '');
+ };
+ var getClassList = function (editor) {
+ return editor.getParam('image_class_list');
+ };
+ var hasDescription = function (editor) {
+ return editor.settings.image_description === false ? false : true;
+ };
+ var hasImageTitle = function (editor) {
+ return editor.settings.image_title === true ? true : false;
+ };
+ var hasImageCaption = function (editor) {
+ return editor.settings.image_caption === true ? true : false;
+ };
+ var getImageList = function (editor) {
+ return editor.getParam('image_list', false);
+ };
+ var hasUploadUrl = function (editor) {
+ return editor.getParam('images_upload_url', false);
+ };
+ var hasUploadHandler = function (editor) {
+ return editor.getParam('images_upload_handler', false);
+ };
+ var getUploadUrl = function (editor) {
+ return editor.getParam('images_upload_url');
+ };
+ var getUploadHandler = function (editor) {
+ return editor.getParam('images_upload_handler');
+ };
+ var getUploadBasePath = function (editor) {
+ return editor.getParam('images_upload_base_path');
+ };
+ var getUploadCredentials = function (editor) {
+ return editor.getParam('images_upload_credentials');
+ };
+ var Settings = {
+ hasDimensions: hasDimensions,
+ hasAdvTab: hasAdvTab,
+ getPrependUrl: getPrependUrl,
+ getClassList: getClassList,
+ hasDescription: hasDescription,
+ hasImageTitle: hasImageTitle,
+ hasImageCaption: hasImageCaption,
+ getImageList: getImageList,
+ hasUploadUrl: hasUploadUrl,
+ hasUploadHandler: hasUploadHandler,
+ getUploadUrl: getUploadUrl,
+ getUploadHandler: getUploadHandler,
+ getUploadBasePath: getUploadBasePath,
+ getUploadCredentials: getUploadCredentials
+ };
</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 Global = typeof window !== 'undefined' ? window : Function('return this;')();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Global = typeof window !== 'undefined' ? window : Function('return 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">- var path = function (parts, scope) {
- var o = scope !== undefined && scope !== null ? scope : Global;
- for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i)
- o = o[parts[i]];
- return o;
- };
- var resolve = function (p, scope) {
- var parts = p.split('.');
- return path(parts, scope);
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var path = function (parts, scope) {
+ var o = scope !== undefined && scope !== null ? scope : Global;
+ for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i)
+ o = o[parts[i]];
+ return o;
+ };
+ var resolve = function (p, scope) {
+ var parts = p.split('.');
+ return path(parts, scope);
+ };
</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 unsafe = function (name, scope) {
- return resolve(name, scope);
- };
- var getOrDie = function (name, scope) {
- var actual = unsafe(name, scope);
- if (actual === undefined || actual === null)
- throw name + ' not available on this browser';
- return actual;
- };
- var $_oab1bcwjjgwebwl = { getOrDie: getOrDie };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var unsafe = function (name, scope) {
+ return resolve(name, scope);
+ };
+ var getOrDie = function (name, scope) {
+ var actual = unsafe(name, scope);
+ if (actual === undefined || actual === null)
+ throw name + ' not available on this browser';
+ return actual;
+ };
+ var Global$1 = { getOrDie: getOrDie };
</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 FileReader () {
- var f = $_oab1bcwjjgwebwl.getOrDie('FileReader');
- return new f();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function FileReader () {
+ var f = Global$1.getOrDie('FileReader');
+ return new f();
+ }
</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 global$1 = tinymce.util.Tools.resolve('tinymce.util.Promise');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$1 = tinymce.util.Tools.resolve('tinymce.util.Promise');
</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 global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$2 = tinymce.util.Tools.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">- var global$3 = tinymce.util.Tools.resolve('tinymce.util.XHR');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$3 = tinymce.util.Tools.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">- var parseIntAndGetMax = function (val1, val2) {
- return Math.max(parseInt(val1, 10), parseInt(val2, 10));
- };
- var getImageSize = function (url, callback) {
- var img = document.createElement('img');
- 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">+ var parseIntAndGetMax = function (val1, val2) {
+ return Math.max(parseInt(val1, 10), parseInt(val2, 10));
+ };
+ var getImageSize = function (url, callback) {
+ var img = document.createElement('img');
+ function done(width, height) {
+ if (img.parentNode) {
+ img.parentNode.removeChild(img);
+ }
+ 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">- callback({
- width: width,
- height: height
- });
- }
- img.onload = function () {
- var width = parseIntAndGetMax(img.width, img.clientWidth);
- var height = parseIntAndGetMax(img.height, img.clientHeight);
- done(width, height);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ img.onload = function () {
+ var width = parseIntAndGetMax(img.width, img.clientWidth);
+ var height = parseIntAndGetMax(img.height, img.clientHeight);
+ done(width, height);
+ };
+ img.onerror = function () {
+ done(0, 0);
+ };
+ var style = img.style;
+ style.visibility = 'hidden';
+ style.position = 'fixed';
+ style.bottom = style.left = '0px';
+ style.width = style.height = 'auto';
+ 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">- img.onerror = function () {
- done(0, 0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var buildListItems = function (inputList, itemCallback, startItems) {
+ function appendItems(values, output) {
+ output = output || [];
+ global$2.each(values, function (item) {
+ var menuItem = { text: item.text || item.title };
+ if (item.menu) {
+ menuItem.menu = appendItems(item.menu);
+ } else {
+ menuItem.value = item.value;
+ itemCallback(menuItem);
+ }
+ output.push(menuItem);
+ });
+ return output;
+ }
+ 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">- var style = img.style;
- style.visibility = 'hidden';
- style.position = 'fixed';
- style.bottom = style.left = '0px';
- style.width = style.height = 'auto';
- document.body.appendChild(img);
- img.src = url;
- };
- var buildListItems = function (inputList, itemCallback, startItems) {
- function appendItems(values, output) {
- output = output || [];
- global$2.each(values, function (item) {
- var menuItem = { text: item.text || item.title };
- if (item.menu) {
- menuItem.menu = appendItems(item.menu);
- } else {
- menuItem.value = item.value;
- itemCallback(menuItem);
- }
- output.push(menuItem);
- });
- return output;
- }
- return appendItems(inputList, startItems || []);
- };
- var removePixelSuffix = function (value) {
- if (value) {
- value = value.replace(/px$/, '');
- }
- return value;
- };
- var addPixelSuffix = function (value) {
- if (value.length > 0 && /^[0-9]+$/.test(value)) {
- value += 'px';
- }
- return value;
- };
- var mergeMargins = function (css) {
- if (css.margin) {
- var splitMargin = css.margin.split(' ');
- switch (splitMargin.length) {
- case 1:
- 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:
- 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:
- 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:
- 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];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var removePixelSuffix = function (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">- delete css.margin;
- }
- return css;
- };
- var createImageList = function (editor, callback) {
- var imageList = $_1dn8wtctjjgwebvz.getImageList(editor);
- if (typeof imageList === 'string') {
- global$3.send({
- url: imageList,
- success: function (text) {
- callback(JSON.parse(text));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return value;
+ };
+ var addPixelSuffix = function (value) {
+ if (value.length > 0 && /^[0-9]+$/.test(value)) {
+ value += 'px';
+ }
+ return value;
+ };
+ var mergeMargins = function (css) {
+ if (css.margin) {
+ var splitMargin = css.margin.split(' ');
+ switch (splitMargin.length) {
+ case 1:
+ 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:
+ 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:
+ 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:
+ 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];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- } else if (typeof imageList === 'function') {
- imageList(callback);
- } else {
- callback(imageList);
- }
- };
- var waitLoadImage = function (editor, data, imgElm) {
- function selectImage() {
- imgElm.onload = imgElm.onerror = null;
- if (editor.selection) {
- editor.selection.select(imgElm);
- editor.nodeChanged();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ delete 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">- }
- imgElm.onload = function () {
- if (!data.width && !data.height && $_1dn8wtctjjgwebvz.hasDimensions(editor)) {
- editor.dom.setAttribs(imgElm, {
- width: imgElm.clientWidth,
- height: imgElm.clientHeight
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return css;
+ };
+ var createImageList = function (editor, callback) {
+ var imageList = Settings.getImageList(editor);
+ if (typeof imageList === 'string') {
+ global$3.send({
+ url: imageList,
+ success: function (text) {
+ callback(JSON.parse(text));
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } 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">- selectImage();
</del><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;
- };
- var blobToDataUri = function (blob) {
- return new global$1(function (resolve, reject) {
- var reader = new FileReader();
- reader.onload = function () {
- resolve(reader.result);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var waitLoadImage = function (editor, data, imgElm) {
+ function selectImage() {
+ imgElm.onload = imgElm.onerror = null;
+ if (editor.selection) {
+ editor.selection.select(imgElm);
+ editor.nodeChanged();
+ }
+ }
+ imgElm.onload = function () {
+ if (!data.width && !data.height && Settings.hasDimensions(editor)) {
+ editor.dom.setAttribs(imgElm, {
+ width: imgElm.clientWidth,
+ height: imgElm.clientHeight
+ });
+ }
+ 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">- reader.onerror = function () {
- reject(FileReader.error.message);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ imgElm.onerror = selectImage;
+ };
+ var blobToDataUri = function (blob) {
+ return new global$1(function (resolve, reject) {
+ var reader = FileReader();
+ reader.onload = function () {
+ resolve(reader.result);
+ };
+ reader.onerror = function () {
+ reject(reader.error.message);
+ };
+ reader.readAsDataURL(blob);
+ });
+ };
+ var Utils = {
+ getImageSize: getImageSize,
+ buildListItems: buildListItems,
+ removePixelSuffix: removePixelSuffix,
+ addPixelSuffix: addPixelSuffix,
+ mergeMargins: mergeMargins,
+ createImageList: createImageList,
+ waitLoadImage: waitLoadImage,
+ blobToDataUri: blobToDataUri
+ };
+
+ var global$4 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
+
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
+ var shallow = function (old, nu) {
+ return nu;
+ };
+ var baseMerge = function (merger) {
+ return function () {
+ var objects = new Array(arguments.length);
+ for (var i = 0; i < objects.length; i++)
+ objects[i] = arguments[i];
+ if (objects.length === 0)
+ throw new Error('Can\'t merge zero objects');
+ var ret = {};
+ for (var j = 0; j < objects.length; j++) {
+ var curObject = objects[j];
+ for (var key in curObject)
+ if (hasOwnProperty.call(curObject, key)) {
+ ret[key] = merger(ret[key], curObject[key]);
+ }
+ }
+ return ret;
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- reader.readAsDataURL(blob);
- });
- };
- var $_1e8k4ncujjgwebw2 = {
- getImageSize: getImageSize,
- buildListItems: buildListItems,
- removePixelSuffix: removePixelSuffix,
- addPixelSuffix: addPixelSuffix,
- mergeMargins: mergeMargins,
- createImageList: createImageList,
- waitLoadImage: waitLoadImage,
- blobToDataUri: blobToDataUri
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var merge = baseMerge(shallow);
</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 global$4 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
-
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var shallow = function (old, nu) {
- return nu;
- };
- var baseMerge = function (merger) {
- return function () {
- var objects = new Array(arguments.length);
- for (var i = 0; i < objects.length; i++)
- objects[i] = arguments[i];
- if (objects.length === 0)
- throw new Error('Can\'t merge zero objects');
- var ret = {};
- for (var j = 0; j < objects.length; j++) {
- var curObject = objects[j];
- for (var key in curObject)
- if (hasOwnProperty.call(curObject, key)) {
- ret[key] = merger(ret[key], curObject[key]);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var DOM = global$4.DOM;
+ var getHspace = function (image) {
+ if (image.style.marginLeft && image.style.marginRight && image.style.marginLeft === image.style.marginRight) {
+ return Utils.removePixelSuffix(image.style.marginLeft);
+ } else {
+ 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 ret;
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
-
- var merge = baseMerge(shallow);
-
- var DOM = global$4.DOM;
- var getHspace = function (image) {
- if (image.style.marginLeft && image.style.marginRight && image.style.marginLeft === image.style.marginRight) {
- return $_1e8k4ncujjgwebw2.removePixelSuffix(image.style.marginLeft);
- } else {
- return '';
- }
- };
- var getVspace = function (image) {
- if (image.style.marginTop && image.style.marginBottom && image.style.marginTop === image.style.marginBottom) {
- return $_1e8k4ncujjgwebw2.removePixelSuffix(image.style.marginTop);
- } else {
- return '';
- }
- };
- var getBorder = function (image) {
- if (image.style.borderWidth) {
- return $_1e8k4ncujjgwebw2.removePixelSuffix(image.style.borderWidth);
- } else {
- return '';
- }
- };
- var getAttrib = function (image, name$$1) {
- if (image.hasAttribute(name$$1)) {
- return image.getAttribute(name$$1);
- } else {
- return '';
- }
- };
- var getStyle = function (image, name$$1) {
- return image.style[name$$1] ? image.style[name$$1] : '';
- };
- var hasCaption = function (image) {
- return image.parentNode !== null && image.parentNode.nodeName === 'FIGURE';
- };
- var setAttrib = function (image, name$$1, value) {
- image.setAttribute(name$$1, value);
- };
- var wrapInFigure = function (image) {
- var figureElm = DOM.create('figure', { class: 'image' });
- DOM.insertAfter(figureElm, image);
- figureElm.appendChild(image);
- figureElm.appendChild(DOM.create('figcaption', { contentEditable: true }, 'Caption'));
- figureElm.contentEditable = 'false';
- };
- var removeFigure = function (image) {
- var figureElm = image.parentNode;
- DOM.insertAfter(image, figureElm);
- DOM.remove(figureElm);
- };
- var toggleCaption = function (image) {
- if (hasCaption(image)) {
- removeFigure(image);
- } else {
- wrapInFigure(image);
- }
- };
- var normalizeStyle = function (image, normalizeCss) {
- var attrValue = image.getAttribute('style');
- var value = normalizeCss(attrValue !== null ? attrValue : '');
- if (value.length > 0) {
- image.setAttribute('style', value);
- image.setAttribute('data-mce-style', value);
- } else {
- image.removeAttribute('style');
- }
- };
- var setSize = function (name$$1, normalizeCss) {
- return function (image, name$$1, value) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getVspace = function (image) {
+ if (image.style.marginTop && image.style.marginBottom && image.style.marginTop === image.style.marginBottom) {
+ return Utils.removePixelSuffix(image.style.marginTop);
+ } else {
+ return '';
+ }
+ };
+ var getBorder = function (image) {
+ if (image.style.borderWidth) {
+ return Utils.removePixelSuffix(image.style.borderWidth);
+ } else {
+ return '';
+ }
+ };
+ var getAttrib = function (image, name$$1) {
+ if (image.hasAttribute(name$$1)) {
+ return image.getAttribute(name$$1);
+ } else {
+ return '';
+ }
+ };
+ var getStyle = function (image, name$$1) {
+ return image.style[name$$1] ? image.style[name$$1] : '';
+ };
+ var hasCaption = function (image) {
+ return image.parentNode !== null && image.parentNode.nodeName === 'FIGURE';
+ };
+ var setAttrib = function (image, name$$1, value) {
+ image.setAttribute(name$$1, value);
+ };
+ var wrapInFigure = function (image) {
+ var figureElm = DOM.create('figure', { class: 'image' });
+ DOM.insertAfter(figureElm, image);
+ figureElm.appendChild(image);
+ figureElm.appendChild(DOM.create('figcaption', { contentEditable: true }, 'Caption'));
+ figureElm.contentEditable = 'false';
+ };
+ var removeFigure = function (image) {
+ var figureElm = image.parentNode;
+ DOM.insertAfter(image, figureElm);
+ DOM.remove(figureElm);
+ };
+ var toggleCaption = function (image) {
+ if (hasCaption(image)) {
+ removeFigure(image);
+ } else {
+ wrapInFigure(image);
+ }
+ };
+ var normalizeStyle = function (image, normalizeCss) {
+ var attrValue = image.getAttribute('style');
+ var value = normalizeCss(attrValue !== null ? attrValue : '');
+ if (value.length > 0) {
+ image.setAttribute('style', value);
+ image.setAttribute('data-mce-style', value);
+ } else {
+ image.removeAttribute('style');
+ }
+ };
+ var setSize = function (name$$1, normalizeCss) {
+ return function (image, name$$1, value) {
+ if (image.style[name$$1]) {
+ image.style[name$$1] = Utils.addPixelSuffix(value);
+ normalizeStyle(image, normalizeCss);
+ } else {
+ setAttrib(image, name$$1, value);
+ }
+ };
+ };
+ var getSize = function (image, name$$1) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (image.style[name$$1]) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- image.style[name$$1] = $_1e8k4ncujjgwebw2.addPixelSuffix(value);
- normalizeStyle(image, normalizeCss);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Utils.removePixelSuffix(image.style[name$$1]);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- setAttrib(image, name$$1, value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return getAttrib(image, name$$1);
</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">- };
- var getSize = function (image, name$$1) {
- if (image.style[name$$1]) {
- return $_1e8k4ncujjgwebw2.removePixelSuffix(image.style[name$$1]);
- } else {
- return getAttrib(image, name$$1);
- }
- };
- var setHspace = function (image, value) {
- var pxValue = $_1e8k4ncujjgwebw2.addPixelSuffix(value);
- image.style.marginLeft = pxValue;
- image.style.marginRight = pxValue;
- };
- var setVspace = function (image, value) {
- var pxValue = $_1e8k4ncujjgwebw2.addPixelSuffix(value);
- image.style.marginTop = pxValue;
- image.style.marginBottom = pxValue;
- };
- var setBorder = function (image, value) {
- var pxValue = $_1e8k4ncujjgwebw2.addPixelSuffix(value);
- image.style.borderWidth = pxValue;
- };
- var setBorderStyle = function (image, value) {
- image.style.borderStyle = value;
- };
- var getBorderStyle = function (image) {
- return getStyle(image, 'borderStyle');
- };
- var isFigure = function (elm) {
- return elm.nodeName === 'FIGURE';
- };
- var defaultData = function () {
- return {
- src: '',
- alt: '',
- title: '',
- width: '',
- height: '',
- class: '',
- style: '',
- caption: false,
- hspace: '',
- vspace: '',
- border: '',
- borderStyle: ''
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setHspace = function (image, value) {
+ var pxValue = Utils.addPixelSuffix(value);
+ image.style.marginLeft = pxValue;
+ image.style.marginRight = pxValue;
</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 getStyleValue = function (normalizeCss, data) {
- var image = document.createElement('img');
- setAttrib(image, 'style', data.style);
- if (getHspace(image) || data.hspace !== '') {
- setHspace(image, data.hspace);
- }
- if (getVspace(image) || data.vspace !== '') {
- setVspace(image, data.vspace);
- }
- if (getBorder(image) || data.border !== '') {
- setBorder(image, data.border);
- }
- if (getBorderStyle(image) || data.borderStyle !== '') {
- setBorderStyle(image, data.borderStyle);
- }
- return normalizeCss(image.getAttribute('style'));
- };
- var create = function (normalizeCss, data) {
- var image = document.createElement('img');
- write(normalizeCss, merge(data, { caption: false }), image);
- setAttrib(image, 'alt', data.alt);
- if (data.caption) {
- var figure = DOM.create('figure', { class: 'image' });
- figure.appendChild(image);
- figure.appendChild(DOM.create('figcaption', { contentEditable: true }, 'Caption'));
- figure.contentEditable = 'false';
- return figure;
- } else {
- return image;
- }
- };
- var read = function (normalizeCss, image) {
- return {
- src: getAttrib(image, 'src'),
- alt: getAttrib(image, 'alt'),
- title: getAttrib(image, 'title'),
- width: getSize(image, 'width'),
- height: getSize(image, 'height'),
- class: getAttrib(image, 'class'),
- style: normalizeCss(getAttrib(image, 'style')),
- caption: hasCaption(image),
- hspace: getHspace(image),
- vspace: getVspace(image),
- border: getBorder(image),
- borderStyle: getStyle(image, 'borderStyle')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setVspace = function (image, value) {
+ var pxValue = Utils.addPixelSuffix(value);
+ image.style.marginTop = pxValue;
+ image.style.marginBottom = pxValue;
</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 updateProp = function (image, oldData, newData, name$$1, set) {
- if (newData[name$$1] !== oldData[name$$1]) {
- set(image, name$$1, newData[name$$1]);
- }
- };
- var normalized = function (set, normalizeCss) {
- return function (image, name$$1, value) {
- set(image, value);
- normalizeStyle(image, normalizeCss);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setBorder = function (image, value) {
+ var pxValue = Utils.addPixelSuffix(value);
+ image.style.borderWidth = pxValue;
</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 write = function (normalizeCss, newData, image) {
- var oldData = read(normalizeCss, image);
- updateProp(image, oldData, newData, 'caption', function (image, _name, _value) {
- return toggleCaption(image);
- });
- updateProp(image, oldData, newData, 'src', setAttrib);
- updateProp(image, oldData, newData, 'alt', setAttrib);
- updateProp(image, oldData, newData, 'title', setAttrib);
- updateProp(image, oldData, newData, 'width', setSize('width', normalizeCss));
- updateProp(image, oldData, newData, 'height', setSize('height', normalizeCss));
- updateProp(image, oldData, newData, 'class', setAttrib);
- updateProp(image, oldData, newData, 'style', normalized(function (image, value) {
- return setAttrib(image, 'style', value);
- }, normalizeCss));
- updateProp(image, oldData, newData, 'hspace', normalized(setHspace, normalizeCss));
- updateProp(image, oldData, newData, 'vspace', normalized(setVspace, normalizeCss));
- updateProp(image, oldData, newData, 'border', normalized(setBorder, normalizeCss));
- updateProp(image, oldData, newData, 'borderStyle', normalized(setBorderStyle, normalizeCss));
- };
-
- var normalizeCss = function (editor, cssText) {
- var css = editor.dom.styles.parse(cssText);
- var mergedCss = $_1e8k4ncujjgwebw2.mergeMargins(css);
- var compressed = editor.dom.styles.parse(editor.dom.styles.serialize(mergedCss));
- return editor.dom.styles.serialize(compressed);
- };
- var getSelectedImage = function (editor) {
- var imgElm = editor.selection.getNode();
- var figureElm = editor.dom.getParent(imgElm, 'figure.image');
- if (figureElm) {
- return editor.dom.select('img', figureElm)[0];
- }
- if (imgElm && (imgElm.nodeName !== 'IMG' || imgElm.getAttribute('data-mce-object') || imgElm.getAttribute('data-mce-placeholder'))) {
- return null;
- }
- return imgElm;
- };
- var splitTextBlock = function (editor, figure) {
- var dom = editor.dom;
- var textBlock = dom.getParent(figure.parentNode, function (node) {
- return editor.schema.getTextBlockElements()[node.nodeName];
- });
- if (textBlock) {
- return dom.split(textBlock, figure);
- } else {
- return figure;
- }
- };
- var readImageDataFromSelection = function (editor) {
- var image = getSelectedImage(editor);
- return image ? read(function (css) {
- return normalizeCss(editor, css);
- }, image) : defaultData();
- };
- var insertImageAtCaret = function (editor, data) {
- var elm = create(function (css) {
- return normalizeCss(editor, css);
- }, data);
- editor.dom.setAttrib(elm, 'data-mce-id', '__mcenew');
- editor.focus();
- editor.selection.setContent(elm.outerHTML);
- var insertedElm = editor.dom.select('*[data-mce-id="__mcenew"]')[0];
- editor.dom.setAttrib(insertedElm, 'data-mce-id', null);
- if (isFigure(insertedElm)) {
- var figure = splitTextBlock(editor, insertedElm);
- editor.selection.select(figure);
- } else {
- editor.selection.select(insertedElm);
- }
- };
- var syncSrcAttr = function (editor, image) {
- editor.dom.setAttrib(image, 'src', image.getAttribute('src'));
- };
- var deleteImage = function (editor, image) {
- if (image) {
- var elm = editor.dom.is(image.parentNode, 'figure.image') ? image.parentNode : image;
- editor.dom.remove(elm);
- editor.focus();
- editor.nodeChanged();
- if (editor.dom.isEmpty(editor.getBody())) {
- editor.setContent('');
- editor.selection.setCursorLocation();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setBorderStyle = function (image, value) {
+ image.style.borderStyle = value;
+ };
+ var getBorderStyle = function (image) {
+ return getStyle(image, 'borderStyle');
+ };
+ var isFigure = function (elm) {
+ return elm.nodeName === 'FIGURE';
+ };
+ var defaultData = function () {
+ return {
+ src: '',
+ alt: '',
+ title: '',
+ width: '',
+ height: '',
+ class: '',
+ style: '',
+ caption: false,
+ hspace: '',
+ vspace: '',
+ border: '',
+ borderStyle: ''
+ };
+ };
+ var getStyleValue = function (normalizeCss, data) {
+ var image = document.createElement('img');
+ setAttrib(image, 'style', data.style);
+ if (getHspace(image) || data.hspace !== '') {
+ setHspace(image, data.hspace);
</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 writeImageDataToSelection = function (editor, data) {
- var image = getSelectedImage(editor);
- write(function (css) {
- return normalizeCss(editor, css);
- }, data, image);
- syncSrcAttr(editor, image);
- if (isFigure(image.parentNode)) {
- var figure = image.parentNode;
- splitTextBlock(editor, figure);
- editor.selection.select(image.parentNode);
- } else {
- editor.selection.select(image);
- $_1e8k4ncujjgwebw2.waitLoadImage(editor, data, image);
- }
- };
- var insertOrUpdateImage = function (editor, data) {
- var image = getSelectedImage(editor);
- if (image) {
- if (data.src) {
- writeImageDataToSelection(editor, data);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (getVspace(image) || data.vspace !== '') {
+ setVspace(image, data.vspace);
+ }
+ if (getBorder(image) || data.border !== '') {
+ setBorder(image, data.border);
+ }
+ if (getBorderStyle(image) || data.borderStyle !== '') {
+ setBorderStyle(image, data.borderStyle);
+ }
+ return normalizeCss(image.getAttribute('style'));
+ };
+ var create = function (normalizeCss, data) {
+ var image = document.createElement('img');
+ write(normalizeCss, merge(data, { caption: false }), image);
+ setAttrib(image, 'alt', data.alt);
+ if (data.caption) {
+ var figure = DOM.create('figure', { class: 'image' });
+ figure.appendChild(image);
+ figure.appendChild(DOM.create('figcaption', { contentEditable: true }, 'Caption'));
+ figure.contentEditable = 'false';
+ return figure;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- deleteImage(editor, image);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return image;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else if (data.src) {
- insertImageAtCaret(editor, data);
- }
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var read = function (normalizeCss, image) {
+ return {
+ src: getAttrib(image, 'src'),
+ alt: getAttrib(image, 'alt'),
+ title: getAttrib(image, 'title'),
+ width: getSize(image, 'width'),
+ height: getSize(image, 'height'),
+ class: getAttrib(image, 'class'),
+ style: normalizeCss(getAttrib(image, 'style')),
+ caption: hasCaption(image),
+ hspace: getHspace(image),
+ vspace: getVspace(image),
+ border: getBorder(image),
+ borderStyle: getStyle(image, 'borderStyle')
+ };
+ };
+ var updateProp = function (image, oldData, newData, name$$1, set) {
+ if (newData[name$$1] !== oldData[name$$1]) {
+ set(image, name$$1, newData[name$$1]);
+ }
+ };
+ var normalized = function (set, normalizeCss) {
+ return function (image, name$$1, value) {
+ set(image, value);
+ normalizeStyle(image, normalizeCss);
+ };
+ };
+ var write = function (normalizeCss, newData, image) {
+ var oldData = read(normalizeCss, image);
+ updateProp(image, oldData, newData, 'caption', function (image, _name, _value) {
+ return toggleCaption(image);
+ });
+ updateProp(image, oldData, newData, 'src', setAttrib);
+ updateProp(image, oldData, newData, 'alt', setAttrib);
+ updateProp(image, oldData, newData, 'title', setAttrib);
+ updateProp(image, oldData, newData, 'width', setSize('width', normalizeCss));
+ updateProp(image, oldData, newData, 'height', setSize('height', normalizeCss));
+ updateProp(image, oldData, newData, 'class', setAttrib);
+ updateProp(image, oldData, newData, 'style', normalized(function (image, value) {
+ return setAttrib(image, 'style', value);
+ }, normalizeCss));
+ updateProp(image, oldData, newData, 'hspace', normalized(setHspace, normalizeCss));
+ updateProp(image, oldData, newData, 'vspace', normalized(setVspace, normalizeCss));
+ updateProp(image, oldData, newData, 'border', normalized(setBorder, normalizeCss));
+ updateProp(image, oldData, newData, 'borderStyle', normalized(setBorderStyle, normalizeCss));
+ };
</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 updateVSpaceHSpaceBorder = function (editor) {
- return function (evt) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var normalizeCss = function (editor, cssText) {
+ var css = editor.dom.styles.parse(cssText);
+ var mergedCss = Utils.mergeMargins(css);
+ var compressed = editor.dom.styles.parse(editor.dom.styles.serialize(mergedCss));
+ return editor.dom.styles.serialize(compressed);
+ };
+ var getSelectedImage = function (editor) {
+ var imgElm = editor.selection.getNode();
+ var figureElm = editor.dom.getParent(imgElm, 'figure.image');
+ if (figureElm) {
+ return editor.dom.select('img', figureElm)[0];
+ }
+ if (imgElm && (imgElm.nodeName !== 'IMG' || imgElm.getAttribute('data-mce-object') || imgElm.getAttribute('data-mce-placeholder'))) {
+ return null;
+ }
+ return imgElm;
+ };
+ var splitTextBlock = function (editor, figure) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var dom = editor.dom;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var rootControl = evt.control.rootControl;
- if (!$_1dn8wtctjjgwebvz.hasAdvTab(editor)) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var textBlock = dom.getParent(figure.parentNode, function (node) {
+ return editor.schema.getTextBlockElements()[node.nodeName];
+ }, editor.getBody());
+ if (textBlock) {
+ return dom.split(textBlock, figure);
+ } else {
+ return figure;
</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 = rootControl.toJSON();
- var css = dom.parseStyle(data.style);
- rootControl.find('#vspace').value('');
- rootControl.find('#hspace').value('');
- css = $_1e8k4ncujjgwebw2.mergeMargins(css);
- if (css['margin-top'] && css['margin-bottom'] || css['margin-right'] && css['margin-left']) {
- if (css['margin-top'] === css['margin-bottom']) {
- rootControl.find('#vspace').value($_1e8k4ncujjgwebw2.removePixelSuffix(css['margin-top']));
- } else {
- rootControl.find('#vspace').value('');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var readImageDataFromSelection = function (editor) {
+ var image = getSelectedImage(editor);
+ return image ? read(function (css) {
+ return normalizeCss(editor, css);
+ }, image) : defaultData();
+ };
+ var insertImageAtCaret = function (editor, data) {
+ var elm = create(function (css) {
+ return normalizeCss(editor, css);
+ }, data);
+ editor.dom.setAttrib(elm, 'data-mce-id', '__mcenew');
+ editor.focus();
+ editor.selection.setContent(elm.outerHTML);
+ var insertedElm = editor.dom.select('*[data-mce-id="__mcenew"]')[0];
+ editor.dom.setAttrib(insertedElm, 'data-mce-id', null);
+ if (isFigure(insertedElm)) {
+ var figure = splitTextBlock(editor, insertedElm);
+ editor.selection.select(figure);
+ } else {
+ editor.selection.select(insertedElm);
+ }
+ };
+ var syncSrcAttr = function (editor, image) {
+ editor.dom.setAttrib(image, 'src', image.getAttribute('src'));
+ };
+ var deleteImage = function (editor, image) {
+ if (image) {
+ var elm = editor.dom.is(image.parentNode, 'figure.image') ? image.parentNode : image;
+ editor.dom.remove(elm);
+ editor.focus();
+ editor.nodeChanged();
+ if (editor.dom.isEmpty(editor.getBody())) {
+ editor.setContent('');
+ editor.selection.setCursorLocation();
</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 (css['margin-right'] === css['margin-left']) {
- rootControl.find('#hspace').value($_1e8k4ncujjgwebw2.removePixelSuffix(css['margin-right']));
- } else {
- rootControl.find('#hspace').value('');
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (css['border-width']) {
- rootControl.find('#border').value($_1e8k4ncujjgwebw2.removePixelSuffix(css['border-width']));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var writeImageDataToSelection = function (editor, data) {
+ var image = getSelectedImage(editor);
+ write(function (css) {
+ return normalizeCss(editor, css);
+ }, data, image);
+ syncSrcAttr(editor, image);
+ if (isFigure(image.parentNode)) {
+ var figure = image.parentNode;
+ splitTextBlock(editor, figure);
+ editor.selection.select(image.parentNode);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- rootControl.find('#border').value('');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.selection.select(image);
+ Utils.waitLoadImage(editor, data, image);
</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 (css['border-style']) {
- rootControl.find('#borderStyle').value(css['border-style']);
- } else {
- rootControl.find('#borderStyle').value('');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var insertOrUpdateImage = function (editor, data) {
+ var image = getSelectedImage(editor);
+ if (image) {
+ if (data.src) {
+ writeImageDataToSelection(editor, data);
+ } else {
+ deleteImage(editor, image);
+ }
+ } else if (data.src) {
+ insertImageAtCaret(editor, 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">- rootControl.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css))));
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var updateStyle = function (editor, win) {
- win.find('#style').each(function (ctrl) {
- var value = getStyleValue(function (css) {
- return normalizeCss(editor, css);
- }, merge(defaultData(), win.toJSON()));
- ctrl.value(value);
- });
- };
- var makeTab = function (editor) {
- return {
- title: 'Advanced',
- type: 'form',
- pack: 'start',
- items: [
- {
- label: 'Style',
- name: 'style',
- type: 'textbox',
- onchange: updateVSpaceHSpaceBorder(editor)
- },
- {
- type: 'form',
- layout: 'grid',
- packV: 'start',
- columns: 2,
- padding: 0,
- defaults: {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var updateVSpaceHSpaceBorder = function (editor) {
+ return function (evt) {
+ var dom = editor.dom;
+ var rootControl = evt.control.rootControl;
+ if (!Settings.hasAdvTab(editor)) {
+ return;
+ }
+ var data = rootControl.toJSON();
+ var css = dom.parseStyle(data.style);
+ rootControl.find('#vspace').value('');
+ rootControl.find('#hspace').value('');
+ css = Utils.mergeMargins(css);
+ if (css['margin-top'] && css['margin-bottom'] || css['margin-right'] && css['margin-left']) {
+ if (css['margin-top'] === css['margin-bottom']) {
+ rootControl.find('#vspace').value(Utils.removePixelSuffix(css['margin-top']));
+ } else {
+ rootControl.find('#vspace').value('');
+ }
+ if (css['margin-right'] === css['margin-left']) {
+ rootControl.find('#hspace').value(Utils.removePixelSuffix(css['margin-right']));
+ } else {
+ rootControl.find('#hspace').value('');
+ }
+ }
+ if (css['border-width']) {
+ rootControl.find('#border').value(Utils.removePixelSuffix(css['border-width']));
+ } else {
+ rootControl.find('#border').value('');
+ }
+ if (css['border-style']) {
+ rootControl.find('#borderStyle').value(css['border-style']);
+ } else {
+ rootControl.find('#borderStyle').value('');
+ }
+ rootControl.find('#style').value(dom.serializeStyle(dom.parseStyle(dom.serializeStyle(css))));
+ };
+ };
+ var updateStyle = function (editor, win) {
+ win.find('#style').each(function (ctrl) {
+ var value = getStyleValue(function (css) {
+ return normalizeCss(editor, css);
+ }, merge(defaultData(), win.toJSON()));
+ ctrl.value(value);
+ });
+ };
+ var makeTab = function (editor) {
+ return {
+ title: 'Advanced',
+ type: 'form',
+ pack: 'start',
+ items: [
+ {
+ label: 'Style',
+ name: 'style',
</ins><span class="cx" style="display: block; padding: 0 10px"> type: 'textbox',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- maxWidth: 50,
- onchange: function (evt) {
- updateStyle(editor, evt.control.rootControl);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ onchange: updateVSpaceHSpaceBorder(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">- items: [
- {
- label: 'Vertical space',
- name: 'vspace'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ {
+ type: 'form',
+ layout: 'grid',
+ packV: 'start',
+ columns: 2,
+ padding: 0,
+ defaults: {
+ type: 'textbox',
+ maxWidth: 50,
+ onchange: function (evt) {
+ updateStyle(editor, evt.control.rootControl);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- {
- label: 'Border width',
- name: 'border'
- },
- {
- label: 'Horizontal space',
- name: 'hspace'
- },
- {
- label: 'Border style',
- type: 'listbox',
- name: 'borderStyle',
- width: 90,
- maxWidth: 90,
- onselect: function (evt) {
- updateStyle(editor, evt.control.rootControl);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ items: [
+ {
+ label: 'Vertical space',
+ name: 'vspace'
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- values: [
- {
- text: 'Select...',
- value: ''
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ {
+ label: 'Border width',
+ name: 'border'
+ },
+ {
+ label: 'Horizontal space',
+ name: 'hspace'
+ },
+ {
+ label: 'Border style',
+ type: 'listbox',
+ name: 'borderStyle',
+ width: 90,
+ maxWidth: 90,
+ onselect: function (evt) {
+ updateStyle(editor, evt.control.rootControl);
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- {
- text: 'Solid',
- value: 'solid'
- },
- {
- text: 'Dotted',
- value: 'dotted'
- },
- {
- text: 'Dashed',
- value: 'dashed'
- },
- {
- text: 'Double',
- value: 'double'
- },
- {
- text: 'Groove',
- value: 'groove'
- },
- {
- text: 'Ridge',
- value: 'ridge'
- },
- {
- text: 'Inset',
- value: 'inset'
- },
- {
- text: 'Outset',
- value: 'outset'
- },
- {
- text: 'None',
- value: 'none'
- },
- {
- text: 'Hidden',
- value: 'hidden'
- }
- ]
- }
- ]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ values: [
+ {
+ text: 'Select...',
+ value: ''
+ },
+ {
+ text: 'Solid',
+ value: 'solid'
+ },
+ {
+ text: 'Dotted',
+ value: 'dotted'
+ },
+ {
+ text: 'Dashed',
+ value: 'dashed'
+ },
+ {
+ text: 'Double',
+ value: 'double'
+ },
+ {
+ text: 'Groove',
+ value: 'groove'
+ },
+ {
+ text: 'Ridge',
+ value: 'ridge'
+ },
+ {
+ text: 'Inset',
+ value: 'inset'
+ },
+ {
+ text: 'Outset',
+ value: 'outset'
+ },
+ {
+ text: 'None',
+ value: 'none'
+ },
+ {
+ text: 'Hidden',
+ value: 'hidden'
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ };
+ };
+ var AdvTab = { makeTab: makeTab };
+
+ var doSyncSize = function (widthCtrl, heightCtrl) {
+ widthCtrl.state.set('oldVal', widthCtrl.value());
+ heightCtrl.state.set('oldVal', heightCtrl.value());
+ };
+ var doSizeControls = function (win, f) {
+ var widthCtrl = win.find('#width')[0];
+ var heightCtrl = win.find('#height')[0];
+ var constrained = win.find('#constrain')[0];
+ if (widthCtrl && heightCtrl && constrained) {
+ f(widthCtrl, heightCtrl, constrained.checked());
+ }
+ };
+ var doUpdateSize = function (widthCtrl, heightCtrl, isContrained) {
+ var oldWidth = widthCtrl.state.get('oldVal');
+ var oldHeight = heightCtrl.state.get('oldVal');
+ var newWidth = widthCtrl.value();
+ var newHeight = heightCtrl.value();
+ if (isContrained && oldWidth && oldHeight && newWidth && newHeight) {
+ if (newWidth !== oldWidth) {
+ newHeight = Math.round(newWidth / oldWidth * newHeight);
+ if (!isNaN(newHeight)) {
+ heightCtrl.value(newHeight);
+ }
+ } else {
+ newWidth = Math.round(newHeight / oldHeight * newWidth);
+ 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">- ]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ doSyncSize(widthCtrl, heightCtrl);
</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 $_6dfy5vd3jjgwebxf = { makeTab: makeTab };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var syncSize = function (win) {
+ doSizeControls(win, doSyncSize);
+ };
+ var updateSize = function (win) {
+ doSizeControls(win, doUpdateSize);
+ };
+ var createUi = function () {
+ var recalcSize = function (evt) {
+ updateSize(evt.control.rootControl);
+ };
+ return {
+ type: 'container',
+ label: 'Dimensions',
+ layout: 'flex',
+ align: 'center',
+ spacing: 5,
+ items: [
+ {
+ name: 'width',
+ type: 'textbox',
+ maxLength: 5,
+ size: 5,
+ onchange: recalcSize,
+ ariaLabel: 'Width'
+ },
+ {
+ type: 'label',
+ text: 'x'
+ },
+ {
+ name: 'height',
+ type: 'textbox',
+ maxLength: 5,
+ size: 5,
+ onchange: recalcSize,
+ ariaLabel: 'Height'
+ },
+ {
+ name: 'constrain',
+ type: 'checkbox',
+ checked: true,
+ text: 'Constrain proportions'
+ }
+ ]
+ };
+ };
+ var SizeManager = {
+ createUi: createUi,
+ syncSize: syncSize,
+ updateSize: updateSize
+ };
</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 doSyncSize = function (widthCtrl, heightCtrl) {
- widthCtrl.state.set('oldVal', widthCtrl.value());
- heightCtrl.state.set('oldVal', heightCtrl.value());
- };
- var doSizeControls = function (win, f) {
- var widthCtrl = win.find('#width')[0];
- var heightCtrl = win.find('#height')[0];
- var constrained = win.find('#constrain')[0];
- if (widthCtrl && heightCtrl && constrained) {
- f(widthCtrl, heightCtrl, constrained.checked());
- }
- };
- var doUpdateSize = function (widthCtrl, heightCtrl, isContrained) {
- var oldWidth = widthCtrl.state.get('oldVal');
- var oldHeight = heightCtrl.state.get('oldVal');
- var newWidth = widthCtrl.value();
- var newHeight = heightCtrl.value();
- if (isContrained && oldWidth && oldHeight && newWidth && newHeight) {
- if (newWidth !== oldWidth) {
- newHeight = Math.round(newWidth / oldWidth * newHeight);
- if (!isNaN(newHeight)) {
- heightCtrl.value(newHeight);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var onSrcChange = function (evt, editor) {
+ var srcURL, prependURL, absoluteURLPattern;
+ var meta = evt.meta || {};
+ var control = evt.control;
+ var rootControl = control.rootControl;
+ var imageListCtrl = rootControl.find('#image-list')[0];
+ if (imageListCtrl) {
+ imageListCtrl.value(editor.convertURL(control.value(), 'src'));
+ }
+ global$2.each(meta, function (value, key) {
+ rootControl.find('#' + key).value(value);
+ });
+ if (!meta.width && !meta.height) {
+ srcURL = editor.convertURL(control.value(), 'src');
+ prependURL = Settings.getPrependUrl(editor);
+ 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">- } else {
- newWidth = Math.round(newHeight / oldHeight * newWidth);
- if (!isNaN(newWidth)) {
- widthCtrl.value(newWidth);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ control.value(srcURL);
+ Utils.getImageSize(editor.documentBaseURI.toAbsolute(control.value()), function (data) {
+ if (data.width && data.height && Settings.hasDimensions(editor)) {
+ rootControl.find('#width').value(data.width);
+ rootControl.find('#height').value(data.height);
+ SizeManager.syncSize(rootControl);
+ }
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- doSyncSize(widthCtrl, heightCtrl);
- };
- var syncSize = function (win) {
- doSizeControls(win, doSyncSize);
- };
- var updateSize = function (win) {
- doSizeControls(win, doUpdateSize);
- };
- var createUi = function () {
- var recalcSize = function (evt) {
- updateSize(evt.control.rootControl);
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return {
- type: 'container',
- label: 'Dimensions',
- layout: 'flex',
- align: 'center',
- spacing: 5,
- items: [
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var onBeforeCall = function (evt) {
+ evt.meta = evt.control.rootControl.toJSON();
+ };
+ var getGeneralItems = function (editor, imageListCtrl) {
+ var 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">- name: 'width',
- type: 'textbox',
- maxLength: 5,
- size: 5,
- onchange: recalcSize,
- ariaLabel: 'Width'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ name: 'src',
+ type: 'filepicker',
+ filetype: 'image',
+ label: 'Source',
+ autofocus: true,
+ onchange: function (evt) {
+ onSrcChange(evt, editor);
+ },
+ onbeforecall: onBeforeCall
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- {
- type: 'label',
- text: 'x'
- },
- {
- name: 'height',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ imageListCtrl
+ ];
+ if (Settings.hasDescription(editor)) {
+ generalFormItems.push({
+ name: 'alt',
</ins><span class="cx" style="display: block; padding: 0 10px"> type: 'textbox',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- maxLength: 5,
- size: 5,
- onchange: recalcSize,
- ariaLabel: 'Height'
- },
- {
- name: 'constrain',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ label: 'Image description'
+ });
+ }
+ if (Settings.hasImageTitle(editor)) {
+ generalFormItems.push({
+ name: 'title',
+ type: 'textbox',
+ label: 'Image Title'
+ });
+ }
+ if (Settings.hasDimensions(editor)) {
+ generalFormItems.push(SizeManager.createUi());
+ }
+ if (Settings.getClassList(editor)) {
+ generalFormItems.push({
+ name: 'class',
+ type: 'listbox',
+ label: 'Class',
+ values: Utils.buildListItems(Settings.getClassList(editor), function (item) {
+ if (item.value) {
+ item.textStyle = function () {
+ return editor.formatter.getCssText({
+ inline: 'img',
+ classes: [item.value]
+ });
+ };
+ }
+ })
+ });
+ }
+ if (Settings.hasImageCaption(editor)) {
+ generalFormItems.push({
+ name: 'caption',
</ins><span class="cx" style="display: block; padding: 0 10px"> type: 'checkbox',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- checked: true,
- text: 'Constrain proportions'
- }
- ]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ label: 'Caption'
+ });
+ }
+ return 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">- };
- var $_ftlz5pdajjgweby4 = {
- createUi: createUi,
- syncSize: syncSize,
- updateSize: updateSize
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var makeTab$1 = function (editor, imageListCtrl) {
+ return {
+ title: 'General',
+ type: 'form',
+ items: getGeneralItems(editor, imageListCtrl)
+ };
+ };
+ var MainTab = {
+ makeTab: makeTab$1,
+ getGeneralItems: getGeneralItems
+ };
</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 onSrcChange = function (evt, editor) {
- var srcURL, prependURL, absoluteURLPattern;
- var meta = evt.meta || {};
- var control = evt.control;
- var rootControl = control.rootControl;
- var imageListCtrl = rootControl.find('#image-list')[0];
- if (imageListCtrl) {
- imageListCtrl.value(editor.convertURL(control.value(), 'src'));
- }
- global$2.each(meta, function (value, key) {
- rootControl.find('#' + key).value(value);
- });
- if (!meta.width && !meta.height) {
- srcURL = editor.convertURL(control.value(), 'src');
- prependURL = $_1dn8wtctjjgwebvz.getPrependUrl(editor);
- absoluteURLPattern = new RegExp('^(?:[a-z]+:)?//', 'i');
- if (prependURL && !absoluteURLPattern.test(srcURL) && srcURL.substring(0, prependURL.length) !== prependURL) {
- srcURL = prependURL + srcURL;
- }
- control.value(srcURL);
- $_1e8k4ncujjgwebw2.getImageSize(editor.documentBaseURI.toAbsolute(control.value()), function (data) {
- if (data.width && data.height && $_1dn8wtctjjgwebvz.hasDimensions(editor)) {
- rootControl.find('#width').value(data.width);
- rootControl.find('#height').value(data.height);
- $_ftlz5pdajjgweby4.syncSize(rootControl);
- }
- });
- }
- };
- var onBeforeCall = function (evt) {
- evt.meta = evt.control.rootControl.toJSON();
- };
- var getGeneralItems = function (editor, imageListCtrl) {
- var generalFormItems = [
- {
- name: 'src',
- type: 'filepicker',
- filetype: 'image',
- label: 'Source',
- autofocus: true,
- onchange: function (evt) {
- onSrcChange(evt, editor);
- },
- onbeforecall: onBeforeCall
- },
- imageListCtrl
- ];
- if ($_1dn8wtctjjgwebvz.hasDescription(editor)) {
- generalFormItems.push({
- name: 'alt',
- type: 'textbox',
- label: 'Image description'
- });
- }
- if ($_1dn8wtctjjgwebvz.hasImageTitle(editor)) {
- generalFormItems.push({
- name: 'title',
- type: 'textbox',
- label: 'Image Title'
- });
- }
- if ($_1dn8wtctjjgwebvz.hasDimensions(editor)) {
- generalFormItems.push($_ftlz5pdajjgweby4.createUi());
- }
- if ($_1dn8wtctjjgwebvz.getClassList(editor)) {
- generalFormItems.push({
- name: 'class',
- type: 'listbox',
- label: 'Class',
- values: $_1e8k4ncujjgwebw2.buildListItems($_1dn8wtctjjgwebvz.getClassList(editor), function (item) {
- if (item.value) {
- item.textStyle = function () {
- return editor.formatter.getCssText({
- inline: 'img',
- classes: [item.value]
- });
- };
- }
- })
- });
- }
- if ($_1dn8wtctjjgwebvz.hasImageCaption(editor)) {
- generalFormItems.push({
- name: 'caption',
- type: 'checkbox',
- label: 'Caption'
- });
- }
- return generalFormItems;
- };
- var makeTab$1 = function (editor, imageListCtrl) {
- return {
- title: 'General',
- type: 'form',
- items: getGeneralItems(editor, imageListCtrl)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var url = function () {
+ return Global$1.getOrDie('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">- };
- var $_78zck5d9jjgweby1 = {
- makeTab: makeTab$1,
- getGeneralItems: getGeneralItems
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createObjectURL = function (blob) {
+ return url().createObjectURL(blob);
+ };
+ var revokeObjectURL = function (u) {
+ url().revokeObjectURL(u);
+ };
+ var URL = {
+ createObjectURL: createObjectURL,
+ revokeObjectURL: revokeObjectURL
+ };
</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 url = function () {
- return $_oab1bcwjjgwebwl.getOrDie('URL');
- };
- var createObjectURL = function (blob) {
- return url().createObjectURL(blob);
- };
- var revokeObjectURL = function (u) {
- url().revokeObjectURL(u);
- };
- var $_86i13edcjjgwebya = {
- createObjectURL: createObjectURL,
- revokeObjectURL: revokeObjectURL
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$5 = tinymce.util.Tools.resolve('tinymce.ui.Factory');
</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 global$5 = tinymce.util.Tools.resolve('tinymce.ui.Factory');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function XMLHttpRequest () {
+ var f = Global$1.getOrDie('XMLHttpRequest');
+ return new f();
+ }
</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 XMLHttpRequest () {
- var f = $_oab1bcwjjgwebwl.getOrDie('XMLHttpRequest');
- return new f();
- }
-
- var noop = function () {
- };
- var pathJoin = function (path1, path2) {
- if (path1) {
- return path1.replace(/\/$/, '') + '/' + path2.replace(/^\//, '');
- }
- return path2;
- };
- function Uploader (settings) {
- var defaultHandler = function (blobInfo, success, failure, progress) {
- var xhr, formData;
- xhr = new XMLHttpRequest();
- xhr.open('POST', settings.url);
- xhr.withCredentials = settings.credentials;
- xhr.upload.onprogress = function (e) {
- progress(e.loaded / e.total * 100);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var noop = function () {
+ };
+ var pathJoin = function (path1, path2) {
+ if (path1) {
+ return path1.replace(/\/$/, '') + '/' + path2.replace(/^\//, '');
+ }
+ return path2;
+ };
+ function Uploader (settings) {
+ var defaultHandler = function (blobInfo, success, failure, progress) {
+ var xhr, formData;
+ xhr = XMLHttpRequest();
+ xhr.open('POST', settings.url);
+ xhr.withCredentials = settings.credentials;
+ xhr.upload.onprogress = function (e) {
+ progress(e.loaded / e.total * 100);
+ };
+ xhr.onerror = function () {
+ failure('Image upload failed due to a XHR Transport error. Code: ' + xhr.status);
+ };
+ xhr.onload = function () {
+ var json;
+ if (xhr.status < 200 || xhr.status >= 300) {
+ failure('HTTP Error: ' + xhr.status);
+ return;
+ }
+ json = JSON.parse(xhr.responseText);
+ if (!json || typeof json.location !== 'string') {
+ failure('Invalid JSON: ' + xhr.responseText);
+ return;
+ }
+ success(pathJoin(settings.basePath, json.location));
+ };
+ formData = new FormData();
+ formData.append('file', blobInfo.blob(), blobInfo.filename());
+ xhr.send(formData);
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- xhr.onerror = function () {
- failure('Image upload failed due to a XHR Transport error. Code: ' + xhr.status);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var uploadBlob = function (blobInfo, handler) {
+ return new global$1(function (resolve, reject) {
+ try {
+ handler(blobInfo, resolve, reject, noop);
+ } catch (ex) {
+ reject(ex.message);
+ }
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- xhr.onload = function () {
- var json;
- if (xhr.status < 200 || xhr.status >= 300) {
- failure('HTTP Error: ' + xhr.status);
- return;
- }
- json = JSON.parse(xhr.responseText);
- if (!json || typeof json.location !== 'string') {
- failure('Invalid JSON: ' + xhr.responseText);
- return;
- }
- success(pathJoin(settings.basePath, json.location));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isDefaultHandler = function (handler) {
+ return handler === defaultHandler;
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- formData = new FormData();
- formData.append('file', blobInfo.blob(), blobInfo.filename());
- xhr.send(formData);
- };
- var uploadBlob = function (blobInfo, handler) {
- return new global$1(function (resolve, reject) {
- try {
- handler(blobInfo, resolve, reject, noop);
- } catch (ex) {
- reject(ex.message);
- }
- });
- };
- var isDefaultHandler = function (handler) {
- return handler === defaultHandler;
- };
- var upload = function (blobInfo) {
- return !settings.url && isDefaultHandler(settings.handler) ? global$1.reject('Upload url missing from the settings.') : uploadBlob(blobInfo, settings.handler);
- };
- settings = global$2.extend({
- credentials: false,
- handler: defaultHandler
- }, settings);
- return { upload: upload };
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var upload = function (blobInfo) {
+ return !settings.url && isDefaultHandler(settings.handler) ? global$1.reject('Upload url missing from the settings.') : uploadBlob(blobInfo, settings.handler);
+ };
+ settings = global$2.extend({
+ credentials: false,
+ handler: defaultHandler
+ }, settings);
+ return { upload: upload };
+ }
</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 onFileInput = function (editor) {
- return function (evt) {
- var Throbber = global$5.get('Throbber');
- var rootControl = evt.control.rootControl;
- var throbber = new Throbber(rootControl.getEl());
- var file = evt.control.value();
- var blobUri = $_86i13edcjjgwebya.createObjectURL(file);
- var uploader = Uploader({
- url: $_1dn8wtctjjgwebvz.getUploadUrl(editor),
- basePath: $_1dn8wtctjjgwebvz.getUploadBasePath(editor),
- credentials: $_1dn8wtctjjgwebvz.getUploadCredentials(editor),
- handler: $_1dn8wtctjjgwebvz.getUploadHandler(editor)
- });
- var finalize = function () {
- throbber.hide();
- $_86i13edcjjgwebya.revokeObjectURL(blobUri);
- };
- throbber.show();
- return $_1e8k4ncujjgwebw2.blobToDataUri(file).then(function (dataUrl) {
- var blobInfo = editor.editorUpload.blobCache.create({
- blob: file,
- blobUri: blobUri,
- name: file.name ? file.name.replace(/\.[^\.]+$/, '') : null,
- base64: dataUrl.split(',')[1]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var onFileInput = function (editor) {
+ return function (evt) {
+ var Throbber = global$5.get('Throbber');
+ var rootControl = evt.control.rootControl;
+ var throbber = new Throbber(rootControl.getEl());
+ var file = evt.control.value();
+ var blobUri = URL.createObjectURL(file);
+ var uploader = Uploader({
+ url: Settings.getUploadUrl(editor),
+ basePath: Settings.getUploadBasePath(editor),
+ credentials: Settings.getUploadCredentials(editor),
+ handler: Settings.getUploadHandler(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 uploader.upload(blobInfo).then(function (url) {
- var src = rootControl.find('#src');
- src.value(url);
- rootControl.find('tabpanel')[0].activateTab(0);
- src.fire('change');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var finalize = function () {
+ throbber.hide();
+ URL.revokeObjectURL(blobUri);
+ };
+ throbber.show();
+ return Utils.blobToDataUri(file).then(function (dataUrl) {
+ var blobInfo = editor.editorUpload.blobCache.create({
+ blob: file,
+ blobUri: blobUri,
+ name: file.name ? file.name.replace(/\.[^\.]+$/, '') : null,
+ base64: dataUrl.split(',')[1]
+ });
+ return uploader.upload(blobInfo).then(function (url) {
+ var src = rootControl.find('#src');
+ src.value(url);
+ rootControl.find('tabpanel')[0].activateTab(0);
+ src.fire('change');
+ finalize();
+ return url;
+ });
+ }).catch(function (err) {
+ editor.windowManager.alert(err);
</ins><span class="cx" style="display: block; padding: 0 10px"> finalize();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return url;
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }).catch(function (err) {
- editor.windowManager.alert(err);
- finalize();
- });
</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">- };
- var acceptExts = '.jpg,.jpeg,.png,.gif';
- var makeTab$2 = function (editor) {
- return {
- title: 'Upload',
- type: 'form',
- layout: 'flex',
- direction: 'column',
- align: 'stretch',
- padding: '20 20 20 20',
- items: [
- {
- type: 'container',
- layout: 'flex',
- direction: 'column',
- align: 'center',
- spacing: 10,
- items: [
- {
- text: 'Browse for an image',
- type: 'browsebutton',
- accept: acceptExts,
- onchange: onFileInput(editor)
- },
- {
- text: 'OR',
- type: 'label'
- }
- ]
- },
- {
- text: 'Drop an image here',
- type: 'dropzone',
- accept: acceptExts,
- height: 100,
- onchange: onFileInput(editor)
- }
- ]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var acceptExts = '.jpg,.jpeg,.png,.gif';
+ var makeTab$2 = function (editor) {
+ return {
+ title: 'Upload',
+ type: 'form',
+ layout: 'flex',
+ direction: 'column',
+ align: 'stretch',
+ padding: '20 20 20 20',
+ items: [
+ {
+ type: 'container',
+ layout: 'flex',
+ direction: 'column',
+ align: 'center',
+ spacing: 10,
+ items: [
+ {
+ text: 'Browse for an image',
+ type: 'browsebutton',
+ accept: acceptExts,
+ onchange: onFileInput(editor)
+ },
+ {
+ text: 'OR',
+ type: 'label'
+ }
+ ]
+ },
+ {
+ text: 'Drop an image here',
+ type: 'dropzone',
+ accept: acceptExts,
+ height: 100,
+ onchange: onFileInput(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">- };
- var $_71qd7mdbjjgweby7 = { makeTab: makeTab$2 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var UploadTab = { makeTab: makeTab$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">- var curry = function (f) {
- var x = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- x[_i - 1] = arguments[_i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function curry(fn) {
+ var initialArgs = [];
+ for (var _i = 1; _i < arguments.length; _i++) {
+ initialArgs[_i - 1] = arguments[_i];
+ }
+ return function () {
+ var restArgs = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ restArgs[_i] = arguments[_i];
+ }
+ var all = initialArgs.concat(restArgs);
+ return fn.apply(null, all);
+ };
</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 args = new Array(arguments.length - 1);
- for (var i = 1; i < arguments.length; i++)
- args[i - 1] = arguments[i];
- return function () {
- var x = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- x[_i] = arguments[_i];
- }
- var newArgs = new Array(arguments.length);
- for (var j = 0; j < newArgs.length; j++)
- newArgs[j] = arguments[j];
- var all = args.concat(newArgs);
- return f.apply(null, all);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var submitForm = function (editor, evt) {
+ var win = evt.control.getRoot();
+ SizeManager.updateSize(win);
+ editor.undoManager.transact(function () {
+ var data = merge(readImageDataFromSelection(editor), win.toJSON());
+ insertOrUpdateImage(editor, data);
+ });
+ 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">- };
-
- var submitForm = function (editor, evt) {
- var win = evt.control.getRoot();
- $_ftlz5pdajjgweby4.updateSize(win);
- editor.undoManager.transact(function () {
- var data = merge(readImageDataFromSelection(editor), win.toJSON());
- insertOrUpdateImage(editor, data);
- });
- editor.editorUpload.uploadImagesAuto();
- };
- function Dialog (editor) {
- function showDialog(imageList) {
- var data = readImageDataFromSelection(editor);
- var win, imageListCtrl;
- if (imageList) {
- imageListCtrl = {
- type: 'listbox',
- label: 'Image list',
- name: 'image-list',
- values: $_1e8k4ncujjgwebw2.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');
- 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">+ function Dialog (editor) {
+ function showDialog(imageList) {
+ var data = readImageDataFromSelection(editor);
+ var win, imageListCtrl;
+ if (imageList) {
+ imageListCtrl = {
+ type: 'listbox',
+ label: 'Image list',
+ name: 'image-list',
+ values: Utils.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');
+ if (!altCtrl.value() || e.lastControl && altCtrl.value() === e.lastControl.text()) {
+ altCtrl.value(e.control.text());
+ }
+ win.find('#src').value(e.control.value()).fire('change');
+ },
+ onPostRender: function () {
+ 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">- win.find('#src').value(e.control.value()).fire('change');
- },
- onPostRender: function () {
- imageListCtrl = this;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ }
+ if (Settings.hasAdvTab(editor) || Settings.hasUploadUrl(editor) || Settings.hasUploadHandler(editor)) {
+ var body = [MainTab.makeTab(editor, imageListCtrl)];
+ if (Settings.hasAdvTab(editor)) {
+ body.push(AdvTab.makeTab(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">- };
- }
- if ($_1dn8wtctjjgwebvz.hasAdvTab(editor) || $_1dn8wtctjjgwebvz.hasUploadUrl(editor) || $_1dn8wtctjjgwebvz.hasUploadHandler(editor)) {
- var body = [$_78zck5d9jjgweby1.makeTab(editor, imageListCtrl)];
- if ($_1dn8wtctjjgwebvz.hasAdvTab(editor)) {
- body.push($_6dfy5vd3jjgwebxf.makeTab(editor));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (Settings.hasUploadUrl(editor) || Settings.hasUploadHandler(editor)) {
+ body.push(UploadTab.makeTab(editor));
+ }
+ win = editor.windowManager.open({
+ title: 'Insert/edit image',
+ data: data,
+ bodyType: 'tabpanel',
+ body: body,
+ onSubmit: curry(submitForm, editor)
+ });
+ } else {
+ win = editor.windowManager.open({
+ title: 'Insert/edit image',
+ data: data,
+ body: MainTab.getGeneralItems(editor, imageListCtrl),
+ onSubmit: curry(submitForm, 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">- if ($_1dn8wtctjjgwebvz.hasUploadUrl(editor) || $_1dn8wtctjjgwebvz.hasUploadHandler(editor)) {
- body.push($_71qd7mdbjjgweby7.makeTab(editor));
- }
- win = editor.windowManager.open({
- title: 'Insert/edit image',
- data: data,
- bodyType: 'tabpanel',
- body: body,
- onSubmit: curry(submitForm, editor)
- });
- } else {
- win = editor.windowManager.open({
- title: 'Insert/edit image',
- data: data,
- body: $_78zck5d9jjgweby1.getGeneralItems(editor, imageListCtrl),
- onSubmit: curry(submitForm, editor)
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ SizeManager.syncSize(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">- $_ftlz5pdajjgweby4.syncSize(win);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function open() {
+ Utils.createImageList(editor, showDialog);
+ }
+ return { open: open };
</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 open() {
- $_1e8k4ncujjgwebw2.createImageList(editor, showDialog);
- }
- return { open: open };
- }
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var register = function (editor) {
- editor.addCommand('mceImage', Dialog(editor).open);
- };
- var $_3lypdlcrjjgwebvs = { register: register };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register = function (editor) {
+ editor.addCommand('mceImage', Dialog(editor).open);
+ };
+ var Commands = { register: register };
</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 hasImageClass = function (node) {
- var className = node.attr('class');
- return className && /\bimage\b/.test(className);
- };
- var toggleContentEditableState = function (state) {
- return function (nodes) {
- var i = nodes.length, node;
- var toggleContentEditable = function (node) {
- node.attr('contenteditable', state ? 'true' : null);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasImageClass = function (node) {
+ var className = node.attr('class');
+ return className && /\bimage\b/.test(className);
+ };
+ var toggleContentEditableState = function (state) {
+ return function (nodes) {
+ var i = nodes.length, node;
+ var toggleContentEditable = function (node) {
+ node.attr('contenteditable', state ? 'true' : null);
+ };
+ while (i--) {
+ node = nodes[i];
+ if (hasImageClass(node)) {
+ node.attr('contenteditable', state ? 'false' : null);
+ global$2.each(node.getAll('figcaption'), toggleContentEditable);
+ }
+ }
</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];
- if (hasImageClass(node)) {
- node.attr('contenteditable', state ? 'false' : null);
- global$2.each(node.getAll('figcaption'), toggleContentEditable);
- }
- }
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var setup = function (editor) {
- editor.on('preInit', function () {
- editor.parser.addNodeFilter('figure', toggleContentEditableState(true));
- editor.serializer.addNodeFilter('figure', toggleContentEditableState(false));
- });
- };
- var $_5op6l2dhjjgwebym = { setup: setup };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setup = function (editor) {
+ editor.on('preInit', function () {
+ editor.parser.addNodeFilter('figure', toggleContentEditableState(true));
+ editor.serializer.addNodeFilter('figure', toggleContentEditableState(false));
+ });
+ };
+ var FilterContent = { setup: setup };
</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 register$1 = function (editor) {
- editor.addButton('image', {
- icon: 'image',
- tooltip: 'Insert/edit image',
- onclick: Dialog(editor).open,
- 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">+ var register$1 = function (editor) {
+ editor.addButton('image', {
+ icon: 'image',
+ tooltip: 'Insert/edit image',
+ onclick: Dialog(editor).open,
+ stateSelector: 'img:not([data-mce-object],[data-mce-placeholder]),figure.image'
+ });
+ editor.addMenuItem('image', {
+ icon: 'image',
+ text: 'Image',
+ onclick: Dialog(editor).open,
+ context: 'insert',
+ prependToContext: true
+ });
+ };
+ var Buttons = { register: register$1 };
+
+ global.add('image', function (editor) {
+ FilterContent.setup(editor);
+ Buttons.register(editor);
+ Commands.register(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">- editor.addMenuItem('image', {
- icon: 'image',
- text: 'Image',
- onclick: Dialog(editor).open,
- context: 'insert',
- prependToContext: true
- });
- };
- var $_dm869adijjgwebyn = { register: register$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function Plugin () {
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global.add('image', function (editor) {
- $_5op6l2dhjjgwebym.setup(editor);
- $_dm869adijjgwebyn.register(editor);
- $_3lypdlcrjjgwebvs.register(editor);
- });
- function Plugin () {
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Plugin;
</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 Plugin;
-
</del><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="trunksrcjs_enqueuesvendortinymcepluginsimagepluginminjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/plugins/image/plugin.min.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/plugins/image/plugin.min.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/plugins/image/plugin.min.js 2019-01-29 20:18:33 UTC (rev 44713)
</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(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=function(e){return!1!==e.settings.image_dimensions},i=function(e){return!0===e.settings.image_advtab},g=function(e){return e.getParam("image_prepend_url","")},n=function(e){return e.getParam("image_class_list")},r=function(e){return!1!==e.settings.image_description},a=function(e){return!0===e.settings.image_title},o=function(e){return!0===e.settings.image_caption},l=function(e){return e.getParam("image_list",!1)},u=function(e){return e.getParam("images_upload_url",!1)},c=function(e){return e.getParam("images_upload_handler",!1)},s=function(e){return e.getParam("images_upload_url")},m=function(e){return e.getParam("images_upload_handler")},f=function(e){return e.getParam("images_upload_base_path")
},p=function(e){return e.getParam("images_upload_credentials")},h="undefined"!=typeof window?window:Function("return this;")(),v=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:h,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},t={getOrDie:function(e,t){var n=v(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n}};function b(){return new(t.getOrDie("FileReader"))}var y,x=tinymce.util.Tools.resolve("tinymce.util.Promise"),w=tinymce.util.Tools.resolve("tinymce.util.Tools"),C=tinymce.util.Tools.resolve("tinymce.util.XHR"),S=function(e,t){return Math.max(parseInt(e,10),parseInt(t,10))},N=function(e,n){var r=document.createElement("img");function t(e,t){r.parentNode&&r.parentNode.removeChild(r),n({width:e,height:t})}r.onload=function(){t(S(r.width,r.clientWidth),S(r.heigh
t,r.clientHeight))},r.onerror=function(){t(0,0)};var a=r.style;a.visibility="hidden",a.position="fixed",a.bottom=a.left="0px",a.width=a.height="auto",document.body.appendChild(r),r.src=e},_=function(e,a,t){return function n(e,r){return r=r||[],w.each(e,function(e){var t={text:e.text||e.title};e.menu?t.menu=n(e.menu):(t.value=e.value,a(t)),r.push(t)}),r}(e,t||[])},A=function(e){return e&&(e=e.replace(/px$/,"")),e},T=function(e){return 0<e.length&&/^[0-9]+$/.test(e)&&(e+="px"),e},R=function(e){if(e.margin){var t=e.margin.split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"
;]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e},I=function(e,t){var n=l(e);"string"==typeof n?C.send({url:n,success:function(e){t(JSON.parse(e))}}):"function"==typeof n?n(t):t(n)},O=function(e,t,n){function r(){n.onload=n.onerror=null,e.selection&&(e.selection.select(n),e.nodeChanged())}n.onload=function(){t.width|
|t.height||!d(e)||e.dom.setAttribs(n,{width:n.clientWidth,height:n.clientHeight}),r()},n.onerror=r},L=function(r){return new x(function(e,t){var n=new b;n.onload=function(){e(n.result)},n.onerror=function(){t(b.error.message)},n.readAsDataURL(r)})},P=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),U=Object.prototype.hasOwnProperty,E=(y=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var a=e[r];for(var o in a)U.call(a,o)&&(n[o]=y(n[o],a[o]))}return n}),k=P.DOM,M=function(e){return e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?A(e.style.marginLeft):""},D=function(e){return e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?A(e.style.marginTop):""},z=function(e){return e.style.bor
derWidth?A(e.style.borderWidth):""},B=function(e,t){return e.hasAttribute(t)?e.getAttribute(t):""},H=function(e,t){return e.style[t]?e.style[t]:""},j=function(e){return null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName},F=function(e,t,n){e.setAttribute(t,n)},W=function(e){var t,n,r,a;j(e)?(a=(r=e).parentNode,k.insertAfter(r,a),k.remove(a)):(t=e,n=k.create("figure",{"class":"image"}),k.insertAfter(n,t),n.appendChild(t),n.appendChild(k.create("figcaption",{contentEditable:!0},"Caption")),n.contentEditable="false")},J=function(e,t){var n=e.getAttribute("style"),r=t(null!==n?n:"");0<r.length?(e.setAttribute("style",r),e.setAttribute("data-mce-style",r)):e.removeAttribute("style")},V=function(e,r){return function(e,t,n){e.style[t]?(e.style[t]=T(n),J(e,r)):F(e,t,n)}},G=function(e,t){return e.style[t]?A(e.style[t]):B(e,t)},$=fu
nction(e,t){var n=T(t);e.style.marginLeft=n,e.style.marginRight=n},X=function(e,t){var n=T(t);e.style.marginTop=n,e.style.marginBottom=n},q=function(e,t){var n=T(t);e.style.borderWidth=n},K=function(e,t){e.style.borderStyle=t},Q=function(e){return"FIGURE"===e.nodeName},Y=function(e,t){var n=document.createElement("img");return F(n,"style",t.style),(M(n)||""!==t.hspace)&&$(n,t.hspace),(D(n)||""!==t.vspace)&&X(n,t.vspace),(z(n)||""!==t.border)&&q(n,t.border),(H(n,"borderStyle")||""!==t.borderStyle)&&K(n,t.borderStyle),e(n.getAttribute("style"))},Z=function(e,t){return{src:B(t,"src"),alt:B(t,"alt"),title:B(t,"title"),width:G(t,"width"),height:G(t,"height"),"class":B(t,"class"),style:e(B(t,"style")),caption:j(t),hspace:M(t),vspace:D(t),border:z(t),borderStyle:H(t,"borderStyle")}
},ee=function(e,t,n,r,a){n[r]!==t[r]&&a(e,r,n[r])},te=function(r,a){return function(e,t,n){r(e,n),J(e,a)}},ne=function(e,t,n){var r=Z(e,n);ee(n,r,t,"caption",function(e,t,n){return W(e)}),ee(n,r,t,"src",F),ee(n,r,t,"alt",F),ee(n,r,t,"title",F),ee(n,r,t,"width",V(0,e)),ee(n,r,t,"height",V(0,e)),ee(n,r,t,"class",F),ee(n,r,t,"style",te(function(e,t){return F(e,"style",t)},e)),ee(n,r,t,"hspace",te($,e)),ee(n,r,t,"vspace",te(X,e)),ee(n,r,t,"border",te(q,e)),ee(n,r,t,"borderStyle",te(K,e))},re=function(e,t){var n=e.dom.styles.parse(t),r=R(n),a=e.dom.styles.parse(e.dom.styles.serialize(r));return e.dom.styles.serialize(a)},ae=function(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"figure.image");return n?e.dom.select("img",n)[0]:t&&("IMG"!==t.nodeName||t.getAttribute("data-mce-object")||t.getAttribute(
"data-mce-placeholder"))?null:t},oe=function(t,e){var n=t.dom,r=n.getParent(e.parentNode,function(e){return t.schema.getTextBlockElements()[e.nodeName]});return r?n.split(r,e):e},ie=function(t){var e=ae(t);return e?Z(function(e){return re(t,e)},e):{src:"",alt:"",title:"",width:"",height:"","class":"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:""}},le=function(t,e){var n=function(e,t){var n=document.createElement("img");if(ne(e,E(t,{caption:!1}),n),F(n,"alt",t.alt),t.caption){var r=k.create("figure",{"class":"image"});return r.appendChild(n),r.appendChild(k.create("figcaption",{contentEditable:!0},"Caption")),r.contentEditable="false",r}return n}(function(e){return re(t,e)},e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.selecti
on.setContent(n.outerHTML);var r=t.dom.select('*[data-mce-id="__mcenew"]')[0];if(t.dom.setAttrib(r,"data-mce-id",null),Q(r)){var a=oe(t,r);t.selection.select(a)}else t.selection.select(r)},ue=function(e,t){var n=ae(e);n?t.src?function(t,e){var n,r=ae(t);if(ne(function(e){return re(t,e)},e,r),n=r,t.dom.setAttrib(n,"src",n.getAttribute("src")),Q(r.parentNode)){var a=r.parentNode;oe(t,a),t.selection.select(r.parentNode)}else t.selection.select(r),O(t,e,r)}(e,t):function(e,t){if(t){var n=e.dom.is(t.parentNode,"figure.image")?t.parentNode:t;e.dom.remove(n),e.focus(),e.nodeChanged(),e.dom.isEmpty(e.getBody())&&(e.setContent(""),e.selection.setCursorLocation())}}(e,n):t.src&&le(e,t)},ce=function(n,r){r.find("#style").each(function(e){var t=Y(function(e){return re(n,e)},E({src:"",alt:"",title:"",width:"",height:"","class":"",style:"
",caption:!1,hspace:"",vspace:"",border:"",borderStyle:""},r.toJSON()));e.value(t)})},se=function(t){return{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox",onchange:(o=t,function(e){var t=o.dom,n=e.control.rootControl;if(i(o)){var r=n.toJSON(),a=t.parseStyle(r.style);n.find("#vspace").value(""),n.find("#hspace").value(""),((a=R(a))["margin-top"]&&a["margin-bottom"]||a["margin-right"]&&a["margin-left"])&&(a["margin-top"]===a["margin-bottom"]?n.find("#vspace").value(A(a["margin-top"])):n.find("#vspace").value(""),a["margin-right"]===a["margin-left"]?n.find("#hspace").value(A(a["margin-right"])):n.find("#hspace").value("&quo
t;)),a["border-width"]?n.find("#border").value(A(a["border-width"])):n.find("#border").value(""),a["border-style"]?n.find("#borderStyle").value(a["border-style"]):n.find("#borderStyle").value(""),n.find("#style").value(t.serializeStyle(t.parseStyle(t.serializeStyle(a))))}})},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,defaults:{type:"textbox",maxWidth:50,onchange:function(e){ce(t,e.control.rootControl)}},items:[{label:"Vertical space",name:"vspace"},{label:"Border width",name:"border"},{label:"Horizontal space",name:"hspace"},{label:"Border style",type:"listbox",name:"borderStyle",width:90,maxWidth:90,onselect:function(e){ce(t,e.control.rootControl)},values:[{text:"Select...",value:""},{text:"Solid",v
alue:"solid"},{text:"Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]};var o},de=function(e,t){e.state.set("oldVal",e.value()),t.state.set("oldVal",t.value())},ge=function(e,t){var n=e.find("#width")[0],r=e.find("#height")[0],a=e.find("#constrain")[0];n&&r&&a&&t(n,r,a.checked())},me=function(e,t,n){var r=e.state.get("oldVal"),a=t.state.get("oldVal"),o=e.value(),i=t.value();n&&r&&a&&o&&i&&(o!==r?(i=Math.round(o/r*i),isNaN(i)||t.value(i)):(o=Math.roun
d(i/a*o),isNaN(o)||e.value(o))),de(e,t)},fe=function(e){ge(e,me)},pe=function(){var e=function(e){fe(e.control.rootControl)};return{type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:5,onchange:e,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:5,onchange:e,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}},he=function(e){ge(e,de)},ve=fe,be=function(e){e.meta=e.control.rootControl.toJSON()},ye=function(s,e){var t=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:function(e){var t,n,r,a,o,i,l,u,c;n=s,i=(t=e).meta||{},l=t.control,u=l.rootControl,(c=u.find("#image-list")[0])&&c.value(n
.convertURL(l.value(),"src")),w.each(i,function(e,t){u.find("#"+t).value(e)}),i.width||i.height||(r=n.convertURL(l.value(),"src"),a=g(n),o=new RegExp("^(?:[a-z]+:)?//","i"),a&&!o.test(r)&&r.substring(0,a.length)!==a&&(r=a+r),l.value(r),N(n.documentBaseURI.toAbsolute(l.value()),function(e){e.width&&e.height&&d(n)&&(u.find("#width").value(e.width),u.find("#height").value(e.height),he(u))}))},onbeforecall:be},e];return r(s)&&t.push({name:"alt",type:"textbox",label:"Image description"}),a(s)&&t.push({name:"title",type:"textbox",label:"Image Title"}),d(s)&&t.push(pe()),n(s)&&t.push({name:"class",type:"listbox",label:"Class",values:_(n(s),function(e){e.value&&(e.textStyle=function(){return s.formatter.getCssText({inline:"img",classes:[
e.value]})})})}),o(s)&&t.push({name:"caption",type:"checkbox",label:"Caption"}),t},xe=function(e,t){return{title:"General",type:"form",items:ye(e,t)}},we=ye,Ce=function(){return t.getOrDie("URL")},Se=function(e){return Ce().createObjectURL(e)},Ne=function(e){Ce().revokeObjectURL(e)},_e=tinymce.util.Tools.resolve("tinymce.ui.Factory");function Ae(){return new(t.getOrDie("XMLHttpRequest"))}var Te=function(){};function Re(i){var t=function(e,r,a,t){var o,n;(o=new Ae).open("POST",i.url),o.withCredentials=i.credentials,o.upload.onprogress=function(e){t(e.loaded/e.total*100)},o.onerror=function(){a("Image upload failed due to a XHR Transport error. Code: "+o.status)},o.onload=function(){var e,t,n;o.status<200||300<=o.status?a("HTTP Error: "+o.status):(e=JSON.parse(o.responseText))&&"string"==typeof e.location?r((t=i.basePath,n=e.location,t?t.replace
(/\/$/,"")+"/"+n.replace(/^\//,""):n)):a("Invalid JSON: "+o.responseText)},(n=new FormData).append("file",e.blob(),e.filename()),o.send(n)};return i=w.extend({credentials:!1,handler:t},i),{upload:function(e){return i.url||i.handler!==t?(r=e,a=i.handler,new x(function(e,t){try{a(r,e,t,Te)}catch(n){t(n.message)}})):x.reject("Upload url missing from the settings.");var r,a}}}var Ie=function(u){return function(e){var t=_e.get("Throbber"),n=e.control.rootControl,r=new t(n.getEl()),a=e.control.value(),o=Se(a),i=Re({url:s(u),basePath:f(u),credentials:p(u),handler:m(u)}),l=function(){r.hide(),Ne(o)};return r.show(),L(a).then(function(e){var t=u.editorUpload.blobCache.create({blob:a,blobUri:o,name:a.name?a.name.replace(/\.[^\.]+$/,""):null,base64:e.split(",")[1]});return i.upload(t).then(function(e){var t=n.find("#src");return t.value(e),n.find("tabpanel")[0].activateTab(0),t.fire(&q
uot;change"),l(),e})})["catch"](function(e){u.windowManager.alert(e),l()})}},Oe=".jpg,.jpeg,.png,.gif",Le=function(e){return{title:"Upload",type:"form",layout:"flex",direction:"column",align:"stretch",padding:"20 20 20 20",items:[{type:"container",layout:"flex",direction:"column",align:"center",spacing:10,items:[{text:"Browse for an image",type:"browsebutton",accept:Oe,onchange:Ie(e)},{text:"OR",type:"label"}]},{text:"Drop an image here",type:"dropzone",accept:Oe,height:100,onchange:Ie(e)}]}},Pe=function(o){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var i=new Array(arguments.length-1),n=1;n<arguments.length;n++)i[n-1]=arguments[n];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=ar
guments[r];var a=i.concat(n);return o.apply(null,a)}},Ue=function(t,e){var n=e.control.getRoot();ve(n),t.undoManager.transact(function(){var e=E(ie(t),n.toJSON());ue(t,e)}),t.editorUpload.uploadImagesAuto()};function Ee(o){function e(e){var n,t,r=ie(o);if(e&&(t={type:"listbox",label:"Image list",name:"image-list",values:_(e,function(e){e.value=o.convertURL(e.value||e.url,"src")},[{text:"None",value:""}]),value:r.src&&o.convertURL(r.src,"src"),onselect:function(e){var t=n.find("#alt");(!t.value()||e.lastControl&&t.value()===e.lastControl.text())&&t.value(e.control.text()),n.find("#src").value(e.control.value()).fire("change")},onPostRender:function(){t=this}}),i(o)||u(o)||c(o)){var a=[xe(o,t)];i(o)&&a.push(se(o)),(u(o)||c(o))&&a.push(Le(o)),n=o.windowManager.open({title:"Insert/edit image",data:r,bodyType:"tabpanel",bo
dy:a,onSubmit:Pe(Ue,o)})}else n=o.windowManager.open({title:"Insert/edit image",data:r,body:we(o,t),onSubmit:Pe(Ue,o)});he(n)}return{open:function(){I(o,e)}}}var ke=function(e){e.addCommand("mceImage",Ee(e).open)},Me=function(o){return function(e){for(var t,n,r=e.length,a=function(e){e.attr("contenteditable",o?"true":null)};r--;)t=e[r],(n=t.attr("class"))&&/\bimage\b/.test(n)&&(t.attr("contenteditable",o?"false":null),w.each(t.getAll("figcaption"),a))}},De=function(e){e.on("preInit",function(){e.parser.addNodeFilter("figure",Me(!0)),e.serializer.addNodeFilter("figure",Me(!1))})},ze=function(e){e.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:Ee(e).open,stateSelector:"img:not([data-mce-object],[data-mce-placeholder]),figure.image"}),e.addMenuItem("image",{icon:"image",text:"I
mage",onclick:Ee(e).open,context:"insert",prependToContext:!0})};e.add("image",function(e){De(e),ze(e),ke(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(){"use strict";var i,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=function(e){return!1!==e.settings.image_dimensions},l=function(e){return!0===e.settings.image_advtab},m=function(e){return e.getParam("image_prepend_url","")},n=function(e){return e.getParam("image_class_list")},r=function(e){return!1!==e.settings.image_description},a=function(e){return!0===e.settings.image_title},o=function(e){return!0===e.settings.image_caption},u=function(e){return e.getParam("image_list",!1)},c=function(e){return e.getParam("images_upload_url",!1)},s=function(e){return e.getParam("images_upload_handler",!1)},g=function(e){return e.getParam("images_upload_url")},f=function(e){return e.getParam("images_upload_handler")},p=function(e){return e.getParam("images_upload_base_path"
;)},h=function(e){return e.getParam("images_upload_credentials")},v="undefined"!=typeof window?window:Function("return this;")(),b=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:v,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},y={getOrDie:function(e,t){var n=b(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n}},x=tinymce.util.Tools.resolve("tinymce.util.Promise"),w=tinymce.util.Tools.resolve("tinymce.util.Tools"),C=tinymce.util.Tools.resolve("tinymce.util.XHR"),S=function(e,t){return Math.max(parseInt(e,10),parseInt(t,10))},N=function(e,n){var r=document.createElement("img");function t(e,t){r.parentNode&&r.parentNode.removeChild(r),n({width:e,height:t})}r.onload=function(){t(S(r.width,r.clientWidth),S(r.height,r.clientHeight))},r.onerror=function(){t(0,0)};var a=r.style;a
.visibility="hidden",a.position="fixed",a.bottom=a.left="0px",a.width=a.height="auto",document.body.appendChild(r),r.src=e},_=function(e,a,t){return function n(e,r){return r=r||[],w.each(e,function(e){var t={text:e.text||e.title};e.menu?t.menu=n(e.menu):(t.value=e.value,a(t)),r.push(t)}),r}(e,t||[])},T=function(e){return e&&(e=e.replace(/px$/,"")),e},A=function(e){return 0<e.length&&/^[0-9]+$/.test(e)&&(e+="px"),e},R=function(e){if(e.margin){var t=e.margin.split(" ");switch(t.length){case 1:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[0],e["margin-bottom"]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[0];break;case 2:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"
]=e["margin-bottom"]||t[0],e["margin-left"]=e["margin-left"]||t[1];break;case 3:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[1];break;case 4:e["margin-top"]=e["margin-top"]||t[0],e["margin-right"]=e["margin-right"]||t[1],e["margin-bottom"]=e["margin-bottom"]||t[2],e["margin-left"]=e["margin-left"]||t[3]}delete e.margin}return e},t=function(e,t){var n=u(e);"string"==typeof n?C.send({url:n,success:function(e){t(JSON.parse(e))}}):"function"==typeof n?n(t):t(n)},I=function(e,t,n){function r(){n.onload=n.onerror=null,e.selection&&(e.selection.select(n),e.nodeChanged())}n.onload=function(){t.width||t.height||!d(e)||e.dom.setAttribs(n,{width:n.clientWidth,height
:n.clientHeight}),r()},n.onerror=r},O=function(r){return new x(function(e,t){var n=new(y.getOrDie("FileReader"));n.onload=function(){e(n.result)},n.onerror=function(){t(n.error.message)},n.readAsDataURL(r)})},L=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),P=Object.prototype.hasOwnProperty,U=(i=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var a=e[r];for(var o in a)P.call(a,o)&&(n[o]=i(n[o],a[o]))}return n}),E=L.DOM,k=function(e){return e.style.marginLeft&&e.style.marginRight&&e.style.marginLeft===e.style.marginRight?T(e.style.marginLeft):""},M=function(e){return e.style.marginTop&&e.style.marginBottom&&e.style.marginTop===e.style.marginBottom?T(e.style.marginTop):""},D=function(e){return e.style.borderWidth?T(e.style.borderWidth
):""},z=function(e,t){return e.hasAttribute(t)?e.getAttribute(t):""},B=function(e,t){return e.style[t]?e.style[t]:""},H=function(e){return null!==e.parentNode&&"FIGURE"===e.parentNode.nodeName},j=function(e,t,n){e.setAttribute(t,n)},F=function(e){var t,n,r,a;H(e)?(a=(r=e).parentNode,E.insertAfter(r,a),E.remove(a)):(t=e,n=E.create("figure",{"class":"image"}),E.insertAfter(n,t),n.appendChild(t),n.appendChild(E.create("figcaption",{contentEditable:!0},"Caption")),n.contentEditable="false")},W=function(e,t){var n=e.getAttribute("style"),r=t(null!==n?n:"");0<r.length?(e.setAttribute("style",r),e.setAttribute("data-mce-style",r)):e.removeAttribute("style")},J=function(e,r){return function(e,t,n){e.style[t]?(e.style[t]=A(n),W(e,r)):j(e,t,n)}},V=function(e,t){return e.style[t]?T(e.style[t]):z(e,t)},G=function(e,t){var n=A(t);e.style
.marginLeft=n,e.style.marginRight=n},$=function(e,t){var n=A(t);e.style.marginTop=n,e.style.marginBottom=n},X=function(e,t){var n=A(t);e.style.borderWidth=n},q=function(e,t){e.style.borderStyle=t},K=function(e){return"FIGURE"===e.nodeName},Q=function(e,t){var n=document.createElement("img");return j(n,"style",t.style),(k(n)||""!==t.hspace)&&G(n,t.hspace),(M(n)||""!==t.vspace)&&$(n,t.vspace),(D(n)||""!==t.border)&&X(n,t.border),(B(n,"borderStyle")||""!==t.borderStyle)&&q(n,t.borderStyle),e(n.getAttribute("style"))},Y=function(e,t){return{src:z(t,"src"),alt:z(t,"alt"),title:z(t,"title"),width:V(t,"width"),height:V(t,"height"),"class":z(t,"class"),style:e(z(t,"style")),caption:H(t),hspace:k(t),vspace:M(t),border:D(t),borderStyle:B(t,"borderStyle")}},Z=function(e,t,n,r,a){n[r]!=
=t[r]&&a(e,r,n[r])},ee=function(r,a){return function(e,t,n){r(e,n),W(e,a)}},te=function(e,t,n){var r=Y(e,n);Z(n,r,t,"caption",function(e,t,n){return F(e)}),Z(n,r,t,"src",j),Z(n,r,t,"alt",j),Z(n,r,t,"title",j),Z(n,r,t,"width",J(0,e)),Z(n,r,t,"height",J(0,e)),Z(n,r,t,"class",j),Z(n,r,t,"style",ee(function(e,t){return j(e,"style",t)},e)),Z(n,r,t,"hspace",ee(G,e)),Z(n,r,t,"vspace",ee($,e)),Z(n,r,t,"border",ee(X,e)),Z(n,r,t,"borderStyle",ee(q,e))},ne=function(e,t){var n=e.dom.styles.parse(t),r=R(n),a=e.dom.styles.parse(e.dom.styles.serialize(r));return e.dom.styles.serialize(a)},re=function(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"figure.image");return n?e.dom.select("img",n)[0]:t&&("IMG"!==t.nodeName||t.getAttribute("data-mce-object")||t.getAttribute("data-mce-placeholder"))?null:t},
ae=function(t,e){var n=t.dom,r=n.getParent(e.parentNode,function(e){return t.schema.getTextBlockElements()[e.nodeName]},t.getBody());return r?n.split(r,e):e},oe=function(t){var e=re(t);return e?Y(function(e){return ne(t,e)},e):{src:"",alt:"",title:"",width:"",height:"","class":"",style:"",caption:!1,hspace:"",vspace:"",border:"",borderStyle:""}},ie=function(t,e){var n=function(e,t){var n=document.createElement("img");if(te(e,U(t,{caption:!1}),n),j(n,"alt",t.alt),t.caption){var r=E.create("figure",{"class":"image"});return r.appendChild(n),r.appendChild(E.create("figcaption",{contentEditable:!0},"Caption")),r.contentEditable="false",r}return n}(function(e){return ne(t,e)},e);t.dom.setAttrib(n,"data-mce-id","__mcenew"),t.focus(),t.selection.setContent(n.outerHTML);var
r=t.dom.select('*[data-mce-id="__mcenew"]')[0];if(t.dom.setAttrib(r,"data-mce-id",null),K(r)){var a=ae(t,r);t.selection.select(a)}else t.selection.select(r)},le=function(e,t){var n=re(e);n?t.src?function(t,e){var n,r=re(t);if(te(function(e){return ne(t,e)},e,r),n=r,t.dom.setAttrib(n,"src",n.getAttribute("src")),K(r.parentNode)){var a=r.parentNode;ae(t,a),t.selection.select(r.parentNode)}else t.selection.select(r),I(t,e,r)}(e,t):function(e,t){if(t){var n=e.dom.is(t.parentNode,"figure.image")?t.parentNode:t;e.dom.remove(n),e.focus(),e.nodeChanged(),e.dom.isEmpty(e.getBody())&&(e.setContent(""),e.selection.setCursorLocation())}}(e,n):t.src&&ie(e,t)},ue=function(n,r){r.find("#style").each(function(e){var t=Q(function(e){return ne(n,e)},U({src:"",alt:"",title:"",width:"",height:"","class":"",style:"",caption:!1,hspace:"
",vspace:"",border:"",borderStyle:""},r.toJSON()));e.value(t)})},ce=function(t){return{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox",onchange:(o=t,function(e){var t=o.dom,n=e.control.rootControl;if(l(o)){var r=n.toJSON(),a=t.parseStyle(r.style);n.find("#vspace").value(""),n.find("#hspace").value(""),((a=R(a))["margin-top"]&&a["margin-bottom"]||a["margin-right"]&&a["margin-left"])&&(a["margin-top"]===a["margin-bottom"]?n.find("#vspace").value(T(a["margin-top"])):n.find("#vspace").value(""),a["margin-right"]===a["margin-left"]?n.find("#hspace").value(T(a["margin-right"])):n.find("#hspace").value("")),a["border-width"
]?n.find("#border").value(T(a["border-width"])):n.find("#border").value(""),a["border-style"]?n.find("#borderStyle").value(a["border-style"]):n.find("#borderStyle").value(""),n.find("#style").value(t.serializeStyle(t.parseStyle(t.serializeStyle(a))))}})},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,defaults:{type:"textbox",maxWidth:50,onchange:function(e){ue(t,e.control.rootControl)}},items:[{label:"Vertical space",name:"vspace"},{label:"Border width",name:"border"},{label:"Horizontal space",name:"hspace"},{label:"Border style",type:"listbox",name:"borderStyle",width:90,maxWidth:90,onselect:function(e){ue(t,e.control.rootControl)},values:[{text:"Select...",value:""},{text:"Solid",value:"solid"},{text:&
quot;Dotted",value:"dotted"},{text:"Dashed",value:"dashed"},{text:"Double",value:"double"},{text:"Groove",value:"groove"},{text:"Ridge",value:"ridge"},{text:"Inset",value:"inset"},{text:"Outset",value:"outset"},{text:"None",value:"none"},{text:"Hidden",value:"hidden"}]}]}]};var o},se=function(e,t){e.state.set("oldVal",e.value()),t.state.set("oldVal",t.value())},de=function(e,t){var n=e.find("#width")[0],r=e.find("#height")[0],a=e.find("#constrain")[0];n&&r&&a&&t(n,r,a.checked())},me=function(e,t,n){var r=e.state.get("oldVal"),a=t.state.get("oldVal"),o=e.value(),i=t.value();n&&r&&a&&o&&i&&(o!==r?(i=Math.round(o/r*i),isNaN(i)||t.value(i)):(o=Math.round(i/a*o),isNaN(o)||e.value(o)))
,se(e,t)},ge=function(e){de(e,me)},fe=function(){var e=function(e){ge(e.control.rootControl)};return{type:"container",label:"Dimensions",layout:"flex",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:5,onchange:e,ariaLabel:"Width"},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:5,onchange:e,ariaLabel:"Height"},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}},pe=function(e){de(e,se)},he=ge,ve=function(e){e.meta=e.control.rootControl.toJSON()},be=function(s,e){var t=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:function(e){var t,n,r,a,o,i,l,u,c;n=s,i=(t=e).meta||{},l=t.control,u=l.rootControl,(c=u.find("#image-list")[0])&&c.value(n.convertURL(l.value(),"src
")),w.each(i,function(e,t){u.find("#"+t).value(e)}),i.width||i.height||(r=n.convertURL(l.value(),"src"),a=m(n),o=new RegExp("^(?:[a-z]+:)?//","i"),a&&!o.test(r)&&r.substring(0,a.length)!==a&&(r=a+r),l.value(r),N(n.documentBaseURI.toAbsolute(l.value()),function(e){e.width&&e.height&&d(n)&&(u.find("#width").value(e.width),u.find("#height").value(e.height),pe(u))}))},onbeforecall:ve},e];return r(s)&&t.push({name:"alt",type:"textbox",label:"Image description"}),a(s)&&t.push({name:"title",type:"textbox",label:"Image Title"}),d(s)&&t.push(fe()),n(s)&&t.push({name:"class",type:"listbox",label:"Class",values:_(n(s),function(e){e.value&&(e.textStyle=function(){return s.formatter.getCssText({inline:"img",classes:[e.value]})})})}),o(s)&&
t.push({name:"caption",type:"checkbox",label:"Caption"}),t},ye=function(e,t){return{title:"General",type:"form",items:be(e,t)}},xe=be,we=function(){return y.getOrDie("URL")},Ce=function(e){return we().createObjectURL(e)},Se=function(e){we().revokeObjectURL(e)},Ne=tinymce.util.Tools.resolve("tinymce.ui.Factory"),_e=function(){};function Te(i){var t=function(e,r,a,t){var o,n;(o=new(y.getOrDie("XMLHttpRequest"))).open("POST",i.url),o.withCredentials=i.credentials,o.upload.onprogress=function(e){t(e.loaded/e.total*100)},o.onerror=function(){a("Image upload failed due to a XHR Transport error. Code: "+o.status)},o.onload=function(){var e,t,n;o.status<200||300<=o.status?a("HTTP Error: "+o.status):(e=JSON.parse(o.responseText))&&"string"==typeof e.location?r((t=i.basePath,n=e.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""
):n)):a("Invalid JSON: "+o.responseText)},(n=new FormData).append("file",e.blob(),e.filename()),o.send(n)};return i=w.extend({credentials:!1,handler:t},i),{upload:function(e){return i.url||i.handler!==t?(r=e,a=i.handler,new x(function(e,t){try{a(r,e,t,_e)}catch(n){t(n.message)}})):x.reject("Upload url missing from the settings.");var r,a}}}var Ae=function(u){return function(e){var t=Ne.get("Throbber"),n=e.control.rootControl,r=new t(n.getEl()),a=e.control.value(),o=Ce(a),i=Te({url:g(u),basePath:p(u),credentials:h(u),handler:f(u)}),l=function(){r.hide(),Se(o)};return r.show(),O(a).then(function(e){var t=u.editorUpload.blobCache.create({blob:a,blobUri:o,name:a.name?a.name.replace(/\.[^\.]+$/,""):null,base64:e.split(",")[1]});return i.upload(t).then(function(e){var t=n.find("#src");return t.value(e),n.find("tabpanel")[0].activateTab(0),t.fire("change"),l(),e})})["catch"](function(e){u.wi
ndowManager.alert(e),l()})}},Re=".jpg,.jpeg,.png,.gif",Ie=function(e){return{title:"Upload",type:"form",layout:"flex",direction:"column",align:"stretch",padding:"20 20 20 20",items:[{type:"container",layout:"flex",direction:"column",align:"center",spacing:10,items:[{text:"Browse for an image",type:"browsebutton",accept:Re,onchange:Ae(e)},{text:"OR",type:"label"}]},{text:"Drop an image here",type:"dropzone",accept:Re,height:100,onchange:Ae(e)}]}};function Oe(r){for(var a=[],e=1;e<arguments.length;e++)a[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=a.concat(e);return r.apply(null,n)}}var Le=function(t,e){var n=e.control.getRoot();he(n),t.undoManager.transact(function(){var e=U(oe(t),n.toJSON());le(t,e)}),t.editorUpload.uploadImagesAuto()};function Pe(o){funct
ion e(e){var n,t,r=oe(o);if(e&&(t={type:"listbox",label:"Image list",name:"image-list",values:_(e,function(e){e.value=o.convertURL(e.value||e.url,"src")},[{text:"None",value:""}]),value:r.src&&o.convertURL(r.src,"src"),onselect:function(e){var t=n.find("#alt");(!t.value()||e.lastControl&&t.value()===e.lastControl.text())&&t.value(e.control.text()),n.find("#src").value(e.control.value()).fire("change")},onPostRender:function(){t=this}}),l(o)||c(o)||s(o)){var a=[ye(o,t)];l(o)&&a.push(ce(o)),(c(o)||s(o))&&a.push(Ie(o)),n=o.windowManager.open({title:"Insert/edit image",data:r,bodyType:"tabpanel",body:a,onSubmit:Oe(Le,o)})}else n=o.windowManager.open({title:"Insert/edit image",data:r,body:xe(o,t),onSubmit:Oe(Le,o)});pe(n)}return{open:function(){t(o,e)}}}var Ue=function(e){e.addCommand("mceImage",Pe(e).o
pen)},Ee=function(o){return function(e){for(var t,n,r=e.length,a=function(e){e.attr("contenteditable",o?"true":null)};r--;)t=e[r],(n=t.attr("class"))&&/\bimage\b/.test(n)&&(t.attr("contenteditable",o?"false":null),w.each(t.getAll("figcaption"),a))}},ke=function(e){e.on("preInit",function(){e.parser.addNodeFilter("figure",Ee(!0)),e.serializer.addNodeFilter("figure",Ee(!1))})},Me=function(e){e.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:Pe(e).open,stateSelector:"img:not([data-mce-object],[data-mce-placeholder]),figure.image"}),e.addMenuItem("image",{icon:"image",text:"Image",onclick:Pe(e).open,context:"insert",prependToContext:!0})};e.add("image",function(e){ke(e),Me(e),Ue(e)})}();
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcjs_enqueuesvendortinymcepluginslinkpluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/plugins/link/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/plugins/link/plugin.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/plugins/link/plugin.js 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,713 +1,713 @@
</span><span class="cx" style="display: block; padding: 0 10px"> (function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var link = (function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'use strict';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'use strict';
</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 global = tinymce.util.Tools.resolve('tinymce.PluginManager');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global = tinymce.util.Tools.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">- var global$1 = tinymce.util.Tools.resolve('tinymce.util.VK');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$1 = tinymce.util.Tools.resolve('tinymce.util.VK');
</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 assumeExternalTargets = function (editorSettings) {
- return typeof editorSettings.link_assume_external_targets === 'boolean' ? editorSettings.link_assume_external_targets : false;
- };
- var hasContextToolbar = function (editorSettings) {
- return typeof editorSettings.link_context_toolbar === 'boolean' ? editorSettings.link_context_toolbar : false;
- };
- var getLinkList = function (editorSettings) {
- return editorSettings.link_list;
- };
- var hasDefaultLinkTarget = function (editorSettings) {
- return typeof editorSettings.default_link_target === 'string';
- };
- var getDefaultLinkTarget = function (editorSettings) {
- return editorSettings.default_link_target;
- };
- var getTargetList = function (editorSettings) {
- return editorSettings.target_list;
- };
- var setTargetList = function (editor, list) {
- editor.settings.target_list = list;
- };
- var shouldShowTargetList = function (editorSettings) {
- return getTargetList(editorSettings) !== false;
- };
- var getRelList = function (editorSettings) {
- return editorSettings.rel_list;
- };
- var hasRelList = function (editorSettings) {
- return getRelList(editorSettings) !== undefined;
- };
- var getLinkClassList = function (editorSettings) {
- return editorSettings.link_class_list;
- };
- var hasLinkClassList = function (editorSettings) {
- return getLinkClassList(editorSettings) !== undefined;
- };
- var shouldShowLinkTitle = function (editorSettings) {
- return editorSettings.link_title !== false;
- };
- var allowUnsafeLinkTarget = function (editorSettings) {
- return typeof editorSettings.allow_unsafe_link_target === 'boolean' ? editorSettings.allow_unsafe_link_target : false;
- };
- var $_1b4wbxfvjjgwechi = {
- assumeExternalTargets: assumeExternalTargets,
- hasContextToolbar: hasContextToolbar,
- getLinkList: getLinkList,
- hasDefaultLinkTarget: hasDefaultLinkTarget,
- getDefaultLinkTarget: getDefaultLinkTarget,
- getTargetList: getTargetList,
- setTargetList: setTargetList,
- shouldShowTargetList: shouldShowTargetList,
- getRelList: getRelList,
- hasRelList: hasRelList,
- getLinkClassList: getLinkClassList,
- hasLinkClassList: hasLinkClassList,
- shouldShowLinkTitle: shouldShowLinkTitle,
- allowUnsafeLinkTarget: allowUnsafeLinkTarget
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var assumeExternalTargets = function (editorSettings) {
+ return typeof editorSettings.link_assume_external_targets === 'boolean' ? editorSettings.link_assume_external_targets : false;
+ };
+ var hasContextToolbar = function (editorSettings) {
+ return typeof editorSettings.link_context_toolbar === 'boolean' ? editorSettings.link_context_toolbar : false;
+ };
+ var getLinkList = function (editorSettings) {
+ return editorSettings.link_list;
+ };
+ var hasDefaultLinkTarget = function (editorSettings) {
+ return typeof editorSettings.default_link_target === 'string';
+ };
+ var getDefaultLinkTarget = function (editorSettings) {
+ return editorSettings.default_link_target;
+ };
+ var getTargetList = function (editorSettings) {
+ return editorSettings.target_list;
+ };
+ var setTargetList = function (editor, list) {
+ editor.settings.target_list = list;
+ };
+ var shouldShowTargetList = function (editorSettings) {
+ return getTargetList(editorSettings) !== false;
+ };
+ var getRelList = function (editorSettings) {
+ return editorSettings.rel_list;
+ };
+ var hasRelList = function (editorSettings) {
+ return getRelList(editorSettings) !== undefined;
+ };
+ var getLinkClassList = function (editorSettings) {
+ return editorSettings.link_class_list;
+ };
+ var hasLinkClassList = function (editorSettings) {
+ return getLinkClassList(editorSettings) !== undefined;
+ };
+ var shouldShowLinkTitle = function (editorSettings) {
+ return editorSettings.link_title !== false;
+ };
+ var allowUnsafeLinkTarget = function (editorSettings) {
+ return typeof editorSettings.allow_unsafe_link_target === 'boolean' ? editorSettings.allow_unsafe_link_target : false;
+ };
+ var Settings = {
+ assumeExternalTargets: assumeExternalTargets,
+ hasContextToolbar: hasContextToolbar,
+ getLinkList: getLinkList,
+ hasDefaultLinkTarget: hasDefaultLinkTarget,
+ getDefaultLinkTarget: getDefaultLinkTarget,
+ getTargetList: getTargetList,
+ setTargetList: setTargetList,
+ shouldShowTargetList: shouldShowTargetList,
+ getRelList: getRelList,
+ hasRelList: hasRelList,
+ getLinkClassList: getLinkClassList,
+ hasLinkClassList: hasLinkClassList,
+ shouldShowLinkTitle: shouldShowLinkTitle,
+ allowUnsafeLinkTarget: allowUnsafeLinkTarget
+ };
</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 global$2 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$2 = tinymce.util.Tools.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">- var global$3 = tinymce.util.Tools.resolve('tinymce.Env');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$3 = tinymce.util.Tools.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">- var appendClickRemove = function (link, evt) {
- document.body.appendChild(link);
- link.dispatchEvent(evt);
- document.body.removeChild(link);
- };
- var open$$1 = function (url) {
- if (!global$3.ie || global$3.ie > 10) {
- var link = document.createElement('a');
- link.target = '_blank';
- link.href = url;
- link.rel = 'noreferrer noopener';
- var evt = document.createEvent('MouseEvents');
- evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
- appendClickRemove(link, evt);
- } else {
- var win = window.open('', '_blank');
- if (win) {
- win.opener = null;
- var doc = win.document;
- doc.open();
- doc.write('<meta http-equiv="refresh" content="0; url=' + global$2.DOM.encode(url) + '">');
- doc.close();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var appendClickRemove = function (link, evt) {
+ document.body.appendChild(link);
+ link.dispatchEvent(evt);
+ document.body.removeChild(link);
+ };
+ var open$$1 = function (url) {
+ if (!global$3.ie || global$3.ie > 10) {
+ var link = document.createElement('a');
+ link.target = '_blank';
+ link.href = url;
+ link.rel = 'noreferrer noopener';
+ var evt = document.createEvent('MouseEvents');
+ evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
+ appendClickRemove(link, evt);
+ } else {
+ var win = window.open('', '_blank');
+ if (win) {
+ win.opener = null;
+ var doc = win.document;
+ doc.open();
+ doc.write('<meta http-equiv="refresh" content="0; url=' + global$2.DOM.encode(url) + '">');
+ doc.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">- }
- };
- var $_du0gebfwjjgwechl = { open: open$$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var OpenUrl = { open: open$$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">- var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$4 = tinymce.util.Tools.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">- var toggleTargetRules = function (rel, isUnsafe) {
- var rules = ['noopener'];
- var newRel = rel ? rel.split(/\s+/) : [];
- var toString = function (rel) {
- return global$4.trim(rel.sort().join(' '));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var toggleTargetRules = function (rel, isUnsafe) {
+ var rules = ['noopener'];
+ var newRel = rel ? rel.split(/\s+/) : [];
+ var toString = function (rel) {
+ return global$4.trim(rel.sort().join(' '));
+ };
+ var addTargetRules = function (rel) {
+ rel = removeTargetRules(rel);
+ return rel.length ? rel.concat(rules) : rules;
+ };
+ var removeTargetRules = function (rel) {
+ return rel.filter(function (val) {
+ return global$4.inArray(rules, val) === -1;
+ });
+ };
+ newRel = isUnsafe ? addTargetRules(newRel) : removeTargetRules(newRel);
+ return newRel.length ? toString(newRel) : 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">- var addTargetRules = function (rel) {
- rel = removeTargetRules(rel);
- return rel.length ? rel.concat(rules) : rules;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var trimCaretContainers = function (text) {
+ return text.replace(/\uFEFF/g, '');
</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 removeTargetRules = function (rel) {
- return rel.filter(function (val) {
- return global$4.inArray(rules, val) === -1;
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getAnchorElement = function (editor, selectedElm) {
+ selectedElm = selectedElm || editor.selection.getNode();
+ if (isImageFigure(selectedElm)) {
+ return editor.dom.select('a[href]', selectedElm)[0];
+ } else {
+ return editor.dom.getParent(selectedElm, 'a[href]');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- newRel = isUnsafe ? addTargetRules(newRel) : removeTargetRules(newRel);
- return newRel.length ? toString(newRel) : null;
- };
- var trimCaretContainers = function (text) {
- return text.replace(/\uFEFF/g, '');
- };
- var getAnchorElement = function (editor, selectedElm) {
- selectedElm = selectedElm || editor.selection.getNode();
- if (isImageFigure(selectedElm)) {
- return editor.dom.select('a[href]', selectedElm)[0];
- } else {
- return editor.dom.getParent(selectedElm, 'a[href]');
- }
- };
- var getAnchorText = function (selection, anchorElm) {
- var text = anchorElm ? anchorElm.innerText || anchorElm.textContent : selection.getContent({ format: 'text' });
- return trimCaretContainers(text);
- };
- var isLink = function (elm) {
- return elm && elm.nodeName === 'A' && elm.href;
- };
- var hasLinks = function (elements) {
- return global$4.grep(elements, isLink).length > 0;
- };
- var isOnlyTextSelected = function (html) {
- if (/</.test(html) && (!/^<a [^>]+>[^<]+<\/a>$/.test(html) || html.indexOf('href=') === -1)) {
- return false;
- }
- return true;
- };
- var isImageFigure = function (node) {
- return node && node.nodeName === 'FIGURE' && /\bimage\b/i.test(node.className);
- };
- var link = function (editor, attachState) {
- return function (data) {
- editor.undoManager.transact(function () {
- var selectedElm = editor.selection.getNode();
- var anchorElm = getAnchorElement(editor, selectedElm);
- var linkAttrs = {
- href: data.href,
- target: data.target ? data.target : null,
- rel: data.rel ? data.rel : null,
- class: data.class ? data.class : null,
- title: data.title ? data.title : null
- };
- if (!$_1b4wbxfvjjgwechi.hasRelList(editor.settings) && $_1b4wbxfvjjgwechi.allowUnsafeLinkTarget(editor.settings) === false) {
- linkAttrs.rel = toggleTargetRules(linkAttrs.rel, linkAttrs.target === '_blank');
- }
- if (data.href === attachState.href) {
- attachState.attach();
- attachState = {};
- }
- if (anchorElm) {
- editor.focus();
- if (data.hasOwnProperty('text')) {
- if ('innerText' in anchorElm) {
- anchorElm.innerText = data.text;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getAnchorText = function (selection, anchorElm) {
+ var text = anchorElm ? anchorElm.innerText || anchorElm.textContent : selection.getContent({ format: 'text' });
+ return trimCaretContainers(text);
+ };
+ var isLink = function (elm) {
+ return elm && elm.nodeName === 'A' && elm.href;
+ };
+ var hasLinks = function (elements) {
+ return global$4.grep(elements, isLink).length > 0;
+ };
+ var isOnlyTextSelected = function (html) {
+ if (/</.test(html) && (!/^<a [^>]+>[^<]+<\/a>$/.test(html) || html.indexOf('href=') === -1)) {
+ return false;
+ }
+ return true;
+ };
+ var isImageFigure = function (node) {
+ return node && node.nodeName === 'FIGURE' && /\bimage\b/i.test(node.className);
+ };
+ var link = function (editor, attachState) {
+ return function (data) {
+ editor.undoManager.transact(function () {
+ var selectedElm = editor.selection.getNode();
+ var anchorElm = getAnchorElement(editor, selectedElm);
+ var linkAttrs = {
+ href: data.href,
+ target: data.target ? data.target : null,
+ rel: data.rel ? data.rel : null,
+ class: data.class ? data.class : null,
+ title: data.title ? data.title : null
+ };
+ if (!Settings.hasRelList(editor.settings) && Settings.allowUnsafeLinkTarget(editor.settings) === false) {
+ linkAttrs.rel = toggleTargetRules(linkAttrs.rel, linkAttrs.target === '_blank');
+ }
+ if (data.href === attachState.href) {
+ attachState.attach();
+ attachState = {};
+ }
+ if (anchorElm) {
+ editor.focus();
+ if (data.hasOwnProperty('text')) {
+ if ('innerText' in anchorElm) {
+ anchorElm.innerText = data.text;
+ } else {
+ anchorElm.textContent = data.text;
+ }
+ }
+ editor.dom.setAttribs(anchorElm, linkAttrs);
+ editor.selection.select(anchorElm);
+ editor.undoManager.add();
+ } else {
+ if (isImageFigure(selectedElm)) {
+ linkImageFigure(editor, selectedElm, linkAttrs);
+ } else if (data.hasOwnProperty('text')) {
+ editor.insertContent(editor.dom.createHTML('a', linkAttrs, editor.dom.encode(data.text)));
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- anchorElm.textContent = data.text;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.execCommand('mceInsertLink', false, linkAttrs);
</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">- editor.dom.setAttribs(anchorElm, linkAttrs);
- editor.selection.select(anchorElm);
- editor.undoManager.add();
- } else {
- if (isImageFigure(selectedElm)) {
- linkImageFigure(editor, selectedElm, linkAttrs);
- } else if (data.hasOwnProperty('text')) {
- editor.insertContent(editor.dom.createHTML('a', linkAttrs, editor.dom.encode(data.text)));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ };
+ var unlink = function (editor) {
+ return function () {
+ editor.undoManager.transact(function () {
+ var node = editor.selection.getNode();
+ if (isImageFigure(node)) {
+ unlinkImageFigure(editor, node);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- editor.execCommand('mceInsertLink', false, linkAttrs);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.execCommand('unlink');
</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">+ });
+ };
</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 unlink = function (editor) {
- return function () {
- editor.undoManager.transact(function () {
- var node = editor.selection.getNode();
- if (isImageFigure(node)) {
- unlinkImageFigure(editor, node);
- } else {
- editor.execCommand('unlink');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var unlinkImageFigure = function (editor, fig) {
+ var a, img;
+ img = editor.dom.select('img', fig)[0];
+ if (img) {
+ a = editor.dom.getParents(img, 'a[href]', fig)[0];
+ if (a) {
+ a.parentNode.insertBefore(img, a);
+ editor.dom.remove(a);
</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">+ }
</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 unlinkImageFigure = function (editor, fig) {
- var a, img;
- img = editor.dom.select('img', fig)[0];
- if (img) {
- a = editor.dom.getParents(img, 'a[href]', fig)[0];
- if (a) {
- a.parentNode.insertBefore(img, a);
- editor.dom.remove(a);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var linkImageFigure = function (editor, fig, attrs) {
+ var a, img;
+ img = editor.dom.select('img', fig)[0];
+ if (img) {
+ a = editor.dom.create('a', attrs);
+ img.parentNode.insertBefore(a, img);
+ a.appendChild(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">- }
- };
- var linkImageFigure = function (editor, fig, attrs) {
- var a, img;
- img = editor.dom.select('img', fig)[0];
- if (img) {
- a = editor.dom.create('a', attrs);
- img.parentNode.insertBefore(a, img);
- a.appendChild(img);
- }
- };
- var $_5298ug0jjgweci0 = {
- link: link,
- unlink: unlink,
- isLink: isLink,
- hasLinks: hasLinks,
- isOnlyTextSelected: isOnlyTextSelected,
- getAnchorElement: getAnchorElement,
- getAnchorText: getAnchorText,
- toggleTargetRules: toggleTargetRules
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var Utils = {
+ link: link,
+ unlink: unlink,
+ isLink: isLink,
+ hasLinks: hasLinks,
+ isOnlyTextSelected: isOnlyTextSelected,
+ getAnchorElement: getAnchorElement,
+ getAnchorText: getAnchorText,
+ toggleTargetRules: toggleTargetRules
+ };
</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 global$5 = tinymce.util.Tools.resolve('tinymce.util.Delay');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$5 = tinymce.util.Tools.resolve('tinymce.util.Delay');
</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 global$6 = tinymce.util.Tools.resolve('tinymce.util.XHR');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$6 = tinymce.util.Tools.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">- var attachState = {};
- var createLinkList = function (editor, callback) {
- var linkList = $_1b4wbxfvjjgwechi.getLinkList(editor.settings);
- if (typeof linkList === 'string') {
- global$6.send({
- url: linkList,
- success: function (text) {
- callback(editor, JSON.parse(text));
- }
- });
- } else if (typeof linkList === 'function') {
- linkList(function (list) {
- callback(editor, list);
- });
- } else {
- callback(editor, linkList);
- }
- };
- var buildListItems = function (inputList, itemCallback, startItems) {
- var appendItems = function (values, output) {
- output = output || [];
- global$4.each(values, function (item) {
- var menuItem = { text: item.text || item.title };
- if (item.menu) {
- menuItem.menu = appendItems(item.menu);
- } else {
- menuItem.value = item.value;
- if (itemCallback) {
- itemCallback(menuItem);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var attachState = {};
+ var createLinkList = function (editor, callback) {
+ var linkList = Settings.getLinkList(editor.settings);
+ if (typeof linkList === 'string') {
+ global$6.send({
+ url: linkList,
+ success: function (text) {
+ callback(editor, JSON.parse(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">- }
- output.push(menuItem);
- });
- return output;
- };
- return appendItems(inputList, startItems || []);
- };
- var delayedConfirm = function (editor, message, callback) {
- var rng = editor.selection.getRng();
- global$5.setEditorTimeout(editor, function () {
- editor.windowManager.confirm(message, function (state) {
- editor.selection.setRng(rng);
- callback(state);
- });
- });
- };
- var showDialog = function (editor, linkList) {
- var data = {};
- var selection = editor.selection;
- var dom = editor.dom;
- var anchorElm, initialText;
- var win, onlyText, textListCtrl, linkListCtrl, relListCtrl, targetListCtrl, classListCtrl, linkTitleCtrl, value;
- var linkListChangeHandler = function (e) {
- var textCtrl = win.find('#text');
- if (!textCtrl.value() || e.lastControl && textCtrl.value() === e.lastControl.text()) {
- textCtrl.value(e.control.text());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ } else if (typeof linkList === 'function') {
+ linkList(function (list) {
+ callback(editor, list);
+ });
+ } else {
+ callback(editor, linkList);
</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('#href').value(e.control.value());
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var buildAnchorListControl = function (url) {
- var anchorList = [];
- global$4.each(editor.dom.select('a:not([href])'), function (anchor) {
- var id = anchor.name || anchor.id;
- if (id) {
- anchorList.push({
- text: id,
- value: '#' + id,
- selected: url.indexOf('#' + id) !== -1
- });
- }
- });
- if (anchorList.length) {
- anchorList.unshift({
- text: 'None',
- value: ''
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var buildListItems = function (inputList, itemCallback, startItems) {
+ var appendItems = function (values, output) {
+ output = output || [];
+ global$4.each(values, function (item) {
+ var menuItem = { text: item.text || item.title };
+ if (item.menu) {
+ menuItem.menu = appendItems(item.menu);
+ } else {
+ menuItem.value = item.value;
+ if (itemCallback) {
+ itemCallback(menuItem);
+ }
+ }
+ 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">- return {
- name: 'anchor',
- type: 'listbox',
- label: 'Anchors',
- values: anchorList,
- onselect: linkListChangeHandler
- };
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return output;
+ };
+ 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">- var updateText = function () {
- if (!initialText && onlyText && !data.text) {
- this.parent().parent().find('#text')[0].value(this.value());
- }
- };
- var urlChange = function (e) {
- var meta = e.meta || {};
- if (linkListCtrl) {
- linkListCtrl.value(editor.convertURL(this.value(), 'href'));
- }
- global$4.each(e.meta, function (value, key) {
- var inp = win.find('#' + key);
- if (key === 'text') {
- if (initialText.length === 0) {
- inp.value(value);
- data.text = value;
- }
- } else {
- inp.value(value);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var delayedConfirm = function (editor, message, callback) {
+ var rng = editor.selection.getRng();
+ global$5.setEditorTimeout(editor, function () {
+ editor.windowManager.confirm(message, function (state) {
+ editor.selection.setRng(rng);
+ callback(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 (meta.attach) {
- attachState = {
- href: this.value(),
- attach: meta.attach
- };
- }
- if (!meta.text) {
- updateText.call(this);
- }
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var onBeforeCall = function (e) {
- e.meta = win.toJSON();
- };
- onlyText = $_5298ug0jjgweci0.isOnlyTextSelected(selection.getContent());
- anchorElm = $_5298ug0jjgweci0.getAnchorElement(editor);
- data.text = initialText = $_5298ug0jjgweci0.getAnchorText(editor.selection, anchorElm);
- data.href = anchorElm ? dom.getAttrib(anchorElm, 'href') : '';
- if (anchorElm) {
- data.target = dom.getAttrib(anchorElm, 'target');
- } else if ($_1b4wbxfvjjgwechi.hasDefaultLinkTarget(editor.settings)) {
- data.target = $_1b4wbxfvjjgwechi.getDefaultLinkTarget(editor.settings);
- }
- if (value = dom.getAttrib(anchorElm, 'rel')) {
- data.rel = value;
- }
- if (value = dom.getAttrib(anchorElm, 'class')) {
- data.class = value;
- }
- if (value = dom.getAttrib(anchorElm, 'title')) {
- data.title = value;
- }
- if (onlyText) {
- textListCtrl = {
- name: 'text',
- type: 'textbox',
- size: 40,
- label: 'Text to display',
- onchange: function () {
- data.text = this.value();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var showDialog = function (editor, linkList) {
+ var data = {};
+ var selection = editor.selection;
+ var dom = editor.dom;
+ var anchorElm, initialText;
+ var win, onlyText, textListCtrl, linkListCtrl, relListCtrl, targetListCtrl, classListCtrl, linkTitleCtrl, value;
+ var linkListChangeHandler = function (e) {
+ var textCtrl = win.find('#text');
+ if (!textCtrl.value() || e.lastControl && textCtrl.value() === e.lastControl.text()) {
+ textCtrl.value(e.control.text());
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ win.find('#href').value(e.control.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 (linkList) {
- linkListCtrl = {
- type: 'listbox',
- label: 'Link list',
- values: buildListItems(linkList, function (item) {
- item.value = editor.convertURL(item.value || item.url, 'href');
- }, [{
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var buildAnchorListControl = function (url) {
+ var anchorList = [];
+ global$4.each(editor.dom.select('a:not([href])'), function (anchor) {
+ var id = anchor.name || anchor.id;
+ if (id) {
+ anchorList.push({
+ text: id,
+ value: '#' + id,
+ selected: url.indexOf('#' + id) !== -1
+ });
+ }
+ });
+ if (anchorList.length) {
+ anchorList.unshift({
</ins><span class="cx" style="display: block; padding: 0 10px"> text: 'None',
</span><span class="cx" style="display: block; padding: 0 10px"> value: ''
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }]),
- onselect: linkListChangeHandler,
- value: editor.convertURL(data.href, 'href'),
- onPostRender: function () {
- linkListCtrl = this;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ return {
+ name: 'anchor',
+ type: 'listbox',
+ label: 'Anchors',
+ values: anchorList,
+ onselect: linkListChangeHandler
+ };
</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">- }
- if ($_1b4wbxfvjjgwechi.shouldShowTargetList(editor.settings)) {
- if ($_1b4wbxfvjjgwechi.getTargetList(editor.settings) === undefined) {
- $_1b4wbxfvjjgwechi.setTargetList(editor, [
- {
- text: 'None',
- value: ''
- },
- {
- text: 'New window',
- value: '_blank'
- }
- ]);
- }
- targetListCtrl = {
- name: 'target',
- type: 'listbox',
- label: 'Target',
- values: buildListItems($_1b4wbxfvjjgwechi.getTargetList(editor.settings))
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var updateText = function () {
+ if (!initialText && onlyText && !data.text) {
+ this.parent().parent().find('#text')[0].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">- }
- if ($_1b4wbxfvjjgwechi.hasRelList(editor.settings)) {
- relListCtrl = {
- name: 'rel',
- type: 'listbox',
- label: 'Rel',
- values: buildListItems($_1b4wbxfvjjgwechi.getRelList(editor.settings), function (item) {
- if ($_1b4wbxfvjjgwechi.allowUnsafeLinkTarget(editor.settings) === false) {
- item.value = $_5298ug0jjgweci0.toggleTargetRules(item.value, data.target === '_blank');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var urlChange = function (e) {
+ var meta = e.meta || {};
+ if (linkListCtrl) {
+ linkListCtrl.value(editor.convertURL(this.value(), 'href'));
+ }
+ global$4.each(e.meta, function (value, key) {
+ var inp = win.find('#' + key);
+ if (key === 'text') {
+ if (initialText.length === 0) {
+ inp.value(value);
+ data.text = value;
+ }
+ } else {
+ inp.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">- })
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ if (meta.attach) {
+ attachState = {
+ href: this.value(),
+ attach: meta.attach
+ };
+ }
+ if (!meta.text) {
+ updateText.call(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">- }
- if ($_1b4wbxfvjjgwechi.hasLinkClassList(editor.settings)) {
- classListCtrl = {
- name: 'class',
- type: 'listbox',
- label: 'Class',
- values: buildListItems($_1b4wbxfvjjgwechi.getLinkClassList(editor.settings), function (item) {
- if (item.value) {
- item.textStyle = function () {
- return editor.formatter.getCssText({
- inline: 'a',
- classes: [item.value]
- });
- };
- }
- })
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var onBeforeCall = function (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 ($_1b4wbxfvjjgwechi.shouldShowLinkTitle(editor.settings)) {
- linkTitleCtrl = {
- name: 'title',
- type: 'textbox',
- label: 'Title',
- value: data.title
- };
- }
- win = editor.windowManager.open({
- title: 'Insert link',
- data: data,
- body: [
- {
- name: 'href',
- type: 'filepicker',
- filetype: 'file',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ onlyText = Utils.isOnlyTextSelected(selection.getContent());
+ anchorElm = Utils.getAnchorElement(editor);
+ data.text = initialText = Utils.getAnchorText(editor.selection, anchorElm);
+ data.href = anchorElm ? dom.getAttrib(anchorElm, 'href') : '';
+ if (anchorElm) {
+ data.target = dom.getAttrib(anchorElm, 'target');
+ } else if (Settings.hasDefaultLinkTarget(editor.settings)) {
+ data.target = Settings.getDefaultLinkTarget(editor.settings);
+ }
+ if (value = dom.getAttrib(anchorElm, 'rel')) {
+ data.rel = value;
+ }
+ if (value = dom.getAttrib(anchorElm, 'class')) {
+ data.class = value;
+ }
+ if (value = dom.getAttrib(anchorElm, 'title')) {
+ data.title = value;
+ }
+ if (onlyText) {
+ textListCtrl = {
+ name: 'text',
+ type: 'textbox',
</ins><span class="cx" style="display: block; padding: 0 10px"> size: 40,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- autofocus: true,
- label: 'Url',
- onchange: urlChange,
- onkeyup: updateText,
- onpaste: updateText,
- onbeforecall: onBeforeCall
- },
- textListCtrl,
- linkTitleCtrl,
- buildAnchorListControl(data.href),
- linkListCtrl,
- relListCtrl,
- targetListCtrl,
- classListCtrl
- ],
- onSubmit: function (e) {
- var assumeExternalTargets = $_1b4wbxfvjjgwechi.assumeExternalTargets(editor.settings);
- var insertLink = $_5298ug0jjgweci0.link(editor, attachState);
- var removeLink = $_5298ug0jjgweci0.unlink(editor);
- var resultData = global$4.extend({}, data, e.data);
- var href = resultData.href;
- if (!href) {
- removeLink();
- return;
- }
- if (!onlyText || resultData.text === initialText) {
- delete resultData.text;
- }
- if (href.indexOf('@') > 0 && href.indexOf('//') === -1 && href.indexOf('mailto:') === -1) {
- delayedConfirm(editor, 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?', function (state) {
- if (state) {
- resultData.href = 'mailto:' + href;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ label: 'Text to display',
+ onchange: function () {
+ data.text = this.value();
+ }
+ };
+ }
+ if (linkList) {
+ linkListCtrl = {
+ type: 'listbox',
+ label: 'Link list',
+ values: buildListItems(linkList, function (item) {
+ item.value = editor.convertURL(item.value || item.url, 'href');
+ }, [{
+ text: 'None',
+ value: ''
+ }]),
+ onselect: linkListChangeHandler,
+ value: editor.convertURL(data.href, 'href'),
+ onPostRender: function () {
+ linkListCtrl = this;
+ }
+ };
+ }
+ if (Settings.shouldShowTargetList(editor.settings)) {
+ if (Settings.getTargetList(editor.settings) === undefined) {
+ Settings.setTargetList(editor, [
+ {
+ text: 'None',
+ value: ''
+ },
+ {
+ text: 'New window',
+ value: '_blank'
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- insertLink(resultData);
- });
- return;
</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">- if (assumeExternalTargets === true && !/^\w+:/i.test(href) || assumeExternalTargets === false && /^\s*www[\.|\d\.]/i.test(href)) {
- delayedConfirm(editor, 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?', function (state) {
- if (state) {
- resultData.href = 'http://' + href;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ targetListCtrl = {
+ name: 'target',
+ type: 'listbox',
+ label: 'Target',
+ values: buildListItems(Settings.getTargetList(editor.settings))
+ };
+ }
+ if (Settings.hasRelList(editor.settings)) {
+ relListCtrl = {
+ name: 'rel',
+ type: 'listbox',
+ label: 'Rel',
+ values: buildListItems(Settings.getRelList(editor.settings), function (item) {
+ if (Settings.allowUnsafeLinkTarget(editor.settings) === false) {
+ item.value = Utils.toggleTargetRules(item.value, data.target === '_blank');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- insertLink(resultData);
- });
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ })
+ };
+ }
+ if (Settings.hasLinkClassList(editor.settings)) {
+ classListCtrl = {
+ name: 'class',
+ type: 'listbox',
+ label: 'Class',
+ values: buildListItems(Settings.getLinkClassList(editor.settings), function (item) {
+ if (item.value) {
+ item.textStyle = function () {
+ return editor.formatter.getCssText({
+ inline: 'a',
+ classes: [item.value]
+ });
+ };
+ }
+ })
+ };
+ }
+ if (Settings.shouldShowLinkTitle(editor.settings)) {
+ linkTitleCtrl = {
+ name: 'title',
+ type: 'textbox',
+ label: 'Title',
+ value: data.title
+ };
+ }
+ win = editor.windowManager.open({
+ title: 'Insert link',
+ data: data,
+ body: [
+ {
+ name: 'href',
+ type: 'filepicker',
+ filetype: 'file',
+ size: 40,
+ autofocus: true,
+ label: 'Url',
+ onchange: urlChange,
+ onkeyup: updateText,
+ onpaste: updateText,
+ onbeforecall: onBeforeCall
+ },
+ textListCtrl,
+ linkTitleCtrl,
+ buildAnchorListControl(data.href),
+ linkListCtrl,
+ relListCtrl,
+ targetListCtrl,
+ classListCtrl
+ ],
+ onSubmit: function (e) {
+ var assumeExternalTargets = Settings.assumeExternalTargets(editor.settings);
+ var insertLink = Utils.link(editor, attachState);
+ var removeLink = Utils.unlink(editor);
+ var resultData = global$4.extend({}, data, e.data);
+ var href = resultData.href;
+ if (!href) {
+ removeLink();
+ return;
+ }
+ if (!onlyText || resultData.text === initialText) {
+ delete resultData.text;
+ }
+ if (href.indexOf('@') > 0 && href.indexOf('//') === -1 && href.indexOf('mailto:') === -1) {
+ delayedConfirm(editor, 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?', function (state) {
+ if (state) {
+ resultData.href = 'mailto:' + href;
+ }
+ insertLink(resultData);
+ });
+ return;
+ }
+ if (assumeExternalTargets === true && !/^\w+:/i.test(href) || assumeExternalTargets === false && /^\s*www[\.|\d\.]/i.test(href)) {
+ delayedConfirm(editor, 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?', function (state) {
+ if (state) {
+ resultData.href = 'http://' + href;
+ }
+ insertLink(resultData);
+ });
+ return;
+ }
+ insertLink(resultData);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- insertLink(resultData);
- }
- });
- };
- var open$1 = function (editor) {
- createLinkList(editor, showDialog);
- };
- var $_dxaplrg2jjgweci6 = { open: open$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ var open$1 = function (editor) {
+ createLinkList(editor, showDialog);
+ };
+ var Dialog = { open: open$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">- var getLink = function (editor, elm) {
- return editor.dom.getParent(elm, 'a[href]');
- };
- var getSelectedLink = function (editor) {
- return getLink(editor, editor.selection.getStart());
- };
- var getHref = function (elm) {
- var href = elm.getAttribute('data-mce-href');
- return href ? href : elm.getAttribute('href');
- };
- var isContextMenuVisible = function (editor) {
- var contextmenu = editor.plugins.contextmenu;
- return contextmenu ? contextmenu.isContextMenuVisible() : false;
- };
- var hasOnlyAltModifier = function (e) {
- return e.altKey === true && e.shiftKey === false && e.ctrlKey === false && e.metaKey === false;
- };
- var gotoLink = function (editor, a) {
- if (a) {
- var href = getHref(a);
- if (/^#/.test(href)) {
- var targetEl = editor.$(href);
- if (targetEl.length) {
- editor.selection.scrollIntoView(targetEl[0], true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getLink = function (editor, elm) {
+ return editor.dom.getParent(elm, 'a[href]');
+ };
+ var getSelectedLink = function (editor) {
+ return getLink(editor, editor.selection.getStart());
+ };
+ var getHref = function (elm) {
+ var href = elm.getAttribute('data-mce-href');
+ return href ? href : elm.getAttribute('href');
+ };
+ var isContextMenuVisible = function (editor) {
+ var contextmenu = editor.plugins.contextmenu;
+ return contextmenu ? contextmenu.isContextMenuVisible() : false;
+ };
+ var hasOnlyAltModifier = function (e) {
+ return e.altKey === true && e.shiftKey === false && e.ctrlKey === false && e.metaKey === false;
+ };
+ var gotoLink = function (editor, a) {
+ if (a) {
+ var href = getHref(a);
+ if (/^#/.test(href)) {
+ var targetEl = editor.$(href);
+ if (targetEl.length) {
+ editor.selection.scrollIntoView(targetEl[0], true);
+ }
+ } else {
+ OpenUrl.open(a.href);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- $_du0gebfwjjgwechl.open(a.href);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- };
- var openDialog = function (editor) {
- return function () {
- $_dxaplrg2jjgweci6.open(editor);
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var gotoSelectedLink = function (editor) {
- return function () {
- gotoLink(editor, getSelectedLink(editor));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var openDialog = function (editor) {
+ return function () {
+ Dialog.open(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">- };
- var leftClickedOnAHref = function (editor) {
- return function (elm) {
- var sel, rng, node;
- if ($_1b4wbxfvjjgwechi.hasContextToolbar(editor.settings) && !isContextMenuVisible(editor) && $_5298ug0jjgweci0.isLink(elm)) {
- sel = editor.selection;
- rng = sel.getRng();
- node = rng.startContainer;
- if (node.nodeType === 3 && sel.isCollapsed() && rng.startOffset > 0 && rng.startOffset < node.data.length) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var gotoSelectedLink = function (editor) {
+ return function () {
+ gotoLink(editor, getSelectedLink(editor));
+ };
+ };
+ var leftClickedOnAHref = function (editor) {
+ return function (elm) {
+ var sel, rng, node;
+ if (Settings.hasContextToolbar(editor.settings) && !isContextMenuVisible(editor) && Utils.isLink(elm)) {
+ sel = editor.selection;
+ rng = sel.getRng();
+ node = rng.startContainer;
+ if (node.nodeType === 3 && sel.isCollapsed() && rng.startOffset > 0 && rng.startOffset < node.data.length) {
+ 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 setupGotoLinks = function (editor) {
- editor.on('click', function (e) {
- var link = getLink(editor, e.target);
- if (link && global$1.metaKeyPressed(e)) {
- e.preventDefault();
- gotoLink(editor, link);
- }
- });
- editor.on('keydown', function (e) {
- var link = getSelectedLink(editor);
- if (link && e.keyCode === 13 && hasOnlyAltModifier(e)) {
- e.preventDefault();
- gotoLink(editor, link);
- }
- });
- };
- var toggleActiveState = function (editor) {
- return function () {
- var self = this;
- editor.on('nodechange', function (e) {
- self.active(!editor.readonly && !!$_5298ug0jjgweci0.getAnchorElement(editor, e.element));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setupGotoLinks = function (editor) {
+ editor.on('click', function (e) {
+ var link = getLink(editor, e.target);
+ if (link && global$1.metaKeyPressed(e)) {
+ e.preventDefault();
+ gotoLink(editor, link);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('keydown', function (e) {
+ var link = getSelectedLink(editor);
+ if (link && e.keyCode === 13 && hasOnlyAltModifier(e)) {
+ e.preventDefault();
+ gotoLink(editor, link);
+ }
+ });
</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 toggleViewLinkState = function (editor) {
- return function () {
- var self = this;
- var toggleVisibility = function (e) {
- if ($_5298ug0jjgweci0.hasLinks(e.parents)) {
- self.show();
- } else {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var toggleActiveState = function (editor) {
+ return function () {
+ var self = this;
+ editor.on('nodechange', function (e) {
+ self.active(!editor.readonly && !!Utils.getAnchorElement(editor, e.element));
+ });
+ };
+ };
+ var toggleViewLinkState = function (editor) {
+ return function () {
+ var self = this;
+ var toggleVisibility = function (e) {
+ if (Utils.hasLinks(e.parents)) {
+ self.show();
+ } else {
+ self.hide();
+ }
+ };
+ if (!Utils.hasLinks(editor.dom.getParents(editor.selection.getStart()))) {
</ins><span class="cx" style="display: block; padding: 0 10px"> self.hide();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('nodechange', toggleVisibility);
+ self.on('remove', function () {
+ editor.off('nodechange', toggleVisibility);
+ });
</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 (!$_5298ug0jjgweci0.hasLinks(editor.dom.getParents(editor.selection.getStart()))) {
- self.hide();
- }
- editor.on('nodechange', toggleVisibility);
- self.on('remove', function () {
- editor.off('nodechange', toggleVisibility);
- });
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var $_8hceq8ftjjgweche = {
- openDialog: openDialog,
- gotoSelectedLink: gotoSelectedLink,
- leftClickedOnAHref: leftClickedOnAHref,
- setupGotoLinks: setupGotoLinks,
- toggleActiveState: toggleActiveState,
- toggleViewLinkState: toggleViewLinkState
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Actions = {
+ openDialog: openDialog,
+ gotoSelectedLink: gotoSelectedLink,
+ leftClickedOnAHref: leftClickedOnAHref,
+ setupGotoLinks: setupGotoLinks,
+ toggleActiveState: toggleActiveState,
+ toggleViewLinkState: toggleViewLinkState
+ };
</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 register = function (editor) {
- editor.addCommand('mceLink', $_8hceq8ftjjgweche.openDialog(editor));
- };
- var $_bauc80fsjjgwechc = { register: register };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register = function (editor) {
+ editor.addCommand('mceLink', Actions.openDialog(editor));
+ };
+ var Commands = { register: register };
</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 setup = function (editor) {
- editor.addShortcut('Meta+K', '', $_8hceq8ftjjgweche.openDialog(editor));
- };
- var $_49u4p1g5jjgwecie = { setup: setup };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setup = function (editor) {
+ editor.addShortcut('Meta+K', '', Actions.openDialog(editor));
+ };
+ var Keyboard = { setup: setup };
</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 setupButtons = function (editor) {
- editor.addButton('link', {
- active: false,
- icon: 'link',
- tooltip: 'Insert/edit link',
- onclick: $_8hceq8ftjjgweche.openDialog(editor),
- onpostrender: $_8hceq8ftjjgweche.toggleActiveState(editor)
- });
- editor.addButton('unlink', {
- active: false,
- icon: 'unlink',
- tooltip: 'Remove link',
- onclick: $_5298ug0jjgweci0.unlink(editor),
- onpostrender: $_8hceq8ftjjgweche.toggleActiveState(editor)
- });
- if (editor.addContextToolbar) {
- editor.addButton('openlink', {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setupButtons = function (editor) {
+ editor.addButton('link', {
+ active: false,
+ icon: 'link',
+ tooltip: 'Insert/edit link',
+ onclick: Actions.openDialog(editor),
+ onpostrender: Actions.toggleActiveState(editor)
+ });
+ editor.addButton('unlink', {
+ active: false,
+ icon: 'unlink',
+ tooltip: 'Remove link',
+ onclick: Utils.unlink(editor),
+ onpostrender: Actions.toggleActiveState(editor)
+ });
+ if (editor.addContextToolbar) {
+ editor.addButton('openlink', {
+ icon: 'newtab',
+ tooltip: 'Open link',
+ onclick: Actions.gotoSelectedLink(editor)
+ });
+ }
+ };
+ var setupMenuItems = function (editor) {
+ editor.addMenuItem('openlink', {
+ text: 'Open link',
</ins><span class="cx" style="display: block; padding: 0 10px"> icon: 'newtab',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- tooltip: 'Open link',
- onclick: $_8hceq8ftjjgweche.gotoSelectedLink(editor)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ onclick: Actions.gotoSelectedLink(editor),
+ onPostRender: Actions.toggleViewLinkState(editor),
+ prependToContext: 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">- }
- };
- var setupMenuItems = function (editor) {
- editor.addMenuItem('openlink', {
- text: 'Open link',
- icon: 'newtab',
- onclick: $_8hceq8ftjjgweche.gotoSelectedLink(editor),
- onPostRender: $_8hceq8ftjjgweche.toggleViewLinkState(editor),
- prependToContext: true
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.addMenuItem('link', {
+ icon: 'link',
+ text: 'Link',
+ shortcut: 'Meta+K',
+ onclick: Actions.openDialog(editor),
+ stateSelector: 'a[href]',
+ context: 'insert',
+ prependToContext: true
+ });
+ editor.addMenuItem('unlink', {
+ icon: 'unlink',
+ text: 'Remove link',
+ onclick: Utils.unlink(editor),
+ stateSelector: 'a[href]'
+ });
+ };
+ var setupContextToolbars = function (editor) {
+ if (editor.addContextToolbar) {
+ editor.addContextToolbar(Actions.leftClickedOnAHref(editor), 'openlink | link unlink');
+ }
+ };
+ var Controls = {
+ setupButtons: setupButtons,
+ setupMenuItems: setupMenuItems,
+ setupContextToolbars: setupContextToolbars
+ };
+
+ global.add('link', function (editor) {
+ Controls.setupButtons(editor);
+ Controls.setupMenuItems(editor);
+ Controls.setupContextToolbars(editor);
+ Actions.setupGotoLinks(editor);
+ Commands.register(editor);
+ Keyboard.setup(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">- editor.addMenuItem('link', {
- icon: 'link',
- text: 'Link',
- shortcut: 'Meta+K',
- onclick: $_8hceq8ftjjgweche.openDialog(editor),
- stateSelector: 'a[href]',
- context: 'insert',
- prependToContext: true
- });
- editor.addMenuItem('unlink', {
- icon: 'unlink',
- text: 'Remove link',
- onclick: $_5298ug0jjgweci0.unlink(editor),
- stateSelector: 'a[href]'
- });
- };
- var setupContextToolbars = function (editor) {
- if (editor.addContextToolbar) {
- editor.addContextToolbar($_8hceq8ftjjgweche.leftClickedOnAHref(editor), 'openlink | link unlink');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function Plugin () {
</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 $_bn93cg6jjgwecif = {
- setupButtons: setupButtons,
- setupMenuItems: setupMenuItems,
- setupContextToolbars: setupContextToolbars
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global.add('link', function (editor) {
- $_bn93cg6jjgwecif.setupButtons(editor);
- $_bn93cg6jjgwecif.setupMenuItems(editor);
- $_bn93cg6jjgwecif.setupContextToolbars(editor);
- $_8hceq8ftjjgweche.setupGotoLinks(editor);
- $_bauc80fsjjgwechc.register(editor);
- $_49u4p1g5jjgwecie.setup(editor);
- });
- function Plugin () {
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Plugin;
</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 Plugin;
-
</del><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="trunksrcjs_enqueuesvendortinymcepluginslistspluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/plugins/lists/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/plugins/lists/plugin.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/plugins/lists/plugin.js 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,1114 +1,2181 @@
</span><span class="cx" style="display: block; padding: 0 10px"> (function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var lists = (function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'use strict';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'use strict';
</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 global = tinymce.util.Tools.resolve('tinymce.PluginManager');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global = tinymce.util.Tools.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">- var global$1 = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$1 = tinymce.util.Tools.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">- var global$2 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$2 = tinymce.util.Tools.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">- var global$3 = tinymce.util.Tools.resolve('tinymce.util.VK');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$3 = tinymce.util.Tools.resolve('tinymce.util.VK');
</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 global$4 = tinymce.util.Tools.resolve('tinymce.dom.BookmarkManager');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$4 = tinymce.util.Tools.resolve('tinymce.dom.BookmarkManager');
</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 global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$5 = tinymce.util.Tools.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">- var global$6 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$6 = tinymce.util.Tools.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">- var isTextNode = function (node) {
- return node && node.nodeType === 3;
- };
- var isListNode = function (node) {
- return node && /^(OL|UL|DL)$/.test(node.nodeName);
- };
- var isListItemNode = function (node) {
- return node && /^(LI|DT|DD)$/.test(node.nodeName);
- };
- var isTableCellNode = function (node) {
- return node && /^(TH|TD)$/.test(node.nodeName);
- };
- var isBr = function (node) {
- return node && node.nodeName === 'BR';
- };
- var isFirstChild = function (node) {
- return node.parentNode.firstChild === node;
- };
- var isLastChild = function (node) {
- return node.parentNode.lastChild === node;
- };
- var isTextBlock = function (editor, node) {
- return node && !!editor.schema.getTextBlockElements()[node.nodeName];
- };
- var isBlock = function (node, blockElements) {
- return node && node.nodeName in blockElements;
- };
- var isBogusBr = function (dom, node) {
- if (!isBr(node)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isTextNode = function (node) {
+ return node && node.nodeType === 3;
+ };
+ var isListNode = function (node) {
+ return node && /^(OL|UL|DL)$/.test(node.nodeName);
+ };
+ var isOlUlNode = function (node) {
+ return node && /^(OL|UL)$/.test(node.nodeName);
+ };
+ var isListItemNode = function (node) {
+ return node && /^(LI|DT|DD)$/.test(node.nodeName);
+ };
+ var isDlItemNode = function (node) {
+ return node && /^(DT|DD)$/.test(node.nodeName);
+ };
+ var isTableCellNode = function (node) {
+ return node && /^(TH|TD)$/.test(node.nodeName);
+ };
+ var isBr = function (node) {
+ return node && node.nodeName === 'BR';
+ };
+ var isFirstChild = function (node) {
+ return node.parentNode.firstChild === node;
+ };
+ var isLastChild = function (node) {
+ return node.parentNode.lastChild === node;
+ };
+ var isTextBlock = function (editor, node) {
+ return node && !!editor.schema.getTextBlockElements()[node.nodeName];
+ };
+ var isBlock = function (node, blockElements) {
+ return node && node.nodeName in blockElements;
+ };
+ var isBogusBr = function (dom, node) {
+ if (!isBr(node)) {
+ return false;
+ }
+ if (dom.isBlock(node.nextSibling) && !isBr(node.previousSibling)) {
+ return true;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (dom.isBlock(node.nextSibling) && !isBr(node.previousSibling)) {
- return true;
- }
- return false;
- };
- var isEmpty = function (dom, elm, keepBookmarks) {
- var empty = dom.isEmpty(elm);
- if (keepBookmarks && dom.select('span[data-mce-type=bookmark]', elm).length > 0) {
- return false;
- }
- return empty;
- };
- var isChildOfBody = function (dom, elm) {
- return dom.isChildOf(elm, dom.getRoot());
- };
- var $_okk1ogljjgweckx = {
- isTextNode: isTextNode,
- isListNode: isListNode,
- isListItemNode: isListItemNode,
- isTableCellNode: isTableCellNode,
- isBr: isBr,
- isFirstChild: isFirstChild,
- isLastChild: isLastChild,
- isTextBlock: isTextBlock,
- isBlock: isBlock,
- isBogusBr: isBogusBr,
- isEmpty: isEmpty,
- isChildOfBody: isChildOfBody
- };
</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);
+ if (keepBookmarks && dom.select('span[data-mce-type=bookmark]', elm).length > 0) {
+ return false;
+ }
+ return empty;
+ };
+ var isChildOfBody = function (dom, elm) {
+ return dom.isChildOf(elm, dom.getRoot());
+ };
+ var NodeType = {
+ isTextNode: isTextNode,
+ isListNode: isListNode,
+ isOlUlNode: isOlUlNode,
+ isDlItemNode: isDlItemNode,
+ isListItemNode: isListItemNode,
+ isTableCellNode: isTableCellNode,
+ isBr: isBr,
+ isFirstChild: isFirstChild,
+ isLastChild: isLastChild,
+ isTextBlock: isTextBlock,
+ isBlock: isBlock,
+ isBogusBr: isBogusBr,
+ isEmpty: isEmpty,
+ isChildOfBody: isChildOfBody
+ };
</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 getNormalizedEndPoint = function (container, offset) {
- var node = global$1.getNode(container, offset);
- if ($_okk1ogljjgweckx.isListItemNode(container) && $_okk1ogljjgweckx.isTextNode(node)) {
- var textNodeOffset = offset >= container.childNodes.length ? node.data.length : 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getNormalizedPoint = function (container, offset) {
+ if (NodeType.isTextNode(container)) {
+ return {
+ container: container,
+ offset: offset
+ };
+ }
+ var node = global$1.getNode(container, offset);
+ if (NodeType.isTextNode(node)) {
+ return {
+ container: node,
+ offset: offset >= container.childNodes.length ? node.data.length : 0
+ };
+ } else if (node.previousSibling && NodeType.isTextNode(node.previousSibling)) {
+ return {
+ container: node.previousSibling,
+ offset: node.previousSibling.data.length
+ };
+ } else if (node.nextSibling && NodeType.isTextNode(node.nextSibling)) {
+ return {
+ container: node.nextSibling,
+ offset: 0
+ };
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- container: node,
- offset: textNodeOffset
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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">- }
- return {
- container: container,
- offset: offset
</del><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();
- var rangeStart = getNormalizedEndPoint(rng.startContainer, rng.startOffset);
- outRng.setStart(rangeStart.container, rangeStart.offset);
- var rangeEnd = getNormalizedEndPoint(rng.endContainer, rng.endOffset);
- outRng.setEnd(rangeEnd.container, rangeEnd.offset);
- return outRng;
- };
- var $_a9cyhvgkjjgweckv = {
- getNormalizedEndPoint: getNormalizedEndPoint,
- normalizeRange: normalizeRange
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var normalizeRange = function (rng) {
+ var outRng = rng.cloneRange();
+ var rangeStart = getNormalizedPoint(rng.startContainer, rng.startOffset);
+ outRng.setStart(rangeStart.container, rangeStart.offset);
+ var rangeEnd = getNormalizedPoint(rng.endContainer, rng.endOffset);
+ outRng.setEnd(rangeEnd.container, rangeEnd.offset);
+ return outRng;
+ };
+ var Range = {
+ getNormalizedPoint: getNormalizedPoint,
+ normalizeRange: normalizeRange
+ };
</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 DOM = global$6.DOM;
- var createBookmark = function (rng) {
- var bookmark = {};
- var setupEndPoint = function (start) {
- var offsetNode, container, offset;
- container = rng[start ? 'startContainer' : 'endContainer'];
- offset = rng[start ? 'startOffset' : 'endOffset'];
- if (container.nodeType === 1) {
- offsetNode = DOM.create('span', { 'data-mce-type': 'bookmark' });
- if (container.hasChildNodes()) {
- offset = Math.min(offset, container.childNodes.length - 1);
- if (start) {
- container.insertBefore(offsetNode, container.childNodes[offset]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var DOM = global$6.DOM;
+ var createBookmark = function (rng) {
+ var bookmark = {};
+ var setupEndPoint = function (start) {
+ var offsetNode, container, offset;
+ container = rng[start ? 'startContainer' : 'endContainer'];
+ offset = rng[start ? 'startOffset' : 'endOffset'];
+ if (container.nodeType === 1) {
+ offsetNode = DOM.create('span', { 'data-mce-type': 'bookmark' });
+ if (container.hasChildNodes()) {
+ offset = Math.min(offset, container.childNodes.length - 1);
+ if (start) {
+ container.insertBefore(offsetNode, container.childNodes[offset]);
+ } else {
+ DOM.insertAfter(offsetNode, container.childNodes[offset]);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- DOM.insertAfter(offsetNode, container.childNodes[offset]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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">- } else {
- container.appendChild(offsetNode);
</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">- container = offsetNode;
- offset = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ bookmark[start ? 'startContainer' : 'endContainer'] = container;
+ bookmark[start ? 'startOffset' : 'endOffset'] = offset;
+ };
+ setupEndPoint(true);
+ 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">- bookmark[start ? 'startContainer' : 'endContainer'] = container;
- bookmark[start ? 'startOffset' : 'endOffset'] = offset;
</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">- setupEndPoint(true);
- if (!rng.collapsed) {
- setupEndPoint();
- }
- return bookmark;
- };
- var resolveBookmark = function (bookmark) {
- function restoreEndPoint(start) {
- var container, offset, node;
- var nodeIndex = function (container) {
- var node = container.parentNode.firstChild, idx = 0;
- while (node) {
- if (node === container) {
- return idx;
</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;
+ var nodeIndex = function (container) {
+ var node = container.parentNode.firstChild, idx = 0;
+ while (node) {
+ if (node === container) {
+ return idx;
+ }
+ if (node.nodeType !== 1 || node.getAttribute('data-mce-type') !== 'bookmark') {
+ idx++;
+ }
+ 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">- 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">+ return -1;
+ };
+ container = node = bookmark[start ? 'startContainer' : 'endContainer'];
+ offset = bookmark[start ? 'startOffset' : 'endOffset'];
+ if (!container) {
+ return;
+ }
+ if (container.nodeType === 1) {
+ offset = nodeIndex(container);
+ container = container.parentNode;
+ DOM.remove(node);
+ if (!container.hasChildNodes() && DOM.isBlock(container)) {
+ container.appendChild(DOM.create('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">- node = node.nextSibling;
</del><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">+ bookmark[start ? 'startContainer' : 'endContainer'] = container;
+ bookmark[start ? 'startOffset' : 'endOffset'] = offset;
+ }
+ restoreEndPoint(true);
+ restoreEndPoint();
+ var rng = DOM.createRng();
+ rng.setStart(bookmark.startContainer, bookmark.startOffset);
+ if (bookmark.endContainer) {
+ rng.setEnd(bookmark.endContainer, bookmark.endOffset);
+ }
+ return Range.normalizeRange(rng);
+ };
+ var Bookmark = {
+ createBookmark: createBookmark,
+ resolveBookmark: resolveBookmark
+ };
+
+ var constant = function (value) {
+ return function () {
+ 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">- container = node = bookmark[start ? 'startContainer' : 'endContainer'];
- offset = bookmark[start ? 'startOffset' : 'endOffset'];
- if (!container) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ function curry(fn) {
+ var initialArgs = [];
+ for (var _i = 1; _i < arguments.length; _i++) {
+ initialArgs[_i - 1] = arguments[_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 (container.nodeType === 1) {
- offset = nodeIndex(container);
- container = container.parentNode;
- DOM.remove(node);
- if (!container.hasChildNodes() && DOM.isBlock(container)) {
- container.appendChild(DOM.create('br'));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return function () {
+ var restArgs = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ restArgs[_i] = arguments[_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">- }
- bookmark[start ? 'startContainer' : 'endContainer'] = container;
- bookmark[start ? 'startOffset' : 'endOffset'] = offset;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var all = initialArgs.concat(restArgs);
+ return fn.apply(null, all);
+ };
</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();
- var rng = DOM.createRng();
- rng.setStart(bookmark.startContainer, bookmark.startOffset);
- if (bookmark.endContainer) {
- rng.setEnd(bookmark.endContainer, bookmark.endOffset);
- }
- return $_a9cyhvgkjjgweckv.normalizeRange(rng);
- };
- var $_2nx1i4gjjjgweckt = {
- createBookmark: createBookmark,
- resolveBookmark: resolveBookmark
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var not = function (f) {
+ return function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ return !f.apply(null, args);
+ };
+ };
+ var never = constant(false);
+ var always = constant(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">- var DOM$1 = global$6.DOM;
- var normalizeList = function (dom, ul) {
- var sibling;
- var parentNode = ul.parentNode;
- if (parentNode.nodeName === 'LI' && parentNode.firstChild === ul) {
- sibling = parentNode.previousSibling;
- if (sibling && sibling.nodeName === 'LI') {
- sibling.appendChild(ul);
- if ($_okk1ogljjgweckx.isEmpty(dom, parentNode)) {
- DOM$1.remove(parentNode);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var never$1 = never;
+ var always$1 = always;
+ var none = function () {
+ return NONE;
+ };
+ var NONE = function () {
+ var eq = function (o) {
+ return o.isNone();
+ };
+ var call$$1 = function (thunk) {
+ return thunk();
+ };
+ var id = function (n) {
+ return n;
+ };
+ var noop$$1 = function () {
+ };
+ var nul = function () {
+ return null;
+ };
+ var undef = function () {
+ return undefined;
+ };
+ var me = {
+ fold: function (n, s) {
+ return n();
+ },
+ is: never$1,
+ isSome: never$1,
+ isNone: always$1,
+ getOr: id,
+ getOrThunk: call$$1,
+ getOrDie: function (msg) {
+ throw new Error(msg || 'error: getOrDie called on none.');
+ },
+ getOrNull: nul,
+ getOrUndefined: undef,
+ or: id,
+ orThunk: call$$1,
+ map: none,
+ ap: none,
+ each: noop$$1,
+ bind: none,
+ flatten: none,
+ exists: never$1,
+ forall: always$1,
+ filter: none,
+ equals: eq,
+ equals_: eq,
+ toArray: function () {
+ return [];
+ },
+ toString: constant('none()')
+ };
+ if (Object.freeze)
+ Object.freeze(me);
+ return me;
+ }();
+ var some = function (a) {
+ var constant_a = function () {
+ return a;
+ };
+ var self = function () {
+ return me;
+ };
+ var map = function (f) {
+ return some(f(a));
+ };
+ var bind = function (f) {
+ return f(a);
+ };
+ var me = {
+ fold: function (n, s) {
+ return s(a);
+ },
+ is: function (v) {
+ return a === v;
+ },
+ isSome: always$1,
+ isNone: never$1,
+ getOr: constant_a,
+ getOrThunk: constant_a,
+ getOrDie: constant_a,
+ getOrNull: constant_a,
+ getOrUndefined: constant_a,
+ or: self,
+ orThunk: self,
+ map: map,
+ ap: function (optfab) {
+ return optfab.fold(none, function (fab) {
+ return some(fab(a));
+ });
+ },
+ each: function (f) {
+ f(a);
+ },
+ bind: bind,
+ flatten: constant_a,
+ exists: bind,
+ forall: bind,
+ filter: function (f) {
+ return f(a) ? me : NONE;
+ },
+ equals: function (o) {
+ return o.is(a);
+ },
+ equals_: function (o, elementEq) {
+ return o.fold(never$1, function (b) {
+ return elementEq(a, b);
+ });
+ },
+ toArray: function () {
+ return [a];
+ },
+ toString: function () {
+ return 'some(' + a + ')';
</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 me;
+ };
+ var from = function (value) {
+ return value === null || value === undefined ? NONE : some(value);
+ };
+ var Option = {
+ some: some,
+ none: none,
+ from: from
+ };
+
+ var typeOf = function (x) {
+ if (x === null)
+ return 'null';
+ var t = typeof x;
+ if (t === 'object' && Array.prototype.isPrototypeOf(x))
+ return 'array';
+ if (t === 'object' && String.prototype.isPrototypeOf(x))
+ return 'string';
+ return t;
+ };
+ var isType = function (type) {
+ return function (value) {
+ return typeOf(value) === type;
+ };
+ };
+ var isString = isType('string');
+ var isBoolean = isType('boolean');
+ var isFunction = isType('function');
+ var isNumber = isType('number');
+
+ var map = function (xs, f) {
+ var len = xs.length;
+ var r = new Array(len);
+ for (var i = 0; i < len; i++) {
+ var x = xs[i];
+ r[i] = f(x, i, xs);
+ }
+ return r;
+ };
+ var each = function (xs, f) {
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ f(x, i, xs);
+ }
+ };
+ var filter = function (xs, pred) {
+ var r = [];
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ if (pred(x, i, xs)) {
+ r.push(x);
+ }
+ }
+ return r;
+ };
+ var groupBy = function (xs, f) {
+ if (xs.length === 0) {
+ return [];
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- DOM$1.setStyle(parentNode, 'listStyleType', 'none');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var wasType = f(xs[0]);
+ var r = [];
+ var group = [];
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ var type = f(x);
+ if (type !== wasType) {
+ r.push(group);
+ group = [];
+ }
+ wasType = type;
+ group.push(x);
+ }
+ if (group.length !== 0) {
+ r.push(group);
+ }
+ return r;
</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 ($_okk1ogljjgweckx.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">+ };
+ var foldl = function (xs, f, acc) {
+ each(xs, function (x) {
+ acc = f(acc, x);
+ });
+ return acc;
+ };
+ var find = function (xs, pred) {
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ if (pred(x, i, xs)) {
+ return Option.some(x);
+ }
</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) {
- global$5.each(global$5.grep(dom.select('ol,ul', element)), function (ul) {
- normalizeList(dom, ul);
- });
- };
- var $_ekd4wzgmjjgwecl1 = {
- normalizeList: normalizeList,
- normalizeLists: normalizeLists
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Option.none();
+ };
+ var push = Array.prototype.push;
+ var flatten = function (xs) {
+ var r = [];
+ for (var i = 0, len = xs.length; i < len; ++i) {
+ if (!Array.prototype.isPrototypeOf(xs[i]))
+ throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
+ push.apply(r, xs[i]);
+ }
+ return r;
+ };
+ var bind = function (xs, f) {
+ var output = map(xs, f);
+ return flatten(output);
+ };
+ var slice = Array.prototype.slice;
+ var reverse = function (xs) {
+ var r = slice.call(xs, 0);
+ r.reverse();
+ return r;
+ };
+ var head = function (xs) {
+ return xs.length === 0 ? Option.none() : Option.some(xs[0]);
+ };
+ var last = function (xs) {
+ return xs.length === 0 ? Option.none() : Option.some(xs[xs.length - 1]);
+ };
+ var from$1 = isFunction(Array.from) ? Array.from : function (x) {
+ return slice.call(x);
+ };
</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 global$7 = tinymce.util.Tools.resolve('tinymce.dom.DomQuery');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Global = typeof window !== 'undefined' ? window : Function('return 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">- var getParentList = function (editor) {
- var selectionStart = editor.selection.getStart(true);
- return editor.dom.getParent(selectionStart, 'OL,UL,DL', getClosestListRootElm(editor, selectionStart));
- };
- var isParentListSelected = function (parentList, selectedBlocks) {
- return parentList && selectedBlocks.length === 1 && selectedBlocks[0] === parentList;
- };
- var findSubLists = function (parentList) {
- return global$5.grep(parentList.querySelectorAll('ol,ul,dl'), function (elm) {
- return $_okk1ogljjgweckx.isListNode(elm);
- });
- };
- var getSelectedSubLists = function (editor) {
- var parentList = getParentList(editor);
- var selectedBlocks = editor.selection.getSelectedBlocks();
- if (isParentListSelected(parentList, selectedBlocks)) {
- return findSubLists(parentList);
- } else {
- return global$5.grep(selectedBlocks, function (elm) {
- return $_okk1ogljjgweckx.isListNode(elm) && parentList !== elm;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var path = function (parts, scope) {
+ var o = scope !== undefined && scope !== null ? scope : Global;
+ for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i)
+ o = o[parts[i]];
+ return o;
+ };
+ var resolve = function (p, scope) {
+ var parts = p.split('.');
+ return path(parts, scope);
+ };
+
+ var unsafe = function (name, scope) {
+ return resolve(name, scope);
+ };
+ var getOrDie = function (name, scope) {
+ var actual = unsafe(name, scope);
+ if (actual === undefined || actual === null)
+ throw name + ' not available on this browser';
+ return actual;
+ };
+ var Global$1 = { getOrDie: getOrDie };
+
+ var htmlElement = function (scope) {
+ return Global$1.getOrDie('HTMLElement', scope);
+ };
+ var isPrototypeOf = function (x) {
+ var scope = resolve('ownerDocument.defaultView', x);
+ return htmlElement(scope).prototype.isPrototypeOf(x);
+ };
+ var HTMLElement = { isPrototypeOf: isPrototypeOf };
+
+ var global$7 = tinymce.util.Tools.resolve('tinymce.dom.DomQuery');
+
+ var getParentList = function (editor) {
+ var selectionStart = editor.selection.getStart(true);
+ return editor.dom.getParent(selectionStart, 'OL,UL,DL', getClosestListRootElm(editor, selectionStart));
+ };
+ var isParentListSelected = function (parentList, selectedBlocks) {
+ return parentList && selectedBlocks.length === 1 && selectedBlocks[0] === parentList;
+ };
+ var findSubLists = function (parentList) {
+ return global$5.grep(parentList.querySelectorAll('ol,ul,dl'), function (elm) {
+ return NodeType.isListNode(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">- }
- };
- var findParentListItemsNodes = function (editor, elms) {
- var listItemsElms = global$5.map(elms, function (elm) {
- var parentLi = editor.dom.getParent(elm, 'li,dd,dt', getClosestListRootElm(editor, elm));
- return parentLi ? parentLi : elm;
- });
- return global$7.unique(listItemsElms);
- };
- var getSelectedListItems = function (editor) {
- var selectedBlocks = editor.selection.getSelectedBlocks();
- return global$5.grep(findParentListItemsNodes(editor, selectedBlocks), function (block) {
- return $_okk1ogljjgweckx.isListItemNode(block);
- });
- };
- var getClosestListRootElm = function (editor, elm) {
- var parentTableCell = editor.dom.getParents(elm, 'TD,TH');
- var root = parentTableCell.length > 0 ? parentTableCell[0] : editor.getBody();
- return root;
- };
- var $_3xb1cggnjjgwecl3 = {
- getParentList: getParentList,
- getSelectedSubLists: getSelectedSubLists,
- getSelectedListItems: getSelectedListItems,
- getClosestListRootElm: getClosestListRootElm
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var getSelectedSubLists = function (editor) {
+ var parentList = getParentList(editor);
+ var selectedBlocks = editor.selection.getSelectedBlocks();
+ if (isParentListSelected(parentList, selectedBlocks)) {
+ return findSubLists(parentList);
+ } else {
+ return global$5.grep(selectedBlocks, function (elm) {
+ return NodeType.isListNode(elm) && parentList !== elm;
+ });
+ }
+ };
+ var findParentListItemsNodes = function (editor, elms) {
+ var listItemsElms = global$5.map(elms, function (elm) {
+ var parentLi = editor.dom.getParent(elm, 'li,dd,dt', getClosestListRootElm(editor, elm));
+ return parentLi ? parentLi : elm;
+ });
+ return global$7.unique(listItemsElms);
+ };
+ var getSelectedListItems = function (editor) {
+ var selectedBlocks = editor.selection.getSelectedBlocks();
+ return global$5.grep(findParentListItemsNodes(editor, selectedBlocks), function (block) {
+ return NodeType.isListItemNode(block);
+ });
+ };
+ var getSelectedDlItems = function (editor) {
+ return filter(getSelectedListItems(editor), NodeType.isDlItemNode);
+ };
+ var getClosestListRootElm = function (editor, elm) {
+ var parentTableCell = editor.dom.getParents(elm, 'TD,TH');
+ var root = parentTableCell.length > 0 ? parentTableCell[0] : editor.getBody();
+ return root;
+ };
+ var findLastParentListNode = function (editor, elm) {
+ var parentLists = editor.dom.getParents(elm, 'ol,ul', getClosestListRootElm(editor, elm));
+ return last(parentLists);
+ };
+ var getSelectedLists = function (editor) {
+ var firstList = findLastParentListNode(editor, editor.selection.getStart());
+ var subsequentLists = filter(editor.selection.getSelectedBlocks(), NodeType.isOlUlNode);
+ return firstList.toArray().concat(subsequentLists);
+ };
+ var getSelectedListRoots = function (editor) {
+ var selectedLists = getSelectedLists(editor);
+ return getUniqueListRoots(editor, selectedLists);
+ };
+ var getUniqueListRoots = function (editor, lists) {
+ var listRoots = map(lists, function (list) {
+ return findLastParentListNode(editor, list).getOr(list);
+ });
+ return global$7.unique(listRoots);
+ };
+ var isList = function (editor) {
+ var list = getParentList(editor);
+ return HTMLElement.isPrototypeOf(list);
+ };
+ var Selection = {
+ isList: isList,
+ getParentList: getParentList,
+ getSelectedSubLists: getSelectedSubLists,
+ getSelectedListItems: getSelectedListItems,
+ getClosestListRootElm: getClosestListRootElm,
+ getSelectedDlItems: getSelectedDlItems,
+ getSelectedListRoots: getSelectedListRoots
+ };
</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 global$8 = tinymce.util.Tools.resolve('tinymce.Env');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var node = function () {
+ var f = Global$1.getOrDie('Node');
+ return f;
+ };
+ var compareDocumentPosition = function (a, b, match) {
+ return (a.compareDocumentPosition(b) & match) !== 0;
+ };
+ var documentPositionPreceding = function (a, b) {
+ return compareDocumentPosition(a, b, node().DOCUMENT_POSITION_PRECEDING);
+ };
+ var documentPositionContainedBy = function (a, b) {
+ return compareDocumentPosition(a, b, node().DOCUMENT_POSITION_CONTAINED_BY);
+ };
+ var Node$1 = {
+ documentPositionPreceding: documentPositionPreceding,
+ documentPositionContainedBy: documentPositionContainedBy
+ };
</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 DOM$2 = global$6.DOM;
- var createNewTextBlock = function (editor, contentNode, blockName) {
- var node, textBlock;
- var fragment = DOM$2.createFragment();
- var hasContentNode;
- var blockElements = editor.schema.getBlockElements();
- if (editor.settings.forced_root_block) {
- blockName = blockName || editor.settings.forced_root_block;
- }
- if (blockName) {
- textBlock = DOM$2.create(blockName);
- if (textBlock.tagName === editor.settings.forced_root_block) {
- DOM$2.setAttribs(textBlock, editor.settings.forced_root_block_attrs);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var cached = function (f) {
+ var called = false;
+ var r;
+ return function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ if (!called) {
+ called = true;
+ r = f.apply(null, args);
+ }
+ return r;
+ };
+ };
+
+ var firstMatch = function (regexes, s) {
+ for (var i = 0; i < regexes.length; i++) {
+ var x = regexes[i];
+ if (x.test(s))
+ return x;
</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 (!$_okk1ogljjgweckx.isBlock(contentNode.firstChild, blockElements)) {
- fragment.appendChild(textBlock);
- }
- }
- if (contentNode) {
- while (node = contentNode.firstChild) {
- var nodeName = node.nodeName;
- 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">+ return undefined;
+ };
+ var find$1 = function (regexes, agent) {
+ var r = firstMatch(regexes, agent);
+ if (!r)
+ return {
+ major: 0,
+ minor: 0
+ };
+ var group = function (i) {
+ return Number(agent.replace(r, '$' + i));
+ };
+ return nu(group(1), group(2));
+ };
+ var detect = function (versionRegexes, agent) {
+ var cleanedAgent = String(agent).toLowerCase();
+ if (versionRegexes.length === 0)
+ return unknown();
+ return find$1(versionRegexes, cleanedAgent);
+ };
+ var unknown = function () {
+ return nu(0, 0);
+ };
+ var nu = function (major, minor) {
+ return {
+ major: major,
+ minor: minor
+ };
+ };
+ var Version = {
+ nu: nu,
+ detect: detect,
+ unknown: unknown
+ };
+
+ var edge = 'Edge';
+ var chrome = 'Chrome';
+ var ie = 'IE';
+ var opera = 'Opera';
+ var firefox = 'Firefox';
+ var safari = 'Safari';
+ var isBrowser = function (name, current) {
+ return function () {
+ return current === name;
+ };
+ };
+ var unknown$1 = function () {
+ return nu$1({
+ current: undefined,
+ version: Version.unknown()
+ });
+ };
+ var nu$1 = function (info) {
+ var current = info.current;
+ var version = info.version;
+ return {
+ current: current,
+ version: version,
+ isEdge: isBrowser(edge, current),
+ isChrome: isBrowser(chrome, current),
+ isIE: isBrowser(ie, current),
+ isOpera: isBrowser(opera, current),
+ isFirefox: isBrowser(firefox, current),
+ isSafari: isBrowser(safari, current)
+ };
+ };
+ var Browser = {
+ unknown: unknown$1,
+ nu: nu$1,
+ edge: constant(edge),
+ chrome: constant(chrome),
+ ie: constant(ie),
+ opera: constant(opera),
+ firefox: constant(firefox),
+ safari: constant(safari)
+ };
+
+ var windows = 'Windows';
+ var ios = 'iOS';
+ var android = 'Android';
+ var linux = 'Linux';
+ var osx = 'OSX';
+ var solaris = 'Solaris';
+ var freebsd = 'FreeBSD';
+ var isOS = function (name, current) {
+ return function () {
+ return current === name;
+ };
+ };
+ var unknown$2 = function () {
+ return nu$2({
+ current: undefined,
+ version: Version.unknown()
+ });
+ };
+ var nu$2 = function (info) {
+ var current = info.current;
+ var version = info.version;
+ return {
+ current: current,
+ version: version,
+ isWindows: isOS(windows, current),
+ isiOS: isOS(ios, current),
+ isAndroid: isOS(android, current),
+ isOSX: isOS(osx, current),
+ isLinux: isOS(linux, current),
+ isSolaris: isOS(solaris, current),
+ isFreeBSD: isOS(freebsd, current)
+ };
+ };
+ var OperatingSystem = {
+ unknown: unknown$2,
+ nu: nu$2,
+ windows: constant(windows),
+ ios: constant(ios),
+ android: constant(android),
+ linux: constant(linux),
+ osx: constant(osx),
+ solaris: constant(solaris),
+ freebsd: constant(freebsd)
+ };
+
+ var DeviceType = function (os, browser, userAgent) {
+ var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true;
+ var isiPhone = os.isiOS() && !isiPad;
+ var isAndroid3 = os.isAndroid() && os.version.major === 3;
+ var isAndroid4 = os.isAndroid() && os.version.major === 4;
+ var isTablet = isiPad || isAndroid3 || isAndroid4 && /mobile/i.test(userAgent) === true;
+ var isTouch = os.isiOS() || os.isAndroid();
+ var isPhone = isTouch && !isTablet;
+ var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false;
+ return {
+ isiPad: constant(isiPad),
+ isiPhone: constant(isiPhone),
+ isTablet: constant(isTablet),
+ isPhone: constant(isPhone),
+ isTouch: constant(isTouch),
+ isAndroid: os.isAndroid,
+ isiOS: os.isiOS,
+ isWebView: constant(iOSwebview)
+ };
+ };
+
+ var detect$1 = function (candidates, userAgent) {
+ var agent = String(userAgent).toLowerCase();
+ return find(candidates, function (candidate) {
+ return candidate.search(agent);
+ });
+ };
+ var detectBrowser = function (browsers, userAgent) {
+ return detect$1(browsers, userAgent).map(function (browser) {
+ var version = Version.detect(browser.versionRegexes, userAgent);
+ return {
+ current: browser.name,
+ version: version
+ };
+ });
+ };
+ var detectOs = function (oses, userAgent) {
+ return detect$1(oses, userAgent).map(function (os) {
+ var version = Version.detect(os.versionRegexes, userAgent);
+ return {
+ current: os.name,
+ version: version
+ };
+ });
+ };
+ var UaString = {
+ detectBrowser: detectBrowser,
+ detectOs: detectOs
+ };
+
+ var contains$1 = function (str, substr) {
+ return str.indexOf(substr) !== -1;
+ };
+
+ var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/;
+ var checkContains = function (target) {
+ return function (uastring) {
+ return contains$1(uastring, target);
+ };
+ };
+ var browsers = [
+ {
+ name: 'Edge',
+ versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
+ search: function (uastring) {
+ var monstrosity = contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit');
+ return monstrosity;
</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 ($_okk1ogljjgweckx.isBlock(node, blockElements)) {
- fragment.appendChild(node);
- textBlock = null;
- } else {
- if (blockName) {
- if (!textBlock) {
- textBlock = DOM$2.create(blockName);
- fragment.appendChild(textBlock);
- }
- textBlock.appendChild(node);
- } else {
- fragment.appendChild(node);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ {
+ name: 'Chrome',
+ versionRegexes: [
+ /.*?chrome\/([0-9]+)\.([0-9]+).*/,
+ normalVersionRegex
+ ],
+ search: function (uastring) {
+ return contains$1(uastring, 'chrome') && !contains$1(uastring, 'chromeframe');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ {
+ name: 'IE',
+ versionRegexes: [
+ /.*?msie\ ?([0-9]+)\.([0-9]+).*/,
+ /.*?rv:([0-9]+)\.([0-9]+).*/
+ ],
+ search: function (uastring) {
+ return contains$1(uastring, 'msie') || contains$1(uastring, 'trident');
+ }
+ },
+ {
+ name: 'Opera',
+ versionRegexes: [
+ normalVersionRegex,
+ /.*?opera\/([0-9]+)\.([0-9]+).*/
+ ],
+ search: checkContains('opera')
+ },
+ {
+ name: 'Firefox',
+ versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],
+ search: checkContains('firefox')
+ },
+ {
+ name: 'Safari',
+ versionRegexes: [
+ normalVersionRegex,
+ /.*?cpu os ([0-9]+)_([0-9]+).*/
+ ],
+ search: function (uastring) {
+ return (contains$1(uastring, 'safari') || contains$1(uastring, 'mobile/')) && contains$1(uastring, 'applewebkit');
+ }
</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$2.create('br'));
- } else {
- if (!hasContentNode && (!global$8.ie || global$8.ie > 10)) {
- textBlock.appendChild(DOM$2.create('br', { 'data-mce-bogus': '1' }));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ];
+ var oses = [
+ {
+ name: 'Windows',
+ search: checkContains('win'),
+ versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]
+ },
+ {
+ name: 'iOS',
+ search: function (uastring) {
+ return contains$1(uastring, 'iphone') || contains$1(uastring, 'ipad');
+ },
+ versionRegexes: [
+ /.*?version\/\ ?([0-9]+)\.([0-9]+).*/,
+ /.*cpu os ([0-9]+)_([0-9]+).*/,
+ /.*cpu iphone os ([0-9]+)_([0-9]+).*/
+ ]
+ },
+ {
+ name: 'Android',
+ search: checkContains('android'),
+ versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/]
+ },
+ {
+ name: 'OSX',
+ search: checkContains('os x'),
+ versionRegexes: [/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]
+ },
+ {
+ name: 'Linux',
+ search: checkContains('linux'),
+ versionRegexes: []
+ },
+ {
+ name: 'Solaris',
+ search: checkContains('sunos'),
+ versionRegexes: []
+ },
+ {
+ name: 'FreeBSD',
+ search: checkContains('freebsd'),
+ versionRegexes: []
</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;
- };
- var $_kbc02gqjjgwecl9 = { createNewTextBlock: createNewTextBlock };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ];
+ var PlatformInfo = {
+ browsers: constant(browsers),
+ oses: constant(oses)
+ };
</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 DOM$3 = global$6.DOM;
- var splitList = function (editor, ul, li, newBlock) {
- var tmpRng, fragment, bookmarks, node;
- var removeAndKeepBookmarks = function (targetNode) {
- global$5.each(bookmarks, function (node) {
- targetNode.parentNode.insertBefore(node, li.parentNode);
- });
- DOM$3.remove(targetNode);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var detect$2 = function (userAgent) {
+ var browsers = PlatformInfo.browsers();
+ var oses = PlatformInfo.oses();
+ var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu);
+ var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu);
+ var deviceType = DeviceType(os, browser, userAgent);
+ return {
+ browser: browser,
+ os: os,
+ deviceType: deviceType
+ };
</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$3.select('span[data-mce-type="bookmark"]', ul);
- newBlock = newBlock || $_kbc02gqjjgwecl9.createNewTextBlock(editor, li);
- tmpRng = DOM$3.createRng();
- tmpRng.setStartAfter(li);
- tmpRng.setEndAfter(ul);
- fragment = tmpRng.extractContents();
- for (node = fragment.firstChild; node; node = node.firstChild) {
- if (node.nodeName === 'LI' && editor.dom.isEmpty(node)) {
- DOM$3.remove(node);
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var PlatformDetection = { detect: detect$2 };
+
+ var detect$3 = cached(function () {
+ var userAgent = navigator.userAgent;
+ return PlatformDetection.detect(userAgent);
+ });
+ var PlatformDetection$1 = { detect: detect$3 };
+
+ var fromHtml = function (html, scope) {
+ var doc = scope || document;
+ var div = doc.createElement('div');
+ div.innerHTML = html;
+ if (!div.hasChildNodes() || div.childNodes.length > 1) {
+ console.error('HTML does not have a single root node', html);
+ throw 'HTML must have a single root 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 (!editor.dom.isEmpty(fragment)) {
- DOM$3.insertAfter(fragment, ul);
- }
- DOM$3.insertAfter(newBlock, ul);
- if ($_okk1ogljjgweckx.isEmpty(editor.dom, li.parentNode)) {
- removeAndKeepBookmarks(li.parentNode);
- }
- DOM$3.remove(li);
- if ($_okk1ogljjgweckx.isEmpty(editor.dom, ul)) {
- DOM$3.remove(ul);
- }
- };
- var $_fikiq7gpjjgwecl5 = { splitList: splitList };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return fromDom(div.childNodes[0]);
+ };
+ var fromTag = function (tag, scope) {
+ var doc = scope || document;
+ var node = doc.createElement(tag);
+ return fromDom(node);
+ };
+ var fromText = function (text, scope) {
+ var doc = scope || document;
+ var node = doc.createTextNode(text);
+ return fromDom(node);
+ };
+ var fromDom = function (node) {
+ if (node === null || node === undefined)
+ throw new Error('Node cannot be null or undefined');
+ return { dom: constant(node) };
+ };
+ var fromPoint = function (docElm, x, y) {
+ var doc = docElm.dom();
+ return Option.from(doc.elementFromPoint(x, y)).map(fromDom);
+ };
+ var Element$$1 = {
+ fromHtml: fromHtml,
+ fromTag: fromTag,
+ fromText: fromText,
+ fromDom: fromDom,
+ fromPoint: fromPoint
+ };
</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 DOM$4 = global$6.DOM;
- var removeEmptyLi = function (dom, li) {
- if ($_okk1ogljjgweckx.isEmpty(dom, li)) {
- DOM$4.remove(li);
- }
- };
- var outdent = function (editor, li) {
- var ul = li.parentNode;
- var ulParent, newBlock;
- if (ul) {
- ulParent = ul.parentNode;
- } else {
- removeEmptyLi(editor.dom, li);
- return true;
- }
- if (ul === editor.getBody()) {
- return true;
- }
- if (li.nodeName === 'DD') {
- DOM$4.rename(li, 'DT');
- return true;
- }
- if ($_okk1ogljjgweckx.isFirstChild(li) && $_okk1ogljjgweckx.isLastChild(li)) {
- if (ulParent.nodeName === 'LI') {
- DOM$4.insertAfter(li, ulParent);
- removeEmptyLi(editor.dom, ulParent);
- DOM$4.remove(ul);
- } else if ($_okk1ogljjgweckx.isListNode(ulParent)) {
- DOM$4.remove(ul, true);
- } else {
- ulParent.insertBefore($_kbc02gqjjgwecl9.createNewTextBlock(editor, li), ul);
- DOM$4.remove(ul);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ATTRIBUTE = Node.ATTRIBUTE_NODE;
+ var CDATA_SECTION = Node.CDATA_SECTION_NODE;
+ var COMMENT = Node.COMMENT_NODE;
+ var DOCUMENT = Node.DOCUMENT_NODE;
+ var DOCUMENT_TYPE = Node.DOCUMENT_TYPE_NODE;
+ var DOCUMENT_FRAGMENT = Node.DOCUMENT_FRAGMENT_NODE;
+ var ELEMENT = Node.ELEMENT_NODE;
+ var TEXT = Node.TEXT_NODE;
+ var PROCESSING_INSTRUCTION = Node.PROCESSING_INSTRUCTION_NODE;
+ var ENTITY_REFERENCE = Node.ENTITY_REFERENCE_NODE;
+ var ENTITY = Node.ENTITY_NODE;
+ var NOTATION = Node.NOTATION_NODE;
+
+ var ELEMENT$1 = ELEMENT;
+ var is = function (element, selector) {
+ var elem = element.dom();
+ if (elem.nodeType !== ELEMENT$1)
+ return false;
+ else if (elem.matches !== undefined)
+ return elem.matches(selector);
+ else if (elem.msMatchesSelector !== undefined)
+ return elem.msMatchesSelector(selector);
+ else if (elem.webkitMatchesSelector !== undefined)
+ return elem.webkitMatchesSelector(selector);
+ else if (elem.mozMatchesSelector !== undefined)
+ return elem.mozMatchesSelector(selector);
+ else
+ throw new Error('Browser lacks native selectors');
+ };
+
+ var eq = function (e1, e2) {
+ return e1.dom() === e2.dom();
+ };
+ var regularContains = function (e1, e2) {
+ var d1 = e1.dom(), d2 = e2.dom();
+ return d1 === d2 ? false : d1.contains(d2);
+ };
+ var ieContains = function (e1, e2) {
+ return Node$1.documentPositionContainedBy(e1.dom(), e2.dom());
+ };
+ var browser = PlatformDetection$1.detect().browser;
+ var contains$2 = browser.isIE() ? ieContains : regularContains;
+ var is$1 = is;
+
+ var keys = Object.keys;
+ var each$1 = function (obj, f) {
+ var props = keys(obj);
+ for (var k = 0, len = props.length; k < len; k++) {
+ var i = props[k];
+ var x = obj[i];
+ f(x, i, 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">- return true;
- } else if ($_okk1ogljjgweckx.isFirstChild(li)) {
- if (ulParent.nodeName === 'LI') {
- DOM$4.insertAfter(li, ulParent);
- li.appendChild(ul);
- removeEmptyLi(editor.dom, ulParent);
- } else if ($_okk1ogljjgweckx.isListNode(ulParent)) {
- ulParent.insertBefore(li, ul);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+
+ var name = function (element) {
+ var r = element.dom().nodeName;
+ return r.toLowerCase();
+ };
+
+ var rawSet = function (dom, key, value$$1) {
+ if (isString(value$$1) || isBoolean(value$$1) || isNumber(value$$1)) {
+ dom.setAttribute(key, value$$1 + '');
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ulParent.insertBefore($_kbc02gqjjgwecl9.createNewTextBlock(editor, li), ul);
- DOM$4.remove(li);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ console.error('Invalid call to Attr.set. Key ', key, ':: Value ', value$$1, ':: Element ', dom);
+ throw new Error('Attribute value was not simple');
</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 ($_okk1ogljjgweckx.isLastChild(li)) {
- if (ulParent.nodeName === 'LI') {
- DOM$4.insertAfter(li, ulParent);
- } else if ($_okk1ogljjgweckx.isListNode(ulParent)) {
- DOM$4.insertAfter(li, ul);
- } else {
- DOM$4.insertAfter($_kbc02gqjjgwecl9.createNewTextBlock(editor, li), ul);
- DOM$4.remove(li);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var setAll = function (element, attrs) {
+ var dom = element.dom();
+ each$1(attrs, function (v, k) {
+ rawSet(dom, k, v);
+ });
+ };
+ var clone = function (element) {
+ return foldl(element.dom().attributes, function (acc, attr) {
+ acc[attr.name] = attr.value;
+ return acc;
+ }, {});
+ };
+
+ var Immutable = function () {
+ var fields = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ fields[_i] = arguments[_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">- return true;
- }
- if (ulParent.nodeName === 'LI') {
- ul = ulParent;
- newBlock = $_kbc02gqjjgwecl9.createNewTextBlock(editor, li, 'LI');
- } else if ($_okk1ogljjgweckx.isListNode(ulParent)) {
- newBlock = $_kbc02gqjjgwecl9.createNewTextBlock(editor, li, 'LI');
- } else {
- newBlock = $_kbc02gqjjgwecl9.createNewTextBlock(editor, li);
- }
- $_fikiq7gpjjgwecl5.splitList(editor, ul, li, newBlock);
- $_ekd4wzgmjjgwecl1.normalizeLists(editor.dom, ul.parentNode);
- return true;
- };
- var outdentSelection = function (editor) {
- var listElements = $_3xb1cggnjjgwecl3.getSelectedListItems(editor);
- if (listElements.length) {
- var bookmark = $_2nx1i4gjjjgweckt.createBookmark(editor.selection.getRng());
- var i = void 0, y = void 0;
- var root = $_3xb1cggnjjgwecl3.getClosestListRootElm(editor, editor.selection.getStart(true));
- i = listElements.length;
- while (i--) {
- var node = listElements[i].parentNode;
- 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">+ return function () {
+ var values = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ values[_i] = arguments[_i];
+ }
+ if (fields.length !== values.length) {
+ throw new Error('Wrong number of arguments to struct. Expected "[' + fields.length + ']", got ' + values.length + ' arguments');
+ }
+ var struct = {};
+ each(fields, function (name, i) {
+ struct[name] = constant(values[i]);
+ });
+ return struct;
+ };
+ };
+
+ var parent = function (element) {
+ var dom = element.dom();
+ return Option.from(dom.parentNode).map(Element$$1.fromDom);
+ };
+ var children = function (element) {
+ var dom = element.dom();
+ return map(dom.childNodes, Element$$1.fromDom);
+ };
+ var child = function (element, index) {
+ var children = element.dom().childNodes;
+ return Option.from(children[index]).map(Element$$1.fromDom);
+ };
+ var firstChild = function (element) {
+ return child(element, 0);
+ };
+ var lastChild = function (element) {
+ return child(element, element.dom().childNodes.length - 1);
+ };
+ var spot = Immutable('element', 'offset');
+
+ var before = function (marker, element) {
+ var parent$$1 = parent(marker);
+ parent$$1.each(function (v) {
+ v.dom().insertBefore(element.dom(), marker.dom());
+ });
+ };
+ var append = function (parent$$1, element) {
+ parent$$1.dom().appendChild(element.dom());
+ };
+
+ var before$1 = function (marker, elements) {
+ each(elements, function (x) {
+ before(marker, x);
+ });
+ };
+ var append$1 = function (parent, elements) {
+ each(elements, function (x) {
+ append(parent, x);
+ });
+ };
+
+ var remove$1 = function (element) {
+ var dom = element.dom();
+ if (dom.parentNode !== null)
+ dom.parentNode.removeChild(dom);
+ };
+
+ var clone$1 = function (original, deep) {
+ return Element$$1.fromDom(original.dom().cloneNode(deep));
+ };
+ var deep = function (original) {
+ return clone$1(original, true);
+ };
+ var shallowAs = function (original, tag) {
+ var nu = Element$$1.fromTag(tag);
+ var attributes = clone(original);
+ setAll(nu, attributes);
+ return nu;
+ };
+ var mutate = function (original, tag) {
+ var nu = shallowAs(original, tag);
+ before(original, nu);
+ var children$$1 = children(original);
+ append$1(nu, children$$1);
+ remove$1(original);
+ return nu;
+ };
+
+ var global$8 = tinymce.util.Tools.resolve('tinymce.Env');
+
+ var DOM$1 = global$6.DOM;
+ var createNewTextBlock = function (editor, contentNode, blockName) {
+ var node, textBlock;
+ var fragment = DOM$1.createFragment();
+ var hasContentNode;
+ var blockElements = editor.schema.getBlockElements();
+ if (editor.settings.forced_root_block) {
+ blockName = blockName || editor.settings.forced_root_block;
+ }
+ if (blockName) {
+ textBlock = DOM$1.create(blockName);
+ if (textBlock.tagName === editor.settings.forced_root_block) {
+ DOM$1.setAttribs(textBlock, editor.settings.forced_root_block_attrs);
+ }
+ if (!NodeType.isBlock(contentNode.firstChild, blockElements)) {
+ fragment.appendChild(textBlock);
+ }
+ }
+ if (contentNode) {
+ while (node = contentNode.firstChild) {
+ var nodeName = node.nodeName;
+ if (!hasContentNode && (nodeName !== 'SPAN' || node.getAttribute('data-mce-type') !== 'bookmark')) {
+ hasContentNode = true;
+ }
+ if (NodeType.isBlock(node, blockElements)) {
+ fragment.appendChild(node);
+ textBlock = null;
+ } else {
+ if (blockName) {
+ if (!textBlock) {
+ textBlock = DOM$1.create(blockName);
+ fragment.appendChild(textBlock);
+ }
+ textBlock.appendChild(node);
+ } else {
+ fragment.appendChild(node);
</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">- node = node.parentNode;
</del><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">- 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">+ if (!editor.settings.forced_root_block) {
+ fragment.appendChild(DOM$1.create('br'));
+ } else {
+ if (!hasContentNode && (!global$8.ie || global$8.ie > 10)) {
+ textBlock.appendChild(DOM$1.create('br', { 'data-mce-bogus': '1' }));
</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">- editor.selection.setRng($_2nx1i4gjjjgweckt.resolveBookmark(bookmark));
- editor.nodeChanged();
- return true;
- }
- };
- var $_6pbactghjjgweckp = {
- outdent: outdent,
- outdentSelection: outdentSelection
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return fragment;
+ };
+ var TextBlock = { createNewTextBlock: createNewTextBlock };
</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 updateListStyle = function (dom, el, detail) {
- var type = detail['list-style-type'] ? detail['list-style-type'] : null;
- dom.setStyle(el, 'list-style-type', type);
- };
- var setAttribs = function (elm, attrs) {
- global$5.each(attrs, function (value, key) {
- elm.setAttribute(key, value);
- });
- };
- var updateListAttrs = function (dom, el, detail) {
- setAttribs(el, detail['list-attributes']);
- global$5.each(dom.select('li', el), function (li) {
- setAttribs(li, detail['list-item-attributes']);
- });
- };
- var updateListWithDetails = function (dom, el, detail) {
- updateListStyle(dom, el, detail);
- updateListAttrs(dom, el, detail);
- };
- var removeStyles = function (dom, element, styles) {
- global$5.each(styles, function (style) {
- var _a;
- return dom.setStyle(element, (_a = {}, _a[style] = '', _a));
- });
- };
- var getEndPointNode = function (editor, rng, start, root) {
- var container, offset;
- container = rng[start ? 'startContainer' : 'endContainer'];
- offset = rng[start ? 'startOffset' : 'endOffset'];
- if (container.nodeType === 1) {
- container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
- }
- if (!start && $_okk1ogljjgweckx.isBr(container.nextSibling)) {
- container = container.nextSibling;
- }
- while (container.parentNode !== root) {
- if ($_okk1ogljjgweckx.isTextBlock(editor, container)) {
- return container;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var DOM$2 = global$6.DOM;
+ var splitList = function (editor, ul, li, newBlock) {
+ var tmpRng, fragment, bookmarks, node;
+ var removeAndKeepBookmarks = function (targetNode) {
+ global$5.each(bookmarks, function (node) {
+ targetNode.parentNode.insertBefore(node, li.parentNode);
+ });
+ DOM$2.remove(targetNode);
+ };
+ bookmarks = DOM$2.select('span[data-mce-type="bookmark"]', ul);
+ newBlock = newBlock || TextBlock.createNewTextBlock(editor, li);
+ tmpRng = DOM$2.createRng();
+ tmpRng.setStartAfter(li);
+ tmpRng.setEndAfter(ul);
+ fragment = tmpRng.extractContents();
+ for (node = fragment.firstChild; node; node = node.firstChild) {
+ if (node.nodeName === 'LI' && editor.dom.isEmpty(node)) {
+ DOM$2.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">- if (/^(TD|TH)$/.test(container.parentNode.nodeName)) {
- return container;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!editor.dom.isEmpty(fragment)) {
+ DOM$2.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">- container = container.parentNode;
- }
- return container;
- };
- var getSelectedTextBlocks = function (editor, rng, root) {
- var textBlocks = [], dom = editor.dom;
- var startNode = getEndPointNode(editor, rng, true, root);
- var endNode = getEndPointNode(editor, rng, false, root);
- var block;
- var siblings = [];
- for (var node = startNode; node; node = node.nextSibling) {
- siblings.push(node);
- if (node === endNode) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ DOM$2.insertAfter(newBlock, ul);
+ 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">- }
- global$5.each(siblings, function (node) {
- if ($_okk1ogljjgweckx.isTextBlock(editor, node)) {
- textBlocks.push(node);
- block = null;
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ DOM$2.remove(li);
+ if (NodeType.isEmpty(editor.dom, ul)) {
+ DOM$2.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">- if (dom.isBlock(node) || $_okk1ogljjgweckx.isBr(node)) {
- if ($_okk1ogljjgweckx.isBr(node)) {
- dom.remove(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var SplitList = { splitList: splitList };
+
+ var liftN = function (arr, f) {
+ var r = [];
+ for (var i = 0; i < arr.length; i++) {
+ var x = arr[i];
+ if (x.isSome()) {
+ r.push(x.getOrDie());
+ } else {
+ return Option.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">- block = null;
- return;
</del><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 (global$4.isBookmarkNode(node)) {
- if ($_okk1ogljjgweckx.isTextBlock(editor, nextSibling) || !nextSibling && node.parentNode === root) {
- block = null;
- return;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Option.some(f.apply(null, r));
+ };
+
+ var fromElements = function (elements, scope) {
+ var doc = scope || document;
+ var fragment = doc.createDocumentFragment();
+ each(elements, function (element) {
+ fragment.appendChild(element.dom());
+ });
+ return Element$$1.fromDom(fragment);
+ };
+
+ var isSupported = function (dom) {
+ return dom.style !== undefined;
+ };
+
+ var internalSet = function (dom, property, value$$1) {
+ if (!isString(value$$1)) {
+ console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value$$1, ':: Element ', dom);
+ throw new Error('CSS value must be a string: ' + value$$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 (!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 (isSupported(dom))
+ dom.style.setProperty(property, value$$1);
+ };
+ var set$1 = function (element, property, value$$1) {
+ var dom = element.dom();
+ internalSet(dom, property, value$$1);
+ };
+
+ var createSection = function (scope, listType) {
+ var section = {
+ list: Element$$1.fromTag(listType, scope),
+ item: Element$$1.fromTag('li', scope)
+ };
+ append(section.list, section.item);
+ return section;
+ };
+ var joinSections = function (parent, appendor) {
+ append(parent.item, appendor.list);
+ };
+ var createJoinedSections = function (scope, length, listType) {
+ var sections = [];
+ var _loop_1 = function (i) {
+ var newSection = createSection(scope, listType);
+ last(sections).each(function (lastSection) {
+ return joinSections(lastSection, newSection);
+ });
+ sections.push(newSection);
+ };
+ for (var i = 0; i < length; i++) {
+ _loop_1(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">- block.appendChild(node);
- });
- return textBlocks;
- };
- var hasCompatibleStyle = function (dom, sib, detail) {
- var sibStyle = dom.getStyle(sib, 'list-style-type');
- var detailStyle = detail ? detail['list-style-type'] : '';
- detailStyle = detailStyle === null ? '' : detailStyle;
- return sibStyle === detailStyle;
- };
- var applyList = function (editor, listName, detail) {
- if (detail === void 0) {
- detail = {};
- }
- var rng = editor.selection.getRng(true);
- var bookmark;
- var listItemName = 'LI';
- var root = $_3xb1cggnjjgwecl3.getClosestListRootElm(editor, editor.selection.getStart(true));
- var dom = editor.dom;
- if (dom.getContentEditable(editor.selection.getNode()) === 'false') {
- return;
- }
- listName = listName.toUpperCase();
- if (listName === 'DL') {
- listItemName = 'DT';
- }
- bookmark = $_2nx1i4gjjjgweckt.createBookmark(rng);
- global$5.each(getSelectedTextBlocks(editor, rng, root), function (block) {
- var listBlock, sibling;
- sibling = block.previousSibling;
- if (sibling && $_okk1ogljjgweckx.isListNode(sibling) && sibling.nodeName === listName && hasCompatibleStyle(dom, sibling, detail)) {
- 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">+ return sections;
+ };
+ var normalizeSection = function (section, entry) {
+ if (name(section.list).toUpperCase() !== entry.listType) {
+ section.list = mutate(section.list, entry.listType);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- removeStyles(dom, block, [
- 'margin',
- 'margin-right',
- 'margin-bottom',
- 'margin-left',
- 'margin-top',
- 'padding',
- 'padding-right',
- 'padding-bottom',
- 'padding-left',
- 'padding-top'
- ]);
- updateListWithDetails(dom, listBlock, detail);
- mergeWithAdjacentLists(editor.dom, listBlock);
- });
- editor.selection.setRng($_2nx1i4gjjjgweckt.resolveBookmark(bookmark));
- };
- var removeList = function (editor) {
- var bookmark = $_2nx1i4gjjjgweckt.createBookmark(editor.selection.getRng(true));
- var root = $_3xb1cggnjjgwecl3.getClosestListRootElm(editor, editor.selection.getStart(true));
- var listItems = $_3xb1cggnjjgwecl3.getSelectedListItems(editor);
- var emptyListItems = global$5.grep(listItems, function (li) {
- return editor.dom.isEmpty(li);
- });
- listItems = global$5.grep(listItems, function (li) {
- return !editor.dom.isEmpty(li);
- });
- global$5.each(emptyListItems, function (li) {
- if ($_okk1ogljjgweckx.isEmpty(editor.dom, li)) {
- $_6pbactghjjgweckp.outdent(editor, li);
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ setAll(section.list, entry.listAttributes);
+ };
+ var createItem = function (scope, attr, content) {
+ var item = Element$$1.fromTag('li', scope);
+ setAll(item, attr);
+ append$1(item, content);
+ return item;
+ };
+ var setItem = function (section, item) {
+ append(section.list, item);
+ section.item = item;
+ };
+ var writeShallow = function (scope, outline, entry) {
+ var newOutline = outline.slice(0, entry.depth);
+ last(newOutline).each(function (section) {
+ setItem(section, createItem(scope, entry.itemAttributes, entry.content));
+ normalizeSection(section, entry);
+ });
+ return newOutline;
+ };
+ var populateSections = function (sections, entry) {
+ last(sections).each(function (section) {
+ setAll(section.list, entry.listAttributes);
+ setAll(section.item, entry.itemAttributes);
+ append$1(section.item, entry.content);
+ });
+ for (var i = 0; i < sections.length - 1; i++) {
+ set$1(sections[i].item, 'list-style-type', '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">- });
- global$5.each(listItems, function (li) {
- var node, rootList;
- if (li.parentNode === editor.getBody()) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var writeDeep = function (scope, outline, entry) {
+ var newSections = createJoinedSections(scope, entry.depth - outline.length, entry.listType);
+ populateSections(newSections, entry);
+ liftN([
+ last(outline),
+ head(newSections)
+ ], joinSections);
+ return outline.concat(newSections);
+ };
+ var composeList = function (scope, entries) {
+ var outline = foldl(entries, function (outline, entry) {
+ return entry.depth > outline.length ? writeDeep(scope, outline, entry) : writeShallow(scope, outline, entry);
+ }, []);
+ return head(outline).map(function (section) {
+ return section.list;
+ });
+ };
+
+ var isIndented = function (entry) {
+ return entry.depth > 0;
+ };
+ var isSelected = function (entry) {
+ return entry.isSelected;
+ };
+
+ var indentEntry = function (indentation, entry) {
+ switch (indentation) {
+ case 'Indent':
+ entry.depth++;
+ break;
+ case 'Outdent':
+ entry.depth--;
+ break;
+ case 'Flatten':
+ entry.depth = 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">- for (node = li; node && node !== root; node = node.parentNode) {
- if ($_okk1ogljjgweckx.isListNode(node)) {
- rootList = node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+
+ var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
+ var shallow$1 = function (old, nu) {
+ return nu;
+ };
+ var baseMerge = function (merger) {
+ return function () {
+ var objects = new Array(arguments.length);
+ for (var i = 0; i < objects.length; i++)
+ objects[i] = arguments[i];
+ if (objects.length === 0)
+ throw new Error('Can\'t merge zero objects');
+ var ret = {};
+ for (var j = 0; j < objects.length; j++) {
+ var curObject = objects[j];
+ for (var key in curObject)
+ if (hasOwnProperty$1.call(curObject, key)) {
+ ret[key] = merger(ret[key], curObject[key]);
+ }
</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 ret;
+ };
+ };
+ var merge = baseMerge(shallow$1);
+
+ var assimilateEntry = function (adherent, source) {
+ adherent.listType = source.listType;
+ adherent.listAttributes = merge({}, source.listAttributes);
+ };
+ var normalizeShallow = function (outline, entry) {
+ var matchingEntryDepth = entry.depth - 1;
+ outline[matchingEntryDepth].each(function (matchingEntry) {
+ return assimilateEntry(entry, matchingEntry);
+ });
+ var newOutline = outline.slice(0, matchingEntryDepth);
+ newOutline.push(Option.some(entry));
+ return newOutline;
+ };
+ var normalizeDeep = function (outline, entry) {
+ var newOutline = outline.slice(0);
+ var diff = entry.depth - outline.length;
+ for (var i = 1; i < diff; i++) {
+ newOutline.push(Option.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">- $_fikiq7gpjjgwecl5.splitList(editor, rootList, li);
- $_ekd4wzgmjjgwecl1.normalizeLists(editor.dom, rootList.parentNode);
- });
- editor.selection.setRng($_2nx1i4gjjjgweckt.resolveBookmark(bookmark));
- };
- var isValidLists = function (list1, list2) {
- return list1 && list2 && $_okk1ogljjgweckx.isListNode(list1) && list1.nodeName === list2.nodeName;
- };
- 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;
- };
- var hasSameClasses = function (elm1, elm2) {
- return elm1.className === elm2.className;
- };
- var shouldMerge = function (dom, list1, list2) {
- return isValidLists(list1, list2) && hasSameListStyle(dom, list1, list2) && hasSameClasses(list1, list2);
- };
- var mergeWithAdjacentLists = function (dom, listBlock) {
- var sibling, node;
- 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">+ newOutline.push(Option.some(entry));
+ return newOutline;
+ };
+ var normalizeEntries = function (entries) {
+ foldl(entries, function (outline, entry) {
+ return entry.depth > outline.length ? normalizeDeep(outline, entry) : normalizeShallow(outline, entry);
+ }, []);
+ };
+
+ var Cell = function (initial) {
+ var value = initial;
+ var get = function () {
+ return value;
+ };
+ var set = function (v) {
+ value = v;
+ };
+ var clone = function () {
+ return Cell(get());
+ };
+ return {
+ get: get,
+ set: set,
+ clone: clone
+ };
+ };
+
+ var ListType;
+ (function (ListType) {
+ ListType['OL'] = 'OL';
+ ListType['UL'] = 'UL';
+ ListType['DL'] = 'DL';
+ }(ListType || (ListType = {})));
+ var getListType = function (list) {
+ switch (name(list)) {
+ case 'ol':
+ return Option.some(ListType.OL);
+ case 'ul':
+ return Option.some(ListType.UL);
+ case 'dl':
+ return Option.some(ListType.DL);
+ default:
+ return Option.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">- dom.remove(sibling);
- }
- 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">+ };
+ var isList$1 = function (el) {
+ return is$1(el, 'OL,UL,DL');
+ };
+
+ var hasFirstChildList = function (li) {
+ return firstChild(li).map(isList$1).getOr(false);
+ };
+ var hasLastChildList = function (li) {
+ return lastChild(li).map(isList$1).getOr(false);
+ };
+
+ var getItemContent = function (li) {
+ var childNodes = children(li);
+ var contentLength = childNodes.length + (hasLastChildList(li) ? -1 : 0);
+ return map(childNodes.slice(0, contentLength), deep);
+ };
+ var createEntry = function (li, depth, isSelected) {
+ var list = parent(li);
+ return {
+ depth: depth,
+ isSelected: isSelected,
+ content: getItemContent(li),
+ listType: list.bind(getListType).getOr(ListType.OL),
+ listAttributes: list.map(clone).getOr({}),
+ itemAttributes: clone(li)
+ };
+ };
+ var parseItem = function (depth, itemSelection, selectionState, item) {
+ var curriedParseList = curry(parseList, depth, itemSelection, selectionState);
+ var updateSelectionState = function (itemRange) {
+ return itemSelection.each(function (selection) {
+ if (eq(itemRange === 'Start' ? selection.start : selection.end, item)) {
+ selectionState.set(itemRange === 'Start');
+ }
+ });
+ };
+ return firstChild(item).filter(isList$1).fold(function () {
+ updateSelectionState('Start');
+ var fromCurrentItem = createEntry(item, depth, selectionState.get());
+ updateSelectionState('End');
+ var fromChildList = lastChild(item).filter(isList$1).map(curriedParseList).getOr([]);
+ return [fromCurrentItem].concat(fromChildList);
+ }, curriedParseList);
+ };
+ var parseList = function (depth, itemSelection, selectionState, list) {
+ var newDepth = depth + 1;
+ return bind(children(list), function (child$$1) {
+ return isList$1(child$$1) ? parseList(newDepth, itemSelection, selectionState, child$$1) : parseItem(newDepth, itemSelection, selectionState, child$$1);
+ });
+ };
+ var parseLists = function (lists, itemSelection) {
+ var selectionState = Cell(false);
+ var initialDepth = 0;
+ return map(lists, function (list) {
+ return {
+ entries: parseList(initialDepth, itemSelection, selectionState, list),
+ sourceList: list
+ };
+ });
+ };
+
+ var outdentedComposer = function (editor, entries) {
+ return map(entries, function (entry) {
+ var content = fromElements(entry.content);
+ return Element$$1.fromDom(TextBlock.createNewTextBlock(editor, content.dom()));
+ });
+ };
+ var indentedComposer = function (editor, entries) {
+ normalizeEntries(entries);
+ return composeList(editor.contentDocument, entries).toArray();
+ };
+ var composeEntries = function (editor, entries) {
+ return bind(groupBy(entries, isIndented), function (entries) {
+ var groupIsIndented = head(entries).map(isIndented).getOr(false);
+ return groupIsIndented ? indentedComposer(editor, entries) : outdentedComposer(editor, entries);
+ });
+ };
+ var indentSelectedEntries = function (entries, indentation) {
+ each(filter(entries, isSelected), function (entry) {
+ return indentEntry(indentation, entry);
+ });
+ };
+ var getItemSelection = function (editor) {
+ var selectedListItems = map(Selection.getSelectedListItems(editor), Element$$1.fromDom);
+ return liftN([
+ find(selectedListItems, not(hasFirstChildList)),
+ find(reverse(selectedListItems), not(hasFirstChildList))
+ ], function (start, end) {
+ return {
+ start: start,
+ end: end
+ };
+ });
+ };
+ var listsIndentation = function (editor, lists, indentation) {
+ var parsedLists = parseLists(lists, getItemSelection(editor));
+ each(parsedLists, function (entrySet) {
+ indentSelectedEntries(entrySet.entries, indentation);
+ before$1(entrySet.sourceList, composeEntries(editor, entrySet.entries));
+ remove$1(entrySet.sourceList);
+ });
+ };
+
+ var outdentDlItem = function (editor, item) {
+ if (is$1(item, 'DD')) {
+ mutate(item, 'DT');
+ } else if (is$1(item, 'DT')) {
+ parent(item).each(function (dl) {
+ return SplitList.splitList(editor, dl.dom(), item.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">- dom.remove(sibling);
- }
- };
- var updateList = function (dom, list, listName, detail) {
- if (list.nodeName !== listName) {
- var newList = dom.rename(list, listName);
- updateListWithDetails(dom, newList, detail);
- } else {
- updateListWithDetails(dom, list, detail);
- }
- };
- var toggleMultipleLists = function (editor, parentList, lists, listName, detail) {
- if (parentList.nodeName === listName && !hasListStyleDetail(detail)) {
- removeList(editor);
- } else {
- var bookmark = $_2nx1i4gjjjgweckt.createBookmark(editor.selection.getRng(true));
- global$5.each([parentList].concat(lists), function (elm) {
- updateList(editor.dom, elm, listName, detail);
- });
- editor.selection.setRng($_2nx1i4gjjjgweckt.resolveBookmark(bookmark));
- }
- };
- var hasListStyleDetail = function (detail) {
- return 'list-style-type' in detail;
- };
- var toggleSingleList = function (editor, parentList, listName, detail) {
- if (parentList === editor.getBody()) {
- return;
- }
- if (parentList) {
- if (parentList.nodeName === listName && !hasListStyleDetail(detail)) {
- removeList(editor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var indentDlItem = function (item) {
+ if (is$1(item, 'DT')) {
+ mutate(item, 'DD');
+ }
+ };
+ var dlIndentation = function (editor, indentation, dlItems) {
+ if (indentation === 'Indent') {
+ each(dlItems, indentDlItem);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var bookmark = $_2nx1i4gjjjgweckt.createBookmark(editor.selection.getRng(true));
- updateListWithDetails(editor.dom, parentList, detail);
- mergeWithAdjacentLists(editor.dom, editor.dom.rename(parentList, listName));
- editor.selection.setRng($_2nx1i4gjjjgweckt.resolveBookmark(bookmark));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ each(dlItems, function (item) {
+ return outdentDlItem(editor, item);
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- applyList(editor, listName, detail);
- }
- };
- var toggleList = function (editor, listName, detail) {
- var parentList = $_3xb1cggnjjgwecl3.getParentList(editor);
- var selectedSubLists = $_3xb1cggnjjgwecl3.getSelectedSubLists(editor);
- detail = detail ? detail : {};
- if (parentList && selectedSubLists.length > 0) {
- toggleMultipleLists(editor, parentList, selectedSubLists, listName, detail);
- } else {
- toggleSingleList(editor, parentList, listName, detail);
- }
- };
- var $_aek3i3gejjgwecki = {
- toggleList: toggleList,
- removeList: removeList,
- mergeWithAdjacentLists: mergeWithAdjacentLists
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var selectionIndentation = function (editor, indentation) {
+ var dlItems = map(Selection.getSelectedDlItems(editor), Element$$1.fromDom);
+ var lists = map(Selection.getSelectedListRoots(editor), Element$$1.fromDom);
+ if (dlItems.length || lists.length) {
+ var bookmark = editor.selection.getBookmark();
+ dlIndentation(editor, indentation, dlItems);
+ listsIndentation(editor, lists, indentation);
+ editor.selection.moveToBookmark(bookmark);
+ editor.selection.setRng(Range.normalizeRange(editor.selection.getRng()));
+ editor.nodeChanged();
+ }
+ };
+ var indentListSelection = function (editor) {
+ selectionIndentation(editor, 'Indent');
+ };
+ var outdentListSelection = function (editor) {
+ selectionIndentation(editor, 'Outdent');
+ };
+ var flattenListSelection = function (editor) {
+ selectionIndentation(editor, 'Flatten');
+ };
</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 findNextCaretContainer = function (editor, rng, isForward, root) {
- var node = rng.startContainer;
- var offset = rng.startOffset;
- var nonEmptyBlocks, walker;
- if (node.nodeType === 3 && (isForward ? offset < node.data.length : offset > 0)) {
- return node;
- }
- nonEmptyBlocks = editor.schema.getNonEmptyElements();
- if (node.nodeType === 1) {
- node = global$1.getNode(node, offset);
- }
- walker = new global$2(node, root);
- if (isForward) {
- if ($_okk1ogljjgweckx.isBogusBr(editor.dom, node)) {
- walker.next();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var updateListStyle = function (dom, el, detail) {
+ var type = detail['list-style-type'] ? detail['list-style-type'] : null;
+ dom.setStyle(el, 'list-style-type', type);
+ };
+ var setAttribs = function (elm, attrs) {
+ global$5.each(attrs, function (value, key) {
+ elm.setAttribute(key, value);
+ });
+ };
+ var updateListAttrs = function (dom, el, detail) {
+ setAttribs(el, detail['list-attributes']);
+ global$5.each(dom.select('li', el), function (li) {
+ setAttribs(li, detail['list-item-attributes']);
+ });
+ };
+ var updateListWithDetails = function (dom, el, detail) {
+ updateListStyle(dom, el, detail);
+ updateListAttrs(dom, el, detail);
+ };
+ var removeStyles = function (dom, element, styles) {
+ global$5.each(styles, function (style) {
+ var _a;
+ return dom.setStyle(element, (_a = {}, _a[style] = '', _a));
+ });
+ };
+ var getEndPointNode = function (editor, rng, start, root) {
+ var container, offset;
+ container = rng[start ? 'startContainer' : 'endContainer'];
+ offset = rng[start ? 'startOffset' : 'endOffset'];
+ 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 (node = walker[isForward ? 'next' : 'prev2']()) {
- if (node.nodeName === 'LI' && !node.hasChildNodes()) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!start && NodeType.isBr(container.nextSibling)) {
+ container = container.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">- if (nonEmptyBlocks[node.nodeName]) {
- return node;
</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;
+ }
+ if (/^(TD|TH)$/.test(container.parentNode.nodeName)) {
+ return container;
+ }
+ 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">- if (node.nodeType === 3 && node.data.length > 0) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return container;
+ };
+ var getSelectedTextBlocks = function (editor, rng, root) {
+ var textBlocks = [], dom = editor.dom;
+ var startNode = getEndPointNode(editor, rng, true, root);
+ var endNode = getEndPointNode(editor, rng, false, root);
+ var block;
+ var siblings = [];
+ for (var node = startNode; node; node = node.nextSibling) {
+ siblings.push(node);
+ 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">- }
- };
- var hasOnlyOneBlockChild = function (dom, elm) {
- var childNodes = elm.childNodes;
- return childNodes.length === 1 && !$_okk1ogljjgweckx.isListNode(childNodes[0]) && dom.isBlock(childNodes[0]);
- };
- var unwrapSingleBlockChild = function (dom, elm) {
- if (hasOnlyOneBlockChild(dom, elm)) {
- dom.remove(elm.firstChild, true);
- }
- };
- var moveChildren = function (dom, fromElm, toElm) {
- var node, targetElm;
- targetElm = hasOnlyOneBlockChild(dom, toElm) ? toElm.firstChild : toElm;
- unwrapSingleBlockChild(dom, fromElm);
- if (!$_okk1ogljjgweckx.isEmpty(dom, fromElm, true)) {
- while (node = fromElm.firstChild) {
- targetElm.appendChild(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global$5.each(siblings, function (node) {
+ if (NodeType.isTextBlock(editor, node)) {
+ textBlocks.push(node);
+ block = null;
+ return;
+ }
+ if (dom.isBlock(node) || NodeType.isBr(node)) {
+ if (NodeType.isBr(node)) {
+ dom.remove(node);
+ }
+ block = null;
+ return;
+ }
+ var nextSibling = node.nextSibling;
+ if (global$4.isBookmarkNode(node)) {
+ if (NodeType.isTextBlock(editor, nextSibling) || !nextSibling && node.parentNode === root) {
+ block = null;
+ return;
+ }
+ }
+ if (!block) {
+ block = dom.create('p');
+ node.parentNode.insertBefore(block, node);
+ textBlocks.push(block);
+ }
+ block.appendChild(node);
+ });
+ return textBlocks;
+ };
+ var hasCompatibleStyle = function (dom, sib, detail) {
+ var sibStyle = dom.getStyle(sib, 'list-style-type');
+ var detailStyle = detail ? detail['list-style-type'] : '';
+ detailStyle = detailStyle === null ? '' : detailStyle;
+ return sibStyle === detailStyle;
+ };
+ var applyList = function (editor, listName, detail) {
+ if (detail === void 0) {
+ 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 mergeLiElements = function (dom, fromElm, toElm) {
- var node, listNode;
- var ul = fromElm.parentNode;
- if (!$_okk1ogljjgweckx.isChildOfBody(dom, fromElm) || !$_okk1ogljjgweckx.isChildOfBody(dom, toElm)) {
- return;
- }
- if ($_okk1ogljjgweckx.isListNode(toElm.lastChild)) {
- listNode = toElm.lastChild;
- }
- if (ul === toElm.lastChild) {
- if ($_okk1ogljjgweckx.isBr(ul.previousSibling)) {
- dom.remove(ul.previousSibling);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var rng = editor.selection.getRng(true);
+ var bookmark;
+ var listItemName = 'LI';
+ var root = Selection.getClosestListRootElm(editor, editor.selection.getStart(true));
+ var dom = editor.dom;
+ 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">- }
- node = toElm.lastChild;
- if (node && $_okk1ogljjgweckx.isBr(node) && fromElm.hasChildNodes()) {
- dom.remove(node);
- }
- if ($_okk1ogljjgweckx.isEmpty(dom, toElm, true)) {
- dom.$(toElm).empty();
- }
- moveChildren(dom, fromElm, toElm);
- if (listNode) {
- toElm.appendChild(listNode);
- }
- dom.remove(fromElm);
- if ($_okk1ogljjgweckx.isEmpty(dom, ul) && ul !== dom.getRoot()) {
- dom.remove(ul);
- }
- };
- var mergeIntoEmptyLi = function (editor, fromLi, toLi) {
- editor.dom.$(toLi).empty();
- mergeLiElements(editor.dom, fromLi, toLi);
- editor.selection.setCursorLocation(toLi);
- };
- var mergeForward = function (editor, rng, fromLi, toLi) {
- var dom = editor.dom;
- if (dom.isEmpty(toLi)) {
- mergeIntoEmptyLi(editor, fromLi, toLi);
- } else {
- var bookmark = $_2nx1i4gjjjgweckt.createBookmark(rng);
- mergeLiElements(dom, fromLi, toLi);
- editor.selection.setRng($_2nx1i4gjjjgweckt.resolveBookmark(bookmark));
- }
- };
- var mergeBackward = function (editor, rng, fromLi, toLi) {
- var bookmark = $_2nx1i4gjjjgweckt.createBookmark(rng);
- mergeLiElements(editor.dom, fromLi, toLi);
- var resolvedBookmark = $_2nx1i4gjjjgweckt.resolveBookmark(bookmark);
- editor.selection.setRng(resolvedBookmark);
- };
- var backspaceDeleteFromListToListCaret = function (editor, isForward) {
- var dom = editor.dom, selection = editor.selection;
- var selectionStartElm = selection.getStart();
- var root = $_3xb1cggnjjgwecl3.getClosestListRootElm(editor, selectionStartElm);
- var li = dom.getParent(selection.getStart(), 'LI', root);
- var ul, rng, otherLi;
- if (li) {
- ul = li.parentNode;
- if (ul === editor.getBody() && $_okk1ogljjgweckx.isEmpty(dom, ul)) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ listName = listName.toUpperCase();
+ 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">- rng = $_a9cyhvgkjjgweckv.normalizeRange(selection.getRng(true));
- otherLi = dom.getParent(findNextCaretContainer(editor, rng, isForward, root), 'LI', root);
- if (otherLi && otherLi !== li) {
- if (isForward) {
- mergeForward(editor, rng, otherLi, li);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ bookmark = Bookmark.createBookmark(rng);
+ global$5.each(getSelectedTextBlocks(editor, rng, root), function (block) {
+ var listBlock, sibling;
+ sibling = block.previousSibling;
+ if (sibling && NodeType.isListNode(sibling) && sibling.nodeName === listName && hasCompatibleStyle(dom, sibling, detail)) {
+ listBlock = sibling;
+ block = dom.rename(block, listItemName);
+ sibling.appendChild(block);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- mergeBackward(editor, rng, li, otherLi);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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">- return true;
- } else if (!otherLi) {
- if (!isForward && $_aek3i3gejjgwecki.removeList(editor)) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ removeStyles(dom, block, [
+ 'margin',
+ 'margin-right',
+ 'margin-bottom',
+ 'margin-left',
+ 'margin-top',
+ 'padding',
+ 'padding-right',
+ 'padding-bottom',
+ 'padding-left',
+ 'padding-top'
+ ]);
+ updateListWithDetails(dom, listBlock, detail);
+ mergeWithAdjacentLists(editor.dom, listBlock);
+ });
+ editor.selection.setRng(Bookmark.resolveBookmark(bookmark));
+ };
+ var isValidLists = function (list1, list2) {
+ return list1 && list2 && NodeType.isListNode(list1) && list1.nodeName === list2.nodeName;
+ };
+ 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;
+ };
+ var hasSameClasses = function (elm1, elm2) {
+ return elm1.className === elm2.className;
+ };
+ var shouldMerge = function (dom, list1, list2) {
+ return isValidLists(list1, list2) && hasSameListStyle(dom, list1, list2) && hasSameClasses(list1, list2);
+ };
+ var mergeWithAdjacentLists = function (dom, listBlock) {
+ var sibling, node;
+ 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><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">- }
- return false;
- };
- var removeBlock = function (dom, block, root) {
- var parentBlock = dom.getParent(block.parentNode, dom.isBlock, root);
- dom.remove(block);
- if (parentBlock && dom.isEmpty(parentBlock)) {
- dom.remove(parentBlock);
- }
- };
- var backspaceDeleteIntoListCaret = function (editor, isForward) {
- var dom = editor.dom;
- var selectionStartElm = editor.selection.getStart();
- var root = $_3xb1cggnjjgwecl3.getClosestListRootElm(editor, selectionStartElm);
- var block = dom.getParent(selectionStartElm, dom.isBlock, root);
- if (block && dom.isEmpty(block)) {
- var rng = $_a9cyhvgkjjgweckv.normalizeRange(editor.selection.getRng(true));
- var otherLi_1 = dom.getParent(findNextCaretContainer(editor, rng, isForward, root), 'LI', root);
- if (otherLi_1) {
- editor.undoManager.transact(function () {
- removeBlock(dom, block, root);
- $_aek3i3gejjgwecki.mergeWithAdjacentLists(dom, otherLi_1.parentNode);
- editor.selection.select(otherLi_1, true);
- editor.selection.collapse(isForward);
</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);
+ }
+ dom.remove(sibling);
+ }
+ };
+ var updateList = function (dom, list, listName, detail) {
+ if (list.nodeName !== listName) {
+ var newList = dom.rename(list, listName);
+ updateListWithDetails(dom, newList, detail);
+ } else {
+ updateListWithDetails(dom, list, detail);
+ }
+ };
+ var toggleMultipleLists = function (editor, parentList, lists, listName, detail) {
+ if (parentList.nodeName === listName && !hasListStyleDetail(detail)) {
+ flattenListSelection(editor);
+ } else {
+ var bookmark = Bookmark.createBookmark(editor.selection.getRng(true));
+ global$5.each([parentList].concat(lists), function (elm) {
+ updateList(editor.dom, elm, 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 true;
</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">- }
- return false;
- };
- var backspaceDeleteCaret = function (editor, isForward) {
- return backspaceDeleteFromListToListCaret(editor, isForward) || backspaceDeleteIntoListCaret(editor, isForward);
- };
- var backspaceDeleteRange = function (editor) {
- var selectionStartElm = editor.selection.getStart();
- var root = $_3xb1cggnjjgwecl3.getClosestListRootElm(editor, selectionStartElm);
- var startListParent = editor.dom.getParent(selectionStartElm, 'LI,DT,DD', root);
- if (startListParent || $_3xb1cggnjjgwecl3.getSelectedListItems(editor).length > 0) {
- editor.undoManager.transact(function () {
- editor.execCommand('Delete');
- $_ekd4wzgmjjgwecl1.normalizeLists(editor.dom, editor.getBody());
- });
- return true;
- }
- return false;
- };
- var backspaceDelete = function (editor, isForward) {
- return editor.selection.isCollapsed() ? backspaceDeleteCaret(editor, isForward) : backspaceDeleteRange(editor);
- };
- var setup = function (editor) {
- editor.on('keydown', function (e) {
- if (e.keyCode === global$3.BACKSPACE) {
- if (backspaceDelete(editor, false)) {
- e.preventDefault();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var hasListStyleDetail = function (detail) {
+ return 'list-style-type' in detail;
+ };
+ var toggleSingleList = function (editor, parentList, listName, detail) {
+ if (parentList === editor.getBody()) {
+ return;
+ }
+ if (parentList) {
+ if (parentList.nodeName === listName && !hasListStyleDetail(detail)) {
+ flattenListSelection(editor);
+ } 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));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else if (e.keyCode === global$3.DELETE) {
- if (backspaceDelete(editor, true)) {
- e.preventDefault();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } 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">- });
- };
- var $_brhyezgajjgweck7 = {
- setup: setup,
- backspaceDelete: backspaceDelete
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var toggleList = function (editor, listName, detail) {
+ var parentList = Selection.getParentList(editor);
+ var selectedSubLists = Selection.getSelectedSubLists(editor);
+ detail = detail ? detail : {};
+ if (parentList && selectedSubLists.length > 0) {
+ toggleMultipleLists(editor, parentList, selectedSubLists, listName, detail);
+ } else {
+ toggleSingleList(editor, parentList, listName, detail);
+ }
+ };
+ var ToggleList = {
+ toggleList: toggleList,
+ mergeWithAdjacentLists: mergeWithAdjacentLists
+ };
</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 get = function (editor) {
- return {
- backspaceDelete: function (isForward) {
- $_brhyezgajjgweck7.backspaceDelete(editor, isForward);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var DOM$3 = global$6.DOM;
+ var normalizeList = function (dom, ul) {
+ var sibling;
+ var parentNode = ul.parentNode;
+ if (parentNode.nodeName === 'LI' && parentNode.firstChild === ul) {
+ sibling = parentNode.previousSibling;
+ if (sibling && sibling.nodeName === 'LI') {
+ sibling.appendChild(ul);
+ if (NodeType.isEmpty(dom, parentNode)) {
+ DOM$3.remove(parentNode);
+ }
+ } else {
+ DOM$3.setStyle(parentNode, 'listStyleType', 'none');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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">- };
- var $_nb3yvg9jjgweck5 = { get: get };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var normalizeLists = function (dom, element) {
+ global$5.each(global$5.grep(dom.select('ol,ul', element)), function (ul) {
+ normalizeList(dom, ul);
+ });
+ };
+ var NormalizeLists = {
+ 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">- var DOM$5 = global$6.DOM;
- var mergeLists = function (from, to) {
- var node;
- if ($_okk1ogljjgweckx.isListNode(from)) {
- while (node = from.firstChild) {
- to.appendChild(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var findNextCaretContainer = function (editor, rng, isForward, root) {
+ var node = rng.startContainer;
+ var offset = rng.startOffset;
+ var nonEmptyBlocks, walker;
+ if (node.nodeType === 3 && (isForward ? offset < node.data.length : offset > 0)) {
+ return 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$5.remove(from);
- }
- };
- var indent = function (li) {
- var sibling, newList, listStyle;
- if (li.nodeName === 'DT') {
- DOM$5.rename(li, 'DD');
- return true;
- }
- sibling = li.previousSibling;
- if (sibling && $_okk1ogljjgweckx.isListNode(sibling)) {
- sibling.appendChild(li);
- return true;
- }
- if (sibling && sibling.nodeName === 'LI' && $_okk1ogljjgweckx.isListNode(sibling.lastChild)) {
- sibling.lastChild.appendChild(li);
- mergeLists(li.lastChild, sibling.lastChild);
- return true;
- }
- sibling = li.nextSibling;
- if (sibling && $_okk1ogljjgweckx.isListNode(sibling)) {
- sibling.insertBefore(li, sibling.firstChild);
- return true;
- }
- sibling = li.previousSibling;
- if (sibling && sibling.nodeName === 'LI') {
- newList = DOM$5.create(li.parentNode.nodeName);
- listStyle = DOM$5.getStyle(li.parentNode, 'listStyleType');
- if (listStyle) {
- DOM$5.setStyle(newList, 'listStyleType', listStyle);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ nonEmptyBlocks = editor.schema.getNonEmptyElements();
+ if (node.nodeType === 1) {
+ node = global$1.getNode(node, 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">- sibling.appendChild(newList);
- newList.appendChild(li);
- mergeLists(li.lastChild, newList);
- return true;
- }
- return false;
- };
- var indentSelection = function (editor) {
- var listElements = $_3xb1cggnjjgwecl3.getSelectedListItems(editor);
- if (listElements.length) {
- var bookmark = $_2nx1i4gjjjgweckt.createBookmark(editor.selection.getRng(true));
- for (var i = 0; i < listElements.length; i++) {
- if (!indent(listElements[i]) && i === 0) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ walker = new global$2(node, root);
+ if (isForward) {
+ if (NodeType.isBogusBr(editor.dom, node)) {
+ walker.next();
</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">- editor.selection.setRng($_2nx1i4gjjjgweckt.resolveBookmark(bookmark));
- editor.nodeChanged();
- return true;
- }
- };
- var $_3rkwagtjjgweclf = { indentSelection: indentSelection };
-
- var queryListCommandState = function (editor, listName) {
- return function () {
- var parentList = editor.dom.getParent(editor.selection.getStart(), 'UL,OL,DL');
- return parentList && parentList.nodeName === listName;
- };
- };
- var register = function (editor) {
- editor.on('BeforeExecCommand', function (e) {
- var cmd = e.command.toLowerCase();
- var isHandled;
- if (cmd === 'indent') {
- if ($_3rkwagtjjgweclf.indentSelection(editor)) {
- isHandled = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ while (node = walker[isForward ? 'next' : 'prev2']()) {
+ if (node.nodeName === 'LI' && !node.hasChildNodes()) {
+ return 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">- } else if (cmd === 'outdent') {
- if ($_6pbactghjjgweckp.outdentSelection(editor)) {
- isHandled = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (nonEmptyBlocks[node.nodeName]) {
+ return node;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (node.nodeType === 3 && node.data.length > 0) {
+ return 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 (isHandled) {
- editor.fire('ExecCommand', { command: e.command });
- e.preventDefault();
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var hasOnlyOneBlockChild = function (dom, elm) {
+ var childNodes = elm.childNodes;
+ return childNodes.length === 1 && !NodeType.isListNode(childNodes[0]) && dom.isBlock(childNodes[0]);
+ };
+ var unwrapSingleBlockChild = function (dom, elm) {
+ if (hasOnlyOneBlockChild(dom, elm)) {
+ dom.remove(elm.firstChild, 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">- });
- editor.addCommand('InsertUnorderedList', function (ui, detail) {
- $_aek3i3gejjgwecki.toggleList(editor, 'UL', detail);
- });
- editor.addCommand('InsertOrderedList', function (ui, detail) {
- $_aek3i3gejjgwecki.toggleList(editor, 'OL', detail);
- });
- editor.addCommand('InsertDefinitionList', function (ui, detail) {
- $_aek3i3gejjgwecki.toggleList(editor, 'DL', detail);
- });
- editor.addQueryStateHandler('InsertUnorderedList', queryListCommandState(editor, 'UL'));
- editor.addQueryStateHandler('InsertOrderedList', queryListCommandState(editor, 'OL'));
- editor.addQueryStateHandler('InsertDefinitionList', queryListCommandState(editor, 'DL'));
- };
- var $_blnfs1gsjjgwecld = { register: register };
-
- var shouldIndentOnTab = function (editor) {
- return editor.getParam('lists_indent_on_tab', true);
- };
- var $_8obsbgvjjgweclk = { shouldIndentOnTab: shouldIndentOnTab };
-
- var setupTabKey = function (editor) {
- editor.on('keydown', function (e) {
- if (e.keyCode !== global$3.TAB || global$3.metaKeyPressed(e)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var moveChildren = function (dom, fromElm, toElm) {
+ var node, targetElm;
+ targetElm = hasOnlyOneBlockChild(dom, toElm) ? toElm.firstChild : toElm;
+ unwrapSingleBlockChild(dom, fromElm);
+ if (!NodeType.isEmpty(dom, fromElm, true)) {
+ while (node = fromElm.firstChild) {
+ targetElm.appendChild(node);
+ }
+ }
+ };
+ var mergeLiElements = function (dom, fromElm, toElm) {
+ var node, listNode;
+ var ul = fromElm.parentNode;
+ if (!NodeType.isChildOfBody(dom, fromElm) || !NodeType.isChildOfBody(dom, toElm)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><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.getParent(editor.selection.getStart(), 'LI,DT,DD')) {
- e.preventDefault();
- if (e.shiftKey) {
- $_6pbactghjjgweckp.outdentSelection(editor);
- } else {
- $_3rkwagtjjgweclf.indentSelection(editor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (NodeType.isListNode(toElm.lastChild)) {
+ listNode = toElm.lastChild;
+ }
+ if (ul === toElm.lastChild) {
+ if (NodeType.isBr(ul.previousSibling)) {
+ dom.remove(ul.previousSibling);
</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">- });
- };
- var setup$1 = function (editor) {
- if ($_8obsbgvjjgweclk.shouldIndentOnTab(editor)) {
- setupTabKey(editor);
- }
- $_brhyezgajjgweck7.setup(editor);
- };
- var $_ees9z9gujjgwecli = { setup: setup$1 };
-
- var findIndex = function (list, predicate) {
- for (var index = 0; index < list.length; index++) {
- var element = list[index];
- if (predicate(element)) {
- return index;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ node = toElm.lastChild;
+ if (node && NodeType.isBr(node) && fromElm.hasChildNodes()) {
+ 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">- }
- return -1;
- };
- var listState = function (editor, listName) {
- return function (e) {
- var ctrl = e.control;
- editor.on('NodeChange', function (e) {
- var tableCellIndex = findIndex(e.parents, $_okk1ogljjgweckx.isTableCellNode);
- var parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents;
- var lists = global$5.grep(parents, $_okk1ogljjgweckx.isListNode);
- ctrl.active(lists.length > 0 && lists[0].nodeName === listName);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (NodeType.isEmpty(dom, toElm, true)) {
+ dom.$(toElm).empty();
+ }
+ moveChildren(dom, fromElm, toElm);
+ if (listNode) {
+ toElm.appendChild(listNode);
+ }
+ dom.remove(fromElm);
+ if (NodeType.isEmpty(dom, ul) && ul !== dom.getRoot()) {
+ dom.remove(ul);
+ }
+ };
+ var mergeIntoEmptyLi = function (editor, fromLi, toLi) {
+ editor.dom.$(toLi).empty();
+ mergeLiElements(editor.dom, fromLi, toLi);
+ editor.selection.setCursorLocation(toLi);
+ };
+ var mergeForward = function (editor, rng, fromLi, toLi) {
+ var dom = editor.dom;
+ if (dom.isEmpty(toLi)) {
+ mergeIntoEmptyLi(editor, fromLi, toLi);
+ } else {
+ var bookmark = Bookmark.createBookmark(rng);
+ mergeLiElements(dom, fromLi, toLi);
+ editor.selection.setRng(Bookmark.resolveBookmark(bookmark));
+ }
+ };
+ var mergeBackward = function (editor, rng, fromLi, toLi) {
+ var bookmark = Bookmark.createBookmark(rng);
+ mergeLiElements(editor.dom, fromLi, toLi);
+ var resolvedBookmark = Bookmark.resolveBookmark(bookmark);
+ editor.selection.setRng(resolvedBookmark);
+ };
+ var backspaceDeleteFromListToListCaret = function (editor, isForward) {
+ var dom = editor.dom, selection = editor.selection;
+ var selectionStartElm = selection.getStart();
+ var root = Selection.getClosestListRootElm(editor, selectionStartElm);
+ var li = dom.getParent(selection.getStart(), 'LI', root);
+ var ul, rng, otherLi;
+ if (li) {
+ ul = li.parentNode;
+ if (ul === editor.getBody() && NodeType.isEmpty(dom, ul)) {
+ return true;
+ }
+ rng = Range.normalizeRange(selection.getRng(true));
+ otherLi = dom.getParent(findNextCaretContainer(editor, rng, isForward, root), 'LI', root);
+ if (otherLi && otherLi !== li) {
+ if (isForward) {
+ mergeForward(editor, rng, otherLi, li);
+ } else {
+ mergeBackward(editor, rng, li, otherLi);
+ }
+ return true;
+ } else if (!otherLi) {
+ if (!isForward) {
+ flattenListSelection(editor);
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+ var removeBlock = function (dom, block, root) {
+ var parentBlock = dom.getParent(block.parentNode, dom.isBlock, root);
+ dom.remove(block);
+ if (parentBlock && dom.isEmpty(parentBlock)) {
+ dom.remove(parentBlock);
+ }
+ };
+ var backspaceDeleteIntoListCaret = function (editor, isForward) {
+ var dom = editor.dom;
+ var selectionStartElm = editor.selection.getStart();
+ var root = Selection.getClosestListRootElm(editor, selectionStartElm);
+ var block = dom.getParent(selectionStartElm, dom.isBlock, root);
+ if (block && dom.isEmpty(block)) {
+ var rng = Range.normalizeRange(editor.selection.getRng(true));
+ var otherLi_1 = dom.getParent(findNextCaretContainer(editor, rng, isForward, root), 'LI', root);
+ if (otherLi_1) {
+ editor.undoManager.transact(function () {
+ removeBlock(dom, block, root);
+ ToggleList.mergeWithAdjacentLists(dom, otherLi_1.parentNode);
+ editor.selection.select(otherLi_1, true);
+ editor.selection.collapse(isForward);
+ });
+ return true;
+ }
+ }
+ return false;
+ };
+ var backspaceDeleteCaret = function (editor, isForward) {
+ return backspaceDeleteFromListToListCaret(editor, isForward) || backspaceDeleteIntoListCaret(editor, isForward);
+ };
+ var backspaceDeleteRange = function (editor) {
+ var selectionStartElm = editor.selection.getStart();
+ var root = Selection.getClosestListRootElm(editor, selectionStartElm);
+ var startListParent = editor.dom.getParent(selectionStartElm, 'LI,DT,DD', root);
+ if (startListParent || Selection.getSelectedListItems(editor).length > 0) {
+ editor.undoManager.transact(function () {
+ editor.execCommand('Delete');
+ NormalizeLists.normalizeLists(editor.dom, editor.getBody());
+ });
+ return true;
+ }
+ return false;
+ };
+ var backspaceDelete = function (editor, isForward) {
+ return editor.selection.isCollapsed() ? backspaceDeleteCaret(editor, isForward) : backspaceDeleteRange(editor);
+ };
+ var setup = function (editor) {
+ editor.on('keydown', function (e) {
+ if (e.keyCode === global$3.BACKSPACE) {
+ if (backspaceDelete(editor, false)) {
+ e.preventDefault();
+ }
+ } else if (e.keyCode === global$3.DELETE) {
+ if (backspaceDelete(editor, true)) {
+ e.preventDefault();
+ }
+ }
</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">- };
- var indentPostRender = function (editor) {
- return function (e) {
- var ctrl = e.control;
- editor.on('nodechange', function () {
- var listItemBlocks = $_3xb1cggnjjgwecl3.getSelectedListItems(editor);
- var disable = listItemBlocks.length > 0 && $_okk1ogljjgweckx.isFirstChild(listItemBlocks[0]);
- ctrl.disabled(disable);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Delete = {
+ setup: setup,
+ backspaceDelete: backspaceDelete
+ };
+
+ var get$3 = function (editor) {
+ return {
+ backspaceDelete: function (isForward) {
+ Delete.backspaceDelete(editor, isForward);
+ }
+ };
+ };
+ var Api = { get: get$3 };
+
+ var queryListCommandState = function (editor, listName) {
+ return function () {
+ var parentList = editor.dom.getParent(editor.selection.getStart(), 'UL,OL,DL');
+ return parentList && parentList.nodeName === listName;
+ };
+ };
+ var register = function (editor) {
+ editor.on('BeforeExecCommand', function (e) {
+ var cmd = e.command.toLowerCase();
+ if (cmd === 'indent') {
+ indentListSelection(editor);
+ } else if (cmd === 'outdent') {
+ outdentListSelection(editor);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.addCommand('InsertUnorderedList', function (ui, detail) {
+ ToggleList.toggleList(editor, 'UL', detail);
+ });
+ editor.addCommand('InsertOrderedList', function (ui, detail) {
+ ToggleList.toggleList(editor, 'OL', detail);
+ });
+ editor.addCommand('InsertDefinitionList', function (ui, detail) {
+ ToggleList.toggleList(editor, 'DL', detail);
+ });
+ editor.addCommand('RemoveList', function () {
+ flattenListSelection(editor);
+ });
+ editor.addQueryStateHandler('InsertUnorderedList', queryListCommandState(editor, 'UL'));
+ editor.addQueryStateHandler('InsertOrderedList', queryListCommandState(editor, 'OL'));
+ editor.addQueryStateHandler('InsertDefinitionList', queryListCommandState(editor, '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">- };
- var register$1 = function (editor) {
- var hasPlugin = function (editor, plugin) {
- var plugins = editor.settings.plugins ? editor.settings.plugins : '';
- return global$5.inArray(plugins.split(/[ ,]/), plugin) !== -1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Commands = { register: register };
+
+ var shouldIndentOnTab = function (editor) {
+ return editor.getParam('lists_indent_on_tab', 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 (!hasPlugin(editor, 'advlist')) {
- editor.addButton('numlist', {
- active: false,
- title: 'Numbered list',
- cmd: 'InsertOrderedList',
- onPostRender: listState(editor, 'OL')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Settings = { shouldIndentOnTab: shouldIndentOnTab };
+
+ var setupTabKey = function (editor) {
+ editor.on('keydown', function (e) {
+ if (e.keyCode !== global$3.TAB || global$3.metaKeyPressed(e)) {
+ return;
+ }
+ if (Selection.isList(editor)) {
+ e.preventDefault();
+ editor.undoManager.transact(function () {
+ if (e.shiftKey) {
+ outdentListSelection(editor);
+ } else {
+ indentListSelection(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">- editor.addButton('bullist', {
- active: false,
- title: 'Bullet list',
- cmd: 'InsertUnorderedList',
- onPostRender: listState(editor, 'UL')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var setup$1 = function (editor) {
+ if (Settings.shouldIndentOnTab(editor)) {
+ setupTabKey(editor);
+ }
+ Delete.setup(editor);
+ };
+ var Keyboard = { setup: setup$1 };
+
+ var findIndex$2 = function (list, predicate) {
+ for (var index = 0; index < list.length; index++) {
+ var element = list[index];
+ if (predicate(element)) {
+ return index;
+ }
+ }
+ return -1;
+ };
+ var listState = function (editor, listName) {
+ return function (e) {
+ var ctrl = e.control;
+ editor.on('NodeChange', function (e) {
+ var tableCellIndex = findIndex$2(e.parents, NodeType.isTableCellNode);
+ var parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents;
+ var lists = global$5.grep(parents, NodeType.isListNode);
+ ctrl.active(lists.length > 0 && lists[0].nodeName === listName);
+ });
+ };
+ };
+ var register$1 = function (editor) {
+ var hasPlugin = function (editor, plugin) {
+ var plugins = editor.settings.plugins ? editor.settings.plugins : '';
+ return global$5.inArray(plugins.split(/[ ,]/), plugin) !== -1;
+ };
+ if (!hasPlugin(editor, 'advlist')) {
+ editor.addButton('numlist', {
+ active: false,
+ title: 'Numbered list',
+ cmd: 'InsertOrderedList',
+ onPostRender: listState(editor, 'OL')
+ });
+ editor.addButton('bullist', {
+ active: false,
+ title: 'Bullet list',
+ cmd: 'InsertUnorderedList',
+ onPostRender: listState(editor, 'UL')
+ });
+ }
+ editor.addButton('indent', {
+ icon: 'indent',
+ title: 'Increase indent',
+ cmd: 'Indent'
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var Buttons = { register: register$1 };
+
+ global.add('lists', function (editor) {
+ Keyboard.setup(editor);
+ Buttons.register(editor);
+ Commands.register(editor);
+ return Api.get(editor);
+ });
+ function Plugin () {
</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('indent', {
- icon: 'indent',
- title: 'Increase indent',
- cmd: 'Indent',
- onPostRender: indentPostRender(editor)
- });
- };
- var $_s7o0sgwjjgweclm = { register: register$1 };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global.add('lists', function (editor) {
- $_ees9z9gujjgwecli.setup(editor);
- $_s7o0sgwjjgweclm.register(editor);
- $_blnfs1gsjjgwecld.register(editor);
- return $_nb3yvg9jjgweck5.get(editor);
- });
- function Plugin () {
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Plugin;
</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 Plugin;
-
</del><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="trunksrcjs_enqueuesvendortinymcepluginslistspluginminjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/plugins/lists/plugin.min.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/plugins/lists/plugin.min.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/plugins/lists/plugin.min.js 2019-01-29 20:18:33 UTC (rev 44713)
</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(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),l=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),n=tinymce.util.Tools.resolve("tinymce.util.VK"),p=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),o=function(e){return e&&"BR"===e.nodeName},r=function(e){return e&&3===e.nodeType},h=function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)},i=function(e){return e&&/^(LI|DT|DD)$/.test(e.nodeName)},a=function(e){return e&&/^(TH|TD)$/.test(e.nodeName)},C=o,s=function(e){return e.parentNode.firstChild===e},c=function(e){return e.parentNode.lastChild===e},y=function(
e,t){return t&&!!e.schema.getTextBlockElements()[t.nodeName]},f=function(e,t){return e&&e.nodeName in t},u=function(e,t){return!!o(t)&&!(!e.isBlock(t.nextSibling)||o(t.previousSibling))},m=function(e,t,n){var o=e.isEmpty(t);return!(n&&0<e.select("span[data-mce-type=bookmark]",t).length)&&o},g=function(e,t){return e.isChildOf(t,e.getRoot())},N=function(e,t){var n=d.getNode(e,t);return i(e)&&r(n)?{container:n,offset:t>=e.childNodes.length?n.data.length:0}:{container:e,offset:t}},L=function(e){var t=e.cloneRange(),n=N(e.startContainer,e.startOffset);t.setStart(n.container,n.offset);var o=N(e.endContainer,e.endOffset);return t.setEnd(o.container,o.offset),t},S=t.DOM,b=function(r){var i={},e=function(e){var t,n,o;n=r[e?"startContainer":"endContainer"],o=r[e?"startOffset":"endOffset"],1===n.nodeType&&(t=S.create("span",{"data-mce-type":"bookmark"}),
n.hasChildNodes()?(o=Math.min(o,n.childNodes.length-1),e?n.insertBefore(t,n.childNodes[o]):S.insertAfter(t,n.childNodes[o])):n.appendChild(t),n=t,o=0),i[e?"startContainer":"endContainer"]=n,i[e?"startOffset":"endOffset"]=o};return e(!0),r.collapsed||e(),i},D=function(r){function e(e){var t,n,o;t=o=r[e?"startContainer":"endContainer"],n=r[e?"startOffset":"endOffset"],t&&(1===t.nodeType&&(n=function(e){for(var t=e.parentNode.firstChild,n=0;t;){if(t===e)return n;1===t.nodeType&&"bookmark"===t.getAttribute("data-mce-type")||n++,t=t.nextSibling}return-1}(t),t=t.parentNode,S.remove(o),!t.hasChildNodes()&&S.isBlock(t)&&t.appendChild(S.create("br"))),r[e?"startContainer":"endContainer"]=t,r[e?"startOffset":"endOffset"]=n)}e(!0),e();var t=S.createRng();return t.setStart(r.startContainer,r.startOffset),r.e
ndContainer&&t.setEnd(r.endContainer,r.endOffset),L(t)},k=t.DOM,T=function(e,t){var n,o=t.parentNode;"LI"===o.nodeName&&o.firstChild===t&&((n=o.previousSibling)&&"LI"===n.nodeName?(n.appendChild(t),m(e,o)&&k.remove(o)):k.setStyle(o,"listStyleType","none")),h(o)&&(n=o.previousSibling)&&"LI"===n.nodeName&&n.appendChild(t)},I=function(t,e){v.each(v.grep(t.select("ol,ul",e)),function(e){T(t,e)})},B=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),R=function(e){var t=e.selection.getStart(!0);return e.dom.getParent(t,"OL,UL,DL",O(e,t))},O=function(e,t){var n=e.dom.getParents(t,"TD,TH");return 0<n.length?n[0]:e.getBody()},E={getParentList:R,getSelectedSubLists:function(e){var t,n,o,r=R(e),i=e.selection.getSelectedBlocks();return o=i,(n=r)&&1===o.length&&o[0]===n?(t=r,v.grep(t.querySelectorAll("ol,ul,dl"),fun
ction(e){return h(e)})):v.grep(i,function(e){return h(e)&&r!==e})},getSelectedListItems:function(e){var n,t,o,r=e.selection.getSelectedBlocks();return v.grep((n=e,t=r,o=v.map(t,function(e){var t=n.dom.getParent(e,"li,dd,dt",O(n,e));return t||e}),B.unique(o)),function(e){return i(e)})},getClosestListRootElm:O},A=tinymce.util.Tools.resolve("tinymce.Env"),P=t.DOM,x=function(e,t,n){var o,r,i,a=P.createFragment(),s=e.schema.getBlockElements();if(e.settings.forced_root_block&&(n=n||e.settings.forced_root_block),n&&((r=P.create(n)).tagName===e.settings.forced_root_block&&P.setAttribs(r,e.settings.forced_root_block_attrs),f(t.firstChild,s)||a.appendChild(r)),t)for(;o=t.firstChild;){var d=o.nodeName;i||"SPAN"===d&&"bookmark"===o.getAttribute("data-mce-type")||(i=!0),f(o,s)?(a.appendChild(o),r=null):n?(r||(r=P.create(n),a.appendChild(r)),r.appendChild(o)):a.appendChild(o)}return e.settings.forced_root_bl
ock?i||A.ie&&!(10<A.ie)||r.appendChild(P.create("br",{"data-mce-bogus":"1"})):a.appendChild(P.create("br")),a},_=t.DOM,M=function(e,t,n,o){var r,i,a,s,d;for(a=_.select('span[data-mce-type="bookmark"]',t),o=o||x(e,n),(r=_.createRng()).setStartAfter(n),r.setEndAfter(t),s=(i=r.extractContents()).firstChild;s;s=s.firstChild)if("LI"===s.nodeName&&e.dom.isEmpty(s)){_.remove(s);break}e.dom.isEmpty(i)||_.insertAfter(i,t),_.insertAfter(o,t),m(e.dom,n.parentNode)&&(d=n.parentNode,v.each(a,function(e){d.parentNode.insertBefore(e,n.parentNode)}),_.remove(d)),_.remove(n),m(e.dom,t)&&_.remove(t)},U=t.DOM,H=function(e,t){m(e,t)&&U.remove(t)},$=function(e,t){var n,o,r=t.parentNode;return r?(n=r.parentNode,r===e.getBody()||("DD"===t.nodeName?U.rename(t,"DT"):s(t)&&c(t)?"LI"===n.nodeName?(U.insertAfter(t,n),H(e.dom,n),U.remove(r)):h(n)?U.remove(r,!0):(n.insertBe
fore(x(e,t),r),U.remove(r)):s(t)?"LI"===n.nodeName?(U.insertAfter(t,n),t.appendChild(r),H(e.dom,n)):h(n)?n.insertBefore(t,r):(n.insertBefore(x(e,t),r),U.remove(t)):c(t)?"LI"===n.nodeName?U.insertAfter(t,n):h(n)?U.insertAfter(t,r):(U.insertAfter(x(e,t),r),U.remove(t)):("LI"===n.nodeName?(r=n,o=x(e,t,"LI")):o=h(n)?x(e,t,"LI"):x(e,t),M(e,r,t,o),I(e.dom,r.parentNode)))):H(e.dom,t),!0},w=$,K=function(e){var t=E.getSelectedListItems(e);if(t.length){var n=b(e.selection.getRng()),o=void 0,r=void 0,i=E.getClosestListRootElm(e,e.selection.getStart(!0));for(o=t.length;o--;)for(var a=t[o].parentNode;a&&a!==i;){for(r=t.length;r--;)if(t[r]===a){t.splice(o,1);break}a=a.parentNode}for(o=0;o<t.length&&($(e,t[o])||0!==o);o++);return e.selection.setRng(D(n)),e.nodeChanged(),!0}},Q=function(n,e){v.each(e,function(e,t){n.setAttribute(t,e)})},W=function(e,t,n){var o,r,i,a,s,d,l;o=e,r=t,a=(i=n)["list-style-type"]?i["list-s
tyle-type"]:null,o.setStyle(r,"list-style-type",a),s=e,Q(d=t,(l=n)["list-attributes"]),v.each(s.select("li",d),function(e){Q(e,l["list-item-attributes"])})},j=function(e,t,n,o){var r,i;for(r=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"],1===r.nodeType&&(r=r.childNodes[Math.min(i,r.childNodes.length-1)]||r),!n&&C(r.nextSibling)&&(r=r.nextSibling);r.parentNode!==o;){if(y(e,r))return r;if(/^(TD|TH)$/.test(r.parentNode.nodeName))return r;r=r.parentNode}return r},q=function(c,f,u){void 0===u&&(u={});var e,t=c.selection.getRng(!0),m="LI",n=E.getClosestListRootElm(c,c.selection.getStart(!0)),g=c.dom;"false"!==g.getContentEditable(c.selection.getNode())&&("DL"===(f=f.toUpperCase())&&(m="DT"),e=b(t),v.each(function(n,e,o){for(var r,i=[],a=n.dom,t=j(n,e,!0,o),s=j(n,e,!1,o),d=[],l=t;l&&(d.pus
h(l),l!==s);l=l.nextSibling);return v.each(d,function(e){if(y(n,e))return i.push(e),void(r=null);if(a.isBlock(e)||C(e))return C(e)&&a.remove(e),void(r=null);var t=e.nextSibling;p.isBookmarkNode(e)&&(y(n,t)||!t&&e.parentNode===o)?r=null:(r||(r=a.create("p"),e.parentNode.insertBefore(r,e),i.push(r)),r.appendChild(e))}),i}(c,t,n),function(e){var t,n,o,r,i,a,s,d,l;(n=e.previousSibling)&&h(n)&&n.nodeName===f&&(o=n,r=u,i=g.getStyle(o,"list-style-type"),a=r?r["list-style-type"]:"",i===(a=null===a?"":a))?(t=n,e=g.rename(e,m),n.appendChild(e)):(t=g.create(f),e.parentNode.insertBefore(t,e),t.appendChild(e),e=g.rename(e,m)),s=g,d=e,l=["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],v.each(l,function(e){var t;
return s.setStyle(d,((t={})[e]="",t))}),W(g,t,u),z(c.dom,t)}),c.selection.setRng(D(e)))},F=function(o){var e=b(o.selection.getRng(!0)),r=E.getClosestListRootElm(o,o.selection.getStart(!0)),t=E.getSelectedListItems(o),n=v.grep(t,function(e){return o.dom.isEmpty(e)});t=v.grep(t,function(e){return!o.dom.isEmpty(e)}),v.each(n,function(e){m(o.dom,e)&&w(o,e)}),v.each(t,function(e){var t,n;if(e.parentNode!==o.getBody()){for(t=e;t&&t!==r;t=t.parentNode)h(t)&&(n=t);M(o,n,e),I(o.dom,n.parentNode)}}),o.selection.setRng(D(e))},V=function(e,t,n){return d=n,(s=t)&&d&&h(s)&&s.nodeName===d.nodeName&&(i=t,a=n,(r=e).getStyle(i,"list-style-type",!0)===r.getStyle(a,"list-style-type",!0))&&(o=n,t.className===o.className);var o,r,i,a,s,d},z=function(e,t){var n,o;if(n=t.nextSibling,V(e,t,n)){for(;o=n.firstChild;)t.appendChild(o);e.remove(n)}if(n=t.previousSibling,V(e,t,n)){for(;o=n.lastChild;)t.insertBefore(o,t.f
irstChild);e.remove(n)}},G=function(t,e,n,o,r){if(e.nodeName!==o||J(r)){var i=b(t.selection.getRng(!0));v.each([e].concat(n),function(e){!function(e,t,n,o){if(t.nodeName!==n){var r=e.rename(t,n);W(e,r,o)}else W(e,t,o)}(t.dom,e,o,r)}),t.selection.setRng(D(i))}else F(t)},J=function(e){return"list-style-type"in e},X={toggleList:function(e,t,n){var o=E.getParentList(e),r=E.getSelectedSubLists(e);n=n||{},o&&0<r.length?G(e,o,r,t,n):function(e,t,n,o){if(t!==e.getBody())if(t)if(t.nodeName!==n||J(o)){var r=b(e.selection.getRng(!0));W(e.dom,t,o),z(e.dom,e.dom.rename(t,n)),e.selection.setRng(D(r))}else F(e);else q(e,n,o)}(e,o,t,n)},removeList:F,mergeWithAdjacentLists:z},Y=function(e,t,n,o){var r,i,a=t.startContainer,s=t.startOffset;if(3===a.nodeType&&(n?s<a.data.length:0<s))return a;for(r=e.schema.getNonEmptyElements(),1===a.nodeType&&(a=d.getNode(a,s)),i=new l(a,o),n&&u(e.dom,a)&&i.next();a=i[n?"next":"prev2"]();){
if("LI"===a.nodeName&&!a.hasChildNodes())return a;if(r[a.nodeName])return a;if(3===a.nodeType&&0<a.data.length)return a}},Z=function(e,t){var n=t.childNodes;return 1===n.length&&!h(n[0])&&e.isBlock(n[0])},ee=function(e,t,n){var o,r,i,a;if(r=Z(e,n)?n.firstChild:n,Z(i=e,a=t)&&i.remove(a.firstChild,!0),!m(e,t,!0))for(;o=t.firstChild;)r.appendChild(o)},te=function(e,t,n){var o,r,i=t.parentNode;g(e,t)&&g(e,n)&&(h(n.lastChild)&&(r=n.lastChild),i===n.lastChild&&C(i.previousSibling)&&e.remove(i.previousSibling),(o=n.lastChild)&&C(o)&&t.hasChildNodes()&&e.remove(o),m(e,n,!0)&&e.$(n).empty(),ee(e,t,n),r&&n.appendChild(r),e.remove(t),m(e,i)&&i!==e.getRoot()&&e.remove(i))},ne=function(e,t,n,o){var r,i,a,s=e.dom;if(s.isEmpty(o))i=n,a=o,(r=e).dom.$(a).empty(),te(r.dom,i,a),r.selection.setCursorLocation(a);else{var d=b(t);te(s,n,o),e.selection.setRng(
D(d))}},oe=function(e,t){var n,o,r,i=e.dom,a=e.selection,s=a.getStart(),d=E.getClosestListRootElm(e,s),l=i.getParent(a.getStart(),"LI",d);if(l){if((n=l.parentNode)===e.getBody()&&m(i,n))return!0;if(o=L(a.getRng(!0)),(r=i.getParent(Y(e,o,t,d),"LI",d))&&r!==l)return t?ne(e,o,r,l):function(e,t,n,o){var r=b(t);te(e.dom,n,o);var i=D(r);e.selection.setRng(i)}(e,o,l,r),!0;if(!r&&!t&&X.removeList(e))return!0}return!1},re=function(e,t){return oe(e,t)||function(r,i){var a=r.dom,e=r.selection.getStart(),s=E.getClosestListRootElm(r,e),d=a.getParent(e,a.isBlock,s);if(d&&a.isEmpty(d)){var t=L(r.selection.getRng(!0)),l=a.getParent(Y(r,t,i,s),"LI",s);if(l)return r.undoManager.transact(function(){var e,t,n,o;t=d,n=s,o=(e=a).getParent(t.parentNode,e.isBlock,n),e.remove(t),o&&e.isEmpty(o)&&e.remove(o),X.mergeWithAdjacentLists(a,l.parentNode),r.selection.select(l,!0),r.selection.collapse(i)}),!0}return!1}(e,t)},ie=fun
ction(e,t){return e.selection.isCollapsed()?re(e,t):(o=(n=e).selection.getStart(),r=E.getClosestListRootElm(n,o),!!(n.dom.getParent(o,"LI,DT,DD",r)||0<E.getSelectedListItems(n).length)&&(n.undoManager.transact(function(){n.execCommand("Delete"),I(n.dom,n.getBody())}),!0));var n,o,r},ae=function(t){t.on("keydown",function(e){e.keyCode===n.BACKSPACE?ie(t,!1)&&e.preventDefault():e.keyCode===n.DELETE&&ie(t,!0)&&e.preventDefault()})},se=ie,de=function(t){return{backspaceDelete:function(e){se(t,e)}}},le=t.DOM,ce=function(e,t){var n;if(h(e)){for(;n=e.firstChild;)t.appendChild(n);le.remove(e)}},fe=function(e){var t,n,o,r,i=E.getSelectedListItems(e);if(i.length){for(var a=b(e.selection.getRng(!0)),s=0;s<i.length&&(t=i[s],r=o=n=void 0,("DT"===t.nodeName?(le.rename(t,"DD"),1):(n=t.previousSibling)&&h(n)?(n.appendChild(t),1):n&&"LI"===n.nodeName&&h(n.lastChild)?(n.la
stChild.appendChild(t),ce(t.lastChild,n.lastChild),1):(n=t.nextSibling)&&h(n)?(n.insertBefore(t,n.firstChild),1):(n=t.previousSibling)&&"LI"===n.nodeName&&(o=le.create(t.parentNode.nodeName),(r=le.getStyle(t.parentNode,"listStyleType"))&&le.setStyle(o,"listStyleType",r),n.appendChild(o),o.appendChild(t),ce(t.lastChild,o),1))||0!==s);s++);return e.selection.setRng(D(a)),e.nodeChanged(),!0}},ue=function(t,n){return function(){var e=t.dom.getParent(t.selection.getStart(),"UL,OL,DL");return e&&e.nodeName===n}},me=function(o){o.on("BeforeExecCommand",function(e){var t,n=e.command.toLowerCase();if("indent"===n?fe(o)&&(t=!0):"outdent"===n&&K(o)&&(t=!0),t)return o.fire("ExecCommand",{command:e.command}),e.preventDefault(),!0}),o.addCommand("InsertUnorderedList",function(e,t){X.toggleList(o,"UL",t)}),o.addCommand("InsertOrder
edList",function(e,t){X.toggleList(o,"OL",t)}),o.addCommand("InsertDefinitionList",function(e,t){X.toggleList(o,"DL",t)}),o.addQueryStateHandler("InsertUnorderedList",ue(o,"UL")),o.addQueryStateHandler("InsertOrderedList",ue(o,"OL")),o.addQueryStateHandler("InsertDefinitionList",ue(o,"DL"))},ge=function(e){return e.getParam("lists_indent_on_tab",!0)},pe=function(e){var t;ge(e)&&(t=e).on("keydown",function(e){e.keyCode!==n.TAB||n.metaKeyPressed(e)||t.dom.getParent(t.selection.getStart(),"LI,DT,DD")&&(e.preventDefault(),e.shiftKey?K(t):fe(t))}),ae(e)},ve=function(t,i){return function(e){var r=e.control;t.on("NodeChange",function(e){var t=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}(e.parents,a),n=-1!==t?e.parents.slice(0,t):e.parents,o=v.grep(n,h);r.active(0<o.length&&o[0].nodeName===i)})}},he=fun
ction(e){var t,n,o,r;n="advlist",o=(t=e).settings.plugins?t.settings.plugins:"",-1===v.inArray(o.split(/[ ,]/),n)&&(e.addButton("numlist",{active:!1,title:"Numbered list",cmd:"InsertOrderedList",onPostRender:ve(e,"OL")}),e.addButton("bullist",{active:!1,title:"Bullet list",cmd:"InsertUnorderedList",onPostRender:ve(e,"UL")})),e.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent",onPostRender:(r=e,function(e){var n=e.control;r.on("nodechange",function(){var e=E.getSelectedListItems(r),t=0<e.length&&s(e[0]);n.disabled(t)})})})};e.add("lists",function(e){return pe(e),he(e),me(e),de(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(){"use strict";var e,n,t,r,o,i,u,a,l,s,c=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),d=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),m=tinymce.util.Tools.resolve("tinymce.util.VK"),p=tinymce.util.Tools.resolve("tinymce.dom.BookmarkManager"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),g=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),h=function(e){return e&&"BR"===e.nodeName},y=function(e){return e&&3===e.nodeType},N=function(e){return e&&/^(OL|UL|DL)$/.test(e.nodeName)},S=function(e){return e&&/^(OL|UL)$/.test(e.nodeName)},O=function(e){return e&&/^(DT|DD)$/.test(e.nodeName)},C=function(e){return e&&/^(LI|DT|DD)$/.test(e.nodeName)},b=function(e){return e&&
/^(TH|TD)$/.test(e.nodeName)},L=h,T=function(e,n){return n&&!!e.schema.getTextBlockElements()[n.nodeName]},D=function(e,n){return e&&e.nodeName in n},E=function(e,n){return!!h(n)&&!(!e.isBlock(n.nextSibling)||h(n.previousSibling))},w=function(e,n,t){var r=e.isEmpty(n);return!(t&&0<e.select("span[data-mce-type=bookmark]",n).length)&&r},k=function(e,n){return e.isChildOf(n,e.getRoot())},A=function(e,n){if(y(e))return{container:e,offset:n};var t=f.getNode(e,n);return y(t)?{container:t,offset:n>=e.childNodes.length?t.data.length:0}:t.previousSibling&&y(t.previousSibling)?{container:t.previousSibling,offset:t.previousSibling.data.length}:t.nextSibling&&y(t.nextSibling)?{container:t.nextSibling,offset:0}:{container:e,offset:n}},x=function(e){var n=e.cloneRange(),t=A(e.startContainer,e.startOffset);n.setStart(t.container,t.offset);var r=A(e.endContainer,e.endOffset);return n.setEnd(r.container,r.offset),n},R=g.DOM,I=fu
nction(o){var i={},e=function(e){var n,t,r;t=o[e?"startContainer":"endContainer"],r=o[e?"startOffset":"endOffset"],1===t.nodeType&&(n=R.create("span",{"data-mce-type":"bookmark"}),t.hasChildNodes()?(r=Math.min(r,t.childNodes.length-1),e?t.insertBefore(n,t.childNodes[r]):R.insertAfter(n,t.childNodes[r])):t.appendChild(n),t=n,r=0),i[e?"startContainer":"endContainer"]=t,i[e?"startOffset":"endOffset"]=r};return e(!0),o.collapsed||e(),i},B=function(o){function e(e){var n,t,r;n=r=o[e?"startContainer":"endContainer"],t=o[e?"startOffset":"endOffset"],n&&(1===n.nodeType&&(t=function(e){for(var n=e.parentNode.firstChild,t=0;n;){if(n===e)return t;1===n.nodeType&&"bookmark"===n.getAttribute("data-mce-type")||t++,n=n.nextSibling}return-1}(n),n=n.parentNode,R.remove(r),!n.hasChildNodes()&&R
.isBlock(n)&&n.appendChild(R.create("br"))),o[e?"startContainer":"endContainer"]=n,o[e?"startOffset":"endOffset"]=t)}e(!0),e();var n=R.createRng();return n.setStart(o.startContainer,o.startOffset),o.endContainer&&n.setEnd(o.endContainer,o.endOffset),x(n)},_=function(e){return function(){return e}},P=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return!t.apply(null,e)}},M=_(!1),U=_(!0),F=M,j=U,H=function(){return $},$=(r={fold:function(e,n){return e()},is:F,isSome:F,isNone:j,getOr:t=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:t,orThunk:n,map:H,ap:H,each:function(){},bind:H,flatten:H,exists:F,forall:j,filter:H,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:
_("none()")},Object.freeze&&Object.freeze(r),r),q=function(t){var e=function(){return t},n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:j,isNone:F,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return q(e(t))},ap:function(e){return e.fold(H,function(e){return q(e(t))})},each:function(e){e(t)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(t)?o:$},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(F,function(e){return n(t,e)})},toArray:function(){return[t]},toString:function(){return"some("+t+")"}};return o},W={some:q,none:H,from:function(e){return null===e||e===undefined?$:q(e)}},z=function(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"===n&&Array.prototype.isPrototypeOf(e)?"array":"object"===n&
;&String.prototype.isPrototypeOf(e)?"string":n}(e)===n}},K=z("string"),V=z("boolean"),X=z("function"),Q=z("number"),Y=function(e,n){for(var t=e.length,r=new Array(t),o=0;o<t;o++){var i=e[o];r[o]=n(i,o,e)}return r},G=function(e,n){for(var t=0,r=e.length;t<r;t++)n(e[t],t,e)},J=function(e,n){for(var t=[],r=0,o=e.length;r<o;r++){var i=e[r];n(i,r,e)&&t.push(i)}return t},Z=function(e,n,t){return G(e,function(e){t=n(t,e)}),t},ee=function(e,n){for(var t=0,r=e.length;t<r;t++){var o=e[t];if(n(o,t,e))return W.some(o)}return W.none()},ne=Array.prototype.push,te=function(e,n){return function(e){for(var n=[],t=0,r=e.length;t<r;++t){if(!Array.prototype.isPrototypeOf(e[t]))throw new Error("Arr.flatten item "+t+" was not an array, input: "+e);ne.apply(n,e[t])}return n}(Y(e,n))},re=Array.prototype.slice,oe=function(e){return 0===e.length?W.none():W.some(e[0])},ie=function(e){return 0===e.length?W.none():W
.some(e[e.length-1])},ue=(X(Array.from)&&Array.from,"undefined"!=typeof window?window:Function("return this;")()),ae=function(e,n){return function(e,n){for(var t=n!==undefined&&null!==n?n:ue,r=0;r<e.length&&t!==undefined&&null!==t;++r)t=t[e[r]];return t}(e.split("."),n)},se=function(e,n){var t=ae(e,n);if(t===undefined||null===t)throw e+" not available on this browser";return t},ce=function(e){var n,t=ae("ownerDocument.defaultView",e);return(n=t,se("HTMLElement",n)).prototype.isPrototypeOf(e)},fe=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),le=function(e){var n=e.selection.getStart(!0);return e.dom.getParent(n,"OL,UL,DL",me(e,n))},de=function(e){var t,n,r,o=e.selection.getSelectedBlocks();return v.grep((t=e,n=o,r=v.map(n,function(e){var n=t.dom.getParent(e,"li,dd,dt",me(t,e));return n||e}),fe.unique(r)),function(e){return C(e)})},me=function(e,n){var t=e.
dom.getParents(n,"TD,TH");return 0<t.length?t[0]:e.getBody()},ge=function(e,n){var t=e.dom.getParents(n,"ol,ul",me(e,n));return ie(t)},pe=function(n,e){var t=Y(e,function(e){return ge(n,e).getOr(e)});return fe.unique(t)},ve={isList:function(e){var n=le(e);return ce(n)},getParentList:le,getSelectedSubLists:function(e){var n,t,r,o=le(e),i=e.selection.getSelectedBlocks();return r=i,(t=o)&&1===r.length&&r[0]===t?(n=o,v.grep(n.querySelectorAll("ol,ul,dl"),function(e){return N(e)})):v.grep(i,function(e){return N(e)&&o!==e})},getSelectedListItems:de,getClosestListRootElm:me,getSelectedDlItems:function(e){return J(de(e),O)},getSelectedListRoots:function(e){var n,t,r,o=(t=ge(n=e,n.selection.getStart()),r=J(n.selection.getSelectedBlocks(),S),t.toArray().concat(r));return pe(e,o)}},he=function(e,n){var t=function(e,n){for(var t=0;t<e.length;t++){var r=e[t];if(r.test(n))return r}return undefined}(e,n);if(!t)return{major:0,minor:0};var
r=function(e){return Number(n.replace(t,"$"+e))};return Ne(r(1),r(2))},ye=function(){return Ne(0,0)},Ne=function(e,n){return{major:e,minor:n}},Se={nu:Ne,detect:function(e,n){var t=String(n).toLowerCase();return 0===e.length?ye():he(e,t)},unknown:ye},Oe="Firefox",Ce=function(e,n){return function(){return n===e}},be=function(e){var n=e.current;return{current:n,version:e.version,isEdge:Ce("Edge",n),isChrome:Ce("Chrome",n),isIE:Ce("IE",n),isOpera:Ce("Opera",n),isFirefox:Ce(Oe,n),isSafari:Ce("Safari",n)}},Le={unknown:function(){return be({current:undefined,version:Se.unknown()})},nu:be,edge:_("Edge"),chrome:_("Chrome"),ie:_("IE"),opera:_("Opera"),firefox:_(Oe),safari:_("Safari")},Te="Windows",De="Android",Ee="Solaris",we="FreeBSD",ke=function(e,n){return function(){return n===e}},Ae=function(e){var n=e.current;return{current:n,ver
sion:e.version,isWindows:ke(Te,n),isiOS:ke("iOS",n),isAndroid:ke(De,n),isOSX:ke("OSX",n),isLinux:ke("Linux",n),isSolaris:ke(Ee,n),isFreeBSD:ke(we,n)}},xe={unknown:function(){return Ae({current:undefined,version:Se.unknown()})},nu:Ae,windows:_(Te),ios:_("iOS"),android:_(De),linux:_("Linux"),osx:_("OSX"),solaris:_(Ee),freebsd:_(we)},Re=function(e,n){var t=String(n).toLowerCase();return ee(e,function(e){return e.search(t)})},Ie=function(e,t){return Re(e,t).map(function(e){var n=Se.detect(e.versionRegexes,t);return{current:e.name,version:n}})},Be=function(e,t){return Re(e,t).map(function(e){var n=Se.detect(e.versionRegexes,t);return{current:e.name,version:n}})},_e=function(e,n){return-1!==e.indexOf(n)},Pe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Me=function(n){return function(e){return _e(e,n)}},Ue=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return _e(e,"edge/")&&_
e(e,"chrome")&&_e(e,"safari")&&_e(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Pe],search:function(e){return _e(e,"chrome")&&!_e(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return _e(e,"msie")||_e(e,"trident")}},{name:"Opera",versionRegexes:[Pe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Me("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Me("firefox")},{name:"Safari",versionRegexes:[Pe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(_e(e,"safari")||_e(e,"mobile/"))&&_e(e,"applewebkit")}}],Fe=[{name:"Windows",search:Me("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS
",search:function(e){return _e(e,"iphone")||_e(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Me("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Me("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Me("linux"),versionRegexes:[]},{name:"Solaris",search:Me("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Me("freebsd"),versionRegexes:[]}],je={browsers:_(Ue),oses:_(Fe)},He=function(e){var n,t,r,o,i,u,a,s,c,f,l,d=je.browsers(),m=je.oses(),g=Ie(d,e).fold(Le.unknown,Le.nu),p=Be(m,e).fold(xe.unknown,xe.nu);return{browser:g,os:p,deviceType:(t=g,r=e,o=(n=p).isiOS()&&!0===/ipad/i.test(r),i=n.isiOS()&&!o,u=n.isAndroid()&&3===n.version.major,a=n.isAndroid()&&4===n.
version.major,s=o||u||a&&!0===/mobile/i.test(r),c=n.isiOS()||n.isAndroid(),f=c&&!s,l=t.isSafari()&&n.isiOS()&&!1===/safari/i.test(r),{isiPad:_(o),isiPhone:_(i),isTablet:_(s),isPhone:_(f),isTouch:_(c),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:_(l)})}},$e={detect:(o=function(){var e=navigator.userAgent;return He(e)},u=!1,function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return u||(u=!0,i=o.apply(null,e)),i})},qe=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:_(e)}},We={fromHtml:function(e,n){var t=(n||document).createElement("div");if(t.innerHTML=e,!t.hasChildNodes()||1<t.childNodes.length)throw console.error("HTML does not have a single root node",e),"HTML must have a single root node";return qe(t.childNodes[0])},fromTag:function(e,n){var t=(n||document).createElement(e);return qe(t)},fromText:function(e,n){var t=(n||document).cre
ateTextNode(e);return qe(t)},fromDom:qe,fromPoint:function(e,n,t){var r=e.dom();return W.from(r.elementFromPoint(n,t)).map(qe)}},ze=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE,Node.DOCUMENT_NODE,Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE),Ke=(Node.TEXT_NODE,Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,ze),Ve=($e.detect().browser.isIE(),function(e,n){var t=e.dom();if(t.nodeType!==Ke)return!1;if(t.matches!==undefined)return t.matches(n);if(t.msMatchesSelector!==undefined)return t.msMatchesSelector(n);if(t.webkitMatchesSelector!==undefined)return t.webkitMatchesSelector(n);if(t.mozMatchesSelector!==undefined)return t.mozMatchesSelector(n);throw new Error("Browser lacks native selectors")}),Xe=Object.keys,Qe=function(e){return e.dom().nodeName.toLowerCase()},Ye=function(e,n){var t=e.dom();!function(e,n){for(var t=Xe(e),r=0,o=t.length;r<o;r++){var i=t[r];n(e[i],i,e)}}(n,function(
e,n){!function(e,n,t){if(!(K(t)||V(t)||Q(t)))throw console.error("Invalid call to Attr.set. Key ",n,":: Value ",t,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(n,t+"")}(t,n,e)})},Ge=function(e){return Z(e.dom().attributes,function(e,n){return e[n.name]=n.value,e},{})},Je=function(e){var n=e.dom();return W.from(n.parentNode).map(We.fromDom)},Ze=function(e){var n=e.dom();return Y(n.childNodes,We.fromDom)},en=function(e,n){var t=e.dom().childNodes;return W.from(t[n]).map(We.fromDom)},nn=function(e){return en(e,0)},tn=function(e){return en(e,e.dom().childNodes.length-1)},rn=(function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n]}("element","offset"),function(n,t){Je(n).each(function(e){e.dom().insertBefore(t.dom(),n.dom())})}),on=function(e,n){e.dom().appendChild(n.dom())},un=function(n,e){G(e,function(e){on(n,e)})},an=function(e){var n=e.dom();null!==n.parentNode&&am
p;n.parentNode.removeChild(n)},sn=function(e){return n=e,t=!0,We.fromDom(n.dom().cloneNode(t));var n,t},cn=function(e,n){var t,r,o,i,u=(t=e,r=n,o=We.fromTag(r),i=Ge(t),Ye(o,i),o);rn(e,u);var a=Ze(e);return un(u,a),an(e),u},fn=tinymce.util.Tools.resolve("tinymce.Env"),ln=g.DOM,dn=function(e,n,t){var r,o,i,u=ln.createFragment(),a=e.schema.getBlockElements();if(e.settings.forced_root_block&&(t=t||e.settings.forced_root_block),t&&((o=ln.create(t)).tagName===e.settings.forced_root_block&&ln.setAttribs(o,e.settings.forced_root_block_attrs),D(n.firstChild,a)||u.appendChild(o)),n)for(;r=n.firstChild;){var s=r.nodeName;i||"SPAN"===s&&"bookmark"===r.getAttribute("data-mce-type")||(i=!0),D(r,a)?(u.appendChild(r),o=null):t?(o||(o=ln.create(t),u.appendChild(o)),o.appendChild(r)):u.appendChild(r)}return e.settings.forced_root_block?i||fn.ie&&!(10<fn.ie)||o.appendChild(ln.create("br",{"data-mce-bogus&
quot;:"1"})):u.appendChild(ln.create("br")),u},mn=g.DOM,gn=function(e,n,t,r){var o,i,u,a,s;for(u=mn.select('span[data-mce-type="bookmark"]',n),r=r||dn(e,t),(o=mn.createRng()).setStartAfter(t),o.setEndAfter(n),a=(i=o.extractContents()).firstChild;a;a=a.firstChild)if("LI"===a.nodeName&&e.dom.isEmpty(a)){mn.remove(a);break}e.dom.isEmpty(i)||mn.insertAfter(i,n),mn.insertAfter(r,n),w(e.dom,t.parentNode)&&(s=t.parentNode,v.each(u,function(e){s.parentNode.insertBefore(e,t.parentNode)}),mn.remove(s)),mn.remove(t),w(e.dom,n)&&mn.remove(n)},pn=function(e,n){for(var t=[],r=0;r<e.length;r++){var o=e[r];if(!o.isSome())return W.none();t.push(o.getOrDie())}return W.some(n.apply(null,t))},vn=function(e,n,t){if(!K(t))throw console.error("Invalid call to CSS.set. Property ",n,":: Value ",t,":: Element ",e),new Error("CSS value must be a string: "+t);e.style!==undefined&&e.style.setProper
ty(n,t)},hn=function(e,n){on(e.item,n.list)},yn=function(i,e,u){for(var a=[],n=function(e){var n,t,r,o=(n=i,t=u,r={list:We.fromTag(t,n),item:We.fromTag("li",n)},on(r.list,r.item),r);ie(a).each(function(e){return hn(e,o)}),a.push(o)},t=0;t<e;t++)n();return a},Nn=function(c,e,f){var n=e.slice(0,f.depth);return ie(n).each(function(e){var n,t,r,o,i,u,a,s;n=e,r=c,o=f.itemAttributes,i=f.content,u=We.fromTag("li",r),Ye(u,o),un(u,i),t=u,on(n.list,t),n.item=t,s=f,Qe((a=e).list).toUpperCase()!==s.listType&&(a.list=cn(a.list,s.listType)),Ye(a.list,s.listAttributes)}),n},Sn=function(e,n,t){var r=yn(e,t.depth-n.length,t.listType);return function(e,n){ie(e).each(function(e){Ye(e.list,n.listAttributes),Ye(e.item,n.itemAttributes),un(e.item,n.content)});for(var t=0;t<e.length-1;t++)r=e[t].item,o="list-style-type",i="none",u=r.dom(),vn(u,o,i);var r,o,i,u}(r,t),pn([ie(n),oe(r)],hn),n.concat(r)},On=function(e){return 0<e.depth},Cn=function(e){re
turn e.isSelected},bn=Object.prototype.hasOwnProperty,Ln=(a=function(e,n){return n},function(){for(var e=new Array(arguments.length),n=0;n<e.length;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Can't merge zero objects");for(var t={},r=0;r<e.length;r++){var o=e[r];for(var i in o)bn.call(o,i)&&(t[i]=a(t[i],o[i]))}return t}),Tn=function(e,r){var n=r.depth-1;e[n].each(function(e){return t=e,(n=r).listType=t.listType,void(n.listAttributes=Ln({},t.listAttributes));var n,t});var t=e.slice(0,n);return t.push(W.some(r)),t},Dn=function(e){Z(e,function(e,n){return n.depth>e.length?function(e,n){for(var t=e.slice(0),r=n.depth-e.length,o=1;o<r;o++)t.push(W.none());return t.push(W.some(n)),t}(e,n):Tn(e,n)},[])},En=function(e){var n=e,t=function(){return n};return{get:t,set:function(e){n=e},clone:function(){return En(t())}}};(s=l||(l={})).OL="OL",s.UL="UL",s.DL="DL";var wn=function(e){switch(Qe(e)){case"ol":return W.so
me(l.OL);case"ul":return W.some(l.UL);case"dl":return W.some(l.DL);default:return W.none()}},kn=function(e){return Ve(e,"OL,UL,DL")},An=function(e){return nn(e).map(kn).getOr(!1)},xn=function(e){var n=Ze(e),t=n.length+(tn(e).map(kn).getOr(!1)?-1:0);return Y(n.slice(0,t),sn)},Rn=function(u,e,a,s){var c=function(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var t=o.concat(e);return r.apply(null,t)}}(In,u,e,a),f=function(r){return e.each(function(e){var n,t;n="Start"===r?e.start:e.end,t=s,n.dom()===t.dom()&&a.set("Start"===r)})};return nn(s).filter(kn).fold(function(){f("Start");var e,n,t,r,o=(e=s,n=u,t=a.get(),r=Je(e),{depth:n,isSelected:t,content:xn(e),listType:r.bind(wn).getOr(l.OL),listAttributes:r.map(Ge).getOr({}),itemAttributes:Ge(e)});f("End");var i=tn(s).filter(kn).map(c).getOr([]);return[o].concat(i)},
c)},In=function(e,n,t,r){var o=e+1;return te(Ze(r),function(e){return kn(e)?In(o,n,t,e):Rn(o,n,t,e)})},Bn=function(i,e){return Y(e,function(e){var n,t,r,o=(n=e.content,r=(t||document).createDocumentFragment(),G(n,function(e){r.appendChild(e.dom())}),We.fromDom(r));return We.fromDom(dn(i,o.dom()))})},_n=function(e,n){return Dn(n),(t=e.contentDocument,r=n,o=Z(r,function(e,n){return n.depth>e.length?Sn(t,e,n):Nn(t,e,n)},[]),oe(o).map(function(e){return e.list})).toArray();var t,r,o},Pn=function(e){var n,t,r=Y(ve.getSelectedListItems(e),We.fromDom);return pn([ee(r,P(An)),ee((n=r,t=re.call(n,0),t.reverse(),t),P(An))],function(e,n){return{start:e,end:n}})},Mn=function(a,e,s){var n,t,r,o=(n=e,t=Pn(a),r=En(!1),Y(n,function(e){return{entries:In(0,t,r,e),sourceList:e}}));G(o,function(e){var n,t,r,o,i,u;n=e.entries,t=s,G(J(n,Cn),function(e){return function(e,n){switch(e){case"Indent":n.depth++;break;case"Outdent":n.depth--;break;case"Flatten":n.depth=0}}(t,e)})
,r=e.sourceList,i=a,u=e.entries,o=te(function(e,n){if(0===e.length)return[];for(var t=n(e[0]),r=[],o=[],i=0,u=e.length;i<u;i++){var a=e[i],s=n(a);s!==t&&(r.push(o),o=[]),t=s,o.push(a)}return 0!==o.length&&r.push(o),r}(u,On),function(e){return oe(e).map(On).getOr(!1)?_n(i,e):Bn(i,e)}),G(o,function(e){rn(r,e)}),an(e.sourceList)})},Un=function(e){Ve(e,"DT")&&cn(e,"DD")},Fn=function(r,e,n){G(n,"Indent"===e?Un:function(e){return n=r,void(Ve(t=e,"DD")?cn(t,"DT"):Ve(t,"DT")&&Je(t).each(function(e){return gn(n,e.dom(),t.dom())}));var n,t})},jn=function(e,n){var t=Y(ve.getSelectedDlItems(e),We.fromDom),r=Y(ve.getSelectedListRoots(e),We.fromDom);if(t.length||r.length){var o=e.selection.getBookmark();Fn(e,n,t),Mn(e,r,n),e.selection.moveToBookmark(o),e.selection.setRng(x(e.selection.getRng())),e.nodeChanged()}},Hn=function(e){jn(e,"Indent")},$n=function(e){jn(e,"Outdent")},qn=funct
ion(e){jn(e,"Flatten")},Wn=function(t,e){v.each(e,function(e,n){t.setAttribute(n,e)})},zn=function(e,n,t){var r,o,i,u,a,s,c;r=e,o=n,u=(i=t)["list-style-type"]?i["list-style-type"]:null,r.setStyle(o,"list-style-type",u),a=e,Wn(s=n,(c=t)["list-attributes"]),v.each(a.select("li",s),function(e){Wn(e,c["list-item-attributes"])})},Kn=function(e,n,t,r){var o,i;for(o=n[t?"startContainer":"endContainer"],i=n[t?"startOffset":"endOffset"],1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!t&&L(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(T(e,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o},Vn=function(f,l,d){void 0===d&&(d={});var e,n=f.selection.getRng(!0),m="LI",t=ve.getClosestListRootElm(f,f.selection.getStart(!0)),g=f.dom;"false"!==g.getContentEditable(f.selec
tion.getNode())&&("DL"===(l=l.toUpperCase())&&(m="DT"),e=I(n),v.each(function(t,e,r){for(var o,i=[],u=t.dom,n=Kn(t,e,!0,r),a=Kn(t,e,!1,r),s=[],c=n;c&&(s.push(c),c!==a);c=c.nextSibling);return v.each(s,function(e){if(T(t,e))return i.push(e),void(o=null);if(u.isBlock(e)||L(e))return L(e)&&u.remove(e),void(o=null);var n=e.nextSibling;p.isBookmarkNode(e)&&(T(t,n)||!n&&e.parentNode===r)?o=null:(o||(o=u.create("p"),e.parentNode.insertBefore(o,e),i.push(o)),o.appendChild(e))}),i}(f,n,t),function(e){var n,t,r,o,i,u,a,s,c;(t=e.previousSibling)&&N(t)&&t.nodeName===l&&(r=t,o=d,i=g.getStyle(r,"list-style-type"),u=o?o["list-style-type"]:"",i===(u=null===u?"":u))?(n=t,e=g.rename(e,m),t.appendChild(e)):(n=g.create(l),e.parentNode.insertBefore(n,e),n.appendChild(e),e=g.rename(e,m)),a=g,s=e,c=["margin","margin-right","margin-bottom&quo
t;,"margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"],v.each(c,function(e){var n;return a.setStyle(s,((n={})[e]="",n))}),zn(g,n,d),Qn(f.dom,n)}),f.selection.setRng(B(e)))},Xn=function(e,n,t){return s=t,(a=n)&&s&&N(a)&&a.nodeName===s.nodeName&&(i=n,u=t,(o=e).getStyle(i,"list-style-type",!0)===o.getStyle(u,"list-style-type",!0))&&(r=t,n.className===r.className);var r,o,i,u,a,s},Qn=function(e,n){var t,r;if(t=n.nextSibling,Xn(e,n,t)){for(;r=t.firstChild;)n.appendChild(r);e.remove(t)}if(t=n.previousSibling,Xn(e,n,t)){for(;r=t.lastChild;)n.insertBefore(r,n.firstChild);e.remove(t)}},Yn=function(n,e,t,r,o){if(e.nodeName!==r||Gn(o)){var i=I(n.selection.getRng(!0));v.each([e].concat(t),function(e){!function(e,n,t,r){if(n.nodeName!==t){var o=e.rename(n,t);zn(e,o,r)}else zn(e,n,r)}(n.dom,e,r,o)}),n.selection.
setRng(B(i))}else qn(n)},Gn=function(e){return"list-style-type"in e},Jn={toggleList:function(e,n,t){var r=ve.getParentList(e),o=ve.getSelectedSubLists(e);t=t||{},r&&0<o.length?Yn(e,r,o,n,t):function(e,n,t,r){if(n!==e.getBody())if(n)if(n.nodeName!==t||Gn(r)){var o=I(e.selection.getRng(!0));zn(e.dom,n,r),Qn(e.dom,e.dom.rename(n,t)),e.selection.setRng(B(o))}else qn(e);else Vn(e,t,r)}(e,r,n,t)},mergeWithAdjacentLists:Qn},Zn=g.DOM,et=function(e,n){var t,r=n.parentNode;"LI"===r.nodeName&&r.firstChild===n&&((t=r.previousSibling)&&"LI"===t.nodeName?(t.appendChild(n),w(e,r)&&Zn.remove(r)):Zn.setStyle(r,"listStyleType","none")),N(r)&&(t=r.previousSibling)&&"LI"===t.nodeName&&t.appendChild(n)},nt=function(n,e){v.each(v.grep(n.select("ol,ul",e)),function(e){et(n,e)})},tt=function(e,n,t,r){var o,i,u=n.startContainer,a=n.startOffset;if(3===u.nodeType&&(t
?a<u.data.length:0<a))return u;for(o=e.schema.getNonEmptyElements(),1===u.nodeType&&(u=f.getNode(u,a)),i=new d(u,r),t&&E(e.dom,u)&&i.next();u=i[t?"next":"prev2"]();){if("LI"===u.nodeName&&!u.hasChildNodes())return u;if(o[u.nodeName])return u;if(3===u.nodeType&&0<u.data.length)return u}},rt=function(e,n){var t=n.childNodes;return 1===t.length&&!N(t[0])&&e.isBlock(t[0])},ot=function(e,n,t){var r,o,i,u;if(o=rt(e,t)?t.firstChild:t,rt(i=e,u=n)&&i.remove(u.firstChild,!0),!w(e,n,!0))for(;r=n.firstChild;)o.appendChild(r)},it=function(e,n,t){var r,o,i=n.parentNode;k(e,n)&&k(e,t)&&(N(t.lastChild)&&(o=t.lastChild),i===t.lastChild&&L(i.previousSibling)&&e.remove(i.previousSibling),(r=t.lastChild)&&L(r)&&n.hasChildNodes()&&e.remove(r),w(e,t,!0)&&e.$(t).empty(),ot(e,n,t),o&&t.appendChild(o),e.remove(n),w(e,i)&&am
p;i!==e.getRoot()&&e.remove(i))},ut=function(e,n,t,r){var o,i,u,a=e.dom;if(a.isEmpty(r))i=t,u=r,(o=e).dom.$(u).empty(),it(o.dom,i,u),o.selection.setCursorLocation(u);else{var s=I(n);it(a,t,r),e.selection.setRng(B(s))}},at=function(e,n){var t,r,o,i=e.dom,u=e.selection,a=u.getStart(),s=ve.getClosestListRootElm(e,a),c=i.getParent(u.getStart(),"LI",s);if(c){if((t=c.parentNode)===e.getBody()&&w(i,t))return!0;if(r=x(u.getRng(!0)),(o=i.getParent(tt(e,r,n,s),"LI",s))&&o!==c)return n?ut(e,r,o,c):function(e,n,t,r){var o=I(n);it(e.dom,t,r);var i=B(o);e.selection.setRng(i)}(e,r,c,o),!0;if(!o&&!n)return qn(e),!0}return!1},st=function(e,n){return at(e,n)||function(o,i){var u=o.dom,e=o.selection.getStart(),a=ve.getClosestListRootElm(o,e),s=u.getParent(e,u.isBlock,a);if(s&&u.isEmpty(s)){var n=x(o.selection.getRng(!0)),c=u.getParent(tt(o,n,i,a),"LI",a);if(c)return o.undoManager.transact(function(){var e,n,t,r;n=s,t=a,r=(e=u).getPa
rent(n.parentNode,e.isBlock,t),e.remove(n),r&&e.isEmpty(r)&&e.remove(r),Jn.mergeWithAdjacentLists(u,c.parentNode),o.selection.select(c,!0),o.selection.collapse(i)}),!0}return!1}(e,n)},ct=function(e,n){return e.selection.isCollapsed()?st(e,n):(r=(t=e).selection.getStart(),o=ve.getClosestListRootElm(t,r),!!(t.dom.getParent(r,"LI,DT,DD",o)||0<ve.getSelectedListItems(t).length)&&(t.undoManager.transact(function(){t.execCommand("Delete"),nt(t.dom,t.getBody())}),!0));var t,r,o},ft=function(n){n.on("keydown",function(e){e.keyCode===m.BACKSPACE?ct(n,!1)&&e.preventDefault():e.keyCode===m.DELETE&&ct(n,!0)&&e.preventDefault()})},lt=ct,dt=function(n){return{backspaceDelete:function(e){lt(n,e)}}},mt=function(n,t){return function(){var e=n.dom.getParent(n.selection.getStart(),"UL,OL,DL");return e&&e.nodeName===t}},gt=function(t){t.on("BeforeExecCommand",function(e){var n=e.command.toLowerC
ase();"indent"===n?Hn(t):"outdent"===n&&$n(t)}),t.addCommand("InsertUnorderedList",function(e,n){Jn.toggleList(t,"UL",n)}),t.addCommand("InsertOrderedList",function(e,n){Jn.toggleList(t,"OL",n)}),t.addCommand("InsertDefinitionList",function(e,n){Jn.toggleList(t,"DL",n)}),t.addCommand("RemoveList",function(){qn(t)}),t.addQueryStateHandler("InsertUnorderedList",mt(t,"UL")),t.addQueryStateHandler("InsertOrderedList",mt(t,"OL")),t.addQueryStateHandler("InsertDefinitionList",mt(t,"DL"))},pt=function(e){return e.getParam("lists_indent_on_tab",!0)},vt=function(e){var n;pt(e)&&(n=e).on("keydown",function(e){e.keyCode!==m.TAB||m.metaKeyPressed(e)||ve.isList(n)&&(e.preventDefault(),n.undoManager.transact(function(){e.shiftKey?$n(n):Hn(n)}))}),ft(e)},ht=function(n,i){return function(e){var o=e.control;n
.on("NodeChange",function(e){var n=function(e,n){for(var t=0;t<e.length;t++)if(n(e[t]))return t;return-1}(e.parents,b),t=-1!==n?e.parents.slice(0,n):e.parents,r=v.grep(t,N);o.active(0<r.length&&r[0].nodeName===i)})}},yt=function(e){var n,t,r;t="advlist",r=(n=e).settings.plugins?n.settings.plugins:"",-1===v.inArray(r.split(/[ ,]/),t)&&(e.addButton("numlist",{active:!1,title:"Numbered list",cmd:"InsertOrderedList",onPostRender:ht(e,"OL")}),e.addButton("bullist",{active:!1,title:"Bullet list",cmd:"InsertUnorderedList",onPostRender:ht(e,"UL")})),e.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent"})};c.add("lists",function(e){return vt(e),yt(e),gt(e),dt(e)})}();
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcjs_enqueuesvendortinymcepluginsmediapluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/plugins/media/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/plugins/media/plugin.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/plugins/media/plugin.js 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,1166 +1,1166 @@
</span><span class="cx" style="display: block; padding: 0 10px"> (function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var media = (function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'use strict';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'use strict';
</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 global = tinymce.util.Tools.resolve('tinymce.PluginManager');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global = tinymce.util.Tools.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">- var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$1 = tinymce.util.Tools.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">- var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$2 = tinymce.util.Tools.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">- var getScripts = function (editor) {
- return editor.getParam('media_scripts');
- };
- var getAudioTemplateCallback = function (editor) {
- return editor.getParam('audio_template_callback');
- };
- var getVideoTemplateCallback = function (editor) {
- return editor.getParam('video_template_callback');
- };
- var hasLiveEmbeds = function (editor) {
- return editor.getParam('media_live_embeds', true);
- };
- var shouldFilterHtml = function (editor) {
- return editor.getParam('media_filter_html', true);
- };
- var getUrlResolver = function (editor) {
- return editor.getParam('media_url_resolver');
- };
- var hasAltSource = function (editor) {
- return editor.getParam('media_alt_source', true);
- };
- var hasPoster = function (editor) {
- return editor.getParam('media_poster', true);
- };
- var hasDimensions = function (editor) {
- return editor.getParam('media_dimensions', true);
- };
- var $_69rpmgh3jjgwecnr = {
- getScripts: getScripts,
- getAudioTemplateCallback: getAudioTemplateCallback,
- getVideoTemplateCallback: getVideoTemplateCallback,
- hasLiveEmbeds: hasLiveEmbeds,
- shouldFilterHtml: shouldFilterHtml,
- getUrlResolver: getUrlResolver,
- hasAltSource: hasAltSource,
- hasPoster: hasPoster,
- hasDimensions: hasDimensions
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getScripts = function (editor) {
+ return editor.getParam('media_scripts');
+ };
+ var getAudioTemplateCallback = function (editor) {
+ return editor.getParam('audio_template_callback');
+ };
+ var getVideoTemplateCallback = function (editor) {
+ return editor.getParam('video_template_callback');
+ };
+ var hasLiveEmbeds = function (editor) {
+ return editor.getParam('media_live_embeds', true);
+ };
+ var shouldFilterHtml = function (editor) {
+ return editor.getParam('media_filter_html', true);
+ };
+ var getUrlResolver = function (editor) {
+ return editor.getParam('media_url_resolver');
+ };
+ var hasAltSource = function (editor) {
+ return editor.getParam('media_alt_source', true);
+ };
+ var hasPoster = function (editor) {
+ return editor.getParam('media_poster', true);
+ };
+ var hasDimensions = function (editor) {
+ return editor.getParam('media_dimensions', true);
+ };
+ var Settings = {
+ getScripts: getScripts,
+ getAudioTemplateCallback: getAudioTemplateCallback,
+ getVideoTemplateCallback: getVideoTemplateCallback,
+ hasLiveEmbeds: hasLiveEmbeds,
+ shouldFilterHtml: shouldFilterHtml,
+ getUrlResolver: getUrlResolver,
+ hasAltSource: hasAltSource,
+ hasPoster: hasPoster,
+ hasDimensions: hasDimensions
+ };
</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 global$3 = tinymce.util.Tools.resolve('tinymce.html.SaxParser');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$3 = tinymce.util.Tools.resolve('tinymce.html.SaxParser');
</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 global$4 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$4 = tinymce.util.Tools.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">- var getVideoScriptMatch = function (prefixes, src) {
- if (prefixes) {
- for (var i = 0; i < prefixes.length; i++) {
- if (src.indexOf(prefixes[i].filter) !== -1) {
- return prefixes[i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getVideoScriptMatch = function (prefixes, src) {
+ if (prefixes) {
+ for (var i = 0; i < prefixes.length; i++) {
+ if (src.indexOf(prefixes[i].filter) !== -1) {
+ return prefixes[i];
+ }
</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">- }
- };
- var $_4q3fmh7jjgwecnw = { getVideoScriptMatch: getVideoScriptMatch };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var VideoScript = { getVideoScriptMatch: getVideoScriptMatch };
</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 trimPx = function (value) {
- return value.replace(/px$/, '');
- };
- var addPx = function (value) {
- return /^[0-9.]+$/.test(value) ? value + 'px' : value;
- };
- var getSize = function (name) {
- return function (elm) {
- return elm ? trimPx(elm.style[name]) : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var trimPx = function (value) {
+ return 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">- };
- var setSize = function (name) {
- return function (elm, value) {
- if (elm) {
- elm.style[name] = addPx(value);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var addPx = function (value) {
+ return /^[0-9.]+$/.test(value) ? value + 'px' : 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 $_jbvx7h8jjgwecnx = {
- getMaxWidth: getSize('maxWidth'),
- getMaxHeight: getSize('maxHeight'),
- setMaxWidth: setSize('maxWidth'),
- setMaxHeight: setSize('maxHeight')
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getSize = function (name) {
+ return function (elm) {
+ return elm ? trimPx(elm.style[name]) : '';
+ };
+ };
+ var setSize = function (name) {
+ return function (elm, value) {
+ if (elm) {
+ elm.style[name] = addPx(value);
+ }
+ };
+ };
+ var Size = {
+ getMaxWidth: getSize('maxWidth'),
+ getMaxHeight: getSize('maxHeight'),
+ setMaxWidth: setSize('maxWidth'),
+ setMaxHeight: setSize('maxHeight')
+ };
</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 DOM = global$4.DOM;
- var getEphoxEmbedIri = function (elm) {
- return DOM.getAttrib(elm, 'data-ephox-embed-iri');
- };
- var isEphoxEmbed = function (html) {
- var fragment = DOM.createFragment(html);
- return getEphoxEmbedIri(fragment.firstChild) !== '';
- };
- var htmlToDataSax = function (prefixes, html) {
- var data = {};
- global$3({
- validate: false,
- allow_conditional_comments: true,
- special: 'script,noscript',
- start: function (name, attrs) {
- if (!data.source1 && name === 'param') {
- data.source1 = attrs.map.movie;
- }
- if (name === 'iframe' || name === 'object' || name === 'embed' || name === 'video' || name === 'audio') {
- if (!data.type) {
- data.type = name;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var DOM = global$4.DOM;
+ var getEphoxEmbedIri = function (elm) {
+ return DOM.getAttrib(elm, 'data-ephox-embed-iri');
+ };
+ var isEphoxEmbed = function (html) {
+ var fragment = DOM.createFragment(html);
+ return getEphoxEmbedIri(fragment.firstChild) !== '';
+ };
+ var htmlToDataSax = function (prefixes, html) {
+ var data = {};
+ global$3({
+ validate: false,
+ allow_conditional_comments: true,
+ special: 'script,noscript',
+ start: function (name, attrs) {
+ if (!data.source1 && name === 'param') {
+ data.source1 = attrs.map.movie;
</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 = global$2.extend(attrs.map, data);
- }
- if (name === 'script') {
- var videoScript = $_4q3fmh7jjgwecnw.getVideoScriptMatch(prefixes, attrs.map.src);
- if (!videoScript) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (name === 'iframe' || name === 'object' || name === 'embed' || name === 'video' || name === 'audio') {
+ if (!data.type) {
+ data.type = name;
+ }
+ data = global$2.extend(attrs.map, 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">- data = {
- type: 'script',
- source1: attrs.map.src,
- width: videoScript.width,
- height: videoScript.height
- };
- }
- if (name === 'source') {
- if (!data.source1) {
- data.source1 = attrs.map.src;
- } else if (!data.source2) {
- data.source2 = attrs.map.src;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (name === 'script') {
+ var videoScript = VideoScript.getVideoScriptMatch(prefixes, attrs.map.src);
+ if (!videoScript) {
+ return;
+ }
+ data = {
+ type: 'script',
+ source1: attrs.map.src,
+ width: videoScript.width,
+ height: videoScript.height
+ };
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (name === 'source') {
+ if (!data.source1) {
+ data.source1 = attrs.map.src;
+ } else if (!data.source2) {
+ data.source2 = attrs.map.src;
+ }
+ }
+ if (name === 'img' && !data.poster) {
+ data.poster = attrs.map.src;
+ }
</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 === 'img' && !data.poster) {
- data.poster = attrs.map.src;
- }
- }
- }).parse(html);
- data.source1 = data.source1 || data.src || data.data;
- data.source2 = data.source2 || '';
- data.poster = data.poster || '';
- return data;
- };
- var ephoxEmbedHtmlToData = function (html) {
- var fragment = DOM.createFragment(html);
- var div = fragment.firstChild;
- return {
- type: 'ephox-embed-iri',
- source1: getEphoxEmbedIri(div),
- source2: '',
- poster: '',
- width: $_jbvx7h8jjgwecnx.getMaxWidth(div),
- height: $_jbvx7h8jjgwecnx.getMaxHeight(div)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }).parse(html);
+ data.source1 = data.source1 || data.src || data.data;
+ data.source2 = data.source2 || '';
+ data.poster = data.poster || '';
+ return 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">- };
- var htmlToData = function (prefixes, html) {
- return isEphoxEmbed(html) ? ephoxEmbedHtmlToData(html) : htmlToDataSax(prefixes, html);
- };
- var $_6mep3hh4jjgwecnt = { htmlToData: htmlToData };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ephoxEmbedHtmlToData = function (html) {
+ var fragment = DOM.createFragment(html);
+ var div = fragment.firstChild;
+ return {
+ type: 'ephox-embed-iri',
+ source1: getEphoxEmbedIri(div),
+ source2: '',
+ poster: '',
+ width: Size.getMaxWidth(div),
+ height: Size.getMaxHeight(div)
+ };
+ };
+ var htmlToData = function (prefixes, html) {
+ return isEphoxEmbed(html) ? ephoxEmbedHtmlToData(html) : htmlToDataSax(prefixes, html);
+ };
+ var HtmlToData = { htmlToData: htmlToData };
</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 global$5 = tinymce.util.Tools.resolve('tinymce.util.Promise');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$5 = tinymce.util.Tools.resolve('tinymce.util.Promise');
</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 guess = function (url) {
- var mimes = {
- mp3: 'audio/mpeg',
- wav: 'audio/wav',
- mp4: 'video/mp4',
- webm: 'video/webm',
- ogg: 'video/ogg',
- swf: 'application/x-shockwave-flash'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var guess = function (url) {
+ var mimes = {
+ mp3: 'audio/mpeg',
+ wav: 'audio/wav',
+ mp4: 'video/mp4',
+ webm: 'video/webm',
+ ogg: 'video/ogg',
+ swf: 'application/x-shockwave-flash'
+ };
+ var fileEnd = url.toLowerCase().split('.').pop();
+ var mime = mimes[fileEnd];
+ return mime ? mime : '';
</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 fileEnd = url.toLowerCase().split('.').pop();
- var mime = mimes[fileEnd];
- return mime ? mime : '';
- };
- var $_d9gn6bhcjjgwecol = { guess: guess };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Mime = { guess: guess };
</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 global$6 = tinymce.util.Tools.resolve('tinymce.html.Writer');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$6 = tinymce.util.Tools.resolve('tinymce.html.Writer');
</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 global$7 = tinymce.util.Tools.resolve('tinymce.html.Schema');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$7 = tinymce.util.Tools.resolve('tinymce.html.Schema');
</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 DOM$1 = global$4.DOM;
- var setAttributes = function (attrs, updatedAttrs) {
- var name;
- var i;
- var value;
- var attr;
- for (name in updatedAttrs) {
- value = '' + updatedAttrs[name];
- if (attrs.map[name]) {
- i = attrs.length;
- while (i--) {
- attr = attrs[i];
- if (attr.name === name) {
- if (value) {
- attrs.map[name] = value;
- attr.value = value;
- } else {
- delete attrs.map[name];
- attrs.splice(i, 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var DOM$1 = global$4.DOM;
+ var setAttributes = function (attrs, updatedAttrs) {
+ var name;
+ var i;
+ var value;
+ var attr;
+ for (name in updatedAttrs) {
+ value = '' + updatedAttrs[name];
+ if (attrs.map[name]) {
+ i = attrs.length;
+ while (i--) {
+ attr = attrs[i];
+ if (attr.name === name) {
+ if (value) {
+ attrs.map[name] = value;
+ attr.value = value;
+ } else {
+ delete attrs.map[name];
+ attrs.splice(i, 1);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if (value) {
+ attrs.push({
+ name: name,
+ value: value
+ });
+ attrs.map[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">- } else if (value) {
- attrs.push({
- name: name,
- value: value
- });
- attrs.map[name] = value;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- };
- var normalizeHtml = function (html) {
- var writer = global$6();
- var parser = global$3(writer);
- parser.parse(html);
- return writer.getContent();
- };
- var updateHtmlSax = function (html, data, updateAll) {
- var writer = global$6();
- var sourceCount = 0;
- var hasImage;
- global$3({
- validate: false,
- allow_conditional_comments: true,
- special: 'script,noscript',
- comment: function (text) {
- writer.comment(text);
- },
- cdata: function (text) {
- writer.cdata(text);
- },
- text: function (text, raw) {
- writer.text(text, raw);
- },
- start: function (name, attrs, empty) {
- switch (name) {
- case 'video':
- case 'object':
- case 'embed':
- case 'img':
- case 'iframe':
- if (data.height !== undefined && data.width !== undefined) {
- setAttributes(attrs, {
- width: data.width,
- height: data.height
- });
- }
- break;
- }
- if (updateAll) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var normalizeHtml = function (html) {
+ var writer = global$6();
+ var parser = global$3(writer);
+ parser.parse(html);
+ return writer.getContent();
+ };
+ var updateHtmlSax = function (html, data, updateAll) {
+ var writer = global$6();
+ var sourceCount = 0;
+ var hasImage;
+ global$3({
+ validate: false,
+ allow_conditional_comments: true,
+ special: 'script,noscript',
+ comment: function (text) {
+ writer.comment(text);
+ },
+ cdata: function (text) {
+ writer.cdata(text);
+ },
+ text: function (text, raw) {
+ writer.text(text, raw);
+ },
+ start: function (name, attrs, empty) {
</ins><span class="cx" style="display: block; padding: 0 10px"> switch (name) {
</span><span class="cx" style="display: block; padding: 0 10px"> case 'video':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- setAttributes(attrs, {
- poster: data.poster,
- src: ''
- });
- if (data.source2) {
- setAttributes(attrs, { src: '' });
- }
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ case 'object':
+ case 'embed':
+ case 'img':
</ins><span class="cx" style="display: block; padding: 0 10px"> case 'iframe':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- setAttributes(attrs, { src: data.source1 });
- break;
- case 'source':
- sourceCount++;
- if (sourceCount <= 2) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (data.height !== undefined && data.width !== undefined) {
</ins><span class="cx" style="display: block; padding: 0 10px"> setAttributes(attrs, {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- src: data['source' + sourceCount],
- type: data['source' + sourceCount + 'mime']
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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">- if (!data['source' + sourceCount]) {
- return;
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- case 'img':
- if (!data.poster) {
- return;
- }
- hasImage = true;
- break;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- writer.start(name, attrs, empty);
- },
- end: function (name) {
- if (name === 'video' && updateAll) {
- for (var index = 1; index <= 2; index++) {
- if (data['source' + index]) {
- var attrs = [];
- attrs.map = {};
- if (sourceCount < index) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (updateAll) {
+ switch (name) {
+ case 'video':
+ setAttributes(attrs, {
+ poster: data.poster,
+ src: ''
+ });
+ if (data.source2) {
+ setAttributes(attrs, { src: '' });
+ }
+ break;
+ case 'iframe':
+ setAttributes(attrs, { src: data.source1 });
+ break;
+ case 'source':
+ sourceCount++;
+ if (sourceCount <= 2) {
</ins><span class="cx" style="display: block; padding: 0 10px"> setAttributes(attrs, {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- src: data['source' + index],
- type: data['source' + index + 'mime']
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ src: data['source' + sourceCount],
+ type: data['source' + sourceCount + 'mime']
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- writer.start('source', attrs, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!data['source' + sourceCount]) {
+ return;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ break;
+ case 'img':
+ if (!data.poster) {
+ return;
+ }
+ hasImage = true;
+ break;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ writer.start(name, attrs, empty);
+ },
+ end: function (name) {
+ if (name === 'video' && updateAll) {
+ for (var index = 1; index <= 2; index++) {
+ if (data['source' + index]) {
+ var attrs = [];
+ attrs.map = {};
+ if (sourceCount < index) {
+ setAttributes(attrs, {
+ src: data['source' + index],
+ type: data['source' + index + 'mime']
+ });
+ writer.start('source', attrs, true);
+ }
+ }
+ }
+ }
+ if (data.poster && name === 'object' && updateAll && !hasImage) {
+ var imgAttrs = [];
+ imgAttrs.map = {};
+ setAttributes(imgAttrs, {
+ src: data.poster,
+ width: data.width,
+ height: data.height
+ });
+ writer.start('img', imgAttrs, true);
+ }
+ writer.end(name);
</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.poster && name === 'object' && updateAll && !hasImage) {
- var imgAttrs = [];
- imgAttrs.map = {};
- setAttributes(imgAttrs, {
- src: data.poster,
- width: data.width,
- height: data.height
- });
- writer.start('img', imgAttrs, true);
- }
- writer.end(name);
- }
- }, global$7({})).parse(html);
- return writer.getContent();
- };
- var isEphoxEmbed$1 = function (html) {
- var fragment = DOM$1.createFragment(html);
- return DOM$1.getAttrib(fragment.firstChild, 'data-ephox-embed-iri') !== '';
- };
- var updateEphoxEmbed = function (html, data) {
- var fragment = DOM$1.createFragment(html);
- var div = fragment.firstChild;
- $_jbvx7h8jjgwecnx.setMaxWidth(div, data.width);
- $_jbvx7h8jjgwecnx.setMaxHeight(div, data.height);
- return normalizeHtml(div.outerHTML);
- };
- var updateHtml = function (html, data, updateAll) {
- return isEphoxEmbed$1(html) ? updateEphoxEmbed(html, data) : updateHtmlSax(html, data, updateAll);
- };
- var $_s3qkohdjjgwecon = { updateHtml: updateHtml };
-
- var urlPatterns = [
- {
- regex: /youtu\.be\/([\w\-_\?&=.]+)/i,
- type: 'iframe',
- w: 560,
- h: 314,
- url: '//www.youtube.com/embed/$1',
- allowFullscreen: true
- },
- {
- regex: /youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,
- type: 'iframe',
- w: 560,
- h: 314,
- url: '//www.youtube.com/embed/$2?$4',
- allowFullscreen: true
- },
- {
- regex: /youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,
- type: 'iframe',
- w: 560,
- h: 314,
- url: '//www.youtube.com/embed/$1',
- allowFullscreen: true
- },
- {
- regex: /vimeo\.com\/([0-9]+)/,
- type: 'iframe',
- w: 425,
- h: 350,
- url: '//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc',
- allowFullscreen: true
- },
- {
- regex: /vimeo\.com\/(.*)\/([0-9]+)/,
- type: 'iframe',
- w: 425,
- h: 350,
- url: '//player.vimeo.com/video/$2?title=0&byline=0',
- allowFullscreen: true
- },
- {
- regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,
- type: 'iframe',
- w: 425,
- h: 350,
- url: '//maps.google.com/maps/ms?msid=$2&output=embed"',
- allowFullscreen: false
- },
- {
- regex: /dailymotion\.com\/video\/([^_]+)/,
- type: 'iframe',
- w: 480,
- h: 270,
- url: '//www.dailymotion.com/embed/video/$1',
- allowFullscreen: true
- },
- {
- regex: /dai\.ly\/([^_]+)/,
- type: 'iframe',
- w: 480,
- h: 270,
- url: '//www.dailymotion.com/embed/video/$1',
- allowFullscreen: true
- }
- ];
- var getUrl = function (pattern, url) {
- var match = pattern.regex.exec(url);
- var newUrl = pattern.url;
- var _loop_1 = function (i) {
- newUrl = newUrl.replace('$' + i, function () {
- return match[i] ? match[i] : '';
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }, global$7({})).parse(html);
+ return writer.getContent();
</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 i = 0; i < match.length; i++) {
- _loop_1(i);
- }
- return newUrl.replace(/\?$/, '');
- };
- var matchPattern = function (url) {
- var pattern = urlPatterns.filter(function (pattern) {
- return pattern.regex.test(url);
- });
- if (pattern.length > 0) {
- return global$2.extend({}, pattern[0], { url: getUrl(pattern[0], url) });
- } else {
- return null;
- }
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isEphoxEmbed$1 = function (html) {
+ var fragment = DOM$1.createFragment(html);
+ return DOM$1.getAttrib(fragment.firstChild, 'data-ephox-embed-iri') !== '';
+ };
+ var updateEphoxEmbed = function (html, data) {
+ var fragment = DOM$1.createFragment(html);
+ var div = fragment.firstChild;
+ Size.setMaxWidth(div, data.width);
+ Size.setMaxHeight(div, data.height);
+ return normalizeHtml(div.outerHTML);
+ };
+ var updateHtml = function (html, data, updateAll) {
+ return isEphoxEmbed$1(html) ? updateEphoxEmbed(html, data) : updateHtmlSax(html, data, updateAll);
+ };
+ var UpdateHtml = { updateHtml: updateHtml };
</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 getIframeHtml = function (data) {
- var allowFullscreen = data.allowFullscreen ? ' allowFullscreen="1"' : '';
- return '<iframe src="' + data.source1 + '" width="' + data.width + '" height="' + data.height + '"' + allowFullscreen + '></iframe>';
- };
- var getFlashHtml = function (data) {
- var html = '<object data="' + data.source1 + '" width="' + data.width + '" height="' + data.height + '" type="application/x-shockwave-flash">';
- if (data.poster) {
- html += '<img src="' + data.poster + '" width="' + data.width + '" height="' + data.height + '" />';
- }
- html += '</object>';
- return html;
- };
- var getAudioHtml = function (data, audioTemplateCallback) {
- if (audioTemplateCallback) {
- return audioTemplateCallback(data);
- } else {
- return '<audio controls="controls" src="' + data.source1 + '">' + (data.source2 ? '\n<source src="' + data.source2 + '"' + (data.source2mime ? ' type="' + data.source2mime + '"' : '') + ' />\n' : '') + '</audio>';
- }
- };
- var getVideoHtml = function (data, videoTemplateCallback) {
- if (videoTemplateCallback) {
- return videoTemplateCallback(data);
- } else {
- return '<video width="' + data.width + '" height="' + data.height + '"' + (data.poster ? ' poster="' + data.poster + '"' : '') + ' controls="controls">\n' + '<source src="' + data.source1 + '"' + (data.source1mime ? ' type="' + data.source1mime + '"' : '') + ' />\n' + (data.source2 ? '<source src="' + data.source2 + '"' + (data.source2mime ? ' type="' + data.source2mime + '"' : '') + ' />\n' : '') + '</video>';
- }
- };
- var getScriptHtml = function (data) {
- return '<script src="' + data.source1 + '"></script>';
- };
- var dataToHtml = function (editor, dataIn) {
- var data = global$2.extend({}, dataIn);
- if (!data.source1) {
- global$2.extend(data, $_6mep3hh4jjgwecnt.htmlToData($_69rpmgh3jjgwecnr.getScripts(editor), data.embed));
- if (!data.source1) {
- return '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var urlPatterns = [
+ {
+ regex: /youtu\.be\/([\w\-_\?&=.]+)/i,
+ type: 'iframe',
+ w: 560,
+ h: 314,
+ url: '//www.youtube.com/embed/$1',
+ allowFullscreen: true
+ },
+ {
+ regex: /youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i,
+ type: 'iframe',
+ w: 560,
+ h: 314,
+ url: '//www.youtube.com/embed/$2?$4',
+ allowFullscreen: true
+ },
+ {
+ regex: /youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i,
+ type: 'iframe',
+ w: 560,
+ h: 314,
+ url: '//www.youtube.com/embed/$1',
+ allowFullscreen: true
+ },
+ {
+ regex: /vimeo\.com\/([0-9]+)/,
+ type: 'iframe',
+ w: 425,
+ h: 350,
+ url: '//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc',
+ allowFullscreen: true
+ },
+ {
+ regex: /vimeo\.com\/(.*)\/([0-9]+)/,
+ type: 'iframe',
+ w: 425,
+ h: 350,
+ url: '//player.vimeo.com/video/$2?title=0&byline=0',
+ allowFullscreen: true
+ },
+ {
+ regex: /maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,
+ type: 'iframe',
+ w: 425,
+ h: 350,
+ url: '//maps.google.com/maps/ms?msid=$2&output=embed"',
+ allowFullscreen: false
+ },
+ {
+ regex: /dailymotion\.com\/video\/([^_]+)/,
+ type: 'iframe',
+ w: 480,
+ h: 270,
+ url: '//www.dailymotion.com/embed/video/$1',
+ allowFullscreen: true
+ },
+ {
+ regex: /dai\.ly\/([^_]+)/,
+ type: 'iframe',
+ w: 480,
+ h: 270,
+ url: '//www.dailymotion.com/embed/video/$1',
+ allowFullscreen: 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 (!data.source2) {
- data.source2 = '';
- }
- if (!data.poster) {
- data.poster = '';
- }
- data.source1 = editor.convertURL(data.source1, 'source');
- data.source2 = editor.convertURL(data.source2, 'source');
- data.source1mime = $_d9gn6bhcjjgwecol.guess(data.source1);
- data.source2mime = $_d9gn6bhcjjgwecol.guess(data.source2);
- data.poster = editor.convertURL(data.poster, 'poster');
- var pattern = matchPattern(data.source1);
- if (pattern) {
- data.source1 = pattern.url;
- data.type = pattern.type;
- data.allowFullscreen = pattern.allowFullscreen;
- data.width = data.width || pattern.w;
- data.height = data.height || pattern.h;
- }
- if (data.embed) {
- return $_s3qkohdjjgwecon.updateHtml(data.embed, data, true);
- } else {
- var videoScript = $_4q3fmh7jjgwecnw.getVideoScriptMatch($_69rpmgh3jjgwecnr.getScripts(editor), data.source1);
- if (videoScript) {
- data.type = 'script';
- data.width = videoScript.width;
- data.height = videoScript.height;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ];
+ var getUrl = function (pattern, url) {
+ var match = pattern.regex.exec(url);
+ var newUrl = pattern.url;
+ var _loop_1 = function (i) {
+ newUrl = newUrl.replace('$' + i, function () {
+ return match[i] ? match[i] : '';
+ });
+ };
+ for (var i = 0; i < match.length; i++) {
+ _loop_1(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">- var audioTemplateCallback = $_69rpmgh3jjgwecnr.getAudioTemplateCallback(editor);
- var videoTemplateCallback = $_69rpmgh3jjgwecnr.getVideoTemplateCallback(editor);
- data.width = data.width || 300;
- data.height = data.height || 150;
- global$2.each(data, function (value, key) {
- data[key] = editor.dom.encode(value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return newUrl.replace(/\?$/, '');
+ };
+ var matchPattern = function (url) {
+ var pattern = urlPatterns.filter(function (pattern) {
+ return pattern.regex.test(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">- if (data.type === 'iframe') {
- return getIframeHtml(data);
- } else if (data.source1mime === 'application/x-shockwave-flash') {
- return getFlashHtml(data);
- } else if (data.source1mime.indexOf('audio') !== -1) {
- return getAudioHtml(data, audioTemplateCallback);
- } else if (data.type === 'script') {
- return getScriptHtml(data);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (pattern.length > 0) {
+ return global$2.extend({}, pattern[0], { url: getUrl(pattern[0], url) });
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return getVideoHtml(data, videoTemplateCallback);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- }
- };
- var $_bc7nlthbjjgwecoh = { dataToHtml: dataToHtml };
</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">- var cache = {};
- var embedPromise = function (data, dataToHtml, handler) {
- return new global$5(function (res, rej) {
- var wrappedResolve = function (response) {
- if (response.html) {
- cache[data.source1] = response;
- }
- return res({
- url: data.source1,
- html: response.html ? response.html : dataToHtml(data)
- });
- };
- if (cache[data.source1]) {
- wrappedResolve(cache[data.source1]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getIframeHtml = function (data) {
+ var allowFullscreen = data.allowFullscreen ? ' allowFullscreen="1"' : '';
+ return '<iframe src="' + data.source1 + '" width="' + data.width + '" height="' + data.height + '"' + allowFullscreen + '></iframe>';
+ };
+ var getFlashHtml = function (data) {
+ var html = '<object data="' + data.source1 + '" width="' + data.width + '" height="' + data.height + '" type="application/x-shockwave-flash">';
+ if (data.poster) {
+ html += '<img src="' + data.poster + '" width="' + data.width + '" height="' + data.height + '" />';
+ }
+ html += '</object>';
+ return html;
+ };
+ var getAudioHtml = function (data, audioTemplateCallback) {
+ if (audioTemplateCallback) {
+ return audioTemplateCallback(data);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- handler({ url: data.source1 }, wrappedResolve, rej);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return '<audio controls="controls" src="' + data.source1 + '">' + (data.source2 ? '\n<source src="' + data.source2 + '"' + (data.source2mime ? ' type="' + data.source2mime + '"' : '') + ' />\n' : '') + '</audio>';
</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 defaultPromise = function (data, dataToHtml) {
- return new global$5(function (res) {
- res({
- html: dataToHtml(data),
- url: data.source1
- });
- });
- };
- var loadedData = function (editor) {
- return function (data) {
- return $_bc7nlthbjjgwecoh.dataToHtml(editor, data);
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var getEmbedHtml = function (editor, data) {
- var embedHandler = $_69rpmgh3jjgwecnr.getUrlResolver(editor);
- return embedHandler ? embedPromise(data, loadedData(editor), embedHandler) : defaultPromise(data, loadedData(editor));
- };
- var isCached = function (url) {
- return cache.hasOwnProperty(url);
- };
- var $_cwvqyth9jjgweco9 = {
- getEmbedHtml: getEmbedHtml,
- isCached: isCached
- };
-
- var doSyncSize = function (widthCtrl, heightCtrl) {
- widthCtrl.state.set('oldVal', widthCtrl.value());
- heightCtrl.state.set('oldVal', heightCtrl.value());
- };
- var doSizeControls = function (win, f) {
- var widthCtrl = win.find('#width')[0];
- var heightCtrl = win.find('#height')[0];
- var constrained = win.find('#constrain')[0];
- if (widthCtrl && heightCtrl && constrained) {
- f(widthCtrl, heightCtrl, constrained.checked());
- }
- };
- var doUpdateSize = function (widthCtrl, heightCtrl, isContrained) {
- var oldWidth = widthCtrl.state.get('oldVal');
- var oldHeight = heightCtrl.state.get('oldVal');
- var newWidth = widthCtrl.value();
- var newHeight = heightCtrl.value();
- if (isContrained && oldWidth && oldHeight && newWidth && newHeight) {
- if (newWidth !== oldWidth) {
- newHeight = Math.round(newWidth / oldWidth * newHeight);
- if (!isNaN(newHeight)) {
- heightCtrl.value(newHeight);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getVideoHtml = function (data, videoTemplateCallback) {
+ if (videoTemplateCallback) {
+ return videoTemplateCallback(data);
+ } else {
+ return '<video width="' + data.width + '" height="' + data.height + '"' + (data.poster ? ' poster="' + data.poster + '"' : '') + ' controls="controls">\n' + '<source src="' + data.source1 + '"' + (data.source1mime ? ' type="' + data.source1mime + '"' : '') + ' />\n' + (data.source2 ? '<source src="' + data.source2 + '"' + (data.source2mime ? ' type="' + data.source2mime + '"' : '') + ' />\n' : '') + '</video>';
+ }
+ };
+ var getScriptHtml = function (data) {
+ return '<script src="' + data.source1 + '"></script>';
+ };
+ var dataToHtml = function (editor, dataIn) {
+ var data = global$2.extend({}, dataIn);
+ if (!data.source1) {
+ global$2.extend(data, HtmlToData.htmlToData(Settings.getScripts(editor), data.embed));
+ if (!data.source1) {
+ return '';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (!data.source2) {
+ data.source2 = '';
+ }
+ if (!data.poster) {
+ data.poster = '';
+ }
+ data.source1 = editor.convertURL(data.source1, 'source');
+ data.source2 = editor.convertURL(data.source2, 'source');
+ data.source1mime = Mime.guess(data.source1);
+ data.source2mime = Mime.guess(data.source2);
+ data.poster = editor.convertURL(data.poster, 'poster');
+ var pattern = matchPattern(data.source1);
+ if (pattern) {
+ data.source1 = pattern.url;
+ data.type = pattern.type;
+ data.allowFullscreen = pattern.allowFullscreen;
+ data.width = data.width || pattern.w;
+ data.height = data.height || pattern.h;
+ }
+ if (data.embed) {
+ return UpdateHtml.updateHtml(data.embed, data, true);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- newWidth = Math.round(newHeight / oldHeight * newWidth);
- if (!isNaN(newWidth)) {
- widthCtrl.value(newWidth);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var videoScript = VideoScript.getVideoScriptMatch(Settings.getScripts(editor), data.source1);
+ if (videoScript) {
+ data.type = 'script';
+ data.width = videoScript.width;
+ data.height = videoScript.height;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var audioTemplateCallback = Settings.getAudioTemplateCallback(editor);
+ var videoTemplateCallback = Settings.getVideoTemplateCallback(editor);
+ data.width = data.width || 300;
+ data.height = data.height || 150;
+ global$2.each(data, function (value, key) {
+ data[key] = editor.dom.encode(value);
+ });
+ if (data.type === 'iframe') {
+ return getIframeHtml(data);
+ } else if (data.source1mime === 'application/x-shockwave-flash') {
+ return getFlashHtml(data);
+ } else if (data.source1mime.indexOf('audio') !== -1) {
+ return getAudioHtml(data, audioTemplateCallback);
+ } else if (data.type === 'script') {
+ return getScriptHtml(data);
+ } else {
+ return getVideoHtml(data, videoTemplateCallback);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- doSyncSize(widthCtrl, heightCtrl);
- };
- var syncSize = function (win) {
- doSizeControls(win, doSyncSize);
- };
- var updateSize = function (win) {
- doSizeControls(win, doUpdateSize);
- };
- var createUi = function (onChange) {
- var recalcSize = function () {
- onChange(function (win) {
- updateSize(win);
- });
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return {
- type: 'container',
- label: 'Dimensions',
- layout: 'flex',
- align: 'center',
- spacing: 5,
- items: [
- {
- name: 'width',
- type: 'textbox',
- maxLength: 5,
- size: 5,
- onchange: recalcSize,
- ariaLabel: 'Width'
- },
- {
- type: 'label',
- text: 'x'
- },
- {
- name: 'height',
- type: 'textbox',
- maxLength: 5,
- size: 5,
- 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">+ var DataToHtml = { dataToHtml: dataToHtml };
+
+ var cache = {};
+ var embedPromise = function (data, dataToHtml, handler) {
+ return new global$5(function (res, rej) {
+ var wrappedResolve = function (response) {
+ if (response.html) {
+ cache[data.source1] = response;
+ }
+ return res({
+ url: data.source1,
+ html: response.html ? response.html : dataToHtml(data)
+ });
+ };
+ if (cache[data.source1]) {
+ wrappedResolve(cache[data.source1]);
+ } else {
+ handler({ url: data.source1 }, wrappedResolve, rej);
</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">+ });
</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 $_ewaahuhhjjgwecow = {
- createUi: createUi,
- syncSize: syncSize,
- updateSize: updateSize
- };
-
- var embedChange = global$1.ie && global$1.ie <= 8 ? 'onChange' : 'onInput';
- var handleError = function (editor) {
- return function (error) {
- var errorMessage = error && error.msg ? 'Media embed handler error: ' + error.msg : 'Media embed handler threw unknown error.';
- editor.notificationManager.open({
- type: 'error',
- text: errorMessage
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var defaultPromise = function (data, dataToHtml) {
+ return new global$5(function (res) {
+ res({
+ html: dataToHtml(data),
+ url: data.source1
+ });
</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">- };
- var getData = function (editor) {
- var element = editor.selection.getNode();
- var dataEmbed = element.getAttribute('data-ephox-embed-iri');
- if (dataEmbed) {
- return {
- 'source1': dataEmbed,
- 'data-ephox-embed-iri': dataEmbed,
- 'width': $_jbvx7h8jjgwecnx.getMaxWidth(element),
- 'height': $_jbvx7h8jjgwecnx.getMaxHeight(element)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var loadedData = function (editor) {
+ return function (data) {
+ return DataToHtml.dataToHtml(editor, 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 element.getAttribute('data-mce-object') ? $_6mep3hh4jjgwecnt.htmlToData($_69rpmgh3jjgwecnr.getScripts(editor), editor.serializer.serialize(element, { selection: true })) : {};
- };
- var getSource = function (editor) {
- var elm = editor.selection.getNode();
- if (elm.getAttribute('data-mce-object') || elm.getAttribute('data-ephox-embed-iri')) {
- return editor.selection.getContent();
- }
- };
- var addEmbedHtml = function (win, editor) {
- return function (response) {
- var html = response.html;
- var embed = win.find('#embed')[0];
- var data = global$2.extend($_6mep3hh4jjgwecnt.htmlToData($_69rpmgh3jjgwecnr.getScripts(editor), html), { source1: response.url });
- win.fromJSON(data);
- if (embed) {
- embed.value(html);
- $_ewaahuhhjjgwecow.updateSize(win);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var getEmbedHtml = function (editor, data) {
+ var embedHandler = Settings.getUrlResolver(editor);
+ return embedHandler ? embedPromise(data, loadedData(editor), embedHandler) : defaultPromise(data, loadedData(editor));
+ };
+ var isCached = function (url) {
+ return cache.hasOwnProperty(url);
+ };
+ var Service = {
+ getEmbedHtml: getEmbedHtml,
+ isCached: isCached
+ };
+
+ var doSyncSize = function (widthCtrl, heightCtrl) {
+ widthCtrl.state.set('oldVal', widthCtrl.value());
+ heightCtrl.state.set('oldVal', heightCtrl.value());
+ };
+ var doSizeControls = function (win, f) {
+ var widthCtrl = win.find('#width')[0];
+ var heightCtrl = win.find('#height')[0];
+ var constrained = win.find('#constrain')[0];
+ if (widthCtrl && heightCtrl && constrained) {
+ f(widthCtrl, heightCtrl, constrained.checked());
</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">- };
- var selectPlaceholder = function (editor, beforeObjects) {
- var i;
- var y;
- var afterObjects = editor.dom.select('img[data-mce-object]');
- for (i = 0; i < beforeObjects.length; i++) {
- for (y = afterObjects.length - 1; y >= 0; y--) {
- if (beforeObjects[i] === afterObjects[y]) {
- afterObjects.splice(y, 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var doUpdateSize = function (widthCtrl, heightCtrl, isContrained) {
+ var oldWidth = widthCtrl.state.get('oldVal');
+ var oldHeight = heightCtrl.state.get('oldVal');
+ var newWidth = widthCtrl.value();
+ var newHeight = heightCtrl.value();
+ if (isContrained && oldWidth && oldHeight && newWidth && newHeight) {
+ if (newWidth !== oldWidth) {
+ newHeight = Math.round(newWidth / oldWidth * newHeight);
+ if (!isNaN(newHeight)) {
+ heightCtrl.value(newHeight);
+ }
+ } else {
+ newWidth = Math.round(newHeight / oldHeight * newWidth);
+ if (!isNaN(newWidth)) {
+ widthCtrl.value(newWidth);
+ }
</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">- }
- editor.selection.select(afterObjects[0]);
- };
- var handleInsert = function (editor, html) {
- var beforeObjects = editor.dom.select('img[data-mce-object]');
- editor.insertContent(html);
- selectPlaceholder(editor, beforeObjects);
- editor.nodeChanged();
- };
- var submitForm = function (win, editor) {
- var data = win.toJSON();
- data.embed = $_s3qkohdjjgwecon.updateHtml(data.embed, data);
- if (data.embed && $_cwvqyth9jjgweco9.isCached(data.source1)) {
- handleInsert(editor, data.embed);
- } else {
- $_cwvqyth9jjgweco9.getEmbedHtml(editor, data).then(function (response) {
- handleInsert(editor, response.html);
- }).catch(handleError(editor));
- }
- };
- var populateMeta = function (win, meta) {
- global$2.each(meta, function (value, key) {
- win.find('#' + key).value(value);
- });
- };
- var showDialog = function (editor) {
- var win;
- var data;
- var generalFormItems = [{
- name: 'source1',
- type: 'filepicker',
- filetype: 'media',
- size: 40,
- autofocus: true,
- label: 'Source',
- onpaste: function () {
- setTimeout(function () {
- $_cwvqyth9jjgweco9.getEmbedHtml(editor, win.toJSON()).then(addEmbedHtml(win, editor)).catch(handleError(editor));
- }, 1);
- },
- onchange: function (e) {
- $_cwvqyth9jjgweco9.getEmbedHtml(editor, win.toJSON()).then(addEmbedHtml(win, editor)).catch(handleError(editor));
- populateMeta(win, e.meta);
- },
- onbeforecall: function (e) {
- e.meta = win.toJSON();
- }
- }];
- var advancedFormItems = [];
- var reserialise = function (update) {
- update(win);
- data = win.toJSON();
- win.find('#embed').value($_s3qkohdjjgwecon.updateHtml(data.embed, data));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ doSyncSize(widthCtrl, heightCtrl);
</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 ($_69rpmgh3jjgwecnr.hasAltSource(editor)) {
- advancedFormItems.push({
- name: 'source2',
- type: 'filepicker',
- filetype: 'media',
- size: 40,
- label: 'Alternative source'
- });
- }
- if ($_69rpmgh3jjgwecnr.hasPoster(editor)) {
- advancedFormItems.push({
- name: 'poster',
- type: 'filepicker',
- filetype: 'image',
- size: 40,
- label: 'Poster'
- });
- }
- if ($_69rpmgh3jjgwecnr.hasDimensions(editor)) {
- var control = $_ewaahuhhjjgwecow.createUi(reserialise);
- generalFormItems.push(control);
- }
- data = getData(editor);
- var embedTextBox = {
- id: 'mcemediasource',
- type: 'textbox',
- flex: 1,
- name: 'embed',
- value: getSource(editor),
- multiline: true,
- rows: 5,
- label: 'Source'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var syncSize = function (win) {
+ doSizeControls(win, doSyncSize);
</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 updateValueOnChange = function () {
- data = global$2.extend({}, $_6mep3hh4jjgwecnt.htmlToData($_69rpmgh3jjgwecnr.getScripts(editor), this.value()));
- this.parent().parent().fromJSON(data);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var updateSize = function (win) {
+ doSizeControls(win, doUpdateSize);
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- embedTextBox[embedChange] = updateValueOnChange;
- var body = [
- {
- title: 'General',
- type: 'form',
- items: generalFormItems
- },
- {
- title: 'Embed',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createUi = function (onChange) {
+ var recalcSize = function () {
+ onChange(function (win) {
+ updateSize(win);
+ });
+ };
+ return {
</ins><span class="cx" style="display: block; padding: 0 10px"> type: 'container',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ label: 'Dimensions',
</ins><span class="cx" style="display: block; padding: 0 10px"> layout: 'flex',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- direction: 'column',
- align: 'stretch',
- padding: 10,
- spacing: 10,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ align: 'center',
+ spacing: 5,
</ins><span class="cx" style="display: block; padding: 0 10px"> items: [
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ name: 'width',
+ type: 'textbox',
+ maxLength: 5,
+ size: 5,
+ onchange: recalcSize,
+ ariaLabel: 'Width'
+ },
+ {
</ins><span class="cx" style="display: block; padding: 0 10px"> type: 'label',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- text: 'Paste your embed code below:',
- forId: 'mcemediasource'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ text: 'x'
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- embedTextBox
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ {
+ name: 'height',
+ type: 'textbox',
+ maxLength: 5,
+ size: 5,
+ onchange: recalcSize,
+ ariaLabel: 'Height'
+ },
+ {
+ name: 'constrain',
+ type: 'checkbox',
+ checked: true,
+ text: 'Constrain proportions'
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> ]
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ };
+ var SizeManager = {
+ createUi: createUi,
+ syncSize: syncSize,
+ updateSize: updateSize
+ };
+
+ var embedChange = global$1.ie && global$1.ie <= 8 ? 'onChange' : 'onInput';
+ var handleError = function (editor) {
+ return function (error) {
+ var errorMessage = error && error.msg ? 'Media embed handler error: ' + error.msg : 'Media embed handler threw unknown error.';
+ editor.notificationManager.open({
+ type: 'error',
+ text: errorMessage
+ });
+ };
+ };
+ var getData = function (editor) {
+ var element = editor.selection.getNode();
+ var dataEmbed = element.getAttribute('data-ephox-embed-iri');
+ if (dataEmbed) {
+ return {
+ 'source1': dataEmbed,
+ 'data-ephox-embed-iri': dataEmbed,
+ 'width': Size.getMaxWidth(element),
+ 'height': Size.getMaxHeight(element)
+ };
</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 (advancedFormItems.length > 0) {
- body.push({
- title: 'Advanced',
- type: 'form',
- items: advancedFormItems
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return element.getAttribute('data-mce-object') ? HtmlToData.htmlToData(Settings.getScripts(editor), editor.serializer.serialize(element, { selection: true })) : {};
+ };
+ var getSource = function (editor) {
+ var elm = editor.selection.getNode();
+ if (elm.getAttribute('data-mce-object') || elm.getAttribute('data-ephox-embed-iri')) {
+ return editor.selection.getContent();
+ }
+ };
+ var addEmbedHtml = function (win, editor) {
+ return function (response) {
+ var html = response.html;
+ var embed = win.find('#embed')[0];
+ var data = global$2.extend(HtmlToData.htmlToData(Settings.getScripts(editor), html), { source1: response.url });
+ win.fromJSON(data);
+ if (embed) {
+ embed.value(html);
+ SizeManager.updateSize(win);
+ }
+ };
+ };
+ var selectPlaceholder = function (editor, beforeObjects) {
+ var i;
+ var y;
+ var afterObjects = editor.dom.select('img[data-mce-object]');
+ for (i = 0; i < beforeObjects.length; i++) {
+ for (y = afterObjects.length - 1; y >= 0; y--) {
+ if (beforeObjects[i] === afterObjects[y]) {
+ afterObjects.splice(y, 1);
+ }
+ }
+ }
+ editor.selection.select(afterObjects[0]);
+ };
+ var handleInsert = function (editor, html) {
+ var beforeObjects = editor.dom.select('img[data-mce-object]');
+ editor.insertContent(html);
+ selectPlaceholder(editor, beforeObjects);
+ editor.nodeChanged();
+ };
+ var submitForm = function (win, editor) {
+ var data = win.toJSON();
+ data.embed = UpdateHtml.updateHtml(data.embed, data);
+ if (data.embed && Service.isCached(data.source1)) {
+ handleInsert(editor, data.embed);
+ } else {
+ Service.getEmbedHtml(editor, data).then(function (response) {
+ handleInsert(editor, response.html);
+ }).catch(handleError(editor));
+ }
+ };
+ var populateMeta = function (win, meta) {
+ global$2.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">- }
- win = editor.windowManager.open({
- title: 'Insert/edit media',
- data: data,
- bodyType: 'tabpanel',
- body: body,
- onSubmit: function () {
- $_ewaahuhhjjgwecow.updateSize(win);
- submitForm(win, editor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var showDialog = function (editor) {
+ var win;
+ var data;
+ var generalFormItems = [{
+ name: 'source1',
+ type: 'filepicker',
+ filetype: 'media',
+ size: 40,
+ autofocus: true,
+ label: 'Source',
+ onpaste: function () {
+ setTimeout(function () {
+ Service.getEmbedHtml(editor, win.toJSON()).then(addEmbedHtml(win, editor)).catch(handleError(editor));
+ }, 1);
+ },
+ onchange: function (e) {
+ Service.getEmbedHtml(editor, win.toJSON()).then(addEmbedHtml(win, editor)).catch(handleError(editor));
+ populateMeta(win, e.meta);
+ },
+ onbeforecall: function (e) {
+ e.meta = win.toJSON();
+ }
+ }];
+ var advancedFormItems = [];
+ var reserialise = function (update) {
+ update(win);
+ data = win.toJSON();
+ win.find('#embed').value(UpdateHtml.updateHtml(data.embed, data));
+ };
+ if (Settings.hasAltSource(editor)) {
+ advancedFormItems.push({
+ name: 'source2',
+ type: 'filepicker',
+ filetype: 'media',
+ size: 40,
+ label: 'Alternative source'
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- $_ewaahuhhjjgwecow.syncSize(win);
- };
- var $_e3lvjbh0jjgwecnm = { showDialog: showDialog };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (Settings.hasPoster(editor)) {
+ advancedFormItems.push({
+ name: 'poster',
+ type: 'filepicker',
+ filetype: 'image',
+ size: 40,
+ label: 'Poster'
+ });
+ }
+ if (Settings.hasDimensions(editor)) {
+ var control = SizeManager.createUi(reserialise);
+ generalFormItems.push(control);
+ }
+ data = getData(editor);
+ var embedTextBox = {
+ id: 'mcemediasource',
+ type: 'textbox',
+ flex: 1,
+ name: 'embed',
+ value: getSource(editor),
+ multiline: true,
+ rows: 5,
+ label: 'Source'
+ };
+ var updateValueOnChange = function () {
+ data = global$2.extend({}, HtmlToData.htmlToData(Settings.getScripts(editor), this.value()));
+ this.parent().parent().fromJSON(data);
+ };
+ embedTextBox[embedChange] = updateValueOnChange;
+ var body = [
+ {
+ title: 'General',
+ type: 'form',
+ items: generalFormItems
+ },
+ {
+ title: 'Embed',
+ type: 'container',
+ layout: 'flex',
+ direction: 'column',
+ align: 'stretch',
+ padding: 10,
+ spacing: 10,
+ items: [
+ {
+ type: 'label',
+ text: 'Paste your embed code below:',
+ forId: 'mcemediasource'
+ },
+ embedTextBox
+ ]
+ }
+ ];
+ if (advancedFormItems.length > 0) {
+ body.push({
+ title: 'Advanced',
+ type: 'form',
+ items: advancedFormItems
+ });
+ }
+ win = editor.windowManager.open({
+ title: 'Insert/edit media',
+ data: data,
+ bodyType: 'tabpanel',
+ body: body,
+ onSubmit: function () {
+ SizeManager.updateSize(win);
+ submitForm(win, editor);
+ }
+ });
+ SizeManager.syncSize(win);
+ };
+ var Dialog = { showDialog: showDialog };
</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 get = function (editor) {
- var showDialog = function () {
- $_e3lvjbh0jjgwecnm.showDialog(editor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var get = function (editor) {
+ var showDialog = function () {
+ Dialog.showDialog(editor);
+ };
+ return { showDialog: showDialog };
</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 { showDialog: showDialog };
- };
- var $_9lh0mgzjjgwecnk = { get: get };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Api = { get: get };
</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 register = function (editor) {
- var showDialog = function () {
- $_e3lvjbh0jjgwecnm.showDialog(editor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register = function (editor) {
+ var showDialog = function () {
+ Dialog.showDialog(editor);
+ };
+ editor.addCommand('mceMedia', showDialog);
</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('mceMedia', showDialog);
- };
- var $_3pne6fhijjgwecoz = { register: register };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Commands = { register: register };
</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 global$8 = tinymce.util.Tools.resolve('tinymce.html.Node');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$8 = tinymce.util.Tools.resolve('tinymce.html.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 sanitize = function (editor, html) {
- if ($_69rpmgh3jjgwecnr.shouldFilterHtml(editor) === false) {
- return html;
- }
- var writer = global$6();
- var blocked;
- global$3({
- validate: false,
- allow_conditional_comments: false,
- special: 'script,noscript',
- comment: function (text) {
- writer.comment(text);
- },
- cdata: function (text) {
- writer.cdata(text);
- },
- text: function (text, raw) {
- writer.text(text, raw);
- },
- start: function (name, attrs, empty) {
- blocked = true;
- if (name === 'script' || name === 'noscript') {
- return;
- }
- for (var i = 0; i < attrs.length; i++) {
- if (attrs[i].name.indexOf('on') === 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var sanitize = function (editor, html) {
+ if (Settings.shouldFilterHtml(editor) === false) {
+ return html;
+ }
+ var writer = global$6();
+ var blocked;
+ global$3({
+ validate: false,
+ allow_conditional_comments: false,
+ special: 'script,noscript',
+ comment: function (text) {
+ writer.comment(text);
+ },
+ cdata: function (text) {
+ writer.cdata(text);
+ },
+ text: function (text, raw) {
+ writer.text(text, raw);
+ },
+ start: function (name, attrs, empty) {
+ blocked = true;
+ if (name === 'script' || name === 'noscript') {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (attrs[i].name === 'style') {
- attrs[i].value = editor.dom.serializeStyle(editor.dom.parseStyle(attrs[i].value), name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (var i = 0; i < attrs.length; i++) {
+ if (attrs[i].name.indexOf('on') === 0) {
+ return;
+ }
+ if (attrs[i].name === 'style') {
+ attrs[i].value = editor.dom.serializeStyle(editor.dom.parseStyle(attrs[i].value), name);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ writer.start(name, attrs, empty);
+ blocked = false;
+ },
+ end: function (name) {
+ if (blocked) {
+ return;
+ }
+ writer.end(name);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- writer.start(name, attrs, empty);
- blocked = false;
- },
- end: function (name) {
- if (blocked) {
- return;
- }
- writer.end(name);
- }
- }, global$7({})).parse(html);
- return writer.getContent();
- };
- var $_58i2qvhmjjgwecp7 = { sanitize: sanitize };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }, global$7({})).parse(html);
+ return writer.getContent();
+ };
+ var Sanitize = { sanitize: sanitize };
</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 createPlaceholderNode = function (editor, node) {
- var placeHolder;
- var name = node.name;
- placeHolder = new global$8('img', 1);
- placeHolder.shortEnded = true;
- retainAttributesAndInnerHtml(editor, node, placeHolder);
- placeHolder.attr({
- 'width': node.attr('width') || '300',
- 'height': node.attr('height') || (name === 'audio' ? '30' : '150'),
- 'style': node.attr('style'),
- 'src': global$1.transparentSrc,
- 'data-mce-object': name,
- 'class': 'mce-object mce-object-' + name
- });
- return placeHolder;
- };
- var createPreviewIframeNode = function (editor, node) {
- var previewWrapper;
- var previewNode;
- var shimNode;
- var name = node.name;
- previewWrapper = new global$8('span', 1);
- previewWrapper.attr({
- 'contentEditable': 'false',
- 'style': node.attr('style'),
- 'data-mce-object': name,
- 'class': 'mce-preview-object mce-object-' + name
- });
- retainAttributesAndInnerHtml(editor, node, previewWrapper);
- previewNode = new global$8(name, 1);
- previewNode.attr({
- src: node.attr('src'),
- allowfullscreen: node.attr('allowfullscreen'),
- style: node.attr('style'),
- class: node.attr('class'),
- width: node.attr('width'),
- height: node.attr('height'),
- frameborder: '0'
- });
- shimNode = new global$8('span', 1);
- shimNode.attr('class', 'mce-shim');
- previewWrapper.append(previewNode);
- previewWrapper.append(shimNode);
- return previewWrapper;
- };
- var retainAttributesAndInnerHtml = function (editor, sourceNode, targetNode) {
- var attrName;
- var attrValue;
- var attribs;
- var ai;
- var innerHtml;
- attribs = sourceNode.attributes;
- ai = attribs.length;
- while (ai--) {
- attrName = attribs[ai].name;
- attrValue = attribs[ai].value;
- if (attrName !== 'width' && attrName !== 'height' && attrName !== 'style') {
- if (attrName === 'data' || attrName === 'src') {
- attrValue = editor.convertURL(attrValue, attrName);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createPlaceholderNode = function (editor, node) {
+ var placeHolder;
+ var name = node.name;
+ placeHolder = new global$8('img', 1);
+ placeHolder.shortEnded = true;
+ retainAttributesAndInnerHtml(editor, node, placeHolder);
+ placeHolder.attr({
+ 'width': node.attr('width') || '300',
+ 'height': node.attr('height') || (name === 'audio' ? '30' : '150'),
+ 'style': node.attr('style'),
+ 'src': global$1.transparentSrc,
+ 'data-mce-object': name,
+ 'class': 'mce-object mce-object-' + name
+ });
+ return placeHolder;
+ };
+ var createPreviewIframeNode = function (editor, node) {
+ var previewWrapper;
+ var previewNode;
+ var shimNode;
+ var name = node.name;
+ previewWrapper = new global$8('span', 1);
+ previewWrapper.attr({
+ 'contentEditable': 'false',
+ 'style': node.attr('style'),
+ 'data-mce-object': name,
+ 'class': 'mce-preview-object mce-object-' + name
+ });
+ retainAttributesAndInnerHtml(editor, node, previewWrapper);
+ previewNode = new global$8(name, 1);
+ previewNode.attr({
+ src: node.attr('src'),
+ allowfullscreen: node.attr('allowfullscreen'),
+ style: node.attr('style'),
+ class: node.attr('class'),
+ width: node.attr('width'),
+ height: node.attr('height'),
+ frameborder: '0'
+ });
+ shimNode = new global$8('span', 1);
+ shimNode.attr('class', 'mce-shim');
+ previewWrapper.append(previewNode);
+ previewWrapper.append(shimNode);
+ return previewWrapper;
+ };
+ var retainAttributesAndInnerHtml = function (editor, sourceNode, targetNode) {
+ var attrName;
+ var attrValue;
+ var attribs;
+ var ai;
+ var innerHtml;
+ attribs = sourceNode.attributes;
+ ai = attribs.length;
+ while (ai--) {
+ attrName = attribs[ai].name;
+ attrValue = attribs[ai].value;
+ if (attrName !== 'width' && attrName !== 'height' && attrName !== 'style') {
+ if (attrName === 'data' || attrName === 'src') {
+ attrValue = editor.convertURL(attrValue, attrName);
+ }
+ targetNode.attr('data-mce-p-' + attrName, attrValue);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- targetNode.attr('data-mce-p-' + attrName, attrValue);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- innerHtml = sourceNode.firstChild && sourceNode.firstChild.value;
- if (innerHtml) {
- targetNode.attr('data-mce-html', escape($_58i2qvhmjjgwecp7.sanitize(editor, innerHtml)));
- targetNode.firstChild = null;
- }
- };
- var isWithinEphoxEmbed = function (node) {
- while (node = node.parent) {
- if (node.attr('data-ephox-embed-iri')) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ innerHtml = sourceNode.firstChild && sourceNode.firstChild.value;
+ if (innerHtml) {
+ targetNode.attr('data-mce-html', escape(Sanitize.sanitize(editor, innerHtml)));
+ targetNode.firstChild = 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 false;
- };
- var placeHolderConverter = function (editor) {
- return function (nodes) {
- var i = nodes.length;
- var node;
- var videoScript;
- while (i--) {
- node = nodes[i];
- if (!node.parent) {
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var isWithinEphoxEmbed = function (node) {
+ while (node = node.parent) {
+ if (node.attr('data-ephox-embed-iri')) {
+ 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 (node.parent.attr('data-mce-object')) {
- continue;
- }
- if (node.name === 'script') {
- videoScript = $_4q3fmh7jjgwecnw.getVideoScriptMatch($_69rpmgh3jjgwecnr.getScripts(editor), node.attr('src'));
- if (!videoScript) {
- continue;
- }
- }
- if (videoScript) {
- if (videoScript.width) {
- node.attr('width', videoScript.width.toString());
- }
- if (videoScript.height) {
- node.attr('height', videoScript.height.toString());
- }
- }
- if (node.name === 'iframe' && $_69rpmgh3jjgwecnr.hasLiveEmbeds(editor) && global$1.ceFalse) {
- if (!isWithinEphoxEmbed(node)) {
- node.replace(createPreviewIframeNode(editor, node));
- }
- } else {
- if (!isWithinEphoxEmbed(node)) {
- node.replace(createPlaceholderNode(editor, node));
- }
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><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 $_ggjz3ehljjgwecp4 = {
- createPreviewIframeNode: createPreviewIframeNode,
- createPlaceholderNode: createPlaceholderNode,
- placeHolderConverter: placeHolderConverter
- };
-
- var setup = function (editor) {
- editor.on('preInit', function () {
- var specialElements = editor.schema.getSpecialElements();
- global$2.each('video audio iframe object'.split(' '), function (name) {
- specialElements[name] = new RegExp('</' + name + '[^>]*>', 'gi');
- });
- var boolAttrs = editor.schema.getBoolAttrs();
- global$2.each('webkitallowfullscreen mozallowfullscreen allowfullscreen'.split(' '), function (name) {
- boolAttrs[name] = {};
- });
- editor.parser.addNodeFilter('iframe,video,audio,object,embed,script', $_ggjz3ehljjgwecp4.placeHolderConverter(editor));
- editor.serializer.addAttributeFilter('data-mce-object', function (nodes, name) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var placeHolderConverter = function (editor) {
+ return function (nodes) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var i = nodes.length;
</span><span class="cx" style="display: block; padding: 0 10px"> var node;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var realElm;
- var ai;
- var attribs;
- var innerHtml;
- var innerNode;
- var realElmName;
- var className;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var videoScript;
</ins><span class="cx" style="display: block; padding: 0 10px"> while (i--) {
</span><span class="cx" style="display: block; padding: 0 10px"> node = nodes[i];
</span><span class="cx" style="display: block; padding: 0 10px"> if (!node.parent) {
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- realElmName = node.attr(name);
- realElm = new global$8(realElmName, 1);
- if (realElmName !== 'audio' && realElmName !== 'script') {
- className = node.attr('class');
- if (className && className.indexOf('mce-preview-object') !== -1) {
- realElm.attr({
- width: node.firstChild.attr('width'),
- height: node.firstChild.attr('height')
- });
- } else {
- realElm.attr({
- width: node.attr('width'),
- height: node.attr('height')
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (node.parent.attr('data-mce-object')) {
+ continue;
+ }
+ if (node.name === 'script') {
+ videoScript = VideoScript.getVideoScriptMatch(Settings.getScripts(editor), node.attr('src'));
+ if (!videoScript) {
+ continue;
</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">- realElm.attr({ style: node.attr('style') });
- attribs = node.attributes;
- ai = attribs.length;
- while (ai--) {
- var attrName = attribs[ai].name;
- if (attrName.indexOf('data-mce-p-') === 0) {
- realElm.attr(attrName.substr(11), attribs[ai].value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (videoScript) {
+ if (videoScript.width) {
+ node.attr('width', videoScript.width.toString());
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (videoScript.height) {
+ node.attr('height', videoScript.height.toString());
+ }
</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 (realElmName === 'script') {
- realElm.attr('type', 'text/javascript');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (node.name === 'iframe' && Settings.hasLiveEmbeds(editor) && global$1.ceFalse) {
+ if (!isWithinEphoxEmbed(node)) {
+ node.replace(createPreviewIframeNode(editor, node));
+ }
+ } else {
+ if (!isWithinEphoxEmbed(node)) {
+ node.replace(createPlaceholderNode(editor, 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">- innerHtml = node.attr('data-mce-html');
- if (innerHtml) {
- innerNode = new global$8('#text', 3);
- innerNode.raw = true;
- innerNode.value = $_58i2qvhmjjgwecp7.sanitize(editor, unescape(innerHtml));
- realElm.append(innerNode);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ };
+ };
+ var Nodes = {
+ createPreviewIframeNode: createPreviewIframeNode,
+ createPlaceholderNode: createPlaceholderNode,
+ placeHolderConverter: placeHolderConverter
+ };
+
+ var setup = function (editor) {
+ editor.on('preInit', function () {
+ var specialElements = editor.schema.getSpecialElements();
+ global$2.each('video audio iframe object'.split(' '), function (name) {
+ specialElements[name] = new RegExp('</' + name + '[^>]*>', 'gi');
+ });
+ var boolAttrs = editor.schema.getBoolAttrs();
+ global$2.each('webkitallowfullscreen mozallowfullscreen allowfullscreen'.split(' '), function (name) {
+ boolAttrs[name] = {};
+ });
+ editor.parser.addNodeFilter('iframe,video,audio,object,embed,script', Nodes.placeHolderConverter(editor));
+ editor.serializer.addAttributeFilter('data-mce-object', function (nodes, name) {
+ var i = nodes.length;
+ var node;
+ var realElm;
+ var ai;
+ var attribs;
+ var innerHtml;
+ var innerNode;
+ var realElmName;
+ var className;
+ while (i--) {
+ node = nodes[i];
+ if (!node.parent) {
+ continue;
+ }
+ realElmName = node.attr(name);
+ realElm = new global$8(realElmName, 1);
+ if (realElmName !== 'audio' && realElmName !== 'script') {
+ className = node.attr('class');
+ if (className && className.indexOf('mce-preview-object') !== -1) {
+ realElm.attr({
+ width: node.firstChild.attr('width'),
+ height: node.firstChild.attr('height')
+ });
+ } else {
+ realElm.attr({
+ width: node.attr('width'),
+ height: node.attr('height')
+ });
+ }
+ }
+ realElm.attr({ style: node.attr('style') });
+ attribs = node.attributes;
+ ai = attribs.length;
+ while (ai--) {
+ var attrName = attribs[ai].name;
+ if (attrName.indexOf('data-mce-p-') === 0) {
+ realElm.attr(attrName.substr(11), attribs[ai].value);
+ }
+ }
+ if (realElmName === 'script') {
+ realElm.attr('type', 'text/javascript');
+ }
+ innerHtml = node.attr('data-mce-html');
+ if (innerHtml) {
+ innerNode = new global$8('#text', 3);
+ innerNode.raw = true;
+ innerNode.value = Sanitize.sanitize(editor, unescape(innerHtml));
+ realElm.append(innerNode);
+ }
+ node.replace(realElm);
</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.replace(realElm);
- }
</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('setContent', function () {
- editor.$('span.mce-preview-object').each(function (index, elm) {
- var $elm = editor.$(elm);
- if ($elm.find('span.mce-shim', elm).length === 0) {
- $elm.append('<span class="mce-shim"></span>');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('setContent', function () {
+ editor.$('span.mce-preview-object').each(function (index, elm) {
+ var $elm = editor.$(elm);
+ if ($elm.find('span.mce-shim', elm).length === 0) {
+ $elm.append('<span class="mce-shim"></span>');
+ }
+ });
+ });
+ };
+ var FilterContent = { setup: setup };
+
+ var setup$1 = function (editor) {
+ editor.on('ResolveName', function (e) {
+ var name;
+ if (e.target.nodeType === 1 && (name = e.target.getAttribute('data-mce-object'))) {
+ e.name = name;
</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">- });
- };
- var $_4o7ga9hjjjgwecp0 = { setup: setup };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var ResolveName = { setup: setup$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">- var setup$1 = function (editor) {
- editor.on('ResolveName', function (e) {
- var name;
- if (e.target.nodeType === 1 && (name = e.target.getAttribute('data-mce-object'))) {
- e.name = name;
- }
- });
- };
- var $_1y6lb6hnjjgwecp9 = { setup: setup$1 };
-
- var setup$2 = function (editor) {
- editor.on('click keyup', function () {
- var selectedNode = editor.selection.getNode();
- if (selectedNode && editor.dom.hasClass(selectedNode, 'mce-preview-object')) {
- if (editor.dom.getAttrib(selectedNode, 'data-mce-selected')) {
- selectedNode.setAttribute('data-mce-selected', '2');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setup$2 = function (editor) {
+ editor.on('click keyup', function () {
+ var selectedNode = editor.selection.getNode();
+ if (selectedNode && editor.dom.hasClass(selectedNode, 'mce-preview-object')) {
+ if (editor.dom.getAttrib(selectedNode, 'data-mce-selected')) {
+ selectedNode.setAttribute('data-mce-selected', '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">- }
- });
- editor.on('ObjectSelected', function (e) {
- var objectType = e.target.getAttribute('data-mce-object');
- if (objectType === 'audio' || objectType === 'script') {
- e.preventDefault();
- }
- });
- editor.on('objectResized', function (e) {
- var target = e.target;
- var html;
- if (target.getAttribute('data-mce-object')) {
- html = target.getAttribute('data-mce-html');
- if (html) {
- html = unescape(html);
- target.setAttribute('data-mce-html', escape($_s3qkohdjjgwecon.updateHtml(html, {
- width: e.width,
- height: e.height
- })));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ editor.on('ObjectSelected', function (e) {
+ var objectType = e.target.getAttribute('data-mce-object');
+ if (objectType === 'audio' || objectType === 'script') {
+ e.preventDefault();
</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 $_dnm1d2hojjgwecpa = { setup: setup$2 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ editor.on('objectResized', function (e) {
+ var target = e.target;
+ var html;
+ if (target.getAttribute('data-mce-object')) {
+ html = target.getAttribute('data-mce-html');
+ if (html) {
+ html = unescape(html);
+ target.setAttribute('data-mce-html', escape(UpdateHtml.updateHtml(html, {
+ width: e.width,
+ height: e.height
+ })));
+ }
+ }
+ });
+ };
+ var Selection = { setup: setup$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">- var register$1 = function (editor) {
- editor.addButton('media', {
- tooltip: 'Insert/edit media',
- cmd: 'mceMedia',
- stateSelector: [
- 'img[data-mce-object]',
- 'span[data-mce-object]',
- 'div[data-ephox-embed-iri]'
- ]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register$1 = function (editor) {
+ editor.addButton('media', {
+ tooltip: 'Insert/edit media',
+ cmd: 'mceMedia',
+ stateSelector: [
+ 'img[data-mce-object]',
+ 'span[data-mce-object]',
+ 'div[data-ephox-embed-iri]'
+ ]
+ });
+ editor.addMenuItem('media', {
+ icon: 'media',
+ text: 'Media',
+ cmd: 'mceMedia',
+ context: 'insert',
+ prependToContext: true
+ });
+ };
+ var Buttons = { register: register$1 };
+
+ global.add('media', function (editor) {
+ Commands.register(editor);
+ Buttons.register(editor);
+ ResolveName.setup(editor);
+ FilterContent.setup(editor);
+ Selection.setup(editor);
+ return Api.get(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">- editor.addMenuItem('media', {
- icon: 'media',
- text: 'Media',
- cmd: 'mceMedia',
- context: 'insert',
- prependToContext: true
- });
- };
- var $_94c7u1hpjjgwecpc = { register: register$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function Plugin () {
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global.add('media', function (editor) {
- $_3pne6fhijjgwecoz.register(editor);
- $_94c7u1hpjjgwecpc.register(editor);
- $_1y6lb6hnjjgwecp9.setup(editor);
- $_4o7ga9hjjjgwecp0.setup(editor);
- $_dnm1d2hojjgwecpa.setup(editor);
- return $_9lh0mgzjjgwecnk.get(editor);
- });
- function Plugin () {
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Plugin;
</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 Plugin;
-
</del><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="trunksrcjs_enqueuesvendortinymcepluginspastepluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/plugins/paste/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/plugins/paste/plugin.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/plugins/paste/plugin.js 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,1497 +1,1858 @@
</span><span class="cx" style="display: block; padding: 0 10px"> (function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var paste = (function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'use strict';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'use strict';
</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 Cell = function (initial) {
- var value = initial;
- var get = function () {
- return value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Cell = function (initial) {
+ var value = initial;
+ var get = function () {
+ return value;
+ };
+ var set = function (v) {
+ value = v;
+ };
+ var clone = function () {
+ return Cell(get());
+ };
+ return {
+ get: get,
+ set: set,
+ clone: clone
+ };
</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 set = function (v) {
- value = v;
- };
- var clone = function () {
- return Cell(get());
- };
- return {
- get: get,
- set: set,
- clone: clone
- };
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global = tinymce.util.Tools.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">- var hasProPlugin = function (editor) {
- if (/(^|[ ,])powerpaste([, ]|$)/.test(editor.settings.plugins) && global.get('powerpaste')) {
- if (typeof window.console !== 'undefined' && window.console.log) {
- window.console.log('PowerPaste is incompatible with Paste plugin! Remove \'paste\' from the \'plugins\' option.');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasProPlugin = function (editor) {
+ if (/(^|[ ,])powerpaste([, ]|$)/.test(editor.settings.plugins) && global.get('powerpaste')) {
+ if (typeof window.console !== 'undefined' && window.console.log) {
+ window.console.log('PowerPaste is incompatible with Paste plugin! Remove \'paste\' from the \'plugins\' option.');
+ }
+ return true;
+ } else {
+ 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 true;
- } else {
- return false;
- }
- };
- var $_15bf6siejjgwect1 = { hasProPlugin: hasProPlugin };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var DetectProPlugin = { hasProPlugin: hasProPlugin };
</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 get = function (clipboard, quirks) {
- return {
- clipboard: clipboard,
- quirks: quirks
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var get = function (clipboard, quirks) {
+ return {
+ clipboard: clipboard,
+ quirks: quirks
+ };
</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 $_6gtliyigjjgwecte = { get: get };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Api = { get: get };
</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 firePastePreProcess = function (editor, html, internal, isWordHtml) {
- return editor.fire('PastePreProcess', {
- content: html,
- internal: internal,
- wordContent: isWordHtml
- });
- };
- var firePastePostProcess = function (editor, node, internal, isWordHtml) {
- return editor.fire('PastePostProcess', {
- node: node,
- internal: internal,
- wordContent: isWordHtml
- });
- };
- var firePastePlainTextToggle = function (editor, state) {
- return editor.fire('PastePlainTextToggle', { state: state });
- };
- var firePaste = function (editor, ieFake) {
- return editor.fire('paste', { ieFake: ieFake });
- };
- var $_8tki3zijjjgwectj = {
- firePastePreProcess: firePastePreProcess,
- firePastePostProcess: firePastePostProcess,
- firePastePlainTextToggle: firePastePlainTextToggle,
- firePaste: firePaste
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var firePastePreProcess = function (editor, html, internal, isWordHtml) {
+ return editor.fire('PastePreProcess', {
+ content: html,
+ internal: internal,
+ wordContent: isWordHtml
+ });
+ };
+ var firePastePostProcess = function (editor, node, internal, isWordHtml) {
+ return editor.fire('PastePostProcess', {
+ node: node,
+ internal: internal,
+ wordContent: isWordHtml
+ });
+ };
+ var firePastePlainTextToggle = function (editor, state) {
+ return editor.fire('PastePlainTextToggle', { state: state });
+ };
+ var firePaste = function (editor, ieFake) {
+ return editor.fire('paste', { ieFake: ieFake });
+ };
+ var Events = {
+ firePastePreProcess: firePastePreProcess,
+ firePastePostProcess: firePastePostProcess,
+ firePastePlainTextToggle: firePastePlainTextToggle,
+ firePaste: firePaste
+ };
</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 shouldPlainTextInform = function (editor) {
- return editor.getParam('paste_plaintext_inform', true);
- };
- var shouldBlockDrop = function (editor) {
- return editor.getParam('paste_block_drop', false);
- };
- var shouldPasteDataImages = function (editor) {
- return editor.getParam('paste_data_images', false);
- };
- var shouldFilterDrop = function (editor) {
- return editor.getParam('paste_filter_drop', true);
- };
- var getPreProcess = function (editor) {
- return editor.getParam('paste_preprocess');
- };
- var getPostProcess = function (editor) {
- return editor.getParam('paste_postprocess');
- };
- var getWebkitStyles = function (editor) {
- return editor.getParam('paste_webkit_styles');
- };
- var shouldRemoveWebKitStyles = function (editor) {
- return editor.getParam('paste_remove_styles_if_webkit', true);
- };
- var shouldMergeFormats = function (editor) {
- return editor.getParam('paste_merge_formats', true);
- };
- var isSmartPasteEnabled = function (editor) {
- return editor.getParam('smart_paste', true);
- };
- var isPasteAsTextEnabled = function (editor) {
- return editor.getParam('paste_as_text', false);
- };
- var getRetainStyleProps = function (editor) {
- return editor.getParam('paste_retain_style_properties');
- };
- var getWordValidElements = function (editor) {
- var defaultValidElements = '-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' + '-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,' + 'td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody';
- return editor.getParam('paste_word_valid_elements', defaultValidElements);
- };
- var shouldConvertWordFakeLists = function (editor) {
- return editor.getParam('paste_convert_word_fake_lists', true);
- };
- var shouldUseDefaultFilters = function (editor) {
- return editor.getParam('paste_enable_default_filters', true);
- };
- var $_xr8b0ikjjgwectl = {
- shouldPlainTextInform: shouldPlainTextInform,
- shouldBlockDrop: shouldBlockDrop,
- shouldPasteDataImages: shouldPasteDataImages,
- shouldFilterDrop: shouldFilterDrop,
- getPreProcess: getPreProcess,
- getPostProcess: getPostProcess,
- getWebkitStyles: getWebkitStyles,
- shouldRemoveWebKitStyles: shouldRemoveWebKitStyles,
- shouldMergeFormats: shouldMergeFormats,
- isSmartPasteEnabled: isSmartPasteEnabled,
- isPasteAsTextEnabled: isPasteAsTextEnabled,
- getRetainStyleProps: getRetainStyleProps,
- getWordValidElements: getWordValidElements,
- shouldConvertWordFakeLists: shouldConvertWordFakeLists,
- shouldUseDefaultFilters: shouldUseDefaultFilters
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var shouldPlainTextInform = function (editor) {
+ return editor.getParam('paste_plaintext_inform', true);
+ };
+ var shouldBlockDrop = function (editor) {
+ return editor.getParam('paste_block_drop', false);
+ };
+ var shouldPasteDataImages = function (editor) {
+ return editor.getParam('paste_data_images', false);
+ };
+ var shouldFilterDrop = function (editor) {
+ return editor.getParam('paste_filter_drop', true);
+ };
+ var getPreProcess = function (editor) {
+ return editor.getParam('paste_preprocess');
+ };
+ var getPostProcess = function (editor) {
+ return editor.getParam('paste_postprocess');
+ };
+ var getWebkitStyles = function (editor) {
+ return editor.getParam('paste_webkit_styles');
+ };
+ var shouldRemoveWebKitStyles = function (editor) {
+ return editor.getParam('paste_remove_styles_if_webkit', true);
+ };
+ var shouldMergeFormats = function (editor) {
+ return editor.getParam('paste_merge_formats', true);
+ };
+ var isSmartPasteEnabled = function (editor) {
+ return editor.getParam('smart_paste', true);
+ };
+ var isPasteAsTextEnabled = function (editor) {
+ return editor.getParam('paste_as_text', false);
+ };
+ var getRetainStyleProps = function (editor) {
+ return editor.getParam('paste_retain_style_properties');
+ };
+ var getWordValidElements = function (editor) {
+ var defaultValidElements = '-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' + '-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,' + 'td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody';
+ return editor.getParam('paste_word_valid_elements', defaultValidElements);
+ };
+ var shouldConvertWordFakeLists = function (editor) {
+ return editor.getParam('paste_convert_word_fake_lists', true);
+ };
+ var shouldUseDefaultFilters = function (editor) {
+ return editor.getParam('paste_enable_default_filters', true);
+ };
+ var Settings = {
+ shouldPlainTextInform: shouldPlainTextInform,
+ shouldBlockDrop: shouldBlockDrop,
+ shouldPasteDataImages: shouldPasteDataImages,
+ shouldFilterDrop: shouldFilterDrop,
+ getPreProcess: getPreProcess,
+ getPostProcess: getPostProcess,
+ getWebkitStyles: getWebkitStyles,
+ shouldRemoveWebKitStyles: shouldRemoveWebKitStyles,
+ shouldMergeFormats: shouldMergeFormats,
+ isSmartPasteEnabled: isSmartPasteEnabled,
+ isPasteAsTextEnabled: isPasteAsTextEnabled,
+ getRetainStyleProps: getRetainStyleProps,
+ getWordValidElements: getWordValidElements,
+ shouldConvertWordFakeLists: shouldConvertWordFakeLists,
+ shouldUseDefaultFilters: shouldUseDefaultFilters
+ };
</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 shouldInformUserAboutPlainText = function (editor, userIsInformedState) {
- return userIsInformedState.get() === false && $_xr8b0ikjjgwectl.shouldPlainTextInform(editor);
- };
- var displayNotification = function (editor, message) {
- editor.notificationManager.open({
- text: editor.translate(message),
- type: 'info'
- });
- };
- var togglePlainTextPaste = function (editor, clipboard, userIsInformedState) {
- if (clipboard.pasteFormat.get() === 'text') {
- clipboard.pasteFormat.set('html');
- $_8tki3zijjjgwectj.firePastePlainTextToggle(editor, false);
- } else {
- clipboard.pasteFormat.set('text');
- $_8tki3zijjjgwectj.firePastePlainTextToggle(editor, true);
- if (shouldInformUserAboutPlainText(editor, userIsInformedState)) {
- displayNotification(editor, 'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.');
- userIsInformedState.set(true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var shouldInformUserAboutPlainText = function (editor, userIsInformedState) {
+ return userIsInformedState.get() === false && Settings.shouldPlainTextInform(editor);
+ };
+ var displayNotification = function (editor, message) {
+ editor.notificationManager.open({
+ text: editor.translate(message),
+ type: 'info'
+ });
+ };
+ var togglePlainTextPaste = function (editor, clipboard, userIsInformedState) {
+ if (clipboard.pasteFormat.get() === 'text') {
+ clipboard.pasteFormat.set('html');
+ Events.firePastePlainTextToggle(editor, false);
+ } else {
+ clipboard.pasteFormat.set('text');
+ Events.firePastePlainTextToggle(editor, true);
+ if (shouldInformUserAboutPlainText(editor, userIsInformedState)) {
+ displayNotification(editor, 'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.');
+ userIsInformedState.set(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">- }
- editor.focus();
- };
- var $_2j7vw7iijjgwecti = { togglePlainTextPaste: togglePlainTextPaste };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.focus();
+ };
+ var Actions = { togglePlainTextPaste: togglePlainTextPaste };
</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 register = function (editor, clipboard, userIsInformedState) {
- editor.addCommand('mceTogglePlainTextPaste', function () {
- $_2j7vw7iijjgwecti.togglePlainTextPaste(editor, clipboard, userIsInformedState);
- });
- editor.addCommand('mceInsertClipboardContent', function (ui, value) {
- if (value.content) {
- clipboard.pasteHtml(value.content, value.internal);
- }
- if (value.text) {
- clipboard.pasteText(value.text);
- }
- });
- };
- var $_fldd1mihjjgwecth = { register: register };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register = function (editor, clipboard, userIsInformedState) {
+ editor.addCommand('mceTogglePlainTextPaste', function () {
+ Actions.togglePlainTextPaste(editor, clipboard, userIsInformedState);
+ });
+ editor.addCommand('mceInsertClipboardContent', function (ui, value) {
+ if (value.content) {
+ clipboard.pasteHtml(value.content, value.internal);
+ }
+ if (value.text) {
+ clipboard.pasteText(value.text);
+ }
+ });
+ };
+ var Commands = { register: register };
</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 global$1 = tinymce.util.Tools.resolve('tinymce.Env');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$1 = tinymce.util.Tools.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">- var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay');
</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 global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$3 = tinymce.util.Tools.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">- var global$4 = tinymce.util.Tools.resolve('tinymce.util.VK');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$4 = tinymce.util.Tools.resolve('tinymce.util.VK');
</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 internalMimeType = 'x-tinymce/html';
- var internalMark = '<!-- ' + internalMimeType + ' -->';
- var mark = function (html) {
- return internalMark + html;
- };
- var unmark = function (html) {
- return html.replace(internalMark, '');
- };
- var isMarked = function (html) {
- return html.indexOf(internalMark) !== -1;
- };
- var $_4x13hjirjjgwecu1 = {
- mark: mark,
- unmark: unmark,
- isMarked: isMarked,
- internalHtmlMime: function () {
- return internalMimeType;
- }
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var internalMimeType = 'x-tinymce/html';
+ var internalMark = '<!-- ' + internalMimeType + ' -->';
+ var mark = function (html) {
+ return internalMark + html;
+ };
+ var unmark = function (html) {
+ return html.replace(internalMark, '');
+ };
+ var isMarked = function (html) {
+ return html.indexOf(internalMark) !== -1;
+ };
+ var InternalHtml = {
+ mark: mark,
+ unmark: unmark,
+ isMarked: isMarked,
+ internalHtmlMime: function () {
+ return internalMimeType;
+ }
+ };
</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 global$5 = tinymce.util.Tools.resolve('tinymce.html.Entities');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$5 = tinymce.util.Tools.resolve('tinymce.html.Entities');
</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 isPlainText = function (text) {
- return !/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(text);
- };
- var toBRs = function (text) {
- return text.replace(/\r?\n/g, '<br>');
- };
- var openContainer = function (rootTag, rootAttrs) {
- var key;
- var attrs = [];
- var tag = '<' + rootTag;
- if (typeof rootAttrs === 'object') {
- for (key in rootAttrs) {
- if (rootAttrs.hasOwnProperty(key)) {
- attrs.push(key + '="' + global$5.encodeAllRaw(rootAttrs[key]) + '"');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isPlainText = function (text) {
+ return !/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(text);
+ };
+ var toBRs = function (text) {
+ return text.replace(/\r?\n/g, '<br>');
+ };
+ var openContainer = function (rootTag, rootAttrs) {
+ var key;
+ var attrs = [];
+ var tag = '<' + rootTag;
+ if (typeof rootAttrs === 'object') {
+ for (key in rootAttrs) {
+ if (rootAttrs.hasOwnProperty(key)) {
+ attrs.push(key + '="' + global$5.encodeAllRaw(rootAttrs[key]) + '"');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (attrs.length) {
+ tag += ' ' + attrs.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">- if (attrs.length) {
- tag += ' ' + attrs.join(' ');
- }
- }
- return tag + '>';
- };
- var toBlockElements = function (text, rootTag, rootAttrs) {
- var blocks = text.split(/\n\n/);
- var tagOpen = openContainer(rootTag, rootAttrs);
- var tagClose = '</' + rootTag + '>';
- var paragraphs = global$3.map(blocks, function (p) {
- return p.split(/\n/).join('<br />');
- });
- var stitch = function (p) {
- return tagOpen + p + tagClose;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return tag + '>';
</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 paragraphs.length === 1 ? paragraphs[0] : global$3.map(paragraphs, stitch).join('');
- };
- var convert = function (text, rootTag, rootAttrs) {
- return rootTag ? toBlockElements(text, rootTag, rootAttrs) : toBRs(text);
- };
- var $_4h3hnrisjjgwecu2 = {
- isPlainText: isPlainText,
- convert: convert,
- toBRs: toBRs,
- toBlockElements: toBlockElements
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var toBlockElements = function (text, rootTag, rootAttrs) {
+ var blocks = text.split(/\n\n/);
+ var tagOpen = openContainer(rootTag, rootAttrs);
+ var tagClose = '</' + rootTag + '>';
+ var paragraphs = global$3.map(blocks, function (p) {
+ return p.split(/\n/).join('<br />');
+ });
+ var stitch = function (p) {
+ return tagOpen + p + tagClose;
+ };
+ return paragraphs.length === 1 ? paragraphs[0] : global$3.map(paragraphs, stitch).join('');
+ };
+ var convert = function (text, rootTag, rootAttrs) {
+ return rootTag ? toBlockElements(text, rootTag, rootAttrs) : toBRs(text);
+ };
+ var Newlines = {
+ isPlainText: isPlainText,
+ convert: convert,
+ toBRs: toBRs,
+ toBlockElements: toBlockElements
+ };
</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 global$6 = tinymce.util.Tools.resolve('tinymce.html.DomParser');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$6 = tinymce.util.Tools.resolve('tinymce.html.DomParser');
</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 global$7 = tinymce.util.Tools.resolve('tinymce.html.Node');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$7 = tinymce.util.Tools.resolve('tinymce.html.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 global$8 = tinymce.util.Tools.resolve('tinymce.html.Schema');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$8 = tinymce.util.Tools.resolve('tinymce.html.Schema');
</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 global$9 = tinymce.util.Tools.resolve('tinymce.html.Serializer');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$9 = tinymce.util.Tools.resolve('tinymce.html.Serializer');
</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 filter(content, items) {
- global$3.each(items, function (v) {
- if (v.constructor === RegExp) {
- content = content.replace(v, '');
- } else {
- content = content.replace(v[0], v[1]);
- }
- });
- return content;
- }
- function innerText(html) {
- var schema = global$8();
- var domParser = global$6({}, schema);
- var text = '';
- var shortEndedElements = schema.getShortEndedElements();
- var ignoreElements = global$3.makeMap('script noscript style textarea video audio iframe object', ' ');
- var blockElements = schema.getBlockElements();
- function walk(node) {
- var name$$1 = node.name, currentNode = node;
- if (name$$1 === 'br') {
- text += '\n';
- return;
- }
- if (shortEndedElements[name$$1]) {
- text += ' ';
- }
- if (ignoreElements[name$$1]) {
- text += ' ';
- return;
- }
- if (node.type === 3) {
- text += node.value;
- }
- if (!node.shortEnded) {
- if (node = node.firstChild) {
- do {
- walk(node);
- } while (node = node.next);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function filter(content, items) {
+ global$3.each(items, function (v) {
+ if (v.constructor === RegExp) {
+ content = content.replace(v, '');
+ } else {
+ content = content.replace(v[0], v[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 (blockElements[name$$1] && currentNode.next) {
- text += '\n';
- if (name$$1 === 'p') {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ return content;
+ }
+ function innerText(html) {
+ var schema = global$8();
+ var domParser = global$6({}, schema);
+ var text = '';
+ var shortEndedElements = schema.getShortEndedElements();
+ var ignoreElements = global$3.makeMap('script noscript style textarea video audio iframe object', ' ');
+ var blockElements = schema.getBlockElements();
+ function walk(node) {
+ var name$$1 = node.name, currentNode = node;
+ if (name$$1 === 'br') {
</ins><span class="cx" style="display: block; padding: 0 10px"> text += '\n';
</span><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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (name$$1 === 'wbr') {
+ return;
+ }
+ if (shortEndedElements[name$$1]) {
+ text += ' ';
+ }
+ if (ignoreElements[name$$1]) {
+ text += ' ';
+ return;
+ }
+ if (node.type === 3) {
+ text += node.value;
+ }
+ if (!node.shortEnded) {
+ if (node = node.firstChild) {
+ do {
+ walk(node);
+ } while (node = node.next);
+ }
+ }
+ if (blockElements[name$$1] && currentNode.next) {
+ text += '\n';
+ if (name$$1 === 'p') {
+ text += '\n';
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ html = filter(html, [/<!\[[^\]]+\]>/g]);
+ walk(domParser.parse(html));
+ return 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">- html = filter(html, [/<!\[[^\]]+\]>/g]);
- walk(domParser.parse(html));
- return text;
- }
- function trimHtml(html) {
- function trimSpaces(all, s1, s2) {
- if (!s1 && !s2) {
- return ' ';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function trimHtml(html) {
+ function trimSpaces(all, s1, s2) {
+ if (!s1 && !s2) {
+ return ' ';
+ }
+ return '\xA0';
</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 '\xA0';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ html = filter(html, [
+ /^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/ig,
+ /<!--StartFragment-->|<!--EndFragment-->/g,
+ [
+ /( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,
+ trimSpaces
+ ],
+ /<br class="Apple-interchange-newline">/g,
+ /<br>$/i
+ ]);
+ return html;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- html = filter(html, [
- /^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/ig,
- /<!--StartFragment-->|<!--EndFragment-->/g,
- [
- /( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,
- trimSpaces
- ],
- /<br class="Apple-interchange-newline">/g,
- /<br>$/i
- ]);
- return html;
- }
- function createIdGenerator(prefix) {
- var count = 0;
- return function () {
- return prefix + count++;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function createIdGenerator(prefix) {
+ var count = 0;
+ return function () {
+ return prefix + count++;
+ };
+ }
+ var isMsEdge = function () {
+ return navigator.userAgent.indexOf(' Edge/') !== -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">- }
- var isMsEdge = function () {
- return navigator.userAgent.indexOf(' Edge/') !== -1;
- };
- var $_4bi2o9j0jjgwecui = {
- filter: filter,
- innerText: innerText,
- trimHtml: trimHtml,
- createIdGenerator: createIdGenerator,
- isMsEdge: isMsEdge
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Utils = {
+ filter: filter,
+ innerText: innerText,
+ trimHtml: trimHtml,
+ createIdGenerator: createIdGenerator,
+ isMsEdge: isMsEdge
+ };
</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 isWordContent(content) {
- return /<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(content) || /class="OutlineElement/.test(content) || /id="?docs\-internal\-guid\-/.test(content);
- }
- function isNumericList(text) {
- var found, patterns;
- patterns = [
- /^[IVXLMCD]{1,2}\.[ \u00a0]/,
- /^[ivxlmcd]{1,2}\.[ \u00a0]/,
- /^[a-z]{1,2}[\.\)][ \u00a0]/,
- /^[A-Z]{1,2}[\.\)][ \u00a0]/,
- /^[0-9]+\.[ \u00a0]/,
- /^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,
- /^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/
- ];
- text = text.replace(/^[\u00a0 ]+/, '');
- global$3.each(patterns, function (pattern) {
- if (pattern.test(text)) {
- found = true;
- return false;
- }
- });
- return found;
- }
- function isBulletList(text) {
- return /^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(text);
- }
- function convertFakeListsToProperLists(node) {
- var currentListNode, prevListNode, lastLevel = 1;
- function getText(node) {
- var txt = '';
- if (node.type === 3) {
- return node.value;
- }
- if (node = node.firstChild) {
- do {
- txt += getText(node);
- } while (node = node.next);
- }
- return txt;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function isWordContent(content) {
+ return /<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(content) || /class="OutlineElement/.test(content) || /id="?docs\-internal\-guid\-/.test(content);
</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 trimListStart(node, regExp) {
- if (node.type === 3) {
- if (regExp.test(node.value)) {
- node.value = node.value.replace(regExp, '');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function isNumericList(text) {
+ var found, patterns;
+ patterns = [
+ /^[IVXLMCD]{1,2}\.[ \u00a0]/,
+ /^[ivxlmcd]{1,2}\.[ \u00a0]/,
+ /^[a-z]{1,2}[\.\)][ \u00a0]/,
+ /^[A-Z]{1,2}[\.\)][ \u00a0]/,
+ /^[0-9]+\.[ \u00a0]/,
+ /^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,
+ /^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/
+ ];
+ text = text.replace(/^[\u00a0 ]+/, '');
+ global$3.each(patterns, function (pattern) {
+ if (pattern.test(text)) {
+ found = true;
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ return found;
+ }
+ function isBulletList(text) {
+ return /^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(text);
+ }
+ function convertFakeListsToProperLists(node) {
+ var currentListNode, prevListNode, lastLevel = 1;
+ function getText(node) {
+ var txt = '';
+ if (node.type === 3) {
+ return node.value;
+ }
+ if (node = node.firstChild) {
+ do {
+ txt += getText(node);
+ } while (node = node.next);
+ }
+ return txt;
</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 = node.firstChild) {
- do {
- if (!trimListStart(node, regExp)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function trimListStart(node, regExp) {
+ if (node.type === 3) {
+ if (regExp.test(node.value)) {
+ node.value = node.value.replace(regExp, '');
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><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.next);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (node = node.firstChild) {
+ do {
+ if (!trimListStart(node, regExp)) {
+ return false;
+ }
+ } while (node = node.next);
+ }
+ 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;
- }
- function removeIgnoredNodes(node) {
- if (node._listIgnore) {
- node.remove();
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function removeIgnoredNodes(node) {
+ if (node._listIgnore) {
+ node.remove();
+ return;
+ }
+ if (node = node.firstChild) {
+ do {
+ removeIgnoredNodes(node);
+ } while (node = node.next);
+ }
</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 = node.firstChild) {
- do {
- removeIgnoredNodes(node);
- } while (node = node.next);
- }
- }
- function convertParagraphToLi(paragraphNode, listName, start) {
- var level = paragraphNode._listLevel || lastLevel;
- if (level !== lastLevel) {
- if (level < lastLevel) {
- if (currentListNode) {
- currentListNode = currentListNode.parent.parent;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function convertParagraphToLi(paragraphNode, listName, start) {
+ var level = paragraphNode._listLevel || lastLevel;
+ if (level !== lastLevel) {
+ if (level < lastLevel) {
+ if (currentListNode) {
+ currentListNode = currentListNode.parent.parent;
+ }
+ } else {
+ prevListNode = currentListNode;
+ currentListNode = null;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (!currentListNode || currentListNode.name !== listName) {
+ prevListNode = prevListNode || currentListNode;
+ currentListNode = new global$7(listName, 1);
+ if (start > 1) {
+ currentListNode.attr('start', '' + start);
+ }
+ paragraphNode.wrap(currentListNode);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- prevListNode = currentListNode;
- currentListNode = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ currentListNode.append(paragraphNode);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ paragraphNode.name = 'li';
+ if (level > lastLevel && prevListNode) {
+ prevListNode.lastChild.append(currentListNode);
+ }
+ lastLevel = level;
+ removeIgnoredNodes(paragraphNode);
+ trimListStart(paragraphNode, /^\u00a0+/);
+ trimListStart(paragraphNode, /^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/);
+ trimListStart(paragraphNode, /^\u00a0+/);
</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 (!currentListNode || currentListNode.name !== listName) {
- prevListNode = prevListNode || currentListNode;
- currentListNode = new global$7(listName, 1);
- if (start > 1) {
- currentListNode.attr('start', '' + start);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var elements = [];
+ var child = node.firstChild;
+ while (typeof child !== 'undefined' && child !== null) {
+ elements.push(child);
+ child = child.walk();
+ if (child !== null) {
+ while (typeof child !== 'undefined' && child.parent !== node) {
+ child = child.walk();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- paragraphNode.wrap(currentListNode);
- } else {
- currentListNode.append(paragraphNode);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- paragraphNode.name = 'li';
- if (level > lastLevel && prevListNode) {
- prevListNode.lastChild.append(currentListNode);
- }
- lastLevel = level;
- removeIgnoredNodes(paragraphNode);
- trimListStart(paragraphNode, /^\u00a0+/);
- trimListStart(paragraphNode, /^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/);
- trimListStart(paragraphNode, /^\u00a0+/);
- }
- var elements = [];
- var child = node.firstChild;
- while (typeof child !== 'undefined' && child !== null) {
- elements.push(child);
- child = child.walk();
- if (child !== null) {
- while (typeof child !== 'undefined' && child.parent !== node) {
- child = child.walk();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (var i = 0; i < elements.length; i++) {
+ node = elements[i];
+ if (node.name === 'p' && node.firstChild) {
+ var nodeText = getText(node);
+ if (isBulletList(nodeText)) {
+ convertParagraphToLi(node, 'ul');
+ continue;
+ }
+ if (isNumericList(nodeText)) {
+ var matches = /([0-9]+)\./.exec(nodeText);
+ var start = 1;
+ if (matches) {
+ start = parseInt(matches[1], 10);
+ }
+ convertParagraphToLi(node, 'ol', start);
+ continue;
+ }
+ if (node._listLevel) {
+ convertParagraphToLi(node, 'ul', 1);
+ continue;
+ }
+ currentListNode = null;
+ } else {
+ prevListNode = currentListNode;
+ currentListNode = null;
</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">- for (var i = 0; i < elements.length; i++) {
- node = elements[i];
- if (node.name === 'p' && node.firstChild) {
- var nodeText = getText(node);
- if (isBulletList(nodeText)) {
- convertParagraphToLi(node, 'ul');
- continue;
- }
- if (isNumericList(nodeText)) {
- var matches = /([0-9]+)\./.exec(nodeText);
- var start = 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function filterStyles(editor, validStyles, node, styleValue) {
+ var outputStyles = {}, matches;
+ var styles = editor.dom.parseStyle(styleValue);
+ global$3.each(styles, function (value, name) {
+ switch (name) {
+ case 'mso-list':
+ matches = /\w+ \w+([0-9]+)/i.exec(styleValue);
</ins><span class="cx" style="display: block; padding: 0 10px"> if (matches) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- start = parseInt(matches[1], 10);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ node._listLevel = parseInt(matches[1], 10);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- convertParagraphToLi(node, 'ol', start);
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (/Ignore/i.test(value) && node.firstChild) {
+ node._listIgnore = true;
+ node.firstChild._listIgnore = true;
+ }
+ break;
+ case 'horiz-align':
+ name = 'text-align';
+ break;
+ case 'vert-align':
+ name = 'vertical-align';
+ break;
+ case 'font-color':
+ case 'mso-foreground':
+ name = 'color';
+ break;
+ case 'mso-background':
+ case 'mso-highlight':
+ name = 'background';
+ break;
+ case 'font-weight':
+ case 'font-style':
+ if (value !== 'normal') {
+ outputStyles[name] = value;
+ }
+ return;
+ case 'mso-element':
+ if (/^(comment|comment-list)$/i.test(value)) {
+ node.remove();
+ return;
+ }
+ 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">- if (node._listLevel) {
- convertParagraphToLi(node, 'ul', 1);
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (name.indexOf('mso-comment') === 0) {
+ node.remove();
+ 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">- currentListNode = null;
- } else {
- prevListNode = currentListNode;
- currentListNode = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (name.indexOf('mso-') === 0) {
+ return;
+ }
+ if (Settings.getRetainStyleProps(editor) === 'all' || validStyles && validStyles[name]) {
+ outputStyles[name] = value;
+ }
+ });
+ if (/(bold)/i.test(outputStyles['font-weight'])) {
+ delete outputStyles['font-weight'];
+ node.wrap(new global$7('b', 1));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (/(italic)/i.test(outputStyles['font-style'])) {
+ delete outputStyles['font-style'];
+ node.wrap(new global$7('i', 1));
+ }
+ outputStyles = editor.dom.serializeStyle(outputStyles, node.name);
+ if (outputStyles) {
+ return outputStyles;
+ }
+ return 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">- }
- function filterStyles(editor, validStyles, node, styleValue) {
- var outputStyles = {}, matches;
- var styles = editor.dom.parseStyle(styleValue);
- global$3.each(styles, function (value, name) {
- switch (name) {
- case 'mso-list':
- matches = /\w+ \w+([0-9]+)/i.exec(styleValue);
- if (matches) {
- node._listLevel = parseInt(matches[1], 10);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var filterWordContent = function (editor, content) {
+ var retainStyleProperties, validStyles;
+ retainStyleProperties = Settings.getRetainStyleProps(editor);
+ if (retainStyleProperties) {
+ validStyles = global$3.makeMap(retainStyleProperties.split(/[, ]/));
+ }
+ content = Utils.filter(content, [
+ /<br class="?Apple-interchange-newline"?>/gi,
+ /<b[^>]+id="?docs-internal-[^>]*>/gi,
+ /<!--[\s\S]+?-->/gi,
+ /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,
+ [
+ /<(\/?)s>/gi,
+ '<$1strike>'
+ ],
+ [
+ / /gi,
+ '\xA0'
+ ],
+ [
+ /<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
+ function (str, spaces) {
+ return spaces.length > 0 ? spaces.replace(/./, ' ').slice(Math.floor(spaces.length / 2)).split('').join('\xA0') : '';
+ }
+ ]
+ ]);
+ var validElements = Settings.getWordValidElements(editor);
+ var schema = global$8({
+ valid_elements: validElements,
+ valid_children: '-li[p]'
+ });
+ global$3.each(schema.elements, function (rule) {
+ if (!rule.attributes.class) {
+ rule.attributes.class = {};
+ rule.attributesOrder.push('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">- if (/Ignore/i.test(value) && node.firstChild) {
- node._listIgnore = true;
- node.firstChild._listIgnore = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!rule.attributes.style) {
+ rule.attributes.style = {};
+ rule.attributesOrder.push('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">- break;
- case 'horiz-align':
- name = 'text-align';
- break;
- case 'vert-align':
- name = 'vertical-align';
- break;
- case 'font-color':
- case 'mso-foreground':
- name = 'color';
- break;
- case 'mso-background':
- case 'mso-highlight':
- name = 'background';
- break;
- case 'font-weight':
- case 'font-style':
- if (value !== 'normal') {
- outputStyles[name] = value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ var domParser = global$6({}, schema);
+ domParser.addAttributeFilter('style', function (nodes) {
+ var i = nodes.length, node;
+ while (i--) {
+ node = nodes[i];
+ node.attr('style', filterStyles(editor, validStyles, node, node.attr('style')));
+ if (node.name === 'span' && node.parent && !node.attributes.length) {
+ node.unwrap();
+ }
</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;
- case 'mso-element':
- if (/^(comment|comment-list)$/i.test(value)) {
- node.remove();
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ domParser.addAttributeFilter('class', function (nodes) {
+ var i = nodes.length, node, className;
+ while (i--) {
+ node = nodes[i];
+ className = node.attr('class');
+ if (/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(className)) {
+ node.remove();
+ }
+ node.attr('class', 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">- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ domParser.addNodeFilter('del', function (nodes) {
+ var i = nodes.length;
+ while (i--) {
+ nodes[i].remove();
+ }
+ });
+ domParser.addNodeFilter('a', function (nodes) {
+ var i = nodes.length, node, href, name;
+ while (i--) {
+ node = nodes[i];
+ href = node.attr('href');
+ name = node.attr('name');
+ if (href && href.indexOf('#_msocom_') !== -1) {
+ node.remove();
+ continue;
+ }
+ if (href && href.indexOf('file://') === 0) {
+ href = href.split('#')[1];
+ if (href) {
+ href = '#' + href;
+ }
+ }
+ if (!href && !name) {
+ node.unwrap();
+ } else {
+ if (name && !/^_?(?:toc|edn|ftn)/i.test(name)) {
+ node.unwrap();
+ continue;
+ }
+ node.attr({
+ href: href,
+ name: name
+ });
+ }
+ }
+ });
+ var rootNode = domParser.parse(content);
+ if (Settings.shouldConvertWordFakeLists(editor)) {
+ convertFakeListsToProperLists(rootNode);
</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.indexOf('mso-comment') === 0) {
- node.remove();
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ content = global$9({ validate: editor.settings.validate }, schema).serialize(rootNode);
+ return content;
+ };
+ var preProcess = function (editor, content) {
+ return Settings.shouldUseDefaultFilters(editor) ? filterWordContent(editor, content) : content;
+ };
+ var WordFilter = {
+ preProcess: preProcess,
+ isWordContent: isWordContent
+ };
+
+ var processResult = function (content, cancelled) {
+ return {
+ content: content,
+ cancelled: cancelled
+ };
+ };
+ var postProcessFilter = function (editor, html, internal, isWordHtml) {
+ var tempBody = editor.dom.create('div', { style: 'display:none' }, html);
+ var postProcessArgs = Events.firePastePostProcess(editor, tempBody, internal, isWordHtml);
+ return processResult(postProcessArgs.node.innerHTML, postProcessArgs.isDefaultPrevented());
+ };
+ var filterContent = function (editor, content, internal, isWordHtml) {
+ var preProcessArgs = Events.firePastePreProcess(editor, content, internal, isWordHtml);
+ if (editor.hasEventListeners('PastePostProcess') && !preProcessArgs.isDefaultPrevented()) {
+ return postProcessFilter(editor, preProcessArgs.content, internal, isWordHtml);
+ } else {
+ return processResult(preProcessArgs.content, preProcessArgs.isDefaultPrevented());
</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.indexOf('mso-') === 0) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var process = function (editor, html, internal) {
+ var isWordHtml = WordFilter.isWordContent(html);
+ var content = isWordHtml ? WordFilter.preProcess(editor, html) : html;
+ return filterContent(editor, content, internal, isWordHtml);
+ };
+ var ProcessFilters = { process: process };
+
+ var removeMeta = function (editor, html) {
+ var body = editor.dom.create('body', {}, html);
+ global$3.each(body.querySelectorAll('meta'), function (elm) {
+ return elm.parentNode.removeChild(elm);
+ });
+ return body.innerHTML;
+ };
+ var pasteHtml = function (editor, html) {
+ editor.insertContent(removeMeta(editor, html), {
+ merge: Settings.shouldMergeFormats(editor),
+ paste: true
+ });
+ return true;
+ };
+ var isAbsoluteUrl = function (url) {
+ return /^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(url);
+ };
+ var isImageUrl = function (url) {
+ return isAbsoluteUrl(url) && /.(gif|jpe?g|png)$/.test(url);
+ };
+ var createImage = function (editor, url, pasteHtmlFn) {
+ editor.undoManager.extra(function () {
+ pasteHtmlFn(editor, url);
+ }, function () {
+ editor.insertContent('<img src="' + url + '">');
+ });
+ return true;
+ };
+ var createLink = function (editor, url, pasteHtmlFn) {
+ editor.undoManager.extra(function () {
+ pasteHtmlFn(editor, url);
+ }, function () {
+ editor.execCommand('mceInsertLink', false, url);
+ });
+ return true;
+ };
+ var linkSelection = function (editor, html, pasteHtmlFn) {
+ return editor.selection.isCollapsed() === false && isAbsoluteUrl(html) ? createLink(editor, html, pasteHtmlFn) : false;
+ };
+ var insertImage = function (editor, html, pasteHtmlFn) {
+ return isImageUrl(html) ? createImage(editor, html, pasteHtmlFn) : false;
+ };
+ var smartInsertContent = function (editor, html) {
+ global$3.each([
+ linkSelection,
+ insertImage,
+ pasteHtml
+ ], function (action) {
+ return action(editor, html, pasteHtml) !== true;
+ });
+ };
+ var insertContent = function (editor, html) {
+ if (Settings.isSmartPasteEnabled(editor) === false) {
+ pasteHtml(editor, html);
+ } else {
+ smartInsertContent(editor, html);
</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 ($_xr8b0ikjjgwectl.getRetainStyleProps(editor) === 'all' || validStyles && validStyles[name]) {
- outputStyles[name] = value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var SmartPaste = {
+ isImageUrl: isImageUrl,
+ isAbsoluteUrl: isAbsoluteUrl,
+ insertContent: insertContent
+ };
+
+ var constant = function (value) {
+ return function () {
+ return value;
+ };
+ };
+ function curry(fn) {
+ var initialArgs = [];
+ for (var _i = 1; _i < arguments.length; _i++) {
+ initialArgs[_i - 1] = arguments[_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 (/(bold)/i.test(outputStyles['font-weight'])) {
- delete outputStyles['font-weight'];
- node.wrap(new global$7('b', 1));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return function () {
+ var restArgs = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ restArgs[_i] = arguments[_i];
+ }
+ var all = initialArgs.concat(restArgs);
+ return fn.apply(null, all);
+ };
</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 (/(italic)/i.test(outputStyles['font-style'])) {
- delete outputStyles['font-style'];
- node.wrap(new global$7('i', 1));
- }
- outputStyles = editor.dom.serializeStyle(outputStyles, node.name);
- if (outputStyles) {
- return outputStyles;
- }
- return null;
- }
- var filterWordContent = function (editor, content) {
- var retainStyleProperties, validStyles;
- retainStyleProperties = $_xr8b0ikjjgwectl.getRetainStyleProps(editor);
- if (retainStyleProperties) {
- validStyles = global$3.makeMap(retainStyleProperties.split(/[, ]/));
- }
- content = $_4bi2o9j0jjgwecui.filter(content, [
- /<br class="?Apple-interchange-newline"?>/gi,
- /<b[^>]+id="?docs-internal-[^>]*>/gi,
- /<!--[\s\S]+?-->/gi,
- /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,
- [
- /<(\/?)s>/gi,
- '<$1strike>'
- ],
- [
- / /gi,
- '\xA0'
- ],
- [
- /<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
- function (str, spaces) {
- return spaces.length > 0 ? spaces.replace(/./, ' ').slice(Math.floor(spaces.length / 2)).split('').join('\xA0') : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var never = constant(false);
+ var always = constant(true);
+
+ var never$1 = never;
+ var always$1 = always;
+ var none = function () {
+ return NONE;
+ };
+ var NONE = function () {
+ var eq = function (o) {
+ return o.isNone();
+ };
+ var call$$1 = function (thunk) {
+ return thunk();
+ };
+ var id = function (n) {
+ return n;
+ };
+ var noop$$1 = function () {
+ };
+ var nul = function () {
+ return null;
+ };
+ var undef = function () {
+ return undefined;
+ };
+ var me = {
+ fold: function (n, s) {
+ return n();
+ },
+ is: never$1,
+ isSome: never$1,
+ isNone: always$1,
+ getOr: id,
+ getOrThunk: call$$1,
+ getOrDie: function (msg) {
+ throw new Error(msg || 'error: getOrDie called on none.');
+ },
+ getOrNull: nul,
+ getOrUndefined: undef,
+ or: id,
+ orThunk: call$$1,
+ map: none,
+ ap: none,
+ each: noop$$1,
+ bind: none,
+ flatten: none,
+ exists: never$1,
+ forall: always$1,
+ filter: none,
+ equals: eq,
+ equals_: eq,
+ toArray: function () {
+ return [];
+ },
+ toString: constant('none()')
+ };
+ if (Object.freeze)
+ Object.freeze(me);
+ return me;
+ }();
+ var some = function (a) {
+ var constant_a = function () {
+ return a;
+ };
+ var self = function () {
+ return me;
+ };
+ var map = function (f) {
+ return some(f(a));
+ };
+ var bind = function (f) {
+ return f(a);
+ };
+ var me = {
+ fold: function (n, s) {
+ return s(a);
+ },
+ is: function (v) {
+ return a === v;
+ },
+ isSome: always$1,
+ isNone: never$1,
+ getOr: constant_a,
+ getOrThunk: constant_a,
+ getOrDie: constant_a,
+ getOrNull: constant_a,
+ getOrUndefined: constant_a,
+ or: self,
+ orThunk: self,
+ map: map,
+ ap: function (optfab) {
+ return optfab.fold(none, function (fab) {
+ return some(fab(a));
+ });
+ },
+ each: function (f) {
+ f(a);
+ },
+ bind: bind,
+ flatten: constant_a,
+ exists: bind,
+ forall: bind,
+ filter: function (f) {
+ return f(a) ? me : NONE;
+ },
+ equals: function (o) {
+ return o.is(a);
+ },
+ equals_: function (o, elementEq) {
+ return o.fold(never$1, function (b) {
+ return elementEq(a, b);
+ });
+ },
+ toArray: function () {
+ return [a];
+ },
+ toString: function () {
+ return 'some(' + a + ')';
</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 validElements = $_xr8b0ikjjgwectl.getWordValidElements(editor);
- var schema = global$8({
- valid_elements: validElements,
- valid_children: '-li[p]'
- });
- global$3.each(schema.elements, function (rule) {
- if (!rule.attributes.class) {
- rule.attributes.class = {};
- rule.attributesOrder.push('class');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ return me;
+ };
+ var from = function (value) {
+ return value === null || value === undefined ? NONE : some(value);
+ };
+ var Option = {
+ some: some,
+ none: none,
+ from: from
+ };
+
+ var typeOf = function (x) {
+ if (x === null)
+ return 'null';
+ var t = typeof x;
+ if (t === 'object' && Array.prototype.isPrototypeOf(x))
+ return 'array';
+ if (t === 'object' && String.prototype.isPrototypeOf(x))
+ return 'string';
+ return t;
+ };
+ var isType = function (type) {
+ return function (value) {
+ return typeOf(value) === type;
+ };
+ };
+ var isFunction = isType('function');
+
+ var map = function (xs, f) {
+ var len = xs.length;
+ var r = new Array(len);
+ for (var i = 0; i < len; i++) {
+ var x = xs[i];
+ r[i] = f(x, i, xs);
</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 (!rule.attributes.style) {
- rule.attributes.style = {};
- rule.attributesOrder.push('style');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return r;
+ };
+ var each = function (xs, f) {
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ f(x, i, xs);
</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 domParser = global$6({}, schema);
- domParser.addAttributeFilter('style', function (nodes) {
- var i = nodes.length, node;
- while (i--) {
- node = nodes[i];
- node.attr('style', filterStyles(editor, validStyles, node, node.attr('style')));
- if (node.name === 'span' && node.parent && !node.attributes.length) {
- node.unwrap();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var filter$1 = function (xs, pred) {
+ var r = [];
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ if (pred(x, i, xs)) {
+ r.push(x);
</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">- });
- domParser.addAttributeFilter('class', function (nodes) {
- var i = nodes.length, node, className;
- while (i--) {
- node = nodes[i];
- className = node.attr('class');
- if (/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(className)) {
- node.remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return r;
+ };
+ var slice = Array.prototype.slice;
+ var from$1 = isFunction(Array.from) ? Array.from : function (x) {
+ return slice.call(x);
+ };
+
+ var nu = function (baseFn) {
+ var data = Option.none();
+ var callbacks = [];
+ var map$$1 = function (f) {
+ return nu(function (nCallback) {
+ get(function (data) {
+ nCallback(f(data));
+ });
+ });
+ };
+ var get = function (nCallback) {
+ if (isReady())
+ call(nCallback);
+ else
+ callbacks.push(nCallback);
+ };
+ var set = function (x) {
+ data = Option.some(x);
+ run(callbacks);
+ callbacks = [];
+ };
+ var isReady = function () {
+ return data.isSome();
+ };
+ var run = function (cbs) {
+ each(cbs, call);
+ };
+ var call = function (cb) {
+ data.each(function (x) {
+ setTimeout(function () {
+ cb(x);
+ }, 0);
+ });
+ };
+ baseFn(set);
+ return {
+ get: get,
+ map: map$$1,
+ isReady: isReady
+ };
+ };
+ var pure$1 = function (a) {
+ return nu(function (callback) {
+ callback(a);
+ });
+ };
+ var LazyValue = {
+ nu: nu,
+ pure: pure$1
+ };
+
+ var bounce = function (f) {
+ return function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_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">- node.attr('class', null);
- }
- });
- domParser.addNodeFilter('del', function (nodes) {
- var i = nodes.length;
- while (i--) {
- nodes[i].remove();
- }
- });
- domParser.addNodeFilter('a', function (nodes) {
- var i = nodes.length, node, href, name;
- while (i--) {
- node = nodes[i];
- href = node.attr('href');
- name = node.attr('name');
- if (href && href.indexOf('#_msocom_') !== -1) {
- node.remove();
- continue;
- }
- if (href && href.indexOf('file://') === 0) {
- href = href.split('#')[1];
- if (href) {
- href = '#' + href;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var me = this;
+ setTimeout(function () {
+ f.apply(me, args);
+ }, 0);
+ };
+ };
+
+ var nu$1 = function (baseFn) {
+ var get = function (callback) {
+ baseFn(bounce(callback));
+ };
+ var map = function (fab) {
+ return nu$1(function (callback) {
+ get(function (a) {
+ var value = fab(a);
+ callback(value);
+ });
+ });
+ };
+ var bind = function (aFutureB) {
+ return nu$1(function (callback) {
+ get(function (a) {
+ aFutureB(a).get(callback);
+ });
+ });
+ };
+ var anonBind = function (futureB) {
+ return nu$1(function (callback) {
+ get(function (a) {
+ futureB.get(callback);
+ });
+ });
+ };
+ var toLazy = function () {
+ return LazyValue.nu(get);
+ };
+ var toCached = function () {
+ var cache = null;
+ return nu$1(function (callback) {
+ if (cache === null) {
+ cache = toLazy();
</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 (!href && !name) {
- node.unwrap();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ cache.get(callback);
+ });
+ };
+ return {
+ map: map,
+ bind: bind,
+ anonBind: anonBind,
+ toLazy: toLazy,
+ toCached: toCached,
+ get: get
+ };
+ };
+ var pure$2 = function (a) {
+ return nu$1(function (callback) {
+ callback(a);
+ });
+ };
+ var Future = {
+ nu: nu$1,
+ pure: pure$2
+ };
+
+ var par = function (asyncValues, nu) {
+ return nu(function (callback) {
+ var r = [];
+ var count = 0;
+ var cb = function (i) {
+ return function (value) {
+ r[i] = value;
+ count++;
+ if (count >= asyncValues.length) {
+ callback(r);
+ }
+ };
+ };
+ if (asyncValues.length === 0) {
+ callback([]);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (name && !/^_?(?:toc|edn|ftn)/i.test(name)) {
- node.unwrap();
- continue;
- }
- node.attr({
- href: href,
- name: name
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ each(asyncValues, function (asyncValue, i) {
+ asyncValue.get(cb(i));
</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">- }
- });
- var rootNode = domParser.parse(content);
- if ($_xr8b0ikjjgwectl.shouldConvertWordFakeLists(editor)) {
- convertFakeListsToProperLists(rootNode);
- }
- content = global$9({ validate: editor.settings.validate }, schema).serialize(rootNode);
- return content;
- };
- var preProcess = function (editor, content) {
- return $_xr8b0ikjjgwectl.shouldUseDefaultFilters(editor) ? filterWordContent(editor, content) : content;
- };
- var $_dfatuiivjjgwecu8 = {
- preProcess: preProcess,
- isWordContent: isWordContent
- };
</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">- var processResult = function (content, cancelled) {
- return {
- content: content,
- cancelled: cancelled
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var par$1 = function (futures) {
+ return par(futures, Future.nu);
</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 postProcessFilter = function (editor, html, internal, isWordHtml) {
- var tempBody = editor.dom.create('div', { style: 'display:none' }, html);
- var postProcessArgs = $_8tki3zijjjgwectj.firePastePostProcess(editor, tempBody, internal, isWordHtml);
- return processResult(postProcessArgs.node.innerHTML, postProcessArgs.isDefaultPrevented());
- };
- var filterContent = function (editor, content, internal, isWordHtml) {
- var preProcessArgs = $_8tki3zijjjgwectj.firePastePreProcess(editor, content, internal, isWordHtml);
- if (editor.hasEventListeners('PastePostProcess') && !preProcessArgs.isDefaultPrevented()) {
- return postProcessFilter(editor, preProcessArgs.content, internal, isWordHtml);
- } else {
- return processResult(preProcessArgs.content, preProcessArgs.isDefaultPrevented());
- }
- };
- var process = function (editor, html, internal) {
- var isWordHtml = $_dfatuiivjjgwecu8.isWordContent(html);
- var content = isWordHtml ? $_dfatuiivjjgwecu8.preProcess(editor, html) : html;
- return filterContent(editor, content, internal, isWordHtml);
- };
- var $_3scw66iujjgwecu4 = { process: process };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var mapM = function (array, fn) {
+ var futures = map(array, fn);
+ return par$1(futures);
+ };
</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 pasteHtml = function (editor, html) {
- editor.insertContent(html, {
- merge: $_xr8b0ikjjgwectl.shouldMergeFormats(editor),
- paste: true
- });
- return true;
- };
- var isAbsoluteUrl = function (url) {
- return /^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(url);
- };
- var isImageUrl = function (url) {
- return isAbsoluteUrl(url) && /.(gif|jpe?g|png)$/.test(url);
- };
- var createImage = function (editor, url, pasteHtmlFn) {
- editor.undoManager.extra(function () {
- pasteHtmlFn(editor, url);
- }, function () {
- editor.insertContent('<img src="' + url + '">');
- });
- return true;
- };
- var createLink = function (editor, url, pasteHtmlFn) {
- editor.undoManager.extra(function () {
- pasteHtmlFn(editor, url);
- }, function () {
- editor.execCommand('mceInsertLink', false, url);
- });
- return true;
- };
- var linkSelection = function (editor, html, pasteHtmlFn) {
- return editor.selection.isCollapsed() === false && isAbsoluteUrl(html) ? createLink(editor, html, pasteHtmlFn) : false;
- };
- var insertImage = function (editor, html, pasteHtmlFn) {
- return isImageUrl(html) ? createImage(editor, html, pasteHtmlFn) : false;
- };
- var smartInsertContent = function (editor, html) {
- global$3.each([
- linkSelection,
- insertImage,
- pasteHtml
- ], function (action) {
- return action(editor, html, pasteHtml) !== true;
- });
- };
- var insertContent = function (editor, html) {
- if ($_xr8b0ikjjgwectl.isSmartPasteEnabled(editor) === false) {
- pasteHtml(editor, html);
- } else {
- smartInsertContent(editor, html);
- }
- };
- var $_d8pzpej1jjgwecum = {
- isImageUrl: isImageUrl,
- isAbsoluteUrl: isAbsoluteUrl,
- insertContent: insertContent
- };
-
- var pasteHtml$1 = function (editor, html, internalFlag) {
- var internal = internalFlag ? internalFlag : $_4x13hjirjjgwecu1.isMarked(html);
- var args = $_3scw66iujjgwecu4.process(editor, $_4x13hjirjjgwecu1.unmark(html), internal);
- if (args.cancelled === false) {
- $_d8pzpej1jjgwecum.insertContent(editor, args.content);
- }
- };
- var pasteText = function (editor, text) {
- text = editor.dom.encode(text).replace(/\r\n/g, '\n');
- text = $_4h3hnrisjjgwecu2.convert(text, editor.settings.forced_root_block, editor.settings.forced_root_block_attrs);
- pasteHtml$1(editor, text, false);
- };
- var getDataTransferItems = function (dataTransfer) {
- var items = {};
- var mceInternalUrlPrefix = 'data:text/mce-internal,';
- if (dataTransfer) {
- if (dataTransfer.getData) {
- var legacyText = dataTransfer.getData('Text');
- if (legacyText && legacyText.length > 0) {
- if (legacyText.indexOf(mceInternalUrlPrefix) === -1) {
- items['text/plain'] = legacyText;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var pasteHtml$1 = function (editor, html, internalFlag) {
+ var internal = internalFlag ? internalFlag : InternalHtml.isMarked(html);
+ var args = ProcessFilters.process(editor, InternalHtml.unmark(html), internal);
+ if (args.cancelled === false) {
+ SmartPaste.insertContent(editor, args.content);
+ }
+ };
+ var pasteText = function (editor, text) {
+ text = editor.dom.encode(text).replace(/\r\n/g, '\n');
+ text = Newlines.convert(text, editor.settings.forced_root_block, editor.settings.forced_root_block_attrs);
+ pasteHtml$1(editor, text, false);
+ };
+ var getDataTransferItems = function (dataTransfer) {
+ var items = {};
+ var mceInternalUrlPrefix = 'data:text/mce-internal,';
+ if (dataTransfer) {
+ if (dataTransfer.getData) {
+ var legacyText = dataTransfer.getData('Text');
+ if (legacyText && legacyText.length > 0) {
+ if (legacyText.indexOf(mceInternalUrlPrefix) === -1) {
+ items['text/plain'] = legacyText;
+ }
</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">- }
- if (dataTransfer.types) {
- for (var i = 0; i < dataTransfer.types.length; i++) {
- var contentType = dataTransfer.types[i];
- try {
- items[contentType] = dataTransfer.getData(contentType);
- } catch (ex) {
- items[contentType] = '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (dataTransfer.types) {
+ for (var i = 0; i < dataTransfer.types.length; i++) {
+ var contentType = dataTransfer.types[i];
+ try {
+ items[contentType] = dataTransfer.getData(contentType);
+ } catch (ex) {
+ items[contentType] = '';
+ }
</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">- }
- return items;
- };
- var getClipboardContent = function (editor, clipboardEvent) {
- var content = getDataTransferItems(clipboardEvent.clipboardData || editor.getDoc().dataTransfer);
- return $_4bi2o9j0jjgwecui.isMsEdge() ? global$3.extend(content, { 'text/html': '' }) : content;
- };
- var hasContentType = function (clipboardContent, mimeType) {
- return mimeType in clipboardContent && clipboardContent[mimeType].length > 0;
- };
- var hasHtmlOrText = function (content) {
- return hasContentType(content, 'text/html') || hasContentType(content, 'text/plain');
- };
- var getBase64FromUri = function (uri) {
- var idx;
- idx = uri.indexOf(',');
- if (idx !== -1) {
- return uri.substr(idx + 1);
- }
- return null;
- };
- var isValidDataUriImage = function (settings, imgElm) {
- return settings.images_dataimg_filter ? settings.images_dataimg_filter(imgElm) : true;
- };
- var extractFilename = function (editor, str) {
- var m = str.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i);
- return m ? editor.dom.encode(m[1]) : null;
- };
- var uniqueId = $_4bi2o9j0jjgwecui.createIdGenerator('mceclip');
- var pasteImage = function (editor, rng, reader, blob) {
- if (rng) {
- editor.selection.setRng(rng);
- rng = null;
- }
- var dataUri = reader.result;
- var base64 = getBase64FromUri(dataUri);
- var id = uniqueId();
- var name$$1 = editor.settings.images_reuse_filename && blob.name ? extractFilename(editor, blob.name) : id;
- var img = new Image();
- img.src = dataUri;
- if (isValidDataUriImage(editor.settings, img)) {
- var blobCache = editor.editorUpload.blobCache;
- var blobInfo = void 0, existingBlobInfo = void 0;
- existingBlobInfo = blobCache.findFirst(function (cachedBlobInfo) {
- return cachedBlobInfo.base64() === base64;
- });
- if (!existingBlobInfo) {
- blobInfo = blobCache.create(id, blob, base64, name$$1);
- blobCache.add(blobInfo);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return items;
+ };
+ var getClipboardContent = function (editor, clipboardEvent) {
+ var content = getDataTransferItems(clipboardEvent.clipboardData || editor.getDoc().dataTransfer);
+ return Utils.isMsEdge() ? global$3.extend(content, { 'text/html': '' }) : content;
+ };
+ var hasContentType = function (clipboardContent, mimeType) {
+ return mimeType in clipboardContent && clipboardContent[mimeType].length > 0;
+ };
+ var hasHtmlOrText = function (content) {
+ return hasContentType(content, 'text/html') || hasContentType(content, 'text/plain');
+ };
+ var getBase64FromUri = function (uri) {
+ var idx;
+ idx = uri.indexOf(',');
+ if (idx !== -1) {
+ return uri.substr(idx + 1);
+ }
+ return null;
+ };
+ var isValidDataUriImage = function (settings, imgElm) {
+ return settings.images_dataimg_filter ? settings.images_dataimg_filter(imgElm) : true;
+ };
+ var extractFilename = function (editor, str) {
+ var m = str.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i);
+ return m ? editor.dom.encode(m[1]) : null;
+ };
+ var uniqueId = Utils.createIdGenerator('mceclip');
+ var pasteImage = function (editor, imageItem) {
+ var base64 = getBase64FromUri(imageItem.uri);
+ var id = uniqueId();
+ var name$$1 = editor.settings.images_reuse_filename && imageItem.blob.name ? extractFilename(editor, imageItem.blob.name) : id;
+ var img = new Image();
+ img.src = imageItem.uri;
+ if (isValidDataUriImage(editor.settings, img)) {
+ var blobCache = editor.editorUpload.blobCache;
+ var blobInfo = void 0, existingBlobInfo = void 0;
+ existingBlobInfo = blobCache.findFirst(function (cachedBlobInfo) {
+ return cachedBlobInfo.base64() === base64;
+ });
+ if (!existingBlobInfo) {
+ blobInfo = blobCache.create(id, imageItem.blob, base64, name$$1);
+ blobCache.add(blobInfo);
+ } else {
+ blobInfo = existingBlobInfo;
+ }
+ pasteHtml$1(editor, '<img src="' + blobInfo.blobUri() + '">', false);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- blobInfo = existingBlobInfo;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ pasteHtml$1(editor, '<img src="' + imageItem.uri + '">', 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">- pasteHtml$1(editor, '<img src="' + blobInfo.blobUri() + '">', false);
- } else {
- pasteHtml$1(editor, '<img src="' + dataUri + '">', false);
- }
- };
- var isClipboardEvent = function (event$$1) {
- return event$$1.type === 'paste';
- };
- var pasteImageData = function (editor, e, rng) {
- var dataTransfer = isClipboardEvent(e) ? e.clipboardData : e.dataTransfer;
- function processItems(items) {
- var i, item, reader, hadImage = false;
- if (items) {
- for (i = 0; i < items.length; i++) {
- item = items[i];
- if (/^image\/(jpeg|png|gif|bmp)$/.test(item.type)) {
- var blob = item.getAsFile ? item.getAsFile() : item;
- reader = new window.FileReader();
- reader.onload = pasteImage.bind(null, editor, rng, reader, blob);
- reader.readAsDataURL(blob);
- e.preventDefault();
- hadImage = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var isClipboardEvent = function (event$$1) {
+ return event$$1.type === 'paste';
+ };
+ var readBlobsAsDataUris = function (items) {
+ return mapM(items, function (item) {
+ return Future.nu(function (resolve) {
+ var blob = item.getAsFile ? item.getAsFile() : item;
+ var reader = new window.FileReader();
+ reader.onload = function () {
+ resolve({
+ blob: blob,
+ uri: reader.result
+ });
+ };
+ reader.readAsDataURL(blob);
+ });
+ });
+ };
+ var getImagesFromDataTransfer = function (dataTransfer) {
+ var items = dataTransfer.items ? map(from$1(dataTransfer.items), function (item) {
+ return item.getAsFile();
+ }) : [];
+ var files = dataTransfer.files ? from$1(dataTransfer.files) : [];
+ var images = filter$1(items.length > 0 ? items : files, function (file) {
+ return /^image\/(jpeg|png|gif|bmp)$/.test(file.type);
+ });
+ return images;
+ };
+ var pasteImageData = function (editor, e, rng) {
+ var dataTransfer = isClipboardEvent(e) ? e.clipboardData : e.dataTransfer;
+ if (editor.settings.paste_data_images && dataTransfer) {
+ var images = getImagesFromDataTransfer(dataTransfer);
+ if (images.length > 0) {
+ e.preventDefault();
+ readBlobsAsDataUris(images).get(function (blobResults) {
+ if (rng) {
+ editor.selection.setRng(rng);
+ }
+ each(blobResults, function (result) {
+ pasteImage(editor, result);
+ });
+ });
+ return true;
+ }
+ }
+ return false;
+ };
+ var isBrokenAndroidClipboardEvent = function (e) {
+ var clipboardData = e.clipboardData;
+ return navigator.userAgent.indexOf('Android') !== -1 && clipboardData && clipboardData.items && clipboardData.items.length === 0;
+ };
+ var isKeyboardPasteEvent = function (e) {
+ return global$4.metaKeyPressed(e) && e.keyCode === 86 || e.shiftKey && e.keyCode === 45;
+ };
+ var registerEventHandlers = function (editor, pasteBin, pasteFormat) {
+ var keyboardPasteTimeStamp = 0;
+ var keyboardPastePlainTextState;
+ editor.on('keydown', function (e) {
+ function removePasteBinOnKeyUp(e) {
+ if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) {
+ pasteBin.remove();
</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">- }
- return hadImage;
- }
- if (editor.settings.paste_data_images && dataTransfer) {
- return processItems(dataTransfer.items) || processItems(dataTransfer.files);
- }
- };
- var isBrokenAndroidClipboardEvent = function (e) {
- var clipboardData = e.clipboardData;
- return navigator.userAgent.indexOf('Android') !== -1 && clipboardData && clipboardData.items && clipboardData.items.length === 0;
- };
- var isKeyboardPasteEvent = function (e) {
- return global$4.metaKeyPressed(e) && e.keyCode === 86 || e.shiftKey && e.keyCode === 45;
- };
- var registerEventHandlers = function (editor, pasteBin, pasteFormat) {
- var keyboardPasteTimeStamp = 0;
- var keyboardPastePlainTextState;
- editor.on('keydown', function (e) {
- function removePasteBinOnKeyUp(e) {
</del><span class="cx" style="display: block; padding: 0 10px"> if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ keyboardPastePlainTextState = e.shiftKey && e.keyCode === 86;
+ if (keyboardPastePlainTextState && global$1.webkit && navigator.userAgent.indexOf('Version/') !== -1) {
+ return;
+ }
+ e.stopImmediatePropagation();
+ keyboardPasteTimeStamp = new Date().getTime();
+ if (global$1.ie && keyboardPastePlainTextState) {
+ e.preventDefault();
+ Events.firePaste(editor, true);
+ return;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> pasteBin.remove();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ pasteBin.create();
+ editor.once('keyup', removePasteBinOnKeyUp);
+ editor.once('paste', function () {
+ editor.off('keyup', removePasteBinOnKeyUp);
+ });
</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 (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) {
- keyboardPastePlainTextState = e.shiftKey && e.keyCode === 86;
- if (keyboardPastePlainTextState && global$1.webkit && navigator.userAgent.indexOf('Version/') !== -1) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ function insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal) {
+ var content, isPlainTextHtml;
+ if (hasContentType(clipboardContent, 'text/html')) {
+ content = clipboardContent['text/html'];
+ } else {
+ content = pasteBin.getHtml();
+ internal = internal ? internal : InternalHtml.isMarked(content);
+ if (pasteBin.isDefaultContent(content)) {
+ plainTextMode = 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">- e.stopImmediatePropagation();
- keyboardPasteTimeStamp = new Date().getTime();
- if (global$1.ie && keyboardPastePlainTextState) {
- e.preventDefault();
- $_8tki3zijjjgwectj.firePaste(editor, true);
- return;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ content = Utils.trimHtml(content);
</ins><span class="cx" style="display: block; padding: 0 10px"> pasteBin.remove();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- pasteBin.create();
- editor.once('keyup', removePasteBinOnKeyUp);
- editor.once('paste', function () {
- editor.off('keyup', removePasteBinOnKeyUp);
- });
- }
- });
- function insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal) {
- var content, isPlainTextHtml;
- if (hasContentType(clipboardContent, 'text/html')) {
- content = clipboardContent['text/html'];
- } else {
- content = pasteBin.getHtml();
- internal = internal ? internal : $_4x13hjirjjgwecu1.isMarked(content);
- if (pasteBin.isDefaultContent(content)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ isPlainTextHtml = internal === false && Newlines.isPlainText(content);
+ if (!content.length || isPlainTextHtml) {
</ins><span class="cx" style="display: block; padding: 0 10px"> plainTextMode = true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- content = $_4bi2o9j0jjgwecui.trimHtml(content);
- pasteBin.remove();
- isPlainTextHtml = internal === false && $_4h3hnrisjjgwecu2.isPlainText(content);
- if (!content.length || isPlainTextHtml) {
- plainTextMode = true;
- }
- if (plainTextMode) {
- if (hasContentType(clipboardContent, 'text/plain') && isPlainTextHtml) {
- content = clipboardContent['text/plain'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (plainTextMode) {
+ if (hasContentType(clipboardContent, 'text/plain') && isPlainTextHtml) {
+ content = clipboardContent['text/plain'];
+ } else {
+ content = Utils.innerText(content);
+ }
+ }
+ if (pasteBin.isDefaultContent(content)) {
+ if (!isKeyBoardPaste) {
+ editor.windowManager.alert('Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.');
+ }
+ return;
+ }
+ if (plainTextMode) {
+ pasteText(editor, content);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- content = $_4bi2o9j0jjgwecui.innerText(content);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ pasteHtml$1(editor, content, internal);
</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">- if (pasteBin.isDefaultContent(content)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getLastRng = function () {
+ return pasteBin.getLastRng() || editor.selection.getRng();
+ };
+ editor.on('paste', function (e) {
+ var clipboardTimer = new Date().getTime();
+ var clipboardContent = getClipboardContent(editor, e);
+ var clipboardDelay = new Date().getTime() - clipboardTimer;
+ var isKeyBoardPaste = new Date().getTime() - keyboardPasteTimeStamp - clipboardDelay < 1000;
+ var plainTextMode = pasteFormat.get() === 'text' || keyboardPastePlainTextState;
+ var internal = hasContentType(clipboardContent, InternalHtml.internalHtmlMime());
+ keyboardPastePlainTextState = false;
+ if (e.isDefaultPrevented() || isBrokenAndroidClipboardEvent(e)) {
+ pasteBin.remove();
+ return;
+ }
+ if (!hasHtmlOrText(clipboardContent) && pasteImageData(editor, e, getLastRng())) {
+ pasteBin.remove();
+ return;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> if (!isKeyBoardPaste) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- editor.windowManager.alert('Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ e.preventDefault();
</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;
- }
- if (plainTextMode) {
- pasteText(editor, content);
- } else {
- pasteHtml$1(editor, content, internal);
- }
- }
- var getLastRng = function () {
- return pasteBin.getLastRng() || editor.selection.getRng();
- };
- editor.on('paste', function (e) {
- var clipboardTimer = new Date().getTime();
- var clipboardContent = getClipboardContent(editor, e);
- var clipboardDelay = new Date().getTime() - clipboardTimer;
- var isKeyBoardPaste = new Date().getTime() - keyboardPasteTimeStamp - clipboardDelay < 1000;
- var plainTextMode = pasteFormat.get() === 'text' || keyboardPastePlainTextState;
- var internal = hasContentType(clipboardContent, $_4x13hjirjjgwecu1.internalHtmlMime());
- keyboardPastePlainTextState = false;
- if (e.isDefaultPrevented() || isBrokenAndroidClipboardEvent(e)) {
- pasteBin.remove();
- return;
- }
- if (!hasHtmlOrText(clipboardContent) && pasteImageData(editor, e, getLastRng())) {
- pasteBin.remove();
- return;
- }
- if (!isKeyBoardPaste) {
- e.preventDefault();
- }
- if (global$1.ie && (!isKeyBoardPaste || e.ieFake) && !hasContentType(clipboardContent, 'text/html')) {
- pasteBin.create();
- editor.dom.bind(pasteBin.getEl(), 'paste', function (e) {
- e.stopPropagation();
- });
- editor.getDoc().execCommand('Paste', false, null);
- clipboardContent['text/html'] = pasteBin.getHtml();
- }
- if (hasContentType(clipboardContent, 'text/html')) {
- e.preventDefault();
- if (!internal) {
- internal = $_4x13hjirjjgwecu1.isMarked(clipboardContent['text/html']);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (global$1.ie && (!isKeyBoardPaste || e.ieFake) && !hasContentType(clipboardContent, 'text/html')) {
+ pasteBin.create();
+ editor.dom.bind(pasteBin.getEl(), 'paste', function (e) {
+ e.stopPropagation();
+ });
+ editor.getDoc().execCommand('Paste', false, null);
+ clipboardContent['text/html'] = pasteBin.getHtml();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal);
- } else {
- global$2.setEditorTimeout(editor, function () {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (hasContentType(clipboardContent, 'text/html')) {
+ e.preventDefault();
+ if (!internal) {
+ internal = InternalHtml.isMarked(clipboardContent['text/html']);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }, 0);
- }
- });
- };
- var registerEventsAndFilters = function (editor, pasteBin, pasteFormat) {
- registerEventHandlers(editor, pasteBin, pasteFormat);
- var src;
- editor.parser.addNodeFilter('img', function (nodes, name$$1, args) {
- var isPasteInsert = function (args) {
- return args.data && args.data.paste === true;
- };
- var remove = function (node) {
- if (!node.attr('data-mce-object') && src !== global$1.transparentSrc) {
- node.remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ global$2.setEditorTimeout(editor, function () {
+ insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal);
+ }, 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">- };
- var isWebKitFakeUrl = function (src) {
- return src.indexOf('webkit-fake-url') === 0;
- };
- var isDataUri = function (src) {
- return src.indexOf('data:') === 0;
- };
- if (!editor.settings.paste_data_images && isPasteInsert(args)) {
- var i = nodes.length;
- while (i--) {
- src = nodes[i].attributes.map.src;
- if (!src) {
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ var registerEventsAndFilters = function (editor, pasteBin, pasteFormat) {
+ registerEventHandlers(editor, pasteBin, pasteFormat);
+ var src;
+ editor.parser.addNodeFilter('img', function (nodes, name$$1, args) {
+ var isPasteInsert = function (args) {
+ return args.data && args.data.paste === true;
+ };
+ var remove = function (node) {
+ if (!node.attr('data-mce-object') && src !== global$1.transparentSrc) {
+ node.remove();
</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 (isWebKitFakeUrl(src)) {
- remove(nodes[i]);
- } else if (!editor.settings.allow_html_data_urls && isDataUri(src)) {
- remove(nodes[i]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var isWebKitFakeUrl = function (src) {
+ return src.indexOf('webkit-fake-url') === 0;
+ };
+ var isDataUri = function (src) {
+ return src.indexOf('data:') === 0;
+ };
+ if (!editor.settings.paste_data_images && isPasteInsert(args)) {
+ var i = nodes.length;
+ while (i--) {
+ src = nodes[i].attributes.map.src;
+ if (!src) {
+ continue;
+ }
+ if (isWebKitFakeUrl(src)) {
+ remove(nodes[i]);
+ } else if (!editor.settings.allow_html_data_urls && isDataUri(src)) {
+ remove(nodes[i]);
+ }
</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">- }
- });
- };
</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">- var getPasteBinParent = function (editor) {
- return global$1.ie && editor.inline ? document.body : editor.getBody();
- };
- var isExternalPasteBin = function (editor) {
- return getPasteBinParent(editor) !== editor.getBody();
- };
- var delegatePasteEvents = function (editor, pasteBinElm) {
- if (isExternalPasteBin(editor)) {
- editor.dom.bind(pasteBinElm, 'paste keyup', function (e) {
- setTimeout(function () {
- editor.fire('paste');
- }, 0);
- });
- }
- };
- var create = function (editor, lastRngCell, pasteBinDefaultContent) {
- var dom = editor.dom, body = editor.getBody();
- var pasteBinElm;
- lastRngCell.set(editor.selection.getRng());
- pasteBinElm = editor.dom.add(getPasteBinParent(editor), 'div', {
- 'id': 'mcepastebin',
- 'class': 'mce-pastebin',
- 'contentEditable': true,
- 'data-mce-bogus': 'all',
- 'style': 'position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0'
- }, pasteBinDefaultContent);
- if (global$1.ie || global$1.gecko) {
- dom.setStyle(pasteBinElm, 'left', dom.getStyle(body, 'direction', true) === 'rtl' ? 65535 : -65535);
- }
- dom.bind(pasteBinElm, 'beforedeactivate focusin focusout', function (e) {
- e.stopPropagation();
- });
- delegatePasteEvents(editor, pasteBinElm);
- pasteBinElm.focus();
- editor.selection.select(pasteBinElm, true);
- };
- var remove = function (editor, lastRngCell) {
- if (getEl(editor)) {
- var pasteBinClone = void 0;
- var lastRng = lastRngCell.get();
- while (pasteBinClone = editor.dom.get('mcepastebin')) {
- editor.dom.remove(pasteBinClone);
- editor.dom.unbind(pasteBinClone);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getPasteBinParent = function (editor) {
+ return global$1.ie && editor.inline ? document.body : editor.getBody();
+ };
+ var isExternalPasteBin = function (editor) {
+ return getPasteBinParent(editor) !== editor.getBody();
+ };
+ var delegatePasteEvents = function (editor, pasteBinElm, pasteBinDefaultContent) {
+ if (isExternalPasteBin(editor)) {
+ editor.dom.bind(pasteBinElm, 'paste keyup', function (e) {
+ if (!isDefault(editor, pasteBinDefaultContent)) {
+ editor.fire('paste');
+ }
+ });
</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 (lastRng) {
- editor.selection.setRng(lastRng);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var create = function (editor, lastRngCell, pasteBinDefaultContent) {
+ var dom = editor.dom, body = editor.getBody();
+ var pasteBinElm;
+ lastRngCell.set(editor.selection.getRng());
+ pasteBinElm = editor.dom.add(getPasteBinParent(editor), 'div', {
+ 'id': 'mcepastebin',
+ 'class': 'mce-pastebin',
+ 'contentEditable': true,
+ 'data-mce-bogus': 'all',
+ 'style': 'position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0'
+ }, pasteBinDefaultContent);
+ if (global$1.ie || global$1.gecko) {
+ dom.setStyle(pasteBinElm, 'left', dom.getStyle(body, 'direction', true) === 'rtl' ? 65535 : -65535);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- lastRngCell.set(null);
- };
- var getEl = function (editor) {
- return editor.dom.get('mcepastebin');
- };
- var getHtml = function (editor) {
- var pasteBinElm, pasteBinClones, i, dirtyWrappers, cleanWrapper;
- var copyAndRemove = function (toElm, fromElm) {
- toElm.appendChild(fromElm);
- editor.dom.remove(fromElm, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ dom.bind(pasteBinElm, 'beforedeactivate focusin focusout', function (e) {
+ e.stopPropagation();
+ });
+ delegatePasteEvents(editor, pasteBinElm, pasteBinDefaultContent);
+ pasteBinElm.focus();
+ editor.selection.select(pasteBinElm, 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">- pasteBinClones = global$3.grep(getPasteBinParent(editor).childNodes, function (elm) {
- return elm.id === 'mcepastebin';
- });
- pasteBinElm = pasteBinClones.shift();
- global$3.each(pasteBinClones, function (pasteBinClone) {
- copyAndRemove(pasteBinElm, pasteBinClone);
- });
- dirtyWrappers = editor.dom.select('div[id=mcepastebin]', pasteBinElm);
- for (i = dirtyWrappers.length - 1; i >= 0; i--) {
- cleanWrapper = editor.dom.create('div');
- pasteBinElm.insertBefore(cleanWrapper, dirtyWrappers[i]);
- copyAndRemove(cleanWrapper, dirtyWrappers[i]);
- }
- return pasteBinElm ? pasteBinElm.innerHTML : '';
- };
- var getLastRng = function (lastRng) {
- return lastRng.get();
- };
- var isDefaultContent = function (pasteBinDefaultContent, content) {
- return content === pasteBinDefaultContent;
- };
- var isPasteBin = function (elm) {
- return elm && elm.id === 'mcepastebin';
- };
- var isDefault = function (editor, pasteBinDefaultContent) {
- var pasteBinElm = getEl(editor);
- return isPasteBin(pasteBinElm) && isDefaultContent(pasteBinDefaultContent, pasteBinElm.innerHTML);
- };
- var PasteBin = function (editor) {
- var lastRng = Cell(null);
- var pasteBinDefaultContent = '%MCEPASTEBIN%';
- return {
- create: function () {
- return create(editor, lastRng, pasteBinDefaultContent);
- },
- remove: function () {
- return remove(editor, lastRng);
- },
- getEl: function () {
- return getEl(editor);
- },
- getHtml: function () {
- return getHtml(editor);
- },
- getLastRng: function () {
- return getLastRng(lastRng);
- },
- isDefault: function () {
- return isDefault(editor, pasteBinDefaultContent);
- },
- isDefaultContent: function (content) {
- return isDefaultContent(pasteBinDefaultContent, content);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var remove = function (editor, lastRngCell) {
+ if (getEl(editor)) {
+ var pasteBinClone = void 0;
+ var lastRng = lastRngCell.get();
+ while (pasteBinClone = editor.dom.get('mcepastebin')) {
+ editor.dom.remove(pasteBinClone);
+ editor.dom.unbind(pasteBinClone);
+ }
+ if (lastRng) {
+ editor.selection.setRng(lastRng);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ lastRngCell.set(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">- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getEl = function (editor) {
+ return editor.dom.get('mcepastebin');
+ };
+ var getHtml = function (editor) {
+ var pasteBinElm, pasteBinClones, i, dirtyWrappers, cleanWrapper;
+ var copyAndRemove = function (toElm, fromElm) {
+ toElm.appendChild(fromElm);
+ editor.dom.remove(fromElm, true);
+ };
+ pasteBinClones = global$3.grep(getPasteBinParent(editor).childNodes, function (elm) {
+ return elm.id === 'mcepastebin';
+ });
+ pasteBinElm = pasteBinClones.shift();
+ global$3.each(pasteBinClones, function (pasteBinClone) {
+ copyAndRemove(pasteBinElm, pasteBinClone);
+ });
+ dirtyWrappers = editor.dom.select('div[id=mcepastebin]', pasteBinElm);
+ for (i = dirtyWrappers.length - 1; i >= 0; i--) {
+ cleanWrapper = editor.dom.create('div');
+ pasteBinElm.insertBefore(cleanWrapper, dirtyWrappers[i]);
+ copyAndRemove(cleanWrapper, dirtyWrappers[i]);
+ }
+ return pasteBinElm ? pasteBinElm.innerHTML : '';
+ };
+ var getLastRng = function (lastRng) {
+ return lastRng.get();
+ };
+ var isDefaultContent = function (pasteBinDefaultContent, content) {
+ return content === pasteBinDefaultContent;
+ };
+ var isPasteBin = function (elm) {
+ return elm && elm.id === 'mcepastebin';
+ };
+ var isDefault = function (editor, pasteBinDefaultContent) {
+ var pasteBinElm = getEl(editor);
+ return isPasteBin(pasteBinElm) && isDefaultContent(pasteBinDefaultContent, pasteBinElm.innerHTML);
+ };
+ var PasteBin = function (editor) {
+ var lastRng = Cell(null);
+ var pasteBinDefaultContent = '%MCEPASTEBIN%';
+ return {
+ create: function () {
+ return create(editor, lastRng, pasteBinDefaultContent);
+ },
+ remove: function () {
+ return remove(editor, lastRng);
+ },
+ getEl: function () {
+ return getEl(editor);
+ },
+ getHtml: function () {
+ return getHtml(editor);
+ },
+ getLastRng: function () {
+ return getLastRng(lastRng);
+ },
+ isDefault: function () {
+ return isDefault(editor, pasteBinDefaultContent);
+ },
+ isDefaultContent: function (content) {
+ return isDefaultContent(pasteBinDefaultContent, content);
+ }
+ };
+ };
</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 Clipboard = function (editor, pasteFormat) {
- var pasteBin = PasteBin(editor);
- editor.on('preInit', function () {
- return registerEventsAndFilters(editor, pasteBin, pasteFormat);
- });
- return {
- pasteFormat: pasteFormat,
- pasteHtml: function (html, internalFlag) {
- return pasteHtml$1(editor, html, internalFlag);
- },
- pasteText: function (text) {
- return pasteText(editor, text);
- },
- pasteImageData: function (e, rng) {
- return pasteImageData(editor, e, rng);
- },
- getDataTransferItems: getDataTransferItems,
- hasHtmlOrText: hasHtmlOrText,
- hasContentType: hasContentType
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Clipboard = function (editor, pasteFormat) {
+ var pasteBin = PasteBin(editor);
+ editor.on('preInit', function () {
+ return registerEventsAndFilters(editor, pasteBin, pasteFormat);
+ });
+ return {
+ pasteFormat: pasteFormat,
+ pasteHtml: function (html, internalFlag) {
+ return pasteHtml$1(editor, html, internalFlag);
+ },
+ pasteText: function (text) {
+ return pasteText(editor, text);
+ },
+ pasteImageData: function (e, rng) {
+ return pasteImageData(editor, e, rng);
+ },
+ getDataTransferItems: getDataTransferItems,
+ hasHtmlOrText: hasHtmlOrText,
+ hasContentType: hasContentType
+ };
</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><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var noop = function () {
- };
- var hasWorkingClipboardApi = function (clipboardData) {
- return global$1.iOS === false && clipboardData !== undefined && typeof clipboardData.setData === 'function' && $_4bi2o9j0jjgwecui.isMsEdge() !== true;
- };
- var setHtml5Clipboard = function (clipboardData, html, text) {
- if (hasWorkingClipboardApi(clipboardData)) {
- try {
- clipboardData.clearData();
- clipboardData.setData('text/html', html);
- clipboardData.setData('text/plain', text);
- clipboardData.setData($_4x13hjirjjgwecu1.internalHtmlMime(), html);
- return true;
- } catch (e) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var noop$1 = function () {
+ };
+ var hasWorkingClipboardApi = function (clipboardData) {
+ return global$1.iOS === false && clipboardData !== undefined && typeof clipboardData.setData === 'function' && Utils.isMsEdge() !== true;
+ };
+ var setHtml5Clipboard = function (clipboardData, html, text) {
+ if (hasWorkingClipboardApi(clipboardData)) {
+ try {
+ clipboardData.clearData();
+ clipboardData.setData('text/html', html);
+ clipboardData.setData('text/plain', text);
+ clipboardData.setData(InternalHtml.internalHtmlMime(), html);
+ return true;
+ } catch (e) {
+ return false;
+ }
+ } else {
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- return false;
- }
- };
- var setClipboardData = function (evt, data, fallback, done) {
- if (setHtml5Clipboard(evt.clipboardData, data.html, data.text)) {
- evt.preventDefault();
- done();
- } else {
- fallback(data.html, done);
- }
- };
- var fallback = function (editor) {
- return function (html, done) {
- var markedHtml = $_4x13hjirjjgwecu1.mark(html);
- var outer = editor.dom.create('div', {
- 'contenteditable': 'false',
- 'data-mce-bogus': 'all'
- });
- var inner = editor.dom.create('div', { contenteditable: 'true' }, markedHtml);
- editor.dom.setStyles(outer, {
- position: 'fixed',
- top: '0',
- left: '-3000px',
- width: '1000px',
- overflow: 'hidden'
- });
- outer.appendChild(inner);
- editor.dom.add(editor.getBody(), outer);
- var range = editor.selection.getRng();
- inner.focus();
- var offscreenRange = editor.dom.createRng();
- offscreenRange.selectNodeContents(inner);
- editor.selection.setRng(offscreenRange);
- setTimeout(function () {
- editor.selection.setRng(range);
- outer.parentNode.removeChild(outer);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var setClipboardData = function (evt, data, fallback, done) {
+ if (setHtml5Clipboard(evt.clipboardData, data.html, data.text)) {
+ evt.preventDefault();
</ins><span class="cx" style="display: block; padding: 0 10px"> done();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }, 0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ fallback(data.html, 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">- };
- var getData = function (editor) {
- return {
- html: editor.selection.getContent({ contextual: true }),
- text: editor.selection.getContent({ format: 'text' })
- };
- };
- var cut = function (editor) {
- return function (evt) {
- if (editor.selection.isCollapsed() === false) {
- setClipboardData(evt, getData(editor), fallback(editor), function () {
- setTimeout(function () {
- editor.execCommand('Delete');
- }, 0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fallback = function (editor) {
+ return function (html, done) {
+ var markedHtml = InternalHtml.mark(html);
+ var outer = editor.dom.create('div', {
+ 'contenteditable': 'false',
+ 'data-mce-bogus': 'all'
</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">+ var inner = editor.dom.create('div', { contenteditable: 'true' }, markedHtml);
+ editor.dom.setStyles(outer, {
+ position: 'fixed',
+ top: '0',
+ left: '-3000px',
+ width: '1000px',
+ overflow: 'hidden'
+ });
+ outer.appendChild(inner);
+ editor.dom.add(editor.getBody(), outer);
+ var range = editor.selection.getRng();
+ inner.focus();
+ var offscreenRange = editor.dom.createRng();
+ offscreenRange.selectNodeContents(inner);
+ editor.selection.setRng(offscreenRange);
+ setTimeout(function () {
+ editor.selection.setRng(range);
+ outer.parentNode.removeChild(outer);
+ done();
+ }, 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">- };
- var copy = function (editor) {
- return function (evt) {
- if (editor.selection.isCollapsed() === false) {
- setClipboardData(evt, getData(editor), fallback(editor), noop);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getData = function (editor) {
+ return {
+ html: editor.selection.getContent({ contextual: true }),
+ text: editor.selection.getContent({ format: '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">- };
- var register$1 = function (editor) {
- editor.on('cut', cut(editor));
- editor.on('copy', copy(editor));
- };
- var $_32blojj3jjgwecv4 = { register: register$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isTableSelection = function (editor) {
+ return !!editor.dom.getParent(editor.selection.getStart(), 'td[data-mce-selected],th[data-mce-selected]', editor.getBody());
+ };
+ var hasSelectedContent = function (editor) {
+ return !editor.selection.isCollapsed() || isTableSelection(editor);
+ };
+ var cut = function (editor) {
+ return function (evt) {
+ if (hasSelectedContent(editor)) {
+ setClipboardData(evt, getData(editor), fallback(editor), function () {
+ setTimeout(function () {
+ editor.execCommand('Delete');
+ }, 0);
+ });
+ }
+ };
+ };
+ var copy = function (editor) {
+ return function (evt) {
+ if (hasSelectedContent(editor)) {
+ setClipboardData(evt, getData(editor), fallback(editor), noop$1);
+ }
+ };
+ };
+ var register$1 = function (editor) {
+ editor.on('cut', cut(editor));
+ editor.on('copy', copy(editor));
+ };
+ var CutCopy = { register: register$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">- var global$10 = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$a = tinymce.util.Tools.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">- var getCaretRangeFromEvent = function (editor, e) {
- return global$10.getCaretRangeFromPoint(e.clientX, e.clientY, editor.getDoc());
- };
- var isPlainTextFileUrl = function (content) {
- var plainTextContent = content['text/plain'];
- return plainTextContent ? plainTextContent.indexOf('file://') === 0 : false;
- };
- var setFocusedRange = function (editor, rng) {
- editor.focus();
- editor.selection.setRng(rng);
- };
- var setup = function (editor, clipboard, draggingInternallyState) {
- if ($_xr8b0ikjjgwectl.shouldBlockDrop(editor)) {
- editor.on('dragend dragover draggesture dragdrop drop drag', function (e) {
- e.preventDefault();
- e.stopPropagation();
- });
- }
- if (!$_xr8b0ikjjgwectl.shouldPasteDataImages(editor)) {
- editor.on('drop', function (e) {
- var dataTransfer = e.dataTransfer;
- if (dataTransfer && dataTransfer.files && dataTransfer.files.length > 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getCaretRangeFromEvent = function (editor, e) {
+ return global$a.getCaretRangeFromPoint(e.clientX, e.clientY, editor.getDoc());
+ };
+ var isPlainTextFileUrl = function (content) {
+ var plainTextContent = content['text/plain'];
+ return plainTextContent ? plainTextContent.indexOf('file://') === 0 : false;
+ };
+ var setFocusedRange = function (editor, rng) {
+ editor.focus();
+ editor.selection.setRng(rng);
+ };
+ var setup = function (editor, clipboard, draggingInternallyState) {
+ if (Settings.shouldBlockDrop(editor)) {
+ editor.on('dragend dragover draggesture dragdrop drop drag', function (e) {
</ins><span class="cx" style="display: block; padding: 0 10px"> e.preventDefault();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- });
- }
- editor.on('drop', function (e) {
- var dropContent, rng;
- rng = getCaretRangeFromEvent(editor, e);
- if (e.isDefaultPrevented() || draggingInternallyState.get()) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ e.stopPropagation();
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- dropContent = clipboard.getDataTransferItems(e.dataTransfer);
- var internal = clipboard.hasContentType(dropContent, $_4x13hjirjjgwecu1.internalHtmlMime());
- if ((!clipboard.hasHtmlOrText(dropContent) || isPlainTextFileUrl(dropContent)) && clipboard.pasteImageData(e, rng)) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!Settings.shouldPasteDataImages(editor)) {
+ editor.on('drop', function (e) {
+ var dataTransfer = e.dataTransfer;
+ if (dataTransfer && dataTransfer.files && dataTransfer.files.length > 0) {
+ e.preventDefault();
+ }
+ });
</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 && $_xr8b0ikjjgwectl.shouldFilterDrop(editor)) {
- var content_1 = dropContent['mce-internal'] || dropContent['text/html'] || dropContent['text/plain'];
- if (content_1) {
- e.preventDefault();
- global$2.setEditorTimeout(editor, function () {
- editor.undoManager.transact(function () {
- if (dropContent['mce-internal']) {
- editor.execCommand('Delete');
- }
- setFocusedRange(editor, rng);
- content_1 = $_4bi2o9j0jjgwecui.trimHtml(content_1);
- if (!dropContent['text/html']) {
- clipboard.pasteText(content_1);
- } else {
- clipboard.pasteHtml(content_1, internal);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('drop', function (e) {
+ var dropContent, rng;
+ rng = getCaretRangeFromEvent(editor, e);
+ if (e.isDefaultPrevented() || draggingInternallyState.get()) {
+ return;
+ }
+ dropContent = clipboard.getDataTransferItems(e.dataTransfer);
+ var internal = clipboard.hasContentType(dropContent, InternalHtml.internalHtmlMime());
+ if ((!clipboard.hasHtmlOrText(dropContent) || isPlainTextFileUrl(dropContent)) && clipboard.pasteImageData(e, rng)) {
+ return;
+ }
+ if (rng && Settings.shouldFilterDrop(editor)) {
+ var content_1 = dropContent['mce-internal'] || dropContent['text/html'] || dropContent['text/plain'];
+ if (content_1) {
+ e.preventDefault();
+ global$2.setEditorTimeout(editor, function () {
+ editor.undoManager.transact(function () {
+ if (dropContent['mce-internal']) {
+ editor.execCommand('Delete');
+ }
+ setFocusedRange(editor, rng);
+ content_1 = Utils.trimHtml(content_1);
+ if (!dropContent['text/html']) {
+ clipboard.pasteText(content_1);
+ } else {
+ clipboard.pasteHtml(content_1, internal);
+ }
+ });
</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">+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ editor.on('dragstart', function (e) {
+ draggingInternallyState.set(true);
+ });
+ editor.on('dragover dragend', function (e) {
+ if (Settings.shouldPasteDataImages(editor) && draggingInternallyState.get() === false) {
+ e.preventDefault();
+ setFocusedRange(editor, getCaretRangeFromEvent(editor, e));
+ }
+ if (e.type === 'dragend') {
+ draggingInternallyState.set(false);
+ }
+ });
+ };
+ var DragDrop = { setup: setup };
+
+ var setup$1 = function (editor) {
+ var plugin = editor.plugins.paste;
+ var preProcess = Settings.getPreProcess(editor);
+ if (preProcess) {
+ editor.on('PastePreProcess', function (e) {
+ preProcess.call(plugin, plugin, 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">- });
- editor.on('dragstart', function (e) {
- draggingInternallyState.set(true);
- });
- editor.on('dragover dragend', function (e) {
- if ($_xr8b0ikjjgwectl.shouldPasteDataImages(editor) && draggingInternallyState.get() === false) {
- e.preventDefault();
- setFocusedRange(editor, getCaretRangeFromEvent(editor, e));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var postProcess = Settings.getPostProcess(editor);
+ if (postProcess) {
+ editor.on('PastePostProcess', function (e) {
+ postProcess.call(plugin, plugin, 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">- if (e.type === 'dragend') {
- draggingInternallyState.set(false);
- }
- });
- };
- var $_b4etj0j4jjgwecv7 = { setup: setup };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var PrePostProcess = { setup: setup$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">- var setup$1 = function (editor) {
- var plugin = editor.plugins.paste;
- var preProcess = $_xr8b0ikjjgwectl.getPreProcess(editor);
- if (preProcess) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function addPreProcessFilter(editor, filterFunc) {
</ins><span class="cx" style="display: block; padding: 0 10px"> editor.on('PastePreProcess', function (e) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- preProcess.call(plugin, plugin, e);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ e.content = filterFunc(editor, e.content, e.internal, e.wordContent);
</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">- var postProcess = $_xr8b0ikjjgwectl.getPostProcess(editor);
- if (postProcess) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function addPostProcessFilter(editor, filterFunc) {
</ins><span class="cx" style="display: block; padding: 0 10px"> editor.on('PastePostProcess', function (e) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- postProcess.call(plugin, plugin, e);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ filterFunc(editor, e.node);
</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">- };
- var $_c5bihmj6jjgwecva = { setup: setup$1 };
-
- function addPreProcessFilter(editor, filterFunc) {
- editor.on('PastePreProcess', function (e) {
- e.content = filterFunc(editor, e.content, e.internal, e.wordContent);
- });
- }
- function addPostProcessFilter(editor, filterFunc) {
- editor.on('PastePostProcess', function (e) {
- filterFunc(editor, e.node);
- });
- }
- function removeExplorerBrElementsAfterBlocks(editor, html) {
- if (!$_dfatuiivjjgwecu8.isWordContent(html)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function removeExplorerBrElementsAfterBlocks(editor, html) {
+ if (!WordFilter.isWordContent(html)) {
+ return html;
+ }
+ var blockElements = [];
+ global$3.each(editor.schema.getBlockElements(), function (block, blockName) {
+ blockElements.push(blockName);
+ });
+ var explorerBlocksRegExp = new RegExp('(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?(' + blockElements.join('|') + ')[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*', 'g');
+ html = Utils.filter(html, [[
+ explorerBlocksRegExp,
+ '$1'
+ ]]);
+ html = Utils.filter(html, [
+ [
+ /<br><br>/g,
+ '<BR><BR>'
+ ],
+ [
+ /<br>/g,
+ ' '
+ ],
+ [
+ /<BR><BR>/g,
+ '<br>'
+ ]
+ ]);
</ins><span class="cx" style="display: block; padding: 0 10px"> return html;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var blockElements = [];
- global$3.each(editor.schema.getBlockElements(), function (block, blockName) {
- blockElements.push(blockName);
- });
- var explorerBlocksRegExp = new RegExp('(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?(' + blockElements.join('|') + ')[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*', 'g');
- html = $_4bi2o9j0jjgwecui.filter(html, [[
- explorerBlocksRegExp,
- '$1'
- ]]);
- html = $_4bi2o9j0jjgwecui.filter(html, [
- [
- /<br><br>/g,
- '<BR><BR>'
- ],
- [
- /<br>/g,
- ' '
- ],
- [
- /<BR><BR>/g,
- '<br>'
- ]
- ]);
- return html;
- }
- function removeWebKitStyles(editor, content, internal, isWordHtml) {
- if (isWordHtml || internal) {
- return content;
- }
- var webKitStylesSetting = $_xr8b0ikjjgwectl.getWebkitStyles(editor);
- var webKitStyles;
- if ($_xr8b0ikjjgwectl.shouldRemoveWebKitStyles(editor) === false || webKitStylesSetting === 'all') {
- return content;
- }
- if (webKitStylesSetting) {
- webKitStyles = webKitStylesSetting.split(/[, ]/);
- }
- if (webKitStyles) {
- var dom_1 = editor.dom, node_1 = editor.selection.getNode();
- content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, function (all, before, value, after) {
- var inputStyles = dom_1.parseStyle(dom_1.decode(value));
- var outputStyles = {};
- if (webKitStyles === 'none') {
- return before + after;
- }
- for (var i = 0; i < webKitStyles.length; i++) {
- var inputValue = inputStyles[webKitStyles[i]], currentValue = dom_1.getStyle(node_1, webKitStyles[i], true);
- if (/color/.test(webKitStyles[i])) {
- inputValue = dom_1.toHex(inputValue);
- currentValue = dom_1.toHex(currentValue);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function removeWebKitStyles(editor, content, internal, isWordHtml) {
+ if (isWordHtml || internal) {
+ return content;
+ }
+ var webKitStylesSetting = Settings.getWebkitStyles(editor);
+ var webKitStyles;
+ if (Settings.shouldRemoveWebKitStyles(editor) === false || webKitStylesSetting === 'all') {
+ return content;
+ }
+ if (webKitStylesSetting) {
+ webKitStyles = webKitStylesSetting.split(/[, ]/);
+ }
+ if (webKitStyles) {
+ var dom_1 = editor.dom, node_1 = editor.selection.getNode();
+ content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, function (all, before, value, after) {
+ var inputStyles = dom_1.parseStyle(dom_1.decode(value));
+ var outputStyles = {};
+ if (webKitStyles === 'none') {
+ return before + after;
</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 (currentValue !== inputValue) {
- outputStyles[webKitStyles[i]] = inputValue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (var i = 0; i < webKitStyles.length; i++) {
+ var inputValue = inputStyles[webKitStyles[i]], currentValue = dom_1.getStyle(node_1, webKitStyles[i], true);
+ if (/color/.test(webKitStyles[i])) {
+ inputValue = dom_1.toHex(inputValue);
+ currentValue = dom_1.toHex(currentValue);
+ }
+ if (currentValue !== inputValue) {
+ outputStyles[webKitStyles[i]] = inputValue;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- outputStyles = dom_1.serializeStyle(outputStyles, 'span');
- if (outputStyles) {
- return before + ' style="' + outputStyles + '"' + after;
- }
- return before + after;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ outputStyles = dom_1.serializeStyle(outputStyles, 'span');
+ if (outputStyles) {
+ return before + ' style="' + outputStyles + '"' + after;
+ }
+ return before + after;
+ });
+ } else {
+ content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, '$1$3');
+ }
+ content = content.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi, function (all, before, value, after) {
+ return before + ' style="' + value + '"' + after;
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, '$1$3');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return content;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- content = content.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi, function (all, before, value, after) {
- return before + ' style="' + value + '"' + after;
- });
- return content;
- }
- function removeUnderlineAndFontInAnchor(editor, root) {
- editor.$('a', root).find('font,u').each(function (i, node) {
- editor.dom.remove(node, true);
- });
- }
- var setup$2 = function (editor) {
- if (global$1.webkit) {
- addPreProcessFilter(editor, removeWebKitStyles);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function removeUnderlineAndFontInAnchor(editor, root) {
+ editor.$('a', root).find('font,u').each(function (i, node) {
+ editor.dom.remove(node, 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 (global$1.ie) {
- addPreProcessFilter(editor, removeExplorerBrElementsAfterBlocks);
- addPostProcessFilter(editor, removeUnderlineAndFontInAnchor);
- }
- };
- var $_36tmgyj7jjgwecvc = { setup: setup$2 };
-
- var curry = function (f) {
- var x = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- x[_i - 1] = arguments[_i];
- }
- var args = new Array(arguments.length - 1);
- for (var i = 1; i < arguments.length; i++)
- args[i - 1] = arguments[i];
- return function () {
- var x = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- x[_i] = arguments[_i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setup$2 = function (editor) {
+ if (global$1.webkit) {
+ addPreProcessFilter(editor, removeWebKitStyles);
</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 newArgs = new Array(arguments.length);
- for (var j = 0; j < newArgs.length; j++)
- newArgs[j] = arguments[j];
- var all = args.concat(newArgs);
- return f.apply(null, all);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (global$1.ie) {
+ addPreProcessFilter(editor, removeExplorerBrElementsAfterBlocks);
+ addPostProcessFilter(editor, removeUnderlineAndFontInAnchor);
+ }
</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">+ var Quirks = { setup: setup$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">- var stateChange = function (editor, clipboard, e) {
- var ctrl = e.control;
- ctrl.active(clipboard.pasteFormat.get() === 'text');
- editor.on('PastePlainTextToggle', function (e) {
- ctrl.active(e.state);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var stateChange = function (editor, clipboard, e) {
+ var ctrl = e.control;
+ ctrl.active(clipboard.pasteFormat.get() === 'text');
+ editor.on('PastePlainTextToggle', function (e) {
+ ctrl.active(e.state);
+ });
+ };
+ var register$2 = function (editor, clipboard) {
+ var postRender = curry(stateChange, editor, clipboard);
+ editor.addButton('pastetext', {
+ active: false,
+ icon: 'pastetext',
+ tooltip: 'Paste as text',
+ cmd: 'mceTogglePlainTextPaste',
+ onPostRender: postRender
+ });
+ editor.addMenuItem('pastetext', {
+ text: 'Paste as text',
+ selectable: true,
+ active: clipboard.pasteFormat,
+ cmd: 'mceTogglePlainTextPaste',
+ onPostRender: postRender
+ });
+ };
+ var Buttons = { register: register$2 };
+
+ global.add('paste', function (editor) {
+ if (DetectProPlugin.hasProPlugin(editor) === false) {
+ var userIsInformedState = Cell(false);
+ var draggingInternallyState = Cell(false);
+ var pasteFormat = Cell(Settings.isPasteAsTextEnabled(editor) ? 'text' : 'html');
+ var clipboard = Clipboard(editor, pasteFormat);
+ var quirks = Quirks.setup(editor);
+ Buttons.register(editor, clipboard);
+ Commands.register(editor, clipboard, userIsInformedState);
+ PrePostProcess.setup(editor);
+ CutCopy.register(editor);
+ DragDrop.setup(editor, clipboard, draggingInternallyState);
+ return Api.get(clipboard, quirks);
+ }
</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 register$2 = function (editor, clipboard) {
- var postRender = curry(stateChange, editor, clipboard);
- editor.addButton('pastetext', {
- active: false,
- icon: 'pastetext',
- tooltip: 'Paste as text',
- cmd: 'mceTogglePlainTextPaste',
- onPostRender: postRender
- });
- editor.addMenuItem('pastetext', {
- text: 'Paste as text',
- selectable: true,
- active: clipboard.pasteFormat,
- cmd: 'mceTogglePlainTextPaste',
- onPostRender: postRender
- });
- };
- var $_g9yhwdj8jjgwecvf = { register: register$2 };
-
- global.add('paste', function (editor) {
- if ($_15bf6siejjgwect1.hasProPlugin(editor) === false) {
- var userIsInformedState = Cell(false);
- var draggingInternallyState = Cell(false);
- var pasteFormat = Cell($_xr8b0ikjjgwectl.isPasteAsTextEnabled(editor) ? 'text' : 'html');
- var clipboard = Clipboard(editor, pasteFormat);
- var quirks = $_36tmgyj7jjgwecvc.setup(editor);
- $_g9yhwdj8jjgwecvf.register(editor, clipboard);
- $_fldd1mihjjgwecth.register(editor, clipboard, userIsInformedState);
- $_c5bihmj6jjgwecva.setup(editor);
- $_32blojj3jjgwecv4.register(editor);
- $_b4etj0j4jjgwecv7.setup(editor, clipboard, draggingInternallyState);
- return $_6gtliyigjjgwecte.get(clipboard, quirks);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function Plugin () {
</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 Plugin () {
- }
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return Plugin;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Plugin;
</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="trunksrcjs_enqueuesvendortinymcepluginspastepluginminjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/plugins/paste/plugin.min.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/plugins/paste/plugin.min.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/plugins/paste/plugin.min.js 2019-01-29 20:18:33 UTC (rev 44713)
</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(){"use strict";var u=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return u(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(e){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(e.settings.plugins)||!t.get("powerpaste")||("undefined"!=typeof window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),0))},s=function(e,t){return{clipboard:e,quirks:t}},f=function(e,t,n,r){return e.fire("PastePreProcess",{content:t,internal:n,wordContent:r})},d=function(e,t,n,r){return e.fire("PastePostProcess",{node:t,internal:n,wordContent:r})},l=function(e,t){return e.fire("PastePlainTextToggle",{state:t})},n=function(e,t){return e.fire("paste&quo
t;,{ieFake:t})},m={shouldPlainTextInform:function(e){return e.getParam("paste_plaintext_inform",!0)},shouldBlockDrop:function(e){return e.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(e){return e.getParam("paste_data_images",!1)},shouldFilterDrop:function(e){return e.getParam("paste_filter_drop",!0)},getPreProcess:function(e){return e.getParam("paste_preprocess")},getPostProcess:function(e){return e.getParam("paste_postprocess")},getWebkitStyles:function(e){return e.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(e){return e.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(e){return e.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(e){return e.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(e){return e.getParam("paste_as_text",!1)},getRetainStyleProps:function(e){return e.getParam("
paste_retain_style_properties")},getWordValidElements:function(e){return e.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")},shouldConvertWordFakeLists:function(e){return e.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(e){return e.getParam("paste_enable_default_filters",!0)}},r=function(e,t,n){var r,a,i;"text"===t.pasteFormat.get()?(t.pasteFormat.set("html"),l(e,!1)):(t.pasteFormat.set("text"),l(e,!0),i=e,!1===n.get()&&m.shouldPlainTextInform(i)&&(a="Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.",(r=e).notificationManager.open({text:r.translate(a),type:"info"}),n.set(!0))),e.focus()},c=function(e,n,
t){e.addCommand("mceTogglePlainTextPaste",function(){r(e,n,t)}),e.addCommand("mceInsertClipboardContent",function(e,t){t.content&&n.pasteHtml(t.content,t.internal),t.text&&n.pasteText(t.text)})},v=tinymce.util.Tools.resolve("tinymce.Env"),h=tinymce.util.Tools.resolve("tinymce.util.Delay"),b=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=tinymce.util.Tools.resolve("tinymce.util.VK"),e="x-tinymce/html",i="\x3c!-- "+e+" --\x3e",p=function(e){return i+e},g=function(e){return e.replace(i,"")},y=function(e){return-1!==e.indexOf(i)},x=function(){return e},P=tinymce.util.Tools.resolve("tinymce.html.Entities"),w=function(e){return e.replace(/\r?\n/g,"<br>")},_=function(e,t,n){var r=e.split(/\n\n/),a=function(e,t){var n,r=[],a="<"+e;if("object"==typeof t){for(n in t)t.hasOwnProperty(n)&&r.push(n+'="'+P.encodeAllRa
w(t[n])+'"');r.length&&(a+=" "+r.join(" "))}return a+">"}(t,n),i="</"+t+">",o=b.map(r,function(e){return e.split(/\n/).join("<br />")});return 1===o.length?o[0]:b.map(o,function(e){return a+e+i}).join("")},D=function(e){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(e)},T=function(e,t,n){return t?_(e,t,n):w(e)},C=tinymce.util.Tools.resolve("tinymce.html.DomParser"),k=tinymce.util.Tools.resolve("tinymce.html.Node"),R=tinymce.util.Tools.resolve("tinymce.html.Schema"),F=tinymce.util.Tools.resolve("tinymce.html.Serializer");function E(t,e){return b.each(e,function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])}),t}var S={filter:E,innerText:function(t){var n=R(),r=C({},n),a="",i=n.getShortEndedElements(),o=b.makeMap(&qu
ot;script noscript style textarea video audio iframe object"," "),s=n.getBlockElements();return t=E(t,[/<!\[[^\]]+\]>/g]),function e(t){var n=t.name,r=t;if("br"!==n)if(i[n]&&(a+=" "),o[n])a+=" ";else{if(3===t.type&&(a+=t.value),!t.shortEnded&&(t=t.firstChild))for(;e(t),t=t.next;);s[n]&&r.next&&(a+="\n","p"===n&&(a+="\n"))}else a+="\n"}(r.parse(t)),a},trimHtml:function(e){return e=E(e,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(e,t,n){return t||n?"\xa0":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},createIdGenerator:function(e){var t=0;return function(){return e+t++}},isMsEdge:function(){return-1!==navigator.userAgent.i
ndexOf(" Edge/")}};function I(t){var n,e;return e=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],t=t.replace(/^[\u00a0 ]+/,""),b.each(e,function(e){if(e.test(t))return!(n=!0)}),n}function M(e){var i,o,s=1;function n(e){var t="";if(3===e.type)return e.value;if(e=e.firstChild)for(;t+=n(e),e=e.next;);return t}function l(e,t){if(3===e.type&&t.test(e.value))return e.value=e.value.replace(t,""),!1;if(e=e.firstChild)do{if(!l(e,t))return!1}while(e=e.next);return!0}function t(t,n,r){var a=t._listLevel||s;a!==s&&(a<s?i&&(i=i.parent.parent):(o=i,i=null)),i&&i.name===n?i.append(t):(o=o||i,i=new k(n,1),1<r&&i.attr("start",""+r),t.wrap(i)),t.name=&q
uot;li",s<a&&o&&o.lastChild.append(i),s=a,function e(t){if(t._listIgnore)t.remove();else if(t=t.firstChild)for(;e(t),t=t.next;);}(t),l(t,/^\u00a0+/),l(t,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),l(t,/^\u00a0+/)}for(var r=[],a=e.firstChild;null!=a;)if(r.push(a),null!==(a=a.walk()))for(;void 0!==a&&a.parent!==e;)a=a.walk();for(var u=0;u<r.length;u++)if("p"===(e=r[u]).name&&e.firstChild){var c=n(e);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(c)){t(e,"ul");continue}if(I(c)){var f=/([0-9]+)\./.exec(c),d=1;f&&(d=parseInt(f[1],10)),t(e,"ol",d);continue}if(e._listLevel){t(e,"ul",1);continue}i=null}else o=i,i=null}function O(n,r,a,i){var o,s={},e=n.dom.parseStyle(i);return b.each(e,function(e,t){switch(t){case"mso-list":(o=/\w+ \w+([0-9]+)/i.exec(i))&&(a._listLevel=parseInt(o[1],10)),/Ignore/i.test(e)&&a.firstChild&&(a._listIgnore=!0,a.firstChild._listIgnore=!0
);break;case"horiz-align":t="text-align";break;case"vert-align":t="vertical-align";break;case"font-color":case"mso-foreground":t="color";break;case"mso-background":case"mso-highlight":t="background";break;case"font-weight":case"font-style":return void("normal"!==e&&(s[t]=e));case"mso-element":if(/^(comment|comment-list)$/i.test(e))return void a.remove()}0!==t.indexOf("mso-comment")?0!==t.indexOf("mso-")&&("all"===m.getRetainStyleProps(n)||r&&r[t])&&(s[t]=e):a.remove()}),/(bold)/i.test(s["font-weight"])&&(delete s["font-weight"],a.wrap(new k("b",1))),/(italic)/i.test(s["font-style"])&&(delete s["font-style"],a.wrap(new k("i",1))),(s=n.dom.serializeStyle(s,a.name))||null}var A={preProcess:function(e,t){return m.
shouldUseDefaultFilters(e)?function(r,e){var t,a;(t=m.getRetainStyleProps(r))&&(a=b.makeMap(t.split(/[, ]/))),e=S.filter(e,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(e,t){return 0<t.length?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\xa0"):""}]]);var n=m.getWordValidElements(r),i=R({valid_elements:n,valid_children:"-li[p]"});b.each(i.elements,function(e){e.attributes["class"]||(e.attributes["class"]={},e.attributesOrder.push("class")),e.attributes.styl
e||(e.attributes.style={},e.attributesOrder.push("style"))});var o=C({},i);o.addAttributeFilter("style",function(e){for(var t,n=e.length;n--;)(t=e[n]).attr("style",O(r,a,t,t.attr("style"))),"span"===t.name&&t.parent&&!t.attributes.length&&t.unwrap()}),o.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)n=(t=e[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&t.remove(),t.attr("class",null)}),o.addNodeFilter("del",function(e){for(var t=e.length;t--;)e[t].remove()}),o.addNodeFilter("a",function(e){for(var t,n,r,a=e.length;a--;)if(n=(t=e[a]).attr("href"),r=t.attr("name"),n&&-1!==n.indexOf("#_msocom_"))t.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r&&!/^_?(?:toc|edn|ftn)/i.te
st(r)){t.unwrap();continue}t.attr({href:n,name:r})}else t.unwrap()});var s=o.parse(e);return m.shouldConvertWordFakeLists(r)&&M(s),e=F({validate:r.settings.validate},i).serialize(s)}(e,t):t},isWordContent:function(e){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(e)||/class="OutlineElement/.test(e)||/id="?docs\-internal\-guid\-/.test(e)}},H=function(e,t){return{content:e,cancelled:t}},B=function(e,t,n,r){var a,i,o,s,l,u,c=f(e,t,n,r);return e.hasEventListeners("PastePostProcess")&&!c.isDefaultPrevented()?(a=e,i=c.content,o=n,s=r,l=a.dom.create("div",{style:"display:none"},i),u=d(a,l,o,s),H(u.node.innerHTML,u.isDefaultPrevented())):H(c.content,c.isDefaultPrevented())},L=function(e,t,n){var r=A.isWordContent(t),a=r?A.preProcess(e,t):t;return B(e,a,n,r)},$=function(e,t){return e.insertContent(t,{merge:m.shouldMergeFormats(e),paste:!0}),!0},j=f
unction(e){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(e)},W=function(e){return j(e)&&/.(gif|jpe?g|png)$/.test(e)},N=function(e,t,n){return!(!1!==e.selection.isCollapsed()||!j(t)||(a=t,i=n,(r=e).undoManager.extra(function(){i(r,a)},function(){r.execCommand("mceInsertLink",!1,a)}),0));var r,a,i},V=function(e,t,n){return!!W(t)&&(a=t,i=n,(r=e).undoManager.extra(function(){i(r,a)},function(){r.insertContent('<img src="'+a+'">')}),!0);var r,a,i},z=function(e,t){var n,r;!1===m.isSmartPasteEnabled(e)?$(e,t):(n=e,r=t,b.each([N,V,$],function(e){return!0!==e(n,r,$)}))},K=function(e,t,n){var r=n||y(t),a=L(e,g(t),r);!1===a.cancelled&&z(e,a.content)},U=function(e,t){t=e.dom.encode(t).replace(/\r\n/g,"\n"),t=T(t,e.settings.forced_root_block,e.settings.forced_root_block_attrs),K(e,t,!1)},G=function(e){var t={};if(e){if(e.getData){var n=e.getData("Text");n&&0<n.length&&-1===n.indexOf("data:text/mce-
internal,")&&(t["text/plain"]=n)}if(e.types)for(var r=0;r<e.types.length;r++){var a=e.types[r];try{t[a]=e.getData(a)}catch(i){t[a]=""}}}return t},X=function(e,t){return t in e&&0<e[t].length},q=function(e){return X(e,"text/html")||X(e,"text/plain")},Y=S.createIdGenerator("mceclip"),Z=function(e,t,n,r){t&&(e.selection.setRng(t),t=null);var a,i,o,s,l,u,c,f=n.result,d=-1!==(i=(a=f).indexOf(","))?a.substr(i+1):null,m=Y(),p=e.settings.images_reuse_filename&&r.name?(o=e,s=r.name,(l=s.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i))?o.dom.encode(l[1]):null):m,g=new Image;if(g.src=f,u=e.settings,c=g,!u.images_dataimg_filter||u.images_dataimg_filter(c)){var v,h=e.editorUpload.blobCache,b=void 0;(v=h.findFirst(function(e){return e.base64()===d}))?b=v:(b=h.create(m,r,d,p),h.add(b)),K(e,'<img src="'+b.blobUri()+'">',!1)}else K(e,'<img src="'+f+'">',!1)},J=function(o
,s,l){var e="paste"===s.type?s.clipboardData:s.dataTransfer;function t(e){var t,n,r,a=!1;if(e)for(t=0;t<e.length;t++)if(n=e[t],/^image\/(jpeg|png|gif|bmp)$/.test(n.type)){var i=n.getAsFile?n.getAsFile():n;(r=new window.FileReader).onload=Z.bind(null,o,l,r,i),r.readAsDataURL(i),s.preventDefault(),a=!0}return a}if(o.settings.paste_data_images&&e)return t(e.items)||t(e.files)},Q=function(e){return a.metaKeyPressed(e)&&86===e.keyCode||e.shiftKey&&45===e.keyCode},ee=function(c,f,d){var m,p=0;function g(e,t,n,r){var a,i;X(e,"text/html")?a=e["text/html"]:(a=f.getHtml(),r=r||y(a),f.isDefaultContent(a)&&(n=!0)),a=S.trimHtml(a),f.remove(),i=!1===r&&D(a),a.length&&!i||(n=!0),n&&(a=X(e,"text/plain")&&i?e["text/plain"]:S.innerText(a)),f.isDefaultContent(a)?t||c.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):n?U(c,a):K(c,a,r)}c.on(&qu
ot;keydown",function(e){function t(e){Q(e)&&!e.isDefaultPrevented()&&f.remove()}if(Q(e)&&!e.isDefaultPrevented()){if((m=e.shiftKey&&86===e.keyCode)&&v.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(e.stopImmediatePropagation(),p=(new Date).getTime(),v.ie&&m)return e.preventDefault(),void n(c,!0);f.remove(),f.create(),c.once("keyup",t),c.once("paste",function(){c.off("keyup",t)})}}),c.on("paste",function(e){var t,n,r,a=(new Date).getTime(),i=(t=c,n=G(e.clipboardData||t.getDoc().dataTransfer),S.isMsEdge()?b.extend(n,{"text/html":""}):n),o=(new Date).getTime()-a,s=(new Date).getTime()-p-o<1e3,l="text"===d.get()||m,u=X(i,x());m=!1,e.isDefaultPrevented()||(r=e.clipboardData,-1!==navigator.userAgent.indexOf("Android")&&r&&r.items&&0===r.items.length)?f.remove():q(i)||!J(c,e,f.getLastRng()||c.select
ion.getRng())?(s||e.preventDefault(),!v.ie||s&&!e.ieFake||X(i,"text/html")||(f.create(),c.dom.bind(f.getEl(),"paste",function(e){e.stopPropagation()}),c.getDoc().execCommand("Paste",!1,null),i["text/html"]=f.getHtml()),X(i,"text/html")?(e.preventDefault(),u||(u=y(i["text/html"])),g(i,s,l,u)):h.setEditorTimeout(c,function(){g(i,s,l,u)},0)):f.remove()})},te=function(e){return v.ie&&e.inline?document.body:e.getBody()},ne=function(t,e){var n;te(n=t)!==n.getBody()&&t.dom.bind(e,"paste keyup",function(e){setTimeout(function(){t.fire("paste")},0)})},re=function(e){return e.dom.get("mcepastebin")},ae=function(e,t){return t===e},ie=function(o){var s=u(null),l="%MCEPASTEBIN%";return{create:function(){return t=s,n=l,a=(e=o).dom,i=e.getBody(),t.set(e.selection.getRng()),r=e.dom.add(te(e),"div",{id:"mcepastebin","class":"mce-pastebin"
,contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n),(v.ie||v.gecko)&&a.setStyle(r,"left","rtl"===a.getStyle(i,"direction",!0)?65535:-65535),a.bind(r,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),ne(e,r),r.focus(),void e.selection.select(r,!0);var e,t,n,r,a,i},remove:function(){return function(e,t){if(re(e)){for(var n=void 0,r=t.get();n=e.dom.get("mcepastebin");)e.dom.remove(n),e.dom.unbind(n);r&&e.selection.setRng(r)}t.set(null)}(o,s)},getEl:function(){return re(o)},getHtml:function(){return function(n){var t,e,r,a,i,o=function(e,t){e.appendChild(t),n.dom.remove(t,!0)};for(e=b.grep(te(n).childNodes,function(e){return"mcepastebin"===e.id}),t=e.shift(),b.each(e,function(e){o(t,e)}),r=(a=n.dom.select("div[id=mcepastebin]",t)).length-1;0<=r;r--)i=n.dom.create(&q
uot;div"),t.insertBefore(i,a[r]),o(i,a[r]);return t?t.innerHTML:""}(o)},getLastRng:function(){return s.get()},isDefault:function(){return e=l,n=re(o),(t=n)&&"mcepastebin"===t.id&&ae(e,n.innerHTML);var e,t,n},isDefaultContent:function(e){return ae(l,e)}}},oe=function(n,e){var t=ie(n);return n.on("preInit",function(){return ee(o=n,t,e),void o.parser.addNodeFilter("img",function(e,t,n){var r,a=function(e){e.attr("data-mce-object")||s===v.transparentSrc||e.remove()};if(!o.settings.paste_data_images&&(r=n).data&&!0===r.data.paste)for(var i=e.length;i--;)(s=e[i].attributes.map.src)&&(0===s.indexOf("webkit-fake-url")?a(e[i]):o.settings.allow_html_data_urls||0!==s.indexOf("data:")||a(e[i]))});var o,s}),{pasteFormat:e,pasteHtml:function(e,t){return K(n,e,t)},pasteText:function(e){return U(n,e)},pasteImageData:function(e,t){return J(n,e,t)},getDataTransferItems:G,hasHtmlOrText:q,
hasContentType:X}},se=function(){},le=function(e,t,n){if(r=e,!1!==v.iOS||r===undefined||"function"!=typeof r.setData||!0===S.isMsEdge())return!1;try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",n),e.setData(x(),t),!0}catch(a){return!1}var r},ue=function(e,t,n,r){le(e.clipboardData,t.html,t.text)?(e.preventDefault(),r()):n(t.html,r)},ce=function(s){return function(e,t){var n=p(e),r=s.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),a=s.dom.create("div",{contenteditable:"true"},n);s.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(a),s.dom.add(s.getBody(),r);var i=s.selection.getRng();a.focus();var o=s.dom.createRng();o.selectNodeContents(a),s.selection.setRng(o),setTimeout(function(){s.selection.setRng(i),r.parentNode.removeChild(r),t()},0)}},fe=fun
ction(e){return{html:e.selection.getContent({contextual:!0}),text:e.selection.getContent({format:"text"})}},de=function(e){var t,n;e.on("cut",(t=e,function(e){!1===t.selection.isCollapsed()&&ue(e,fe(t),ce(t),function(){setTimeout(function(){t.execCommand("Delete")},0)})})),e.on("copy",(n=e,function(e){!1===n.selection.isCollapsed()&&ue(e,fe(n),ce(n),se)}))},me=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),pe=function(e,t){return me.getCaretRangeFromPoint(t.clientX,t.clientY,e.getDoc())},ge=function(e,t){e.focus(),e.selection.setRng(t)},ve=function(o,s,l){m.shouldBlockDrop(o)&&o.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),m.shouldPasteDataImages(o)||o.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&0<t.files.length&&e.preventDefault()}),o.on("drop",function(e){var t,n;if(n=pe(o,e)
,!e.isDefaultPrevented()&&!l.get()){t=s.getDataTransferItems(e.dataTransfer);var r,a=s.hasContentType(t,x());if((s.hasHtmlOrText(t)&&(!(r=t["text/plain"])||0!==r.indexOf("file://"))||!s.pasteImageData(e,n))&&n&&m.shouldFilterDrop(o)){var i=t["mce-internal"]||t["text/html"]||t["text/plain"];i&&(e.preventDefault(),h.setEditorTimeout(o,function(){o.undoManager.transact(function(){t["mce-internal"]&&o.execCommand("Delete"),ge(o,n),i=S.trimHtml(i),t["text/html"]?s.pasteHtml(i,a):s.pasteText(i)})}))}}}),o.on("dragstart",function(e){l.set(!0)}),o.on("dragover dragend",function(e){m.shouldPasteDataImages(o)&&!1===l.get()&&(e.preventDefault(),ge(o,pe(o,e))),"dragend"===e.type&&l.set(!1)})},he=function(e){var t=e.plugins.paste,n=m.getPreProcess(e);n&&e.on("PastePreProcess",function(e){n.call(t,t,
e)});var r=m.getPostProcess(e);r&&e.on("PastePostProcess",function(e){r.call(t,t,e)})};function be(t,n){t.on("PastePreProcess",function(e){e.content=n(t,e.content,e.internal,e.wordContent)})}function ye(e,t){if(!A.isWordContent(t))return t;var n=[];b.each(e.schema.getBlockElements(),function(e,t){n.push(t)});var r=new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g");return t=S.filter(t,[[r,"$1"]]),t=S.filter(t,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function xe(e,t,n,r){if(r||n)return t;var u,a=m.getWebkitStyles(e);if(!1===m.shouldRemoveWebKitStyles(e)||"all"===a)return t;if(a&&(u=a.split(/[, ]/)),u){var c=e.dom,f=e.selection.getNode();t=t.replace(/(<[^>]+) style="([^"]*)&qu
ot;([^>]*>)/gi,function(e,t,n,r){var a=c.parseStyle(c.decode(n)),i={};if("none"===u)return t+r;for(var o=0;o<u.length;o++){var s=a[u[o]],l=c.getStyle(f,u[o],!0);/color/.test(u[o])&&(s=c.toHex(s),l=c.toHex(l)),l!==s&&(i[u[o]]=s)}return(i=c.serializeStyle(i,"span"))?t+' style="'+i+'"'+r:t+r})}else t=t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return t=t.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(e,t,n,r){return t+' style="'+n+'"'+r})}function Pe(n,e){n.$("a",e).find("font,u").each(function(e,t){n.dom.remove(t,!0)})}var we=function(e){var t,n;v.webkit&&be(e,xe),v.ie&&(be(e,ye),n=Pe,(t=e).on("PastePostProcess",function(e){n(t,e.node)}))},_e=function(e,t,n){var r=n.control;r.active("text"===t.pasteFormat.get()),e.on("PastePlainTextToggle",function(e){r.active(e.stat
e)})},De=function(e,t){var n=function(i){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var o=new Array(arguments.length-1),n=1;n<arguments.length;n++)o[n-1]=arguments[n];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var a=o.concat(n);return i.apply(null,a)}}(_e,e,t);e.addButton("pastetext",{active:!1,icon:"pastetext",tooltip:"Paste as text",cmd:"mceTogglePlainTextPaste",onPostRender:n}),e.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:t.pasteFormat,cmd:"mceTogglePlainTextPaste",onPostRender:n})};t.add("paste",function(e){if(!1===o(e)){var t=u(!1),n=u(!1),r=u(m.isPasteAsTextEnabled(e)?"text":"html"),a=oe(e,r),i=we(e);return De(e,a),c(e,a,t),he(e),de(e),ve(e,a,n),s(a,i)}})}();
</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(){"use strict";var l=function(t){var e=t,n=function(){return e};return{get:n,set:function(t){e=t},clone:function(){return l(n())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(t){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(t.settings.plugins)||!e.get("powerpaste")||("undefined"!=typeof window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),0))},s=function(t,e){return{clipboard:t,quirks:e}},f=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})},d=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})},u=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},n=function(t,e){return t.fire("paste&quo
t;,{ieFake:e})},m={shouldPlainTextInform:function(t){return t.getParam("paste_plaintext_inform",!0)},shouldBlockDrop:function(t){return t.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(t){return t.getParam("paste_data_images",!1)},shouldFilterDrop:function(t){return t.getParam("paste_filter_drop",!0)},getPreProcess:function(t){return t.getParam("paste_preprocess")},getPostProcess:function(t){return t.getParam("paste_postprocess")},getWebkitStyles:function(t){return t.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(t){return t.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(t){return t.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(t){return t.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(t){return t.getParam("paste_as_text",!1)},getRetainStyleProps:function(t){return t.getParam("
paste_retain_style_properties")},getWordValidElements:function(t){return t.getParam("paste_word_valid_elements","-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody")},shouldConvertWordFakeLists:function(t){return t.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(t){return t.getParam("paste_enable_default_filters",!0)}},r=function(t,e,n){var r,o,i;"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),u(t,!1)):(e.pasteFormat.set("text"),u(t,!0),i=t,!1===n.get()&&m.shouldPlainTextInform(i)&&(o="Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.",(r=t).notificationManager.open({text:r.translate(o),type:"info"}),n.set(!0))),t.focus()},c=function(t,n,
e){t.addCommand("mceTogglePlainTextPaste",function(){r(t,n,e)}),t.addCommand("mceInsertClipboardContent",function(t,e){e.content&&n.pasteHtml(e.content,e.internal),e.text&&n.pasteText(e.text)})},v=tinymce.util.Tools.resolve("tinymce.Env"),h=tinymce.util.Tools.resolve("tinymce.util.Delay"),y=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),t="x-tinymce/html",i="\x3c!-- "+t+" --\x3e",g=function(t){return i+t},p=function(t){return t.replace(i,"")},b=function(t){return-1!==t.indexOf(i)},x=function(){return t},P=tinymce.util.Tools.resolve("tinymce.html.Entities"),w=function(t){return t.replace(/\r?\n/g,"<br>")},_=function(t,e,n){var r=t.split(/\n\n/),o=function(t,e){var n,r=[],o="<"+t;if("object"==typeof e){for(n in e)e.hasOwnProperty(n)&&r.push(n+'="'+P.encodeAllRa
w(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="</"+e+">",a=y.map(r,function(t){return t.split(/\n/).join("<br />")});return 1===a.length?a[0]:y.map(a,function(t){return o+t+i}).join("")},D=function(t){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(t)},T=function(t,e,n){return e?_(t,e,n):w(t)},C=tinymce.util.Tools.resolve("tinymce.html.DomParser"),k=tinymce.util.Tools.resolve("tinymce.html.Node"),S=tinymce.util.Tools.resolve("tinymce.html.Schema"),O=tinymce.util.Tools.resolve("tinymce.html.Serializer");function R(e,t){return y.each(t,function(t){e=t.constructor===RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}var F={filter:R,innerText:function(e){var n=S(),r=C({},n),o="",i=n.getShortEndedElements(),a=y.makeMap(&qu
ot;script noscript style textarea video audio iframe object"," "),s=n.getBlockElements();return e=R(e,[/<!\[[^\]]+\]>/g]),function t(e){var n=e.name,r=e;if("br"!==n){if("wbr"!==n)if(i[n]&&(o+=" "),a[n])o+=" ";else{if(3===e.type&&(o+=e.value),!e.shortEnded&&(e=e.firstChild))for(;t(e),e=e.next;);s[n]&&r.next&&(o+="\n","p"===n&&(o+="\n"))}}else o+="\n"}(r.parse(e)),o},trimHtml:function(t){return t=R(t,[/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/<!--StartFragment-->|<!--EndFragment-->/g,[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g,function(t,e,n){return e||n?"\xa0":" "}],/<br class="Apple-interchange-newline">/g,/<br>$/i])},createIdGenerator:function(t){var e=0;return function(){return t+e++}},isMsEdge:function(){return-
1!==navigator.userAgent.indexOf(" Edge/")}};function E(e){var n,t;return t=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],e=e.replace(/^[\u00a0 ]+/,""),y.each(t,function(t){if(t.test(e))return!(n=!0)}),n}function A(t){var i,a,s=1;function n(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)for(;e+=n(t),t=t.next;);return e}function u(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!u(t,e))return!1}while(t=t.next);return!0}function e(e,n,r){var o=e._listLevel||s;o!==s&&(o<s?i&&(i=i.parent.parent):(a=i,i=null)),i&&i.name===n?i.append(e):(a=a||i,i=new k(n,1),1<r&&i.attr("start",""
;+r),e.wrap(i)),e.name="li",s<o&&a&&a.lastChild.append(i),s=o,function t(e){if(e._listIgnore)e.remove();else if(e=e.firstChild)for(;t(e),e=e.next;);}(e),u(e,/^\u00a0+/),u(e,/^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/),u(e,/^\u00a0+/)}for(var r=[],o=t.firstChild;null!=o;)if(r.push(o),null!==(o=o.walk()))for(;void 0!==o&&o.parent!==t;)o=o.walk();for(var l=0;l<r.length;l++)if("p"===(t=r[l]).name&&t.firstChild){var c=n(t);if(/^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(c)){e(t,"ul");continue}if(E(c)){var f=/([0-9]+)\./.exec(c),d=1;f&&(d=parseInt(f[1],10)),e(t,"ol",d);continue}if(t._listLevel){e(t,"ul",1);continue}i=null}else a=i,i=null}function I(n,r,o,i){var a,s={},t=n.dom.parseStyle(i);return y.each(t,function(t,e){switch(e){case"mso-list":(a=/\w+ \w+([0-9]+)/i.exec(i))&&(o._listLevel=parseInt(a[1],10)),/Ignore/i.test(t)&&o.firstChild&&(o._listIgnore=!0,o.
firstChild._listIgnore=!0);break;case"horiz-align":e="text-align";break;case"vert-align":e="vertical-align";break;case"font-color":case"mso-foreground":e="color";break;case"mso-background":case"mso-highlight":e="background";break;case"font-weight":case"font-style":return void("normal"!==t&&(s[e]=t));case"mso-element":if(/^(comment|comment-list)$/i.test(t))return void o.remove()}0!==e.indexOf("mso-comment")?0!==e.indexOf("mso-")&&("all"===m.getRetainStyleProps(n)||r&&r[e])&&(s[e]=t):o.remove()}),/(bold)/i.test(s["font-weight"])&&(delete s["font-weight"],o.wrap(new k("b",1))),/(italic)/i.test(s["font-style"])&&(delete s["font-style"],o.wrap(new k("i",1))),(s=n.dom.serializeStyle(s,o.name))||null}var M,B,H,j,L,N=
{preProcess:function(t,e){return m.shouldUseDefaultFilters(t)?function(r,t){var e,o;(e=m.getRetainStyleProps(r))&&(o=y.makeMap(e.split(/[, ]/))),t=F.filter(t,[/<br class="?Apple-interchange-newline"?>/gi,/<b[^>]+id="?docs-internal-[^>]*>/gi,/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(t,e){return 0<e.length?e.replace(/./," ").slice(Math.floor(e.length/2)).split("").join("\xa0"):""}]]);var n=m.getWordValidElements(r),i=S({valid_elements:n,valid_children:"-li[p]"});y.each(i.elements,function(t){t.attributes["class"]||(t.attributes["class"]={},t.attributesOrder.push(&q
uot;class")),t.attributes.style||(t.attributes.style={},t.attributesOrder.push("style"))});var a=C({},i);a.addAttributeFilter("style",function(t){for(var e,n=t.length;n--;)(e=t[n]).attr("style",I(r,o,e,e.attr("style"))),"span"===e.name&&e.parent&&!e.attributes.length&&e.unwrap()}),a.addAttributeFilter("class",function(t){for(var e,n,r=t.length;r--;)n=(e=t[r]).attr("class"),/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(n)&&e.remove(),e.attr("class",null)}),a.addNodeFilter("del",function(t){for(var e=t.length;e--;)t[e].remove()}),a.addNodeFilter("a",function(t){for(var e,n,r,o=t.length;o--;)if(n=(e=t[o]).attr("href"),r=e.attr("name"),n&&-1!==n.indexOf("#_msocom_"))e.remove();else if(n&&0===n.indexOf("file://")&&(n=n.split("#")[1])&&(n="#"+n),n||r){if(r
&&!/^_?(?:toc|edn|ftn)/i.test(r)){e.unwrap();continue}e.attr({href:n,name:r})}else e.unwrap()});var s=a.parse(t);return m.shouldConvertWordFakeLists(r)&&A(s),t=O({validate:r.settings.validate},i).serialize(s)}(t,e):e},isWordContent:function(t){return/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(t)||/class="OutlineElement/.test(t)||/id="?docs\-internal\-guid\-/.test(t)}},$=function(t,e){return{content:t,cancelled:e}},W=function(t,e,n,r){var o,i,a,s,u,l,c=f(t,e,n,r);return t.hasEventListeners("PastePostProcess")&&!c.isDefaultPrevented()?(o=t,i=c.content,a=n,s=r,u=o.dom.create("div",{style:"display:none"},i),l=d(o,u,a,s),$(l.node.innerHTML,l.isDefaultPrevented())):$(c.content,c.isDefaultPrevented())},z=function(t,e,n){var r=N.isWordContent(e),o=r?N.preProcess(t,e):e;return W(t,o,n,r)},U=function(t,e){var n,r;return t.insertContent((n=e,r=t
.dom.create("body",{},n),y.each(r.querySelectorAll("meta"),function(t){return t.parentNode.removeChild(t)}),r.innerHTML),{merge:m.shouldMergeFormats(t),paste:!0}),!0},V=function(t){return/^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(t)},q=function(t){return V(t)&&/.(gif|jpe?g|png)$/.test(t)},K=function(t,e,n){return!(!1!==t.selection.isCollapsed()||!V(e)||(o=e,i=n,(r=t).undoManager.extra(function(){i(r,o)},function(){r.execCommand("mceInsertLink",!1,o)}),0));var r,o,i},G=function(t,e,n){return!!q(e)&&(o=e,i=n,(r=t).undoManager.extra(function(){i(r,o)},function(){r.insertContent('<img src="'+o+'">')}),!0);var r,o,i},X=function(t,e){var n,r;!1===m.isSmartPasteEnabled(t)?U(t,e):(n=t,r=e,y.each([K,G,U],function(t){return!0!==t(n,r,U)}))},Y=function(t){return function(){return t}},Z=Y(!1),J=Y(!0),Q=Z,tt=J,et=function(){return nt},nt=(j={fold:function(t,e){return t()},is:Q,isSome:Q,isNone:tt,getOr:H=function(t){return t},getOrTh
unk:B=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},or:H,orThunk:B,map:et,ap:et,each:function(){},bind:et,flatten:et,exists:Q,forall:tt,filter:et,equals:M=function(t){return t.isNone()},equals_:M,toArray:function(){return[]},toString:Y("none()")},Object.freeze&&Object.freeze(j),j),rt=function(n){var t=function(){return n},e=function(){return o},r=function(t){return t(n)},o={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:tt,isNone:Q,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return rt(t(n))},ap:function(t){return t.fold(et,function(t){return rt(t(n))})},each:function(t){t(n)},bind:r,flatten:t,exists:r,forall:r,filter:function(t){return t(n)?o:nt},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(Q,function(t){return e(n,t)})},toArray:fun
ction(){return[n]},toString:function(){return"some("+n+")"}};return o},ot={some:rt,none:et,from:function(t){return null===t||t===undefined?nt:rt(t)}},it=(L="function",function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&Array.prototype.isPrototypeOf(t)?"array":"object"===e&&String.prototype.isPrototypeOf(t)?"string":e}(t)===L}),at=function(t,e){for(var n=t.length,r=new Array(n),o=0;o<n;o++){var i=t[o];r[o]=e(i,o,t)}return r},st=function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n,t)},ut=Array.prototype.slice,lt=it(Array.from)?Array.from:function(t){return ut.call(t)},ct=function(t){var n=ot.none(),e=[],r=function(t){o()?a(t):e.push(t)},o=function(){return n.isSome()},i=function(t){st(t,a)},a=function(e){n.each(function(t){setTimeout(function(){e(t)},0)})};return t(function(t){n=ot.some(t),i(e),e=[]}),{get:r,map:function(n){return ct(function(e)
{r(function(t){e(n(t))})})},isReady:o}},ft={nu:ct,pure:function(e){return ct(function(t){t(e)})}},dt=function(e){var t=function(t){var r;e((r=t,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this;setTimeout(function(){r.apply(n,t)},0)}))},n=function(){return ft.nu(t)};return{map:function(r){return dt(function(n){t(function(t){var e=r(t);n(e)})})},bind:function(n){return dt(function(e){t(function(t){n(t).get(e)})})},anonBind:function(n){return dt(function(e){t(function(t){n.get(e)})})},toLazy:n,toCached:function(){var e=null;return dt(function(t){null===e&&(e=n()),e.get(t)})},get:t}},mt={nu:dt,pure:function(e){return dt(function(t){t(e)})}},gt=function(a,t){return t(function(r){var o=[],i=0;0===a.length?r([]):st(a,function(t,e){var n;t.get((n=e,function(t){o[n]=t,++i>=a.length&&r(o)}))})})},pt=function(t,e){var n=at(t,e);return gt(n,mt.nu)},vt=function(t,e,n){var r=n||b(e),o=z(t,p(e),r);!1===o.cancelled&&X(t,o.content)},ht=fun
ction(t,e){e=t.dom.encode(e).replace(/\r\n/g,"\n"),e=T(e,t.settings.forced_root_block,t.settings.forced_root_block_attrs),vt(t,e,!1)},yt=function(t){var e={};if(t){if(t.getData){var n=t.getData("Text");n&&0<n.length&&-1===n.indexOf("data:text/mce-internal,")&&(e["text/plain"]=n)}if(t.types)for(var r=0;r<t.types.length;r++){var o=t.types[r];try{e[o]=t.getData(o)}catch(i){e[o]=""}}}return e},bt=function(t,e){return e in t&&0<t[e].length},xt=function(t){return bt(t,"text/html")||bt(t,"text/plain")},Pt=F.createIdGenerator("mceclip"),wt=function(e,t,n){var r,o,i,a,s="paste"===t.type?t.clipboardData:t.dataTransfer;if(e.settings.paste_data_images&&s){var u=(i=(o=s).items?at(lt(o.items),function(t){return t.getAsFile()}):[],a=o.files?lt(o.files):[],function(t,e){for(var n=[],r=0,o=t.length;r<o;r++){var i=t[r];e(i,r,t)&&n.push(i)}return n}(0<
;i.length?i:a,function(t){return/^image\/(jpeg|png|gif|bmp)$/.test(t.type)}));if(0<u.length)return t.preventDefault(),(r=u,pt(r,function(r){return mt.nu(function(t){var e=r.getAsFile?r.getAsFile():r,n=new window.FileReader;n.onload=function(){t({blob:e,uri:n.result})},n.readAsDataURL(e)})})).get(function(t){n&&e.selection.setRng(n),st(t,function(t){!function(t,e){var n,r,o,i,a,s,u,l=(n=e.uri,-1!==(r=n.indexOf(","))?n.substr(r+1):null),c=Pt(),f=t.settings.images_reuse_filename&&e.blob.name?(o=t,i=e.blob.name,(a=i.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i))?o.dom.encode(a[1]):null):c,d=new Image;if(d.src=e.uri,s=t.settings,u=d,!s.images_dataimg_filter||s.images_dataimg_filter(u)){var m,g=t.editorUpload.blobCache,p=void 0;(m=g.findFirst(function(t){return t.base64()===l}))?p=m:(p=g.create(c,e.blob,l,f),g.add(p)),vt(t,'<img src="'+p.blobUri()+'">',!1)}else vt(t,'<img src="'+e.uri+'">',!1)}(e,t)})}),!0}return!1},_t=function(t)
{return o.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode},Dt=function(c,f,d){var m,g=0;function p(t,e,n,r){var o,i;bt(t,"text/html")?o=t["text/html"]:(o=f.getHtml(),r=r||b(o),f.isDefaultContent(o)&&(n=!0)),o=F.trimHtml(o),f.remove(),i=!1===r&&D(o),o.length&&!i||(n=!0),n&&(o=bt(t,"text/plain")&&i?t["text/plain"]:F.innerText(o)),f.isDefaultContent(o)?e||c.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):n?ht(c,o):vt(c,o,r)}c.on("keydown",function(t){function e(t){_t(t)&&!t.isDefaultPrevented()&&f.remove()}if(_t(t)&&!t.isDefaultPrevented()){if((m=t.shiftKey&&86===t.keyCode)&&v.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(t.stopImmediatePropagation(),g=(new Date).getTime(),v.ie&&m)return t.preventDefault(),void n(c,!0);f.remove(),f.create()
,c.once("keyup",e),c.once("paste",function(){c.off("keyup",e)})}}),c.on("paste",function(t){var e,n,r,o=(new Date).getTime(),i=(e=c,n=yt(t.clipboardData||e.getDoc().dataTransfer),F.isMsEdge()?y.extend(n,{"text/html":""}):n),a=(new Date).getTime()-o,s=(new Date).getTime()-g-a<1e3,u="text"===d.get()||m,l=bt(i,x());m=!1,t.isDefaultPrevented()||(r=t.clipboardData,-1!==navigator.userAgent.indexOf("Android")&&r&&r.items&&0===r.items.length)?f.remove():xt(i)||!wt(c,t,f.getLastRng()||c.selection.getRng())?(s||t.preventDefault(),!v.ie||s&&!t.ieFake||bt(i,"text/html")||(f.create(),c.dom.bind(f.getEl(),"paste",function(t){t.stopPropagation()}),c.getDoc().execCommand("Paste",!1,null),i["text/html"]=f.getHtml()),bt(i,"text/html")?(t.preventDefault(),l||(l=b(i["text/html"])),p(i,s,u,l)):h.setEditorTimeout(c,function(){p(i,s,
u,l)},0)):f.remove()})},Tt=function(t){return v.ie&&t.inline?document.body:t.getBody()},Ct=function(e,t,n){var r;Tt(r=e)!==r.getBody()&&e.dom.bind(t,"paste keyup",function(t){Ot(e,n)||e.fire("paste")})},kt=function(t){return t.dom.get("mcepastebin")},St=function(t,e){return e===t},Ot=function(t,e){var n,r=kt(t);return(n=r)&&"mcepastebin"===n.id&&St(e,r.innerHTML)},Rt=function(a){var s=l(null),u="%MCEPASTEBIN%";return{create:function(){return e=s,n=u,o=(t=a).dom,i=t.getBody(),e.set(t.selection.getRng()),r=t.dom.add(Tt(t),"div",{id:"mcepastebin","class":"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n),(v.ie||v.gecko)&&o.setStyle(r,"left","rtl"===o.getStyle(i,"direction",!0)?65535:-65535),o.bind(r,
"beforedeactivate focusin focusout",function(t){t.stopPropagation()}),Ct(t,r,n),r.focus(),void t.selection.select(r,!0);var t,e,n,r,o,i},remove:function(){return function(t,e){if(kt(t)){for(var n=void 0,r=e.get();n=t.dom.get("mcepastebin");)t.dom.remove(n),t.dom.unbind(n);r&&t.selection.setRng(r)}e.set(null)}(a,s)},getEl:function(){return kt(a)},getHtml:function(){return function(n){var e,t,r,o,i,a=function(t,e){t.appendChild(e),n.dom.remove(e,!0)};for(t=y.grep(Tt(n).childNodes,function(t){return"mcepastebin"===t.id}),e=t.shift(),y.each(t,function(t){a(e,t)}),r=(o=n.dom.select("div[id=mcepastebin]",e)).length-1;0<=r;r--)i=n.dom.create("div"),e.insertBefore(i,o[r]),a(i,o[r]);return e?e.innerHTML:""}(a)},getLastRng:function(){return s.get()},isDefault:function(){return Ot(a,u)},isDefaultContent:function(t){return St(u,t)}}},Ft=function(n,t){var e=Rt(n);return n.on("preInit",function(){return Dt(a=n,e,t),v
oid a.parser.addNodeFilter("img",function(t,e,n){var r,o=function(t){t.attr("data-mce-object")||s===v.transparentSrc||t.remove()};if(!a.settings.paste_data_images&&(r=n).data&&!0===r.data.paste)for(var i=t.length;i--;)(s=t[i].attributes.map.src)&&(0===s.indexOf("webkit-fake-url")?o(t[i]):a.settings.allow_html_data_urls||0!==s.indexOf("data:")||o(t[i]))});var a,s}),{pasteFormat:t,pasteHtml:function(t,e){return vt(n,t,e)},pasteText:function(t){return ht(n,t)},pasteImageData:function(t,e){return wt(n,t,e)},getDataTransferItems:yt,hasHtmlOrText:xt,hasContentType:bt}},Et=function(){},At=function(t,e,n){if(r=t,!1!==v.iOS||r===undefined||"function"!=typeof r.setData||!0===F.isMsEdge())return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData(x(),e),!0}catch(o){return!1}var r},It=function(t,e,n,r){At(t.clipboardData,e.html,e.text)?(t.preventDefault(),r()):n(e.ht
ml,r)},Mt=function(s){return function(t,e){var n=g(t),r=s.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),o=s.dom.create("div",{contenteditable:"true"},n);s.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(o),s.dom.add(s.getBody(),r);var i=s.selection.getRng();o.focus();var a=s.dom.createRng();a.selectNodeContents(o),s.selection.setRng(a),setTimeout(function(){s.selection.setRng(i),r.parentNode.removeChild(r),e()},0)}},Bt=function(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}},Ht=function(t){return!t.selection.isCollapsed()||!!(e=t).dom.getParent(e.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",e.getBody());var e},jt=function(t){var e,n;t.on("cut",(e=t,function(t){Ht(e)&&It(t,Bt(e),Mt(e),f
unction(){setTimeout(function(){e.execCommand("Delete")},0)})})),t.on("copy",(n=t,function(t){Ht(n)&&It(t,Bt(n),Mt(n),Et)}))},Lt=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Nt=function(t,e){return Lt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())},$t=function(t,e){t.focus(),t.selection.setRng(e)},Wt=function(a,s,u){m.shouldBlockDrop(a)&&a.on("dragend dragover draggesture dragdrop drop drag",function(t){t.preventDefault(),t.stopPropagation()}),m.shouldPasteDataImages(a)||a.on("drop",function(t){var e=t.dataTransfer;e&&e.files&&0<e.files.length&&t.preventDefault()}),a.on("drop",function(t){var e,n;if(n=Nt(a,t),!t.isDefaultPrevented()&&!u.get()){e=s.getDataTransferItems(t.dataTransfer);var r,o=s.hasContentType(e,x());if((s.hasHtmlOrText(e)&&(!(r=e["text/plain"])||0!==r.indexOf("file://"))||!s.pasteImageData(t,n))&&n&&
;m.shouldFilterDrop(a)){var i=e["mce-internal"]||e["text/html"]||e["text/plain"];i&&(t.preventDefault(),h.setEditorTimeout(a,function(){a.undoManager.transact(function(){e["mce-internal"]&&a.execCommand("Delete"),$t(a,n),i=F.trimHtml(i),e["text/html"]?s.pasteHtml(i,o):s.pasteText(i)})}))}}}),a.on("dragstart",function(t){u.set(!0)}),a.on("dragover dragend",function(t){m.shouldPasteDataImages(a)&&!1===u.get()&&(t.preventDefault(),$t(a,Nt(a,t))),"dragend"===t.type&&u.set(!1)})},zt=function(t){var e=t.plugins.paste,n=m.getPreProcess(t);n&&t.on("PastePreProcess",function(t){n.call(e,e,t)});var r=m.getPostProcess(t);r&&t.on("PastePostProcess",function(t){r.call(e,e,t)})};function Ut(e,n){e.on("PastePreProcess",function(t){t.content=n(e,t.content,t.internal,t.wordContent)})}function Vt(t,e){if(!N.isWordContent(e))ret
urn e;var n=[];y.each(t.schema.getBlockElements(),function(t,e){n.push(e)});var r=new RegExp("(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?("+n.join("|")+")[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*","g");return e=F.filter(e,[[r,"$1"]]),e=F.filter(e,[[/<br><br>/g,"<BR><BR>"],[/<br>/g," "],[/<BR><BR>/g,"<br>"]])}function qt(t,e,n,r){if(r||n)return e;var l,o=m.getWebkitStyles(t);if(!1===m.shouldRemoveWebKitStyles(t)||"all"===o)return e;if(o&&(l=o.split(/[, ]/)),l){var c=t.dom,f=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(t,e,n,r){var o=c.parseStyle(c.decode(n)),i={};if("none"===l)return e+r;for(var a=0;a<l.length;a++){var s=o[l[a]],u=c.getStyle(f,l[a],!0);/color/.test(l[a])&&(s=c.toHex(s),u=c.toHex(u)),u!==s&&(i[l[a]]=s)
}return(i=c.serializeStyle(i,"span"))?e+' style="'+i+'"'+r:e+r})}else e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e=e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(t,e,n,r){return e+' style="'+n+'"'+r})}function Kt(n,t){n.$("a",t).find("font,u").each(function(t,e){n.dom.remove(e,!0)})}var Gt=function(t){var e,n;v.webkit&&Ut(t,qt),v.ie&&(Ut(t,Vt),n=Kt,(e=t).on("PastePostProcess",function(t){n(e,t.node)}))},Xt=function(t,e,n){var r=n.control;r.active("text"===e.pasteFormat.get()),t.on("PastePlainTextToggle",function(t){r.active(t.state)})},Yt=function(t,e){var n=function(r){for(var o=[],t=1;t<arguments.length;t++)o[t-1]=arguments[t];return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=o.concat(t);return r.apply(null,n)}}(Xt,t,e);t.addButton("pastetext&
quot;,{active:!1,icon:"pastetext",tooltip:"Paste as text",cmd:"mceTogglePlainTextPaste",onPostRender:n}),t.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:e.pasteFormat,cmd:"mceTogglePlainTextPaste",onPostRender:n})};e.add("paste",function(t){if(!1===a(t)){var e=l(!1),n=l(!1),r=l(m.isPasteAsTextEnabled(t)?"text":"html"),o=Ft(t,r),i=Gt(t);return Yt(t,o),c(t,o,e),zt(t),jt(t),Wt(t,o,n),s(o,i)}})}();
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcjs_enqueuesvendortinymcepluginstabfocuspluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/plugins/tabfocus/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/plugins/tabfocus/plugin.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/plugins/tabfocus/plugin.js 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,124 +1,124 @@
</span><span class="cx" style="display: block; padding: 0 10px"> (function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var tabfocus = (function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'use strict';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'use strict';
</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 global = tinymce.util.Tools.resolve('tinymce.PluginManager');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global = tinymce.util.Tools.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">- var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$1 = tinymce.util.Tools.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">- var global$2 = tinymce.util.Tools.resolve('tinymce.EditorManager');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$2 = tinymce.util.Tools.resolve('tinymce.EditorManager');
</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 global$3 = tinymce.util.Tools.resolve('tinymce.Env');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$3 = tinymce.util.Tools.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">- var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay');
</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 global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$5 = tinymce.util.Tools.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">- var global$6 = tinymce.util.Tools.resolve('tinymce.util.VK');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$6 = tinymce.util.Tools.resolve('tinymce.util.VK');
</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 getTabFocusElements = function (editor) {
- return editor.getParam('tabfocus_elements', ':prev,:next');
- };
- var getTabFocus = function (editor) {
- return editor.getParam('tab_focus', getTabFocusElements(editor));
- };
- var $_8rita4kwjjgwed4m = { getTabFocus: getTabFocus };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getTabFocusElements = function (editor) {
+ return editor.getParam('tabfocus_elements', ':prev,:next');
+ };
+ var getTabFocus = function (editor) {
+ return editor.getParam('tab_focus', getTabFocusElements(editor));
+ };
+ var Settings = { getTabFocus: getTabFocus };
</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 DOM = global$1.DOM;
- var tabCancel = function (e) {
- if (e.keyCode === global$6.TAB && !e.ctrlKey && !e.altKey && !e.metaKey) {
- e.preventDefault();
- }
- };
- var setup = function (editor) {
- function tabHandler(e) {
- var x, el, v, i;
- if (e.keyCode !== global$6.TAB || e.ctrlKey || e.altKey || e.metaKey || e.isDefaultPrevented()) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var DOM = global$1.DOM;
+ var tabCancel = function (e) {
+ if (e.keyCode === global$6.TAB && !e.ctrlKey && !e.altKey && !e.metaKey) {
+ e.preventDefault();
</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 find(direction) {
- el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
- function canSelectRecursive(e) {
- return e.nodeName === 'BODY' || e.type !== 'hidden' && e.style.display !== 'none' && e.style.visibility !== 'hidden' && canSelectRecursive(e.parentNode);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var setup = function (editor) {
+ function tabHandler(e) {
+ var x, el, v, i;
+ if (e.keyCode !== global$6.TAB || e.ctrlKey || e.altKey || e.metaKey || e.isDefaultPrevented()) {
+ 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 canSelect(el) {
- return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && global$2.get(e.id) && el.tabIndex !== -1 && canSelectRecursive(el);
- }
- global$5.each(el, function (e, i) {
- if (e.id === editor.id) {
- x = i;
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function find(direction) {
+ el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
+ function canSelectRecursive(e) {
+ return e.nodeName === 'BODY' || e.type !== 'hidden' && e.style.display !== 'none' && e.style.visibility !== 'hidden' && canSelectRecursive(e.parentNode);
</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 (direction > 0) {
- for (i = x + 1; i < el.length; i++) {
- if (canSelect(el[i])) {
- return el[i];
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function canSelect(el) {
+ return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && global$2.get(e.id) && el.tabIndex !== -1 && canSelectRecursive(el);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- for (i = x - 1; i >= 0; i--) {
- if (canSelect(el[i])) {
- return el[i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global$5.each(el, function (e, i) {
+ if (e.id === editor.id) {
+ x = i;
+ return false;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ if (direction > 0) {
+ for (i = x + 1; i < el.length; i++) {
+ if (canSelect(el[i])) {
+ return el[i];
+ }
+ }
+ } else {
+ for (i = x - 1; i >= 0; i--) {
+ if (canSelect(el[i])) {
+ return el[i];
+ }
+ }
</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 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 null;
- }
- v = global$5.explode($_8rita4kwjjgwed4m.getTabFocus(editor));
- if (v.length === 1) {
- v[1] = v[0];
- v[0] = ':prev';
- }
- if (e.shiftKey) {
- if (v[0] === ':prev') {
- el = find(-1);
- } else {
- el = DOM.get(v[0]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ v = global$5.explode(Settings.getTabFocus(editor));
+ if (v.length === 1) {
+ v[1] = v[0];
+ v[0] = ':prev';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- if (v[1] === ':next') {
- el = find(1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (e.shiftKey) {
+ if (v[0] === ':prev') {
+ el = find(-1);
+ } else {
+ el = DOM.get(v[0]);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- el = DOM.get(v[1]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (v[1] === ':next') {
+ el = find(1);
+ } else {
+ el = DOM.get(v[1]);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (el) {
+ var focusEditor = global$2.get(el.id || el.name);
+ if (el.id && focusEditor) {
+ focusEditor.focus();
+ } else {
+ global$4.setTimeout(function () {
+ if (!global$3.webkit) {
+ window.focus();
+ }
+ el.focus();
+ }, 10);
+ }
+ e.preventDefault();
+ }
</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 (el) {
- var focusEditor = global$2.get(el.id || el.name);
- if (el.id && focusEditor) {
- focusEditor.focus();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('init', function () {
+ if (editor.inline) {
+ DOM.setAttrib(editor.getBody(), 'tabIndex', null);
+ }
+ editor.on('keyup', tabCancel);
+ if (global$3.gecko) {
+ editor.on('keypress keydown', tabHandler);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global$4.setTimeout(function () {
- if (!global$3.webkit) {
- window.focus();
- }
- el.focus();
- }, 10);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('keydown', tabHandler);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- e.preventDefault();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ var Keyboard = { setup: setup };
+
+ global.add('tabfocus', function (editor) {
+ Keyboard.setup(editor);
+ });
+ function Plugin () {
</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 () {
- if (editor.inline) {
- DOM.setAttrib(editor.getBody(), 'tabIndex', null);
- }
- editor.on('keyup', tabCancel);
- if (global$3.gecko) {
- editor.on('keypress keydown', tabHandler);
- } else {
- editor.on('keydown', tabHandler);
- }
- });
- };
- var $_6zogdykpjjgwed4h = { setup: setup };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global.add('tabfocus', function (editor) {
- $_6zogdykpjjgwed4h.setup(editor);
- });
- function Plugin () {
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Plugin;
</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 Plugin;
-
</del><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="trunksrcjs_enqueuesvendortinymcepluginstextcolorpluginjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/plugins/textcolor/plugin.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/plugins/textcolor/plugin.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/plugins/textcolor/plugin.js 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,346 +1,346 @@
</span><span class="cx" style="display: block; padding: 0 10px"> (function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var textcolor = (function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'use strict';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'use strict';
</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 global = tinymce.util.Tools.resolve('tinymce.PluginManager');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global = tinymce.util.Tools.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">- var getCurrentColor = function (editor, format) {
- var color;
- editor.dom.getParents(editor.selection.getStart(), function (elm) {
- var value;
- if (value = elm.style[format === 'forecolor' ? 'color' : 'background-color']) {
- color = value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getCurrentColor = function (editor, format) {
+ var color;
+ editor.dom.getParents(editor.selection.getStart(), function (elm) {
+ var value;
+ if (value = elm.style[format === 'forecolor' ? 'color' : 'background-color']) {
+ color = color ? color : value;
+ }
+ });
+ return color;
+ };
+ var mapColors = function (colorMap) {
+ var i;
+ var colors = [];
+ for (i = 0; i < colorMap.length; i += 2) {
+ colors.push({
+ text: colorMap[i + 1],
+ color: '#' + colorMap[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">- });
- return color;
- };
- var mapColors = function (colorMap) {
- var i;
- var colors = [];
- for (i = 0; i < colorMap.length; i += 2) {
- colors.push({
- text: colorMap[i + 1],
- color: '#' + colorMap[i]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return colors;
+ };
+ var applyFormat = function (editor, format, value) {
+ editor.undoManager.transact(function () {
+ editor.focus();
+ editor.formatter.apply(format, { value: value });
+ 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 colors;
- };
- var applyFormat = function (editor, format, value) {
- editor.undoManager.transact(function () {
- editor.focus();
- editor.formatter.apply(format, { value: value });
- editor.nodeChanged();
- });
- };
- var removeFormat = function (editor, format) {
- editor.undoManager.transact(function () {
- editor.focus();
- editor.formatter.remove(format, { value: null }, null, true);
- editor.nodeChanged();
- });
- };
- var $_b0p88yrijjgwefd2 = {
- getCurrentColor: getCurrentColor,
- mapColors: mapColors,
- applyFormat: applyFormat,
- removeFormat: removeFormat
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var removeFormat = function (editor, format) {
+ editor.undoManager.transact(function () {
+ editor.focus();
+ editor.formatter.remove(format, { value: null }, null, true);
+ editor.nodeChanged();
+ });
+ };
+ var TextColor = {
+ getCurrentColor: getCurrentColor,
+ mapColors: mapColors,
+ applyFormat: applyFormat,
+ removeFormat: removeFormat
+ };
</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 register = function (editor) {
- editor.addCommand('mceApplyTextcolor', function (format, value) {
- $_b0p88yrijjgwefd2.applyFormat(editor, format, value);
- });
- editor.addCommand('mceRemoveTextcolor', function (format) {
- $_b0p88yrijjgwefd2.removeFormat(editor, format);
- });
- };
- var $_g2o2pirhjjgwefd1 = { register: register };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register = function (editor) {
+ editor.addCommand('mceApplyTextcolor', function (format, value) {
+ TextColor.applyFormat(editor, format, value);
+ });
+ editor.addCommand('mceRemoveTextcolor', function (format) {
+ TextColor.removeFormat(editor, format);
+ });
+ };
+ var Commands = { register: register };
</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 global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$1 = tinymce.util.Tools.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">- var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$2 = tinymce.util.Tools.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">- var defaultColorMap = [
- '000000',
- 'Black',
- '993300',
- 'Burnt orange',
- '333300',
- 'Dark olive',
- '003300',
- 'Dark green',
- '003366',
- 'Dark azure',
- '000080',
- 'Navy Blue',
- '333399',
- 'Indigo',
- '333333',
- 'Very dark gray',
- '800000',
- 'Maroon',
- 'FF6600',
- 'Orange',
- '808000',
- 'Olive',
- '008000',
- 'Green',
- '008080',
- 'Teal',
- '0000FF',
- 'Blue',
- '666699',
- 'Grayish blue',
- '808080',
- 'Gray',
- 'FF0000',
- 'Red',
- 'FF9900',
- 'Amber',
- '99CC00',
- 'Yellow green',
- '339966',
- 'Sea green',
- '33CCCC',
- 'Turquoise',
- '3366FF',
- 'Royal blue',
- '800080',
- 'Purple',
- '999999',
- 'Medium gray',
- 'FF00FF',
- 'Magenta',
- 'FFCC00',
- 'Gold',
- 'FFFF00',
- 'Yellow',
- '00FF00',
- 'Lime',
- '00FFFF',
- 'Aqua',
- '00CCFF',
- 'Sky blue',
- '993366',
- 'Red violet',
- 'FFFFFF',
- 'White',
- 'FF99CC',
- 'Pink',
- 'FFCC99',
- 'Peach',
- 'FFFF99',
- 'Light yellow',
- 'CCFFCC',
- 'Pale green',
- 'CCFFFF',
- 'Pale cyan',
- '99CCFF',
- 'Light sky blue',
- 'CC99FF',
- 'Plum'
- ];
- var getTextColorMap = function (editor) {
- return editor.getParam('textcolor_map', defaultColorMap);
- };
- var getForeColorMap = function (editor) {
- return editor.getParam('forecolor_map', getTextColorMap(editor));
- };
- var getBackColorMap = function (editor) {
- return editor.getParam('backcolor_map', getTextColorMap(editor));
- };
- var getTextColorRows = function (editor) {
- return editor.getParam('textcolor_rows', 5);
- };
- var getTextColorCols = function (editor) {
- return editor.getParam('textcolor_cols', 8);
- };
- var getForeColorRows = function (editor) {
- return editor.getParam('forecolor_rows', getTextColorRows(editor));
- };
- var getBackColorRows = function (editor) {
- return editor.getParam('backcolor_rows', getTextColorRows(editor));
- };
- var getForeColorCols = function (editor) {
- return editor.getParam('forecolor_cols', getTextColorCols(editor));
- };
- var getBackColorCols = function (editor) {
- return editor.getParam('backcolor_cols', getTextColorCols(editor));
- };
- var getColorPickerCallback = function (editor) {
- return editor.getParam('color_picker_callback', null);
- };
- var hasColorPicker = function (editor) {
- return typeof getColorPickerCallback(editor) === 'function';
- };
- var $_2rfqb7rmjjgwefd9 = {
- getForeColorMap: getForeColorMap,
- getBackColorMap: getBackColorMap,
- getForeColorRows: getForeColorRows,
- getBackColorRows: getBackColorRows,
- getForeColorCols: getForeColorCols,
- getBackColorCols: getBackColorCols,
- getColorPickerCallback: getColorPickerCallback,
- hasColorPicker: hasColorPicker
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var defaultColorMap = [
+ '000000',
+ 'Black',
+ '993300',
+ 'Burnt orange',
+ '333300',
+ 'Dark olive',
+ '003300',
+ 'Dark green',
+ '003366',
+ 'Dark azure',
+ '000080',
+ 'Navy Blue',
+ '333399',
+ 'Indigo',
+ '333333',
+ 'Very dark gray',
+ '800000',
+ 'Maroon',
+ 'FF6600',
+ 'Orange',
+ '808000',
+ 'Olive',
+ '008000',
+ 'Green',
+ '008080',
+ 'Teal',
+ '0000FF',
+ 'Blue',
+ '666699',
+ 'Grayish blue',
+ '808080',
+ 'Gray',
+ 'FF0000',
+ 'Red',
+ 'FF9900',
+ 'Amber',
+ '99CC00',
+ 'Yellow green',
+ '339966',
+ 'Sea green',
+ '33CCCC',
+ 'Turquoise',
+ '3366FF',
+ 'Royal blue',
+ '800080',
+ 'Purple',
+ '999999',
+ 'Medium gray',
+ 'FF00FF',
+ 'Magenta',
+ 'FFCC00',
+ 'Gold',
+ 'FFFF00',
+ 'Yellow',
+ '00FF00',
+ 'Lime',
+ '00FFFF',
+ 'Aqua',
+ '00CCFF',
+ 'Sky blue',
+ '993366',
+ 'Red violet',
+ 'FFFFFF',
+ 'White',
+ 'FF99CC',
+ 'Pink',
+ 'FFCC99',
+ 'Peach',
+ 'FFFF99',
+ 'Light yellow',
+ 'CCFFCC',
+ 'Pale green',
+ 'CCFFFF',
+ 'Pale cyan',
+ '99CCFF',
+ 'Light sky blue',
+ 'CC99FF',
+ 'Plum'
+ ];
+ var getTextColorMap = function (editor) {
+ return editor.getParam('textcolor_map', defaultColorMap);
+ };
+ var getForeColorMap = function (editor) {
+ return editor.getParam('forecolor_map', getTextColorMap(editor));
+ };
+ var getBackColorMap = function (editor) {
+ return editor.getParam('backcolor_map', getTextColorMap(editor));
+ };
+ var getTextColorRows = function (editor) {
+ return editor.getParam('textcolor_rows', 5);
+ };
+ var getTextColorCols = function (editor) {
+ return editor.getParam('textcolor_cols', 8);
+ };
+ var getForeColorRows = function (editor) {
+ return editor.getParam('forecolor_rows', getTextColorRows(editor));
+ };
+ var getBackColorRows = function (editor) {
+ return editor.getParam('backcolor_rows', getTextColorRows(editor));
+ };
+ var getForeColorCols = function (editor) {
+ return editor.getParam('forecolor_cols', getTextColorCols(editor));
+ };
+ var getBackColorCols = function (editor) {
+ return editor.getParam('backcolor_cols', getTextColorCols(editor));
+ };
+ var getColorPickerCallback = function (editor) {
+ return editor.getParam('color_picker_callback', null);
+ };
+ var hasColorPicker = function (editor) {
+ return typeof getColorPickerCallback(editor) === 'function';
+ };
+ var Settings = {
+ getForeColorMap: getForeColorMap,
+ getBackColorMap: getBackColorMap,
+ getForeColorRows: getForeColorRows,
+ getBackColorRows: getBackColorRows,
+ getForeColorCols: getForeColorCols,
+ getBackColorCols: getBackColorCols,
+ getColorPickerCallback: getColorPickerCallback,
+ hasColorPicker: hasColorPicker
+ };
</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 global$3 = tinymce.util.Tools.resolve('tinymce.util.I18n');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$3 = tinymce.util.Tools.resolve('tinymce.util.I18n');
</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 getHtml = function (cols, rows, colorMap, hasColorPicker) {
- var colors, color, html, last, x, y, i, count = 0;
- var id = global$1.DOM.uniqueId('mcearia');
- var getColorCellHtml = function (color, title) {
- var isNoColor = color === 'transparent';
- return '<td class="mce-grid-cell' + (isNoColor ? ' mce-colorbtn-trans' : '') + '">' + '<div id="' + id + '-' + count++ + '"' + ' data-mce-color="' + (color ? color : '') + '"' + ' role="option"' + ' tabIndex="-1"' + ' style="' + (color ? 'background-color: ' + color : '') + '"' + ' title="' + global$3.translate(title) + '">' + (isNoColor ? '×' : '') + '</div>' + '</td>';
- };
- colors = $_b0p88yrijjgwefd2.mapColors(colorMap);
- colors.push({
- text: global$3.translate('No color'),
- color: 'transparent'
- });
- html = '<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>';
- last = colors.length - 1;
- for (y = 0; y < rows; y++) {
- html += '<tr>';
- for (x = 0; x < cols; x++) {
- i = y * cols + x;
- if (i > last) {
- html += '<td></td>';
- } else {
- color = colors[i];
- html += getColorCellHtml(color.color, color.text);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getHtml = function (cols, rows, colorMap, hasColorPicker) {
+ var colors, color, html, last, x, y, i, count = 0;
+ var id = global$1.DOM.uniqueId('mcearia');
+ var getColorCellHtml = function (color, title) {
+ var isNoColor = color === 'transparent';
+ return '<td class="mce-grid-cell' + (isNoColor ? ' mce-colorbtn-trans' : '') + '">' + '<div id="' + id + '-' + count++ + '"' + ' data-mce-color="' + (color ? color : '') + '"' + ' role="option"' + ' tabIndex="-1"' + ' style="' + (color ? 'background-color: ' + color : '') + '"' + ' title="' + global$3.translate(title) + '">' + (isNoColor ? '×' : '') + '</div>' + '</td>';
+ };
+ colors = TextColor.mapColors(colorMap);
+ colors.push({
+ text: global$3.translate('No color'),
+ color: 'transparent'
+ });
+ html = '<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>';
+ last = colors.length - 1;
+ for (y = 0; y < rows; y++) {
+ html += '<tr>';
+ for (x = 0; x < cols; x++) {
+ i = y * cols + x;
+ if (i > last) {
+ html += '<td></td>';
+ } else {
+ color = colors[i];
+ html += getColorCellHtml(color.color, color.text);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ html += '</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">- html += '</tr>';
- }
- if (hasColorPicker) {
- html += '<tr>' + '<td colspan="' + cols + '" class="mce-custom-color-btn">' + '<div id="' + id + '-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" ' + 'role="button" tabindex="-1" aria-labelledby="' + id + '-c" style="width: 100%">' + '<button type="button" role="presentation" tabindex="-1">' + global$3.translate('Custom...') + '</button>' + '</div>' + '</td>' + '</tr>';
- html += '<tr>';
- for (x = 0; x < cols; x++) {
- html += getColorCellHtml('', 'Custom color');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (hasColorPicker) {
+ html += '<tr>' + '<td colspan="' + cols + '" class="mce-custom-color-btn">' + '<div id="' + id + '-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" ' + 'role="button" tabindex="-1" aria-labelledby="' + id + '-c" style="width: 100%">' + '<button type="button" role="presentation" tabindex="-1">' + global$3.translate('Custom...') + '</button>' + '</div>' + '</td>' + '</tr>';
+ html += '<tr>';
+ for (x = 0; x < cols; x++) {
+ html += getColorCellHtml('', 'Custom color');
+ }
+ html += '</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">- html += '</tr>';
- }
- html += '</tbody></table>';
- return html;
- };
- var $_fihh7qrnjjgwefdb = { getHtml: getHtml };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ html += '</tbody></table>';
+ return html;
+ };
+ var ColorPickerHtml = { getHtml: getHtml };
</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 setDivColor = function setDivColor(div, value) {
- div.style.background = value;
- div.setAttribute('data-mce-color', value);
- };
- var onButtonClick = function (editor) {
- return function (e) {
- var ctrl = e.control;
- if (ctrl._color) {
- editor.execCommand('mceApplyTextcolor', ctrl.settings.format, ctrl._color);
- } else {
- editor.execCommand('mceRemoveTextcolor', ctrl.settings.format);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setDivColor = function setDivColor(div, value) {
+ div.style.background = value;
+ div.setAttribute('data-mce-color', 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 onPanelClick = function (editor, cols) {
- return function (e) {
- var buttonCtrl = this.parent();
- var value;
- var currentColor = $_b0p88yrijjgwefd2.getCurrentColor(editor, buttonCtrl.settings.format);
- var selectColor = function (value) {
- editor.execCommand('mceApplyTextcolor', buttonCtrl.settings.format, value);
- buttonCtrl.hidePanel();
- buttonCtrl.color(value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var onButtonClick = function (editor) {
+ return function (e) {
+ var ctrl = e.control;
+ if (ctrl._color) {
+ editor.execCommand('mceApplyTextcolor', ctrl.settings.format, ctrl._color);
+ } else {
+ editor.execCommand('mceRemoveTextcolor', ctrl.settings.format);
+ }
</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 resetColor = function () {
- editor.execCommand('mceRemoveTextcolor', buttonCtrl.settings.format);
- buttonCtrl.hidePanel();
- buttonCtrl.resetColor();
- };
- if (global$1.DOM.getParent(e.target, '.mce-custom-color-btn')) {
- buttonCtrl.hidePanel();
- var colorPickerCallback = $_2rfqb7rmjjgwefd9.getColorPickerCallback(editor);
- colorPickerCallback.call(editor, function (value) {
- var tableElm = buttonCtrl.panel.getEl().getElementsByTagName('table')[0];
- var customColorCells, div, i;
- customColorCells = global$2.map(tableElm.rows[tableElm.rows.length - 1].childNodes, function (elm) {
- return elm.firstChild;
- });
- for (i = 0; i < customColorCells.length; i++) {
- div = customColorCells[i];
- if (!div.getAttribute('data-mce-color')) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var onPanelClick = function (editor, cols) {
+ return function (e) {
+ var buttonCtrl = this.parent();
+ var value;
+ var currentColor = TextColor.getCurrentColor(editor, buttonCtrl.settings.format);
+ var selectColor = function (value) {
+ editor.execCommand('mceApplyTextcolor', buttonCtrl.settings.format, value);
+ buttonCtrl.hidePanel();
+ buttonCtrl.color(value);
+ };
+ var resetColor = function () {
+ editor.execCommand('mceRemoveTextcolor', buttonCtrl.settings.format);
+ buttonCtrl.hidePanel();
+ buttonCtrl.resetColor();
+ };
+ if (global$1.DOM.getParent(e.target, '.mce-custom-color-btn')) {
+ buttonCtrl.hidePanel();
+ var colorPickerCallback = Settings.getColorPickerCallback(editor);
+ colorPickerCallback.call(editor, function (value) {
+ var tableElm = buttonCtrl.panel.getEl().getElementsByTagName('table')[0];
+ var customColorCells, div, i;
+ customColorCells = global$2.map(tableElm.rows[tableElm.rows.length - 1].childNodes, function (elm) {
+ return elm.firstChild;
+ });
+ for (i = 0; i < customColorCells.length; i++) {
+ div = customColorCells[i];
+ if (!div.getAttribute('data-mce-color')) {
+ 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">- }
- if (i === cols) {
- for (i = 0; i < cols - 1; i++) {
- setDivColor(customColorCells[i], customColorCells[i + 1].getAttribute('data-mce-color'));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (i === cols) {
+ for (i = 0; i < cols - 1; i++) {
+ setDivColor(customColorCells[i], customColorCells[i + 1].getAttribute('data-mce-color'));
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ setDivColor(div, value);
+ selectColor(value);
+ }, currentColor);
+ }
+ value = e.target.getAttribute('data-mce-color');
+ if (value) {
+ if (this.lastId) {
+ global$1.DOM.get(this.lastId).setAttribute('aria-selected', '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">- setDivColor(div, value);
- selectColor(value);
- }, currentColor);
- }
- value = e.target.getAttribute('data-mce-color');
- if (value) {
- if (this.lastId) {
- global$1.DOM.get(this.lastId).setAttribute('aria-selected', 'false');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ e.target.setAttribute('aria-selected', true);
+ this.lastId = e.target.id;
+ if (value === 'transparent') {
+ resetColor();
+ } else {
+ selectColor(value);
+ }
+ } else if (value !== null) {
+ buttonCtrl.hidePanel();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- e.target.setAttribute('aria-selected', true);
- this.lastId = e.target.id;
- if (value === 'transparent') {
- resetColor();
- } else {
- selectColor(value);
- }
- } else if (value !== null) {
- buttonCtrl.hidePanel();
- }
</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">- };
- var renderColorPicker = function (editor, foreColor) {
- return function () {
- var cols = foreColor ? $_2rfqb7rmjjgwefd9.getForeColorCols(editor) : $_2rfqb7rmjjgwefd9.getBackColorCols(editor);
- var rows = foreColor ? $_2rfqb7rmjjgwefd9.getForeColorRows(editor) : $_2rfqb7rmjjgwefd9.getBackColorRows(editor);
- var colorMap = foreColor ? $_2rfqb7rmjjgwefd9.getForeColorMap(editor) : $_2rfqb7rmjjgwefd9.getBackColorMap(editor);
- var hasColorPicker = $_2rfqb7rmjjgwefd9.hasColorPicker(editor);
- return $_fihh7qrnjjgwefdb.getHtml(cols, rows, colorMap, hasColorPicker);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var renderColorPicker = function (editor, foreColor) {
+ return function () {
+ var cols = foreColor ? Settings.getForeColorCols(editor) : Settings.getBackColorCols(editor);
+ var rows = foreColor ? Settings.getForeColorRows(editor) : Settings.getBackColorRows(editor);
+ var colorMap = foreColor ? Settings.getForeColorMap(editor) : Settings.getBackColorMap(editor);
+ var hasColorPicker = Settings.hasColorPicker(editor);
+ return ColorPickerHtml.getHtml(cols, rows, colorMap, hasColorPicker);
+ };
</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 register$1 = function (editor) {
- editor.addButton('forecolor', {
- type: 'colorbutton',
- tooltip: 'Text color',
- format: 'forecolor',
- panel: {
- role: 'application',
- ariaRemember: true,
- html: renderColorPicker(editor, true),
- onclick: onPanelClick(editor, $_2rfqb7rmjjgwefd9.getForeColorCols(editor))
- },
- onclick: onButtonClick(editor)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register$1 = function (editor) {
+ editor.addButton('forecolor', {
+ type: 'colorbutton',
+ tooltip: 'Text color',
+ format: 'forecolor',
+ panel: {
+ role: 'application',
+ ariaRemember: true,
+ html: renderColorPicker(editor, true),
+ onclick: onPanelClick(editor, Settings.getForeColorCols(editor))
+ },
+ onclick: onButtonClick(editor)
+ });
+ editor.addButton('backcolor', {
+ type: 'colorbutton',
+ tooltip: 'Background color',
+ format: 'hilitecolor',
+ panel: {
+ role: 'application',
+ ariaRemember: true,
+ html: renderColorPicker(editor, false),
+ onclick: onPanelClick(editor, Settings.getBackColorCols(editor))
+ },
+ onclick: onButtonClick(editor)
+ });
+ };
+ var Buttons = { register: register$1 };
+
+ global.add('textcolor', function (editor) {
+ Commands.register(editor);
+ Buttons.register(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">- editor.addButton('backcolor', {
- type: 'colorbutton',
- tooltip: 'Background color',
- format: 'hilitecolor',
- panel: {
- role: 'application',
- ariaRemember: true,
- html: renderColorPicker(editor, false),
- onclick: onPanelClick(editor, $_2rfqb7rmjjgwefd9.getBackColorCols(editor))
- },
- onclick: onButtonClick(editor)
- });
- };
- var $_8npvswrjjjgwefd5 = { register: register$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function Plugin () {
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global.add('textcolor', function (editor) {
- $_g2o2pirhjjgwefd1.register(editor);
- $_8npvswrjjjgwefd5.register(editor);
- });
- function Plugin () {
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Plugin;
</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 Plugin;
-
</del><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="trunksrcjs_enqueuesvendortinymcepluginstextcolorpluginminjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/plugins/textcolor/plugin.min.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/plugins/textcolor/plugin.min.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/plugins/textcolor/plugin.min.js 2019-01-29 20:18:33 UTC (rev 44713)
</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(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t,o){var r;return t.dom.getParents(t.selection.getStart(),function(t){var e;(e=t.style["forecolor"===o?"color":"background-color"])&&(r=e)}),r},g=function(t){var e,o=[];for(e=0;e<t.length;e+=2)o.push({text:t[e+1],color:"#"+t[e]});return o},r=function(t,e,o){t.undoManager.transact(function(){t.focus(),t.formatter.apply(e,{value:o}),t.nodeChanged()})},e=function(t,e){t.undoManager.transact(function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()})},o=function(o){o.addCommand("mceApplyTextcolor",function(t,e){r(o,t,e)}),o.addCommand("mceRemoveTextcolor",function(t){e(o,t)})},F=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),i=tinymce.util.Tools.resolve("tinymce.util.To
ols"),a=["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Mag
enta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Red violet","FFFFFF","White","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum"],l=function(t){return t.getParam("textcolor_map",a)},c=function(t){return t.getParam("textcolor_rows",5)},u=function(t){return t.getParam("textcolor_cols",8)},m=function(t){return t.getParam("color_picker_callback",null)},s=function(t){return t.getParam("forecolor_map",l(t))},d=function(t){return t.getParam("backcolor_map",l(t))},f=function(t){return t.getParam("forecolor
_rows",c(t))},b=function(t){return t.getParam("backcolor_rows",c(t))},p=function(t){return t.getParam("forecolor_cols",u(t))},C=function(t){return t.getParam("backcolor_cols",u(t))},y=m,v=function(t){return"function"==typeof m(t)},h=tinymce.util.Tools.resolve("tinymce.util.I18n"),P=function(t,e,o,r){var n,a,l,c,i,u,m,s=0,d=F.DOM.uniqueId("mcearia"),f=function(t,e){var o="transparent"===t;return'<td class="mce-grid-cell'+(o?" mce-colorbtn-trans":"")+'"><div id="'+d+"-"+s+++'" data-mce-color="'+(t||"")+'" role="option" tabIndex="-1" style="'+(t?"background-color: "+t:"")+'" title="'+h.translate(e)+'">'+(o?"×":"")+"</div></td>"};for((n=g(o)).push({text:h.translate("No color"),color:"transparent"}),l='&l
t;table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>',c=n.length-1,u=0;u<e;u++){for(l+="<tr>",i=0;i<t;i++)l+=c<(m=u*t+i)?"<td></td>":f((a=n[m]).color,a.text);l+="</tr>"}if(r){for(l+='<tr><td colspan="'+t+'" class="mce-custom-color-btn"><div id="'+d+'-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="'+d+'-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">'+h.translate("Custom...")+"</button></div></td></tr>",l+="<tr>",i=0;i<t;i++)l+=f("","Custom color");l+="</tr>"}return l+="</tbody></table>"},k=function(t,e)
{t.style.background=e,t.setAttribute("data-mce-color",e)},x=function(o){return function(t){var e=t.control;e._color?o.execCommand("mceApplyTextcolor",e.settings.format,e._color):o.execCommand("mceRemoveTextcolor",e.settings.format)}},T=function(r,c){return function(t){var e,a=this.parent(),o=n(r,a.settings.format),l=function(t){r.execCommand("mceApplyTextcolor",a.settings.format,t),a.hidePanel(),a.color(t)};F.DOM.getParent(t.target,".mce-custom-color-btn")&&(a.hidePanel(),y(r).call(r,function(t){var e,o,r,n=a.panel.getEl().getElementsByTagName("table")[0];for(e=i.map(n.rows[n.rows.length-1].childNodes,function(t){return t.firstChild}),r=0;r<e.length&&(o=e[r]).getAttribute("data-mce-color");r++);if(r===c)for(r=0;r<c-1;r++)k(e[r],e[r+1].getAttribute("data-mce-color"));k(o,t),l(t)},o)),(e=t.target.getAttribute("data-mce-color"))?(this.lastId&&F.DOM.get(this.lastId).se
tAttribute("aria-selected","false"),t.target.setAttribute("aria-selected",!0),this.lastId=t.target.id,"transparent"===e?(r.execCommand("mceRemoveTextcolor",a.settings.format),a.hidePanel(),a.resetColor()):l(e)):null!==e&&a.hidePanel()}},_=function(n,a){return function(){var t=a?p(n):C(n),e=a?f(n):b(n),o=a?s(n):d(n),r=v(n);return P(t,e,o,r)}},A=function(t){t.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:!0,html:_(t,!0),onclick:T(t,p(t))},onclick:x(t)}),t.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:!0,html:_(t,!1),onclick:T(t,C(t))},onclick:x(t)})};t.add("textcolor",function(t){o(t),A(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(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=function(t,o){var r;return t.dom.getParents(t.selection.getStart(),function(t){var e;(e=t.style["forecolor"===o?"color":"background-color"])&&(r=r||e)}),r},g=function(t){var e,o=[];for(e=0;e<t.length;e+=2)o.push({text:t[e+1],color:"#"+t[e]});return o},r=function(t,e,o){t.undoManager.transact(function(){t.focus(),t.formatter.apply(e,{value:o}),t.nodeChanged()})},e=function(t,e){t.undoManager.transact(function(){t.focus(),t.formatter.remove(e,{value:null},null,!0),t.nodeChanged()})},o=function(o){o.addCommand("mceApplyTextcolor",function(t,e){r(o,t,e)}),o.addCommand("mceRemoveTextcolor",function(t){e(o,t)})},F=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),i=tinymce.util.Tools.resolve("tinymce.util
.Tools"),a=["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","
Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Red violet","FFFFFF","White","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum"],l=function(t){return t.getParam("textcolor_map",a)},c=function(t){return t.getParam("textcolor_rows",5)},u=function(t){return t.getParam("textcolor_cols",8)},m=function(t){return t.getParam("color_picker_callback",null)},s=function(t){return t.getParam("forecolor_map",l(t))},d=function(t){return t.getParam("backcolor_map",l(t))},f=function(t){return t.getParam("foreco
lor_rows",c(t))},b=function(t){return t.getParam("backcolor_rows",c(t))},p=function(t){return t.getParam("forecolor_cols",u(t))},C=function(t){return t.getParam("backcolor_cols",u(t))},y=m,v=function(t){return"function"==typeof m(t)},h=tinymce.util.Tools.resolve("tinymce.util.I18n"),P=function(t,e,o,r){var n,a,l,c,i,u,m,s=0,d=F.DOM.uniqueId("mcearia"),f=function(t,e){var o="transparent"===t;return'<td class="mce-grid-cell'+(o?" mce-colorbtn-trans":"")+'"><div id="'+d+"-"+s+++'" data-mce-color="'+(t||"")+'" role="option" tabIndex="-1" style="'+(t?"background-color: "+t:"")+'" title="'+h.translate(e)+'">'+(o?"×":"")+"</div></td>"};for((n=g(o)).push({text:h.translate("No color"),color:"transparent"}),l=
'<table class="mce-grid mce-grid-border mce-colorbutton-grid" role="list" cellspacing="0"><tbody>',c=n.length-1,u=0;u<e;u++){for(l+="<tr>",i=0;i<t;i++)l+=c<(m=u*t+i)?"<td></td>":f((a=n[m]).color,a.text);l+="</tr>"}if(r){for(l+='<tr><td colspan="'+t+'" class="mce-custom-color-btn"><div id="'+d+'-c" class="mce-widget mce-btn mce-btn-small mce-btn-flat" role="button" tabindex="-1" aria-labelledby="'+d+'-c" style="width: 100%"><button type="button" role="presentation" tabindex="-1">'+h.translate("Custom...")+"</button></div></td></tr>",l+="<tr>",i=0;i<t;i++)l+=f("","Custom color");l+="</tr>"}return l+="</tbody></table>"},k=function(t
,e){t.style.background=e,t.setAttribute("data-mce-color",e)},x=function(o){return function(t){var e=t.control;e._color?o.execCommand("mceApplyTextcolor",e.settings.format,e._color):o.execCommand("mceRemoveTextcolor",e.settings.format)}},T=function(r,c){return function(t){var e,a=this.parent(),o=n(r,a.settings.format),l=function(t){r.execCommand("mceApplyTextcolor",a.settings.format,t),a.hidePanel(),a.color(t)};F.DOM.getParent(t.target,".mce-custom-color-btn")&&(a.hidePanel(),y(r).call(r,function(t){var e,o,r,n=a.panel.getEl().getElementsByTagName("table")[0];for(e=i.map(n.rows[n.rows.length-1].childNodes,function(t){return t.firstChild}),r=0;r<e.length&&(o=e[r]).getAttribute("data-mce-color");r++);if(r===c)for(r=0;r<c-1;r++)k(e[r],e[r+1].getAttribute("data-mce-color"));k(o,t),l(t)},o)),(e=t.target.getAttribute("data-mce-color"))?(this.lastId&&F.DOM.get(this.lastId)
.setAttribute("aria-selected","false"),t.target.setAttribute("aria-selected",!0),this.lastId=t.target.id,"transparent"===e?(r.execCommand("mceRemoveTextcolor",a.settings.format),a.hidePanel(),a.resetColor()):l(e)):null!==e&&a.hidePanel()}},_=function(n,a){return function(){var t=a?p(n):C(n),e=a?f(n):b(n),o=a?s(n):d(n),r=v(n);return P(t,e,o,r)}},A=function(t){t.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",format:"forecolor",panel:{role:"application",ariaRemember:!0,html:_(t,!0),onclick:T(t,p(t))},onclick:x(t)}),t.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",format:"hilitecolor",panel:{role:"application",ariaRemember:!0,html:_(t,!1),onclick:T(t,C(t))},onclick:x(t)})};t.add("textcolor",function(t){o(t),A(t)})}();
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcjs_enqueuesvendortinymceskinslightgrayfontstinymcesvg"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/skins/lightgray/fonts/tinymce.svg</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/skins/lightgray/fonts/tinymce.svg 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/skins/lightgray/fonts/tinymce.svg 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -87,6 +87,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <glyph unicode="" glyph-name="reload" d="M889.68 793.68c-93.608 102.216-228.154 166.32-377.68 166.32-282.77 0-512-229.23-512-512h96c0 229.75 186.25 416 416 416 123.020 0 233.542-53.418 309.696-138.306l-149.696-149.694h352v352l-134.32-134.32zM928 448c0-229.75-186.25-416-416-416-123.020 0-233.542 53.418-309.694 138.306l149.694 149.694h-352v-352l134.32 134.32c93.608-102.216 228.154-166.32 377.68-166.32 282.77 0 512 229.23 512 512h-96z" />
</span><span class="cx" style="display: block; padding: 0 10px"> <glyph unicode="" glyph-name="translate" d="M553.6 304l-118.4 118.4c80 89.6 137.6 195.2 172.8 304h137.6v92.8h-326.4v92.8h-92.8v-92.8h-326.4v-92.8h518.4c-32-89.6-80-176-147.2-249.6-44.8 48-80 99.2-108.8 156.8h-92.8c35.2-76.8 80-147.2 137.6-211.2l-236.8-233.6 67.2-67.2 233.6 233.6 144-144c3.2 0 38.4 92.8 38.4 92.8zM816 540.8h-92.8l-208-560h92.8l51.2 140.8h220.8l51.2-140.8h92.8l-208 560zM691.2 214.4l76.8 201.6 76.8-201.6h-153.6z" />
</span><span class="cx" style="display: block; padding: 0 10px"> <glyph unicode="" glyph-name="drag" d="M576 896h128v-128h-128v128zM576 640h128v-128h-128v128zM320 640h128v-128h-128v128zM576 384h128v-128h-128v128zM320 384h128v-128h-128v128zM320 128h128v-128h-128v128zM576 128h128v-128h-128v128zM320 896h128v-128h-128v128z" />
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<glyph unicode="" glyph-name="format-painter" d="M768 746.667v42.667c0 23.467-19.2 42.667-42.667 42.667h-512c-23.467 0-42.667-19.2-42.667-42.667v-170.667c0-23.467 19.2-42.667 42.667-42.667h512c23.467 0 42.667 19.2 42.667 42.667v42.667h42.667v-170.667h-426.667v-384c0-23.467 19.2-42.667 42.667-42.667h85.333c23.467 0 42.667 19.2 42.667 42.667v298.667h341.333v341.333h-128z" />
</ins><span class="cx" style="display: block; padding: 0 10px"> <glyph unicode="" glyph-name="home" d="M1024 369.556l-512 397.426-512-397.428v162.038l512 397.426 512-397.428zM896 384v-384h-256v256h-256v-256h-256v384l384 288z" />
</span><span class="cx" style="display: block; padding: 0 10px"> <glyph unicode="" glyph-name="books" d="M576.234 670.73l242.712 81.432 203.584-606.784-242.712-81.432zM0 64h256v704h-256v-704zM64 640h128v-64h-128v64zM320 64h256v704h-256v-704zM384 640h128v-64h-128v64z" />
</span><span class="cx" style="display: block; padding: 0 10px"> <glyph unicode="" glyph-name="upload" d="M839.432 760.57c27.492-27.492 50.554-78.672 55.552-120.57h-318.984v318.984c41.898-4.998 93.076-28.060 120.568-55.552l142.864-142.862zM512 576v384h-368c-44 0-80-36-80-80v-864c0-44 36-80 80-80h672c44 0 80 36 80 80v560h-384zM576 192v-192h-192v192h-160l256 256 256-256h-160z" />
</span></span></pre></div>
<a id="trunksrcjs_enqueuesvendortinymceskinslightgrayskinmincss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/skins/lightgray/skin.min.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/skins/lightgray/skin.min.css 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/skins/lightgray/skin.min.css 2019-01-29 20:18:33 UTC (rev 44713)
</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">-.mce-container,.mce-container *,.mce-widget,.mce-widget *,.mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#595959;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.word-wrap{word-wrap:break-word;-ms-word-break:break-all;word-break:break-all;word-break:break-word;-ms-hyphens:auto
;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:inherit !important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);box-shadow:0 1px 2px rgba(0, 0, 0, 0.2)}.mce-statusbar>.mce-container-body{display:flex;padding-right:16px}.mce-statusbar>.mce-container-body .mce-path{flex:1}.mce-wordcount{font-size:inherit;text-transform:uppercase;padding:8px 0}div.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative;font-size:11px}.mce-fullscreen .mce-resizehandle{display:none}.mce-statusbar .mce-flow-layout-item{margin:0}.mce-charmap{bo
rder-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #c5c5c5;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:white}.mce-grid td.mce-grid-cell div{border:1px solid #c5c5c5;width:15px;height:15px;margin:0;cursor:pointer}.mce-grid td.mce-grid-cell div:focus{border-color:#91bbe9}.mce-grid td.mce-grid-cell div[disabled]{cursor:not-allowed}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover,.mce-grid a:focus{border-color:#91bbe9}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#c5c5c5;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#91bbe9;background:#bdd6f2}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%}.mce-colorbtn-trans div{text-align:center;vertical-align:middle;font-weight:bold;font-size:20px;lin
e-height:16px;color:#8b8b8b}.mce-monospace{font-family:"Courier New",Courier,monospace}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-container b{font-weight:bold}.mce-container p{margin-bottom:5px}.mce-container a{cursor:pointer;color:#2276d2}.mce-container a:hover{text-decoration:underline}.mce-container ul{margin-left:15px}.mce-container .mce-table-striped{border-collapse:collapse;margin:10px}.mce-container .mce-table-striped thead>tr{background-color:#fafafa}.mce-container .mce-table-striped thead>tr th{font-weight:bold}.mce-container .mce-table-striped td,.mce-container .mce-table-striped th{padding:5px}.mce-container .mce-table-striped tr:nth-child(even){background-color:#fafafa}.mce-container .mce-table-striped tbody>tr:hover{background-color:#e1e1e1}.mce-branding{font-size:inherit;text-transform:uppercase;white-space:pre;padding:8px 0}.mce-branding a{font-size:inherit;color:inherit}.mce-top-part{position:relative}.mce-top-part::before{content:
'';position:absolute;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);top:0;right:0;bottom:0;left:0;pointer-events:none}.mce-rtl .mce-wordcount{left:0;right:auto}.mce-rtl .mce-statusbar>.mce-container-body>*:last-child{padding-right:0;padding-left:10px}.mce-rtl .mce-path{text-align:right;padding-right:16px}.mce-croprect-container{position:absolute;top:0;left:0}.mce-croprect-handle{position:absolute;top:0;left:0;width:20px;height:20px;border:2px solid white}.mce-croprect-handle-nw{border-width:2px 0 0 2px;margin:-2px 0 0 -2px;cursor:nw-resize;top:100px;left:100px}.mce-croprect-handle-ne{border-width:2px 2px 0 0;margin:-2px 0 0 -20px;cursor:ne-resize;top:100px;left:200px}.mce-croprect-handle-sw{border-width:0 0 2px 2px;margin:-20px 2px 0 -2px;cursor:sw-resize;top:200px;left:100px}.mce-croprect-handle-se{border-width:0 2px 2px 0;margin:-20px 0 0 -20px;cursor:se-resize;top:200px;left:200px}.mce-cro
prect-handle-move{position:absolute;cursor:move;border:0}.mce-croprect-block{opacity:.5;filter:alpha(opacity=50);zoom:1;position:absolute;background:black}.mce-croprect-handle:focus{border-color:#2276d2}.mce-croprect-handle-move:focus{outline:1px solid #2276d2}.mce-imagepanel{overflow:auto;background:black}.mce-imagepanel-bg{position:absolute;background:url('data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==')}.mce-imagepanel img{position:absolute}.mce-imagetool.mce-btn .mce-ico{display:block;width:20px;height:20px;text-align:center;line-height:20px;font-size:20px;padding:5px}.mce-arrow-up{margin-top:12px}.mce-arrow-down{margin-top:-12px}.mce-arrow:before,.mce-arrow:after{position:absolute;left:50%;display:block;width:0;height:0;border-style:solid;border-color:transparent;content:""}.mce-arrow.mce-arrow-up:before{top:-9px;border-bottom-color:#c5c5c5;border-width:0 9px 9px;margin-left:-9px}.mce-arrow.mce-arrow-down:before{bott
om:-9px;border-top-color:#c5c5c5;border-width:9px 9px 0;margin-left:-9px}.mce-arrow.mce-arrow-up:after{top:-8px;border-bottom-color:#fff;border-width:0 8px 8px;margin-left:-8px}.mce-arrow.mce-arrow-down:after{bottom:-8px;border-top-color:#fff;border-width:8px 8px 0;margin-left:-8px}.mce-arrow.mce-arrow-left:before,.mce-arrow.mce-arrow-left:after{margin:0}.mce-arrow.mce-arrow-left:before{left:8px}.mce-arrow.mce-arrow-left:after{left:9px}.mce-arrow.mce-arrow-right:before,.mce-arrow.mce-arrow-right:after{left:auto;margin:0}.mce-arrow.mce-arrow-right:before{right:8px}.mce-arrow.mce-arrow-right:after{right:9px}.mce-arrow.mce-arrow-center.mce-arrow.mce-arrow-left:before{left:-9px;top:50%;border-right-color:#c5c5c5;border-width:9px 9px 9px 0;margin-top:-9px}.mce-arrow.mce-arrow-center.mce-arrow.mce-arrow-left:after{left:-8px;top:50%;border-right-color:#fff;border-width:8px 8px 8px 0;margin-top:-8px}.mce-arrow.mce-arrow-center.mce-arrow.mce-arrow-left{margin-left:12px}.mce-arrow.mce-arrow-c
enter.mce-arrow.mce-arrow-right:before{right:-9px;top:50%;border-left-color:#c5c5c5;border-width:9px 0 9px 9px;margin-top:-9px}.mce-arrow.mce-arrow-center.mce-arrow.mce-arrow-right:after{right:-8px;top:50%;border-left-color:#fff;border-width:8px 0 8px 8px;margin-top:-8px}.mce-arrow.mce-arrow-center.mce-arrow.mce-arrow-right{margin-left:-14px}.mce-edit-aria-container>.mce-container-body{display:flex}.mce-edit-aria-container>.mce-container-body .mce-edit-area{flex:1}.mce-edit-aria-container>.mce-container-body .mce-sidebar>.mce-container-body{display:flex;align-items:stretch;height:100%}.mce-edit-aria-container>.mce-container-body .mce-sidebar-panel{min-width:250px;max-width:250px;position:relative}.mce-edit-aria-container>.mce-container-body .mce-sidebar-panel>.mce-container-body{position:absolute;width:100%;height:100%;overflow:auto;top:0;left:0}.mce-sidebar-toolbar{border:0 solid #c5c5c5;border-left-width:1px}.mce-sidebar-toolbar .mce-btn{border-left:0;border-r
ight:0}.mce-sidebar-toolbar .mce-btn.mce-active,.mce-sidebar-toolbar .mce-btn.mce-active:hover{background-color:#555c66}.mce-sidebar-toolbar .mce-btn.mce-active button,.mce-sidebar-toolbar .mce-btn.mce-active:hover button,.mce-sidebar-toolbar .mce-btn.mce-active button i,.mce-sidebar-toolbar .mce-btn.mce-active:hover button i{color:white;text-shadow:1px 1px none}.mce-sidebar-panel{border:0 solid #c5c5c5;border-left-width:1px}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(op
acity=60);zoom:1}.mce-scroll{position:relative}.mce-panel{border:0 solid #f3f3f3;border:0 solid #c5c5c5;background-color:#fff}.mce-floatpanel{position:absolute;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);box-shadow:0 1px 2px rgba(0, 0, 0, 0.2)}.mce-floatpanel.mce-fixed{position:fixed}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);top:0;left:0;background:#FFF;border:1px solid #c5c5c5;border:1px solid rgba(0,0,0,0.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px
;*margin-top:0}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#c5c5c5;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#FFF}.mce-floatpanel.mce-popover.mce-top{margin-top:-10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-top>.mce-arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#c5c5c5;top:auto;bottom:-11px}.mce-floatpanel.mce-popover.mce-top>.mce-arrow:after{bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#FFF}.mce-floatpanel.mce-popover.mce-bottom.mce-start,.mce-floatpanel.mce-popover.mce-top.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow,.mce-floatpanel.mce-popover.mce-top.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end,.mce-floatpanel.mce-popover.mce-top.mce-end{
margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow,.mce-floatpanel.mce-popover.mce-top.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#FFF}#mce-modal-block.mce-in{opacity:.5;filter:alpha(opacity=50);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#FFF;position:fixed;top:0;left:0;opacity:0;transform:scale(.1);transition:transform 100ms ease-in,opacity 150ms ease-in}.mce-window.mce-in{transform:scale(1);opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #c5c5c5;position:relative}.m
ce-window-head .mce-close{position:absolute;right:0;top:0;height:38px;width:38px;text-align:center;cursor:pointer}.mce-window-head .mce-close i{color:#9b9b9b}.mce-close:hover i{color:#bdbdbd}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:20px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#FFF;border-top:1px solid #c5c5c5}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window-body .mce-listbox{border-color:#e2e4e7}.mce-window .mce-btn:hover{border-color:#c5c5c5}.mce-window .mce-btn:focus{border-color:#2276d2}.mce-window-body .mce-btn,.mce-foot .mce-btn{border-color:#c5c5c5}.mce-foot .mce-btn.mce-primary{border-color:transparent}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:0}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-he
ad .mce-title{direction:rtl;text-align:right;padding-right:0;padding-left:20px}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1;margin-top:1px}.mce-tooltip-inner{font-size:11px;background-color:#000;color:white;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-ne,.mce-tooltip-se{margin-left:14px}.mce-tooltip-n .mce-tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;bord
er-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:sol
id;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-progress{display:inline-block;position:relative;height:20px}.mce-progress .mce-bar-container{display:inline-block;width:100px;height:100%;margin-right:8px;border:1px solid #ccc;overflow:hidden}.mce-progress .mce-text{display:inline-block;margin-top:auto;margin-bottom:auto;font-size:14px;width:40px;color:#595959}.mce-bar{display:block;width:0;height:100%;background-color:#dfdfdf;-webkit-transition:width .2s ease;transition:width .2s ease}.mce-notification{position:absolute;background-color:#fff;padding:5px;margin-top:5px;border-width:1px;border-style:solid;border-color:#c5c5c5;transition:transform 100ms ease-in,opacity 150ms ease-in;opacity:0;box-sizing:border-box}.mce-notification.mce-in{opacity:1}.mce-notification-success{background-color:#dff0d8;border-color:#d6e9c6}.mce-notification-info{background-color:#d9edf7;border-color:#779ECB}.mce-notification-warning{background-color:#fcf8e3;border-color
:#faebcc}.mce-notification-error{background-color:#f2dede;border-color:#ebccd1}.mce-notification.mce-has-close{padding-right:15px}.mce-notification .mce-ico{margin-top:5px}.mce-notification-inner{word-wrap:break-word;-ms-word-break:break-all;word-break:break-all;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;display:inline-block;font-size:14px;margin:5px 8px 4px 8px;text-align:center;white-space:normal;color:#31708f}.mce-notification-inner a{text-decoration:underline;cursor:pointer}.mce-notification .mce-progress{margin-right:8px}.mce-notification .mce-progress .mce-text{margin-top:5px}.mce-notification *,.mce-notification .mce-progress .mce-text{color:#595959}.mce-notification .mce-progress .mce-bar-container{border-color:#c5c5c5}.mce-notification .mce-progress .mce-bar-container .mce-bar{background-color:#595959}.mce-notification-success *,.mce-notification-success .mce-progress .mce-text{color:#3c763d}.mce-notification-success .mce-prog
ress .mce-bar-container{border-color:#d6e9c6}.mce-notification-success .mce-progress .mce-bar-container .mce-bar{background-color:#3c763d}.mce-notification-info *,.mce-notification-info .mce-progress .mce-text{color:#31708f}.mce-notification-info .mce-progress .mce-bar-container{border-color:#779ECB}.mce-notification-info .mce-progress .mce-bar-container .mce-bar{background-color:#31708f}.mce-notification-warning *,.mce-notification-warning .mce-progress .mce-text{color:#8a6d3b}.mce-notification-warning .mce-progress .mce-bar-container{border-color:#faebcc}.mce-notification-warning .mce-progress .mce-bar-container .mce-bar{background-color:#8a6d3b}.mce-notification-error *,.mce-notification-error .mce-progress .mce-text{color:#a94442}.mce-notification-error .mce-progress .mce-bar-container{border-color:#ebccd1}.mce-notification-error .mce-progress .mce-bar-container .mce-bar{background-color:#a94442}.mce-notification .mce-close{position:absolute;top:6px;right:8px;font-size:20px;font
-weight:bold;line-height:20px;color:#9b9b9b;cursor:pointer}.mce-abs-layout{position:relative}html .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-btn{border:1px solid #b3b3b3;border-color:transparent transparent transparent transparent;position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);background:white;display:inline-block;*display:inline;*zoom:1;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-btn:hover,.mce-btn:active{background:white;color:#595959;border-color:#e2e4e7}.mce-btn:focus{background:white;color:#595959;border-color:#e2e4e7}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover,.mce-btn.mce-active:focus,.mce-btn.mce-active:active{-webkit-box-shadow:none;-moz-box-shadow:none;box-
shadow:none;background:#555c66;color:white;border-color:transparent}.mce-btn.mce-active button,.mce-btn.mce-active:hover button,.mce-btn.mce-active i,.mce-btn.mce-active:hover i{color:white}.mce-btn:hover .mce-caret{border-top-color:#b5bcc2}.mce-btn.mce-active .mce-caret,.mce-btn.mce-active:hover .mce-caret{border-top-color:white}.mce-btn button{padding:4px 6px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#595959;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px none}.mce-primary.mce-btn-has-text{min-width:50px}.mce-primary{color:white;border:1px solid transparent;border-color:transparent;background-color:#2276d2}.mce-primary:hover,.mce-primary:focus{background-color:#1e6abc;border-color:transparent}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alp
ha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#1e6abc;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-primary button,.mce-primary button i{color:white;text-shadow:1px 1px none}.mce-btn .mce-txt{font-size:inherit;line-height:inherit;color:inherit}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #b5bcc2;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px
solid #b5bcc2;border-top:0}.mce-btn-flat{border:0;background:transparent;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-btn-flat:hover,.mce-btn-flat.mce-active,.mce-btn-flat:focus,.mce-btn-flat:active{border:0;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-btn-has-text .mce-ico{padding-right:5px}.mce-rtl .mce-btn button{direction:rtl}.mce-toolbar .mce-btn-group{margin:0;padding:2px 0}.mce-btn-group .mce-btn{border-width:1px;margin:0;margin-left:2px}.mce-btn-group:not(:first-child){border-left:1px solid #d9d9d9;padding-left:0;margin-left:2px}.mce-btn-group{margin-left:2px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-rtl .mce-btn-group .mce-btn{margin-left:0;margin-right:2px}.mce-rtl .mce-btn-group .mce-first{margin-right:0}.mce-rtl .mce-btn-group:not(:first-child){border-left:none;border-right:1px solid #d9d9d9;padding-right:4px;margin-right:4px}.mce-checkbox{cursor:pointer}i.mce-i-checkbox
{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;background-color:white;text-indent:-10em;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#595959;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid #2276d2;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#bdbdbd}.mce-checkbox .mce-label{vertical-align:middle}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-combobox{position:relative;display:inline-block;*display:inline;*zoom:1;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#bdbdbd}.mce-combobox .mce-btn{border:1px solid #c5c5c5;border-left:
0;margin:0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-combobox .mce-status{position:absolute;right:2px;top:50%;line-height:16px;margin-top:-8px;font-size:12px;width:15px;height:15px;text-align:center;cursor:pointer}.mce-combobox.mce-has-status input{padding-right:20px}.mce-combobox.mce-has-open .mce-status{right:37px}.mce-combobox .mce-status.mce-i-warning{color:#c09853}.mce-combobox .mce-status.mce-i-checkmark{color:#468847}.mce-menu.mce-combobox-menu{border-top:0;margin-top:0;max-height:200px}.mce-menu.mce-combobox-menu .mce-menu-item{padding:4px 6px 4px 4px;font-size:11px}.mce-menu.mce-combobox-menu .mce-menu-item-sep{padding:0}.mce-menu.mce-combobox-menu .mce-text,.mce-menu.mce-combobox-menu .mce-text b{font-size:11px}.mce-menu.mce-combobox-menu .mce-menu-item-link,.mce-menu.mce-combobox-menu .mce-menu
-item-link b{font-size:11px}.mce-colorbox i{border:1px solid #c5c5c5;width:14px;height:14px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-17px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:3px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;padding-left:2px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px;border-left:0}.mce-colorpicker{position:relative;width:250px;height:220px}.mce-colorpicker-sv{position:absolute;top:0;left:0;width:90%;height:100%;border:1px solid #c5c5c5;cursor:crosshair;overflow:hidden}.mce-colorpicker-h-chunk{width:100%}.mce-colorpicker-
overlay1,.mce-colorpicker-overlay2{width:100%;height:100%;position:absolute;top:0;left:0}.mce-colorpicker-overlay1{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='#ffffff', endColorstr='#00ffffff');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')";background:linear-gradient(to right, #fff, rgba(255,255,255,0))}.mce-colorpicker-overlay2{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#00000000', endColorstr='#000000');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')";background:linear-gradient(to bottom, rgba(0,0,0,0), #000)}.mce-colorpicker-selector1{background:none;position:absolute;width:12px;height:12px;margin:-8px 0 0 -8px;border:1px solid black;border-radius:50%}.mce-colorpicker-selector2{position:absolute;width:10px;height:10px;border:1px solid white;bo
rder-radius:50%}.mce-colorpicker-h{position:absolute;top:0;right:0;width:6.5%;height:100%;border:1px solid #c5c5c5;cursor:crosshair}.mce-colorpicker-h-marker{margin-top:-4px;position:absolute;top:0;left:-1px;width:100%;border:1px solid black;background:white;height:4px;z-index:100}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal;font-size:inherit}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#595959;font-size:inherit;text-transform:uppercase}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#555c66;color:white}.mce-path .mce-divider{display:inline;font-size:inherit}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9E9E9E}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}
.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #c5c5c5;width:100%;height:100%}.mce-infobox{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);overflow:hidden;border:1px solid red}.mce-infobox div{display:block;margin:5px}.mce-infobox div button{position:absolute;top:50%;right:4px;cursor:pointer;margin-top:-8px;display:none}.mce-infobox div button:focus{outline:2px solid #e2e4e7}.mce-infobox.mce-has-help div{margin-right:25px}.mce-infobox.mce-has-help button{d
isplay:block}.mce-infobox.mce-success{background:#dff0d8;border-color:#d6e9c6}.mce-infobox.mce-success div{color:#3c763d}.mce-infobox.mce-warning{background:#fcf8e3;border-color:#faebcc}.mce-infobox.mce-warning div{color:#8a6d3b}.mce-infobox.mce-error{background:#f2dede;border-color:#ebccd1}.mce-infobox.mce-error div{color:#a94442}.mce-rtl .mce-infobox div{text-align:right;direction:rtl}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-label.mce-success{color:#468847}.mce-label.mce-warning{color:#c09853}.mce-label.mce-error{color:#b94a48}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar{border:1px solid #e2e4e7}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar .mce-menubt
n button span{color:#595959}.mce-menubar .mce-caret{border-top-color:#b5bcc2}.mce-menubar .mce-active .mce-caret,.mce-menubar .mce-menubtn:hover .mce-caret{border-top-color:#b5bcc2}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:#e2e4e7;background:white;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubar .mce-menubtn.mce-active{border-bottom:none;z-index:65537}div.mce-menubtn.mce-opened{border-bottom-color:white;z-index:65537}.mce-menubtn button{color:#595959}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-rtl .mce-menubtn.mce-fixed-width span{direction:rtl;text-align:right}.mce-menu-item{display:block;padding:6px 4px 6
px 4px;clear:both;font-weight:normal;line-height:20px;color:#595959;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-text,.mce-menu-item .mce-text b{line-height:1;vertical-align:initial}.mce-menu-item .mce-caret{margin-top:4px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #595959}.mce-menu-item .mce-menu-shortcut{display:inline-block;padding:0 10px 0 20px;color:#aaa}.mce-menu-item .mce-ico{padding-right:4px}.mce-menu-item:hover,.mce-menu-item:focus{background:#ededee}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#aaa}.mce-menu-item:hover .mce-text,.mce-menu-item:focus .mce-text,.mce-menu-item:hover .mce-ico,.mce-menu-item:focus .mce-ico{color:#595959}.mce-menu-item.mce-selected{background:#ededee}.mce-menu-item.mce-selected .mce-text,.mce-menu-item.mce-selected .mce-ico{color:#595959}.mce-menu-item.mce-activ
e.mce-menu-item-normal{background:#555c66}.mce-menu-item.mce-active.mce-menu-item-normal .mce-text,.mce-menu-item.mce-active.mce-menu-item-normal .mce-ico{color:white}.mce-menu-item.mce-active.mce-menu-item-checkbox .mce-ico{visibility:visible}.mce-menu-item.mce-disabled,.mce-menu-item.mce-disabled:hover{background:white}.mce-menu-item.mce-disabled:focus,.mce-menu-item.mce-disabled:hover:focus{background:#ededee}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled:hover .mce-text,.mce-menu-item.mce-disabled .mce-ico,.mce-menu-item.mce-disabled:hover .mce-ico{color:#aaa}.mce-menu-item.mce-menu-item-preview.mce-active{border-left:5px solid #555c66;background:white}.mce-menu-item.mce-menu-item-preview.mce-active .mce-text,.mce-menu-item.mce-menu-item-preview.mce-active .mce-ico{color:#595959}.mce-menu-item.mce-menu-item-preview.mce-active:hover{background:#ededee}.mce-menu-item-link{color:#093;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mce-menu-item-link b{
color:#093}.mce-menu-item-ellipsis{display:block;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.mce-menu-item:hover *,.mce-menu-item.mce-selected *,.mce-menu-item:focus *{color:#595959}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:transparent;border-bottom:1px solid rgba(0,0,0,0.1);cursor:default;filter:none}div.mce-menu .mce-menu-item b{font-weight:bold}.mce-menu-item-indent-1{padding-left:20px}.mce-menu-item-indent-2{padding-left:35px}.mce-menu-item-indent-2{padding-left:35px}.mce-menu-item-indent-3{padding-left:40px}.mce-menu-item-indent-4{padding-left:45px}.mce-menu-item-indent-5{padding-left:50px}.mce-menu-item-indent-6{padding-left:55px}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #595959;border-left:0}.mce-rtl .mce-menu-item.mce
-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#595959}.mce-rtl .mce-menu-item .mce-ico{padding-right:0;padding-left:4px}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}.mce-throbber-inline{position:static;height:50px}.mce-menu .mce-throbber-inline{height:25px;background-size:contain}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:-1px 0 0;min-width:180px;background:white;border:1px solid #c5c9cf;border:1px solid #e2e4e7;z-index:1002;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);max-height:500px;overflow:auto;overflow-x:hidden}.mce-menu.mce-animate{op
acity:.01;transform:rotateY(10deg) rotateX(-10deg);transform-origin:left top}.mce-menu.mce-menu-align .mce-menu-shortcut,.mce-menu.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block}.mce-menu.mce-in.mce-animate{opacity:1;transform:rotateY(0) rotateX(0);transition:opacity .075s ease,transform .1s ease}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-rtl .mce-menu-item .mce-ico{padding-right:0;padding-left:4px}.mce-rtl.mce-menu-align .mce-caret,.mce-rtl .mce-menu-shortcut{right:auto;left:0}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-container-body .mce-resizehandle{position:abso
lute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#595959}.mce-selectbox{background:#fff;border:1px solid #c5c5c5}.mce-slider{border:1px solid #c5c5c5;background:#fff;width:100px;height:10px;position:relative;display:block}.mce-slider.mce-vertical{width:10px;height:100px}.mce-slider-handle{border:1px solid #c5c5c5;background:#e6e6e6;display:block;width:13px;height:13px;position:absolute;top:0;left:0;margin-left:-1px;margin-top:-2px}.mce-slider-handle:focus{border-color:#2276d2}.mce-spacer{visibility:hidden}.mce-splitbtn:hover .mce-open{border-left:1px solid #e2e4e7}.mce-splitbtn .mce-open{border-left:1px solid transparent;padding-right:4px;padding-left:4px}.mce-splitbtn .mce-open:focus{border-left:1px solid #e2e4e7}.mce-splitbtn .mce-open:hover,.mce-splitbtn .mce-open:active{border-left:1px solid #e2e4e7}.mce-splitbtn.mce-active:hover .mce-open{border-left:1px soli
d white}.mce-splitbtn.mce-opened{border-color:#e2e4e7}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:4px;padding-left:4px}.mce-rtl .mce-splitbtn .mce-open{border-left:0}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tabs,.mce-tabs+.mce-container-body{background:#fff}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#fff;padding:8px 15px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#FDFDFD}.mce-tab.mce-active{background:#FDFDFD;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-tab:focus{color:#2276d2}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;-webkit-box-shadow:none;-moz-box-shadow:none;box-shad
ow:none;display:inline-block;-webkit-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#595959}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:#2276d2;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px;height:auto}.mce-textbox.mce-disabled{color:#bdbdbd}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.mce-dropzone{border:3px dashed gray;text-align:center}.mce-dropzone span{text-transform:uppercase;display:inline-block;vertical-align:middle}.mce-dropzone:after{content:"";height:100%;display:inline-block;vertical-align:middle}.mce-dropzone.mce-disabled{opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-dropzone.mce-disabled.mce-dragenter{cursor:not-allowed}.mce-browsebutton{position:relative;overflow:hidden}.mce-browsebutton button{positi
on:relative;z-index:1}.mce-browsebutton input{opacity:0;filter:alpha(opacity=0);zoom:1;position:absolute;top:0;left:0;width:100%;height:100%;z-index:0}@font-face{font-family:'tinymce';src:url('fonts/tinymce.eot');src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce.woff') format('woff'),url('fonts/tinymce.ttf') format('truetype'),url('fonts/tinymce.svg#tinymce') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/tinymce-small.eot');src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce-small.woff') format('woff'),url('fonts/tinymce-small.ttf') format('truetype'),url('fonts/tinymce-small.svg#tinymce') format('svg');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce',Arial;font-style:normal;font-weight:normal;font-variant:normal;font-size:16px;line-height:16px;speak:none;vertical-align:text-top;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:
grayscale;display:inline-block;background:transparent center center;background-size:cover;width:16px;height:16px;color:#595959}.mce-btn-small .mce-ico{font-family:'tinymce-small',Arial}.mce-i-save:before{content:"\e000"}.mce-i-newdocument:before{content:"\e001"}.mce-i-fullpage:before{content:"\e002"}.mce-i-alignleft:before{content:"\e003"}.mce-i-aligncenter:before{content:"\e004"}.mce-i-alignright:before{content:"\e005"}.mce-i-alignjustify:before{content:"\e006"}.mce-i-alignnone:before{content:"\e003"}.mce-i-cut:before{content:"\e007"}.mce-i-paste:before{content:"\e008"}.mce-i-searchreplace:before{content:"\e009"}.mce-i-bullist:before{content:"\e00a"}.mce-i-numlist:before{content:"\e00b"}.mce-i-indent:before{content:"\e00c"}.mce-i-outdent:before{content:"\e00d"}.mce-i-blockquote:before{content:"\e00e"}.mce-i-undo:before{conte
nt:"\e00f"}.mce-i-redo:before{content:"\e010"}.mce-i-link:before{content:"\e011"}.mce-i-unlink:before{content:"\e012"}.mce-i-anchor:before{content:"\e013"}.mce-i-image:before{content:"\e014"}.mce-i-media:before{content:"\e015"}.mce-i-help:before{content:"\e016"}.mce-i-code:before{content:"\e017"}.mce-i-insertdatetime:before{content:"\e018"}.mce-i-preview:before{content:"\e019"}.mce-i-forecolor:before{content:"\e01a"}.mce-i-backcolor:before{content:"\e01a"}.mce-i-table:before{content:"\e01b"}.mce-i-hr:before{content:"\e01c"}.mce-i-removeformat:before{content:"\e01d"}.mce-i-subscript:before{content:"\e01e"}.mce-i-superscript:before{content:"\e01f"}.mce-i-charmap:before{content:"\e020"}.mce-i-emoticons:before{content:"\e021"}.mce-i-print:before{content:"\e022"}.mce-i-fullscreen:b
efore{content:"\e023"}.mce-i-spellchecker:before{content:"\e024"}.mce-i-nonbreaking:before{content:"\e025"}.mce-i-template:before{content:"\e026"}.mce-i-pagebreak:before{content:"\e027"}.mce-i-restoredraft:before{content:"\e028"}.mce-i-bold:before{content:"\e02a"}.mce-i-italic:before{content:"\e02b"}.mce-i-underline:before{content:"\e02c"}.mce-i-strikethrough:before{content:"\e02d"}.mce-i-visualchars:before{content:"\e02e"}.mce-i-visualblocks:before{content:"\e02e"}.mce-i-ltr:before{content:"\e02f"}.mce-i-rtl:before{content:"\e030"}.mce-i-copy:before{content:"\e031"}.mce-i-resize:before{content:"\e032"}.mce-i-browse:before{content:"\e034"}.mce-i-pastetext:before{content:"\e035"}.mce-i-rotateleft:before{content:"\eaa8"}.mce-i-rotateright:before{content:"\eaa9"}.mce-i-crop:before{content:
"\ee78"}.mce-i-editimage:before{content:"\e915"}.mce-i-options:before{content:"\ec6a"}.mce-i-flipv:before{content:"\eaaa"}.mce-i-fliph:before{content:"\eaac"}.mce-i-zoomin:before{content:"\eb35"}.mce-i-zoomout:before{content:"\eb36"}.mce-i-sun:before{content:"\eccc"}.mce-i-moon:before{content:"\eccd"}.mce-i-arrowleft:before{content:"\edc0"}.mce-i-arrowright:before{content:"\e93c"}.mce-i-drop:before{content:"\e935"}.mce-i-contrast:before{content:"\ecd4"}.mce-i-sharpen:before{content:"\eba7"}.mce-i-resize2:before{content:"\edf9"}.mce-i-orientation:before{content:"\e601"}.mce-i-invert:before{content:"\e602"}.mce-i-gamma:before{content:"\e600"}.mce-i-remove:before{content:"\ed6a"}.mce-i-tablerowprops:before{content:"\e604"}.mce-i-tablecellprops:before{content:"\e605"}.mce-i-table2
:before{content:"\e606"}.mce-i-tablemergecells:before{content:"\e607"}.mce-i-tableinsertcolbefore:before{content:"\e608"}.mce-i-tableinsertcolafter:before{content:"\e609"}.mce-i-tableinsertrowbefore:before{content:"\e60a"}.mce-i-tableinsertrowafter:before{content:"\e60b"}.mce-i-tablesplitcells:before{content:"\e60d"}.mce-i-tabledelete:before{content:"\e60e"}.mce-i-tableleftheader:before{content:"\e62a"}.mce-i-tabletopheader:before{content:"\e62b"}.mce-i-tabledeleterow:before{content:"\e800"}.mce-i-tabledeletecol:before{content:"\e801"}.mce-i-codesample:before{content:"\e603"}.mce-i-fill:before{content:"\e902"}.mce-i-borderwidth:before{content:"\e903"}.mce-i-line:before{content:"\e904"}.mce-i-count:before{content:"\e905"}.mce-i-translate:before{content:"\e907"}.mce-i-drag:before{content:"\e908"}.m
ce-i-home:before{content:"\e90b"}.mce-i-upload:before{content:"\e914"}.mce-i-bubble:before{content:"\e91c"}.mce-i-user:before{content:"\e91d"}.mce-i-lock:before{content:"\e926"}.mce-i-unlock:before{content:"\e927"}.mce-i-settings:before{content:"\e928"}.mce-i-remove2:before{content:"\e92a"}.mce-i-menu:before{content:"\e92d"}.mce-i-warning:before{content:"\e930"}.mce-i-question:before{content:"\e931"}.mce-i-pluscircle:before{content:"\e932"}.mce-i-info:before{content:"\e933"}.mce-i-notice:before{content:"\e934"}.mce-i-arrowup:before{content:"\e93b"}.mce-i-arrowdown:before{content:"\e93d"}.mce-i-arrowup2:before{content:"\e93f"}.mce-i-arrowdown2:before{content:"\e940"}.mce-i-menu2:before{content:"\e941"}.mce-i-newtab:before{content:"\e961"}.mce-i-a11y:before{content:"\e900"}.mce-
i-plus:before{content:"\e93a"}.mce-i-insert:before{content:"\e93a"}.mce-i-minus:before{content:"\e939"}.mce-i-books:before{content:"\e911"}.mce-i-reload:before{content:"\e906"}.mce-i-toc:before{content:"\e901"}.mce-i-checkmark:before{content:"\e033"}.mce-i-checkbox:before,.mce-i-selected:before{content:"\e033"}.mce-i-insert{font-size:14px}.mce-i-selected{visibility:hidden}i.mce-i-backcolor{text-shadow:none;background:#BBB}.mce-rtl .mce-filepicker input{direction:ltr}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.mce-container,.mce-container *,.mce-widget,.mce-widget *,.mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#595959;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.word-wrap{word-wrap:break-word;-ms-word-break:break-all;word-break:break-all;word-break:break-word;-ms-hyphens:auto;
-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:inherit !important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);box-shadow:0 1px 2px rgba(0, 0, 0, 0.2)}.mce-statusbar>.mce-container-body{display:flex;padding-right:16px}.mce-statusbar>.mce-container-body .mce-path{flex:1}.mce-wordcount{font-size:inherit;text-transform:uppercase;padding:8px 0}div.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative;font-size:11px}.mce-fullscreen .mce-resizehandle{display:none}.mce-statusbar .mce-flow-layout-item{margin:0}.mce-charmap{bor
der-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #c5c5c5;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:white}.mce-grid td.mce-grid-cell div{border:1px solid #c5c5c5;width:15px;height:15px;margin:0;cursor:pointer}.mce-grid td.mce-grid-cell div:focus{border-color:#91bbe9}.mce-grid td.mce-grid-cell div[disabled]{cursor:not-allowed}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover,.mce-grid a:focus{border-color:#91bbe9}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#c5c5c5;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#91bbe9;background:#bdd6f2}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%}.mce-colorbtn-trans div{text-align:center;vertical-align:middle;font-weight:bold;font-size:20px;line
-height:16px;color:#8b8b8b}.mce-monospace{font-family:"Courier New",Courier,monospace}.mce-toolbar-grp .mce-flow-layout-item{margin-bottom:0}.mce-container b{font-weight:bold}.mce-container p{margin-bottom:5px}.mce-container a{cursor:pointer;color:#2276d2}.mce-container a:hover{text-decoration:underline}.mce-container ul{margin-left:15px}.mce-container .mce-table-striped{border-collapse:collapse;margin:10px}.mce-container .mce-table-striped thead>tr{background-color:#fafafa}.mce-container .mce-table-striped thead>tr th{font-weight:bold}.mce-container .mce-table-striped td,.mce-container .mce-table-striped th{padding:5px}.mce-container .mce-table-striped tr:nth-child(even){background-color:#fafafa}.mce-container .mce-table-striped tbody>tr:hover{background-color:#e1e1e1}.mce-branding{font-size:inherit;text-transform:uppercase;white-space:pre;padding:8px 0}.mce-branding a{font-size:inherit;color:inherit}.mce-top-part{position:relative}.mce-top-part::before{content:'
';position:absolute;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);top:0;right:0;bottom:0;left:0;pointer-events:none}.mce-rtl .mce-wordcount{left:0;right:auto}.mce-rtl .mce-statusbar>.mce-container-body>*:last-child{padding-right:0;padding-left:10px}.mce-rtl .mce-path{text-align:right;padding-right:16px}.mce-croprect-container{position:absolute;top:0;left:0}.mce-croprect-handle{position:absolute;top:0;left:0;width:20px;height:20px;border:2px solid white}.mce-croprect-handle-nw{border-width:2px 0 0 2px;margin:-2px 0 0 -2px;cursor:nw-resize;top:100px;left:100px}.mce-croprect-handle-ne{border-width:2px 2px 0 0;margin:-2px 0 0 -20px;cursor:ne-resize;top:100px;left:200px}.mce-croprect-handle-sw{border-width:0 0 2px 2px;margin:-20px 2px 0 -2px;cursor:sw-resize;top:200px;left:100px}.mce-croprect-handle-se{border-width:0 2px 2px 0;margin:-20px 0 0 -20px;cursor:se-resize;top:200px;left:200px}.mce-crop
rect-handle-move{position:absolute;cursor:move;border:0}.mce-croprect-block{opacity:.5;filter:alpha(opacity=50);zoom:1;position:absolute;background:black}.mce-croprect-handle:focus{border-color:#2276d2}.mce-croprect-handle-move:focus{outline:1px solid #2276d2}.mce-imagepanel{overflow:auto;background:black}.mce-imagepanel-bg{position:absolute;background:url('data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==')}.mce-imagepanel img{position:absolute}.mce-imagetool.mce-btn .mce-ico{display:block;width:20px;height:20px;text-align:center;line-height:20px;font-size:20px;padding:5px}.mce-arrow-up{margin-top:12px}.mce-arrow-down{margin-top:-12px}.mce-arrow:before,.mce-arrow:after{position:absolute;left:50%;display:block;width:0;height:0;border-style:solid;border-color:transparent;content:""}.mce-arrow.mce-arrow-up:before{top:-9px;border-bottom-color:#c5c5c5;border-width:0 9px 9px;margin-left:-9px}.mce-arrow.mce-arrow-down:before{botto
m:-9px;border-top-color:#c5c5c5;border-width:9px 9px 0;margin-left:-9px}.mce-arrow.mce-arrow-up:after{top:-8px;border-bottom-color:#fff;border-width:0 8px 8px;margin-left:-8px}.mce-arrow.mce-arrow-down:after{bottom:-8px;border-top-color:#fff;border-width:8px 8px 0;margin-left:-8px}.mce-arrow.mce-arrow-left:before,.mce-arrow.mce-arrow-left:after{margin:0}.mce-arrow.mce-arrow-left:before{left:8px}.mce-arrow.mce-arrow-left:after{left:9px}.mce-arrow.mce-arrow-right:before,.mce-arrow.mce-arrow-right:after{left:auto;margin:0}.mce-arrow.mce-arrow-right:before{right:8px}.mce-arrow.mce-arrow-right:after{right:9px}.mce-arrow.mce-arrow-center.mce-arrow.mce-arrow-left:before{left:-9px;top:50%;border-right-color:#c5c5c5;border-width:9px 9px 9px 0;margin-top:-9px}.mce-arrow.mce-arrow-center.mce-arrow.mce-arrow-left:after{left:-8px;top:50%;border-right-color:#fff;border-width:8px 8px 8px 0;margin-top:-8px}.mce-arrow.mce-arrow-center.mce-arrow.mce-arrow-left{margin-left:12px}.mce-arrow.mce-arrow-ce
nter.mce-arrow.mce-arrow-right:before{right:-9px;top:50%;border-left-color:#c5c5c5;border-width:9px 0 9px 9px;margin-top:-9px}.mce-arrow.mce-arrow-center.mce-arrow.mce-arrow-right:after{right:-8px;top:50%;border-left-color:#fff;border-width:8px 0 8px 8px;margin-top:-8px}.mce-arrow.mce-arrow-center.mce-arrow.mce-arrow-right{margin-left:-14px}.mce-edit-aria-container>.mce-container-body{display:flex}.mce-edit-aria-container>.mce-container-body .mce-edit-area{flex:1}.mce-edit-aria-container>.mce-container-body .mce-sidebar>.mce-container-body{display:flex;align-items:stretch;height:100%}.mce-edit-aria-container>.mce-container-body .mce-sidebar-panel{min-width:250px;max-width:250px;position:relative}.mce-edit-aria-container>.mce-container-body .mce-sidebar-panel>.mce-container-body{position:absolute;width:100%;height:100%;overflow:auto;top:0;left:0}.mce-sidebar-toolbar{border:0 solid #c5c5c5;border-left-width:1px}.mce-sidebar-toolbar .mce-btn{border-left:0;border-ri
ght:0}.mce-sidebar-toolbar .mce-btn.mce-active,.mce-sidebar-toolbar .mce-btn.mce-active:hover{background-color:#555c66}.mce-sidebar-toolbar .mce-btn.mce-active button,.mce-sidebar-toolbar .mce-btn.mce-active:hover button,.mce-sidebar-toolbar .mce-btn.mce-active button i,.mce-sidebar-toolbar .mce-btn.mce-active:hover button i{color:white;text-shadow:1px 1px none}.mce-sidebar-panel{border:0 solid #c5c5c5;border-left-width:1px}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opa
city=60);zoom:1}.mce-scroll{position:relative}.mce-panel{border:0 solid #f3f3f3;border:0 solid #c5c5c5;background-color:#fff}.mce-floatpanel{position:absolute;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);box-shadow:0 1px 2px rgba(0, 0, 0, 0.2)}.mce-floatpanel.mce-fixed{position:fixed}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);top:0;left:0;background:#FFF;border:1px solid #c5c5c5;border:1px solid rgba(0,0,0,0.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px;
*margin-top:0}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#c5c5c5;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#FFF}.mce-floatpanel.mce-popover.mce-top{margin-top:-10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-top>.mce-arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#c5c5c5;top:auto;bottom:-11px}.mce-floatpanel.mce-popover.mce-top>.mce-arrow:after{bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#FFF}.mce-floatpanel.mce-popover.mce-bottom.mce-start,.mce-floatpanel.mce-popover.mce-top.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow,.mce-floatpanel.mce-popover.mce-top.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end,.mce-floatpanel.mce-popover.mce-top.mce-end{m
argin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow,.mce-floatpanel.mce-popover.mce-top.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#FFF}#mce-modal-block.mce-in{opacity:.5;filter:alpha(opacity=50);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#FFF;position:fixed;top:0;left:0;opacity:0;transform:scale(.1);transition:transform 100ms ease-in,opacity 150ms ease-in}.mce-window.mce-in{transform:scale(1);opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #c5c5c5;position:relative}.mc
e-window-head .mce-close{position:absolute;right:0;top:0;height:38px;width:38px;text-align:center;cursor:pointer}.mce-window-head .mce-close i{color:#9b9b9b}.mce-close:hover i{color:#bdbdbd}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:20px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#FFF;border-top:1px solid #c5c5c5}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window-body .mce-listbox{border-color:#e2e4e7}.mce-window .mce-btn:hover{border-color:#c5c5c5}.mce-window .mce-btn:focus{border-color:#2276d2}.mce-window-body .mce-btn,.mce-foot .mce-btn{border-color:#c5c5c5}.mce-foot .mce-btn.mce-primary{border-color:transparent}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:0}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-hea
d .mce-title{direction:rtl;text-align:right;padding-right:0;padding-left:20px}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1;margin-top:1px}.mce-tooltip-inner{font-size:11px;background-color:#000;color:white;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-ne,.mce-tooltip-se{margin-left:14px}.mce-tooltip-n .mce-tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;borde
r-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:soli
d;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-progress{display:inline-block;position:relative;height:20px}.mce-progress .mce-bar-container{display:inline-block;width:100px;height:100%;margin-right:8px;border:1px solid #ccc;overflow:hidden}.mce-progress .mce-text{display:inline-block;margin-top:auto;margin-bottom:auto;font-size:14px;width:40px;color:#595959}.mce-bar{display:block;width:0;height:100%;background-color:#dfdfdf;-webkit-transition:width .2s ease;transition:width .2s ease}.mce-notification{position:absolute;background-color:#fff;padding:5px;margin-top:5px;border-width:1px;border-style:solid;border-color:#c5c5c5;transition:transform 100ms ease-in,opacity 150ms ease-in;opacity:0;box-sizing:border-box}.mce-notification.mce-in{opacity:1}.mce-notification-success{background-color:#dff0d8;border-color:#d6e9c6}.mce-notification-info{background-color:#d9edf7;border-color:#779ECB}.mce-notification-warning{background-color:#fcf8e3;border-color:
#faebcc}.mce-notification-error{background-color:#f2dede;border-color:#ebccd1}.mce-notification.mce-has-close{padding-right:15px}.mce-notification .mce-ico{margin-top:5px}.mce-notification-inner{word-wrap:break-word;-ms-word-break:break-all;word-break:break-all;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;display:inline-block;font-size:14px;margin:5px 8px 4px 8px;text-align:center;white-space:normal;color:#31708f}.mce-notification-inner a{text-decoration:underline;cursor:pointer}.mce-notification .mce-progress{margin-right:8px}.mce-notification .mce-progress .mce-text{margin-top:5px}.mce-notification *,.mce-notification .mce-progress .mce-text{color:#595959}.mce-notification .mce-progress .mce-bar-container{border-color:#c5c5c5}.mce-notification .mce-progress .mce-bar-container .mce-bar{background-color:#595959}.mce-notification-success *,.mce-notification-success .mce-progress .mce-text{color:#3c763d}.mce-notification-success .mce-progr
ess .mce-bar-container{border-color:#d6e9c6}.mce-notification-success .mce-progress .mce-bar-container .mce-bar{background-color:#3c763d}.mce-notification-info *,.mce-notification-info .mce-progress .mce-text{color:#31708f}.mce-notification-info .mce-progress .mce-bar-container{border-color:#779ECB}.mce-notification-info .mce-progress .mce-bar-container .mce-bar{background-color:#31708f}.mce-notification-warning *,.mce-notification-warning .mce-progress .mce-text{color:#8a6d3b}.mce-notification-warning .mce-progress .mce-bar-container{border-color:#faebcc}.mce-notification-warning .mce-progress .mce-bar-container .mce-bar{background-color:#8a6d3b}.mce-notification-error *,.mce-notification-error .mce-progress .mce-text{color:#a94442}.mce-notification-error .mce-progress .mce-bar-container{border-color:#ebccd1}.mce-notification-error .mce-progress .mce-bar-container .mce-bar{background-color:#a94442}.mce-notification .mce-close{position:absolute;top:6px;right:8px;font-size:20px;font-
weight:bold;line-height:20px;color:#9b9b9b;cursor:pointer}.mce-abs-layout{position:relative}html .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-btn{border:1px solid #b3b3b3;border-color:transparent transparent transparent transparent;position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);background:white;display:inline-block;*display:inline;*zoom:1;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-btn:hover,.mce-btn:active{background:white;color:#595959;border-color:#e2e4e7}.mce-btn:focus{background:white;color:#595959;border-color:#e2e4e7}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover,.mce-btn.mce-active:focus,.mce-btn.mce-active:active{-webkit-box-shadow:none;-moz-box-shadow:none;box-s
hadow:none;background:#555c66;color:white;border-color:transparent}.mce-btn.mce-active button,.mce-btn.mce-active:hover button,.mce-btn.mce-active i,.mce-btn.mce-active:hover i{color:white}.mce-btn:hover .mce-caret{border-top-color:#b5bcc2}.mce-btn.mce-active .mce-caret,.mce-btn.mce-active:hover .mce-caret{border-top-color:white}.mce-btn button{padding:4px 6px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#595959;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px none}.mce-primary.mce-btn-has-text{min-width:50px}.mce-primary{color:white;border:1px solid transparent;border-color:transparent;background-color:#2276d2}.mce-primary:hover,.mce-primary:focus{background-color:#1e6abc;border-color:transparent}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alph
a(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#1e6abc;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-primary button,.mce-primary button i{color:white;text-shadow:1px 1px none}.mce-btn .mce-txt{font-size:inherit;line-height:inherit;color:inherit}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:1px 5px;font-size:12px;*padding-bottom:2px}.mce-btn-small i{line-height:20px;vertical-align:top;*line-height:18px}.mce-btn .mce-caret{margin-top:8px;margin-left:0}.mce-btn-small .mce-caret{margin-top:8px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #b5bcc2;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px s
olid #b5bcc2;border-top:0}.mce-btn-flat{border:0;background:transparent;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-btn-flat:hover,.mce-btn-flat.mce-active,.mce-btn-flat:focus,.mce-btn-flat:active{border:0;background:#e6e6e6;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-btn-has-text .mce-ico{padding-right:5px}.mce-rtl .mce-btn button{direction:rtl}.mce-toolbar .mce-btn-group{margin:0;padding:2px 0}.mce-btn-group .mce-btn{border-width:1px;margin:0;margin-left:2px}.mce-btn-group:not(:first-child){border-left:1px solid #d9d9d9;padding-left:0;margin-left:2px}.mce-btn-group{margin-left:2px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-rtl .mce-btn-group .mce-btn{margin-left:0;margin-right:2px}.mce-rtl .mce-btn-group .mce-first{margin-right:0}.mce-rtl .mce-btn-group:not(:first-child){border-left:none;border-right:1px solid #d9d9d9;padding-right:4px;margin-right:4px}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{
margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;background-color:white;text-indent:-10em;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#595959;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid #2276d2;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#bdbdbd}.mce-checkbox .mce-label{vertical-align:middle}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-combobox{position:relative;display:inline-block;*display:inline;*zoom:1;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#bdbdbd}.mce-combobox .mce-btn{border:1px solid #c5c5c5;border-left:0
;margin:0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-combobox .mce-status{position:absolute;right:2px;top:50%;line-height:16px;margin-top:-8px;font-size:12px;width:15px;height:15px;text-align:center;cursor:pointer}.mce-combobox.mce-has-status input{padding-right:20px}.mce-combobox.mce-has-open .mce-status{right:37px}.mce-combobox .mce-status.mce-i-warning{color:#c09853}.mce-combobox .mce-status.mce-i-checkmark{color:#468847}.mce-menu.mce-combobox-menu{border-top:0;margin-top:0;max-height:200px}.mce-menu.mce-combobox-menu .mce-menu-item{padding:4px 6px 4px 4px;font-size:11px}.mce-menu.mce-combobox-menu .mce-menu-item-sep{padding:0}.mce-menu.mce-combobox-menu .mce-text,.mce-menu.mce-combobox-menu .mce-text b{font-size:11px}.mce-menu.mce-combobox-menu .mce-menu-item-link,.mce-menu.mce-combobox-menu .mce-menu-
item-link b{font-size:11px}.mce-colorbox i{border:1px solid #c5c5c5;width:14px;height:14px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-17px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-16px;padding-right:0;width:16px}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:3px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;padding-left:2px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px;border-left:0}.mce-colorpicker{position:relative;width:250px;height:220px}.mce-colorpicker-sv{position:absolute;top:0;left:0;width:90%;height:100%;border:1px solid #c5c5c5;cursor:crosshair;overflow:hidden}.mce-colorpicker-h-chunk{width:100%}.mce-colorpicker-o
verlay1,.mce-colorpicker-overlay2{width:100%;height:100%;position:absolute;top:0;left:0}.mce-colorpicker-overlay1{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr='#ffffff', endColorstr='#00ffffff');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr='#ffffff', endColorstr='#00ffffff')";background:linear-gradient(to right, #fff, rgba(255,255,255,0))}.mce-colorpicker-overlay2{filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#00000000', endColorstr='#000000');-ms-filter:"progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00000000', endColorstr='#000000')";background:linear-gradient(to bottom, rgba(0,0,0,0), #000)}.mce-colorpicker-selector1{background:none;position:absolute;width:12px;height:12px;margin:-8px 0 0 -8px;border:1px solid black;border-radius:50%}.mce-colorpicker-selector2{position:absolute;width:10px;height:10px;border:1px solid white;bor
der-radius:50%}.mce-colorpicker-h{position:absolute;top:0;right:0;width:6.5%;height:100%;border:1px solid #c5c5c5;cursor:crosshair}.mce-colorpicker-h-marker{margin-top:-4px;position:absolute;top:0;left:-1px;width:100%;border:1px solid black;background:white;height:4px;z-index:100}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal;font-size:inherit}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#595959;font-size:inherit;text-transform:uppercase}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#555c66;color:white}.mce-path .mce-divider{display:inline;font-size:inherit}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9E9E9E}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.
mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #c5c5c5;width:100%;height:100%}.mce-infobox{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);overflow:hidden;border:1px solid red}.mce-infobox div{display:block;margin:5px}.mce-infobox div button{position:absolute;top:50%;right:4px;cursor:pointer;margin-top:-8px;display:none}.mce-infobox div button:focus{outline:2px solid #e2e4e7}.mce-infobox.mce-has-help div{margin-right:25px}.mce-infobox.mce-has-help button{di
splay:block}.mce-infobox.mce-success{background:#dff0d8;border-color:#d6e9c6}.mce-infobox.mce-success div{color:#3c763d}.mce-infobox.mce-warning{background:#fcf8e3;border-color:#faebcc}.mce-infobox.mce-warning div{color:#8a6d3b}.mce-infobox.mce-error{background:#f2dede;border-color:#ebccd1}.mce-infobox.mce-error div{color:#a94442}.mce-rtl .mce-infobox div{text-align:right;direction:rtl}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-label.mce-success{color:#468847}.mce-label.mce-warning{color:#c09853}.mce-label.mce-error{color:#b94a48}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar{border:1px solid #e2e4e7}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar .mce-menubtn
button span{color:#595959}.mce-menubar .mce-caret{border-top-color:#b5bcc2}.mce-menubar .mce-active .mce-caret,.mce-menubar .mce-menubtn:hover .mce-caret{border-top-color:#b5bcc2}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:#e2e4e7;background:white;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubar .mce-menubtn.mce-active{border-bottom:none;z-index:65537}div.mce-menubtn.mce-opened{border-bottom-color:white;z-index:65537}div.mce-menubtn.mce-opened.mce-opened-under{z-index:0}.mce-menubtn button{color:#595959}.mce-menubtn.mce-btn-small span{font-size:12px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-menubtn .mce-caret{*margin-top:6px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-rtl .mce-menubtn.mce-fixed-width span{direction:rtl;text-align
:right}.mce-menu-item{display:block;padding:6px 4px 6px 4px;clear:both;font-weight:normal;line-height:20px;color:#595959;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-text,.mce-menu-item .mce-text b{line-height:1;vertical-align:initial}.mce-menu-item .mce-caret{margin-top:4px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #595959}.mce-menu-item .mce-menu-shortcut{display:inline-block;padding:0 10px 0 20px;color:#aaa}.mce-menu-item .mce-ico{padding-right:4px}.mce-menu-item:hover,.mce-menu-item:focus{background:#ededee}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#aaa}.mce-menu-item:hover .mce-text,.mce-menu-item:focus .mce-text,.mce-menu-item:hover .mce-ico,.mce-menu-item:focus .mce-ico{color:#595959}.mce-menu-item.mce-selected{background:#ededee}.mce-menu-item.mce-selected .mce-text,.mce-menu-item.mce-sel
ected .mce-ico{color:#595959}.mce-menu-item.mce-active.mce-menu-item-normal{background:#555c66}.mce-menu-item.mce-active.mce-menu-item-normal .mce-text,.mce-menu-item.mce-active.mce-menu-item-normal .mce-ico{color:white}.mce-menu-item.mce-active.mce-menu-item-checkbox .mce-ico{visibility:visible}.mce-menu-item.mce-disabled,.mce-menu-item.mce-disabled:hover{background:white}.mce-menu-item.mce-disabled:focus,.mce-menu-item.mce-disabled:hover:focus{background:#ededee}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled:hover .mce-text,.mce-menu-item.mce-disabled .mce-ico,.mce-menu-item.mce-disabled:hover .mce-ico{color:#aaa}.mce-menu-item.mce-menu-item-preview.mce-active{border-left:5px solid #555c66;background:white}.mce-menu-item.mce-menu-item-preview.mce-active .mce-text,.mce-menu-item.mce-menu-item-preview.mce-active .mce-ico{color:#595959}.mce-menu-item.mce-menu-item-preview.mce-active:hover{background:#ededee}.mce-menu-item-link{color:#093;overflow:hidden;text-overfl
ow:ellipsis;white-space:nowrap}.mce-menu-item-link b{color:#093}.mce-menu-item-ellipsis{display:block;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.mce-menu-item:hover *,.mce-menu-item.mce-selected *,.mce-menu-item:focus *{color:#595959}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:transparent;border-bottom:1px solid rgba(0,0,0,0.1);cursor:default;filter:none}div.mce-menu .mce-menu-item b{font-weight:bold}.mce-menu-item-indent-1{padding-left:20px}.mce-menu-item-indent-2{padding-left:35px}.mce-menu-item-indent-2{padding-left:35px}.mce-menu-item-indent-3{padding-left:40px}.mce-menu-item-indent-4{padding-left:45px}.mce-menu-item-indent-5{padding-left:50px}.mce-menu-item-indent-6{padding-left:55px}.mce-menu.mce-rtl{direction:rtl}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px so
lid #595959;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#595959}.mce-rtl .mce-menu-item .mce-ico{padding-right:0;padding-left:4px}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}.mce-throbber-inline{position:static;height:50px}.mce-menu .mce-throbber-inline{height:25px;background-size:contain}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:-1px 0 0;min-width:180px;background:white;border:1px solid #c5c9cf;border:1px solid #e2e4e7;z-index:1002;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);box-shadow:0 1px 2px rgba(0, 0, 0, 0.2);max-height:500px;ove
rflow:auto;overflow-x:hidden}.mce-menu.mce-animate{opacity:.01;transform:rotateY(10deg) rotateX(-10deg);transform-origin:left top}.mce-menu.mce-menu-align .mce-menu-shortcut,.mce-menu.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block}.mce-menu.mce-in.mce-animate{opacity:1;transform:rotateY(0) rotateX(0);transition:opacity .075s ease,transform .1s ease}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-rtl .mce-menu-item .mce-ico{padding-right:0;padding-left:4px}.mce-rtl.mce-menu-align .mce-caret,.mce-rtl .mce-menu-shortcut{right:auto;left:0}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20p
x}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#595959}.mce-selectbox{background:#fff;border:1px solid #c5c5c5}.mce-slider{border:1px solid #c5c5c5;background:#fff;width:100px;height:10px;position:relative;display:block}.mce-slider.mce-vertical{width:10px;height:100px}.mce-slider-handle{border:1px solid #c5c5c5;background:#e6e6e6;display:block;width:13px;height:13px;position:absolute;top:0;left:0;margin-left:-1px;margin-top:-2px}.mce-slider-handle:focus{border-color:#2276d2}.mce-spacer{visibility:hidden}.mce-splitbtn:hover .mce-open{border-left:1px solid #e2e4e7}.mce-splitbtn .mce-open{border-left:1px solid transparent;padding-right:4px;padding-left:4px}.mce-splitbtn .mce-open:focus{border-left:1px solid #e2e4e7}.mce-splitbtn .mce-open:hover,.mce-splitbtn .mce-open:active{border-left:1px solid #e2e4e7}.mce-spl
itbtn.mce-active:hover .mce-open{border-left:1px solid white}.mce-splitbtn.mce-opened{border-color:#e2e4e7}.mce-splitbtn.mce-btn-small .mce-open{padding:0 3px 0 3px}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:4px;padding-left:4px}.mce-rtl .mce-splitbtn .mce-open{border-left:0}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tabs,.mce-tabs+.mce-container-body{background:#fff}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#fff;padding:8px 15px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#FDFDFD}.mce-tab.mce-active{background:#FDFDFD;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-tab:focus{color:#2276d2}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;
-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;display:inline-block;-webkit-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#595959}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:#2276d2;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px;height:auto}.mce-textbox.mce-disabled{color:#bdbdbd}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.mce-dropzone{border:3px dashed gray;text-align:center}.mce-dropzone span{text-transform:uppercase;display:inline-block;vertical-align:middle}.mce-dropzone:after{content:"";height:100%;display:inline-block;vertical-align:middle}.mce-dropzone.mce-disabled{opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-dropzone.mce-disabled.mce-dragenter{cursor:not-allowed}.mce-browsebutton{position:rel
ative;overflow:hidden}.mce-browsebutton button{position:relative;z-index:1}.mce-browsebutton input{opacity:0;filter:alpha(opacity=0);zoom:1;position:absolute;top:0;left:0;width:100%;height:100%;z-index:0}@font-face{font-family:'tinymce';src:url('fonts/tinymce.eot');src:url('fonts/tinymce.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce.woff') format('woff'),url('fonts/tinymce.ttf') format('truetype'),url('fonts/tinymce.svg#tinymce') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/tinymce-small.eot');src:url('fonts/tinymce-small.eot?#iefix') format('embedded-opentype'),url('fonts/tinymce-small.woff') format('woff'),url('fonts/tinymce-small.ttf') format('truetype'),url('fonts/tinymce-small.svg#tinymce') format('svg');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce',Arial;font-style:normal;font-weight:normal;font-variant:normal;font-size:16px;line-height:16px;speak:none;vertical-align:text-top;-webki
t-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;background:transparent center center;background-size:cover;width:16px;height:16px;color:#595959}.mce-btn-small .mce-ico{font-family:'tinymce-small',Arial}.mce-i-save:before{content:"\e000"}.mce-i-newdocument:before{content:"\e001"}.mce-i-fullpage:before{content:"\e002"}.mce-i-alignleft:before{content:"\e003"}.mce-i-aligncenter:before{content:"\e004"}.mce-i-alignright:before{content:"\e005"}.mce-i-alignjustify:before{content:"\e006"}.mce-i-alignnone:before{content:"\e003"}.mce-i-cut:before{content:"\e007"}.mce-i-paste:before{content:"\e008"}.mce-i-searchreplace:before{content:"\e009"}.mce-i-bullist:before{content:"\e00a"}.mce-i-numlist:before{content:"\e00b"}.mce-i-indent:before{content:"\e00c"}.mce-i-outdent:before{content:"\e00d"}.mce-i-blockquote:befo
re{content:"\e00e"}.mce-i-undo:before{content:"\e00f"}.mce-i-redo:before{content:"\e010"}.mce-i-link:before{content:"\e011"}.mce-i-unlink:before{content:"\e012"}.mce-i-anchor:before{content:"\e013"}.mce-i-image:before{content:"\e014"}.mce-i-media:before{content:"\e015"}.mce-i-help:before{content:"\e016"}.mce-i-code:before{content:"\e017"}.mce-i-insertdatetime:before{content:"\e018"}.mce-i-preview:before{content:"\e019"}.mce-i-forecolor:before{content:"\e01a"}.mce-i-backcolor:before{content:"\e01a"}.mce-i-table:before{content:"\e01b"}.mce-i-hr:before{content:"\e01c"}.mce-i-removeformat:before{content:"\e01d"}.mce-i-subscript:before{content:"\e01e"}.mce-i-superscript:before{content:"\e01f"}.mce-i-charmap:before{content:"\e020"}.mce-i-emoticons:before{content:"\e021"}.mce-i-print
:before{content:"\e022"}.mce-i-fullscreen:before{content:"\e023"}.mce-i-spellchecker:before{content:"\e024"}.mce-i-nonbreaking:before{content:"\e025"}.mce-i-template:before{content:"\e026"}.mce-i-pagebreak:before{content:"\e027"}.mce-i-restoredraft:before{content:"\e028"}.mce-i-bold:before{content:"\e02a"}.mce-i-italic:before{content:"\e02b"}.mce-i-underline:before{content:"\e02c"}.mce-i-strikethrough:before{content:"\e02d"}.mce-i-visualchars:before{content:"\e02e"}.mce-i-visualblocks:before{content:"\e02e"}.mce-i-ltr:before{content:"\e02f"}.mce-i-rtl:before{content:"\e030"}.mce-i-copy:before{content:"\e031"}.mce-i-resize:before{content:"\e032"}.mce-i-browse:before{content:"\e034"}.mce-i-pastetext:before{content:"\e035"}.mce-i-rotateleft:before{content:"\eaa8"}.mce-i-rotateright:before{
content:"\eaa9"}.mce-i-crop:before{content:"\ee78"}.mce-i-editimage:before{content:"\e915"}.mce-i-options:before{content:"\ec6a"}.mce-i-flipv:before{content:"\eaaa"}.mce-i-fliph:before{content:"\eaac"}.mce-i-zoomin:before{content:"\eb35"}.mce-i-zoomout:before{content:"\eb36"}.mce-i-sun:before{content:"\eccc"}.mce-i-moon:before{content:"\eccd"}.mce-i-arrowleft:before{content:"\edc0"}.mce-i-arrowright:before{content:"\e93c"}.mce-i-drop:before{content:"\e935"}.mce-i-contrast:before{content:"\ecd4"}.mce-i-sharpen:before{content:"\eba7"}.mce-i-resize2:before{content:"\edf9"}.mce-i-orientation:before{content:"\e601"}.mce-i-invert:before{content:"\e602"}.mce-i-gamma:before{content:"\e600"}.mce-i-remove:before{content:"\ed6a"}.mce-i-tablerowprops:before{content:"\e604"}.mce-i-tablecel
lprops:before{content:"\e605"}.mce-i-table2:before{content:"\e606"}.mce-i-tablemergecells:before{content:"\e607"}.mce-i-tableinsertcolbefore:before{content:"\e608"}.mce-i-tableinsertcolafter:before{content:"\e609"}.mce-i-tableinsertrowbefore:before{content:"\e60a"}.mce-i-tableinsertrowafter:before{content:"\e60b"}.mce-i-tablesplitcells:before{content:"\e60d"}.mce-i-tabledelete:before{content:"\e60e"}.mce-i-tableleftheader:before{content:"\e62a"}.mce-i-tabletopheader:before{content:"\e62b"}.mce-i-tabledeleterow:before{content:"\e800"}.mce-i-tabledeletecol:before{content:"\e801"}.mce-i-codesample:before{content:"\e603"}.mce-i-fill:before{content:"\e902"}.mce-i-borderwidth:before{content:"\e903"}.mce-i-line:before{content:"\e904"}.mce-i-count:before{content:"\e905"}.mce-i-translate:before{content:"\e907&
quot;}.mce-i-drag:before{content:"\e908"}.mce-i-home:before{content:"\e90b"}.mce-i-upload:before{content:"\e914"}.mce-i-bubble:before{content:"\e91c"}.mce-i-user:before{content:"\e91d"}.mce-i-lock:before{content:"\e926"}.mce-i-unlock:before{content:"\e927"}.mce-i-settings:before{content:"\e928"}.mce-i-remove2:before{content:"\e92a"}.mce-i-menu:before{content:"\e92d"}.mce-i-warning:before{content:"\e930"}.mce-i-question:before{content:"\e931"}.mce-i-pluscircle:before{content:"\e932"}.mce-i-info:before{content:"\e933"}.mce-i-notice:before{content:"\e934"}.mce-i-arrowup:before{content:"\e93b"}.mce-i-arrowdown:before{content:"\e93d"}.mce-i-arrowup2:before{content:"\e93f"}.mce-i-arrowdown2:before{content:"\e940"}.mce-i-menu2:before{content:"\e941"}.mce-i-newtab:before{content:"\e961&quo
t;}.mce-i-a11y:before{content:"\e900"}.mce-i-plus:before{content:"\e93a"}.mce-i-insert:before{content:"\e93a"}.mce-i-minus:before{content:"\e939"}.mce-i-books:before{content:"\e911"}.mce-i-reload:before{content:"\e906"}.mce-i-toc:before{content:"\e901"}.mce-i-checkmark:before{content:"\e033"}.mce-i-format-painter:before{content:"\e909"}.mce-i-checkbox:before,.mce-i-selected:before{content:"\e033"}.mce-i-insert{font-size:14px}.mce-i-selected{visibility:hidden}i.mce-i-backcolor{text-shadow:none;background:#BBB}.mce-rtl .mce-filepicker input{direction:ltr}/*# sourceMappingURL=skin.min.css.map */
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcjs_enqueuesvendortinymcethemesinlitethemejs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/themes/inlite/theme.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/themes/inlite/theme.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/themes/inlite/theme.js 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,10235 +1,9821 @@
</span><span class="cx" style="display: block; padding: 0 10px"> (function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var inlite = (function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'use strict';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'use strict';
</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 global = tinymce.util.Tools.resolve('tinymce.ThemeManager');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global = tinymce.util.Tools.resolve('tinymce.ThemeManager');
</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 global$1 = tinymce.util.Tools.resolve('tinymce.Env');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$1 = tinymce.util.Tools.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">- var global$2 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$2 = tinymce.util.Tools.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">- var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay');
</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 flatten = function (arr) {
- return arr.reduce(function (results, item) {
- return Array.isArray(item) ? results.concat(flatten(item)) : results.concat(item);
- }, []);
- };
- var $_ccn98l17xjjgwejz7 = { flatten: flatten };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var flatten = function (arr) {
+ return arr.reduce(function (results, item) {
+ return Array.isArray(item) ? results.concat(flatten(item)) : results.concat(item);
+ }, []);
+ };
+ var DeepFlatten = { flatten: flatten };
</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 result = function (id, rect) {
- return {
- id: id,
- rect: rect
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var result = function (id, rect) {
+ return {
+ id: id,
+ rect: rect
+ };
</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 match = function (editor, matchers) {
- for (var i = 0; i < matchers.length; i++) {
- var f = matchers[i];
- var result_1 = f(editor);
- if (result_1) {
- return result_1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var match = function (editor, matchers) {
+ for (var i = 0; i < matchers.length; i++) {
+ var f = matchers[i];
+ var result_1 = f(editor);
+ if (result_1) {
+ return result_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 null;
- };
- var $_6lg87517zjjgwejza = {
- match: match,
- result: result
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return null;
+ };
+ var Matcher = {
+ match: match,
+ result: result
+ };
</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 fromClientRect = function (clientRect) {
- return {
- x: clientRect.left,
- y: clientRect.top,
- w: clientRect.width,
- h: clientRect.height
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fromClientRect = function (clientRect) {
+ return {
+ x: clientRect.left,
+ y: clientRect.top,
+ w: clientRect.width,
+ h: clientRect.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">- };
- var toClientRect = function (geomRect) {
- return {
- left: geomRect.x,
- top: geomRect.y,
- width: geomRect.w,
- height: geomRect.h,
- right: geomRect.x + geomRect.w,
- bottom: geomRect.y + geomRect.h
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var toClientRect = function (geomRect) {
+ return {
+ left: geomRect.x,
+ top: geomRect.y,
+ width: geomRect.w,
+ height: geomRect.h,
+ right: geomRect.x + geomRect.w,
+ bottom: geomRect.y + geomRect.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">- };
- var $_1x174x181jjgwejzd = {
- fromClientRect: fromClientRect,
- toClientRect: toClientRect
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Convert = {
+ fromClientRect: fromClientRect,
+ toClientRect: toClientRect
+ };
</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 toAbsolute = function (rect) {
- var vp = global$2.DOM.getViewPort();
- return {
- x: rect.x + vp.x,
- y: rect.y + vp.y,
- w: rect.w,
- h: rect.h
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var toAbsolute = function (rect) {
+ var vp = global$2.DOM.getViewPort();
+ return {
+ x: rect.x + vp.x,
+ y: rect.y + vp.y,
+ w: rect.w,
+ h: rect.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">- };
- var measureElement = function (elm) {
- var clientRect = elm.getBoundingClientRect();
- return toAbsolute({
- x: clientRect.left,
- y: clientRect.top,
- w: Math.max(elm.clientWidth, elm.offsetWidth),
- h: Math.max(elm.clientHeight, elm.offsetHeight)
- });
- };
- var getElementRect = function (editor, elm) {
- return measureElement(elm);
- };
- var getPageAreaRect = function (editor) {
- return measureElement(editor.getElement().ownerDocument.body);
- };
- var getContentAreaRect = function (editor) {
- return measureElement(editor.getContentAreaContainer() || editor.getBody());
- };
- var getSelectionRect = function (editor) {
- var clientRect = editor.selection.getBoundingClientRect();
- return clientRect ? toAbsolute($_1x174x181jjgwejzd.fromClientRect(clientRect)) : null;
- };
- var $_51qgo2180jjgwejzb = {
- getElementRect: getElementRect,
- getPageAreaRect: getPageAreaRect,
- getContentAreaRect: getContentAreaRect,
- getSelectionRect: getSelectionRect
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var measureElement = function (elm) {
+ var clientRect = elm.getBoundingClientRect();
+ return toAbsolute({
+ x: clientRect.left,
+ y: clientRect.top,
+ w: Math.max(elm.clientWidth, elm.offsetWidth),
+ h: Math.max(elm.clientHeight, elm.offsetHeight)
+ });
+ };
+ var getElementRect = function (editor, elm) {
+ return measureElement(elm);
+ };
+ var getPageAreaRect = function (editor) {
+ return measureElement(editor.getElement().ownerDocument.body);
+ };
+ var getContentAreaRect = function (editor) {
+ return measureElement(editor.getContentAreaContainer() || editor.getBody());
+ };
+ var getSelectionRect = function (editor) {
+ var clientRect = editor.selection.getBoundingClientRect();
+ return clientRect ? toAbsolute(Convert.fromClientRect(clientRect)) : null;
+ };
+ var Measure = {
+ getElementRect: getElementRect,
+ getPageAreaRect: getPageAreaRect,
+ getContentAreaRect: getContentAreaRect,
+ getSelectionRect: getSelectionRect
+ };
</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 element = function (element, predicateIds) {
- return function (editor) {
- for (var i = 0; i < predicateIds.length; i++) {
- if (predicateIds[i].predicate(element)) {
- var result = $_6lg87517zjjgwejza.result(predicateIds[i].id, $_51qgo2180jjgwejzb.getElementRect(editor, element));
- return result;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var element = function (element, predicateIds) {
+ return function (editor) {
+ for (var i = 0; i < predicateIds.length; i++) {
+ if (predicateIds[i].predicate(element)) {
+ var result = Matcher.result(predicateIds[i].id, Measure.getElementRect(editor, element));
+ return result;
+ }
</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 null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- };
- var parent = function (elements, predicateIds) {
- return function (editor) {
- for (var i = 0; i < elements.length; i++) {
- for (var x = 0; x < predicateIds.length; x++) {
- if (predicateIds[x].predicate(elements[i])) {
- return $_6lg87517zjjgwejza.result(predicateIds[x].id, $_51qgo2180jjgwejzb.getElementRect(editor, elements[i]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var parent = function (elements, predicateIds) {
+ return function (editor) {
+ for (var i = 0; i < elements.length; i++) {
+ for (var x = 0; x < predicateIds.length; x++) {
+ if (predicateIds[x].predicate(elements[i])) {
+ return Matcher.result(predicateIds[x].id, Measure.getElementRect(editor, elements[i]));
+ }
</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">- }
- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- };
- var $_egsucq17yjjgwejz9 = {
- element: element,
- parent: parent
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ElementMatcher = {
+ element: element,
+ parent: parent
+ };
</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 global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$4 = tinymce.util.Tools.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">- var create = function (id, predicate) {
- return {
- id: id,
- predicate: predicate
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var create = function (id, predicate) {
+ return {
+ id: id,
+ predicate: predicate
+ };
</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 fromContextToolbars = function (toolbars) {
- return global$4.map(toolbars, function (toolbar) {
- return create(toolbar.id, toolbar.predicate);
- });
- };
- var $_9rj8kx182jjgwejze = {
- create: create,
- fromContextToolbars: fromContextToolbars
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fromContextToolbars = function (toolbars) {
+ return global$4.map(toolbars, function (toolbar) {
+ return create(toolbar.id, toolbar.predicate);
+ });
+ };
+ var PredicateId = {
+ create: create,
+ fromContextToolbars: fromContextToolbars
+ };
</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 textSelection = function (id) {
- return function (editor) {
- if (!editor.selection.isCollapsed()) {
- var result = $_6lg87517zjjgwejza.result(id, $_51qgo2180jjgwejzb.getSelectionRect(editor));
- return result;
- }
- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var textSelection = function (id) {
+ return function (editor) {
+ if (!editor.selection.isCollapsed()) {
+ var result = Matcher.result(id, Measure.getSelectionRect(editor));
+ return result;
+ }
+ return 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">- };
- var emptyTextBlock = function (elements, id) {
- return function (editor) {
- var i;
- var textBlockElementsMap = editor.schema.getTextBlockElements();
- for (i = 0; i < elements.length; i++) {
- if (elements[i].nodeName === 'TABLE') {
- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var emptyTextBlock = function (elements, id) {
+ return function (editor) {
+ var i;
+ var textBlockElementsMap = editor.schema.getTextBlockElements();
+ for (i = 0; i < elements.length; i++) {
+ if (elements[i].nodeName === 'TABLE') {
+ return 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">- }
- for (i = 0; i < elements.length; i++) {
- if (elements[i].nodeName in textBlockElementsMap) {
- if (editor.dom.isEmpty(elements[i])) {
- return $_6lg87517zjjgwejza.result(id, $_51qgo2180jjgwejzb.getSelectionRect(editor));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (i = 0; i < elements.length; i++) {
+ if (elements[i].nodeName in textBlockElementsMap) {
+ if (editor.dom.isEmpty(elements[i])) {
+ return Matcher.result(id, Measure.getSelectionRect(editor));
+ }
+ return 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 null;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- };
- var $_fhwgeg184jjgwejzf = {
- textSelection: textSelection,
- emptyTextBlock: emptyTextBlock
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var SelectionMatcher = {
+ textSelection: textSelection,
+ emptyTextBlock: emptyTextBlock
+ };
</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 fireSkinLoaded = function (editor) {
- editor.fire('SkinLoaded');
- };
- var fireBeforeRenderUI = function (editor) {
- return editor.fire('BeforeRenderUI');
- };
- var $_77u64d186jjgwejzi = {
- fireSkinLoaded: fireSkinLoaded,
- fireBeforeRenderUI: fireBeforeRenderUI
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fireSkinLoaded = function (editor) {
+ editor.fire('SkinLoaded');
+ };
+ var fireBeforeRenderUI = function (editor) {
+ return editor.fire('BeforeRenderUI');
+ };
+ var Events = {
+ fireSkinLoaded: fireSkinLoaded,
+ fireBeforeRenderUI: fireBeforeRenderUI
+ };
</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 global$5 = tinymce.util.Tools.resolve('tinymce.EditorManager');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$5 = tinymce.util.Tools.resolve('tinymce.EditorManager');
</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 isType = function (type) {
- return function (value) {
- return typeof value === type;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isType = function (type) {
+ return function (value) {
+ return typeof value === 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 isArray = function (value) {
- return Array.isArray(value);
- };
- var isNull = function (value) {
- return value === null;
- };
- var isObject = function (predicate) {
- return function (value) {
- return !isNull(value) && !isArray(value) && predicate(value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isArray = function (value) {
+ return Array.isArray(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 isString = function (value) {
- return isType('string')(value);
- };
- var isNumber = function (value) {
- return isType('number')(value);
- };
- var isFunction = function (value) {
- return isType('function')(value);
- };
- var isBoolean = function (value) {
- return isType('boolean')(value);
- };
- var $_e4npq318ajjgwejzo = {
- isString: isString,
- isNumber: isNumber,
- isBoolean: isBoolean,
- isFunction: isFunction,
- isObject: isObject(isType('object')),
- isNull: isNull,
- isArray: isArray
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isNull = function (value) {
+ return value === null;
+ };
+ var isObject = function (predicate) {
+ return function (value) {
+ return !isNull(value) && !isArray(value) && predicate(value);
+ };
+ };
+ var isString = function (value) {
+ return isType('string')(value);
+ };
+ var isNumber = function (value) {
+ return isType('number')(value);
+ };
+ var isFunction = function (value) {
+ return isType('function')(value);
+ };
+ var isBoolean = function (value) {
+ return isType('boolean')(value);
+ };
+ var Type = {
+ isString: isString,
+ isNumber: isNumber,
+ isBoolean: isBoolean,
+ isFunction: isFunction,
+ isObject: isObject(isType('object')),
+ isNull: isNull,
+ isArray: 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">- var validDefaultOrDie = function (value, predicate) {
- if (predicate(value)) {
- return true;
- }
- throw new Error('Default value doesn\'t match requested type.');
- };
- var getByTypeOr = function (predicate) {
- return function (editor, name, defaultValue) {
- var settings = editor.settings;
- validDefaultOrDie(defaultValue, predicate);
- return name in settings && predicate(settings[name]) ? settings[name] : defaultValue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var validDefaultOrDie = function (value, predicate) {
+ if (predicate(value)) {
+ return true;
+ }
+ throw new Error('Default value doesn\'t match requested 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 splitNoEmpty = function (str, delim) {
- return str.split(delim).filter(function (item) {
- return item.length > 0;
- });
- };
- var itemsToArray = function (value, defaultValue) {
- var stringToItemsArray = function (value) {
- return typeof value === 'string' ? splitNoEmpty(value, /[ ,]/) : value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getByTypeOr = function (predicate) {
+ return function (editor, name, defaultValue) {
+ var settings = editor.settings;
+ validDefaultOrDie(defaultValue, predicate);
+ return name in settings && predicate(settings[name]) ? settings[name] : defaultValue;
+ };
</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 boolToItemsArray = function (value, defaultValue) {
- return value === false ? [] : defaultValue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var splitNoEmpty = function (str, delim) {
+ return str.split(delim).filter(function (item) {
+ return item.length > 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">- if ($_e4npq318ajjgwejzo.isArray(value)) {
- return value;
- } else if ($_e4npq318ajjgwejzo.isString(value)) {
- return stringToItemsArray(value);
- } else if ($_e4npq318ajjgwejzo.isBoolean(value)) {
- return boolToItemsArray(value, defaultValue);
- }
- return defaultValue;
- };
- var getToolbarItemsOr = function (predicate) {
- return function (editor, name, defaultValue) {
- var value = name in editor.settings ? editor.settings[name] : defaultValue;
- validDefaultOrDie(defaultValue, predicate);
- return itemsToArray(value, defaultValue);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var itemsToArray = function (value, defaultValue) {
+ var stringToItemsArray = function (value) {
+ return typeof value === 'string' ? splitNoEmpty(value, /[ ,]/) : value;
+ };
+ var boolToItemsArray = function (value, defaultValue) {
+ return value === false ? [] : defaultValue;
+ };
+ if (Type.isArray(value)) {
+ return value;
+ } else if (Type.isString(value)) {
+ return stringToItemsArray(value);
+ } else if (Type.isBoolean(value)) {
+ return boolToItemsArray(value, defaultValue);
+ }
+ return defaultValue;
</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 $_c8umh189jjgwejzm = {
- getStringOr: getByTypeOr($_e4npq318ajjgwejzo.isString),
- getBoolOr: getByTypeOr($_e4npq318ajjgwejzo.isBoolean),
- getNumberOr: getByTypeOr($_e4npq318ajjgwejzo.isNumber),
- getHandlerOr: getByTypeOr($_e4npq318ajjgwejzo.isFunction),
- getToolbarItemsOr: getToolbarItemsOr($_e4npq318ajjgwejzo.isArray)
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getToolbarItemsOr = function (predicate) {
+ return function (editor, name, defaultValue) {
+ var value = name in editor.settings ? editor.settings[name] : defaultValue;
+ validDefaultOrDie(defaultValue, predicate);
+ return itemsToArray(value, defaultValue);
+ };
+ };
+ var EditorSettings = {
+ getStringOr: getByTypeOr(Type.isString),
+ getBoolOr: getByTypeOr(Type.isBoolean),
+ getNumberOr: getByTypeOr(Type.isNumber),
+ getHandlerOr: getByTypeOr(Type.isFunction),
+ getToolbarItemsOr: getToolbarItemsOr(Type.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">- var global$6 = tinymce.util.Tools.resolve('tinymce.geom.Rect');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$6 = tinymce.util.Tools.resolve('tinymce.geom.Rect');
</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 result$1 = function (rect, position) {
- return {
- rect: rect,
- position: position
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var result$1 = function (rect, position) {
+ return {
+ rect: rect,
+ position: position
+ };
</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 moveTo = function (rect, toRect) {
- return {
- x: toRect.x,
- y: toRect.y,
- w: rect.w,
- h: rect.h
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var moveTo = function (rect, toRect) {
+ return {
+ x: toRect.x,
+ y: toRect.y,
+ w: rect.w,
+ h: rect.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">- };
- var calcByPositions = function (testPositions1, testPositions2, targetRect, contentAreaRect, panelRect) {
- var relPos, relRect, outputPanelRect;
- var paddedContentRect = {
- x: contentAreaRect.x,
- y: contentAreaRect.y,
- w: contentAreaRect.w + (contentAreaRect.w < panelRect.w + targetRect.w ? panelRect.w : 0),
- h: contentAreaRect.h + (contentAreaRect.h < panelRect.h + targetRect.h ? panelRect.h : 0)
- };
- relPos = global$6.findBestRelativePosition(panelRect, targetRect, paddedContentRect, testPositions1);
- targetRect = global$6.clamp(targetRect, paddedContentRect);
- if (relPos) {
- relRect = global$6.relativePosition(panelRect, targetRect, relPos);
- outputPanelRect = moveTo(panelRect, relRect);
- return result$1(outputPanelRect, relPos);
- }
- targetRect = global$6.intersect(paddedContentRect, targetRect);
- if (targetRect) {
- relPos = global$6.findBestRelativePosition(panelRect, targetRect, paddedContentRect, testPositions2);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var calcByPositions = function (testPositions1, testPositions2, targetRect, contentAreaRect, panelRect) {
+ var relPos, relRect, outputPanelRect;
+ var paddedContentRect = {
+ x: contentAreaRect.x,
+ y: contentAreaRect.y,
+ w: contentAreaRect.w + (contentAreaRect.w < panelRect.w + targetRect.w ? panelRect.w : 0),
+ h: contentAreaRect.h + (contentAreaRect.h < panelRect.h + targetRect.h ? panelRect.h : 0)
+ };
+ relPos = global$6.findBestRelativePosition(panelRect, targetRect, paddedContentRect, testPositions1);
+ targetRect = global$6.clamp(targetRect, paddedContentRect);
</ins><span class="cx" style="display: block; padding: 0 10px"> if (relPos) {
</span><span class="cx" style="display: block; padding: 0 10px"> relRect = global$6.relativePosition(panelRect, targetRect, relPos);
</span><span class="cx" style="display: block; padding: 0 10px"> outputPanelRect = moveTo(panelRect, relRect);
</span><span class="cx" style="display: block; padding: 0 10px"> return result$1(outputPanelRect, relPos);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- outputPanelRect = moveTo(panelRect, targetRect);
- return result$1(outputPanelRect, relPos);
- }
- return null;
- };
- var calcInsert = function (targetRect, contentAreaRect, panelRect) {
- return calcByPositions([
- 'cr-cl',
- 'cl-cr'
- ], [
- 'bc-tc',
- 'bl-tl',
- 'br-tr'
- ], targetRect, contentAreaRect, panelRect);
- };
- var calc = function (targetRect, contentAreaRect, panelRect) {
- return calcByPositions([
- 'tc-bc',
- 'bc-tc',
- 'tl-bl',
- 'bl-tl',
- 'tr-br',
- 'br-tr',
- 'cr-cl',
- 'cl-cr'
- ], [
- 'bc-tc',
- 'bl-tl',
- 'br-tr',
- 'cr-cl'
- ], targetRect, contentAreaRect, panelRect);
- };
- var userConstrain = function (handler, targetRect, contentAreaRect, panelRect) {
- var userConstrainedPanelRect;
- if (typeof handler === 'function') {
- userConstrainedPanelRect = handler({
- elementRect: $_1x174x181jjgwejzd.toClientRect(targetRect),
- contentAreaRect: $_1x174x181jjgwejzd.toClientRect(contentAreaRect),
- panelRect: $_1x174x181jjgwejzd.toClientRect(panelRect)
- });
- return $_1x174x181jjgwejzd.fromClientRect(userConstrainedPanelRect);
- }
- return panelRect;
- };
- var defaultHandler = function (rects) {
- return rects.panelRect;
- };
- var $_gir42l18bjjgwejzq = {
- calcInsert: calcInsert,
- calc: calc,
- userConstrain: userConstrain,
- defaultHandler: defaultHandler
- };
-
- var toAbsoluteUrl = function (editor, url) {
- return editor.documentBaseURI.toAbsolute(url);
- };
- var urlFromName = function (name) {
- var prefix = global$5.baseURL + '/skins/';
- return name ? prefix + name : prefix + 'lightgray';
- };
- var getTextSelectionToolbarItems = function (editor) {
- return $_c8umh189jjgwejzm.getToolbarItemsOr(editor, 'selection_toolbar', [
- 'bold',
- 'italic',
- '|',
- 'quicklink',
- 'h2',
- 'h3',
- 'blockquote'
- ]);
- };
- var getInsertToolbarItems = function (editor) {
- return $_c8umh189jjgwejzm.getToolbarItemsOr(editor, 'insert_toolbar', [
- 'quickimage',
- 'quicktable'
- ]);
- };
- var getPositionHandler = function (editor) {
- return $_c8umh189jjgwejzm.getHandlerOr(editor, 'inline_toolbar_position_handler', $_gir42l18bjjgwejzq.defaultHandler);
- };
- var getSkinUrl = function (editor) {
- var settings = editor.settings;
- return settings.skin_url ? toAbsoluteUrl(editor, settings.skin_url) : urlFromName(settings.skin);
- };
- var isSkinDisabled = function (editor) {
- return editor.settings.skin === false;
- };
- var $_4j2h42187jjgwejzk = {
- getTextSelectionToolbarItems: getTextSelectionToolbarItems,
- getInsertToolbarItems: getInsertToolbarItems,
- getPositionHandler: getPositionHandler,
- getSkinUrl: getSkinUrl,
- isSkinDisabled: isSkinDisabled
- };
-
- var fireSkinLoaded$1 = function (editor, callback) {
- var done = function () {
- editor._skinLoaded = true;
- $_77u64d186jjgwejzi.fireSkinLoaded(editor);
- callback();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ targetRect = global$6.intersect(paddedContentRect, targetRect);
+ if (targetRect) {
+ relPos = global$6.findBestRelativePosition(panelRect, targetRect, paddedContentRect, testPositions2);
+ if (relPos) {
+ relRect = global$6.relativePosition(panelRect, targetRect, relPos);
+ outputPanelRect = moveTo(panelRect, relRect);
+ return result$1(outputPanelRect, relPos);
+ }
+ outputPanelRect = moveTo(panelRect, targetRect);
+ return result$1(outputPanelRect, relPos);
+ }
+ return 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.initialized) {
- done();
- } else {
- editor.on('init', done);
- }
- };
- var load = function (editor, callback) {
- var skinUrl = $_4j2h42187jjgwejzk.getSkinUrl(editor);
- var done = function () {
- fireSkinLoaded$1(editor, callback);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var calcInsert = function (targetRect, contentAreaRect, panelRect) {
+ return calcByPositions([
+ 'cr-cl',
+ 'cl-cr'
+ ], [
+ 'bc-tc',
+ 'bl-tl',
+ 'br-tr'
+ ], targetRect, contentAreaRect, panelRect);
</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 ($_4j2h42187jjgwejzk.isSkinDisabled(editor)) {
- done();
- } else {
- global$2.DOM.styleSheetLoader.load(skinUrl + '/skin.min.css', done);
- editor.contentCSS.push(skinUrl + '/content.inline.min.css');
- }
- };
- var $_93v08q185jjgwejzh = { load: load };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var calc = function (targetRect, contentAreaRect, panelRect) {
+ return calcByPositions([
+ 'tc-bc',
+ 'bc-tc',
+ 'tl-bl',
+ 'bl-tl',
+ 'tr-br',
+ 'br-tr',
+ 'cr-cl',
+ 'cl-cr'
+ ], [
+ 'bc-tc',
+ 'bl-tl',
+ 'br-tr',
+ 'cr-cl'
+ ], targetRect, contentAreaRect, panelRect);
+ };
+ var userConstrain = function (handler, targetRect, contentAreaRect, panelRect) {
+ var userConstrainedPanelRect;
+ if (typeof handler === 'function') {
+ userConstrainedPanelRect = handler({
+ elementRect: Convert.toClientRect(targetRect),
+ contentAreaRect: Convert.toClientRect(contentAreaRect),
+ panelRect: Convert.toClientRect(panelRect)
+ });
+ return Convert.fromClientRect(userConstrainedPanelRect);
+ }
+ return panelRect;
+ };
+ var defaultHandler = function (rects) {
+ return rects.panelRect;
+ };
+ var Layout = {
+ calcInsert: calcInsert,
+ calc: calc,
+ userConstrain: userConstrain,
+ defaultHandler: defaultHandler
+ };
</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 getSelectionElements = function (editor) {
- var node = editor.selection.getNode();
- var elms = editor.dom.getParents(node, '*');
- return elms;
- };
- var createToolbar = function (editor, selector, id, items) {
- var selectorPredicate = function (elm) {
- return editor.dom.is(elm, selector);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var toAbsoluteUrl = function (editor, url) {
+ return editor.documentBaseURI.toAbsolute(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">- return {
- predicate: selectorPredicate,
- id: id,
- items: items
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var urlFromName = function (name) {
+ var prefix = global$5.baseURL + '/skins/';
+ return name ? prefix + name : prefix + 'lightgray';
</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 getToolbars = function (editor) {
- var contextToolbars = editor.contextToolbars;
- return $_ccn98l17xjjgwejz7.flatten([
- contextToolbars ? contextToolbars : [],
- createToolbar(editor, 'img', 'image', 'alignleft aligncenter alignright')
- ]);
- };
- var findMatchResult = function (editor, toolbars) {
- var result, elements, contextToolbarsPredicateIds;
- elements = getSelectionElements(editor);
- contextToolbarsPredicateIds = $_9rj8kx182jjgwejze.fromContextToolbars(toolbars);
- result = $_6lg87517zjjgwejza.match(editor, [
- $_egsucq17yjjgwejz9.element(elements[0], contextToolbarsPredicateIds),
- $_fhwgeg184jjgwejzf.textSelection('text'),
- $_fhwgeg184jjgwejzf.emptyTextBlock(elements, 'insert'),
- $_egsucq17yjjgwejz9.parent(elements, contextToolbarsPredicateIds)
- ]);
- return result && result.rect ? result : null;
- };
- var editorHasFocus = function (editor) {
- return document.activeElement === editor.getBody();
- };
- var togglePanel = function (editor, panel) {
- var toggle = function () {
- var toolbars = getToolbars(editor);
- var result = findMatchResult(editor, toolbars);
- if (result) {
- panel.show(editor, result.id, result.rect, toolbars);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getTextSelectionToolbarItems = function (editor) {
+ return EditorSettings.getToolbarItemsOr(editor, 'selection_toolbar', [
+ 'bold',
+ 'italic',
+ '|',
+ 'quicklink',
+ 'h2',
+ 'h3',
+ 'blockquote'
+ ]);
+ };
+ var getInsertToolbarItems = function (editor) {
+ return EditorSettings.getToolbarItemsOr(editor, 'insert_toolbar', [
+ 'quickimage',
+ 'quicktable'
+ ]);
+ };
+ var getPositionHandler = function (editor) {
+ return EditorSettings.getHandlerOr(editor, 'inline_toolbar_position_handler', Layout.defaultHandler);
+ };
+ var getSkinUrl = function (editor) {
+ var settings = editor.settings;
+ return settings.skin_url ? toAbsoluteUrl(editor, settings.skin_url) : urlFromName(settings.skin);
+ };
+ var isSkinDisabled = function (editor) {
+ return editor.settings.skin === false;
+ };
+ var Settings = {
+ getTextSelectionToolbarItems: getTextSelectionToolbarItems,
+ getInsertToolbarItems: getInsertToolbarItems,
+ getPositionHandler: getPositionHandler,
+ getSkinUrl: getSkinUrl,
+ isSkinDisabled: isSkinDisabled
+ };
+
+ var fireSkinLoaded$1 = function (editor, callback) {
+ var done = function () {
+ editor._skinLoaded = true;
+ Events.fireSkinLoaded(editor);
+ callback();
+ };
+ if (editor.initialized) {
+ done();
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- panel.hide();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('init', done);
</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">- return function () {
- if (!editor.removed && editorHasFocus(editor)) {
- toggle();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var load = function (editor, callback) {
+ var skinUrl = Settings.getSkinUrl(editor);
+ var done = function () {
+ fireSkinLoaded$1(editor, callback);
+ };
+ if (Settings.isSkinDisabled(editor)) {
+ done();
+ } else {
+ global$2.DOM.styleSheetLoader.load(skinUrl + '/skin.min.css', done);
+ editor.contentCSS.push(skinUrl + '/content.inline.min.css');
</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">- };
- var repositionPanel = function (editor, panel) {
- return function () {
- var toolbars = getToolbars(editor);
- var result = findMatchResult(editor, toolbars);
- if (result) {
- panel.reposition(editor, result.id, result.rect);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var SkinLoader = { load: load };
+
+ var getSelectionElements = function (editor) {
+ var node = editor.selection.getNode();
+ var elms = editor.dom.getParents(node, '*');
+ return elms;
</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 ignoreWhenFormIsVisible = function (editor, panel, f) {
- return function () {
- if (!editor.removed && !panel.inForm()) {
- f();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createToolbar = function (editor, selector, id, items) {
+ var selectorPredicate = function (elm) {
+ return editor.dom.is(elm, selector);
+ };
+ return {
+ predicate: selectorPredicate,
+ id: id,
+ items: items
+ };
</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 bindContextualToolbarsEvents = function (editor, panel) {
- var throttledTogglePanel = global$3.throttle(togglePanel(editor, panel), 0);
- var throttledTogglePanelWhenNotInForm = global$3.throttle(ignoreWhenFormIsVisible(editor, panel, togglePanel(editor, panel)), 0);
- var reposition = repositionPanel(editor, panel);
- editor.on('blur hide ObjectResizeStart', panel.hide);
- editor.on('click', throttledTogglePanel);
- editor.on('nodeChange mouseup', throttledTogglePanelWhenNotInForm);
- editor.on('ResizeEditor keyup', throttledTogglePanel);
- editor.on('ResizeWindow', reposition);
- global$2.DOM.bind(global$1.container, 'scroll', reposition);
- editor.on('remove', function () {
- global$2.DOM.unbind(global$1.container, 'scroll', reposition);
- panel.remove();
- });
- editor.shortcuts.add('Alt+F10,F10', '', panel.focus);
- };
- var overrideLinkShortcut = function (editor, panel) {
- editor.shortcuts.remove('meta+k');
- editor.shortcuts.add('meta+k', '', function () {
- var toolbars = getToolbars(editor);
- var result = $_6lg87517zjjgwejza.match(editor, [$_fhwgeg184jjgwejzf.textSelection('quicklink')]);
- if (result) {
- panel.show(editor, result.id, result.rect, toolbars);
- }
- });
- };
- var renderInlineUI = function (editor, panel) {
- $_93v08q185jjgwejzh.load(editor, function () {
- bindContextualToolbarsEvents(editor, panel);
- overrideLinkShortcut(editor, panel);
- });
- return {};
- };
- var fail = function (message) {
- throw new Error(message);
- };
- var renderUI = function (editor, panel) {
- return editor.inline ? renderInlineUI(editor, panel) : fail('inlite theme only supports inline mode.');
- };
- var $_b0wxh217tjjgwejyx = { renderUI: renderUI };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getToolbars = function (editor) {
+ var contextToolbars = editor.contextToolbars;
+ return DeepFlatten.flatten([
+ contextToolbars ? contextToolbars : [],
+ createToolbar(editor, 'img', 'image', 'alignleft aligncenter alignright')
+ ]);
+ };
+ var findMatchResult = function (editor, toolbars) {
+ var result, elements, contextToolbarsPredicateIds;
+ elements = getSelectionElements(editor);
+ contextToolbarsPredicateIds = PredicateId.fromContextToolbars(toolbars);
+ result = Matcher.match(editor, [
+ ElementMatcher.element(elements[0], contextToolbarsPredicateIds),
+ SelectionMatcher.textSelection('text'),
+ SelectionMatcher.emptyTextBlock(elements, 'insert'),
+ ElementMatcher.parent(elements, contextToolbarsPredicateIds)
+ ]);
+ return result && result.rect ? result : null;
+ };
+ var editorHasFocus = function (editor) {
+ return document.activeElement === editor.getBody();
+ };
+ var togglePanel = function (editor, panel) {
+ var toggle = function () {
+ var toolbars = getToolbars(editor);
+ var result = findMatchResult(editor, toolbars);
+ if (result) {
+ panel.show(editor, result.id, result.rect, toolbars);
+ } else {
+ panel.hide();
+ }
+ };
+ return function () {
+ if (!editor.removed && editorHasFocus(editor)) {
+ toggle();
+ }
+ };
+ };
+ var repositionPanel = function (editor, panel) {
+ return function () {
+ var toolbars = getToolbars(editor);
+ var result = findMatchResult(editor, toolbars);
+ if (result) {
+ panel.reposition(editor, result.id, result.rect);
+ }
+ };
+ };
+ var ignoreWhenFormIsVisible = function (editor, panel, f) {
+ return function () {
+ if (!editor.removed && !panel.inForm()) {
+ f();
+ }
+ };
+ };
+ var bindContextualToolbarsEvents = function (editor, panel) {
+ var throttledTogglePanel = global$3.throttle(togglePanel(editor, panel), 0);
+ var throttledTogglePanelWhenNotInForm = global$3.throttle(ignoreWhenFormIsVisible(editor, panel, togglePanel(editor, panel)), 0);
+ var reposition = repositionPanel(editor, panel);
+ editor.on('blur hide ObjectResizeStart', panel.hide);
+ editor.on('click', throttledTogglePanel);
+ editor.on('nodeChange mouseup', throttledTogglePanelWhenNotInForm);
+ editor.on('ResizeEditor keyup', throttledTogglePanel);
+ editor.on('ResizeWindow', reposition);
+ global$2.DOM.bind(global$1.container, 'scroll', reposition);
+ editor.on('remove', function () {
+ global$2.DOM.unbind(global$1.container, 'scroll', reposition);
+ panel.remove();
+ });
+ editor.shortcuts.add('Alt+F10,F10', '', panel.focus);
+ };
+ var overrideLinkShortcut = function (editor, panel) {
+ editor.shortcuts.remove('meta+k');
+ editor.shortcuts.add('meta+k', '', function () {
+ var toolbars = getToolbars(editor);
+ var result = Matcher.match(editor, [SelectionMatcher.textSelection('quicklink')]);
+ if (result) {
+ panel.show(editor, result.id, result.rect, toolbars);
+ }
+ });
+ };
+ var renderInlineUI = function (editor, panel) {
+ SkinLoader.load(editor, function () {
+ bindContextualToolbarsEvents(editor, panel);
+ overrideLinkShortcut(editor, panel);
+ });
+ return {};
+ };
+ var fail = function (message) {
+ throw new Error(message);
+ };
+ var renderUI = function (editor, panel) {
+ return editor.inline ? renderInlineUI(editor, panel) : fail('inlite theme only supports inline mode.');
+ };
+ var Render = { renderUI: renderUI };
</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 noop = function () {
- var x = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- x[_i] = arguments[_i];
- }
- };
-
- var compose = function (fa, fb) {
- return function () {
- var x = [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var noop = function () {
+ var args = [];
</ins><span class="cx" style="display: block; padding: 0 10px"> for (var _i = 0; _i < arguments.length; _i++) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- x[_i] = arguments[_i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ args[_i] = arguments[_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">- return fa(fb.apply(null, arguments));
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var constant = function (value) {
- return function () {
- return value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var constant = function (value) {
+ return function () {
+ 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">- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var never = constant(false);
+ var always = constant(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">+ var never$1 = never;
+ var always$1 = always;
+ var none = function () {
+ return NONE;
+ };
+ var NONE = function () {
+ var eq = function (o) {
+ return o.isNone();
+ };
+ var call$$1 = function (thunk) {
+ return thunk();
+ };
+ var id = function (n) {
+ return n;
+ };
+ var noop$$1 = function () {
+ };
+ var nul = function () {
+ return null;
+ };
+ var undef = function () {
+ return undefined;
+ };
+ var me = {
+ fold: function (n, s) {
+ return n();
+ },
+ is: never$1,
+ isSome: never$1,
+ isNone: always$1,
+ getOr: id,
+ getOrThunk: call$$1,
+ getOrDie: function (msg) {
+ throw new Error(msg || 'error: getOrDie called on none.');
+ },
+ getOrNull: nul,
+ getOrUndefined: undef,
+ or: id,
+ orThunk: call$$1,
+ map: none,
+ ap: none,
+ each: noop$$1,
+ bind: none,
+ flatten: none,
+ exists: never$1,
+ forall: always$1,
+ filter: none,
+ equals: eq,
+ equals_: eq,
+ toArray: function () {
+ return [];
+ },
+ toString: constant('none()')
+ };
+ if (Object.freeze)
+ Object.freeze(me);
+ return me;
+ }();
+ var some = function (a) {
+ var constant_a = function () {
+ return a;
+ };
+ var self = function () {
+ return me;
+ };
+ var map = function (f) {
+ return some(f(a));
+ };
+ var bind = function (f) {
+ return f(a);
+ };
+ var me = {
+ fold: function (n, s) {
+ return s(a);
+ },
+ is: function (v) {
+ return a === v;
+ },
+ isSome: always$1,
+ isNone: never$1,
+ getOr: constant_a,
+ getOrThunk: constant_a,
+ getOrDie: constant_a,
+ getOrNull: constant_a,
+ getOrUndefined: constant_a,
+ or: self,
+ orThunk: self,
+ map: map,
+ ap: function (optfab) {
+ return optfab.fold(none, function (fab) {
+ return some(fab(a));
+ });
+ },
+ each: function (f) {
+ f(a);
+ },
+ bind: bind,
+ flatten: constant_a,
+ exists: bind,
+ forall: bind,
+ filter: function (f) {
+ return f(a) ? me : NONE;
+ },
+ equals: function (o) {
+ return o.is(a);
+ },
+ equals_: function (o, elementEq) {
+ return o.fold(never$1, function (b) {
+ return elementEq(a, b);
+ });
+ },
+ toArray: function () {
+ return [a];
+ },
+ toString: function () {
+ return 'some(' + a + ')';
+ }
+ };
+ return me;
+ };
+ var from = function (value) {
+ return value === null || value === undefined ? NONE : some(value);
+ };
+ var Option = {
+ some: some,
+ none: none,
+ from: from
+ };
</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 curry = function (f) {
- var x = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- x[_i - 1] = arguments[_i];
- }
- var args = new Array(arguments.length - 1);
- for (var i = 1; i < arguments.length; i++)
- args[i - 1] = arguments[i];
- return function () {
- var x = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- x[_i] = arguments[_i];
- }
- var newArgs = new Array(arguments.length);
- for (var j = 0; j < newArgs.length; j++)
- newArgs[j] = arguments[j];
- var all = args.concat(newArgs);
- return f.apply(null, all);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var typeOf = function (x) {
+ if (x === null)
+ return 'null';
+ var t = typeof x;
+ if (t === 'object' && Array.prototype.isPrototypeOf(x))
+ return 'array';
+ if (t === 'object' && String.prototype.isPrototypeOf(x))
+ return 'string';
+ return t;
</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">+ var isType$1 = function (type) {
+ return function (value) {
+ return typeOf(value) === type;
+ };
+ };
+ var isFunction$1 = isType$1('function');
+ var isNumber$1 = isType$1('number');
</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 never = constant(false);
- var always = constant(true);
-
- var never$1 = never;
- var always$1 = always;
- var none = function () {
- return NONE;
- };
- var NONE = function () {
- var eq = function (o) {
- return o.isNone();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var rawIndexOf = function () {
+ var pIndexOf = Array.prototype.indexOf;
+ var fastIndex = function (xs, x) {
+ return pIndexOf.call(xs, x);
+ };
+ var slowIndex = function (xs, x) {
+ return slowIndexOf(xs, x);
+ };
+ return pIndexOf === undefined ? slowIndex : fastIndex;
+ }();
+ var indexOf = function (xs, x) {
+ var r = rawIndexOf(xs, x);
+ return r === -1 ? Option.none() : Option.some(r);
</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 call$$1 = function (thunk) {
- return thunk();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var exists = function (xs, pred) {
+ return findIndex(xs, pred).isSome();
</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 id = function (n) {
- return n;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var map = function (xs, f) {
+ var len = xs.length;
+ var r = new Array(len);
+ for (var i = 0; i < len; i++) {
+ var x = xs[i];
+ r[i] = f(x, i, xs);
+ }
+ return r;
</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 noop$$1 = function () {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var each = function (xs, f) {
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ f(x, i, xs);
+ }
</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 nul = function () {
- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var filter = function (xs, pred) {
+ var r = [];
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ if (pred(x, i, xs)) {
+ r.push(x);
+ }
+ }
+ return r;
</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 undef = function () {
- return undefined;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var foldl = function (xs, f, acc) {
+ each(xs, function (x) {
+ acc = f(acc, x);
+ });
+ return acc;
</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 me = {
- fold: function (n, s) {
- return n();
- },
- is: never$1,
- isSome: never$1,
- isNone: always$1,
- getOr: id,
- getOrThunk: call$$1,
- getOrDie: function (msg) {
- throw new Error(msg || 'error: getOrDie called on none.');
- },
- getOrNull: nul,
- getOrUndefined: undef,
- or: id,
- orThunk: call$$1,
- map: none,
- ap: none,
- each: noop$$1,
- bind: none,
- flatten: none,
- exists: never$1,
- forall: always$1,
- filter: none,
- equals: eq,
- equals_: eq,
- toArray: function () {
- return [];
- },
- toString: constant('none()')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var find = function (xs, pred) {
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ if (pred(x, i, xs)) {
+ return Option.some(x);
+ }
+ }
+ return Option.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">- if (Object.freeze)
- Object.freeze(me);
- return me;
- }();
- var some = function (a) {
- var constant_a = function () {
- return a;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var findIndex = function (xs, pred) {
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ if (pred(x, i, xs)) {
+ return Option.some(i);
+ }
+ }
+ return Option.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 self = function () {
- return me;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var slowIndexOf = function (xs, x) {
+ for (var i = 0, len = xs.length; i < len; ++i) {
+ if (xs[i] === x) {
+ return i;
+ }
+ }
+ 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">- var map = function (f) {
- return some(f(a));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var push = Array.prototype.push;
+ var flatten$1 = function (xs) {
+ var r = [];
+ for (var i = 0, len = xs.length; i < len; ++i) {
+ if (!Array.prototype.isPrototypeOf(xs[i]))
+ throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
+ push.apply(r, xs[i]);
+ }
+ return r;
</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 bind = function (f) {
- return f(a);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var slice = Array.prototype.slice;
+ var from$1 = isFunction$1(Array.from) ? Array.from : function (x) {
+ return slice.call(x);
</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 me = {
- fold: function (n, s) {
- return s(a);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var count = 0;
+ var funcs = {
+ id: function () {
+ return 'mceu_' + count++;
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- is: function (v) {
- return a === v;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ create: function (name$$1, attrs, children) {
+ var elm = document.createElement(name$$1);
+ global$2.DOM.setAttribs(elm, attrs);
+ if (typeof children === 'string') {
+ elm.innerHTML = children;
+ } else {
+ global$4.each(children, function (child) {
+ if (child.nodeType) {
+ elm.appendChild(child);
+ }
+ });
+ }
+ 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">- isSome: always$1,
- isNone: never$1,
- getOr: constant_a,
- getOrThunk: constant_a,
- getOrDie: constant_a,
- getOrNull: constant_a,
- getOrUndefined: constant_a,
- or: self,
- orThunk: self,
- map: map,
- ap: function (optfab) {
- return optfab.fold(none, function (fab) {
- return some(fab(a));
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ createFragment: function (html) {
+ return global$2.DOM.createFragment(html);
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- each: function (f) {
- f(a);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ getWindowSize: function () {
+ return global$2.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">- bind: bind,
- flatten: constant_a,
- exists: bind,
- forall: bind,
- filter: function (f) {
- return f(a) ? me : NONE;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ getSize: function (elm) {
+ var width, height;
+ if (elm.getBoundingClientRect) {
+ var rect = elm.getBoundingClientRect();
+ width = Math.max(rect.width || rect.right - rect.left, elm.offsetWidth);
+ height = Math.max(rect.height || rect.bottom - rect.bottom, elm.offsetHeight);
+ } else {
+ width = elm.offsetWidth;
+ height = elm.offsetHeight;
+ }
+ return {
+ width: width,
+ height: height
+ };
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- equals: function (o) {
- return o.is(a);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ getPos: function (elm, root) {
+ return global$2.DOM.getPos(elm, root || funcs.getContainer());
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- equals_: function (o, elementEq) {
- return o.fold(never$1, function (b) {
- return elementEq(a, b);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ getContainer: function () {
+ return global$1.container ? global$1.container : document.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">- toArray: function () {
- return [a];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ getViewPort: function (win) {
+ return global$2.DOM.getViewPort(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">- toString: function () {
- return 'some(' + a + ')';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ get: function (id) {
+ return document.getElementById(id);
+ },
+ addClass: function (elm, cls) {
+ return global$2.DOM.addClass(elm, cls);
+ },
+ removeClass: function (elm, cls) {
+ return global$2.DOM.removeClass(elm, cls);
+ },
+ hasClass: function (elm, cls) {
+ return global$2.DOM.hasClass(elm, cls);
+ },
+ toggleClass: function (elm, cls, state) {
+ return global$2.DOM.toggleClass(elm, cls, state);
+ },
+ css: function (elm, name$$1, value) {
+ return global$2.DOM.setStyle(elm, name$$1, value);
+ },
+ getRuntimeStyle: function (elm, name$$1) {
+ return global$2.DOM.getStyle(elm, name$$1, true);
+ },
+ on: function (target, name$$1, callback, scope) {
+ return global$2.DOM.bind(target, name$$1, callback, scope);
+ },
+ off: function (target, name$$1, callback) {
+ return global$2.DOM.unbind(target, name$$1, callback);
+ },
+ fire: function (target, name$$1, args) {
+ return global$2.DOM.fire(target, name$$1, args);
+ },
+ innerHtml: function (elm, html) {
+ global$2.DOM.setHTML(elm, html);
</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">- return me;
- };
- var from = function (value) {
- return value === null || value === undefined ? NONE : some(value);
- };
- var Option = {
- some: some,
- none: none,
- from: from
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var typeOf = function (x) {
- if (x === null)
- return 'null';
- var t = typeof x;
- if (t === 'object' && Array.prototype.isPrototypeOf(x))
- return 'array';
- if (t === 'object' && String.prototype.isPrototypeOf(x))
- return 'string';
- return t;
- };
- var isType$1 = function (type) {
- return function (value) {
- return typeOf(value) === type;
- };
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$7 = tinymce.util.Tools.resolve('tinymce.dom.DomQuery');
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$8 = tinymce.util.Tools.resolve('tinymce.util.Class');
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$9 = tinymce.util.Tools.resolve('tinymce.util.EventDispatcher');
</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 isFunction$1 = isType$1('function');
- var isNumber$1 = isType$1('number');
-
- var rawIndexOf = function () {
- var pIndexOf = Array.prototype.indexOf;
- var fastIndex = function (xs, x) {
- return pIndexOf.call(xs, x);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var BoxUtils = {
+ parseBox: function (value) {
+ var len;
+ var radix = 10;
+ if (!value) {
+ return;
+ }
+ if (typeof value === 'number') {
+ value = value || 0;
+ return {
+ top: value,
+ left: value,
+ bottom: value,
+ right: value
+ };
+ }
+ value = value.split(' ');
+ len = value.length;
+ if (len === 1) {
+ value[1] = value[2] = value[3] = value[0];
+ } else if (len === 2) {
+ value[2] = value[0];
+ value[3] = value[1];
+ } else if (len === 3) {
+ value[3] = value[1];
+ }
+ return {
+ top: parseInt(value[0], radix) || 0,
+ right: parseInt(value[1], radix) || 0,
+ bottom: parseInt(value[2], radix) || 0,
+ left: parseInt(value[3], radix) || 0
+ };
+ },
+ measureBox: function (elm, prefix) {
+ function getStyle(name) {
+ var defaultView = elm.ownerDocument.defaultView;
+ if (defaultView) {
+ var computedStyle = defaultView.getComputedStyle(elm, null);
+ if (computedStyle) {
+ name = name.replace(/[A-Z]/g, function (a) {
+ return '-' + a;
+ });
+ return computedStyle.getPropertyValue(name);
+ } else {
+ return null;
+ }
+ }
+ return elm.currentStyle[name];
+ }
+ function getSide(name) {
+ var val = parseFloat(getStyle(name));
+ return isNaN(val) ? 0 : val;
+ }
+ return {
+ top: getSide(prefix + 'TopWidth'),
+ right: getSide(prefix + 'RightWidth'),
+ bottom: getSide(prefix + 'BottomWidth'),
+ left: getSide(prefix + 'LeftWidth')
+ };
+ }
</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 slowIndex = function (xs, x) {
- return slowIndexOf(xs, x);
- };
- return pIndexOf === undefined ? slowIndex : fastIndex;
- }();
- var indexOf = function (xs, x) {
- var r = rawIndexOf(xs, x);
- return r === -1 ? Option.none() : Option.some(r);
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var exists = function (xs, pred) {
- return findIndex(xs, pred).isSome();
- };
-
-
- var map = function (xs, f) {
- var len = xs.length;
- var r = new Array(len);
- for (var i = 0; i < len; i++) {
- var x = xs[i];
- r[i] = f(x, i, xs);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function noop$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 r;
- };
- var each = function (xs, f) {
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- f(x, i, xs);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function ClassList(onchange) {
+ this.cls = [];
+ this.cls._map = {};
+ this.onchange = onchange || noop$1;
+ this.prefix = '';
</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 filter = function (xs, pred) {
- var r = [];
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- if (pred(x, i, xs)) {
- r.push(x);
- }
- }
- return r;
- };
-
-
- var foldl = function (xs, f, acc) {
- each(xs, function (x) {
- acc = f(acc, x);
- });
- return acc;
- };
- var find = function (xs, pred) {
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- if (pred(x, i, xs)) {
- return Option.some(x);
- }
- }
- return Option.none();
- };
- var findIndex = function (xs, pred) {
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- if (pred(x, i, xs)) {
- return Option.some(i);
- }
- }
- return Option.none();
- };
- var slowIndexOf = function (xs, x) {
- for (var i = 0, len = xs.length; i < len; ++i) {
- if (xs[i] === x) {
- return i;
- }
- }
- return -1;
- };
- var push = Array.prototype.push;
- var flatten$1 = function (xs) {
- var r = [];
- for (var i = 0, len = xs.length; i < len; ++i) {
- if (!Array.prototype.isPrototypeOf(xs[i]))
- throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
- push.apply(r, xs[i]);
- }
- return r;
- };
-
-
-
- var slice = Array.prototype.slice;
- var reverse = function (xs) {
- var r = slice.call(xs, 0);
- r.reverse();
- return r;
- };
-
-
-
-
-
-
- var from$1 = isFunction$1(Array.from) ? Array.from : function (x) {
- return slice.call(x);
- };
-
- var count = 0;
- var funcs = {
- id: function () {
- return 'mceu_' + count++;
- },
- create: function (name$$1, attrs, children) {
- var elm = document.createElement(name$$1);
- global$2.DOM.setAttribs(elm, attrs);
- if (typeof children === 'string') {
- elm.innerHTML = children;
- } else {
- global$4.each(children, function (child) {
- if (child.nodeType) {
- elm.appendChild(child);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global$4.extend(ClassList.prototype, {
+ add: function (cls) {
+ if (cls && !this.contains(cls)) {
+ this.cls._map[cls] = true;
+ this.cls.push(cls);
+ this._change();
+ }
+ return this;
+ },
+ remove: function (cls) {
+ if (this.contains(cls)) {
+ var i = void 0;
+ for (i = 0; i < this.cls.length; i++) {
+ if (this.cls[i] === cls) {
+ 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 elm;
- },
- createFragment: function (html) {
- return global$2.DOM.createFragment(html);
- },
- getWindowSize: function () {
- return global$2.DOM.getViewPort();
- },
- getSize: function (elm) {
- var width, height;
- if (elm.getBoundingClientRect) {
- var rect = elm.getBoundingClientRect();
- width = Math.max(rect.width || rect.right - rect.left, elm.offsetWidth);
- height = Math.max(rect.height || rect.bottom - rect.bottom, elm.offsetHeight);
- } else {
- width = elm.offsetWidth;
- height = elm.offsetHeight;
- }
- return {
- width: width,
- height: height
- };
- },
- getPos: function (elm, root) {
- return global$2.DOM.getPos(elm, root || funcs.getContainer());
- },
- getContainer: function () {
- return global$1.container ? global$1.container : document.body;
- },
- getViewPort: function (win) {
- return global$2.DOM.getViewPort(win);
- },
- get: function (id) {
- return document.getElementById(id);
- },
- addClass: function (elm, cls) {
- return global$2.DOM.addClass(elm, cls);
- },
- removeClass: function (elm, cls) {
- return global$2.DOM.removeClass(elm, cls);
- },
- hasClass: function (elm, cls) {
- return global$2.DOM.hasClass(elm, cls);
- },
- toggleClass: function (elm, cls, state) {
- return global$2.DOM.toggleClass(elm, cls, state);
- },
- css: function (elm, name$$1, value) {
- return global$2.DOM.setStyle(elm, name$$1, value);
- },
- getRuntimeStyle: function (elm, name$$1) {
- return global$2.DOM.getStyle(elm, name$$1, true);
- },
- on: function (target, name$$1, callback, scope) {
- return global$2.DOM.bind(target, name$$1, callback, scope);
- },
- off: function (target, name$$1, callback) {
- return global$2.DOM.unbind(target, name$$1, callback);
- },
- fire: function (target, name$$1, args) {
- return global$2.DOM.fire(target, name$$1, args);
- },
- innerHtml: function (elm, html) {
- global$2.DOM.setHTML(elm, html);
- }
- };
-
- var global$7 = tinymce.util.Tools.resolve('tinymce.dom.DomQuery');
-
- var global$8 = tinymce.util.Tools.resolve('tinymce.util.Class');
-
- var global$9 = tinymce.util.Tools.resolve('tinymce.util.EventDispatcher');
-
- var $_4kbuyt18pjjgwek1w = {
- parseBox: function (value) {
- var len;
- var radix = 10;
- if (!value) {
- return;
- }
- if (typeof value === 'number') {
- value = value || 0;
- return {
- top: value,
- left: value,
- bottom: value,
- right: value
- };
- }
- value = value.split(' ');
- len = value.length;
- if (len === 1) {
- value[1] = value[2] = value[3] = value[0];
- } else if (len === 2) {
- value[2] = value[0];
- value[3] = value[1];
- } else if (len === 3) {
- value[3] = value[1];
- }
- return {
- top: parseInt(value[0], radix) || 0,
- right: parseInt(value[1], radix) || 0,
- bottom: parseInt(value[2], radix) || 0,
- left: parseInt(value[3], radix) || 0
- };
- },
- measureBox: function (elm, prefix) {
- function getStyle(name) {
- var defaultView = elm.ownerDocument.defaultView;
- if (defaultView) {
- var computedStyle = defaultView.getComputedStyle(elm, null);
- if (computedStyle) {
- name = name.replace(/[A-Z]/g, function (a) {
- return '-' + a;
- });
- return computedStyle.getPropertyValue(name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.cls.splice(i, 1);
+ delete this.cls._map[cls];
+ this._change();
+ }
+ return this;
+ },
+ toggle: function (cls, state) {
+ var curState = this.contains(cls);
+ if (curState !== state) {
+ if (curState) {
+ this.remove(cls);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.add(cls);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this._change();
</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 elm.currentStyle[name];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this;
+ },
+ contains: function (cls) {
+ return !!this.cls._map[cls];
+ },
+ _change: function () {
+ delete this.clsValue;
+ this.onchange.call(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">- function getSide(name) {
- var val = parseFloat(getStyle(name));
- return isNaN(val) ? 0 : val;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ ClassList.prototype.toString = function () {
+ var value;
+ if (this.clsValue) {
+ return this.clsValue;
</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 {
- top: getSide(prefix + 'TopWidth'),
- right: getSide(prefix + 'RightWidth'),
- bottom: getSide(prefix + 'BottomWidth'),
- left: getSide(prefix + 'LeftWidth')
- };
- }
- };
-
- function noop$1() {
- }
- function ClassList(onchange) {
- this.cls = [];
- this.cls._map = {};
- this.onchange = onchange || noop$1;
- this.prefix = '';
- }
- global$4.extend(ClassList.prototype, {
- add: function (cls) {
- if (cls && !this.contains(cls)) {
- this.cls._map[cls] = true;
- this.cls.push(cls);
- this._change();
- }
- return this;
- },
- remove: function (cls) {
- if (this.contains(cls)) {
- var i = void 0;
- for (i = 0; i < this.cls.length; i++) {
- if (this.cls[i] === cls) {
- break;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ value = '';
+ for (var i = 0; i < this.cls.length; i++) {
+ if (i > 0) {
+ 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">- this.cls.splice(i, 1);
- delete this.cls._map[cls];
- this._change();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ value += this.prefix + this.cls[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">- return this;
- },
- toggle: function (cls, state) {
- var curState = this.contains(cls);
- if (curState !== state) {
- if (curState) {
- this.remove(cls);
- } else {
- this.add(cls);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return value;
+ };
+
+ function unique(array) {
+ var uniqueItems = [];
+ var i = array.length, item;
+ while (i--) {
+ item = array[i];
+ if (!item.__checked) {
+ uniqueItems.push(item);
+ item.__checked = 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">- this._change();
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return this;
- },
- contains: function (cls) {
- return !!this.cls._map[cls];
- },
- _change: function () {
- delete this.clsValue;
- this.onchange.call(this);
- }
- });
- ClassList.prototype.toString = function () {
- var value;
- if (this.clsValue) {
- return this.clsValue;
- }
- value = '';
- for (var i = 0; i < this.cls.length; i++) {
- if (i > 0) {
- value += ' ';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ i = uniqueItems.length;
+ while (i--) {
+ delete uniqueItems[i].__checked;
</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 += this.prefix + this.cls[i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return uniqueItems;
</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;
- };
-
- function unique(array) {
- var uniqueItems = [];
- var i = array.length, item;
- while (i--) {
- item = array[i];
- if (!item.__checked) {
- uniqueItems.push(item);
- item.__checked = 1;
- }
- }
- i = uniqueItems.length;
- while (i--) {
- delete uniqueItems[i].__checked;
- }
- return uniqueItems;
- }
- var expression = /^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i;
- var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g;
- var whiteSpace = /^\s*|\s*$/g;
- var Collection;
- var Selector = global$8.extend({
- init: function (selector) {
- var match = this.match;
- function compileNameFilter(name) {
- if (name) {
- name = name.toLowerCase();
- return function (item) {
- return name === '*' || item.type === name;
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var expression = /^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i;
+ var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g;
+ var whiteSpace = /^\s*|\s*$/g;
+ var Collection;
+ var Selector = global$8.extend({
+ init: function (selector) {
+ var match = this.match;
+ function compileNameFilter(name) {
+ if (name) {
+ name = name.toLowerCase();
+ return function (item) {
+ return name === '*' || item.type === name;
+ };
+ }
</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 compileIdFilter(id) {
- if (id) {
- return function (item) {
- return item._name === id;
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function compileIdFilter(id) {
+ if (id) {
+ return function (item) {
+ return item._name === id;
+ };
+ }
</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 compileClassesFilter(classes) {
- if (classes) {
- classes = classes.split('.');
- return function (item) {
- var i = classes.length;
- while (i--) {
- if (!item.classes.contains(classes[i])) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function compileClassesFilter(classes) {
+ if (classes) {
+ classes = classes.split('.');
+ return function (item) {
+ var i = classes.length;
+ while (i--) {
+ if (!item.classes.contains(classes[i])) {
+ 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 true;
- };
</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">- }
- function compileAttrFilter(name, cmp, check) {
- if (name) {
- return function (item) {
- var value = item[name] ? item[name]() : '';
- return !cmp ? !!check : cmp === '=' ? value === check : cmp === '*=' ? value.indexOf(check) >= 0 : cmp === '~=' ? (' ' + value + ' ').indexOf(' ' + check + ' ') >= 0 : cmp === '!=' ? value !== check : cmp === '^=' ? value.indexOf(check) === 0 : cmp === '$=' ? value.substr(value.length - check.length) === check : false;
- };
- }
- }
- function compilePsuedoFilter(name) {
- var notSelectors;
- if (name) {
- name = /(?:not\((.+)\))|(.+)/i.exec(name);
- if (!name[1]) {
- name = name[2];
- return function (item, index, length) {
- return name === 'first' ? index === 0 : name === 'last' ? index === length - 1 : name === 'even' ? index % 2 === 0 : name === 'odd' ? index % 2 === 1 : item[name] ? item[name]() : false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function compileAttrFilter(name, cmp, check) {
+ if (name) {
+ return function (item) {
+ var value = item[name] ? item[name]() : '';
+ return !cmp ? !!check : cmp === '=' ? value === check : cmp === '*=' ? value.indexOf(check) >= 0 : cmp === '~=' ? (' ' + value + ' ').indexOf(' ' + check + ' ') >= 0 : cmp === '!=' ? value !== check : cmp === '^=' ? value.indexOf(check) === 0 : cmp === '$=' ? value.substr(value.length - check.length) === check : false;
</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">- notSelectors = parseChunks(name[1], []);
- return function (item) {
- return !match(item, notSelectors);
- };
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- function compile(selector, filters, direct) {
- var parts;
- function add(filter) {
- if (filter) {
- filters.push(filter);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function compilePsuedoFilter(name) {
+ var notSelectors;
+ if (name) {
+ name = /(?:not\((.+)\))|(.+)/i.exec(name);
+ if (!name[1]) {
+ name = name[2];
+ return function (item, index, length) {
+ return name === 'first' ? index === 0 : name === 'last' ? index === length - 1 : name === 'even' ? index % 2 === 0 : name === 'odd' ? index % 2 === 1 : item[name] ? item[name]() : false;
+ };
+ }
+ notSelectors = parseChunks(name[1], []);
+ return function (item) {
+ return !match(item, notSelectors);
+ };
</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">- parts = expression.exec(selector.replace(whiteSpace, ''));
- add(compileNameFilter(parts[1]));
- add(compileIdFilter(parts[2]));
- add(compileClassesFilter(parts[3]));
- add(compileAttrFilter(parts[4], parts[5], parts[6]));
- add(compilePsuedoFilter(parts[7]));
- filters.pseudo = !!parts[7];
- filters.direct = direct;
- return filters;
- }
- function parseChunks(selector, selectors) {
- var parts = [];
- var extra, matches, i;
- do {
- chunker.exec('');
- matches = chunker.exec(selector);
- if (matches) {
- selector = matches[3];
- parts.push(matches[1]);
- if (matches[2]) {
- extra = matches[3];
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function compile(selector, filters, direct) {
+ var parts;
+ function add(filter) {
+ if (filter) {
+ filters.push(filter);
</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">- } while (matches);
- if (extra) {
- parseChunks(extra, selectors);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parts = expression.exec(selector.replace(whiteSpace, ''));
+ add(compileNameFilter(parts[1]));
+ add(compileIdFilter(parts[2]));
+ add(compileClassesFilter(parts[3]));
+ add(compileAttrFilter(parts[4], parts[5], parts[6]));
+ add(compilePsuedoFilter(parts[7]));
+ filters.pseudo = !!parts[7];
+ filters.direct = direct;
+ return filters;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- selector = [];
- for (i = 0; i < parts.length; i++) {
- if (parts[i] !== '>') {
- selector.push(compile(parts[i], [], parts[i - 1] === '>'));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function parseChunks(selector, selectors) {
+ var parts = [];
+ var extra, matches, i;
+ do {
+ chunker.exec('');
+ matches = chunker.exec(selector);
+ if (matches) {
+ selector = matches[3];
+ parts.push(matches[1]);
+ if (matches[2]) {
+ extra = matches[3];
+ break;
+ }
+ }
+ } while (matches);
+ if (extra) {
+ parseChunks(extra, selectors);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ selector = [];
+ for (i = 0; i < parts.length; i++) {
+ if (parts[i] !== '>') {
+ selector.push(compile(parts[i], [], parts[i - 1] === '>'));
+ }
+ }
+ selectors.push(selector);
+ return selectors;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- selectors.push(selector);
- return selectors;
- }
- this._selectors = parseChunks(selector, []);
- },
- match: function (control, selectors) {
- var i, l, si, sl, selector, fi, fl, filters, index, length, siblings, count, item;
- selectors = selectors || this._selectors;
- for (i = 0, l = selectors.length; i < l; i++) {
- selector = selectors[i];
- sl = selector.length;
- item = control;
- count = 0;
- for (si = sl - 1; si >= 0; si--) {
- filters = selector[si];
- while (item) {
- if (filters.pseudo) {
- siblings = item.parent().items();
- index = length = siblings.length;
- while (index--) {
- if (siblings[index] === item) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this._selectors = parseChunks(selector, []);
+ },
+ match: function (control, selectors) {
+ var i, l, si, sl, selector, fi, fl, filters, index, length, siblings, count, item;
+ selectors = selectors || this._selectors;
+ for (i = 0, l = selectors.length; i < l; i++) {
+ selector = selectors[i];
+ sl = selector.length;
+ item = control;
+ count = 0;
+ for (si = sl - 1; si >= 0; si--) {
+ filters = selector[si];
+ while (item) {
+ if (filters.pseudo) {
+ siblings = item.parent().items();
+ index = length = siblings.length;
+ while (index--) {
+ if (siblings[index] === item) {
+ break;
+ }
+ }
+ }
+ for (fi = 0, fl = filters.length; fi < fl; fi++) {
+ if (!filters[fi](item, index, length)) {
+ fi = fl + 1;
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (fi === fl) {
+ count++;
+ break;
+ } else {
+ if (si === sl - 1) {
+ break;
+ }
+ }
+ item = item.parent();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (count === sl) {
+ return true;
+ }
+ }
+ return false;
+ },
+ find: function (container) {
+ var matches = [], i, l;
+ var selectors = this._selectors;
+ function collect(items, selector, index) {
+ var i, l, fi, fl, item;
+ var filters = selector[index];
+ for (i = 0, l = items.length; i < l; i++) {
+ item = items[i];
</ins><span class="cx" style="display: block; padding: 0 10px"> for (fi = 0, fl = filters.length; fi < fl; fi++) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (!filters[fi](item, index, length)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!filters[fi](item, i, l)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> fi = fl + 1;
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</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"> if (fi === fl) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- count++;
- break;
- } else {
- if (si === sl - 1) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (index === selector.length - 1) {
+ matches.push(item);
+ } else {
+ if (item.items) {
+ collect(item.items(), selector, index + 1);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if (filters.direct) {
+ 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">- item = item.parent();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (item.items) {
+ collect(item.items(), selector, index);
+ }
</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">- if (count === sl) {
- return true;
- }
- }
- return false;
- },
- find: function (container) {
- var matches = [], i, l;
- var selectors = this._selectors;
- function collect(items, selector, index) {
- var i, l, fi, fl, item;
- var filters = selector[index];
- for (i = 0, l = items.length; i < l; i++) {
- item = items[i];
- for (fi = 0, fl = filters.length; fi < fl; fi++) {
- if (!filters[fi](item, i, l)) {
- fi = fl + 1;
- break;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (container.items) {
+ for (i = 0, l = selectors.length; i < l; i++) {
+ collect(container.items(), selectors[i], 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">- if (fi === fl) {
- if (index === selector.length - 1) {
- matches.push(item);
- } else {
- if (item.items) {
- collect(item.items(), selector, index + 1);
- }
- }
- } else if (filters.direct) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (l > 1) {
+ matches = unique(matches);
</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.items) {
- collect(item.items(), selector, index);
- }
</del><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.items) {
- for (i = 0, l = selectors.length; i < l; i++) {
- collect(container.items(), selectors[i], 0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!Collection) {
+ Collection = Selector.Collection;
</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 (l > 1) {
- matches = unique(matches);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new Collection(matches);
</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 (!Collection) {
- Collection = Selector.Collection;
- }
- return new Collection(matches);
- }
- });
</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">- var Collection$1;
- var proto;
- var push$1 = Array.prototype.push;
- var slice$1 = Array.prototype.slice;
- proto = {
- length: 0,
- init: function (items) {
- if (items) {
- this.add(items);
- }
- },
- add: function (items) {
- var self = this;
- if (!global$4.isArray(items)) {
- if (items instanceof Collection$1) {
- self.add(items.toArray());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Collection$1, proto;
+ var push$1 = Array.prototype.push, slice$1 = Array.prototype.slice;
+ proto = {
+ length: 0,
+ init: function (items) {
+ if (items) {
+ this.add(items);
+ }
+ },
+ add: function (items) {
+ var self = this;
+ if (!global$4.isArray(items)) {
+ if (items instanceof Collection$1) {
+ self.add(items.toArray());
+ } else {
+ push$1.call(self, items);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- push$1.call(self, items);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ push$1.apply(self, items);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- push$1.apply(self, items);
- }
- return self;
- },
- set: function (items) {
- var self = this;
- var len = self.length;
- var i;
- self.length = 0;
- self.add(items);
- for (i = self.length; i < len; i++) {
- delete self[i];
- }
- return self;
- },
- filter: function (selector) {
- var self = this;
- var i, l;
- var matches = [];
- var item, match;
- if (typeof selector === 'string') {
- selector = new Selector(selector);
- match = function (item) {
- return selector.match(item);
- };
- } else {
- match = selector;
- }
- for (i = 0, l = self.length; i < l; i++) {
- item = self[i];
- if (match(item)) {
- matches.push(item);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self;
+ },
+ set: function (items) {
+ var self = this;
+ var len = self.length;
+ var i;
+ self.length = 0;
+ self.add(items);
+ for (i = self.length; i < len; i++) {
+ delete self[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">- }
- return new Collection$1(matches);
- },
- slice: function () {
- return new Collection$1(slice$1.apply(this, arguments));
- },
- eq: function (index) {
- return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
- },
- each: function (callback) {
- global$4.each(this, callback);
- return this;
- },
- toArray: function () {
- return global$4.toArray(this);
- },
- indexOf: function (ctrl) {
- var self = this;
- var i = self.length;
- while (i--) {
- if (self[i] === ctrl) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self;
+ },
+ filter: function (selector) {
+ var self = this;
+ var i, l;
+ var matches = [];
+ var item, match;
+ if (typeof selector === 'string') {
+ selector = new Selector(selector);
+ match = function (item) {
+ return selector.match(item);
+ };
+ } else {
+ match = 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">- }
- return i;
- },
- reverse: function () {
- return new Collection$1(global$4.toArray(this).reverse());
- },
- hasClass: function (cls) {
- return this[0] ? this[0].classes.contains(cls) : false;
- },
- prop: function (name, value) {
- var self = this;
- var item;
- if (value !== undefined) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (i = 0, l = self.length; i < l; i++) {
+ item = self[i];
+ if (match(item)) {
+ matches.push(item);
+ }
+ }
+ return new Collection$1(matches);
+ },
+ slice: function () {
+ return new Collection$1(slice$1.apply(this, arguments));
+ },
+ eq: function (index) {
+ return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
+ },
+ each: function (callback) {
+ global$4.each(this, callback);
+ return this;
+ },
+ toArray: function () {
+ return global$4.toArray(this);
+ },
+ indexOf: function (ctrl) {
+ var self = this;
+ var i = self.length;
+ while (i--) {
+ if (self[i] === ctrl) {
+ break;
+ }
+ }
+ return i;
+ },
+ reverse: function () {
+ return new Collection$1(global$4.toArray(this).reverse());
+ },
+ hasClass: function (cls) {
+ return this[0] ? this[0].classes.contains(cls) : false;
+ },
+ prop: function (name, value) {
+ var self = this;
+ var item;
+ if (value !== undefined) {
+ self.each(function (item) {
+ if (item[name]) {
+ item[name](value);
+ }
+ });
+ return self;
+ }
+ item = self[0];
+ if (item && item[name]) {
+ return item[name]();
+ }
+ },
+ exec: function (name) {
+ var self = this, args = global$4.toArray(arguments).slice(1);
</ins><span class="cx" style="display: block; padding: 0 10px"> self.each(function (item) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (item[name]) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- item[name](value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ item[name].apply(item, args);
</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"> return self;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- item = self[0];
- if (item && item[name]) {
- return item[name]();
- }
- },
- exec: function (name) {
- var self = this, args = global$4.toArray(arguments).slice(1);
- self.each(function (item) {
- if (item[name]) {
- item[name].apply(item, args);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ remove: function () {
+ var i = this.length;
+ while (i--) {
+ this[i].remove();
</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 self;
- },
- remove: function () {
- var i = this.length;
- while (i--) {
- this[i].remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this;
+ },
+ addClass: function (cls) {
+ return this.each(function (item) {
+ item.classes.add(cls);
+ });
+ },
+ removeClass: function (cls) {
+ return this.each(function (item) {
+ item.classes.remove(cls);
+ });
</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 this;
- },
- addClass: function (cls) {
- return this.each(function (item) {
- item.classes.add(cls);
- });
- },
- removeClass: function (cls) {
- return this.each(function (item) {
- item.classes.remove(cls);
- });
- }
- };
- global$4.each('fire on off show hide append prepend before after reflow'.split(' '), function (name) {
- proto[name] = function () {
- var args = global$4.toArray(arguments);
- this.each(function (ctrl) {
- if (name in ctrl) {
- ctrl[name].apply(ctrl, args);
- }
- });
- return this;
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- global$4.each('text name disabled active selected checked visible parent value data'.split(' '), function (name) {
- proto[name] = function (value) {
- return this.prop(name, value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global$4.each('fire on off show hide append prepend before after reflow'.split(' '), function (name) {
+ proto[name] = function () {
+ var args = global$4.toArray(arguments);
+ this.each(function (ctrl) {
+ if (name in ctrl) {
+ ctrl[name].apply(ctrl, args);
+ }
+ });
+ return this;
+ };
+ });
+ global$4.each('text name disabled active selected checked visible parent value data'.split(' '), function (name) {
+ proto[name] = function (value) {
+ return this.prop(name, value);
+ };
+ });
+ Collection$1 = global$8.extend(proto);
+ Selector.Collection = Collection$1;
+ var Collection$2 = Collection$1;
+
+ var Binding = function (settings) {
+ this.create = settings.create;
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- Collection$1 = global$8.extend(proto);
- Selector.Collection = Collection$1;
- var Collection$2 = Collection$1;
-
- var Binding = function (settings) {
- this.create = settings.create;
- };
- Binding.create = function (model, name) {
- return new Binding({
- create: function (otherModel, otherName) {
- var bindings;
- var fromSelfToOther = function (e) {
- otherModel.set(otherName, e.value);
- };
- var fromOtherToSelf = function (e) {
- model.set(name, e.value);
- };
- otherModel.on('change:' + otherName, fromOtherToSelf);
- model.on('change:' + name, fromSelfToOther);
- bindings = otherModel._bindings;
- if (!bindings) {
- bindings = otherModel._bindings = [];
- otherModel.on('destroy', function () {
- var i = bindings.length;
- while (i--) {
- bindings[i]();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Binding.create = function (model, name) {
+ return new Binding({
+ create: function (otherModel, otherName) {
+ var bindings;
+ var fromSelfToOther = function (e) {
+ otherModel.set(otherName, e.value);
+ };
+ var fromOtherToSelf = function (e) {
+ model.set(name, e.value);
+ };
+ otherModel.on('change:' + otherName, fromOtherToSelf);
+ model.on('change:' + name, fromSelfToOther);
+ bindings = otherModel._bindings;
+ if (!bindings) {
+ bindings = otherModel._bindings = [];
+ otherModel.on('destroy', function () {
+ var i = bindings.length;
+ while (i--) {
+ bindings[i]();
+ }
+ });
+ }
+ bindings.push(function () {
+ model.off('change:' + name, fromSelfToOther);
</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 model.get(name);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- bindings.push(function () {
- model.off('change:' + name, fromSelfToOther);
- });
- return model.get(name);
- }
- });
- };
</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">- var global$10 = tinymce.util.Tools.resolve('tinymce.util.Observable');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$a = tinymce.util.Tools.resolve('tinymce.util.Observable');
</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 isNode(node) {
- return node.nodeType > 0;
- }
- function isEqual(a, b) {
- var k, checked;
- if (a === b) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function isNode(node) {
+ return node.nodeType > 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">- if (a === null || b === null) {
- return a === b;
- }
- if (typeof a !== 'object' || typeof b !== 'object') {
- return a === b;
- }
- if (global$4.isArray(b)) {
- if (a.length !== b.length) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function isEqual(a, b) {
+ var k, checked;
+ if (a === b) {
+ 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">- k = a.length;
- while (k--) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (a === null || b === null) {
+ return a === b;
+ }
+ if (typeof a !== 'object' || typeof b !== 'object') {
+ return a === b;
+ }
+ if (global$4.isArray(b)) {
+ if (a.length !== b.length) {
+ return false;
+ }
+ k = a.length;
+ while (k--) {
+ if (!isEqual(a[k], b[k])) {
+ return false;
+ }
+ }
+ }
+ if (isNode(a) || isNode(b)) {
+ return a === b;
+ }
+ checked = {};
+ for (k in b) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (!isEqual(a[k], b[k])) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ checked[k] = 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 (isNode(a) || isNode(b)) {
- return a === b;
- }
- checked = {};
- for (k in b) {
- if (!isEqual(a[k], b[k])) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (k in a) {
+ if (!checked[k] && !isEqual(a[k], b[k])) {
+ 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">- checked[k] = true;
</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">- for (k in a) {
- if (!checked[k] && !isEqual(a[k], b[k])) {
- return false;
- }
- }
- return true;
- }
- var ObservableObject = global$8.extend({
- Mixins: [global$10],
- init: function (data) {
- var name, value;
- data = data || {};
- for (name in data) {
- value = data[name];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ObservableObject = global$8.extend({
+ Mixins: [global$a],
+ init: function (data) {
+ var name, value;
+ data = data || {};
+ for (name in data) {
+ value = data[name];
+ if (value instanceof Binding) {
+ data[name] = value.create(this, name);
+ }
+ }
+ this.data = data;
+ },
+ set: function (name, value) {
+ var key, args;
+ var oldValue = this.data[name];
</ins><span class="cx" style="display: block; padding: 0 10px"> if (value instanceof Binding) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- data[name] = value.create(this, name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ value = value.create(this, name);
</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.data = data;
- },
- set: function (name, value) {
- var key, args;
- var oldValue = this.data[name];
- if (value instanceof Binding) {
- value = value.create(this, name);
- }
- if (typeof name === 'object') {
- for (key in name) {
- this.set(key, name[key]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (typeof name === 'object') {
+ for (key in name) {
+ this.set(key, name[key]);
+ }
+ return this;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!isEqual(oldValue, value)) {
+ this.data[name] = value;
+ args = {
+ target: this,
+ name: name,
+ value: value,
+ oldValue: oldValue
+ };
+ this.fire('change:' + name, args);
+ this.fire('change', args);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return this;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ get: function (name) {
+ return this.data[name];
+ },
+ has: function (name) {
+ return name in this.data;
+ },
+ bind: function (name) {
+ return Binding.create(this, name);
+ },
+ destroy: function () {
+ this.fire('destroy');
</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 (!isEqual(oldValue, value)) {
- this.data[name] = value;
- args = {
- target: this,
- name: name,
- value: value,
- oldValue: oldValue
- };
- this.fire('change:' + name, args);
- this.fire('change', args);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var dirtyCtrls = {}, animationFrameRequested;
+ var ReflowQueue = {
+ add: function (ctrl) {
+ var parent$$1 = ctrl.parent();
+ if (parent$$1) {
+ if (!parent$$1._layout || parent$$1._layout.isNative()) {
+ return;
+ }
+ if (!dirtyCtrls[parent$$1._id]) {
+ dirtyCtrls[parent$$1._id] = parent$$1;
+ }
+ if (!animationFrameRequested) {
+ animationFrameRequested = true;
+ global$3.requestAnimationFrame(function () {
+ var id, ctrl;
+ animationFrameRequested = false;
+ for (id in dirtyCtrls) {
+ ctrl = dirtyCtrls[id];
+ if (ctrl.state.get('rendered')) {
+ ctrl.reflow();
+ }
+ }
+ dirtyCtrls = {};
+ }, document.body);
+ }
+ }
+ },
+ remove: function (ctrl) {
+ if (dirtyCtrls[ctrl._id]) {
+ delete dirtyCtrls[ctrl._id];
+ }
</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 this;
- },
- get: function (name) {
- return this.data[name];
- },
- has: function (name) {
- return name in this.data;
- },
- bind: function (name) {
- return Binding.create(this, name);
- },
- destroy: function () {
- this.fire('destroy');
- }
- });
</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">- var dirtyCtrls = {};
- var animationFrameRequested;
- var $_cqjgb518wjjgwek2f = {
- add: function (ctrl) {
- var parent$$1 = ctrl.parent();
- if (parent$$1) {
- if (!parent$$1._layout || parent$$1._layout.isNative()) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getUiContainerDelta = function (ctrl) {
+ var uiContainer = getUiContainer(ctrl);
+ if (uiContainer && global$2.DOM.getStyle(uiContainer, 'position', true) !== 'static') {
+ var containerPos = global$2.DOM.getPos(uiContainer);
+ var dx = uiContainer.scrollLeft - containerPos.x;
+ var dy = uiContainer.scrollTop - containerPos.y;
+ return Option.some({
+ x: dx,
+ y: dy
+ });
+ } else {
+ return Option.none();
+ }
+ };
+ var setUiContainer = function (editor, ctrl) {
+ var uiContainer = global$2.DOM.select(editor.settings.ui_container)[0];
+ ctrl.getRoot().uiContainer = uiContainer;
+ };
+ var getUiContainer = function (ctrl) {
+ return ctrl ? ctrl.getRoot().uiContainer : null;
+ };
+ var inheritUiContainer = function (fromCtrl, toCtrl) {
+ return toCtrl.uiContainer = getUiContainer(fromCtrl);
+ };
+ var UiContainer = {
+ getUiContainerDelta: getUiContainerDelta,
+ setUiContainer: setUiContainer,
+ getUiContainer: getUiContainer,
+ inheritUiContainer: inheritUiContainer
+ };
+
+ var hasMouseWheelEventSupport = 'onmousewheel' in document;
+ var hasWheelEventSupport = false;
+ var classPrefix = 'mce-';
+ var Control, idCounter = 0;
+ var proto$1 = {
+ Statics: { classPrefix: classPrefix },
+ isRtl: function () {
+ return Control.rtl;
+ },
+ classPrefix: classPrefix,
+ init: function (settings) {
+ var self$$1 = this;
+ var classes, defaultClasses;
+ function applyClasses(classes) {
+ var i;
+ classes = classes.split(' ');
+ for (i = 0; i < classes.length; i++) {
+ self$$1.classes.add(classes[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 (!dirtyCtrls[parent$$1._id]) {
- dirtyCtrls[parent$$1._id] = parent$$1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.settings = settings = global$4.extend({}, self$$1.Defaults, settings);
+ self$$1._id = settings.id || 'mceu_' + idCounter++;
+ self$$1._aria = { role: settings.role };
+ self$$1._elmCache = {};
+ self$$1.$ = global$7;
+ self$$1.state = new ObservableObject({
+ visible: true,
+ active: false,
+ disabled: false,
+ value: ''
+ });
+ self$$1.data = new ObservableObject(settings.data);
+ self$$1.classes = new ClassList(function () {
+ if (self$$1.state.get('rendered')) {
+ self$$1.getEl().className = this.toString();
+ }
+ });
+ self$$1.classes.prefix = self$$1.classPrefix;
+ classes = settings.classes;
+ if (classes) {
+ if (self$$1.Defaults) {
+ defaultClasses = self$$1.Defaults.classes;
+ if (defaultClasses && classes !== defaultClasses) {
+ applyClasses(defaultClasses);
+ }
+ }
+ applyClasses(classes);
</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 (!animationFrameRequested) {
- animationFrameRequested = true;
- global$3.requestAnimationFrame(function () {
- var id, ctrl;
- animationFrameRequested = false;
- for (id in dirtyCtrls) {
- ctrl = dirtyCtrls[id];
- if (ctrl.state.get('rendered')) {
- ctrl.reflow();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global$4.each('title text name visible disabled active value'.split(' '), function (name$$1) {
+ if (name$$1 in settings) {
+ self$$1[name$$1](settings[name$$1]);
+ }
+ });
+ self$$1.on('click', function () {
+ if (self$$1.disabled()) {
+ return false;
+ }
+ });
+ self$$1.settings = settings;
+ self$$1.borderBox = BoxUtils.parseBox(settings.border);
+ self$$1.paddingBox = BoxUtils.parseBox(settings.padding);
+ self$$1.marginBox = BoxUtils.parseBox(settings.margin);
+ if (settings.hidden) {
+ self$$1.hide();
+ }
+ },
+ Properties: 'parent,name',
+ getContainerElm: function () {
+ var uiContainer = UiContainer.getUiContainer(this);
+ return uiContainer ? uiContainer : funcs.getContainer();
+ },
+ getParentCtrl: function (elm) {
+ var ctrl;
+ var lookup = this.getRoot().controlIdLookup;
+ while (elm && lookup) {
+ ctrl = lookup[elm.id];
+ if (ctrl) {
+ break;
+ }
+ elm = elm.parentNode;
+ }
+ return ctrl;
+ },
+ initLayoutRect: function () {
+ var self$$1 = this;
+ var settings = self$$1.settings;
+ var borderBox, layoutRect;
+ var elm = self$$1.getEl();
+ var width, height, minWidth, minHeight, autoResize;
+ var startMinWidth, startMinHeight, initialSize;
+ borderBox = self$$1.borderBox = self$$1.borderBox || BoxUtils.measureBox(elm, 'border');
+ self$$1.paddingBox = self$$1.paddingBox || BoxUtils.measureBox(elm, 'padding');
+ self$$1.marginBox = self$$1.marginBox || BoxUtils.measureBox(elm, 'margin');
+ initialSize = funcs.getSize(elm);
+ startMinWidth = settings.minWidth;
+ startMinHeight = settings.minHeight;
+ minWidth = startMinWidth || initialSize.width;
+ minHeight = startMinHeight || initialSize.height;
+ width = settings.width;
+ height = settings.height;
+ autoResize = settings.autoResize;
+ autoResize = typeof autoResize !== 'undefined' ? autoResize : !width && !height;
+ width = width || minWidth;
+ height = height || minHeight;
+ var deltaW = borderBox.left + borderBox.right;
+ var deltaH = borderBox.top + borderBox.bottom;
+ var maxW = settings.maxWidth || 65535;
+ var maxH = settings.maxHeight || 65535;
+ self$$1._layoutRect = layoutRect = {
+ x: settings.x || 0,
+ y: settings.y || 0,
+ w: width,
+ h: height,
+ deltaW: deltaW,
+ deltaH: deltaH,
+ contentW: width - deltaW,
+ contentH: height - deltaH,
+ innerW: width - deltaW,
+ innerH: height - deltaH,
+ startMinWidth: startMinWidth || 0,
+ startMinHeight: startMinHeight || 0,
+ minW: Math.min(minWidth, maxW),
+ minH: Math.min(minHeight, maxH),
+ maxW: maxW,
+ maxH: maxH,
+ autoResize: autoResize,
+ scrollW: 0
+ };
+ self$$1._lastLayoutRect = {};
+ return layoutRect;
+ },
+ layoutRect: function (newRect) {
+ var self$$1 = this;
+ var curRect = self$$1._layoutRect, lastLayoutRect, size, deltaWidth, deltaHeight, repaintControls;
+ if (!curRect) {
+ curRect = self$$1.initLayoutRect();
+ }
+ if (newRect) {
+ deltaWidth = curRect.deltaW;
+ deltaHeight = curRect.deltaH;
+ if (newRect.x !== undefined) {
+ curRect.x = newRect.x;
+ }
+ if (newRect.y !== undefined) {
+ curRect.y = newRect.y;
+ }
+ if (newRect.minW !== undefined) {
+ curRect.minW = newRect.minW;
+ }
+ if (newRect.minH !== undefined) {
+ curRect.minH = newRect.minH;
+ }
+ size = newRect.w;
+ if (size !== undefined) {
+ size = size < curRect.minW ? curRect.minW : size;
+ size = size > curRect.maxW ? curRect.maxW : size;
+ curRect.w = size;
+ curRect.innerW = size - deltaWidth;
+ }
+ size = newRect.h;
+ if (size !== undefined) {
+ size = size < curRect.minH ? curRect.minH : size;
+ size = size > curRect.maxH ? curRect.maxH : size;
+ curRect.h = size;
+ curRect.innerH = size - deltaHeight;
+ }
+ size = newRect.innerW;
+ if (size !== undefined) {
+ size = size < curRect.minW - deltaWidth ? curRect.minW - deltaWidth : size;
+ size = size > curRect.maxW - deltaWidth ? curRect.maxW - deltaWidth : size;
+ curRect.innerW = size;
+ curRect.w = size + deltaWidth;
+ }
+ size = newRect.innerH;
+ if (size !== undefined) {
+ size = size < curRect.minH - deltaHeight ? curRect.minH - deltaHeight : size;
+ size = size > curRect.maxH - deltaHeight ? curRect.maxH - deltaHeight : size;
+ curRect.innerH = size;
+ curRect.h = size + deltaHeight;
+ }
+ if (newRect.contentW !== undefined) {
+ curRect.contentW = newRect.contentW;
+ }
+ if (newRect.contentH !== undefined) {
+ curRect.contentH = newRect.contentH;
+ }
+ lastLayoutRect = self$$1._lastLayoutRect;
+ if (lastLayoutRect.x !== curRect.x || lastLayoutRect.y !== curRect.y || lastLayoutRect.w !== curRect.w || lastLayoutRect.h !== curRect.h) {
+ repaintControls = Control.repaintControls;
+ if (repaintControls) {
+ if (repaintControls.map && !repaintControls.map[self$$1._id]) {
+ repaintControls.push(self$$1);
+ repaintControls.map[self$$1._id] = true;
</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">- dirtyCtrls = {};
- }, document.body);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ lastLayoutRect.x = curRect.x;
+ lastLayoutRect.y = curRect.y;
+ lastLayoutRect.w = curRect.w;
+ lastLayoutRect.h = curRect.h;
+ }
+ return self$$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">- }
- },
- remove: function (ctrl) {
- if (dirtyCtrls[ctrl._id]) {
- delete dirtyCtrls[ctrl._id];
- }
- }
- };
-
- var getUiContainerDelta = function (ctrl) {
- var uiContainer = getUiContainer(ctrl);
- if (uiContainer && global$2.DOM.getStyle(uiContainer, 'position', true) !== 'static') {
- var containerPos = global$2.DOM.getPos(uiContainer);
- var dx = uiContainer.scrollLeft - containerPos.x;
- var dy = uiContainer.scrollTop - containerPos.y;
- return Option.some({
- x: dx,
- y: dy
- });
- } else {
- return Option.none();
- }
- };
- var setUiContainer = function (editor, ctrl) {
- var uiContainer = global$2.DOM.select(editor.settings.ui_container)[0];
- ctrl.getRoot().uiContainer = uiContainer;
- };
- var getUiContainer = function (ctrl) {
- return ctrl ? ctrl.getRoot().uiContainer : null;
- };
- var inheritUiContainer = function (fromCtrl, toCtrl) {
- return toCtrl.uiContainer = getUiContainer(fromCtrl);
- };
- var $_egt6ye18xjjgwek2h = {
- getUiContainerDelta: getUiContainerDelta,
- setUiContainer: setUiContainer,
- getUiContainer: getUiContainer,
- inheritUiContainer: inheritUiContainer
- };
-
- var hasMouseWheelEventSupport = 'onmousewheel' in document;
- var hasWheelEventSupport = false;
- var classPrefix = 'mce-';
- var Control;
- var idCounter = 0;
- var proto$1 = {
- Statics: { classPrefix: classPrefix },
- isRtl: function () {
- return Control.rtl;
- },
- classPrefix: classPrefix,
- init: function (settings) {
- var self$$1 = this;
- var classes, defaultClasses;
- function applyClasses(classes) {
- var i;
- classes = classes.split(' ');
- for (i = 0; i < classes.length; i++) {
- self$$1.classes.add(classes[i]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return curRect;
+ },
+ repaint: function () {
+ var self$$1 = this;
+ var style, bodyStyle, bodyElm, rect, borderBox;
+ var borderW, borderH, lastRepaintRect, round, value;
+ round = !document.createRange ? Math.round : function (value) {
+ return value;
+ };
+ style = self$$1.getEl().style;
+ rect = self$$1._layoutRect;
+ lastRepaintRect = self$$1._lastRepaintRect || {};
+ borderBox = self$$1.borderBox;
+ borderW = borderBox.left + borderBox.right;
+ borderH = borderBox.top + borderBox.bottom;
+ if (rect.x !== lastRepaintRect.x) {
+ style.left = round(rect.x) + 'px';
+ lastRepaintRect.x = rect.x;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- self$$1.settings = settings = global$4.extend({}, self$$1.Defaults, settings);
- self$$1._id = settings.id || 'mceu_' + idCounter++;
- self$$1._aria = { role: settings.role };
- self$$1._elmCache = {};
- self$$1.$ = global$7;
- self$$1.state = new ObservableObject({
- visible: true,
- active: false,
- disabled: false,
- value: ''
- });
- self$$1.data = new ObservableObject(settings.data);
- self$$1.classes = new ClassList(function () {
- if (self$$1.state.get('rendered')) {
- self$$1.getEl().className = this.toString();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rect.y !== lastRepaintRect.y) {
+ style.top = round(rect.y) + 'px';
+ lastRepaintRect.y = rect.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">- });
- self$$1.classes.prefix = self$$1.classPrefix;
- classes = settings.classes;
- if (classes) {
- if (self$$1.Defaults) {
- defaultClasses = self$$1.Defaults.classes;
- if (defaultClasses && classes !== defaultClasses) {
- applyClasses(defaultClasses);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rect.w !== lastRepaintRect.w) {
+ value = round(rect.w - borderW);
+ style.width = (value >= 0 ? value : 0) + 'px';
+ lastRepaintRect.w = rect.w;
+ }
+ if (rect.h !== lastRepaintRect.h) {
+ value = round(rect.h - borderH);
+ style.height = (value >= 0 ? value : 0) + 'px';
+ lastRepaintRect.h = rect.h;
+ }
+ if (self$$1._hasBody && rect.innerW !== lastRepaintRect.innerW) {
+ value = round(rect.innerW);
+ bodyElm = self$$1.getEl('body');
+ if (bodyElm) {
+ bodyStyle = bodyElm.style;
+ bodyStyle.width = (value >= 0 ? value : 0) + 'px';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ lastRepaintRect.innerW = rect.innerW;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- applyClasses(classes);
- }
- global$4.each('title text name visible disabled active value'.split(' '), function (name$$1) {
- if (name$$1 in settings) {
- self$$1[name$$1](settings[name$$1]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self$$1._hasBody && rect.innerH !== lastRepaintRect.innerH) {
+ value = round(rect.innerH);
+ bodyElm = bodyElm || self$$1.getEl('body');
+ if (bodyElm) {
+ bodyStyle = bodyStyle || bodyElm.style;
+ bodyStyle.height = (value >= 0 ? value : 0) + 'px';
+ }
+ lastRepaintRect.innerH = rect.innerH;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self$$1.on('click', function () {
- if (self$$1.disabled()) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1._lastRepaintRect = lastRepaintRect;
+ self$$1.fire('repaint', {}, false);
+ },
+ updateLayoutRect: function () {
+ var self$$1 = this;
+ self$$1.parent()._lastRect = null;
+ funcs.css(self$$1.getEl(), {
+ width: '',
+ height: ''
+ });
+ self$$1._layoutRect = self$$1._lastRepaintRect = self$$1._lastLayoutRect = null;
+ self$$1.initLayoutRect();
+ },
+ on: function (name$$1, callback) {
+ var self$$1 = this;
+ function resolveCallbackName(name$$1) {
+ var callback, scope;
+ if (typeof name$$1 !== 'string') {
+ return name$$1;
+ }
+ return function (e) {
+ if (!callback) {
+ self$$1.parentsAndSelf().each(function (ctrl) {
+ var callbacks = ctrl.settings.callbacks;
+ if (callbacks && (callback = callbacks[name$$1])) {
+ scope = ctrl;
+ return false;
+ }
+ });
+ }
+ if (!callback) {
+ e.action = name$$1;
+ this.fire('execute', e);
+ return;
+ }
+ return callback.call(scope, 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">- });
- self$$1.settings = settings;
- self$$1.borderBox = $_4kbuyt18pjjgwek1w.parseBox(settings.border);
- self$$1.paddingBox = $_4kbuyt18pjjgwek1w.parseBox(settings.padding);
- self$$1.marginBox = $_4kbuyt18pjjgwek1w.parseBox(settings.margin);
- if (settings.hidden) {
- self$$1.hide();
- }
- },
- Properties: 'parent,name',
- getContainerElm: function () {
- var uiContainer = $_egt6ye18xjjgwek2h.getUiContainer(this);
- return uiContainer ? uiContainer : funcs.getContainer();
- },
- getParentCtrl: function (elm) {
- var ctrl;
- var lookup = this.getRoot().controlIdLookup;
- while (elm && lookup) {
- ctrl = lookup[elm.id];
- if (ctrl) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ getEventDispatcher(self$$1).on(name$$1, resolveCallbackName(callback));
+ return self$$1;
+ },
+ off: function (name$$1, callback) {
+ getEventDispatcher(this).off(name$$1, callback);
+ return this;
+ },
+ fire: function (name$$1, args, bubble) {
+ var self$$1 = this;
+ args = args || {};
+ if (!args.control) {
+ args.control = self$$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">- elm = elm.parentNode;
- }
- return ctrl;
- },
- initLayoutRect: function () {
- var self$$1 = this;
- var settings = self$$1.settings;
- var borderBox, layoutRect;
- var elm = self$$1.getEl();
- var width, height, minWidth, minHeight, autoResize;
- var startMinWidth, startMinHeight, initialSize;
- borderBox = self$$1.borderBox = self$$1.borderBox || $_4kbuyt18pjjgwek1w.measureBox(elm, 'border');
- self$$1.paddingBox = self$$1.paddingBox || $_4kbuyt18pjjgwek1w.measureBox(elm, 'padding');
- self$$1.marginBox = self$$1.marginBox || $_4kbuyt18pjjgwek1w.measureBox(elm, 'margin');
- initialSize = funcs.getSize(elm);
- startMinWidth = settings.minWidth;
- startMinHeight = settings.minHeight;
- minWidth = startMinWidth || initialSize.width;
- minHeight = startMinHeight || initialSize.height;
- width = settings.width;
- height = settings.height;
- autoResize = settings.autoResize;
- autoResize = typeof autoResize !== 'undefined' ? autoResize : !width && !height;
- width = width || minWidth;
- height = height || minHeight;
- var deltaW = borderBox.left + borderBox.right;
- var deltaH = borderBox.top + borderBox.bottom;
- var maxW = settings.maxWidth || 65535;
- var maxH = settings.maxHeight || 65535;
- self$$1._layoutRect = layoutRect = {
- x: settings.x || 0,
- y: settings.y || 0,
- w: width,
- h: height,
- deltaW: deltaW,
- deltaH: deltaH,
- contentW: width - deltaW,
- contentH: height - deltaH,
- innerW: width - deltaW,
- innerH: height - deltaH,
- startMinWidth: startMinWidth || 0,
- startMinHeight: startMinHeight || 0,
- minW: Math.min(minWidth, maxW),
- minH: Math.min(minHeight, maxH),
- maxW: maxW,
- maxH: maxH,
- autoResize: autoResize,
- scrollW: 0
- };
- self$$1._lastLayoutRect = {};
- return layoutRect;
- },
- layoutRect: function (newRect) {
- var self$$1 = this;
- var curRect = self$$1._layoutRect, lastLayoutRect, size, deltaWidth, deltaHeight, repaintControls;
- if (!curRect) {
- curRect = self$$1.initLayoutRect();
- }
- if (newRect) {
- deltaWidth = curRect.deltaW;
- deltaHeight = curRect.deltaH;
- if (newRect.x !== undefined) {
- curRect.x = newRect.x;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ args = getEventDispatcher(self$$1).fire(name$$1, args);
+ if (bubble !== false && self$$1.parent) {
+ var parent$$1 = self$$1.parent();
+ while (parent$$1 && !args.isPropagationStopped()) {
+ parent$$1.fire(name$$1, args, false);
+ parent$$1 = parent$$1.parent();
+ }
</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 (newRect.y !== undefined) {
- curRect.y = newRect.y;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return args;
+ },
+ hasEventListeners: function (name$$1) {
+ return getEventDispatcher(this).has(name$$1);
+ },
+ parents: function (selector) {
+ var self$$1 = this;
+ var ctrl, parents = new Collection$2();
+ for (ctrl = self$$1.parent(); ctrl; ctrl = ctrl.parent()) {
+ parents.add(ctrl);
</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 (newRect.minW !== undefined) {
- curRect.minW = newRect.minW;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (selector) {
+ parents = parents.filter(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">- if (newRect.minH !== undefined) {
- curRect.minH = newRect.minH;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return parents;
+ },
+ parentsAndSelf: function (selector) {
+ return new Collection$2(this).add(this.parents(selector));
+ },
+ next: function () {
+ var parentControls = this.parent().items();
+ return parentControls[parentControls.indexOf(this) + 1];
+ },
+ prev: function () {
+ var parentControls = this.parent().items();
+ return parentControls[parentControls.indexOf(this) - 1];
+ },
+ innerHtml: function (html) {
+ this.$el.html(html);
+ return this;
+ },
+ getEl: function (suffix) {
+ var id = suffix ? this._id + '-' + suffix : this._id;
+ if (!this._elmCache[id]) {
+ this._elmCache[id] = global$7('#' + id)[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">- size = newRect.w;
- if (size !== undefined) {
- size = size < curRect.minW ? curRect.minW : size;
- size = size > curRect.maxW ? curRect.maxW : size;
- curRect.w = size;
- curRect.innerW = size - deltaWidth;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this._elmCache[id];
+ },
+ show: function () {
+ return this.visible(true);
+ },
+ hide: function () {
+ return this.visible(false);
+ },
+ focus: function () {
+ try {
+ this.getEl().focus();
+ } catch (ex) {
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- size = newRect.h;
- if (size !== undefined) {
- size = size < curRect.minH ? curRect.minH : size;
- size = size > curRect.maxH ? curRect.maxH : size;
- curRect.h = size;
- curRect.innerH = size - deltaHeight;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this;
+ },
+ blur: function () {
+ this.getEl().blur();
+ return this;
+ },
+ aria: function (name$$1, value) {
+ var self$$1 = this, elm = self$$1.getEl(self$$1.ariaTarget);
+ if (typeof value === 'undefined') {
+ return self$$1._aria[name$$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">- size = newRect.innerW;
- if (size !== undefined) {
- size = size < curRect.minW - deltaWidth ? curRect.minW - deltaWidth : size;
- size = size > curRect.maxW - deltaWidth ? curRect.maxW - deltaWidth : size;
- curRect.innerW = size;
- curRect.w = size + deltaWidth;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1._aria[name$$1] = value;
+ if (self$$1.state.get('rendered')) {
+ elm.setAttribute(name$$1 === 'role' ? name$$1 : 'aria-' + name$$1, 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">- size = newRect.innerH;
- if (size !== undefined) {
- size = size < curRect.minH - deltaHeight ? curRect.minH - deltaHeight : size;
- size = size > curRect.maxH - deltaHeight ? curRect.maxH - deltaHeight : size;
- curRect.innerH = size;
- curRect.h = size + deltaHeight;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$1;
+ },
+ encode: function (text, translate) {
+ if (translate !== false) {
+ text = this.translate(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 (newRect.contentW !== undefined) {
- curRect.contentW = newRect.contentW;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return (text || '').replace(/[&<>"]/g, function (match) {
+ return '&#' + match.charCodeAt(0) + ';';
+ });
+ },
+ translate: function (text) {
+ return Control.translate ? Control.translate(text) : text;
+ },
+ before: function (items) {
+ var self$$1 = this, parent$$1 = self$$1.parent();
+ if (parent$$1) {
+ parent$$1.insert(items, parent$$1.items().indexOf(self$$1), 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 (newRect.contentH !== undefined) {
- curRect.contentH = newRect.contentH;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$1;
+ },
+ after: function (items) {
+ var self$$1 = this, parent$$1 = self$$1.parent();
+ if (parent$$1) {
+ parent$$1.insert(items, parent$$1.items().indexOf(self$$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">- lastLayoutRect = self$$1._lastLayoutRect;
- if (lastLayoutRect.x !== curRect.x || lastLayoutRect.y !== curRect.y || lastLayoutRect.w !== curRect.w || lastLayoutRect.h !== curRect.h) {
- repaintControls = Control.repaintControls;
- if (repaintControls) {
- if (repaintControls.map && !repaintControls.map[self$$1._id]) {
- repaintControls.push(self$$1);
- repaintControls.map[self$$1._id] = true;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$1;
+ },
+ remove: function () {
+ var self$$1 = this;
+ var elm = self$$1.getEl();
+ var parent$$1 = self$$1.parent();
+ var newItems, i;
+ if (self$$1.items) {
+ var controls = self$$1.items().toArray();
+ i = controls.length;
+ while (i--) {
+ controls[i].remove();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- lastLayoutRect.x = curRect.x;
- lastLayoutRect.y = curRect.y;
- lastLayoutRect.w = curRect.w;
- lastLayoutRect.h = curRect.h;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return self$$1;
- }
- return curRect;
- },
- repaint: function () {
- var self$$1 = this;
- var style, bodyStyle, bodyElm, rect, borderBox;
- var borderW, borderH, lastRepaintRect, round, value;
- round = !document.createRange ? Math.round : function (value) {
- return value;
- };
- style = self$$1.getEl().style;
- rect = self$$1._layoutRect;
- lastRepaintRect = self$$1._lastRepaintRect || {};
- borderBox = self$$1.borderBox;
- borderW = borderBox.left + borderBox.right;
- borderH = borderBox.top + borderBox.bottom;
- if (rect.x !== lastRepaintRect.x) {
- style.left = round(rect.x) + 'px';
- lastRepaintRect.x = rect.x;
- }
- if (rect.y !== lastRepaintRect.y) {
- style.top = round(rect.y) + 'px';
- lastRepaintRect.y = rect.y;
- }
- if (rect.w !== lastRepaintRect.w) {
- value = round(rect.w - borderW);
- style.width = (value >= 0 ? value : 0) + 'px';
- lastRepaintRect.w = rect.w;
- }
- if (rect.h !== lastRepaintRect.h) {
- value = round(rect.h - borderH);
- style.height = (value >= 0 ? value : 0) + 'px';
- lastRepaintRect.h = rect.h;
- }
- if (self$$1._hasBody && rect.innerW !== lastRepaintRect.innerW) {
- value = round(rect.innerW);
- bodyElm = self$$1.getEl('body');
- if (bodyElm) {
- bodyStyle = bodyElm.style;
- bodyStyle.width = (value >= 0 ? value : 0) + 'px';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (parent$$1 && parent$$1.items) {
+ newItems = [];
+ parent$$1.items().each(function (item) {
+ if (item !== self$$1) {
+ newItems.push(item);
+ }
+ });
+ parent$$1.items().set(newItems);
+ parent$$1._lastRect = 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">- lastRepaintRect.innerW = rect.innerW;
- }
- if (self$$1._hasBody && rect.innerH !== lastRepaintRect.innerH) {
- value = round(rect.innerH);
- bodyElm = bodyElm || self$$1.getEl('body');
- if (bodyElm) {
- bodyStyle = bodyStyle || bodyElm.style;
- bodyStyle.height = (value >= 0 ? value : 0) + 'px';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self$$1._eventsRoot && self$$1._eventsRoot === self$$1) {
+ global$7(elm).off();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- lastRepaintRect.innerH = rect.innerH;
- }
- self$$1._lastRepaintRect = lastRepaintRect;
- self$$1.fire('repaint', {}, false);
- },
- updateLayoutRect: function () {
- var self$$1 = this;
- self$$1.parent()._lastRect = null;
- funcs.css(self$$1.getEl(), {
- width: '',
- height: ''
- });
- self$$1._layoutRect = self$$1._lastRepaintRect = self$$1._lastLayoutRect = null;
- self$$1.initLayoutRect();
- },
- on: function (name$$1, callback) {
- var self$$1 = this;
- function resolveCallbackName(name$$1) {
- var callback, scope;
- if (typeof name$$1 !== 'string') {
- return name$$1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var lookup = self$$1.getRoot().controlIdLookup;
+ if (lookup) {
+ delete lookup[self$$1._id];
</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 function (e) {
- if (!callback) {
- self$$1.parentsAndSelf().each(function (ctrl) {
- var callbacks = ctrl.settings.callbacks;
- if (callbacks && (callback = callbacks[name$$1])) {
- scope = ctrl;
- return false;
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (elm && elm.parentNode) {
+ elm.parentNode.removeChild(elm);
+ }
+ self$$1.state.set('rendered', false);
+ self$$1.state.destroy();
+ self$$1.fire('remove');
+ return self$$1;
+ },
+ renderBefore: function (elm) {
+ global$7(elm).before(this.renderHtml());
+ this.postRender();
+ return this;
+ },
+ renderTo: function (elm) {
+ global$7(elm || this.getContainerElm()).append(this.renderHtml());
+ this.postRender();
+ return this;
+ },
+ preRender: function () {
+ },
+ render: function () {
+ },
+ renderHtml: function () {
+ return '<div id="' + this._id + '" class="' + this.classes + '"></div>';
+ },
+ postRender: function () {
+ var self$$1 = this;
+ var settings = self$$1.settings;
+ var elm, box, parent$$1, name$$1, parentEventsRoot;
+ self$$1.$el = global$7(self$$1.getEl());
+ self$$1.state.set('rendered', true);
+ for (name$$1 in settings) {
+ if (name$$1.indexOf('on') === 0) {
+ self$$1.on(name$$1.substr(2), settings[name$$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 (!callback) {
- e.action = name$$1;
- this.fire('execute', e);
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (self$$1._eventsRoot) {
+ for (parent$$1 = self$$1.parent(); !parentEventsRoot && parent$$1; parent$$1 = parent$$1.parent()) {
+ parentEventsRoot = parent$$1._eventsRoot;
</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 callback.call(scope, e);
- };
- }
- getEventDispatcher(self$$1).on(name$$1, resolveCallbackName(callback));
- return self$$1;
- },
- off: function (name$$1, callback) {
- getEventDispatcher(this).off(name$$1, callback);
- return this;
- },
- fire: function (name$$1, args, bubble) {
- var self$$1 = this;
- args = args || {};
- if (!args.control) {
- args.control = self$$1;
- }
- args = getEventDispatcher(self$$1).fire(name$$1, args);
- if (bubble !== false && self$$1.parent) {
- var parent$$1 = self$$1.parent();
- while (parent$$1 && !args.isPropagationStopped()) {
- parent$$1.fire(name$$1, args, false);
- parent$$1 = parent$$1.parent();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (parentEventsRoot) {
+ for (name$$1 in parentEventsRoot._nativeEvents) {
+ self$$1._nativeEvents[name$$1] = 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 args;
- },
- hasEventListeners: function (name$$1) {
- return getEventDispatcher(this).has(name$$1);
- },
- parents: function (selector) {
- var self$$1 = this;
- var ctrl, parents = new Collection$2();
- for (ctrl = self$$1.parent(); ctrl; ctrl = ctrl.parent()) {
- parents.add(ctrl);
- }
- if (selector) {
- parents = parents.filter(selector);
- }
- return parents;
- },
- parentsAndSelf: function (selector) {
- return new Collection$2(this).add(this.parents(selector));
- },
- next: function () {
- var parentControls = this.parent().items();
- return parentControls[parentControls.indexOf(this) + 1];
- },
- prev: function () {
- var parentControls = this.parent().items();
- return parentControls[parentControls.indexOf(this) - 1];
- },
- innerHtml: function (html) {
- this.$el.html(html);
- return this;
- },
- getEl: function (suffix) {
- var id = suffix ? this._id + '-' + suffix : this._id;
- if (!this._elmCache[id]) {
- this._elmCache[id] = global$7('#' + id)[0];
- }
- return this._elmCache[id];
- },
- show: function () {
- return this.visible(true);
- },
- hide: function () {
- return this.visible(false);
- },
- focus: function () {
- try {
- this.getEl().focus();
- } catch (ex) {
- }
- return this;
- },
- blur: function () {
- this.getEl().blur();
- return this;
- },
- aria: function (name$$1, value) {
- var self$$1 = this, elm = self$$1.getEl(self$$1.ariaTarget);
- if (typeof value === 'undefined') {
- return self$$1._aria[name$$1];
- }
- self$$1._aria[name$$1] = value;
- if (self$$1.state.get('rendered')) {
- elm.setAttribute(name$$1 === 'role' ? name$$1 : 'aria-' + name$$1, value);
- }
- return self$$1;
- },
- encode: function (text, translate) {
- if (translate !== false) {
- text = this.translate(text);
- }
- return (text || '').replace(/[&<>"]/g, function (match) {
- return '&#' + match.charCodeAt(0) + ';';
- });
- },
- translate: function (text) {
- return Control.translate ? Control.translate(text) : text;
- },
- before: function (items) {
- var self$$1 = this, parent$$1 = self$$1.parent();
- if (parent$$1) {
- parent$$1.insert(items, parent$$1.items().indexOf(self$$1), true);
- }
- return self$$1;
- },
- after: function (items) {
- var self$$1 = this, parent$$1 = self$$1.parent();
- if (parent$$1) {
- parent$$1.insert(items, parent$$1.items().indexOf(self$$1));
- }
- return self$$1;
- },
- remove: function () {
- var self$$1 = this;
- var elm = self$$1.getEl();
- var parent$$1 = self$$1.parent();
- var newItems, i;
- if (self$$1.items) {
- var controls = self$$1.items().toArray();
- i = controls.length;
- while (i--) {
- controls[i].remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ bindPendingEvents(self$$1);
+ if (settings.style) {
+ elm = self$$1.getEl();
+ if (elm) {
+ elm.setAttribute('style', settings.style);
+ elm.style.cssText = settings.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 (parent$$1 && parent$$1.items) {
- newItems = [];
- parent$$1.items().each(function (item) {
- if (item !== self$$1) {
- newItems.push(item);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self$$1.settings.border) {
+ box = self$$1.borderBox;
+ self$$1.$el.css({
+ 'border-top-width': box.top,
+ 'border-right-width': box.right,
+ 'border-bottom-width': box.bottom,
+ 'border-left-width': box.left
+ });
+ }
+ var root = self$$1.getRoot();
+ if (!root.controlIdLookup) {
+ root.controlIdLookup = {};
+ }
+ root.controlIdLookup[self$$1._id] = self$$1;
+ for (var key in self$$1._aria) {
+ self$$1.aria(key, self$$1._aria[key]);
+ }
+ if (self$$1.state.get('visible') === false) {
+ self$$1.getEl().style.display = 'none';
+ }
+ self$$1.bindStates();
+ self$$1.state.on('change:visible', function (e) {
+ var state = e.value;
+ var parentCtrl;
+ if (self$$1.state.get('rendered')) {
+ self$$1.getEl().style.display = state === false ? 'none' : '';
+ self$$1.getEl().getBoundingClientRect();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parentCtrl = self$$1.parent();
+ if (parentCtrl) {
+ parentCtrl._lastRect = null;
+ }
+ self$$1.fire(state ? 'show' : 'hide');
+ ReflowQueue.add(self$$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">- parent$$1.items().set(newItems);
- parent$$1._lastRect = null;
- }
- if (self$$1._eventsRoot && self$$1._eventsRoot === self$$1) {
- global$7(elm).off();
- }
- var lookup = self$$1.getRoot().controlIdLookup;
- if (lookup) {
- delete lookup[self$$1._id];
- }
- if (elm && elm.parentNode) {
- elm.parentNode.removeChild(elm);
- }
- self$$1.state.set('rendered', false);
- self$$1.state.destroy();
- self$$1.fire('remove');
- return self$$1;
- },
- renderBefore: function (elm) {
- global$7(elm).before(this.renderHtml());
- this.postRender();
- return this;
- },
- renderTo: function (elm) {
- global$7(elm || this.getContainerElm()).append(this.renderHtml());
- this.postRender();
- return this;
- },
- preRender: function () {
- },
- render: function () {
- },
- renderHtml: function () {
- return '<div id="' + this._id + '" class="' + this.classes + '"></div>';
- },
- postRender: function () {
- var self$$1 = this;
- var settings = self$$1.settings;
- var elm, box, parent$$1, name$$1, parentEventsRoot;
- self$$1.$el = global$7(self$$1.getEl());
- self$$1.state.set('rendered', true);
- for (name$$1 in settings) {
- if (name$$1.indexOf('on') === 0) {
- self$$1.on(name$$1.substr(2), settings[name$$1]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.fire('postrender', {}, false);
+ },
+ bindStates: function () {
+ },
+ scrollIntoView: function (align) {
+ function getOffset(elm, rootElm) {
+ var x, y, parent$$1 = elm;
+ x = y = 0;
+ while (parent$$1 && parent$$1 !== rootElm && parent$$1.nodeType) {
+ x += parent$$1.offsetLeft || 0;
+ y += parent$$1.offsetTop || 0;
+ parent$$1 = parent$$1.offsetParent;
+ }
+ return {
+ x: x,
+ y: 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 (self$$1._eventsRoot) {
- for (parent$$1 = self$$1.parent(); !parentEventsRoot && parent$$1; parent$$1 = parent$$1.parent()) {
- parentEventsRoot = parent$$1._eventsRoot;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var elm = this.getEl(), parentElm = elm.parentNode;
+ var x, y, width, height, parentWidth, parentHeight;
+ var pos = getOffset(elm, parentElm);
+ x = pos.x;
+ y = pos.y;
+ width = elm.offsetWidth;
+ height = elm.offsetHeight;
+ parentWidth = parentElm.clientWidth;
+ parentHeight = parentElm.clientHeight;
+ if (align === 'end') {
+ x -= parentWidth - width;
+ y -= parentHeight - height;
+ } else if (align === 'center') {
+ x -= parentWidth / 2 - width / 2;
+ y -= parentHeight / 2 - height / 2;
</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 (parentEventsRoot) {
- for (name$$1 in parentEventsRoot._nativeEvents) {
- self$$1._nativeEvents[name$$1] = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parentElm.scrollLeft = x;
+ parentElm.scrollTop = y;
+ return this;
+ },
+ getRoot: function () {
+ var ctrl = this, rootControl;
+ var parents = [];
+ while (ctrl) {
+ if (ctrl.rootControl) {
+ rootControl = ctrl.rootControl;
+ break;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parents.push(ctrl);
+ rootControl = ctrl;
+ ctrl = ctrl.parent();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- bindPendingEvents(self$$1);
- if (settings.style) {
- elm = self$$1.getEl();
- if (elm) {
- elm.setAttribute('style', settings.style);
- elm.style.cssText = settings.style;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!rootControl) {
+ rootControl = 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">- }
- if (self$$1.settings.border) {
- box = self$$1.borderBox;
- self$$1.$el.css({
- 'border-top-width': box.top,
- 'border-right-width': box.right,
- 'border-bottom-width': box.bottom,
- 'border-left-width': box.left
- });
- }
- var root = self$$1.getRoot();
- if (!root.controlIdLookup) {
- root.controlIdLookup = {};
- }
- root.controlIdLookup[self$$1._id] = self$$1;
- for (var key in self$$1._aria) {
- self$$1.aria(key, self$$1._aria[key]);
- }
- if (self$$1.state.get('visible') === false) {
- self$$1.getEl().style.display = 'none';
- }
- self$$1.bindStates();
- self$$1.state.on('change:visible', function (e) {
- var state = e.value;
- var parentCtrl;
- if (self$$1.state.get('rendered')) {
- self$$1.getEl().style.display = state === false ? 'none' : '';
- self$$1.getEl().getBoundingClientRect();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var i = parents.length;
+ while (i--) {
+ parents[i].rootControl = rootControl;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- parentCtrl = self$$1.parent();
- if (parentCtrl) {
- parentCtrl._lastRect = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return rootControl;
+ },
+ reflow: function () {
+ ReflowQueue.remove(this);
+ var parent$$1 = this.parent();
+ if (parent$$1 && parent$$1._layout && !parent$$1._layout.isNative()) {
+ parent$$1.reflow();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.fire(state ? 'show' : 'hide');
- $_cqjgb518wjjgwek2f.add(self$$1);
- });
- self$$1.fire('postrender', {}, false);
- },
- bindStates: function () {
- },
- scrollIntoView: function (align) {
- function getOffset(elm, rootElm) {
- var x, y, parent$$1 = elm;
- x = y = 0;
- while (parent$$1 && parent$$1 !== rootElm && parent$$1.nodeType) {
- x += parent$$1.offsetLeft || 0;
- y += parent$$1.offsetTop || 0;
- parent$$1 = parent$$1.offsetParent;
- }
- return {
- x: x,
- y: y
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- var elm = this.getEl(), parentElm = elm.parentNode;
- var x, y, width, height, parentWidth, parentHeight;
- var pos = getOffset(elm, parentElm);
- x = pos.x;
- y = pos.y;
- width = elm.offsetWidth;
- height = elm.offsetHeight;
- parentWidth = parentElm.clientWidth;
- parentHeight = parentElm.clientHeight;
- if (align === 'end') {
- x -= parentWidth - width;
- y -= parentHeight - height;
- } else if (align === 'center') {
- x -= parentWidth / 2 - width / 2;
- y -= parentHeight / 2 - height / 2;
- }
- parentElm.scrollLeft = x;
- parentElm.scrollTop = y;
- return this;
- },
- getRoot: function () {
- var ctrl = this, rootControl;
- var parents = [];
- while (ctrl) {
- if (ctrl.rootControl) {
- rootControl = ctrl.rootControl;
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ global$4.each('text title visible disabled active value'.split(' '), function (name$$1) {
+ proto$1[name$$1] = function (value) {
+ if (arguments.length === 0) {
+ return this.state.get(name$$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">- parents.push(ctrl);
- rootControl = ctrl;
- ctrl = ctrl.parent();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (typeof value !== 'undefined') {
+ this.state.set(name$$1, value);
+ }
+ return this;
+ };
+ });
+ Control = global$8.extend(proto$1);
+ function getEventDispatcher(obj) {
+ if (!obj._eventDispatcher) {
+ obj._eventDispatcher = new global$9({
+ scope: obj,
+ toggleEvent: function (name$$1, state) {
+ if (state && global$9.isNative(name$$1)) {
+ if (!obj._nativeEvents) {
+ obj._nativeEvents = {};
+ }
+ obj._nativeEvents[name$$1] = true;
+ if (obj.state.get('rendered')) {
+ bindPendingEvents(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">- if (!rootControl) {
- rootControl = this;
- }
- var i = parents.length;
- while (i--) {
- parents[i].rootControl = rootControl;
- }
- return rootControl;
- },
- reflow: function () {
- $_cqjgb518wjjgwek2f.remove(this);
- var parent$$1 = this.parent();
- if (parent$$1 && parent$$1._layout && !parent$$1._layout.isNative()) {
- parent$$1.reflow();
- }
- return this;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return obj._eventDispatcher;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- global$4.each('text title visible disabled active value'.split(' '), function (name$$1) {
- proto$1[name$$1] = function (value) {
- if (arguments.length === 0) {
- return this.state.get(name$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function bindPendingEvents(eventCtrl) {
+ var i, l, parents, eventRootCtrl, nativeEvents, name$$1;
+ function delegate(e) {
+ var control = eventCtrl.getParentCtrl(e.target);
+ if (control) {
+ control.fire(e.type, 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">- if (typeof value !== 'undefined') {
- this.state.set(name$$1, value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function mouseLeaveHandler() {
+ var ctrl = eventRootCtrl._lastHoverCtrl;
+ if (ctrl) {
+ ctrl.fire('mouseleave', { target: ctrl.getEl() });
+ ctrl.parents().each(function (ctrl) {
+ ctrl.fire('mouseleave', { target: ctrl.getEl() });
+ });
+ eventRootCtrl._lastHoverCtrl = null;
+ }
</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 this;
- };
- });
- Control = global$8.extend(proto$1);
- function getEventDispatcher(obj) {
- if (!obj._eventDispatcher) {
- obj._eventDispatcher = new global$9({
- scope: obj,
- toggleEvent: function (name$$1, state) {
- if (state && global$9.isNative(name$$1)) {
- if (!obj._nativeEvents) {
- obj._nativeEvents = {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function mouseEnterHandler(e) {
+ var ctrl = eventCtrl.getParentCtrl(e.target), lastCtrl = eventRootCtrl._lastHoverCtrl, idx = 0, i, parents, lastParents;
+ if (ctrl !== lastCtrl) {
+ eventRootCtrl._lastHoverCtrl = ctrl;
+ parents = ctrl.parents().toArray().reverse();
+ parents.push(ctrl);
+ if (lastCtrl) {
+ lastParents = lastCtrl.parents().toArray().reverse();
+ lastParents.push(lastCtrl);
+ for (idx = 0; idx < lastParents.length; idx++) {
+ if (parents[idx] !== lastParents[idx]) {
+ break;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- obj._nativeEvents[name$$1] = true;
- if (obj.state.get('rendered')) {
- bindPendingEvents(obj);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (i = lastParents.length - 1; i >= idx; i--) {
+ lastCtrl = lastParents[i];
+ lastCtrl.fire('mouseleave', { target: lastCtrl.getEl() });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (i = idx; i < parents.length; i++) {
+ ctrl = parents[i];
+ ctrl.fire('mouseenter', { target: ctrl.getEl() });
+ }
</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._eventDispatcher;
- }
- function bindPendingEvents(eventCtrl) {
- var i, l, parents, eventRootCtrl, nativeEvents, name$$1;
- function delegate(e) {
- var control = eventCtrl.getParentCtrl(e.target);
- if (control) {
- control.fire(e.type, e);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- function mouseLeaveHandler() {
- var ctrl = eventRootCtrl._lastHoverCtrl;
- if (ctrl) {
- ctrl.fire('mouseleave', { target: ctrl.getEl() });
- ctrl.parents().each(function (ctrl) {
- ctrl.fire('mouseleave', { target: ctrl.getEl() });
- });
- eventRootCtrl._lastHoverCtrl = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function fixWheelEvent(e) {
+ e.preventDefault();
+ if (e.type === 'mousewheel') {
+ e.deltaY = -1 / 40 * e.wheelDelta;
+ if (e.wheelDeltaX) {
+ e.deltaX = -1 / 40 * e.wheelDeltaX;
+ }
+ } else {
+ e.deltaX = 0;
+ e.deltaY = e.detail;
+ }
+ e = eventCtrl.fire('wheel', 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 mouseEnterHandler(e) {
- var ctrl = eventCtrl.getParentCtrl(e.target), lastCtrl = eventRootCtrl._lastHoverCtrl, idx = 0, i, parents, lastParents;
- if (ctrl !== lastCtrl) {
- eventRootCtrl._lastHoverCtrl = ctrl;
- parents = ctrl.parents().toArray().reverse();
- parents.push(ctrl);
- if (lastCtrl) {
- lastParents = lastCtrl.parents().toArray().reverse();
- lastParents.push(lastCtrl);
- for (idx = 0; idx < lastParents.length; idx++) {
- if (parents[idx] !== lastParents[idx]) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ nativeEvents = eventCtrl._nativeEvents;
+ if (nativeEvents) {
+ parents = eventCtrl.parents().toArray();
+ parents.unshift(eventCtrl);
+ for (i = 0, l = parents.length; !eventRootCtrl && i < l; i++) {
+ eventRootCtrl = parents[i]._eventsRoot;
+ }
+ if (!eventRootCtrl) {
+ eventRootCtrl = parents[parents.length - 1] || eventCtrl;
+ }
+ eventCtrl._eventsRoot = eventRootCtrl;
+ for (l = i, i = 0; i < l; i++) {
+ parents[i]._eventsRoot = eventRootCtrl;
+ }
+ var eventRootDelegates = eventRootCtrl._delegates;
+ if (!eventRootDelegates) {
+ eventRootDelegates = eventRootCtrl._delegates = {};
+ }
+ for (name$$1 in nativeEvents) {
+ if (!nativeEvents) {
+ return false;
+ }
+ if (name$$1 === 'wheel' && !hasWheelEventSupport) {
+ if (hasMouseWheelEventSupport) {
+ global$7(eventCtrl.getEl()).on('mousewheel', fixWheelEvent);
+ } else {
+ global$7(eventCtrl.getEl()).on('DOMMouseScroll', fixWheelEvent);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ continue;
</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 = lastParents.length - 1; i >= idx; i--) {
- lastCtrl = lastParents[i];
- lastCtrl.fire('mouseleave', { target: lastCtrl.getEl() });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (name$$1 === 'mouseenter' || name$$1 === 'mouseleave') {
+ if (!eventRootCtrl._hasMouseEnter) {
+ global$7(eventRootCtrl.getEl()).on('mouseleave', mouseLeaveHandler).on('mouseover', mouseEnterHandler);
+ eventRootCtrl._hasMouseEnter = 1;
+ }
+ } else if (!eventRootDelegates[name$$1]) {
+ global$7(eventRootCtrl.getEl()).on(name$$1, delegate);
+ eventRootDelegates[name$$1] = 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">+ nativeEvents[name$$1] = 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">- for (i = idx; i < parents.length; i++) {
- ctrl = parents[i];
- ctrl.fire('mouseenter', { target: ctrl.getEl() });
- }
</del><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">- function fixWheelEvent(e) {
- e.preventDefault();
- if (e.type === 'mousewheel') {
- e.deltaY = -1 / 40 * e.wheelDelta;
- if (e.wheelDeltaX) {
- e.deltaX = -1 / 40 * e.wheelDeltaX;
- }
- } else {
- e.deltaX = 0;
- e.deltaY = e.detail;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Control$1 = Control;
+
+ var isStatic = function (elm) {
+ return funcs.getRuntimeStyle(elm, 'position') === 'static';
+ };
+ var isFixed = function (ctrl) {
+ return ctrl.state.get('fixed');
+ };
+ function calculateRelativePosition(ctrl, targetElm, rel) {
+ var ctrlElm, pos, x, y, selfW, selfH, targetW, targetH, viewport, size;
+ viewport = getWindowViewPort();
+ pos = funcs.getPos(targetElm, UiContainer.getUiContainer(ctrl));
+ x = pos.x;
+ y = pos.y;
+ if (isFixed(ctrl) && isStatic(document.body)) {
+ x -= viewport.x;
+ y -= viewport.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">- e = eventCtrl.fire('wheel', e);
- }
- nativeEvents = eventCtrl._nativeEvents;
- if (nativeEvents) {
- parents = eventCtrl.parents().toArray();
- parents.unshift(eventCtrl);
- for (i = 0, l = parents.length; !eventRootCtrl && i < l; i++) {
- eventRootCtrl = parents[i]._eventsRoot;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ctrlElm = ctrl.getEl();
+ size = funcs.getSize(ctrlElm);
+ selfW = size.width;
+ selfH = size.height;
+ size = funcs.getSize(targetElm);
+ targetW = size.width;
+ targetH = size.height;
+ rel = (rel || '').split('');
+ if (rel[0] === 'b') {
+ y += targetH;
</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 (!eventRootCtrl) {
- eventRootCtrl = parents[parents.length - 1] || eventCtrl;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rel[1] === 'r') {
+ x += targetW;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- eventCtrl._eventsRoot = eventRootCtrl;
- for (l = i, i = 0; i < l; i++) {
- parents[i]._eventsRoot = eventRootCtrl;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rel[0] === 'c') {
+ y += Math.round(targetH / 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">- var eventRootDelegates = eventRootCtrl._delegates;
- if (!eventRootDelegates) {
- eventRootDelegates = eventRootCtrl._delegates = {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rel[1] === 'c') {
+ x += Math.round(targetW / 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">- for (name$$1 in nativeEvents) {
- if (!nativeEvents) {
- return false;
- }
- if (name$$1 === 'wheel' && !hasWheelEventSupport) {
- if (hasMouseWheelEventSupport) {
- global$7(eventCtrl.getEl()).on('mousewheel', fixWheelEvent);
- } else {
- global$7(eventCtrl.getEl()).on('DOMMouseScroll', fixWheelEvent);
- }
- continue;
- }
- if (name$$1 === 'mouseenter' || name$$1 === 'mouseleave') {
- if (!eventRootCtrl._hasMouseEnter) {
- global$7(eventRootCtrl.getEl()).on('mouseleave', mouseLeaveHandler).on('mouseover', mouseEnterHandler);
- eventRootCtrl._hasMouseEnter = 1;
- }
- } else if (!eventRootDelegates[name$$1]) {
- global$7(eventRootCtrl.getEl()).on(name$$1, delegate);
- eventRootDelegates[name$$1] = true;
- }
- nativeEvents[name$$1] = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rel[3] === 'b') {
+ y -= selfH;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rel[4] === 'r') {
+ x -= selfW;
+ }
+ if (rel[3] === 'c') {
+ y -= Math.round(selfH / 2);
+ }
+ if (rel[4] === 'c') {
+ x -= Math.round(selfW / 2);
+ }
+ return {
+ x: x,
+ y: y,
+ w: selfW,
+ h: selfH
+ };
</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 Control$1 = Control;
-
- var isStatic = function (elm) {
- return funcs.getRuntimeStyle(elm, 'position') === 'static';
- };
- var isFixed = function (ctrl) {
- return ctrl.state.get('fixed');
- };
- function calculateRelativePosition(ctrl, targetElm, rel) {
- var ctrlElm, pos, x, y, selfW, selfH, targetW, targetH, viewport, size;
- viewport = getWindowViewPort();
- pos = funcs.getPos(targetElm, $_egt6ye18xjjgwek2h.getUiContainer(ctrl));
- x = pos.x;
- y = pos.y;
- if (isFixed(ctrl) && isStatic(document.body)) {
- x -= viewport.x;
- y -= viewport.y;
- }
- ctrlElm = ctrl.getEl();
- size = funcs.getSize(ctrlElm);
- selfW = size.width;
- selfH = size.height;
- size = funcs.getSize(targetElm);
- targetW = size.width;
- targetH = size.height;
- rel = (rel || '').split('');
- if (rel[0] === 'b') {
- y += targetH;
- }
- if (rel[1] === 'r') {
- x += targetW;
- }
- if (rel[0] === 'c') {
- y += Math.round(targetH / 2);
- }
- if (rel[1] === 'c') {
- x += Math.round(targetW / 2);
- }
- if (rel[3] === 'b') {
- y -= selfH;
- }
- if (rel[4] === 'r') {
- x -= selfW;
- }
- if (rel[3] === 'c') {
- y -= Math.round(selfH / 2);
- }
- if (rel[4] === 'c') {
- x -= Math.round(selfW / 2);
- }
- return {
- x: x,
- y: y,
- w: selfW,
- h: selfH
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getUiContainerViewPort = function (customUiContainer) {
+ return {
+ x: 0,
+ y: 0,
+ w: customUiContainer.scrollWidth - 1,
+ h: customUiContainer.scrollHeight - 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">- }
- var getUiContainerViewPort = function (customUiContainer) {
- return {
- x: 0,
- y: 0,
- w: customUiContainer.scrollWidth - 1,
- h: customUiContainer.scrollHeight - 1
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getWindowViewPort = function () {
+ var win = window;
+ var x = Math.max(win.pageXOffset, document.body.scrollLeft, document.documentElement.scrollLeft);
+ var y = Math.max(win.pageYOffset, document.body.scrollTop, document.documentElement.scrollTop);
+ var w = win.innerWidth || document.documentElement.clientWidth;
+ var h = win.innerHeight || document.documentElement.clientHeight;
+ return {
+ x: x,
+ y: y,
+ 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">- };
- var getWindowViewPort = function () {
- var win = window;
- var x = Math.max(win.pageXOffset, document.body.scrollLeft, document.documentElement.scrollLeft);
- var y = Math.max(win.pageYOffset, document.body.scrollTop, document.documentElement.scrollTop);
- var w = win.innerWidth || document.documentElement.clientWidth;
- var h = win.innerHeight || document.documentElement.clientHeight;
- return {
- x: x,
- y: y,
- w: x + w,
- h: y + h
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getViewPortRect = function (ctrl) {
+ var customUiContainer = UiContainer.getUiContainer(ctrl);
+ return customUiContainer && !isFixed(ctrl) ? getUiContainerViewPort(customUiContainer) : getWindowViewPort();
</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 getViewPortRect = function (ctrl) {
- var customUiContainer = $_egt6ye18xjjgwek2h.getUiContainer(ctrl);
- return customUiContainer && !isFixed(ctrl) ? getUiContainerViewPort(customUiContainer) : getWindowViewPort();
- };
- var $_8zu82i18yjjgwek2l = {
- testMoveRel: function (elm, rels) {
- var viewPortRect = getViewPortRect(this);
- for (var i = 0; i < rels.length; i++) {
- var pos = calculateRelativePosition(this, elm, rels[i]);
- if (isFixed(this)) {
- if (pos.x > 0 && pos.x + pos.w < viewPortRect.w && pos.y > 0 && pos.y + pos.h < viewPortRect.h) {
- return rels[i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Movable = {
+ testMoveRel: function (elm, rels) {
+ var viewPortRect = getViewPortRect(this);
+ for (var i = 0; i < rels.length; i++) {
+ var pos = calculateRelativePosition(this, elm, rels[i]);
+ if (isFixed(this)) {
+ if (pos.x > 0 && pos.x + pos.w < viewPortRect.w && pos.y > 0 && pos.y + pos.h < viewPortRect.h) {
+ return rels[i];
+ }
+ } else {
+ if (pos.x > viewPortRect.x && pos.x + pos.w < viewPortRect.w + viewPortRect.x && pos.y > viewPortRect.y && pos.y + pos.h < viewPortRect.h + viewPortRect.y) {
+ return rels[i];
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- if (pos.x > viewPortRect.x && pos.x + pos.w < viewPortRect.w && pos.y > viewPortRect.y && pos.y + pos.h < viewPortRect.h) {
- return rels[i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ return rels[0];
+ },
+ moveRel: function (elm, rel) {
+ if (typeof rel !== 'string') {
+ rel = this.testMoveRel(elm, rel);
+ }
+ var pos = calculateRelativePosition(this, elm, rel);
+ return this.moveTo(pos.x, pos.y);
+ },
+ moveBy: function (dx, dy) {
+ var self$$1 = this, rect = self$$1.layoutRect();
+ self$$1.moveTo(rect.x + dx, rect.y + dy);
+ return self$$1;
+ },
+ moveTo: function (x, y) {
+ var self$$1 = this;
+ function constrain(value, max, size) {
+ if (value < 0) {
+ return 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (value + size > max) {
+ value = max - size;
+ return value < 0 ? 0 : value;
+ }
+ 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">- }
- return rels[0];
- },
- moveRel: function (elm, rel) {
- if (typeof rel !== 'string') {
- rel = this.testMoveRel(elm, rel);
- }
- var pos = calculateRelativePosition(this, elm, rel);
- return this.moveTo(pos.x, pos.y);
- },
- moveBy: function (dx, dy) {
- var self$$1 = this, rect = self$$1.layoutRect();
- self$$1.moveTo(rect.x + dx, rect.y + dy);
- return self$$1;
- },
- moveTo: function (x, y) {
- var self$$1 = this;
- function constrain(value, max, size) {
- if (value < 0) {
- return 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self$$1.settings.constrainToViewport) {
+ var viewPortRect = getViewPortRect(this);
+ var layoutRect = self$$1.layoutRect();
+ x = constrain(x, viewPortRect.w + viewPortRect.x, layoutRect.w);
+ y = constrain(y, viewPortRect.h + viewPortRect.y, layoutRect.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">- if (value + size > max) {
- value = max - size;
- return value < 0 ? 0 : value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var uiContainer = UiContainer.getUiContainer(self$$1);
+ if (uiContainer && isStatic(uiContainer) && !isFixed(self$$1)) {
+ x -= uiContainer.scrollLeft;
+ y -= uiContainer.scrollTop;
</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;
- }
- if (self$$1.settings.constrainToViewport) {
- var viewPortRect = getViewPortRect(this);
- var layoutRect = self$$1.layoutRect();
- x = constrain(x, viewPortRect.w, layoutRect.w);
- y = constrain(y, viewPortRect.h, layoutRect.h);
- }
- var uiContainer = $_egt6ye18xjjgwek2h.getUiContainer(self$$1);
- if (uiContainer && isStatic(uiContainer) && !isFixed(self$$1)) {
- x -= uiContainer.scrollLeft;
- y -= uiContainer.scrollTop;
- }
- if (uiContainer) {
- x += 1;
- y += 1;
- }
- if (self$$1.state.get('rendered')) {
- self$$1.layoutRect({
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (uiContainer) {
+ x += 1;
+ y += 1;
+ }
+ if (self$$1.state.get('rendered')) {
+ self$$1.layoutRect({
+ x: x,
+ y: y
+ }).repaint();
+ } else {
+ self$$1.settings.x = x;
+ self$$1.settings.y = y;
+ }
+ self$$1.fire('move', {
</ins><span class="cx" style="display: block; padding: 0 10px"> x: x,
</span><span class="cx" style="display: block; padding: 0 10px"> y: y
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }).repaint();
- } else {
- self$$1.settings.x = x;
- self$$1.settings.y = y;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ return self$$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">- self$$1.fire('move', {
- x: x,
- y: y
- });
- return self$$1;
- }
- };
</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">- var Tooltip = Control$1.extend({
- Mixins: [$_8zu82i18yjjgwek2l],
- Defaults: { classes: 'widget tooltip tooltip-n' },
- renderHtml: function () {
- var self = this, prefix = self.classPrefix;
- return '<div id="' + self._id + '" class="' + self.classes + '" role="presentation">' + '<div class="' + prefix + 'tooltip-arrow"></div>' + '<div class="' + prefix + 'tooltip-inner">' + self.encode(self.state.get('text')) + '</div>' + '</div>';
- },
- bindStates: function () {
- var self = this;
- self.state.on('change:text', function (e) {
- self.getEl().lastChild.innerHTML = self.encode(e.value);
- });
- return self._super();
- },
- repaint: function () {
- var self = this;
- var style, rect;
- style = self.getEl().style;
- rect = self._layoutRect;
- style.left = rect.x + 'px';
- style.top = rect.y + 'px';
- style.zIndex = 65535 + 65535;
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Tooltip = Control$1.extend({
+ Mixins: [Movable],
+ Defaults: { classes: 'widget tooltip tooltip-n' },
+ renderHtml: function () {
+ var self = this, prefix = self.classPrefix;
+ return '<div id="' + self._id + '" class="' + self.classes + '" role="presentation">' + '<div class="' + prefix + 'tooltip-arrow"></div>' + '<div class="' + prefix + 'tooltip-inner">' + self.encode(self.state.get('text')) + '</div>' + '</div>';
+ },
+ bindStates: function () {
+ var self = this;
+ self.state.on('change:text', function (e) {
+ self.getEl().lastChild.innerHTML = self.encode(e.value);
+ });
+ return self._super();
+ },
+ repaint: function () {
+ var self = this;
+ var style, rect;
+ style = self.getEl().style;
+ rect = self._layoutRect;
+ style.left = rect.x + 'px';
+ style.top = rect.y + 'px';
+ style.zIndex = 65535 + 65535;
+ }
+ });
</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 Widget = Control$1.extend({
- init: function (settings) {
- var self = this;
- self._super(settings);
- settings = self.settings;
- self.canFocus = true;
- if (settings.tooltip && Widget.tooltips !== false) {
- self.on('mouseenter', function (e) {
- var tooltip = self.tooltip().moveTo(-65535);
- if (e.control === self) {
- var rel = tooltip.text(settings.tooltip).show().testMoveRel(self.getEl(), [
- 'bc-tc',
- 'bc-tl',
- 'bc-tr'
- ]);
- tooltip.classes.toggle('tooltip-n', rel === 'bc-tc');
- tooltip.classes.toggle('tooltip-nw', rel === 'bc-tl');
- tooltip.classes.toggle('tooltip-ne', rel === 'bc-tr');
- tooltip.moveRel(self.getEl(), rel);
- } else {
- tooltip.hide();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Widget = Control$1.extend({
+ init: function (settings) {
+ var self = this;
+ self._super(settings);
+ settings = self.settings;
+ self.canFocus = true;
+ if (settings.tooltip && Widget.tooltips !== false) {
+ self.on('mouseenter', function (e) {
+ var tooltip = self.tooltip().moveTo(-65535);
+ if (e.control === self) {
+ var rel = tooltip.text(settings.tooltip).show().testMoveRel(self.getEl(), [
+ 'bc-tc',
+ 'bc-tl',
+ 'bc-tr'
+ ]);
+ tooltip.classes.toggle('tooltip-n', rel === 'bc-tc');
+ tooltip.classes.toggle('tooltip-nw', rel === 'bc-tl');
+ tooltip.classes.toggle('tooltip-ne', rel === 'bc-tr');
+ tooltip.moveRel(self.getEl(), rel);
+ } else {
+ tooltip.hide();
+ }
+ });
+ self.on('mouseleave mousedown click', function () {
+ self.tooltip().remove();
+ self._tooltip = null;
+ });
+ }
+ self.aria('label', settings.ariaLabel || settings.tooltip);
+ },
+ tooltip: function () {
+ if (!this._tooltip) {
+ this._tooltip = new Tooltip({ type: 'tooltip' });
+ UiContainer.inheritUiContainer(this, this._tooltip);
+ this._tooltip.renderTo();
+ }
+ return this._tooltip;
+ },
+ postRender: function () {
+ var self = this, settings = self.settings;
+ self._super();
+ if (!self.parent() && (settings.width || settings.height)) {
+ self.initLayoutRect();
+ self.repaint();
+ }
+ if (settings.autofocus) {
+ self.focus();
+ }
+ },
+ bindStates: function () {
+ var self = this;
+ function disable(state) {
+ self.aria('disabled', state);
+ self.classes.toggle('disabled', state);
+ }
+ function active(state) {
+ self.aria('pressed', state);
+ self.classes.toggle('active', state);
+ }
+ self.state.on('change:disabled', function (e) {
+ disable(e.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">- self.on('mouseleave mousedown click', function () {
- self.tooltip().remove();
- self._tooltip = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.state.on('change:active', function (e) {
+ active(e.value);
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self.state.get('disabled')) {
+ disable(true);
+ }
+ if (self.state.get('active')) {
+ active(true);
+ }
+ return self._super();
+ },
+ remove: function () {
+ this._super();
+ if (this._tooltip) {
+ this._tooltip.remove();
+ this._tooltip = 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">- self.aria('label', settings.ariaLabel || settings.tooltip);
- },
- tooltip: function () {
- if (!this._tooltip) {
- this._tooltip = new Tooltip({ type: 'tooltip' });
- $_egt6ye18xjjgwek2h.inheritUiContainer(this, this._tooltip);
- this._tooltip.renderTo();
- }
- return this._tooltip;
- },
- postRender: function () {
- var self = this, settings = self.settings;
- self._super();
- if (!self.parent() && (settings.width || settings.height)) {
- self.initLayoutRect();
- self.repaint();
- }
- if (settings.autofocus) {
- self.focus();
- }
- },
- bindStates: function () {
- var self = this;
- function disable(state) {
- self.aria('disabled', state);
- self.classes.toggle('disabled', state);
- }
- function active(state) {
- self.aria('pressed', state);
- self.classes.toggle('active', state);
- }
- self.state.on('change:disabled', function (e) {
- disable(e.value);
- });
- self.state.on('change:active', function (e) {
- active(e.value);
- });
- if (self.state.get('disabled')) {
- disable(true);
- }
- if (self.state.get('active')) {
- active(true);
- }
- return self._super();
- },
- remove: function () {
- this._super();
- if (this._tooltip) {
- this._tooltip.remove();
- this._tooltip = null;
- }
- }
- });
</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">- var Progress = Widget.extend({
- Defaults: { value: 0 },
- init: function (settings) {
- var self = this;
- self._super(settings);
- self.classes.add('progress');
- if (!self.settings.filter) {
- self.settings.filter = function (value) {
- return Math.round(value);
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Progress = Widget.extend({
+ Defaults: { value: 0 },
+ init: function (settings) {
+ var self = this;
+ self._super(settings);
+ self.classes.add('progress');
+ if (!self.settings.filter) {
+ self.settings.filter = function (value) {
+ return Math.round(value);
+ };
+ }
+ },
+ renderHtml: function () {
+ var self = this, id = self._id, prefix = this.classPrefix;
+ return '<div id="' + id + '" class="' + self.classes + '">' + '<div class="' + prefix + 'bar-container">' + '<div class="' + prefix + 'bar"></div>' + '</div>' + '<div class="' + prefix + 'text">0%</div>' + '</div>';
+ },
+ postRender: function () {
+ var self = this;
+ self._super();
+ self.value(self.settings.value);
+ return self;
+ },
+ bindStates: function () {
+ var self = this;
+ function setValue(value) {
+ value = self.settings.filter(value);
+ self.getEl().lastChild.innerHTML = value + '%';
+ self.getEl().firstChild.firstChild.style.width = value + '%';
+ }
+ self.state.on('change:value', function (e) {
+ setValue(e.value);
+ });
+ setValue(self.state.get('value'));
+ return self._super();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- },
- renderHtml: function () {
- var self = this, id = self._id, prefix = this.classPrefix;
- return '<div id="' + id + '" class="' + self.classes + '">' + '<div class="' + prefix + 'bar-container">' + '<div class="' + prefix + 'bar"></div>' + '</div>' + '<div class="' + prefix + 'text">0%</div>' + '</div>';
- },
- postRender: function () {
- var self = this;
- self._super();
- self.value(self.settings.value);
- return self;
- },
- bindStates: function () {
- var self = this;
- function setValue(value) {
- value = self.settings.filter(value);
- self.getEl().lastChild.innerHTML = value + '%';
- self.getEl().firstChild.firstChild.style.width = value + '%';
- }
- self.state.on('change:value', function (e) {
- setValue(e.value);
- });
- setValue(self.state.get('value'));
- return self._super();
- }
- });
</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">- var updateLiveRegion = function (ctx, text) {
- ctx.getEl().lastChild.textContent = text + (ctx.progressBar ? ' ' + ctx.progressBar.value() + '%' : '');
- };
- var Notification = Control$1.extend({
- Mixins: [$_8zu82i18yjjgwek2l],
- Defaults: { classes: 'widget notification' },
- init: function (settings) {
- var self = this;
- self._super(settings);
- self.maxWidth = settings.maxWidth;
- if (settings.text) {
- self.text(settings.text);
- }
- if (settings.icon) {
- self.icon = settings.icon;
- }
- if (settings.color) {
- self.color = settings.color;
- }
- if (settings.type) {
- self.classes.add('notification-' + settings.type);
- }
- if (settings.timeout && (settings.timeout < 0 || settings.timeout > 0) && !settings.closeButton) {
- self.closeButton = false;
- } else {
- self.classes.add('has-close');
- self.closeButton = true;
- }
- if (settings.progressBar) {
- self.progressBar = new Progress();
- }
- self.on('click', function (e) {
- if (e.target.className.indexOf(self.classPrefix + 'close') !== -1) {
- self.close();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var updateLiveRegion = function (ctx, text) {
+ ctx.getEl().lastChild.textContent = text + (ctx.progressBar ? ' ' + ctx.progressBar.value() + '%' : '');
+ };
+ var Notification = Control$1.extend({
+ Mixins: [Movable],
+ Defaults: { classes: 'widget notification' },
+ init: function (settings) {
+ var self = this;
+ self._super(settings);
+ self.maxWidth = settings.maxWidth;
+ if (settings.text) {
+ self.text(settings.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">- });
- },
- renderHtml: function () {
- var self = this;
- var prefix = self.classPrefix;
- var icon = '', closeButton = '', progressBar = '', notificationStyle = '';
- if (self.icon) {
- icon = '<i class="' + prefix + 'ico' + ' ' + prefix + 'i-' + self.icon + '"></i>';
- }
- notificationStyle = ' style="max-width: ' + self.maxWidth + 'px;' + (self.color ? 'background-color: ' + self.color + ';"' : '"');
- if (self.closeButton) {
- closeButton = '<button type="button" class="' + prefix + 'close" aria-hidden="true">\xD7</button>';
- }
- if (self.progressBar) {
- progressBar = self.progressBar.renderHtml();
- }
- return '<div id="' + self._id + '" class="' + self.classes + '"' + notificationStyle + ' role="presentation">' + icon + '<div class="' + prefix + 'notification-inner">' + self.state.get('text') + '</div>' + progressBar + closeButton + '<div style="clip: rect(1px, 1px, 1px, 1px);height: 1px;overflow: hidden;position: absolute;width: 1px;"' + ' aria-live="assertive" aria-relevant="additions" aria-atomic="true"></div>' + '</div>';
- },
- postRender: function () {
- var self = this;
- global$3.setTimeout(function () {
- self.$el.addClass(self.classPrefix + 'in');
- updateLiveRegion(self, self.state.get('text'));
- }, 100);
- return self._super();
- },
- bindStates: function () {
- var self = this;
- self.state.on('change:text', function (e) {
- self.getEl().firstChild.innerHTML = e.value;
- updateLiveRegion(self, e.value);
- });
- if (self.progressBar) {
- self.progressBar.bindStates();
- self.progressBar.state.on('change:value', function (e) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (settings.icon) {
+ self.icon = settings.icon;
+ }
+ if (settings.color) {
+ self.color = settings.color;
+ }
+ if (settings.type) {
+ self.classes.add('notification-' + settings.type);
+ }
+ if (settings.timeout && (settings.timeout < 0 || settings.timeout > 0) && !settings.closeButton) {
+ self.closeButton = false;
+ } else {
+ self.classes.add('has-close');
+ self.closeButton = true;
+ }
+ if (settings.progressBar) {
+ self.progressBar = new Progress();
+ }
+ self.on('click', function (e) {
+ if (e.target.className.indexOf(self.classPrefix + 'close') !== -1) {
+ self.close();
+ }
+ });
+ },
+ renderHtml: function () {
+ var self = this;
+ var prefix = self.classPrefix;
+ var icon = '', closeButton = '', progressBar = '', notificationStyle = '';
+ if (self.icon) {
+ icon = '<i class="' + prefix + 'ico' + ' ' + prefix + 'i-' + self.icon + '"></i>';
+ }
+ notificationStyle = ' style="max-width: ' + self.maxWidth + 'px;' + (self.color ? 'background-color: ' + self.color + ';"' : '"');
+ if (self.closeButton) {
+ closeButton = '<button type="button" class="' + prefix + 'close" aria-hidden="true">\xD7</button>';
+ }
+ if (self.progressBar) {
+ progressBar = self.progressBar.renderHtml();
+ }
+ return '<div id="' + self._id + '" class="' + self.classes + '"' + notificationStyle + ' role="presentation">' + icon + '<div class="' + prefix + 'notification-inner">' + self.state.get('text') + '</div>' + progressBar + closeButton + '<div style="clip: rect(1px, 1px, 1px, 1px);height: 1px;overflow: hidden;position: absolute;width: 1px;"' + ' aria-live="assertive" aria-relevant="additions" aria-atomic="true"></div>' + '</div>';
+ },
+ postRender: function () {
+ var self = this;
+ global$3.setTimeout(function () {
+ self.$el.addClass(self.classPrefix + 'in');
</ins><span class="cx" style="display: block; padding: 0 10px"> updateLiveRegion(self, self.state.get('text'));
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }, 100);
+ return self._super();
+ },
+ bindStates: function () {
+ var self = this;
+ self.state.on('change:text', function (e) {
+ self.getEl().firstChild.innerHTML = e.value;
+ updateLiveRegion(self, e.value);
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self.progressBar) {
+ self.progressBar.bindStates();
+ self.progressBar.state.on('change:value', function (e) {
+ updateLiveRegion(self, self.state.get('text'));
+ });
+ }
+ return self._super();
+ },
+ close: function () {
+ var self = this;
+ if (!self.fire('close').isDefaultPrevented()) {
+ self.remove();
+ }
+ return self;
+ },
+ repaint: function () {
+ var self = this;
+ var style, rect;
+ style = self.getEl().style;
+ rect = self._layoutRect;
+ style.left = rect.x + 'px';
+ style.top = rect.y + 'px';
+ style.zIndex = 65535 - 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 self._super();
- },
- close: function () {
- var self = this;
- if (!self.fire('close').isDefaultPrevented()) {
- self.remove();
- }
- return self;
- },
- repaint: function () {
- var self = this;
- var style, rect;
- style = self.getEl().style;
- rect = self._layoutRect;
- style.left = rect.x + 'px';
- style.top = rect.y + 'px';
- style.zIndex = 65535 - 1;
- }
- });
</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">- function NotificationManagerImpl (editor) {
- var getEditorContainer = function (editor) {
- return editor.inline ? editor.getElement() : editor.getContentAreaContainer();
- };
- var getContainerWidth = function () {
- var container = getEditorContainer(editor);
- return funcs.getSize(container).width;
- };
- var prePositionNotifications = function (notifications) {
- each(notifications, function (notification) {
- notification.moveTo(0, 0);
- });
- };
- var positionNotifications = function (notifications) {
- if (notifications.length > 0) {
- var firstItem = notifications.slice(0, 1)[0];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function NotificationManagerImpl (editor) {
+ var getEditorContainer = function (editor) {
+ return editor.inline ? editor.getElement() : editor.getContentAreaContainer();
+ };
+ var getContainerWidth = function () {
</ins><span class="cx" style="display: block; padding: 0 10px"> var container = getEditorContainer(editor);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- firstItem.moveRel(container, 'tc-tc');
- each(notifications, function (notification, index) {
- if (index > 0) {
- notification.moveRel(notifications[index - 1].getEl(), 'bc-tc');
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return funcs.getSize(container).width;
+ };
+ var prePositionNotifications = function (notifications) {
+ each(notifications, function (notification) {
+ notification.moveTo(0, 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">- }
- };
- var reposition = function (notifications) {
- prePositionNotifications(notifications);
- positionNotifications(notifications);
- };
- var open = function (args, closeCallback) {
- var extendedArgs = global$4.extend(args, { maxWidth: getContainerWidth() });
- var notif = new Notification(extendedArgs);
- notif.args = extendedArgs;
- if (extendedArgs.timeout > 0) {
- notif.timer = setTimeout(function () {
- notif.close();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var positionNotifications = function (notifications) {
+ if (notifications.length > 0) {
+ var firstItem = notifications.slice(0, 1)[0];
+ var container = getEditorContainer(editor);
+ firstItem.moveRel(container, 'tc-tc');
+ each(notifications, function (notification, index) {
+ if (index > 0) {
+ notification.moveRel(notifications[index - 1].getEl(), 'bc-tc');
+ }
+ });
+ }
+ };
+ var reposition = function (notifications) {
+ prePositionNotifications(notifications);
+ positionNotifications(notifications);
+ };
+ var open = function (args, closeCallback) {
+ var extendedArgs = global$4.extend(args, { maxWidth: getContainerWidth() });
+ var notif = new Notification(extendedArgs);
+ notif.args = extendedArgs;
+ if (extendedArgs.timeout > 0) {
+ notif.timer = setTimeout(function () {
+ notif.close();
+ closeCallback();
+ }, extendedArgs.timeout);
+ }
+ notif.on('close', function () {
</ins><span class="cx" style="display: block; padding: 0 10px"> closeCallback();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }, extendedArgs.timeout);
- }
- notif.on('close', function () {
- closeCallback();
- });
- notif.renderTo();
- return notif;
- };
- var close = function (notification) {
- notification.close();
- };
- var getArgs = function (notification) {
- return notification.args;
- };
- return {
- open: open,
- close: close,
- reposition: reposition,
- getArgs: getArgs
- };
- }
-
- function getDocumentSize(doc) {
- var documentElement, body, scrollWidth, clientWidth;
- var offsetWidth, scrollHeight, clientHeight, offsetHeight;
- var max = Math.max;
- documentElement = doc.documentElement;
- body = doc.body;
- scrollWidth = max(documentElement.scrollWidth, body.scrollWidth);
- clientWidth = max(documentElement.clientWidth, body.clientWidth);
- offsetWidth = max(documentElement.offsetWidth, body.offsetWidth);
- scrollHeight = max(documentElement.scrollHeight, body.scrollHeight);
- clientHeight = max(documentElement.clientHeight, body.clientHeight);
- offsetHeight = max(documentElement.offsetHeight, body.offsetHeight);
- return {
- width: scrollWidth < offsetWidth ? clientWidth : scrollWidth,
- height: scrollHeight < offsetHeight ? clientHeight : scrollHeight
- };
- }
- function updateWithTouchData(e) {
- var keys, i;
- if (e.changedTouches) {
- keys = 'screenX screenY pageX pageY clientX clientY'.split(' ');
- for (i = 0; i < keys.length; i++) {
- e[keys[i]] = e.changedTouches[0][keys[i]];
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ notif.renderTo();
+ return notif;
+ };
+ var close = function (notification) {
+ notification.close();
+ };
+ var getArgs = function (notification) {
+ return notification.args;
+ };
+ return {
+ open: open,
+ close: close,
+ reposition: reposition,
+ getArgs: getArgs
+ };
</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 DragHelper (id, settings) {
- var $eventOverlay;
- var doc = settings.document || document;
- var downButton;
- var start, stop$$1, drag, startX, startY;
- settings = settings || {};
- var handleElement = doc.getElementById(settings.handle || id);
- start = function (e) {
- var docSize = getDocumentSize(doc);
- var handleElm, cursor;
- updateWithTouchData(e);
- e.preventDefault();
- downButton = e.button;
- handleElm = handleElement;
- startX = e.screenX;
- startY = e.screenY;
- if (window.getComputedStyle) {
- cursor = window.getComputedStyle(handleElm, null).getPropertyValue('cursor');
- } else {
- cursor = handleElm.runtimeStyle.cursor;
- }
- $eventOverlay = global$7('<div></div>').css({
- position: 'absolute',
- top: 0,
- left: 0,
- width: docSize.width,
- height: docSize.height,
- zIndex: 2147483647,
- opacity: 0.0001,
- cursor: cursor
- }).appendTo(doc.body);
- global$7(doc).on('mousemove touchmove', drag).on('mouseup touchend', stop$$1);
- settings.start(e);
- };
- drag = function (e) {
- updateWithTouchData(e);
- if (e.button !== downButton) {
- return stop$$1(e);
- }
- e.deltaX = e.screenX - startX;
- e.deltaY = e.screenY - startY;
- e.preventDefault();
- settings.drag(e);
- };
- stop$$1 = function (e) {
- updateWithTouchData(e);
- global$7(doc).off('mousemove touchmove', drag).off('mouseup touchend', stop$$1);
- $eventOverlay.remove();
- if (settings.stop) {
- settings.stop(e);
- }
- };
- this.destroy = function () {
- global$7(handleElement).off();
- };
- global$7(handleElement).on('mousedown touchstart', start);
- }
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var global$11 = tinymce.util.Tools.resolve('tinymce.ui.Factory');
-
- var hasTabstopData = function (elm) {
- return elm.getAttribute('data-mce-tabstop') ? true : false;
- };
- function KeyboardNavigation (settings) {
- var root = settings.root;
- var focusedElement, focusedControl;
- function isElement(node) {
- return node && node.nodeType === 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function getDocumentSize(doc) {
+ var documentElement, body, scrollWidth, clientWidth;
+ var offsetWidth, scrollHeight, clientHeight, offsetHeight;
+ var max = Math.max;
+ documentElement = doc.documentElement;
+ body = doc.body;
+ scrollWidth = max(documentElement.scrollWidth, body.scrollWidth);
+ clientWidth = max(documentElement.clientWidth, body.clientWidth);
+ offsetWidth = max(documentElement.offsetWidth, body.offsetWidth);
+ scrollHeight = max(documentElement.scrollHeight, body.scrollHeight);
+ clientHeight = max(documentElement.clientHeight, body.clientHeight);
+ offsetHeight = max(documentElement.offsetHeight, body.offsetHeight);
+ return {
+ width: scrollWidth < offsetWidth ? clientWidth : scrollWidth,
+ height: scrollHeight < offsetHeight ? clientHeight : scrollHeight
+ };
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- try {
- focusedElement = document.activeElement;
- } catch (ex) {
- focusedElement = document.body;
- }
- focusedControl = root.getParentCtrl(focusedElement);
- function getRole(elm) {
- elm = elm || focusedElement;
- if (isElement(elm)) {
- return elm.getAttribute('role');
- }
- return null;
- }
- function getParentRole(elm) {
- var role, parent$$1 = elm || focusedElement;
- while (parent$$1 = parent$$1.parentNode) {
- if (role = getRole(parent$$1)) {
- return role;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function updateWithTouchData(e) {
+ var keys, i;
+ if (e.changedTouches) {
+ keys = 'screenX screenY pageX pageY clientX clientY'.split(' ');
+ for (i = 0; i < keys.length; i++) {
+ e[keys[i]] = e.changedTouches[0][keys[i]];
</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">- function getAriaProp(name$$1) {
- var elm = focusedElement;
- if (isElement(elm)) {
- return elm.getAttribute('aria-' + name$$1);
- }
- }
- function isTextInputElement(elm) {
- var tagName = elm.tagName.toUpperCase();
- return tagName === 'INPUT' || tagName === 'TEXTAREA' || tagName === 'SELECT';
- }
- function canFocus(elm) {
- if (isTextInputElement(elm) && !elm.hidden) {
- return true;
- }
- if (hasTabstopData(elm)) {
- return true;
- }
- if (/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(getRole(elm))) {
- return true;
- }
- return false;
- }
- function getFocusElements(elm) {
- var elements = [];
- function collect(elm) {
- if (elm.nodeType !== 1 || elm.style.display === 'none' || elm.disabled) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function DragHelper (id, settings) {
+ var $eventOverlay;
+ var doc = settings.document || document;
+ var downButton;
+ var start, stop$$1, drag, startX, startY;
+ settings = settings || {};
+ var handleElement = doc.getElementById(settings.handle || id);
+ start = function (e) {
+ var docSize = getDocumentSize(doc);
+ var handleElm, cursor;
+ updateWithTouchData(e);
+ e.preventDefault();
+ downButton = e.button;
+ handleElm = handleElement;
+ startX = e.screenX;
+ startY = e.screenY;
+ if (window.getComputedStyle) {
+ cursor = window.getComputedStyle(handleElm, null).getPropertyValue('cursor');
+ } else {
+ cursor = handleElm.runtimeStyle.cursor;
</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 (canFocus(elm)) {
- elements.push(elm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $eventOverlay = global$7('<div></div>').css({
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ width: docSize.width,
+ height: docSize.height,
+ zIndex: 2147483647,
+ opacity: 0.0001,
+ cursor: cursor
+ }).appendTo(doc.body);
+ global$7(doc).on('mousemove touchmove', drag).on('mouseup touchend', stop$$1);
+ settings.start(e);
+ };
+ drag = function (e) {
+ updateWithTouchData(e);
+ if (e.button !== downButton) {
+ return stop$$1(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">- for (var i = 0; i < elm.childNodes.length; i++) {
- collect(elm.childNodes[i]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ e.deltaX = e.screenX - startX;
+ e.deltaY = e.screenY - startY;
+ e.preventDefault();
+ settings.drag(e);
+ };
+ stop$$1 = function (e) {
+ updateWithTouchData(e);
+ global$7(doc).off('mousemove touchmove', drag).off('mouseup touchend', stop$$1);
+ $eventOverlay.remove();
+ if (settings.stop) {
+ settings.stop(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">- }
- collect(elm || root.getEl());
- return elements;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ this.destroy = function () {
+ global$7(handleElement).off();
+ };
+ global$7(handleElement).on('mousedown touchstart', start);
</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 getNavigationRoot(targetControl) {
- var navigationRoot, controls;
- targetControl = targetControl || focusedControl;
- controls = targetControl.parents().toArray();
- controls.unshift(targetControl);
- for (var i = 0; i < controls.length; i++) {
- navigationRoot = controls[i];
- if (navigationRoot.settings.ariaRoot) {
- break;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var global$b = tinymce.util.Tools.resolve('tinymce.ui.Factory');
+
+ var hasTabstopData = function (elm) {
+ return elm.getAttribute('data-mce-tabstop') ? true : false;
+ };
+ function KeyboardNavigation (settings) {
+ var root = settings.root;
+ var focusedElement, focusedControl;
+ function isElement(node) {
+ return node && node.nodeType === 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 navigationRoot;
- }
- function focusFirst(targetControl) {
- var navigationRoot = getNavigationRoot(targetControl);
- var focusElements = getFocusElements(navigationRoot.getEl());
- if (navigationRoot.settings.ariaRemember && 'lastAriaIndex' in navigationRoot) {
- moveFocusToIndex(navigationRoot.lastAriaIndex, focusElements);
- } else {
- moveFocusToIndex(0, focusElements);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ try {
+ focusedElement = document.activeElement;
+ } catch (ex) {
+ focusedElement = document.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">- }
- function moveFocusToIndex(idx, elements) {
- if (idx < 0) {
- idx = elements.length - 1;
- } else if (idx >= elements.length) {
- idx = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ focusedControl = root.getParentCtrl(focusedElement);
+ function getRole(elm) {
+ elm = elm || focusedElement;
+ if (isElement(elm)) {
+ return elm.getAttribute('role');
+ }
+ return 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 (elements[idx]) {
- elements[idx].focus();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function getParentRole(elm) {
+ var role, parent$$1 = elm || focusedElement;
+ while (parent$$1 = parent$$1.parentNode) {
+ if (role = getRole(parent$$1)) {
+ return role;
+ }
+ }
</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 idx;
- }
- function moveFocus(dir, elements) {
- var idx = -1;
- var navigationRoot = getNavigationRoot();
- elements = elements || getFocusElements(navigationRoot.getEl());
- for (var i = 0; i < elements.length; i++) {
- if (elements[i] === focusedElement) {
- idx = i;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function getAriaProp(name$$1) {
+ var elm = focusedElement;
+ if (isElement(elm)) {
+ return elm.getAttribute('aria-' + name$$1);
</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">- idx += dir;
- navigationRoot.lastAriaIndex = moveFocusToIndex(idx, elements);
- }
- function left() {
- var parentRole = getParentRole();
- if (parentRole === 'tablist') {
- moveFocus(-1, getFocusElements(focusedElement.parentNode));
- } else if (focusedControl.parent().submenu) {
- cancel();
- } else {
- moveFocus(-1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function isTextInputElement(elm) {
+ var tagName = elm.tagName.toUpperCase();
+ return tagName === 'INPUT' || tagName === 'TEXTAREA' || tagName === 'SELECT';
</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 right() {
- var role = getRole(), parentRole = getParentRole();
- if (parentRole === 'tablist') {
- moveFocus(1, getFocusElements(focusedElement.parentNode));
- } else if (role === 'menuitem' && parentRole === 'menu' && getAriaProp('haspopup')) {
- enter();
- } else {
- moveFocus(1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function canFocus(elm) {
+ if (isTextInputElement(elm) && !elm.hidden) {
+ return true;
+ }
+ if (hasTabstopData(elm)) {
+ return true;
+ }
+ if (/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(getRole(elm))) {
+ return true;
+ }
+ 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">- }
- function up() {
- moveFocus(-1);
- }
- function down() {
- var role = getRole(), parentRole = getParentRole();
- if (role === 'menuitem' && parentRole === 'menubar') {
- enter();
- } else if (role === 'button' && getAriaProp('haspopup')) {
- enter({ key: 'down' });
- } else {
- moveFocus(1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function getFocusElements(elm) {
+ var elements = [];
+ function collect(elm) {
+ if (elm.nodeType !== 1 || elm.style.display === 'none' || elm.disabled) {
+ return;
+ }
+ if (canFocus(elm)) {
+ elements.push(elm);
+ }
+ for (var i = 0; i < elm.childNodes.length; i++) {
+ collect(elm.childNodes[i]);
+ }
+ }
+ collect(elm || root.getEl());
+ return elements;
</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 tab(e) {
- var parentRole = getParentRole();
- if (parentRole === 'tablist') {
- var elm = getFocusElements(focusedControl.getEl('body'))[0];
- if (elm) {
- elm.focus();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function getNavigationRoot(targetControl) {
+ var navigationRoot, controls;
+ targetControl = targetControl || focusedControl;
+ controls = targetControl.parents().toArray();
+ controls.unshift(targetControl);
+ for (var i = 0; i < controls.length; i++) {
+ navigationRoot = controls[i];
+ if (navigationRoot.settings.ariaRoot) {
+ 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">- } else {
- moveFocus(e.shiftKey ? -1 : 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return navigationRoot;
</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 cancel() {
- focusedControl.fire('cancel');
- }
- function enter(aria) {
- aria = aria || {};
- focusedControl.fire('click', {
- target: focusedElement,
- aria: aria
- });
- }
- root.on('keydown', function (e) {
- function handleNonTabOrEscEvent(e, handler) {
- if (isTextInputElement(focusedElement) || hasTabstopData(focusedElement)) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function focusFirst(targetControl) {
+ var navigationRoot = getNavigationRoot(targetControl);
+ var focusElements = getFocusElements(navigationRoot.getEl());
+ if (navigationRoot.settings.ariaRemember && 'lastAriaIndex' in navigationRoot) {
+ moveFocusToIndex(navigationRoot.lastAriaIndex, focusElements);
+ } else {
+ moveFocusToIndex(0, focusElements);
</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 (getRole(focusedElement) === 'slider') {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ function moveFocusToIndex(idx, elements) {
+ if (idx < 0) {
+ idx = elements.length - 1;
+ } else if (idx >= elements.length) {
+ 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">- if (handler(e) !== false) {
- e.preventDefault();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (elements[idx]) {
+ elements[idx].focus();
</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 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">- if (e.isDefaultPrevented()) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function moveFocus(dir, elements) {
+ var idx = -1;
+ var navigationRoot = getNavigationRoot();
+ elements = elements || getFocusElements(navigationRoot.getEl());
+ for (var i = 0; i < elements.length; i++) {
+ if (elements[i] === focusedElement) {
+ idx = i;
+ }
+ }
+ idx += dir;
+ navigationRoot.lastAriaIndex = moveFocusToIndex(idx, elements);
</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 (e.keyCode) {
- case 37:
- handleNonTabOrEscEvent(e, left);
- break;
- case 39:
- handleNonTabOrEscEvent(e, right);
- break;
- case 38:
- handleNonTabOrEscEvent(e, up);
- break;
- case 40:
- handleNonTabOrEscEvent(e, down);
- break;
- case 27:
- cancel();
- break;
- case 14:
- case 13:
- case 32:
- handleNonTabOrEscEvent(e, enter);
- break;
- case 9:
- tab(e);
- e.preventDefault();
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function left() {
+ var parentRole = getParentRole();
+ if (parentRole === 'tablist') {
+ moveFocus(-1, getFocusElements(focusedElement.parentNode));
+ } else if (focusedControl.parent().submenu) {
+ cancel();
+ } else {
+ moveFocus(-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">- });
- root.on('focusin', function (e) {
- focusedElement = e.target;
- focusedControl = e.control;
- });
- return { focusFirst: focusFirst };
- }
-
- var selectorCache = {};
- var Container = Control$1.extend({
- init: function (settings) {
- var self = this;
- self._super(settings);
- settings = self.settings;
- if (settings.fixed) {
- self.state.set('fixed', true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function right() {
+ var role = getRole(), parentRole = getParentRole();
+ if (parentRole === 'tablist') {
+ moveFocus(1, getFocusElements(focusedElement.parentNode));
+ } else if (role === 'menuitem' && parentRole === 'menu' && getAriaProp('haspopup')) {
+ enter();
+ } else {
+ moveFocus(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">- self._items = new Collection$2();
- if (self.isRtl()) {
- self.classes.add('rtl');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function up() {
+ moveFocus(-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">- self.bodyClasses = new ClassList(function () {
- if (self.state.get('rendered')) {
- self.getEl('body').className = this.toString();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function down() {
+ var role = getRole(), parentRole = getParentRole();
+ if (role === 'menuitem' && parentRole === 'menubar') {
+ enter();
+ } else if (role === 'button' && getAriaProp('haspopup')) {
+ enter({ key: 'down' });
+ } else {
+ moveFocus(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">- });
- self.bodyClasses.prefix = self.classPrefix;
- self.classes.add('container');
- self.bodyClasses.add('container-body');
- if (settings.containerCls) {
- self.classes.add(settings.containerCls);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self._layout = global$11.create((settings.layout || '') + 'layout');
- if (self.settings.items) {
- self.add(self.settings.items);
- } else {
- self.add(self.render());
- }
- self._hasBody = true;
- },
- items: function () {
- return this._items;
- },
- find: function (selector) {
- selector = selectorCache[selector] = selectorCache[selector] || new Selector(selector);
- return selector.find(this);
- },
- add: function (items) {
- var self = this;
- self.items().add(self.create(items)).parent(self);
- return self;
- },
- focus: function (keyboard) {
- var self = this;
- var focusCtrl, keyboardNav, items;
- if (keyboard) {
- keyboardNav = self.keyboardNav || self.parents().eq(-1)[0].keyboardNav;
- if (keyboardNav) {
- keyboardNav.focusFirst(self);
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function tab(e) {
+ var parentRole = getParentRole();
+ if (parentRole === 'tablist') {
+ var elm = getFocusElements(focusedControl.getEl('body'))[0];
+ if (elm) {
+ elm.focus();
+ }
+ } else {
+ moveFocus(e.shiftKey ? -1 : 1);
</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">- items = self.find('*');
- if (self.statusbar) {
- items.add(self.statusbar.items());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function cancel() {
+ focusedControl.fire('cancel');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- items.each(function (ctrl) {
- if (ctrl.settings.autofocus) {
- focusCtrl = null;
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function enter(aria) {
+ aria = aria || {};
+ focusedControl.fire('click', {
+ target: focusedElement,
+ aria: aria
+ });
+ }
+ root.on('keydown', function (e) {
+ function handleNonTabOrEscEvent(e, handler) {
+ if (isTextInputElement(focusedElement) || hasTabstopData(focusedElement)) {
+ return;
+ }
+ if (getRole(focusedElement) === 'slider') {
+ return;
+ }
+ if (handler(e) !== false) {
+ e.preventDefault();
+ }
</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 (ctrl.canFocus) {
- focusCtrl = focusCtrl || ctrl;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (e.isDefaultPrevented()) {
+ 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 (focusCtrl) {
- focusCtrl.focus();
- }
- return self;
- },
- replace: function (oldItem, newItem) {
- var ctrlElm;
- var items = this.items();
- var i = items.length;
- while (i--) {
- if (items[i] === oldItem) {
- items[i] = newItem;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ switch (e.keyCode) {
+ case 37:
+ handleNonTabOrEscEvent(e, left);
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ case 39:
+ handleNonTabOrEscEvent(e, right);
+ break;
+ case 38:
+ handleNonTabOrEscEvent(e, up);
+ break;
+ case 40:
+ handleNonTabOrEscEvent(e, down);
+ break;
+ case 27:
+ cancel();
+ break;
+ case 14:
+ case 13:
+ case 32:
+ handleNonTabOrEscEvent(e, enter);
+ break;
+ case 9:
+ tab(e);
+ e.preventDefault();
+ 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">- }
- if (i >= 0) {
- ctrlElm = newItem.getEl();
- if (ctrlElm) {
- ctrlElm.parentNode.removeChild(ctrlElm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ root.on('focusin', function (e) {
+ focusedElement = e.target;
+ focusedControl = e.control;
+ });
+ return { focusFirst: focusFirst };
+ }
+
+ var selectorCache = {};
+ var Container = Control$1.extend({
+ init: function (settings) {
+ var self = this;
+ self._super(settings);
+ settings = self.settings;
+ if (settings.fixed) {
+ self.state.set('fixed', 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">- ctrlElm = oldItem.getEl();
- if (ctrlElm) {
- ctrlElm.parentNode.removeChild(ctrlElm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._items = new Collection$2();
+ if (self.isRtl()) {
+ self.classes.add('rtl');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- newItem.parent(this);
- },
- create: function (items) {
- var self = this;
- var settings;
- var ctrlItems = [];
- if (!global$4.isArray(items)) {
- items = [items];
- }
- global$4.each(items, function (item) {
- if (item) {
- if (!(item instanceof Control$1)) {
- if (typeof item === 'string') {
- item = { type: item };
- }
- settings = global$4.extend({}, self.settings.defaults, item);
- item.type = settings.type = settings.type || item.type || self.settings.defaultType || (settings.defaults ? settings.defaults.type : null);
- item = global$11.create(settings);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.bodyClasses = new ClassList(function () {
+ if (self.state.get('rendered')) {
+ self.getEl('body').className = this.toString();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ctrlItems.push(item);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ self.bodyClasses.prefix = self.classPrefix;
+ self.classes.add('container');
+ self.bodyClasses.add('container-body');
+ if (settings.containerCls) {
+ self.classes.add(settings.containerCls);
</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 ctrlItems;
- },
- renderNew: function () {
- var self = this;
- self.items().each(function (ctrl, index) {
- var containerElm;
- ctrl.parent(self);
- if (!ctrl.state.get('rendered')) {
- containerElm = self.getEl('body');
- if (containerElm.hasChildNodes() && index <= containerElm.childNodes.length - 1) {
- global$7(containerElm.childNodes[index]).before(ctrl.renderHtml());
- } else {
- global$7(containerElm).append(ctrl.renderHtml());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._layout = global$b.create((settings.layout || '') + 'layout');
+ if (self.settings.items) {
+ self.add(self.settings.items);
+ } else {
+ self.add(self.render());
+ }
+ self._hasBody = true;
+ },
+ items: function () {
+ return this._items;
+ },
+ find: function (selector) {
+ selector = selectorCache[selector] = selectorCache[selector] || new Selector(selector);
+ return selector.find(this);
+ },
+ add: function (items) {
+ var self = this;
+ self.items().add(self.create(items)).parent(self);
+ return self;
+ },
+ focus: function (keyboard) {
+ var self = this;
+ var focusCtrl, keyboardNav, items;
+ if (keyboard) {
+ keyboardNav = self.keyboardNav || self.parents().eq(-1)[0].keyboardNav;
+ if (keyboardNav) {
+ keyboardNav.focusFirst(self);
+ 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">- ctrl.postRender();
- $_cqjgb518wjjgwek2f.add(ctrl);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self._layout.applyClasses(self.items().filter(':visible'));
- self._lastRect = null;
- return self;
- },
- append: function (items) {
- return this.add(items).renderNew();
- },
- prepend: function (items) {
- var self = this;
- self.items().set(self.create(items).concat(self.items().toArray()));
- return self.renderNew();
- },
- insert: function (items, index, before) {
- var self = this;
- var curItems, beforeItems, afterItems;
- items = self.create(items);
- curItems = self.items();
- if (!before && index < curItems.length - 1) {
- index += 1;
- }
- if (index >= 0 && index < curItems.length) {
- beforeItems = curItems.slice(0, index).toArray();
- afterItems = curItems.slice(index).toArray();
- curItems.set(beforeItems.concat(items, afterItems));
- }
- return self.renderNew();
- },
- fromJSON: function (data) {
- var self = this;
- for (var name in data) {
- self.find('#' + name).value(data[name]);
- }
- return self;
- },
- toJSON: function () {
- var self = this, data = {};
- self.find('*').each(function (ctrl) {
- var name = ctrl.name(), value = ctrl.value();
- if (name && typeof value !== 'undefined') {
- data[name] = value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ items = self.find('*');
+ if (self.statusbar) {
+ items.add(self.statusbar.items());
</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 data;
- },
- renderHtml: function () {
- var self = this, layout = self._layout, role = this.settings.role;
- self.preRender();
- layout.preRender(self);
- return '<div id="' + self._id + '" class="' + self.classes + '"' + (role ? ' role="' + this.settings.role + '"' : '') + '>' + '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + (self.settings.html || '') + layout.renderHtml(self) + '</div>' + '</div>';
- },
- postRender: function () {
- var self = this;
- var box;
- self.items().exec('postRender');
- self._super();
- self._layout.postRender(self);
- self.state.set('rendered', true);
- if (self.settings.style) {
- self.$el.css(self.settings.style);
- }
- if (self.settings.border) {
- box = self.borderBox;
- self.$el.css({
- 'border-top-width': box.top,
- 'border-right-width': box.right,
- 'border-bottom-width': box.bottom,
- 'border-left-width': box.left
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ items.each(function (ctrl) {
+ if (ctrl.settings.autofocus) {
+ focusCtrl = null;
+ return false;
+ }
+ if (ctrl.canFocus) {
+ focusCtrl = focusCtrl || ctrl;
+ }
</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 (!self.parent()) {
- self.keyboardNav = KeyboardNavigation({ root: self });
- }
- return self;
- },
- initLayoutRect: function () {
- var self = this, layoutRect = self._super();
- self._layout.recalc(self);
- return layoutRect;
- },
- recalc: function () {
- var self = this;
- var rect = self._layoutRect;
- var lastRect = self._lastRect;
- if (!lastRect || lastRect.w !== rect.w || lastRect.h !== rect.h) {
- self._layout.recalc(self);
- rect = self.layoutRect();
- self._lastRect = {
- x: rect.x,
- y: rect.y,
- w: rect.w,
- h: rect.h
- };
- return true;
- }
- },
- reflow: function () {
- var i;
- $_cqjgb518wjjgwek2f.remove(this);
- if (this.visible()) {
- Control$1.repaintControls = [];
- Control$1.repaintControls.map = {};
- this.recalc();
- i = Control$1.repaintControls.length;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (focusCtrl) {
+ focusCtrl.focus();
+ }
+ return self;
+ },
+ replace: function (oldItem, newItem) {
+ var ctrlElm;
+ var items = this.items();
+ var i = items.length;
</ins><span class="cx" style="display: block; padding: 0 10px"> while (i--) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- Control$1.repaintControls[i].repaint();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (items[i] === oldItem) {
+ items[i] = newItem;
+ 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">- if (this.settings.layout !== 'flow' && this.settings.layout !== 'stack') {
- this.repaint();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (i >= 0) {
+ ctrlElm = newItem.getEl();
+ if (ctrlElm) {
+ ctrlElm.parentNode.removeChild(ctrlElm);
+ }
+ ctrlElm = oldItem.getEl();
+ if (ctrlElm) {
+ ctrlElm.parentNode.removeChild(ctrlElm);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- Control$1.repaintControls = [];
- }
- return this;
- }
- });
-
- var $_8woeth19ajjgwek4b = {
- init: function () {
- var self = this;
- self.on('repaint', self.renderScroll);
- },
- renderScroll: function () {
- var self = this, margin = 2;
- function repaintScroll() {
- var hasScrollH, hasScrollV, bodyElm;
- function repaintAxis(axisName, posName, sizeName, contentSizeName, hasScroll, ax) {
- var containerElm, scrollBarElm, scrollThumbElm;
- var containerSize, scrollSize, ratio, rect;
- var posNameLower, sizeNameLower;
- scrollBarElm = self.getEl('scroll' + axisName);
- if (scrollBarElm) {
- posNameLower = posName.toLowerCase();
- sizeNameLower = sizeName.toLowerCase();
- global$7(self.getEl('absend')).css(posNameLower, self.layoutRect()[contentSizeName] - 1);
- if (!hasScroll) {
- global$7(scrollBarElm).css('display', 'none');
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ newItem.parent(this);
+ },
+ create: function (items) {
+ var self = this;
+ var settings;
+ var ctrlItems = [];
+ if (!global$4.isArray(items)) {
+ items = [items];
+ }
+ global$4.each(items, function (item) {
+ if (item) {
+ if (!(item instanceof Control$1)) {
+ if (typeof item === 'string') {
+ item = { type: item };
+ }
+ settings = global$4.extend({}, self.settings.defaults, item);
+ item.type = settings.type = settings.type || item.type || self.settings.defaultType || (settings.defaults ? settings.defaults.type : null);
+ item = global$b.create(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">- global$7(scrollBarElm).css('display', 'block');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ctrlItems.push(item);
+ }
+ });
+ return ctrlItems;
+ },
+ renderNew: function () {
+ var self = this;
+ self.items().each(function (ctrl, index) {
+ var containerElm;
+ ctrl.parent(self);
+ if (!ctrl.state.get('rendered')) {
</ins><span class="cx" style="display: block; padding: 0 10px"> containerElm = self.getEl('body');
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- scrollThumbElm = self.getEl('scroll' + axisName + 't');
- containerSize = containerElm['client' + sizeName] - margin * 2;
- containerSize -= hasScrollH && hasScrollV ? scrollBarElm['client' + ax] : 0;
- scrollSize = containerElm['scroll' + sizeName];
- ratio = containerSize / scrollSize;
- rect = {};
- rect[posNameLower] = containerElm['offset' + posName] + margin;
- rect[sizeNameLower] = containerSize;
- global$7(scrollBarElm).css(rect);
- rect = {};
- rect[posNameLower] = containerElm['scroll' + posName] * ratio;
- rect[sizeNameLower] = containerSize * ratio;
- global$7(scrollThumbElm).css(rect);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (containerElm.hasChildNodes() && index <= containerElm.childNodes.length - 1) {
+ global$7(containerElm.childNodes[index]).before(ctrl.renderHtml());
+ } else {
+ global$7(containerElm).append(ctrl.renderHtml());
+ }
+ ctrl.postRender();
+ ReflowQueue.add(ctrl);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ self._layout.applyClasses(self.items().filter(':visible'));
+ self._lastRect = null;
+ return self;
+ },
+ append: function (items) {
+ return this.add(items).renderNew();
+ },
+ prepend: function (items) {
+ var self = this;
+ self.items().set(self.create(items).concat(self.items().toArray()));
+ return self.renderNew();
+ },
+ insert: function (items, index, before) {
+ var self = this;
+ var curItems, beforeItems, afterItems;
+ items = self.create(items);
+ curItems = self.items();
+ if (!before && index < curItems.length - 1) {
+ index += 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">- bodyElm = self.getEl('body');
- hasScrollH = bodyElm.scrollWidth > bodyElm.clientWidth;
- hasScrollV = bodyElm.scrollHeight > bodyElm.clientHeight;
- repaintAxis('h', 'Left', 'Width', 'contentW', hasScrollH, 'Height');
- repaintAxis('v', 'Top', 'Height', 'contentH', hasScrollV, 'Width');
- }
- function addScroll() {
- function addScrollAxis(axisName, posName, sizeName, deltaPosName, ax) {
- var scrollStart;
- var axisId = self._id + '-scroll' + axisName, prefix = self.classPrefix;
- global$7(self.getEl()).append('<div id="' + axisId + '" class="' + prefix + 'scrollbar ' + prefix + 'scrollbar-' + axisName + '">' + '<div id="' + axisId + 't" class="' + prefix + 'scrollbar-thumb"></div>' + '</div>');
- self.draghelper = new DragHelper(axisId + 't', {
- start: function () {
- scrollStart = self.getEl('body')['scroll' + posName];
- global$7('#' + axisId).addClass(prefix + 'active');
- },
- drag: function (e) {
- var ratio, hasScrollH, hasScrollV, containerSize;
- var layoutRect = self.layoutRect();
- hasScrollH = layoutRect.contentW > layoutRect.innerW;
- hasScrollV = layoutRect.contentH > layoutRect.innerH;
- containerSize = self.getEl('body')['client' + sizeName] - margin * 2;
- containerSize -= hasScrollH && hasScrollV ? self.getEl('scroll' + axisName)['client' + ax] : 0;
- ratio = containerSize / self.getEl('body')['scroll' + sizeName];
- self.getEl('body')['scroll' + posName] = scrollStart + e['delta' + deltaPosName] / ratio;
- },
- stop: function () {
- global$7('#' + axisId).removeClass(prefix + 'active');
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (index >= 0 && index < curItems.length) {
+ beforeItems = curItems.slice(0, index).toArray();
+ afterItems = curItems.slice(index).toArray();
+ curItems.set(beforeItems.concat(items, afterItems));
+ }
+ return self.renderNew();
+ },
+ fromJSON: function (data) {
+ var self = this;
+ for (var name in data) {
+ self.find('#' + name).value(data[name]);
+ }
+ return self;
+ },
+ toJSON: function () {
+ var self = this, data = {};
+ self.find('*').each(function (ctrl) {
+ var name = ctrl.name(), value = ctrl.value();
+ if (name && typeof value !== 'undefined') {
+ data[name] = value;
+ }
+ });
+ return data;
+ },
+ renderHtml: function () {
+ var self = this, layout = self._layout, role = this.settings.role;
+ self.preRender();
+ layout.preRender(self);
+ return '<div id="' + self._id + '" class="' + self.classes + '"' + (role ? ' role="' + this.settings.role + '"' : '') + '>' + '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + (self.settings.html || '') + layout.renderHtml(self) + '</div>' + '</div>';
+ },
+ postRender: function () {
+ var self = this;
+ var box;
+ self.items().exec('postRender');
+ self._super();
+ self._layout.postRender(self);
+ self.state.set('rendered', true);
+ if (self.settings.style) {
+ self.$el.css(self.settings.style);
+ }
+ if (self.settings.border) {
+ box = self.borderBox;
+ self.$el.css({
+ 'border-top-width': box.top,
+ 'border-right-width': box.right,
+ 'border-bottom-width': box.bottom,
+ 'border-left-width': box.left
</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">- self.classes.add('scroll');
- addScrollAxis('v', 'Top', 'Height', 'Y', 'Width');
- addScrollAxis('h', 'Left', 'Width', 'X', 'Height');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!self.parent()) {
+ self.keyboardNav = KeyboardNavigation({ root: self });
+ }
+ return self;
+ },
+ initLayoutRect: function () {
+ var self = this, layoutRect = self._super();
+ self._layout.recalc(self);
+ return layoutRect;
+ },
+ recalc: function () {
+ var self = this;
+ var rect = self._layoutRect;
+ var lastRect = self._lastRect;
+ if (!lastRect || lastRect.w !== rect.w || lastRect.h !== rect.h) {
+ self._layout.recalc(self);
+ rect = self.layoutRect();
+ self._lastRect = {
+ x: rect.x,
+ y: rect.y,
+ w: rect.w,
+ h: rect.h
+ };
+ return true;
+ }
+ },
+ reflow: function () {
+ var i;
+ ReflowQueue.remove(this);
+ if (this.visible()) {
+ Control$1.repaintControls = [];
+ Control$1.repaintControls.map = {};
+ this.recalc();
+ i = Control$1.repaintControls.length;
+ while (i--) {
+ Control$1.repaintControls[i].repaint();
+ }
+ if (this.settings.layout !== 'flow' && this.settings.layout !== 'stack') {
+ this.repaint();
+ }
+ Control$1.repaintControls = [];
+ }
+ return 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">- if (self.settings.autoScroll) {
- if (!self._hasScroll) {
- self._hasScroll = true;
- addScroll();
- self.on('wheel', function (e) {
- var bodyEl = self.getEl('body');
- bodyEl.scrollLeft += (e.deltaX || 0) * 10;
- bodyEl.scrollTop += e.deltaY * 10;
- repaintScroll();
- });
- global$7(self.getEl('body')).on('scroll', repaintScroll);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var Scrollable = {
+ init: function () {
+ var self = this;
+ self.on('repaint', self.renderScroll);
+ },
+ renderScroll: function () {
+ var self = this, margin = 2;
+ function repaintScroll() {
+ var hasScrollH, hasScrollV, bodyElm;
+ function repaintAxis(axisName, posName, sizeName, contentSizeName, hasScroll, ax) {
+ var containerElm, scrollBarElm, scrollThumbElm;
+ var containerSize, scrollSize, ratio, rect;
+ var posNameLower, sizeNameLower;
+ scrollBarElm = self.getEl('scroll' + axisName);
+ if (scrollBarElm) {
+ posNameLower = posName.toLowerCase();
+ sizeNameLower = sizeName.toLowerCase();
+ global$7(self.getEl('absend')).css(posNameLower, self.layoutRect()[contentSizeName] - 1);
+ if (!hasScroll) {
+ global$7(scrollBarElm).css('display', 'none');
+ return;
+ }
+ global$7(scrollBarElm).css('display', 'block');
+ containerElm = self.getEl('body');
+ scrollThumbElm = self.getEl('scroll' + axisName + 't');
+ containerSize = containerElm['client' + sizeName] - margin * 2;
+ containerSize -= hasScrollH && hasScrollV ? scrollBarElm['client' + ax] : 0;
+ scrollSize = containerElm['scroll' + sizeName];
+ ratio = containerSize / scrollSize;
+ rect = {};
+ rect[posNameLower] = containerElm['offset' + posName] + margin;
+ rect[sizeNameLower] = containerSize;
+ global$7(scrollBarElm).css(rect);
+ rect = {};
+ rect[posNameLower] = containerElm['scroll' + posName] * ratio;
+ rect[sizeNameLower] = containerSize * ratio;
+ global$7(scrollThumbElm).css(rect);
+ }
+ }
+ bodyElm = self.getEl('body');
+ hasScrollH = bodyElm.scrollWidth > bodyElm.clientWidth;
+ hasScrollV = bodyElm.scrollHeight > bodyElm.clientHeight;
+ repaintAxis('h', 'Left', 'Width', 'contentW', hasScrollH, 'Height');
+ repaintAxis('v', 'Top', 'Height', 'contentH', hasScrollV, 'Width');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- repaintScroll();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function addScroll() {
+ function addScrollAxis(axisName, posName, sizeName, deltaPosName, ax) {
+ var scrollStart;
+ var axisId = self._id + '-scroll' + axisName, prefix = self.classPrefix;
+ global$7(self.getEl()).append('<div id="' + axisId + '" class="' + prefix + 'scrollbar ' + prefix + 'scrollbar-' + axisName + '">' + '<div id="' + axisId + 't" class="' + prefix + 'scrollbar-thumb"></div>' + '</div>');
+ self.draghelper = new DragHelper(axisId + 't', {
+ start: function () {
+ scrollStart = self.getEl('body')['scroll' + posName];
+ global$7('#' + axisId).addClass(prefix + 'active');
+ },
+ drag: function (e) {
+ var ratio, hasScrollH, hasScrollV, containerSize;
+ var layoutRect = self.layoutRect();
+ hasScrollH = layoutRect.contentW > layoutRect.innerW;
+ hasScrollV = layoutRect.contentH > layoutRect.innerH;
+ containerSize = self.getEl('body')['client' + sizeName] - margin * 2;
+ containerSize -= hasScrollH && hasScrollV ? self.getEl('scroll' + axisName)['client' + ax] : 0;
+ ratio = containerSize / self.getEl('body')['scroll' + sizeName];
+ self.getEl('body')['scroll' + posName] = scrollStart + e['delta' + deltaPosName] / ratio;
+ },
+ stop: function () {
+ global$7('#' + axisId).removeClass(prefix + 'active');
+ }
+ });
+ }
+ self.classes.add('scroll');
+ addScrollAxis('v', 'Top', 'Height', 'Y', 'Width');
+ addScrollAxis('h', 'Left', 'Width', 'X', 'Height');
+ }
+ if (self.settings.autoScroll) {
+ if (!self._hasScroll) {
+ self._hasScroll = true;
+ addScroll();
+ self.on('wheel', function (e) {
+ var bodyEl = self.getEl('body');
+ bodyEl.scrollLeft += (e.deltaX || 0) * 10;
+ bodyEl.scrollTop += e.deltaY * 10;
+ repaintScroll();
+ });
+ global$7(self.getEl('body')).on('scroll', repaintScroll);
+ }
+ repaintScroll();
+ }
</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">+ };
</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 Panel = Container.extend({
- Defaults: {
- layout: 'fit',
- containerCls: 'panel'
- },
- Mixins: [$_8woeth19ajjgwek4b],
- renderHtml: function () {
- var self = this;
- var layout = self._layout;
- var innerHtml = self.settings.html;
- self.preRender();
- layout.preRender(self);
- if (typeof innerHtml === 'undefined') {
- innerHtml = '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + layout.renderHtml(self) + '</div>';
- } else {
- if (typeof innerHtml === 'function') {
- innerHtml = innerHtml.call(self);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Panel = Container.extend({
+ Defaults: {
+ layout: 'fit',
+ containerCls: 'panel'
+ },
+ Mixins: [Scrollable],
+ renderHtml: function () {
+ var self = this;
+ var layout = self._layout;
+ var innerHtml = self.settings.html;
+ self.preRender();
+ layout.preRender(self);
+ if (typeof innerHtml === 'undefined') {
+ innerHtml = '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + layout.renderHtml(self) + '</div>';
+ } else {
+ if (typeof innerHtml === 'function') {
+ innerHtml = innerHtml.call(self);
+ }
+ self._hasBody = 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">- self._hasBody = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return '<div id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1" role="group">' + (self._preBodyHtml || '') + innerHtml + '</div>';
</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 '<div id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1" role="group">' + (self._preBodyHtml || '') + innerHtml + '</div>';
- }
- });
</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">- var $_20hy1119bjjgwek4f = {
- resizeToContent: function () {
- this._layoutRect.autoResize = true;
- this._lastRect = null;
- this.reflow();
- },
- resizeTo: function (w, h) {
- if (w <= 1 || h <= 1) {
- var rect = funcs.getWindowSize();
- w = w <= 1 ? w * rect.w : w;
- h = h <= 1 ? h * rect.h : h;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Resizable = {
+ resizeToContent: function () {
+ this._layoutRect.autoResize = true;
+ this._lastRect = null;
+ this.reflow();
+ },
+ resizeTo: function (w, h) {
+ if (w <= 1 || h <= 1) {
+ var rect = funcs.getWindowSize();
+ w = w <= 1 ? w * rect.w : w;
+ h = h <= 1 ? h * rect.h : h;
+ }
+ this._layoutRect.autoResize = false;
+ return this.layoutRect({
+ minW: w,
+ minH: h,
+ w: w,
+ h: h
+ }).reflow();
+ },
+ resizeBy: function (dw, dh) {
+ var self = this, rect = self.layoutRect();
+ return self.resizeTo(rect.w + dw, rect.h + dh);
</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._layoutRect.autoResize = false;
- return this.layoutRect({
- minW: w,
- minH: h,
- w: w,
- h: h
- }).reflow();
- },
- resizeBy: function (dw, dh) {
- var self = this, rect = self.layoutRect();
- return self.resizeTo(rect.w + dw, rect.h + dh);
- }
- };
</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">- var documentClickHandler;
- var documentScrollHandler;
- var windowResizeHandler;
- var visiblePanels = [];
- var zOrder = [];
- var hasModal;
- function isChildOf(ctrl, parent$$1) {
- while (ctrl) {
- if (ctrl === parent$$1) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var documentClickHandler, documentScrollHandler, windowResizeHandler;
+ var visiblePanels = [];
+ var zOrder = [];
+ var hasModal;
+ function isChildOf(ctrl, parent$$1) {
+ while (ctrl) {
+ if (ctrl === parent$$1) {
+ return true;
+ }
+ ctrl = ctrl.parent();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ctrl = ctrl.parent();
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- function skipOrHidePanels(e) {
- var i = visiblePanels.length;
- while (i--) {
- var panel = visiblePanels[i], clickCtrl = panel.getParentCtrl(e.target);
- if (panel.settings.autohide) {
- if (clickCtrl) {
- if (isChildOf(clickCtrl, panel) || panel.parent() === clickCtrl) {
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function skipOrHidePanels(e) {
+ var i = visiblePanels.length;
+ while (i--) {
+ var panel = visiblePanels[i], clickCtrl = panel.getParentCtrl(e.target);
+ if (panel.settings.autohide) {
+ if (clickCtrl) {
+ if (isChildOf(clickCtrl, panel) || panel.parent() === clickCtrl) {
+ continue;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ e = panel.fire('autohide', { target: e.target });
+ if (!e.isDefaultPrevented()) {
+ panel.hide();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- e = panel.fire('autohide', { target: e.target });
- if (!e.isDefaultPrevented()) {
- panel.hide();
- }
</del><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">- }
- function bindDocumentClickHandler() {
- if (!documentClickHandler) {
- documentClickHandler = function (e) {
- if (e.button === 2) {
- return;
- }
- skipOrHidePanels(e);
- };
- global$7(document).on('click touchstart', documentClickHandler);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function bindDocumentClickHandler() {
+ if (!documentClickHandler) {
+ documentClickHandler = function (e) {
+ if (e.button === 2) {
+ return;
+ }
+ skipOrHidePanels(e);
+ };
+ global$7(document).on('click touchstart', documentClickHandler);
+ }
</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 bindDocumentScrollHandler() {
- if (!documentScrollHandler) {
- documentScrollHandler = function () {
- var i;
- i = visiblePanels.length;
- while (i--) {
- repositionPanel$1(visiblePanels[i]);
- }
- };
- global$7(window).on('scroll', documentScrollHandler);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function bindDocumentScrollHandler() {
+ if (!documentScrollHandler) {
+ documentScrollHandler = function () {
+ var i;
+ i = visiblePanels.length;
+ while (i--) {
+ repositionPanel$1(visiblePanels[i]);
+ }
+ };
+ global$7(window).on('scroll', documentScrollHandler);
+ }
</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 bindWindowResizeHandler() {
- if (!windowResizeHandler) {
- var docElm_1 = document.documentElement;
- var clientWidth_1 = docElm_1.clientWidth, clientHeight_1 = docElm_1.clientHeight;
- windowResizeHandler = function () {
- if (!document.all || clientWidth_1 !== docElm_1.clientWidth || clientHeight_1 !== docElm_1.clientHeight) {
- clientWidth_1 = docElm_1.clientWidth;
- clientHeight_1 = docElm_1.clientHeight;
- FloatPanel.hideAll();
- }
- };
- global$7(window).on('resize', windowResizeHandler);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function bindWindowResizeHandler() {
+ if (!windowResizeHandler) {
+ var docElm_1 = document.documentElement;
+ var clientWidth_1 = docElm_1.clientWidth, clientHeight_1 = docElm_1.clientHeight;
+ windowResizeHandler = function () {
+ if (!document.all || clientWidth_1 !== docElm_1.clientWidth || clientHeight_1 !== docElm_1.clientHeight) {
+ clientWidth_1 = docElm_1.clientWidth;
+ clientHeight_1 = docElm_1.clientHeight;
+ FloatPanel.hideAll();
+ }
+ };
+ global$7(window).on('resize', windowResizeHandler);
+ }
</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 repositionPanel$1(panel) {
- var scrollY$$1 = funcs.getViewPort().y;
- function toggleFixedChildPanels(fixed, deltaY) {
- var parent$$1;
- for (var i = 0; i < visiblePanels.length; i++) {
- if (visiblePanels[i] !== panel) {
- parent$$1 = visiblePanels[i].parent();
- while (parent$$1 && (parent$$1 = parent$$1.parent())) {
- if (parent$$1 === panel) {
- visiblePanels[i].fixed(fixed).moveBy(0, deltaY).repaint();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function repositionPanel$1(panel) {
+ var scrollY$$1 = funcs.getViewPort().y;
+ function toggleFixedChildPanels(fixed, deltaY) {
+ var parent$$1;
+ for (var i = 0; i < visiblePanels.length; i++) {
+ if (visiblePanels[i] !== panel) {
+ parent$$1 = visiblePanels[i].parent();
+ while (parent$$1 && (parent$$1 = parent$$1.parent())) {
+ if (parent$$1 === panel) {
+ visiblePanels[i].fixed(fixed).moveBy(0, deltaY).repaint();
+ }
</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="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (panel.settings.autofix) {
- if (!panel.state.get('fixed')) {
- panel._autoFixY = panel.layoutRect().y;
- if (panel._autoFixY < scrollY$$1) {
- panel.fixed(true).layoutRect({ y: 0 }).repaint();
- toggleFixedChildPanels(true, scrollY$$1 - panel._autoFixY);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (panel.settings.autofix) {
+ if (!panel.state.get('fixed')) {
+ panel._autoFixY = panel.layoutRect().y;
+ if (panel._autoFixY < scrollY$$1) {
+ panel.fixed(true).layoutRect({ y: 0 }).repaint();
+ toggleFixedChildPanels(true, scrollY$$1 - panel._autoFixY);
+ }
+ } else {
+ if (panel._autoFixY > scrollY$$1) {
+ panel.fixed(false).layoutRect({ y: panel._autoFixY }).repaint();
+ toggleFixedChildPanels(false, panel._autoFixY - scrollY$$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">- } else {
- if (panel._autoFixY > scrollY$$1) {
- panel.fixed(false).layoutRect({ y: panel._autoFixY }).repaint();
- toggleFixedChildPanels(false, panel._autoFixY - scrollY$$1);
- }
</del><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">- }
- function addRemove(add, ctrl) {
- var i, zIndex = FloatPanel.zIndex || 65535, topModal;
- if (add) {
- zOrder.push(ctrl);
- } else {
- i = zOrder.length;
- while (i--) {
- if (zOrder[i] === ctrl) {
- zOrder.splice(i, 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function addRemove(add, ctrl) {
+ var i, zIndex = FloatPanel.zIndex || 65535, topModal;
+ if (add) {
+ zOrder.push(ctrl);
+ } else {
+ i = zOrder.length;
+ while (i--) {
+ if (zOrder[i] === ctrl) {
+ zOrder.splice(i, 1);
+ }
</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">- }
- if (zOrder.length) {
- for (i = 0; i < zOrder.length; i++) {
- if (zOrder[i].modal) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (zOrder.length) {
+ for (i = 0; i < zOrder.length; i++) {
+ if (zOrder[i].modal) {
+ zIndex++;
+ topModal = zOrder[i];
+ }
+ zOrder[i].getEl().style.zIndex = zIndex;
+ zOrder[i].zIndex = zIndex;
</ins><span class="cx" style="display: block; padding: 0 10px"> zIndex++;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- topModal = zOrder[i];
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- zOrder[i].getEl().style.zIndex = zIndex;
- zOrder[i].zIndex = zIndex;
- zIndex++;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var modalBlockEl = global$7('#' + ctrl.classPrefix + 'modal-block', ctrl.getContainerElm())[0];
+ if (topModal) {
+ global$7(modalBlockEl).css('z-index', topModal.zIndex - 1);
+ } else if (modalBlockEl) {
+ modalBlockEl.parentNode.removeChild(modalBlockEl);
+ hasModal = false;
+ }
+ FloatPanel.currentZIndex = zIndex;
</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 modalBlockEl = global$7('#' + ctrl.classPrefix + 'modal-block', ctrl.getContainerElm())[0];
- if (topModal) {
- global$7(modalBlockEl).css('z-index', topModal.zIndex - 1);
- } else if (modalBlockEl) {
- modalBlockEl.parentNode.removeChild(modalBlockEl);
- hasModal = false;
- }
- FloatPanel.currentZIndex = zIndex;
- }
- var FloatPanel = Panel.extend({
- Mixins: [
- $_8zu82i18yjjgwek2l,
- $_20hy1119bjjgwek4f
- ],
- init: function (settings) {
- var self$$1 = this;
- self$$1._super(settings);
- self$$1._eventsRoot = self$$1;
- self$$1.classes.add('floatpanel');
- if (settings.autohide) {
- bindDocumentClickHandler();
- bindWindowResizeHandler();
- visiblePanels.push(self$$1);
- }
- if (settings.autofix) {
- bindDocumentScrollHandler();
- self$$1.on('move', function () {
- repositionPanel$1(this);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var FloatPanel = Panel.extend({
+ Mixins: [
+ Movable,
+ Resizable
+ ],
+ init: function (settings) {
+ var self$$1 = this;
+ self$$1._super(settings);
+ self$$1._eventsRoot = self$$1;
+ self$$1.classes.add('floatpanel');
+ if (settings.autohide) {
+ bindDocumentClickHandler();
+ bindWindowResizeHandler();
+ visiblePanels.push(self$$1);
+ }
+ if (settings.autofix) {
+ bindDocumentScrollHandler();
+ self$$1.on('move', function () {
+ repositionPanel$1(this);
+ });
+ }
+ self$$1.on('postrender show', function (e) {
+ if (e.control === self$$1) {
+ var $modalBlockEl_1;
+ var prefix_1 = self$$1.classPrefix;
+ if (self$$1.modal && !hasModal) {
+ $modalBlockEl_1 = global$7('#' + prefix_1 + 'modal-block', self$$1.getContainerElm());
+ if (!$modalBlockEl_1[0]) {
+ $modalBlockEl_1 = global$7('<div id="' + prefix_1 + 'modal-block" class="' + prefix_1 + 'reset ' + prefix_1 + 'fade"></div>').appendTo(self$$1.getContainerElm());
+ }
+ global$3.setTimeout(function () {
+ $modalBlockEl_1.addClass(prefix_1 + 'in');
+ global$7(self$$1.getEl()).addClass(prefix_1 + 'in');
+ });
+ hasModal = true;
+ }
+ addRemove(true, self$$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">- }
- self$$1.on('postrender show', function (e) {
- if (e.control === self$$1) {
- var $modalBlockEl_1;
- var prefix_1 = self$$1.classPrefix;
- if (self$$1.modal && !hasModal) {
- $modalBlockEl_1 = global$7('#' + prefix_1 + 'modal-block', self$$1.getContainerElm());
- if (!$modalBlockEl_1[0]) {
- $modalBlockEl_1 = global$7('<div id="' + prefix_1 + 'modal-block" class="' + prefix_1 + 'reset ' + prefix_1 + 'fade"></div>').appendTo(self$$1.getContainerElm());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.on('show', function () {
+ self$$1.parents().each(function (ctrl) {
+ if (ctrl.state.get('fixed')) {
+ self$$1.fixed(true);
+ 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">- global$3.setTimeout(function () {
- $modalBlockEl_1.addClass(prefix_1 + 'in');
- global$7(self$$1.getEl()).addClass(prefix_1 + 'in');
- });
- hasModal = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ });
+ if (settings.popover) {
+ self$$1._preBodyHtml = '<div class="' + self$$1.classPrefix + 'arrow"></div>';
+ self$$1.classes.add('popover').add('bottom').add(self$$1.isRtl() ? 'end' : 'start');
+ }
+ self$$1.aria('label', settings.ariaLabel);
+ self$$1.aria('labelledby', self$$1._id);
+ self$$1.aria('describedby', self$$1.describedBy || self$$1._id + '-none');
+ },
+ fixed: function (state) {
+ var self$$1 = this;
+ if (self$$1.state.get('fixed') !== state) {
+ if (self$$1.state.get('rendered')) {
+ var viewport = funcs.getViewPort();
+ if (state) {
+ self$$1.layoutRect().y -= viewport.y;
+ } else {
+ self$$1.layoutRect().y += viewport.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">- addRemove(true, self$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.classes.toggle('fixed', state);
+ self$$1.state.set('fixed', 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">- });
- self$$1.on('show', function () {
- self$$1.parents().each(function (ctrl) {
- if (ctrl.state.get('fixed')) {
- self$$1.fixed(true);
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$1;
+ },
+ show: function () {
+ var self$$1 = this;
+ var i;
+ var state = self$$1._super();
+ i = visiblePanels.length;
+ while (i--) {
+ if (visiblePanels[i] === self$$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">- });
- });
- if (settings.popover) {
- self$$1._preBodyHtml = '<div class="' + self$$1.classPrefix + 'arrow"></div>';
- self$$1.classes.add('popover').add('bottom').add(self$$1.isRtl() ? 'end' : 'start');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (i === -1) {
+ visiblePanels.push(self$$1);
+ }
+ return state;
+ },
+ hide: function () {
+ removeVisiblePanel(this);
+ addRemove(false, this);
+ return this._super();
+ },
+ hideAll: function () {
+ FloatPanel.hideAll();
+ },
+ close: function () {
+ var self$$1 = this;
+ if (!self$$1.fire('close').isDefaultPrevented()) {
+ self$$1.remove();
+ addRemove(false, self$$1);
+ }
+ return self$$1;
+ },
+ remove: function () {
+ removeVisiblePanel(this);
+ this._super();
+ },
+ postRender: function () {
+ var self$$1 = this;
+ if (self$$1.settings.bodyRole) {
+ this.getEl('body').setAttribute('role', self$$1.settings.bodyRole);
+ }
+ return self$$1._super();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.aria('label', settings.ariaLabel);
- self$$1.aria('labelledby', self$$1._id);
- self$$1.aria('describedby', self$$1.describedBy || self$$1._id + '-none');
- },
- fixed: function (state) {
- var self$$1 = this;
- if (self$$1.state.get('fixed') !== state) {
- if (self$$1.state.get('rendered')) {
- var viewport = funcs.getViewPort();
- if (state) {
- self$$1.layoutRect().y -= viewport.y;
- } else {
- self$$1.layoutRect().y += viewport.y;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ FloatPanel.hideAll = function () {
+ var i = visiblePanels.length;
+ while (i--) {
+ var panel = visiblePanels[i];
+ if (panel && panel.settings.autohide) {
+ panel.hide();
+ visiblePanels.splice(i, 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">- self$$1.classes.toggle('fixed', state);
- self$$1.state.set('fixed', state);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return self$$1;
- },
- show: function () {
- var self$$1 = this;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ function removeVisiblePanel(panel) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var i;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var state = self$$1._super();
</del><span class="cx" style="display: block; padding: 0 10px"> i = visiblePanels.length;
</span><span class="cx" style="display: block; padding: 0 10px"> while (i--) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (visiblePanels[i] === self$$1) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (visiblePanels[i] === panel) {
+ visiblePanels.splice(i, 1);
</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">- if (i === -1) {
- visiblePanels.push(self$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ i = zOrder.length;
+ while (i--) {
+ if (zOrder[i] === panel) {
+ zOrder.splice(i, 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 state;
- },
- hide: function () {
- removeVisiblePanel(this);
- addRemove(false, this);
- return this._super();
- },
- hideAll: function () {
- FloatPanel.hideAll();
- },
- close: function () {
- var self$$1 = this;
- if (!self$$1.fire('close').isDefaultPrevented()) {
- self$$1.remove();
- addRemove(false, self$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+
+ var windows = [];
+ var oldMetaValue = '';
+ function toggleFullScreenState(state) {
+ var noScaleMetaValue = 'width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0';
+ var viewport = global$7('meta[name=viewport]')[0], contentValue;
+ if (global$1.overrideViewPort === 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">- return self$$1;
- },
- remove: function () {
- removeVisiblePanel(this);
- this._super();
- },
- postRender: function () {
- var self$$1 = this;
- if (self$$1.settings.bodyRole) {
- this.getEl('body').setAttribute('role', self$$1.settings.bodyRole);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!viewport) {
+ viewport = document.createElement('meta');
+ viewport.setAttribute('name', 'viewport');
+ document.getElementsByTagName('head')[0].appendChild(viewport);
</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 self$$1._super();
- }
- });
- FloatPanel.hideAll = function () {
- var i = visiblePanels.length;
- while (i--) {
- var panel = visiblePanels[i];
- if (panel && panel.settings.autohide) {
- panel.hide();
- visiblePanels.splice(i, 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ contentValue = viewport.getAttribute('content');
+ if (contentValue && typeof oldMetaValue !== 'undefined') {
+ oldMetaValue = contentValue;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ viewport.setAttribute('content', state ? noScaleMetaValue : oldMetaValue);
</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 removeVisiblePanel(panel) {
- var i;
- i = visiblePanels.length;
- while (i--) {
- if (visiblePanels[i] === panel) {
- visiblePanels.splice(i, 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function toggleBodyFullScreenClasses(classPrefix, state) {
+ if (checkFullscreenWindows() && state === false) {
+ global$7([
+ document.documentElement,
+ document.body
+ ]).removeClass(classPrefix + 'fullscreen');
</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">- i = zOrder.length;
- while (i--) {
- if (zOrder[i] === panel) {
- zOrder.splice(i, 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function checkFullscreenWindows() {
+ for (var i = 0; i < windows.length; i++) {
+ if (windows[i]._fullscreen) {
+ 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 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 windows = [];
- var oldMetaValue = '';
- function toggleFullScreenState(state) {
- var noScaleMetaValue = 'width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0';
- var viewport = global$7('meta[name=viewport]')[0], contentValue;
- if (global$1.overrideViewPort === false) {
- return;
- }
- if (!viewport) {
- viewport = document.createElement('meta');
- viewport.setAttribute('name', 'viewport');
- document.getElementsByTagName('head')[0].appendChild(viewport);
- }
- contentValue = viewport.getAttribute('content');
- if (contentValue && typeof oldMetaValue !== 'undefined') {
- oldMetaValue = contentValue;
- }
- viewport.setAttribute('content', state ? noScaleMetaValue : oldMetaValue);
- }
- function toggleBodyFullScreenClasses(classPrefix, state) {
- if (checkFullscreenWindows() && state === false) {
- global$7([
- document.documentElement,
- document.body
- ]).removeClass(classPrefix + 'fullscreen');
- }
- }
- function checkFullscreenWindows() {
- for (var i = 0; i < windows.length; i++) {
- if (windows[i]._fullscreen) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function handleWindowResize() {
+ if (!global$1.desktop) {
+ var lastSize_1 = {
+ w: window.innerWidth,
+ h: window.innerHeight
+ };
+ global$3.setInterval(function () {
+ var w = window.innerWidth, h = window.innerHeight;
+ if (lastSize_1.w !== w || lastSize_1.h !== h) {
+ lastSize_1 = {
+ w: w,
+ h: h
+ };
+ global$7(window).trigger('resize');
+ }
+ }, 100);
</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;
- }
- function handleWindowResize() {
- if (!global$1.desktop) {
- var lastSize_1 = {
- w: window.innerWidth,
- h: window.innerHeight
- };
- global$3.setInterval(function () {
- var w = window.innerWidth, h = window.innerHeight;
- if (lastSize_1.w !== w || lastSize_1.h !== h) {
- lastSize_1 = {
- w: w,
- h: h
- };
- global$7(window).trigger('resize');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function reposition() {
+ var i;
+ var rect = funcs.getWindowSize();
+ var layoutRect;
+ for (i = 0; i < windows.length; i++) {
+ layoutRect = windows[i].layoutRect();
+ windows[i].moveTo(windows[i].settings.x || Math.max(0, rect.w / 2 - layoutRect.w / 2), windows[i].settings.y || Math.max(0, rect.h / 2 - layoutRect.h / 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">- }, 100);
- }
- function reposition() {
- var i;
- var rect = funcs.getWindowSize();
- var layoutRect;
- for (i = 0; i < windows.length; i++) {
- layoutRect = windows[i].layoutRect();
- windows[i].moveTo(windows[i].settings.x || Math.max(0, rect.w / 2 - layoutRect.w / 2), windows[i].settings.y || Math.max(0, rect.h / 2 - layoutRect.h / 2));
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global$7(window).on('resize', reposition);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global$7(window).on('resize', reposition);
- }
- var Window$$1 = FloatPanel.extend({
- modal: true,
- Defaults: {
- border: 1,
- layout: 'flex',
- containerCls: 'panel',
- role: 'dialog',
- callbacks: {
- submit: function () {
- this.fire('submit', { data: this.toJSON() });
- },
- close: function () {
- this.close();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Window$$1 = FloatPanel.extend({
+ modal: true,
+ Defaults: {
+ border: 1,
+ layout: 'flex',
+ containerCls: 'panel',
+ role: 'dialog',
+ callbacks: {
+ submit: function () {
+ this.fire('submit', { data: this.toJSON() });
+ },
+ close: function () {
+ this.close();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- },
- init: function (settings) {
- var self$$1 = this;
- self$$1._super(settings);
- if (self$$1.isRtl()) {
- self$$1.classes.add('rtl');
- }
- self$$1.classes.add('window');
- self$$1.bodyClasses.add('window-body');
- self$$1.state.set('fixed', true);
- if (settings.buttons) {
- self$$1.statusbar = new Panel({
- layout: 'flex',
- border: '1 0 0 0',
- spacing: 3,
- padding: 10,
- align: 'center',
- pack: self$$1.isRtl() ? 'start' : 'end',
- defaults: { type: 'button' },
- items: settings.buttons
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ init: function (settings) {
+ var self$$1 = this;
+ self$$1._super(settings);
+ if (self$$1.isRtl()) {
+ self$$1.classes.add('rtl');
+ }
+ self$$1.classes.add('window');
+ self$$1.bodyClasses.add('window-body');
+ self$$1.state.set('fixed', true);
+ if (settings.buttons) {
+ self$$1.statusbar = new Panel({
+ layout: 'flex',
+ border: '1 0 0 0',
+ spacing: 3,
+ padding: 10,
+ align: 'center',
+ pack: self$$1.isRtl() ? 'start' : 'end',
+ defaults: { type: 'button' },
+ items: settings.buttons
+ });
+ self$$1.statusbar.classes.add('foot');
+ self$$1.statusbar.parent(self$$1);
+ }
+ self$$1.on('click', function (e) {
+ var closeClass = self$$1.classPrefix + 'close';
+ if (funcs.hasClass(e.target, closeClass) || funcs.hasClass(e.target.parentNode, closeClass)) {
+ self$$1.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">- self$$1.statusbar.classes.add('foot');
- self$$1.statusbar.parent(self$$1);
- }
- self$$1.on('click', function (e) {
- var closeClass = self$$1.classPrefix + 'close';
- if (funcs.hasClass(e.target, closeClass) || funcs.hasClass(e.target.parentNode, closeClass)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.on('cancel', function () {
</ins><span class="cx" style="display: block; padding: 0 10px"> self$$1.close();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ self$$1.on('move', function (e) {
+ if (e.control === self$$1) {
+ FloatPanel.hideAll();
+ }
+ });
+ self$$1.aria('describedby', self$$1.describedBy || self$$1._id + '-none');
+ self$$1.aria('label', settings.title);
+ self$$1._fullscreen = false;
+ },
+ recalc: function () {
+ var self$$1 = this;
+ var statusbar$$1 = self$$1.statusbar;
+ var layoutRect, width, x, needsRecalc;
+ if (self$$1._fullscreen) {
+ self$$1.layoutRect(funcs.getWindowSize());
+ self$$1.layoutRect().contentH = self$$1.layoutRect().innerH;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self$$1.on('cancel', function () {
- self$$1.close();
- });
- self$$1.on('move', function (e) {
- if (e.control === self$$1) {
- FloatPanel.hideAll();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1._super();
+ layoutRect = self$$1.layoutRect();
+ if (self$$1.settings.title && !self$$1._fullscreen) {
+ width = layoutRect.headerW;
+ if (width > layoutRect.w) {
+ x = layoutRect.x - Math.max(0, width / 2);
+ self$$1.layoutRect({
+ w: width,
+ x: x
+ });
+ needsRecalc = 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">- });
- self$$1.aria('describedby', self$$1.describedBy || self$$1._id + '-none');
- self$$1.aria('label', settings.title);
- self$$1._fullscreen = false;
- },
- recalc: function () {
- var self$$1 = this;
- var statusbar$$1 = self$$1.statusbar;
- var layoutRect, width, x, needsRecalc;
- if (self$$1._fullscreen) {
- self$$1.layoutRect(funcs.getWindowSize());
- self$$1.layoutRect().contentH = self$$1.layoutRect().innerH;
- }
- self$$1._super();
- layoutRect = self$$1.layoutRect();
- if (self$$1.settings.title && !self$$1._fullscreen) {
- width = layoutRect.headerW;
- if (width > layoutRect.w) {
- x = layoutRect.x - Math.max(0, width / 2);
- self$$1.layoutRect({
- w: width,
- x: x
- });
- needsRecalc = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (statusbar$$1) {
+ statusbar$$1.layoutRect({ w: self$$1.layoutRect().innerW }).recalc();
+ width = statusbar$$1.layoutRect().minW + layoutRect.deltaW;
+ if (width > layoutRect.w) {
+ x = layoutRect.x - Math.max(0, width - layoutRect.w);
+ self$$1.layoutRect({
+ w: width,
+ x: x
+ });
+ needsRecalc = 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 (statusbar$$1) {
- statusbar$$1.layoutRect({ w: self$$1.layoutRect().innerW }).recalc();
- width = statusbar$$1.layoutRect().minW + layoutRect.deltaW;
- if (width > layoutRect.w) {
- x = layoutRect.x - Math.max(0, width - layoutRect.w);
- self$$1.layoutRect({
- w: width,
- x: x
- });
- needsRecalc = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (needsRecalc) {
+ self$$1.recalc();
</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 (needsRecalc) {
- self$$1.recalc();
- }
- },
- initLayoutRect: function () {
- var self$$1 = this;
- var layoutRect = self$$1._super();
- var deltaH = 0, headEl;
- if (self$$1.settings.title && !self$$1._fullscreen) {
- headEl = self$$1.getEl('head');
- var size = funcs.getSize(headEl);
- layoutRect.headerW = size.width;
- layoutRect.headerH = size.height;
- deltaH += layoutRect.headerH;
- }
- if (self$$1.statusbar) {
- deltaH += self$$1.statusbar.layoutRect().h;
- }
- layoutRect.deltaH += deltaH;
- layoutRect.minH += deltaH;
- layoutRect.h += deltaH;
- var rect = funcs.getWindowSize();
- layoutRect.x = self$$1.settings.x || Math.max(0, rect.w / 2 - layoutRect.w / 2);
- layoutRect.y = self$$1.settings.y || Math.max(0, rect.h / 2 - layoutRect.h / 2);
- return layoutRect;
- },
- renderHtml: function () {
- var self$$1 = this, layout = self$$1._layout, id = self$$1._id, prefix = self$$1.classPrefix;
- var settings = self$$1.settings;
- var headerHtml = '', footerHtml = '', html = settings.html;
- self$$1.preRender();
- layout.preRender(self$$1);
- if (settings.title) {
- headerHtml = '<div id="' + id + '-head" class="' + prefix + 'window-head">' + '<div id="' + id + '-title" class="' + prefix + 'title">' + self$$1.encode(settings.title) + '</div>' + '<div id="' + id + '-dragh" class="' + prefix + 'dragh"></div>' + '<button type="button" class="' + prefix + 'close" aria-hidden="true">' + '<i class="mce-ico mce-i-remove"></i>' + '</button>' + '</div>';
- }
- if (settings.url) {
- html = '<iframe src="' + settings.url + '" tabindex="-1"></iframe>';
- }
- if (typeof html === 'undefined') {
- html = layout.renderHtml(self$$1);
- }
- if (self$$1.statusbar) {
- footerHtml = self$$1.statusbar.renderHtml();
- }
- return '<div id="' + id + '" class="' + self$$1.classes + '" hidefocus="1">' + '<div class="' + self$$1.classPrefix + 'reset" role="application">' + headerHtml + '<div id="' + id + '-body" class="' + self$$1.bodyClasses + '">' + html + '</div>' + footerHtml + '</div>' + '</div>';
- },
- fullscreen: function (state) {
- var self$$1 = this;
- var documentElement = document.documentElement;
- var slowRendering;
- var prefix = self$$1.classPrefix;
- var layoutRect;
- if (state !== self$$1._fullscreen) {
- global$7(window).on('resize', function () {
- var time;
- if (self$$1._fullscreen) {
- if (!slowRendering) {
- time = new Date().getTime();
- var rect = funcs.getWindowSize();
- self$$1.moveTo(0, 0).resizeTo(rect.w, rect.h);
- if (new Date().getTime() - time > 50) {
- slowRendering = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ initLayoutRect: function () {
+ var self$$1 = this;
+ var layoutRect = self$$1._super();
+ var deltaH = 0, headEl;
+ if (self$$1.settings.title && !self$$1._fullscreen) {
+ headEl = self$$1.getEl('head');
+ var size = funcs.getSize(headEl);
+ layoutRect.headerW = size.width;
+ layoutRect.headerH = size.height;
+ deltaH += layoutRect.headerH;
+ }
+ if (self$$1.statusbar) {
+ deltaH += self$$1.statusbar.layoutRect().h;
+ }
+ layoutRect.deltaH += deltaH;
+ layoutRect.minH += deltaH;
+ layoutRect.h += deltaH;
+ var rect = funcs.getWindowSize();
+ layoutRect.x = self$$1.settings.x || Math.max(0, rect.w / 2 - layoutRect.w / 2);
+ layoutRect.y = self$$1.settings.y || Math.max(0, rect.h / 2 - layoutRect.h / 2);
+ return layoutRect;
+ },
+ renderHtml: function () {
+ var self$$1 = this, layout = self$$1._layout, id = self$$1._id, prefix = self$$1.classPrefix;
+ var settings = self$$1.settings;
+ var headerHtml = '', footerHtml = '', html = settings.html;
+ self$$1.preRender();
+ layout.preRender(self$$1);
+ if (settings.title) {
+ headerHtml = '<div id="' + id + '-head" class="' + prefix + 'window-head">' + '<div id="' + id + '-title" class="' + prefix + 'title">' + self$$1.encode(settings.title) + '</div>' + '<div id="' + id + '-dragh" class="' + prefix + 'dragh"></div>' + '<button type="button" class="' + prefix + 'close" aria-hidden="true">' + '<i class="mce-ico mce-i-remove"></i>' + '</button>' + '</div>';
+ }
+ if (settings.url) {
+ html = '<iframe src="' + settings.url + '" tabindex="-1"></iframe>';
+ }
+ if (typeof html === 'undefined') {
+ html = layout.renderHtml(self$$1);
+ }
+ if (self$$1.statusbar) {
+ footerHtml = self$$1.statusbar.renderHtml();
+ }
+ return '<div id="' + id + '" class="' + self$$1.classes + '" hidefocus="1">' + '<div class="' + self$$1.classPrefix + 'reset" role="application">' + headerHtml + '<div id="' + id + '-body" class="' + self$$1.bodyClasses + '">' + html + '</div>' + footerHtml + '</div>' + '</div>';
+ },
+ fullscreen: function (state) {
+ var self$$1 = this;
+ var documentElement = document.documentElement;
+ var slowRendering;
+ var prefix = self$$1.classPrefix;
+ var layoutRect;
+ if (state !== self$$1._fullscreen) {
+ global$7(window).on('resize', function () {
+ var time;
+ if (self$$1._fullscreen) {
+ if (!slowRendering) {
+ time = new Date().getTime();
+ var rect = funcs.getWindowSize();
+ self$$1.moveTo(0, 0).resizeTo(rect.w, rect.h);
+ if (new Date().getTime() - time > 50) {
+ slowRendering = true;
+ }
+ } else {
+ if (!self$$1._timer) {
+ self$$1._timer = global$3.setTimeout(function () {
+ var rect = funcs.getWindowSize();
+ self$$1.moveTo(0, 0).resizeTo(rect.w, rect.h);
+ self$$1._timer = 0;
+ }, 50);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- if (!self$$1._timer) {
- self$$1._timer = global$3.setTimeout(function () {
- var rect = funcs.getWindowSize();
- self$$1.moveTo(0, 0).resizeTo(rect.w, rect.h);
- self$$1._timer = 0;
- }, 50);
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ layoutRect = self$$1.layoutRect();
+ self$$1._fullscreen = state;
+ if (!state) {
+ self$$1.borderBox = BoxUtils.parseBox(self$$1.settings.border);
+ self$$1.getEl('head').style.display = '';
+ layoutRect.deltaH += layoutRect.headerH;
+ global$7([
+ documentElement,
+ document.body
+ ]).removeClass(prefix + 'fullscreen');
+ self$$1.classes.remove('fullscreen');
+ self$$1.moveTo(self$$1._initial.x, self$$1._initial.y).resizeTo(self$$1._initial.w, self$$1._initial.h);
+ } else {
+ self$$1._initial = {
+ x: layoutRect.x,
+ y: layoutRect.y,
+ w: layoutRect.w,
+ h: layoutRect.h
+ };
+ self$$1.borderBox = BoxUtils.parseBox('0');
+ self$$1.getEl('head').style.display = 'none';
+ layoutRect.deltaH -= layoutRect.headerH + 2;
+ global$7([
+ documentElement,
+ document.body
+ ]).addClass(prefix + 'fullscreen');
+ self$$1.classes.add('fullscreen');
+ var rect = funcs.getWindowSize();
+ self$$1.moveTo(0, 0).resizeTo(rect.w, rect.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">- });
- layoutRect = self$$1.layoutRect();
- self$$1._fullscreen = state;
- if (!state) {
- self$$1.borderBox = $_4kbuyt18pjjgwek1w.parseBox(self$$1.settings.border);
- self$$1.getEl('head').style.display = '';
- layoutRect.deltaH += layoutRect.headerH;
- global$7([
- documentElement,
- document.body
- ]).removeClass(prefix + 'fullscreen');
- self$$1.classes.remove('fullscreen');
- self$$1.moveTo(self$$1._initial.x, self$$1._initial.y).resizeTo(self$$1._initial.w, self$$1._initial.h);
- } else {
- self$$1._initial = {
- x: layoutRect.x,
- y: layoutRect.y,
- w: layoutRect.w,
- h: layoutRect.h
- };
- self$$1.borderBox = $_4kbuyt18pjjgwek1w.parseBox('0');
- self$$1.getEl('head').style.display = 'none';
- layoutRect.deltaH -= layoutRect.headerH + 2;
- global$7([
- documentElement,
- document.body
- ]).addClass(prefix + 'fullscreen');
- self$$1.classes.add('fullscreen');
- var rect = funcs.getWindowSize();
- self$$1.moveTo(0, 0).resizeTo(rect.w, rect.h);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- return self$$1.reflow();
- },
- postRender: function () {
- var self$$1 = this;
- var startPos;
- setTimeout(function () {
- self$$1.classes.add('in');
- self$$1.fire('open');
- }, 0);
- self$$1._super();
- if (self$$1.statusbar) {
- self$$1.statusbar.postRender();
- }
- self$$1.focus();
- this.dragHelper = new DragHelper(self$$1._id + '-dragh', {
- start: function () {
- startPos = {
- x: self$$1.layoutRect().x,
- y: self$$1.layoutRect().y
- };
- },
- drag: function (e) {
- self$$1.moveTo(startPos.x + e.deltaX, startPos.y + e.deltaY);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$1.reflow();
+ },
+ postRender: function () {
+ var self$$1 = this;
+ var startPos;
+ setTimeout(function () {
+ self$$1.classes.add('in');
+ self$$1.fire('open');
+ }, 0);
+ self$$1._super();
+ if (self$$1.statusbar) {
+ self$$1.statusbar.postRender();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self$$1.on('submit', function (e) {
- if (!e.isDefaultPrevented()) {
- self$$1.close();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.focus();
+ this.dragHelper = new DragHelper(self$$1._id + '-dragh', {
+ start: function () {
+ startPos = {
+ x: self$$1.layoutRect().x,
+ y: self$$1.layoutRect().y
+ };
+ },
+ drag: function (e) {
+ self$$1.moveTo(startPos.x + e.deltaX, startPos.y + e.deltaY);
+ }
+ });
+ self$$1.on('submit', function (e) {
+ if (!e.isDefaultPrevented()) {
+ self$$1.close();
+ }
+ });
+ windows.push(self$$1);
+ toggleFullScreenState(true);
+ },
+ submit: function () {
+ return this.fire('submit', { data: this.toJSON() });
+ },
+ remove: function () {
+ var self$$1 = this;
+ var i;
+ self$$1.dragHelper.destroy();
+ self$$1._super();
+ if (self$$1.statusbar) {
+ this.statusbar.remove();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- windows.push(self$$1);
- toggleFullScreenState(true);
- },
- submit: function () {
- return this.fire('submit', { data: this.toJSON() });
- },
- remove: function () {
- var self$$1 = this;
- var i;
- self$$1.dragHelper.destroy();
- self$$1._super();
- if (self$$1.statusbar) {
- this.statusbar.remove();
- }
- toggleBodyFullScreenClasses(self$$1.classPrefix, false);
- i = windows.length;
- while (i--) {
- if (windows[i] === self$$1) {
- windows.splice(i, 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ toggleBodyFullScreenClasses(self$$1.classPrefix, false);
+ i = windows.length;
+ while (i--) {
+ if (windows[i] === self$$1) {
+ windows.splice(i, 1);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ toggleFullScreenState(windows.length > 0);
+ },
+ getContentWindow: function () {
+ var ifr = this.getEl().getElementsByTagName('iframe')[0];
+ return ifr ? ifr.contentWindow : 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">- toggleFullScreenState(windows.length > 0);
- },
- getContentWindow: function () {
- var ifr = this.getEl().getElementsByTagName('iframe')[0];
- return ifr ? ifr.contentWindow : null;
- }
- });
- handleWindowResize();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ handleWindowResize();
</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 MessageBox = Window$$1.extend({
- init: function (settings) {
- settings = {
- border: 1,
- padding: 20,
- layout: 'flex',
- pack: 'center',
- align: 'center',
- containerCls: 'panel',
- autoScroll: true,
- buttons: {
- type: 'button',
- text: 'Ok',
- action: 'ok'
- },
- items: {
- type: 'label',
- multiline: true,
- maxWidth: 500,
- maxHeight: 200
- }
- };
- this._super(settings);
- },
- Statics: {
- OK: 1,
- OK_CANCEL: 2,
- YES_NO: 3,
- YES_NO_CANCEL: 4,
- msgBox: function (settings) {
- var buttons;
- var callback = settings.callback || function () {
- };
- function createButton(text, status$$1, primary) {
- return {
- type: 'button',
- text: text,
- subtype: primary ? 'primary' : '',
- onClick: function (e) {
- e.control.parents()[1].close();
- callback(status$$1);
- }
- };
- }
- switch (settings.buttons) {
- case MessageBox.OK_CANCEL:
- buttons = [
- createButton('Ok', true, true),
- createButton('Cancel', false)
- ];
- break;
- case MessageBox.YES_NO:
- case MessageBox.YES_NO_CANCEL:
- buttons = [
- createButton('Yes', 1, true),
- createButton('No', 0)
- ];
- if (settings.buttons === MessageBox.YES_NO_CANCEL) {
- buttons.push(createButton('Cancel', -1));
- }
- break;
- default:
- buttons = [createButton('Ok', true, true)];
- break;
- }
- return new Window$$1({
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var MessageBox = Window$$1.extend({
+ init: function (settings) {
+ settings = {
+ border: 1,
</ins><span class="cx" style="display: block; padding: 0 10px"> padding: 20,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- x: settings.x,
- y: settings.y,
- minWidth: 300,
- minHeight: 100,
</del><span class="cx" style="display: block; padding: 0 10px"> layout: 'flex',
</span><span class="cx" style="display: block; padding: 0 10px"> pack: 'center',
</span><span class="cx" style="display: block; padding: 0 10px"> align: 'center',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- buttons: buttons,
- title: settings.title,
- role: 'alertdialog',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ containerCls: 'panel',
+ autoScroll: true,
+ buttons: {
+ type: 'button',
+ text: 'Ok',
+ action: 'ok'
+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> items: {
</span><span class="cx" style="display: block; padding: 0 10px"> type: 'label',
</span><span class="cx" style="display: block; padding: 0 10px"> multiline: true,
</span><span class="cx" style="display: block; padding: 0 10px"> maxWidth: 500,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- maxHeight: 200,
- text: settings.text
- },
- onPostRender: function () {
- this.aria('describedby', this.items()[0]._id);
- },
- onClose: settings.onClose,
- onCancel: function () {
- callback(false);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ maxHeight: 200
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }).renderTo(document.body).reflow();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ this._super(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">- alert: function (settings, callback) {
- if (typeof settings === 'string') {
- settings = { text: settings };
- }
- settings.callback = callback;
- return MessageBox.msgBox(settings);
- },
- confirm: function (settings, callback) {
- if (typeof settings === 'string') {
- settings = { text: settings };
- }
- settings.callback = callback;
- settings.buttons = MessageBox.OK_CANCEL;
- return MessageBox.msgBox(settings);
- }
- }
- });
-
- function WindowManagerImpl (editor) {
- var open$$1 = function (args, params, closeCallback) {
- var win;
- args.title = args.title || ' ';
- args.url = args.url || args.file;
- if (args.url) {
- args.width = parseInt(args.width || 320, 10);
- args.height = parseInt(args.height || 240, 10);
- }
- if (args.body) {
- args.items = {
- defaults: args.defaults,
- type: args.bodyType || 'form',
- items: args.body,
- data: args.data,
- callbacks: args.commands
- };
- }
- if (!args.url && !args.buttons) {
- args.buttons = [
- {
- text: 'Ok',
- subtype: 'primary',
- onclick: function () {
- win.find('form')[0].submit();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Statics: {
+ OK: 1,
+ OK_CANCEL: 2,
+ YES_NO: 3,
+ YES_NO_CANCEL: 4,
+ msgBox: function (settings) {
+ var buttons;
+ var callback = settings.callback || function () {
+ };
+ function createButton(text, status$$1, primary) {
+ return {
+ type: 'button',
+ text: text,
+ subtype: primary ? 'primary' : '',
+ onClick: function (e) {
+ e.control.parents()[1].close();
+ callback(status$$1);
+ }
+ };
+ }
+ switch (settings.buttons) {
+ case MessageBox.OK_CANCEL:
+ buttons = [
+ createButton('Ok', true, true),
+ createButton('Cancel', false)
+ ];
+ break;
+ case MessageBox.YES_NO:
+ case MessageBox.YES_NO_CANCEL:
+ buttons = [
+ createButton('Yes', 1, true),
+ createButton('No', 0)
+ ];
+ if (settings.buttons === MessageBox.YES_NO_CANCEL) {
+ buttons.push(createButton('Cancel', -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">- },
- {
- text: 'Cancel',
- onclick: function () {
- win.close();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ break;
+ default:
+ buttons = [createButton('Ok', true, true)];
+ break;
+ }
+ return new Window$$1({
+ padding: 20,
+ x: settings.x,
+ y: settings.y,
+ minWidth: 300,
+ minHeight: 100,
+ layout: 'flex',
+ pack: 'center',
+ align: 'center',
+ buttons: buttons,
+ title: settings.title,
+ role: 'alertdialog',
+ items: {
+ type: 'label',
+ multiline: true,
+ maxWidth: 500,
+ maxHeight: 200,
+ text: settings.text
+ },
+ onPostRender: function () {
+ this.aria('describedby', this.items()[0]._id);
+ },
+ onClose: settings.onClose,
+ onCancel: function () {
+ callback(false);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }).renderTo(document.body).reflow();
+ },
+ alert: function (settings, callback) {
+ if (typeof settings === 'string') {
+ settings = { text: 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">- ];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ settings.callback = callback;
+ return MessageBox.msgBox(settings);
+ },
+ confirm: function (settings, callback) {
+ if (typeof settings === 'string') {
+ settings = { text: settings };
+ }
+ settings.callback = callback;
+ settings.buttons = MessageBox.OK_CANCEL;
+ return MessageBox.msgBox(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">- win = new Window$$1(args);
- win.on('close', function () {
- closeCallback(win);
- });
- if (args.data) {
- win.on('postRender', function () {
- this.find('*').each(function (ctrl) {
- var name$$1 = ctrl.name();
- if (name$$1 in args.data) {
- ctrl.value(args.data[name$$1]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ function WindowManagerImpl (editor) {
+ var open$$1 = function (args, params, closeCallback) {
+ var win;
+ args.title = args.title || ' ';
+ args.url = args.url || args.file;
+ if (args.url) {
+ args.width = parseInt(args.width || 320, 10);
+ args.height = parseInt(args.height || 240, 10);
+ }
+ if (args.body) {
+ args.items = {
+ defaults: args.defaults,
+ type: args.bodyType || 'form',
+ items: args.body,
+ data: args.data,
+ callbacks: args.commands
+ };
+ }
+ if (!args.url && !args.buttons) {
+ args.buttons = [
+ {
+ text: 'Ok',
+ subtype: 'primary',
+ onclick: function () {
+ win.find('form')[0].submit();
+ }
+ },
+ {
+ text: 'Cancel',
+ onclick: function () {
+ win.close();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ];
+ }
+ win = new Window$$1(args);
+ win.on('close', function () {
+ closeCallback(win);
+ });
+ if (args.data) {
+ win.on('postRender', function () {
+ this.find('*').each(function (ctrl) {
+ var name$$1 = ctrl.name();
+ if (name$$1 in args.data) {
+ ctrl.value(args.data[name$$1]);
+ }
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ win.features = args || {};
+ win.params = params || {};
+ win = win.renderTo(document.body).reflow();
+ return win;
+ };
+ var alert$$1 = function (message, choiceCallback, closeCallback) {
+ var win;
+ win = MessageBox.alert(message, function () {
+ choiceCallback();
</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.features = args || {};
- win.params = params || {};
- win = win.renderTo(document.body).reflow();
- return win;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ win.on('close', function () {
+ closeCallback(win);
+ });
+ return win;
+ };
+ var confirm$$1 = function (message, choiceCallback, closeCallback) {
+ var win;
+ win = MessageBox.confirm(message, function (state) {
+ choiceCallback(state);
+ });
+ win.on('close', function () {
+ closeCallback(win);
+ });
+ return win;
+ };
+ var close$$1 = function (window$$1) {
+ window$$1.close();
+ };
+ var getParams = function (window$$1) {
+ return window$$1.params;
+ };
+ var setParams = function (window$$1, params) {
+ window$$1.params = params;
+ };
+ return {
+ open: open$$1,
+ alert: alert$$1,
+ confirm: confirm$$1,
+ close: close$$1,
+ getParams: getParams,
+ setParams: setParams
+ };
+ }
+
+ var get = function (editor, panel) {
+ var renderUI = function () {
+ return Render.renderUI(editor, panel);
+ };
+ return {
+ renderUI: renderUI,
+ getNotificationManagerImpl: function () {
+ return NotificationManagerImpl(editor);
+ },
+ getWindowManagerImpl: function () {
+ return WindowManagerImpl(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">- var alert$$1 = function (message, choiceCallback, closeCallback) {
- var win;
- win = MessageBox.alert(message, function () {
- choiceCallback();
- });
- win.on('close', function () {
- closeCallback(win);
- });
- return win;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ThemeApi = { get: get };
+
+ var Global = typeof window !== 'undefined' ? window : Function('return this;')();
+
+ var path = function (parts, scope) {
+ var o = scope !== undefined && scope !== null ? scope : Global;
+ for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i)
+ o = o[parts[i]];
+ return o;
</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 confirm$$1 = function (message, choiceCallback, closeCallback) {
- var win;
- win = MessageBox.confirm(message, function (state) {
- choiceCallback(state);
- });
- win.on('close', function () {
- closeCallback(win);
- });
- return win;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var resolve = function (p, scope) {
+ var parts = p.split('.');
+ return path(parts, scope);
</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 close$$1 = function (window$$1) {
- window$$1.close();
- };
- var getParams = function (window$$1) {
- return window$$1.params;
- };
- var setParams = function (window$$1, params) {
- window$$1.params = params;
- };
- return {
- open: open$$1,
- alert: alert$$1,
- confirm: confirm$$1,
- close: close$$1,
- getParams: getParams,
- setParams: setParams
- };
- }
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var get = function (editor, panel) {
- var renderUI = function () {
- return $_b0wxh217tjjgwejyx.renderUI(editor, panel);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var unsafe = function (name, scope) {
+ return resolve(name, scope);
</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 {
- renderUI: renderUI,
- getNotificationManagerImpl: function () {
- return NotificationManagerImpl(editor);
- },
- getWindowManagerImpl: function () {
- return WindowManagerImpl(editor);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getOrDie = function (name, scope) {
+ var actual = unsafe(name, scope);
+ if (actual === undefined || actual === null)
+ throw name + ' not available on this browser';
+ return actual;
</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 $_7y4x3k17sjjgwejyw = { get: get };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Global$1 = { getOrDie: getOrDie };
</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 Global = typeof window !== 'undefined' ? window : Function('return this;')();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function FileReader () {
+ var f = Global$1.getOrDie('FileReader');
+ return new f();
+ }
</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 path = function (parts, scope) {
- var o = scope !== undefined && scope !== null ? scope : Global;
- for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i)
- o = o[parts[i]];
- return o;
- };
- var resolve = function (p, scope) {
- var parts = p.split('.');
- return path(parts, scope);
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$c = tinymce.util.Tools.resolve('tinymce.util.Promise');
</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 unsafe = function (name, scope) {
- return resolve(name, scope);
- };
- var getOrDie = function (name, scope) {
- var actual = unsafe(name, scope);
- if (actual === undefined || actual === null)
- throw name + ' not available on this browser';
- return actual;
- };
- var $_8wnjhx19gjjgwek54 = { getOrDie: getOrDie };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var blobToBase64 = function (blob) {
+ return new global$c(function (resolve) {
+ var reader = FileReader();
+ reader.onloadend = function () {
+ resolve(reader.result.split(',')[1]);
+ };
+ reader.readAsDataURL(blob);
+ });
+ };
+ var Conversions = { blobToBase64: blobToBase64 };
</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 FileReader () {
- var f = $_8wnjhx19gjjgwek54.getOrDie('FileReader');
- return new f();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var pickFile = function () {
+ return new global$c(function (resolve) {
+ var fileInput;
+ fileInput = document.createElement('input');
+ fileInput.type = 'file';
+ fileInput.style.position = 'fixed';
+ fileInput.style.left = 0;
+ fileInput.style.top = 0;
+ fileInput.style.opacity = 0.001;
+ document.body.appendChild(fileInput);
+ fileInput.onchange = function (e) {
+ resolve(Array.prototype.slice.call(e.target.files));
+ };
+ fileInput.click();
+ fileInput.parentNode.removeChild(fileInput);
+ });
+ };
+ var Picker = { pickFile: pickFile };
</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 global$12 = tinymce.util.Tools.resolve('tinymce.util.Promise');
-
- var blobToBase64 = function (blob) {
- return new global$12(function (resolve) {
- var reader = new FileReader();
- reader.onloadend = function () {
- resolve(reader.result.split(',')[1]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var count$1 = 0;
+ var seed = function () {
+ var rnd = function () {
+ return Math.round(Math.random() * 4294967295).toString(36);
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- reader.readAsDataURL(blob);
- });
- };
- var $_c292419ejjgwek4z = { blobToBase64: blobToBase64 };
-
- var pickFile = function () {
- return new global$12(function (resolve) {
- var fileInput;
- fileInput = document.createElement('input');
- fileInput.type = 'file';
- fileInput.style.position = 'fixed';
- fileInput.style.left = 0;
- fileInput.style.top = 0;
- fileInput.style.opacity = 0.001;
- document.body.appendChild(fileInput);
- fileInput.onchange = function (e) {
- resolve(Array.prototype.slice.call(e.target.files));
- };
- fileInput.click();
- fileInput.parentNode.removeChild(fileInput);
- });
- };
- var $_edjfwb19kjjgwek5a = { pickFile: pickFile };
-
- var count$1 = 0;
- var seed = function () {
- var rnd = function () {
- return Math.round(Math.random() * 4294967295).toString(36);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 's' + Date.now().toString(36) + rnd() + rnd() + rnd();
</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 's' + Date.now().toString(36) + rnd() + rnd() + rnd();
- };
- var uuid = function (prefix) {
- return prefix + count$1++ + seed();
- };
- var $_49gxzf19mjjgwek5f = { uuid: uuid };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var uuid = function (prefix) {
+ return prefix + count$1++ + seed();
+ };
+ var Uuid = { uuid: uuid };
</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 create$1 = function (dom, rng) {
- var bookmark = {};
- function setupEndPoint(start) {
- var offsetNode, container, offset;
- container = rng[start ? 'startContainer' : 'endContainer'];
- offset = rng[start ? 'startOffset' : 'endOffset'];
- if (container.nodeType === 1) {
- offsetNode = dom.create('span', { 'data-mce-type': 'bookmark' });
- if (container.hasChildNodes()) {
- offset = Math.min(offset, container.childNodes.length - 1);
- if (start) {
- container.insertBefore(offsetNode, container.childNodes[offset]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var create$1 = function (dom, rng) {
+ var bookmark = {};
+ function setupEndPoint(start) {
+ var offsetNode, container, offset;
+ container = rng[start ? 'startContainer' : 'endContainer'];
+ offset = rng[start ? 'startOffset' : 'endOffset'];
+ if (container.nodeType === 1) {
+ offsetNode = dom.create('span', { 'data-mce-type': 'bookmark' });
+ if (container.hasChildNodes()) {
+ offset = Math.min(offset, container.childNodes.length - 1);
+ if (start) {
+ container.insertBefore(offsetNode, container.childNodes[offset]);
+ } else {
+ dom.insertAfter(offsetNode, container.childNodes[offset]);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- dom.insertAfter(offsetNode, container.childNodes[offset]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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">- } else {
- container.appendChild(offsetNode);
</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">- container = offsetNode;
- offset = 0;
</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">- bookmark[start ? 'startContainer' : 'endContainer'] = container;
- bookmark[start ? 'startOffset' : 'endOffset'] = offset;
- }
- setupEndPoint(true);
- if (!rng.collapsed) {
- setupEndPoint();
- }
- return bookmark;
- };
- var resolve$1 = function (dom, bookmark) {
- function restoreEndPoint(start) {
- var container, offset, node;
- function nodeIndex(container) {
- var node = container.parentNode.firstChild, idx = 0;
- while (node) {
- if (node === container) {
- return idx;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ setupEndPoint(true);
+ if (!rng.collapsed) {
+ setupEndPoint();
+ }
+ return bookmark;
+ };
+ var resolve$1 = function (dom, bookmark) {
+ function restoreEndPoint(start) {
+ var container, offset, node;
+ function nodeIndex(container) {
+ var node = container.parentNode.firstChild, idx = 0;
+ while (node) {
+ if (node === container) {
+ return idx;
+ }
+ if (node.nodeType !== 1 || node.getAttribute('data-mce-type') !== 'bookmark') {
+ idx++;
+ }
+ 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">- if (node.nodeType !== 1 || node.getAttribute('data-mce-type') !== 'bookmark') {
- idx++;
- }
- node = node.nextSibling;
</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">- return -1;
</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'];
+ if (!container) {
+ return;
+ }
+ if (container.nodeType === 1) {
+ offset = nodeIndex(container);
+ container = container.parentNode;
+ dom.remove(node);
+ }
+ 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">- container = node = bookmark[start ? 'startContainer' : 'endContainer'];
- offset = bookmark[start ? 'startOffset' : 'endOffset'];
- if (!container) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ restoreEndPoint(true);
+ restoreEndPoint();
+ var rng = dom.createRng();
+ rng.setStart(bookmark.startContainer, bookmark.startOffset);
+ 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">- if (container.nodeType === 1) {
- offset = nodeIndex(container);
- container = container.parentNode;
- dom.remove(node);
- }
- bookmark[start ? 'startContainer' : 'endContainer'] = container;
- bookmark[start ? 'startOffset' : 'endOffset'] = offset;
- }
- restoreEndPoint(true);
- restoreEndPoint();
- var rng = dom.createRng();
- rng.setStart(bookmark.startContainer, bookmark.startOffset);
- if (bookmark.endContainer) {
- rng.setEnd(bookmark.endContainer, bookmark.endOffset);
- }
- return rng;
- };
- var $_3b24e19ojjgwek5i = {
- create: create$1,
- resolve: resolve$1
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return rng;
+ };
+ var Bookmark = {
+ create: create$1,
+ resolve: resolve$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">- var global$13 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$d = tinymce.util.Tools.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">- var global$14 = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$e = tinymce.util.Tools.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">- var getSelectedElements = function (rootElm, startNode, endNode) {
- var walker, node;
- var elms = [];
- walker = new global$13(startNode, rootElm);
- for (node = startNode; node; node = walker.next()) {
- if (node.nodeType === 1) {
- elms.push(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getSelectedElements = function (rootElm, startNode, endNode) {
+ var walker, node;
+ var elms = [];
+ walker = new global$d(startNode, rootElm);
+ for (node = startNode; node; node = walker.next()) {
+ if (node.nodeType === 1) {
+ elms.push(node);
+ }
+ 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">- if (node === endNode) {
- break;
- }
- }
- return elms;
- };
- var unwrapElements = function (editor, elms) {
- var bookmark, dom, selection;
- dom = editor.dom;
- selection = editor.selection;
- bookmark = $_3b24e19ojjgwek5i.create(dom, selection.getRng());
- global$4.each(elms, function (elm) {
- editor.dom.remove(elm, true);
- });
- selection.setRng($_3b24e19ojjgwek5i.resolve(dom, bookmark));
- };
- var isLink = function (elm) {
- return elm.nodeName === 'A' && elm.hasAttribute('href');
- };
- var getParentAnchorOrSelf = function (dom, elm) {
- var anchorElm = dom.getParent(elm, isLink);
- return anchorElm ? anchorElm : elm;
- };
- var getSelectedAnchors = function (editor) {
- var startElm, endElm, rootElm, anchorElms, selection, dom, rng;
- selection = editor.selection;
- dom = editor.dom;
- rng = selection.getRng();
- startElm = getParentAnchorOrSelf(dom, global$14.getNode(rng.startContainer, rng.startOffset));
- endElm = global$14.getNode(rng.endContainer, rng.endOffset);
- rootElm = editor.getBody();
- anchorElms = global$4.grep(getSelectedElements(rootElm, startElm, endElm), isLink);
- return anchorElms;
- };
- var unlinkSelection = function (editor) {
- unwrapElements(editor, getSelectedAnchors(editor));
- };
- var $_aunbnv19njjgwek5g = { unlinkSelection: unlinkSelection };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return elms;
+ };
+ var unwrapElements = function (editor, elms) {
+ var bookmark, dom, selection;
+ dom = editor.dom;
+ selection = editor.selection;
+ bookmark = Bookmark.create(dom, selection.getRng());
+ global$4.each(elms, function (elm) {
+ editor.dom.remove(elm, true);
+ });
+ selection.setRng(Bookmark.resolve(dom, bookmark));
+ };
+ var isLink = function (elm) {
+ return elm.nodeName === 'A' && elm.hasAttribute('href');
+ };
+ var getParentAnchorOrSelf = function (dom, elm) {
+ var anchorElm = dom.getParent(elm, isLink);
+ return anchorElm ? anchorElm : elm;
+ };
+ var getSelectedAnchors = function (editor) {
+ var startElm, endElm, rootElm, anchorElms, selection, dom, rng;
+ selection = editor.selection;
+ dom = editor.dom;
+ rng = selection.getRng();
+ startElm = getParentAnchorOrSelf(dom, global$e.getNode(rng.startContainer, rng.startOffset));
+ endElm = global$e.getNode(rng.endContainer, rng.endOffset);
+ rootElm = editor.getBody();
+ anchorElms = global$4.grep(getSelectedElements(rootElm, startElm, endElm), isLink);
+ return anchorElms;
+ };
+ var unlinkSelection = function (editor) {
+ unwrapElements(editor, getSelectedAnchors(editor));
+ };
+ var Unlink = { unlinkSelection: unlinkSelection };
</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 createTableHtml = function (cols, rows) {
- var x, y, html;
- html = '<table data-mce-id="mce" style="width: 100%">';
- html += '<tbody>';
- for (y = 0; y < rows; y++) {
- html += '<tr>';
- for (x = 0; x < cols; x++) {
- html += '<td><br></td>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createTableHtml = function (cols, rows) {
+ var x, y, html;
+ html = '<table data-mce-id="mce" style="width: 100%">';
+ html += '<tbody>';
+ for (y = 0; y < rows; y++) {
+ html += '<tr>';
+ for (x = 0; x < cols; x++) {
+ html += '<td><br></td>';
+ }
+ html += '</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">- html += '</tr>';
- }
- html += '</tbody>';
- html += '</table>';
- return html;
- };
- var getInsertedElement = function (editor) {
- var elms = editor.dom.select('*[data-mce-id]');
- return elms[0];
- };
- var insertTableHtml = function (editor, cols, rows) {
- editor.undoManager.transact(function () {
- var tableElm, cellElm;
- editor.insertContent(createTableHtml(cols, rows));
- tableElm = getInsertedElement(editor);
- tableElm.removeAttribute('data-mce-id');
- cellElm = editor.dom.select('td,th', tableElm);
- editor.selection.setCursorLocation(cellElm[0], 0);
- });
- };
- var insertTable = function (editor, cols, rows) {
- editor.plugins.table ? editor.plugins.table.insertTable(cols, rows) : insertTableHtml(editor, cols, rows);
- };
- var formatBlock = function (editor, formatName) {
- editor.execCommand('FormatBlock', false, formatName);
- };
- var insertBlob = function (editor, base64, blob) {
- var blobCache, blobInfo;
- blobCache = editor.editorUpload.blobCache;
- blobInfo = blobCache.create($_49gxzf19mjjgwek5f.uuid('mceu'), blob, base64);
- blobCache.add(blobInfo);
- editor.insertContent(editor.dom.createHTML('img', { src: blobInfo.blobUri() }));
- };
- var collapseSelectionToEnd = function (editor) {
- editor.selection.collapse(false);
- };
- var unlink = function (editor) {
- editor.focus();
- $_aunbnv19njjgwek5g.unlinkSelection(editor);
- collapseSelectionToEnd(editor);
- };
- var changeHref = function (editor, elm, url) {
- editor.focus();
- editor.dom.setAttrib(elm, 'href', url);
- collapseSelectionToEnd(editor);
- };
- var insertLink = function (editor, url) {
- editor.execCommand('mceInsertLink', false, { href: url });
- collapseSelectionToEnd(editor);
- };
- var updateOrInsertLink = function (editor, url) {
- var elm = editor.dom.getParent(editor.selection.getStart(), 'a[href]');
- elm ? changeHref(editor, elm, url) : insertLink(editor, url);
- };
- var createLink = function (editor, url) {
- url.trim().length === 0 ? unlink(editor) : updateOrInsertLink(editor, url);
- };
- var $_elxm3u19ljjgwek5d = {
- insertTable: insertTable,
- formatBlock: formatBlock,
- insertBlob: insertBlob,
- createLink: createLink,
- unlink: unlink
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ html += '</tbody>';
+ html += '</table>';
+ return html;
+ };
+ var getInsertedElement = function (editor) {
+ var elms = editor.dom.select('*[data-mce-id]');
+ return elms[0];
+ };
+ var insertTableHtml = function (editor, cols, rows) {
+ editor.undoManager.transact(function () {
+ var tableElm, cellElm;
+ editor.insertContent(createTableHtml(cols, rows));
+ tableElm = getInsertedElement(editor);
+ tableElm.removeAttribute('data-mce-id');
+ cellElm = editor.dom.select('td,th', tableElm);
+ editor.selection.setCursorLocation(cellElm[0], 0);
+ });
+ };
+ var insertTable = function (editor, cols, rows) {
+ editor.plugins.table ? editor.plugins.table.insertTable(cols, rows) : insertTableHtml(editor, cols, rows);
+ };
+ var formatBlock = function (editor, formatName) {
+ editor.execCommand('FormatBlock', false, formatName);
+ };
+ var insertBlob = function (editor, base64, blob) {
+ var blobCache, blobInfo;
+ blobCache = editor.editorUpload.blobCache;
+ blobInfo = blobCache.create(Uuid.uuid('mceu'), blob, base64);
+ blobCache.add(blobInfo);
+ editor.insertContent(editor.dom.createHTML('img', { src: blobInfo.blobUri() }));
+ };
+ var collapseSelectionToEnd = function (editor) {
+ editor.selection.collapse(false);
+ };
+ var unlink = function (editor) {
+ editor.focus();
+ Unlink.unlinkSelection(editor);
+ collapseSelectionToEnd(editor);
+ };
+ var changeHref = function (editor, elm, url) {
+ editor.focus();
+ editor.dom.setAttrib(elm, 'href', url);
+ collapseSelectionToEnd(editor);
+ };
+ var insertLink = function (editor, url) {
+ editor.execCommand('mceInsertLink', false, { href: url });
+ collapseSelectionToEnd(editor);
+ };
+ var updateOrInsertLink = function (editor, url) {
+ var elm = editor.dom.getParent(editor.selection.getStart(), 'a[href]');
+ elm ? changeHref(editor, elm, url) : insertLink(editor, url);
+ };
+ var createLink = function (editor, url) {
+ url.trim().length === 0 ? unlink(editor) : updateOrInsertLink(editor, url);
+ };
+ var Actions = {
+ insertTable: insertTable,
+ formatBlock: formatBlock,
+ insertBlob: insertBlob,
+ createLink: createLink,
+ unlink: unlink
+ };
</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 addHeaderButtons = function (editor) {
- var formatBlock = function (name) {
- return function () {
- $_elxm3u19ljjgwek5d.formatBlock(editor, name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var addHeaderButtons = function (editor) {
+ var formatBlock = function (name) {
+ return function () {
+ Actions.formatBlock(editor, name);
+ };
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (var i = 1; i < 6; i++) {
+ var name = 'h' + i;
+ editor.addButton(name, {
+ text: name.toUpperCase(),
+ tooltip: 'Heading ' + i,
+ stateSelector: name,
+ onclick: formatBlock(name),
+ onPostRender: function () {
+ var span = this.getEl().firstChild.firstChild;
+ span.style.fontWeight = 'bold';
+ }
+ });
+ }
</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 i = 1; i < 6; i++) {
- var name = 'h' + i;
- editor.addButton(name, {
- text: name.toUpperCase(),
- tooltip: 'Heading ' + i,
- stateSelector: name,
- onclick: formatBlock(name),
- onPostRender: function () {
- var span = this.getEl().firstChild.firstChild;
- span.style.fontWeight = 'bold';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var addToEditor = function (editor, panel) {
+ editor.addButton('quicklink', {
+ icon: 'link',
+ tooltip: 'Insert/Edit link',
+ stateSelector: 'a[href]',
+ onclick: function () {
+ panel.showForm(editor, 'quicklink');
</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">- }
- };
- var addToEditor = function (editor, panel) {
- editor.addButton('quicklink', {
- icon: 'link',
- tooltip: 'Insert/Edit link',
- stateSelector: 'a[href]',
- onclick: function () {
- panel.showForm(editor, 'quicklink');
- }
- });
- editor.addButton('quickimage', {
- icon: 'image',
- tooltip: 'Insert image',
- onclick: function () {
- $_edjfwb19kjjgwek5a.pickFile().then(function (files) {
- var blob = files[0];
- $_c292419ejjgwek4z.blobToBase64(blob).then(function (base64) {
- $_elxm3u19ljjgwek5d.insertBlob(editor, base64, blob);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.addButton('quickimage', {
+ icon: 'image',
+ tooltip: 'Insert image',
+ onclick: function () {
+ Picker.pickFile().then(function (files) {
+ var blob = files[0];
+ Conversions.blobToBase64(blob).then(function (base64) {
+ Actions.insertBlob(editor, base64, blob);
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ });
+ editor.addButton('quicktable', {
+ icon: 'table',
+ tooltip: 'Insert table',
+ onclick: function () {
+ panel.hide();
+ Actions.insertTable(editor, 2, 2);
+ }
+ });
+ addHeaderButtons(editor);
+ };
+ var Buttons = { addToEditor: addToEditor };
+
+ var getUiContainerDelta$1 = function () {
+ var uiContainer = global$1.container;
+ if (uiContainer && global$2.DOM.getStyle(uiContainer, 'position', true) !== 'static') {
+ var containerPos = global$2.DOM.getPos(uiContainer);
+ var dx = containerPos.x - uiContainer.scrollLeft;
+ var dy = containerPos.y - uiContainer.scrollTop;
+ return Option.some({
+ x: dx,
+ y: dy
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ return Option.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">- });
- editor.addButton('quicktable', {
- icon: 'table',
- tooltip: 'Insert table',
- onclick: function () {
- panel.hide();
- $_elxm3u19ljjgwek5d.insertTable(editor, 2, 2);
- }
- });
- addHeaderButtons(editor);
- };
- var $_epdxt419djjgwek4l = { addToEditor: addToEditor };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var UiContainer$1 = { getUiContainerDelta: getUiContainerDelta$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">- var getUiContainerDelta$1 = function () {
- var uiContainer = global$1.container;
- if (uiContainer && global$2.DOM.getStyle(uiContainer, 'position', true) !== 'static') {
- var containerPos = global$2.DOM.getPos(uiContainer);
- var dx = containerPos.x - uiContainer.scrollLeft;
- var dy = containerPos.y - uiContainer.scrollTop;
- return Option.some({
- x: dx,
- y: dy
- });
- } else {
- return Option.none();
- }
- };
- var $_9hbv4x19sjjgwek5q = { getUiContainerDelta: getUiContainerDelta$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isDomainLike = function (href) {
+ return /^www\.|\.(com|org|edu|gov|uk|net|ca|de|jp|fr|au|us|ru|ch|it|nl|se|no|es|mil)$/i.test(href.trim());
+ };
+ var isAbsolute = function (href) {
+ return /^https?:\/\//.test(href.trim());
+ };
+ var UrlType = {
+ isDomainLike: isDomainLike,
+ isAbsolute: isAbsolute
+ };
</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 isDomainLike = function (href) {
- return /^www\.|\.(com|org|edu|gov|uk|net|ca|de|jp|fr|au|us|ru|ch|it|nl|se|no|es|mil)$/i.test(href.trim());
- };
- var isAbsolute = function (href) {
- return /^https?:\/\//.test(href.trim());
- };
- var $_5y05uk19ujjgwek5w = {
- isDomainLike: isDomainLike,
- isAbsolute: isAbsolute
- };
-
- var focusFirstTextBox = function (form) {
- form.find('textbox').eq(0).each(function (ctrl) {
- ctrl.focus();
- });
- };
- var createForm = function (name, spec) {
- var form = global$11.create(global$4.extend({
- type: 'form',
- layout: 'flex',
- direction: 'row',
- padding: 5,
- name: name,
- spacing: 3
- }, spec));
- form.on('show', function () {
- focusFirstTextBox(form);
- });
- return form;
- };
- var toggleVisibility = function (ctrl, state) {
- return state ? ctrl.show() : ctrl.hide();
- };
- var askAboutPrefix = function (editor, href) {
- return new global$12(function (resolve) {
- editor.windowManager.confirm('The URL you entered seems to be an external link. Do you want to add the required http:// prefix?', function (result) {
- var output = result === true ? 'http://' + href : href;
- resolve(output);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var focusFirstTextBox = function (form) {
+ form.find('textbox').eq(0).each(function (ctrl) {
+ ctrl.focus();
</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 convertLinkToAbsolute = function (editor, href) {
- return !$_5y05uk19ujjgwek5w.isAbsolute(href) && $_5y05uk19ujjgwek5w.isDomainLike(href) ? askAboutPrefix(editor, href) : global$12.resolve(href);
- };
- var createQuickLinkForm = function (editor, hide) {
- var attachState = {};
- var unlink = function () {
- editor.focus();
- $_elxm3u19ljjgwek5d.unlink(editor);
- hide();
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var onChangeHandler = function (e) {
- var meta = e.meta;
- if (meta && meta.attach) {
- attachState = {
- href: this.value(),
- attach: meta.attach
- };
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createForm = function (name, spec) {
+ var form = global$b.create(global$4.extend({
+ type: 'form',
+ layout: 'flex',
+ direction: 'row',
+ padding: 5,
+ name: name,
+ spacing: 3
+ }, spec));
+ form.on('show', function () {
+ focusFirstTextBox(form);
+ });
+ return form;
</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 onShowHandler = function (e) {
- if (e.control === this) {
- var elm = void 0, linkurl = '';
- elm = editor.dom.getParent(editor.selection.getStart(), 'a[href]');
- if (elm) {
- linkurl = editor.dom.getAttrib(elm, 'href');
- }
- this.fromJSON({ linkurl: linkurl });
- toggleVisibility(this.find('#unlink'), elm);
- this.find('#linkurl')[0].focus();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var toggleVisibility = function (ctrl, state) {
+ return state ? ctrl.show() : ctrl.hide();
</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 createForm('quicklink', {
- items: [
- {
- type: 'button',
- name: 'unlink',
- icon: 'unlink',
- onclick: unlink,
- tooltip: 'Remove link'
- },
- {
- type: 'filepicker',
- name: 'linkurl',
- placeholder: 'Paste or type a link',
- filetype: 'file',
- onchange: onChangeHandler
- },
- {
- type: 'button',
- icon: 'checkmark',
- subtype: 'primary',
- tooltip: 'Ok',
- onclick: 'submit'
- }
- ],
- onshow: onShowHandler,
- onsubmit: function (e) {
- convertLinkToAbsolute(editor, e.data.linkurl).then(function (url) {
- editor.undoManager.transact(function () {
- if (url === attachState.href) {
- attachState.attach();
- attachState = {};
- }
- $_elxm3u19ljjgwek5d.createLink(editor, url);
- });
- hide();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var askAboutPrefix = function (editor, href) {
+ return new global$c(function (resolve) {
+ editor.windowManager.confirm('The URL you entered seems to be an external link. Do you want to add the required http:// prefix?', function (result) {
+ var output = result === true ? 'http://' + href : href;
+ resolve(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">- }
- });
- };
- var $_amewps19tjjgwek5t = { createQuickLinkForm: createQuickLinkForm };
-
- var getSelectorStateResult = function (itemName, item) {
- var result = function (selector, handler) {
- return {
- selector: selector,
- handler: handler
- };
</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">- var activeHandler = function (state) {
- item.active(state);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var convertLinkToAbsolute = function (editor, href) {
+ return !UrlType.isAbsolute(href) && UrlType.isDomainLike(href) ? askAboutPrefix(editor, href) : global$c.resolve(href);
</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 disabledHandler = function (state) {
- item.disabled(state);
- };
- if (item.settings.stateSelector) {
- return result(item.settings.stateSelector, activeHandler);
- }
- if (item.settings.disabledStateSelector) {
- return result(item.settings.disabledStateSelector, disabledHandler);
- }
- return null;
- };
- var bindSelectorChanged = function (editor, itemName, item) {
- return function () {
- var result = getSelectorStateResult(itemName, item);
- if (result !== null) {
- editor.selection.selectorChanged(result.selector, result.handler);
- }
- };
- };
- var itemsToArray$1 = function (items) {
- if ($_e4npq318ajjgwejzo.isArray(items)) {
- return items;
- } else if ($_e4npq318ajjgwejzo.isString(items)) {
- return items.split(/[ ,]/);
- }
- return [];
- };
- var create$2 = function (editor, name, items) {
- var toolbarItems = [];
- var buttonGroup;
- if (!items) {
- return;
- }
- global$4.each(itemsToArray$1(items), function (item) {
- if (item === '|') {
- buttonGroup = null;
- } else {
- if (editor.buttons[item]) {
- if (!buttonGroup) {
- buttonGroup = {
- type: 'buttongroup',
- items: []
- };
- toolbarItems.push(buttonGroup);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createQuickLinkForm = function (editor, hide) {
+ var attachState = {};
+ var unlink = function () {
+ editor.focus();
+ Actions.unlink(editor);
+ hide();
+ };
+ var onChangeHandler = function (e) {
+ var meta = e.meta;
+ if (meta && meta.attach) {
+ attachState = {
+ href: this.value(),
+ attach: meta.attach
+ };
+ }
+ };
+ var onShowHandler = function (e) {
+ if (e.control === this) {
+ var elm = void 0, linkurl = '';
+ elm = editor.dom.getParent(editor.selection.getStart(), 'a[href]');
+ if (elm) {
+ linkurl = editor.dom.getAttrib(elm, 'href');
</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 button = editor.buttons[item];
- if ($_e4npq318ajjgwejzo.isFunction(button)) {
- button = button();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.fromJSON({ linkurl: linkurl });
+ toggleVisibility(this.find('#unlink'), elm);
+ this.find('#linkurl')[0].focus();
+ }
+ };
+ return createForm('quicklink', {
+ items: [
+ {
+ type: 'button',
+ name: 'unlink',
+ icon: 'unlink',
+ onclick: unlink,
+ tooltip: 'Remove link'
+ },
+ {
+ type: 'filepicker',
+ name: 'linkurl',
+ placeholder: 'Paste or type a link',
+ filetype: 'file',
+ onchange: onChangeHandler
+ },
+ {
+ type: 'button',
+ icon: 'checkmark',
+ subtype: 'primary',
+ tooltip: 'Ok',
+ onclick: 'submit'
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- button.type = button.type || 'button';
- button = global$11.create(button);
- button.on('postRender', bindSelectorChanged(editor, item, button));
- buttonGroup.items.push(button);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ],
+ onshow: onShowHandler,
+ onsubmit: function (e) {
+ convertLinkToAbsolute(editor, e.data.linkurl).then(function (url) {
+ editor.undoManager.transact(function () {
+ if (url === attachState.href) {
+ attachState.attach();
+ attachState = {};
+ }
+ Actions.createLink(editor, url);
+ });
+ hide();
+ });
</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 global$11.create({
- type: 'toolbar',
- layout: 'flow',
- name: name,
- items: toolbarItems
- });
- };
- var $_797pa819vjjgwek5x = { create: create$2 };
-
- var create$3 = function () {
- var panel, currentRect;
- var createToolbars = function (editor, toolbars) {
- return global$4.map(toolbars, function (toolbar) {
- return $_797pa819vjjgwek5x.create(editor, toolbar.id, toolbar.items);
</del><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">- var hasToolbarItems = function (toolbar) {
- return toolbar.items().length > 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Forms = { createQuickLinkForm: createQuickLinkForm };
+
+ var getSelectorStateResult = function (itemName, item) {
+ var result = function (selector, handler) {
+ return {
+ selector: selector,
+ handler: handler
+ };
+ };
+ var activeHandler = function (state) {
+ item.active(state);
+ };
+ var disabledHandler = function (state) {
+ item.disabled(state);
+ };
+ if (item.settings.stateSelector) {
+ return result(item.settings.stateSelector, activeHandler);
+ }
+ if (item.settings.disabledStateSelector) {
+ return result(item.settings.disabledStateSelector, disabledHandler);
+ }
+ return 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">- var create = function (editor, toolbars) {
- var items = createToolbars(editor, toolbars).concat([
- $_797pa819vjjgwek5x.create(editor, 'text', $_4j2h42187jjgwejzk.getTextSelectionToolbarItems(editor)),
- $_797pa819vjjgwek5x.create(editor, 'insert', $_4j2h42187jjgwejzk.getInsertToolbarItems(editor)),
- $_amewps19tjjgwek5t.createQuickLinkForm(editor, hide)
- ]);
- return global$11.create({
- type: 'floatpanel',
- role: 'dialog',
- classes: 'tinymce tinymce-inline arrow',
- ariaLabel: 'Inline toolbar',
- layout: 'flex',
- direction: 'column',
- align: 'stretch',
- autohide: false,
- autofix: true,
- fixed: true,
- border: 1,
- items: global$4.grep(items, hasToolbarItems),
- oncancel: function () {
- editor.focus();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var bindSelectorChanged = function (editor, itemName, item) {
+ return function () {
+ var result = getSelectorStateResult(itemName, item);
+ if (result !== null) {
+ editor.selection.selectorChanged(result.selector, result.handler);
</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">+ };
</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 showPanel = function (panel) {
- if (panel) {
- panel.show();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var itemsToArray$1 = function (items) {
+ if (Type.isArray(items)) {
+ return items;
+ } else if (Type.isString(items)) {
+ return items.split(/[ ,]/);
</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 [];
</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 movePanelTo = function (panel, pos) {
- panel.moveTo(pos.x, pos.y);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var create$2 = function (editor, name, items) {
+ var toolbarItems = [];
+ var buttonGroup;
+ if (!items) {
+ return;
+ }
+ global$4.each(itemsToArray$1(items), function (item) {
+ if (item === '|') {
+ buttonGroup = null;
+ } else {
+ if (editor.buttons[item]) {
+ if (!buttonGroup) {
+ buttonGroup = {
+ type: 'buttongroup',
+ items: []
+ };
+ toolbarItems.push(buttonGroup);
+ }
+ var button = editor.buttons[item];
+ if (Type.isFunction(button)) {
+ button = button();
+ }
+ button.type = button.type || 'button';
+ button = global$b.create(button);
+ button.on('postRender', bindSelectorChanged(editor, item, button));
+ buttonGroup.items.push(button);
+ }
+ }
+ });
+ return global$b.create({
+ type: 'toolbar',
+ layout: 'flow',
+ name: name,
+ items: toolbarItems
+ });
</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 togglePositionClass = function (panel, relPos) {
- relPos = relPos ? relPos.substr(0, 2) : '';
- global$4.each({
- t: 'down',
- b: 'up',
- c: 'center'
- }, function (cls, pos) {
- panel.classes.toggle('arrow-' + cls, pos === relPos.substr(0, 1));
- });
- if (relPos === 'cr') {
- panel.classes.toggle('arrow-left', true);
- panel.classes.toggle('arrow-right', false);
- } else if (relPos === 'cl') {
- panel.classes.toggle('arrow-left', true);
- panel.classes.toggle('arrow-right', true);
- } else {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Toolbar = { create: create$2 };
+
+ var create$3 = function () {
+ var panel, currentRect;
+ var createToolbars = function (editor, toolbars) {
+ return global$4.map(toolbars, function (toolbar) {
+ return Toolbar.create(editor, toolbar.id, toolbar.items);
+ });
+ };
+ var hasToolbarItems = function (toolbar) {
+ return toolbar.items().length > 0;
+ };
+ var create = function (editor, toolbars) {
+ var items = createToolbars(editor, toolbars).concat([
+ Toolbar.create(editor, 'text', Settings.getTextSelectionToolbarItems(editor)),
+ Toolbar.create(editor, 'insert', Settings.getInsertToolbarItems(editor)),
+ Forms.createQuickLinkForm(editor, hide)
+ ]);
+ return global$b.create({
+ type: 'floatpanel',
+ role: 'dialog',
+ classes: 'tinymce tinymce-inline arrow',
+ ariaLabel: 'Inline toolbar',
+ layout: 'flex',
+ direction: 'column',
+ align: 'stretch',
+ autohide: false,
+ autofix: true,
+ fixed: true,
+ border: 1,
+ items: global$4.grep(items, hasToolbarItems),
+ oncancel: function () {
+ editor.focus();
+ }
+ });
+ };
+ var showPanel = function (panel) {
+ if (panel) {
+ panel.show();
+ }
+ };
+ var movePanelTo = function (panel, pos) {
+ panel.moveTo(pos.x, pos.y);
+ };
+ var togglePositionClass = function (panel, relPos) {
+ relPos = relPos ? relPos.substr(0, 2) : '';
</ins><span class="cx" style="display: block; padding: 0 10px"> global$4.each({
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- l: 'left',
- r: 'right'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ t: 'down',
+ b: 'up',
+ c: 'center'
</ins><span class="cx" style="display: block; padding: 0 10px"> }, function (cls, pos) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- panel.classes.toggle('arrow-' + cls, pos === relPos.substr(1, 1));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ panel.classes.toggle('arrow-' + cls, pos === relPos.substr(0, 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">- }
- };
- var showToolbar = function (panel, id) {
- var toolbars = panel.items().filter('#' + id);
- if (toolbars.length > 0) {
- toolbars[0].show();
- panel.reflow();
- return true;
- }
- return false;
- };
- var repositionPanelAt = function (panel, id, editor, targetRect) {
- var contentAreaRect, panelRect, result, userConstainHandler;
- userConstainHandler = $_4j2h42187jjgwejzk.getPositionHandler(editor);
- contentAreaRect = $_51qgo2180jjgwejzb.getContentAreaRect(editor);
- panelRect = global$2.DOM.getRect(panel.getEl());
- if (id === 'insert') {
- result = $_gir42l18bjjgwejzq.calcInsert(targetRect, contentAreaRect, panelRect);
- } else {
- result = $_gir42l18bjjgwejzq.calc(targetRect, contentAreaRect, panelRect);
- }
- if (result) {
- var delta = $_9hbv4x19sjjgwek5q.getUiContainerDelta().getOr({
- x: 0,
- y: 0
- });
- var transposedPanelRect = {
- x: result.rect.x - delta.x,
- y: result.rect.y - delta.y,
- w: result.rect.w,
- h: result.rect.h
- };
- currentRect = targetRect;
- movePanelTo(panel, $_gir42l18bjjgwejzq.userConstrain(userConstainHandler, targetRect, contentAreaRect, transposedPanelRect));
- togglePositionClass(panel, result.position);
- return true;
- } else {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (relPos === 'cr') {
+ panel.classes.toggle('arrow-left', true);
+ panel.classes.toggle('arrow-right', false);
+ } else if (relPos === 'cl') {
+ panel.classes.toggle('arrow-left', false);
+ panel.classes.toggle('arrow-right', true);
+ } else {
+ global$4.each({
+ l: 'left',
+ r: 'right'
+ }, function (cls, pos) {
+ panel.classes.toggle('arrow-' + cls, pos === relPos.substr(1, 1));
+ });
+ }
+ };
+ var showToolbar = function (panel, id) {
+ var toolbars = panel.items().filter('#' + id);
+ if (toolbars.length > 0) {
+ toolbars[0].show();
+ panel.reflow();
+ return true;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- };
- var showPanelAt = function (panel, id, editor, targetRect) {
- showPanel(panel);
- panel.items().hide();
- if (!showToolbar(panel, id)) {
- hide();
- return;
- }
- if (repositionPanelAt(panel, id, editor, targetRect) === false) {
- hide();
- }
- };
- var hasFormVisible = function () {
- return panel.items().filter('form:visible').length > 0;
- };
- var showForm = function (editor, id) {
- if (panel) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var repositionPanelAt = function (panel, id, editor, targetRect) {
+ var contentAreaRect, panelRect, result, userConstainHandler;
+ userConstainHandler = Settings.getPositionHandler(editor);
+ contentAreaRect = Measure.getContentAreaRect(editor);
+ panelRect = global$2.DOM.getRect(panel.getEl());
+ if (id === 'insert') {
+ result = Layout.calcInsert(targetRect, contentAreaRect, panelRect);
+ } else {
+ result = Layout.calc(targetRect, contentAreaRect, panelRect);
+ }
+ if (result) {
+ var delta = UiContainer$1.getUiContainerDelta().getOr({
+ x: 0,
+ y: 0
+ });
+ var transposedPanelRect = {
+ x: result.rect.x - delta.x,
+ y: result.rect.y - delta.y,
+ w: result.rect.w,
+ h: result.rect.h
+ };
+ currentRect = targetRect;
+ movePanelTo(panel, Layout.userConstrain(userConstainHandler, targetRect, contentAreaRect, transposedPanelRect));
+ togglePositionClass(panel, result.position);
+ return true;
+ } else {
+ return false;
+ }
+ };
+ var showPanelAt = function (panel, id, editor, targetRect) {
+ showPanel(panel);
</ins><span class="cx" style="display: block; padding: 0 10px"> panel.items().hide();
</span><span class="cx" style="display: block; padding: 0 10px"> if (!showToolbar(panel, id)) {
</span><span class="cx" style="display: block; padding: 0 10px"> hide();
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var contentAreaRect = void 0, panelRect = void 0, result = void 0, userConstainHandler = void 0;
- showPanel(panel);
- panel.items().hide();
- showToolbar(panel, id);
- userConstainHandler = $_4j2h42187jjgwejzk.getPositionHandler(editor);
- contentAreaRect = $_51qgo2180jjgwejzb.getContentAreaRect(editor);
- panelRect = global$2.DOM.getRect(panel.getEl());
- result = $_gir42l18bjjgwejzq.calc(currentRect, contentAreaRect, panelRect);
- if (result) {
- panelRect = result.rect;
- movePanelTo(panel, $_gir42l18bjjgwejzq.userConstrain(userConstainHandler, currentRect, contentAreaRect, panelRect));
- togglePositionClass(panel, result.position);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (repositionPanelAt(panel, id, editor, targetRect) === false) {
+ hide();
</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">+ };
+ var hasFormVisible = function () {
+ return panel.items().filter('form:visible').length > 0;
+ };
+ var showForm = function (editor, id) {
+ if (panel) {
+ panel.items().hide();
+ if (!showToolbar(panel, id)) {
+ hide();
+ return;
+ }
+ var contentAreaRect = void 0, panelRect = void 0, result = void 0, userConstainHandler = void 0;
+ showPanel(panel);
+ panel.items().hide();
+ showToolbar(panel, id);
+ userConstainHandler = Settings.getPositionHandler(editor);
+ contentAreaRect = Measure.getContentAreaRect(editor);
+ panelRect = global$2.DOM.getRect(panel.getEl());
+ result = Layout.calc(currentRect, contentAreaRect, panelRect);
+ if (result) {
+ panelRect = result.rect;
+ movePanelTo(panel, Layout.userConstrain(userConstainHandler, currentRect, contentAreaRect, panelRect));
+ togglePositionClass(panel, result.position);
+ }
+ }
+ };
+ var show = function (editor, id, targetRect, toolbars) {
+ if (!panel) {
+ Events.fireBeforeRenderUI(editor);
+ panel = create(editor, toolbars);
+ panel.renderTo().reflow().moveTo(targetRect.x, targetRect.y);
+ editor.nodeChanged();
+ }
+ showPanelAt(panel, id, editor, targetRect);
+ };
+ var reposition = function (editor, id, targetRect) {
+ if (panel) {
+ repositionPanelAt(panel, id, editor, targetRect);
+ }
+ };
+ var hide = function () {
+ if (panel) {
+ panel.hide();
+ }
+ };
+ var focus = function () {
+ if (panel) {
+ panel.find('toolbar:visible').eq(0).each(function (item) {
+ item.focus(true);
+ });
+ }
+ };
+ var remove = function () {
+ if (panel) {
+ panel.remove();
+ panel = null;
+ }
+ };
+ var inForm = function () {
+ return panel && panel.visible() && hasFormVisible();
+ };
+ return {
+ show: show,
+ showForm: showForm,
+ reposition: reposition,
+ inForm: inForm,
+ hide: hide,
+ focus: focus,
+ remove: remove
+ };
</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 show = function (editor, id, targetRect, toolbars) {
- if (!panel) {
- $_77u64d186jjgwejzi.fireBeforeRenderUI(editor);
- panel = create(editor, toolbars);
- panel.renderTo().reflow().moveTo(targetRect.x, targetRect.y);
- editor.nodeChanged();
- }
- showPanelAt(panel, id, editor, targetRect);
- };
- var reposition = function (editor, id, targetRect) {
- if (panel) {
- repositionPanelAt(panel, id, editor, targetRect);
- }
- };
- var hide = function () {
- if (panel) {
- panel.hide();
- }
- };
- var focus = function () {
- if (panel) {
- panel.find('toolbar:visible').eq(0).each(function (item) {
- item.focus(true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var Layout$1 = global$8.extend({
+ Defaults: {
+ firstControlClass: 'first',
+ lastControlClass: 'last'
+ },
+ init: function (settings) {
+ this.settings = global$4.extend({}, this.Defaults, settings);
+ },
+ preRender: function (container) {
+ container.bodyClasses.add(this.settings.containerClass);
+ },
+ applyClasses: function (items) {
+ var self = this;
+ var settings = self.settings;
+ var firstClass, lastClass, firstItem, lastItem;
+ firstClass = settings.firstControlClass;
+ lastClass = settings.lastControlClass;
+ items.each(function (item) {
+ item.classes.remove(firstClass).remove(lastClass).add(settings.controlClass);
+ if (item.visible()) {
+ if (!firstItem) {
+ firstItem = item;
+ }
+ lastItem = item;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (firstItem) {
+ firstItem.classes.add(firstClass);
+ }
+ if (lastItem) {
+ lastItem.classes.add(lastClass);
+ }
+ },
+ renderHtml: function (container) {
+ var self = this;
+ var html = '';
+ self.applyClasses(container.items());
+ container.items().each(function (item) {
+ html += item.renderHtml();
+ });
+ return html;
+ },
+ recalc: function () {
+ },
+ postRender: function () {
+ },
+ isNative: function () {
+ 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 remove = function () {
- if (panel) {
- panel.remove();
- panel = null;
- }
- };
- var inForm = function () {
- return panel && panel.visible() && hasFormVisible();
- };
- return {
- show: show,
- showForm: showForm,
- reposition: reposition,
- inForm: inForm,
- hide: hide,
- focus: focus,
- remove: remove
- };
- };
</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">- var Layout$1 = global$8.extend({
- Defaults: {
- firstControlClass: 'first',
- lastControlClass: 'last'
- },
- init: function (settings) {
- this.settings = global$4.extend({}, this.Defaults, settings);
- },
- preRender: function (container) {
- container.bodyClasses.add(this.settings.containerClass);
- },
- applyClasses: function (items) {
- var self = this;
- var settings = self.settings;
- var firstClass, lastClass, firstItem, lastItem;
- firstClass = settings.firstControlClass;
- lastClass = settings.lastControlClass;
- items.each(function (item) {
- item.classes.remove(firstClass).remove(lastClass).add(settings.controlClass);
- if (item.visible()) {
- if (!firstItem) {
- firstItem = item;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var AbsoluteLayout = Layout$1.extend({
+ Defaults: {
+ containerClass: 'abs-layout',
+ controlClass: 'abs-layout-item'
+ },
+ recalc: function (container) {
+ container.items().filter(':visible').each(function (ctrl) {
+ var settings = ctrl.settings;
+ ctrl.layoutRect({
+ x: settings.x,
+ y: settings.y,
+ w: settings.w,
+ h: settings.h
+ });
+ if (ctrl.recalc) {
+ ctrl.recalc();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- lastItem = item;
- }
- });
- if (firstItem) {
- firstItem.classes.add(firstClass);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ },
+ renderHtml: function (container) {
+ return '<div id="' + container._id + '-absend" class="' + container.classPrefix + 'abs-end"></div>' + this._super(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 (lastItem) {
- lastItem.classes.add(lastClass);
- }
- },
- renderHtml: function (container) {
- var self = this;
- var html = '';
- self.applyClasses(container.items());
- container.items().each(function (item) {
- html += item.renderHtml();
- });
- return html;
- },
- recalc: function () {
- },
- postRender: function () {
- },
- isNative: function () {
- return false;
- }
- });
</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">- var AbsoluteLayout = Layout$1.extend({
- Defaults: {
- containerClass: 'abs-layout',
- controlClass: 'abs-layout-item'
- },
- recalc: function (container) {
- container.items().filter(':visible').each(function (ctrl) {
- var settings = ctrl.settings;
- ctrl.layoutRect({
- x: settings.x,
- y: settings.y,
- w: settings.w,
- h: settings.h
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Button = Widget.extend({
+ Defaults: {
+ classes: 'widget btn',
+ role: 'button'
+ },
+ init: function (settings) {
+ var self$$1 = this;
+ var size;
+ self$$1._super(settings);
+ settings = self$$1.settings;
+ size = self$$1.settings.size;
+ self$$1.on('click mousedown', function (e) {
+ e.preventDefault();
</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 (ctrl.recalc) {
- ctrl.recalc();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.on('touchstart', function (e) {
+ self$$1.fire('click', e);
+ e.preventDefault();
+ });
+ if (settings.subtype) {
+ self$$1.classes.add(settings.subtype);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- },
- renderHtml: function (container) {
- return '<div id="' + container._id + '-absend" class="' + container.classPrefix + 'abs-end"></div>' + this._super(container);
- }
- });
-
- var Button = Widget.extend({
- Defaults: {
- classes: 'widget btn',
- role: 'button'
- },
- init: function (settings) {
- var self$$1 = this;
- var size;
- self$$1._super(settings);
- settings = self$$1.settings;
- size = self$$1.settings.size;
- self$$1.on('click mousedown', function (e) {
- e.preventDefault();
- });
- self$$1.on('touchstart', function (e) {
- self$$1.fire('click', e);
- e.preventDefault();
- });
- if (settings.subtype) {
- self$$1.classes.add(settings.subtype);
- }
- if (size) {
- self$$1.classes.add('btn-' + size);
- }
- if (settings.icon) {
- self$$1.icon(settings.icon);
- }
- },
- icon: function (icon) {
- if (!arguments.length) {
- return this.state.get('icon');
- }
- this.state.set('icon', icon);
- return this;
- },
- repaint: function () {
- var btnElm = this.getEl().firstChild;
- var btnStyle;
- if (btnElm) {
- btnStyle = btnElm.style;
- btnStyle.width = btnStyle.height = '100%';
- }
- this._super();
- },
- renderHtml: function () {
- var self$$1 = this, id = self$$1._id, prefix = self$$1.classPrefix;
- var icon = self$$1.state.get('icon'), image;
- var text = self$$1.state.get('text');
- var textHtml = '';
- var ariaPressed;
- var settings = self$$1.settings;
- image = settings.image;
- if (image) {
- icon = 'none';
- if (typeof image !== 'string') {
- image = window.getSelection ? image[0] : image[1];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (size) {
+ self$$1.classes.add('btn-' + size);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- image = ' style="background-image: url(\'' + image + '\')"';
- } else {
- image = '';
- }
- if (text) {
- self$$1.classes.add('btn-has-text');
- textHtml = '<span class="' + prefix + 'txt">' + self$$1.encode(text) + '</span>';
- }
- icon = icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
- ariaPressed = typeof settings.active === 'boolean' ? ' aria-pressed="' + settings.active + '"' : '';
- return '<div id="' + id + '" class="' + self$$1.classes + '" tabindex="-1"' + ariaPressed + '>' + '<button id="' + id + '-button" role="presentation" type="button" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + textHtml + '</button>' + '</div>';
- },
- bindStates: function () {
- var self$$1 = this, $ = self$$1.$, textCls = self$$1.classPrefix + 'txt';
- function setButtonText(text) {
- var $span = $('span.' + textCls, self$$1.getEl());
- if (text) {
- if (!$span[0]) {
- $('button:first', self$$1.getEl()).append('<span class="' + textCls + '"></span>');
- $span = $('span.' + textCls, self$$1.getEl());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (settings.icon) {
+ self$$1.icon(settings.icon);
+ }
+ },
+ icon: function (icon) {
+ if (!arguments.length) {
+ return this.state.get('icon');
+ }
+ this.state.set('icon', icon);
+ return this;
+ },
+ repaint: function () {
+ var btnElm = this.getEl().firstChild;
+ var btnStyle;
+ if (btnElm) {
+ btnStyle = btnElm.style;
+ btnStyle.width = btnStyle.height = '100%';
+ }
+ this._super();
+ },
+ renderHtml: function () {
+ var self$$1 = this, id = self$$1._id, prefix = self$$1.classPrefix;
+ var icon = self$$1.state.get('icon'), image;
+ var text = self$$1.state.get('text');
+ var textHtml = '';
+ var ariaPressed;
+ var settings = self$$1.settings;
+ image = settings.image;
+ if (image) {
+ icon = 'none';
+ if (typeof image !== 'string') {
+ image = window.getSelection ? image[0] : image[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">- $span.html(self$$1.encode(text));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ image = ' style="background-image: url(\'' + image + '\')"';
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $span.remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ image = '';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.classes.toggle('btn-has-text', !!text);
- }
- self$$1.state.on('change:text', function (e) {
- setButtonText(e.value);
- });
- self$$1.state.on('change:icon', function (e) {
- var icon = e.value;
- var prefix = self$$1.classPrefix;
- self$$1.settings.icon = icon;
- icon = icon ? prefix + 'ico ' + prefix + 'i-' + self$$1.settings.icon : '';
- var btnElm = self$$1.getEl().firstChild;
- var iconElm = btnElm.getElementsByTagName('i')[0];
- if (icon) {
- if (!iconElm || iconElm !== btnElm.firstChild) {
- iconElm = document.createElement('i');
- btnElm.insertBefore(iconElm, btnElm.firstChild);
- }
- iconElm.className = icon;
- } else if (iconElm) {
- btnElm.removeChild(iconElm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (text) {
+ self$$1.classes.add('btn-has-text');
+ textHtml = '<span class="' + prefix + 'txt">' + self$$1.encode(text) + '</span>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- setButtonText(self$$1.state.get('text'));
- });
- return self$$1._super();
- }
- });
-
- var BrowseButton = Button.extend({
- init: function (settings) {
- var self = this;
- settings = global$4.extend({
- text: 'Browse...',
- multiple: false,
- accept: null
- }, settings);
- self._super(settings);
- self.classes.add('browsebutton');
- if (settings.multiple) {
- self.classes.add('multiple');
- }
- },
- postRender: function () {
- var self = this;
- var input = funcs.create('input', {
- type: 'file',
- id: self._id + '-browse',
- accept: self.settings.accept
- });
- self._super();
- global$7(input).on('change', function (e) {
- var files = e.target.files;
- self.value = function () {
- if (!files.length) {
- return null;
- } else if (self.settings.multiple) {
- return files;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ icon = icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
+ ariaPressed = typeof settings.active === 'boolean' ? ' aria-pressed="' + settings.active + '"' : '';
+ return '<div id="' + id + '" class="' + self$$1.classes + '" tabindex="-1"' + ariaPressed + '>' + '<button id="' + id + '-button" role="presentation" type="button" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + textHtml + '</button>' + '</div>';
+ },
+ bindStates: function () {
+ var self$$1 = this, $ = self$$1.$, textCls = self$$1.classPrefix + 'txt';
+ function setButtonText(text) {
+ var $span = $('span.' + textCls, self$$1.getEl());
+ if (text) {
+ if (!$span[0]) {
+ $('button:first', self$$1.getEl()).append('<span class="' + textCls + '"></span>');
+ $span = $('span.' + textCls, self$$1.getEl());
+ }
+ $span.html(self$$1.encode(text));
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return files[0];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $span.remove();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- e.preventDefault();
- if (files.length) {
- self.fire('change', e);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.classes.toggle('btn-has-text', !!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">- });
- global$7(input).on('click', function (e) {
- e.stopPropagation();
- });
- global$7(self.getEl('button')).on('click', function (e) {
- e.stopPropagation();
- input.click();
- });
- self.getEl().appendChild(input);
- },
- remove: function () {
- global$7(this.getEl('button')).off();
- global$7(this.getEl('input')).off();
- this._super();
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.state.on('change:text', function (e) {
+ setButtonText(e.value);
+ });
+ self$$1.state.on('change:icon', function (e) {
+ var icon = e.value;
+ var prefix = self$$1.classPrefix;
+ self$$1.settings.icon = icon;
+ icon = icon ? prefix + 'ico ' + prefix + 'i-' + self$$1.settings.icon : '';
+ var btnElm = self$$1.getEl().firstChild;
+ var iconElm = btnElm.getElementsByTagName('i')[0];
+ if (icon) {
+ if (!iconElm || iconElm !== btnElm.firstChild) {
+ iconElm = document.createElement('i');
+ btnElm.insertBefore(iconElm, btnElm.firstChild);
+ }
+ iconElm.className = icon;
+ } else if (iconElm) {
+ btnElm.removeChild(iconElm);
+ }
+ setButtonText(self$$1.state.get('text'));
+ });
+ return self$$1._super();
+ }
+ });
</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 ButtonGroup = Container.extend({
- Defaults: {
- defaultType: 'button',
- role: 'group'
- },
- renderHtml: function () {
- var self = this, layout = self._layout;
- self.classes.add('btn-group');
- self.preRender();
- layout.preRender(self);
- return '<div id="' + self._id + '" class="' + self.classes + '">' + '<div id="' + self._id + '-body">' + (self.settings.html || '') + layout.renderHtml(self) + '</div>' + '</div>';
- }
- });
-
- var Checkbox = Widget.extend({
- Defaults: {
- classes: 'checkbox',
- role: 'checkbox',
- checked: false
- },
- init: function (settings) {
- var self$$1 = this;
- self$$1._super(settings);
- self$$1.on('click mousedown', function (e) {
- e.preventDefault();
- });
- self$$1.on('click', function (e) {
- e.preventDefault();
- if (!self$$1.disabled()) {
- self$$1.checked(!self$$1.checked());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var BrowseButton = Button.extend({
+ init: function (settings) {
+ var self = this;
+ settings = global$4.extend({
+ text: 'Browse...',
+ multiple: false,
+ accept: null
+ }, settings);
+ self._super(settings);
+ self.classes.add('browsebutton');
+ if (settings.multiple) {
+ self.classes.add('multiple');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self$$1.checked(self$$1.settings.checked);
- },
- checked: function (state) {
- if (!arguments.length) {
- return this.state.get('checked');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ postRender: function () {
+ var self = this;
+ var input = funcs.create('input', {
+ type: 'file',
+ id: self._id + '-browse',
+ accept: self.settings.accept
+ });
+ self._super();
+ global$7(input).on('change', function (e) {
+ var files = e.target.files;
+ self.value = function () {
+ if (!files.length) {
+ return null;
+ } else if (self.settings.multiple) {
+ return files;
+ } else {
+ return files[0];
+ }
+ };
+ e.preventDefault();
+ if (files.length) {
+ self.fire('change', e);
+ }
+ });
+ global$7(input).on('click', function (e) {
+ e.stopPropagation();
+ });
+ global$7(self.getEl('button')).on('click', function (e) {
+ e.stopPropagation();
+ input.click();
+ });
+ self.getEl().appendChild(input);
+ },
+ remove: function () {
+ global$7(this.getEl('button')).off();
+ global$7(this.getEl('input')).off();
+ this._super();
</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.state.set('checked', state);
- return this;
- },
- value: function (state) {
- if (!arguments.length) {
- return this.checked();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var ButtonGroup = Container.extend({
+ Defaults: {
+ defaultType: 'button',
+ role: 'group'
+ },
+ renderHtml: function () {
+ var self = this, layout = self._layout;
+ self.classes.add('btn-group');
+ self.preRender();
+ layout.preRender(self);
+ return '<div id="' + self._id + '" class="' + self.classes + '">' + '<div id="' + self._id + '-body">' + (self.settings.html || '') + layout.renderHtml(self) + '</div>' + '</div>';
</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 this.checked(state);
- },
- renderHtml: function () {
- var self$$1 = this, id = self$$1._id, prefix = self$$1.classPrefix;
- return '<div id="' + id + '" class="' + self$$1.classes + '" unselectable="on" aria-labelledby="' + id + '-al" tabindex="-1">' + '<i class="' + prefix + 'ico ' + prefix + 'i-checkbox"></i>' + '<span id="' + id + '-al" class="' + prefix + 'label">' + self$$1.encode(self$$1.state.get('text')) + '</span>' + '</div>';
- },
- bindStates: function () {
- var self$$1 = this;
- function checked(state) {
- self$$1.classes.toggle('checked', state);
- self$$1.aria('checked', state);
- }
- self$$1.state.on('change:text', function (e) {
- self$$1.getEl('al').firstChild.data = self$$1.translate(e.value);
- });
- self$$1.state.on('change:checked change:value', function (e) {
- self$$1.fire('change');
- checked(e.value);
- });
- self$$1.state.on('change:icon', function (e) {
- var icon = e.value;
- var prefix = self$$1.classPrefix;
- if (typeof icon === 'undefined') {
- return self$$1.settings.icon;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var Checkbox = Widget.extend({
+ Defaults: {
+ classes: 'checkbox',
+ role: 'checkbox',
+ checked: false
+ },
+ init: function (settings) {
+ var self$$1 = this;
+ self$$1._super(settings);
+ self$$1.on('click mousedown', function (e) {
+ e.preventDefault();
+ });
+ self$$1.on('click', function (e) {
+ e.preventDefault();
+ if (!self$$1.disabled()) {
+ self$$1.checked(!self$$1.checked());
+ }
+ });
+ self$$1.checked(self$$1.settings.checked);
+ },
+ checked: function (state) {
+ if (!arguments.length) {
+ return this.state.get('checked');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.settings.icon = icon;
- icon = icon ? prefix + 'ico ' + prefix + 'i-' + self$$1.settings.icon : '';
- var btnElm = self$$1.getEl().firstChild;
- var iconElm = btnElm.getElementsByTagName('i')[0];
- if (icon) {
- if (!iconElm || iconElm !== btnElm.firstChild) {
- iconElm = document.createElement('i');
- btnElm.insertBefore(iconElm, btnElm.firstChild);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.state.set('checked', state);
+ return this;
+ },
+ value: function (state) {
+ if (!arguments.length) {
+ return this.checked();
+ }
+ return this.checked(state);
+ },
+ renderHtml: function () {
+ var self$$1 = this, id = self$$1._id, prefix = self$$1.classPrefix;
+ return '<div id="' + id + '" class="' + self$$1.classes + '" unselectable="on" aria-labelledby="' + id + '-al" tabindex="-1">' + '<i class="' + prefix + 'ico ' + prefix + 'i-checkbox"></i>' + '<span id="' + id + '-al" class="' + prefix + 'label">' + self$$1.encode(self$$1.state.get('text')) + '</span>' + '</div>';
+ },
+ bindStates: function () {
+ var self$$1 = this;
+ function checked(state) {
+ self$$1.classes.toggle('checked', state);
+ self$$1.aria('checked', state);
+ }
+ self$$1.state.on('change:text', function (e) {
+ self$$1.getEl('al').firstChild.data = self$$1.translate(e.value);
+ });
+ self$$1.state.on('change:checked change:value', function (e) {
+ self$$1.fire('change');
+ checked(e.value);
+ });
+ self$$1.state.on('change:icon', function (e) {
+ var icon = e.value;
+ var prefix = self$$1.classPrefix;
+ if (typeof icon === 'undefined') {
+ return self$$1.settings.icon;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- iconElm.className = icon;
- } else if (iconElm) {
- btnElm.removeChild(iconElm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.settings.icon = icon;
+ icon = icon ? prefix + 'ico ' + prefix + 'i-' + self$$1.settings.icon : '';
+ var btnElm = self$$1.getEl().firstChild;
+ var iconElm = btnElm.getElementsByTagName('i')[0];
+ if (icon) {
+ if (!iconElm || iconElm !== btnElm.firstChild) {
+ iconElm = document.createElement('i');
+ btnElm.insertBefore(iconElm, btnElm.firstChild);
+ }
+ iconElm.className = icon;
+ } else if (iconElm) {
+ btnElm.removeChild(iconElm);
+ }
+ });
+ if (self$$1.state.get('checked')) {
+ checked(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 (self$$1.state.get('checked')) {
- checked(true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$1._super();
</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 self$$1._super();
- }
- });
</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">- var global$15 = tinymce.util.Tools.resolve('tinymce.util.VK');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$f = tinymce.util.Tools.resolve('tinymce.util.VK');
</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 ComboBox = Widget.extend({
- init: function (settings) {
- var self$$1 = this;
- self$$1._super(settings);
- settings = self$$1.settings;
- self$$1.classes.add('combobox');
- self$$1.subinput = true;
- self$$1.ariaTarget = 'inp';
- settings.menu = settings.menu || settings.values;
- if (settings.menu) {
- settings.icon = 'caret';
- }
- self$$1.on('click', function (e) {
- var elm = e.target;
- var root = self$$1.getEl();
- if (!global$7.contains(root, elm) && elm !== root) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ComboBox = Widget.extend({
+ init: function (settings) {
+ var self$$1 = this;
+ self$$1._super(settings);
+ settings = self$$1.settings;
+ self$$1.classes.add('combobox');
+ self$$1.subinput = true;
+ self$$1.ariaTarget = 'inp';
+ settings.menu = settings.menu || settings.values;
+ if (settings.menu) {
+ settings.icon = 'caret';
</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 (elm && elm !== root) {
- if (elm.id && elm.id.indexOf('-open') !== -1) {
- self$$1.fire('action');
- if (settings.menu) {
- self$$1.showMenu();
- if (e.aria) {
- self$$1.menu.items()[0].focus();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.on('click', function (e) {
+ var elm = e.target;
+ var root = self$$1.getEl();
+ if (!global$7.contains(root, elm) && elm !== root) {
+ return;
+ }
+ while (elm && elm !== root) {
+ if (elm.id && elm.id.indexOf('-open') !== -1) {
+ self$$1.fire('action');
+ if (settings.menu) {
+ self$$1.showMenu();
+ if (e.aria) {
+ self$$1.menu.items()[0].focus();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><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">- elm = elm.parentNode;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ self$$1.on('keydown', function (e) {
+ var rootControl;
+ if (e.keyCode === 13 && e.target.nodeName === 'INPUT') {
+ e.preventDefault();
+ self$$1.parents().reverse().each(function (ctrl) {
+ if (ctrl.toJSON) {
+ rootControl = ctrl;
+ return false;
+ }
+ });
+ self$$1.fire('submit', { data: rootControl.toJSON() });
+ }
+ });
+ self$$1.on('keyup', function (e) {
+ if (e.target.nodeName === 'INPUT') {
+ var oldValue = self$$1.state.get('value');
+ var newValue = e.target.value;
+ if (newValue !== oldValue) {
+ self$$1.state.set('value', newValue);
+ self$$1.fire('autocomplete', e);
+ }
+ }
+ });
+ self$$1.on('mouseover', function (e) {
+ var tooltip = self$$1.tooltip().moveTo(-65535);
+ if (self$$1.statusLevel() && e.target.className.indexOf(self$$1.classPrefix + 'status') !== -1) {
+ var statusMessage = self$$1.statusMessage() || 'Ok';
+ var rel = tooltip.text(statusMessage).show().testMoveRel(e.target, [
+ 'bc-tc',
+ 'bc-tl',
+ 'bc-tr'
+ ]);
+ tooltip.classes.toggle('tooltip-n', rel === 'bc-tc');
+ tooltip.classes.toggle('tooltip-nw', rel === 'bc-tl');
+ tooltip.classes.toggle('tooltip-ne', rel === 'bc-tr');
+ tooltip.moveRel(e.target, rel);
+ }
+ });
+ },
+ statusLevel: function (value) {
+ if (arguments.length > 0) {
+ this.state.set('statusLevel', 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">- });
- self$$1.on('keydown', function (e) {
- var rootControl;
- if (e.keyCode === 13 && e.target.nodeName === 'INPUT') {
- e.preventDefault();
- self$$1.parents().reverse().each(function (ctrl) {
- if (ctrl.toJSON) {
- rootControl = ctrl;
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this.state.get('statusLevel');
+ },
+ statusMessage: function (value) {
+ if (arguments.length > 0) {
+ this.state.set('statusMessage', value);
+ }
+ return this.state.get('statusMessage');
+ },
+ showMenu: function () {
+ var self$$1 = this;
+ var settings = self$$1.settings;
+ var menu;
+ if (!self$$1.menu) {
+ menu = settings.menu || [];
+ if (menu.length) {
+ menu = {
+ type: 'menu',
+ items: menu
+ };
+ } else {
+ menu.type = menu.type || 'menu';
+ }
+ self$$1.menu = global$b.create(menu).parent(self$$1).renderTo(self$$1.getContainerElm());
+ self$$1.fire('createmenu');
+ self$$1.menu.reflow();
+ self$$1.menu.on('cancel', function (e) {
+ if (e.control === self$$1.menu) {
+ self$$1.focus();
</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">- self$$1.fire('submit', { data: rootControl.toJSON() });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.menu.on('show hide', function (e) {
+ e.control.items().each(function (ctrl) {
+ ctrl.active(ctrl.value() === self$$1.value());
+ });
+ }).fire('show');
+ self$$1.menu.on('select', function (e) {
+ self$$1.value(e.control.value());
+ });
+ self$$1.on('focusin', function (e) {
+ if (e.target.tagName.toUpperCase() === 'INPUT') {
+ self$$1.menu.hide();
+ }
+ });
+ self$$1.aria('expanded', 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">- });
- self$$1.on('keyup', function (e) {
- if (e.target.nodeName === 'INPUT') {
- var oldValue = self$$1.state.get('value');
- var newValue = e.target.value;
- if (newValue !== oldValue) {
- self$$1.state.set('value', newValue);
- self$$1.fire('autocomplete', e);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.menu.show();
+ self$$1.menu.layoutRect({ w: self$$1.layoutRect().w });
+ self$$1.menu.moveRel(self$$1.getEl(), self$$1.isRtl() ? [
+ 'br-tr',
+ 'tr-br'
+ ] : [
+ 'bl-tl',
+ 'tl-bl'
+ ]);
+ },
+ focus: function () {
+ this.getEl('inp').focus();
+ },
+ repaint: function () {
+ var self$$1 = this, elm = self$$1.getEl(), openElm = self$$1.getEl('open'), rect = self$$1.layoutRect();
+ var width, lineHeight, innerPadding = 0;
+ var inputElm = elm.firstChild;
+ if (self$$1.statusLevel() && self$$1.statusLevel() !== 'none') {
+ innerPadding = parseInt(funcs.getRuntimeStyle(inputElm, 'padding-right'), 10) - parseInt(funcs.getRuntimeStyle(inputElm, 'padding-left'), 10);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self$$1.on('mouseover', function (e) {
- var tooltip = self$$1.tooltip().moveTo(-65535);
- if (self$$1.statusLevel() && e.target.className.indexOf(self$$1.classPrefix + 'status') !== -1) {
- var statusMessage = self$$1.statusMessage() || 'Ok';
- var rel = tooltip.text(statusMessage).show().testMoveRel(e.target, [
- 'bc-tc',
- 'bc-tl',
- 'bc-tr'
- ]);
- tooltip.classes.toggle('tooltip-n', rel === 'bc-tc');
- tooltip.classes.toggle('tooltip-nw', rel === 'bc-tl');
- tooltip.classes.toggle('tooltip-ne', rel === 'bc-tr');
- tooltip.moveRel(e.target, rel);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (openElm) {
+ width = rect.w - funcs.getSize(openElm).width - 10;
+ } else {
+ width = rect.w - 10;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- },
- statusLevel: function (value) {
- if (arguments.length > 0) {
- this.state.set('statusLevel', value);
- }
- return this.state.get('statusLevel');
- },
- statusMessage: function (value) {
- if (arguments.length > 0) {
- this.state.set('statusMessage', value);
- }
- return this.state.get('statusMessage');
- },
- showMenu: function () {
- var self$$1 = this;
- var settings = self$$1.settings;
- var menu;
- if (!self$$1.menu) {
- menu = settings.menu || [];
- if (menu.length) {
- menu = {
- type: 'menu',
- items: menu
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var doc = document;
+ if (doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
+ lineHeight = self$$1.layoutRect().h - 2 + 'px';
+ }
+ global$7(inputElm).css({
+ width: width - innerPadding,
+ lineHeight: lineHeight
+ });
+ self$$1._super();
+ return self$$1;
+ },
+ postRender: function () {
+ var self$$1 = this;
+ global$7(this.getEl('inp')).on('change', function (e) {
+ self$$1.state.set('value', e.target.value);
+ self$$1.fire('change', e);
+ });
+ return self$$1._super();
+ },
+ renderHtml: function () {
+ var self$$1 = this, id = self$$1._id, settings = self$$1.settings, prefix = self$$1.classPrefix;
+ var value = self$$1.state.get('value') || '';
+ var icon, text, openBtnHtml = '', extraAttrs = '', statusHtml = '';
+ if ('spellcheck' in settings) {
+ extraAttrs += ' spellcheck="' + settings.spellcheck + '"';
+ }
+ if (settings.maxLength) {
+ extraAttrs += ' maxlength="' + settings.maxLength + '"';
+ }
+ if (settings.size) {
+ extraAttrs += ' size="' + settings.size + '"';
+ }
+ if (settings.subtype) {
+ extraAttrs += ' type="' + settings.subtype + '"';
+ }
+ statusHtml = '<i id="' + id + '-status" class="mce-status mce-ico" style="display: none"></i>';
+ if (self$$1.disabled()) {
+ extraAttrs += ' disabled="disabled"';
+ }
+ icon = settings.icon;
+ if (icon && icon !== 'caret') {
+ icon = prefix + 'ico ' + prefix + 'i-' + settings.icon;
+ }
+ text = self$$1.state.get('text');
+ if (icon || text) {
+ openBtnHtml = '<div id="' + id + '-open" class="' + prefix + 'btn ' + prefix + 'open" tabIndex="-1" role="button">' + '<button id="' + id + '-action" type="button" hidefocus="1" tabindex="-1">' + (icon !== 'caret' ? '<i class="' + icon + '"></i>' : '<i class="' + prefix + 'caret"></i>') + (text ? (icon ? ' ' : '') + text : '') + '</button>' + '</div>';
+ self$$1.classes.add('has-open');
+ }
+ return '<div id="' + id + '" class="' + self$$1.classes + '">' + '<input id="' + id + '-inp" class="' + prefix + 'textbox" value="' + self$$1.encode(value, false) + '" hidefocus="1"' + extraAttrs + ' placeholder="' + self$$1.encode(settings.placeholder) + '" />' + statusHtml + openBtnHtml + '</div>';
+ },
+ value: function (value) {
+ if (arguments.length) {
+ this.state.set('value', value);
+ return this;
+ }
+ if (this.state.get('rendered')) {
+ this.state.set('value', this.getEl('inp').value);
+ }
+ return this.state.get('value');
+ },
+ showAutoComplete: function (items, term) {
+ var self$$1 = this;
+ if (items.length === 0) {
+ self$$1.hideMenu();
+ return;
+ }
+ var insert = function (value, title) {
+ return function () {
+ self$$1.fire('selectitem', {
+ title: title,
+ value: value
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ if (self$$1.menu) {
+ self$$1.menu.items().remove();
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- menu.type = menu.type || 'menu';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.menu = global$b.create({
+ type: 'menu',
+ classes: 'combobox-menu',
+ layout: 'flow'
+ }).parent(self$$1).renderTo();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.menu = global$11.create(menu).parent(self$$1).renderTo(self$$1.getContainerElm());
- self$$1.fire('createmenu');
- self$$1.menu.reflow();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global$4.each(items, function (item) {
+ self$$1.menu.add({
+ text: item.title,
+ url: item.previewUrl,
+ match: term,
+ classes: 'menu-item-ellipsis',
+ onclick: insert(item.value, item.title)
+ });
+ });
+ self$$1.menu.renderNew();
+ self$$1.hideMenu();
</ins><span class="cx" style="display: block; padding: 0 10px"> self$$1.menu.on('cancel', function (e) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (e.control === self$$1.menu) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (e.control.parent() === self$$1.menu) {
+ e.stopPropagation();
</ins><span class="cx" style="display: block; padding: 0 10px"> self$$1.focus();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.hideMenu();
</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">- self$$1.menu.on('show hide', function (e) {
- e.control.items().each(function (ctrl) {
- ctrl.active(ctrl.value() === self$$1.value());
- });
- }).fire('show');
- self$$1.menu.on('select', function (e) {
- self$$1.value(e.control.value());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.menu.on('select', function () {
+ self$$1.focus();
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.on('focusin', function (e) {
- if (e.target.tagName.toUpperCase() === 'INPUT') {
- self$$1.menu.hide();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var maxW = self$$1.layoutRect().w;
+ self$$1.menu.layoutRect({
+ w: maxW,
+ minW: 0,
+ maxW: maxW
+ });
+ self$$1.menu.repaint();
+ self$$1.menu.reflow();
+ self$$1.menu.show();
+ self$$1.menu.moveRel(self$$1.getEl(), self$$1.isRtl() ? [
+ 'br-tr',
+ 'tr-br'
+ ] : [
+ 'bl-tl',
+ 'tl-bl'
+ ]);
+ },
+ hideMenu: function () {
+ if (this.menu) {
+ this.menu.hide();
+ }
+ },
+ bindStates: function () {
+ var self$$1 = this;
+ self$$1.state.on('change:value', function (e) {
+ if (self$$1.getEl('inp').value !== e.value) {
+ self$$1.getEl('inp').value = e.value;
</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">- self$$1.aria('expanded', true);
- }
- self$$1.menu.show();
- self$$1.menu.layoutRect({ w: self$$1.layoutRect().w });
- self$$1.menu.moveRel(self$$1.getEl(), self$$1.isRtl() ? [
- 'br-tr',
- 'tr-br'
- ] : [
- 'bl-tl',
- 'tl-bl'
- ]);
- },
- focus: function () {
- this.getEl('inp').focus();
- },
- repaint: function () {
- var self$$1 = this, elm = self$$1.getEl(), openElm = self$$1.getEl('open'), rect = self$$1.layoutRect();
- var width, lineHeight, innerPadding = 0;
- var inputElm = elm.firstChild;
- if (self$$1.statusLevel() && self$$1.statusLevel() !== 'none') {
- innerPadding = parseInt(funcs.getRuntimeStyle(inputElm, 'padding-right'), 10) - parseInt(funcs.getRuntimeStyle(inputElm, 'padding-left'), 10);
- }
- if (openElm) {
- width = rect.w - funcs.getSize(openElm).width - 10;
- } else {
- width = rect.w - 10;
- }
- var doc = document;
- if (doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
- lineHeight = self$$1.layoutRect().h - 2 + 'px';
- }
- global$7(inputElm).css({
- width: width - innerPadding,
- lineHeight: lineHeight
- });
- self$$1._super();
- return self$$1;
- },
- postRender: function () {
- var self$$1 = this;
- global$7(this.getEl('inp')).on('change', function (e) {
- self$$1.state.set('value', e.target.value);
- self$$1.fire('change', e);
- });
- return self$$1._super();
- },
- renderHtml: function () {
- var self$$1 = this, id = self$$1._id, settings = self$$1.settings, prefix = self$$1.classPrefix;
- var value = self$$1.state.get('value') || '';
- var icon, text, openBtnHtml = '', extraAttrs = '', statusHtml = '';
- if ('spellcheck' in settings) {
- extraAttrs += ' spellcheck="' + settings.spellcheck + '"';
- }
- if (settings.maxLength) {
- extraAttrs += ' maxlength="' + settings.maxLength + '"';
- }
- if (settings.size) {
- extraAttrs += ' size="' + settings.size + '"';
- }
- if (settings.subtype) {
- extraAttrs += ' type="' + settings.subtype + '"';
- }
- statusHtml = '<i id="' + id + '-status" class="mce-status mce-ico" style="display: none"></i>';
- if (self$$1.disabled()) {
- extraAttrs += ' disabled="disabled"';
- }
- icon = settings.icon;
- if (icon && icon !== 'caret') {
- icon = prefix + 'ico ' + prefix + 'i-' + settings.icon;
- }
- text = self$$1.state.get('text');
- if (icon || text) {
- openBtnHtml = '<div id="' + id + '-open" class="' + prefix + 'btn ' + prefix + 'open" tabIndex="-1" role="button">' + '<button id="' + id + '-action" type="button" hidefocus="1" tabindex="-1">' + (icon !== 'caret' ? '<i class="' + icon + '"></i>' : '<i class="' + prefix + 'caret"></i>') + (text ? (icon ? ' ' : '') + text : '') + '</button>' + '</div>';
- self$$1.classes.add('has-open');
- }
- return '<div id="' + id + '" class="' + self$$1.classes + '">' + '<input id="' + id + '-inp" class="' + prefix + 'textbox" value="' + self$$1.encode(value, false) + '" hidefocus="1"' + extraAttrs + ' placeholder="' + self$$1.encode(settings.placeholder) + '" />' + statusHtml + openBtnHtml + '</div>';
- },
- value: function (value) {
- if (arguments.length) {
- this.state.set('value', value);
- return this;
- }
- if (this.state.get('rendered')) {
- this.state.set('value', this.getEl('inp').value);
- }
- return this.state.get('value');
- },
- showAutoComplete: function (items, term) {
- var self$$1 = this;
- if (items.length === 0) {
- self$$1.hideMenu();
- return;
- }
- var insert = function (value, title) {
- return function () {
- self$$1.fire('selectitem', {
- title: title,
- value: value
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.state.on('change:disabled', function (e) {
+ self$$1.getEl('inp').disabled = e.value;
+ });
+ self$$1.state.on('change:statusLevel', function (e) {
+ var statusIconElm = self$$1.getEl('status');
+ var prefix = self$$1.classPrefix, value = e.value;
+ funcs.css(statusIconElm, 'display', value === 'none' ? 'none' : '');
+ funcs.toggleClass(statusIconElm, prefix + 'i-checkmark', value === 'ok');
+ funcs.toggleClass(statusIconElm, prefix + 'i-warning', value === 'warn');
+ funcs.toggleClass(statusIconElm, prefix + 'i-error', value === 'error');
+ self$$1.classes.toggle('has-status', value !== 'none');
+ self$$1.repaint();
+ });
+ funcs.on(self$$1.getEl('status'), 'mouseleave', function () {
+ self$$1.tooltip().hide();
+ });
+ self$$1.on('cancel', function (e) {
+ if (self$$1.menu && self$$1.menu.visible()) {
+ e.stopPropagation();
+ self$$1.hideMenu();
+ }
+ });
+ var focusIdx = function (idx, menu) {
+ if (menu && menu.items().length > 0) {
+ menu.items().eq(idx)[0].focus();
+ }
</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 (self$$1.menu) {
- self$$1.menu.items().remove();
- } else {
- self$$1.menu = global$11.create({
- type: 'menu',
- classes: 'combobox-menu',
- layout: 'flow'
- }).parent(self$$1).renderTo();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.on('keydown', function (e) {
+ var keyCode = e.keyCode;
+ if (e.target.nodeName === 'INPUT') {
+ if (keyCode === global$f.DOWN) {
+ e.preventDefault();
+ self$$1.fire('autocomplete');
+ focusIdx(0, self$$1.menu);
+ } else if (keyCode === global$f.UP) {
+ e.preventDefault();
+ focusIdx(-1, self$$1.menu);
+ }
+ }
+ });
+ return self$$1._super();
+ },
+ remove: function () {
+ global$7(this.getEl('inp')).off();
+ if (this.menu) {
+ this.menu.remove();
+ }
+ this._super();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global$4.each(items, function (item) {
- self$$1.menu.add({
- text: item.title,
- url: item.previewUrl,
- match: term,
- classes: 'menu-item-ellipsis',
- onclick: insert(item.value, item.title)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var ColorBox = ComboBox.extend({
+ init: function (settings) {
+ var self = this;
+ settings.spellcheck = false;
+ if (settings.onaction) {
+ settings.icon = 'none';
+ }
+ self._super(settings);
+ self.classes.add('colorbox');
+ self.on('change keyup postrender', function () {
+ self.repaintColor(self.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">- });
- self$$1.menu.renderNew();
- self$$1.hideMenu();
- self$$1.menu.on('cancel', function (e) {
- if (e.control.parent() === self$$1.menu) {
- e.stopPropagation();
- self$$1.focus();
- self$$1.hideMenu();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ repaintColor: function (value) {
+ var openElm = this.getEl('open');
+ var elm = openElm ? openElm.getElementsByTagName('i')[0] : null;
+ if (elm) {
+ try {
+ elm.style.background = value;
+ } catch (ex) {
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self$$1.menu.on('select', function () {
- self$$1.focus();
- });
- var maxW = self$$1.layoutRect().w;
- self$$1.menu.layoutRect({
- w: maxW,
- minW: 0,
- maxW: maxW
- });
- self$$1.menu.repaint();
- self$$1.menu.reflow();
- self$$1.menu.show();
- self$$1.menu.moveRel(self$$1.getEl(), self$$1.isRtl() ? [
- 'br-tr',
- 'tr-br'
- ] : [
- 'bl-tl',
- 'tl-bl'
- ]);
- },
- hideMenu: function () {
- if (this.menu) {
- this.menu.hide();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ bindStates: function () {
+ var self = this;
+ self.state.on('change:value', function (e) {
+ if (self.state.get('rendered')) {
+ self.repaintColor(e.value);
+ }
+ });
+ return self._super();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- },
- bindStates: function () {
- var self$$1 = this;
- self$$1.state.on('change:value', function (e) {
- if (self$$1.getEl('inp').value !== e.value) {
- self$$1.getEl('inp').value = e.value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var PanelButton = Button.extend({
+ showPanel: function () {
+ var self = this, settings = self.settings;
+ self.classes.add('opened');
+ if (!self.panel) {
+ var panelSettings = settings.panel;
+ if (panelSettings.type) {
+ panelSettings = {
+ layout: 'grid',
+ items: panelSettings
+ };
+ }
+ panelSettings.role = panelSettings.role || 'dialog';
+ panelSettings.popover = true;
+ panelSettings.autohide = true;
+ panelSettings.ariaRoot = true;
+ self.panel = new FloatPanel(panelSettings).on('hide', function () {
+ self.classes.remove('opened');
+ }).on('cancel', function (e) {
+ e.stopPropagation();
+ self.focus();
+ self.hidePanel();
+ }).parent(self).renderTo(self.getContainerElm());
+ self.panel.fire('show');
+ self.panel.reflow();
+ } else {
+ self.panel.show();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self$$1.state.on('change:disabled', function (e) {
- self$$1.getEl('inp').disabled = e.value;
- });
- self$$1.state.on('change:statusLevel', function (e) {
- var statusIconElm = self$$1.getEl('status');
- var prefix = self$$1.classPrefix, value = e.value;
- funcs.css(statusIconElm, 'display', value === 'none' ? 'none' : '');
- funcs.toggleClass(statusIconElm, prefix + 'i-checkmark', value === 'ok');
- funcs.toggleClass(statusIconElm, prefix + 'i-warning', value === 'warn');
- funcs.toggleClass(statusIconElm, prefix + 'i-error', value === 'error');
- self$$1.classes.toggle('has-status', value !== 'none');
- self$$1.repaint();
- });
- funcs.on(self$$1.getEl('status'), 'mouseleave', function () {
- self$$1.tooltip().hide();
- });
- self$$1.on('cancel', function (e) {
- if (self$$1.menu && self$$1.menu.visible()) {
- e.stopPropagation();
- self$$1.hideMenu();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var rtlRels = [
+ 'bc-tc',
+ 'bc-tl',
+ 'bc-tr'
+ ];
+ var ltrRels = [
+ 'bc-tc',
+ 'bc-tr',
+ 'bc-tl',
+ 'tc-bc',
+ 'tc-br',
+ 'tc-bl'
+ ];
+ var rel = self.panel.testMoveRel(self.getEl(), settings.popoverAlign || (self.isRtl() ? rtlRels : ltrRels));
+ self.panel.classes.toggle('start', rel.substr(-1) === 'l');
+ self.panel.classes.toggle('end', rel.substr(-1) === 'r');
+ var isTop = rel.substr(0, 1) === 't';
+ self.panel.classes.toggle('bottom', !isTop);
+ self.panel.classes.toggle('top', isTop);
+ self.panel.moveRel(self.getEl(), rel);
+ },
+ hidePanel: function () {
+ var self = this;
+ if (self.panel) {
+ self.panel.hide();
</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 focusIdx = function (idx, menu) {
- if (menu && menu.items().length > 0) {
- menu.items().eq(idx)[0].focus();
- }
- };
- self$$1.on('keydown', function (e) {
- var keyCode = e.keyCode;
- if (e.target.nodeName === 'INPUT') {
- if (keyCode === global$15.DOWN) {
- e.preventDefault();
- self$$1.fire('autocomplete');
- focusIdx(0, self$$1.menu);
- } else if (keyCode === global$15.UP) {
- e.preventDefault();
- focusIdx(-1, self$$1.menu);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ postRender: function () {
+ var self = this;
+ self.aria('haspopup', true);
+ self.on('click', function (e) {
+ if (e.control === self) {
+ if (self.panel && self.panel.visible()) {
+ self.hidePanel();
+ } else {
+ self.showPanel();
+ self.panel.focus(!!e.aria);
+ }
</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 self._super();
+ },
+ remove: function () {
+ if (this.panel) {
+ this.panel.remove();
+ this.panel = 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 self$$1._super();
- },
- remove: function () {
- global$7(this.getEl('inp')).off();
- if (this.menu) {
- this.menu.remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this._super();
</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._super();
- }
- });
</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">- var ColorBox = ComboBox.extend({
- init: function (settings) {
- var self = this;
- settings.spellcheck = false;
- if (settings.onaction) {
- settings.icon = 'none';
- }
- self._super(settings);
- self.classes.add('colorbox');
- self.on('change keyup postrender', function () {
- self.repaintColor(self.value());
- });
- },
- repaintColor: function (value) {
- var openElm = this.getEl('open');
- var elm = openElm ? openElm.getElementsByTagName('i')[0] : null;
- if (elm) {
- try {
- elm.style.background = value;
- } catch (ex) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var DOM = global$2.DOM;
+ var ColorButton = PanelButton.extend({
+ init: function (settings) {
+ this._super(settings);
+ this.classes.add('splitbtn');
+ this.classes.add('colorbutton');
+ },
+ color: function (color) {
+ if (color) {
+ this._color = color;
+ this.getEl('preview').style.backgroundColor = color;
+ return this;
</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 this._color;
+ },
+ resetColor: function () {
+ this._color = null;
+ this.getEl('preview').style.backgroundColor = null;
+ return this;
+ },
+ renderHtml: function () {
+ var self = this, id = self._id, prefix = self.classPrefix, text = self.state.get('text');
+ var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
+ var image = self.settings.image ? ' style="background-image: url(\'' + self.settings.image + '\')"' : '';
+ var textHtml = '';
+ if (text) {
+ self.classes.add('btn-has-text');
+ textHtml = '<span class="' + prefix + 'txt">' + self.encode(text) + '</span>';
+ }
+ return '<div id="' + id + '" class="' + self.classes + '" role="button" tabindex="-1" aria-haspopup="true">' + '<button role="presentation" hidefocus="1" type="button" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + '<span id="' + id + '-preview" class="' + prefix + 'preview"></span>' + textHtml + '</button>' + '<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' + ' <i class="' + prefix + 'caret"></i>' + '</button>' + '</div>';
+ },
+ postRender: function () {
+ var self = this, onClickHandler = self.settings.onclick;
+ self.on('click', function (e) {
+ if (e.aria && e.aria.key === 'down') {
+ return;
+ }
+ if (e.control === self && !DOM.getParent(e.target, '.' + self.classPrefix + 'open')) {
+ e.stopImmediatePropagation();
+ onClickHandler.call(self, e);
+ }
+ });
+ delete self.settings.onclick;
+ return self._super();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- },
- bindStates: function () {
- var self = this;
- self.state.on('change:value', function (e) {
- if (self.state.get('rendered')) {
- self.repaintColor(e.value);
- }
- });
- return self._super();
- }
- });
</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">- var PanelButton = Button.extend({
- showPanel: function () {
- var self = this, settings = self.settings;
- self.classes.add('opened');
- if (!self.panel) {
- var panelSettings = settings.panel;
- if (panelSettings.type) {
- panelSettings = {
- layout: 'grid',
- items: panelSettings
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$g = tinymce.util.Tools.resolve('tinymce.util.Color');
+
+ var ColorPicker = Widget.extend({
+ Defaults: { classes: 'widget colorpicker' },
+ init: function (settings) {
+ this._super(settings);
+ },
+ postRender: function () {
+ var self = this;
+ var color = self.color();
+ var hsv, hueRootElm, huePointElm, svRootElm, svPointElm;
+ hueRootElm = self.getEl('h');
+ huePointElm = self.getEl('hp');
+ svRootElm = self.getEl('sv');
+ svPointElm = self.getEl('svp');
+ function getPos(elm, event) {
+ var pos = funcs.getPos(elm);
+ var x, y;
+ x = event.pageX - pos.x;
+ y = event.pageY - pos.y;
+ x = Math.max(0, Math.min(x / elm.clientWidth, 1));
+ y = Math.max(0, Math.min(y / elm.clientHeight, 1));
+ return {
+ x: x,
+ y: y
</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">- panelSettings.role = panelSettings.role || 'dialog';
- panelSettings.popover = true;
- panelSettings.autohide = true;
- panelSettings.ariaRoot = true;
- self.panel = new FloatPanel(panelSettings).on('hide', function () {
- self.classes.remove('opened');
- }).on('cancel', function (e) {
- e.stopPropagation();
- self.focus();
- self.hidePanel();
- }).parent(self).renderTo(self.getContainerElm());
- self.panel.fire('show');
- self.panel.reflow();
- } else {
- self.panel.show();
- }
- var rtlRels = [
- 'bc-tc',
- 'bc-tl',
- 'bc-tr'
- ];
- var ltrRels = [
- 'bc-tc',
- 'bc-tr',
- 'bc-tl',
- 'tc-bc',
- 'tc-br',
- 'tc-bl'
- ];
- var rel = self.panel.testMoveRel(self.getEl(), settings.popoverAlign || (self.isRtl() ? rtlRels : ltrRels));
- self.panel.classes.toggle('start', rel.substr(-1) === 'l');
- self.panel.classes.toggle('end', rel.substr(-1) === 'r');
- var isTop = rel.substr(0, 1) === 't';
- self.panel.classes.toggle('bottom', !isTop);
- self.panel.classes.toggle('top', isTop);
- self.panel.moveRel(self.getEl(), rel);
- },
- hidePanel: function () {
- var self = this;
- if (self.panel) {
- self.panel.hide();
- }
- },
- postRender: function () {
- var self = this;
- self.aria('haspopup', true);
- self.on('click', function (e) {
- if (e.control === self) {
- if (self.panel && self.panel.visible()) {
- self.hidePanel();
- } else {
- self.showPanel();
- self.panel.focus(!!e.aria);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function updateColor(hsv, hueUpdate) {
+ var hue = (360 - hsv.h) / 360;
+ funcs.css(huePointElm, { top: hue * 100 + '%' });
+ if (!hueUpdate) {
+ funcs.css(svPointElm, {
+ left: hsv.s + '%',
+ top: 100 - hsv.v + '%'
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ svRootElm.style.background = global$g({
+ s: 100,
+ v: 100,
+ h: hsv.h
+ }).toHex();
+ self.color().parse({
+ s: hsv.s,
+ v: hsv.v,
+ h: hsv.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">- });
- return self._super();
- },
- remove: function () {
- if (this.panel) {
- this.panel.remove();
- this.panel = null;
- }
- return this._super();
- }
- });
-
- var DOM = global$2.DOM;
- var ColorButton = PanelButton.extend({
- init: function (settings) {
- this._super(settings);
- this.classes.add('splitbtn');
- this.classes.add('colorbutton');
- },
- color: function (color) {
- if (color) {
- this._color = color;
- this.getEl('preview').style.backgroundColor = color;
- return this;
- }
- return this._color;
- },
- resetColor: function () {
- this._color = null;
- this.getEl('preview').style.backgroundColor = null;
- return this;
- },
- renderHtml: function () {
- var self = this, id = self._id, prefix = self.classPrefix, text = self.state.get('text');
- var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
- var image = self.settings.image ? ' style="background-image: url(\'' + self.settings.image + '\')"' : '';
- var textHtml = '';
- if (text) {
- self.classes.add('btn-has-text');
- textHtml = '<span class="' + prefix + 'txt">' + self.encode(text) + '</span>';
- }
- return '<div id="' + id + '" class="' + self.classes + '" role="button" tabindex="-1" aria-haspopup="true">' + '<button role="presentation" hidefocus="1" type="button" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + '<span id="' + id + '-preview" class="' + prefix + 'preview"></span>' + textHtml + '</button>' + '<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' + ' <i class="' + prefix + 'caret"></i>' + '</button>' + '</div>';
- },
- postRender: function () {
- var self = this, onClickHandler = self.settings.onclick;
- self.on('click', function (e) {
- if (e.aria && e.aria.key === 'down') {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function updateSaturationAndValue(e) {
+ var pos;
+ pos = getPos(svRootElm, e);
+ hsv.s = pos.x * 100;
+ hsv.v = (1 - pos.y) * 100;
+ updateColor(hsv);
+ self.fire('change');
</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.control === self && !DOM.getParent(e.target, '.' + self.classPrefix + 'open')) {
- e.stopImmediatePropagation();
- onClickHandler.call(self, e);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function updateHue(e) {
+ var pos;
+ pos = getPos(hueRootElm, e);
+ hsv = color.toHsv();
+ hsv.h = (1 - pos.y) * 360;
+ updateColor(hsv, true);
+ self.fire('change');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- delete self.settings.onclick;
- return self._super();
- }
- });
-
- var global$16 = tinymce.util.Tools.resolve('tinymce.util.Color');
-
- var ColorPicker = Widget.extend({
- Defaults: { classes: 'widget colorpicker' },
- init: function (settings) {
- this._super(settings);
- },
- postRender: function () {
- var self = this;
- var color = self.color();
- var hsv, hueRootElm, huePointElm, svRootElm, svPointElm;
- hueRootElm = self.getEl('h');
- huePointElm = self.getEl('hp');
- svRootElm = self.getEl('sv');
- svPointElm = self.getEl('svp');
- function getPos(elm, event) {
- var pos = funcs.getPos(elm);
- var x, y;
- x = event.pageX - pos.x;
- y = event.pageY - pos.y;
- x = Math.max(0, Math.min(x / elm.clientWidth, 1));
- y = Math.max(0, Math.min(y / elm.clientHeight, 1));
- return {
- x: x,
- y: y
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._repaint = function () {
+ hsv = color.toHsv();
+ updateColor(hsv);
</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 updateColor(hsv, hueUpdate) {
- var hue = (360 - hsv.h) / 360;
- funcs.css(huePointElm, { top: hue * 100 + '%' });
- if (!hueUpdate) {
- funcs.css(svPointElm, {
- left: hsv.s + '%',
- top: 100 - hsv.v + '%'
- });
- }
- svRootElm.style.background = global$16({
- s: 100,
- v: 100,
- h: hsv.h
- }).toHex();
- self.color().parse({
- s: hsv.s,
- v: hsv.v,
- h: hsv.h
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._super();
+ self._svdraghelper = new DragHelper(self._id + '-sv', {
+ start: updateSaturationAndValue,
+ drag: updateSaturationAndValue
</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 updateSaturationAndValue(e) {
- var pos;
- pos = getPos(svRootElm, e);
- hsv.s = pos.x * 100;
- hsv.v = (1 - pos.y) * 100;
- updateColor(hsv);
- self.fire('change');
- }
- function updateHue(e) {
- var pos;
- pos = getPos(hueRootElm, e);
- hsv = color.toHsv();
- hsv.h = (1 - pos.y) * 360;
- updateColor(hsv, true);
- self.fire('change');
- }
- self._repaint = function () {
- hsv = color.toHsv();
- updateColor(hsv);
- };
- self._super();
- self._svdraghelper = new DragHelper(self._id + '-sv', {
- start: updateSaturationAndValue,
- drag: updateSaturationAndValue
- });
- self._hdraghelper = new DragHelper(self._id + '-h', {
- start: updateHue,
- drag: updateHue
- });
- self._repaint();
- },
- rgb: function () {
- return this.color().toRgb();
- },
- value: function (value) {
- var self = this;
- if (arguments.length) {
- self.color().parse(value);
- if (self._rendered) {
- self._repaint();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._hdraghelper = new DragHelper(self._id + '-h', {
+ start: updateHue,
+ drag: updateHue
+ });
+ self._repaint();
+ },
+ rgb: function () {
+ return this.color().toRgb();
+ },
+ value: function (value) {
+ var self = this;
+ if (arguments.length) {
+ self.color().parse(value);
+ if (self._rendered) {
+ self._repaint();
+ }
+ } else {
+ return self.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">- } else {
- return self.color().toHex();
- }
- },
- color: function () {
- if (!this._color) {
- this._color = global$16();
- }
- return this._color;
- },
- renderHtml: function () {
- var self = this;
- var id = self._id;
- var prefix = self.classPrefix;
- var hueHtml;
- var stops = '#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000';
- function getOldIeFallbackHtml() {
- var i, l, html = '', gradientPrefix, stopsList;
- gradientPrefix = 'filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=';
- stopsList = stops.split(',');
- for (i = 0, l = stopsList.length - 1; i < l; i++) {
- html += '<div class="' + prefix + 'colorpicker-h-chunk" style="' + 'height:' + 100 / l + '%;' + gradientPrefix + stopsList[i] + ',endColorstr=' + stopsList[i + 1] + ');' + '-ms-' + gradientPrefix + stopsList[i] + ',endColorstr=' + stopsList[i + 1] + ')' + '"></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ color: function () {
+ if (!this._color) {
+ this._color = global$g();
</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 html;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this._color;
+ },
+ renderHtml: function () {
+ var self = this;
+ var id = self._id;
+ var prefix = self.classPrefix;
+ var hueHtml;
+ var stops = '#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000';
+ function getOldIeFallbackHtml() {
+ var i, l, html = '', gradientPrefix, stopsList;
+ gradientPrefix = 'filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=';
+ stopsList = stops.split(',');
+ for (i = 0, l = stopsList.length - 1; i < l; i++) {
+ html += '<div class="' + prefix + 'colorpicker-h-chunk" style="' + 'height:' + 100 / l + '%;' + gradientPrefix + stopsList[i] + ',endColorstr=' + stopsList[i + 1] + ');' + '-ms-' + gradientPrefix + stopsList[i] + ',endColorstr=' + stopsList[i + 1] + ')' + '"></div>';
+ }
+ return html;
+ }
+ var gradientCssText = 'background: -ms-linear-gradient(top,' + stops + ');' + 'background: linear-gradient(to bottom,' + stops + ');';
+ hueHtml = '<div id="' + id + '-h" class="' + prefix + 'colorpicker-h" style="' + gradientCssText + '">' + getOldIeFallbackHtml() + '<div id="' + id + '-hp" class="' + prefix + 'colorpicker-h-marker"></div>' + '</div>';
+ return '<div id="' + id + '" class="' + self.classes + '">' + '<div id="' + id + '-sv" class="' + prefix + 'colorpicker-sv">' + '<div class="' + prefix + 'colorpicker-overlay1">' + '<div class="' + prefix + 'colorpicker-overlay2">' + '<div id="' + id + '-svp" class="' + prefix + 'colorpicker-selector1">' + '<div class="' + prefix + 'colorpicker-selector2"></div>' + '</div>' + '</div>' + '</div>' + '</div>' + hueHtml + '</div>';
</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 gradientCssText = 'background: -ms-linear-gradient(top,' + stops + ');' + 'background: linear-gradient(to bottom,' + stops + ');';
- hueHtml = '<div id="' + id + '-h" class="' + prefix + 'colorpicker-h" style="' + gradientCssText + '">' + getOldIeFallbackHtml() + '<div id="' + id + '-hp" class="' + prefix + 'colorpicker-h-marker"></div>' + '</div>';
- return '<div id="' + id + '" class="' + self.classes + '">' + '<div id="' + id + '-sv" class="' + prefix + 'colorpicker-sv">' + '<div class="' + prefix + 'colorpicker-overlay1">' + '<div class="' + prefix + 'colorpicker-overlay2">' + '<div id="' + id + '-svp" class="' + prefix + 'colorpicker-selector1">' + '<div class="' + prefix + 'colorpicker-selector2"></div>' + '</div>' + '</div>' + '</div>' + '</div>' + hueHtml + '</div>';
- }
- });
</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">- var DropZone = Widget.extend({
- init: function (settings) {
- var self = this;
- settings = global$4.extend({
- height: 100,
- text: 'Drop an image here',
- multiple: false,
- accept: null
- }, settings);
- self._super(settings);
- self.classes.add('dropzone');
- if (settings.multiple) {
- self.classes.add('multiple');
- }
- },
- renderHtml: function () {
- var self = this;
- var attrs, elm;
- var cfg = self.settings;
- attrs = {
- id: self._id,
- hidefocus: '1'
- };
- elm = funcs.create('div', attrs, '<span>' + this.translate(cfg.text) + '</span>');
- if (cfg.height) {
- funcs.css(elm, 'height', cfg.height + 'px');
- }
- if (cfg.width) {
- funcs.css(elm, 'width', cfg.width + 'px');
- }
- elm.className = self.classes;
- return elm.outerHTML;
- },
- postRender: function () {
- var self = this;
- var toggleDragClass = function (e) {
- e.preventDefault();
- self.classes.toggle('dragenter');
- self.getEl().className = self.classes;
- };
- var filter = function (files) {
- var accept = self.settings.accept;
- if (typeof accept !== 'string') {
- return files;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var DropZone = Widget.extend({
+ init: function (settings) {
+ var self = this;
+ settings = global$4.extend({
+ height: 100,
+ text: 'Drop an image here',
+ multiple: false,
+ accept: null
+ }, settings);
+ self._super(settings);
+ self.classes.add('dropzone');
+ if (settings.multiple) {
+ self.classes.add('multiple');
</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 re = new RegExp('(' + accept.split(/\s*,\s*/).join('|') + ')$', 'i');
- return global$4.grep(files, function (file) {
- return re.test(file.name);
- });
- };
- self._super();
- self.$el.on('dragover', function (e) {
- e.preventDefault();
- });
- self.$el.on('dragenter', toggleDragClass);
- self.$el.on('dragleave', toggleDragClass);
- self.$el.on('drop', function (e) {
- e.preventDefault();
- if (self.state.get('disabled')) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ renderHtml: function () {
+ var self = this;
+ var attrs, elm;
+ var cfg = self.settings;
+ attrs = {
+ id: self._id,
+ hidefocus: '1'
+ };
+ elm = funcs.create('div', attrs, '<span>' + this.translate(cfg.text) + '</span>');
+ if (cfg.height) {
+ funcs.css(elm, 'height', cfg.height + '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">- var files = filter(e.dataTransfer.files);
- self.value = function () {
- if (!files.length) {
- return null;
- } else if (self.settings.multiple) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (cfg.width) {
+ funcs.css(elm, 'width', cfg.width + 'px');
+ }
+ elm.className = self.classes;
+ return elm.outerHTML;
+ },
+ postRender: function () {
+ var self = this;
+ var toggleDragClass = function (e) {
+ e.preventDefault();
+ self.classes.toggle('dragenter');
+ self.getEl().className = self.classes;
+ };
+ var filter = function (files) {
+ var accept = self.settings.accept;
+ if (typeof accept !== 'string') {
</ins><span class="cx" style="display: block; padding: 0 10px"> return files;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- return files[0];
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var re = new RegExp('(' + accept.split(/\s*,\s*/).join('|') + ')$', 'i');
+ return global$4.grep(files, function (file) {
+ return re.test(file.name);
+ });
</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 (files.length) {
- self.fire('change', e);
- }
- });
- },
- remove: function () {
- this.$el.off();
- this._super();
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._super();
+ self.$el.on('dragover', function (e) {
+ e.preventDefault();
+ });
+ self.$el.on('dragenter', toggleDragClass);
+ self.$el.on('dragleave', toggleDragClass);
+ self.$el.on('drop', function (e) {
+ e.preventDefault();
+ if (self.state.get('disabled')) {
+ return;
+ }
+ var files = filter(e.dataTransfer.files);
+ self.value = function () {
+ if (!files.length) {
+ return null;
+ } else if (self.settings.multiple) {
+ return files;
+ } else {
+ return files[0];
+ }
+ };
+ if (files.length) {
+ self.fire('change', e);
+ }
+ });
+ },
+ remove: function () {
+ this.$el.off();
+ this._super();
+ }
+ });
</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 Path = Widget.extend({
- init: function (settings) {
- var self = this;
- if (!settings.delimiter) {
- settings.delimiter = '\xBB';
- }
- self._super(settings);
- self.classes.add('path');
- self.canFocus = true;
- self.on('click', function (e) {
- var index;
- var target = e.target;
- if (index = target.getAttribute('data-index')) {
- self.fire('select', {
- value: self.row()[index],
- index: index
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Path = Widget.extend({
+ init: function (settings) {
+ var self = this;
+ if (!settings.delimiter) {
+ settings.delimiter = '\xBB';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self.row(self.settings.row);
- },
- focus: function () {
- var self = this;
- self.getEl().firstChild.focus();
- return self;
- },
- row: function (row) {
- if (!arguments.length) {
- return this.state.get('row');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._super(settings);
+ self.classes.add('path');
+ self.canFocus = true;
+ self.on('click', function (e) {
+ var index;
+ var target = e.target;
+ if (index = target.getAttribute('data-index')) {
+ self.fire('select', {
+ value: self.row()[index],
+ index: index
+ });
+ }
+ });
+ self.row(self.settings.row);
+ },
+ focus: function () {
+ var self = this;
+ self.getEl().firstChild.focus();
+ return self;
+ },
+ row: function (row) {
+ if (!arguments.length) {
+ return this.state.get('row');
+ }
+ this.state.set('row', row);
+ return this;
+ },
+ renderHtml: function () {
+ var self = this;
+ return '<div id="' + self._id + '" class="' + self.classes + '">' + self._getDataPathHtml(self.state.get('row')) + '</div>';
+ },
+ bindStates: function () {
+ var self = this;
+ self.state.on('change:row', function (e) {
+ self.innerHtml(self._getDataPathHtml(e.value));
+ });
+ return self._super();
+ },
+ _getDataPathHtml: function (data) {
+ var self = this;
+ var parts = data || [];
+ var i, l, html = '';
+ var prefix = self.classPrefix;
+ for (i = 0, l = parts.length; i < l; i++) {
+ html += (i > 0 ? '<div class="' + prefix + 'divider" aria-hidden="true"> ' + self.settings.delimiter + ' </div>' : '') + '<div role="button" class="' + prefix + 'path-item' + (i === l - 1 ? ' ' + prefix + 'last' : '') + '" data-index="' + i + '" tabindex="-1" id="' + self._id + '-' + i + '" aria-level="' + (i + 1) + '">' + parts[i].name + '</div>';
+ }
+ if (!html) {
+ html = '<div class="' + prefix + 'path-item">\xA0</div>';
+ }
+ return html;
</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.state.set('row', row);
- return this;
- },
- renderHtml: function () {
- var self = this;
- return '<div id="' + self._id + '" class="' + self.classes + '">' + self._getDataPathHtml(self.state.get('row')) + '</div>';
- },
- bindStates: function () {
- var self = this;
- self.state.on('change:row', function (e) {
- self.innerHtml(self._getDataPathHtml(e.value));
- });
- return self._super();
- },
- _getDataPathHtml: function (data) {
- var self = this;
- var parts = data || [];
- var i, l, html = '';
- var prefix = self.classPrefix;
- for (i = 0, l = parts.length; i < l; i++) {
- html += (i > 0 ? '<div class="' + prefix + 'divider" aria-hidden="true"> ' + self.settings.delimiter + ' </div>' : '') + '<div role="button" class="' + prefix + 'path-item' + (i === l - 1 ? ' ' + prefix + 'last' : '') + '" data-index="' + i + '" tabindex="-1" id="' + self._id + '-' + i + '" aria-level="' + (i + 1) + '">' + parts[i].name + '</div>';
- }
- if (!html) {
- html = '<div class="' + prefix + 'path-item">\xA0</div>';
- }
- return html;
- }
- });
</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">- var ElementPath = Path.extend({
- postRender: function () {
- var self = this, editor = self.settings.editor;
- function isHidden(elm) {
- if (elm.nodeType === 1) {
- if (elm.nodeName === 'BR' || !!elm.getAttribute('data-mce-bogus')) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ElementPath = Path.extend({
+ postRender: function () {
+ var self = this, editor = self.settings.editor;
+ function isHidden(elm) {
+ if (elm.nodeType === 1) {
+ if (elm.nodeName === 'BR' || !!elm.getAttribute('data-mce-bogus')) {
+ return true;
+ }
+ if (elm.getAttribute('data-mce-type') === 'bookmark') {
+ return true;
+ }
</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 (elm.getAttribute('data-mce-type') === 'bookmark') {
- return true;
- }
</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">- return false;
- }
- if (editor.settings.elementpath !== false) {
- self.on('select', function (e) {
- editor.focus();
- editor.selection.select(this.row()[e.index].element);
- editor.nodeChanged();
- });
- editor.on('nodeChange', function (e) {
- var outParents = [];
- var parents = e.parents;
- var i = parents.length;
- while (i--) {
- if (parents[i].nodeType === 1 && !isHidden(parents[i])) {
- var args = editor.fire('ResolveName', {
- name: parents[i].nodeName.toLowerCase(),
- target: parents[i]
- });
- if (!args.isDefaultPrevented()) {
- outParents.push({
- name: args.name,
- element: parents[i]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (editor.settings.elementpath !== false) {
+ self.on('select', function (e) {
+ editor.focus();
+ editor.selection.select(this.row()[e.index].element);
+ editor.nodeChanged();
+ });
+ editor.on('nodeChange', function (e) {
+ var outParents = [];
+ var parents = e.parents;
+ var i = parents.length;
+ while (i--) {
+ if (parents[i].nodeType === 1 && !isHidden(parents[i])) {
+ var args = editor.fire('ResolveName', {
+ name: parents[i].nodeName.toLowerCase(),
+ target: parents[i]
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!args.isDefaultPrevented()) {
+ outParents.push({
+ name: args.name,
+ element: parents[i]
+ });
+ }
+ if (args.isPropagationStopped()) {
+ 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">- if (args.isPropagationStopped()) {
- break;
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- self.row(outParents);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.row(outParents);
+ });
+ }
+ return self._super();
</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 self._super();
- }
- });
</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">- var FormItem = Container.extend({
- Defaults: {
- layout: 'flex',
- align: 'center',
- defaults: { flex: 1 }
- },
- renderHtml: function () {
- var self = this, layout = self._layout, prefix = self.classPrefix;
- self.classes.add('formitem');
- layout.preRender(self);
- return '<div id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1">' + (self.settings.title ? '<div id="' + self._id + '-title" class="' + prefix + 'title">' + self.settings.title + '</div>' : '') + '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + (self.settings.html || '') + layout.renderHtml(self) + '</div>' + '</div>';
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var FormItem = Container.extend({
+ Defaults: {
+ layout: 'flex',
+ align: 'center',
+ defaults: { flex: 1 }
+ },
+ renderHtml: function () {
+ var self = this, layout = self._layout, prefix = self.classPrefix;
+ self.classes.add('formitem');
+ layout.preRender(self);
+ return '<div id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1">' + (self.settings.title ? '<div id="' + self._id + '-title" class="' + prefix + 'title">' + self.settings.title + '</div>' : '') + '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + (self.settings.html || '') + layout.renderHtml(self) + '</div>' + '</div>';
+ }
+ });
</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 Form = Container.extend({
- Defaults: {
- containerCls: 'form',
- layout: 'flex',
- direction: 'column',
- align: 'stretch',
- flex: 1,
- padding: 15,
- labelGap: 30,
- spacing: 10,
- callbacks: {
- submit: function () {
- this.submit();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Form = Container.extend({
+ Defaults: {
+ containerCls: 'form',
+ layout: 'flex',
+ direction: 'column',
+ align: 'stretch',
+ flex: 1,
+ padding: 15,
+ labelGap: 30,
+ spacing: 10,
+ callbacks: {
+ submit: function () {
+ this.submit();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- },
- preRender: function () {
- var self = this, items = self.items();
- if (!self.settings.formItemDefaults) {
- self.settings.formItemDefaults = {
- layout: 'flex',
- autoResize: 'overflow',
- defaults: { flex: 1 }
- };
- }
- items.each(function (ctrl) {
- var formItem;
- var label = ctrl.settings.label;
- if (label) {
- formItem = new FormItem(global$4.extend({
- items: {
- type: 'label',
- id: ctrl._id + '-l',
- text: label,
- flex: 0,
- forId: ctrl._id,
- disabled: ctrl.disabled()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ preRender: function () {
+ var self = this, items = self.items();
+ if (!self.settings.formItemDefaults) {
+ self.settings.formItemDefaults = {
+ layout: 'flex',
+ autoResize: 'overflow',
+ defaults: { flex: 1 }
+ };
+ }
+ items.each(function (ctrl) {
+ var formItem;
+ var label = ctrl.settings.label;
+ if (label) {
+ formItem = new FormItem(global$4.extend({
+ items: {
+ type: 'label',
+ id: ctrl._id + '-l',
+ text: label,
+ flex: 0,
+ forId: ctrl._id,
+ disabled: ctrl.disabled()
+ }
+ }, self.settings.formItemDefaults));
+ formItem.type = 'formitem';
+ ctrl.aria('labelledby', ctrl._id + '-l');
+ if (typeof ctrl.settings.flex === 'undefined') {
+ ctrl.settings.flex = 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">- }, self.settings.formItemDefaults));
- formItem.type = 'formitem';
- ctrl.aria('labelledby', ctrl._id + '-l');
- if (typeof ctrl.settings.flex === 'undefined') {
- ctrl.settings.flex = 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.replace(ctrl, formItem);
+ formItem.add(ctrl);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.replace(ctrl, formItem);
- formItem.add(ctrl);
- }
- });
- },
- submit: function () {
- return this.fire('submit', { data: this.toJSON() });
- },
- postRender: function () {
- var self = this;
- self._super();
- self.fromJSON(self.settings.data);
- },
- bindStates: function () {
- var self = this;
- self._super();
- function recalcLabels() {
- var maxLabelWidth = 0;
- var labels = [];
- var i, labelGap, items;
- if (self.settings.labelGapCalc === false) {
- return;
- }
- if (self.settings.labelGapCalc === 'children') {
- items = self.find('formitem');
- } else {
- items = self.items();
- }
- items.filter('formitem').each(function (item) {
- var labelCtrl = item.items()[0], labelWidth = labelCtrl.getEl().clientWidth;
- maxLabelWidth = labelWidth > maxLabelWidth ? labelWidth : maxLabelWidth;
- labels.push(labelCtrl);
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- labelGap = self.settings.labelGap || 0;
- i = labels.length;
- while (i--) {
- labels[i].settings.minWidth = maxLabelWidth + labelGap;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ submit: function () {
+ return this.fire('submit', { data: this.toJSON() });
+ },
+ postRender: function () {
+ var self = this;
+ self._super();
+ self.fromJSON(self.settings.data);
+ },
+ bindStates: function () {
+ var self = this;
+ self._super();
+ function recalcLabels() {
+ var maxLabelWidth = 0;
+ var labels = [];
+ var i, labelGap, items;
+ if (self.settings.labelGapCalc === false) {
+ return;
+ }
+ if (self.settings.labelGapCalc === 'children') {
+ items = self.find('formitem');
+ } else {
+ items = self.items();
+ }
+ items.filter('formitem').each(function (item) {
+ var labelCtrl = item.items()[0], labelWidth = labelCtrl.getEl().clientWidth;
+ maxLabelWidth = labelWidth > maxLabelWidth ? labelWidth : maxLabelWidth;
+ labels.push(labelCtrl);
+ });
+ labelGap = self.settings.labelGap || 0;
+ i = labels.length;
+ while (i--) {
+ labels[i].settings.minWidth = maxLabelWidth + labelGap;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.on('show', recalcLabels);
+ recalcLabels();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.on('show', recalcLabels);
- recalcLabels();
- }
- });
</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">- var FieldSet = Form.extend({
- Defaults: {
- containerCls: 'fieldset',
- layout: 'flex',
- direction: 'column',
- align: 'stretch',
- flex: 1,
- padding: '25 15 5 15',
- labelGap: 30,
- spacing: 10,
- border: 1
- },
- renderHtml: function () {
- var self = this, layout = self._layout, prefix = self.classPrefix;
- self.preRender();
- layout.preRender(self);
- return '<fieldset id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1">' + (self.settings.title ? '<legend id="' + self._id + '-title" class="' + prefix + 'fieldset-title">' + self.settings.title + '</legend>' : '') + '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + (self.settings.html || '') + layout.renderHtml(self) + '</div>' + '</fieldset>';
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var FieldSet = Form.extend({
+ Defaults: {
+ containerCls: 'fieldset',
+ layout: 'flex',
+ direction: 'column',
+ align: 'stretch',
+ flex: 1,
+ padding: '25 15 5 15',
+ labelGap: 30,
+ spacing: 10,
+ border: 1
+ },
+ renderHtml: function () {
+ var self = this, layout = self._layout, prefix = self.classPrefix;
+ self.preRender();
+ layout.preRender(self);
+ return '<fieldset id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1">' + (self.settings.title ? '<legend id="' + self._id + '-title" class="' + prefix + 'fieldset-title">' + self.settings.title + '</legend>' : '') + '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + (self.settings.html || '') + layout.renderHtml(self) + '</div>' + '</fieldset>';
+ }
+ });
</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 unique$1 = 0;
- var generate = function (prefix) {
- var date = new Date();
- var time = date.getTime();
- var random = Math.floor(Math.random() * 1000000000);
- unique$1++;
- return prefix + '_' + random + unique$1 + String(time);
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var unique$1 = 0;
+ var generate = function (prefix) {
+ var date = new Date();
+ var time = date.getTime();
+ var random = Math.floor(Math.random() * 1000000000);
+ unique$1++;
+ return prefix + '_' + random + unique$1 + String(time);
+ };
</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 fromHtml = function (html, scope) {
- var doc = scope || document;
- var div = doc.createElement('div');
- div.innerHTML = html;
- if (!div.hasChildNodes() || div.childNodes.length > 1) {
- console.error('HTML does not have a single root node', html);
- throw 'HTML must have a single root node';
- }
- return fromDom(div.childNodes[0]);
- };
- var fromTag = function (tag, scope) {
- var doc = scope || document;
- var node = doc.createElement(tag);
- return fromDom(node);
- };
- var fromText = function (text, scope) {
- var doc = scope || document;
- var node = doc.createTextNode(text);
- return fromDom(node);
- };
- var fromDom = function (node) {
- if (node === null || node === undefined)
- throw new Error('Node cannot be null or undefined');
- return { dom: constant(node) };
- };
- var fromPoint = function (docElm, x, y) {
- var doc = docElm.dom();
- return Option.from(doc.elementFromPoint(x, y)).map(fromDom);
- };
- var Element$$1 = {
- fromHtml: fromHtml,
- fromTag: fromTag,
- fromText: fromText,
- fromDom: fromDom,
- fromPoint: fromPoint
- };
-
- var cached = function (f) {
- var called = false;
- var r;
- return function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fromHtml = function (html, scope) {
+ var doc = scope || document;
+ var div = doc.createElement('div');
+ div.innerHTML = html;
+ if (!div.hasChildNodes() || div.childNodes.length > 1) {
+ console.error('HTML does not have a single root node', html);
+ throw 'HTML must have a single root 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 (!called) {
- called = true;
- r = f.apply(null, args);
- }
- return r;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return fromDom(div.childNodes[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">- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fromTag = function (tag, scope) {
+ var doc = scope || document;
+ var node = doc.createElement(tag);
+ return fromDom(node);
+ };
+ var fromText = function (text, scope) {
+ var doc = scope || document;
+ var node = doc.createTextNode(text);
+ return fromDom(node);
+ };
+ var fromDom = function (node) {
+ if (node === null || node === undefined)
+ throw new Error('Node cannot be null or undefined');
+ return { dom: constant(node) };
+ };
+ var fromPoint = function (docElm, x, y) {
+ var doc = docElm.dom();
+ return Option.from(doc.elementFromPoint(x, y)).map(fromDom);
+ };
+ var Element$$1 = {
+ fromHtml: fromHtml,
+ fromTag: fromTag,
+ fromText: fromText,
+ fromDom: fromDom,
+ fromPoint: fromPoint
+ };
</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 $_2jrgnk1apjjgwek8y = {
- ATTRIBUTE: Node.ATTRIBUTE_NODE,
- CDATA_SECTION: Node.CDATA_SECTION_NODE,
- COMMENT: Node.COMMENT_NODE,
- DOCUMENT: Node.DOCUMENT_NODE,
- DOCUMENT_TYPE: Node.DOCUMENT_TYPE_NODE,
- DOCUMENT_FRAGMENT: Node.DOCUMENT_FRAGMENT_NODE,
- ELEMENT: Node.ELEMENT_NODE,
- TEXT: Node.TEXT_NODE,
- PROCESSING_INSTRUCTION: Node.PROCESSING_INSTRUCTION_NODE,
- ENTITY_REFERENCE: Node.ENTITY_REFERENCE_NODE,
- ENTITY: Node.ENTITY_NODE,
- NOTATION: Node.NOTATION_NODE
- };
-
- var name = function (element) {
- var r = element.dom().nodeName;
- return r.toLowerCase();
- };
- var type = function (element) {
- return element.dom().nodeType;
- };
- var value = function (element) {
- return element.dom().nodeValue;
- };
- var isType$2 = function (t) {
- return function (element) {
- return type(element) === t;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var cached = function (f) {
+ var called = false;
+ var r;
+ return function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ if (!called) {
+ called = true;
+ r = f.apply(null, args);
+ }
+ return r;
+ };
</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 isComment = function (element) {
- return type(element) === $_2jrgnk1apjjgwek8y.COMMENT || name(element) === '#comment';
- };
- var isElement = isType$2($_2jrgnk1apjjgwek8y.ELEMENT);
- var isText = isType$2($_2jrgnk1apjjgwek8y.TEXT);
- var isDocument = isType$2($_2jrgnk1apjjgwek8y.DOCUMENT);
- var $_fv3as1aojjgwek8x = {
- name: name,
- type: type,
- value: value,
- isElement: isElement,
- isText: isText,
- isDocument: isDocument,
- isComment: isComment
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var inBody = function (element) {
- var dom = $_fv3as1aojjgwek8x.isText(element) ? element.dom().parentNode : element.dom();
- return dom !== undefined && dom !== null && dom.ownerDocument.body.contains(dom);
- };
- var body = cached(function () {
- return getBody(Element$$1.fromDom(document));
- });
- var getBody = function (doc) {
- var body = doc.dom().body;
- if (body === null || body === undefined)
- throw 'Body is not available yet';
- return Element$$1.fromDom(body);
- };
- var $_d2glpe1amjjgwek8t = {
- body: body,
- getBody: getBody,
- inBody: inBody
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ATTRIBUTE = Node.ATTRIBUTE_NODE;
+ var CDATA_SECTION = Node.CDATA_SECTION_NODE;
+ var COMMENT = Node.COMMENT_NODE;
+ var DOCUMENT = Node.DOCUMENT_NODE;
+ var DOCUMENT_TYPE = Node.DOCUMENT_TYPE_NODE;
+ var DOCUMENT_FRAGMENT = Node.DOCUMENT_FRAGMENT_NODE;
+ var ELEMENT = Node.ELEMENT_NODE;
+ var TEXT = Node.TEXT_NODE;
+ var PROCESSING_INSTRUCTION = Node.PROCESSING_INSTRUCTION_NODE;
+ var ENTITY_REFERENCE = Node.ENTITY_REFERENCE_NODE;
+ var ENTITY = Node.ENTITY_NODE;
+ var NOTATION = Node.NOTATION_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 Immutable = function () {
- var fields = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- fields[_i] = arguments[_i];
- }
- return function () {
- var values = [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Immutable = function () {
+ var fields = [];
</ins><span class="cx" style="display: block; padding: 0 10px"> for (var _i = 0; _i < arguments.length; _i++) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- values[_i] = arguments[_i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ fields[_i] = arguments[_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 (fields.length !== values.length) {
- throw new Error('Wrong number of arguments to struct. Expected "[' + fields.length + ']", got ' + values.length + ' arguments');
- }
- var struct = {};
- each(fields, function (name, i) {
- struct[name] = constant(values[i]);
- });
- return struct;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return function () {
+ var values = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ values[_i] = arguments[_i];
+ }
+ if (fields.length !== values.length) {
+ throw new Error('Wrong number of arguments to struct. Expected "[' + fields.length + ']", got ' + values.length + ' arguments');
+ }
+ var struct = {};
+ each(fields, function (name, i) {
+ struct[name] = constant(values[i]);
+ });
+ return struct;
+ };
</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><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var toArray = function (target, f) {
- var r = [];
- var recurse = function (e) {
- r.push(e);
- return f(e);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var node = function () {
+ var f = Global$1.getOrDie('Node');
+ return f;
</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 cur = f(target);
- do {
- cur = cur.bind(recurse);
- } while (cur.isSome());
- return r;
- };
- var $_607sf01awjjgweka0 = { toArray: toArray };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var compareDocumentPosition = function (a, b, match) {
+ return (a.compareDocumentPosition(b) & match) !== 0;
+ };
+ var documentPositionPreceding = function (a, b) {
+ return compareDocumentPosition(a, b, node().DOCUMENT_POSITION_PRECEDING);
+ };
+ var documentPositionContainedBy = function (a, b) {
+ return compareDocumentPosition(a, b, node().DOCUMENT_POSITION_CONTAINED_BY);
+ };
+ var Node$1 = {
+ documentPositionPreceding: documentPositionPreceding,
+ documentPositionContainedBy: documentPositionContainedBy
+ };
</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 node = function () {
- var f = $_8wnjhx19gjjgwek54.getOrDie('Node');
- return f;
- };
- var compareDocumentPosition = function (a, b, match) {
- return (a.compareDocumentPosition(b) & match) !== 0;
- };
- var documentPositionPreceding = function (a, b) {
- return compareDocumentPosition(a, b, node().DOCUMENT_POSITION_PRECEDING);
- };
- var documentPositionContainedBy = function (a, b) {
- return compareDocumentPosition(a, b, node().DOCUMENT_POSITION_CONTAINED_BY);
- };
- var $_d0o64o1ayjjgwekaa = {
- documentPositionPreceding: documentPositionPreceding,
- documentPositionContainedBy: documentPositionContainedBy
- };
-
- var firstMatch = function (regexes, s) {
- for (var i = 0; i < regexes.length; i++) {
- var x = regexes[i];
- if (x.test(s))
- return x;
- }
- return undefined;
- };
- var find$2 = function (regexes, agent) {
- var r = firstMatch(regexes, agent);
- if (!r)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var firstMatch = function (regexes, s) {
+ for (var i = 0; i < regexes.length; i++) {
+ var x = regexes[i];
+ if (x.test(s))
+ return x;
+ }
+ return undefined;
+ };
+ var find$2 = function (regexes, agent) {
+ var r = firstMatch(regexes, agent);
+ if (!r)
+ return {
+ major: 0,
+ minor: 0
+ };
+ var group = function (i) {
+ return Number(agent.replace(r, '$' + i));
+ };
+ return nu(group(1), group(2));
+ };
+ var detect = function (versionRegexes, agent) {
+ var cleanedAgent = String(agent).toLowerCase();
+ if (versionRegexes.length === 0)
+ return unknown();
+ return find$2(versionRegexes, cleanedAgent);
+ };
+ var unknown = function () {
+ return nu(0, 0);
+ };
+ var nu = function (major, minor) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- major: 0,
- minor: 0
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ major: major,
+ minor: minor
</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 group = function (i) {
- return Number(agent.replace(r, '$' + i));
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return nu(group(1), group(2));
- };
- var detect = function (versionRegexes, agent) {
- var cleanedAgent = String(agent).toLowerCase();
- if (versionRegexes.length === 0)
- return unknown();
- return find$2(versionRegexes, cleanedAgent);
- };
- var unknown = function () {
- return nu(0, 0);
- };
- var nu = function (major, minor) {
- return {
- major: major,
- minor: minor
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Version = {
+ nu: nu,
+ detect: detect,
+ unknown: unknown
</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 $_bhlk9t1b2jjgwekaq = {
- nu: nu,
- detect: detect,
- unknown: unknown
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var edge = 'Edge';
- var chrome = 'Chrome';
- var ie = 'IE';
- var opera = 'Opera';
- var firefox = 'Firefox';
- var safari = 'Safari';
- var isBrowser = function (name, current) {
- return function () {
- return current === name;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var edge = 'Edge';
+ var chrome = 'Chrome';
+ var ie = 'IE';
+ var opera = 'Opera';
+ var firefox = 'Firefox';
+ var safari = 'Safari';
+ var isBrowser = function (name, current) {
+ return function () {
+ return current === name;
+ };
</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 unknown$1 = function () {
- return nu$1({
- current: undefined,
- version: $_bhlk9t1b2jjgwekaq.unknown()
- });
- };
- var nu$1 = function (info) {
- var current = info.current;
- var version = info.version;
- return {
- current: current,
- version: version,
- isEdge: isBrowser(edge, current),
- isChrome: isBrowser(chrome, current),
- isIE: isBrowser(ie, current),
- isOpera: isBrowser(opera, current),
- isFirefox: isBrowser(firefox, current),
- isSafari: isBrowser(safari, current)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var unknown$1 = function () {
+ return nu$1({
+ current: undefined,
+ version: Version.unknown()
+ });
</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 $_3j4jht1b1jjgwekal = {
- unknown: unknown$1,
- nu: nu$1,
- edge: constant(edge),
- chrome: constant(chrome),
- ie: constant(ie),
- opera: constant(opera),
- firefox: constant(firefox),
- safari: constant(safari)
- };
-
- var windows$1 = 'Windows';
- var ios = 'iOS';
- var android = 'Android';
- var linux = 'Linux';
- var osx = 'OSX';
- var solaris = 'Solaris';
- var freebsd = 'FreeBSD';
- var isOS = function (name, current) {
- return function () {
- return current === name;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var nu$1 = function (info) {
+ var current = info.current;
+ var version = info.version;
+ return {
+ current: current,
+ version: version,
+ isEdge: isBrowser(edge, current),
+ isChrome: isBrowser(chrome, current),
+ isIE: isBrowser(ie, current),
+ isOpera: isBrowser(opera, current),
+ isFirefox: isBrowser(firefox, current),
+ isSafari: isBrowser(safari, current)
+ };
</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 unknown$2 = function () {
- return nu$2({
- current: undefined,
- version: $_bhlk9t1b2jjgwekaq.unknown()
- });
- };
- var nu$2 = function (info) {
- var current = info.current;
- var version = info.version;
- return {
- current: current,
- version: version,
- isWindows: isOS(windows$1, current),
- isiOS: isOS(ios, current),
- isAndroid: isOS(android, current),
- isOSX: isOS(osx, current),
- isLinux: isOS(linux, current),
- isSolaris: isOS(solaris, current),
- isFreeBSD: isOS(freebsd, current)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Browser = {
+ unknown: unknown$1,
+ nu: nu$1,
+ edge: constant(edge),
+ chrome: constant(chrome),
+ ie: constant(ie),
+ opera: constant(opera),
+ firefox: constant(firefox),
+ safari: constant(safari)
</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 $_7je60a1b3jjgwekar = {
- unknown: unknown$2,
- nu: nu$2,
- windows: constant(windows$1),
- ios: constant(ios),
- android: constant(android),
- linux: constant(linux),
- osx: constant(osx),
- solaris: constant(solaris),
- freebsd: constant(freebsd)
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function DeviceType (os, browser, userAgent) {
- var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true;
- var isiPhone = os.isiOS() && !isiPad;
- var isAndroid3 = os.isAndroid() && os.version.major === 3;
- var isAndroid4 = os.isAndroid() && os.version.major === 4;
- var isTablet = isiPad || isAndroid3 || isAndroid4 && /mobile/i.test(userAgent) === true;
- var isTouch = os.isiOS() || os.isAndroid();
- var isPhone = isTouch && !isTablet;
- var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false;
- return {
- isiPad: constant(isiPad),
- isiPhone: constant(isiPhone),
- isTablet: constant(isTablet),
- isPhone: constant(isPhone),
- isTouch: constant(isTouch),
- isAndroid: os.isAndroid,
- isiOS: os.isiOS,
- isWebView: constant(iOSwebview)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var windows$1 = 'Windows';
+ var ios = 'iOS';
+ var android = 'Android';
+ var linux = 'Linux';
+ var osx = 'OSX';
+ var solaris = 'Solaris';
+ var freebsd = 'FreeBSD';
+ var isOS = function (name, current) {
+ return function () {
+ return current === name;
+ };
</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 detect$1 = function (candidates, userAgent) {
- var agent = String(userAgent).toLowerCase();
- return find(candidates, function (candidate) {
- return candidate.search(agent);
- });
- };
- var detectBrowser = function (browsers, userAgent) {
- return detect$1(browsers, userAgent).map(function (browser) {
- var version = $_bhlk9t1b2jjgwekaq.detect(browser.versionRegexes, userAgent);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var unknown$2 = function () {
+ return nu$2({
+ current: undefined,
+ version: Version.unknown()
+ });
+ };
+ var nu$2 = function (info) {
+ var current = info.current;
+ var version = info.version;
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- current: browser.name,
- version: version
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ current: current,
+ version: version,
+ isWindows: isOS(windows$1, current),
+ isiOS: isOS(ios, current),
+ isAndroid: isOS(android, current),
+ isOSX: isOS(osx, current),
+ isLinux: isOS(linux, current),
+ isSolaris: isOS(solaris, current),
+ isFreeBSD: isOS(freebsd, current)
</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 detectOs = function (oses, userAgent) {
- return detect$1(oses, userAgent).map(function (os) {
- var version = $_bhlk9t1b2jjgwekaq.detect(os.versionRegexes, userAgent);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var OperatingSystem = {
+ unknown: unknown$2,
+ nu: nu$2,
+ windows: constant(windows$1),
+ ios: constant(ios),
+ android: constant(android),
+ linux: constant(linux),
+ osx: constant(osx),
+ solaris: constant(solaris),
+ freebsd: constant(freebsd)
+ };
+
+ var DeviceType = function (os, browser, userAgent) {
+ var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true;
+ var isiPhone = os.isiOS() && !isiPad;
+ var isAndroid3 = os.isAndroid() && os.version.major === 3;
+ var isAndroid4 = os.isAndroid() && os.version.major === 4;
+ var isTablet = isiPad || isAndroid3 || isAndroid4 && /mobile/i.test(userAgent) === true;
+ var isTouch = os.isiOS() || os.isAndroid();
+ var isPhone = isTouch && !isTablet;
+ var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false;
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- current: os.name,
- version: version
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ isiPad: constant(isiPad),
+ isiPhone: constant(isiPhone),
+ isTablet: constant(isTablet),
+ isPhone: constant(isPhone),
+ isTouch: constant(isTouch),
+ isAndroid: os.isAndroid,
+ isiOS: os.isiOS,
+ isWebView: constant(iOSwebview)
</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 $_1uo66k1b5jjgwekb9 = {
- detectBrowser: detectBrowser,
- detectOs: detectOs
- };
</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">- var contains$1 = function (str, substr) {
- return str.indexOf(substr) !== -1;
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var detect$1 = function (candidates, userAgent) {
+ var agent = String(userAgent).toLowerCase();
+ return find(candidates, function (candidate) {
+ return candidate.search(agent);
+ });
+ };
+ var detectBrowser = function (browsers, userAgent) {
+ return detect$1(browsers, userAgent).map(function (browser) {
+ var version = Version.detect(browser.versionRegexes, userAgent);
+ return {
+ current: browser.name,
+ version: version
+ };
+ });
+ };
+ var detectOs = function (oses, userAgent) {
+ return detect$1(oses, userAgent).map(function (os) {
+ var version = Version.detect(os.versionRegexes, userAgent);
+ return {
+ current: os.name,
+ version: version
+ };
+ });
+ };
+ var UaString = {
+ detectBrowser: detectBrowser,
+ detectOs: detectOs
+ };
</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 normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/;
- var checkContains = function (target) {
- return function (uastring) {
- return contains$1(uastring, target);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var contains$1 = function (str, substr) {
+ return str.indexOf(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">- };
- var browsers = [
- {
- name: 'Edge',
- versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
- search: function (uastring) {
- var monstrosity = contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit');
- return monstrosity;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/;
+ var checkContains = function (target) {
+ return function (uastring) {
+ return contains$1(uastring, target);
+ };
+ };
+ var browsers = [
+ {
+ name: 'Edge',
+ versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
+ search: function (uastring) {
+ var monstrosity = contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit');
+ return monstrosity;
+ }
+ },
+ {
+ name: 'Chrome',
+ versionRegexes: [
+ /.*?chrome\/([0-9]+)\.([0-9]+).*/,
+ normalVersionRegex
+ ],
+ search: function (uastring) {
+ return contains$1(uastring, 'chrome') && !contains$1(uastring, 'chromeframe');
+ }
+ },
+ {
+ name: 'IE',
+ versionRegexes: [
+ /.*?msie\ ?([0-9]+)\.([0-9]+).*/,
+ /.*?rv:([0-9]+)\.([0-9]+).*/
+ ],
+ search: function (uastring) {
+ return contains$1(uastring, 'msie') || contains$1(uastring, 'trident');
+ }
+ },
+ {
+ name: 'Opera',
+ versionRegexes: [
+ normalVersionRegex,
+ /.*?opera\/([0-9]+)\.([0-9]+).*/
+ ],
+ search: checkContains('opera')
+ },
+ {
+ name: 'Firefox',
+ versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],
+ search: checkContains('firefox')
+ },
+ {
+ name: 'Safari',
+ versionRegexes: [
+ normalVersionRegex,
+ /.*?cpu os ([0-9]+)_([0-9]+).*/
+ ],
+ search: function (uastring) {
+ return (contains$1(uastring, 'safari') || contains$1(uastring, 'mobile/')) && contains$1(uastring, 'applewebkit');
+ }
</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: 'Chrome',
- versionRegexes: [
- /.*?chrome\/([0-9]+)\.([0-9]+).*/,
- normalVersionRegex
- ],
- search: function (uastring) {
- return contains$1(uastring, 'chrome') && !contains$1(uastring, 'chromeframe');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ];
+ var oses = [
+ {
+ name: 'Windows',
+ search: checkContains('win'),
+ versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]
+ },
+ {
+ name: 'iOS',
+ search: function (uastring) {
+ return contains$1(uastring, 'iphone') || contains$1(uastring, 'ipad');
+ },
+ versionRegexes: [
+ /.*?version\/\ ?([0-9]+)\.([0-9]+).*/,
+ /.*cpu os ([0-9]+)_([0-9]+).*/,
+ /.*cpu iphone os ([0-9]+)_([0-9]+).*/
+ ]
+ },
+ {
+ name: 'Android',
+ search: checkContains('android'),
+ versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/]
+ },
+ {
+ name: 'OSX',
+ search: checkContains('os x'),
+ versionRegexes: [/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]
+ },
+ {
+ name: 'Linux',
+ search: checkContains('linux'),
+ versionRegexes: []
+ },
+ {
+ name: 'Solaris',
+ search: checkContains('sunos'),
+ versionRegexes: []
+ },
+ {
+ name: 'FreeBSD',
+ search: checkContains('freebsd'),
+ versionRegexes: []
</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: 'IE',
- versionRegexes: [
- /.*?msie\ ?([0-9]+)\.([0-9]+).*/,
- /.*?rv:([0-9]+)\.([0-9]+).*/
- ],
- search: function (uastring) {
- return contains$1(uastring, 'msie') || contains$1(uastring, 'trident');
- }
- },
- {
- name: 'Opera',
- versionRegexes: [
- normalVersionRegex,
- /.*?opera\/([0-9]+)\.([0-9]+).*/
- ],
- search: checkContains('opera')
- },
- {
- name: 'Firefox',
- versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],
- search: checkContains('firefox')
- },
- {
- name: 'Safari',
- versionRegexes: [
- normalVersionRegex,
- /.*?cpu os ([0-9]+)_([0-9]+).*/
- ],
- search: function (uastring) {
- return (contains$1(uastring, 'safari') || contains$1(uastring, 'mobile/')) && contains$1(uastring, 'applewebkit');
- }
- }
- ];
- var oses = [
- {
- name: 'Windows',
- search: checkContains('win'),
- versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]
- },
- {
- name: 'iOS',
- search: function (uastring) {
- return contains$1(uastring, 'iphone') || contains$1(uastring, 'ipad');
- },
- versionRegexes: [
- /.*?version\/\ ?([0-9]+)\.([0-9]+).*/,
- /.*cpu os ([0-9]+)_([0-9]+).*/,
- /.*cpu iphone os ([0-9]+)_([0-9]+).*/
- ]
- },
- {
- name: 'Android',
- search: checkContains('android'),
- versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/]
- },
- {
- name: 'OSX',
- search: checkContains('os x'),
- versionRegexes: [/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]
- },
- {
- name: 'Linux',
- search: checkContains('linux'),
- versionRegexes: []
- },
- {
- name: 'Solaris',
- search: checkContains('sunos'),
- versionRegexes: []
- },
- {
- name: 'FreeBSD',
- search: checkContains('freebsd'),
- versionRegexes: []
- }
- ];
- var $_4f7v971b6jjgwekbd = {
- browsers: constant(browsers),
- oses: constant(oses)
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ];
+ var PlatformInfo = {
+ browsers: constant(browsers),
+ oses: constant(oses)
+ };
</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 detect$2 = function (userAgent) {
- var browsers = $_4f7v971b6jjgwekbd.browsers();
- var oses = $_4f7v971b6jjgwekbd.oses();
- var browser = $_1uo66k1b5jjgwekb9.detectBrowser(browsers, userAgent).fold($_3j4jht1b1jjgwekal.unknown, $_3j4jht1b1jjgwekal.nu);
- var os = $_1uo66k1b5jjgwekb9.detectOs(oses, userAgent).fold($_7je60a1b3jjgwekar.unknown, $_7je60a1b3jjgwekar.nu);
- var deviceType = DeviceType(os, browser, userAgent);
- return {
- browser: browser,
- os: os,
- deviceType: deviceType
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var detect$2 = function (userAgent) {
+ var browsers = PlatformInfo.browsers();
+ var oses = PlatformInfo.oses();
+ var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu);
+ var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu);
+ var deviceType = DeviceType(os, browser, userAgent);
+ return {
+ browser: browser,
+ os: os,
+ deviceType: deviceType
+ };
</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 $_d71emz1b0jjgwekak = { detect: detect$2 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var PlatformDetection = { detect: detect$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">- var detect$3 = cached(function () {
- var userAgent = navigator.userAgent;
- return $_d71emz1b0jjgwekak.detect(userAgent);
- });
- var $_9xrxmy1azjjgwekac = { detect: detect$3 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var detect$3 = cached(function () {
+ var userAgent = navigator.userAgent;
+ return PlatformDetection.detect(userAgent);
+ });
+ var PlatformDetection$1 = { detect: detect$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 ELEMENT = $_2jrgnk1apjjgwek8y.ELEMENT;
- var DOCUMENT = $_2jrgnk1apjjgwek8y.DOCUMENT;
- var is = function (element, selector) {
- var elem = element.dom();
- if (elem.nodeType !== ELEMENT)
- return false;
- else if (elem.matches !== undefined)
- return elem.matches(selector);
- else if (elem.msMatchesSelector !== undefined)
- return elem.msMatchesSelector(selector);
- else if (elem.webkitMatchesSelector !== undefined)
- return elem.webkitMatchesSelector(selector);
- else if (elem.mozMatchesSelector !== undefined)
- return elem.mozMatchesSelector(selector);
- else
- throw new Error('Browser lacks native selectors');
- };
- var bypassSelector = function (dom) {
- return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT || dom.childElementCount === 0;
- };
- var all = function (selector, scope) {
- var base = scope === undefined ? document : scope.dom();
- return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), Element$$1.fromDom);
- };
- var one = function (selector, scope) {
- var base = scope === undefined ? document : scope.dom();
- return bypassSelector(base) ? Option.none() : Option.from(base.querySelector(selector)).map(Element$$1.fromDom);
- };
- var $_e63uk51bajjgwekbq = {
- all: all,
- is: is,
- one: one
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ELEMENT$1 = ELEMENT;
+ var DOCUMENT$1 = DOCUMENT;
+ var bypassSelector = function (dom) {
+ return dom.nodeType !== ELEMENT$1 && dom.nodeType !== DOCUMENT$1 || dom.childElementCount === 0;
+ };
+ var all = function (selector, scope) {
+ var base = scope === undefined ? document : scope.dom();
+ return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), Element$$1.fromDom);
+ };
+ var one = function (selector, scope) {
+ var base = scope === undefined ? document : scope.dom();
+ return bypassSelector(base) ? Option.none() : Option.from(base.querySelector(selector)).map(Element$$1.fromDom);
+ };
</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 eq = function (e1, e2) {
- return e1.dom() === e2.dom();
- };
- var isEqualNode = function (e1, e2) {
- return e1.dom().isEqualNode(e2.dom());
- };
- var member = function (element, elements) {
- return exists(elements, curry(eq, element));
- };
- var regularContains = function (e1, e2) {
- var d1 = e1.dom(), d2 = e2.dom();
- return d1 === d2 ? false : d1.contains(d2);
- };
- var ieContains = function (e1, e2) {
- return $_d0o64o1ayjjgwekaa.documentPositionContainedBy(e1.dom(), e2.dom());
- };
- var browser = $_9xrxmy1azjjgwekac.detect().browser;
- var contains$2 = browser.isIE() ? ieContains : regularContains;
- var $_36s5ie1axjjgweka1 = {
- eq: eq,
- isEqualNode: isEqualNode,
- member: member,
- contains: contains$2,
- is: $_e63uk51bajjgwekbq.is
- };
-
- var owner = function (element) {
- return Element$$1.fromDom(element.dom().ownerDocument);
- };
- var documentElement = function (element) {
- return Element$$1.fromDom(element.dom().ownerDocument.documentElement);
- };
- var defaultView = function (element) {
- var el = element.dom();
- var defaultView = el.ownerDocument.defaultView;
- return Element$$1.fromDom(defaultView);
- };
- var parent$1 = function (element) {
- var dom = element.dom();
- return Option.from(dom.parentNode).map(Element$$1.fromDom);
- };
- var findIndex$1 = function (element) {
- return parent$1(element).bind(function (p) {
- var kin = children(p);
- return findIndex(kin, function (elem) {
- return $_36s5ie1axjjgweka1.eq(element, elem);
- });
- });
- };
- var parents = function (element, isRoot) {
- var stop = isFunction$1(isRoot) ? isRoot : constant(false);
- var dom = element.dom();
- var ret = [];
- while (dom.parentNode !== null && dom.parentNode !== undefined) {
- var rawParent = dom.parentNode;
- var parent = Element$$1.fromDom(rawParent);
- ret.push(parent);
- if (stop(parent) === true)
- break;
- else
- dom = rawParent;
- }
- return ret;
- };
- var siblings = function (element) {
- var filterSelf = function (elements) {
- return filter(elements, function (x) {
- return !$_36s5ie1axjjgweka1.eq(element, x);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var regularContains = function (e1, e2) {
+ var d1 = e1.dom(), d2 = e2.dom();
+ return d1 === d2 ? false : d1.contains(d2);
</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 parent$1(element).map(children).map(filterSelf).getOr([]);
- };
- var offsetParent = function (element) {
- var dom = element.dom();
- return Option.from(dom.offsetParent).map(Element$$1.fromDom);
- };
- var prevSibling = function (element) {
- var dom = element.dom();
- return Option.from(dom.previousSibling).map(Element$$1.fromDom);
- };
- var nextSibling = function (element) {
- var dom = element.dom();
- return Option.from(dom.nextSibling).map(Element$$1.fromDom);
- };
- var prevSiblings = function (element) {
- return reverse($_607sf01awjjgweka0.toArray(element, prevSibling));
- };
- var nextSiblings = function (element) {
- return $_607sf01awjjgweka0.toArray(element, nextSibling);
- };
- var children = function (element) {
- var dom = element.dom();
- return map(dom.childNodes, Element$$1.fromDom);
- };
- var child = function (element, index) {
- var children = element.dom().childNodes;
- return Option.from(children[index]).map(Element$$1.fromDom);
- };
- var firstChild = function (element) {
- return child(element, 0);
- };
- var lastChild = function (element) {
- return child(element, element.dom().childNodes.length - 1);
- };
- var childNodesCount = function (element) {
- return element.dom().childNodes.length;
- };
- var hasChildNodes = function (element) {
- return element.dom().hasChildNodes();
- };
- var spot = Immutable('element', 'offset');
- var leaf = function (element, offset) {
- var cs = children(element);
- return cs.length > 0 && offset < cs.length ? spot(cs[offset], 0) : spot(element, offset);
- };
- var $_fk3hdw1aqjjgwek91 = {
- owner: owner,
- defaultView: defaultView,
- documentElement: documentElement,
- parent: parent$1,
- findIndex: findIndex$1,
- parents: parents,
- siblings: siblings,
- prevSibling: prevSibling,
- offsetParent: offsetParent,
- prevSiblings: prevSiblings,
- nextSibling: nextSibling,
- nextSiblings: nextSiblings,
- children: children,
- child: child,
- firstChild: firstChild,
- lastChild: lastChild,
- childNodesCount: childNodesCount,
- hasChildNodes: hasChildNodes,
- leaf: leaf
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ieContains = function (e1, e2) {
+ return Node$1.documentPositionContainedBy(e1.dom(), e2.dom());
+ };
+ var browser = PlatformDetection$1.detect().browser;
+ var contains$2 = browser.isIE() ? ieContains : regularContains;
</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 all$1 = function (predicate) {
- return descendants($_d2glpe1amjjgwek8t.body(), predicate);
- };
- var ancestors = function (scope, predicate, isRoot) {
- return filter($_fk3hdw1aqjjgwek91.parents(scope, isRoot), predicate);
- };
- var siblings$1 = function (scope, predicate) {
- return filter($_fk3hdw1aqjjgwek91.siblings(scope), predicate);
- };
- var children$1 = function (scope, predicate) {
- return filter($_fk3hdw1aqjjgwek91.children(scope), predicate);
- };
- var descendants = function (scope, predicate) {
- var result = [];
- each($_fk3hdw1aqjjgwek91.children(scope), function (x) {
- if (predicate(x)) {
- result = result.concat([x]);
- }
- result = result.concat(descendants(x, predicate));
- });
- return result;
- };
- var $_4re57m1aljjgwek8p = {
- all: all$1,
- ancestors: ancestors,
- siblings: siblings$1,
- children: children$1,
- descendants: descendants
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var spot = Immutable('element', '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 all$2 = function (selector) {
- return $_e63uk51bajjgwekbq.all(selector);
- };
- var ancestors$1 = function (scope, selector, isRoot) {
- return $_4re57m1aljjgwek8p.ancestors(scope, function (e) {
- return $_e63uk51bajjgwekbq.is(e, selector);
- }, isRoot);
- };
- var siblings$2 = function (scope, selector) {
- return $_4re57m1aljjgwek8p.siblings(scope, function (e) {
- return $_e63uk51bajjgwekbq.is(e, selector);
- });
- };
- var children$2 = function (scope, selector) {
- return $_4re57m1aljjgwek8p.children(scope, function (e) {
- return $_e63uk51bajjgwekbq.is(e, selector);
- });
- };
- var descendants$1 = function (scope, selector) {
- return $_e63uk51bajjgwekbq.all(selector, scope);
- };
- var $_1jc9su1akjjgwek8o = {
- all: all$2,
- ancestors: ancestors$1,
- siblings: siblings$2,
- children: children$2,
- descendants: descendants$1
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var descendants$1 = function (scope, selector) {
+ return all(selector, scope);
+ };
</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 trim$1 = global$4.trim;
- var hasContentEditableState = function (value) {
- return function (node) {
- if (node && node.nodeType === 1) {
- if (node.contentEditable === value) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var trim$1 = global$4.trim;
+ var hasContentEditableState = function (value) {
+ return function (node) {
+ if (node && node.nodeType === 1) {
+ if (node.contentEditable === value) {
+ return true;
+ }
+ if (node.getAttribute('data-mce-contenteditable') === value) {
+ 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 (node.getAttribute('data-mce-contenteditable') === value) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return false;
+ };
+ };
+ var isContentEditableTrue = hasContentEditableState('true');
+ var isContentEditableFalse = hasContentEditableState('false');
+ var create$4 = function (type, title, url, level, attach) {
+ return {
+ type: type,
+ title: title,
+ url: url,
+ level: level,
+ attach: attach
+ };
+ };
+ var isChildOfContentEditableTrue = function (node) {
+ while (node = node.parentNode) {
+ var value = node.contentEditable;
+ if (value && value !== 'inherit') {
+ return isContentEditableTrue(node);
</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"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var isContentEditableTrue = hasContentEditableState('true');
- var isContentEditableFalse = hasContentEditableState('false');
- var create$4 = function (type, title, url, level, attach) {
- return {
- type: type,
- title: title,
- url: url,
- level: level,
- attach: attach
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var select = function (selector, root) {
+ return map(descendants$1(Element$$1.fromDom(root), selector), function (element) {
+ return element.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 isChildOfContentEditableTrue = function (node) {
- while (node = node.parentNode) {
- var value = node.contentEditable;
- if (value && value !== 'inherit') {
- return isContentEditableTrue(node);
- }
- }
- return false;
- };
- var select = function (selector, root) {
- return map($_1jc9su1akjjgwek8o.descendants(Element$$1.fromDom(root), selector), function (element) {
- return element.dom();
- });
- };
- var getElementText = function (elm) {
- return elm.innerText || elm.textContent;
- };
- var getOrGenerateId = function (elm) {
- return elm.id ? elm.id : generate('h');
- };
- var isAnchor = function (elm) {
- return elm && elm.nodeName === 'A' && (elm.id || elm.name);
- };
- var isValidAnchor = function (elm) {
- return isAnchor(elm) && isEditable(elm);
- };
- var isHeader = function (elm) {
- return elm && /^(H[1-6])$/.test(elm.nodeName);
- };
- var isEditable = function (elm) {
- return isChildOfContentEditableTrue(elm) && !isContentEditableFalse(elm);
- };
- var isValidHeader = function (elm) {
- return isHeader(elm) && isEditable(elm);
- };
- var getLevel = function (elm) {
- return isHeader(elm) ? parseInt(elm.nodeName.substr(1), 10) : 0;
- };
- var headerTarget = function (elm) {
- var headerId = getOrGenerateId(elm);
- var attach = function () {
- elm.id = headerId;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getElementText = function (elm) {
+ return elm.innerText || elm.textContent;
</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 create$4('header', getElementText(elm), '#' + headerId, getLevel(elm), attach);
- };
- var anchorTarget = function (elm) {
- var anchorId = elm.id || elm.name;
- var anchorText = getElementText(elm);
- return create$4('anchor', anchorText ? anchorText : '#' + anchorId, '#' + anchorId, 0, noop);
- };
- var getHeaderTargets = function (elms) {
- return map(filter(elms, isValidHeader), headerTarget);
- };
- var getAnchorTargets = function (elms) {
- return map(filter(elms, isValidAnchor), anchorTarget);
- };
- var getTargetElements = function (elm) {
- var elms = select('h1,h2,h3,h4,h5,h6,a:not([href])', elm);
- return elms;
- };
- var hasTitle = function (target) {
- return trim$1(target.title).length > 0;
- };
- var find$3 = function (elm) {
- var elms = getTargetElements(elm);
- return filter(getHeaderTargets(elms).concat(getAnchorTargets(elms)), hasTitle);
- };
- var $_5ia43q1ahjjgwek7u = { find: find$3 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getOrGenerateId = function (elm) {
+ return elm.id ? elm.id : generate('h');
+ };
+ var isAnchor = function (elm) {
+ return elm && elm.nodeName === 'A' && (elm.id || elm.name);
+ };
+ var isValidAnchor = function (elm) {
+ return isAnchor(elm) && isEditable(elm);
+ };
+ var isHeader = function (elm) {
+ return elm && /^(H[1-6])$/.test(elm.nodeName);
+ };
+ var isEditable = function (elm) {
+ return isChildOfContentEditableTrue(elm) && !isContentEditableFalse(elm);
+ };
+ var isValidHeader = function (elm) {
+ return isHeader(elm) && isEditable(elm);
+ };
+ var getLevel = function (elm) {
+ return isHeader(elm) ? parseInt(elm.nodeName.substr(1), 10) : 0;
+ };
+ var headerTarget = function (elm) {
+ var headerId = getOrGenerateId(elm);
+ var attach = function () {
+ elm.id = headerId;
+ };
+ return create$4('header', getElementText(elm), '#' + headerId, getLevel(elm), attach);
+ };
+ var anchorTarget = function (elm) {
+ var anchorId = elm.id || elm.name;
+ var anchorText = getElementText(elm);
+ return create$4('anchor', anchorText ? anchorText : '#' + anchorId, '#' + anchorId, 0, noop);
+ };
+ var getHeaderTargets = function (elms) {
+ return map(filter(elms, isValidHeader), headerTarget);
+ };
+ var getAnchorTargets = function (elms) {
+ return map(filter(elms, isValidAnchor), anchorTarget);
+ };
+ var getTargetElements = function (elm) {
+ var elms = select('h1,h2,h3,h4,h5,h6,a:not([href])', elm);
+ return elms;
+ };
+ var hasTitle = function (target) {
+ return trim$1(target.title).length > 0;
+ };
+ var find$3 = function (elm) {
+ var elms = getTargetElements(elm);
+ return filter(getHeaderTargets(elms).concat(getAnchorTargets(elms)), hasTitle);
+ };
+ var LinkTargets = { find: find$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 getActiveEditor = function () {
- return window.tinymce ? window.tinymce.activeEditor : global$5.activeEditor;
- };
- var history = {};
- var HISTORY_LENGTH = 5;
- var clearHistory = function () {
- history = {};
- };
- var toMenuItem = function (target) {
- return {
- title: target.title,
- value: {
- title: { raw: target.title },
- url: target.url,
- attach: target.attach
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getActiveEditor = function () {
+ return window.tinymce ? window.tinymce.activeEditor : global$5.activeEditor;
</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 toMenuItems = function (targets) {
- return global$4.map(targets, toMenuItem);
- };
- var staticMenuItem = function (title, url) {
- return {
- title: title,
- value: {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var history = {};
+ var HISTORY_LENGTH = 5;
+ var clearHistory = function () {
+ history = {};
+ };
+ var toMenuItem = function (target) {
+ return {
+ title: target.title,
+ value: {
+ title: { raw: target.title },
+ url: target.url,
+ attach: target.attach
+ }
+ };
+ };
+ var toMenuItems = function (targets) {
+ return global$4.map(targets, toMenuItem);
+ };
+ var staticMenuItem = function (title, url) {
+ return {
</ins><span class="cx" style="display: block; padding: 0 10px"> title: title,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- url: url,
- attach: noop
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ value: {
+ title: title,
+ url: url,
+ attach: 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">- };
- var isUniqueUrl = function (url, targets) {
- var foundTarget = exists(targets, function (target) {
- return target.url === url;
- });
- return !foundTarget;
- };
- var getSetting = function (editorSettings, name, defaultValue) {
- var value = name in editorSettings ? editorSettings[name] : defaultValue;
- return value === false ? null : value;
- };
- var createMenuItems = function (term, targets, fileType, editorSettings) {
- var separator = { title: '-' };
- var fromHistoryMenuItems = function (history) {
- var historyItems = history.hasOwnProperty(fileType) ? history[fileType] : [];
- var uniqueHistory = filter(historyItems, function (url) {
- return isUniqueUrl(url, targets);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isUniqueUrl = function (url, targets) {
+ var foundTarget = exists(targets, function (target) {
+ return target.url === 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">- return global$4.map(uniqueHistory, function (url) {
- return {
- title: url,
- value: {
- title: url,
- url: url,
- attach: noop
- }
- };
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return !foundTarget;
</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 fromMenuItems = function (type) {
- var filteredTargets = filter(targets, function (target) {
- return target.type === type;
- });
- return toMenuItems(filteredTargets);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getSetting = function (editorSettings, name, defaultValue) {
+ var value = name in editorSettings ? editorSettings[name] : defaultValue;
+ return value === false ? null : 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 anchorMenuItems = function () {
- var anchorMenuItems = fromMenuItems('anchor');
- var topAnchor = getSetting(editorSettings, 'anchor_top', '#top');
- var bottomAchor = getSetting(editorSettings, 'anchor_bottom', '#bottom');
- if (topAnchor !== null) {
- anchorMenuItems.unshift(staticMenuItem('<top>', topAnchor));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createMenuItems = function (term, targets, fileType, editorSettings) {
+ var separator = { title: '-' };
+ var fromHistoryMenuItems = function (history) {
+ var historyItems = history.hasOwnProperty(fileType) ? history[fileType] : [];
+ var uniqueHistory = filter(historyItems, function (url) {
+ return isUniqueUrl(url, targets);
+ });
+ return global$4.map(uniqueHistory, function (url) {
+ return {
+ title: url,
+ value: {
+ title: url,
+ url: url,
+ attach: noop
+ }
+ };
+ });
+ };
+ var fromMenuItems = function (type) {
+ var filteredTargets = filter(targets, function (target) {
+ return target.type === type;
+ });
+ return toMenuItems(filteredTargets);
+ };
+ var anchorMenuItems = function () {
+ var anchorMenuItems = fromMenuItems('anchor');
+ var topAnchor = getSetting(editorSettings, 'anchor_top', '#top');
+ var bottomAchor = getSetting(editorSettings, 'anchor_bottom', '#bottom');
+ if (topAnchor !== null) {
+ anchorMenuItems.unshift(staticMenuItem('<top>', topAnchor));
+ }
+ if (bottomAchor !== null) {
+ anchorMenuItems.push(staticMenuItem('<bottom>', bottomAchor));
+ }
+ return anchorMenuItems;
+ };
+ var join = function (items) {
+ return foldl(items, function (a, b) {
+ var bothEmpty = a.length === 0 || b.length === 0;
+ return bothEmpty ? a.concat(b) : a.concat(separator, b);
+ }, []);
+ };
+ if (editorSettings.typeahead_urls === 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">- if (bottomAchor !== null) {
- anchorMenuItems.push(staticMenuItem('<bottom>', bottomAchor));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return fileType === 'file' ? join([
+ filterByQuery(term, fromHistoryMenuItems(history)),
+ filterByQuery(term, fromMenuItems('header')),
+ filterByQuery(term, anchorMenuItems())
+ ]) : filterByQuery(term, fromHistoryMenuItems(history));
+ };
+ var addToHistory = function (url, fileType) {
+ var items = history[fileType];
+ if (!/^https?/.test(url)) {
+ 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 anchorMenuItems;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (items) {
+ if (indexOf(items, url).isNone()) {
+ history[fileType] = items.slice(0, HISTORY_LENGTH).concat(url);
+ }
+ } else {
+ history[fileType] = [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">- var join = function (items) {
- return foldl(items, function (a, b) {
- var bothEmpty = a.length === 0 || b.length === 0;
- return bothEmpty ? a.concat(b) : a.concat(separator, b);
- }, []);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var filterByQuery = function (term, menuItems) {
+ var lowerCaseTerm = term.toLowerCase();
+ var result = global$4.grep(menuItems, function (item) {
+ return item.title.toLowerCase().indexOf(lowerCaseTerm) !== -1;
+ });
+ return result.length === 1 && result[0].title === term ? [] : result;
</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 (editorSettings.typeahead_urls === false) {
- return [];
- }
- return fileType === 'file' ? join([
- filterByQuery(term, fromHistoryMenuItems(history)),
- filterByQuery(term, fromMenuItems('header')),
- filterByQuery(term, anchorMenuItems())
- ]) : filterByQuery(term, fromHistoryMenuItems(history));
- };
- var addToHistory = function (url, fileType) {
- var items = history[fileType];
- if (!/^https?/.test(url)) {
- return;
- }
- if (items) {
- if (indexOf(items, url).isNone()) {
- history[fileType] = items.slice(0, HISTORY_LENGTH).concat(url);
- }
- } else {
- history[fileType] = [url];
- }
- };
- var filterByQuery = function (term, menuItems) {
- var lowerCaseTerm = term.toLowerCase();
- var result = global$4.grep(menuItems, function (item) {
- return item.title.toLowerCase().indexOf(lowerCaseTerm) !== -1;
- });
- return result.length === 1 && result[0].title === term ? [] : result;
- };
- var getTitle = function (linkDetails) {
- var title = linkDetails.title;
- return title.raw ? title.raw : title;
- };
- var setupAutoCompleteHandler = function (ctrl, editorSettings, bodyElm, fileType) {
- var autocomplete = function (term) {
- var linkTargets = $_5ia43q1ahjjgwek7u.find(bodyElm);
- var menuItems = createMenuItems(term, linkTargets, fileType, editorSettings);
- ctrl.showAutoComplete(menuItems, term);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getTitle = function (linkDetails) {
+ var title = linkDetails.title;
+ return title.raw ? title.raw : 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">- ctrl.on('autocomplete', function () {
- autocomplete(ctrl.value());
- });
- ctrl.on('selectitem', function (e) {
- var linkDetails = e.value;
- ctrl.value(linkDetails.url);
- var title = getTitle(linkDetails);
- if (fileType === 'image') {
- ctrl.fire('change', {
- meta: {
- alt: title,
- attach: linkDetails.attach
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setupAutoCompleteHandler = function (ctrl, editorSettings, bodyElm, fileType) {
+ var autocomplete = function (term) {
+ var linkTargets = LinkTargets.find(bodyElm);
+ var menuItems = createMenuItems(term, linkTargets, fileType, editorSettings);
+ ctrl.showAutoComplete(menuItems, term);
+ };
+ ctrl.on('autocomplete', function () {
+ autocomplete(ctrl.value());
+ });
+ ctrl.on('selectitem', function (e) {
+ var linkDetails = e.value;
+ ctrl.value(linkDetails.url);
+ var title = getTitle(linkDetails);
+ if (fileType === 'image') {
+ ctrl.fire('change', {
+ meta: {
+ alt: title,
+ attach: linkDetails.attach
+ }
+ });
+ } else {
+ ctrl.fire('change', {
+ meta: {
+ text: title,
+ attach: linkDetails.attach
+ }
+ });
+ }
+ ctrl.focus();
+ });
+ ctrl.on('click', function (e) {
+ if (ctrl.value().length === 0 && e.target.nodeName === 'INPUT') {
+ autocomplete('');
+ }
+ });
+ ctrl.on('PostRender', function () {
+ ctrl.getRoot().on('submit', function (e) {
+ if (!e.isDefaultPrevented()) {
+ addToHistory(ctrl.value(), fileType);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ var statusToUiState = function (result) {
+ var status = result.status, message = result.message;
+ if (status === 'valid') {
+ return {
+ status: 'ok',
+ message: message
+ };
+ } else if (status === 'unknown') {
+ return {
+ status: 'warn',
+ message: message
+ };
+ } else if (status === 'invalid') {
+ return {
+ status: 'warn',
+ message: message
+ };
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ctrl.fire('change', {
- meta: {
- text: title,
- attach: linkDetails.attach
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return {
+ status: 'none',
+ message: ''
+ };
+ }
+ };
+ var setupLinkValidatorHandler = function (ctrl, editorSettings, fileType) {
+ var validatorHandler = editorSettings.filepicker_validator_handler;
+ if (validatorHandler) {
+ var validateUrl_1 = function (url) {
+ if (url.length === 0) {
+ ctrl.statusLevel('none');
+ return;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ validatorHandler({
+ url: url,
+ type: fileType
+ }, function (result) {
+ var uiState = statusToUiState(result);
+ ctrl.statusMessage(uiState.message);
+ ctrl.statusLevel(uiState.status);
+ });
+ };
+ ctrl.state.on('change:value', function (e) {
+ validateUrl_1(e.value);
</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">- ctrl.focus();
- });
- ctrl.on('click', function (e) {
- if (ctrl.value().length === 0 && e.target.nodeName === 'INPUT') {
- autocomplete('');
- }
- });
- ctrl.on('PostRender', function () {
- ctrl.getRoot().on('submit', function (e) {
- if (!e.isDefaultPrevented()) {
- addToHistory(ctrl.value(), fileType);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var FilePicker = ComboBox.extend({
+ Statics: { clearHistory: clearHistory },
+ init: function (settings) {
+ var self = this, editor = getActiveEditor(), editorSettings = editor.settings;
+ var actionCallback, fileBrowserCallback, fileBrowserCallbackTypes;
+ var fileType = settings.filetype;
+ settings.spellcheck = false;
+ fileBrowserCallbackTypes = editorSettings.file_picker_types || editorSettings.file_browser_callback_types;
+ if (fileBrowserCallbackTypes) {
+ fileBrowserCallbackTypes = global$4.makeMap(fileBrowserCallbackTypes, /[, ]/);
</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 statusToUiState = function (result) {
- var status = result.status, message = result.message;
- if (status === 'valid') {
- return {
- status: 'ok',
- message: message
- };
- } else if (status === 'unknown') {
- return {
- status: 'warn',
- message: message
- };
- } else if (status === 'invalid') {
- return {
- status: 'warn',
- message: message
- };
- } else {
- return {
- status: 'none',
- message: ''
- };
- }
- };
- var setupLinkValidatorHandler = function (ctrl, editorSettings, fileType) {
- var validatorHandler = editorSettings.filepicker_validator_handler;
- if (validatorHandler) {
- var validateUrl_1 = function (url) {
- if (url.length === 0) {
- ctrl.statusLevel('none');
- return;
- }
- validatorHandler({
- url: url,
- type: fileType
- }, function (result) {
- var uiState = statusToUiState(result);
- ctrl.statusMessage(uiState.message);
- ctrl.statusLevel(uiState.status);
- });
- };
- ctrl.state.on('change:value', function (e) {
- validateUrl_1(e.value);
- });
- }
- };
- var FilePicker = ComboBox.extend({
- Statics: { clearHistory: clearHistory },
- init: function (settings) {
- var self = this, editor = getActiveEditor(), editorSettings = editor.settings;
- var actionCallback, fileBrowserCallback, fileBrowserCallbackTypes;
- var fileType = settings.filetype;
- settings.spellcheck = false;
- fileBrowserCallbackTypes = editorSettings.file_picker_types || editorSettings.file_browser_callback_types;
- if (fileBrowserCallbackTypes) {
- fileBrowserCallbackTypes = global$4.makeMap(fileBrowserCallbackTypes, /[, ]/);
- }
- if (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[fileType]) {
- fileBrowserCallback = editorSettings.file_picker_callback;
- if (fileBrowserCallback && (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[fileType])) {
- actionCallback = function () {
- var meta = self.fire('beforecall').meta;
- meta = global$4.extend({ filetype: fileType }, meta);
- fileBrowserCallback.call(editor, function (value, meta) {
- self.value(value).fire('change', { meta: meta });
- }, self.value(), meta);
- };
- } else {
- fileBrowserCallback = editorSettings.file_browser_callback;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[fileType]) {
+ fileBrowserCallback = editorSettings.file_picker_callback;
</ins><span class="cx" style="display: block; padding: 0 10px"> if (fileBrowserCallback && (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[fileType])) {
</span><span class="cx" style="display: block; padding: 0 10px"> actionCallback = function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- fileBrowserCallback(self.getEl('inp').id, self.value(), fileType, window);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var meta = self.fire('beforecall').meta;
+ meta = global$4.extend({ filetype: fileType }, meta);
+ fileBrowserCallback.call(editor, function (value, meta) {
+ self.value(value).fire('change', { meta: meta });
+ }, self.value(), meta);
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ fileBrowserCallback = editorSettings.file_browser_callback;
+ if (fileBrowserCallback && (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[fileType])) {
+ actionCallback = function () {
+ fileBrowserCallback(self.getEl('inp').id, self.value(), fileType, window);
+ };
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (actionCallback) {
+ settings.icon = 'browse';
+ settings.onaction = actionCallback;
+ }
+ self._super(settings);
+ self.classes.add('filepicker');
+ setupAutoCompleteHandler(self, editorSettings, editor.getBody(), fileType);
+ setupLinkValidatorHandler(self, editorSettings, fileType);
</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 (actionCallback) {
- settings.icon = 'browse';
- settings.onaction = actionCallback;
- }
- self._super(settings);
- self.classes.add('filepicker');
- setupAutoCompleteHandler(self, editorSettings, editor.getBody(), fileType);
- setupLinkValidatorHandler(self, editorSettings, fileType);
- }
- });
</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">- var FitLayout = AbsoluteLayout.extend({
- recalc: function (container) {
- var contLayoutRect = container.layoutRect(), paddingBox = container.paddingBox;
- container.items().filter(':visible').each(function (ctrl) {
- ctrl.layoutRect({
- x: paddingBox.left,
- y: paddingBox.top,
- w: contLayoutRect.innerW - paddingBox.right - paddingBox.left,
- h: contLayoutRect.innerH - paddingBox.top - paddingBox.bottom
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var FitLayout = AbsoluteLayout.extend({
+ recalc: function (container) {
+ var contLayoutRect = container.layoutRect(), paddingBox = container.paddingBox;
+ container.items().filter(':visible').each(function (ctrl) {
+ ctrl.layoutRect({
+ x: paddingBox.left,
+ y: paddingBox.top,
+ w: contLayoutRect.innerW - paddingBox.right - paddingBox.left,
+ h: contLayoutRect.innerH - paddingBox.top - paddingBox.bottom
+ });
+ if (ctrl.recalc) {
+ ctrl.recalc();
+ }
</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 (ctrl.recalc) {
- ctrl.recalc();
- }
- });
- }
- });
</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">- var FlexLayout = AbsoluteLayout.extend({
- recalc: function (container) {
- var i, l, items, contLayoutRect, contPaddingBox, contSettings, align, pack, spacing, totalFlex, availableSpace, direction;
- var ctrl, ctrlLayoutRect, ctrlSettings, flex;
- var maxSizeItems = [];
- var size, maxSize, ratio, rect, pos, maxAlignEndPos;
- var sizeName, minSizeName, posName, maxSizeName, beforeName, innerSizeName, deltaSizeName, contentSizeName;
- var alignAxisName, alignInnerSizeName, alignSizeName, alignMinSizeName, alignBeforeName, alignAfterName;
- var alignDeltaSizeName, alignContentSizeName;
- var max = Math.max, min = Math.min;
- items = container.items().filter(':visible');
- contLayoutRect = container.layoutRect();
- contPaddingBox = container.paddingBox;
- contSettings = container.settings;
- direction = container.isRtl() ? contSettings.direction || 'row-reversed' : contSettings.direction;
- align = contSettings.align;
- pack = container.isRtl() ? contSettings.pack || 'end' : contSettings.pack;
- spacing = contSettings.spacing || 0;
- if (direction === 'row-reversed' || direction === 'column-reverse') {
- items = items.set(items.toArray().reverse());
- direction = direction.split('-')[0];
- }
- if (direction === 'column') {
- posName = 'y';
- sizeName = 'h';
- minSizeName = 'minH';
- maxSizeName = 'maxH';
- innerSizeName = 'innerH';
- beforeName = 'top';
- deltaSizeName = 'deltaH';
- contentSizeName = 'contentH';
- alignBeforeName = 'left';
- alignSizeName = 'w';
- alignAxisName = 'x';
- alignInnerSizeName = 'innerW';
- alignMinSizeName = 'minW';
- alignAfterName = 'right';
- alignDeltaSizeName = 'deltaW';
- alignContentSizeName = 'contentW';
- } else {
- posName = 'x';
- sizeName = 'w';
- minSizeName = 'minW';
- maxSizeName = 'maxW';
- innerSizeName = 'innerW';
- beforeName = 'left';
- deltaSizeName = 'deltaW';
- contentSizeName = 'contentW';
- alignBeforeName = 'top';
- alignSizeName = 'h';
- alignAxisName = 'y';
- alignInnerSizeName = 'innerH';
- alignMinSizeName = 'minH';
- alignAfterName = 'bottom';
- alignDeltaSizeName = 'deltaH';
- alignContentSizeName = 'contentH';
- }
- availableSpace = contLayoutRect[innerSizeName] - contPaddingBox[beforeName] - contPaddingBox[beforeName];
- maxAlignEndPos = totalFlex = 0;
- for (i = 0, l = items.length; i < l; i++) {
- ctrl = items[i];
- ctrlLayoutRect = ctrl.layoutRect();
- ctrlSettings = ctrl.settings;
- flex = ctrlSettings.flex;
- availableSpace -= i < l - 1 ? spacing : 0;
- if (flex > 0) {
- totalFlex += flex;
- if (ctrlLayoutRect[maxSizeName]) {
- maxSizeItems.push(ctrl);
- }
- ctrlLayoutRect.flex = flex;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var FlexLayout = AbsoluteLayout.extend({
+ recalc: function (container) {
+ var i, l, items, contLayoutRect, contPaddingBox, contSettings, align, pack, spacing, totalFlex, availableSpace, direction;
+ var ctrl, ctrlLayoutRect, ctrlSettings, flex;
+ var maxSizeItems = [];
+ var size, maxSize, ratio, rect, pos, maxAlignEndPos;
+ var sizeName, minSizeName, posName, maxSizeName, beforeName, innerSizeName, deltaSizeName, contentSizeName;
+ var alignAxisName, alignInnerSizeName, alignSizeName, alignMinSizeName, alignBeforeName, alignAfterName;
+ var alignDeltaSizeName, alignContentSizeName;
+ var max = Math.max, min = Math.min;
+ items = container.items().filter(':visible');
+ contLayoutRect = container.layoutRect();
+ contPaddingBox = container.paddingBox;
+ contSettings = container.settings;
+ direction = container.isRtl() ? contSettings.direction || 'row-reversed' : contSettings.direction;
+ align = contSettings.align;
+ pack = container.isRtl() ? contSettings.pack || 'end' : contSettings.pack;
+ spacing = contSettings.spacing || 0;
+ if (direction === 'row-reversed' || direction === 'column-reverse') {
+ items = items.set(items.toArray().reverse());
+ direction = direction.split('-')[0];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- availableSpace -= ctrlLayoutRect[minSizeName];
- size = contPaddingBox[alignBeforeName] + ctrlLayoutRect[alignMinSizeName] + contPaddingBox[alignAfterName];
- if (size > maxAlignEndPos) {
- maxAlignEndPos = size;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (direction === 'column') {
+ posName = 'y';
+ sizeName = 'h';
+ minSizeName = 'minH';
+ maxSizeName = 'maxH';
+ innerSizeName = 'innerH';
+ beforeName = 'top';
+ deltaSizeName = 'deltaH';
+ contentSizeName = 'contentH';
+ alignBeforeName = 'left';
+ alignSizeName = 'w';
+ alignAxisName = 'x';
+ alignInnerSizeName = 'innerW';
+ alignMinSizeName = 'minW';
+ alignAfterName = 'right';
+ alignDeltaSizeName = 'deltaW';
+ alignContentSizeName = 'contentW';
+ } else {
+ posName = 'x';
+ sizeName = 'w';
+ minSizeName = 'minW';
+ maxSizeName = 'maxW';
+ innerSizeName = 'innerW';
+ beforeName = 'left';
+ deltaSizeName = 'deltaW';
+ contentSizeName = 'contentW';
+ alignBeforeName = 'top';
+ alignSizeName = 'h';
+ alignAxisName = 'y';
+ alignInnerSizeName = 'innerH';
+ alignMinSizeName = 'minH';
+ alignAfterName = 'bottom';
+ alignDeltaSizeName = 'deltaH';
+ alignContentSizeName = 'contentH';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- rect = {};
- if (availableSpace < 0) {
- rect[minSizeName] = contLayoutRect[minSizeName] - availableSpace + contLayoutRect[deltaSizeName];
- } else {
- rect[minSizeName] = contLayoutRect[innerSizeName] - availableSpace + contLayoutRect[deltaSizeName];
- }
- rect[alignMinSizeName] = maxAlignEndPos + contLayoutRect[alignDeltaSizeName];
- rect[contentSizeName] = contLayoutRect[innerSizeName] - availableSpace;
- rect[alignContentSizeName] = maxAlignEndPos;
- rect.minW = min(rect.minW, contLayoutRect.maxW);
- rect.minH = min(rect.minH, contLayoutRect.maxH);
- rect.minW = max(rect.minW, contLayoutRect.startMinWidth);
- rect.minH = max(rect.minH, contLayoutRect.startMinHeight);
- if (contLayoutRect.autoResize && (rect.minW !== contLayoutRect.minW || rect.minH !== contLayoutRect.minH)) {
- rect.w = rect.minW;
- rect.h = rect.minH;
- container.layoutRect(rect);
- this.recalc(container);
- if (container._lastRect === null) {
- var parentCtrl = container.parent();
- if (parentCtrl) {
- parentCtrl._lastRect = null;
- parentCtrl.recalc();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ availableSpace = contLayoutRect[innerSizeName] - contPaddingBox[beforeName] - contPaddingBox[beforeName];
+ maxAlignEndPos = totalFlex = 0;
+ for (i = 0, l = items.length; i < l; i++) {
+ ctrl = items[i];
+ ctrlLayoutRect = ctrl.layoutRect();
+ ctrlSettings = ctrl.settings;
+ flex = ctrlSettings.flex;
+ availableSpace -= i < l - 1 ? spacing : 0;
+ if (flex > 0) {
+ totalFlex += flex;
+ if (ctrlLayoutRect[maxSizeName]) {
+ maxSizeItems.push(ctrl);
+ }
+ ctrlLayoutRect.flex = flex;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ availableSpace -= ctrlLayoutRect[minSizeName];
+ size = contPaddingBox[alignBeforeName] + ctrlLayoutRect[alignMinSizeName] + contPaddingBox[alignAfterName];
+ if (size > maxAlignEndPos) {
+ maxAlignEndPos = size;
+ }
</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;
- }
- ratio = availableSpace / totalFlex;
- for (i = 0, l = maxSizeItems.length; i < l; i++) {
- ctrl = maxSizeItems[i];
- ctrlLayoutRect = ctrl.layoutRect();
- maxSize = ctrlLayoutRect[maxSizeName];
- size = ctrlLayoutRect[minSizeName] + ctrlLayoutRect.flex * ratio;
- if (size > maxSize) {
- availableSpace -= ctrlLayoutRect[maxSizeName] - ctrlLayoutRect[minSizeName];
- totalFlex -= ctrlLayoutRect.flex;
- ctrlLayoutRect.flex = 0;
- ctrlLayoutRect.maxFlexSize = maxSize;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rect = {};
+ if (availableSpace < 0) {
+ rect[minSizeName] = contLayoutRect[minSizeName] - availableSpace + contLayoutRect[deltaSizeName];
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ctrlLayoutRect.maxFlexSize = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rect[minSizeName] = contLayoutRect[innerSizeName] - availableSpace + contLayoutRect[deltaSizeName];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- ratio = availableSpace / totalFlex;
- pos = contPaddingBox[beforeName];
- rect = {};
- if (totalFlex === 0) {
- if (pack === 'end') {
- pos = availableSpace + contPaddingBox[beforeName];
- } else if (pack === 'center') {
- pos = Math.round(contLayoutRect[innerSizeName] / 2 - (contLayoutRect[innerSizeName] - availableSpace) / 2) + contPaddingBox[beforeName];
- if (pos < 0) {
- pos = contPaddingBox[beforeName];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rect[alignMinSizeName] = maxAlignEndPos + contLayoutRect[alignDeltaSizeName];
+ rect[contentSizeName] = contLayoutRect[innerSizeName] - availableSpace;
+ rect[alignContentSizeName] = maxAlignEndPos;
+ rect.minW = min(rect.minW, contLayoutRect.maxW);
+ rect.minH = min(rect.minH, contLayoutRect.maxH);
+ rect.minW = max(rect.minW, contLayoutRect.startMinWidth);
+ rect.minH = max(rect.minH, contLayoutRect.startMinHeight);
+ if (contLayoutRect.autoResize && (rect.minW !== contLayoutRect.minW || rect.minH !== contLayoutRect.minH)) {
+ rect.w = rect.minW;
+ rect.h = rect.minH;
+ container.layoutRect(rect);
+ this.recalc(container);
+ if (container._lastRect === null) {
+ var parentCtrl = container.parent();
+ if (parentCtrl) {
+ parentCtrl._lastRect = null;
+ parentCtrl.recalc();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else if (pack === 'justify') {
- pos = contPaddingBox[beforeName];
- spacing = Math.floor(availableSpace / (items.length - 1));
</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">- }
- rect[alignAxisName] = contPaddingBox[alignBeforeName];
- for (i = 0, l = items.length; i < l; i++) {
- ctrl = items[i];
- ctrlLayoutRect = ctrl.layoutRect();
- size = ctrlLayoutRect.maxFlexSize || ctrlLayoutRect[minSizeName];
- if (align === 'center') {
- rect[alignAxisName] = Math.round(contLayoutRect[alignInnerSizeName] / 2 - ctrlLayoutRect[alignSizeName] / 2);
- } else if (align === 'stretch') {
- rect[alignSizeName] = max(ctrlLayoutRect[alignMinSizeName] || 0, contLayoutRect[alignInnerSizeName] - contPaddingBox[alignBeforeName] - contPaddingBox[alignAfterName]);
- rect[alignAxisName] = contPaddingBox[alignBeforeName];
- } else if (align === 'end') {
- rect[alignAxisName] = contLayoutRect[alignInnerSizeName] - ctrlLayoutRect[alignSizeName] - contPaddingBox.top;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ratio = availableSpace / totalFlex;
+ for (i = 0, l = maxSizeItems.length; i < l; i++) {
+ ctrl = maxSizeItems[i];
+ ctrlLayoutRect = ctrl.layoutRect();
+ maxSize = ctrlLayoutRect[maxSizeName];
+ size = ctrlLayoutRect[minSizeName] + ctrlLayoutRect.flex * ratio;
+ if (size > maxSize) {
+ availableSpace -= ctrlLayoutRect[maxSizeName] - ctrlLayoutRect[minSizeName];
+ totalFlex -= ctrlLayoutRect.flex;
+ ctrlLayoutRect.flex = 0;
+ ctrlLayoutRect.maxFlexSize = maxSize;
+ } else {
+ ctrlLayoutRect.maxFlexSize = 0;
+ }
</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 (ctrlLayoutRect.flex > 0) {
- size += ctrlLayoutRect.flex * ratio;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ratio = availableSpace / totalFlex;
+ pos = contPaddingBox[beforeName];
+ rect = {};
+ if (totalFlex === 0) {
+ if (pack === 'end') {
+ pos = availableSpace + contPaddingBox[beforeName];
+ } else if (pack === 'center') {
+ pos = Math.round(contLayoutRect[innerSizeName] / 2 - (contLayoutRect[innerSizeName] - availableSpace) / 2) + contPaddingBox[beforeName];
+ if (pos < 0) {
+ pos = contPaddingBox[beforeName];
+ }
+ } else if (pack === 'justify') {
+ pos = contPaddingBox[beforeName];
+ spacing = Math.floor(availableSpace / (items.length - 1));
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- rect[sizeName] = size;
- rect[posName] = pos;
- ctrl.layoutRect(rect);
- if (ctrl.recalc) {
- ctrl.recalc();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rect[alignAxisName] = contPaddingBox[alignBeforeName];
+ for (i = 0, l = items.length; i < l; i++) {
+ ctrl = items[i];
+ ctrlLayoutRect = ctrl.layoutRect();
+ size = ctrlLayoutRect.maxFlexSize || ctrlLayoutRect[minSizeName];
+ if (align === 'center') {
+ rect[alignAxisName] = Math.round(contLayoutRect[alignInnerSizeName] / 2 - ctrlLayoutRect[alignSizeName] / 2);
+ } else if (align === 'stretch') {
+ rect[alignSizeName] = max(ctrlLayoutRect[alignMinSizeName] || 0, contLayoutRect[alignInnerSizeName] - contPaddingBox[alignBeforeName] - contPaddingBox[alignAfterName]);
+ rect[alignAxisName] = contPaddingBox[alignBeforeName];
+ } else if (align === 'end') {
+ rect[alignAxisName] = contLayoutRect[alignInnerSizeName] - ctrlLayoutRect[alignSizeName] - contPaddingBox.top;
+ }
+ if (ctrlLayoutRect.flex > 0) {
+ size += ctrlLayoutRect.flex * ratio;
+ }
+ rect[sizeName] = size;
+ rect[posName] = pos;
+ ctrl.layoutRect(rect);
+ if (ctrl.recalc) {
+ ctrl.recalc();
+ }
+ pos += size + spacing;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- pos += size + spacing;
</del><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">+ });
</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 FlowLayout = Layout$1.extend({
- Defaults: {
- containerClass: 'flow-layout',
- controlClass: 'flow-layout-item',
- endClass: 'break'
- },
- recalc: function (container) {
- container.items().filter(':visible').each(function (ctrl) {
- if (ctrl.recalc) {
- ctrl.recalc();
- }
- });
- },
- isNative: function () {
- return true;
- }
- });
-
- function ClosestOrAncestor (is, ancestor, scope, a, isRoot) {
- return is(scope, a) ? Option.some(scope) : isFunction$1(isRoot) && isRoot(scope) ? Option.none() : ancestor(scope, a, isRoot);
- }
-
- var first$1 = function (predicate) {
- return descendant($_d2glpe1amjjgwek8t.body(), predicate);
- };
- var ancestor = function (scope, predicate, isRoot) {
- var element = scope.dom();
- var stop = isFunction$1(isRoot) ? isRoot : constant(false);
- while (element.parentNode) {
- element = element.parentNode;
- var el = Element$$1.fromDom(element);
- if (predicate(el))
- return Option.some(el);
- else if (stop(el))
- break;
- }
- return Option.none();
- };
- var closest = function (scope, predicate, isRoot) {
- var is = function (scope) {
- return predicate(scope);
- };
- return ClosestOrAncestor(is, ancestor, scope, predicate, isRoot);
- };
- var sibling = function (scope, predicate) {
- var element = scope.dom();
- if (!element.parentNode)
- return Option.none();
- return child$1(Element$$1.fromDom(element.parentNode), function (x) {
- return !$_36s5ie1axjjgweka1.eq(scope, x) && predicate(x);
- });
- };
- var child$1 = function (scope, predicate) {
- var result = find(scope.dom().childNodes, compose(predicate, Element$$1.fromDom));
- return result.map(Element$$1.fromDom);
- };
- var descendant = function (scope, predicate) {
- var descend = function (node) {
- for (var i = 0; i < node.childNodes.length; i++) {
- if (predicate(Element$$1.fromDom(node.childNodes[i])))
- return Option.some(Element$$1.fromDom(node.childNodes[i]));
- var res = descend(node.childNodes[i]);
- if (res.isSome())
- return res;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var FlowLayout = Layout$1.extend({
+ Defaults: {
+ containerClass: 'flow-layout',
+ controlClass: 'flow-layout-item',
+ endClass: 'break'
+ },
+ recalc: function (container) {
+ container.items().filter(':visible').each(function (ctrl) {
+ if (ctrl.recalc) {
+ ctrl.recalc();
+ }
+ });
+ },
+ isNative: function () {
+ 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 Option.none();
- };
- return descend(scope.dom());
- };
- var $_df9cwz1bgjjgwekcd = {
- first: first$1,
- ancestor: ancestor,
- closest: closest,
- sibling: sibling,
- child: child$1,
- descendant: descendant
- };
-
- var first$2 = function (selector) {
- return $_e63uk51bajjgwekbq.one(selector);
- };
- var ancestor$1 = function (scope, selector, isRoot) {
- return $_df9cwz1bgjjgwekcd.ancestor(scope, function (e) {
- return $_e63uk51bajjgwekbq.is(e, selector);
- }, isRoot);
- };
- var sibling$1 = function (scope, selector) {
- return $_df9cwz1bgjjgwekcd.sibling(scope, function (e) {
- return $_e63uk51bajjgwekbq.is(e, selector);
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var child$2 = function (scope, selector) {
- return $_df9cwz1bgjjgwekcd.child(scope, function (e) {
- return $_e63uk51bajjgwekbq.is(e, selector);
- });
- };
- var descendant$1 = function (scope, selector) {
- return $_e63uk51bajjgwekbq.one(selector, scope);
- };
- var closest$1 = function (scope, selector, isRoot) {
- return ClosestOrAncestor($_e63uk51bajjgwekbq.is, ancestor$1, scope, selector, isRoot);
- };
- var $_6nlstg1bfjjgwekcb = {
- first: first$2,
- ancestor: ancestor$1,
- sibling: sibling$1,
- child: child$2,
- descendant: descendant$1,
- closest: closest$1
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var toggleFormat = function (editor, fmt) {
- return function () {
- editor.execCommand('mceToggleFormat', false, fmt);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var descendant$1 = function (scope, selector) {
+ return one(selector, scope);
</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 addFormatChangedListener = function (editor, name, changed) {
- var handler = function (state) {
- changed(state, name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var toggleFormat = function (editor, fmt) {
+ return function () {
+ editor.execCommand('mceToggleFormat', false, fmt);
+ };
</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.formatter) {
- editor.formatter.formatChanged(name, handler);
- } else {
- editor.on('init', function () {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var addFormatChangedListener = function (editor, name, changed) {
+ var handler = function (state) {
+ changed(state, name);
+ };
+ if (editor.formatter) {
</ins><span class="cx" style="display: block; padding: 0 10px"> editor.formatter.formatChanged(name, handler);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- }
- };
- var postRenderFormatToggle = function (editor, name) {
- return function (e) {
- addFormatChangedListener(editor, name, function (state) {
- e.control.active(state);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ editor.on('init', function () {
+ editor.formatter.formatChanged(name, handler);
+ });
+ }
</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">+ var postRenderFormatToggle = function (editor, name) {
+ return function (e) {
+ addFormatChangedListener(editor, name, function (state) {
+ e.control.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">- var register = function (editor) {
- var alignFormats = [
- 'alignleft',
- 'aligncenter',
- 'alignright',
- 'alignjustify'
- ];
- var defaultAlign = 'alignleft';
- var alignMenuItems = [
- {
- text: 'Left',
- icon: 'alignleft',
- onclick: toggleFormat(editor, 'alignleft')
- },
- {
- text: 'Center',
- icon: 'aligncenter',
- onclick: toggleFormat(editor, 'aligncenter')
- },
- {
- text: 'Right',
- icon: 'alignright',
- onclick: toggleFormat(editor, 'alignright')
- },
- {
- text: 'Justify',
- icon: 'alignjustify',
- onclick: toggleFormat(editor, 'alignjustify')
- }
- ];
- editor.addMenuItem('align', {
- text: 'Align',
- menu: alignMenuItems
- });
- editor.addButton('align', {
- type: 'menubutton',
- icon: defaultAlign,
- menu: alignMenuItems,
- onShowMenu: function (e) {
- var menu = e.control.menu;
- global$4.each(alignFormats, function (formatName, idx) {
- menu.items().eq(idx).each(function (item) {
- return item.active(editor.formatter.match(formatName));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register = function (editor) {
+ var alignFormats = [
+ 'alignleft',
+ 'aligncenter',
+ 'alignright',
+ 'alignjustify'
+ ];
+ var defaultAlign = 'alignleft';
+ var alignMenuItems = [
+ {
+ text: 'Left',
+ icon: 'alignleft',
+ onclick: toggleFormat(editor, 'alignleft')
+ },
+ {
+ text: 'Center',
+ icon: 'aligncenter',
+ onclick: toggleFormat(editor, 'aligncenter')
+ },
+ {
+ text: 'Right',
+ icon: 'alignright',
+ onclick: toggleFormat(editor, 'alignright')
+ },
+ {
+ text: 'Justify',
+ icon: 'alignjustify',
+ onclick: toggleFormat(editor, 'alignjustify')
+ }
+ ];
+ editor.addMenuItem('align', {
+ text: 'Align',
+ menu: alignMenuItems
+ });
+ editor.addButton('align', {
+ type: 'menubutton',
+ icon: defaultAlign,
+ menu: alignMenuItems,
+ onShowMenu: function (e) {
+ var menu = e.control.menu;
+ global$4.each(alignFormats, function (formatName, idx) {
+ menu.items().eq(idx).each(function (item) {
+ return item.active(editor.formatter.match(formatName));
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- },
- onPostRender: function (e) {
- var ctrl = e.control;
- global$4.each(alignFormats, function (formatName, idx) {
- addFormatChangedListener(editor, formatName, function (state) {
- ctrl.icon(defaultAlign);
- if (state) {
- ctrl.icon(formatName);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ onPostRender: function (e) {
+ var ctrl = e.control;
+ global$4.each(alignFormats, function (formatName, idx) {
+ addFormatChangedListener(editor, formatName, function (state) {
+ ctrl.icon(defaultAlign);
+ if (state) {
+ ctrl.icon(formatName);
+ }
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ });
+ global$4.each({
+ alignleft: [
+ 'Align left',
+ 'JustifyLeft'
+ ],
+ aligncenter: [
+ 'Align center',
+ 'JustifyCenter'
+ ],
+ alignright: [
+ 'Align right',
+ 'JustifyRight'
+ ],
+ alignjustify: [
+ 'Justify',
+ 'JustifyFull'
+ ],
+ alignnone: [
+ 'No alignment',
+ 'JustifyNone'
+ ]
+ }, function (item, name) {
+ editor.addButton(name, {
+ active: false,
+ tooltip: item[0],
+ cmd: item[1],
+ onPostRender: postRenderFormatToggle(editor, name)
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- });
- global$4.each({
- alignleft: [
- 'Align left',
- 'JustifyLeft'
- ],
- aligncenter: [
- 'Align center',
- 'JustifyCenter'
- ],
- alignright: [
- 'Align right',
- 'JustifyRight'
- ],
- alignjustify: [
- 'Justify',
- 'JustifyFull'
- ],
- alignnone: [
- 'No alignment',
- 'JustifyNone'
- ]
- }, function (item, name) {
- editor.addButton(name, {
- active: false,
- tooltip: item[0],
- cmd: item[1],
- onPostRender: postRenderFormatToggle(editor, name)
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- };
- var $_7uh4c31bijjgwekcw = { register: register };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var Align = { register: register };
</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 getFirstFont = function (fontFamily) {
- return fontFamily ? fontFamily.split(',')[0] : '';
- };
- var findMatchingValue = function (items, fontFamily) {
- var font = fontFamily ? fontFamily.toLowerCase() : '';
- var value;
- global$4.each(items, function (item) {
- if (item.value.toLowerCase() === font) {
- value = item.value;
- }
- });
- global$4.each(items, function (item) {
- if (!value && getFirstFont(item.value).toLowerCase() === getFirstFont(font).toLowerCase()) {
- value = item.value;
- }
- });
- return value;
- };
- var createFontNameListBoxChangeHandler = function (editor, items) {
- return function () {
- var self = this;
- self.state.set('value', null);
- editor.on('init nodeChange', function (e) {
- var fontFamily = editor.queryCommandValue('FontName');
- var match = findMatchingValue(items, fontFamily);
- self.value(match ? match : null);
- if (!match && fontFamily) {
- self.text(getFirstFont(fontFamily));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getFirstFont = function (fontFamily) {
+ return fontFamily ? fontFamily.split(',')[0] : '';
+ };
+ var findMatchingValue = function (items, fontFamily) {
+ var font = fontFamily ? fontFamily.toLowerCase() : '';
+ var value;
+ global$4.each(items, function (item) {
+ if (item.value.toLowerCase() === font) {
+ value = item.value;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global$4.each(items, function (item) {
+ if (!value && getFirstFont(item.value).toLowerCase() === getFirstFont(font).toLowerCase()) {
+ value = item.value;
+ }
+ });
+ 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">- };
- var createFormats = function (formats) {
- formats = formats.replace(/;$/, '').split(';');
- var i = formats.length;
- while (i--) {
- formats[i] = formats[i].split('=');
- }
- return formats;
- };
- var getFontItems = function (editor) {
- var defaultFontsFormats = 'Andale Mono=andale mono,monospace;' + 'Arial=arial,helvetica,sans-serif;' + 'Arial Black=arial black,sans-serif;' + 'Book Antiqua=book antiqua,palatino,serif;' + 'Comic Sans MS=comic sans ms,sans-serif;' + 'Courier New=courier new,courier,monospace;' + 'Georgia=georgia,palatino,serif;' + 'Helvetica=helvetica,arial,sans-serif;' + 'Impact=impact,sans-serif;' + 'Symbol=symbol;' + 'Tahoma=tahoma,arial,helvetica,sans-serif;' + 'Terminal=terminal,monaco,monospace;' + 'Times New Roman=times new roman,times,serif;' + 'Trebuchet MS=trebuchet ms,geneva,sans-serif;' + 'Verdana=verdana,geneva,sans-serif;' + 'Webdings=webdings;' + 'Wingdings=wingdings,zapf dingbats';
- var fonts = createFormats(editor.settings.font_formats || defaultFontsFormats);
- return global$4.map(fonts, function (font) {
- return {
- text: { raw: font[0] },
- value: font[1],
- textStyle: font[1].indexOf('dings') === -1 ? 'font-family:' + font[1] : ''
- };
- });
- };
- var registerButtons = function (editor) {
- editor.addButton('fontselect', function () {
- var items = getFontItems(editor);
- return {
- type: 'listbox',
- text: 'Font Family',
- tooltip: 'Font Family',
- values: items,
- fixedWidth: true,
- onPostRender: createFontNameListBoxChangeHandler(editor, items),
- onselect: function (e) {
- if (e.control.settings.value) {
- editor.execCommand('FontName', false, e.control.settings.value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createFontNameListBoxChangeHandler = function (editor, items) {
+ return function () {
+ var self = this;
+ self.state.set('value', null);
+ editor.on('init nodeChange', function (e) {
+ var fontFamily = editor.queryCommandValue('FontName');
+ var match = findMatchingValue(items, fontFamily);
+ self.value(match ? match : null);
+ if (!match && fontFamily) {
+ self.text(getFirstFont(fontFamily));
</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">+ });
</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 register$1 = function (editor) {
- registerButtons(editor);
- };
- var $_2g5ce1bkjjgwekcz = { register: register$1 };
-
- var round = function (number, precision) {
- var factor = Math.pow(10, precision);
- return Math.round(number * factor) / factor;
- };
- var toPt = function (fontSize, precision) {
- if (/[0-9.]+px$/.test(fontSize)) {
- return round(parseInt(fontSize, 10) * 72 / 96, precision || 0) + 'pt';
- }
- return fontSize;
- };
- var findMatchingValue$1 = function (items, pt, px) {
- var value;
- global$4.each(items, function (item) {
- if (item.value === px) {
- value = px;
- } else if (item.value === pt) {
- value = pt;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var createFormats = function (formats) {
+ formats = formats.replace(/;$/, '').split(';');
+ var i = formats.length;
+ while (i--) {
+ formats[i] = formats[i].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">- });
- return value;
- };
- var createFontSizeListBoxChangeHandler = function (editor, items) {
- return function () {
- var self = this;
- editor.on('init nodeChange', function (e) {
- var px, pt, precision, match;
- px = editor.queryCommandValue('FontSize');
- if (px) {
- for (precision = 3; !match && precision >= 0; precision--) {
- pt = toPt(px, precision);
- match = findMatchingValue$1(items, pt, px);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return formats;
+ };
+ var getFontItems = function (editor) {
+ var defaultFontsFormats = 'Andale Mono=andale mono,monospace;' + 'Arial=arial,helvetica,sans-serif;' + 'Arial Black=arial black,sans-serif;' + 'Book Antiqua=book antiqua,palatino,serif;' + 'Comic Sans MS=comic sans ms,sans-serif;' + 'Courier New=courier new,courier,monospace;' + 'Georgia=georgia,palatino,serif;' + 'Helvetica=helvetica,arial,sans-serif;' + 'Impact=impact,sans-serif;' + 'Symbol=symbol;' + 'Tahoma=tahoma,arial,helvetica,sans-serif;' + 'Terminal=terminal,monaco,monospace;' + 'Times New Roman=times new roman,times,serif;' + 'Trebuchet MS=trebuchet ms,geneva,sans-serif;' + 'Verdana=verdana,geneva,sans-serif;' + 'Webdings=webdings;' + 'Wingdings=wingdings,zapf dingbats';
+ var fonts = createFormats(editor.settings.font_formats || defaultFontsFormats);
+ return global$4.map(fonts, function (font) {
+ return {
+ text: { raw: font[0] },
+ value: font[1],
+ textStyle: font[1].indexOf('dings') === -1 ? 'font-family:' + font[1] : ''
+ };
+ });
+ };
+ var registerButtons = function (editor) {
+ editor.addButton('fontselect', function () {
+ var items = getFontItems(editor);
+ return {
+ type: 'listbox',
+ text: 'Font Family',
+ tooltip: 'Font Family',
+ values: items,
+ fixedWidth: true,
+ onPostRender: createFontNameListBoxChangeHandler(editor, items),
+ onselect: function (e) {
+ if (e.control.settings.value) {
+ editor.execCommand('FontName', false, e.control.settings.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">- }
- self.value(match ? match : null);
- if (!match) {
- self.text(pt);
- }
</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><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var getFontSizeItems = function (editor) {
- var defaultFontsizeFormats = '8pt 10pt 12pt 14pt 18pt 24pt 36pt';
- var fontsizeFormats = editor.settings.fontsize_formats || defaultFontsizeFormats;
- return global$4.map(fontsizeFormats.split(' '), function (item) {
- var text = item, value = item;
- var values = item.split('=');
- if (values.length > 1) {
- text = values[0];
- value = values[1];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register$1 = function (editor) {
+ registerButtons(editor);
+ };
+ var FontSelect = { register: register$1 };
+
+ var round = function (number, precision) {
+ var factor = Math.pow(10, precision);
+ return Math.round(number * factor) / factor;
+ };
+ var toPt = function (fontSize, precision) {
+ if (/[0-9.]+px$/.test(fontSize)) {
+ return round(parseInt(fontSize, 10) * 72 / 96, precision || 0) + 'pt';
</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 {
- text: text,
- value: value
- };
- });
- };
- var registerButtons$1 = function (editor) {
- editor.addButton('fontsizeselect', function () {
- var items = getFontSizeItems(editor);
- return {
- type: 'listbox',
- text: 'Font Sizes',
- tooltip: 'Font Sizes',
- values: items,
- fixedWidth: true,
- onPostRender: createFontSizeListBoxChangeHandler(editor, items),
- onclick: function (e) {
- if (e.control.settings.value) {
- editor.execCommand('FontSize', false, e.control.settings.value);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return fontSize;
+ };
+ var findMatchingValue$1 = function (items, pt, px) {
+ var value;
+ global$4.each(items, function (item) {
+ if (item.value === px) {
+ value = px;
+ } else if (item.value === pt) {
+ value = pt;
</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 register$2 = function (editor) {
- registerButtons$1(editor);
- };
- var $_b15nsk1bljjgwekd9 = { register: register$2 };
-
- var hideMenuObjects = function (editor, menu) {
- var count = menu.length;
- global$4.each(menu, function (item) {
- if (item.menu) {
- item.hidden = hideMenuObjects(editor, item.menu) === 0;
- }
- var formatName = item.format;
- if (formatName) {
- item.hidden = !editor.formatter.canApply(formatName);
- }
- if (item.hidden) {
- count--;
- }
- });
- return count;
- };
- var hideFormatMenuItems = function (editor, menu) {
- var count = menu.items().length;
- menu.items().each(function (item) {
- if (item.menu) {
- item.visible(hideFormatMenuItems(editor, item.menu) > 0);
- }
- if (!item.menu && item.settings.menu) {
- item.visible(hideMenuObjects(editor, item.settings.menu) > 0);
- }
- var formatName = item.settings.format;
- if (formatName) {
- item.visible(editor.formatter.canApply(formatName));
- }
- if (!item.visible()) {
- count--;
- }
- });
- return count;
- };
- var createFormatMenu = function (editor) {
- var count = 0;
- var newFormats = [];
- var defaultStyleFormats = [
- {
- title: 'Headings',
- items: [
- {
- title: 'Heading 1',
- format: 'h1'
- },
- {
- title: 'Heading 2',
- format: 'h2'
- },
- {
- title: 'Heading 3',
- format: 'h3'
- },
- {
- title: 'Heading 4',
- format: 'h4'
- },
- {
- title: 'Heading 5',
- format: 'h5'
- },
- {
- title: 'Heading 6',
- format: 'h6'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ return value;
+ };
+ var createFontSizeListBoxChangeHandler = function (editor, items) {
+ return function () {
+ var self = this;
+ editor.on('init nodeChange', function (e) {
+ var px, pt, precision, match;
+ px = editor.queryCommandValue('FontSize');
+ if (px) {
+ for (precision = 3; !match && precision >= 0; precision--) {
+ pt = toPt(px, precision);
+ match = findMatchingValue$1(items, pt, 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">- ]
- },
- {
- title: 'Inline',
- items: [
- {
- title: 'Bold',
- icon: 'bold',
- format: 'bold'
- },
- {
- title: 'Italic',
- icon: 'italic',
- format: 'italic'
- },
- {
- title: 'Underline',
- icon: 'underline',
- format: 'underline'
- },
- {
- title: 'Strikethrough',
- icon: 'strikethrough',
- format: 'strikethrough'
- },
- {
- title: 'Superscript',
- icon: 'superscript',
- format: 'superscript'
- },
- {
- title: 'Subscript',
- icon: 'subscript',
- format: 'subscript'
- },
- {
- title: 'Code',
- icon: 'code',
- format: 'code'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.value(match ? match : null);
+ if (!match) {
+ self.text(pt);
</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: 'Blocks',
- items: [
- {
- title: 'Paragraph',
- format: 'p'
- },
- {
- title: 'Blockquote',
- format: 'blockquote'
- },
- {
- title: 'Div',
- format: 'div'
- },
- {
- title: 'Pre',
- format: 'pre'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ };
+ var getFontSizeItems = function (editor) {
+ var defaultFontsizeFormats = '8pt 10pt 12pt 14pt 18pt 24pt 36pt';
+ var fontsizeFormats = editor.settings.fontsize_formats || defaultFontsizeFormats;
+ return global$4.map(fontsizeFormats.split(' '), function (item) {
+ var text = item, value = item;
+ var values = item.split('=');
+ if (values.length > 1) {
+ text = values[0];
+ value = values[1];
+ }
+ return {
+ text: text,
+ value: value
+ };
+ });
+ };
+ var registerButtons$1 = function (editor) {
+ editor.addButton('fontsizeselect', function () {
+ var items = getFontSizeItems(editor);
+ return {
+ type: 'listbox',
+ text: 'Font Sizes',
+ tooltip: 'Font Sizes',
+ values: items,
+ fixedWidth: true,
+ onPostRender: createFontSizeListBoxChangeHandler(editor, items),
+ onclick: function (e) {
+ if (e.control.settings.value) {
+ editor.execCommand('FontSize', false, e.control.settings.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">- ]
- },
- {
- title: 'Alignment',
- items: [
- {
- title: 'Left',
- icon: 'alignleft',
- format: 'alignleft'
- },
- {
- title: 'Center',
- icon: 'aligncenter',
- format: 'aligncenter'
- },
- {
- title: 'Right',
- icon: 'alignright',
- format: 'alignright'
- },
- {
- title: 'Justify',
- icon: 'alignjustify',
- format: 'alignjustify'
- }
- ]
- }
- ];
- var createMenu = function (formats) {
- var menu = [];
- if (!formats) {
- return;
- }
- global$4.each(formats, function (format) {
- var menuItem = {
- text: format.title,
- icon: format.icon
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (format.items) {
- menuItem.menu = createMenu(format.items);
- } else {
- var formatName = format.format || 'custom' + count++;
- if (!format.format) {
- format.name = formatName;
- newFormats.push(format);
- }
- menuItem.format = formatName;
- menuItem.cmd = format.cmd;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ var register$2 = function (editor) {
+ registerButtons$1(editor);
+ };
+ var FontSizeSelect = { register: register$2 };
+
+ var hideMenuObjects = function (editor, menu) {
+ var count = menu.length;
+ global$4.each(menu, function (item) {
+ if (item.menu) {
+ item.hidden = hideMenuObjects(editor, item.menu) === 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">- menu.push(menuItem);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var formatName = item.format;
+ if (formatName) {
+ item.hidden = !editor.formatter.canApply(formatName);
+ }
+ if (item.hidden) {
+ count--;
+ }
</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 menu;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return count;
</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 createStylesMenu = function () {
- var menu;
- if (editor.settings.style_formats_merge) {
- if (editor.settings.style_formats) {
- menu = createMenu(defaultStyleFormats.concat(editor.settings.style_formats));
- } else {
- menu = createMenu(defaultStyleFormats);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hideFormatMenuItems = function (editor, menu) {
+ var count = menu.items().length;
+ menu.items().each(function (item) {
+ if (item.menu) {
+ item.visible(hideFormatMenuItems(editor, item.menu) > 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">- } else {
- menu = createMenu(editor.settings.style_formats || defaultStyleFormats);
- }
- return menu;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!item.menu && item.settings.menu) {
+ item.visible(hideMenuObjects(editor, item.settings.menu) > 0);
+ }
+ var formatName = item.settings.format;
+ if (formatName) {
+ item.visible(editor.formatter.canApply(formatName));
+ }
+ if (!item.visible()) {
+ count--;
+ }
+ });
+ return count;
</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 () {
- global$4.each(newFormats, function (format) {
- editor.formatter.register(format.name, format);
- });
- });
- return {
- type: 'menu',
- items: createStylesMenu(),
- onPostRender: function (e) {
- editor.fire('renderFormatsMenu', { control: e.control });
- },
- itemDefaults: {
- preview: true,
- textStyle: function () {
- if (this.settings.format) {
- return editor.formatter.getCssText(this.settings.format);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createFormatMenu = function (editor) {
+ var count = 0;
+ var newFormats = [];
+ var defaultStyleFormats = [
+ {
+ title: 'Headings',
+ items: [
+ {
+ title: 'Heading 1',
+ format: 'h1'
+ },
+ {
+ title: 'Heading 2',
+ format: 'h2'
+ },
+ {
+ title: 'Heading 3',
+ format: 'h3'
+ },
+ {
+ title: 'Heading 4',
+ format: 'h4'
+ },
+ {
+ title: 'Heading 5',
+ format: 'h5'
+ },
+ {
+ title: 'Heading 6',
+ format: 'h6'
+ }
+ ]
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- onPostRender: function () {
- var self = this;
- self.parent().on('show', function () {
- var formatName, command;
- formatName = self.settings.format;
- if (formatName) {
- self.disabled(!editor.formatter.canApply(formatName));
- self.active(editor.formatter.match(formatName));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ {
+ title: 'Inline',
+ items: [
+ {
+ title: 'Bold',
+ icon: 'bold',
+ format: 'bold'
+ },
+ {
+ title: 'Italic',
+ icon: 'italic',
+ format: 'italic'
+ },
+ {
+ title: 'Underline',
+ icon: 'underline',
+ format: 'underline'
+ },
+ {
+ title: 'Strikethrough',
+ icon: 'strikethrough',
+ format: 'strikethrough'
+ },
+ {
+ title: 'Superscript',
+ icon: 'superscript',
+ format: 'superscript'
+ },
+ {
+ title: 'Subscript',
+ icon: 'subscript',
+ format: 'subscript'
+ },
+ {
+ title: 'Code',
+ icon: 'code',
+ format: 'code'
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- command = self.settings.cmd;
- if (command) {
- self.active(editor.queryCommandState(command));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ]
+ },
+ {
+ title: 'Blocks',
+ items: [
+ {
+ title: 'Paragraph',
+ format: 'p'
+ },
+ {
+ title: 'Blockquote',
+ format: 'blockquote'
+ },
+ {
+ title: 'Div',
+ format: 'div'
+ },
+ {
+ title: 'Pre',
+ format: 'pre'
</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">+ ]
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- onclick: function () {
- if (this.settings.format) {
- toggleFormat(editor, this.settings.format)();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ {
+ title: 'Alignment',
+ items: [
+ {
+ title: 'Left',
+ icon: 'alignleft',
+ format: 'alignleft'
+ },
+ {
+ title: 'Center',
+ icon: 'aligncenter',
+ format: 'aligncenter'
+ },
+ {
+ title: 'Right',
+ icon: 'alignright',
+ format: 'alignright'
+ },
+ {
+ title: 'Justify',
+ icon: 'alignjustify',
+ format: 'alignjustify'
+ }
+ ]
+ }
+ ];
+ var createMenu = function (formats) {
+ var menu = [];
+ if (!formats) {
+ return;
+ }
+ global$4.each(formats, function (format) {
+ var menuItem = {
+ text: format.title,
+ icon: format.icon
+ };
+ if (format.items) {
+ menuItem.menu = createMenu(format.items);
+ } else {
+ var formatName = format.format || 'custom' + count++;
+ if (!format.format) {
+ format.name = formatName;
+ newFormats.push(format);
+ }
+ menuItem.format = formatName;
+ menuItem.cmd = format.cmd;
</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.settings.cmd) {
- editor.execCommand(this.settings.cmd);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ menu.push(menuItem);
+ });
+ return menu;
+ };
+ var createStylesMenu = function () {
+ var menu;
+ if (editor.settings.style_formats_merge) {
+ if (editor.settings.style_formats) {
+ menu = createMenu(defaultStyleFormats.concat(editor.settings.style_formats));
+ } else {
+ menu = createMenu(defaultStyleFormats);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ menu = createMenu(editor.settings.style_formats || defaultStyleFormats);
</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">+ return menu;
+ };
+ editor.on('init', function () {
+ global$4.each(newFormats, function (format) {
+ editor.formatter.register(format.name, format);
+ });
+ });
+ return {
+ type: 'menu',
+ items: createStylesMenu(),
+ onPostRender: function (e) {
+ editor.fire('renderFormatsMenu', { control: e.control });
+ },
+ itemDefaults: {
+ preview: true,
+ textStyle: function () {
+ if (this.settings.format) {
+ return editor.formatter.getCssText(this.settings.format);
+ }
+ },
+ onPostRender: function () {
+ var self = this;
+ self.parent().on('show', function () {
+ var formatName, command;
+ formatName = self.settings.format;
+ if (formatName) {
+ self.disabled(!editor.formatter.canApply(formatName));
+ self.active(editor.formatter.match(formatName));
+ }
+ command = self.settings.cmd;
+ if (command) {
+ self.active(editor.queryCommandState(command));
+ }
+ });
+ },
+ onclick: function () {
+ if (this.settings.format) {
+ toggleFormat(editor, this.settings.format)();
+ }
+ if (this.settings.cmd) {
+ editor.execCommand(this.settings.cmd);
+ }
+ }
+ }
+ };
</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 registerMenuItems = function (editor, formatMenu) {
- editor.addMenuItem('formats', {
- text: 'Formats',
- menu: formatMenu
- });
- };
- var registerButtons$2 = function (editor, formatMenu) {
- editor.addButton('styleselect', {
- type: 'menubutton',
- text: 'Formats',
- menu: formatMenu,
- onShowMenu: function () {
- if (editor.settings.style_formats_autohide) {
- hideFormatMenuItems(editor, this.menu);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var registerMenuItems = function (editor, formatMenu) {
+ editor.addMenuItem('formats', {
+ text: 'Formats',
+ menu: formatMenu
+ });
+ };
+ var registerButtons$2 = function (editor, formatMenu) {
+ editor.addButton('styleselect', {
+ type: 'menubutton',
+ text: 'Formats',
+ menu: formatMenu,
+ onShowMenu: function () {
+ if (editor.settings.style_formats_autohide) {
+ hideFormatMenuItems(editor, this.menu);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ var register$3 = function (editor) {
+ var formatMenu = createFormatMenu(editor);
+ registerMenuItems(editor, formatMenu);
+ registerButtons$2(editor, formatMenu);
+ };
+ var Formats = { register: register$3 };
+
+ var defaultBlocks = 'Paragraph=p;' + 'Heading 1=h1;' + 'Heading 2=h2;' + 'Heading 3=h3;' + 'Heading 4=h4;' + 'Heading 5=h5;' + 'Heading 6=h6;' + 'Preformatted=pre';
+ var createFormats$1 = function (formats) {
+ formats = formats.replace(/;$/, '').split(';');
+ var i = formats.length;
+ while (i--) {
+ formats[i] = formats[i].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 register$3 = function (editor) {
- var formatMenu = createFormatMenu(editor);
- registerMenuItems(editor, formatMenu);
- registerButtons$2(editor, formatMenu);
- };
- var $_9qaa1r1bmjjgwekdc = { register: register$3 };
-
- var defaultBlocks = 'Paragraph=p;' + 'Heading 1=h1;' + 'Heading 2=h2;' + 'Heading 3=h3;' + 'Heading 4=h4;' + 'Heading 5=h5;' + 'Heading 6=h6;' + 'Preformatted=pre';
- var createFormats$1 = function (formats) {
- formats = formats.replace(/;$/, '').split(';');
- var i = formats.length;
- while (i--) {
- formats[i] = formats[i].split('=');
- }
- return formats;
- };
- var createListBoxChangeHandler = function (editor, items, formatName) {
- return function () {
- var self = this;
- editor.on('nodeChange', function (e) {
- var formatter = editor.formatter;
- var value = null;
- global$4.each(e.parents, function (node) {
- global$4.each(items, function (item) {
- if (formatName) {
- if (formatter.matchNode(node, formatName, { value: item.value })) {
- value = item.value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return formats;
+ };
+ var createListBoxChangeHandler = function (editor, items, formatName) {
+ return function () {
+ var self = this;
+ editor.on('nodeChange', function (e) {
+ var formatter = editor.formatter;
+ var value = null;
+ global$4.each(e.parents, function (node) {
+ global$4.each(items, function (item) {
+ if (formatName) {
+ if (formatter.matchNode(node, formatName, { value: item.value })) {
+ value = item.value;
+ }
+ } else {
+ if (formatter.matchNode(node, item.value)) {
+ value = item.value;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- if (formatter.matchNode(node, item.value)) {
- value = item.value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (value) {
+ 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">- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> if (value) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</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">- if (value) {
- return false;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.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">- self.value(value);
- });
</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">- };
- var lazyFormatSelectBoxItems = function (editor, blocks) {
- return function () {
- var items = [];
- global$4.each(blocks, function (block) {
- items.push({
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var lazyFormatSelectBoxItems = function (editor, blocks) {
+ return function () {
+ var items = [];
+ global$4.each(blocks, function (block) {
+ items.push({
+ text: block[0],
+ value: block[1],
+ textStyle: function () {
+ return editor.formatter.getCssText(block[1]);
+ }
+ });
+ });
+ return {
+ type: 'listbox',
+ text: blocks[0][0],
+ values: items,
+ fixedWidth: true,
+ onselect: function (e) {
+ if (e.control) {
+ var fmt = e.control.value();
+ toggleFormat(editor, fmt)();
+ }
+ },
+ onPostRender: createListBoxChangeHandler(editor, items)
+ };
+ };
+ };
+ var buildMenuItems = function (editor, blocks) {
+ return global$4.map(blocks, function (block) {
+ return {
</ins><span class="cx" style="display: block; padding: 0 10px"> text: block[0],
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- value: block[1],
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ onclick: toggleFormat(editor, block[1]),
</ins><span class="cx" style="display: block; padding: 0 10px"> textStyle: function () {
</span><span class="cx" style="display: block; padding: 0 10px"> return editor.formatter.getCssText(block[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">- });
</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">- return {
- type: 'listbox',
- text: blocks[0][0],
- values: items,
- fixedWidth: true,
- onselect: function (e) {
- if (e.control) {
- var fmt = e.control.value();
- toggleFormat(editor, fmt)();
- }
- },
- onPostRender: createListBoxChangeHandler(editor, items)
- };
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var buildMenuItems = function (editor, blocks) {
- return global$4.map(blocks, function (block) {
- return {
- text: block[0],
- onclick: toggleFormat(editor, block[1]),
- textStyle: function () {
- return editor.formatter.getCssText(block[1]);
- }
- };
- });
- };
- var register$4 = function (editor) {
- var blocks = createFormats$1(editor.settings.block_formats || defaultBlocks);
- editor.addMenuItem('blockformats', {
- text: 'Blocks',
- menu: buildMenuItems(editor, blocks)
- });
- editor.addButton('formatselect', lazyFormatSelectBoxItems(editor, blocks));
- };
- var $_a3xw9u1bnjjgwekdh = { register: register$4 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register$4 = function (editor) {
+ var blocks = createFormats$1(editor.settings.block_formats || defaultBlocks);
+ editor.addMenuItem('blockformats', {
+ text: 'Blocks',
+ menu: buildMenuItems(editor, blocks)
+ });
+ editor.addButton('formatselect', lazyFormatSelectBoxItems(editor, blocks));
+ };
+ var FormatSelect = { register: register$4 };
</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 createCustomMenuItems = function (editor, names) {
- var items, nameList;
- if (typeof names === 'string') {
- nameList = names.split(' ');
- } else if (global$4.isArray(names)) {
- return flatten$1(global$4.map(names, function (names) {
- return createCustomMenuItems(editor, names);
- }));
- }
- items = global$4.grep(nameList, function (name) {
- return name === '|' || name in editor.menuItems;
- });
- return global$4.map(items, function (name) {
- return name === '|' ? { text: '-' } : editor.menuItems[name];
- });
- };
- var isSeparator = function (menuItem) {
- return menuItem && menuItem.text === '-';
- };
- var trimMenuItems = function (menuItems) {
- var menuItems2 = filter(menuItems, function (menuItem, i, menuItems) {
- return !isSeparator(menuItem) || !isSeparator(menuItems[i - 1]);
- });
- return filter(menuItems2, function (menuItem, i, menuItems) {
- return !isSeparator(menuItem) || i > 0 && i < menuItems.length - 1;
- });
- };
- var createContextMenuItems = function (editor, context) {
- var outputMenuItems = [{ text: '-' }];
- var menuItems = global$4.grep(editor.menuItems, function (menuItem) {
- return menuItem.context === context;
- });
- global$4.each(menuItems, function (menuItem) {
- if (menuItem.separator === 'before') {
- outputMenuItems.push({ text: '|' });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createCustomMenuItems = function (editor, names) {
+ var items, nameList;
+ if (typeof names === 'string') {
+ nameList = names.split(' ');
+ } else if (global$4.isArray(names)) {
+ return flatten$1(global$4.map(names, function (names) {
+ return createCustomMenuItems(editor, names);
+ }));
</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 (menuItem.prependToContext) {
- outputMenuItems.unshift(menuItem);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ items = global$4.grep(nameList, function (name) {
+ return name === '|' || name in editor.menuItems;
+ });
+ return global$4.map(items, function (name) {
+ return name === '|' ? { text: '-' } : editor.menuItems[name];
+ });
+ };
+ var isSeparator = function (menuItem) {
+ return menuItem && menuItem.text === '-';
+ };
+ var trimMenuItems = function (menuItems) {
+ var menuItems2 = filter(menuItems, function (menuItem, i, menuItems) {
+ return !isSeparator(menuItem) || !isSeparator(menuItems[i - 1]);
+ });
+ return filter(menuItems2, function (menuItem, i, menuItems) {
+ return !isSeparator(menuItem) || i > 0 && i < menuItems.length - 1;
+ });
+ };
+ var createContextMenuItems = function (editor, context) {
+ var outputMenuItems = [{ text: '-' }];
+ var menuItems = global$4.grep(editor.menuItems, function (menuItem) {
+ return menuItem.context === context;
+ });
+ global$4.each(menuItems, function (menuItem) {
+ if (menuItem.separator === 'before') {
+ outputMenuItems.push({ text: '|' });
+ }
+ if (menuItem.prependToContext) {
+ outputMenuItems.unshift(menuItem);
+ } else {
+ outputMenuItems.push(menuItem);
+ }
+ if (menuItem.separator === 'after') {
+ outputMenuItems.push({ text: '|' });
+ }
+ });
+ return outputMenuItems;
+ };
+ var createInsertMenu = function (editor) {
+ var insertButtonItems = editor.settings.insert_button_items;
+ if (insertButtonItems) {
+ return trimMenuItems(createCustomMenuItems(editor, insertButtonItems));
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- outputMenuItems.push(menuItem);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return trimMenuItems(createContextMenuItems(editor, 'insert'));
</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 (menuItem.separator === 'after') {
- outputMenuItems.push({ text: '|' });
- }
- });
- return outputMenuItems;
- };
- var createInsertMenu = function (editor) {
- var insertButtonItems = editor.settings.insert_button_items;
- if (insertButtonItems) {
- return trimMenuItems(createCustomMenuItems(editor, insertButtonItems));
- } else {
- return trimMenuItems(createContextMenuItems(editor, 'insert'));
- }
- };
- var registerButtons$3 = function (editor) {
- editor.addButton('insert', {
- type: 'menubutton',
- icon: 'insert',
- menu: [],
- oncreatemenu: function () {
- this.menu.add(createInsertMenu(editor));
- this.menu.renderNew();
- }
- });
- };
- var register$5 = function (editor) {
- registerButtons$3(editor);
- };
- var $_dvqvtt1bojjgwekdj = { register: register$5 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var registerButtons$3 = function (editor) {
+ editor.addButton('insert', {
+ type: 'menubutton',
+ icon: 'insert',
+ menu: [],
+ oncreatemenu: function () {
+ this.menu.add(createInsertMenu(editor));
+ this.menu.renderNew();
+ }
+ });
+ };
+ var register$5 = function (editor) {
+ registerButtons$3(editor);
+ };
+ var InsertButton = { register: register$5 };
</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 registerFormatButtons = function (editor) {
- global$4.each({
- bold: 'Bold',
- italic: 'Italic',
- underline: 'Underline',
- strikethrough: 'Strikethrough',
- subscript: 'Subscript',
- superscript: 'Superscript'
- }, function (text, name) {
- editor.addButton(name, {
- active: false,
- tooltip: text,
- onPostRender: postRenderFormatToggle(editor, name),
- onclick: toggleFormat(editor, name)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var registerFormatButtons = function (editor) {
+ global$4.each({
+ bold: 'Bold',
+ italic: 'Italic',
+ underline: 'Underline',
+ strikethrough: 'Strikethrough',
+ subscript: 'Subscript',
+ superscript: 'Superscript'
+ }, function (text, name) {
+ editor.addButton(name, {
+ active: false,
+ tooltip: text,
+ onPostRender: postRenderFormatToggle(editor, name),
+ onclick: toggleFormat(editor, name)
+ });
</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 registerCommandButtons = function (editor) {
- global$4.each({
- outdent: [
- 'Decrease indent',
- 'Outdent'
- ],
- indent: [
- 'Increase indent',
- 'Indent'
- ],
- cut: [
- 'Cut',
- 'Cut'
- ],
- copy: [
- 'Copy',
- 'Copy'
- ],
- paste: [
- 'Paste',
- 'Paste'
- ],
- help: [
- 'Help',
- 'mceHelp'
- ],
- selectall: [
- 'Select all',
- 'SelectAll'
- ],
- visualaid: [
- 'Visual aids',
- 'mceToggleVisualAid'
- ],
- newdocument: [
- 'New document',
- 'mceNewDocument'
- ],
- removeformat: [
- 'Clear formatting',
- 'RemoveFormat'
- ],
- remove: [
- 'Remove',
- 'Delete'
- ]
- }, function (item, name) {
- editor.addButton(name, {
- tooltip: item[0],
- cmd: item[1]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var registerCommandButtons = function (editor) {
+ global$4.each({
+ outdent: [
+ 'Decrease indent',
+ 'Outdent'
+ ],
+ indent: [
+ 'Increase indent',
+ 'Indent'
+ ],
+ cut: [
+ 'Cut',
+ 'Cut'
+ ],
+ copy: [
+ 'Copy',
+ 'Copy'
+ ],
+ paste: [
+ 'Paste',
+ 'Paste'
+ ],
+ help: [
+ 'Help',
+ 'mceHelp'
+ ],
+ selectall: [
+ 'Select all',
+ 'SelectAll'
+ ],
+ visualaid: [
+ 'Visual aids',
+ 'mceToggleVisualAid'
+ ],
+ newdocument: [
+ 'New document',
+ 'mceNewDocument'
+ ],
+ removeformat: [
+ 'Clear formatting',
+ 'RemoveFormat'
+ ],
+ remove: [
+ 'Remove',
+ 'Delete'
+ ]
+ }, function (item, name) {
+ editor.addButton(name, {
+ tooltip: item[0],
+ cmd: item[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">- });
- };
- var registerCommandToggleButtons = function (editor) {
- global$4.each({
- blockquote: [
- 'Blockquote',
- 'mceBlockQuote'
- ],
- subscript: [
- 'Subscript',
- 'Subscript'
- ],
- superscript: [
- 'Superscript',
- 'Superscript'
- ]
- }, function (item, name) {
- editor.addButton(name, {
- active: false,
- tooltip: item[0],
- cmd: item[1],
- onPostRender: postRenderFormatToggle(editor, name)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var registerCommandToggleButtons = function (editor) {
+ global$4.each({
+ blockquote: [
+ 'Blockquote',
+ 'mceBlockQuote'
+ ],
+ subscript: [
+ 'Subscript',
+ 'Subscript'
+ ],
+ superscript: [
+ 'Superscript',
+ 'Superscript'
+ ]
+ }, function (item, name) {
+ editor.addButton(name, {
+ active: false,
+ tooltip: item[0],
+ cmd: item[1],
+ onPostRender: postRenderFormatToggle(editor, name)
+ });
</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 registerButtons$4 = function (editor) {
- registerFormatButtons(editor);
- registerCommandButtons(editor);
- registerCommandToggleButtons(editor);
- };
- var registerMenuItems$1 = function (editor) {
- global$4.each({
- bold: [
- 'Bold',
- 'Bold',
- 'Meta+B'
- ],
- italic: [
- 'Italic',
- 'Italic',
- 'Meta+I'
- ],
- underline: [
- 'Underline',
- 'Underline',
- 'Meta+U'
- ],
- strikethrough: [
- 'Strikethrough',
- 'Strikethrough'
- ],
- subscript: [
- 'Subscript',
- 'Subscript'
- ],
- superscript: [
- 'Superscript',
- 'Superscript'
- ],
- removeformat: [
- 'Clear formatting',
- 'RemoveFormat'
- ],
- newdocument: [
- 'New document',
- 'mceNewDocument'
- ],
- cut: [
- 'Cut',
- 'Cut',
- 'Meta+X'
- ],
- copy: [
- 'Copy',
- 'Copy',
- 'Meta+C'
- ],
- paste: [
- 'Paste',
- 'Paste',
- 'Meta+V'
- ],
- selectall: [
- 'Select all',
- 'SelectAll',
- 'Meta+A'
- ]
- }, function (item, name) {
- editor.addMenuItem(name, {
- text: item[0],
- icon: name,
- shortcut: item[2],
- cmd: item[1]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var registerButtons$4 = function (editor) {
+ registerFormatButtons(editor);
+ registerCommandButtons(editor);
+ registerCommandToggleButtons(editor);
+ };
+ var registerMenuItems$1 = function (editor) {
+ global$4.each({
+ bold: [
+ 'Bold',
+ 'Bold',
+ 'Meta+B'
+ ],
+ italic: [
+ 'Italic',
+ 'Italic',
+ 'Meta+I'
+ ],
+ underline: [
+ 'Underline',
+ 'Underline',
+ 'Meta+U'
+ ],
+ strikethrough: [
+ 'Strikethrough',
+ 'Strikethrough'
+ ],
+ subscript: [
+ 'Subscript',
+ 'Subscript'
+ ],
+ superscript: [
+ 'Superscript',
+ 'Superscript'
+ ],
+ removeformat: [
+ 'Clear formatting',
+ 'RemoveFormat'
+ ],
+ newdocument: [
+ 'New document',
+ 'mceNewDocument'
+ ],
+ cut: [
+ 'Cut',
+ 'Cut',
+ 'Meta+X'
+ ],
+ copy: [
+ 'Copy',
+ 'Copy',
+ 'Meta+C'
+ ],
+ paste: [
+ 'Paste',
+ 'Paste',
+ 'Meta+V'
+ ],
+ selectall: [
+ 'Select all',
+ 'SelectAll',
+ 'Meta+A'
+ ]
+ }, function (item, name) {
+ editor.addMenuItem(name, {
+ text: item[0],
+ icon: name,
+ shortcut: item[2],
+ cmd: item[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">- });
- editor.addMenuItem('codeformat', {
- text: 'Code',
- icon: 'code',
- onclick: toggleFormat(editor, 'code')
- });
- };
- var register$6 = function (editor) {
- registerButtons$4(editor);
- registerMenuItems$1(editor);
- };
- var $_2ywvy11bpjjgwekdn = { register: register$6 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.addMenuItem('codeformat', {
+ text: 'Code',
+ icon: 'code',
+ onclick: toggleFormat(editor, 'code')
+ });
+ };
+ var register$6 = function (editor) {
+ registerButtons$4(editor);
+ registerMenuItems$1(editor);
+ };
+ var SimpleControls = { register: register$6 };
</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 toggleUndoRedoState = function (editor, type) {
- return function () {
- var self = this;
- var checkState = function () {
- var typeFn = type === 'redo' ? 'hasRedo' : 'hasUndo';
- return editor.undoManager ? editor.undoManager[typeFn]() : false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var toggleUndoRedoState = function (editor, type) {
+ return function () {
+ var self = this;
+ var checkState = function () {
+ var typeFn = type === 'redo' ? 'hasRedo' : 'hasUndo';
+ return editor.undoManager ? editor.undoManager[typeFn]() : false;
+ };
+ self.disabled(!checkState());
+ editor.on('Undo Redo AddUndo TypingUndo ClearUndos SwitchMode', function () {
+ self.disabled(editor.readonly || !checkState());
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.disabled(!checkState());
- editor.on('Undo Redo AddUndo TypingUndo ClearUndos SwitchMode', function () {
- self.disabled(editor.readonly || !checkState());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var registerMenuItems$2 = function (editor) {
+ editor.addMenuItem('undo', {
+ text: 'Undo',
+ icon: 'undo',
+ shortcut: 'Meta+Z',
+ onPostRender: toggleUndoRedoState(editor, 'undo'),
+ cmd: 'undo'
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.addMenuItem('redo', {
+ text: 'Redo',
+ icon: 'redo',
+ shortcut: 'Meta+Y',
+ onPostRender: toggleUndoRedoState(editor, 'redo'),
+ cmd: 'redo'
+ });
</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 registerMenuItems$2 = function (editor) {
- editor.addMenuItem('undo', {
- text: 'Undo',
- icon: 'undo',
- shortcut: 'Meta+Z',
- onPostRender: toggleUndoRedoState(editor, 'undo'),
- cmd: 'undo'
- });
- editor.addMenuItem('redo', {
- text: 'Redo',
- icon: 'redo',
- shortcut: 'Meta+Y',
- onPostRender: toggleUndoRedoState(editor, 'redo'),
- cmd: 'redo'
- });
- };
- var registerButtons$5 = function (editor) {
- editor.addButton('undo', {
- tooltip: 'Undo',
- onPostRender: toggleUndoRedoState(editor, 'undo'),
- cmd: 'undo'
- });
- editor.addButton('redo', {
- tooltip: 'Redo',
- onPostRender: toggleUndoRedoState(editor, 'redo'),
- cmd: 'redo'
- });
- };
- var register$7 = function (editor) {
- registerMenuItems$2(editor);
- registerButtons$5(editor);
- };
- var $_5qfrkx1bqjjgwekdq = { register: register$7 };
-
- var toggleVisualAidState = function (editor) {
- return function () {
- var self = this;
- editor.on('VisualAid', function (e) {
- self.active(e.hasVisual);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var registerButtons$5 = function (editor) {
+ editor.addButton('undo', {
+ tooltip: 'Undo',
+ onPostRender: toggleUndoRedoState(editor, 'undo'),
+ cmd: 'undo'
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.active(editor.hasVisual);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.addButton('redo', {
+ tooltip: 'Redo',
+ onPostRender: toggleUndoRedoState(editor, 'redo'),
+ cmd: 'redo'
+ });
</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 registerMenuItems$3 = function (editor) {
- editor.addMenuItem('visualaid', {
- text: 'Visual aids',
- selectable: true,
- onPostRender: toggleVisualAidState(editor),
- cmd: 'mceToggleVisualAid'
- });
- };
- var register$8 = function (editor) {
- registerMenuItems$3(editor);
- };
- var $_ebb6rc1brjjgwekdr = { register: register$8 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register$7 = function (editor) {
+ registerMenuItems$2(editor);
+ registerButtons$5(editor);
+ };
+ var UndoRedo = { register: register$7 };
</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 setupEnvironment = function () {
- Widget.tooltips = !global$1.iOS;
- Control$1.translate = function (text) {
- return global$5.translate(text);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var toggleVisualAidState = function (editor) {
+ return function () {
+ var self = this;
+ editor.on('VisualAid', function (e) {
+ self.active(e.hasVisual);
+ });
+ self.active(editor.hasVisual);
+ };
</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 setupUiContainer = function (editor) {
- if (editor.settings.ui_container) {
- global$1.container = $_6nlstg1bfjjgwekcb.descendant(Element$$1.fromDom(document.body), editor.settings.ui_container).fold(constant(null), function (elm) {
- return elm.dom();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var registerMenuItems$3 = function (editor) {
+ editor.addMenuItem('visualaid', {
+ text: 'Visual aids',
+ selectable: true,
+ onPostRender: toggleVisualAidState(editor),
+ cmd: 'mceToggleVisualAid'
</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 setupRtlMode = function (editor) {
- if (editor.rtl) {
- Control$1.rtl = true;
- }
- };
- var setupHideFloatPanels = function (editor) {
- editor.on('mousedown', function () {
- FloatPanel.hideAll();
- });
- };
- var setup = function (editor) {
- setupRtlMode(editor);
- setupHideFloatPanels(editor);
- setupUiContainer(editor);
- setupEnvironment();
- $_a3xw9u1bnjjgwekdh.register(editor);
- $_7uh4c31bijjgwekcw.register(editor);
- $_2ywvy11bpjjgwekdn.register(editor);
- $_5qfrkx1bqjjgwekdq.register(editor);
- $_b15nsk1bljjgwekd9.register(editor);
- $_2g5ce1bkjjgwekcz.register(editor);
- $_9qaa1r1bmjjgwekdc.register(editor);
- $_ebb6rc1brjjgwekdr.register(editor);
- $_dvqvtt1bojjgwekdj.register(editor);
- };
- var $_gg6ikw1bejjgwekc5 = { setup: setup };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var register$8 = function (editor) {
+ registerMenuItems$3(editor);
+ };
+ var VisualAid = { register: register$8 };
</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 GridLayout = AbsoluteLayout.extend({
- recalc: function (container) {
- var settings, rows, cols, items, contLayoutRect, width, height, rect, ctrlLayoutRect, ctrl, x, y, posX, posY, ctrlSettings, contPaddingBox, align, spacingH, spacingV, alignH, alignV, maxX, maxY;
- var colWidths = [];
- var rowHeights = [];
- var ctrlMinWidth, ctrlMinHeight, availableWidth, availableHeight, reverseRows, idx;
- settings = container.settings;
- items = container.items().filter(':visible');
- contLayoutRect = container.layoutRect();
- cols = settings.columns || Math.ceil(Math.sqrt(items.length));
- rows = Math.ceil(items.length / cols);
- spacingH = settings.spacingH || settings.spacing || 0;
- spacingV = settings.spacingV || settings.spacing || 0;
- alignH = settings.alignH || settings.align;
- alignV = settings.alignV || settings.align;
- contPaddingBox = container.paddingBox;
- reverseRows = 'reverseRows' in settings ? settings.reverseRows : container.isRtl();
- if (alignH && typeof alignH === 'string') {
- alignH = [alignH];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setupEnvironment = function () {
+ Widget.tooltips = !global$1.iOS;
+ Control$1.translate = function (text) {
+ return global$5.translate(text);
+ };
+ };
+ var setupUiContainer = function (editor) {
+ if (editor.settings.ui_container) {
+ global$1.container = descendant$1(Element$$1.fromDom(document.body), editor.settings.ui_container).fold(constant(null), function (elm) {
+ return elm.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 (alignV && typeof alignV === 'string') {
- alignV = [alignV];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var setupRtlMode = function (editor) {
+ if (editor.rtl) {
+ Control$1.rtl = 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">- for (x = 0; x < cols; x++) {
- colWidths.push(0);
- }
- for (y = 0; y < rows; y++) {
- rowHeights.push(0);
- }
- for (y = 0; y < rows; y++) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var setupHideFloatPanels = function (editor) {
+ editor.on('mousedown progressstate', function () {
+ FloatPanel.hideAll();
+ });
+ };
+ var setup = function (editor) {
+ setupRtlMode(editor);
+ setupHideFloatPanels(editor);
+ setupUiContainer(editor);
+ setupEnvironment();
+ FormatSelect.register(editor);
+ Align.register(editor);
+ SimpleControls.register(editor);
+ UndoRedo.register(editor);
+ FontSizeSelect.register(editor);
+ FontSelect.register(editor);
+ Formats.register(editor);
+ VisualAid.register(editor);
+ InsertButton.register(editor);
+ };
+ var FormatControls = { setup: setup };
+
+ var GridLayout = AbsoluteLayout.extend({
+ recalc: function (container) {
+ var settings, rows, cols, items, contLayoutRect, width, height, rect, ctrlLayoutRect, ctrl, x, y, posX, posY, ctrlSettings, contPaddingBox, align, spacingH, spacingV, alignH, alignV, maxX, maxY;
+ var colWidths = [];
+ var rowHeights = [];
+ var ctrlMinWidth, ctrlMinHeight, availableWidth, availableHeight, reverseRows, idx;
+ settings = container.settings;
+ items = container.items().filter(':visible');
+ contLayoutRect = container.layoutRect();
+ cols = settings.columns || Math.ceil(Math.sqrt(items.length));
+ rows = Math.ceil(items.length / cols);
+ spacingH = settings.spacingH || settings.spacing || 0;
+ spacingV = settings.spacingV || settings.spacing || 0;
+ alignH = settings.alignH || settings.align;
+ alignV = settings.alignV || settings.align;
+ contPaddingBox = container.paddingBox;
+ reverseRows = 'reverseRows' in settings ? settings.reverseRows : container.isRtl();
+ if (alignH && typeof alignH === 'string') {
+ alignH = [alignH];
+ }
+ if (alignV && typeof alignV === 'string') {
+ alignV = [alignV];
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> for (x = 0; x < cols; x++) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ctrl = items[y * cols + x];
- if (!ctrl) {
- break;
- }
- ctrlLayoutRect = ctrl.layoutRect();
- ctrlMinWidth = ctrlLayoutRect.minW;
- ctrlMinHeight = ctrlLayoutRect.minH;
- colWidths[x] = ctrlMinWidth > colWidths[x] ? ctrlMinWidth : colWidths[x];
- rowHeights[y] = ctrlMinHeight > rowHeights[y] ? ctrlMinHeight : rowHeights[y];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ colWidths.push(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">- }
- availableWidth = contLayoutRect.innerW - contPaddingBox.left - contPaddingBox.right;
- for (maxX = 0, x = 0; x < cols; x++) {
- maxX += colWidths[x] + (x > 0 ? spacingH : 0);
- availableWidth -= (x > 0 ? spacingH : 0) + colWidths[x];
- }
- availableHeight = contLayoutRect.innerH - contPaddingBox.top - contPaddingBox.bottom;
- for (maxY = 0, y = 0; y < rows; y++) {
- maxY += rowHeights[y] + (y > 0 ? spacingV : 0);
- availableHeight -= (y > 0 ? spacingV : 0) + rowHeights[y];
- }
- maxX += contPaddingBox.left + contPaddingBox.right;
- maxY += contPaddingBox.top + contPaddingBox.bottom;
- rect = {};
- rect.minW = maxX + (contLayoutRect.w - contLayoutRect.innerW);
- rect.minH = maxY + (contLayoutRect.h - contLayoutRect.innerH);
- rect.contentW = rect.minW - contLayoutRect.deltaW;
- rect.contentH = rect.minH - contLayoutRect.deltaH;
- rect.minW = Math.min(rect.minW, contLayoutRect.maxW);
- rect.minH = Math.min(rect.minH, contLayoutRect.maxH);
- rect.minW = Math.max(rect.minW, contLayoutRect.startMinWidth);
- rect.minH = Math.max(rect.minH, contLayoutRect.startMinHeight);
- if (contLayoutRect.autoResize && (rect.minW !== contLayoutRect.minW || rect.minH !== contLayoutRect.minH)) {
- rect.w = rect.minW;
- rect.h = rect.minH;
- container.layoutRect(rect);
- this.recalc(container);
- if (container._lastRect === null) {
- var parentCtrl = container.parent();
- if (parentCtrl) {
- parentCtrl._lastRect = null;
- parentCtrl.recalc();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (y = 0; y < rows; y++) {
+ rowHeights.push(0);
+ }
+ for (y = 0; y < rows; y++) {
+ for (x = 0; x < cols; x++) {
+ ctrl = items[y * cols + x];
+ if (!ctrl) {
+ break;
+ }
+ ctrlLayoutRect = ctrl.layoutRect();
+ ctrlMinWidth = ctrlLayoutRect.minW;
+ ctrlMinHeight = ctrlLayoutRect.minH;
+ colWidths[x] = ctrlMinWidth > colWidths[x] ? ctrlMinWidth : colWidths[x];
+ rowHeights[y] = ctrlMinHeight > rowHeights[y] ? ctrlMinHeight : rowHeights[y];
</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">- return;
- }
- if (contLayoutRect.autoResize) {
- rect = container.layoutRect(rect);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ availableWidth = contLayoutRect.innerW - contPaddingBox.left - contPaddingBox.right;
+ for (maxX = 0, x = 0; x < cols; x++) {
+ maxX += colWidths[x] + (x > 0 ? spacingH : 0);
+ availableWidth -= (x > 0 ? spacingH : 0) + colWidths[x];
+ }
+ availableHeight = contLayoutRect.innerH - contPaddingBox.top - contPaddingBox.bottom;
+ for (maxY = 0, y = 0; y < rows; y++) {
+ maxY += rowHeights[y] + (y > 0 ? spacingV : 0);
+ availableHeight -= (y > 0 ? spacingV : 0) + rowHeights[y];
+ }
+ maxX += contPaddingBox.left + contPaddingBox.right;
+ maxY += contPaddingBox.top + contPaddingBox.bottom;
+ rect = {};
+ rect.minW = maxX + (contLayoutRect.w - contLayoutRect.innerW);
+ rect.minH = maxY + (contLayoutRect.h - contLayoutRect.innerH);
</ins><span class="cx" style="display: block; padding: 0 10px"> rect.contentW = rect.minW - contLayoutRect.deltaW;
</span><span class="cx" style="display: block; padding: 0 10px"> rect.contentH = rect.minH - contLayoutRect.deltaH;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- var flexV;
- if (settings.packV === 'start') {
- flexV = 0;
- } else {
- flexV = availableHeight > 0 ? Math.floor(availableHeight / rows) : 0;
- }
- var totalFlex = 0;
- var flexWidths = settings.flexWidths;
- if (flexWidths) {
- for (x = 0; x < flexWidths.length; x++) {
- totalFlex += flexWidths[x];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rect.minW = Math.min(rect.minW, contLayoutRect.maxW);
+ rect.minH = Math.min(rect.minH, contLayoutRect.maxH);
+ rect.minW = Math.max(rect.minW, contLayoutRect.startMinWidth);
+ rect.minH = Math.max(rect.minH, contLayoutRect.startMinHeight);
+ if (contLayoutRect.autoResize && (rect.minW !== contLayoutRect.minW || rect.minH !== contLayoutRect.minH)) {
+ rect.w = rect.minW;
+ rect.h = rect.minH;
+ container.layoutRect(rect);
+ this.recalc(container);
+ if (container._lastRect === null) {
+ var parentCtrl = container.parent();
+ if (parentCtrl) {
+ parentCtrl._lastRect = null;
+ parentCtrl.recalc();
+ }
+ }
+ 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">- } else {
- totalFlex = cols;
- }
- var ratio = availableWidth / totalFlex;
- for (x = 0; x < cols; x++) {
- colWidths[x] += flexWidths ? flexWidths[x] * ratio : ratio;
- }
- posY = contPaddingBox.top;
- for (y = 0; y < rows; y++) {
- posX = contPaddingBox.left;
- height = rowHeights[y] + flexV;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (contLayoutRect.autoResize) {
+ rect = container.layoutRect(rect);
+ rect.contentW = rect.minW - contLayoutRect.deltaW;
+ rect.contentH = rect.minH - contLayoutRect.deltaH;
+ }
+ var flexV;
+ if (settings.packV === 'start') {
+ flexV = 0;
+ } else {
+ flexV = availableHeight > 0 ? Math.floor(availableHeight / rows) : 0;
+ }
+ var totalFlex = 0;
+ var flexWidths = settings.flexWidths;
+ if (flexWidths) {
+ for (x = 0; x < flexWidths.length; x++) {
+ totalFlex += flexWidths[x];
+ }
+ } else {
+ totalFlex = cols;
+ }
+ var ratio = availableWidth / totalFlex;
</ins><span class="cx" style="display: block; padding: 0 10px"> for (x = 0; x < cols; x++) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (reverseRows) {
- idx = y * cols + cols - 1 - x;
- } else {
- idx = y * cols + x;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ colWidths[x] += flexWidths ? flexWidths[x] * ratio : ratio;
+ }
+ posY = contPaddingBox.top;
+ for (y = 0; y < rows; y++) {
+ posX = contPaddingBox.left;
+ height = rowHeights[y] + flexV;
+ for (x = 0; x < cols; x++) {
+ if (reverseRows) {
+ idx = y * cols + cols - 1 - x;
+ } else {
+ idx = y * cols + x;
+ }
+ ctrl = items[idx];
+ if (!ctrl) {
+ break;
+ }
+ ctrlSettings = ctrl.settings;
+ ctrlLayoutRect = ctrl.layoutRect();
+ width = Math.max(colWidths[x], ctrlLayoutRect.startMinWidth);
+ ctrlLayoutRect.x = posX;
+ ctrlLayoutRect.y = posY;
+ align = ctrlSettings.alignH || (alignH ? alignH[x] || alignH[0] : null);
+ if (align === 'center') {
+ ctrlLayoutRect.x = posX + width / 2 - ctrlLayoutRect.w / 2;
+ } else if (align === 'right') {
+ ctrlLayoutRect.x = posX + width - ctrlLayoutRect.w;
+ } else if (align === 'stretch') {
+ ctrlLayoutRect.w = width;
+ }
+ align = ctrlSettings.alignV || (alignV ? alignV[x] || alignV[0] : null);
+ if (align === 'center') {
+ ctrlLayoutRect.y = posY + height / 2 - ctrlLayoutRect.h / 2;
+ } else if (align === 'bottom') {
+ ctrlLayoutRect.y = posY + height - ctrlLayoutRect.h;
+ } else if (align === 'stretch') {
+ ctrlLayoutRect.h = height;
+ }
+ ctrl.layoutRect(ctrlLayoutRect);
+ posX += width + spacingH;
+ if (ctrl.recalc) {
+ ctrl.recalc();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ctrl = items[idx];
- if (!ctrl) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ posY += height + spacingV;
+ }
+ }
+ });
+
+ var Iframe = Widget.extend({
+ renderHtml: function () {
+ var self = this;
+ self.classes.add('iframe');
+ self.canFocus = false;
+ return '<iframe id="' + self._id + '" class="' + self.classes + '" tabindex="-1" src="' + (self.settings.url || 'javascript:\'\'') + '" frameborder="0"></iframe>';
+ },
+ src: function (src) {
+ this.getEl().src = src;
+ },
+ html: function (html, callback) {
+ var self = this, body = this.getEl().contentWindow.document.body;
+ if (!body) {
+ global$3.setTimeout(function () {
+ self.html(html);
+ });
+ } else {
+ body.innerHTML = html;
+ if (callback) {
+ 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">- ctrlSettings = ctrl.settings;
- ctrlLayoutRect = ctrl.layoutRect();
- width = Math.max(colWidths[x], ctrlLayoutRect.startMinWidth);
- ctrlLayoutRect.x = posX;
- ctrlLayoutRect.y = posY;
- align = ctrlSettings.alignH || (alignH ? alignH[x] || alignH[0] : null);
- if (align === 'center') {
- ctrlLayoutRect.x = posX + width / 2 - ctrlLayoutRect.w / 2;
- } else if (align === 'right') {
- ctrlLayoutRect.x = posX + width - ctrlLayoutRect.w;
- } else if (align === 'stretch') {
- ctrlLayoutRect.w = width;
- }
- align = ctrlSettings.alignV || (alignV ? alignV[x] || alignV[0] : null);
- if (align === 'center') {
- ctrlLayoutRect.y = posY + height / 2 - ctrlLayoutRect.h / 2;
- } else if (align === 'bottom') {
- ctrlLayoutRect.y = posY + height - ctrlLayoutRect.h;
- } else if (align === 'stretch') {
- ctrlLayoutRect.h = height;
- }
- ctrl.layoutRect(ctrlLayoutRect);
- posX += width + spacingH;
- if (ctrl.recalc) {
- ctrl.recalc();
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- posY += height + spacingV;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- }
- });
</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">- var Iframe = Widget.extend({
- renderHtml: function () {
- var self = this;
- self.classes.add('iframe');
- self.canFocus = false;
- return '<iframe id="' + self._id + '" class="' + self.classes + '" tabindex="-1" src="' + (self.settings.url || 'javascript:\'\'') + '" frameborder="0"></iframe>';
- },
- src: function (src) {
- this.getEl().src = src;
- },
- html: function (html, callback) {
- var self = this, body = this.getEl().contentWindow.document.body;
- if (!body) {
- global$3.setTimeout(function () {
- self.html(html);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var InfoBox = Widget.extend({
+ init: function (settings) {
+ var self = this;
+ self._super(settings);
+ self.classes.add('widget').add('infobox');
+ self.canFocus = false;
+ },
+ severity: function (level) {
+ this.classes.remove('error');
+ this.classes.remove('warning');
+ this.classes.remove('success');
+ this.classes.add(level);
+ },
+ help: function (state) {
+ this.state.set('help', state);
+ },
+ renderHtml: function () {
+ var self = this, prefix = self.classPrefix;
+ return '<div id="' + self._id + '" class="' + self.classes + '">' + '<div id="' + self._id + '-body">' + self.encode(self.state.get('text')) + '<button role="button" tabindex="-1">' + '<i class="' + prefix + 'ico ' + prefix + 'i-help"></i>' + '</button>' + '</div>' + '</div>';
+ },
+ bindStates: function () {
+ var self = this;
+ self.state.on('change:text', function (e) {
+ self.getEl('body').firstChild.data = self.encode(e.value);
+ if (self.state.get('rendered')) {
+ self.updateLayoutRect();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- body.innerHTML = html;
- if (callback) {
- callback();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.state.on('change:help', function (e) {
+ self.classes.toggle('has-help', e.value);
+ if (self.state.get('rendered')) {
+ self.updateLayoutRect();
+ }
+ });
+ return self._super();
</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 this;
- }
- });
</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">- var InfoBox = Widget.extend({
- init: function (settings) {
- var self = this;
- self._super(settings);
- self.classes.add('widget').add('infobox');
- self.canFocus = false;
- },
- severity: function (level) {
- this.classes.remove('error');
- this.classes.remove('warning');
- this.classes.remove('success');
- this.classes.add(level);
- },
- help: function (state) {
- this.state.set('help', state);
- },
- renderHtml: function () {
- var self = this, prefix = self.classPrefix;
- return '<div id="' + self._id + '" class="' + self.classes + '">' + '<div id="' + self._id + '-body">' + self.encode(self.state.get('text')) + '<button role="button" tabindex="-1">' + '<i class="' + prefix + 'ico ' + prefix + 'i-help"></i>' + '</button>' + '</div>' + '</div>';
- },
- bindStates: function () {
- var self = this;
- self.state.on('change:text', function (e) {
- self.getEl('body').firstChild.data = self.encode(e.value);
- if (self.state.get('rendered')) {
- self.updateLayoutRect();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Label = Widget.extend({
+ init: function (settings) {
+ var self = this;
+ self._super(settings);
+ self.classes.add('widget').add('label');
+ self.canFocus = false;
+ if (settings.multiline) {
+ self.classes.add('autoscroll');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self.state.on('change:help', function (e) {
- self.classes.toggle('has-help', e.value);
- if (self.state.get('rendered')) {
- self.updateLayoutRect();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (settings.strong) {
+ self.classes.add('strong');
</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 self._super();
- }
- });
-
- var Label = Widget.extend({
- init: function (settings) {
- var self = this;
- self._super(settings);
- self.classes.add('widget').add('label');
- self.canFocus = false;
- if (settings.multiline) {
- self.classes.add('autoscroll');
- }
- if (settings.strong) {
- self.classes.add('strong');
- }
- },
- initLayoutRect: function () {
- var self = this, layoutRect = self._super();
- if (self.settings.multiline) {
- var size = funcs.getSize(self.getEl());
- if (size.width > layoutRect.maxW) {
- layoutRect.minW = layoutRect.maxW;
- self.classes.add('multiline');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ initLayoutRect: function () {
+ var self = this, layoutRect = self._super();
+ if (self.settings.multiline) {
+ var size = funcs.getSize(self.getEl());
+ if (size.width > layoutRect.maxW) {
+ layoutRect.minW = layoutRect.maxW;
+ self.classes.add('multiline');
+ }
+ self.getEl().style.width = layoutRect.minW + 'px';
+ layoutRect.startMinH = layoutRect.h = layoutRect.minH = Math.min(layoutRect.maxH, funcs.getSize(self.getEl()).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">- self.getEl().style.width = layoutRect.minW + 'px';
- layoutRect.startMinH = layoutRect.h = layoutRect.minH = Math.min(layoutRect.maxH, funcs.getSize(self.getEl()).height);
- }
- return layoutRect;
- },
- repaint: function () {
- var self = this;
- if (!self.settings.multiline) {
- self.getEl().style.lineHeight = self.layoutRect().h + 'px';
- }
- return self._super();
- },
- severity: function (level) {
- this.classes.remove('error');
- this.classes.remove('warning');
- this.classes.remove('success');
- this.classes.add(level);
- },
- renderHtml: function () {
- var self = this;
- var targetCtrl, forName, forId = self.settings.forId;
- var text = self.settings.html ? self.settings.html : self.encode(self.state.get('text'));
- if (!forId && (forName = self.settings.forName)) {
- targetCtrl = self.getRoot().find('#' + forName)[0];
- if (targetCtrl) {
- forId = targetCtrl._id;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return layoutRect;
+ },
+ repaint: function () {
+ var self = this;
+ if (!self.settings.multiline) {
+ self.getEl().style.lineHeight = self.layoutRect().h + 'px';
</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 self._super();
+ },
+ severity: function (level) {
+ this.classes.remove('error');
+ this.classes.remove('warning');
+ this.classes.remove('success');
+ this.classes.add(level);
+ },
+ renderHtml: function () {
+ var self = this;
+ var targetCtrl, forName, forId = self.settings.forId;
+ var text = self.settings.html ? self.settings.html : self.encode(self.state.get('text'));
+ if (!forId && (forName = self.settings.forName)) {
+ targetCtrl = self.getRoot().find('#' + forName)[0];
+ if (targetCtrl) {
+ forId = targetCtrl._id;
+ }
+ }
+ if (forId) {
+ return '<label id="' + self._id + '" class="' + self.classes + '"' + (forId ? ' for="' + forId + '"' : '') + '>' + text + '</label>';
+ }
+ return '<span id="' + self._id + '" class="' + self.classes + '">' + text + '</span>';
+ },
+ bindStates: function () {
+ var self = this;
+ self.state.on('change:text', function (e) {
+ self.innerHtml(self.encode(e.value));
+ if (self.state.get('rendered')) {
+ self.updateLayoutRect();
+ }
+ });
+ return self._super();
</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 (forId) {
- return '<label id="' + self._id + '" class="' + self.classes + '"' + (forId ? ' for="' + forId + '"' : '') + '>' + text + '</label>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var Toolbar$1 = Container.extend({
+ Defaults: {
+ role: 'toolbar',
+ layout: 'flow'
+ },
+ init: function (settings) {
+ var self = this;
+ self._super(settings);
+ self.classes.add('toolbar');
+ },
+ postRender: function () {
+ var self = this;
+ self.items().each(function (ctrl) {
+ ctrl.classes.add('toolbar-item');
+ });
+ return self._super();
</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 '<span id="' + self._id + '" class="' + self.classes + '">' + text + '</span>';
- },
- bindStates: function () {
- var self = this;
- self.state.on('change:text', function (e) {
- self.innerHtml(self.encode(e.value));
- if (self.state.get('rendered')) {
- self.updateLayoutRect();
- }
- });
- return self._super();
- }
- });
</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">- var Toolbar$1 = Container.extend({
- Defaults: {
- role: 'toolbar',
- layout: 'flow'
- },
- init: function (settings) {
- var self = this;
- self._super(settings);
- self.classes.add('toolbar');
- },
- postRender: function () {
- var self = this;
- self.items().each(function (ctrl) {
- ctrl.classes.add('toolbar-item');
- });
- return self._super();
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var MenuBar = Toolbar$1.extend({
+ Defaults: {
+ role: 'menubar',
+ containerCls: 'menubar',
+ ariaRoot: true,
+ defaults: { type: 'menubutton' }
+ }
+ });
</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 MenuBar = Toolbar$1.extend({
- Defaults: {
- role: 'menubar',
- containerCls: 'menubar',
- ariaRoot: true,
- defaults: { type: 'menubutton' }
- }
- });
-
- function isChildOf$1(node, parent$$1) {
- while (node) {
- if (parent$$1 === node) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function isChildOf$1(node, parent$$1) {
+ while (node) {
+ if (parent$$1 === node) {
+ return true;
+ }
+ 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">- node = node.parentNode;
</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">- return false;
- }
- var MenuButton = Button.extend({
- init: function (settings) {
- var self$$1 = this;
- self$$1._renderOpen = true;
- self$$1._super(settings);
- settings = self$$1.settings;
- self$$1.classes.add('menubtn');
- if (settings.fixedWidth) {
- self$$1.classes.add('fixed-width');
- }
- self$$1.aria('haspopup', true);
- self$$1.state.set('menu', settings.menu || self$$1.render());
- },
- showMenu: function (toggle) {
- var self$$1 = this;
- var menu;
- if (self$$1.menu && self$$1.menu.visible() && toggle !== false) {
- return self$$1.hideMenu();
- }
- if (!self$$1.menu) {
- menu = self$$1.state.get('menu') || [];
- self$$1.classes.add('opened');
- if (menu.length) {
- menu = {
- type: 'menu',
- animate: true,
- items: menu
- };
- } else {
- menu.type = menu.type || 'menu';
- menu.animate = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var MenuButton = Button.extend({
+ init: function (settings) {
+ var self$$1 = this;
+ self$$1._renderOpen = true;
+ self$$1._super(settings);
+ settings = self$$1.settings;
+ self$$1.classes.add('menubtn');
+ if (settings.fixedWidth) {
+ self$$1.classes.add('fixed-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">- if (!menu.renderTo) {
- self$$1.menu = global$11.create(menu).parent(self$$1).renderTo();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.aria('haspopup', true);
+ self$$1.state.set('menu', settings.menu || self$$1.render());
+ },
+ showMenu: function (toggle) {
+ var self$$1 = this;
+ var menu;
+ if (self$$1.menu && self$$1.menu.visible() && toggle !== false) {
+ return self$$1.hideMenu();
+ }
+ if (!self$$1.menu) {
+ menu = self$$1.state.get('menu') || [];
+ self$$1.classes.add('opened');
+ if (menu.length) {
+ menu = {
+ type: 'menu',
+ animate: true,
+ items: menu
+ };
+ } else {
+ menu.type = menu.type || 'menu';
+ menu.animate = true;
+ }
+ if (!menu.renderTo) {
+ self$$1.menu = global$b.create(menu).parent(self$$1).renderTo();
+ } else {
+ self$$1.menu = menu.parent(self$$1).show().renderTo();
+ }
+ self$$1.fire('createmenu');
+ self$$1.menu.reflow();
+ self$$1.menu.on('cancel', function (e) {
+ if (e.control.parent() === self$$1.menu) {
+ e.stopPropagation();
+ self$$1.focus();
+ self$$1.hideMenu();
+ }
+ });
+ self$$1.menu.on('select', function () {
+ self$$1.focus();
+ });
+ self$$1.menu.on('show hide', function (e) {
+ if (e.type === 'hide' && e.control.parent() === self$$1) {
+ self$$1.classes.remove('opened-under');
+ }
+ if (e.control === self$$1.menu) {
+ self$$1.activeMenu(e.type === 'show');
+ self$$1.classes.toggle('opened', e.type === 'show');
+ }
+ self$$1.aria('expanded', e.type === 'show');
+ }).fire('show');
+ }
+ self$$1.menu.show();
+ self$$1.menu.layoutRect({ w: self$$1.layoutRect().w });
+ self$$1.menu.repaint();
+ self$$1.menu.moveRel(self$$1.getEl(), self$$1.isRtl() ? [
+ 'br-tr',
+ 'tr-br'
+ ] : [
+ 'bl-tl',
+ 'tl-bl'
+ ]);
+ var menuLayoutRect = self$$1.menu.layoutRect();
+ var selfBottom = self$$1.$el.offset().top + self$$1.layoutRect().h;
+ if (selfBottom > menuLayoutRect.y && selfBottom < menuLayoutRect.y + menuLayoutRect.h) {
+ self$$1.classes.add('opened-under');
+ }
+ self$$1.fire('showmenu');
+ },
+ hideMenu: function () {
+ var self$$1 = this;
+ if (self$$1.menu) {
+ self$$1.menu.items().each(function (item) {
+ if (item.hideMenu) {
+ item.hideMenu();
+ }
+ });
+ self$$1.menu.hide();
+ }
+ },
+ activeMenu: function (state) {
+ this.classes.toggle('active', state);
+ },
+ renderHtml: function () {
+ var self$$1 = this, id = self$$1._id, prefix = self$$1.classPrefix;
+ var icon = self$$1.settings.icon, image;
+ var text = self$$1.state.get('text');
+ var textHtml = '';
+ image = self$$1.settings.image;
+ if (image) {
+ icon = 'none';
+ if (typeof image !== 'string') {
+ image = window.getSelection ? image[0] : image[1];
+ }
+ image = ' style="background-image: url(\'' + image + '\')"';
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.menu = menu.parent(self$$1).show().renderTo();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ image = '';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.fire('createmenu');
- self$$1.menu.reflow();
- self$$1.menu.on('cancel', function (e) {
- if (e.control.parent() === self$$1.menu) {
- e.stopPropagation();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (text) {
+ self$$1.classes.add('btn-has-text');
+ textHtml = '<span class="' + prefix + 'txt">' + self$$1.encode(text) + '</span>';
+ }
+ icon = self$$1.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
+ self$$1.aria('role', self$$1.parent() instanceof MenuBar ? 'menuitem' : 'button');
+ return '<div id="' + id + '" class="' + self$$1.classes + '" tabindex="-1" aria-labelledby="' + id + '">' + '<button id="' + id + '-open" role="presentation" type="button" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + textHtml + ' <i class="' + prefix + 'caret"></i>' + '</button>' + '</div>';
+ },
+ postRender: function () {
+ var self$$1 = this;
+ self$$1.on('click', function (e) {
+ if (e.control === self$$1 && isChildOf$1(e.target, self$$1.getEl())) {
</ins><span class="cx" style="display: block; padding: 0 10px"> self$$1.focus();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.hideMenu();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.showMenu(!e.aria);
+ if (e.aria) {
+ self$$1.menu.items().filter(':visible')[0].focus();
+ }
</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">- self$$1.menu.on('select', function () {
- self$$1.focus();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.on('mouseenter', function (e) {
+ var overCtrl = e.control;
+ var parent$$1 = self$$1.parent();
+ var hasVisibleSiblingMenu;
+ if (overCtrl && parent$$1 && overCtrl instanceof MenuButton && overCtrl.parent() === parent$$1) {
+ parent$$1.items().filter('MenuButton').each(function (ctrl) {
+ if (ctrl.hideMenu && ctrl !== overCtrl) {
+ if (ctrl.menu && ctrl.menu.visible()) {
+ hasVisibleSiblingMenu = true;
+ }
+ ctrl.hideMenu();
+ }
+ });
+ if (hasVisibleSiblingMenu) {
+ overCtrl.focus();
+ overCtrl.showMenu();
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.menu.on('show hide', function (e) {
- if (e.control === self$$1.menu) {
- self$$1.activeMenu(e.type === 'show');
- self$$1.classes.toggle('opened', e.type === 'show');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$1._super();
+ },
+ bindStates: function () {
+ var self$$1 = this;
+ self$$1.state.on('change:menu', function () {
+ if (self$$1.menu) {
+ self$$1.menu.remove();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.aria('expanded', e.type === 'show');
- }).fire('show');
- }
- self$$1.menu.show();
- self$$1.menu.layoutRect({ w: self$$1.layoutRect().w });
- self$$1.menu.repaint();
- self$$1.menu.moveRel(self$$1.getEl(), self$$1.isRtl() ? [
- 'br-tr',
- 'tr-br'
- ] : [
- 'bl-tl',
- 'tl-bl'
- ]);
- self$$1.fire('showmenu');
- },
- hideMenu: function () {
- var self$$1 = this;
- if (self$$1.menu) {
- self$$1.menu.items().each(function (item) {
- if (item.hideMenu) {
- item.hideMenu();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.menu = 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">- self$$1.menu.hide();
- }
- },
- activeMenu: function (state) {
- this.classes.toggle('active', state);
- },
- renderHtml: function () {
- var self$$1 = this, id = self$$1._id, prefix = self$$1.classPrefix;
- var icon = self$$1.settings.icon, image;
- var text = self$$1.state.get('text');
- var textHtml = '';
- image = self$$1.settings.image;
- if (image) {
- icon = 'none';
- if (typeof image !== 'string') {
- image = window.getSelection ? image[0] : image[1];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$1._super();
+ },
+ remove: function () {
+ this._super();
+ if (this.menu) {
+ this.menu.remove();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- image = ' style="background-image: url(\'' + image + '\')"';
- } else {
- image = '';
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (text) {
- self$$1.classes.add('btn-has-text');
- textHtml = '<span class="' + prefix + 'txt">' + self$$1.encode(text) + '</span>';
- }
- icon = self$$1.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
- self$$1.aria('role', self$$1.parent() instanceof MenuBar ? 'menuitem' : 'button');
- return '<div id="' + id + '" class="' + self$$1.classes + '" tabindex="-1" aria-labelledby="' + id + '">' + '<button id="' + id + '-open" role="presentation" type="button" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + textHtml + ' <i class="' + prefix + 'caret"></i>' + '</button>' + '</div>';
- },
- postRender: function () {
- var self$$1 = this;
- self$$1.on('click', function (e) {
- if (e.control === self$$1 && isChildOf$1(e.target, self$$1.getEl())) {
- self$$1.focus();
- self$$1.showMenu(!e.aria);
- if (e.aria) {
- self$$1.menu.items().filter(':visible')[0].focus();
- }
- }
- });
- self$$1.on('mouseenter', function (e) {
- var overCtrl = e.control;
- var parent$$1 = self$$1.parent();
- var hasVisibleSiblingMenu;
- if (overCtrl && parent$$1 && overCtrl instanceof MenuButton && overCtrl.parent() === parent$$1) {
- parent$$1.items().filter('MenuButton').each(function (ctrl) {
- if (ctrl.hideMenu && ctrl !== overCtrl) {
- if (ctrl.menu && ctrl.menu.visible()) {
- hasVisibleSiblingMenu = true;
- }
- ctrl.hideMenu();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ function Throbber (elm, inline) {
+ var self = this;
+ var state;
+ var classPrefix = Control$1.classPrefix;
+ var timer;
+ self.show = function (time, callback) {
+ function render() {
+ if (state) {
+ global$7(elm).append('<div class="' + classPrefix + 'throbber' + (inline ? ' ' + classPrefix + 'throbber-inline' : '') + '"></div>');
+ if (callback) {
+ 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">- });
- if (hasVisibleSiblingMenu) {
- overCtrl.focus();
- overCtrl.showMenu();
</del><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">- });
- return self$$1._super();
- },
- bindStates: function () {
- var self$$1 = this;
- self$$1.state.on('change:menu', function () {
- if (self$$1.menu) {
- self$$1.menu.remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.hide();
+ state = true;
+ if (time) {
+ timer = global$3.setTimeout(render, time);
+ } else {
+ render();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.menu = null;
- });
- return self$$1._super();
- },
- remove: function () {
- this._super();
- if (this.menu) {
- this.menu.remove();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self;
+ };
+ self.hide = function () {
+ var child = elm.lastChild;
+ global$3.clearTimeout(timer);
+ if (child && child.className.indexOf('throbber') !== -1) {
+ child.parentNode.removeChild(child);
+ }
+ state = false;
+ return self;
+ };
</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><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function Throbber (elm, inline) {
- var self = this;
- var state;
- var classPrefix = Control$1.classPrefix;
- var timer;
- self.show = function (time, callback) {
- function render() {
- if (state) {
- global$7(elm).append('<div class="' + classPrefix + 'throbber' + (inline ? ' ' + classPrefix + 'throbber-inline' : '') + '"></div>');
- if (callback) {
- callback();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Menu = FloatPanel.extend({
+ Defaults: {
+ defaultType: 'menuitem',
+ border: 1,
+ layout: 'stack',
+ role: 'application',
+ bodyRole: 'menu',
+ ariaRoot: true
+ },
+ init: function (settings) {
+ var self = this;
+ settings.autohide = true;
+ settings.constrainToViewport = true;
+ if (typeof settings.items === 'function') {
+ settings.itemsFactory = settings.items;
+ settings.items = [];
+ }
+ if (settings.itemDefaults) {
+ var items = settings.items;
+ var i = items.length;
+ while (i--) {
+ items[i] = global$4.extend({}, settings.itemDefaults, items[i]);
</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">- }
- self.hide();
- state = true;
- if (time) {
- timer = global$3.setTimeout(render, time);
- } else {
- render();
- }
- return self;
- };
- self.hide = function () {
- var child = elm.lastChild;
- global$3.clearTimeout(timer);
- if (child && child.className.indexOf('throbber') !== -1) {
- child.parentNode.removeChild(child);
- }
- state = false;
- return self;
- };
- }
-
- var Menu = FloatPanel.extend({
- Defaults: {
- defaultType: 'menuitem',
- border: 1,
- layout: 'stack',
- role: 'application',
- bodyRole: 'menu',
- ariaRoot: true
- },
- init: function (settings) {
- var self = this;
- settings.autohide = true;
- settings.constrainToViewport = true;
- if (typeof settings.items === 'function') {
- settings.itemsFactory = settings.items;
- settings.items = [];
- }
- if (settings.itemDefaults) {
- var items = settings.items;
- var i = items.length;
- while (i--) {
- items[i] = global$4.extend({}, settings.itemDefaults, items[i]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._super(settings);
+ self.classes.add('menu');
+ if (settings.animate && global$1.ie !== 11) {
+ self.classes.add('animate');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- self._super(settings);
- self.classes.add('menu');
- if (settings.animate && global$1.ie !== 11) {
- self.classes.add('animate');
- }
- },
- repaint: function () {
- this.classes.toggle('menu-align', true);
- this._super();
- this.getEl().style.height = '';
- this.getEl('body').style.height = '';
- return this;
- },
- cancel: function () {
- var self = this;
- self.hideAll();
- self.fire('select');
- },
- load: function () {
- var self = this;
- var time, factory;
- function hideThrobber() {
- if (self.throbber) {
- self.throbber.hide();
- self.throbber = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ repaint: function () {
+ this.classes.toggle('menu-align', true);
+ this._super();
+ this.getEl().style.height = '';
+ this.getEl('body').style.height = '';
+ return this;
+ },
+ cancel: function () {
+ var self = this;
+ self.hideAll();
+ self.fire('select');
+ },
+ load: function () {
+ var self = this;
+ var time, factory;
+ function hideThrobber() {
+ if (self.throbber) {
+ self.throbber.hide();
+ self.throbber = 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">- }
- factory = self.settings.itemsFactory;
- if (!factory) {
- return;
- }
- if (!self.throbber) {
- self.throbber = new Throbber(self.getEl('body'), true);
- if (self.items().length === 0) {
- self.throbber.show();
- self.fire('loading');
- } else {
- self.throbber.show(100, function () {
- self.items().remove();
- self.fire('loading');
- });
- }
- self.on('hide close', hideThrobber);
- }
- self.requestTime = time = new Date().getTime();
- self.settings.itemsFactory(function (items) {
- if (items.length === 0) {
- self.hide();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ factory = self.settings.itemsFactory;
+ if (!factory) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (self.requestTime !== time) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!self.throbber) {
+ self.throbber = new Throbber(self.getEl('body'), true);
+ if (self.items().length === 0) {
+ self.throbber.show();
+ self.fire('loading');
+ } else {
+ self.throbber.show(100, function () {
+ self.items().remove();
+ self.fire('loading');
+ });
+ }
+ self.on('hide close', hideThrobber);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.getEl().style.width = '';
- self.getEl('body').style.width = '';
- hideThrobber();
- self.items().remove();
- self.getEl('body').innerHTML = '';
- self.add(items);
- self.renderNew();
- self.fire('loaded');
- });
- },
- hideAll: function () {
- var self = this;
- this.find('menuitem').exec('hideMenu');
- return self._super();
- },
- preRender: function () {
- var self = this;
- self.items().each(function (ctrl) {
- var settings = ctrl.settings;
- if (settings.icon || settings.image || settings.selectable) {
- self._hasIcons = true;
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.requestTime = time = new Date().getTime();
+ self.settings.itemsFactory(function (items) {
+ if (items.length === 0) {
+ self.hide();
+ return;
+ }
+ if (self.requestTime !== time) {
+ return;
+ }
+ self.getEl().style.width = '';
+ self.getEl('body').style.width = '';
+ hideThrobber();
+ self.items().remove();
+ self.getEl('body').innerHTML = '';
+ self.add(items);
+ self.renderNew();
+ self.fire('loaded');
+ });
+ },
+ hideAll: function () {
+ var self = this;
+ this.find('menuitem').exec('hideMenu');
+ return self._super();
+ },
+ preRender: function () {
+ var self = this;
+ self.items().each(function (ctrl) {
+ var settings = ctrl.settings;
+ if (settings.icon || settings.image || settings.selectable) {
+ self._hasIcons = true;
+ return false;
+ }
+ });
+ if (self.settings.itemsFactory) {
+ self.on('postrender', function () {
+ if (self.settings.itemsFactory) {
+ self.load();
+ }
+ });
</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 (self.settings.itemsFactory) {
- self.on('postrender', function () {
- if (self.settings.itemsFactory) {
- self.load();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.on('show hide', function (e) {
+ if (e.control === self) {
+ if (e.type === 'show') {
+ global$3.setTimeout(function () {
+ self.classes.add('in');
+ }, 0);
+ } else {
+ self.classes.remove('in');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self._super();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.on('show hide', function (e) {
- if (e.control === self) {
- if (e.type === 'show') {
- global$3.setTimeout(function () {
- self.classes.add('in');
- }, 0);
- } else {
- self.classes.remove('in');
- }
- }
- });
- return self._super();
- }
- });
</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">- var ListBox = MenuButton.extend({
- init: function (settings) {
- var self = this;
- var values, selected, selectedText, lastItemCtrl;
- function setSelected(menuValues) {
- for (var i = 0; i < menuValues.length; i++) {
- selected = menuValues[i].selected || settings.value === menuValues[i].value;
- if (selected) {
- selectedText = selectedText || menuValues[i].text;
- self.state.set('value', menuValues[i].value);
- return true;
- }
- if (menuValues[i].menu) {
- if (setSelected(menuValues[i].menu)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ListBox = MenuButton.extend({
+ init: function (settings) {
+ var self = this;
+ var values, selected, selectedText, lastItemCtrl;
+ function setSelected(menuValues) {
+ for (var i = 0; i < menuValues.length; i++) {
+ selected = menuValues[i].selected || settings.value === menuValues[i].value;
+ if (selected) {
+ selectedText = selectedText || menuValues[i].text;
+ self.state.set('value', menuValues[i].value);
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (menuValues[i].menu) {
+ if (setSelected(menuValues[i].menu)) {
+ return true;
+ }
+ }
</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">- }
- self._super(settings);
- settings = self.settings;
- self._values = values = settings.values;
- if (values) {
- if (typeof settings.value !== 'undefined') {
- setSelected(values);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._super(settings);
+ settings = self.settings;
+ self._values = values = settings.values;
+ if (values) {
+ if (typeof settings.value !== 'undefined') {
+ setSelected(values);
+ }
+ if (!selected && values.length > 0) {
+ selectedText = values[0].text;
+ self.state.set('value', values[0].value);
+ }
+ self.state.set('menu', values);
</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 (!selected && values.length > 0) {
- selectedText = values[0].text;
- self.state.set('value', values[0].value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.state.set('text', settings.text || selectedText);
+ self.classes.add('listbox');
+ self.on('select', function (e) {
+ var ctrl = e.control;
+ if (lastItemCtrl) {
+ e.lastControl = lastItemCtrl;
+ }
+ if (settings.multiple) {
+ ctrl.active(!ctrl.active());
+ } else {
+ self.value(e.control.value());
+ }
+ lastItemCtrl = ctrl;
+ });
+ },
+ value: function (value) {
+ if (arguments.length === 0) {
+ return this.state.get('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">- self.state.set('menu', values);
- }
- self.state.set('text', settings.text || selectedText);
- self.classes.add('listbox');
- self.on('select', function (e) {
- var ctrl = e.control;
- if (lastItemCtrl) {
- e.lastControl = lastItemCtrl;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (typeof value === 'undefined') {
+ return 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">- if (settings.multiple) {
- ctrl.active(!ctrl.active());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function valueExists(values) {
+ return exists(values, function (a) {
+ return a.menu ? valueExists(a.menu) : a.value === value;
+ });
+ }
+ if (this.settings.values) {
+ if (valueExists(this.settings.values)) {
+ this.state.set('value', value);
+ } else if (value === null) {
+ this.state.set('value', null);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.value(e.control.value());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.state.set('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">- lastItemCtrl = ctrl;
- });
- },
- value: function (value) {
- if (arguments.length === 0) {
- return this.state.get('value');
- }
- if (typeof value === 'undefined') {
</del><span class="cx" style="display: block; padding: 0 10px"> return this;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (this.settings.values) {
- var matchingValues = global$4.grep(this.settings.values, function (a) {
- return a.value === value;
- });
- if (matchingValues.length > 0) {
- this.state.set('value', value);
- } else if (value === null) {
- this.state.set('value', null);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ bindStates: function () {
+ var self = this;
+ function activateMenuItemsByValue(menu, value) {
+ if (menu instanceof Menu) {
+ menu.items().each(function (ctrl) {
+ if (!ctrl.hasMenus()) {
+ ctrl.active(ctrl.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">- } else {
- this.state.set('value', value);
- }
- return this;
- },
- bindStates: function () {
- var self = this;
- function activateMenuItemsByValue(menu, value) {
- if (menu instanceof Menu) {
- menu.items().each(function (ctrl) {
- if (!ctrl.hasMenus()) {
- ctrl.active(ctrl.value() === value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function getSelectedItem(menuValues, value) {
+ var selectedItem;
+ if (!menuValues) {
+ return;
+ }
+ for (var i = 0; i < menuValues.length; i++) {
+ if (menuValues[i].value === value) {
+ return menuValues[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">- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (menuValues[i].menu) {
+ selectedItem = getSelectedItem(menuValues[i].menu, value);
+ if (selectedItem) {
+ return selectedItem;
+ }
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.on('show', function (e) {
+ activateMenuItemsByValue(e.control, self.value());
+ });
+ self.state.on('change:value', function (e) {
+ var selectedItem = getSelectedItem(self.state.get('menu'), e.value);
+ if (selectedItem) {
+ self.text(selectedItem.text);
+ } else {
+ self.text(self.settings.text);
+ }
+ });
+ return self._super();
</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 getSelectedItem(menuValues, value) {
- var selectedItem;
- if (!menuValues) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var toggleTextStyle = function (ctrl, state) {
+ var textStyle = ctrl._textStyle;
+ if (textStyle) {
+ var textElm = ctrl.getEl('text');
+ textElm.setAttribute('style', textStyle);
+ if (state) {
+ textElm.style.color = '';
+ textElm.style.backgroundColor = '';
</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 i = 0; i < menuValues.length; i++) {
- if (menuValues[i].value === value) {
- return menuValues[i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ };
+ var MenuItem = Widget.extend({
+ Defaults: {
+ border: 0,
+ role: 'menuitem'
+ },
+ init: function (settings) {
+ var self = this;
+ var text;
+ self._super(settings);
+ settings = self.settings;
+ self.classes.add('menu-item');
+ if (settings.menu) {
+ self.classes.add('menu-item-expand');
+ }
+ if (settings.preview) {
+ self.classes.add('menu-item-preview');
+ }
+ text = self.state.get('text');
+ if (text === '-' || text === '|') {
+ self.classes.add('menu-item-sep');
+ self.aria('role', 'separator');
+ self.state.set('text', '-');
+ }
+ if (settings.selectable) {
+ self.aria('role', 'menuitemcheckbox');
+ self.classes.add('menu-item-checkbox');
+ settings.icon = 'selected';
+ }
+ if (!settings.preview && !settings.selectable) {
+ self.classes.add('menu-item-normal');
+ }
+ self.on('mousedown', function (e) {
+ e.preventDefault();
+ });
+ if (settings.menu && !settings.ariaHideMenu) {
+ self.aria('haspopup', true);
+ }
+ },
+ hasMenus: function () {
+ return !!this.settings.menu;
+ },
+ showMenu: function () {
+ var self = this;
+ var settings = self.settings;
+ var menu;
+ var parent = self.parent();
+ parent.items().each(function (ctrl) {
+ if (ctrl !== self) {
+ ctrl.hideMenu();
</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 (menuValues[i].menu) {
- selectedItem = getSelectedItem(menuValues[i].menu, value);
- if (selectedItem) {
- return selectedItem;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ if (settings.menu) {
+ menu = self.menu;
+ if (!menu) {
+ menu = settings.menu;
+ if (menu.length) {
+ menu = {
+ type: 'menu',
+ items: menu
+ };
+ } else {
+ menu.type = menu.type || 'menu';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (parent.settings.itemDefaults) {
+ menu.itemDefaults = parent.settings.itemDefaults;
+ }
+ menu = self.menu = global$b.create(menu).parent(self).renderTo();
+ menu.reflow();
+ menu.on('cancel', function (e) {
+ e.stopPropagation();
+ self.focus();
+ menu.hide();
+ });
+ menu.on('show hide', function (e) {
+ if (e.control.items) {
+ e.control.items().each(function (ctrl) {
+ ctrl.active(ctrl.settings.selected);
+ });
+ }
+ }).fire('show');
+ menu.on('hide', function (e) {
+ if (e.control === menu) {
+ self.classes.remove('selected');
+ }
+ });
+ menu.submenu = true;
+ } else {
+ menu.show();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ menu._parentMenu = parent;
+ menu.classes.add('menu-sub');
+ var rel = menu.testMoveRel(self.getEl(), self.isRtl() ? [
+ 'tl-tr',
+ 'bl-br',
+ 'tr-tl',
+ 'br-bl'
+ ] : [
+ 'tr-tl',
+ 'br-bl',
+ 'tl-tr',
+ 'bl-br'
+ ]);
+ menu.moveRel(self.getEl(), rel);
+ menu.rel = rel;
+ rel = 'menu-sub-' + rel;
+ menu.classes.remove(menu._lastRel).add(rel);
+ menu._lastRel = rel;
+ self.classes.add('selected');
+ self.aria('expanded', 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">- }
- self.on('show', function (e) {
- activateMenuItemsByValue(e.control, self.value());
- });
- self.state.on('change:value', function (e) {
- var selectedItem = getSelectedItem(self.state.get('menu'), e.value);
- if (selectedItem) {
- self.text(selectedItem.text);
- } else {
- self.text(self.settings.text);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ hideMenu: function () {
+ var self = this;
+ if (self.menu) {
+ self.menu.items().each(function (item) {
+ if (item.hideMenu) {
+ item.hideMenu();
+ }
+ });
+ self.menu.hide();
+ self.aria('expanded', false);
</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 self._super();
- }
- });
-
- var toggleTextStyle = function (ctrl, state) {
- var textStyle = ctrl._textStyle;
- if (textStyle) {
- var textElm = ctrl.getEl('text');
- textElm.setAttribute('style', textStyle);
- if (state) {
- textElm.style.color = '';
- textElm.style.backgroundColor = '';
- }
- }
- };
- var MenuItem = Widget.extend({
- Defaults: {
- border: 0,
- role: 'menuitem'
- },
- init: function (settings) {
- var self = this;
- var text;
- self._super(settings);
- settings = self.settings;
- self.classes.add('menu-item');
- if (settings.menu) {
- self.classes.add('menu-item-expand');
- }
- if (settings.preview) {
- self.classes.add('menu-item-preview');
- }
- text = self.state.get('text');
- if (text === '-' || text === '|') {
- self.classes.add('menu-item-sep');
- self.aria('role', 'separator');
- self.state.set('text', '-');
- }
- if (settings.selectable) {
- self.aria('role', 'menuitemcheckbox');
- self.classes.add('menu-item-checkbox');
- settings.icon = 'selected';
- }
- if (!settings.preview && !settings.selectable) {
- self.classes.add('menu-item-normal');
- }
- self.on('mousedown', function (e) {
- e.preventDefault();
- });
- if (settings.menu && !settings.ariaHideMenu) {
- self.aria('haspopup', true);
- }
- },
- hasMenus: function () {
- return !!this.settings.menu;
- },
- showMenu: function () {
- var self = this;
- var settings = self.settings;
- var menu;
- var parent = self.parent();
- parent.items().each(function (ctrl) {
- if (ctrl !== self) {
- ctrl.hideMenu();
- }
- });
- if (settings.menu) {
- menu = self.menu;
- if (!menu) {
- menu = settings.menu;
- if (menu.length) {
- menu = {
- type: 'menu',
- items: menu
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self;
+ },
+ renderHtml: function () {
+ var self = this;
+ var id = self._id;
+ var settings = self.settings;
+ var prefix = self.classPrefix;
+ var text = self.state.get('text');
+ var icon = self.settings.icon, image = '', shortcut = settings.shortcut;
+ var url = self.encode(settings.url), iconHtml = '';
+ function convertShortcut(shortcut) {
+ var i, value, replace = {};
+ if (global$1.mac) {
+ replace = {
+ alt: '⌥',
+ ctrl: '⌘',
+ shift: '⇧',
+ meta: '⌘'
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- menu.type = menu.type || 'menu';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ replace = { meta: 'Ctrl' };
</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 (parent.settings.itemDefaults) {
- menu.itemDefaults = parent.settings.itemDefaults;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ shortcut = shortcut.split('+');
+ for (i = 0; i < shortcut.length; i++) {
+ value = replace[shortcut[i].toLowerCase()];
+ if (value) {
+ shortcut[i] = 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">- menu = self.menu = global$11.create(menu).parent(self).renderTo();
- menu.reflow();
- menu.on('cancel', function (e) {
- e.stopPropagation();
- self.focus();
- menu.hide();
- });
- menu.on('show hide', function (e) {
- if (e.control.items) {
- e.control.items().each(function (ctrl) {
- ctrl.active(ctrl.settings.selected);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return shortcut.join('+');
+ }
+ function escapeRegExp(str) {
+ return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+ }
+ function markMatches(text) {
+ var match = settings.match || '';
+ return match ? text.replace(new RegExp(escapeRegExp(match), 'gi'), function (match) {
+ return '!mce~match[' + match + ']mce~match!';
+ }) : text;
+ }
+ function boldMatches(text) {
+ return text.replace(new RegExp(escapeRegExp('!mce~match['), 'g'), '<b>').replace(new RegExp(escapeRegExp(']mce~match!'), 'g'), '</b>');
+ }
+ if (icon) {
+ self.parent().classes.add('menu-has-icons');
+ }
+ if (settings.image) {
+ image = ' style="background-image: url(\'' + settings.image + '\')"';
+ }
+ if (shortcut) {
+ shortcut = convertShortcut(shortcut);
+ }
+ icon = prefix + 'ico ' + prefix + 'i-' + (self.settings.icon || 'none');
+ iconHtml = text !== '-' ? '<i class="' + icon + '"' + image + '></i>\xA0' : '';
+ text = boldMatches(self.encode(markMatches(text)));
+ url = boldMatches(self.encode(markMatches(url)));
+ return '<div id="' + id + '" class="' + self.classes + '" tabindex="-1">' + iconHtml + (text !== '-' ? '<span id="' + id + '-text" class="' + prefix + 'text">' + text + '</span>' : '') + (shortcut ? '<div id="' + id + '-shortcut" class="' + prefix + 'menu-shortcut">' + shortcut + '</div>' : '') + (settings.menu ? '<div class="' + prefix + 'caret"></div>' : '') + (url ? '<div class="' + prefix + 'menu-item-link">' + url + '</div>' : '') + '</div>';
+ },
+ postRender: function () {
+ var self = this, settings = self.settings;
+ var textStyle = settings.textStyle;
+ if (typeof textStyle === 'function') {
+ textStyle = textStyle.call(this);
+ }
+ if (textStyle) {
+ var textElm = self.getEl('text');
+ if (textElm) {
+ textElm.setAttribute('style', textStyle);
+ self._textStyle = textStyle;
+ }
+ }
+ self.on('mouseenter click', function (e) {
+ if (e.control === self) {
+ if (!settings.menu && e.type === 'click') {
+ self.fire('select');
+ global$3.requestAnimationFrame(function () {
+ self.parent().hideAll();
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ self.showMenu();
+ if (e.aria) {
+ self.menu.focus(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">- }).fire('show');
- menu.on('hide', function (e) {
- if (e.control === menu) {
- self.classes.remove('selected');
- }
- });
- menu.submenu = true;
- } else {
- menu.show();
- }
- menu._parentMenu = parent;
- menu.classes.add('menu-sub');
- var rel = menu.testMoveRel(self.getEl(), self.isRtl() ? [
- 'tl-tr',
- 'bl-br',
- 'tr-tl',
- 'br-bl'
- ] : [
- 'tr-tl',
- 'br-bl',
- 'tl-tr',
- 'bl-br'
- ]);
- menu.moveRel(self.getEl(), rel);
- menu.rel = rel;
- rel = 'menu-sub-' + rel;
- menu.classes.remove(menu._lastRel).add(rel);
- menu._lastRel = rel;
- self.classes.add('selected');
- self.aria('expanded', true);
- }
- },
- hideMenu: function () {
- var self = this;
- if (self.menu) {
- self.menu.items().each(function (item) {
- if (item.hideMenu) {
- item.hideMenu();
</del><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">- self.menu.hide();
- self.aria('expanded', false);
- }
- return self;
- },
- renderHtml: function () {
- var self = this;
- var id = self._id;
- var settings = self.settings;
- var prefix = self.classPrefix;
- var text = self.state.get('text');
- var icon = self.settings.icon, image = '', shortcut = settings.shortcut;
- var url = self.encode(settings.url), iconHtml = '';
- function convertShortcut(shortcut) {
- var i, value, replace = {};
- if (global$1.mac) {
- replace = {
- alt: '⌥',
- ctrl: '⌘',
- shift: '⇧',
- meta: '⌘'
- };
- } else {
- replace = { meta: 'Ctrl' };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._super();
+ return self;
+ },
+ hover: function () {
+ var self = this;
+ self.parent().items().each(function (ctrl) {
+ ctrl.classes.remove('selected');
+ });
+ self.classes.toggle('selected', true);
+ return self;
+ },
+ active: function (state) {
+ toggleTextStyle(this, state);
+ if (typeof state !== 'undefined') {
+ this.aria('checked', 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">- shortcut = shortcut.split('+');
- for (i = 0; i < shortcut.length; i++) {
- value = replace[shortcut[i].toLowerCase()];
- if (value) {
- shortcut[i] = value;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this._super(state);
+ },
+ remove: function () {
+ this._super();
+ if (this.menu) {
+ this.menu.remove();
</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 shortcut.join('+');
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function escapeRegExp(str) {
- return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var Radio = Checkbox.extend({
+ Defaults: {
+ classes: 'radio',
+ role: 'radio'
</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 markMatches(text) {
- var match = settings.match || '';
- return match ? text.replace(new RegExp(escapeRegExp(match), 'gi'), function (match) {
- return '!mce~match[' + match + ']mce~match!';
- }) : text;
- }
- function boldMatches(text) {
- return text.replace(new RegExp(escapeRegExp('!mce~match['), 'g'), '<b>').replace(new RegExp(escapeRegExp(']mce~match!'), 'g'), '</b>');
- }
- if (icon) {
- self.parent().classes.add('menu-has-icons');
- }
- if (settings.image) {
- image = ' style="background-image: url(\'' + settings.image + '\')"';
- }
- if (shortcut) {
- shortcut = convertShortcut(shortcut);
- }
- icon = prefix + 'ico ' + prefix + 'i-' + (self.settings.icon || 'none');
- iconHtml = text !== '-' ? '<i class="' + icon + '"' + image + '></i>\xA0' : '';
- text = boldMatches(self.encode(markMatches(text)));
- url = boldMatches(self.encode(markMatches(url)));
- return '<div id="' + id + '" class="' + self.classes + '" tabindex="-1">' + iconHtml + (text !== '-' ? '<span id="' + id + '-text" class="' + prefix + 'text">' + text + '</span>' : '') + (shortcut ? '<div id="' + id + '-shortcut" class="' + prefix + 'menu-shortcut">' + shortcut + '</div>' : '') + (settings.menu ? '<div class="' + prefix + 'caret"></div>' : '') + (url ? '<div class="' + prefix + 'menu-item-link">' + url + '</div>' : '') + '</div>';
- },
- postRender: function () {
- var self = this, settings = self.settings;
- var textStyle = settings.textStyle;
- if (typeof textStyle === 'function') {
- textStyle = textStyle.call(this);
- }
- if (textStyle) {
- var textElm = self.getEl('text');
- if (textElm) {
- textElm.setAttribute('style', textStyle);
- self._textStyle = textStyle;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var ResizeHandle = Widget.extend({
+ renderHtml: function () {
+ var self = this, prefix = self.classPrefix;
+ self.classes.add('resizehandle');
+ if (self.settings.direction === 'both') {
+ self.classes.add('resizehandle-both');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- self.on('mouseenter click', function (e) {
- if (e.control === self) {
- if (!settings.menu && e.type === 'click') {
- self.fire('select');
- global$3.requestAnimationFrame(function () {
- self.parent().hideAll();
- });
- } else {
- self.showMenu();
- if (e.aria) {
- self.menu.focus(true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.canFocus = false;
+ return '<div id="' + self._id + '" class="' + self.classes + '">' + '<i class="' + prefix + 'ico ' + prefix + 'i-resize"></i>' + '</div>';
+ },
+ postRender: function () {
+ var self = this;
+ self._super();
+ self.resizeDragHelper = new DragHelper(this._id, {
+ start: function () {
+ self.fire('ResizeStart');
+ },
+ drag: function (e) {
+ if (self.settings.direction !== 'both') {
+ e.deltaX = 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.fire('Resize', e);
+ },
+ stop: function () {
+ self.fire('ResizeEnd');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ },
+ remove: function () {
+ if (this.resizeDragHelper) {
+ this.resizeDragHelper.destroy();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self._super();
- return self;
- },
- hover: function () {
- var self = this;
- self.parent().items().each(function (ctrl) {
- ctrl.classes.remove('selected');
- });
- self.classes.toggle('selected', true);
- return self;
- },
- active: function (state) {
- toggleTextStyle(this, state);
- if (typeof state !== 'undefined') {
- this.aria('checked', state);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this._super();
</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 this._super(state);
- },
- remove: function () {
- this._super();
- if (this.menu) {
- this.menu.remove();
- }
- }
- });
</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">- var Radio = Checkbox.extend({
- Defaults: {
- classes: 'radio',
- role: 'radio'
- }
- });
-
- var ResizeHandle = Widget.extend({
- renderHtml: function () {
- var self = this, prefix = self.classPrefix;
- self.classes.add('resizehandle');
- if (self.settings.direction === 'both') {
- self.classes.add('resizehandle-both');
- }
- self.canFocus = false;
- return '<div id="' + self._id + '" class="' + self.classes + '">' + '<i class="' + prefix + 'ico ' + prefix + 'i-resize"></i>' + '</div>';
- },
- postRender: function () {
- var self = this;
- self._super();
- self.resizeDragHelper = new DragHelper(this._id, {
- start: function () {
- self.fire('ResizeStart');
- },
- drag: function (e) {
- if (self.settings.direction !== 'both') {
- e.deltaX = 0;
- }
- self.fire('Resize', e);
- },
- stop: function () {
- self.fire('ResizeEnd');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function createOptions(options) {
+ var strOptions = '';
+ if (options) {
+ for (var i = 0; i < options.length; i++) {
+ strOptions += '<option value="' + options[i] + '">' + options[i] + '</option>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- },
- remove: function () {
- if (this.resizeDragHelper) {
- this.resizeDragHelper.destroy();
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return this._super();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return strOptions;
</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 createOptions(options) {
- var strOptions = '';
- if (options) {
- for (var i = 0; i < options.length; i++) {
- strOptions += '<option value="' + options[i] + '">' + options[i] + '</option>';
- }
- }
- return strOptions;
- }
- var SelectBox = Widget.extend({
- Defaults: {
- classes: 'selectbox',
- role: 'selectbox',
- options: []
- },
- init: function (settings) {
- var self = this;
- self._super(settings);
- if (self.settings.size) {
- self.size = self.settings.size;
- }
- if (self.settings.options) {
- self._options = self.settings.options;
- }
- self.on('keydown', function (e) {
- var rootControl;
- if (e.keyCode === 13) {
- e.preventDefault();
- self.parents().reverse().each(function (ctrl) {
- if (ctrl.toJSON) {
- rootControl = ctrl;
- return false;
- }
- });
- self.fire('submit', { data: rootControl.toJSON() });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var SelectBox = Widget.extend({
+ Defaults: {
+ classes: 'selectbox',
+ role: 'selectbox',
+ options: []
+ },
+ init: function (settings) {
+ var self = this;
+ self._super(settings);
+ if (self.settings.size) {
+ self.size = self.settings.size;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- },
- options: function (state) {
- if (!arguments.length) {
- return this.state.get('options');
- }
- this.state.set('options', state);
- return this;
- },
- renderHtml: function () {
- var self = this;
- var options, size = '';
- options = createOptions(self._options);
- if (self.size) {
- size = ' size = "' + self.size + '"';
- }
- return '<select id="' + self._id + '" class="' + self.classes + '"' + size + '>' + options + '</select>';
- },
- bindStates: function () {
- var self = this;
- self.state.on('change:options', function (e) {
- self.getEl().innerHTML = createOptions(e.value);
- });
- return self._super();
- }
- });
-
- function constrain(value, minVal, maxVal) {
- if (value < minVal) {
- value = minVal;
- }
- if (value > maxVal) {
- value = maxVal;
- }
- return value;
- }
- function setAriaProp(el, name, value) {
- el.setAttribute('aria-' + name, value);
- }
- function updateSliderHandle(ctrl, value) {
- var maxHandlePos, shortSizeName, sizeName, stylePosName, styleValue, handleEl;
- if (ctrl.settings.orientation === 'v') {
- stylePosName = 'top';
- sizeName = 'height';
- shortSizeName = 'h';
- } else {
- stylePosName = 'left';
- sizeName = 'width';
- shortSizeName = 'w';
- }
- handleEl = ctrl.getEl('handle');
- maxHandlePos = (ctrl.layoutRect()[shortSizeName] || 100) - funcs.getSize(handleEl)[sizeName];
- styleValue = maxHandlePos * ((value - ctrl._minValue) / (ctrl._maxValue - ctrl._minValue)) + 'px';
- handleEl.style[stylePosName] = styleValue;
- handleEl.style.height = ctrl.layoutRect().h + 'px';
- setAriaProp(handleEl, 'valuenow', value);
- setAriaProp(handleEl, 'valuetext', '' + ctrl.settings.previewFilter(value));
- setAriaProp(handleEl, 'valuemin', ctrl._minValue);
- setAriaProp(handleEl, 'valuemax', ctrl._maxValue);
- }
- var Slider = Widget.extend({
- init: function (settings) {
- var self = this;
- if (!settings.previewFilter) {
- settings.previewFilter = function (value) {
- return Math.round(value * 100) / 100;
- };
- }
- self._super(settings);
- self.classes.add('slider');
- if (settings.orientation === 'v') {
- self.classes.add('vertical');
- }
- self._minValue = isNumber$1(settings.minValue) ? settings.minValue : 0;
- self._maxValue = isNumber$1(settings.maxValue) ? settings.maxValue : 100;
- self._initValue = self.state.get('value');
- },
- renderHtml: function () {
- var self = this, id = self._id, prefix = self.classPrefix;
- return '<div id="' + id + '" class="' + self.classes + '">' + '<div id="' + id + '-handle" class="' + prefix + 'slider-handle" role="slider" tabindex="-1"></div>' + '</div>';
- },
- reset: function () {
- this.value(this._initValue).repaint();
- },
- postRender: function () {
- var self = this;
- var minValue, maxValue, screenCordName, stylePosName, sizeName, shortSizeName;
- function toFraction(min, max, val) {
- return (val + min) / (max - min);
- }
- function fromFraction(min, max, val) {
- return val * (max - min) - min;
- }
- function handleKeyboard(minValue, maxValue) {
- function alter(delta) {
- var value;
- value = self.value();
- value = fromFraction(minValue, maxValue, toFraction(minValue, maxValue, value) + delta * 0.05);
- value = constrain(value, minValue, maxValue);
- self.value(value);
- self.fire('dragstart', { value: value });
- self.fire('drag', { value: value });
- self.fire('dragend', { value: value });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self.settings.options) {
+ self._options = self.settings.options;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> self.on('keydown', function (e) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- switch (e.keyCode) {
- case 37:
- case 38:
- alter(-1);
- break;
- case 39:
- case 40:
- alter(1);
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var rootControl;
+ if (e.keyCode === 13) {
+ e.preventDefault();
+ self.parents().reverse().each(function (ctrl) {
+ if (ctrl.toJSON) {
+ rootControl = ctrl;
+ return false;
+ }
+ });
+ self.fire('submit', { data: rootControl.toJSON() });
</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">- }
- function handleDrag(minValue, maxValue, handleEl) {
- var startPos, startHandlePos, maxHandlePos, handlePos, value;
- self._dragHelper = new DragHelper(self._id, {
- handle: self._id + '-handle',
- start: function (e) {
- startPos = e[screenCordName];
- startHandlePos = parseInt(self.getEl('handle').style[stylePosName], 10);
- maxHandlePos = (self.layoutRect()[shortSizeName] || 100) - funcs.getSize(handleEl)[sizeName];
- self.fire('dragstart', { value: value });
- },
- drag: function (e) {
- var delta = e[screenCordName] - startPos;
- handlePos = constrain(startHandlePos + delta, 0, maxHandlePos);
- handleEl.style[stylePosName] = handlePos + 'px';
- value = minValue + handlePos / maxHandlePos * (maxValue - minValue);
- self.value(value);
- self.tooltip().text('' + self.settings.previewFilter(value)).show().moveRel(handleEl, 'bc tc');
- self.fire('drag', { value: value });
- },
- stop: function () {
- self.tooltip().hide();
- self.fire('dragend', { value: value });
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ options: function (state) {
+ if (!arguments.length) {
+ return this.state.get('options');
+ }
+ this.state.set('options', state);
+ return this;
+ },
+ renderHtml: function () {
+ var self = this;
+ var options, size = '';
+ options = createOptions(self._options);
+ if (self.size) {
+ size = ' size = "' + self.size + '"';
+ }
+ return '<select id="' + self._id + '" class="' + self.classes + '"' + size + '>' + options + '</select>';
+ },
+ bindStates: function () {
+ var self = this;
+ self.state.on('change:options', function (e) {
+ self.getEl().innerHTML = createOptions(e.value);
</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 self._super();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- minValue = self._minValue;
- maxValue = self._maxValue;
- if (self.settings.orientation === 'v') {
- screenCordName = 'screenY';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ function constrain(value, minVal, maxVal) {
+ if (value < minVal) {
+ value = minVal;
+ }
+ if (value > maxVal) {
+ value = maxVal;
+ }
+ return value;
+ }
+ function setAriaProp(el, name, value) {
+ el.setAttribute('aria-' + name, value);
+ }
+ function updateSliderHandle(ctrl, value) {
+ var maxHandlePos, shortSizeName, sizeName, stylePosName, styleValue, handleEl;
+ if (ctrl.settings.orientation === 'v') {
</ins><span class="cx" style="display: block; padding: 0 10px"> stylePosName = 'top';
</span><span class="cx" style="display: block; padding: 0 10px"> sizeName = 'height';
</span><span class="cx" style="display: block; padding: 0 10px"> shortSizeName = 'h';
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- screenCordName = 'screenX';
</del><span class="cx" style="display: block; padding: 0 10px"> stylePosName = 'left';
</span><span class="cx" style="display: block; padding: 0 10px"> sizeName = 'width';
</span><span class="cx" style="display: block; padding: 0 10px"> shortSizeName = 'w';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self._super();
- handleKeyboard(minValue, maxValue);
- handleDrag(minValue, maxValue, self.getEl('handle'));
- },
- repaint: function () {
- this._super();
- updateSliderHandle(this, this.value());
- },
- bindStates: function () {
- var self = this;
- self.state.on('change:value', function (e) {
- updateSliderHandle(self, e.value);
- });
- return self._super();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ handleEl = ctrl.getEl('handle');
+ maxHandlePos = (ctrl.layoutRect()[shortSizeName] || 100) - funcs.getSize(handleEl)[sizeName];
+ styleValue = maxHandlePos * ((value - ctrl._minValue) / (ctrl._maxValue - ctrl._minValue)) + 'px';
+ handleEl.style[stylePosName] = styleValue;
+ handleEl.style.height = ctrl.layoutRect().h + 'px';
+ setAriaProp(handleEl, 'valuenow', value);
+ setAriaProp(handleEl, 'valuetext', '' + ctrl.settings.previewFilter(value));
+ setAriaProp(handleEl, 'valuemin', ctrl._minValue);
+ setAriaProp(handleEl, 'valuemax', ctrl._maxValue);
</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">+ var Slider = Widget.extend({
+ init: function (settings) {
+ var self = this;
+ if (!settings.previewFilter) {
+ settings.previewFilter = function (value) {
+ return Math.round(value * 100) / 100;
+ };
+ }
+ self._super(settings);
+ self.classes.add('slider');
+ if (settings.orientation === 'v') {
+ self.classes.add('vertical');
+ }
+ self._minValue = isNumber$1(settings.minValue) ? settings.minValue : 0;
+ self._maxValue = isNumber$1(settings.maxValue) ? settings.maxValue : 100;
+ self._initValue = self.state.get('value');
+ },
+ renderHtml: function () {
+ var self = this, id = self._id, prefix = self.classPrefix;
+ return '<div id="' + id + '" class="' + self.classes + '">' + '<div id="' + id + '-handle" class="' + prefix + 'slider-handle" role="slider" tabindex="-1"></div>' + '</div>';
+ },
+ reset: function () {
+ this.value(this._initValue).repaint();
+ },
+ postRender: function () {
+ var self = this;
+ var minValue, maxValue, screenCordName, stylePosName, sizeName, shortSizeName;
+ function toFraction(min, max, val) {
+ return (val + min) / (max - min);
+ }
+ function fromFraction(min, max, val) {
+ return val * (max - min) - min;
+ }
+ function handleKeyboard(minValue, maxValue) {
+ function alter(delta) {
+ var value;
+ value = self.value();
+ value = fromFraction(minValue, maxValue, toFraction(minValue, maxValue, value) + delta * 0.05);
+ value = constrain(value, minValue, maxValue);
+ self.value(value);
+ self.fire('dragstart', { value: value });
+ self.fire('drag', { value: value });
+ self.fire('dragend', { value: value });
+ }
+ self.on('keydown', function (e) {
+ switch (e.keyCode) {
+ case 37:
+ case 38:
+ alter(-1);
+ break;
+ case 39:
+ case 40:
+ alter(1);
+ break;
+ }
+ });
+ }
+ function handleDrag(minValue, maxValue, handleEl) {
+ var startPos, startHandlePos, maxHandlePos, handlePos, value;
+ self._dragHelper = new DragHelper(self._id, {
+ handle: self._id + '-handle',
+ start: function (e) {
+ startPos = e[screenCordName];
+ startHandlePos = parseInt(self.getEl('handle').style[stylePosName], 10);
+ maxHandlePos = (self.layoutRect()[shortSizeName] || 100) - funcs.getSize(handleEl)[sizeName];
+ self.fire('dragstart', { value: value });
+ },
+ drag: function (e) {
+ var delta = e[screenCordName] - startPos;
+ handlePos = constrain(startHandlePos + delta, 0, maxHandlePos);
+ handleEl.style[stylePosName] = handlePos + 'px';
+ value = minValue + handlePos / maxHandlePos * (maxValue - minValue);
+ self.value(value);
+ self.tooltip().text('' + self.settings.previewFilter(value)).show().moveRel(handleEl, 'bc tc');
+ self.fire('drag', { value: value });
+ },
+ stop: function () {
+ self.tooltip().hide();
+ self.fire('dragend', { value: value });
+ }
+ });
+ }
+ minValue = self._minValue;
+ maxValue = self._maxValue;
+ if (self.settings.orientation === 'v') {
+ screenCordName = 'screenY';
+ stylePosName = 'top';
+ sizeName = 'height';
+ shortSizeName = 'h';
+ } else {
+ screenCordName = 'screenX';
+ stylePosName = 'left';
+ sizeName = 'width';
+ shortSizeName = 'w';
+ }
+ self._super();
+ handleKeyboard(minValue, maxValue);
+ handleDrag(minValue, maxValue, self.getEl('handle'));
+ },
+ repaint: function () {
+ this._super();
+ updateSliderHandle(this, this.value());
+ },
+ bindStates: function () {
+ var self = this;
+ self.state.on('change:value', function (e) {
+ updateSliderHandle(self, e.value);
+ });
+ return self._super();
+ }
+ });
</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 Spacer = Widget.extend({
- renderHtml: function () {
- var self = this;
- self.classes.add('spacer');
- self.canFocus = false;
- return '<div id="' + self._id + '" class="' + self.classes + '"></div>';
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Spacer = Widget.extend({
+ renderHtml: function () {
+ var self = this;
+ self.classes.add('spacer');
+ self.canFocus = false;
+ return '<div id="' + self._id + '" class="' + self.classes + '"></div>';
+ }
+ });
</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 SplitButton = MenuButton.extend({
- Defaults: {
- classes: 'widget btn splitbtn',
- role: 'button'
- },
- repaint: function () {
- var self$$1 = this;
- var elm = self$$1.getEl();
- var rect = self$$1.layoutRect();
- var mainButtonElm, menuButtonElm;
- self$$1._super();
- mainButtonElm = elm.firstChild;
- menuButtonElm = elm.lastChild;
- global$7(mainButtonElm).css({
- width: rect.w - funcs.getSize(menuButtonElm).width,
- height: rect.h - 2
- });
- global$7(menuButtonElm).css({ height: rect.h - 2 });
- return self$$1;
- },
- activeMenu: function (state) {
- var self$$1 = this;
- global$7(self$$1.getEl().lastChild).toggleClass(self$$1.classPrefix + 'active', state);
- },
- renderHtml: function () {
- var self$$1 = this;
- var id = self$$1._id;
- var prefix = self$$1.classPrefix;
- var image;
- var icon = self$$1.state.get('icon');
- var text = self$$1.state.get('text');
- var settings = self$$1.settings;
- var textHtml = '', ariaPressed;
- image = settings.image;
- if (image) {
- icon = 'none';
- if (typeof image !== 'string') {
- image = window.getSelection ? image[0] : image[1];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var SplitButton = MenuButton.extend({
+ Defaults: {
+ classes: 'widget btn splitbtn',
+ role: 'button'
+ },
+ repaint: function () {
+ var self$$1 = this;
+ var elm = self$$1.getEl();
+ var rect = self$$1.layoutRect();
+ var mainButtonElm, menuButtonElm;
+ self$$1._super();
+ mainButtonElm = elm.firstChild;
+ menuButtonElm = elm.lastChild;
+ global$7(mainButtonElm).css({
+ width: rect.w - funcs.getSize(menuButtonElm).width,
+ height: rect.h - 2
+ });
+ global$7(menuButtonElm).css({ height: rect.h - 2 });
+ return self$$1;
+ },
+ activeMenu: function (state) {
+ var self$$1 = this;
+ global$7(self$$1.getEl().lastChild).toggleClass(self$$1.classPrefix + 'active', state);
+ },
+ renderHtml: function () {
+ var self$$1 = this;
+ var id = self$$1._id;
+ var prefix = self$$1.classPrefix;
+ var image;
+ var icon = self$$1.state.get('icon');
+ var text = self$$1.state.get('text');
+ var settings = self$$1.settings;
+ var textHtml = '', ariaPressed;
+ image = settings.image;
+ if (image) {
+ icon = 'none';
+ if (typeof image !== 'string') {
+ image = window.getSelection ? image[0] : image[1];
+ }
+ image = ' style="background-image: url(\'' + image + '\')"';
+ } else {
+ image = '';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- image = ' style="background-image: url(\'' + image + '\')"';
- } else {
- image = '';
- }
- icon = settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
- if (text) {
- self$$1.classes.add('btn-has-text');
- textHtml = '<span class="' + prefix + 'txt">' + self$$1.encode(text) + '</span>';
- }
- ariaPressed = typeof settings.active === 'boolean' ? ' aria-pressed="' + settings.active + '"' : '';
- return '<div id="' + id + '" class="' + self$$1.classes + '" role="button"' + ariaPressed + ' tabindex="-1">' + '<button type="button" hidefocus="1" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + textHtml + '</button>' + '<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' + (self$$1._menuBtnText ? (icon ? '\xA0' : '') + self$$1._menuBtnText : '') + ' <i class="' + prefix + 'caret"></i>' + '</button>' + '</div>';
- },
- postRender: function () {
- var self$$1 = this, onClickHandler = self$$1.settings.onclick;
- self$$1.on('click', function (e) {
- var node = e.target;
- if (e.control === this) {
- while (node) {
- if (e.aria && e.aria.key !== 'down' || node.nodeName === 'BUTTON' && node.className.indexOf('open') === -1) {
- e.stopImmediatePropagation();
- if (onClickHandler) {
- onClickHandler.call(this, e);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ icon = settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
+ if (text) {
+ self$$1.classes.add('btn-has-text');
+ textHtml = '<span class="' + prefix + 'txt">' + self$$1.encode(text) + '</span>';
+ }
+ ariaPressed = typeof settings.active === 'boolean' ? ' aria-pressed="' + settings.active + '"' : '';
+ return '<div id="' + id + '" class="' + self$$1.classes + '" role="button"' + ariaPressed + ' tabindex="-1">' + '<button type="button" hidefocus="1" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + textHtml + '</button>' + '<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' + (self$$1._menuBtnText ? (icon ? '\xA0' : '') + self$$1._menuBtnText : '') + ' <i class="' + prefix + 'caret"></i>' + '</button>' + '</div>';
+ },
+ postRender: function () {
+ var self$$1 = this, onClickHandler = self$$1.settings.onclick;
+ self$$1.on('click', function (e) {
+ var node = e.target;
+ if (e.control === this) {
+ while (node) {
+ if (e.aria && e.aria.key !== 'down' || node.nodeName === 'BUTTON' && node.className.indexOf('open') === -1) {
+ e.stopImmediatePropagation();
+ if (onClickHandler) {
+ onClickHandler.call(this, e);
+ }
+ 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;
</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">- node = node.parentNode;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- });
- delete self$$1.settings.onclick;
- return self$$1._super();
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ delete self$$1.settings.onclick;
+ return self$$1._super();
+ }
+ });
</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 StackLayout = FlowLayout.extend({
- Defaults: {
- containerClass: 'stack-layout',
- controlClass: 'stack-layout-item',
- endClass: 'break'
- },
- isNative: function () {
- return true;
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var StackLayout = FlowLayout.extend({
+ Defaults: {
+ containerClass: 'stack-layout',
+ controlClass: 'stack-layout-item',
+ endClass: 'break'
+ },
+ isNative: function () {
+ 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">- var TabPanel = Panel.extend({
- Defaults: {
- layout: 'absolute',
- defaults: { type: 'panel' }
- },
- activateTab: function (idx) {
- var activeTabElm;
- if (this.activeTabId) {
- activeTabElm = this.getEl(this.activeTabId);
- global$7(activeTabElm).removeClass(this.classPrefix + 'active');
- activeTabElm.setAttribute('aria-selected', 'false');
- }
- this.activeTabId = 't' + idx;
- activeTabElm = this.getEl('t' + idx);
- activeTabElm.setAttribute('aria-selected', 'true');
- global$7(activeTabElm).addClass(this.classPrefix + 'active');
- this.items()[idx].show().fire('showtab');
- this.reflow();
- this.items().each(function (item, i) {
- if (idx !== i) {
- item.hide();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var TabPanel = Panel.extend({
+ Defaults: {
+ layout: 'absolute',
+ defaults: { type: 'panel' }
+ },
+ activateTab: function (idx) {
+ var activeTabElm;
+ if (this.activeTabId) {
+ activeTabElm = this.getEl(this.activeTabId);
+ global$7(activeTabElm).removeClass(this.classPrefix + 'active');
+ activeTabElm.setAttribute('aria-selected', '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">- });
- },
- renderHtml: function () {
- var self = this;
- var layout = self._layout;
- var tabsHtml = '';
- var prefix = self.classPrefix;
- self.preRender();
- layout.preRender(self);
- self.items().each(function (ctrl, i) {
- var id = self._id + '-t' + i;
- ctrl.aria('role', 'tabpanel');
- ctrl.aria('labelledby', id);
- tabsHtml += '<div id="' + id + '" class="' + prefix + 'tab" ' + 'unselectable="on" role="tab" aria-controls="' + ctrl._id + '" aria-selected="false" tabIndex="-1">' + self.encode(ctrl.settings.title) + '</div>';
- });
- return '<div id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1">' + '<div id="' + self._id + '-head" class="' + prefix + 'tabs" role="tablist">' + tabsHtml + '</div>' + '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + layout.renderHtml(self) + '</div>' + '</div>';
- },
- postRender: function () {
- var self = this;
- self._super();
- self.settings.activeTab = self.settings.activeTab || 0;
- self.activateTab(self.settings.activeTab);
- this.on('click', function (e) {
- var targetParent = e.target.parentNode;
- if (targetParent && targetParent.id === self._id + '-head') {
- var i = targetParent.childNodes.length;
- while (i--) {
- if (targetParent.childNodes[i] === e.target) {
- self.activateTab(i);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.activeTabId = 't' + idx;
+ activeTabElm = this.getEl('t' + idx);
+ activeTabElm.setAttribute('aria-selected', 'true');
+ global$7(activeTabElm).addClass(this.classPrefix + 'active');
+ this.items()[idx].show().fire('showtab');
+ this.reflow();
+ this.items().each(function (item, i) {
+ if (idx !== i) {
+ item.hide();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- });
- },
- initLayoutRect: function () {
- var self = this;
- var rect, minW, minH;
- minW = funcs.getSize(self.getEl('head')).width;
- minW = minW < 0 ? 0 : minW;
- minH = 0;
- self.items().each(function (item) {
- minW = Math.max(minW, item.layoutRect().minW);
- minH = Math.max(minH, item.layoutRect().minH);
- });
- self.items().each(function (ctrl) {
- ctrl.settings.x = 0;
- ctrl.settings.y = 0;
- ctrl.settings.w = minW;
- ctrl.settings.h = minH;
- ctrl.layoutRect({
- x: 0,
- y: 0,
- w: minW,
- h: minH
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- var headH = funcs.getSize(self.getEl('head')).height;
- self.settings.minWidth = minW;
- self.settings.minHeight = minH + headH;
- rect = self._super();
- rect.deltaH += headH;
- rect.innerH = rect.h - rect.deltaH;
- return rect;
- }
- });
-
- var TextBox = Widget.extend({
- init: function (settings) {
- var self$$1 = this;
- self$$1._super(settings);
- self$$1.classes.add('textbox');
- if (settings.multiline) {
- self$$1.classes.add('multiline');
- } else {
- self$$1.on('keydown', function (e) {
- var rootControl;
- if (e.keyCode === 13) {
- e.preventDefault();
- self$$1.parents().reverse().each(function (ctrl) {
- if (ctrl.toJSON) {
- rootControl = ctrl;
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ renderHtml: function () {
+ var self = this;
+ var layout = self._layout;
+ var tabsHtml = '';
+ var prefix = self.classPrefix;
+ self.preRender();
+ layout.preRender(self);
+ self.items().each(function (ctrl, i) {
+ var id = self._id + '-t' + i;
+ ctrl.aria('role', 'tabpanel');
+ ctrl.aria('labelledby', id);
+ tabsHtml += '<div id="' + id + '" class="' + prefix + 'tab" ' + 'unselectable="on" role="tab" aria-controls="' + ctrl._id + '" aria-selected="false" tabIndex="-1">' + self.encode(ctrl.settings.title) + '</div>';
+ });
+ return '<div id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1">' + '<div id="' + self._id + '-head" class="' + prefix + 'tabs" role="tablist">' + tabsHtml + '</div>' + '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + layout.renderHtml(self) + '</div>' + '</div>';
+ },
+ postRender: function () {
+ var self = this;
+ self._super();
+ self.settings.activeTab = self.settings.activeTab || 0;
+ self.activateTab(self.settings.activeTab);
+ this.on('click', function (e) {
+ var targetParent = e.target.parentNode;
+ if (targetParent && targetParent.id === self._id + '-head') {
+ var i = targetParent.childNodes.length;
+ while (i--) {
+ if (targetParent.childNodes[i] === e.target) {
+ self.activateTab(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">- });
- self$$1.fire('submit', { data: rootControl.toJSON() });
</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><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.on('keyup', function (e) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ initLayoutRect: function () {
+ var self = this;
+ var rect, minW, minH;
+ minW = funcs.getSize(self.getEl('head')).width;
+ minW = minW < 0 ? 0 : minW;
+ minH = 0;
+ self.items().each(function (item) {
+ minW = Math.max(minW, item.layoutRect().minW);
+ minH = Math.max(minH, item.layoutRect().minH);
+ });
+ self.items().each(function (ctrl) {
+ ctrl.settings.x = 0;
+ ctrl.settings.y = 0;
+ ctrl.settings.w = minW;
+ ctrl.settings.h = minH;
+ ctrl.layoutRect({
+ x: 0,
+ y: 0,
+ w: minW,
+ h: minH
+ });
+ });
+ var headH = funcs.getSize(self.getEl('head')).height;
+ self.settings.minWidth = minW;
+ self.settings.minHeight = minH + headH;
+ rect = self._super();
+ rect.deltaH += headH;
+ rect.innerH = rect.h - rect.deltaH;
+ return rect;
+ }
+ });
+
+ var TextBox = Widget.extend({
+ init: function (settings) {
+ var self$$1 = this;
+ self$$1._super(settings);
+ self$$1.classes.add('textbox');
+ if (settings.multiline) {
+ self$$1.classes.add('multiline');
+ } else {
+ self$$1.on('keydown', function (e) {
+ var rootControl;
+ if (e.keyCode === 13) {
+ e.preventDefault();
+ self$$1.parents().reverse().each(function (ctrl) {
+ if (ctrl.toJSON) {
+ rootControl = ctrl;
+ return false;
+ }
+ });
+ self$$1.fire('submit', { data: rootControl.toJSON() });
+ }
+ });
+ self$$1.on('keyup', function (e) {
+ self$$1.state.set('value', e.target.value);
+ });
+ }
+ },
+ repaint: function () {
+ var self$$1 = this;
+ var style, rect, borderBox, borderW, borderH = 0, lastRepaintRect;
+ style = self$$1.getEl().style;
+ rect = self$$1._layoutRect;
+ lastRepaintRect = self$$1._lastRepaintRect || {};
+ var doc = document;
+ if (!self$$1.settings.multiline && doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
+ style.lineHeight = rect.h - borderH + 'px';
+ }
+ borderBox = self$$1.borderBox;
+ borderW = borderBox.left + borderBox.right + 8;
+ borderH = borderBox.top + borderBox.bottom + (self$$1.settings.multiline ? 8 : 0);
+ if (rect.x !== lastRepaintRect.x) {
+ style.left = rect.x + 'px';
+ lastRepaintRect.x = rect.x;
+ }
+ if (rect.y !== lastRepaintRect.y) {
+ style.top = rect.y + 'px';
+ lastRepaintRect.y = rect.y;
+ }
+ if (rect.w !== lastRepaintRect.w) {
+ style.width = rect.w - borderW + 'px';
+ lastRepaintRect.w = rect.w;
+ }
+ if (rect.h !== lastRepaintRect.h) {
+ style.height = rect.h - borderH + 'px';
+ lastRepaintRect.h = rect.h;
+ }
+ self$$1._lastRepaintRect = lastRepaintRect;
+ self$$1.fire('repaint', {}, false);
+ return self$$1;
+ },
+ renderHtml: function () {
+ var self$$1 = this;
+ var settings = self$$1.settings;
+ var attrs, elm;
+ attrs = {
+ id: self$$1._id,
+ hidefocus: '1'
+ };
+ global$4.each([
+ 'rows',
+ 'spellcheck',
+ 'maxLength',
+ 'size',
+ 'readonly',
+ 'min',
+ 'max',
+ 'step',
+ 'list',
+ 'pattern',
+ 'placeholder',
+ 'required',
+ 'multiple'
+ ], function (name$$1) {
+ attrs[name$$1] = settings[name$$1];
+ });
+ if (self$$1.disabled()) {
+ attrs.disabled = 'disabled';
+ }
+ if (settings.subtype) {
+ attrs.type = settings.subtype;
+ }
+ elm = funcs.create(settings.multiline ? 'textarea' : 'input', attrs);
+ elm.value = self$$1.state.get('value');
+ elm.className = self$$1.classes.toString();
+ return elm.outerHTML;
+ },
+ value: function (value) {
+ if (arguments.length) {
+ this.state.set('value', value);
+ return this;
+ }
+ if (this.state.get('rendered')) {
+ this.state.set('value', this.getEl().value);
+ }
+ return this.state.get('value');
+ },
+ postRender: function () {
+ var self$$1 = this;
+ self$$1.getEl().value = self$$1.state.get('value');
+ self$$1._super();
+ self$$1.$el.on('change', function (e) {
</ins><span class="cx" style="display: block; padding: 0 10px"> self$$1.state.set('value', e.target.value);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.fire('change', e);
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ bindStates: function () {
+ var self$$1 = this;
+ self$$1.state.on('change:value', function (e) {
+ if (self$$1.getEl().value !== e.value) {
+ self$$1.getEl().value = e.value;
+ }
+ });
+ self$$1.state.on('change:disabled', function (e) {
+ self$$1.getEl().disabled = e.value;
+ });
+ return self$$1._super();
+ },
+ remove: function () {
+ this.$el.off();
+ this._super();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- },
- repaint: function () {
- var self$$1 = this;
- var style, rect, borderBox, borderW, borderH = 0, lastRepaintRect;
- style = self$$1.getEl().style;
- rect = self$$1._layoutRect;
- lastRepaintRect = self$$1._lastRepaintRect || {};
- var doc = document;
- if (!self$$1.settings.multiline && doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
- style.lineHeight = rect.h - borderH + 'px';
- }
- borderBox = self$$1.borderBox;
- borderW = borderBox.left + borderBox.right + 8;
- borderH = borderBox.top + borderBox.bottom + (self$$1.settings.multiline ? 8 : 0);
- if (rect.x !== lastRepaintRect.x) {
- style.left = rect.x + 'px';
- lastRepaintRect.x = rect.x;
- }
- if (rect.y !== lastRepaintRect.y) {
- style.top = rect.y + 'px';
- lastRepaintRect.y = rect.y;
- }
- if (rect.w !== lastRepaintRect.w) {
- style.width = rect.w - borderW + 'px';
- lastRepaintRect.w = rect.w;
- }
- if (rect.h !== lastRepaintRect.h) {
- style.height = rect.h - borderH + 'px';
- lastRepaintRect.h = rect.h;
- }
- self$$1._lastRepaintRect = lastRepaintRect;
- self$$1.fire('repaint', {}, false);
- return self$$1;
- },
- renderHtml: function () {
- var self$$1 = this;
- var settings = self$$1.settings;
- var attrs, elm;
- attrs = {
- id: self$$1._id,
- hidefocus: '1'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var getApi = function () {
+ return {
+ Selector: Selector,
+ Collection: Collection$2,
+ ReflowQueue: ReflowQueue,
+ Control: Control$1,
+ Factory: global$b,
+ KeyboardNavigation: KeyboardNavigation,
+ Container: Container,
+ DragHelper: DragHelper,
+ Scrollable: Scrollable,
+ Panel: Panel,
+ Movable: Movable,
+ Resizable: Resizable,
+ FloatPanel: FloatPanel,
+ Window: Window$$1,
+ MessageBox: MessageBox,
+ Tooltip: Tooltip,
+ Widget: Widget,
+ Progress: Progress,
+ Notification: Notification,
+ Layout: Layout$1,
+ AbsoluteLayout: AbsoluteLayout,
+ Button: Button,
+ ButtonGroup: ButtonGroup,
+ Checkbox: Checkbox,
+ ComboBox: ComboBox,
+ ColorBox: ColorBox,
+ PanelButton: PanelButton,
+ ColorButton: ColorButton,
+ ColorPicker: ColorPicker,
+ Path: Path,
+ ElementPath: ElementPath,
+ FormItem: FormItem,
+ Form: Form,
+ FieldSet: FieldSet,
+ FilePicker: FilePicker,
+ FitLayout: FitLayout,
+ FlexLayout: FlexLayout,
+ FlowLayout: FlowLayout,
+ FormatControls: FormatControls,
+ GridLayout: GridLayout,
+ Iframe: Iframe,
+ InfoBox: InfoBox,
+ Label: Label,
+ Toolbar: Toolbar$1,
+ MenuBar: MenuBar,
+ MenuButton: MenuButton,
+ MenuItem: MenuItem,
+ Throbber: Throbber,
+ Menu: Menu,
+ ListBox: ListBox,
+ Radio: Radio,
+ ResizeHandle: ResizeHandle,
+ SelectBox: SelectBox,
+ Slider: Slider,
+ Spacer: Spacer,
+ SplitButton: SplitButton,
+ StackLayout: StackLayout,
+ TabPanel: TabPanel,
+ TextBox: TextBox,
+ DropZone: DropZone,
+ BrowseButton: BrowseButton
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global$4.each([
- 'rows',
- 'spellcheck',
- 'maxLength',
- 'size',
- 'readonly',
- 'min',
- 'max',
- 'step',
- 'list',
- 'pattern',
- 'placeholder',
- 'required',
- 'multiple'
- ], function (name$$1) {
- attrs[name$$1] = settings[name$$1];
- });
- if (self$$1.disabled()) {
- attrs.disabled = 'disabled';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var appendTo = function (target) {
+ if (target.ui) {
+ global$4.each(getApi(), function (ref, key) {
+ target.ui[key] = ref;
+ });
+ } else {
+ target.ui = getApi();
</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.subtype) {
- attrs.type = settings.subtype;
- }
- elm = funcs.create(settings.multiline ? 'textarea' : 'input', attrs);
- elm.value = self$$1.state.get('value');
- elm.className = self$$1.classes.toString();
- return elm.outerHTML;
- },
- value: function (value) {
- if (arguments.length) {
- this.state.set('value', value);
- return this;
- }
- if (this.state.get('rendered')) {
- this.state.set('value', this.getEl().value);
- }
- return this.state.get('value');
- },
- postRender: function () {
- var self$$1 = this;
- self$$1.getEl().value = self$$1.state.get('value');
- self$$1._super();
- self$$1.$el.on('change', function (e) {
- self$$1.state.set('value', e.target.value);
- self$$1.fire('change', e);
- });
- },
- bindStates: function () {
- var self$$1 = this;
- self$$1.state.on('change:value', function (e) {
- if (self$$1.getEl().value !== e.value) {
- self$$1.getEl().value = e.value;
- }
- });
- self$$1.state.on('change:disabled', function (e) {
- self$$1.getEl().disabled = e.value;
- });
- return self$$1._super();
- },
- remove: function () {
- this.$el.off();
- this._super();
- }
- });
-
- var getApi = function () {
- return {
- Selector: Selector,
- Collection: Collection$2,
- ReflowQueue: $_cqjgb518wjjgwek2f,
- Control: Control$1,
- Factory: global$11,
- KeyboardNavigation: KeyboardNavigation,
- Container: Container,
- DragHelper: DragHelper,
- Scrollable: $_8woeth19ajjgwek4b,
- Panel: Panel,
- Movable: $_8zu82i18yjjgwek2l,
- Resizable: $_20hy1119bjjgwek4f,
- FloatPanel: FloatPanel,
- Window: Window$$1,
- MessageBox: MessageBox,
- Tooltip: Tooltip,
- Widget: Widget,
- Progress: Progress,
- Notification: Notification,
- Layout: Layout$1,
- AbsoluteLayout: AbsoluteLayout,
- Button: Button,
- ButtonGroup: ButtonGroup,
- Checkbox: Checkbox,
- ComboBox: ComboBox,
- ColorBox: ColorBox,
- PanelButton: PanelButton,
- ColorButton: ColorButton,
- ColorPicker: ColorPicker,
- Path: Path,
- ElementPath: ElementPath,
- FormItem: FormItem,
- Form: Form,
- FieldSet: FieldSet,
- FilePicker: FilePicker,
- FitLayout: FitLayout,
- FlexLayout: FlexLayout,
- FlowLayout: FlowLayout,
- FormatControls: $_gg6ikw1bejjgwekc5,
- GridLayout: GridLayout,
- Iframe: Iframe,
- InfoBox: InfoBox,
- Label: Label,
- Toolbar: Toolbar$1,
- MenuBar: MenuBar,
- MenuButton: MenuButton,
- MenuItem: MenuItem,
- Throbber: Throbber,
- Menu: Menu,
- ListBox: ListBox,
- Radio: Radio,
- ResizeHandle: ResizeHandle,
- SelectBox: SelectBox,
- Slider: Slider,
- Spacer: Spacer,
- SplitButton: SplitButton,
- StackLayout: StackLayout,
- TabPanel: TabPanel,
- TextBox: TextBox,
- DropZone: DropZone,
- BrowseButton: BrowseButton
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var appendTo = function (target) {
- if (target.ui) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var registerToFactory = function () {
</ins><span class="cx" style="display: block; padding: 0 10px"> global$4.each(getApi(), function (ref, key) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- target.ui[key] = ref;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global$b.add(key, ref);
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- target.ui = getApi();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var Api = {
+ appendTo: appendTo,
+ registerToFactory: registerToFactory
+ };
+
+ Api.registerToFactory();
+ Api.appendTo(window.tinymce ? window.tinymce : {});
+ global.add('inlite', function (editor) {
+ var panel = create$3();
+ FormatControls.setup(editor);
+ Buttons.addToEditor(editor, panel);
+ return ThemeApi.get(editor, panel);
+ });
+ function Theme () {
</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 registerToFactory = function () {
- global$4.each(getApi(), function (ref, key) {
- global$11.add(key, ref);
- });
- };
- var Api = {
- appendTo: appendTo,
- registerToFactory: registerToFactory
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- Api.registerToFactory();
- Api.appendTo(window.tinymce ? window.tinymce : {});
- global.add('inlite', function (editor) {
- var panel = create$3();
- $_gg6ikw1bejjgwekc5.setup(editor);
- $_epdxt419djjgwek4l.addToEditor(editor, panel);
- return $_7y4x3k17sjjgwejyw.get(editor, panel);
- });
- function Theme () {
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Theme;
</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 Theme;
-
</del><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="trunksrcjs_enqueuesvendortinymcethemesinlitethememinjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/themes/inlite/theme.min.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/themes/inlite/theme.min.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/themes/inlite/theme.min.js 2019-01-29 20:18:33 UTC (rev 44713)
</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(){"use strict";var u,t,e,n,i,r,o=tinymce.util.Tools.resolve("tinymce.ThemeManager"),h=tinymce.util.Tools.resolve("tinymce.Env"),v=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=tinymce.util.Tools.resolve("tinymce.util.Delay"),s=function(t){return t.reduce(function(t,e){return Array.isArray(e)?t.concat(s(e)):t.concat(e)},[])},a={flatten:s},l=function(t,e){for(var n=0;n<e.length;n++){var i=(0,e[n])(t);if(i)return i}return null},d=function(t,e){return{id:t,rect:e}},f=function(t){return{x:t.left,y:t.top,w:t.width,h:t.height}},m=function(t){return{left:t.x,top:t.y,width:t.w,height:t.h,right:t.x+t.w,bottom:t.y+t.h}},g=function(t){var e=v.DOM.getViewPort();return{x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},p=function(t){var e=t.getBoundingClientRect();return g({x:e.left,y:e.top,w:Math.max(t.clientWidth,t.offsetWidth),h:Math.max(t.client
Height,t.offsetHeight)})},b=function(t,e){return p(e)},y=function(t){return p(t.getContentAreaContainer()||t.getBody())},x=function(t){var e=t.selection.getBoundingClientRect();return e?g(f(e)):null},w=function(n,i){return function(t){for(var e=0;e<i.length;e++)if(i[e].predicate(n))return d(i[e].id,b(t,n));return null}},_=function(i,r){return function(t){for(var e=0;e<i.length;e++)for(var n=0;n<r.length;n++)if(r[n].predicate(i[e]))return d(r[n].id,b(t,i[e]));return null}},C=tinymce.util.Tools.resolve("tinymce.util.Tools"),R=function(t,e){return{id:t,predicate:e}},E=function(t){return C.map(t,function(t){return R(t.id,t.predicate)})},k=function(e){return function(t){return t.selection.isCollapsed()?null:d(e,x(t))}},T=function(i,r){return function(t){var e,n=t.schema.getTextBlockElements();for(e=0;e<i.length;e++)if("TABLE"===i[e].nodeName)return null;for(e=0;e<i.length;e++)if(i[e].nodeName in n)return t.dom.isEmpty(i[e])?d(r,x(t)):null;return null}},
H=function(t){t.fire("SkinLoaded")},M=function(t){return t.fire("BeforeRenderUI")},S=tinymce.util.Tools.resolve("tinymce.EditorManager"),N=function(e){return function(t){return typeof t===e}},O=function(t){return Array.isArray(t)},D=function(t){return N("string")(t)},P=function(t){return N("number")(t)},W=function(t){return N("boolean")(t)},A=function(t){return N("function")(t)},B=(N("object"),O),L=function(t,e){if(e(t))return!0;throw new Error("Default value doesn't match requested type.")},I=function(r){return function(t,e,n){var i=t.settings;return L(n,r),e in i&&r(i[e])?i[e]:n}},z={getStringOr:I(D),getBoolOr:I(W),getNumberOr:I(P),getHandlerOr:I(A),getToolbarItemsOr:(u=B,function(t,e,n){var i,r,o,s,a,l=e in t.settings?t.settings[e]:n;return L(n,u),r=n,B(i=l)?i:D(i)?"string"==typeof(s=i)?(a=/[ ,]/,s.split(a).filter(function(t){return 0<t.length})):s:W(i)?(o=r,!1===i?[]:o)
:r})},F=tinymce.util.Tools.resolve("tinymce.geom.Rect"),U=function(t,e){return{rect:t,position:e}},V=function(t,e){return{x:e.x,y:e.y,w:t.w,h:t.h}},q=function(t,e,n,i,r){var o,s,a,l={x:i.x,y:i.y,w:i.w+(i.w<r.w+n.w?r.w:0),h:i.h+(i.h<r.h+n.h?r.h:0)};return o=F.findBestRelativePosition(r,n,l,t),n=F.clamp(n,l),o?(s=F.relativePosition(r,n,o),a=V(r,s),U(a,o)):(n=F.intersect(l,n))?((o=F.findBestRelativePosition(r,n,l,e))?(s=F.relativePosition(r,n,o),a=V(r,s)):a=V(r,n),U(a,o)):null},Y=function(t,e,n){return q(["cr-cl","cl-cr"],["bc-tc","bl-tl","br-tr"],t,e,n)},$=function(t,e,n){return q(["tc-bc","bc-tc","tl-bl","bl-tl","tr-br","br-tr","cr-cl","cl-cr"],["bc-tc","bl-tl","br-tr","cr-cl"],t,e,n)},X=function(t,e,n,i){var r;return"function"==typeof t?(r=t({elementRect:m(e),contentAreaRect:m(n),panelRect:
m(i)}),f(r)):i},j=function(t){return t.panelRect},J=function(t){return z.getToolbarItemsOr(t,"selection_toolbar",["bold","italic","|","quicklink","h2","h3","blockquote"])},G=function(t){return z.getToolbarItemsOr(t,"insert_toolbar",["quickimage","quicktable"])},K=function(t){return z.getHandlerOr(t,"inline_toolbar_position_handler",j)},Z=function(t){var e,n,i,r,o=t.settings;return o.skin_url?(i=t,r=o.skin_url,i.documentBaseURI.toAbsolute(r)):(e=o.skin,n=S.baseURL+"/skins/",e?n+e:n+"lightgray")},Q=function(t){return!1===t.settings.skin},tt=function(i,r){var t=Z(i),e=function(){var t,e,n;e=r,n=function(){t._skinLoaded=!0,H(t),e()},(t=i).initialized?n():t.on("init",n)};Q(i)?e():(v.DOM.styleSheetLoader.load(t+"/skin.min.css",e),i.contentCSS.push(t+"/content.inline.min.css"))},et=function(t){var e,n,i,r,o=t.contextToolba
rs;return a.flatten([o||[],(e=t,n="img",i="image",r="alignleft aligncenter alignright",{predicate:function(t){return e.dom.is(t,n)},id:i,items:r})])},nt=function(t,e){var n,i,r,o,s;return s=(o=t).selection.getNode(),i=o.dom.getParents(s,"*"),r=E(e),(n=l(t,[w(i[0],r),k("text"),T(i,"insert"),_(i,r)]))&&n.rect?n:null},it=function(i,r){return function(){var t,e,n;i.removed||(n=i,document.activeElement!==n.getBody())||(t=et(i),(e=nt(i,t))?r.show(i,e.id,e.rect,t):r.hide())}},rt=function(t,e){var n,i,r,o,s,a=c.throttle(it(t,e),0),l=c.throttle((r=it(n=t,i=e),function(){n.removed||i.inForm()||r()}),0),u=(o=t,s=e,function(){var t=et(o),e=nt(o,t);e&&s.reposition(o,e.id,e.rect)});t.on("blur hide ObjectResizeStart",e.hide),t.on("click",a),t.on("nodeChange mouseup",l),t.on("ResizeEditor keyup",a),t.on("ResizeWindow",u),v.DOM.bind(h.container,"scroll",u),t.on(&quo
t;remove",function(){v.DOM.unbind(h.container,"scroll",u),e.remove()}),t.shortcuts.add("Alt+F10,F10","",e.focus)},ot=function(t,e){return tt(t,function(){var n,i;rt(t,e),i=e,(n=t).shortcuts.remove("meta+k"),n.shortcuts.add("meta+k","",function(){var t=et(n),e=l(n,[k("quicklink")]);e&&i.show(n,e.id,e.rect,t)})}),{}},st=function(t,e){return t.inline?ot(t,e):function(t){throw new Error(t)}("inlite theme only supports inline mode.")},at=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},lt=function(t){return function(){return t}},ut=lt(!1),ct=lt(!0),dt=ut,ft=ct,ht=function(){return mt},mt=(i={fold:function(t,e){return t()},is:dt,isSome:dt,isNone:ft,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined
},or:n,orThunk:e,map:ht,ap:ht,each:function(){},bind:ht,flatten:ht,exists:dt,forall:ft,filter:ht,equals:t=function(t){return t.isNone()},equals_:t,toArray:function(){return[]},toString:lt("none()")},Object.freeze&&Object.freeze(i),i),gt=function(n){var t=function(){return n},e=function(){return r},i=function(t){return t(n)},r={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:ft,isNone:dt,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return gt(t(n))},ap:function(t){return t.fold(ht,function(t){return gt(t(n))})},each:function(t){t(n)},bind:i,flatten:t,exists:i,forall:i,filter:function(t){return t(n)?r:mt},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(dt,function(t){return e(n,t)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return r},pt={some:gt,none:ht,from:function(t){return null===t||t===undefined?mt:gt(t)}},vt=function(e){ret
urn function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&Array.prototype.isPrototypeOf(t)?"array":"object"===e&&String.prototype.isPrototypeOf(t)?"string":e}(t)===e}},bt=vt("function"),yt=vt("number"),xt=(r=Array.prototype.indexOf)===undefined?function(t,e){return Tt(t,e)}:function(t,e){return r.call(t,e)},wt=function(t,e){return kt(t,e).isSome()},_t=function(t,e){for(var n=t.length,i=new Array(n),r=0;r<n;r++){var o=t[r];i[r]=e(o,r,t)}return i},Ct=function(t,e){for(var n=0,i=t.length;n<i;n++)e(t[n],n,t)},Rt=function(t,e){for(var n=[],i=0,r=t.length;i<r;i++){var o=t[i];e(o,i,t)&&n.push(o)}return n},Et=function(t,e){for(var n=0,i=t.length;n<i;n++){var r=t[n];if(e(r,n,t))return pt.some(r)}return pt.none()},kt=function(t,e){for(var n=0,i=t.length;n<i;n++)if(e(t[n],n,t))return pt.some(n);return pt.none()},Tt=function(t,e){for(var n=0,i=t.lengt
h;n<i;++n)if(t[n]===e)return n;return-1},Ht=Array.prototype.push,Mt=(Array.prototype.slice,bt(Array.from)&&Array.from,0),St={id:function(){return"mceu_"+Mt++},create:function(t,e,n){var i=document.createElement(t);return v.DOM.setAttribs(i,e),"string"==typeof n?i.innerHTML=n:C.each(n,function(t){t.nodeType&&i.appendChild(t)}),i},createFragment:function(t){return v.DOM.createFragment(t)},getWindowSize:function(){return v.DOM.getViewPort()},getSize:function(t){var e,n;if(t.getBoundingClientRect){var i=t.getBoundingClientRect();e=Math.max(i.width||i.right-i.left,t.offsetWidth),n=Math.max(i.height||i.bottom-i.bottom,t.offsetHeight)}else e=t.offsetWidth,n=t.offsetHeight;return{width:e,height:n}},getPos:function(t,e){return v.DOM.getPos(t,e||St.getContainer())},getContainer:function(){return h.container?h.container:document.body},getViewPort:function(t){return v.DOM.getViewPort(t)},get:function(t){return document.getElementById(t)},addClass:function(
t,e){return v.DOM.addClass(t,e)},removeClass:function(t,e){return v.DOM.removeClass(t,e)},hasClass:function(t,e){return v.DOM.hasClass(t,e)},toggleClass:function(t,e,n){return v.DOM.toggleClass(t,e,n)},css:function(t,e,n){return v.DOM.setStyle(t,e,n)},getRuntimeStyle:function(t,e){return v.DOM.getStyle(t,e,!0)},on:function(t,e,n,i){return v.DOM.bind(t,e,n,i)},off:function(t,e,n){return v.DOM.unbind(t,e,n)},fire:function(t,e,n){return v.DOM.fire(t,e,n)},innerHtml:function(t,e){v.DOM.setHTML(t,e)}},Nt=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),Ot=tinymce.util.Tools.resolve("tinymce.util.Class"),Dt=tinymce.util.Tools.resolve("tinymce.util.EventDispatcher"),Pt=function(t){var e;if(t)return"number"==typeof t?{top:t=t||0,left:t,bottom:t,right:t}:(1===(e=(t=t.split(" ")).length)?t[1]=t[2]=t[3]=t[0]:2===e?(t[2]=t[0],t[3]=t[1]):3===e&&(t[3]=t[1]),{top:parseInt(t[0],10)||0,right:parseInt(t[1],10)||0,bottom:parseInt(t[2],10)||0,
left:parseInt(t[3],10)||0})},Wt=function(i,t){function e(t){var e=parseFloat(function(t){var e=i.ownerDocument.defaultView;if(e){var n=e.getComputedStyle(i,null);return n?(t=t.replace(/[A-Z]/g,function(t){return"-"+t}),n.getPropertyValue(t)):null}return i.currentStyle[t]}(t));return isNaN(e)?0:e}return{top:e(t+"TopWidth"),right:e(t+"RightWidth"),bottom:e(t+"BottomWidth"),left:e(t+"LeftWidth")}};function At(){}function Bt(t){this.cls=[],this.cls._map={},this.onchange=t||At,this.prefix=""}C.extend(Bt.prototype,{add:function(t){return t&&!this.contains(t)&&(this.cls._map[t]=!0,this.cls.push(t),this._change()),this},remove:function(t){if(this.contains(t)){var e=void 0;for(e=0;e<this.cls.length&&this.cls[e]!==t;e++);this.cls.splice(e,1),delete this.cls._map[t],this._change()}return this},toggle:function(t,e){var n=this.contains(t);return n!==e&&(n?this.remove(t):this.add(t),this._change()),this
},contains:function(t){return!!this.cls._map[t]},_change:function(){delete this.clsValue,this.onchange.call(this)}}),Bt.prototype.toString=function(){var t;if(this.clsValue)return this.clsValue;t="";for(var e=0;e<this.cls.length;e++)0<e&&(t+=" "),t+=this.prefix+this.cls[e];return t};var Lt,It,zt,Ft=/^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,Ut=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,Vt=/^\s*|\s*$/g,qt=Ot.extend({init:function(t){var o=this.match;function s(t,e,n){var i;function r(t){t&&e.push(t)}return r(function(e){if(e)return e=e.toLowerCase(),function(t){return"*"===e||t.type===e}}((i=Ft.exec(t.replace(Vt,"")))[1])),r(function(e){if(e)return function(t){return t._name===e}}(i[2])),r(function(n){if(n)return n=n.split("."),function
(t){for(var e=n.length;e--;)if(!t.classes.contains(n[e]))return!1;return!0}}(i[3])),r(function(n,i,r){if(n)return function(t){var e=t[n]?t[n]():"";return i?"="===i?e===r:"*="===i?0<=e.indexOf(r):"~="===i?0<=(" "+e+" ").indexOf(" "+r+" "):"!="===i?e!==r:"^="===i?0===e.indexOf(r):"$="===i&&e.substr(e.length-r.length)===r:!!r}}(i[4],i[5],i[6])),r(function(i){var e;if(i)return(i=/(?:not\((.+)\))|(.+)/i.exec(i))[1]?(e=a(i[1],[]),function(t){return!o(t,e)}):(i=i[2],function(t,e,n){return"first"===i?0===e:"last"===i?e===n-1:"even"===i?e%2==0:"odd"===i?e%2==1:!!t[i]&&t[i]()})}(i[7])),e.pseudo=!!i[7],e.direct=n,e}function a(t,e){var n,i,r,o=[];do{if(Ut.exec(""),(i=Ut.exec(t))&&(t=i[3],o.push(i[1]),i[2])){n=i[3];break}}while(i);for(n&&a(n,e),t=[],r=0;r<o.length;r++)">"!==o[r]&&a
mp;t.push(s(o[r],[],">"===o[r-1]));return e.push(t),e}this._selectors=a(t,[])},match:function(t,e){var n,i,r,o,s,a,l,u,c,d,f,h,m;for(n=0,i=(e=e||this._selectors).length;n<i;n++){for(m=t,h=0,r=(o=(s=e[n]).length)-1;0<=r;r--)for(u=s[r];m;){if(u.pseudo)for(c=d=(f=m.parent().items()).length;c--&&f[c]!==m;);for(a=0,l=u.length;a<l;a++)if(!u[a](m,c,d)){a=l+1;break}if(a===l){h++;break}if(r===o-1)break;m=m.parent()}if(h===o)return!0}return!1},find:function(t){var e,n,u=[],i=this._selectors;function c(t,e,n){var i,r,o,s,a,l=e[n];for(i=0,r=t.length;i<r;i++){for(a=t[i],o=0,s=l.length;o<s;o++)if(!l[o](a,i,r)){o=s+1;break}if(o===s)n===e.length-1?u.push(a):a.items&&c(a.items(),e,n+1);else if(l.direct)return;a.items&&c(a.items(),e,n)}}if(t.items){for(e=0,n=i.length;e<n;e++)c(t.items(),i[e],0);1<n&&(u=function(t){for(var e,n=[],i=t.length;i--;)(e=t[i]).__checked||(n.push(e),e.__checked=1);for(i=n.length;i--;)delete n[i].__checked;retu
rn n}(u))}return Lt||(Lt=qt.Collection),new Lt(u)}}),Yt=Array.prototype.push,$t=Array.prototype.slice;zt={length:0,init:function(t){t&&this.add(t)},add:function(t){return C.isArray(t)?Yt.apply(this,t):t instanceof It?this.add(t.toArray()):Yt.call(this,t),this},set:function(t){var e,n=this,i=n.length;for(n.length=0,n.add(t),e=n.length;e<i;e++)delete n[e];return n},filter:function(e){var t,n,i,r,o=[];for("string"==typeof e?(e=new qt(e),r=function(t){return e.match(t)}):r=e,t=0,n=this.length;t<n;t++)r(i=this[t])&&o.push(i);return new It(o)},slice:function(){return new It($t.apply(this,arguments))},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},each:function(t){return C.each(this,t),this},toArray:function(){return C.toArray(this)},indexOf:function(t){for(var e=this.length;e--&&this[e]!==t;);return e},reverse:function(){return new It(C.toArray(this).reverse())},hasClass:function(t){return!!this[0]&&this[0].classes.contains(t)
},prop:function(e,n){var t;return n!==undefined?(this.each(function(t){t[e]&&t[e](n)}),this):(t=this[0])&&t[e]?t[e]():void 0},exec:function(e){var n=C.toArray(arguments).slice(1);return this.each(function(t){t[e]&&t[e].apply(t,n)}),this},remove:function(){for(var t=this.length;t--;)this[t].remove();return this},addClass:function(e){return this.each(function(t){t.classes.add(e)})},removeClass:function(e){return this.each(function(t){t.classes.remove(e)})}},C.each("fire on off show hide append prepend before after reflow".split(" "),function(n){zt[n]=function(){var e=C.toArray(arguments);return this.each(function(t){n in t&&t[n].apply(t,e)}),this}}),C.each("text name disabled active selected checked visible parent value data".split(" "),function(e){zt[e]=function(t){return this.prop(e,t)}}),It=Ot.extend(zt);var Xt=qt.Collection=It,jt=function(t){this.create=t.create};jt.create=function(r,o){return new jt({create:f
unction(e,n){var i,t=function(t){e.set(n,t.value)};return e.on("change:"+n,function(t){r.set(o,t.value)}),r.on("change:"+o,t),(i=e._bindings)||(i=e._bindings=[],e.on("destroy",function(){for(var t=i.length;t--;)i[t]()})),i.push(function(){r.off("change:"+o,t)}),r.get(o)}})};var Jt=tinymce.util.Tools.resolve("tinymce.util.Observable");function Gt(t){return 0<t.nodeType}var Kt,Zt,Qt=Ot.extend({Mixins:[Jt],init:function(t){var e,n;for(e in t=t||{})(n=t[e])instanceof jt&&(t[e]=n.create(this,e));this.data=t},set:function(e,n){var i,r,o=this.data[e];if(n instanceof jt&&(n=n.create(this,e)),"object"==typeof e){for(i in e)this.set(i,e[i]);return this}return function t(e,n){var i,r;if(e===n)return!0;if(null===e||null===n)return e===n;if("object"!=typeof e||"object"!=typeof n)return e===n;if(C.isArray(n)){if(e.length!==n.length)return!1;for(i=e.length;i--;)if(!t(e[i],n[i]))return!1}if(Gt(e)||Gt(
n))return e===n;for(i in r={},n){if(!t(e[i],n[i]))return!1;r[i]=!0}for(i in e)if(!r[i]&&!t(e[i],n[i]))return!1;return!0}(o,n)||(this.data[e]=n,r={target:this,name:e,value:n,oldValue:o},this.fire("change:"+e,r),this.fire("change",r)),this},get:function(t){return this.data[t]},has:function(t){return t in this.data},bind:function(t){return jt.create(this,t)},destroy:function(){this.fire("destroy")}}),te={},ee={add:function(t){var e=t.parent();if(e){if(!e._layout||e._layout.isNative())return;te[e._id]||(te[e._id]=e),Kt||(Kt=!0,c.requestAnimationFrame(function(){var t,e;for(t in Kt=!1,te)(e=te[t]).state.get("rendered")&&e.reflow();te={}},document.body))}},remove:function(t){te[t._id]&&delete te[t._id]}},ne=function(t){return t?t.getRoot().uiContainer:null},ie={getUiContainerDelta:function(t){var e=ne(t);if(e&&"static"!==v.DOM.getStyle(e,"position",!0)){var n=v.DOM.getPos(e),i=e.scrollLeft-n.x,r=e.
scrollTop-n.y;return pt.some({x:i,y:r})}return pt.none()},setUiContainer:function(t,e){var n=v.DOM.select(t.settings.ui_container)[0];e.getRoot().uiContainer=n},getUiContainer:ne,inheritUiContainer:function(t,e){return e.uiContainer=ne(t)}},re="onmousewheel"in document,oe=!1,se=0,ae={Statics:{classPrefix:"mce-"},isRtl:function(){return Zt.rtl},classPrefix:"mce-",init:function(e){var t,n,i=this;function r(t){var e;for(t=t.split(" "),e=0;e<t.length;e++)i.classes.add(t[e])}i.settings=e=C.extend({},i.Defaults,e),i._id=e.id||"mceu_"+se++,i._aria={role:e.role},i._elmCache={},i.$=Nt,i.state=new Qt({visible:!0,active:!1,disabled:!1,value:""}),i.data=new Qt(e.data),i.classes=new Bt(function(){i.state.get("rendered")&&(i.getEl().className=this.toString())}),i.classes.prefix=i.classPrefix,(t=e.classes)&&(i.Defaults&&(n=i.Defaults.classes)&&t!==n&&r(n),r(t)),C.each("title text n
ame visible disabled active value".split(" "),function(t){t in e&&i[t](e[t])}),i.on("click",function(){if(i.disabled())return!1}),i.settings=e,i.borderBox=Pt(e.border),i.paddingBox=Pt(e.padding),i.marginBox=Pt(e.margin),e.hidden&&i.hide()},Properties:"parent,name",getContainerElm:function(){var t=ie.getUiContainer(this);return t||St.getContainer()},getParentCtrl:function(t){for(var e,n=this.getRoot().controlIdLookup;t&&n&&!(e=n[t.id]);)t=t.parentNode;return e},initLayoutRect:function(){var t,e,n,i,r,o,s,a,l,u,c=this,d=c.settings,f=c.getEl();t=c.borderBox=c.borderBox||Wt(f,"border"),c.paddingBox=c.paddingBox||Wt(f,"padding"),c.marginBox=c.marginBox||Wt(f,"margin"),u=St.getSize(f),a=d.minWidth,l=d.minHeight,r=a||u.width,o=l||u.height,n=d.width,i=d.height,s=void 0!==(s=d.autoResize)?s:!n&&!i,n=n||r,i=i||o;var h=t.left+t.right,m=t.top+t.bottom,g=d.maxWidth||65535,p=d.maxHeight||65535
;return c._layoutRect=e={x:d.x||0,y:d.y||0,w:n,h:i,deltaW:h,deltaH:m,contentW:n-h,contentH:i-m,innerW:n-h,innerH:i-m,startMinWidth:a||0,startMinHeight:l||0,minW:Math.min(r,g),minH:Math.min(o,p),maxW:g,maxH:p,autoResize:s,scrollW:0},c._lastLayoutRect={},e},layoutRect:function(t){var e,n,i,r,o,s=this,a=s._layoutRect;return a||(a=s.initLayoutRect()),t?(i=a.deltaW,r=a.deltaH,t.x!==undefined&&(a.x=t.x),t.y!==undefined&&(a.y=t.y),t.minW!==undefined&&(a.minW=t.minW),t.minH!==undefined&&(a.minH=t.minH),(n=t.w)!==undefined&&(n=(n=n<a.minW?a.minW:n)>a.maxW?a.maxW:n,a.w=n,a.innerW=n-i),(n=t.h)!==undefined&&(n=(n=n<a.minH?a.minH:n)>a.maxH?a.maxH:n,a.h=n,a.innerH=n-r),(n=t.innerW)!==undefined&&(n=(n=n<a.minW-i?a.minW-i:n)>a.maxW-i?a.maxW-i:n,a.innerW=n,a.w=n+i),(n=t.innerH)!==undefined&&(n=(n=n<a.minH-r?a.minH-r:n)>a.maxH-r?a.maxH-r:n,a.innerH=n,a.h=n+r),t.contentW!==undefined&&(a.contentW=t.contentW)
,t.contentH!==undefined&&(a.contentH=t.contentH),(e=s._lastLayoutRect).x===a.x&&e.y===a.y&&e.w===a.w&&e.h===a.h||((o=Zt.repaintControls)&&o.map&&!o.map[s._id]&&(o.push(s),o.map[s._id]=!0),e.x=a.x,e.y=a.y,e.w=a.w,e.h=a.h),s):a},repaint:function(){var t,e,n,i,r,o,s,a,l,u,c=this;l=document.createRange?function(t){return t}:Math.round,t=c.getEl().style,i=c._layoutRect,a=c._lastRepaintRect||{},o=(r=c.borderBox).left+r.right,s=r.top+r.bottom,i.x!==a.x&&(t.left=l(i.x)+"px",a.x=i.x),i.y!==a.y&&(t.top=l(i.y)+"px",a.y=i.y),i.w!==a.w&&(u=l(i.w-o),t.width=(0<=u?u:0)+"px",a.w=i.w),i.h!==a.h&&(u=l(i.h-s),t.height=(0<=u?u:0)+"px",a.h=i.h),c._hasBody&&i.innerW!==a.innerW&&(u=l(i.innerW),(n=c.getEl("body"))&&((e=n.style).width=(0<=u?u:0)+"px"),a.innerW=i.innerW),c._hasBody&&i.innerH!==a.innerH&&(u=l(i.inne
rH),(n=n||c.getEl("body"))&&((e=e||n.style).height=(0<=u?u:0)+"px"),a.innerH=i.innerH),c._lastRepaintRect=a,c.fire("repaint",{},!1)},updateLayoutRect:function(){var t=this;t.parent()._lastRect=null,St.css(t.getEl(),{width:"",height:""}),t._layoutRect=t._lastRepaintRect=t._lastLayoutRect=null,t.initLayoutRect()},on:function(t,e){var n,i,r,o=this;return le(o).on(t,"string"!=typeof(n=e)?n:function(t){return i||o.parentsAndSelf().each(function(t){var e=t.settings.callbacks;if(e&&(i=e[n]))return r=t,!1}),i?i.call(r,t):(t.action=n,void this.fire("execute",t))}),o},off:function(t,e){return le(this).off(t,e),this},fire:function(t,e,n){if((e=e||{}).control||(e.control=this),e=le(this).fire(t,e),!1!==n&&this.parent)for(var i=this.parent();i&&!e.isPropagationStopped();)i.fire(t,e,!1),i=i.parent();return e},hasEventListeners:function(t){return le(this).has(t)},parents:function(t){var e,n=new
Xt;for(e=this.parent();e;e=e.parent())n.add(e);return t&&(n=n.filter(t)),n},parentsAndSelf:function(t){return new Xt(this).add(this.parents(t))},next:function(){var t=this.parent().items();return t[t.indexOf(this)+1]},prev:function(){var t=this.parent().items();return t[t.indexOf(this)-1]},innerHtml:function(t){return this.$el.html(t),this},getEl:function(t){var e=t?this._id+"-"+t:this._id;return this._elmCache[e]||(this._elmCache[e]=Nt("#"+e)[0]),this._elmCache[e]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(t){}return this},blur:function(){return this.getEl().blur(),this},aria:function(t,e){var n=this,i=n.getEl(n.ariaTarget);return void 0===e?n._aria[t]:(n._aria[t]=e,n.state.get("rendered")&&i.setAttribute("role"===t?t:"aria-"+t,e),n)},encode:function(t,e){return!1!==e&&(t=this.translate(t)),(t||"").replace(/[&am
p;<>"]/g,function(t){return"&#"+t.charCodeAt(0)+";"})},translate:function(t){return Zt.translate?Zt.translate(t):t},before:function(t){var e=this.parent();return e&&e.insert(t,e.items().indexOf(this),!0),this},after:function(t){var e=this.parent();return e&&e.insert(t,e.items().indexOf(this)),this},remove:function(){var e,t,n=this,i=n.getEl(),r=n.parent();if(n.items){var o=n.items().toArray();for(t=o.length;t--;)o[t].remove()}r&&r.items&&(e=[],r.items().each(function(t){t!==n&&e.push(t)}),r.items().set(e),r._lastRect=null),n._eventsRoot&&n._eventsRoot===n&&Nt(i).off();var s=n.getRoot().controlIdLookup;return s&&delete s[n._id],i&&i.parentNode&&i.parentNode.removeChild(i),n.state.set("rendered",!1),n.state.destroy(),n.fire("remove"),n},renderBefore:function(t){return Nt(t).before(this.renderHtml()),this.postRender(),this},renderTo:function(t){return N
t(t||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'"></div>'},postRender:function(){var t,e,n,i,r,o=this,s=o.settings;for(i in o.$el=Nt(o.getEl()),o.state.set("rendered",!0),s)0===i.indexOf("on")&&o.on(i.substr(2),s[i]);if(o._eventsRoot){for(n=o.parent();!r&&n;n=n.parent())r=n._eventsRoot;if(r)for(i in r._nativeEvents)o._nativeEvents[i]=!0}ue(o),s.style&&(t=o.getEl())&&(t.setAttribute("style",s.style),t.style.cssText=s.style),o.settings.border&&(e=o.borderBox,o.$el.css({"border-top-width":e.top,"border-right-width":e.right,"border-bottom-width":e.bottom,"border-left-width":e.left}));var a=o.getRoot();for(var l in a.controlIdLookup||(a.controlIdLookup={}),(a.controlIdLookup[o._id]=o)._aria)o.aria(l,o.
_aria[l]);!1===o.state.get("visible")&&(o.getEl().style.display="none"),o.bindStates(),o.state.on("change:visible",function(t){var e,n=t.value;o.state.get("rendered")&&(o.getEl().style.display=!1===n?"none":"",o.getEl().getBoundingClientRect()),(e=o.parent())&&(e._lastRect=null),o.fire(n?"show":"hide"),ee.add(o)}),o.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(t){var e,n,i,r,o,s,a=this.getEl(),l=a.parentNode,u=function(t,e){var n,i,r=t;for(n=i=0;r&&r!==e&&r.nodeType;)n+=r.offsetLeft||0,i+=r.offsetTop||0,r=r.offsetParent;return{x:n,y:i}}(a,l);return e=u.x,n=u.y,i=a.offsetWidth,r=a.offsetHeight,o=l.clientWidth,s=l.clientHeight,"end"===t?(e-=o-i,n-=s-r):"center"===t&&(e-=o/2-i/2,n-=s/2-r/2),l.scrollLeft=e,l.scrollTop=n,this},getRoot:function(){for(var t,e=this,n=[];e;){if(e.rootControl){t=e.rootControl
;break}n.push(e),e=(t=e).parent()}t||(t=this);for(var i=n.length;i--;)n[i].rootControl=t;return t},reflow:function(){ee.remove(this);var t=this.parent();return t&&t._layout&&!t._layout.isNative()&&t.reflow(),this}};function le(n){return n._eventDispatcher||(n._eventDispatcher=new Dt({scope:n,toggleEvent:function(t,e){e&&Dt.isNative(t)&&(n._nativeEvents||(n._nativeEvents={}),n._nativeEvents[t]=!0,n.state.get("rendered")&&ue(n))}})),n._eventDispatcher}function ue(a){var t,e,n,l,i,r;function o(t){var e=a.getParentCtrl(t.target);e&&e.fire(t.type,t)}function s(){var t=l._lastHoverCtrl;t&&(t.fire("mouseleave",{target:t.getEl()}),t.parents().each(function(t){t.fire("mouseleave",{target:t.getEl()})}),l._lastHoverCtrl=null)}function u(t){var e,n,i,r=a.getParentCtrl(t.target),o=l._lastHoverCtrl,s=0;if(r!==o){if((n=(l._lastHoverCtrl=r).parents().toArray().reverse()).push(r),o){for((i=o.parents().toArr
ay().reverse()).push(o),s=0;s<i.length&&n[s]===i[s];s++);for(e=i.length-1;s<=e;e--)(o=i[e]).fire("mouseleave",{target:o.getEl()})}for(e=s;e<n.length;e++)(r=n[e]).fire("mouseenter",{target:r.getEl()})}}function c(t){t.preventDefault(),"mousewheel"===t.type?(t.deltaY=-.025*t.wheelDelta,t.wheelDeltaX&&(t.deltaX=-.025*t.wheelDeltaX)):(t.deltaX=0,t.deltaY=t.detail),t=a.fire("wheel",t)}if(i=a._nativeEvents){for((n=a.parents().toArray()).unshift(a),t=0,e=n.length;!l&&t<e;t++)l=n[t]._eventsRoot;for(l||(l=n[n.length-1]||a),a._eventsRoot=l,e=t,t=0;t<e;t++)n[t]._eventsRoot=l;var d=l._delegates;for(r in d||(d=l._delegates={}),i){if(!i)return!1;"wheel"!==r||oe?("mouseenter"===r||"mouseleave"===r?l._hasMouseEnter||(Nt(l.getEl()).on("mouseleave",s).on("mouseover",u),l._hasMouseEnter=1):d[r]||(Nt(l.getEl()).on(r,o),d[r]=!0),i[r]=!1):re?Nt(a.getEl()).on("mousewheel&qu
ot;,c):Nt(a.getEl()).on("DOMMouseScroll",c)}}}C.each("text title visible disabled active value".split(" "),function(e){ae[e]=function(t){return 0===arguments.length?this.state.get(e):(void 0!==t&&this.state.set(e,t),this)}});var ce=Zt=Ot.extend(ae),de=function(t){return"static"===St.getRuntimeStyle(t,"position")},fe=function(t){return t.state.get("fixed")};function he(t,e,n){var i,r,o,s,a,l,u,c,d,f;return d=me(),o=(r=St.getPos(e,ie.getUiContainer(t))).x,s=r.y,fe(t)&&de(document.body)&&(o-=d.x,s-=d.y),i=t.getEl(),a=(f=St.getSize(i)).width,l=f.height,u=(f=St.getSize(e)).width,c=f.height,"b"===(n=(n||"").split(""))[0]&&(s+=c),"r"===n[1]&&(o+=u),"c"===n[0]&&(s+=Math.round(c/2)),"c"===n[1]&&(o+=Math.round(u/2)),"b"===n[3]&&(s-=l),"r"===n[4]&&(o-=a),"c"===n[3]&&(
s-=Math.round(l/2)),"c"===n[4]&&(o-=Math.round(a/2)),{x:o,y:s,w:a,h:l}}var me=function(){var t=window,e=Math.max(t.pageXOffset,document.body.scrollLeft,document.documentElement.scrollLeft),n=Math.max(t.pageYOffset,document.body.scrollTop,document.documentElement.scrollTop);return{x:e,y:n,w:e+(t.innerWidth||document.documentElement.clientWidth),h:n+(t.innerHeight||document.documentElement.clientHeight)}},ge=function(t){var e,n=ie.getUiContainer(t);return n&&!fe(t)?{x:0,y:0,w:(e=n).scrollWidth-1,h:e.scrollHeight-1}:me()},pe={testMoveRel:function(t,e){for(var n=ge(this),i=0;i<e.length;i++){var r=he(this,t,e[i]);if(fe(this)){if(0<r.x&&r.x+r.w<n.w&&0<r.y&&r.y+r.h<n.h)return e[i]}else if(r.x>n.x&&r.x+r.w<n.w&&r.y>n.y&&r.y+r.h<n.h)return e[i]}return e[0]},moveRel:function(t,e){"string"!=typeof e&&(e=this.testMoveRel(t,e));var n=he(this,t,e);return this.moveTo(n.x,n.y)},mov
eBy:function(t,e){var n=this.layoutRect();return this.moveTo(n.x+t,n.y+e),this},moveTo:function(t,e){var n=this;function i(t,e,n){return t<0?0:e<t+n&&(t=e-n)<0?0:t}if(n.settings.constrainToViewport){var r=ge(this),o=n.layoutRect();t=i(t,r.w,o.w),e=i(e,r.h,o.h)}var s=ie.getUiContainer(n);return s&&de(s)&&!fe(n)&&(t-=s.scrollLeft,e-=s.scrollTop),s&&(t+=1,e+=1),n.state.get("rendered")?n.layoutRect({x:t,y:e}).repaint():(n.settings.x=t,n.settings.y=e),n.fire("move",{x:t,y:e}),n}},ve=ce.extend({Mixins:[pe],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var t=this,e=t.classPrefix;return'<div id="'+t._id+'" class="'+t.classes+'" role="presentation"><div class="'+e+'tooltip-arrow"></div><div class="'+e+'tooltip-inner">'+t.encode(t.state.get("text"))+"</div></div>"},bindStates:function(){va
r e=this;return e.state.on("change:text",function(t){e.getEl().lastChild.innerHTML=e.encode(t.value)}),e._super()},repaint:function(){var t,e;t=this.getEl().style,e=this._layoutRect,t.left=e.x+"px",t.top=e.y+"px",t.zIndex=131070}}),be=ce.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.canFocus=!0,i.tooltip&&!1!==be.tooltips&&(r.on("mouseenter",function(t){var e=r.tooltip().moveTo(-65535);if(t.control===r){var n=e.text(i.tooltip).show().testMoveRel(r.getEl(),["bc-tc","bc-tl","bc-tr"]);e.classes.toggle("tooltip-n","bc-tc"===n),e.classes.toggle("tooltip-nw","bc-tl"===n),e.classes.toggle("tooltip-ne","bc-tr"===n),e.moveRel(r.getEl(),n)}else e.hide()}),r.on("mouseleave mousedown click",function(){r.tooltip().remove(),r._tooltip=null})),r.aria("label",i.ariaLabel||i.tooltip)},tooltip:function(){return this._too
ltip||(this._tooltip=new ve({type:"tooltip"}),ie.inheritUiContainer(this,this._tooltip),this._tooltip.renderTo()),this._tooltip},postRender:function(){var t=this,e=t.settings;t._super(),t.parent()||!e.width&&!e.height||(t.initLayoutRect(),t.repaint()),e.autofocus&&t.focus()},bindStates:function(){var e=this;function n(t){e.aria("disabled",t),e.classes.toggle("disabled",t)}function i(t){e.aria("pressed",t),e.classes.toggle("active",t)}return e.state.on("change:disabled",function(t){n(t.value)}),e.state.on("change:active",function(t){i(t.value)}),e.state.get("disabled")&&n(!0),e.state.get("active")&&i(!0),e._super()},remove:function(){this._super(),this._tooltip&&(this._tooltip.remove(),this._tooltip=null)}}),ye=be.extend({Defaults:{value:0},init:function(t){this._super(t),this.classes.add("progress"),this.settings.filter||(this.settings.filter=fu
nction(t){return Math.round(t)})},renderHtml:function(){var t=this._id,e=this.classPrefix;return'<div id="'+t+'" class="'+this.classes+'"><div class="'+e+'bar-container"><div class="'+e+'bar"></div></div><div class="'+e+'text">0%</div></div>'},postRender:function(){return this._super(),this.value(this.settings.value),this},bindStates:function(){var e=this;function n(t){t=e.settings.filter(t),e.getEl().lastChild.innerHTML=t+"%",e.getEl().firstChild.firstChild.style.width=t+"%"}return e.state.on("change:value",function(t){n(t.value)}),n(e.state.get("value")),e._super()}}),xe=function(t,e){t.getEl().lastChild.textContent=e+(t.progressBar?" "+t.progressBar.value()+"%":"")},we=ce.extend({Mixins:[pe],Defaults:{classes:"widget notification"},init:function(t){var e=this;e._super(t),e.maxWidth=t.maxWidth,t.text&&
amp;e.text(t.text),t.icon&&(e.icon=t.icon),t.color&&(e.color=t.color),t.type&&e.classes.add("notification-"+t.type),t.timeout&&(t.timeout<0||0<t.timeout)&&!t.closeButton?e.closeButton=!1:(e.classes.add("has-close"),e.closeButton=!0),t.progressBar&&(e.progressBar=new ye),e.on("click",function(t){-1!==t.target.className.indexOf(e.classPrefix+"close")&&e.close()})},renderHtml:function(){var t,e=this,n=e.classPrefix,i="",r="",o="";return e.icon&&(i='<i class="'+n+"ico "+n+"i-"+e.icon+'"></i>'),t=' style="max-width: '+e.maxWidth+"px;"+(e.color?"background-color: "+e.color+';"':'"'),e.closeButton&&(r='<button type="button" class="'+n+'close" aria-hidden="true">\xd7</button>'),e.progressBar&&(o=e.progressBar.renderHtml(
)),'<div id="'+e._id+'" class="'+e.classes+'"'+t+' role="presentation">'+i+'<div class="'+n+'notification-inner">'+e.state.get("text")+"</div>"+o+r+'<div style="clip: rect(1px, 1px, 1px, 1px);height: 1px;overflow: hidden;position: absolute;width: 1px;" aria-live="assertive" aria-relevant="additions" aria-atomic="true"></div></div>'},postRender:function(){var t=this;return c.setTimeout(function(){t.$el.addClass(t.classPrefix+"in"),xe(t,t.state.get("text"))},100),t._super()},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().firstChild.innerHTML=t.value,xe(e,t.value)}),e.progressBar&&(e.progressBar.bindStates(),e.progressBar.state.on("change:value",function(t){xe(e,e.state.get("text"))})),e._super()},close:function(){return this.fire("close").isDefa
ultPrevented()||this.remove(),this},repaint:function(){var t,e;t=this.getEl().style,e=this._layoutRect,t.left=e.x+"px",t.top=e.y+"px",t.zIndex=65534}});function _e(o){var s=function(t){return t.inline?t.getElement():t.getContentAreaContainer()};return{open:function(t,e){var n,i=C.extend(t,{maxWidth:(n=s(o),St.getSize(n).width)}),r=new we(i);return 0<(r.args=i).timeout&&(r.timer=setTimeout(function(){r.close(),e()},i.timeout)),r.on("close",function(){e()}),r.renderTo(),r},close:function(t){t.close()},reposition:function(t){Ct(t,function(t){t.moveTo(0,0)}),function(n){if(0<n.length){var t=n.slice(0,1)[0],e=s(o);t.moveRel(e,"tc-tc"),Ct(n,function(t,e){0<e&&t.moveRel(n[e-1].getEl(),"bc-tc")})}}(t)},getArgs:function(t){return t.args}}}function Ce(t){var e,n;if(t.changedTouches)for(e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]}
function Re(t,h){var m,g,e,p,v,b,y,x=h.document||document;h=h||{};var w=x.getElementById(h.handle||t);e=function(t){var e,n,i,r,o,s,a,l,u,c,d,f=(e=x,u=Math.max,n=e.documentElement,i=e.body,r=u(n.scrollWidth,i.scrollWidth),o=u(n.clientWidth,i.clientWidth),s=u(n.offsetWidth,i.offsetWidth),a=u(n.scrollHeight,i.scrollHeight),l=u(n.clientHeight,i.clientHeight),{width:r<s?o:r,height:a<u(n.offsetHeight,i.offsetHeight)?l:a});Ce(t),t.preventDefault(),g=t.button,c=w,b=t.screenX,y=t.screenY,d=window.getComputedStyle?window.getComputedStyle(c,null).getPropertyValue("cursor"):c.runtimeStyle.cursor,m=Nt("<div></div>").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:d}).appendTo(x.body),Nt(x).on("mousemove touchmove",v).on("mouseup touchend",p),h.start(t)},v=function(t){if(Ce(t),t.button!==g)return p(t);t.deltaX=t.screenX-b,t.deltaY=t.screenY-y,t.preventDefault(),h.drag(t)}
,p=function(t){Ce(t),Nt(x).off("mousemove touchmove",v).off("mouseup touchend",p),m.remove(),h.stop&&h.stop(t)},this.destroy=function(){Nt(w).off()},Nt(w).on("mousedown touchstart",e)}var Ee=tinymce.util.Tools.resolve("tinymce.ui.Factory"),ke=function(t){return!!t.getAttribute("data-mce-tabstop")};function Te(t){var o,r,n=t.root;function i(t){return t&&1===t.nodeType}try{o=document.activeElement}catch(e){o=document.body}function s(t){return i(t=t||o)?t.getAttribute("role"):null}function a(t){for(var e,n=t||o;n=n.parentNode;)if(e=s(n))return e}function l(t){var e=o;if(i(e))return e.getAttribute("aria-"+t)}function u(t){var e=t.tagName.toUpperCase();return"INPUT"===e||"TEXTAREA"===e||"SELECT"===e}function c(e){var r=[];return function t(e){if(1===e.nodeType&&"none"!==e.style.display&&!e.disabled){var n;(u(n=e)&&!n.hidden||ke(n)||/^(butto
n|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(s(n)))&&r.push(e);for(var i=0;i<e.childNodes.length;i++)t(e.childNodes[i])}}(e||n.getEl()),r}function d(t){var e,n;(n=(t=t||r).parents().toArray()).unshift(t);for(var i=0;i<n.length&&!(e=n[i]).settings.ariaRoot;i++);return e}function f(t,e){return t<0?t=e.length-1:t>=e.length&&(t=0),e[t]&&e[t].focus(),t}function h(t,e){var n=-1,i=d();e=e||c(i.getEl());for(var r=0;r<e.length;r++)e[r]===o&&(n=r);n+=t,i.lastAriaIndex=f(n,e)}function m(){"tablist"===a()?h(-1,c(o.parentNode)):r.parent().submenu?b():h(-1)}function g(){var t=s(),e=a();"tablist"===e?h(1,c(o.parentNode)):"menuitem"===t&&"menu"===e&&l("haspopup")?y():h(1)}function p(){h(-1)}function v(){var t=s(),e=a();"menuitem"===t&&"menubar"===e?y():"button"===t&&l("haspopup")?y({key:"down&
quot;}):h(1)}function b(){r.fire("cancel")}function y(t){t=t||{},r.fire("click",{target:o,aria:t})}return r=n.getParentCtrl(o),n.on("keydown",function(t){function e(t,e){u(o)||ke(o)||"slider"!==s(o)&&!1!==e(t)&&t.preventDefault()}if(!t.isDefaultPrevented())switch(t.keyCode){case 37:e(t,m);break;case 39:e(t,g);break;case 38:e(t,p);break;case 40:e(t,v);break;case 27:b();break;case 14:case 13:case 32:e(t,y);break;case 9:!function(t){if("tablist"===a()){var e=c(r.getEl("body"))[0];e&&e.focus()}else h(t.shiftKey?-1:1)}(t),t.preventDefault()}}),n.on("focusin",function(t){o=t.target,r=t.control}),{focusFirst:function(t){var e=d(t),n=c(e.getEl());e.settings.ariaRemember&&"lastAriaIndex"in e?f(e.lastAriaIndex,n):f(0,n)}}}var He,Me,Se,Ne,Oe={},De=ce.extend({init:function(t){var e=this;e._super(t),(t=e.settings).fixed&&e.state.set("fixed",!0),e._items=new Xt,e.isRtl
()&&e.classes.add("rtl"),e.bodyClasses=new Bt(function(){e.state.get("rendered")&&(e.getEl("body").className=this.toString())}),e.bodyClasses.prefix=e.classPrefix,e.classes.add("container"),e.bodyClasses.add("container-body"),t.containerCls&&e.classes.add(t.containerCls),e._layout=Ee.create((t.layout||"")+"layout"),e.settings.items?e.add(e.settings.items):e.add(e.render()),e._hasBody=!0},items:function(){return this._items},find:function(t){return(t=Oe[t]=Oe[t]||new qt(t)).find(this)},add:function(t){return this.items().add(this.create(t)).parent(this),this},focus:function(t){var e,n,i,r=this;if(!t||!(n=r.keyboardNav||r.parents().eq(-1)[0].keyboardNav))return i=r.find("*"),r.statusbar&&i.add(r.statusbar.items()),i.each(function(t){if(t.settings.autofocus)return e=null,!1;t.canFocus&&(e=e||t)}),e&&e.focus(),r;n.focusFirst(r)},replace:function(t,e){for(var n,
i=this.items(),r=i.length;r--;)if(i[r]===t){i[r]=e;break}0<=r&&((n=e.getEl())&&n.parentNode.removeChild(n),(n=t.getEl())&&n.parentNode.removeChild(n)),e.parent(this)},create:function(t){var e,n=this,i=[];return C.isArray(t)||(t=[t]),C.each(t,function(t){t&&(t instanceof ce||("string"==typeof t&&(t={type:t}),e=C.extend({},n.settings.defaults,t),t.type=e.type=e.type||t.type||n.settings.defaultType||(e.defaults?e.defaults.type:null),t=Ee.create(e)),i.push(t))}),i},renderNew:function(){var i=this;return i.items().each(function(t,e){var n;t.parent(i),t.state.get("rendered")||((n=i.getEl("body")).hasChildNodes()&&e<=n.childNodes.length-1?Nt(n.childNodes[e]).before(t.renderHtml()):Nt(n).append(t.renderHtml()),t.postRender(),ee.add(t))}),i._layout.applyClasses(i.items().filter(":visible")),i._lastRect=null,i},append:function(t){return this.add(t).renderNew()},prepend:function(t){return this.items()
.set(this.create(t).concat(this.items().toArray())),this.renderNew()},insert:function(t,e,n){var i,r,o;return t=this.create(t),i=this.items(),!n&&e<i.length-1&&(e+=1),0<=e&&e<i.length&&(r=i.slice(0,e).toArray(),o=i.slice(e).toArray(),i.set(r.concat(t,o))),this.renderNew()},fromJSON:function(t){for(var e in t)this.find("#"+e).value(t[e]);return this},toJSON:function(){var i={};return this.find("*").each(function(t){var e=t.name(),n=t.value();e&&void 0!==n&&(i[e]=n)}),i},renderHtml:function(){var t=this,e=t._layout,n=this.settings.role;return t.preRender(),e.preRender(t),'<div id="'+t._id+'" class="'+t.classes+'"'+(n?' role="'+this.settings.role+'"':"")+'><div id="'+t._id+'-body" class="'+t.bodyClasses+'">'+(t.settings.html||"")+e.renderHtml(t)+"</div></div>"},postRender:function(){var t,e=this;return e.ite
ms().exec("postRender"),e._super(),e._layout.postRender(e),e.state.set("rendered",!0),e.settings.style&&e.$el.css(e.settings.style),e.settings.border&&(t=e.borderBox,e.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e.parent()||(e.keyboardNav=Te({root:e})),e},initLayoutRect:function(){var t=this._super();return this._layout.recalc(this),t},recalc:function(){var t=this,e=t._layoutRect,n=t._lastRect;if(!n||n.w!==e.w||n.h!==e.h)return t._layout.recalc(t),e=t.layoutRect(),t._lastRect={x:e.x,y:e.y,w:e.w,h:e.h},!0},reflow:function(){var t;if(ee.remove(this),this.visible()){for(ce.repaintControls=[],ce.repaintControls.map={},this.recalc(),t=ce.repaintControls.length;t--;)ce.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),ce.repaintControls=[]}retu
rn this}}),Pe={init:function(){this.on("repaint",this.renderScroll)},renderScroll:function(){var p=this,v=2;function n(){var m,g,t;function e(t,e,n,i,r,o){var s,a,l,u,c,d,f,h;if(a=p.getEl("scroll"+t)){if(f=e.toLowerCase(),h=n.toLowerCase(),Nt(p.getEl("absend")).css(f,p.layoutRect()[i]-1),!r)return void Nt(a).css("display","none");Nt(a).css("display","block"),s=p.getEl("body"),l=p.getEl("scroll"+t+"t"),u=s["client"+n]-2*v,c=(u-=m&&g?a["client"+o]:0)/s["scroll"+n],(d={})[f]=s["offset"+e]+v,d[h]=u,Nt(a).css(d),(d={})[f]=s["scroll"+e]*c,d[h]=u*c,Nt(l).css(d)}}t=p.getEl("body"),m=t.scrollWidth>t.clientWidth,g=t.scrollHeight>t.clientHeight,e("h","Left","Width","contentW",m,"Height"),e("v","Top","Height","contentH",g,"Width&q
uot;)}p.settings.autoScroll&&(p._hasScroll||(p._hasScroll=!0,function(){function t(s,a,l,u,c){var d,t=p._id+"-scroll"+s,e=p.classPrefix;Nt(p.getEl()).append('<div id="'+t+'" class="'+e+"scrollbar "+e+"scrollbar-"+s+'"><div id="'+t+'t" class="'+e+'scrollbar-thumb"></div></div>'),p.draghelper=new Re(t+"t",{start:function(){d=p.getEl("body")["scroll"+a],Nt("#"+t).addClass(e+"active")},drag:function(t){var e,n,i,r,o=p.layoutRect();n=o.contentW>o.innerW,i=o.contentH>o.innerH,r=p.getEl("body")["client"+l]-2*v,e=(r-=n&&i?p.getEl("scroll"+s)["client"+c]:0)/p.getEl("body")["scroll"+l],p.getEl("body")["scroll"+a]=d+t["delta"+u]/e},stop:function(){Nt("#"+t).removeClass(e+"active")}})}p.classes.add("scroll"),t(&qu
ot;v","Top","Height","Y","Width"),t("h","Left","Width","X","Height")}(),p.on("wheel",function(t){var e=p.getEl("body");e.scrollLeft+=10*(t.deltaX||0),e.scrollTop+=10*t.deltaY,n()}),Nt(p.getEl("body")).on("scroll",n)),n())}},We=De.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[Pe],renderHtml:function(){var t=this,e=t._layout,n=t.settings.html;return t.preRender(),e.preRender(t),void 0===n?n='<div id="'+t._id+'-body" class="'+t.bodyClasses+'">'+e.renderHtml(t)+"</div>":("function"==typeof n&&(n=n.call(t)),t._hasBody=!1),'<div id="'+t._id+'" class="'+t.classes+'" hidefocus="1" tabindex="-1" role="group">'+(t._preBodyHtml||"")+n+"</div>"}}),Ae={resizeToContent:function(){this._layo
utRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,e){if(t<=1||e<=1){var n=St.getWindowSize();t=t<=1?t*n.w:t,e=e<=1?e*n.h:e}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:e,w:t,h:e}).reflow()},resizeBy:function(t,e){var n=this.layoutRect();return this.resizeTo(n.w+t,n.h+e)}},Be=[],Le=[];function Ie(t,e){for(;t;){if(t===e)return!0;t=t.parent()}}function ze(){He||(He=function(t){2!==t.button&&function(t){for(var e=Be.length;e--;){var n=Be[e],i=n.getParentCtrl(t.target);if(n.settings.autohide){if(i&&(Ie(i,n)||n.parent()===i))continue;(t=n.fire("autohide",{target:t.target})).isDefaultPrevented()||n.hide()}}}(t)},Nt(document).on("click touchstart",He))}function Fe(r){var t=St.getViewPort().y;function e(t,e){for(var n,i=0;i<Be.length;i++)if(Be[i]!==r)for(n=Be[i].parent();n&&(n=n.parent());)n===r&&Be[i].fixed(t).moveBy(0,e).repaint()}r.settings.autofix&&(r.state.get("
;fixed")?r._autoFixY>t&&(r.fixed(!1).layoutRect({y:r._autoFixY}).repaint(),e(!1,r._autoFixY-t)):(r._autoFixY=r.layoutRect().y,r._autoFixY<t&&(r.fixed(!0).layoutRect({y:0}).repaint(),e(!0,t-r._autoFixY))))}function Ue(t,e){var n,i,r=Ve.zIndex||65535;if(t)Le.push(e);else for(n=Le.length;n--;)Le[n]===e&&Le.splice(n,1);if(Le.length)for(n=0;n<Le.length;n++)Le[n].modal&&(r++,i=Le[n]),Le[n].getEl().style.zIndex=r,Le[n].zIndex=r,r++;var o=Nt("#"+e.classPrefix+"modal-block",e.getContainerElm())[0];i?Nt(o).css("z-index",i.zIndex-1):o&&(o.parentNode.removeChild(o),Ne=!1),Ve.currentZIndex=r}var Ve=We.extend({Mixins:[pe,Ae],init:function(t){var i=this;i._super(t),(i._eventsRoot=i).classes.add("floatpanel"),t.autohide&&(ze(),function(){if(!Se){var t=document.documentElement,e=t.clientWidth,n=t.clientHeight;Se=function(){document.all&&e===t.clientWidth&&n===t.clientHeight||(e=t.cli
entWidth,n=t.clientHeight,Ve.hideAll())},Nt(window).on("resize",Se)}}(),Be.push(i)),t.autofix&&(Me||(Me=function(){var t;for(t=Be.length;t--;)Fe(Be[t])},Nt(window).on("scroll",Me)),i.on("move",function(){Fe(this)})),i.on("postrender show",function(t){if(t.control===i){var e,n=i.classPrefix;i.modal&&!Ne&&((e=Nt("#"+n+"modal-block",i.getContainerElm()))[0]||(e=Nt('<div id="'+n+'modal-block" class="'+n+"reset "+n+'fade"></div>').appendTo(i.getContainerElm())),c.setTimeout(function(){e.addClass(n+"in"),Nt(i.getEl()).addClass(n+"in")}),Ne=!0),Ue(!0,i)}}),i.on("show",function(){i.parents().each(function(t){if(t.state.get("fixed"))return i.fixed(!0),!1})}),t.popover&&(i._preBodyHtml='<div class="'+i.classPrefix+'arrow"></div>',i.classes.add("popover").add("bottom").add(i.isRtl(
)?"end":"start")),i.aria("label",t.ariaLabel),i.aria("labelledby",i._id),i.aria("describedby",i.describedBy||i._id+"-none")},fixed:function(t){var e=this;if(e.state.get("fixed")!==t){if(e.state.get("rendered")){var n=St.getViewPort();t?e.layoutRect().y-=n.y:e.layoutRect().y+=n.y}e.classes.toggle("fixed",t),e.state.set("fixed",t)}return e},show:function(){var t,e=this._super();for(t=Be.length;t--&&Be[t]!==this;);return-1===t&&Be.push(this),e},hide:function(){return qe(this),Ue(!1,this),this._super()},hideAll:function(){Ve.hideAll()},close:function(){return this.fire("close").isDefaultPrevented()||(this.remove(),Ue(!1,this)),this},remove:function(){qe(this),this._super()},postRender:function(){return this.settings.bodyRole&&this.getEl("body").setAttribute("role",this.settings.bodyRole),this._super()}});function qe(t){var e;for(e=Be.l
ength;e--;)Be[e]===t&&Be.splice(e,1);for(e=Le.length;e--;)Le[e]===t&&Le.splice(e,1)}Ve.hideAll=function(){for(var t=Be.length;t--;){var e=Be[t];e&&e.settings.autohide&&(e.hide(),Be.splice(t,1))}};var Ye=[],$e="";function Xe(t){var e,n=Nt("meta[name=viewport]")[0];!1!==h.overrideViewPort&&(n||((n=document.createElement("meta")).setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(n)),(e=n.getAttribute("content"))&&void 0!==$e&&($e=e),n.setAttribute("content",t?"width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0":$e))}function je(t,e){(function(){for(var t=0;t<Ye.length;t++)if(Ye[t]._fullscreen)return!0;return!1})()&&!1===e&&Nt([document.documentElement,document.body]).removeClass(t+"fullscreen")}var Je=Ve.extend({modal:!0,Defaults:{border:1,la
yout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(t){var n=this;n._super(t),n.isRtl()&&n.classes.add("rtl"),n.classes.add("window"),n.bodyClasses.add("window-body"),n.state.set("fixed",!0),t.buttons&&(n.statusbar=new We({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:t.buttons}),n.statusbar.classes.add("foot"),n.statusbar.parent(n)),n.on("click",function(t){var e=n.classPrefix+"close";(St.hasClass(t.target,e)||St.hasClass(t.target.parentNode,e))&&n.close()}),n.on("cancel",function(){n.close()}),n.on("move",function(t){t.control===n&&Ve.hideAll()}),n.aria("describedby&q
uot;,n.describedBy||n._id+"-none"),n.aria("label",t.title),n._fullscreen=!1},recalc:function(){var t,e,n,i,r=this,o=r.statusbar;r._fullscreen&&(r.layoutRect(St.getWindowSize()),r.layoutRect().contentH=r.layoutRect().innerH),r._super(),t=r.layoutRect(),r.settings.title&&!r._fullscreen&&(e=t.headerW)>t.w&&(n=t.x-Math.max(0,e/2),r.layoutRect({w:e,x:n}),i=!0),o&&(o.layoutRect({w:r.layoutRect().innerW}).recalc(),(e=o.layoutRect().minW+t.deltaW)>t.w&&(n=t.x-Math.max(0,e-t.w),r.layoutRect({w:e,x:n}),i=!0)),i&&r.recalc()},initLayoutRect:function(){var t,e=this,n=e._super(),i=0;if(e.settings.title&&!e._fullscreen){t=e.getEl("head");var r=St.getSize(t);n.headerW=r.width,n.headerH=r.height,i+=n.headerH}e.statusbar&&(i+=e.statusbar.layoutRect().h),n.deltaH+=i,n.minH+=i,n.h+=i;var o=St.getWindowSize();return n.x=e.settings.x||Math.max(0,o.w/2-n.w/2),n.y=e.settings.y||Math.max(0,o.h/2-n.h/2
),n},renderHtml:function(){var t=this,e=t._layout,n=t._id,i=t.classPrefix,r=t.settings,o="",s="",a=r.html;return t.preRender(),e.preRender(t),r.title&&(o='<div id="'+n+'-head" class="'+i+'window-head"><div id="'+n+'-title" class="'+i+'title">'+t.encode(r.title)+'</div><div id="'+n+'-dragh" class="'+i+'dragh"></div><button type="button" class="'+i+'close" aria-hidden="true"><i class="mce-ico mce-i-remove"></i></button></div>'),r.url&&(a='<iframe src="'+r.url+'" tabindex="-1"></iframe>'),void 0===a&&(a=e.renderHtml(t)),t.statusbar&&(s=t.statusbar.renderHtml()),'<div id="'+n+'" class="'+t.classes+'" hidefocus="1"><div class="'+t.classPrefix+'reset" role="application">'+o+'<div id=&q
uot;'+n+'-body" class="'+t.bodyClasses+'">'+a+"</div>"+s+"</div></div>"},fullscreen:function(t){var n,e,i=this,r=document.documentElement,o=i.classPrefix;if(t!==i._fullscreen)if(Nt(window).on("resize",function(){var t;if(i._fullscreen)if(n)i._timer||(i._timer=c.setTimeout(function(){var t=St.getWindowSize();i.moveTo(0,0).resizeTo(t.w,t.h),i._timer=0},50));else{t=(new Date).getTime();var e=St.getWindowSize();i.moveTo(0,0).resizeTo(e.w,e.h),50<(new Date).getTime()-t&&(n=!0)}}),e=i.layoutRect(),i._fullscreen=t){i._initial={x:e.x,y:e.y,w:e.w,h:e.h},i.borderBox=Pt("0"),i.getEl("head").style.display="none",e.deltaH-=e.headerH+2,Nt([r,document.body]).addClass(o+"fullscreen"),i.classes.add("fullscreen");var s=St.getWindowSize();i.moveTo(0,0).resizeTo(s.w,s.h)}else i.borderBox=Pt(i.settings.border),i.getEl("head").style.display="",e.deltaH+=e.head
erH,Nt([r,document.body]).removeClass(o+"fullscreen"),i.classes.remove("fullscreen"),i.moveTo(i._initial.x,i._initial.y).resizeTo(i._initial.w,i._initial.h);return i.reflow()},postRender:function(){var e,n=this;setTimeout(function(){n.classes.add("in"),n.fire("open")},0),n._super(),n.statusbar&&n.statusbar.postRender(),n.focus(),this.dragHelper=new Re(n._id+"-dragh",{start:function(){e={x:n.layoutRect().x,y:n.layoutRect().y}},drag:function(t){n.moveTo(e.x+t.deltaX,e.y+t.deltaY)}}),n.on("submit",function(t){t.isDefaultPrevented()||n.close()}),Ye.push(n),Xe(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var t,e=this;for(e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),je(e.classPrefix,!1),t=Ye.length;t--;)Ye[t]===e&&Ye.splice(t,1);Xe(0<Ye.length)},getContentWindow:function(){var t=this.getEl().getElementsByTagName("ifram
e")[0];return t?t.contentWindow:null}});!function(){if(!h.desktop){var n={w:window.innerWidth,h:window.innerHeight};c.setInterval(function(){var t=window.innerWidth,e=window.innerHeight;n.w===t&&n.h===e||(n={w:t,h:e},Nt(window).trigger("resize"))},100)}Nt(window).on("resize",function(){var t,e,n=St.getWindowSize();for(t=0;t<Ye.length;t++)e=Ye[t].layoutRect(),Ye[t].moveTo(Ye[t].settings.x||Math.max(0,n.w/2-e.w/2),Ye[t].settings.y||Math.max(0,n.h/2-e.h/2))})}();var Ge=Je.extend({init:function(t){t={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(t)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(t){var e,i=t.callback||function(){};function n(t,e,n){return{type:"button",text:
t,subtype:n?"primary":"",onClick:function(t){t.control.parents()[1].close(),i(e)}}}switch(t.buttons){case Ge.OK_CANCEL:e=[n("Ok",!0,!0),n("Cancel",!1)];break;case Ge.YES_NO:case Ge.YES_NO_CANCEL:e=[n("Yes",1,!0),n("No",0)],t.buttons===Ge.YES_NO_CANCEL&&e.push(n("Cancel",-1));break;default:e=[n("Ok",!0,!0)]}return new Je({padding:20,x:t.x,y:t.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:e,title:t.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:t.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:t.onClose,onCancel:function(){i(!1)}}).renderTo(document.body).reflow()},alert:function(t,e){return"string"==typeof t&&(t={text:t}),t.callback=e,Ge.msgBox(t)},confirm:function(t,e){return"string"==typeof t&&
amp;(t={text:t}),t.callback=e,t.buttons=Ge.OK_CANCEL,Ge.msgBox(t)}}}),Ke=function(t,e){return{renderUI:function(){return st(t,e)},getNotificationManagerImpl:function(){return _e(t)},getWindowManagerImpl:function(){return{open:function(n,t,e){var i;return n.title=n.title||" ",n.url=n.url||n.file,n.url&&(n.width=parseInt(n.width||320,10),n.height=parseInt(n.height||240,10)),n.body&&(n.items={defaults:n.defaults,type:n.bodyType||"form",items:n.body,data:n.data,callbacks:n.commands}),n.url||n.buttons||(n.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit()}},{text:"Cancel",onclick:function(){i.close()}}]),(i=new Je(n)).on("close",function(){e(i)}),n.data&&i.on("postRender",function(){this.find("*").each(function(t){var e=t.name();e in n.data&&t.value(n.data[e])})}),i.features=n||{},i.params=t||{},i=i.renderTo(document.body).reflow()},al
ert:function(t,e,n){var i;return(i=Ge.alert(t,function(){e()})).on("close",function(){n(i)}),i},confirm:function(t,e,n){var i;return(i=Ge.confirm(t,function(t){e(t)})).on("close",function(){n(i)}),i},close:function(t){t.close()},getParams:function(t){return t.params},setParams:function(t,e){t.params=e}}}}},Ze="undefined"!=typeof window?window:Function("return this;")(),Qe=function(t,e){return function(t,e){for(var n=e!==undefined&&null!==e?e:Ze,i=0;i<t.length&&n!==undefined&&null!==n;++i)n=n[t[i]];return n}(t.split("."),e)},tn=function(t,e){var n=Qe(t,e);if(n===undefined||null===n)throw t+" not available on this browser";return n};function en(){return new(tn("FileReader"))}var nn=tinymce.util.Tools.resolve("tinymce.util.Promise"),rn=function(n){return new nn(function(t){var e=new en;e.onloadend=function(){t(e.result.split(",")[1])},e.readAsDataURL(n)})},on=function(){
return new nn(function(e){var t;(t=document.createElement("input")).type="file",t.style.position="fixed",t.style.left=0,t.style.top=0,t.style.opacity=.001,document.body.appendChild(t),t.onchange=function(t){e(Array.prototype.slice.call(t.target.files))},t.click(),t.parentNode.removeChild(t)})},sn=0,an=function(t){return t+sn+++(e=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+Date.now().toString(36)+e()+e()+e());var e},ln=function(r,o){var s={};function t(t){var e,n,i;n=o[t?"startContainer":"endContainer"],i=o[t?"startOffset":"endOffset"],1===n.nodeType&&(e=r.create("span",{"data-mce-type":"bookmark"}),n.hasChildNodes()?(i=Math.min(i,n.childNodes.length-1),t?n.insertBefore(e,n.childNodes[i]):r.insertAfter(e,n.childNodes[i])):n.appendChild(e),n=e,i=0),s[t?"startContainer":"endContainer"]=n,s[t?"startOffset":"
;endOffset"]=i}return t(!0),o.collapsed||t(),s},un=function(r,o){function t(t){var e,n,i;e=i=o[t?"startContainer":"endContainer"],n=o[t?"startOffset":"endOffset"],e&&(1===e.nodeType&&(n=function(t){for(var e=t.parentNode.firstChild,n=0;e;){if(e===t)return n;1===e.nodeType&&"bookmark"===e.getAttribute("data-mce-type")||n++,e=e.nextSibling}return-1}(e),e=e.parentNode,r.remove(i)),o[t?"startContainer":"endContainer"]=e,o[t?"startOffset":"endOffset"]=n)}t(!0),t();var e=r.createRng();return e.setStart(o.startContainer,o.startOffset),o.endContainer&&e.setEnd(o.endContainer,o.endOffset),e},cn=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),dn=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),fn=function(t){return"A"===t.nodeName&&t.hasAttribute("href")},hn=function(t){var e,n,i,r,o,s,a,l;return r=t.s
election,o=t.dom,s=r.getRng(),a=o,l=dn.getNode(s.startContainer,s.startOffset),e=a.getParent(l,fn)||l,n=dn.getNode(s.endContainer,s.endOffset),i=t.getBody(),C.grep(function(t,e,n){var i,r,o=[];for(i=new cn(e,t),r=e;r&&(1===r.nodeType&&o.push(r),r!==n);r=i.next());return o}(i,e,n),fn)},mn=function(t){var e,n,i,r,o;n=hn(e=t),r=e.dom,o=e.selection,i=ln(r,o.getRng()),C.each(n,function(t){e.dom.remove(t,!0)}),o.setRng(un(r,i))},gn=function(t){t.selection.collapse(!1)},pn=function(t){t.focus(),mn(t),gn(t)},vn=function(t,e){var n,i,r,o,s,a=t.dom.getParent(t.selection.getStart(),"a[href]");a?(o=a,s=e,(r=t).focus(),r.dom.setAttrib(o,"href",s),gn(r)):(i=e,(n=t).execCommand("mceInsertLink",!1,{href:i}),gn(n))},bn=function(t,e,n){var i,r,o;t.plugins.table?t.plugins.table.insertTable(e,n):(r=e,o=n,(i=t).undoManager.transact(function(){var t,e;i.insertContent(function(t,e){var n,i,r;for(r='<table data-mce-id="mce" style="width: 100%&
quot;>',r+="<tbody>",i=0;i<e;i++){for(r+="<tr>",n=0;n<t;n++)r+="<td><br></td>";r+="</tr>"}return r+="</tbody>",r+="</table>"}(r,o)),(t=i.dom.select("*[data-mce-id]")[0]).removeAttribute("data-mce-id"),e=i.dom.select("td,th",t),i.selection.setCursorLocation(e[0],0)}))},yn=function(t,e){t.execCommand("FormatBlock",!1,e)},xn=function(t,e,n){var i,r;r=(i=t.editorUpload.blobCache).create(an("mceu"),n,e),i.add(r),t.insertContent(t.dom.createHTML("img",{src:r.blobUri()}))},wn=function(t,e){0===e.trim().length?pn(t):vn(t,e)},_n=pn,Cn=function(n,t){n.addButton("quicklink",{icon:"link",tooltip:"Insert/Edit link",stateSelector:"a[href]",onclick:function(){t.showForm(n,"quicklink")}}),n.addButton("quickimage",{icon:"image",tooltip:"Insert image&qu
ot;,onclick:function(){on().then(function(t){var e=t[0];rn(e).then(function(t){xn(n,t,e)})})}}),n.addButton("quicktable",{icon:"table",tooltip:"Insert table",onclick:function(){t.hide(),bn(n,2,2)}}),function(e){for(var t=function(t){return function(){yn(e,t)}},n=1;n<6;n++){var i="h"+n;e.addButton(i,{text:i.toUpperCase(),tooltip:"Heading "+n,stateSelector:i,onclick:t(i),onPostRender:function(){this.getEl().firstChild.firstChild.style.fontWeight="bold"}})}}(n)},Rn=function(){var t=h.container;if(t&&"static"!==v.DOM.getStyle(t,"position",!0)){var e=v.DOM.getPos(t),n=e.x-t.scrollLeft,i=e.y-t.scrollTop;return pt.some({x:n,y:i})}return pt.none()},En=function(t){return/^www\.|\.(com|org|edu|gov|uk|net|ca|de|jp|fr|au|us|ru|ch|it|nl|se|no|es|mil)$/i.test(t.trim())},kn=function(t){return/^https?:\/\//.test(t.trim())},Tn=function(t,e){return!kn(e)&&En(e)?(n=t,i=e,new nn(function(e){n.windowManage
r.confirm("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(t){e(!0===t?"http://"+i:i)})})):nn.resolve(e);var n,i},Hn=function(r,e){var t,n,i,o={};return t="quicklink",n={items:[{type:"button",name:"unlink",icon:"unlink",onclick:function(){r.focus(),_n(r),e()},tooltip:"Remove link"},{type:"filepicker",name:"linkurl",placeholder:"Paste or type a link",filetype:"file",onchange:function(t){var e=t.meta;e&&e.attach&&(o={href:this.value(),attach:e.attach})}},{type:"button",icon:"checkmark",subtype:"primary",tooltip:"Ok",onclick:"submit"}],onshow:function(t){if(t.control===this){var e,n="";(e=r.dom.getParent(r.selection.getStart(),"a[href]"))&&(n=r.dom.getAttrib(e,"href")),this.fromJSON({linkurl:n}),i=this.find("#un
link"),e?i.show():i.hide(),this.find("#linkurl")[0].focus()}var i},onsubmit:function(t){Tn(r,t.data.linkurl).then(function(t){r.undoManager.transact(function(){t===o.href&&(o.attach(),o={}),wn(r,t)}),e()})}},(i=Ee.create(C.extend({type:"form",layout:"flex",direction:"row",padding:5,name:t,spacing:3},n))).on("show",function(){i.find("textbox").eq(0).each(function(t){t.focus()})}),i},Mn=function(n,t,e){var o,i,s=[];if(e)return C.each(B(i=e)?i:D(i)?i.split(/[ ,]/):[],function(t){if("|"===t)o=null;else if(n.buttons[t]){o||(o={type:"buttongroup",items:[]},s.push(o));var e=n.buttons[t];A(e)&&(e=e()),e.type=e.type||"button",(e=Ee.create(e)).on("postRender",(i=n,r=e,function(){var e,t,n=(t=function(t,e){return{selector:t,handler:e}},(e=r).settings.stateSelector?t(e.settings.stateSelector,function(t){e.active(t)}):e.settings.disabledStateSelector?t(e.settings.disabledState
Selector,function(t){e.disabled(t)}):null);null!==n&&i.selection.selectorChanged(n.selector,n.handler)})),o.items.push(e)}var i,r}),Ee.create({type:"toolbar",layout:"flow",name:t,items:s})},Sn=function(){var l,c,o=function(t){return 0<t.items().length},u=function(t,e){var n,i,r=(n=t,i=e,C.map(i,function(t){return Mn(n,t.id,t.items)})).concat([Mn(t,"text",J(t)),Mn(t,"insert",G(t)),Hn(t,p)]);return Ee.create({type:"floatpanel",role:"dialog",classes:"tinymce tinymce-inline arrow",ariaLabel:"Inline toolbar",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!0,border:1,items:C.grep(r,o),oncancel:function(){t.focus()}})},d=function(t){t&&t.show()},f=function(t,e){t.moveTo(e.x,e.y)},h=function(n,i){i=i?i.substr(0,2):"",C.each({t:"down",b:"up",c:"center"},function(t,e){n.classes.toggle("arrow
-"+t,e===i.substr(0,1))}),"cr"===i?(n.classes.toggle("arrow-left",!0),n.classes.toggle("arrow-right",!1)):"cl"===i?(n.classes.toggle("arrow-left",!0),n.classes.toggle("arrow-right",!0)):C.each({l:"left",r:"right"},function(t,e){n.classes.toggle("arrow-"+t,e===i.substr(1,1))})},m=function(t,e){var n=t.items().filter("#"+e);return 0<n.length&&(n[0].show(),t.reflow(),!0)},g=function(t,e,n,i){var r,o,s,a;if(a=K(n),r=y(n),o=v.DOM.getRect(t.getEl()),s="insert"===e?Y(i,r,o):$(i,r,o)){var l=Rn().getOr({x:0,y:0}),u={x:s.rect.x-l.x,y:s.rect.y-l.y,w:s.rect.w,h:s.rect.h};return f(t,X(a,c=i,r,u)),h(t,s.position),!0}return!1},p=function(){l&&l.hide()};return{show:function(t,e,n,i){var r,o,s,a;l||(M(t),(l=u(t,i)).renderTo().reflow().moveTo(n.x,n.y),t.nodeChanged()),o=e,s=t,a=n,d(r=l),r.items().hide(),m(r,o)?!1===g(r,o,s,a)&&p():p()},showForm:function(t,e){if
(l){if(l.items().hide(),!m(l,e))return void p();var n,i,r,o=void 0;d(l),l.items().hide(),m(l,e),r=K(t),n=y(t),o=v.DOM.getRect(l.getEl()),(i=$(c,n,o))&&(o=i.rect,f(l,X(r,c,n,o)),h(l,i.position))}},reposition:function(t,e,n){l&&g(l,e,t,n)},inForm:function(){return l&&l.visible()&&0<l.items().filter("form:visible").length},hide:p,focus:function(){l&&l.find("toolbar:visible").eq(0).each(function(t){t.focus(!0)})},remove:function(){l&&(l.remove(),l=null)}}},Nn=Ot.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(t){this.settings=C.extend({},this.Defaults,t)},preRender:function(t){t.bodyClasses.add(this.settings.containerClass)},applyClasses:function(t){var e,n,i,r,o=this.settings;e=o.firstControlClass,n=o.lastControlClass,t.each(function(t){t.classes.remove(e).remove(n).add(o.controlClass),t.visible()&&(i||(i=t),r=t)}),i&&i.classes.add(e),r&&
r.classes.add(n)},renderHtml:function(t){var e="";return this.applyClasses(t.items()),t.items().each(function(t){e+=t.renderHtml()}),e},recalc:function(){},postRender:function(){},isNative:function(){return!1}}),On=Nn.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(t){t.items().filter(":visible").each(function(t){var e=t.settings;t.layoutRect({x:e.x,y:e.y,w:e.w,h:e.h}),t.recalc&&t.recalc()})},renderHtml:function(t){return'<div id="'+t._id+'-absend" class="'+t.classPrefix+'abs-end"></div>'+this._super(t)}}),Dn=be.extend({Defaults:{classes:"widget btn",role:"button"},init:function(t){var e,n=this;n._super(t),t=n.settings,e=n.settings.size,n.on("click mousedown",function(t){t.preventDefault()}),n.on("touchstart",function(t){n.fire("click",t),t.preventDefault()}),t.subtype&&n.classes.add(t.subtype),e&&
amp;n.classes.add("btn-"+e),t.icon&&n.icon(t.icon)},icon:function(t){return arguments.length?(this.state.set("icon",t),this):this.state.get("icon")},repaint:function(){var t,e=this.getEl().firstChild;e&&((t=e.style).width=t.height="100%"),this._super()},renderHtml:function(){var t,e,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a="",l=n.settings;return(t=l.image)?(o="none","string"!=typeof t&&(t=window.getSelection?t[0]:t[1]),t=" style=\"background-image: url('"+t+"')\""):t="",s&&(n.classes.add("btn-has-text"),a='<span class="'+r+'txt">'+n.encode(s)+"</span>"),o=o?r+"ico "+r+"i-"+o:"",e="boolean"==typeof l.active?' aria-pressed="'+l.active+'"':"",'<div id="'+i+'" class="'+n.cla
sses+'" tabindex="-1"'+e+'><button id="'+i+'-button" role="presentation" type="button" tabindex="-1">'+(o?'<i class="'+o+'"'+t+"></i>":"")+a+"</button></div>"},bindStates:function(){var o=this,n=o.$,i=o.classPrefix+"txt";function s(t){var e=n("span."+i,o.getEl());t?(e[0]||(n("button:first",o.getEl()).append('<span class="'+i+'"></span>'),e=n("span."+i,o.getEl())),e.html(o.encode(t))):e.remove(),o.classes.toggle("btn-has-text",!!t)}return o.state.on("change:text",function(t){s(t.value)}),o.state.on("change:icon",function(t){var e=t.value,n=o.classPrefix;e=(o.settings.icon=e)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];e?(r&&r===i.firstChild||(r=document.createElement(&qu
ot;i"),i.insertBefore(r,i.firstChild)),r.className=e):r&&i.removeChild(r),s(o.state.get("text"))}),o._super()}}),Pn=Dn.extend({init:function(t){t=C.extend({text:"Browse...",multiple:!1,accept:null},t),this._super(t),this.classes.add("browsebutton"),t.multiple&&this.classes.add("multiple")},postRender:function(){var n=this,e=St.create("input",{type:"file",id:n._id+"-browse",accept:n.settings.accept});n._super(),Nt(e).on("change",function(t){var e=t.target.files;n.value=function(){return e.length?n.settings.multiple?e:e[0]:null},t.preventDefault(),e.length&&n.fire("change",t)}),Nt(e).on("click",function(t){t.stopPropagation()}),Nt(n.getEl("button")).on("click",function(t){t.stopPropagation(),e.click()}),n.getEl().appendChild(e)},remove:function(){Nt(this.getEl("button")).off(),Nt(this.getEl("input")).off(),this._super(
)}}),Wn=De.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var t=this,e=t._layout;return t.classes.add("btn-group"),t.preRender(),e.preRender(t),'<div id="'+t._id+'" class="'+t.classes+'"><div id="'+t._id+'-body">'+(t.settings.html||"")+e.renderHtml(t)+"</div></div>"}}),An=be.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(t){var e=this;e._super(t),e.on("click mousedown",function(t){t.preventDefault()}),e.on("click",function(t){t.preventDefault(),e.disabled()||e.checked(!e.checked())}),e.checked(e.settings.checked)},checked:function(t){return arguments.length?(this.state.set("checked",t),this):this.state.get("checked")},value:function(t){return arguments.length?this.checked(t):this.checked()},renderHtml:function(){var t=this,e=t._id,n=t.classPrefix;return'<div i
d="'+e+'" class="'+t.classes+'" unselectable="on" aria-labelledby="'+e+'-al" tabindex="-1"><i class="'+n+"ico "+n+'i-checkbox"></i><span id="'+e+'-al" class="'+n+'label">'+t.encode(t.state.get("text"))+"</span></div>"},bindStates:function(){var o=this;function e(t){o.classes.toggle("checked",t),o.aria("checked",t)}return o.state.on("change:text",function(t){o.getEl("al").firstChild.data=o.translate(t.value)}),o.state.on("change:checked change:value",function(t){o.fire("change"),e(t.value)}),o.state.on("change:icon",function(t){var e=t.value,n=o.classPrefix;if(void 0===e)return o.settings.icon;e=(o.settings.icon=e)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];e?(r&&r===i.firstCh
ild||(r=document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=e):r&&i.removeChild(r)}),o.state.get("checked")&&e(!0),o._super()}}),Bn=tinymce.util.Tools.resolve("tinymce.util.VK"),Ln=be.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.classes.add("combobox"),r.subinput=!0,r.ariaTarget="inp",i.menu=i.menu||i.values,i.menu&&(i.icon="caret"),r.on("click",function(t){var e=t.target,n=r.getEl();if(Nt.contains(n,e)||e===n)for(;e&&e!==n;)e.id&&-1!==e.id.indexOf("-open")&&(r.fire("action"),i.menu&&(r.showMenu(),t.aria&&r.menu.items()[0].focus())),e=e.parentNode}),r.on("keydown",function(t){var e;13===t.keyCode&&"INPUT"===t.target.nodeName&&(t.preventDefault(),r.parents().reverse().each(function(t){if(t.toJSON)return e=t,!1}),r.fire("submit",{data:e.toJSON()}))}),
r.on("keyup",function(t){if("INPUT"===t.target.nodeName){var e=r.state.get("value"),n=t.target.value;n!==e&&(r.state.set("value",n),r.fire("autocomplete",t))}}),r.on("mouseover",function(t){var e=r.tooltip().moveTo(-65535);if(r.statusLevel()&&-1!==t.target.className.indexOf(r.classPrefix+"status")){var n=r.statusMessage()||"Ok",i=e.text(n).show().testMoveRel(t.target,["bc-tc","bc-tl","bc-tr"]);e.classes.toggle("tooltip-n","bc-tc"===i),e.classes.toggle("tooltip-nw","bc-tl"===i),e.classes.toggle("tooltip-ne","bc-tr"===i),e.moveRel(t.target,i)}})},statusLevel:function(t){return 0<arguments.length&&this.state.set("statusLevel",t),this.state.get("statusLevel")},statusMessage:function(t){return 0<arguments.length&&this.state.set("statusMessage",t),this.st
ate.get("statusMessage")},showMenu:function(){var t,e=this,n=e.settings;e.menu||((t=n.menu||[]).length?t={type:"menu",items:t}:t.type=t.type||"menu",e.menu=Ee.create(t).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control.items().each(function(t){t.active(t.value()===e.value())})}).fire("show"),e.menu.on("select",function(t){e.value(t.control.value())}),e.on("focusin",function(t){"INPUT"===t.target.tagName.toUpperCase()&&e.menu.hide()}),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var t,e,n=this,i=n.getEl(),r=n.getEl
("open"),o=n.layoutRect(),s=0,a=i.firstChild;n.statusLevel()&&"none"!==n.statusLevel()&&(s=parseInt(St.getRuntimeStyle(a,"padding-right"),10)-parseInt(St.getRuntimeStyle(a,"padding-left"),10)),t=r?o.w-St.getSize(r).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(e=n.layoutRect().h-2+"px"),Nt(a).css({width:t-s,lineHeight:e}),n._super(),n},postRender:function(){var e=this;return Nt(this.getEl("inp")).on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)}),e._super()},renderHtml:function(){var t,e,n,i=this,r=i._id,o=i.settings,s=i.classPrefix,a=i.state.get("value")||"",l="",u="";return"spellcheck"in o&&(u+=' spellcheck="'+o.spellcheck+'"'),o.maxLength&&(u+=' maxlength="'+o.maxLength+'"'),o.size&&(u+=' size=&quo
t;'+o.size+'"'),o.subtype&&(u+=' type="'+o.subtype+'"'),n='<i id="'+r+'-status" class="mce-status mce-ico" style="display: none"></i>',i.disabled()&&(u+=' disabled="disabled"'),(t=o.icon)&&"caret"!==t&&(t=s+"ico "+s+"i-"+o.icon),e=i.state.get("text"),(t||e)&&(l='<div id="'+r+'-open" class="'+s+"btn "+s+'open" tabIndex="-1" role="button"><button id="'+r+'-action" type="button" hidefocus="1" tabindex="-1">'+("caret"!==t?'<i class="'+t+'"></i>':'<i class="'+s+'caret"></i>')+(e?(t?" ":"")+e:"")+"</button></div>",i.classes.add("has-open")),'<div id="'+r+'" class="'+i.classes+'"><input id="'+r+'-i
np" class="'+s+'textbox" value="'+i.encode(a,!1)+'" hidefocus="1"'+u+' placeholder="'+i.encode(o.placeholder)+'" />'+n+l+"</div>"},value:function(t){return arguments.length?(this.state.set("value",t),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},showAutoComplete:function(t,i){var r=this;if(0!==t.length){r.menu?r.menu.items().remove():r.menu=Ee.create({type:"menu",classes:"combobox-menu",layout:"flow"}).parent(r).renderTo(),C.each(t,function(t){var e,n;r.menu.add({text:t.title,url:t.previewUrl,match:i,classes:"menu-item-ellipsis",onclick:(e=t.value,n=t.title,function(){r.fire("selectitem",{title:n,value:e})})})}),r.menu.renderNew(),r.hideMenu(),r.menu.on("cancel",function(t){t.control.parent()===r.menu&&(t.stopPropagation(),r.focus(),r
.hideMenu())}),r.menu.on("select",function(){r.focus()});var e=r.layoutRect().w;r.menu.layoutRect({w:e,minW:0,maxW:e}),r.menu.repaint(),r.menu.reflow(),r.menu.show(),r.menu.moveRel(r.getEl(),r.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])}else r.hideMenu()},hideMenu:function(){this.menu&&this.menu.hide()},bindStates:function(){var r=this;r.state.on("change:value",function(t){r.getEl("inp").value!==t.value&&(r.getEl("inp").value=t.value)}),r.state.on("change:disabled",function(t){r.getEl("inp").disabled=t.value}),r.state.on("change:statusLevel",function(t){var e=r.getEl("status"),n=r.classPrefix,i=t.value;St.css(e,"display","none"===i?"none":""),St.toggleClass(e,n+"i-checkmark","ok"===i),St.toggleClass(e,n+"i-warning","warn"===i),St.toggleClass(e,n+"i-error",&quo
t;error"===i),r.classes.toggle("has-status","none"!==i),r.repaint()}),St.on(r.getEl("status"),"mouseleave",function(){r.tooltip().hide()}),r.on("cancel",function(t){r.menu&&r.menu.visible()&&(t.stopPropagation(),r.hideMenu())});var n=function(t,e){e&&0<e.items().length&&e.items().eq(t)[0].focus()};return r.on("keydown",function(t){var e=t.keyCode;"INPUT"===t.target.nodeName&&(e===Bn.DOWN?(t.preventDefault(),r.fire("autocomplete"),n(0,r.menu)):e===Bn.UP&&(t.preventDefault(),n(-1,r.menu)))}),r._super()},remove:function(){Nt(this.getEl("inp")).off(),this.menu&&this.menu.remove(),this._super()}}),In=Ln.extend({init:function(t){var e=this;t.spellcheck=!1,t.onaction&&(t.icon="none"),e._super(t),e.classes.add("colorbox"),e.on("change keyup postrender",function(){e.repaintColor(e.value())})},repaintCol
or:function(t){var e=this.getEl("open"),n=e?e.getElementsByTagName("i")[0]:null;if(n)try{n.style.background=t}catch(i){}},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.state.get("rendered")&&e.repaintColor(t.value)}),e._super()}}),zn=Dn.extend({showPanel:function(){var e=this,t=e.settings;if(e.classes.add("opened"),e.panel)e.panel.show();else{var n=t.panel;n.type&&(n={layout:"grid",items:n}),n.role=n.role||"dialog",n.popover=!0,n.autohide=!0,n.ariaRoot=!0,e.panel=new Ve(n).on("hide",function(){e.classes.remove("opened")}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}var i=e.panel.testMoveRel(e.getEl(),t.popoverAlign||(e.isRtl()?["bc-tc","bc-tl","bc-tr"]:["bc-tc","bc-tr","
;bc-tl","tc-bc","tc-br","tc-bl"]));e.panel.classes.toggle("start","l"===i.substr(-1)),e.panel.classes.toggle("end","r"===i.substr(-1));var r="t"===i.substr(0,1);e.panel.classes.toggle("bottom",!r),e.panel.classes.toggle("top",r),e.panel.moveRel(e.getEl(),i)},hidePanel:function(){this.panel&&this.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}}),Fn=v.DOM,Un=zn.extend({init:function(t){this._super(t),this.classes.add("splitbtn"),this.classes.add("colorbutton")},color:function(t){return t?(this._color=t,this.getEl("preview").style.backgroundColor=t,thi
s):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var t=this,e=t._id,n=t.classPrefix,i=t.state.get("text"),r=t.settings.icon?n+"ico "+n+"i-"+t.settings.icon:"",o=t.settings.image?" style=\"background-image: url('"+t.settings.image+"')\"":"",s="";return i&&(t.classes.add("btn-has-text"),s='<span class="'+n+'txt">'+t.encode(i)+"</span>"),'<div id="'+e+'" class="'+t.classes+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+o+"></i>":"")+'<span id="'+e+'-preview" class="'+n+'preview"></sp
an>'+s+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1"> <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,n=e.settings.onclick;return e.on("click",function(t){t.aria&&"down"===t.aria.key||t.control!==e||Fn.getParent(t.target,"."+e.classPrefix+"open")||(t.stopImmediatePropagation(),n.call(e,t))}),delete e.settings.onclick,e._super()}}),Vn=tinymce.util.Tools.resolve("tinymce.util.Color"),qn=be.extend({Defaults:{classes:"widget colorpicker"},init:function(t){this._super(t)},postRender:function(){var n,i,r,o,s,a=this,l=a.color();function u(t,e){var n,i,r=St.getPos(t);return n=e.pageX-r.x,i=e.pageY-r.y,{x:n=Math.max(0,Math.min(n/t.clientWidth,1)),y:i=Math.max(0,Math.min(i/t.clientHeight,1))}}function c(t,e){var n=(360-t.h)/360;St.css(r,{top:100*n+"%"}),e||St.css(s,{le
ft:t.s+"%",top:100-t.v+"%"}),o.style.background=Vn({s:100,v:100,h:t.h}).toHex(),a.color().parse({s:t.s,v:t.v,h:t.h})}function t(t){var e;e=u(o,t),n.s=100*e.x,n.v=100*(1-e.y),c(n),a.fire("change")}function e(t){var e;e=u(i,t),(n=l.toHsv()).h=360*(1-e.y),c(n,!0),a.fire("change")}i=a.getEl("h"),r=a.getEl("hp"),o=a.getEl("sv"),s=a.getEl("svp"),a._repaint=function(){c(n=l.toHsv())},a._super(),a._svdraghelper=new Re(a._id+"-sv",{start:t,drag:t}),a._hdraghelper=new Re(a._id+"-h",{start:e,drag:e}),a._repaint()},rgb:function(){return this.color().toRgb()},value:function(t){if(!arguments.length)return this.color().toHex();this.color().parse(t),this._rendered&&this._repaint()},color:function(){return this._color||(this._color=Vn()),this._color},renderHtml:function(){var t,e=this._id,o=this.classPrefix,s="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00
,#ffff00,#ff8000,#ff0000";return t='<div id="'+e+'-h" class="'+o+'colorpicker-h" style="background: -ms-linear-gradient(top,'+s+");background: linear-gradient(to bottom,"+s+');">'+function(){var t,e,n,i,r="";for(n="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",t=0,e=(i=s.split(",")).length-1;t<e;t++)r+='<div class="'+o+'colorpicker-h-chunk" style="height:'+100/e+"%;"+n+i[t]+",endColorstr="+i[t+1]+");-ms-"+n+i[t]+",endColorstr="+i[t+1]+')"></div>';return r}()+'<div id="'+e+'-hp" class="'+o+'colorpicker-h-marker"></div></div>','<div id="'+e+'" class="'+this.classes+'"><div id="'+e+'-sv" class="'+o+'colorpicker-sv"><div class="'+o+'colorpicker-overlay1"><div class="'+o+'colorpicker-over
lay2"><div id="'+e+'-svp" class="'+o+'colorpicker-selector1"><div class="'+o+'colorpicker-selector2"></div></div></div></div></div>'+t+"</div>"}}),Yn=be.extend({init:function(t){t=C.extend({height:100,text:"Drop an image here",multiple:!1,accept:null},t),this._super(t),this.classes.add("dropzone"),t.multiple&&this.classes.add("multiple")},renderHtml:function(){var t,e,n=this.settings;return t={id:this._id,hidefocus:"1"},e=St.create("div",t,"<span>"+this.translate(n.text)+"</span>"),n.height&&St.css(e,"height",n.height+"px"),n.width&&St.css(e,"width",n.width+"px"),e.className=this.classes,e.outerHTML},postRender:function(){var i=this,t=function(t){t.preventDefault(),i.classes.toggle("dragenter"),i.getEl().className=i.classes};i._super()
,i.$el.on("dragover",function(t){t.preventDefault()}),i.$el.on("dragenter",t),i.$el.on("dragleave",t),i.$el.on("drop",function(t){if(t.preventDefault(),!i.state.get("disabled")){var e=function(t){var e=i.settings.accept;if("string"!=typeof e)return t;var n=new RegExp("("+e.split(/\s*,\s*/).join("|")+")$","i");return C.grep(t,function(t){return n.test(t.name)})}(t.dataTransfer.files);i.value=function(){return e.length?i.settings.multiple?e:e[0]:null},e.length&&i.fire("change",t)}})},remove:function(){this.$el.off(),this._super()}}),$n=be.extend({init:function(t){var n=this;t.delimiter||(t.delimiter="\xbb"),n._super(t),n.classes.add("path"),n.canFocus=!0,n.on("click",function(t){var e;(e=t.target.getAttribute("data-index"))&&n.fire("select",{value:n.row()[e],index:e})}),n.row(n.settings.row)},focus:function(){re
turn this.getEl().firstChild.focus(),this},row:function(t){return arguments.length?(this.state.set("row",t),this):this.state.get("row")},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'">'+this._getDataPathHtml(this.state.get("row"))+"</div>"},bindStates:function(){var e=this;return e.state.on("change:row",function(t){e.innerHtml(e._getDataPathHtml(t.value))}),e._super()},_getDataPathHtml:function(t){var e,n,i=t||[],r="",o=this.classPrefix;for(e=0,n=i.length;e<n;e++)r+=(0<e?'<div class="'+o+'divider" aria-hidden="true"> '+this.settings.delimiter+" </div>":"")+'<div role="button" class="'+o+"path-item"+(e===n-1?" "+o+"last":"")+'" data-index="'+e+'" tabindex="-1" id="'+this._id+"-"+e+'" aria-level="'+(e+
1)+'">'+i[e].name+"</div>";return r||(r='<div class="'+o+'path-item">\xa0</div>'),r}}),Xn=$n.extend({postRender:function(){var o=this,s=o.settings.editor;function a(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1}return!1!==s.settings.elementpath&&(o.on("select",function(t){s.focus(),s.selection.select(this.row()[t.index].element),s.nodeChanged()}),s.on("nodeChange",function(t){for(var e=[],n=t.parents,i=n.length;i--;)if(1===n[i].nodeType&&!a(n[i])){var r=s.fire("ResolveName",{name:n[i].nodeName.toLowerCase(),target:n[i]});if(r.isDefaultPrevented()||e.push({name:r.name,element:n[i]}),r.isPropagationStopped())break}o.row(e)})),o._super()}}),jn=De.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function()
{var t=this,e=t._layout,n=t.classPrefix;return t.classes.add("formitem"),e.preRender(t),'<div id="'+t._id+'" class="'+t.classes+'" hidefocus="1" tabindex="-1">'+(t.settings.title?'<div id="'+t._id+'-title" class="'+n+'title">'+t.settings.title+"</div>":"")+'<div id="'+t._id+'-body" class="'+t.bodyClasses+'">'+(t.settings.html||"")+e.renderHtml(t)+"</div></div>"}}),Jn=De.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:15,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var i=this,t=i.items();i.settings.formItemDefaults||(i.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),t.each(function(t){var e,n=t.settings.label;n&&((e=new jn
(C.extend({items:{type:"label",id:t._id+"-l",text:n,flex:0,forId:t._id,disabled:t.disabled()}},i.settings.formItemDefaults))).type="formitem",t.aria("labelledby",t._id+"-l"),"undefined"==typeof t.settings.flex&&(t.settings.flex=1),i.replace(t,e),e.add(t))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){this._super(),this.fromJSON(this.settings.data)},bindStates:function(){var n=this;function t(){var t,e,i=0,r=[];if(!1!==n.settings.labelGapCalc)for(("children"===n.settings.labelGapCalc?n.find("formitem"):n.items()).filter("formitem").each(function(t){var e=t.items()[0],n=e.getEl().clientWidth;i=i<n?n:i,r.push(e)}),e=n.settings.labelGap||0,t=r.length;t--;)r[t].settings.minWidth=i+e}n._super(),n.on("show",t),t()}}),Gn=Jn.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column"
,align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var t=this,e=t._layout,n=t.classPrefix;return t.preRender(),e.preRender(t),'<fieldset id="'+t._id+'" class="'+t.classes+'" hidefocus="1" tabindex="-1">'+(t.settings.title?'<legend id="'+t._id+'-title" class="'+n+'fieldset-title">'+t.settings.title+"</legend>":"")+'<div id="'+t._id+'-body" class="'+t.bodyClasses+'">'+(t.settings.html||"")+e.renderHtml(t)+"</div></fieldset>"}}),Kn=0,Zn=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:lt(t)}},Qn={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",t),&
quot;HTML must have a single root node";return Zn(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return Zn(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Zn(n)},fromDom:Zn,fromPoint:function(t,e,n){var i=t.dom();return pt.from(i.elementFromPoint(e,n)).map(Zn)}},ti=function(n){var i,r=!1;return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r||(r=!0,i=n.apply(null,t)),i}},ei={ATTRIBUTE:Node.ATTRIBUTE_NODE,CDATA_SECTION:Node.CDATA_SECTION_NODE,COMMENT:Node.COMMENT_NODE,DOCUMENT:Node.DOCUMENT_NODE,DOCUMENT_TYPE:Node.DOCUMENT_TYPE_NODE,DOCUMENT_FRAGMENT:Node.DOCUMENT_FRAGMENT_NODE,ELEMENT:Node.ELEMENT_NODE,TEXT:Node.TEXT_NODE,PROCESSING_INSTRUCTION:Node.PROCESSING_INSTRUCTION_NODE,ENTITY_REFERENCE:Node.ENTITY_REFERENCE_NODE,ENTITY:Node.ENTITY_NODE,NOTATION:Node.NOTATION_NODE},ni=function(t){return t.dom().nodeType},ii=function(e){return function(t){return ni(t)===e}},ri=(ii(ei.ELEMENT),ii(ei.TEXT
),ii(ei.DOCUMENT),ti(function(){return ri(Qn.fromDom(document))}),function(t){var e=t.dom().body;if(null===e||e===undefined)throw"Body is not available yet";return Qn.fromDom(e)}),oi=function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var i=t[n];if(i.test(e))return i}return undefined}(t,e);if(!n)return{major:0,minor:0};var i=function(t){return Number(e.replace(n,"$"+t))};return ai(i(1),i(2))},si=function(){return ai(0,0)},ai=function(t,e){return{major:t,minor:e}},li={nu:ai,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?si():oi(t,n)},unknown:si},ui="Firefox",ci=function(t,e){return function(){return e===t}},di=function(t){var e=t.current;return{current:e,version:t.version,isEdge:ci("Edge",e),isChrome:ci("Chrome",e),isIE:ci("IE",e),isOpera:ci("Opera",e),isFirefox:ci(ui,e),isSafari:ci("Safari",e)}},fi={unknown:function(){return di({current:undefined,version:li.unknown()}
)},nu:di,edge:lt("Edge"),chrome:lt("Chrome"),ie:lt("IE"),opera:lt("Opera"),firefox:lt(ui),safari:lt("Safari")},hi="Windows",mi="Android",gi="Solaris",pi="FreeBSD",vi=function(t,e){return function(){return e===t}},bi=function(t){var e=t.current;return{current:e,version:t.version,isWindows:vi(hi,e),isiOS:vi("iOS",e),isAndroid:vi(mi,e),isOSX:vi("OSX",e),isLinux:vi("Linux",e),isSolaris:vi(gi,e),isFreeBSD:vi(pi,e)}},yi={unknown:function(){return bi({current:undefined,version:li.unknown()})},nu:bi,windows:lt(hi),ios:lt("iOS"),android:lt(mi),linux:lt("Linux"),osx:lt("OSX"),solaris:lt(gi),freebsd:lt(pi)},xi=function(t,e){var n=String(e).toLowerCase();return Et(t,function(t){return t.search(n)})},wi=function(t,n){return xi(t,n).map(function(t){var e=li.detect(t.versionRegexes,n);return{current:t.name,version:e}})},_i=function(t,n){return xi(t,n
).map(function(t){var e=li.detect(t.versionRegexes,n);return{current:t.name,version:e}})},Ci=function(t,e){return-1!==t.indexOf(e)},Ri=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Ei=function(e){return function(t){return Ci(t,e)}},ki=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return Ci(t,"edge/")&&Ci(t,"chrome")&&Ci(t,"safari")&&Ci(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ri],search:function(t){return Ci(t,"chrome")&&!Ci(t,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return Ci(t,"msie")||Ci(t,"trident")}},{name:"Opera",versionRegexes:[Ri,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Ei("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/]
,search:Ei("firefox")},{name:"Safari",versionRegexes:[Ri,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(Ci(t,"safari")||Ci(t,"mobile/"))&&Ci(t,"applewebkit")}}],Ti=[{name:"Windows",search:Ei("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return Ci(t,"iphone")||Ci(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Ei("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Ei("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Ei("linux"),versionRegexes:[]},{name:"Solaris",search:Ei("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Ei("freebsd"),versionRegexe
s:[]}],Hi={browsers:lt(ki),oses:lt(Ti)},Mi=function(t){var e,n,i,r,o,s,a,l,u,c,d,f=Hi.browsers(),h=Hi.oses(),m=wi(f,t).fold(fi.unknown,fi.nu),g=_i(h,t).fold(yi.unknown,yi.nu);return{browser:m,os:g,deviceType:(n=m,i=t,r=(e=g).isiOS()&&!0===/ipad/i.test(i),o=e.isiOS()&&!r,s=e.isAndroid()&&3===e.version.major,a=e.isAndroid()&&4===e.version.major,l=r||s||a&&!0===/mobile/i.test(i),u=e.isiOS()||e.isAndroid(),c=u&&!l,d=n.isSafari()&&e.isiOS()&&!1===/safari/i.test(i),{isiPad:lt(r),isiPhone:lt(o),isTablet:lt(l),isPhone:lt(c),isTouch:lt(u),isAndroid:e.isAndroid,isiOS:e.isiOS,isWebView:lt(d)})}},Si=ti(function(){var t=navigator.userAgent;return Mi(t)}),Ni=ei.ELEMENT,Oi=ei.DOCUMENT,Di=function(t){return t.nodeType!==Ni&&t.nodeType!==Oi||0===t.childElementCount},Pi={all:function(t,e){var n=e===undefined?document:e.dom();return Di(n)?[]:_t(n.querySelectorAll(t),Qn.fromDom)},is:function(t,e){var n=t.dom();if(n.nodeType!==Ni)re
turn!1;if(n.matches!==undefined)return n.matches(e);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(e);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(e);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")},one:function(t,e){var n=e===undefined?document:e.dom();return Di(n)?pt.none():pt.from(n.querySelector(t)).map(Qn.fromDom)}},Wi=(Si().browser.isIE(),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]}("element","offset"),function(t,e){return Pi.all(e,t)}),Ai=C.trim,Bi=function(e){return function(t){if(t&&1===t.nodeType){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}},Li=Bi("true"),Ii=Bi("false"),zi=function(t,e,n,i,r){return{type:t,title:e,url:n,level:i,attach:r}},Fi=function(t){return t.innerText||t.textContent},Ui=function(t){return t.id
?t.id:(e="h",n=(new Date).getTime(),e+"_"+Math.floor(1e9*Math.random())+ ++Kn+String(n));var e,n},Vi=function(t){return(e=t)&&"A"===e.nodeName&&(e.id||e.name)&&Yi(t);var e},qi=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},Yi=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return Li(t)}return!1}(t)&&!Ii(t)},$i=function(t){return qi(t)&&Yi(t)},Xi=function(t){var e,n=Ui(t);return zi("header",Fi(t),"#"+n,qi(e=t)?parseInt(e.nodeName.substr(1),10):0,function(){t.id=n})},ji=function(t){var e=t.id||t.name,n=Fi(t);return zi("anchor",n||"#"+e,"#"+e,0,at)},Ji=function(t){var e,n;return e="h1,h2,h3,h4,h5,h6,a:not([href])",n=t,_t(Wi(Qn.fromDom(n),e),function(t){return t.dom()})},Gi=function(t){return 0<Ai(t.title).length},Ki=function(t){var e,n=Ji(t);return Rt((e=n,_t(Rt(e,$i),Xi)).co
ncat(_t(Rt(n,Vi),ji)),Gi)},Zi={},Qi=function(t){return{title:t.title,value:{title:{raw:t.title},url:t.url,attach:t.attach}}},tr=function(t,e){return{title:t,value:{title:t,url:e,attach:at}}},er=function(t,e,n){var i=e in t?t[e]:n;return!1===i?null:i},nr=function(t,i,r,e){var n,o,s,a,l,u,c={title:"-"},d=function(t){var e=t.hasOwnProperty(r)?t[r]:[],n=Rt(e,function(t){return e=t,!wt(i,function(t){return t.url===e});var e});return C.map(n,function(t){return{title:t,value:{title:t,url:t,attach:at}}})},f=function(e){var t,n=Rt(i,function(t){return t.type===e});return t=n,C.map(t,Qi)};return!1===e.typeahead_urls?[]:"file"===r?(n=[rr(t,d(Zi)),rr(t,f("header")),rr(t,(a=f("anchor"),l=er(e,"anchor_top","#top"),u=er(e,"anchor_bottom","#bottom"),null!==l&&a.unshift(tr("<top>",l)),null!==u&&a.push(tr("<bottom>",u)),a))],o=function(t,e){return 0===t.length||0===e.length?
t.concat(e):t.concat(c,e)},s=[],Ct(n,function(t){s=o(s,t)}),s):rr(t,d(Zi))},ir=function(t,e){var n,i,r,o=Zi[e];/^https?/.test(t)&&(o?(n=o,i=t,r=xt(n,i),-1===r?pt.none():pt.some(r)).isNone()&&(Zi[e]=o.slice(0,5).concat(t)):Zi[e]=[t])},rr=function(t,e){var n=t.toLowerCase(),i=C.grep(e,function(t){return-1!==t.title.toLowerCase().indexOf(n)});return 1===i.length&&i[0].title===t?[]:i},or=function(o,t,n){var i=t.filepicker_validator_handler;i&&o.state.on("change:value",function(t){var e;0!==(e=t.value).length?i({url:e,type:n},function(t){var e,n,i,r=(n=(e=t).status,i=e.message,"valid"===n?{status:"ok",message:i}:"unknown"===n?{status:"warn",message:i}:"invalid"===n?{status:"warn",message:i}:{status:"none",message:""});o.statusMessage(r.message),o.statusLevel(r.status)}):o.statusLevel("none")})},sr=Ln.extend({Statics:{clearHistory:function(){Zi={}}},init:func
tion(t){var e,n,i,r,o,s,a,l,u=this,c=window.tinymce?window.tinymce.activeEditor:S.activeEditor,d=c.settings,f=t.filetype;t.spellcheck=!1,(i=d.file_picker_types||d.file_browser_callback_types)&&(i=C.makeMap(i,/[, ]/)),i&&!i[f]||(!(n=d.file_picker_callback)||i&&!i[f]?!(n=d.file_browser_callback)||i&&!i[f]||(e=function(){n(u.getEl("inp").id,u.value(),f,window)}):e=function(){var t=u.fire("beforecall").meta;t=C.extend({filetype:f},t),n.call(c,function(t,e){u.value(t).fire("change",{meta:e})},u.value(),t)}),e&&(t.icon="browse",t.onaction=e),u._super(t),u.classes.add("filepicker"),r=u,o=d,s=c.getBody(),a=f,l=function(t){var e=Ki(s),n=nr(t,e,a,o);r.showAutoComplete(n,t)},r.on("autocomplete",function(){l(r.value())}),r.on("selectitem",function(t){var e=t.value;r.value(e.url);var n,i=(n=e.title).raw?n.raw:n;"image"===a?r.fire("change",{meta:{alt:i,attach:e.attach}
}):r.fire("change",{meta:{text:i,attach:e.attach}}),r.focus()}),r.on("click",function(t){0===r.value().length&&"INPUT"===t.target.nodeName&&l("")}),r.on("PostRender",function(){r.getRoot().on("submit",function(t){t.isDefaultPrevented()||ir(r.value(),a)})}),or(u,d,f)}}),ar=On.extend({recalc:function(t){var e=t.layoutRect(),n=t.paddingBox;t.items().filter(":visible").each(function(t){t.layoutRect({x:n.left,y:n.top,w:e.innerW-n.right-n.left,h:e.innerH-n.top-n.bottom}),t.recalc&&t.recalc()})}}),lr=On.extend({recalc:function(t){var e,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,C,R,E,k,T,H,M,S,N,O,D,P,W,A,B,L=[],I=Math.max,z=Math.min;for(i=t.items().filter(":visible"),r=t.layoutRect(),o=t.paddingBox,s=t.settings,f=t.isRtl()?s.direction||"row-reversed":s.direction,a=s.align,l=t.isRtl()?s.pack||"end":s.pack,u=s.spacing||0,"row-reversed"!==f&&"colum
n-reverse"!==f||(i=i.set(i.toArray().reverse()),f=f.split("-")[0]),"column"===f?(R="y",_="h",C="minH",E="maxH",T="innerH",k="top",H="deltaH",M="contentH",P="left",O="w",S="x",N="innerW",D="minW",W="right",A="deltaW",B="contentW"):(R="x",_="w",C="minW",E="maxW",T="innerW",k="left",H="deltaW",M="contentW",P="top",O="h",S="y",N="innerH",D="minH",W="bottom",A="deltaH",B="contentH"),d=r[T]-o[k]-o[k],w=c=0,e=0,n=i.length;e<n;e++)m=(h=i[e]).layoutRect(),d-=e<n-1?u:0,0<(g=h.settings.flex)&&(c+=g,m[E]&&L.push(h),m.flex=g),d-=m[C],w<(p=o[P]+m[D]+o[W])&&(w=p);if((y={})[C]=d<0?r[C]-d+r[H]:r[T]-d+r[H],y[D]=w+r[A],y[M]=
r[T]-d,y[B]=w,y.minW=z(y.minW,r.maxW),y.minH=z(y.minH,r.maxH),y.minW=I(y.minW,r.startMinWidth),y.minH=I(y.minH,r.startMinHeight),!r.autoResize||y.minW===r.minW&&y.minH===r.minH){for(b=d/c,e=0,n=L.length;e<n;e++)(v=(m=(h=L[e]).layoutRect())[E])<(p=m[C]+m.flex*b)?(d-=m[E]-m[C],c-=m.flex,m.flex=0,m.maxFlexSize=v):m.maxFlexSize=0;for(b=d/c,x=o[k],y={},0===c&&("end"===l?x=d+o[k]:"center"===l?(x=Math.round(r[T]/2-(r[T]-d)/2)+o[k])<0&&(x=o[k]):"justify"===l&&(x=o[k],u=Math.floor(d/(i.length-1)))),y[S]=o[P],e=0,n=i.length;e<n;e++)p=(m=(h=i[e]).layoutRect()).maxFlexSize||m[C],"center"===a?y[S]=Math.round(r[N]/2-m[O]/2):"stretch"===a?(y[O]=I(m[D]||0,r[N]-o[P]-o[W]),y[S]=o[P]):"end"===a&&(y[S]=r[N]-m[O]-o.top),0<m.flex&&(p+=m.flex*b),y[_]=p,y[R]=x,h.layoutRect(y),h.recalc&&h.recalc(),x+=p+u}else if(y.w=y.minW,y.h=y.minH,t.layoutRect(y),this.recalc(t),null===t._last
Rect){var F=t.parent();F&&(F._lastRect=null,F.recalc())}}}),ur=Nn.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(t){t.items().filter(":visible").each(function(t){t.recalc&&t.recalc()})},isNative:function(){return!0}}),cr=function(t,e){return Pi.one(e,t)},dr=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},fr=function(t,e,n){var i=function(t){n(t,e)};t.formatter?t.formatter.formatChanged(e,i):t.on("init",function(){t.formatter.formatChanged(e,i)})},hr=function(t,n){return function(e){fr(t,n,function(t){e.control.active(t)})}},mr=function(i){var e=["alignleft","aligncenter","alignright","alignjustify"],r="alignleft",t=[{text:"Left",icon:"alignleft",onclick:dr(i,"alignleft")},{text:"Center",icon:"aligncenter",onclick:dr(i,&qu
ot;aligncenter")},{text:"Right",icon:"alignright",onclick:dr(i,"alignright")},{text:"Justify",icon:"alignjustify",onclick:dr(i,"alignjustify")}];i.addMenuItem("align",{text:"Align",menu:t}),i.addButton("align",{type:"menubutton",icon:r,menu:t,onShowMenu:function(t){var n=t.control.menu;C.each(e,function(e,t){n.items().eq(t).each(function(t){return t.active(i.formatter.match(e))})})},onPostRender:function(t){var n=t.control;C.each(e,function(e,t){fr(i,e,function(t){n.icon(r),t&&n.icon(e)})})}}),C.each({alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(t,e){i.addButton(e,{active:!1,tooltip:t[0],cmd:t[1],onPostRen
der:hr(i,e)})})},gr=function(t){return t?t.split(",")[0]:""},pr=function(l,u){return function(){var a=this;a.state.set("value",null),l.on("init nodeChange",function(t){var e,n,i,r,o=l.queryCommandValue("FontName"),s=(e=u,r=(n=o)?n.toLowerCase():"",C.each(e,function(t){t.value.toLowerCase()===r&&(i=t.value)}),C.each(e,function(t){i||gr(t.value).toLowerCase()!==gr(r).toLowerCase()||(i=t.value)}),i);a.value(s||null),!s&&o&&a.text(gr(o))})}},vr=function(n){n.addButton("fontselect",function(){var t,e=(t=function(t){for(var e=(t=t.replace(/;$/,"").split(";")).length;e--;)t[e]=t[e].split("=");return t}(n.settings.font_formats||"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia
,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"),C.map(t,function(t){return{text:{raw:t[0]},value:t[1],textStyle:-1===t[1].indexOf("dings")?"font-family:"+t[1]:""}}));return{type:"listbox",text:"Font Family",tooltip:"Font Family",values:e,fixedWidth:!0,onPostRender:pr(n,e),onselect:function(t){t.control.settings.value&&n.execCommand("FontName",!1,t.control.settings.value)}}})},br=function(t){vr(t)},yr=function(t,e){return/[0-9.]+px$/.test(t)?(n=72*parseInt(t,10)/96,i=e||0,r=Math.pow(10,i),Math.round(n*r)/r+"pt"):t;var n,i,r},xr=function(t,e,n){var i;return C.each(t,function(t){t.value===n?i=n:t.value==
=e&&(i=e)}),i},wr=function(n){n.addButton("fontsizeselect",function(){var t,s,a,e=(t=n.settings.fontsize_formats||"8pt 10pt 12pt 14pt 18pt 24pt 36pt",C.map(t.split(" "),function(t){var e=t,n=t,i=t.split("=");return 1<i.length&&(e=i[0],n=i[1]),{text:e,value:n}}));return{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:e,fixedWidth:!0,onPostRender:(s=n,a=e,function(){var o=this;s.on("init nodeChange",function(t){var e,n,i,r;if(e=s.queryCommandValue("FontSize"))for(i=3;!r&&0<=i;i--)n=yr(e,i),r=xr(a,n,e);o.value(r||null),r||o.text(n)})}),onclick:function(t){t.control.settings.value&&n.execCommand("FontSize",!1,t.control.settings.value)}}})},_r=function(t){wr(t)},Cr=function(n,t){var i=t.length;return C.each(t,function(t){t.menu&&(t.hidden=0===Cr(n,t.menu));var e=t.format;e&&(t.hidden=!n.formatter.canApply(e)),t.hidden&&
amp;i--}),i},Rr=function(n,t){var i=t.items().length;return t.items().each(function(t){t.menu&&t.visible(0<Rr(n,t.menu)),!t.menu&&t.settings.menu&&t.visible(0<Cr(n,t.settings.menu));var e=t.settings.format;e&&t.visible(n.formatter.canApply(e)),t.visible()||i--}),i},Er=function(t){var i,r,o,e,s,n,a,l,u=(r=0,o=[],e=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough&
quot;,icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],s=function(t){var i=[];if(t)return C.each(t,function(
t){var e={text:t.title,icon:t.icon};if(t.items)e.menu=s(t.items);else{var n=t.format||"custom"+r++;t.format||(t.name=n,o.push(t)),e.format=n,e.cmd=t.cmd}i.push(e)}),i},(i=t).on("init",function(){C.each(o,function(t){i.formatter.register(t.name,t)})}),{type:"menu",items:i.settings.style_formats_merge?i.settings.style_formats?s(e.concat(i.settings.style_formats)):s(e):s(i.settings.style_formats||e),onPostRender:function(t){i.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){if(this.settings.format)return i.formatter.getCssText(this.settings.format)},onPostRender:function(){var n=this;n.parent().on("show",function(){var t,e;(t=n.settings.format)&&(n.disabled(!i.formatter.canApply(t)),n.active(i.formatter.match(t))),(e=n.settings.cmd)&&n.active(i.queryCommandState(e))})},onclick:function(){this.settings.format&&dr(i,this.settings.format)(),this.settings.cmd&&i.exe
cCommand(this.settings.cmd)}}});n=u,t.addMenuItem("formats",{text:"Formats",menu:n}),l=u,(a=t).addButton("styleselect",{type:"menubutton",text:"Formats",menu:l,onShowMenu:function(){a.settings.style_formats_autohide&&Rr(a,this.menu)}})},kr=function(n,t){return function(){var r,o,s,e=[];return C.each(t,function(t){e.push({text:t[0],value:t[1],textStyle:function(){return n.formatter.getCssText(t[1])}})}),{type:"listbox",text:t[0][0],values:e,fixedWidth:!0,onselect:function(t){if(t.control){var e=t.control.value();dr(n,e)()}},onPostRender:(r=n,o=e,function(){var e=this;r.on("nodeChange",function(t){var n=r.formatter,i=null;C.each(t.parents,function(e){if(C.each(o,function(t){if(s?n.matchNode(e,s,{value:t.value})&&(i=t.value):n.matchNode(e,t.value)&&(i=t.value),i)return!1}),i)return!1}),e.value(i)})})}}},Tr=function(t){var e,n,i=function(t){for(var e=(t=t.replace(/;$/,"").split("
;")).length;e--;)t[e]=t[e].split("=");return t}(t.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");t.addMenuItem("blockformats",{text:"Blocks",menu:(e=t,n=i,C.map(n,function(t){return{text:t[0],onclick:dr(e,t[1]),textStyle:function(){return e.formatter.getCssText(t[1])}}}))}),t.addButton("formatselect",kr(t,i))},Hr=function(e,t){var n,i;if("string"==typeof t)i=t.split(" ");else if(C.isArray(t))return function(t){for(var e=[],n=0,i=t.length;n<i;++n){if(!Array.prototype.isPrototypeOf(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);Ht.apply(e,t[n])}return e}(C.map(t,function(t){return Hr(e,t)}));return n=C.grep(i,function(t){return"|"===t||t in e.menuItems}),C.map(n,function(t){return"|"===t?{text:"-"}:e.menuItems[t]})},Mr=function(t){return t&&
amp;"-"===t.text},Sr=function(t){var e=Rt(t,function(t,e,n){return!Mr(t)||!Mr(n[e-1])});return Rt(e,function(t,e,n){return!Mr(t)||0<e&&e<n.length-1})},Nr=function(t){var e,n,i,r,o=t.settings.insert_button_items;return Sr(o?Hr(t,o):(e=t,n="insert",i=[{text:"-"}],r=C.grep(e.menuItems,function(t){return t.context===n}),C.each(r,function(t){"before"===t.separator&&i.push({text:"|"}),t.prependToContext?i.unshift(t):i.push(t),"after"===t.separator&&i.push({text:"|"})}),i))},Or=function(t){var e;(e=t).addButton("insert",{type:"menubutton",icon:"insert",menu:[],oncreatemenu:function(){this.menu.add(Nr(e)),this.menu.renderNew()}})},Dr=function(t){var n,i,r;n=t,C.each({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t
,e){n.addButton(e,{active:!1,tooltip:t,onPostRender:hr(n,e),onclick:dr(n,e)})}),i=t,C.each({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"],removeformat:["Clear formatting","RemoveFormat"],remove:["Remove","Delete"]},function(t,e){i.addButton(e,{tooltip:t[0],cmd:t[1]})}),r=t,C.each({blockquote:["Blockquote","mceBlockQuote"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"]},function(t,e){r.addButton(e,{active:!1,tooltip:t[0],cmd:t[1],onPostRe
nder:hr(r,e)})})},Pr=function(t){var n;Dr(t),n=t,C.each({bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline","Meta+U"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"],newdocument:["New document","mceNewDocument"],cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"]},function(t,e){n.addMenuItem(e,{text:t[0],icon:e,shortcut:t[2],cmd:t[1]})}),n.addMenuItem("codeformat",{text:"Code",icon:"code",oncl
ick:dr(n,"code")})},Wr=function(n,i){return function(){var t=this,e=function(){var t="redo"===i?"hasRedo":"hasUndo";return!!n.undoManager&&n.undoManager[t]()};t.disabled(!e()),n.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){t.disabled(n.readonly||!e())})}},Ar=function(t){var e,n;(e=t).addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:Wr(e,"undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:Wr(e,"redo"),cmd:"redo"}),(n=t).addButton("undo",{tooltip:"Undo",onPostRender:Wr(n,"undo"),cmd:"undo"}),n.addButton("redo",{tooltip:"Redo",onPostRender:Wr(n,"redo"),cmd:"redo"})},Br=function(t){var e,n;(e=t).addMenuItem("visualaid",{text:"
Visual aids",selectable:!0,onPostRender:(n=e,function(){var e=this;n.on("VisualAid",function(t){e.active(t.hasVisual)}),e.active(n.hasVisual)}),cmd:"mceToggleVisualAid"})},Lr={setup:function(t){var e;t.rtl&&(ce.rtl=!0),t.on("mousedown",function(){Ve.hideAll()}),(e=t).settings.ui_container&&(h.container=cr(Qn.fromDom(document.body),e.settings.ui_container).fold(lt(null),function(t){return t.dom()})),be.tooltips=!h.iOS,ce.translate=function(t){return S.translate(t)},Tr(t),mr(t),Pr(t),Ar(t),_r(t),br(t),Er(t),Br(t),Or(t)}},Ir=On.extend({recalc:function(t){var e,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,C,R,E,k,T,H,M=[],S=[];e=t.settings,r=t.items().filter(":visible"),o=t.layoutRect(),i=e.columns||Math.ceil(Math.sqrt(r.length)),n=Math.ceil(r.length/i),b=e.spacingH||e.spacing||0,y=e.spacingV||e.spacing||0,x=e.alignH||e.align,w=e.alignV||e.align,p=t.paddingBox,H="reverseRows"in e?e.reverseRows:t.isRtl(),x&&"
;string"==typeof x&&(x=[x]),w&&"string"==typeof w&&(w=[w]);for(d=0;d<i;d++)M.push(0);for(f=0;f<n;f++)S.push(0);for(f=0;f<n;f++)for(d=0;d<i&&(c=r[f*i+d]);d++)R=(u=c.layoutRect()).minW,E=u.minH,M[d]=R>M[d]?R:M[d],S[f]=E>S[f]?E:S[f];for(k=o.innerW-p.left-p.right,d=_=0;d<i;d++)_+=M[d]+(0<d?b:0),k-=(0<d?b:0)+M[d];for(T=o.innerH-p.top-p.bottom,f=C=0;f<n;f++)C+=S[f]+(0<f?y:0),T-=(0<f?y:0)+S[f];if(_+=p.left+p.right,C+=p.top+p.bottom,(l={}).minW=_+(o.w-o.innerW),l.minH=C+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW===o.minW&&l.minH===o.minH){var N;o.autoResize&&((l=t.layoutRect(l)).contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH),N="start"===e.packV?0:0<T?Math.floor(T/n):0;var O=0,D=e.flexWid
ths;if(D)for(d=0;d<D.length;d++)O+=D[d];else O=i;var P=k/O;for(d=0;d<i;d++)M[d]+=D?D[d]*P:P;for(m=p.top,f=0;f<n;f++){for(h=p.left,a=S[f]+N,d=0;d<i&&(c=r[H?f*i+i-1-d:f*i+d]);d++)g=c.settings,u=c.layoutRect(),s=Math.max(M[d],u.startMinWidth),u.x=h,u.y=m,"center"===(v=g.alignH||(x?x[d]||x[0]:null))?u.x=h+s/2-u.w/2:"right"===v?u.x=h+s-u.w:"stretch"===v&&(u.w=s),"center"===(v=g.alignV||(w?w[d]||w[0]:null))?u.y=m+a/2-u.h/2:"bottom"===v?u.y=m+a-u.h:"stretch"===v&&(u.h=a),c.layoutRect(u),h+=s+b,c.recalc&&c.recalc();m+=a+y}}else if(l.w=l.minW,l.h=l.minH,t.layoutRect(l),this.recalc(t),null===t._lastRect){var W=t.parent();W&&(W._lastRect=null,W.recalc())}}}),zr=be.extend({renderHtml:function(){var t=this;return t.classes.add("iframe"),t.canFocus=!1,'<iframe id="'+t._id+'" class="'+t.classes+'" tabindex="-1" src="'+(t.settings.url||"
;javascript:''")+'" frameborder="0"></iframe>'},src:function(t){this.getEl().src=t},html:function(t,e){var n=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=t,e&&e()):c.setTimeout(function(){n.html(t)}),this}}),Fr=be.extend({init:function(t){this._super(t),this.classes.add("widget").add("infobox"),this.canFocus=!1},severity:function(t){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(t)},help:function(t){this.state.set("help",t)},renderHtml:function(){var t=this,e=t.classPrefix;return'<div id="'+t._id+'" class="'+t.classes+'"><div id="'+t._id+'-body">'+t.encode(t.state.get("text"))+'<button role="button" tabindex="-1"><i class="'+e+"ico "+e+'i-help"></i></button></div></div>'},bindS
tates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl("body").firstChild.data=e.encode(t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e.state.on("change:help",function(t){e.classes.toggle("has-help",t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}}),Ur=be.extend({init:function(t){var e=this;e._super(t),e.classes.add("widget").add("label"),e.canFocus=!1,t.multiline&&e.classes.add("autoscroll"),t.strong&&e.classes.add("strong")},initLayoutRect:function(){var t=this,e=t._super();return t.settings.multiline&&(St.getSize(t.getEl()).width>e.maxW&&(e.minW=e.maxW,t.classes.add("multiline")),t.getEl().style.width=e.minW+"px",e.startMinH=e.h=e.minH=Math.min(e.maxH,St.getSize(t.getEl()).height)),e},repaint:function(){return this.settings.multiline||(this.getEl().style.li
neHeight=this.layoutRect().h+"px"),this._super()},severity:function(t){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(t)},renderHtml:function(){var t,e,n=this,i=n.settings.forId,r=n.settings.html?n.settings.html:n.encode(n.state.get("text"));return!i&&(e=n.settings.forName)&&(t=n.getRoot().find("#"+e)[0])&&(i=t._id),i?'<label id="'+n._id+'" class="'+n.classes+'"'+(i?' for="'+i+'"':"")+">"+r+"</label>":'<span id="'+n._id+'" class="'+n.classes+'">'+r+"</span>"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.innerHtml(e.encode(t.value)),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}}),Vr=De.extend({Defaults:{role:"toolbar",layout:"flow"},in
it:function(t){this._super(t),this.classes.add("toolbar")},postRender:function(){return this.items().each(function(t){t.classes.add("toolbar-item")}),this._super()}}),qr=Vr.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}}),Yr=Dn.extend({init:function(t){var e=this;e._renderOpen=!0,e._super(t),t=e.settings,e.classes.add("menubtn"),t.fixedWidth&&e.classes.add("fixed-width"),e.aria("haspopup",!0),e.state.set("menu",t.menu||e.render())},showMenu:function(t){var e,n=this;if(n.menu&&n.menu.visible()&&!1!==t)return n.hideMenu();n.menu||(e=n.state.get("menu")||[],n.classes.add("opened"),e.length?e={type:"menu",animate:!0,items:e}:(e.type=e.type||"menu",e.animate=!0),e.renderTo?n.menu=e.parent(n).show().renderTo():n.menu=Ee.create(e).parent(n).renderTo(),n.fire("createmenu"),n.menu
.reflow(),n.menu.on("cancel",function(t){t.control.parent()===n.menu&&(t.stopPropagation(),n.focus(),n.hideMenu())}),n.menu.on("select",function(){n.focus()}),n.menu.on("show hide",function(t){t.control===n.menu&&(n.activeMenu("show"===t.type),n.classes.toggle("opened","show"===t.type)),n.aria("expanded","show"===t.type)}).fire("show")),n.menu.show(),n.menu.layoutRect({w:n.layoutRect().w}),n.menu.repaint(),n.menu.moveRel(n.getEl(),n.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]),n.fire("showmenu")},hideMenu:function(){this.menu&&(this.menu.items().each(function(t){t.hideMenu&&t.hideMenu()}),this.menu.hide())},activeMenu:function(t){this.classes.toggle("active",t)},renderHtml:function(){var t,e=this,n=e._id,i=e.classPrefix,r=e.settings.icon,o=e.state.get("text"),s="";return(t=e.settings.
image)?(r="none","string"!=typeof t&&(t=window.getSelection?t[0]:t[1]),t=" style=\"background-image: url('"+t+"')\""):t="",o&&(e.classes.add("btn-has-text"),s='<span class="'+i+'txt">'+e.encode(o)+"</span>"),r=e.settings.icon?i+"ico "+i+"i-"+r:"",e.aria("role",e.parent()instanceof qr?"menuitem":"button"),'<div id="'+n+'" class="'+e.classes+'" tabindex="-1" aria-labelledby="'+n+'"><button id="'+n+'-open" role="presentation" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+t+"></i>":"")+s+' <i class="'+i+'caret"></i></button></div>'},postRender:function(){var r=this;return r.on("click",function(t){t.control===r&&function(t,e
){for(;t;){if(e===t)return!0;t=t.parentNode}return!1}(t.target,r.getEl())&&(r.focus(),r.showMenu(!t.aria),t.aria&&r.menu.items().filter(":visible")[0].focus())}),r.on("mouseenter",function(t){var e,n=t.control,i=r.parent();n&&i&&n instanceof Yr&&n.parent()===i&&(i.items().filter("MenuButton").each(function(t){t.hideMenu&&t!==n&&(t.menu&&t.menu.visible()&&(e=!0),t.hideMenu())}),e&&(n.focus(),n.showMenu()))}),r._super()},bindStates:function(){var t=this;return t.state.on("change:menu",function(){t.menu&&t.menu.remove(),t.menu=null}),t._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}});function $r(i,r){var o,s,a=this,l=ce.classPrefix;a.show=function(t,e){function n(){o&&(Nt(i).append('<div class="'+l+"throbber"+(r?" "+l+"throbber-inline":"")+'"></div>'
),e&&e())}return a.hide(),o=!0,t?s=c.setTimeout(n,t):n(),a},a.hide=function(){var t=i.lastChild;return c.clearTimeout(s),t&&-1!==t.className.indexOf("throbber")&&t.parentNode.removeChild(t),o=!1,a}}var Xr=Ve.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(t){if(t.autohide=!0,t.constrainToViewport=!0,"function"==typeof t.items&&(t.itemsFactory=t.items,t.items=[]),t.itemDefaults)for(var e=t.items,n=e.length;n--;)e[n]=C.extend({},t.itemDefaults,e[n]);this._super(t),this.classes.add("menu"),t.animate&&11!==h.ie&&this.classes.add("animate")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){this.hideAll(),this.fire("select"
;)},load:function(){var e,n=this;function i(){n.throbber&&(n.throbber.hide(),n.throbber=null)}n.settings.itemsFactory&&(n.throbber||(n.throbber=new $r(n.getEl("body"),!0),0===n.items().length?(n.throbber.show(),n.fire("loading")):n.throbber.show(100,function(){n.items().remove(),n.fire("loading")}),n.on("hide close",i)),n.requestTime=e=(new Date).getTime(),n.settings.itemsFactory(function(t){0!==t.length?n.requestTime===e&&(n.getEl().style.width="",n.getEl("body").style.width="",i(),n.items().remove(),n.getEl("body").innerHTML="",n.add(t),n.renderNew(),n.fire("loaded")):n.hide()}))},hideAll:function(){return this.find("menuitem").exec("hideMenu"),this._super()},preRender:function(){var n=this;return n.items().each(function(t){var e=t.settings;if(e.icon||e.image||e.selectable)return!(n._hasIcons=!0)}),n.settings.itemsFactory&&n.on(&qu
ot;postrender",function(){n.settings.itemsFactory&&n.load()}),n.on("show hide",function(t){t.control===n&&("show"===t.type?c.setTimeout(function(){n.classes.add("in")},0):n.classes.remove("in"))}),n._super()}}),jr=Yr.extend({init:function(i){var e,r,o,n,s=this;s._super(i),i=s.settings,s._values=e=i.values,e&&("undefined"!=typeof i.value&&function t(e){for(var n=0;n<e.length;n++){if(r=e[n].selected||i.value===e[n].value)return o=o||e[n].text,s.state.set("value",e[n].value),!0;if(e[n].menu&&t(e[n].menu))return!0}}(e),!r&&0<e.length&&(o=e[0].text,s.state.set("value",e[0].value)),s.state.set("menu",e)),s.state.set("text",i.text||o),s.classes.add("listbox"),s.on("select",function(t){var e=t.control;n&&(t.lastControl=n),i.multiple?e.active(!e.active()):s.value(t.control.value()),n=e})},value:function(e){ret
urn 0===arguments.length?this.state.get("value"):(void 0===e||(this.settings.values?0<C.grep(this.settings.values,function(t){return t.value===e}).length?this.state.set("value",e):null===e&&this.state.set("value",null):this.state.set("value",e)),this)},bindStates:function(){var i=this;return i.on("show",function(t){var e,n;e=t.control,n=i.value(),e instanceof Xr&&e.items().each(function(t){t.hasMenus()||t.active(t.value()===n)})}),i.state.on("change:value",function(e){var n=function t(e,n){var i;if(e)for(var r=0;r<e.length;r++){if(e[r].value===n)return e[r];if(e[r].menu&&(i=t(e[r].menu,n)))return i}}(i.state.get("menu"),e.value);n?i.text(n.text):i.text(i.settings.text)}),i._super()}}),Jr=be.extend({Defaults:{border:0,role:"menuitem"},init:function(t){var e,n=this;n._super(t),t=n.settings,n.classes.add("menu-item"),t.menu&&n.classes.add("menu-item-expan
d"),t.preview&&n.classes.add("menu-item-preview"),"-"!==(e=n.state.get("text"))&&"|"!==e||(n.classes.add("menu-item-sep"),n.aria("role","separator"),n.state.set("text","-")),t.selectable&&(n.aria("role","menuitemcheckbox"),n.classes.add("menu-item-checkbox"),t.icon="selected"),t.preview||t.selectable||n.classes.add("menu-item-normal"),n.on("mousedown",function(t){t.preventDefault()}),t.menu&&!t.ariaHideMenu&&n.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var e,n=this,t=n.settings,i=n.parent();if(i.items().each(function(t){t!==n&&t.hideMenu()}),t.menu){(e=n.menu)?e.show():((e=t.menu).length?e={type:"menu",items:e}:e.type=e.type||"menu",i.settings.itemDefaults&&(e.itemDefaults=i.settings.itemDefaults),(e=
n.menu=Ee.create(e).parent(n).renderTo()).reflow(),e.on("cancel",function(t){t.stopPropagation(),n.focus(),e.hide()}),e.on("show hide",function(t){t.control.items&&t.control.items().each(function(t){t.active(t.settings.selected)})}).fire("show"),e.on("hide",function(t){t.control===e&&n.classes.remove("selected")}),e.submenu=!0),e._parentMenu=i,e.classes.add("menu-sub");var r=e.testMoveRel(n.getEl(),n.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);e.moveRel(n.getEl(),r),r="menu-sub-"+(e.rel=r),e.classes.remove(e._lastRel).add(r),e._lastRel=r,n.classes.add("selected"),n.aria("expanded",!0)}},hideMenu:function(){var t=this;return t.menu&&(t.menu.items().each(function(t){t.hideMenu&&t.hideMenu()}),t.menu.hide(),t.aria("expanded",!1)),t},renderHtml:f
unction(){var t,e=this,n=e._id,i=e.settings,r=e.classPrefix,o=e.state.get("text"),s=e.settings.icon,a="",l=i.shortcut,u=e.encode(i.url);function c(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function d(t){var e=i.match||"";return e?t.replace(new RegExp(c(e),"gi"),function(t){return"!mce~match["+t+"]mce~match!"}):t}function f(t){return t.replace(new RegExp(c("!mce~match["),"g"),"<b>").replace(new RegExp(c("]mce~match!"),"g"),"</b>")}return s&&e.parent().classes.add("menu-has-icons"),i.image&&(a=" style=\"background-image: url('"+i.image+"')\""),l&&(l=function(t){var e,n,i={};for(i=h.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},t=t.split("+"),e=0;e<t.length
;e++)(n=i[t[e].toLowerCase()])&&(t[e]=n);return t.join("+")}(l)),s=r+"ico "+r+"i-"+(e.settings.icon||"none"),t="-"!==o?'<i class="'+s+'"'+a+"></i>\xa0":"",o=f(e.encode(d(o))),u=f(e.encode(d(u))),'<div id="'+n+'" class="'+e.classes+'" tabindex="-1">'+t+("-"!==o?'<span id="'+n+'-text" class="'+r+'text">'+o+"</span>":"")+(l?'<div id="'+n+'-shortcut" class="'+r+'menu-shortcut">'+l+"</div>":"")+(i.menu?'<div class="'+r+'caret"></div>':"")+(u?'<div class="'+r+'menu-item-link">'+u+"</div>":"")+"</div>"},postRender:function(){var e=this,n=e.settings,t=n.textStyle;if("function"==typeof t&&(t=t.call(this)),t){var i=e.getEl("text");
i&&(i.setAttribute("style",t),e._textStyle=t)}return e.on("mouseenter click",function(t){t.control===e&&(n.menu||"click"!==t.type?(e.showMenu(),t.aria&&e.menu.focus(!0)):(e.fire("select"),c.requestAnimationFrame(function(){e.parent().hideAll()})))}),e._super(),e},hover:function(){return this.parent().items().each(function(t){t.classes.remove("selected")}),this.classes.toggle("selected",!0),this},active:function(t){return function(t,e){var n=t._textStyle;if(n){var i=t.getEl("text");i.setAttribute("style",n),e&&(i.style.color="",i.style.backgroundColor="")}}(this,t),void 0!==t&&this.aria("checked",t),this._super(t)},remove:function(){this._super(),this.menu&&this.menu.remove()}}),Gr=An.extend({Defaults:{classes:"radio",role:"radio"}}),Kr=be.extend({renderHtml:function(){var t=this,e=t.classPrefix;return t.clas
ses.add("resizehandle"),"both"===t.settings.direction&&t.classes.add("resizehandle-both"),t.canFocus=!1,'<div id="'+t._id+'" class="'+t.classes+'"><i class="'+e+"ico "+e+'i-resize"></i></div>'},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new Re(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!==e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}});function Zr(t){var e="";if(t)for(var n=0;n<t.length;n++)e+='<option value="'+t[n]+'">'+t[n]+"</option>";return e}var Qr=be.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(t){var n=this;n._super(t),n.settings.s
ize&&(n.size=n.settings.size),n.settings.options&&(n._options=n.settings.options),n.on("keydown",function(t){var e;13===t.keyCode&&(t.preventDefault(),n.parents().reverse().each(function(t){if(t.toJSON)return e=t,!1}),n.fire("submit",{data:e.toJSON()}))})},options:function(t){return arguments.length?(this.state.set("options",t),this):this.state.get("options")},renderHtml:function(){var t,e=this,n="";return t=Zr(e._options),e.size&&(n=' size = "'+e.size+'"'),'<select id="'+e._id+'" class="'+e.classes+'"'+n+">"+t+"</select>"},bindStates:function(){var e=this;return e.state.on("change:options",function(t){e.getEl().innerHTML=Zr(t.value)}),e._super()}});function to(t,e,n){return t<e&&(t=e),n<t&&(t=n),t}function eo(t,e,n){t.setAttribute("aria-"+e,n)}function no(t,e){var n,i,r,o,s;"v"===t.setting
s.orientation?(r="top",i="height",n="h"):(r="left",i="width",n="w"),s=t.getEl("handle"),o=((t.layoutRect()[n]||100)-St.getSize(s)[i])*((e-t._minValue)/(t._maxValue-t._minValue))+"px",s.style[r]=o,s.style.height=t.layoutRect().h+"px",eo(s,"valuenow",e),eo(s,"valuetext",""+t.settings.previewFilter(e)),eo(s,"valuemin",t._minValue),eo(s,"valuemax",t._maxValue)}var io=be.extend({init:function(t){var e=this;t.previewFilter||(t.previewFilter=function(t){return Math.round(100*t)/100}),e._super(t),e.classes.add("slider"),"v"===t.orientation&&e.classes.add("vertical"),e._minValue=yt(t.minValue)?t.minValue:0,e._maxValue=yt(t.maxValue)?t.maxValue:100,e._initValue=e.state.get("value")},renderHtml:function(){var t=this._id,e=this.classPrefix;return'<div id="'+t+'" class="'+this.classes+'"&
gt;<div id="'+t+'-handle" class="'+e+'slider-handle" role="slider" tabindex="-1"></div></div>'},reset:function(){this.value(this._initValue).repaint()},postRender:function(){var t,e,n,i,r,o,s,a,l,u,c,d,f,h,m=this;t=m._minValue,e=m._maxValue,"v"===m.settings.orientation?(n="screenY",i="top",r="height",o="h"):(n="screenX",i="left",r="width",o="w"),m._super(),function(o,s){function e(t){var e,n,i,r;e=to(e=(((e=m.value())+(r=n=o))/((i=s)-r)+.05*t)*(i-n)-n,o,s),m.value(e),m.fire("dragstart",{value:e}),m.fire("drag",{value:e}),m.fire("dragend",{value:e})}m.on("keydown",function(t){switch(t.keyCode){case 37:case 38:e(-1);break;case 39:case 40:e(1)}})}(t,e),s=t,a=e,l=m.getEl("handle"),m._dragHelper=new Re(m._id,{handle:m._id+"-handle",start:function(t){u=t[n],c=parseInt(m.getEl("ha
ndle").style[i],10),d=(m.layoutRect()[o]||100)-St.getSize(l)[r],m.fire("dragstart",{value:h})},drag:function(t){var e=t[n]-u;f=to(c+e,0,d),l.style[i]=f+"px",h=s+f/d*(a-s),m.value(h),m.tooltip().text(""+m.settings.previewFilter(h)).show().moveRel(l,"bc tc"),m.fire("drag",{value:h})},stop:function(){m.tooltip().hide(),m.fire("dragend",{value:h})}})},repaint:function(){this._super(),no(this,this.value())},bindStates:function(){var e=this;return e.state.on("change:value",function(t){no(e,t.value)}),e._super()}}),ro=be.extend({renderHtml:function(){return this.classes.add("spacer"),this.canFocus=!1,'<div id="'+this._id+'" class="'+this.classes+'"></div>'}}),oo=Yr.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var t,e,n=this.getEl(),i=this.layoutRect();return this._super(),t=n.firstChild,e=n.lastChild,Nt(t).css({width:i
.w-St.getSize(e).width,height:i.h-2}),Nt(e).css({height:i.h-2}),this},activeMenu:function(t){Nt(this.getEl().lastChild).toggleClass(this.classPrefix+"active",t)},renderHtml:function(){var t,e,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a=n.settings,l="";return(t=a.image)?(o="none","string"!=typeof t&&(t=window.getSelection?t[0]:t[1]),t=" style=\"background-image: url('"+t+"')\""):t="",o=a.icon?r+"ico "+r+"i-"+o:"",s&&(n.classes.add("btn-has-text"),l='<span class="'+r+'txt">'+n.encode(s)+"</span>"),e="boolean"==typeof a.active?' aria-pressed="'+a.active+'"':"",'<div id="'+i+'" class="'+n.classes+'" role="button"'+e+' tabindex="-1"><button type="button" hidefocus="1" tabin
dex="-1">'+(o?'<i class="'+o+'"'+t+"></i>":"")+l+'</button><button type="button" class="'+r+'open" hidefocus="1" tabindex="-1">'+(n._menuBtnText?(o?"\xa0":"")+n._menuBtnText:"")+' <i class="'+r+'caret"></i></button></div>'},postRender:function(){var n=this.settings.onclick;return this.on("click",function(t){var e=t.target;if(t.control===this)for(;e;){if(t.aria&&"down"!==t.aria.key||"BUTTON"===e.nodeName&&-1===e.className.indexOf("open"))return t.stopImmediatePropagation(),void(n&&n.call(this,t));e=e.parentNode}}),delete this.settings.onclick,this._super()}}),so=ur.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}}),ao=We.extend({Defaults:{layout
:"absolute",defaults:{type:"panel"}},activateTab:function(n){var t;this.activeTabId&&(t=this.getEl(this.activeTabId),Nt(t).removeClass(this.classPrefix+"active"),t.setAttribute("aria-selected","false")),this.activeTabId="t"+n,(t=this.getEl("t"+n)).setAttribute("aria-selected","true"),Nt(t).addClass(this.classPrefix+"active"),this.items()[n].show().fire("showtab"),this.reflow(),this.items().each(function(t,e){n!==e&&t.hide()})},renderHtml:function(){var i=this,t=i._layout,r="",o=i.classPrefix;return i.preRender(),t.preRender(i),i.items().each(function(t,e){var n=i._id+"-t"+e;t.aria("role","tabpanel"),t.aria("labelledby",n),r+='<div id="'+n+'" class="'+o+'tab" unselectable="on" role="tab" aria-controls="'+t._id+'" aria-selected="false" tabIndex="
;-1">'+i.encode(t.settings.title)+"</div>"}),'<div id="'+i._id+'" class="'+i.classes+'" hidefocus="1" tabindex="-1"><div id="'+i._id+'-head" class="'+o+'tabs" role="tablist">'+r+'</div><div id="'+i._id+'-body" class="'+i.bodyClasses+'">'+t.renderHtml(i)+"</div></div>"},postRender:function(){var i=this;i._super(),i.settings.activeTab=i.settings.activeTab||0,i.activateTab(i.settings.activeTab),this.on("click",function(t){var e=t.target.parentNode;if(e&&e.id===i._id+"-head")for(var n=e.childNodes.length;n--;)e.childNodes[n]===t.target&&i.activateTab(n)})},initLayoutRect:function(){var t,e,n,i=this;e=(e=St.getSize(i.getEl("head")).width)<0?0:e,n=0,i.items().each(function(t){e=Math.max(e,t.layoutRect().minW),n=Math.max(n,t.layoutRect().minH)}),i.items().each(function(t){t.settings.x
=0,t.settings.y=0,t.settings.w=e,t.settings.h=n,t.layoutRect({x:0,y:0,w:e,h:n})});var r=St.getSize(i.getEl("head")).height;return i.settings.minWidth=e,i.settings.minHeight=n+r,(t=i._super()).deltaH+=r,t.innerH=t.h-t.deltaH,t}}),lo=be.extend({init:function(t){var n=this;n._super(t),n.classes.add("textbox"),t.multiline?n.classes.add("multiline"):(n.on("keydown",function(t){var e;13===t.keyCode&&(t.preventDefault(),n.parents().reverse().each(function(t){if(t.toJSON)return e=t,!1}),n.fire("submit",{data:e.toJSON()}))}),n.on("keyup",function(t){n.state.set("value",t.target.value)}))},repaint:function(){var t,e,n,i,r,o=this,s=0;t=o.getEl().style,e=o._layoutRect,r=o._lastRepaintRect||{};var a=document;return!o.settings.multiline&&a.all&&(!a.documentMode||a.documentMode<=8)&&(t.lineHeight=e.h-s+"px"),i=(n=o.borderBox).left+n.right+8,s=n.top+n.bottom+(o.settings.multiline?8:0),
e.x!==r.x&&(t.left=e.x+"px",r.x=e.x),e.y!==r.y&&(t.top=e.y+"px",r.y=e.y),e.w!==r.w&&(t.width=e.w-i+"px",r.w=e.w),e.h!==r.h&&(t.height=e.h-s+"px",r.h=e.h),o._lastRepaintRect=r,o.fire("repaint",{},!1),o},renderHtml:function(){var e,t,n=this,i=n.settings;return e={id:n._id,hidefocus:"1"},C.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(t){e[t]=i[t]}),n.disabled()&&(e.disabled="disabled"),i.subtype&&(e.type=i.subtype),(t=St.create(i.multiline?"textarea":"input",e)).value=n.state.get("value"),t.className=n.classes.toString(),t.outerHTML},value:function(t){return arguments.length?(this.state.set("value",t),this):(thi
s.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var e=this;e.getEl().value=e.state.get("value"),e._super(),e.$el.on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)})},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl().value!==t.value&&(e.getEl().value=t.value)}),e.state.on("change:disabled",function(t){e.getEl().disabled=t.value}),e._super()},remove:function(){this.$el.off(),this._super()}}),uo=function(){return{Selector:qt,Collection:Xt,ReflowQueue:ee,Control:ce,Factory:Ee,KeyboardNavigation:Te,Container:De,DragHelper:Re,Scrollable:Pe,Panel:We,Movable:pe,Resizable:Ae,FloatPanel:Ve,Window:Je,MessageBox:Ge,Tooltip:ve,Widget:be,Progress:ye,Notification:we,Layout:Nn,AbsoluteLayout:On,Button:Dn,ButtonGroup:Wn,Checkbox:An,ComboBox:Ln,ColorBox:In,PanelBu
tton:zn,ColorButton:Un,ColorPicker:qn,Path:$n,ElementPath:Xn,FormItem:jn,Form:Jn,FieldSet:Gn,FilePicker:sr,FitLayout:ar,FlexLayout:lr,FlowLayout:ur,FormatControls:Lr,GridLayout:Ir,Iframe:zr,InfoBox:Fr,Label:Ur,Toolbar:Vr,MenuBar:qr,MenuButton:Yr,MenuItem:Jr,Throbber:$r,Menu:Xr,ListBox:jr,Radio:Gr,ResizeHandle:Kr,SelectBox:Qr,Slider:io,Spacer:ro,SplitButton:oo,StackLayout:so,TabPanel:ao,TextBox:lo,DropZone:Yn,BrowseButton:Pn}},co=function(n){n.ui?C.each(uo(),function(t,e){n.ui[e]=t}):n.ui=uo()};C.each(uo(),function(t,e){Ee.add(e,t)}),co(window.tinymce?window.tinymce:{}),o.add("inlite",function(t){var e=Sn();return Lr.setup(t),Cn(t,e),Ke(t,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(){"use strict";var u,t,e,n,i,r,o=tinymce.util.Tools.resolve("tinymce.ThemeManager"),h=tinymce.util.Tools.resolve("tinymce.Env"),v=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=tinymce.util.Tools.resolve("tinymce.util.Delay"),s=function(t){return t.reduce(function(t,e){return Array.isArray(e)?t.concat(s(e)):t.concat(e)},[])},a={flatten:s},l=function(t,e){for(var n=0;n<e.length;n++){var i=(0,e[n])(t);if(i)return i}return null},d=function(t,e){return{id:t,rect:e}},f=function(t){return{x:t.left,y:t.top,w:t.width,h:t.height}},m=function(t){return{left:t.x,top:t.y,width:t.w,height:t.h,right:t.x+t.w,bottom:t.y+t.h}},g=function(t){var e=v.DOM.getViewPort();return{x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},p=function(t){var e=t.getBoundingClientRect();return g({x:e.left,y:e.top,w:Math.max(t.clientWidth,t.offsetWidth),h:Math.max(t.client
Height,t.offsetHeight)})},b=function(t,e){return p(e)},y=function(t){return p(t.getContentAreaContainer()||t.getBody())},x=function(t){var e=t.selection.getBoundingClientRect();return e?g(f(e)):null},w=function(n,i){return function(t){for(var e=0;e<i.length;e++)if(i[e].predicate(n))return d(i[e].id,b(t,n));return null}},_=function(i,r){return function(t){for(var e=0;e<i.length;e++)for(var n=0;n<r.length;n++)if(r[n].predicate(i[e]))return d(r[n].id,b(t,i[e]));return null}},R=tinymce.util.Tools.resolve("tinymce.util.Tools"),C=function(t,e){return{id:t,predicate:e}},k=function(t){return R.map(t,function(t){return C(t.id,t.predicate)})},E=function(e){return function(t){return t.selection.isCollapsed()?null:d(e,x(t))}},H=function(i,r){return function(t){var e,n=t.schema.getTextBlockElements();for(e=0;e<i.length;e++)if("TABLE"===i[e].nodeName)return null;for(e=0;e<i.length;e++)if(i[e].nodeName in n)return t.dom.isEmpty(i[e])?d(r,x(t)):null;return null}},
T=function(t){t.fire("SkinLoaded")},S=function(t){return t.fire("BeforeRenderUI")},M=tinymce.util.Tools.resolve("tinymce.EditorManager"),N=function(e){return function(t){return typeof t===e}},O=function(t){return Array.isArray(t)},P=function(t){return N("string")(t)},W=function(t){return N("number")(t)},D=function(t){return N("boolean")(t)},A=function(t){return N("function")(t)},B=(N("object"),O),L=function(t,e){if(e(t))return!0;throw new Error("Default value doesn't match requested type.")},I=function(r){return function(t,e,n){var i=t.settings;return L(n,r),e in i&&r(i[e])?i[e]:n}},z={getStringOr:I(P),getBoolOr:I(D),getNumberOr:I(W),getHandlerOr:I(A),getToolbarItemsOr:(u=B,function(t,e,n){var i,r,o,s,a,l=e in t.settings?t.settings[e]:n;return L(n,u),r=n,B(i=l)?i:P(i)?"string"==typeof(s=i)?(a=/[ ,]/,s.split(a).filter(function(t){return 0<t.length})):s:D(i)?(o=r,!1===i?[]:o)
:r})},F=tinymce.util.Tools.resolve("tinymce.geom.Rect"),U=function(t,e){return{rect:t,position:e}},V=function(t,e){return{x:e.x,y:e.y,w:t.w,h:t.h}},q=function(t,e,n,i,r){var o,s,a,l={x:i.x,y:i.y,w:i.w+(i.w<r.w+n.w?r.w:0),h:i.h+(i.h<r.h+n.h?r.h:0)};return o=F.findBestRelativePosition(r,n,l,t),n=F.clamp(n,l),o?(s=F.relativePosition(r,n,o),a=V(r,s),U(a,o)):(n=F.intersect(l,n))?((o=F.findBestRelativePosition(r,n,l,e))?(s=F.relativePosition(r,n,o),a=V(r,s)):a=V(r,n),U(a,o)):null},Y=function(t,e,n){return q(["cr-cl","cl-cr"],["bc-tc","bl-tl","br-tr"],t,e,n)},$=function(t,e,n){return q(["tc-bc","bc-tc","tl-bl","bl-tl","tr-br","br-tr","cr-cl","cl-cr"],["bc-tc","bl-tl","br-tr","cr-cl"],t,e,n)},X=function(t,e,n,i){var r;return"function"==typeof t?(r=t({elementRect:m(e),contentAreaRect:m(n),panelRect:
m(i)}),f(r)):i},j=function(t){return t.panelRect},J=function(t){return z.getToolbarItemsOr(t,"selection_toolbar",["bold","italic","|","quicklink","h2","h3","blockquote"])},G=function(t){return z.getToolbarItemsOr(t,"insert_toolbar",["quickimage","quicktable"])},K=function(t){return z.getHandlerOr(t,"inline_toolbar_position_handler",j)},Z=function(t){var e,n,i,r,o=t.settings;return o.skin_url?(i=t,r=o.skin_url,i.documentBaseURI.toAbsolute(r)):(e=o.skin,n=M.baseURL+"/skins/",e?n+e:n+"lightgray")},Q=function(t){return!1===t.settings.skin},tt=function(i,r){var t=Z(i),e=function(){var t,e,n;e=r,n=function(){t._skinLoaded=!0,T(t),e()},(t=i).initialized?n():t.on("init",n)};Q(i)?e():(v.DOM.styleSheetLoader.load(t+"/skin.min.css",e),i.contentCSS.push(t+"/content.inline.min.css"))},et=function(t){var e,n,i,r,o=t.contextToolba
rs;return a.flatten([o||[],(e=t,n="img",i="image",r="alignleft aligncenter alignright",{predicate:function(t){return e.dom.is(t,n)},id:i,items:r})])},nt=function(t,e){var n,i,r,o,s;return s=(o=t).selection.getNode(),i=o.dom.getParents(s,"*"),r=k(e),(n=l(t,[w(i[0],r),E("text"),H(i,"insert"),_(i,r)]))&&n.rect?n:null},it=function(i,r){return function(){var t,e,n;i.removed||(n=i,document.activeElement!==n.getBody())||(t=et(i),(e=nt(i,t))?r.show(i,e.id,e.rect,t):r.hide())}},rt=function(t,e){var n,i,r,o,s,a=c.throttle(it(t,e),0),l=c.throttle((r=it(n=t,i=e),function(){n.removed||i.inForm()||r()}),0),u=(o=t,s=e,function(){var t=et(o),e=nt(o,t);e&&s.reposition(o,e.id,e.rect)});t.on("blur hide ObjectResizeStart",e.hide),t.on("click",a),t.on("nodeChange mouseup",l),t.on("ResizeEditor keyup",a),t.on("ResizeWindow",u),v.DOM.bind(h.container,"scroll",u),t.on(&quo
t;remove",function(){v.DOM.unbind(h.container,"scroll",u),e.remove()}),t.shortcuts.add("Alt+F10,F10","",e.focus)},ot=function(t,e){return tt(t,function(){var n,i;rt(t,e),i=e,(n=t).shortcuts.remove("meta+k"),n.shortcuts.add("meta+k","",function(){var t=et(n),e=l(n,[E("quicklink")]);e&&i.show(n,e.id,e.rect,t)})}),{}},st=function(t,e){return t.inline?ot(t,e):function(t){throw new Error(t)}("inlite theme only supports inline mode.")},at=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},lt=function(t){return function(){return t}},ut=lt(!1),ct=lt(!0),dt=ut,ft=ct,ht=function(){return mt},mt=(i={fold:function(t,e){return t()},is:dt,isSome:dt,isNone:ft,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined
},or:n,orThunk:e,map:ht,ap:ht,each:function(){},bind:ht,flatten:ht,exists:dt,forall:ft,filter:ht,equals:t=function(t){return t.isNone()},equals_:t,toArray:function(){return[]},toString:lt("none()")},Object.freeze&&Object.freeze(i),i),gt=function(n){var t=function(){return n},e=function(){return r},i=function(t){return t(n)},r={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:ft,isNone:dt,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return gt(t(n))},ap:function(t){return t.fold(ht,function(t){return gt(t(n))})},each:function(t){t(n)},bind:i,flatten:t,exists:i,forall:i,filter:function(t){return t(n)?r:mt},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(dt,function(t){return e(n,t)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return r},pt={some:gt,none:ht,from:function(t){return null===t||t===undefined?mt:gt(t)}},vt=function(e){ret
urn function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"===e&&Array.prototype.isPrototypeOf(t)?"array":"object"===e&&String.prototype.isPrototypeOf(t)?"string":e}(t)===e}},bt=vt("function"),yt=vt("number"),xt=(r=Array.prototype.indexOf)===undefined?function(t,e){return Et(t,e)}:function(t,e){return r.call(t,e)},wt=function(t,e){return kt(t,e).isSome()},_t=function(t,e){for(var n=t.length,i=new Array(n),r=0;r<n;r++){var o=t[r];i[r]=e(o,r,t)}return i},Rt=function(t,e){for(var n=0,i=t.length;n<i;n++)e(t[n],n,t)},Ct=function(t,e){for(var n=[],i=0,r=t.length;i<r;i++){var o=t[i];e(o,i,t)&&n.push(o)}return n},kt=function(t,e){for(var n=0,i=t.length;n<i;n++)if(e(t[n],n,t))return pt.some(n);return pt.none()},Et=function(t,e){for(var n=0,i=t.length;n<i;++n)if(t[n]===e)return n;return-1},Ht=Array.prototype.push,Tt=(Array.prototype.slice,bt(Array.from)&am
p;&Array.from,0),St={id:function(){return"mceu_"+Tt++},create:function(t,e,n){var i=document.createElement(t);return v.DOM.setAttribs(i,e),"string"==typeof n?i.innerHTML=n:R.each(n,function(t){t.nodeType&&i.appendChild(t)}),i},createFragment:function(t){return v.DOM.createFragment(t)},getWindowSize:function(){return v.DOM.getViewPort()},getSize:function(t){var e,n;if(t.getBoundingClientRect){var i=t.getBoundingClientRect();e=Math.max(i.width||i.right-i.left,t.offsetWidth),n=Math.max(i.height||i.bottom-i.bottom,t.offsetHeight)}else e=t.offsetWidth,n=t.offsetHeight;return{width:e,height:n}},getPos:function(t,e){return v.DOM.getPos(t,e||St.getContainer())},getContainer:function(){return h.container?h.container:document.body},getViewPort:function(t){return v.DOM.getViewPort(t)},get:function(t){return document.getElementById(t)},addClass:function(t,e){return v.DOM.addClass(t,e)},removeClass:function(t,e){return v.DOM.removeClass(t,e)},hasClass:function(t,e
){return v.DOM.hasClass(t,e)},toggleClass:function(t,e,n){return v.DOM.toggleClass(t,e,n)},css:function(t,e,n){return v.DOM.setStyle(t,e,n)},getRuntimeStyle:function(t,e){return v.DOM.getStyle(t,e,!0)},on:function(t,e,n,i){return v.DOM.bind(t,e,n,i)},off:function(t,e,n){return v.DOM.unbind(t,e,n)},fire:function(t,e,n){return v.DOM.fire(t,e,n)},innerHtml:function(t,e){v.DOM.setHTML(t,e)}},Mt=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),Nt=tinymce.util.Tools.resolve("tinymce.util.Class"),Ot=tinymce.util.Tools.resolve("tinymce.util.EventDispatcher"),Pt=function(t){var e;if(t)return"number"==typeof t?{top:t=t||0,left:t,bottom:t,right:t}:(1===(e=(t=t.split(" ")).length)?t[1]=t[2]=t[3]=t[0]:2===e?(t[2]=t[0],t[3]=t[1]):3===e&&(t[3]=t[1]),{top:parseInt(t[0],10)||0,right:parseInt(t[1],10)||0,bottom:parseInt(t[2],10)||0,left:parseInt(t[3],10)||0})},Wt=function(i,t){function e(t){var e=parseFloat(function(t){var e=i.ownerDocument.
defaultView;if(e){var n=e.getComputedStyle(i,null);return n?(t=t.replace(/[A-Z]/g,function(t){return"-"+t}),n.getPropertyValue(t)):null}return i.currentStyle[t]}(t));return isNaN(e)?0:e}return{top:e(t+"TopWidth"),right:e(t+"RightWidth"),bottom:e(t+"BottomWidth"),left:e(t+"LeftWidth")}};function Dt(){}function At(t){this.cls=[],this.cls._map={},this.onchange=t||Dt,this.prefix=""}R.extend(At.prototype,{add:function(t){return t&&!this.contains(t)&&(this.cls._map[t]=!0,this.cls.push(t),this._change()),this},remove:function(t){if(this.contains(t)){var e=void 0;for(e=0;e<this.cls.length&&this.cls[e]!==t;e++);this.cls.splice(e,1),delete this.cls._map[t],this._change()}return this},toggle:function(t,e){var n=this.contains(t);return n!==e&&(n?this.remove(t):this.add(t),this._change()),this},contains:function(t){return!!this.cls._map[t]},_change:function(){delete this.clsValue,this.onchange.call(thi
s)}}),At.prototype.toString=function(){var t;if(this.clsValue)return this.clsValue;t="";for(var e=0;e<this.cls.length;e++)0<e&&(t+=" "),t+=this.prefix+this.cls[e];return t};var Bt,Lt,It,zt=/^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,Ft=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,Ut=/^\s*|\s*$/g,Vt=Nt.extend({init:function(t){var o=this.match;function s(t,e,n){var i;function r(t){t&&e.push(t)}return r(function(e){if(e)return e=e.toLowerCase(),function(t){return"*"===e||t.type===e}}((i=zt.exec(t.replace(Ut,"")))[1])),r(function(e){if(e)return function(t){return t._name===e}}(i[2])),r(function(n){if(n)return n=n.split("."),function(t){for(var e=n.length;e--;)if(!t.classes.contains(n[e]))return!1;return!0}}(i[3])),r(function(n,i,r){if(n)retu
rn function(t){var e=t[n]?t[n]():"";return i?"="===i?e===r:"*="===i?0<=e.indexOf(r):"~="===i?0<=(" "+e+" ").indexOf(" "+r+" "):"!="===i?e!==r:"^="===i?0===e.indexOf(r):"$="===i&&e.substr(e.length-r.length)===r:!!r}}(i[4],i[5],i[6])),r(function(i){var e;if(i)return(i=/(?:not\((.+)\))|(.+)/i.exec(i))[1]?(e=a(i[1],[]),function(t){return!o(t,e)}):(i=i[2],function(t,e,n){return"first"===i?0===e:"last"===i?e===n-1:"even"===i?e%2==0:"odd"===i?e%2==1:!!t[i]&&t[i]()})}(i[7])),e.pseudo=!!i[7],e.direct=n,e}function a(t,e){var n,i,r,o=[];do{if(Ft.exec(""),(i=Ft.exec(t))&&(t=i[3],o.push(i[1]),i[2])){n=i[3];break}}while(i);for(n&&a(n,e),t=[],r=0;r<o.length;r++)">"!==o[r]&&t.push(s(o[r],[],">"===o[r-1]));return e.push(t),e}this._selectors=a(t,[])},match:function(t,e)
{var n,i,r,o,s,a,l,u,c,d,f,h,m;for(n=0,i=(e=e||this._selectors).length;n<i;n++){for(m=t,h=0,r=(o=(s=e[n]).length)-1;0<=r;r--)for(u=s[r];m;){if(u.pseudo)for(c=d=(f=m.parent().items()).length;c--&&f[c]!==m;);for(a=0,l=u.length;a<l;a++)if(!u[a](m,c,d)){a=l+1;break}if(a===l){h++;break}if(r===o-1)break;m=m.parent()}if(h===o)return!0}return!1},find:function(t){var e,n,u=[],i=this._selectors;function c(t,e,n){var i,r,o,s,a,l=e[n];for(i=0,r=t.length;i<r;i++){for(a=t[i],o=0,s=l.length;o<s;o++)if(!l[o](a,i,r)){o=s+1;break}if(o===s)n===e.length-1?u.push(a):a.items&&c(a.items(),e,n+1);else if(l.direct)return;a.items&&c(a.items(),e,n)}}if(t.items){for(e=0,n=i.length;e<n;e++)c(t.items(),i[e],0);1<n&&(u=function(t){for(var e,n=[],i=t.length;i--;)(e=t[i]).__checked||(n.push(e),e.__checked=1);for(i=n.length;i--;)delete n[i].__checked;return n}(u))}return Bt||(Bt=Vt.Collection),new Bt(u)}}),qt=Array.prototype.push,Yt=Array.prototype.slice;It={lengt
h:0,init:function(t){t&&this.add(t)},add:function(t){return R.isArray(t)?qt.apply(this,t):t instanceof Lt?this.add(t.toArray()):qt.call(this,t),this},set:function(t){var e,n=this,i=n.length;for(n.length=0,n.add(t),e=n.length;e<i;e++)delete n[e];return n},filter:function(e){var t,n,i,r,o=[];for("string"==typeof e?(e=new Vt(e),r=function(t){return e.match(t)}):r=e,t=0,n=this.length;t<n;t++)r(i=this[t])&&o.push(i);return new Lt(o)},slice:function(){return new Lt(Yt.apply(this,arguments))},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},each:function(t){return R.each(this,t),this},toArray:function(){return R.toArray(this)},indexOf:function(t){for(var e=this.length;e--&&this[e]!==t;);return e},reverse:function(){return new Lt(R.toArray(this).reverse())},hasClass:function(t){return!!this[0]&&this[0].classes.contains(t)},prop:function(e,n){var t;return n!==undefined?(this.each(function(t){t[e]&&t[e](n)}),this):(t=this[0]
)&&t[e]?t[e]():void 0},exec:function(e){var n=R.toArray(arguments).slice(1);return this.each(function(t){t[e]&&t[e].apply(t,n)}),this},remove:function(){for(var t=this.length;t--;)this[t].remove();return this},addClass:function(e){return this.each(function(t){t.classes.add(e)})},removeClass:function(e){return this.each(function(t){t.classes.remove(e)})}},R.each("fire on off show hide append prepend before after reflow".split(" "),function(n){It[n]=function(){var e=R.toArray(arguments);return this.each(function(t){n in t&&t[n].apply(t,e)}),this}}),R.each("text name disabled active selected checked visible parent value data".split(" "),function(e){It[e]=function(t){return this.prop(e,t)}}),Lt=Nt.extend(It);var $t=Vt.Collection=Lt,Xt=function(t){this.create=t.create};Xt.create=function(r,o){return new Xt({create:function(e,n){var i,t=function(t){e.set(n,t.value)};return e.on("change:"+n,function(t){r.set(o,t.valu
e)}),r.on("change:"+o,t),(i=e._bindings)||(i=e._bindings=[],e.on("destroy",function(){for(var t=i.length;t--;)i[t]()})),i.push(function(){r.off("change:"+o,t)}),r.get(o)}})};var jt=tinymce.util.Tools.resolve("tinymce.util.Observable");function Jt(t){return 0<t.nodeType}var Gt,Kt,Zt=Nt.extend({Mixins:[jt],init:function(t){var e,n;for(e in t=t||{})(n=t[e])instanceof Xt&&(t[e]=n.create(this,e));this.data=t},set:function(e,n){var i,r,o=this.data[e];if(n instanceof Xt&&(n=n.create(this,e)),"object"==typeof e){for(i in e)this.set(i,e[i]);return this}return function t(e,n){var i,r;if(e===n)return!0;if(null===e||null===n)return e===n;if("object"!=typeof e||"object"!=typeof n)return e===n;if(R.isArray(n)){if(e.length!==n.length)return!1;for(i=e.length;i--;)if(!t(e[i],n[i]))return!1}if(Jt(e)||Jt(n))return e===n;for(i in r={},n){if(!t(e[i],n[i]))return!1;r[i]=!0}for(i in e)if(!r[i]&&!t(e[i],n[i]))r
eturn!1;return!0}(o,n)||(this.data[e]=n,r={target:this,name:e,value:n,oldValue:o},this.fire("change:"+e,r),this.fire("change",r)),this},get:function(t){return this.data[t]},has:function(t){return t in this.data},bind:function(t){return Xt.create(this,t)},destroy:function(){this.fire("destroy")}}),Qt={},te={add:function(t){var e=t.parent();if(e){if(!e._layout||e._layout.isNative())return;Qt[e._id]||(Qt[e._id]=e),Gt||(Gt=!0,c.requestAnimationFrame(function(){var t,e;for(t in Gt=!1,Qt)(e=Qt[t]).state.get("rendered")&&e.reflow();Qt={}},document.body))}},remove:function(t){Qt[t._id]&&delete Qt[t._id]}},ee=function(t){return t?t.getRoot().uiContainer:null},ne={getUiContainerDelta:function(t){var e=ee(t);if(e&&"static"!==v.DOM.getStyle(e,"position",!0)){var n=v.DOM.getPos(e),i=e.scrollLeft-n.x,r=e.scrollTop-n.y;return pt.some({x:i,y:r})}return pt.none()},setUiContainer:function(t,e){var n=v.DOM.select(t.set
tings.ui_container)[0];e.getRoot().uiContainer=n},getUiContainer:ee,inheritUiContainer:function(t,e){return e.uiContainer=ee(t)}},ie="onmousewheel"in document,re=!1,oe=0,se={Statics:{classPrefix:"mce-"},isRtl:function(){return Kt.rtl},classPrefix:"mce-",init:function(e){var t,n,i=this;function r(t){var e;for(t=t.split(" "),e=0;e<t.length;e++)i.classes.add(t[e])}i.settings=e=R.extend({},i.Defaults,e),i._id=e.id||"mceu_"+oe++,i._aria={role:e.role},i._elmCache={},i.$=Mt,i.state=new Zt({visible:!0,active:!1,disabled:!1,value:""}),i.data=new Zt(e.data),i.classes=new At(function(){i.state.get("rendered")&&(i.getEl().className=this.toString())}),i.classes.prefix=i.classPrefix,(t=e.classes)&&(i.Defaults&&(n=i.Defaults.classes)&&t!==n&&r(n),r(t)),R.each("title text name visible disabled active value".split(" "),function(t){t in e&&i[t](e[t])}),i.on(&quo
t;click",function(){if(i.disabled())return!1}),i.settings=e,i.borderBox=Pt(e.border),i.paddingBox=Pt(e.padding),i.marginBox=Pt(e.margin),e.hidden&&i.hide()},Properties:"parent,name",getContainerElm:function(){var t=ne.getUiContainer(this);return t||St.getContainer()},getParentCtrl:function(t){for(var e,n=this.getRoot().controlIdLookup;t&&n&&!(e=n[t.id]);)t=t.parentNode;return e},initLayoutRect:function(){var t,e,n,i,r,o,s,a,l,u,c=this,d=c.settings,f=c.getEl();t=c.borderBox=c.borderBox||Wt(f,"border"),c.paddingBox=c.paddingBox||Wt(f,"padding"),c.marginBox=c.marginBox||Wt(f,"margin"),u=St.getSize(f),a=d.minWidth,l=d.minHeight,r=a||u.width,o=l||u.height,n=d.width,i=d.height,s=void 0!==(s=d.autoResize)?s:!n&&!i,n=n||r,i=i||o;var h=t.left+t.right,m=t.top+t.bottom,g=d.maxWidth||65535,p=d.maxHeight||65535;return c._layoutRect=e={x:d.x||0,y:d.y||0,w:n,h:i,deltaW:h,deltaH:m,contentW:n-h,contentH:i-m,innerW:n-h,inner
H:i-m,startMinWidth:a||0,startMinHeight:l||0,minW:Math.min(r,g),minH:Math.min(o,p),maxW:g,maxH:p,autoResize:s,scrollW:0},c._lastLayoutRect={},e},layoutRect:function(t){var e,n,i,r,o,s=this,a=s._layoutRect;return a||(a=s.initLayoutRect()),t?(i=a.deltaW,r=a.deltaH,t.x!==undefined&&(a.x=t.x),t.y!==undefined&&(a.y=t.y),t.minW!==undefined&&(a.minW=t.minW),t.minH!==undefined&&(a.minH=t.minH),(n=t.w)!==undefined&&(n=(n=n<a.minW?a.minW:n)>a.maxW?a.maxW:n,a.w=n,a.innerW=n-i),(n=t.h)!==undefined&&(n=(n=n<a.minH?a.minH:n)>a.maxH?a.maxH:n,a.h=n,a.innerH=n-r),(n=t.innerW)!==undefined&&(n=(n=n<a.minW-i?a.minW-i:n)>a.maxW-i?a.maxW-i:n,a.innerW=n,a.w=n+i),(n=t.innerH)!==undefined&&(n=(n=n<a.minH-r?a.minH-r:n)>a.maxH-r?a.maxH-r:n,a.innerH=n,a.h=n+r),t.contentW!==undefined&&(a.contentW=t.contentW),t.contentH!==undefined&&(a.contentH=t.contentH),(e=s._lastLayoutRect).x===a.x&&e.y===a.y&&
amp;e.w===a.w&&e.h===a.h||((o=Kt.repaintControls)&&o.map&&!o.map[s._id]&&(o.push(s),o.map[s._id]=!0),e.x=a.x,e.y=a.y,e.w=a.w,e.h=a.h),s):a},repaint:function(){var t,e,n,i,r,o,s,a,l,u,c=this;l=document.createRange?function(t){return t}:Math.round,t=c.getEl().style,i=c._layoutRect,a=c._lastRepaintRect||{},o=(r=c.borderBox).left+r.right,s=r.top+r.bottom,i.x!==a.x&&(t.left=l(i.x)+"px",a.x=i.x),i.y!==a.y&&(t.top=l(i.y)+"px",a.y=i.y),i.w!==a.w&&(u=l(i.w-o),t.width=(0<=u?u:0)+"px",a.w=i.w),i.h!==a.h&&(u=l(i.h-s),t.height=(0<=u?u:0)+"px",a.h=i.h),c._hasBody&&i.innerW!==a.innerW&&(u=l(i.innerW),(n=c.getEl("body"))&&((e=n.style).width=(0<=u?u:0)+"px"),a.innerW=i.innerW),c._hasBody&&i.innerH!==a.innerH&&(u=l(i.innerH),(n=n||c.getEl("body"))&&((e=e||n.style).height=(0<=u?u:0)+"px"),a.innerH=i.i
nnerH),c._lastRepaintRect=a,c.fire("repaint",{},!1)},updateLayoutRect:function(){var t=this;t.parent()._lastRect=null,St.css(t.getEl(),{width:"",height:""}),t._layoutRect=t._lastRepaintRect=t._lastLayoutRect=null,t.initLayoutRect()},on:function(t,e){var n,i,r,o=this;return ae(o).on(t,"string"!=typeof(n=e)?n:function(t){return i||o.parentsAndSelf().each(function(t){var e=t.settings.callbacks;if(e&&(i=e[n]))return r=t,!1}),i?i.call(r,t):(t.action=n,void this.fire("execute",t))}),o},off:function(t,e){return ae(this).off(t,e),this},fire:function(t,e,n){if((e=e||{}).control||(e.control=this),e=ae(this).fire(t,e),!1!==n&&this.parent)for(var i=this.parent();i&&!e.isPropagationStopped();)i.fire(t,e,!1),i=i.parent();return e},hasEventListeners:function(t){return ae(this).has(t)},parents:function(t){var e,n=new $t;for(e=this.parent();e;e=e.parent())n.add(e);return t&&(n=n.filter(t)),n},parentsAndSelf:function(t)
{return new $t(this).add(this.parents(t))},next:function(){var t=this.parent().items();return t[t.indexOf(this)+1]},prev:function(){var t=this.parent().items();return t[t.indexOf(this)-1]},innerHtml:function(t){return this.$el.html(t),this},getEl:function(t){var e=t?this._id+"-"+t:this._id;return this._elmCache[e]||(this._elmCache[e]=Mt("#"+e)[0]),this._elmCache[e]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(t){}return this},blur:function(){return this.getEl().blur(),this},aria:function(t,e){var n=this,i=n.getEl(n.ariaTarget);return void 0===e?n._aria[t]:(n._aria[t]=e,n.state.get("rendered")&&i.setAttribute("role"===t?t:"aria-"+t,e),n)},encode:function(t,e){return!1!==e&&(t=this.translate(t)),(t||"").replace(/[&<>"]/g,function(t){return"&#"+t.charCodeAt(0)+";"})},translate:function(t)
{return Kt.translate?Kt.translate(t):t},before:function(t){var e=this.parent();return e&&e.insert(t,e.items().indexOf(this),!0),this},after:function(t){var e=this.parent();return e&&e.insert(t,e.items().indexOf(this)),this},remove:function(){var e,t,n=this,i=n.getEl(),r=n.parent();if(n.items){var o=n.items().toArray();for(t=o.length;t--;)o[t].remove()}r&&r.items&&(e=[],r.items().each(function(t){t!==n&&e.push(t)}),r.items().set(e),r._lastRect=null),n._eventsRoot&&n._eventsRoot===n&&Mt(i).off();var s=n.getRoot().controlIdLookup;return s&&delete s[n._id],i&&i.parentNode&&i.parentNode.removeChild(i),n.state.set("rendered",!1),n.state.destroy(),n.fire("remove"),n},renderBefore:function(t){return Mt(t).before(this.renderHtml()),this.postRender(),this},renderTo:function(t){return Mt(t||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:fu
nction(){},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'"></div>'},postRender:function(){var t,e,n,i,r,o=this,s=o.settings;for(i in o.$el=Mt(o.getEl()),o.state.set("rendered",!0),s)0===i.indexOf("on")&&o.on(i.substr(2),s[i]);if(o._eventsRoot){for(n=o.parent();!r&&n;n=n.parent())r=n._eventsRoot;if(r)for(i in r._nativeEvents)o._nativeEvents[i]=!0}le(o),s.style&&(t=o.getEl())&&(t.setAttribute("style",s.style),t.style.cssText=s.style),o.settings.border&&(e=o.borderBox,o.$el.css({"border-top-width":e.top,"border-right-width":e.right,"border-bottom-width":e.bottom,"border-left-width":e.left}));var a=o.getRoot();for(var l in a.controlIdLookup||(a.controlIdLookup={}),(a.controlIdLookup[o._id]=o)._aria)o.aria(l,o._aria[l]);!1===o.state.get("visible")&&(o.getEl().style.display="none"),o.bindState
s(),o.state.on("change:visible",function(t){var e,n=t.value;o.state.get("rendered")&&(o.getEl().style.display=!1===n?"none":"",o.getEl().getBoundingClientRect()),(e=o.parent())&&(e._lastRect=null),o.fire(n?"show":"hide"),te.add(o)}),o.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(t){var e,n,i,r,o,s,a=this.getEl(),l=a.parentNode,u=function(t,e){var n,i,r=t;for(n=i=0;r&&r!==e&&r.nodeType;)n+=r.offsetLeft||0,i+=r.offsetTop||0,r=r.offsetParent;return{x:n,y:i}}(a,l);return e=u.x,n=u.y,i=a.offsetWidth,r=a.offsetHeight,o=l.clientWidth,s=l.clientHeight,"end"===t?(e-=o-i,n-=s-r):"center"===t&&(e-=o/2-i/2,n-=s/2-r/2),l.scrollLeft=e,l.scrollTop=n,this},getRoot:function(){for(var t,e=this,n=[];e;){if(e.rootControl){t=e.rootControl;break}n.push(e),e=(t=e).parent()}t||(t=this);for(var i=n.length;i--;)n[i].rootControl=t;return t},reflow:funct
ion(){te.remove(this);var t=this.parent();return t&&t._layout&&!t._layout.isNative()&&t.reflow(),this}};function ae(n){return n._eventDispatcher||(n._eventDispatcher=new Ot({scope:n,toggleEvent:function(t,e){e&&Ot.isNative(t)&&(n._nativeEvents||(n._nativeEvents={}),n._nativeEvents[t]=!0,n.state.get("rendered")&&le(n))}})),n._eventDispatcher}function le(a){var t,e,n,l,i,r;function o(t){var e=a.getParentCtrl(t.target);e&&e.fire(t.type,t)}function s(){var t=l._lastHoverCtrl;t&&(t.fire("mouseleave",{target:t.getEl()}),t.parents().each(function(t){t.fire("mouseleave",{target:t.getEl()})}),l._lastHoverCtrl=null)}function u(t){var e,n,i,r=a.getParentCtrl(t.target),o=l._lastHoverCtrl,s=0;if(r!==o){if((n=(l._lastHoverCtrl=r).parents().toArray().reverse()).push(r),o){for((i=o.parents().toArray().reverse()).push(o),s=0;s<i.length&&n[s]===i[s];s++);for(e=i.length-1;s<=e;e--)(o=i[e]).fire(
"mouseleave",{target:o.getEl()})}for(e=s;e<n.length;e++)(r=n[e]).fire("mouseenter",{target:r.getEl()})}}function c(t){t.preventDefault(),"mousewheel"===t.type?(t.deltaY=-.025*t.wheelDelta,t.wheelDeltaX&&(t.deltaX=-.025*t.wheelDeltaX)):(t.deltaX=0,t.deltaY=t.detail),t=a.fire("wheel",t)}if(i=a._nativeEvents){for((n=a.parents().toArray()).unshift(a),t=0,e=n.length;!l&&t<e;t++)l=n[t]._eventsRoot;for(l||(l=n[n.length-1]||a),a._eventsRoot=l,e=t,t=0;t<e;t++)n[t]._eventsRoot=l;var d=l._delegates;for(r in d||(d=l._delegates={}),i){if(!i)return!1;"wheel"!==r||re?("mouseenter"===r||"mouseleave"===r?l._hasMouseEnter||(Mt(l.getEl()).on("mouseleave",s).on("mouseover",u),l._hasMouseEnter=1):d[r]||(Mt(l.getEl()).on(r,o),d[r]=!0),i[r]=!1):ie?Mt(a.getEl()).on("mousewheel",c):Mt(a.getEl()).on("DOMMouseScroll",c)}}}R.each("text title visible disabled active value&q
uot;.split(" "),function(e){se[e]=function(t){return 0===arguments.length?this.state.get(e):(void 0!==t&&this.state.set(e,t),this)}});var ue=Kt=Nt.extend(se),ce=function(t){return"static"===St.getRuntimeStyle(t,"position")},de=function(t){return t.state.get("fixed")};function fe(t,e,n){var i,r,o,s,a,l,u,c,d,f;return d=he(),o=(r=St.getPos(e,ne.getUiContainer(t))).x,s=r.y,de(t)&&ce(document.body)&&(o-=d.x,s-=d.y),i=t.getEl(),a=(f=St.getSize(i)).width,l=f.height,u=(f=St.getSize(e)).width,c=f.height,"b"===(n=(n||"").split(""))[0]&&(s+=c),"r"===n[1]&&(o+=u),"c"===n[0]&&(s+=Math.round(c/2)),"c"===n[1]&&(o+=Math.round(u/2)),"b"===n[3]&&(s-=l),"r"===n[4]&&(o-=a),"c"===n[3]&&(s-=Math.round(l/2)),"c"===n[4]&&(o-=Math.round(a/2)),{x:o,y:s,w:a,h:l}}var he=function(){var
t=window;return{x:Math.max(t.pageXOffset,document.body.scrollLeft,document.documentElement.scrollLeft),y:Math.max(t.pageYOffset,document.body.scrollTop,document.documentElement.scrollTop),w:t.innerWidth||document.documentElement.clientWidth,h:t.innerHeight||document.documentElement.clientHeight}},me=function(t){var e,n=ne.getUiContainer(t);return n&&!de(t)?{x:0,y:0,w:(e=n).scrollWidth-1,h:e.scrollHeight-1}:he()},ge={testMoveRel:function(t,e){for(var n=me(this),i=0;i<e.length;i++){var r=fe(this,t,e[i]);if(de(this)){if(0<r.x&&r.x+r.w<n.w&&0<r.y&&r.y+r.h<n.h)return e[i]}else if(r.x>n.x&&r.x+r.w<n.w+n.x&&r.y>n.y&&r.y+r.h<n.h+n.y)return e[i]}return e[0]},moveRel:function(t,e){"string"!=typeof e&&(e=this.testMoveRel(t,e));var n=fe(this,t,e);return this.moveTo(n.x,n.y)},moveBy:function(t,e){var n=this.layoutRect();return this.moveTo(n.x+t,n.y+e),this},moveTo:function(t,e){var n=this;functio
n i(t,e,n){return t<0?0:e<t+n&&(t=e-n)<0?0:t}if(n.settings.constrainToViewport){var r=me(this),o=n.layoutRect();t=i(t,r.w+r.x,o.w),e=i(e,r.h+r.y,o.h)}var s=ne.getUiContainer(n);return s&&ce(s)&&!de(n)&&(t-=s.scrollLeft,e-=s.scrollTop),s&&(t+=1,e+=1),n.state.get("rendered")?n.layoutRect({x:t,y:e}).repaint():(n.settings.x=t,n.settings.y=e),n.fire("move",{x:t,y:e}),n}},pe=ue.extend({Mixins:[ge],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var t=this,e=t.classPrefix;return'<div id="'+t._id+'" class="'+t.classes+'" role="presentation"><div class="'+e+'tooltip-arrow"></div><div class="'+e+'tooltip-inner">'+t.encode(t.state.get("text"))+"</div></div>"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().lastChild.innerHTML=e.encode(t.value)}
),e._super()},repaint:function(){var t,e;t=this.getEl().style,e=this._layoutRect,t.left=e.x+"px",t.top=e.y+"px",t.zIndex=131070}}),ve=ue.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.canFocus=!0,i.tooltip&&!1!==ve.tooltips&&(r.on("mouseenter",function(t){var e=r.tooltip().moveTo(-65535);if(t.control===r){var n=e.text(i.tooltip).show().testMoveRel(r.getEl(),["bc-tc","bc-tl","bc-tr"]);e.classes.toggle("tooltip-n","bc-tc"===n),e.classes.toggle("tooltip-nw","bc-tl"===n),e.classes.toggle("tooltip-ne","bc-tr"===n),e.moveRel(r.getEl(),n)}else e.hide()}),r.on("mouseleave mousedown click",function(){r.tooltip().remove(),r._tooltip=null})),r.aria("label",i.ariaLabel||i.tooltip)},tooltip:function(){return this._tooltip||(this._tooltip=new pe({type:"tooltip"}),ne.inheritUiContainer(this,this._tooltip),this._tooltip
.renderTo()),this._tooltip},postRender:function(){var t=this,e=t.settings;t._super(),t.parent()||!e.width&&!e.height||(t.initLayoutRect(),t.repaint()),e.autofocus&&t.focus()},bindStates:function(){var e=this;function n(t){e.aria("disabled",t),e.classes.toggle("disabled",t)}function i(t){e.aria("pressed",t),e.classes.toggle("active",t)}return e.state.on("change:disabled",function(t){n(t.value)}),e.state.on("change:active",function(t){i(t.value)}),e.state.get("disabled")&&n(!0),e.state.get("active")&&i(!0),e._super()},remove:function(){this._super(),this._tooltip&&(this._tooltip.remove(),this._tooltip=null)}}),be=ve.extend({Defaults:{value:0},init:function(t){this._super(t),this.classes.add("progress"),this.settings.filter||(this.settings.filter=function(t){return Math.round(t)})},renderHtml:function(){var t=this._id,e=this.classPrefix;return'<div id=&qu
ot;'+t+'" class="'+this.classes+'"><div class="'+e+'bar-container"><div class="'+e+'bar"></div></div><div class="'+e+'text">0%</div></div>'},postRender:function(){return this._super(),this.value(this.settings.value),this},bindStates:function(){var e=this;function n(t){t=e.settings.filter(t),e.getEl().lastChild.innerHTML=t+"%",e.getEl().firstChild.firstChild.style.width=t+"%"}return e.state.on("change:value",function(t){n(t.value)}),n(e.state.get("value")),e._super()}}),ye=function(t,e){t.getEl().lastChild.textContent=e+(t.progressBar?" "+t.progressBar.value()+"%":"")},xe=ue.extend({Mixins:[ge],Defaults:{classes:"widget notification"},init:function(t){var e=this;e._super(t),e.maxWidth=t.maxWidth,t.text&&e.text(t.text),t.icon&&(e.icon=t.icon),t.color&&(e.color=t.color),t.type&&e.classes
.add("notification-"+t.type),t.timeout&&(t.timeout<0||0<t.timeout)&&!t.closeButton?e.closeButton=!1:(e.classes.add("has-close"),e.closeButton=!0),t.progressBar&&(e.progressBar=new be),e.on("click",function(t){-1!==t.target.className.indexOf(e.classPrefix+"close")&&e.close()})},renderHtml:function(){var t,e=this,n=e.classPrefix,i="",r="",o="";return e.icon&&(i='<i class="'+n+"ico "+n+"i-"+e.icon+'"></i>'),t=' style="max-width: '+e.maxWidth+"px;"+(e.color?"background-color: "+e.color+';"':'"'),e.closeButton&&(r='<button type="button" class="'+n+'close" aria-hidden="true">\xd7</button>'),e.progressBar&&(o=e.progressBar.renderHtml()),'<div id="'+e._id+'" class="'+e.classes+'"'+t+' role="presentation">'+i+
'<div class="'+n+'notification-inner">'+e.state.get("text")+"</div>"+o+r+'<div style="clip: rect(1px, 1px, 1px, 1px);height: 1px;overflow: hidden;position: absolute;width: 1px;" aria-live="assertive" aria-relevant="additions" aria-atomic="true"></div></div>'},postRender:function(){var t=this;return c.setTimeout(function(){t.$el.addClass(t.classPrefix+"in"),ye(t,t.state.get("text"))},100),t._super()},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl().firstChild.innerHTML=t.value,ye(e,t.value)}),e.progressBar&&(e.progressBar.bindStates(),e.progressBar.state.on("change:value",function(t){ye(e,e.state.get("text"))})),e._super()},close:function(){return this.fire("close").isDefaultPrevented()||this.remove(),this},repaint:function(){var t,e;t=this.getEl().style,e=this._layoutRect,t.left=e
.x+"px",t.top=e.y+"px",t.zIndex=65534}});function we(o){var s=function(t){return t.inline?t.getElement():t.getContentAreaContainer()};return{open:function(t,e){var n,i=R.extend(t,{maxWidth:(n=s(o),St.getSize(n).width)}),r=new xe(i);return 0<(r.args=i).timeout&&(r.timer=setTimeout(function(){r.close(),e()},i.timeout)),r.on("close",function(){e()}),r.renderTo(),r},close:function(t){t.close()},reposition:function(t){Rt(t,function(t){t.moveTo(0,0)}),function(n){if(0<n.length){var t=n.slice(0,1)[0],e=s(o);t.moveRel(e,"tc-tc"),Rt(n,function(t,e){0<e&&t.moveRel(n[e-1].getEl(),"bc-tc")})}}(t)},getArgs:function(t){return t.args}}}function _e(t){var e,n;if(t.changedTouches)for(e="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<e.length;n++)t[e[n]]=t.changedTouches[0][e[n]]}function Re(t,h){var m,g,e,p,v,b,y,x=h.document||document;h=h||{};var w=x.getElementById(h.handle||t);e=functio
n(t){var e,n,i,r,o,s,a,l,u,c,d,f=(e=x,u=Math.max,n=e.documentElement,i=e.body,r=u(n.scrollWidth,i.scrollWidth),o=u(n.clientWidth,i.clientWidth),s=u(n.offsetWidth,i.offsetWidth),a=u(n.scrollHeight,i.scrollHeight),l=u(n.clientHeight,i.clientHeight),{width:r<s?o:r,height:a<u(n.offsetHeight,i.offsetHeight)?l:a});_e(t),t.preventDefault(),g=t.button,c=w,b=t.screenX,y=t.screenY,d=window.getComputedStyle?window.getComputedStyle(c,null).getPropertyValue("cursor"):c.runtimeStyle.cursor,m=Mt("<div></div>").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:d}).appendTo(x.body),Mt(x).on("mousemove touchmove",v).on("mouseup touchend",p),h.start(t)},v=function(t){if(_e(t),t.button!==g)return p(t);t.deltaX=t.screenX-b,t.deltaY=t.screenY-y,t.preventDefault(),h.drag(t)},p=function(t){_e(t),Mt(x).off("mousemove touchmove",v).off("mouseup touchend",p),m.remove(
),h.stop&&h.stop(t)},this.destroy=function(){Mt(w).off()},Mt(w).on("mousedown touchstart",e)}var Ce=tinymce.util.Tools.resolve("tinymce.ui.Factory"),ke=function(t){return!!t.getAttribute("data-mce-tabstop")};function Ee(t){var o,r,n=t.root;function i(t){return t&&1===t.nodeType}try{o=document.activeElement}catch(e){o=document.body}function s(t){return i(t=t||o)?t.getAttribute("role"):null}function a(t){for(var e,n=t||o;n=n.parentNode;)if(e=s(n))return e}function l(t){var e=o;if(i(e))return e.getAttribute("aria-"+t)}function u(t){var e=t.tagName.toUpperCase();return"INPUT"===e||"TEXTAREA"===e||"SELECT"===e}function c(e){var r=[];return function t(e){if(1===e.nodeType&&"none"!==e.style.display&&!e.disabled){var n;(u(n=e)&&!n.hidden||ke(n)||/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(s(n)))&&r.push(e);for(var i=0;i
<e.childNodes.length;i++)t(e.childNodes[i])}}(e||n.getEl()),r}function d(t){var e,n;(n=(t=t||r).parents().toArray()).unshift(t);for(var i=0;i<n.length&&!(e=n[i]).settings.ariaRoot;i++);return e}function f(t,e){return t<0?t=e.length-1:t>=e.length&&(t=0),e[t]&&e[t].focus(),t}function h(t,e){var n=-1,i=d();e=e||c(i.getEl());for(var r=0;r<e.length;r++)e[r]===o&&(n=r);n+=t,i.lastAriaIndex=f(n,e)}function m(){"tablist"===a()?h(-1,c(o.parentNode)):r.parent().submenu?b():h(-1)}function g(){var t=s(),e=a();"tablist"===e?h(1,c(o.parentNode)):"menuitem"===t&&"menu"===e&&l("haspopup")?y():h(1)}function p(){h(-1)}function v(){var t=s(),e=a();"menuitem"===t&&"menubar"===e?y():"button"===t&&l("haspopup")?y({key:"down"}):h(1)}function b(){r.fire("cancel")}function y(t){t=t||{},r.fire("click",{target:o,a
ria:t})}return r=n.getParentCtrl(o),n.on("keydown",function(t){function e(t,e){u(o)||ke(o)||"slider"!==s(o)&&!1!==e(t)&&t.preventDefault()}if(!t.isDefaultPrevented())switch(t.keyCode){case 37:e(t,m);break;case 39:e(t,g);break;case 38:e(t,p);break;case 40:e(t,v);break;case 27:b();break;case 14:case 13:case 32:e(t,y);break;case 9:!function(t){if("tablist"===a()){var e=c(r.getEl("body"))[0];e&&e.focus()}else h(t.shiftKey?-1:1)}(t),t.preventDefault()}}),n.on("focusin",function(t){o=t.target,r=t.control}),{focusFirst:function(t){var e=d(t),n=c(e.getEl());e.settings.ariaRemember&&"lastAriaIndex"in e?f(e.lastAriaIndex,n):f(0,n)}}}var He,Te,Se,Me,Ne={},Oe=ue.extend({init:function(t){var e=this;e._super(t),(t=e.settings).fixed&&e.state.set("fixed",!0),e._items=new $t,e.isRtl()&&e.classes.add("rtl"),e.bodyClasses=new At(function(){e.state.get("rendered")&am
p;&(e.getEl("body").className=this.toString())}),e.bodyClasses.prefix=e.classPrefix,e.classes.add("container"),e.bodyClasses.add("container-body"),t.containerCls&&e.classes.add(t.containerCls),e._layout=Ce.create((t.layout||"")+"layout"),e.settings.items?e.add(e.settings.items):e.add(e.render()),e._hasBody=!0},items:function(){return this._items},find:function(t){return(t=Ne[t]=Ne[t]||new Vt(t)).find(this)},add:function(t){return this.items().add(this.create(t)).parent(this),this},focus:function(t){var e,n,i,r=this;if(!t||!(n=r.keyboardNav||r.parents().eq(-1)[0].keyboardNav))return i=r.find("*"),r.statusbar&&i.add(r.statusbar.items()),i.each(function(t){if(t.settings.autofocus)return e=null,!1;t.canFocus&&(e=e||t)}),e&&e.focus(),r;n.focusFirst(r)},replace:function(t,e){for(var n,i=this.items(),r=i.length;r--;)if(i[r]===t){i[r]=e;break}0<=r&&((n=e.getEl())&&n.parentNode.
removeChild(n),(n=t.getEl())&&n.parentNode.removeChild(n)),e.parent(this)},create:function(t){var e,n=this,i=[];return R.isArray(t)||(t=[t]),R.each(t,function(t){t&&(t instanceof ue||("string"==typeof t&&(t={type:t}),e=R.extend({},n.settings.defaults,t),t.type=e.type=e.type||t.type||n.settings.defaultType||(e.defaults?e.defaults.type:null),t=Ce.create(e)),i.push(t))}),i},renderNew:function(){var i=this;return i.items().each(function(t,e){var n;t.parent(i),t.state.get("rendered")||((n=i.getEl("body")).hasChildNodes()&&e<=n.childNodes.length-1?Mt(n.childNodes[e]).before(t.renderHtml()):Mt(n).append(t.renderHtml()),t.postRender(),te.add(t))}),i._layout.applyClasses(i.items().filter(":visible")),i._lastRect=null,i},append:function(t){return this.add(t).renderNew()},prepend:function(t){return this.items().set(this.create(t).concat(this.items().toArray())),this.renderNew()},insert:function(t,e,n){var i,r,o;return t
=this.create(t),i=this.items(),!n&&e<i.length-1&&(e+=1),0<=e&&e<i.length&&(r=i.slice(0,e).toArray(),o=i.slice(e).toArray(),i.set(r.concat(t,o))),this.renderNew()},fromJSON:function(t){for(var e in t)this.find("#"+e).value(t[e]);return this},toJSON:function(){var i={};return this.find("*").each(function(t){var e=t.name(),n=t.value();e&&void 0!==n&&(i[e]=n)}),i},renderHtml:function(){var t=this,e=t._layout,n=this.settings.role;return t.preRender(),e.preRender(t),'<div id="'+t._id+'" class="'+t.classes+'"'+(n?' role="'+this.settings.role+'"':"")+'><div id="'+t._id+'-body" class="'+t.bodyClasses+'">'+(t.settings.html||"")+e.renderHtml(t)+"</div></div>"},postRender:function(){var t,e=this;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e.state.set("rendered",!0),e.set
tings.style&&e.$el.css(e.settings.style),e.settings.border&&(t=e.borderBox,e.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e.parent()||(e.keyboardNav=Ee({root:e})),e},initLayoutRect:function(){var t=this._super();return this._layout.recalc(this),t},recalc:function(){var t=this,e=t._layoutRect,n=t._lastRect;if(!n||n.w!==e.w||n.h!==e.h)return t._layout.recalc(t),e=t.layoutRect(),t._lastRect={x:e.x,y:e.y,w:e.w,h:e.h},!0},reflow:function(){var t;if(te.remove(this),this.visible()){for(ue.repaintControls=[],ue.repaintControls.map={},this.recalc(),t=ue.repaintControls.length;t--;)ue.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),ue.repaintControls=[]}return this}}),Pe={init:function(){this.on("repaint",this.renderScroll)},renderScroll:function(){var p=th
is,v=2;function n(){var m,g,t;function e(t,e,n,i,r,o){var s,a,l,u,c,d,f,h;if(a=p.getEl("scroll"+t)){if(f=e.toLowerCase(),h=n.toLowerCase(),Mt(p.getEl("absend")).css(f,p.layoutRect()[i]-1),!r)return void Mt(a).css("display","none");Mt(a).css("display","block"),s=p.getEl("body"),l=p.getEl("scroll"+t+"t"),u=s["client"+n]-2*v,c=(u-=m&&g?a["client"+o]:0)/s["scroll"+n],(d={})[f]=s["offset"+e]+v,d[h]=u,Mt(a).css(d),(d={})[f]=s["scroll"+e]*c,d[h]=u*c,Mt(l).css(d)}}t=p.getEl("body"),m=t.scrollWidth>t.clientWidth,g=t.scrollHeight>t.clientHeight,e("h","Left","Width","contentW",m,"Height"),e("v","Top","Height","contentH",g,"Width")}p.settings.autoScroll&&(p._hasScroll||(p._hasScroll=!0,function(){function t(s,a,l,u,c){var d,t=p
._id+"-scroll"+s,e=p.classPrefix;Mt(p.getEl()).append('<div id="'+t+'" class="'+e+"scrollbar "+e+"scrollbar-"+s+'"><div id="'+t+'t" class="'+e+'scrollbar-thumb"></div></div>'),p.draghelper=new Re(t+"t",{start:function(){d=p.getEl("body")["scroll"+a],Mt("#"+t).addClass(e+"active")},drag:function(t){var e,n,i,r,o=p.layoutRect();n=o.contentW>o.innerW,i=o.contentH>o.innerH,r=p.getEl("body")["client"+l]-2*v,e=(r-=n&&i?p.getEl("scroll"+s)["client"+c]:0)/p.getEl("body")["scroll"+l],p.getEl("body")["scroll"+a]=d+t["delta"+u]/e},stop:function(){Mt("#"+t).removeClass(e+"active")}})}p.classes.add("scroll"),t("v","Top","Height","Y","Width"),t("h","Left"
,"Width","X","Height")}(),p.on("wheel",function(t){var e=p.getEl("body");e.scrollLeft+=10*(t.deltaX||0),e.scrollTop+=10*t.deltaY,n()}),Mt(p.getEl("body")).on("scroll",n)),n())}},We=Oe.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[Pe],renderHtml:function(){var t=this,e=t._layout,n=t.settings.html;return t.preRender(),e.preRender(t),void 0===n?n='<div id="'+t._id+'-body" class="'+t.bodyClasses+'">'+e.renderHtml(t)+"</div>":("function"==typeof n&&(n=n.call(t)),t._hasBody=!1),'<div id="'+t._id+'" class="'+t.classes+'" hidefocus="1" tabindex="-1" role="group">'+(t._preBodyHtml||"")+n+"</div>"}}),De={resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,e){if(t<=1||e<=1){var n=St.ge
tWindowSize();t=t<=1?t*n.w:t,e=e<=1?e*n.h:e}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:e,w:t,h:e}).reflow()},resizeBy:function(t,e){var n=this.layoutRect();return this.resizeTo(n.w+t,n.h+e)}},Ae=[],Be=[];function Le(t,e){for(;t;){if(t===e)return!0;t=t.parent()}}function Ie(){He||(He=function(t){2!==t.button&&function(t){for(var e=Ae.length;e--;){var n=Ae[e],i=n.getParentCtrl(t.target);if(n.settings.autohide){if(i&&(Le(i,n)||n.parent()===i))continue;(t=n.fire("autohide",{target:t.target})).isDefaultPrevented()||n.hide()}}}(t)},Mt(document).on("click touchstart",He))}function ze(r){var t=St.getViewPort().y;function e(t,e){for(var n,i=0;i<Ae.length;i++)if(Ae[i]!==r)for(n=Ae[i].parent();n&&(n=n.parent());)n===r&&Ae[i].fixed(t).moveBy(0,e).repaint()}r.settings.autofix&&(r.state.get("fixed")?r._autoFixY>t&&(r.fixed(!1).layoutRect({y:r._autoFixY}).repaint(),e(!1,r._autoFixY-t))
:(r._autoFixY=r.layoutRect().y,r._autoFixY<t&&(r.fixed(!0).layoutRect({y:0}).repaint(),e(!0,t-r._autoFixY))))}function Fe(t,e){var n,i,r=Ue.zIndex||65535;if(t)Be.push(e);else for(n=Be.length;n--;)Be[n]===e&&Be.splice(n,1);if(Be.length)for(n=0;n<Be.length;n++)Be[n].modal&&(r++,i=Be[n]),Be[n].getEl().style.zIndex=r,Be[n].zIndex=r,r++;var o=Mt("#"+e.classPrefix+"modal-block",e.getContainerElm())[0];i?Mt(o).css("z-index",i.zIndex-1):o&&(o.parentNode.removeChild(o),Me=!1),Ue.currentZIndex=r}var Ue=We.extend({Mixins:[ge,De],init:function(t){var i=this;i._super(t),(i._eventsRoot=i).classes.add("floatpanel"),t.autohide&&(Ie(),function(){if(!Se){var t=document.documentElement,e=t.clientWidth,n=t.clientHeight;Se=function(){document.all&&e===t.clientWidth&&n===t.clientHeight||(e=t.clientWidth,n=t.clientHeight,Ue.hideAll())},Mt(window).on("resize",Se)}}(),Ae.push(i)),t.autofix&&am
p;(Te||(Te=function(){var t;for(t=Ae.length;t--;)ze(Ae[t])},Mt(window).on("scroll",Te)),i.on("move",function(){ze(this)})),i.on("postrender show",function(t){if(t.control===i){var e,n=i.classPrefix;i.modal&&!Me&&((e=Mt("#"+n+"modal-block",i.getContainerElm()))[0]||(e=Mt('<div id="'+n+'modal-block" class="'+n+"reset "+n+'fade"></div>').appendTo(i.getContainerElm())),c.setTimeout(function(){e.addClass(n+"in"),Mt(i.getEl()).addClass(n+"in")}),Me=!0),Fe(!0,i)}}),i.on("show",function(){i.parents().each(function(t){if(t.state.get("fixed"))return i.fixed(!0),!1})}),t.popover&&(i._preBodyHtml='<div class="'+i.classPrefix+'arrow"></div>',i.classes.add("popover").add("bottom").add(i.isRtl()?"end":"start")),i.aria("label",t.ariaLabel),i.aria("labelledby",i._id
),i.aria("describedby",i.describedBy||i._id+"-none")},fixed:function(t){var e=this;if(e.state.get("fixed")!==t){if(e.state.get("rendered")){var n=St.getViewPort();t?e.layoutRect().y-=n.y:e.layoutRect().y+=n.y}e.classes.toggle("fixed",t),e.state.set("fixed",t)}return e},show:function(){var t,e=this._super();for(t=Ae.length;t--&&Ae[t]!==this;);return-1===t&&Ae.push(this),e},hide:function(){return Ve(this),Fe(!1,this),this._super()},hideAll:function(){Ue.hideAll()},close:function(){return this.fire("close").isDefaultPrevented()||(this.remove(),Fe(!1,this)),this},remove:function(){Ve(this),this._super()},postRender:function(){return this.settings.bodyRole&&this.getEl("body").setAttribute("role",this.settings.bodyRole),this._super()}});function Ve(t){var e;for(e=Ae.length;e--;)Ae[e]===t&&Ae.splice(e,1);for(e=Be.length;e--;)Be[e]===t&&Be.splice(e,1)}Ue.hideAll=
function(){for(var t=Ae.length;t--;){var e=Ae[t];e&&e.settings.autohide&&(e.hide(),Ae.splice(t,1))}};var qe=[],Ye="";function $e(t){var e,n=Mt("meta[name=viewport]")[0];!1!==h.overrideViewPort&&(n||((n=document.createElement("meta")).setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(n)),(e=n.getAttribute("content"))&&void 0!==Ye&&(Ye=e),n.setAttribute("content",t?"width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0":Ye))}function Xe(t,e){(function(){for(var t=0;t<qe.length;t++)if(qe[t]._fullscreen)return!0;return!1})()&&!1===e&&Mt([document.documentElement,document.body]).removeClass(t+"fullscreen")}var je=Ue.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.
fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(t){var n=this;n._super(t),n.isRtl()&&n.classes.add("rtl"),n.classes.add("window"),n.bodyClasses.add("window-body"),n.state.set("fixed",!0),t.buttons&&(n.statusbar=new We({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:t.buttons}),n.statusbar.classes.add("foot"),n.statusbar.parent(n)),n.on("click",function(t){var e=n.classPrefix+"close";(St.hasClass(t.target,e)||St.hasClass(t.target.parentNode,e))&&n.close()}),n.on("cancel",function(){n.close()}),n.on("move",function(t){t.control===n&&Ue.hideAll()}),n.aria("describedby",n.describedBy||n._id+"-none"),n.aria("label",t.title),n._fullscreen=!1},recalc:functio
n(){var t,e,n,i,r=this,o=r.statusbar;r._fullscreen&&(r.layoutRect(St.getWindowSize()),r.layoutRect().contentH=r.layoutRect().innerH),r._super(),t=r.layoutRect(),r.settings.title&&!r._fullscreen&&(e=t.headerW)>t.w&&(n=t.x-Math.max(0,e/2),r.layoutRect({w:e,x:n}),i=!0),o&&(o.layoutRect({w:r.layoutRect().innerW}).recalc(),(e=o.layoutRect().minW+t.deltaW)>t.w&&(n=t.x-Math.max(0,e-t.w),r.layoutRect({w:e,x:n}),i=!0)),i&&r.recalc()},initLayoutRect:function(){var t,e=this,n=e._super(),i=0;if(e.settings.title&&!e._fullscreen){t=e.getEl("head");var r=St.getSize(t);n.headerW=r.width,n.headerH=r.height,i+=n.headerH}e.statusbar&&(i+=e.statusbar.layoutRect().h),n.deltaH+=i,n.minH+=i,n.h+=i;var o=St.getWindowSize();return n.x=e.settings.x||Math.max(0,o.w/2-n.w/2),n.y=e.settings.y||Math.max(0,o.h/2-n.h/2),n},renderHtml:function(){var t=this,e=t._layout,n=t._id,i=t.classPrefix,r=t.settings,o="",s="&
quot;,a=r.html;return t.preRender(),e.preRender(t),r.title&&(o='<div id="'+n+'-head" class="'+i+'window-head"><div id="'+n+'-title" class="'+i+'title">'+t.encode(r.title)+'</div><div id="'+n+'-dragh" class="'+i+'dragh"></div><button type="button" class="'+i+'close" aria-hidden="true"><i class="mce-ico mce-i-remove"></i></button></div>'),r.url&&(a='<iframe src="'+r.url+'" tabindex="-1"></iframe>'),void 0===a&&(a=e.renderHtml(t)),t.statusbar&&(s=t.statusbar.renderHtml()),'<div id="'+n+'" class="'+t.classes+'" hidefocus="1"><div class="'+t.classPrefix+'reset" role="application">'+o+'<div id="'+n+'-body" class="'+t.bodyClasses+'">'+a+"</div>"+s+"</div>&l
t;/div>"},fullscreen:function(t){var n,e,i=this,r=document.documentElement,o=i.classPrefix;if(t!==i._fullscreen)if(Mt(window).on("resize",function(){var t;if(i._fullscreen)if(n)i._timer||(i._timer=c.setTimeout(function(){var t=St.getWindowSize();i.moveTo(0,0).resizeTo(t.w,t.h),i._timer=0},50));else{t=(new Date).getTime();var e=St.getWindowSize();i.moveTo(0,0).resizeTo(e.w,e.h),50<(new Date).getTime()-t&&(n=!0)}}),e=i.layoutRect(),i._fullscreen=t){i._initial={x:e.x,y:e.y,w:e.w,h:e.h},i.borderBox=Pt("0"),i.getEl("head").style.display="none",e.deltaH-=e.headerH+2,Mt([r,document.body]).addClass(o+"fullscreen"),i.classes.add("fullscreen");var s=St.getWindowSize();i.moveTo(0,0).resizeTo(s.w,s.h)}else i.borderBox=Pt(i.settings.border),i.getEl("head").style.display="",e.deltaH+=e.headerH,Mt([r,document.body]).removeClass(o+"fullscreen"),i.classes.remove("fullscreen"),i.move
To(i._initial.x,i._initial.y).resizeTo(i._initial.w,i._initial.h);return i.reflow()},postRender:function(){var e,n=this;setTimeout(function(){n.classes.add("in"),n.fire("open")},0),n._super(),n.statusbar&&n.statusbar.postRender(),n.focus(),this.dragHelper=new Re(n._id+"-dragh",{start:function(){e={x:n.layoutRect().x,y:n.layoutRect().y}},drag:function(t){n.moveTo(e.x+t.deltaX,e.y+t.deltaY)}}),n.on("submit",function(t){t.isDefaultPrevented()||n.close()}),qe.push(n),$e(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var t,e=this;for(e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),Xe(e.classPrefix,!1),t=qe.length;t--;)qe[t]===e&&qe.splice(t,1);$e(0<qe.length)},getContentWindow:function(){var t=this.getEl().getElementsByTagName("iframe")[0];return t?t.contentWindow:null}});!function(){if(!h.desktop){var n={w:window.innerWidth,h:window.inn
erHeight};c.setInterval(function(){var t=window.innerWidth,e=window.innerHeight;n.w===t&&n.h===e||(n={w:t,h:e},Mt(window).trigger("resize"))},100)}Mt(window).on("resize",function(){var t,e,n=St.getWindowSize();for(t=0;t<qe.length;t++)e=qe[t].layoutRect(),qe[t].moveTo(qe[t].settings.x||Math.max(0,n.w/2-e.w/2),qe[t].settings.y||Math.max(0,n.h/2-e.h/2))})}();var Je,Ge,Ke,Ze=je.extend({init:function(t){t={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(t)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(t){var e,i=t.callback||function(){};function n(t,e,n){return{type:"button",text:t,subtype:n?"primary":"",onClick:function(t){t.control.parents()[1].close(),i(e)}}
}switch(t.buttons){case Ze.OK_CANCEL:e=[n("Ok",!0,!0),n("Cancel",!1)];break;case Ze.YES_NO:case Ze.YES_NO_CANCEL:e=[n("Yes",1,!0),n("No",0)],t.buttons===Ze.YES_NO_CANCEL&&e.push(n("Cancel",-1));break;default:e=[n("Ok",!0,!0)]}return new je({padding:20,x:t.x,y:t.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:e,title:t.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:t.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:t.onClose,onCancel:function(){i(!1)}}).renderTo(document.body).reflow()},alert:function(t,e){return"string"==typeof t&&(t={text:t}),t.callback=e,Ze.msgBox(t)},confirm:function(t,e){return"string"==typeof t&&(t={text:t}),t.callback=e,t.buttons=Ze.OK_CANCEL,Ze.msgBox(t)}}}),Qe=function(t,e){return{renderUI
:function(){return st(t,e)},getNotificationManagerImpl:function(){return we(t)},getWindowManagerImpl:function(){return{open:function(n,t,e){var i;return n.title=n.title||" ",n.url=n.url||n.file,n.url&&(n.width=parseInt(n.width||320,10),n.height=parseInt(n.height||240,10)),n.body&&(n.items={defaults:n.defaults,type:n.bodyType||"form",items:n.body,data:n.data,callbacks:n.commands}),n.url||n.buttons||(n.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit()}},{text:"Cancel",onclick:function(){i.close()}}]),(i=new je(n)).on("close",function(){e(i)}),n.data&&i.on("postRender",function(){this.find("*").each(function(t){var e=t.name();e in n.data&&t.value(n.data[e])})}),i.features=n||{},i.params=t||{},i=i.renderTo(document.body).reflow()},alert:function(t,e,n){var i;return(i=Ze.alert(t,function(){e()})).on("close",function(){n(i)})
,i},confirm:function(t,e,n){var i;return(i=Ze.confirm(t,function(t){e(t)})).on("close",function(){n(i)}),i},close:function(t){t.close()},getParams:function(t){return t.params},setParams:function(t,e){t.params=e}}}}},tn="undefined"!=typeof window?window:Function("return this;")(),en=function(t,e){return function(t,e){for(var n=e!==undefined&&null!==e?e:tn,i=0;i<t.length&&n!==undefined&&null!==n;++i)n=n[t[i]];return n}(t.split("."),e)},nn=function(t,e){var n=en(t,e);if(n===undefined||null===n)throw t+" not available on this browser";return n},rn=tinymce.util.Tools.resolve("tinymce.util.Promise"),on=function(n){return new rn(function(t){var e=new(nn("FileReader"));e.onloadend=function(){t(e.result.split(",")[1])},e.readAsDataURL(n)})},sn=function(){return new rn(function(e){var t;(t=document.createElement("input")).type="file",t.style.position="fixed"
,t.style.left=0,t.style.top=0,t.style.opacity=.001,document.body.appendChild(t),t.onchange=function(t){e(Array.prototype.slice.call(t.target.files))},t.click(),t.parentNode.removeChild(t)})},an=0,ln=function(t){return t+an+++(e=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+Date.now().toString(36)+e()+e()+e());var e},un=function(r,o){var s={};function t(t){var e,n,i;n=o[t?"startContainer":"endContainer"],i=o[t?"startOffset":"endOffset"],1===n.nodeType&&(e=r.create("span",{"data-mce-type":"bookmark"}),n.hasChildNodes()?(i=Math.min(i,n.childNodes.length-1),t?n.insertBefore(e,n.childNodes[i]):r.insertAfter(e,n.childNodes[i])):n.appendChild(e),n=e,i=0),s[t?"startContainer":"endContainer"]=n,s[t?"startOffset":"endOffset"]=i}return t(!0),o.collapsed||t(),s},cn=function(r,o){function t(t){var e,n,i;e=i=o[t?"startContainer":"
;endContainer"],n=o[t?"startOffset":"endOffset"],e&&(1===e.nodeType&&(n=function(t){for(var e=t.parentNode.firstChild,n=0;e;){if(e===t)return n;1===e.nodeType&&"bookmark"===e.getAttribute("data-mce-type")||n++,e=e.nextSibling}return-1}(e),e=e.parentNode,r.remove(i)),o[t?"startContainer":"endContainer"]=e,o[t?"startOffset":"endOffset"]=n)}t(!0),t();var e=r.createRng();return e.setStart(o.startContainer,o.startOffset),o.endContainer&&e.setEnd(o.endContainer,o.endOffset),e},dn=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),fn=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),hn=function(t){return"A"===t.nodeName&&t.hasAttribute("href")},mn=function(t){var e,n,i,r,o,s,a,l;return r=t.selection,o=t.dom,s=r.getRng(),a=o,l=fn.getNode(s.startContainer,s.startOffset),e=a.getParent(l,hn)||l,n=fn.getNode(s.endContainer,s.en
dOffset),i=t.getBody(),R.grep(function(t,e,n){var i,r,o=[];for(i=new dn(e,t),r=e;r&&(1===r.nodeType&&o.push(r),r!==n);r=i.next());return o}(i,e,n),hn)},gn=function(t){var e,n,i,r,o;n=mn(e=t),r=e.dom,o=e.selection,i=un(r,o.getRng()),R.each(n,function(t){e.dom.remove(t,!0)}),o.setRng(cn(r,i))},pn=function(t){t.selection.collapse(!1)},vn=function(t){t.focus(),gn(t),pn(t)},bn=function(t,e){var n,i,r,o,s,a=t.dom.getParent(t.selection.getStart(),"a[href]");a?(o=a,s=e,(r=t).focus(),r.dom.setAttrib(o,"href",s),pn(r)):(i=e,(n=t).execCommand("mceInsertLink",!1,{href:i}),pn(n))},yn=function(t,e,n){var i,r,o;t.plugins.table?t.plugins.table.insertTable(e,n):(r=e,o=n,(i=t).undoManager.transact(function(){var t,e;i.insertContent(function(t,e){var n,i,r;for(r='<table data-mce-id="mce" style="width: 100%">',r+="<tbody>",i=0;i<e;i++){for(r+="<tr>",n=0;n<t;n++)r+="<td><br><
/td>";r+="</tr>"}return r+="</tbody>",r+="</table>"}(r,o)),(t=i.dom.select("*[data-mce-id]")[0]).removeAttribute("data-mce-id"),e=i.dom.select("td,th",t),i.selection.setCursorLocation(e[0],0)}))},xn=function(t,e){t.execCommand("FormatBlock",!1,e)},wn=function(t,e,n){var i,r;r=(i=t.editorUpload.blobCache).create(ln("mceu"),n,e),i.add(r),t.insertContent(t.dom.createHTML("img",{src:r.blobUri()}))},_n=function(t,e){0===e.trim().length?vn(t):bn(t,e)},Rn=vn,Cn=function(n,t){n.addButton("quicklink",{icon:"link",tooltip:"Insert/Edit link",stateSelector:"a[href]",onclick:function(){t.showForm(n,"quicklink")}}),n.addButton("quickimage",{icon:"image",tooltip:"Insert image",onclick:function(){sn().then(function(t){var e=t[0];on(e).then(function(t){wn(n,t,e)})})}}),n.addButton("quicktable",{ic
on:"table",tooltip:"Insert table",onclick:function(){t.hide(),yn(n,2,2)}}),function(e){for(var t=function(t){return function(){xn(e,t)}},n=1;n<6;n++){var i="h"+n;e.addButton(i,{text:i.toUpperCase(),tooltip:"Heading "+n,stateSelector:i,onclick:t(i),onPostRender:function(){this.getEl().firstChild.firstChild.style.fontWeight="bold"}})}}(n)},kn=function(){var t=h.container;if(t&&"static"!==v.DOM.getStyle(t,"position",!0)){var e=v.DOM.getPos(t),n=e.x-t.scrollLeft,i=e.y-t.scrollTop;return pt.some({x:n,y:i})}return pt.none()},En=function(t){return/^www\.|\.(com|org|edu|gov|uk|net|ca|de|jp|fr|au|us|ru|ch|it|nl|se|no|es|mil)$/i.test(t.trim())},Hn=function(t){return/^https?:\/\//.test(t.trim())},Tn=function(t,e){return!Hn(e)&&En(e)?(n=t,i=e,new rn(function(e){n.windowManager.confirm("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(t){e(
!0===t?"http://"+i:i)})})):rn.resolve(e);var n,i},Sn=function(r,e){var t,n,i,o={};return t="quicklink",n={items:[{type:"button",name:"unlink",icon:"unlink",onclick:function(){r.focus(),Rn(r),e()},tooltip:"Remove link"},{type:"filepicker",name:"linkurl",placeholder:"Paste or type a link",filetype:"file",onchange:function(t){var e=t.meta;e&&e.attach&&(o={href:this.value(),attach:e.attach})}},{type:"button",icon:"checkmark",subtype:"primary",tooltip:"Ok",onclick:"submit"}],onshow:function(t){if(t.control===this){var e,n="";(e=r.dom.getParent(r.selection.getStart(),"a[href]"))&&(n=r.dom.getAttrib(e,"href")),this.fromJSON({linkurl:n}),i=this.find("#unlink"),e?i.show():i.hide(),this.find("#linkurl")[0].focus()}var i},onsubmit:function(t){Tn(r,t.data.linkurl).then(funct
ion(t){r.undoManager.transact(function(){t===o.href&&(o.attach(),o={}),_n(r,t)}),e()})}},(i=Ce.create(R.extend({type:"form",layout:"flex",direction:"row",padding:5,name:t,spacing:3},n))).on("show",function(){i.find("textbox").eq(0).each(function(t){t.focus()})}),i},Mn=function(n,t,e){var o,i,s=[];if(e)return R.each(B(i=e)?i:P(i)?i.split(/[ ,]/):[],function(t){if("|"===t)o=null;else if(n.buttons[t]){o||(o={type:"buttongroup",items:[]},s.push(o));var e=n.buttons[t];A(e)&&(e=e()),e.type=e.type||"button",(e=Ce.create(e)).on("postRender",(i=n,r=e,function(){var e,t,n=(t=function(t,e){return{selector:t,handler:e}},(e=r).settings.stateSelector?t(e.settings.stateSelector,function(t){e.active(t)}):e.settings.disabledStateSelector?t(e.settings.disabledStateSelector,function(t){e.disabled(t)}):null);null!==n&&i.selection.selectorChanged(n.selector,n.handler)})),o.items.push(e)}var
i,r}),Ce.create({type:"toolbar",layout:"flow",name:t,items:s})},Nn=function(){var l,c,o=function(t){return 0<t.items().length},u=function(t,e){var n,i,r=(n=t,i=e,R.map(i,function(t){return Mn(n,t.id,t.items)})).concat([Mn(t,"text",J(t)),Mn(t,"insert",G(t)),Sn(t,p)]);return Ce.create({type:"floatpanel",role:"dialog",classes:"tinymce tinymce-inline arrow",ariaLabel:"Inline toolbar",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!0,border:1,items:R.grep(r,o),oncancel:function(){t.focus()}})},d=function(t){t&&t.show()},f=function(t,e){t.moveTo(e.x,e.y)},h=function(n,i){i=i?i.substr(0,2):"",R.each({t:"down",b:"up",c:"center"},function(t,e){n.classes.toggle("arrow-"+t,e===i.substr(0,1))}),"cr"===i?(n.classes.toggle("arrow-left",!0),n.classes.toggle("arrow-right"
;,!1)):"cl"===i?(n.classes.toggle("arrow-left",!1),n.classes.toggle("arrow-right",!0)):R.each({l:"left",r:"right"},function(t,e){n.classes.toggle("arrow-"+t,e===i.substr(1,1))})},m=function(t,e){var n=t.items().filter("#"+e);return 0<n.length&&(n[0].show(),t.reflow(),!0)},g=function(t,e,n,i){var r,o,s,a;if(a=K(n),r=y(n),o=v.DOM.getRect(t.getEl()),s="insert"===e?Y(i,r,o):$(i,r,o)){var l=kn().getOr({x:0,y:0}),u={x:s.rect.x-l.x,y:s.rect.y-l.y,w:s.rect.w,h:s.rect.h};return f(t,X(a,c=i,r,u)),h(t,s.position),!0}return!1},p=function(){l&&l.hide()};return{show:function(t,e,n,i){var r,o,s,a;l||(S(t),(l=u(t,i)).renderTo().reflow().moveTo(n.x,n.y),t.nodeChanged()),o=e,s=t,a=n,d(r=l),r.items().hide(),m(r,o)?!1===g(r,o,s,a)&&p():p()},showForm:function(t,e){if(l){if(l.items().hide(),!m(l,e))return void p();var n,i,r,o=void 0;d(l),l.items().hide(),m(l,e),r=K(t),n=y(t),o=v.DOM.getRect(l.getEl(
)),(i=$(c,n,o))&&(o=i.rect,f(l,X(r,c,n,o)),h(l,i.position))}},reposition:function(t,e,n){l&&g(l,e,t,n)},inForm:function(){return l&&l.visible()&&0<l.items().filter("form:visible").length},hide:p,focus:function(){l&&l.find("toolbar:visible").eq(0).each(function(t){t.focus(!0)})},remove:function(){l&&(l.remove(),l=null)}}},On=Nt.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(t){this.settings=R.extend({},this.Defaults,t)},preRender:function(t){t.bodyClasses.add(this.settings.containerClass)},applyClasses:function(t){var e,n,i,r,o=this.settings;e=o.firstControlClass,n=o.lastControlClass,t.each(function(t){t.classes.remove(e).remove(n).add(o.controlClass),t.visible()&&(i||(i=t),r=t)}),i&&i.classes.add(e),r&&r.classes.add(n)},renderHtml:function(t){var e="";return this.applyClasses(t.items()),t.items().each(function(t){e+=t.render
Html()}),e},recalc:function(){},postRender:function(){},isNative:function(){return!1}}),Pn=On.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(t){t.items().filter(":visible").each(function(t){var e=t.settings;t.layoutRect({x:e.x,y:e.y,w:e.w,h:e.h}),t.recalc&&t.recalc()})},renderHtml:function(t){return'<div id="'+t._id+'-absend" class="'+t.classPrefix+'abs-end"></div>'+this._super(t)}}),Wn=ve.extend({Defaults:{classes:"widget btn",role:"button"},init:function(t){var e,n=this;n._super(t),t=n.settings,e=n.settings.size,n.on("click mousedown",function(t){t.preventDefault()}),n.on("touchstart",function(t){n.fire("click",t),t.preventDefault()}),t.subtype&&n.classes.add(t.subtype),e&&n.classes.add("btn-"+e),t.icon&&n.icon(t.icon)},icon:function(t){return arguments.length?(this.state.set("i
con",t),this):this.state.get("icon")},repaint:function(){var t,e=this.getEl().firstChild;e&&((t=e.style).width=t.height="100%"),this._super()},renderHtml:function(){var t,e,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a="",l=n.settings;return(t=l.image)?(o="none","string"!=typeof t&&(t=window.getSelection?t[0]:t[1]),t=" style=\"background-image: url('"+t+"')\""):t="",s&&(n.classes.add("btn-has-text"),a='<span class="'+r+'txt">'+n.encode(s)+"</span>"),o=o?r+"ico "+r+"i-"+o:"",e="boolean"==typeof l.active?' aria-pressed="'+l.active+'"':"",'<div id="'+i+'" class="'+n.classes+'" tabindex="-1"'+e+'><button id="'+i+'-button" role="presentation" type="button&qu
ot; tabindex="-1">'+(o?'<i class="'+o+'"'+t+"></i>":"")+a+"</button></div>"},bindStates:function(){var o=this,n=o.$,i=o.classPrefix+"txt";function s(t){var e=n("span."+i,o.getEl());t?(e[0]||(n("button:first",o.getEl()).append('<span class="'+i+'"></span>'),e=n("span."+i,o.getEl())),e.html(o.encode(t))):e.remove(),o.classes.toggle("btn-has-text",!!t)}return o.state.on("change:text",function(t){s(t.value)}),o.state.on("change:icon",function(t){var e=t.value,n=o.classPrefix;e=(o.settings.icon=e)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];e?(r&&r===i.firstChild||(r=document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=e):r&&i.removeChild(r),s(o.state.get("text"))}),o._super()}}
),Dn=Wn.extend({init:function(t){t=R.extend({text:"Browse...",multiple:!1,accept:null},t),this._super(t),this.classes.add("browsebutton"),t.multiple&&this.classes.add("multiple")},postRender:function(){var n=this,e=St.create("input",{type:"file",id:n._id+"-browse",accept:n.settings.accept});n._super(),Mt(e).on("change",function(t){var e=t.target.files;n.value=function(){return e.length?n.settings.multiple?e:e[0]:null},t.preventDefault(),e.length&&n.fire("change",t)}),Mt(e).on("click",function(t){t.stopPropagation()}),Mt(n.getEl("button")).on("click",function(t){t.stopPropagation(),e.click()}),n.getEl().appendChild(e)},remove:function(){Mt(this.getEl("button")).off(),Mt(this.getEl("input")).off(),this._super()}}),An=Oe.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var t=this,e=t._layout;retur
n t.classes.add("btn-group"),t.preRender(),e.preRender(t),'<div id="'+t._id+'" class="'+t.classes+'"><div id="'+t._id+'-body">'+(t.settings.html||"")+e.renderHtml(t)+"</div></div>"}}),Bn=ve.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(t){var e=this;e._super(t),e.on("click mousedown",function(t){t.preventDefault()}),e.on("click",function(t){t.preventDefault(),e.disabled()||e.checked(!e.checked())}),e.checked(e.settings.checked)},checked:function(t){return arguments.length?(this.state.set("checked",t),this):this.state.get("checked")},value:function(t){return arguments.length?this.checked(t):this.checked()},renderHtml:function(){var t=this,e=t._id,n=t.classPrefix;return'<div id="'+e+'" class="'+t.classes+'" unselectable="on" aria-labelledby="'+e+'-al" tabindex="-1
"><i class="'+n+"ico "+n+'i-checkbox"></i><span id="'+e+'-al" class="'+n+'label">'+t.encode(t.state.get("text"))+"</span></div>"},bindStates:function(){var o=this;function e(t){o.classes.toggle("checked",t),o.aria("checked",t)}return o.state.on("change:text",function(t){o.getEl("al").firstChild.data=o.translate(t.value)}),o.state.on("change:checked change:value",function(t){o.fire("change"),e(t.value)}),o.state.on("change:icon",function(t){var e=t.value,n=o.classPrefix;if(void 0===e)return o.settings.icon;e=(o.settings.icon=e)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];e?(r&&r===i.firstChild||(r=document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=e):r&&i.removeChild(r)}),o.state.get
("checked")&&e(!0),o._super()}}),Ln=tinymce.util.Tools.resolve("tinymce.util.VK"),In=ve.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.classes.add("combobox"),r.subinput=!0,r.ariaTarget="inp",i.menu=i.menu||i.values,i.menu&&(i.icon="caret"),r.on("click",function(t){var e=t.target,n=r.getEl();if(Mt.contains(n,e)||e===n)for(;e&&e!==n;)e.id&&-1!==e.id.indexOf("-open")&&(r.fire("action"),i.menu&&(r.showMenu(),t.aria&&r.menu.items()[0].focus())),e=e.parentNode}),r.on("keydown",function(t){var e;13===t.keyCode&&"INPUT"===t.target.nodeName&&(t.preventDefault(),r.parents().reverse().each(function(t){if(t.toJSON)return e=t,!1}),r.fire("submit",{data:e.toJSON()}))}),r.on("keyup",function(t){if("INPUT"===t.target.nodeName){var e=r.state.get("value"),n=t.target.value;n!=
=e&&(r.state.set("value",n),r.fire("autocomplete",t))}}),r.on("mouseover",function(t){var e=r.tooltip().moveTo(-65535);if(r.statusLevel()&&-1!==t.target.className.indexOf(r.classPrefix+"status")){var n=r.statusMessage()||"Ok",i=e.text(n).show().testMoveRel(t.target,["bc-tc","bc-tl","bc-tr"]);e.classes.toggle("tooltip-n","bc-tc"===i),e.classes.toggle("tooltip-nw","bc-tl"===i),e.classes.toggle("tooltip-ne","bc-tr"===i),e.moveRel(t.target,i)}})},statusLevel:function(t){return 0<arguments.length&&this.state.set("statusLevel",t),this.state.get("statusLevel")},statusMessage:function(t){return 0<arguments.length&&this.state.set("statusMessage",t),this.state.get("statusMessage")},showMenu:function(){var t,e=this,n=e.settings;e.menu||((t=n.menu||[]).length?t={type:"menu&qu
ot;,items:t}:t.type=t.type||"menu",e.menu=Ce.create(t).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control.items().each(function(t){t.active(t.value()===e.value())})}).fire("show"),e.menu.on("select",function(t){e.value(t.control.value())}),e.on("focusin",function(t){"INPUT"===t.target.tagName.toUpperCase()&&e.menu.hide()}),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var t,e,n=this,i=n.getEl(),r=n.getEl("open"),o=n.layoutRect(),s=0,a=i.firstChild;n.statusLevel()&&"none"!==n.statusLevel()&&(s=parseIn
t(St.getRuntimeStyle(a,"padding-right"),10)-parseInt(St.getRuntimeStyle(a,"padding-left"),10)),t=r?o.w-St.getSize(r).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(e=n.layoutRect().h-2+"px"),Mt(a).css({width:t-s,lineHeight:e}),n._super(),n},postRender:function(){var e=this;return Mt(this.getEl("inp")).on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)}),e._super()},renderHtml:function(){var t,e,n,i=this,r=i._id,o=i.settings,s=i.classPrefix,a=i.state.get("value")||"",l="",u="";return"spellcheck"in o&&(u+=' spellcheck="'+o.spellcheck+'"'),o.maxLength&&(u+=' maxlength="'+o.maxLength+'"'),o.size&&(u+=' size="'+o.size+'"'),o.subtype&&(u+=' type="'+o.subtype+'"'),n='<i id="'+r+'-status" class="mce-st
atus mce-ico" style="display: none"></i>',i.disabled()&&(u+=' disabled="disabled"'),(t=o.icon)&&"caret"!==t&&(t=s+"ico "+s+"i-"+o.icon),e=i.state.get("text"),(t||e)&&(l='<div id="'+r+'-open" class="'+s+"btn "+s+'open" tabIndex="-1" role="button"><button id="'+r+'-action" type="button" hidefocus="1" tabindex="-1">'+("caret"!==t?'<i class="'+t+'"></i>':'<i class="'+s+'caret"></i>')+(e?(t?" ":"")+e:"")+"</button></div>",i.classes.add("has-open")),'<div id="'+r+'" class="'+i.classes+'"><input id="'+r+'-inp" class="'+s+'textbox" value="'+i.encode(a,!1)+'" hidefocus="1"'+u+' placeholder="'+i.encode
(o.placeholder)+'" />'+n+l+"</div>"},value:function(t){return arguments.length?(this.state.set("value",t),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},showAutoComplete:function(t,i){var r=this;if(0!==t.length){r.menu?r.menu.items().remove():r.menu=Ce.create({type:"menu",classes:"combobox-menu",layout:"flow"}).parent(r).renderTo(),R.each(t,function(t){var e,n;r.menu.add({text:t.title,url:t.previewUrl,match:i,classes:"menu-item-ellipsis",onclick:(e=t.value,n=t.title,function(){r.fire("selectitem",{title:n,value:e})})})}),r.menu.renderNew(),r.hideMenu(),r.menu.on("cancel",function(t){t.control.parent()===r.menu&&(t.stopPropagation(),r.focus(),r.hideMenu())}),r.menu.on("select",function(){r.focus()});var e=r.layoutRect().w;r.menu.layoutRect({w:e,minW:0,maxW:e}),r.men
u.repaint(),r.menu.reflow(),r.menu.show(),r.menu.moveRel(r.getEl(),r.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])}else r.hideMenu()},hideMenu:function(){this.menu&&this.menu.hide()},bindStates:function(){var r=this;r.state.on("change:value",function(t){r.getEl("inp").value!==t.value&&(r.getEl("inp").value=t.value)}),r.state.on("change:disabled",function(t){r.getEl("inp").disabled=t.value}),r.state.on("change:statusLevel",function(t){var e=r.getEl("status"),n=r.classPrefix,i=t.value;St.css(e,"display","none"===i?"none":""),St.toggleClass(e,n+"i-checkmark","ok"===i),St.toggleClass(e,n+"i-warning","warn"===i),St.toggleClass(e,n+"i-error","error"===i),r.classes.toggle("has-status","none"!==i),r.repaint()}),St.on(r.getEl("status"),"
;mouseleave",function(){r.tooltip().hide()}),r.on("cancel",function(t){r.menu&&r.menu.visible()&&(t.stopPropagation(),r.hideMenu())});var n=function(t,e){e&&0<e.items().length&&e.items().eq(t)[0].focus()};return r.on("keydown",function(t){var e=t.keyCode;"INPUT"===t.target.nodeName&&(e===Ln.DOWN?(t.preventDefault(),r.fire("autocomplete"),n(0,r.menu)):e===Ln.UP&&(t.preventDefault(),n(-1,r.menu)))}),r._super()},remove:function(){Mt(this.getEl("inp")).off(),this.menu&&this.menu.remove(),this._super()}}),zn=In.extend({init:function(t){var e=this;t.spellcheck=!1,t.onaction&&(t.icon="none"),e._super(t),e.classes.add("colorbox"),e.on("change keyup postrender",function(){e.repaintColor(e.value())})},repaintColor:function(t){var e=this.getEl("open"),n=e?e.getElementsByTagName("i")[0]:null;if(n)try{n.style.background=t}catc
h(i){}},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.state.get("rendered")&&e.repaintColor(t.value)}),e._super()}}),Fn=Wn.extend({showPanel:function(){var e=this,t=e.settings;if(e.classes.add("opened"),e.panel)e.panel.show();else{var n=t.panel;n.type&&(n={layout:"grid",items:n}),n.role=n.role||"dialog",n.popover=!0,n.autohide=!0,n.ariaRoot=!0,e.panel=new Ue(n).on("hide",function(){e.classes.remove("opened")}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}var i=e.panel.testMoveRel(e.getEl(),t.popoverAlign||(e.isRtl()?["bc-tc","bc-tl","bc-tr"]:["bc-tc","bc-tr","bc-tl","tc-bc","tc-br","tc-bl"]));e.panel.classes.toggle("start","l"===i.subst
r(-1)),e.panel.classes.toggle("end","r"===i.substr(-1));var r="t"===i.substr(0,1);e.panel.classes.toggle("bottom",!r),e.panel.classes.toggle("top",r),e.panel.moveRel(e.getEl(),i)},hidePanel:function(){this.panel&&this.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}}),Un=v.DOM,Vn=Fn.extend({init:function(t){this._super(t),this.classes.add("splitbtn"),this.classes.add("colorbutton")},color:function(t){return t?(this._color=t,this.getEl("preview").style.backgroundColor=t,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderH
tml:function(){var t=this,e=t._id,n=t.classPrefix,i=t.state.get("text"),r=t.settings.icon?n+"ico "+n+"i-"+t.settings.icon:"",o=t.settings.image?" style=\"background-image: url('"+t.settings.image+"')\"":"",s="";return i&&(t.classes.add("btn-has-text"),s='<span class="'+n+'txt">'+t.encode(i)+"</span>"),'<div id="'+e+'" class="'+t.classes+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+o+"></i>":"")+'<span id="'+e+'-preview" class="'+n+'preview"></span>'+s+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1&quo
t;> <i class="'+n+'caret"></i></button></div>'},postRender:function(){var e=this,n=e.settings.onclick;return e.on("click",function(t){t.aria&&"down"===t.aria.key||t.control!==e||Un.getParent(t.target,"."+e.classPrefix+"open")||(t.stopImmediatePropagation(),n.call(e,t))}),delete e.settings.onclick,e._super()}}),qn=tinymce.util.Tools.resolve("tinymce.util.Color"),Yn=ve.extend({Defaults:{classes:"widget colorpicker"},init:function(t){this._super(t)},postRender:function(){var n,i,r,o,s,a=this,l=a.color();function u(t,e){var n,i,r=St.getPos(t);return n=e.pageX-r.x,i=e.pageY-r.y,{x:n=Math.max(0,Math.min(n/t.clientWidth,1)),y:i=Math.max(0,Math.min(i/t.clientHeight,1))}}function c(t,e){var n=(360-t.h)/360;St.css(r,{top:100*n+"%"}),e||St.css(s,{left:t.s+"%",top:100-t.v+"%"}),o.style.background=qn({s:100,v:100,h:t.h}).toHex(),a.color().parse({s:t.s,v:t.v,h:t.h
})}function t(t){var e;e=u(o,t),n.s=100*e.x,n.v=100*(1-e.y),c(n),a.fire("change")}function e(t){var e;e=u(i,t),(n=l.toHsv()).h=360*(1-e.y),c(n,!0),a.fire("change")}i=a.getEl("h"),r=a.getEl("hp"),o=a.getEl("sv"),s=a.getEl("svp"),a._repaint=function(){c(n=l.toHsv())},a._super(),a._svdraghelper=new Re(a._id+"-sv",{start:t,drag:t}),a._hdraghelper=new Re(a._id+"-h",{start:e,drag:e}),a._repaint()},rgb:function(){return this.color().toRgb()},value:function(t){if(!arguments.length)return this.color().toHex();this.color().parse(t),this._rendered&&this._repaint()},color:function(){return this._color||(this._color=qn()),this._color},renderHtml:function(){var t,e=this._id,o=this.classPrefix,s="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000";return t='<div id="'+e+'-h" class="'+o+'colorpicker-h" style="background: -
ms-linear-gradient(top,'+s+");background: linear-gradient(to bottom,"+s+');">'+function(){var t,e,n,i,r="";for(n="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",t=0,e=(i=s.split(",")).length-1;t<e;t++)r+='<div class="'+o+'colorpicker-h-chunk" style="height:'+100/e+"%;"+n+i[t]+",endColorstr="+i[t+1]+");-ms-"+n+i[t]+",endColorstr="+i[t+1]+')"></div>';return r}()+'<div id="'+e+'-hp" class="'+o+'colorpicker-h-marker"></div></div>','<div id="'+e+'" class="'+this.classes+'"><div id="'+e+'-sv" class="'+o+'colorpicker-sv"><div class="'+o+'colorpicker-overlay1"><div class="'+o+'colorpicker-overlay2"><div id="'+e+'-svp" class="'+o+'colorpicker-selector1"><div class="'+o+'colorpicker-se
lector2"></div></div></div></div></div>'+t+"</div>"}}),$n=ve.extend({init:function(t){t=R.extend({height:100,text:"Drop an image here",multiple:!1,accept:null},t),this._super(t),this.classes.add("dropzone"),t.multiple&&this.classes.add("multiple")},renderHtml:function(){var t,e,n=this.settings;return t={id:this._id,hidefocus:"1"},e=St.create("div",t,"<span>"+this.translate(n.text)+"</span>"),n.height&&St.css(e,"height",n.height+"px"),n.width&&St.css(e,"width",n.width+"px"),e.className=this.classes,e.outerHTML},postRender:function(){var i=this,t=function(t){t.preventDefault(),i.classes.toggle("dragenter"),i.getEl().className=i.classes};i._super(),i.$el.on("dragover",function(t){t.preventDefault()}),i.$el.on("dragenter",t),i.$el.on("dragleave",t),i.
$el.on("drop",function(t){if(t.preventDefault(),!i.state.get("disabled")){var e=function(t){var e=i.settings.accept;if("string"!=typeof e)return t;var n=new RegExp("("+e.split(/\s*,\s*/).join("|")+")$","i");return R.grep(t,function(t){return n.test(t.name)})}(t.dataTransfer.files);i.value=function(){return e.length?i.settings.multiple?e:e[0]:null},e.length&&i.fire("change",t)}})},remove:function(){this.$el.off(),this._super()}}),Xn=ve.extend({init:function(t){var n=this;t.delimiter||(t.delimiter="\xbb"),n._super(t),n.classes.add("path"),n.canFocus=!0,n.on("click",function(t){var e;(e=t.target.getAttribute("data-index"))&&n.fire("select",{value:n.row()[e],index:e})}),n.row(n.settings.row)},focus:function(){return this.getEl().firstChild.focus(),this},row:function(t){return arguments.length?(this.state.set("row",t),this):this.state
.get("row")},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'">'+this._getDataPathHtml(this.state.get("row"))+"</div>"},bindStates:function(){var e=this;return e.state.on("change:row",function(t){e.innerHtml(e._getDataPathHtml(t.value))}),e._super()},_getDataPathHtml:function(t){var e,n,i=t||[],r="",o=this.classPrefix;for(e=0,n=i.length;e<n;e++)r+=(0<e?'<div class="'+o+'divider" aria-hidden="true"> '+this.settings.delimiter+" </div>":"")+'<div role="button" class="'+o+"path-item"+(e===n-1?" "+o+"last":"")+'" data-index="'+e+'" tabindex="-1" id="'+this._id+"-"+e+'" aria-level="'+(e+1)+'">'+i[e].name+"</div>";return r||(r='<div class="'+o+'path-item">\xa0</div>'),r}}),j
n=Xn.extend({postRender:function(){var o=this,s=o.settings.editor;function a(t){if(1===t.nodeType){if("BR"===t.nodeName||t.getAttribute("data-mce-bogus"))return!0;if("bookmark"===t.getAttribute("data-mce-type"))return!0}return!1}return!1!==s.settings.elementpath&&(o.on("select",function(t){s.focus(),s.selection.select(this.row()[t.index].element),s.nodeChanged()}),s.on("nodeChange",function(t){for(var e=[],n=t.parents,i=n.length;i--;)if(1===n[i].nodeType&&!a(n[i])){var r=s.fire("ResolveName",{name:n[i].nodeName.toLowerCase(),target:n[i]});if(r.isDefaultPrevented()||e.push({name:r.name,element:n[i]}),r.isPropagationStopped())break}o.row(e)})),o._super()}}),Jn=Oe.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var t=this,e=t._layout,n=t.classPrefix;return t.classes.add("formitem"),e.preRender(t),'<div id="'+t._id+'" cl
ass="'+t.classes+'" hidefocus="1" tabindex="-1">'+(t.settings.title?'<div id="'+t._id+'-title" class="'+n+'title">'+t.settings.title+"</div>":"")+'<div id="'+t._id+'-body" class="'+t.bodyClasses+'">'+(t.settings.html||"")+e.renderHtml(t)+"</div></div>"}}),Gn=Oe.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:15,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var i=this,t=i.items();i.settings.formItemDefaults||(i.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),t.each(function(t){var e,n=t.settings.label;n&&((e=new Jn(R.extend({items:{type:"label",id:t._id+"-l",text:n,flex:0,forId:t._id,disabled:t.disabled()}},i.settings.formItem
Defaults))).type="formitem",t.aria("labelledby",t._id+"-l"),"undefined"==typeof t.settings.flex&&(t.settings.flex=1),i.replace(t,e),e.add(t))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){this._super(),this.fromJSON(this.settings.data)},bindStates:function(){var n=this;function t(){var t,e,i=0,r=[];if(!1!==n.settings.labelGapCalc)for(("children"===n.settings.labelGapCalc?n.find("formitem"):n.items()).filter("formitem").each(function(t){var e=t.items()[0],n=e.getEl().clientWidth;i=i<n?n:i,r.push(e)}),e=n.settings.labelGap||0,t=r.length;t--;)r[t].settings.minWidth=i+e}n._super(),n.on("show",t),t()}}),Kn=Gn.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var t=this,e=t
._layout,n=t.classPrefix;return t.preRender(),e.preRender(t),'<fieldset id="'+t._id+'" class="'+t.classes+'" hidefocus="1" tabindex="-1">'+(t.settings.title?'<legend id="'+t._id+'-title" class="'+n+'fieldset-title">'+t.settings.title+"</legend>":"")+'<div id="'+t._id+'-body" class="'+t.bodyClasses+'">'+(t.settings.html||"")+e.renderHtml(t)+"</div></fieldset>"}}),Zn=0,Qn=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:lt(t)}},ti={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",t),"HTML must have a single root node";return Qn(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);re
turn Qn(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return Qn(n)},fromDom:Qn,fromPoint:function(t,e,n){var i=t.dom();return pt.from(i.elementFromPoint(e,n)).map(Qn)}},ei=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE,Node.DOCUMENT_NODE),ni=(Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE),ii=(Node.TEXT_NODE,Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,function(t,e){var n=function(t,e){for(var n=0;n<t.length;n++){var i=t[n];if(i.test(e))return i}return undefined}(t,e);if(!n)return{major:0,minor:0};var i=function(t){return Number(e.replace(n,"$"+t))};return oi(i(1),i(2))}),ri=function(){return oi(0,0)},oi=function(t,e){return{major:t,minor:e}},si={nu:oi,detect:function(t,e){var n=String(e).toLowerCase();return 0===t.length?ri():ii(t,n)},unknown:ri},ai="Firefox",li=function(t,e){return function(){return e===t}},ui=function(t){var e=t.current;return{curren
t:e,version:t.version,isEdge:li("Edge",e),isChrome:li("Chrome",e),isIE:li("IE",e),isOpera:li("Opera",e),isFirefox:li(ai,e),isSafari:li("Safari",e)}},ci={unknown:function(){return ui({current:undefined,version:si.unknown()})},nu:ui,edge:lt("Edge"),chrome:lt("Chrome"),ie:lt("IE"),opera:lt("Opera"),firefox:lt(ai),safari:lt("Safari")},di="Windows",fi="Android",hi="Solaris",mi="FreeBSD",gi=function(t,e){return function(){return e===t}},pi=function(t){var e=t.current;return{current:e,version:t.version,isWindows:gi(di,e),isiOS:gi("iOS",e),isAndroid:gi(fi,e),isOSX:gi("OSX",e),isLinux:gi("Linux",e),isSolaris:gi(hi,e),isFreeBSD:gi(mi,e)}},vi={unknown:function(){return pi({current:undefined,version:si.unknown()})},nu:pi,windows:lt(di),ios:lt("iOS"),android:lt(fi),linux:lt("Linux"),osx:lt("OSX"),so
laris:lt(hi),freebsd:lt(mi)},bi=function(t,e){var n=String(e).toLowerCase();return function(t,e){for(var n=0,i=t.length;n<i;n++){var r=t[n];if(e(r,n,t))return pt.some(r)}return pt.none()}(t,function(t){return t.search(n)})},yi=function(t,n){return bi(t,n).map(function(t){var e=si.detect(t.versionRegexes,n);return{current:t.name,version:e}})},xi=function(t,n){return bi(t,n).map(function(t){var e=si.detect(t.versionRegexes,n);return{current:t.name,version:e}})},wi=function(t,e){return-1!==t.indexOf(e)},_i=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Ri=function(e){return function(t){return wi(t,e)}},Ci=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(t){return wi(t,"edge/")&&wi(t,"chrome")&&wi(t,"safari")&&wi(t,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,_i],search:function(t){return wi(t,"chrome")&&!wi(t,"chromefra
me")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(t){return wi(t,"msie")||wi(t,"trident")}},{name:"Opera",versionRegexes:[_i,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Ri("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Ri("firefox")},{name:"Safari",versionRegexes:[_i,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(t){return(wi(t,"safari")||wi(t,"mobile/"))&&wi(t,"applewebkit")}}],ki=[{name:"Windows",search:Ri("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(t){return wi(t,"iphone")||wi(t,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Ri("android&q
uot;),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Ri("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Ri("linux"),versionRegexes:[]},{name:"Solaris",search:Ri("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Ri("freebsd"),versionRegexes:[]}],Ei={browsers:lt(Ci),oses:lt(ki)},Hi=function(t){var e,n,i,r,o,s,a,l,u,c,d,f=Ei.browsers(),h=Ei.oses(),m=yi(f,t).fold(ci.unknown,ci.nu),g=xi(h,t).fold(vi.unknown,vi.nu);return{browser:m,os:g,deviceType:(n=m,i=t,r=(e=g).isiOS()&&!0===/ipad/i.test(i),o=e.isiOS()&&!r,s=e.isAndroid()&&3===e.version.major,a=e.isAndroid()&&4===e.version.major,l=r||s||a&&!0===/mobile/i.test(i),u=e.isiOS()||e.isAndroid(),c=u&&!l,d=n.isSafari()&&e.isiOS()&&!1===/safari/i.test(i),{isiPad:lt(r),isiPhone:lt(o),isTablet:lt(l),isPhone:lt(c),isTouch:lt(u),isAndroid:e.isAndroi
d,isiOS:e.isiOS,isWebView:lt(d)})}},Ti=(Ke=!(Je=function(){var t=navigator.userAgent;return Hi(t)}),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ke||(Ke=!0,Ge=Je.apply(null,t)),Ge}),Si=ni,Mi=ei,Ni=function(t){return t.nodeType!==Si&&t.nodeType!==Mi||0===t.childElementCount},Oi=(Ti().browser.isIE(),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]}("element","offset"),R.trim),Pi=function(e){return function(t){if(t&&1===t.nodeType){if(t.contentEditable===e)return!0;if(t.getAttribute("data-mce-contenteditable")===e)return!0}return!1}},Wi=Pi("true"),Di=Pi("false"),Ai=function(t,e,n,i,r){return{type:t,title:e,url:n,level:i,attach:r}},Bi=function(t){return t.innerText||t.textContent},Li=function(t){return t.id?t.id:(e="h",n=(new Date).getTime(),e+"_"+Math.floor(1e9*Math.random())+ ++Zn+String(n));var e,n},Ii=function(t){return(e=t)&&"A&
quot;===e.nodeName&&(e.id||e.name)&&Fi(t);var e},zi=function(t){return t&&/^(H[1-6])$/.test(t.nodeName)},Fi=function(t){return function(t){for(;t=t.parentNode;){var e=t.contentEditable;if(e&&"inherit"!==e)return Wi(t)}return!1}(t)&&!Di(t)},Ui=function(t){return zi(t)&&Fi(t)},Vi=function(t){var e,n=Li(t);return Ai("header",Bi(t),"#"+n,zi(e=t)?parseInt(e.nodeName.substr(1),10):0,function(){t.id=n})},qi=function(t){var e=t.id||t.name,n=Bi(t);return Ai("anchor",n||"#"+e,"#"+e,0,at)},Yi=function(t){var e,n,i,r,o,s;return e="h1,h2,h3,h4,h5,h6,a:not([href])",n=t,_t((Ti().browser.isIE(),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]}("element","offset"),i=ti.fromDom(n),r=e,s=(o=i)===undefined?document:o.dom(),Ni(s)?[]:_t(s.querySelectorAll(r),ti.fromDom)),function(t){return t.dom()})},$i=function(t){return 0<Oi(t.title).length}
,Xi=function(t){var e,n=Yi(t);return Ct((e=n,_t(Ct(e,Ui),Vi)).concat(_t(Ct(n,Ii),qi)),$i)},ji={},Ji=function(t){return{title:t.title,value:{title:{raw:t.title},url:t.url,attach:t.attach}}},Gi=function(t,e){return{title:t,value:{title:t,url:e,attach:at}}},Ki=function(t,e,n){var i=e in t?t[e]:n;return!1===i?null:i},Zi=function(t,i,r,e){var n,o,s,a,l,u,c={title:"-"},d=function(t){var e=t.hasOwnProperty(r)?t[r]:[],n=Ct(e,function(t){return e=t,!wt(i,function(t){return t.url===e});var e});return R.map(n,function(t){return{title:t,value:{title:t,url:t,attach:at}}})},f=function(e){var t,n=Ct(i,function(t){return t.type===e});return t=n,R.map(t,Ji)};return!1===e.typeahead_urls?[]:"file"===r?(n=[tr(t,d(ji)),tr(t,f("header")),tr(t,(a=f("anchor"),l=Ki(e,"anchor_top","#top"),u=Ki(e,"anchor_bottom","#bottom"),null!==l&&a.unshift(Gi("<top>",l)),null!==u&&a.push(Gi("<bottom>&q
uot;,u)),a))],o=function(t,e){return 0===t.length||0===e.length?t.concat(e):t.concat(c,e)},s=[],Rt(n,function(t){s=o(s,t)}),s):tr(t,d(ji))},Qi=function(t,e){var n,i,r,o=ji[e];/^https?/.test(t)&&(o?(n=o,i=t,r=xt(n,i),-1===r?pt.none():pt.some(r)).isNone()&&(ji[e]=o.slice(0,5).concat(t)):ji[e]=[t])},tr=function(t,e){var n=t.toLowerCase(),i=R.grep(e,function(t){return-1!==t.title.toLowerCase().indexOf(n)});return 1===i.length&&i[0].title===t?[]:i},er=function(o,t,n){var i=t.filepicker_validator_handler;i&&o.state.on("change:value",function(t){var e;0!==(e=t.value).length?i({url:e,type:n},function(t){var e,n,i,r=(n=(e=t).status,i=e.message,"valid"===n?{status:"ok",message:i}:"unknown"===n?{status:"warn",message:i}:"invalid"===n?{status:"warn",message:i}:{status:"none",message:""});o.statusMessage(r.message),o.statusLevel(r.status)}):o.statusLevel("none")})},
nr=In.extend({Statics:{clearHistory:function(){ji={}}},init:function(t){var e,n,i,r,o,s,a,l,u=this,c=window.tinymce?window.tinymce.activeEditor:M.activeEditor,d=c.settings,f=t.filetype;t.spellcheck=!1,(i=d.file_picker_types||d.file_browser_callback_types)&&(i=R.makeMap(i,/[, ]/)),i&&!i[f]||(!(n=d.file_picker_callback)||i&&!i[f]?!(n=d.file_browser_callback)||i&&!i[f]||(e=function(){n(u.getEl("inp").id,u.value(),f,window)}):e=function(){var t=u.fire("beforecall").meta;t=R.extend({filetype:f},t),n.call(c,function(t,e){u.value(t).fire("change",{meta:e})},u.value(),t)}),e&&(t.icon="browse",t.onaction=e),u._super(t),u.classes.add("filepicker"),r=u,o=d,s=c.getBody(),a=f,l=function(t){var e=Xi(s),n=Zi(t,e,a,o);r.showAutoComplete(n,t)},r.on("autocomplete",function(){l(r.value())}),r.on("selectitem",function(t){var e=t.value;r.value(e.url);var n,i=(n=e.title).raw?n.raw:n;"image&q
uot;===a?r.fire("change",{meta:{alt:i,attach:e.attach}}):r.fire("change",{meta:{text:i,attach:e.attach}}),r.focus()}),r.on("click",function(t){0===r.value().length&&"INPUT"===t.target.nodeName&&l("")}),r.on("PostRender",function(){r.getRoot().on("submit",function(t){t.isDefaultPrevented()||Qi(r.value(),a)})}),er(u,d,f)}}),ir=Pn.extend({recalc:function(t){var e=t.layoutRect(),n=t.paddingBox;t.items().filter(":visible").each(function(t){t.layoutRect({x:n.left,y:n.top,w:e.innerW-n.right-n.left,h:e.innerH-n.top-n.bottom}),t.recalc&&t.recalc()})}}),rr=Pn.extend({recalc:function(t){var e,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,R,C,k,E,H,T,S,M,N,O,P,W,D,A,B,L=[],I=Math.max,z=Math.min;for(i=t.items().filter(":visible"),r=t.layoutRect(),o=t.paddingBox,s=t.settings,f=t.isRtl()?s.direction||"row-reversed":s.direction,a=s.align,l=t.isRtl()?s.pack||"end":s.pack,
u=s.spacing||0,"row-reversed"!==f&&"column-reverse"!==f||(i=i.set(i.toArray().reverse()),f=f.split("-")[0]),"column"===f?(C="y",_="h",R="minH",k="maxH",H="innerH",E="top",T="deltaH",S="contentH",W="left",O="w",M="x",N="innerW",P="minW",D="right",A="deltaW",B="contentW"):(C="x",_="w",R="minW",k="maxW",H="innerW",E="left",T="deltaW",S="contentW",W="top",O="h",M="y",N="innerH",P="minH",D="bottom",A="deltaH",B="contentH"),d=r[H]-o[E]-o[E],w=c=0,e=0,n=i.length;e<n;e++)m=(h=i[e]).layoutRect(),d-=e<n-1?u:0,0<(g=h.settings.flex)&&(c+=g,m[k]&&L.push(h),m.flex=g),d-=m[R],w<(p=o[W]+m[P]+o[D])&&(w=
p);if((y={})[R]=d<0?r[R]-d+r[T]:r[H]-d+r[T],y[P]=w+r[A],y[S]=r[H]-d,y[B]=w,y.minW=z(y.minW,r.maxW),y.minH=z(y.minH,r.maxH),y.minW=I(y.minW,r.startMinWidth),y.minH=I(y.minH,r.startMinHeight),!r.autoResize||y.minW===r.minW&&y.minH===r.minH){for(b=d/c,e=0,n=L.length;e<n;e++)(v=(m=(h=L[e]).layoutRect())[k])<(p=m[R]+m.flex*b)?(d-=m[k]-m[R],c-=m.flex,m.flex=0,m.maxFlexSize=v):m.maxFlexSize=0;for(b=d/c,x=o[E],y={},0===c&&("end"===l?x=d+o[E]:"center"===l?(x=Math.round(r[H]/2-(r[H]-d)/2)+o[E])<0&&(x=o[E]):"justify"===l&&(x=o[E],u=Math.floor(d/(i.length-1)))),y[M]=o[W],e=0,n=i.length;e<n;e++)p=(m=(h=i[e]).layoutRect()).maxFlexSize||m[R],"center"===a?y[M]=Math.round(r[N]/2-m[O]/2):"stretch"===a?(y[O]=I(m[P]||0,r[N]-o[W]-o[D]),y[M]=o[W]):"end"===a&&(y[M]=r[N]-m[O]-o.top),0<m.flex&&(p+=m.flex*b),y[_]=p,y[C]=x,h.layoutRect(y),h.recalc&&h.recalc(),x+=p+u}else if(y.w
=y.minW,y.h=y.minH,t.layoutRect(y),this.recalc(t),null===t._lastRect){var F=t.parent();F&&(F._lastRect=null,F.recalc())}}}),or=On.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(t){t.items().filter(":visible").each(function(t){t.recalc&&t.recalc()})},isNative:function(){return!0}}),sr=function(t,e){return n=e,r=(i=t)===undefined?document:i.dom(),Ni(r)?pt.none():pt.from(r.querySelector(n)).map(ti.fromDom);var n,i,r},ar=function(t,e){return function(){t.execCommand("mceToggleFormat",!1,e)}},lr=function(t,e,n){var i=function(t){n(t,e)};t.formatter?t.formatter.formatChanged(e,i):t.on("init",function(){t.formatter.formatChanged(e,i)})},ur=function(t,n){return function(e){lr(t,n,function(t){e.control.active(t)})}},cr=function(i){var e=["alignleft","aligncenter","alignright","alignjustify"],r="alignleft&quo
t;,t=[{text:"Left",icon:"alignleft",onclick:ar(i,"alignleft")},{text:"Center",icon:"aligncenter",onclick:ar(i,"aligncenter")},{text:"Right",icon:"alignright",onclick:ar(i,"alignright")},{text:"Justify",icon:"alignjustify",onclick:ar(i,"alignjustify")}];i.addMenuItem("align",{text:"Align",menu:t}),i.addButton("align",{type:"menubutton",icon:r,menu:t,onShowMenu:function(t){var n=t.control.menu;R.each(e,function(e,t){n.items().eq(t).each(function(t){return t.active(i.formatter.match(e))})})},onPostRender:function(t){var n=t.control;R.each(e,function(e,t){lr(i,e,function(t){n.icon(r),t&&n.icon(e)})})}}),R.each({alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify&
quot;,"JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(t,e){i.addButton(e,{active:!1,tooltip:t[0],cmd:t[1],onPostRender:ur(i,e)})})},dr=function(t){return t?t.split(",")[0]:""},fr=function(l,u){return function(){var a=this;a.state.set("value",null),l.on("init nodeChange",function(t){var e,n,i,r,o=l.queryCommandValue("FontName"),s=(e=u,r=(n=o)?n.toLowerCase():"",R.each(e,function(t){t.value.toLowerCase()===r&&(i=t.value)}),R.each(e,function(t){i||dr(t.value).toLowerCase()!==dr(r).toLowerCase()||(i=t.value)}),i);a.value(s||null),!s&&o&&a.text(dr(o))})}},hr=function(n){n.addButton("fontselect",function(){var t,e=(t=function(t){for(var e=(t=t.replace(/;$/,"").split(";")).length;e--;)t[e]=t[e].split("=");return t}(n.settings.font_formats||"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Bla
ck=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"),R.map(t,function(t){return{text:{raw:t[0]},value:t[1],textStyle:-1===t[1].indexOf("dings")?"font-family:"+t[1]:""}}));return{type:"listbox",text:"Font Family",tooltip:"Font Family",values:e,fixedWidth:!0,onPostRender:fr(n,e),onselect:function(t){t.control.settings.value&&n.execCommand("FontName",!1,t.control.settings.value)}}})},mr=function(t){hr(t)},gr=function(t,e){return/[0-9.]+px$/.test(t)?(n=72*pars
eInt(t,10)/96,i=e||0,r=Math.pow(10,i),Math.round(n*r)/r+"pt"):t;var n,i,r},pr=function(t,e,n){var i;return R.each(t,function(t){t.value===n?i=n:t.value===e&&(i=e)}),i},vr=function(n){n.addButton("fontsizeselect",function(){var t,s,a,e=(t=n.settings.fontsize_formats||"8pt 10pt 12pt 14pt 18pt 24pt 36pt",R.map(t.split(" "),function(t){var e=t,n=t,i=t.split("=");return 1<i.length&&(e=i[0],n=i[1]),{text:e,value:n}}));return{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:e,fixedWidth:!0,onPostRender:(s=n,a=e,function(){var o=this;s.on("init nodeChange",function(t){var e,n,i,r;if(e=s.queryCommandValue("FontSize"))for(i=3;!r&&0<=i;i--)n=gr(e,i),r=pr(a,n,e);o.value(r||null),r||o.text(n)})}),onclick:function(t){t.control.settings.value&&n.execCommand("FontSize",!1,t.control.settings.value)}}})},br=function(t){vr(t)},yr=function(n,t){
var i=t.length;return R.each(t,function(t){t.menu&&(t.hidden=0===yr(n,t.menu));var e=t.format;e&&(t.hidden=!n.formatter.canApply(e)),t.hidden&&i--}),i},xr=function(n,t){var i=t.items().length;return t.items().each(function(t){t.menu&&t.visible(0<xr(n,t.menu)),!t.menu&&t.settings.menu&&t.visible(0<yr(n,t.settings.menu));var e=t.settings.format;e&&t.visible(n.formatter.canApply(e)),t.visible()||i--}),i},wr=function(t){var i,r,o,e,s,n,a,l,u=(r=0,o=[],e=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",i
con:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"a
lignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],s=function(t){var i=[];if(t)return R.each(t,function(t){var e={text:t.title,icon:t.icon};if(t.items)e.menu=s(t.items);else{var n=t.format||"custom"+r++;t.format||(t.name=n,o.push(t)),e.format=n,e.cmd=t.cmd}i.push(e)}),i},(i=t).on("init",function(){R.each(o,function(t){i.formatter.register(t.name,t)})}),{type:"menu",items:i.settings.style_formats_merge?i.settings.style_formats?s(e.concat(i.settings.style_formats)):s(e):s(i.settings.style_formats||e),onPostRender:function(t){i.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){if(this.settings.format)return i.formatter.getCssText(this.settings.format)},onPostRender:function(){var n=this;n.parent().on("show",function(){var t,e;(t=n.settings.format)&&(n.disabled(!i.formatter.canApply(t)),n.active(i.formatter.match(t))),(e=n.settin
gs.cmd)&&n.active(i.queryCommandState(e))})},onclick:function(){this.settings.format&&ar(i,this.settings.format)(),this.settings.cmd&&i.execCommand(this.settings.cmd)}}});n=u,t.addMenuItem("formats",{text:"Formats",menu:n}),l=u,(a=t).addButton("styleselect",{type:"menubutton",text:"Formats",menu:l,onShowMenu:function(){a.settings.style_formats_autohide&&xr(a,this.menu)}})},_r=function(n,t){return function(){var r,o,s,e=[];return R.each(t,function(t){e.push({text:t[0],value:t[1],textStyle:function(){return n.formatter.getCssText(t[1])}})}),{type:"listbox",text:t[0][0],values:e,fixedWidth:!0,onselect:function(t){if(t.control){var e=t.control.value();ar(n,e)()}},onPostRender:(r=n,o=e,function(){var e=this;r.on("nodeChange",function(t){var n=r.formatter,i=null;R.each(t.parents,function(e){if(R.each(o,function(t){if(s?n.matchNode(e,s,{value:t.value})&&(i=t.value):n.matchNode(e,t.
value)&&(i=t.value),i)return!1}),i)return!1}),e.value(i)})})}}},Rr=function(t){var e,n,i=function(t){for(var e=(t=t.replace(/;$/,"").split(";")).length;e--;)t[e]=t[e].split("=");return t}(t.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");t.addMenuItem("blockformats",{text:"Blocks",menu:(e=t,n=i,R.map(n,function(t){return{text:t[0],onclick:ar(e,t[1]),textStyle:function(){return e.formatter.getCssText(t[1])}}}))}),t.addButton("formatselect",_r(t,i))},Cr=function(e,t){var n,i;if("string"==typeof t)i=t.split(" ");else if(R.isArray(t))return function(t){for(var e=[],n=0,i=t.length;n<i;++n){if(!Array.prototype.isPrototypeOf(t[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+t);Ht.apply(e,t[n])}return e}(R.map(t,function(t){return Cr(e,t)}));return n=R.grep(i,funct
ion(t){return"|"===t||t in e.menuItems}),R.map(n,function(t){return"|"===t?{text:"-"}:e.menuItems[t]})},kr=function(t){return t&&"-"===t.text},Er=function(t){var e=Ct(t,function(t,e,n){return!kr(t)||!kr(n[e-1])});return Ct(e,function(t,e,n){return!kr(t)||0<e&&e<n.length-1})},Hr=function(t){var e,n,i,r,o=t.settings.insert_button_items;return Er(o?Cr(t,o):(e=t,n="insert",i=[{text:"-"}],r=R.grep(e.menuItems,function(t){return t.context===n}),R.each(r,function(t){"before"===t.separator&&i.push({text:"|"}),t.prependToContext?i.unshift(t):i.push(t),"after"===t.separator&&i.push({text:"|"})}),i))},Tr=function(t){var e;(e=t).addButton("insert",{type:"menubutton",icon:"insert",menu:[],oncreatemenu:function(){this.menu.add(Hr(e)),this.menu.renderNew()}})},Sr=function(t){var n,i,r;n=t,R.each({bold:"Bold",italic:"I
talic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,e){n.addButton(e,{active:!1,tooltip:t,onPostRender:ur(n,e),onclick:ar(n,e)})}),i=t,R.each({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"],removeformat:["Clear formatting","RemoveFormat"],remove:["Remove","Delete"]},function(t,e){i.addButton(e,{tooltip:t[0],cmd:t[1]})}),r=t,R.each({blockquote:["Blockquote","mceBlockQuote"],subscript:["Subscrip
t","Subscript"],superscript:["Superscript","Superscript"]},function(t,e){r.addButton(e,{active:!1,tooltip:t[0],cmd:t[1],onPostRender:ur(r,e)})})},Mr=function(t){var n;Sr(t),n=t,R.each({bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline","Meta+U"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"],newdocument:["New document","mceNewDocument"],cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"]
},function(t,e){n.addMenuItem(e,{text:t[0],icon:e,shortcut:t[2],cmd:t[1]})}),n.addMenuItem("codeformat",{text:"Code",icon:"code",onclick:ar(n,"code")})},Nr=function(n,i){return function(){var t=this,e=function(){var t="redo"===i?"hasRedo":"hasUndo";return!!n.undoManager&&n.undoManager[t]()};t.disabled(!e()),n.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){t.disabled(n.readonly||!e())})}},Or=function(t){var e,n;(e=t).addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:Nr(e,"undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:Nr(e,"redo"),cmd:"redo"}),(n=t).addButton("undo",{tooltip:"Undo",onPostRender:Nr(n,"undo"),cmd:"undo"}),n.addButton("redo"
;,{tooltip:"Redo",onPostRender:Nr(n,"redo"),cmd:"redo"})},Pr=function(t){var e,n;(e=t).addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:(n=e,function(){var e=this;n.on("VisualAid",function(t){e.active(t.hasVisual)}),e.active(n.hasVisual)}),cmd:"mceToggleVisualAid"})},Wr={setup:function(t){var e;t.rtl&&(ue.rtl=!0),t.on("mousedown progressstate",function(){Ue.hideAll()}),(e=t).settings.ui_container&&(h.container=sr(ti.fromDom(document.body),e.settings.ui_container).fold(lt(null),function(t){return t.dom()})),ve.tooltips=!h.iOS,ue.translate=function(t){return M.translate(t)},Rr(t),cr(t),Mr(t),Or(t),br(t),mr(t),wr(t),Pr(t),Tr(t)}},Dr=Pn.extend({recalc:function(t){var e,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,R,C,k,E,H,T,S=[],M=[];e=t.settings,r=t.items().filter(":visible"),o=t.layoutRect(),i=e.columns||Math.ceil(Math.sqrt(r.length)),n=Math.ceil(r.length/i),b=
e.spacingH||e.spacing||0,y=e.spacingV||e.spacing||0,x=e.alignH||e.align,w=e.alignV||e.align,p=t.paddingBox,T="reverseRows"in e?e.reverseRows:t.isRtl(),x&&"string"==typeof x&&(x=[x]),w&&"string"==typeof w&&(w=[w]);for(d=0;d<i;d++)S.push(0);for(f=0;f<n;f++)M.push(0);for(f=0;f<n;f++)for(d=0;d<i&&(c=r[f*i+d]);d++)C=(u=c.layoutRect()).minW,k=u.minH,S[d]=C>S[d]?C:S[d],M[f]=k>M[f]?k:M[f];for(E=o.innerW-p.left-p.right,d=_=0;d<i;d++)_+=S[d]+(0<d?b:0),E-=(0<d?b:0)+S[d];for(H=o.innerH-p.top-p.bottom,f=R=0;f<n;f++)R+=M[f]+(0<f?y:0),H-=(0<f?y:0)+M[f];if(_+=p.left+p.right,R+=p.top+p.bottom,(l={}).minW=_+(o.w-o.innerW),l.minH=R+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW===o.minW&&l.minH===o.minH){v
ar N;o.autoResize&&((l=t.layoutRect(l)).contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH),N="start"===e.packV?0:0<H?Math.floor(H/n):0;var O=0,P=e.flexWidths;if(P)for(d=0;d<P.length;d++)O+=P[d];else O=i;var W=E/O;for(d=0;d<i;d++)S[d]+=P?P[d]*W:W;for(m=p.top,f=0;f<n;f++){for(h=p.left,a=M[f]+N,d=0;d<i&&(c=r[T?f*i+i-1-d:f*i+d]);d++)g=c.settings,u=c.layoutRect(),s=Math.max(S[d],u.startMinWidth),u.x=h,u.y=m,"center"===(v=g.alignH||(x?x[d]||x[0]:null))?u.x=h+s/2-u.w/2:"right"===v?u.x=h+s-u.w:"stretch"===v&&(u.w=s),"center"===(v=g.alignV||(w?w[d]||w[0]:null))?u.y=m+a/2-u.h/2:"bottom"===v?u.y=m+a-u.h:"stretch"===v&&(u.h=a),c.layoutRect(u),h+=s+b,c.recalc&&c.recalc();m+=a+y}}else if(l.w=l.minW,l.h=l.minH,t.layoutRect(l),this.recalc(t),null===t._lastRect){var D=t.parent();D&&(D._lastRect=null,D.recalc())}}}),Ar=ve.extend({renderHtml:function(){var t=this;retur
n t.classes.add("iframe"),t.canFocus=!1,'<iframe id="'+t._id+'" class="'+t.classes+'" tabindex="-1" src="'+(t.settings.url||"javascript:''")+'" frameborder="0"></iframe>'},src:function(t){this.getEl().src=t},html:function(t,e){var n=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=t,e&&e()):c.setTimeout(function(){n.html(t)}),this}}),Br=ve.extend({init:function(t){this._super(t),this.classes.add("widget").add("infobox"),this.canFocus=!1},severity:function(t){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(t)},help:function(t){this.state.set("help",t)},renderHtml:function(){var t=this,e=t.classPrefix;return'<div id="'+t._id+'" class="'+t.classes+'"><div id="'+t._id+'-body">'+t.encode(t.state.get("text"))+'
<button role="button" tabindex="-1"><i class="'+e+"ico "+e+'i-help"></i></button></div></div>'},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.getEl("body").firstChild.data=e.encode(t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e.state.on("change:help",function(t){e.classes.toggle("has-help",t.value),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}}),Lr=ve.extend({init:function(t){var e=this;e._super(t),e.classes.add("widget").add("label"),e.canFocus=!1,t.multiline&&e.classes.add("autoscroll"),t.strong&&e.classes.add("strong")},initLayoutRect:function(){var t=this,e=t._super();return t.settings.multiline&&(St.getSize(t.getEl()).width>e.maxW&&(e.minW=e.maxW,t.classes.add("multiline")),t.getEl().sty
le.width=e.minW+"px",e.startMinH=e.h=e.minH=Math.min(e.maxH,St.getSize(t.getEl()).height)),e},repaint:function(){return this.settings.multiline||(this.getEl().style.lineHeight=this.layoutRect().h+"px"),this._super()},severity:function(t){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(t)},renderHtml:function(){var t,e,n=this,i=n.settings.forId,r=n.settings.html?n.settings.html:n.encode(n.state.get("text"));return!i&&(e=n.settings.forName)&&(t=n.getRoot().find("#"+e)[0])&&(i=t._id),i?'<label id="'+n._id+'" class="'+n.classes+'"'+(i?' for="'+i+'"':"")+">"+r+"</label>":'<span id="'+n._id+'" class="'+n.classes+'">'+r+"</span>"},bindStates:function(){var e=this;return e.state.on("change:text",function(t){e.innerHtm
l(e.encode(t.value)),e.state.get("rendered")&&e.updateLayoutRect()}),e._super()}}),Ir=Oe.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(t){this._super(t),this.classes.add("toolbar")},postRender:function(){return this.items().each(function(t){t.classes.add("toolbar-item")}),this._super()}}),zr=Ir.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}}),Fr=Wn.extend({init:function(t){var e=this;e._renderOpen=!0,e._super(t),t=e.settings,e.classes.add("menubtn"),t.fixedWidth&&e.classes.add("fixed-width"),e.aria("haspopup",!0),e.state.set("menu",t.menu||e.render())},showMenu:function(t){var e,n=this;if(n.menu&&n.menu.visible()&&!1!==t)return n.hideMenu();n.menu||(e=n.state.get("menu")||[],n.classes.add("opened"),e.length?e={type:"menu",animate:!0,items
:e}:(e.type=e.type||"menu",e.animate=!0),e.renderTo?n.menu=e.parent(n).show().renderTo():n.menu=Ce.create(e).parent(n).renderTo(),n.fire("createmenu"),n.menu.reflow(),n.menu.on("cancel",function(t){t.control.parent()===n.menu&&(t.stopPropagation(),n.focus(),n.hideMenu())}),n.menu.on("select",function(){n.focus()}),n.menu.on("show hide",function(t){"hide"===t.type&&t.control.parent()===n&&n.classes.remove("opened-under"),t.control===n.menu&&(n.activeMenu("show"===t.type),n.classes.toggle("opened","show"===t.type)),n.aria("expanded","show"===t.type)}).fire("show")),n.menu.show(),n.menu.layoutRect({w:n.layoutRect().w}),n.menu.repaint(),n.menu.moveRel(n.getEl(),n.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]);var i=n.menu.layoutRect(),r=n.$el.offset().top+n.layoutRect().h;r>i.y&&
r<i.y+i.h&&n.classes.add("opened-under"),n.fire("showmenu")},hideMenu:function(){this.menu&&(this.menu.items().each(function(t){t.hideMenu&&t.hideMenu()}),this.menu.hide())},activeMenu:function(t){this.classes.toggle("active",t)},renderHtml:function(){var t,e=this,n=e._id,i=e.classPrefix,r=e.settings.icon,o=e.state.get("text"),s="";return(t=e.settings.image)?(r="none","string"!=typeof t&&(t=window.getSelection?t[0]:t[1]),t=" style=\"background-image: url('"+t+"')\""):t="",o&&(e.classes.add("btn-has-text"),s='<span class="'+i+'txt">'+e.encode(o)+"</span>"),r=e.settings.icon?i+"ico "+i+"i-"+r:"",e.aria("role",e.parent()instanceof zr?"menuitem":"button"),'<div id="'+n+'" class="'+e.classes+'" tabindex="-1&qu
ot; aria-labelledby="'+n+'"><button id="'+n+'-open" role="presentation" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+t+"></i>":"")+s+' <i class="'+i+'caret"></i></button></div>'},postRender:function(){var r=this;return r.on("click",function(t){t.control===r&&function(t,e){for(;t;){if(e===t)return!0;t=t.parentNode}return!1}(t.target,r.getEl())&&(r.focus(),r.showMenu(!t.aria),t.aria&&r.menu.items().filter(":visible")[0].focus())}),r.on("mouseenter",function(t){var e,n=t.control,i=r.parent();n&&i&&n instanceof Fr&&n.parent()===i&&(i.items().filter("MenuButton").each(function(t){t.hideMenu&&t!==n&&(t.menu&&t.menu.visible()&&(e=!0),t.hideMenu())}),e&&(n.focus(),n.showMenu()))}),r._super()},bindStates:function(){var
t=this;return t.state.on("change:menu",function(){t.menu&&t.menu.remove(),t.menu=null}),t._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}});function Ur(i,r){var o,s,a=this,l=ue.classPrefix;a.show=function(t,e){function n(){o&&(Mt(i).append('<div class="'+l+"throbber"+(r?" "+l+"throbber-inline":"")+'"></div>'),e&&e())}return a.hide(),o=!0,t?s=c.setTimeout(n,t):n(),a},a.hide=function(){var t=i.lastChild;return c.clearTimeout(s),t&&-1!==t.className.indexOf("throbber")&&t.parentNode.removeChild(t),o=!1,a}}var Vr=Ue.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(t){if(t.autohide=!0,t.constrainToViewport=!0,"function"==typeof t.items&&(t.itemsFactory=t.items,t.items=[]),t.itemDefaults)for(var e=t.ite
ms,n=e.length;n--;)e[n]=R.extend({},t.itemDefaults,e[n]);this._super(t),this.classes.add("menu"),t.animate&&11!==h.ie&&this.classes.add("animate")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){this.hideAll(),this.fire("select")},load:function(){var e,n=this;function i(){n.throbber&&(n.throbber.hide(),n.throbber=null)}n.settings.itemsFactory&&(n.throbber||(n.throbber=new Ur(n.getEl("body"),!0),0===n.items().length?(n.throbber.show(),n.fire("loading")):n.throbber.show(100,function(){n.items().remove(),n.fire("loading")}),n.on("hide close",i)),n.requestTime=e=(new Date).getTime(),n.settings.itemsFactory(function(t){0!==t.length?n.requestTime===e&&(n.getEl().style.width="",n.getEl("body").style.width=&
quot;",i(),n.items().remove(),n.getEl("body").innerHTML="",n.add(t),n.renderNew(),n.fire("loaded")):n.hide()}))},hideAll:function(){return this.find("menuitem").exec("hideMenu"),this._super()},preRender:function(){var n=this;return n.items().each(function(t){var e=t.settings;if(e.icon||e.image||e.selectable)return!(n._hasIcons=!0)}),n.settings.itemsFactory&&n.on("postrender",function(){n.settings.itemsFactory&&n.load()}),n.on("show hide",function(t){t.control===n&&("show"===t.type?c.setTimeout(function(){n.classes.add("in")},0):n.classes.remove("in"))}),n._super()}}),qr=Fr.extend({init:function(i){var e,r,o,n,s=this;s._super(i),i=s.settings,s._values=e=i.values,e&&("undefined"!=typeof i.value&&function t(e){for(var n=0;n<e.length;n++){if(r=e[n].selected||i.value===e[n].value)return o=o||e[n].text,s.state.set("value",e
[n].value),!0;if(e[n].menu&&t(e[n].menu))return!0}}(e),!r&&0<e.length&&(o=e[0].text,s.state.set("value",e[0].value)),s.state.set("menu",e)),s.state.set("text",i.text||o),s.classes.add("listbox"),s.on("select",function(t){var e=t.control;n&&(t.lastControl=n),i.multiple?e.active(!e.active()):s.value(t.control.value()),n=e})},value:function(n){return 0===arguments.length?this.state.get("value"):(void 0===n||(this.settings.values&&!function e(t){return wt(t,function(t){return t.menu?e(t.menu):t.value===n})}(this.settings.values)?null===n&&this.state.set("value",null):this.state.set("value",n)),this)},bindStates:function(){var i=this;return i.on("show",function(t){var e,n;e=t.control,n=i.value(),e instanceof Vr&&e.items().each(function(t){t.hasMenus()||t.active(t.value()===n)})}),i.state.on("change:value",function(e){var n=function
t(e,n){var i;if(e)for(var r=0;r<e.length;r++){if(e[r].value===n)return e[r];if(e[r].menu&&(i=t(e[r].menu,n)))return i}}(i.state.get("menu"),e.value);n?i.text(n.text):i.text(i.settings.text)}),i._super()}}),Yr=ve.extend({Defaults:{border:0,role:"menuitem"},init:function(t){var e,n=this;n._super(t),t=n.settings,n.classes.add("menu-item"),t.menu&&n.classes.add("menu-item-expand"),t.preview&&n.classes.add("menu-item-preview"),"-"!==(e=n.state.get("text"))&&"|"!==e||(n.classes.add("menu-item-sep"),n.aria("role","separator"),n.state.set("text","-")),t.selectable&&(n.aria("role","menuitemcheckbox"),n.classes.add("menu-item-checkbox"),t.icon="selected"),t.preview||t.selectable||n.classes.add("menu-item-normal"),n.on("mousedown",function(t){t.preventDefault()}),
t.menu&&!t.ariaHideMenu&&n.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var e,n=this,t=n.settings,i=n.parent();if(i.items().each(function(t){t!==n&&t.hideMenu()}),t.menu){(e=n.menu)?e.show():((e=t.menu).length?e={type:"menu",items:e}:e.type=e.type||"menu",i.settings.itemDefaults&&(e.itemDefaults=i.settings.itemDefaults),(e=n.menu=Ce.create(e).parent(n).renderTo()).reflow(),e.on("cancel",function(t){t.stopPropagation(),n.focus(),e.hide()}),e.on("show hide",function(t){t.control.items&&t.control.items().each(function(t){t.active(t.settings.selected)})}).fire("show"),e.on("hide",function(t){t.control===e&&n.classes.remove("selected")}),e.submenu=!0),e._parentMenu=i,e.classes.add("menu-sub");var r=e.testMoveRel(n.getEl(),n.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:[&qu
ot;tr-tl","br-bl","tl-tr","bl-br"]);e.moveRel(n.getEl(),r),r="menu-sub-"+(e.rel=r),e.classes.remove(e._lastRel).add(r),e._lastRel=r,n.classes.add("selected"),n.aria("expanded",!0)}},hideMenu:function(){var t=this;return t.menu&&(t.menu.items().each(function(t){t.hideMenu&&t.hideMenu()}),t.menu.hide(),t.aria("expanded",!1)),t},renderHtml:function(){var t,e=this,n=e._id,i=e.settings,r=e.classPrefix,o=e.state.get("text"),s=e.settings.icon,a="",l=i.shortcut,u=e.encode(i.url);function c(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function d(t){var e=i.match||"";return e?t.replace(new RegExp(c(e),"gi"),function(t){return"!mce~match["+t+"]mce~match!"}):t}function f(t){return t.replace(new RegExp(c("!mce~match["),"g"),"<b>").replace(new RegExp(c("]mce~match!"),"g"),&q
uot;</b>")}return s&&e.parent().classes.add("menu-has-icons"),i.image&&(a=" style=\"background-image: url('"+i.image+"')\""),l&&(l=function(t){var e,n,i={};for(i=h.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},t=t.split("+"),e=0;e<t.length;e++)(n=i[t[e].toLowerCase()])&&(t[e]=n);return t.join("+")}(l)),s=r+"ico "+r+"i-"+(e.settings.icon||"none"),t="-"!==o?'<i class="'+s+'"'+a+"></i>\xa0":"",o=f(e.encode(d(o))),u=f(e.encode(d(u))),'<div id="'+n+'" class="'+e.classes+'" tabindex="-1">'+t+("-"!==o?'<span id="'+n+'-text" class="'+r+'text">'+o+"</span>":"")+(l?'<div id="'+n+'-shortcut" class=
"'+r+'menu-shortcut">'+l+"</div>":"")+(i.menu?'<div class="'+r+'caret"></div>':"")+(u?'<div class="'+r+'menu-item-link">'+u+"</div>":"")+"</div>"},postRender:function(){var e=this,n=e.settings,t=n.textStyle;if("function"==typeof t&&(t=t.call(this)),t){var i=e.getEl("text");i&&(i.setAttribute("style",t),e._textStyle=t)}return e.on("mouseenter click",function(t){t.control===e&&(n.menu||"click"!==t.type?(e.showMenu(),t.aria&&e.menu.focus(!0)):(e.fire("select"),c.requestAnimationFrame(function(){e.parent().hideAll()})))}),e._super(),e},hover:function(){return this.parent().items().each(function(t){t.classes.remove("selected")}),this.classes.toggle("selected",!0),this},active:function(t){return function(t,e){var n=t._textStyle;if(n){var i=t.getEl(&quo
t;text");i.setAttribute("style",n),e&&(i.style.color="",i.style.backgroundColor="")}}(this,t),void 0!==t&&this.aria("checked",t),this._super(t)},remove:function(){this._super(),this.menu&&this.menu.remove()}}),$r=Bn.extend({Defaults:{classes:"radio",role:"radio"}}),Xr=ve.extend({renderHtml:function(){var t=this,e=t.classPrefix;return t.classes.add("resizehandle"),"both"===t.settings.direction&&t.classes.add("resizehandle-both"),t.canFocus=!1,'<div id="'+t._id+'" class="'+t.classes+'"><i class="'+e+"ico "+e+'i-resize"></i></div>'},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new Re(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!==e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("Re
sizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}});function jr(t){var e="";if(t)for(var n=0;n<t.length;n++)e+='<option value="'+t[n]+'">'+t[n]+"</option>";return e}var Jr=ve.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(t){var n=this;n._super(t),n.settings.size&&(n.size=n.settings.size),n.settings.options&&(n._options=n.settings.options),n.on("keydown",function(t){var e;13===t.keyCode&&(t.preventDefault(),n.parents().reverse().each(function(t){if(t.toJSON)return e=t,!1}),n.fire("submit",{data:e.toJSON()}))})},options:function(t){return arguments.length?(this.state.set("options",t),this):this.state.get("options")},renderHtml:function(){var t,e=this,n="";return t=jr(e._options),e.size&&(n=' size = "'+e.size+'"'),'<select
id="'+e._id+'" class="'+e.classes+'"'+n+">"+t+"</select>"},bindStates:function(){var e=this;return e.state.on("change:options",function(t){e.getEl().innerHTML=jr(t.value)}),e._super()}});function Gr(t,e,n){return t<e&&(t=e),n<t&&(t=n),t}function Kr(t,e,n){t.setAttribute("aria-"+e,n)}function Zr(t,e){var n,i,r,o,s;"v"===t.settings.orientation?(r="top",i="height",n="h"):(r="left",i="width",n="w"),s=t.getEl("handle"),o=((t.layoutRect()[n]||100)-St.getSize(s)[i])*((e-t._minValue)/(t._maxValue-t._minValue))+"px",s.style[r]=o,s.style.height=t.layoutRect().h+"px",Kr(s,"valuenow",e),Kr(s,"valuetext",""+t.settings.previewFilter(e)),Kr(s,"valuemin",t._minValue),Kr(s,"valuemax",t._maxValue)}var Qr=ve.extend({init:function(t){var e=this;t.previewFilter||(t.p
reviewFilter=function(t){return Math.round(100*t)/100}),e._super(t),e.classes.add("slider"),"v"===t.orientation&&e.classes.add("vertical"),e._minValue=yt(t.minValue)?t.minValue:0,e._maxValue=yt(t.maxValue)?t.maxValue:100,e._initValue=e.state.get("value")},renderHtml:function(){var t=this._id,e=this.classPrefix;return'<div id="'+t+'" class="'+this.classes+'"><div id="'+t+'-handle" class="'+e+'slider-handle" role="slider" tabindex="-1"></div></div>'},reset:function(){this.value(this._initValue).repaint()},postRender:function(){var t,e,n,i,r,o,s,a,l,u,c,d,f,h,m=this;t=m._minValue,e=m._maxValue,"v"===m.settings.orientation?(n="screenY",i="top",r="height",o="h"):(n="screenX",i="left",r="width",o="w"),m._super(),function(o,s){function e(t){var e,n,i,r;e=Gr(e=(((e=m.value
())+(r=n=o))/((i=s)-r)+.05*t)*(i-n)-n,o,s),m.value(e),m.fire("dragstart",{value:e}),m.fire("drag",{value:e}),m.fire("dragend",{value:e})}m.on("keydown",function(t){switch(t.keyCode){case 37:case 38:e(-1);break;case 39:case 40:e(1)}})}(t,e),s=t,a=e,l=m.getEl("handle"),m._dragHelper=new Re(m._id,{handle:m._id+"-handle",start:function(t){u=t[n],c=parseInt(m.getEl("handle").style[i],10),d=(m.layoutRect()[o]||100)-St.getSize(l)[r],m.fire("dragstart",{value:h})},drag:function(t){var e=t[n]-u;f=Gr(c+e,0,d),l.style[i]=f+"px",h=s+f/d*(a-s),m.value(h),m.tooltip().text(""+m.settings.previewFilter(h)).show().moveRel(l,"bc tc"),m.fire("drag",{value:h})},stop:function(){m.tooltip().hide(),m.fire("dragend",{value:h})}})},repaint:function(){this._super(),Zr(this,this.value())},bindStates:function(){var e=this;return e.state.on("change:value",function(t){Zr(e,t.
value)}),e._super()}}),to=ve.extend({renderHtml:function(){return this.classes.add("spacer"),this.canFocus=!1,'<div id="'+this._id+'" class="'+this.classes+'"></div>'}}),eo=Fr.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var t,e,n=this.getEl(),i=this.layoutRect();return this._super(),t=n.firstChild,e=n.lastChild,Mt(t).css({width:i.w-St.getSize(e).width,height:i.h-2}),Mt(e).css({height:i.h-2}),this},activeMenu:function(t){Mt(this.getEl().lastChild).toggleClass(this.classPrefix+"active",t)},renderHtml:function(){var t,e,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a=n.settings,l="";return(t=a.image)?(o="none","string"!=typeof t&&(t=window.getSelection?t[0]:t[1]),t=" style=\"background-image: url('"+t+"')\""):t="",o=a.icon?r+"ico "+r+"i-&
quot;+o:"",s&&(n.classes.add("btn-has-text"),l='<span class="'+r+'txt">'+n.encode(s)+"</span>"),e="boolean"==typeof a.active?' aria-pressed="'+a.active+'"':"",'<div id="'+i+'" class="'+n.classes+'" role="button"'+e+' tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(o?'<i class="'+o+'"'+t+"></i>":"")+l+'</button><button type="button" class="'+r+'open" hidefocus="1" tabindex="-1">'+(n._menuBtnText?(o?"\xa0":"")+n._menuBtnText:"")+' <i class="'+r+'caret"></i></button></div>'},postRender:function(){var n=this.settings.onclick;return this.on("click",function(t){var e=t.target;if(t.control===this)for(;e;){if(t.aria&&"down&qu
ot;!==t.aria.key||"BUTTON"===e.nodeName&&-1===e.className.indexOf("open"))return t.stopImmediatePropagation(),void(n&&n.call(this,t));e=e.parentNode}}),delete this.settings.onclick,this._super()}}),no=or.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}}),io=We.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(n){var t;this.activeTabId&&(t=this.getEl(this.activeTabId),Mt(t).removeClass(this.classPrefix+"active"),t.setAttribute("aria-selected","false")),this.activeTabId="t"+n,(t=this.getEl("t"+n)).setAttribute("aria-selected","true"),Mt(t).addClass(this.classPrefix+"active"),this.items()[n].show().fire("showtab"),this.reflow(),this.items().each(function(t,e){n!==e&&t.hide()})},renderHtm
l:function(){var i=this,t=i._layout,r="",o=i.classPrefix;return i.preRender(),t.preRender(i),i.items().each(function(t,e){var n=i._id+"-t"+e;t.aria("role","tabpanel"),t.aria("labelledby",n),r+='<div id="'+n+'" class="'+o+'tab" unselectable="on" role="tab" aria-controls="'+t._id+'" aria-selected="false" tabIndex="-1">'+i.encode(t.settings.title)+"</div>"}),'<div id="'+i._id+'" class="'+i.classes+'" hidefocus="1" tabindex="-1"><div id="'+i._id+'-head" class="'+o+'tabs" role="tablist">'+r+'</div><div id="'+i._id+'-body" class="'+i.bodyClasses+'">'+t.renderHtml(i)+"</div></div>"},postRender:function(){var i=this;i._super(),i.settings.activeTab=i.settings.activeTab||0,i.activateTab(i.settings.activeTab),this.on(&qu
ot;click",function(t){var e=t.target.parentNode;if(e&&e.id===i._id+"-head")for(var n=e.childNodes.length;n--;)e.childNodes[n]===t.target&&i.activateTab(n)})},initLayoutRect:function(){var t,e,n,i=this;e=(e=St.getSize(i.getEl("head")).width)<0?0:e,n=0,i.items().each(function(t){e=Math.max(e,t.layoutRect().minW),n=Math.max(n,t.layoutRect().minH)}),i.items().each(function(t){t.settings.x=0,t.settings.y=0,t.settings.w=e,t.settings.h=n,t.layoutRect({x:0,y:0,w:e,h:n})});var r=St.getSize(i.getEl("head")).height;return i.settings.minWidth=e,i.settings.minHeight=n+r,(t=i._super()).deltaH+=r,t.innerH=t.h-t.deltaH,t}}),ro=ve.extend({init:function(t){var n=this;n._super(t),n.classes.add("textbox"),t.multiline?n.classes.add("multiline"):(n.on("keydown",function(t){var e;13===t.keyCode&&(t.preventDefault(),n.parents().reverse().each(function(t){if(t.toJSON)return e=t,!1}),n.fire("submit",{data:e.
toJSON()}))}),n.on("keyup",function(t){n.state.set("value",t.target.value)}))},repaint:function(){var t,e,n,i,r,o=this,s=0;t=o.getEl().style,e=o._layoutRect,r=o._lastRepaintRect||{};var a=document;return!o.settings.multiline&&a.all&&(!a.documentMode||a.documentMode<=8)&&(t.lineHeight=e.h-s+"px"),i=(n=o.borderBox).left+n.right+8,s=n.top+n.bottom+(o.settings.multiline?8:0),e.x!==r.x&&(t.left=e.x+"px",r.x=e.x),e.y!==r.y&&(t.top=e.y+"px",r.y=e.y),e.w!==r.w&&(t.width=e.w-i+"px",r.w=e.w),e.h!==r.h&&(t.height=e.h-s+"px",r.h=e.h),o._lastRepaintRect=r,o.fire("repaint",{},!1),o},renderHtml:function(){var e,t,n=this,i=n.settings;return e={id:n._id,hidefocus:"1"},R.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern&
quot;,"placeholder","required","multiple"],function(t){e[t]=i[t]}),n.disabled()&&(e.disabled="disabled"),i.subtype&&(e.type=i.subtype),(t=St.create(i.multiline?"textarea":"input",e)).value=n.state.get("value"),t.className=n.classes.toString(),t.outerHTML},value:function(t){return arguments.length?(this.state.set("value",t),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var e=this;e.getEl().value=e.state.get("value"),e._super(),e.$el.on("change",function(t){e.state.set("value",t.target.value),e.fire("change",t)})},bindStates:function(){var e=this;return e.state.on("change:value",function(t){e.getEl().value!==t.value&&(e.getEl().value=t.value)}),e.state.on("change:disabled",function(t){e.getEl().disabled=t.va
lue}),e._super()},remove:function(){this.$el.off(),this._super()}}),oo=function(){return{Selector:Vt,Collection:$t,ReflowQueue:te,Control:ue,Factory:Ce,KeyboardNavigation:Ee,Container:Oe,DragHelper:Re,Scrollable:Pe,Panel:We,Movable:ge,Resizable:De,FloatPanel:Ue,Window:je,MessageBox:Ze,Tooltip:pe,Widget:ve,Progress:be,Notification:xe,Layout:On,AbsoluteLayout:Pn,Button:Wn,ButtonGroup:An,Checkbox:Bn,ComboBox:In,ColorBox:zn,PanelButton:Fn,ColorButton:Vn,ColorPicker:Yn,Path:Xn,ElementPath:jn,FormItem:Jn,Form:Gn,FieldSet:Kn,FilePicker:nr,FitLayout:ir,FlexLayout:rr,FlowLayout:or,FormatControls:Wr,GridLayout:Dr,Iframe:Ar,InfoBox:Br,Label:Lr,Toolbar:Ir,MenuBar:zr,MenuButton:Fr,MenuItem:Yr,Throbber:Ur,Menu:Vr,ListBox:qr,Radio:$r,ResizeHandle:Xr,SelectBox:Jr,Slider:Qr,Spacer:to,SplitButton:eo,StackLayout:no,TabPanel:io,TextBox:ro,DropZone:$n,BrowseButton:Dn}},so=function(n){n.ui?R.each(oo(),function(t,e){n.ui[e]=t}):n.ui=oo()};R.each(oo(),function(t,e){Ce.add(e,t)}),so(window.tinymce?window.ti
nymce:{}),o.add("inlite",function(t){var e=Nn();return Wr.setup(t),Cn(t,e),Qe(t,e)})}();
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcjs_enqueuesvendortinymcethemesmodernthemejs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/themes/modern/theme.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/themes/modern/theme.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/themes/modern/theme.js 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,10041 +1,9627 @@
</span><span class="cx" style="display: block; padding: 0 10px"> (function () {
</span><span class="cx" style="display: block; padding: 0 10px"> var modern = (function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'use strict';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'use strict';
</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 global = tinymce.util.Tools.resolve('tinymce.ThemeManager');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global = tinymce.util.Tools.resolve('tinymce.ThemeManager');
</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 global$1 = tinymce.util.Tools.resolve('tinymce.EditorManager');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$1 = tinymce.util.Tools.resolve('tinymce.EditorManager');
</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 global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$2 = tinymce.util.Tools.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">- var isBrandingEnabled = function (editor) {
- return editor.getParam('branding', true, 'boolean');
- };
- var hasMenubar = function (editor) {
- return getMenubar(editor) !== false;
- };
- var getMenubar = function (editor) {
- return editor.getParam('menubar');
- };
- var hasStatusbar = function (editor) {
- return editor.getParam('statusbar', true, 'boolean');
- };
- var getToolbarSize = function (editor) {
- return editor.getParam('toolbar_items_size');
- };
- var isReadOnly = function (editor) {
- return editor.getParam('readonly', false, 'boolean');
- };
- var getFixedToolbarContainer = function (editor) {
- return editor.getParam('fixed_toolbar_container');
- };
- var getInlineToolbarPositionHandler = function (editor) {
- return editor.getParam('inline_toolbar_position_handler');
- };
- var getMenu = function (editor) {
- return editor.getParam('menu');
- };
- var getRemovedMenuItems = function (editor) {
- return editor.getParam('removed_menuitems', '');
- };
- var getMinWidth = function (editor) {
- return editor.getParam('min_width', 100, 'number');
- };
- var getMinHeight = function (editor) {
- return editor.getParam('min_height', 100, 'number');
- };
- var getMaxWidth = function (editor) {
- return editor.getParam('max_width', 65535, 'number');
- };
- var getMaxHeight = function (editor) {
- return editor.getParam('max_height', 65535, 'number');
- };
- var isSkinDisabled = function (editor) {
- return editor.settings.skin === false;
- };
- var isInline = function (editor) {
- return editor.getParam('inline', false, 'boolean');
- };
- var getResize = function (editor) {
- var resize = editor.getParam('resize', 'vertical');
- if (resize === false) {
- return 'none';
- } else if (resize === 'both') {
- return 'both';
- } else {
- return 'vertical';
- }
- };
- var getSkinUrl = function (editor) {
- var settings = editor.settings;
- var skin = settings.skin;
- var skinUrl = settings.skin_url;
- if (skin !== false) {
- var skinName = skin ? skin : 'lightgray';
- if (skinUrl) {
- skinUrl = editor.documentBaseURI.toAbsolute(skinUrl);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isBrandingEnabled = function (editor) {
+ return editor.getParam('branding', true, 'boolean');
+ };
+ var hasMenubar = function (editor) {
+ return getMenubar(editor) !== false;
+ };
+ var getMenubar = function (editor) {
+ return editor.getParam('menubar');
+ };
+ var hasStatusbar = function (editor) {
+ return editor.getParam('statusbar', true, 'boolean');
+ };
+ var getToolbarSize = function (editor) {
+ return editor.getParam('toolbar_items_size');
+ };
+ var isReadOnly = function (editor) {
+ return editor.getParam('readonly', false, 'boolean');
+ };
+ var getFixedToolbarContainer = function (editor) {
+ return editor.getParam('fixed_toolbar_container');
+ };
+ var getInlineToolbarPositionHandler = function (editor) {
+ return editor.getParam('inline_toolbar_position_handler');
+ };
+ var getMenu = function (editor) {
+ return editor.getParam('menu');
+ };
+ var getRemovedMenuItems = function (editor) {
+ return editor.getParam('removed_menuitems', '');
+ };
+ var getMinWidth = function (editor) {
+ return editor.getParam('min_width', 100, 'number');
+ };
+ var getMinHeight = function (editor) {
+ return editor.getParam('min_height', 100, 'number');
+ };
+ var getMaxWidth = function (editor) {
+ return editor.getParam('max_width', 65535, 'number');
+ };
+ var getMaxHeight = function (editor) {
+ return editor.getParam('max_height', 65535, 'number');
+ };
+ var isSkinDisabled = function (editor) {
+ return editor.settings.skin === false;
+ };
+ var isInline = function (editor) {
+ return editor.getParam('inline', false, 'boolean');
+ };
+ var getResize = function (editor) {
+ var resize = editor.getParam('resize', 'vertical');
+ if (resize === false) {
+ return 'none';
+ } else if (resize === 'both') {
+ return 'both';
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- skinUrl = global$1.baseURL + '/skins/' + skinName;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 'vertical';
</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 skinUrl;
- };
- var getIndexedToolbars = function (settings, defaultToolbar) {
- var toolbars = [];
- for (var i = 1; i < 10; i++) {
- var toolbar = settings['toolbar' + i];
- if (!toolbar) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var getSkinUrl = function (editor) {
+ var settings = editor.settings;
+ var skin = settings.skin;
+ var skinUrl = settings.skin_url;
+ if (skin !== false) {
+ var skinName = skin ? skin : 'lightgray';
+ if (skinUrl) {
+ skinUrl = editor.documentBaseURI.toAbsolute(skinUrl);
+ } else {
+ skinUrl = global$1.baseURL + '/skins/' + skinName;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- toolbars.push(toolbar);
- }
- var mainToolbar = settings.toolbar ? [settings.toolbar] : [defaultToolbar];
- return toolbars.length > 0 ? toolbars : mainToolbar;
- };
- var getToolbars = function (editor) {
- var toolbar = editor.getParam('toolbar');
- var defaultToolbar = 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image';
- if (toolbar === false) {
- return [];
- } else if (global$2.isArray(toolbar)) {
- return global$2.grep(toolbar, function (toolbar) {
- return toolbar.length > 0;
- });
- } else {
- return getIndexedToolbars(editor.settings, defaultToolbar);
- }
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return skinUrl;
+ };
+ var getIndexedToolbars = function (settings, defaultToolbar) {
+ var toolbars = [];
+ for (var i = 1; i < 10; i++) {
+ var toolbar = settings['toolbar' + i];
+ if (!toolbar) {
+ break;
+ }
+ toolbars.push(toolbar);
+ }
+ var mainToolbar = settings.toolbar ? [settings.toolbar] : [defaultToolbar];
+ return toolbars.length > 0 ? toolbars : mainToolbar;
+ };
+ var getToolbars = function (editor) {
+ var toolbar = editor.getParam('toolbar');
+ var defaultToolbar = 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image';
+ if (toolbar === false) {
+ return [];
+ } else if (global$2.isArray(toolbar)) {
+ return global$2.grep(toolbar, function (toolbar) {
+ return toolbar.length > 0;
+ });
+ } else {
+ return getIndexedToolbars(editor.settings, defaultToolbar);
+ }
+ };
</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 global$3 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$3 = tinymce.util.Tools.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">- var global$4 = tinymce.util.Tools.resolve('tinymce.ui.Factory');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$4 = tinymce.util.Tools.resolve('tinymce.ui.Factory');
</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 global$5 = tinymce.util.Tools.resolve('tinymce.util.I18n');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$5 = tinymce.util.Tools.resolve('tinymce.util.I18n');
</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 fireSkinLoaded = function (editor) {
- return editor.fire('SkinLoaded');
- };
- var fireResizeEditor = function (editor) {
- return editor.fire('ResizeEditor');
- };
- var fireBeforeRenderUI = function (editor) {
- return editor.fire('BeforeRenderUI');
- };
- var $_5hpmustzjjgwefnb = {
- fireSkinLoaded: fireSkinLoaded,
- fireResizeEditor: fireResizeEditor,
- fireBeforeRenderUI: fireBeforeRenderUI
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fireSkinLoaded = function (editor) {
+ return editor.fire('SkinLoaded');
+ };
+ var fireResizeEditor = function (editor) {
+ return editor.fire('ResizeEditor');
+ };
+ var fireBeforeRenderUI = function (editor) {
+ return editor.fire('BeforeRenderUI');
+ };
+ var Events = {
+ fireSkinLoaded: fireSkinLoaded,
+ fireResizeEditor: fireResizeEditor,
+ fireBeforeRenderUI: fireBeforeRenderUI
+ };
</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 focus = function (panel, type) {
- return function () {
- var item = panel.find(type)[0];
- if (item) {
- item.focus(true);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var focus = function (panel, type) {
+ return function () {
+ var item = panel.find(type)[0];
+ if (item) {
+ item.focus(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">- };
- var addKeys = function (editor, panel) {
- editor.shortcuts.add('Alt+F9', '', focus(panel, 'menubar'));
- editor.shortcuts.add('Alt+F10,F10', '', focus(panel, 'toolbar'));
- editor.shortcuts.add('Alt+F11', '', focus(panel, 'elementpath'));
- panel.on('cancel', function () {
- editor.focus();
- });
- };
- var $_azwbz4u0jjgwefnc = { addKeys: addKeys };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var addKeys = function (editor, panel) {
+ editor.shortcuts.add('Alt+F9', '', focus(panel, 'menubar'));
+ editor.shortcuts.add('Alt+F10,F10', '', focus(panel, 'toolbar'));
+ editor.shortcuts.add('Alt+F11', '', focus(panel, 'elementpath'));
+ panel.on('cancel', function () {
+ editor.focus();
+ });
+ };
+ var A11y = { addKeys: addKeys };
</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 global$6 = tinymce.util.Tools.resolve('tinymce.geom.Rect');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$6 = tinymce.util.Tools.resolve('tinymce.geom.Rect');
</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 global$7 = tinymce.util.Tools.resolve('tinymce.util.Delay');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$7 = tinymce.util.Tools.resolve('tinymce.util.Delay');
</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 noop = function () {
- var x = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- x[_i] = arguments[_i];
- }
- };
-
- var compose = function (fa, fb) {
- return function () {
- var x = [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var noop = function () {
+ var args = [];
</ins><span class="cx" style="display: block; padding: 0 10px"> for (var _i = 0; _i < arguments.length; _i++) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- x[_i] = arguments[_i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ args[_i] = arguments[_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">- return fa(fb.apply(null, arguments));
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var constant = function (value) {
- return function () {
- return value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var constant = function (value) {
+ return function () {
+ 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">- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var never = constant(false);
+ var always = constant(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">+ var never$1 = never;
+ var always$1 = always;
+ var none = function () {
+ return NONE;
+ };
+ var NONE = function () {
+ var eq = function (o) {
+ return o.isNone();
+ };
+ var call$$1 = function (thunk) {
+ return thunk();
+ };
+ var id = function (n) {
+ return n;
+ };
+ var noop$$1 = function () {
+ };
+ var nul = function () {
+ return null;
+ };
+ var undef = function () {
+ return undefined;
+ };
+ var me = {
+ fold: function (n, s) {
+ return n();
+ },
+ is: never$1,
+ isSome: never$1,
+ isNone: always$1,
+ getOr: id,
+ getOrThunk: call$$1,
+ getOrDie: function (msg) {
+ throw new Error(msg || 'error: getOrDie called on none.');
+ },
+ getOrNull: nul,
+ getOrUndefined: undef,
+ or: id,
+ orThunk: call$$1,
+ map: none,
+ ap: none,
+ each: noop$$1,
+ bind: none,
+ flatten: none,
+ exists: never$1,
+ forall: always$1,
+ filter: none,
+ equals: eq,
+ equals_: eq,
+ toArray: function () {
+ return [];
+ },
+ toString: constant('none()')
+ };
+ if (Object.freeze)
+ Object.freeze(me);
+ return me;
+ }();
+ var some = function (a) {
+ var constant_a = function () {
+ return a;
+ };
+ var self = function () {
+ return me;
+ };
+ var map = function (f) {
+ return some(f(a));
+ };
+ var bind = function (f) {
+ return f(a);
+ };
+ var me = {
+ fold: function (n, s) {
+ return s(a);
+ },
+ is: function (v) {
+ return a === v;
+ },
+ isSome: always$1,
+ isNone: never$1,
+ getOr: constant_a,
+ getOrThunk: constant_a,
+ getOrDie: constant_a,
+ getOrNull: constant_a,
+ getOrUndefined: constant_a,
+ or: self,
+ orThunk: self,
+ map: map,
+ ap: function (optfab) {
+ return optfab.fold(none, function (fab) {
+ return some(fab(a));
+ });
+ },
+ each: function (f) {
+ f(a);
+ },
+ bind: bind,
+ flatten: constant_a,
+ exists: bind,
+ forall: bind,
+ filter: function (f) {
+ return f(a) ? me : NONE;
+ },
+ equals: function (o) {
+ return o.is(a);
+ },
+ equals_: function (o, elementEq) {
+ return o.fold(never$1, function (b) {
+ return elementEq(a, b);
+ });
+ },
+ toArray: function () {
+ return [a];
+ },
+ toString: function () {
+ return 'some(' + a + ')';
+ }
+ };
+ return me;
+ };
+ var from = function (value) {
+ return value === null || value === undefined ? NONE : some(value);
+ };
+ var Option = {
+ some: some,
+ none: none,
+ from: from
+ };
</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 curry = function (f) {
- var x = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- x[_i - 1] = arguments[_i];
- }
- var args = new Array(arguments.length - 1);
- for (var i = 1; i < arguments.length; i++)
- args[i - 1] = arguments[i];
- return function () {
- var x = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- x[_i] = arguments[_i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getUiContainerDelta = function (ctrl) {
+ var uiContainer = getUiContainer(ctrl);
+ if (uiContainer && global$3.DOM.getStyle(uiContainer, 'position', true) !== 'static') {
+ var containerPos = global$3.DOM.getPos(uiContainer);
+ var dx = uiContainer.scrollLeft - containerPos.x;
+ var dy = uiContainer.scrollTop - containerPos.y;
+ return Option.some({
+ x: dx,
+ y: dy
+ });
+ } else {
+ return Option.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 newArgs = new Array(arguments.length);
- for (var j = 0; j < newArgs.length; j++)
- newArgs[j] = arguments[j];
- var all = args.concat(newArgs);
- return f.apply(null, all);
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
-
-
-
-
- var never = constant(false);
- var always = constant(true);
-
- var never$1 = never;
- var always$1 = always;
- var none = function () {
- return NONE;
- };
- var NONE = function () {
- var eq = function (o) {
- return o.isNone();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setUiContainer = function (editor, ctrl) {
+ var uiContainer = global$3.DOM.select(editor.settings.ui_container)[0];
+ ctrl.getRoot().uiContainer = uiContainer;
</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 call$$1 = function (thunk) {
- return thunk();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getUiContainer = function (ctrl) {
+ return ctrl ? ctrl.getRoot().uiContainer : 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">- var id = function (n) {
- return n;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var inheritUiContainer = function (fromCtrl, toCtrl) {
+ return toCtrl.uiContainer = getUiContainer(fromCtrl);
</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 noop$$1 = function () {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var UiContainer = {
+ getUiContainerDelta: getUiContainerDelta,
+ setUiContainer: setUiContainer,
+ getUiContainer: getUiContainer,
+ inheritUiContainer: inheritUiContainer
</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 nul = function () {
- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var createToolbar = function (editor, items, size) {
+ var toolbarItems = [];
+ var buttonGroup;
+ if (!items) {
+ return;
+ }
+ global$2.each(items.split(/[ ,]/), function (item) {
+ var itemName;
+ var bindSelectorChanged = function () {
+ var selection = editor.selection;
+ if (item.settings.stateSelector) {
+ selection.selectorChanged(item.settings.stateSelector, function (state) {
+ item.active(state);
+ }, true);
+ }
+ if (item.settings.disabledStateSelector) {
+ selection.selectorChanged(item.settings.disabledStateSelector, function (state) {
+ item.disabled(state);
+ });
+ }
+ };
+ if (item === '|') {
+ buttonGroup = null;
+ } else {
+ if (!buttonGroup) {
+ buttonGroup = {
+ type: 'buttongroup',
+ items: []
+ };
+ toolbarItems.push(buttonGroup);
+ }
+ if (editor.buttons[item]) {
+ itemName = item;
+ item = editor.buttons[itemName];
+ if (typeof item === 'function') {
+ item = item();
+ }
+ item.type = item.type || 'button';
+ item.size = size;
+ item = global$4.create(item);
+ buttonGroup.items.push(item);
+ if (editor.initialized) {
+ bindSelectorChanged();
+ } else {
+ editor.on('init', bindSelectorChanged);
+ }
+ }
+ }
+ });
+ return {
+ type: 'toolbar',
+ layout: 'flow',
+ items: toolbarItems
+ };
</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 undef = function () {
- return undefined;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createToolbars = function (editor, size) {
+ var toolbars = [];
+ var addToolbar = function (items) {
+ if (items) {
+ toolbars.push(createToolbar(editor, items, size));
+ }
+ };
+ global$2.each(getToolbars(editor), function (toolbar) {
+ addToolbar(toolbar);
+ });
+ if (toolbars.length) {
+ return {
+ type: 'panel',
+ layout: 'stack',
+ classes: 'toolbar-grp',
+ ariaRoot: true,
+ ariaRemember: true,
+ items: toolbars
+ };
+ }
</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 me = {
- fold: function (n, s) {
- return n();
- },
- is: never$1,
- isSome: never$1,
- isNone: always$1,
- getOr: id,
- getOrThunk: call$$1,
- getOrDie: function (msg) {
- throw new Error(msg || 'error: getOrDie called on none.');
- },
- getOrNull: nul,
- getOrUndefined: undef,
- or: id,
- orThunk: call$$1,
- map: none,
- ap: none,
- each: noop$$1,
- bind: none,
- flatten: none,
- exists: never$1,
- forall: always$1,
- filter: none,
- equals: eq,
- equals_: eq,
- toArray: function () {
- return [];
- },
- toString: constant('none()')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Toolbar = {
+ createToolbar: createToolbar,
+ createToolbars: createToolbars
</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 (Object.freeze)
- Object.freeze(me);
- return me;
- }();
- var some = function (a) {
- var constant_a = function () {
- return a;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var DOM = global$3.DOM;
+ var toClientRect = function (geomRect) {
+ return {
+ left: geomRect.x,
+ top: geomRect.y,
+ width: geomRect.w,
+ height: geomRect.h,
+ right: geomRect.x + geomRect.w,
+ bottom: geomRect.y + geomRect.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">- var self = function () {
- return me;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hideAllFloatingPanels = function (editor) {
+ global$2.each(editor.contextToolbars, function (toolbar) {
+ if (toolbar.panel) {
+ toolbar.panel.hide();
+ }
+ });
</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 map = function (f) {
- return some(f(a));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var movePanelTo = function (panel, pos) {
+ panel.moveTo(pos.left, pos.top);
</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 bind = function (f) {
- return f(a);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var togglePositionClass = function (panel, relPos, predicate) {
+ relPos = relPos ? relPos.substr(0, 2) : '';
+ global$2.each({
+ t: 'down',
+ b: 'up'
+ }, function (cls, pos) {
+ panel.classes.toggle('arrow-' + cls, predicate(pos, relPos.substr(0, 1)));
+ });
+ global$2.each({
+ l: 'left',
+ r: 'right'
+ }, function (cls, pos) {
+ panel.classes.toggle('arrow-' + cls, predicate(pos, relPos.substr(1, 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">- var me = {
- fold: function (n, s) {
- return s(a);
- },
- is: function (v) {
- return a === v;
- },
- isSome: always$1,
- isNone: never$1,
- getOr: constant_a,
- getOrThunk: constant_a,
- getOrDie: constant_a,
- getOrNull: constant_a,
- getOrUndefined: constant_a,
- or: self,
- orThunk: self,
- map: map,
- ap: function (optfab) {
- return optfab.fold(none, function (fab) {
- return some(fab(a));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var userConstrain = function (handler, x, y, elementRect, contentAreaRect, panelRect) {
+ panelRect = toClientRect({
+ x: x,
+ y: y,
+ w: panelRect.w,
+ h: panelRect.h
+ });
+ if (handler) {
+ panelRect = handler({
+ elementRect: toClientRect(elementRect),
+ contentAreaRect: toClientRect(contentAreaRect),
+ panelRect: panelRect
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- },
- each: function (f) {
- f(a);
- },
- bind: bind,
- flatten: constant_a,
- exists: bind,
- forall: bind,
- filter: function (f) {
- return f(a) ? me : NONE;
- },
- equals: function (o) {
- return o.is(a);
- },
- equals_: function (o, elementEq) {
- return o.fold(never$1, function (b) {
- return elementEq(a, b);
- });
- },
- toArray: function () {
- return [a];
- },
- toString: function () {
- return 'some(' + a + ')';
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return panelRect;
</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 me;
- };
- var from = function (value) {
- return value === null || value === undefined ? NONE : some(value);
- };
- var Option = {
- some: some,
- none: none,
- from: from
- };
-
- var getUiContainerDelta = function (ctrl) {
- var uiContainer = getUiContainer(ctrl);
- if (uiContainer && global$3.DOM.getStyle(uiContainer, 'position', true) !== 'static') {
- var containerPos = global$3.DOM.getPos(uiContainer);
- var dx = uiContainer.scrollLeft - containerPos.x;
- var dy = uiContainer.scrollTop - containerPos.y;
- return Option.some({
- x: dx,
- y: dy
- });
- } else {
- return Option.none();
- }
- };
- var setUiContainer = function (editor, ctrl) {
- var uiContainer = global$3.DOM.select(editor.settings.ui_container)[0];
- ctrl.getRoot().uiContainer = uiContainer;
- };
- var getUiContainer = function (ctrl) {
- return ctrl ? ctrl.getRoot().uiContainer : null;
- };
- var inheritUiContainer = function (fromCtrl, toCtrl) {
- return toCtrl.uiContainer = getUiContainer(fromCtrl);
- };
- var $_6344qfu4jjgwefnr = {
- getUiContainerDelta: getUiContainerDelta,
- setUiContainer: setUiContainer,
- getUiContainer: getUiContainer,
- inheritUiContainer: inheritUiContainer
- };
-
- var createToolbar = function (editor, items, size) {
- var toolbarItems = [];
- var buttonGroup;
- if (!items) {
- return;
- }
- global$2.each(items.split(/[ ,]/), function (item) {
- var itemName;
- var bindSelectorChanged = function () {
- var selection = editor.selection;
- if (item.settings.stateSelector) {
- selection.selectorChanged(item.settings.stateSelector, function (state) {
- item.active(state);
- }, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var addContextualToolbars = function (editor) {
+ var scrollContainer;
+ var getContextToolbars = function () {
+ return editor.contextToolbars || [];
+ };
+ var getElementRect = function (elm) {
+ var pos, targetRect, root;
+ pos = DOM.getPos(editor.getContentAreaContainer());
+ targetRect = editor.dom.getRect(elm);
+ root = editor.dom.getRoot();
+ if (root.nodeName === 'BODY') {
+ targetRect.x -= root.ownerDocument.documentElement.scrollLeft || root.scrollLeft;
+ targetRect.y -= root.ownerDocument.documentElement.scrollTop || root.scrollTop;
</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.settings.disabledStateSelector) {
- selection.selectorChanged(item.settings.disabledStateSelector, function (state) {
- item.disabled(state);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ targetRect.x += pos.x;
+ targetRect.y += pos.y;
+ return targetRect;
+ };
+ var reposition = function (match, shouldShow) {
+ var relPos, panelRect, elementRect, contentAreaRect, panel, relRect, testPositions, smallElementWidthThreshold;
+ var handler = getInlineToolbarPositionHandler(editor);
+ if (editor.removed) {
+ return;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!match || !match.toolbar.panel) {
+ hideAllFloatingPanels(editor);
+ return;
+ }
+ testPositions = [
+ 'bc-tc',
+ 'tc-bc',
+ 'tl-bl',
+ 'bl-tl',
+ 'tr-br',
+ 'br-tr'
+ ];
+ panel = match.toolbar.panel;
+ if (shouldShow) {
+ panel.show();
+ }
+ elementRect = getElementRect(match.element);
+ panelRect = DOM.getRect(panel.getEl());
+ contentAreaRect = DOM.getRect(editor.getContentAreaContainer() || editor.getBody());
+ var delta = UiContainer.getUiContainerDelta(panel).getOr({
+ x: 0,
+ y: 0
+ });
+ elementRect.x += delta.x;
+ elementRect.y += delta.y;
+ panelRect.x += delta.x;
+ panelRect.y += delta.y;
+ contentAreaRect.x += delta.x;
+ contentAreaRect.y += delta.y;
+ smallElementWidthThreshold = 25;
+ if (DOM.getStyle(match.element, 'display', true) !== 'inline') {
+ var clientRect = match.element.getBoundingClientRect();
+ elementRect.w = clientRect.width;
+ elementRect.h = clientRect.height;
+ }
+ if (!editor.inline) {
+ contentAreaRect.w = editor.getDoc().documentElement.offsetWidth;
+ }
+ if (editor.selection.controlSelection.isResizable(match.element) && elementRect.w < smallElementWidthThreshold) {
+ elementRect = global$6.inflate(elementRect, 0, 8);
+ }
+ relPos = global$6.findBestRelativePosition(panelRect, elementRect, contentAreaRect, testPositions);
+ elementRect = global$6.clamp(elementRect, contentAreaRect);
+ if (relPos) {
+ relRect = global$6.relativePosition(panelRect, elementRect, relPos);
+ movePanelTo(panel, userConstrain(handler, relRect.x, relRect.y, elementRect, contentAreaRect, panelRect));
+ } else {
+ contentAreaRect.h += panelRect.h;
+ elementRect = global$6.intersect(contentAreaRect, elementRect);
+ if (elementRect) {
+ relPos = global$6.findBestRelativePosition(panelRect, elementRect, contentAreaRect, [
+ 'bc-tc',
+ 'bl-tl',
+ 'br-tr'
+ ]);
+ if (relPos) {
+ relRect = global$6.relativePosition(panelRect, elementRect, relPos);
+ movePanelTo(panel, userConstrain(handler, relRect.x, relRect.y, elementRect, contentAreaRect, panelRect));
+ } else {
+ movePanelTo(panel, userConstrain(handler, elementRect.x, elementRect.y, elementRect, contentAreaRect, panelRect));
+ }
+ } else {
+ panel.hide();
+ }
+ }
+ togglePositionClass(panel, relPos, function (pos1, pos2) {
+ return pos1 === pos2;
+ });
</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 === '|') {
- buttonGroup = null;
- } else {
- if (!buttonGroup) {
- buttonGroup = {
- type: 'buttongroup',
- items: []
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var repositionHandler = function (show) {
+ return function () {
+ var execute = function () {
+ if (editor.selection) {
+ reposition(findFrontMostMatch(editor.selection.getNode()), show);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- toolbarItems.push(buttonGroup);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global$7.requestAnimationFrame(execute);
+ };
+ };
+ var bindScrollEvent = function (panel) {
+ if (!scrollContainer) {
+ var reposition_1 = repositionHandler(true);
+ var uiContainer_1 = UiContainer.getUiContainer(panel);
+ scrollContainer = editor.selection.getScrollContainer() || editor.getWin();
+ DOM.bind(scrollContainer, 'scroll', reposition_1);
+ DOM.bind(uiContainer_1, 'scroll', reposition_1);
+ editor.on('remove', function () {
+ DOM.unbind(scrollContainer, 'scroll', reposition_1);
+ DOM.unbind(uiContainer_1, 'scroll', reposition_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 (editor.buttons[item]) {
- itemName = item;
- item = editor.buttons[itemName];
- if (typeof item === 'function') {
- item = item();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var showContextToolbar = function (match) {
+ var panel;
+ if (match.toolbar.panel) {
+ match.toolbar.panel.show();
+ reposition(match);
+ return;
+ }
+ panel = global$4.create({
+ type: 'floatpanel',
+ role: 'dialog',
+ classes: 'tinymce tinymce-inline arrow',
+ ariaLabel: 'Inline toolbar',
+ layout: 'flex',
+ direction: 'column',
+ align: 'stretch',
+ autohide: false,
+ autofix: true,
+ fixed: true,
+ border: 1,
+ items: Toolbar.createToolbar(editor, match.toolbar.items),
+ oncancel: function () {
+ editor.focus();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- item.type = item.type || 'button';
- item.size = size;
- item = global$4.create(item);
- buttonGroup.items.push(item);
- if (editor.initialized) {
- bindSelectorChanged();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ UiContainer.setUiContainer(editor, panel);
+ bindScrollEvent(panel);
+ match.toolbar.panel = panel;
+ panel.renderTo().reflow();
+ reposition(match);
+ };
+ var hideAllContextToolbars = function () {
+ global$2.each(getContextToolbars(), function (toolbar) {
+ if (toolbar.panel) {
+ toolbar.panel.hide();
+ }
+ });
+ };
+ var findFrontMostMatch = function (targetElm) {
+ var i, y, parentsAndSelf;
+ var toolbars = getContextToolbars();
+ parentsAndSelf = editor.$(targetElm).parents().add(targetElm);
+ for (i = parentsAndSelf.length - 1; i >= 0; i--) {
+ for (y = toolbars.length - 1; y >= 0; y--) {
+ if (toolbars[y].predicate(parentsAndSelf[i])) {
+ return {
+ toolbar: toolbars[y],
+ element: parentsAndSelf[i]
+ };
+ }
+ }
+ }
+ return null;
+ };
+ editor.on('click keyup setContent ObjectResized', function (e) {
+ if (e.type === 'setcontent' && !e.selection) {
+ return;
+ }
+ global$7.setEditorTimeout(editor, function () {
+ var match;
+ match = findFrontMostMatch(editor.selection.getNode());
+ if (match) {
+ hideAllContextToolbars();
+ showContextToolbar(match);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- editor.on('init', bindSelectorChanged);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ hideAllContextToolbars();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ });
+ editor.on('blur hide contextmenu', hideAllContextToolbars);
+ editor.on('ObjectResizeStart', function () {
+ var match = findFrontMostMatch(editor.selection.getNode());
+ if (match && match.toolbar.panel) {
+ match.toolbar.panel.hide();
</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 {
- type: 'toolbar',
- layout: 'flow',
- items: toolbarItems
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ editor.on('ResizeEditor ResizeWindow', repositionHandler(true));
+ editor.on('nodeChange', repositionHandler(false));
+ editor.on('remove', function () {
+ global$2.each(getContextToolbars(), function (toolbar) {
+ if (toolbar.panel) {
+ toolbar.panel.remove();
+ }
+ });
+ editor.contextToolbars = {};
+ });
+ editor.shortcuts.add('ctrl+F9', '', function () {
+ var match = findFrontMostMatch(editor.selection.getNode());
+ if (match && match.toolbar.panel) {
+ match.toolbar.panel.items()[0].focus();
+ }
+ });
</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 createToolbars = function (editor, size) {
- var toolbars = [];
- var addToolbar = function (items) {
- if (items) {
- toolbars.push(createToolbar(editor, items, size));
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ContextToolbars = { addContextualToolbars: addContextualToolbars };
+
+ var typeOf = function (x) {
+ if (x === null)
+ return 'null';
+ var t = typeof x;
+ if (t === 'object' && Array.prototype.isPrototypeOf(x))
+ return 'array';
+ if (t === 'object' && String.prototype.isPrototypeOf(x))
+ return 'string';
+ return t;
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global$2.each(getToolbars(editor), function (toolbar) {
- addToolbar(toolbar);
- });
- if (toolbars.length) {
- return {
- type: 'panel',
- layout: 'stack',
- classes: 'toolbar-grp',
- ariaRoot: true,
- ariaRemember: true,
- items: toolbars
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isType = function (type) {
+ return function (value) {
+ return typeOf(value) === 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 $_4udolhu7jjgwefo1 = {
- createToolbar: createToolbar,
- createToolbars: createToolbars
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var isFunction = isType('function');
+ var isNumber = isType('number');
</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 DOM = global$3.DOM;
- var toClientRect = function (geomRect) {
- return {
- left: geomRect.x,
- top: geomRect.y,
- width: geomRect.w,
- height: geomRect.h,
- right: geomRect.x + geomRect.w,
- bottom: geomRect.y + geomRect.h
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var rawIndexOf = function () {
+ var pIndexOf = Array.prototype.indexOf;
+ var fastIndex = function (xs, x) {
+ return pIndexOf.call(xs, x);
+ };
+ var slowIndex = function (xs, x) {
+ return slowIndexOf(xs, x);
+ };
+ return pIndexOf === undefined ? slowIndex : fastIndex;
+ }();
+ var indexOf = function (xs, x) {
+ var r = rawIndexOf(xs, x);
+ return r === -1 ? Option.none() : Option.some(r);
</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 hideAllFloatingPanels = function (editor) {
- global$2.each(editor.contextToolbars, function (toolbar) {
- if (toolbar.panel) {
- toolbar.panel.hide();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var exists = function (xs, pred) {
+ return findIndex(xs, pred).isSome();
+ };
+ var map = function (xs, f) {
+ var len = xs.length;
+ var r = new Array(len);
+ for (var i = 0; i < len; i++) {
+ var x = xs[i];
+ r[i] = f(x, i, xs);
</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 movePanelTo = function (panel, pos) {
- panel.moveTo(pos.left, pos.top);
- };
- var togglePositionClass = function (panel, relPos, predicate) {
- relPos = relPos ? relPos.substr(0, 2) : '';
- global$2.each({
- t: 'down',
- b: 'up'
- }, function (cls, pos) {
- panel.classes.toggle('arrow-' + cls, predicate(pos, relPos.substr(0, 1)));
- });
- global$2.each({
- l: 'left',
- r: 'right'
- }, function (cls, pos) {
- panel.classes.toggle('arrow-' + cls, predicate(pos, relPos.substr(1, 1)));
- });
- };
- var userConstrain = function (handler, x, y, elementRect, contentAreaRect, panelRect) {
- panelRect = toClientRect({
- x: x,
- y: y,
- w: panelRect.w,
- h: panelRect.h
- });
- if (handler) {
- panelRect = handler({
- elementRect: toClientRect(elementRect),
- contentAreaRect: toClientRect(contentAreaRect),
- panelRect: panelRect
- });
- }
- return panelRect;
- };
- var addContextualToolbars = function (editor) {
- var scrollContainer;
- var getContextToolbars = function () {
- return editor.contextToolbars || [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return r;
</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 getElementRect = function (elm) {
- var pos, targetRect, root;
- pos = DOM.getPos(editor.getContentAreaContainer());
- targetRect = editor.dom.getRect(elm);
- root = editor.dom.getRoot();
- if (root.nodeName === 'BODY') {
- targetRect.x -= root.ownerDocument.documentElement.scrollLeft || root.scrollLeft;
- targetRect.y -= root.ownerDocument.documentElement.scrollTop || root.scrollTop;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var each = function (xs, f) {
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ f(x, i, xs);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- targetRect.x += pos.x;
- targetRect.y += pos.y;
- return targetRect;
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var reposition = function (match, shouldShow) {
- var relPos, panelRect, elementRect, contentAreaRect, panel, relRect, testPositions, smallElementWidthThreshold;
- var handler = getInlineToolbarPositionHandler(editor);
- if (editor.removed) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var filter = function (xs, pred) {
+ var r = [];
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ if (pred(x, i, xs)) {
+ r.push(x);
+ }
</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 (!match || !match.toolbar.panel) {
- hideAllFloatingPanels(editor);
- return;
- }
- testPositions = [
- 'bc-tc',
- 'tc-bc',
- 'tl-bl',
- 'bl-tl',
- 'tr-br',
- 'br-tr'
- ];
- panel = match.toolbar.panel;
- if (shouldShow) {
- panel.show();
- }
- elementRect = getElementRect(match.element);
- panelRect = DOM.getRect(panel.getEl());
- contentAreaRect = DOM.getRect(editor.getContentAreaContainer() || editor.getBody());
- var delta = $_6344qfu4jjgwefnr.getUiContainerDelta(panel).getOr({
- x: 0,
- y: 0
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return r;
+ };
+ var foldl = function (xs, f, acc) {
+ each(xs, function (x) {
+ acc = f(acc, x);
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- elementRect.x += delta.x;
- elementRect.y += delta.y;
- panelRect.x += delta.x;
- panelRect.y += delta.y;
- contentAreaRect.x += delta.x;
- contentAreaRect.y += delta.y;
- smallElementWidthThreshold = 25;
- if (DOM.getStyle(match.element, 'display', true) !== 'inline') {
- var clientRect = match.element.getBoundingClientRect();
- elementRect.w = clientRect.width;
- elementRect.h = clientRect.height;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return acc;
+ };
+ var find = function (xs, pred) {
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ if (pred(x, i, xs)) {
+ return Option.some(x);
+ }
</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.inline) {
- contentAreaRect.w = editor.getDoc().documentElement.offsetWidth;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Option.none();
+ };
+ var findIndex = function (xs, pred) {
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ if (pred(x, i, xs)) {
+ return Option.some(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 (editor.selection.controlSelection.isResizable(match.element) && elementRect.w < smallElementWidthThreshold) {
- elementRect = global$6.inflate(elementRect, 0, 8);
- }
- relPos = global$6.findBestRelativePosition(panelRect, elementRect, contentAreaRect, testPositions);
- elementRect = global$6.clamp(elementRect, contentAreaRect);
- if (relPos) {
- relRect = global$6.relativePosition(panelRect, elementRect, relPos);
- movePanelTo(panel, userConstrain(handler, relRect.x, relRect.y, elementRect, contentAreaRect, panelRect));
- } else {
- contentAreaRect.h += panelRect.h;
- elementRect = global$6.intersect(contentAreaRect, elementRect);
- if (elementRect) {
- relPos = global$6.findBestRelativePosition(panelRect, elementRect, contentAreaRect, [
- 'bc-tc',
- 'bl-tl',
- 'br-tr'
- ]);
- if (relPos) {
- relRect = global$6.relativePosition(panelRect, elementRect, relPos);
- movePanelTo(panel, userConstrain(handler, relRect.x, relRect.y, elementRect, contentAreaRect, panelRect));
- } else {
- movePanelTo(panel, userConstrain(handler, elementRect.x, elementRect.y, elementRect, contentAreaRect, panelRect));
- }
- } else {
- panel.hide();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Option.none();
+ };
+ var slowIndexOf = function (xs, x) {
+ for (var i = 0, len = xs.length; i < len; ++i) {
+ if (xs[i] === x) {
+ return i;
</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">- togglePositionClass(panel, relPos, function (pos1, pos2) {
- return pos1 === pos2;
- });
</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">- var repositionHandler = function (show) {
- return function () {
- var execute = function () {
- if (editor.selection) {
- reposition(findFrontMostMatch(editor.selection.getNode()), show);
- }
- };
- global$7.requestAnimationFrame(execute);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var push = Array.prototype.push;
+ var flatten = function (xs) {
+ var r = [];
+ for (var i = 0, len = xs.length; i < len; ++i) {
+ if (!Array.prototype.isPrototypeOf(xs[i]))
+ throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
+ push.apply(r, xs[i]);
+ }
+ return r;
+ };
+ var slice = Array.prototype.slice;
+ var from$1 = isFunction(Array.from) ? Array.from : function (x) {
+ return slice.call(x);
+ };
+
+ var defaultMenus = {
+ file: {
+ title: 'File',
+ items: 'newdocument restoredraft | preview | print'
+ },
+ edit: {
+ title: 'Edit',
+ items: 'undo redo | cut copy paste pastetext | selectall'
+ },
+ view: {
+ title: 'View',
+ items: 'code | visualaid visualchars visualblocks | spellchecker | preview fullscreen'
+ },
+ insert: {
+ title: 'Insert',
+ items: 'image link media template codesample inserttable | charmap hr | pagebreak nonbreaking anchor toc | insertdatetime'
+ },
+ format: {
+ title: 'Format',
+ items: 'bold italic underline strikethrough superscript subscript codeformat | blockformats align | removeformat'
+ },
+ tools: {
+ title: 'Tools',
+ items: 'spellchecker spellcheckerlanguage | a11ycheck code'
+ },
+ table: { title: 'Table' },
+ help: { title: 'Help' }
+ };
+ var delimiterMenuNamePair = function () {
+ return {
+ name: '|',
+ item: { text: '|' }
</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">- var bindScrollEvent = function (panel) {
- if (!scrollContainer) {
- var reposition_1 = repositionHandler(true);
- var uiContainer_1 = $_6344qfu4jjgwefnr.getUiContainer(panel);
- scrollContainer = editor.selection.getScrollContainer() || editor.getWin();
- DOM.bind(scrollContainer, 'scroll', reposition_1);
- DOM.bind(uiContainer_1, 'scroll', reposition_1);
- editor.on('remove', function () {
- DOM.unbind(scrollContainer, 'scroll', reposition_1);
- DOM.unbind(uiContainer_1, 'scroll', reposition_1);
- });
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createMenuNameItemPair = function (name, item) {
+ var menuItem = item ? {
+ name: name,
+ item: item
+ } : null;
+ return name === '|' ? delimiterMenuNamePair() : 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">- var showContextToolbar = function (match) {
- var panel;
- if (match.toolbar.panel) {
- match.toolbar.panel.show();
- reposition(match);
- return;
- }
- panel = global$4.create({
- type: 'floatpanel',
- role: 'dialog',
- classes: 'tinymce tinymce-inline arrow',
- ariaLabel: 'Inline toolbar',
- layout: 'flex',
- direction: 'column',
- align: 'stretch',
- autohide: false,
- autofix: true,
- fixed: true,
- border: 1,
- items: $_4udolhu7jjgwefo1.createToolbar(editor, match.toolbar.items),
- oncancel: function () {
- editor.focus();
- }
- });
- $_6344qfu4jjgwefnr.setUiContainer(editor, panel);
- bindScrollEvent(panel);
- match.toolbar.panel = panel;
- panel.renderTo().reflow();
- reposition(match);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasItemName = function (namedMenuItems, name) {
+ return findIndex(namedMenuItems, function (namedMenuItem) {
+ return namedMenuItem.name === name;
+ }).isSome();
</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 hideAllContextToolbars = function () {
- global$2.each(getContextToolbars(), function (toolbar) {
- if (toolbar.panel) {
- toolbar.panel.hide();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isSeparator = function (namedMenuItem) {
+ return namedMenuItem && namedMenuItem.item.text === '|';
+ };
+ var cleanupMenu = function (namedMenuItems, removedMenuItems) {
+ var menuItemsPass1 = filter(namedMenuItems, function (namedMenuItem) {
+ return removedMenuItems.hasOwnProperty(namedMenuItem.name) === false;
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var menuItemsPass2 = filter(menuItemsPass1, function (namedMenuItem, i, namedMenuItems) {
+ return !isSeparator(namedMenuItem) || !isSeparator(namedMenuItems[i - 1]);
+ });
+ return filter(menuItemsPass2, function (namedMenuItem, i, namedMenuItems) {
+ return !isSeparator(namedMenuItem) || i > 0 && i < namedMenuItems.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">- var findFrontMostMatch = function (targetElm) {
- var i, y, parentsAndSelf;
- var toolbars = getContextToolbars();
- parentsAndSelf = editor.$(targetElm).parents().add(targetElm);
- for (i = parentsAndSelf.length - 1; i >= 0; i--) {
- for (y = toolbars.length - 1; y >= 0; y--) {
- if (toolbars[y].predicate(parentsAndSelf[i])) {
- return {
- toolbar: toolbars[y],
- element: parentsAndSelf[i]
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createMenu = function (editorMenuItems, menus, removedMenuItems, context) {
+ var menuButton, menu, namedMenuItems, isUserDefined;
+ if (menus) {
+ menu = menus[context];
+ isUserDefined = true;
+ } else {
+ menu = defaultMenus[context];
+ }
+ if (menu) {
+ menuButton = { text: menu.title };
+ namedMenuItems = [];
+ global$2.each((menu.items || '').split(/[ ,]/), function (name) {
+ var namedMenuItem = createMenuNameItemPair(name, editorMenuItems[name]);
+ if (namedMenuItem) {
+ namedMenuItems.push(namedMenuItem);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ if (!isUserDefined) {
+ global$2.each(editorMenuItems, function (item, name) {
+ if (item.context === context && !hasItemName(namedMenuItems, name)) {
+ if (item.separator === 'before') {
+ namedMenuItems.push(delimiterMenuNamePair());
+ }
+ if (item.prependToContext) {
+ namedMenuItems.unshift(createMenuNameItemPair(name, item));
+ } else {
+ namedMenuItems.push(createMenuNameItemPair(name, item));
+ }
+ if (item.separator === 'after') {
+ namedMenuItems.push(delimiterMenuNamePair());
+ }
+ }
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ menuButton.menu = map(cleanupMenu(namedMenuItems, removedMenuItems), function (menuItem) {
+ return menuItem.item;
+ });
+ if (!menuButton.menu.length) {
+ return 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 null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return menuButton;
</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('click keyup setContent ObjectResized', function (e) {
- if (e.type === 'setcontent' && !e.selection) {
- return;
- }
- global$7.setEditorTimeout(editor, function () {
- var match;
- match = findFrontMostMatch(editor.selection.getNode());
- if (match) {
- hideAllContextToolbars();
- showContextToolbar(match);
- } else {
- hideAllContextToolbars();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getDefaultMenubar = function (editor) {
+ var name;
+ var defaultMenuBar = [];
+ var menu = getMenu(editor);
+ if (menu) {
+ for (name in menu) {
+ defaultMenuBar.push(name);
</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('blur hide contextmenu', hideAllContextToolbars);
- editor.on('ObjectResizeStart', function () {
- var match = findFrontMostMatch(editor.selection.getNode());
- if (match && match.toolbar.panel) {
- match.toolbar.panel.hide();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ for (name in defaultMenus) {
+ defaultMenuBar.push(name);
+ }
</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('ResizeEditor ResizeWindow', repositionHandler(true));
- editor.on('nodeChange', repositionHandler(false));
- editor.on('remove', function () {
- global$2.each(getContextToolbars(), function (toolbar) {
- if (toolbar.panel) {
- toolbar.panel.remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return defaultMenuBar;
+ };
+ var createMenuButtons = function (editor) {
+ var menuButtons = [];
+ var defaultMenuBar = getDefaultMenubar(editor);
+ var removedMenuItems = global$2.makeMap(getRemovedMenuItems(editor).split(/[ ,]/));
+ var menubar = getMenubar(editor);
+ var enabledMenuNames = typeof menubar === 'string' ? menubar.split(/[ ,]/) : defaultMenuBar;
+ for (var i = 0; i < enabledMenuNames.length; i++) {
+ var menuItems = enabledMenuNames[i];
+ var menu = createMenu(editor.menuItems, getMenu(editor), removedMenuItems, menuItems);
+ if (menu) {
+ menuButtons.push(menu);
</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.contextToolbars = {};
- });
- editor.shortcuts.add('ctrl+shift+e > ctrl+shift+p', '', function () {
- var match = findFrontMostMatch(editor.selection.getNode());
- if (match && match.toolbar.panel) {
- match.toolbar.panel.items()[0].focus();
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- };
- var $_g1gegqu1jjgwefne = { addContextualToolbars: addContextualToolbars };
-
- var typeOf = function (x) {
- if (x === null)
- return 'null';
- var t = typeof x;
- if (t === 'object' && Array.prototype.isPrototypeOf(x))
- return 'array';
- if (t === 'object' && String.prototype.isPrototypeOf(x))
- return 'string';
- return t;
- };
- var isType = function (type) {
- return function (value) {
- return typeOf(value) === type;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return menuButtons;
</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">+ var Menubar = { createMenuButtons: createMenuButtons };
</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 isFunction = isType('function');
- var isNumber = isType('number');
-
- var rawIndexOf = function () {
- var pIndexOf = Array.prototype.indexOf;
- var fastIndex = function (xs, x) {
- return pIndexOf.call(xs, x);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var DOM$1 = global$3.DOM;
+ var getSize = function (elm) {
+ return {
+ width: elm.clientWidth,
+ height: elm.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">- var slowIndex = function (xs, x) {
- return slowIndexOf(xs, x);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var resizeTo = function (editor, width, height) {
+ var containerElm, iframeElm, containerSize, iframeSize;
+ containerElm = editor.getContainer();
+ iframeElm = editor.getContentAreaContainer().firstChild;
+ containerSize = getSize(containerElm);
+ iframeSize = getSize(iframeElm);
+ if (width !== null) {
+ width = Math.max(getMinWidth(editor), width);
+ width = Math.min(getMaxWidth(editor), width);
+ DOM$1.setStyle(containerElm, 'width', width + (containerSize.width - iframeSize.width));
+ DOM$1.setStyle(iframeElm, 'width', width);
+ }
+ height = Math.max(getMinHeight(editor), height);
+ height = Math.min(getMaxHeight(editor), height);
+ DOM$1.setStyle(iframeElm, 'height', height);
+ Events.fireResizeEditor(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 pIndexOf === undefined ? slowIndex : fastIndex;
- }();
- var indexOf = function (xs, x) {
- var r = rawIndexOf(xs, x);
- return r === -1 ? Option.none() : Option.some(r);
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var resizeBy = function (editor, dw, dh) {
+ var elm = editor.getContentAreaContainer();
+ resizeTo(editor, elm.clientWidth + dw, elm.clientHeight + dh);
+ };
+ var Resize = {
+ resizeTo: resizeTo,
+ resizeBy: resizeBy
+ };
</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 exists = function (xs, pred) {
- return findIndex(xs, pred).isSome();
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$8 = tinymce.util.Tools.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">-
- var map = function (xs, f) {
- var len = xs.length;
- var r = new Array(len);
- for (var i = 0; i < len; i++) {
- var x = xs[i];
- r[i] = f(x, i, xs);
- }
- return r;
- };
- var each = function (xs, f) {
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- f(x, i, xs);
- }
- };
-
-
- var filter = function (xs, pred) {
- var r = [];
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- if (pred(x, i, xs)) {
- r.push(x);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var api = function (elm) {
+ return {
+ element: function () {
+ return elm;
+ }
+ };
+ };
+ var trigger = function (sidebar, panel, callbackName) {
+ var callback = sidebar.settings[callbackName];
+ if (callback) {
+ callback(api(panel.getEl('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 r;
- };
-
-
- var foldl = function (xs, f, acc) {
- each(xs, function (x) {
- acc = f(acc, x);
- });
- return acc;
- };
- var find = function (xs, pred) {
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- if (pred(x, i, xs)) {
- return Option.some(x);
- }
- }
- return Option.none();
- };
- var findIndex = function (xs, pred) {
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- if (pred(x, i, xs)) {
- return Option.some(i);
- }
- }
- return Option.none();
- };
- var slowIndexOf = function (xs, x) {
- for (var i = 0, len = xs.length; i < len; ++i) {
- if (xs[i] === x) {
- return i;
- }
- }
- return -1;
- };
- var push = Array.prototype.push;
- var flatten = function (xs) {
- var r = [];
- for (var i = 0, len = xs.length; i < len; ++i) {
- if (!Array.prototype.isPrototypeOf(xs[i]))
- throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
- push.apply(r, xs[i]);
- }
- return r;
- };
-
-
-
- var slice = Array.prototype.slice;
- var reverse = function (xs) {
- var r = slice.call(xs, 0);
- r.reverse();
- return r;
- };
-
-
-
-
-
-
- var from$1 = isFunction(Array.from) ? Array.from : function (x) {
- return slice.call(x);
- };
-
- var defaultMenus = {
- file: {
- title: 'File',
- items: 'newdocument restoredraft | preview | print'
- },
- edit: {
- title: 'Edit',
- items: 'undo redo | cut copy paste pastetext | selectall'
- },
- view: {
- title: 'View',
- items: 'code | visualaid visualchars visualblocks | spellchecker | preview fullscreen'
- },
- insert: {
- title: 'Insert',
- items: 'image link media template codesample inserttable | charmap hr | pagebreak nonbreaking anchor toc | insertdatetime'
- },
- format: {
- title: 'Format',
- items: 'bold italic underline strikethrough superscript subscript codeformat | blockformats align | removeformat'
- },
- tools: {
- title: 'Tools',
- items: 'spellchecker spellcheckerlanguage | a11ycheck code'
- },
- table: { title: 'Table' },
- help: { title: 'Help' }
- };
- var delimiterMenuNamePair = function () {
- return {
- name: '|',
- item: { text: '|' }
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var createMenuNameItemPair = function (name, item) {
- var menuItem = item ? {
- name: name,
- item: item
- } : null;
- return name === '|' ? delimiterMenuNamePair() : menuItem;
- };
- var hasItemName = function (namedMenuItems, name) {
- return findIndex(namedMenuItems, function (namedMenuItem) {
- return namedMenuItem.name === name;
- }).isSome();
- };
- var isSeparator = function (namedMenuItem) {
- return namedMenuItem && namedMenuItem.item.text === '|';
- };
- var cleanupMenu = function (namedMenuItems, removedMenuItems) {
- var menuItemsPass1 = filter(namedMenuItems, function (namedMenuItem) {
- return removedMenuItems.hasOwnProperty(namedMenuItem.name) === false;
- });
- var menuItemsPass2 = filter(menuItemsPass1, function (namedMenuItem, i, namedMenuItems) {
- return !isSeparator(namedMenuItem) || !isSeparator(namedMenuItems[i - 1]);
- });
- return filter(menuItemsPass2, function (namedMenuItem, i, namedMenuItems) {
- return !isSeparator(namedMenuItem) || i > 0 && i < namedMenuItems.length - 1;
- });
- };
- var createMenu = function (editorMenuItems, menus, removedMenuItems, context) {
- var menuButton, menu, namedMenuItems, isUserDefined;
- if (menus) {
- menu = menus[context];
- isUserDefined = true;
- } else {
- menu = defaultMenus[context];
- }
- if (menu) {
- menuButton = { text: menu.title };
- namedMenuItems = [];
- global$2.each((menu.items || '').split(/[ ,]/), function (name) {
- var namedMenuItem = createMenuNameItemPair(name, editorMenuItems[name]);
- if (namedMenuItem) {
- namedMenuItems.push(namedMenuItem);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hidePanels = function (name, container, sidebars) {
+ global$2.each(sidebars, function (sidebar) {
+ var panel = container.items().filter('#' + sidebar.name)[0];
+ if (panel && panel.visible() && sidebar.name !== name) {
+ trigger(sidebar, panel, 'onhide');
+ panel.visible(false);
</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">- if (!isUserDefined) {
- global$2.each(editorMenuItems, function (item, name) {
- if (item.context === context && !hasItemName(namedMenuItems, name)) {
- if (item.separator === 'before') {
- namedMenuItems.push(delimiterMenuNamePair());
- }
- if (item.prependToContext) {
- namedMenuItems.unshift(createMenuNameItemPair(name, item));
- } else {
- namedMenuItems.push(createMenuNameItemPair(name, item));
- }
- if (item.separator === 'after') {
- namedMenuItems.push(delimiterMenuNamePair());
- }
- }
- });
- }
- menuButton.menu = map(cleanupMenu(namedMenuItems, removedMenuItems), function (menuItem) {
- return menuItem.item;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var deactivateButtons = function (toolbar) {
+ toolbar.items().each(function (ctrl) {
+ ctrl.active(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 (!menuButton.menu.length) {
- return null;
- }
- }
- return menuButton;
- };
- var getDefaultMenubar = function (editor) {
- var name;
- var defaultMenuBar = [];
- var menu = getMenu(editor);
- if (menu) {
- for (name in menu) {
- defaultMenuBar.push(name);
- }
- } else {
- for (name in defaultMenus) {
- defaultMenuBar.push(name);
- }
- }
- return defaultMenuBar;
- };
- var createMenuButtons = function (editor) {
- var menuButtons = [];
- var defaultMenuBar = getDefaultMenubar(editor);
- var removedMenuItems = global$2.makeMap(getRemovedMenuItems(editor).split(/[ ,]/));
- var menubar = getMenubar(editor);
- var enabledMenuNames = typeof menubar === 'string' ? menubar.split(/[ ,]/) : defaultMenuBar;
- for (var i = 0; i < enabledMenuNames.length; i++) {
- var menuItems = enabledMenuNames[i];
- var menu = createMenu(editor.menuItems, getMenu(editor), removedMenuItems, menuItems);
- if (menu) {
- menuButtons.push(menu);
- }
- }
- return menuButtons;
- };
- var $_bahgsqu8jjgwefo4 = { createMenuButtons: createMenuButtons };
-
- var DOM$1 = global$3.DOM;
- var getSize = function (elm) {
- return {
- width: elm.clientWidth,
- height: elm.clientHeight
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var resizeTo = function (editor, width, height) {
- var containerElm, iframeElm, containerSize, iframeSize;
- containerElm = editor.getContainer();
- iframeElm = editor.getContentAreaContainer().firstChild;
- containerSize = getSize(containerElm);
- iframeSize = getSize(iframeElm);
- if (width !== null) {
- width = Math.max(getMinWidth(editor), width);
- width = Math.min(getMaxWidth(editor), width);
- DOM$1.setStyle(containerElm, 'width', width + (containerSize.width - iframeSize.width));
- DOM$1.setStyle(iframeElm, 'width', width);
- }
- height = Math.max(getMinHeight(editor), height);
- height = Math.min(getMaxHeight(editor), height);
- DOM$1.setStyle(iframeElm, 'height', height);
- $_5hpmustzjjgwefnb.fireResizeEditor(editor);
- };
- var resizeBy = function (editor, dw, dh) {
- var elm = editor.getContentAreaContainer();
- resizeTo(editor, elm.clientWidth + dw, elm.clientHeight + dh);
- };
- var $_sd6u0ubjjgwefok = {
- resizeTo: resizeTo,
- resizeBy: resizeBy
- };
-
- var global$8 = tinymce.util.Tools.resolve('tinymce.Env');
-
- var api = function (elm) {
- return {
- element: function () {
- return elm;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var findSidebar = function (sidebars, name) {
+ return global$2.grep(sidebars, function (sidebar) {
+ return sidebar.name === name;
+ })[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">- };
- var trigger = function (sidebar, panel, callbackName) {
- var callback = sidebar.settings[callbackName];
- if (callback) {
- callback(api(panel.getEl('body')));
- }
- };
- var hidePanels = function (name, container, sidebars) {
- global$2.each(sidebars, function (sidebar) {
- var panel = container.items().filter('#' + sidebar.name)[0];
- if (panel && panel.visible() && sidebar.name !== name) {
- trigger(sidebar, panel, 'onhide');
- panel.visible(false);
- }
- });
- };
- var deactivateButtons = function (toolbar) {
- toolbar.items().each(function (ctrl) {
- ctrl.active(false);
- });
- };
- var findSidebar = function (sidebars, name) {
- return global$2.grep(sidebars, function (sidebar) {
- return sidebar.name === name;
- })[0];
- };
- var showPanel = function (editor, name, sidebars) {
- return function (e) {
- var btnCtrl = e.control;
- var container = btnCtrl.parents().filter('panel')[0];
- var panel = container.find('#' + name)[0];
- var sidebar = findSidebar(sidebars, name);
- hidePanels(name, container, sidebars);
- deactivateButtons(btnCtrl.parent());
- if (panel && panel.visible()) {
- trigger(sidebar, panel, 'onhide');
- panel.hide();
- btnCtrl.active(false);
- } else {
- if (panel) {
- panel.show();
- trigger(sidebar, panel, 'onshow');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var showPanel = function (editor, name, sidebars) {
+ return function (e) {
+ var btnCtrl = e.control;
+ var container = btnCtrl.parents().filter('panel')[0];
+ var panel = container.find('#' + name)[0];
+ var sidebar = findSidebar(sidebars, name);
+ hidePanels(name, container, sidebars);
+ deactivateButtons(btnCtrl.parent());
+ if (panel && panel.visible()) {
+ trigger(sidebar, panel, 'onhide');
+ panel.hide();
+ btnCtrl.active(false);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- panel = global$4.create({
- type: 'container',
- name: name,
- layout: 'stack',
- classes: 'sidebar-panel',
- html: ''
- });
- container.prepend(panel);
- trigger(sidebar, panel, 'onrender');
- trigger(sidebar, panel, 'onshow');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (panel) {
+ panel.show();
+ trigger(sidebar, panel, 'onshow');
+ } else {
+ panel = global$4.create({
+ type: 'container',
+ name: name,
+ layout: 'stack',
+ classes: 'sidebar-panel',
+ html: ''
+ });
+ container.prepend(panel);
+ trigger(sidebar, panel, 'onrender');
+ trigger(sidebar, panel, 'onshow');
+ }
+ btnCtrl.active(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">- btnCtrl.active(true);
- }
- $_5hpmustzjjgwefnb.fireResizeEditor(editor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Events.fireResizeEditor(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">- };
- var isModernBrowser = function () {
- return !global$8.ie || global$8.ie >= 11;
- };
- var hasSidebar = function (editor) {
- return isModernBrowser() && editor.sidebars ? editor.sidebars.length > 0 : false;
- };
- var createSidebar = function (editor) {
- var buttons = global$2.map(editor.sidebars, function (sidebar) {
- var settings = sidebar.settings;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isModernBrowser = function () {
+ return !global$8.ie || global$8.ie >= 11;
+ };
+ var hasSidebar = function (editor) {
+ return isModernBrowser() && editor.sidebars ? editor.sidebars.length > 0 : false;
+ };
+ var createSidebar = function (editor) {
+ var buttons = global$2.map(editor.sidebars, function (sidebar) {
+ var settings = sidebar.settings;
+ return {
+ type: 'button',
+ icon: settings.icon,
+ image: settings.image,
+ tooltip: settings.tooltip,
+ onclick: showPanel(editor, sidebar.name, editor.sidebars)
+ };
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- type: 'button',
- icon: settings.icon,
- image: settings.image,
- tooltip: settings.tooltip,
- onclick: showPanel(editor, sidebar.name, editor.sidebars)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ type: 'panel',
+ name: 'sidebar',
+ layout: 'stack',
+ classes: 'sidebar',
+ items: [{
+ type: 'toolbar',
+ layout: 'stack',
+ classes: 'sidebar-toolbar',
+ items: 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">- });
- return {
- type: 'panel',
- name: 'sidebar',
- layout: 'stack',
- classes: 'sidebar',
- items: [{
- type: 'toolbar',
- layout: 'stack',
- classes: 'sidebar-toolbar',
- items: buttons
- }]
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var $_b7ut9jucjjgwefom = {
- hasSidebar: hasSidebar,
- createSidebar: createSidebar
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Sidebar = {
+ hasSidebar: hasSidebar,
+ createSidebar: createSidebar
+ };
</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 fireSkinLoaded$1 = function (editor) {
- var done = function () {
- editor._skinLoaded = true;
- $_5hpmustzjjgwefnb.fireSkinLoaded(editor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fireSkinLoaded$1 = function (editor) {
+ var done = function () {
+ editor._skinLoaded = true;
+ Events.fireSkinLoaded(editor);
+ };
+ return function () {
+ if (editor.initialized) {
+ done();
+ } else {
+ editor.on('init', 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">- return function () {
- if (editor.initialized) {
- done();
- } else {
- editor.on('init', done);
- }
- };
- };
- var $_awdosmuejjgwefop = { fireSkinLoaded: fireSkinLoaded$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var SkinLoaded = { fireSkinLoaded: fireSkinLoaded$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">- var DOM$2 = global$3.DOM;
- var switchMode = function (panel) {
- return function (e) {
- panel.find('*').disabled(e.mode === 'readonly');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var DOM$2 = global$3.DOM;
+ var switchMode = function (panel) {
+ return function (e) {
+ panel.find('*').disabled(e.mode === 'readonly');
+ };
</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 editArea = function (border) {
- return {
- type: 'panel',
- name: 'iframe',
- layout: 'stack',
- classes: 'edit-area',
- border: border,
- html: ''
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var editArea = function (border) {
+ return {
+ type: 'panel',
+ name: 'iframe',
+ layout: 'stack',
+ classes: 'edit-area',
+ border: border,
+ html: ''
+ };
</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 editAreaContainer = function (editor) {
- return {
- type: 'panel',
- layout: 'stack',
- classes: 'edit-aria-container',
- border: '1 0 0 0',
- items: [
- editArea('0'),
- $_b7ut9jucjjgwefom.createSidebar(editor)
- ]
- };
- };
- var render = function (editor, theme, args) {
- var panel, resizeHandleCtrl, startSize;
- if (isSkinDisabled(editor) === false && args.skinUiCss) {
- DOM$2.styleSheetLoader.load(args.skinUiCss, $_awdosmuejjgwefop.fireSkinLoaded(editor));
- } else {
- $_awdosmuejjgwefop.fireSkinLoaded(editor)();
- }
- panel = theme.panel = global$4.create({
- type: 'panel',
- role: 'application',
- classes: 'tinymce',
- style: 'visibility: hidden',
- layout: 'stack',
- border: 1,
- items: [
- {
- type: 'container',
- classes: 'top-part',
- items: [
- hasMenubar(editor) === false ? null : {
- type: 'menubar',
- border: '0 0 1 0',
- items: $_bahgsqu8jjgwefo4.createMenuButtons(editor)
- },
- $_4udolhu7jjgwefo1.createToolbars(editor, getToolbarSize(editor))
- ]
- },
- $_b7ut9jucjjgwefom.hasSidebar(editor) ? editAreaContainer(editor) : editArea('1 0 0 0')
- ]
- });
- $_6344qfu4jjgwefnr.setUiContainer(editor, panel);
- if (getResize(editor) !== 'none') {
- resizeHandleCtrl = {
- type: 'resizehandle',
- direction: getResize(editor),
- onResizeStart: function () {
- var elm = editor.getContentAreaContainer().firstChild;
- startSize = {
- width: elm.clientWidth,
- height: elm.clientHeight
- };
- },
- onResize: function (e) {
- if (getResize(editor) === 'both') {
- $_sd6u0ubjjgwefok.resizeTo(editor, startSize.width + e.deltaX, startSize.height + e.deltaY);
- } else {
- $_sd6u0ubjjgwefok.resizeTo(editor, null, startSize.height + e.deltaY);
- }
- }
- };
- }
- if (hasStatusbar(editor)) {
- var linkHtml = '<a href="https://www.tinymce.com/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce" rel="noopener" target="_blank" role="presentation" tabindex="-1">tinymce</a>';
- var html = global$5.translate([
- 'Powered by {0}',
- linkHtml
- ]);
- var brandingLabel = isBrandingEnabled(editor) ? {
- type: 'label',
- classes: 'branding',
- html: ' ' + html
- } : null;
- panel.add({
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var editAreaContainer = function (editor) {
+ return {
</ins><span class="cx" style="display: block; padding: 0 10px"> type: 'panel',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- name: 'statusbar',
- classes: 'statusbar',
- layout: 'flow',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ layout: 'stack',
+ classes: 'edit-aria-container',
</ins><span class="cx" style="display: block; padding: 0 10px"> border: '1 0 0 0',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ariaRoot: true,
</del><span class="cx" style="display: block; padding: 0 10px"> items: [
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editArea('0'),
+ Sidebar.createSidebar(editor)
+ ]
+ };
+ };
+ var render = function (editor, theme, args) {
+ var panel, resizeHandleCtrl, startSize;
+ if (isSkinDisabled(editor) === false && args.skinUiCss) {
+ DOM$2.styleSheetLoader.load(args.skinUiCss, SkinLoaded.fireSkinLoaded(editor));
+ } else {
+ SkinLoaded.fireSkinLoaded(editor)();
+ }
+ panel = theme.panel = global$4.create({
+ type: 'panel',
+ role: 'application',
+ classes: 'tinymce',
+ style: 'visibility: hidden',
+ layout: 'stack',
+ border: 1,
+ items: [
</ins><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- type: 'elementpath',
- editor: editor
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ type: 'container',
+ classes: 'top-part',
+ items: [
+ hasMenubar(editor) === false ? null : {
+ type: 'menubar',
+ border: '0 0 1 0',
+ items: Menubar.createMenuButtons(editor)
+ },
+ Toolbar.createToolbars(editor, getToolbarSize(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">- resizeHandleCtrl,
- brandingLabel
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Sidebar.hasSidebar(editor) ? editAreaContainer(editor) : editArea('1 0 0 0')
</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">- }
- $_5hpmustzjjgwefnb.fireBeforeRenderUI(editor);
- editor.on('SwitchMode', switchMode(panel));
- panel.renderBefore(args.targetNode).reflow();
- if (isReadOnly(editor)) {
- editor.setMode('readonly');
- }
- if (args.width) {
- DOM$2.setStyle(panel.getEl(), 'width', args.width);
- }
- editor.on('remove', function () {
- panel.remove();
- panel = null;
- });
- $_azwbz4u0jjgwefnc.addKeys(editor, panel);
- $_g1gegqu1jjgwefne.addContextualToolbars(editor);
- return {
- iframeContainer: panel.find('#iframe')[0].getEl(),
- editorContainer: panel.getEl()
- };
- };
- var $_vxdgetvjjgwefn7 = { render: render };
-
- var global$9 = tinymce.util.Tools.resolve('tinymce.dom.DomQuery');
-
- var count = 0;
- var funcs = {
- id: function () {
- return 'mceu_' + count++;
- },
- create: function (name$$1, attrs, children) {
- var elm = document.createElement(name$$1);
- global$3.DOM.setAttribs(elm, attrs);
- if (typeof children === 'string') {
- elm.innerHTML = children;
- } else {
- global$2.each(children, function (child) {
- if (child.nodeType) {
- elm.appendChild(child);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ UiContainer.setUiContainer(editor, panel);
+ if (getResize(editor) !== 'none') {
+ resizeHandleCtrl = {
+ type: 'resizehandle',
+ direction: getResize(editor),
+ onResizeStart: function () {
+ var elm = editor.getContentAreaContainer().firstChild;
+ startSize = {
+ width: elm.clientWidth,
+ height: elm.clientHeight
+ };
+ },
+ onResize: function (e) {
+ if (getResize(editor) === 'both') {
+ Resize.resizeTo(editor, startSize.width + e.deltaX, startSize.height + e.deltaY);
+ } else {
+ Resize.resizeTo(editor, null, startSize.height + e.deltaY);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ }
+ if (hasStatusbar(editor)) {
+ var linkHtml = '<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce" rel="noopener" target="_blank" role="presentation" tabindex="-1">Tiny</a>';
+ var html = global$5.translate([
+ 'Powered by {0}',
+ linkHtml
+ ]);
+ var brandingLabel = isBrandingEnabled(editor) ? {
+ type: 'label',
+ classes: 'branding',
+ html: ' ' + html
+ } : null;
+ panel.add({
+ type: 'panel',
+ name: 'statusbar',
+ classes: 'statusbar',
+ layout: 'flow',
+ border: '1 0 0 0',
+ ariaRoot: true,
+ items: [
+ {
+ type: 'elementpath',
+ editor: editor
+ },
+ resizeHandleCtrl,
+ brandingLabel
+ ]
</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">- return elm;
- },
- createFragment: function (html) {
- return global$3.DOM.createFragment(html);
- },
- getWindowSize: function () {
- return global$3.DOM.getViewPort();
- },
- getSize: function (elm) {
- var width, height;
- if (elm.getBoundingClientRect) {
- var rect = elm.getBoundingClientRect();
- width = Math.max(rect.width || rect.right - rect.left, elm.offsetWidth);
- height = Math.max(rect.height || rect.bottom - rect.bottom, elm.offsetHeight);
- } else {
- width = elm.offsetWidth;
- height = elm.offsetHeight;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Events.fireBeforeRenderUI(editor);
+ editor.on('SwitchMode', switchMode(panel));
+ panel.renderBefore(args.targetNode).reflow();
+ if (isReadOnly(editor)) {
+ editor.setMode('readonly');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (args.width) {
+ DOM$2.setStyle(panel.getEl(), 'width', args.width);
+ }
+ editor.on('remove', function () {
+ panel.remove();
+ panel = null;
+ });
+ A11y.addKeys(editor, panel);
+ ContextToolbars.addContextualToolbars(editor);
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- width: width,
- height: height
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ iframeContainer: panel.find('#iframe')[0].getEl(),
+ editorContainer: panel.getEl()
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- },
- getPos: function (elm, root) {
- return global$3.DOM.getPos(elm, root || funcs.getContainer());
- },
- getContainer: function () {
- return global$8.container ? global$8.container : document.body;
- },
- getViewPort: function (win) {
- return global$3.DOM.getViewPort(win);
- },
- get: function (id) {
- return document.getElementById(id);
- },
- addClass: function (elm, cls) {
- return global$3.DOM.addClass(elm, cls);
- },
- removeClass: function (elm, cls) {
- return global$3.DOM.removeClass(elm, cls);
- },
- hasClass: function (elm, cls) {
- return global$3.DOM.hasClass(elm, cls);
- },
- toggleClass: function (elm, cls, state) {
- return global$3.DOM.toggleClass(elm, cls, state);
- },
- css: function (elm, name$$1, value) {
- return global$3.DOM.setStyle(elm, name$$1, value);
- },
- getRuntimeStyle: function (elm, name$$1) {
- return global$3.DOM.getStyle(elm, name$$1, true);
- },
- on: function (target, name$$1, callback, scope) {
- return global$3.DOM.bind(target, name$$1, callback, scope);
- },
- off: function (target, name$$1, callback) {
- return global$3.DOM.unbind(target, name$$1, callback);
- },
- fire: function (target, name$$1, args) {
- return global$3.DOM.fire(target, name$$1, args);
- },
- innerHtml: function (elm, html) {
- global$3.DOM.setHTML(elm, html);
- }
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var Iframe = { render: render };
</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 isStatic = function (elm) {
- return funcs.getRuntimeStyle(elm, 'position') === 'static';
- };
- var isFixed = function (ctrl) {
- return ctrl.state.get('fixed');
- };
- function calculateRelativePosition(ctrl, targetElm, rel) {
- var ctrlElm, pos, x, y, selfW, selfH, targetW, targetH, viewport, size;
- viewport = getWindowViewPort();
- pos = funcs.getPos(targetElm, $_6344qfu4jjgwefnr.getUiContainer(ctrl));
- x = pos.x;
- y = pos.y;
- if (isFixed(ctrl) && isStatic(document.body)) {
- x -= viewport.x;
- y -= viewport.y;
- }
- ctrlElm = ctrl.getEl();
- size = funcs.getSize(ctrlElm);
- selfW = size.width;
- selfH = size.height;
- size = funcs.getSize(targetElm);
- targetW = size.width;
- targetH = size.height;
- rel = (rel || '').split('');
- if (rel[0] === 'b') {
- y += targetH;
- }
- if (rel[1] === 'r') {
- x += targetW;
- }
- if (rel[0] === 'c') {
- y += Math.round(targetH / 2);
- }
- if (rel[1] === 'c') {
- x += Math.round(targetW / 2);
- }
- if (rel[3] === 'b') {
- y -= selfH;
- }
- if (rel[4] === 'r') {
- x -= selfW;
- }
- if (rel[3] === 'c') {
- y -= Math.round(selfH / 2);
- }
- if (rel[4] === 'c') {
- x -= Math.round(selfW / 2);
- }
- return {
- x: x,
- y: y,
- w: selfW,
- h: selfH
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$9 = tinymce.util.Tools.resolve('tinymce.dom.DomQuery');
+
+ var count = 0;
+ var funcs = {
+ id: function () {
+ return 'mceu_' + count++;
+ },
+ create: function (name$$1, attrs, children) {
+ var elm = document.createElement(name$$1);
+ global$3.DOM.setAttribs(elm, attrs);
+ if (typeof children === 'string') {
+ elm.innerHTML = children;
+ } else {
+ global$2.each(children, function (child) {
+ if (child.nodeType) {
+ elm.appendChild(child);
+ }
+ });
+ }
+ return elm;
+ },
+ createFragment: function (html) {
+ return global$3.DOM.createFragment(html);
+ },
+ getWindowSize: function () {
+ return global$3.DOM.getViewPort();
+ },
+ getSize: function (elm) {
+ var width, height;
+ if (elm.getBoundingClientRect) {
+ var rect = elm.getBoundingClientRect();
+ width = Math.max(rect.width || rect.right - rect.left, elm.offsetWidth);
+ height = Math.max(rect.height || rect.bottom - rect.bottom, elm.offsetHeight);
+ } else {
+ width = elm.offsetWidth;
+ height = elm.offsetHeight;
+ }
+ return {
+ width: width,
+ height: height
+ };
+ },
+ getPos: function (elm, root) {
+ return global$3.DOM.getPos(elm, root || funcs.getContainer());
+ },
+ getContainer: function () {
+ return global$8.container ? global$8.container : document.body;
+ },
+ getViewPort: function (win) {
+ return global$3.DOM.getViewPort(win);
+ },
+ get: function (id) {
+ return document.getElementById(id);
+ },
+ addClass: function (elm, cls) {
+ return global$3.DOM.addClass(elm, cls);
+ },
+ removeClass: function (elm, cls) {
+ return global$3.DOM.removeClass(elm, cls);
+ },
+ hasClass: function (elm, cls) {
+ return global$3.DOM.hasClass(elm, cls);
+ },
+ toggleClass: function (elm, cls, state) {
+ return global$3.DOM.toggleClass(elm, cls, state);
+ },
+ css: function (elm, name$$1, value) {
+ return global$3.DOM.setStyle(elm, name$$1, value);
+ },
+ getRuntimeStyle: function (elm, name$$1) {
+ return global$3.DOM.getStyle(elm, name$$1, true);
+ },
+ on: function (target, name$$1, callback, scope) {
+ return global$3.DOM.bind(target, name$$1, callback, scope);
+ },
+ off: function (target, name$$1, callback) {
+ return global$3.DOM.unbind(target, name$$1, callback);
+ },
+ fire: function (target, name$$1, args) {
+ return global$3.DOM.fire(target, name$$1, args);
+ },
+ innerHtml: function (elm, html) {
+ global$3.DOM.setHTML(elm, html);
+ }
</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 getUiContainerViewPort = function (customUiContainer) {
- return {
- x: 0,
- y: 0,
- w: customUiContainer.scrollWidth - 1,
- h: customUiContainer.scrollHeight - 1
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var isStatic = function (elm) {
+ return funcs.getRuntimeStyle(elm, 'position') === 'static';
</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 getWindowViewPort = function () {
- var win = window;
- var x = Math.max(win.pageXOffset, document.body.scrollLeft, document.documentElement.scrollLeft);
- var y = Math.max(win.pageYOffset, document.body.scrollTop, document.documentElement.scrollTop);
- var w = win.innerWidth || document.documentElement.clientWidth;
- var h = win.innerHeight || document.documentElement.clientHeight;
- return {
- x: x,
- y: y,
- w: x + w,
- h: y + h
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isFixed = function (ctrl) {
+ return ctrl.state.get('fixed');
</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 getViewPortRect = function (ctrl) {
- var customUiContainer = $_6344qfu4jjgwefnr.getUiContainer(ctrl);
- return customUiContainer && !isFixed(ctrl) ? getUiContainerViewPort(customUiContainer) : getWindowViewPort();
- };
- var $_3fnh5iukjjgwefpt = {
- testMoveRel: function (elm, rels) {
- var viewPortRect = getViewPortRect(this);
- for (var i = 0; i < rels.length; i++) {
- var pos = calculateRelativePosition(this, elm, rels[i]);
- if (isFixed(this)) {
- if (pos.x > 0 && pos.x + pos.w < viewPortRect.w && pos.y > 0 && pos.y + pos.h < viewPortRect.h) {
- return rels[i];
- }
- } else {
- if (pos.x > viewPortRect.x && pos.x + pos.w < viewPortRect.w && pos.y > viewPortRect.y && pos.y + pos.h < viewPortRect.h) {
- return rels[i];
- }
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function calculateRelativePosition(ctrl, targetElm, rel) {
+ var ctrlElm, pos, x, y, selfW, selfH, targetW, targetH, viewport, size;
+ viewport = getWindowViewPort();
+ pos = funcs.getPos(targetElm, UiContainer.getUiContainer(ctrl));
+ x = pos.x;
+ y = pos.y;
+ if (isFixed(ctrl) && isStatic(document.body)) {
+ x -= viewport.x;
+ y -= viewport.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">- return rels[0];
- },
- moveRel: function (elm, rel) {
- if (typeof rel !== 'string') {
- rel = this.testMoveRel(elm, rel);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ctrlElm = ctrl.getEl();
+ size = funcs.getSize(ctrlElm);
+ selfW = size.width;
+ selfH = size.height;
+ size = funcs.getSize(targetElm);
+ targetW = size.width;
+ targetH = size.height;
+ rel = (rel || '').split('');
+ if (rel[0] === 'b') {
+ y += targetH;
</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 pos = calculateRelativePosition(this, elm, rel);
- return this.moveTo(pos.x, pos.y);
- },
- moveBy: function (dx, dy) {
- var self$$1 = this, rect = self$$1.layoutRect();
- self$$1.moveTo(rect.x + dx, rect.y + dy);
- return self$$1;
- },
- moveTo: function (x, y) {
- var self$$1 = this;
- function constrain(value, max, size) {
- if (value < 0) {
- return 0;
- }
- if (value + size > max) {
- value = max - size;
- return value < 0 ? 0 : value;
- }
- return value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rel[1] === 'r') {
+ x += targetW;
</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 (self$$1.settings.constrainToViewport) {
- var viewPortRect = getViewPortRect(this);
- var layoutRect = self$$1.layoutRect();
- x = constrain(x, viewPortRect.w, layoutRect.w);
- y = constrain(y, viewPortRect.h, layoutRect.h);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rel[0] === 'c') {
+ y += Math.round(targetH / 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">- var uiContainer = $_6344qfu4jjgwefnr.getUiContainer(self$$1);
- if (uiContainer && isStatic(uiContainer) && !isFixed(self$$1)) {
- x -= uiContainer.scrollLeft;
- y -= uiContainer.scrollTop;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rel[1] === 'c') {
+ x += Math.round(targetW / 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">- if (uiContainer) {
- x += 1;
- y += 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rel[3] === 'b') {
+ y -= selfH;
</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 (self$$1.state.get('rendered')) {
- self$$1.layoutRect({
- x: x,
- y: y
- }).repaint();
- } else {
- self$$1.settings.x = x;
- self$$1.settings.y = y;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rel[4] === 'r') {
+ x -= selfW;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.fire('move', {
- x: x,
- y: y
- });
- return self$$1;
- }
- };
-
- var global$10 = tinymce.util.Tools.resolve('tinymce.util.Class');
-
- var global$11 = tinymce.util.Tools.resolve('tinymce.util.EventDispatcher');
-
- var $_fbr241uqjjgwefqo = {
- parseBox: function (value) {
- var len;
- var radix = 10;
- if (!value) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rel[3] === 'c') {
+ y -= Math.round(selfH / 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">- if (typeof value === 'number') {
- value = value || 0;
- return {
- top: value,
- left: value,
- bottom: value,
- right: value
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rel[4] === 'c') {
+ x -= Math.round(selfW / 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">- value = value.split(' ');
- len = value.length;
- if (len === 1) {
- value[1] = value[2] = value[3] = value[0];
- } else if (len === 2) {
- value[2] = value[0];
- value[3] = value[1];
- } else if (len === 3) {
- value[3] = value[1];
- }
</del><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- top: parseInt(value[0], radix) || 0,
- right: parseInt(value[1], radix) || 0,
- bottom: parseInt(value[2], radix) || 0,
- left: parseInt(value[3], radix) || 0
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ x: x,
+ y: y,
+ w: selfW,
+ h: selfH
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- },
- measureBox: function (elm, prefix) {
- function getStyle(name) {
- var defaultView = elm.ownerDocument.defaultView;
- if (defaultView) {
- var computedStyle = defaultView.getComputedStyle(elm, null);
- if (computedStyle) {
- name = name.replace(/[A-Z]/g, function (a) {
- return '-' + a;
- });
- return computedStyle.getPropertyValue(name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ var getUiContainerViewPort = function (customUiContainer) {
+ return {
+ x: 0,
+ y: 0,
+ w: customUiContainer.scrollWidth - 1,
+ h: customUiContainer.scrollHeight - 1
+ };
+ };
+ var getWindowViewPort = function () {
+ var win = window;
+ var x = Math.max(win.pageXOffset, document.body.scrollLeft, document.documentElement.scrollLeft);
+ var y = Math.max(win.pageYOffset, document.body.scrollTop, document.documentElement.scrollTop);
+ var w = win.innerWidth || document.documentElement.clientWidth;
+ var h = win.innerHeight || document.documentElement.clientHeight;
+ return {
+ x: x,
+ y: y,
+ w: w,
+ h: h
+ };
+ };
+ var getViewPortRect = function (ctrl) {
+ var customUiContainer = UiContainer.getUiContainer(ctrl);
+ return customUiContainer && !isFixed(ctrl) ? getUiContainerViewPort(customUiContainer) : getWindowViewPort();
+ };
+ var Movable = {
+ testMoveRel: function (elm, rels) {
+ var viewPortRect = getViewPortRect(this);
+ for (var i = 0; i < rels.length; i++) {
+ var pos = calculateRelativePosition(this, elm, rels[i]);
+ if (isFixed(this)) {
+ if (pos.x > 0 && pos.x + pos.w < viewPortRect.w && pos.y > 0 && pos.y + pos.h < viewPortRect.h) {
+ return rels[i];
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (pos.x > viewPortRect.x && pos.x + pos.w < viewPortRect.w + viewPortRect.x && pos.y > viewPortRect.y && pos.y + pos.h < viewPortRect.h + viewPortRect.y) {
+ return rels[i];
+ }
</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">- return elm.currentStyle[name];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return rels[0];
+ },
+ moveRel: function (elm, rel) {
+ if (typeof rel !== 'string') {
+ rel = this.testMoveRel(elm, rel);
+ }
+ var pos = calculateRelativePosition(this, elm, rel);
+ return this.moveTo(pos.x, pos.y);
+ },
+ moveBy: function (dx, dy) {
+ var self$$1 = this, rect = self$$1.layoutRect();
+ self$$1.moveTo(rect.x + dx, rect.y + dy);
+ return self$$1;
+ },
+ moveTo: function (x, y) {
+ var self$$1 = this;
+ function constrain(value, max, size) {
+ if (value < 0) {
+ return 0;
+ }
+ if (value + size > max) {
+ value = max - size;
+ return value < 0 ? 0 : value;
+ }
+ return value;
+ }
+ if (self$$1.settings.constrainToViewport) {
+ var viewPortRect = getViewPortRect(this);
+ var layoutRect = self$$1.layoutRect();
+ x = constrain(x, viewPortRect.w + viewPortRect.x, layoutRect.w);
+ y = constrain(y, viewPortRect.h + viewPortRect.y, layoutRect.h);
+ }
+ var uiContainer = UiContainer.getUiContainer(self$$1);
+ if (uiContainer && isStatic(uiContainer) && !isFixed(self$$1)) {
+ x -= uiContainer.scrollLeft;
+ y -= uiContainer.scrollTop;
+ }
+ if (uiContainer) {
+ x += 1;
+ y += 1;
+ }
+ if (self$$1.state.get('rendered')) {
+ self$$1.layoutRect({
+ x: x,
+ y: y
+ }).repaint();
+ } else {
+ self$$1.settings.x = x;
+ self$$1.settings.y = y;
+ }
+ self$$1.fire('move', {
+ x: x,
+ y: y
+ });
+ return self$$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">- function getSide(name) {
- var val = parseFloat(getStyle(name));
- return isNaN(val) ? 0 : val;
- }
- return {
- top: getSide(prefix + 'TopWidth'),
- right: getSide(prefix + 'RightWidth'),
- bottom: getSide(prefix + 'BottomWidth'),
- left: getSide(prefix + 'LeftWidth')
- };
- }
- };
</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">- function noop$1() {
- }
- function ClassList(onchange) {
- this.cls = [];
- this.cls._map = {};
- this.onchange = onchange || noop$1;
- this.prefix = '';
- }
- global$2.extend(ClassList.prototype, {
- add: function (cls) {
- if (cls && !this.contains(cls)) {
- this.cls._map[cls] = true;
- this.cls.push(cls);
- this._change();
- }
- return this;
- },
- remove: function (cls) {
- if (this.contains(cls)) {
- var i = void 0;
- for (i = 0; i < this.cls.length; i++) {
- if (this.cls[i] === cls) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$a = tinymce.util.Tools.resolve('tinymce.util.Class');
+
+ var global$b = tinymce.util.Tools.resolve('tinymce.util.EventDispatcher');
+
+ var BoxUtils = {
+ parseBox: function (value) {
+ var len;
+ var radix = 10;
+ if (!value) {
+ return;
+ }
+ if (typeof value === 'number') {
+ value = value || 0;
+ return {
+ top: value,
+ left: value,
+ bottom: value,
+ right: value
+ };
+ }
+ value = value.split(' ');
+ len = value.length;
+ if (len === 1) {
+ value[1] = value[2] = value[3] = value[0];
+ } else if (len === 2) {
+ value[2] = value[0];
+ value[3] = value[1];
+ } else if (len === 3) {
+ value[3] = value[1];
+ }
+ return {
+ top: parseInt(value[0], radix) || 0,
+ right: parseInt(value[1], radix) || 0,
+ bottom: parseInt(value[2], radix) || 0,
+ left: parseInt(value[3], radix) || 0
+ };
+ },
+ measureBox: function (elm, prefix) {
+ function getStyle(name) {
+ var defaultView = elm.ownerDocument.defaultView;
+ if (defaultView) {
+ var computedStyle = defaultView.getComputedStyle(elm, null);
+ if (computedStyle) {
+ name = name.replace(/[A-Z]/g, function (a) {
+ return '-' + a;
+ });
+ return computedStyle.getPropertyValue(name);
+ } else {
+ return null;
+ }
</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 elm.currentStyle[name];
</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.cls.splice(i, 1);
- delete this.cls._map[cls];
- this._change();
- }
- return this;
- },
- toggle: function (cls, state) {
- var curState = this.contains(cls);
- if (curState !== state) {
- if (curState) {
- this.remove(cls);
- } else {
- this.add(cls);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function getSide(name) {
+ var val = parseFloat(getStyle(name));
+ return isNaN(val) ? 0 : val;
</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._change();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return {
+ top: getSide(prefix + 'TopWidth'),
+ right: getSide(prefix + 'RightWidth'),
+ bottom: getSide(prefix + 'BottomWidth'),
+ left: getSide(prefix + 'LeftWidth')
+ };
</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 this;
- },
- contains: function (cls) {
- return !!this.cls._map[cls];
- },
- _change: function () {
- delete this.clsValue;
- this.onchange.call(this);
- }
- });
- ClassList.prototype.toString = function () {
- var value;
- if (this.clsValue) {
- return this.clsValue;
- }
- value = '';
- for (var i = 0; i < this.cls.length; i++) {
- if (i > 0) {
- value += ' ';
- }
- value += this.prefix + this.cls[i];
- }
- return value;
- };
</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">- function unique(array) {
- var uniqueItems = [];
- var i = array.length, item;
- while (i--) {
- item = array[i];
- if (!item.__checked) {
- uniqueItems.push(item);
- item.__checked = 1;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function noop$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">- i = uniqueItems.length;
- while (i--) {
- delete uniqueItems[i].__checked;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function ClassList(onchange) {
+ this.cls = [];
+ this.cls._map = {};
+ this.onchange = onchange || noop$1;
+ this.prefix = '';
</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 uniqueItems;
- }
- var expression = /^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i;
- var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g;
- var whiteSpace = /^\s*|\s*$/g;
- var Collection;
- var Selector = global$10.extend({
- init: function (selector) {
- var match = this.match;
- function compileNameFilter(name) {
- if (name) {
- name = name.toLowerCase();
- return function (item) {
- return name === '*' || item.type === name;
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global$2.extend(ClassList.prototype, {
+ add: function (cls) {
+ if (cls && !this.contains(cls)) {
+ this.cls._map[cls] = true;
+ this.cls.push(cls);
+ this._change();
</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 compileIdFilter(id) {
- if (id) {
- return function (item) {
- return item._name === id;
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this;
+ },
+ remove: function (cls) {
+ if (this.contains(cls)) {
+ var i = void 0;
+ for (i = 0; i < this.cls.length; i++) {
+ if (this.cls[i] === cls) {
+ break;
+ }
+ }
+ this.cls.splice(i, 1);
+ delete this.cls._map[cls];
+ this._change();
</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 this;
+ },
+ toggle: function (cls, state) {
+ var curState = this.contains(cls);
+ if (curState !== state) {
+ if (curState) {
+ this.remove(cls);
+ } else {
+ this.add(cls);
+ }
+ this._change();
+ }
+ return this;
+ },
+ contains: function (cls) {
+ return !!this.cls._map[cls];
+ },
+ _change: function () {
+ delete this.clsValue;
+ this.onchange.call(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">- function compileClassesFilter(classes) {
- if (classes) {
- classes = classes.split('.');
- return function (item) {
- var i = classes.length;
- while (i--) {
- if (!item.classes.contains(classes[i])) {
- return false;
- }
- }
- return true;
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ ClassList.prototype.toString = function () {
+ var value;
+ if (this.clsValue) {
+ return this.clsValue;
+ }
+ value = '';
+ for (var i = 0; i < this.cls.length; i++) {
+ if (i > 0) {
+ value += ' ';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ value += this.prefix + this.cls[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">- function compileAttrFilter(name, cmp, check) {
- if (name) {
- return function (item) {
- var value = item[name] ? item[name]() : '';
- return !cmp ? !!check : cmp === '=' ? value === check : cmp === '*=' ? value.indexOf(check) >= 0 : cmp === '~=' ? (' ' + value + ' ').indexOf(' ' + check + ' ') >= 0 : cmp === '!=' ? value !== check : cmp === '^=' ? value.indexOf(check) === 0 : cmp === '$=' ? value.substr(value.length - check.length) === check : false;
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return value;
+ };
+
+ function unique(array) {
+ var uniqueItems = [];
+ var i = array.length, item;
+ while (i--) {
+ item = array[i];
+ if (!item.__checked) {
+ uniqueItems.push(item);
+ item.__checked = 1;
</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">- function compilePsuedoFilter(name) {
- var notSelectors;
- if (name) {
- name = /(?:not\((.+)\))|(.+)/i.exec(name);
- if (!name[1]) {
- name = name[2];
- return function (item, index, length) {
- return name === 'first' ? index === 0 : name === 'last' ? index === length - 1 : name === 'even' ? index % 2 === 0 : name === 'odd' ? index % 2 === 1 : item[name] ? item[name]() : false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ i = uniqueItems.length;
+ while (i--) {
+ delete uniqueItems[i].__checked;
+ }
+ return uniqueItems;
+ }
+ var expression = /^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i;
+ var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g;
+ var whiteSpace = /^\s*|\s*$/g;
+ var Collection;
+ var Selector = global$a.extend({
+ init: function (selector) {
+ var match = this.match;
+ function compileNameFilter(name) {
+ if (name) {
+ name = name.toLowerCase();
+ return function (item) {
+ return name === '*' || item.type === name;
</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">- notSelectors = parseChunks(name[1], []);
- return function (item) {
- return !match(item, notSelectors);
- };
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- function compile(selector, filters, direct) {
- var parts;
- function add(filter) {
- if (filter) {
- filters.push(filter);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function compileIdFilter(id) {
+ if (id) {
+ return function (item) {
+ return item._name === id;
+ };
</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">- parts = expression.exec(selector.replace(whiteSpace, ''));
- add(compileNameFilter(parts[1]));
- add(compileIdFilter(parts[2]));
- add(compileClassesFilter(parts[3]));
- add(compileAttrFilter(parts[4], parts[5], parts[6]));
- add(compilePsuedoFilter(parts[7]));
- filters.pseudo = !!parts[7];
- filters.direct = direct;
- return filters;
- }
- function parseChunks(selector, selectors) {
- var parts = [];
- var extra, matches, i;
- do {
- chunker.exec('');
- matches = chunker.exec(selector);
- if (matches) {
- selector = matches[3];
- parts.push(matches[1]);
- if (matches[2]) {
- extra = matches[3];
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function compileClassesFilter(classes) {
+ if (classes) {
+ classes = classes.split('.');
+ return function (item) {
+ var i = classes.length;
+ while (i--) {
+ if (!item.classes.contains(classes[i])) {
+ return false;
+ }
+ }
+ return true;
+ };
+ }
+ }
+ function compileAttrFilter(name, cmp, check) {
+ if (name) {
+ return function (item) {
+ var value = item[name] ? item[name]() : '';
+ return !cmp ? !!check : cmp === '=' ? value === check : cmp === '*=' ? value.indexOf(check) >= 0 : cmp === '~=' ? (' ' + value + ' ').indexOf(' ' + check + ' ') >= 0 : cmp === '!=' ? value !== check : cmp === '^=' ? value.indexOf(check) === 0 : cmp === '$=' ? value.substr(value.length - check.length) === check : false;
+ };
+ }
+ }
+ function compilePsuedoFilter(name) {
+ var notSelectors;
+ if (name) {
+ name = /(?:not\((.+)\))|(.+)/i.exec(name);
+ if (!name[1]) {
+ name = name[2];
+ return function (item, index, length) {
+ return name === 'first' ? index === 0 : name === 'last' ? index === length - 1 : name === 'even' ? index % 2 === 0 : name === 'odd' ? index % 2 === 1 : item[name] ? item[name]() : false;
+ };
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ notSelectors = parseChunks(name[1], []);
+ return function (item) {
+ return !match(item, notSelectors);
+ };
</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 (matches);
- if (extra) {
- parseChunks(extra, selectors);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- selector = [];
- for (i = 0; i < parts.length; i++) {
- if (parts[i] !== '>') {
- selector.push(compile(parts[i], [], parts[i - 1] === '>'));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function compile(selector, filters, direct) {
+ var parts;
+ function add(filter) {
+ if (filter) {
+ filters.push(filter);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parts = expression.exec(selector.replace(whiteSpace, ''));
+ add(compileNameFilter(parts[1]));
+ add(compileIdFilter(parts[2]));
+ add(compileClassesFilter(parts[3]));
+ add(compileAttrFilter(parts[4], parts[5], parts[6]));
+ add(compilePsuedoFilter(parts[7]));
+ filters.pseudo = !!parts[7];
+ filters.direct = direct;
+ return filters;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- selectors.push(selector);
- return selectors;
- }
- this._selectors = parseChunks(selector, []);
- },
- match: function (control, selectors) {
- var i, l, si, sl, selector, fi, fl, filters, index, length, siblings, count, item;
- selectors = selectors || this._selectors;
- for (i = 0, l = selectors.length; i < l; i++) {
- selector = selectors[i];
- sl = selector.length;
- item = control;
- count = 0;
- for (si = sl - 1; si >= 0; si--) {
- filters = selector[si];
- while (item) {
- if (filters.pseudo) {
- siblings = item.parent().items();
- index = length = siblings.length;
- while (index--) {
- if (siblings[index] === item) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function parseChunks(selector, selectors) {
+ var parts = [];
+ var extra, matches, i;
+ do {
+ chunker.exec('');
+ matches = chunker.exec(selector);
+ if (matches) {
+ selector = matches[3];
+ parts.push(matches[1]);
+ if (matches[2]) {
+ extra = matches[3];
+ break;
+ }
+ }
+ } while (matches);
+ if (extra) {
+ parseChunks(extra, selectors);
+ }
+ selector = [];
+ for (i = 0; i < parts.length; i++) {
+ if (parts[i] !== '>') {
+ selector.push(compile(parts[i], [], parts[i - 1] === '>'));
+ }
+ }
+ selectors.push(selector);
+ return selectors;
+ }
+ this._selectors = parseChunks(selector, []);
+ },
+ match: function (control, selectors) {
+ var i, l, si, sl, selector, fi, fl, filters, index, length, siblings, count, item;
+ selectors = selectors || this._selectors;
+ for (i = 0, l = selectors.length; i < l; i++) {
+ selector = selectors[i];
+ sl = selector.length;
+ item = control;
+ count = 0;
+ for (si = sl - 1; si >= 0; si--) {
+ filters = selector[si];
+ while (item) {
+ if (filters.pseudo) {
+ siblings = item.parent().items();
+ index = length = siblings.length;
+ while (index--) {
+ if (siblings[index] === item) {
+ break;
+ }
+ }
+ }
+ for (fi = 0, fl = filters.length; fi < fl; fi++) {
+ if (!filters[fi](item, index, length)) {
+ fi = fl + 1;
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (fi === fl) {
+ count++;
+ break;
+ } else {
+ if (si === sl - 1) {
+ break;
+ }
+ }
+ item = item.parent();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (count === sl) {
+ return true;
+ }
+ }
+ return false;
+ },
+ find: function (container) {
+ var matches = [], i, l;
+ var selectors = this._selectors;
+ function collect(items, selector, index) {
+ var i, l, fi, fl, item;
+ var filters = selector[index];
+ for (i = 0, l = items.length; i < l; i++) {
+ item = items[i];
</ins><span class="cx" style="display: block; padding: 0 10px"> for (fi = 0, fl = filters.length; fi < fl; fi++) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (!filters[fi](item, index, length)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!filters[fi](item, i, l)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> fi = fl + 1;
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</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"> if (fi === fl) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- count++;
- break;
- } else {
- if (si === sl - 1) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (index === selector.length - 1) {
+ matches.push(item);
+ } else {
+ if (item.items) {
+ collect(item.items(), selector, index + 1);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if (filters.direct) {
+ 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">- item = item.parent();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (item.items) {
+ collect(item.items(), selector, index);
+ }
</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">- if (count === sl) {
- return true;
- }
- }
- return false;
- },
- find: function (container) {
- var matches = [], i, l;
- var selectors = this._selectors;
- function collect(items, selector, index) {
- var i, l, fi, fl, item;
- var filters = selector[index];
- for (i = 0, l = items.length; i < l; i++) {
- item = items[i];
- for (fi = 0, fl = filters.length; fi < fl; fi++) {
- if (!filters[fi](item, i, l)) {
- fi = fl + 1;
- break;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (container.items) {
+ for (i = 0, l = selectors.length; i < l; i++) {
+ collect(container.items(), selectors[i], 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">- if (fi === fl) {
- if (index === selector.length - 1) {
- matches.push(item);
- } else {
- if (item.items) {
- collect(item.items(), selector, index + 1);
- }
- }
- } else if (filters.direct) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (l > 1) {
+ matches = unique(matches);
</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.items) {
- collect(item.items(), selector, index);
- }
</del><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.items) {
- for (i = 0, l = selectors.length; i < l; i++) {
- collect(container.items(), selectors[i], 0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!Collection) {
+ Collection = Selector.Collection;
</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 (l > 1) {
- matches = unique(matches);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new Collection(matches);
</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 (!Collection) {
- Collection = Selector.Collection;
- }
- return new Collection(matches);
- }
- });
</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">- var Collection$1;
- var proto;
- var push$1 = Array.prototype.push;
- var slice$1 = Array.prototype.slice;
- proto = {
- length: 0,
- init: function (items) {
- if (items) {
- this.add(items);
- }
- },
- add: function (items) {
- var self = this;
- if (!global$2.isArray(items)) {
- if (items instanceof Collection$1) {
- self.add(items.toArray());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Collection$1, proto;
+ var push$1 = Array.prototype.push, slice$1 = Array.prototype.slice;
+ proto = {
+ length: 0,
+ init: function (items) {
+ if (items) {
+ this.add(items);
+ }
+ },
+ add: function (items) {
+ var self = this;
+ if (!global$2.isArray(items)) {
+ if (items instanceof Collection$1) {
+ self.add(items.toArray());
+ } else {
+ push$1.call(self, items);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- push$1.call(self, items);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ push$1.apply(self, items);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- push$1.apply(self, items);
- }
- return self;
- },
- set: function (items) {
- var self = this;
- var len = self.length;
- var i;
- self.length = 0;
- self.add(items);
- for (i = self.length; i < len; i++) {
- delete self[i];
- }
- return self;
- },
- filter: function (selector) {
- var self = this;
- var i, l;
- var matches = [];
- var item, match;
- if (typeof selector === 'string') {
- selector = new Selector(selector);
- match = function (item) {
- return selector.match(item);
- };
- } else {
- match = selector;
- }
- for (i = 0, l = self.length; i < l; i++) {
- item = self[i];
- if (match(item)) {
- matches.push(item);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self;
+ },
+ set: function (items) {
+ var self = this;
+ var len = self.length;
+ var i;
+ self.length = 0;
+ self.add(items);
+ for (i = self.length; i < len; i++) {
+ delete self[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">- }
- return new Collection$1(matches);
- },
- slice: function () {
- return new Collection$1(slice$1.apply(this, arguments));
- },
- eq: function (index) {
- return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
- },
- each: function (callback) {
- global$2.each(this, callback);
- return this;
- },
- toArray: function () {
- return global$2.toArray(this);
- },
- indexOf: function (ctrl) {
- var self = this;
- var i = self.length;
- while (i--) {
- if (self[i] === ctrl) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self;
+ },
+ filter: function (selector) {
+ var self = this;
+ var i, l;
+ var matches = [];
+ var item, match;
+ if (typeof selector === 'string') {
+ selector = new Selector(selector);
+ match = function (item) {
+ return selector.match(item);
+ };
+ } else {
+ match = 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">- }
- return i;
- },
- reverse: function () {
- return new Collection$1(global$2.toArray(this).reverse());
- },
- hasClass: function (cls) {
- return this[0] ? this[0].classes.contains(cls) : false;
- },
- prop: function (name, value) {
- var self = this;
- var item;
- if (value !== undefined) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (i = 0, l = self.length; i < l; i++) {
+ item = self[i];
+ if (match(item)) {
+ matches.push(item);
+ }
+ }
+ return new Collection$1(matches);
+ },
+ slice: function () {
+ return new Collection$1(slice$1.apply(this, arguments));
+ },
+ eq: function (index) {
+ return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
+ },
+ each: function (callback) {
+ global$2.each(this, callback);
+ return this;
+ },
+ toArray: function () {
+ return global$2.toArray(this);
+ },
+ indexOf: function (ctrl) {
+ var self = this;
+ var i = self.length;
+ while (i--) {
+ if (self[i] === ctrl) {
+ break;
+ }
+ }
+ return i;
+ },
+ reverse: function () {
+ return new Collection$1(global$2.toArray(this).reverse());
+ },
+ hasClass: function (cls) {
+ return this[0] ? this[0].classes.contains(cls) : false;
+ },
+ prop: function (name, value) {
+ var self = this;
+ var item;
+ if (value !== undefined) {
+ self.each(function (item) {
+ if (item[name]) {
+ item[name](value);
+ }
+ });
+ return self;
+ }
+ item = self[0];
+ if (item && item[name]) {
+ return item[name]();
+ }
+ },
+ exec: function (name) {
+ var self = this, args = global$2.toArray(arguments).slice(1);
</ins><span class="cx" style="display: block; padding: 0 10px"> self.each(function (item) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (item[name]) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- item[name](value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ item[name].apply(item, args);
</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"> return self;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- item = self[0];
- if (item && item[name]) {
- return item[name]();
- }
- },
- exec: function (name) {
- var self = this, args = global$2.toArray(arguments).slice(1);
- self.each(function (item) {
- if (item[name]) {
- item[name].apply(item, args);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ remove: function () {
+ var i = this.length;
+ while (i--) {
+ this[i].remove();
</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 self;
- },
- remove: function () {
- var i = this.length;
- while (i--) {
- this[i].remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this;
+ },
+ addClass: function (cls) {
+ return this.each(function (item) {
+ item.classes.add(cls);
+ });
+ },
+ removeClass: function (cls) {
+ return this.each(function (item) {
+ item.classes.remove(cls);
+ });
</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 this;
- },
- addClass: function (cls) {
- return this.each(function (item) {
- item.classes.add(cls);
- });
- },
- removeClass: function (cls) {
- return this.each(function (item) {
- item.classes.remove(cls);
- });
- }
- };
- global$2.each('fire on off show hide append prepend before after reflow'.split(' '), function (name) {
- proto[name] = function () {
- var args = global$2.toArray(arguments);
- this.each(function (ctrl) {
- if (name in ctrl) {
- ctrl[name].apply(ctrl, args);
- }
- });
- return this;
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- global$2.each('text name disabled active selected checked visible parent value data'.split(' '), function (name) {
- proto[name] = function (value) {
- return this.prop(name, value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global$2.each('fire on off show hide append prepend before after reflow'.split(' '), function (name) {
+ proto[name] = function () {
+ var args = global$2.toArray(arguments);
+ this.each(function (ctrl) {
+ if (name in ctrl) {
+ ctrl[name].apply(ctrl, args);
+ }
+ });
+ return this;
+ };
+ });
+ global$2.each('text name disabled active selected checked visible parent value data'.split(' '), function (name) {
+ proto[name] = function (value) {
+ return this.prop(name, value);
+ };
+ });
+ Collection$1 = global$a.extend(proto);
+ Selector.Collection = Collection$1;
+ var Collection$2 = Collection$1;
+
+ var Binding = function (settings) {
+ this.create = settings.create;
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- Collection$1 = global$10.extend(proto);
- Selector.Collection = Collection$1;
- var Collection$2 = Collection$1;
-
- var Binding = function (settings) {
- this.create = settings.create;
- };
- Binding.create = function (model, name) {
- return new Binding({
- create: function (otherModel, otherName) {
- var bindings;
- var fromSelfToOther = function (e) {
- otherModel.set(otherName, e.value);
- };
- var fromOtherToSelf = function (e) {
- model.set(name, e.value);
- };
- otherModel.on('change:' + otherName, fromOtherToSelf);
- model.on('change:' + name, fromSelfToOther);
- bindings = otherModel._bindings;
- if (!bindings) {
- bindings = otherModel._bindings = [];
- otherModel.on('destroy', function () {
- var i = bindings.length;
- while (i--) {
- bindings[i]();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Binding.create = function (model, name) {
+ return new Binding({
+ create: function (otherModel, otherName) {
+ var bindings;
+ var fromSelfToOther = function (e) {
+ otherModel.set(otherName, e.value);
+ };
+ var fromOtherToSelf = function (e) {
+ model.set(name, e.value);
+ };
+ otherModel.on('change:' + otherName, fromOtherToSelf);
+ model.on('change:' + name, fromSelfToOther);
+ bindings = otherModel._bindings;
+ if (!bindings) {
+ bindings = otherModel._bindings = [];
+ otherModel.on('destroy', function () {
+ var i = bindings.length;
+ while (i--) {
+ bindings[i]();
+ }
+ });
+ }
+ bindings.push(function () {
+ model.off('change:' + name, fromSelfToOther);
</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 model.get(name);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- bindings.push(function () {
- model.off('change:' + name, fromSelfToOther);
- });
- return model.get(name);
- }
- });
- };
</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">- var global$12 = tinymce.util.Tools.resolve('tinymce.util.Observable');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$c = tinymce.util.Tools.resolve('tinymce.util.Observable');
</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 isNode(node) {
- return node.nodeType > 0;
- }
- function isEqual(a, b) {
- var k, checked;
- if (a === b) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function isNode(node) {
+ return node.nodeType > 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">- if (a === null || b === null) {
- return a === b;
- }
- if (typeof a !== 'object' || typeof b !== 'object') {
- return a === b;
- }
- if (global$2.isArray(b)) {
- if (a.length !== b.length) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function isEqual(a, b) {
+ var k, checked;
+ if (a === b) {
+ 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">- k = a.length;
- while (k--) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (a === null || b === null) {
+ return a === b;
+ }
+ if (typeof a !== 'object' || typeof b !== 'object') {
+ return a === b;
+ }
+ if (global$2.isArray(b)) {
+ if (a.length !== b.length) {
+ return false;
+ }
+ k = a.length;
+ while (k--) {
+ if (!isEqual(a[k], b[k])) {
+ return false;
+ }
+ }
+ }
+ if (isNode(a) || isNode(b)) {
+ return a === b;
+ }
+ checked = {};
+ for (k in b) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (!isEqual(a[k], b[k])) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ checked[k] = 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 (isNode(a) || isNode(b)) {
- return a === b;
- }
- checked = {};
- for (k in b) {
- if (!isEqual(a[k], b[k])) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (k in a) {
+ if (!checked[k] && !isEqual(a[k], b[k])) {
+ 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">- checked[k] = true;
</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">- for (k in a) {
- if (!checked[k] && !isEqual(a[k], b[k])) {
- return false;
- }
- }
- return true;
- }
- var ObservableObject = global$10.extend({
- Mixins: [global$12],
- init: function (data) {
- var name, value;
- data = data || {};
- for (name in data) {
- value = data[name];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ObservableObject = global$a.extend({
+ Mixins: [global$c],
+ init: function (data) {
+ var name, value;
+ data = data || {};
+ for (name in data) {
+ value = data[name];
+ if (value instanceof Binding) {
+ data[name] = value.create(this, name);
+ }
+ }
+ this.data = data;
+ },
+ set: function (name, value) {
+ var key, args;
+ var oldValue = this.data[name];
</ins><span class="cx" style="display: block; padding: 0 10px"> if (value instanceof Binding) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- data[name] = value.create(this, name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ value = value.create(this, name);
</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.data = data;
- },
- set: function (name, value) {
- var key, args;
- var oldValue = this.data[name];
- if (value instanceof Binding) {
- value = value.create(this, name);
- }
- if (typeof name === 'object') {
- for (key in name) {
- this.set(key, name[key]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (typeof name === 'object') {
+ for (key in name) {
+ this.set(key, name[key]);
+ }
+ return this;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!isEqual(oldValue, value)) {
+ this.data[name] = value;
+ args = {
+ target: this,
+ name: name,
+ value: value,
+ oldValue: oldValue
+ };
+ this.fire('change:' + name, args);
+ this.fire('change', args);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return this;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ get: function (name) {
+ return this.data[name];
+ },
+ has: function (name) {
+ return name in this.data;
+ },
+ bind: function (name) {
+ return Binding.create(this, name);
+ },
+ destroy: function () {
+ this.fire('destroy');
</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 (!isEqual(oldValue, value)) {
- this.data[name] = value;
- args = {
- target: this,
- name: name,
- value: value,
- oldValue: oldValue
- };
- this.fire('change:' + name, args);
- this.fire('change', args);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var dirtyCtrls = {}, animationFrameRequested;
+ var ReflowQueue = {
+ add: function (ctrl) {
+ var parent$$1 = ctrl.parent();
+ if (parent$$1) {
+ if (!parent$$1._layout || parent$$1._layout.isNative()) {
+ return;
+ }
+ if (!dirtyCtrls[parent$$1._id]) {
+ dirtyCtrls[parent$$1._id] = parent$$1;
+ }
+ if (!animationFrameRequested) {
+ animationFrameRequested = true;
+ global$7.requestAnimationFrame(function () {
+ var id, ctrl;
+ animationFrameRequested = false;
+ for (id in dirtyCtrls) {
+ ctrl = dirtyCtrls[id];
+ if (ctrl.state.get('rendered')) {
+ ctrl.reflow();
+ }
+ }
+ dirtyCtrls = {};
+ }, document.body);
+ }
+ }
+ },
+ remove: function (ctrl) {
+ if (dirtyCtrls[ctrl._id]) {
+ delete dirtyCtrls[ctrl._id];
+ }
</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 this;
- },
- get: function (name) {
- return this.data[name];
- },
- has: function (name) {
- return name in this.data;
- },
- bind: function (name) {
- return Binding.create(this, name);
- },
- destroy: function () {
- this.fire('destroy');
- }
- });
</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">- var dirtyCtrls = {};
- var animationFrameRequested;
- var $_p42hyuxjjgwefrk = {
- add: function (ctrl) {
- var parent$$1 = ctrl.parent();
- if (parent$$1) {
- if (!parent$$1._layout || parent$$1._layout.isNative()) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasMouseWheelEventSupport = 'onmousewheel' in document;
+ var hasWheelEventSupport = false;
+ var classPrefix = 'mce-';
+ var Control, idCounter = 0;
+ var proto$1 = {
+ Statics: { classPrefix: classPrefix },
+ isRtl: function () {
+ return Control.rtl;
+ },
+ classPrefix: classPrefix,
+ init: function (settings) {
+ var self$$1 = this;
+ var classes, defaultClasses;
+ function applyClasses(classes) {
+ var i;
+ classes = classes.split(' ');
+ for (i = 0; i < classes.length; i++) {
+ self$$1.classes.add(classes[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 (!dirtyCtrls[parent$$1._id]) {
- dirtyCtrls[parent$$1._id] = parent$$1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.settings = settings = global$2.extend({}, self$$1.Defaults, settings);
+ self$$1._id = settings.id || 'mceu_' + idCounter++;
+ self$$1._aria = { role: settings.role };
+ self$$1._elmCache = {};
+ self$$1.$ = global$9;
+ self$$1.state = new ObservableObject({
+ visible: true,
+ active: false,
+ disabled: false,
+ value: ''
+ });
+ self$$1.data = new ObservableObject(settings.data);
+ self$$1.classes = new ClassList(function () {
+ if (self$$1.state.get('rendered')) {
+ self$$1.getEl().className = this.toString();
+ }
+ });
+ self$$1.classes.prefix = self$$1.classPrefix;
+ classes = settings.classes;
+ if (classes) {
+ if (self$$1.Defaults) {
+ defaultClasses = self$$1.Defaults.classes;
+ if (defaultClasses && classes !== defaultClasses) {
+ applyClasses(defaultClasses);
+ }
+ }
+ applyClasses(classes);
</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 (!animationFrameRequested) {
- animationFrameRequested = true;
- global$7.requestAnimationFrame(function () {
- var id, ctrl;
- animationFrameRequested = false;
- for (id in dirtyCtrls) {
- ctrl = dirtyCtrls[id];
- if (ctrl.state.get('rendered')) {
- ctrl.reflow();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global$2.each('title text name visible disabled active value'.split(' '), function (name$$1) {
+ if (name$$1 in settings) {
+ self$$1[name$$1](settings[name$$1]);
+ }
+ });
+ self$$1.on('click', function () {
+ if (self$$1.disabled()) {
+ return false;
+ }
+ });
+ self$$1.settings = settings;
+ self$$1.borderBox = BoxUtils.parseBox(settings.border);
+ self$$1.paddingBox = BoxUtils.parseBox(settings.padding);
+ self$$1.marginBox = BoxUtils.parseBox(settings.margin);
+ if (settings.hidden) {
+ self$$1.hide();
+ }
+ },
+ Properties: 'parent,name',
+ getContainerElm: function () {
+ var uiContainer = UiContainer.getUiContainer(this);
+ return uiContainer ? uiContainer : funcs.getContainer();
+ },
+ getParentCtrl: function (elm) {
+ var ctrl;
+ var lookup = this.getRoot().controlIdLookup;
+ while (elm && lookup) {
+ ctrl = lookup[elm.id];
+ if (ctrl) {
+ break;
+ }
+ elm = elm.parentNode;
+ }
+ return ctrl;
+ },
+ initLayoutRect: function () {
+ var self$$1 = this;
+ var settings = self$$1.settings;
+ var borderBox, layoutRect;
+ var elm = self$$1.getEl();
+ var width, height, minWidth, minHeight, autoResize;
+ var startMinWidth, startMinHeight, initialSize;
+ borderBox = self$$1.borderBox = self$$1.borderBox || BoxUtils.measureBox(elm, 'border');
+ self$$1.paddingBox = self$$1.paddingBox || BoxUtils.measureBox(elm, 'padding');
+ self$$1.marginBox = self$$1.marginBox || BoxUtils.measureBox(elm, 'margin');
+ initialSize = funcs.getSize(elm);
+ startMinWidth = settings.minWidth;
+ startMinHeight = settings.minHeight;
+ minWidth = startMinWidth || initialSize.width;
+ minHeight = startMinHeight || initialSize.height;
+ width = settings.width;
+ height = settings.height;
+ autoResize = settings.autoResize;
+ autoResize = typeof autoResize !== 'undefined' ? autoResize : !width && !height;
+ width = width || minWidth;
+ height = height || minHeight;
+ var deltaW = borderBox.left + borderBox.right;
+ var deltaH = borderBox.top + borderBox.bottom;
+ var maxW = settings.maxWidth || 65535;
+ var maxH = settings.maxHeight || 65535;
+ self$$1._layoutRect = layoutRect = {
+ x: settings.x || 0,
+ y: settings.y || 0,
+ w: width,
+ h: height,
+ deltaW: deltaW,
+ deltaH: deltaH,
+ contentW: width - deltaW,
+ contentH: height - deltaH,
+ innerW: width - deltaW,
+ innerH: height - deltaH,
+ startMinWidth: startMinWidth || 0,
+ startMinHeight: startMinHeight || 0,
+ minW: Math.min(minWidth, maxW),
+ minH: Math.min(minHeight, maxH),
+ maxW: maxW,
+ maxH: maxH,
+ autoResize: autoResize,
+ scrollW: 0
+ };
+ self$$1._lastLayoutRect = {};
+ return layoutRect;
+ },
+ layoutRect: function (newRect) {
+ var self$$1 = this;
+ var curRect = self$$1._layoutRect, lastLayoutRect, size, deltaWidth, deltaHeight, repaintControls;
+ if (!curRect) {
+ curRect = self$$1.initLayoutRect();
+ }
+ if (newRect) {
+ deltaWidth = curRect.deltaW;
+ deltaHeight = curRect.deltaH;
+ if (newRect.x !== undefined) {
+ curRect.x = newRect.x;
+ }
+ if (newRect.y !== undefined) {
+ curRect.y = newRect.y;
+ }
+ if (newRect.minW !== undefined) {
+ curRect.minW = newRect.minW;
+ }
+ if (newRect.minH !== undefined) {
+ curRect.minH = newRect.minH;
+ }
+ size = newRect.w;
+ if (size !== undefined) {
+ size = size < curRect.minW ? curRect.minW : size;
+ size = size > curRect.maxW ? curRect.maxW : size;
+ curRect.w = size;
+ curRect.innerW = size - deltaWidth;
+ }
+ size = newRect.h;
+ if (size !== undefined) {
+ size = size < curRect.minH ? curRect.minH : size;
+ size = size > curRect.maxH ? curRect.maxH : size;
+ curRect.h = size;
+ curRect.innerH = size - deltaHeight;
+ }
+ size = newRect.innerW;
+ if (size !== undefined) {
+ size = size < curRect.minW - deltaWidth ? curRect.minW - deltaWidth : size;
+ size = size > curRect.maxW - deltaWidth ? curRect.maxW - deltaWidth : size;
+ curRect.innerW = size;
+ curRect.w = size + deltaWidth;
+ }
+ size = newRect.innerH;
+ if (size !== undefined) {
+ size = size < curRect.minH - deltaHeight ? curRect.minH - deltaHeight : size;
+ size = size > curRect.maxH - deltaHeight ? curRect.maxH - deltaHeight : size;
+ curRect.innerH = size;
+ curRect.h = size + deltaHeight;
+ }
+ if (newRect.contentW !== undefined) {
+ curRect.contentW = newRect.contentW;
+ }
+ if (newRect.contentH !== undefined) {
+ curRect.contentH = newRect.contentH;
+ }
+ lastLayoutRect = self$$1._lastLayoutRect;
+ if (lastLayoutRect.x !== curRect.x || lastLayoutRect.y !== curRect.y || lastLayoutRect.w !== curRect.w || lastLayoutRect.h !== curRect.h) {
+ repaintControls = Control.repaintControls;
+ if (repaintControls) {
+ if (repaintControls.map && !repaintControls.map[self$$1._id]) {
+ repaintControls.push(self$$1);
+ repaintControls.map[self$$1._id] = true;
</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">- dirtyCtrls = {};
- }, document.body);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ lastLayoutRect.x = curRect.x;
+ lastLayoutRect.y = curRect.y;
+ lastLayoutRect.w = curRect.w;
+ lastLayoutRect.h = curRect.h;
+ }
+ return self$$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">- }
- },
- remove: function (ctrl) {
- if (dirtyCtrls[ctrl._id]) {
- delete dirtyCtrls[ctrl._id];
- }
- }
- };
-
- var hasMouseWheelEventSupport = 'onmousewheel' in document;
- var hasWheelEventSupport = false;
- var classPrefix = 'mce-';
- var Control;
- var idCounter = 0;
- var proto$1 = {
- Statics: { classPrefix: classPrefix },
- isRtl: function () {
- return Control.rtl;
- },
- classPrefix: classPrefix,
- init: function (settings) {
- var self$$1 = this;
- var classes, defaultClasses;
- function applyClasses(classes) {
- var i;
- classes = classes.split(' ');
- for (i = 0; i < classes.length; i++) {
- self$$1.classes.add(classes[i]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return curRect;
+ },
+ repaint: function () {
+ var self$$1 = this;
+ var style, bodyStyle, bodyElm, rect, borderBox;
+ var borderW, borderH, lastRepaintRect, round, value;
+ round = !document.createRange ? Math.round : function (value) {
+ return value;
+ };
+ style = self$$1.getEl().style;
+ rect = self$$1._layoutRect;
+ lastRepaintRect = self$$1._lastRepaintRect || {};
+ borderBox = self$$1.borderBox;
+ borderW = borderBox.left + borderBox.right;
+ borderH = borderBox.top + borderBox.bottom;
+ if (rect.x !== lastRepaintRect.x) {
+ style.left = round(rect.x) + 'px';
+ lastRepaintRect.x = rect.x;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- self$$1.settings = settings = global$2.extend({}, self$$1.Defaults, settings);
- self$$1._id = settings.id || 'mceu_' + idCounter++;
- self$$1._aria = { role: settings.role };
- self$$1._elmCache = {};
- self$$1.$ = global$9;
- self$$1.state = new ObservableObject({
- visible: true,
- active: false,
- disabled: false,
- value: ''
- });
- self$$1.data = new ObservableObject(settings.data);
- self$$1.classes = new ClassList(function () {
- if (self$$1.state.get('rendered')) {
- self$$1.getEl().className = this.toString();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rect.y !== lastRepaintRect.y) {
+ style.top = round(rect.y) + 'px';
+ lastRepaintRect.y = rect.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">- });
- self$$1.classes.prefix = self$$1.classPrefix;
- classes = settings.classes;
- if (classes) {
- if (self$$1.Defaults) {
- defaultClasses = self$$1.Defaults.classes;
- if (defaultClasses && classes !== defaultClasses) {
- applyClasses(defaultClasses);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rect.w !== lastRepaintRect.w) {
+ value = round(rect.w - borderW);
+ style.width = (value >= 0 ? value : 0) + 'px';
+ lastRepaintRect.w = rect.w;
+ }
+ if (rect.h !== lastRepaintRect.h) {
+ value = round(rect.h - borderH);
+ style.height = (value >= 0 ? value : 0) + 'px';
+ lastRepaintRect.h = rect.h;
+ }
+ if (self$$1._hasBody && rect.innerW !== lastRepaintRect.innerW) {
+ value = round(rect.innerW);
+ bodyElm = self$$1.getEl('body');
+ if (bodyElm) {
+ bodyStyle = bodyElm.style;
+ bodyStyle.width = (value >= 0 ? value : 0) + 'px';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ lastRepaintRect.innerW = rect.innerW;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- applyClasses(classes);
- }
- global$2.each('title text name visible disabled active value'.split(' '), function (name$$1) {
- if (name$$1 in settings) {
- self$$1[name$$1](settings[name$$1]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self$$1._hasBody && rect.innerH !== lastRepaintRect.innerH) {
+ value = round(rect.innerH);
+ bodyElm = bodyElm || self$$1.getEl('body');
+ if (bodyElm) {
+ bodyStyle = bodyStyle || bodyElm.style;
+ bodyStyle.height = (value >= 0 ? value : 0) + 'px';
+ }
+ lastRepaintRect.innerH = rect.innerH;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self$$1.on('click', function () {
- if (self$$1.disabled()) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1._lastRepaintRect = lastRepaintRect;
+ self$$1.fire('repaint', {}, false);
+ },
+ updateLayoutRect: function () {
+ var self$$1 = this;
+ self$$1.parent()._lastRect = null;
+ funcs.css(self$$1.getEl(), {
+ width: '',
+ height: ''
+ });
+ self$$1._layoutRect = self$$1._lastRepaintRect = self$$1._lastLayoutRect = null;
+ self$$1.initLayoutRect();
+ },
+ on: function (name$$1, callback) {
+ var self$$1 = this;
+ function resolveCallbackName(name$$1) {
+ var callback, scope;
+ if (typeof name$$1 !== 'string') {
+ return name$$1;
+ }
+ return function (e) {
+ if (!callback) {
+ self$$1.parentsAndSelf().each(function (ctrl) {
+ var callbacks = ctrl.settings.callbacks;
+ if (callbacks && (callback = callbacks[name$$1])) {
+ scope = ctrl;
+ return false;
+ }
+ });
+ }
+ if (!callback) {
+ e.action = name$$1;
+ this.fire('execute', e);
+ return;
+ }
+ return callback.call(scope, 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">- });
- self$$1.settings = settings;
- self$$1.borderBox = $_fbr241uqjjgwefqo.parseBox(settings.border);
- self$$1.paddingBox = $_fbr241uqjjgwefqo.parseBox(settings.padding);
- self$$1.marginBox = $_fbr241uqjjgwefqo.parseBox(settings.margin);
- if (settings.hidden) {
- self$$1.hide();
- }
- },
- Properties: 'parent,name',
- getContainerElm: function () {
- var uiContainer = $_6344qfu4jjgwefnr.getUiContainer(this);
- return uiContainer ? uiContainer : funcs.getContainer();
- },
- getParentCtrl: function (elm) {
- var ctrl;
- var lookup = this.getRoot().controlIdLookup;
- while (elm && lookup) {
- ctrl = lookup[elm.id];
- if (ctrl) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ getEventDispatcher(self$$1).on(name$$1, resolveCallbackName(callback));
+ return self$$1;
+ },
+ off: function (name$$1, callback) {
+ getEventDispatcher(this).off(name$$1, callback);
+ return this;
+ },
+ fire: function (name$$1, args, bubble) {
+ var self$$1 = this;
+ args = args || {};
+ if (!args.control) {
+ args.control = self$$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">- elm = elm.parentNode;
- }
- return ctrl;
- },
- initLayoutRect: function () {
- var self$$1 = this;
- var settings = self$$1.settings;
- var borderBox, layoutRect;
- var elm = self$$1.getEl();
- var width, height, minWidth, minHeight, autoResize;
- var startMinWidth, startMinHeight, initialSize;
- borderBox = self$$1.borderBox = self$$1.borderBox || $_fbr241uqjjgwefqo.measureBox(elm, 'border');
- self$$1.paddingBox = self$$1.paddingBox || $_fbr241uqjjgwefqo.measureBox(elm, 'padding');
- self$$1.marginBox = self$$1.marginBox || $_fbr241uqjjgwefqo.measureBox(elm, 'margin');
- initialSize = funcs.getSize(elm);
- startMinWidth = settings.minWidth;
- startMinHeight = settings.minHeight;
- minWidth = startMinWidth || initialSize.width;
- minHeight = startMinHeight || initialSize.height;
- width = settings.width;
- height = settings.height;
- autoResize = settings.autoResize;
- autoResize = typeof autoResize !== 'undefined' ? autoResize : !width && !height;
- width = width || minWidth;
- height = height || minHeight;
- var deltaW = borderBox.left + borderBox.right;
- var deltaH = borderBox.top + borderBox.bottom;
- var maxW = settings.maxWidth || 65535;
- var maxH = settings.maxHeight || 65535;
- self$$1._layoutRect = layoutRect = {
- x: settings.x || 0,
- y: settings.y || 0,
- w: width,
- h: height,
- deltaW: deltaW,
- deltaH: deltaH,
- contentW: width - deltaW,
- contentH: height - deltaH,
- innerW: width - deltaW,
- innerH: height - deltaH,
- startMinWidth: startMinWidth || 0,
- startMinHeight: startMinHeight || 0,
- minW: Math.min(minWidth, maxW),
- minH: Math.min(minHeight, maxH),
- maxW: maxW,
- maxH: maxH,
- autoResize: autoResize,
- scrollW: 0
- };
- self$$1._lastLayoutRect = {};
- return layoutRect;
- },
- layoutRect: function (newRect) {
- var self$$1 = this;
- var curRect = self$$1._layoutRect, lastLayoutRect, size, deltaWidth, deltaHeight, repaintControls;
- if (!curRect) {
- curRect = self$$1.initLayoutRect();
- }
- if (newRect) {
- deltaWidth = curRect.deltaW;
- deltaHeight = curRect.deltaH;
- if (newRect.x !== undefined) {
- curRect.x = newRect.x;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ args = getEventDispatcher(self$$1).fire(name$$1, args);
+ if (bubble !== false && self$$1.parent) {
+ var parent$$1 = self$$1.parent();
+ while (parent$$1 && !args.isPropagationStopped()) {
+ parent$$1.fire(name$$1, args, false);
+ parent$$1 = parent$$1.parent();
+ }
</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 (newRect.y !== undefined) {
- curRect.y = newRect.y;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return args;
+ },
+ hasEventListeners: function (name$$1) {
+ return getEventDispatcher(this).has(name$$1);
+ },
+ parents: function (selector) {
+ var self$$1 = this;
+ var ctrl, parents = new Collection$2();
+ for (ctrl = self$$1.parent(); ctrl; ctrl = ctrl.parent()) {
+ parents.add(ctrl);
</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 (newRect.minW !== undefined) {
- curRect.minW = newRect.minW;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (selector) {
+ parents = parents.filter(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">- if (newRect.minH !== undefined) {
- curRect.minH = newRect.minH;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return parents;
+ },
+ parentsAndSelf: function (selector) {
+ return new Collection$2(this).add(this.parents(selector));
+ },
+ next: function () {
+ var parentControls = this.parent().items();
+ return parentControls[parentControls.indexOf(this) + 1];
+ },
+ prev: function () {
+ var parentControls = this.parent().items();
+ return parentControls[parentControls.indexOf(this) - 1];
+ },
+ innerHtml: function (html) {
+ this.$el.html(html);
+ return this;
+ },
+ getEl: function (suffix) {
+ var id = suffix ? this._id + '-' + suffix : this._id;
+ if (!this._elmCache[id]) {
+ this._elmCache[id] = global$9('#' + id)[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">- size = newRect.w;
- if (size !== undefined) {
- size = size < curRect.minW ? curRect.minW : size;
- size = size > curRect.maxW ? curRect.maxW : size;
- curRect.w = size;
- curRect.innerW = size - deltaWidth;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this._elmCache[id];
+ },
+ show: function () {
+ return this.visible(true);
+ },
+ hide: function () {
+ return this.visible(false);
+ },
+ focus: function () {
+ try {
+ this.getEl().focus();
+ } catch (ex) {
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- size = newRect.h;
- if (size !== undefined) {
- size = size < curRect.minH ? curRect.minH : size;
- size = size > curRect.maxH ? curRect.maxH : size;
- curRect.h = size;
- curRect.innerH = size - deltaHeight;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this;
+ },
+ blur: function () {
+ this.getEl().blur();
+ return this;
+ },
+ aria: function (name$$1, value) {
+ var self$$1 = this, elm = self$$1.getEl(self$$1.ariaTarget);
+ if (typeof value === 'undefined') {
+ return self$$1._aria[name$$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">- size = newRect.innerW;
- if (size !== undefined) {
- size = size < curRect.minW - deltaWidth ? curRect.minW - deltaWidth : size;
- size = size > curRect.maxW - deltaWidth ? curRect.maxW - deltaWidth : size;
- curRect.innerW = size;
- curRect.w = size + deltaWidth;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1._aria[name$$1] = value;
+ if (self$$1.state.get('rendered')) {
+ elm.setAttribute(name$$1 === 'role' ? name$$1 : 'aria-' + name$$1, 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">- size = newRect.innerH;
- if (size !== undefined) {
- size = size < curRect.minH - deltaHeight ? curRect.minH - deltaHeight : size;
- size = size > curRect.maxH - deltaHeight ? curRect.maxH - deltaHeight : size;
- curRect.innerH = size;
- curRect.h = size + deltaHeight;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$1;
+ },
+ encode: function (text, translate) {
+ if (translate !== false) {
+ text = this.translate(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 (newRect.contentW !== undefined) {
- curRect.contentW = newRect.contentW;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return (text || '').replace(/[&<>"]/g, function (match) {
+ return '&#' + match.charCodeAt(0) + ';';
+ });
+ },
+ translate: function (text) {
+ return Control.translate ? Control.translate(text) : text;
+ },
+ before: function (items) {
+ var self$$1 = this, parent$$1 = self$$1.parent();
+ if (parent$$1) {
+ parent$$1.insert(items, parent$$1.items().indexOf(self$$1), 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 (newRect.contentH !== undefined) {
- curRect.contentH = newRect.contentH;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$1;
+ },
+ after: function (items) {
+ var self$$1 = this, parent$$1 = self$$1.parent();
+ if (parent$$1) {
+ parent$$1.insert(items, parent$$1.items().indexOf(self$$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">- lastLayoutRect = self$$1._lastLayoutRect;
- if (lastLayoutRect.x !== curRect.x || lastLayoutRect.y !== curRect.y || lastLayoutRect.w !== curRect.w || lastLayoutRect.h !== curRect.h) {
- repaintControls = Control.repaintControls;
- if (repaintControls) {
- if (repaintControls.map && !repaintControls.map[self$$1._id]) {
- repaintControls.push(self$$1);
- repaintControls.map[self$$1._id] = true;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$1;
+ },
+ remove: function () {
+ var self$$1 = this;
+ var elm = self$$1.getEl();
+ var parent$$1 = self$$1.parent();
+ var newItems, i;
+ if (self$$1.items) {
+ var controls = self$$1.items().toArray();
+ i = controls.length;
+ while (i--) {
+ controls[i].remove();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- lastLayoutRect.x = curRect.x;
- lastLayoutRect.y = curRect.y;
- lastLayoutRect.w = curRect.w;
- lastLayoutRect.h = curRect.h;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return self$$1;
- }
- return curRect;
- },
- repaint: function () {
- var self$$1 = this;
- var style, bodyStyle, bodyElm, rect, borderBox;
- var borderW, borderH, lastRepaintRect, round, value;
- round = !document.createRange ? Math.round : function (value) {
- return value;
- };
- style = self$$1.getEl().style;
- rect = self$$1._layoutRect;
- lastRepaintRect = self$$1._lastRepaintRect || {};
- borderBox = self$$1.borderBox;
- borderW = borderBox.left + borderBox.right;
- borderH = borderBox.top + borderBox.bottom;
- if (rect.x !== lastRepaintRect.x) {
- style.left = round(rect.x) + 'px';
- lastRepaintRect.x = rect.x;
- }
- if (rect.y !== lastRepaintRect.y) {
- style.top = round(rect.y) + 'px';
- lastRepaintRect.y = rect.y;
- }
- if (rect.w !== lastRepaintRect.w) {
- value = round(rect.w - borderW);
- style.width = (value >= 0 ? value : 0) + 'px';
- lastRepaintRect.w = rect.w;
- }
- if (rect.h !== lastRepaintRect.h) {
- value = round(rect.h - borderH);
- style.height = (value >= 0 ? value : 0) + 'px';
- lastRepaintRect.h = rect.h;
- }
- if (self$$1._hasBody && rect.innerW !== lastRepaintRect.innerW) {
- value = round(rect.innerW);
- bodyElm = self$$1.getEl('body');
- if (bodyElm) {
- bodyStyle = bodyElm.style;
- bodyStyle.width = (value >= 0 ? value : 0) + 'px';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (parent$$1 && parent$$1.items) {
+ newItems = [];
+ parent$$1.items().each(function (item) {
+ if (item !== self$$1) {
+ newItems.push(item);
+ }
+ });
+ parent$$1.items().set(newItems);
+ parent$$1._lastRect = 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">- lastRepaintRect.innerW = rect.innerW;
- }
- if (self$$1._hasBody && rect.innerH !== lastRepaintRect.innerH) {
- value = round(rect.innerH);
- bodyElm = bodyElm || self$$1.getEl('body');
- if (bodyElm) {
- bodyStyle = bodyStyle || bodyElm.style;
- bodyStyle.height = (value >= 0 ? value : 0) + 'px';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self$$1._eventsRoot && self$$1._eventsRoot === self$$1) {
+ global$9(elm).off();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- lastRepaintRect.innerH = rect.innerH;
- }
- self$$1._lastRepaintRect = lastRepaintRect;
- self$$1.fire('repaint', {}, false);
- },
- updateLayoutRect: function () {
- var self$$1 = this;
- self$$1.parent()._lastRect = null;
- funcs.css(self$$1.getEl(), {
- width: '',
- height: ''
- });
- self$$1._layoutRect = self$$1._lastRepaintRect = self$$1._lastLayoutRect = null;
- self$$1.initLayoutRect();
- },
- on: function (name$$1, callback) {
- var self$$1 = this;
- function resolveCallbackName(name$$1) {
- var callback, scope;
- if (typeof name$$1 !== 'string') {
- return name$$1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var lookup = self$$1.getRoot().controlIdLookup;
+ if (lookup) {
+ delete lookup[self$$1._id];
</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 function (e) {
- if (!callback) {
- self$$1.parentsAndSelf().each(function (ctrl) {
- var callbacks = ctrl.settings.callbacks;
- if (callbacks && (callback = callbacks[name$$1])) {
- scope = ctrl;
- return false;
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (elm && elm.parentNode) {
+ elm.parentNode.removeChild(elm);
+ }
+ self$$1.state.set('rendered', false);
+ self$$1.state.destroy();
+ self$$1.fire('remove');
+ return self$$1;
+ },
+ renderBefore: function (elm) {
+ global$9(elm).before(this.renderHtml());
+ this.postRender();
+ return this;
+ },
+ renderTo: function (elm) {
+ global$9(elm || this.getContainerElm()).append(this.renderHtml());
+ this.postRender();
+ return this;
+ },
+ preRender: function () {
+ },
+ render: function () {
+ },
+ renderHtml: function () {
+ return '<div id="' + this._id + '" class="' + this.classes + '"></div>';
+ },
+ postRender: function () {
+ var self$$1 = this;
+ var settings = self$$1.settings;
+ var elm, box, parent$$1, name$$1, parentEventsRoot;
+ self$$1.$el = global$9(self$$1.getEl());
+ self$$1.state.set('rendered', true);
+ for (name$$1 in settings) {
+ if (name$$1.indexOf('on') === 0) {
+ self$$1.on(name$$1.substr(2), settings[name$$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 (!callback) {
- e.action = name$$1;
- this.fire('execute', e);
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (self$$1._eventsRoot) {
+ for (parent$$1 = self$$1.parent(); !parentEventsRoot && parent$$1; parent$$1 = parent$$1.parent()) {
+ parentEventsRoot = parent$$1._eventsRoot;
</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 callback.call(scope, e);
- };
- }
- getEventDispatcher(self$$1).on(name$$1, resolveCallbackName(callback));
- return self$$1;
- },
- off: function (name$$1, callback) {
- getEventDispatcher(this).off(name$$1, callback);
- return this;
- },
- fire: function (name$$1, args, bubble) {
- var self$$1 = this;
- args = args || {};
- if (!args.control) {
- args.control = self$$1;
- }
- args = getEventDispatcher(self$$1).fire(name$$1, args);
- if (bubble !== false && self$$1.parent) {
- var parent$$1 = self$$1.parent();
- while (parent$$1 && !args.isPropagationStopped()) {
- parent$$1.fire(name$$1, args, false);
- parent$$1 = parent$$1.parent();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (parentEventsRoot) {
+ for (name$$1 in parentEventsRoot._nativeEvents) {
+ self$$1._nativeEvents[name$$1] = 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 args;
- },
- hasEventListeners: function (name$$1) {
- return getEventDispatcher(this).has(name$$1);
- },
- parents: function (selector) {
- var self$$1 = this;
- var ctrl, parents = new Collection$2();
- for (ctrl = self$$1.parent(); ctrl; ctrl = ctrl.parent()) {
- parents.add(ctrl);
- }
- if (selector) {
- parents = parents.filter(selector);
- }
- return parents;
- },
- parentsAndSelf: function (selector) {
- return new Collection$2(this).add(this.parents(selector));
- },
- next: function () {
- var parentControls = this.parent().items();
- return parentControls[parentControls.indexOf(this) + 1];
- },
- prev: function () {
- var parentControls = this.parent().items();
- return parentControls[parentControls.indexOf(this) - 1];
- },
- innerHtml: function (html) {
- this.$el.html(html);
- return this;
- },
- getEl: function (suffix) {
- var id = suffix ? this._id + '-' + suffix : this._id;
- if (!this._elmCache[id]) {
- this._elmCache[id] = global$9('#' + id)[0];
- }
- return this._elmCache[id];
- },
- show: function () {
- return this.visible(true);
- },
- hide: function () {
- return this.visible(false);
- },
- focus: function () {
- try {
- this.getEl().focus();
- } catch (ex) {
- }
- return this;
- },
- blur: function () {
- this.getEl().blur();
- return this;
- },
- aria: function (name$$1, value) {
- var self$$1 = this, elm = self$$1.getEl(self$$1.ariaTarget);
- if (typeof value === 'undefined') {
- return self$$1._aria[name$$1];
- }
- self$$1._aria[name$$1] = value;
- if (self$$1.state.get('rendered')) {
- elm.setAttribute(name$$1 === 'role' ? name$$1 : 'aria-' + name$$1, value);
- }
- return self$$1;
- },
- encode: function (text, translate) {
- if (translate !== false) {
- text = this.translate(text);
- }
- return (text || '').replace(/[&<>"]/g, function (match) {
- return '&#' + match.charCodeAt(0) + ';';
- });
- },
- translate: function (text) {
- return Control.translate ? Control.translate(text) : text;
- },
- before: function (items) {
- var self$$1 = this, parent$$1 = self$$1.parent();
- if (parent$$1) {
- parent$$1.insert(items, parent$$1.items().indexOf(self$$1), true);
- }
- return self$$1;
- },
- after: function (items) {
- var self$$1 = this, parent$$1 = self$$1.parent();
- if (parent$$1) {
- parent$$1.insert(items, parent$$1.items().indexOf(self$$1));
- }
- return self$$1;
- },
- remove: function () {
- var self$$1 = this;
- var elm = self$$1.getEl();
- var parent$$1 = self$$1.parent();
- var newItems, i;
- if (self$$1.items) {
- var controls = self$$1.items().toArray();
- i = controls.length;
- while (i--) {
- controls[i].remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ bindPendingEvents(self$$1);
+ if (settings.style) {
+ elm = self$$1.getEl();
+ if (elm) {
+ elm.setAttribute('style', settings.style);
+ elm.style.cssText = settings.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 (parent$$1 && parent$$1.items) {
- newItems = [];
- parent$$1.items().each(function (item) {
- if (item !== self$$1) {
- newItems.push(item);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self$$1.settings.border) {
+ box = self$$1.borderBox;
+ self$$1.$el.css({
+ 'border-top-width': box.top,
+ 'border-right-width': box.right,
+ 'border-bottom-width': box.bottom,
+ 'border-left-width': box.left
+ });
+ }
+ var root = self$$1.getRoot();
+ if (!root.controlIdLookup) {
+ root.controlIdLookup = {};
+ }
+ root.controlIdLookup[self$$1._id] = self$$1;
+ for (var key in self$$1._aria) {
+ self$$1.aria(key, self$$1._aria[key]);
+ }
+ if (self$$1.state.get('visible') === false) {
+ self$$1.getEl().style.display = 'none';
+ }
+ self$$1.bindStates();
+ self$$1.state.on('change:visible', function (e) {
+ var state = e.value;
+ var parentCtrl;
+ if (self$$1.state.get('rendered')) {
+ self$$1.getEl().style.display = state === false ? 'none' : '';
+ self$$1.getEl().getBoundingClientRect();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parentCtrl = self$$1.parent();
+ if (parentCtrl) {
+ parentCtrl._lastRect = null;
+ }
+ self$$1.fire(state ? 'show' : 'hide');
+ ReflowQueue.add(self$$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">- parent$$1.items().set(newItems);
- parent$$1._lastRect = null;
- }
- if (self$$1._eventsRoot && self$$1._eventsRoot === self$$1) {
- global$9(elm).off();
- }
- var lookup = self$$1.getRoot().controlIdLookup;
- if (lookup) {
- delete lookup[self$$1._id];
- }
- if (elm && elm.parentNode) {
- elm.parentNode.removeChild(elm);
- }
- self$$1.state.set('rendered', false);
- self$$1.state.destroy();
- self$$1.fire('remove');
- return self$$1;
- },
- renderBefore: function (elm) {
- global$9(elm).before(this.renderHtml());
- this.postRender();
- return this;
- },
- renderTo: function (elm) {
- global$9(elm || this.getContainerElm()).append(this.renderHtml());
- this.postRender();
- return this;
- },
- preRender: function () {
- },
- render: function () {
- },
- renderHtml: function () {
- return '<div id="' + this._id + '" class="' + this.classes + '"></div>';
- },
- postRender: function () {
- var self$$1 = this;
- var settings = self$$1.settings;
- var elm, box, parent$$1, name$$1, parentEventsRoot;
- self$$1.$el = global$9(self$$1.getEl());
- self$$1.state.set('rendered', true);
- for (name$$1 in settings) {
- if (name$$1.indexOf('on') === 0) {
- self$$1.on(name$$1.substr(2), settings[name$$1]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.fire('postrender', {}, false);
+ },
+ bindStates: function () {
+ },
+ scrollIntoView: function (align) {
+ function getOffset(elm, rootElm) {
+ var x, y, parent$$1 = elm;
+ x = y = 0;
+ while (parent$$1 && parent$$1 !== rootElm && parent$$1.nodeType) {
+ x += parent$$1.offsetLeft || 0;
+ y += parent$$1.offsetTop || 0;
+ parent$$1 = parent$$1.offsetParent;
+ }
+ return {
+ x: x,
+ y: 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 (self$$1._eventsRoot) {
- for (parent$$1 = self$$1.parent(); !parentEventsRoot && parent$$1; parent$$1 = parent$$1.parent()) {
- parentEventsRoot = parent$$1._eventsRoot;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var elm = this.getEl(), parentElm = elm.parentNode;
+ var x, y, width, height, parentWidth, parentHeight;
+ var pos = getOffset(elm, parentElm);
+ x = pos.x;
+ y = pos.y;
+ width = elm.offsetWidth;
+ height = elm.offsetHeight;
+ parentWidth = parentElm.clientWidth;
+ parentHeight = parentElm.clientHeight;
+ if (align === 'end') {
+ x -= parentWidth - width;
+ y -= parentHeight - height;
+ } else if (align === 'center') {
+ x -= parentWidth / 2 - width / 2;
+ y -= parentHeight / 2 - height / 2;
</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 (parentEventsRoot) {
- for (name$$1 in parentEventsRoot._nativeEvents) {
- self$$1._nativeEvents[name$$1] = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parentElm.scrollLeft = x;
+ parentElm.scrollTop = y;
+ return this;
+ },
+ getRoot: function () {
+ var ctrl = this, rootControl;
+ var parents = [];
+ while (ctrl) {
+ if (ctrl.rootControl) {
+ rootControl = ctrl.rootControl;
+ break;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parents.push(ctrl);
+ rootControl = ctrl;
+ ctrl = ctrl.parent();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- bindPendingEvents(self$$1);
- if (settings.style) {
- elm = self$$1.getEl();
- if (elm) {
- elm.setAttribute('style', settings.style);
- elm.style.cssText = settings.style;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!rootControl) {
+ rootControl = 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">- }
- if (self$$1.settings.border) {
- box = self$$1.borderBox;
- self$$1.$el.css({
- 'border-top-width': box.top,
- 'border-right-width': box.right,
- 'border-bottom-width': box.bottom,
- 'border-left-width': box.left
- });
- }
- var root = self$$1.getRoot();
- if (!root.controlIdLookup) {
- root.controlIdLookup = {};
- }
- root.controlIdLookup[self$$1._id] = self$$1;
- for (var key in self$$1._aria) {
- self$$1.aria(key, self$$1._aria[key]);
- }
- if (self$$1.state.get('visible') === false) {
- self$$1.getEl().style.display = 'none';
- }
- self$$1.bindStates();
- self$$1.state.on('change:visible', function (e) {
- var state = e.value;
- var parentCtrl;
- if (self$$1.state.get('rendered')) {
- self$$1.getEl().style.display = state === false ? 'none' : '';
- self$$1.getEl().getBoundingClientRect();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var i = parents.length;
+ while (i--) {
+ parents[i].rootControl = rootControl;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- parentCtrl = self$$1.parent();
- if (parentCtrl) {
- parentCtrl._lastRect = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return rootControl;
+ },
+ reflow: function () {
+ ReflowQueue.remove(this);
+ var parent$$1 = this.parent();
+ if (parent$$1 && parent$$1._layout && !parent$$1._layout.isNative()) {
+ parent$$1.reflow();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.fire(state ? 'show' : 'hide');
- $_p42hyuxjjgwefrk.add(self$$1);
- });
- self$$1.fire('postrender', {}, false);
- },
- bindStates: function () {
- },
- scrollIntoView: function (align) {
- function getOffset(elm, rootElm) {
- var x, y, parent$$1 = elm;
- x = y = 0;
- while (parent$$1 && parent$$1 !== rootElm && parent$$1.nodeType) {
- x += parent$$1.offsetLeft || 0;
- y += parent$$1.offsetTop || 0;
- parent$$1 = parent$$1.offsetParent;
- }
- return {
- x: x,
- y: y
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- var elm = this.getEl(), parentElm = elm.parentNode;
- var x, y, width, height, parentWidth, parentHeight;
- var pos = getOffset(elm, parentElm);
- x = pos.x;
- y = pos.y;
- width = elm.offsetWidth;
- height = elm.offsetHeight;
- parentWidth = parentElm.clientWidth;
- parentHeight = parentElm.clientHeight;
- if (align === 'end') {
- x -= parentWidth - width;
- y -= parentHeight - height;
- } else if (align === 'center') {
- x -= parentWidth / 2 - width / 2;
- y -= parentHeight / 2 - height / 2;
- }
- parentElm.scrollLeft = x;
- parentElm.scrollTop = y;
- return this;
- },
- getRoot: function () {
- var ctrl = this, rootControl;
- var parents = [];
- while (ctrl) {
- if (ctrl.rootControl) {
- rootControl = ctrl.rootControl;
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ global$2.each('text title visible disabled active value'.split(' '), function (name$$1) {
+ proto$1[name$$1] = function (value) {
+ if (arguments.length === 0) {
+ return this.state.get(name$$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">- parents.push(ctrl);
- rootControl = ctrl;
- ctrl = ctrl.parent();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (typeof value !== 'undefined') {
+ this.state.set(name$$1, value);
+ }
+ return this;
+ };
+ });
+ Control = global$a.extend(proto$1);
+ function getEventDispatcher(obj) {
+ if (!obj._eventDispatcher) {
+ obj._eventDispatcher = new global$b({
+ scope: obj,
+ toggleEvent: function (name$$1, state) {
+ if (state && global$b.isNative(name$$1)) {
+ if (!obj._nativeEvents) {
+ obj._nativeEvents = {};
+ }
+ obj._nativeEvents[name$$1] = true;
+ if (obj.state.get('rendered')) {
+ bindPendingEvents(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">- if (!rootControl) {
- rootControl = this;
- }
- var i = parents.length;
- while (i--) {
- parents[i].rootControl = rootControl;
- }
- return rootControl;
- },
- reflow: function () {
- $_p42hyuxjjgwefrk.remove(this);
- var parent$$1 = this.parent();
- if (parent$$1 && parent$$1._layout && !parent$$1._layout.isNative()) {
- parent$$1.reflow();
- }
- return this;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return obj._eventDispatcher;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- global$2.each('text title visible disabled active value'.split(' '), function (name$$1) {
- proto$1[name$$1] = function (value) {
- if (arguments.length === 0) {
- return this.state.get(name$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function bindPendingEvents(eventCtrl) {
+ var i, l, parents, eventRootCtrl, nativeEvents, name$$1;
+ function delegate(e) {
+ var control = eventCtrl.getParentCtrl(e.target);
+ if (control) {
+ control.fire(e.type, 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">- if (typeof value !== 'undefined') {
- this.state.set(name$$1, value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function mouseLeaveHandler() {
+ var ctrl = eventRootCtrl._lastHoverCtrl;
+ if (ctrl) {
+ ctrl.fire('mouseleave', { target: ctrl.getEl() });
+ ctrl.parents().each(function (ctrl) {
+ ctrl.fire('mouseleave', { target: ctrl.getEl() });
+ });
+ eventRootCtrl._lastHoverCtrl = null;
+ }
</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 this;
- };
- });
- Control = global$10.extend(proto$1);
- function getEventDispatcher(obj) {
- if (!obj._eventDispatcher) {
- obj._eventDispatcher = new global$11({
- scope: obj,
- toggleEvent: function (name$$1, state) {
- if (state && global$11.isNative(name$$1)) {
- if (!obj._nativeEvents) {
- obj._nativeEvents = {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function mouseEnterHandler(e) {
+ var ctrl = eventCtrl.getParentCtrl(e.target), lastCtrl = eventRootCtrl._lastHoverCtrl, idx = 0, i, parents, lastParents;
+ if (ctrl !== lastCtrl) {
+ eventRootCtrl._lastHoverCtrl = ctrl;
+ parents = ctrl.parents().toArray().reverse();
+ parents.push(ctrl);
+ if (lastCtrl) {
+ lastParents = lastCtrl.parents().toArray().reverse();
+ lastParents.push(lastCtrl);
+ for (idx = 0; idx < lastParents.length; idx++) {
+ if (parents[idx] !== lastParents[idx]) {
+ break;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- obj._nativeEvents[name$$1] = true;
- if (obj.state.get('rendered')) {
- bindPendingEvents(obj);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (i = lastParents.length - 1; i >= idx; i--) {
+ lastCtrl = lastParents[i];
+ lastCtrl.fire('mouseleave', { target: lastCtrl.getEl() });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (i = idx; i < parents.length; i++) {
+ ctrl = parents[i];
+ ctrl.fire('mouseenter', { target: ctrl.getEl() });
+ }
</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._eventDispatcher;
- }
- function bindPendingEvents(eventCtrl) {
- var i, l, parents, eventRootCtrl, nativeEvents, name$$1;
- function delegate(e) {
- var control = eventCtrl.getParentCtrl(e.target);
- if (control) {
- control.fire(e.type, e);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- function mouseLeaveHandler() {
- var ctrl = eventRootCtrl._lastHoverCtrl;
- if (ctrl) {
- ctrl.fire('mouseleave', { target: ctrl.getEl() });
- ctrl.parents().each(function (ctrl) {
- ctrl.fire('mouseleave', { target: ctrl.getEl() });
- });
- eventRootCtrl._lastHoverCtrl = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function fixWheelEvent(e) {
+ e.preventDefault();
+ if (e.type === 'mousewheel') {
+ e.deltaY = -1 / 40 * e.wheelDelta;
+ if (e.wheelDeltaX) {
+ e.deltaX = -1 / 40 * e.wheelDeltaX;
+ }
+ } else {
+ e.deltaX = 0;
+ e.deltaY = e.detail;
+ }
+ e = eventCtrl.fire('wheel', 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 mouseEnterHandler(e) {
- var ctrl = eventCtrl.getParentCtrl(e.target), lastCtrl = eventRootCtrl._lastHoverCtrl, idx = 0, i, parents, lastParents;
- if (ctrl !== lastCtrl) {
- eventRootCtrl._lastHoverCtrl = ctrl;
- parents = ctrl.parents().toArray().reverse();
- parents.push(ctrl);
- if (lastCtrl) {
- lastParents = lastCtrl.parents().toArray().reverse();
- lastParents.push(lastCtrl);
- for (idx = 0; idx < lastParents.length; idx++) {
- if (parents[idx] !== lastParents[idx]) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ nativeEvents = eventCtrl._nativeEvents;
+ if (nativeEvents) {
+ parents = eventCtrl.parents().toArray();
+ parents.unshift(eventCtrl);
+ for (i = 0, l = parents.length; !eventRootCtrl && i < l; i++) {
+ eventRootCtrl = parents[i]._eventsRoot;
+ }
+ if (!eventRootCtrl) {
+ eventRootCtrl = parents[parents.length - 1] || eventCtrl;
+ }
+ eventCtrl._eventsRoot = eventRootCtrl;
+ for (l = i, i = 0; i < l; i++) {
+ parents[i]._eventsRoot = eventRootCtrl;
+ }
+ var eventRootDelegates = eventRootCtrl._delegates;
+ if (!eventRootDelegates) {
+ eventRootDelegates = eventRootCtrl._delegates = {};
+ }
+ for (name$$1 in nativeEvents) {
+ if (!nativeEvents) {
+ return false;
+ }
+ if (name$$1 === 'wheel' && !hasWheelEventSupport) {
+ if (hasMouseWheelEventSupport) {
+ global$9(eventCtrl.getEl()).on('mousewheel', fixWheelEvent);
+ } else {
+ global$9(eventCtrl.getEl()).on('DOMMouseScroll', fixWheelEvent);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ continue;
</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 = lastParents.length - 1; i >= idx; i--) {
- lastCtrl = lastParents[i];
- lastCtrl.fire('mouseleave', { target: lastCtrl.getEl() });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (name$$1 === 'mouseenter' || name$$1 === 'mouseleave') {
+ if (!eventRootCtrl._hasMouseEnter) {
+ global$9(eventRootCtrl.getEl()).on('mouseleave', mouseLeaveHandler).on('mouseover', mouseEnterHandler);
+ eventRootCtrl._hasMouseEnter = 1;
+ }
+ } else if (!eventRootDelegates[name$$1]) {
+ global$9(eventRootCtrl.getEl()).on(name$$1, delegate);
+ eventRootDelegates[name$$1] = 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">+ nativeEvents[name$$1] = 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">- for (i = idx; i < parents.length; i++) {
- ctrl = parents[i];
- ctrl.fire('mouseenter', { target: ctrl.getEl() });
- }
</del><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">- function fixWheelEvent(e) {
- e.preventDefault();
- if (e.type === 'mousewheel') {
- e.deltaY = -1 / 40 * e.wheelDelta;
- if (e.wheelDeltaX) {
- e.deltaX = -1 / 40 * e.wheelDeltaX;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Control$1 = Control;
+
+ var hasTabstopData = function (elm) {
+ return elm.getAttribute('data-mce-tabstop') ? true : false;
+ };
+ function KeyboardNavigation (settings) {
+ var root = settings.root;
+ var focusedElement, focusedControl;
+ function isElement(node) {
+ return node && node.nodeType === 1;
+ }
+ try {
+ focusedElement = document.activeElement;
+ } catch (ex) {
+ focusedElement = document.body;
+ }
+ focusedControl = root.getParentCtrl(focusedElement);
+ function getRole(elm) {
+ elm = elm || focusedElement;
+ if (isElement(elm)) {
+ return elm.getAttribute('role');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- e.deltaX = 0;
- e.deltaY = e.detail;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- e = eventCtrl.fire('wheel', e);
- }
- nativeEvents = eventCtrl._nativeEvents;
- if (nativeEvents) {
- parents = eventCtrl.parents().toArray();
- parents.unshift(eventCtrl);
- for (i = 0, l = parents.length; !eventRootCtrl && i < l; i++) {
- eventRootCtrl = parents[i]._eventsRoot;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function getParentRole(elm) {
+ var role, parent$$1 = elm || focusedElement;
+ while (parent$$1 = parent$$1.parentNode) {
+ if (role = getRole(parent$$1)) {
+ return role;
+ }
+ }
</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 (!eventRootCtrl) {
- eventRootCtrl = parents[parents.length - 1] || eventCtrl;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function getAriaProp(name$$1) {
+ var elm = focusedElement;
+ if (isElement(elm)) {
+ return elm.getAttribute('aria-' + name$$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">- eventCtrl._eventsRoot = eventRootCtrl;
- for (l = i, i = 0; i < l; i++) {
- parents[i]._eventsRoot = eventRootCtrl;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function isTextInputElement(elm) {
+ var tagName = elm.tagName.toUpperCase();
+ return tagName === 'INPUT' || tagName === 'TEXTAREA' || tagName === 'SELECT';
</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 eventRootDelegates = eventRootCtrl._delegates;
- if (!eventRootDelegates) {
- eventRootDelegates = eventRootCtrl._delegates = {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function canFocus(elm) {
+ if (isTextInputElement(elm) && !elm.hidden) {
+ return true;
+ }
+ if (hasTabstopData(elm)) {
+ return true;
+ }
+ if (/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(getRole(elm))) {
+ return true;
+ }
+ 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">- for (name$$1 in nativeEvents) {
- if (!nativeEvents) {
- return false;
- }
- if (name$$1 === 'wheel' && !hasWheelEventSupport) {
- if (hasMouseWheelEventSupport) {
- global$9(eventCtrl.getEl()).on('mousewheel', fixWheelEvent);
- } else {
- global$9(eventCtrl.getEl()).on('DOMMouseScroll', fixWheelEvent);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function getFocusElements(elm) {
+ var elements = [];
+ function collect(elm) {
+ if (elm.nodeType !== 1 || elm.style.display === 'none' || elm.disabled) {
+ 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">- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (canFocus(elm)) {
+ elements.push(elm);
+ }
+ for (var i = 0; i < elm.childNodes.length; i++) {
+ collect(elm.childNodes[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 (name$$1 === 'mouseenter' || name$$1 === 'mouseleave') {
- if (!eventRootCtrl._hasMouseEnter) {
- global$9(eventRootCtrl.getEl()).on('mouseleave', mouseLeaveHandler).on('mouseover', mouseEnterHandler);
- eventRootCtrl._hasMouseEnter = 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ collect(elm || root.getEl());
+ return elements;
+ }
+ function getNavigationRoot(targetControl) {
+ var navigationRoot, controls;
+ targetControl = targetControl || focusedControl;
+ controls = targetControl.parents().toArray();
+ controls.unshift(targetControl);
+ for (var i = 0; i < controls.length; i++) {
+ navigationRoot = controls[i];
+ if (navigationRoot.settings.ariaRoot) {
+ 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">- } else if (!eventRootDelegates[name$$1]) {
- global$9(eventRootCtrl.getEl()).on(name$$1, delegate);
- eventRootDelegates[name$$1] = true;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- nativeEvents[name$$1] = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return navigationRoot;
</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 Control$1 = Control;
-
- var hasTabstopData = function (elm) {
- return elm.getAttribute('data-mce-tabstop') ? true : false;
- };
- function KeyboardNavigation (settings) {
- var root = settings.root;
- var focusedElement, focusedControl;
- function isElement(node) {
- return node && node.nodeType === 1;
- }
- try {
- focusedElement = document.activeElement;
- } catch (ex) {
- focusedElement = document.body;
- }
- focusedControl = root.getParentCtrl(focusedElement);
- function getRole(elm) {
- elm = elm || focusedElement;
- if (isElement(elm)) {
- return elm.getAttribute('role');
- }
- return null;
- }
- function getParentRole(elm) {
- var role, parent$$1 = elm || focusedElement;
- while (parent$$1 = parent$$1.parentNode) {
- if (role = getRole(parent$$1)) {
- return role;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function focusFirst(targetControl) {
+ var navigationRoot = getNavigationRoot(targetControl);
+ var focusElements = getFocusElements(navigationRoot.getEl());
+ if (navigationRoot.settings.ariaRemember && 'lastAriaIndex' in navigationRoot) {
+ moveFocusToIndex(navigationRoot.lastAriaIndex, focusElements);
+ } else {
+ moveFocusToIndex(0, focusElements);
</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">- }
- function getAriaProp(name$$1) {
- var elm = focusedElement;
- if (isElement(elm)) {
- return elm.getAttribute('aria-' + name$$1);
- }
- }
- function isTextInputElement(elm) {
- var tagName = elm.tagName.toUpperCase();
- return tagName === 'INPUT' || tagName === 'TEXTAREA' || tagName === 'SELECT';
- }
- function canFocus(elm) {
- if (isTextInputElement(elm) && !elm.hidden) {
- return true;
- }
- if (hasTabstopData(elm)) {
- return true;
- }
- if (/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(getRole(elm))) {
- return true;
- }
- return false;
- }
- function getFocusElements(elm) {
- var elements = [];
- function collect(elm) {
- if (elm.nodeType !== 1 || elm.style.display === 'none' || elm.disabled) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function moveFocusToIndex(idx, elements) {
+ if (idx < 0) {
+ idx = elements.length - 1;
+ } else if (idx >= elements.length) {
+ 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">- if (canFocus(elm)) {
- elements.push(elm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (elements[idx]) {
+ elements[idx].focus();
</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 i = 0; i < elm.childNodes.length; i++) {
- collect(elm.childNodes[i]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return idx;
+ }
+ function moveFocus(dir, elements) {
+ var idx = -1;
+ var navigationRoot = getNavigationRoot();
+ elements = elements || getFocusElements(navigationRoot.getEl());
+ for (var i = 0; i < elements.length; i++) {
+ if (elements[i] === focusedElement) {
+ idx = i;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ idx += dir;
+ navigationRoot.lastAriaIndex = moveFocusToIndex(idx, elements);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- collect(elm || root.getEl());
- return elements;
- }
- function getNavigationRoot(targetControl) {
- var navigationRoot, controls;
- targetControl = targetControl || focusedControl;
- controls = targetControl.parents().toArray();
- controls.unshift(targetControl);
- for (var i = 0; i < controls.length; i++) {
- navigationRoot = controls[i];
- if (navigationRoot.settings.ariaRoot) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function left() {
+ var parentRole = getParentRole();
+ if (parentRole === 'tablist') {
+ moveFocus(-1, getFocusElements(focusedElement.parentNode));
+ } else if (focusedControl.parent().submenu) {
+ cancel();
+ } else {
+ moveFocus(-1);
</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">- return navigationRoot;
- }
- function focusFirst(targetControl) {
- var navigationRoot = getNavigationRoot(targetControl);
- var focusElements = getFocusElements(navigationRoot.getEl());
- if (navigationRoot.settings.ariaRemember && 'lastAriaIndex' in navigationRoot) {
- moveFocusToIndex(navigationRoot.lastAriaIndex, focusElements);
- } else {
- moveFocusToIndex(0, focusElements);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function right() {
+ var role = getRole(), parentRole = getParentRole();
+ if (parentRole === 'tablist') {
+ moveFocus(1, getFocusElements(focusedElement.parentNode));
+ } else if (role === 'menuitem' && parentRole === 'menu' && getAriaProp('haspopup')) {
+ enter();
+ } else {
+ moveFocus(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">- }
- function moveFocusToIndex(idx, elements) {
- if (idx < 0) {
- idx = elements.length - 1;
- } else if (idx >= elements.length) {
- idx = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function up() {
+ moveFocus(-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 (elements[idx]) {
- elements[idx].focus();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function down() {
+ var role = getRole(), parentRole = getParentRole();
+ if (role === 'menuitem' && parentRole === 'menubar') {
+ enter();
+ } else if (role === 'button' && getAriaProp('haspopup')) {
+ enter({ key: 'down' });
+ } else {
+ moveFocus(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 idx;
- }
- function moveFocus(dir, elements) {
- var idx = -1;
- var navigationRoot = getNavigationRoot();
- elements = elements || getFocusElements(navigationRoot.getEl());
- for (var i = 0; i < elements.length; i++) {
- if (elements[i] === focusedElement) {
- idx = i;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function tab(e) {
+ var parentRole = getParentRole();
+ if (parentRole === 'tablist') {
+ var elm = getFocusElements(focusedControl.getEl('body'))[0];
+ if (elm) {
+ elm.focus();
+ }
+ } else {
+ moveFocus(e.shiftKey ? -1 : 1);
</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">- idx += dir;
- navigationRoot.lastAriaIndex = moveFocusToIndex(idx, elements);
- }
- function left() {
- var parentRole = getParentRole();
- if (parentRole === 'tablist') {
- moveFocus(-1, getFocusElements(focusedElement.parentNode));
- } else if (focusedControl.parent().submenu) {
- cancel();
- } else {
- moveFocus(-1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function cancel() {
+ focusedControl.fire('cancel');
</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 right() {
- var role = getRole(), parentRole = getParentRole();
- if (parentRole === 'tablist') {
- moveFocus(1, getFocusElements(focusedElement.parentNode));
- } else if (role === 'menuitem' && parentRole === 'menu' && getAriaProp('haspopup')) {
- enter();
- } else {
- moveFocus(1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function enter(aria) {
+ aria = aria || {};
+ focusedControl.fire('click', {
+ target: focusedElement,
+ aria: aria
+ });
</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 up() {
- moveFocus(-1);
- }
- function down() {
- var role = getRole(), parentRole = getParentRole();
- if (role === 'menuitem' && parentRole === 'menubar') {
- enter();
- } else if (role === 'button' && getAriaProp('haspopup')) {
- enter({ key: 'down' });
- } else {
- moveFocus(1);
- }
- }
- function tab(e) {
- var parentRole = getParentRole();
- if (parentRole === 'tablist') {
- var elm = getFocusElements(focusedControl.getEl('body'))[0];
- if (elm) {
- elm.focus();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ root.on('keydown', function (e) {
+ function handleNonTabOrEscEvent(e, handler) {
+ if (isTextInputElement(focusedElement) || hasTabstopData(focusedElement)) {
+ return;
+ }
+ if (getRole(focusedElement) === 'slider') {
+ return;
+ }
+ if (handler(e) !== false) {
+ e.preventDefault();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- moveFocus(e.shiftKey ? -1 : 1);
- }
- }
- function cancel() {
- focusedControl.fire('cancel');
- }
- function enter(aria) {
- aria = aria || {};
- focusedControl.fire('click', {
- target: focusedElement,
- aria: aria
- });
- }
- root.on('keydown', function (e) {
- function handleNonTabOrEscEvent(e, handler) {
- if (isTextInputElement(focusedElement) || hasTabstopData(focusedElement)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (e.isDefaultPrevented()) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (getRole(focusedElement) === 'slider') {
- return;
- }
- if (handler(e) !== false) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ switch (e.keyCode) {
+ case 37:
+ handleNonTabOrEscEvent(e, left);
+ break;
+ case 39:
+ handleNonTabOrEscEvent(e, right);
+ break;
+ case 38:
+ handleNonTabOrEscEvent(e, up);
+ break;
+ case 40:
+ handleNonTabOrEscEvent(e, down);
+ break;
+ case 27:
+ cancel();
+ break;
+ case 14:
+ case 13:
+ case 32:
+ handleNonTabOrEscEvent(e, enter);
+ break;
+ case 9:
+ tab(e);
</ins><span class="cx" style="display: block; padding: 0 10px"> e.preventDefault();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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">- }
- if (e.isDefaultPrevented()) {
- return;
- }
- switch (e.keyCode) {
- case 37:
- handleNonTabOrEscEvent(e, left);
- break;
- case 39:
- handleNonTabOrEscEvent(e, right);
- break;
- case 38:
- handleNonTabOrEscEvent(e, up);
- break;
- case 40:
- handleNonTabOrEscEvent(e, down);
- break;
- case 27:
- cancel();
- break;
- case 14:
- case 13:
- case 32:
- handleNonTabOrEscEvent(e, enter);
- break;
- case 9:
- tab(e);
- e.preventDefault();
- break;
- }
- });
- root.on('focusin', function (e) {
- focusedElement = e.target;
- focusedControl = e.control;
- });
- return { focusFirst: focusFirst };
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ root.on('focusin', function (e) {
+ focusedElement = e.target;
+ focusedControl = e.control;
+ });
+ return { focusFirst: focusFirst };
+ }
</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 selectorCache = {};
- var Container = Control$1.extend({
- init: function (settings) {
- var self = this;
- self._super(settings);
- settings = self.settings;
- if (settings.fixed) {
- self.state.set('fixed', true);
- }
- self._items = new Collection$2();
- if (self.isRtl()) {
- self.classes.add('rtl');
- }
- self.bodyClasses = new ClassList(function () {
- if (self.state.get('rendered')) {
- self.getEl('body').className = this.toString();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var selectorCache = {};
+ var Container = Control$1.extend({
+ init: function (settings) {
+ var self = this;
+ self._super(settings);
+ settings = self.settings;
+ if (settings.fixed) {
+ self.state.set('fixed', 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">- });
- self.bodyClasses.prefix = self.classPrefix;
- self.classes.add('container');
- self.bodyClasses.add('container-body');
- if (settings.containerCls) {
- self.classes.add(settings.containerCls);
- }
- self._layout = global$4.create((settings.layout || '') + 'layout');
- if (self.settings.items) {
- self.add(self.settings.items);
- } else {
- self.add(self.render());
- }
- self._hasBody = true;
- },
- items: function () {
- return this._items;
- },
- find: function (selector) {
- selector = selectorCache[selector] = selectorCache[selector] || new Selector(selector);
- return selector.find(this);
- },
- add: function (items) {
- var self = this;
- self.items().add(self.create(items)).parent(self);
- return self;
- },
- focus: function (keyboard) {
- var self = this;
- var focusCtrl, keyboardNav, items;
- if (keyboard) {
- keyboardNav = self.keyboardNav || self.parents().eq(-1)[0].keyboardNav;
- if (keyboardNav) {
- keyboardNav.focusFirst(self);
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._items = new Collection$2();
+ if (self.isRtl()) {
+ self.classes.add('rtl');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- items = self.find('*');
- if (self.statusbar) {
- items.add(self.statusbar.items());
- }
- items.each(function (ctrl) {
- if (ctrl.settings.autofocus) {
- focusCtrl = null;
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.bodyClasses = new ClassList(function () {
+ if (self.state.get('rendered')) {
+ self.getEl('body').className = this.toString();
+ }
+ });
+ self.bodyClasses.prefix = self.classPrefix;
+ self.classes.add('container');
+ self.bodyClasses.add('container-body');
+ if (settings.containerCls) {
+ self.classes.add(settings.containerCls);
</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 (ctrl.canFocus) {
- focusCtrl = focusCtrl || ctrl;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._layout = global$4.create((settings.layout || '') + 'layout');
+ if (self.settings.items) {
+ self.add(self.settings.items);
+ } else {
+ self.add(self.render());
</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 (focusCtrl) {
- focusCtrl.focus();
- }
- return self;
- },
- replace: function (oldItem, newItem) {
- var ctrlElm;
- var items = this.items();
- var i = items.length;
- while (i--) {
- if (items[i] === oldItem) {
- items[i] = newItem;
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._hasBody = true;
+ },
+ items: function () {
+ return this._items;
+ },
+ find: function (selector) {
+ selector = selectorCache[selector] = selectorCache[selector] || new Selector(selector);
+ return selector.find(this);
+ },
+ add: function (items) {
+ var self = this;
+ self.items().add(self.create(items)).parent(self);
+ return self;
+ },
+ focus: function (keyboard) {
+ var self = this;
+ var focusCtrl, keyboardNav, items;
+ if (keyboard) {
+ keyboardNav = self.keyboardNav || self.parents().eq(-1)[0].keyboardNav;
+ if (keyboardNav) {
+ keyboardNav.focusFirst(self);
+ 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 (i >= 0) {
- ctrlElm = newItem.getEl();
- if (ctrlElm) {
- ctrlElm.parentNode.removeChild(ctrlElm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ items = self.find('*');
+ if (self.statusbar) {
+ items.add(self.statusbar.items());
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ctrlElm = oldItem.getEl();
- if (ctrlElm) {
- ctrlElm.parentNode.removeChild(ctrlElm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ items.each(function (ctrl) {
+ if (ctrl.settings.autofocus) {
+ focusCtrl = null;
+ return false;
+ }
+ if (ctrl.canFocus) {
+ focusCtrl = focusCtrl || ctrl;
+ }
+ });
+ if (focusCtrl) {
+ focusCtrl.focus();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- newItem.parent(this);
- },
- create: function (items) {
- var self = this;
- var settings;
- var ctrlItems = [];
- if (!global$2.isArray(items)) {
- items = [items];
- }
- global$2.each(items, function (item) {
- if (item) {
- if (!(item instanceof Control$1)) {
- if (typeof item === 'string') {
- item = { type: item };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self;
+ },
+ replace: function (oldItem, newItem) {
+ var ctrlElm;
+ var items = this.items();
+ var i = items.length;
+ while (i--) {
+ if (items[i] === oldItem) {
+ items[i] = newItem;
+ break;
+ }
+ }
+ if (i >= 0) {
+ ctrlElm = newItem.getEl();
+ if (ctrlElm) {
+ ctrlElm.parentNode.removeChild(ctrlElm);
+ }
+ ctrlElm = oldItem.getEl();
+ if (ctrlElm) {
+ ctrlElm.parentNode.removeChild(ctrlElm);
+ }
+ }
+ newItem.parent(this);
+ },
+ create: function (items) {
+ var self = this;
+ var settings;
+ var ctrlItems = [];
+ if (!global$2.isArray(items)) {
+ items = [items];
+ }
+ global$2.each(items, function (item) {
+ if (item) {
+ if (!(item instanceof Control$1)) {
+ if (typeof item === 'string') {
+ item = { type: item };
+ }
+ settings = global$2.extend({}, self.settings.defaults, item);
+ item.type = settings.type = settings.type || item.type || self.settings.defaultType || (settings.defaults ? settings.defaults.type : null);
+ item = global$4.create(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">- settings = global$2.extend({}, self.settings.defaults, item);
- item.type = settings.type = settings.type || item.type || self.settings.defaultType || (settings.defaults ? settings.defaults.type : null);
- item = global$4.create(settings);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ctrlItems.push(item);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ctrlItems.push(item);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ return ctrlItems;
+ },
+ renderNew: function () {
+ var self = this;
+ self.items().each(function (ctrl, index) {
+ var containerElm;
+ ctrl.parent(self);
+ if (!ctrl.state.get('rendered')) {
+ containerElm = self.getEl('body');
+ if (containerElm.hasChildNodes() && index <= containerElm.childNodes.length - 1) {
+ global$9(containerElm.childNodes[index]).before(ctrl.renderHtml());
+ } else {
+ global$9(containerElm).append(ctrl.renderHtml());
+ }
+ ctrl.postRender();
+ ReflowQueue.add(ctrl);
+ }
+ });
+ self._layout.applyClasses(self.items().filter(':visible'));
+ self._lastRect = null;
+ return self;
+ },
+ append: function (items) {
+ return this.add(items).renderNew();
+ },
+ prepend: function (items) {
+ var self = this;
+ self.items().set(self.create(items).concat(self.items().toArray()));
+ return self.renderNew();
+ },
+ insert: function (items, index, before) {
+ var self = this;
+ var curItems, beforeItems, afterItems;
+ items = self.create(items);
+ curItems = self.items();
+ if (!before && index < curItems.length - 1) {
+ index += 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 ctrlItems;
- },
- renderNew: function () {
- var self = this;
- self.items().each(function (ctrl, index) {
- var containerElm;
- ctrl.parent(self);
- if (!ctrl.state.get('rendered')) {
- containerElm = self.getEl('body');
- if (containerElm.hasChildNodes() && index <= containerElm.childNodes.length - 1) {
- global$9(containerElm.childNodes[index]).before(ctrl.renderHtml());
- } else {
- global$9(containerElm).append(ctrl.renderHtml());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (index >= 0 && index < curItems.length) {
+ beforeItems = curItems.slice(0, index).toArray();
+ afterItems = curItems.slice(index).toArray();
+ curItems.set(beforeItems.concat(items, afterItems));
+ }
+ return self.renderNew();
+ },
+ fromJSON: function (data) {
+ var self = this;
+ for (var name in data) {
+ self.find('#' + name).value(data[name]);
+ }
+ return self;
+ },
+ toJSON: function () {
+ var self = this, data = {};
+ self.find('*').each(function (ctrl) {
+ var name = ctrl.name(), value = ctrl.value();
+ if (name && typeof value !== 'undefined') {
+ data[name] = value;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ctrl.postRender();
- $_p42hyuxjjgwefrk.add(ctrl);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ return data;
+ },
+ renderHtml: function () {
+ var self = this, layout = self._layout, role = this.settings.role;
+ self.preRender();
+ layout.preRender(self);
+ return '<div id="' + self._id + '" class="' + self.classes + '"' + (role ? ' role="' + this.settings.role + '"' : '') + '>' + '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + (self.settings.html || '') + layout.renderHtml(self) + '</div>' + '</div>';
+ },
+ postRender: function () {
+ var self = this;
+ var box;
+ self.items().exec('postRender');
+ self._super();
+ self._layout.postRender(self);
+ self.state.set('rendered', true);
+ if (self.settings.style) {
+ self.$el.css(self.settings.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">- });
- self._layout.applyClasses(self.items().filter(':visible'));
- self._lastRect = null;
- return self;
- },
- append: function (items) {
- return this.add(items).renderNew();
- },
- prepend: function (items) {
- var self = this;
- self.items().set(self.create(items).concat(self.items().toArray()));
- return self.renderNew();
- },
- insert: function (items, index, before) {
- var self = this;
- var curItems, beforeItems, afterItems;
- items = self.create(items);
- curItems = self.items();
- if (!before && index < curItems.length - 1) {
- index += 1;
- }
- if (index >= 0 && index < curItems.length) {
- beforeItems = curItems.slice(0, index).toArray();
- afterItems = curItems.slice(index).toArray();
- curItems.set(beforeItems.concat(items, afterItems));
- }
- return self.renderNew();
- },
- fromJSON: function (data) {
- var self = this;
- for (var name in data) {
- self.find('#' + name).value(data[name]);
- }
- return self;
- },
- toJSON: function () {
- var self = this, data = {};
- self.find('*').each(function (ctrl) {
- var name = ctrl.name(), value = ctrl.value();
- if (name && typeof value !== 'undefined') {
- data[name] = value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self.settings.border) {
+ box = self.borderBox;
+ self.$el.css({
+ 'border-top-width': box.top,
+ 'border-right-width': box.right,
+ 'border-bottom-width': box.bottom,
+ 'border-left-width': box.left
+ });
</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 data;
- },
- renderHtml: function () {
- var self = this, layout = self._layout, role = this.settings.role;
- self.preRender();
- layout.preRender(self);
- return '<div id="' + self._id + '" class="' + self.classes + '"' + (role ? ' role="' + this.settings.role + '"' : '') + '>' + '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + (self.settings.html || '') + layout.renderHtml(self) + '</div>' + '</div>';
- },
- postRender: function () {
- var self = this;
- var box;
- self.items().exec('postRender');
- self._super();
- self._layout.postRender(self);
- self.state.set('rendered', true);
- if (self.settings.style) {
- self.$el.css(self.settings.style);
- }
- if (self.settings.border) {
- box = self.borderBox;
- self.$el.css({
- 'border-top-width': box.top,
- 'border-right-width': box.right,
- 'border-bottom-width': box.bottom,
- 'border-left-width': box.left
- });
- }
- if (!self.parent()) {
- self.keyboardNav = KeyboardNavigation({ root: self });
- }
- return self;
- },
- initLayoutRect: function () {
- var self = this, layoutRect = self._super();
- self._layout.recalc(self);
- return layoutRect;
- },
- recalc: function () {
- var self = this;
- var rect = self._layoutRect;
- var lastRect = self._lastRect;
- if (!lastRect || lastRect.w !== rect.w || lastRect.h !== rect.h) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!self.parent()) {
+ self.keyboardNav = KeyboardNavigation({ root: self });
+ }
+ return self;
+ },
+ initLayoutRect: function () {
+ var self = this, layoutRect = self._super();
</ins><span class="cx" style="display: block; padding: 0 10px"> self._layout.recalc(self);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- rect = self.layoutRect();
- self._lastRect = {
- x: rect.x,
- y: rect.y,
- w: rect.w,
- h: rect.h
- };
- return true;
- }
- },
- reflow: function () {
- var i;
- $_p42hyuxjjgwefrk.remove(this);
- if (this.visible()) {
- Control$1.repaintControls = [];
- Control$1.repaintControls.map = {};
- this.recalc();
- i = Control$1.repaintControls.length;
- while (i--) {
- Control$1.repaintControls[i].repaint();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return layoutRect;
+ },
+ recalc: function () {
+ var self = this;
+ var rect = self._layoutRect;
+ var lastRect = self._lastRect;
+ if (!lastRect || lastRect.w !== rect.w || lastRect.h !== rect.h) {
+ self._layout.recalc(self);
+ rect = self.layoutRect();
+ self._lastRect = {
+ x: rect.x,
+ y: rect.y,
+ w: rect.w,
+ h: rect.h
+ };
+ return true;
</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.settings.layout !== 'flow' && this.settings.layout !== 'stack') {
- this.repaint();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ reflow: function () {
+ var i;
+ ReflowQueue.remove(this);
+ if (this.visible()) {
+ Control$1.repaintControls = [];
+ Control$1.repaintControls.map = {};
+ this.recalc();
+ i = Control$1.repaintControls.length;
+ while (i--) {
+ Control$1.repaintControls[i].repaint();
+ }
+ if (this.settings.layout !== 'flow' && this.settings.layout !== 'stack') {
+ this.repaint();
+ }
+ Control$1.repaintControls = [];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- Control$1.repaintControls = [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- return this;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ function getDocumentSize(doc) {
+ var documentElement, body, scrollWidth, clientWidth;
+ var offsetWidth, scrollHeight, clientHeight, offsetHeight;
+ var max = Math.max;
+ documentElement = doc.documentElement;
+ body = doc.body;
+ scrollWidth = max(documentElement.scrollWidth, body.scrollWidth);
+ clientWidth = max(documentElement.clientWidth, body.clientWidth);
+ offsetWidth = max(documentElement.offsetWidth, body.offsetWidth);
+ scrollHeight = max(documentElement.scrollHeight, body.scrollHeight);
+ clientHeight = max(documentElement.clientHeight, body.clientHeight);
+ offsetHeight = max(documentElement.offsetHeight, body.offsetHeight);
+ return {
+ width: scrollWidth < offsetWidth ? clientWidth : scrollWidth,
+ height: scrollHeight < offsetHeight ? clientHeight : scrollHeight
+ };
</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 getDocumentSize(doc) {
- var documentElement, body, scrollWidth, clientWidth;
- var offsetWidth, scrollHeight, clientHeight, offsetHeight;
- var max = Math.max;
- documentElement = doc.documentElement;
- body = doc.body;
- scrollWidth = max(documentElement.scrollWidth, body.scrollWidth);
- clientWidth = max(documentElement.clientWidth, body.clientWidth);
- offsetWidth = max(documentElement.offsetWidth, body.offsetWidth);
- scrollHeight = max(documentElement.scrollHeight, body.scrollHeight);
- clientHeight = max(documentElement.clientHeight, body.clientHeight);
- offsetHeight = max(documentElement.offsetHeight, body.offsetHeight);
- return {
- width: scrollWidth < offsetWidth ? clientWidth : scrollWidth,
- height: scrollHeight < offsetHeight ? clientHeight : scrollHeight
- };
- }
- function updateWithTouchData(e) {
- var keys, i;
- if (e.changedTouches) {
- keys = 'screenX screenY pageX pageY clientX clientY'.split(' ');
- for (i = 0; i < keys.length; i++) {
- e[keys[i]] = e.changedTouches[0][keys[i]];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function updateWithTouchData(e) {
+ var keys, i;
+ if (e.changedTouches) {
+ keys = 'screenX screenY pageX pageY clientX clientY'.split(' ');
+ for (i = 0; i < keys.length; i++) {
+ e[keys[i]] = e.changedTouches[0][keys[i]];
+ }
</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">- }
- function DragHelper (id, settings) {
- var $eventOverlay;
- var doc = settings.document || document;
- var downButton;
- var start, stop$$1, drag, startX, startY;
- settings = settings || {};
- var handleElement = doc.getElementById(settings.handle || id);
- start = function (e) {
- var docSize = getDocumentSize(doc);
- var handleElm, cursor;
- updateWithTouchData(e);
- e.preventDefault();
- downButton = e.button;
- handleElm = handleElement;
- startX = e.screenX;
- startY = e.screenY;
- if (window.getComputedStyle) {
- cursor = window.getComputedStyle(handleElm, null).getPropertyValue('cursor');
- } else {
- cursor = handleElm.runtimeStyle.cursor;
- }
- $eventOverlay = global$9('<div></div>').css({
- position: 'absolute',
- top: 0,
- left: 0,
- width: docSize.width,
- height: docSize.height,
- zIndex: 2147483647,
- opacity: 0.0001,
- cursor: cursor
- }).appendTo(doc.body);
- global$9(doc).on('mousemove touchmove', drag).on('mouseup touchend', stop$$1);
- settings.start(e);
- };
- drag = function (e) {
- updateWithTouchData(e);
- if (e.button !== downButton) {
- return stop$$1(e);
- }
- e.deltaX = e.screenX - startX;
- e.deltaY = e.screenY - startY;
- e.preventDefault();
- settings.drag(e);
- };
- stop$$1 = function (e) {
- updateWithTouchData(e);
- global$9(doc).off('mousemove touchmove', drag).off('mouseup touchend', stop$$1);
- $eventOverlay.remove();
- if (settings.stop) {
- settings.stop(e);
- }
- };
- this.destroy = function () {
- global$9(handleElement).off();
- };
- global$9(handleElement).on('mousedown touchstart', start);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function DragHelper (id, settings) {
+ var $eventOverlay;
+ var doc = settings.document || document;
+ var downButton;
+ var start, stop$$1, drag, startX, startY;
+ settings = settings || {};
+ var handleElement = doc.getElementById(settings.handle || id);
+ start = function (e) {
+ var docSize = getDocumentSize(doc);
+ var handleElm, cursor;
+ updateWithTouchData(e);
+ e.preventDefault();
+ downButton = e.button;
+ handleElm = handleElement;
+ startX = e.screenX;
+ startY = e.screenY;
+ if (window.getComputedStyle) {
+ cursor = window.getComputedStyle(handleElm, null).getPropertyValue('cursor');
+ } else {
+ cursor = handleElm.runtimeStyle.cursor;
+ }
+ $eventOverlay = global$9('<div></div>').css({
+ position: 'absolute',
+ top: 0,
+ left: 0,
+ width: docSize.width,
+ height: docSize.height,
+ zIndex: 2147483647,
+ opacity: 0.0001,
+ cursor: cursor
+ }).appendTo(doc.body);
+ global$9(doc).on('mousemove touchmove', drag).on('mouseup touchend', stop$$1);
+ settings.start(e);
+ };
+ drag = function (e) {
+ updateWithTouchData(e);
+ if (e.button !== downButton) {
+ return stop$$1(e);
+ }
+ e.deltaX = e.screenX - startX;
+ e.deltaY = e.screenY - startY;
+ e.preventDefault();
+ settings.drag(e);
+ };
+ stop$$1 = function (e) {
+ updateWithTouchData(e);
+ global$9(doc).off('mousemove touchmove', drag).off('mouseup touchend', stop$$1);
+ $eventOverlay.remove();
+ if (settings.stop) {
+ settings.stop(e);
+ }
+ };
+ this.destroy = function () {
+ global$9(handleElement).off();
+ };
+ global$9(handleElement).on('mousedown touchstart', start);
+ }
</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 $_3rxloyuzjjgwefrs = {
- init: function () {
- var self = this;
- self.on('repaint', self.renderScroll);
- },
- renderScroll: function () {
- var self = this, margin = 2;
- function repaintScroll() {
- var hasScrollH, hasScrollV, bodyElm;
- function repaintAxis(axisName, posName, sizeName, contentSizeName, hasScroll, ax) {
- var containerElm, scrollBarElm, scrollThumbElm;
- var containerSize, scrollSize, ratio, rect;
- var posNameLower, sizeNameLower;
- scrollBarElm = self.getEl('scroll' + axisName);
- if (scrollBarElm) {
- posNameLower = posName.toLowerCase();
- sizeNameLower = sizeName.toLowerCase();
- global$9(self.getEl('absend')).css(posNameLower, self.layoutRect()[contentSizeName] - 1);
- if (!hasScroll) {
- global$9(scrollBarElm).css('display', 'none');
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Scrollable = {
+ init: function () {
+ var self = this;
+ self.on('repaint', self.renderScroll);
+ },
+ renderScroll: function () {
+ var self = this, margin = 2;
+ function repaintScroll() {
+ var hasScrollH, hasScrollV, bodyElm;
+ function repaintAxis(axisName, posName, sizeName, contentSizeName, hasScroll, ax) {
+ var containerElm, scrollBarElm, scrollThumbElm;
+ var containerSize, scrollSize, ratio, rect;
+ var posNameLower, sizeNameLower;
+ scrollBarElm = self.getEl('scroll' + axisName);
+ if (scrollBarElm) {
+ posNameLower = posName.toLowerCase();
+ sizeNameLower = sizeName.toLowerCase();
+ global$9(self.getEl('absend')).css(posNameLower, self.layoutRect()[contentSizeName] - 1);
+ if (!hasScroll) {
+ global$9(scrollBarElm).css('display', 'none');
+ return;
+ }
+ global$9(scrollBarElm).css('display', 'block');
+ containerElm = self.getEl('body');
+ scrollThumbElm = self.getEl('scroll' + axisName + 't');
+ containerSize = containerElm['client' + sizeName] - margin * 2;
+ containerSize -= hasScrollH && hasScrollV ? scrollBarElm['client' + ax] : 0;
+ scrollSize = containerElm['scroll' + sizeName];
+ ratio = containerSize / scrollSize;
+ rect = {};
+ rect[posNameLower] = containerElm['offset' + posName] + margin;
+ rect[sizeNameLower] = containerSize;
+ global$9(scrollBarElm).css(rect);
+ rect = {};
+ rect[posNameLower] = containerElm['scroll' + posName] * ratio;
+ rect[sizeNameLower] = containerSize * ratio;
+ global$9(scrollThumbElm).css(rect);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global$9(scrollBarElm).css('display', 'block');
- containerElm = self.getEl('body');
- scrollThumbElm = self.getEl('scroll' + axisName + 't');
- containerSize = containerElm['client' + sizeName] - margin * 2;
- containerSize -= hasScrollH && hasScrollV ? scrollBarElm['client' + ax] : 0;
- scrollSize = containerElm['scroll' + sizeName];
- ratio = containerSize / scrollSize;
- rect = {};
- rect[posNameLower] = containerElm['offset' + posName] + margin;
- rect[sizeNameLower] = containerSize;
- global$9(scrollBarElm).css(rect);
- rect = {};
- rect[posNameLower] = containerElm['scroll' + posName] * ratio;
- rect[sizeNameLower] = containerSize * ratio;
- global$9(scrollThumbElm).css(rect);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ bodyElm = self.getEl('body');
+ hasScrollH = bodyElm.scrollWidth > bodyElm.clientWidth;
+ hasScrollV = bodyElm.scrollHeight > bodyElm.clientHeight;
+ repaintAxis('h', 'Left', 'Width', 'contentW', hasScrollH, 'Height');
+ repaintAxis('v', 'Top', 'Height', 'contentH', hasScrollV, 'Width');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- bodyElm = self.getEl('body');
- hasScrollH = bodyElm.scrollWidth > bodyElm.clientWidth;
- hasScrollV = bodyElm.scrollHeight > bodyElm.clientHeight;
- repaintAxis('h', 'Left', 'Width', 'contentW', hasScrollH, 'Height');
- repaintAxis('v', 'Top', 'Height', 'contentH', hasScrollV, 'Width');
- }
- function addScroll() {
- function addScrollAxis(axisName, posName, sizeName, deltaPosName, ax) {
- var scrollStart;
- var axisId = self._id + '-scroll' + axisName, prefix = self.classPrefix;
- global$9(self.getEl()).append('<div id="' + axisId + '" class="' + prefix + 'scrollbar ' + prefix + 'scrollbar-' + axisName + '">' + '<div id="' + axisId + 't" class="' + prefix + 'scrollbar-thumb"></div>' + '</div>');
- self.draghelper = new DragHelper(axisId + 't', {
- start: function () {
- scrollStart = self.getEl('body')['scroll' + posName];
- global$9('#' + axisId).addClass(prefix + 'active');
- },
- drag: function (e) {
- var ratio, hasScrollH, hasScrollV, containerSize;
- var layoutRect = self.layoutRect();
- hasScrollH = layoutRect.contentW > layoutRect.innerW;
- hasScrollV = layoutRect.contentH > layoutRect.innerH;
- containerSize = self.getEl('body')['client' + sizeName] - margin * 2;
- containerSize -= hasScrollH && hasScrollV ? self.getEl('scroll' + axisName)['client' + ax] : 0;
- ratio = containerSize / self.getEl('body')['scroll' + sizeName];
- self.getEl('body')['scroll' + posName] = scrollStart + e['delta' + deltaPosName] / ratio;
- },
- stop: function () {
- global$9('#' + axisId).removeClass(prefix + 'active');
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function addScroll() {
+ function addScrollAxis(axisName, posName, sizeName, deltaPosName, ax) {
+ var scrollStart;
+ var axisId = self._id + '-scroll' + axisName, prefix = self.classPrefix;
+ global$9(self.getEl()).append('<div id="' + axisId + '" class="' + prefix + 'scrollbar ' + prefix + 'scrollbar-' + axisName + '">' + '<div id="' + axisId + 't" class="' + prefix + 'scrollbar-thumb"></div>' + '</div>');
+ self.draghelper = new DragHelper(axisId + 't', {
+ start: function () {
+ scrollStart = self.getEl('body')['scroll' + posName];
+ global$9('#' + axisId).addClass(prefix + 'active');
+ },
+ drag: function (e) {
+ var ratio, hasScrollH, hasScrollV, containerSize;
+ var layoutRect = self.layoutRect();
+ hasScrollH = layoutRect.contentW > layoutRect.innerW;
+ hasScrollV = layoutRect.contentH > layoutRect.innerH;
+ containerSize = self.getEl('body')['client' + sizeName] - margin * 2;
+ containerSize -= hasScrollH && hasScrollV ? self.getEl('scroll' + axisName)['client' + ax] : 0;
+ ratio = containerSize / self.getEl('body')['scroll' + sizeName];
+ self.getEl('body')['scroll' + posName] = scrollStart + e['delta' + deltaPosName] / ratio;
+ },
+ stop: function () {
+ global$9('#' + axisId).removeClass(prefix + 'active');
+ }
+ });
+ }
+ self.classes.add('scroll');
+ addScrollAxis('v', 'Top', 'Height', 'Y', 'Width');
+ addScrollAxis('h', 'Left', 'Width', 'X', '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">- self.classes.add('scroll');
- addScrollAxis('v', 'Top', 'Height', 'Y', 'Width');
- addScrollAxis('h', 'Left', 'Width', 'X', 'Height');
- }
- if (self.settings.autoScroll) {
- if (!self._hasScroll) {
- self._hasScroll = true;
- addScroll();
- self.on('wheel', function (e) {
- var bodyEl = self.getEl('body');
- bodyEl.scrollLeft += (e.deltaX || 0) * 10;
- bodyEl.scrollTop += e.deltaY * 10;
- repaintScroll();
- });
- global$9(self.getEl('body')).on('scroll', repaintScroll);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self.settings.autoScroll) {
+ if (!self._hasScroll) {
+ self._hasScroll = true;
+ addScroll();
+ self.on('wheel', function (e) {
+ var bodyEl = self.getEl('body');
+ bodyEl.scrollLeft += (e.deltaX || 0) * 10;
+ bodyEl.scrollTop += e.deltaY * 10;
+ repaintScroll();
+ });
+ global$9(self.getEl('body')).on('scroll', repaintScroll);
+ }
+ repaintScroll();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- repaintScroll();
</del><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">+ };
</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 Panel = Container.extend({
- Defaults: {
- layout: 'fit',
- containerCls: 'panel'
- },
- Mixins: [$_3rxloyuzjjgwefrs],
- renderHtml: function () {
- var self = this;
- var layout = self._layout;
- var innerHtml = self.settings.html;
- self.preRender();
- layout.preRender(self);
- if (typeof innerHtml === 'undefined') {
- innerHtml = '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + layout.renderHtml(self) + '</div>';
- } else {
- if (typeof innerHtml === 'function') {
- innerHtml = innerHtml.call(self);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Panel = Container.extend({
+ Defaults: {
+ layout: 'fit',
+ containerCls: 'panel'
+ },
+ Mixins: [Scrollable],
+ renderHtml: function () {
+ var self = this;
+ var layout = self._layout;
+ var innerHtml = self.settings.html;
+ self.preRender();
+ layout.preRender(self);
+ if (typeof innerHtml === 'undefined') {
+ innerHtml = '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + layout.renderHtml(self) + '</div>';
+ } else {
+ if (typeof innerHtml === 'function') {
+ innerHtml = innerHtml.call(self);
+ }
+ self._hasBody = 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">- self._hasBody = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return '<div id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1" role="group">' + (self._preBodyHtml || '') + innerHtml + '</div>';
</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 '<div id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1" role="group">' + (self._preBodyHtml || '') + innerHtml + '</div>';
- }
- });
</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">- var $_3m7770v1jjgwefrz = {
- resizeToContent: function () {
- this._layoutRect.autoResize = true;
- this._lastRect = null;
- this.reflow();
- },
- resizeTo: function (w, h) {
- if (w <= 1 || h <= 1) {
- var rect = funcs.getWindowSize();
- w = w <= 1 ? w * rect.w : w;
- h = h <= 1 ? h * rect.h : h;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Resizable = {
+ resizeToContent: function () {
+ this._layoutRect.autoResize = true;
+ this._lastRect = null;
+ this.reflow();
+ },
+ resizeTo: function (w, h) {
+ if (w <= 1 || h <= 1) {
+ var rect = funcs.getWindowSize();
+ w = w <= 1 ? w * rect.w : w;
+ h = h <= 1 ? h * rect.h : h;
+ }
+ this._layoutRect.autoResize = false;
+ return this.layoutRect({
+ minW: w,
+ minH: h,
+ w: w,
+ h: h
+ }).reflow();
+ },
+ resizeBy: function (dw, dh) {
+ var self = this, rect = self.layoutRect();
+ return self.resizeTo(rect.w + dw, rect.h + dh);
</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._layoutRect.autoResize = false;
- return this.layoutRect({
- minW: w,
- minH: h,
- w: w,
- h: h
- }).reflow();
- },
- resizeBy: function (dw, dh) {
- var self = this, rect = self.layoutRect();
- return self.resizeTo(rect.w + dw, rect.h + dh);
- }
- };
</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">- var documentClickHandler;
- var documentScrollHandler;
- var windowResizeHandler;
- var visiblePanels = [];
- var zOrder = [];
- var hasModal;
- function isChildOf(ctrl, parent$$1) {
- while (ctrl) {
- if (ctrl === parent$$1) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var documentClickHandler, documentScrollHandler, windowResizeHandler;
+ var visiblePanels = [];
+ var zOrder = [];
+ var hasModal;
+ function isChildOf(ctrl, parent$$1) {
+ while (ctrl) {
+ if (ctrl === parent$$1) {
+ return true;
+ }
+ ctrl = ctrl.parent();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ctrl = ctrl.parent();
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- function skipOrHidePanels(e) {
- var i = visiblePanels.length;
- while (i--) {
- var panel = visiblePanels[i], clickCtrl = panel.getParentCtrl(e.target);
- if (panel.settings.autohide) {
- if (clickCtrl) {
- if (isChildOf(clickCtrl, panel) || panel.parent() === clickCtrl) {
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function skipOrHidePanels(e) {
+ var i = visiblePanels.length;
+ while (i--) {
+ var panel = visiblePanels[i], clickCtrl = panel.getParentCtrl(e.target);
+ if (panel.settings.autohide) {
+ if (clickCtrl) {
+ if (isChildOf(clickCtrl, panel) || panel.parent() === clickCtrl) {
+ continue;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ e = panel.fire('autohide', { target: e.target });
+ if (!e.isDefaultPrevented()) {
+ panel.hide();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- e = panel.fire('autohide', { target: e.target });
- if (!e.isDefaultPrevented()) {
- panel.hide();
- }
</del><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">- }
- function bindDocumentClickHandler() {
- if (!documentClickHandler) {
- documentClickHandler = function (e) {
- if (e.button === 2) {
- return;
- }
- skipOrHidePanels(e);
- };
- global$9(document).on('click touchstart', documentClickHandler);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function bindDocumentClickHandler() {
+ if (!documentClickHandler) {
+ documentClickHandler = function (e) {
+ if (e.button === 2) {
+ return;
+ }
+ skipOrHidePanels(e);
+ };
+ global$9(document).on('click touchstart', documentClickHandler);
+ }
</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 bindDocumentScrollHandler() {
- if (!documentScrollHandler) {
- documentScrollHandler = function () {
- var i;
- i = visiblePanels.length;
- while (i--) {
- repositionPanel(visiblePanels[i]);
- }
- };
- global$9(window).on('scroll', documentScrollHandler);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function bindDocumentScrollHandler() {
+ if (!documentScrollHandler) {
+ documentScrollHandler = function () {
+ var i;
+ i = visiblePanels.length;
+ while (i--) {
+ repositionPanel(visiblePanels[i]);
+ }
+ };
+ global$9(window).on('scroll', documentScrollHandler);
+ }
</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 bindWindowResizeHandler() {
- if (!windowResizeHandler) {
- var docElm_1 = document.documentElement;
- var clientWidth_1 = docElm_1.clientWidth, clientHeight_1 = docElm_1.clientHeight;
- windowResizeHandler = function () {
- if (!document.all || clientWidth_1 !== docElm_1.clientWidth || clientHeight_1 !== docElm_1.clientHeight) {
- clientWidth_1 = docElm_1.clientWidth;
- clientHeight_1 = docElm_1.clientHeight;
- FloatPanel.hideAll();
- }
- };
- global$9(window).on('resize', windowResizeHandler);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function bindWindowResizeHandler() {
+ if (!windowResizeHandler) {
+ var docElm_1 = document.documentElement;
+ var clientWidth_1 = docElm_1.clientWidth, clientHeight_1 = docElm_1.clientHeight;
+ windowResizeHandler = function () {
+ if (!document.all || clientWidth_1 !== docElm_1.clientWidth || clientHeight_1 !== docElm_1.clientHeight) {
+ clientWidth_1 = docElm_1.clientWidth;
+ clientHeight_1 = docElm_1.clientHeight;
+ FloatPanel.hideAll();
+ }
+ };
+ global$9(window).on('resize', windowResizeHandler);
+ }
</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 repositionPanel(panel) {
- var scrollY$$1 = funcs.getViewPort().y;
- function toggleFixedChildPanels(fixed, deltaY) {
- var parent$$1;
- for (var i = 0; i < visiblePanels.length; i++) {
- if (visiblePanels[i] !== panel) {
- parent$$1 = visiblePanels[i].parent();
- while (parent$$1 && (parent$$1 = parent$$1.parent())) {
- if (parent$$1 === panel) {
- visiblePanels[i].fixed(fixed).moveBy(0, deltaY).repaint();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function repositionPanel(panel) {
+ var scrollY$$1 = funcs.getViewPort().y;
+ function toggleFixedChildPanels(fixed, deltaY) {
+ var parent$$1;
+ for (var i = 0; i < visiblePanels.length; i++) {
+ if (visiblePanels[i] !== panel) {
+ parent$$1 = visiblePanels[i].parent();
+ while (parent$$1 && (parent$$1 = parent$$1.parent())) {
+ if (parent$$1 === panel) {
+ visiblePanels[i].fixed(fixed).moveBy(0, deltaY).repaint();
+ }
</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="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (panel.settings.autofix) {
- if (!panel.state.get('fixed')) {
- panel._autoFixY = panel.layoutRect().y;
- if (panel._autoFixY < scrollY$$1) {
- panel.fixed(true).layoutRect({ y: 0 }).repaint();
- toggleFixedChildPanels(true, scrollY$$1 - panel._autoFixY);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (panel.settings.autofix) {
+ if (!panel.state.get('fixed')) {
+ panel._autoFixY = panel.layoutRect().y;
+ if (panel._autoFixY < scrollY$$1) {
+ panel.fixed(true).layoutRect({ y: 0 }).repaint();
+ toggleFixedChildPanels(true, scrollY$$1 - panel._autoFixY);
+ }
+ } else {
+ if (panel._autoFixY > scrollY$$1) {
+ panel.fixed(false).layoutRect({ y: panel._autoFixY }).repaint();
+ toggleFixedChildPanels(false, panel._autoFixY - scrollY$$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">- } else {
- if (panel._autoFixY > scrollY$$1) {
- panel.fixed(false).layoutRect({ y: panel._autoFixY }).repaint();
- toggleFixedChildPanels(false, panel._autoFixY - scrollY$$1);
- }
</del><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">- }
- function addRemove(add, ctrl) {
- var i, zIndex = FloatPanel.zIndex || 65535, topModal;
- if (add) {
- zOrder.push(ctrl);
- } else {
- i = zOrder.length;
- while (i--) {
- if (zOrder[i] === ctrl) {
- zOrder.splice(i, 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function addRemove(add, ctrl) {
+ var i, zIndex = FloatPanel.zIndex || 65535, topModal;
+ if (add) {
+ zOrder.push(ctrl);
+ } else {
+ i = zOrder.length;
+ while (i--) {
+ if (zOrder[i] === ctrl) {
+ zOrder.splice(i, 1);
+ }
</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">- }
- if (zOrder.length) {
- for (i = 0; i < zOrder.length; i++) {
- if (zOrder[i].modal) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (zOrder.length) {
+ for (i = 0; i < zOrder.length; i++) {
+ if (zOrder[i].modal) {
+ zIndex++;
+ topModal = zOrder[i];
+ }
+ zOrder[i].getEl().style.zIndex = zIndex;
+ zOrder[i].zIndex = zIndex;
</ins><span class="cx" style="display: block; padding: 0 10px"> zIndex++;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- topModal = zOrder[i];
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- zOrder[i].getEl().style.zIndex = zIndex;
- zOrder[i].zIndex = zIndex;
- zIndex++;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var modalBlockEl = global$9('#' + ctrl.classPrefix + 'modal-block', ctrl.getContainerElm())[0];
+ if (topModal) {
+ global$9(modalBlockEl).css('z-index', topModal.zIndex - 1);
+ } else if (modalBlockEl) {
+ modalBlockEl.parentNode.removeChild(modalBlockEl);
+ hasModal = false;
+ }
+ FloatPanel.currentZIndex = zIndex;
</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 modalBlockEl = global$9('#' + ctrl.classPrefix + 'modal-block', ctrl.getContainerElm())[0];
- if (topModal) {
- global$9(modalBlockEl).css('z-index', topModal.zIndex - 1);
- } else if (modalBlockEl) {
- modalBlockEl.parentNode.removeChild(modalBlockEl);
- hasModal = false;
- }
- FloatPanel.currentZIndex = zIndex;
- }
- var FloatPanel = Panel.extend({
- Mixins: [
- $_3fnh5iukjjgwefpt,
- $_3m7770v1jjgwefrz
- ],
- init: function (settings) {
- var self$$1 = this;
- self$$1._super(settings);
- self$$1._eventsRoot = self$$1;
- self$$1.classes.add('floatpanel');
- if (settings.autohide) {
- bindDocumentClickHandler();
- bindWindowResizeHandler();
- visiblePanels.push(self$$1);
- }
- if (settings.autofix) {
- bindDocumentScrollHandler();
- self$$1.on('move', function () {
- repositionPanel(this);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var FloatPanel = Panel.extend({
+ Mixins: [
+ Movable,
+ Resizable
+ ],
+ init: function (settings) {
+ var self$$1 = this;
+ self$$1._super(settings);
+ self$$1._eventsRoot = self$$1;
+ self$$1.classes.add('floatpanel');
+ if (settings.autohide) {
+ bindDocumentClickHandler();
+ bindWindowResizeHandler();
+ visiblePanels.push(self$$1);
+ }
+ if (settings.autofix) {
+ bindDocumentScrollHandler();
+ self$$1.on('move', function () {
+ repositionPanel(this);
+ });
+ }
+ self$$1.on('postrender show', function (e) {
+ if (e.control === self$$1) {
+ var $modalBlockEl_1;
+ var prefix_1 = self$$1.classPrefix;
+ if (self$$1.modal && !hasModal) {
+ $modalBlockEl_1 = global$9('#' + prefix_1 + 'modal-block', self$$1.getContainerElm());
+ if (!$modalBlockEl_1[0]) {
+ $modalBlockEl_1 = global$9('<div id="' + prefix_1 + 'modal-block" class="' + prefix_1 + 'reset ' + prefix_1 + 'fade"></div>').appendTo(self$$1.getContainerElm());
+ }
+ global$7.setTimeout(function () {
+ $modalBlockEl_1.addClass(prefix_1 + 'in');
+ global$9(self$$1.getEl()).addClass(prefix_1 + 'in');
+ });
+ hasModal = true;
+ }
+ addRemove(true, self$$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">- }
- self$$1.on('postrender show', function (e) {
- if (e.control === self$$1) {
- var $modalBlockEl_1;
- var prefix_1 = self$$1.classPrefix;
- if (self$$1.modal && !hasModal) {
- $modalBlockEl_1 = global$9('#' + prefix_1 + 'modal-block', self$$1.getContainerElm());
- if (!$modalBlockEl_1[0]) {
- $modalBlockEl_1 = global$9('<div id="' + prefix_1 + 'modal-block" class="' + prefix_1 + 'reset ' + prefix_1 + 'fade"></div>').appendTo(self$$1.getContainerElm());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.on('show', function () {
+ self$$1.parents().each(function (ctrl) {
+ if (ctrl.state.get('fixed')) {
+ self$$1.fixed(true);
+ 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">- global$7.setTimeout(function () {
- $modalBlockEl_1.addClass(prefix_1 + 'in');
- global$9(self$$1.getEl()).addClass(prefix_1 + 'in');
- });
- hasModal = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ });
+ if (settings.popover) {
+ self$$1._preBodyHtml = '<div class="' + self$$1.classPrefix + 'arrow"></div>';
+ self$$1.classes.add('popover').add('bottom').add(self$$1.isRtl() ? 'end' : 'start');
+ }
+ self$$1.aria('label', settings.ariaLabel);
+ self$$1.aria('labelledby', self$$1._id);
+ self$$1.aria('describedby', self$$1.describedBy || self$$1._id + '-none');
+ },
+ fixed: function (state) {
+ var self$$1 = this;
+ if (self$$1.state.get('fixed') !== state) {
+ if (self$$1.state.get('rendered')) {
+ var viewport = funcs.getViewPort();
+ if (state) {
+ self$$1.layoutRect().y -= viewport.y;
+ } else {
+ self$$1.layoutRect().y += viewport.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">- addRemove(true, self$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.classes.toggle('fixed', state);
+ self$$1.state.set('fixed', 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">- });
- self$$1.on('show', function () {
- self$$1.parents().each(function (ctrl) {
- if (ctrl.state.get('fixed')) {
- self$$1.fixed(true);
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$1;
+ },
+ show: function () {
+ var self$$1 = this;
+ var i;
+ var state = self$$1._super();
+ i = visiblePanels.length;
+ while (i--) {
+ if (visiblePanels[i] === self$$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">- });
- });
- if (settings.popover) {
- self$$1._preBodyHtml = '<div class="' + self$$1.classPrefix + 'arrow"></div>';
- self$$1.classes.add('popover').add('bottom').add(self$$1.isRtl() ? 'end' : 'start');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (i === -1) {
+ visiblePanels.push(self$$1);
+ }
+ return state;
+ },
+ hide: function () {
+ removeVisiblePanel(this);
+ addRemove(false, this);
+ return this._super();
+ },
+ hideAll: function () {
+ FloatPanel.hideAll();
+ },
+ close: function () {
+ var self$$1 = this;
+ if (!self$$1.fire('close').isDefaultPrevented()) {
+ self$$1.remove();
+ addRemove(false, self$$1);
+ }
+ return self$$1;
+ },
+ remove: function () {
+ removeVisiblePanel(this);
+ this._super();
+ },
+ postRender: function () {
+ var self$$1 = this;
+ if (self$$1.settings.bodyRole) {
+ this.getEl('body').setAttribute('role', self$$1.settings.bodyRole);
+ }
+ return self$$1._super();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.aria('label', settings.ariaLabel);
- self$$1.aria('labelledby', self$$1._id);
- self$$1.aria('describedby', self$$1.describedBy || self$$1._id + '-none');
- },
- fixed: function (state) {
- var self$$1 = this;
- if (self$$1.state.get('fixed') !== state) {
- if (self$$1.state.get('rendered')) {
- var viewport = funcs.getViewPort();
- if (state) {
- self$$1.layoutRect().y -= viewport.y;
- } else {
- self$$1.layoutRect().y += viewport.y;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ FloatPanel.hideAll = function () {
+ var i = visiblePanels.length;
+ while (i--) {
+ var panel = visiblePanels[i];
+ if (panel && panel.settings.autohide) {
+ panel.hide();
+ visiblePanels.splice(i, 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">- self$$1.classes.toggle('fixed', state);
- self$$1.state.set('fixed', state);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return self$$1;
- },
- show: function () {
- var self$$1 = this;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ function removeVisiblePanel(panel) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var i;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var state = self$$1._super();
</del><span class="cx" style="display: block; padding: 0 10px"> i = visiblePanels.length;
</span><span class="cx" style="display: block; padding: 0 10px"> while (i--) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (visiblePanels[i] === self$$1) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (visiblePanels[i] === panel) {
+ visiblePanels.splice(i, 1);
</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">- if (i === -1) {
- visiblePanels.push(self$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ i = zOrder.length;
+ while (i--) {
+ if (zOrder[i] === panel) {
+ zOrder.splice(i, 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 state;
- },
- hide: function () {
- removeVisiblePanel(this);
- addRemove(false, this);
- return this._super();
- },
- hideAll: function () {
- FloatPanel.hideAll();
- },
- close: function () {
- var self$$1 = this;
- if (!self$$1.fire('close').isDefaultPrevented()) {
- self$$1.remove();
- addRemove(false, self$$1);
- }
- return self$$1;
- },
- remove: function () {
- removeVisiblePanel(this);
- this._super();
- },
- postRender: function () {
- var self$$1 = this;
- if (self$$1.settings.bodyRole) {
- this.getEl('body').setAttribute('role', self$$1.settings.bodyRole);
- }
- return self$$1._super();
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- FloatPanel.hideAll = function () {
- var i = visiblePanels.length;
- while (i--) {
- var panel = visiblePanels[i];
- if (panel && panel.settings.autohide) {
- panel.hide();
- visiblePanels.splice(i, 1);
- }
- }
- };
- function removeVisiblePanel(panel) {
- var i;
- i = visiblePanels.length;
- while (i--) {
- if (visiblePanels[i] === panel) {
- visiblePanels.splice(i, 1);
- }
- }
- i = zOrder.length;
- while (i--) {
- if (zOrder[i] === panel) {
- zOrder.splice(i, 1);
- }
- }
- }
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var isFixed$1 = function (inlineToolbarContainer, editor) {
- return !!(inlineToolbarContainer && !editor.settings.ui_container);
- };
- var render$1 = function (editor, theme, args) {
- var panel, inlineToolbarContainer;
- var DOM = global$3.DOM;
- var fixedToolbarContainer = getFixedToolbarContainer(editor);
- if (fixedToolbarContainer) {
- inlineToolbarContainer = DOM.select(fixedToolbarContainer)[0];
- }
- var reposition = function () {
- if (panel && panel.moveRel && panel.visible() && !panel._fixed) {
- var scrollContainer = editor.selection.getScrollContainer(), body = editor.getBody();
- var deltaX = 0, deltaY = 0;
- if (scrollContainer) {
- var bodyPos = DOM.getPos(body), scrollContainerPos = DOM.getPos(scrollContainer);
- deltaX = Math.max(0, scrollContainerPos.x - bodyPos.x);
- deltaY = Math.max(0, scrollContainerPos.y - bodyPos.y);
- }
- panel.fixed(false).moveRel(body, editor.rtl ? [
- 'tr-br',
- 'br-tr'
- ] : [
- 'tl-bl',
- 'bl-tl',
- 'tr-br'
- ]).moveBy(deltaX, deltaY);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isFixed$1 = function (inlineToolbarContainer, editor) {
+ return !!(inlineToolbarContainer && !editor.settings.ui_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 show = function () {
- if (panel) {
- panel.show();
- reposition();
- DOM.addClass(editor.getBody(), 'mce-edit-focus');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var render$1 = function (editor, theme, args) {
+ var panel, inlineToolbarContainer;
+ var DOM = global$3.DOM;
+ var fixedToolbarContainer = getFixedToolbarContainer(editor);
+ if (fixedToolbarContainer) {
+ inlineToolbarContainer = DOM.select(fixedToolbarContainer)[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">- };
- var hide = function () {
- if (panel) {
- panel.hide();
- FloatPanel.hideAll();
- DOM.removeClass(editor.getBody(), 'mce-edit-focus');
- }
- };
- var render = function () {
- if (panel) {
- if (!panel.visible()) {
- show();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var reposition = function () {
+ if (panel && panel.moveRel && panel.visible() && !panel._fixed) {
+ var scrollContainer = editor.selection.getScrollContainer(), body = editor.getBody();
+ var deltaX = 0, deltaY = 0;
+ if (scrollContainer) {
+ var bodyPos = DOM.getPos(body), scrollContainerPos = DOM.getPos(scrollContainer);
+ deltaX = Math.max(0, scrollContainerPos.x - bodyPos.x);
+ deltaY = Math.max(0, scrollContainerPos.y - bodyPos.y);
+ }
+ panel.fixed(false).moveRel(body, editor.rtl ? [
+ 'tr-br',
+ 'br-tr'
+ ] : [
+ 'tl-bl',
+ 'bl-tl',
+ 'tr-br'
+ ]).moveBy(deltaX, deltaY);
</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;
- }
- panel = theme.panel = global$4.create({
- type: inlineToolbarContainer ? 'panel' : 'floatpanel',
- role: 'application',
- classes: 'tinymce tinymce-inline',
- layout: 'flex',
- direction: 'column',
- align: 'stretch',
- autohide: false,
- autofix: isFixed$1(inlineToolbarContainer, editor),
- fixed: isFixed$1(inlineToolbarContainer, editor),
- border: 1,
- items: [
- hasMenubar(editor) === false ? null : {
- type: 'menubar',
- border: '0 0 1 0',
- items: $_bahgsqu8jjgwefo4.createMenuButtons(editor)
- },
- $_4udolhu7jjgwefo1.createToolbars(editor, getToolbarSize(editor))
- ]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var show = function () {
+ if (panel) {
+ panel.show();
+ reposition();
+ DOM.addClass(editor.getBody(), 'mce-edit-focus');
+ }
+ };
+ var hide = function () {
+ if (panel) {
+ panel.hide();
+ FloatPanel.hideAll();
+ DOM.removeClass(editor.getBody(), 'mce-edit-focus');
+ }
+ };
+ var render = function () {
+ if (panel) {
+ if (!panel.visible()) {
+ show();
+ }
+ return;
+ }
+ panel = theme.panel = global$4.create({
+ type: inlineToolbarContainer ? 'panel' : 'floatpanel',
+ role: 'application',
+ classes: 'tinymce tinymce-inline',
+ layout: 'flex',
+ direction: 'column',
+ align: 'stretch',
+ autohide: false,
+ autofix: true,
+ fixed: isFixed$1(inlineToolbarContainer, editor),
+ border: 1,
+ items: [
+ hasMenubar(editor) === false ? null : {
+ type: 'menubar',
+ border: '0 0 1 0',
+ items: Menubar.createMenuButtons(editor)
+ },
+ Toolbar.createToolbars(editor, getToolbarSize(editor))
+ ]
+ });
+ UiContainer.setUiContainer(editor, panel);
+ Events.fireBeforeRenderUI(editor);
+ if (inlineToolbarContainer) {
+ panel.renderTo(inlineToolbarContainer).reflow();
+ } else {
+ panel.renderTo().reflow();
+ }
+ A11y.addKeys(editor, panel);
+ show();
+ ContextToolbars.addContextualToolbars(editor);
+ editor.on('nodeChange', reposition);
+ editor.on('ResizeWindow', reposition);
+ editor.on('activate', show);
+ editor.on('deactivate', hide);
+ editor.nodeChanged();
+ };
+ editor.settings.content_editable = true;
+ editor.on('focus', function () {
+ if (isSkinDisabled(editor) === false && args.skinUiCss) {
+ DOM.styleSheetLoader.load(args.skinUiCss, render, render);
+ } else {
+ render();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_6344qfu4jjgwefnr.setUiContainer(editor, panel);
- $_5hpmustzjjgwefnb.fireBeforeRenderUI(editor);
- if (inlineToolbarContainer) {
- panel.renderTo(inlineToolbarContainer).reflow();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('blur hide', hide);
+ editor.on('remove', function () {
+ if (panel) {
+ panel.remove();
+ panel = null;
+ }
+ });
+ if (isSkinDisabled(editor) === false && args.skinUiCss) {
+ DOM.styleSheetLoader.load(args.skinUiCss, SkinLoaded.fireSkinLoaded(editor));
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- panel.renderTo().reflow();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ SkinLoaded.fireSkinLoaded(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">- $_azwbz4u0jjgwefnc.addKeys(editor, panel);
- show();
- $_g1gegqu1jjgwefne.addContextualToolbars(editor);
- editor.on('nodeChange', reposition);
- editor.on('ResizeWindow', reposition);
- editor.on('activate', show);
- editor.on('deactivate', hide);
- editor.nodeChanged();
</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">- editor.settings.content_editable = true;
- editor.on('focus', function () {
- if (isSkinDisabled(editor) === false && args.skinUiCss) {
- DOM.styleSheetLoader.load(args.skinUiCss, render, render);
- } else {
- render();
- }
- });
- editor.on('blur hide', hide);
- editor.on('remove', function () {
- if (panel) {
- panel.remove();
- panel = null;
- }
- });
- if (isSkinDisabled(editor) === false && args.skinUiCss) {
- DOM.styleSheetLoader.load(args.skinUiCss, $_awdosmuejjgwefop.fireSkinLoaded(editor));
- } else {
- $_awdosmuejjgwefop.fireSkinLoaded(editor)();
- }
- return {};
- };
- var $_fuoldxufjjgwefor = { render: render$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Inline = { render: render$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">- function Throbber (elm, inline) {
- var self = this;
- var state;
- var classPrefix = Control$1.classPrefix;
- var timer;
- self.show = function (time, callback) {
- function render() {
- if (state) {
- global$9(elm).append('<div class="' + classPrefix + 'throbber' + (inline ? ' ' + classPrefix + 'throbber-inline' : '') + '"></div>');
- if (callback) {
- callback();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function Throbber (elm, inline) {
+ var self = this;
+ var state;
+ var classPrefix = Control$1.classPrefix;
+ var timer;
+ self.show = function (time, callback) {
+ function render() {
+ if (state) {
+ global$9(elm).append('<div class="' + classPrefix + 'throbber' + (inline ? ' ' + classPrefix + 'throbber-inline' : '') + '"></div>');
+ if (callback) {
+ callback();
+ }
</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">- }
- self.hide();
- state = true;
- if (time) {
- timer = global$7.setTimeout(render, time);
- } else {
- render();
- }
- return self;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.hide();
+ state = true;
+ if (time) {
+ timer = global$7.setTimeout(render, time);
+ } else {
+ render();
+ }
+ return self;
+ };
+ self.hide = function () {
+ var child = elm.lastChild;
+ global$7.clearTimeout(timer);
+ if (child && child.className.indexOf('throbber') !== -1) {
+ child.parentNode.removeChild(child);
+ }
+ state = false;
+ return self;
+ };
+ }
+
+ var setup = function (editor, theme) {
+ var throbber;
+ editor.on('ProgressState', function (e) {
+ throbber = throbber || new Throbber(theme.panel.getEl('body'));
+ if (e.state) {
+ throbber.show(e.time);
+ } else {
+ throbber.hide();
+ }
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.hide = function () {
- var child = elm.lastChild;
- global$7.clearTimeout(timer);
- if (child && child.className.indexOf('throbber') !== -1) {
- child.parentNode.removeChild(child);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ProgressState = { setup: setup };
+
+ var renderUI = function (editor, theme, args) {
+ var skinUrl = getSkinUrl(editor);
+ if (skinUrl) {
+ args.skinUiCss = skinUrl + '/skin.min.css';
+ editor.contentCSS.push(skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.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">- state = false;
- return self;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ProgressState.setup(editor, theme);
+ return isInline(editor) ? Inline.render(editor, theme, args) : Iframe.render(editor, theme, args);
</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">+ var Render = { renderUI: renderUI };
</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 setup = function (editor, theme) {
- var throbber;
- editor.on('ProgressState', function (e) {
- throbber = throbber || new Throbber(theme.panel.getEl('body'));
- if (e.state) {
- throbber.show(e.time);
- } else {
- throbber.hide();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Tooltip = Control$1.extend({
+ Mixins: [Movable],
+ Defaults: { classes: 'widget tooltip tooltip-n' },
+ renderHtml: function () {
+ var self = this, prefix = self.classPrefix;
+ return '<div id="' + self._id + '" class="' + self.classes + '" role="presentation">' + '<div class="' + prefix + 'tooltip-arrow"></div>' + '<div class="' + prefix + 'tooltip-inner">' + self.encode(self.state.get('text')) + '</div>' + '</div>';
+ },
+ bindStates: function () {
+ var self = this;
+ self.state.on('change:text', function (e) {
+ self.getEl().lastChild.innerHTML = self.encode(e.value);
+ });
+ return self._super();
+ },
+ repaint: function () {
+ var self = this;
+ var style, rect;
+ style = self.getEl().style;
+ rect = self._layoutRect;
+ style.left = rect.x + 'px';
+ style.top = rect.y + 'px';
+ style.zIndex = 65535 + 65535;
</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">- };
- var $_18iiwkv2jjgwefs0 = { setup: setup };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var renderUI = function (editor, theme, args) {
- var skinUrl = getSkinUrl(editor);
- if (skinUrl) {
- args.skinUiCss = skinUrl + '/skin.min.css';
- editor.contentCSS.push(skinUrl + '/content' + (editor.inline ? '.inline' : '') + '.min.css');
- }
- $_18iiwkv2jjgwefs0.setup(editor, theme);
- return isInline(editor) ? $_fuoldxufjjgwefor.render(editor, theme, args) : $_vxdgetvjjgwefn7.render(editor, theme, args);
- };
- var $_as4c3qtrjjgwefn1 = { renderUI: renderUI };
-
- var Tooltip = Control$1.extend({
- Mixins: [$_3fnh5iukjjgwefpt],
- Defaults: { classes: 'widget tooltip tooltip-n' },
- renderHtml: function () {
- var self = this, prefix = self.classPrefix;
- return '<div id="' + self._id + '" class="' + self.classes + '" role="presentation">' + '<div class="' + prefix + 'tooltip-arrow"></div>' + '<div class="' + prefix + 'tooltip-inner">' + self.encode(self.state.get('text')) + '</div>' + '</div>';
- },
- bindStates: function () {
- var self = this;
- self.state.on('change:text', function (e) {
- self.getEl().lastChild.innerHTML = self.encode(e.value);
- });
- return self._super();
- },
- repaint: function () {
- var self = this;
- var style, rect;
- style = self.getEl().style;
- rect = self._layoutRect;
- style.left = rect.x + 'px';
- style.top = rect.y + 'px';
- style.zIndex = 65535 + 65535;
- }
- });
-
- var Widget = Control$1.extend({
- init: function (settings) {
- var self = this;
- self._super(settings);
- settings = self.settings;
- self.canFocus = true;
- if (settings.tooltip && Widget.tooltips !== false) {
- self.on('mouseenter', function (e) {
- var tooltip = self.tooltip().moveTo(-65535);
- if (e.control === self) {
- var rel = tooltip.text(settings.tooltip).show().testMoveRel(self.getEl(), [
- 'bc-tc',
- 'bc-tl',
- 'bc-tr'
- ]);
- tooltip.classes.toggle('tooltip-n', rel === 'bc-tc');
- tooltip.classes.toggle('tooltip-nw', rel === 'bc-tl');
- tooltip.classes.toggle('tooltip-ne', rel === 'bc-tr');
- tooltip.moveRel(self.getEl(), rel);
- } else {
- tooltip.hide();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Widget = Control$1.extend({
+ init: function (settings) {
+ var self = this;
+ self._super(settings);
+ settings = self.settings;
+ self.canFocus = true;
+ if (settings.tooltip && Widget.tooltips !== false) {
+ self.on('mouseenter', function (e) {
+ var tooltip = self.tooltip().moveTo(-65535);
+ if (e.control === self) {
+ var rel = tooltip.text(settings.tooltip).show().testMoveRel(self.getEl(), [
+ 'bc-tc',
+ 'bc-tl',
+ 'bc-tr'
+ ]);
+ tooltip.classes.toggle('tooltip-n', rel === 'bc-tc');
+ tooltip.classes.toggle('tooltip-nw', rel === 'bc-tl');
+ tooltip.classes.toggle('tooltip-ne', rel === 'bc-tr');
+ tooltip.moveRel(self.getEl(), rel);
+ } else {
+ tooltip.hide();
+ }
+ });
+ self.on('mouseleave mousedown click', function () {
+ self.tooltip().remove();
+ self._tooltip = null;
+ });
+ }
+ self.aria('label', settings.ariaLabel || settings.tooltip);
+ },
+ tooltip: function () {
+ if (!this._tooltip) {
+ this._tooltip = new Tooltip({ type: 'tooltip' });
+ UiContainer.inheritUiContainer(this, this._tooltip);
+ this._tooltip.renderTo();
+ }
+ return this._tooltip;
+ },
+ postRender: function () {
+ var self = this, settings = self.settings;
+ self._super();
+ if (!self.parent() && (settings.width || settings.height)) {
+ self.initLayoutRect();
+ self.repaint();
+ }
+ if (settings.autofocus) {
+ self.focus();
+ }
+ },
+ bindStates: function () {
+ var self = this;
+ function disable(state) {
+ self.aria('disabled', state);
+ self.classes.toggle('disabled', state);
+ }
+ function active(state) {
+ self.aria('pressed', state);
+ self.classes.toggle('active', state);
+ }
+ self.state.on('change:disabled', function (e) {
+ disable(e.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">- self.on('mouseleave mousedown click', function () {
- self.tooltip().remove();
- self._tooltip = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.state.on('change:active', function (e) {
+ active(e.value);
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self.state.get('disabled')) {
+ disable(true);
+ }
+ if (self.state.get('active')) {
+ active(true);
+ }
+ return self._super();
+ },
+ remove: function () {
+ this._super();
+ if (this._tooltip) {
+ this._tooltip.remove();
+ this._tooltip = 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">- self.aria('label', settings.ariaLabel || settings.tooltip);
- },
- tooltip: function () {
- if (!this._tooltip) {
- this._tooltip = new Tooltip({ type: 'tooltip' });
- $_6344qfu4jjgwefnr.inheritUiContainer(this, this._tooltip);
- this._tooltip.renderTo();
- }
- return this._tooltip;
- },
- postRender: function () {
- var self = this, settings = self.settings;
- self._super();
- if (!self.parent() && (settings.width || settings.height)) {
- self.initLayoutRect();
- self.repaint();
- }
- if (settings.autofocus) {
- self.focus();
- }
- },
- bindStates: function () {
- var self = this;
- function disable(state) {
- self.aria('disabled', state);
- self.classes.toggle('disabled', state);
- }
- function active(state) {
- self.aria('pressed', state);
- self.classes.toggle('active', state);
- }
- self.state.on('change:disabled', function (e) {
- disable(e.value);
- });
- self.state.on('change:active', function (e) {
- active(e.value);
- });
- if (self.state.get('disabled')) {
- disable(true);
- }
- if (self.state.get('active')) {
- active(true);
- }
- return self._super();
- },
- remove: function () {
- this._super();
- if (this._tooltip) {
- this._tooltip.remove();
- this._tooltip = null;
- }
- }
- });
</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">- var Progress = Widget.extend({
- Defaults: { value: 0 },
- init: function (settings) {
- var self = this;
- self._super(settings);
- self.classes.add('progress');
- if (!self.settings.filter) {
- self.settings.filter = function (value) {
- return Math.round(value);
- };
- }
- },
- renderHtml: function () {
- var self = this, id = self._id, prefix = this.classPrefix;
- return '<div id="' + id + '" class="' + self.classes + '">' + '<div class="' + prefix + 'bar-container">' + '<div class="' + prefix + 'bar"></div>' + '</div>' + '<div class="' + prefix + 'text">0%</div>' + '</div>';
- },
- postRender: function () {
- var self = this;
- self._super();
- self.value(self.settings.value);
- return self;
- },
- bindStates: function () {
- var self = this;
- function setValue(value) {
- value = self.settings.filter(value);
- self.getEl().lastChild.innerHTML = value + '%';
- self.getEl().firstChild.firstChild.style.width = value + '%';
- }
- self.state.on('change:value', function (e) {
- setValue(e.value);
- });
- setValue(self.state.get('value'));
- return self._super();
- }
- });
-
- var updateLiveRegion = function (ctx, text) {
- ctx.getEl().lastChild.textContent = text + (ctx.progressBar ? ' ' + ctx.progressBar.value() + '%' : '');
- };
- var Notification = Control$1.extend({
- Mixins: [$_3fnh5iukjjgwefpt],
- Defaults: { classes: 'widget notification' },
- init: function (settings) {
- var self = this;
- self._super(settings);
- self.maxWidth = settings.maxWidth;
- if (settings.text) {
- self.text(settings.text);
- }
- if (settings.icon) {
- self.icon = settings.icon;
- }
- if (settings.color) {
- self.color = settings.color;
- }
- if (settings.type) {
- self.classes.add('notification-' + settings.type);
- }
- if (settings.timeout && (settings.timeout < 0 || settings.timeout > 0) && !settings.closeButton) {
- self.closeButton = false;
- } else {
- self.classes.add('has-close');
- self.closeButton = true;
- }
- if (settings.progressBar) {
- self.progressBar = new Progress();
- }
- self.on('click', function (e) {
- if (e.target.className.indexOf(self.classPrefix + 'close') !== -1) {
- self.close();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Progress = Widget.extend({
+ Defaults: { value: 0 },
+ init: function (settings) {
+ var self = this;
+ self._super(settings);
+ self.classes.add('progress');
+ if (!self.settings.filter) {
+ self.settings.filter = function (value) {
+ return Math.round(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">- });
- },
- renderHtml: function () {
- var self = this;
- var prefix = self.classPrefix;
- var icon = '', closeButton = '', progressBar = '', notificationStyle = '';
- if (self.icon) {
- icon = '<i class="' + prefix + 'ico' + ' ' + prefix + 'i-' + self.icon + '"></i>';
- }
- notificationStyle = ' style="max-width: ' + self.maxWidth + 'px;' + (self.color ? 'background-color: ' + self.color + ';"' : '"');
- if (self.closeButton) {
- closeButton = '<button type="button" class="' + prefix + 'close" aria-hidden="true">\xD7</button>';
- }
- if (self.progressBar) {
- progressBar = self.progressBar.renderHtml();
- }
- return '<div id="' + self._id + '" class="' + self.classes + '"' + notificationStyle + ' role="presentation">' + icon + '<div class="' + prefix + 'notification-inner">' + self.state.get('text') + '</div>' + progressBar + closeButton + '<div style="clip: rect(1px, 1px, 1px, 1px);height: 1px;overflow: hidden;position: absolute;width: 1px;"' + ' aria-live="assertive" aria-relevant="additions" aria-atomic="true"></div>' + '</div>';
- },
- postRender: function () {
- var self = this;
- global$7.setTimeout(function () {
- self.$el.addClass(self.classPrefix + 'in');
- updateLiveRegion(self, self.state.get('text'));
- }, 100);
- return self._super();
- },
- bindStates: function () {
- var self = this;
- self.state.on('change:text', function (e) {
- self.getEl().firstChild.innerHTML = e.value;
- updateLiveRegion(self, e.value);
- });
- if (self.progressBar) {
- self.progressBar.bindStates();
- self.progressBar.state.on('change:value', function (e) {
- updateLiveRegion(self, self.state.get('text'));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ renderHtml: function () {
+ var self = this, id = self._id, prefix = this.classPrefix;
+ return '<div id="' + id + '" class="' + self.classes + '">' + '<div class="' + prefix + 'bar-container">' + '<div class="' + prefix + 'bar"></div>' + '</div>' + '<div class="' + prefix + 'text">0%</div>' + '</div>';
+ },
+ postRender: function () {
+ var self = this;
+ self._super();
+ self.value(self.settings.value);
+ return self;
+ },
+ bindStates: function () {
+ var self = this;
+ function setValue(value) {
+ value = self.settings.filter(value);
+ self.getEl().lastChild.innerHTML = value + '%';
+ self.getEl().firstChild.firstChild.style.width = value + '%';
+ }
+ self.state.on('change:value', function (e) {
+ setValue(e.value);
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ setValue(self.state.get('value'));
+ return self._super();
</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 self._super();
- },
- close: function () {
- var self = this;
- if (!self.fire('close').isDefaultPrevented()) {
- self.remove();
- }
- return self;
- },
- repaint: function () {
- var self = this;
- var style, rect;
- style = self.getEl().style;
- rect = self._layoutRect;
- style.left = rect.x + 'px';
- style.top = rect.y + 'px';
- style.zIndex = 65535 - 1;
- }
- });
</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">- function NotificationManagerImpl (editor) {
- var getEditorContainer = function (editor) {
- return editor.inline ? editor.getElement() : editor.getContentAreaContainer();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var updateLiveRegion = function (ctx, text) {
+ ctx.getEl().lastChild.textContent = text + (ctx.progressBar ? ' ' + ctx.progressBar.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 getContainerWidth = function () {
- var container = getEditorContainer(editor);
- return funcs.getSize(container).width;
- };
- var prePositionNotifications = function (notifications) {
- each(notifications, function (notification) {
- notification.moveTo(0, 0);
- });
- };
- var positionNotifications = function (notifications) {
- if (notifications.length > 0) {
- var firstItem = notifications.slice(0, 1)[0];
- var container = getEditorContainer(editor);
- firstItem.moveRel(container, 'tc-tc');
- each(notifications, function (notification, index) {
- if (index > 0) {
- notification.moveRel(notifications[index - 1].getEl(), 'bc-tc');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Notification = Control$1.extend({
+ Mixins: [Movable],
+ Defaults: { classes: 'widget notification' },
+ init: function (settings) {
+ var self = this;
+ self._super(settings);
+ self.maxWidth = settings.maxWidth;
+ if (settings.text) {
+ self.text(settings.text);
+ }
+ if (settings.icon) {
+ self.icon = settings.icon;
+ }
+ if (settings.color) {
+ self.color = settings.color;
+ }
+ if (settings.type) {
+ self.classes.add('notification-' + settings.type);
+ }
+ if (settings.timeout && (settings.timeout < 0 || settings.timeout > 0) && !settings.closeButton) {
+ self.closeButton = false;
+ } else {
+ self.classes.add('has-close');
+ self.closeButton = true;
+ }
+ if (settings.progressBar) {
+ self.progressBar = new Progress();
+ }
+ self.on('click', function (e) {
+ if (e.target.className.indexOf(self.classPrefix + 'close') !== -1) {
+ self.close();
</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">- }
- };
- var reposition = function (notifications) {
- prePositionNotifications(notifications);
- positionNotifications(notifications);
- };
- var open = function (args, closeCallback) {
- var extendedArgs = global$2.extend(args, { maxWidth: getContainerWidth() });
- var notif = new Notification(extendedArgs);
- notif.args = extendedArgs;
- if (extendedArgs.timeout > 0) {
- notif.timer = setTimeout(function () {
- notif.close();
- closeCallback();
- }, extendedArgs.timeout);
- }
- notif.on('close', function () {
- closeCallback();
- });
- notif.renderTo();
- return notif;
- };
- var close = function (notification) {
- notification.close();
- };
- var getArgs = function (notification) {
- return notification.args;
- };
- return {
- open: open,
- close: close,
- reposition: reposition,
- getArgs: getArgs
- };
- }
-
- var windows = [];
- var oldMetaValue = '';
- function toggleFullScreenState(state) {
- var noScaleMetaValue = 'width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0';
- var viewport = global$9('meta[name=viewport]')[0], contentValue;
- if (global$8.overrideViewPort === false) {
- return;
- }
- if (!viewport) {
- viewport = document.createElement('meta');
- viewport.setAttribute('name', 'viewport');
- document.getElementsByTagName('head')[0].appendChild(viewport);
- }
- contentValue = viewport.getAttribute('content');
- if (contentValue && typeof oldMetaValue !== 'undefined') {
- oldMetaValue = contentValue;
- }
- viewport.setAttribute('content', state ? noScaleMetaValue : oldMetaValue);
- }
- function toggleBodyFullScreenClasses(classPrefix, state) {
- if (checkFullscreenWindows() && state === false) {
- global$9([
- document.documentElement,
- document.body
- ]).removeClass(classPrefix + 'fullscreen');
- }
- }
- function checkFullscreenWindows() {
- for (var i = 0; i < windows.length; i++) {
- if (windows[i]._fullscreen) {
- return true;
- }
- }
- return false;
- }
- function handleWindowResize() {
- if (!global$8.desktop) {
- var lastSize_1 = {
- w: window.innerWidth,
- h: window.innerHeight
- };
- global$7.setInterval(function () {
- var w = window.innerWidth, h = window.innerHeight;
- if (lastSize_1.w !== w || lastSize_1.h !== h) {
- lastSize_1 = {
- w: w,
- h: h
- };
- global$9(window).trigger('resize');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ renderHtml: function () {
+ var self = this;
+ var prefix = self.classPrefix;
+ var icon = '', closeButton = '', progressBar = '', notificationStyle = '';
+ if (self.icon) {
+ icon = '<i class="' + prefix + 'ico' + ' ' + prefix + 'i-' + self.icon + '"></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">- }, 100);
- }
- function reposition() {
- var i;
- var rect = funcs.getWindowSize();
- var layoutRect;
- for (i = 0; i < windows.length; i++) {
- layoutRect = windows[i].layoutRect();
- windows[i].moveTo(windows[i].settings.x || Math.max(0, rect.w / 2 - layoutRect.w / 2), windows[i].settings.y || Math.max(0, rect.h / 2 - layoutRect.h / 2));
- }
- }
- global$9(window).on('resize', reposition);
- }
- var Window$$1 = FloatPanel.extend({
- modal: true,
- Defaults: {
- border: 1,
- layout: 'flex',
- containerCls: 'panel',
- role: 'dialog',
- callbacks: {
- submit: function () {
- this.fire('submit', { data: this.toJSON() });
- },
- close: function () {
- this.close();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ notificationStyle = ' style="max-width: ' + self.maxWidth + 'px;' + (self.color ? 'background-color: ' + self.color + ';"' : '"');
+ if (self.closeButton) {
+ closeButton = '<button type="button" class="' + prefix + 'close" aria-hidden="true">\xD7</button>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- },
- init: function (settings) {
- var self$$1 = this;
- self$$1._super(settings);
- if (self$$1.isRtl()) {
- self$$1.classes.add('rtl');
- }
- self$$1.classes.add('window');
- self$$1.bodyClasses.add('window-body');
- self$$1.state.set('fixed', true);
- if (settings.buttons) {
- self$$1.statusbar = new Panel({
- layout: 'flex',
- border: '1 0 0 0',
- spacing: 3,
- padding: 10,
- align: 'center',
- pack: self$$1.isRtl() ? 'start' : 'end',
- defaults: { type: 'button' },
- items: settings.buttons
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self.progressBar) {
+ progressBar = self.progressBar.renderHtml();
+ }
+ return '<div id="' + self._id + '" class="' + self.classes + '"' + notificationStyle + ' role="presentation">' + icon + '<div class="' + prefix + 'notification-inner">' + self.state.get('text') + '</div>' + progressBar + closeButton + '<div style="clip: rect(1px, 1px, 1px, 1px);height: 1px;overflow: hidden;position: absolute;width: 1px;"' + ' aria-live="assertive" aria-relevant="additions" aria-atomic="true"></div>' + '</div>';
+ },
+ postRender: function () {
+ var self = this;
+ global$7.setTimeout(function () {
+ self.$el.addClass(self.classPrefix + 'in');
+ updateLiveRegion(self, self.state.get('text'));
+ }, 100);
+ return self._super();
+ },
+ bindStates: function () {
+ var self = this;
+ self.state.on('change:text', function (e) {
+ self.getEl().firstChild.innerHTML = e.value;
+ updateLiveRegion(self, e.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">- self$$1.statusbar.classes.add('foot');
- self$$1.statusbar.parent(self$$1);
- }
- self$$1.on('click', function (e) {
- var closeClass = self$$1.classPrefix + 'close';
- if (funcs.hasClass(e.target, closeClass) || funcs.hasClass(e.target.parentNode, closeClass)) {
- self$$1.close();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self.progressBar) {
+ self.progressBar.bindStates();
+ self.progressBar.state.on('change:value', function (e) {
+ updateLiveRegion(self, self.state.get('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">- });
- self$$1.on('cancel', function () {
- self$$1.close();
- });
- self$$1.on('move', function (e) {
- if (e.control === self$$1) {
- FloatPanel.hideAll();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self._super();
+ },
+ close: function () {
+ var self = this;
+ if (!self.fire('close').isDefaultPrevented()) {
+ self.remove();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self$$1.aria('describedby', self$$1.describedBy || self$$1._id + '-none');
- self$$1.aria('label', settings.title);
- self$$1._fullscreen = false;
- },
- recalc: function () {
- var self$$1 = this;
- var statusbar$$1 = self$$1.statusbar;
- var layoutRect, width, x, needsRecalc;
- if (self$$1._fullscreen) {
- self$$1.layoutRect(funcs.getWindowSize());
- self$$1.layoutRect().contentH = self$$1.layoutRect().innerH;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self;
+ },
+ repaint: function () {
+ var self = this;
+ var style, rect;
+ style = self.getEl().style;
+ rect = self._layoutRect;
+ style.left = rect.x + 'px';
+ style.top = rect.y + 'px';
+ style.zIndex = 65535 - 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">- self$$1._super();
- layoutRect = self$$1.layoutRect();
- if (self$$1.settings.title && !self$$1._fullscreen) {
- width = layoutRect.headerW;
- if (width > layoutRect.w) {
- x = layoutRect.x - Math.max(0, width / 2);
- self$$1.layoutRect({
- w: width,
- x: x
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ function NotificationManagerImpl (editor) {
+ var getEditorContainer = function (editor) {
+ return editor.inline ? editor.getElement() : editor.getContentAreaContainer();
+ };
+ var getContainerWidth = function () {
+ var container = getEditorContainer(editor);
+ return funcs.getSize(container).width;
+ };
+ var prePositionNotifications = function (notifications) {
+ each(notifications, function (notification) {
+ notification.moveTo(0, 0);
+ });
+ };
+ var positionNotifications = function (notifications) {
+ if (notifications.length > 0) {
+ var firstItem = notifications.slice(0, 1)[0];
+ var container = getEditorContainer(editor);
+ firstItem.moveRel(container, 'tc-tc');
+ each(notifications, function (notification, index) {
+ if (index > 0) {
+ notification.moveRel(notifications[index - 1].getEl(), 'bc-tc');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- needsRecalc = true;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (statusbar$$1) {
- statusbar$$1.layoutRect({ w: self$$1.layoutRect().innerW }).recalc();
- width = statusbar$$1.layoutRect().minW + layoutRect.deltaW;
- if (width > layoutRect.w) {
- x = layoutRect.x - Math.max(0, width - layoutRect.w);
- self$$1.layoutRect({
- w: width,
- x: x
- });
- needsRecalc = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var reposition = function (notifications) {
+ prePositionNotifications(notifications);
+ positionNotifications(notifications);
+ };
+ var open = function (args, closeCallback) {
+ var extendedArgs = global$2.extend(args, { maxWidth: getContainerWidth() });
+ var notif = new Notification(extendedArgs);
+ notif.args = extendedArgs;
+ if (extendedArgs.timeout > 0) {
+ notif.timer = setTimeout(function () {
+ notif.close();
+ closeCallback();
+ }, extendedArgs.timeout);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ notif.on('close', function () {
+ closeCallback();
+ });
+ notif.renderTo();
+ return notif;
+ };
+ var close = function (notification) {
+ notification.close();
+ };
+ var getArgs = function (notification) {
+ return notification.args;
+ };
+ return {
+ open: open,
+ close: close,
+ reposition: reposition,
+ getArgs: getArgs
+ };
+ }
+
+ var windows = [];
+ var oldMetaValue = '';
+ function toggleFullScreenState(state) {
+ var noScaleMetaValue = 'width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0';
+ var viewport = global$9('meta[name=viewport]')[0], contentValue;
+ if (global$8.overrideViewPort === 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">- if (needsRecalc) {
- self$$1.recalc();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!viewport) {
+ viewport = document.createElement('meta');
+ viewport.setAttribute('name', 'viewport');
+ document.getElementsByTagName('head')[0].appendChild(viewport);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- },
- initLayoutRect: function () {
- var self$$1 = this;
- var layoutRect = self$$1._super();
- var deltaH = 0, headEl;
- if (self$$1.settings.title && !self$$1._fullscreen) {
- headEl = self$$1.getEl('head');
- var size = funcs.getSize(headEl);
- layoutRect.headerW = size.width;
- layoutRect.headerH = size.height;
- deltaH += layoutRect.headerH;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ contentValue = viewport.getAttribute('content');
+ if (contentValue && typeof oldMetaValue !== 'undefined') {
+ oldMetaValue = contentValue;
</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 (self$$1.statusbar) {
- deltaH += self$$1.statusbar.layoutRect().h;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ viewport.setAttribute('content', state ? noScaleMetaValue : oldMetaValue);
+ }
+ function toggleBodyFullScreenClasses(classPrefix, state) {
+ if (checkFullscreenWindows() && state === false) {
+ global$9([
+ document.documentElement,
+ document.body
+ ]).removeClass(classPrefix + '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">- layoutRect.deltaH += deltaH;
- layoutRect.minH += deltaH;
- layoutRect.h += deltaH;
- var rect = funcs.getWindowSize();
- layoutRect.x = self$$1.settings.x || Math.max(0, rect.w / 2 - layoutRect.w / 2);
- layoutRect.y = self$$1.settings.y || Math.max(0, rect.h / 2 - layoutRect.h / 2);
- return layoutRect;
- },
- renderHtml: function () {
- var self$$1 = this, layout = self$$1._layout, id = self$$1._id, prefix = self$$1.classPrefix;
- var settings = self$$1.settings;
- var headerHtml = '', footerHtml = '', html = settings.html;
- self$$1.preRender();
- layout.preRender(self$$1);
- if (settings.title) {
- headerHtml = '<div id="' + id + '-head" class="' + prefix + 'window-head">' + '<div id="' + id + '-title" class="' + prefix + 'title">' + self$$1.encode(settings.title) + '</div>' + '<div id="' + id + '-dragh" class="' + prefix + 'dragh"></div>' + '<button type="button" class="' + prefix + 'close" aria-hidden="true">' + '<i class="mce-ico mce-i-remove"></i>' + '</button>' + '</div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ function checkFullscreenWindows() {
+ for (var i = 0; i < windows.length; i++) {
+ if (windows[i]._fullscreen) {
+ 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 (settings.url) {
- html = '<iframe src="' + settings.url + '" tabindex="-1"></iframe>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return false;
+ }
+ function handleWindowResize() {
+ if (!global$8.desktop) {
+ var lastSize_1 = {
+ w: window.innerWidth,
+ h: window.innerHeight
+ };
+ global$7.setInterval(function () {
+ var w = window.innerWidth, h = window.innerHeight;
+ if (lastSize_1.w !== w || lastSize_1.h !== h) {
+ lastSize_1 = {
+ w: w,
+ h: h
+ };
+ global$9(window).trigger('resize');
+ }
+ }, 100);
</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 html === 'undefined') {
- html = layout.renderHtml(self$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function reposition() {
+ var i;
+ var rect = funcs.getWindowSize();
+ var layoutRect;
+ for (i = 0; i < windows.length; i++) {
+ layoutRect = windows[i].layoutRect();
+ windows[i].moveTo(windows[i].settings.x || Math.max(0, rect.w / 2 - layoutRect.w / 2), windows[i].settings.y || Math.max(0, rect.h / 2 - layoutRect.h / 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">- if (self$$1.statusbar) {
- footerHtml = self$$1.statusbar.renderHtml();
- }
- return '<div id="' + id + '" class="' + self$$1.classes + '" hidefocus="1">' + '<div class="' + self$$1.classPrefix + 'reset" role="application">' + headerHtml + '<div id="' + id + '-body" class="' + self$$1.bodyClasses + '">' + html + '</div>' + footerHtml + '</div>' + '</div>';
- },
- fullscreen: function (state) {
- var self$$1 = this;
- var documentElement = document.documentElement;
- var slowRendering;
- var prefix = self$$1.classPrefix;
- var layoutRect;
- if (state !== self$$1._fullscreen) {
- global$9(window).on('resize', function () {
- var time;
- if (self$$1._fullscreen) {
- if (!slowRendering) {
- time = new Date().getTime();
- var rect = funcs.getWindowSize();
- self$$1.moveTo(0, 0).resizeTo(rect.w, rect.h);
- if (new Date().getTime() - time > 50) {
- slowRendering = true;
- }
- } else {
- if (!self$$1._timer) {
- self$$1._timer = global$7.setTimeout(function () {
- var rect = funcs.getWindowSize();
- self$$1.moveTo(0, 0).resizeTo(rect.w, rect.h);
- self$$1._timer = 0;
- }, 50);
- }
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global$9(window).on('resize', reposition);
+ }
+ var Window$$1 = FloatPanel.extend({
+ modal: true,
+ Defaults: {
+ border: 1,
+ layout: 'flex',
+ containerCls: 'panel',
+ role: 'dialog',
+ callbacks: {
+ submit: function () {
+ this.fire('submit', { data: this.toJSON() });
+ },
+ close: function () {
+ this.close();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ },
+ init: function (settings) {
+ var self$$1 = this;
+ self$$1._super(settings);
+ if (self$$1.isRtl()) {
+ self$$1.classes.add('rtl');
+ }
+ self$$1.classes.add('window');
+ self$$1.bodyClasses.add('window-body');
+ self$$1.state.set('fixed', true);
+ if (settings.buttons) {
+ self$$1.statusbar = new Panel({
+ layout: 'flex',
+ border: '1 0 0 0',
+ spacing: 3,
+ padding: 10,
+ align: 'center',
+ pack: self$$1.isRtl() ? 'start' : 'end',
+ defaults: { type: 'button' },
+ items: settings.buttons
+ });
+ self$$1.statusbar.classes.add('foot');
+ self$$1.statusbar.parent(self$$1);
+ }
+ self$$1.on('click', function (e) {
+ var closeClass = self$$1.classPrefix + 'close';
+ if (funcs.hasClass(e.target, closeClass) || funcs.hasClass(e.target.parentNode, closeClass)) {
+ self$$1.close();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.on('cancel', function () {
+ self$$1.close();
+ });
+ self$$1.on('move', function (e) {
+ if (e.control === self$$1) {
+ FloatPanel.hideAll();
+ }
+ });
+ self$$1.aria('describedby', self$$1.describedBy || self$$1._id + '-none');
+ self$$1.aria('label', settings.title);
+ self$$1._fullscreen = false;
+ },
+ recalc: function () {
+ var self$$1 = this;
+ var statusbar$$1 = self$$1.statusbar;
+ var layoutRect, width, x, needsRecalc;
+ if (self$$1._fullscreen) {
+ self$$1.layoutRect(funcs.getWindowSize());
+ self$$1.layoutRect().contentH = self$$1.layoutRect().innerH;
+ }
+ self$$1._super();
</ins><span class="cx" style="display: block; padding: 0 10px"> layoutRect = self$$1.layoutRect();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1._fullscreen = state;
- if (!state) {
- self$$1.borderBox = $_fbr241uqjjgwefqo.parseBox(self$$1.settings.border);
- self$$1.getEl('head').style.display = '';
- layoutRect.deltaH += layoutRect.headerH;
- global$9([
- documentElement,
- document.body
- ]).removeClass(prefix + 'fullscreen');
- self$$1.classes.remove('fullscreen');
- self$$1.moveTo(self$$1._initial.x, self$$1._initial.y).resizeTo(self$$1._initial.w, self$$1._initial.h);
- } else {
- self$$1._initial = {
- x: layoutRect.x,
- y: layoutRect.y,
- w: layoutRect.w,
- h: layoutRect.h
- };
- self$$1.borderBox = $_fbr241uqjjgwefqo.parseBox('0');
- self$$1.getEl('head').style.display = 'none';
- layoutRect.deltaH -= layoutRect.headerH + 2;
- global$9([
- documentElement,
- document.body
- ]).addClass(prefix + 'fullscreen');
- self$$1.classes.add('fullscreen');
- var rect = funcs.getWindowSize();
- self$$1.moveTo(0, 0).resizeTo(rect.w, rect.h);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self$$1.settings.title && !self$$1._fullscreen) {
+ width = layoutRect.headerW;
+ if (width > layoutRect.w) {
+ x = layoutRect.x - Math.max(0, width / 2);
+ self$$1.layoutRect({
+ w: width,
+ x: x
+ });
+ needsRecalc = 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 self$$1.reflow();
- },
- postRender: function () {
- var self$$1 = this;
- var startPos;
- setTimeout(function () {
- self$$1.classes.add('in');
- self$$1.fire('open');
- }, 0);
- self$$1._super();
- if (self$$1.statusbar) {
- self$$1.statusbar.postRender();
- }
- self$$1.focus();
- this.dragHelper = new DragHelper(self$$1._id + '-dragh', {
- start: function () {
- startPos = {
- x: self$$1.layoutRect().x,
- y: self$$1.layoutRect().y
- };
- },
- drag: function (e) {
- self$$1.moveTo(startPos.x + e.deltaX, startPos.y + e.deltaY);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (statusbar$$1) {
+ statusbar$$1.layoutRect({ w: self$$1.layoutRect().innerW }).recalc();
+ width = statusbar$$1.layoutRect().minW + layoutRect.deltaW;
+ if (width > layoutRect.w) {
+ x = layoutRect.x - Math.max(0, width - layoutRect.w);
+ self$$1.layoutRect({
+ w: width,
+ x: x
+ });
+ needsRecalc = 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">- });
- self$$1.on('submit', function (e) {
- if (!e.isDefaultPrevented()) {
- self$$1.close();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (needsRecalc) {
+ self$$1.recalc();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- windows.push(self$$1);
- toggleFullScreenState(true);
- },
- submit: function () {
- return this.fire('submit', { data: this.toJSON() });
- },
- remove: function () {
- var self$$1 = this;
- var i;
- self$$1.dragHelper.destroy();
- self$$1._super();
- if (self$$1.statusbar) {
- this.statusbar.remove();
- }
- toggleBodyFullScreenClasses(self$$1.classPrefix, false);
- i = windows.length;
- while (i--) {
- if (windows[i] === self$$1) {
- windows.splice(i, 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ initLayoutRect: function () {
+ var self$$1 = this;
+ var layoutRect = self$$1._super();
+ var deltaH = 0, headEl;
+ if (self$$1.settings.title && !self$$1._fullscreen) {
+ headEl = self$$1.getEl('head');
+ var size = funcs.getSize(headEl);
+ layoutRect.headerW = size.width;
+ layoutRect.headerH = size.height;
+ deltaH += layoutRect.headerH;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- toggleFullScreenState(windows.length > 0);
- },
- getContentWindow: function () {
- var ifr = this.getEl().getElementsByTagName('iframe')[0];
- return ifr ? ifr.contentWindow : null;
- }
- });
- handleWindowResize();
-
- var MessageBox = Window$$1.extend({
- init: function (settings) {
- settings = {
- border: 1,
- padding: 20,
- layout: 'flex',
- pack: 'center',
- align: 'center',
- containerCls: 'panel',
- autoScroll: true,
- buttons: {
- type: 'button',
- text: 'Ok',
- action: 'ok'
- },
- items: {
- type: 'label',
- multiline: true,
- maxWidth: 500,
- maxHeight: 200
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self$$1.statusbar) {
+ deltaH += self$$1.statusbar.layoutRect().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">- };
- this._super(settings);
- },
- Statics: {
- OK: 1,
- OK_CANCEL: 2,
- YES_NO: 3,
- YES_NO_CANCEL: 4,
- msgBox: function (settings) {
- var buttons;
- var callback = settings.callback || function () {
- };
- function createButton(text, status$$1, primary) {
- return {
- type: 'button',
- text: text,
- subtype: primary ? 'primary' : '',
- onClick: function (e) {
- e.control.parents()[1].close();
- callback(status$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ layoutRect.deltaH += deltaH;
+ layoutRect.minH += deltaH;
+ layoutRect.h += deltaH;
+ var rect = funcs.getWindowSize();
+ layoutRect.x = self$$1.settings.x || Math.max(0, rect.w / 2 - layoutRect.w / 2);
+ layoutRect.y = self$$1.settings.y || Math.max(0, rect.h / 2 - layoutRect.h / 2);
+ return layoutRect;
+ },
+ renderHtml: function () {
+ var self$$1 = this, layout = self$$1._layout, id = self$$1._id, prefix = self$$1.classPrefix;
+ var settings = self$$1.settings;
+ var headerHtml = '', footerHtml = '', html = settings.html;
+ self$$1.preRender();
+ layout.preRender(self$$1);
+ if (settings.title) {
+ headerHtml = '<div id="' + id + '-head" class="' + prefix + 'window-head">' + '<div id="' + id + '-title" class="' + prefix + 'title">' + self$$1.encode(settings.title) + '</div>' + '<div id="' + id + '-dragh" class="' + prefix + 'dragh"></div>' + '<button type="button" class="' + prefix + 'close" aria-hidden="true">' + '<i class="mce-ico mce-i-remove"></i>' + '</button>' + '</div>';
+ }
+ if (settings.url) {
+ html = '<iframe src="' + settings.url + '" tabindex="-1"></iframe>';
+ }
+ if (typeof html === 'undefined') {
+ html = layout.renderHtml(self$$1);
+ }
+ if (self$$1.statusbar) {
+ footerHtml = self$$1.statusbar.renderHtml();
+ }
+ return '<div id="' + id + '" class="' + self$$1.classes + '" hidefocus="1">' + '<div class="' + self$$1.classPrefix + 'reset" role="application">' + headerHtml + '<div id="' + id + '-body" class="' + self$$1.bodyClasses + '">' + html + '</div>' + footerHtml + '</div>' + '</div>';
+ },
+ fullscreen: function (state) {
+ var self$$1 = this;
+ var documentElement = document.documentElement;
+ var slowRendering;
+ var prefix = self$$1.classPrefix;
+ var layoutRect;
+ if (state !== self$$1._fullscreen) {
+ global$9(window).on('resize', function () {
+ var time;
+ if (self$$1._fullscreen) {
+ if (!slowRendering) {
+ time = new Date().getTime();
+ var rect = funcs.getWindowSize();
+ self$$1.moveTo(0, 0).resizeTo(rect.w, rect.h);
+ if (new Date().getTime() - time > 50) {
+ slowRendering = true;
+ }
+ } else {
+ if (!self$$1._timer) {
+ self$$1._timer = global$7.setTimeout(function () {
+ var rect = funcs.getWindowSize();
+ self$$1.moveTo(0, 0).resizeTo(rect.w, rect.h);
+ self$$1._timer = 0;
+ }, 50);
+ }
+ }
</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">+ });
+ layoutRect = self$$1.layoutRect();
+ self$$1._fullscreen = state;
+ if (!state) {
+ self$$1.borderBox = BoxUtils.parseBox(self$$1.settings.border);
+ self$$1.getEl('head').style.display = '';
+ layoutRect.deltaH += layoutRect.headerH;
+ global$9([
+ documentElement,
+ document.body
+ ]).removeClass(prefix + 'fullscreen');
+ self$$1.classes.remove('fullscreen');
+ self$$1.moveTo(self$$1._initial.x, self$$1._initial.y).resizeTo(self$$1._initial.w, self$$1._initial.h);
+ } else {
+ self$$1._initial = {
+ x: layoutRect.x,
+ y: layoutRect.y,
+ w: layoutRect.w,
+ h: layoutRect.h
+ };
+ self$$1.borderBox = BoxUtils.parseBox('0');
+ self$$1.getEl('head').style.display = 'none';
+ layoutRect.deltaH -= layoutRect.headerH + 2;
+ global$9([
+ documentElement,
+ document.body
+ ]).addClass(prefix + 'fullscreen');
+ self$$1.classes.add('fullscreen');
+ var rect = funcs.getWindowSize();
+ self$$1.moveTo(0, 0).resizeTo(rect.w, rect.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">- switch (settings.buttons) {
- case MessageBox.OK_CANCEL:
- buttons = [
- createButton('Ok', true, true),
- createButton('Cancel', false)
- ];
- break;
- case MessageBox.YES_NO:
- case MessageBox.YES_NO_CANCEL:
- buttons = [
- createButton('Yes', 1, true),
- createButton('No', 0)
- ];
- if (settings.buttons === MessageBox.YES_NO_CANCEL) {
- buttons.push(createButton('Cancel', -1));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$1.reflow();
+ },
+ postRender: function () {
+ var self$$1 = this;
+ var startPos;
+ setTimeout(function () {
+ self$$1.classes.add('in');
+ self$$1.fire('open');
+ }, 0);
+ self$$1._super();
+ if (self$$1.statusbar) {
+ self$$1.statusbar.postRender();
+ }
+ self$$1.focus();
+ this.dragHelper = new DragHelper(self$$1._id + '-dragh', {
+ start: function () {
+ startPos = {
+ x: self$$1.layoutRect().x,
+ y: self$$1.layoutRect().y
+ };
+ },
+ drag: function (e) {
+ self$$1.moveTo(startPos.x + e.deltaX, startPos.y + e.deltaY);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- break;
- default:
- buttons = [createButton('Ok', true, true)];
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ self$$1.on('submit', function (e) {
+ if (!e.isDefaultPrevented()) {
+ self$$1.close();
+ }
+ });
+ windows.push(self$$1);
+ toggleFullScreenState(true);
+ },
+ submit: function () {
+ return this.fire('submit', { data: this.toJSON() });
+ },
+ remove: function () {
+ var self$$1 = this;
+ var i;
+ self$$1.dragHelper.destroy();
+ self$$1._super();
+ if (self$$1.statusbar) {
+ this.statusbar.remove();
</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 new Window$$1({
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ toggleBodyFullScreenClasses(self$$1.classPrefix, false);
+ i = windows.length;
+ while (i--) {
+ if (windows[i] === self$$1) {
+ windows.splice(i, 1);
+ }
+ }
+ toggleFullScreenState(windows.length > 0);
+ },
+ getContentWindow: function () {
+ var ifr = this.getEl().getElementsByTagName('iframe')[0];
+ return ifr ? ifr.contentWindow : null;
+ }
+ });
+ handleWindowResize();
+
+ var MessageBox = Window$$1.extend({
+ init: function (settings) {
+ settings = {
+ border: 1,
</ins><span class="cx" style="display: block; padding: 0 10px"> padding: 20,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- x: settings.x,
- y: settings.y,
- minWidth: 300,
- minHeight: 100,
</del><span class="cx" style="display: block; padding: 0 10px"> layout: 'flex',
</span><span class="cx" style="display: block; padding: 0 10px"> pack: 'center',
</span><span class="cx" style="display: block; padding: 0 10px"> align: 'center',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- buttons: buttons,
- title: settings.title,
- role: 'alertdialog',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ containerCls: 'panel',
+ autoScroll: true,
+ buttons: {
+ type: 'button',
+ text: 'Ok',
+ action: 'ok'
+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> items: {
</span><span class="cx" style="display: block; padding: 0 10px"> type: 'label',
</span><span class="cx" style="display: block; padding: 0 10px"> multiline: true,
</span><span class="cx" style="display: block; padding: 0 10px"> maxWidth: 500,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- maxHeight: 200,
- text: settings.text
- },
- onPostRender: function () {
- this.aria('describedby', this.items()[0]._id);
- },
- onClose: settings.onClose,
- onCancel: function () {
- callback(false);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ maxHeight: 200
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }).renderTo(document.body).reflow();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ this._super(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">- alert: function (settings, callback) {
- if (typeof settings === 'string') {
- settings = { text: settings };
- }
- settings.callback = callback;
- return MessageBox.msgBox(settings);
- },
- confirm: function (settings, callback) {
- if (typeof settings === 'string') {
- settings = { text: settings };
- }
- settings.callback = callback;
- settings.buttons = MessageBox.OK_CANCEL;
- return MessageBox.msgBox(settings);
- }
- }
- });
-
- function WindowManagerImpl (editor) {
- var open$$1 = function (args, params, closeCallback) {
- var win;
- args.title = args.title || ' ';
- args.url = args.url || args.file;
- if (args.url) {
- args.width = parseInt(args.width || 320, 10);
- args.height = parseInt(args.height || 240, 10);
- }
- if (args.body) {
- args.items = {
- defaults: args.defaults,
- type: args.bodyType || 'form',
- items: args.body,
- data: args.data,
- callbacks: args.commands
- };
- }
- if (!args.url && !args.buttons) {
- args.buttons = [
- {
- text: 'Ok',
- subtype: 'primary',
- onclick: function () {
- win.find('form')[0].submit();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Statics: {
+ OK: 1,
+ OK_CANCEL: 2,
+ YES_NO: 3,
+ YES_NO_CANCEL: 4,
+ msgBox: function (settings) {
+ var buttons;
+ var callback = settings.callback || function () {
+ };
+ function createButton(text, status$$1, primary) {
+ return {
+ type: 'button',
+ text: text,
+ subtype: primary ? 'primary' : '',
+ onClick: function (e) {
+ e.control.parents()[1].close();
+ callback(status$$1);
+ }
+ };
+ }
+ switch (settings.buttons) {
+ case MessageBox.OK_CANCEL:
+ buttons = [
+ createButton('Ok', true, true),
+ createButton('Cancel', false)
+ ];
+ break;
+ case MessageBox.YES_NO:
+ case MessageBox.YES_NO_CANCEL:
+ buttons = [
+ createButton('Yes', 1, true),
+ createButton('No', 0)
+ ];
+ if (settings.buttons === MessageBox.YES_NO_CANCEL) {
+ buttons.push(createButton('Cancel', -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">- },
- {
- text: 'Cancel',
- onclick: function () {
- win.close();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ break;
+ default:
+ buttons = [createButton('Ok', true, true)];
+ break;
+ }
+ return new Window$$1({
+ padding: 20,
+ x: settings.x,
+ y: settings.y,
+ minWidth: 300,
+ minHeight: 100,
+ layout: 'flex',
+ pack: 'center',
+ align: 'center',
+ buttons: buttons,
+ title: settings.title,
+ role: 'alertdialog',
+ items: {
+ type: 'label',
+ multiline: true,
+ maxWidth: 500,
+ maxHeight: 200,
+ text: settings.text
+ },
+ onPostRender: function () {
+ this.aria('describedby', this.items()[0]._id);
+ },
+ onClose: settings.onClose,
+ onCancel: function () {
+ callback(false);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }).renderTo(document.body).reflow();
+ },
+ alert: function (settings, callback) {
+ if (typeof settings === 'string') {
+ settings = { text: 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">- ];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ settings.callback = callback;
+ return MessageBox.msgBox(settings);
+ },
+ confirm: function (settings, callback) {
+ if (typeof settings === 'string') {
+ settings = { text: settings };
+ }
+ settings.callback = callback;
+ settings.buttons = MessageBox.OK_CANCEL;
+ return MessageBox.msgBox(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">- win = new Window$$1(args);
- win.on('close', function () {
- closeCallback(win);
- });
- if (args.data) {
- win.on('postRender', function () {
- this.find('*').each(function (ctrl) {
- var name$$1 = ctrl.name();
- if (name$$1 in args.data) {
- ctrl.value(args.data[name$$1]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ function WindowManagerImpl (editor) {
+ var open$$1 = function (args, params, closeCallback) {
+ var win;
+ args.title = args.title || ' ';
+ args.url = args.url || args.file;
+ if (args.url) {
+ args.width = parseInt(args.width || 320, 10);
+ args.height = parseInt(args.height || 240, 10);
+ }
+ if (args.body) {
+ args.items = {
+ defaults: args.defaults,
+ type: args.bodyType || 'form',
+ items: args.body,
+ data: args.data,
+ callbacks: args.commands
+ };
+ }
+ if (!args.url && !args.buttons) {
+ args.buttons = [
+ {
+ text: 'Ok',
+ subtype: 'primary',
+ onclick: function () {
+ win.find('form')[0].submit();
+ }
+ },
+ {
+ text: 'Cancel',
+ onclick: function () {
+ win.close();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ];
+ }
+ win = new Window$$1(args);
+ win.on('close', function () {
+ closeCallback(win);
+ });
+ if (args.data) {
+ win.on('postRender', function () {
+ this.find('*').each(function (ctrl) {
+ var name$$1 = ctrl.name();
+ if (name$$1 in args.data) {
+ ctrl.value(args.data[name$$1]);
+ }
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ win.features = args || {};
+ win.params = params || {};
+ win = win.renderTo(document.body).reflow();
+ return win;
+ };
+ var alert$$1 = function (message, choiceCallback, closeCallback) {
+ var win;
+ win = MessageBox.alert(message, function () {
+ choiceCallback();
</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.features = args || {};
- win.params = params || {};
- win = win.renderTo(document.body).reflow();
- return win;
- };
- var alert$$1 = function (message, choiceCallback, closeCallback) {
- var win;
- win = MessageBox.alert(message, function () {
- choiceCallback();
- });
- win.on('close', function () {
- closeCallback(win);
- });
- return win;
- };
- var confirm$$1 = function (message, choiceCallback, closeCallback) {
- var win;
- win = MessageBox.confirm(message, function (state) {
- choiceCallback(state);
- });
- win.on('close', function () {
- closeCallback(win);
- });
- return win;
- };
- var close$$1 = function (window$$1) {
- window$$1.close();
- };
- var getParams = function (window$$1) {
- return window$$1.params;
- };
- var setParams = function (window$$1, params) {
- window$$1.params = params;
- };
- return {
- open: open$$1,
- alert: alert$$1,
- confirm: confirm$$1,
- close: close$$1,
- getParams: getParams,
- setParams: setParams
- };
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ win.on('close', function () {
+ closeCallback(win);
+ });
+ return win;
+ };
+ var confirm$$1 = function (message, choiceCallback, closeCallback) {
+ var win;
+ win = MessageBox.confirm(message, function (state) {
+ choiceCallback(state);
+ });
+ win.on('close', function () {
+ closeCallback(win);
+ });
+ return win;
+ };
+ var close$$1 = function (window$$1) {
+ window$$1.close();
+ };
+ var getParams = function (window$$1) {
+ return window$$1.params;
+ };
+ var setParams = function (window$$1, params) {
+ window$$1.params = params;
+ };
+ return {
+ open: open$$1,
+ alert: alert$$1,
+ confirm: confirm$$1,
+ close: close$$1,
+ getParams: getParams,
+ setParams: setParams
+ };
+ }
</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 get = function (editor) {
- var renderUI = function (args) {
- return $_as4c3qtrjjgwefn1.renderUI(editor, this, args);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var get = function (editor) {
+ var renderUI = function (args) {
+ return Render.renderUI(editor, this, args);
+ };
+ var resizeTo = function (w, h) {
+ return Resize.resizeTo(editor, w, h);
+ };
+ var resizeBy = function (dw, dh) {
+ return Resize.resizeBy(editor, dw, dh);
+ };
+ var getNotificationManagerImpl = function () {
+ return NotificationManagerImpl(editor);
+ };
+ var getWindowManagerImpl = function () {
+ return WindowManagerImpl(editor);
+ };
+ return {
+ renderUI: renderUI,
+ resizeTo: resizeTo,
+ resizeBy: resizeBy,
+ getNotificationManagerImpl: getNotificationManagerImpl,
+ getWindowManagerImpl: getWindowManagerImpl
+ };
</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 resizeTo = function (w, h) {
- return $_sd6u0ubjjgwefok.resizeTo(editor, w, h);
- };
- var resizeBy = function (dw, dh) {
- return $_sd6u0ubjjgwefok.resizeBy(editor, dw, dh);
- };
- var getNotificationManagerImpl = function () {
- return NotificationManagerImpl(editor);
- };
- var getWindowManagerImpl = function () {
- return WindowManagerImpl(editor);
- };
- return {
- renderUI: renderUI,
- resizeTo: resizeTo,
- resizeBy: resizeBy,
- getNotificationManagerImpl: getNotificationManagerImpl,
- getWindowManagerImpl: getWindowManagerImpl
- };
- };
- var $_buaxbttqjjgwefn0 = { get: get };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ThemeApi = { get: get };
</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 Layout = global$10.extend({
- Defaults: {
- firstControlClass: 'first',
- lastControlClass: 'last'
- },
- init: function (settings) {
- this.settings = global$2.extend({}, this.Defaults, settings);
- },
- preRender: function (container) {
- container.bodyClasses.add(this.settings.containerClass);
- },
- applyClasses: function (items) {
- var self = this;
- var settings = self.settings;
- var firstClass, lastClass, firstItem, lastItem;
- firstClass = settings.firstControlClass;
- lastClass = settings.lastControlClass;
- items.each(function (item) {
- item.classes.remove(firstClass).remove(lastClass).add(settings.controlClass);
- if (item.visible()) {
- if (!firstItem) {
- firstItem = item;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Layout = global$a.extend({
+ Defaults: {
+ firstControlClass: 'first',
+ lastControlClass: 'last'
+ },
+ init: function (settings) {
+ this.settings = global$2.extend({}, this.Defaults, settings);
+ },
+ preRender: function (container) {
+ container.bodyClasses.add(this.settings.containerClass);
+ },
+ applyClasses: function (items) {
+ var self = this;
+ var settings = self.settings;
+ var firstClass, lastClass, firstItem, lastItem;
+ firstClass = settings.firstControlClass;
+ lastClass = settings.lastControlClass;
+ items.each(function (item) {
+ item.classes.remove(firstClass).remove(lastClass).add(settings.controlClass);
+ if (item.visible()) {
+ if (!firstItem) {
+ firstItem = item;
+ }
+ lastItem = item;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- lastItem = item;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ if (firstItem) {
+ firstItem.classes.add(firstClass);
</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 (firstItem) {
- firstItem.classes.add(firstClass);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (lastItem) {
+ lastItem.classes.add(lastClass);
+ }
+ },
+ renderHtml: function (container) {
+ var self = this;
+ var html = '';
+ self.applyClasses(container.items());
+ container.items().each(function (item) {
+ html += item.renderHtml();
+ });
+ return html;
+ },
+ recalc: function () {
+ },
+ postRender: function () {
+ },
+ isNative: function () {
+ 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 (lastItem) {
- lastItem.classes.add(lastClass);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var AbsoluteLayout = Layout.extend({
+ Defaults: {
+ containerClass: 'abs-layout',
+ controlClass: 'abs-layout-item'
+ },
+ recalc: function (container) {
+ container.items().filter(':visible').each(function (ctrl) {
+ var settings = ctrl.settings;
+ ctrl.layoutRect({
+ x: settings.x,
+ y: settings.y,
+ w: settings.w,
+ h: settings.h
+ });
+ if (ctrl.recalc) {
+ ctrl.recalc();
+ }
+ });
+ },
+ renderHtml: function (container) {
+ return '<div id="' + container._id + '-absend" class="' + container.classPrefix + 'abs-end"></div>' + this._super(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">- },
- renderHtml: function (container) {
- var self = this;
- var html = '';
- self.applyClasses(container.items());
- container.items().each(function (item) {
- html += item.renderHtml();
- });
- return html;
- },
- recalc: function () {
- },
- postRender: function () {
- },
- isNative: function () {
- return false;
- }
- });
</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">- var AbsoluteLayout = Layout.extend({
- Defaults: {
- containerClass: 'abs-layout',
- controlClass: 'abs-layout-item'
- },
- recalc: function (container) {
- container.items().filter(':visible').each(function (ctrl) {
- var settings = ctrl.settings;
- ctrl.layoutRect({
- x: settings.x,
- y: settings.y,
- w: settings.w,
- h: settings.h
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Button = Widget.extend({
+ Defaults: {
+ classes: 'widget btn',
+ role: 'button'
+ },
+ init: function (settings) {
+ var self$$1 = this;
+ var size;
+ self$$1._super(settings);
+ settings = self$$1.settings;
+ size = self$$1.settings.size;
+ self$$1.on('click mousedown', function (e) {
+ e.preventDefault();
</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 (ctrl.recalc) {
- ctrl.recalc();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.on('touchstart', function (e) {
+ self$$1.fire('click', e);
+ e.preventDefault();
+ });
+ if (settings.subtype) {
+ self$$1.classes.add(settings.subtype);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- },
- renderHtml: function (container) {
- return '<div id="' + container._id + '-absend" class="' + container.classPrefix + 'abs-end"></div>' + this._super(container);
- }
- });
-
- var Button = Widget.extend({
- Defaults: {
- classes: 'widget btn',
- role: 'button'
- },
- init: function (settings) {
- var self$$1 = this;
- var size;
- self$$1._super(settings);
- settings = self$$1.settings;
- size = self$$1.settings.size;
- self$$1.on('click mousedown', function (e) {
- e.preventDefault();
- });
- self$$1.on('touchstart', function (e) {
- self$$1.fire('click', e);
- e.preventDefault();
- });
- if (settings.subtype) {
- self$$1.classes.add(settings.subtype);
- }
- if (size) {
- self$$1.classes.add('btn-' + size);
- }
- if (settings.icon) {
- self$$1.icon(settings.icon);
- }
- },
- icon: function (icon) {
- if (!arguments.length) {
- return this.state.get('icon');
- }
- this.state.set('icon', icon);
- return this;
- },
- repaint: function () {
- var btnElm = this.getEl().firstChild;
- var btnStyle;
- if (btnElm) {
- btnStyle = btnElm.style;
- btnStyle.width = btnStyle.height = '100%';
- }
- this._super();
- },
- renderHtml: function () {
- var self$$1 = this, id = self$$1._id, prefix = self$$1.classPrefix;
- var icon = self$$1.state.get('icon'), image;
- var text = self$$1.state.get('text');
- var textHtml = '';
- var ariaPressed;
- var settings = self$$1.settings;
- image = settings.image;
- if (image) {
- icon = 'none';
- if (typeof image !== 'string') {
- image = window.getSelection ? image[0] : image[1];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (size) {
+ self$$1.classes.add('btn-' + size);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- image = ' style="background-image: url(\'' + image + '\')"';
- } else {
- image = '';
- }
- if (text) {
- self$$1.classes.add('btn-has-text');
- textHtml = '<span class="' + prefix + 'txt">' + self$$1.encode(text) + '</span>';
- }
- icon = icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
- ariaPressed = typeof settings.active === 'boolean' ? ' aria-pressed="' + settings.active + '"' : '';
- return '<div id="' + id + '" class="' + self$$1.classes + '" tabindex="-1"' + ariaPressed + '>' + '<button id="' + id + '-button" role="presentation" type="button" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + textHtml + '</button>' + '</div>';
- },
- bindStates: function () {
- var self$$1 = this, $ = self$$1.$, textCls = self$$1.classPrefix + 'txt';
- function setButtonText(text) {
- var $span = $('span.' + textCls, self$$1.getEl());
- if (text) {
- if (!$span[0]) {
- $('button:first', self$$1.getEl()).append('<span class="' + textCls + '"></span>');
- $span = $('span.' + textCls, self$$1.getEl());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (settings.icon) {
+ self$$1.icon(settings.icon);
+ }
+ },
+ icon: function (icon) {
+ if (!arguments.length) {
+ return this.state.get('icon');
+ }
+ this.state.set('icon', icon);
+ return this;
+ },
+ repaint: function () {
+ var btnElm = this.getEl().firstChild;
+ var btnStyle;
+ if (btnElm) {
+ btnStyle = btnElm.style;
+ btnStyle.width = btnStyle.height = '100%';
+ }
+ this._super();
+ },
+ renderHtml: function () {
+ var self$$1 = this, id = self$$1._id, prefix = self$$1.classPrefix;
+ var icon = self$$1.state.get('icon'), image;
+ var text = self$$1.state.get('text');
+ var textHtml = '';
+ var ariaPressed;
+ var settings = self$$1.settings;
+ image = settings.image;
+ if (image) {
+ icon = 'none';
+ if (typeof image !== 'string') {
+ image = window.getSelection ? image[0] : image[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">- $span.html(self$$1.encode(text));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ image = ' style="background-image: url(\'' + image + '\')"';
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $span.remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ image = '';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.classes.toggle('btn-has-text', !!text);
- }
- self$$1.state.on('change:text', function (e) {
- setButtonText(e.value);
- });
- self$$1.state.on('change:icon', function (e) {
- var icon = e.value;
- var prefix = self$$1.classPrefix;
- self$$1.settings.icon = icon;
- icon = icon ? prefix + 'ico ' + prefix + 'i-' + self$$1.settings.icon : '';
- var btnElm = self$$1.getEl().firstChild;
- var iconElm = btnElm.getElementsByTagName('i')[0];
- if (icon) {
- if (!iconElm || iconElm !== btnElm.firstChild) {
- iconElm = document.createElement('i');
- btnElm.insertBefore(iconElm, btnElm.firstChild);
- }
- iconElm.className = icon;
- } else if (iconElm) {
- btnElm.removeChild(iconElm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (text) {
+ self$$1.classes.add('btn-has-text');
+ textHtml = '<span class="' + prefix + 'txt">' + self$$1.encode(text) + '</span>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- setButtonText(self$$1.state.get('text'));
- });
- return self$$1._super();
- }
- });
-
- var BrowseButton = Button.extend({
- init: function (settings) {
- var self = this;
- settings = global$2.extend({
- text: 'Browse...',
- multiple: false,
- accept: null
- }, settings);
- self._super(settings);
- self.classes.add('browsebutton');
- if (settings.multiple) {
- self.classes.add('multiple');
- }
- },
- postRender: function () {
- var self = this;
- var input = funcs.create('input', {
- type: 'file',
- id: self._id + '-browse',
- accept: self.settings.accept
- });
- self._super();
- global$9(input).on('change', function (e) {
- var files = e.target.files;
- self.value = function () {
- if (!files.length) {
- return null;
- } else if (self.settings.multiple) {
- return files;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ icon = icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
+ ariaPressed = typeof settings.active === 'boolean' ? ' aria-pressed="' + settings.active + '"' : '';
+ return '<div id="' + id + '" class="' + self$$1.classes + '" tabindex="-1"' + ariaPressed + '>' + '<button id="' + id + '-button" role="presentation" type="button" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + textHtml + '</button>' + '</div>';
+ },
+ bindStates: function () {
+ var self$$1 = this, $ = self$$1.$, textCls = self$$1.classPrefix + 'txt';
+ function setButtonText(text) {
+ var $span = $('span.' + textCls, self$$1.getEl());
+ if (text) {
+ if (!$span[0]) {
+ $('button:first', self$$1.getEl()).append('<span class="' + textCls + '"></span>');
+ $span = $('span.' + textCls, self$$1.getEl());
+ }
+ $span.html(self$$1.encode(text));
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return files[0];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $span.remove();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- e.preventDefault();
- if (files.length) {
- self.fire('change', e);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.classes.toggle('btn-has-text', !!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">- });
- global$9(input).on('click', function (e) {
- e.stopPropagation();
- });
- global$9(self.getEl('button')).on('click', function (e) {
- e.stopPropagation();
- input.click();
- });
- self.getEl().appendChild(input);
- },
- remove: function () {
- global$9(this.getEl('button')).off();
- global$9(this.getEl('input')).off();
- this._super();
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.state.on('change:text', function (e) {
+ setButtonText(e.value);
+ });
+ self$$1.state.on('change:icon', function (e) {
+ var icon = e.value;
+ var prefix = self$$1.classPrefix;
+ self$$1.settings.icon = icon;
+ icon = icon ? prefix + 'ico ' + prefix + 'i-' + self$$1.settings.icon : '';
+ var btnElm = self$$1.getEl().firstChild;
+ var iconElm = btnElm.getElementsByTagName('i')[0];
+ if (icon) {
+ if (!iconElm || iconElm !== btnElm.firstChild) {
+ iconElm = document.createElement('i');
+ btnElm.insertBefore(iconElm, btnElm.firstChild);
+ }
+ iconElm.className = icon;
+ } else if (iconElm) {
+ btnElm.removeChild(iconElm);
+ }
+ setButtonText(self$$1.state.get('text'));
+ });
+ return self$$1._super();
+ }
+ });
</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 ButtonGroup = Container.extend({
- Defaults: {
- defaultType: 'button',
- role: 'group'
- },
- renderHtml: function () {
- var self = this, layout = self._layout;
- self.classes.add('btn-group');
- self.preRender();
- layout.preRender(self);
- return '<div id="' + self._id + '" class="' + self.classes + '">' + '<div id="' + self._id + '-body">' + (self.settings.html || '') + layout.renderHtml(self) + '</div>' + '</div>';
- }
- });
-
- var Checkbox = Widget.extend({
- Defaults: {
- classes: 'checkbox',
- role: 'checkbox',
- checked: false
- },
- init: function (settings) {
- var self$$1 = this;
- self$$1._super(settings);
- self$$1.on('click mousedown', function (e) {
- e.preventDefault();
- });
- self$$1.on('click', function (e) {
- e.preventDefault();
- if (!self$$1.disabled()) {
- self$$1.checked(!self$$1.checked());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var BrowseButton = Button.extend({
+ init: function (settings) {
+ var self = this;
+ settings = global$2.extend({
+ text: 'Browse...',
+ multiple: false,
+ accept: null
+ }, settings);
+ self._super(settings);
+ self.classes.add('browsebutton');
+ if (settings.multiple) {
+ self.classes.add('multiple');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self$$1.checked(self$$1.settings.checked);
- },
- checked: function (state) {
- if (!arguments.length) {
- return this.state.get('checked');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ postRender: function () {
+ var self = this;
+ var input = funcs.create('input', {
+ type: 'file',
+ id: self._id + '-browse',
+ accept: self.settings.accept
+ });
+ self._super();
+ global$9(input).on('change', function (e) {
+ var files = e.target.files;
+ self.value = function () {
+ if (!files.length) {
+ return null;
+ } else if (self.settings.multiple) {
+ return files;
+ } else {
+ return files[0];
+ }
+ };
+ e.preventDefault();
+ if (files.length) {
+ self.fire('change', e);
+ }
+ });
+ global$9(input).on('click', function (e) {
+ e.stopPropagation();
+ });
+ global$9(self.getEl('button')).on('click', function (e) {
+ e.stopPropagation();
+ input.click();
+ });
+ self.getEl().appendChild(input);
+ },
+ remove: function () {
+ global$9(this.getEl('button')).off();
+ global$9(this.getEl('input')).off();
+ this._super();
</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.state.set('checked', state);
- return this;
- },
- value: function (state) {
- if (!arguments.length) {
- return this.checked();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var ButtonGroup = Container.extend({
+ Defaults: {
+ defaultType: 'button',
+ role: 'group'
+ },
+ renderHtml: function () {
+ var self = this, layout = self._layout;
+ self.classes.add('btn-group');
+ self.preRender();
+ layout.preRender(self);
+ return '<div id="' + self._id + '" class="' + self.classes + '">' + '<div id="' + self._id + '-body">' + (self.settings.html || '') + layout.renderHtml(self) + '</div>' + '</div>';
</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 this.checked(state);
- },
- renderHtml: function () {
- var self$$1 = this, id = self$$1._id, prefix = self$$1.classPrefix;
- return '<div id="' + id + '" class="' + self$$1.classes + '" unselectable="on" aria-labelledby="' + id + '-al" tabindex="-1">' + '<i class="' + prefix + 'ico ' + prefix + 'i-checkbox"></i>' + '<span id="' + id + '-al" class="' + prefix + 'label">' + self$$1.encode(self$$1.state.get('text')) + '</span>' + '</div>';
- },
- bindStates: function () {
- var self$$1 = this;
- function checked(state) {
- self$$1.classes.toggle('checked', state);
- self$$1.aria('checked', state);
- }
- self$$1.state.on('change:text', function (e) {
- self$$1.getEl('al').firstChild.data = self$$1.translate(e.value);
- });
- self$$1.state.on('change:checked change:value', function (e) {
- self$$1.fire('change');
- checked(e.value);
- });
- self$$1.state.on('change:icon', function (e) {
- var icon = e.value;
- var prefix = self$$1.classPrefix;
- if (typeof icon === 'undefined') {
- return self$$1.settings.icon;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var Checkbox = Widget.extend({
+ Defaults: {
+ classes: 'checkbox',
+ role: 'checkbox',
+ checked: false
+ },
+ init: function (settings) {
+ var self$$1 = this;
+ self$$1._super(settings);
+ self$$1.on('click mousedown', function (e) {
+ e.preventDefault();
+ });
+ self$$1.on('click', function (e) {
+ e.preventDefault();
+ if (!self$$1.disabled()) {
+ self$$1.checked(!self$$1.checked());
+ }
+ });
+ self$$1.checked(self$$1.settings.checked);
+ },
+ checked: function (state) {
+ if (!arguments.length) {
+ return this.state.get('checked');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.settings.icon = icon;
- icon = icon ? prefix + 'ico ' + prefix + 'i-' + self$$1.settings.icon : '';
- var btnElm = self$$1.getEl().firstChild;
- var iconElm = btnElm.getElementsByTagName('i')[0];
- if (icon) {
- if (!iconElm || iconElm !== btnElm.firstChild) {
- iconElm = document.createElement('i');
- btnElm.insertBefore(iconElm, btnElm.firstChild);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.state.set('checked', state);
+ return this;
+ },
+ value: function (state) {
+ if (!arguments.length) {
+ return this.checked();
+ }
+ return this.checked(state);
+ },
+ renderHtml: function () {
+ var self$$1 = this, id = self$$1._id, prefix = self$$1.classPrefix;
+ return '<div id="' + id + '" class="' + self$$1.classes + '" unselectable="on" aria-labelledby="' + id + '-al" tabindex="-1">' + '<i class="' + prefix + 'ico ' + prefix + 'i-checkbox"></i>' + '<span id="' + id + '-al" class="' + prefix + 'label">' + self$$1.encode(self$$1.state.get('text')) + '</span>' + '</div>';
+ },
+ bindStates: function () {
+ var self$$1 = this;
+ function checked(state) {
+ self$$1.classes.toggle('checked', state);
+ self$$1.aria('checked', state);
+ }
+ self$$1.state.on('change:text', function (e) {
+ self$$1.getEl('al').firstChild.data = self$$1.translate(e.value);
+ });
+ self$$1.state.on('change:checked change:value', function (e) {
+ self$$1.fire('change');
+ checked(e.value);
+ });
+ self$$1.state.on('change:icon', function (e) {
+ var icon = e.value;
+ var prefix = self$$1.classPrefix;
+ if (typeof icon === 'undefined') {
+ return self$$1.settings.icon;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- iconElm.className = icon;
- } else if (iconElm) {
- btnElm.removeChild(iconElm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.settings.icon = icon;
+ icon = icon ? prefix + 'ico ' + prefix + 'i-' + self$$1.settings.icon : '';
+ var btnElm = self$$1.getEl().firstChild;
+ var iconElm = btnElm.getElementsByTagName('i')[0];
+ if (icon) {
+ if (!iconElm || iconElm !== btnElm.firstChild) {
+ iconElm = document.createElement('i');
+ btnElm.insertBefore(iconElm, btnElm.firstChild);
+ }
+ iconElm.className = icon;
+ } else if (iconElm) {
+ btnElm.removeChild(iconElm);
+ }
+ });
+ if (self$$1.state.get('checked')) {
+ checked(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 (self$$1.state.get('checked')) {
- checked(true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$1._super();
</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 self$$1._super();
- }
- });
</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">- var global$13 = tinymce.util.Tools.resolve('tinymce.util.VK');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$d = tinymce.util.Tools.resolve('tinymce.util.VK');
</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 ComboBox = Widget.extend({
- init: function (settings) {
- var self$$1 = this;
- self$$1._super(settings);
- settings = self$$1.settings;
- self$$1.classes.add('combobox');
- self$$1.subinput = true;
- self$$1.ariaTarget = 'inp';
- settings.menu = settings.menu || settings.values;
- if (settings.menu) {
- settings.icon = 'caret';
- }
- self$$1.on('click', function (e) {
- var elm = e.target;
- var root = self$$1.getEl();
- if (!global$9.contains(root, elm) && elm !== root) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ComboBox = Widget.extend({
+ init: function (settings) {
+ var self$$1 = this;
+ self$$1._super(settings);
+ settings = self$$1.settings;
+ self$$1.classes.add('combobox');
+ self$$1.subinput = true;
+ self$$1.ariaTarget = 'inp';
+ settings.menu = settings.menu || settings.values;
+ if (settings.menu) {
+ settings.icon = 'caret';
</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 (elm && elm !== root) {
- if (elm.id && elm.id.indexOf('-open') !== -1) {
- self$$1.fire('action');
- if (settings.menu) {
- self$$1.showMenu();
- if (e.aria) {
- self$$1.menu.items()[0].focus();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.on('click', function (e) {
+ var elm = e.target;
+ var root = self$$1.getEl();
+ if (!global$9.contains(root, elm) && elm !== root) {
+ return;
+ }
+ while (elm && elm !== root) {
+ if (elm.id && elm.id.indexOf('-open') !== -1) {
+ self$$1.fire('action');
+ if (settings.menu) {
+ self$$1.showMenu();
+ if (e.aria) {
+ self$$1.menu.items()[0].focus();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><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">- elm = elm.parentNode;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ self$$1.on('keydown', function (e) {
+ var rootControl;
+ if (e.keyCode === 13 && e.target.nodeName === 'INPUT') {
+ e.preventDefault();
+ self$$1.parents().reverse().each(function (ctrl) {
+ if (ctrl.toJSON) {
+ rootControl = ctrl;
+ return false;
+ }
+ });
+ self$$1.fire('submit', { data: rootControl.toJSON() });
+ }
+ });
+ self$$1.on('keyup', function (e) {
+ if (e.target.nodeName === 'INPUT') {
+ var oldValue = self$$1.state.get('value');
+ var newValue = e.target.value;
+ if (newValue !== oldValue) {
+ self$$1.state.set('value', newValue);
+ self$$1.fire('autocomplete', e);
+ }
+ }
+ });
+ self$$1.on('mouseover', function (e) {
+ var tooltip = self$$1.tooltip().moveTo(-65535);
+ if (self$$1.statusLevel() && e.target.className.indexOf(self$$1.classPrefix + 'status') !== -1) {
+ var statusMessage = self$$1.statusMessage() || 'Ok';
+ var rel = tooltip.text(statusMessage).show().testMoveRel(e.target, [
+ 'bc-tc',
+ 'bc-tl',
+ 'bc-tr'
+ ]);
+ tooltip.classes.toggle('tooltip-n', rel === 'bc-tc');
+ tooltip.classes.toggle('tooltip-nw', rel === 'bc-tl');
+ tooltip.classes.toggle('tooltip-ne', rel === 'bc-tr');
+ tooltip.moveRel(e.target, rel);
+ }
+ });
+ },
+ statusLevel: function (value) {
+ if (arguments.length > 0) {
+ this.state.set('statusLevel', 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">- });
- self$$1.on('keydown', function (e) {
- var rootControl;
- if (e.keyCode === 13 && e.target.nodeName === 'INPUT') {
- e.preventDefault();
- self$$1.parents().reverse().each(function (ctrl) {
- if (ctrl.toJSON) {
- rootControl = ctrl;
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this.state.get('statusLevel');
+ },
+ statusMessage: function (value) {
+ if (arguments.length > 0) {
+ this.state.set('statusMessage', value);
+ }
+ return this.state.get('statusMessage');
+ },
+ showMenu: function () {
+ var self$$1 = this;
+ var settings = self$$1.settings;
+ var menu;
+ if (!self$$1.menu) {
+ menu = settings.menu || [];
+ if (menu.length) {
+ menu = {
+ type: 'menu',
+ items: menu
+ };
+ } else {
+ menu.type = menu.type || 'menu';
+ }
+ self$$1.menu = global$4.create(menu).parent(self$$1).renderTo(self$$1.getContainerElm());
+ self$$1.fire('createmenu');
+ self$$1.menu.reflow();
+ self$$1.menu.on('cancel', function (e) {
+ if (e.control === self$$1.menu) {
+ self$$1.focus();
</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">- self$$1.fire('submit', { data: rootControl.toJSON() });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.menu.on('show hide', function (e) {
+ e.control.items().each(function (ctrl) {
+ ctrl.active(ctrl.value() === self$$1.value());
+ });
+ }).fire('show');
+ self$$1.menu.on('select', function (e) {
+ self$$1.value(e.control.value());
+ });
+ self$$1.on('focusin', function (e) {
+ if (e.target.tagName.toUpperCase() === 'INPUT') {
+ self$$1.menu.hide();
+ }
+ });
+ self$$1.aria('expanded', 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">- });
- self$$1.on('keyup', function (e) {
- if (e.target.nodeName === 'INPUT') {
- var oldValue = self$$1.state.get('value');
- var newValue = e.target.value;
- if (newValue !== oldValue) {
- self$$1.state.set('value', newValue);
- self$$1.fire('autocomplete', e);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.menu.show();
+ self$$1.menu.layoutRect({ w: self$$1.layoutRect().w });
+ self$$1.menu.moveRel(self$$1.getEl(), self$$1.isRtl() ? [
+ 'br-tr',
+ 'tr-br'
+ ] : [
+ 'bl-tl',
+ 'tl-bl'
+ ]);
+ },
+ focus: function () {
+ this.getEl('inp').focus();
+ },
+ repaint: function () {
+ var self$$1 = this, elm = self$$1.getEl(), openElm = self$$1.getEl('open'), rect = self$$1.layoutRect();
+ var width, lineHeight, innerPadding = 0;
+ var inputElm = elm.firstChild;
+ if (self$$1.statusLevel() && self$$1.statusLevel() !== 'none') {
+ innerPadding = parseInt(funcs.getRuntimeStyle(inputElm, 'padding-right'), 10) - parseInt(funcs.getRuntimeStyle(inputElm, 'padding-left'), 10);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self$$1.on('mouseover', function (e) {
- var tooltip = self$$1.tooltip().moveTo(-65535);
- if (self$$1.statusLevel() && e.target.className.indexOf(self$$1.classPrefix + 'status') !== -1) {
- var statusMessage = self$$1.statusMessage() || 'Ok';
- var rel = tooltip.text(statusMessage).show().testMoveRel(e.target, [
- 'bc-tc',
- 'bc-tl',
- 'bc-tr'
- ]);
- tooltip.classes.toggle('tooltip-n', rel === 'bc-tc');
- tooltip.classes.toggle('tooltip-nw', rel === 'bc-tl');
- tooltip.classes.toggle('tooltip-ne', rel === 'bc-tr');
- tooltip.moveRel(e.target, rel);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (openElm) {
+ width = rect.w - funcs.getSize(openElm).width - 10;
+ } else {
+ width = rect.w - 10;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- },
- statusLevel: function (value) {
- if (arguments.length > 0) {
- this.state.set('statusLevel', value);
- }
- return this.state.get('statusLevel');
- },
- statusMessage: function (value) {
- if (arguments.length > 0) {
- this.state.set('statusMessage', value);
- }
- return this.state.get('statusMessage');
- },
- showMenu: function () {
- var self$$1 = this;
- var settings = self$$1.settings;
- var menu;
- if (!self$$1.menu) {
- menu = settings.menu || [];
- if (menu.length) {
- menu = {
- type: 'menu',
- items: menu
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var doc = document;
+ if (doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
+ lineHeight = self$$1.layoutRect().h - 2 + 'px';
+ }
+ global$9(inputElm).css({
+ width: width - innerPadding,
+ lineHeight: lineHeight
+ });
+ self$$1._super();
+ return self$$1;
+ },
+ postRender: function () {
+ var self$$1 = this;
+ global$9(this.getEl('inp')).on('change', function (e) {
+ self$$1.state.set('value', e.target.value);
+ self$$1.fire('change', e);
+ });
+ return self$$1._super();
+ },
+ renderHtml: function () {
+ var self$$1 = this, id = self$$1._id, settings = self$$1.settings, prefix = self$$1.classPrefix;
+ var value = self$$1.state.get('value') || '';
+ var icon, text, openBtnHtml = '', extraAttrs = '', statusHtml = '';
+ if ('spellcheck' in settings) {
+ extraAttrs += ' spellcheck="' + settings.spellcheck + '"';
+ }
+ if (settings.maxLength) {
+ extraAttrs += ' maxlength="' + settings.maxLength + '"';
+ }
+ if (settings.size) {
+ extraAttrs += ' size="' + settings.size + '"';
+ }
+ if (settings.subtype) {
+ extraAttrs += ' type="' + settings.subtype + '"';
+ }
+ statusHtml = '<i id="' + id + '-status" class="mce-status mce-ico" style="display: none"></i>';
+ if (self$$1.disabled()) {
+ extraAttrs += ' disabled="disabled"';
+ }
+ icon = settings.icon;
+ if (icon && icon !== 'caret') {
+ icon = prefix + 'ico ' + prefix + 'i-' + settings.icon;
+ }
+ text = self$$1.state.get('text');
+ if (icon || text) {
+ openBtnHtml = '<div id="' + id + '-open" class="' + prefix + 'btn ' + prefix + 'open" tabIndex="-1" role="button">' + '<button id="' + id + '-action" type="button" hidefocus="1" tabindex="-1">' + (icon !== 'caret' ? '<i class="' + icon + '"></i>' : '<i class="' + prefix + 'caret"></i>') + (text ? (icon ? ' ' : '') + text : '') + '</button>' + '</div>';
+ self$$1.classes.add('has-open');
+ }
+ return '<div id="' + id + '" class="' + self$$1.classes + '">' + '<input id="' + id + '-inp" class="' + prefix + 'textbox" value="' + self$$1.encode(value, false) + '" hidefocus="1"' + extraAttrs + ' placeholder="' + self$$1.encode(settings.placeholder) + '" />' + statusHtml + openBtnHtml + '</div>';
+ },
+ value: function (value) {
+ if (arguments.length) {
+ this.state.set('value', value);
+ return this;
+ }
+ if (this.state.get('rendered')) {
+ this.state.set('value', this.getEl('inp').value);
+ }
+ return this.state.get('value');
+ },
+ showAutoComplete: function (items, term) {
+ var self$$1 = this;
+ if (items.length === 0) {
+ self$$1.hideMenu();
+ return;
+ }
+ var insert = function (value, title) {
+ return function () {
+ self$$1.fire('selectitem', {
+ title: title,
+ value: value
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ if (self$$1.menu) {
+ self$$1.menu.items().remove();
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- menu.type = menu.type || 'menu';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.menu = global$4.create({
+ type: 'menu',
+ classes: 'combobox-menu',
+ layout: 'flow'
+ }).parent(self$$1).renderTo();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.menu = global$4.create(menu).parent(self$$1).renderTo(self$$1.getContainerElm());
- self$$1.fire('createmenu');
- self$$1.menu.reflow();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global$2.each(items, function (item) {
+ self$$1.menu.add({
+ text: item.title,
+ url: item.previewUrl,
+ match: term,
+ classes: 'menu-item-ellipsis',
+ onclick: insert(item.value, item.title)
+ });
+ });
+ self$$1.menu.renderNew();
+ self$$1.hideMenu();
</ins><span class="cx" style="display: block; padding: 0 10px"> self$$1.menu.on('cancel', function (e) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (e.control === self$$1.menu) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (e.control.parent() === self$$1.menu) {
+ e.stopPropagation();
</ins><span class="cx" style="display: block; padding: 0 10px"> self$$1.focus();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.hideMenu();
</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">- self$$1.menu.on('show hide', function (e) {
- e.control.items().each(function (ctrl) {
- ctrl.active(ctrl.value() === self$$1.value());
- });
- }).fire('show');
- self$$1.menu.on('select', function (e) {
- self$$1.value(e.control.value());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.menu.on('select', function () {
+ self$$1.focus();
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.on('focusin', function (e) {
- if (e.target.tagName.toUpperCase() === 'INPUT') {
- self$$1.menu.hide();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var maxW = self$$1.layoutRect().w;
+ self$$1.menu.layoutRect({
+ w: maxW,
+ minW: 0,
+ maxW: maxW
+ });
+ self$$1.menu.repaint();
+ self$$1.menu.reflow();
+ self$$1.menu.show();
+ self$$1.menu.moveRel(self$$1.getEl(), self$$1.isRtl() ? [
+ 'br-tr',
+ 'tr-br'
+ ] : [
+ 'bl-tl',
+ 'tl-bl'
+ ]);
+ },
+ hideMenu: function () {
+ if (this.menu) {
+ this.menu.hide();
+ }
+ },
+ bindStates: function () {
+ var self$$1 = this;
+ self$$1.state.on('change:value', function (e) {
+ if (self$$1.getEl('inp').value !== e.value) {
+ self$$1.getEl('inp').value = e.value;
</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">- self$$1.aria('expanded', true);
- }
- self$$1.menu.show();
- self$$1.menu.layoutRect({ w: self$$1.layoutRect().w });
- self$$1.menu.moveRel(self$$1.getEl(), self$$1.isRtl() ? [
- 'br-tr',
- 'tr-br'
- ] : [
- 'bl-tl',
- 'tl-bl'
- ]);
- },
- focus: function () {
- this.getEl('inp').focus();
- },
- repaint: function () {
- var self$$1 = this, elm = self$$1.getEl(), openElm = self$$1.getEl('open'), rect = self$$1.layoutRect();
- var width, lineHeight, innerPadding = 0;
- var inputElm = elm.firstChild;
- if (self$$1.statusLevel() && self$$1.statusLevel() !== 'none') {
- innerPadding = parseInt(funcs.getRuntimeStyle(inputElm, 'padding-right'), 10) - parseInt(funcs.getRuntimeStyle(inputElm, 'padding-left'), 10);
- }
- if (openElm) {
- width = rect.w - funcs.getSize(openElm).width - 10;
- } else {
- width = rect.w - 10;
- }
- var doc = document;
- if (doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
- lineHeight = self$$1.layoutRect().h - 2 + 'px';
- }
- global$9(inputElm).css({
- width: width - innerPadding,
- lineHeight: lineHeight
- });
- self$$1._super();
- return self$$1;
- },
- postRender: function () {
- var self$$1 = this;
- global$9(this.getEl('inp')).on('change', function (e) {
- self$$1.state.set('value', e.target.value);
- self$$1.fire('change', e);
- });
- return self$$1._super();
- },
- renderHtml: function () {
- var self$$1 = this, id = self$$1._id, settings = self$$1.settings, prefix = self$$1.classPrefix;
- var value = self$$1.state.get('value') || '';
- var icon, text, openBtnHtml = '', extraAttrs = '', statusHtml = '';
- if ('spellcheck' in settings) {
- extraAttrs += ' spellcheck="' + settings.spellcheck + '"';
- }
- if (settings.maxLength) {
- extraAttrs += ' maxlength="' + settings.maxLength + '"';
- }
- if (settings.size) {
- extraAttrs += ' size="' + settings.size + '"';
- }
- if (settings.subtype) {
- extraAttrs += ' type="' + settings.subtype + '"';
- }
- statusHtml = '<i id="' + id + '-status" class="mce-status mce-ico" style="display: none"></i>';
- if (self$$1.disabled()) {
- extraAttrs += ' disabled="disabled"';
- }
- icon = settings.icon;
- if (icon && icon !== 'caret') {
- icon = prefix + 'ico ' + prefix + 'i-' + settings.icon;
- }
- text = self$$1.state.get('text');
- if (icon || text) {
- openBtnHtml = '<div id="' + id + '-open" class="' + prefix + 'btn ' + prefix + 'open" tabIndex="-1" role="button">' + '<button id="' + id + '-action" type="button" hidefocus="1" tabindex="-1">' + (icon !== 'caret' ? '<i class="' + icon + '"></i>' : '<i class="' + prefix + 'caret"></i>') + (text ? (icon ? ' ' : '') + text : '') + '</button>' + '</div>';
- self$$1.classes.add('has-open');
- }
- return '<div id="' + id + '" class="' + self$$1.classes + '">' + '<input id="' + id + '-inp" class="' + prefix + 'textbox" value="' + self$$1.encode(value, false) + '" hidefocus="1"' + extraAttrs + ' placeholder="' + self$$1.encode(settings.placeholder) + '" />' + statusHtml + openBtnHtml + '</div>';
- },
- value: function (value) {
- if (arguments.length) {
- this.state.set('value', value);
- return this;
- }
- if (this.state.get('rendered')) {
- this.state.set('value', this.getEl('inp').value);
- }
- return this.state.get('value');
- },
- showAutoComplete: function (items, term) {
- var self$$1 = this;
- if (items.length === 0) {
- self$$1.hideMenu();
- return;
- }
- var insert = function (value, title) {
- return function () {
- self$$1.fire('selectitem', {
- title: title,
- value: value
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.state.on('change:disabled', function (e) {
+ self$$1.getEl('inp').disabled = e.value;
+ });
+ self$$1.state.on('change:statusLevel', function (e) {
+ var statusIconElm = self$$1.getEl('status');
+ var prefix = self$$1.classPrefix, value = e.value;
+ funcs.css(statusIconElm, 'display', value === 'none' ? 'none' : '');
+ funcs.toggleClass(statusIconElm, prefix + 'i-checkmark', value === 'ok');
+ funcs.toggleClass(statusIconElm, prefix + 'i-warning', value === 'warn');
+ funcs.toggleClass(statusIconElm, prefix + 'i-error', value === 'error');
+ self$$1.classes.toggle('has-status', value !== 'none');
+ self$$1.repaint();
+ });
+ funcs.on(self$$1.getEl('status'), 'mouseleave', function () {
+ self$$1.tooltip().hide();
+ });
+ self$$1.on('cancel', function (e) {
+ if (self$$1.menu && self$$1.menu.visible()) {
+ e.stopPropagation();
+ self$$1.hideMenu();
+ }
+ });
+ var focusIdx = function (idx, menu) {
+ if (menu && menu.items().length > 0) {
+ menu.items().eq(idx)[0].focus();
+ }
</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 (self$$1.menu) {
- self$$1.menu.items().remove();
- } else {
- self$$1.menu = global$4.create({
- type: 'menu',
- classes: 'combobox-menu',
- layout: 'flow'
- }).parent(self$$1).renderTo();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.on('keydown', function (e) {
+ var keyCode = e.keyCode;
+ if (e.target.nodeName === 'INPUT') {
+ if (keyCode === global$d.DOWN) {
+ e.preventDefault();
+ self$$1.fire('autocomplete');
+ focusIdx(0, self$$1.menu);
+ } else if (keyCode === global$d.UP) {
+ e.preventDefault();
+ focusIdx(-1, self$$1.menu);
+ }
+ }
+ });
+ return self$$1._super();
+ },
+ remove: function () {
+ global$9(this.getEl('inp')).off();
+ if (this.menu) {
+ this.menu.remove();
+ }
+ this._super();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global$2.each(items, function (item) {
- self$$1.menu.add({
- text: item.title,
- url: item.previewUrl,
- match: term,
- classes: 'menu-item-ellipsis',
- onclick: insert(item.value, item.title)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var ColorBox = ComboBox.extend({
+ init: function (settings) {
+ var self = this;
+ settings.spellcheck = false;
+ if (settings.onaction) {
+ settings.icon = 'none';
+ }
+ self._super(settings);
+ self.classes.add('colorbox');
+ self.on('change keyup postrender', function () {
+ self.repaintColor(self.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">- });
- self$$1.menu.renderNew();
- self$$1.hideMenu();
- self$$1.menu.on('cancel', function (e) {
- if (e.control.parent() === self$$1.menu) {
- e.stopPropagation();
- self$$1.focus();
- self$$1.hideMenu();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ repaintColor: function (value) {
+ var openElm = this.getEl('open');
+ var elm = openElm ? openElm.getElementsByTagName('i')[0] : null;
+ if (elm) {
+ try {
+ elm.style.background = value;
+ } catch (ex) {
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self$$1.menu.on('select', function () {
- self$$1.focus();
- });
- var maxW = self$$1.layoutRect().w;
- self$$1.menu.layoutRect({
- w: maxW,
- minW: 0,
- maxW: maxW
- });
- self$$1.menu.repaint();
- self$$1.menu.reflow();
- self$$1.menu.show();
- self$$1.menu.moveRel(self$$1.getEl(), self$$1.isRtl() ? [
- 'br-tr',
- 'tr-br'
- ] : [
- 'bl-tl',
- 'tl-bl'
- ]);
- },
- hideMenu: function () {
- if (this.menu) {
- this.menu.hide();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ bindStates: function () {
+ var self = this;
+ self.state.on('change:value', function (e) {
+ if (self.state.get('rendered')) {
+ self.repaintColor(e.value);
+ }
+ });
+ return self._super();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- },
- bindStates: function () {
- var self$$1 = this;
- self$$1.state.on('change:value', function (e) {
- if (self$$1.getEl('inp').value !== e.value) {
- self$$1.getEl('inp').value = e.value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var PanelButton = Button.extend({
+ showPanel: function () {
+ var self = this, settings = self.settings;
+ self.classes.add('opened');
+ if (!self.panel) {
+ var panelSettings = settings.panel;
+ if (panelSettings.type) {
+ panelSettings = {
+ layout: 'grid',
+ items: panelSettings
+ };
+ }
+ panelSettings.role = panelSettings.role || 'dialog';
+ panelSettings.popover = true;
+ panelSettings.autohide = true;
+ panelSettings.ariaRoot = true;
+ self.panel = new FloatPanel(panelSettings).on('hide', function () {
+ self.classes.remove('opened');
+ }).on('cancel', function (e) {
+ e.stopPropagation();
+ self.focus();
+ self.hidePanel();
+ }).parent(self).renderTo(self.getContainerElm());
+ self.panel.fire('show');
+ self.panel.reflow();
+ } else {
+ self.panel.show();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self$$1.state.on('change:disabled', function (e) {
- self$$1.getEl('inp').disabled = e.value;
- });
- self$$1.state.on('change:statusLevel', function (e) {
- var statusIconElm = self$$1.getEl('status');
- var prefix = self$$1.classPrefix, value = e.value;
- funcs.css(statusIconElm, 'display', value === 'none' ? 'none' : '');
- funcs.toggleClass(statusIconElm, prefix + 'i-checkmark', value === 'ok');
- funcs.toggleClass(statusIconElm, prefix + 'i-warning', value === 'warn');
- funcs.toggleClass(statusIconElm, prefix + 'i-error', value === 'error');
- self$$1.classes.toggle('has-status', value !== 'none');
- self$$1.repaint();
- });
- funcs.on(self$$1.getEl('status'), 'mouseleave', function () {
- self$$1.tooltip().hide();
- });
- self$$1.on('cancel', function (e) {
- if (self$$1.menu && self$$1.menu.visible()) {
- e.stopPropagation();
- self$$1.hideMenu();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var rtlRels = [
+ 'bc-tc',
+ 'bc-tl',
+ 'bc-tr'
+ ];
+ var ltrRels = [
+ 'bc-tc',
+ 'bc-tr',
+ 'bc-tl',
+ 'tc-bc',
+ 'tc-br',
+ 'tc-bl'
+ ];
+ var rel = self.panel.testMoveRel(self.getEl(), settings.popoverAlign || (self.isRtl() ? rtlRels : ltrRels));
+ self.panel.classes.toggle('start', rel.substr(-1) === 'l');
+ self.panel.classes.toggle('end', rel.substr(-1) === 'r');
+ var isTop = rel.substr(0, 1) === 't';
+ self.panel.classes.toggle('bottom', !isTop);
+ self.panel.classes.toggle('top', isTop);
+ self.panel.moveRel(self.getEl(), rel);
+ },
+ hidePanel: function () {
+ var self = this;
+ if (self.panel) {
+ self.panel.hide();
</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 focusIdx = function (idx, menu) {
- if (menu && menu.items().length > 0) {
- menu.items().eq(idx)[0].focus();
- }
- };
- self$$1.on('keydown', function (e) {
- var keyCode = e.keyCode;
- if (e.target.nodeName === 'INPUT') {
- if (keyCode === global$13.DOWN) {
- e.preventDefault();
- self$$1.fire('autocomplete');
- focusIdx(0, self$$1.menu);
- } else if (keyCode === global$13.UP) {
- e.preventDefault();
- focusIdx(-1, self$$1.menu);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ postRender: function () {
+ var self = this;
+ self.aria('haspopup', true);
+ self.on('click', function (e) {
+ if (e.control === self) {
+ if (self.panel && self.panel.visible()) {
+ self.hidePanel();
+ } else {
+ self.showPanel();
+ self.panel.focus(!!e.aria);
+ }
</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 self._super();
+ },
+ remove: function () {
+ if (this.panel) {
+ this.panel.remove();
+ this.panel = 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 self$$1._super();
- },
- remove: function () {
- global$9(this.getEl('inp')).off();
- if (this.menu) {
- this.menu.remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this._super();
</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._super();
- }
- });
</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">- var ColorBox = ComboBox.extend({
- init: function (settings) {
- var self = this;
- settings.spellcheck = false;
- if (settings.onaction) {
- settings.icon = 'none';
- }
- self._super(settings);
- self.classes.add('colorbox');
- self.on('change keyup postrender', function () {
- self.repaintColor(self.value());
- });
- },
- repaintColor: function (value) {
- var openElm = this.getEl('open');
- var elm = openElm ? openElm.getElementsByTagName('i')[0] : null;
- if (elm) {
- try {
- elm.style.background = value;
- } catch (ex) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var DOM$3 = global$3.DOM;
+ var ColorButton = PanelButton.extend({
+ init: function (settings) {
+ this._super(settings);
+ this.classes.add('splitbtn');
+ this.classes.add('colorbutton');
+ },
+ color: function (color) {
+ if (color) {
+ this._color = color;
+ this.getEl('preview').style.backgroundColor = color;
+ return this;
</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 this._color;
+ },
+ resetColor: function () {
+ this._color = null;
+ this.getEl('preview').style.backgroundColor = null;
+ return this;
+ },
+ renderHtml: function () {
+ var self = this, id = self._id, prefix = self.classPrefix, text = self.state.get('text');
+ var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
+ var image = self.settings.image ? ' style="background-image: url(\'' + self.settings.image + '\')"' : '';
+ var textHtml = '';
+ if (text) {
+ self.classes.add('btn-has-text');
+ textHtml = '<span class="' + prefix + 'txt">' + self.encode(text) + '</span>';
+ }
+ return '<div id="' + id + '" class="' + self.classes + '" role="button" tabindex="-1" aria-haspopup="true">' + '<button role="presentation" hidefocus="1" type="button" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + '<span id="' + id + '-preview" class="' + prefix + 'preview"></span>' + textHtml + '</button>' + '<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' + ' <i class="' + prefix + 'caret"></i>' + '</button>' + '</div>';
+ },
+ postRender: function () {
+ var self = this, onClickHandler = self.settings.onclick;
+ self.on('click', function (e) {
+ if (e.aria && e.aria.key === 'down') {
+ return;
+ }
+ if (e.control === self && !DOM$3.getParent(e.target, '.' + self.classPrefix + 'open')) {
+ e.stopImmediatePropagation();
+ onClickHandler.call(self, e);
+ }
+ });
+ delete self.settings.onclick;
+ return self._super();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- },
- bindStates: function () {
- var self = this;
- self.state.on('change:value', function (e) {
- if (self.state.get('rendered')) {
- self.repaintColor(e.value);
- }
- });
- return self._super();
- }
- });
</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">- var PanelButton = Button.extend({
- showPanel: function () {
- var self = this, settings = self.settings;
- self.classes.add('opened');
- if (!self.panel) {
- var panelSettings = settings.panel;
- if (panelSettings.type) {
- panelSettings = {
- layout: 'grid',
- items: panelSettings
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var global$e = tinymce.util.Tools.resolve('tinymce.util.Color');
+
+ var ColorPicker = Widget.extend({
+ Defaults: { classes: 'widget colorpicker' },
+ init: function (settings) {
+ this._super(settings);
+ },
+ postRender: function () {
+ var self = this;
+ var color = self.color();
+ var hsv, hueRootElm, huePointElm, svRootElm, svPointElm;
+ hueRootElm = self.getEl('h');
+ huePointElm = self.getEl('hp');
+ svRootElm = self.getEl('sv');
+ svPointElm = self.getEl('svp');
+ function getPos(elm, event) {
+ var pos = funcs.getPos(elm);
+ var x, y;
+ x = event.pageX - pos.x;
+ y = event.pageY - pos.y;
+ x = Math.max(0, Math.min(x / elm.clientWidth, 1));
+ y = Math.max(0, Math.min(y / elm.clientHeight, 1));
+ return {
+ x: x,
+ y: y
</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">- panelSettings.role = panelSettings.role || 'dialog';
- panelSettings.popover = true;
- panelSettings.autohide = true;
- panelSettings.ariaRoot = true;
- self.panel = new FloatPanel(panelSettings).on('hide', function () {
- self.classes.remove('opened');
- }).on('cancel', function (e) {
- e.stopPropagation();
- self.focus();
- self.hidePanel();
- }).parent(self).renderTo(self.getContainerElm());
- self.panel.fire('show');
- self.panel.reflow();
- } else {
- self.panel.show();
- }
- var rtlRels = [
- 'bc-tc',
- 'bc-tl',
- 'bc-tr'
- ];
- var ltrRels = [
- 'bc-tc',
- 'bc-tr',
- 'bc-tl',
- 'tc-bc',
- 'tc-br',
- 'tc-bl'
- ];
- var rel = self.panel.testMoveRel(self.getEl(), settings.popoverAlign || (self.isRtl() ? rtlRels : ltrRels));
- self.panel.classes.toggle('start', rel.substr(-1) === 'l');
- self.panel.classes.toggle('end', rel.substr(-1) === 'r');
- var isTop = rel.substr(0, 1) === 't';
- self.panel.classes.toggle('bottom', !isTop);
- self.panel.classes.toggle('top', isTop);
- self.panel.moveRel(self.getEl(), rel);
- },
- hidePanel: function () {
- var self = this;
- if (self.panel) {
- self.panel.hide();
- }
- },
- postRender: function () {
- var self = this;
- self.aria('haspopup', true);
- self.on('click', function (e) {
- if (e.control === self) {
- if (self.panel && self.panel.visible()) {
- self.hidePanel();
- } else {
- self.showPanel();
- self.panel.focus(!!e.aria);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function updateColor(hsv, hueUpdate) {
+ var hue = (360 - hsv.h) / 360;
+ funcs.css(huePointElm, { top: hue * 100 + '%' });
+ if (!hueUpdate) {
+ funcs.css(svPointElm, {
+ left: hsv.s + '%',
+ top: 100 - hsv.v + '%'
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ svRootElm.style.background = global$e({
+ s: 100,
+ v: 100,
+ h: hsv.h
+ }).toHex();
+ self.color().parse({
+ s: hsv.s,
+ v: hsv.v,
+ h: hsv.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">- });
- return self._super();
- },
- remove: function () {
- if (this.panel) {
- this.panel.remove();
- this.panel = null;
- }
- return this._super();
- }
- });
-
- var DOM$3 = global$3.DOM;
- var ColorButton = PanelButton.extend({
- init: function (settings) {
- this._super(settings);
- this.classes.add('splitbtn');
- this.classes.add('colorbutton');
- },
- color: function (color) {
- if (color) {
- this._color = color;
- this.getEl('preview').style.backgroundColor = color;
- return this;
- }
- return this._color;
- },
- resetColor: function () {
- this._color = null;
- this.getEl('preview').style.backgroundColor = null;
- return this;
- },
- renderHtml: function () {
- var self = this, id = self._id, prefix = self.classPrefix, text = self.state.get('text');
- var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : '';
- var image = self.settings.image ? ' style="background-image: url(\'' + self.settings.image + '\')"' : '';
- var textHtml = '';
- if (text) {
- self.classes.add('btn-has-text');
- textHtml = '<span class="' + prefix + 'txt">' + self.encode(text) + '</span>';
- }
- return '<div id="' + id + '" class="' + self.classes + '" role="button" tabindex="-1" aria-haspopup="true">' + '<button role="presentation" hidefocus="1" type="button" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + '<span id="' + id + '-preview" class="' + prefix + 'preview"></span>' + textHtml + '</button>' + '<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' + ' <i class="' + prefix + 'caret"></i>' + '</button>' + '</div>';
- },
- postRender: function () {
- var self = this, onClickHandler = self.settings.onclick;
- self.on('click', function (e) {
- if (e.aria && e.aria.key === 'down') {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function updateSaturationAndValue(e) {
+ var pos;
+ pos = getPos(svRootElm, e);
+ hsv.s = pos.x * 100;
+ hsv.v = (1 - pos.y) * 100;
+ updateColor(hsv);
+ self.fire('change');
</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.control === self && !DOM$3.getParent(e.target, '.' + self.classPrefix + 'open')) {
- e.stopImmediatePropagation();
- onClickHandler.call(self, e);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function updateHue(e) {
+ var pos;
+ pos = getPos(hueRootElm, e);
+ hsv = color.toHsv();
+ hsv.h = (1 - pos.y) * 360;
+ updateColor(hsv, true);
+ self.fire('change');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- delete self.settings.onclick;
- return self._super();
- }
- });
-
- var global$14 = tinymce.util.Tools.resolve('tinymce.util.Color');
-
- var ColorPicker = Widget.extend({
- Defaults: { classes: 'widget colorpicker' },
- init: function (settings) {
- this._super(settings);
- },
- postRender: function () {
- var self = this;
- var color = self.color();
- var hsv, hueRootElm, huePointElm, svRootElm, svPointElm;
- hueRootElm = self.getEl('h');
- huePointElm = self.getEl('hp');
- svRootElm = self.getEl('sv');
- svPointElm = self.getEl('svp');
- function getPos(elm, event) {
- var pos = funcs.getPos(elm);
- var x, y;
- x = event.pageX - pos.x;
- y = event.pageY - pos.y;
- x = Math.max(0, Math.min(x / elm.clientWidth, 1));
- y = Math.max(0, Math.min(y / elm.clientHeight, 1));
- return {
- x: x,
- y: y
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._repaint = function () {
+ hsv = color.toHsv();
+ updateColor(hsv);
</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 updateColor(hsv, hueUpdate) {
- var hue = (360 - hsv.h) / 360;
- funcs.css(huePointElm, { top: hue * 100 + '%' });
- if (!hueUpdate) {
- funcs.css(svPointElm, {
- left: hsv.s + '%',
- top: 100 - hsv.v + '%'
- });
- }
- svRootElm.style.background = global$14({
- s: 100,
- v: 100,
- h: hsv.h
- }).toHex();
- self.color().parse({
- s: hsv.s,
- v: hsv.v,
- h: hsv.h
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._super();
+ self._svdraghelper = new DragHelper(self._id + '-sv', {
+ start: updateSaturationAndValue,
+ drag: updateSaturationAndValue
</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 updateSaturationAndValue(e) {
- var pos;
- pos = getPos(svRootElm, e);
- hsv.s = pos.x * 100;
- hsv.v = (1 - pos.y) * 100;
- updateColor(hsv);
- self.fire('change');
- }
- function updateHue(e) {
- var pos;
- pos = getPos(hueRootElm, e);
- hsv = color.toHsv();
- hsv.h = (1 - pos.y) * 360;
- updateColor(hsv, true);
- self.fire('change');
- }
- self._repaint = function () {
- hsv = color.toHsv();
- updateColor(hsv);
- };
- self._super();
- self._svdraghelper = new DragHelper(self._id + '-sv', {
- start: updateSaturationAndValue,
- drag: updateSaturationAndValue
- });
- self._hdraghelper = new DragHelper(self._id + '-h', {
- start: updateHue,
- drag: updateHue
- });
- self._repaint();
- },
- rgb: function () {
- return this.color().toRgb();
- },
- value: function (value) {
- var self = this;
- if (arguments.length) {
- self.color().parse(value);
- if (self._rendered) {
- self._repaint();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._hdraghelper = new DragHelper(self._id + '-h', {
+ start: updateHue,
+ drag: updateHue
+ });
+ self._repaint();
+ },
+ rgb: function () {
+ return this.color().toRgb();
+ },
+ value: function (value) {
+ var self = this;
+ if (arguments.length) {
+ self.color().parse(value);
+ if (self._rendered) {
+ self._repaint();
+ }
+ } else {
+ return self.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">- } else {
- return self.color().toHex();
- }
- },
- color: function () {
- if (!this._color) {
- this._color = global$14();
- }
- return this._color;
- },
- renderHtml: function () {
- var self = this;
- var id = self._id;
- var prefix = self.classPrefix;
- var hueHtml;
- var stops = '#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000';
- function getOldIeFallbackHtml() {
- var i, l, html = '', gradientPrefix, stopsList;
- gradientPrefix = 'filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=';
- stopsList = stops.split(',');
- for (i = 0, l = stopsList.length - 1; i < l; i++) {
- html += '<div class="' + prefix + 'colorpicker-h-chunk" style="' + 'height:' + 100 / l + '%;' + gradientPrefix + stopsList[i] + ',endColorstr=' + stopsList[i + 1] + ');' + '-ms-' + gradientPrefix + stopsList[i] + ',endColorstr=' + stopsList[i + 1] + ')' + '"></div>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ color: function () {
+ if (!this._color) {
+ this._color = global$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">- return html;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this._color;
+ },
+ renderHtml: function () {
+ var self = this;
+ var id = self._id;
+ var prefix = self.classPrefix;
+ var hueHtml;
+ var stops = '#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000';
+ function getOldIeFallbackHtml() {
+ var i, l, html = '', gradientPrefix, stopsList;
+ gradientPrefix = 'filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=';
+ stopsList = stops.split(',');
+ for (i = 0, l = stopsList.length - 1; i < l; i++) {
+ html += '<div class="' + prefix + 'colorpicker-h-chunk" style="' + 'height:' + 100 / l + '%;' + gradientPrefix + stopsList[i] + ',endColorstr=' + stopsList[i + 1] + ');' + '-ms-' + gradientPrefix + stopsList[i] + ',endColorstr=' + stopsList[i + 1] + ')' + '"></div>';
+ }
+ return html;
+ }
+ var gradientCssText = 'background: -ms-linear-gradient(top,' + stops + ');' + 'background: linear-gradient(to bottom,' + stops + ');';
+ hueHtml = '<div id="' + id + '-h" class="' + prefix + 'colorpicker-h" style="' + gradientCssText + '">' + getOldIeFallbackHtml() + '<div id="' + id + '-hp" class="' + prefix + 'colorpicker-h-marker"></div>' + '</div>';
+ return '<div id="' + id + '" class="' + self.classes + '">' + '<div id="' + id + '-sv" class="' + prefix + 'colorpicker-sv">' + '<div class="' + prefix + 'colorpicker-overlay1">' + '<div class="' + prefix + 'colorpicker-overlay2">' + '<div id="' + id + '-svp" class="' + prefix + 'colorpicker-selector1">' + '<div class="' + prefix + 'colorpicker-selector2"></div>' + '</div>' + '</div>' + '</div>' + '</div>' + hueHtml + '</div>';
</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 gradientCssText = 'background: -ms-linear-gradient(top,' + stops + ');' + 'background: linear-gradient(to bottom,' + stops + ');';
- hueHtml = '<div id="' + id + '-h" class="' + prefix + 'colorpicker-h" style="' + gradientCssText + '">' + getOldIeFallbackHtml() + '<div id="' + id + '-hp" class="' + prefix + 'colorpicker-h-marker"></div>' + '</div>';
- return '<div id="' + id + '" class="' + self.classes + '">' + '<div id="' + id + '-sv" class="' + prefix + 'colorpicker-sv">' + '<div class="' + prefix + 'colorpicker-overlay1">' + '<div class="' + prefix + 'colorpicker-overlay2">' + '<div id="' + id + '-svp" class="' + prefix + 'colorpicker-selector1">' + '<div class="' + prefix + 'colorpicker-selector2"></div>' + '</div>' + '</div>' + '</div>' + '</div>' + hueHtml + '</div>';
- }
- });
</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">- var DropZone = Widget.extend({
- init: function (settings) {
- var self = this;
- settings = global$2.extend({
- height: 100,
- text: 'Drop an image here',
- multiple: false,
- accept: null
- }, settings);
- self._super(settings);
- self.classes.add('dropzone');
- if (settings.multiple) {
- self.classes.add('multiple');
- }
- },
- renderHtml: function () {
- var self = this;
- var attrs, elm;
- var cfg = self.settings;
- attrs = {
- id: self._id,
- hidefocus: '1'
- };
- elm = funcs.create('div', attrs, '<span>' + this.translate(cfg.text) + '</span>');
- if (cfg.height) {
- funcs.css(elm, 'height', cfg.height + 'px');
- }
- if (cfg.width) {
- funcs.css(elm, 'width', cfg.width + 'px');
- }
- elm.className = self.classes;
- return elm.outerHTML;
- },
- postRender: function () {
- var self = this;
- var toggleDragClass = function (e) {
- e.preventDefault();
- self.classes.toggle('dragenter');
- self.getEl().className = self.classes;
- };
- var filter = function (files) {
- var accept = self.settings.accept;
- if (typeof accept !== 'string') {
- return files;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var DropZone = Widget.extend({
+ init: function (settings) {
+ var self = this;
+ settings = global$2.extend({
+ height: 100,
+ text: 'Drop an image here',
+ multiple: false,
+ accept: null
+ }, settings);
+ self._super(settings);
+ self.classes.add('dropzone');
+ if (settings.multiple) {
+ self.classes.add('multiple');
</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 re = new RegExp('(' + accept.split(/\s*,\s*/).join('|') + ')$', 'i');
- return global$2.grep(files, function (file) {
- return re.test(file.name);
- });
- };
- self._super();
- self.$el.on('dragover', function (e) {
- e.preventDefault();
- });
- self.$el.on('dragenter', toggleDragClass);
- self.$el.on('dragleave', toggleDragClass);
- self.$el.on('drop', function (e) {
- e.preventDefault();
- if (self.state.get('disabled')) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ renderHtml: function () {
+ var self = this;
+ var attrs, elm;
+ var cfg = self.settings;
+ attrs = {
+ id: self._id,
+ hidefocus: '1'
+ };
+ elm = funcs.create('div', attrs, '<span>' + this.translate(cfg.text) + '</span>');
+ if (cfg.height) {
+ funcs.css(elm, 'height', cfg.height + '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">- var files = filter(e.dataTransfer.files);
- self.value = function () {
- if (!files.length) {
- return null;
- } else if (self.settings.multiple) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (cfg.width) {
+ funcs.css(elm, 'width', cfg.width + 'px');
+ }
+ elm.className = self.classes;
+ return elm.outerHTML;
+ },
+ postRender: function () {
+ var self = this;
+ var toggleDragClass = function (e) {
+ e.preventDefault();
+ self.classes.toggle('dragenter');
+ self.getEl().className = self.classes;
+ };
+ var filter = function (files) {
+ var accept = self.settings.accept;
+ if (typeof accept !== 'string') {
</ins><span class="cx" style="display: block; padding: 0 10px"> return files;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- return files[0];
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var re = new RegExp('(' + accept.split(/\s*,\s*/).join('|') + ')$', 'i');
+ return global$2.grep(files, function (file) {
+ return re.test(file.name);
+ });
</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 (files.length) {
- self.fire('change', e);
- }
- });
- },
- remove: function () {
- this.$el.off();
- this._super();
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._super();
+ self.$el.on('dragover', function (e) {
+ e.preventDefault();
+ });
+ self.$el.on('dragenter', toggleDragClass);
+ self.$el.on('dragleave', toggleDragClass);
+ self.$el.on('drop', function (e) {
+ e.preventDefault();
+ if (self.state.get('disabled')) {
+ return;
+ }
+ var files = filter(e.dataTransfer.files);
+ self.value = function () {
+ if (!files.length) {
+ return null;
+ } else if (self.settings.multiple) {
+ return files;
+ } else {
+ return files[0];
+ }
+ };
+ if (files.length) {
+ self.fire('change', e);
+ }
+ });
+ },
+ remove: function () {
+ this.$el.off();
+ this._super();
+ }
+ });
</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 Path = Widget.extend({
- init: function (settings) {
- var self = this;
- if (!settings.delimiter) {
- settings.delimiter = '\xBB';
- }
- self._super(settings);
- self.classes.add('path');
- self.canFocus = true;
- self.on('click', function (e) {
- var index;
- var target = e.target;
- if (index = target.getAttribute('data-index')) {
- self.fire('select', {
- value: self.row()[index],
- index: index
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Path = Widget.extend({
+ init: function (settings) {
+ var self = this;
+ if (!settings.delimiter) {
+ settings.delimiter = '\xBB';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self.row(self.settings.row);
- },
- focus: function () {
- var self = this;
- self.getEl().firstChild.focus();
- return self;
- },
- row: function (row) {
- if (!arguments.length) {
- return this.state.get('row');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._super(settings);
+ self.classes.add('path');
+ self.canFocus = true;
+ self.on('click', function (e) {
+ var index;
+ var target = e.target;
+ if (index = target.getAttribute('data-index')) {
+ self.fire('select', {
+ value: self.row()[index],
+ index: index
+ });
+ }
+ });
+ self.row(self.settings.row);
+ },
+ focus: function () {
+ var self = this;
+ self.getEl().firstChild.focus();
+ return self;
+ },
+ row: function (row) {
+ if (!arguments.length) {
+ return this.state.get('row');
+ }
+ this.state.set('row', row);
+ return this;
+ },
+ renderHtml: function () {
+ var self = this;
+ return '<div id="' + self._id + '" class="' + self.classes + '">' + self._getDataPathHtml(self.state.get('row')) + '</div>';
+ },
+ bindStates: function () {
+ var self = this;
+ self.state.on('change:row', function (e) {
+ self.innerHtml(self._getDataPathHtml(e.value));
+ });
+ return self._super();
+ },
+ _getDataPathHtml: function (data) {
+ var self = this;
+ var parts = data || [];
+ var i, l, html = '';
+ var prefix = self.classPrefix;
+ for (i = 0, l = parts.length; i < l; i++) {
+ html += (i > 0 ? '<div class="' + prefix + 'divider" aria-hidden="true"> ' + self.settings.delimiter + ' </div>' : '') + '<div role="button" class="' + prefix + 'path-item' + (i === l - 1 ? ' ' + prefix + 'last' : '') + '" data-index="' + i + '" tabindex="-1" id="' + self._id + '-' + i + '" aria-level="' + (i + 1) + '">' + parts[i].name + '</div>';
+ }
+ if (!html) {
+ html = '<div class="' + prefix + 'path-item">\xA0</div>';
+ }
+ return html;
</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.state.set('row', row);
- return this;
- },
- renderHtml: function () {
- var self = this;
- return '<div id="' + self._id + '" class="' + self.classes + '">' + self._getDataPathHtml(self.state.get('row')) + '</div>';
- },
- bindStates: function () {
- var self = this;
- self.state.on('change:row', function (e) {
- self.innerHtml(self._getDataPathHtml(e.value));
- });
- return self._super();
- },
- _getDataPathHtml: function (data) {
- var self = this;
- var parts = data || [];
- var i, l, html = '';
- var prefix = self.classPrefix;
- for (i = 0, l = parts.length; i < l; i++) {
- html += (i > 0 ? '<div class="' + prefix + 'divider" aria-hidden="true"> ' + self.settings.delimiter + ' </div>' : '') + '<div role="button" class="' + prefix + 'path-item' + (i === l - 1 ? ' ' + prefix + 'last' : '') + '" data-index="' + i + '" tabindex="-1" id="' + self._id + '-' + i + '" aria-level="' + (i + 1) + '">' + parts[i].name + '</div>';
- }
- if (!html) {
- html = '<div class="' + prefix + 'path-item">\xA0</div>';
- }
- return html;
- }
- });
</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">- var ElementPath = Path.extend({
- postRender: function () {
- var self = this, editor = self.settings.editor;
- function isHidden(elm) {
- if (elm.nodeType === 1) {
- if (elm.nodeName === 'BR' || !!elm.getAttribute('data-mce-bogus')) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ElementPath = Path.extend({
+ postRender: function () {
+ var self = this, editor = self.settings.editor;
+ function isHidden(elm) {
+ if (elm.nodeType === 1) {
+ if (elm.nodeName === 'BR' || !!elm.getAttribute('data-mce-bogus')) {
+ return true;
+ }
+ if (elm.getAttribute('data-mce-type') === 'bookmark') {
+ return true;
+ }
</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 (elm.getAttribute('data-mce-type') === 'bookmark') {
- return true;
- }
</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">- return false;
- }
- if (editor.settings.elementpath !== false) {
- self.on('select', function (e) {
- editor.focus();
- editor.selection.select(this.row()[e.index].element);
- editor.nodeChanged();
- });
- editor.on('nodeChange', function (e) {
- var outParents = [];
- var parents = e.parents;
- var i = parents.length;
- while (i--) {
- if (parents[i].nodeType === 1 && !isHidden(parents[i])) {
- var args = editor.fire('ResolveName', {
- name: parents[i].nodeName.toLowerCase(),
- target: parents[i]
- });
- if (!args.isDefaultPrevented()) {
- outParents.push({
- name: args.name,
- element: parents[i]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (editor.settings.elementpath !== false) {
+ self.on('select', function (e) {
+ editor.focus();
+ editor.selection.select(this.row()[e.index].element);
+ editor.nodeChanged();
+ });
+ editor.on('nodeChange', function (e) {
+ var outParents = [];
+ var parents = e.parents;
+ var i = parents.length;
+ while (i--) {
+ if (parents[i].nodeType === 1 && !isHidden(parents[i])) {
+ var args = editor.fire('ResolveName', {
+ name: parents[i].nodeName.toLowerCase(),
+ target: parents[i]
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!args.isDefaultPrevented()) {
+ outParents.push({
+ name: args.name,
+ element: parents[i]
+ });
+ }
+ if (args.isPropagationStopped()) {
+ 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">- if (args.isPropagationStopped()) {
- break;
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- self.row(outParents);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.row(outParents);
+ });
+ }
+ return self._super();
</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 self._super();
- }
- });
</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">- var FormItem = Container.extend({
- Defaults: {
- layout: 'flex',
- align: 'center',
- defaults: { flex: 1 }
- },
- renderHtml: function () {
- var self = this, layout = self._layout, prefix = self.classPrefix;
- self.classes.add('formitem');
- layout.preRender(self);
- return '<div id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1">' + (self.settings.title ? '<div id="' + self._id + '-title" class="' + prefix + 'title">' + self.settings.title + '</div>' : '') + '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + (self.settings.html || '') + layout.renderHtml(self) + '</div>' + '</div>';
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var FormItem = Container.extend({
+ Defaults: {
+ layout: 'flex',
+ align: 'center',
+ defaults: { flex: 1 }
+ },
+ renderHtml: function () {
+ var self = this, layout = self._layout, prefix = self.classPrefix;
+ self.classes.add('formitem');
+ layout.preRender(self);
+ return '<div id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1">' + (self.settings.title ? '<div id="' + self._id + '-title" class="' + prefix + 'title">' + self.settings.title + '</div>' : '') + '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + (self.settings.html || '') + layout.renderHtml(self) + '</div>' + '</div>';
+ }
+ });
</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 Form = Container.extend({
- Defaults: {
- containerCls: 'form',
- layout: 'flex',
- direction: 'column',
- align: 'stretch',
- flex: 1,
- padding: 15,
- labelGap: 30,
- spacing: 10,
- callbacks: {
- submit: function () {
- this.submit();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Form = Container.extend({
+ Defaults: {
+ containerCls: 'form',
+ layout: 'flex',
+ direction: 'column',
+ align: 'stretch',
+ flex: 1,
+ padding: 15,
+ labelGap: 30,
+ spacing: 10,
+ callbacks: {
+ submit: function () {
+ this.submit();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- },
- preRender: function () {
- var self = this, items = self.items();
- if (!self.settings.formItemDefaults) {
- self.settings.formItemDefaults = {
- layout: 'flex',
- autoResize: 'overflow',
- defaults: { flex: 1 }
- };
- }
- items.each(function (ctrl) {
- var formItem;
- var label = ctrl.settings.label;
- if (label) {
- formItem = new FormItem(global$2.extend({
- items: {
- type: 'label',
- id: ctrl._id + '-l',
- text: label,
- flex: 0,
- forId: ctrl._id,
- disabled: ctrl.disabled()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ preRender: function () {
+ var self = this, items = self.items();
+ if (!self.settings.formItemDefaults) {
+ self.settings.formItemDefaults = {
+ layout: 'flex',
+ autoResize: 'overflow',
+ defaults: { flex: 1 }
+ };
+ }
+ items.each(function (ctrl) {
+ var formItem;
+ var label = ctrl.settings.label;
+ if (label) {
+ formItem = new FormItem(global$2.extend({
+ items: {
+ type: 'label',
+ id: ctrl._id + '-l',
+ text: label,
+ flex: 0,
+ forId: ctrl._id,
+ disabled: ctrl.disabled()
+ }
+ }, self.settings.formItemDefaults));
+ formItem.type = 'formitem';
+ ctrl.aria('labelledby', ctrl._id + '-l');
+ if (typeof ctrl.settings.flex === 'undefined') {
+ ctrl.settings.flex = 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">- }, self.settings.formItemDefaults));
- formItem.type = 'formitem';
- ctrl.aria('labelledby', ctrl._id + '-l');
- if (typeof ctrl.settings.flex === 'undefined') {
- ctrl.settings.flex = 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.replace(ctrl, formItem);
+ formItem.add(ctrl);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.replace(ctrl, formItem);
- formItem.add(ctrl);
- }
- });
- },
- submit: function () {
- return this.fire('submit', { data: this.toJSON() });
- },
- postRender: function () {
- var self = this;
- self._super();
- self.fromJSON(self.settings.data);
- },
- bindStates: function () {
- var self = this;
- self._super();
- function recalcLabels() {
- var maxLabelWidth = 0;
- var labels = [];
- var i, labelGap, items;
- if (self.settings.labelGapCalc === false) {
- return;
- }
- if (self.settings.labelGapCalc === 'children') {
- items = self.find('formitem');
- } else {
- items = self.items();
- }
- items.filter('formitem').each(function (item) {
- var labelCtrl = item.items()[0], labelWidth = labelCtrl.getEl().clientWidth;
- maxLabelWidth = labelWidth > maxLabelWidth ? labelWidth : maxLabelWidth;
- labels.push(labelCtrl);
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- labelGap = self.settings.labelGap || 0;
- i = labels.length;
- while (i--) {
- labels[i].settings.minWidth = maxLabelWidth + labelGap;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ submit: function () {
+ return this.fire('submit', { data: this.toJSON() });
+ },
+ postRender: function () {
+ var self = this;
+ self._super();
+ self.fromJSON(self.settings.data);
+ },
+ bindStates: function () {
+ var self = this;
+ self._super();
+ function recalcLabels() {
+ var maxLabelWidth = 0;
+ var labels = [];
+ var i, labelGap, items;
+ if (self.settings.labelGapCalc === false) {
+ return;
+ }
+ if (self.settings.labelGapCalc === 'children') {
+ items = self.find('formitem');
+ } else {
+ items = self.items();
+ }
+ items.filter('formitem').each(function (item) {
+ var labelCtrl = item.items()[0], labelWidth = labelCtrl.getEl().clientWidth;
+ maxLabelWidth = labelWidth > maxLabelWidth ? labelWidth : maxLabelWidth;
+ labels.push(labelCtrl);
+ });
+ labelGap = self.settings.labelGap || 0;
+ i = labels.length;
+ while (i--) {
+ labels[i].settings.minWidth = maxLabelWidth + labelGap;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.on('show', recalcLabels);
+ recalcLabels();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.on('show', recalcLabels);
- recalcLabels();
- }
- });
</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">- var FieldSet = Form.extend({
- Defaults: {
- containerCls: 'fieldset',
- layout: 'flex',
- direction: 'column',
- align: 'stretch',
- flex: 1,
- padding: '25 15 5 15',
- labelGap: 30,
- spacing: 10,
- border: 1
- },
- renderHtml: function () {
- var self = this, layout = self._layout, prefix = self.classPrefix;
- self.preRender();
- layout.preRender(self);
- return '<fieldset id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1">' + (self.settings.title ? '<legend id="' + self._id + '-title" class="' + prefix + 'fieldset-title">' + self.settings.title + '</legend>' : '') + '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + (self.settings.html || '') + layout.renderHtml(self) + '</div>' + '</fieldset>';
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var FieldSet = Form.extend({
+ Defaults: {
+ containerCls: 'fieldset',
+ layout: 'flex',
+ direction: 'column',
+ align: 'stretch',
+ flex: 1,
+ padding: '25 15 5 15',
+ labelGap: 30,
+ spacing: 10,
+ border: 1
+ },
+ renderHtml: function () {
+ var self = this, layout = self._layout, prefix = self.classPrefix;
+ self.preRender();
+ layout.preRender(self);
+ return '<fieldset id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1">' + (self.settings.title ? '<legend id="' + self._id + '-title" class="' + prefix + 'fieldset-title">' + self.settings.title + '</legend>' : '') + '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + (self.settings.html || '') + layout.renderHtml(self) + '</div>' + '</fieldset>';
+ }
+ });
</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 unique$1 = 0;
- var generate = function (prefix) {
- var date = new Date();
- var time = date.getTime();
- var random = Math.floor(Math.random() * 1000000000);
- unique$1++;
- return prefix + '_' + random + unique$1 + String(time);
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var unique$1 = 0;
+ var generate = function (prefix) {
+ var date = new Date();
+ var time = date.getTime();
+ var random = Math.floor(Math.random() * 1000000000);
+ unique$1++;
+ return prefix + '_' + random + unique$1 + String(time);
+ };
</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 fromHtml = function (html, scope) {
- var doc = scope || document;
- var div = doc.createElement('div');
- div.innerHTML = html;
- if (!div.hasChildNodes() || div.childNodes.length > 1) {
- console.error('HTML does not have a single root node', html);
- throw 'HTML must have a single root node';
- }
- return fromDom(div.childNodes[0]);
- };
- var fromTag = function (tag, scope) {
- var doc = scope || document;
- var node = doc.createElement(tag);
- return fromDom(node);
- };
- var fromText = function (text, scope) {
- var doc = scope || document;
- var node = doc.createTextNode(text);
- return fromDom(node);
- };
- var fromDom = function (node) {
- if (node === null || node === undefined)
- throw new Error('Node cannot be null or undefined');
- return { dom: constant(node) };
- };
- var fromPoint = function (docElm, x, y) {
- var doc = docElm.dom();
- return Option.from(doc.elementFromPoint(x, y)).map(fromDom);
- };
- var Element$$1 = {
- fromHtml: fromHtml,
- fromTag: fromTag,
- fromText: fromText,
- fromDom: fromDom,
- fromPoint: fromPoint
- };
-
- var cached = function (f) {
- var called = false;
- var r;
- return function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fromHtml = function (html, scope) {
+ var doc = scope || document;
+ var div = doc.createElement('div');
+ div.innerHTML = html;
+ if (!div.hasChildNodes() || div.childNodes.length > 1) {
+ console.error('HTML does not have a single root node', html);
+ throw 'HTML must have a single root 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 (!called) {
- called = true;
- r = f.apply(null, args);
- }
- return r;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return fromDom(div.childNodes[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">- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fromTag = function (tag, scope) {
+ var doc = scope || document;
+ var node = doc.createElement(tag);
+ return fromDom(node);
+ };
+ var fromText = function (text, scope) {
+ var doc = scope || document;
+ var node = doc.createTextNode(text);
+ return fromDom(node);
+ };
+ var fromDom = function (node) {
+ if (node === null || node === undefined)
+ throw new Error('Node cannot be null or undefined');
+ return { dom: constant(node) };
+ };
+ var fromPoint = function (docElm, x, y) {
+ var doc = docElm.dom();
+ return Option.from(doc.elementFromPoint(x, y)).map(fromDom);
+ };
+ var Element$$1 = {
+ fromHtml: fromHtml,
+ fromTag: fromTag,
+ fromText: fromText,
+ fromDom: fromDom,
+ fromPoint: fromPoint
+ };
</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 $_vi4lpw5jjgwefvz = {
- ATTRIBUTE: Node.ATTRIBUTE_NODE,
- CDATA_SECTION: Node.CDATA_SECTION_NODE,
- COMMENT: Node.COMMENT_NODE,
- DOCUMENT: Node.DOCUMENT_NODE,
- DOCUMENT_TYPE: Node.DOCUMENT_TYPE_NODE,
- DOCUMENT_FRAGMENT: Node.DOCUMENT_FRAGMENT_NODE,
- ELEMENT: Node.ELEMENT_NODE,
- TEXT: Node.TEXT_NODE,
- PROCESSING_INSTRUCTION: Node.PROCESSING_INSTRUCTION_NODE,
- ENTITY_REFERENCE: Node.ENTITY_REFERENCE_NODE,
- ENTITY: Node.ENTITY_NODE,
- NOTATION: Node.NOTATION_NODE
- };
-
- var name = function (element) {
- var r = element.dom().nodeName;
- return r.toLowerCase();
- };
- var type = function (element) {
- return element.dom().nodeType;
- };
- var value = function (element) {
- return element.dom().nodeValue;
- };
- var isType$1 = function (t) {
- return function (element) {
- return type(element) === t;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var cached = function (f) {
+ var called = false;
+ var r;
+ return function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ if (!called) {
+ called = true;
+ r = f.apply(null, args);
+ }
+ return r;
+ };
</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 isComment = function (element) {
- return type(element) === $_vi4lpw5jjgwefvz.COMMENT || name(element) === '#comment';
- };
- var isElement = isType$1($_vi4lpw5jjgwefvz.ELEMENT);
- var isText = isType$1($_vi4lpw5jjgwefvz.TEXT);
- var isDocument = isType$1($_vi4lpw5jjgwefvz.DOCUMENT);
- var $_8bzgjvw4jjgwefvy = {
- name: name,
- type: type,
- value: value,
- isElement: isElement,
- isText: isText,
- isDocument: isDocument,
- isComment: isComment
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var inBody = function (element) {
- var dom = $_8bzgjvw4jjgwefvy.isText(element) ? element.dom().parentNode : element.dom();
- return dom !== undefined && dom !== null && dom.ownerDocument.body.contains(dom);
- };
- var body = cached(function () {
- return getBody(Element$$1.fromDom(document));
- });
- var getBody = function (doc) {
- var body = doc.dom().body;
- if (body === null || body === undefined)
- throw 'Body is not available yet';
- return Element$$1.fromDom(body);
- };
- var $_g7jljiw2jjgwefvu = {
- body: body,
- getBody: getBody,
- inBody: inBody
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ATTRIBUTE = Node.ATTRIBUTE_NODE;
+ var CDATA_SECTION = Node.CDATA_SECTION_NODE;
+ var COMMENT = Node.COMMENT_NODE;
+ var DOCUMENT = Node.DOCUMENT_NODE;
+ var DOCUMENT_TYPE = Node.DOCUMENT_TYPE_NODE;
+ var DOCUMENT_FRAGMENT = Node.DOCUMENT_FRAGMENT_NODE;
+ var ELEMENT = Node.ELEMENT_NODE;
+ var TEXT = Node.TEXT_NODE;
+ var PROCESSING_INSTRUCTION = Node.PROCESSING_INSTRUCTION_NODE;
+ var ENTITY_REFERENCE = Node.ENTITY_REFERENCE_NODE;
+ var ENTITY = Node.ENTITY_NODE;
+ var NOTATION = Node.NOTATION_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 Immutable = function () {
- var fields = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- fields[_i] = arguments[_i];
- }
- return function () {
- var values = [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Immutable = function () {
+ var fields = [];
</ins><span class="cx" style="display: block; padding: 0 10px"> for (var _i = 0; _i < arguments.length; _i++) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- values[_i] = arguments[_i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ fields[_i] = arguments[_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 (fields.length !== values.length) {
- throw new Error('Wrong number of arguments to struct. Expected "[' + fields.length + ']", got ' + values.length + ' arguments');
- }
- var struct = {};
- each(fields, function (name, i) {
- struct[name] = constant(values[i]);
- });
- return struct;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return function () {
+ var values = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ values[_i] = arguments[_i];
+ }
+ if (fields.length !== values.length) {
+ throw new Error('Wrong number of arguments to struct. Expected "[' + fields.length + ']", got ' + values.length + ' arguments');
+ }
+ var struct = {};
+ each(fields, function (name, i) {
+ struct[name] = constant(values[i]);
+ });
+ return struct;
+ };
</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><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var toArray = function (target, f) {
- var r = [];
- var recurse = function (e) {
- r.push(e);
- return f(e);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Global = typeof window !== 'undefined' ? window : Function('return this;')();
+
+ var path = function (parts, scope) {
+ var o = scope !== undefined && scope !== null ? scope : Global;
+ for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i)
+ o = o[parts[i]];
+ return o;
</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 cur = f(target);
- do {
- cur = cur.bind(recurse);
- } while (cur.isSome());
- return r;
- };
- var $_5edc27wcjjgwefwz = { toArray: toArray };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var resolve = function (p, scope) {
+ var parts = p.split('.');
+ return path(parts, scope);
+ };
</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 Global = typeof window !== 'undefined' ? window : Function('return this;')();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var unsafe = function (name, scope) {
+ return resolve(name, scope);
+ };
+ var getOrDie = function (name, scope) {
+ var actual = unsafe(name, scope);
+ if (actual === undefined || actual === null)
+ throw name + ' not available on this browser';
+ return actual;
+ };
+ var Global$1 = { getOrDie: getOrDie };
</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 path = function (parts, scope) {
- var o = scope !== undefined && scope !== null ? scope : Global;
- for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i)
- o = o[parts[i]];
- return o;
- };
- var resolve = function (p, scope) {
- var parts = p.split('.');
- return path(parts, scope);
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var node = function () {
+ var f = Global$1.getOrDie('Node');
+ return f;
+ };
+ var compareDocumentPosition = function (a, b, match) {
+ return (a.compareDocumentPosition(b) & match) !== 0;
+ };
+ var documentPositionPreceding = function (a, b) {
+ return compareDocumentPosition(a, b, node().DOCUMENT_POSITION_PRECEDING);
+ };
+ var documentPositionContainedBy = function (a, b) {
+ return compareDocumentPosition(a, b, node().DOCUMENT_POSITION_CONTAINED_BY);
+ };
+ var Node$1 = {
+ documentPositionPreceding: documentPositionPreceding,
+ documentPositionContainedBy: documentPositionContainedBy
+ };
</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 unsafe = function (name, scope) {
- return resolve(name, scope);
- };
- var getOrDie = function (name, scope) {
- var actual = unsafe(name, scope);
- if (actual === undefined || actual === null)
- throw name + ' not available on this browser';
- return actual;
- };
- var $_eggz6rwfjjgwefxb = { getOrDie: getOrDie };
-
- var node = function () {
- var f = $_eggz6rwfjjgwefxb.getOrDie('Node');
- return f;
- };
- var compareDocumentPosition = function (a, b, match) {
- return (a.compareDocumentPosition(b) & match) !== 0;
- };
- var documentPositionPreceding = function (a, b) {
- return compareDocumentPosition(a, b, node().DOCUMENT_POSITION_PRECEDING);
- };
- var documentPositionContainedBy = function (a, b) {
- return compareDocumentPosition(a, b, node().DOCUMENT_POSITION_CONTAINED_BY);
- };
- var $_d3tk25wejjgwefxa = {
- documentPositionPreceding: documentPositionPreceding,
- documentPositionContainedBy: documentPositionContainedBy
- };
-
- var firstMatch = function (regexes, s) {
- for (var i = 0; i < regexes.length; i++) {
- var x = regexes[i];
- if (x.test(s))
- return x;
- }
- return undefined;
- };
- var find$2 = function (regexes, agent) {
- var r = firstMatch(regexes, agent);
- if (!r)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var firstMatch = function (regexes, s) {
+ for (var i = 0; i < regexes.length; i++) {
+ var x = regexes[i];
+ if (x.test(s))
+ return x;
+ }
+ return undefined;
+ };
+ var find$2 = function (regexes, agent) {
+ var r = firstMatch(regexes, agent);
+ if (!r)
+ return {
+ major: 0,
+ minor: 0
+ };
+ var group = function (i) {
+ return Number(agent.replace(r, '$' + i));
+ };
+ return nu(group(1), group(2));
+ };
+ var detect = function (versionRegexes, agent) {
+ var cleanedAgent = String(agent).toLowerCase();
+ if (versionRegexes.length === 0)
+ return unknown();
+ return find$2(versionRegexes, cleanedAgent);
+ };
+ var unknown = function () {
+ return nu(0, 0);
+ };
+ var nu = function (major, minor) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- major: 0,
- minor: 0
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ major: major,
+ minor: minor
</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 group = function (i) {
- return Number(agent.replace(r, '$' + i));
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return nu(group(1), group(2));
- };
- var detect = function (versionRegexes, agent) {
- var cleanedAgent = String(agent).toLowerCase();
- if (versionRegexes.length === 0)
- return unknown();
- return find$2(versionRegexes, cleanedAgent);
- };
- var unknown = function () {
- return nu(0, 0);
- };
- var nu = function (major, minor) {
- return {
- major: major,
- minor: minor
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Version = {
+ nu: nu,
+ detect: detect,
+ unknown: unknown
</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 $_f8xw27wljjgwefxn = {
- nu: nu,
- detect: detect,
- unknown: unknown
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var edge = 'Edge';
- var chrome = 'Chrome';
- var ie = 'IE';
- var opera = 'Opera';
- var firefox = 'Firefox';
- var safari = 'Safari';
- var isBrowser = function (name, current) {
- return function () {
- return current === name;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var edge = 'Edge';
+ var chrome = 'Chrome';
+ var ie = 'IE';
+ var opera = 'Opera';
+ var firefox = 'Firefox';
+ var safari = 'Safari';
+ var isBrowser = function (name, current) {
+ return function () {
+ return current === name;
+ };
</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 unknown$1 = function () {
- return nu$1({
- current: undefined,
- version: $_f8xw27wljjgwefxn.unknown()
- });
- };
- var nu$1 = function (info) {
- var current = info.current;
- var version = info.version;
- return {
- current: current,
- version: version,
- isEdge: isBrowser(edge, current),
- isChrome: isBrowser(chrome, current),
- isIE: isBrowser(ie, current),
- isOpera: isBrowser(opera, current),
- isFirefox: isBrowser(firefox, current),
- isSafari: isBrowser(safari, current)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var unknown$1 = function () {
+ return nu$1({
+ current: undefined,
+ version: Version.unknown()
+ });
</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 $_6jz8s6wkjjgwefxk = {
- unknown: unknown$1,
- nu: nu$1,
- edge: constant(edge),
- chrome: constant(chrome),
- ie: constant(ie),
- opera: constant(opera),
- firefox: constant(firefox),
- safari: constant(safari)
- };
-
- var windows$1 = 'Windows';
- var ios = 'iOS';
- var android = 'Android';
- var linux = 'Linux';
- var osx = 'OSX';
- var solaris = 'Solaris';
- var freebsd = 'FreeBSD';
- var isOS = function (name, current) {
- return function () {
- return current === name;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var nu$1 = function (info) {
+ var current = info.current;
+ var version = info.version;
+ return {
+ current: current,
+ version: version,
+ isEdge: isBrowser(edge, current),
+ isChrome: isBrowser(chrome, current),
+ isIE: isBrowser(ie, current),
+ isOpera: isBrowser(opera, current),
+ isFirefox: isBrowser(firefox, current),
+ isSafari: isBrowser(safari, current)
+ };
</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 unknown$2 = function () {
- return nu$2({
- current: undefined,
- version: $_f8xw27wljjgwefxn.unknown()
- });
- };
- var nu$2 = function (info) {
- var current = info.current;
- var version = info.version;
- return {
- current: current,
- version: version,
- isWindows: isOS(windows$1, current),
- isiOS: isOS(ios, current),
- isAndroid: isOS(android, current),
- isOSX: isOS(osx, current),
- isLinux: isOS(linux, current),
- isSolaris: isOS(solaris, current),
- isFreeBSD: isOS(freebsd, current)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Browser = {
+ unknown: unknown$1,
+ nu: nu$1,
+ edge: constant(edge),
+ chrome: constant(chrome),
+ ie: constant(ie),
+ opera: constant(opera),
+ firefox: constant(firefox),
+ safari: constant(safari)
</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 $_ac4rxfwmjjgwefxp = {
- unknown: unknown$2,
- nu: nu$2,
- windows: constant(windows$1),
- ios: constant(ios),
- android: constant(android),
- linux: constant(linux),
- osx: constant(osx),
- solaris: constant(solaris),
- freebsd: constant(freebsd)
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function DeviceType (os, browser, userAgent) {
- var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true;
- var isiPhone = os.isiOS() && !isiPad;
- var isAndroid3 = os.isAndroid() && os.version.major === 3;
- var isAndroid4 = os.isAndroid() && os.version.major === 4;
- var isTablet = isiPad || isAndroid3 || isAndroid4 && /mobile/i.test(userAgent) === true;
- var isTouch = os.isiOS() || os.isAndroid();
- var isPhone = isTouch && !isTablet;
- var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false;
- return {
- isiPad: constant(isiPad),
- isiPhone: constant(isiPhone),
- isTablet: constant(isTablet),
- isPhone: constant(isPhone),
- isTouch: constant(isTouch),
- isAndroid: os.isAndroid,
- isiOS: os.isiOS,
- isWebView: constant(iOSwebview)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var windows$1 = 'Windows';
+ var ios = 'iOS';
+ var android = 'Android';
+ var linux = 'Linux';
+ var osx = 'OSX';
+ var solaris = 'Solaris';
+ var freebsd = 'FreeBSD';
+ var isOS = function (name, current) {
+ return function () {
+ return current === name;
+ };
</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 detect$1 = function (candidates, userAgent) {
- var agent = String(userAgent).toLowerCase();
- return find(candidates, function (candidate) {
- return candidate.search(agent);
- });
- };
- var detectBrowser = function (browsers, userAgent) {
- return detect$1(browsers, userAgent).map(function (browser) {
- var version = $_f8xw27wljjgwefxn.detect(browser.versionRegexes, userAgent);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var unknown$2 = function () {
+ return nu$2({
+ current: undefined,
+ version: Version.unknown()
+ });
+ };
+ var nu$2 = function (info) {
+ var current = info.current;
+ var version = info.version;
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- current: browser.name,
- version: version
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ current: current,
+ version: version,
+ isWindows: isOS(windows$1, current),
+ isiOS: isOS(ios, current),
+ isAndroid: isOS(android, current),
+ isOSX: isOS(osx, current),
+ isLinux: isOS(linux, current),
+ isSolaris: isOS(solaris, current),
+ isFreeBSD: isOS(freebsd, current)
</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 detectOs = function (oses, userAgent) {
- return detect$1(oses, userAgent).map(function (os) {
- var version = $_f8xw27wljjgwefxn.detect(os.versionRegexes, userAgent);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var OperatingSystem = {
+ unknown: unknown$2,
+ nu: nu$2,
+ windows: constant(windows$1),
+ ios: constant(ios),
+ android: constant(android),
+ linux: constant(linux),
+ osx: constant(osx),
+ solaris: constant(solaris),
+ freebsd: constant(freebsd)
+ };
+
+ var DeviceType = function (os, browser, userAgent) {
+ var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true;
+ var isiPhone = os.isiOS() && !isiPad;
+ var isAndroid3 = os.isAndroid() && os.version.major === 3;
+ var isAndroid4 = os.isAndroid() && os.version.major === 4;
+ var isTablet = isiPad || isAndroid3 || isAndroid4 && /mobile/i.test(userAgent) === true;
+ var isTouch = os.isiOS() || os.isAndroid();
+ var isPhone = isTouch && !isTablet;
+ var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false;
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- current: os.name,
- version: version
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ isiPad: constant(isiPad),
+ isiPhone: constant(isiPhone),
+ isTablet: constant(isTablet),
+ isPhone: constant(isPhone),
+ isTouch: constant(isTouch),
+ isAndroid: os.isAndroid,
+ isiOS: os.isiOS,
+ isWebView: constant(iOSwebview)
</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 $_d66zk7wojjgwefxw = {
- detectBrowser: detectBrowser,
- detectOs: detectOs
- };
</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">- var contains$1 = function (str, substr) {
- return str.indexOf(substr) !== -1;
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var detect$1 = function (candidates, userAgent) {
+ var agent = String(userAgent).toLowerCase();
+ return find(candidates, function (candidate) {
+ return candidate.search(agent);
+ });
+ };
+ var detectBrowser = function (browsers, userAgent) {
+ return detect$1(browsers, userAgent).map(function (browser) {
+ var version = Version.detect(browser.versionRegexes, userAgent);
+ return {
+ current: browser.name,
+ version: version
+ };
+ });
+ };
+ var detectOs = function (oses, userAgent) {
+ return detect$1(oses, userAgent).map(function (os) {
+ var version = Version.detect(os.versionRegexes, userAgent);
+ return {
+ current: os.name,
+ version: version
+ };
+ });
+ };
+ var UaString = {
+ detectBrowser: detectBrowser,
+ detectOs: detectOs
+ };
</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 normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/;
- var checkContains = function (target) {
- return function (uastring) {
- return contains$1(uastring, target);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var contains$1 = function (str, substr) {
+ return str.indexOf(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">- };
- var browsers = [
- {
- name: 'Edge',
- versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
- search: function (uastring) {
- var monstrosity = contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit');
- return monstrosity;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/;
+ var checkContains = function (target) {
+ return function (uastring) {
+ return contains$1(uastring, target);
+ };
+ };
+ var browsers = [
+ {
+ name: 'Edge',
+ versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
+ search: function (uastring) {
+ var monstrosity = contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit');
+ return monstrosity;
+ }
+ },
+ {
+ name: 'Chrome',
+ versionRegexes: [
+ /.*?chrome\/([0-9]+)\.([0-9]+).*/,
+ normalVersionRegex
+ ],
+ search: function (uastring) {
+ return contains$1(uastring, 'chrome') && !contains$1(uastring, 'chromeframe');
+ }
+ },
+ {
+ name: 'IE',
+ versionRegexes: [
+ /.*?msie\ ?([0-9]+)\.([0-9]+).*/,
+ /.*?rv:([0-9]+)\.([0-9]+).*/
+ ],
+ search: function (uastring) {
+ return contains$1(uastring, 'msie') || contains$1(uastring, 'trident');
+ }
+ },
+ {
+ name: 'Opera',
+ versionRegexes: [
+ normalVersionRegex,
+ /.*?opera\/([0-9]+)\.([0-9]+).*/
+ ],
+ search: checkContains('opera')
+ },
+ {
+ name: 'Firefox',
+ versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],
+ search: checkContains('firefox')
+ },
+ {
+ name: 'Safari',
+ versionRegexes: [
+ normalVersionRegex,
+ /.*?cpu os ([0-9]+)_([0-9]+).*/
+ ],
+ search: function (uastring) {
+ return (contains$1(uastring, 'safari') || contains$1(uastring, 'mobile/')) && contains$1(uastring, 'applewebkit');
+ }
</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: 'Chrome',
- versionRegexes: [
- /.*?chrome\/([0-9]+)\.([0-9]+).*/,
- normalVersionRegex
- ],
- search: function (uastring) {
- return contains$1(uastring, 'chrome') && !contains$1(uastring, 'chromeframe');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ];
+ var oses = [
+ {
+ name: 'Windows',
+ search: checkContains('win'),
+ versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]
+ },
+ {
+ name: 'iOS',
+ search: function (uastring) {
+ return contains$1(uastring, 'iphone') || contains$1(uastring, 'ipad');
+ },
+ versionRegexes: [
+ /.*?version\/\ ?([0-9]+)\.([0-9]+).*/,
+ /.*cpu os ([0-9]+)_([0-9]+).*/,
+ /.*cpu iphone os ([0-9]+)_([0-9]+).*/
+ ]
+ },
+ {
+ name: 'Android',
+ search: checkContains('android'),
+ versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/]
+ },
+ {
+ name: 'OSX',
+ search: checkContains('os x'),
+ versionRegexes: [/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]
+ },
+ {
+ name: 'Linux',
+ search: checkContains('linux'),
+ versionRegexes: []
+ },
+ {
+ name: 'Solaris',
+ search: checkContains('sunos'),
+ versionRegexes: []
+ },
+ {
+ name: 'FreeBSD',
+ search: checkContains('freebsd'),
+ versionRegexes: []
</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: 'IE',
- versionRegexes: [
- /.*?msie\ ?([0-9]+)\.([0-9]+).*/,
- /.*?rv:([0-9]+)\.([0-9]+).*/
- ],
- search: function (uastring) {
- return contains$1(uastring, 'msie') || contains$1(uastring, 'trident');
- }
- },
- {
- name: 'Opera',
- versionRegexes: [
- normalVersionRegex,
- /.*?opera\/([0-9]+)\.([0-9]+).*/
- ],
- search: checkContains('opera')
- },
- {
- name: 'Firefox',
- versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],
- search: checkContains('firefox')
- },
- {
- name: 'Safari',
- versionRegexes: [
- normalVersionRegex,
- /.*?cpu os ([0-9]+)_([0-9]+).*/
- ],
- search: function (uastring) {
- return (contains$1(uastring, 'safari') || contains$1(uastring, 'mobile/')) && contains$1(uastring, 'applewebkit');
- }
- }
- ];
- var oses = [
- {
- name: 'Windows',
- search: checkContains('win'),
- versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]
- },
- {
- name: 'iOS',
- search: function (uastring) {
- return contains$1(uastring, 'iphone') || contains$1(uastring, 'ipad');
- },
- versionRegexes: [
- /.*?version\/\ ?([0-9]+)\.([0-9]+).*/,
- /.*cpu os ([0-9]+)_([0-9]+).*/,
- /.*cpu iphone os ([0-9]+)_([0-9]+).*/
- ]
- },
- {
- name: 'Android',
- search: checkContains('android'),
- versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/]
- },
- {
- name: 'OSX',
- search: checkContains('os x'),
- versionRegexes: [/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]
- },
- {
- name: 'Linux',
- search: checkContains('linux'),
- versionRegexes: []
- },
- {
- name: 'Solaris',
- search: checkContains('sunos'),
- versionRegexes: []
- },
- {
- name: 'FreeBSD',
- search: checkContains('freebsd'),
- versionRegexes: []
- }
- ];
- var $_frphugwpjjgwefy0 = {
- browsers: constant(browsers),
- oses: constant(oses)
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ];
+ var PlatformInfo = {
+ browsers: constant(browsers),
+ oses: constant(oses)
+ };
</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 detect$2 = function (userAgent) {
- var browsers = $_frphugwpjjgwefy0.browsers();
- var oses = $_frphugwpjjgwefy0.oses();
- var browser = $_d66zk7wojjgwefxw.detectBrowser(browsers, userAgent).fold($_6jz8s6wkjjgwefxk.unknown, $_6jz8s6wkjjgwefxk.nu);
- var os = $_d66zk7wojjgwefxw.detectOs(oses, userAgent).fold($_ac4rxfwmjjgwefxp.unknown, $_ac4rxfwmjjgwefxp.nu);
- var deviceType = DeviceType(os, browser, userAgent);
- return {
- browser: browser,
- os: os,
- deviceType: deviceType
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var detect$2 = function (userAgent) {
+ var browsers = PlatformInfo.browsers();
+ var oses = PlatformInfo.oses();
+ var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu);
+ var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu);
+ var deviceType = DeviceType(os, browser, userAgent);
+ return {
+ browser: browser,
+ os: os,
+ deviceType: deviceType
+ };
</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 $_2lmz7fwjjjgwefxj = { detect: detect$2 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var PlatformDetection = { detect: detect$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">- var detect$3 = cached(function () {
- var userAgent = navigator.userAgent;
- return $_2lmz7fwjjjgwefxj.detect(userAgent);
- });
- var $_3d6uczwijjgwefxg = { detect: detect$3 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var detect$3 = cached(function () {
+ var userAgent = navigator.userAgent;
+ return PlatformDetection.detect(userAgent);
+ });
+ var PlatformDetection$1 = { detect: detect$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 ELEMENT = $_vi4lpw5jjgwefvz.ELEMENT;
- var DOCUMENT = $_vi4lpw5jjgwefvz.DOCUMENT;
- var is = function (element, selector) {
- var elem = element.dom();
- if (elem.nodeType !== ELEMENT)
- return false;
- else if (elem.matches !== undefined)
- return elem.matches(selector);
- else if (elem.msMatchesSelector !== undefined)
- return elem.msMatchesSelector(selector);
- else if (elem.webkitMatchesSelector !== undefined)
- return elem.webkitMatchesSelector(selector);
- else if (elem.mozMatchesSelector !== undefined)
- return elem.mozMatchesSelector(selector);
- else
- throw new Error('Browser lacks native selectors');
- };
- var bypassSelector = function (dom) {
- return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT || dom.childElementCount === 0;
- };
- var all = function (selector, scope) {
- var base = scope === undefined ? document : scope.dom();
- return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), Element$$1.fromDom);
- };
- var one = function (selector, scope) {
- var base = scope === undefined ? document : scope.dom();
- return bypassSelector(base) ? Option.none() : Option.from(base.querySelector(selector)).map(Element$$1.fromDom);
- };
- var $_ofcqhwtjjgwefyb = {
- all: all,
- is: is,
- one: one
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ELEMENT$1 = ELEMENT;
+ var DOCUMENT$1 = DOCUMENT;
+ var bypassSelector = function (dom) {
+ return dom.nodeType !== ELEMENT$1 && dom.nodeType !== DOCUMENT$1 || dom.childElementCount === 0;
+ };
+ var all = function (selector, scope) {
+ var base = scope === undefined ? document : scope.dom();
+ return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), Element$$1.fromDom);
+ };
+ var one = function (selector, scope) {
+ var base = scope === undefined ? document : scope.dom();
+ return bypassSelector(base) ? Option.none() : Option.from(base.querySelector(selector)).map(Element$$1.fromDom);
+ };
</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 eq = function (e1, e2) {
- return e1.dom() === e2.dom();
- };
- var isEqualNode = function (e1, e2) {
- return e1.dom().isEqualNode(e2.dom());
- };
- var member = function (element, elements) {
- return exists(elements, curry(eq, element));
- };
- var regularContains = function (e1, e2) {
- var d1 = e1.dom(), d2 = e2.dom();
- return d1 === d2 ? false : d1.contains(d2);
- };
- var ieContains = function (e1, e2) {
- return $_d3tk25wejjgwefxa.documentPositionContainedBy(e1.dom(), e2.dom());
- };
- var browser = $_3d6uczwijjgwefxg.detect().browser;
- var contains$2 = browser.isIE() ? ieContains : regularContains;
- var $_bdbghwwdjjgwefx0 = {
- eq: eq,
- isEqualNode: isEqualNode,
- member: member,
- contains: contains$2,
- is: $_ofcqhwtjjgwefyb.is
- };
-
- var owner = function (element) {
- return Element$$1.fromDom(element.dom().ownerDocument);
- };
- var documentElement = function (element) {
- return Element$$1.fromDom(element.dom().ownerDocument.documentElement);
- };
- var defaultView = function (element) {
- var el = element.dom();
- var defaultView = el.ownerDocument.defaultView;
- return Element$$1.fromDom(defaultView);
- };
- var parent = function (element) {
- var dom = element.dom();
- return Option.from(dom.parentNode).map(Element$$1.fromDom);
- };
- var findIndex$1 = function (element) {
- return parent(element).bind(function (p) {
- var kin = children(p);
- return findIndex(kin, function (elem) {
- return $_bdbghwwdjjgwefx0.eq(element, elem);
- });
- });
- };
- var parents = function (element, isRoot) {
- var stop = isFunction(isRoot) ? isRoot : constant(false);
- var dom = element.dom();
- var ret = [];
- while (dom.parentNode !== null && dom.parentNode !== undefined) {
- var rawParent = dom.parentNode;
- var parent = Element$$1.fromDom(rawParent);
- ret.push(parent);
- if (stop(parent) === true)
- break;
- else
- dom = rawParent;
- }
- return ret;
- };
- var siblings = function (element) {
- var filterSelf = function (elements) {
- return filter(elements, function (x) {
- return !$_bdbghwwdjjgwefx0.eq(element, x);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var regularContains = function (e1, e2) {
+ var d1 = e1.dom(), d2 = e2.dom();
+ return d1 === d2 ? false : d1.contains(d2);
</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 parent(element).map(children).map(filterSelf).getOr([]);
- };
- var offsetParent = function (element) {
- var dom = element.dom();
- return Option.from(dom.offsetParent).map(Element$$1.fromDom);
- };
- var prevSibling = function (element) {
- var dom = element.dom();
- return Option.from(dom.previousSibling).map(Element$$1.fromDom);
- };
- var nextSibling = function (element) {
- var dom = element.dom();
- return Option.from(dom.nextSibling).map(Element$$1.fromDom);
- };
- var prevSiblings = function (element) {
- return reverse($_5edc27wcjjgwefwz.toArray(element, prevSibling));
- };
- var nextSiblings = function (element) {
- return $_5edc27wcjjgwefwz.toArray(element, nextSibling);
- };
- var children = function (element) {
- var dom = element.dom();
- return map(dom.childNodes, Element$$1.fromDom);
- };
- var child = function (element, index) {
- var children = element.dom().childNodes;
- return Option.from(children[index]).map(Element$$1.fromDom);
- };
- var firstChild = function (element) {
- return child(element, 0);
- };
- var lastChild = function (element) {
- return child(element, element.dom().childNodes.length - 1);
- };
- var childNodesCount = function (element) {
- return element.dom().childNodes.length;
- };
- var hasChildNodes = function (element) {
- return element.dom().hasChildNodes();
- };
- var spot = Immutable('element', 'offset');
- var leaf = function (element, offset) {
- var cs = children(element);
- return cs.length > 0 && offset < cs.length ? spot(cs[offset], 0) : spot(element, offset);
- };
- var $_r7112w6jjgwefw2 = {
- owner: owner,
- defaultView: defaultView,
- documentElement: documentElement,
- parent: parent,
- findIndex: findIndex$1,
- parents: parents,
- siblings: siblings,
- prevSibling: prevSibling,
- offsetParent: offsetParent,
- prevSiblings: prevSiblings,
- nextSibling: nextSibling,
- nextSiblings: nextSiblings,
- children: children,
- child: child,
- firstChild: firstChild,
- lastChild: lastChild,
- childNodesCount: childNodesCount,
- hasChildNodes: hasChildNodes,
- leaf: leaf
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ieContains = function (e1, e2) {
+ return Node$1.documentPositionContainedBy(e1.dom(), e2.dom());
+ };
+ var browser = PlatformDetection$1.detect().browser;
+ var contains$2 = browser.isIE() ? ieContains : regularContains;
</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 all$1 = function (predicate) {
- return descendants($_g7jljiw2jjgwefvu.body(), predicate);
- };
- var ancestors = function (scope, predicate, isRoot) {
- return filter($_r7112w6jjgwefw2.parents(scope, isRoot), predicate);
- };
- var siblings$1 = function (scope, predicate) {
- return filter($_r7112w6jjgwefw2.siblings(scope), predicate);
- };
- var children$1 = function (scope, predicate) {
- return filter($_r7112w6jjgwefw2.children(scope), predicate);
- };
- var descendants = function (scope, predicate) {
- var result = [];
- each($_r7112w6jjgwefw2.children(scope), function (x) {
- if (predicate(x)) {
- result = result.concat([x]);
- }
- result = result.concat(descendants(x, predicate));
- });
- return result;
- };
- var $_3dx616w1jjgwefvq = {
- all: all$1,
- ancestors: ancestors,
- siblings: siblings$1,
- children: children$1,
- descendants: descendants
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var spot = Immutable('element', '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 all$2 = function (selector) {
- return $_ofcqhwtjjgwefyb.all(selector);
- };
- var ancestors$1 = function (scope, selector, isRoot) {
- return $_3dx616w1jjgwefvq.ancestors(scope, function (e) {
- return $_ofcqhwtjjgwefyb.is(e, selector);
- }, isRoot);
- };
- var siblings$2 = function (scope, selector) {
- return $_3dx616w1jjgwefvq.siblings(scope, function (e) {
- return $_ofcqhwtjjgwefyb.is(e, selector);
- });
- };
- var children$2 = function (scope, selector) {
- return $_3dx616w1jjgwefvq.children(scope, function (e) {
- return $_ofcqhwtjjgwefyb.is(e, selector);
- });
- };
- var descendants$1 = function (scope, selector) {
- return $_ofcqhwtjjgwefyb.all(selector, scope);
- };
- var $_5wsttjw0jjgwefvp = {
- all: all$2,
- ancestors: ancestors$1,
- siblings: siblings$2,
- children: children$2,
- descendants: descendants$1
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var descendants$1 = function (scope, selector) {
+ return all(selector, scope);
+ };
</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 trim$1 = global$2.trim;
- var hasContentEditableState = function (value) {
- return function (node) {
- if (node && node.nodeType === 1) {
- if (node.contentEditable === value) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var trim$1 = global$2.trim;
+ var hasContentEditableState = function (value) {
+ return function (node) {
+ if (node && node.nodeType === 1) {
+ if (node.contentEditable === value) {
+ return true;
+ }
+ if (node.getAttribute('data-mce-contenteditable') === value) {
+ 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 (node.getAttribute('data-mce-contenteditable') === value) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return false;
+ };
+ };
+ var isContentEditableTrue = hasContentEditableState('true');
+ var isContentEditableFalse = hasContentEditableState('false');
+ var create = function (type, title, url, level, attach) {
+ return {
+ type: type,
+ title: title,
+ url: url,
+ level: level,
+ attach: attach
+ };
+ };
+ var isChildOfContentEditableTrue = function (node) {
+ while (node = node.parentNode) {
+ var value = node.contentEditable;
+ if (value && value !== 'inherit') {
+ return isContentEditableTrue(node);
</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"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var isContentEditableTrue = hasContentEditableState('true');
- var isContentEditableFalse = hasContentEditableState('false');
- var create = function (type, title, url, level, attach) {
- return {
- type: type,
- title: title,
- url: url,
- level: level,
- attach: attach
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var select = function (selector, root) {
+ return map(descendants$1(Element$$1.fromDom(root), selector), function (element) {
+ return element.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 isChildOfContentEditableTrue = function (node) {
- while (node = node.parentNode) {
- var value = node.contentEditable;
- if (value && value !== 'inherit') {
- return isContentEditableTrue(node);
- }
- }
- return false;
- };
- var select = function (selector, root) {
- return map($_5wsttjw0jjgwefvp.descendants(Element$$1.fromDom(root), selector), function (element) {
- return element.dom();
- });
- };
- var getElementText = function (elm) {
- return elm.innerText || elm.textContent;
- };
- var getOrGenerateId = function (elm) {
- return elm.id ? elm.id : generate('h');
- };
- var isAnchor = function (elm) {
- return elm && elm.nodeName === 'A' && (elm.id || elm.name);
- };
- var isValidAnchor = function (elm) {
- return isAnchor(elm) && isEditable(elm);
- };
- var isHeader = function (elm) {
- return elm && /^(H[1-6])$/.test(elm.nodeName);
- };
- var isEditable = function (elm) {
- return isChildOfContentEditableTrue(elm) && !isContentEditableFalse(elm);
- };
- var isValidHeader = function (elm) {
- return isHeader(elm) && isEditable(elm);
- };
- var getLevel = function (elm) {
- return isHeader(elm) ? parseInt(elm.nodeName.substr(1), 10) : 0;
- };
- var headerTarget = function (elm) {
- var headerId = getOrGenerateId(elm);
- var attach = function () {
- elm.id = headerId;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getElementText = function (elm) {
+ return elm.innerText || elm.textContent;
</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 create('header', getElementText(elm), '#' + headerId, getLevel(elm), attach);
- };
- var anchorTarget = function (elm) {
- var anchorId = elm.id || elm.name;
- var anchorText = getElementText(elm);
- return create('anchor', anchorText ? anchorText : '#' + anchorId, '#' + anchorId, 0, noop);
- };
- var getHeaderTargets = function (elms) {
- return map(filter(elms, isValidHeader), headerTarget);
- };
- var getAnchorTargets = function (elms) {
- return map(filter(elms, isValidAnchor), anchorTarget);
- };
- var getTargetElements = function (elm) {
- var elms = select('h1,h2,h3,h4,h5,h6,a:not([href])', elm);
- return elms;
- };
- var hasTitle = function (target) {
- return trim$1(target.title).length > 0;
- };
- var find$3 = function (elm) {
- var elms = getTargetElements(elm);
- return filter(getHeaderTargets(elms).concat(getAnchorTargets(elms)), hasTitle);
- };
- var $_7cacckvxjjgwefv6 = { find: find$3 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getOrGenerateId = function (elm) {
+ return elm.id ? elm.id : generate('h');
+ };
+ var isAnchor = function (elm) {
+ return elm && elm.nodeName === 'A' && (elm.id || elm.name);
+ };
+ var isValidAnchor = function (elm) {
+ return isAnchor(elm) && isEditable(elm);
+ };
+ var isHeader = function (elm) {
+ return elm && /^(H[1-6])$/.test(elm.nodeName);
+ };
+ var isEditable = function (elm) {
+ return isChildOfContentEditableTrue(elm) && !isContentEditableFalse(elm);
+ };
+ var isValidHeader = function (elm) {
+ return isHeader(elm) && isEditable(elm);
+ };
+ var getLevel = function (elm) {
+ return isHeader(elm) ? parseInt(elm.nodeName.substr(1), 10) : 0;
+ };
+ var headerTarget = function (elm) {
+ var headerId = getOrGenerateId(elm);
+ var attach = function () {
+ elm.id = headerId;
+ };
+ return create('header', getElementText(elm), '#' + headerId, getLevel(elm), attach);
+ };
+ var anchorTarget = function (elm) {
+ var anchorId = elm.id || elm.name;
+ var anchorText = getElementText(elm);
+ return create('anchor', anchorText ? anchorText : '#' + anchorId, '#' + anchorId, 0, noop);
+ };
+ var getHeaderTargets = function (elms) {
+ return map(filter(elms, isValidHeader), headerTarget);
+ };
+ var getAnchorTargets = function (elms) {
+ return map(filter(elms, isValidAnchor), anchorTarget);
+ };
+ var getTargetElements = function (elm) {
+ var elms = select('h1,h2,h3,h4,h5,h6,a:not([href])', elm);
+ return elms;
+ };
+ var hasTitle = function (target) {
+ return trim$1(target.title).length > 0;
+ };
+ var find$3 = function (elm) {
+ var elms = getTargetElements(elm);
+ return filter(getHeaderTargets(elms).concat(getAnchorTargets(elms)), hasTitle);
+ };
+ var LinkTargets = { find: find$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 getActiveEditor = function () {
- return window.tinymce ? window.tinymce.activeEditor : global$1.activeEditor;
- };
- var history = {};
- var HISTORY_LENGTH = 5;
- var clearHistory = function () {
- history = {};
- };
- var toMenuItem = function (target) {
- return {
- title: target.title,
- value: {
- title: { raw: target.title },
- url: target.url,
- attach: target.attach
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getActiveEditor = function () {
+ return window.tinymce ? window.tinymce.activeEditor : global$1.activeEditor;
</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 toMenuItems = function (targets) {
- return global$2.map(targets, toMenuItem);
- };
- var staticMenuItem = function (title, url) {
- return {
- title: title,
- value: {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var history = {};
+ var HISTORY_LENGTH = 5;
+ var clearHistory = function () {
+ history = {};
+ };
+ var toMenuItem = function (target) {
+ return {
+ title: target.title,
+ value: {
+ title: { raw: target.title },
+ url: target.url,
+ attach: target.attach
+ }
+ };
+ };
+ var toMenuItems = function (targets) {
+ return global$2.map(targets, toMenuItem);
+ };
+ var staticMenuItem = function (title, url) {
+ return {
</ins><span class="cx" style="display: block; padding: 0 10px"> title: title,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- url: url,
- attach: noop
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ value: {
+ title: title,
+ url: url,
+ attach: 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">- };
- var isUniqueUrl = function (url, targets) {
- var foundTarget = exists(targets, function (target) {
- return target.url === url;
- });
- return !foundTarget;
- };
- var getSetting = function (editorSettings, name, defaultValue) {
- var value = name in editorSettings ? editorSettings[name] : defaultValue;
- return value === false ? null : value;
- };
- var createMenuItems = function (term, targets, fileType, editorSettings) {
- var separator = { title: '-' };
- var fromHistoryMenuItems = function (history) {
- var historyItems = history.hasOwnProperty(fileType) ? history[fileType] : [];
- var uniqueHistory = filter(historyItems, function (url) {
- return isUniqueUrl(url, targets);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isUniqueUrl = function (url, targets) {
+ var foundTarget = exists(targets, function (target) {
+ return target.url === 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">- return global$2.map(uniqueHistory, function (url) {
- return {
- title: url,
- value: {
- title: url,
- url: url,
- attach: noop
- }
- };
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return !foundTarget;
</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 fromMenuItems = function (type) {
- var filteredTargets = filter(targets, function (target) {
- return target.type === type;
- });
- return toMenuItems(filteredTargets);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getSetting = function (editorSettings, name, defaultValue) {
+ var value = name in editorSettings ? editorSettings[name] : defaultValue;
+ return value === false ? null : 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 anchorMenuItems = function () {
- var anchorMenuItems = fromMenuItems('anchor');
- var topAnchor = getSetting(editorSettings, 'anchor_top', '#top');
- var bottomAchor = getSetting(editorSettings, 'anchor_bottom', '#bottom');
- if (topAnchor !== null) {
- anchorMenuItems.unshift(staticMenuItem('<top>', topAnchor));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createMenuItems = function (term, targets, fileType, editorSettings) {
+ var separator = { title: '-' };
+ var fromHistoryMenuItems = function (history) {
+ var historyItems = history.hasOwnProperty(fileType) ? history[fileType] : [];
+ var uniqueHistory = filter(historyItems, function (url) {
+ return isUniqueUrl(url, targets);
+ });
+ return global$2.map(uniqueHistory, function (url) {
+ return {
+ title: url,
+ value: {
+ title: url,
+ url: url,
+ attach: noop
+ }
+ };
+ });
+ };
+ var fromMenuItems = function (type) {
+ var filteredTargets = filter(targets, function (target) {
+ return target.type === type;
+ });
+ return toMenuItems(filteredTargets);
+ };
+ var anchorMenuItems = function () {
+ var anchorMenuItems = fromMenuItems('anchor');
+ var topAnchor = getSetting(editorSettings, 'anchor_top', '#top');
+ var bottomAchor = getSetting(editorSettings, 'anchor_bottom', '#bottom');
+ if (topAnchor !== null) {
+ anchorMenuItems.unshift(staticMenuItem('<top>', topAnchor));
+ }
+ if (bottomAchor !== null) {
+ anchorMenuItems.push(staticMenuItem('<bottom>', bottomAchor));
+ }
+ return anchorMenuItems;
+ };
+ var join = function (items) {
+ return foldl(items, function (a, b) {
+ var bothEmpty = a.length === 0 || b.length === 0;
+ return bothEmpty ? a.concat(b) : a.concat(separator, b);
+ }, []);
+ };
+ if (editorSettings.typeahead_urls === 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">- if (bottomAchor !== null) {
- anchorMenuItems.push(staticMenuItem('<bottom>', bottomAchor));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return fileType === 'file' ? join([
+ filterByQuery(term, fromHistoryMenuItems(history)),
+ filterByQuery(term, fromMenuItems('header')),
+ filterByQuery(term, anchorMenuItems())
+ ]) : filterByQuery(term, fromHistoryMenuItems(history));
+ };
+ var addToHistory = function (url, fileType) {
+ var items = history[fileType];
+ if (!/^https?/.test(url)) {
+ 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 anchorMenuItems;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (items) {
+ if (indexOf(items, url).isNone()) {
+ history[fileType] = items.slice(0, HISTORY_LENGTH).concat(url);
+ }
+ } else {
+ history[fileType] = [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">- var join = function (items) {
- return foldl(items, function (a, b) {
- var bothEmpty = a.length === 0 || b.length === 0;
- return bothEmpty ? a.concat(b) : a.concat(separator, b);
- }, []);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var filterByQuery = function (term, menuItems) {
+ var lowerCaseTerm = term.toLowerCase();
+ var result = global$2.grep(menuItems, function (item) {
+ return item.title.toLowerCase().indexOf(lowerCaseTerm) !== -1;
+ });
+ return result.length === 1 && result[0].title === term ? [] : result;
</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 (editorSettings.typeahead_urls === false) {
- return [];
- }
- return fileType === 'file' ? join([
- filterByQuery(term, fromHistoryMenuItems(history)),
- filterByQuery(term, fromMenuItems('header')),
- filterByQuery(term, anchorMenuItems())
- ]) : filterByQuery(term, fromHistoryMenuItems(history));
- };
- var addToHistory = function (url, fileType) {
- var items = history[fileType];
- if (!/^https?/.test(url)) {
- return;
- }
- if (items) {
- if (indexOf(items, url).isNone()) {
- history[fileType] = items.slice(0, HISTORY_LENGTH).concat(url);
- }
- } else {
- history[fileType] = [url];
- }
- };
- var filterByQuery = function (term, menuItems) {
- var lowerCaseTerm = term.toLowerCase();
- var result = global$2.grep(menuItems, function (item) {
- return item.title.toLowerCase().indexOf(lowerCaseTerm) !== -1;
- });
- return result.length === 1 && result[0].title === term ? [] : result;
- };
- var getTitle = function (linkDetails) {
- var title = linkDetails.title;
- return title.raw ? title.raw : title;
- };
- var setupAutoCompleteHandler = function (ctrl, editorSettings, bodyElm, fileType) {
- var autocomplete = function (term) {
- var linkTargets = $_7cacckvxjjgwefv6.find(bodyElm);
- var menuItems = createMenuItems(term, linkTargets, fileType, editorSettings);
- ctrl.showAutoComplete(menuItems, term);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getTitle = function (linkDetails) {
+ var title = linkDetails.title;
+ return title.raw ? title.raw : 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">- ctrl.on('autocomplete', function () {
- autocomplete(ctrl.value());
- });
- ctrl.on('selectitem', function (e) {
- var linkDetails = e.value;
- ctrl.value(linkDetails.url);
- var title = getTitle(linkDetails);
- if (fileType === 'image') {
- ctrl.fire('change', {
- meta: {
- alt: title,
- attach: linkDetails.attach
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setupAutoCompleteHandler = function (ctrl, editorSettings, bodyElm, fileType) {
+ var autocomplete = function (term) {
+ var linkTargets = LinkTargets.find(bodyElm);
+ var menuItems = createMenuItems(term, linkTargets, fileType, editorSettings);
+ ctrl.showAutoComplete(menuItems, term);
+ };
+ ctrl.on('autocomplete', function () {
+ autocomplete(ctrl.value());
+ });
+ ctrl.on('selectitem', function (e) {
+ var linkDetails = e.value;
+ ctrl.value(linkDetails.url);
+ var title = getTitle(linkDetails);
+ if (fileType === 'image') {
+ ctrl.fire('change', {
+ meta: {
+ alt: title,
+ attach: linkDetails.attach
+ }
+ });
+ } else {
+ ctrl.fire('change', {
+ meta: {
+ text: title,
+ attach: linkDetails.attach
+ }
+ });
+ }
+ ctrl.focus();
+ });
+ ctrl.on('click', function (e) {
+ if (ctrl.value().length === 0 && e.target.nodeName === 'INPUT') {
+ autocomplete('');
+ }
+ });
+ ctrl.on('PostRender', function () {
+ ctrl.getRoot().on('submit', function (e) {
+ if (!e.isDefaultPrevented()) {
+ addToHistory(ctrl.value(), fileType);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ var statusToUiState = function (result) {
+ var status = result.status, message = result.message;
+ if (status === 'valid') {
+ return {
+ status: 'ok',
+ message: message
+ };
+ } else if (status === 'unknown') {
+ return {
+ status: 'warn',
+ message: message
+ };
+ } else if (status === 'invalid') {
+ return {
+ status: 'warn',
+ message: message
+ };
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ctrl.fire('change', {
- meta: {
- text: title,
- attach: linkDetails.attach
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return {
+ status: 'none',
+ message: ''
+ };
+ }
+ };
+ var setupLinkValidatorHandler = function (ctrl, editorSettings, fileType) {
+ var validatorHandler = editorSettings.filepicker_validator_handler;
+ if (validatorHandler) {
+ var validateUrl_1 = function (url) {
+ if (url.length === 0) {
+ ctrl.statusLevel('none');
+ return;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ validatorHandler({
+ url: url,
+ type: fileType
+ }, function (result) {
+ var uiState = statusToUiState(result);
+ ctrl.statusMessage(uiState.message);
+ ctrl.statusLevel(uiState.status);
+ });
+ };
+ ctrl.state.on('change:value', function (e) {
+ validateUrl_1(e.value);
</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">- ctrl.focus();
- });
- ctrl.on('click', function (e) {
- if (ctrl.value().length === 0 && e.target.nodeName === 'INPUT') {
- autocomplete('');
- }
- });
- ctrl.on('PostRender', function () {
- ctrl.getRoot().on('submit', function (e) {
- if (!e.isDefaultPrevented()) {
- addToHistory(ctrl.value(), fileType);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var FilePicker = ComboBox.extend({
+ Statics: { clearHistory: clearHistory },
+ init: function (settings) {
+ var self = this, editor = getActiveEditor(), editorSettings = editor.settings;
+ var actionCallback, fileBrowserCallback, fileBrowserCallbackTypes;
+ var fileType = settings.filetype;
+ settings.spellcheck = false;
+ fileBrowserCallbackTypes = editorSettings.file_picker_types || editorSettings.file_browser_callback_types;
+ if (fileBrowserCallbackTypes) {
+ fileBrowserCallbackTypes = global$2.makeMap(fileBrowserCallbackTypes, /[, ]/);
</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 statusToUiState = function (result) {
- var status = result.status, message = result.message;
- if (status === 'valid') {
- return {
- status: 'ok',
- message: message
- };
- } else if (status === 'unknown') {
- return {
- status: 'warn',
- message: message
- };
- } else if (status === 'invalid') {
- return {
- status: 'warn',
- message: message
- };
- } else {
- return {
- status: 'none',
- message: ''
- };
- }
- };
- var setupLinkValidatorHandler = function (ctrl, editorSettings, fileType) {
- var validatorHandler = editorSettings.filepicker_validator_handler;
- if (validatorHandler) {
- var validateUrl_1 = function (url) {
- if (url.length === 0) {
- ctrl.statusLevel('none');
- return;
- }
- validatorHandler({
- url: url,
- type: fileType
- }, function (result) {
- var uiState = statusToUiState(result);
- ctrl.statusMessage(uiState.message);
- ctrl.statusLevel(uiState.status);
- });
- };
- ctrl.state.on('change:value', function (e) {
- validateUrl_1(e.value);
- });
- }
- };
- var FilePicker = ComboBox.extend({
- Statics: { clearHistory: clearHistory },
- init: function (settings) {
- var self = this, editor = getActiveEditor(), editorSettings = editor.settings;
- var actionCallback, fileBrowserCallback, fileBrowserCallbackTypes;
- var fileType = settings.filetype;
- settings.spellcheck = false;
- fileBrowserCallbackTypes = editorSettings.file_picker_types || editorSettings.file_browser_callback_types;
- if (fileBrowserCallbackTypes) {
- fileBrowserCallbackTypes = global$2.makeMap(fileBrowserCallbackTypes, /[, ]/);
- }
- if (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[fileType]) {
- fileBrowserCallback = editorSettings.file_picker_callback;
- if (fileBrowserCallback && (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[fileType])) {
- actionCallback = function () {
- var meta = self.fire('beforecall').meta;
- meta = global$2.extend({ filetype: fileType }, meta);
- fileBrowserCallback.call(editor, function (value, meta) {
- self.value(value).fire('change', { meta: meta });
- }, self.value(), meta);
- };
- } else {
- fileBrowserCallback = editorSettings.file_browser_callback;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[fileType]) {
+ fileBrowserCallback = editorSettings.file_picker_callback;
</ins><span class="cx" style="display: block; padding: 0 10px"> if (fileBrowserCallback && (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[fileType])) {
</span><span class="cx" style="display: block; padding: 0 10px"> actionCallback = function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- fileBrowserCallback(self.getEl('inp').id, self.value(), fileType, window);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var meta = self.fire('beforecall').meta;
+ meta = global$2.extend({ filetype: fileType }, meta);
+ fileBrowserCallback.call(editor, function (value, meta) {
+ self.value(value).fire('change', { meta: meta });
+ }, self.value(), meta);
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ fileBrowserCallback = editorSettings.file_browser_callback;
+ if (fileBrowserCallback && (!fileBrowserCallbackTypes || fileBrowserCallbackTypes[fileType])) {
+ actionCallback = function () {
+ fileBrowserCallback(self.getEl('inp').id, self.value(), fileType, window);
+ };
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (actionCallback) {
+ settings.icon = 'browse';
+ settings.onaction = actionCallback;
+ }
+ self._super(settings);
+ self.classes.add('filepicker');
+ setupAutoCompleteHandler(self, editorSettings, editor.getBody(), fileType);
+ setupLinkValidatorHandler(self, editorSettings, fileType);
</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 (actionCallback) {
- settings.icon = 'browse';
- settings.onaction = actionCallback;
- }
- self._super(settings);
- self.classes.add('filepicker');
- setupAutoCompleteHandler(self, editorSettings, editor.getBody(), fileType);
- setupLinkValidatorHandler(self, editorSettings, fileType);
- }
- });
</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">- var FitLayout = AbsoluteLayout.extend({
- recalc: function (container) {
- var contLayoutRect = container.layoutRect(), paddingBox = container.paddingBox;
- container.items().filter(':visible').each(function (ctrl) {
- ctrl.layoutRect({
- x: paddingBox.left,
- y: paddingBox.top,
- w: contLayoutRect.innerW - paddingBox.right - paddingBox.left,
- h: contLayoutRect.innerH - paddingBox.top - paddingBox.bottom
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var FitLayout = AbsoluteLayout.extend({
+ recalc: function (container) {
+ var contLayoutRect = container.layoutRect(), paddingBox = container.paddingBox;
+ container.items().filter(':visible').each(function (ctrl) {
+ ctrl.layoutRect({
+ x: paddingBox.left,
+ y: paddingBox.top,
+ w: contLayoutRect.innerW - paddingBox.right - paddingBox.left,
+ h: contLayoutRect.innerH - paddingBox.top - paddingBox.bottom
+ });
+ if (ctrl.recalc) {
+ ctrl.recalc();
+ }
</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 (ctrl.recalc) {
- ctrl.recalc();
- }
- });
- }
- });
</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">- var FlexLayout = AbsoluteLayout.extend({
- recalc: function (container) {
- var i, l, items, contLayoutRect, contPaddingBox, contSettings, align, pack, spacing, totalFlex, availableSpace, direction;
- var ctrl, ctrlLayoutRect, ctrlSettings, flex;
- var maxSizeItems = [];
- var size, maxSize, ratio, rect, pos, maxAlignEndPos;
- var sizeName, minSizeName, posName, maxSizeName, beforeName, innerSizeName, deltaSizeName, contentSizeName;
- var alignAxisName, alignInnerSizeName, alignSizeName, alignMinSizeName, alignBeforeName, alignAfterName;
- var alignDeltaSizeName, alignContentSizeName;
- var max = Math.max, min = Math.min;
- items = container.items().filter(':visible');
- contLayoutRect = container.layoutRect();
- contPaddingBox = container.paddingBox;
- contSettings = container.settings;
- direction = container.isRtl() ? contSettings.direction || 'row-reversed' : contSettings.direction;
- align = contSettings.align;
- pack = container.isRtl() ? contSettings.pack || 'end' : contSettings.pack;
- spacing = contSettings.spacing || 0;
- if (direction === 'row-reversed' || direction === 'column-reverse') {
- items = items.set(items.toArray().reverse());
- direction = direction.split('-')[0];
- }
- if (direction === 'column') {
- posName = 'y';
- sizeName = 'h';
- minSizeName = 'minH';
- maxSizeName = 'maxH';
- innerSizeName = 'innerH';
- beforeName = 'top';
- deltaSizeName = 'deltaH';
- contentSizeName = 'contentH';
- alignBeforeName = 'left';
- alignSizeName = 'w';
- alignAxisName = 'x';
- alignInnerSizeName = 'innerW';
- alignMinSizeName = 'minW';
- alignAfterName = 'right';
- alignDeltaSizeName = 'deltaW';
- alignContentSizeName = 'contentW';
- } else {
- posName = 'x';
- sizeName = 'w';
- minSizeName = 'minW';
- maxSizeName = 'maxW';
- innerSizeName = 'innerW';
- beforeName = 'left';
- deltaSizeName = 'deltaW';
- contentSizeName = 'contentW';
- alignBeforeName = 'top';
- alignSizeName = 'h';
- alignAxisName = 'y';
- alignInnerSizeName = 'innerH';
- alignMinSizeName = 'minH';
- alignAfterName = 'bottom';
- alignDeltaSizeName = 'deltaH';
- alignContentSizeName = 'contentH';
- }
- availableSpace = contLayoutRect[innerSizeName] - contPaddingBox[beforeName] - contPaddingBox[beforeName];
- maxAlignEndPos = totalFlex = 0;
- for (i = 0, l = items.length; i < l; i++) {
- ctrl = items[i];
- ctrlLayoutRect = ctrl.layoutRect();
- ctrlSettings = ctrl.settings;
- flex = ctrlSettings.flex;
- availableSpace -= i < l - 1 ? spacing : 0;
- if (flex > 0) {
- totalFlex += flex;
- if (ctrlLayoutRect[maxSizeName]) {
- maxSizeItems.push(ctrl);
- }
- ctrlLayoutRect.flex = flex;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var FlexLayout = AbsoluteLayout.extend({
+ recalc: function (container) {
+ var i, l, items, contLayoutRect, contPaddingBox, contSettings, align, pack, spacing, totalFlex, availableSpace, direction;
+ var ctrl, ctrlLayoutRect, ctrlSettings, flex;
+ var maxSizeItems = [];
+ var size, maxSize, ratio, rect, pos, maxAlignEndPos;
+ var sizeName, minSizeName, posName, maxSizeName, beforeName, innerSizeName, deltaSizeName, contentSizeName;
+ var alignAxisName, alignInnerSizeName, alignSizeName, alignMinSizeName, alignBeforeName, alignAfterName;
+ var alignDeltaSizeName, alignContentSizeName;
+ var max = Math.max, min = Math.min;
+ items = container.items().filter(':visible');
+ contLayoutRect = container.layoutRect();
+ contPaddingBox = container.paddingBox;
+ contSettings = container.settings;
+ direction = container.isRtl() ? contSettings.direction || 'row-reversed' : contSettings.direction;
+ align = contSettings.align;
+ pack = container.isRtl() ? contSettings.pack || 'end' : contSettings.pack;
+ spacing = contSettings.spacing || 0;
+ if (direction === 'row-reversed' || direction === 'column-reverse') {
+ items = items.set(items.toArray().reverse());
+ direction = direction.split('-')[0];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- availableSpace -= ctrlLayoutRect[minSizeName];
- size = contPaddingBox[alignBeforeName] + ctrlLayoutRect[alignMinSizeName] + contPaddingBox[alignAfterName];
- if (size > maxAlignEndPos) {
- maxAlignEndPos = size;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (direction === 'column') {
+ posName = 'y';
+ sizeName = 'h';
+ minSizeName = 'minH';
+ maxSizeName = 'maxH';
+ innerSizeName = 'innerH';
+ beforeName = 'top';
+ deltaSizeName = 'deltaH';
+ contentSizeName = 'contentH';
+ alignBeforeName = 'left';
+ alignSizeName = 'w';
+ alignAxisName = 'x';
+ alignInnerSizeName = 'innerW';
+ alignMinSizeName = 'minW';
+ alignAfterName = 'right';
+ alignDeltaSizeName = 'deltaW';
+ alignContentSizeName = 'contentW';
+ } else {
+ posName = 'x';
+ sizeName = 'w';
+ minSizeName = 'minW';
+ maxSizeName = 'maxW';
+ innerSizeName = 'innerW';
+ beforeName = 'left';
+ deltaSizeName = 'deltaW';
+ contentSizeName = 'contentW';
+ alignBeforeName = 'top';
+ alignSizeName = 'h';
+ alignAxisName = 'y';
+ alignInnerSizeName = 'innerH';
+ alignMinSizeName = 'minH';
+ alignAfterName = 'bottom';
+ alignDeltaSizeName = 'deltaH';
+ alignContentSizeName = 'contentH';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- rect = {};
- if (availableSpace < 0) {
- rect[minSizeName] = contLayoutRect[minSizeName] - availableSpace + contLayoutRect[deltaSizeName];
- } else {
- rect[minSizeName] = contLayoutRect[innerSizeName] - availableSpace + contLayoutRect[deltaSizeName];
- }
- rect[alignMinSizeName] = maxAlignEndPos + contLayoutRect[alignDeltaSizeName];
- rect[contentSizeName] = contLayoutRect[innerSizeName] - availableSpace;
- rect[alignContentSizeName] = maxAlignEndPos;
- rect.minW = min(rect.minW, contLayoutRect.maxW);
- rect.minH = min(rect.minH, contLayoutRect.maxH);
- rect.minW = max(rect.minW, contLayoutRect.startMinWidth);
- rect.minH = max(rect.minH, contLayoutRect.startMinHeight);
- if (contLayoutRect.autoResize && (rect.minW !== contLayoutRect.minW || rect.minH !== contLayoutRect.minH)) {
- rect.w = rect.minW;
- rect.h = rect.minH;
- container.layoutRect(rect);
- this.recalc(container);
- if (container._lastRect === null) {
- var parentCtrl = container.parent();
- if (parentCtrl) {
- parentCtrl._lastRect = null;
- parentCtrl.recalc();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ availableSpace = contLayoutRect[innerSizeName] - contPaddingBox[beforeName] - contPaddingBox[beforeName];
+ maxAlignEndPos = totalFlex = 0;
+ for (i = 0, l = items.length; i < l; i++) {
+ ctrl = items[i];
+ ctrlLayoutRect = ctrl.layoutRect();
+ ctrlSettings = ctrl.settings;
+ flex = ctrlSettings.flex;
+ availableSpace -= i < l - 1 ? spacing : 0;
+ if (flex > 0) {
+ totalFlex += flex;
+ if (ctrlLayoutRect[maxSizeName]) {
+ maxSizeItems.push(ctrl);
+ }
+ ctrlLayoutRect.flex = flex;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ availableSpace -= ctrlLayoutRect[minSizeName];
+ size = contPaddingBox[alignBeforeName] + ctrlLayoutRect[alignMinSizeName] + contPaddingBox[alignAfterName];
+ if (size > maxAlignEndPos) {
+ maxAlignEndPos = size;
+ }
</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;
- }
- ratio = availableSpace / totalFlex;
- for (i = 0, l = maxSizeItems.length; i < l; i++) {
- ctrl = maxSizeItems[i];
- ctrlLayoutRect = ctrl.layoutRect();
- maxSize = ctrlLayoutRect[maxSizeName];
- size = ctrlLayoutRect[minSizeName] + ctrlLayoutRect.flex * ratio;
- if (size > maxSize) {
- availableSpace -= ctrlLayoutRect[maxSizeName] - ctrlLayoutRect[minSizeName];
- totalFlex -= ctrlLayoutRect.flex;
- ctrlLayoutRect.flex = 0;
- ctrlLayoutRect.maxFlexSize = maxSize;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rect = {};
+ if (availableSpace < 0) {
+ rect[minSizeName] = contLayoutRect[minSizeName] - availableSpace + contLayoutRect[deltaSizeName];
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ctrlLayoutRect.maxFlexSize = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rect[minSizeName] = contLayoutRect[innerSizeName] - availableSpace + contLayoutRect[deltaSizeName];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- ratio = availableSpace / totalFlex;
- pos = contPaddingBox[beforeName];
- rect = {};
- if (totalFlex === 0) {
- if (pack === 'end') {
- pos = availableSpace + contPaddingBox[beforeName];
- } else if (pack === 'center') {
- pos = Math.round(contLayoutRect[innerSizeName] / 2 - (contLayoutRect[innerSizeName] - availableSpace) / 2) + contPaddingBox[beforeName];
- if (pos < 0) {
- pos = contPaddingBox[beforeName];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rect[alignMinSizeName] = maxAlignEndPos + contLayoutRect[alignDeltaSizeName];
+ rect[contentSizeName] = contLayoutRect[innerSizeName] - availableSpace;
+ rect[alignContentSizeName] = maxAlignEndPos;
+ rect.minW = min(rect.minW, contLayoutRect.maxW);
+ rect.minH = min(rect.minH, contLayoutRect.maxH);
+ rect.minW = max(rect.minW, contLayoutRect.startMinWidth);
+ rect.minH = max(rect.minH, contLayoutRect.startMinHeight);
+ if (contLayoutRect.autoResize && (rect.minW !== contLayoutRect.minW || rect.minH !== contLayoutRect.minH)) {
+ rect.w = rect.minW;
+ rect.h = rect.minH;
+ container.layoutRect(rect);
+ this.recalc(container);
+ if (container._lastRect === null) {
+ var parentCtrl = container.parent();
+ if (parentCtrl) {
+ parentCtrl._lastRect = null;
+ parentCtrl.recalc();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else if (pack === 'justify') {
- pos = contPaddingBox[beforeName];
- spacing = Math.floor(availableSpace / (items.length - 1));
</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">- }
- rect[alignAxisName] = contPaddingBox[alignBeforeName];
- for (i = 0, l = items.length; i < l; i++) {
- ctrl = items[i];
- ctrlLayoutRect = ctrl.layoutRect();
- size = ctrlLayoutRect.maxFlexSize || ctrlLayoutRect[minSizeName];
- if (align === 'center') {
- rect[alignAxisName] = Math.round(contLayoutRect[alignInnerSizeName] / 2 - ctrlLayoutRect[alignSizeName] / 2);
- } else if (align === 'stretch') {
- rect[alignSizeName] = max(ctrlLayoutRect[alignMinSizeName] || 0, contLayoutRect[alignInnerSizeName] - contPaddingBox[alignBeforeName] - contPaddingBox[alignAfterName]);
- rect[alignAxisName] = contPaddingBox[alignBeforeName];
- } else if (align === 'end') {
- rect[alignAxisName] = contLayoutRect[alignInnerSizeName] - ctrlLayoutRect[alignSizeName] - contPaddingBox.top;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ratio = availableSpace / totalFlex;
+ for (i = 0, l = maxSizeItems.length; i < l; i++) {
+ ctrl = maxSizeItems[i];
+ ctrlLayoutRect = ctrl.layoutRect();
+ maxSize = ctrlLayoutRect[maxSizeName];
+ size = ctrlLayoutRect[minSizeName] + ctrlLayoutRect.flex * ratio;
+ if (size > maxSize) {
+ availableSpace -= ctrlLayoutRect[maxSizeName] - ctrlLayoutRect[minSizeName];
+ totalFlex -= ctrlLayoutRect.flex;
+ ctrlLayoutRect.flex = 0;
+ ctrlLayoutRect.maxFlexSize = maxSize;
+ } else {
+ ctrlLayoutRect.maxFlexSize = 0;
+ }
</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 (ctrlLayoutRect.flex > 0) {
- size += ctrlLayoutRect.flex * ratio;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ratio = availableSpace / totalFlex;
+ pos = contPaddingBox[beforeName];
+ rect = {};
+ if (totalFlex === 0) {
+ if (pack === 'end') {
+ pos = availableSpace + contPaddingBox[beforeName];
+ } else if (pack === 'center') {
+ pos = Math.round(contLayoutRect[innerSizeName] / 2 - (contLayoutRect[innerSizeName] - availableSpace) / 2) + contPaddingBox[beforeName];
+ if (pos < 0) {
+ pos = contPaddingBox[beforeName];
+ }
+ } else if (pack === 'justify') {
+ pos = contPaddingBox[beforeName];
+ spacing = Math.floor(availableSpace / (items.length - 1));
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- rect[sizeName] = size;
- rect[posName] = pos;
- ctrl.layoutRect(rect);
- if (ctrl.recalc) {
- ctrl.recalc();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rect[alignAxisName] = contPaddingBox[alignBeforeName];
+ for (i = 0, l = items.length; i < l; i++) {
+ ctrl = items[i];
+ ctrlLayoutRect = ctrl.layoutRect();
+ size = ctrlLayoutRect.maxFlexSize || ctrlLayoutRect[minSizeName];
+ if (align === 'center') {
+ rect[alignAxisName] = Math.round(contLayoutRect[alignInnerSizeName] / 2 - ctrlLayoutRect[alignSizeName] / 2);
+ } else if (align === 'stretch') {
+ rect[alignSizeName] = max(ctrlLayoutRect[alignMinSizeName] || 0, contLayoutRect[alignInnerSizeName] - contPaddingBox[alignBeforeName] - contPaddingBox[alignAfterName]);
+ rect[alignAxisName] = contPaddingBox[alignBeforeName];
+ } else if (align === 'end') {
+ rect[alignAxisName] = contLayoutRect[alignInnerSizeName] - ctrlLayoutRect[alignSizeName] - contPaddingBox.top;
+ }
+ if (ctrlLayoutRect.flex > 0) {
+ size += ctrlLayoutRect.flex * ratio;
+ }
+ rect[sizeName] = size;
+ rect[posName] = pos;
+ ctrl.layoutRect(rect);
+ if (ctrl.recalc) {
+ ctrl.recalc();
+ }
+ pos += size + spacing;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- pos += size + spacing;
</del><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">+ });
</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 FlowLayout = Layout.extend({
- Defaults: {
- containerClass: 'flow-layout',
- controlClass: 'flow-layout-item',
- endClass: 'break'
- },
- recalc: function (container) {
- container.items().filter(':visible').each(function (ctrl) {
- if (ctrl.recalc) {
- ctrl.recalc();
- }
- });
- },
- isNative: function () {
- return true;
- }
- });
-
- function ClosestOrAncestor (is, ancestor, scope, a, isRoot) {
- return is(scope, a) ? Option.some(scope) : isFunction(isRoot) && isRoot(scope) ? Option.none() : ancestor(scope, a, isRoot);
- }
-
- var first$1 = function (predicate) {
- return descendant($_g7jljiw2jjgwefvu.body(), predicate);
- };
- var ancestor = function (scope, predicate, isRoot) {
- var element = scope.dom();
- var stop = isFunction(isRoot) ? isRoot : constant(false);
- while (element.parentNode) {
- element = element.parentNode;
- var el = Element$$1.fromDom(element);
- if (predicate(el))
- return Option.some(el);
- else if (stop(el))
- break;
- }
- return Option.none();
- };
- var closest = function (scope, predicate, isRoot) {
- var is = function (scope) {
- return predicate(scope);
- };
- return ClosestOrAncestor(is, ancestor, scope, predicate, isRoot);
- };
- var sibling = function (scope, predicate) {
- var element = scope.dom();
- if (!element.parentNode)
- return Option.none();
- return child$1(Element$$1.fromDom(element.parentNode), function (x) {
- return !$_bdbghwwdjjgwefx0.eq(scope, x) && predicate(x);
- });
- };
- var child$1 = function (scope, predicate) {
- var result = find(scope.dom().childNodes, compose(predicate, Element$$1.fromDom));
- return result.map(Element$$1.fromDom);
- };
- var descendant = function (scope, predicate) {
- var descend = function (node) {
- for (var i = 0; i < node.childNodes.length; i++) {
- if (predicate(Element$$1.fromDom(node.childNodes[i])))
- return Option.some(Element$$1.fromDom(node.childNodes[i]));
- var res = descend(node.childNodes[i]);
- if (res.isSome())
- return res;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var FlowLayout = Layout.extend({
+ Defaults: {
+ containerClass: 'flow-layout',
+ controlClass: 'flow-layout-item',
+ endClass: 'break'
+ },
+ recalc: function (container) {
+ container.items().filter(':visible').each(function (ctrl) {
+ if (ctrl.recalc) {
+ ctrl.recalc();
+ }
+ });
+ },
+ isNative: function () {
+ 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 Option.none();
- };
- return descend(scope.dom());
- };
- var $_2htnvowzjjgwefz5 = {
- first: first$1,
- ancestor: ancestor,
- closest: closest,
- sibling: sibling,
- child: child$1,
- descendant: descendant
- };
-
- var first$2 = function (selector) {
- return $_ofcqhwtjjgwefyb.one(selector);
- };
- var ancestor$1 = function (scope, selector, isRoot) {
- return $_2htnvowzjjgwefz5.ancestor(scope, function (e) {
- return $_ofcqhwtjjgwefyb.is(e, selector);
- }, isRoot);
- };
- var sibling$1 = function (scope, selector) {
- return $_2htnvowzjjgwefz5.sibling(scope, function (e) {
- return $_ofcqhwtjjgwefyb.is(e, selector);
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var child$2 = function (scope, selector) {
- return $_2htnvowzjjgwefz5.child(scope, function (e) {
- return $_ofcqhwtjjgwefyb.is(e, selector);
- });
- };
- var descendant$1 = function (scope, selector) {
- return $_ofcqhwtjjgwefyb.one(selector, scope);
- };
- var closest$1 = function (scope, selector, isRoot) {
- return ClosestOrAncestor($_ofcqhwtjjgwefyb.is, ancestor$1, scope, selector, isRoot);
- };
- var $_4ftvxwwyjjgwefz3 = {
- first: first$2,
- ancestor: ancestor$1,
- sibling: sibling$1,
- child: child$2,
- descendant: descendant$1,
- closest: closest$1
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var toggleFormat = function (editor, fmt) {
- return function () {
- editor.execCommand('mceToggleFormat', false, fmt);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var descendant$1 = function (scope, selector) {
+ return one(selector, scope);
</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 addFormatChangedListener = function (editor, name, changed) {
- var handler = function (state) {
- changed(state, name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var toggleFormat = function (editor, fmt) {
+ return function () {
+ editor.execCommand('mceToggleFormat', false, fmt);
+ };
</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.formatter) {
- editor.formatter.formatChanged(name, handler);
- } else {
- editor.on('init', function () {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var addFormatChangedListener = function (editor, name, changed) {
+ var handler = function (state) {
+ changed(state, name);
+ };
+ if (editor.formatter) {
</ins><span class="cx" style="display: block; padding: 0 10px"> editor.formatter.formatChanged(name, handler);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- }
- };
- var postRenderFormatToggle = function (editor, name) {
- return function (e) {
- addFormatChangedListener(editor, name, function (state) {
- e.control.active(state);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ editor.on('init', function () {
+ editor.formatter.formatChanged(name, handler);
+ });
+ }
</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">+ var postRenderFormatToggle = function (editor, name) {
+ return function (e) {
+ addFormatChangedListener(editor, name, function (state) {
+ e.control.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">- var register = function (editor) {
- var alignFormats = [
- 'alignleft',
- 'aligncenter',
- 'alignright',
- 'alignjustify'
- ];
- var defaultAlign = 'alignleft';
- var alignMenuItems = [
- {
- text: 'Left',
- icon: 'alignleft',
- onclick: toggleFormat(editor, 'alignleft')
- },
- {
- text: 'Center',
- icon: 'aligncenter',
- onclick: toggleFormat(editor, 'aligncenter')
- },
- {
- text: 'Right',
- icon: 'alignright',
- onclick: toggleFormat(editor, 'alignright')
- },
- {
- text: 'Justify',
- icon: 'alignjustify',
- onclick: toggleFormat(editor, 'alignjustify')
- }
- ];
- editor.addMenuItem('align', {
- text: 'Align',
- menu: alignMenuItems
- });
- editor.addButton('align', {
- type: 'menubutton',
- icon: defaultAlign,
- menu: alignMenuItems,
- onShowMenu: function (e) {
- var menu = e.control.menu;
- global$2.each(alignFormats, function (formatName, idx) {
- menu.items().eq(idx).each(function (item) {
- return item.active(editor.formatter.match(formatName));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register = function (editor) {
+ var alignFormats = [
+ 'alignleft',
+ 'aligncenter',
+ 'alignright',
+ 'alignjustify'
+ ];
+ var defaultAlign = 'alignleft';
+ var alignMenuItems = [
+ {
+ text: 'Left',
+ icon: 'alignleft',
+ onclick: toggleFormat(editor, 'alignleft')
+ },
+ {
+ text: 'Center',
+ icon: 'aligncenter',
+ onclick: toggleFormat(editor, 'aligncenter')
+ },
+ {
+ text: 'Right',
+ icon: 'alignright',
+ onclick: toggleFormat(editor, 'alignright')
+ },
+ {
+ text: 'Justify',
+ icon: 'alignjustify',
+ onclick: toggleFormat(editor, 'alignjustify')
+ }
+ ];
+ editor.addMenuItem('align', {
+ text: 'Align',
+ menu: alignMenuItems
+ });
+ editor.addButton('align', {
+ type: 'menubutton',
+ icon: defaultAlign,
+ menu: alignMenuItems,
+ onShowMenu: function (e) {
+ var menu = e.control.menu;
+ global$2.each(alignFormats, function (formatName, idx) {
+ menu.items().eq(idx).each(function (item) {
+ return item.active(editor.formatter.match(formatName));
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- },
- onPostRender: function (e) {
- var ctrl = e.control;
- global$2.each(alignFormats, function (formatName, idx) {
- addFormatChangedListener(editor, formatName, function (state) {
- ctrl.icon(defaultAlign);
- if (state) {
- ctrl.icon(formatName);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ onPostRender: function (e) {
+ var ctrl = e.control;
+ global$2.each(alignFormats, function (formatName, idx) {
+ addFormatChangedListener(editor, formatName, function (state) {
+ ctrl.icon(defaultAlign);
+ if (state) {
+ ctrl.icon(formatName);
+ }
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ });
+ global$2.each({
+ alignleft: [
+ 'Align left',
+ 'JustifyLeft'
+ ],
+ aligncenter: [
+ 'Align center',
+ 'JustifyCenter'
+ ],
+ alignright: [
+ 'Align right',
+ 'JustifyRight'
+ ],
+ alignjustify: [
+ 'Justify',
+ 'JustifyFull'
+ ],
+ alignnone: [
+ 'No alignment',
+ 'JustifyNone'
+ ]
+ }, function (item, name) {
+ editor.addButton(name, {
+ active: false,
+ tooltip: item[0],
+ cmd: item[1],
+ onPostRender: postRenderFormatToggle(editor, name)
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- });
- global$2.each({
- alignleft: [
- 'Align left',
- 'JustifyLeft'
- ],
- aligncenter: [
- 'Align center',
- 'JustifyCenter'
- ],
- alignright: [
- 'Align right',
- 'JustifyRight'
- ],
- alignjustify: [
- 'Justify',
- 'JustifyFull'
- ],
- alignnone: [
- 'No alignment',
- 'JustifyNone'
- ]
- }, function (item, name) {
- editor.addButton(name, {
- active: false,
- tooltip: item[0],
- cmd: item[1],
- onPostRender: postRenderFormatToggle(editor, name)
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- };
- var $_cz4u4px1jjgwefzl = { register: register };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var Align = { register: register };
</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 getFirstFont = function (fontFamily) {
- return fontFamily ? fontFamily.split(',')[0] : '';
- };
- var findMatchingValue = function (items, fontFamily) {
- var font = fontFamily ? fontFamily.toLowerCase() : '';
- var value;
- global$2.each(items, function (item) {
- if (item.value.toLowerCase() === font) {
- value = item.value;
- }
- });
- global$2.each(items, function (item) {
- if (!value && getFirstFont(item.value).toLowerCase() === getFirstFont(font).toLowerCase()) {
- value = item.value;
- }
- });
- return value;
- };
- var createFontNameListBoxChangeHandler = function (editor, items) {
- return function () {
- var self = this;
- self.state.set('value', null);
- editor.on('init nodeChange', function (e) {
- var fontFamily = editor.queryCommandValue('FontName');
- var match = findMatchingValue(items, fontFamily);
- self.value(match ? match : null);
- if (!match && fontFamily) {
- self.text(getFirstFont(fontFamily));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getFirstFont = function (fontFamily) {
+ return fontFamily ? fontFamily.split(',')[0] : '';
+ };
+ var findMatchingValue = function (items, fontFamily) {
+ var font = fontFamily ? fontFamily.toLowerCase() : '';
+ var value;
+ global$2.each(items, function (item) {
+ if (item.value.toLowerCase() === font) {
+ value = item.value;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global$2.each(items, function (item) {
+ if (!value && getFirstFont(item.value).toLowerCase() === getFirstFont(font).toLowerCase()) {
+ value = item.value;
+ }
+ });
+ 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">- };
- var createFormats = function (formats) {
- formats = formats.replace(/;$/, '').split(';');
- var i = formats.length;
- while (i--) {
- formats[i] = formats[i].split('=');
- }
- return formats;
- };
- var getFontItems = function (editor) {
- var defaultFontsFormats = 'Andale Mono=andale mono,monospace;' + 'Arial=arial,helvetica,sans-serif;' + 'Arial Black=arial black,sans-serif;' + 'Book Antiqua=book antiqua,palatino,serif;' + 'Comic Sans MS=comic sans ms,sans-serif;' + 'Courier New=courier new,courier,monospace;' + 'Georgia=georgia,palatino,serif;' + 'Helvetica=helvetica,arial,sans-serif;' + 'Impact=impact,sans-serif;' + 'Symbol=symbol;' + 'Tahoma=tahoma,arial,helvetica,sans-serif;' + 'Terminal=terminal,monaco,monospace;' + 'Times New Roman=times new roman,times,serif;' + 'Trebuchet MS=trebuchet ms,geneva,sans-serif;' + 'Verdana=verdana,geneva,sans-serif;' + 'Webdings=webdings;' + 'Wingdings=wingdings,zapf dingbats';
- var fonts = createFormats(editor.settings.font_formats || defaultFontsFormats);
- return global$2.map(fonts, function (font) {
- return {
- text: { raw: font[0] },
- value: font[1],
- textStyle: font[1].indexOf('dings') === -1 ? 'font-family:' + font[1] : ''
- };
- });
- };
- var registerButtons = function (editor) {
- editor.addButton('fontselect', function () {
- var items = getFontItems(editor);
- return {
- type: 'listbox',
- text: 'Font Family',
- tooltip: 'Font Family',
- values: items,
- fixedWidth: true,
- onPostRender: createFontNameListBoxChangeHandler(editor, items),
- onselect: function (e) {
- if (e.control.settings.value) {
- editor.execCommand('FontName', false, e.control.settings.value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createFontNameListBoxChangeHandler = function (editor, items) {
+ return function () {
+ var self = this;
+ self.state.set('value', null);
+ editor.on('init nodeChange', function (e) {
+ var fontFamily = editor.queryCommandValue('FontName');
+ var match = findMatchingValue(items, fontFamily);
+ self.value(match ? match : null);
+ if (!match && fontFamily) {
+ self.text(getFirstFont(fontFamily));
</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">+ });
</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 register$1 = function (editor) {
- registerButtons(editor);
- };
- var $_f7ngpex3jjgwefzo = { register: register$1 };
-
- var round = function (number, precision) {
- var factor = Math.pow(10, precision);
- return Math.round(number * factor) / factor;
- };
- var toPt = function (fontSize, precision) {
- if (/[0-9.]+px$/.test(fontSize)) {
- return round(parseInt(fontSize, 10) * 72 / 96, precision || 0) + 'pt';
- }
- return fontSize;
- };
- var findMatchingValue$1 = function (items, pt, px) {
- var value;
- global$2.each(items, function (item) {
- if (item.value === px) {
- value = px;
- } else if (item.value === pt) {
- value = pt;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var createFormats = function (formats) {
+ formats = formats.replace(/;$/, '').split(';');
+ var i = formats.length;
+ while (i--) {
+ formats[i] = formats[i].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">- });
- return value;
- };
- var createFontSizeListBoxChangeHandler = function (editor, items) {
- return function () {
- var self = this;
- editor.on('init nodeChange', function (e) {
- var px, pt, precision, match;
- px = editor.queryCommandValue('FontSize');
- if (px) {
- for (precision = 3; !match && precision >= 0; precision--) {
- pt = toPt(px, precision);
- match = findMatchingValue$1(items, pt, px);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return formats;
+ };
+ var getFontItems = function (editor) {
+ var defaultFontsFormats = 'Andale Mono=andale mono,monospace;' + 'Arial=arial,helvetica,sans-serif;' + 'Arial Black=arial black,sans-serif;' + 'Book Antiqua=book antiqua,palatino,serif;' + 'Comic Sans MS=comic sans ms,sans-serif;' + 'Courier New=courier new,courier,monospace;' + 'Georgia=georgia,palatino,serif;' + 'Helvetica=helvetica,arial,sans-serif;' + 'Impact=impact,sans-serif;' + 'Symbol=symbol;' + 'Tahoma=tahoma,arial,helvetica,sans-serif;' + 'Terminal=terminal,monaco,monospace;' + 'Times New Roman=times new roman,times,serif;' + 'Trebuchet MS=trebuchet ms,geneva,sans-serif;' + 'Verdana=verdana,geneva,sans-serif;' + 'Webdings=webdings;' + 'Wingdings=wingdings,zapf dingbats';
+ var fonts = createFormats(editor.settings.font_formats || defaultFontsFormats);
+ return global$2.map(fonts, function (font) {
+ return {
+ text: { raw: font[0] },
+ value: font[1],
+ textStyle: font[1].indexOf('dings') === -1 ? 'font-family:' + font[1] : ''
+ };
+ });
+ };
+ var registerButtons = function (editor) {
+ editor.addButton('fontselect', function () {
+ var items = getFontItems(editor);
+ return {
+ type: 'listbox',
+ text: 'Font Family',
+ tooltip: 'Font Family',
+ values: items,
+ fixedWidth: true,
+ onPostRender: createFontNameListBoxChangeHandler(editor, items),
+ onselect: function (e) {
+ if (e.control.settings.value) {
+ editor.execCommand('FontName', false, e.control.settings.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">- }
- self.value(match ? match : null);
- if (!match) {
- self.text(pt);
- }
</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><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var getFontSizeItems = function (editor) {
- var defaultFontsizeFormats = '8pt 10pt 12pt 14pt 18pt 24pt 36pt';
- var fontsizeFormats = editor.settings.fontsize_formats || defaultFontsizeFormats;
- return global$2.map(fontsizeFormats.split(' '), function (item) {
- var text = item, value = item;
- var values = item.split('=');
- if (values.length > 1) {
- text = values[0];
- value = values[1];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register$1 = function (editor) {
+ registerButtons(editor);
+ };
+ var FontSelect = { register: register$1 };
+
+ var round = function (number, precision) {
+ var factor = Math.pow(10, precision);
+ return Math.round(number * factor) / factor;
+ };
+ var toPt = function (fontSize, precision) {
+ if (/[0-9.]+px$/.test(fontSize)) {
+ return round(parseInt(fontSize, 10) * 72 / 96, precision || 0) + 'pt';
</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 {
- text: text,
- value: value
- };
- });
- };
- var registerButtons$1 = function (editor) {
- editor.addButton('fontsizeselect', function () {
- var items = getFontSizeItems(editor);
- return {
- type: 'listbox',
- text: 'Font Sizes',
- tooltip: 'Font Sizes',
- values: items,
- fixedWidth: true,
- onPostRender: createFontSizeListBoxChangeHandler(editor, items),
- onclick: function (e) {
- if (e.control.settings.value) {
- editor.execCommand('FontSize', false, e.control.settings.value);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return fontSize;
+ };
+ var findMatchingValue$1 = function (items, pt, px) {
+ var value;
+ global$2.each(items, function (item) {
+ if (item.value === px) {
+ value = px;
+ } else if (item.value === pt) {
+ value = pt;
</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 register$2 = function (editor) {
- registerButtons$1(editor);
- };
- var $_9a6bd5x4jjgwefzr = { register: register$2 };
-
- var hideMenuObjects = function (editor, menu) {
- var count = menu.length;
- global$2.each(menu, function (item) {
- if (item.menu) {
- item.hidden = hideMenuObjects(editor, item.menu) === 0;
- }
- var formatName = item.format;
- if (formatName) {
- item.hidden = !editor.formatter.canApply(formatName);
- }
- if (item.hidden) {
- count--;
- }
- });
- return count;
- };
- var hideFormatMenuItems = function (editor, menu) {
- var count = menu.items().length;
- menu.items().each(function (item) {
- if (item.menu) {
- item.visible(hideFormatMenuItems(editor, item.menu) > 0);
- }
- if (!item.menu && item.settings.menu) {
- item.visible(hideMenuObjects(editor, item.settings.menu) > 0);
- }
- var formatName = item.settings.format;
- if (formatName) {
- item.visible(editor.formatter.canApply(formatName));
- }
- if (!item.visible()) {
- count--;
- }
- });
- return count;
- };
- var createFormatMenu = function (editor) {
- var count = 0;
- var newFormats = [];
- var defaultStyleFormats = [
- {
- title: 'Headings',
- items: [
- {
- title: 'Heading 1',
- format: 'h1'
- },
- {
- title: 'Heading 2',
- format: 'h2'
- },
- {
- title: 'Heading 3',
- format: 'h3'
- },
- {
- title: 'Heading 4',
- format: 'h4'
- },
- {
- title: 'Heading 5',
- format: 'h5'
- },
- {
- title: 'Heading 6',
- format: 'h6'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ return value;
+ };
+ var createFontSizeListBoxChangeHandler = function (editor, items) {
+ return function () {
+ var self = this;
+ editor.on('init nodeChange', function (e) {
+ var px, pt, precision, match;
+ px = editor.queryCommandValue('FontSize');
+ if (px) {
+ for (precision = 3; !match && precision >= 0; precision--) {
+ pt = toPt(px, precision);
+ match = findMatchingValue$1(items, pt, 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">- ]
- },
- {
- title: 'Inline',
- items: [
- {
- title: 'Bold',
- icon: 'bold',
- format: 'bold'
- },
- {
- title: 'Italic',
- icon: 'italic',
- format: 'italic'
- },
- {
- title: 'Underline',
- icon: 'underline',
- format: 'underline'
- },
- {
- title: 'Strikethrough',
- icon: 'strikethrough',
- format: 'strikethrough'
- },
- {
- title: 'Superscript',
- icon: 'superscript',
- format: 'superscript'
- },
- {
- title: 'Subscript',
- icon: 'subscript',
- format: 'subscript'
- },
- {
- title: 'Code',
- icon: 'code',
- format: 'code'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.value(match ? match : null);
+ if (!match) {
+ self.text(pt);
</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: 'Blocks',
- items: [
- {
- title: 'Paragraph',
- format: 'p'
- },
- {
- title: 'Blockquote',
- format: 'blockquote'
- },
- {
- title: 'Div',
- format: 'div'
- },
- {
- title: 'Pre',
- format: 'pre'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ };
+ var getFontSizeItems = function (editor) {
+ var defaultFontsizeFormats = '8pt 10pt 12pt 14pt 18pt 24pt 36pt';
+ var fontsizeFormats = editor.settings.fontsize_formats || defaultFontsizeFormats;
+ return global$2.map(fontsizeFormats.split(' '), function (item) {
+ var text = item, value = item;
+ var values = item.split('=');
+ if (values.length > 1) {
+ text = values[0];
+ value = values[1];
+ }
+ return {
+ text: text,
+ value: value
+ };
+ });
+ };
+ var registerButtons$1 = function (editor) {
+ editor.addButton('fontsizeselect', function () {
+ var items = getFontSizeItems(editor);
+ return {
+ type: 'listbox',
+ text: 'Font Sizes',
+ tooltip: 'Font Sizes',
+ values: items,
+ fixedWidth: true,
+ onPostRender: createFontSizeListBoxChangeHandler(editor, items),
+ onclick: function (e) {
+ if (e.control.settings.value) {
+ editor.execCommand('FontSize', false, e.control.settings.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">- ]
- },
- {
- title: 'Alignment',
- items: [
- {
- title: 'Left',
- icon: 'alignleft',
- format: 'alignleft'
- },
- {
- title: 'Center',
- icon: 'aligncenter',
- format: 'aligncenter'
- },
- {
- title: 'Right',
- icon: 'alignright',
- format: 'alignright'
- },
- {
- title: 'Justify',
- icon: 'alignjustify',
- format: 'alignjustify'
- }
- ]
- }
- ];
- var createMenu = function (formats) {
- var menu = [];
- if (!formats) {
- return;
- }
- global$2.each(formats, function (format) {
- var menuItem = {
- text: format.title,
- icon: format.icon
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (format.items) {
- menuItem.menu = createMenu(format.items);
- } else {
- var formatName = format.format || 'custom' + count++;
- if (!format.format) {
- format.name = formatName;
- newFormats.push(format);
- }
- menuItem.format = formatName;
- menuItem.cmd = format.cmd;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ var register$2 = function (editor) {
+ registerButtons$1(editor);
+ };
+ var FontSizeSelect = { register: register$2 };
+
+ var hideMenuObjects = function (editor, menu) {
+ var count = menu.length;
+ global$2.each(menu, function (item) {
+ if (item.menu) {
+ item.hidden = hideMenuObjects(editor, item.menu) === 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">- menu.push(menuItem);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var formatName = item.format;
+ if (formatName) {
+ item.hidden = !editor.formatter.canApply(formatName);
+ }
+ if (item.hidden) {
+ count--;
+ }
</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 menu;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return count;
</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 createStylesMenu = function () {
- var menu;
- if (editor.settings.style_formats_merge) {
- if (editor.settings.style_formats) {
- menu = createMenu(defaultStyleFormats.concat(editor.settings.style_formats));
- } else {
- menu = createMenu(defaultStyleFormats);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hideFormatMenuItems = function (editor, menu) {
+ var count = menu.items().length;
+ menu.items().each(function (item) {
+ if (item.menu) {
+ item.visible(hideFormatMenuItems(editor, item.menu) > 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">- } else {
- menu = createMenu(editor.settings.style_formats || defaultStyleFormats);
- }
- return menu;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!item.menu && item.settings.menu) {
+ item.visible(hideMenuObjects(editor, item.settings.menu) > 0);
+ }
+ var formatName = item.settings.format;
+ if (formatName) {
+ item.visible(editor.formatter.canApply(formatName));
+ }
+ if (!item.visible()) {
+ count--;
+ }
+ });
+ return count;
</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 () {
- global$2.each(newFormats, function (format) {
- editor.formatter.register(format.name, format);
- });
- });
- return {
- type: 'menu',
- items: createStylesMenu(),
- onPostRender: function (e) {
- editor.fire('renderFormatsMenu', { control: e.control });
- },
- itemDefaults: {
- preview: true,
- textStyle: function () {
- if (this.settings.format) {
- return editor.formatter.getCssText(this.settings.format);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createFormatMenu = function (editor) {
+ var count = 0;
+ var newFormats = [];
+ var defaultStyleFormats = [
+ {
+ title: 'Headings',
+ items: [
+ {
+ title: 'Heading 1',
+ format: 'h1'
+ },
+ {
+ title: 'Heading 2',
+ format: 'h2'
+ },
+ {
+ title: 'Heading 3',
+ format: 'h3'
+ },
+ {
+ title: 'Heading 4',
+ format: 'h4'
+ },
+ {
+ title: 'Heading 5',
+ format: 'h5'
+ },
+ {
+ title: 'Heading 6',
+ format: 'h6'
+ }
+ ]
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- onPostRender: function () {
- var self = this;
- self.parent().on('show', function () {
- var formatName, command;
- formatName = self.settings.format;
- if (formatName) {
- self.disabled(!editor.formatter.canApply(formatName));
- self.active(editor.formatter.match(formatName));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ {
+ title: 'Inline',
+ items: [
+ {
+ title: 'Bold',
+ icon: 'bold',
+ format: 'bold'
+ },
+ {
+ title: 'Italic',
+ icon: 'italic',
+ format: 'italic'
+ },
+ {
+ title: 'Underline',
+ icon: 'underline',
+ format: 'underline'
+ },
+ {
+ title: 'Strikethrough',
+ icon: 'strikethrough',
+ format: 'strikethrough'
+ },
+ {
+ title: 'Superscript',
+ icon: 'superscript',
+ format: 'superscript'
+ },
+ {
+ title: 'Subscript',
+ icon: 'subscript',
+ format: 'subscript'
+ },
+ {
+ title: 'Code',
+ icon: 'code',
+ format: 'code'
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- command = self.settings.cmd;
- if (command) {
- self.active(editor.queryCommandState(command));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ]
+ },
+ {
+ title: 'Blocks',
+ items: [
+ {
+ title: 'Paragraph',
+ format: 'p'
+ },
+ {
+ title: 'Blockquote',
+ format: 'blockquote'
+ },
+ {
+ title: 'Div',
+ format: 'div'
+ },
+ {
+ title: 'Pre',
+ format: 'pre'
</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">+ ]
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- onclick: function () {
- if (this.settings.format) {
- toggleFormat(editor, this.settings.format)();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ {
+ title: 'Alignment',
+ items: [
+ {
+ title: 'Left',
+ icon: 'alignleft',
+ format: 'alignleft'
+ },
+ {
+ title: 'Center',
+ icon: 'aligncenter',
+ format: 'aligncenter'
+ },
+ {
+ title: 'Right',
+ icon: 'alignright',
+ format: 'alignright'
+ },
+ {
+ title: 'Justify',
+ icon: 'alignjustify',
+ format: 'alignjustify'
+ }
+ ]
+ }
+ ];
+ var createMenu = function (formats) {
+ var menu = [];
+ if (!formats) {
+ return;
+ }
+ global$2.each(formats, function (format) {
+ var menuItem = {
+ text: format.title,
+ icon: format.icon
+ };
+ if (format.items) {
+ menuItem.menu = createMenu(format.items);
+ } else {
+ var formatName = format.format || 'custom' + count++;
+ if (!format.format) {
+ format.name = formatName;
+ newFormats.push(format);
+ }
+ menuItem.format = formatName;
+ menuItem.cmd = format.cmd;
</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.settings.cmd) {
- editor.execCommand(this.settings.cmd);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ menu.push(menuItem);
+ });
+ return menu;
+ };
+ var createStylesMenu = function () {
+ var menu;
+ if (editor.settings.style_formats_merge) {
+ if (editor.settings.style_formats) {
+ menu = createMenu(defaultStyleFormats.concat(editor.settings.style_formats));
+ } else {
+ menu = createMenu(defaultStyleFormats);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ menu = createMenu(editor.settings.style_formats || defaultStyleFormats);
</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">+ return menu;
+ };
+ editor.on('init', function () {
+ global$2.each(newFormats, function (format) {
+ editor.formatter.register(format.name, format);
+ });
+ });
+ return {
+ type: 'menu',
+ items: createStylesMenu(),
+ onPostRender: function (e) {
+ editor.fire('renderFormatsMenu', { control: e.control });
+ },
+ itemDefaults: {
+ preview: true,
+ textStyle: function () {
+ if (this.settings.format) {
+ return editor.formatter.getCssText(this.settings.format);
+ }
+ },
+ onPostRender: function () {
+ var self = this;
+ self.parent().on('show', function () {
+ var formatName, command;
+ formatName = self.settings.format;
+ if (formatName) {
+ self.disabled(!editor.formatter.canApply(formatName));
+ self.active(editor.formatter.match(formatName));
+ }
+ command = self.settings.cmd;
+ if (command) {
+ self.active(editor.queryCommandState(command));
+ }
+ });
+ },
+ onclick: function () {
+ if (this.settings.format) {
+ toggleFormat(editor, this.settings.format)();
+ }
+ if (this.settings.cmd) {
+ editor.execCommand(this.settings.cmd);
+ }
+ }
+ }
+ };
</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 registerMenuItems = function (editor, formatMenu) {
- editor.addMenuItem('formats', {
- text: 'Formats',
- menu: formatMenu
- });
- };
- var registerButtons$2 = function (editor, formatMenu) {
- editor.addButton('styleselect', {
- type: 'menubutton',
- text: 'Formats',
- menu: formatMenu,
- onShowMenu: function () {
- if (editor.settings.style_formats_autohide) {
- hideFormatMenuItems(editor, this.menu);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var registerMenuItems = function (editor, formatMenu) {
+ editor.addMenuItem('formats', {
+ text: 'Formats',
+ menu: formatMenu
+ });
+ };
+ var registerButtons$2 = function (editor, formatMenu) {
+ editor.addButton('styleselect', {
+ type: 'menubutton',
+ text: 'Formats',
+ menu: formatMenu,
+ onShowMenu: function () {
+ if (editor.settings.style_formats_autohide) {
+ hideFormatMenuItems(editor, this.menu);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ var register$3 = function (editor) {
+ var formatMenu = createFormatMenu(editor);
+ registerMenuItems(editor, formatMenu);
+ registerButtons$2(editor, formatMenu);
+ };
+ var Formats = { register: register$3 };
+
+ var defaultBlocks = 'Paragraph=p;' + 'Heading 1=h1;' + 'Heading 2=h2;' + 'Heading 3=h3;' + 'Heading 4=h4;' + 'Heading 5=h5;' + 'Heading 6=h6;' + 'Preformatted=pre';
+ var createFormats$1 = function (formats) {
+ formats = formats.replace(/;$/, '').split(';');
+ var i = formats.length;
+ while (i--) {
+ formats[i] = formats[i].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 register$3 = function (editor) {
- var formatMenu = createFormatMenu(editor);
- registerMenuItems(editor, formatMenu);
- registerButtons$2(editor, formatMenu);
- };
- var $_ejzqp9x5jjgwefzu = { register: register$3 };
-
- var defaultBlocks = 'Paragraph=p;' + 'Heading 1=h1;' + 'Heading 2=h2;' + 'Heading 3=h3;' + 'Heading 4=h4;' + 'Heading 5=h5;' + 'Heading 6=h6;' + 'Preformatted=pre';
- var createFormats$1 = function (formats) {
- formats = formats.replace(/;$/, '').split(';');
- var i = formats.length;
- while (i--) {
- formats[i] = formats[i].split('=');
- }
- return formats;
- };
- var createListBoxChangeHandler = function (editor, items, formatName) {
- return function () {
- var self = this;
- editor.on('nodeChange', function (e) {
- var formatter = editor.formatter;
- var value = null;
- global$2.each(e.parents, function (node) {
- global$2.each(items, function (item) {
- if (formatName) {
- if (formatter.matchNode(node, formatName, { value: item.value })) {
- value = item.value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return formats;
+ };
+ var createListBoxChangeHandler = function (editor, items, formatName) {
+ return function () {
+ var self = this;
+ editor.on('nodeChange', function (e) {
+ var formatter = editor.formatter;
+ var value = null;
+ global$2.each(e.parents, function (node) {
+ global$2.each(items, function (item) {
+ if (formatName) {
+ if (formatter.matchNode(node, formatName, { value: item.value })) {
+ value = item.value;
+ }
+ } else {
+ if (formatter.matchNode(node, item.value)) {
+ value = item.value;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- if (formatter.matchNode(node, item.value)) {
- value = item.value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (value) {
+ 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">- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> if (value) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</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">- if (value) {
- return false;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.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">- self.value(value);
- });
</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">- };
- var lazyFormatSelectBoxItems = function (editor, blocks) {
- return function () {
- var items = [];
- global$2.each(blocks, function (block) {
- items.push({
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var lazyFormatSelectBoxItems = function (editor, blocks) {
+ return function () {
+ var items = [];
+ global$2.each(blocks, function (block) {
+ items.push({
+ text: block[0],
+ value: block[1],
+ textStyle: function () {
+ return editor.formatter.getCssText(block[1]);
+ }
+ });
+ });
+ return {
+ type: 'listbox',
+ text: blocks[0][0],
+ values: items,
+ fixedWidth: true,
+ onselect: function (e) {
+ if (e.control) {
+ var fmt = e.control.value();
+ toggleFormat(editor, fmt)();
+ }
+ },
+ onPostRender: createListBoxChangeHandler(editor, items)
+ };
+ };
+ };
+ var buildMenuItems = function (editor, blocks) {
+ return global$2.map(blocks, function (block) {
+ return {
</ins><span class="cx" style="display: block; padding: 0 10px"> text: block[0],
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- value: block[1],
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ onclick: toggleFormat(editor, block[1]),
</ins><span class="cx" style="display: block; padding: 0 10px"> textStyle: function () {
</span><span class="cx" style="display: block; padding: 0 10px"> return editor.formatter.getCssText(block[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">- });
</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">- return {
- type: 'listbox',
- text: blocks[0][0],
- values: items,
- fixedWidth: true,
- onselect: function (e) {
- if (e.control) {
- var fmt = e.control.value();
- toggleFormat(editor, fmt)();
- }
- },
- onPostRender: createListBoxChangeHandler(editor, items)
- };
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var buildMenuItems = function (editor, blocks) {
- return global$2.map(blocks, function (block) {
- return {
- text: block[0],
- onclick: toggleFormat(editor, block[1]),
- textStyle: function () {
- return editor.formatter.getCssText(block[1]);
- }
- };
- });
- };
- var register$4 = function (editor) {
- var blocks = createFormats$1(editor.settings.block_formats || defaultBlocks);
- editor.addMenuItem('blockformats', {
- text: 'Blocks',
- menu: buildMenuItems(editor, blocks)
- });
- editor.addButton('formatselect', lazyFormatSelectBoxItems(editor, blocks));
- };
- var $_fp0lmzx6jjgwefzy = { register: register$4 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register$4 = function (editor) {
+ var blocks = createFormats$1(editor.settings.block_formats || defaultBlocks);
+ editor.addMenuItem('blockformats', {
+ text: 'Blocks',
+ menu: buildMenuItems(editor, blocks)
+ });
+ editor.addButton('formatselect', lazyFormatSelectBoxItems(editor, blocks));
+ };
+ var FormatSelect = { register: register$4 };
</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 createCustomMenuItems = function (editor, names) {
- var items, nameList;
- if (typeof names === 'string') {
- nameList = names.split(' ');
- } else if (global$2.isArray(names)) {
- return flatten(global$2.map(names, function (names) {
- return createCustomMenuItems(editor, names);
- }));
- }
- items = global$2.grep(nameList, function (name) {
- return name === '|' || name in editor.menuItems;
- });
- return global$2.map(items, function (name) {
- return name === '|' ? { text: '-' } : editor.menuItems[name];
- });
- };
- var isSeparator$1 = function (menuItem) {
- return menuItem && menuItem.text === '-';
- };
- var trimMenuItems = function (menuItems) {
- var menuItems2 = filter(menuItems, function (menuItem, i, menuItems) {
- return !isSeparator$1(menuItem) || !isSeparator$1(menuItems[i - 1]);
- });
- return filter(menuItems2, function (menuItem, i, menuItems) {
- return !isSeparator$1(menuItem) || i > 0 && i < menuItems.length - 1;
- });
- };
- var createContextMenuItems = function (editor, context) {
- var outputMenuItems = [{ text: '-' }];
- var menuItems = global$2.grep(editor.menuItems, function (menuItem) {
- return menuItem.context === context;
- });
- global$2.each(menuItems, function (menuItem) {
- if (menuItem.separator === 'before') {
- outputMenuItems.push({ text: '|' });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createCustomMenuItems = function (editor, names) {
+ var items, nameList;
+ if (typeof names === 'string') {
+ nameList = names.split(' ');
+ } else if (global$2.isArray(names)) {
+ return flatten(global$2.map(names, function (names) {
+ return createCustomMenuItems(editor, names);
+ }));
</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 (menuItem.prependToContext) {
- outputMenuItems.unshift(menuItem);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ items = global$2.grep(nameList, function (name) {
+ return name === '|' || name in editor.menuItems;
+ });
+ return global$2.map(items, function (name) {
+ return name === '|' ? { text: '-' } : editor.menuItems[name];
+ });
+ };
+ var isSeparator$1 = function (menuItem) {
+ return menuItem && menuItem.text === '-';
+ };
+ var trimMenuItems = function (menuItems) {
+ var menuItems2 = filter(menuItems, function (menuItem, i, menuItems) {
+ return !isSeparator$1(menuItem) || !isSeparator$1(menuItems[i - 1]);
+ });
+ return filter(menuItems2, function (menuItem, i, menuItems) {
+ return !isSeparator$1(menuItem) || i > 0 && i < menuItems.length - 1;
+ });
+ };
+ var createContextMenuItems = function (editor, context) {
+ var outputMenuItems = [{ text: '-' }];
+ var menuItems = global$2.grep(editor.menuItems, function (menuItem) {
+ return menuItem.context === context;
+ });
+ global$2.each(menuItems, function (menuItem) {
+ if (menuItem.separator === 'before') {
+ outputMenuItems.push({ text: '|' });
+ }
+ if (menuItem.prependToContext) {
+ outputMenuItems.unshift(menuItem);
+ } else {
+ outputMenuItems.push(menuItem);
+ }
+ if (menuItem.separator === 'after') {
+ outputMenuItems.push({ text: '|' });
+ }
+ });
+ return outputMenuItems;
+ };
+ var createInsertMenu = function (editor) {
+ var insertButtonItems = editor.settings.insert_button_items;
+ if (insertButtonItems) {
+ return trimMenuItems(createCustomMenuItems(editor, insertButtonItems));
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- outputMenuItems.push(menuItem);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return trimMenuItems(createContextMenuItems(editor, 'insert'));
</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 (menuItem.separator === 'after') {
- outputMenuItems.push({ text: '|' });
- }
- });
- return outputMenuItems;
- };
- var createInsertMenu = function (editor) {
- var insertButtonItems = editor.settings.insert_button_items;
- if (insertButtonItems) {
- return trimMenuItems(createCustomMenuItems(editor, insertButtonItems));
- } else {
- return trimMenuItems(createContextMenuItems(editor, 'insert'));
- }
- };
- var registerButtons$3 = function (editor) {
- editor.addButton('insert', {
- type: 'menubutton',
- icon: 'insert',
- menu: [],
- oncreatemenu: function () {
- this.menu.add(createInsertMenu(editor));
- this.menu.renderNew();
- }
- });
- };
- var register$5 = function (editor) {
- registerButtons$3(editor);
- };
- var $_4j2o4hx7jjgweg01 = { register: register$5 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var registerButtons$3 = function (editor) {
+ editor.addButton('insert', {
+ type: 'menubutton',
+ icon: 'insert',
+ menu: [],
+ oncreatemenu: function () {
+ this.menu.add(createInsertMenu(editor));
+ this.menu.renderNew();
+ }
+ });
+ };
+ var register$5 = function (editor) {
+ registerButtons$3(editor);
+ };
+ var InsertButton = { register: register$5 };
</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 registerFormatButtons = function (editor) {
- global$2.each({
- bold: 'Bold',
- italic: 'Italic',
- underline: 'Underline',
- strikethrough: 'Strikethrough',
- subscript: 'Subscript',
- superscript: 'Superscript'
- }, function (text, name) {
- editor.addButton(name, {
- active: false,
- tooltip: text,
- onPostRender: postRenderFormatToggle(editor, name),
- onclick: toggleFormat(editor, name)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var registerFormatButtons = function (editor) {
+ global$2.each({
+ bold: 'Bold',
+ italic: 'Italic',
+ underline: 'Underline',
+ strikethrough: 'Strikethrough',
+ subscript: 'Subscript',
+ superscript: 'Superscript'
+ }, function (text, name) {
+ editor.addButton(name, {
+ active: false,
+ tooltip: text,
+ onPostRender: postRenderFormatToggle(editor, name),
+ onclick: toggleFormat(editor, name)
+ });
</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 registerCommandButtons = function (editor) {
- global$2.each({
- outdent: [
- 'Decrease indent',
- 'Outdent'
- ],
- indent: [
- 'Increase indent',
- 'Indent'
- ],
- cut: [
- 'Cut',
- 'Cut'
- ],
- copy: [
- 'Copy',
- 'Copy'
- ],
- paste: [
- 'Paste',
- 'Paste'
- ],
- help: [
- 'Help',
- 'mceHelp'
- ],
- selectall: [
- 'Select all',
- 'SelectAll'
- ],
- visualaid: [
- 'Visual aids',
- 'mceToggleVisualAid'
- ],
- newdocument: [
- 'New document',
- 'mceNewDocument'
- ],
- removeformat: [
- 'Clear formatting',
- 'RemoveFormat'
- ],
- remove: [
- 'Remove',
- 'Delete'
- ]
- }, function (item, name) {
- editor.addButton(name, {
- tooltip: item[0],
- cmd: item[1]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var registerCommandButtons = function (editor) {
+ global$2.each({
+ outdent: [
+ 'Decrease indent',
+ 'Outdent'
+ ],
+ indent: [
+ 'Increase indent',
+ 'Indent'
+ ],
+ cut: [
+ 'Cut',
+ 'Cut'
+ ],
+ copy: [
+ 'Copy',
+ 'Copy'
+ ],
+ paste: [
+ 'Paste',
+ 'Paste'
+ ],
+ help: [
+ 'Help',
+ 'mceHelp'
+ ],
+ selectall: [
+ 'Select all',
+ 'SelectAll'
+ ],
+ visualaid: [
+ 'Visual aids',
+ 'mceToggleVisualAid'
+ ],
+ newdocument: [
+ 'New document',
+ 'mceNewDocument'
+ ],
+ removeformat: [
+ 'Clear formatting',
+ 'RemoveFormat'
+ ],
+ remove: [
+ 'Remove',
+ 'Delete'
+ ]
+ }, function (item, name) {
+ editor.addButton(name, {
+ tooltip: item[0],
+ cmd: item[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">- });
- };
- var registerCommandToggleButtons = function (editor) {
- global$2.each({
- blockquote: [
- 'Blockquote',
- 'mceBlockQuote'
- ],
- subscript: [
- 'Subscript',
- 'Subscript'
- ],
- superscript: [
- 'Superscript',
- 'Superscript'
- ]
- }, function (item, name) {
- editor.addButton(name, {
- active: false,
- tooltip: item[0],
- cmd: item[1],
- onPostRender: postRenderFormatToggle(editor, name)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var registerCommandToggleButtons = function (editor) {
+ global$2.each({
+ blockquote: [
+ 'Blockquote',
+ 'mceBlockQuote'
+ ],
+ subscript: [
+ 'Subscript',
+ 'Subscript'
+ ],
+ superscript: [
+ 'Superscript',
+ 'Superscript'
+ ]
+ }, function (item, name) {
+ editor.addButton(name, {
+ active: false,
+ tooltip: item[0],
+ cmd: item[1],
+ onPostRender: postRenderFormatToggle(editor, name)
+ });
</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 registerButtons$4 = function (editor) {
- registerFormatButtons(editor);
- registerCommandButtons(editor);
- registerCommandToggleButtons(editor);
- };
- var registerMenuItems$1 = function (editor) {
- global$2.each({
- bold: [
- 'Bold',
- 'Bold',
- 'Meta+B'
- ],
- italic: [
- 'Italic',
- 'Italic',
- 'Meta+I'
- ],
- underline: [
- 'Underline',
- 'Underline',
- 'Meta+U'
- ],
- strikethrough: [
- 'Strikethrough',
- 'Strikethrough'
- ],
- subscript: [
- 'Subscript',
- 'Subscript'
- ],
- superscript: [
- 'Superscript',
- 'Superscript'
- ],
- removeformat: [
- 'Clear formatting',
- 'RemoveFormat'
- ],
- newdocument: [
- 'New document',
- 'mceNewDocument'
- ],
- cut: [
- 'Cut',
- 'Cut',
- 'Meta+X'
- ],
- copy: [
- 'Copy',
- 'Copy',
- 'Meta+C'
- ],
- paste: [
- 'Paste',
- 'Paste',
- 'Meta+V'
- ],
- selectall: [
- 'Select all',
- 'SelectAll',
- 'Meta+A'
- ]
- }, function (item, name) {
- editor.addMenuItem(name, {
- text: item[0],
- icon: name,
- shortcut: item[2],
- cmd: item[1]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var registerButtons$4 = function (editor) {
+ registerFormatButtons(editor);
+ registerCommandButtons(editor);
+ registerCommandToggleButtons(editor);
+ };
+ var registerMenuItems$1 = function (editor) {
+ global$2.each({
+ bold: [
+ 'Bold',
+ 'Bold',
+ 'Meta+B'
+ ],
+ italic: [
+ 'Italic',
+ 'Italic',
+ 'Meta+I'
+ ],
+ underline: [
+ 'Underline',
+ 'Underline',
+ 'Meta+U'
+ ],
+ strikethrough: [
+ 'Strikethrough',
+ 'Strikethrough'
+ ],
+ subscript: [
+ 'Subscript',
+ 'Subscript'
+ ],
+ superscript: [
+ 'Superscript',
+ 'Superscript'
+ ],
+ removeformat: [
+ 'Clear formatting',
+ 'RemoveFormat'
+ ],
+ newdocument: [
+ 'New document',
+ 'mceNewDocument'
+ ],
+ cut: [
+ 'Cut',
+ 'Cut',
+ 'Meta+X'
+ ],
+ copy: [
+ 'Copy',
+ 'Copy',
+ 'Meta+C'
+ ],
+ paste: [
+ 'Paste',
+ 'Paste',
+ 'Meta+V'
+ ],
+ selectall: [
+ 'Select all',
+ 'SelectAll',
+ 'Meta+A'
+ ]
+ }, function (item, name) {
+ editor.addMenuItem(name, {
+ text: item[0],
+ icon: name,
+ shortcut: item[2],
+ cmd: item[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">- });
- editor.addMenuItem('codeformat', {
- text: 'Code',
- icon: 'code',
- onclick: toggleFormat(editor, 'code')
- });
- };
- var register$6 = function (editor) {
- registerButtons$4(editor);
- registerMenuItems$1(editor);
- };
- var $_c2lkymx8jjgweg05 = { register: register$6 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.addMenuItem('codeformat', {
+ text: 'Code',
+ icon: 'code',
+ onclick: toggleFormat(editor, 'code')
+ });
+ };
+ var register$6 = function (editor) {
+ registerButtons$4(editor);
+ registerMenuItems$1(editor);
+ };
+ var SimpleControls = { register: register$6 };
</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 toggleUndoRedoState = function (editor, type) {
- return function () {
- var self = this;
- var checkState = function () {
- var typeFn = type === 'redo' ? 'hasRedo' : 'hasUndo';
- return editor.undoManager ? editor.undoManager[typeFn]() : false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var toggleUndoRedoState = function (editor, type) {
+ return function () {
+ var self = this;
+ var checkState = function () {
+ var typeFn = type === 'redo' ? 'hasRedo' : 'hasUndo';
+ return editor.undoManager ? editor.undoManager[typeFn]() : false;
+ };
+ self.disabled(!checkState());
+ editor.on('Undo Redo AddUndo TypingUndo ClearUndos SwitchMode', function () {
+ self.disabled(editor.readonly || !checkState());
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.disabled(!checkState());
- editor.on('Undo Redo AddUndo TypingUndo ClearUndos SwitchMode', function () {
- self.disabled(editor.readonly || !checkState());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var registerMenuItems$2 = function (editor) {
+ editor.addMenuItem('undo', {
+ text: 'Undo',
+ icon: 'undo',
+ shortcut: 'Meta+Z',
+ onPostRender: toggleUndoRedoState(editor, 'undo'),
+ cmd: 'undo'
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.addMenuItem('redo', {
+ text: 'Redo',
+ icon: 'redo',
+ shortcut: 'Meta+Y',
+ onPostRender: toggleUndoRedoState(editor, 'redo'),
+ cmd: 'redo'
+ });
</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 registerMenuItems$2 = function (editor) {
- editor.addMenuItem('undo', {
- text: 'Undo',
- icon: 'undo',
- shortcut: 'Meta+Z',
- onPostRender: toggleUndoRedoState(editor, 'undo'),
- cmd: 'undo'
- });
- editor.addMenuItem('redo', {
- text: 'Redo',
- icon: 'redo',
- shortcut: 'Meta+Y',
- onPostRender: toggleUndoRedoState(editor, 'redo'),
- cmd: 'redo'
- });
- };
- var registerButtons$5 = function (editor) {
- editor.addButton('undo', {
- tooltip: 'Undo',
- onPostRender: toggleUndoRedoState(editor, 'undo'),
- cmd: 'undo'
- });
- editor.addButton('redo', {
- tooltip: 'Redo',
- onPostRender: toggleUndoRedoState(editor, 'redo'),
- cmd: 'redo'
- });
- };
- var register$7 = function (editor) {
- registerMenuItems$2(editor);
- registerButtons$5(editor);
- };
- var $_9h432jx9jjgweg07 = { register: register$7 };
-
- var toggleVisualAidState = function (editor) {
- return function () {
- var self = this;
- editor.on('VisualAid', function (e) {
- self.active(e.hasVisual);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var registerButtons$5 = function (editor) {
+ editor.addButton('undo', {
+ tooltip: 'Undo',
+ onPostRender: toggleUndoRedoState(editor, 'undo'),
+ cmd: 'undo'
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.active(editor.hasVisual);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.addButton('redo', {
+ tooltip: 'Redo',
+ onPostRender: toggleUndoRedoState(editor, 'redo'),
+ cmd: 'redo'
+ });
</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 registerMenuItems$3 = function (editor) {
- editor.addMenuItem('visualaid', {
- text: 'Visual aids',
- selectable: true,
- onPostRender: toggleVisualAidState(editor),
- cmd: 'mceToggleVisualAid'
- });
- };
- var register$8 = function (editor) {
- registerMenuItems$3(editor);
- };
- var $_eoil5jxajjgweg09 = { register: register$8 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register$7 = function (editor) {
+ registerMenuItems$2(editor);
+ registerButtons$5(editor);
+ };
+ var UndoRedo = { register: register$7 };
</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 setupEnvironment = function () {
- Widget.tooltips = !global$8.iOS;
- Control$1.translate = function (text) {
- return global$1.translate(text);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var toggleVisualAidState = function (editor) {
+ return function () {
+ var self = this;
+ editor.on('VisualAid', function (e) {
+ self.active(e.hasVisual);
+ });
+ self.active(editor.hasVisual);
+ };
</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 setupUiContainer = function (editor) {
- if (editor.settings.ui_container) {
- global$8.container = $_4ftvxwwyjjgwefz3.descendant(Element$$1.fromDom(document.body), editor.settings.ui_container).fold(constant(null), function (elm) {
- return elm.dom();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var registerMenuItems$3 = function (editor) {
+ editor.addMenuItem('visualaid', {
+ text: 'Visual aids',
+ selectable: true,
+ onPostRender: toggleVisualAidState(editor),
+ cmd: 'mceToggleVisualAid'
</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 setupRtlMode = function (editor) {
- if (editor.rtl) {
- Control$1.rtl = true;
- }
- };
- var setupHideFloatPanels = function (editor) {
- editor.on('mousedown', function () {
- FloatPanel.hideAll();
- });
- };
- var setup$1 = function (editor) {
- setupRtlMode(editor);
- setupHideFloatPanels(editor);
- setupUiContainer(editor);
- setupEnvironment();
- $_fp0lmzx6jjgwefzy.register(editor);
- $_cz4u4px1jjgwefzl.register(editor);
- $_c2lkymx8jjgweg05.register(editor);
- $_9h432jx9jjgweg07.register(editor);
- $_9a6bd5x4jjgwefzr.register(editor);
- $_f7ngpex3jjgwefzo.register(editor);
- $_ejzqp9x5jjgwefzu.register(editor);
- $_eoil5jxajjgweg09.register(editor);
- $_4j2o4hx7jjgweg01.register(editor);
- };
- var $_5heykgwxjjgwefyx = { setup: setup$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var register$8 = function (editor) {
+ registerMenuItems$3(editor);
+ };
+ var VisualAid = { register: register$8 };
</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 GridLayout = AbsoluteLayout.extend({
- recalc: function (container) {
- var settings, rows, cols, items, contLayoutRect, width, height, rect, ctrlLayoutRect, ctrl, x, y, posX, posY, ctrlSettings, contPaddingBox, align, spacingH, spacingV, alignH, alignV, maxX, maxY;
- var colWidths = [];
- var rowHeights = [];
- var ctrlMinWidth, ctrlMinHeight, availableWidth, availableHeight, reverseRows, idx;
- settings = container.settings;
- items = container.items().filter(':visible');
- contLayoutRect = container.layoutRect();
- cols = settings.columns || Math.ceil(Math.sqrt(items.length));
- rows = Math.ceil(items.length / cols);
- spacingH = settings.spacingH || settings.spacing || 0;
- spacingV = settings.spacingV || settings.spacing || 0;
- alignH = settings.alignH || settings.align;
- alignV = settings.alignV || settings.align;
- contPaddingBox = container.paddingBox;
- reverseRows = 'reverseRows' in settings ? settings.reverseRows : container.isRtl();
- if (alignH && typeof alignH === 'string') {
- alignH = [alignH];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setupEnvironment = function () {
+ Widget.tooltips = !global$8.iOS;
+ Control$1.translate = function (text) {
+ return global$1.translate(text);
+ };
+ };
+ var setupUiContainer = function (editor) {
+ if (editor.settings.ui_container) {
+ global$8.container = descendant$1(Element$$1.fromDom(document.body), editor.settings.ui_container).fold(constant(null), function (elm) {
+ return elm.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 (alignV && typeof alignV === 'string') {
- alignV = [alignV];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var setupRtlMode = function (editor) {
+ if (editor.rtl) {
+ Control$1.rtl = 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">- for (x = 0; x < cols; x++) {
- colWidths.push(0);
- }
- for (y = 0; y < rows; y++) {
- rowHeights.push(0);
- }
- for (y = 0; y < rows; y++) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var setupHideFloatPanels = function (editor) {
+ editor.on('mousedown progressstate', function () {
+ FloatPanel.hideAll();
+ });
+ };
+ var setup$1 = function (editor) {
+ setupRtlMode(editor);
+ setupHideFloatPanels(editor);
+ setupUiContainer(editor);
+ setupEnvironment();
+ FormatSelect.register(editor);
+ Align.register(editor);
+ SimpleControls.register(editor);
+ UndoRedo.register(editor);
+ FontSizeSelect.register(editor);
+ FontSelect.register(editor);
+ Formats.register(editor);
+ VisualAid.register(editor);
+ InsertButton.register(editor);
+ };
+ var FormatControls = { setup: setup$1 };
+
+ var GridLayout = AbsoluteLayout.extend({
+ recalc: function (container) {
+ var settings, rows, cols, items, contLayoutRect, width, height, rect, ctrlLayoutRect, ctrl, x, y, posX, posY, ctrlSettings, contPaddingBox, align, spacingH, spacingV, alignH, alignV, maxX, maxY;
+ var colWidths = [];
+ var rowHeights = [];
+ var ctrlMinWidth, ctrlMinHeight, availableWidth, availableHeight, reverseRows, idx;
+ settings = container.settings;
+ items = container.items().filter(':visible');
+ contLayoutRect = container.layoutRect();
+ cols = settings.columns || Math.ceil(Math.sqrt(items.length));
+ rows = Math.ceil(items.length / cols);
+ spacingH = settings.spacingH || settings.spacing || 0;
+ spacingV = settings.spacingV || settings.spacing || 0;
+ alignH = settings.alignH || settings.align;
+ alignV = settings.alignV || settings.align;
+ contPaddingBox = container.paddingBox;
+ reverseRows = 'reverseRows' in settings ? settings.reverseRows : container.isRtl();
+ if (alignH && typeof alignH === 'string') {
+ alignH = [alignH];
+ }
+ if (alignV && typeof alignV === 'string') {
+ alignV = [alignV];
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> for (x = 0; x < cols; x++) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ctrl = items[y * cols + x];
- if (!ctrl) {
- break;
- }
- ctrlLayoutRect = ctrl.layoutRect();
- ctrlMinWidth = ctrlLayoutRect.minW;
- ctrlMinHeight = ctrlLayoutRect.minH;
- colWidths[x] = ctrlMinWidth > colWidths[x] ? ctrlMinWidth : colWidths[x];
- rowHeights[y] = ctrlMinHeight > rowHeights[y] ? ctrlMinHeight : rowHeights[y];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ colWidths.push(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">- }
- availableWidth = contLayoutRect.innerW - contPaddingBox.left - contPaddingBox.right;
- for (maxX = 0, x = 0; x < cols; x++) {
- maxX += colWidths[x] + (x > 0 ? spacingH : 0);
- availableWidth -= (x > 0 ? spacingH : 0) + colWidths[x];
- }
- availableHeight = contLayoutRect.innerH - contPaddingBox.top - contPaddingBox.bottom;
- for (maxY = 0, y = 0; y < rows; y++) {
- maxY += rowHeights[y] + (y > 0 ? spacingV : 0);
- availableHeight -= (y > 0 ? spacingV : 0) + rowHeights[y];
- }
- maxX += contPaddingBox.left + contPaddingBox.right;
- maxY += contPaddingBox.top + contPaddingBox.bottom;
- rect = {};
- rect.minW = maxX + (contLayoutRect.w - contLayoutRect.innerW);
- rect.minH = maxY + (contLayoutRect.h - contLayoutRect.innerH);
- rect.contentW = rect.minW - contLayoutRect.deltaW;
- rect.contentH = rect.minH - contLayoutRect.deltaH;
- rect.minW = Math.min(rect.minW, contLayoutRect.maxW);
- rect.minH = Math.min(rect.minH, contLayoutRect.maxH);
- rect.minW = Math.max(rect.minW, contLayoutRect.startMinWidth);
- rect.minH = Math.max(rect.minH, contLayoutRect.startMinHeight);
- if (contLayoutRect.autoResize && (rect.minW !== contLayoutRect.minW || rect.minH !== contLayoutRect.minH)) {
- rect.w = rect.minW;
- rect.h = rect.minH;
- container.layoutRect(rect);
- this.recalc(container);
- if (container._lastRect === null) {
- var parentCtrl = container.parent();
- if (parentCtrl) {
- parentCtrl._lastRect = null;
- parentCtrl.recalc();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (y = 0; y < rows; y++) {
+ rowHeights.push(0);
+ }
+ for (y = 0; y < rows; y++) {
+ for (x = 0; x < cols; x++) {
+ ctrl = items[y * cols + x];
+ if (!ctrl) {
+ break;
+ }
+ ctrlLayoutRect = ctrl.layoutRect();
+ ctrlMinWidth = ctrlLayoutRect.minW;
+ ctrlMinHeight = ctrlLayoutRect.minH;
+ colWidths[x] = ctrlMinWidth > colWidths[x] ? ctrlMinWidth : colWidths[x];
+ rowHeights[y] = ctrlMinHeight > rowHeights[y] ? ctrlMinHeight : rowHeights[y];
</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">- return;
- }
- if (contLayoutRect.autoResize) {
- rect = container.layoutRect(rect);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ availableWidth = contLayoutRect.innerW - contPaddingBox.left - contPaddingBox.right;
+ for (maxX = 0, x = 0; x < cols; x++) {
+ maxX += colWidths[x] + (x > 0 ? spacingH : 0);
+ availableWidth -= (x > 0 ? spacingH : 0) + colWidths[x];
+ }
+ availableHeight = contLayoutRect.innerH - contPaddingBox.top - contPaddingBox.bottom;
+ for (maxY = 0, y = 0; y < rows; y++) {
+ maxY += rowHeights[y] + (y > 0 ? spacingV : 0);
+ availableHeight -= (y > 0 ? spacingV : 0) + rowHeights[y];
+ }
+ maxX += contPaddingBox.left + contPaddingBox.right;
+ maxY += contPaddingBox.top + contPaddingBox.bottom;
+ rect = {};
+ rect.minW = maxX + (contLayoutRect.w - contLayoutRect.innerW);
+ rect.minH = maxY + (contLayoutRect.h - contLayoutRect.innerH);
</ins><span class="cx" style="display: block; padding: 0 10px"> rect.contentW = rect.minW - contLayoutRect.deltaW;
</span><span class="cx" style="display: block; padding: 0 10px"> rect.contentH = rect.minH - contLayoutRect.deltaH;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- var flexV;
- if (settings.packV === 'start') {
- flexV = 0;
- } else {
- flexV = availableHeight > 0 ? Math.floor(availableHeight / rows) : 0;
- }
- var totalFlex = 0;
- var flexWidths = settings.flexWidths;
- if (flexWidths) {
- for (x = 0; x < flexWidths.length; x++) {
- totalFlex += flexWidths[x];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rect.minW = Math.min(rect.minW, contLayoutRect.maxW);
+ rect.minH = Math.min(rect.minH, contLayoutRect.maxH);
+ rect.minW = Math.max(rect.minW, contLayoutRect.startMinWidth);
+ rect.minH = Math.max(rect.minH, contLayoutRect.startMinHeight);
+ if (contLayoutRect.autoResize && (rect.minW !== contLayoutRect.minW || rect.minH !== contLayoutRect.minH)) {
+ rect.w = rect.minW;
+ rect.h = rect.minH;
+ container.layoutRect(rect);
+ this.recalc(container);
+ if (container._lastRect === null) {
+ var parentCtrl = container.parent();
+ if (parentCtrl) {
+ parentCtrl._lastRect = null;
+ parentCtrl.recalc();
+ }
+ }
+ 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">- } else {
- totalFlex = cols;
- }
- var ratio = availableWidth / totalFlex;
- for (x = 0; x < cols; x++) {
- colWidths[x] += flexWidths ? flexWidths[x] * ratio : ratio;
- }
- posY = contPaddingBox.top;
- for (y = 0; y < rows; y++) {
- posX = contPaddingBox.left;
- height = rowHeights[y] + flexV;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (contLayoutRect.autoResize) {
+ rect = container.layoutRect(rect);
+ rect.contentW = rect.minW - contLayoutRect.deltaW;
+ rect.contentH = rect.minH - contLayoutRect.deltaH;
+ }
+ var flexV;
+ if (settings.packV === 'start') {
+ flexV = 0;
+ } else {
+ flexV = availableHeight > 0 ? Math.floor(availableHeight / rows) : 0;
+ }
+ var totalFlex = 0;
+ var flexWidths = settings.flexWidths;
+ if (flexWidths) {
+ for (x = 0; x < flexWidths.length; x++) {
+ totalFlex += flexWidths[x];
+ }
+ } else {
+ totalFlex = cols;
+ }
+ var ratio = availableWidth / totalFlex;
</ins><span class="cx" style="display: block; padding: 0 10px"> for (x = 0; x < cols; x++) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (reverseRows) {
- idx = y * cols + cols - 1 - x;
- } else {
- idx = y * cols + x;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ colWidths[x] += flexWidths ? flexWidths[x] * ratio : ratio;
+ }
+ posY = contPaddingBox.top;
+ for (y = 0; y < rows; y++) {
+ posX = contPaddingBox.left;
+ height = rowHeights[y] + flexV;
+ for (x = 0; x < cols; x++) {
+ if (reverseRows) {
+ idx = y * cols + cols - 1 - x;
+ } else {
+ idx = y * cols + x;
+ }
+ ctrl = items[idx];
+ if (!ctrl) {
+ break;
+ }
+ ctrlSettings = ctrl.settings;
+ ctrlLayoutRect = ctrl.layoutRect();
+ width = Math.max(colWidths[x], ctrlLayoutRect.startMinWidth);
+ ctrlLayoutRect.x = posX;
+ ctrlLayoutRect.y = posY;
+ align = ctrlSettings.alignH || (alignH ? alignH[x] || alignH[0] : null);
+ if (align === 'center') {
+ ctrlLayoutRect.x = posX + width / 2 - ctrlLayoutRect.w / 2;
+ } else if (align === 'right') {
+ ctrlLayoutRect.x = posX + width - ctrlLayoutRect.w;
+ } else if (align === 'stretch') {
+ ctrlLayoutRect.w = width;
+ }
+ align = ctrlSettings.alignV || (alignV ? alignV[x] || alignV[0] : null);
+ if (align === 'center') {
+ ctrlLayoutRect.y = posY + height / 2 - ctrlLayoutRect.h / 2;
+ } else if (align === 'bottom') {
+ ctrlLayoutRect.y = posY + height - ctrlLayoutRect.h;
+ } else if (align === 'stretch') {
+ ctrlLayoutRect.h = height;
+ }
+ ctrl.layoutRect(ctrlLayoutRect);
+ posX += width + spacingH;
+ if (ctrl.recalc) {
+ ctrl.recalc();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ctrl = items[idx];
- if (!ctrl) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ posY += height + spacingV;
+ }
+ }
+ });
+
+ var Iframe$1 = Widget.extend({
+ renderHtml: function () {
+ var self = this;
+ self.classes.add('iframe');
+ self.canFocus = false;
+ return '<iframe id="' + self._id + '" class="' + self.classes + '" tabindex="-1" src="' + (self.settings.url || 'javascript:\'\'') + '" frameborder="0"></iframe>';
+ },
+ src: function (src) {
+ this.getEl().src = src;
+ },
+ html: function (html, callback) {
+ var self = this, body = this.getEl().contentWindow.document.body;
+ if (!body) {
+ global$7.setTimeout(function () {
+ self.html(html);
+ });
+ } else {
+ body.innerHTML = html;
+ if (callback) {
+ 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">- ctrlSettings = ctrl.settings;
- ctrlLayoutRect = ctrl.layoutRect();
- width = Math.max(colWidths[x], ctrlLayoutRect.startMinWidth);
- ctrlLayoutRect.x = posX;
- ctrlLayoutRect.y = posY;
- align = ctrlSettings.alignH || (alignH ? alignH[x] || alignH[0] : null);
- if (align === 'center') {
- ctrlLayoutRect.x = posX + width / 2 - ctrlLayoutRect.w / 2;
- } else if (align === 'right') {
- ctrlLayoutRect.x = posX + width - ctrlLayoutRect.w;
- } else if (align === 'stretch') {
- ctrlLayoutRect.w = width;
- }
- align = ctrlSettings.alignV || (alignV ? alignV[x] || alignV[0] : null);
- if (align === 'center') {
- ctrlLayoutRect.y = posY + height / 2 - ctrlLayoutRect.h / 2;
- } else if (align === 'bottom') {
- ctrlLayoutRect.y = posY + height - ctrlLayoutRect.h;
- } else if (align === 'stretch') {
- ctrlLayoutRect.h = height;
- }
- ctrl.layoutRect(ctrlLayoutRect);
- posX += width + spacingH;
- if (ctrl.recalc) {
- ctrl.recalc();
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- posY += height + spacingV;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- }
- });
</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">- var Iframe$1 = Widget.extend({
- renderHtml: function () {
- var self = this;
- self.classes.add('iframe');
- self.canFocus = false;
- return '<iframe id="' + self._id + '" class="' + self.classes + '" tabindex="-1" src="' + (self.settings.url || 'javascript:\'\'') + '" frameborder="0"></iframe>';
- },
- src: function (src) {
- this.getEl().src = src;
- },
- html: function (html, callback) {
- var self = this, body = this.getEl().contentWindow.document.body;
- if (!body) {
- global$7.setTimeout(function () {
- self.html(html);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var InfoBox = Widget.extend({
+ init: function (settings) {
+ var self = this;
+ self._super(settings);
+ self.classes.add('widget').add('infobox');
+ self.canFocus = false;
+ },
+ severity: function (level) {
+ this.classes.remove('error');
+ this.classes.remove('warning');
+ this.classes.remove('success');
+ this.classes.add(level);
+ },
+ help: function (state) {
+ this.state.set('help', state);
+ },
+ renderHtml: function () {
+ var self = this, prefix = self.classPrefix;
+ return '<div id="' + self._id + '" class="' + self.classes + '">' + '<div id="' + self._id + '-body">' + self.encode(self.state.get('text')) + '<button role="button" tabindex="-1">' + '<i class="' + prefix + 'ico ' + prefix + 'i-help"></i>' + '</button>' + '</div>' + '</div>';
+ },
+ bindStates: function () {
+ var self = this;
+ self.state.on('change:text', function (e) {
+ self.getEl('body').firstChild.data = self.encode(e.value);
+ if (self.state.get('rendered')) {
+ self.updateLayoutRect();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- body.innerHTML = html;
- if (callback) {
- callback();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.state.on('change:help', function (e) {
+ self.classes.toggle('has-help', e.value);
+ if (self.state.get('rendered')) {
+ self.updateLayoutRect();
+ }
+ });
+ return self._super();
</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 this;
- }
- });
</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">- var InfoBox = Widget.extend({
- init: function (settings) {
- var self = this;
- self._super(settings);
- self.classes.add('widget').add('infobox');
- self.canFocus = false;
- },
- severity: function (level) {
- this.classes.remove('error');
- this.classes.remove('warning');
- this.classes.remove('success');
- this.classes.add(level);
- },
- help: function (state) {
- this.state.set('help', state);
- },
- renderHtml: function () {
- var self = this, prefix = self.classPrefix;
- return '<div id="' + self._id + '" class="' + self.classes + '">' + '<div id="' + self._id + '-body">' + self.encode(self.state.get('text')) + '<button role="button" tabindex="-1">' + '<i class="' + prefix + 'ico ' + prefix + 'i-help"></i>' + '</button>' + '</div>' + '</div>';
- },
- bindStates: function () {
- var self = this;
- self.state.on('change:text', function (e) {
- self.getEl('body').firstChild.data = self.encode(e.value);
- if (self.state.get('rendered')) {
- self.updateLayoutRect();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Label = Widget.extend({
+ init: function (settings) {
+ var self = this;
+ self._super(settings);
+ self.classes.add('widget').add('label');
+ self.canFocus = false;
+ if (settings.multiline) {
+ self.classes.add('autoscroll');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self.state.on('change:help', function (e) {
- self.classes.toggle('has-help', e.value);
- if (self.state.get('rendered')) {
- self.updateLayoutRect();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (settings.strong) {
+ self.classes.add('strong');
</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 self._super();
- }
- });
-
- var Label = Widget.extend({
- init: function (settings) {
- var self = this;
- self._super(settings);
- self.classes.add('widget').add('label');
- self.canFocus = false;
- if (settings.multiline) {
- self.classes.add('autoscroll');
- }
- if (settings.strong) {
- self.classes.add('strong');
- }
- },
- initLayoutRect: function () {
- var self = this, layoutRect = self._super();
- if (self.settings.multiline) {
- var size = funcs.getSize(self.getEl());
- if (size.width > layoutRect.maxW) {
- layoutRect.minW = layoutRect.maxW;
- self.classes.add('multiline');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ initLayoutRect: function () {
+ var self = this, layoutRect = self._super();
+ if (self.settings.multiline) {
+ var size = funcs.getSize(self.getEl());
+ if (size.width > layoutRect.maxW) {
+ layoutRect.minW = layoutRect.maxW;
+ self.classes.add('multiline');
+ }
+ self.getEl().style.width = layoutRect.minW + 'px';
+ layoutRect.startMinH = layoutRect.h = layoutRect.minH = Math.min(layoutRect.maxH, funcs.getSize(self.getEl()).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">- self.getEl().style.width = layoutRect.minW + 'px';
- layoutRect.startMinH = layoutRect.h = layoutRect.minH = Math.min(layoutRect.maxH, funcs.getSize(self.getEl()).height);
- }
- return layoutRect;
- },
- repaint: function () {
- var self = this;
- if (!self.settings.multiline) {
- self.getEl().style.lineHeight = self.layoutRect().h + 'px';
- }
- return self._super();
- },
- severity: function (level) {
- this.classes.remove('error');
- this.classes.remove('warning');
- this.classes.remove('success');
- this.classes.add(level);
- },
- renderHtml: function () {
- var self = this;
- var targetCtrl, forName, forId = self.settings.forId;
- var text = self.settings.html ? self.settings.html : self.encode(self.state.get('text'));
- if (!forId && (forName = self.settings.forName)) {
- targetCtrl = self.getRoot().find('#' + forName)[0];
- if (targetCtrl) {
- forId = targetCtrl._id;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return layoutRect;
+ },
+ repaint: function () {
+ var self = this;
+ if (!self.settings.multiline) {
+ self.getEl().style.lineHeight = self.layoutRect().h + 'px';
</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 self._super();
+ },
+ severity: function (level) {
+ this.classes.remove('error');
+ this.classes.remove('warning');
+ this.classes.remove('success');
+ this.classes.add(level);
+ },
+ renderHtml: function () {
+ var self = this;
+ var targetCtrl, forName, forId = self.settings.forId;
+ var text = self.settings.html ? self.settings.html : self.encode(self.state.get('text'));
+ if (!forId && (forName = self.settings.forName)) {
+ targetCtrl = self.getRoot().find('#' + forName)[0];
+ if (targetCtrl) {
+ forId = targetCtrl._id;
+ }
+ }
+ if (forId) {
+ return '<label id="' + self._id + '" class="' + self.classes + '"' + (forId ? ' for="' + forId + '"' : '') + '>' + text + '</label>';
+ }
+ return '<span id="' + self._id + '" class="' + self.classes + '">' + text + '</span>';
+ },
+ bindStates: function () {
+ var self = this;
+ self.state.on('change:text', function (e) {
+ self.innerHtml(self.encode(e.value));
+ if (self.state.get('rendered')) {
+ self.updateLayoutRect();
+ }
+ });
+ return self._super();
</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 (forId) {
- return '<label id="' + self._id + '" class="' + self.classes + '"' + (forId ? ' for="' + forId + '"' : '') + '>' + text + '</label>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var Toolbar$1 = Container.extend({
+ Defaults: {
+ role: 'toolbar',
+ layout: 'flow'
+ },
+ init: function (settings) {
+ var self = this;
+ self._super(settings);
+ self.classes.add('toolbar');
+ },
+ postRender: function () {
+ var self = this;
+ self.items().each(function (ctrl) {
+ ctrl.classes.add('toolbar-item');
+ });
+ return self._super();
</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 '<span id="' + self._id + '" class="' + self.classes + '">' + text + '</span>';
- },
- bindStates: function () {
- var self = this;
- self.state.on('change:text', function (e) {
- self.innerHtml(self.encode(e.value));
- if (self.state.get('rendered')) {
- self.updateLayoutRect();
- }
- });
- return self._super();
- }
- });
</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">- var Toolbar$1 = Container.extend({
- Defaults: {
- role: 'toolbar',
- layout: 'flow'
- },
- init: function (settings) {
- var self = this;
- self._super(settings);
- self.classes.add('toolbar');
- },
- postRender: function () {
- var self = this;
- self.items().each(function (ctrl) {
- ctrl.classes.add('toolbar-item');
- });
- return self._super();
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var MenuBar = Toolbar$1.extend({
+ Defaults: {
+ role: 'menubar',
+ containerCls: 'menubar',
+ ariaRoot: true,
+ defaults: { type: 'menubutton' }
+ }
+ });
</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 MenuBar = Toolbar$1.extend({
- Defaults: {
- role: 'menubar',
- containerCls: 'menubar',
- ariaRoot: true,
- defaults: { type: 'menubutton' }
- }
- });
-
- function isChildOf$1(node, parent$$1) {
- while (node) {
- if (parent$$1 === node) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function isChildOf$1(node, parent$$1) {
+ while (node) {
+ if (parent$$1 === node) {
+ return true;
+ }
+ 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">- node = node.parentNode;
</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">- return false;
- }
- var MenuButton = Button.extend({
- init: function (settings) {
- var self$$1 = this;
- self$$1._renderOpen = true;
- self$$1._super(settings);
- settings = self$$1.settings;
- self$$1.classes.add('menubtn');
- if (settings.fixedWidth) {
- self$$1.classes.add('fixed-width');
- }
- self$$1.aria('haspopup', true);
- self$$1.state.set('menu', settings.menu || self$$1.render());
- },
- showMenu: function (toggle) {
- var self$$1 = this;
- var menu;
- if (self$$1.menu && self$$1.menu.visible() && toggle !== false) {
- return self$$1.hideMenu();
- }
- if (!self$$1.menu) {
- menu = self$$1.state.get('menu') || [];
- self$$1.classes.add('opened');
- if (menu.length) {
- menu = {
- type: 'menu',
- animate: true,
- items: menu
- };
- } else {
- menu.type = menu.type || 'menu';
- menu.animate = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var MenuButton = Button.extend({
+ init: function (settings) {
+ var self$$1 = this;
+ self$$1._renderOpen = true;
+ self$$1._super(settings);
+ settings = self$$1.settings;
+ self$$1.classes.add('menubtn');
+ if (settings.fixedWidth) {
+ self$$1.classes.add('fixed-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">- if (!menu.renderTo) {
- self$$1.menu = global$4.create(menu).parent(self$$1).renderTo();
- } else {
- self$$1.menu = menu.parent(self$$1).show().renderTo();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.aria('haspopup', true);
+ self$$1.state.set('menu', settings.menu || self$$1.render());
+ },
+ showMenu: function (toggle) {
+ var self$$1 = this;
+ var menu;
+ if (self$$1.menu && self$$1.menu.visible() && toggle !== false) {
+ return self$$1.hideMenu();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.fire('createmenu');
- self$$1.menu.reflow();
- self$$1.menu.on('cancel', function (e) {
- if (e.control.parent() === self$$1.menu) {
- e.stopPropagation();
- self$$1.focus();
- self$$1.hideMenu();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!self$$1.menu) {
+ menu = self$$1.state.get('menu') || [];
+ self$$1.classes.add('opened');
+ if (menu.length) {
+ menu = {
+ type: 'menu',
+ animate: true,
+ items: menu
+ };
+ } else {
+ menu.type = menu.type || 'menu';
+ menu.animate = 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">- });
- self$$1.menu.on('select', function () {
- self$$1.focus();
- });
- self$$1.menu.on('show hide', function (e) {
- if (e.control === self$$1.menu) {
- self$$1.activeMenu(e.type === 'show');
- self$$1.classes.toggle('opened', e.type === 'show');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!menu.renderTo) {
+ self$$1.menu = global$4.create(menu).parent(self$$1).renderTo();
+ } else {
+ self$$1.menu = menu.parent(self$$1).show().renderTo();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.aria('expanded', e.type === 'show');
- }).fire('show');
- }
- self$$1.menu.show();
- self$$1.menu.layoutRect({ w: self$$1.layoutRect().w });
- self$$1.menu.repaint();
- self$$1.menu.moveRel(self$$1.getEl(), self$$1.isRtl() ? [
- 'br-tr',
- 'tr-br'
- ] : [
- 'bl-tl',
- 'tl-bl'
- ]);
- self$$1.fire('showmenu');
- },
- hideMenu: function () {
- var self$$1 = this;
- if (self$$1.menu) {
- self$$1.menu.items().each(function (item) {
- if (item.hideMenu) {
- item.hideMenu();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.fire('createmenu');
+ self$$1.menu.reflow();
+ self$$1.menu.on('cancel', function (e) {
+ if (e.control.parent() === self$$1.menu) {
+ e.stopPropagation();
+ self$$1.focus();
+ self$$1.hideMenu();
+ }
+ });
+ self$$1.menu.on('select', function () {
+ self$$1.focus();
+ });
+ self$$1.menu.on('show hide', function (e) {
+ if (e.type === 'hide' && e.control.parent() === self$$1) {
+ self$$1.classes.remove('opened-under');
+ }
+ if (e.control === self$$1.menu) {
+ self$$1.activeMenu(e.type === 'show');
+ self$$1.classes.toggle('opened', e.type === 'show');
+ }
+ self$$1.aria('expanded', e.type === 'show');
+ }).fire('show');
+ }
+ self$$1.menu.show();
+ self$$1.menu.layoutRect({ w: self$$1.layoutRect().w });
+ self$$1.menu.repaint();
+ self$$1.menu.moveRel(self$$1.getEl(), self$$1.isRtl() ? [
+ 'br-tr',
+ 'tr-br'
+ ] : [
+ 'bl-tl',
+ 'tl-bl'
+ ]);
+ var menuLayoutRect = self$$1.menu.layoutRect();
+ var selfBottom = self$$1.$el.offset().top + self$$1.layoutRect().h;
+ if (selfBottom > menuLayoutRect.y && selfBottom < menuLayoutRect.y + menuLayoutRect.h) {
+ self$$1.classes.add('opened-under');
+ }
+ self$$1.fire('showmenu');
+ },
+ hideMenu: function () {
+ var self$$1 = this;
+ if (self$$1.menu) {
+ self$$1.menu.items().each(function (item) {
+ if (item.hideMenu) {
+ item.hideMenu();
+ }
+ });
+ self$$1.menu.hide();
+ }
+ },
+ activeMenu: function (state) {
+ this.classes.toggle('active', state);
+ },
+ renderHtml: function () {
+ var self$$1 = this, id = self$$1._id, prefix = self$$1.classPrefix;
+ var icon = self$$1.settings.icon, image;
+ var text = self$$1.state.get('text');
+ var textHtml = '';
+ image = self$$1.settings.image;
+ if (image) {
+ icon = 'none';
+ if (typeof image !== 'string') {
+ image = window.getSelection ? image[0] : image[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">- });
- self$$1.menu.hide();
- }
- },
- activeMenu: function (state) {
- this.classes.toggle('active', state);
- },
- renderHtml: function () {
- var self$$1 = this, id = self$$1._id, prefix = self$$1.classPrefix;
- var icon = self$$1.settings.icon, image;
- var text = self$$1.state.get('text');
- var textHtml = '';
- image = self$$1.settings.image;
- if (image) {
- icon = 'none';
- if (typeof image !== 'string') {
- image = window.getSelection ? image[0] : image[1];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ image = ' style="background-image: url(\'' + image + '\')"';
+ } else {
+ image = '';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- image = ' style="background-image: url(\'' + image + '\')"';
- } else {
- image = '';
- }
- if (text) {
- self$$1.classes.add('btn-has-text');
- textHtml = '<span class="' + prefix + 'txt">' + self$$1.encode(text) + '</span>';
- }
- icon = self$$1.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
- self$$1.aria('role', self$$1.parent() instanceof MenuBar ? 'menuitem' : 'button');
- return '<div id="' + id + '" class="' + self$$1.classes + '" tabindex="-1" aria-labelledby="' + id + '">' + '<button id="' + id + '-open" role="presentation" type="button" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + textHtml + ' <i class="' + prefix + 'caret"></i>' + '</button>' + '</div>';
- },
- postRender: function () {
- var self$$1 = this;
- self$$1.on('click', function (e) {
- if (e.control === self$$1 && isChildOf$1(e.target, self$$1.getEl())) {
- self$$1.focus();
- self$$1.showMenu(!e.aria);
- if (e.aria) {
- self$$1.menu.items().filter(':visible')[0].focus();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (text) {
+ self$$1.classes.add('btn-has-text');
+ textHtml = '<span class="' + prefix + 'txt">' + self$$1.encode(text) + '</span>';
+ }
+ icon = self$$1.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
+ self$$1.aria('role', self$$1.parent() instanceof MenuBar ? 'menuitem' : 'button');
+ return '<div id="' + id + '" class="' + self$$1.classes + '" tabindex="-1" aria-labelledby="' + id + '">' + '<button id="' + id + '-open" role="presentation" type="button" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + textHtml + ' <i class="' + prefix + 'caret"></i>' + '</button>' + '</div>';
+ },
+ postRender: function () {
+ var self$$1 = this;
+ self$$1.on('click', function (e) {
+ if (e.control === self$$1 && isChildOf$1(e.target, self$$1.getEl())) {
+ self$$1.focus();
+ self$$1.showMenu(!e.aria);
+ if (e.aria) {
+ self$$1.menu.items().filter(':visible')[0].focus();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- });
- self$$1.on('mouseenter', function (e) {
- var overCtrl = e.control;
- var parent$$1 = self$$1.parent();
- var hasVisibleSiblingMenu;
- if (overCtrl && parent$$1 && overCtrl instanceof MenuButton && overCtrl.parent() === parent$$1) {
- parent$$1.items().filter('MenuButton').each(function (ctrl) {
- if (ctrl.hideMenu && ctrl !== overCtrl) {
- if (ctrl.menu && ctrl.menu.visible()) {
- hasVisibleSiblingMenu = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ self$$1.on('mouseenter', function (e) {
+ var overCtrl = e.control;
+ var parent$$1 = self$$1.parent();
+ var hasVisibleSiblingMenu;
+ if (overCtrl && parent$$1 && overCtrl instanceof MenuButton && overCtrl.parent() === parent$$1) {
+ parent$$1.items().filter('MenuButton').each(function (ctrl) {
+ if (ctrl.hideMenu && ctrl !== overCtrl) {
+ if (ctrl.menu && ctrl.menu.visible()) {
+ hasVisibleSiblingMenu = true;
+ }
+ ctrl.hideMenu();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ctrl.hideMenu();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ if (hasVisibleSiblingMenu) {
+ overCtrl.focus();
+ overCtrl.showMenu();
</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 (hasVisibleSiblingMenu) {
- overCtrl.focus();
- overCtrl.showMenu();
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ return self$$1._super();
+ },
+ bindStates: function () {
+ var self$$1 = this;
+ self$$1.state.on('change:menu', function () {
+ if (self$$1.menu) {
+ self$$1.menu.remove();
+ }
+ self$$1.menu = null;
+ });
+ return self$$1._super();
+ },
+ remove: function () {
+ this._super();
+ if (this.menu) {
+ this.menu.remove();
</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 self$$1._super();
- },
- bindStates: function () {
- var self$$1 = this;
- self$$1.state.on('change:menu', function () {
- if (self$$1.menu) {
- self$$1.menu.remove();
- }
- self$$1.menu = null;
- });
- return self$$1._super();
- },
- remove: function () {
- this._super();
- if (this.menu) {
- this.menu.remove();
</del><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">+ });
</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 Menu = FloatPanel.extend({
- Defaults: {
- defaultType: 'menuitem',
- border: 1,
- layout: 'stack',
- role: 'application',
- bodyRole: 'menu',
- ariaRoot: true
- },
- init: function (settings) {
- var self = this;
- settings.autohide = true;
- settings.constrainToViewport = true;
- if (typeof settings.items === 'function') {
- settings.itemsFactory = settings.items;
- settings.items = [];
- }
- if (settings.itemDefaults) {
- var items = settings.items;
- var i = items.length;
- while (i--) {
- items[i] = global$2.extend({}, settings.itemDefaults, items[i]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Menu = FloatPanel.extend({
+ Defaults: {
+ defaultType: 'menuitem',
+ border: 1,
+ layout: 'stack',
+ role: 'application',
+ bodyRole: 'menu',
+ ariaRoot: true
+ },
+ init: function (settings) {
+ var self = this;
+ settings.autohide = true;
+ settings.constrainToViewport = true;
+ if (typeof settings.items === 'function') {
+ settings.itemsFactory = settings.items;
+ settings.items = [];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- self._super(settings);
- self.classes.add('menu');
- if (settings.animate && global$8.ie !== 11) {
- self.classes.add('animate');
- }
- },
- repaint: function () {
- this.classes.toggle('menu-align', true);
- this._super();
- this.getEl().style.height = '';
- this.getEl('body').style.height = '';
- return this;
- },
- cancel: function () {
- var self = this;
- self.hideAll();
- self.fire('select');
- },
- load: function () {
- var self = this;
- var time, factory;
- function hideThrobber() {
- if (self.throbber) {
- self.throbber.hide();
- self.throbber = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (settings.itemDefaults) {
+ var items = settings.items;
+ var i = items.length;
+ while (i--) {
+ items[i] = global$2.extend({}, settings.itemDefaults, items[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">- }
- factory = self.settings.itemsFactory;
- if (!factory) {
- return;
- }
- if (!self.throbber) {
- self.throbber = new Throbber(self.getEl('body'), true);
- if (self.items().length === 0) {
- self.throbber.show();
- self.fire('loading');
- } else {
- self.throbber.show(100, function () {
- self.items().remove();
- self.fire('loading');
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._super(settings);
+ self.classes.add('menu');
+ if (settings.animate && global$8.ie !== 11) {
+ self.classes.add('animate');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.on('hide close', hideThrobber);
- }
- self.requestTime = time = new Date().getTime();
- self.settings.itemsFactory(function (items) {
- if (items.length === 0) {
- self.hide();
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ repaint: function () {
+ this.classes.toggle('menu-align', true);
+ this._super();
+ this.getEl().style.height = '';
+ this.getEl('body').style.height = '';
+ return this;
+ },
+ cancel: function () {
+ var self = this;
+ self.hideAll();
+ self.fire('select');
+ },
+ load: function () {
+ var self = this;
+ var time, factory;
+ function hideThrobber() {
+ if (self.throbber) {
+ self.throbber.hide();
+ self.throbber = 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 (self.requestTime !== time) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ factory = self.settings.itemsFactory;
+ if (!factory) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.getEl().style.width = '';
- self.getEl('body').style.width = '';
- hideThrobber();
- self.items().remove();
- self.getEl('body').innerHTML = '';
- self.add(items);
- self.renderNew();
- self.fire('loaded');
- });
- },
- hideAll: function () {
- var self = this;
- this.find('menuitem').exec('hideMenu');
- return self._super();
- },
- preRender: function () {
- var self = this;
- self.items().each(function (ctrl) {
- var settings = ctrl.settings;
- if (settings.icon || settings.image || settings.selectable) {
- self._hasIcons = true;
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!self.throbber) {
+ self.throbber = new Throbber(self.getEl('body'), true);
+ if (self.items().length === 0) {
+ self.throbber.show();
+ self.fire('loading');
+ } else {
+ self.throbber.show(100, function () {
+ self.items().remove();
+ self.fire('loading');
+ });
+ }
+ self.on('hide close', hideThrobber);
</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 (self.settings.itemsFactory) {
- self.on('postrender', function () {
- if (self.settings.itemsFactory) {
- self.load();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.requestTime = time = new Date().getTime();
+ self.settings.itemsFactory(function (items) {
+ if (items.length === 0) {
+ self.hide();
+ return;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self.requestTime !== time) {
+ return;
+ }
+ self.getEl().style.width = '';
+ self.getEl('body').style.width = '';
+ hideThrobber();
+ self.items().remove();
+ self.getEl('body').innerHTML = '';
+ self.add(items);
+ self.renderNew();
+ self.fire('loaded');
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- self.on('show hide', function (e) {
- if (e.control === self) {
- if (e.type === 'show') {
- global$7.setTimeout(function () {
- self.classes.add('in');
- }, 0);
- } else {
- self.classes.remove('in');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ hideAll: function () {
+ var self = this;
+ this.find('menuitem').exec('hideMenu');
+ return self._super();
+ },
+ preRender: function () {
+ var self = this;
+ self.items().each(function (ctrl) {
+ var settings = ctrl.settings;
+ if (settings.icon || settings.image || settings.selectable) {
+ self._hasIcons = true;
+ return false;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ if (self.settings.itemsFactory) {
+ self.on('postrender', function () {
+ if (self.settings.itemsFactory) {
+ self.load();
+ }
+ });
</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 self._super();
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.on('show hide', function (e) {
+ if (e.control === self) {
+ if (e.type === 'show') {
+ global$7.setTimeout(function () {
+ self.classes.add('in');
+ }, 0);
+ } else {
+ self.classes.remove('in');
+ }
+ }
+ });
+ return self._super();
+ }
+ });
</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 ListBox = MenuButton.extend({
- init: function (settings) {
- var self = this;
- var values, selected, selectedText, lastItemCtrl;
- function setSelected(menuValues) {
- for (var i = 0; i < menuValues.length; i++) {
- selected = menuValues[i].selected || settings.value === menuValues[i].value;
- if (selected) {
- selectedText = selectedText || menuValues[i].text;
- self.state.set('value', menuValues[i].value);
- return true;
- }
- if (menuValues[i].menu) {
- if (setSelected(menuValues[i].menu)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ListBox = MenuButton.extend({
+ init: function (settings) {
+ var self = this;
+ var values, selected, selectedText, lastItemCtrl;
+ function setSelected(menuValues) {
+ for (var i = 0; i < menuValues.length; i++) {
+ selected = menuValues[i].selected || settings.value === menuValues[i].value;
+ if (selected) {
+ selectedText = selectedText || menuValues[i].text;
+ self.state.set('value', menuValues[i].value);
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (menuValues[i].menu) {
+ if (setSelected(menuValues[i].menu)) {
+ return true;
+ }
+ }
</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">- }
- self._super(settings);
- settings = self.settings;
- self._values = values = settings.values;
- if (values) {
- if (typeof settings.value !== 'undefined') {
- setSelected(values);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._super(settings);
+ settings = self.settings;
+ self._values = values = settings.values;
+ if (values) {
+ if (typeof settings.value !== 'undefined') {
+ setSelected(values);
+ }
+ if (!selected && values.length > 0) {
+ selectedText = values[0].text;
+ self.state.set('value', values[0].value);
+ }
+ self.state.set('menu', values);
</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 (!selected && values.length > 0) {
- selectedText = values[0].text;
- self.state.set('value', values[0].value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.state.set('text', settings.text || selectedText);
+ self.classes.add('listbox');
+ self.on('select', function (e) {
+ var ctrl = e.control;
+ if (lastItemCtrl) {
+ e.lastControl = lastItemCtrl;
+ }
+ if (settings.multiple) {
+ ctrl.active(!ctrl.active());
+ } else {
+ self.value(e.control.value());
+ }
+ lastItemCtrl = ctrl;
+ });
+ },
+ value: function (value) {
+ if (arguments.length === 0) {
+ return this.state.get('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">- self.state.set('menu', values);
- }
- self.state.set('text', settings.text || selectedText);
- self.classes.add('listbox');
- self.on('select', function (e) {
- var ctrl = e.control;
- if (lastItemCtrl) {
- e.lastControl = lastItemCtrl;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (typeof value === 'undefined') {
+ return 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">- if (settings.multiple) {
- ctrl.active(!ctrl.active());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function valueExists(values) {
+ return exists(values, function (a) {
+ return a.menu ? valueExists(a.menu) : a.value === value;
+ });
+ }
+ if (this.settings.values) {
+ if (valueExists(this.settings.values)) {
+ this.state.set('value', value);
+ } else if (value === null) {
+ this.state.set('value', null);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.value(e.control.value());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.state.set('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">- lastItemCtrl = ctrl;
- });
- },
- value: function (value) {
- if (arguments.length === 0) {
- return this.state.get('value');
- }
- if (typeof value === 'undefined') {
</del><span class="cx" style="display: block; padding: 0 10px"> return this;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (this.settings.values) {
- var matchingValues = global$2.grep(this.settings.values, function (a) {
- return a.value === value;
- });
- if (matchingValues.length > 0) {
- this.state.set('value', value);
- } else if (value === null) {
- this.state.set('value', null);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ bindStates: function () {
+ var self = this;
+ function activateMenuItemsByValue(menu, value) {
+ if (menu instanceof Menu) {
+ menu.items().each(function (ctrl) {
+ if (!ctrl.hasMenus()) {
+ ctrl.active(ctrl.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">- } else {
- this.state.set('value', value);
- }
- return this;
- },
- bindStates: function () {
- var self = this;
- function activateMenuItemsByValue(menu, value) {
- if (menu instanceof Menu) {
- menu.items().each(function (ctrl) {
- if (!ctrl.hasMenus()) {
- ctrl.active(ctrl.value() === value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function getSelectedItem(menuValues, value) {
+ var selectedItem;
+ if (!menuValues) {
+ return;
+ }
+ for (var i = 0; i < menuValues.length; i++) {
+ if (menuValues[i].value === value) {
+ return menuValues[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">- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (menuValues[i].menu) {
+ selectedItem = getSelectedItem(menuValues[i].menu, value);
+ if (selectedItem) {
+ return selectedItem;
+ }
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.on('show', function (e) {
+ activateMenuItemsByValue(e.control, self.value());
+ });
+ self.state.on('change:value', function (e) {
+ var selectedItem = getSelectedItem(self.state.get('menu'), e.value);
+ if (selectedItem) {
+ self.text(selectedItem.text);
+ } else {
+ self.text(self.settings.text);
+ }
+ });
+ return self._super();
</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 getSelectedItem(menuValues, value) {
- var selectedItem;
- if (!menuValues) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var toggleTextStyle = function (ctrl, state) {
+ var textStyle = ctrl._textStyle;
+ if (textStyle) {
+ var textElm = ctrl.getEl('text');
+ textElm.setAttribute('style', textStyle);
+ if (state) {
+ textElm.style.color = '';
+ textElm.style.backgroundColor = '';
</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 i = 0; i < menuValues.length; i++) {
- if (menuValues[i].value === value) {
- return menuValues[i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ };
+ var MenuItem = Widget.extend({
+ Defaults: {
+ border: 0,
+ role: 'menuitem'
+ },
+ init: function (settings) {
+ var self = this;
+ var text;
+ self._super(settings);
+ settings = self.settings;
+ self.classes.add('menu-item');
+ if (settings.menu) {
+ self.classes.add('menu-item-expand');
+ }
+ if (settings.preview) {
+ self.classes.add('menu-item-preview');
+ }
+ text = self.state.get('text');
+ if (text === '-' || text === '|') {
+ self.classes.add('menu-item-sep');
+ self.aria('role', 'separator');
+ self.state.set('text', '-');
+ }
+ if (settings.selectable) {
+ self.aria('role', 'menuitemcheckbox');
+ self.classes.add('menu-item-checkbox');
+ settings.icon = 'selected';
+ }
+ if (!settings.preview && !settings.selectable) {
+ self.classes.add('menu-item-normal');
+ }
+ self.on('mousedown', function (e) {
+ e.preventDefault();
+ });
+ if (settings.menu && !settings.ariaHideMenu) {
+ self.aria('haspopup', true);
+ }
+ },
+ hasMenus: function () {
+ return !!this.settings.menu;
+ },
+ showMenu: function () {
+ var self = this;
+ var settings = self.settings;
+ var menu;
+ var parent = self.parent();
+ parent.items().each(function (ctrl) {
+ if (ctrl !== self) {
+ ctrl.hideMenu();
</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 (menuValues[i].menu) {
- selectedItem = getSelectedItem(menuValues[i].menu, value);
- if (selectedItem) {
- return selectedItem;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ if (settings.menu) {
+ menu = self.menu;
+ if (!menu) {
+ menu = settings.menu;
+ if (menu.length) {
+ menu = {
+ type: 'menu',
+ items: menu
+ };
+ } else {
+ menu.type = menu.type || 'menu';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (parent.settings.itemDefaults) {
+ menu.itemDefaults = parent.settings.itemDefaults;
+ }
+ menu = self.menu = global$4.create(menu).parent(self).renderTo();
+ menu.reflow();
+ menu.on('cancel', function (e) {
+ e.stopPropagation();
+ self.focus();
+ menu.hide();
+ });
+ menu.on('show hide', function (e) {
+ if (e.control.items) {
+ e.control.items().each(function (ctrl) {
+ ctrl.active(ctrl.settings.selected);
+ });
+ }
+ }).fire('show');
+ menu.on('hide', function (e) {
+ if (e.control === menu) {
+ self.classes.remove('selected');
+ }
+ });
+ menu.submenu = true;
+ } else {
+ menu.show();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ menu._parentMenu = parent;
+ menu.classes.add('menu-sub');
+ var rel = menu.testMoveRel(self.getEl(), self.isRtl() ? [
+ 'tl-tr',
+ 'bl-br',
+ 'tr-tl',
+ 'br-bl'
+ ] : [
+ 'tr-tl',
+ 'br-bl',
+ 'tl-tr',
+ 'bl-br'
+ ]);
+ menu.moveRel(self.getEl(), rel);
+ menu.rel = rel;
+ rel = 'menu-sub-' + rel;
+ menu.classes.remove(menu._lastRel).add(rel);
+ menu._lastRel = rel;
+ self.classes.add('selected');
+ self.aria('expanded', 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">- }
- self.on('show', function (e) {
- activateMenuItemsByValue(e.control, self.value());
- });
- self.state.on('change:value', function (e) {
- var selectedItem = getSelectedItem(self.state.get('menu'), e.value);
- if (selectedItem) {
- self.text(selectedItem.text);
- } else {
- self.text(self.settings.text);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ hideMenu: function () {
+ var self = this;
+ if (self.menu) {
+ self.menu.items().each(function (item) {
+ if (item.hideMenu) {
+ item.hideMenu();
+ }
+ });
+ self.menu.hide();
+ self.aria('expanded', false);
</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 self._super();
- }
- });
-
- var toggleTextStyle = function (ctrl, state) {
- var textStyle = ctrl._textStyle;
- if (textStyle) {
- var textElm = ctrl.getEl('text');
- textElm.setAttribute('style', textStyle);
- if (state) {
- textElm.style.color = '';
- textElm.style.backgroundColor = '';
- }
- }
- };
- var MenuItem = Widget.extend({
- Defaults: {
- border: 0,
- role: 'menuitem'
- },
- init: function (settings) {
- var self = this;
- var text;
- self._super(settings);
- settings = self.settings;
- self.classes.add('menu-item');
- if (settings.menu) {
- self.classes.add('menu-item-expand');
- }
- if (settings.preview) {
- self.classes.add('menu-item-preview');
- }
- text = self.state.get('text');
- if (text === '-' || text === '|') {
- self.classes.add('menu-item-sep');
- self.aria('role', 'separator');
- self.state.set('text', '-');
- }
- if (settings.selectable) {
- self.aria('role', 'menuitemcheckbox');
- self.classes.add('menu-item-checkbox');
- settings.icon = 'selected';
- }
- if (!settings.preview && !settings.selectable) {
- self.classes.add('menu-item-normal');
- }
- self.on('mousedown', function (e) {
- e.preventDefault();
- });
- if (settings.menu && !settings.ariaHideMenu) {
- self.aria('haspopup', true);
- }
- },
- hasMenus: function () {
- return !!this.settings.menu;
- },
- showMenu: function () {
- var self = this;
- var settings = self.settings;
- var menu;
- var parent = self.parent();
- parent.items().each(function (ctrl) {
- if (ctrl !== self) {
- ctrl.hideMenu();
- }
- });
- if (settings.menu) {
- menu = self.menu;
- if (!menu) {
- menu = settings.menu;
- if (menu.length) {
- menu = {
- type: 'menu',
- items: menu
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self;
+ },
+ renderHtml: function () {
+ var self = this;
+ var id = self._id;
+ var settings = self.settings;
+ var prefix = self.classPrefix;
+ var text = self.state.get('text');
+ var icon = self.settings.icon, image = '', shortcut = settings.shortcut;
+ var url = self.encode(settings.url), iconHtml = '';
+ function convertShortcut(shortcut) {
+ var i, value, replace = {};
+ if (global$8.mac) {
+ replace = {
+ alt: '⌥',
+ ctrl: '⌘',
+ shift: '⇧',
+ meta: '⌘'
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- menu.type = menu.type || 'menu';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ replace = { meta: 'Ctrl' };
</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 (parent.settings.itemDefaults) {
- menu.itemDefaults = parent.settings.itemDefaults;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ shortcut = shortcut.split('+');
+ for (i = 0; i < shortcut.length; i++) {
+ value = replace[shortcut[i].toLowerCase()];
+ if (value) {
+ shortcut[i] = 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">- menu = self.menu = global$4.create(menu).parent(self).renderTo();
- menu.reflow();
- menu.on('cancel', function (e) {
- e.stopPropagation();
- self.focus();
- menu.hide();
- });
- menu.on('show hide', function (e) {
- if (e.control.items) {
- e.control.items().each(function (ctrl) {
- ctrl.active(ctrl.settings.selected);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return shortcut.join('+');
+ }
+ function escapeRegExp(str) {
+ return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+ }
+ function markMatches(text) {
+ var match = settings.match || '';
+ return match ? text.replace(new RegExp(escapeRegExp(match), 'gi'), function (match) {
+ return '!mce~match[' + match + ']mce~match!';
+ }) : text;
+ }
+ function boldMatches(text) {
+ return text.replace(new RegExp(escapeRegExp('!mce~match['), 'g'), '<b>').replace(new RegExp(escapeRegExp(']mce~match!'), 'g'), '</b>');
+ }
+ if (icon) {
+ self.parent().classes.add('menu-has-icons');
+ }
+ if (settings.image) {
+ image = ' style="background-image: url(\'' + settings.image + '\')"';
+ }
+ if (shortcut) {
+ shortcut = convertShortcut(shortcut);
+ }
+ icon = prefix + 'ico ' + prefix + 'i-' + (self.settings.icon || 'none');
+ iconHtml = text !== '-' ? '<i class="' + icon + '"' + image + '></i>\xA0' : '';
+ text = boldMatches(self.encode(markMatches(text)));
+ url = boldMatches(self.encode(markMatches(url)));
+ return '<div id="' + id + '" class="' + self.classes + '" tabindex="-1">' + iconHtml + (text !== '-' ? '<span id="' + id + '-text" class="' + prefix + 'text">' + text + '</span>' : '') + (shortcut ? '<div id="' + id + '-shortcut" class="' + prefix + 'menu-shortcut">' + shortcut + '</div>' : '') + (settings.menu ? '<div class="' + prefix + 'caret"></div>' : '') + (url ? '<div class="' + prefix + 'menu-item-link">' + url + '</div>' : '') + '</div>';
+ },
+ postRender: function () {
+ var self = this, settings = self.settings;
+ var textStyle = settings.textStyle;
+ if (typeof textStyle === 'function') {
+ textStyle = textStyle.call(this);
+ }
+ if (textStyle) {
+ var textElm = self.getEl('text');
+ if (textElm) {
+ textElm.setAttribute('style', textStyle);
+ self._textStyle = textStyle;
+ }
+ }
+ self.on('mouseenter click', function (e) {
+ if (e.control === self) {
+ if (!settings.menu && e.type === 'click') {
+ self.fire('select');
+ global$7.requestAnimationFrame(function () {
+ self.parent().hideAll();
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ self.showMenu();
+ if (e.aria) {
+ self.menu.focus(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">- }).fire('show');
- menu.on('hide', function (e) {
- if (e.control === menu) {
- self.classes.remove('selected');
- }
- });
- menu.submenu = true;
- } else {
- menu.show();
- }
- menu._parentMenu = parent;
- menu.classes.add('menu-sub');
- var rel = menu.testMoveRel(self.getEl(), self.isRtl() ? [
- 'tl-tr',
- 'bl-br',
- 'tr-tl',
- 'br-bl'
- ] : [
- 'tr-tl',
- 'br-bl',
- 'tl-tr',
- 'bl-br'
- ]);
- menu.moveRel(self.getEl(), rel);
- menu.rel = rel;
- rel = 'menu-sub-' + rel;
- menu.classes.remove(menu._lastRel).add(rel);
- menu._lastRel = rel;
- self.classes.add('selected');
- self.aria('expanded', true);
- }
- },
- hideMenu: function () {
- var self = this;
- if (self.menu) {
- self.menu.items().each(function (item) {
- if (item.hideMenu) {
- item.hideMenu();
</del><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">- self.menu.hide();
- self.aria('expanded', false);
- }
- return self;
- },
- renderHtml: function () {
- var self = this;
- var id = self._id;
- var settings = self.settings;
- var prefix = self.classPrefix;
- var text = self.state.get('text');
- var icon = self.settings.icon, image = '', shortcut = settings.shortcut;
- var url = self.encode(settings.url), iconHtml = '';
- function convertShortcut(shortcut) {
- var i, value, replace = {};
- if (global$8.mac) {
- replace = {
- alt: '⌥',
- ctrl: '⌘',
- shift: '⇧',
- meta: '⌘'
- };
- } else {
- replace = { meta: 'Ctrl' };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self._super();
+ return self;
+ },
+ hover: function () {
+ var self = this;
+ self.parent().items().each(function (ctrl) {
+ ctrl.classes.remove('selected');
+ });
+ self.classes.toggle('selected', true);
+ return self;
+ },
+ active: function (state) {
+ toggleTextStyle(this, state);
+ if (typeof state !== 'undefined') {
+ this.aria('checked', 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">- shortcut = shortcut.split('+');
- for (i = 0; i < shortcut.length; i++) {
- value = replace[shortcut[i].toLowerCase()];
- if (value) {
- shortcut[i] = value;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this._super(state);
+ },
+ remove: function () {
+ this._super();
+ if (this.menu) {
+ this.menu.remove();
</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 shortcut.join('+');
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function escapeRegExp(str) {
- return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var Radio = Checkbox.extend({
+ Defaults: {
+ classes: 'radio',
+ role: 'radio'
</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 markMatches(text) {
- var match = settings.match || '';
- return match ? text.replace(new RegExp(escapeRegExp(match), 'gi'), function (match) {
- return '!mce~match[' + match + ']mce~match!';
- }) : text;
- }
- function boldMatches(text) {
- return text.replace(new RegExp(escapeRegExp('!mce~match['), 'g'), '<b>').replace(new RegExp(escapeRegExp(']mce~match!'), 'g'), '</b>');
- }
- if (icon) {
- self.parent().classes.add('menu-has-icons');
- }
- if (settings.image) {
- image = ' style="background-image: url(\'' + settings.image + '\')"';
- }
- if (shortcut) {
- shortcut = convertShortcut(shortcut);
- }
- icon = prefix + 'ico ' + prefix + 'i-' + (self.settings.icon || 'none');
- iconHtml = text !== '-' ? '<i class="' + icon + '"' + image + '></i>\xA0' : '';
- text = boldMatches(self.encode(markMatches(text)));
- url = boldMatches(self.encode(markMatches(url)));
- return '<div id="' + id + '" class="' + self.classes + '" tabindex="-1">' + iconHtml + (text !== '-' ? '<span id="' + id + '-text" class="' + prefix + 'text">' + text + '</span>' : '') + (shortcut ? '<div id="' + id + '-shortcut" class="' + prefix + 'menu-shortcut">' + shortcut + '</div>' : '') + (settings.menu ? '<div class="' + prefix + 'caret"></div>' : '') + (url ? '<div class="' + prefix + 'menu-item-link">' + url + '</div>' : '') + '</div>';
- },
- postRender: function () {
- var self = this, settings = self.settings;
- var textStyle = settings.textStyle;
- if (typeof textStyle === 'function') {
- textStyle = textStyle.call(this);
- }
- if (textStyle) {
- var textElm = self.getEl('text');
- if (textElm) {
- textElm.setAttribute('style', textStyle);
- self._textStyle = textStyle;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var ResizeHandle = Widget.extend({
+ renderHtml: function () {
+ var self = this, prefix = self.classPrefix;
+ self.classes.add('resizehandle');
+ if (self.settings.direction === 'both') {
+ self.classes.add('resizehandle-both');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- self.on('mouseenter click', function (e) {
- if (e.control === self) {
- if (!settings.menu && e.type === 'click') {
- self.fire('select');
- global$7.requestAnimationFrame(function () {
- self.parent().hideAll();
- });
- } else {
- self.showMenu();
- if (e.aria) {
- self.menu.focus(true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.canFocus = false;
+ return '<div id="' + self._id + '" class="' + self.classes + '">' + '<i class="' + prefix + 'ico ' + prefix + 'i-resize"></i>' + '</div>';
+ },
+ postRender: function () {
+ var self = this;
+ self._super();
+ self.resizeDragHelper = new DragHelper(this._id, {
+ start: function () {
+ self.fire('ResizeStart');
+ },
+ drag: function (e) {
+ if (self.settings.direction !== 'both') {
+ e.deltaX = 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.fire('Resize', e);
+ },
+ stop: function () {
+ self.fire('ResizeEnd');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ },
+ remove: function () {
+ if (this.resizeDragHelper) {
+ this.resizeDragHelper.destroy();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- self._super();
- return self;
- },
- hover: function () {
- var self = this;
- self.parent().items().each(function (ctrl) {
- ctrl.classes.remove('selected');
- });
- self.classes.toggle('selected', true);
- return self;
- },
- active: function (state) {
- toggleTextStyle(this, state);
- if (typeof state !== 'undefined') {
- this.aria('checked', state);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this._super();
</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 this._super(state);
- },
- remove: function () {
- this._super();
- if (this.menu) {
- this.menu.remove();
- }
- }
- });
</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">- var Radio = Checkbox.extend({
- Defaults: {
- classes: 'radio',
- role: 'radio'
- }
- });
-
- var ResizeHandle = Widget.extend({
- renderHtml: function () {
- var self = this, prefix = self.classPrefix;
- self.classes.add('resizehandle');
- if (self.settings.direction === 'both') {
- self.classes.add('resizehandle-both');
- }
- self.canFocus = false;
- return '<div id="' + self._id + '" class="' + self.classes + '">' + '<i class="' + prefix + 'ico ' + prefix + 'i-resize"></i>' + '</div>';
- },
- postRender: function () {
- var self = this;
- self._super();
- self.resizeDragHelper = new DragHelper(this._id, {
- start: function () {
- self.fire('ResizeStart');
- },
- drag: function (e) {
- if (self.settings.direction !== 'both') {
- e.deltaX = 0;
- }
- self.fire('Resize', e);
- },
- stop: function () {
- self.fire('ResizeEnd');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function createOptions(options) {
+ var strOptions = '';
+ if (options) {
+ for (var i = 0; i < options.length; i++) {
+ strOptions += '<option value="' + options[i] + '">' + options[i] + '</option>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- },
- remove: function () {
- if (this.resizeDragHelper) {
- this.resizeDragHelper.destroy();
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return this._super();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return strOptions;
</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 createOptions(options) {
- var strOptions = '';
- if (options) {
- for (var i = 0; i < options.length; i++) {
- strOptions += '<option value="' + options[i] + '">' + options[i] + '</option>';
- }
- }
- return strOptions;
- }
- var SelectBox = Widget.extend({
- Defaults: {
- classes: 'selectbox',
- role: 'selectbox',
- options: []
- },
- init: function (settings) {
- var self = this;
- self._super(settings);
- if (self.settings.size) {
- self.size = self.settings.size;
- }
- if (self.settings.options) {
- self._options = self.settings.options;
- }
- self.on('keydown', function (e) {
- var rootControl;
- if (e.keyCode === 13) {
- e.preventDefault();
- self.parents().reverse().each(function (ctrl) {
- if (ctrl.toJSON) {
- rootControl = ctrl;
- return false;
- }
- });
- self.fire('submit', { data: rootControl.toJSON() });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var SelectBox = Widget.extend({
+ Defaults: {
+ classes: 'selectbox',
+ role: 'selectbox',
+ options: []
+ },
+ init: function (settings) {
+ var self = this;
+ self._super(settings);
+ if (self.settings.size) {
+ self.size = self.settings.size;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- },
- options: function (state) {
- if (!arguments.length) {
- return this.state.get('options');
- }
- this.state.set('options', state);
- return this;
- },
- renderHtml: function () {
- var self = this;
- var options, size = '';
- options = createOptions(self._options);
- if (self.size) {
- size = ' size = "' + self.size + '"';
- }
- return '<select id="' + self._id + '" class="' + self.classes + '"' + size + '>' + options + '</select>';
- },
- bindStates: function () {
- var self = this;
- self.state.on('change:options', function (e) {
- self.getEl().innerHTML = createOptions(e.value);
- });
- return self._super();
- }
- });
-
- function constrain(value, minVal, maxVal) {
- if (value < minVal) {
- value = minVal;
- }
- if (value > maxVal) {
- value = maxVal;
- }
- return value;
- }
- function setAriaProp(el, name, value) {
- el.setAttribute('aria-' + name, value);
- }
- function updateSliderHandle(ctrl, value) {
- var maxHandlePos, shortSizeName, sizeName, stylePosName, styleValue, handleEl;
- if (ctrl.settings.orientation === 'v') {
- stylePosName = 'top';
- sizeName = 'height';
- shortSizeName = 'h';
- } else {
- stylePosName = 'left';
- sizeName = 'width';
- shortSizeName = 'w';
- }
- handleEl = ctrl.getEl('handle');
- maxHandlePos = (ctrl.layoutRect()[shortSizeName] || 100) - funcs.getSize(handleEl)[sizeName];
- styleValue = maxHandlePos * ((value - ctrl._minValue) / (ctrl._maxValue - ctrl._minValue)) + 'px';
- handleEl.style[stylePosName] = styleValue;
- handleEl.style.height = ctrl.layoutRect().h + 'px';
- setAriaProp(handleEl, 'valuenow', value);
- setAriaProp(handleEl, 'valuetext', '' + ctrl.settings.previewFilter(value));
- setAriaProp(handleEl, 'valuemin', ctrl._minValue);
- setAriaProp(handleEl, 'valuemax', ctrl._maxValue);
- }
- var Slider = Widget.extend({
- init: function (settings) {
- var self = this;
- if (!settings.previewFilter) {
- settings.previewFilter = function (value) {
- return Math.round(value * 100) / 100;
- };
- }
- self._super(settings);
- self.classes.add('slider');
- if (settings.orientation === 'v') {
- self.classes.add('vertical');
- }
- self._minValue = isNumber(settings.minValue) ? settings.minValue : 0;
- self._maxValue = isNumber(settings.maxValue) ? settings.maxValue : 100;
- self._initValue = self.state.get('value');
- },
- renderHtml: function () {
- var self = this, id = self._id, prefix = self.classPrefix;
- return '<div id="' + id + '" class="' + self.classes + '">' + '<div id="' + id + '-handle" class="' + prefix + 'slider-handle" role="slider" tabindex="-1"></div>' + '</div>';
- },
- reset: function () {
- this.value(this._initValue).repaint();
- },
- postRender: function () {
- var self = this;
- var minValue, maxValue, screenCordName, stylePosName, sizeName, shortSizeName;
- function toFraction(min, max, val) {
- return (val + min) / (max - min);
- }
- function fromFraction(min, max, val) {
- return val * (max - min) - min;
- }
- function handleKeyboard(minValue, maxValue) {
- function alter(delta) {
- var value;
- value = self.value();
- value = fromFraction(minValue, maxValue, toFraction(minValue, maxValue, value) + delta * 0.05);
- value = constrain(value, minValue, maxValue);
- self.value(value);
- self.fire('dragstart', { value: value });
- self.fire('drag', { value: value });
- self.fire('dragend', { value: value });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self.settings.options) {
+ self._options = self.settings.options;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> self.on('keydown', function (e) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- switch (e.keyCode) {
- case 37:
- case 38:
- alter(-1);
- break;
- case 39:
- case 40:
- alter(1);
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var rootControl;
+ if (e.keyCode === 13) {
+ e.preventDefault();
+ self.parents().reverse().each(function (ctrl) {
+ if (ctrl.toJSON) {
+ rootControl = ctrl;
+ return false;
+ }
+ });
+ self.fire('submit', { data: rootControl.toJSON() });
</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">- }
- function handleDrag(minValue, maxValue, handleEl) {
- var startPos, startHandlePos, maxHandlePos, handlePos, value;
- self._dragHelper = new DragHelper(self._id, {
- handle: self._id + '-handle',
- start: function (e) {
- startPos = e[screenCordName];
- startHandlePos = parseInt(self.getEl('handle').style[stylePosName], 10);
- maxHandlePos = (self.layoutRect()[shortSizeName] || 100) - funcs.getSize(handleEl)[sizeName];
- self.fire('dragstart', { value: value });
- },
- drag: function (e) {
- var delta = e[screenCordName] - startPos;
- handlePos = constrain(startHandlePos + delta, 0, maxHandlePos);
- handleEl.style[stylePosName] = handlePos + 'px';
- value = minValue + handlePos / maxHandlePos * (maxValue - minValue);
- self.value(value);
- self.tooltip().text('' + self.settings.previewFilter(value)).show().moveRel(handleEl, 'bc tc');
- self.fire('drag', { value: value });
- },
- stop: function () {
- self.tooltip().hide();
- self.fire('dragend', { value: value });
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ options: function (state) {
+ if (!arguments.length) {
+ return this.state.get('options');
+ }
+ this.state.set('options', state);
+ return this;
+ },
+ renderHtml: function () {
+ var self = this;
+ var options, size = '';
+ options = createOptions(self._options);
+ if (self.size) {
+ size = ' size = "' + self.size + '"';
+ }
+ return '<select id="' + self._id + '" class="' + self.classes + '"' + size + '>' + options + '</select>';
+ },
+ bindStates: function () {
+ var self = this;
+ self.state.on('change:options', function (e) {
+ self.getEl().innerHTML = createOptions(e.value);
</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 self._super();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- minValue = self._minValue;
- maxValue = self._maxValue;
- if (self.settings.orientation === 'v') {
- screenCordName = 'screenY';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ function constrain(value, minVal, maxVal) {
+ if (value < minVal) {
+ value = minVal;
+ }
+ if (value > maxVal) {
+ value = maxVal;
+ }
+ return value;
+ }
+ function setAriaProp(el, name, value) {
+ el.setAttribute('aria-' + name, value);
+ }
+ function updateSliderHandle(ctrl, value) {
+ var maxHandlePos, shortSizeName, sizeName, stylePosName, styleValue, handleEl;
+ if (ctrl.settings.orientation === 'v') {
</ins><span class="cx" style="display: block; padding: 0 10px"> stylePosName = 'top';
</span><span class="cx" style="display: block; padding: 0 10px"> sizeName = 'height';
</span><span class="cx" style="display: block; padding: 0 10px"> shortSizeName = 'h';
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- screenCordName = 'screenX';
</del><span class="cx" style="display: block; padding: 0 10px"> stylePosName = 'left';
</span><span class="cx" style="display: block; padding: 0 10px"> sizeName = 'width';
</span><span class="cx" style="display: block; padding: 0 10px"> shortSizeName = 'w';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self._super();
- handleKeyboard(minValue, maxValue);
- handleDrag(minValue, maxValue, self.getEl('handle'));
- },
- repaint: function () {
- this._super();
- updateSliderHandle(this, this.value());
- },
- bindStates: function () {
- var self = this;
- self.state.on('change:value', function (e) {
- updateSliderHandle(self, e.value);
- });
- return self._super();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ handleEl = ctrl.getEl('handle');
+ maxHandlePos = (ctrl.layoutRect()[shortSizeName] || 100) - funcs.getSize(handleEl)[sizeName];
+ styleValue = maxHandlePos * ((value - ctrl._minValue) / (ctrl._maxValue - ctrl._minValue)) + 'px';
+ handleEl.style[stylePosName] = styleValue;
+ handleEl.style.height = ctrl.layoutRect().h + 'px';
+ setAriaProp(handleEl, 'valuenow', value);
+ setAriaProp(handleEl, 'valuetext', '' + ctrl.settings.previewFilter(value));
+ setAriaProp(handleEl, 'valuemin', ctrl._minValue);
+ setAriaProp(handleEl, 'valuemax', ctrl._maxValue);
</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">+ var Slider = Widget.extend({
+ init: function (settings) {
+ var self = this;
+ if (!settings.previewFilter) {
+ settings.previewFilter = function (value) {
+ return Math.round(value * 100) / 100;
+ };
+ }
+ self._super(settings);
+ self.classes.add('slider');
+ if (settings.orientation === 'v') {
+ self.classes.add('vertical');
+ }
+ self._minValue = isNumber(settings.minValue) ? settings.minValue : 0;
+ self._maxValue = isNumber(settings.maxValue) ? settings.maxValue : 100;
+ self._initValue = self.state.get('value');
+ },
+ renderHtml: function () {
+ var self = this, id = self._id, prefix = self.classPrefix;
+ return '<div id="' + id + '" class="' + self.classes + '">' + '<div id="' + id + '-handle" class="' + prefix + 'slider-handle" role="slider" tabindex="-1"></div>' + '</div>';
+ },
+ reset: function () {
+ this.value(this._initValue).repaint();
+ },
+ postRender: function () {
+ var self = this;
+ var minValue, maxValue, screenCordName, stylePosName, sizeName, shortSizeName;
+ function toFraction(min, max, val) {
+ return (val + min) / (max - min);
+ }
+ function fromFraction(min, max, val) {
+ return val * (max - min) - min;
+ }
+ function handleKeyboard(minValue, maxValue) {
+ function alter(delta) {
+ var value;
+ value = self.value();
+ value = fromFraction(minValue, maxValue, toFraction(minValue, maxValue, value) + delta * 0.05);
+ value = constrain(value, minValue, maxValue);
+ self.value(value);
+ self.fire('dragstart', { value: value });
+ self.fire('drag', { value: value });
+ self.fire('dragend', { value: value });
+ }
+ self.on('keydown', function (e) {
+ switch (e.keyCode) {
+ case 37:
+ case 38:
+ alter(-1);
+ break;
+ case 39:
+ case 40:
+ alter(1);
+ break;
+ }
+ });
+ }
+ function handleDrag(minValue, maxValue, handleEl) {
+ var startPos, startHandlePos, maxHandlePos, handlePos, value;
+ self._dragHelper = new DragHelper(self._id, {
+ handle: self._id + '-handle',
+ start: function (e) {
+ startPos = e[screenCordName];
+ startHandlePos = parseInt(self.getEl('handle').style[stylePosName], 10);
+ maxHandlePos = (self.layoutRect()[shortSizeName] || 100) - funcs.getSize(handleEl)[sizeName];
+ self.fire('dragstart', { value: value });
+ },
+ drag: function (e) {
+ var delta = e[screenCordName] - startPos;
+ handlePos = constrain(startHandlePos + delta, 0, maxHandlePos);
+ handleEl.style[stylePosName] = handlePos + 'px';
+ value = minValue + handlePos / maxHandlePos * (maxValue - minValue);
+ self.value(value);
+ self.tooltip().text('' + self.settings.previewFilter(value)).show().moveRel(handleEl, 'bc tc');
+ self.fire('drag', { value: value });
+ },
+ stop: function () {
+ self.tooltip().hide();
+ self.fire('dragend', { value: value });
+ }
+ });
+ }
+ minValue = self._minValue;
+ maxValue = self._maxValue;
+ if (self.settings.orientation === 'v') {
+ screenCordName = 'screenY';
+ stylePosName = 'top';
+ sizeName = 'height';
+ shortSizeName = 'h';
+ } else {
+ screenCordName = 'screenX';
+ stylePosName = 'left';
+ sizeName = 'width';
+ shortSizeName = 'w';
+ }
+ self._super();
+ handleKeyboard(minValue, maxValue);
+ handleDrag(minValue, maxValue, self.getEl('handle'));
+ },
+ repaint: function () {
+ this._super();
+ updateSliderHandle(this, this.value());
+ },
+ bindStates: function () {
+ var self = this;
+ self.state.on('change:value', function (e) {
+ updateSliderHandle(self, e.value);
+ });
+ return self._super();
+ }
+ });
</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 Spacer = Widget.extend({
- renderHtml: function () {
- var self = this;
- self.classes.add('spacer');
- self.canFocus = false;
- return '<div id="' + self._id + '" class="' + self.classes + '"></div>';
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Spacer = Widget.extend({
+ renderHtml: function () {
+ var self = this;
+ self.classes.add('spacer');
+ self.canFocus = false;
+ return '<div id="' + self._id + '" class="' + self.classes + '"></div>';
+ }
+ });
</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 SplitButton = MenuButton.extend({
- Defaults: {
- classes: 'widget btn splitbtn',
- role: 'button'
- },
- repaint: function () {
- var self$$1 = this;
- var elm = self$$1.getEl();
- var rect = self$$1.layoutRect();
- var mainButtonElm, menuButtonElm;
- self$$1._super();
- mainButtonElm = elm.firstChild;
- menuButtonElm = elm.lastChild;
- global$9(mainButtonElm).css({
- width: rect.w - funcs.getSize(menuButtonElm).width,
- height: rect.h - 2
- });
- global$9(menuButtonElm).css({ height: rect.h - 2 });
- return self$$1;
- },
- activeMenu: function (state) {
- var self$$1 = this;
- global$9(self$$1.getEl().lastChild).toggleClass(self$$1.classPrefix + 'active', state);
- },
- renderHtml: function () {
- var self$$1 = this;
- var id = self$$1._id;
- var prefix = self$$1.classPrefix;
- var image;
- var icon = self$$1.state.get('icon');
- var text = self$$1.state.get('text');
- var settings = self$$1.settings;
- var textHtml = '', ariaPressed;
- image = settings.image;
- if (image) {
- icon = 'none';
- if (typeof image !== 'string') {
- image = window.getSelection ? image[0] : image[1];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var SplitButton = MenuButton.extend({
+ Defaults: {
+ classes: 'widget btn splitbtn',
+ role: 'button'
+ },
+ repaint: function () {
+ var self$$1 = this;
+ var elm = self$$1.getEl();
+ var rect = self$$1.layoutRect();
+ var mainButtonElm, menuButtonElm;
+ self$$1._super();
+ mainButtonElm = elm.firstChild;
+ menuButtonElm = elm.lastChild;
+ global$9(mainButtonElm).css({
+ width: rect.w - funcs.getSize(menuButtonElm).width,
+ height: rect.h - 2
+ });
+ global$9(menuButtonElm).css({ height: rect.h - 2 });
+ return self$$1;
+ },
+ activeMenu: function (state) {
+ var self$$1 = this;
+ global$9(self$$1.getEl().lastChild).toggleClass(self$$1.classPrefix + 'active', state);
+ },
+ renderHtml: function () {
+ var self$$1 = this;
+ var id = self$$1._id;
+ var prefix = self$$1.classPrefix;
+ var image;
+ var icon = self$$1.state.get('icon');
+ var text = self$$1.state.get('text');
+ var settings = self$$1.settings;
+ var textHtml = '', ariaPressed;
+ image = settings.image;
+ if (image) {
+ icon = 'none';
+ if (typeof image !== 'string') {
+ image = window.getSelection ? image[0] : image[1];
+ }
+ image = ' style="background-image: url(\'' + image + '\')"';
+ } else {
+ image = '';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- image = ' style="background-image: url(\'' + image + '\')"';
- } else {
- image = '';
- }
- icon = settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
- if (text) {
- self$$1.classes.add('btn-has-text');
- textHtml = '<span class="' + prefix + 'txt">' + self$$1.encode(text) + '</span>';
- }
- ariaPressed = typeof settings.active === 'boolean' ? ' aria-pressed="' + settings.active + '"' : '';
- return '<div id="' + id + '" class="' + self$$1.classes + '" role="button"' + ariaPressed + ' tabindex="-1">' + '<button type="button" hidefocus="1" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + textHtml + '</button>' + '<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' + (self$$1._menuBtnText ? (icon ? '\xA0' : '') + self$$1._menuBtnText : '') + ' <i class="' + prefix + 'caret"></i>' + '</button>' + '</div>';
- },
- postRender: function () {
- var self$$1 = this, onClickHandler = self$$1.settings.onclick;
- self$$1.on('click', function (e) {
- var node = e.target;
- if (e.control === this) {
- while (node) {
- if (e.aria && e.aria.key !== 'down' || node.nodeName === 'BUTTON' && node.className.indexOf('open') === -1) {
- e.stopImmediatePropagation();
- if (onClickHandler) {
- onClickHandler.call(this, e);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ icon = settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : '';
+ if (text) {
+ self$$1.classes.add('btn-has-text');
+ textHtml = '<span class="' + prefix + 'txt">' + self$$1.encode(text) + '</span>';
+ }
+ ariaPressed = typeof settings.active === 'boolean' ? ' aria-pressed="' + settings.active + '"' : '';
+ return '<div id="' + id + '" class="' + self$$1.classes + '" role="button"' + ariaPressed + ' tabindex="-1">' + '<button type="button" hidefocus="1" tabindex="-1">' + (icon ? '<i class="' + icon + '"' + image + '></i>' : '') + textHtml + '</button>' + '<button type="button" class="' + prefix + 'open" hidefocus="1" tabindex="-1">' + (self$$1._menuBtnText ? (icon ? '\xA0' : '') + self$$1._menuBtnText : '') + ' <i class="' + prefix + 'caret"></i>' + '</button>' + '</div>';
+ },
+ postRender: function () {
+ var self$$1 = this, onClickHandler = self$$1.settings.onclick;
+ self$$1.on('click', function (e) {
+ var node = e.target;
+ if (e.control === this) {
+ while (node) {
+ if (e.aria && e.aria.key !== 'down' || node.nodeName === 'BUTTON' && node.className.indexOf('open') === -1) {
+ e.stopImmediatePropagation();
+ if (onClickHandler) {
+ onClickHandler.call(this, e);
+ }
+ 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;
</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">- node = node.parentNode;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- });
- delete self$$1.settings.onclick;
- return self$$1._super();
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ delete self$$1.settings.onclick;
+ return self$$1._super();
+ }
+ });
</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 StackLayout = FlowLayout.extend({
- Defaults: {
- containerClass: 'stack-layout',
- controlClass: 'stack-layout-item',
- endClass: 'break'
- },
- isNative: function () {
- return true;
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var StackLayout = FlowLayout.extend({
+ Defaults: {
+ containerClass: 'stack-layout',
+ controlClass: 'stack-layout-item',
+ endClass: 'break'
+ },
+ isNative: function () {
+ 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">- var TabPanel = Panel.extend({
- Defaults: {
- layout: 'absolute',
- defaults: { type: 'panel' }
- },
- activateTab: function (idx) {
- var activeTabElm;
- if (this.activeTabId) {
- activeTabElm = this.getEl(this.activeTabId);
- global$9(activeTabElm).removeClass(this.classPrefix + 'active');
- activeTabElm.setAttribute('aria-selected', 'false');
- }
- this.activeTabId = 't' + idx;
- activeTabElm = this.getEl('t' + idx);
- activeTabElm.setAttribute('aria-selected', 'true');
- global$9(activeTabElm).addClass(this.classPrefix + 'active');
- this.items()[idx].show().fire('showtab');
- this.reflow();
- this.items().each(function (item, i) {
- if (idx !== i) {
- item.hide();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var TabPanel = Panel.extend({
+ Defaults: {
+ layout: 'absolute',
+ defaults: { type: 'panel' }
+ },
+ activateTab: function (idx) {
+ var activeTabElm;
+ if (this.activeTabId) {
+ activeTabElm = this.getEl(this.activeTabId);
+ global$9(activeTabElm).removeClass(this.classPrefix + 'active');
+ activeTabElm.setAttribute('aria-selected', '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">- });
- },
- renderHtml: function () {
- var self = this;
- var layout = self._layout;
- var tabsHtml = '';
- var prefix = self.classPrefix;
- self.preRender();
- layout.preRender(self);
- self.items().each(function (ctrl, i) {
- var id = self._id + '-t' + i;
- ctrl.aria('role', 'tabpanel');
- ctrl.aria('labelledby', id);
- tabsHtml += '<div id="' + id + '" class="' + prefix + 'tab" ' + 'unselectable="on" role="tab" aria-controls="' + ctrl._id + '" aria-selected="false" tabIndex="-1">' + self.encode(ctrl.settings.title) + '</div>';
- });
- return '<div id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1">' + '<div id="' + self._id + '-head" class="' + prefix + 'tabs" role="tablist">' + tabsHtml + '</div>' + '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + layout.renderHtml(self) + '</div>' + '</div>';
- },
- postRender: function () {
- var self = this;
- self._super();
- self.settings.activeTab = self.settings.activeTab || 0;
- self.activateTab(self.settings.activeTab);
- this.on('click', function (e) {
- var targetParent = e.target.parentNode;
- if (targetParent && targetParent.id === self._id + '-head') {
- var i = targetParent.childNodes.length;
- while (i--) {
- if (targetParent.childNodes[i] === e.target) {
- self.activateTab(i);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.activeTabId = 't' + idx;
+ activeTabElm = this.getEl('t' + idx);
+ activeTabElm.setAttribute('aria-selected', 'true');
+ global$9(activeTabElm).addClass(this.classPrefix + 'active');
+ this.items()[idx].show().fire('showtab');
+ this.reflow();
+ this.items().each(function (item, i) {
+ if (idx !== i) {
+ item.hide();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- });
- },
- initLayoutRect: function () {
- var self = this;
- var rect, minW, minH;
- minW = funcs.getSize(self.getEl('head')).width;
- minW = minW < 0 ? 0 : minW;
- minH = 0;
- self.items().each(function (item) {
- minW = Math.max(minW, item.layoutRect().minW);
- minH = Math.max(minH, item.layoutRect().minH);
- });
- self.items().each(function (ctrl) {
- ctrl.settings.x = 0;
- ctrl.settings.y = 0;
- ctrl.settings.w = minW;
- ctrl.settings.h = minH;
- ctrl.layoutRect({
- x: 0,
- y: 0,
- w: minW,
- h: minH
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- var headH = funcs.getSize(self.getEl('head')).height;
- self.settings.minWidth = minW;
- self.settings.minHeight = minH + headH;
- rect = self._super();
- rect.deltaH += headH;
- rect.innerH = rect.h - rect.deltaH;
- return rect;
- }
- });
-
- var TextBox = Widget.extend({
- init: function (settings) {
- var self$$1 = this;
- self$$1._super(settings);
- self$$1.classes.add('textbox');
- if (settings.multiline) {
- self$$1.classes.add('multiline');
- } else {
- self$$1.on('keydown', function (e) {
- var rootControl;
- if (e.keyCode === 13) {
- e.preventDefault();
- self$$1.parents().reverse().each(function (ctrl) {
- if (ctrl.toJSON) {
- rootControl = ctrl;
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ renderHtml: function () {
+ var self = this;
+ var layout = self._layout;
+ var tabsHtml = '';
+ var prefix = self.classPrefix;
+ self.preRender();
+ layout.preRender(self);
+ self.items().each(function (ctrl, i) {
+ var id = self._id + '-t' + i;
+ ctrl.aria('role', 'tabpanel');
+ ctrl.aria('labelledby', id);
+ tabsHtml += '<div id="' + id + '" class="' + prefix + 'tab" ' + 'unselectable="on" role="tab" aria-controls="' + ctrl._id + '" aria-selected="false" tabIndex="-1">' + self.encode(ctrl.settings.title) + '</div>';
+ });
+ return '<div id="' + self._id + '" class="' + self.classes + '" hidefocus="1" tabindex="-1">' + '<div id="' + self._id + '-head" class="' + prefix + 'tabs" role="tablist">' + tabsHtml + '</div>' + '<div id="' + self._id + '-body" class="' + self.bodyClasses + '">' + layout.renderHtml(self) + '</div>' + '</div>';
+ },
+ postRender: function () {
+ var self = this;
+ self._super();
+ self.settings.activeTab = self.settings.activeTab || 0;
+ self.activateTab(self.settings.activeTab);
+ this.on('click', function (e) {
+ var targetParent = e.target.parentNode;
+ if (targetParent && targetParent.id === self._id + '-head') {
+ var i = targetParent.childNodes.length;
+ while (i--) {
+ if (targetParent.childNodes[i] === e.target) {
+ self.activateTab(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">- });
- self$$1.fire('submit', { data: rootControl.toJSON() });
</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><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.on('keyup', function (e) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ initLayoutRect: function () {
+ var self = this;
+ var rect, minW, minH;
+ minW = funcs.getSize(self.getEl('head')).width;
+ minW = minW < 0 ? 0 : minW;
+ minH = 0;
+ self.items().each(function (item) {
+ minW = Math.max(minW, item.layoutRect().minW);
+ minH = Math.max(minH, item.layoutRect().minH);
+ });
+ self.items().each(function (ctrl) {
+ ctrl.settings.x = 0;
+ ctrl.settings.y = 0;
+ ctrl.settings.w = minW;
+ ctrl.settings.h = minH;
+ ctrl.layoutRect({
+ x: 0,
+ y: 0,
+ w: minW,
+ h: minH
+ });
+ });
+ var headH = funcs.getSize(self.getEl('head')).height;
+ self.settings.minWidth = minW;
+ self.settings.minHeight = minH + headH;
+ rect = self._super();
+ rect.deltaH += headH;
+ rect.innerH = rect.h - rect.deltaH;
+ return rect;
+ }
+ });
+
+ var TextBox = Widget.extend({
+ init: function (settings) {
+ var self$$1 = this;
+ self$$1._super(settings);
+ self$$1.classes.add('textbox');
+ if (settings.multiline) {
+ self$$1.classes.add('multiline');
+ } else {
+ self$$1.on('keydown', function (e) {
+ var rootControl;
+ if (e.keyCode === 13) {
+ e.preventDefault();
+ self$$1.parents().reverse().each(function (ctrl) {
+ if (ctrl.toJSON) {
+ rootControl = ctrl;
+ return false;
+ }
+ });
+ self$$1.fire('submit', { data: rootControl.toJSON() });
+ }
+ });
+ self$$1.on('keyup', function (e) {
+ self$$1.state.set('value', e.target.value);
+ });
+ }
+ },
+ repaint: function () {
+ var self$$1 = this;
+ var style, rect, borderBox, borderW, borderH = 0, lastRepaintRect;
+ style = self$$1.getEl().style;
+ rect = self$$1._layoutRect;
+ lastRepaintRect = self$$1._lastRepaintRect || {};
+ var doc = document;
+ if (!self$$1.settings.multiline && doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
+ style.lineHeight = rect.h - borderH + 'px';
+ }
+ borderBox = self$$1.borderBox;
+ borderW = borderBox.left + borderBox.right + 8;
+ borderH = borderBox.top + borderBox.bottom + (self$$1.settings.multiline ? 8 : 0);
+ if (rect.x !== lastRepaintRect.x) {
+ style.left = rect.x + 'px';
+ lastRepaintRect.x = rect.x;
+ }
+ if (rect.y !== lastRepaintRect.y) {
+ style.top = rect.y + 'px';
+ lastRepaintRect.y = rect.y;
+ }
+ if (rect.w !== lastRepaintRect.w) {
+ style.width = rect.w - borderW + 'px';
+ lastRepaintRect.w = rect.w;
+ }
+ if (rect.h !== lastRepaintRect.h) {
+ style.height = rect.h - borderH + 'px';
+ lastRepaintRect.h = rect.h;
+ }
+ self$$1._lastRepaintRect = lastRepaintRect;
+ self$$1.fire('repaint', {}, false);
+ return self$$1;
+ },
+ renderHtml: function () {
+ var self$$1 = this;
+ var settings = self$$1.settings;
+ var attrs, elm;
+ attrs = {
+ id: self$$1._id,
+ hidefocus: '1'
+ };
+ global$2.each([
+ 'rows',
+ 'spellcheck',
+ 'maxLength',
+ 'size',
+ 'readonly',
+ 'min',
+ 'max',
+ 'step',
+ 'list',
+ 'pattern',
+ 'placeholder',
+ 'required',
+ 'multiple'
+ ], function (name$$1) {
+ attrs[name$$1] = settings[name$$1];
+ });
+ if (self$$1.disabled()) {
+ attrs.disabled = 'disabled';
+ }
+ if (settings.subtype) {
+ attrs.type = settings.subtype;
+ }
+ elm = funcs.create(settings.multiline ? 'textarea' : 'input', attrs);
+ elm.value = self$$1.state.get('value');
+ elm.className = self$$1.classes.toString();
+ return elm.outerHTML;
+ },
+ value: function (value) {
+ if (arguments.length) {
+ this.state.set('value', value);
+ return this;
+ }
+ if (this.state.get('rendered')) {
+ this.state.set('value', this.getEl().value);
+ }
+ return this.state.get('value');
+ },
+ postRender: function () {
+ var self$$1 = this;
+ self$$1.getEl().value = self$$1.state.get('value');
+ self$$1._super();
+ self$$1.$el.on('change', function (e) {
</ins><span class="cx" style="display: block; padding: 0 10px"> self$$1.state.set('value', e.target.value);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.fire('change', e);
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ bindStates: function () {
+ var self$$1 = this;
+ self$$1.state.on('change:value', function (e) {
+ if (self$$1.getEl().value !== e.value) {
+ self$$1.getEl().value = e.value;
+ }
+ });
+ self$$1.state.on('change:disabled', function (e) {
+ self$$1.getEl().disabled = e.value;
+ });
+ return self$$1._super();
+ },
+ remove: function () {
+ this.$el.off();
+ this._super();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- },
- repaint: function () {
- var self$$1 = this;
- var style, rect, borderBox, borderW, borderH = 0, lastRepaintRect;
- style = self$$1.getEl().style;
- rect = self$$1._layoutRect;
- lastRepaintRect = self$$1._lastRepaintRect || {};
- var doc = document;
- if (!self$$1.settings.multiline && doc.all && (!doc.documentMode || doc.documentMode <= 8)) {
- style.lineHeight = rect.h - borderH + 'px';
- }
- borderBox = self$$1.borderBox;
- borderW = borderBox.left + borderBox.right + 8;
- borderH = borderBox.top + borderBox.bottom + (self$$1.settings.multiline ? 8 : 0);
- if (rect.x !== lastRepaintRect.x) {
- style.left = rect.x + 'px';
- lastRepaintRect.x = rect.x;
- }
- if (rect.y !== lastRepaintRect.y) {
- style.top = rect.y + 'px';
- lastRepaintRect.y = rect.y;
- }
- if (rect.w !== lastRepaintRect.w) {
- style.width = rect.w - borderW + 'px';
- lastRepaintRect.w = rect.w;
- }
- if (rect.h !== lastRepaintRect.h) {
- style.height = rect.h - borderH + 'px';
- lastRepaintRect.h = rect.h;
- }
- self$$1._lastRepaintRect = lastRepaintRect;
- self$$1.fire('repaint', {}, false);
- return self$$1;
- },
- renderHtml: function () {
- var self$$1 = this;
- var settings = self$$1.settings;
- var attrs, elm;
- attrs = {
- id: self$$1._id,
- hidefocus: '1'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+
+ var getApi = function () {
+ return {
+ Selector: Selector,
+ Collection: Collection$2,
+ ReflowQueue: ReflowQueue,
+ Control: Control$1,
+ Factory: global$4,
+ KeyboardNavigation: KeyboardNavigation,
+ Container: Container,
+ DragHelper: DragHelper,
+ Scrollable: Scrollable,
+ Panel: Panel,
+ Movable: Movable,
+ Resizable: Resizable,
+ FloatPanel: FloatPanel,
+ Window: Window$$1,
+ MessageBox: MessageBox,
+ Tooltip: Tooltip,
+ Widget: Widget,
+ Progress: Progress,
+ Notification: Notification,
+ Layout: Layout,
+ AbsoluteLayout: AbsoluteLayout,
+ Button: Button,
+ ButtonGroup: ButtonGroup,
+ Checkbox: Checkbox,
+ ComboBox: ComboBox,
+ ColorBox: ColorBox,
+ PanelButton: PanelButton,
+ ColorButton: ColorButton,
+ ColorPicker: ColorPicker,
+ Path: Path,
+ ElementPath: ElementPath,
+ FormItem: FormItem,
+ Form: Form,
+ FieldSet: FieldSet,
+ FilePicker: FilePicker,
+ FitLayout: FitLayout,
+ FlexLayout: FlexLayout,
+ FlowLayout: FlowLayout,
+ FormatControls: FormatControls,
+ GridLayout: GridLayout,
+ Iframe: Iframe$1,
+ InfoBox: InfoBox,
+ Label: Label,
+ Toolbar: Toolbar$1,
+ MenuBar: MenuBar,
+ MenuButton: MenuButton,
+ MenuItem: MenuItem,
+ Throbber: Throbber,
+ Menu: Menu,
+ ListBox: ListBox,
+ Radio: Radio,
+ ResizeHandle: ResizeHandle,
+ SelectBox: SelectBox,
+ Slider: Slider,
+ Spacer: Spacer,
+ SplitButton: SplitButton,
+ StackLayout: StackLayout,
+ TabPanel: TabPanel,
+ TextBox: TextBox,
+ DropZone: DropZone,
+ BrowseButton: BrowseButton
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- global$2.each([
- 'rows',
- 'spellcheck',
- 'maxLength',
- 'size',
- 'readonly',
- 'min',
- 'max',
- 'step',
- 'list',
- 'pattern',
- 'placeholder',
- 'required',
- 'multiple'
- ], function (name$$1) {
- attrs[name$$1] = settings[name$$1];
- });
- if (self$$1.disabled()) {
- attrs.disabled = 'disabled';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var appendTo = function (target) {
+ if (target.ui) {
+ global$2.each(getApi(), function (ref, key) {
+ target.ui[key] = ref;
+ });
+ } else {
+ target.ui = getApi();
</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.subtype) {
- attrs.type = settings.subtype;
- }
- elm = funcs.create(settings.multiline ? 'textarea' : 'input', attrs);
- elm.value = self$$1.state.get('value');
- elm.className = self$$1.classes.toString();
- return elm.outerHTML;
- },
- value: function (value) {
- if (arguments.length) {
- this.state.set('value', value);
- return this;
- }
- if (this.state.get('rendered')) {
- this.state.set('value', this.getEl().value);
- }
- return this.state.get('value');
- },
- postRender: function () {
- var self$$1 = this;
- self$$1.getEl().value = self$$1.state.get('value');
- self$$1._super();
- self$$1.$el.on('change', function (e) {
- self$$1.state.set('value', e.target.value);
- self$$1.fire('change', e);
- });
- },
- bindStates: function () {
- var self$$1 = this;
- self$$1.state.on('change:value', function (e) {
- if (self$$1.getEl().value !== e.value) {
- self$$1.getEl().value = e.value;
- }
- });
- self$$1.state.on('change:disabled', function (e) {
- self$$1.getEl().disabled = e.value;
- });
- return self$$1._super();
- },
- remove: function () {
- this.$el.off();
- this._super();
- }
- });
-
- var getApi = function () {
- return {
- Selector: Selector,
- Collection: Collection$2,
- ReflowQueue: $_p42hyuxjjgwefrk,
- Control: Control$1,
- Factory: global$4,
- KeyboardNavigation: KeyboardNavigation,
- Container: Container,
- DragHelper: DragHelper,
- Scrollable: $_3rxloyuzjjgwefrs,
- Panel: Panel,
- Movable: $_3fnh5iukjjgwefpt,
- Resizable: $_3m7770v1jjgwefrz,
- FloatPanel: FloatPanel,
- Window: Window$$1,
- MessageBox: MessageBox,
- Tooltip: Tooltip,
- Widget: Widget,
- Progress: Progress,
- Notification: Notification,
- Layout: Layout,
- AbsoluteLayout: AbsoluteLayout,
- Button: Button,
- ButtonGroup: ButtonGroup,
- Checkbox: Checkbox,
- ComboBox: ComboBox,
- ColorBox: ColorBox,
- PanelButton: PanelButton,
- ColorButton: ColorButton,
- ColorPicker: ColorPicker,
- Path: Path,
- ElementPath: ElementPath,
- FormItem: FormItem,
- Form: Form,
- FieldSet: FieldSet,
- FilePicker: FilePicker,
- FitLayout: FitLayout,
- FlexLayout: FlexLayout,
- FlowLayout: FlowLayout,
- FormatControls: $_5heykgwxjjgwefyx,
- GridLayout: GridLayout,
- Iframe: Iframe$1,
- InfoBox: InfoBox,
- Label: Label,
- Toolbar: Toolbar$1,
- MenuBar: MenuBar,
- MenuButton: MenuButton,
- MenuItem: MenuItem,
- Throbber: Throbber,
- Menu: Menu,
- ListBox: ListBox,
- Radio: Radio,
- ResizeHandle: ResizeHandle,
- SelectBox: SelectBox,
- Slider: Slider,
- Spacer: Spacer,
- SplitButton: SplitButton,
- StackLayout: StackLayout,
- TabPanel: TabPanel,
- TextBox: TextBox,
- DropZone: DropZone,
- BrowseButton: BrowseButton
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var appendTo = function (target) {
- if (target.ui) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var registerToFactory = function () {
</ins><span class="cx" style="display: block; padding: 0 10px"> global$2.each(getApi(), function (ref, key) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- target.ui[key] = ref;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global$4.add(key, ref);
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- target.ui = getApi();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var Api = {
+ appendTo: appendTo,
+ registerToFactory: registerToFactory
+ };
+
+ Api.registerToFactory();
+ Api.appendTo(window.tinymce ? window.tinymce : {});
+ global.add('modern', function (editor) {
+ FormatControls.setup(editor);
+ return ThemeApi.get(editor);
+ });
+ function Theme () {
</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 registerToFactory = function () {
- global$2.each(getApi(), function (ref, key) {
- global$4.add(key, ref);
- });
- };
- var Api = {
- appendTo: appendTo,
- registerToFactory: registerToFactory
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- Api.registerToFactory();
- Api.appendTo(window.tinymce ? window.tinymce : {});
- global.add('modern', function (editor) {
- $_5heykgwxjjgwefyx.setup(editor);
- return $_buaxbttqjjgwefn0.get(editor);
- });
- function Theme () {
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Theme;
</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 Theme;
-
</del><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="trunksrcjs_enqueuesvendortinymcethemesmodernthememinjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/themes/modern/theme.min.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/themes/modern/theme.min.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/themes/modern/theme.min.js 2019-01-29 20:18:33 UTC (rev 44713)
</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(){"use strict";var e,t,n,i,r,o=tinymce.util.Tools.resolve("tinymce.ThemeManager"),h=tinymce.util.Tools.resolve("tinymce.EditorManager"),w=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=function(e){return!1!==c(e)},c=function(e){return e.getParam("menubar")},f=function(e){return e.getParam("toolbar_items_size")},m=function(e){return e.getParam("menu")},g=function(e){return!1===e.settings.skin},p=function(e){var t=e.getParam("resize","vertical");return!1===t?"none":"both"===t?"both":"vertical"},v=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),b=tinymce.util.Tools.resolve("tinymce.ui.Factory"),y=tinymce.util.Tools.resolve("tinymce.util.I18n"),s=function(e){return e.fire("SkinLoaded")},x=function(e){return
e.fire("ResizeEditor")},_=function(e){return e.fire("BeforeRenderUI")},a=function(t,n){return function(){var e=t.find(n)[0];e&&e.focus(!0)}},C=function(e,t){e.shortcuts.add("Alt+F9","",a(t,"menubar")),e.shortcuts.add("Alt+F10,F10","",a(t,"toolbar")),e.shortcuts.add("Alt+F11","",a(t,"elementpath")),t.on("cancel",function(){e.focus()})},R=tinymce.util.Tools.resolve("tinymce.geom.Rect"),u=tinymce.util.Tools.resolve("tinymce.util.Delay"),E=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},k=function(e){return function(){return e}},l=k(!1),T=k(!0),H=l,S=T,M=function(){return N},N=(i={fold:function(e,t){return e()},is:H,isSome:H,isNone:S,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null}
,getOrUndefined:function(){return undefined},or:n,orThunk:t,map:M,ap:M,each:function(){},bind:M,flatten:M,exists:H,forall:S,filter:M,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:k("none()")},Object.freeze&&Object.freeze(i),i),P=function(n){var e=function(){return n},t=function(){return r},i=function(e){return e(n)},r={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:S,isNone:H,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return P(e(n))},ap:function(e){return e.fold(M,function(e){return P(e(n))})},each:function(e){e(n)},bind:i,flatten:e,exists:i,forall:i,filter:function(e){return e(n)?r:N},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(H,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return r},D={some:P,none:M,from:function(e){return null===e||e===undefined?N:P(e
)}},W=function(e){return e?e.getRoot().uiContainer:null},O={getUiContainerDelta:function(e){var t=W(e);if(t&&"static"!==v.DOM.getStyle(t,"position",!0)){var n=v.DOM.getPos(t),i=t.scrollLeft-n.x,r=t.scrollTop-n.y;return D.some({x:i,y:r})}return D.none()},setUiContainer:function(e,t){var n=v.DOM.select(e.settings.ui_container)[0];t.getRoot().uiContainer=n},getUiContainer:W,inheritUiContainer:function(e,t){return t.uiContainer=W(e)}},A=function(i,e,r){var o,s=[];if(e)return w.each(e.split(/[ ,]/),function(t){var e,n=function(){var e=i.selection;t.settings.stateSelector&&e.selectorChanged(t.settings.stateSelector,function(e){t.active(e)},!0),t.settings.disabledStateSelector&&e.selectorChanged(t.settings.disabledStateSelector,function(e){t.disabled(e)})};"|"===t?o=null:(o||(o={type:"buttongroup",items:[]},s.push(o)),i.buttons[t]&&(e=t,"function"==typeof(t=i.buttons[e])&&(t=t()),t.type=t.type||"
button",t.size=r,t=b.create(t),o.items.push(t),i.initialized?n():i.on("init",n)))}),{type:"toolbar",layout:"flow",items:s}},B=A,L=function(n,i){var e,t,r=[];if(w.each(!1===(t=(e=n).getParam("toolbar"))?[]:w.isArray(t)?w.grep(t,function(e){return 0<e.length}):function(e,t){for(var n=[],i=1;i<10;i++){var r=e["toolbar"+i];if(!r)break;n.push(r)}var o=e.toolbar?[e.toolbar]:[t];return 0<n.length?n:o}(e.settings,"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"),function(e){var t;(t=e)&&r.push(A(n,t,i))}),r.length)return{type:"panel",layout:"stack",classes:"toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:r}},I=v.DOM,z=function(e){return{left:e.x,top:e.y,width:e.w,height:e.h,right:e.x+e.w,bottom:e.y+e.h}},F=function(e,t){e.moveTo(t.left,t.top)},U=function(e,t,n,i,r,o){return o=z({x:t,y:n,w:o.w,h:o.h
}),e&&(o=e({elementRect:z(i),contentAreaRect:z(r),panelRect:o})),o},V=function(x){var i,o=function(){return x.contextToolbars||[]},n=function(e,t){var n,i,r,o,s,a,l,u=x.getParam("inline_toolbar_position_handler");if(!x.removed){if(!e||!e.toolbar.panel)return c=x,void w.each(c.contextToolbars,function(e){e.panel&&e.panel.hide()});var c,d,f,h,m;l=["bc-tc","tc-bc","tl-bl","bl-tl","tr-br","br-tr"],s=e.toolbar.panel,t&&s.show(),d=e.element,f=I.getPos(x.getContentAreaContainer()),h=x.dom.getRect(d),"BODY"===(m=x.dom.getRoot()).nodeName&&(h.x-=m.ownerDocument.documentElement.scrollLeft||m.scrollLeft,h.y-=m.ownerDocument.documentElement.scrollTop||m.scrollTop),h.x+=f.x,h.y+=f.y,r=h,i=I.getRect(s.getEl()),o=I.getRect(x.getContentAreaContainer()||x.getBody());var g,p,v,b=O.getUiContainerDelta(s).getOr({x:0,y:0});if(r.x+=b.x,r.y+=b.y,i.x+=b.x,i.y+=b.y,o.x+=b.x,o.y+=b.y,"inline&q
uot;!==I.getStyle(e.element,"display",!0)){var y=e.element.getBoundingClientRect();r.w=y.width,r.h=y.height}x.inline||(o.w=x.getDoc().documentElement.offsetWidth),x.selection.controlSelection.isResizable(e.element)&&r.w<25&&(r=R.inflate(r,0,8)),n=R.findBestRelativePosition(i,r,o,l),r=R.clamp(r,o),n?(a=R.relativePosition(i,r,n),F(s,U(u,a.x,a.y,r,o,i))):(o.h+=i.h,(r=R.intersect(o,r))?(n=R.findBestRelativePosition(i,r,o,["bc-tc","bl-tl","br-tr"]))?(a=R.relativePosition(i,r,n),F(s,U(u,a.x,a.y,r,o,i))):F(s,U(u,r.x,r.y,r,o,i)):s.hide()),g=s,v=function(e,t){return e===t},p=(p=n)?p.substr(0,2):"",w.each({t:"down",b:"up"},function(e,t){g.classes.toggle("arrow-"+e,v(t,p.substr(0,1)))}),w.each({l:"left",r:"right"},function(e,t){g.classes.toggle("arrow-"+e,v(t,p.substr(1,1)))})}},r=function(e){return function(){u.requestAnimationFrame(function(){x.selection&&n
(a(x.selection.getNode()),e)})}},t=function(e){var t;if(e.toolbar.panel)return e.toolbar.panel.show(),void n(e);t=b.create({type:"floatpanel",role:"dialog",classes:"tinymce tinymce-inline arrow",ariaLabel:"Inline toolbar",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!0,border:1,items:B(x,e.toolbar.items),oncancel:function(){x.focus()}}),O.setUiContainer(x,t),function(e){if(!i){var t=r(!0),n=O.getUiContainer(e);i=x.selection.getScrollContainer()||x.getWin(),I.bind(i,"scroll",t),I.bind(n,"scroll",t),x.on("remove",function(){I.unbind(i,"scroll",t),I.unbind(n,"scroll",t)})}}(t),(e.toolbar.panel=t).renderTo().reflow(),n(e)},s=function(){w.each(o(),function(e){e.panel&&e.panel.hide()})},a=function(e){var t,n,i,r=o();for(t=(i=x.$(e).parents().add(e)).length-1;0<=t;t--)for(n=r.length-1;0<=n;n--)if(r[n].predicate(i[t]))return{t
oolbar:r[n],element:i[t]};return null};x.on("click keyup setContent ObjectResized",function(e){("setcontent"!==e.type||e.selection)&&u.setEditorTimeout(x,function(){var e;(e=a(x.selection.getNode()))?(s(),t(e)):s()})}),x.on("blur hide contextmenu",s),x.on("ObjectResizeStart",function(){var e=a(x.selection.getNode());e&&e.toolbar.panel&&e.toolbar.panel.hide()}),x.on("ResizeEditor ResizeWindow",r(!0)),x.on("nodeChange",r(!1)),x.on("remove",function(){w.each(o(),function(e){e.panel&&e.panel.remove()}),x.contextToolbars={}}),x.shortcuts.add("ctrl+shift+e > ctrl+shift+p","",function(){var e=a(x.selection.getNode());e&&e.toolbar.panel&&e.toolbar.panel.items()[0].focus()})},Y=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"a
rray":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},$=Y("function"),X=Y("number"),q=(r=Array.prototype.indexOf)===undefined?function(e,t){return ee(e,t)}:function(e,t){return r.call(e,t)},j=function(e,t){return Q(e,t).isSome()},J=function(e,t){for(var n=e.length,i=new Array(n),r=0;r<n;r++){var o=e[r];i[r]=t(o,r,e)}return i},G=function(e,t){for(var n=0,i=e.length;n<i;n++)t(e[n],n,e)},K=function(e,t){for(var n=[],i=0,r=e.length;i<r;i++){var o=e[i];t(o,i,e)&&n.push(o)}return n},Z=function(e,t){for(var n=0,i=e.length;n<i;n++){var r=e[n];if(t(r,n,e))return D.some(r)}return D.none()},Q=function(e,t){for(var n=0,i=e.length;n<i;n++)if(t(e[n],n,e))return D.some(n);return D.none()},ee=function(e,t){for(var n=0,i=e.length;n<i;++n)if(e[n]===t)return n;return-1},te=Array.prototype.push,ne=(Array.prototype.slice,$(Array.from)&&Array.from,{file:{title:"File",items:"newdocume
nt restoredraft | preview | print"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall"},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen"},insert:{title:"Insert",items:"image link media template codesample inserttable | charmap hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | blockformats align | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code"},table:{title:"Table"},help:{title:"Help"}}),ie=function(e,t){return"|"===e?{name:"|",item:{text:"|"}}:t?{name:e,item:t}:null},re=function(e){return e&&"|"===e.item.text},oe=function(n,e,t,i){var r,o,s,a,l,u,c;return e?(o=e[i],a=!0):o=ne[i],o
&&(r={text:o.title},s=[],w.each((o.items||"").split(/[ ,]/),function(e){var t=ie(e,n[e]);t&&s.push(t)}),a||w.each(n,function(e,t){var n;e.context!==i||(n=t,Q(s,function(e){return e.name===n}).isSome())||("before"===e.separator&&s.push({name:"|",item:{text:"|"}}),e.prependToContext?s.unshift(ie(t,e)):s.push(ie(t,e)),"after"===e.separator&&s.push({name:"|",item:{text:"|"}}))}),r.menu=J((l=t,u=K(s,function(e){return!1===l.hasOwnProperty(e.name)}),c=K(u,function(e,t,n){return!re(e)||!re(n[t-1])}),K(c,function(e,t,n){return!re(e)||0<t&&t<n.length-1})),function(e){return e.item}),!r.menu.length)?null:r},se=function(e){for(var t,n=[],i=function(e){var t,n=[],i=m(e);if(i)for(t in i)n.push(t);else for(t in ne)n.push(t);return n}(e),r=w.makeMap((t=e,t.getParam("removed_menuitems","")).split(/[ ,]/)),o=c(e),s="string"==typeof o?o.split(/[ ,]/):i,a=0;
a<s.length;a++){var l=s[a],u=oe(e.menuItems,m(e),r,l);u&&n.push(u)}return n},ae=v.DOM,le=function(e){return{width:e.clientWidth,height:e.clientHeight}},ue=function(e,t,n){var i,r,o,s;i=e.getContainer(),r=e.getContentAreaContainer().firstChild,o=le(i),s=le(r),null!==t&&(t=Math.max(e.getParam("min_width",100,"number"),t),t=Math.min(e.getParam("max_width",65535,"number"),t),ae.setStyle(i,"width",t+(o.width-s.width)),ae.setStyle(r,"width",t)),n=Math.max(e.getParam("min_height",100,"number"),n),n=Math.min(e.getParam("max_height",65535,"number"),n),ae.setStyle(r,"height",n),x(e)},ce=ue,de=function(e,t,n){var i=e.getContentAreaContainer();ue(e,i.clientWidth+t,i.clientHeight+n)},fe=tinymce.util.Tools.resolve("tinymce.Env"),he=function(e,t,n){var i,r=e.settings[n];r&&r((i=t.getEl("body"),{element:function(){return i}}))},me=function(c,d,
f){return function(e){var t,n,i,r,o,s=e.control,a=s.parents().filter("panel")[0],l=a.find("#"+d)[0],u=(t=f,n=d,w.grep(t,function(e){return e.name===n})[0]);i=d,r=a,o=f,w.each(o,function(e){var t=r.items().filter("#"+e.name)[0];t&&t.visible()&&e.name!==i&&(he(e,t,"onhide"),t.visible(!1))}),s.parent().items().each(function(e){e.active(!1)}),l&&l.visible()?(he(u,l,"onhide"),l.hide(),s.active(!1)):(l?l.show():(l=b.create({type:"container",name:d,layout:"stack",classes:"sidebar-panel",html:""}),a.prepend(l),he(u,l,"onrender")),he(u,l,"onshow"),s.active(!0)),x(c)}},ge=function(e){return!(fe.ie&&!(11<=fe.ie)||!e.sidebars)&&0<e.sidebars.length},pe=function(n){return{type:"panel",name:"sidebar",layout:"stack",classes:"sidebar",items:[{type:"toolbar",layout:"stack",classes
:"sidebar-toolbar",items:w.map(n.sidebars,function(e){var t=e.settings;return{type:"button",icon:t.icon,image:t.image,tooltip:t.tooltip,onclick:me(n,e.name,n.sidebars)}})}]}},ve=function(e){var t=function(){e._skinLoaded=!0,s(e)};return function(){e.initialized?t():e.on("init",t)}},be=v.DOM,ye=function(e){return{type:"panel",name:"iframe",layout:"stack",classes:"edit-area",border:e,html:""}},xe=function(t,e,n){var i,r,o,s,a;if(!1===g(t)&&n.skinUiCss?be.styleSheetLoader.load(n.skinUiCss,ve(t)):ve(t)(),i=e.panel=b.create({type:"panel",role:"application",classes:"tinymce",style:"visibility: hidden",layout:"stack",border:1,items:[{type:"container",classes:"top-part",items:[!1===d(t)?null:{type:"menubar",border:"0 0 1 0",items:se(t)},L(t,f(t))]},ge(t)?(s=t,{type:"panel",layout:"stack",classes:
"edit-aria-container",border:"1 0 0 0",items:[ye("0"),pe(s)]}):ye("1 0 0 0")]}),O.setUiContainer(t,i),"none"!==p(t)&&(r={type:"resizehandle",direction:p(t),onResizeStart:function(){var e=t.getContentAreaContainer().firstChild;o={width:e.clientWidth,height:e.clientHeight}},onResize:function(e){"both"===p(t)?ce(t,o.width+e.deltaX,o.height+e.deltaY):ce(t,null,o.height+e.deltaY)}}),t.getParam("statusbar",!0,"boolean")){var l=y.translate(["Powered by {0}",'<a href="https://www.tinymce.com/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce" rel="noopener" target="_blank" role="presentation" tabindex="-1">tinymce</a>']),u=t.getParam("branding",!0,"boolean")?{type:"label",classes:"branding",html:" "+l}:null;i.add({type:"panel",nam
e:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",ariaRoot:!0,items:[{type:"elementpath",editor:t},r,u]})}return _(t),t.on("SwitchMode",(a=i,function(e){a.find("*").disabled("readonly"===e.mode)})),i.renderBefore(n.targetNode).reflow(),t.getParam("readonly",!1,"boolean")&&t.setMode("readonly"),n.width&&be.setStyle(i.getEl(),"width",n.width),t.on("remove",function(){i.remove(),i=null}),C(t,i),V(t),{iframeContainer:i.find("#iframe")[0].getEl(),editorContainer:i.getEl()}},we=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),_e=0,Ce={id:function(){return"mceu_"+_e++},create:function(e,t,n){var i=document.createElement(e);return v.DOM.setAttribs(i,t),"string"==typeof n?i.innerHTML=n:w.each(n,function(e){e.nodeType&&i.appendChild(e)}),i},createFragment:function(e){return v.DOM.creat
eFragment(e)},getWindowSize:function(){return v.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var i=e.getBoundingClientRect();t=Math.max(i.width||i.right-i.left,e.offsetWidth),n=Math.max(i.height||i.bottom-i.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,t){return v.DOM.getPos(e,t||Ce.getContainer())},getContainer:function(){return fe.container?fe.container:document.body},getViewPort:function(e){return v.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,t){return v.DOM.addClass(e,t)},removeClass:function(e,t){return v.DOM.removeClass(e,t)},hasClass:function(e,t){return v.DOM.hasClass(e,t)},toggleClass:function(e,t,n){return v.DOM.toggleClass(e,t,n)},css:function(e,t,n){return v.DOM.setStyle(e,t,n)},getRuntimeStyle:function(e,t){return v.DOM.getStyle(e,t,!0)},on:function(e,t,n,i){return v.DOM.bind(e,t,n,i)},off:function(e,t,n){return v.DOM.unbind(e,t,n)},fir
e:function(e,t,n){return v.DOM.fire(e,t,n)},innerHtml:function(e,t){v.DOM.setHTML(e,t)}},Re=function(e){return"static"===Ce.getRuntimeStyle(e,"position")},Ee=function(e){return e.state.get("fixed")};function ke(e,t,n){var i,r,o,s,a,l,u,c,d,f;return d=Te(),o=(r=Ce.getPos(t,O.getUiContainer(e))).x,s=r.y,Ee(e)&&Re(document.body)&&(o-=d.x,s-=d.y),i=e.getEl(),a=(f=Ce.getSize(i)).width,l=f.height,u=(f=Ce.getSize(t)).width,c=f.height,"b"===(n=(n||"").split(""))[0]&&(s+=c),"r"===n[1]&&(o+=u),"c"===n[0]&&(s+=Math.round(c/2)),"c"===n[1]&&(o+=Math.round(u/2)),"b"===n[3]&&(s-=l),"r"===n[4]&&(o-=a),"c"===n[3]&&(s-=Math.round(l/2)),"c"===n[4]&&(o-=Math.round(a/2)),{x:o,y:s,w:a,h:l}}var Te=function(){var e=window,t=Math.max(e.pageXOffset,document.body.scrollLeft,document.documentElement.scro
llLeft),n=Math.max(e.pageYOffset,document.body.scrollTop,document.documentElement.scrollTop);return{x:t,y:n,w:t+(e.innerWidth||document.documentElement.clientWidth),h:n+(e.innerHeight||document.documentElement.clientHeight)}},He=function(e){var t,n=O.getUiContainer(e);return n&&!Ee(e)?{x:0,y:0,w:(t=n).scrollWidth-1,h:t.scrollHeight-1}:Te()},Se={testMoveRel:function(e,t){for(var n=He(this),i=0;i<t.length;i++){var r=ke(this,e,t[i]);if(Ee(this)){if(0<r.x&&r.x+r.w<n.w&&0<r.y&&r.y+r.h<n.h)return t[i]}else if(r.x>n.x&&r.x+r.w<n.w&&r.y>n.y&&r.y+r.h<n.h)return t[i]}return t[0]},moveRel:function(e,t){"string"!=typeof t&&(t=this.testMoveRel(e,t));var n=ke(this,e,t);return this.moveTo(n.x,n.y)},moveBy:function(e,t){var n=this.layoutRect();return this.moveTo(n.x+e,n.y+t),this},moveTo:function(e,t){var n=this;function i(e,t,n){return e<0?0:t<e+n&&(e=t-n)<0?0:e}if(n.settings.const
rainToViewport){var r=He(this),o=n.layoutRect();e=i(e,r.w,o.w),t=i(t,r.h,o.h)}var s=O.getUiContainer(n);return s&&Re(s)&&!Ee(n)&&(e-=s.scrollLeft,t-=s.scrollTop),s&&(e+=1,t+=1),n.state.get("rendered")?n.layoutRect({x:e,y:t}).repaint():(n.settings.x=e,n.settings.y=t),n.fire("move",{x:e,y:t}),n}},Me=tinymce.util.Tools.resolve("tinymce.util.Class"),Ne=tinymce.util.Tools.resolve("tinymce.util.EventDispatcher"),Pe=function(e){var t;if(e)return"number"==typeof e?{top:e=e||0,left:e,bottom:e,right:e}:(1===(t=(e=e.split(" ")).length)?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],10)||0,right:parseInt(e[1],10)||0,bottom:parseInt(e[2],10)||0,left:parseInt(e[3],10)||0})},De=function(i,e){function t(e){var t=parseFloat(function(e){var t=i.ownerDocument.defaultView;if(t){var n=t.getComputedStyle(i,null);return n?(e=e.replace(/[A-Z]/g,function(e){return"-
"+e}),n.getPropertyValue(e)):null}return i.currentStyle[e]}(e));return isNaN(t)?0:t}return{top:t(e+"TopWidth"),right:t(e+"RightWidth"),bottom:t(e+"BottomWidth"),left:t(e+"LeftWidth")}};function We(){}function Oe(e){this.cls=[],this.cls._map={},this.onchange=e||We,this.prefix=""}w.extend(Oe.prototype,{add:function(e){return e&&!this.contains(e)&&(this.cls._map[e]=!0,this.cls.push(e),this._change()),this},remove:function(e){if(this.contains(e)){var t=void 0;for(t=0;t<this.cls.length&&this.cls[t]!==e;t++);this.cls.splice(t,1),delete this.cls._map[e],this._change()}return this},toggle:function(e,t){var n=this.contains(e);return n!==t&&(n?this.remove(e):this.add(e),this._change()),this},contains:function(e){return!!this.cls._map[e]},_change:function(){delete this.clsValue,this.onchange.call(this)}}),Oe.prototype.toString=function(){var e;if(this.clsValue)return this.clsValue;e="";for(var t
=0;t<this.cls.length;t++)0<t&&(e+=" "),e+=this.prefix+this.cls[t];return e};var Ae,Be,Le,Ie=/^([\w\\*]+)?(?:#([\w\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,ze=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,Fe=/^\s*|\s*$/g,Ue=Me.extend({init:function(e){var o=this.match;function s(e,t,n){var i;function r(e){e&&t.push(e)}return r(function(t){if(t)return t=t.toLowerCase(),function(e){return"*"===t||e.type===t}}((i=Ie.exec(e.replace(Fe,"")))[1])),r(function(t){if(t)return function(e){return e._name===t}}(i[2])),r(function(n){if(n)return n=n.split("."),function(e){for(var t=n.length;t--;)if(!e.classes.contains(n[t]))return!1;return!0}}(i[3])),r(function(n,i,r){if(n)return function(e){var t=e[n]?e[n]():"";return i?"="===i?t===r:"*="===i?0<=t.i
ndexOf(r):"~="===i?0<=(" "+t+" ").indexOf(" "+r+" "):"!="===i?t!==r:"^="===i?0===t.indexOf(r):"$="===i&&t.substr(t.length-r.length)===r:!!r}}(i[4],i[5],i[6])),r(function(i){var t;if(i)return(i=/(?:not\((.+)\))|(.+)/i.exec(i))[1]?(t=a(i[1],[]),function(e){return!o(e,t)}):(i=i[2],function(e,t,n){return"first"===i?0===t:"last"===i?t===n-1:"even"===i?t%2==0:"odd"===i?t%2==1:!!e[i]&&e[i]()})}(i[7])),t.pseudo=!!i[7],t.direct=n,t}function a(e,t){var n,i,r,o=[];do{if(ze.exec(""),(i=ze.exec(e))&&(e=i[3],o.push(i[1]),i[2])){n=i[3];break}}while(i);for(n&&a(n,t),e=[],r=0;r<o.length;r++)">"!==o[r]&&e.push(s(o[r],[],">"===o[r-1]));return t.push(e),t}this._selectors=a(e,[])},match:function(e,t){var n,i,r,o,s,a,l,u,c,d,f,h,m;for(n=0,i=(t=t||this._selectors).length;n<i;n++){for(m=e,h=0,r=(o=(s=t[n]
).length)-1;0<=r;r--)for(u=s[r];m;){if(u.pseudo)for(c=d=(f=m.parent().items()).length;c--&&f[c]!==m;);for(a=0,l=u.length;a<l;a++)if(!u[a](m,c,d)){a=l+1;break}if(a===l){h++;break}if(r===o-1)break;m=m.parent()}if(h===o)return!0}return!1},find:function(e){var t,n,u=[],i=this._selectors;function c(e,t,n){var i,r,o,s,a,l=t[n];for(i=0,r=e.length;i<r;i++){for(a=e[i],o=0,s=l.length;o<s;o++)if(!l[o](a,i,r)){o=s+1;break}if(o===s)n===t.length-1?u.push(a):a.items&&c(a.items(),t,n+1);else if(l.direct)return;a.items&&c(a.items(),t,n)}}if(e.items){for(t=0,n=i.length;t<n;t++)c(e.items(),i[t],0);1<n&&(u=function(e){for(var t,n=[],i=e.length;i--;)(t=e[i]).__checked||(n.push(t),t.__checked=1);for(i=n.length;i--;)delete n[i].__checked;return n}(u))}return Ae||(Ae=Ue.Collection),new Ae(u)}}),Ve=Array.prototype.push,Ye=Array.prototype.slice;Le={length:0,init:function(e){e&&this.add(e)},add:function(e){return w.isArray(e)?Ve.apply(this,e):e instanc
eof Be?this.add(e.toArray()):Ve.call(this,e),this},set:function(e){var t,n=this,i=n.length;for(n.length=0,n.add(e),t=n.length;t<i;t++)delete n[t];return n},filter:function(t){var e,n,i,r,o=[];for("string"==typeof t?(t=new Ue(t),r=function(e){return t.match(e)}):r=t,e=0,n=this.length;e<n;e++)r(i=this[e])&&o.push(i);return new Be(o)},slice:function(){return new Be(Ye.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(e){return w.each(this,e),this},toArray:function(){return w.toArray(this)},indexOf:function(e){for(var t=this.length;t--&&this[t]!==e;);return t},reverse:function(){return new Be(w.toArray(this).reverse())},hasClass:function(e){return!!this[0]&&this[0].classes.contains(e)},prop:function(t,n){var e;return n!==undefined?(this.each(function(e){e[t]&&e[t](n)}),this):(e=this[0])&&e[t]?e[t]():void 0},exec:function(t){var n=w.toArray(arguments).slice(1);return this.each(functi
on(e){e[t]&&e[t].apply(e,n)}),this},remove:function(){for(var e=this.length;e--;)this[e].remove();return this},addClass:function(t){return this.each(function(e){e.classes.add(t)})},removeClass:function(t){return this.each(function(e){e.classes.remove(t)})}},w.each("fire on off show hide append prepend before after reflow".split(" "),function(n){Le[n]=function(){var t=w.toArray(arguments);return this.each(function(e){n in e&&e[n].apply(e,t)}),this}}),w.each("text name disabled active selected checked visible parent value data".split(" "),function(t){Le[t]=function(e){return this.prop(t,e)}}),Be=Me.extend(Le);var $e=Ue.Collection=Be,Xe=function(e){this.create=e.create};Xe.create=function(r,o){return new Xe({create:function(t,n){var i,e=function(e){t.set(n,e.value)};return t.on("change:"+n,function(e){r.set(o,e.value)}),r.on("change:"+o,e),(i=t._bindings)||(i=t._bindings=[],t.on("destroy",function(){f
or(var e=i.length;e--;)i[e]()})),i.push(function(){r.off("change:"+o,e)}),r.get(o)}})};var qe=tinymce.util.Tools.resolve("tinymce.util.Observable");function je(e){return 0<e.nodeType}var Je,Ge,Ke=Me.extend({Mixins:[qe],init:function(e){var t,n;for(t in e=e||{})(n=e[t])instanceof Xe&&(e[t]=n.create(this,t));this.data=e},set:function(t,n){var i,r,o=this.data[t];if(n instanceof Xe&&(n=n.create(this,t)),"object"==typeof t){for(i in t)this.set(i,t[i]);return this}return function e(t,n){var i,r;if(t===n)return!0;if(null===t||null===n)return t===n;if("object"!=typeof t||"object"!=typeof n)return t===n;if(w.isArray(n)){if(t.length!==n.length)return!1;for(i=t.length;i--;)if(!e(t[i],n[i]))return!1}if(je(t)||je(n))return t===n;for(i in r={},n){if(!e(t[i],n[i]))return!1;r[i]=!0}for(i in t)if(!r[i]&&!e(t[i],n[i]))return!1;return!0}(o,n)||(this.data[t]=n,r={target:this,name:t,value:n,oldValue:o},this.fire("change:&q
uot;+t,r),this.fire("change",r)),this},get:function(e){return this.data[e]},has:function(e){return e in this.data},bind:function(e){return Xe.create(this,e)},destroy:function(){this.fire("destroy")}}),Ze={},Qe={add:function(e){var t=e.parent();if(t){if(!t._layout||t._layout.isNative())return;Ze[t._id]||(Ze[t._id]=t),Je||(Je=!0,u.requestAnimationFrame(function(){var e,t;for(e in Je=!1,Ze)(t=Ze[e]).state.get("rendered")&&t.reflow();Ze={}},document.body))}},remove:function(e){Ze[e._id]&&delete Ze[e._id]}},et="onmousewheel"in document,tt=!1,nt=0,it={Statics:{classPrefix:"mce-"},isRtl:function(){return Ge.rtl},classPrefix:"mce-",init:function(t){var e,n,i=this;function r(e){var t;for(e=e.split(" "),t=0;t<e.length;t++)i.classes.add(e[t])}i.settings=t=w.extend({},i.Defaults,t),i._id=t.id||"mceu_"+nt++,i._aria={role:t.role},i._elmCache={},i.$=we,i.state=new Ke({visible:!0,active:!1,disabled:!1
,value:""}),i.data=new Ke(t.data),i.classes=new Oe(function(){i.state.get("rendered")&&(i.getEl().className=this.toString())}),i.classes.prefix=i.classPrefix,(e=t.classes)&&(i.Defaults&&(n=i.Defaults.classes)&&e!==n&&r(n),r(e)),w.each("title text name visible disabled active value".split(" "),function(e){e in t&&i[e](t[e])}),i.on("click",function(){if(i.disabled())return!1}),i.settings=t,i.borderBox=Pe(t.border),i.paddingBox=Pe(t.padding),i.marginBox=Pe(t.margin),t.hidden&&i.hide()},Properties:"parent,name",getContainerElm:function(){var e=O.getUiContainer(this);return e||Ce.getContainer()},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},initLayoutRect:function(){var e,t,n,i,r,o,s,a,l,u,c=this,d=c.settings,f=c.getEl();e=c.borderBox=c.borderBox||De(f,"border"),c.paddingBox=c.padd
ingBox||De(f,"padding"),c.marginBox=c.marginBox||De(f,"margin"),u=Ce.getSize(f),a=d.minWidth,l=d.minHeight,r=a||u.width,o=l||u.height,n=d.width,i=d.height,s=void 0!==(s=d.autoResize)?s:!n&&!i,n=n||r,i=i||o;var h=e.left+e.right,m=e.top+e.bottom,g=d.maxWidth||65535,p=d.maxHeight||65535;return c._layoutRect=t={x:d.x||0,y:d.y||0,w:n,h:i,deltaW:h,deltaH:m,contentW:n-h,contentH:i-m,innerW:n-h,innerH:i-m,startMinWidth:a||0,startMinHeight:l||0,minW:Math.min(r,g),minH:Math.min(o,p),maxW:g,maxH:p,autoResize:s,scrollW:0},c._lastLayoutRect={},t},layoutRect:function(e){var t,n,i,r,o,s=this,a=s._layoutRect;return a||(a=s.initLayoutRect()),e?(i=a.deltaW,r=a.deltaH,e.x!==undefined&&(a.x=e.x),e.y!==undefined&&(a.y=e.y),e.minW!==undefined&&(a.minW=e.minW),e.minH!==undefined&&(a.minH=e.minH),(n=e.w)!==undefined&&(n=(n=n<a.minW?a.minW:n)>a.maxW?a.maxW:n,a.w=n,a.innerW=n-i),(n=e.h)!==undefined&&(n=(n=n<a.minH?a.minH:n)&
gt;a.maxH?a.maxH:n,a.h=n,a.innerH=n-r),(n=e.innerW)!==undefined&&(n=(n=n<a.minW-i?a.minW-i:n)>a.maxW-i?a.maxW-i:n,a.innerW=n,a.w=n+i),(n=e.innerH)!==undefined&&(n=(n=n<a.minH-r?a.minH-r:n)>a.maxH-r?a.maxH-r:n,a.innerH=n,a.h=n+r),e.contentW!==undefined&&(a.contentW=e.contentW),e.contentH!==undefined&&(a.contentH=e.contentH),(t=s._lastLayoutRect).x===a.x&&t.y===a.y&&t.w===a.w&&t.h===a.h||((o=Ge.repaintControls)&&o.map&&!o.map[s._id]&&(o.push(s),o.map[s._id]=!0),t.x=a.x,t.y=a.y,t.w=a.w,t.h=a.h),s):a},repaint:function(){var e,t,n,i,r,o,s,a,l,u,c=this;l=document.createRange?function(e){return e}:Math.round,e=c.getEl().style,i=c._layoutRect,a=c._lastRepaintRect||{},o=(r=c.borderBox).left+r.right,s=r.top+r.bottom,i.x!==a.x&&(e.left=l(i.x)+"px",a.x=i.x),i.y!==a.y&&(e.top=l(i.y)+"px",a.y=i.y),i.w!==a.w&&(u=l(i.w-o),e.width=(0<=u?u:0)+"px",a.w=i.
w),i.h!==a.h&&(u=l(i.h-s),e.height=(0<=u?u:0)+"px",a.h=i.h),c._hasBody&&i.innerW!==a.innerW&&(u=l(i.innerW),(n=c.getEl("body"))&&((t=n.style).width=(0<=u?u:0)+"px"),a.innerW=i.innerW),c._hasBody&&i.innerH!==a.innerH&&(u=l(i.innerH),(n=n||c.getEl("body"))&&((t=t||n.style).height=(0<=u?u:0)+"px"),a.innerH=i.innerH),c._lastRepaintRect=a,c.fire("repaint",{},!1)},updateLayoutRect:function(){var e=this;e.parent()._lastRect=null,Ce.css(e.getEl(),{width:"",height:""}),e._layoutRect=e._lastRepaintRect=e._lastLayoutRect=null,e.initLayoutRect()},on:function(e,t){var n,i,r,o=this;return rt(o).on(e,"string"!=typeof(n=t)?n:function(e){return i||o.parentsAndSelf().each(function(e){var t=e.settings.callbacks;if(t&&(i=t[n]))return r=e,!1}),i?i.call(r,e):(e.action=n,void this.fire("execute",e))}),o},off:function(e,t){return rt(thi
s).off(e,t),this},fire:function(e,t,n){if((t=t||{}).control||(t.control=this),t=rt(this).fire(e,t),!1!==n&&this.parent)for(var i=this.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return rt(this).has(e)},parents:function(e){var t,n=new $e;for(t=this.parent();t;t=t.parent())n.add(t);return e&&(n=n.filter(e)),n},parentsAndSelf:function(e){return new $e(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=we("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().bl
ur(),this},aria:function(e,t){var n=this,i=n.getEl(n.ariaTarget);return void 0===t?n._aria[e]:(n._aria[e]=t,n.state.get("rendered")&&i.setAttribute("role"===e?e:"aria-"+e,t),n)},encode:function(e,t){return!1!==t&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return Ge.translate?Ge.translate(e):e},before:function(e){var t=this.parent();return t&&t.insert(e,t.items().indexOf(this),!0),this},after:function(e){var t=this.parent();return t&&t.insert(e,t.items().indexOf(this)),this},remove:function(){var t,e,n=this,i=n.getEl(),r=n.parent();if(n.items){var o=n.items().toArray();for(e=o.length;e--;)o[e].remove()}r&&r.items&&(t=[],r.items().each(function(e){e!==n&&t.push(e)}),r.items().set(t),r._lastRect=null),n._eventsRoot&&n._eventsRoot===n&&we(i).off();var s=n.getRoot().c
ontrolIdLookup;return s&&delete s[n._id],i&&i.parentNode&&i.parentNode.removeChild(i),n.state.set("rendered",!1),n.state.destroy(),n.fire("remove"),n},renderBefore:function(e){return we(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return we(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'"></div>'},postRender:function(){var e,t,n,i,r,o=this,s=o.settings;for(i in o.$el=we(o.getEl()),o.state.set("rendered",!0),s)0===i.indexOf("on")&&o.on(i.substr(2),s[i]);if(o._eventsRoot){for(n=o.parent();!r&&n;n=n.parent())r=n._eventsRoot;if(r)for(i in r._nativeEvents)o._nativeEvents[i]=!0}ot(o),s.style&&(e=o.getEl())&&(e.setAttribute("style",s.style),e.style.cssText=s.style),o.settings.bord
er&&(t=o.borderBox,o.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left}));var a=o.getRoot();for(var l in a.controlIdLookup||(a.controlIdLookup={}),(a.controlIdLookup[o._id]=o)._aria)o.aria(l,o._aria[l]);!1===o.state.get("visible")&&(o.getEl().style.display="none"),o.bindStates(),o.state.on("change:visible",function(e){var t,n=e.value;o.state.get("rendered")&&(o.getEl().style.display=!1===n?"none":"",o.getEl().getBoundingClientRect()),(t=o.parent())&&(t._lastRect=null),o.fire(n?"show":"hide"),Qe.add(o)}),o.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){var t,n,i,r,o,s,a=this.getEl(),l=a.parentNode,u=function(e,t){var n,i,r=e;for(n=i=0;r&&r!==t&&r.nodeType;)n+=r.offsetLeft||0,i+=r.offsetTop||0,r=r.offsetParent;
return{x:n,y:i}}(a,l);return t=u.x,n=u.y,i=a.offsetWidth,r=a.offsetHeight,o=l.clientWidth,s=l.clientHeight,"end"===e?(t-=o-i,n-=s-r):"center"===e&&(t-=o/2-i/2,n-=s/2-r/2),l.scrollLeft=t,l.scrollTop=n,this},getRoot:function(){for(var e,t=this,n=[];t;){if(t.rootControl){e=t.rootControl;break}n.push(t),t=(e=t).parent()}e||(e=this);for(var i=n.length;i--;)n[i].rootControl=e;return e},reflow:function(){Qe.remove(this);var e=this.parent();return e&&e._layout&&!e._layout.isNative()&&e.reflow(),this}};function rt(n){return n._eventDispatcher||(n._eventDispatcher=new Ne({scope:n,toggleEvent:function(e,t){t&&Ne.isNative(e)&&(n._nativeEvents||(n._nativeEvents={}),n._nativeEvents[e]=!0,n.state.get("rendered")&&ot(n))}})),n._eventDispatcher}function ot(a){var e,t,n,l,i,r;function o(e){var t=a.getParentCtrl(e.target);t&&t.fire(e.type,e)}function s(){var e=l._lastHoverCtrl;e&&(e.fire("mousele
ave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),l._lastHoverCtrl=null)}function u(e){var t,n,i,r=a.getParentCtrl(e.target),o=l._lastHoverCtrl,s=0;if(r!==o){if((n=(l._lastHoverCtrl=r).parents().toArray().reverse()).push(r),o){for((i=o.parents().toArray().reverse()).push(o),s=0;s<i.length&&n[s]===i[s];s++);for(t=i.length-1;s<=t;t--)(o=i[t]).fire("mouseleave",{target:o.getEl()})}for(t=s;t<n.length;t++)(r=n[t]).fire("mouseenter",{target:r.getEl()})}}function c(e){e.preventDefault(),"mousewheel"===e.type?(e.deltaY=-.025*e.wheelDelta,e.wheelDeltaX&&(e.deltaX=-.025*e.wheelDeltaX)):(e.deltaX=0,e.deltaY=e.detail),e=a.fire("wheel",e)}if(i=a._nativeEvents){for((n=a.parents().toArray()).unshift(a),e=0,t=n.length;!l&&e<t;e++)l=n[e]._eventsRoot;for(l||(l=n[n.length-1]||a),a._eventsRoot=l,t=e,e=0;e<t;e++)n[e]._eventsRoot=l;var d=l._delegates;for(r in d||(d=l
._delegates={}),i){if(!i)return!1;"wheel"!==r||tt?("mouseenter"===r||"mouseleave"===r?l._hasMouseEnter||(we(l.getEl()).on("mouseleave",s).on("mouseover",u),l._hasMouseEnter=1):d[r]||(we(l.getEl()).on(r,o),d[r]=!0),i[r]=!1):et?we(a.getEl()).on("mousewheel",c):we(a.getEl()).on("DOMMouseScroll",c)}}}w.each("text title visible disabled active value".split(" "),function(t){it[t]=function(e){return 0===arguments.length?this.state.get(t):(void 0!==e&&this.state.set(t,e),this)}});var st=Ge=Me.extend(it),at=function(e){return!!e.getAttribute("data-mce-tabstop")};function lt(e){var o,r,n=e.root;function i(e){return e&&1===e.nodeType}try{o=document.activeElement}catch(t){o=document.body}function s(e){return i(e=e||o)?e.getAttribute("role"):null}function a(e){for(var t,n=e||o;n=n.parentNode;)if(t=s(n))return t}function l(e){var t=o;if(i(t))return t.getAttribute("ari
a-"+e)}function u(e){var t=e.tagName.toUpperCase();return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}function c(t){var r=[];return function e(t){if(1===t.nodeType&&"none"!==t.style.display&&!t.disabled){var n;(u(n=t)&&!n.hidden||at(n)||/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(s(n)))&&r.push(t);for(var i=0;i<t.childNodes.length;i++)e(t.childNodes[i])}}(t||n.getEl()),r}function d(e){var t,n;(n=(e=e||r).parents().toArray()).unshift(e);for(var i=0;i<n.length&&!(t=n[i]).settings.ariaRoot;i++);return t}function f(e,t){return e<0?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function h(e,t){var n=-1,i=d();t=t||c(i.getEl());for(var r=0;r<t.length;r++)t[r]===o&&(n=r);n+=e,i.lastAriaIndex=f(n,t)}function m(){"tablist"===a()?h(-1,c(o.parentNode)):r.parent().submenu?b():h(-1)}function g(){var e=s(),t=a();"tablist&q
uot;===t?h(1,c(o.parentNode)):"menuitem"===e&&"menu"===t&&l("haspopup")?y():h(1)}function p(){h(-1)}function v(){var e=s(),t=a();"menuitem"===e&&"menubar"===t?y():"button"===e&&l("haspopup")?y({key:"down"}):h(1)}function b(){r.fire("cancel")}function y(e){e=e||{},r.fire("click",{target:o,aria:e})}return r=n.getParentCtrl(o),n.on("keydown",function(e){function t(e,t){u(o)||at(o)||"slider"!==s(o)&&!1!==t(e)&&e.preventDefault()}if(!e.isDefaultPrevented())switch(e.keyCode){case 37:t(e,m);break;case 39:t(e,g);break;case 38:t(e,p);break;case 40:t(e,v);break;case 27:b();break;case 14:case 13:case 32:t(e,y);break;case 9:!function(e){if("tablist"===a()){var t=c(r.getEl("body"))[0];t&&t.focus()}else h(e.shiftKey?-1:1)}(e),e.preventDefault()}}),n.on("focusin",function(e){o=e.target,r=e.contr
ol}),{focusFirst:function(e){var t=d(e),n=c(t.getEl());t.settings.ariaRemember&&"lastAriaIndex"in t?f(t.lastAriaIndex,n):f(0,n)}}}var ut={},ct=st.extend({init:function(e){var t=this;t._super(e),(e=t.settings).fixed&&t.state.set("fixed",!0),t._items=new $e,t.isRtl()&&t.classes.add("rtl"),t.bodyClasses=new Oe(function(){t.state.get("rendered")&&(t.getEl("body").className=this.toString())}),t.bodyClasses.prefix=t.classPrefix,t.classes.add("container"),t.bodyClasses.add("container-body"),e.containerCls&&t.classes.add(e.containerCls),t._layout=b.create((e.layout||"")+"layout"),t.settings.items?t.add(t.settings.items):t.add(t.render()),t._hasBody=!0},items:function(){return this._items},find:function(e){return(e=ut[e]=ut[e]||new Ue(e)).find(this)},add:function(e){return this.items().add(this.create(e)).parent(this),this},focus:function(e){var t,n,i,r=this;if(!e
||!(n=r.keyboardNav||r.parents().eq(-1)[0].keyboardNav))return i=r.find("*"),r.statusbar&&i.add(r.statusbar.items()),i.each(function(e){if(e.settings.autofocus)return t=null,!1;e.canFocus&&(t=t||e)}),t&&t.focus(),r;n.focusFirst(r)},replace:function(e,t){for(var n,i=this.items(),r=i.length;r--;)if(i[r]===e){i[r]=t;break}0<=r&&((n=t.getEl())&&n.parentNode.removeChild(n),(n=e.getEl())&&n.parentNode.removeChild(n)),t.parent(this)},create:function(e){var t,n=this,i=[];return w.isArray(e)||(e=[e]),w.each(e,function(e){e&&(e instanceof st||("string"==typeof e&&(e={type:e}),t=w.extend({},n.settings.defaults,e),e.type=t.type=t.type||e.type||n.settings.defaultType||(t.defaults?t.defaults.type:null),e=b.create(t)),i.push(e))}),i},renderNew:function(){var i=this;return i.items().each(function(e,t){var n;e.parent(i),e.state.get("rendered")||((n=i.getEl("body")).hasChildNodes()&&t<
;=n.childNodes.length-1?we(n.childNodes[t]).before(e.renderHtml()):we(n).append(e.renderHtml()),e.postRender(),Qe.add(e))}),i._layout.applyClasses(i.items().filter(":visible")),i._lastRect=null,i},append:function(e){return this.add(e).renderNew()},prepend:function(e){return this.items().set(this.create(e).concat(this.items().toArray())),this.renderNew()},insert:function(e,t,n){var i,r,o;return e=this.create(e),i=this.items(),!n&&t<i.length-1&&(t+=1),0<=t&&t<i.length&&(r=i.slice(0,t).toArray(),o=i.slice(t).toArray(),i.set(r.concat(e,o))),this.renderNew()},fromJSON:function(e){for(var t in e)this.find("#"+t).value(e[t]);return this},toJSON:function(){var i={};return this.find("*").each(function(e){var t=e.name(),n=e.value();t&&void 0!==n&&(i[t]=n)}),i},renderHtml:function(){var e=this,t=e._layout,n=this.settings.role;return e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'
+e.classes+'"'+(n?' role="'+this.settings.role+'"':"")+'><div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"},postRender:function(){var e,t=this;return t.items().exec("postRender"),t._super(),t._layout.postRender(t),t.state.set("rendered",!0),t.settings.style&&t.$el.css(t.settings.style),t.settings.border&&(e=t.borderBox,t.$el.css({"border-top-width":e.top,"border-right-width":e.right,"border-bottom-width":e.bottom,"border-left-width":e.left})),t.parent()||(t.keyboardNav=lt({root:t})),t},initLayoutRect:function(){var e=this._super();return this._layout.recalc(this),e},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;if(!n||n.w!==t.w||n.h!==t.h)return e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0},reflow:function(){var e;if(Qe.rem
ove(this),this.visible()){for(st.repaintControls=[],st.repaintControls.map={},this.recalc(),e=st.repaintControls.length;e--;)st.repaintControls[e].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),st.repaintControls=[]}return this}});function dt(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<t.length;n++)e[t[n]]=e.changedTouches[0][t[n]]}function ft(e,h){var m,g,t,p,v,b,y,x=h.document||document;h=h||{};var w=x.getElementById(h.handle||e);t=function(e){var t,n,i,r,o,s,a,l,u,c,d,f=(t=x,u=Math.max,n=t.documentElement,i=t.body,r=u(n.scrollWidth,i.scrollWidth),o=u(n.clientWidth,i.clientWidth),s=u(n.offsetWidth,i.offsetWidth),a=u(n.scrollHeight,i.scrollHeight),l=u(n.clientHeight,i.clientHeight),{width:r<s?o:r,height:a<u(n.offsetHeight,i.offsetHeight)?l:a});dt(e),e.preventDefault(),g=e.button,c=w,b=e.screenX,y=e.screenY,d=window.getComp
utedStyle?window.getComputedStyle(c,null).getPropertyValue("cursor"):c.runtimeStyle.cursor,m=we("<div></div>").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:d}).appendTo(x.body),we(x).on("mousemove touchmove",v).on("mouseup touchend",p),h.start(e)},v=function(e){if(dt(e),e.button!==g)return p(e);e.deltaX=e.screenX-b,e.deltaY=e.screenY-y,e.preventDefault(),h.drag(e)},p=function(e){dt(e),we(x).off("mousemove touchmove",v).off("mouseup touchend",p),m.remove(),h.stop&&h.stop(e)},this.destroy=function(){we(w).off()},we(w).on("mousedown touchstart",t)}var ht,mt,gt,pt,vt={init:function(){this.on("repaint",this.renderScroll)},renderScroll:function(){var p=this,v=2;function n(){var m,g,e;function t(e,t,n,i,r,o){var s,a,l,u,c,d,f,h;if(a=p.getEl("scroll"+e)){if(f=t.toLowerCase(),h=n.toLowerCase(),we(p.getEl("abs
end")).css(f,p.layoutRect()[i]-1),!r)return void we(a).css("display","none");we(a).css("display","block"),s=p.getEl("body"),l=p.getEl("scroll"+e+"t"),u=s["client"+n]-2*v,c=(u-=m&&g?a["client"+o]:0)/s["scroll"+n],(d={})[f]=s["offset"+t]+v,d[h]=u,we(a).css(d),(d={})[f]=s["scroll"+t]*c,d[h]=u*c,we(l).css(d)}}e=p.getEl("body"),m=e.scrollWidth>e.clientWidth,g=e.scrollHeight>e.clientHeight,t("h","Left","Width","contentW",m,"Height"),t("v","Top","Height","contentH",g,"Width")}p.settings.autoScroll&&(p._hasScroll||(p._hasScroll=!0,function(){function e(s,a,l,u,c){var d,e=p._id+"-scroll"+s,t=p.classPrefix;we(p.getEl()).append('<div id="'+e+'" class="'+t+"scrollbar "+t+"scrollbar-"+s+'"&g
t;<div id="'+e+'t" class="'+t+'scrollbar-thumb"></div></div>'),p.draghelper=new ft(e+"t",{start:function(){d=p.getEl("body")["scroll"+a],we("#"+e).addClass(t+"active")},drag:function(e){var t,n,i,r,o=p.layoutRect();n=o.contentW>o.innerW,i=o.contentH>o.innerH,r=p.getEl("body")["client"+l]-2*v,t=(r-=n&&i?p.getEl("scroll"+s)["client"+c]:0)/p.getEl("body")["scroll"+l],p.getEl("body")["scroll"+a]=d+e["delta"+u]/t},stop:function(){we("#"+e).removeClass(t+"active")}})}p.classes.add("scroll"),e("v","Top","Height","Y","Width"),e("h","Left","Width","X","Height")}(),p.on("wheel",function(e){var t=p.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10
*e.deltaY,n()}),we(p.getEl("body")).on("scroll",n)),n())}},bt=ct.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[vt],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),void 0===n?n='<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div>":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1" role="group">'+(e._preBodyHtml||"")+n+"</div>"}}),yt={resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(e,t){if(e<=1||t<=1){var n=Ce.getWindowSize();e=e<=1?e*n.w:e,t=t<=1?t*n.h:t}return this._layoutRect.autoResize=!1,this.layoutRect({minW:e,minH:t,w:e,h:t}).reflow()},resizeBy:function(e,t){var n=t
his.layoutRect();return this.resizeTo(n.w+e,n.h+t)}},xt=[],wt=[];function _t(e,t){for(;e;){if(e===t)return!0;e=e.parent()}}function Ct(){ht||(ht=function(e){2!==e.button&&function(e){for(var t=xt.length;t--;){var n=xt[t],i=n.getParentCtrl(e.target);if(n.settings.autohide){if(i&&(_t(i,n)||n.parent()===i))continue;(e=n.fire("autohide",{target:e.target})).isDefaultPrevented()||n.hide()}}}(e)},we(document).on("click touchstart",ht))}function Rt(r){var e=Ce.getViewPort().y;function t(e,t){for(var n,i=0;i<xt.length;i++)if(xt[i]!==r)for(n=xt[i].parent();n&&(n=n.parent());)n===r&&xt[i].fixed(e).moveBy(0,t).repaint()}r.settings.autofix&&(r.state.get("fixed")?r._autoFixY>e&&(r.fixed(!1).layoutRect({y:r._autoFixY}).repaint(),t(!1,r._autoFixY-e)):(r._autoFixY=r.layoutRect().y,r._autoFixY<e&&(r.fixed(!0).layoutRect({y:0}).repaint(),t(!0,e-r._autoFixY))))}function Et(e,t){var n,i,r=kt.zIndex||65535;if(e
)wt.push(t);else for(n=wt.length;n--;)wt[n]===t&&wt.splice(n,1);if(wt.length)for(n=0;n<wt.length;n++)wt[n].modal&&(r++,i=wt[n]),wt[n].getEl().style.zIndex=r,wt[n].zIndex=r,r++;var o=we("#"+t.classPrefix+"modal-block",t.getContainerElm())[0];i?we(o).css("z-index",i.zIndex-1):o&&(o.parentNode.removeChild(o),pt=!1),kt.currentZIndex=r}var kt=bt.extend({Mixins:[Se,yt],init:function(e){var i=this;i._super(e),(i._eventsRoot=i).classes.add("floatpanel"),e.autohide&&(Ct(),function(){if(!gt){var e=document.documentElement,t=e.clientWidth,n=e.clientHeight;gt=function(){document.all&&t===e.clientWidth&&n===e.clientHeight||(t=e.clientWidth,n=e.clientHeight,kt.hideAll())},we(window).on("resize",gt)}}(),xt.push(i)),e.autofix&&(mt||(mt=function(){var e;for(e=xt.length;e--;)Rt(xt[e])},we(window).on("scroll",mt)),i.on("move",function(){Rt(this)})),i.on("postrender show
",function(e){if(e.control===i){var t,n=i.classPrefix;i.modal&&!pt&&((t=we("#"+n+"modal-block",i.getContainerElm()))[0]||(t=we('<div id="'+n+'modal-block" class="'+n+"reset "+n+'fade"></div>').appendTo(i.getContainerElm())),u.setTimeout(function(){t.addClass(n+"in"),we(i.getEl()).addClass(n+"in")}),pt=!0),Et(!0,i)}}),i.on("show",function(){i.parents().each(function(e){if(e.state.get("fixed"))return i.fixed(!0),!1})}),e.popover&&(i._preBodyHtml='<div class="'+i.classPrefix+'arrow"></div>',i.classes.add("popover").add("bottom").add(i.isRtl()?"end":"start")),i.aria("label",e.ariaLabel),i.aria("labelledby",i._id),i.aria("describedby",i.describedBy||i._id+"-none")},fixed:function(e){var t=this;if(t.state.get("fixed")!==e){if(t.state.get("render
ed")){var n=Ce.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.classes.toggle("fixed",e),t.state.set("fixed",e)}return t},show:function(){var e,t=this._super();for(e=xt.length;e--&&xt[e]!==this;);return-1===e&&xt.push(this),t},hide:function(){return Tt(this),Et(!1,this),this._super()},hideAll:function(){kt.hideAll()},close:function(){return this.fire("close").isDefaultPrevented()||(this.remove(),Et(!1,this)),this},remove:function(){Tt(this),this._super()},postRender:function(){return this.settings.bodyRole&&this.getEl("body").setAttribute("role",this.settings.bodyRole),this._super()}});function Tt(e){var t;for(t=xt.length;t--;)xt[t]===e&&xt.splice(t,1);for(t=wt.length;t--;)wt[t]===e&&wt.splice(t,1)}kt.hideAll=function(){for(var e=xt.length;e--;){var t=xt[e];t&&t.settings.autohide&&(t.hide(),xt.splice(e,1))}};var Ht=function(e,t){return!(!e||t.settings.ui_conta
iner)},St=function(s,e,t){var a,n,l=v.DOM,i=s.getParam("fixed_toolbar_container");i&&(n=l.select(i)[0]);var r=function(){if(a&&a.moveRel&&a.visible()&&!a._fixed){var e=s.selection.getScrollContainer(),t=s.getBody(),n=0,i=0;if(e){var r=l.getPos(t),o=l.getPos(e);n=Math.max(0,o.x-r.x),i=Math.max(0,o.y-r.y)}a.fixed(!1).moveRel(t,s.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl","tr-br"]).moveBy(n,i)}},o=function(){a&&(a.show(),r(),l.addClass(s.getBody(),"mce-edit-focus"))},u=function(){a&&(a.hide(),kt.hideAll(),l.removeClass(s.getBody(),"mce-edit-focus"))},c=function(){a?a.visible()||o():(a=e.panel=b.create({type:n?"panel":"floatpanel",role:"application",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:Ht(n,s),fixed:Ht(n,s),border:1,items:[!1===d(s)
?null:{type:"menubar",border:"0 0 1 0",items:se(s)},L(s,f(s))]}),O.setUiContainer(s,a),_(s),n?a.renderTo(n).reflow():a.renderTo().reflow(),C(s,a),o(),V(s),s.on("nodeChange",r),s.on("ResizeWindow",r),s.on("activate",o),s.on("deactivate",u),s.nodeChanged())};return s.settings.content_editable=!0,s.on("focus",function(){!1===g(s)&&t.skinUiCss?l.styleSheetLoader.load(t.skinUiCss,c,c):c()}),s.on("blur hide",u),s.on("remove",function(){a&&(a.remove(),a=null)}),!1===g(s)&&t.skinUiCss?l.styleSheetLoader.load(t.skinUiCss,ve(s)):ve(s)(),{}};function Mt(i,r){var o,s,a=this,l=st.classPrefix;a.show=function(e,t){function n(){o&&(we(i).append('<div class="'+l+"throbber"+(r?" "+l+"throbber-inline":"")+'"></div>'),t&&t())}return a.hide(),o=!0,e?s=u.setTimeout(n,e):n(),a},a.hide=function(){var e=i.lastChild;ret
urn u.clearTimeout(s),e&&-1!==e.className.indexOf("throbber")&&e.parentNode.removeChild(e),o=!1,a}}var Nt=function(e,t){var n;e.on("ProgressState",function(e){n=n||new Mt(t.panel.getEl("body")),e.state?n.show(e.time):n.hide()})},Pt=function(e,t,n){var i=function(e){var t=e.settings,n=t.skin,i=t.skin_url;if(!1!==n){var r=n||"lightgray";i=i?e.documentBaseURI.toAbsolute(i):h.baseURL+"/skins/"+r}return i}(e);return i&&(n.skinUiCss=i+"/skin.min.css",e.contentCSS.push(i+"/content"+(e.inline?".inline":"")+".min.css")),Nt(e,t),e.getParam("inline",!1,"boolean")?St(e,t,n):xe(e,t,n)},Dt=st.extend({Mixins:[Se],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'" role="presentation"><div class="'+t+'tooltip-arro
w"></div><div class="'+t+'tooltip-inner">'+e.encode(e.state.get("text"))+"</div></div>"},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl().lastChild.innerHTML=t.encode(e.value)}),t._super()},repaint:function(){var e,t;e=this.getEl().style,t=this._layoutRect,e.left=t.x+"px",e.top=t.y+"px",e.zIndex=131070}}),Wt=st.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.canFocus=!0,i.tooltip&&!1!==Wt.tooltips&&(r.on("mouseenter",function(e){var t=r.tooltip().moveTo(-65535);if(e.control===r){var n=t.text(i.tooltip).show().testMoveRel(r.getEl(),["bc-tc","bc-tl","bc-tr"]);t.classes.toggle("tooltip-n","bc-tc"===n),t.classes.toggle("tooltip-nw","bc-tl"===n),t.classes.toggle("tooltip-ne","bc-tr"===n),t.moveRel(r.getEl(),n)}else t.hide()}),r.on(
"mouseleave mousedown click",function(){r.tooltip().remove(),r._tooltip=null})),r.aria("label",i.ariaLabel||i.tooltip)},tooltip:function(){return this._tooltip||(this._tooltip=new Dt({type:"tooltip"}),O.inheritUiContainer(this,this._tooltip),this._tooltip.renderTo()),this._tooltip},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){var t=this;function n(e){t.aria("disabled",e),t.classes.toggle("disabled",e)}function i(e){t.aria("pressed",e),t.classes.toggle("active",e)}return t.state.on("change:disabled",function(e){n(e.value)}),t.state.on("change:active",function(e){i(e.value)}),t.state.get("disabled")&&n(!0),t.state.get("active")&&i(!0),t._super()},remove:function(){this._super(),this._tooltip&&(this._tooltip.remove()
,this._tooltip=null)}}),Ot=Wt.extend({Defaults:{value:0},init:function(e){this._super(e),this.classes.add("progress"),this.settings.filter||(this.settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this._id,t=this.classPrefix;return'<div id="'+e+'" class="'+this.classes+'"><div class="'+t+'bar-container"><div class="'+t+'bar"></div></div><div class="'+t+'text">0%</div></div>'},postRender:function(){return this._super(),this.value(this.settings.value),this},bindStates:function(){var t=this;function n(e){e=t.settings.filter(e),t.getEl().lastChild.innerHTML=e+"%",t.getEl().firstChild.firstChild.style.width=e+"%"}return t.state.on("change:value",function(e){n(e.value)}),n(t.state.get("value")),t._super()}}),At=function(e,t){e.getEl().lastChild.textContent=t+(e.progressBar?" "+e.progressBar.value()+"
%":"")},Bt=st.extend({Mixins:[Se],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),t.maxWidth=e.maxWidth,e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||0<e.timeout)&&!e.closeButton?t.closeButton=!1:(t.classes.add("has-close"),t.closeButton=!0),e.progressBar&&(t.progressBar=new Ot),t.on("click",function(e){-1!==e.target.className.indexOf(t.classPrefix+"close")&&t.close()})},renderHtml:function(){var e,t=this,n=t.classPrefix,i="",r="",o="";return t.icon&&(i='<i class="'+n+"ico "+n+"i-"+t.icon+'"></i>'),e=' style="max-width: '+t.maxWidth+"px;"+(t.color?"background-color: "+t.color+';"':'"'),t.closeButton&&
;(r='<button type="button" class="'+n+'close" aria-hidden="true">\xd7</button>'),t.progressBar&&(o=t.progressBar.renderHtml()),'<div id="'+t._id+'" class="'+t.classes+'"'+e+' role="presentation">'+i+'<div class="'+n+'notification-inner">'+t.state.get("text")+"</div>"+o+r+'<div style="clip: rect(1px, 1px, 1px, 1px);height: 1px;overflow: hidden;position: absolute;width: 1px;" aria-live="assertive" aria-relevant="additions" aria-atomic="true"></div></div>'},postRender:function(){var e=this;return u.setTimeout(function(){e.$el.addClass(e.classPrefix+"in"),At(e,e.state.get("text"))},100),e._super()},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl().firstChild.innerHTML=e.value,At(t,e.value)}),t.progressBar&&(t.progressBar.bindState
s(),t.progressBar.state.on("change:value",function(e){At(t,t.state.get("text"))})),t._super()},close:function(){return this.fire("close").isDefaultPrevented()||this.remove(),this},repaint:function(){var e,t;e=this.getEl().style,t=this._layoutRect,e.left=t.x+"px",e.top=t.y+"px",e.zIndex=65534}});function Lt(o){var s=function(e){return e.inline?e.getElement():e.getContentAreaContainer()};return{open:function(e,t){var n,i=w.extend(e,{maxWidth:(n=s(o),Ce.getSize(n).width)}),r=new Bt(i);return 0<(r.args=i).timeout&&(r.timer=setTimeout(function(){r.close(),t()},i.timeout)),r.on("close",function(){t()}),r.renderTo(),r},close:function(e){e.close()},reposition:function(e){G(e,function(e){e.moveTo(0,0)}),function(n){if(0<n.length){var e=n.slice(0,1)[0],t=s(o);e.moveRel(t,"tc-tc"),G(n,function(e,t){0<t&&e.moveRel(n[t-1].getEl(),"bc-tc")})}}(e)},getArgs:function(e){return e.args}}}var It=[],
zt="";function Ft(e){var t,n=we("meta[name=viewport]")[0];!1!==fe.overrideViewPort&&(n||((n=document.createElement("meta")).setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(n)),(t=n.getAttribute("content"))&&void 0!==zt&&(zt=t),n.setAttribute("content",e?"width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0":zt))}function Ut(e,t){(function(){for(var e=0;e<It.length;e++)if(It[e]._fullscreen)return!0;return!1})()&&!1===t&&we([document.documentElement,document.body]).removeClass(e+"fullscreen")}var Vt=kt.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var n=this;n._super(e),n.isRt
l()&&n.classes.add("rtl"),n.classes.add("window"),n.bodyClasses.add("window-body"),n.state.set("fixed",!0),e.buttons&&(n.statusbar=new bt({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),n.statusbar.classes.add("foot"),n.statusbar.parent(n)),n.on("click",function(e){var t=n.classPrefix+"close";(Ce.hasClass(e.target,t)||Ce.hasClass(e.target.parentNode,t))&&n.close()}),n.on("cancel",function(){n.close()}),n.on("move",function(e){e.control===n&&kt.hideAll()}),n.aria("describedby",n.describedBy||n._id+"-none"),n.aria("label",e.title),n._fullscreen=!1},recalc:function(){var e,t,n,i,r=this,o=r.statusbar;r._fullscreen&&(r.layoutRect(Ce.getWindowSize()),r.layoutRect().contentH=r.layout
Rect().innerH),r._super(),e=r.layoutRect(),r.settings.title&&!r._fullscreen&&(t=e.headerW)>e.w&&(n=e.x-Math.max(0,t/2),r.layoutRect({w:t,x:n}),i=!0),o&&(o.layoutRect({w:r.layoutRect().innerW}).recalc(),(t=o.layoutRect().minW+e.deltaW)>e.w&&(n=e.x-Math.max(0,t-e.w),r.layoutRect({w:t,x:n}),i=!0)),i&&r.recalc()},initLayoutRect:function(){var e,t=this,n=t._super(),i=0;if(t.settings.title&&!t._fullscreen){e=t.getEl("head");var r=Ce.getSize(e);n.headerW=r.width,n.headerH=r.height,i+=n.headerH}t.statusbar&&(i+=t.statusbar.layoutRect().h),n.deltaH+=i,n.minH+=i,n.h+=i;var o=Ce.getWindowSize();return n.x=t.settings.x||Math.max(0,o.w/2-n.w/2),n.y=t.settings.y||Math.max(0,o.h/2-n.h/2),n},renderHtml:function(){var e=this,t=e._layout,n=e._id,i=e.classPrefix,r=e.settings,o="",s="",a=r.html;return e.preRender(),t.preRender(e),r.title&&(o='<div id="'+n+'-head" class="'+i+'win
dow-head"><div id="'+n+'-title" class="'+i+'title">'+e.encode(r.title)+'</div><div id="'+n+'-dragh" class="'+i+'dragh"></div><button type="button" class="'+i+'close" aria-hidden="true"><i class="mce-ico mce-i-remove"></i></button></div>'),r.url&&(a='<iframe src="'+r.url+'" tabindex="-1"></iframe>'),void 0===a&&(a=t.renderHtml(e)),e.statusbar&&(s=e.statusbar.renderHtml()),'<div id="'+n+'" class="'+e.classes+'" hidefocus="1"><div class="'+e.classPrefix+'reset" role="application">'+o+'<div id="'+n+'-body" class="'+e.bodyClasses+'">'+a+"</div>"+s+"</div></div>"},fullscreen:function(e){var n,t,i=this,r=document.documentElement,o=i.classPrefix;if(e!==i._fullscreen)if(we(
window).on("resize",function(){var e;if(i._fullscreen)if(n)i._timer||(i._timer=u.setTimeout(function(){var e=Ce.getWindowSize();i.moveTo(0,0).resizeTo(e.w,e.h),i._timer=0},50));else{e=(new Date).getTime();var t=Ce.getWindowSize();i.moveTo(0,0).resizeTo(t.w,t.h),50<(new Date).getTime()-e&&(n=!0)}}),t=i.layoutRect(),i._fullscreen=e){i._initial={x:t.x,y:t.y,w:t.w,h:t.h},i.borderBox=Pe("0"),i.getEl("head").style.display="none",t.deltaH-=t.headerH+2,we([r,document.body]).addClass(o+"fullscreen"),i.classes.add("fullscreen");var s=Ce.getWindowSize();i.moveTo(0,0).resizeTo(s.w,s.h)}else i.borderBox=Pe(i.settings.border),i.getEl("head").style.display="",t.deltaH+=t.headerH,we([r,document.body]).removeClass(o+"fullscreen"),i.classes.remove("fullscreen"),i.moveTo(i._initial.x,i._initial.y).resizeTo(i._initial.w,i._initial.h);return i.reflow()},postRender:function(){var t,n=this;setTim
eout(function(){n.classes.add("in"),n.fire("open")},0),n._super(),n.statusbar&&n.statusbar.postRender(),n.focus(),this.dragHelper=new ft(n._id+"-dragh",{start:function(){t={x:n.layoutRect().x,y:n.layoutRect().y}},drag:function(e){n.moveTo(t.x+e.deltaX,t.y+e.deltaY)}}),n.on("submit",function(e){e.isDefaultPrevented()||n.close()}),It.push(n),Ft(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e,t=this;for(t.dragHelper.destroy(),t._super(),t.statusbar&&this.statusbar.remove(),Ut(t.classPrefix,!1),e=It.length;e--;)It[e]===t&&It.splice(e,1);Ft(0<It.length)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});!function(){if(!fe.desktop){var n={w:window.innerWidth,h:window.innerHeight};u.setInterval(function(){var e=window.innerWidth,t=window.innerHeight;n.w===e&&n.h===t||(n={w:e,h:t},we(win
dow).trigger("resize"))},100)}we(window).on("resize",function(){var e,t,n=Ce.getWindowSize();for(e=0;e<It.length;e++)t=It[e].layoutRect(),It[e].moveTo(It[e].settings.x||Math.max(0,n.w/2-t.w/2),It[e].settings.y||Math.max(0,n.h/2-t.h/2))})}();var Yt=Vt.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(e){var t,i=e.callback||function(){};function n(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),i(t)}}}switch(e.buttons){case Yt.OK_CANCEL:t=[n("Ok",!0,!0),n("Cancel",!1)];break;case Yt.YES_NO:case Yt.YES_NO_CANCEL:t
=[n("Yes",1,!0),n("No",0)],e.buttons===Yt.YES_NO_CANCEL&&t.push(n("Cancel",-1));break;default:t=[n("Ok",!0,!0)]}return new Vt({padding:20,x:e.x,y:e.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:t,title:e.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:e.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:e.onClose,onCancel:function(){i(!1)}}).renderTo(document.body).reflow()},alert:function(e,t){return"string"==typeof e&&(e={text:e}),e.callback=t,Yt.msgBox(e)},confirm:function(e,t){return"string"==typeof e&&(e={text:e}),e.callback=t,e.buttons=Yt.OK_CANCEL,Yt.msgBox(e)}}}),$t=function(n){return{renderUI:function(e){return Pt(n,this,e)},resizeTo:function(e,t){return ce(n,e,t)},resizeBy:function(e,t){return de(n,e,t)},getNotificationManag
erImpl:function(){return Lt(n)},getWindowManagerImpl:function(){return{open:function(n,e,t){var i;return n.title=n.title||" ",n.url=n.url||n.file,n.url&&(n.width=parseInt(n.width||320,10),n.height=parseInt(n.height||240,10)),n.body&&(n.items={defaults:n.defaults,type:n.bodyType||"form",items:n.body,data:n.data,callbacks:n.commands}),n.url||n.buttons||(n.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit()}},{text:"Cancel",onclick:function(){i.close()}}]),(i=new Vt(n)).on("close",function(){t(i)}),n.data&&i.on("postRender",function(){this.find("*").each(function(e){var t=e.name();t in n.data&&e.value(n.data[t])})}),i.features=n||{},i.params=e||{},i=i.renderTo(document.body).reflow()},alert:function(e,t,n){var i;return(i=Yt.alert(e,function(){t()})).on("close",function(){n(i)}),i},confirm:function(e,t,n){var i;return(i=Yt.co
nfirm(e,function(e){t(e)})).on("close",function(){n(i)}),i},close:function(e){e.close()},getParams:function(e){return e.params},setParams:function(e,t){e.params=t}}}}},Xt=Me.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=w.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t,n,i,r,o=this.settings;t=o.firstControlClass,n=o.lastControlClass,e.each(function(e){e.classes.remove(t).remove(n).add(o.controlClass),e.visible()&&(i||(i=e),r=e)}),i&&i.classes.add(t),r&&r.classes.add(n)},renderHtml:function(e){var t="";return this.applyClasses(e.items()),e.items().each(function(e){t+=e.renderHtml()}),t},recalc:function(){},postRender:function(){},isNative:function(){return!1}}),qt=Xt.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.ite
ms().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'<div id="'+e._id+'-absend" class="'+e.classPrefix+'abs-end"></div>'+this._super(e)}}),jt=Wt.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t,n=this;n._super(e),e=n.settings,t=n.settings.size,n.on("click mousedown",function(e){e.preventDefault()}),n.on("touchstart",function(e){n.fire("click",e),e.preventDefault()}),e.subtype&&n.classes.add(e.subtype),t&&n.classes.add("btn-"+t),e.icon&&n.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e,t=this.getEl().firstChild;t&&((e=t.style).width=e.height="100%"),this._super()},renderHtml:function(){var e,t,n=this,i=n
._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a="",l=n.settings;return(e=l.image)?(o="none","string"!=typeof e&&(e=window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",s&&(n.classes.add("btn-has-text"),a='<span class="'+r+'txt">'+n.encode(s)+"</span>"),o=o?r+"ico "+r+"i-"+o:"",t="boolean"==typeof l.active?' aria-pressed="'+l.active+'"':"",'<div id="'+i+'" class="'+n.classes+'" tabindex="-1"'+t+'><button id="'+i+'-button" role="presentation" type="button" tabindex="-1">'+(o?'<i class="'+o+'"'+e+"></i>":"")+a+"</button></div>"},bindStates:function(){var o=this,n=o.$,i=o.classPrefix+"t
xt";function s(e){var t=n("span."+i,o.getEl());e?(t[0]||(n("button:first",o.getEl()).append('<span class="'+i+'"></span>'),t=n("span."+i,o.getEl())),t.html(o.encode(e))):t.remove(),o.classes.toggle("btn-has-text",!!e)}return o.state.on("change:text",function(e){s(e.value)}),o.state.on("change:icon",function(e){var t=e.value,n=o.classPrefix;t=(o.settings.icon=t)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];t?(r&&r===i.firstChild||(r=document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=t):r&&i.removeChild(r),s(o.state.get("text"))}),o._super()}}),Jt=jt.extend({init:function(e){e=w.extend({text:"Browse...",multiple:!1,accept:null},e),this._super(e),this.classes.add("browsebutton"),e.multiple&&this.classes.add("multiple")
},postRender:function(){var n=this,t=Ce.create("input",{type:"file",id:n._id+"-browse",accept:n.settings.accept});n._super(),we(t).on("change",function(e){var t=e.target.files;n.value=function(){return t.length?n.settings.multiple?t:t[0]:null},e.preventDefault(),t.length&&n.fire("change",e)}),we(t).on("click",function(e){e.stopPropagation()}),we(n.getEl("button")).on("click",function(e){e.stopPropagation(),t.click()}),n.getEl().appendChild(t)},remove:function(){we(this.getEl("button")).off(),we(this.getEl("input")).off(),this._super()}}),Gt=ct.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+(e.settings.html||"")+t.re
nderHtml(e)+"</div></div>"}}),Kt=Wt.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'" unselectable="on" aria-labelledby="'+t+'-al" tabindex="-1"><i class="'+n+"ico "+n+'i-checkbox"></i><span id="'+t+'-al" class="'+n+'label">'+e.encode(e.state.get("text"))+"</span></div
>"},bindStates:function(){var o=this;function t(e){o.classes.toggle("checked",e),o.aria("checked",e)}return o.state.on("change:text",function(e){o.getEl("al").firstChild.data=o.translate(e.value)}),o.state.on("change:checked change:value",function(e){o.fire("change"),t(e.value)}),o.state.on("change:icon",function(e){var t=e.value,n=o.classPrefix;if(void 0===t)return o.settings.icon;t=(o.settings.icon=t)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];t?(r&&r===i.firstChild||(r=document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=t):r&&i.removeChild(r)}),o.state.get("checked")&&t(!0),o._super()}}),Zt=tinymce.util.Tools.resolve("tinymce.util.VK"),Qt=Wt.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.classes.add("combobox"),r.s
ubinput=!0,r.ariaTarget="inp",i.menu=i.menu||i.values,i.menu&&(i.icon="caret"),r.on("click",function(e){var t=e.target,n=r.getEl();if(we.contains(n,t)||t===n)for(;t&&t!==n;)t.id&&-1!==t.id.indexOf("-open")&&(r.fire("action"),i.menu&&(r.showMenu(),e.aria&&r.menu.items()[0].focus())),t=t.parentNode}),r.on("keydown",function(e){var t;13===e.keyCode&&"INPUT"===e.target.nodeName&&(e.preventDefault(),r.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),r.fire("submit",{data:t.toJSON()}))}),r.on("keyup",function(e){if("INPUT"===e.target.nodeName){var t=r.state.get("value"),n=e.target.value;n!==t&&(r.state.set("value",n),r.fire("autocomplete",e))}}),r.on("mouseover",function(e){var t=r.tooltip().moveTo(-65535);if(r.statusLevel()&&-1!==e.target.className.indexOf
(r.classPrefix+"status")){var n=r.statusMessage()||"Ok",i=t.text(n).show().testMoveRel(e.target,["bc-tc","bc-tl","bc-tr"]);t.classes.toggle("tooltip-n","bc-tc"===i),t.classes.toggle("tooltip-nw","bc-tl"===i),t.classes.toggle("tooltip-ne","bc-tr"===i),t.moveRel(e.target,i)}})},statusLevel:function(e){return 0<arguments.length&&this.state.set("statusLevel",e),this.state.get("statusLevel")},statusMessage:function(e){return 0<arguments.length&&this.state.set("statusMessage",e),this.state.get("statusMessage")},showMenu:function(){var e,t=this,n=t.settings;t.menu||((e=n.menu||[]).length?e={type:"menu",items:e}:e.type=e.type||"menu",t.menu=b.create(e).parent(t).renderTo(t.getContainerElm()),t.fire("createmenu"),t.menu.reflow(),t.menu.on("cancel",function(e){e.control===t.menu&&
amp;t.focus()}),t.menu.on("show hide",function(e){e.control.items().each(function(e){e.active(e.value()===t.value())})}).fire("show"),t.menu.on("select",function(e){t.value(e.control.value())}),t.on("focusin",function(e){"INPUT"===e.target.tagName.toUpperCase()&&t.menu.hide()}),t.aria("expanded",!0)),t.menu.show(),t.menu.layoutRect({w:t.layoutRect().w}),t.menu.moveRel(t.getEl(),t.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var e,t,n=this,i=n.getEl(),r=n.getEl("open"),o=n.layoutRect(),s=0,a=i.firstChild;n.statusLevel()&&"none"!==n.statusLevel()&&(s=parseInt(Ce.getRuntimeStyle(a,"padding-right"),10)-parseInt(Ce.getRuntimeStyle(a,"padding-left"),10)),e=r?o.w-Ce.getSize(r).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documen
tMode<=8)&&(t=n.layoutRect().h-2+"px"),we(a).css({width:e-s,lineHeight:t}),n._super(),n},postRender:function(){var t=this;return we(this.getEl("inp")).on("change",function(e){t.state.set("value",e.target.value),t.fire("change",e)}),t._super()},renderHtml:function(){var e,t,n,i=this,r=i._id,o=i.settings,s=i.classPrefix,a=i.state.get("value")||"",l="",u="";return"spellcheck"in o&&(u+=' spellcheck="'+o.spellcheck+'"'),o.maxLength&&(u+=' maxlength="'+o.maxLength+'"'),o.size&&(u+=' size="'+o.size+'"'),o.subtype&&(u+=' type="'+o.subtype+'"'),n='<i id="'+r+'-status" class="mce-status mce-ico" style="display: none"></i>',i.disabled()&&(u+=' disabled="disabled"'),(e=o.icon)&&"caret"!==e&&(e=s+"ico "+s+"i-"+o
.icon),t=i.state.get("text"),(e||t)&&(l='<div id="'+r+'-open" class="'+s+"btn "+s+'open" tabIndex="-1" role="button"><button id="'+r+'-action" type="button" hidefocus="1" tabindex="-1">'+("caret"!==e?'<i class="'+e+'"></i>':'<i class="'+s+'caret"></i>')+(t?(e?" ":"")+t:"")+"</button></div>",i.classes.add("has-open")),'<div id="'+r+'" class="'+i.classes+'"><input id="'+r+'-inp" class="'+s+'textbox" value="'+i.encode(a,!1)+'" hidefocus="1"'+u+' placeholder="'+i.encode(o.placeholder)+'" />'+n+l+"</div>"},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("val
ue",this.getEl("inp").value),this.state.get("value"))},showAutoComplete:function(e,i){var r=this;if(0!==e.length){r.menu?r.menu.items().remove():r.menu=b.create({type:"menu",classes:"combobox-menu",layout:"flow"}).parent(r).renderTo(),w.each(e,function(e){var t,n;r.menu.add({text:e.title,url:e.previewUrl,match:i,classes:"menu-item-ellipsis",onclick:(t=e.value,n=e.title,function(){r.fire("selectitem",{title:n,value:t})})})}),r.menu.renderNew(),r.hideMenu(),r.menu.on("cancel",function(e){e.control.parent()===r.menu&&(e.stopPropagation(),r.focus(),r.hideMenu())}),r.menu.on("select",function(){r.focus()});var t=r.layoutRect().w;r.menu.layoutRect({w:t,minW:0,maxW:t}),r.menu.repaint(),r.menu.reflow(),r.menu.show(),r.menu.moveRel(r.getEl(),r.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])}else r.hideMenu()},hideMenu:function(){this.menu&&this.m
enu.hide()},bindStates:function(){var r=this;r.state.on("change:value",function(e){r.getEl("inp").value!==e.value&&(r.getEl("inp").value=e.value)}),r.state.on("change:disabled",function(e){r.getEl("inp").disabled=e.value}),r.state.on("change:statusLevel",function(e){var t=r.getEl("status"),n=r.classPrefix,i=e.value;Ce.css(t,"display","none"===i?"none":""),Ce.toggleClass(t,n+"i-checkmark","ok"===i),Ce.toggleClass(t,n+"i-warning","warn"===i),Ce.toggleClass(t,n+"i-error","error"===i),r.classes.toggle("has-status","none"!==i),r.repaint()}),Ce.on(r.getEl("status"),"mouseleave",function(){r.tooltip().hide()}),r.on("cancel",function(e){r.menu&&r.menu.visible()&&(e.stopPropagation(),r.hideMenu())});var n=function(e,t){t&&0<t.items().length&
amp;&t.items().eq(e)[0].focus()};return r.on("keydown",function(e){var t=e.keyCode;"INPUT"===e.target.nodeName&&(t===Zt.DOWN?(e.preventDefault(),r.fire("autocomplete"),n(0,r.menu)):t===Zt.UP&&(e.preventDefault(),n(-1,r.menu)))}),r._super()},remove:function(){we(this.getEl("inp")).off(),this.menu&&this.menu.remove(),this._super()}}),en=Qt.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl("open"),n=t?t.getElementsByTagName("i")[0]:null;if(n)try{n.style.background=e}catch(i){}},bindStates:function(){var t=this;return t.state.on("change:value",function(e){t.state.get("rendered")&&t.repaintColor(e.value)}),t._super()}}),tn=jt.extend({showPanel:function(){var
t=this,e=t.settings;if(t.classes.add("opened"),t.panel)t.panel.show();else{var n=e.panel;n.type&&(n={layout:"grid",items:n}),n.role=n.role||"dialog",n.popover=!0,n.autohide=!0,n.ariaRoot=!0,t.panel=new kt(n).on("hide",function(){t.classes.remove("opened")}).on("cancel",function(e){e.stopPropagation(),t.focus(),t.hidePanel()}).parent(t).renderTo(t.getContainerElm()),t.panel.fire("show"),t.panel.reflow()}var i=t.panel.testMoveRel(t.getEl(),e.popoverAlign||(t.isRtl()?["bc-tc","bc-tl","bc-tr"]:["bc-tc","bc-tr","bc-tl","tc-bc","tc-br","tc-bl"]));t.panel.classes.toggle("start","l"===i.substr(-1)),t.panel.classes.toggle("end","r"===i.substr(-1));var r="t"===i.substr(0,1);t.panel.classes.toggle("bottom",!r),t.panel.classes.toggle("top",r),t.panel.moveRel(t.
getEl(),i)},hidePanel:function(){this.panel&&this.panel.hide()},postRender:function(){var t=this;return t.aria("haspopup",!0),t.on("click",function(e){e.control===t&&(t.panel&&t.panel.visible()?t.hidePanel():(t.showPanel(),t.panel.focus(!!e.aria)))}),t._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}}),nn=v.DOM,rn=tn.extend({init:function(e){this._super(e),this.classes.add("splitbtn"),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,i=e.state.get("text"),r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",o=e.settings.image?" style=\"background-ima
ge: url('"+e.settings.image+"')\"":"",s="";return i&&(e.classes.add("btn-has-text"),s='<span class="'+n+'txt">'+e.encode(i)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+o+"></i>":"")+'<span id="'+t+'-preview" class="'+n+'preview"></span>'+s+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1"> <i class="'+n+'caret"></i></button></div>'},postRender:function(){var t=this,n=t.settings.onclick;return t.on("click",function(e){e.aria&&"down"===e.
aria.key||e.control!==t||nn.getParent(e.target,"."+t.classPrefix+"open")||(e.stopImmediatePropagation(),n.call(t,e))}),delete t.settings.onclick,t._super()}}),on=tinymce.util.Tools.resolve("tinymce.util.Color"),sn=Wt.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){var n,i,r,o,s,a=this,l=a.color();function u(e,t){var n,i,r=Ce.getPos(e);return n=t.pageX-r.x,i=t.pageY-r.y,{x:n=Math.max(0,Math.min(n/e.clientWidth,1)),y:i=Math.max(0,Math.min(i/e.clientHeight,1))}}function c(e,t){var n=(360-e.h)/360;Ce.css(r,{top:100*n+"%"}),t||Ce.css(s,{left:e.s+"%",top:100-e.v+"%"}),o.style.background=on({s:100,v:100,h:e.h}).toHex(),a.color().parse({s:e.s,v:e.v,h:e.h})}function e(e){var t;t=u(o,e),n.s=100*t.x,n.v=100*(1-t.y),c(n),a.fire("change")}function t(e){var t;t=u(i,e),(n=l.toHsv()).h=360*(1-t.y),c(n,!0),a.fire("change")}i=a.getEl("h"),r=a.getEl
("hp"),o=a.getEl("sv"),s=a.getEl("svp"),a._repaint=function(){c(n=l.toHsv())},a._super(),a._svdraghelper=new ft(a._id+"-sv",{start:e,drag:e}),a._hdraghelper=new ft(a._id+"-h",{start:t,drag:t}),a._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){if(!arguments.length)return this.color().toHex();this.color().parse(e),this._rendered&&this._repaint()},color:function(){return this._color||(this._color=on()),this._color},renderHtml:function(){var e,t=this._id,o=this.classPrefix,s="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000";return e='<div id="'+t+'-h" class="'+o+'colorpicker-h" style="background: -ms-linear-gradient(top,'+s+");background: linear-gradient(to bottom,"+s+');">'+function(){var e,t,n,i,r="";for(n="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startC
olorstr=",e=0,t=(i=s.split(",")).length-1;e<t;e++)r+='<div class="'+o+'colorpicker-h-chunk" style="height:'+100/t+"%;"+n+i[e]+",endColorstr="+i[e+1]+");-ms-"+n+i[e]+",endColorstr="+i[e+1]+')"></div>';return r}()+'<div id="'+t+'-hp" class="'+o+'colorpicker-h-marker"></div></div>','<div id="'+t+'" class="'+this.classes+'"><div id="'+t+'-sv" class="'+o+'colorpicker-sv"><div class="'+o+'colorpicker-overlay1"><div class="'+o+'colorpicker-overlay2"><div id="'+t+'-svp" class="'+o+'colorpicker-selector1"><div class="'+o+'colorpicker-selector2"></div></div></div></div></div>'+e+"</div>"}}),an=Wt.extend({init:function(e){e=w.extend({height:100,text:"Drop an image here",multiple:!1,accept:
null},e),this._super(e),this.classes.add("dropzone"),e.multiple&&this.classes.add("multiple")},renderHtml:function(){var e,t,n=this.settings;return e={id:this._id,hidefocus:"1"},t=Ce.create("div",e,"<span>"+this.translate(n.text)+"</span>"),n.height&&Ce.css(t,"height",n.height+"px"),n.width&&Ce.css(t,"width",n.width+"px"),t.className=this.classes,t.outerHTML},postRender:function(){var i=this,e=function(e){e.preventDefault(),i.classes.toggle("dragenter"),i.getEl().className=i.classes};i._super(),i.$el.on("dragover",function(e){e.preventDefault()}),i.$el.on("dragenter",e),i.$el.on("dragleave",e),i.$el.on("drop",function(e){if(e.preventDefault(),!i.state.get("disabled")){var t=function(e){var t=i.settings.accept;if("string"!=typeof t)return e;var n=new RegExp("("+t.split(/\
s*,\s*/).join("|")+")$","i");return w.grep(e,function(e){return n.test(e.name)})}(e.dataTransfer.files);i.value=function(){return t.length?i.settings.multiple?t:t[0]:null},t.length&&i.fire("change",e)}})},remove:function(){this.$el.off(),this._super()}}),ln=Wt.extend({init:function(e){var n=this;e.delimiter||(e.delimiter="\xbb"),n._super(e),n.classes.add("path"),n.canFocus=!0,n.on("click",function(e){var t;(t=e.target.getAttribute("data-index"))&&n.fire("select",{value:n.row()[t],index:t})}),n.row(n.settings.row)},focus:function(){return this.getEl().firstChild.focus(),this},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'">'+this._getDataPathHtml(this.state.get("row"))+"</div>"},bindState
s:function(){var t=this;return t.state.on("change:row",function(e){t.innerHtml(t._getDataPathHtml(e.value))}),t._super()},_getDataPathHtml:function(e){var t,n,i=e||[],r="",o=this.classPrefix;for(t=0,n=i.length;t<n;t++)r+=(0<t?'<div class="'+o+'divider" aria-hidden="true"> '+this.settings.delimiter+" </div>":"")+'<div role="button" class="'+o+"path-item"+(t===n-1?" "+o+"last":"")+'" data-index="'+t+'" tabindex="-1" id="'+this._id+"-"+t+'" aria-level="'+(t+1)+'">'+i[t].name+"</div>";return r||(r='<div class="'+o+'path-item">\xa0</div>'),r}}),un=ln.extend({postRender:function(){var o=this,s=o.settings.editor;function a(e){if(1===e.nodeType){if("BR"===e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttr
ibute("data-mce-type"))return!0}return!1}return!1!==s.settings.elementpath&&(o.on("select",function(e){s.focus(),s.selection.select(this.row()[e.index].element),s.nodeChanged()}),s.on("nodeChange",function(e){for(var t=[],n=e.parents,i=n.length;i--;)if(1===n[i].nodeType&&!a(n[i])){var r=s.fire("ResolveName",{name:n[i].nodeName.toLowerCase(),target:n[i]});if(r.isDefaultPrevented()||t.push({name:r.name,element:n[i]}),r.isPropagationStopped())break}o.row(t)})),o._super()}}),cn=ct.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<div id="'+e._id+'-title" class="'+n+'title">'+e.settings.title+"</div>":&
quot;")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}}),dn=ct.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:15,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var i=this,e=i.items();i.settings.formItemDefaults||(i.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),e.each(function(e){var t,n=e.settings.label;n&&((t=new cn(w.extend({items:{type:"label",id:e._id+"-l",text:n,flex:0,forId:e._id,disabled:e.disabled()}},i.settings.formItemDefaults))).type="formitem",e.aria("labelledby",e._id+"-l"),"undefined"==typeof e.settings.flex&&(e.settings.flex=1),i.replace(e,t),t.add(e))})},submit:function(){return
this.fire("submit",{data:this.toJSON()})},postRender:function(){this._super(),this.fromJSON(this.settings.data)},bindStates:function(){var n=this;function e(){var e,t,i=0,r=[];if(!1!==n.settings.labelGapCalc)for(("children"===n.settings.labelGapCalc?n.find("formitem"):n.items()).filter("formitem").each(function(e){var t=e.items()[0],n=t.getEl().clientWidth;i=i<n?n:i,r.push(t)}),t=n.settings.labelGap||0,e=r.length;e--;)r[e].settings.minWidth=i+t}n._super(),n.on("show",e),e()}}),fn=dn.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'<fieldset id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<legend id=
"'+e._id+'-title" class="'+n+'fieldset-title">'+e.settings.title+"</legend>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></fieldset>"}}),hn=0,mn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:k(e)}},gn={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),"HTML must have a single root node";return mn(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return mn(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return mn(n)},fromDom:mn,fromPoint:function(e,t,n){var i=e.dom();return D.from(i.elementFromPoint(t,n)).map(mn)}},pn=function(n){var i,r=!1;return
function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r||(r=!0,i=n.apply(null,e)),i}},vn={ATTRIBUTE:Node.ATTRIBUTE_NODE,CDATA_SECTION:Node.CDATA_SECTION_NODE,COMMENT:Node.COMMENT_NODE,DOCUMENT:Node.DOCUMENT_NODE,DOCUMENT_TYPE:Node.DOCUMENT_TYPE_NODE,DOCUMENT_FRAGMENT:Node.DOCUMENT_FRAGMENT_NODE,ELEMENT:Node.ELEMENT_NODE,TEXT:Node.TEXT_NODE,PROCESSING_INSTRUCTION:Node.PROCESSING_INSTRUCTION_NODE,ENTITY_REFERENCE:Node.ENTITY_REFERENCE_NODE,ENTITY:Node.ENTITY_NODE,NOTATION:Node.NOTATION_NODE},bn=function(e){return e.dom().nodeType},yn=function(t){return function(e){return bn(e)===t}},xn=(yn(vn.ELEMENT),yn(vn.TEXT),yn(vn.DOCUMENT),pn(function(){return xn(gn.fromDom(document))}),function(e){var t=e.dom().body;if(null===t||t===undefined)throw"Body is not available yet";return gn.fromDom(t)}),wn=("undefined"!=typeof window?window:Function("return this;")(),function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(
i.test(t))return i}return undefined}(e,t);if(!n)return{major:0,minor:0};var i=function(e){return Number(t.replace(n,"$"+e))};return Cn(i(1),i(2))}),_n=function(){return Cn(0,0)},Cn=function(e,t){return{major:e,minor:t}},Rn={nu:Cn,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?_n():wn(e,n)},unknown:_n},En="Firefox",kn=function(e,t){return function(){return t===e}},Tn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:kn("Edge",t),isChrome:kn("Chrome",t),isIE:kn("IE",t),isOpera:kn("Opera",t),isFirefox:kn(En,t),isSafari:kn("Safari",t)}},Hn={unknown:function(){return Tn({current:undefined,version:Rn.unknown()})},nu:Tn,edge:k("Edge"),chrome:k("Chrome"),ie:k("IE"),opera:k("Opera"),firefox:k(En),safari:k("Safari")},Sn="Windows",Mn="Android",Nn="Solaris",Pn="FreeBSD",Dn=function(e,t){return
function(){return t===e}},Wn=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Dn(Sn,t),isiOS:Dn("iOS",t),isAndroid:Dn(Mn,t),isOSX:Dn("OSX",t),isLinux:Dn("Linux",t),isSolaris:Dn(Nn,t),isFreeBSD:Dn(Pn,t)}},On={unknown:function(){return Wn({current:undefined,version:Rn.unknown()})},nu:Wn,windows:k(Sn),ios:k("iOS"),android:k(Mn),linux:k("Linux"),osx:k("OSX"),solaris:k(Nn),freebsd:k(Pn)},An=function(e,t){var n=String(t).toLowerCase();return Z(e,function(e){return e.search(n)})},Bn=function(e,n){return An(e,n).map(function(e){var t=Rn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Ln=function(e,n){return An(e,n).map(function(e){var t=Rn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},In=function(e,t){return-1!==e.indexOf(t)},zn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Fn=function(t){return function(e){return In(e,t)}},Un=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]
+)\.([0-9]+)$/],search:function(e){return In(e,"edge/")&&In(e,"chrome")&&In(e,"safari")&&In(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,zn],search:function(e){return In(e,"chrome")&&!In(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return In(e,"msie")||In(e,"trident")}},{name:"Opera",versionRegexes:[zn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Fn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Fn("firefox")},{name:"Safari",versionRegexes:[zn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(In(e,"safari")||In(e,"mobile/"))&&In(e,"applewebkit")}}],Vn=[{name:"Windows",search:Fn("win"
;),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return In(e,"iphone")||In(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Fn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Fn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Fn("linux"),versionRegexes:[]},{name:"Solaris",search:Fn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Fn("freebsd"),versionRegexes:[]}],Yn={browsers:k(Un),oses:k(Vn)},$n=function(e){var t,n,i,r,o,s,a,l,u,c,d,f=Yn.browsers(),h=Yn.oses(),m=Bn(f,e).fold(Hn.unknown,Hn.nu),g=Ln(h,e).fold(On.unknown,On.nu);return{browser:m,os:g,deviceType:(n=m,i=e,r=(t=g).isiOS()&&!0===/ipad/i.test(i),o=t.isiOS()&&!r,
s=t.isAndroid()&&3===t.version.major,a=t.isAndroid()&&4===t.version.major,l=r||s||a&&!0===/mobile/i.test(i),u=t.isiOS()||t.isAndroid(),c=u&&!l,d=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(i),{isiPad:k(r),isiPhone:k(o),isTablet:k(l),isPhone:k(c),isTouch:k(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:k(d)})}},Xn=pn(function(){var e=navigator.userAgent;return $n(e)}),qn=vn.ELEMENT,jn=vn.DOCUMENT,Jn=function(e){return e.nodeType!==qn&&e.nodeType!==jn||0===e.childElementCount},Gn={all:function(e,t){var n=t===undefined?document:t.dom();return Jn(n)?[]:J(n.querySelectorAll(e),gn.fromDom)},is:function(e,t){var n=e.dom();if(n.nodeType!==qn)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks n
ative selectors")},one:function(e,t){var n=t===undefined?document:t.dom();return Jn(n)?D.none():D.from(n.querySelector(e)).map(gn.fromDom)}},Kn=(Xn().browser.isIE(),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}("element","offset"),function(e,t){return Gn.all(t,e)}),Zn=w.trim,Qn=function(t){return function(e){if(e&&1===e.nodeType){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},ei=Qn("true"),ti=Qn("false"),ni=function(e,t,n,i,r){return{type:e,title:t,url:n,level:i,attach:r}},ii=function(e){return e.innerText||e.textContent},ri=function(e){return e.id?e.id:(t="h",n=(new Date).getTime(),t+"_"+Math.floor(1e9*Math.random())+ ++hn+String(n));var t,n},oi=function(e){return(t=e)&&"A"===t.nodeName&&(t.id||t.name)&&ai(e);var t},si=function(e){return e&&/^(H[1-6])$/.test(e.nodeName)},ai=fu
nction(e){return function(e){for(;e=e.parentNode;){var t=e.contentEditable;if(t&&"inherit"!==t)return ei(e)}return!1}(e)&&!ti(e)},li=function(e){return si(e)&&ai(e)},ui=function(e){var t,n=ri(e);return ni("header",ii(e),"#"+n,si(t=e)?parseInt(t.nodeName.substr(1),10):0,function(){e.id=n})},ci=function(e){var t=e.id||e.name,n=ii(e);return ni("anchor",n||"#"+t,"#"+t,0,E)},di=function(e){var t,n;return t="h1,h2,h3,h4,h5,h6,a:not([href])",n=e,J(Kn(gn.fromDom(n),t),function(e){return e.dom()})},fi=function(e){return 0<Zn(e.title).length},hi=function(e){var t,n=di(e);return K((t=n,J(K(t,li),ui)).concat(J(K(n,oi),ci)),fi)},mi={},gi=function(e){return{title:e.title,value:{title:{raw:e.title},url:e.url,attach:e.attach}}},pi=function(e,t){return{title:e,value:{title:e,url:t,attach:E}}},vi=function(e,t,n){var i=t in e?e[t]:n;return!1===i?null:i},bi=function(e,i,r,t){var n,o,s,a,l,u,c={title:"-
"},d=function(e){var t=e.hasOwnProperty(r)?e[r]:[],n=K(t,function(e){return t=e,!j(i,function(e){return e.url===t});var t});return w.map(n,function(e){return{title:e,value:{title:e,url:e,attach:E}}})},f=function(t){var e,n=K(i,function(e){return e.type===t});return e=n,w.map(e,gi)};return!1===t.typeahead_urls?[]:"file"===r?(n=[xi(e,d(mi)),xi(e,f("header")),xi(e,(a=f("anchor"),l=vi(t,"anchor_top","#top"),u=vi(t,"anchor_bottom","#bottom"),null!==l&&a.unshift(pi("<top>",l)),null!==u&&a.push(pi("<bottom>",u)),a))],o=function(e,t){return 0===e.length||0===t.length?e.concat(t):e.concat(c,t)},s=[],G(n,function(e){s=o(s,e)}),s):xi(e,d(mi))},yi=function(e,t){var n,i,r,o=mi[t];/^https?/.test(e)&&(o?(n=o,i=e,r=q(n,i),-1===r?D.none():D.some(r)).isNone()&&(mi[t]=o.slice(0,5).concat(e)):mi[t]=[e])},xi=function(e,t){var n=e.toLowerCase(),i=w.grep(t,function(e){
return-1!==e.title.toLowerCase().indexOf(n)});return 1===i.length&&i[0].title===e?[]:i},wi=function(o,e,n){var i=e.filepicker_validator_handler;i&&o.state.on("change:value",function(e){var t;0!==(t=e.value).length?i({url:t,type:n},function(e){var t,n,i,r=(n=(t=e).status,i=t.message,"valid"===n?{status:"ok",message:i}:"unknown"===n?{status:"warn",message:i}:"invalid"===n?{status:"warn",message:i}:{status:"none",message:""});o.statusMessage(r.message),o.statusLevel(r.status)}):o.statusLevel("none")})},_i=Qt.extend({Statics:{clearHistory:function(){mi={}}},init:function(e){var t,n,i,r,o,s,a,l,u=this,c=window.tinymce?window.tinymce.activeEditor:h.activeEditor,d=c.settings,f=e.filetype;e.spellcheck=!1,(i=d.file_picker_types||d.file_browser_callback_types)&&(i=w.makeMap(i,/[, ]/)),i&&!i[f]||(!(n=d.file_picker_callback)||i&&!i[f]?!(n=d.file_browser_cal
lback)||i&&!i[f]||(t=function(){n(u.getEl("inp").id,u.value(),f,window)}):t=function(){var e=u.fire("beforecall").meta;e=w.extend({filetype:f},e),n.call(c,function(e,t){u.value(e).fire("change",{meta:t})},u.value(),e)}),t&&(e.icon="browse",e.onaction=t),u._super(e),u.classes.add("filepicker"),r=u,o=d,s=c.getBody(),a=f,l=function(e){var t=hi(s),n=bi(e,t,a,o);r.showAutoComplete(n,e)},r.on("autocomplete",function(){l(r.value())}),r.on("selectitem",function(e){var t=e.value;r.value(t.url);var n,i=(n=t.title).raw?n.raw:n;"image"===a?r.fire("change",{meta:{alt:i,attach:t.attach}}):r.fire("change",{meta:{text:i,attach:t.attach}}),r.focus()}),r.on("click",function(e){0===r.value().length&&"INPUT"===e.target.nodeName&&l("")}),r.on("PostRender",function(){r.getRoot().on("submit",function(e){e.isDefaultPrevented()|
|yi(r.value(),a)})}),wi(u,d,f)}}),Ci=qt.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}}),Ri=qt.extend({recalc:function(e){var t,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,C,R,E,k,T,H,S,M,N,P,D,W,O,A,B,L=[],I=Math.max,z=Math.min;for(i=e.items().filter(":visible"),r=e.layoutRect(),o=e.paddingBox,s=e.settings,f=e.isRtl()?s.direction||"row-reversed":s.direction,a=s.align,l=e.isRtl()?s.pack||"end":s.pack,u=s.spacing||0,"row-reversed"!==f&&"column-reverse"!==f||(i=i.set(i.toArray().reverse()),f=f.split("-")[0]),"column"===f?(R="y",_="h",C="minH",E="maxH",T="innerH",k="top",H="deltaH",S="contentH",W="left",P="w",M="x",N=
"innerW",D="minW",O="right",A="deltaW",B="contentW"):(R="x",_="w",C="minW",E="maxW",T="innerW",k="left",H="deltaW",S="contentW",W="top",P="h",M="y",N="innerH",D="minH",O="bottom",A="deltaH",B="contentH"),d=r[T]-o[k]-o[k],w=c=0,t=0,n=i.length;t<n;t++)m=(h=i[t]).layoutRect(),d-=t<n-1?u:0,0<(g=h.settings.flex)&&(c+=g,m[E]&&L.push(h),m.flex=g),d-=m[C],w<(p=o[W]+m[D]+o[O])&&(w=p);if((y={})[C]=d<0?r[C]-d+r[H]:r[T]-d+r[H],y[D]=w+r[A],y[S]=r[T]-d,y[B]=w,y.minW=z(y.minW,r.maxW),y.minH=z(y.minH,r.maxH),y.minW=I(y.minW,r.startMinWidth),y.minH=I(y.minH,r.startMinHeight),!r.autoResize||y.minW===r.minW&&y.minH===r.minH){for(b=d/c,t=0,n=L.length;t<n;t++)(v=(m=(h=L[t]).layoutRect())[E])<(p=m[C]+m.flex*b)?(d-=m[E]-m[C],c-=m.flex,m.flex=0,m.m
axFlexSize=v):m.maxFlexSize=0;for(b=d/c,x=o[k],y={},0===c&&("end"===l?x=d+o[k]:"center"===l?(x=Math.round(r[T]/2-(r[T]-d)/2)+o[k])<0&&(x=o[k]):"justify"===l&&(x=o[k],u=Math.floor(d/(i.length-1)))),y[M]=o[W],t=0,n=i.length;t<n;t++)p=(m=(h=i[t]).layoutRect()).maxFlexSize||m[C],"center"===a?y[M]=Math.round(r[N]/2-m[P]/2):"stretch"===a?(y[P]=I(m[D]||0,r[N]-o[W]-o[O]),y[M]=o[W]):"end"===a&&(y[M]=r[N]-m[P]-o.top),0<m.flex&&(p+=m.flex*b),y[_]=p,y[R]=x,h.layoutRect(y),h.recalc&&h.recalc(),x+=p+u}else if(y.w=y.minW,y.h=y.minH,e.layoutRect(y),this.recalc(e),null===e._lastRect){var F=e.parent();F&&(F._lastRect=null,F.recalc())}}}),Ei=Xt.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})},isNa
tive:function(){return!0}}),ki=function(e,t){return Gn.one(t,e)},Ti=function(e,t){return function(){e.execCommand("mceToggleFormat",!1,t)}},Hi=function(e,t,n){var i=function(e){n(e,t)};e.formatter?e.formatter.formatChanged(t,i):e.on("init",function(){e.formatter.formatChanged(t,i)})},Si=function(e,n){return function(t){Hi(e,n,function(e){t.control.active(e)})}},Mi=function(i){var t=["alignleft","aligncenter","alignright","alignjustify"],r="alignleft",e=[{text:"Left",icon:"alignleft",onclick:Ti(i,"alignleft")},{text:"Center",icon:"aligncenter",onclick:Ti(i,"aligncenter")},{text:"Right",icon:"alignright",onclick:Ti(i,"alignright")},{text:"Justify",icon:"alignjustify",onclick:Ti(i,"alignjustify")}];i.addMenuItem("align",{text:"Align",menu:e}),i.addButton("align",{type:&
quot;menubutton",icon:r,menu:e,onShowMenu:function(e){var n=e.control.menu;w.each(t,function(t,e){n.items().eq(e).each(function(e){return e.active(i.formatter.match(t))})})},onPostRender:function(e){var n=e.control;w.each(t,function(t,e){Hi(i,t,function(e){n.icon(r),e&&n.icon(t)})})}}),w.each({alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(e,t){i.addButton(t,{active:!1,tooltip:e[0],cmd:e[1],onPostRender:Si(i,t)})})},Ni=function(e){return e?e.split(",")[0]:""},Pi=function(l,u){return function(){var a=this;a.state.set("value",null),l.on("init nodeChange",function(e){var t,n,i,r,o=l.queryCommandValue("FontName"),s=(t=u,r=(n=o)?n.toLowerCase():"",w.ea
ch(t,function(e){e.value.toLowerCase()===r&&(i=e.value)}),w.each(t,function(e){i||Ni(e.value).toLowerCase()!==Ni(r).toLowerCase()||(i=e.value)}),i);a.value(s||null),!s&&o&&a.text(Ni(o))})}},Di=function(n){n.addButton("fontselect",function(){var e,t=(e=function(e){for(var t=(e=e.replace(/;$/,"").split(";")).length;t--;)e[t]=e[t].split("=");return e}(n.settings.font_formats||"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wing
dings=wingdings,zapf dingbats"),w.map(e,function(e){return{text:{raw:e[0]},value:e[1],textStyle:-1===e[1].indexOf("dings")?"font-family:"+e[1]:""}}));return{type:"listbox",text:"Font Family",tooltip:"Font Family",values:t,fixedWidth:!0,onPostRender:Pi(n,t),onselect:function(e){e.control.settings.value&&n.execCommand("FontName",!1,e.control.settings.value)}}})},Wi=function(e){Di(e)},Oi=function(e,t){return/[0-9.]+px$/.test(e)?(n=72*parseInt(e,10)/96,i=t||0,r=Math.pow(10,i),Math.round(n*r)/r+"pt"):e;var n,i,r},Ai=function(e,t,n){var i;return w.each(e,function(e){e.value===n?i=n:e.value===t&&(i=t)}),i},Bi=function(n){n.addButton("fontsizeselect",function(){var e,s,a,t=(e=n.settings.fontsize_formats||"8pt 10pt 12pt 14pt 18pt 24pt 36pt",w.map(e.split(" "),function(e){var t=e,n=e,i=e.split("=");return 1<i.length&&(t=i[0],n=i[1]),{text:t,va
lue:n}}));return{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:t,fixedWidth:!0,onPostRender:(s=n,a=t,function(){var o=this;s.on("init nodeChange",function(e){var t,n,i,r;if(t=s.queryCommandValue("FontSize"))for(i=3;!r&&0<=i;i--)n=Oi(t,i),r=Ai(a,n,t);o.value(r||null),r||o.text(n)})}),onclick:function(e){e.control.settings.value&&n.execCommand("FontSize",!1,e.control.settings.value)}}})},Li=function(e){Bi(e)},Ii=function(n,e){var i=e.length;return w.each(e,function(e){e.menu&&(e.hidden=0===Ii(n,e.menu));var t=e.format;t&&(e.hidden=!n.formatter.canApply(t)),e.hidden&&i--}),i},zi=function(n,e){var i=e.items().length;return e.items().each(function(e){e.menu&&e.visible(0<zi(n,e.menu)),!e.menu&&e.settings.menu&&e.visible(0<Ii(n,e.settings.menu));var t=e.settings.format;t&&e.visible(n.formatter.canApply(t)),e.visible()||i--}),i},Fi=funct
ion(e){var i,r,o,t,s,n,a,l,u=(r=0,o=[],t=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code
"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],s=function(e){var i=[];if(e)return w.each(e,function(e){var t={text:e.title,icon:e.icon};if(e.items)t.menu=s(e.items);else{var n=e.format||"custom"+r++;e.format||(e.name=n,o.push(e)),t.format=n,t.cmd=e.cmd}i.push(t)}),i},(i=e).on("init",function(){w.each(o,function(e){i.formatter.register(e.name,e)})}),{type:"menu",items:i.settings.s
tyle_formats_merge?i.settings.style_formats?s(t.concat(i.settings.style_formats)):s(t):s(i.settings.style_formats||t),onPostRender:function(e){i.fire("renderFormatsMenu",{control:e.control})},itemDefaults:{preview:!0,textStyle:function(){if(this.settings.format)return i.formatter.getCssText(this.settings.format)},onPostRender:function(){var n=this;n.parent().on("show",function(){var e,t;(e=n.settings.format)&&(n.disabled(!i.formatter.canApply(e)),n.active(i.formatter.match(e))),(t=n.settings.cmd)&&n.active(i.queryCommandState(t))})},onclick:function(){this.settings.format&&Ti(i,this.settings.format)(),this.settings.cmd&&i.execCommand(this.settings.cmd)}}});n=u,e.addMenuItem("formats",{text:"Formats",menu:n}),l=u,(a=e).addButton("styleselect",{type:"menubutton",text:"Formats",menu:l,onShowMenu:function(){a.settings.style_formats_autohide&&zi(a,this.menu)}})},Ui=function(n,e){
return function(){var r,o,s,t=[];return w.each(e,function(e){t.push({text:e[0],value:e[1],textStyle:function(){return n.formatter.getCssText(e[1])}})}),{type:"listbox",text:e[0][0],values:t,fixedWidth:!0,onselect:function(e){if(e.control){var t=e.control.value();Ti(n,t)()}},onPostRender:(r=n,o=t,function(){var t=this;r.on("nodeChange",function(e){var n=r.formatter,i=null;w.each(e.parents,function(t){if(w.each(o,function(e){if(s?n.matchNode(t,s,{value:e.value})&&(i=e.value):n.matchNode(t,e.value)&&(i=e.value),i)return!1}),i)return!1}),t.value(i)})})}}},Vi=function(e){var t,n,i=function(e){for(var t=(e=e.replace(/;$/,"").split(";")).length;t--;)e[t]=e[t].split("=");return e}(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");e.addMenuItem("blockformats",{text:"Blocks",menu:(t=e,n=i,w.map(n,function(e){retur
n{text:e[0],onclick:Ti(t,e[1]),textStyle:function(){return t.formatter.getCssText(e[1])}}}))}),e.addButton("formatselect",Ui(e,i))},Yi=function(t,e){var n,i;if("string"==typeof e)i=e.split(" ");else if(w.isArray(e))return function(e){for(var t=[],n=0,i=e.length;n<i;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);te.apply(t,e[n])}return t}(w.map(e,function(e){return Yi(t,e)}));return n=w.grep(i,function(e){return"|"===e||e in t.menuItems}),w.map(n,function(e){return"|"===e?{text:"-"}:t.menuItems[e]})},$i=function(e){return e&&"-"===e.text},Xi=function(e){var t=K(e,function(e,t,n){return!$i(e)||!$i(n[t-1])});return K(t,function(e,t,n){return!$i(e)||0<t&&t<n.length-1})},qi=function(e){var t,n,i,r,o=e.settings.insert_button_items;return Xi(o?Yi(e,o):(t=e,n="insert",i=[{text:"-"}],r=w.grep
(t.menuItems,function(e){return e.context===n}),w.each(r,function(e){"before"===e.separator&&i.push({text:"|"}),e.prependToContext?i.unshift(e):i.push(e),"after"===e.separator&&i.push({text:"|"})}),i))},ji=function(e){var t;(t=e).addButton("insert",{type:"menubutton",icon:"insert",menu:[],oncreatemenu:function(){this.menu.add(qi(t)),this.menu.renderNew()}})},Ji=function(e){var n,i,r;n=e,w.each({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(e,t){n.addButton(t,{active:!1,tooltip:e,onPostRender:Si(n,t),onclick:Ti(n,t)})}),i=e,w.each({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste",&quo
t;Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"],removeformat:["Clear formatting","RemoveFormat"],remove:["Remove","Delete"]},function(e,t){i.addButton(t,{tooltip:e[0],cmd:e[1]})}),r=e,w.each({blockquote:["Blockquote","mceBlockQuote"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"]},function(e,t){r.addButton(t,{active:!1,tooltip:e[0],cmd:e[1],onPostRender:Si(r,t)})})},Gi=function(e){var n;Ji(e),n=e,w.each({bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline","Meta+U"],strikethrough:["Strikethrough","Strikethr
ough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"],newdocument:["New document","mceNewDocument"],cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"]},function(e,t){n.addMenuItem(t,{text:e[0],icon:t,shortcut:e[2],cmd:e[1]})}),n.addMenuItem("codeformat",{text:"Code",icon:"code",onclick:Ti(n,"code")})},Ki=function(n,i){return function(){var e=this,t=function(){var e="redo"===i?"hasRedo":"hasUndo";return!!n.undoManager&&n.undoManager[e]()};e.disabled(!t()),n.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){e.disabled(
n.readonly||!t())})}},Zi=function(e){var t,n;(t=e).addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:Ki(t,"undo"),cmd:"undo"}),t.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:Ki(t,"redo"),cmd:"redo"}),(n=e).addButton("undo",{tooltip:"Undo",onPostRender:Ki(n,"undo"),cmd:"undo"}),n.addButton("redo",{tooltip:"Redo",onPostRender:Ki(n,"redo"),cmd:"redo"})},Qi=function(e){var t,n;(t=e).addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:(n=t,function(){var t=this;n.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(n.hasVisual)}),cmd:"mceToggleVisualAid"})},er={setup:function(e){var t;e.rtl&&(st.rtl=!0),e.on("mousedown",function(){kt.hideAll()}),(t=e).set
tings.ui_container&&(fe.container=ki(gn.fromDom(document.body),t.settings.ui_container).fold(k(null),function(e){return e.dom()})),Wt.tooltips=!fe.iOS,st.translate=function(e){return h.translate(e)},Vi(e),Mi(e),Gi(e),Zi(e),Li(e),Wi(e),Fi(e),Qi(e),ji(e)}},tr=qt.extend({recalc:function(e){var t,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,C,R,E,k,T,H,S=[],M=[];t=e.settings,r=e.items().filter(":visible"),o=e.layoutRect(),i=t.columns||Math.ceil(Math.sqrt(r.length)),n=Math.ceil(r.length/i),b=t.spacingH||t.spacing||0,y=t.spacingV||t.spacing||0,x=t.alignH||t.align,w=t.alignV||t.align,p=e.paddingBox,H="reverseRows"in t?t.reverseRows:e.isRtl(),x&&"string"==typeof x&&(x=[x]),w&&"string"==typeof w&&(w=[w]);for(d=0;d<i;d++)S.push(0);for(f=0;f<n;f++)M.push(0);for(f=0;f<n;f++)for(d=0;d<i&&(c=r[f*i+d]);d++)R=(u=c.layoutRect()).minW,E=u.minH,S[d]=R>S[d]?R:S[d],M[f]=E>M[f]?E:M[f];for(k=o.innerW-p.l
eft-p.right,d=_=0;d<i;d++)_+=S[d]+(0<d?b:0),k-=(0<d?b:0)+S[d];for(T=o.innerH-p.top-p.bottom,f=C=0;f<n;f++)C+=M[f]+(0<f?y:0),T-=(0<f?y:0)+M[f];if(_+=p.left+p.right,C+=p.top+p.bottom,(l={}).minW=_+(o.w-o.innerW),l.minH=C+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW===o.minW&&l.minH===o.minH){var N;o.autoResize&&((l=e.layoutRect(l)).contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH),N="start"===t.packV?0:0<T?Math.floor(T/n):0;var P=0,D=t.flexWidths;if(D)for(d=0;d<D.length;d++)P+=D[d];else P=i;var W=k/P;for(d=0;d<i;d++)S[d]+=D?D[d]*W:W;for(m=p.top,f=0;f<n;f++){for(h=p.left,a=M[f]+N,d=0;d<i&&(c=r[H?f*i+i-1-d:f*i+d]);d++)g=c.settings,u=c.layoutRect(),s=Math.max(S[d],u.startMinWidth),u.x=h,u.y=m,"center"===(v=g.alignH||(x?x[d]
||x[0]:null))?u.x=h+s/2-u.w/2:"right"===v?u.x=h+s-u.w:"stretch"===v&&(u.w=s),"center"===(v=g.alignV||(w?w[d]||w[0]:null))?u.y=m+a/2-u.h/2:"bottom"===v?u.y=m+a-u.h:"stretch"===v&&(u.h=a),c.layoutRect(u),h+=s+b,c.recalc&&c.recalc();m+=a+y}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var O=e.parent();O&&(O._lastRect=null,O.recalc())}}}),nr=Wt.extend({renderHtml:function(){var e=this;return e.classes.add("iframe"),e.canFocus=!1,'<iframe id="'+e._id+'" class="'+e.classes+'" tabindex="-1" src="'+(e.settings.url||"javascript:''")+'" frameborder="0"></iframe>'},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,i=this.getEl().contentWindow.document.body;return i?(i.innerHTML=e,t&&t()):u.setTimeout(function(){n.html(e)}),this}}),ir=Wt.extend({init:function(e){this._super(
e),this.classes.add("widget").add("infobox"),this.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+e.encode(e.state.get("text"))+'<button role="button" tabindex="-1"><i class="'+t+"ico "+t+'i-help"></i></button></div></div>'},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl("body").firstChild.data=t.encode(e.value),t.state.get("rendered")&&t.updateLayoutRect()}),t.state.on("change:help",function(e){t.classes.toggle("has-help",e.value),t.state.get
("rendered")&&t.updateLayoutRect()}),t._super()}}),rr=Wt.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,t=e._super();return e.settings.multiline&&(Ce.getSize(e.getEl()).width>t.maxW&&(t.minW=t.maxW,e.classes.add("multiline")),e.getEl().style.width=t.minW+"px",t.startMinH=t.h=t.minH=Math.min(t.maxH,Ce.getSize(e.getEl()).height)),t},repaint:function(){return this.settings.multiline||(this.getEl().style.lineHeight=this.layoutRect().h+"px"),this._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e,t,n=this,i=n.settings.forId,r=n.settings.html?n.settings.html:
n.encode(n.state.get("text"));return!i&&(t=n.settings.forName)&&(e=n.getRoot().find("#"+t)[0])&&(i=e._id),i?'<label id="'+n._id+'" class="'+n.classes+'"'+(i?' for="'+i+'"':"")+">"+r+"</label>":'<span id="'+n._id+'" class="'+n.classes+'">'+r+"</span>"},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.innerHtml(t.encode(e.value)),t.state.get("rendered")&&t.updateLayoutRect()}),t._super()}}),or=ct.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){this._super(e),this.classes.add("toolbar")},postRender:function(){return this.items().each(function(e){e.classes.add("toolbar-item")}),this._super()}}),sr=or.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton&
quot;}}}),ar=jt.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(e){var t,n=this;if(n.menu&&n.menu.visible()&&!1!==e)return n.hideMenu();n.menu||(t=n.state.get("menu")||[],n.classes.add("opened"),t.length?t={type:"menu",animate:!0,items:t}:(t.type=t.type||"menu",t.animate=!0),t.renderTo?n.menu=t.parent(n).show().renderTo():n.menu=b.create(t).parent(n).renderTo(),n.fire("createmenu"),n.menu.reflow(),n.menu.on("cancel",function(e){e.control.parent()===n.menu&&(e.stopPropagation(),n.focus(),n.hideMenu())}),n.menu.on("select",function(){n.focus()}),n.menu.on("show hide",function(e){e.control===n.menu&&(n.activeMenu("show"===e.type),n.classes.togg
le("opened","show"===e.type)),n.aria("expanded","show"===e.type)}).fire("show")),n.menu.show(),n.menu.layoutRect({w:n.layoutRect().w}),n.menu.repaint(),n.menu.moveRel(n.getEl(),n.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]),n.fire("showmenu")},hideMenu:function(){this.menu&&(this.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),this.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var e,t=this,n=t._id,i=t.classPrefix,r=t.settings.icon,o=t.state.get("text"),s="";return(e=t.settings.image)?(r="none","string"!=typeof e&&(e=window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",o&&(t.classes.add("btn-has-text"),s='<span class="'+i+'txt">'+t.encode(o)+"</span
>"),r=t.settings.icon?i+"ico "+i+"i-"+r:"",t.aria("role",t.parent()instanceof sr?"menuitem":"button"),'<div id="'+n+'" class="'+t.classes+'" tabindex="-1" aria-labelledby="'+n+'"><button id="'+n+'-open" role="presentation" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+e+"></i>":"")+s+' <i class="'+i+'caret"></i></button></div>'},postRender:function(){var r=this;return r.on("click",function(e){e.control===r&&function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}(e.target,r.getEl())&&(r.focus(),r.showMenu(!e.aria),e.aria&&r.menu.items().filter(":visible")[0].focus())}),r.on("mouseenter",function(e){var t,n=e.control,i=r.parent();n&&i&&n instanceof ar&&n.parent
()===i&&(i.items().filter("MenuButton").each(function(e){e.hideMenu&&e!==n&&(e.menu&&e.menu.visible()&&(t=!0),e.hideMenu())}),t&&(n.focus(),n.showMenu()))}),r._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}}),lr=kt.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var t=e.items,n=t.length;n--;)t[n]=w.extend({},e.itemDefaults,t[n]);this._super(e),this.classes.add("menu"),e.animate&&11!==fe.ie&&this.classes.add("animate")},repaint:function(){return this.classes
.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){this.hideAll(),this.fire("select")},load:function(){var t,n=this;function i(){n.throbber&&(n.throbber.hide(),n.throbber=null)}n.settings.itemsFactory&&(n.throbber||(n.throbber=new Mt(n.getEl("body"),!0),0===n.items().length?(n.throbber.show(),n.fire("loading")):n.throbber.show(100,function(){n.items().remove(),n.fire("loading")}),n.on("hide close",i)),n.requestTime=t=(new Date).getTime(),n.settings.itemsFactory(function(e){0!==e.length?n.requestTime===t&&(n.getEl().style.width="",n.getEl("body").style.width="",i(),n.items().remove(),n.getEl("body").innerHTML="",n.add(e),n.renderNew(),n.fire("loaded")):n.hide()}))},hideAll:function(){return this.find("menuitem").exec("hideM
enu"),this._super()},preRender:function(){var n=this;return n.items().each(function(e){var t=e.settings;if(t.icon||t.image||t.selectable)return!(n._hasIcons=!0)}),n.settings.itemsFactory&&n.on("postrender",function(){n.settings.itemsFactory&&n.load()}),n.on("show hide",function(e){e.control===n&&("show"===e.type?u.setTimeout(function(){n.classes.add("in")},0):n.classes.remove("in"))}),n._super()}}),ur=ar.extend({init:function(i){var t,r,o,n,s=this;s._super(i),i=s.settings,s._values=t=i.values,t&&("undefined"!=typeof i.value&&function e(t){for(var n=0;n<t.length;n++){if(r=t[n].selected||i.value===t[n].value)return o=o||t[n].text,s.state.set("value",t[n].value),!0;if(t[n].menu&&e(t[n].menu))return!0}}(t),!r&&0<t.length&&(o=t[0].text,s.state.set("value",t[0].value)),s.state.set("menu",t)),s.state.set("text",i.text
||o),s.classes.add("listbox"),s.on("select",function(e){var t=e.control;n&&(e.lastControl=n),i.multiple?t.active(!t.active()):s.value(e.control.value()),n=t})},value:function(t){return 0===arguments.length?this.state.get("value"):(void 0===t||(this.settings.values?0<w.grep(this.settings.values,function(e){return e.value===t}).length?this.state.set("value",t):null===t&&this.state.set("value",null):this.state.set("value",t)),this)},bindStates:function(){var i=this;return i.on("show",function(e){var t,n;t=e.control,n=i.value(),t instanceof lr&&t.items().each(function(e){e.hasMenus()||e.active(e.value()===n)})}),i.state.on("change:value",function(t){var n=function e(t,n){var i;if(t)for(var r=0;r<t.length;r++){if(t[r].value===n)return t[r];if(t[r].menu&&(i=e(t[r].menu,n)))return i}}(i.state.get("menu"),t.value);n?i.text(n.text):i.text(i.settings.text)}),i._super
()}}),cr=Wt.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t,n=this;n._super(e),e=n.settings,n.classes.add("menu-item"),e.menu&&n.classes.add("menu-item-expand"),e.preview&&n.classes.add("menu-item-preview"),"-"!==(t=n.state.get("text"))&&"|"!==t||(n.classes.add("menu-item-sep"),n.aria("role","separator"),n.state.set("text","-")),e.selectable&&(n.aria("role","menuitemcheckbox"),n.classes.add("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||n.classes.add("menu-item-normal"),n.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&n.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var t,n=this,e=n.settings,i=n.parent();if(i.items().each(function(e){e!==n&&
amp;e.hideMenu()}),e.menu){(t=n.menu)?t.show():((t=e.menu).length?t={type:"menu",items:t}:t.type=t.type||"menu",i.settings.itemDefaults&&(t.itemDefaults=i.settings.itemDefaults),(t=n.menu=b.create(t).parent(n).renderTo()).reflow(),t.on("cancel",function(e){e.stopPropagation(),n.focus(),t.hide()}),t.on("show hide",function(e){e.control.items&&e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),t.on("hide",function(e){e.control===t&&n.classes.remove("selected")}),t.submenu=!0),t._parentMenu=i,t.classes.add("menu-sub");var r=t.testMoveRel(n.getEl(),n.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);t.moveRel(n.getEl(),r),r="menu-sub-"+(t.rel=r),t.classes.remove(t._lastRel).add(r),t._lastRel=r,n.classes.add("selected"),n.aria(&qu
ot;expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){var e,t=this,n=t._id,i=t.settings,r=t.classPrefix,o=t.state.get("text"),s=t.settings.icon,a="",l=i.shortcut,u=t.encode(i.url);function c(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function d(e){var t=i.match||"";return t?e.replace(new RegExp(c(t),"gi"),function(e){return"!mce~match["+e+"]mce~match!"}):e}function f(e){return e.replace(new RegExp(c("!mce~match["),"g"),"<b>").replace(new RegExp(c("]mce~match!"),"g"),"</b>")}return s&&t.parent().classes.add("menu-has-icons"),i.image&&(a=" style=\"background-image: url('"+i.image+"')\""),l&&(l=function(e){var t
,n,i={};for(i=fe.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},e=e.split("+"),t=0;t<e.length;t++)(n=i[e[t].toLowerCase()])&&(e[t]=n);return e.join("+")}(l)),s=r+"ico "+r+"i-"+(t.settings.icon||"none"),e="-"!==o?'<i class="'+s+'"'+a+"></i>\xa0":"",o=f(t.encode(d(o))),u=f(t.encode(d(u))),'<div id="'+n+'" class="'+t.classes+'" tabindex="-1">'+e+("-"!==o?'<span id="'+n+'-text" class="'+r+'text">'+o+"</span>":"")+(l?'<div id="'+n+'-shortcut" class="'+r+'menu-shortcut">'+l+"</div>":"")+(i.menu?'<div class="'+r+'caret"></div>':"")+(u?'<div class="'+r+'menu-item-link">'+u+"</
div>":"")+"</div>"},postRender:function(){var t=this,n=t.settings,e=n.textStyle;if("function"==typeof e&&(e=e.call(this)),e){var i=t.getEl("text");i&&(i.setAttribute("style",e),t._textStyle=e)}return t.on("mouseenter click",function(e){e.control===t&&(n.menu||"click"!==e.type?(t.showMenu(),e.aria&&t.menu.focus(!0)):(t.fire("select"),u.requestAnimationFrame(function(){t.parent().hideAll()})))}),t._super(),t},hover:function(){return this.parent().items().each(function(e){e.classes.remove("selected")}),this.classes.toggle("selected",!0),this},active:function(e){return function(e,t){var n=e._textStyle;if(n){var i=e.getEl("text");i.setAttribute("style",n),t&&(i.style.color="",i.style.backgroundColor="")}}(this,e),void 0!==e&&this.aria("checked",e),this._super(e)},remove:function(
){this._super(),this.menu&&this.menu.remove()}}),dr=Kt.extend({Defaults:{classes:"radio",role:"radio"}}),fr=Wt.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.classes.add("resizehandle"),"both"===e.settings.direction&&e.classes.add("resizehandle-both"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"><i class="'+t+"ico "+t+'i-resize"></i></div>'},postRender:function(){var t=this;t._super(),t.resizeDragHelper=new ft(this._id,{start:function(){t.fire("ResizeStart")},drag:function(e){"both"!==t.settings.direction&&(e.deltaX=0),t.fire("Resize",e)},stop:function(){t.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}});function hr(e){var t="";if(e)for(var n=0;n<e.length;n++)t+='<option value="'+
e[n]+'">'+e[n]+"</option>";return t}var mr=Wt.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var n=this;n._super(e),n.settings.size&&(n.size=n.settings.size),n.settings.options&&(n._options=n.settings.options),n.on("keydown",function(e){var t;13===e.keyCode&&(e.preventDefault(),n.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),n.fire("submit",{data:t.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options",e),this):this.state.get("options")},renderHtml:function(){var e,t=this,n="";return e=hr(t._options),t.size&&(n=' size = "'+t.size+'"'),'<select id="'+t._id+'" class="'+t.classes+'"'+n+">"+e+"</select>"},bindStates:function(){var t=this;return t.state.on("change:options",function(e){t.getEl().innerHTML=hr(e
.value)}),t._super()}});function gr(e,t,n){return e<t&&(e=t),n<e&&(e=n),e}function pr(e,t,n){e.setAttribute("aria-"+t,n)}function vr(e,t){var n,i,r,o,s;"v"===e.settings.orientation?(r="top",i="height",n="h"):(r="left",i="width",n="w"),s=e.getEl("handle"),o=((e.layoutRect()[n]||100)-Ce.getSize(s)[i])*((t-e._minValue)/(e._maxValue-e._minValue))+"px",s.style[r]=o,s.style.height=e.layoutRect().h+"px",pr(s,"valuenow",t),pr(s,"valuetext",""+e.settings.previewFilter(t)),pr(s,"valuemin",e._minValue),pr(s,"valuemax",e._maxValue)}var br=Wt.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"===e.orientation&&t.classes.add("vertical"),t._minValue=X(e.minValue)?e.minValue:0,t._max
Value=X(e.maxValue)?e.maxValue:100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this._id,t=this.classPrefix;return'<div id="'+e+'" class="'+this.classes+'"><div id="'+e+'-handle" class="'+t+'slider-handle" role="slider" tabindex="-1"></div></div>'},reset:function(){this.value(this._initValue).repaint()},postRender:function(){var e,t,n,i,r,o,s,a,l,u,c,d,f,h,m=this;e=m._minValue,t=m._maxValue,"v"===m.settings.orientation?(n="screenY",i="top",r="height",o="h"):(n="screenX",i="left",r="width",o="w"),m._super(),function(o,s){function t(e){var t,n,i,r;t=gr(t=(((t=m.value())+(r=n=o))/((i=s)-r)+.05*e)*(i-n)-n,o,s),m.value(t),m.fire("dragstart",{value:t}),m.fire("drag",{value:t}),m.fire("dragend",{value:t})}m.on("keydown",function(e){switch(e.keyCode){ca
se 37:case 38:t(-1);break;case 39:case 40:t(1)}})}(e,t),s=e,a=t,l=m.getEl("handle"),m._dragHelper=new ft(m._id,{handle:m._id+"-handle",start:function(e){u=e[n],c=parseInt(m.getEl("handle").style[i],10),d=(m.layoutRect()[o]||100)-Ce.getSize(l)[r],m.fire("dragstart",{value:h})},drag:function(e){var t=e[n]-u;f=gr(c+t,0,d),l.style[i]=f+"px",h=s+f/d*(a-s),m.value(h),m.tooltip().text(""+m.settings.previewFilter(h)).show().moveRel(l,"bc tc"),m.fire("drag",{value:h})},stop:function(){m.tooltip().hide(),m.fire("dragend",{value:h})}})},repaint:function(){this._super(),vr(this,this.value())},bindStates:function(){var t=this;return t.state.on("change:value",function(e){vr(t,e.value)}),t._super()}}),yr=Wt.extend({renderHtml:function(){return this.classes.add("spacer"),this.canFocus=!1,'<div id="'+this._id+'" class="'+this.classes+'"></div>'}}),xr=ar.extend
({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e,t,n=this.getEl(),i=this.layoutRect();return this._super(),e=n.firstChild,t=n.lastChild,we(e).css({width:i.w-Ce.getSize(t).width,height:i.h-2}),we(t).css({height:i.h-2}),this},activeMenu:function(e){we(this.getEl().lastChild).toggleClass(this.classPrefix+"active",e)},renderHtml:function(){var e,t,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a=n.settings,l="";return(e=a.image)?(o="none","string"!=typeof e&&(e=window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",o=a.icon?r+"ico "+r+"i-"+o:"",s&&(n.classes.add("btn-has-text"),l='<span class="'+r+'txt">'+n.encode(s)+"</span>"),t="boolean"==typeof a.active?' aria-pressed="'+a.acti
ve+'"':"",'<div id="'+i+'" class="'+n.classes+'" role="button"'+t+' tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(o?'<i class="'+o+'"'+e+"></i>":"")+l+'</button><button type="button" class="'+r+'open" hidefocus="1" tabindex="-1">'+(n._menuBtnText?(o?"\xa0":"")+n._menuBtnText:"")+' <i class="'+r+'caret"></i></button></div>'},postRender:function(){var n=this.settings.onclick;return this.on("click",function(e){var t=e.target;if(e.control===this)for(;t;){if(e.aria&&"down"!==e.aria.key||"BUTTON"===t.nodeName&&-1===t.className.indexOf("open"))return e.stopImmediatePropagation(),void(n&&n.call(this,e));t=t.parentNode}}),delete this.settings.onclick,this._s
uper()}}),wr=Ei.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}}),_r=bt.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(n){var e;this.activeTabId&&(e=this.getEl(this.activeTabId),we(e).removeClass(this.classPrefix+"active"),e.setAttribute("aria-selected","false")),this.activeTabId="t"+n,(e=this.getEl("t"+n)).setAttribute("aria-selected","true"),we(e).addClass(this.classPrefix+"active"),this.items()[n].show().fire("showtab"),this.reflow(),this.items().each(function(e,t){n!==t&&e.hide()})},renderHtml:function(){var i=this,e=i._layout,r="",o=i.classPrefix;return i.preRender(),e.preRender(i),i.items().each(function(e,t){var n=i._id+"-t"+t;e.aria("role","tabpanel"),e.aria("labe
lledby",n),r+='<div id="'+n+'" class="'+o+'tab" unselectable="on" role="tab" aria-controls="'+e._id+'" aria-selected="false" tabIndex="-1">'+i.encode(e.settings.title)+"</div>"}),'<div id="'+i._id+'" class="'+i.classes+'" hidefocus="1" tabindex="-1"><div id="'+i._id+'-head" class="'+o+'tabs" role="tablist">'+r+'</div><div id="'+i._id+'-body" class="'+i.bodyClasses+'">'+e.renderHtml(i)+"</div></div>"},postRender:function(){var i=this;i._super(),i.settings.activeTab=i.settings.activeTab||0,i.activateTab(i.settings.activeTab),this.on("click",function(e){var t=e.target.parentNode;if(t&&t.id===i._id+"-head")for(var n=t.childNodes.length;n--;)t.childNodes[n]===e.target&&i.activateTab(n)})},initLayoutRect:function(){var e,t,n
,i=this;t=(t=Ce.getSize(i.getEl("head")).width)<0?0:t,n=0,i.items().each(function(e){t=Math.max(t,e.layoutRect().minW),n=Math.max(n,e.layoutRect().minH)}),i.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=t,e.settings.h=n,e.layoutRect({x:0,y:0,w:t,h:n})});var r=Ce.getSize(i.getEl("head")).height;return i.settings.minWidth=t,i.settings.minHeight=n+r,(e=i._super()).deltaH+=r,e.innerH=e.h-e.deltaH,e}}),Cr=Wt.extend({init:function(e){var n=this;n._super(e),n.classes.add("textbox"),e.multiline?n.classes.add("multiline"):(n.on("keydown",function(e){var t;13===e.keyCode&&(e.preventDefault(),n.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),n.fire("submit",{data:t.toJSON()}))}),n.on("keyup",function(e){n.state.set("value",e.target.value)}))},repaint:function(){var e,t,n,i,r,o=this,s=0;e=o.getEl().style,t=o._layoutRect,r=o._lastRepaintRect||{};var a=document;return!
o.settings.multiline&&a.all&&(!a.documentMode||a.documentMode<=8)&&(e.lineHeight=t.h-s+"px"),i=(n=o.borderBox).left+n.right+8,s=n.top+n.bottom+(o.settings.multiline?8:0),t.x!==r.x&&(e.left=t.x+"px",r.x=t.x),t.y!==r.y&&(e.top=t.y+"px",r.y=t.y),t.w!==r.w&&(e.width=t.w-i+"px",r.w=t.w),t.h!==r.h&&(e.height=t.h-s+"px",r.h=t.h),o._lastRepaintRect=r,o.fire("repaint",{},!1),o},renderHtml:function(){var t,e,n=this,i=n.settings;return t={id:n._id,hidefocus:"1"},w.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(e){t[e]=i[e]}),n.disabled()&&(t.disabled="disabled"),i.subtype&&(t.type=i.subtype),(e=Ce.create(i.multiline?"te
xtarea":"input",t)).value=n.state.get("value"),e.className=n.classes.toString(),e.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var t=this;t.getEl().value=t.state.get("value"),t._super(),t.$el.on("change",function(e){t.state.set("value",e.target.value),t.fire("change",e)})},bindStates:function(){var t=this;return t.state.on("change:value",function(e){t.getEl().value!==e.value&&(t.getEl().value=e.value)}),t.state.on("change:disabled",function(e){t.getEl().disabled=e.value}),t._super()},remove:function(){this.$el.off(),this._super()}}),Rr=function(){return{Selector:Ue,Collection:$e,ReflowQueue:Qe,Control:st,Factory:b,KeyboardNavigation:lt,Container:ct,DragHelper:ft,Scrollable:vt,Panel:bt,M
ovable:Se,Resizable:yt,FloatPanel:kt,Window:Vt,MessageBox:Yt,Tooltip:Dt,Widget:Wt,Progress:Ot,Notification:Bt,Layout:Xt,AbsoluteLayout:qt,Button:jt,ButtonGroup:Gt,Checkbox:Kt,ComboBox:Qt,ColorBox:en,PanelButton:tn,ColorButton:rn,ColorPicker:sn,Path:ln,ElementPath:un,FormItem:cn,Form:dn,FieldSet:fn,FilePicker:_i,FitLayout:Ci,FlexLayout:Ri,FlowLayout:Ei,FormatControls:er,GridLayout:tr,Iframe:nr,InfoBox:ir,Label:rr,Toolbar:or,MenuBar:sr,MenuButton:ar,MenuItem:cr,Throbber:Mt,Menu:lr,ListBox:ur,Radio:dr,ResizeHandle:fr,SelectBox:mr,Slider:br,Spacer:yr,SplitButton:xr,StackLayout:wr,TabPanel:_r,TextBox:Cr,DropZone:an,BrowseButton:Jt}},Er=function(n){n.ui?w.each(Rr(),function(e,t){n.ui[t]=e}):n.ui=Rr()};w.each(Rr(),function(e,t){b.add(t,e)}),Er(window.tinymce?window.tinymce:{}),o.add("modern",function(e){return er.setup(e),$t(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(){"use strict";var e,t,n,i,r,o=tinymce.util.Tools.resolve("tinymce.ThemeManager"),h=tinymce.util.Tools.resolve("tinymce.EditorManager"),w=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=function(e){return!1!==c(e)},c=function(e){return e.getParam("menubar")},f=function(e){return e.getParam("toolbar_items_size")},m=function(e){return e.getParam("menu")},g=function(e){return!1===e.settings.skin},p=function(e){var t=e.getParam("resize","vertical");return!1===t?"none":"both"===t?"both":"vertical"},v=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),b=tinymce.util.Tools.resolve("tinymce.ui.Factory"),y=tinymce.util.Tools.resolve("tinymce.util.I18n"),s=function(e){return e.fire("SkinLoaded")},x=function(e){return
e.fire("ResizeEditor")},_=function(e){return e.fire("BeforeRenderUI")},a=function(t,n){return function(){var e=t.find(n)[0];e&&e.focus(!0)}},R=function(e,t){e.shortcuts.add("Alt+F9","",a(t,"menubar")),e.shortcuts.add("Alt+F10,F10","",a(t,"toolbar")),e.shortcuts.add("Alt+F11","",a(t,"elementpath")),t.on("cancel",function(){e.focus()})},C=tinymce.util.Tools.resolve("tinymce.geom.Rect"),u=tinymce.util.Tools.resolve("tinymce.util.Delay"),E=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},k=function(e){return function(){return e}},l=k(!1),H=k(!0),S=l,T=H,M=function(){return N},N=(i={fold:function(e,t){return e()},is:S,isSome:S,isNone:T,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null}
,getOrUndefined:function(){return undefined},or:n,orThunk:t,map:M,ap:M,each:function(){},bind:M,flatten:M,exists:S,forall:T,filter:M,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:k("none()")},Object.freeze&&Object.freeze(i),i),P=function(n){var e=function(){return n},t=function(){return r},i=function(e){return e(n)},r={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:T,isNone:S,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return P(e(n))},ap:function(e){return e.fold(M,function(e){return P(e(n))})},each:function(e){e(n)},bind:i,flatten:e,exists:i,forall:i,filter:function(e){return e(n)?r:N},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(S,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return r},W={some:P,none:M,from:function(e){return null===e||e===undefined?N:P(e
)}},D=function(e){return e?e.getRoot().uiContainer:null},O={getUiContainerDelta:function(e){var t=D(e);if(t&&"static"!==v.DOM.getStyle(t,"position",!0)){var n=v.DOM.getPos(t),i=t.scrollLeft-n.x,r=t.scrollTop-n.y;return W.some({x:i,y:r})}return W.none()},setUiContainer:function(e,t){var n=v.DOM.select(e.settings.ui_container)[0];t.getRoot().uiContainer=n},getUiContainer:D,inheritUiContainer:function(e,t){return t.uiContainer=D(e)}},A=function(i,e,r){var o,s=[];if(e)return w.each(e.split(/[ ,]/),function(t){var e,n=function(){var e=i.selection;t.settings.stateSelector&&e.selectorChanged(t.settings.stateSelector,function(e){t.active(e)},!0),t.settings.disabledStateSelector&&e.selectorChanged(t.settings.disabledStateSelector,function(e){t.disabled(e)})};"|"===t?o=null:(o||(o={type:"buttongroup",items:[]},s.push(o)),i.buttons[t]&&(e=t,"function"==typeof(t=i.buttons[e])&&(t=t()),t.type=t.type||"
button",t.size=r,t=b.create(t),o.items.push(t),i.initialized?n():i.on("init",n)))}),{type:"toolbar",layout:"flow",items:s}},B=A,L=function(n,i){var e,t,r=[];if(w.each(!1===(t=(e=n).getParam("toolbar"))?[]:w.isArray(t)?w.grep(t,function(e){return 0<e.length}):function(e,t){for(var n=[],i=1;i<10;i++){var r=e["toolbar"+i];if(!r)break;n.push(r)}var o=e.toolbar?[e.toolbar]:[t];return 0<n.length?n:o}(e.settings,"undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"),function(e){var t;(t=e)&&r.push(A(n,t,i))}),r.length)return{type:"panel",layout:"stack",classes:"toolbar-grp",ariaRoot:!0,ariaRemember:!0,items:r}},z=v.DOM,I=function(e){return{left:e.x,top:e.y,width:e.w,height:e.h,right:e.x+e.w,bottom:e.y+e.h}},F=function(e,t){e.moveTo(t.left,t.top)},U=function(e,t,n,i,r,o){return o=I({x:t,y:n,w:o.w,h:o.h
}),e&&(o=e({elementRect:I(i),contentAreaRect:I(r),panelRect:o})),o},V=function(x){var i,o=function(){return x.contextToolbars||[]},n=function(e,t){var n,i,r,o,s,a,l,u=x.getParam("inline_toolbar_position_handler");if(!x.removed){if(!e||!e.toolbar.panel)return c=x,void w.each(c.contextToolbars,function(e){e.panel&&e.panel.hide()});var c,d,f,h,m;l=["bc-tc","tc-bc","tl-bl","bl-tl","tr-br","br-tr"],s=e.toolbar.panel,t&&s.show(),d=e.element,f=z.getPos(x.getContentAreaContainer()),h=x.dom.getRect(d),"BODY"===(m=x.dom.getRoot()).nodeName&&(h.x-=m.ownerDocument.documentElement.scrollLeft||m.scrollLeft,h.y-=m.ownerDocument.documentElement.scrollTop||m.scrollTop),h.x+=f.x,h.y+=f.y,r=h,i=z.getRect(s.getEl()),o=z.getRect(x.getContentAreaContainer()||x.getBody());var g,p,v,b=O.getUiContainerDelta(s).getOr({x:0,y:0});if(r.x+=b.x,r.y+=b.y,i.x+=b.x,i.y+=b.y,o.x+=b.x,o.y+=b.y,"inline&q
uot;!==z.getStyle(e.element,"display",!0)){var y=e.element.getBoundingClientRect();r.w=y.width,r.h=y.height}x.inline||(o.w=x.getDoc().documentElement.offsetWidth),x.selection.controlSelection.isResizable(e.element)&&r.w<25&&(r=C.inflate(r,0,8)),n=C.findBestRelativePosition(i,r,o,l),r=C.clamp(r,o),n?(a=C.relativePosition(i,r,n),F(s,U(u,a.x,a.y,r,o,i))):(o.h+=i.h,(r=C.intersect(o,r))?(n=C.findBestRelativePosition(i,r,o,["bc-tc","bl-tl","br-tr"]))?(a=C.relativePosition(i,r,n),F(s,U(u,a.x,a.y,r,o,i))):F(s,U(u,r.x,r.y,r,o,i)):s.hide()),g=s,v=function(e,t){return e===t},p=(p=n)?p.substr(0,2):"",w.each({t:"down",b:"up"},function(e,t){g.classes.toggle("arrow-"+e,v(t,p.substr(0,1)))}),w.each({l:"left",r:"right"},function(e,t){g.classes.toggle("arrow-"+e,v(t,p.substr(1,1)))})}},r=function(e){return function(){u.requestAnimationFrame(function(){x.selection&&n
(a(x.selection.getNode()),e)})}},t=function(e){var t;if(e.toolbar.panel)return e.toolbar.panel.show(),void n(e);t=b.create({type:"floatpanel",role:"dialog",classes:"tinymce tinymce-inline arrow",ariaLabel:"Inline toolbar",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:!0,border:1,items:B(x,e.toolbar.items),oncancel:function(){x.focus()}}),O.setUiContainer(x,t),function(e){if(!i){var t=r(!0),n=O.getUiContainer(e);i=x.selection.getScrollContainer()||x.getWin(),z.bind(i,"scroll",t),z.bind(n,"scroll",t),x.on("remove",function(){z.unbind(i,"scroll",t),z.unbind(n,"scroll",t)})}}(t),(e.toolbar.panel=t).renderTo().reflow(),n(e)},s=function(){w.each(o(),function(e){e.panel&&e.panel.hide()})},a=function(e){var t,n,i,r=o();for(t=(i=x.$(e).parents().add(e)).length-1;0<=t;t--)for(n=r.length-1;0<=n;n--)if(r[n].predicate(i[t]))return{t
oolbar:r[n],element:i[t]};return null};x.on("click keyup setContent ObjectResized",function(e){("setcontent"!==e.type||e.selection)&&u.setEditorTimeout(x,function(){var e;(e=a(x.selection.getNode()))?(s(),t(e)):s()})}),x.on("blur hide contextmenu",s),x.on("ObjectResizeStart",function(){var e=a(x.selection.getNode());e&&e.toolbar.panel&&e.toolbar.panel.hide()}),x.on("ResizeEditor ResizeWindow",r(!0)),x.on("nodeChange",r(!1)),x.on("remove",function(){w.each(o(),function(e){e.panel&&e.panel.remove()}),x.contextToolbars={}}),x.shortcuts.add("ctrl+F9","",function(){var e=a(x.selection.getNode());e&&e.toolbar.panel&&e.toolbar.panel.items()[0].focus()})},Y=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object
"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},$=Y("function"),q=Y("number"),X=(r=Array.prototype.indexOf)===undefined?function(e,t){return Q(e,t)}:function(e,t){return r.call(e,t)},j=function(e,t){return Z(e,t).isSome()},J=function(e,t){for(var n=e.length,i=new Array(n),r=0;r<n;r++){var o=e[r];i[r]=t(o,r,e)}return i},G=function(e,t){for(var n=0,i=e.length;n<i;n++)t(e[n],n,e)},K=function(e,t){for(var n=[],i=0,r=e.length;i<r;i++){var o=e[i];t(o,i,e)&&n.push(o)}return n},Z=function(e,t){for(var n=0,i=e.length;n<i;n++)if(t(e[n],n,e))return W.some(n);return W.none()},Q=function(e,t){for(var n=0,i=e.length;n<i;++n)if(e[n]===t)return n;return-1},ee=Array.prototype.push,te=(Array.prototype.slice,$(Array.from)&&Array.from,{file:{title:"File",items:"newdocument restoredraft | preview | print"},edit:{title:"Edit",items:"undo redo | cut copy paste pastetext | selectall&qu
ot;},view:{title:"View",items:"code | visualaid visualchars visualblocks | spellchecker | preview fullscreen"},insert:{title:"Insert",items:"image link media template codesample inserttable | charmap hr | pagebreak nonbreaking anchor toc | insertdatetime"},format:{title:"Format",items:"bold italic underline strikethrough superscript subscript codeformat | blockformats align | removeformat"},tools:{title:"Tools",items:"spellchecker spellcheckerlanguage | a11ycheck code"},table:{title:"Table"},help:{title:"Help"}}),ne=function(e,t){return"|"===e?{name:"|",item:{text:"|"}}:t?{name:e,item:t}:null},ie=function(e){return e&&"|"===e.item.text},re=function(n,e,t,i){var r,o,s,a,l,u,c;return e?(o=e[i],a=!0):o=te[i],o&&(r={text:o.title},s=[],w.each((o.items||"").split(/[ ,]/),function(e){var t=ne(e,n[e]);t&&s.push(t)}),a||
w.each(n,function(e,t){var n;e.context!==i||(n=t,Z(s,function(e){return e.name===n}).isSome())||("before"===e.separator&&s.push({name:"|",item:{text:"|"}}),e.prependToContext?s.unshift(ne(t,e)):s.push(ne(t,e)),"after"===e.separator&&s.push({name:"|",item:{text:"|"}}))}),r.menu=J((l=t,u=K(s,function(e){return!1===l.hasOwnProperty(e.name)}),c=K(u,function(e,t,n){return!ie(e)||!ie(n[t-1])}),K(c,function(e,t,n){return!ie(e)||0<t&&t<n.length-1})),function(e){return e.item}),!r.menu.length)?null:r},oe=function(e){for(var t,n=[],i=function(e){var t,n=[],i=m(e);if(i)for(t in i)n.push(t);else for(t in te)n.push(t);return n}(e),r=w.makeMap((t=e,t.getParam("removed_menuitems","")).split(/[ ,]/)),o=c(e),s="string"==typeof o?o.split(/[ ,]/):i,a=0;a<s.length;a++){var l=s[a],u=re(e.menuItems,m(e),r,l);u&&n.push(u)}return n},se=v.DOM,ae=function(e){return{width:e.client
Width,height:e.clientHeight}},le=function(e,t,n){var i,r,o,s;i=e.getContainer(),r=e.getContentAreaContainer().firstChild,o=ae(i),s=ae(r),null!==t&&(t=Math.max(e.getParam("min_width",100,"number"),t),t=Math.min(e.getParam("max_width",65535,"number"),t),se.setStyle(i,"width",t+(o.width-s.width)),se.setStyle(r,"width",t)),n=Math.max(e.getParam("min_height",100,"number"),n),n=Math.min(e.getParam("max_height",65535,"number"),n),se.setStyle(r,"height",n),x(e)},ue=le,ce=function(e,t,n){var i=e.getContentAreaContainer();le(e,i.clientWidth+t,i.clientHeight+n)},de=tinymce.util.Tools.resolve("tinymce.Env"),fe=function(e,t,n){var i,r=e.settings[n];r&&r((i=t.getEl("body"),{element:function(){return i}}))},he=function(c,d,f){return function(e){var t,n,i,r,o,s=e.control,a=s.parents().filter("panel")[0],l=a.find("#"+d)[0],u=(t=f,n=d,w.
grep(t,function(e){return e.name===n})[0]);i=d,r=a,o=f,w.each(o,function(e){var t=r.items().filter("#"+e.name)[0];t&&t.visible()&&e.name!==i&&(fe(e,t,"onhide"),t.visible(!1))}),s.parent().items().each(function(e){e.active(!1)}),l&&l.visible()?(fe(u,l,"onhide"),l.hide(),s.active(!1)):(l?l.show():(l=b.create({type:"container",name:d,layout:"stack",classes:"sidebar-panel",html:""}),a.prepend(l),fe(u,l,"onrender")),fe(u,l,"onshow"),s.active(!0)),x(c)}},me=function(e){return!(de.ie&&!(11<=de.ie)||!e.sidebars)&&0<e.sidebars.length},ge=function(n){return{type:"panel",name:"sidebar",layout:"stack",classes:"sidebar",items:[{type:"toolbar",layout:"stack",classes:"sidebar-toolbar",items:w.map(n.sidebars,function(e){var t=e.settings;return{type:"button",icon:t.icon,image:t.i
mage,tooltip:t.tooltip,onclick:he(n,e.name,n.sidebars)}})}]}},pe=function(e){var t=function(){e._skinLoaded=!0,s(e)};return function(){e.initialized?t():e.on("init",t)}},ve=v.DOM,be=function(e){return{type:"panel",name:"iframe",layout:"stack",classes:"edit-area",border:e,html:""}},ye=function(t,e,n){var i,r,o,s,a;if(!1===g(t)&&n.skinUiCss?ve.styleSheetLoader.load(n.skinUiCss,pe(t)):pe(t)(),i=e.panel=b.create({type:"panel",role:"application",classes:"tinymce",style:"visibility: hidden",layout:"stack",border:1,items:[{type:"container",classes:"top-part",items:[!1===d(t)?null:{type:"menubar",border:"0 0 1 0",items:oe(t)},L(t,f(t))]},me(t)?(s=t,{type:"panel",layout:"stack",classes:"edit-aria-container",border:"1 0 0 0",items:[be("0"),ge(s)]}):be("1 0 0 0")]}),O.setUiContai
ner(t,i),"none"!==p(t)&&(r={type:"resizehandle",direction:p(t),onResizeStart:function(){var e=t.getContentAreaContainer().firstChild;o={width:e.clientWidth,height:e.clientHeight}},onResize:function(e){"both"===p(t)?ue(t,o.width+e.deltaX,o.height+e.deltaY):ue(t,null,o.height+e.deltaY)}}),t.getParam("statusbar",!0,"boolean")){var l=y.translate(["Powered by {0}",'<a href="https://www.tiny.cloud/?utm_campaign=editor_referral&utm_medium=poweredby&utm_source=tinymce" rel="noopener" target="_blank" role="presentation" tabindex="-1">Tiny</a>']),u=t.getParam("branding",!0,"boolean")?{type:"label",classes:"branding",html:" "+l}:null;i.add({type:"panel",name:"statusbar",classes:"statusbar",layout:"flow",border:"1 0 0 0",ariaRoot:!0,items:[{type:"e
lementpath",editor:t},r,u]})}return _(t),t.on("SwitchMode",(a=i,function(e){a.find("*").disabled("readonly"===e.mode)})),i.renderBefore(n.targetNode).reflow(),t.getParam("readonly",!1,"boolean")&&t.setMode("readonly"),n.width&&ve.setStyle(i.getEl(),"width",n.width),t.on("remove",function(){i.remove(),i=null}),R(t,i),V(t),{iframeContainer:i.find("#iframe")[0].getEl(),editorContainer:i.getEl()}},xe=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),we=0,_e={id:function(){return"mceu_"+we++},create:function(e,t,n){var i=document.createElement(e);return v.DOM.setAttribs(i,t),"string"==typeof n?i.innerHTML=n:w.each(n,function(e){e.nodeType&&i.appendChild(e)}),i},createFragment:function(e){return v.DOM.createFragment(e)},getWindowSize:function(){return v.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var i=e.getBou
ndingClientRect();t=Math.max(i.width||i.right-i.left,e.offsetWidth),n=Math.max(i.height||i.bottom-i.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,t){return v.DOM.getPos(e,t||_e.getContainer())},getContainer:function(){return de.container?de.container:document.body},getViewPort:function(e){return v.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,t){return v.DOM.addClass(e,t)},removeClass:function(e,t){return v.DOM.removeClass(e,t)},hasClass:function(e,t){return v.DOM.hasClass(e,t)},toggleClass:function(e,t,n){return v.DOM.toggleClass(e,t,n)},css:function(e,t,n){return v.DOM.setStyle(e,t,n)},getRuntimeStyle:function(e,t){return v.DOM.getStyle(e,t,!0)},on:function(e,t,n,i){return v.DOM.bind(e,t,n,i)},off:function(e,t,n){return v.DOM.unbind(e,t,n)},fire:function(e,t,n){return v.DOM.fire(e,t,n)},innerHtml:function(e,t){v.DOM.setHTML(e,t)}},Re=function(e){return"static"===_e.get
RuntimeStyle(e,"position")},Ce=function(e){return e.state.get("fixed")};function Ee(e,t,n){var i,r,o,s,a,l,u,c,d,f;return d=ke(),o=(r=_e.getPos(t,O.getUiContainer(e))).x,s=r.y,Ce(e)&&Re(document.body)&&(o-=d.x,s-=d.y),i=e.getEl(),a=(f=_e.getSize(i)).width,l=f.height,u=(f=_e.getSize(t)).width,c=f.height,"b"===(n=(n||"").split(""))[0]&&(s+=c),"r"===n[1]&&(o+=u),"c"===n[0]&&(s+=Math.round(c/2)),"c"===n[1]&&(o+=Math.round(u/2)),"b"===n[3]&&(s-=l),"r"===n[4]&&(o-=a),"c"===n[3]&&(s-=Math.round(l/2)),"c"===n[4]&&(o-=Math.round(a/2)),{x:o,y:s,w:a,h:l}}var ke=function(){var e=window;return{x:Math.max(e.pageXOffset,document.body.scrollLeft,document.documentElement.scrollLeft),y:Math.max(e.pageYOffset,document.body.scrollTop,document.documentElement.scrollTop),w:e.innerWidth||document.documentElem
ent.clientWidth,h:e.innerHeight||document.documentElement.clientHeight}},He=function(e){var t,n=O.getUiContainer(e);return n&&!Ce(e)?{x:0,y:0,w:(t=n).scrollWidth-1,h:t.scrollHeight-1}:ke()},Se={testMoveRel:function(e,t){for(var n=He(this),i=0;i<t.length;i++){var r=Ee(this,e,t[i]);if(Ce(this)){if(0<r.x&&r.x+r.w<n.w&&0<r.y&&r.y+r.h<n.h)return t[i]}else if(r.x>n.x&&r.x+r.w<n.w+n.x&&r.y>n.y&&r.y+r.h<n.h+n.y)return t[i]}return t[0]},moveRel:function(e,t){"string"!=typeof t&&(t=this.testMoveRel(e,t));var n=Ee(this,e,t);return this.moveTo(n.x,n.y)},moveBy:function(e,t){var n=this.layoutRect();return this.moveTo(n.x+e,n.y+t),this},moveTo:function(e,t){var n=this;function i(e,t,n){return e<0?0:t<e+n&&(e=t-n)<0?0:e}if(n.settings.constrainToViewport){var r=He(this),o=n.layoutRect();e=i(e,r.w+r.x,o.w),t=i(t,r.h+r.y,o.h)}var s=O.getUiContainer(n);return s&&Re(s)&&
!Ce(n)&&(e-=s.scrollLeft,t-=s.scrollTop),s&&(e+=1,t+=1),n.state.get("rendered")?n.layoutRect({x:e,y:t}).repaint():(n.settings.x=e,n.settings.y=t),n.fire("move",{x:e,y:t}),n}},Te=tinymce.util.Tools.resolve("tinymce.util.Class"),Me=tinymce.util.Tools.resolve("tinymce.util.EventDispatcher"),Ne=function(e){var t;if(e)return"number"==typeof e?{top:e=e||0,left:e,bottom:e,right:e}:(1===(t=(e=e.split(" ")).length)?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],10)||0,right:parseInt(e[1],10)||0,bottom:parseInt(e[2],10)||0,left:parseInt(e[3],10)||0})},Pe=function(i,e){function t(e){var t=parseFloat(function(e){var t=i.ownerDocument.defaultView;if(t){var n=t.getComputedStyle(i,null);return n?(e=e.replace(/[A-Z]/g,function(e){return"-"+e}),n.getPropertyValue(e)):null}return i.currentStyle[e]}(e));return isNaN(t)?0:t}return{top:t(e+"TopWidth"),right:t(e+&
quot;RightWidth"),bottom:t(e+"BottomWidth"),left:t(e+"LeftWidth")}};function We(){}function De(e){this.cls=[],this.cls._map={},this.onchange=e||We,this.prefix=""}w.extend(De.prototype,{add:function(e){return e&&!this.contains(e)&&(this.cls._map[e]=!0,this.cls.push(e),this._change()),this},remove:function(e){if(this.contains(e)){var t=void 0;for(t=0;t<this.cls.length&&this.cls[t]!==e;t++);this.cls.splice(t,1),delete this.cls._map[e],this._change()}return this},toggle:function(e,t){var n=this.contains(e);return n!==t&&(n?this.remove(e):this.add(e),this._change()),this},contains:function(e){return!!this.cls._map[e]},_change:function(){delete this.clsValue,this.onchange.call(this)}}),De.prototype.toString=function(){var e;if(this.clsValue)return this.clsValue;e="";for(var t=0;t<this.cls.length;t++)0<t&&(e+=" "),e+=this.prefix+this.cls[t];return e};var Oe,Ae,Be,Le=/^([\w\\*]+)?(?:#([\w
\-\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,ze=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,Ie=/^\s*|\s*$/g,Fe=Te.extend({init:function(e){var o=this.match;function s(e,t,n){var i;function r(e){e&&t.push(e)}return r(function(t){if(t)return t=t.toLowerCase(),function(e){return"*"===t||e.type===t}}((i=Le.exec(e.replace(Ie,"")))[1])),r(function(t){if(t)return function(e){return e._name===t}}(i[2])),r(function(n){if(n)return n=n.split("."),function(e){for(var t=n.length;t--;)if(!e.classes.contains(n[t]))return!1;return!0}}(i[3])),r(function(n,i,r){if(n)return function(e){var t=e[n]?e[n]():"";return i?"="===i?t===r:"*="===i?0<=t.indexOf(r):"~="===i?0<=(" "+t+" ").indexOf(" "+r+" "):"!="===i?t!==r:"
^="===i?0===t.indexOf(r):"$="===i&&t.substr(t.length-r.length)===r:!!r}}(i[4],i[5],i[6])),r(function(i){var t;if(i)return(i=/(?:not\((.+)\))|(.+)/i.exec(i))[1]?(t=a(i[1],[]),function(e){return!o(e,t)}):(i=i[2],function(e,t,n){return"first"===i?0===t:"last"===i?t===n-1:"even"===i?t%2==0:"odd"===i?t%2==1:!!e[i]&&e[i]()})}(i[7])),t.pseudo=!!i[7],t.direct=n,t}function a(e,t){var n,i,r,o=[];do{if(ze.exec(""),(i=ze.exec(e))&&(e=i[3],o.push(i[1]),i[2])){n=i[3];break}}while(i);for(n&&a(n,t),e=[],r=0;r<o.length;r++)">"!==o[r]&&e.push(s(o[r],[],">"===o[r-1]));return t.push(e),t}this._selectors=a(e,[])},match:function(e,t){var n,i,r,o,s,a,l,u,c,d,f,h,m;for(n=0,i=(t=t||this._selectors).length;n<i;n++){for(m=e,h=0,r=(o=(s=t[n]).length)-1;0<=r;r--)for(u=s[r];m;){if(u.pseudo)for(c=d=(f=m.parent().items()).length;c--&&f[c]!==m;);for(a=0,l=u.length;a<
l;a++)if(!u[a](m,c,d)){a=l+1;break}if(a===l){h++;break}if(r===o-1)break;m=m.parent()}if(h===o)return!0}return!1},find:function(e){var t,n,u=[],i=this._selectors;function c(e,t,n){var i,r,o,s,a,l=t[n];for(i=0,r=e.length;i<r;i++){for(a=e[i],o=0,s=l.length;o<s;o++)if(!l[o](a,i,r)){o=s+1;break}if(o===s)n===t.length-1?u.push(a):a.items&&c(a.items(),t,n+1);else if(l.direct)return;a.items&&c(a.items(),t,n)}}if(e.items){for(t=0,n=i.length;t<n;t++)c(e.items(),i[t],0);1<n&&(u=function(e){for(var t,n=[],i=e.length;i--;)(t=e[i]).__checked||(n.push(t),t.__checked=1);for(i=n.length;i--;)delete n[i].__checked;return n}(u))}return Oe||(Oe=Fe.Collection),new Oe(u)}}),Ue=Array.prototype.push,Ve=Array.prototype.slice;Be={length:0,init:function(e){e&&this.add(e)},add:function(e){return w.isArray(e)?Ue.apply(this,e):e instanceof Ae?this.add(e.toArray()):Ue.call(this,e),this},set:function(e){var t,n=this,i=n.length;for(n.length=0,n.add(e),t=n.length;t<i;t++)
delete n[t];return n},filter:function(t){var e,n,i,r,o=[];for("string"==typeof t?(t=new Fe(t),r=function(e){return t.match(e)}):r=t,e=0,n=this.length;e<n;e++)r(i=this[e])&&o.push(i);return new Ae(o)},slice:function(){return new Ae(Ve.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(e){return w.each(this,e),this},toArray:function(){return w.toArray(this)},indexOf:function(e){for(var t=this.length;t--&&this[t]!==e;);return t},reverse:function(){return new Ae(w.toArray(this).reverse())},hasClass:function(e){return!!this[0]&&this[0].classes.contains(e)},prop:function(t,n){var e;return n!==undefined?(this.each(function(e){e[t]&&e[t](n)}),this):(e=this[0])&&e[t]?e[t]():void 0},exec:function(t){var n=w.toArray(arguments).slice(1);return this.each(function(e){e[t]&&e[t].apply(e,n)}),this},remove:function(){for(var e=this.length;e--;)this[e].remove();return this},addClass:function(
t){return this.each(function(e){e.classes.add(t)})},removeClass:function(t){return this.each(function(e){e.classes.remove(t)})}},w.each("fire on off show hide append prepend before after reflow".split(" "),function(n){Be[n]=function(){var t=w.toArray(arguments);return this.each(function(e){n in e&&e[n].apply(e,t)}),this}}),w.each("text name disabled active selected checked visible parent value data".split(" "),function(t){Be[t]=function(e){return this.prop(t,e)}}),Ae=Te.extend(Be);var Ye=Fe.Collection=Ae,$e=function(e){this.create=e.create};$e.create=function(r,o){return new $e({create:function(t,n){var i,e=function(e){t.set(n,e.value)};return t.on("change:"+n,function(e){r.set(o,e.value)}),r.on("change:"+o,e),(i=t._bindings)||(i=t._bindings=[],t.on("destroy",function(){for(var e=i.length;e--;)i[e]()})),i.push(function(){r.off("change:"+o,e)}),r.get(o)}})};var qe=tinymce.util.Tools.resolve("
tinymce.util.Observable");function Xe(e){return 0<e.nodeType}var je,Je,Ge=Te.extend({Mixins:[qe],init:function(e){var t,n;for(t in e=e||{})(n=e[t])instanceof $e&&(e[t]=n.create(this,t));this.data=e},set:function(t,n){var i,r,o=this.data[t];if(n instanceof $e&&(n=n.create(this,t)),"object"==typeof t){for(i in t)this.set(i,t[i]);return this}return function e(t,n){var i,r;if(t===n)return!0;if(null===t||null===n)return t===n;if("object"!=typeof t||"object"!=typeof n)return t===n;if(w.isArray(n)){if(t.length!==n.length)return!1;for(i=t.length;i--;)if(!e(t[i],n[i]))return!1}if(Xe(t)||Xe(n))return t===n;for(i in r={},n){if(!e(t[i],n[i]))return!1;r[i]=!0}for(i in t)if(!r[i]&&!e(t[i],n[i]))return!1;return!0}(o,n)||(this.data[t]=n,r={target:this,name:t,value:n,oldValue:o},this.fire("change:"+t,r),this.fire("change",r)),this},get:function(e){return this.data[e]},has:function(e){return e in this.data},bind:functio
n(e){return $e.create(this,e)},destroy:function(){this.fire("destroy")}}),Ke={},Ze={add:function(e){var t=e.parent();if(t){if(!t._layout||t._layout.isNative())return;Ke[t._id]||(Ke[t._id]=t),je||(je=!0,u.requestAnimationFrame(function(){var e,t;for(e in je=!1,Ke)(t=Ke[e]).state.get("rendered")&&t.reflow();Ke={}},document.body))}},remove:function(e){Ke[e._id]&&delete Ke[e._id]}},Qe="onmousewheel"in document,et=!1,tt=0,nt={Statics:{classPrefix:"mce-"},isRtl:function(){return Je.rtl},classPrefix:"mce-",init:function(t){var e,n,i=this;function r(e){var t;for(e=e.split(" "),t=0;t<e.length;t++)i.classes.add(e[t])}i.settings=t=w.extend({},i.Defaults,t),i._id=t.id||"mceu_"+tt++,i._aria={role:t.role},i._elmCache={},i.$=xe,i.state=new Ge({visible:!0,active:!1,disabled:!1,value:""}),i.data=new Ge(t.data),i.classes=new De(function(){i.state.get("rendered")&&(i.getEl().className=t
his.toString())}),i.classes.prefix=i.classPrefix,(e=t.classes)&&(i.Defaults&&(n=i.Defaults.classes)&&e!==n&&r(n),r(e)),w.each("title text name visible disabled active value".split(" "),function(e){e in t&&i[e](t[e])}),i.on("click",function(){if(i.disabled())return!1}),i.settings=t,i.borderBox=Ne(t.border),i.paddingBox=Ne(t.padding),i.marginBox=Ne(t.margin),t.hidden&&i.hide()},Properties:"parent,name",getContainerElm:function(){var e=O.getUiContainer(this);return e||_e.getContainer()},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},initLayoutRect:function(){var e,t,n,i,r,o,s,a,l,u,c=this,d=c.settings,f=c.getEl();e=c.borderBox=c.borderBox||Pe(f,"border"),c.paddingBox=c.paddingBox||Pe(f,"padding"),c.marginBox=c.marginBox||Pe(f,"margin"),u=_e.getSize(f),a=d.minWidth,l=d.minHeight,r=a||u.wid
th,o=l||u.height,n=d.width,i=d.height,s=void 0!==(s=d.autoResize)?s:!n&&!i,n=n||r,i=i||o;var h=e.left+e.right,m=e.top+e.bottom,g=d.maxWidth||65535,p=d.maxHeight||65535;return c._layoutRect=t={x:d.x||0,y:d.y||0,w:n,h:i,deltaW:h,deltaH:m,contentW:n-h,contentH:i-m,innerW:n-h,innerH:i-m,startMinWidth:a||0,startMinHeight:l||0,minW:Math.min(r,g),minH:Math.min(o,p),maxW:g,maxH:p,autoResize:s,scrollW:0},c._lastLayoutRect={},t},layoutRect:function(e){var t,n,i,r,o,s=this,a=s._layoutRect;return a||(a=s.initLayoutRect()),e?(i=a.deltaW,r=a.deltaH,e.x!==undefined&&(a.x=e.x),e.y!==undefined&&(a.y=e.y),e.minW!==undefined&&(a.minW=e.minW),e.minH!==undefined&&(a.minH=e.minH),(n=e.w)!==undefined&&(n=(n=n<a.minW?a.minW:n)>a.maxW?a.maxW:n,a.w=n,a.innerW=n-i),(n=e.h)!==undefined&&(n=(n=n<a.minH?a.minH:n)>a.maxH?a.maxH:n,a.h=n,a.innerH=n-r),(n=e.innerW)!==undefined&&(n=(n=n<a.minW-i?a.minW-i:n)>a.maxW-i?a.maxW-i:n,a.innerW=
n,a.w=n+i),(n=e.innerH)!==undefined&&(n=(n=n<a.minH-r?a.minH-r:n)>a.maxH-r?a.maxH-r:n,a.innerH=n,a.h=n+r),e.contentW!==undefined&&(a.contentW=e.contentW),e.contentH!==undefined&&(a.contentH=e.contentH),(t=s._lastLayoutRect).x===a.x&&t.y===a.y&&t.w===a.w&&t.h===a.h||((o=Je.repaintControls)&&o.map&&!o.map[s._id]&&(o.push(s),o.map[s._id]=!0),t.x=a.x,t.y=a.y,t.w=a.w,t.h=a.h),s):a},repaint:function(){var e,t,n,i,r,o,s,a,l,u,c=this;l=document.createRange?function(e){return e}:Math.round,e=c.getEl().style,i=c._layoutRect,a=c._lastRepaintRect||{},o=(r=c.borderBox).left+r.right,s=r.top+r.bottom,i.x!==a.x&&(e.left=l(i.x)+"px",a.x=i.x),i.y!==a.y&&(e.top=l(i.y)+"px",a.y=i.y),i.w!==a.w&&(u=l(i.w-o),e.width=(0<=u?u:0)+"px",a.w=i.w),i.h!==a.h&&(u=l(i.h-s),e.height=(0<=u?u:0)+"px",a.h=i.h),c._hasBody&&i.innerW!==a.innerW&&(u=l(i.
innerW),(n=c.getEl("body"))&&((t=n.style).width=(0<=u?u:0)+"px"),a.innerW=i.innerW),c._hasBody&&i.innerH!==a.innerH&&(u=l(i.innerH),(n=n||c.getEl("body"))&&((t=t||n.style).height=(0<=u?u:0)+"px"),a.innerH=i.innerH),c._lastRepaintRect=a,c.fire("repaint",{},!1)},updateLayoutRect:function(){var e=this;e.parent()._lastRect=null,_e.css(e.getEl(),{width:"",height:""}),e._layoutRect=e._lastRepaintRect=e._lastLayoutRect=null,e.initLayoutRect()},on:function(e,t){var n,i,r,o=this;return it(o).on(e,"string"!=typeof(n=t)?n:function(e){return i||o.parentsAndSelf().each(function(e){var t=e.settings.callbacks;if(t&&(i=t[n]))return r=e,!1}),i?i.call(r,e):(e.action=n,void this.fire("execute",e))}),o},off:function(e,t){return it(this).off(e,t),this},fire:function(e,t,n){if((t=t||{}).control||(t.control=this),t=it(this).fire(e,t),!1!==n&&this.parent)for(var i=
this.parent();i&&!t.isPropagationStopped();)i.fire(e,t,!1),i=i.parent();return t},hasEventListeners:function(e){return it(this).has(e)},parents:function(e){var t,n=new Ye;for(t=this.parent();t;t=t.parent())n.add(t);return e&&(n=n.filter(e)),n},parentsAndSelf:function(e){return new Ye(this).add(this.parents(e))},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},innerHtml:function(e){return this.$el.html(e),this},getEl:function(e){var t=e?this._id+"-"+e:this._id;return this._elmCache[t]||(this._elmCache[t]=xe("#"+t)[0]),this._elmCache[t]},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,i=n.getEl(n.ariaTarget);return void 0===t?n._aria[e]:(n._aria[e]=t,n.state.get("rendered&qu
ot;)&&i.setAttribute("role"===e?e:"aria-"+e,t),n)},encode:function(e,t){return!1!==t&&(e=this.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},translate:function(e){return Je.translate?Je.translate(e):e},before:function(e){var t=this.parent();return t&&t.insert(e,t.items().indexOf(this),!0),this},after:function(e){var t=this.parent();return t&&t.insert(e,t.items().indexOf(this)),this},remove:function(){var t,e,n=this,i=n.getEl(),r=n.parent();if(n.items){var o=n.items().toArray();for(e=o.length;e--;)o[e].remove()}r&&r.items&&(t=[],r.items().each(function(e){e!==n&&t.push(e)}),r.items().set(t),r._lastRect=null),n._eventsRoot&&n._eventsRoot===n&&xe(i).off();var s=n.getRoot().controlIdLookup;return s&&delete s[n._id],i&&i.parentNode&&i.parentNode.removeChild(i),n.state.set("rendered&
quot;,!1),n.state.destroy(),n.fire("remove"),n},renderBefore:function(e){return xe(e).before(this.renderHtml()),this.postRender(),this},renderTo:function(e){return xe(e||this.getContainerElm()).append(this.renderHtml()),this.postRender(),this},preRender:function(){},render:function(){},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'"></div>'},postRender:function(){var e,t,n,i,r,o=this,s=o.settings;for(i in o.$el=xe(o.getEl()),o.state.set("rendered",!0),s)0===i.indexOf("on")&&o.on(i.substr(2),s[i]);if(o._eventsRoot){for(n=o.parent();!r&&n;n=n.parent())r=n._eventsRoot;if(r)for(i in r._nativeEvents)o._nativeEvents[i]=!0}rt(o),s.style&&(e=o.getEl())&&(e.setAttribute("style",s.style),e.style.cssText=s.style),o.settings.border&&(t=o.borderBox,o.$el.css({"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width
":t.bottom,"border-left-width":t.left}));var a=o.getRoot();for(var l in a.controlIdLookup||(a.controlIdLookup={}),(a.controlIdLookup[o._id]=o)._aria)o.aria(l,o._aria[l]);!1===o.state.get("visible")&&(o.getEl().style.display="none"),o.bindStates(),o.state.on("change:visible",function(e){var t,n=e.value;o.state.get("rendered")&&(o.getEl().style.display=!1===n?"none":"",o.getEl().getBoundingClientRect()),(t=o.parent())&&(t._lastRect=null),o.fire(n?"show":"hide"),Ze.add(o)}),o.fire("postrender",{},!1)},bindStates:function(){},scrollIntoView:function(e){var t,n,i,r,o,s,a=this.getEl(),l=a.parentNode,u=function(e,t){var n,i,r=e;for(n=i=0;r&&r!==t&&r.nodeType;)n+=r.offsetLeft||0,i+=r.offsetTop||0,r=r.offsetParent;return{x:n,y:i}}(a,l);return t=u.x,n=u.y,i=a.offsetWidth,r=a.offsetHeight,o=l.clientWidth,s=l.clientHeight,"end"===e?(t-=o-i,n-
=s-r):"center"===e&&(t-=o/2-i/2,n-=s/2-r/2),l.scrollLeft=t,l.scrollTop=n,this},getRoot:function(){for(var e,t=this,n=[];t;){if(t.rootControl){e=t.rootControl;break}n.push(t),t=(e=t).parent()}e||(e=this);for(var i=n.length;i--;)n[i].rootControl=e;return e},reflow:function(){Ze.remove(this);var e=this.parent();return e&&e._layout&&!e._layout.isNative()&&e.reflow(),this}};function it(n){return n._eventDispatcher||(n._eventDispatcher=new Me({scope:n,toggleEvent:function(e,t){t&&Me.isNative(e)&&(n._nativeEvents||(n._nativeEvents={}),n._nativeEvents[e]=!0,n.state.get("rendered")&&rt(n))}})),n._eventDispatcher}function rt(a){var e,t,n,l,i,r;function o(e){var t=a.getParentCtrl(e.target);t&&t.fire(e.type,e)}function s(){var e=l._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),l._lastHoverCtrl=null)}fun
ction u(e){var t,n,i,r=a.getParentCtrl(e.target),o=l._lastHoverCtrl,s=0;if(r!==o){if((n=(l._lastHoverCtrl=r).parents().toArray().reverse()).push(r),o){for((i=o.parents().toArray().reverse()).push(o),s=0;s<i.length&&n[s]===i[s];s++);for(t=i.length-1;s<=t;t--)(o=i[t]).fire("mouseleave",{target:o.getEl()})}for(t=s;t<n.length;t++)(r=n[t]).fire("mouseenter",{target:r.getEl()})}}function c(e){e.preventDefault(),"mousewheel"===e.type?(e.deltaY=-.025*e.wheelDelta,e.wheelDeltaX&&(e.deltaX=-.025*e.wheelDeltaX)):(e.deltaX=0,e.deltaY=e.detail),e=a.fire("wheel",e)}if(i=a._nativeEvents){for((n=a.parents().toArray()).unshift(a),e=0,t=n.length;!l&&e<t;e++)l=n[e]._eventsRoot;for(l||(l=n[n.length-1]||a),a._eventsRoot=l,t=e,e=0;e<t;e++)n[e]._eventsRoot=l;var d=l._delegates;for(r in d||(d=l._delegates={}),i){if(!i)return!1;"wheel"!==r||et?("mouseenter"===r||"mouseleave"===r?l._hasMouseEnter||(xe
(l.getEl()).on("mouseleave",s).on("mouseover",u),l._hasMouseEnter=1):d[r]||(xe(l.getEl()).on(r,o),d[r]=!0),i[r]=!1):Qe?xe(a.getEl()).on("mousewheel",c):xe(a.getEl()).on("DOMMouseScroll",c)}}}w.each("text title visible disabled active value".split(" "),function(t){nt[t]=function(e){return 0===arguments.length?this.state.get(t):(void 0!==e&&this.state.set(t,e),this)}});var ot=Je=Te.extend(nt),st=function(e){return!!e.getAttribute("data-mce-tabstop")};function at(e){var o,r,n=e.root;function i(e){return e&&1===e.nodeType}try{o=document.activeElement}catch(t){o=document.body}function s(e){return i(e=e||o)?e.getAttribute("role"):null}function a(e){for(var t,n=e||o;n=n.parentNode;)if(t=s(n))return t}function l(e){var t=o;if(i(t))return t.getAttribute("aria-"+e)}function u(e){var t=e.tagName.toUpperCase();return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t}fun
ction c(t){var r=[];return function e(t){if(1===t.nodeType&&"none"!==t.style.display&&!t.disabled){var n;(u(n=t)&&!n.hidden||st(n)||/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell|slider)$/.test(s(n)))&&r.push(t);for(var i=0;i<t.childNodes.length;i++)e(t.childNodes[i])}}(t||n.getEl()),r}function d(e){var t,n;(n=(e=e||r).parents().toArray()).unshift(e);for(var i=0;i<n.length&&!(t=n[i]).settings.ariaRoot;i++);return t}function f(e,t){return e<0?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function h(e,t){var n=-1,i=d();t=t||c(i.getEl());for(var r=0;r<t.length;r++)t[r]===o&&(n=r);n+=e,i.lastAriaIndex=f(n,t)}function m(){"tablist"===a()?h(-1,c(o.parentNode)):r.parent().submenu?b():h(-1)}function g(){var e=s(),t=a();"tablist"===t?h(1,c(o.parentNode)):"menuitem"===e&&"menu"===t&&l("haspopup")?y():h(1)}function p
(){h(-1)}function v(){var e=s(),t=a();"menuitem"===e&&"menubar"===t?y():"button"===e&&l("haspopup")?y({key:"down"}):h(1)}function b(){r.fire("cancel")}function y(e){e=e||{},r.fire("click",{target:o,aria:e})}return r=n.getParentCtrl(o),n.on("keydown",function(e){function t(e,t){u(o)||st(o)||"slider"!==s(o)&&!1!==t(e)&&e.preventDefault()}if(!e.isDefaultPrevented())switch(e.keyCode){case 37:t(e,m);break;case 39:t(e,g);break;case 38:t(e,p);break;case 40:t(e,v);break;case 27:b();break;case 14:case 13:case 32:t(e,y);break;case 9:!function(e){if("tablist"===a()){var t=c(r.getEl("body"))[0];t&&t.focus()}else h(e.shiftKey?-1:1)}(e),e.preventDefault()}}),n.on("focusin",function(e){o=e.target,r=e.control}),{focusFirst:function(e){var t=d(e),n=c(t.getEl());t.settings.ariaRemember&&"lastAriaIndex"in t?f(t.lastAriaIndex,n
):f(0,n)}}}var lt={},ut=ot.extend({init:function(e){var t=this;t._super(e),(e=t.settings).fixed&&t.state.set("fixed",!0),t._items=new Ye,t.isRtl()&&t.classes.add("rtl"),t.bodyClasses=new De(function(){t.state.get("rendered")&&(t.getEl("body").className=this.toString())}),t.bodyClasses.prefix=t.classPrefix,t.classes.add("container"),t.bodyClasses.add("container-body"),e.containerCls&&t.classes.add(e.containerCls),t._layout=b.create((e.layout||"")+"layout"),t.settings.items?t.add(t.settings.items):t.add(t.render()),t._hasBody=!0},items:function(){return this._items},find:function(e){return(e=lt[e]=lt[e]||new Fe(e)).find(this)},add:function(e){return this.items().add(this.create(e)).parent(this),this},focus:function(e){var t,n,i,r=this;if(!e||!(n=r.keyboardNav||r.parents().eq(-1)[0].keyboardNav))return i=r.find("*"),r.statusbar&&i.add(r.statusbar.items()),i.
each(function(e){if(e.settings.autofocus)return t=null,!1;e.canFocus&&(t=t||e)}),t&&t.focus(),r;n.focusFirst(r)},replace:function(e,t){for(var n,i=this.items(),r=i.length;r--;)if(i[r]===e){i[r]=t;break}0<=r&&((n=t.getEl())&&n.parentNode.removeChild(n),(n=e.getEl())&&n.parentNode.removeChild(n)),t.parent(this)},create:function(e){var t,n=this,i=[];return w.isArray(e)||(e=[e]),w.each(e,function(e){e&&(e instanceof ot||("string"==typeof e&&(e={type:e}),t=w.extend({},n.settings.defaults,e),e.type=t.type=t.type||e.type||n.settings.defaultType||(t.defaults?t.defaults.type:null),e=b.create(t)),i.push(e))}),i},renderNew:function(){var i=this;return i.items().each(function(e,t){var n;e.parent(i),e.state.get("rendered")||((n=i.getEl("body")).hasChildNodes()&&t<=n.childNodes.length-1?xe(n.childNodes[t]).before(e.renderHtml()):xe(n).append(e.renderHtml()),e.postRender(),Ze.add(e))}),i._layout.app
lyClasses(i.items().filter(":visible")),i._lastRect=null,i},append:function(e){return this.add(e).renderNew()},prepend:function(e){return this.items().set(this.create(e).concat(this.items().toArray())),this.renderNew()},insert:function(e,t,n){var i,r,o;return e=this.create(e),i=this.items(),!n&&t<i.length-1&&(t+=1),0<=t&&t<i.length&&(r=i.slice(0,t).toArray(),o=i.slice(t).toArray(),i.set(r.concat(e,o))),this.renderNew()},fromJSON:function(e){for(var t in e)this.find("#"+t).value(e[t]);return this},toJSON:function(){var i={};return this.find("*").each(function(e){var t=e.name(),n=e.value();t&&void 0!==n&&(i[t]=n)}),i},renderHtml:function(){var e=this,t=e._layout,n=this.settings.role;return e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"'+(n?' role="'+this.settings.role+'"':"")+'><div id="'+e._id+'-body" class="'+
e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"},postRender:function(){var e,t=this;return t.items().exec("postRender"),t._super(),t._layout.postRender(t),t.state.set("rendered",!0),t.settings.style&&t.$el.css(t.settings.style),t.settings.border&&(e=t.borderBox,t.$el.css({"border-top-width":e.top,"border-right-width":e.right,"border-bottom-width":e.bottom,"border-left-width":e.left})),t.parent()||(t.keyboardNav=at({root:t})),t},initLayoutRect:function(){var e=this._super();return this._layout.recalc(this),e},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;if(!n||n.w!==t.w||n.h!==t.h)return e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0},reflow:function(){var e;if(Ze.remove(this),this.visible()){for(ot.repaintControls=[],ot.repaintControls.map={},this.recalc(),e=ot.repaintControls.length;e--;)ot.repaintCo
ntrols[e].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),ot.repaintControls=[]}return this}});function ct(e){var t,n;if(e.changedTouches)for(t="screenX screenY pageX pageY clientX clientY".split(" "),n=0;n<t.length;n++)e[t[n]]=e.changedTouches[0][t[n]]}function dt(e,h){var m,g,t,p,v,b,y,x=h.document||document;h=h||{};var w=x.getElementById(h.handle||e);t=function(e){var t,n,i,r,o,s,a,l,u,c,d,f=(t=x,u=Math.max,n=t.documentElement,i=t.body,r=u(n.scrollWidth,i.scrollWidth),o=u(n.clientWidth,i.clientWidth),s=u(n.offsetWidth,i.offsetWidth),a=u(n.scrollHeight,i.scrollHeight),l=u(n.clientHeight,i.clientHeight),{width:r<s?o:r,height:a<u(n.offsetHeight,i.offsetHeight)?l:a});ct(e),e.preventDefault(),g=e.button,c=w,b=e.screenX,y=e.screenY,d=window.getComputedStyle?window.getComputedStyle(c,null).getPropertyValue("cursor"):c.runtimeStyle.cursor,m=xe("<div></div>&q
uot;).css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:d}).appendTo(x.body),xe(x).on("mousemove touchmove",v).on("mouseup touchend",p),h.start(e)},v=function(e){if(ct(e),e.button!==g)return p(e);e.deltaX=e.screenX-b,e.deltaY=e.screenY-y,e.preventDefault(),h.drag(e)},p=function(e){ct(e),xe(x).off("mousemove touchmove",v).off("mouseup touchend",p),m.remove(),h.stop&&h.stop(e)},this.destroy=function(){xe(w).off()},xe(w).on("mousedown touchstart",t)}var ft,ht,mt,gt,pt={init:function(){this.on("repaint",this.renderScroll)},renderScroll:function(){var p=this,v=2;function n(){var m,g,e;function t(e,t,n,i,r,o){var s,a,l,u,c,d,f,h;if(a=p.getEl("scroll"+e)){if(f=t.toLowerCase(),h=n.toLowerCase(),xe(p.getEl("absend")).css(f,p.layoutRect()[i]-1),!r)return void xe(a).css("display","none");xe(a).css("display","
;block"),s=p.getEl("body"),l=p.getEl("scroll"+e+"t"),u=s["client"+n]-2*v,c=(u-=m&&g?a["client"+o]:0)/s["scroll"+n],(d={})[f]=s["offset"+t]+v,d[h]=u,xe(a).css(d),(d={})[f]=s["scroll"+t]*c,d[h]=u*c,xe(l).css(d)}}e=p.getEl("body"),m=e.scrollWidth>e.clientWidth,g=e.scrollHeight>e.clientHeight,t("h","Left","Width","contentW",m,"Height"),t("v","Top","Height","contentH",g,"Width")}p.settings.autoScroll&&(p._hasScroll||(p._hasScroll=!0,function(){function e(s,a,l,u,c){var d,e=p._id+"-scroll"+s,t=p.classPrefix;xe(p.getEl()).append('<div id="'+e+'" class="'+t+"scrollbar "+t+"scrollbar-"+s+'"><div id="'+e+'t" class="'+t+'scrollbar-thumb"></div></div>'),p.draghelper=new dt(e+"t",
{start:function(){d=p.getEl("body")["scroll"+a],xe("#"+e).addClass(t+"active")},drag:function(e){var t,n,i,r,o=p.layoutRect();n=o.contentW>o.innerW,i=o.contentH>o.innerH,r=p.getEl("body")["client"+l]-2*v,t=(r-=n&&i?p.getEl("scroll"+s)["client"+c]:0)/p.getEl("body")["scroll"+l],p.getEl("body")["scroll"+a]=d+e["delta"+u]/t},stop:function(){xe("#"+e).removeClass(t+"active")}})}p.classes.add("scroll"),e("v","Top","Height","Y","Width"),e("h","Left","Width","X","Height")}(),p.on("wheel",function(e){var t=p.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),xe(p.getEl("body")).on("scroll",n)),n())}},vt=ut.extend({Defaults:{layout:"fit",containerCl
s:"panel"},Mixins:[pt],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),void 0===n?n='<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+t.renderHtml(e)+"</div>":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1" role="group">'+(e._preBodyHtml||"")+n+"</div>"}}),bt={resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(e,t){if(e<=1||t<=1){var n=_e.getWindowSize();e=e<=1?e*n.w:e,t=t<=1?t*n.h:t}return this._layoutRect.autoResize=!1,this.layoutRect({minW:e,minH:t,w:e,h:t}).reflow()},resizeBy:function(e,t){var n=this.layoutRect();return this.resizeTo(n.w+e,n.h+t)}},yt=[],xt=[];function wt(e,t){for(;e;){if(e===t)return!0;e=e.parent()}}function _t(){
ft||(ft=function(e){2!==e.button&&function(e){for(var t=yt.length;t--;){var n=yt[t],i=n.getParentCtrl(e.target);if(n.settings.autohide){if(i&&(wt(i,n)||n.parent()===i))continue;(e=n.fire("autohide",{target:e.target})).isDefaultPrevented()||n.hide()}}}(e)},xe(document).on("click touchstart",ft))}function Rt(r){var e=_e.getViewPort().y;function t(e,t){for(var n,i=0;i<yt.length;i++)if(yt[i]!==r)for(n=yt[i].parent();n&&(n=n.parent());)n===r&&yt[i].fixed(e).moveBy(0,t).repaint()}r.settings.autofix&&(r.state.get("fixed")?r._autoFixY>e&&(r.fixed(!1).layoutRect({y:r._autoFixY}).repaint(),t(!1,r._autoFixY-e)):(r._autoFixY=r.layoutRect().y,r._autoFixY<e&&(r.fixed(!0).layoutRect({y:0}).repaint(),t(!0,e-r._autoFixY))))}function Ct(e,t){var n,i,r=Et.zIndex||65535;if(e)xt.push(t);else for(n=xt.length;n--;)xt[n]===t&&xt.splice(n,1);if(xt.length)for(n=0;n<xt.length;n++)xt[n].modal&&(r++
,i=xt[n]),xt[n].getEl().style.zIndex=r,xt[n].zIndex=r,r++;var o=xe("#"+t.classPrefix+"modal-block",t.getContainerElm())[0];i?xe(o).css("z-index",i.zIndex-1):o&&(o.parentNode.removeChild(o),gt=!1),Et.currentZIndex=r}var Et=vt.extend({Mixins:[Se,bt],init:function(e){var i=this;i._super(e),(i._eventsRoot=i).classes.add("floatpanel"),e.autohide&&(_t(),function(){if(!mt){var e=document.documentElement,t=e.clientWidth,n=e.clientHeight;mt=function(){document.all&&t===e.clientWidth&&n===e.clientHeight||(t=e.clientWidth,n=e.clientHeight,Et.hideAll())},xe(window).on("resize",mt)}}(),yt.push(i)),e.autofix&&(ht||(ht=function(){var e;for(e=yt.length;e--;)Rt(yt[e])},xe(window).on("scroll",ht)),i.on("move",function(){Rt(this)})),i.on("postrender show",function(e){if(e.control===i){var t,n=i.classPrefix;i.modal&&!gt&&((t=xe("#"+n+"modal-block",i
.getContainerElm()))[0]||(t=xe('<div id="'+n+'modal-block" class="'+n+"reset "+n+'fade"></div>').appendTo(i.getContainerElm())),u.setTimeout(function(){t.addClass(n+"in"),xe(i.getEl()).addClass(n+"in")}),gt=!0),Ct(!0,i)}}),i.on("show",function(){i.parents().each(function(e){if(e.state.get("fixed"))return i.fixed(!0),!1})}),e.popover&&(i._preBodyHtml='<div class="'+i.classPrefix+'arrow"></div>',i.classes.add("popover").add("bottom").add(i.isRtl()?"end":"start")),i.aria("label",e.ariaLabel),i.aria("labelledby",i._id),i.aria("describedby",i.describedBy||i._id+"-none")},fixed:function(e){var t=this;if(t.state.get("fixed")!==e){if(t.state.get("rendered")){var n=_e.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.classes.toggle("fixed",e),t.state.set("f
ixed",e)}return t},show:function(){var e,t=this._super();for(e=yt.length;e--&&yt[e]!==this;);return-1===e&&yt.push(this),t},hide:function(){return kt(this),Ct(!1,this),this._super()},hideAll:function(){Et.hideAll()},close:function(){return this.fire("close").isDefaultPrevented()||(this.remove(),Ct(!1,this)),this},remove:function(){kt(this),this._super()},postRender:function(){return this.settings.bodyRole&&this.getEl("body").setAttribute("role",this.settings.bodyRole),this._super()}});function kt(e){var t;for(t=yt.length;t--;)yt[t]===e&&yt.splice(t,1);for(t=xt.length;t--;)xt[t]===e&&xt.splice(t,1)}Et.hideAll=function(){for(var e=yt.length;e--;){var t=yt[e];t&&t.settings.autohide&&(t.hide(),yt.splice(e,1))}};var Ht=function(s,n,e){var a,i,l=v.DOM,t=s.getParam("fixed_toolbar_container");t&&(i=l.select(t)[0]);var r=function(){if(a&&a.moveRel&&a.visible()&&
;!a._fixed){var e=s.selection.getScrollContainer(),t=s.getBody(),n=0,i=0;if(e){var r=l.getPos(t),o=l.getPos(e);n=Math.max(0,o.x-r.x),i=Math.max(0,o.y-r.y)}a.fixed(!1).moveRel(t,s.rtl?["tr-br","br-tr"]:["tl-bl","bl-tl","tr-br"]).moveBy(n,i)}},o=function(){a&&(a.show(),r(),l.addClass(s.getBody(),"mce-edit-focus"))},u=function(){a&&(a.hide(),Et.hideAll(),l.removeClass(s.getBody(),"mce-edit-focus"))},c=function(){var e,t;a?a.visible()||o():(a=n.panel=b.create({type:i?"panel":"floatpanel",role:"application",classes:"tinymce tinymce-inline",layout:"flex",direction:"column",align:"stretch",autohide:!1,autofix:!0,fixed:(e=i,t=s,!(!e||t.settings.ui_container)),border:1,items:[!1===d(s)?null:{type:"menubar",border:"0 0 1 0",items:oe(s)},L(s,f(s))]}),O.setUiContainer(s,a),_(s),i?a.renderTo(i).reflow():a.renderTo().reflow
(),R(s,a),o(),V(s),s.on("nodeChange",r),s.on("ResizeWindow",r),s.on("activate",o),s.on("deactivate",u),s.nodeChanged())};return s.settings.content_editable=!0,s.on("focus",function(){!1===g(s)&&e.skinUiCss?l.styleSheetLoader.load(e.skinUiCss,c,c):c()}),s.on("blur hide",u),s.on("remove",function(){a&&(a.remove(),a=null)}),!1===g(s)&&e.skinUiCss?l.styleSheetLoader.load(e.skinUiCss,pe(s)):pe(s)(),{}};function St(i,r){var o,s,a=this,l=ot.classPrefix;a.show=function(e,t){function n(){o&&(xe(i).append('<div class="'+l+"throbber"+(r?" "+l+"throbber-inline":"")+'"></div>'),t&&t())}return a.hide(),o=!0,e?s=u.setTimeout(n,e):n(),a},a.hide=function(){var e=i.lastChild;return u.clearTimeout(s),e&&-1!==e.className.indexOf("throbber")&&e.parentNode.removeChild(e),o=!1,a}}var Tt=function(e,t){var n;e.on
("ProgressState",function(e){n=n||new St(t.panel.getEl("body")),e.state?n.show(e.time):n.hide()})},Mt=function(e,t,n){var i=function(e){var t=e.settings,n=t.skin,i=t.skin_url;if(!1!==n){var r=n||"lightgray";i=i?e.documentBaseURI.toAbsolute(i):h.baseURL+"/skins/"+r}return i}(e);return i&&(n.skinUiCss=i+"/skin.min.css",e.contentCSS.push(i+"/content"+(e.inline?".inline":"")+".min.css")),Tt(e,t),e.getParam("inline",!1,"boolean")?Ht(e,t,n):ye(e,t,n)},Nt=ot.extend({Mixins:[Se],Defaults:{classes:"widget tooltip tooltip-n"},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'" role="presentation"><div class="'+t+'tooltip-arrow"></div><div class="'+t+'tooltip-inner">'+e.encode(e.state.get("text"))+"</div></div>"},bindS
tates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl().lastChild.innerHTML=t.encode(e.value)}),t._super()},repaint:function(){var e,t;e=this.getEl().style,t=this._layoutRect,e.left=t.x+"px",e.top=t.y+"px",e.zIndex=131070}}),Pt=ot.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.canFocus=!0,i.tooltip&&!1!==Pt.tooltips&&(r.on("mouseenter",function(e){var t=r.tooltip().moveTo(-65535);if(e.control===r){var n=t.text(i.tooltip).show().testMoveRel(r.getEl(),["bc-tc","bc-tl","bc-tr"]);t.classes.toggle("tooltip-n","bc-tc"===n),t.classes.toggle("tooltip-nw","bc-tl"===n),t.classes.toggle("tooltip-ne","bc-tr"===n),t.moveRel(r.getEl(),n)}else t.hide()}),r.on("mouseleave mousedown click",function(){r.tooltip().remove(),r._tooltip=null})),r.aria("label",i.ariaLabel||i.tooltip)},tooltip:function
(){return this._tooltip||(this._tooltip=new Nt({type:"tooltip"}),O.inheritUiContainer(this,this._tooltip),this._tooltip.renderTo()),this._tooltip},postRender:function(){var e=this,t=e.settings;e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},bindStates:function(){var t=this;function n(e){t.aria("disabled",e),t.classes.toggle("disabled",e)}function i(e){t.aria("pressed",e),t.classes.toggle("active",e)}return t.state.on("change:disabled",function(e){n(e.value)}),t.state.on("change:active",function(e){i(e.value)}),t.state.get("disabled")&&n(!0),t.state.get("active")&&i(!0),t._super()},remove:function(){this._super(),this._tooltip&&(this._tooltip.remove(),this._tooltip=null)}}),Wt=Pt.extend({Defaults:{value:0},init:function(e){this._super(e),this.classes.add("progress"),this.settings.filter||(this.
settings.filter=function(e){return Math.round(e)})},renderHtml:function(){var e=this._id,t=this.classPrefix;return'<div id="'+e+'" class="'+this.classes+'"><div class="'+t+'bar-container"><div class="'+t+'bar"></div></div><div class="'+t+'text">0%</div></div>'},postRender:function(){return this._super(),this.value(this.settings.value),this},bindStates:function(){var t=this;function n(e){e=t.settings.filter(e),t.getEl().lastChild.innerHTML=e+"%",t.getEl().firstChild.firstChild.style.width=e+"%"}return t.state.on("change:value",function(e){n(e.value)}),n(t.state.get("value")),t._super()}}),Dt=function(e,t){e.getEl().lastChild.textContent=t+(e.progressBar?" "+e.progressBar.value()+"%":"")},Ot=ot.extend({Mixins:[Se],Defaults:{classes:"widget notification"},init:function(e){var t=this;t._super(e),t.maxWidth=e.max
Width,e.text&&t.text(e.text),e.icon&&(t.icon=e.icon),e.color&&(t.color=e.color),e.type&&t.classes.add("notification-"+e.type),e.timeout&&(e.timeout<0||0<e.timeout)&&!e.closeButton?t.closeButton=!1:(t.classes.add("has-close"),t.closeButton=!0),e.progressBar&&(t.progressBar=new Wt),t.on("click",function(e){-1!==e.target.className.indexOf(t.classPrefix+"close")&&t.close()})},renderHtml:function(){var e,t=this,n=t.classPrefix,i="",r="",o="";return t.icon&&(i='<i class="'+n+"ico "+n+"i-"+t.icon+'"></i>'),e=' style="max-width: '+t.maxWidth+"px;"+(t.color?"background-color: "+t.color+';"':'"'),t.closeButton&&(r='<button type="button" class="'+n+'close" aria-hidden="true">\xd7</button>'),t.progressBar&&(o=t.progr
essBar.renderHtml()),'<div id="'+t._id+'" class="'+t.classes+'"'+e+' role="presentation">'+i+'<div class="'+n+'notification-inner">'+t.state.get("text")+"</div>"+o+r+'<div style="clip: rect(1px, 1px, 1px, 1px);height: 1px;overflow: hidden;position: absolute;width: 1px;" aria-live="assertive" aria-relevant="additions" aria-atomic="true"></div></div>'},postRender:function(){var e=this;return u.setTimeout(function(){e.$el.addClass(e.classPrefix+"in"),Dt(e,e.state.get("text"))},100),e._super()},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl().firstChild.innerHTML=e.value,Dt(t,e.value)}),t.progressBar&&(t.progressBar.bindStates(),t.progressBar.state.on("change:value",function(e){Dt(t,t.state.get("text"))})),t._super()},close:function(){return this.fire("c
lose").isDefaultPrevented()||this.remove(),this},repaint:function(){var e,t;e=this.getEl().style,t=this._layoutRect,e.left=t.x+"px",e.top=t.y+"px",e.zIndex=65534}});function At(o){var s=function(e){return e.inline?e.getElement():e.getContentAreaContainer()};return{open:function(e,t){var n,i=w.extend(e,{maxWidth:(n=s(o),_e.getSize(n).width)}),r=new Ot(i);return 0<(r.args=i).timeout&&(r.timer=setTimeout(function(){r.close(),t()},i.timeout)),r.on("close",function(){t()}),r.renderTo(),r},close:function(e){e.close()},reposition:function(e){G(e,function(e){e.moveTo(0,0)}),function(n){if(0<n.length){var e=n.slice(0,1)[0],t=s(o);e.moveRel(t,"tc-tc"),G(n,function(e,t){0<t&&e.moveRel(n[t-1].getEl(),"bc-tc")})}}(e)},getArgs:function(e){return e.args}}}var Bt=[],Lt="";function zt(e){var t,n=xe("meta[name=viewport]")[0];!1!==de.overrideViewPort&&(n||((n=document.createElement("meta&qu
ot;)).setAttribute("name","viewport"),document.getElementsByTagName("head")[0].appendChild(n)),(t=n.getAttribute("content"))&&void 0!==Lt&&(Lt=t),n.setAttribute("content",e?"width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0":Lt))}function It(e,t){(function(){for(var e=0;e<Bt.length;e++)if(Bt[e]._fullscreen)return!0;return!1})()&&!1===t&&xe([document.documentElement,document.body]).removeClass(e+"fullscreen")}var Ft=Et.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var n=this;n._super(e),n.isRtl()&&n.classes.add("rtl"),n.classes.add("window"),n.bodyClasses.add("window-body"),n.state.set("fixed",!0),e
.buttons&&(n.statusbar=new vt({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),n.statusbar.classes.add("foot"),n.statusbar.parent(n)),n.on("click",function(e){var t=n.classPrefix+"close";(_e.hasClass(e.target,t)||_e.hasClass(e.target.parentNode,t))&&n.close()}),n.on("cancel",function(){n.close()}),n.on("move",function(e){e.control===n&&Et.hideAll()}),n.aria("describedby",n.describedBy||n._id+"-none"),n.aria("label",e.title),n._fullscreen=!1},recalc:function(){var e,t,n,i,r=this,o=r.statusbar;r._fullscreen&&(r.layoutRect(_e.getWindowSize()),r.layoutRect().contentH=r.layoutRect().innerH),r._super(),e=r.layoutRect(),r.settings.title&&!r._fullscreen&&(t=e.headerW)>e.w&&(n=e.x-Math.max(0,t/2),r.layoutRe
ct({w:t,x:n}),i=!0),o&&(o.layoutRect({w:r.layoutRect().innerW}).recalc(),(t=o.layoutRect().minW+e.deltaW)>e.w&&(n=e.x-Math.max(0,t-e.w),r.layoutRect({w:t,x:n}),i=!0)),i&&r.recalc()},initLayoutRect:function(){var e,t=this,n=t._super(),i=0;if(t.settings.title&&!t._fullscreen){e=t.getEl("head");var r=_e.getSize(e);n.headerW=r.width,n.headerH=r.height,i+=n.headerH}t.statusbar&&(i+=t.statusbar.layoutRect().h),n.deltaH+=i,n.minH+=i,n.h+=i;var o=_e.getWindowSize();return n.x=t.settings.x||Math.max(0,o.w/2-n.w/2),n.y=t.settings.y||Math.max(0,o.h/2-n.h/2),n},renderHtml:function(){var e=this,t=e._layout,n=e._id,i=e.classPrefix,r=e.settings,o="",s="",a=r.html;return e.preRender(),t.preRender(e),r.title&&(o='<div id="'+n+'-head" class="'+i+'window-head"><div id="'+n+'-title" class="'+i+'title">'+e.encode(r.title)+'</div><div id="'+n+'-dragh" cla
ss="'+i+'dragh"></div><button type="button" class="'+i+'close" aria-hidden="true"><i class="mce-ico mce-i-remove"></i></button></div>'),r.url&&(a='<iframe src="'+r.url+'" tabindex="-1"></iframe>'),void 0===a&&(a=t.renderHtml(e)),e.statusbar&&(s=e.statusbar.renderHtml()),'<div id="'+n+'" class="'+e.classes+'" hidefocus="1"><div class="'+e.classPrefix+'reset" role="application">'+o+'<div id="'+n+'-body" class="'+e.bodyClasses+'">'+a+"</div>"+s+"</div></div>"},fullscreen:function(e){var n,t,i=this,r=document.documentElement,o=i.classPrefix;if(e!==i._fullscreen)if(xe(window).on("resize",function(){var e;if(i._fullscreen)if(n)i._timer||(i._timer=u.setTimeout(function(){var e=_e.getWindowSize();i.moveTo(0,0).resi
zeTo(e.w,e.h),i._timer=0},50));else{e=(new Date).getTime();var t=_e.getWindowSize();i.moveTo(0,0).resizeTo(t.w,t.h),50<(new Date).getTime()-e&&(n=!0)}}),t=i.layoutRect(),i._fullscreen=e){i._initial={x:t.x,y:t.y,w:t.w,h:t.h},i.borderBox=Ne("0"),i.getEl("head").style.display="none",t.deltaH-=t.headerH+2,xe([r,document.body]).addClass(o+"fullscreen"),i.classes.add("fullscreen");var s=_e.getWindowSize();i.moveTo(0,0).resizeTo(s.w,s.h)}else i.borderBox=Ne(i.settings.border),i.getEl("head").style.display="",t.deltaH+=t.headerH,xe([r,document.body]).removeClass(o+"fullscreen"),i.classes.remove("fullscreen"),i.moveTo(i._initial.x,i._initial.y).resizeTo(i._initial.w,i._initial.h);return i.reflow()},postRender:function(){var t,n=this;setTimeout(function(){n.classes.add("in"),n.fire("open")},0),n._super(),n.statusbar&&n.statusbar.postRender(),n.focus(),this.dragHelpe
r=new dt(n._id+"-dragh",{start:function(){t={x:n.layoutRect().x,y:n.layoutRect().y}},drag:function(e){n.moveTo(t.x+e.deltaX,t.y+e.deltaY)}}),n.on("submit",function(e){e.isDefaultPrevented()||n.close()}),Bt.push(n),zt(!0)},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e,t=this;for(t.dragHelper.destroy(),t._super(),t.statusbar&&this.statusbar.remove(),It(t.classPrefix,!1),e=Bt.length;e--;)Bt[e]===t&&Bt.splice(e,1);zt(0<Bt.length)},getContentWindow:function(){var e=this.getEl().getElementsByTagName("iframe")[0];return e?e.contentWindow:null}});!function(){if(!de.desktop){var n={w:window.innerWidth,h:window.innerHeight};u.setInterval(function(){var e=window.innerWidth,t=window.innerHeight;n.w===e&&n.h===t||(n={w:e,h:t},xe(window).trigger("resize"))},100)}xe(window).on("resize",function(){var e,t,n=_e.getWindowSize();for(e=0;e<Bt.length;e++)t=Bt[e].layoutRe
ct(),Bt[e].moveTo(Bt[e].settings.x||Math.max(0,n.w/2-t.w/2),Bt[e].settings.y||Math.max(0,n.h/2-t.h/2))})}();var Ut,Vt,Yt,$t=Ft.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(e){var t,i=e.callback||function(){};function n(e,t,n){return{type:"button",text:e,subtype:n?"primary":"",onClick:function(e){e.control.parents()[1].close(),i(t)}}}switch(e.buttons){case $t.OK_CANCEL:t=[n("Ok",!0,!0),n("Cancel",!1)];break;case $t.YES_NO:case $t.YES_NO_CANCEL:t=[n("Yes",1,!0),n("No",0)],e.buttons===$t.YES_NO_CANCEL&&t.push(n("Cancel",-1));break;default:t=[n("Ok&q
uot;,!0,!0)]}return new Ft({padding:20,x:e.x,y:e.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:t,title:e.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:e.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:e.onClose,onCancel:function(){i(!1)}}).renderTo(document.body).reflow()},alert:function(e,t){return"string"==typeof e&&(e={text:e}),e.callback=t,$t.msgBox(e)},confirm:function(e,t){return"string"==typeof e&&(e={text:e}),e.callback=t,e.buttons=$t.OK_CANCEL,$t.msgBox(e)}}}),qt=function(n){return{renderUI:function(e){return Mt(n,this,e)},resizeTo:function(e,t){return ue(n,e,t)},resizeBy:function(e,t){return ce(n,e,t)},getNotificationManagerImpl:function(){return At(n)},getWindowManagerImpl:function(){return{open:function(n,e,t){var i;return n.title=n.title||" ",n.url=n.url
||n.file,n.url&&(n.width=parseInt(n.width||320,10),n.height=parseInt(n.height||240,10)),n.body&&(n.items={defaults:n.defaults,type:n.bodyType||"form",items:n.body,data:n.data,callbacks:n.commands}),n.url||n.buttons||(n.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit()}},{text:"Cancel",onclick:function(){i.close()}}]),(i=new Ft(n)).on("close",function(){t(i)}),n.data&&i.on("postRender",function(){this.find("*").each(function(e){var t=e.name();t in n.data&&e.value(n.data[t])})}),i.features=n||{},i.params=e||{},i=i.renderTo(document.body).reflow()},alert:function(e,t,n){var i;return(i=$t.alert(e,function(){t()})).on("close",function(){n(i)}),i},confirm:function(e,t,n){var i;return(i=$t.confirm(e,function(e){t(e)})).on("close",function(){n(i)}),i},close:function(e){e.close()},getParams:function(e){return e.params},setParams
:function(e,t){e.params=t}}}}},Xt=Te.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=w.extend({},this.Defaults,e)},preRender:function(e){e.bodyClasses.add(this.settings.containerClass)},applyClasses:function(e){var t,n,i,r,o=this.settings;t=o.firstControlClass,n=o.lastControlClass,e.each(function(e){e.classes.remove(t).remove(n).add(o.controlClass),e.visible()&&(i||(i=e),r=e)}),i&&i.classes.add(t),r&&r.classes.add(n)},renderHtml:function(e){var t="";return this.applyClasses(e.items()),e.items().each(function(e){t+=e.renderHtml()}),t},recalc:function(){},postRender:function(){},isNative:function(){return!1}}),jt=Xt.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderH
tml:function(e){return'<div id="'+e._id+'-absend" class="'+e.classPrefix+'abs-end"></div>'+this._super(e)}}),Jt=Pt.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t,n=this;n._super(e),e=n.settings,t=n.settings.size,n.on("click mousedown",function(e){e.preventDefault()}),n.on("touchstart",function(e){n.fire("click",e),e.preventDefault()}),e.subtype&&n.classes.add(e.subtype),t&&n.classes.add("btn-"+t),e.icon&&n.icon(e.icon)},icon:function(e){return arguments.length?(this.state.set("icon",e),this):this.state.get("icon")},repaint:function(){var e,t=this.getEl().firstChild;t&&((e=t.style).width=e.height="100%"),this._super()},renderHtml:function(){var e,t,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a="",l=n.settings;return(e=l.image)?(o="none&qu
ot;,"string"!=typeof e&&(e=window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",s&&(n.classes.add("btn-has-text"),a='<span class="'+r+'txt">'+n.encode(s)+"</span>"),o=o?r+"ico "+r+"i-"+o:"",t="boolean"==typeof l.active?' aria-pressed="'+l.active+'"':"",'<div id="'+i+'" class="'+n.classes+'" tabindex="-1"'+t+'><button id="'+i+'-button" role="presentation" type="button" tabindex="-1">'+(o?'<i class="'+o+'"'+e+"></i>":"")+a+"</button></div>"},bindStates:function(){var o=this,n=o.$,i=o.classPrefix+"txt";function s(e){var t=n("span."+i,o.getEl());e?(t[0]||(n("button:first",o.getEl()).append('<span class="'+i+'&qu
ot;></span>'),t=n("span."+i,o.getEl())),t.html(o.encode(e))):t.remove(),o.classes.toggle("btn-has-text",!!e)}return o.state.on("change:text",function(e){s(e.value)}),o.state.on("change:icon",function(e){var t=e.value,n=o.classPrefix;t=(o.settings.icon=t)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];t?(r&&r===i.firstChild||(r=document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=t):r&&i.removeChild(r),s(o.state.get("text"))}),o._super()}}),Gt=Jt.extend({init:function(e){e=w.extend({text:"Browse...",multiple:!1,accept:null},e),this._super(e),this.classes.add("browsebutton"),e.multiple&&this.classes.add("multiple")},postRender:function(){var n=this,t=_e.create("input",{type:"file",id:n._id+"-browse",accept:n.settings.accept});n._
super(),xe(t).on("change",function(e){var t=e.target.files;n.value=function(){return t.length?n.settings.multiple?t:t[0]:null},e.preventDefault(),t.length&&n.fire("change",e)}),xe(t).on("click",function(e){e.stopPropagation()}),xe(n.getEl("button")).on("click",function(e){e.stopPropagation(),t.click()}),n.getEl().appendChild(t)},remove:function(){xe(this.getEl("button")).off(),xe(this.getEl("input")).off(),this._super()}}),Kt=ut.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.classes.add("btn-group"),e.preRender(),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+(e.settings.html||"")+t.renderHtml(e)+"</div></div>"}}),Zt=Pt.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init
:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){return arguments.length?(this.state.set("checked",e),this):this.state.get("checked")},value:function(e){return arguments.length?this.checked(e):this.checked()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'<div id="'+t+'" class="'+e.classes+'" unselectable="on" aria-labelledby="'+t+'-al" tabindex="-1"><i class="'+n+"ico "+n+'i-checkbox"></i><span id="'+t+'-al" class="'+n+'label">'+e.encode(e.state.get("text"))+"</span></div>"},bindStates:function(){var o=this;function t(e){o.classes.toggle("checked",e),o.aria("checked",e)}return o.state.on(
"change:text",function(e){o.getEl("al").firstChild.data=o.translate(e.value)}),o.state.on("change:checked change:value",function(e){o.fire("change"),t(e.value)}),o.state.on("change:icon",function(e){var t=e.value,n=o.classPrefix;if(void 0===t)return o.settings.icon;t=(o.settings.icon=t)?n+"ico "+n+"i-"+o.settings.icon:"";var i=o.getEl().firstChild,r=i.getElementsByTagName("i")[0];t?(r&&r===i.firstChild||(r=document.createElement("i"),i.insertBefore(r,i.firstChild)),r.className=t):r&&i.removeChild(r)}),o.state.get("checked")&&t(!0),o._super()}}),Qt=tinymce.util.Tools.resolve("tinymce.util.VK"),en=Pt.extend({init:function(i){var r=this;r._super(i),i=r.settings,r.classes.add("combobox"),r.subinput=!0,r.ariaTarget="inp",i.menu=i.menu||i.values,i.menu&&(i.icon="caret"),r.on("click",function(e){var t
=e.target,n=r.getEl();if(xe.contains(n,t)||t===n)for(;t&&t!==n;)t.id&&-1!==t.id.indexOf("-open")&&(r.fire("action"),i.menu&&(r.showMenu(),e.aria&&r.menu.items()[0].focus())),t=t.parentNode}),r.on("keydown",function(e){var t;13===e.keyCode&&"INPUT"===e.target.nodeName&&(e.preventDefault(),r.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),r.fire("submit",{data:t.toJSON()}))}),r.on("keyup",function(e){if("INPUT"===e.target.nodeName){var t=r.state.get("value"),n=e.target.value;n!==t&&(r.state.set("value",n),r.fire("autocomplete",e))}}),r.on("mouseover",function(e){var t=r.tooltip().moveTo(-65535);if(r.statusLevel()&&-1!==e.target.className.indexOf(r.classPrefix+"status")){var n=r.statusMessage()||"Ok",i=t.text(n).show().testMoveRel(e.target,["bc-tc","bc-tl&
quot;,"bc-tr"]);t.classes.toggle("tooltip-n","bc-tc"===i),t.classes.toggle("tooltip-nw","bc-tl"===i),t.classes.toggle("tooltip-ne","bc-tr"===i),t.moveRel(e.target,i)}})},statusLevel:function(e){return 0<arguments.length&&this.state.set("statusLevel",e),this.state.get("statusLevel")},statusMessage:function(e){return 0<arguments.length&&this.state.set("statusMessage",e),this.state.get("statusMessage")},showMenu:function(){var e,t=this,n=t.settings;t.menu||((e=n.menu||[]).length?e={type:"menu",items:e}:e.type=e.type||"menu",t.menu=b.create(e).parent(t).renderTo(t.getContainerElm()),t.fire("createmenu"),t.menu.reflow(),t.menu.on("cancel",function(e){e.control===t.menu&&t.focus()}),t.menu.on("show hide",function(e){e.control.items().each(function(e){e.active(e.value()===t.value())})}).fire("show&
quot;),t.menu.on("select",function(e){t.value(e.control.value())}),t.on("focusin",function(e){"INPUT"===e.target.tagName.toUpperCase()&&t.menu.hide()}),t.aria("expanded",!0)),t.menu.show(),t.menu.layoutRect({w:t.layoutRect().w}),t.menu.moveRel(t.getEl(),t.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},focus:function(){this.getEl("inp").focus()},repaint:function(){var e,t,n=this,i=n.getEl(),r=n.getEl("open"),o=n.layoutRect(),s=0,a=i.firstChild;n.statusLevel()&&"none"!==n.statusLevel()&&(s=parseInt(_e.getRuntimeStyle(a,"padding-right"),10)-parseInt(_e.getRuntimeStyle(a,"padding-left"),10)),e=r?o.w-_e.getSize(r).width-10:o.w-10;var l=document;return l.all&&(!l.documentMode||l.documentMode<=8)&&(t=n.layoutRect().h-2+"px"),xe(a).css({width:e-s,lineHeight:t}),n._super(),n},postRender:function(){var t=this;retu
rn xe(this.getEl("inp")).on("change",function(e){t.state.set("value",e.target.value),t.fire("change",e)}),t._super()},renderHtml:function(){var e,t,n,i=this,r=i._id,o=i.settings,s=i.classPrefix,a=i.state.get("value")||"",l="",u="";return"spellcheck"in o&&(u+=' spellcheck="'+o.spellcheck+'"'),o.maxLength&&(u+=' maxlength="'+o.maxLength+'"'),o.size&&(u+=' size="'+o.size+'"'),o.subtype&&(u+=' type="'+o.subtype+'"'),n='<i id="'+r+'-status" class="mce-status mce-ico" style="display: none"></i>',i.disabled()&&(u+=' disabled="disabled"'),(e=o.icon)&&"caret"!==e&&(e=s+"ico "+s+"i-"+o.icon),t=i.state.get("text"),(e||t)&&(l='<div id="'+r+'-open" class="'+s+"btn "+s+'open" tabInde
x="-1" role="button"><button id="'+r+'-action" type="button" hidefocus="1" tabindex="-1">'+("caret"!==e?'<i class="'+e+'"></i>':'<i class="'+s+'caret"></i>')+(t?(e?" ":"")+t:"")+"</button></div>",i.classes.add("has-open")),'<div id="'+r+'" class="'+i.classes+'"><input id="'+r+'-inp" class="'+s+'textbox" value="'+i.encode(a,!1)+'" hidefocus="1"'+u+' placeholder="'+i.encode(o.placeholder)+'" />'+n+l+"</div>"},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl("inp").value),this.state.get("value"))},showAutoComplete:function(e,i){var r=this;if(0!==e.length){r.menu?r
.menu.items().remove():r.menu=b.create({type:"menu",classes:"combobox-menu",layout:"flow"}).parent(r).renderTo(),w.each(e,function(e){var t,n;r.menu.add({text:e.title,url:e.previewUrl,match:i,classes:"menu-item-ellipsis",onclick:(t=e.value,n=e.title,function(){r.fire("selectitem",{title:n,value:t})})})}),r.menu.renderNew(),r.hideMenu(),r.menu.on("cancel",function(e){e.control.parent()===r.menu&&(e.stopPropagation(),r.focus(),r.hideMenu())}),r.menu.on("select",function(){r.focus()});var t=r.layoutRect().w;r.menu.layoutRect({w:t,minW:0,maxW:t}),r.menu.repaint(),r.menu.reflow(),r.menu.show(),r.menu.moveRel(r.getEl(),r.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])}else r.hideMenu()},hideMenu:function(){this.menu&&this.menu.hide()},bindStates:function(){var r=this;r.state.on("change:value",function(e){r.getEl("inp").value!==e.value&&(r.g
etEl("inp").value=e.value)}),r.state.on("change:disabled",function(e){r.getEl("inp").disabled=e.value}),r.state.on("change:statusLevel",function(e){var t=r.getEl("status"),n=r.classPrefix,i=e.value;_e.css(t,"display","none"===i?"none":""),_e.toggleClass(t,n+"i-checkmark","ok"===i),_e.toggleClass(t,n+"i-warning","warn"===i),_e.toggleClass(t,n+"i-error","error"===i),r.classes.toggle("has-status","none"!==i),r.repaint()}),_e.on(r.getEl("status"),"mouseleave",function(){r.tooltip().hide()}),r.on("cancel",function(e){r.menu&&r.menu.visible()&&(e.stopPropagation(),r.hideMenu())});var n=function(e,t){t&&0<t.items().length&&t.items().eq(e)[0].focus()};return r.on("keydown",function(e){var t=e.keyCode;"INPUT"===e.target.nodeName&&(t=
==Qt.DOWN?(e.preventDefault(),r.fire("autocomplete"),n(0,r.menu)):t===Qt.UP&&(e.preventDefault(),n(-1,r.menu)))}),r._super()},remove:function(){xe(this.getEl("inp")).off(),this.menu&&this.menu.remove(),this._super()}}),tn=en.extend({init:function(e){var t=this;e.spellcheck=!1,e.onaction&&(e.icon="none"),t._super(e),t.classes.add("colorbox"),t.on("change keyup postrender",function(){t.repaintColor(t.value())})},repaintColor:function(e){var t=this.getEl("open"),n=t?t.getElementsByTagName("i")[0]:null;if(n)try{n.style.background=e}catch(i){}},bindStates:function(){var t=this;return t.state.on("change:value",function(e){t.state.get("rendered")&&t.repaintColor(e.value)}),t._super()}}),nn=Jt.extend({showPanel:function(){var t=this,e=t.settings;if(t.classes.add("opened"),t.panel)t.panel.show();else{var n=e.panel;n.type&&(n={layout:"grid",item
s:n}),n.role=n.role||"dialog",n.popover=!0,n.autohide=!0,n.ariaRoot=!0,t.panel=new Et(n).on("hide",function(){t.classes.remove("opened")}).on("cancel",function(e){e.stopPropagation(),t.focus(),t.hidePanel()}).parent(t).renderTo(t.getContainerElm()),t.panel.fire("show"),t.panel.reflow()}var i=t.panel.testMoveRel(t.getEl(),e.popoverAlign||(t.isRtl()?["bc-tc","bc-tl","bc-tr"]:["bc-tc","bc-tr","bc-tl","tc-bc","tc-br","tc-bl"]));t.panel.classes.toggle("start","l"===i.substr(-1)),t.panel.classes.toggle("end","r"===i.substr(-1));var r="t"===i.substr(0,1);t.panel.classes.toggle("bottom",!r),t.panel.classes.toggle("top",r),t.panel.moveRel(t.getEl(),i)},hidePanel:function(){this.panel&&this.panel.hide()},postRender:function(){var t=this;return t.aria("haspopup",!0),t.o
n("click",function(e){e.control===t&&(t.panel&&t.panel.visible()?t.hidePanel():(t.showPanel(),t.panel.focus(!!e.aria)))}),t._super()},remove:function(){return this.panel&&(this.panel.remove(),this.panel=null),this._super()}}),rn=v.DOM,on=nn.extend({init:function(e){this._super(e),this.classes.add("splitbtn"),this.classes.add("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},resetColor:function(){return this._color=null,this.getEl("preview").style.backgroundColor=null,this},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,i=e.state.get("text"),r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",o=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"",s="";return i&&(e.classes.add("btn-has-text"),s='&l
t;span class="'+n+'txt">'+e.encode(i)+"</span>"),'<div id="'+t+'" class="'+e.classes+'" role="button" tabindex="-1" aria-haspopup="true"><button role="presentation" hidefocus="1" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+o+"></i>":"")+'<span id="'+t+'-preview" class="'+n+'preview"></span>'+s+'</button><button type="button" class="'+n+'open" hidefocus="1" tabindex="-1"> <i class="'+n+'caret"></i></button></div>'},postRender:function(){var t=this,n=t.settings.onclick;return t.on("click",function(e){e.aria&&"down"===e.aria.key||e.control!==t||rn.getParent(e.target,"."+t.classPrefix+"open")||(e.stopImmediatePropagation(),n.call(t,e))}),delete t
.settings.onclick,t._super()}}),sn=tinymce.util.Tools.resolve("tinymce.util.Color"),an=Pt.extend({Defaults:{classes:"widget colorpicker"},init:function(e){this._super(e)},postRender:function(){var n,i,r,o,s,a=this,l=a.color();function u(e,t){var n,i,r=_e.getPos(e);return n=t.pageX-r.x,i=t.pageY-r.y,{x:n=Math.max(0,Math.min(n/e.clientWidth,1)),y:i=Math.max(0,Math.min(i/e.clientHeight,1))}}function c(e,t){var n=(360-e.h)/360;_e.css(r,{top:100*n+"%"}),t||_e.css(s,{left:e.s+"%",top:100-e.v+"%"}),o.style.background=sn({s:100,v:100,h:e.h}).toHex(),a.color().parse({s:e.s,v:e.v,h:e.h})}function e(e){var t;t=u(o,e),n.s=100*t.x,n.v=100*(1-t.y),c(n),a.fire("change")}function t(e){var t;t=u(i,e),(n=l.toHsv()).h=360*(1-t.y),c(n,!0),a.fire("change")}i=a.getEl("h"),r=a.getEl("hp"),o=a.getEl("sv"),s=a.getEl("svp"),a._repaint=function(){c(n=l.toHsv())},a._super(),a._svdraghelper=new dt(a._id
+"-sv",{start:e,drag:e}),a._hdraghelper=new dt(a._id+"-h",{start:t,drag:t}),a._repaint()},rgb:function(){return this.color().toRgb()},value:function(e){if(!arguments.length)return this.color().toHex();this.color().parse(e),this._rendered&&this._repaint()},color:function(){return this._color||(this._color=sn()),this._color},renderHtml:function(){var e,t=this._id,o=this.classPrefix,s="#ff0000,#ff0080,#ff00ff,#8000ff,#0000ff,#0080ff,#00ffff,#00ff80,#00ff00,#80ff00,#ffff00,#ff8000,#ff0000";return e='<div id="'+t+'-h" class="'+o+'colorpicker-h" style="background: -ms-linear-gradient(top,'+s+");background: linear-gradient(to bottom,"+s+');">'+function(){var e,t,n,i,r="";for(n="filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=",e=0,t=(i=s.split(",")).length-1;e<t;e++)r+='<div class="'+o+'colorpicker-h-chunk" style="height:'+100
/t+"%;"+n+i[e]+",endColorstr="+i[e+1]+");-ms-"+n+i[e]+",endColorstr="+i[e+1]+')"></div>';return r}()+'<div id="'+t+'-hp" class="'+o+'colorpicker-h-marker"></div></div>','<div id="'+t+'" class="'+this.classes+'"><div id="'+t+'-sv" class="'+o+'colorpicker-sv"><div class="'+o+'colorpicker-overlay1"><div class="'+o+'colorpicker-overlay2"><div id="'+t+'-svp" class="'+o+'colorpicker-selector1"><div class="'+o+'colorpicker-selector2"></div></div></div></div></div>'+e+"</div>"}}),ln=Pt.extend({init:function(e){e=w.extend({height:100,text:"Drop an image here",multiple:!1,accept:null},e),this._super(e),this.classes.add("dropzone"),e.multiple&&this.classes.add("multiple")},renderHtml:function(){va
r e,t,n=this.settings;return e={id:this._id,hidefocus:"1"},t=_e.create("div",e,"<span>"+this.translate(n.text)+"</span>"),n.height&&_e.css(t,"height",n.height+"px"),n.width&&_e.css(t,"width",n.width+"px"),t.className=this.classes,t.outerHTML},postRender:function(){var i=this,e=function(e){e.preventDefault(),i.classes.toggle("dragenter"),i.getEl().className=i.classes};i._super(),i.$el.on("dragover",function(e){e.preventDefault()}),i.$el.on("dragenter",e),i.$el.on("dragleave",e),i.$el.on("drop",function(e){if(e.preventDefault(),!i.state.get("disabled")){var t=function(e){var t=i.settings.accept;if("string"!=typeof t)return e;var n=new RegExp("("+t.split(/\s*,\s*/).join("|")+")$","i");return w.grep(e,function(e){return n.test(e.name)})}(e.dataTransfer.files);i.value=funct
ion(){return t.length?i.settings.multiple?t:t[0]:null},t.length&&i.fire("change",e)}})},remove:function(){this.$el.off(),this._super()}}),un=Pt.extend({init:function(e){var n=this;e.delimiter||(e.delimiter="\xbb"),n._super(e),n.classes.add("path"),n.canFocus=!0,n.on("click",function(e){var t;(t=e.target.getAttribute("data-index"))&&n.fire("select",{value:n.row()[t],index:t})}),n.row(n.settings.row)},focus:function(){return this.getEl().firstChild.focus(),this},row:function(e){return arguments.length?(this.state.set("row",e),this):this.state.get("row")},renderHtml:function(){return'<div id="'+this._id+'" class="'+this.classes+'">'+this._getDataPathHtml(this.state.get("row"))+"</div>"},bindStates:function(){var t=this;return t.state.on("change:row",function(e){t.innerHtml(t._getDataPathHtml(e.value))}),t._super()},_getDataPathHtm
l:function(e){var t,n,i=e||[],r="",o=this.classPrefix;for(t=0,n=i.length;t<n;t++)r+=(0<t?'<div class="'+o+'divider" aria-hidden="true"> '+this.settings.delimiter+" </div>":"")+'<div role="button" class="'+o+"path-item"+(t===n-1?" "+o+"last":"")+'" data-index="'+t+'" tabindex="-1" id="'+this._id+"-"+t+'" aria-level="'+(t+1)+'">'+i[t].name+"</div>";return r||(r='<div class="'+o+'path-item">\xa0</div>'),r}}),cn=un.extend({postRender:function(){var o=this,s=o.settings.editor;function a(e){if(1===e.nodeType){if("BR"===e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}return!1!==s.settings.elementpath&&(o.on("select",function(e){s.focus(),s.sele
ction.select(this.row()[e.index].element),s.nodeChanged()}),s.on("nodeChange",function(e){for(var t=[],n=e.parents,i=n.length;i--;)if(1===n[i].nodeType&&!a(n[i])){var r=s.fire("ResolveName",{name:n[i].nodeName.toLowerCase(),target:n[i]});if(r.isDefaultPrevented()||t.push({name:r.name,element:n[i]}),r.isPropagationStopped())break}o.row(t)})),o._super()}}),dn=ut.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.classes.add("formitem"),t.preRender(e),'<div id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<div id="'+e._id+'-title" class="'+n+'title">'+e.settings.title+"</div>":"")+'<div id="'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"
</div></div>"}}),fn=ut.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:15,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var i=this,e=i.items();i.settings.formItemDefaults||(i.settings.formItemDefaults={layout:"flex",autoResize:"overflow",defaults:{flex:1}}),e.each(function(e){var t,n=e.settings.label;n&&((t=new dn(w.extend({items:{type:"label",id:e._id+"-l",text:n,flex:0,forId:e._id,disabled:e.disabled()}},i.settings.formItemDefaults))).type="formitem",e.aria("labelledby",e._id+"-l"),"undefined"==typeof e.settings.flex&&(e.settings.flex=1),i.replace(e,t),t.add(e))})},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){this._super(),this.fromJSON(this.settings.data)},bindStates:function(){va
r n=this;function e(){var e,t,i=0,r=[];if(!1!==n.settings.labelGapCalc)for(("children"===n.settings.labelGapCalc?n.find("formitem"):n.items()).filter("formitem").each(function(e){var t=e.items()[0],n=t.getEl().clientWidth;i=i<n?n:i,r.push(t)}),t=n.settings.labelGap||0,e=r.length;e--;)r[e].settings.minWidth=i+t}n._super(),n.on("show",e),e()}}),hn=fn.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'<fieldset id="'+e._id+'" class="'+e.classes+'" hidefocus="1" tabindex="-1">'+(e.settings.title?'<legend id="'+e._id+'-title" class="'+n+'fieldset-title">'+e.settings.title+"</legend>":"")+'<div id="
;'+e._id+'-body" class="'+e.bodyClasses+'">'+(e.settings.html||"")+t.renderHtml(e)+"</div></fieldset>"}}),mn=0,gn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:k(e)}},pn={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),"HTML must have a single root node";return gn(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return gn(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return gn(n)},fromDom:gn,fromPoint:function(e,t,n){var i=e.dom();return W.from(i.elementFromPoint(t,n)).map(gn)}},vn=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE,Node.DOCUMENT_NODE),bn=(Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE),yn=(Node.TEXT_NODE
,Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,"undefined"!=typeof window?window:Function("return this;")(),function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(i.test(t))return i}return undefined}(e,t);if(!n)return{major:0,minor:0};var i=function(e){return Number(t.replace(n,"$"+e))};return wn(i(1),i(2))}),xn=function(){return wn(0,0)},wn=function(e,t){return{major:e,minor:t}},_n={nu:wn,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?xn():yn(e,n)},unknown:xn},Rn="Firefox",Cn=function(e,t){return function(){return t===e}},En=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Cn("Edge",t),isChrome:Cn("Chrome",t),isIE:Cn("IE",t),isOpera:Cn("Opera",t),isFirefox:Cn(Rn,t),isSafari:Cn("Safari",t)}},kn={unknown:function(){return En({current:undefined,version:_n.unknown()})},nu:En,edge:
k("Edge"),chrome:k("Chrome"),ie:k("IE"),opera:k("Opera"),firefox:k(Rn),safari:k("Safari")},Hn="Windows",Sn="Android",Tn="Solaris",Mn="FreeBSD",Nn=function(e,t){return function(){return t===e}},Pn=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Nn(Hn,t),isiOS:Nn("iOS",t),isAndroid:Nn(Sn,t),isOSX:Nn("OSX",t),isLinux:Nn("Linux",t),isSolaris:Nn(Tn,t),isFreeBSD:Nn(Mn,t)}},Wn={unknown:function(){return Pn({current:undefined,version:_n.unknown()})},nu:Pn,windows:k(Hn),ios:k("iOS"),android:k(Sn),linux:k("Linux"),osx:k("OSX"),solaris:k(Tn),freebsd:k(Mn)},Dn=function(e,t){var n=String(t).toLowerCase();return function(e,t){for(var n=0,i=e.length;n<i;n++){var r=e[n];if(t(r,n,e))return W.some(r)}return W.none()}(e,function(e){return e.search(n)})},On=function(e,n){return Dn(e,n).map(function(e){var t=_n.detect(e.versionR
egexes,n);return{current:e.name,version:t}})},An=function(e,n){return Dn(e,n).map(function(e){var t=_n.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Bn=function(e,t){return-1!==e.indexOf(t)},Ln=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,zn=function(t){return function(e){return Bn(e,t)}},In=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Bn(e,"edge/")&&Bn(e,"chrome")&&Bn(e,"safari")&&Bn(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Ln],search:function(e){return Bn(e,"chrome")&&!Bn(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Bn(e,"msie")||Bn(e,"trident")}},{name:"Opera",versionRegexes:[Ln,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:zn("opera")},{nam
e:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:zn("firefox")},{name:"Safari",versionRegexes:[Ln,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Bn(e,"safari")||Bn(e,"mobile/"))&&Bn(e,"applewebkit")}}],Fn=[{name:"Windows",search:zn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Bn(e,"iphone")||Bn(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:zn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:zn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:zn("linux"),versionRegexes:[]},{name:"Solaris",search:zn("sunos"),versionRegexe
s:[]},{name:"FreeBSD",search:zn("freebsd"),versionRegexes:[]}],Un={browsers:k(In),oses:k(Fn)},Vn=function(e){var t,n,i,r,o,s,a,l,u,c,d,f=Un.browsers(),h=Un.oses(),m=On(f,e).fold(kn.unknown,kn.nu),g=An(h,e).fold(Wn.unknown,Wn.nu);return{browser:m,os:g,deviceType:(n=m,i=e,r=(t=g).isiOS()&&!0===/ipad/i.test(i),o=t.isiOS()&&!r,s=t.isAndroid()&&3===t.version.major,a=t.isAndroid()&&4===t.version.major,l=r||s||a&&!0===/mobile/i.test(i),u=t.isiOS()||t.isAndroid(),c=u&&!l,d=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(i),{isiPad:k(r),isiPhone:k(o),isTablet:k(l),isPhone:k(c),isTouch:k(u),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:k(d)})}},Yn=(Yt=!(Ut=function(){var e=navigator.userAgent;return Vn(e)}),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Yt||(Yt=!0,Vt=Ut.apply(null,e)),Vt}),$n=bn,qn=vn,Xn=function(e){return e.nodeType!==$n&&e.nodeType!==qn||0===e.childElemen
tCount},jn=(Yn().browser.isIE(),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}("element","offset"),w.trim),Jn=function(t){return function(e){if(e&&1===e.nodeType){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Gn=Jn("true"),Kn=Jn("false"),Zn=function(e,t,n,i,r){return{type:e,title:t,url:n,level:i,attach:r}},Qn=function(e){return e.innerText||e.textContent},ei=function(e){return e.id?e.id:(t="h",n=(new Date).getTime(),t+"_"+Math.floor(1e9*Math.random())+ ++mn+String(n));var t,n},ti=function(e){return(t=e)&&"A"===t.nodeName&&(t.id||t.name)&&ii(e);var t},ni=function(e){return e&&/^(H[1-6])$/.test(e.nodeName)},ii=function(e){return function(e){for(;e=e.parentNode;){var t=e.contentEditable;if(t&&"inherit"!==t)return Gn(e)}return!1}(e)&&!Kn(e)},ri=function(e){retu
rn ni(e)&&ii(e)},oi=function(e){var t,n=ei(e);return Zn("header",Qn(e),"#"+n,ni(t=e)?parseInt(t.nodeName.substr(1),10):0,function(){e.id=n})},si=function(e){var t=e.id||e.name,n=Qn(e);return Zn("anchor",n||"#"+t,"#"+t,0,E)},ai=function(e){var t,n,i,r,o,s;return t="h1,h2,h3,h4,h5,h6,a:not([href])",n=e,J((Yn().browser.isIE(),function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}("element","offset"),i=pn.fromDom(n),r=t,s=(o=i)===undefined?document:o.dom(),Xn(s)?[]:J(s.querySelectorAll(r),pn.fromDom)),function(e){return e.dom()})},li=function(e){return 0<jn(e.title).length},ui=function(e){var t,n=ai(e);return K((t=n,J(K(t,ri),oi)).concat(J(K(n,ti),si)),li)},ci={},di=function(e){return{title:e.title,value:{title:{raw:e.title},url:e.url,attach:e.attach}}},fi=function(e,t){return{title:e,value:{title:e,url:t,attach:E}}},hi=function(e,t,n){var i=t in e?e[t]:n;return!1===i?null:i},mi=
function(e,i,r,t){var n,o,s,a,l,u,c={title:"-"},d=function(e){var t=e.hasOwnProperty(r)?e[r]:[],n=K(t,function(e){return t=e,!j(i,function(e){return e.url===t});var t});return w.map(n,function(e){return{title:e,value:{title:e,url:e,attach:E}}})},f=function(t){var e,n=K(i,function(e){return e.type===t});return e=n,w.map(e,di)};return!1===t.typeahead_urls?[]:"file"===r?(n=[pi(e,d(ci)),pi(e,f("header")),pi(e,(a=f("anchor"),l=hi(t,"anchor_top","#top"),u=hi(t,"anchor_bottom","#bottom"),null!==l&&a.unshift(fi("<top>",l)),null!==u&&a.push(fi("<bottom>",u)),a))],o=function(e,t){return 0===e.length||0===t.length?e.concat(t):e.concat(c,t)},s=[],G(n,function(e){s=o(s,e)}),s):pi(e,d(ci))},gi=function(e,t){var n,i,r,o=ci[t];/^https?/.test(e)&&(o?(n=o,i=e,r=X(n,i),-1===r?W.none():W.some(r)).isNone()&&(ci[t]=o.slice(0,5).concat(e)):ci[t]=[e])},pi=function(
e,t){var n=e.toLowerCase(),i=w.grep(t,function(e){return-1!==e.title.toLowerCase().indexOf(n)});return 1===i.length&&i[0].title===e?[]:i},vi=function(o,e,n){var i=e.filepicker_validator_handler;i&&o.state.on("change:value",function(e){var t;0!==(t=e.value).length?i({url:t,type:n},function(e){var t,n,i,r=(n=(t=e).status,i=t.message,"valid"===n?{status:"ok",message:i}:"unknown"===n?{status:"warn",message:i}:"invalid"===n?{status:"warn",message:i}:{status:"none",message:""});o.statusMessage(r.message),o.statusLevel(r.status)}):o.statusLevel("none")})},bi=en.extend({Statics:{clearHistory:function(){ci={}}},init:function(e){var t,n,i,r,o,s,a,l,u=this,c=window.tinymce?window.tinymce.activeEditor:h.activeEditor,d=c.settings,f=e.filetype;e.spellcheck=!1,(i=d.file_picker_types||d.file_browser_callback_types)&&(i=w.makeMap(i,/[, ]/)),i&&!i[f]||(!(n=d.file_picker_
callback)||i&&!i[f]?!(n=d.file_browser_callback)||i&&!i[f]||(t=function(){n(u.getEl("inp").id,u.value(),f,window)}):t=function(){var e=u.fire("beforecall").meta;e=w.extend({filetype:f},e),n.call(c,function(e,t){u.value(e).fire("change",{meta:t})},u.value(),e)}),t&&(e.icon="browse",e.onaction=t),u._super(e),u.classes.add("filepicker"),r=u,o=d,s=c.getBody(),a=f,l=function(e){var t=ui(s),n=mi(e,t,a,o);r.showAutoComplete(n,e)},r.on("autocomplete",function(){l(r.value())}),r.on("selectitem",function(e){var t=e.value;r.value(t.url);var n,i=(n=t.title).raw?n.raw:n;"image"===a?r.fire("change",{meta:{alt:i,attach:t.attach}}):r.fire("change",{meta:{text:i,attach:t.attach}}),r.focus()}),r.on("click",function(e){0===r.value().length&&"INPUT"===e.target.nodeName&&l("")}),r.on("PostRender",function(){r.getRoot().on(&quo
t;submit",function(e){e.isDefaultPrevented()||gi(r.value(),a)})}),vi(u,d,f)}}),yi=jt.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox;e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc()})}}),xi=jt.extend({recalc:function(e){var t,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,R,C,E,k,H,S,T,M,N,P,W,D,O,A,B,L=[],z=Math.max,I=Math.min;for(i=e.items().filter(":visible"),r=e.layoutRect(),o=e.paddingBox,s=e.settings,f=e.isRtl()?s.direction||"row-reversed":s.direction,a=s.align,l=e.isRtl()?s.pack||"end":s.pack,u=s.spacing||0,"row-reversed"!==f&&"column-reverse"!==f||(i=i.set(i.toArray().reverse()),f=f.split("-")[0]),"column"===f?(C="y",_="h",R="minH",E="maxH",H="innerH",k="top",S="deltaH",T="contentH",D=&
quot;left",P="w",M="x",N="innerW",W="minW",O="right",A="deltaW",B="contentW"):(C="x",_="w",R="minW",E="maxW",H="innerW",k="left",S="deltaW",T="contentW",D="top",P="h",M="y",N="innerH",W="minH",O="bottom",A="deltaH",B="contentH"),d=r[H]-o[k]-o[k],w=c=0,t=0,n=i.length;t<n;t++)m=(h=i[t]).layoutRect(),d-=t<n-1?u:0,0<(g=h.settings.flex)&&(c+=g,m[E]&&L.push(h),m.flex=g),d-=m[R],w<(p=o[D]+m[W]+o[O])&&(w=p);if((y={})[R]=d<0?r[R]-d+r[S]:r[H]-d+r[S],y[W]=w+r[A],y[T]=r[H]-d,y[B]=w,y.minW=I(y.minW,r.maxW),y.minH=I(y.minH,r.maxH),y.minW=z(y.minW,r.startMinWidth),y.minH=z(y.minH,r.startMinHeight),!r.autoResize||y.minW===r.minW&&y.minH===r.minH){for(b=d/c,t=0,n=L.length;t<n;t++)(v=(m=(h=L[t]).layoutRect())[E])<(p=m
[R]+m.flex*b)?(d-=m[E]-m[R],c-=m.flex,m.flex=0,m.maxFlexSize=v):m.maxFlexSize=0;for(b=d/c,x=o[k],y={},0===c&&("end"===l?x=d+o[k]:"center"===l?(x=Math.round(r[H]/2-(r[H]-d)/2)+o[k])<0&&(x=o[k]):"justify"===l&&(x=o[k],u=Math.floor(d/(i.length-1)))),y[M]=o[D],t=0,n=i.length;t<n;t++)p=(m=(h=i[t]).layoutRect()).maxFlexSize||m[R],"center"===a?y[M]=Math.round(r[N]/2-m[P]/2):"stretch"===a?(y[P]=z(m[W]||0,r[N]-o[D]-o[O]),y[M]=o[D]):"end"===a&&(y[M]=r[N]-m[P]-o.top),0<m.flex&&(p+=m.flex*b),y[_]=p,y[C]=x,h.layoutRect(y),h.recalc&&h.recalc(),x+=p+u}else if(y.w=y.minW,y.h=y.minH,e.layoutRect(y),this.recalc(e),null===e._lastRect){var F=e.parent();F&&(F._lastRect=null,F.recalc())}}}),wi=Xt.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").eac
h(function(e){e.recalc&&e.recalc()})},isNative:function(){return!0}}),_i=function(e,t){return n=t,r=(i=e)===undefined?document:i.dom(),Xn(r)?W.none():W.from(r.querySelector(n)).map(pn.fromDom);var n,i,r},Ri=function(e,t){return function(){e.execCommand("mceToggleFormat",!1,t)}},Ci=function(e,t,n){var i=function(e){n(e,t)};e.formatter?e.formatter.formatChanged(t,i):e.on("init",function(){e.formatter.formatChanged(t,i)})},Ei=function(e,n){return function(t){Ci(e,n,function(e){t.control.active(e)})}},ki=function(i){var t=["alignleft","aligncenter","alignright","alignjustify"],r="alignleft",e=[{text:"Left",icon:"alignleft",onclick:Ri(i,"alignleft")},{text:"Center",icon:"aligncenter",onclick:Ri(i,"aligncenter")},{text:"Right",icon:"alignright",onclick:Ri(i,"alignright")},{text:"Justify",icon:"alignjustify&qu
ot;,onclick:Ri(i,"alignjustify")}];i.addMenuItem("align",{text:"Align",menu:e}),i.addButton("align",{type:"menubutton",icon:r,menu:e,onShowMenu:function(e){var n=e.control.menu;w.each(t,function(t,e){n.items().eq(e).each(function(e){return e.active(i.formatter.match(t))})})},onPostRender:function(e){var n=e.control;w.each(t,function(t,e){Ci(i,t,function(e){n.icon(r),e&&n.icon(t)})})}}),w.each({alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"],alignnone:["No alignment","JustifyNone"]},function(e,t){i.addButton(t,{active:!1,tooltip:e[0],cmd:e[1],onPostRender:Ei(i,t)})})},Hi=function(e){return e?e.split(",")[0]:""},Si=function(l,u){return function(){var a=this;a.state.set("value",null),l.
on("init nodeChange",function(e){var t,n,i,r,o=l.queryCommandValue("FontName"),s=(t=u,r=(n=o)?n.toLowerCase():"",w.each(t,function(e){e.value.toLowerCase()===r&&(i=e.value)}),w.each(t,function(e){i||Hi(e.value).toLowerCase()!==Hi(r).toLowerCase()||(i=e.value)}),i);a.value(s||null),!s&&o&&a.text(Hi(o))})}},Ti=function(n){n.addButton("fontselect",function(){var e,t=(e=function(e){for(var t=(e=e.replace(/;$/,"").split(";")).length;t--;)e[t]=e[t].split("=");return e}(n.settings.font_formats||"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospa
ce;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"),w.map(e,function(e){return{text:{raw:e[0]},value:e[1],textStyle:-1===e[1].indexOf("dings")?"font-family:"+e[1]:""}}));return{type:"listbox",text:"Font Family",tooltip:"Font Family",values:t,fixedWidth:!0,onPostRender:Si(n,t),onselect:function(e){e.control.settings.value&&n.execCommand("FontName",!1,e.control.settings.value)}}})},Mi=function(e){Ti(e)},Ni=function(e,t){return/[0-9.]+px$/.test(e)?(n=72*parseInt(e,10)/96,i=t||0,r=Math.pow(10,i),Math.round(n*r)/r+"pt"):e;var n,i,r},Pi=function(e,t,n){var i;return w.each(e,function(e){e.value===n?i=n:e.value===t&&(i=t)}),i},Wi=function(n){n.addButton("fontsizeselect",function(){var e,s,a,t=(e=n.settings.fontsize_formats||"8pt 10pt 12pt 14pt 18pt 24p
t 36pt",w.map(e.split(" "),function(e){var t=e,n=e,i=e.split("=");return 1<i.length&&(t=i[0],n=i[1]),{text:t,value:n}}));return{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:t,fixedWidth:!0,onPostRender:(s=n,a=t,function(){var o=this;s.on("init nodeChange",function(e){var t,n,i,r;if(t=s.queryCommandValue("FontSize"))for(i=3;!r&&0<=i;i--)n=Ni(t,i),r=Pi(a,n,t);o.value(r||null),r||o.text(n)})}),onclick:function(e){e.control.settings.value&&n.execCommand("FontSize",!1,e.control.settings.value)}}})},Di=function(e){Wi(e)},Oi=function(n,e){var i=e.length;return w.each(e,function(e){e.menu&&(e.hidden=0===Oi(n,e.menu));var t=e.format;t&&(e.hidden=!n.formatter.canApply(t)),e.hidden&&i--}),i},Ai=function(n,e){var i=e.items().length;return e.items().each(function(e){e.menu&&e.visible(0<Ai(n,e.menu)),!e.menu&&e.settings.menu&
amp;&e.visible(0<Oi(n,e.settings.menu));var t=e.settings.format;t&&e.visible(n.formatter.canApply(t)),e.visible()||i--}),i},Bi=function(e){var i,r,o,t,s,n,a,l,u=(r=0,o=[],t=[{title:"Headings",items:[{title:"Heading 1",format:"h1"},{title:"Heading 2",format:"h2"},{title:"Heading 3",format:"h3"},{title:"Heading 4",format:"h4"},{title:"Heading 5",format:"h5"},{title:"Heading 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{t
itle:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}],s=function(e){var i=[];if(e)return w.each(e,function(e){var t={text:e.title,icon:e.icon};if(e.items)t.menu=s(e.items);else{var n=e.format||"custom"+r++;e.format||(e.name=n,o.push(e)),t.format=n,t.cmd=e.cmd}i.
push(t)}),i},(i=e).on("init",function(){w.each(o,function(e){i.formatter.register(e.name,e)})}),{type:"menu",items:i.settings.style_formats_merge?i.settings.style_formats?s(t.concat(i.settings.style_formats)):s(t):s(i.settings.style_formats||t),onPostRender:function(e){i.fire("renderFormatsMenu",{control:e.control})},itemDefaults:{preview:!0,textStyle:function(){if(this.settings.format)return i.formatter.getCssText(this.settings.format)},onPostRender:function(){var n=this;n.parent().on("show",function(){var e,t;(e=n.settings.format)&&(n.disabled(!i.formatter.canApply(e)),n.active(i.formatter.match(e))),(t=n.settings.cmd)&&n.active(i.queryCommandState(t))})},onclick:function(){this.settings.format&&Ri(i,this.settings.format)(),this.settings.cmd&&i.execCommand(this.settings.cmd)}}});n=u,e.addMenuItem("formats",{text:"Formats",menu:n}),l=u,(a=e).addButton("styleselect",{type:"menu
button",text:"Formats",menu:l,onShowMenu:function(){a.settings.style_formats_autohide&&Ai(a,this.menu)}})},Li=function(n,e){return function(){var r,o,s,t=[];return w.each(e,function(e){t.push({text:e[0],value:e[1],textStyle:function(){return n.formatter.getCssText(e[1])}})}),{type:"listbox",text:e[0][0],values:t,fixedWidth:!0,onselect:function(e){if(e.control){var t=e.control.value();Ri(n,t)()}},onPostRender:(r=n,o=t,function(){var t=this;r.on("nodeChange",function(e){var n=r.formatter,i=null;w.each(e.parents,function(t){if(w.each(o,function(e){if(s?n.matchNode(t,s,{value:e.value})&&(i=e.value):n.matchNode(t,e.value)&&(i=e.value),i)return!1}),i)return!1}),t.value(i)})})}}},zi=function(e){var t,n,i=function(e){for(var t=(e=e.replace(/;$/,"").split(";")).length;t--;)e[t]=e[t].split("=");return e}(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Headin
g 5=h5;Heading 6=h6;Preformatted=pre");e.addMenuItem("blockformats",{text:"Blocks",menu:(t=e,n=i,w.map(n,function(e){return{text:e[0],onclick:Ri(t,e[1]),textStyle:function(){return t.formatter.getCssText(e[1])}}}))}),e.addButton("formatselect",Li(e,i))},Ii=function(t,e){var n,i;if("string"==typeof e)i=e.split(" ");else if(w.isArray(e))return function(e){for(var t=[],n=0,i=e.length;n<i;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);ee.apply(t,e[n])}return t}(w.map(e,function(e){return Ii(t,e)}));return n=w.grep(i,function(e){return"|"===e||e in t.menuItems}),w.map(n,function(e){return"|"===e?{text:"-"}:t.menuItems[e]})},Fi=function(e){return e&&"-"===e.text},Ui=function(e){var t=K(e,function(e,t,n){return!Fi(e)||!Fi(n[t-1])});return K(t,function(e,t,n){return!Fi(e)||0<t&&t<n.leng
th-1})},Vi=function(e){var t,n,i,r,o=e.settings.insert_button_items;return Ui(o?Ii(e,o):(t=e,n="insert",i=[{text:"-"}],r=w.grep(t.menuItems,function(e){return e.context===n}),w.each(r,function(e){"before"===e.separator&&i.push({text:"|"}),e.prependToContext?i.unshift(e):i.push(e),"after"===e.separator&&i.push({text:"|"})}),i))},Yi=function(e){var t;(t=e).addButton("insert",{type:"menubutton",icon:"insert",menu:[],oncreatemenu:function(){this.menu.add(Vi(t)),this.menu.renderNew()}})},$i=function(e){var n,i,r;n=e,w.each({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(e,t){n.addButton(t,{active:!1,tooltip:e,onPostRender:Ei(n,t),onclick:Ri(n,t)})}),i=e,w.each({outdent:["Decrease indent","Outdent"],indent:["Inc
rease indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"],removeformat:["Clear formatting","RemoveFormat"],remove:["Remove","Delete"]},function(e,t){i.addButton(t,{tooltip:e[0],cmd:e[1]})}),r=e,w.each({blockquote:["Blockquote","mceBlockQuote"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"]},function(e,t){r.addButton(t,{active:!1,tooltip:e[0],cmd:e[1],onPostRender:Ei(r,t)})})},qi=function(e){var n;$i(e),n=e,w.each({bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic",&quo
t;Meta+I"],underline:["Underline","Underline","Meta+U"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"],newdocument:["New document","mceNewDocument"],cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"]},function(e,t){n.addMenuItem(t,{text:e[0],icon:t,shortcut:e[2],cmd:e[1]})}),n.addMenuItem("codeformat",{text:"Code",icon:"code",onclick:Ri(n,"code")})},Xi=function(n,i){return function(){var e=this,t=function(){var e="redo"===i?"hasRedo":"hasUndo";return!!n.u
ndoManager&&n.undoManager[e]()};e.disabled(!t()),n.on("Undo Redo AddUndo TypingUndo ClearUndos SwitchMode",function(){e.disabled(n.readonly||!t())})}},ji=function(e){var t,n;(t=e).addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:Xi(t,"undo"),cmd:"undo"}),t.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:Xi(t,"redo"),cmd:"redo"}),(n=e).addButton("undo",{tooltip:"Undo",onPostRender:Xi(n,"undo"),cmd:"undo"}),n.addButton("redo",{tooltip:"Redo",onPostRender:Xi(n,"redo"),cmd:"redo"})},Ji=function(e){var t,n;(t=e).addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:(n=t,function(){var t=this;n.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(n.hasVisual)}),cmd:&quo
t;mceToggleVisualAid"})},Gi={setup:function(e){var t;e.rtl&&(ot.rtl=!0),e.on("mousedown progressstate",function(){Et.hideAll()}),(t=e).settings.ui_container&&(de.container=_i(pn.fromDom(document.body),t.settings.ui_container).fold(k(null),function(e){return e.dom()})),Pt.tooltips=!de.iOS,ot.translate=function(e){return h.translate(e)},zi(e),ki(e),qi(e),ji(e),Di(e),Mi(e),Bi(e),Ji(e),Yi(e)}},Ki=jt.extend({recalc:function(e){var t,n,i,r,o,s,a,l,u,c,d,f,h,m,g,p,v,b,y,x,w,_,R,C,E,k,H,S,T=[],M=[];t=e.settings,r=e.items().filter(":visible"),o=e.layoutRect(),i=t.columns||Math.ceil(Math.sqrt(r.length)),n=Math.ceil(r.length/i),b=t.spacingH||t.spacing||0,y=t.spacingV||t.spacing||0,x=t.alignH||t.align,w=t.alignV||t.align,p=e.paddingBox,S="reverseRows"in t?t.reverseRows:e.isRtl(),x&&"string"==typeof x&&(x=[x]),w&&"string"==typeof w&&(w=[w]);for(d=0;d<i;d++)T.push(0);for(f=0;f<n;f++)M.push
(0);for(f=0;f<n;f++)for(d=0;d<i&&(c=r[f*i+d]);d++)C=(u=c.layoutRect()).minW,E=u.minH,T[d]=C>T[d]?C:T[d],M[f]=E>M[f]?E:M[f];for(k=o.innerW-p.left-p.right,d=_=0;d<i;d++)_+=T[d]+(0<d?b:0),k-=(0<d?b:0)+T[d];for(H=o.innerH-p.top-p.bottom,f=R=0;f<n;f++)R+=M[f]+(0<f?y:0),H-=(0<f?y:0)+M[f];if(_+=p.left+p.right,R+=p.top+p.bottom,(l={}).minW=_+(o.w-o.innerW),l.minH=R+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW===o.minW&&l.minH===o.minH){var N;o.autoResize&&((l=e.layoutRect(l)).contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH),N="start"===t.packV?0:0<H?Math.floor(H/n):0;var P=0,W=t.flexWidths;if(W)for(d=0;d<W.length;d++)P+=W[d];else P=i;var D=k/P;for(d=0;d<i;d++)T[d]+=W?W[d]*D:D;for(m=p.top,f=0;f<n;f++){for(h=p.left,a=M[f]+N,d=0;
d<i&&(c=r[S?f*i+i-1-d:f*i+d]);d++)g=c.settings,u=c.layoutRect(),s=Math.max(T[d],u.startMinWidth),u.x=h,u.y=m,"center"===(v=g.alignH||(x?x[d]||x[0]:null))?u.x=h+s/2-u.w/2:"right"===v?u.x=h+s-u.w:"stretch"===v&&(u.w=s),"center"===(v=g.alignV||(w?w[d]||w[0]:null))?u.y=m+a/2-u.h/2:"bottom"===v?u.y=m+a-u.h:"stretch"===v&&(u.h=a),c.layoutRect(u),h+=s+b,c.recalc&&c.recalc();m+=a+y}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var O=e.parent();O&&(O._lastRect=null,O.recalc())}}}),Zi=Pt.extend({renderHtml:function(){var e=this;return e.classes.add("iframe"),e.canFocus=!1,'<iframe id="'+e._id+'" class="'+e.classes+'" tabindex="-1" src="'+(e.settings.url||"javascript:''")+'" frameborder="0"></iframe>'},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,i=this.ge
tEl().contentWindow.document.body;return i?(i.innerHTML=e,t&&t()):u.setTimeout(function(){n.html(e)}),this}}),Qi=Pt.extend({init:function(e){this._super(e),this.classes.add("widget").add("infobox"),this.canFocus=!1},severity:function(e){this.classes.remove("error"),this.classes.remove("warning"),this.classes.remove("success"),this.classes.add(e)},help:function(e){this.state.set("help",e)},renderHtml:function(){var e=this,t=e.classPrefix;return'<div id="'+e._id+'" class="'+e.classes+'"><div id="'+e._id+'-body">'+e.encode(e.state.get("text"))+'<button role="button" tabindex="-1"><i class="'+t+"ico "+t+'i-help"></i></button></div></div>'},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.getEl("body").firstChild.data=t.encode(e.value),t.state.ge
t("rendered")&&t.updateLayoutRect()}),t.state.on("change:help",function(e){t.classes.toggle("has-help",e.value),t.state.get("rendered")&&t.updateLayoutRect()}),t._super()}}),er=Pt.extend({init:function(e){var t=this;t._super(e),t.classes.add("widget").add("label"),t.canFocus=!1,e.multiline&&t.classes.add("autoscroll"),e.strong&&t.classes.add("strong")},initLayoutRect:function(){var e=this,t=e._super();return e.settings.multiline&&(_e.getSize(e.getEl()).width>t.maxW&&(t.minW=t.maxW,e.classes.add("multiline")),e.getEl().style.width=t.minW+"px",t.startMinH=t.h=t.minH=Math.min(t.maxH,_e.getSize(e.getEl()).height)),t},repaint:function(){return this.settings.multiline||(this.getEl().style.lineHeight=this.layoutRect().h+"px"),this._super()},severity:function(e){this.classes.remove("error"),this.classes.remove("warnin
g"),this.classes.remove("success"),this.classes.add(e)},renderHtml:function(){var e,t,n=this,i=n.settings.forId,r=n.settings.html?n.settings.html:n.encode(n.state.get("text"));return!i&&(t=n.settings.forName)&&(e=n.getRoot().find("#"+t)[0])&&(i=e._id),i?'<label id="'+n._id+'" class="'+n.classes+'"'+(i?' for="'+i+'"':"")+">"+r+"</label>":'<span id="'+n._id+'" class="'+n.classes+'">'+r+"</span>"},bindStates:function(){var t=this;return t.state.on("change:text",function(e){t.innerHtml(t.encode(e.value)),t.state.get("rendered")&&t.updateLayoutRect()}),t._super()}}),tr=ut.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){this._super(e),this.classes.add("toolbar")},postRender:function(){return this.items().each(function(e){e.classes.add("tool
bar-item")}),this._super()}}),nr=tr.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}}),ir=Jt.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),e=t.settings,t.classes.add("menubtn"),e.fixedWidth&&t.classes.add("fixed-width"),t.aria("haspopup",!0),t.state.set("menu",e.menu||t.render())},showMenu:function(e){var t,n=this;if(n.menu&&n.menu.visible()&&!1!==e)return n.hideMenu();n.menu||(t=n.state.get("menu")||[],n.classes.add("opened"),t.length?t={type:"menu",animate:!0,items:t}:(t.type=t.type||"menu",t.animate=!0),t.renderTo?n.menu=t.parent(n).show().renderTo():n.menu=b.create(t).parent(n).renderTo(),n.fire("createmenu"),n.menu.reflow(),n.menu.on("cancel",function(e){e.control.parent()===n.menu&&(e.stopPropagation(),n.focus(),n.hideMenu())}),n.menu.on("se
lect",function(){n.focus()}),n.menu.on("show hide",function(e){"hide"===e.type&&e.control.parent()===n&&n.classes.remove("opened-under"),e.control===n.menu&&(n.activeMenu("show"===e.type),n.classes.toggle("opened","show"===e.type)),n.aria("expanded","show"===e.type)}).fire("show")),n.menu.show(),n.menu.layoutRect({w:n.layoutRect().w}),n.menu.repaint(),n.menu.moveRel(n.getEl(),n.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]);var i=n.menu.layoutRect(),r=n.$el.offset().top+n.layoutRect().h;r>i.y&&r<i.y+i.h&&n.classes.add("opened-under"),n.fire("showmenu")},hideMenu:function(){this.menu&&(this.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),this.menu.hide())},activeMenu:function(e){this.classes.toggle("active",e)},renderHtml:function(){var e,t=this,n=t._id,
i=t.classPrefix,r=t.settings.icon,o=t.state.get("text"),s="";return(e=t.settings.image)?(r="none","string"!=typeof e&&(e=window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",o&&(t.classes.add("btn-has-text"),s='<span class="'+i+'txt">'+t.encode(o)+"</span>"),r=t.settings.icon?i+"ico "+i+"i-"+r:"",t.aria("role",t.parent()instanceof nr?"menuitem":"button"),'<div id="'+n+'" class="'+t.classes+'" tabindex="-1" aria-labelledby="'+n+'"><button id="'+n+'-open" role="presentation" type="button" tabindex="-1">'+(r?'<i class="'+r+'"'+e+"></i>":"")+s+' <i class="'+i+'caret"></i></button></div>'},postRende
r:function(){var r=this;return r.on("click",function(e){e.control===r&&function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}(e.target,r.getEl())&&(r.focus(),r.showMenu(!e.aria),e.aria&&r.menu.items().filter(":visible")[0].focus())}),r.on("mouseenter",function(e){var t,n=e.control,i=r.parent();n&&i&&n instanceof ir&&n.parent()===i&&(i.items().filter("MenuButton").each(function(e){e.hideMenu&&e!==n&&(e.menu&&e.menu.visible()&&(t=!0),e.hideMenu())}),t&&(n.focus(),n.showMenu()))}),r._super()},bindStates:function(){var e=this;return e.state.on("change:menu",function(){e.menu&&e.menu.remove(),e.menu=null}),e._super()},remove:function(){this._super(),this.menu&&this.menu.remove()}}),rr=Et.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"men
u",ariaRoot:!0},init:function(e){if(e.autohide=!0,e.constrainToViewport=!0,"function"==typeof e.items&&(e.itemsFactory=e.items,e.items=[]),e.itemDefaults)for(var t=e.items,n=t.length;n--;)t[n]=w.extend({},e.itemDefaults,t[n]);this._super(e),this.classes.add("menu"),e.animate&&11!==de.ie&&this.classes.add("animate")},repaint:function(){return this.classes.toggle("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){this.hideAll(),this.fire("select")},load:function(){var t,n=this;function i(){n.throbber&&(n.throbber.hide(),n.throbber=null)}n.settings.itemsFactory&&(n.throbber||(n.throbber=new St(n.getEl("body"),!0),0===n.items().length?(n.throbber.show(),n.fire("loading")):n.throbber.show(100,function(){n.items().remove(),n.fire("loading")}),n.on("hide close"
,i)),n.requestTime=t=(new Date).getTime(),n.settings.itemsFactory(function(e){0!==e.length?n.requestTime===t&&(n.getEl().style.width="",n.getEl("body").style.width="",i(),n.items().remove(),n.getEl("body").innerHTML="",n.add(e),n.renderNew(),n.fire("loaded")):n.hide()}))},hideAll:function(){return this.find("menuitem").exec("hideMenu"),this._super()},preRender:function(){var n=this;return n.items().each(function(e){var t=e.settings;if(t.icon||t.image||t.selectable)return!(n._hasIcons=!0)}),n.settings.itemsFactory&&n.on("postrender",function(){n.settings.itemsFactory&&n.load()}),n.on("show hide",function(e){e.control===n&&("show"===e.type?u.setTimeout(function(){n.classes.add("in")},0):n.classes.remove("in"))}),n._super()}}),or=ir.extend({init:function(i){var t,r,o,n,s=this;s._super(i),i=s.settings,s._values=t=i.values,t&
;&("undefined"!=typeof i.value&&function e(t){for(var n=0;n<t.length;n++){if(r=t[n].selected||i.value===t[n].value)return o=o||t[n].text,s.state.set("value",t[n].value),!0;if(t[n].menu&&e(t[n].menu))return!0}}(t),!r&&0<t.length&&(o=t[0].text,s.state.set("value",t[0].value)),s.state.set("menu",t)),s.state.set("text",i.text||o),s.classes.add("listbox"),s.on("select",function(e){var t=e.control;n&&(e.lastControl=n),i.multiple?t.active(!t.active()):s.value(e.control.value()),n=t})},value:function(n){return 0===arguments.length?this.state.get("value"):(void 0===n||(this.settings.values&&!function t(e){return j(e,function(e){return e.menu?t(e.menu):e.value===n})}(this.settings.values)?null===n&&this.state.set("value",null):this.state.set("value",n)),this)},bindStates:function(){var i=this;return i.on("show",function
(e){var t,n;t=e.control,n=i.value(),t instanceof rr&&t.items().each(function(e){e.hasMenus()||e.active(e.value()===n)})}),i.state.on("change:value",function(t){var n=function e(t,n){var i;if(t)for(var r=0;r<t.length;r++){if(t[r].value===n)return t[r];if(t[r].menu&&(i=e(t[r].menu,n)))return i}}(i.state.get("menu"),t.value);n?i.text(n.text):i.text(i.settings.text)}),i._super()}}),sr=Pt.extend({Defaults:{border:0,role:"menuitem"},init:function(e){var t,n=this;n._super(e),e=n.settings,n.classes.add("menu-item"),e.menu&&n.classes.add("menu-item-expand"),e.preview&&n.classes.add("menu-item-preview"),"-"!==(t=n.state.get("text"))&&"|"!==t||(n.classes.add("menu-item-sep"),n.aria("role","separator"),n.state.set("text","-")),e.selectable&&(n.aria("role","menuitemcheckbox"),n.classes.ad
d("menu-item-checkbox"),e.icon="selected"),e.preview||e.selectable||n.classes.add("menu-item-normal"),n.on("mousedown",function(e){e.preventDefault()}),e.menu&&!e.ariaHideMenu&&n.aria("haspopup",!0)},hasMenus:function(){return!!this.settings.menu},showMenu:function(){var t,n=this,e=n.settings,i=n.parent();if(i.items().each(function(e){e!==n&&e.hideMenu()}),e.menu){(t=n.menu)?t.show():((t=e.menu).length?t={type:"menu",items:t}:t.type=t.type||"menu",i.settings.itemDefaults&&(t.itemDefaults=i.settings.itemDefaults),(t=n.menu=b.create(t).parent(n).renderTo()).reflow(),t.on("cancel",function(e){e.stopPropagation(),n.focus(),t.hide()}),t.on("show hide",function(e){e.control.items&&e.control.items().each(function(e){e.active(e.settings.selected)})}).fire("show"),t.on("hide",function(e){e.control===t&&n.classes.remove("selected&qu
ot;)}),t.submenu=!0),t._parentMenu=i,t.classes.add("menu-sub");var r=t.testMoveRel(n.getEl(),n.isRtl()?["tl-tr","bl-br","tr-tl","br-bl"]:["tr-tl","br-bl","tl-tr","bl-br"]);t.moveRel(n.getEl(),r),r="menu-sub-"+(t.rel=r),t.classes.remove(t._lastRel).add(r),t._lastRel=r,n.classes.add("selected"),n.aria("expanded",!0)}},hideMenu:function(){var e=this;return e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide(),e.aria("expanded",!1)),e},renderHtml:function(){var e,t=this,n=t._id,i=t.settings,r=t.classPrefix,o=t.state.get("text"),s=t.settings.icon,a="",l=i.shortcut,u=t.encode(i.url);function c(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function d(e){var t=i.match||"";return t?e.replace(new RegExp(c(t),"gi"),function(e){return"!mce~match["+e+"]
mce~match!"}):e}function f(e){return e.replace(new RegExp(c("!mce~match["),"g"),"<b>").replace(new RegExp(c("]mce~match!"),"g"),"</b>")}return s&&t.parent().classes.add("menu-has-icons"),i.image&&(a=" style=\"background-image: url('"+i.image+"')\""),l&&(l=function(e){var t,n,i={};for(i=de.mac?{alt:"⌥",ctrl:"⌘",shift:"⇧",meta:"⌘"}:{meta:"Ctrl"},e=e.split("+"),t=0;t<e.length;t++)(n=i[e[t].toLowerCase()])&&(e[t]=n);return e.join("+")}(l)),s=r+"ico "+r+"i-"+(t.settings.icon||"none"),e="-"!==o?'<i class="'+s+'"'+a+"></i>\xa0":"",o=f(t.encode(d(o))),u=f(t.encode(d(u))),'<div id="'+n+'" class="'+t.classes+'" tabindex="-1
">'+e+("-"!==o?'<span id="'+n+'-text" class="'+r+'text">'+o+"</span>":"")+(l?'<div id="'+n+'-shortcut" class="'+r+'menu-shortcut">'+l+"</div>":"")+(i.menu?'<div class="'+r+'caret"></div>':"")+(u?'<div class="'+r+'menu-item-link">'+u+"</div>":"")+"</div>"},postRender:function(){var t=this,n=t.settings,e=n.textStyle;if("function"==typeof e&&(e=e.call(this)),e){var i=t.getEl("text");i&&(i.setAttribute("style",e),t._textStyle=e)}return t.on("mouseenter click",function(e){e.control===t&&(n.menu||"click"!==e.type?(t.showMenu(),e.aria&&t.menu.focus(!0)):(t.fire("select"),u.requestAnimationFrame(function(){t.parent().hideAll()})))}),t._super(),t},hover:function(){return this.parent().items().
each(function(e){e.classes.remove("selected")}),this.classes.toggle("selected",!0),this},active:function(e){return function(e,t){var n=e._textStyle;if(n){var i=e.getEl("text");i.setAttribute("style",n),t&&(i.style.color="",i.style.backgroundColor="")}}(this,e),void 0!==e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}}),ar=Zt.extend({Defaults:{classes:"radio",role:"radio"}}),lr=Pt.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.classes.add("resizehandle"),"both"===e.settings.direction&&e.classes.add("resizehandle-both"),e.canFocus=!1,'<div id="'+e._id+'" class="'+e.classes+'"><i class="'+t+"ico "+t+'i-resize"></i></div>'},postRender:function(){var t=this;t._super(),t.resizeDragHelper=new dt(this._id
,{start:function(){t.fire("ResizeStart")},drag:function(e){"both"!==t.settings.direction&&(e.deltaX=0),t.fire("Resize",e)},stop:function(){t.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}});function ur(e){var t="";if(e)for(var n=0;n<e.length;n++)t+='<option value="'+e[n]+'">'+e[n]+"</option>";return t}var cr=Pt.extend({Defaults:{classes:"selectbox",role:"selectbox",options:[]},init:function(e){var n=this;n._super(e),n.settings.size&&(n.size=n.settings.size),n.settings.options&&(n._options=n.settings.options),n.on("keydown",function(e){var t;13===e.keyCode&&(e.preventDefault(),n.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),n.fire("submit",{data:t.toJSON()}))})},options:function(e){return arguments.length?(this.state.set("options
",e),this):this.state.get("options")},renderHtml:function(){var e,t=this,n="";return e=ur(t._options),t.size&&(n=' size = "'+t.size+'"'),'<select id="'+t._id+'" class="'+t.classes+'"'+n+">"+e+"</select>"},bindStates:function(){var t=this;return t.state.on("change:options",function(e){t.getEl().innerHTML=ur(e.value)}),t._super()}});function dr(e,t,n){return e<t&&(e=t),n<e&&(e=n),e}function fr(e,t,n){e.setAttribute("aria-"+t,n)}function hr(e,t){var n,i,r,o,s;"v"===e.settings.orientation?(r="top",i="height",n="h"):(r="left",i="width",n="w"),s=e.getEl("handle"),o=((e.layoutRect()[n]||100)-_e.getSize(s)[i])*((t-e._minValue)/(e._maxValue-e._minValue))+"px",s.style[r]=o,s.style.height=e.layoutRect().h+"px",fr(s,"valuenow",t),fr(s,"valuetext&q
uot;,""+e.settings.previewFilter(t)),fr(s,"valuemin",e._minValue),fr(s,"valuemax",e._maxValue)}var mr=Pt.extend({init:function(e){var t=this;e.previewFilter||(e.previewFilter=function(e){return Math.round(100*e)/100}),t._super(e),t.classes.add("slider"),"v"===e.orientation&&t.classes.add("vertical"),t._minValue=q(e.minValue)?e.minValue:0,t._maxValue=q(e.maxValue)?e.maxValue:100,t._initValue=t.state.get("value")},renderHtml:function(){var e=this._id,t=this.classPrefix;return'<div id="'+e+'" class="'+this.classes+'"><div id="'+e+'-handle" class="'+t+'slider-handle" role="slider" tabindex="-1"></div></div>'},reset:function(){this.value(this._initValue).repaint()},postRender:function(){var e,t,n,i,r,o,s,a,l,u,c,d,f,h,m=this;e=m._minValue,t=m._maxValue,"v"===m.settings.orientation?(n="screenY",i="top&quo
t;,r="height",o="h"):(n="screenX",i="left",r="width",o="w"),m._super(),function(o,s){function t(e){var t,n,i,r;t=dr(t=(((t=m.value())+(r=n=o))/((i=s)-r)+.05*e)*(i-n)-n,o,s),m.value(t),m.fire("dragstart",{value:t}),m.fire("drag",{value:t}),m.fire("dragend",{value:t})}m.on("keydown",function(e){switch(e.keyCode){case 37:case 38:t(-1);break;case 39:case 40:t(1)}})}(e,t),s=e,a=t,l=m.getEl("handle"),m._dragHelper=new dt(m._id,{handle:m._id+"-handle",start:function(e){u=e[n],c=parseInt(m.getEl("handle").style[i],10),d=(m.layoutRect()[o]||100)-_e.getSize(l)[r],m.fire("dragstart",{value:h})},drag:function(e){var t=e[n]-u;f=dr(c+t,0,d),l.style[i]=f+"px",h=s+f/d*(a-s),m.value(h),m.tooltip().text(""+m.settings.previewFilter(h)).show().moveRel(l,"bc tc"),m.fire("drag",{value:h})},stop:function(){m.tooltip().hide(),m.f
ire("dragend",{value:h})}})},repaint:function(){this._super(),hr(this,this.value())},bindStates:function(){var t=this;return t.state.on("change:value",function(e){hr(t,e.value)}),t._super()}}),gr=Pt.extend({renderHtml:function(){return this.classes.add("spacer"),this.canFocus=!1,'<div id="'+this._id+'" class="'+this.classes+'"></div>'}}),pr=ir.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e,t,n=this.getEl(),i=this.layoutRect();return this._super(),e=n.firstChild,t=n.lastChild,xe(e).css({width:i.w-_e.getSize(t).width,height:i.h-2}),xe(t).css({height:i.h-2}),this},activeMenu:function(e){xe(this.getEl().lastChild).toggleClass(this.classPrefix+"active",e)},renderHtml:function(){var e,t,n=this,i=n._id,r=n.classPrefix,o=n.state.get("icon"),s=n.state.get("text"),a=n.settings,l="";return(e=a.image)?(o="none","string&
quot;!=typeof e&&(e=window.getSelection?e[0]:e[1]),e=" style=\"background-image: url('"+e+"')\""):e="",o=a.icon?r+"ico "+r+"i-"+o:"",s&&(n.classes.add("btn-has-text"),l='<span class="'+r+'txt">'+n.encode(s)+"</span>"),t="boolean"==typeof a.active?' aria-pressed="'+a.active+'"':"",'<div id="'+i+'" class="'+n.classes+'" role="button"'+t+' tabindex="-1"><button type="button" hidefocus="1" tabindex="-1">'+(o?'<i class="'+o+'"'+e+"></i>":"")+l+'</button><button type="button" class="'+r+'open" hidefocus="1" tabindex="-1">'+(n._menuBtnText?(o?"\xa0":"")+n._menuBtnText:"")+' <i class="'+r+'caret"></i></button
></div>'},postRender:function(){var n=this.settings.onclick;return this.on("click",function(e){var t=e.target;if(e.control===this)for(;t;){if(e.aria&&"down"!==e.aria.key||"BUTTON"===t.nodeName&&-1===t.className.indexOf("open"))return e.stopImmediatePropagation(),void(n&&n.call(this,e));t=t.parentNode}}),delete this.settings.onclick,this._super()}}),vr=wi.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"},isNative:function(){return!0}}),br=vt.extend({Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(n){var e;this.activeTabId&&(e=this.getEl(this.activeTabId),xe(e).removeClass(this.classPrefix+"active"),e.setAttribute("aria-selected","false")),this.activeTabId="t"+n,(e=this.getEl("t"+n)).setAttribute("aria-selected","true&
quot;),xe(e).addClass(this.classPrefix+"active"),this.items()[n].show().fire("showtab"),this.reflow(),this.items().each(function(e,t){n!==t&&e.hide()})},renderHtml:function(){var i=this,e=i._layout,r="",o=i.classPrefix;return i.preRender(),e.preRender(i),i.items().each(function(e,t){var n=i._id+"-t"+t;e.aria("role","tabpanel"),e.aria("labelledby",n),r+='<div id="'+n+'" class="'+o+'tab" unselectable="on" role="tab" aria-controls="'+e._id+'" aria-selected="false" tabIndex="-1">'+i.encode(e.settings.title)+"</div>"}),'<div id="'+i._id+'" class="'+i.classes+'" hidefocus="1" tabindex="-1"><div id="'+i._id+'-head" class="'+o+'tabs" role="tablist">'+r+'</div><div id="'+i._id+'-body" class="'+i.bodyClasses+'">'+
e.renderHtml(i)+"</div></div>"},postRender:function(){var i=this;i._super(),i.settings.activeTab=i.settings.activeTab||0,i.activateTab(i.settings.activeTab),this.on("click",function(e){var t=e.target.parentNode;if(t&&t.id===i._id+"-head")for(var n=t.childNodes.length;n--;)t.childNodes[n]===e.target&&i.activateTab(n)})},initLayoutRect:function(){var e,t,n,i=this;t=(t=_e.getSize(i.getEl("head")).width)<0?0:t,n=0,i.items().each(function(e){t=Math.max(t,e.layoutRect().minW),n=Math.max(n,e.layoutRect().minH)}),i.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=t,e.settings.h=n,e.layoutRect({x:0,y:0,w:t,h:n})});var r=_e.getSize(i.getEl("head")).height;return i.settings.minWidth=t,i.settings.minHeight=n+r,(e=i._super()).deltaH+=r,e.innerH=e.h-e.deltaH,e}}),yr=Pt.extend({init:function(e){var n=this;n._super(e),n.classes.add("textbox"),e.multiline?n.classes.add("multiline")
:(n.on("keydown",function(e){var t;13===e.keyCode&&(e.preventDefault(),n.parents().reverse().each(function(e){if(e.toJSON)return t=e,!1}),n.fire("submit",{data:t.toJSON()}))}),n.on("keyup",function(e){n.state.set("value",e.target.value)}))},repaint:function(){var e,t,n,i,r,o=this,s=0;e=o.getEl().style,t=o._layoutRect,r=o._lastRepaintRect||{};var a=document;return!o.settings.multiline&&a.all&&(!a.documentMode||a.documentMode<=8)&&(e.lineHeight=t.h-s+"px"),i=(n=o.borderBox).left+n.right+8,s=n.top+n.bottom+(o.settings.multiline?8:0),t.x!==r.x&&(e.left=t.x+"px",r.x=t.x),t.y!==r.y&&(e.top=t.y+"px",r.y=t.y),t.w!==r.w&&(e.width=t.w-i+"px",r.w=t.w),t.h!==r.h&&(e.height=t.h-s+"px",r.h=t.h),o._lastRepaintRect=r,o.fire("repaint",{},!1),o},renderHtml:function(){var t,e,n=this,i=n.settings;return t={id:n._id,hidefocus:"1"
},w.each(["rows","spellcheck","maxLength","size","readonly","min","max","step","list","pattern","placeholder","required","multiple"],function(e){t[e]=i[e]}),n.disabled()&&(t.disabled="disabled"),i.subtype&&(t.type=i.subtype),(e=_e.create(i.multiline?"textarea":"input",t)).value=n.state.get("value"),e.className=n.classes.toString(),e.outerHTML},value:function(e){return arguments.length?(this.state.set("value",e),this):(this.state.get("rendered")&&this.state.set("value",this.getEl().value),this.state.get("value"))},postRender:function(){var t=this;t.getEl().value=t.state.get("value"),t._super(),t.$el.on("change",function(e){t.state.set("value",e.target.value),t.fire("change",e)})},bindStates:function(){var t=this;re
turn t.state.on("change:value",function(e){t.getEl().value!==e.value&&(t.getEl().value=e.value)}),t.state.on("change:disabled",function(e){t.getEl().disabled=e.value}),t._super()},remove:function(){this.$el.off(),this._super()}}),xr=function(){return{Selector:Fe,Collection:Ye,ReflowQueue:Ze,Control:ot,Factory:b,KeyboardNavigation:at,Container:ut,DragHelper:dt,Scrollable:pt,Panel:vt,Movable:Se,Resizable:bt,FloatPanel:Et,Window:Ft,MessageBox:$t,Tooltip:Nt,Widget:Pt,Progress:Wt,Notification:Ot,Layout:Xt,AbsoluteLayout:jt,Button:Jt,ButtonGroup:Kt,Checkbox:Zt,ComboBox:en,ColorBox:tn,PanelButton:nn,ColorButton:on,ColorPicker:an,Path:un,ElementPath:cn,FormItem:dn,Form:fn,FieldSet:hn,FilePicker:bi,FitLayout:yi,FlexLayout:xi,FlowLayout:wi,FormatControls:Gi,GridLayout:Ki,Iframe:Zi,InfoBox:Qi,Label:er,Toolbar:tr,MenuBar:nr,MenuButton:ir,MenuItem:sr,Throbber:St,Menu:rr,ListBox:or,Radio:ar,ResizeHandle:lr,SelectBox:cr,Slider:mr,Spacer:gr,SplitButton:pr,StackLayout:vr,
TabPanel:br,TextBox:yr,DropZone:ln,BrowseButton:Gt}},wr=function(n){n.ui?w.each(xr(),function(e,t){n.ui[t]=e}):n.ui=xr()};w.each(xr(),function(e,t){b.add(t,e)}),wr(window.tinymce?window.tinymce:{}),o.add("modern",function(e){return Gi.setup(e),qt(e)})}();
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcjs_enqueuesvendortinymcetinymcejs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/tinymce.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/tinymce.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/tinymce.js 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,10623 +1,9566 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-// 4.8.0 (2018-06-27)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+// 4.9.2 (2018-12-17)
</ins><span class="cx" style="display: block; padding: 0 10px"> (function () {
</span><span class="cx" style="display: block; padding: 0 10px"> (function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'use strict';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'use strict';
</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 noop = function () {
- var x = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- x[_i] = arguments[_i];
- }
- };
-
- var compose = function (fa, fb) {
- return function () {
- var x = [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var noop = function () {
+ var args = [];
</ins><span class="cx" style="display: block; padding: 0 10px"> for (var _i = 0; _i < arguments.length; _i++) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- x[_i] = arguments[_i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ args[_i] = arguments[_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">- return fa(fb.apply(null, arguments));
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var constant = function (value) {
- return function () {
- return value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var compose = function (fa, fb) {
+ return function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ return fa(fb.apply(null, args));
+ };
</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 identity = function (x) {
- return x;
- };
-
- var curry = function (f) {
- var x = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- x[_i - 1] = arguments[_i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var constant = function (value) {
+ return function () {
+ return value;
+ };
+ };
+ var identity = function (x) {
+ return x;
+ };
+ function curry(fn) {
+ var initialArgs = [];
+ for (var _i = 1; _i < arguments.length; _i++) {
+ initialArgs[_i - 1] = arguments[_i];
+ }
+ return function () {
+ var restArgs = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ restArgs[_i] = arguments[_i];
+ }
+ var all = initialArgs.concat(restArgs);
+ return fn.apply(null, all);
+ };
</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 args = new Array(arguments.length - 1);
- for (var i = 1; i < arguments.length; i++)
- args[i - 1] = arguments[i];
- return function () {
- var x = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- x[_i] = arguments[_i];
- }
- var newArgs = new Array(arguments.length);
- for (var j = 0; j < newArgs.length; j++)
- newArgs[j] = arguments[j];
- var all = args.concat(newArgs);
- return f.apply(null, all);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var not = function (f) {
+ return function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ return !f.apply(null, args);
+ };
</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 die = function (msg) {
- return function () {
- throw new Error(msg);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var die = function (msg) {
+ return function () {
+ throw new Error(msg);
+ };
</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">+ var never = constant(false);
+ var always = constant(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">-
- var never = constant(false);
- var always = constant(true);
-
- var never$1 = never;
- var always$1 = always;
- var none = function () {
- return NONE;
- };
- var NONE = function () {
- var eq = function (o) {
- return o.isNone();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var never$1 = never;
+ var always$1 = always;
+ var none = function () {
+ return 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 call$$1 = function (thunk) {
- return thunk();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var NONE = function () {
+ var eq = function (o) {
+ return o.isNone();
+ };
+ var call$$1 = function (thunk) {
+ return thunk();
+ };
+ var id = function (n) {
+ return n;
+ };
+ var noop$$1 = function () {
+ };
+ var nul = function () {
+ return null;
+ };
+ var undef = function () {
+ return undefined;
+ };
+ var me = {
+ fold: function (n, s) {
+ return n();
+ },
+ is: never$1,
+ isSome: never$1,
+ isNone: always$1,
+ getOr: id,
+ getOrThunk: call$$1,
+ getOrDie: function (msg) {
+ throw new Error(msg || 'error: getOrDie called on none.');
+ },
+ getOrNull: nul,
+ getOrUndefined: undef,
+ or: id,
+ orThunk: call$$1,
+ map: none,
+ ap: none,
+ each: noop$$1,
+ bind: none,
+ flatten: none,
+ exists: never$1,
+ forall: always$1,
+ filter: none,
+ equals: eq,
+ equals_: eq,
+ toArray: function () {
+ return [];
+ },
+ toString: constant('none()')
+ };
+ if (Object.freeze)
+ Object.freeze(me);
+ return me;
+ }();
+ var some = function (a) {
+ var constant_a = function () {
+ return a;
+ };
+ var self = function () {
+ return me;
+ };
+ var map = function (f) {
+ return some(f(a));
+ };
+ var bind = function (f) {
+ return f(a);
+ };
+ var me = {
+ fold: function (n, s) {
+ return s(a);
+ },
+ is: function (v) {
+ return a === v;
+ },
+ isSome: always$1,
+ isNone: never$1,
+ getOr: constant_a,
+ getOrThunk: constant_a,
+ getOrDie: constant_a,
+ getOrNull: constant_a,
+ getOrUndefined: constant_a,
+ or: self,
+ orThunk: self,
+ map: map,
+ ap: function (optfab) {
+ return optfab.fold(none, function (fab) {
+ return some(fab(a));
+ });
+ },
+ each: function (f) {
+ f(a);
+ },
+ bind: bind,
+ flatten: constant_a,
+ exists: bind,
+ forall: bind,
+ filter: function (f) {
+ return f(a) ? me : NONE;
+ },
+ equals: function (o) {
+ return o.is(a);
+ },
+ equals_: function (o, elementEq) {
+ return o.fold(never$1, function (b) {
+ return elementEq(a, b);
+ });
+ },
+ toArray: function () {
+ return [a];
+ },
+ toString: function () {
+ return 'some(' + a + ')';
+ }
+ };
+ return me;
</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 id = function (n) {
- return n;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var from = function (value) {
+ return value === null || value === undefined ? NONE : some(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 noop$$1 = function () {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Option = {
+ some: some,
+ none: none,
+ from: from
</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 nul = function () {
- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var typeOf = function (x) {
+ if (x === null)
+ return 'null';
+ var t = typeof x;
+ if (t === 'object' && Array.prototype.isPrototypeOf(x))
+ return 'array';
+ if (t === 'object' && String.prototype.isPrototypeOf(x))
+ return 'string';
+ return t;
</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 undef = function () {
- return undefined;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isType = function (type) {
+ return function (value) {
+ return typeOf(value) === 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 me = {
- fold: function (n, s) {
- return n();
- },
- is: never$1,
- isSome: never$1,
- isNone: always$1,
- getOr: id,
- getOrThunk: call$$1,
- getOrDie: function (msg) {
- throw new Error(msg || 'error: getOrDie called on none.');
- },
- getOrNull: nul,
- getOrUndefined: undef,
- or: id,
- orThunk: call$$1,
- map: none,
- ap: none,
- each: noop$$1,
- bind: none,
- flatten: none,
- exists: never$1,
- forall: always$1,
- filter: none,
- equals: eq,
- equals_: eq,
- toArray: function () {
- return [];
- },
- toString: constant('none()')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isString = isType('string');
+ var isObject = isType('object');
+ var isArray = isType('array');
+ var isNull = isType('null');
+ var isBoolean = isType('boolean');
+ var isFunction = isType('function');
+ var isNumber = isType('number');
+
+ var rawIndexOf = function () {
+ var pIndexOf = Array.prototype.indexOf;
+ var fastIndex = function (xs, x) {
+ return pIndexOf.call(xs, x);
+ };
+ var slowIndex = function (xs, x) {
+ return slowIndexOf(xs, x);
+ };
+ return pIndexOf === undefined ? slowIndex : fastIndex;
+ }();
+ var indexOf = function (xs, x) {
+ var r = rawIndexOf(xs, x);
+ return r === -1 ? Option.none() : Option.some(r);
</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 (Object.freeze)
- Object.freeze(me);
- return me;
- }();
- var some = function (a) {
- var constant_a = function () {
- return a;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var contains = function (xs, x) {
+ return rawIndexOf(xs, x) > -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">- var self = function () {
- return me;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var exists = function (xs, pred) {
+ return findIndex(xs, pred).isSome();
</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 map = function (f) {
- return some(f(a));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var map = function (xs, f) {
+ var len = xs.length;
+ var r = new Array(len);
+ for (var i = 0; i < len; i++) {
+ var x = xs[i];
+ r[i] = f(x, i, xs);
+ }
+ return r;
</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 bind = function (f) {
- return f(a);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var each = function (xs, f) {
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ f(x, i, xs);
+ }
</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 me = {
- fold: function (n, s) {
- return s(a);
- },
- is: function (v) {
- return a === v;
- },
- isSome: always$1,
- isNone: never$1,
- getOr: constant_a,
- getOrThunk: constant_a,
- getOrDie: constant_a,
- getOrNull: constant_a,
- getOrUndefined: constant_a,
- or: self,
- orThunk: self,
- map: map,
- ap: function (optfab) {
- return optfab.fold(none, function (fab) {
- return some(fab(a));
- });
- },
- each: function (f) {
- f(a);
- },
- bind: bind,
- flatten: constant_a,
- exists: bind,
- forall: bind,
- filter: function (f) {
- return f(a) ? me : NONE;
- },
- equals: function (o) {
- return o.is(a);
- },
- equals_: function (o, elementEq) {
- return o.fold(never$1, function (b) {
- return elementEq(a, b);
- });
- },
- toArray: function () {
- return [a];
- },
- toString: function () {
- return 'some(' + a + ')';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var eachr = function (xs, f) {
+ for (var i = xs.length - 1; i >= 0; i--) {
+ var x = xs[i];
+ f(x, i, xs);
</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">- return me;
- };
- var from = function (value) {
- return value === null || value === undefined ? NONE : some(value);
- };
- var Option = {
- some: some,
- none: none,
- from: from
- };
-
- var typeOf = function (x) {
- if (x === null)
- return 'null';
- var t = typeof x;
- if (t === 'object' && Array.prototype.isPrototypeOf(x))
- return 'array';
- if (t === 'object' && String.prototype.isPrototypeOf(x))
- return 'string';
- return t;
- };
- var isType = function (type) {
- return function (value) {
- return typeOf(value) === type;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var partition = function (xs, pred) {
+ var pass = [];
+ var fail = [];
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ var arr = pred(x, i, xs) ? pass : fail;
+ arr.push(x);
+ }
+ return {
+ pass: pass,
+ fail: fail
+ };
</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 isString = isType('string');
- var isObject = isType('object');
- var isArray = isType('array');
- var isNull = isType('null');
- var isBoolean = isType('boolean');
-
- var isFunction = isType('function');
- var isNumber = isType('number');
-
- var rawIndexOf = function () {
- var pIndexOf = Array.prototype.indexOf;
- var fastIndex = function (xs, x) {
- return pIndexOf.call(xs, x);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var filter = function (xs, pred) {
+ var r = [];
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ if (pred(x, i, xs)) {
+ r.push(x);
+ }
+ }
+ return r;
</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 slowIndex = function (xs, x) {
- return slowIndexOf(xs, x);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var foldr = function (xs, f, acc) {
+ eachr(xs, function (x) {
+ acc = f(acc, x);
+ });
+ return acc;
</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 pIndexOf === undefined ? slowIndex : fastIndex;
- }();
- var indexOf = function (xs, x) {
- var r = rawIndexOf(xs, x);
- return r === -1 ? Option.none() : Option.some(r);
- };
- var contains = function (xs, x) {
- return rawIndexOf(xs, x) > -1;
- };
- var exists = function (xs, pred) {
- return findIndex(xs, pred).isSome();
- };
-
-
- var map = function (xs, f) {
- var len = xs.length;
- var r = new Array(len);
- for (var i = 0; i < len; i++) {
- var x = xs[i];
- r[i] = f(x, i, xs);
- }
- return r;
- };
- var each = function (xs, f) {
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- f(x, i, xs);
- }
- };
- var eachr = function (xs, f) {
- for (var i = xs.length - 1; i >= 0; i--) {
- var x = xs[i];
- f(x, i, xs);
- }
- };
- var partition = function (xs, pred) {
- var pass = [];
- var fail = [];
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- var arr = pred(x, i, xs) ? pass : fail;
- arr.push(x);
- }
- return {
- pass: pass,
- fail: fail
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var foldl = function (xs, f, acc) {
+ each(xs, function (x) {
+ acc = f(acc, x);
+ });
+ return acc;
</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 filter = function (xs, pred) {
- var r = [];
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- if (pred(x, i, xs)) {
- r.push(x);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var find = function (xs, pred) {
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ if (pred(x, i, xs)) {
+ return Option.some(x);
+ }
</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 r;
- };
-
- var foldr = function (xs, f, acc) {
- eachr(xs, function (x) {
- acc = f(acc, x);
- });
- return acc;
- };
- var foldl = function (xs, f, acc) {
- each(xs, function (x) {
- acc = f(acc, x);
- });
- return acc;
- };
- var find = function (xs, pred) {
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- if (pred(x, i, xs)) {
- return Option.some(x);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Option.none();
+ };
+ var findIndex = function (xs, pred) {
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ if (pred(x, i, xs)) {
+ return Option.some(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">- }
- return Option.none();
- };
- var findIndex = function (xs, pred) {
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- if (pred(x, i, xs)) {
- return Option.some(i);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Option.none();
+ };
+ var slowIndexOf = function (xs, x) {
+ for (var i = 0, len = xs.length; i < len; ++i) {
+ if (xs[i] === x) {
+ return 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">- }
- return Option.none();
- };
- var slowIndexOf = function (xs, x) {
- for (var i = 0, len = xs.length; i < len; ++i) {
- if (xs[i] === x) {
- return i;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return -1;
+ };
+ var push = Array.prototype.push;
+ var flatten = function (xs) {
+ var r = [];
+ for (var i = 0, len = xs.length; i < len; ++i) {
+ if (!Array.prototype.isPrototypeOf(xs[i]))
+ throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
+ push.apply(r, xs[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">- }
- return -1;
- };
- var push = Array.prototype.push;
- var flatten = function (xs) {
- var r = [];
- for (var i = 0, len = xs.length; i < len; ++i) {
- if (!Array.prototype.isPrototypeOf(xs[i]))
- throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
- push.apply(r, xs[i]);
- }
- return r;
- };
- var bind = function (xs, f) {
- var output = map(xs, f);
- return flatten(output);
- };
- var forall = function (xs, pred) {
- for (var i = 0, len = xs.length; i < len; ++i) {
- var x = xs[i];
- if (pred(x, i, xs) !== true) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return r;
+ };
+ var bind = function (xs, f) {
+ var output = map(xs, f);
+ return flatten(output);
+ };
+ var forall = function (xs, pred) {
+ for (var i = 0, len = xs.length; i < len; ++i) {
+ var x = xs[i];
+ if (pred(x, i, xs) !== true) {
+ 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 true;
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return true;
+ };
+ var slice = Array.prototype.slice;
+ var reverse = function (xs) {
+ var r = slice.call(xs, 0);
+ r.reverse();
+ return r;
+ };
+ var difference = function (a1, a2) {
+ return filter(a1, function (x) {
+ return !contains(a2, x);
+ });
+ };
+ var mapToObject = function (xs, f) {
+ var r = {};
+ for (var i = 0, len = xs.length; i < len; i++) {
+ var x = xs[i];
+ r[String(x)] = f(x, i);
+ }
+ return r;
+ };
+ var sort = function (xs, comparator) {
+ var copy = slice.call(xs, 0);
+ copy.sort(comparator);
+ return copy;
+ };
+ var head = function (xs) {
+ return xs.length === 0 ? Option.none() : Option.some(xs[0]);
+ };
+ var last = function (xs) {
+ return xs.length === 0 ? Option.none() : Option.some(xs[xs.length - 1]);
+ };
+ var from$1 = isFunction(Array.from) ? Array.from : function (x) {
+ return slice.call(x);
+ };
</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 slice = Array.prototype.slice;
- var reverse = function (xs) {
- var r = slice.call(xs, 0);
- r.reverse();
- return r;
- };
- var difference = function (a1, a2) {
- return filter(a1, function (x) {
- return !contains(a2, x);
- });
- };
- var mapToObject = function (xs, f) {
- var r = {};
- for (var i = 0, len = xs.length; i < len; i++) {
- var x = xs[i];
- r[String(x)] = f(x, i);
- }
- return r;
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Global = typeof window !== 'undefined' ? window : Function('return 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">- var sort = function (xs, comparator) {
- var copy = slice.call(xs, 0);
- copy.sort(comparator);
- return copy;
- };
- var head = function (xs) {
- return xs.length === 0 ? Option.none() : Option.some(xs[0]);
- };
- var last = function (xs) {
- return xs.length === 0 ? Option.none() : Option.some(xs[xs.length - 1]);
- };
- var from$1 = isFunction(Array.from) ? Array.from : function (x) {
- return slice.call(x);
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var path = function (parts, scope) {
+ var o = scope !== undefined && scope !== null ? scope : Global;
+ for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i)
+ o = o[parts[i]];
+ return o;
+ };
+ var resolve = function (p, scope) {
+ var parts = p.split('.');
+ return path(parts, scope);
+ };
</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 Global = typeof window !== 'undefined' ? window : Function('return this;')();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var unsafe = function (name, scope) {
+ return resolve(name, scope);
+ };
+ var getOrDie = function (name, scope) {
+ var actual = unsafe(name, scope);
+ if (actual === undefined || actual === null)
+ throw name + ' not available on this browser';
+ return actual;
+ };
+ var Global$1 = { getOrDie: getOrDie };
</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 path = function (parts, scope) {
- var o = scope !== undefined && scope !== null ? scope : Global;
- for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i)
- o = o[parts[i]];
- return o;
- };
- var resolve = function (p, scope) {
- var parts = p.split('.');
- return path(parts, scope);
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var url = function () {
+ return Global$1.getOrDie('URL');
+ };
+ var createObjectURL = function (blob) {
+ return url().createObjectURL(blob);
+ };
+ var revokeObjectURL = function (u) {
+ url().revokeObjectURL(u);
+ };
+ var URL = {
+ createObjectURL: createObjectURL,
+ revokeObjectURL: revokeObjectURL
+ };
</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 unsafe = function (name, scope) {
- return resolve(name, scope);
- };
- var getOrDie = function (name, scope) {
- var actual = unsafe(name, scope);
- if (actual === undefined || actual === null)
- throw name + ' not available on this browser';
- return actual;
- };
- var $_6xhbl4cjjgwe7a3 = { getOrDie: getOrDie };
-
- var url = function () {
- return $_6xhbl4cjjgwe7a3.getOrDie('URL');
- };
- var createObjectURL = function (blob) {
- return url().createObjectURL(blob);
- };
- var revokeObjectURL = function (u) {
- url().revokeObjectURL(u);
- };
- var $_r9uyubjjgwe7a2 = {
- createObjectURL: createObjectURL,
- revokeObjectURL: revokeObjectURL
- };
-
- var nav = navigator;
- var userAgent = nav.userAgent;
- var opera;
- var webkit;
- var ie;
- var ie11;
- var ie12;
- var gecko;
- var mac;
- var iDevice;
- var android;
- var fileApi;
- var phone;
- var tablet;
- var windowsPhone;
- var matchMediaQuery = function (query) {
- return 'matchMedia' in window ? matchMedia(query).matches : false;
- };
- opera = false;
- android = /Android/.test(userAgent);
- webkit = /WebKit/.test(userAgent);
- ie = !webkit && !opera && /MSIE/gi.test(userAgent) && /Explorer/gi.test(nav.appName);
- ie = ie && /MSIE (\w+)\./.exec(userAgent)[1];
- ie11 = userAgent.indexOf('Trident/') !== -1 && (userAgent.indexOf('rv:') !== -1 || nav.appName.indexOf('Netscape') !== -1) ? 11 : false;
- ie12 = userAgent.indexOf('Edge/') !== -1 && !ie && !ie11 ? 12 : false;
- ie = ie || ie11 || ie12;
- gecko = !webkit && !ie11 && /Gecko/.test(userAgent);
- mac = userAgent.indexOf('Mac') !== -1;
- iDevice = /(iPad|iPhone)/.test(userAgent);
- fileApi = 'FormData' in window && 'FileReader' in window && 'URL' in window && !!$_r9uyubjjgwe7a2.createObjectURL;
- phone = matchMediaQuery('only screen and (max-device-width: 480px)') && (android || iDevice);
- tablet = matchMediaQuery('only screen and (min-width: 800px)') && (android || iDevice);
- windowsPhone = userAgent.indexOf('Windows Phone') !== -1;
- if (ie12) {
- webkit = false;
- }
- var contentEditable = !iDevice || fileApi || parseInt(userAgent.match(/AppleWebKit\/(\d*)/)[1], 10) >= 534;
- var $_bcvfv9ajjgwe79v = {
- opera: opera,
- webkit: webkit,
- ie: ie,
- gecko: gecko,
- mac: mac,
- iOS: iDevice,
- android: android,
- contentEditable: contentEditable,
- transparentSrc: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
- caretAfter: ie !== 8,
- range: window.getSelection && 'Range' in window,
- documentMode: ie && !ie12 ? document.documentMode || 7 : 10,
- fileApi: fileApi,
- ceFalse: ie === false || ie > 8,
- cacheSuffix: null,
- container: null,
- overrideViewPort: null,
- experimentalShadowDom: false,
- canHaveCSP: ie === false || ie > 11,
- desktop: !phone && !tablet,
- windowsPhone: windowsPhone
- };
-
- var promise = function () {
- function bind(fn, thisArg) {
- return function () {
- fn.apply(thisArg, arguments);
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var nav = navigator, userAgent = nav.userAgent;
+ var opera, webkit, ie, ie11, ie12, gecko, mac, iDevice, android, fileApi, phone, tablet, windowsPhone;
+ var matchMediaQuery = function (query) {
+ return 'matchMedia' in window ? matchMedia(query).matches : false;
+ };
+ opera = false;
+ android = /Android/.test(userAgent);
+ webkit = /WebKit/.test(userAgent);
+ ie = !webkit && !opera && /MSIE/gi.test(userAgent) && /Explorer/gi.test(nav.appName);
+ ie = ie && /MSIE (\w+)\./.exec(userAgent)[1];
+ ie11 = userAgent.indexOf('Trident/') !== -1 && (userAgent.indexOf('rv:') !== -1 || nav.appName.indexOf('Netscape') !== -1) ? 11 : false;
+ ie12 = userAgent.indexOf('Edge/') !== -1 && !ie && !ie11 ? 12 : false;
+ ie = ie || ie11 || ie12;
+ gecko = !webkit && !ie11 && /Gecko/.test(userAgent);
+ mac = userAgent.indexOf('Mac') !== -1;
+ iDevice = /(iPad|iPhone)/.test(userAgent);
+ fileApi = 'FormData' in window && 'FileReader' in window && 'URL' in window && !!URL.createObjectURL;
+ phone = matchMediaQuery('only screen and (max-device-width: 480px)') && (android || iDevice);
+ tablet = matchMediaQuery('only screen and (min-width: 800px)') && (android || iDevice);
+ windowsPhone = userAgent.indexOf('Windows Phone') !== -1;
+ if (ie12) {
+ webkit = 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 isArray = Array.isArray || function (value) {
- return Object.prototype.toString.call(value) === '[object Array]';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var contentEditable = !iDevice || fileApi || parseInt(userAgent.match(/AppleWebKit\/(\d*)/)[1], 10) >= 534;
+ var Env = {
+ opera: opera,
+ webkit: webkit,
+ ie: ie,
+ gecko: gecko,
+ mac: mac,
+ iOS: iDevice,
+ android: android,
+ contentEditable: contentEditable,
+ transparentSrc: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7',
+ caretAfter: ie !== 8,
+ range: window.getSelection && 'Range' in window,
+ documentMode: ie && !ie12 ? document.documentMode || 7 : 10,
+ fileApi: fileApi,
+ ceFalse: ie === false || ie > 8,
+ cacheSuffix: null,
+ container: null,
+ overrideViewPort: null,
+ experimentalShadowDom: false,
+ canHaveCSP: ie === false || ie > 11,
+ desktop: !phone && !tablet,
+ windowsPhone: windowsPhone
</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 Promise = function (fn) {
- if (typeof this !== 'object') {
- throw new TypeError('Promises must be constructed via new');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var promise = function () {
+ function bind(fn, thisArg) {
+ return function () {
+ fn.apply(thisArg, 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 (typeof fn !== 'function') {
- throw new TypeError('not a function');
- }
- this._state = null;
- this._value = null;
- this._deferreds = [];
- doResolve(fn, bind(resolve, this), bind(reject, this));
- };
- var asap = Promise.immediateFn || typeof setImmediate === 'function' && setImmediate || function (fn) {
- setTimeout(fn, 1);
- };
- function handle(deferred) {
- var me = this;
- if (this._state === null) {
- this._deferreds.push(deferred);
- return;
- }
- asap(function () {
- var cb = me._state ? deferred.onFulfilled : deferred.onRejected;
- if (cb === null) {
- (me._state ? deferred.resolve : deferred.reject)(me._value);
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isArray = Array.isArray || function (value) {
+ return Object.prototype.toString.call(value) === '[object Array]';
+ };
+ var Promise = function (fn) {
+ if (typeof this !== 'object') {
+ throw new TypeError('Promises must be constructed via new');
</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 ret;
- try {
- ret = cb(me._value);
- } catch (e) {
- deferred.reject(e);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (typeof fn !== 'function') {
+ throw new TypeError('not a function');
+ }
+ this._state = null;
+ this._value = null;
+ this._deferreds = [];
+ doResolve(fn, bind(resolve, this), bind(reject, this));
+ };
+ var asap = Promise.immediateFn || typeof setImmediate === 'function' && setImmediate || function (fn) {
+ setTimeout(fn, 1);
+ };
+ function handle(deferred) {
+ var me = this;
+ if (this._state === null) {
+ this._deferreds.push(deferred);
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- deferred.resolve(ret);
- });
- }
- function resolve(newValue) {
- try {
- if (newValue === this) {
- throw new TypeError('A promise cannot be resolved with itself.');
- }
- if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
- var then = newValue.then;
- if (typeof then === 'function') {
- doResolve(bind(then, newValue), bind(resolve, this), bind(reject, this));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ asap(function () {
+ var cb = me._state ? deferred.onFulfilled : deferred.onRejected;
+ if (cb === null) {
+ (me._state ? deferred.resolve : deferred.reject)(me._value);
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ret;
+ try {
+ ret = cb(me._value);
+ } catch (e) {
+ deferred.reject(e);
+ return;
+ }
+ deferred.resolve(ret);
+ });
+ }
+ function resolve(newValue) {
+ try {
+ if (newValue === this) {
+ throw new TypeError('A promise cannot be resolved with itself.');
+ }
+ if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
+ var then = newValue.then;
+ if (typeof then === 'function') {
+ doResolve(bind(then, newValue), bind(resolve, this), bind(reject, this));
+ return;
+ }
+ }
+ this._state = true;
+ this._value = newValue;
+ finale.call(this);
+ } catch (e) {
+ reject.call(this, 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">- this._state = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ function reject(newValue) {
+ this._state = false;
</ins><span class="cx" style="display: block; padding: 0 10px"> this._value = newValue;
</span><span class="cx" style="display: block; padding: 0 10px"> finale.call(this);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } catch (e) {
- reject.call(this, e);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- function reject(newValue) {
- this._state = false;
- this._value = newValue;
- finale.call(this);
- }
- function finale() {
- for (var i = 0, len = this._deferreds.length; i < len; i++) {
- handle.call(this, this._deferreds[i]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function finale() {
+ for (var i = 0, len = this._deferreds.length; i < len; i++) {
+ handle.call(this, this._deferreds[i]);
+ }
+ this._deferreds = 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">- this._deferreds = null;
- }
- function Handler(onFulfilled, onRejected, resolve, reject) {
- this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
- this.onRejected = typeof onRejected === 'function' ? onRejected : null;
- this.resolve = resolve;
- this.reject = reject;
- }
- function doResolve(fn, onFulfilled, onRejected) {
- var done = false;
- try {
- fn(function (value) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function Handler(onFulfilled, onRejected, resolve, reject) {
+ this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
+ this.onRejected = typeof onRejected === 'function' ? onRejected : null;
+ this.resolve = resolve;
+ this.reject = reject;
+ }
+ function doResolve(fn, onFulfilled, onRejected) {
+ var done = false;
+ try {
+ fn(function (value) {
+ if (done) {
+ return;
+ }
+ done = true;
+ onFulfilled(value);
+ }, function (reason) {
+ if (done) {
+ return;
+ }
+ done = true;
+ onRejected(reason);
+ });
+ } catch (ex) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (done) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> done = true;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- onFulfilled(value);
- }, function (reason) {
- if (done) {
- return;
- }
- done = true;
- onRejected(reason);
- });
- } catch (ex) {
- if (done) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ onRejected(ex);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- done = true;
- onRejected(ex);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- Promise.prototype.catch = function (onRejected) {
- return this.then(null, onRejected);
- };
- Promise.prototype.then = function (onFulfilled, onRejected) {
- var me = this;
- return new Promise(function (resolve, reject) {
- handle.call(me, new Handler(onFulfilled, onRejected, resolve, reject));
- });
- };
- Promise.all = function () {
- var args = Array.prototype.slice.call(arguments.length === 1 && isArray(arguments[0]) ? arguments[0] : arguments);
- return new Promise(function (resolve, reject) {
- if (args.length === 0) {
- return resolve([]);
- }
- var remaining = args.length;
- function res(i, val) {
- try {
- if (val && (typeof val === 'object' || typeof val === 'function')) {
- var then = val.then;
- if (typeof then === 'function') {
- then.call(val, function (val) {
- res(i, val);
- }, reject);
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Promise.prototype.catch = function (onRejected) {
+ return this.then(null, onRejected);
+ };
+ Promise.prototype.then = function (onFulfilled, onRejected) {
+ var me = this;
+ return new Promise(function (resolve, reject) {
+ handle.call(me, new Handler(onFulfilled, onRejected, resolve, reject));
+ });
+ };
+ Promise.all = function () {
+ var args = Array.prototype.slice.call(arguments.length === 1 && isArray(arguments[0]) ? arguments[0] : arguments);
+ return new Promise(function (resolve, reject) {
+ if (args.length === 0) {
+ return resolve([]);
+ }
+ var remaining = args.length;
+ function res(i, val) {
+ try {
+ if (val && (typeof val === 'object' || typeof val === 'function')) {
+ var then = val.then;
+ if (typeof then === 'function') {
+ then.call(val, function (val) {
+ res(i, val);
+ }, reject);
+ return;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ args[i] = val;
+ if (--remaining === 0) {
+ resolve(args);
+ }
+ } catch (ex) {
+ reject(ex);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- args[i] = val;
- if (--remaining === 0) {
- resolve(args);
- }
- } catch (ex) {
- reject(ex);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (var i = 0; i < args.length; i++) {
+ res(i, args[i]);
+ }
+ });
+ };
+ Promise.resolve = function (value) {
+ if (value && typeof value === 'object' && value.constructor === Promise) {
+ 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">- for (var i = 0; i < args.length; i++) {
- res(i, args[i]);
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new Promise(function (resolve) {
+ resolve(value);
+ });
+ };
+ Promise.reject = function (value) {
+ return new Promise(function (resolve, reject) {
+ reject(value);
+ });
+ };
+ Promise.race = function (values) {
+ return new Promise(function (resolve, reject) {
+ for (var i = 0, len = values.length; i < len; i++) {
+ values[i].then(resolve, reject);
+ }
+ });
+ };
+ return Promise;
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- Promise.resolve = function (value) {
- if (value && typeof value === 'object' && value.constructor === Promise) {
- return value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var promiseObj = window.Promise ? window.Promise : promise();
+
+ var requestAnimationFramePromise;
+ var requestAnimationFrame$$1 = function (callback, element) {
+ var i, requestAnimationFrameFunc = window.requestAnimationFrame;
+ var vendors = [
+ 'ms',
+ 'moz',
+ 'webkit'
+ ];
+ var featurefill = function (callback) {
+ window.setTimeout(callback, 0);
+ };
+ for (i = 0; i < vendors.length && !requestAnimationFrameFunc; i++) {
+ requestAnimationFrameFunc = window[vendors[i] + 'RequestAnimationFrame'];
</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 new Promise(function (resolve) {
- resolve(value);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!requestAnimationFrameFunc) {
+ requestAnimationFrameFunc = featurefill;
+ }
+ requestAnimationFrameFunc(callback, element);
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- Promise.reject = function (value) {
- return new Promise(function (resolve, reject) {
- reject(value);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var wrappedSetTimeout = function (callback, time) {
+ if (typeof time !== 'number') {
+ time = 0;
+ }
+ return setTimeout(callback, time);
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- Promise.race = function (values) {
- return new Promise(function (resolve, reject) {
- for (var i = 0, len = values.length; i < len; i++) {
- values[i].then(resolve, reject);
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var wrappedSetInterval = function (callback, time) {
+ if (typeof time !== 'number') {
+ time = 1;
+ }
+ return setInterval(callback, time);
</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 Promise;
- };
- var promiseObj = window.Promise ? window.Promise : promise();
-
- var requestAnimationFramePromise;
- var requestAnimationFrame$$1 = function (callback, element) {
- var i, requestAnimationFrameFunc = window.requestAnimationFrame;
- var vendors = [
- 'ms',
- 'moz',
- 'webkit'
- ];
- var featurefill = function (callback) {
- window.setTimeout(callback, 0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var wrappedClearTimeout = function (id) {
+ return clearTimeout(id);
</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 < vendors.length && !requestAnimationFrameFunc; i++) {
- requestAnimationFrameFunc = window[vendors[i] + 'RequestAnimationFrame'];
- }
- if (!requestAnimationFrameFunc) {
- requestAnimationFrameFunc = featurefill;
- }
- requestAnimationFrameFunc(callback, element);
- };
- var wrappedSetTimeout = function (callback, time) {
- if (typeof time !== 'number') {
- time = 0;
- }
- return setTimeout(callback, time);
- };
- var wrappedSetInterval = function (callback, time) {
- if (typeof time !== 'number') {
- time = 1;
- }
- return setInterval(callback, time);
- };
- var wrappedClearTimeout = function (id) {
- return clearTimeout(id);
- };
- var wrappedClearInterval = function (id) {
- return clearInterval(id);
- };
- var debounce = function (callback, time) {
- var timer, func;
- func = function () {
- var args = arguments;
- clearTimeout(timer);
- timer = wrappedSetTimeout(function () {
- callback.apply(this, args);
- }, time);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var wrappedClearInterval = function (id) {
+ return clearInterval(id);
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- func.stop = function () {
- clearTimeout(timer);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var debounce = function (callback, time) {
+ var timer, func;
+ func = function () {
+ var args = arguments;
+ clearTimeout(timer);
+ timer = wrappedSetTimeout(function () {
+ callback.apply(this, args);
+ }, time);
+ };
+ func.stop = function () {
+ clearTimeout(timer);
+ };
+ return func;
</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 func;
- };
- var $_9o1ijaijjgwe7dm = {
- requestAnimationFrame: function (callback, element) {
- if (requestAnimationFramePromise) {
- requestAnimationFramePromise.then(callback);
- return;
- }
- requestAnimationFramePromise = new promiseObj(function (resolve) {
- if (!element) {
- element = document.body;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Delay = {
+ requestAnimationFrame: function (callback, element) {
+ if (requestAnimationFramePromise) {
+ requestAnimationFramePromise.then(callback);
+ 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">- requestAnimationFrame$$1(resolve, element);
- }).then(callback);
- },
- setTimeout: wrappedSetTimeout,
- setInterval: wrappedSetInterval,
- setEditorTimeout: function (editor, callback, time) {
- return wrappedSetTimeout(function () {
- if (!editor.removed) {
- callback();
- }
- }, time);
- },
- setEditorInterval: function (editor, callback, time) {
- var timer;
- timer = wrappedSetInterval(function () {
- if (!editor.removed) {
- callback();
- } else {
- clearInterval(timer);
- }
- }, time);
- return timer;
- },
- debounce: debounce,
- throttle: debounce,
- clearInterval: wrappedClearInterval,
- clearTimeout: wrappedClearTimeout
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ requestAnimationFramePromise = new promiseObj(function (resolve) {
+ if (!element) {
+ element = document.body;
+ }
+ requestAnimationFrame$$1(resolve, element);
+ }).then(callback);
+ },
+ setTimeout: wrappedSetTimeout,
+ setInterval: wrappedSetInterval,
+ setEditorTimeout: function (editor, callback, time) {
+ return wrappedSetTimeout(function () {
+ if (!editor.removed) {
+ callback();
+ }
+ }, time);
+ },
+ setEditorInterval: function (editor, callback, time) {
+ var timer;
+ timer = wrappedSetInterval(function () {
+ if (!editor.removed) {
+ callback();
+ } else {
+ clearInterval(timer);
+ }
+ }, time);
+ return timer;
+ },
+ debounce: debounce,
+ throttle: debounce,
+ clearInterval: wrappedClearInterval,
+ clearTimeout: wrappedClearTimeout
+ };
</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 eventExpandoPrefix = 'mce-data-';
- var mouseEventRe = /^(?:mouse|contextmenu)|click/;
- var deprecated = {
- keyLocation: 1,
- layerX: 1,
- layerY: 1,
- returnValue: 1,
- webkitMovementX: 1,
- webkitMovementY: 1,
- keyIdentifier: 1
- };
- var hasIsDefaultPrevented = function (event$$1) {
- return event$$1.isDefaultPrevented === returnTrue || event$$1.isDefaultPrevented === returnFalse;
- };
- var returnFalse = function () {
- return false;
- };
- var returnTrue = function () {
- return true;
- };
- var addEvent = function (target, name$$1, callback, capture) {
- if (target.addEventListener) {
- target.addEventListener(name$$1, callback, capture || false);
- } else if (target.attachEvent) {
- target.attachEvent('on' + name$$1, callback);
- }
- };
- var removeEvent = function (target, name$$1, callback, capture) {
- if (target.removeEventListener) {
- target.removeEventListener(name$$1, callback, capture || false);
- } else if (target.detachEvent) {
- target.detachEvent('on' + name$$1, callback);
- }
- };
- var getTargetFromShadowDom = function (event$$1, defaultTarget) {
- var path, target = defaultTarget;
- path = event$$1.path;
- if (path && path.length > 0) {
- target = path[0];
- }
- if (event$$1.composedPath) {
- path = event$$1.composedPath();
- if (path && path.length > 0) {
- target = path[0];
- }
- }
- return target;
- };
- var fix = function (originalEvent, data) {
- var name$$1;
- var event$$1 = data || {};
- for (name$$1 in originalEvent) {
- if (!deprecated[name$$1]) {
- event$$1[name$$1] = originalEvent[name$$1];
- }
- }
- if (!event$$1.target) {
- event$$1.target = event$$1.srcElement || document;
- }
- if ($_bcvfv9ajjgwe79v.experimentalShadowDom) {
- event$$1.target = getTargetFromShadowDom(originalEvent, event$$1.target);
- }
- if (originalEvent && mouseEventRe.test(originalEvent.type) && originalEvent.pageX === undefined && originalEvent.clientX !== undefined) {
- var eventDoc = event$$1.target.ownerDocument || document;
- var doc = eventDoc.documentElement;
- var body = eventDoc.body;
- event$$1.pageX = originalEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
- event$$1.pageY = originalEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
- }
- event$$1.preventDefault = function () {
- event$$1.isDefaultPrevented = returnTrue;
- if (originalEvent) {
- if (originalEvent.preventDefault) {
- originalEvent.preventDefault();
- } else {
- originalEvent.returnValue = false;
- }
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var eventExpandoPrefix = 'mce-data-';
+ var mouseEventRe = /^(?:mouse|contextmenu)|click/;
+ var deprecated = {
+ keyLocation: 1,
+ layerX: 1,
+ layerY: 1,
+ returnValue: 1,
+ webkitMovementX: 1,
+ webkitMovementY: 1,
+ keyIdentifier: 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">- event$$1.stopPropagation = function () {
- event$$1.isPropagationStopped = returnTrue;
- if (originalEvent) {
- if (originalEvent.stopPropagation) {
- originalEvent.stopPropagation();
- } else {
- originalEvent.cancelBubble = true;
- }
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasIsDefaultPrevented = function (event$$1) {
+ return event$$1.isDefaultPrevented === returnTrue || event$$1.isDefaultPrevented === returnFalse;
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- event$$1.stopImmediatePropagation = function () {
- event$$1.isImmediatePropagationStopped = returnTrue;
- event$$1.stopPropagation();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var returnFalse = function () {
+ 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 (hasIsDefaultPrevented(event$$1) === false) {
- event$$1.isDefaultPrevented = returnFalse;
- event$$1.isPropagationStopped = returnFalse;
- event$$1.isImmediatePropagationStopped = returnFalse;
- }
- if (typeof event$$1.metaKey === 'undefined') {
- event$$1.metaKey = false;
- }
- return event$$1;
- };
- var bindOnReady = function (win, callback, eventUtils) {
- var doc = win.document, event$$1 = { type: 'ready' };
- if (eventUtils.domLoaded) {
- callback(event$$1);
- return;
- }
- var isDocReady = function () {
- return doc.readyState === 'complete' || doc.readyState === 'interactive' && doc.body;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var returnTrue = function () {
+ 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">- var readyHandler = function () {
- if (!eventUtils.domLoaded) {
- eventUtils.domLoaded = true;
- callback(event$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var addEvent = function (target, name$$1, callback, capture) {
+ if (target.addEventListener) {
+ target.addEventListener(name$$1, callback, capture || false);
+ } else if (target.attachEvent) {
+ target.attachEvent('on' + name$$1, callback);
</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">- var waitForDomLoaded = function () {
- if (isDocReady()) {
- removeEvent(doc, 'readystatechange', waitForDomLoaded);
- readyHandler();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var removeEvent = function (target, name$$1, callback, capture) {
+ if (target.removeEventListener) {
+ target.removeEventListener(name$$1, callback, capture || false);
+ } else if (target.detachEvent) {
+ target.detachEvent('on' + name$$1, callback);
</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">- var tryScroll = function () {
- try {
- doc.documentElement.doScroll('left');
- } catch (ex) {
- $_9o1ijaijjgwe7dm.setTimeout(tryScroll);
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getTargetFromShadowDom = function (event$$1, defaultTarget) {
+ if (event$$1.composedPath) {
+ var composedPath = event$$1.composedPath();
+ if (composedPath && composedPath.length > 0) {
+ return composedPath[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">- readyHandler();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return defaultTarget;
</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 (doc.addEventListener && !($_bcvfv9ajjgwe79v.ie && $_bcvfv9ajjgwe79v.ie < 11)) {
- if (isDocReady()) {
- readyHandler();
- } else {
- addEvent(win, 'DOMContentLoaded', readyHandler);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fix = function (originalEvent, data) {
+ var name$$1;
+ var event$$1 = data || {};
+ for (name$$1 in originalEvent) {
+ if (!deprecated[name$$1]) {
+ event$$1[name$$1] = originalEvent[name$$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">- } else {
- addEvent(doc, 'readystatechange', waitForDomLoaded);
- if (doc.documentElement.doScroll && win.self === win.top) {
- tryScroll();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!event$$1.target) {
+ event$$1.target = event$$1.srcElement || document;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- addEvent(win, 'load', readyHandler);
- };
- var EventUtils = function () {
- var self$$1 = this;
- var events = {}, count, expando, hasFocusIn, hasMouseEnterLeave, mouseEnterLeave;
- expando = eventExpandoPrefix + (+new Date()).toString(32);
- hasMouseEnterLeave = 'onmouseenter' in document.documentElement;
- hasFocusIn = 'onfocusin' in document.documentElement;
- mouseEnterLeave = {
- mouseenter: 'mouseover',
- mouseleave: 'mouseout'
- };
- count = 1;
- self$$1.domLoaded = false;
- self$$1.events = events;
- var executeHandlers = function (evt, id) {
- var callbackList, i, l, callback;
- var container = events[id];
- callbackList = container && container[evt.type];
- if (callbackList) {
- for (i = 0, l = callbackList.length; i < l; i++) {
- callback = callbackList[i];
- if (callback && callback.func.call(callback.scope, evt) === false) {
- evt.preventDefault();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (Env.experimentalShadowDom) {
+ event$$1.target = getTargetFromShadowDom(originalEvent, event$$1.target);
+ }
+ if (originalEvent && mouseEventRe.test(originalEvent.type) && originalEvent.pageX === undefined && originalEvent.clientX !== undefined) {
+ var eventDoc = event$$1.target.ownerDocument || document;
+ var doc = eventDoc.documentElement;
+ var body = eventDoc.body;
+ event$$1.pageX = originalEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
+ event$$1.pageY = originalEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
+ }
+ event$$1.preventDefault = function () {
+ event$$1.isDefaultPrevented = returnTrue;
+ if (originalEvent) {
+ if (originalEvent.preventDefault) {
+ originalEvent.preventDefault();
+ } else {
+ originalEvent.returnValue = 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 (evt.isImmediatePropagationStopped()) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ };
+ event$$1.stopPropagation = function () {
+ event$$1.isPropagationStopped = returnTrue;
+ if (originalEvent) {
+ if (originalEvent.stopPropagation) {
+ originalEvent.stopPropagation();
+ } else {
+ originalEvent.cancelBubble = true;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ event$$1.stopImmediatePropagation = function () {
+ event$$1.isImmediatePropagationStopped = returnTrue;
+ event$$1.stopPropagation();
+ };
+ if (hasIsDefaultPrevented(event$$1) === false) {
+ event$$1.isDefaultPrevented = returnFalse;
+ event$$1.isPropagationStopped = returnFalse;
+ event$$1.isImmediatePropagationStopped = returnFalse;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (typeof event$$1.metaKey === 'undefined') {
+ event$$1.metaKey = false;
+ }
+ return event$$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">- self$$1.bind = function (target, names, callback, scope) {
- var id, callbackList, i, name$$1, fakeName, nativeHandler, capture;
- var win = window;
- var defaultNativeHandler = function (evt) {
- executeHandlers(fix(evt || win.event), id);
- };
- if (!target || target.nodeType === 3 || target.nodeType === 8) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var bindOnReady = function (win, callback, eventUtils) {
+ var doc = win.document, event$$1 = { type: 'ready' };
+ if (eventUtils.domLoaded) {
+ callback(event$$1);
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (!target[expando]) {
- id = count++;
- target[expando] = id;
- events[id] = {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isDocReady = function () {
+ return doc.readyState === 'complete' || doc.readyState === 'interactive' && doc.body;
+ };
+ var readyHandler = function () {
+ if (!eventUtils.domLoaded) {
+ eventUtils.domLoaded = true;
+ callback(event$$1);
+ }
+ };
+ var waitForDomLoaded = function () {
+ if (isDocReady()) {
+ removeEvent(doc, 'readystatechange', waitForDomLoaded);
+ readyHandler();
+ }
+ };
+ var tryScroll = function () {
+ try {
+ doc.documentElement.doScroll('left');
+ } catch (ex) {
+ Delay.setTimeout(tryScroll);
+ return;
+ }
+ readyHandler();
+ };
+ if (doc.addEventListener && !(Env.ie && Env.ie < 11)) {
+ if (isDocReady()) {
+ readyHandler();
+ } else {
+ addEvent(win, 'DOMContentLoaded', readyHandler);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- id = target[expando];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ addEvent(doc, 'readystatechange', waitForDomLoaded);
+ if (doc.documentElement.doScroll && win.self === win.top) {
+ tryScroll();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- scope = scope || target;
- names = names.split(' ');
- i = names.length;
- while (i--) {
- name$$1 = names[i];
- nativeHandler = defaultNativeHandler;
- fakeName = capture = false;
- if (name$$1 === 'DOMContentLoaded') {
- name$$1 = 'ready';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ addEvent(win, 'load', readyHandler);
+ };
+ var EventUtils = function () {
+ var self$$1 = this;
+ var events = {}, count, expando, hasFocusIn, hasMouseEnterLeave, mouseEnterLeave;
+ expando = eventExpandoPrefix + (+new Date()).toString(32);
+ hasMouseEnterLeave = 'onmouseenter' in document.documentElement;
+ hasFocusIn = 'onfocusin' in document.documentElement;
+ mouseEnterLeave = {
+ mouseenter: 'mouseover',
+ mouseleave: 'mouseout'
+ };
+ count = 1;
+ self$$1.domLoaded = false;
+ self$$1.events = events;
+ var executeHandlers = function (evt, id) {
+ var callbackList, i, l, callback;
+ var container = events[id];
+ callbackList = container && container[evt.type];
+ if (callbackList) {
+ for (i = 0, l = callbackList.length; i < l; i++) {
+ callback = callbackList[i];
+ if (callback && callback.func.call(callback.scope, evt) === false) {
+ evt.preventDefault();
+ }
+ if (evt.isImmediatePropagationStopped()) {
+ 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 (self$$1.domLoaded && name$$1 === 'ready' && target.readyState === 'complete') {
- callback.call(scope, fix({ type: name$$1 }));
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ self$$1.bind = function (target, names, callback, scope) {
+ var id, callbackList, i, name$$1, fakeName, nativeHandler, capture;
+ var win = window;
+ var defaultNativeHandler = function (evt) {
+ executeHandlers(fix(evt || win.event), id);
+ };
+ if (!target || target.nodeType === 3 || target.nodeType === 8) {
+ 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 (!hasMouseEnterLeave) {
- fakeName = mouseEnterLeave[name$$1];
- if (fakeName) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!target[expando]) {
+ id = count++;
+ target[expando] = id;
+ events[id] = {};
+ } else {
+ id = target[expando];
+ }
+ scope = scope || target;
+ names = names.split(' ');
+ i = names.length;
+ while (i--) {
+ name$$1 = names[i];
+ nativeHandler = defaultNativeHandler;
+ fakeName = capture = false;
+ if (name$$1 === 'DOMContentLoaded') {
+ name$$1 = 'ready';
+ }
+ if (self$$1.domLoaded && name$$1 === 'ready' && target.readyState === 'complete') {
+ callback.call(scope, fix({ type: name$$1 }));
+ continue;
+ }
+ if (!hasMouseEnterLeave) {
+ fakeName = mouseEnterLeave[name$$1];
+ if (fakeName) {
+ nativeHandler = function (evt) {
+ var current, related;
+ current = evt.currentTarget;
+ related = evt.relatedTarget;
+ if (related && current.contains) {
+ related = current.contains(related);
+ } else {
+ while (related && related !== current) {
+ related = related.parentNode;
+ }
+ }
+ if (!related) {
+ evt = fix(evt || win.event);
+ evt.type = evt.type === 'mouseout' ? 'mouseleave' : 'mouseenter';
+ evt.target = current;
+ executeHandlers(evt, id);
+ }
+ };
+ }
+ }
+ if (!hasFocusIn && (name$$1 === 'focusin' || name$$1 === 'focusout')) {
+ capture = true;
+ fakeName = name$$1 === 'focusin' ? 'focus' : 'blur';
</ins><span class="cx" style="display: block; padding: 0 10px"> nativeHandler = function (evt) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var current, related;
- current = evt.currentTarget;
- related = evt.relatedTarget;
- if (related && current.contains) {
- related = current.contains(related);
- } else {
- while (related && related !== current) {
- related = related.parentNode;
- }
- }
- if (!related) {
- evt = fix(evt || win.event);
- evt.type = evt.type === 'mouseout' ? 'mouseleave' : 'mouseenter';
- evt.target = current;
- executeHandlers(evt, id);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ evt = fix(evt || win.event);
+ evt.type = evt.type === 'focus' ? 'focusin' : 'focusout';
+ executeHandlers(evt, id);
</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">- }
- if (!hasFocusIn && (name$$1 === 'focusin' || name$$1 === 'focusout')) {
- capture = true;
- fakeName = name$$1 === 'focusin' ? 'focus' : 'blur';
- nativeHandler = function (evt) {
- evt = fix(evt || win.event);
- evt.type = evt.type === 'focus' ? 'focusin' : 'focusout';
- executeHandlers(evt, id);
- };
- }
- callbackList = events[id][name$$1];
- if (!callbackList) {
- events[id][name$$1] = callbackList = [{
- func: callback,
- scope: scope
- }];
- callbackList.fakeName = fakeName;
- callbackList.capture = capture;
- callbackList.nativeHandler = nativeHandler;
- if (name$$1 === 'ready') {
- bindOnReady(target, nativeHandler, self$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ callbackList = events[id][name$$1];
+ if (!callbackList) {
+ events[id][name$$1] = callbackList = [{
+ func: callback,
+ scope: scope
+ }];
+ callbackList.fakeName = fakeName;
+ callbackList.capture = capture;
+ callbackList.nativeHandler = nativeHandler;
+ if (name$$1 === 'ready') {
+ bindOnReady(target, nativeHandler, self$$1);
+ } else {
+ addEvent(target, fakeName || name$$1, nativeHandler, capture);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- addEvent(target, fakeName || name$$1, nativeHandler, capture);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (name$$1 === 'ready' && self$$1.domLoaded) {
+ callback({ type: name$$1 });
+ } else {
+ callbackList.push({
+ func: callback,
+ scope: scope
+ });
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- if (name$$1 === 'ready' && self$$1.domLoaded) {
- callback({ type: name$$1 });
- } else {
- callbackList.push({
- func: callback,
- scope: scope
- });
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- target = callbackList = 0;
- return callback;
- };
- self$$1.unbind = function (target, names, callback) {
- var id, callbackList, i, ci, name$$1, eventMap;
- if (!target || target.nodeType === 3 || target.nodeType === 8) {
- return self$$1;
- }
- id = target[expando];
- if (id) {
- eventMap = events[id];
- if (names) {
- names = names.split(' ');
- i = names.length;
- while (i--) {
- name$$1 = names[i];
- callbackList = eventMap[name$$1];
- if (callbackList) {
- if (callback) {
- ci = callbackList.length;
- while (ci--) {
- if (callbackList[ci].func === callback) {
- var nativeHandler = callbackList.nativeHandler;
- var fakeName = callbackList.fakeName, capture = callbackList.capture;
- callbackList = callbackList.slice(0, ci).concat(callbackList.slice(ci + 1));
- callbackList.nativeHandler = nativeHandler;
- callbackList.fakeName = fakeName;
- callbackList.capture = capture;
- eventMap[name$$1] = callbackList;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ target = callbackList = 0;
+ return callback;
+ };
+ self$$1.unbind = function (target, names, callback) {
+ var id, callbackList, i, ci, name$$1, eventMap;
+ if (!target || target.nodeType === 3 || target.nodeType === 8) {
+ return self$$1;
+ }
+ id = target[expando];
+ if (id) {
+ eventMap = events[id];
+ if (names) {
+ names = names.split(' ');
+ i = names.length;
+ while (i--) {
+ name$$1 = names[i];
+ callbackList = eventMap[name$$1];
+ if (callbackList) {
+ if (callback) {
+ ci = callbackList.length;
+ while (ci--) {
+ if (callbackList[ci].func === callback) {
+ var nativeHandler = callbackList.nativeHandler;
+ var fakeName = callbackList.fakeName, capture = callbackList.capture;
+ callbackList = callbackList.slice(0, ci).concat(callbackList.slice(ci + 1));
+ callbackList.nativeHandler = nativeHandler;
+ callbackList.fakeName = fakeName;
+ callbackList.capture = capture;
+ eventMap[name$$1] = callbackList;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!callback || callbackList.length === 0) {
+ delete eventMap[name$$1];
+ removeEvent(target, callbackList.fakeName || name$$1, callbackList.nativeHandler, callbackList.capture);
+ }
</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 || callbackList.length === 0) {
- delete eventMap[name$$1];
- removeEvent(target, callbackList.fakeName || name$$1, callbackList.nativeHandler, callbackList.capture);
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ for (name$$1 in eventMap) {
+ callbackList = eventMap[name$$1];
+ removeEvent(target, callbackList.fakeName || name$$1, callbackList.nativeHandler, callbackList.capture);
+ }
+ eventMap = {};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
</del><span class="cx" style="display: block; padding: 0 10px"> for (name$$1 in eventMap) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- callbackList = eventMap[name$$1];
- removeEvent(target, callbackList.fakeName || name$$1, callbackList.nativeHandler, callbackList.capture);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$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">- eventMap = {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ delete events[id];
+ try {
+ delete target[expando];
+ } catch (ex) {
+ target[expando] = 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">- for (name$$1 in eventMap) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$1;
+ };
+ self$$1.fire = function (target, name$$1, args) {
+ var id;
+ if (!target || target.nodeType === 3 || target.nodeType === 8) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return self$$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">- delete events[id];
- try {
- delete target[expando];
- } catch (ex) {
- target[expando] = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ args = fix(null, args);
+ args.type = name$$1;
+ args.target = target;
+ do {
+ id = target[expando];
+ if (id) {
+ executeHandlers(args, id);
+ }
+ target = target.parentNode || target.ownerDocument || target.defaultView || target.parentWindow;
+ } while (target && !args.isPropagationStopped());
+ return self$$1;
+ };
+ self$$1.clean = function (target) {
+ var i, children;
+ var unbind = self$$1.unbind;
+ if (!target || target.nodeType === 3 || target.nodeType === 8) {
+ return self$$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 self$$1;
- };
- self$$1.fire = function (target, name$$1, args) {
- var id;
- if (!target || target.nodeType === 3 || target.nodeType === 8) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (target[expando]) {
+ unbind(target);
+ }
+ if (!target.getElementsByTagName) {
+ target = target.document;
+ }
+ if (target && target.getElementsByTagName) {
+ unbind(target);
+ children = target.getElementsByTagName('*');
+ i = children.length;
+ while (i--) {
+ target = children[i];
+ if (target[expando]) {
+ unbind(target);
+ }
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return self$$1;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- args = fix(null, args);
- args.type = name$$1;
- args.target = target;
- do {
- id = target[expando];
- if (id) {
- executeHandlers(args, id);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ self$$1.destroy = function () {
+ events = {};
+ };
+ self$$1.cancel = function (e) {
+ if (e) {
+ e.preventDefault();
+ 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 = target.parentNode || target.ownerDocument || target.defaultView || target.parentWindow;
- } while (target && !args.isPropagationStopped());
- return self$$1;
</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">- self$$1.clean = function (target) {
- var i, children;
- var unbind = self$$1.unbind;
- if (!target || target.nodeType === 3 || target.nodeType === 8) {
- return self$$1;
- }
- if (target[expando]) {
- unbind(target);
- }
- if (!target.getElementsByTagName) {
- target = target.document;
- }
- if (target && target.getElementsByTagName) {
- unbind(target);
- children = target.getElementsByTagName('*');
- i = children.length;
- while (i--) {
- target = children[i];
- if (target[expando]) {
- unbind(target);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ EventUtils.Event = new EventUtils();
+ EventUtils.Event.bind(window, 'ready', function () {
+ });
+
+ var i, support, Expr, getText, isXML, tokenize, compile, select, outermostContext, sortInput, hasDuplicate, setDocument, document$1, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains$1, expando = 'sizzle' + -new Date(), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), sortOrder = function (a, b) {
+ if (a === b) {
+ hasDuplicate = true;
+ }
+ return 0;
+ }, strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, hasOwn = {}.hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push$1 = arr.push, slice$1 = arr.slice, indexOf$1 = arr.indexOf || function (elem) {
+ var i = 0, len = this.length;
+ for (; i < len; i++) {
+ if (this[i] === elem) {
+ return i;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return -1;
+ }, booleans = 'checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped', whitespace = '[\\x20\\t\\r\\n\\f]', identifier = '(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+', attributes = '\\[' + whitespace + '*(' + identifier + ')(?:' + whitespace + '*([*^$|!~]?=)' + whitespace + '*(?:\'((?:\\\\.|[^\\\\\'])*)\'|"((?:\\\\.|[^\\\\"])*)"|(' + identifier + '))|)' + whitespace + '*\\]', pseudos = ':(' + identifier + ')(?:\\((' + '(\'((?:\\\\.|[^\\\\\'])*)\'|"((?:\\\\.|[^\\\\"])*)")|' + '((?:\\\\.|[^\\\\()[\\]]|' + attributes + ')*)|' + '.*' + ')\\)|)', rtrim = new RegExp('^' + whitespace + '+|((?:^|[^\\\\])(?:\\\\.)*)' + whitespace + '+$', 'g'), rcomma = new RegExp('^' + whitespace + '*,' + whitespace + '*'), rcombinators = new RegExp('^' + whitespace + '*([>+~]|' + whitespace + ')' + whitespace + '*'), rattributeQuotes = new RegExp('=' + whitespace + '*([^\\]\'"]*?)' + whitespace + '*\\]', 'g'
), rpseudo = new RegExp(pseudos), ridentifier = new RegExp('^' + identifier + '$'), matchExpr = {
+ ID: new RegExp('^#(' + identifier + ')'),
+ CLASS: new RegExp('^\\.(' + identifier + ')'),
+ TAG: new RegExp('^(' + identifier + '|[*])'),
+ ATTR: new RegExp('^' + attributes),
+ PSEUDO: new RegExp('^' + pseudos),
+ CHILD: new RegExp('^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(' + whitespace + '*(even|odd|(([+-]|)(\\d*)n|)' + whitespace + '*(?:([+-]|)' + whitespace + '*(\\d+)|))' + whitespace + '*\\)|)', 'i'),
+ bool: new RegExp('^(?:' + booleans + ')$', 'i'),
+ needsContext: new RegExp('^' + whitespace + '*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(' + whitespace + '*((?:-\\d)?\\d*)' + whitespace + '*\\)|)(?=[^-]|$)', 'i')
+ }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, rescape = /'|\\/g, runescape = new RegExp('\\\\([\\da-f]{1,6}' + whitespace + '?|(' + whitespace + ')|.)', 'ig'), funescape = function (_, escaped, escapedWhitespace) {
+ var high = '0x' + escaped - 65536;
+ return high !== high || escapedWhitespace ? escaped : high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320);
+ };
+ try {
+ push$1.apply(arr = slice$1.call(preferredDoc.childNodes), preferredDoc.childNodes);
+ arr[preferredDoc.childNodes.length].nodeType;
+ } catch (e) {
+ push$1 = {
+ apply: arr.length ? function (target, els) {
+ push_native.apply(target, slice$1.call(els));
+ } : function (target, els) {
+ var j = target.length, i = 0;
+ while (target[j++] = els[i++]) {
+ }
+ target.length = j - 1;
+ }
+ };
+ }
+ var Sizzle = function (selector, context, results, seed) {
+ var match, elem, m, nodeType, i, groups, old, nid, newContext, newSelector;
+ if ((context ? context.ownerDocument || context : preferredDoc) !== document$1) {
+ setDocument(context);
</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 self$$1;
- };
- self$$1.destroy = function () {
- events = {};
- };
- self$$1.cancel = function (e) {
- if (e) {
- e.preventDefault();
- e.stopImmediatePropagation();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ context = context || document$1;
+ results = results || [];
+ if (!selector || typeof selector !== 'string') {
+ return results;
</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;
- };
- };
- EventUtils.Event = new EventUtils();
- EventUtils.Event.bind(window, 'ready', function () {
- });
-
- var i;
- var support;
- var Expr;
- var getText;
- var isXML;
- var tokenize;
- var compile;
- var select;
- var outermostContext;
- var sortInput;
- var hasDuplicate;
- var setDocument;
- var document$1;
- var docElem;
- var documentIsHTML;
- var rbuggyQSA;
- var rbuggyMatches;
- var matches;
- var contains$1;
- var expando = 'sizzle' + -new Date();
- var preferredDoc = window.document;
- var dirruns = 0;
- var done = 0;
- var classCache = createCache();
- var tokenCache = createCache();
- var compilerCache = createCache();
- var sortOrder = function (a, b) {
- if (a === b) {
- hasDuplicate = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ((nodeType = context.nodeType) !== 1 && nodeType !== 9) {
+ 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 0;
- };
- var strundefined = typeof undefined;
- var MAX_NEGATIVE = 1 << 31;
- var hasOwn = {}.hasOwnProperty;
- var arr = [];
- var pop = arr.pop;
- var push_native = arr.push;
- var push$1 = arr.push;
- var slice$1 = arr.slice;
- var indexOf$1 = arr.indexOf || function (elem) {
- var i = 0, len = this.length;
- for (; i < len; i++) {
- if (this[i] === elem) {
- return i;
- }
- }
- return -1;
- };
- var booleans = 'checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped';
- var whitespace = '[\\x20\\t\\r\\n\\f]';
- var identifier = '(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+';
- var attributes = '\\[' + whitespace + '*(' + identifier + ')(?:' + whitespace + '*([*^$|!~]?=)' + whitespace + '*(?:\'((?:\\\\.|[^\\\\\'])*)\'|"((?:\\\\.|[^\\\\"])*)"|(' + identifier + '))|)' + whitespace + '*\\]';
- var pseudos = ':(' + identifier + ')(?:\\((' + '(\'((?:\\\\.|[^\\\\\'])*)\'|"((?:\\\\.|[^\\\\"])*)")|' + '((?:\\\\.|[^\\\\()[\\]]|' + attributes + ')*)|' + '.*' + ')\\)|)';
- var rtrim = new RegExp('^' + whitespace + '+|((?:^|[^\\\\])(?:\\\\.)*)' + whitespace + '+$', 'g');
- var rcomma = new RegExp('^' + whitespace + '*,' + whitespace + '*');
- var rcombinators = new RegExp('^' + whitespace + '*([>+~]|' + whitespace + ')' + whitespace + '*');
- var rattributeQuotes = new RegExp('=' + whitespace + '*([^\\]\'"]*?)' + whitespace + '*\\]', 'g');
- var rpseudo = new RegExp(pseudos);
- var ridentifier = new RegExp('^' + identifier + '$');
- var matchExpr = {
- ID: new RegExp('^#(' + identifier + ')'),
- CLASS: new RegExp('^\\.(' + identifier + ')'),
- TAG: new RegExp('^(' + identifier + '|[*])'),
- ATTR: new RegExp('^' + attributes),
- PSEUDO: new RegExp('^' + pseudos),
- CHILD: new RegExp('^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(' + whitespace + '*(even|odd|(([+-]|)(\\d*)n|)' + whitespace + '*(?:([+-]|)' + whitespace + '*(\\d+)|))' + whitespace + '*\\)|)', 'i'),
- bool: new RegExp('^(?:' + booleans + ')$', 'i'),
- needsContext: new RegExp('^' + whitespace + '*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(' + whitespace + '*((?:-\\d)?\\d*)' + whitespace + '*\\)|)(?=[^-]|$)', 'i')
- };
- var rinputs = /^(?:input|select|textarea|button)$/i;
- var rheader = /^h\d$/i;
- var rnative = /^[^{]+\{\s*\[native \w/;
- var rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/;
- var rsibling = /[+~]/;
- var rescape = /'|\\/g;
- var runescape = new RegExp('\\\\([\\da-f]{1,6}' + whitespace + '?|(' + whitespace + ')|.)', 'ig');
- var funescape = function (_, escaped, escapedWhitespace) {
- var high = '0x' + escaped - 65536;
- return high !== high || escapedWhitespace ? escaped : high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320);
- };
- try {
- push$1.apply(arr = slice$1.call(preferredDoc.childNodes), preferredDoc.childNodes);
- arr[preferredDoc.childNodes.length].nodeType;
- } catch (e) {
- push$1 = {
- apply: arr.length ? function (target, els) {
- push_native.apply(target, slice$1.call(els));
- } : function (target, els) {
- var j = target.length, i = 0;
- while (target[j++] = els[i++]) {
- }
- target.length = j - 1;
- }
- };
- }
- var Sizzle = function (selector, context, results, seed) {
- var match, elem, m, nodeType, i, groups, old, nid, newContext, newSelector;
- if ((context ? context.ownerDocument || context : preferredDoc) !== document$1) {
- setDocument(context);
- }
- context = context || document$1;
- results = results || [];
- if (!selector || typeof selector !== 'string') {
- return results;
- }
- if ((nodeType = context.nodeType) !== 1 && nodeType !== 9) {
- return [];
- }
- if (documentIsHTML && !seed) {
- if (match = rquickExpr.exec(selector)) {
- if (m = match[1]) {
- if (nodeType === 9) {
- elem = context.getElementById(m);
- if (elem && elem.parentNode) {
- if (elem.id === m) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (documentIsHTML && !seed) {
+ if (match = rquickExpr.exec(selector)) {
+ if (m = match[1]) {
+ if (nodeType === 9) {
+ elem = context.getElementById(m);
+ if (elem && elem.parentNode) {
+ if (elem.id === m) {
+ results.push(elem);
+ return results;
+ }
+ } else {
+ return results;
+ }
+ } else {
+ if (context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) && contains$1(context, elem) && elem.id === m) {
</ins><span class="cx" style="display: block; padding: 0 10px"> results.push(elem);
</span><span class="cx" style="display: block; padding: 0 10px"> return results;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ } else if (match[2]) {
+ push$1.apply(results, context.getElementsByTagName(selector));
+ return results;
+ } else if ((m = match[3]) && support.getElementsByClassName) {
+ push$1.apply(results, context.getElementsByClassName(m));
+ return results;
+ }
+ }
+ if (support.qsa && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
+ nid = old = expando;
+ newContext = context;
+ newSelector = nodeType === 9 && selector;
+ if (nodeType === 1 && context.nodeName.toLowerCase() !== 'object') {
+ groups = tokenize(selector);
+ if (old = context.getAttribute('id')) {
+ nid = old.replace(rescape, '\\$&');
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return results;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ context.setAttribute('id', nid);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- if (context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) && contains$1(context, elem) && elem.id === m) {
- results.push(elem);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ nid = '[id=\'' + nid + '\'] ';
+ i = groups.length;
+ while (i--) {
+ groups[i] = nid + toSelector(groups[i]);
+ }
+ newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
+ newSelector = groups.join(',');
+ }
+ if (newSelector) {
+ try {
+ push$1.apply(results, newContext.querySelectorAll(newSelector));
</ins><span class="cx" style="display: block; padding: 0 10px"> return results;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } catch (qsaError) {
+ } finally {
+ if (!old) {
+ context.removeAttribute('id');
+ }
</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">- } else if (match[2]) {
- push$1.apply(results, context.getElementsByTagName(selector));
- return results;
- } else if ((m = match[3]) && support.getElementsByClassName) {
- push$1.apply(results, context.getElementsByClassName(m));
- return results;
</del><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">- if (support.qsa && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
- nid = old = expando;
- newContext = context;
- newSelector = nodeType === 9 && selector;
- if (nodeType === 1 && context.nodeName.toLowerCase() !== 'object') {
- groups = tokenize(selector);
- if (old = context.getAttribute('id')) {
- nid = old.replace(rescape, '\\$&');
- } else {
- context.setAttribute('id', nid);
- }
- nid = '[id=\'' + nid + '\'] ';
- i = groups.length;
- while (i--) {
- groups[i] = nid + toSelector(groups[i]);
- }
- newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
- newSelector = groups.join(',');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return select(selector.replace(rtrim, '$1'), context, results, seed);
+ };
+ function createCache() {
+ var keys = [];
+ function cache(key, value) {
+ if (keys.push(key + ' ') > Expr.cacheLength) {
+ delete cache[keys.shift()];
</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 (newSelector) {
- try {
- push$1.apply(results, newContext.querySelectorAll(newSelector));
- return results;
- } catch (qsaError) {
- } finally {
- if (!old) {
- context.removeAttribute('id');
- }
- }
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return cache[key + ' '] = value;
</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 cache;
</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 select(selector.replace(rtrim, '$1'), context, results, seed);
- };
- function createCache() {
- var keys = [];
- function cache(key, value) {
- if (keys.push(key + ' ') > Expr.cacheLength) {
- delete cache[keys.shift()];
- }
- return cache[key + ' '] = value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function markFunction(fn) {
+ fn[expando] = true;
+ return fn;
</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 cache;
- }
- function markFunction(fn) {
- fn[expando] = true;
- return fn;
- }
- function siblingCheck(a, b) {
- var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && (~b.sourceIndex || MAX_NEGATIVE) - (~a.sourceIndex || MAX_NEGATIVE);
- if (diff) {
- return diff;
- }
- if (cur) {
- while (cur = cur.nextSibling) {
- if (cur === b) {
- return -1;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function siblingCheck(a, b) {
+ var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && (~b.sourceIndex || MAX_NEGATIVE) - (~a.sourceIndex || MAX_NEGATIVE);
+ if (diff) {
+ return diff;
</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 a ? 1 : -1;
- }
- function createInputPseudo(type) {
- return function (elem) {
- var name$$1 = elem.nodeName.toLowerCase();
- return name$$1 === 'input' && elem.type === type;
- };
- }
- function createButtonPseudo(type) {
- return function (elem) {
- var name$$1 = elem.nodeName.toLowerCase();
- return (name$$1 === 'input' || name$$1 === 'button') && elem.type === type;
- };
- }
- function createPositionalPseudo(fn) {
- return markFunction(function (argument) {
- argument = +argument;
- return markFunction(function (seed, matches) {
- var j, matchIndexes = fn([], seed.length, argument), i = matchIndexes.length;
- while (i--) {
- if (seed[j = matchIndexes[i]]) {
- seed[j] = !(matches[j] = seed[j]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (cur) {
+ while (cur = cur.nextSibling) {
+ if (cur === b) {
+ return -1;
</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">- });
- });
- }
- function testContext(context) {
- return context && typeof context.getElementsByTagName !== strundefined && context;
- }
- support = Sizzle.support = {};
- isXML = Sizzle.isXML = function (elem) {
- var documentElement = elem && (elem.ownerDocument || elem).documentElement;
- return documentElement ? documentElement.nodeName !== 'HTML' : false;
- };
- setDocument = Sizzle.setDocument = function (node) {
- var hasCompare, doc = node ? node.ownerDocument || node : preferredDoc, parent$$1 = doc.defaultView;
- function getTop(win) {
- try {
- return win.top;
- } catch (ex) {
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return a ? 1 : -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 (doc === document$1 || doc.nodeType !== 9 || !doc.documentElement) {
- return document$1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function createInputPseudo(type) {
+ return function (elem) {
+ var name$$1 = elem.nodeName.toLowerCase();
+ return name$$1 === 'input' && elem.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">- document$1 = doc;
- docElem = doc.documentElement;
- documentIsHTML = !isXML(doc);
- if (parent$$1 && parent$$1 !== getTop(parent$$1)) {
- if (parent$$1.addEventListener) {
- parent$$1.addEventListener('unload', function () {
- setDocument();
- }, false);
- } else if (parent$$1.attachEvent) {
- parent$$1.attachEvent('onunload', function () {
- setDocument();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function createButtonPseudo(type) {
+ return function (elem) {
+ var name$$1 = elem.nodeName.toLowerCase();
+ return (name$$1 === 'input' || name$$1 === 'button') && elem.type === type;
+ };
+ }
+ function createPositionalPseudo(fn) {
+ return markFunction(function (argument) {
+ argument = +argument;
+ return markFunction(function (seed, matches) {
+ var j, matchIndexes = fn([], seed.length, argument), i = matchIndexes.length;
+ while (i--) {
+ if (seed[j = matchIndexes[i]]) {
+ seed[j] = !(matches[j] = seed[j]);
+ }
+ }
</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">+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- support.attributes = true;
- support.getElementsByTagName = true;
- support.getElementsByClassName = rnative.test(doc.getElementsByClassName);
- support.getById = true;
- Expr.find.ID = function (id, context) {
- if (typeof context.getElementById !== strundefined && documentIsHTML) {
- var m = context.getElementById(id);
- return m && m.parentNode ? [m] : [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function testContext(context) {
+ return context && typeof context.getElementsByTagName !== strundefined && context;
+ }
+ support = Sizzle.support = {};
+ isXML = Sizzle.isXML = function (elem) {
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+ return documentElement ? documentElement.nodeName !== 'HTML' : false;
+ };
+ setDocument = Sizzle.setDocument = function (node) {
+ var hasCompare, doc = node ? node.ownerDocument || node : preferredDoc, parent$$1 = doc.defaultView;
+ function getTop(win) {
+ try {
+ return win.top;
+ } catch (ex) {
+ }
+ return 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">- };
- Expr.filter.ID = function (id) {
- var attrId = id.replace(runescape, funescape);
- return function (elem) {
- return elem.getAttribute('id') === attrId;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (doc === document$1 || doc.nodeType !== 9 || !doc.documentElement) {
+ return document$1;
+ }
+ document$1 = doc;
+ docElem = doc.documentElement;
+ documentIsHTML = !isXML(doc);
+ if (parent$$1 && parent$$1 !== getTop(parent$$1)) {
+ if (parent$$1.addEventListener) {
+ parent$$1.addEventListener('unload', function () {
+ setDocument();
+ }, false);
+ } else if (parent$$1.attachEvent) {
+ parent$$1.attachEvent('onunload', function () {
+ setDocument();
+ });
+ }
+ }
+ support.attributes = true;
+ support.getElementsByTagName = true;
+ support.getElementsByClassName = rnative.test(doc.getElementsByClassName);
+ support.getById = true;
+ Expr.find.ID = function (id, context) {
+ if (typeof context.getElementById !== strundefined && documentIsHTML) {
+ var m = context.getElementById(id);
+ return m && m.parentNode ? [m] : [];
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Expr.filter.ID = function (id) {
+ var attrId = id.replace(runescape, funescape);
+ return function (elem) {
+ return elem.getAttribute('id') === attrId;
+ };
+ };
+ Expr.find.TAG = support.getElementsByTagName ? function (tag, context) {
+ if (typeof context.getElementsByTagName !== strundefined) {
+ return context.getElementsByTagName(tag);
+ }
+ } : function (tag, context) {
+ var elem, tmp = [], i = 0, results = context.getElementsByTagName(tag);
+ if (tag === '*') {
+ while (elem = results[i++]) {
+ if (elem.nodeType === 1) {
+ tmp.push(elem);
+ }
+ }
+ return tmp;
+ }
+ return results;
+ };
+ Expr.find.CLASS = support.getElementsByClassName && function (className, context) {
+ if (documentIsHTML) {
+ return context.getElementsByClassName(className);
+ }
+ };
+ rbuggyMatches = [];
+ rbuggyQSA = [];
+ support.disconnectedMatch = true;
+ rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join('|'));
+ rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join('|'));
+ hasCompare = rnative.test(docElem.compareDocumentPosition);
+ contains$1 = hasCompare || rnative.test(docElem.contains) ? function (a, b) {
+ var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode;
+ return a === bup || !!(bup && bup.nodeType === 1 && (adown.contains ? adown.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));
+ } : function (a, b) {
+ if (b) {
+ while (b = b.parentNode) {
+ if (b === a) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+ sortOrder = hasCompare ? function (a, b) {
+ if (a === b) {
+ hasDuplicate = true;
+ return 0;
+ }
+ var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
+ if (compare) {
+ return compare;
+ }
+ compare = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1;
+ if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) {
+ if (a === doc || a.ownerDocument === preferredDoc && contains$1(preferredDoc, a)) {
+ return -1;
+ }
+ if (b === doc || b.ownerDocument === preferredDoc && contains$1(preferredDoc, b)) {
+ return 1;
+ }
+ return sortInput ? indexOf$1.call(sortInput, a) - indexOf$1.call(sortInput, b) : 0;
+ }
+ return compare & 4 ? -1 : 1;
+ } : function (a, b) {
+ if (a === b) {
+ hasDuplicate = true;
+ return 0;
+ }
+ var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [a], bp = [b];
+ if (!aup || !bup) {
+ return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? indexOf$1.call(sortInput, a) - indexOf$1.call(sortInput, b) : 0;
+ } else if (aup === bup) {
+ return siblingCheck(a, b);
+ }
+ cur = a;
+ while (cur = cur.parentNode) {
+ ap.unshift(cur);
+ }
+ cur = b;
+ while (cur = cur.parentNode) {
+ bp.unshift(cur);
+ }
+ while (ap[i] === bp[i]) {
+ i++;
+ }
+ return i ? siblingCheck(ap[i], bp[i]) : ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0;
+ };
+ return doc;
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- Expr.find.TAG = support.getElementsByTagName ? function (tag, context) {
- if (typeof context.getElementsByTagName !== strundefined) {
- return context.getElementsByTagName(tag);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Sizzle.matches = function (expr, elements) {
+ return Sizzle(expr, null, null, elements);
+ };
+ Sizzle.matchesSelector = function (elem, expr) {
+ if ((elem.ownerDocument || elem) !== document$1) {
+ setDocument(elem);
</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 (tag, context) {
- var elem, tmp = [], i = 0, results = context.getElementsByTagName(tag);
- if (tag === '*') {
- while (elem = results[i++]) {
- if (elem.nodeType === 1) {
- tmp.push(elem);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ expr = expr.replace(rattributeQuotes, '=\'$1\']');
+ if (support.matchesSelector && documentIsHTML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && (!rbuggyQSA || !rbuggyQSA.test(expr))) {
+ try {
+ var ret = matches.call(elem, expr);
+ if (ret || support.disconnectedMatch || elem.document && elem.document.nodeType !== 11) {
+ return ret;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } catch (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">- return tmp;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return results;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Sizzle(expr, document$1, null, [elem]).length > 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">- Expr.find.CLASS = support.getElementsByClassName && function (className, context) {
- if (documentIsHTML) {
- return context.getElementsByClassName(className);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Sizzle.contains = function (context, elem) {
+ if ((context.ownerDocument || context) !== document$1) {
+ setDocument(context);
</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 contains$1(context, elem);
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- rbuggyMatches = [];
- rbuggyQSA = [];
- support.disconnectedMatch = true;
- rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join('|'));
- rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join('|'));
- hasCompare = rnative.test(docElem.compareDocumentPosition);
- contains$1 = hasCompare || rnative.test(docElem.contains) ? function (a, b) {
- var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode;
- return a === bup || !!(bup && bup.nodeType === 1 && (adown.contains ? adown.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));
- } : function (a, b) {
- if (b) {
- while (b = b.parentNode) {
- if (b === a) {
- return true;
- }
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Sizzle.attr = function (elem, name$$1) {
+ if ((elem.ownerDocument || elem) !== document$1) {
+ setDocument(elem);
</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">+ var fn = Expr.attrHandle[name$$1.toLowerCase()], val = fn && hasOwn.call(Expr.attrHandle, name$$1.toLowerCase()) ? fn(elem, name$$1, !documentIsHTML) : undefined;
+ return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute(name$$1) : (val = elem.getAttributeNode(name$$1)) && val.specified ? val.value : 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">- sortOrder = hasCompare ? function (a, b) {
- if (a === b) {
- hasDuplicate = true;
- return 0;
- }
- var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
- if (compare) {
- return compare;
- }
- compare = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1;
- if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) {
- if (a === doc || a.ownerDocument === preferredDoc && contains$1(preferredDoc, a)) {
- return -1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Sizzle.error = function (msg) {
+ throw new Error('Syntax error, unrecognized expression: ' + msg);
+ };
+ Sizzle.uniqueSort = function (results) {
+ var elem, duplicates = [], j = 0, i = 0;
+ hasDuplicate = !support.detectDuplicates;
+ sortInput = !support.sortStable && results.slice(0);
+ results.sort(sortOrder);
+ if (hasDuplicate) {
+ while (elem = results[i++]) {
+ if (elem === results[i]) {
+ j = duplicates.push(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 (b === doc || b.ownerDocument === preferredDoc && contains$1(preferredDoc, b)) {
- return 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ while (j--) {
+ results.splice(duplicates[j], 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 sortInput ? indexOf$1.call(sortInput, a) - indexOf$1.call(sortInput, b) : 0;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return compare & 4 ? -1 : 1;
- } : function (a, b) {
- if (a === b) {
- hasDuplicate = true;
- return 0;
- }
- var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [a], bp = [b];
- if (!aup || !bup) {
- return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? indexOf$1.call(sortInput, a) - indexOf$1.call(sortInput, b) : 0;
- } else if (aup === bup) {
- return siblingCheck(a, b);
- }
- cur = a;
- while (cur = cur.parentNode) {
- ap.unshift(cur);
- }
- cur = b;
- while (cur = cur.parentNode) {
- bp.unshift(cur);
- }
- while (ap[i] === bp[i]) {
- i++;
- }
- return i ? siblingCheck(ap[i], bp[i]) : ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ sortInput = null;
+ return results;
</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 doc;
- };
- Sizzle.matches = function (expr, elements) {
- return Sizzle(expr, null, null, elements);
- };
- Sizzle.matchesSelector = function (elem, expr) {
- if ((elem.ownerDocument || elem) !== document$1) {
- setDocument(elem);
- }
- expr = expr.replace(rattributeQuotes, '=\'$1\']');
- if (support.matchesSelector && documentIsHTML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && (!rbuggyQSA || !rbuggyQSA.test(expr))) {
- try {
- var ret = matches.call(elem, expr);
- if (ret || support.disconnectedMatch || elem.document && elem.document.nodeType !== 11) {
- return ret;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ getText = Sizzle.getText = function (elem) {
+ var node, ret = '', i = 0, nodeType = elem.nodeType;
+ if (!nodeType) {
+ while (node = elem[i++]) {
+ ret += getText(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">- } catch (e) {
- }
- }
- return Sizzle(expr, document$1, null, [elem]).length > 0;
- };
- Sizzle.contains = function (context, elem) {
- if ((context.ownerDocument || context) !== document$1) {
- setDocument(context);
- }
- return contains$1(context, elem);
- };
- Sizzle.attr = function (elem, name$$1) {
- if ((elem.ownerDocument || elem) !== document$1) {
- setDocument(elem);
- }
- var fn = Expr.attrHandle[name$$1.toLowerCase()], val = fn && hasOwn.call(Expr.attrHandle, name$$1.toLowerCase()) ? fn(elem, name$$1, !documentIsHTML) : undefined;
- return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute(name$$1) : (val = elem.getAttributeNode(name$$1)) && val.specified ? val.value : null;
- };
- Sizzle.error = function (msg) {
- throw new Error('Syntax error, unrecognized expression: ' + msg);
- };
- Sizzle.uniqueSort = function (results) {
- var elem, duplicates = [], j = 0, i = 0;
- hasDuplicate = !support.detectDuplicates;
- sortInput = !support.sortStable && results.slice(0);
- results.sort(sortOrder);
- if (hasDuplicate) {
- while (elem = results[i++]) {
- if (elem === results[i]) {
- j = duplicates.push(i);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
+ if (typeof elem.textContent === 'string') {
+ return elem.textContent;
+ } else {
+ for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
+ ret += getText(elem);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if (nodeType === 3 || nodeType === 4) {
+ return elem.nodeValue;
</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 (j--) {
- results.splice(duplicates[j], 1);
- }
- }
- sortInput = null;
- return results;
- };
- getText = Sizzle.getText = function (elem) {
- var node, ret = '', i = 0, nodeType = elem.nodeType;
- if (!nodeType) {
- while (node = elem[i++]) {
- ret += getText(node);
- }
- } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
- if (typeof elem.textContent === 'string') {
- return elem.textContent;
- } else {
- for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
- ret += getText(elem);
- }
- }
- } else if (nodeType === 3 || nodeType === 4) {
- return elem.nodeValue;
- }
- return ret;
- };
- Expr = Sizzle.selectors = {
- cacheLength: 50,
- createPseudo: markFunction,
- match: matchExpr,
- attrHandle: {},
- find: {},
- relative: {
- '>': {
- dir: 'parentNode',
- first: true
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ret;
+ };
+ Expr = Sizzle.selectors = {
+ cacheLength: 50,
+ createPseudo: markFunction,
+ match: matchExpr,
+ attrHandle: {},
+ find: {},
+ relative: {
+ '>': {
+ dir: 'parentNode',
+ first: true
+ },
+ ' ': { dir: 'parentNode' },
+ '+': {
+ dir: 'previousSibling',
+ first: true
+ },
+ '~': { dir: 'previousSibling' }
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ' ': { dir: 'parentNode' },
- '+': {
- dir: 'previousSibling',
- first: true
- },
- '~': { dir: 'previousSibling' }
- },
- preFilter: {
- ATTR: function (match) {
- match[1] = match[1].replace(runescape, funescape);
- match[3] = (match[3] || match[4] || match[5] || '').replace(runescape, funescape);
- if (match[2] === '~=') {
- match[3] = ' ' + match[3] + ' ';
- }
- return match.slice(0, 4);
- },
- CHILD: function (match) {
- match[1] = match[1].toLowerCase();
- if (match[1].slice(0, 3) === 'nth') {
- if (!match[3]) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ preFilter: {
+ ATTR: function (match) {
+ match[1] = match[1].replace(runescape, funescape);
+ match[3] = (match[3] || match[4] || match[5] || '').replace(runescape, funescape);
+ if (match[2] === '~=') {
+ match[3] = ' ' + match[3] + ' ';
+ }
+ return match.slice(0, 4);
+ },
+ CHILD: function (match) {
+ match[1] = match[1].toLowerCase();
+ if (match[1].slice(0, 3) === 'nth') {
+ if (!match[3]) {
+ Sizzle.error(match[0]);
+ }
+ match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === 'even' || match[3] === 'odd'));
+ match[5] = +(match[7] + match[8] || match[3] === 'odd');
+ } else if (match[3]) {
</ins><span class="cx" style="display: block; padding: 0 10px"> Sizzle.error(match[0]);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === 'even' || match[3] === 'odd'));
- match[5] = +(match[7] + match[8] || match[3] === 'odd');
- } else if (match[3]) {
- Sizzle.error(match[0]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return match;
+ },
+ PSEUDO: function (match) {
+ var excess, unquoted = !match[6] && match[2];
+ if (matchExpr.CHILD.test(match[0])) {
+ return null;
+ }
+ if (match[3]) {
+ match[2] = match[4] || match[5] || '';
+ } else if (unquoted && rpseudo.test(unquoted) && (excess = tokenize(unquoted, true)) && (excess = unquoted.indexOf(')', unquoted.length - excess) - unquoted.length)) {
+ match[0] = match[0].slice(0, excess);
+ match[2] = unquoted.slice(0, excess);
+ }
+ return match.slice(0, 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">- return match;
</del><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- PSEUDO: function (match) {
- var excess, unquoted = !match[6] && match[2];
- if (matchExpr.CHILD.test(match[0])) {
- return null;
- }
- if (match[3]) {
- match[2] = match[4] || match[5] || '';
- } else if (unquoted && rpseudo.test(unquoted) && (excess = tokenize(unquoted, true)) && (excess = unquoted.indexOf(')', unquoted.length - excess) - unquoted.length)) {
- match[0] = match[0].slice(0, excess);
- match[2] = unquoted.slice(0, excess);
- }
- return match.slice(0, 3);
- }
- },
- filter: {
- TAG: function (nodeNameSelector) {
- var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
- return nodeNameSelector === '*' ? function () {
- return true;
- } : function (elem) {
- return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
- };
- },
- CLASS: function (className) {
- var pattern = classCache[className + ' '];
- return pattern || (pattern = new RegExp('(^|' + whitespace + ')' + className + '(' + whitespace + '|$)')) && classCache(className, function (elem) {
- return pattern.test(typeof elem.className === 'string' && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute('class') || '');
- });
- },
- ATTR: function (name$$1, operator, check) {
- return function (elem) {
- var result = Sizzle.attr(elem, name$$1);
- if (result == null) {
- return operator === '!=';
- }
- if (!operator) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ filter: {
+ TAG: function (nodeNameSelector) {
+ var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
+ return nodeNameSelector === '*' ? function () {
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- result += '';
- return operator === '=' ? result === check : operator === '!=' ? result !== check : operator === '^=' ? check && result.indexOf(check) === 0 : operator === '*=' ? check && result.indexOf(check) > -1 : operator === '$=' ? check && result.slice(-check.length) === check : operator === '~=' ? (' ' + result + ' ').indexOf(check) > -1 : operator === '|=' ? result === check || result.slice(0, check.length + 1) === check + '-' : false;
- };
- },
- CHILD: function (type, what, argument, first, last) {
- var simple = type.slice(0, 3) !== 'nth', forward = type.slice(-4) !== 'last', ofType = what === 'of-type';
- return first === 1 && last === 0 ? function (elem) {
- return !!elem.parentNode;
- } : function (elem, context, xml) {
- var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? 'nextSibling' : 'previousSibling', parent$$1 = elem.parentNode, name$$1 = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType;
- if (parent$$1) {
- if (simple) {
- while (dir) {
- node = elem;
- while (node = node[dir]) {
- if (ofType ? node.nodeName.toLowerCase() === name$$1 : node.nodeType === 1) {
- return false;
- }
- }
- start = dir = type === 'only' && !start && 'nextSibling';
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } : function (elem) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+ };
+ },
+ CLASS: function (className) {
+ var pattern = classCache[className + ' '];
+ return pattern || (pattern = new RegExp('(^|' + whitespace + ')' + className + '(' + whitespace + '|$)')) && classCache(className, function (elem) {
+ return pattern.test(typeof elem.className === 'string' && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute('class') || '');
+ });
+ },
+ ATTR: function (name$$1, operator, check) {
+ return function (elem) {
+ var result = Sizzle.attr(elem, name$$1);
+ if (result == null) {
+ return operator === '!=';
+ }
+ if (!operator) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- start = [forward ? parent$$1.firstChild : parent$$1.lastChild];
- if (forward && useCache) {
- outerCache = parent$$1[expando] || (parent$$1[expando] = {});
- cache = outerCache[type] || [];
- nodeIndex = cache[0] === dirruns && cache[1];
- diff = cache[0] === dirruns && cache[2];
- node = nodeIndex && parent$$1.childNodes[nodeIndex];
- while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) {
- if (node.nodeType === 1 && ++diff && node === elem) {
- outerCache[type] = [
- dirruns,
- nodeIndex,
- diff
- ];
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ result += '';
+ return operator === '=' ? result === check : operator === '!=' ? result !== check : operator === '^=' ? check && result.indexOf(check) === 0 : operator === '*=' ? check && result.indexOf(check) > -1 : operator === '$=' ? check && result.slice(-check.length) === check : operator === '~=' ? (' ' + result + ' ').indexOf(check) > -1 : operator === '|=' ? result === check || result.slice(0, check.length + 1) === check + '-' : false;
+ };
+ },
+ CHILD: function (type, what, argument, first, last) {
+ var simple = type.slice(0, 3) !== 'nth', forward = type.slice(-4) !== 'last', ofType = what === 'of-type';
+ return first === 1 && last === 0 ? function (elem) {
+ return !!elem.parentNode;
+ } : function (elem, context, xml) {
+ var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? 'nextSibling' : 'previousSibling', parent$$1 = elem.parentNode, name$$1 = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType;
+ if (parent$$1) {
+ if (simple) {
+ while (dir) {
+ node = elem;
+ while (node = node[dir]) {
+ if (ofType ? node.nodeName.toLowerCase() === name$$1 : node.nodeType === 1) {
+ return false;
+ }
+ }
+ start = dir = type === 'only' && !start && 'nextSibling';
</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 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">- } else if (useCache && (cache = (elem[expando] || (elem[expando] = {}))[type]) && cache[0] === dirruns) {
- diff = cache[1];
- } else {
- while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) {
- if ((ofType ? node.nodeName.toLowerCase() === name$$1 : node.nodeType === 1) && ++diff) {
- if (useCache) {
- (node[expando] || (node[expando] = {}))[type] = [
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ start = [forward ? parent$$1.firstChild : parent$$1.lastChild];
+ if (forward && useCache) {
+ outerCache = parent$$1[expando] || (parent$$1[expando] = {});
+ cache = outerCache[type] || [];
+ nodeIndex = cache[0] === dirruns && cache[1];
+ diff = cache[0] === dirruns && cache[2];
+ node = nodeIndex && parent$$1.childNodes[nodeIndex];
+ while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) {
+ if (node.nodeType === 1 && ++diff && node === elem) {
+ outerCache[type] = [
</ins><span class="cx" style="display: block; padding: 0 10px"> dirruns,
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ nodeIndex,
</ins><span class="cx" style="display: block; padding: 0 10px"> diff
</span><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 === elem) {
</del><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if (useCache && (cache = (elem[expando] || (elem[expando] = {}))[type]) && cache[0] === dirruns) {
+ diff = cache[1];
+ } else {
+ while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) {
+ if ((ofType ? node.nodeName.toLowerCase() === name$$1 : node.nodeType === 1) && ++diff) {
+ if (useCache) {
+ (node[expando] || (node[expando] = {}))[type] = [
+ dirruns,
+ diff
+ ];
+ }
+ if (node === elem) {
+ break;
+ }
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ diff -= last;
+ return diff === first || diff % first === 0 && diff / first >= 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">- diff -= last;
- return diff === first || diff % first === 0 && diff / first >= 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ },
+ PSEUDO: function (pseudo, argument) {
+ var args, fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error('unsupported pseudo: ' + pseudo);
+ if (fn[expando]) {
+ return fn(argument);
</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">+ if (fn.length > 1) {
+ args = [
+ pseudo,
+ pseudo,
+ '',
+ argument
+ ];
+ return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function (seed, matches) {
+ var idx, matched = fn(seed, argument), i = matched.length;
+ while (i--) {
+ idx = indexOf$1.call(seed, matched[i]);
+ seed[idx] = !(matches[idx] = matched[i]);
+ }
+ }) : function (elem) {
+ return fn(elem, 0, args);
+ };
+ }
+ return fn;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- PSEUDO: function (pseudo, argument) {
- var args, fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error('unsupported pseudo: ' + pseudo);
- if (fn[expando]) {
- return fn(argument);
- }
- if (fn.length > 1) {
- args = [
- pseudo,
- pseudo,
- '',
- argument
- ];
- return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function (seed, matches) {
- var idx, matched = fn(seed, argument), i = matched.length;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ pseudos: {
+ not: markFunction(function (selector) {
+ var input = [], results = [], matcher = compile(selector.replace(rtrim, '$1'));
+ return matcher[expando] ? markFunction(function (seed, matches, context, xml) {
+ var elem, unmatched = matcher(seed, null, xml, []), i = seed.length;
</ins><span class="cx" style="display: block; padding: 0 10px"> while (i--) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- idx = indexOf$1.call(seed, matched[i]);
- seed[idx] = !(matches[idx] = matched[i]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (elem = unmatched[i]) {
+ seed[i] = !(matches[i] = elem);
+ }
</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 (elem) {
- return fn(elem, 0, args);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }) : function (elem, context, xml) {
+ input[0] = elem;
+ matcher(input, null, xml, results);
+ return !results.pop();
</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 fn;
- }
- },
- pseudos: {
- not: markFunction(function (selector) {
- var input = [], results = [], matcher = compile(selector.replace(rtrim, '$1'));
- return matcher[expando] ? markFunction(function (seed, matches, context, xml) {
- var elem, unmatched = matcher(seed, null, xml, []), i = seed.length;
- while (i--) {
- if (elem = unmatched[i]) {
- seed[i] = !(matches[i] = elem);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }),
+ has: markFunction(function (selector) {
+ return function (elem) {
+ return Sizzle(selector, elem).length > 0;
+ };
+ }),
+ contains: markFunction(function (text) {
+ text = text.replace(runescape, funescape);
+ return function (elem) {
+ return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1;
+ };
+ }),
+ lang: markFunction(function (lang) {
+ if (!ridentifier.test(lang || '')) {
+ Sizzle.error('unsupported lang: ' + lang);
</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 (elem, context, xml) {
- input[0] = elem;
- matcher(input, null, xml, results);
- return !results.pop();
- };
- }),
- has: markFunction(function (selector) {
- return function (elem) {
- return Sizzle(selector, elem).length > 0;
- };
- }),
- contains: markFunction(function (text) {
- text = text.replace(runescape, funescape);
- return function (elem) {
- return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1;
- };
- }),
- lang: markFunction(function (lang) {
- if (!ridentifier.test(lang || '')) {
- Sizzle.error('unsupported lang: ' + lang);
- }
- lang = lang.replace(runescape, funescape).toLowerCase();
- return function (elem) {
- var elemLang;
- do {
- if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute('xml:lang') || elem.getAttribute('lang')) {
- elemLang = elemLang.toLowerCase();
- return elemLang === lang || elemLang.indexOf(lang + '-') === 0;
- }
- } while ((elem = elem.parentNode) && elem.nodeType === 1);
- return false;
- };
- }),
- target: function (elem) {
- var hash = window.location && window.location.hash;
- return hash && hash.slice(1) === elem.id;
- },
- root: function (elem) {
- return elem === docElem;
- },
- focus: function (elem) {
- return elem === document$1.activeElement && (!document$1.hasFocus || document$1.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
- },
- enabled: function (elem) {
- return elem.disabled === false;
- },
- disabled: function (elem) {
- return elem.disabled === true;
- },
- checked: function (elem) {
- var nodeName = elem.nodeName.toLowerCase();
- return nodeName === 'input' && !!elem.checked || nodeName === 'option' && !!elem.selected;
- },
- selected: function (elem) {
- if (elem.parentNode) {
- elem.parentNode.selectedIndex;
- }
- return elem.selected === true;
- },
- empty: function (elem) {
- for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
- if (elem.nodeType < 6) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ lang = lang.replace(runescape, funescape).toLowerCase();
+ return function (elem) {
+ var elemLang;
+ do {
+ if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute('xml:lang') || elem.getAttribute('lang')) {
+ elemLang = elemLang.toLowerCase();
+ return elemLang === lang || elemLang.indexOf(lang + '-') === 0;
+ }
+ } while ((elem = elem.parentNode) && elem.nodeType === 1);
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ }),
+ target: function (elem) {
+ var hash = window.location && window.location.hash;
+ return hash && hash.slice(1) === elem.id;
+ },
+ root: function (elem) {
+ return elem === docElem;
+ },
+ focus: function (elem) {
+ return elem === document$1.activeElement && (!document$1.hasFocus || document$1.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+ },
+ enabled: function (elem) {
+ return elem.disabled === false;
+ },
+ disabled: function (elem) {
+ return elem.disabled === true;
+ },
+ checked: function (elem) {
+ var nodeName = elem.nodeName.toLowerCase();
+ return nodeName === 'input' && !!elem.checked || nodeName === 'option' && !!elem.selected;
+ },
+ selected: function (elem) {
+ if (elem.parentNode) {
+ elem.parentNode.selectedIndex;
</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;
- },
- parent: function (elem) {
- return !Expr.pseudos.empty(elem);
- },
- header: function (elem) {
- return rheader.test(elem.nodeName);
- },
- input: function (elem) {
- return rinputs.test(elem.nodeName);
- },
- button: function (elem) {
- var name$$1 = elem.nodeName.toLowerCase();
- return name$$1 === 'input' && elem.type === 'button' || name$$1 === 'button';
- },
- text: function (elem) {
- var attr;
- return elem.nodeName.toLowerCase() === 'input' && elem.type === 'text' && ((attr = elem.getAttribute('type')) == null || attr.toLowerCase() === 'text');
- },
- first: createPositionalPseudo(function () {
- return [0];
- }),
- last: createPositionalPseudo(function (matchIndexes, length$$1) {
- return [length$$1 - 1];
- }),
- eq: createPositionalPseudo(function (matchIndexes, length$$1, argument) {
- return [argument < 0 ? argument + length$$1 : argument];
- }),
- even: createPositionalPseudo(function (matchIndexes, length$$1) {
- var i = 0;
- for (; i < length$$1; i += 2) {
- matchIndexes.push(i);
- }
- return matchIndexes;
- }),
- odd: createPositionalPseudo(function (matchIndexes, length$$1) {
- var i = 1;
- for (; i < length$$1; i += 2) {
- matchIndexes.push(i);
- }
- return matchIndexes;
- }),
- lt: createPositionalPseudo(function (matchIndexes, length$$1, argument) {
- var i = argument < 0 ? argument + length$$1 : argument;
- for (; --i >= 0;) {
- matchIndexes.push(i);
- }
- return matchIndexes;
- }),
- gt: createPositionalPseudo(function (matchIndexes, length$$1, argument) {
- var i = argument < 0 ? argument + length$$1 : argument;
- for (; ++i < length$$1;) {
- matchIndexes.push(i);
- }
- return matchIndexes;
- })
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return elem.selected === true;
+ },
+ empty: function (elem) {
+ for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
+ if (elem.nodeType < 6) {
+ return false;
+ }
+ }
+ return true;
+ },
+ parent: function (elem) {
+ return !Expr.pseudos.empty(elem);
+ },
+ header: function (elem) {
+ return rheader.test(elem.nodeName);
+ },
+ input: function (elem) {
+ return rinputs.test(elem.nodeName);
+ },
+ button: function (elem) {
+ var name$$1 = elem.nodeName.toLowerCase();
+ return name$$1 === 'input' && elem.type === 'button' || name$$1 === 'button';
+ },
+ text: function (elem) {
+ var attr;
+ return elem.nodeName.toLowerCase() === 'input' && elem.type === 'text' && ((attr = elem.getAttribute('type')) == null || attr.toLowerCase() === 'text');
+ },
+ first: createPositionalPseudo(function () {
+ return [0];
+ }),
+ last: createPositionalPseudo(function (matchIndexes, length$$1) {
+ return [length$$1 - 1];
+ }),
+ eq: createPositionalPseudo(function (matchIndexes, length$$1, argument) {
+ return [argument < 0 ? argument + length$$1 : argument];
+ }),
+ even: createPositionalPseudo(function (matchIndexes, length$$1) {
+ var i = 0;
+ for (; i < length$$1; i += 2) {
+ matchIndexes.push(i);
+ }
+ return matchIndexes;
+ }),
+ odd: createPositionalPseudo(function (matchIndexes, length$$1) {
+ var i = 1;
+ for (; i < length$$1; i += 2) {
+ matchIndexes.push(i);
+ }
+ return matchIndexes;
+ }),
+ lt: createPositionalPseudo(function (matchIndexes, length$$1, argument) {
+ var i = argument < 0 ? argument + length$$1 : argument;
+ for (; --i >= 0;) {
+ matchIndexes.push(i);
+ }
+ return matchIndexes;
+ }),
+ gt: createPositionalPseudo(function (matchIndexes, length$$1, argument) {
+ var i = argument < 0 ? argument + length$$1 : argument;
+ for (; ++i < length$$1;) {
+ matchIndexes.push(i);
+ }
+ return matchIndexes;
+ })
+ }
+ };
+ Expr.pseudos.nth = Expr.pseudos.eq;
+ for (i in {
+ radio: true,
+ checkbox: true,
+ file: true,
+ password: true,
+ image: true
+ }) {
+ Expr.pseudos[i] = createInputPseudo(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">- };
- Expr.pseudos.nth = Expr.pseudos.eq;
- for (i in {
- radio: true,
- checkbox: true,
- file: true,
- password: true,
- image: true
- }) {
- Expr.pseudos[i] = createInputPseudo(i);
- }
- for (i in {
- submit: true,
- reset: true
- }) {
- Expr.pseudos[i] = createButtonPseudo(i);
- }
- function setFilters() {
- }
- setFilters.prototype = Expr.filters = Expr.pseudos;
- Expr.setFilters = new setFilters();
- tokenize = Sizzle.tokenize = function (selector, parseOnly) {
- var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + ' '];
- if (cached) {
- return parseOnly ? 0 : cached.slice(0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (i in {
+ submit: true,
+ reset: true
+ }) {
+ Expr.pseudos[i] = createButtonPseudo(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">- soFar = selector;
- groups = [];
- preFilters = Expr.preFilter;
- while (soFar) {
- if (!matched || (match = rcomma.exec(soFar))) {
- if (match) {
- soFar = soFar.slice(match[0].length) || soFar;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function setFilters() {
+ }
+ setFilters.prototype = Expr.filters = Expr.pseudos;
+ Expr.setFilters = new setFilters();
+ tokenize = Sizzle.tokenize = function (selector, parseOnly) {
+ var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + ' '];
+ if (cached) {
+ return parseOnly ? 0 : cached.slice(0);
+ }
+ soFar = selector;
+ groups = [];
+ preFilters = Expr.preFilter;
+ while (soFar) {
+ if (!matched || (match = rcomma.exec(soFar))) {
+ if (match) {
+ soFar = soFar.slice(match[0].length) || soFar;
+ }
+ groups.push(tokens = []);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- groups.push(tokens = []);
- }
- matched = false;
- if (match = rcombinators.exec(soFar)) {
- matched = match.shift();
- tokens.push({
- value: matched,
- type: match[0].replace(rtrim, ' ')
- });
- soFar = soFar.slice(matched.length);
- }
- for (type in Expr.filter) {
- if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ matched = false;
+ if (match = rcombinators.exec(soFar)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> matched = match.shift();
</span><span class="cx" style="display: block; padding: 0 10px"> tokens.push({
</span><span class="cx" style="display: block; padding: 0 10px"> value: matched,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- type: type,
- matches: match
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ type: match[0].replace(rtrim, ' ')
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> soFar = soFar.slice(matched.length);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (type in Expr.filter) {
+ if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ type: type,
+ matches: match
+ });
+ soFar = soFar.slice(matched.length);
+ }
+ }
+ if (!matched) {
+ break;
+ }
</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 (!matched) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) : tokenCache(selector, groups).slice(0);
+ };
+ function toSelector(tokens) {
+ var i = 0, len = tokens.length, selector = '';
+ for (; i < len; i++) {
+ selector += tokens[i].value;
</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 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">- return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) : tokenCache(selector, groups).slice(0);
- };
- function toSelector(tokens) {
- var i = 0, len = tokens.length, selector = '';
- for (; i < len; i++) {
- selector += tokens[i].value;
- }
- return selector;
- }
- function addCombinator(matcher, combinator, base) {
- var dir = combinator.dir, checkNonElements = base && dir === 'parentNode', doneName = done++;
- return combinator.first ? function (elem, context, xml) {
- while (elem = elem[dir]) {
- if (elem.nodeType === 1 || checkNonElements) {
- return matcher(elem, context, xml);
- }
- }
- } : function (elem, context, xml) {
- var oldCache, outerCache, newCache = [
- dirruns,
- doneName
- ];
- if (xml) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function addCombinator(matcher, combinator, base) {
+ var dir = combinator.dir, checkNonElements = base && dir === 'parentNode', doneName = done++;
+ return combinator.first ? function (elem, context, xml) {
</ins><span class="cx" style="display: block; padding: 0 10px"> while (elem = elem[dir]) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (elem.nodeType === 1 || checkNonElements) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (matcher(elem, context, xml)) {
- return true;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return matcher(elem, context, xml);
</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">- } else {
- while (elem = elem[dir]) {
- if (elem.nodeType === 1 || checkNonElements) {
- outerCache = elem[expando] || (elem[expando] = {});
- if ((oldCache = outerCache[dir]) && oldCache[0] === dirruns && oldCache[1] === doneName) {
- return newCache[2] = oldCache[2];
- } else {
- outerCache[dir] = newCache;
- if (newCache[2] = matcher(elem, context, xml)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } : function (elem, context, xml) {
+ var oldCache, outerCache, newCache = [
+ dirruns,
+ doneName
+ ];
+ if (xml) {
+ while (elem = elem[dir]) {
+ if (elem.nodeType === 1 || checkNonElements) {
+ if (matcher(elem, context, xml)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ while (elem = elem[dir]) {
+ if (elem.nodeType === 1 || checkNonElements) {
+ outerCache = elem[expando] || (elem[expando] = {});
+ if ((oldCache = outerCache[dir]) && oldCache[0] === dirruns && oldCache[1] === doneName) {
+ return newCache[2] = oldCache[2];
+ } else {
+ outerCache[dir] = newCache;
+ if (newCache[2] = matcher(elem, context, xml)) {
+ 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">- }
- };
- }
- function elementMatcher(matchers) {
- return matchers.length > 1 ? function (elem, context, xml) {
- var i = matchers.length;
- while (i--) {
- if (!matchers[i](elem, context, xml)) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ }
+ function elementMatcher(matchers) {
+ return matchers.length > 1 ? function (elem, context, xml) {
+ var i = matchers.length;
+ while (i--) {
+ if (!matchers[i](elem, context, xml)) {
+ return false;
+ }
</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 true;
+ } : matchers[0];
+ }
+ function multipleContexts(selector, contexts, results) {
+ var i = 0, len = contexts.length;
+ for (; i < len; i++) {
+ Sizzle(selector, contexts[i], results);
</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;
- } : matchers[0];
- }
- function multipleContexts(selector, contexts, results) {
- var i = 0, len = contexts.length;
- for (; i < len; i++) {
- Sizzle(selector, contexts[i], results);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return results;
</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 results;
- }
- function condense(unmatched, map, filter, context, xml) {
- var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null;
- for (; i < len; i++) {
- if (elem = unmatched[i]) {
- if (!filter || filter(elem, context, xml)) {
- newUnmatched.push(elem);
- if (mapped) {
- map.push(i);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function condense(unmatched, map, filter, context, xml) {
+ var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null;
+ for (; i < len; i++) {
+ if (elem = unmatched[i]) {
+ if (!filter || filter(elem, context, xml)) {
+ newUnmatched.push(elem);
+ if (mapped) {
+ map.push(i);
+ }
</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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return newUnmatched;
</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 newUnmatched;
- }
- function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
- if (postFilter && !postFilter[expando]) {
- postFilter = setMatcher(postFilter);
- }
- if (postFinder && !postFinder[expando]) {
- postFinder = setMatcher(postFinder, postSelector);
- }
- return markFunction(function (seed, results, context, xml) {
- var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts(selector || '*', context.nodeType ? [context] : context, []), matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems, matcherOut = matcher ? postFinder || (seed ? preFilter : preexisting || postFilter) ? [] : results : matcherIn;
- if (matcher) {
- matcher(matcherIn, matcherOut, context, xml);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
+ if (postFilter && !postFilter[expando]) {
+ postFilter = setMatcher(postFilter);
</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 (postFilter) {
- temp = condense(matcherOut, postMap);
- postFilter(temp, [], context, xml);
- i = temp.length;
- while (i--) {
- if (elem = temp[i]) {
- matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (postFinder && !postFinder[expando]) {
+ postFinder = setMatcher(postFinder, postSelector);
+ }
+ return markFunction(function (seed, results, context, xml) {
+ var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts(selector || '*', context.nodeType ? [context] : context, []), matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems, matcherOut = matcher ? postFinder || (seed ? preFilter : preexisting || postFilter) ? [] : results : matcherIn;
+ if (matcher) {
+ matcher(matcherIn, matcherOut, context, xml);
+ }
+ if (postFilter) {
+ temp = condense(matcherOut, postMap);
+ postFilter(temp, [], context, xml);
+ i = temp.length;
+ while (i--) {
+ if (elem = temp[i]) {
+ matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem);
+ }
</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">- }
- if (seed) {
- if (postFinder || preFilter) {
- if (postFinder) {
- temp = [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (seed) {
+ if (postFinder || preFilter) {
+ if (postFinder) {
+ temp = [];
+ i = matcherOut.length;
+ while (i--) {
+ if (elem = matcherOut[i]) {
+ temp.push(matcherIn[i] = elem);
+ }
+ }
+ postFinder(null, matcherOut = [], temp, xml);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> i = matcherOut.length;
</span><span class="cx" style="display: block; padding: 0 10px"> while (i--) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (elem = matcherOut[i]) {
- temp.push(matcherIn[i] = elem);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ((elem = matcherOut[i]) && (temp = postFinder ? indexOf$1.call(seed, elem) : preMap[i]) > -1) {
+ seed[temp] = !(results[temp] = elem);
</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">- postFinder(null, matcherOut = [], temp, xml);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- i = matcherOut.length;
- while (i--) {
- if ((elem = matcherOut[i]) && (temp = postFinder ? indexOf$1.call(seed, elem) : preMap[i]) > -1) {
- seed[temp] = !(results[temp] = elem);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut);
+ if (postFinder) {
+ postFinder(null, results, matcherOut, xml);
+ } else {
+ push$1.apply(results, matcherOut);
</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">- } else {
- matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut);
- if (postFinder) {
- postFinder(null, results, matcherOut, xml);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ }
+ function matcherFromTokens(tokens) {
+ var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[' '], i = leadingRelative ? 1 : 0, matchContext = addCombinator(function (elem) {
+ return elem === checkContext;
+ }, implicitRelative, true), matchAnyContext = addCombinator(function (elem) {
+ return indexOf$1.call(checkContext, elem) > -1;
+ }, implicitRelative, true), matchers = [function (elem, context, xml) {
+ return !leadingRelative && (xml || context !== outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml));
+ }];
+ for (; i < len; i++) {
+ if (matcher = Expr.relative[tokens[i].type]) {
+ matchers = [addCombinator(elementMatcher(matchers), matcher)];
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- push$1.apply(results, matcherOut);
- }
- }
- });
- }
- function matcherFromTokens(tokens) {
- var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[' '], i = leadingRelative ? 1 : 0, matchContext = addCombinator(function (elem) {
- return elem === checkContext;
- }, implicitRelative, true), matchAnyContext = addCombinator(function (elem) {
- return indexOf$1.call(checkContext, elem) > -1;
- }, implicitRelative, true), matchers = [function (elem, context, xml) {
- return !leadingRelative && (xml || context !== outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml));
- }];
- for (; i < len; i++) {
- if (matcher = Expr.relative[tokens[i].type]) {
- matchers = [addCombinator(elementMatcher(matchers), matcher)];
- } else {
- matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches);
- if (matcher[expando]) {
- j = ++i;
- for (; j < len; j++) {
- if (Expr.relative[tokens[j].type]) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches);
+ if (matcher[expando]) {
+ j = ++i;
+ for (; j < len; j++) {
+ if (Expr.relative[tokens[j].type]) {
+ break;
+ }
</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 setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector(tokens.slice(0, i - 1).concat({ value: tokens[i - 2].type === ' ' ? '*' : '' })).replace(rtrim, '$1'), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens(tokens = tokens.slice(j)), j < len && toSelector(tokens));
</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 setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector(tokens.slice(0, i - 1).concat({ value: tokens[i - 2].type === ' ' ? '*' : '' })).replace(rtrim, '$1'), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens(tokens = tokens.slice(j)), j < len && toSelector(tokens));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ matchers.push(matcher);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- matchers.push(matcher);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return elementMatcher(matchers);
</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 elementMatcher(matchers);
- }
- function matcherFromGroupMatchers(elementMatchers, setMatchers) {
- var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function (seed, context, xml, results, outermost) {
- var elem, j, matcher, matchedCount = 0, i = '0', unmatched = seed && [], setMatched = [], contextBackup = outermostContext, elems = seed || byElement && Expr.find.TAG('*', outermost), dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1, len = elems.length;
- if (outermost) {
- outermostContext = context !== document$1 && context;
- }
- for (; i !== len && (elem = elems[i]) != null; i++) {
- if (byElement && elem) {
- j = 0;
- while (matcher = elementMatchers[j++]) {
- if (matcher(elem, context, xml)) {
- results.push(elem);
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function matcherFromGroupMatchers(elementMatchers, setMatchers) {
+ var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function (seed, context, xml, results, outermost) {
+ var elem, j, matcher, matchedCount = 0, i = '0', unmatched = seed && [], setMatched = [], contextBackup = outermostContext, elems = seed || byElement && Expr.find.TAG('*', outermost), dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1, len = elems.length;
+ if (outermost) {
+ outermostContext = context !== document$1 && context;
+ }
+ for (; i !== len && (elem = elems[i]) != null; i++) {
+ if (byElement && elem) {
+ j = 0;
+ while (matcher = elementMatchers[j++]) {
+ if (matcher(elem, context, xml)) {
+ results.push(elem);
+ break;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (outermost) {
+ dirruns = dirrunsUnique;
+ }
</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 (outermost) {
- dirruns = dirrunsUnique;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (bySet) {
+ if (elem = !matcher && elem) {
+ matchedCount--;
+ }
+ if (seed) {
+ unmatched.push(elem);
+ }
</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">- if (bySet) {
- if (elem = !matcher && elem) {
- matchedCount--;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ matchedCount += i;
+ if (bySet && i !== matchedCount) {
+ j = 0;
+ while (matcher = setMatchers[j++]) {
+ matcher(unmatched, setMatched, context, xml);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if (seed) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- unmatched.push(elem);
- }
- }
- }
- matchedCount += i;
- if (bySet && i !== matchedCount) {
- j = 0;
- while (matcher = setMatchers[j++]) {
- matcher(unmatched, setMatched, context, xml);
- }
- if (seed) {
- if (matchedCount > 0) {
- while (i--) {
- if (!(unmatched[i] || setMatched[i])) {
- setMatched[i] = pop.call(results);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (matchedCount > 0) {
+ while (i--) {
+ if (!(unmatched[i] || setMatched[i])) {
+ setMatched[i] = pop.call(results);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ setMatched = condense(setMatched);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- setMatched = condense(setMatched);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ push$1.apply(results, setMatched);
+ if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {
+ Sizzle.uniqueSort(results);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- push$1.apply(results, setMatched);
- if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {
- Sizzle.uniqueSort(results);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (outermost) {
+ dirruns = dirrunsUnique;
+ outermostContext = contextBackup;
</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 unmatched;
+ };
+ return bySet ? markFunction(superMatcher) : superMatcher;
+ }
+ compile = Sizzle.compile = function (selector, match) {
+ var i, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + ' '];
+ if (!cached) {
+ if (!match) {
+ match = tokenize(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">- if (outermost) {
- dirruns = dirrunsUnique;
- outermostContext = contextBackup;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ i = match.length;
+ while (i--) {
+ cached = matcherFromTokens(match[i]);
+ if (cached[expando]) {
+ setMatchers.push(cached);
+ } else {
+ elementMatchers.push(cached);
+ }
</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 unmatched;
- };
- return bySet ? markFunction(superMatcher) : superMatcher;
- }
- compile = Sizzle.compile = function (selector, match) {
- var i, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + ' '];
- if (!cached) {
- if (!match) {
- match = tokenize(selector);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers));
+ cached.selector = 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">- i = match.length;
- while (i--) {
- cached = matcherFromTokens(match[i]);
- if (cached[expando]) {
- setMatchers.push(cached);
- } else {
- elementMatchers.push(cached);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return cached;
+ };
+ select = Sizzle.select = function (selector, context, results, seed) {
+ var i, tokens, token, type, find, compiled = typeof selector === 'function' && selector, match = !seed && tokenize(selector = compiled.selector || selector);
+ results = results || [];
+ if (match.length === 1) {
+ tokens = match[0] = match[0].slice(0);
+ if (tokens.length > 2 && (token = tokens[0]).type === 'ID' && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) {
+ context = (Expr.find.ID(token.matches[0].replace(runescape, funescape), context) || [])[0];
+ if (!context) {
+ return results;
+ } else if (compiled) {
+ context = context.parentNode;
+ }
+ selector = selector.slice(tokens.shift().value.length);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers));
- cached.selector = selector;
- }
- return cached;
- };
- select = Sizzle.select = function (selector, context, results, seed) {
- var i, tokens, token, type, find, compiled = typeof selector === 'function' && selector, match = !seed && tokenize(selector = compiled.selector || selector);
- results = results || [];
- if (match.length === 1) {
- tokens = match[0] = match[0].slice(0);
- if (tokens.length > 2 && (token = tokens[0]).type === 'ID' && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) {
- context = (Expr.find.ID(token.matches[0].replace(runescape, funescape), context) || [])[0];
- if (!context) {
- return results;
- } else if (compiled) {
- context = context.parentNode;
- }
- selector = selector.slice(tokens.shift().value.length);
- }
- i = matchExpr.needsContext.test(selector) ? 0 : tokens.length;
- while (i--) {
- token = tokens[i];
- if (Expr.relative[type = token.type]) {
- break;
- }
- if (find = Expr.find[type]) {
- if (seed = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testContext(context.parentNode) || context)) {
- tokens.splice(i, 1);
- selector = seed.length && toSelector(tokens);
- if (!selector) {
- push$1.apply(results, seed);
- return results;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ i = matchExpr.needsContext.test(selector) ? 0 : tokens.length;
+ while (i--) {
+ token = tokens[i];
+ if (Expr.relative[type = token.type]) {
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (find = Expr.find[type]) {
+ if (seed = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testContext(context.parentNode) || context)) {
+ tokens.splice(i, 1);
+ selector = seed.length && toSelector(tokens);
+ if (!selector) {
+ push$1.apply(results, seed);
+ return results;
+ }
+ break;
+ }
+ }
</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">- }
- (compiled || compile(selector, match))(seed, context, !documentIsHTML, results, rsibling.test(selector) && testContext(context.parentNode) || context);
- return results;
- };
- support.sortStable = expando.split('').sort(sortOrder).join('') === expando;
- support.detectDuplicates = !!hasDuplicate;
- setDocument();
- support.sortDetached = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ (compiled || compile(selector, match))(seed, context, !documentIsHTML, results, rsibling.test(selector) && testContext(context.parentNode) || context);
+ return results;
+ };
+ support.sortStable = expando.split('').sort(sortOrder).join('') === expando;
+ support.detectDuplicates = !!hasDuplicate;
+ setDocument();
+ support.sortDetached = 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">- var isArray$1 = Array.isArray;
- var toArray = function (obj) {
- var array = obj, i, l;
- if (!isArray$1(obj)) {
- array = [];
- for (i = 0, l = obj.length; i < l; i++) {
- array[i] = obj[i];
- }
- }
- return array;
- };
- var each$1 = function (o, cb, s) {
- var n, l;
- if (!o) {
- return 0;
- }
- s = s || o;
- if (o.length !== undefined) {
- for (n = 0, l = o.length; n < l; n++) {
- if (cb.call(s, o[n], n, o) === false) {
- return 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isArray$1 = Array.isArray;
+ var toArray = function (obj) {
+ var array = obj, i, l;
+ if (!isArray$1(obj)) {
+ array = [];
+ for (i = 0, l = obj.length; i < l; i++) {
+ array[i] = obj[i];
</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">- } else {
- for (n in o) {
- if (o.hasOwnProperty(n)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return array;
+ };
+ var each$1 = function (o, cb, s) {
+ var n, l;
+ if (!o) {
+ return 0;
+ }
+ s = s || o;
+ if (o.length !== undefined) {
+ for (n = 0, l = o.length; n < l; n++) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (cb.call(s, o[n], n, o) === false) {
</span><span class="cx" style="display: block; padding: 0 10px"> return 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ for (n in o) {
+ if (o.hasOwnProperty(n)) {
+ if (cb.call(s, o[n], n, o) === false) {
+ return 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">- }
- return 1;
- };
- var map$1 = function (array, callback) {
- var out = [];
- each$1(array, function (item, index) {
- out.push(callback(item, index, array));
- });
- return out;
- };
- var filter$1 = function (a, f) {
- var o = [];
- each$1(a, function (v, index) {
- if (!f || f(v, index, a)) {
- o.push(v);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 1;
+ };
+ var map$1 = function (array, callback) {
+ var out = [];
+ each$1(array, function (item, index) {
+ out.push(callback(item, index, array));
+ });
+ return out;
+ };
+ var filter$1 = function (a, f) {
+ var o = [];
+ each$1(a, function (v, index) {
+ if (!f || f(v, index, a)) {
+ o.push(v);
+ }
+ });
+ return o;
+ };
+ var indexOf$2 = function (a, v) {
+ var i, l;
+ if (a) {
+ for (i = 0, l = a.length; i < l; i++) {
+ if (a[i] === v) {
+ return 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">- });
- return o;
- };
- var indexOf$2 = function (a, v) {
- var i, l;
- if (a) {
- for (i = 0, l = a.length; i < l; i++) {
- if (a[i] === v) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return -1;
+ };
+ var reduce = function (collection, iteratee, accumulator, thisArg) {
+ var i = 0;
+ if (arguments.length < 3) {
+ accumulator = collection[0];
+ }
+ for (; i < collection.length; i++) {
+ accumulator = iteratee.call(thisArg, accumulator, collection[i], i);
+ }
+ return accumulator;
+ };
+ var findIndex$1 = function (array, predicate, thisArg) {
+ var i, l;
+ for (i = 0, l = array.length; i < l; i++) {
+ if (predicate.call(thisArg, array[i], i, array)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return i;
</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">- }
- return -1;
- };
- var reduce = function (collection, iteratee, accumulator, thisArg) {
- var i = 0;
- if (arguments.length < 3) {
- accumulator = collection[0];
- }
- for (; i < collection.length; i++) {
- accumulator = iteratee.call(thisArg, accumulator, collection[i], i);
- }
- return accumulator;
- };
- var findIndex$1 = function (array, predicate, thisArg) {
- var i, l;
- for (i = 0, l = array.length; i < l; i++) {
- if (predicate.call(thisArg, array[i], i, array)) {
- return i;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return -1;
+ };
+ var find$1 = function (array, predicate, thisArg) {
+ var idx = findIndex$1(array, predicate, thisArg);
+ if (idx !== -1) {
+ return array[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;
- };
- var find$1 = function (array, predicate, thisArg) {
- var idx = findIndex$1(array, predicate, thisArg);
- if (idx !== -1) {
- return array[idx];
- }
- return undefined;
- };
- var last$1 = function (collection) {
- return collection[collection.length - 1];
- };
- var $_6t4axrmjjgwe7jf = {
- isArray: isArray$1,
- toArray: toArray,
- each: each$1,
- map: map$1,
- filter: filter$1,
- indexOf: indexOf$2,
- reduce: reduce,
- findIndex: findIndex$1,
- find: find$1,
- last: last$1
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return undefined;
+ };
+ var last$1 = function (collection) {
+ return collection[collection.length - 1];
+ };
+ var ArrUtils = {
+ isArray: isArray$1,
+ toArray: toArray,
+ each: each$1,
+ map: map$1,
+ filter: filter$1,
+ indexOf: indexOf$2,
+ reduce: reduce,
+ findIndex: findIndex$1,
+ find: find$1,
+ last: last$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">- var whiteSpaceRegExp = /^\s*|\s*$/g;
- var trim = function (str) {
- return str === null || str === undefined ? '' : ('' + str).replace(whiteSpaceRegExp, '');
- };
- var is = function (obj, type) {
- if (!type) {
- return obj !== undefined;
- }
- if (type === 'array' && $_6t4axrmjjgwe7jf.isArray(obj)) {
- return true;
- }
- return typeof obj === type;
- };
- var makeMap = function (items, delim, map) {
- var i;
- items = items || [];
- delim = delim || ',';
- if (typeof items === 'string') {
- items = items.split(delim);
- }
- map = map || {};
- i = items.length;
- while (i--) {
- map[items[i]] = {};
- }
- return map;
- };
- var hasOwnProperty = function (obj, prop) {
- return Object.prototype.hasOwnProperty.call(obj, prop);
- };
- var create = function (s, p, root) {
- var self$$1 = this;
- var sp, ns, cn, scn, c, de = 0;
- s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);
- cn = s[3].match(/(^|\.)(\w+)$/i)[2];
- ns = self$$1.createNS(s[3].replace(/\.\w+$/, ''), root);
- if (ns[cn]) {
- return;
- }
- if (s[2] === 'static') {
- ns[cn] = p;
- if (this.onCreate) {
- this.onCreate(s[2], s[3], ns[cn]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var whiteSpaceRegExp = /^\s*|\s*$/g;
+ var trim = function (str) {
+ return str === null || str === undefined ? '' : ('' + str).replace(whiteSpaceRegExp, '');
+ };
+ var is = function (obj, type) {
+ if (!type) {
+ return obj !== undefined;
</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;
- }
- if (!p[cn]) {
- p[cn] = function () {
- };
- de = 1;
- }
- ns[cn] = p[cn];
- self$$1.extend(ns[cn].prototype, p);
- if (s[5]) {
- sp = self$$1.resolve(s[5]).prototype;
- scn = s[5].match(/\.(\w+)$/i)[1];
- c = ns[cn];
- if (de) {
- ns[cn] = function () {
- return sp[scn].apply(this, arguments);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (type === 'array' && ArrUtils.isArray(obj)) {
+ return true;
+ }
+ return typeof obj === type;
+ };
+ var makeMap = function (items, delim, map) {
+ var i;
+ items = items || [];
+ delim = delim || ',';
+ if (typeof items === 'string') {
+ items = items.split(delim);
+ }
+ map = map || {};
+ i = items.length;
+ while (i--) {
+ map[items[i]] = {};
+ }
+ return map;
+ };
+ var hasOwnProperty = function (obj, prop) {
+ return Object.prototype.hasOwnProperty.call(obj, prop);
+ };
+ var create = function (s, p, root) {
+ var self$$1 = this;
+ var sp, ns, cn, scn, c, de = 0;
+ s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);
+ cn = s[3].match(/(^|\.)(\w+)$/i)[2];
+ ns = self$$1.createNS(s[3].replace(/\.\w+$/, ''), root);
+ if (ns[cn]) {
+ return;
+ }
+ if (s[2] === 'static') {
+ ns[cn] = p;
+ if (this.onCreate) {
+ this.onCreate(s[2], s[3], ns[cn]);
+ }
+ return;
+ }
+ if (!p[cn]) {
+ p[cn] = function () {
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- ns[cn] = function () {
- this.parent = sp[scn];
- return c.apply(this, arguments);
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ de = 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">- ns[cn].prototype[cn] = ns[cn];
- self$$1.each(sp, function (f, n) {
- ns[cn].prototype[n] = sp[n];
- });
- self$$1.each(p, function (f, n) {
- if (sp[n]) {
- ns[cn].prototype[n] = function () {
- this.parent = sp[n];
- return f.apply(this, arguments);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ns[cn] = p[cn];
+ self$$1.extend(ns[cn].prototype, p);
+ if (s[5]) {
+ sp = self$$1.resolve(s[5]).prototype;
+ scn = s[5].match(/\.(\w+)$/i)[1];
+ c = ns[cn];
+ if (de) {
+ ns[cn] = function () {
+ return sp[scn].apply(this, arguments);
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (n !== cn) {
- ns[cn].prototype[n] = f;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ns[cn] = function () {
+ this.parent = sp[scn];
+ return c.apply(this, arguments);
+ };
+ }
+ ns[cn].prototype[cn] = ns[cn];
+ self$$1.each(sp, function (f, n) {
+ ns[cn].prototype[n] = sp[n];
+ });
+ self$$1.each(p, function (f, n) {
+ if (sp[n]) {
+ ns[cn].prototype[n] = function () {
+ this.parent = sp[n];
+ return f.apply(this, arguments);
+ };
+ } else {
+ if (n !== cn) {
+ ns[cn].prototype[n] = f;
+ }
</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">+ });
+ }
+ self$$1.each(p.static, function (f, n) {
+ ns[cn][n] = f;
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- self$$1.each(p.static, function (f, n) {
- ns[cn][n] = f;
- });
- };
- var extend = function (obj, ext) {
- var x = [];
- for (var _i = 2; _i < arguments.length; _i++) {
- x[_i - 2] = arguments[_i];
- }
- var i, l, name$$1;
- var args = arguments;
- var value;
- for (i = 1, l = args.length; i < l; i++) {
- ext = args[i];
- for (name$$1 in ext) {
- if (ext.hasOwnProperty(name$$1)) {
- value = ext[name$$1];
- if (value !== undefined) {
- obj[name$$1] = value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var extend = function (obj, ext) {
+ var x = [];
+ for (var _i = 2; _i < arguments.length; _i++) {
+ x[_i - 2] = arguments[_i];
+ }
+ var i, l, name$$1;
+ var args = arguments;
+ var value;
+ for (i = 1, l = args.length; i < l; i++) {
+ ext = args[i];
+ for (name$$1 in ext) {
+ if (ext.hasOwnProperty(name$$1)) {
+ value = ext[name$$1];
+ if (value !== undefined) {
+ obj[name$$1] = value;
+ }
</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">- }
- return obj;
- };
- var walk = function (o, f, n, s) {
- s = s || this;
- if (o) {
- if (n) {
- o = o[n];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return obj;
+ };
+ var walk = function (o, f, n, s) {
+ s = s || this;
+ if (o) {
+ if (n) {
+ o = o[n];
+ }
+ ArrUtils.each(o, function (o, i) {
+ if (f.call(s, o, i, n) === false) {
+ return false;
+ }
+ walk(o, f, n, s);
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_6t4axrmjjgwe7jf.each(o, function (o, i) {
- if (f.call(s, o, i, n) === false) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var createNS = function (n, o) {
+ var i, v;
+ o = o || window;
+ n = n.split('.');
+ for (i = 0; i < n.length; i++) {
+ v = n[i];
+ if (!o[v]) {
+ o[v] = {};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- walk(o, f, n, s);
- });
- }
- };
- var createNS = function (n, o) {
- var i, v;
- o = o || window;
- n = n.split('.');
- for (i = 0; i < n.length; i++) {
- v = n[i];
- if (!o[v]) {
- o[v] = {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ o = o[v];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- o = o[v];
- }
- return o;
- };
- var resolve$1 = function (n, o) {
- var i, l;
- o = o || window;
- n = n.split('.');
- for (i = 0, l = n.length; i < l; i++) {
- o = o[n[i]];
- if (!o) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return o;
+ };
+ var resolve$1 = function (n, o) {
+ var i, l;
+ o = o || window;
+ n = n.split('.');
+ for (i = 0, l = n.length; i < l; i++) {
+ o = o[n[i]];
+ if (!o) {
+ break;
+ }
</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 o;
- };
- var explode = function (s, d) {
- if (!s || is(s, 'array')) {
- return s;
- }
- return $_6t4axrmjjgwe7jf.map(s.split(d || ','), trim);
- };
- var _addCacheSuffix = function (url) {
- var cacheSuffix = $_bcvfv9ajjgwe79v.cacheSuffix;
- if (cacheSuffix) {
- url += (url.indexOf('?') === -1 ? '?' : '&') + cacheSuffix;
- }
- return url;
- };
- var $_6cwiepljjgwe7j4 = {
- trim: trim,
- isArray: $_6t4axrmjjgwe7jf.isArray,
- is: is,
- toArray: $_6t4axrmjjgwe7jf.toArray,
- makeMap: makeMap,
- each: $_6t4axrmjjgwe7jf.each,
- map: $_6t4axrmjjgwe7jf.map,
- grep: $_6t4axrmjjgwe7jf.filter,
- inArray: $_6t4axrmjjgwe7jf.indexOf,
- hasOwn: hasOwnProperty,
- extend: extend,
- create: create,
- walk: walk,
- createNS: createNS,
- resolve: resolve$1,
- explode: explode,
- _addCacheSuffix: _addCacheSuffix
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return o;
+ };
+ var explode = function (s, d) {
+ if (!s || is(s, 'array')) {
+ return s;
+ }
+ return ArrUtils.map(s.split(d || ','), trim);
+ };
+ var _addCacheSuffix = function (url) {
+ var cacheSuffix = Env.cacheSuffix;
+ if (cacheSuffix) {
+ url += (url.indexOf('?') === -1 ? '?' : '&') + cacheSuffix;
+ }
+ return url;
+ };
+ var Tools = {
+ trim: trim,
+ isArray: ArrUtils.isArray,
+ is: is,
+ toArray: ArrUtils.toArray,
+ makeMap: makeMap,
+ each: ArrUtils.each,
+ map: ArrUtils.map,
+ grep: ArrUtils.filter,
+ inArray: ArrUtils.indexOf,
+ hasOwn: hasOwnProperty,
+ extend: extend,
+ create: create,
+ walk: walk,
+ createNS: createNS,
+ resolve: resolve$1,
+ explode: explode,
+ _addCacheSuffix: _addCacheSuffix
+ };
</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 doc = document;
- var push$2 = Array.prototype.push;
- var slice$2 = Array.prototype.slice;
- var rquickExpr$1 = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/;
- var Event$$1 = EventUtils.Event;
- var skipUniques = $_6cwiepljjgwe7j4.makeMap('children,contents,next,prev');
- var isDefined = function (obj) {
- return typeof obj !== 'undefined';
- };
- var isString$1 = function (obj) {
- return typeof obj === 'string';
- };
- var isWindow = function (obj) {
- return obj && obj === obj.window;
- };
- var createFragment = function (html, fragDoc) {
- var frag, node, container;
- fragDoc = fragDoc || doc;
- container = fragDoc.createElement('div');
- frag = fragDoc.createDocumentFragment();
- container.innerHTML = html;
- while (node = container.firstChild) {
- frag.appendChild(node);
- }
- return frag;
- };
- var domManipulate = function (targetNodes, sourceItem, callback, reverse) {
- var i;
- if (isString$1(sourceItem)) {
- sourceItem = createFragment(sourceItem, getElementDocument(targetNodes[0]));
- } else if (sourceItem.length && !sourceItem.nodeType) {
- sourceItem = DomQuery.makeArray(sourceItem);
- if (reverse) {
- for (i = sourceItem.length - 1; i >= 0; i--) {
- domManipulate(targetNodes, sourceItem[i], callback, reverse);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var doc = document, push$2 = Array.prototype.push, slice$2 = Array.prototype.slice;
+ var rquickExpr$1 = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/;
+ var Event$$1 = EventUtils.Event;
+ var skipUniques = Tools.makeMap('children,contents,next,prev');
+ var isDefined = function (obj) {
+ return typeof obj !== 'undefined';
+ };
+ var isString$1 = function (obj) {
+ return typeof obj === 'string';
+ };
+ var isWindow = function (obj) {
+ return obj && obj === obj.window;
+ };
+ var createFragment = function (html, fragDoc) {
+ var frag, node, container;
+ fragDoc = fragDoc || doc;
+ container = fragDoc.createElement('div');
+ frag = fragDoc.createDocumentFragment();
+ container.innerHTML = html;
+ while (node = container.firstChild) {
+ frag.appendChild(node);
+ }
+ return frag;
+ };
+ var domManipulate = function (targetNodes, sourceItem, callback, reverse) {
+ var i;
+ if (isString$1(sourceItem)) {
+ sourceItem = createFragment(sourceItem, getElementDocument(targetNodes[0]));
+ } else if (sourceItem.length && !sourceItem.nodeType) {
+ sourceItem = DomQuery.makeArray(sourceItem);
+ if (reverse) {
+ for (i = sourceItem.length - 1; i >= 0; i--) {
+ domManipulate(targetNodes, sourceItem[i], callback, reverse);
+ }
+ } else {
+ for (i = 0; i < sourceItem.length; i++) {
+ domManipulate(targetNodes, sourceItem[i], callback, reverse);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- for (i = 0; i < sourceItem.length; i++) {
- domManipulate(targetNodes, sourceItem[i], callback, reverse);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return targetNodes;
+ }
+ if (sourceItem.nodeType) {
+ i = targetNodes.length;
+ while (i--) {
+ callback.call(targetNodes[i], sourceItem);
</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"> return targetNodes;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (sourceItem.nodeType) {
- i = targetNodes.length;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var hasClass = function (node, className) {
+ return node && className && (' ' + node.className + ' ').indexOf(' ' + className + ' ') !== -1;
+ };
+ var wrap = function (elements, wrapper, all) {
+ var lastParent, newWrapper;
+ wrapper = DomQuery(wrapper)[0];
+ elements.each(function () {
+ var self$$1 = this;
+ if (!all || lastParent !== self$$1.parentNode) {
+ lastParent = self$$1.parentNode;
+ newWrapper = wrapper.cloneNode(false);
+ self$$1.parentNode.insertBefore(newWrapper, self$$1);
+ newWrapper.appendChild(self$$1);
+ } else {
+ newWrapper.appendChild(self$$1);
+ }
+ });
+ return elements;
+ };
+ var numericCssMap = Tools.makeMap('fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom', ' ');
+ var booleanMap = Tools.makeMap('checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected', ' ');
+ var propFix = {
+ for: 'htmlFor',
+ class: 'className',
+ readonly: 'readOnly'
+ };
+ var cssFix = { float: 'cssFloat' };
+ var attrHooks = {}, cssHooks = {};
+ var DomQuery = function (selector, context) {
+ return new DomQuery.fn.init(selector, context);
+ };
+ var inArray = function (item, array) {
+ var i;
+ if (array.indexOf) {
+ return array.indexOf(item);
+ }
+ i = array.length;
</ins><span class="cx" style="display: block; padding: 0 10px"> while (i--) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- callback.call(targetNodes[i], sourceItem);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (array[i] === item) {
+ return 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">- }
- return targetNodes;
- };
- var hasClass = function (node, className) {
- return node && className && (' ' + node.className + ' ').indexOf(' ' + className + ' ') !== -1;
- };
- var wrap = function (elements, wrapper, all) {
- var lastParent, newWrapper;
- wrapper = DomQuery(wrapper)[0];
- elements.each(function () {
- var self$$1 = this;
- if (!all || lastParent !== self$$1.parentNode) {
- lastParent = self$$1.parentNode;
- newWrapper = wrapper.cloneNode(false);
- self$$1.parentNode.insertBefore(newWrapper, self$$1);
- newWrapper.appendChild(self$$1);
- } else {
- newWrapper.appendChild(self$$1);
- }
- });
- return elements;
- };
- var numericCssMap = $_6cwiepljjgwe7j4.makeMap('fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom', ' ');
- var booleanMap = $_6cwiepljjgwe7j4.makeMap('checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected', ' ');
- var propFix = {
- for: 'htmlFor',
- class: 'className',
- readonly: 'readOnly'
- };
- var cssFix = { float: 'cssFloat' };
- var attrHooks = {};
- var cssHooks = {};
- var DomQuery = function (selector, context) {
- return new DomQuery.fn.init(selector, context);
- };
- var inArray = function (item, array) {
- var i;
- if (array.indexOf) {
- return array.indexOf(item);
- }
- i = array.length;
- while (i--) {
- if (array[i] === item) {
- return i;
- }
- }
- return -1;
- };
- var whiteSpaceRegExp$1 = /^\s*|\s*$/g;
- var trim$1 = function (str) {
- return str === null || str === undefined ? '' : ('' + str).replace(whiteSpaceRegExp$1, '');
- };
- var each$2 = function (obj, callback) {
- var length$$1, key, i, value;
- if (obj) {
- length$$1 = obj.length;
- if (length$$1 === undefined) {
- for (key in obj) {
- if (obj.hasOwnProperty(key)) {
- value = obj[key];
- if (callback.call(value, key, value) === false) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return -1;
+ };
+ var whiteSpaceRegExp$1 = /^\s*|\s*$/g;
+ var trim$1 = function (str) {
+ return str === null || str === undefined ? '' : ('' + str).replace(whiteSpaceRegExp$1, '');
+ };
+ var each$2 = function (obj, callback) {
+ var length$$1, key, i, value;
+ if (obj) {
+ length$$1 = obj.length;
+ if (length$$1 === undefined) {
+ for (key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ value = obj[key];
+ if (callback.call(value, key, value) === false) {
+ break;
+ }
+ }
+ }
+ } else {
+ for (i = 0; i < length$$1; i++) {
+ value = obj[i];
+ if (callback.call(value, i, value) === false) {
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</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">- } else {
- for (i = 0; i < length$$1; i++) {
- value = obj[i];
- if (callback.call(value, i, value) === false) {
- break;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ return obj;
+ };
+ var grep = function (array, callback) {
+ var out = [];
+ each$2(array, function (i, item) {
+ if (callback(item, i)) {
+ out.push(item);
</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 out;
+ };
+ var getElementDocument = function (element) {
+ if (!element) {
+ return doc;
</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;
- };
- var grep = function (array, callback) {
- var out = [];
- each$2(array, function (i, item) {
- if (callback(item, i)) {
- out.push(item);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (element.nodeType === 9) {
+ return element;
</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 out;
- };
- var getElementDocument = function (element) {
- if (!element) {
- return doc;
- }
- if (element.nodeType === 9) {
- return element;
- }
- return element.ownerDocument;
- };
- DomQuery.fn = DomQuery.prototype = {
- constructor: DomQuery,
- selector: '',
- context: null,
- length: 0,
- init: function (selector, context) {
- var self$$1 = this;
- var match, node;
- if (!selector) {
- return self$$1;
- }
- if (selector.nodeType) {
- self$$1.context = self$$1[0] = selector;
- self$$1.length = 1;
- return self$$1;
- }
- if (context && context.nodeType) {
- self$$1.context = context;
- } else {
- if (context) {
- return DomQuery(selector).attr(context);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return element.ownerDocument;
+ };
+ DomQuery.fn = DomQuery.prototype = {
+ constructor: DomQuery,
+ selector: '',
+ context: null,
+ length: 0,
+ init: function (selector, context) {
+ var self$$1 = this;
+ var match, node;
+ if (!selector) {
+ return self$$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">- self$$1.context = context = document;
- }
- if (isString$1(selector)) {
- self$$1.selector = selector;
- if (selector.charAt(0) === '<' && selector.charAt(selector.length - 1) === '>' && selector.length >= 3) {
- match = [
- null,
- selector,
- null
- ];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (selector.nodeType) {
+ self$$1.context = self$$1[0] = selector;
+ self$$1.length = 1;
+ return self$$1;
+ }
+ if (context && context.nodeType) {
+ self$$1.context = context;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- match = rquickExpr$1.exec(selector);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (context) {
+ return DomQuery(selector).attr(context);
+ }
+ self$$1.context = context = document;
</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 (match) {
- if (match[1]) {
- node = createFragment(selector, getElementDocument(context)).firstChild;
- while (node) {
- push$2.call(self$$1, node);
- node = node.nextSibling;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isString$1(selector)) {
+ self$$1.selector = selector;
+ if (selector.charAt(0) === '<' && selector.charAt(selector.length - 1) === '>' && selector.length >= 3) {
+ match = [
+ null,
+ selector,
+ null
+ ];
+ } else {
+ match = rquickExpr$1.exec(selector);
+ }
+ if (match) {
+ if (match[1]) {
+ node = createFragment(selector, getElementDocument(context)).firstChild;
+ while (node) {
+ push$2.call(self$$1, node);
+ node = node.nextSibling;
+ }
+ } else {
+ node = getElementDocument(context).getElementById(match[2]);
+ if (!node) {
+ return self$$1;
+ }
+ if (node.id !== match[2]) {
+ return self$$1.find(selector);
+ }
+ self$$1.length = 1;
+ self$$1[0] = node;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- node = getElementDocument(context).getElementById(match[2]);
- if (!node) {
- return self$$1;
- }
- if (node.id !== match[2]) {
- return self$$1.find(selector);
- }
- self$$1.length = 1;
- self$$1[0] = node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return DomQuery(context).find(selector);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return DomQuery(context).find(selector);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.add(selector, 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">- } else {
- this.add(selector, false);
- }
- return self$$1;
- },
- toArray: function () {
- return $_6cwiepljjgwe7j4.toArray(this);
- },
- add: function (items, sort) {
- var self$$1 = this;
- var nodes, i;
- if (isString$1(items)) {
- return self$$1.add(DomQuery(items));
- }
- if (sort !== false) {
- nodes = DomQuery.unique(self$$1.toArray().concat(DomQuery.makeArray(items)));
- self$$1.length = nodes.length;
- for (i = 0; i < nodes.length; i++) {
- self$$1[i] = nodes[i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$1;
+ },
+ toArray: function () {
+ return Tools.toArray(this);
+ },
+ add: function (items, sort) {
+ var self$$1 = this;
+ var nodes, i;
+ if (isString$1(items)) {
+ return self$$1.add(DomQuery(items));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- push$2.apply(self$$1, DomQuery.makeArray(items));
- }
- return self$$1;
- },
- attr: function (name$$1, value) {
- var self$$1 = this;
- var hook;
- if (typeof name$$1 === 'object') {
- each$2(name$$1, function (name$$1, value) {
- self$$1.attr(name$$1, value);
- });
- } else if (isDefined(value)) {
- this.each(function () {
- var hook;
- if (this.nodeType === 1) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (sort !== false) {
+ nodes = DomQuery.unique(self$$1.toArray().concat(DomQuery.makeArray(items)));
+ self$$1.length = nodes.length;
+ for (i = 0; i < nodes.length; i++) {
+ self$$1[i] = nodes[i];
+ }
+ } else {
+ push$2.apply(self$$1, DomQuery.makeArray(items));
+ }
+ return self$$1;
+ },
+ attr: function (name$$1, value) {
+ var self$$1 = this;
+ var hook;
+ if (typeof name$$1 === 'object') {
+ each$2(name$$1, function (name$$1, value) {
+ self$$1.attr(name$$1, value);
+ });
+ } else if (isDefined(value)) {
+ this.each(function () {
+ var hook;
+ if (this.nodeType === 1) {
+ hook = attrHooks[name$$1];
+ if (hook && hook.set) {
+ hook.set(this, value);
+ return;
+ }
+ if (value === null) {
+ this.removeAttribute(name$$1, 2);
+ } else {
+ this.setAttribute(name$$1, value, 2);
+ }
+ }
+ });
+ } else {
+ if (self$$1[0] && self$$1[0].nodeType === 1) {
</ins><span class="cx" style="display: block; padding: 0 10px"> hook = attrHooks[name$$1];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (hook && hook.set) {
- hook.set(this, value);
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (hook && hook.get) {
+ return hook.get(self$$1[0], name$$1);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (booleanMap[name$$1]) {
+ return self$$1.prop(name$$1) ? name$$1 : undefined;
+ }
+ value = self$$1[0].getAttribute(name$$1, 2);
</ins><span class="cx" style="display: block; padding: 0 10px"> if (value === null) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.removeAttribute(name$$1, 2);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ value = undefined;
+ }
+ }
+ return value;
+ }
+ return self$$1;
+ },
+ removeAttr: function (name$$1) {
+ return this.attr(name$$1, null);
+ },
+ prop: function (name$$1, value) {
+ var self$$1 = this;
+ name$$1 = propFix[name$$1] || name$$1;
+ if (typeof name$$1 === 'object') {
+ each$2(name$$1, function (name$$1, value) {
+ self$$1.prop(name$$1, value);
+ });
+ } else if (isDefined(value)) {
+ this.each(function () {
+ if (this.nodeType === 1) {
+ this[name$$1] = value;
+ }
+ });
+ } else {
+ if (self$$1[0] && self$$1[0].nodeType && name$$1 in self$$1[0]) {
+ return self$$1[0][name$$1];
+ }
+ return value;
+ }
+ return self$$1;
+ },
+ css: function (name$$1, value) {
+ var self$$1 = this;
+ var elm, hook;
+ var camel = function (name$$1) {
+ return name$$1.replace(/-(\D)/g, function (a, b) {
+ return b.toUpperCase();
+ });
+ };
+ var dashed = function (name$$1) {
+ return name$$1.replace(/[A-Z]/g, function (a) {
+ return '-' + a;
+ });
+ };
+ if (typeof name$$1 === 'object') {
+ each$2(name$$1, function (name$$1, value) {
+ self$$1.css(name$$1, value);
+ });
+ } else {
+ if (isDefined(value)) {
+ name$$1 = camel(name$$1);
+ if (typeof value === 'number' && !numericCssMap[name$$1]) {
+ value = value.toString() + 'px';
+ }
+ self$$1.each(function () {
+ var style = this.style;
+ hook = cssHooks[name$$1];
+ if (hook && hook.set) {
+ hook.set(this, value);
+ return;
+ }
+ try {
+ this.style[cssFix[name$$1] || name$$1] = value;
+ } catch (ex) {
+ }
+ if (value === null || value === '') {
+ if (style.removeProperty) {
+ style.removeProperty(dashed(name$$1));
+ } else {
+ style.removeAttribute(name$$1);
+ }
+ }
+ });
+ } else {
+ elm = self$$1[0];
+ hook = cssHooks[name$$1];
+ if (hook && hook.get) {
+ return hook.get(elm);
+ }
+ if (elm.ownerDocument.defaultView) {
+ try {
+ return elm.ownerDocument.defaultView.getComputedStyle(elm, null).getPropertyValue(dashed(name$$1));
+ } catch (ex) {
+ return undefined;
+ }
+ } else if (elm.currentStyle) {
+ return elm.currentStyle[camel(name$$1)];
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.setAttribute(name$$1, value, 2);
</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><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- } else {
- if (self$$1[0] && self$$1[0].nodeType === 1) {
- hook = attrHooks[name$$1];
- if (hook && hook.get) {
- return hook.get(self$$1[0], name$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ return self$$1;
+ },
+ remove: function () {
+ var self$$1 = this;
+ var node, i = this.length;
+ while (i--) {
+ node = self$$1[i];
+ Event$$1.clean(node);
+ if (node.parentNode) {
+ node.parentNode.removeChild(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 (booleanMap[name$$1]) {
- return self$$1.prop(name$$1) ? name$$1 : undefined;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ return this;
+ },
+ empty: function () {
+ var self$$1 = this;
+ var node, i = this.length;
+ while (i--) {
+ node = self$$1[i];
+ while (node.firstChild) {
+ node.removeChild(node.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">- value = self$$1[0].getAttribute(name$$1, 2);
- if (value === null) {
- value = undefined;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ return this;
+ },
+ html: function (value) {
+ var self$$1 = this;
+ var i;
+ if (isDefined(value)) {
+ i = self$$1.length;
+ try {
+ while (i--) {
+ self$$1[i].innerHTML = value;
+ }
+ } catch (ex) {
+ DomQuery(self$$1[i]).empty().append(value);
</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 self$$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 value;
- }
- return self$$1;
- },
- removeAttr: function (name$$1) {
- return this.attr(name$$1, null);
- },
- prop: function (name$$1, value) {
- var self$$1 = this;
- name$$1 = propFix[name$$1] || name$$1;
- if (typeof name$$1 === 'object') {
- each$2(name$$1, function (name$$1, value) {
- self$$1.prop(name$$1, value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$1[0] ? self$$1[0].innerHTML : '';
+ },
+ text: function (value) {
+ var self$$1 = this;
+ var i;
+ if (isDefined(value)) {
+ i = self$$1.length;
+ while (i--) {
+ if ('innerText' in self$$1[i]) {
+ self$$1[i].innerText = value;
+ } else {
+ self$$1[0].textContent = value;
+ }
+ }
+ return self$$1;
+ }
+ return self$$1[0] ? self$$1[0].innerText || self$$1[0].textContent : '';
+ },
+ append: function () {
+ return domManipulate(this, arguments, function (node) {
+ if (this.nodeType === 1 || this.host && this.host.nodeType === 1) {
+ this.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">- } else if (isDefined(value)) {
- this.each(function () {
- if (this.nodeType === 1) {
- this[name$$1] = value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ prepend: function () {
+ return domManipulate(this, arguments, function (node) {
+ if (this.nodeType === 1 || this.host && this.host.nodeType === 1) {
+ this.insertBefore(node, this.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">- });
- } else {
- if (self$$1[0] && self$$1[0].nodeType && name$$1 in self$$1[0]) {
- return self$$1[0][name$$1];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }, true);
+ },
+ before: function () {
+ var self$$1 = this;
+ if (self$$1[0] && self$$1[0].parentNode) {
+ return domManipulate(self$$1, arguments, function (node) {
+ this.parentNode.insertBefore(node, 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">- return value;
- }
- return self$$1;
- },
- css: function (name$$1, value) {
- var self$$1 = this;
- var elm, hook;
- var camel = function (name$$1) {
- return name$$1.replace(/-(\D)/g, function (a, b) {
- return b.toUpperCase();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self$$1;
+ },
+ after: function () {
+ var self$$1 = this;
+ if (self$$1[0] && self$$1[0].parentNode) {
+ return domManipulate(self$$1, arguments, function (node) {
+ this.parentNode.insertBefore(node, this.nextSibling);
+ }, true);
+ }
+ return self$$1;
+ },
+ appendTo: function (val) {
+ DomQuery(val).append(this);
+ return this;
+ },
+ prependTo: function (val) {
+ DomQuery(val).prepend(this);
+ return this;
+ },
+ replaceWith: function (content) {
+ return this.before(content).remove();
+ },
+ wrap: function (content) {
+ return wrap(this, content);
+ },
+ wrapAll: function (content) {
+ return wrap(this, content, true);
+ },
+ wrapInner: function (content) {
+ this.each(function () {
+ DomQuery(this).contents().wrapAll(content);
</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 dashed = function (name$$1) {
- return name$$1.replace(/[A-Z]/g, function (a) {
- return '-' + a;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this;
+ },
+ unwrap: function () {
+ return this.parent().each(function () {
+ DomQuery(this).replaceWith(this.childNodes);
</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 name$$1 === 'object') {
- each$2(name$$1, function (name$$1, value) {
- self$$1.css(name$$1, value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ clone: function () {
+ var result = [];
+ this.each(function () {
+ result.push(this.cloneNode(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">- } else {
- if (isDefined(value)) {
- name$$1 = camel(name$$1);
- if (typeof value === 'number' && !numericCssMap[name$$1]) {
- value = value.toString() + 'px';
- }
- self$$1.each(function () {
- var style = this.style;
- hook = cssHooks[name$$1];
- if (hook && hook.set) {
- hook.set(this, value);
- return;
- }
- try {
- this.style[cssFix[name$$1] || name$$1] = value;
- } catch (ex) {
- }
- if (value === null || value === '') {
- if (style.removeProperty) {
- style.removeProperty(dashed(name$$1));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return DomQuery(result);
+ },
+ addClass: function (className) {
+ return this.toggleClass(className, true);
+ },
+ removeClass: function (className) {
+ return this.toggleClass(className, false);
+ },
+ toggleClass: function (className, state) {
+ var self$$1 = this;
+ if (typeof className !== 'string') {
+ return self$$1;
+ }
+ if (className.indexOf(' ') !== -1) {
+ each$2(className.split(' '), function () {
+ self$$1.toggleClass(this, state);
+ });
+ } else {
+ self$$1.each(function (index, node) {
+ var existingClassName, classState;
+ classState = hasClass(node, className);
+ if (classState !== state) {
+ existingClassName = node.className;
+ if (classState) {
+ node.className = trim$1((' ' + existingClassName + ' ').replace(' ' + className + ' ', ' '));
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- style.removeAttribute(name$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ node.className += existingClassName ? ' ' + className : className;
</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">- } else {
- elm = self$$1[0];
- hook = cssHooks[name$$1];
- if (hook && hook.get) {
- return hook.get(elm);
- }
- if (elm.ownerDocument.defaultView) {
- try {
- return elm.ownerDocument.defaultView.getComputedStyle(elm, null).getPropertyValue(dashed(name$$1));
- } catch (ex) {
- return undefined;
- }
- } else if (elm.currentStyle) {
- return elm.currentStyle[camel(name$$1)];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ return self$$1;
+ },
+ hasClass: function (className) {
+ return hasClass(this[0], className);
+ },
+ each: function (callback) {
+ return each$2(this, callback);
+ },
+ on: function (name$$1, callback) {
+ return this.each(function () {
+ Event$$1.bind(this, name$$1, callback);
+ });
+ },
+ off: function (name$$1, callback) {
+ return this.each(function () {
+ Event$$1.unbind(this, name$$1, callback);
+ });
+ },
+ trigger: function (name$$1) {
+ return this.each(function () {
+ if (typeof name$$1 === 'object') {
+ Event$$1.fire(this, name$$1.type, name$$1);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</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">+ Event$$1.fire(this, name$$1);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ },
+ show: function () {
+ return this.css('display', '');
+ },
+ hide: function () {
+ return this.css('display', 'none');
+ },
+ slice: function () {
+ return new DomQuery(slice$2.apply(this, arguments));
+ },
+ eq: function (index) {
+ return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
+ },
+ first: function () {
+ return this.eq(0);
+ },
+ last: function () {
+ return this.eq(-1);
+ },
+ find: function (selector) {
+ var i, l;
+ var ret = [];
+ for (i = 0, l = this.length; i < l; i++) {
+ DomQuery.find(selector, this[i], ret);
</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 self$$1;
- },
- remove: function () {
- var self$$1 = this;
- var node, i = this.length;
- while (i--) {
- node = self$$1[i];
- Event$$1.clean(node);
- if (node.parentNode) {
- node.parentNode.removeChild(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return DomQuery(ret);
+ },
+ filter: function (selector) {
+ if (typeof selector === 'function') {
+ return DomQuery(grep(this.toArray(), function (item, i) {
+ return selector(i, item);
+ }));
</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 this;
- },
- empty: function () {
- var self$$1 = this;
- var node, i = this.length;
- while (i--) {
- node = self$$1[i];
- while (node.firstChild) {
- node.removeChild(node.firstChild);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return DomQuery(DomQuery.filter(selector, this.toArray()));
+ },
+ closest: function (selector) {
+ var result = [];
+ if (selector instanceof DomQuery) {
+ selector = selector[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">- }
- return this;
- },
- html: function (value) {
- var self$$1 = this;
- var i;
- if (isDefined(value)) {
- i = self$$1.length;
- try {
- while (i--) {
- self$$1[i].innerHTML = value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.each(function (i, node) {
+ while (node) {
+ if (typeof selector === 'string' && DomQuery(node).is(selector)) {
+ result.push(node);
+ break;
+ } else if (node === selector) {
+ result.push(node);
+ break;
+ }
+ 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">- } catch (ex) {
- DomQuery(self$$1[i]).empty().append(value);
- }
- return self$$1;
- }
- return self$$1[0] ? self$$1[0].innerHTML : '';
- },
- text: function (value) {
- var self$$1 = this;
- var i;
- if (isDefined(value)) {
- i = self$$1.length;
- while (i--) {
- if ('innerText' in self$$1[i]) {
- self$$1[i].innerText = value;
- } else {
- self$$1[0].textContent = value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ return DomQuery(result);
+ },
+ offset: function (offset) {
+ var elm, doc, docElm;
+ var x = 0, y = 0, pos;
+ if (!offset) {
+ elm = this[0];
+ if (elm) {
+ doc = elm.ownerDocument;
+ docElm = doc.documentElement;
+ if (elm.getBoundingClientRect) {
+ pos = elm.getBoundingClientRect();
+ x = pos.left + (docElm.scrollLeft || doc.body.scrollLeft) - docElm.clientLeft;
+ y = pos.top + (docElm.scrollTop || doc.body.scrollTop) - docElm.clientTop;
+ }
</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 {
+ left: x,
+ top: 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">- return self$$1;
- }
- return self$$1[0] ? self$$1[0].innerText || self$$1[0].textContent : '';
- },
- append: function () {
- return domManipulate(this, arguments, function (node) {
- if (this.nodeType === 1 || this.host && this.host.nodeType === 1) {
- this.appendChild(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this.css(offset);
+ },
+ push: push$2,
+ sort: [].sort,
+ splice: [].splice
+ };
+ Tools.extend(DomQuery, {
+ extend: Tools.extend,
+ makeArray: function (object) {
+ if (isWindow(object) || object.nodeType) {
+ return [object];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- },
- prepend: function () {
- return domManipulate(this, arguments, function (node) {
- if (this.nodeType === 1 || this.host && this.host.nodeType === 1) {
- this.insertBefore(node, this.firstChild);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Tools.toArray(object);
+ },
+ inArray: inArray,
+ isArray: Tools.isArray,
+ each: each$2,
+ trim: trim$1,
+ grep: grep,
+ find: Sizzle,
+ expr: Sizzle.selectors,
+ unique: Sizzle.uniqueSort,
+ text: Sizzle.getText,
+ contains: Sizzle.contains,
+ filter: function (expr, elems, not) {
+ var i = elems.length;
+ if (not) {
+ expr = ':not(' + expr + ')';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }, true);
- },
- before: function () {
- var self$$1 = this;
- if (self$$1[0] && self$$1[0].parentNode) {
- return domManipulate(self$$1, arguments, function (node) {
- this.parentNode.insertBefore(node, this);
- });
- }
- return self$$1;
- },
- after: function () {
- var self$$1 = this;
- if (self$$1[0] && self$$1[0].parentNode) {
- return domManipulate(self$$1, arguments, function (node) {
- this.parentNode.insertBefore(node, this.nextSibling);
- }, true);
- }
- return self$$1;
- },
- appendTo: function (val) {
- DomQuery(val).append(this);
- return this;
- },
- prependTo: function (val) {
- DomQuery(val).prepend(this);
- return this;
- },
- replaceWith: function (content) {
- return this.before(content).remove();
- },
- wrap: function (content) {
- return wrap(this, content);
- },
- wrapAll: function (content) {
- return wrap(this, content, true);
- },
- wrapInner: function (content) {
- this.each(function () {
- DomQuery(this).contents().wrapAll(content);
- });
- return this;
- },
- unwrap: function () {
- return this.parent().each(function () {
- DomQuery(this).replaceWith(this.childNodes);
- });
- },
- clone: function () {
- var result = [];
- this.each(function () {
- result.push(this.cloneNode(true));
- });
- return DomQuery(result);
- },
- addClass: function (className) {
- return this.toggleClass(className, true);
- },
- removeClass: function (className) {
- return this.toggleClass(className, false);
- },
- toggleClass: function (className, state) {
- var self$$1 = this;
- if (typeof className !== 'string') {
- return self$$1;
- }
- if (className.indexOf(' ') !== -1) {
- each$2(className.split(' '), function () {
- self$$1.toggleClass(this, state);
- });
- } else {
- self$$1.each(function (index, node) {
- var existingClassName, classState;
- classState = hasClass(node, className);
- if (classState !== state) {
- existingClassName = node.className;
- if (classState) {
- node.className = trim$1((' ' + existingClassName + ' ').replace(' ' + className + ' ', ' '));
- } else {
- node.className += existingClassName ? ' ' + className : className;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ while (i--) {
+ if (elems[i].nodeType !== 1) {
+ elems.splice(i, 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 self$$1;
- },
- hasClass: function (className) {
- return hasClass(this[0], className);
- },
- each: function (callback) {
- return each$2(this, callback);
- },
- on: function (name$$1, callback) {
- return this.each(function () {
- Event$$1.bind(this, name$$1, callback);
- });
- },
- off: function (name$$1, callback) {
- return this.each(function () {
- Event$$1.unbind(this, name$$1, callback);
- });
- },
- trigger: function (name$$1) {
- return this.each(function () {
- if (typeof name$$1 === 'object') {
- Event$$1.fire(this, name$$1.type, name$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (elems.length === 1) {
+ elems = DomQuery.find.matchesSelector(elems[0], expr) ? [elems[0]] : [];
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- Event$$1.fire(this, name$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ elems = DomQuery.find.matches(expr, elems);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- },
- show: function () {
- return this.css('display', '');
- },
- hide: function () {
- return this.css('display', 'none');
- },
- slice: function () {
- return new DomQuery(slice$2.apply(this, arguments));
- },
- eq: function (index) {
- return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
- },
- first: function () {
- return this.eq(0);
- },
- last: function () {
- return this.eq(-1);
- },
- find: function (selector) {
- var i, l;
- var ret = [];
- for (i = 0, l = this.length; i < l; i++) {
- DomQuery.find(selector, this[i], ret);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return elems;
</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 DomQuery(ret);
- },
- filter: function (selector) {
- if (typeof selector === 'function') {
- return DomQuery(grep(this.toArray(), function (item, i) {
- return selector(i, item);
- }));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ var dir = function (el, prop, until) {
+ var matched = [];
+ var cur = el[prop];
+ if (typeof until !== 'string' && until instanceof DomQuery) {
+ until = until[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">- return DomQuery(DomQuery.filter(selector, this.toArray()));
- },
- closest: function (selector) {
- var result = [];
- if (selector instanceof DomQuery) {
- selector = selector[0];
- }
- this.each(function (i, node) {
- while (node) {
- if (typeof selector === 'string' && DomQuery(node).is(selector)) {
- result.push(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ while (cur && cur.nodeType !== 9) {
+ if (until !== undefined) {
+ if (cur === until) {
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else if (node === selector) {
- result.push(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (typeof until === 'string' && DomQuery(cur).is(until)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><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><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- return DomQuery(result);
- },
- offset: function (offset) {
- var elm, doc, docElm;
- var x = 0, y = 0, pos;
- if (!offset) {
- elm = this[0];
- if (elm) {
- doc = elm.ownerDocument;
- docElm = doc.documentElement;
- if (elm.getBoundingClientRect) {
- pos = elm.getBoundingClientRect();
- x = pos.left + (docElm.scrollLeft || doc.body.scrollLeft) - docElm.clientLeft;
- y = pos.top + (docElm.scrollTop || doc.body.scrollTop) - docElm.clientTop;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (cur.nodeType === 1) {
+ matched.push(cur);
</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 {
- left: x,
- top: y
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ cur = cur[prop];
</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 this.css(offset);
- },
- push: push$2,
- sort: [].sort,
- splice: [].splice
- };
- $_6cwiepljjgwe7j4.extend(DomQuery, {
- extend: $_6cwiepljjgwe7j4.extend,
- makeArray: function (object) {
- if (isWindow(object) || object.nodeType) {
- return [object];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return matched;
+ };
+ var sibling = function (node, siblingName, nodeType, until) {
+ var result = [];
+ if (until instanceof DomQuery) {
+ until = until[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">- return $_6cwiepljjgwe7j4.toArray(object);
- },
- inArray: inArray,
- isArray: $_6cwiepljjgwe7j4.isArray,
- each: each$2,
- trim: trim$1,
- grep: grep,
- find: Sizzle,
- expr: Sizzle.selectors,
- unique: Sizzle.uniqueSort,
- text: Sizzle.getText,
- contains: Sizzle.contains,
- filter: function (expr, elems, not) {
- var i = elems.length;
- if (not) {
- expr = ':not(' + expr + ')';
- }
- while (i--) {
- if (elems[i].nodeType !== 1) {
- elems.splice(i, 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (; node; node = node[siblingName]) {
+ if (nodeType && node.nodeType !== nodeType) {
+ continue;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (until !== undefined) {
+ if (node === until) {
+ break;
+ }
+ if (typeof until === 'string' && DomQuery(node).is(until)) {
+ break;
+ }
+ }
+ result.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 (elems.length === 1) {
- elems = DomQuery.find.matchesSelector(elems[0], expr) ? [elems[0]] : [];
- } else {
- elems = DomQuery.find.matches(expr, elems);
- }
- return elems;
- }
- });
- var dir = function (el, prop, until) {
- var matched = [];
- var cur = el[prop];
- if (typeof until !== 'string' && until instanceof DomQuery) {
- until = until[0];
- }
- while (cur && cur.nodeType !== 9) {
- if (until !== undefined) {
- if (cur === until) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return result;
+ };
+ var firstSibling = function (node, siblingName, nodeType) {
+ for (node = node[siblingName]; node; node = node[siblingName]) {
+ if (node.nodeType === nodeType) {
+ return 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 (typeof until === 'string' && DomQuery(cur).is(until)) {
- break;
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (cur.nodeType === 1) {
- matched.push(cur);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return null;
+ };
+ each$2({
+ parent: function (node) {
+ var parent$$1 = node.parentNode;
+ return parent$$1 && parent$$1.nodeType !== 11 ? parent$$1 : null;
+ },
+ parents: function (node) {
+ return dir(node, 'parentNode');
+ },
+ next: function (node) {
+ return firstSibling(node, 'nextSibling', 1);
+ },
+ prev: function (node) {
+ return firstSibling(node, 'previousSibling', 1);
+ },
+ children: function (node) {
+ return sibling(node.firstChild, 'nextSibling', 1);
+ },
+ contents: function (node) {
+ return Tools.toArray((node.nodeName === 'iframe' ? node.contentDocument || node.contentWindow.document : node).childNodes);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- cur = cur[prop];
- }
- return matched;
- };
- var sibling = function (node, siblingName, nodeType, until) {
- var result = [];
- if (until instanceof DomQuery) {
- until = until[0];
- }
- for (; node; node = node[siblingName]) {
- if (nodeType && node.nodeType !== nodeType) {
- continue;
- }
- if (until !== undefined) {
- if (node === until) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }, function (name$$1, fn) {
+ DomQuery.fn[name$$1] = function (selector) {
+ var self$$1 = this;
+ var result = [];
+ self$$1.each(function () {
+ var nodes = fn.call(result, this, selector, result);
+ if (nodes) {
+ if (DomQuery.isArray(nodes)) {
+ result.push.apply(result, nodes);
+ } else {
+ result.push(nodes);
+ }
+ }
+ });
+ if (this.length > 1) {
+ if (!skipUniques[name$$1]) {
+ result = DomQuery.unique(result);
+ }
+ if (name$$1.indexOf('parents') === 0) {
+ result = result.reverse();
+ }
</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 until === 'string' && DomQuery(node).is(until)) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ result = DomQuery(result);
+ if (selector) {
+ return result.filter(selector);
</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 result;
+ };
+ });
+ each$2({
+ parentsUntil: function (node, until) {
+ return dir(node, 'parentNode', until);
+ },
+ nextUntil: function (node, until) {
+ return sibling(node, 'nextSibling', 1, until).slice(1);
+ },
+ prevUntil: function (node, until) {
+ return sibling(node, 'previousSibling', 1, until).slice(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">- result.push(node);
- }
- return result;
- };
- var firstSibling = function (node, siblingName, nodeType) {
- for (node = node[siblingName]; node; node = node[siblingName]) {
- if (node.nodeType === nodeType) {
- return node;
- }
- }
- return null;
- };
- each$2({
- parent: function (node) {
- var parent$$1 = node.parentNode;
- return parent$$1 && parent$$1.nodeType !== 11 ? parent$$1 : null;
- },
- parents: function (node) {
- return dir(node, 'parentNode');
- },
- next: function (node) {
- return firstSibling(node, 'nextSibling', 1);
- },
- prev: function (node) {
- return firstSibling(node, 'previousSibling', 1);
- },
- children: function (node) {
- return sibling(node.firstChild, 'nextSibling', 1);
- },
- contents: function (node) {
- return $_6cwiepljjgwe7j4.toArray((node.nodeName === 'iframe' ? node.contentDocument || node.contentWindow.document : node).childNodes);
- }
- }, function (name$$1, fn) {
- DomQuery.fn[name$$1] = function (selector) {
- var self$$1 = this;
- var result = [];
- self$$1.each(function () {
- var nodes = fn.call(result, this, selector, result);
- if (nodes) {
- if (DomQuery.isArray(nodes)) {
- result.push.apply(result, nodes);
- } else {
- result.push(nodes);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }, function (name$$1, fn) {
+ DomQuery.fn[name$$1] = function (selector, filter) {
+ var self$$1 = this;
+ var result = [];
+ self$$1.each(function () {
+ var nodes = fn.call(result, this, selector, result);
+ if (nodes) {
+ if (DomQuery.isArray(nodes)) {
+ result.push.apply(result, nodes);
+ } else {
+ result.push(nodes);
+ }
</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.length > 1) {
- if (!skipUniques[name$$1]) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ if (this.length > 1) {
</ins><span class="cx" style="display: block; padding: 0 10px"> result = DomQuery.unique(result);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (name$$1.indexOf('parents') === 0 || name$$1 === 'prevUntil') {
+ result = result.reverse();
+ }
</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$$1.indexOf('parents') === 0) {
- result = result.reverse();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ result = DomQuery(result);
+ if (filter) {
+ return result.filter(filter);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- result = DomQuery(result);
- if (selector) {
- return result.filter(selector);
- }
- return result;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return result;
+ };
+ });
+ DomQuery.fn.is = function (selector) {
+ return !!selector && this.filter(selector).length > 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">- });
- each$2({
- parentsUntil: function (node, until) {
- return dir(node, 'parentNode', until);
- },
- nextUntil: function (node, until) {
- return sibling(node, 'nextSibling', 1, until).slice(1);
- },
- prevUntil: function (node, until) {
- return sibling(node, 'previousSibling', 1, until).slice(1);
- }
- }, function (name$$1, fn) {
- DomQuery.fn[name$$1] = function (selector, filter) {
- var self$$1 = this;
- var result = [];
- self$$1.each(function () {
- var nodes = fn.call(result, this, selector, result);
- if (nodes) {
- if (DomQuery.isArray(nodes)) {
- result.push.apply(result, nodes);
- } else {
- result.push(nodes);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ DomQuery.fn.init.prototype = DomQuery.fn;
+ DomQuery.overrideDefaults = function (callback) {
+ var defaults;
+ var sub = function (selector, context) {
+ defaults = defaults || callback();
+ if (arguments.length === 0) {
+ selector = defaults.element;
</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.length > 1) {
- result = DomQuery.unique(result);
- if (name$$1.indexOf('parents') === 0 || name$$1 === 'prevUntil') {
- result = result.reverse();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!context) {
+ context = defaults.context;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- result = DomQuery(result);
- if (filter) {
- return result.filter(filter);
- }
- return result;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return new sub.fn.init(selector, context);
+ };
+ DomQuery.extend(sub, this);
+ return sub;
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- DomQuery.fn.is = function (selector) {
- return !!selector && this.filter(selector).length > 0;
- };
- DomQuery.fn.init.prototype = DomQuery.fn;
- DomQuery.overrideDefaults = function (callback) {
- var defaults;
- var sub = function (selector, context) {
- defaults = defaults || callback();
- if (arguments.length === 0) {
- selector = defaults.element;
- }
- if (!context) {
- context = defaults.context;
- }
- return new sub.fn.init(selector, context);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var appendHooks = function (targetHooks, prop, hooks) {
+ each$2(hooks, function (name$$1, func) {
+ targetHooks[name$$1] = targetHooks[name$$1] || {};
+ targetHooks[name$$1][prop] = func;
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- DomQuery.extend(sub, this);
- return sub;
- };
- var appendHooks = function (targetHooks, prop, hooks) {
- each$2(hooks, function (name$$1, func) {
- targetHooks[name$$1] = targetHooks[name$$1] || {};
- targetHooks[name$$1][prop] = func;
- });
- };
- if ($_bcvfv9ajjgwe79v.ie && $_bcvfv9ajjgwe79v.ie < 8) {
- appendHooks(attrHooks, 'get', {
- maxlength: function (elm) {
- var value = elm.maxLength;
- if (value === 2147483647) {
- return undefined;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (Env.ie && Env.ie < 8) {
+ appendHooks(attrHooks, 'get', {
+ maxlength: function (elm) {
+ var value = elm.maxLength;
+ if (value === 2147483647) {
+ return undefined;
+ }
+ return value;
+ },
+ size: function (elm) {
+ var value = elm.size;
+ if (value === 20) {
+ return undefined;
+ }
+ return value;
+ },
+ class: function (elm) {
+ return elm.className;
+ },
+ style: function (elm) {
+ var value = elm.style.cssText;
+ if (value.length === 0) {
+ return undefined;
+ }
+ 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">- return value;
- },
- size: function (elm) {
- var value = elm.size;
- if (value === 20) {
- return undefined;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ appendHooks(attrHooks, 'set', {
+ class: function (elm, value) {
+ elm.className = value;
+ },
+ style: function (elm, value) {
+ elm.style.cssText = 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">- return value;
- },
- class: function (elm) {
- return elm.className;
- },
- style: function (elm) {
- var value = elm.style.cssText;
- if (value.length === 0) {
- return undefined;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ }
+ if (Env.ie && Env.ie < 9) {
+ cssFix.float = 'styleFloat';
+ appendHooks(cssHooks, 'set', {
+ opacity: function (elm, value) {
+ var style = elm.style;
+ if (value === null || value === '') {
+ style.removeAttribute('filter');
+ } else {
+ style.zoom = 1;
+ style.filter = 'alpha(opacity=' + value * 100 + ')';
+ }
</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;
- }
- });
- appendHooks(attrHooks, 'set', {
- class: function (elm, value) {
- elm.className = value;
- },
- style: function (elm, value) {
- elm.style.cssText = value;
- }
- });
- }
- if ($_bcvfv9ajjgwe79v.ie && $_bcvfv9ajjgwe79v.ie < 9) {
- cssFix.float = 'styleFloat';
- appendHooks(cssHooks, 'set', {
- opacity: function (elm, value) {
- var style = elm.style;
- if (value === null || value === '') {
- style.removeAttribute('filter');
- } else {
- style.zoom = 1;
- style.filter = 'alpha(opacity=' + value * 100 + ')';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ }
+ DomQuery.attrHooks = attrHooks;
+ DomQuery.cssHooks = cssHooks;
+
+ var cached = function (f) {
+ var called = false;
+ var r;
+ return function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_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">- }
- });
- }
- DomQuery.attrHooks = attrHooks;
- DomQuery.cssHooks = cssHooks;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!called) {
+ called = true;
+ r = f.apply(null, args);
+ }
+ return r;
+ };
+ };
</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 cached = function (f) {
- var called = false;
- var r;
- return function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var firstMatch = function (regexes, s) {
+ for (var i = 0; i < regexes.length; i++) {
+ var x = regexes[i];
+ if (x.test(s))
+ return x;
</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 (!called) {
- called = true;
- r = f.apply(null, args);
- }
- return r;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return undefined;
</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 firstMatch = function (regexes, s) {
- for (var i = 0; i < regexes.length; i++) {
- var x = regexes[i];
- if (x.test(s))
- return x;
- }
- return undefined;
- };
- var find$2 = function (regexes, agent) {
- var r = firstMatch(regexes, agent);
- if (!r)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var find$2 = function (regexes, agent) {
+ var r = firstMatch(regexes, agent);
+ if (!r)
+ return {
+ major: 0,
+ minor: 0
+ };
+ var group = function (i) {
+ return Number(agent.replace(r, '$' + i));
+ };
+ return nu(group(1), group(2));
+ };
+ var detect = function (versionRegexes, agent) {
+ var cleanedAgent = String(agent).toLowerCase();
+ if (versionRegexes.length === 0)
+ return unknown();
+ return find$2(versionRegexes, cleanedAgent);
+ };
+ var unknown = function () {
+ return nu(0, 0);
+ };
+ var nu = function (major, minor) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- major: 0,
- minor: 0
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ major: major,
+ minor: minor
</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 group = function (i) {
- return Number(agent.replace(r, '$' + i));
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return nu(group(1), group(2));
- };
- var detect = function (versionRegexes, agent) {
- var cleanedAgent = String(agent).toLowerCase();
- if (versionRegexes.length === 0)
- return unknown();
- return find$2(versionRegexes, cleanedAgent);
- };
- var unknown = function () {
- return nu(0, 0);
- };
- var nu = function (major, minor) {
- return {
- major: major,
- minor: minor
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Version = {
+ nu: nu,
+ detect: detect,
+ unknown: unknown
</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 $_4qb10ysjjgwe7kc = {
- nu: nu,
- detect: detect,
- unknown: unknown
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var edge = 'Edge';
- var chrome = 'Chrome';
- var ie$1 = 'IE';
- var opera$1 = 'Opera';
- var firefox = 'Firefox';
- var safari = 'Safari';
- var isBrowser = function (name, current) {
- return function () {
- return current === name;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var edge = 'Edge';
+ var chrome = 'Chrome';
+ var ie$1 = 'IE';
+ var opera$1 = 'Opera';
+ var firefox = 'Firefox';
+ var safari = 'Safari';
+ var isBrowser = function (name, current) {
+ return function () {
+ return current === name;
+ };
</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 unknown$1 = function () {
- return nu$1({
- current: undefined,
- version: $_4qb10ysjjgwe7kc.unknown()
- });
- };
- var nu$1 = function (info) {
- var current = info.current;
- var version = info.version;
- return {
- current: current,
- version: version,
- isEdge: isBrowser(edge, current),
- isChrome: isBrowser(chrome, current),
- isIE: isBrowser(ie$1, current),
- isOpera: isBrowser(opera$1, current),
- isFirefox: isBrowser(firefox, current),
- isSafari: isBrowser(safari, current)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var unknown$1 = function () {
+ return nu$1({
+ current: undefined,
+ version: Version.unknown()
+ });
</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 $_66ohnorjjgwe7k7 = {
- unknown: unknown$1,
- nu: nu$1,
- edge: constant(edge),
- chrome: constant(chrome),
- ie: constant(ie$1),
- opera: constant(opera$1),
- firefox: constant(firefox),
- safari: constant(safari)
- };
-
- var windows = 'Windows';
- var ios = 'iOS';
- var android$1 = 'Android';
- var linux = 'Linux';
- var osx = 'OSX';
- var solaris = 'Solaris';
- var freebsd = 'FreeBSD';
- var isOS = function (name, current) {
- return function () {
- return current === name;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var nu$1 = function (info) {
+ var current = info.current;
+ var version = info.version;
+ return {
+ current: current,
+ version: version,
+ isEdge: isBrowser(edge, current),
+ isChrome: isBrowser(chrome, current),
+ isIE: isBrowser(ie$1, current),
+ isOpera: isBrowser(opera$1, current),
+ isFirefox: isBrowser(firefox, current),
+ isSafari: isBrowser(safari, current)
+ };
</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 unknown$2 = function () {
- return nu$2({
- current: undefined,
- version: $_4qb10ysjjgwe7kc.unknown()
- });
- };
- var nu$2 = function (info) {
- var current = info.current;
- var version = info.version;
- return {
- current: current,
- version: version,
- isWindows: isOS(windows, current),
- isiOS: isOS(ios, current),
- isAndroid: isOS(android$1, current),
- isOSX: isOS(osx, current),
- isLinux: isOS(linux, current),
- isSolaris: isOS(solaris, current),
- isFreeBSD: isOS(freebsd, current)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Browser = {
+ unknown: unknown$1,
+ nu: nu$1,
+ edge: constant(edge),
+ chrome: constant(chrome),
+ ie: constant(ie$1),
+ opera: constant(opera$1),
+ firefox: constant(firefox),
+ safari: constant(safari)
</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 $_m4ezttjjgwe7kg = {
- unknown: unknown$2,
- nu: nu$2,
- windows: constant(windows),
- ios: constant(ios),
- android: constant(android$1),
- linux: constant(linux),
- osx: constant(osx),
- solaris: constant(solaris),
- freebsd: constant(freebsd)
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function DeviceType (os, browser, userAgent) {
- var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true;
- var isiPhone = os.isiOS() && !isiPad;
- var isAndroid3 = os.isAndroid() && os.version.major === 3;
- var isAndroid4 = os.isAndroid() && os.version.major === 4;
- var isTablet = isiPad || isAndroid3 || isAndroid4 && /mobile/i.test(userAgent) === true;
- var isTouch = os.isiOS() || os.isAndroid();
- var isPhone = isTouch && !isTablet;
- var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false;
- return {
- isiPad: constant(isiPad),
- isiPhone: constant(isiPhone),
- isTablet: constant(isTablet),
- isPhone: constant(isPhone),
- isTouch: constant(isTouch),
- isAndroid: os.isAndroid,
- isiOS: os.isiOS,
- isWebView: constant(iOSwebview)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var windows = 'Windows';
+ var ios = 'iOS';
+ var android$1 = 'Android';
+ var linux = 'Linux';
+ var osx = 'OSX';
+ var solaris = 'Solaris';
+ var freebsd = 'FreeBSD';
+ var isOS = function (name, current) {
+ return function () {
+ return current === name;
+ };
</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 detect$1 = function (candidates, userAgent) {
- var agent = String(userAgent).toLowerCase();
- return find(candidates, function (candidate) {
- return candidate.search(agent);
- });
- };
- var detectBrowser = function (browsers, userAgent) {
- return detect$1(browsers, userAgent).map(function (browser) {
- var version = $_4qb10ysjjgwe7kc.detect(browser.versionRegexes, userAgent);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var unknown$2 = function () {
+ return nu$2({
+ current: undefined,
+ version: Version.unknown()
+ });
+ };
+ var nu$2 = function (info) {
+ var current = info.current;
+ var version = info.version;
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- current: browser.name,
- version: version
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ current: current,
+ version: version,
+ isWindows: isOS(windows, current),
+ isiOS: isOS(ios, current),
+ isAndroid: isOS(android$1, current),
+ isOSX: isOS(osx, current),
+ isLinux: isOS(linux, current),
+ isSolaris: isOS(solaris, current),
+ isFreeBSD: isOS(freebsd, current)
</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 detectOs = function (oses, userAgent) {
- return detect$1(oses, userAgent).map(function (os) {
- var version = $_4qb10ysjjgwe7kc.detect(os.versionRegexes, userAgent);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var OperatingSystem = {
+ unknown: unknown$2,
+ nu: nu$2,
+ windows: constant(windows),
+ ios: constant(ios),
+ android: constant(android$1),
+ linux: constant(linux),
+ osx: constant(osx),
+ solaris: constant(solaris),
+ freebsd: constant(freebsd)
+ };
+
+ var DeviceType = function (os, browser, userAgent) {
+ var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true;
+ var isiPhone = os.isiOS() && !isiPad;
+ var isAndroid3 = os.isAndroid() && os.version.major === 3;
+ var isAndroid4 = os.isAndroid() && os.version.major === 4;
+ var isTablet = isiPad || isAndroid3 || isAndroid4 && /mobile/i.test(userAgent) === true;
+ var isTouch = os.isiOS() || os.isAndroid();
+ var isPhone = isTouch && !isTablet;
+ var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false;
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- current: os.name,
- version: version
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ isiPad: constant(isiPad),
+ isiPhone: constant(isiPhone),
+ isTablet: constant(isTablet),
+ isPhone: constant(isPhone),
+ isTouch: constant(isTouch),
+ isAndroid: os.isAndroid,
+ isiOS: os.isiOS,
+ isWebView: constant(iOSwebview)
</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 $_5cav46vjjgwe7kq = {
- detectBrowser: detectBrowser,
- detectOs: detectOs
- };
</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">- var contains$2 = function (str, substr) {
- return str.indexOf(substr) !== -1;
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var detect$1 = function (candidates, userAgent) {
+ var agent = String(userAgent).toLowerCase();
+ return find(candidates, function (candidate) {
+ return candidate.search(agent);
+ });
+ };
+ var detectBrowser = function (browsers, userAgent) {
+ return detect$1(browsers, userAgent).map(function (browser) {
+ var version = Version.detect(browser.versionRegexes, userAgent);
+ return {
+ current: browser.name,
+ version: version
+ };
+ });
+ };
+ var detectOs = function (oses, userAgent) {
+ return detect$1(oses, userAgent).map(function (os) {
+ var version = Version.detect(os.versionRegexes, userAgent);
+ return {
+ current: os.name,
+ version: version
+ };
+ });
+ };
+ var UaString = {
+ detectBrowser: detectBrowser,
+ detectOs: detectOs
+ };
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var contains$2 = function (str, substr) {
+ return str.indexOf(substr) !== -1;
+ };
+ var trim$2 = function (str) {
+ return str.replace(/^\s+|\s+$/g, '');
+ };
+ var lTrim = function (str) {
+ return str.replace(/^\s+/g, '');
+ };
+ var rTrim = function (str) {
+ return str.replace(/\s+$/g, '');
+ };
</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 trim$2 = function (str) {
- return str.replace(/^\s+|\s+$/g, '');
- };
-
- var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/;
- var checkContains = function (target) {
- return function (uastring) {
- return contains$2(uastring, target);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/;
+ var checkContains = function (target) {
+ return function (uastring) {
+ return contains$2(uastring, 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">- };
- var browsers = [
- {
- name: 'Edge',
- versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
- search: function (uastring) {
- var monstrosity = contains$2(uastring, 'edge/') && contains$2(uastring, 'chrome') && contains$2(uastring, 'safari') && contains$2(uastring, 'applewebkit');
- return monstrosity;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var browsers = [
+ {
+ name: 'Edge',
+ versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
+ search: function (uastring) {
+ var monstrosity = contains$2(uastring, 'edge/') && contains$2(uastring, 'chrome') && contains$2(uastring, 'safari') && contains$2(uastring, 'applewebkit');
+ return monstrosity;
+ }
+ },
+ {
+ name: 'Chrome',
+ versionRegexes: [
+ /.*?chrome\/([0-9]+)\.([0-9]+).*/,
+ normalVersionRegex
+ ],
+ search: function (uastring) {
+ return contains$2(uastring, 'chrome') && !contains$2(uastring, 'chromeframe');
+ }
+ },
+ {
+ name: 'IE',
+ versionRegexes: [
+ /.*?msie\ ?([0-9]+)\.([0-9]+).*/,
+ /.*?rv:([0-9]+)\.([0-9]+).*/
+ ],
+ search: function (uastring) {
+ return contains$2(uastring, 'msie') || contains$2(uastring, 'trident');
+ }
+ },
+ {
+ name: 'Opera',
+ versionRegexes: [
+ normalVersionRegex,
+ /.*?opera\/([0-9]+)\.([0-9]+).*/
+ ],
+ search: checkContains('opera')
+ },
+ {
+ name: 'Firefox',
+ versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],
+ search: checkContains('firefox')
+ },
+ {
+ name: 'Safari',
+ versionRegexes: [
+ normalVersionRegex,
+ /.*?cpu os ([0-9]+)_([0-9]+).*/
+ ],
+ search: function (uastring) {
+ return (contains$2(uastring, 'safari') || contains$2(uastring, 'mobile/')) && contains$2(uastring, 'applewebkit');
+ }
</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: 'Chrome',
- versionRegexes: [
- /.*?chrome\/([0-9]+)\.([0-9]+).*/,
- normalVersionRegex
- ],
- search: function (uastring) {
- return contains$2(uastring, 'chrome') && !contains$2(uastring, 'chromeframe');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ];
+ var oses = [
+ {
+ name: 'Windows',
+ search: checkContains('win'),
+ versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]
+ },
+ {
+ name: 'iOS',
+ search: function (uastring) {
+ return contains$2(uastring, 'iphone') || contains$2(uastring, 'ipad');
+ },
+ versionRegexes: [
+ /.*?version\/\ ?([0-9]+)\.([0-9]+).*/,
+ /.*cpu os ([0-9]+)_([0-9]+).*/,
+ /.*cpu iphone os ([0-9]+)_([0-9]+).*/
+ ]
+ },
+ {
+ name: 'Android',
+ search: checkContains('android'),
+ versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/]
+ },
+ {
+ name: 'OSX',
+ search: checkContains('os x'),
+ versionRegexes: [/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]
+ },
+ {
+ name: 'Linux',
+ search: checkContains('linux'),
+ versionRegexes: []
+ },
+ {
+ name: 'Solaris',
+ search: checkContains('sunos'),
+ versionRegexes: []
+ },
+ {
+ name: 'FreeBSD',
+ search: checkContains('freebsd'),
+ versionRegexes: []
</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: 'IE',
- versionRegexes: [
- /.*?msie\ ?([0-9]+)\.([0-9]+).*/,
- /.*?rv:([0-9]+)\.([0-9]+).*/
- ],
- search: function (uastring) {
- return contains$2(uastring, 'msie') || contains$2(uastring, 'trident');
- }
- },
- {
- name: 'Opera',
- versionRegexes: [
- normalVersionRegex,
- /.*?opera\/([0-9]+)\.([0-9]+).*/
- ],
- search: checkContains('opera')
- },
- {
- name: 'Firefox',
- versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],
- search: checkContains('firefox')
- },
- {
- name: 'Safari',
- versionRegexes: [
- normalVersionRegex,
- /.*?cpu os ([0-9]+)_([0-9]+).*/
- ],
- search: function (uastring) {
- return (contains$2(uastring, 'safari') || contains$2(uastring, 'mobile/')) && contains$2(uastring, 'applewebkit');
- }
- }
- ];
- var oses = [
- {
- name: 'Windows',
- search: checkContains('win'),
- versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]
- },
- {
- name: 'iOS',
- search: function (uastring) {
- return contains$2(uastring, 'iphone') || contains$2(uastring, 'ipad');
- },
- versionRegexes: [
- /.*?version\/\ ?([0-9]+)\.([0-9]+).*/,
- /.*cpu os ([0-9]+)_([0-9]+).*/,
- /.*cpu iphone os ([0-9]+)_([0-9]+).*/
- ]
- },
- {
- name: 'Android',
- search: checkContains('android'),
- versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/]
- },
- {
- name: 'OSX',
- search: checkContains('os x'),
- versionRegexes: [/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]
- },
- {
- name: 'Linux',
- search: checkContains('linux'),
- versionRegexes: []
- },
- {
- name: 'Solaris',
- search: checkContains('sunos'),
- versionRegexes: []
- },
- {
- name: 'FreeBSD',
- search: checkContains('freebsd'),
- versionRegexes: []
- }
- ];
- var $_5exylhwjjgwe7kx = {
- browsers: constant(browsers),
- oses: constant(oses)
- };
-
- var detect$2 = function (userAgent) {
- var browsers = $_5exylhwjjgwe7kx.browsers();
- var oses = $_5exylhwjjgwe7kx.oses();
- var browser = $_5cav46vjjgwe7kq.detectBrowser(browsers, userAgent).fold($_66ohnorjjgwe7k7.unknown, $_66ohnorjjgwe7k7.nu);
- var os = $_5cav46vjjgwe7kq.detectOs(oses, userAgent).fold($_m4ezttjjgwe7kg.unknown, $_m4ezttjjgwe7kg.nu);
- var deviceType = DeviceType(os, browser, userAgent);
- return {
- browser: browser,
- os: os,
- deviceType: deviceType
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ];
+ var PlatformInfo = {
+ browsers: constant(browsers),
+ oses: constant(oses)
</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 $_b73hs8qjjgwe7k5 = { detect: detect$2 };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var detect$3 = cached(function () {
- var userAgent = navigator.userAgent;
- return $_b73hs8qjjgwe7k5.detect(userAgent);
- });
- var $_7vg267ojjgwe7k0 = { detect: detect$3 };
-
- var fromHtml = function (html, scope) {
- var doc = scope || document;
- var div = doc.createElement('div');
- div.innerHTML = html;
- if (!div.hasChildNodes() || div.childNodes.length > 1) {
- console.error('HTML does not have a single root node', html);
- throw 'HTML must have a single root node';
- }
- return fromDom(div.childNodes[0]);
- };
- var fromTag = function (tag, scope) {
- var doc = scope || document;
- var node = doc.createElement(tag);
- return fromDom(node);
- };
- var fromText = function (text, scope) {
- var doc = scope || document;
- var node = doc.createTextNode(text);
- return fromDom(node);
- };
- var fromDom = function (node) {
- if (node === null || node === undefined)
- throw new Error('Node cannot be null or undefined');
- return { dom: constant(node) };
- };
- var fromPoint = function (docElm, x, y) {
- var doc = docElm.dom();
- return Option.from(doc.elementFromPoint(x, y)).map(fromDom);
- };
- var Element$$1 = {
- fromHtml: fromHtml,
- fromTag: fromTag,
- fromText: fromText,
- fromDom: fromDom,
- fromPoint: fromPoint
- };
-
- var $_9ssocf12jjgwe7lr = {
- ATTRIBUTE: Node.ATTRIBUTE_NODE,
- CDATA_SECTION: Node.CDATA_SECTION_NODE,
- COMMENT: Node.COMMENT_NODE,
- DOCUMENT: Node.DOCUMENT_NODE,
- DOCUMENT_TYPE: Node.DOCUMENT_TYPE_NODE,
- DOCUMENT_FRAGMENT: Node.DOCUMENT_FRAGMENT_NODE,
- ELEMENT: Node.ELEMENT_NODE,
- TEXT: Node.TEXT_NODE,
- PROCESSING_INSTRUCTION: Node.PROCESSING_INSTRUCTION_NODE,
- ENTITY_REFERENCE: Node.ENTITY_REFERENCE_NODE,
- ENTITY: Node.ENTITY_NODE,
- NOTATION: Node.NOTATION_NODE
- };
-
- var name = function (element) {
- var r = element.dom().nodeName;
- return r.toLowerCase();
- };
- var type = function (element) {
- return element.dom().nodeType;
- };
- var value = function (element) {
- return element.dom().nodeValue;
- };
- var isType$1 = function (t) {
- return function (element) {
- return type(element) === t;
- };
- };
- var isComment = function (element) {
- return type(element) === $_9ssocf12jjgwe7lr.COMMENT || name(element) === '#comment';
- };
- var isElement = isType$1($_9ssocf12jjgwe7lr.ELEMENT);
- var isText = isType$1($_9ssocf12jjgwe7lr.TEXT);
- var isDocument = isType$1($_9ssocf12jjgwe7lr.DOCUMENT);
- var $_fxxo5411jjgwe7lq = {
- name: name,
- type: type,
- value: value,
- isElement: isElement,
- isText: isText,
- isDocument: isDocument,
- isComment: isComment
- };
-
- var keys = Object.keys;
- var each$3 = function (obj, f) {
- var props = keys(obj);
- for (var k = 0, len = props.length; k < len; k++) {
- var i = props[k];
- var x = obj[i];
- f(x, i, obj);
- }
- };
- var map$2 = function (obj, f) {
- return tupleMap(obj, function (x, i, obj) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var detect$2 = function (userAgent) {
+ var browsers = PlatformInfo.browsers();
+ var oses = PlatformInfo.oses();
+ var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu);
+ var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu);
+ var deviceType = DeviceType(os, browser, userAgent);
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- k: i,
- v: f(x, i, obj)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ browser: browser,
+ os: os,
+ deviceType: deviceType
</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 tupleMap = function (obj, f) {
- var r = {};
- each$3(obj, function (x, i) {
- var tuple = f(x, i, obj);
- r[tuple.k] = tuple.v;
- });
- return r;
- };
- var bifilter = function (obj, pred) {
- var t = {};
- var f = {};
- each$3(obj, function (x, i) {
- var branch = pred(x, i) ? t : f;
- branch[i] = x;
- });
- return {
- t: t,
- f: f
</del><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">+ var PlatformDetection = { detect: detect$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">- var rawSet = function (dom, key, value) {
- if (isString(value) || isBoolean(value) || isNumber(value)) {
- dom.setAttribute(key, value + '');
- } else {
- console.error('Invalid call to Attr.set. Key ', key, ':: Value ', value, ':: Element ', dom);
- throw new Error('Attribute value was not simple');
- }
- };
- var set = function (element, key, value) {
- rawSet(element.dom(), key, value);
- };
- var setAll = function (element, attrs) {
- var dom = element.dom();
- each$3(attrs, function (v, k) {
- rawSet(dom, k, v);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var detect$3 = cached(function () {
+ var userAgent = navigator.userAgent;
+ return PlatformDetection.detect(userAgent);
</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 get = function (element, key) {
- var v = element.dom().getAttribute(key);
- return v === null ? undefined : v;
- };
- var has = function (element, key) {
- var dom = element.dom();
- return dom && dom.hasAttribute ? dom.hasAttribute(key) : false;
- };
- var remove = function (element, key) {
- element.dom().removeAttribute(key);
- };
- var hasNone = function (element) {
- var attrs = element.dom().attributes;
- return attrs === undefined || attrs === null || attrs.length === 0;
- };
- var clone = function (element) {
- return foldl(element.dom().attributes, function (acc, attr) {
- acc[attr.name] = attr.value;
- return acc;
- }, {});
- };
- var transferOne = function (source, destination, attr) {
- if (has(source, attr) && !has(destination, attr))
- set(destination, attr, get(source, attr));
- };
- var transfer = function (source, destination, attrs) {
- if (!$_fxxo5411jjgwe7lq.isElement(source) || !$_fxxo5411jjgwe7lq.isElement(destination))
- return;
- each(attrs, function (attr) {
- transferOne(source, destination, attr);
- });
- };
- var $_etx7gr15jjgwe7mr = {
- clone: clone,
- set: set,
- setAll: setAll,
- get: get,
- has: has,
- remove: remove,
- hasNone: hasNone,
- transfer: transfer
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var PlatformDetection$1 = { detect: detect$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 inBody = function (element) {
- var dom = $_fxxo5411jjgwe7lq.isText(element) ? element.dom().parentNode : element.dom();
- return dom !== undefined && dom !== null && dom.ownerDocument.body.contains(dom);
- };
- var body = cached(function () {
- return getBody(Element$$1.fromDom(document));
- });
- var getBody = function (doc) {
- var body = doc.dom().body;
- if (body === null || body === undefined)
- throw 'Body is not available yet';
- return Element$$1.fromDom(body);
- };
- var $_eu440l16jjgwe7n2 = {
- body: body,
- getBody: getBody,
- inBody: inBody
- };
-
- var isSupported = function (dom) {
- return dom.style !== undefined;
- };
- var $_1br9d717jjgwe7n9 = { isSupported: isSupported };
-
- var internalSet = function (dom, property, value) {
- if (!isString(value)) {
- console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom);
- throw new Error('CSS value must be a string: ' + value);
- }
- if ($_1br9d717jjgwe7n9.isSupported(dom))
- dom.style.setProperty(property, value);
- };
- var internalRemove = function (dom, property) {
- if ($_1br9d717jjgwe7n9.isSupported(dom))
- dom.style.removeProperty(property);
- };
- var set$1 = function (element, property, value) {
- var dom = element.dom();
- internalSet(dom, property, value);
- };
- var setAll$1 = function (element, css) {
- var dom = element.dom();
- each$3(css, function (v, k) {
- internalSet(dom, k, v);
- });
- };
- var setOptions = function (element, css) {
- var dom = element.dom();
- each$3(css, function (v, k) {
- v.fold(function () {
- internalRemove(dom, k);
- }, function (value) {
- internalSet(dom, k, value);
- });
- });
- };
- var get$1 = function (element, property) {
- var dom = element.dom();
- var styles = window.getComputedStyle(dom);
- var r = styles.getPropertyValue(property);
- var v = r === '' && !$_eu440l16jjgwe7n2.inBody(element) ? getUnsafeProperty(dom, property) : r;
- return v === null ? undefined : v;
- };
- var getUnsafeProperty = function (dom, property) {
- return $_1br9d717jjgwe7n9.isSupported(dom) ? dom.style.getPropertyValue(property) : '';
- };
- var getRaw = function (element, property) {
- var dom = element.dom();
- var raw = getUnsafeProperty(dom, property);
- return Option.from(raw).filter(function (r) {
- return r.length > 0;
- });
- };
- var getAllRaw = function (element) {
- var css = {};
- var dom = element.dom();
- if ($_1br9d717jjgwe7n9.isSupported(dom)) {
- for (var i = 0; i < dom.style.length; i++) {
- var ruleName = dom.style.item(i);
- css[ruleName] = dom.style[ruleName];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fromHtml = function (html, scope) {
+ var doc = scope || document;
+ var div = doc.createElement('div');
+ div.innerHTML = html;
+ if (!div.hasChildNodes() || div.childNodes.length > 1) {
+ console.error('HTML does not have a single root node', html);
+ throw 'HTML must have a single root 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 css;
- };
- var isValidValue = function (tag, property, value) {
- var element = Element$$1.fromTag(tag);
- set$1(element, property, value);
- var style = getRaw(element, property);
- return style.isSome();
- };
- var remove$1 = function (element, property) {
- var dom = element.dom();
- internalRemove(dom, property);
- if ($_etx7gr15jjgwe7mr.has(element, 'style') && trim$2($_etx7gr15jjgwe7mr.get(element, 'style')) === '') {
- $_etx7gr15jjgwe7mr.remove(element, 'style');
- }
- };
- var preserve = function (element, f) {
- var oldStyles = $_etx7gr15jjgwe7mr.get(element, 'style');
- var result = f(element);
- var restore = oldStyles === undefined ? $_etx7gr15jjgwe7mr.remove : $_etx7gr15jjgwe7mr.set;
- restore(element, 'style', oldStyles);
- return result;
- };
- var copy = function (source, target) {
- var sourceDom = source.dom();
- var targetDom = target.dom();
- if ($_1br9d717jjgwe7n9.isSupported(sourceDom) && $_1br9d717jjgwe7n9.isSupported(targetDom)) {
- targetDom.style.cssText = sourceDom.style.cssText;
- }
- };
- var reflow = function (e) {
- return e.dom().offsetWidth;
- };
- var transferOne$1 = function (source, destination, style) {
- getRaw(source, style).each(function (value) {
- if (getRaw(destination, style).isNone())
- set$1(destination, style, value);
- });
- };
- var transfer$1 = function (source, destination, styles) {
- if (!$_fxxo5411jjgwe7lq.isElement(source) || !$_fxxo5411jjgwe7lq.isElement(destination))
- return;
- each(styles, function (style) {
- transferOne$1(source, destination, style);
- });
- };
- var $_e0ei5w13jjgwe7m4 = {
- copy: copy,
- set: set$1,
- preserve: preserve,
- setAll: setAll$1,
- setOptions: setOptions,
- remove: remove$1,
- get: get$1,
- getRaw: getRaw,
- getAllRaw: getAllRaw,
- isValidValue: isValidValue,
- reflow: reflow,
- transfer: transfer$1
- };
-
- var Immutable = function () {
- var fields = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- fields[_i] = arguments[_i];
- }
- return function () {
- var values = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- values[_i] = arguments[_i];
- }
- if (fields.length !== values.length) {
- throw new Error('Wrong number of arguments to struct. Expected "[' + fields.length + ']", got ' + values.length + ' arguments');
- }
- var struct = {};
- each(fields, function (name, i) {
- struct[name] = constant(values[i]);
- });
- return struct;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return fromDom(div.childNodes[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">- };
-
- var toArray$1 = function (target, f) {
- var r = [];
- var recurse = function (e) {
- r.push(e);
- return f(e);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fromTag = function (tag, scope) {
+ var doc = scope || document;
+ var node = doc.createElement(tag);
+ return fromDom(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 cur = f(target);
- do {
- cur = cur.bind(recurse);
- } while (cur.isSome());
- return r;
- };
- var $_2hsygk1djjgwe7o3 = { toArray: toArray$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fromText = function (text, scope) {
+ var doc = scope || document;
+ var node = doc.createTextNode(text);
+ return fromDom(node);
+ };
+ var fromDom = function (node) {
+ if (node === null || node === undefined)
+ throw new Error('Node cannot be null or undefined');
+ return { dom: constant(node) };
+ };
+ var fromPoint = function (docElm, x, y) {
+ var doc = docElm.dom();
+ return Option.from(doc.elementFromPoint(x, y)).map(fromDom);
+ };
+ var Element$$1 = {
+ fromHtml: fromHtml,
+ fromTag: fromTag,
+ fromText: fromText,
+ fromDom: fromDom,
+ fromPoint: fromPoint
+ };
</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 node = function () {
- var f = $_6xhbl4cjjgwe7a3.getOrDie('Node');
- return f;
- };
- var compareDocumentPosition = function (a, b, match) {
- return (a.compareDocumentPosition(b) & match) !== 0;
- };
- var documentPositionPreceding = function (a, b) {
- return compareDocumentPosition(a, b, node().DOCUMENT_POSITION_PRECEDING);
- };
- var documentPositionContainedBy = function (a, b) {
- return compareDocumentPosition(a, b, node().DOCUMENT_POSITION_CONTAINED_BY);
- };
- var $_g79q0i1fjjgwe7on = {
- documentPositionPreceding: documentPositionPreceding,
- documentPositionContainedBy: documentPositionContainedBy
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ATTRIBUTE = Node.ATTRIBUTE_NODE;
+ var CDATA_SECTION = Node.CDATA_SECTION_NODE;
+ var COMMENT = Node.COMMENT_NODE;
+ var DOCUMENT = Node.DOCUMENT_NODE;
+ var DOCUMENT_TYPE = Node.DOCUMENT_TYPE_NODE;
+ var DOCUMENT_FRAGMENT = Node.DOCUMENT_FRAGMENT_NODE;
+ var ELEMENT = Node.ELEMENT_NODE;
+ var TEXT = Node.TEXT_NODE;
+ var PROCESSING_INSTRUCTION = Node.PROCESSING_INSTRUCTION_NODE;
+ var ENTITY_REFERENCE = Node.ENTITY_REFERENCE_NODE;
+ var ENTITY = Node.ENTITY_NODE;
+ var NOTATION = Node.NOTATION_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 ELEMENT = $_9ssocf12jjgwe7lr.ELEMENT;
- var DOCUMENT = $_9ssocf12jjgwe7lr.DOCUMENT;
- var is$1 = function (element, selector) {
- var elem = element.dom();
- if (elem.nodeType !== ELEMENT)
- return false;
- else if (elem.matches !== undefined)
- return elem.matches(selector);
- else if (elem.msMatchesSelector !== undefined)
- return elem.msMatchesSelector(selector);
- else if (elem.webkitMatchesSelector !== undefined)
- return elem.webkitMatchesSelector(selector);
- else if (elem.mozMatchesSelector !== undefined)
- return elem.mozMatchesSelector(selector);
- else
- throw new Error('Browser lacks native selectors');
- };
- var bypassSelector = function (dom) {
- return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT || dom.childElementCount === 0;
- };
- var all = function (selector, scope) {
- var base = scope === undefined ? document : scope.dom();
- return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), Element$$1.fromDom);
- };
- var one = function (selector, scope) {
- var base = scope === undefined ? document : scope.dom();
- return bypassSelector(base) ? Option.none() : Option.from(base.querySelector(selector)).map(Element$$1.fromDom);
- };
- var $_4yq1xp1gjjgwe7op = {
- all: all,
- is: is$1,
- one: one
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var name = function (element) {
+ var r = element.dom().nodeName;
+ return r.toLowerCase();
+ };
+ var type = function (element) {
+ return element.dom().nodeType;
+ };
+ var isType$1 = function (t) {
+ return function (element) {
+ return type(element) === t;
+ };
+ };
+ var isElement = isType$1(ELEMENT);
+ var isText = isType$1(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">- var eq = function (e1, e2) {
- return e1.dom() === e2.dom();
- };
- var isEqualNode = function (e1, e2) {
- return e1.dom().isEqualNode(e2.dom());
- };
- var member = function (element, elements) {
- return exists(elements, curry(eq, element));
- };
- var regularContains = function (e1, e2) {
- var d1 = e1.dom(), d2 = e2.dom();
- return d1 === d2 ? false : d1.contains(d2);
- };
- var ieContains = function (e1, e2) {
- return $_g79q0i1fjjgwe7on.documentPositionContainedBy(e1.dom(), e2.dom());
- };
- var browser = $_7vg267ojjgwe7k0.detect().browser;
- var contains$3 = browser.isIE() ? ieContains : regularContains;
- var $_5raon11ejjgwe7o5 = {
- eq: eq,
- isEqualNode: isEqualNode,
- member: member,
- contains: contains$3,
- is: $_4yq1xp1gjjgwe7op.is
- };
-
- var owner = function (element) {
- return Element$$1.fromDom(element.dom().ownerDocument);
- };
- var documentElement = function (element) {
- return Element$$1.fromDom(element.dom().ownerDocument.documentElement);
- };
- var defaultView = function (element) {
- var el = element.dom();
- var defaultView = el.ownerDocument.defaultView;
- return Element$$1.fromDom(defaultView);
- };
- var parent = function (element) {
- var dom = element.dom();
- return Option.from(dom.parentNode).map(Element$$1.fromDom);
- };
- var findIndex$2 = function (element) {
- return parent(element).bind(function (p) {
- var kin = children(p);
- return findIndex(kin, function (elem) {
- return $_5raon11ejjgwe7o5.eq(element, elem);
- });
- });
- };
- var parents = function (element, isRoot) {
- var stop = isFunction(isRoot) ? isRoot : constant(false);
- var dom = element.dom();
- var ret = [];
- while (dom.parentNode !== null && dom.parentNode !== undefined) {
- var rawParent = dom.parentNode;
- var parent = Element$$1.fromDom(rawParent);
- ret.push(parent);
- if (stop(parent) === true)
- break;
- else
- dom = rawParent;
- }
- return ret;
- };
- var siblings = function (element) {
- var filterSelf = function (elements) {
- return filter(elements, function (x) {
- return !$_5raon11ejjgwe7o5.eq(element, x);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var keys = Object.keys;
+ var hasOwnProperty$1 = Object.hasOwnProperty;
+ var each$3 = function (obj, f) {
+ var props = keys(obj);
+ for (var k = 0, len = props.length; k < len; k++) {
+ var i = props[k];
+ var x = obj[i];
+ f(x, i, 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">- return parent(element).map(children).map(filterSelf).getOr([]);
- };
- var offsetParent = function (element) {
- var dom = element.dom();
- return Option.from(dom.offsetParent).map(Element$$1.fromDom);
- };
- var prevSibling = function (element) {
- var dom = element.dom();
- return Option.from(dom.previousSibling).map(Element$$1.fromDom);
- };
- var nextSibling = function (element) {
- var dom = element.dom();
- return Option.from(dom.nextSibling).map(Element$$1.fromDom);
- };
- var prevSiblings = function (element) {
- return reverse($_2hsygk1djjgwe7o3.toArray(element, prevSibling));
- };
- var nextSiblings = function (element) {
- return $_2hsygk1djjgwe7o3.toArray(element, nextSibling);
- };
- var children = function (element) {
- var dom = element.dom();
- return map(dom.childNodes, Element$$1.fromDom);
- };
- var child = function (element, index) {
- var children = element.dom().childNodes;
- return Option.from(children[index]).map(Element$$1.fromDom);
- };
- var firstChild = function (element) {
- return child(element, 0);
- };
- var lastChild = function (element) {
- return child(element, element.dom().childNodes.length - 1);
- };
- var childNodesCount = function (element) {
- return element.dom().childNodes.length;
- };
- var hasChildNodes = function (element) {
- return element.dom().hasChildNodes();
- };
- var spot = Immutable('element', 'offset');
- var leaf = function (element, offset) {
- var cs = children(element);
- return cs.length > 0 && offset < cs.length ? spot(cs[offset], 0) : spot(element, offset);
- };
- var $_d3rmjp18jjgwe7nc = {
- owner: owner,
- defaultView: defaultView,
- documentElement: documentElement,
- parent: parent,
- findIndex: findIndex$2,
- parents: parents,
- siblings: siblings,
- prevSibling: prevSibling,
- offsetParent: offsetParent,
- prevSiblings: prevSiblings,
- nextSibling: nextSibling,
- nextSiblings: nextSiblings,
- children: children,
- child: child,
- firstChild: firstChild,
- lastChild: lastChild,
- childNodesCount: childNodesCount,
- hasChildNodes: hasChildNodes,
- leaf: leaf
- };
-
- var browser$1 = $_7vg267ojjgwe7k0.detect().browser;
- var firstElement = function (nodes) {
- return find(nodes, $_fxxo5411jjgwe7lq.isElement);
- };
- var getTableCaptionDeltaY = function (elm) {
- if (browser$1.isFirefox() && $_fxxo5411jjgwe7lq.name(elm) === 'table') {
- return firstElement($_d3rmjp18jjgwe7nc.children(elm)).filter(function (elm) {
- return $_fxxo5411jjgwe7lq.name(elm) === 'caption';
- }).bind(function (caption) {
- return firstElement($_d3rmjp18jjgwe7nc.nextSiblings(caption)).map(function (body) {
- var bodyTop = body.dom().offsetTop;
- var captionTop = caption.dom().offsetTop;
- var captionHeight = caption.dom().offsetHeight;
- return bodyTop <= captionTop ? -captionHeight : 0;
- });
- }).getOr(0);
- } else {
- return 0;
- }
- };
- var getPos = function (body, elm, rootElm) {
- var x = 0, y = 0, offsetParent;
- var doc = body.ownerDocument;
- var pos;
- rootElm = rootElm ? rootElm : body;
- if (elm) {
- if (rootElm === body && elm.getBoundingClientRect && $_e0ei5w13jjgwe7m4.get(Element$$1.fromDom(body), 'position') === 'static') {
- pos = elm.getBoundingClientRect();
- x = pos.left + (doc.documentElement.scrollLeft || body.scrollLeft) - doc.documentElement.clientLeft;
- y = pos.top + (doc.documentElement.scrollTop || body.scrollTop) - doc.documentElement.clientTop;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var map$2 = function (obj, f) {
+ return tupleMap(obj, function (x, i, obj) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- x: x,
- y: y
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ k: i,
+ v: f(x, i, 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">- }
- offsetParent = elm;
- while (offsetParent && offsetParent !== rootElm && offsetParent.nodeType) {
- x += offsetParent.offsetLeft || 0;
- y += offsetParent.offsetTop || 0;
- offsetParent = offsetParent.offsetParent;
- }
- offsetParent = elm.parentNode;
- while (offsetParent && offsetParent !== rootElm && offsetParent.nodeType) {
- x -= offsetParent.scrollLeft || 0;
- y -= offsetParent.scrollTop || 0;
- offsetParent = offsetParent.parentNode;
- }
- y += getTableCaptionDeltaY(Element$$1.fromDom(elm));
- }
- return {
- x: x,
- y: y
</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">- };
- var $_3h7c3wnjjgwe7jl = { getPos: getPos };
-
- var nu$3 = function (baseFn) {
- var data = Option.none();
- var callbacks = [];
- var map$$1 = function (f) {
- return nu$3(function (nCallback) {
- get(function (data) {
- nCallback(f(data));
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var tupleMap = function (obj, f) {
+ var r = {};
+ each$3(obj, function (x, i) {
+ var tuple = f(x, i, obj);
+ r[tuple.k] = tuple.v;
</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 r;
</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 get = function (nCallback) {
- if (isReady())
- call(nCallback);
- else
- callbacks.push(nCallback);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var bifilter = function (obj, pred) {
+ var t = {};
+ var f = {};
+ each$3(obj, function (x, i) {
+ var branch = pred(x, i) ? t : f;
+ branch[i] = x;
+ });
+ return {
+ t: t,
+ f: f
+ };
</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 set = function (x) {
- data = Option.some(x);
- run(callbacks);
- callbacks = [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var has = function (obj, key) {
+ return hasOwnProperty$1.call(obj, key);
</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 isReady = function () {
- return data.isSome();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var rawSet = function (dom, key, value$$1) {
+ if (isString(value$$1) || isBoolean(value$$1) || isNumber(value$$1)) {
+ dom.setAttribute(key, value$$1 + '');
+ } else {
+ console.error('Invalid call to Attr.set. Key ', key, ':: Value ', value$$1, ':: Element ', dom);
+ throw new Error('Attribute value was not simple');
+ }
</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 run = function (cbs) {
- each(cbs, call);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var set = function (element, key, value$$1) {
+ rawSet(element.dom(), key, value$$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">- var call = function (cb) {
- data.each(function (x) {
- setTimeout(function () {
- cb(x);
- }, 0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setAll = function (element, attrs) {
+ var dom = element.dom();
+ each$3(attrs, function (v, k) {
+ rawSet(dom, k, v);
</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">- baseFn(set);
- return {
- get: get,
- map: map$$1,
- isReady: isReady
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var get$1 = function (element, key) {
+ var v = element.dom().getAttribute(key);
+ return v === null ? undefined : v;
</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 pure$1 = function (a) {
- return nu$3(function (callback) {
- callback(a);
- });
- };
- var LazyValue = {
- nu: nu$3,
- pure: pure$1
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var has$1 = function (element, key) {
+ var dom = element.dom();
+ return dom && dom.hasAttribute ? dom.hasAttribute(key) : false;
+ };
+ var remove = function (element, key) {
+ element.dom().removeAttribute(key);
+ };
</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 bounce = function (f) {
- return function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- var me = this;
- setTimeout(function () {
- f.apply(me, args);
- }, 0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var inBody = function (element) {
+ var dom = isText(element) ? element.dom().parentNode : element.dom();
+ return dom !== undefined && dom !== null && dom.ownerDocument.body.contains(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">- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var nu$4 = function (baseFn) {
- var get = function (callback) {
- baseFn(bounce(callback));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isSupported = function (dom) {
+ return dom.style !== undefined;
</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 map = function (fab) {
- return nu$4(function (callback) {
- get(function (a) {
- var value = fab(a);
- callback(value);
- });
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var internalSet = function (dom, property, value$$1) {
+ if (!isString(value$$1)) {
+ console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value$$1, ':: Element ', dom);
+ throw new Error('CSS value must be a string: ' + value$$1);
+ }
+ if (isSupported(dom))
+ dom.style.setProperty(property, value$$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">- var bind = function (aFutureB) {
- return nu$4(function (callback) {
- get(function (a) {
- aFutureB(a).get(callback);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setAll$1 = function (element, css) {
+ var dom = element.dom();
+ each$3(css, function (v, k) {
+ internalSet(dom, k, v);
</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">- var anonBind = function (futureB) {
- return nu$4(function (callback) {
- get(function (a) {
- futureB.get(callback);
- });
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var get$2 = function (element, property) {
+ var dom = element.dom();
+ var styles = window.getComputedStyle(dom);
+ var r = styles.getPropertyValue(property);
+ var v = r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r;
+ return v === null ? undefined : v;
</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 toLazy = function () {
- return LazyValue.nu(get);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getUnsafeProperty = function (dom, property) {
+ return isSupported(dom) ? dom.style.getPropertyValue(property) : '';
</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 {
- map: map,
- bind: bind,
- anonBind: anonBind,
- toLazy: toLazy,
- get: get
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getRaw = function (element, property) {
+ var dom = element.dom();
+ var raw = getUnsafeProperty(dom, property);
+ return Option.from(raw).filter(function (r) {
+ return r.length > 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">- };
- var pure$2 = function (a) {
- return nu$4(function (callback) {
- callback(a);
- });
- };
- var Future = {
- nu: nu$4,
- pure: pure$2
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var par = function (asyncValues, nu) {
- return nu(function (callback) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Immutable = function () {
+ var fields = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ fields[_i] = arguments[_i];
+ }
+ return function () {
+ var values = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ values[_i] = arguments[_i];
+ }
+ if (fields.length !== values.length) {
+ throw new Error('Wrong number of arguments to struct. Expected "[' + fields.length + ']", got ' + values.length + ' arguments');
+ }
+ var struct = {};
+ each(fields, function (name, i) {
+ struct[name] = constant(values[i]);
+ });
+ return struct;
+ };
+ };
+
+ var toArray$1 = function (target, f) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var r = [];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var count = 0;
- var cb = function (i) {
- return function (value) {
- r[i] = value;
- count++;
- if (count >= asyncValues.length) {
- callback(r);
- }
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var recurse = function (e) {
+ r.push(e);
+ return f(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">- if (asyncValues.length === 0) {
- callback([]);
- } else {
- each(asyncValues, function (asyncValue, i) {
- asyncValue.get(cb(i));
- });
- }
- });
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var cur = f(target);
+ do {
+ cur = cur.bind(recurse);
+ } while (cur.isSome());
+ return r;
+ };
+ var Recurse = { toArray: toArray$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">- var par$1 = function (futures) {
- return par(futures, Future.nu);
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var node = function () {
+ var f = Global$1.getOrDie('Node');
+ return f;
+ };
+ var compareDocumentPosition = function (a, b, match) {
+ return (a.compareDocumentPosition(b) & match) !== 0;
+ };
+ var documentPositionPreceding = function (a, b) {
+ return compareDocumentPosition(a, b, node().DOCUMENT_POSITION_PRECEDING);
+ };
+ var documentPositionContainedBy = function (a, b) {
+ return compareDocumentPosition(a, b, node().DOCUMENT_POSITION_CONTAINED_BY);
+ };
+ var Node$1 = {
+ documentPositionPreceding: documentPositionPreceding,
+ documentPositionContainedBy: documentPositionContainedBy
+ };
</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 value$1 = function (o) {
- var is = function (v) {
- return o === v;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ELEMENT$1 = ELEMENT;
+ var DOCUMENT$1 = DOCUMENT;
+ var is$1 = function (element, selector) {
+ var elem = element.dom();
+ if (elem.nodeType !== ELEMENT$1)
+ return false;
+ else if (elem.matches !== undefined)
+ return elem.matches(selector);
+ else if (elem.msMatchesSelector !== undefined)
+ return elem.msMatchesSelector(selector);
+ else if (elem.webkitMatchesSelector !== undefined)
+ return elem.webkitMatchesSelector(selector);
+ else if (elem.mozMatchesSelector !== undefined)
+ return elem.mozMatchesSelector(selector);
+ else
+ throw new Error('Browser lacks native selectors');
</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 or = function (opt) {
- return value$1(o);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var bypassSelector = function (dom) {
+ return dom.nodeType !== ELEMENT$1 && dom.nodeType !== DOCUMENT$1 || dom.childElementCount === 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">- var orThunk = function (f) {
- return value$1(o);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var all = function (selector, scope) {
+ var base = scope === undefined ? document : scope.dom();
+ return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), Element$$1.fromDom);
</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 map = function (f) {
- return value$1(f(o));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var one = function (selector, scope) {
+ var base = scope === undefined ? document : scope.dom();
+ return bypassSelector(base) ? Option.none() : Option.from(base.querySelector(selector)).map(Element$$1.fromDom);
</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 each = function (f) {
- f(o);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var eq = function (e1, e2) {
+ return e1.dom() === e2.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 bind = function (f) {
- return f(o);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var regularContains = function (e1, e2) {
+ var d1 = e1.dom(), d2 = e2.dom();
+ return d1 === d2 ? false : d1.contains(d2);
</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 fold = function (_, onValue) {
- return onValue(o);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ieContains = function (e1, e2) {
+ return Node$1.documentPositionContainedBy(e1.dom(), e2.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 exists = function (f) {
- return f(o);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var browser = PlatformDetection$1.detect().browser;
+ var contains$3 = browser.isIE() ? ieContains : regularContains;
+
+ var owner = function (element) {
+ return Element$$1.fromDom(element.dom().ownerDocument);
</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 forall = function (f) {
- return f(o);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var documentElement = function (element) {
+ return Element$$1.fromDom(element.dom().ownerDocument.documentElement);
</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 toOption = function () {
- return Option.some(o);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var defaultView = function (element) {
+ var el = element.dom();
+ var defaultView = el.ownerDocument.defaultView;
+ return Element$$1.fromDom(defaultView);
</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 {
- is: is,
- isValue: always,
- isError: never,
- getOr: constant(o),
- getOrThunk: constant(o),
- getOrDie: constant(o),
- or: or,
- orThunk: orThunk,
- fold: fold,
- map: map,
- each: each,
- bind: bind,
- exists: exists,
- forall: forall,
- toOption: toOption
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var parent = function (element) {
+ var dom = element.dom();
+ return Option.from(dom.parentNode).map(Element$$1.fromDom);
</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 error = function (message) {
- var getOrThunk = function (f) {
- return f();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var parents = function (element, isRoot) {
+ var stop = isFunction(isRoot) ? isRoot : constant(false);
+ var dom = element.dom();
+ var ret = [];
+ while (dom.parentNode !== null && dom.parentNode !== undefined) {
+ var rawParent = dom.parentNode;
+ var parent = Element$$1.fromDom(rawParent);
+ ret.push(parent);
+ if (stop(parent) === true)
+ break;
+ else
+ dom = rawParent;
+ }
+ return ret;
</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 getOrDie = function () {
- return die(String(message))();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var prevSibling = function (element) {
+ var dom = element.dom();
+ return Option.from(dom.previousSibling).map(Element$$1.fromDom);
</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 or = function (opt) {
- return opt;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var nextSibling = function (element) {
+ var dom = element.dom();
+ return Option.from(dom.nextSibling).map(Element$$1.fromDom);
</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 orThunk = function (f) {
- return f();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var prevSiblings = function (element) {
+ return reverse(Recurse.toArray(element, prevSibling));
</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 map = function (f) {
- return error(message);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var nextSiblings = function (element) {
+ return Recurse.toArray(element, 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">- var bind = function (f) {
- return error(message);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var children = function (element) {
+ var dom = element.dom();
+ return map(dom.childNodes, Element$$1.fromDom);
</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 fold = function (onError, _) {
- return onError(message);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var child = function (element, index) {
+ var children = element.dom().childNodes;
+ return Option.from(children[index]).map(Element$$1.fromDom);
</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 {
- is: never,
- isValue: never,
- isError: always,
- getOr: identity,
- getOrThunk: getOrThunk,
- getOrDie: getOrDie,
- or: or,
- orThunk: orThunk,
- fold: fold,
- map: map,
- each: noop,
- bind: bind,
- exists: never,
- forall: always,
- toOption: Option.none
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var firstChild = function (element) {
+ return child(element, 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">- };
- var Result = {
- value: value$1,
- error: error
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var lastChild = function (element) {
+ return child(element, element.dom().childNodes.length - 1);
+ };
+ var childNodesCount = function (element) {
+ return element.dom().childNodes.length;
+ };
+ var spot = Immutable('element', '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">- function StyleSheetLoader(document$$1, settings) {
- var idCount = 0;
- var loadedStates = {};
- var maxLoadTime;
- settings = settings || {};
- maxLoadTime = settings.maxLoadTime || 5000;
- var appendToHead = function (node) {
- document$$1.getElementsByTagName('head')[0].appendChild(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var browser$1 = PlatformDetection$1.detect().browser;
+ var firstElement = function (nodes) {
+ return find(nodes, isElement);
</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 load = function (url, loadedCallback, errorCallback) {
- var link, style, startTime, state;
- var passed = function () {
- var callbacks = state.passed;
- var i = callbacks.length;
- while (i--) {
- callbacks[i]();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getTableCaptionDeltaY = function (elm) {
+ if (browser$1.isFirefox() && name(elm) === 'table') {
+ return firstElement(children(elm)).filter(function (elm) {
+ return name(elm) === 'caption';
+ }).bind(function (caption) {
+ return firstElement(nextSiblings(caption)).map(function (body) {
+ var bodyTop = body.dom().offsetTop;
+ var captionTop = caption.dom().offsetTop;
+ var captionHeight = caption.dom().offsetHeight;
+ return bodyTop <= captionTop ? -captionHeight : 0;
+ });
+ }).getOr(0);
+ } else {
+ return 0;
+ }
+ };
+ var getPos = function (body, elm, rootElm) {
+ var x = 0, y = 0, offsetParent$$1;
+ var doc = body.ownerDocument;
+ var pos;
+ rootElm = rootElm ? rootElm : body;
+ if (elm) {
+ if (rootElm === body && elm.getBoundingClientRect && get$2(Element$$1.fromDom(body), 'position') === 'static') {
+ pos = elm.getBoundingClientRect();
+ x = pos.left + (doc.documentElement.scrollLeft || body.scrollLeft) - doc.documentElement.clientLeft;
+ y = pos.top + (doc.documentElement.scrollTop || body.scrollTop) - doc.documentElement.clientTop;
+ return {
+ x: x,
+ y: 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">- state.status = 2;
- state.passed = [];
- state.failed = [];
- };
- var failed = function () {
- var callbacks = state.failed;
- var i = callbacks.length;
- while (i--) {
- callbacks[i]();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ offsetParent$$1 = elm;
+ while (offsetParent$$1 && offsetParent$$1 !== rootElm && offsetParent$$1.nodeType) {
+ x += offsetParent$$1.offsetLeft || 0;
+ y += offsetParent$$1.offsetTop || 0;
+ offsetParent$$1 = offsetParent$$1.offsetParent;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- state.status = 3;
- state.passed = [];
- state.failed = [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ offsetParent$$1 = elm.parentNode;
+ while (offsetParent$$1 && offsetParent$$1 !== rootElm && offsetParent$$1.nodeType) {
+ x -= offsetParent$$1.scrollLeft || 0;
+ y -= offsetParent$$1.scrollTop || 0;
+ offsetParent$$1 = offsetParent$$1.parentNode;
+ }
+ y += getTableCaptionDeltaY(Element$$1.fromDom(elm));
+ }
+ return {
+ x: x,
+ y: 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">- var isOldWebKit = function () {
- var webKitChunks = navigator.userAgent.match(/WebKit\/(\d*)/);
- return !!(webKitChunks && parseInt(webKitChunks[1], 10) < 536);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var Position = { getPos: getPos };
+
+ var nu$3 = function (baseFn) {
+ var data = Option.none();
+ var callbacks = [];
+ var map$$1 = function (f) {
+ return nu$3(function (nCallback) {
+ get(function (data) {
+ nCallback(f(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">- var wait = function (testCallback, waitCallback) {
- if (!testCallback()) {
- if (new Date().getTime() - startTime < maxLoadTime) {
- $_9o1ijaijjgwe7dm.setTimeout(waitCallback);
- } else {
- failed();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var get = function (nCallback) {
+ if (isReady())
+ call(nCallback);
+ else
+ callbacks.push(nCallback);
+ };
+ var set = function (x) {
+ data = Option.some(x);
+ run(callbacks);
+ callbacks = [];
+ };
+ var isReady = function () {
+ return data.isSome();
+ };
+ var run = function (cbs) {
+ each(cbs, call);
+ };
+ var call = function (cb) {
+ data.each(function (x) {
+ setTimeout(function () {
+ cb(x);
+ }, 0);
+ });
+ };
+ baseFn(set);
+ return {
+ get: get,
+ map: map$$1,
+ isReady: isReady
+ };
+ };
+ var pure$1 = function (a) {
+ return nu$3(function (callback) {
+ callback(a);
+ });
+ };
+ var LazyValue = {
+ nu: nu$3,
+ pure: pure$1
+ };
+
+ var bounce = function (f) {
+ return function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var me = this;
+ setTimeout(function () {
+ f.apply(me, args);
+ }, 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">- var waitForWebKitLinkLoaded = function () {
- wait(function () {
- var styleSheets = document$$1.styleSheets;
- var styleSheet, i = styleSheets.length, owner;
- while (i--) {
- styleSheet = styleSheets[i];
- owner = styleSheet.ownerNode ? styleSheet.ownerNode : styleSheet.owningElement;
- if (owner && owner.id === link.id) {
- passed();
- return true;
- }
- }
- }, waitForWebKitLinkLoaded);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+
+ var nu$4 = function (baseFn) {
+ var get = function (callback) {
+ baseFn(bounce(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">- var waitForGeckoLinkLoaded = function () {
- wait(function () {
- try {
- var cssRules = style.sheet.cssRules;
- passed();
- return !!cssRules;
- } catch (ex) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var map = function (fab) {
+ return nu$4(function (callback) {
+ get(function (a) {
+ var value = fab(a);
+ callback(value);
+ });
+ });
+ };
+ var bind = function (aFutureB) {
+ return nu$4(function (callback) {
+ get(function (a) {
+ aFutureB(a).get(callback);
+ });
+ });
+ };
+ var anonBind = function (futureB) {
+ return nu$4(function (callback) {
+ get(function (a) {
+ futureB.get(callback);
+ });
+ });
+ };
+ var toLazy = function () {
+ return LazyValue.nu(get);
+ };
+ var toCached = function () {
+ var cache = null;
+ return nu$4(function (callback) {
+ if (cache === null) {
+ cache = toLazy();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }, waitForGeckoLinkLoaded);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ cache.get(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">- url = $_6cwiepljjgwe7j4._addCacheSuffix(url);
- if (!loadedStates[url]) {
- state = {
- passed: [],
- failed: []
- };
- loadedStates[url] = state;
- } else {
- state = loadedStates[url];
- }
- if (loadedCallback) {
- state.passed.push(loadedCallback);
- }
- if (errorCallback) {
- state.failed.push(errorCallback);
- }
- if (state.status === 1) {
- return;
- }
- if (state.status === 2) {
- passed();
- return;
- }
- if (state.status === 3) {
- failed();
- return;
- }
- state.status = 1;
- link = document$$1.createElement('link');
- link.rel = 'stylesheet';
- link.type = 'text/css';
- link.id = 'u' + idCount++;
- link.async = false;
- link.defer = false;
- startTime = new Date().getTime();
- if ('onload' in link && !isOldWebKit()) {
- link.onload = waitForWebKitLinkLoaded;
- link.onerror = failed;
- } else {
- if (navigator.userAgent.indexOf('Firefox') > 0) {
- style = document$$1.createElement('style');
- style.textContent = '@import "' + url + '"';
- waitForGeckoLinkLoaded();
- appendToHead(style);
- return;
- }
- waitForWebKitLinkLoaded();
- }
- appendToHead(link);
- link.href = url;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return {
+ map: map,
+ bind: bind,
+ anonBind: anonBind,
+ toLazy: toLazy,
+ toCached: toCached,
+ get: get
+ };
</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 loadF = function (url) {
- return Future.nu(function (resolve) {
- load(url, compose(resolve, constant(Result.value(url))), compose(resolve, constant(Result.error(url))));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var pure$2 = function (a) {
+ return nu$4(function (callback) {
+ callback(a);
</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">- var unbox = function (result) {
- return result.fold(identity, identity);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Future = {
+ nu: nu$4,
+ pure: pure$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">- var loadAll = function (urls, success, failure) {
- par$1(map(urls, loadF)).get(function (result) {
- var parts = partition(result, function (r) {
- return r.isValue();
- });
- if (parts.fail.length > 0) {
- failure(parts.fail.map(unbox));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var par = function (asyncValues, nu) {
+ return nu(function (callback) {
+ var r = [];
+ var count = 0;
+ var cb = function (i) {
+ return function (value) {
+ r[i] = value;
+ count++;
+ if (count >= asyncValues.length) {
+ callback(r);
+ }
+ };
+ };
+ if (asyncValues.length === 0) {
+ callback([]);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- success(parts.pass.map(unbox));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ each(asyncValues, function (asyncValue, i) {
+ asyncValue.get(cb(i));
+ });
</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">- return {
- load: load,
- loadAll: loadAll
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var par$1 = function (futures) {
+ return par(futures, Future.nu);
</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><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function TreeWalker (startNode, rootNode) {
- var node = startNode;
- var findSibling = function (node, startName, siblingName, shallow) {
- var sibling, parent;
- if (node) {
- if (!shallow && node[startName]) {
- return node[startName];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var value$1 = function (o) {
+ var is = function (v) {
+ return o === v;
+ };
+ var or = function (opt) {
+ return value$1(o);
+ };
+ var orThunk = function (f) {
+ return value$1(o);
+ };
+ var map = function (f) {
+ return value$1(f(o));
+ };
+ var mapError = function (f) {
+ return value$1(o);
+ };
+ var each = function (f) {
+ f(o);
+ };
+ var bind = function (f) {
+ return f(o);
+ };
+ var fold = function (_, onValue) {
+ return onValue(o);
+ };
+ var exists = function (f) {
+ return f(o);
+ };
+ var forall = function (f) {
+ return f(o);
+ };
+ var toOption = function () {
+ return Option.some(o);
+ };
+ return {
+ is: is,
+ isValue: always,
+ isError: never,
+ getOr: constant(o),
+ getOrThunk: constant(o),
+ getOrDie: constant(o),
+ or: or,
+ orThunk: orThunk,
+ fold: fold,
+ map: map,
+ mapError: mapError,
+ each: each,
+ bind: bind,
+ exists: exists,
+ forall: forall,
+ toOption: toOption
+ };
+ };
+ var error = function (message) {
+ var getOrThunk = function (f) {
+ return f();
+ };
+ var getOrDie = function () {
+ return die(String(message))();
+ };
+ var or = function (opt) {
+ return opt;
+ };
+ var orThunk = function (f) {
+ return f();
+ };
+ var map = function (f) {
+ return error(message);
+ };
+ var mapError = function (f) {
+ return error(f(message));
+ };
+ var bind = function (f) {
+ return error(message);
+ };
+ var fold = function (onError, _) {
+ return onError(message);
+ };
+ return {
+ is: never,
+ isValue: never,
+ isError: always,
+ getOr: identity,
+ getOrThunk: getOrThunk,
+ getOrDie: getOrDie,
+ or: or,
+ orThunk: orThunk,
+ fold: fold,
+ map: map,
+ mapError: mapError,
+ each: noop,
+ bind: bind,
+ exists: never,
+ forall: always,
+ toOption: Option.none
+ };
+ };
+ var Result = {
+ value: value$1,
+ error: error
+ };
+
+ function StyleSheetLoader(document$$1, settings) {
+ if (settings === void 0) {
+ settings = {};
+ }
+ var idCount = 0;
+ var loadedStates = {};
+ var maxLoadTime;
+ maxLoadTime = settings.maxLoadTime || 5000;
+ var appendToHead = function (node) {
+ document$$1.getElementsByTagName('head')[0].appendChild(node);
+ };
+ var load = function (url, loadedCallback, errorCallback) {
+ var link, style, startTime, state;
+ var passed = function () {
+ var callbacks = state.passed;
+ var i = callbacks.length;
+ while (i--) {
+ callbacks[i]();
+ }
+ state.status = 2;
+ state.passed = [];
+ state.failed = [];
+ };
+ var failed = function () {
+ var callbacks = state.failed;
+ var i = callbacks.length;
+ while (i--) {
+ callbacks[i]();
+ }
+ state.status = 3;
+ state.passed = [];
+ state.failed = [];
+ };
+ var isOldWebKit = function () {
+ var webKitChunks = navigator.userAgent.match(/WebKit\/(\d*)/);
+ return !!(webKitChunks && parseInt(webKitChunks[1], 10) < 536);
+ };
+ var wait = function (testCallback, waitCallback) {
+ if (!testCallback()) {
+ if (new Date().getTime() - startTime < maxLoadTime) {
+ Delay.setTimeout(waitCallback);
+ } else {
+ failed();
+ }
+ }
+ };
+ var waitForWebKitLinkLoaded = function () {
+ wait(function () {
+ var styleSheets = document$$1.styleSheets;
+ var styleSheet, i = styleSheets.length, owner;
+ while (i--) {
+ styleSheet = styleSheets[i];
+ owner = styleSheet.ownerNode ? styleSheet.ownerNode : styleSheet.owningElement;
+ if (owner && owner.id === link.id) {
+ passed();
+ return true;
+ }
+ }
+ }, waitForWebKitLinkLoaded);
+ };
+ var waitForGeckoLinkLoaded = function () {
+ wait(function () {
+ try {
+ var cssRules = style.sheet.cssRules;
+ passed();
+ return !!cssRules;
+ } catch (ex) {
+ }
+ }, waitForGeckoLinkLoaded);
+ };
+ url = Tools._addCacheSuffix(url);
+ if (!loadedStates[url]) {
+ state = {
+ passed: [],
+ failed: []
+ };
+ loadedStates[url] = state;
+ } else {
+ state = loadedStates[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">- if (node !== rootNode) {
- sibling = node[siblingName];
- if (sibling) {
- return sibling;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (loadedCallback) {
+ state.passed.push(loadedCallback);
+ }
+ if (errorCallback) {
+ state.failed.push(errorCallback);
+ }
+ if (state.status === 1) {
+ return;
+ }
+ if (state.status === 2) {
+ passed();
+ return;
+ }
+ if (state.status === 3) {
+ failed();
+ return;
+ }
+ state.status = 1;
+ link = document$$1.createElement('link');
+ link.rel = 'stylesheet';
+ link.type = 'text/css';
+ link.id = 'u' + idCount++;
+ link.async = false;
+ link.defer = false;
+ startTime = new Date().getTime();
+ if (settings.contentCssCors) {
+ link.crossOrigin = 'anonymous';
+ }
+ if ('onload' in link && !isOldWebKit()) {
+ link.onload = waitForWebKitLinkLoaded;
+ link.onerror = failed;
+ } else {
+ if (navigator.userAgent.indexOf('Firefox') > 0) {
+ style = document$$1.createElement('style');
+ style.textContent = '@import "' + url + '"';
+ waitForGeckoLinkLoaded();
+ appendToHead(style);
+ 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 (parent = node.parentNode; parent && parent !== rootNode; parent = parent.parentNode) {
- sibling = parent[siblingName];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ waitForWebKitLinkLoaded();
+ }
+ appendToHead(link);
+ link.href = url;
+ };
+ var loadF = function (url) {
+ return Future.nu(function (resolve) {
+ load(url, compose(resolve, constant(Result.value(url))), compose(resolve, constant(Result.error(url))));
+ });
+ };
+ var unbox = function (result) {
+ return result.fold(identity, identity);
+ };
+ var loadAll = function (urls, success, failure) {
+ par$1(map(urls, loadF)).get(function (result) {
+ var parts = partition(result, function (r) {
+ return r.isValue();
+ });
+ if (parts.fail.length > 0) {
+ failure(parts.fail.map(unbox));
+ } else {
+ success(parts.pass.map(unbox));
+ }
+ });
+ };
+ return {
+ load: load,
+ loadAll: loadAll
+ };
+ }
+
+ function TreeWalker (startNode, rootNode) {
+ var node = startNode;
+ var findSibling = function (node, startName, siblingName, shallow) {
+ var sibling, parent;
+ if (node) {
+ if (!shallow && node[startName]) {
+ return node[startName];
+ }
+ if (node !== rootNode) {
+ sibling = node[siblingName];
</ins><span class="cx" style="display: block; padding: 0 10px"> if (sibling) {
</span><span class="cx" style="display: block; padding: 0 10px"> return sibling;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (parent = node.parentNode; parent && parent !== rootNode; parent = parent.parentNode) {
+ sibling = parent[siblingName];
+ if (sibling) {
+ return sibling;
+ }
+ }
</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">- }
- };
- var findPreviousNode = function (node, startName, siblingName, shallow) {
- var sibling, parent, child;
- if (node) {
- sibling = node[siblingName];
- if (rootNode && sibling === rootNode) {
- return;
- }
- if (sibling) {
- if (!shallow) {
- for (child = sibling[startName]; child; child = child[startName]) {
- if (!child[startName]) {
- return child;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var findPreviousNode = function (node, startName, siblingName, shallow) {
+ var sibling, parent, child;
+ if (node) {
+ sibling = node[siblingName];
+ if (rootNode && sibling === rootNode) {
+ return;
+ }
+ if (sibling) {
+ if (!shallow) {
+ for (child = sibling[startName]; child; child = child[startName]) {
+ if (!child[startName]) {
+ return child;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- return sibling;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parent = node.parentNode;
+ if (parent && parent !== rootNode) {
+ return parent;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- parent = node.parentNode;
- if (parent && parent !== rootNode) {
- return parent;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ this.current = function () {
+ return node;
+ };
+ this.next = function (shallow) {
+ node = findSibling(node, 'firstChild', 'nextSibling', shallow);
+ return node;
+ };
+ this.prev = function (shallow) {
+ node = findSibling(node, 'lastChild', 'previousSibling', shallow);
+ return node;
+ };
+ this.prev2 = function (shallow) {
+ node = findPreviousNode(node, 'lastChild', 'previousSibling', shallow);
+ return node;
+ };
+ }
+
+ var blocks = [
+ 'article',
+ 'aside',
+ 'details',
+ 'div',
+ 'dt',
+ 'figcaption',
+ 'footer',
+ 'form',
+ 'fieldset',
+ 'header',
+ 'hgroup',
+ 'html',
+ 'main',
+ 'nav',
+ 'section',
+ 'summary',
+ 'body',
+ 'p',
+ 'dl',
+ 'multicol',
+ 'dd',
+ 'figure',
+ 'address',
+ 'center',
+ 'blockquote',
+ 'h1',
+ 'h2',
+ 'h3',
+ 'h4',
+ 'h5',
+ 'h6',
+ 'listing',
+ 'xmp',
+ 'pre',
+ 'plaintext',
+ 'menu',
+ 'dir',
+ 'ul',
+ 'ol',
+ 'li',
+ 'hr',
+ 'table',
+ 'tbody',
+ 'thead',
+ 'tfoot',
+ 'th',
+ 'tr',
+ 'td',
+ 'caption'
+ ];
+ var voids = [
+ 'area',
+ 'base',
+ 'basefont',
+ 'br',
+ 'col',
+ 'frame',
+ 'hr',
+ 'img',
+ 'input',
+ 'isindex',
+ 'link',
+ 'meta',
+ 'param',
+ 'embed',
+ 'source',
+ 'wbr',
+ 'track'
+ ];
+ var tableCells = [
+ 'td',
+ 'th'
+ ];
+ var tableSections = [
+ 'thead',
+ 'tbody',
+ 'tfoot'
+ ];
+ var textBlocks = [
+ 'h1',
+ 'h2',
+ 'h3',
+ 'h4',
+ 'h5',
+ 'h6',
+ 'p',
+ 'div',
+ 'address',
+ 'pre',
+ 'form',
+ 'blockquote',
+ 'center',
+ 'dir',
+ 'fieldset',
+ 'header',
+ 'footer',
+ 'article',
+ 'section',
+ 'hgroup',
+ 'aside',
+ 'nav',
+ 'figure'
+ ];
+ var headings = [
+ 'h1',
+ 'h2',
+ 'h3',
+ 'h4',
+ 'h5',
+ 'h6'
+ ];
+ var listItems = [
+ 'li',
+ 'dd',
+ 'dt'
+ ];
+ var lists = [
+ 'ul',
+ 'ol',
+ 'dl'
+ ];
+ var wsElements = [
+ 'pre',
+ 'script',
+ 'textarea',
+ 'style'
+ ];
+ var lazyLookup = function (items) {
+ var lookup;
+ return function (node) {
+ lookup = lookup ? lookup : mapToObject(items, constant(true));
+ return lookup.hasOwnProperty(name(node));
+ };
+ };
+ var isHeading = lazyLookup(headings);
+ var isBlock = lazyLookup(blocks);
+ var isInline = function (node) {
+ return isElement(node) && !isBlock(node);
+ };
+ var isBr = function (node) {
+ return isElement(node) && name(node) === 'br';
+ };
+ var isTextBlock = lazyLookup(textBlocks);
+ var isList = lazyLookup(lists);
+ var isListItem = lazyLookup(listItems);
+ var isVoid = lazyLookup(voids);
+ var isTableSection = lazyLookup(tableSections);
+ var isTableCell = lazyLookup(tableCells);
+ var isWsPreserveElement = lazyLookup(wsElements);
+
+ var isNodeType = function (type) {
+ return function (node) {
+ return !!node && node.nodeType === type;
+ };
+ };
+ var isElement$1 = isNodeType(1);
+ var matchNodeNames = function (names) {
+ var items = names.toLowerCase().split(' ');
+ return function (node) {
+ var i, name;
+ if (node && node.nodeType) {
+ name = node.nodeName.toLowerCase();
+ for (i = 0; i < items.length; i++) {
+ if (name === items[i]) {
+ 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">- }
</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">- this.current = function () {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var matchStyleValues = function (name, values) {
+ var items = values.toLowerCase().split(' ');
+ return function (node) {
+ var i, cssValue;
+ if (isElement$1(node)) {
+ for (i = 0; i < items.length; i++) {
+ var computed = node.ownerDocument.defaultView.getComputedStyle(node, null);
+ cssValue = computed ? computed.getPropertyValue(name) : null;
+ if (cssValue === items[i]) {
+ return true;
+ }
+ }
+ }
+ 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">- this.next = function (shallow) {
- node = findSibling(node, 'firstChild', 'nextSibling', shallow);
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasPropValue = function (propName, propValue) {
+ return function (node) {
+ return isElement$1(node) && node[propName] === propValue;
+ };
</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.prev = function (shallow) {
- node = findSibling(node, 'lastChild', 'previousSibling', shallow);
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasAttribute = function (attrName, attrValue) {
+ return function (node) {
+ return isElement$1(node) && node.hasAttribute(attrName);
+ };
</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.prev2 = function (shallow) {
- node = findPreviousNode(node, 'lastChild', 'previousSibling', shallow);
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasAttributeValue = function (attrName, attrValue) {
+ return function (node) {
+ return isElement$1(node) && node.getAttribute(attrName) === attrValue;
+ };
</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 blocks = [
- 'article',
- 'aside',
- 'details',
- 'div',
- 'dt',
- 'figcaption',
- 'footer',
- 'form',
- 'fieldset',
- 'header',
- 'hgroup',
- 'html',
- 'main',
- 'nav',
- 'section',
- 'summary',
- 'body',
- 'p',
- 'dl',
- 'multicol',
- 'dd',
- 'figure',
- 'address',
- 'center',
- 'blockquote',
- 'h1',
- 'h2',
- 'h3',
- 'h4',
- 'h5',
- 'h6',
- 'listing',
- 'xmp',
- 'pre',
- 'plaintext',
- 'menu',
- 'dir',
- 'ul',
- 'ol',
- 'li',
- 'hr',
- 'table',
- 'tbody',
- 'thead',
- 'tfoot',
- 'th',
- 'tr',
- 'td',
- 'caption'
- ];
- var voids = [
- 'area',
- 'base',
- 'basefont',
- 'br',
- 'col',
- 'frame',
- 'hr',
- 'img',
- 'input',
- 'isindex',
- 'link',
- 'meta',
- 'param',
- 'embed',
- 'source',
- 'wbr',
- 'track'
- ];
- var tableCells = [
- 'td',
- 'th'
- ];
- var tableSections = [
- 'thead',
- 'tbody',
- 'tfoot'
- ];
- var textBlocks = [
- 'h1',
- 'h2',
- 'h3',
- 'h4',
- 'h5',
- 'h6',
- 'p',
- 'div',
- 'address',
- 'pre',
- 'form',
- 'blockquote',
- 'center',
- 'dir',
- 'fieldset',
- 'header',
- 'footer',
- 'article',
- 'section',
- 'hgroup',
- 'aside',
- 'nav',
- 'figure'
- ];
- var headings = [
- 'h1',
- 'h2',
- 'h3',
- 'h4',
- 'h5',
- 'h6'
- ];
- var listItems = [
- 'li',
- 'dd',
- 'dt'
- ];
- var lists = [
- 'ul',
- 'ol',
- 'dl'
- ];
- var wsElements = [
- 'pre',
- 'script',
- 'textarea',
- 'style'
- ];
- var lazyLookup = function (items) {
- var lookup;
- return function (node) {
- lookup = lookup ? lookup : mapToObject(items, constant(true));
- return lookup.hasOwnProperty($_fxxo5411jjgwe7lq.name(node));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isBogus = function (node) {
+ return isElement$1(node) && node.hasAttribute('data-mce-bogus');
</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 isHeading = lazyLookup(headings);
- var isBlock = lazyLookup(blocks);
- var isInline = function (node) {
- return $_fxxo5411jjgwe7lq.isElement(node) && !isBlock(node);
- };
- var isBr = function (node) {
- return $_fxxo5411jjgwe7lq.isElement(node) && $_fxxo5411jjgwe7lq.name(node) === 'br';
- };
- var isTextBlock = lazyLookup(textBlocks);
- var isList = lazyLookup(lists);
- var isListItem = lazyLookup(listItems);
- var isVoid = lazyLookup(voids);
- var isTableSection = lazyLookup(tableSections);
- var isTableCell = lazyLookup(tableCells);
- var isWsPreserveElement = lazyLookup(wsElements);
-
- var isNodeType = function (type) {
- return function (node) {
- return !!node && node.nodeType === type;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isBogusAll = function (node) {
+ return isElement$1(node) && node.getAttribute('data-mce-bogus') === 'all';
</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 isElement$1 = isNodeType(1);
- var matchNodeNames = function (names) {
- var items = names.toLowerCase().split(' ');
- return function (node) {
- var i, name;
- if (node && node.nodeType) {
- name = node.nodeName.toLowerCase();
- for (i = 0; i < items.length; i++) {
- if (name === items[i]) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isTable = function (node) {
+ return isElement$1(node) && node.tagName === 'TABLE';
+ };
+ var hasContentEditableState = function (value) {
+ return function (node) {
+ if (isElement$1(node)) {
+ if (node.contentEditable === value) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><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;
- };
- };
- var matchStyleValues = function (name, values) {
- var items = values.toLowerCase().split(' ');
- return function (node) {
- var i, cssValue;
- if (isElement$1(node)) {
- for (i = 0; i < items.length; i++) {
- var computed = node.ownerDocument.defaultView.getComputedStyle(node, null);
- cssValue = computed ? computed.getPropertyValue(name) : null;
- if (cssValue === items[i]) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (node.getAttribute('data-mce-contenteditable') === value) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</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">- }
- 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 hasPropValue = function (propName, propValue) {
- return function (node) {
- return isElement$1(node) && node[propName] === propValue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isText$1 = isNodeType(3);
+ var isComment$1 = isNodeType(8);
+ var isDocument$1 = isNodeType(9);
+ var isBr$1 = matchNodeNames('br');
+ var isContentEditableTrue = hasContentEditableState('true');
+ var isContentEditableFalse = hasContentEditableState('false');
+ var NodeType = {
+ isText: isText$1,
+ isElement: isElement$1,
+ isComment: isComment$1,
+ isDocument: isDocument$1,
+ isBr: isBr$1,
+ isContentEditableTrue: isContentEditableTrue,
+ isContentEditableFalse: isContentEditableFalse,
+ matchNodeNames: matchNodeNames,
+ hasPropValue: hasPropValue,
+ hasAttribute: hasAttribute,
+ hasAttributeValue: hasAttributeValue,
+ matchStyleValues: matchStyleValues,
+ isBogus: isBogus,
+ isBogusAll: isBogusAll,
+ isTable: isTable
</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 hasAttribute = function (attrName, attrValue) {
- return function (node) {
- return isElement$1(node) && node.hasAttribute(attrName);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var surroundedBySpans = function (node) {
+ var previousIsSpan = node.previousSibling && node.previousSibling.nodeName === 'SPAN';
+ var nextIsSpan = node.nextSibling && node.nextSibling.nodeName === 'SPAN';
+ return previousIsSpan && nextIsSpan;
</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 hasAttributeValue = function (attrName, attrValue) {
- return function (node) {
- return isElement$1(node) && node.getAttribute(attrName) === attrValue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isBookmarkNode = function (node) {
+ return node && node.tagName === 'SPAN' && node.getAttribute('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">- };
- var isBogus = function (node) {
- return isElement$1(node) && node.hasAttribute('data-mce-bogus');
- };
- var isBogusAll = function (node) {
- return isElement$1(node) && node.getAttribute('data-mce-bogus') === 'all';
- };
- var isTable = function (node) {
- return isElement$1(node) && node.tagName === 'TABLE';
- };
- var hasContentEditableState = function (value) {
- return function (node) {
- if (isElement$1(node)) {
- if (node.contentEditable === value) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var trimNode = function (dom, node) {
+ var i, children = node.childNodes;
+ if (NodeType.isElement(node) && isBookmarkNode(node)) {
+ return;
+ }
+ for (i = children.length - 1; i >= 0; i--) {
+ trimNode(dom, children[i]);
+ }
+ if (NodeType.isDocument(node) === false) {
+ if (NodeType.isText(node) && node.nodeValue.length > 0) {
+ var trimmedLength = Tools.trim(node.nodeValue).length;
+ if (dom.isBlock(node.parentNode) || trimmedLength > 0) {
+ return;
+ }
+ if (trimmedLength === 0 && surroundedBySpans(node)) {
+ return;
+ }
+ } else if (NodeType.isElement(node)) {
+ children = node.childNodes;
+ if (children.length === 1 && isBookmarkNode(children[0])) {
+ node.parentNode.insertBefore(children[0], node);
+ }
+ if (children.length || isVoid(Element$$1.fromDom(node))) {
+ 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 (node.getAttribute('data-mce-contenteditable') === value) {
- return true;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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">- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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 isText$1 = isNodeType(3);
- var isComment$1 = isNodeType(8);
- var isDocument$1 = isNodeType(9);
- var isBr$1 = matchNodeNames('br');
- var isContentEditableTrue = hasContentEditableState('true');
- var isContentEditableFalse = hasContentEditableState('false');
- var $_3b9u2y1rjjgwe7qe = {
- isText: isText$1,
- isElement: isElement$1,
- isComment: isComment$1,
- isDocument: isDocument$1,
- isBr: isBr$1,
- isContentEditableTrue: isContentEditableTrue,
- isContentEditableFalse: isContentEditableFalse,
- matchNodeNames: matchNodeNames,
- hasPropValue: hasPropValue,
- hasAttribute: hasAttribute,
- hasAttributeValue: hasAttributeValue,
- matchStyleValues: matchStyleValues,
- isBogus: isBogus,
- isBogusAll: isBogusAll,
- isTable: isTable
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var TrimNode = { trimNode: trimNode };
</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 surroundedBySpans = function (node) {
- var previousIsSpan = node.previousSibling && node.previousSibling.nodeName === 'SPAN';
- var nextIsSpan = node.nextSibling && node.nextSibling.nodeName === 'SPAN';
- return previousIsSpan && nextIsSpan;
- };
- var isBookmarkNode = function (node) {
- return node && node.tagName === 'SPAN' && node.getAttribute('data-mce-type') === 'bookmark';
- };
- var trimNode = function (dom, node) {
- var i, children = node.childNodes;
- if ($_3b9u2y1rjjgwe7qe.isElement(node) && isBookmarkNode(node)) {
- return;
- }
- for (i = children.length - 1; i >= 0; i--) {
- trimNode(dom, children[i]);
- }
- if ($_3b9u2y1rjjgwe7qe.isDocument(node) === false) {
- if ($_3b9u2y1rjjgwe7qe.isText(node) && node.nodeValue.length > 0) {
- var trimmedLength = $_6cwiepljjgwe7j4.trim(node.nodeValue).length;
- if (dom.isBlock(node.parentNode) || trimmedLength > 0) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var makeMap$1 = Tools.makeMap;
+ var namedEntities, baseEntities, reverseEntities;
+ var attrsCharsRegExp = /[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
+ var textCharsRegExp = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
+ var rawCharsRegExp = /[<>&\"\']/g;
+ var entityRegExp = /&#([a-z0-9]+);?|&([a-z0-9]+);/gi;
+ var asciiMap = {
+ 128: '\u20AC',
+ 130: '\u201A',
+ 131: '\u0192',
+ 132: '\u201E',
+ 133: '\u2026',
+ 134: '\u2020',
+ 135: '\u2021',
+ 136: '\u02c6',
+ 137: '\u2030',
+ 138: '\u0160',
+ 139: '\u2039',
+ 140: '\u0152',
+ 142: '\u017d',
+ 145: '\u2018',
+ 146: '\u2019',
+ 147: '\u201C',
+ 148: '\u201D',
+ 149: '\u2022',
+ 150: '\u2013',
+ 151: '\u2014',
+ 152: '\u02DC',
+ 153: '\u2122',
+ 154: '\u0161',
+ 155: '\u203A',
+ 156: '\u0153',
+ 158: '\u017e',
+ 159: '\u0178'
+ };
+ baseEntities = {
+ '"': '"',
+ '\'': ''',
+ '<': '<',
+ '>': '>',
+ '&': '&',
+ '`': '`'
+ };
+ reverseEntities = {
+ '<': '<',
+ '>': '>',
+ '&': '&',
+ '"': '"',
+ ''': '\''
+ };
+ var nativeDecode = function (text) {
+ var elm;
+ elm = Element$$1.fromTag('div').dom();
+ elm.innerHTML = text;
+ return elm.textContent || elm.innerText || text;
+ };
+ var buildEntitiesLookup = function (items, radix) {
+ var i, chr, entity;
+ var lookup = {};
+ if (items) {
+ items = items.split(',');
+ radix = radix || 10;
+ for (i = 0; i < items.length; i += 2) {
+ chr = String.fromCharCode(parseInt(items[i], radix));
+ if (!baseEntities[chr]) {
+ entity = '&' + items[i + 1] + ';';
+ lookup[chr] = entity;
+ lookup[entity] = 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">- if (trimmedLength === 0 && surroundedBySpans(node)) {
- return;
- }
- } else if ($_3b9u2y1rjjgwe7qe.isElement(node)) {
- children = node.childNodes;
- if (children.length === 1 && isBookmarkNode(children[0])) {
- node.parentNode.insertBefore(children[0], node);
- }
- if (children.length || isVoid(Element$$1.fromDom(node))) {
- return;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return lookup;
</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(node);
- }
- return node;
- };
- var $_cu5wx21pjjgwe7pz = { trimNode: trimNode };
-
- var makeMap$1 = $_6cwiepljjgwe7j4.makeMap;
- var namedEntities;
- var baseEntities;
- var reverseEntities;
- var attrsCharsRegExp = /[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
- var textCharsRegExp = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
- var rawCharsRegExp = /[<>&\"\']/g;
- var entityRegExp = /&#([a-z0-9]+);?|&([a-z0-9]+);/gi;
- var asciiMap = {
- 128: '\u20AC',
- 130: '\u201A',
- 131: '\u0192',
- 132: '\u201E',
- 133: '\u2026',
- 134: '\u2020',
- 135: '\u2021',
- 136: '\u02c6',
- 137: '\u2030',
- 138: '\u0160',
- 139: '\u2039',
- 140: '\u0152',
- 142: '\u017d',
- 145: '\u2018',
- 146: '\u2019',
- 147: '\u201C',
- 148: '\u201D',
- 149: '\u2022',
- 150: '\u2013',
- 151: '\u2014',
- 152: '\u02DC',
- 153: '\u2122',
- 154: '\u0161',
- 155: '\u203A',
- 156: '\u0153',
- 158: '\u017e',
- 159: '\u0178'
- };
- baseEntities = {
- '"': '"',
- '\'': ''',
- '<': '<',
- '>': '>',
- '&': '&',
- '`': '`'
- };
- reverseEntities = {
- '<': '<',
- '>': '>',
- '&': '&',
- '"': '"',
- ''': '\''
- };
- var nativeDecode = function (text) {
- var elm;
- elm = Element$$1.fromTag('div').dom();
- elm.innerHTML = text;
- return elm.textContent || elm.innerText || text;
- };
- var buildEntitiesLookup = function (items, radix) {
- var i, chr, entity;
- var lookup = {};
- if (items) {
- items = items.split(',');
- radix = radix || 10;
- for (i = 0; i < items.length; i += 2) {
- chr = String.fromCharCode(parseInt(items[i], radix));
- if (!baseEntities[chr]) {
- entity = '&' + items[i + 1] + ';';
- lookup[chr] = entity;
- lookup[entity] = chr;
- }
- }
- return lookup;
- }
- };
- namedEntities = buildEntitiesLookup('50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,' + '5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,' + '5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,' + '5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,' + '68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,' + '6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,' + '6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,' + '75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,' + '7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,' + '7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,' + 'sj,Gamma,sk,Delt
a,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,' + 'st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,' + 't9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,' + 'tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,' + 'u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,' + '81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,' + '8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,' + '8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,' + '8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,' + '8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,' + 'nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sd
ot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,' + 'rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,' + 'Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,' + '80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,' + '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro', 32);
- var encodeRaw = function (text, attr) {
- return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) {
- return baseEntities[chr] || chr;
- });
- };
- var encodeAllRaw = function (text) {
- return ('' + text).replace(rawCharsRegExp, function (chr) {
- return baseEntities[chr] || chr;
- });
- };
- var encodeNumeric = function (text, attr) {
- return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) {
- if (chr.length > 1) {
- return '&#' + ((chr.charCodeAt(0) - 55296) * 1024 + (chr.charCodeAt(1) - 56320) + 65536) + ';';
- }
- return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';';
- });
- };
- var encodeNamed = function (text, attr, entities) {
- entities = entities || namedEntities;
- return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) {
- return baseEntities[chr] || entities[chr] || chr;
- });
- };
- var getEncodeFunc = function (name, entities) {
- var entitiesMap = buildEntitiesLookup(entities) || namedEntities;
- var encodeNamedAndNumeric = function (text, attr) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ namedEntities = buildEntitiesLookup('50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,' + '5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,' + '5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,' + '5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,' + '68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,' + '6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,' + '6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,' + '75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,' + '7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,' + '7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,' + 'sj,Gamma,sk,De
lta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,' + 'st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,' + 't9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,' + 'tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,' + 'u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,' + '81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,' + '8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,' + '8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,' + '8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,' + '8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,' + 'nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,
sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,' + 'rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,' + 'Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,' + '80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,' + '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro', 32);
+ var encodeRaw = function (text, attr) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (baseEntities[chr] !== undefined) {
- return baseEntities[chr];
- }
- if (entitiesMap[chr] !== undefined) {
- return entitiesMap[chr];
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return baseEntities[chr] || chr;
+ });
+ };
+ var encodeAllRaw = function (text) {
+ return ('' + text).replace(rawCharsRegExp, function (chr) {
+ return baseEntities[chr] || chr;
+ });
+ };
+ var encodeNumeric = function (text, attr) {
+ return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (chr.length > 1) {
</span><span class="cx" style="display: block; padding: 0 10px"> return '&#' + ((chr.charCodeAt(0) - 55296) * 1024 + (chr.charCodeAt(1) - 56320) + 65536) + ';';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return '&#' + chr.charCodeAt(0) + ';';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';';
</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">- var encodeCustomNamed = function (text, attr) {
- return encodeNamed(text, attr, entitiesMap);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var encodeNamed = function (text, attr, entities) {
+ entities = entities || namedEntities;
+ return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) {
+ return baseEntities[chr] || entities[chr] || 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">- var nameMap = makeMap$1(name.replace(/\+/g, ','));
- if (nameMap.named && nameMap.numeric) {
- return encodeNamedAndNumeric;
- }
- if (nameMap.named) {
- if (entities) {
- return encodeCustomNamed;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getEncodeFunc = function (name, entities) {
+ var entitiesMap = buildEntitiesLookup(entities) || namedEntities;
+ var encodeNamedAndNumeric = function (text, attr) {
+ return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) {
+ if (baseEntities[chr] !== undefined) {
+ return baseEntities[chr];
+ }
+ if (entitiesMap[chr] !== undefined) {
+ return entitiesMap[chr];
+ }
+ if (chr.length > 1) {
+ return '&#' + ((chr.charCodeAt(0) - 55296) * 1024 + (chr.charCodeAt(1) - 56320) + 65536) + ';';
+ }
+ return '&#' + chr.charCodeAt(0) + ';';
+ });
+ };
+ var encodeCustomNamed = function (text, attr) {
+ return encodeNamed(text, attr, entitiesMap);
+ };
+ var nameMap = makeMap$1(name.replace(/\+/g, ','));
+ if (nameMap.named && nameMap.numeric) {
+ return encodeNamedAndNumeric;
</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 encodeNamed;
- }
- if (nameMap.numeric) {
- return encodeNumeric;
- }
- return encodeRaw;
- };
- var decode = function (text) {
- return text.replace(entityRegExp, function (all, numeric) {
- if (numeric) {
- if (numeric.charAt(0).toLowerCase() === 'x') {
- numeric = parseInt(numeric.substr(1), 16);
- } else {
- numeric = parseInt(numeric, 10);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (nameMap.named) {
+ if (entities) {
+ return encodeCustomNamed;
</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 (numeric > 65535) {
- numeric -= 65536;
- return String.fromCharCode(55296 + (numeric >> 10), 56320 + (numeric & 1023));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return encodeNamed;
+ }
+ if (nameMap.numeric) {
+ return encodeNumeric;
+ }
+ return encodeRaw;
+ };
+ var decode = function (text) {
+ return text.replace(entityRegExp, function (all, numeric) {
+ if (numeric) {
+ if (numeric.charAt(0).toLowerCase() === 'x') {
+ numeric = parseInt(numeric.substr(1), 16);
+ } else {
+ numeric = parseInt(numeric, 10);
+ }
+ if (numeric > 65535) {
+ numeric -= 65536;
+ return String.fromCharCode(55296 + (numeric >> 10), 56320 + (numeric & 1023));
+ }
+ return asciiMap[numeric] || String.fromCharCode(numeric);
</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 asciiMap[numeric] || String.fromCharCode(numeric);
- }
- return reverseEntities[all] || namedEntities[all] || nativeDecode(all);
- });
- };
- var $_6pqr9q1sjjgwe7qj = {
- encodeRaw: encodeRaw,
- encodeAllRaw: encodeAllRaw,
- encodeNumeric: encodeNumeric,
- encodeNamed: encodeNamed,
- getEncodeFunc: getEncodeFunc,
- decode: decode
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return reverseEntities[all] || namedEntities[all] || nativeDecode(all);
+ });
+ };
+ var Entities = {
+ encodeRaw: encodeRaw,
+ encodeAllRaw: encodeAllRaw,
+ encodeNumeric: encodeNumeric,
+ encodeNamed: encodeNamed,
+ getEncodeFunc: getEncodeFunc,
+ decode: decode
+ };
</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 mapCache = {};
- var dummyObj = {};
- var makeMap$2 = $_6cwiepljjgwe7j4.makeMap;
- var each$4 = $_6cwiepljjgwe7j4.each;
- var extend$1 = $_6cwiepljjgwe7j4.extend;
- var explode$1 = $_6cwiepljjgwe7j4.explode;
- var inArray$1 = $_6cwiepljjgwe7j4.inArray;
- var split = function (items, delim) {
- items = $_6cwiepljjgwe7j4.trim(items);
- return items ? items.split(delim || ' ') : [];
- };
- var compileSchema = function (type) {
- var schema = {};
- var globalAttributes, blockContent;
- var phrasingContent, flowContent, html4BlockContent, html4PhrasingContent;
- var add = function (name, attributes, children) {
- var ni, attributesOrder, element;
- var arrayToMap = function (array, obj) {
- var map = {};
- var i, l;
- for (i = 0, l = array.length; i < l; i++) {
- map[array[i]] = obj || {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var mapCache = {}, dummyObj = {};
+ var makeMap$2 = Tools.makeMap, each$4 = Tools.each, extend$1 = Tools.extend, explode$1 = Tools.explode, inArray$1 = Tools.inArray;
+ var split = function (items, delim) {
+ items = Tools.trim(items);
+ return items ? items.split(delim || ' ') : [];
+ };
+ var compileSchema = function (type) {
+ var schema = {};
+ var globalAttributes, blockContent;
+ var phrasingContent, flowContent, html4BlockContent, html4PhrasingContent;
+ var add = function (name, attributes, children) {
+ var ni, attributesOrder, element;
+ var arrayToMap = function (array, obj) {
+ var map = {};
+ var i, l;
+ for (i = 0, l = array.length; i < l; i++) {
+ map[array[i]] = obj || {};
+ }
+ return map;
+ };
+ children = children || [];
+ attributes = attributes || '';
+ if (typeof children === 'string') {
+ children = split(children);
</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 map;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ name = split(name);
+ ni = name.length;
+ while (ni--) {
+ attributesOrder = split([
+ globalAttributes,
+ attributes
+ ].join(' '));
+ element = {
+ attributes: arrayToMap(attributesOrder),
+ attributesOrder: attributesOrder,
+ children: arrayToMap(children, dummyObj)
+ };
+ schema[name[ni]] = element;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- children = children || [];
- attributes = attributes || '';
- if (typeof children === 'string') {
- children = split(children);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var addAttrs = function (name, attributes) {
+ var ni, schemaItem, i, l;
+ name = split(name);
+ ni = name.length;
+ attributes = split(attributes);
+ while (ni--) {
+ schemaItem = schema[name[ni]];
+ for (i = 0, l = attributes.length; i < l; i++) {
+ schemaItem.attributes[attributes[i]] = {};
+ schemaItem.attributesOrder.push(attributes[i]);
+ }
+ }
+ };
+ if (mapCache[type]) {
+ return mapCache[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">- name = split(name);
- ni = name.length;
- while (ni--) {
- attributesOrder = split([
- globalAttributes,
- attributes
- ].join(' '));
- element = {
- attributes: arrayToMap(attributesOrder),
- attributesOrder: attributesOrder,
- children: arrayToMap(children, dummyObj)
- };
- schema[name[ni]] = element;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ globalAttributes = 'id accesskey class dir lang style tabindex title role';
+ blockContent = 'address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul';
+ phrasingContent = 'a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd ' + 'label map noscript object q s samp script select small span strong sub sup ' + 'textarea u var #text #comment';
+ if (type !== 'html4') {
+ globalAttributes += ' contenteditable contextmenu draggable dropzone ' + 'hidden spellcheck translate';
+ blockContent += ' article aside details dialog figure main header footer hgroup section nav';
+ phrasingContent += ' audio canvas command datalist mark meter output picture ' + 'progress time wbr video ruby bdi keygen';
</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 addAttrs = function (name, attributes) {
- var ni, schemaItem, i, l;
- name = split(name);
- ni = name.length;
- attributes = split(attributes);
- while (ni--) {
- schemaItem = schema[name[ni]];
- for (i = 0, l = attributes.length; i < l; i++) {
- schemaItem.attributes[attributes[i]] = {};
- schemaItem.attributesOrder.push(attributes[i]);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (type !== 'html5-strict') {
+ globalAttributes += ' xml:lang';
+ html4PhrasingContent = 'acronym applet basefont big font strike tt';
+ phrasingContent = [
+ phrasingContent,
+ html4PhrasingContent
+ ].join(' ');
+ each$4(split(html4PhrasingContent), function (name) {
+ add(name, '', phrasingContent);
+ });
+ html4BlockContent = 'center dir isindex noframes';
+ blockContent = [
+ blockContent,
+ html4BlockContent
+ ].join(' ');
+ flowContent = [
+ blockContent,
+ phrasingContent
+ ].join(' ');
+ each$4(split(html4BlockContent), function (name) {
+ add(name, '', flowContent);
+ });
</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 (mapCache[type]) {
- return mapCache[type];
- }
- globalAttributes = 'id accesskey class dir lang style tabindex title role';
- blockContent = 'address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul';
- phrasingContent = 'a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd ' + 'label map noscript object q s samp script select small span strong sub sup ' + 'textarea u var #text #comment';
- if (type !== 'html4') {
- globalAttributes += ' contenteditable contextmenu draggable dropzone ' + 'hidden spellcheck translate';
- blockContent += ' article aside details dialog figure header footer hgroup section nav';
- phrasingContent += ' audio canvas command datalist mark meter output picture ' + 'progress time wbr video ruby bdi keygen';
- }
- if (type !== 'html5-strict') {
- globalAttributes += ' xml:lang';
- html4PhrasingContent = 'acronym applet basefont big font strike tt';
- phrasingContent = [
- phrasingContent,
- html4PhrasingContent
- ].join(' ');
- each$4(split(html4PhrasingContent), function (name) {
- add(name, '', phrasingContent);
- });
- html4BlockContent = 'center dir isindex noframes';
- blockContent = [
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ flowContent = flowContent || [
</ins><span class="cx" style="display: block; padding: 0 10px"> blockContent,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- html4BlockContent
- ].join(' ');
- flowContent = [
- blockContent,
</del><span class="cx" style="display: block; padding: 0 10px"> phrasingContent
</span><span class="cx" style="display: block; padding: 0 10px"> ].join(' ');
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- each$4(split(html4BlockContent), function (name) {
- add(name, '', flowContent);
- });
- }
- flowContent = flowContent || [
- blockContent,
- phrasingContent
- ].join(' ');
- add('html', 'manifest', 'head body');
- add('head', '', 'base command link meta noscript script style title');
- add('title hr noscript br');
- add('base', 'href target');
- add('link', 'href rel media hreflang type sizes hreflang');
- add('meta', 'name http-equiv content charset');
- add('style', 'media type scoped');
- add('script', 'src async defer type charset');
- add('body', 'onafterprint onbeforeprint onbeforeunload onblur onerror onfocus ' + 'onhashchange onload onmessage onoffline ononline onpagehide onpageshow ' + 'onpopstate onresize onscroll onstorage onunload', flowContent);
- add('address dt dd div caption', '', flowContent);
- add('h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn', '', phrasingContent);
- add('blockquote', 'cite', flowContent);
- add('ol', 'reversed start type', 'li');
- add('ul', '', 'li');
- add('li', 'value', flowContent);
- add('dl', '', 'dt dd');
- add('a', 'href target rel media hreflang type', phrasingContent);
- add('q', 'cite', phrasingContent);
- add('ins del', 'cite datetime', flowContent);
- add('img', 'src sizes srcset alt usemap ismap width height');
- add('iframe', 'src name width height', flowContent);
- add('embed', 'src type width height');
- add('object', 'data type typemustmatch name usemap form width height', [
- flowContent,
- 'param'
- ].join(' '));
- add('param', 'name value');
- add('map', 'name', [
- flowContent,
- 'area'
- ].join(' '));
- add('area', 'alt coords shape href target rel media hreflang type');
- add('table', 'border', 'caption colgroup thead tfoot tbody tr' + (type === 'html4' ? ' col' : ''));
- add('colgroup', 'span', 'col');
- add('col', 'span');
- add('tbody thead tfoot', '', 'tr');
- add('tr', '', 'td th');
- add('td', 'colspan rowspan headers', flowContent);
- add('th', 'colspan rowspan headers scope abbr', flowContent);
- add('form', 'accept-charset action autocomplete enctype method name novalidate target', flowContent);
- add('fieldset', 'disabled form name', [
- flowContent,
- 'legend'
- ].join(' '));
- add('label', 'form for', phrasingContent);
- add('input', 'accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate ' + 'formtarget height list max maxlength min multiple name pattern readonly required size src step type value width');
- add('button', 'disabled form formaction formenctype formmethod formnovalidate formtarget name type value', type === 'html4' ? flowContent : phrasingContent);
- add('select', 'disabled form multiple name required size', 'option optgroup');
- add('optgroup', 'disabled label', 'option');
- add('option', 'disabled label selected value');
- add('textarea', 'cols dirname disabled form maxlength name readonly required rows wrap');
- add('menu', 'type label', [
- flowContent,
- 'li'
- ].join(' '));
- add('noscript', '', flowContent);
- if (type !== 'html4') {
- add('wbr');
- add('ruby', '', [
- phrasingContent,
- 'rt rp'
- ].join(' '));
- add('figcaption', '', flowContent);
- add('mark rt rp summary bdi', '', phrasingContent);
- add('canvas', 'width height', flowContent);
- add('video', 'src crossorigin poster preload autoplay mediagroup loop ' + 'muted controls width height buffered', [
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add('html', 'manifest', 'head body');
+ add('head', '', 'base command link meta noscript script style title');
+ add('title hr noscript br');
+ add('base', 'href target');
+ add('link', 'href rel media hreflang type sizes hreflang');
+ add('meta', 'name http-equiv content charset');
+ add('style', 'media type scoped');
+ add('script', 'src async defer type charset');
+ add('body', 'onafterprint onbeforeprint onbeforeunload onblur onerror onfocus ' + 'onhashchange onload onmessage onoffline ononline onpagehide onpageshow ' + 'onpopstate onresize onscroll onstorage onunload', flowContent);
+ add('address dt dd div caption', '', flowContent);
+ add('h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn', '', phrasingContent);
+ add('blockquote', 'cite', flowContent);
+ add('ol', 'reversed start type', 'li');
+ add('ul', '', 'li');
+ add('li', 'value', flowContent);
+ add('dl', '', 'dt dd');
+ add('a', 'href target rel media hreflang type', phrasingContent);
+ add('q', 'cite', phrasingContent);
+ add('ins del', 'cite datetime', flowContent);
+ add('img', 'src sizes srcset alt usemap ismap width height');
+ add('iframe', 'src name width height', flowContent);
+ add('embed', 'src type width height');
+ add('object', 'data type typemustmatch name usemap form width height', [
</ins><span class="cx" style="display: block; padding: 0 10px"> flowContent,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'track source'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'param'
</ins><span class="cx" style="display: block; padding: 0 10px"> ].join(' '));
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add('audio', 'src crossorigin preload autoplay mediagroup loop muted controls ' + 'buffered volume', [
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add('param', 'name value');
+ add('map', 'name', [
</ins><span class="cx" style="display: block; padding: 0 10px"> flowContent,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'track source'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'area'
</ins><span class="cx" style="display: block; padding: 0 10px"> ].join(' '));
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add('picture', '', 'img source');
- add('source', 'src srcset type media sizes');
- add('track', 'kind src srclang label default');
- add('datalist', '', [
- phrasingContent,
- 'option'
- ].join(' '));
- add('article section nav aside header footer', '', flowContent);
- add('hgroup', '', 'h1 h2 h3 h4 h5 h6');
- add('figure', '', [
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add('area', 'alt coords shape href target rel media hreflang type');
+ add('table', 'border', 'caption colgroup thead tfoot tbody tr' + (type === 'html4' ? ' col' : ''));
+ add('colgroup', 'span', 'col');
+ add('col', 'span');
+ add('tbody thead tfoot', '', 'tr');
+ add('tr', '', 'td th');
+ add('td', 'colspan rowspan headers', flowContent);
+ add('th', 'colspan rowspan headers scope abbr', flowContent);
+ add('form', 'accept-charset action autocomplete enctype method name novalidate target', flowContent);
+ add('fieldset', 'disabled form name', [
</ins><span class="cx" style="display: block; padding: 0 10px"> flowContent,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'figcaption'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'legend'
</ins><span class="cx" style="display: block; padding: 0 10px"> ].join(' '));
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add('time', 'datetime', phrasingContent);
- add('dialog', 'open', flowContent);
- add('command', 'type label icon disabled checked radiogroup command');
- add('output', 'for form name', phrasingContent);
- add('progress', 'value max', phrasingContent);
- add('meter', 'value min max low high optimum', phrasingContent);
- add('details', 'open', [
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add('label', 'form for', phrasingContent);
+ add('input', 'accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate ' + 'formtarget height list max maxlength min multiple name pattern readonly required size src step type value width');
+ add('button', 'disabled form formaction formenctype formmethod formnovalidate formtarget name type value', type === 'html4' ? flowContent : phrasingContent);
+ add('select', 'disabled form multiple name required size', 'option optgroup');
+ add('optgroup', 'disabled label', 'option');
+ add('option', 'disabled label selected value');
+ add('textarea', 'cols dirname disabled form maxlength name readonly required rows wrap');
+ add('menu', 'type label', [
</ins><span class="cx" style="display: block; padding: 0 10px"> flowContent,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'summary'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'li'
</ins><span class="cx" style="display: block; padding: 0 10px"> ].join(' '));
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add('keygen', 'autofocus challenge disabled form keytype name');
- }
- if (type !== 'html5-strict') {
- addAttrs('script', 'language xml:space');
- addAttrs('style', 'xml:space');
- addAttrs('object', 'declare classid code codebase codetype archive standby align border hspace vspace');
- addAttrs('embed', 'align name hspace vspace');
- addAttrs('param', 'valuetype type');
- addAttrs('a', 'charset name rev shape coords');
- addAttrs('br', 'clear');
- addAttrs('applet', 'codebase archive code object alt name width height align hspace vspace');
- addAttrs('img', 'name longdesc align border hspace vspace');
- addAttrs('iframe', 'longdesc frameborder marginwidth marginheight scrolling align');
- addAttrs('font basefont', 'size color face');
- addAttrs('input', 'usemap align');
- addAttrs('select', 'onchange');
- addAttrs('textarea');
- addAttrs('h1 h2 h3 h4 h5 h6 div p legend caption', 'align');
- addAttrs('ul', 'type compact');
- addAttrs('li', 'type');
- addAttrs('ol dl menu dir', 'compact');
- addAttrs('pre', 'width xml:space');
- addAttrs('hr', 'align noshade size width');
- addAttrs('isindex', 'prompt');
- addAttrs('table', 'summary width frame rules cellspacing cellpadding align bgcolor');
- addAttrs('col', 'width align char charoff valign');
- addAttrs('colgroup', 'width align char charoff valign');
- addAttrs('thead', 'align char charoff valign');
- addAttrs('tr', 'align char charoff valign bgcolor');
- addAttrs('th', 'axis align char charoff valign nowrap bgcolor width height');
- addAttrs('form', 'accept');
- addAttrs('td', 'abbr axis scope align char charoff valign nowrap bgcolor width height');
- addAttrs('tfoot', 'align char charoff valign');
- addAttrs('tbody', 'align char charoff valign');
- addAttrs('area', 'nohref');
- addAttrs('body', 'background bgcolor text link vlink alink');
- }
- if (type !== 'html4') {
- addAttrs('input button select textarea', 'autofocus');
- addAttrs('input textarea', 'placeholder');
- addAttrs('a', 'download');
- addAttrs('link script img', 'crossorigin');
- addAttrs('iframe', 'sandbox seamless allowfullscreen');
- }
- each$4(split('a form meter progress dfn'), function (name) {
- if (schema[name]) {
- delete schema[name].children[name];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add('noscript', '', flowContent);
+ if (type !== 'html4') {
+ add('wbr');
+ add('ruby', '', [
+ phrasingContent,
+ 'rt rp'
+ ].join(' '));
+ add('figcaption', '', flowContent);
+ add('mark rt rp summary bdi', '', phrasingContent);
+ add('canvas', 'width height', flowContent);
+ add('video', 'src crossorigin poster preload autoplay mediagroup loop ' + 'muted controls width height buffered', [
+ flowContent,
+ 'track source'
+ ].join(' '));
+ add('audio', 'src crossorigin preload autoplay mediagroup loop muted controls ' + 'buffered volume', [
+ flowContent,
+ 'track source'
+ ].join(' '));
+ add('picture', '', 'img source');
+ add('source', 'src srcset type media sizes');
+ add('track', 'kind src srclang label default');
+ add('datalist', '', [
+ phrasingContent,
+ 'option'
+ ].join(' '));
+ add('article section nav aside main header footer', '', flowContent);
+ add('hgroup', '', 'h1 h2 h3 h4 h5 h6');
+ add('figure', '', [
+ flowContent,
+ 'figcaption'
+ ].join(' '));
+ add('time', 'datetime', phrasingContent);
+ add('dialog', 'open', flowContent);
+ add('command', 'type label icon disabled checked radiogroup command');
+ add('output', 'for form name', phrasingContent);
+ add('progress', 'value max', phrasingContent);
+ add('meter', 'value min max low high optimum', phrasingContent);
+ add('details', 'open', [
+ flowContent,
+ 'summary'
+ ].join(' '));
+ add('keygen', 'autofocus challenge disabled form keytype name');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- delete schema.caption.children.table;
- delete schema.script;
- mapCache[type] = schema;
- return schema;
- };
- var compileElementMap = function (value, mode) {
- var styles;
- if (value) {
- styles = {};
- if (typeof value === 'string') {
- value = { '*': value };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (type !== 'html5-strict') {
+ addAttrs('script', 'language xml:space');
+ addAttrs('style', 'xml:space');
+ addAttrs('object', 'declare classid code codebase codetype archive standby align border hspace vspace');
+ addAttrs('embed', 'align name hspace vspace');
+ addAttrs('param', 'valuetype type');
+ addAttrs('a', 'charset name rev shape coords');
+ addAttrs('br', 'clear');
+ addAttrs('applet', 'codebase archive code object alt name width height align hspace vspace');
+ addAttrs('img', 'name longdesc align border hspace vspace');
+ addAttrs('iframe', 'longdesc frameborder marginwidth marginheight scrolling align');
+ addAttrs('font basefont', 'size color face');
+ addAttrs('input', 'usemap align');
+ addAttrs('select', 'onchange');
+ addAttrs('textarea');
+ addAttrs('h1 h2 h3 h4 h5 h6 div p legend caption', 'align');
+ addAttrs('ul', 'type compact');
+ addAttrs('li', 'type');
+ addAttrs('ol dl menu dir', 'compact');
+ addAttrs('pre', 'width xml:space');
+ addAttrs('hr', 'align noshade size width');
+ addAttrs('isindex', 'prompt');
+ addAttrs('table', 'summary width frame rules cellspacing cellpadding align bgcolor');
+ addAttrs('col', 'width align char charoff valign');
+ addAttrs('colgroup', 'width align char charoff valign');
+ addAttrs('thead', 'align char charoff valign');
+ addAttrs('tr', 'align char charoff valign bgcolor');
+ addAttrs('th', 'axis align char charoff valign nowrap bgcolor width height');
+ addAttrs('form', 'accept');
+ addAttrs('td', 'abbr axis scope align char charoff valign nowrap bgcolor width height');
+ addAttrs('tfoot', 'align char charoff valign');
+ addAttrs('tbody', 'align char charoff valign');
+ addAttrs('area', 'nohref');
+ addAttrs('body', 'background bgcolor text link vlink alink');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- each$4(value, function (value, key) {
- styles[key] = styles[key.toUpperCase()] = mode === 'map' ? makeMap$2(value, /[, ]/) : explode$1(value, /[, ]/);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (type !== 'html4') {
+ addAttrs('input button select textarea', 'autofocus');
+ addAttrs('input textarea', 'placeholder');
+ addAttrs('a', 'download');
+ addAttrs('link script img', 'crossorigin');
+ addAttrs('iframe', 'sandbox seamless allowfullscreen');
+ }
+ each$4(split('a form meter progress dfn'), function (name) {
+ if (schema[name]) {
+ delete schema[name].children[name];
+ }
</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 styles;
- };
- function Schema(settings) {
- var elements = {};
- var children = {};
- var patternElements = [];
- var validStyles;
- var invalidStyles;
- var schemaItems;
- var whiteSpaceElementsMap, selfClosingElementsMap, shortEndedElementsMap, boolAttrMap, validClasses;
- var blockElementsMap, nonEmptyElementsMap, moveCaretBeforeOnEnterElementsMap, textBlockElementsMap, textInlineElementsMap;
- var customElementsMap = {}, specialElements = {};
- var createLookupTable = function (option, defaultValue, extendWith) {
- var value = settings[option];
- if (!value) {
- value = mapCache[option];
- if (!value) {
- value = makeMap$2(defaultValue, ' ', makeMap$2(defaultValue.toUpperCase(), ' '));
- value = extend$1(value, extendWith);
- mapCache[option] = value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ delete schema.caption.children.table;
+ delete schema.script;
+ mapCache[type] = schema;
+ return schema;
+ };
+ var compileElementMap = function (value, mode) {
+ var styles;
+ if (value) {
+ styles = {};
+ if (typeof value === 'string') {
+ 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">- } else {
- value = makeMap$2(value, /[, ]/, makeMap$2(value.toUpperCase(), /[, ]/));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ each$4(value, function (value, key) {
+ styles[key] = styles[key.toUpperCase()] = mode === 'map' ? makeMap$2(value, /[, ]/) : explode$1(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">- return value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return styles;
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- settings = settings || {};
- schemaItems = compileSchema(settings.schema);
- if (settings.verify_html === false) {
- settings.valid_elements = '*[*]';
- }
- validStyles = compileElementMap(settings.valid_styles);
- invalidStyles = compileElementMap(settings.invalid_styles, 'map');
- validClasses = compileElementMap(settings.valid_classes, 'map');
- whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script noscript style textarea video audio iframe object code');
- selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr');
- shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link ' + 'meta param embed source wbr track');
- boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize ' + 'noshade nowrap readonly selected autoplay loop controls');
- nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object ' + 'script pre code', shortEndedElementsMap);
- moveCaretBeforeOnEnterElementsMap = createLookupTable('move_caret_before_on_enter_elements', 'table', nonEmptyElementsMap);
- textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' + 'blockquote center dir fieldset header footer article section hgroup aside nav figure');
- blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' + 'th tr td li ol ul caption dl dt dd noscript menu isindex option ' + 'datalist select optgroup figcaption details summary', textBlockElementsMap);
- textInlineElementsMap = createLookupTable('text_inline_elements', 'span strong b em i font strike u var cite ' + 'dfn code mark q sup sub samp');
- each$4((settings.special || 'script noscript noframes noembed title style textarea xmp').split(' '), function (name) {
- specialElements[name] = new RegExp('</' + name + '[^>]*>', 'gi');
- });
- var patternToRegExp = function (str) {
- return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$');
- };
- var addValidElements = function (validElements) {
- var ei, el, ai, al, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder, prefix, outputName, globalAttributes, globalAttributesOrder, key, value;
- var elementRuleRegExp = /^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/, attrRuleRegExp = /^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/, hasPatternsRegExp = /[*?+]/;
- if (validElements) {
- validElements = split(validElements, ',');
- if (elements['@']) {
- globalAttributes = elements['@'].attributes;
- globalAttributesOrder = elements['@'].attributesOrder;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function Schema(settings) {
+ var elements = {};
+ var children = {};
+ var patternElements = [];
+ var validStyles;
+ var invalidStyles;
+ var schemaItems;
+ var whiteSpaceElementsMap, selfClosingElementsMap, shortEndedElementsMap, boolAttrMap, validClasses;
+ var blockElementsMap, nonEmptyElementsMap, moveCaretBeforeOnEnterElementsMap, textBlockElementsMap, textInlineElementsMap;
+ var customElementsMap = {}, specialElements = {};
+ var createLookupTable = function (option, defaultValue, extendWith) {
+ var value = settings[option];
+ if (!value) {
+ value = mapCache[option];
+ if (!value) {
+ value = makeMap$2(defaultValue, ' ', makeMap$2(defaultValue.toUpperCase(), ' '));
+ value = extend$1(value, extendWith);
+ mapCache[option] = value;
+ }
+ } else {
+ value = makeMap$2(value, /[, ]/, makeMap$2(value.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">- for (ei = 0, el = validElements.length; ei < el; ei++) {
- matches = elementRuleRegExp.exec(validElements[ei]);
- if (matches) {
- prefix = matches[1];
- elementName = matches[2];
- outputName = matches[3];
- attrData = matches[5];
- attributes = {};
- attributesOrder = [];
- element = {
- attributes: attributes,
- attributesOrder: attributesOrder
- };
- if (prefix === '#') {
- element.paddEmpty = true;
- }
- if (prefix === '-') {
- element.removeEmpty = true;
- }
- if (matches[4] === '!') {
- element.removeEmptyAttrs = true;
- }
- if (globalAttributes) {
- for (key in globalAttributes) {
- attributes[key] = globalAttributes[key];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return value;
+ };
+ settings = settings || {};
+ schemaItems = compileSchema(settings.schema);
+ if (settings.verify_html === false) {
+ settings.valid_elements = '*[*]';
+ }
+ validStyles = compileElementMap(settings.valid_styles);
+ invalidStyles = compileElementMap(settings.invalid_styles, 'map');
+ validClasses = compileElementMap(settings.valid_classes, 'map');
+ whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script noscript style textarea video audio iframe object code');
+ selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr');
+ shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link ' + 'meta param embed source wbr track');
+ boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize ' + 'noshade nowrap readonly selected autoplay loop controls');
+ nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object ' + 'script pre code', shortEndedElementsMap);
+ moveCaretBeforeOnEnterElementsMap = createLookupTable('move_caret_before_on_enter_elements', 'table', nonEmptyElementsMap);
+ textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' + 'blockquote center dir fieldset header footer article section hgroup aside main nav figure');
+ blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' + 'th tr td li ol ul caption dl dt dd noscript menu isindex option ' + 'datalist select optgroup figcaption details summary', textBlockElementsMap);
+ textInlineElementsMap = createLookupTable('text_inline_elements', 'span strong b em i font strike u var cite ' + 'dfn code mark q sup sub samp');
+ each$4((settings.special || 'script noscript noframes noembed title style textarea xmp').split(' '), function (name) {
+ specialElements[name] = new RegExp('</' + name + '[^>]*>', 'gi');
+ });
+ var patternToRegExp = function (str) {
+ return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$');
+ };
+ var addValidElements = function (validElements) {
+ var ei, el, ai, al, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder, prefix, outputName, globalAttributes, globalAttributesOrder, key, value;
+ var elementRuleRegExp = /^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/, attrRuleRegExp = /^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/, hasPatternsRegExp = /[*?+]/;
+ if (validElements) {
+ validElements = split(validElements, ',');
+ if (elements['@']) {
+ globalAttributes = elements['@'].attributes;
+ globalAttributesOrder = elements['@'].attributesOrder;
+ }
+ for (ei = 0, el = validElements.length; ei < el; ei++) {
+ matches = elementRuleRegExp.exec(validElements[ei]);
+ if (matches) {
+ prefix = matches[1];
+ elementName = matches[2];
+ outputName = matches[3];
+ attrData = matches[5];
+ attributes = {};
+ attributesOrder = [];
+ element = {
+ attributes: attributes,
+ attributesOrder: attributesOrder
+ };
+ if (prefix === '#') {
+ element.paddEmpty = 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">- attributesOrder.push.apply(attributesOrder, globalAttributesOrder);
- }
- if (attrData) {
- attrData = split(attrData, '|');
- for (ai = 0, al = attrData.length; ai < al; ai++) {
- matches = attrRuleRegExp.exec(attrData[ai]);
- if (matches) {
- attr = {};
- attrType = matches[1];
- attrName = matches[2].replace(/[\\:]:/g, ':');
- prefix = matches[3];
- value = matches[4];
- if (attrType === '!') {
- element.attributesRequired = element.attributesRequired || [];
- element.attributesRequired.push(attrName);
- attr.required = true;
- }
- if (attrType === '-') {
- delete attributes[attrName];
- attributesOrder.splice(inArray$1(attributesOrder, attrName), 1);
- continue;
- }
- if (prefix) {
- if (prefix === '=') {
- element.attributesDefault = element.attributesDefault || [];
- element.attributesDefault.push({
- name: attrName,
- value: value
- });
- attr.defaultValue = value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (prefix === '-') {
+ element.removeEmpty = true;
+ }
+ if (matches[4] === '!') {
+ element.removeEmptyAttrs = true;
+ }
+ if (globalAttributes) {
+ for (key in globalAttributes) {
+ attributes[key] = globalAttributes[key];
+ }
+ attributesOrder.push.apply(attributesOrder, globalAttributesOrder);
+ }
+ if (attrData) {
+ attrData = split(attrData, '|');
+ for (ai = 0, al = attrData.length; ai < al; ai++) {
+ matches = attrRuleRegExp.exec(attrData[ai]);
+ if (matches) {
+ attr = {};
+ attrType = matches[1];
+ attrName = matches[2].replace(/[\\:]:/g, ':');
+ prefix = matches[3];
+ value = matches[4];
+ if (attrType === '!') {
+ element.attributesRequired = element.attributesRequired || [];
+ element.attributesRequired.push(attrName);
+ attr.required = 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 (prefix === ':') {
- element.attributesForced = element.attributesForced || [];
- element.attributesForced.push({
- name: attrName,
- value: value
- });
- attr.forcedValue = value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (attrType === '-') {
+ delete attributes[attrName];
+ attributesOrder.splice(inArray$1(attributesOrder, attrName), 1);
+ continue;
</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 (prefix === '<') {
- attr.validValues = makeMap$2(value, '?');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (prefix) {
+ if (prefix === '=') {
+ element.attributesDefault = element.attributesDefault || [];
+ element.attributesDefault.push({
+ name: attrName,
+ value: value
+ });
+ attr.defaultValue = value;
+ }
+ if (prefix === ':') {
+ element.attributesForced = element.attributesForced || [];
+ element.attributesForced.push({
+ name: attrName,
+ value: value
+ });
+ attr.forcedValue = value;
+ }
+ if (prefix === '<') {
+ attr.validValues = makeMap$2(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 (hasPatternsRegExp.test(attrName)) {
- element.attributePatterns = element.attributePatterns || [];
- attr.pattern = patternToRegExp(attrName);
- element.attributePatterns.push(attr);
- } else {
- if (!attributes[attrName]) {
- attributesOrder.push(attrName);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (hasPatternsRegExp.test(attrName)) {
+ element.attributePatterns = element.attributePatterns || [];
+ attr.pattern = patternToRegExp(attrName);
+ element.attributePatterns.push(attr);
+ } else {
+ if (!attributes[attrName]) {
+ attributesOrder.push(attrName);
+ }
+ attributes[attrName] = attr;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- attributes[attrName] = attr;
</del><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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!globalAttributes && elementName === '@') {
+ globalAttributes = attributes;
+ globalAttributesOrder = attributesOrder;
+ }
+ if (outputName) {
+ element.outputName = elementName;
+ elements[outputName] = element;
+ }
+ if (hasPatternsRegExp.test(elementName)) {
+ element.pattern = patternToRegExp(elementName);
+ patternElements.push(element);
+ } else {
+ elements[elementName] = element;
+ }
</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 (!globalAttributes && elementName === '@') {
- globalAttributes = attributes;
- globalAttributesOrder = attributesOrder;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ }
+ };
+ var setValidElements = function (validElements) {
+ elements = {};
+ patternElements = [];
+ addValidElements(validElements);
+ each$4(schemaItems, function (element, name) {
+ children[name] = element.children;
+ });
+ };
+ var addCustomElements = function (customElements) {
+ var customElementRegExp = /^(~)?(.+)$/;
+ if (customElements) {
+ mapCache.text_block_elements = mapCache.block_elements = null;
+ each$4(split(customElements, ','), function (rule) {
+ var matches = customElementRegExp.exec(rule), inline = matches[1] === '~', cloneName = inline ? 'span' : 'div', name = matches[2];
+ children[name] = children[cloneName];
+ customElementsMap[name] = cloneName;
+ if (!inline) {
+ blockElementsMap[name.toUpperCase()] = {};
+ blockElementsMap[name] = {};
</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 (outputName) {
- element.outputName = elementName;
- elements[outputName] = element;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!elements[name]) {
+ var customRule = elements[cloneName];
+ customRule = extend$1({}, customRule);
+ delete customRule.removeEmptyAttrs;
+ delete customRule.removeEmpty;
+ elements[name] = customRule;
</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 (hasPatternsRegExp.test(elementName)) {
- element.pattern = patternToRegExp(elementName);
- patternElements.push(element);
- } else {
- elements[elementName] = element;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ each$4(children, function (element, elmName) {
+ if (element[cloneName]) {
+ children[elmName] = element = extend$1({}, children[elmName]);
+ element[name] = element[cloneName];
+ }
+ });
+ });
+ }
+ };
+ var addValidChildren = function (validChildren) {
+ var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/;
+ mapCache[settings.schema] = null;
+ if (validChildren) {
+ each$4(split(validChildren, ','), function (rule) {
+ var matches = childRuleRegExp.exec(rule);
+ var parent, prefix;
+ if (matches) {
+ prefix = matches[1];
+ if (prefix) {
+ parent = children[matches[2]];
+ } else {
+ parent = children[matches[2]] = { '#comment': {} };
+ }
+ parent = children[matches[2]];
+ each$4(split(matches[3], '|'), function (child) {
+ if (prefix === '-') {
+ delete parent[child];
+ } else {
+ parent[child] = {};
+ }
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ }
+ };
+ var getElementRule = function (name) {
+ var element = elements[name], i;
+ if (element) {
+ return element;
+ }
+ i = patternElements.length;
+ while (i--) {
+ element = patternElements[i];
+ if (element.pattern.test(name)) {
+ return element;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ if (!settings.valid_elements) {
+ each$4(schemaItems, function (element, name) {
+ elements[name] = {
+ attributes: element.attributes,
+ attributesOrder: element.attributesOrder
+ };
+ children[name] = element.children;
+ });
+ if (settings.schema !== 'html5') {
+ each$4(split('strong/b em/i'), function (item) {
+ item = split(item, '/');
+ elements[item[1]].outputName = item[0];
+ });
+ }
+ each$4(split('ol ul sub sup blockquote span font a table tbody tr strong em b i'), function (name) {
+ if (elements[name]) {
+ elements[name].removeEmpty = true;
+ }
+ });
+ each$4(split('p h1 h2 h3 h4 h5 h6 th td pre div address caption li'), function (name) {
+ elements[name].paddEmpty = true;
+ });
+ each$4(split('span'), function (name) {
+ elements[name].removeEmptyAttrs = true;
+ });
+ } else {
+ setValidElements(settings.valid_elements);
</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 setValidElements = function (validElements) {
- elements = {};
- patternElements = [];
- addValidElements(validElements);
- each$4(schemaItems, function (element, name) {
- children[name] = element.children;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ addCustomElements(settings.custom_elements);
+ addValidChildren(settings.valid_children);
+ addValidElements(settings.extended_valid_elements);
+ addValidChildren('+ol[ul|ol],+ul[ul|ol]');
+ each$4({
+ dd: 'dl',
+ dt: 'dl',
+ li: 'ul ol',
+ td: 'tr',
+ th: 'tr',
+ tr: 'tbody thead tfoot',
+ tbody: 'table',
+ thead: 'table',
+ tfoot: 'table',
+ legend: 'fieldset',
+ area: 'map',
+ param: 'video audio object'
+ }, function (parents, item) {
+ if (elements[item]) {
+ elements[item].parentsRequired = split(parents);
+ }
</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 addCustomElements = function (customElements) {
- var customElementRegExp = /^(~)?(.+)$/;
- if (customElements) {
- mapCache.text_block_elements = mapCache.block_elements = null;
- each$4(split(customElements, ','), function (rule) {
- var matches = customElementRegExp.exec(rule), inline = matches[1] === '~', cloneName = inline ? 'span' : 'div', name = matches[2];
- children[name] = children[cloneName];
- customElementsMap[name] = cloneName;
- if (!inline) {
- blockElementsMap[name.toUpperCase()] = {};
- blockElementsMap[name] = {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (settings.invalid_elements) {
+ each$4(explode$1(settings.invalid_elements), function (item) {
+ if (elements[item]) {
+ delete elements[item];
</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 (!elements[name]) {
- var customRule = elements[cloneName];
- customRule = extend$1({}, customRule);
- delete customRule.removeEmptyAttrs;
- delete customRule.removeEmpty;
- elements[name] = customRule;
- }
- each$4(children, function (element, elmName) {
- if (element[cloneName]) {
- children[elmName] = element = extend$1({}, children[elmName]);
- element[name] = element[cloneName];
- }
- });
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!getElementRule('span')) {
+ addValidElements('span[!data-mce-type|*]');
+ }
+ var getValidStyles = function () {
+ return validStyles;
+ };
+ var getInvalidStyles = function () {
+ return invalidStyles;
+ };
+ var getValidClasses = function () {
+ return validClasses;
+ };
+ var getBoolAttrs = function () {
+ return boolAttrMap;
+ };
+ var getBlockElements = function () {
+ return blockElementsMap;
+ };
+ var getTextBlockElements = function () {
+ return textBlockElementsMap;
+ };
+ var getTextInlineElements = function () {
+ return textInlineElementsMap;
+ };
+ var getShortEndedElements = function () {
+ return shortEndedElementsMap;
+ };
+ var getSelfClosingElements = function () {
+ return selfClosingElementsMap;
+ };
+ var getNonEmptyElements = function () {
+ return nonEmptyElementsMap;
+ };
+ var getMoveCaretBeforeOnEnterElements = function () {
+ return moveCaretBeforeOnEnterElementsMap;
+ };
+ var getWhiteSpaceElements = function () {
+ return whiteSpaceElementsMap;
+ };
+ var getSpecialElements = function () {
+ return specialElements;
+ };
+ var isValidChild = function (name, child) {
+ var parent = children[name.toLowerCase()];
+ return !!(parent && parent[child.toLowerCase()]);
+ };
+ var isValid = function (name, attr) {
+ var attrPatterns, i;
+ var rule = getElementRule(name);
+ if (rule) {
+ if (attr) {
+ if (rule.attributes[attr]) {
+ return true;
+ }
+ attrPatterns = rule.attributePatterns;
+ if (attrPatterns) {
+ i = attrPatterns.length;
+ while (i--) {
+ if (attrPatterns[i].pattern.test(name)) {
+ return true;
+ }
+ }
+ }
+ } else {
+ return true;
+ }
+ }
+ return false;
+ };
+ var getCustomElements = function () {
+ return customElementsMap;
+ };
+ return {
+ children: children,
+ elements: elements,
+ getValidStyles: getValidStyles,
+ getValidClasses: getValidClasses,
+ getBlockElements: getBlockElements,
+ getInvalidStyles: getInvalidStyles,
+ getShortEndedElements: getShortEndedElements,
+ getTextBlockElements: getTextBlockElements,
+ getTextInlineElements: getTextInlineElements,
+ getBoolAttrs: getBoolAttrs,
+ getElementRule: getElementRule,
+ getSelfClosingElements: getSelfClosingElements,
+ getNonEmptyElements: getNonEmptyElements,
+ getMoveCaretBeforeOnEnterElements: getMoveCaretBeforeOnEnterElements,
+ getWhiteSpaceElements: getWhiteSpaceElements,
+ getSpecialElements: getSpecialElements,
+ isValidChild: isValidChild,
+ isValid: isValid,
+ getCustomElements: getCustomElements,
+ addValidElements: addValidElements,
+ setValidElements: setValidElements,
+ addCustomElements: addCustomElements,
+ addValidChildren: addValidChildren
+ };
+ }
+
+ var toHex = function (match, r, g, b) {
+ var hex = function (val) {
+ val = parseInt(val, 10).toString(16);
+ return val.length > 1 ? val : '0' + val;
+ };
+ return '#' + hex(r) + hex(g) + hex(b);
</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 addValidChildren = function (validChildren) {
- var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/;
- mapCache[settings.schema] = null;
- if (validChildren) {
- each$4(split(validChildren, ','), function (rule) {
- var matches = childRuleRegExp.exec(rule);
- var parent, prefix;
- if (matches) {
- prefix = matches[1];
- if (prefix) {
- parent = children[matches[2]];
- } else {
- parent = children[matches[2]] = { '#comment': {} };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function Styles(settings, schema) {
+ var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi;
+ var urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi;
+ var styleRegExp = /\s*([^:]+):\s*([^;]+);?/g;
+ var trimRightRegExp = /\s+$/;
+ var i;
+ var encodingLookup = {};
+ var encodingItems;
+ var validStyles;
+ var invalidStyles;
+ var invisibleChar = '\uFEFF';
+ settings = settings || {};
+ if (schema) {
+ validStyles = schema.getValidStyles();
+ invalidStyles = schema.getInvalidStyles();
+ }
+ encodingItems = ('\\" \\\' \\; \\: ; : ' + invisibleChar).split(' ');
+ for (i = 0; i < encodingItems.length; i++) {
+ encodingLookup[encodingItems[i]] = invisibleChar + i;
+ encodingLookup[invisibleChar + i] = encodingItems[i];
+ }
+ return {
+ toHex: function (color) {
+ return color.replace(rgbRegExp, toHex);
+ },
+ parse: function (css) {
+ var styles = {};
+ var matches, name, value, isEncoded;
+ var urlConverter = settings.url_converter;
+ var urlConverterScope = settings.url_converter_scope || this;
+ var compress = function (prefix, suffix, noJoin) {
+ var top, right, bottom, left;
+ top = styles[prefix + '-top' + suffix];
+ if (!top) {
+ 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">- parent = children[matches[2]];
- each$4(split(matches[3], '|'), function (child) {
- if (prefix === '-') {
- delete parent[child];
- } else {
- parent[child] = {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ right = styles[prefix + '-right' + suffix];
+ if (!right) {
+ return;
+ }
+ bottom = styles[prefix + '-bottom' + suffix];
+ if (!bottom) {
+ return;
+ }
+ left = styles[prefix + '-left' + suffix];
+ if (!left) {
+ return;
+ }
+ var box = [
+ top,
+ right,
+ bottom,
+ left
+ ];
+ i = box.length - 1;
+ while (i--) {
+ if (box[i] !== box[i + 1]) {
+ break;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (i > -1 && noJoin) {
+ return;
+ }
+ styles[prefix + suffix] = i === -1 ? box[0] : box.join(' ');
+ delete styles[prefix + '-top' + suffix];
+ delete styles[prefix + '-right' + suffix];
+ delete styles[prefix + '-bottom' + suffix];
+ delete styles[prefix + '-left' + suffix];
+ };
+ var canCompress = function (key) {
+ var value = styles[key], i;
+ if (!value) {
+ return;
+ }
+ value = value.split(' ');
+ i = value.length;
+ while (i--) {
+ if (value[i] !== value[0]) {
+ return false;
+ }
+ }
+ styles[key] = value[0];
+ return true;
+ };
+ var compress2 = function (target, a, b, c) {
+ if (!canCompress(a)) {
+ return;
+ }
+ if (!canCompress(b)) {
+ return;
+ }
+ if (!canCompress(c)) {
+ return;
+ }
+ styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c];
+ delete styles[a];
+ delete styles[b];
+ delete styles[c];
+ };
+ var encode = function (str) {
+ isEncoded = true;
+ return encodingLookup[str];
+ };
+ var decode = function (str, keepSlashes) {
+ if (isEncoded) {
+ str = str.replace(/\uFEFF[0-9]/g, function (str) {
+ return encodingLookup[str];
+ });
+ }
+ if (!keepSlashes) {
+ str = str.replace(/\\([\'\";:])/g, '$1');
+ }
+ return str;
+ };
+ var decodeSingleHexSequence = function (escSeq) {
+ return String.fromCharCode(parseInt(escSeq.slice(1), 16));
+ };
+ var decodeHexSequences = function (value) {
+ return value.replace(/\\[0-9a-f]+/gi, decodeSingleHexSequence);
+ };
+ var processUrl = function (match, url, url2, url3, str, str2) {
+ str = str || str2;
+ if (str) {
+ str = decode(str);
+ return '\'' + str.replace(/\'/g, '\\\'') + '\'';
+ }
+ url = decode(url || url2 || url3);
+ if (!settings.allow_script_urls) {
+ var scriptUrl = url.replace(/[\s\r\n]+/g, '');
+ if (/(java|vb)script:/i.test(scriptUrl)) {
+ return '';
+ }
+ if (!settings.allow_svg_data_urls && /^data:image\/svg/i.test(scriptUrl)) {
+ return '';
+ }
+ }
+ if (urlConverter) {
+ url = urlConverter.call(urlConverterScope, url, 'style');
+ }
+ return 'url(\'' + url.replace(/\'/g, '\\\'') + '\')';
+ };
+ if (css) {
+ css = css.replace(/[\u0000-\u001F]/g, '');
+ css = css.replace(/\\[\"\';:\uFEFF]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function (str) {
+ return str.replace(/[;:]/g, encode);
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ while (matches = styleRegExp.exec(css)) {
+ styleRegExp.lastIndex = matches.index + matches[0].length;
+ name = matches[1].replace(trimRightRegExp, '').toLowerCase();
+ value = matches[2].replace(trimRightRegExp, '');
+ if (name && value) {
+ name = decodeHexSequences(name);
+ value = decodeHexSequences(value);
+ if (name.indexOf(invisibleChar) !== -1 || name.indexOf('"') !== -1) {
+ continue;
+ }
+ if (!settings.allow_script_urls && (name === 'behavior' || /expression\s*\(|\/\*|\*\//.test(value))) {
+ continue;
+ }
+ if (name === 'font-weight' && value === '700') {
+ value = 'bold';
+ } else if (name === 'color' || name === 'background-color') {
+ value = value.toLowerCase();
+ }
+ value = value.replace(rgbRegExp, toHex);
+ value = value.replace(urlOrStrRegExp, processUrl);
+ styles[name] = isEncoded ? decode(value, true) : value;
+ }
+ }
+ compress('border', '', true);
+ compress('border', '-width');
+ compress('border', '-color');
+ compress('border', '-style');
+ compress('padding', '');
+ compress('margin', '');
+ compress2('border', 'border-width', 'border-style', 'border-color');
+ if (styles.border === 'medium none') {
+ delete styles.border;
+ }
+ if (styles['border-image'] === 'none') {
+ delete styles['border-image'];
+ }
</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">+ return styles;
+ },
+ serialize: function (styles, elementName) {
+ var css = '', name, value;
+ var serializeStyles = function (name) {
+ var styleList, i, l, value;
+ styleList = validStyles[name];
+ if (styleList) {
+ for (i = 0, l = styleList.length; i < l; i++) {
+ name = styleList[i];
+ value = styles[name];
+ if (value) {
+ css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';';
+ }
+ }
+ }
+ };
+ var isValid = function (name, elementName) {
+ var styleMap;
+ styleMap = invalidStyles['*'];
+ if (styleMap && styleMap[name]) {
+ return false;
+ }
+ styleMap = invalidStyles[elementName];
+ if (styleMap && styleMap[name]) {
+ return false;
+ }
+ return true;
+ };
+ if (elementName && validStyles) {
+ serializeStyles('*');
+ serializeStyles(elementName);
+ } else {
+ for (name in styles) {
+ value = styles[name];
+ if (value && (!invalidStyles || isValid(name, elementName))) {
+ css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';';
+ }
+ }
+ }
+ return css;
+ }
+ };
+ }
+
+ var each$5 = Tools.each;
+ var grep$1 = Tools.grep;
+ var isIE = Env.ie;
+ var simpleSelectorRe = /^([a-z0-9],?)+$/i;
+ var whiteSpaceRegExp$2 = /^[ \t\r\n]*$/;
+ var setupAttrHooks = function (styles, settings, getContext) {
+ var attrHooks = {};
+ var keepValues = settings.keep_values;
+ var keepUrlHook = {
+ set: function ($elm, value, name$$1) {
+ if (settings.url_converter) {
+ value = settings.url_converter.call(settings.url_converter_scope || getContext(), value, name$$1, $elm[0]);
+ }
+ $elm.attr('data-mce-' + name$$1, value).attr(name$$1, value);
+ },
+ get: function ($elm, name$$1) {
+ return $elm.attr('data-mce-' + name$$1) || $elm.attr(name$$1);
+ }
+ };
+ attrHooks = {
+ style: {
+ set: function ($elm, value) {
+ if (value !== null && typeof value === 'object') {
+ $elm.css(value);
+ return;
+ }
+ if (keepValues) {
+ $elm.attr('data-mce-style', value);
+ }
+ $elm.attr('style', value);
+ },
+ get: function ($elm) {
+ var value = $elm.attr('data-mce-style') || $elm.attr('style');
+ value = styles.serialize(styles.parse(value), $elm[0].nodeName);
+ return value;
+ }
+ }
+ };
+ if (keepValues) {
+ attrHooks.href = attrHooks.src = keepUrlHook;
</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 attrHooks;
</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 getElementRule = function (name) {
- var element = elements[name], i;
- if (element) {
- return element;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var updateInternalStyleAttr = function (styles, $elm) {
+ var rawValue = $elm.attr('style');
+ var value = styles.serialize(styles.parse(rawValue), $elm[0].nodeName);
+ if (!value) {
+ value = 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">- i = patternElements.length;
- while (i--) {
- element = patternElements[i];
- if (element.pattern.test(name)) {
- return element;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $elm.attr('data-mce-style', value);
+ };
+ var findNodeIndex = function (node, normalized) {
+ var idx = 0, lastNodeType, nodeType;
+ if (node) {
+ for (lastNodeType = node.nodeType, node = node.previousSibling; node; node = node.previousSibling) {
+ nodeType = node.nodeType;
+ if (normalized && nodeType === 3) {
+ if (nodeType === lastNodeType || !node.nodeValue.length) {
+ continue;
+ }
+ }
+ idx++;
+ lastNodeType = nodeType;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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">- if (!settings.valid_elements) {
- each$4(schemaItems, function (element, name) {
- elements[name] = {
- attributes: element.attributes,
- attributesOrder: element.attributesOrder
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function DOMUtils(doc, settings) {
+ var _this = this;
+ if (settings === void 0) {
+ settings = {};
+ }
+ var attrHooks;
+ var addedStyles = {};
+ var win = window;
+ var files = {};
+ var counter = 0;
+ var stdMode = true;
+ var boxModel = true;
+ var styleSheetLoader = StyleSheetLoader(doc, { contentCssCors: settings.contentCssCors });
+ var boundEvents = [];
+ var schema = settings.schema ? settings.schema : Schema({});
+ var styles = Styles({
+ url_converter: settings.url_converter,
+ url_converter_scope: settings.url_converter_scope
+ }, settings.schema);
+ var events = settings.ownEvents ? new EventUtils(settings.proxy) : EventUtils.Event;
+ var blockElementsMap = schema.getBlockElements();
+ var $ = DomQuery.overrideDefaults(function () {
+ return {
+ context: doc,
+ element: self$$1.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">- children[name] = element.children;
</del><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.schema !== 'html5') {
- each$4(split('strong/b em/i'), function (item) {
- item = split(item, '/');
- elements[item[1]].outputName = item[0];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isBlock = function (node) {
+ if (typeof node === 'string') {
+ return !!blockElementsMap[node];
+ } else if (node) {
+ var type = node.nodeType;
+ if (type) {
+ return !!(type === 1 && blockElementsMap[node.nodeName]);
+ }
+ }
+ return false;
+ };
+ var get = function (elm) {
+ if (elm && doc && typeof elm === 'string') {
+ var node = doc.getElementById(elm);
+ if (node && node.id !== elm) {
+ return doc.getElementsByName(elm)[1];
+ } else {
+ return node;
+ }
+ }
+ return elm;
+ };
+ var $$ = function (elm) {
+ if (typeof elm === 'string') {
+ elm = get(elm);
+ }
+ return $(elm);
+ };
+ var getAttrib = function (elm, name$$1, defaultVal) {
+ var hook, value;
+ var $elm = $$(elm);
+ if ($elm.length) {
+ hook = attrHooks[name$$1];
+ if (hook && hook.get) {
+ value = hook.get($elm, name$$1);
+ } else {
+ value = $elm.attr(name$$1);
+ }
+ }
+ if (typeof value === 'undefined') {
+ value = defaultVal || '';
+ }
+ return value;
+ };
+ var getAttribs = function (elm) {
+ var node = get(elm);
+ if (!node) {
+ return [];
+ }
+ return node.attributes;
+ };
+ var setAttrib = function (elm, name$$1, value) {
+ var originalValue, hook;
+ if (value === '') {
+ value = null;
+ }
+ var $elm = $$(elm);
+ originalValue = $elm.attr(name$$1);
+ if (!$elm.length) {
+ return;
+ }
+ hook = attrHooks[name$$1];
+ if (hook && hook.set) {
+ hook.set($elm, value, name$$1);
+ } else {
+ $elm.attr(name$$1, value);
+ }
+ if (originalValue !== value && settings.onSetAttrib) {
+ settings.onSetAttrib({
+ attrElm: $elm,
+ attrName: name$$1,
+ attrValue: value
+ });
+ }
+ };
+ var clone = function (node, deep) {
+ if (!isIE || node.nodeType !== 1 || deep) {
+ return node.cloneNode(deep);
+ }
+ if (!deep) {
+ var clone_1 = doc.createElement(node.nodeName);
+ each$5(getAttribs(node), function (attr) {
+ setAttrib(clone_1, attr.nodeName, getAttrib(node, attr.nodeName));
+ });
+ return clone_1;
+ }
+ return null;
+ };
+ var getRoot = function () {
+ return settings.root_element || doc.body;
+ };
+ var getViewPort = function (argWin) {
+ var actWin = !argWin ? win : argWin;
+ var doc = actWin.document;
+ var rootElm = boxModel ? doc.documentElement : doc.body;
+ return {
+ x: actWin.pageXOffset || rootElm.scrollLeft,
+ y: actWin.pageYOffset || rootElm.scrollTop,
+ w: actWin.innerWidth || rootElm.clientWidth,
+ h: actWin.innerHeight || rootElm.clientHeight
+ };
+ };
+ var getPos = function (elm, rootElm) {
+ return Position.getPos(doc.body, get(elm), rootElm);
+ };
+ var setStyle = function (elm, name$$1, value) {
+ var $elm = $$(elm).css(name$$1, value);
+ if (settings.update_styles) {
+ updateInternalStyleAttr(styles, $elm);
+ }
+ };
+ var setStyles = function (elm, stylesArg) {
+ var $elm = $$(elm).css(stylesArg);
+ if (settings.update_styles) {
+ updateInternalStyleAttr(styles, $elm);
+ }
+ };
+ var getStyle = function (elm, name$$1, computed) {
+ var $elm = $$(elm);
+ if (computed) {
+ return $elm.css(name$$1);
+ }
+ name$$1 = name$$1.replace(/-(\D)/g, function (a, b) {
+ return b.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">- }
- each$4(split('ol ul sub sup blockquote span font a table tbody tr strong em b i'), function (name) {
- if (elements[name]) {
- elements[name].removeEmpty = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (name$$1 === 'float') {
+ name$$1 = Env.ie && Env.ie < 12 ? 'styleFloat' : 'cssFloat';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- each$4(split('p h1 h2 h3 h4 h5 h6 th td pre div address caption li'), function (name) {
- elements[name].paddEmpty = true;
- });
- each$4(split('span'), function (name) {
- elements[name].removeEmptyAttrs = true;
- });
- } else {
- setValidElements(settings.valid_elements);
- }
- addCustomElements(settings.custom_elements);
- addValidChildren(settings.valid_children);
- addValidElements(settings.extended_valid_elements);
- addValidChildren('+ol[ul|ol],+ul[ul|ol]');
- each$4({
- dd: 'dl',
- dt: 'dl',
- li: 'ul ol',
- td: 'tr',
- th: 'tr',
- tr: 'tbody thead tfoot',
- tbody: 'table',
- thead: 'table',
- tfoot: 'table',
- legend: 'fieldset',
- area: 'map',
- param: 'video audio object'
- }, function (parents, item) {
- if (elements[item]) {
- elements[item].parentsRequired = split(parents);
- }
- });
- if (settings.invalid_elements) {
- each$4(explode$1(settings.invalid_elements), function (item) {
- if (elements[item]) {
- delete elements[item];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $elm[0] && $elm[0].style ? $elm[0].style[name$$1] : undefined;
+ };
+ var getSize = function (elm) {
+ var w, h;
+ elm = get(elm);
+ w = getStyle(elm, 'width');
+ h = getStyle(elm, 'height');
+ if (w.indexOf('px') === -1) {
+ w = 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">- });
- }
- if (!getElementRule('span')) {
- addValidElements('span[!data-mce-type|*]');
- }
- var getValidStyles = function () {
- return validStyles;
- };
- var getInvalidStyles = function () {
- return invalidStyles;
- };
- var getValidClasses = function () {
- return validClasses;
- };
- var getBoolAttrs = function () {
- return boolAttrMap;
- };
- var getBlockElements = function () {
- return blockElementsMap;
- };
- var getTextBlockElements = function () {
- return textBlockElementsMap;
- };
- var getTextInlineElements = function () {
- return textInlineElementsMap;
- };
- var getShortEndedElements = function () {
- return shortEndedElementsMap;
- };
- var getSelfClosingElements = function () {
- return selfClosingElementsMap;
- };
- var getNonEmptyElements = function () {
- return nonEmptyElementsMap;
- };
- var getMoveCaretBeforeOnEnterElements = function () {
- return moveCaretBeforeOnEnterElementsMap;
- };
- var getWhiteSpaceElements = function () {
- return whiteSpaceElementsMap;
- };
- var getSpecialElements = function () {
- return specialElements;
- };
- var isValidChild = function (name, child) {
- var parent = children[name.toLowerCase()];
- return !!(parent && parent[child.toLowerCase()]);
- };
- var isValid = function (name, attr) {
- var attrPatterns, i;
- var rule = getElementRule(name);
- if (rule) {
- if (attr) {
- if (rule.attributes[attr]) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (h.indexOf('px') === -1) {
+ h = 0;
+ }
+ return {
+ w: parseInt(w, 10) || elm.offsetWidth || elm.clientWidth,
+ h: parseInt(h, 10) || elm.offsetHeight || elm.clientHeight
+ };
+ };
+ var getRect = function (elm) {
+ var pos, size;
+ elm = get(elm);
+ pos = getPos(elm);
+ size = getSize(elm);
+ return {
+ x: pos.x,
+ y: pos.y,
+ w: size.w,
+ h: size.h
+ };
+ };
+ var is = function (elm, selector) {
+ var i;
+ if (!elm) {
+ return false;
+ }
+ if (!Array.isArray(elm)) {
+ if (selector === '*') {
+ return elm.nodeType === 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">- attrPatterns = rule.attributePatterns;
- if (attrPatterns) {
- i = attrPatterns.length;
- while (i--) {
- if (attrPatterns[i].pattern.test(name)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (simpleSelectorRe.test(selector)) {
+ var selectors = selector.toLowerCase().split(/,/);
+ var elmName = elm.nodeName.toLowerCase();
+ for (i = selectors.length - 1; i >= 0; i--) {
+ if (selectors[i] === elmName) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><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">- } else {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (elm.nodeType && elm.nodeType !== 1) {
+ 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 false;
- };
- var getCustomElements = function () {
- return customElementsMap;
- };
- return {
- children: children,
- elements: elements,
- getValidStyles: getValidStyles,
- getValidClasses: getValidClasses,
- getBlockElements: getBlockElements,
- getInvalidStyles: getInvalidStyles,
- getShortEndedElements: getShortEndedElements,
- getTextBlockElements: getTextBlockElements,
- getTextInlineElements: getTextInlineElements,
- getBoolAttrs: getBoolAttrs,
- getElementRule: getElementRule,
- getSelfClosingElements: getSelfClosingElements,
- getNonEmptyElements: getNonEmptyElements,
- getMoveCaretBeforeOnEnterElements: getMoveCaretBeforeOnEnterElements,
- getWhiteSpaceElements: getWhiteSpaceElements,
- getSpecialElements: getSpecialElements,
- isValidChild: isValidChild,
- isValid: isValid,
- getCustomElements: getCustomElements,
- addValidElements: addValidElements,
- setValidElements: setValidElements,
- addCustomElements: addCustomElements,
- addValidChildren: addValidChildren
- };
- }
-
- var toHex = function (match, r, g, b) {
- var hex = function (val) {
- val = parseInt(val, 10).toString(16);
- return val.length > 1 ? val : '0' + val;
- };
- return '#' + hex(r) + hex(g) + hex(b);
- };
- function Styles(settings, schema) {
- var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi;
- var urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi;
- var styleRegExp = /\s*([^:]+):\s*([^;]+);?/g;
- var trimRightRegExp = /\s+$/;
- var i;
- var encodingLookup = {};
- var encodingItems;
- var validStyles;
- var invalidStyles;
- var invisibleChar = '\uFEFF';
- settings = settings || {};
- if (schema) {
- validStyles = schema.getValidStyles();
- invalidStyles = schema.getInvalidStyles();
- }
- encodingItems = ('\\" \\\' \\; \\: ; : ' + invisibleChar).split(' ');
- for (i = 0; i < encodingItems.length; i++) {
- encodingLookup[encodingItems[i]] = invisibleChar + i;
- encodingLookup[invisibleChar + i] = encodingItems[i];
- }
- return {
- toHex: function (color) {
- return color.replace(rgbRegExp, toHex);
- },
- parse: function (css) {
- var styles = {};
- var matches, name, value, isEncoded;
- var urlConverter = settings.url_converter;
- var urlConverterScope = settings.url_converter_scope || this;
- var compress = function (prefix, suffix, noJoin) {
- var top, right, bottom, left;
- top = styles[prefix + '-top' + suffix];
- if (!top) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var elms = !Array.isArray(elm) ? [elm] : elm;
+ return Sizzle(selector, elms[0].ownerDocument || elms[0], null, elms).length > 0;
+ };
+ var getParents = function (elm, selector, root, collect) {
+ var result = [];
+ var selectorVal;
+ var node = get(elm);
+ collect = collect === undefined;
+ root = root || (getRoot().nodeName !== 'BODY' ? getRoot().parentNode : null);
+ if (Tools.is(selector, 'string')) {
+ selectorVal = selector;
+ if (selector === '*') {
+ selector = function (node) {
+ return node.nodeType === 1;
+ };
+ } else {
+ selector = function (node) {
+ return is(node, selectorVal);
+ };
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- right = styles[prefix + '-right' + suffix];
- if (!right) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ while (node) {
+ if (node === root || !node.nodeType || node.nodeType === 9) {
+ 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">- bottom = styles[prefix + '-bottom' + suffix];
- if (!bottom) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!selector || typeof selector === 'function' && selector(node)) {
+ if (collect) {
+ result.push(node);
+ } else {
+ return [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">- left = styles[prefix + '-left' + suffix];
- if (!left) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ node = node.parentNode;
+ }
+ return collect ? result : null;
+ };
+ var getParent = function (node, selector, root) {
+ var parents = getParents(node, selector, root, false);
+ return parents && parents.length > 0 ? parents[0] : null;
+ };
+ var _findSib = function (node, selector, name$$1) {
+ var func = selector;
+ if (node) {
+ if (typeof selector === 'string') {
+ func = function (node) {
+ return is(node, 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">- var box = [
- top,
- right,
- bottom,
- left
- ];
- i = box.length - 1;
- while (i--) {
- if (box[i] !== box[i + 1]) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (node = node[name$$1]; node; node = node[name$$1]) {
+ if (typeof func === 'function' && func(node)) {
+ return node;
</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">- if (i > -1 && noJoin) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ return null;
+ };
+ var getNext = function (node, selector) {
+ return _findSib(node, selector, 'nextSibling');
+ };
+ var getPrev = function (node, selector) {
+ return _findSib(node, selector, 'previousSibling');
+ };
+ var select = function (selector, scope) {
+ return Sizzle(selector, get(scope) || settings.root_element || doc, []);
+ };
+ var run = function (elm, func, scope) {
+ var result;
+ var node = typeof elm === 'string' ? get(elm) : elm;
+ if (!node) {
+ return false;
+ }
+ if (Tools.isArray(node) && (node.length || node.length === 0)) {
+ result = [];
+ each$5(node, function (elm, i) {
+ if (elm) {
+ if (typeof elm === 'string') {
+ elm = get(elm);
+ }
+ result.push(func.call(scope, elm, i));
+ }
+ });
+ return result;
+ }
+ var context = scope ? scope : _this;
+ return func.call(context, node);
+ };
+ var setAttribs = function (elm, attrs) {
+ $$(elm).each(function (i, node) {
+ each$5(attrs, function (value, name$$1) {
+ setAttrib(node, name$$1, value);
+ });
+ });
+ };
+ var setHTML = function (elm, html) {
+ var $elm = $$(elm);
+ if (isIE) {
+ $elm.each(function (i, target) {
+ if (target.canHaveHTML === false) {
+ return;
+ }
+ while (target.firstChild) {
+ target.removeChild(target.firstChild);
+ }
+ try {
+ target.innerHTML = '<br>' + html;
+ target.removeChild(target.firstChild);
+ } catch (ex) {
+ DomQuery('<div></div>').html('<br>' + html).contents().slice(1).appendTo(target);
+ }
+ return html;
+ });
+ } else {
+ $elm.html(html);
+ }
+ };
+ var add = function (parentElm, name$$1, attrs, html, create) {
+ return run(parentElm, function (parentElm) {
+ var newElm = typeof name$$1 === 'string' ? doc.createElement(name$$1) : name$$1;
+ setAttribs(newElm, attrs);
+ if (html) {
+ if (typeof html !== 'string' && html.nodeType) {
+ newElm.appendChild(html);
+ } else if (typeof html === 'string') {
+ setHTML(newElm, html);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- styles[prefix + suffix] = i === -1 ? box[0] : box.join(' ');
- delete styles[prefix + '-top' + suffix];
- delete styles[prefix + '-right' + suffix];
- delete styles[prefix + '-bottom' + suffix];
- delete styles[prefix + '-left' + suffix];
- };
- var canCompress = function (key) {
- var value = styles[key], i;
- if (!value) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return !create ? parentElm.appendChild(newElm) : newElm;
+ });
+ };
+ var create = function (name$$1, attrs, html) {
+ return add(doc.createElement(name$$1), name$$1, attrs, html, true);
+ };
+ var decode = Entities.decode;
+ var encode = Entities.encodeAllRaw;
+ var createHTML = function (name$$1, attrs, html) {
+ var outHtml = '', key;
+ outHtml += '<' + name$$1;
+ for (key in attrs) {
+ if (attrs.hasOwnProperty(key) && attrs[key] !== null && typeof attrs[key] !== 'undefined') {
+ outHtml += ' ' + key + '="' + encode(attrs[key]) + '"';
</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 = value.split(' ');
- i = value.length;
- while (i--) {
- if (value[i] !== value[0]) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (typeof html !== 'undefined') {
+ return outHtml + '>' + html + '</' + name$$1 + '>';
+ }
+ return outHtml + ' />';
+ };
+ var createFragment = function (html) {
+ var node;
+ var container = doc.createElement('div');
+ var frag = doc.createDocumentFragment();
+ if (html) {
+ container.innerHTML = html;
+ }
+ while (node = container.firstChild) {
+ frag.appendChild(node);
+ }
+ return frag;
+ };
+ var remove = function (node, keepChildren) {
+ var $node = $$(node);
+ if (keepChildren) {
+ $node.each(function () {
+ var child;
+ while (child = this.firstChild) {
+ if (child.nodeType === 3 && child.data.length === 0) {
+ this.removeChild(child);
+ } else {
+ this.parentNode.insertBefore(child, this);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }).remove();
+ } else {
+ $node.remove();
+ }
+ return $node.length > 1 ? $node.toArray() : $node[0];
+ };
+ var removeAllAttribs = function (e) {
+ return run(e, function (e) {
+ var i;
+ var attrs = e.attributes;
+ for (i = attrs.length - 1; i >= 0; i--) {
+ e.removeAttributeNode(attrs.item(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">- styles[key] = value[0];
- return true;
- };
- var compress2 = function (target, a, b, c) {
- if (!canCompress(a)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ var parseStyle = function (cssText) {
+ return styles.parse(cssText);
+ };
+ var serializeStyle = function (stylesArg, name$$1) {
+ return styles.serialize(stylesArg, name$$1);
+ };
+ var addStyle = function (cssText) {
+ var head, styleElm;
+ if (self$$1 !== DOMUtils.DOM && doc === document) {
+ if (addedStyles[cssText]) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (!canCompress(b)) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ addedStyles[cssText] = true;
+ }
+ styleElm = doc.getElementById('mceDefaultStyles');
+ if (!styleElm) {
+ styleElm = doc.createElement('style');
+ styleElm.id = 'mceDefaultStyles';
+ styleElm.type = 'text/css';
+ head = doc.getElementsByTagName('head')[0];
+ if (head.firstChild) {
+ head.insertBefore(styleElm, head.firstChild);
+ } else {
+ head.appendChild(styleElm);
</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 (!canCompress(c)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (styleElm.styleSheet) {
+ styleElm.styleSheet.cssText += cssText;
+ } else {
+ styleElm.appendChild(doc.createTextNode(cssText));
+ }
+ };
+ var loadCSS = function (url) {
+ var head;
+ if (self$$1 !== DOMUtils.DOM && doc === document) {
+ DOMUtils.DOM.loadCSS(url);
+ return;
+ }
+ if (!url) {
+ url = '';
+ }
+ head = doc.getElementsByTagName('head')[0];
+ each$5(url.split(','), function (url) {
+ var link;
+ url = Tools._addCacheSuffix(url);
+ if (files[url]) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c];
- delete styles[a];
- delete styles[b];
- delete styles[c];
- };
- var encode = function (str) {
- isEncoded = true;
- return encodingLookup[str];
- };
- var decode = function (str, keepSlashes) {
- if (isEncoded) {
- str = str.replace(/\uFEFF[0-9]/g, function (str) {
- return encodingLookup[str];
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ files[url] = true;
+ link = create('link', {
+ rel: 'stylesheet',
+ href: url
+ });
+ head.appendChild(link);
+ });
+ };
+ var toggleClass = function (elm, cls, state) {
+ $$(elm).toggleClass(cls, state).each(function () {
+ if (this.className === '') {
+ DomQuery(this).attr('class', 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 (!keepSlashes) {
- str = str.replace(/\\([\'\";:])/g, '$1');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ var addClass = function (elm, cls) {
+ $$(elm).addClass(cls);
+ };
+ var removeClass = function (elm, cls) {
+ toggleClass(elm, cls, false);
+ };
+ var hasClass = function (elm, cls) {
+ return $$(elm).hasClass(cls);
+ };
+ var show = function (elm) {
+ $$(elm).show();
+ };
+ var hide = function (elm) {
+ $$(elm).hide();
+ };
+ var isHidden = function (elm) {
+ return $$(elm).css('display') === 'none';
+ };
+ var uniqueId = function (prefix) {
+ return (!prefix ? 'mce_' : prefix) + counter++;
+ };
+ var getOuterHTML = function (elm) {
+ var node = typeof elm === 'string' ? get(elm) : elm;
+ return NodeType.isElement(node) ? node.outerHTML : DomQuery('<div></div>').append(DomQuery(node).clone()).html();
+ };
+ var setOuterHTML = function (elm, html) {
+ $$(elm).each(function () {
+ try {
+ if ('outerHTML' in this) {
+ this.outerHTML = html;
+ return;
+ }
+ } catch (ex) {
</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 str;
- };
- var decodeSingleHexSequence = function (escSeq) {
- return String.fromCharCode(parseInt(escSeq.slice(1), 16));
- };
- var decodeHexSequences = function (value) {
- return value.replace(/\\[0-9a-f]+/gi, decodeSingleHexSequence);
- };
- var processUrl = function (match, url, url2, url3, str, str2) {
- str = str || str2;
- if (str) {
- str = decode(str);
- return '\'' + str.replace(/\'/g, '\\\'') + '\'';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ remove(DomQuery(this).html(html), true);
+ });
+ };
+ var insertAfter = function (node, reference) {
+ var referenceNode = get(reference);
+ return run(node, function (node) {
+ var parent$$1, nextSibling;
+ parent$$1 = referenceNode.parentNode;
+ nextSibling = referenceNode.nextSibling;
+ if (nextSibling) {
+ parent$$1.insertBefore(node, nextSibling);
+ } else {
+ parent$$1.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">- url = decode(url || url2 || url3);
- if (!settings.allow_script_urls) {
- var scriptUrl = url.replace(/[\s\r\n]+/g, '');
- if (/(java|vb)script:/i.test(scriptUrl)) {
- return '';
- }
- if (!settings.allow_svg_data_urls && /^data:image\/svg/i.test(scriptUrl)) {
- return '';
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return node;
+ });
+ };
+ var replace = function (newElm, oldElm, keepChildren) {
+ return run(oldElm, function (oldElm) {
+ if (Tools.is(oldElm, 'array')) {
+ newElm = newElm.cloneNode(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 (urlConverter) {
- url = urlConverter.call(urlConverterScope, url, 'style');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (keepChildren) {
+ each$5(grep$1(oldElm.childNodes), function (node) {
+ newElm.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 'url(\'' + url.replace(/\'/g, '\\\'') + '\')';
- };
- if (css) {
- css = css.replace(/[\u0000-\u001F]/g, '');
- css = css.replace(/\\[\"\';:\uFEFF]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function (str) {
- return str.replace(/[;:]/g, encode);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return oldElm.parentNode.replaceChild(newElm, oldElm);
+ });
+ };
+ var rename = function (elm, name$$1) {
+ var newElm;
+ if (elm.nodeName !== name$$1.toUpperCase()) {
+ newElm = create(name$$1);
+ each$5(getAttribs(elm), function (attrNode) {
+ setAttrib(newElm, attrNode.nodeName, getAttrib(elm, attrNode.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">- while (matches = styleRegExp.exec(css)) {
- styleRegExp.lastIndex = matches.index + matches[0].length;
- name = matches[1].replace(trimRightRegExp, '').toLowerCase();
- value = matches[2].replace(trimRightRegExp, '');
- if (name && value) {
- name = decodeHexSequences(name);
- value = decodeHexSequences(value);
- if (name.indexOf(invisibleChar) !== -1 || name.indexOf('"') !== -1) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ replace(newElm, elm, true);
+ }
+ return newElm || elm;
+ };
+ var findCommonAncestor = function (a, b) {
+ var ps = a, pe;
+ while (ps) {
+ pe = b;
+ while (pe && ps !== pe) {
+ pe = pe.parentNode;
+ }
+ if (ps === pe) {
+ break;
+ }
+ ps = ps.parentNode;
+ }
+ if (!ps && a.ownerDocument) {
+ return a.ownerDocument.documentElement;
+ }
+ return ps;
+ };
+ var toHex = function (rgbVal) {
+ return styles.toHex(Tools.trim(rgbVal));
+ };
+ var isEmpty = function (node, elements) {
+ var i, attributes, type, whitespace, walker, name$$1, brCount = 0;
+ node = node.firstChild;
+ if (node) {
+ walker = new TreeWalker(node, node.parentNode);
+ elements = elements || (schema ? schema.getNonEmptyElements() : null);
+ whitespace = schema ? schema.getWhiteSpaceElements() : {};
+ do {
+ type = node.nodeType;
+ if (NodeType.isElement(node)) {
+ var bogusVal = node.getAttribute('data-mce-bogus');
+ if (bogusVal) {
+ node = walker.next(bogusVal === 'all');
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><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.allow_script_urls && (name === 'behavior' || /expression\s*\(|\/\*|\*\//.test(value))) {
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ name$$1 = node.nodeName.toLowerCase();
+ if (elements && elements[name$$1]) {
+ if (name$$1 === 'br') {
+ brCount++;
+ node = walker.next();
+ continue;
+ }
+ 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 (name === 'font-weight' && value === '700') {
- value = 'bold';
- } else if (name === 'color' || name === 'background-color') {
- value = value.toLowerCase();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ attributes = getAttribs(node);
+ i = attributes.length;
+ while (i--) {
+ name$$1 = attributes[i].nodeName;
+ if (name$$1 === 'name' || name$$1 === 'data-mce-bookmark') {
+ 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">- value = value.replace(rgbRegExp, toHex);
- value = value.replace(urlOrStrRegExp, processUrl);
- styles[name] = isEncoded ? decode(value, true) : value;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (type === 8) {
+ return false;
+ }
+ if (type === 3 && !whiteSpaceRegExp$2.test(node.nodeValue)) {
+ return false;
+ }
+ if (type === 3 && node.parentNode && whitespace[node.parentNode.nodeName] && whiteSpaceRegExp$2.test(node.nodeValue)) {
+ return false;
+ }
+ node = walker.next();
+ } while (node);
+ }
+ return brCount <= 1;
+ };
+ var createRng = function () {
+ return doc.createRange();
+ };
+ var split = function (parentElm, splitElm, replacementElm) {
+ var r = createRng(), bef, aft, pa;
+ if (parentElm && splitElm) {
+ r.setStart(parentElm.parentNode, findNodeIndex(parentElm));
+ r.setEnd(splitElm.parentNode, findNodeIndex(splitElm));
+ bef = r.extractContents();
+ r = createRng();
+ r.setStart(splitElm.parentNode, findNodeIndex(splitElm) + 1);
+ r.setEnd(parentElm.parentNode, findNodeIndex(parentElm) + 1);
+ aft = r.extractContents();
+ pa = parentElm.parentNode;
+ pa.insertBefore(TrimNode.trimNode(self$$1, bef), parentElm);
+ if (replacementElm) {
+ pa.insertBefore(replacementElm, parentElm);
+ } else {
+ pa.insertBefore(splitElm, parentElm);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- compress('border', '', true);
- compress('border', '-width');
- compress('border', '-color');
- compress('border', '-style');
- compress('padding', '');
- compress('margin', '');
- compress2('border', 'border-width', 'border-style', 'border-color');
- if (styles.border === 'medium none') {
- delete styles.border;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ pa.insertBefore(TrimNode.trimNode(self$$1, aft), parentElm);
+ remove(parentElm);
+ return replacementElm || splitElm;
+ }
+ };
+ var bind = function (target, name$$1, func, scope) {
+ if (Tools.isArray(target)) {
+ var i = target.length;
+ while (i--) {
+ target[i] = bind(target[i], name$$1, func, scope);
</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 (styles['border-image'] === 'none') {
- delete styles['border-image'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return target;
+ }
+ if (settings.collect && (target === doc || target === win)) {
+ boundEvents.push([
+ target,
+ name$$1,
+ func,
+ scope
+ ]);
+ }
+ return events.bind(target, name$$1, func, scope || self$$1);
+ };
+ var unbind = function (target, name$$1, func) {
+ var i;
+ if (Tools.isArray(target)) {
+ i = target.length;
+ while (i--) {
+ target[i] = unbind(target[i], name$$1, func);
</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 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">- return styles;
- },
- serialize: function (styles, elementName) {
- var css = '', name, value;
- var serializeStyles = function (name) {
- var styleList, i, l, value;
- styleList = validStyles[name];
- if (styleList) {
- for (i = 0, l = styleList.length; i < l; i++) {
- name = styleList[i];
- value = styles[name];
- if (value) {
- css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';';
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (boundEvents && (target === doc || target === win)) {
+ i = boundEvents.length;
+ while (i--) {
+ var item = boundEvents[i];
+ if (target === item[0] && (!name$$1 || name$$1 === item[1]) && (!func || func === item[2])) {
+ events.unbind(item[0], item[1], item[2]);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ return events.unbind(target, name$$1, func);
+ };
+ var fire = function (target, name$$1, evt) {
+ return events.fire(target, name$$1, evt);
+ };
+ var getContentEditable = function (node) {
+ if (node && NodeType.isElement(node)) {
+ var contentEditable = node.getAttribute('data-mce-contenteditable');
+ if (contentEditable && contentEditable !== 'inherit') {
+ return contentEditable;
+ }
+ return node.contentEditable !== 'inherit' ? node.contentEditable : null;
+ } else {
+ return null;
+ }
+ };
+ var getContentEditableParent = function (node) {
+ var root = getRoot();
+ var state = null;
+ for (; node && node !== root; node = node.parentNode) {
+ state = getContentEditable(node);
+ if (state !== null) {
+ break;
+ }
+ }
+ return state;
+ };
+ var destroy = function () {
+ if (boundEvents) {
+ var i = boundEvents.length;
+ while (i--) {
+ var item = boundEvents[i];
+ events.unbind(item[0], item[1], item[2]);
+ }
+ }
+ if (Sizzle.setDocument) {
+ Sizzle.setDocument();
+ }
+ };
+ var isChildOf = function (node, parent$$1) {
+ while (node) {
+ if (parent$$1 === node) {
+ return true;
+ }
+ node = node.parentNode;
+ }
+ return false;
+ };
+ var dumpRng = function (r) {
+ return 'startContainer: ' + r.startContainer.nodeName + ', startOffset: ' + r.startOffset + ', endContainer: ' + r.endContainer.nodeName + ', endOffset: ' + r.endOffset;
+ };
+ var self$$1 = {
+ doc: doc,
+ settings: settings,
+ win: win,
+ files: files,
+ stdMode: stdMode,
+ boxModel: boxModel,
+ styleSheetLoader: styleSheetLoader,
+ boundEvents: boundEvents,
+ styles: styles,
+ schema: schema,
+ events: events,
+ isBlock: isBlock,
+ $: $,
+ $$: $$,
+ root: null,
+ clone: clone,
+ getRoot: getRoot,
+ getViewPort: getViewPort,
+ getRect: getRect,
+ getSize: getSize,
+ getParent: getParent,
+ getParents: getParents,
+ get: get,
+ getNext: getNext,
+ getPrev: getPrev,
+ select: select,
+ is: is,
+ add: add,
+ create: create,
+ createHTML: createHTML,
+ createFragment: createFragment,
+ remove: remove,
+ setStyle: setStyle,
+ getStyle: getStyle,
+ setStyles: setStyles,
+ removeAllAttribs: removeAllAttribs,
+ setAttrib: setAttrib,
+ setAttribs: setAttribs,
+ getAttrib: getAttrib,
+ getPos: getPos,
+ parseStyle: parseStyle,
+ serializeStyle: serializeStyle,
+ addStyle: addStyle,
+ loadCSS: loadCSS,
+ addClass: addClass,
+ removeClass: removeClass,
+ hasClass: hasClass,
+ toggleClass: toggleClass,
+ show: show,
+ hide: hide,
+ isHidden: isHidden,
+ uniqueId: uniqueId,
+ setHTML: setHTML,
+ getOuterHTML: getOuterHTML,
+ setOuterHTML: setOuterHTML,
+ decode: decode,
+ encode: encode,
+ insertAfter: insertAfter,
+ replace: replace,
+ rename: rename,
+ findCommonAncestor: findCommonAncestor,
+ toHex: toHex,
+ run: run,
+ getAttribs: getAttribs,
+ isEmpty: isEmpty,
+ createRng: createRng,
+ nodeIndex: findNodeIndex,
+ split: split,
+ bind: bind,
+ unbind: unbind,
+ fire: fire,
+ getContentEditable: getContentEditable,
+ getContentEditableParent: getContentEditableParent,
+ destroy: destroy,
+ isChildOf: isChildOf,
+ dumpRng: dumpRng
+ };
+ attrHooks = setupAttrHooks(styles, settings, function () {
+ return self$$1;
+ });
+ return self$$1;
+ }
+ (function (DOMUtils) {
+ DOMUtils.DOM = DOMUtils(document);
+ DOMUtils.nodeIndex = findNodeIndex;
+ }(DOMUtils || (DOMUtils = {})));
+ var DOMUtils$1 = DOMUtils;
+
+ var DOM = DOMUtils$1.DOM;
+ var each$6 = Tools.each, grep$2 = Tools.grep;
+ var isFunction$1 = function (f) {
+ return typeof f === 'function';
+ };
+ var ScriptLoader = function () {
+ var QUEUED = 0;
+ var LOADING = 1;
+ var LOADED = 2;
+ var FAILED = 3;
+ var states = {};
+ var queue = [];
+ var scriptLoadedCallbacks = {};
+ var queueLoadedCallbacks = [];
+ var loading = 0;
+ var loadScript = function (url, success, failure) {
+ var dom = DOM;
+ var elm, id;
+ var done = function () {
+ dom.remove(id);
+ if (elm) {
+ elm.onreadystatechange = elm.onload = elm = null;
+ }
+ success();
</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 isValid = function (name, elementName) {
- var styleMap;
- styleMap = invalidStyles['*'];
- if (styleMap && styleMap[name]) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var error = function () {
+ if (isFunction$1(failure)) {
+ failure();
+ } else {
+ if (typeof console !== 'undefined' && console.log) {
+ console.log('Failed to load script: ' + 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">- styleMap = invalidStyles[elementName];
- if (styleMap && styleMap[name]) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ id = dom.uniqueId();
+ elm = document.createElement('script');
+ elm.id = id;
+ elm.type = 'text/javascript';
+ elm.src = Tools._addCacheSuffix(url);
+ elm.onload = done;
+ elm.onerror = error;
+ (document.getElementsByTagName('head')[0] || document.body).appendChild(elm);
+ };
+ this.isDone = function (url) {
+ return states[url] === LOADED;
+ };
+ this.markDone = function (url) {
+ states[url] = LOADED;
+ };
+ this.add = this.load = function (url, success, scope, failure) {
+ var state = states[url];
+ if (state === undefined) {
+ queue.push(url);
+ states[url] = QUEUED;
+ }
+ if (success) {
+ if (!scriptLoadedCallbacks[url]) {
+ scriptLoadedCallbacks[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">- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ scriptLoadedCallbacks[url].push({
+ success: success,
+ failure: failure,
+ scope: scope || this
+ });
+ }
+ };
+ this.remove = function (url) {
+ delete states[url];
+ delete scriptLoadedCallbacks[url];
+ };
+ this.loadQueue = function (success, scope, failure) {
+ this.loadScripts(queue, success, scope, failure);
+ };
+ this.loadScripts = function (scripts, success, scope, failure) {
+ var loadScripts;
+ var failures = [];
+ var execCallbacks = function (name$$1, url) {
+ each$6(scriptLoadedCallbacks[url], function (callback) {
+ if (isFunction$1(callback[name$$1])) {
+ callback[name$$1].call(callback.scope);
+ }
+ });
+ scriptLoadedCallbacks[url] = undefined;
</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 (elementName && validStyles) {
- serializeStyles('*');
- serializeStyles(elementName);
- } else {
- for (name in styles) {
- value = styles[name];
- if (value && (!invalidStyles || isValid(name, elementName))) {
- css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ queueLoadedCallbacks.push({
+ success: success,
+ failure: failure,
+ scope: scope || this
+ });
+ loadScripts = function () {
+ var loadingScripts = grep$2(scripts);
+ scripts.length = 0;
+ each$6(loadingScripts, function (url) {
+ if (states[url] === LOADED) {
+ execCallbacks('success', url);
+ return;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (states[url] === FAILED) {
+ execCallbacks('failure', url);
+ return;
+ }
+ if (states[url] !== LOADING) {
+ states[url] = LOADING;
+ loading++;
+ loadScript(url, function () {
+ states[url] = LOADED;
+ loading--;
+ execCallbacks('success', url);
+ loadScripts();
+ }, function () {
+ states[url] = FAILED;
+ loading--;
+ failures.push(url);
+ execCallbacks('failure', url);
+ loadScripts();
+ });
+ }
+ });
+ if (!loading) {
+ var notifyCallbacks = queueLoadedCallbacks.slice(0);
+ queueLoadedCallbacks.length = 0;
+ each$6(notifyCallbacks, function (callback) {
+ if (failures.length === 0) {
+ if (isFunction$1(callback.success)) {
+ callback.success.call(callback.scope);
+ }
+ } else {
+ if (isFunction$1(callback.failure)) {
+ callback.failure.call(callback.scope, failures);
+ }
+ }
+ });
</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 css;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ loadScripts();
+ };
</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">+ ScriptLoader.ScriptLoader = new ScriptLoader();
</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 each$5 = $_6cwiepljjgwe7j4.each;
- var grep$1 = $_6cwiepljjgwe7j4.grep;
- var isIE = $_bcvfv9ajjgwe79v.ie;
- var simpleSelectorRe = /^([a-z0-9],?)+$/i;
- var whiteSpaceRegExp$2 = /^[ \t\r\n]*$/;
- var setupAttrHooks = function (styles, settings, getContext) {
- var attrHooks = {};
- var keepValues = settings.keep_values;
- var keepUrlHook = {
- set: function ($elm, value, name$$1) {
- if (settings.url_converter) {
- value = settings.url_converter.call(settings.url_converter_scope || getContext(), value, name$$1, $elm[0]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var each$7 = Tools.each;
+ function AddOnManager() {
+ var _this = this;
+ var items = [];
+ var urls = {};
+ var lookup = {};
+ var _listeners = [];
+ var get = function (name) {
+ if (lookup[name]) {
+ return lookup[name].instance;
</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.attr('data-mce-' + name$$1, value).attr(name$$1, value);
- },
- get: function ($elm, name$$1) {
- return $elm.attr('data-mce-' + name$$1) || $elm.attr(name$$1);
- }
- };
- attrHooks = {
- style: {
- set: function ($elm, value) {
- if (value !== null && typeof value === 'object') {
- $elm.css(value);
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return undefined;
+ };
+ var dependencies = function (name) {
+ var result;
+ if (lookup[name]) {
+ result = lookup[name].dependencies;
+ }
+ return result || [];
+ };
+ var requireLangPack = function (name, languages) {
+ var language = AddOnManager.language;
+ if (language && AddOnManager.languageLoad !== false) {
+ if (languages) {
+ languages = ',' + languages + ',';
+ if (languages.indexOf(',' + language.substr(0, 2) + ',') !== -1) {
+ language = language.substr(0, 2);
+ } else if (languages.indexOf(',' + language + ',') === -1) {
+ 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 (keepValues) {
- $elm.attr('data-mce-style', value);
- }
- $elm.attr('style', value);
- },
- get: function ($elm) {
- var value = $elm.attr('data-mce-style') || $elm.attr('style');
- value = styles.serialize(styles.parse(value), $elm[0].nodeName);
- return value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ScriptLoader.ScriptLoader.add(urls[name] + '/langs/' + language + '.js');
</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 (keepValues) {
- attrHooks.href = attrHooks.src = keepUrlHook;
- }
- return attrHooks;
- };
- var updateInternalStyleAttr = function (styles, $elm) {
- var rawValue = $elm.attr('style');
- var value = styles.serialize(styles.parse(rawValue), $elm[0].nodeName);
- if (!value) {
- value = null;
- }
- $elm.attr('data-mce-style', value);
- };
- var findNodeIndex = function (node, normalized) {
- var idx = 0, lastNodeType, nodeType;
- if (node) {
- for (lastNodeType = node.nodeType, node = node.previousSibling; node; node = node.previousSibling) {
- nodeType = node.nodeType;
- if (normalized && nodeType === 3) {
- if (nodeType === lastNodeType || !node.nodeValue.length) {
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var add = function (id, addOn, dependencies) {
+ items.push(addOn);
+ lookup[id] = {
+ instance: addOn,
+ dependencies: dependencies
+ };
+ var result = partition(_listeners, function (listener) {
+ return listener.name === id;
+ });
+ _listeners = result.fail;
+ each$7(result.pass, function (listener) {
+ listener.callback();
+ });
+ return addOn;
+ };
+ var remove = function (name) {
+ delete urls[name];
+ delete lookup[name];
+ };
+ var createUrl = function (baseUrl, dep) {
+ if (typeof dep === 'object') {
+ return dep;
+ }
+ return typeof baseUrl === 'string' ? {
+ prefix: '',
+ resource: dep,
+ suffix: ''
+ } : {
+ prefix: baseUrl.prefix,
+ resource: dep,
+ suffix: baseUrl.suffix
+ };
+ };
+ var addComponents = function (pluginName, scripts) {
+ var pluginUrl = _this.urls[pluginName];
+ each$7(scripts, function (script) {
+ ScriptLoader.ScriptLoader.add(pluginUrl + '/' + script);
+ });
+ };
+ var loadDependencies = function (name, addOnUrl, success, scope) {
+ var deps = dependencies(name);
+ each$7(deps, function (dep) {
+ var newUrl = createUrl(addOnUrl, dep);
+ load(newUrl.resource, newUrl, undefined, undefined);
+ });
+ if (success) {
+ if (scope) {
+ success.call(scope);
+ } else {
+ success.call(ScriptLoader);
</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">- idx++;
- lastNodeType = nodeType;
- }
- }
- return idx;
- };
- function DOMUtils(doc, settings) {
- var _this = this;
- if (settings === void 0) {
- settings = {};
- }
- var attrHooks;
- var addedStyles = {};
- var win = window;
- var files = {};
- var counter = 0;
- var stdMode = true;
- var boxModel = true;
- var styleSheetLoader = StyleSheetLoader(doc);
- var boundEvents = [];
- var schema = settings.schema ? settings.schema : Schema({});
- var styles = Styles({
- url_converter: settings.url_converter,
- url_converter_scope: settings.url_converter_scope
- }, settings.schema);
- var events = settings.ownEvents ? new EventUtils(settings.proxy) : EventUtils.Event;
- var blockElementsMap = schema.getBlockElements();
- var $ = DomQuery.overrideDefaults(function () {
- return {
- context: doc,
- element: self$$1.getRoot()
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- var isBlock = function (node) {
- if (typeof node === 'string') {
- return !!blockElementsMap[node];
- } else if (node) {
- var type = node.nodeType;
- if (type) {
- return !!(type === 1 && blockElementsMap[node.nodeName]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var load = function (name, addOnUrl, success, scope, failure) {
+ if (urls[name]) {
+ 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 false;
- };
- var get = function (elm) {
- if (elm && doc && typeof elm === 'string') {
- var node = doc.getElementById(elm);
- if (node && node.id !== elm) {
- return doc.getElementsByName(elm)[1];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var urlString = typeof addOnUrl === 'string' ? addOnUrl : addOnUrl.prefix + addOnUrl.resource + addOnUrl.suffix;
+ if (urlString.indexOf('/') !== 0 && urlString.indexOf('://') === -1) {
+ urlString = AddOnManager.baseURL + '/' + urlString;
+ }
+ urls[name] = urlString.substring(0, urlString.lastIndexOf('/'));
+ if (lookup[name]) {
+ loadDependencies(name, addOnUrl, success, scope);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ScriptLoader.ScriptLoader.add(urlString, function () {
+ return loadDependencies(name, addOnUrl, success, scope);
+ }, scope, failure);
</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 elm;
- };
- var $$ = function (elm) {
- if (typeof elm === 'string') {
- elm = get(elm);
- }
- return $(elm);
- };
- var getAttrib = function (elm, name$$1, defaultVal) {
- var hook, value;
- var $elm = $$(elm);
- if ($elm.length) {
- hook = attrHooks[name$$1];
- if (hook && hook.get) {
- value = hook.get($elm, name$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var waitFor = function (name, callback) {
+ if (lookup.hasOwnProperty(name)) {
+ callback();
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- value = $elm.attr(name$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _listeners.push({
+ name: name,
+ callback: 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">- }
- if (typeof value === 'undefined') {
- value = defaultVal || '';
- }
- return value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ return {
+ items: items,
+ urls: urls,
+ lookup: lookup,
+ _listeners: _listeners,
+ get: get,
+ dependencies: dependencies,
+ requireLangPack: requireLangPack,
+ add: add,
+ remove: remove,
+ createUrl: createUrl,
+ addComponents: addComponents,
+ load: load,
+ waitFor: waitFor
+ };
+ }
+ (function (AddOnManager) {
+ AddOnManager.PluginManager = AddOnManager();
+ AddOnManager.ThemeManager = AddOnManager();
+ }(AddOnManager || (AddOnManager = {})));
+
+ var before = function (marker, element) {
+ var parent$$1 = parent(marker);
+ parent$$1.each(function (v) {
+ v.dom().insertBefore(element.dom(), marker.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 getAttribs = function (elm) {
- var node = get(elm);
- if (!node) {
- return [];
- }
- return node.attributes;
- };
- var setAttrib = function (elm, name$$1, value) {
- var originalValue, hook;
- if (value === '') {
- value = null;
- }
- var $elm = $$(elm);
- originalValue = $elm.attr(name$$1);
- if (!$elm.length) {
- return;
- }
- hook = attrHooks[name$$1];
- if (hook && hook.set) {
- hook.set($elm, value, name$$1);
- } else {
- $elm.attr(name$$1, value);
- }
- if (originalValue !== value && settings.onSetAttrib) {
- settings.onSetAttrib({
- attrElm: $elm,
- attrName: name$$1,
- attrValue: value
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var after = function (marker, element) {
+ var sibling = nextSibling(marker);
+ sibling.fold(function () {
+ var parent$$1 = parent(marker);
+ parent$$1.each(function (v) {
+ append(v, element);
</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">+ }, function (v) {
+ before(v, element);
+ });
</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 clone = function (node, deep) {
- if (!isIE || node.nodeType !== 1 || deep) {
- return node.cloneNode(deep);
- }
- if (!deep) {
- var clone_1 = doc.createElement(node.nodeName);
- each$5(getAttribs(node), function (attr) {
- setAttrib(clone_1, attr.nodeName, getAttrib(node, attr.nodeName));
- });
- return clone_1;
- }
- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var prepend = function (parent$$1, element) {
+ var firstChild$$1 = firstChild(parent$$1);
+ firstChild$$1.fold(function () {
+ append(parent$$1, element);
+ }, function (v) {
+ parent$$1.dom().insertBefore(element.dom(), v.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 getRoot = function () {
- return settings.root_element || doc.body;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var append = function (parent$$1, element) {
+ parent$$1.dom().appendChild(element.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 getViewPort = function (argWin) {
- var actWin = !argWin ? win : argWin;
- var doc = actWin.document;
- var rootElm = boxModel ? doc.documentElement : doc.body;
- return {
- x: actWin.pageXOffset || rootElm.scrollLeft,
- y: actWin.pageYOffset || rootElm.scrollTop,
- w: actWin.innerWidth || rootElm.clientWidth,
- h: actWin.innerHeight || rootElm.clientHeight
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var wrap$1 = function (element, wrapper) {
+ before(element, wrapper);
+ append(wrapper, element);
</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 getPos = function (elm, rootElm) {
- return $_3h7c3wnjjgwe7jl.getPos(doc.body, get(elm), rootElm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var before$1 = function (marker, elements) {
+ each(elements, function (x) {
+ before(marker, x);
+ });
</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 setStyle = function (elm, name$$1, value) {
- var $elm = $$(elm).css(name$$1, value);
- if (settings.update_styles) {
- updateInternalStyleAttr(styles, $elm);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var append$1 = function (parent, elements) {
+ each(elements, function (x) {
+ append(parent, x);
+ });
</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 setStyles = function (elm, stylesArg) {
- var $elm = $$(elm).css(stylesArg);
- if (settings.update_styles) {
- updateInternalStyleAttr(styles, $elm);
- }
- };
- var getStyle = function (elm, name$$1, computed) {
- var $elm = $$(elm);
- if (computed) {
- return $elm.css(name$$1);
- }
- name$$1 = name$$1.replace(/-(\D)/g, function (a, b) {
- return b.toUpperCase();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var empty = function (element) {
+ element.dom().textContent = '';
+ each(children(element), function (rogue) {
+ remove$2(rogue);
</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$$1 === 'float') {
- name$$1 = $_bcvfv9ajjgwe79v.ie && $_bcvfv9ajjgwe79v.ie < 12 ? 'styleFloat' : 'cssFloat';
- }
- return $elm[0] && $elm[0].style ? $elm[0].style[name$$1] : undefined;
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var getSize = function (elm) {
- var w, h;
- elm = get(elm);
- w = getStyle(elm, 'width');
- h = getStyle(elm, 'height');
- if (w.indexOf('px') === -1) {
- w = 0;
- }
- if (h.indexOf('px') === -1) {
- h = 0;
- }
- return {
- w: parseInt(w, 10) || elm.offsetWidth || elm.clientWidth,
- h: parseInt(h, 10) || elm.offsetHeight || elm.clientHeight
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var remove$2 = function (element) {
+ var dom = element.dom();
+ if (dom.parentNode !== null)
+ dom.parentNode.removeChild(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 getRect = function (elm) {
- var pos, size;
- elm = get(elm);
- pos = getPos(elm);
- size = getSize(elm);
- return {
- x: pos.x,
- y: pos.y,
- w: size.w,
- h: size.h
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var unwrap = function (wrapper) {
+ var children$$1 = children(wrapper);
+ if (children$$1.length > 0)
+ before$1(wrapper, children$$1);
+ remove$2(wrapper);
</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 is = function (elm, selector) {
- var i;
- if (!elm) {
- return false;
- }
- if (!Array.isArray(elm)) {
- if (selector === '*') {
- return elm.nodeType === 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var first$1 = function (fn, rate) {
+ var timer = null;
+ var cancel = function () {
+ if (timer !== null) {
+ clearTimeout(timer);
+ timer = 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 (simpleSelectorRe.test(selector)) {
- var selectors = selector.toLowerCase().split(/,/);
- var elmName = elm.nodeName.toLowerCase();
- for (i = selectors.length - 1; i >= 0; i--) {
- if (selectors[i] === elmName) {
- return true;
- }
- }
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var throttle = function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_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 (elm.nodeType && elm.nodeType !== 1) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (timer === null) {
+ timer = setTimeout(function () {
+ fn.apply(null, args);
+ timer = null;
+ }, rate);
</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 elms = !Array.isArray(elm) ? [elm] : elm;
- return Sizzle(selector, elms[0].ownerDocument || elms[0], null, elms).length > 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ return {
+ cancel: cancel,
+ throttle: throttle
+ };
</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 getParents = function (elm, selector, root, collect) {
- var result = [];
- var selectorVal;
- var node = get(elm);
- collect = collect === undefined;
- root = root || (getRoot().nodeName !== 'BODY' ? getRoot().parentNode : null);
- if ($_6cwiepljjgwe7j4.is(selector, 'string')) {
- selectorVal = selector;
- if (selector === '*') {
- selector = function (node) {
- return node.nodeType === 1;
- };
- } else {
- selector = function (node) {
- return is(node, selectorVal);
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var last$3 = function (fn, rate) {
+ var timer = null;
+ var cancel = function () {
+ if (timer !== null) {
+ clearTimeout(timer);
+ timer = 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">- }
- while (node) {
- if (node === root || !node.nodeType || node.nodeType === 9) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var throttle = function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_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 (!selector || typeof selector === 'function' && selector(node)) {
- if (collect) {
- result.push(node);
- } else {
- return [node];
- }
- }
- node = node.parentNode;
- }
- return collect ? result : null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (timer !== null)
+ clearTimeout(timer);
+ timer = setTimeout(function () {
+ fn.apply(null, args);
+ timer = null;
+ }, rate);
+ };
+ return {
+ cancel: cancel,
+ throttle: throttle
+ };
</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 getParent = function (node, selector, root) {
- var parents = getParents(node, selector, root, false);
- return parents && parents.length > 0 ? parents[0] : null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var Cell = function (initial) {
+ var value = initial;
+ var get = function () {
+ return value;
+ };
+ var set = function (v) {
+ value = v;
+ };
+ var clone = function () {
+ return Cell(get());
+ };
+ return {
+ get: get,
+ set: set,
+ clone: clone
+ };
</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 _findSib = function (node, selector, name$$1) {
- var func = selector;
- if (node) {
- if (typeof selector === 'string') {
- func = function (node) {
- return is(node, selector);
- };
- }
- for (node = node[name$$1]; node; node = node[name$$1]) {
- if (typeof func === 'function' && func(node)) {
- return node;
- }
- }
- }
- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var read = function (element, attr) {
+ var value = get$1(element, attr);
+ return value === undefined || value === '' ? [] : value.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 getNext = function (node, selector) {
- return _findSib(node, selector, 'nextSibling');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var add = function (element, attr, id) {
+ var old = read(element, attr);
+ var nu = old.concat([id]);
+ set(element, attr, nu.join(' '));
+ 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">- var getPrev = function (node, selector) {
- return _findSib(node, selector, 'previousSibling');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var remove$3 = function (element, attr, id) {
+ var nu = filter(read(element, attr), function (v) {
+ return v !== id;
+ });
+ if (nu.length > 0)
+ set(element, attr, nu.join(' '));
+ else
+ remove(element, attr);
+ 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 select = function (selector, scope) {
- return Sizzle(selector, get(scope) || settings.root_element || doc, []);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var supports = function (element) {
+ return element.dom().classList !== undefined;
</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 run = function (elm, func, scope) {
- var result;
- var node = typeof elm === 'string' ? get(elm) : elm;
- if (!node) {
- return false;
- }
- if ($_6cwiepljjgwe7j4.isArray(node) && (node.length || node.length === 0)) {
- result = [];
- each$5(node, function (elm, i) {
- if (elm) {
- if (typeof elm === 'string') {
- elm = get(elm);
- }
- result.push(func.call(scope, elm, i));
- }
- });
- return result;
- }
- var context = scope ? scope : _this;
- return func.call(context, node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var get$3 = function (element) {
+ return read(element, '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">- var setAttribs = function (elm, attrs) {
- $$(elm).each(function (i, node) {
- each$5(attrs, function (value, name$$1) {
- setAttrib(node, name$$1, value);
- });
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var add$1 = function (element, clazz) {
+ return add(element, 'class', clazz);
</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 setHTML = function (elm, html) {
- var $elm = $$(elm);
- if (isIE) {
- $elm.each(function (i, target) {
- if (target.canHaveHTML === false) {
- return;
- }
- while (target.firstChild) {
- target.removeChild(target.firstChild);
- }
- try {
- target.innerHTML = '<br>' + html;
- target.removeChild(target.firstChild);
- } catch (ex) {
- DomQuery('<div></div>').html('<br>' + html).contents().slice(1).appendTo(target);
- }
- return html;
- });
- } else {
- $elm.html(html);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var remove$4 = function (element, clazz) {
+ return remove$3(element, 'class', clazz);
+ };
+
+ var add$2 = function (element, clazz) {
+ if (supports(element))
+ element.dom().classList.add(clazz);
+ else
+ add$1(element, clazz);
+ };
+ var cleanClass = function (element) {
+ var classList = supports(element) ? element.dom().classList : get$3(element);
+ if (classList.length === 0) {
+ remove(element, 'class');
</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">- var add = function (parentElm, name$$1, attrs, html, create) {
- return run(parentElm, function (parentElm) {
- var newElm = typeof name$$1 === 'string' ? doc.createElement(name$$1) : name$$1;
- setAttribs(newElm, attrs);
- if (html) {
- if (typeof html !== 'string' && html.nodeType) {
- newElm.appendChild(html);
- } else if (typeof html === 'string') {
- setHTML(newElm, html);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var remove$5 = function (element, clazz) {
+ if (supports(element)) {
+ var classList = element.dom().classList;
+ classList.remove(clazz);
+ } else
+ remove$4(element, clazz);
+ cleanClass(element);
+ };
+ var has$2 = function (element, clazz) {
+ return supports(element) && element.dom().classList.contains(clazz);
+ };
+
+ var descendants = function (scope, predicate) {
+ var result = [];
+ each(children(scope), function (x) {
+ if (predicate(x)) {
+ result = result.concat([x]);
</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 !create ? parentElm.appendChild(newElm) : newElm;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ result = result.concat(descendants(x, predicate));
</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 result;
</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 create = function (name$$1, attrs, html) {
- return add(doc.createElement(name$$1), name$$1, attrs, html, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var descendants$1 = function (scope, selector) {
+ return all(selector, scope);
</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 decode = $_6pqr9q1sjjgwe7qj.decode;
- var encode = $_6pqr9q1sjjgwe7qj.encodeAllRaw;
- var createHTML = function (name$$1, attrs, html) {
- var outHtml = '', key;
- outHtml += '<' + name$$1;
- for (key in attrs) {
- if (attrs.hasOwnProperty(key) && attrs[key] !== null && typeof attrs[key] !== 'undefined') {
- outHtml += ' ' + key + '="' + encode(attrs[key]) + '"';
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ function ClosestOrAncestor (is, ancestor, scope, a, isRoot) {
+ return is(scope, a) ? Option.some(scope) : isFunction(isRoot) && isRoot(scope) ? Option.none() : ancestor(scope, a, isRoot);
+ }
+
+ var ancestor = function (scope, predicate, isRoot) {
+ var element = scope.dom();
+ var stop = isFunction(isRoot) ? isRoot : constant(false);
+ while (element.parentNode) {
+ element = element.parentNode;
+ var el = Element$$1.fromDom(element);
+ if (predicate(el))
+ return Option.some(el);
+ else if (stop(el))
+ 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">- if (typeof html !== 'undefined') {
- return outHtml + '>' + html + '</' + name$$1 + '>';
- }
- return outHtml + ' />';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Option.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 createFragment = function (html) {
- var node;
- var container = doc.createElement('div');
- var frag = doc.createDocumentFragment();
- if (html) {
- container.innerHTML = html;
- }
- while (node = container.firstChild) {
- frag.appendChild(node);
- }
- return frag;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var closest = function (scope, predicate, isRoot) {
+ var is = function (scope) {
+ return predicate(scope);
+ };
+ return ClosestOrAncestor(is, ancestor, scope, predicate, isRoot);
</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 remove = function (node, keepChildren) {
- var $node = $$(node);
- if (keepChildren) {
- $node.each(function () {
- var child;
- while (child = this.firstChild) {
- if (child.nodeType === 3 && child.data.length === 0) {
- this.removeChild(child);
- } else {
- this.parentNode.insertBefore(child, this);
- }
- }
- }).remove();
- } else {
- $node.remove();
- }
- return $node.length > 1 ? $node.toArray() : $node[0];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var ancestor$1 = function (scope, selector, isRoot) {
+ return ancestor(scope, function (e) {
+ return is$1(e, selector);
+ }, isRoot);
</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 removeAllAttribs = function (e) {
- return run(e, function (e) {
- var i;
- var attrs = e.attributes;
- for (i = attrs.length - 1; i >= 0; i--) {
- e.removeAttributeNode(attrs.item(i));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var descendant$1 = function (scope, selector) {
+ return one(selector, scope);
+ };
+ var closest$1 = function (scope, selector, isRoot) {
+ return ClosestOrAncestor(is$1, ancestor$1, scope, selector, isRoot);
+ };
+
+ var annotation = constant('mce-annotation');
+ var dataAnnotation = constant('data-mce-annotation');
+ var dataAnnotationId = constant('data-mce-annotation-uid');
+
+ var identify = function (editor, annotationName) {
+ var rng = editor.selection.getRng();
+ var start = Element$$1.fromDom(rng.startContainer);
+ var root = Element$$1.fromDom(editor.getBody());
+ var selector = annotationName.fold(function () {
+ return '.' + annotation();
+ }, function (an) {
+ return '[' + dataAnnotation() + '="' + an + '"]';
+ });
+ var newStart = child(start, rng.startOffset).getOr(start);
+ var closest = closest$1(newStart, selector, function (n) {
+ return eq(n, root);
+ });
+ var getAttr = function (c, property) {
+ if (has$1(c, property)) {
+ return Option.some(get$1(c, property));
+ } else {
+ return Option.none();
</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 closest.bind(function (c) {
+ return getAttr(c, '' + dataAnnotationId()).bind(function (uid) {
+ return getAttr(c, '' + dataAnnotation()).map(function (name$$1) {
+ var elements = findMarkers(editor, uid);
+ return {
+ uid: uid,
+ name: name$$1,
+ elements: elements
+ };
+ });
+ });
</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">- var parseStyle = function (cssText) {
- return styles.parse(cssText);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isAnnotation = function (elem) {
+ return isElement(elem) && has$2(elem, annotation());
</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 serializeStyle = function (stylesArg, name$$1) {
- return styles.serialize(stylesArg, name$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var findMarkers = function (editor, uid) {
+ var body = Element$$1.fromDom(editor.getBody());
+ return descendants$1(body, '[' + dataAnnotationId() + '="' + uid + '"]');
</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 addStyle = function (cssText) {
- var head, styleElm;
- if (self$$1 !== DOMUtils.DOM && doc === document) {
- if (addedStyles[cssText]) {
- return;
- }
- addedStyles[cssText] = true;
- }
- styleElm = doc.getElementById('mceDefaultStyles');
- if (!styleElm) {
- styleElm = doc.createElement('style');
- styleElm.id = 'mceDefaultStyles';
- styleElm.type = 'text/css';
- head = doc.getElementsByTagName('head')[0];
- if (head.firstChild) {
- head.insertBefore(styleElm, head.firstChild);
- } else {
- head.appendChild(styleElm);
- }
- }
- if (styleElm.styleSheet) {
- styleElm.styleSheet.cssText += cssText;
- } else {
- styleElm.appendChild(doc.createTextNode(cssText));
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var findAll = function (editor, name$$1) {
+ var body = Element$$1.fromDom(editor.getBody());
+ var markers = descendants$1(body, '[' + dataAnnotation() + '="' + name$$1 + '"]');
+ var directory = {};
+ each(markers, function (m) {
+ var uid = get$1(m, dataAnnotationId());
+ var nodesAlready = directory.hasOwnProperty(uid) ? directory[uid] : [];
+ directory[uid] = nodesAlready.concat([m]);
+ });
+ return directory;
</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 loadCSS = function (url) {
- var head;
- if (self$$1 !== DOMUtils.DOM && doc === document) {
- DOMUtils.DOM.loadCSS(url);
- return;
- }
- if (!url) {
- url = '';
- }
- head = doc.getElementsByTagName('head')[0];
- each$5(url.split(','), function (url) {
- var link;
- url = $_6cwiepljjgwe7j4._addCacheSuffix(url);
- if (files[url]) {
- return;
- }
- files[url] = true;
- link = create('link', {
- rel: 'stylesheet',
- href: url
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var setup = function (editor, registry) {
+ var changeCallbacks = Cell({});
+ var initData = function () {
+ return {
+ listeners: [],
+ previous: Cell(Option.none())
+ };
+ };
+ var withCallbacks = function (name, f) {
+ updateCallbacks(name, function (data) {
+ f(data);
+ return 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">- head.appendChild(link);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var updateCallbacks = function (name, f) {
+ var callbackMap = changeCallbacks.get();
+ var data = callbackMap.hasOwnProperty(name) ? callbackMap[name] : initData();
+ var outputData = f(data);
+ callbackMap[name] = outputData;
+ changeCallbacks.set(callbackMap);
+ };
+ var fireCallbacks = function (name, uid, elements) {
+ withCallbacks(name, function (data) {
+ each(data.listeners, function (f) {
+ return f(true, name, {
+ uid: uid,
+ nodes: map(elements, function (elem) {
+ return elem.dom();
+ })
+ });
+ });
+ });
+ };
+ var fireNoAnnotation = function (name) {
+ withCallbacks(name, function (data) {
+ each(data.listeners, function (f) {
+ return f(false, name);
+ });
+ });
+ };
+ var onNodeChange = last$3(function () {
+ var callbackMap = changeCallbacks.get();
+ var annotations = sort(keys(callbackMap));
+ each(annotations, function (name) {
+ updateCallbacks(name, function (data) {
+ var prev = data.previous.get();
+ identify(editor, Option.some(name)).fold(function () {
+ if (prev.isSome()) {
+ fireNoAnnotation(name);
+ data.previous.set(Option.none());
+ }
+ }, function (_a) {
+ var uid = _a.uid, name = _a.name, elements = _a.elements;
+ if (!prev.is(uid)) {
+ fireCallbacks(name, uid, elements);
+ data.previous.set(Option.some(uid));
+ }
+ });
+ return {
+ previous: data.previous,
+ listeners: data.listeners
+ };
+ });
+ });
+ }, 30);
+ editor.on('remove', function () {
+ onNodeChange.cancel();
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('nodeChange', function () {
+ onNodeChange.throttle();
+ });
+ var addListener = function (name, f) {
+ updateCallbacks(name, function (data) {
+ return {
+ previous: data.previous,
+ listeners: data.listeners.concat([f])
+ };
+ });
+ };
+ return { addListener: addListener };
</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 toggleClass = function (elm, cls, state) {
- $$(elm).toggleClass(cls, state).each(function () {
- if (this.className === '') {
- DomQuery(this).attr('class', null);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var setup$1 = function (editor, registry) {
+ var identifyParserNode = function (span) {
+ var optAnnotation = Option.from(span.attributes.map[dataAnnotation()]);
+ return optAnnotation.bind(registry.lookup);
+ };
+ editor.on('init', function () {
+ editor.serializer.addNodeFilter('span', function (spans) {
+ each(spans, function (span) {
+ identifyParserNode(span).each(function (settings) {
+ if (settings.persistent === false) {
+ span.unwrap();
+ }
+ });
+ });
+ });
</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">- var addClass = function (elm, cls) {
- $$(elm).addClass(cls);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var create$1 = function () {
+ var annotations = {};
+ var register = function (name, settings) {
+ annotations[name] = {
+ name: name,
+ settings: settings
+ };
+ };
+ var lookup = function (name) {
+ return annotations.hasOwnProperty(name) ? Option.from(annotations[name]).map(function (a) {
+ return a.settings;
+ }) : Option.none();
+ };
+ return {
+ register: register,
+ lookup: lookup
+ };
</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 removeClass = function (elm, cls) {
- toggleClass(elm, cls, false);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ function __rest(s, e) {
+ var t = {};
+ for (var p in s)
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
+ t[p] = s[p];
+ if (s != null && typeof Object.getOwnPropertySymbols === 'function')
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
+ if (e.indexOf(p[i]) < 0)
+ t[p[i]] = s[p[i]];
+ return t;
+ }
+
+ var unique = 0;
+ var generate = function (prefix) {
+ var date = new Date();
+ var time = date.getTime();
+ var random = Math.floor(Math.random() * 1000000000);
+ unique++;
+ return prefix + '_' + random + unique + String(time);
</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 hasClass = function (elm, cls) {
- return $$(elm).hasClass(cls);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var add$3 = function (element, classes) {
+ each(classes, function (x) {
+ add$2(element, x);
+ });
</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 show = function (elm) {
- $$(elm).show();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var clone$1 = function (original, deep) {
+ return Element$$1.fromDom(original.dom().cloneNode(deep));
</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 hide = function (elm) {
- $$(elm).hide();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var shallow = function (original) {
+ return clone$1(original, 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 isHidden = function (elm) {
- return $$(elm).css('display') === 'none';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var deep = function (original) {
+ return clone$1(original, 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">- var uniqueId = function (prefix) {
- return (!prefix ? 'mce_' : prefix) + counter++;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var fromHtml$1 = function (html, scope) {
+ var doc = scope || document;
+ var div = doc.createElement('div');
+ div.innerHTML = html;
+ return children(Element$$1.fromDom(div));
</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 getOuterHTML = function (elm) {
- var node = typeof elm === 'string' ? get(elm) : elm;
- return $_3b9u2y1rjjgwe7qe.isElement(node) ? node.outerHTML : DomQuery('<div></div>').append(DomQuery(node).clone()).html();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var get$5 = function (element) {
+ return element.dom().innerHTML;
</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 setOuterHTML = function (elm, html) {
- $$(elm).each(function () {
- try {
- if ('outerHTML' in this) {
- this.outerHTML = html;
- return;
- }
- } catch (ex) {
- }
- remove(DomQuery(this).html(html), true);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var set$2 = function (element, content) {
+ var owner$$1 = owner(element);
+ var docDom = owner$$1.dom();
+ var fragment = Element$$1.fromDom(docDom.createDocumentFragment());
+ var contentElements = fromHtml$1(content, docDom);
+ append$1(fragment, contentElements);
+ empty(element);
+ append(element, fragment);
</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 insertAfter = function (node, reference) {
- var referenceNode = get(reference);
- return run(node, function (node) {
- var parent$$1, nextSibling;
- parent$$1 = referenceNode.parentNode;
- nextSibling = referenceNode.nextSibling;
- if (nextSibling) {
- parent$$1.insertBefore(node, nextSibling);
- } else {
- parent$$1.appendChild(node);
- }
- return node;
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var ZWSP = '\uFEFF';
+ var isZwsp = function (chr) {
+ return chr === ZWSP;
</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 replace = function (newElm, oldElm, keepChildren) {
- return run(oldElm, function (oldElm) {
- if ($_6cwiepljjgwe7j4.is(oldElm, 'array')) {
- newElm = newElm.cloneNode(true);
- }
- if (keepChildren) {
- each$5(grep$1(oldElm.childNodes), function (node) {
- newElm.appendChild(node);
- });
- }
- return oldElm.parentNode.replaceChild(newElm, oldElm);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var trim$3 = function (text) {
+ return text.replace(new RegExp(ZWSP, 'g'), '');
</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 rename = function (elm, name$$1) {
- var newElm;
- if (elm.nodeName !== name$$1.toUpperCase()) {
- newElm = create(name$$1);
- each$5(getAttribs(elm), function (attrNode) {
- setAttrib(newElm, attrNode.nodeName, getAttrib(elm, attrNode.nodeName));
- });
- replace(newElm, elm, true);
- }
- return newElm || elm;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Zwsp = {
+ isZwsp: isZwsp,
+ ZWSP: ZWSP,
+ trim: trim$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 findCommonAncestor = function (a, b) {
- var ps = a, pe;
- while (ps) {
- pe = b;
- while (pe && ps !== pe) {
- pe = pe.parentNode;
- }
- if (ps === pe) {
- break;
- }
- ps = ps.parentNode;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var isElement$2 = NodeType.isElement;
+ var isText$2 = NodeType.isText;
+ var isCaretContainerBlock = function (node) {
+ if (isText$2(node)) {
+ 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">- if (!ps && a.ownerDocument) {
- return a.ownerDocument.documentElement;
- }
- return ps;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return isElement$2(node) && node.hasAttribute('data-mce-caret');
</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 toHex = function (rgbVal) {
- return styles.toHex($_6cwiepljjgwe7j4.trim(rgbVal));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isCaretContainerInline = function (node) {
+ return isText$2(node) && Zwsp.isZwsp(node.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">- var isEmpty = function (node, elements) {
- var i, attributes, type, whitespace, walker, name$$1, brCount = 0;
- node = node.firstChild;
- if (node) {
- walker = new TreeWalker(node, node.parentNode);
- elements = elements || (schema ? schema.getNonEmptyElements() : null);
- whitespace = schema ? schema.getWhiteSpaceElements() : {};
- do {
- type = node.nodeType;
- if ($_3b9u2y1rjjgwe7qe.isElement(node)) {
- var bogusVal = node.getAttribute('data-mce-bogus');
- if (bogusVal) {
- node = walker.next(bogusVal === 'all');
- continue;
- }
- name$$1 = node.nodeName.toLowerCase();
- if (elements && elements[name$$1]) {
- if (name$$1 === 'br') {
- brCount++;
- node = walker.next();
- continue;
- }
- return false;
- }
- attributes = getAttribs(node);
- i = attributes.length;
- while (i--) {
- name$$1 = attributes[i].nodeName;
- if (name$$1 === 'name' || name$$1 === 'data-mce-bookmark') {
- return false;
- }
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isCaretContainer = function (node) {
+ return isCaretContainerBlock(node) || isCaretContainerInline(node);
+ };
+ var hasContent = function (node) {
+ return node.firstChild !== node.lastChild || !NodeType.isBr(node.firstChild);
+ };
+ var insertInline = function (node, before) {
+ var doc, sibling, textNode, parentNode;
+ doc = node.ownerDocument;
+ textNode = doc.createTextNode(Zwsp.ZWSP);
+ parentNode = node.parentNode;
+ if (!before) {
+ sibling = node.nextSibling;
+ if (isText$2(sibling)) {
+ if (isCaretContainer(sibling)) {
+ return 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">- if (type === 8) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (startsWithCaretContainer(sibling)) {
+ sibling.splitText(1);
+ return 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">- if (type === 3 && !whiteSpaceRegExp$2.test(node.nodeValue)) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (node.nextSibling) {
+ parentNode.insertBefore(textNode, node.nextSibling);
+ } else {
+ parentNode.appendChild(textNode);
+ }
+ } else {
+ sibling = node.previousSibling;
+ if (isText$2(sibling)) {
+ if (isCaretContainer(sibling)) {
+ return 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">- if (type === 3 && node.parentNode && whitespace[node.parentNode.nodeName] && whiteSpaceRegExp$2.test(node.nodeValue)) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (endsWithCaretContainer(sibling)) {
+ return sibling.splitText(sibling.data.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">- node = walker.next();
- } while (node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ parentNode.insertBefore(textNode, 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 brCount <= 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return textNode;
</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 createRng = function () {
- return doc.createRange();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isBeforeInline = function (pos) {
+ var container = pos.container();
+ return pos && NodeType.isText(container) && container.data.charAt(pos.offset()) === Zwsp.ZWSP;
</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 split = function (parentElm, splitElm, replacementElm) {
- var r = createRng(), bef, aft, pa;
- if (parentElm && splitElm) {
- r.setStart(parentElm.parentNode, findNodeIndex(parentElm));
- r.setEnd(splitElm.parentNode, findNodeIndex(splitElm));
- bef = r.extractContents();
- r = createRng();
- r.setStart(splitElm.parentNode, findNodeIndex(splitElm) + 1);
- r.setEnd(parentElm.parentNode, findNodeIndex(parentElm) + 1);
- aft = r.extractContents();
- pa = parentElm.parentNode;
- pa.insertBefore($_cu5wx21pjjgwe7pz.trimNode(self$$1, bef), parentElm);
- if (replacementElm) {
- pa.insertBefore(replacementElm, parentElm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isAfterInline = function (pos) {
+ var container = pos.container();
+ return pos && NodeType.isText(container) && container.data.charAt(pos.offset() - 1) === Zwsp.ZWSP;
+ };
+ var createBogusBr = function () {
+ var br = document.createElement('br');
+ br.setAttribute('data-mce-bogus', '1');
+ return br;
+ };
+ var insertBlock = function (blockName, node, before) {
+ var doc, blockNode, parentNode;
+ doc = node.ownerDocument;
+ blockNode = doc.createElement(blockName);
+ blockNode.setAttribute('data-mce-caret', before ? 'before' : 'after');
+ blockNode.setAttribute('data-mce-bogus', 'all');
+ blockNode.appendChild(createBogusBr());
+ parentNode = node.parentNode;
+ if (!before) {
+ if (node.nextSibling) {
+ parentNode.insertBefore(blockNode, node.nextSibling);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- pa.insertBefore(splitElm, parentElm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parentNode.appendChild(blockNode);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- pa.insertBefore($_cu5wx21pjjgwe7pz.trimNode(self$$1, aft), parentElm);
- remove(parentElm);
- return replacementElm || splitElm;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ parentNode.insertBefore(blockNode, node);
</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 blockNode;
</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 bind = function (target, name$$1, func, scope) {
- if ($_6cwiepljjgwe7j4.isArray(target)) {
- var i = target.length;
- while (i--) {
- target[i] = bind(target[i], name$$1, func, scope);
- }
- return target;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var startsWithCaretContainer = function (node) {
+ return isText$2(node) && node.data[0] === Zwsp.ZWSP;
+ };
+ var endsWithCaretContainer = function (node) {
+ return isText$2(node) && node.data[node.data.length - 1] === Zwsp.ZWSP;
+ };
+ var trimBogusBr = function (elm) {
+ var brs = elm.getElementsByTagName('br');
+ var lastBr = brs[brs.length - 1];
+ if (NodeType.isBogus(lastBr)) {
+ lastBr.parentNode.removeChild(lastBr);
</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.collect && (target === doc || target === win)) {
- boundEvents.push([
- target,
- name$$1,
- func,
- scope
- ]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var showCaretContainerBlock = function (caretContainer) {
+ if (caretContainer && caretContainer.hasAttribute('data-mce-caret')) {
+ trimBogusBr(caretContainer);
+ caretContainer.removeAttribute('data-mce-caret');
+ caretContainer.removeAttribute('data-mce-bogus');
+ caretContainer.removeAttribute('style');
+ caretContainer.removeAttribute('_moz_abspos');
+ return caretContainer;
</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 events.bind(target, name$$1, func, scope || self$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- var unbind = function (target, name$$1, func) {
- var i;
- if ($_6cwiepljjgwe7j4.isArray(target)) {
- i = target.length;
- while (i--) {
- target[i] = unbind(target[i], name$$1, func);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isRangeInCaretContainerBlock = function (range) {
+ return isCaretContainerBlock(range.startContainer);
+ };
+
+ var isContentEditableTrue$1 = NodeType.isContentEditableTrue;
+ var isContentEditableFalse$1 = NodeType.isContentEditableFalse;
+ var isBr$2 = NodeType.isBr;
+ var isText$3 = NodeType.isText;
+ var isInvalidTextElement = NodeType.matchNodeNames('script style textarea');
+ var isAtomicInline = NodeType.matchNodeNames('img input textarea hr iframe video audio object');
+ var isTable$1 = NodeType.matchNodeNames('table');
+ var isCaretContainer$1 = isCaretContainer;
+ var isCaretCandidate = function (node) {
+ if (isCaretContainer$1(node)) {
+ return false;
+ }
+ if (isText$3(node)) {
+ if (isInvalidTextElement(node.parentNode)) {
+ 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 target;
</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 (boundEvents && (target === doc || target === win)) {
- i = boundEvents.length;
- while (i--) {
- var item = boundEvents[i];
- if (target === item[0] && (!name$$1 || name$$1 === item[1]) && (!func || func === item[2])) {
- events.unbind(item[0], item[1], item[2]);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return isAtomicInline(node) || isBr$2(node) || isTable$1(node) || isNonUiContentEditableFalse(node);
+ };
+ var isUnselectable = function (node) {
+ return NodeType.isElement(node) && node.getAttribute('unselectable') === 'true';
+ };
+ var isNonUiContentEditableFalse = function (node) {
+ return isUnselectable(node) === false && isContentEditableFalse$1(node);
+ };
+ var isInEditable = function (node, root) {
+ for (node = node.parentNode; node && node !== root; node = node.parentNode) {
+ if (isNonUiContentEditableFalse(node)) {
+ return false;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isContentEditableTrue$1(node)) {
+ 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 events.unbind(target, name$$1, func);
</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">- var fire = function (target, name$$1, evt) {
- return events.fire(target, name$$1, evt);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isAtomicContentEditableFalse = function (node) {
+ if (!isNonUiContentEditableFalse(node)) {
+ return false;
+ }
+ return foldl(from$1(node.getElementsByTagName('*')), function (result, elm) {
+ return result || isContentEditableTrue$1(elm);
+ }, false) !== 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">- var getContentEditable = function (node) {
- if (node && $_3b9u2y1rjjgwe7qe.isElement(node)) {
- var contentEditable = node.getAttribute('data-mce-contenteditable');
- if (contentEditable && contentEditable !== 'inherit') {
- return contentEditable;
- }
- return node.contentEditable !== 'inherit' ? node.contentEditable : null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isAtomic = function (node) {
+ return isAtomicInline(node) || isAtomicContentEditableFalse(node);
+ };
+ var isEditableCaretCandidate = function (node, root) {
+ return isCaretCandidate(node) && isInEditable(node, root);
+ };
+
+ var round = Math.round;
+ var clone$2 = function (rect) {
+ if (!rect) {
+ return {
+ left: 0,
+ top: 0,
+ bottom: 0,
+ right: 0,
+ width: 0,
+ height: 0
+ };
+ }
+ return {
+ left: round(rect.left),
+ top: round(rect.top),
+ bottom: round(rect.bottom),
+ right: round(rect.right),
+ width: round(rect.width),
+ height: round(rect.height)
+ };
+ };
+ var collapse = function (rect, toStart) {
+ rect = clone$2(rect);
+ if (toStart) {
+ rect.right = rect.left;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rect.left = rect.left + rect.width;
+ rect.right = rect.left;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rect.width = 0;
+ return rect;
</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 getContentEditableParent = function (node) {
- var root = getRoot();
- var state = null;
- for (; node && node !== root; node = node.parentNode) {
- state = getContentEditable(node);
- if (state !== null) {
- break;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isEqual = function (rect1, rect2) {
+ return rect1.left === rect2.left && rect1.top === rect2.top && rect1.bottom === rect2.bottom && rect1.right === rect2.right;
+ };
+ var isValidOverflow = function (overflowY, rect1, rect2) {
+ return overflowY >= 0 && overflowY <= Math.min(rect1.height, rect2.height) / 2;
+ };
+ var isAbove = function (rect1, rect2) {
+ if (rect1.bottom - rect1.height / 2 < rect2.top) {
+ 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 state;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rect1.top > rect2.bottom) {
+ return false;
+ }
+ return isValidOverflow(rect2.top - rect1.bottom, rect1, rect2);
</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 destroy = function () {
- if (boundEvents) {
- var i = boundEvents.length;
- while (i--) {
- var item = boundEvents[i];
- events.unbind(item[0], item[1], item[2]);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isBelow = function (rect1, rect2) {
+ if (rect1.top > rect2.bottom) {
+ 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 (Sizzle.setDocument) {
- Sizzle.setDocument();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rect1.bottom < rect2.top) {
+ return false;
</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 isValidOverflow(rect2.bottom - rect1.top, rect1, rect2);
</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 isChildOf = function (node, parent$$1) {
- while (node) {
- if (parent$$1 === node) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var containsXY = function (rect, clientX, clientY) {
+ return clientX >= rect.left && clientX <= rect.right && clientY >= rect.top && clientY <= rect.bottom;
+ };
+ var overflowX = function (outer, inner) {
+ if (inner.left > outer.left && inner.right < outer.right) {
+ return 0;
+ } else {
+ return inner.left < outer.left ? inner.left - outer.left : inner.right - outer.right;
+ }
+ };
+ var overflowY = function (outer, inner) {
+ if (inner.top > outer.top && inner.bottom < outer.bottom) {
+ return 0;
+ } else {
+ return inner.top < outer.top ? inner.top - outer.top : inner.bottom - outer.bottom;
+ }
+ };
+ var getOverflow = function (outer, inner) {
+ return {
+ x: overflowX(outer, inner),
+ y: overflowY(outer, inner)
+ };
+ };
+
+ var getSelectedNode = function (range) {
+ var startContainer = range.startContainer, startOffset = range.startOffset;
+ if (startContainer.hasChildNodes() && range.endOffset === startOffset + 1) {
+ return startContainer.childNodes[startOffset];
+ }
+ return null;
+ };
+ var getNode = function (container, offset) {
+ if (container.nodeType === 1 && container.hasChildNodes()) {
+ if (offset >= container.childNodes.length) {
+ 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">- node = node.parentNode;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ container = container.childNodes[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 false;
</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 dumpRng = function (r) {
- return 'startContainer: ' + r.startContainer.nodeName + ', startOffset: ' + r.startOffset + ', endContainer: ' + r.endContainer.nodeName + ', endOffset: ' + r.endOffset;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var extendingChars = new RegExp('[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a' + '\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0' + '\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08E3-\u0902\u093a\u093c' + '\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3' + '\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc' + '\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57' + '\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56' + '\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44' + '\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb
1\u0eb4-\u0eb9' + '\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97' + '\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074' + '\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5' + '\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18' + '\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1ABE\u1b00-\u1b03\u1b34' + '\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9' + '\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9' + '\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20DD-\u20E0\u20e1\u20E2-\u20E4\u20e5-\u20f0\u2cef-\u2cf1' + '\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\u
a66f\uA670-\uA672\ua674-\ua67d\uA69E-\ua69f\ua6f0-\ua6f1' + '\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc' + '\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1' + '\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\uFE2F\uff9e-\uff9f]');
+ var isExtendingChar = function (ch) {
+ return typeof ch === 'string' && ch.charCodeAt(0) >= 768 && extendingChars.test(ch);
</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 self$$1 = {
- doc: doc,
- settings: settings,
- win: win,
- files: files,
- stdMode: stdMode,
- boxModel: boxModel,
- styleSheetLoader: styleSheetLoader,
- boundEvents: boundEvents,
- styles: styles,
- schema: schema,
- events: events,
- isBlock: isBlock,
- $: $,
- $$: $$,
- root: null,
- clone: clone,
- getRoot: getRoot,
- getViewPort: getViewPort,
- getRect: getRect,
- getSize: getSize,
- getParent: getParent,
- getParents: getParents,
- get: get,
- getNext: getNext,
- getPrev: getPrev,
- select: select,
- is: is,
- add: add,
- create: create,
- createHTML: createHTML,
- createFragment: createFragment,
- remove: remove,
- setStyle: setStyle,
- getStyle: getStyle,
- setStyles: setStyles,
- removeAllAttribs: removeAllAttribs,
- setAttrib: setAttrib,
- setAttribs: setAttribs,
- getAttrib: getAttrib,
- getPos: getPos,
- parseStyle: parseStyle,
- serializeStyle: serializeStyle,
- addStyle: addStyle,
- loadCSS: loadCSS,
- addClass: addClass,
- removeClass: removeClass,
- hasClass: hasClass,
- toggleClass: toggleClass,
- show: show,
- hide: hide,
- isHidden: isHidden,
- uniqueId: uniqueId,
- setHTML: setHTML,
- getOuterHTML: getOuterHTML,
- setOuterHTML: setOuterHTML,
- decode: decode,
- encode: encode,
- insertAfter: insertAfter,
- replace: replace,
- rename: rename,
- findCommonAncestor: findCommonAncestor,
- toHex: toHex,
- run: run,
- getAttribs: getAttribs,
- isEmpty: isEmpty,
- createRng: createRng,
- nodeIndex: findNodeIndex,
- split: split,
- bind: bind,
- unbind: unbind,
- fire: fire,
- getContentEditable: getContentEditable,
- getContentEditableParent: getContentEditableParent,
- destroy: destroy,
- isChildOf: isChildOf,
- dumpRng: dumpRng
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var liftN = function (arr, f) {
+ var r = [];
+ for (var i = 0; i < arr.length; i++) {
+ var x = arr[i];
+ if (x.isSome()) {
+ r.push(x.getOrDie());
+ } else {
+ return Option.none();
+ }
+ }
+ return Option.some(f.apply(null, r));
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- attrHooks = setupAttrHooks(styles, settings, function () {
- return self$$1;
- });
- return self$$1;
- }
- (function (DOMUtils) {
- DOMUtils.DOM = DOMUtils(document);
- DOMUtils.nodeIndex = findNodeIndex;
- }(DOMUtils || (DOMUtils = {})));
- var DOMUtils$1 = DOMUtils;
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var DOM = DOMUtils$1.DOM;
- var each$6 = $_6cwiepljjgwe7j4.each;
- var grep$2 = $_6cwiepljjgwe7j4.grep;
- var isFunction$1 = function (f) {
- return typeof f === 'function';
- };
- var ScriptLoader = function () {
- var QUEUED = 0;
- var LOADING = 1;
- var LOADED = 2;
- var FAILED = 3;
- var states = {};
- var queue = [];
- var scriptLoadedCallbacks = {};
- var queueLoadedCallbacks = [];
- var loading = 0;
- var loadScript = function (url, success, failure) {
- var dom = DOM;
- var elm, id;
- var done = function () {
- dom.remove(id);
- if (elm) {
- elm.onreadystatechange = elm.onload = elm = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var slice$3 = [].slice;
+ var or = function () {
+ var x = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ x[_i] = arguments[_i];
+ }
+ var args = slice$3.call(arguments);
+ return function (x) {
+ for (var i = 0; i < args.length; i++) {
+ if (args[i](x)) {
+ 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">- success();
</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 error = function () {
- if (isFunction$1(failure)) {
- failure();
- } else {
- if (typeof console !== 'undefined' && console.log) {
- console.log('Failed to load script: ' + url);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var and = function () {
+ var x = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ x[_i] = arguments[_i];
+ }
+ var args = slice$3.call(arguments);
+ return function (x) {
+ for (var i = 0; i < args.length; i++) {
+ if (!args[i](x)) {
+ return false;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><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">- id = dom.uniqueId();
- elm = document.createElement('script');
- elm.id = id;
- elm.type = 'text/javascript';
- elm.src = $_6cwiepljjgwe7j4._addCacheSuffix(url);
- if ('onreadystatechange' in elm) {
- elm.onreadystatechange = function () {
- if (/loaded|complete/.test(elm.readyState)) {
- done();
- }
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var Predicate = {
+ and: and,
+ or: or
+ };
+
+ var isElement$3 = NodeType.isElement;
+ var isCaretCandidate$1 = isCaretCandidate;
+ var isBlock$1 = NodeType.matchStyleValues('display', 'block table');
+ var isFloated = NodeType.matchStyleValues('float', 'left right');
+ var isValidElementCaretCandidate = Predicate.and(isElement$3, isCaretCandidate$1, not(isFloated));
+ var isNotPre = not(NodeType.matchStyleValues('white-space', 'pre pre-line pre-wrap'));
+ var isText$4 = NodeType.isText;
+ var isBr$3 = NodeType.isBr;
+ var nodeIndex = DOMUtils$1.nodeIndex;
+ var resolveIndex = getNode;
+ var createRange = function (doc) {
+ return 'createRange' in doc ? doc.createRange() : DOMUtils$1.DOM.createRng();
+ };
+ var isWhiteSpace = function (chr) {
+ return chr && /[\r\n\t ]/.test(chr);
+ };
+ var isRange = function (rng) {
+ return !!rng.setStart && !!rng.setEnd;
+ };
+ var isHiddenWhiteSpaceRange = function (range$$1) {
+ var container = range$$1.startContainer;
+ var offset = range$$1.startOffset;
+ var text;
+ if (isWhiteSpace(range$$1.toString()) && isNotPre(container.parentNode) && NodeType.isText(container)) {
+ text = container.data;
+ if (isWhiteSpace(text[offset - 1]) || isWhiteSpace(text[offset + 1])) {
+ return true;
+ }
+ }
+ return false;
+ };
+ var getBrClientRect = function (brNode) {
+ var doc = brNode.ownerDocument;
+ var rng = createRange(doc);
+ var nbsp = doc.createTextNode('\xA0');
+ var parentNode = brNode.parentNode;
+ var clientRect;
+ parentNode.insertBefore(nbsp, brNode);
+ rng.setStart(nbsp, 0);
+ rng.setEnd(nbsp, 1);
+ clientRect = clone$2(rng.getBoundingClientRect());
+ parentNode.removeChild(nbsp);
+ return clientRect;
+ };
+ var getBoundingClientRectWebKitText = function (rng) {
+ var sc = rng.startContainer;
+ var ec = rng.endContainer;
+ var so = rng.startOffset;
+ var eo = rng.endOffset;
+ if (sc === ec && NodeType.isText(ec) && so === 0 && eo === 1) {
+ var newRng = rng.cloneRange();
+ newRng.setEndAfter(ec);
+ return getBoundingClientRect(newRng);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- elm.onload = done;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- elm.onerror = error;
- (document.getElementsByTagName('head')[0] || document.body).appendChild(elm);
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.isDone = function (url) {
- return states[url] === LOADED;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isZeroRect = function (r) {
+ return r.left === 0 && r.right === 0 && r.top === 0 && r.bottom === 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">- this.markDone = function (url) {
- states[url] = LOADED;
- };
- this.add = this.load = function (url, success, scope, failure) {
- var state = states[url];
- if (state === undefined) {
- queue.push(url);
- states[url] = QUEUED;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getBoundingClientRect = function (item) {
+ var clientRect, clientRects;
+ clientRects = item.getClientRects();
+ if (clientRects.length > 0) {
+ clientRect = clone$2(clientRects[0]);
+ } else {
+ clientRect = clone$2(item.getBoundingClientRect());
</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 (success) {
- if (!scriptLoadedCallbacks[url]) {
- scriptLoadedCallbacks[url] = [];
- }
- scriptLoadedCallbacks[url].push({
- success: success,
- failure: failure,
- scope: scope || this
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!isRange(item) && isBr$3(item) && isZeroRect(clientRect)) {
+ return getBrClientRect(item);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isZeroRect(clientRect) && isRange(item)) {
+ return getBoundingClientRectWebKitText(item);
+ }
+ return clientRect;
</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 (url) {
- delete states[url];
- delete scriptLoadedCallbacks[url];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var collapseAndInflateWidth = function (clientRect, toStart) {
+ var newClientRect = collapse(clientRect, toStart);
+ newClientRect.width = 1;
+ newClientRect.right = newClientRect.left + 1;
+ return newClientRect;
</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.loadQueue = function (success, scope, failure) {
- this.loadScripts(queue, success, scope, failure);
- };
- this.loadScripts = function (scripts, success, scope, failure) {
- var loadScripts;
- var failures = [];
- var execCallbacks = function (name$$1, url) {
- each$6(scriptLoadedCallbacks[url], function (callback) {
- if (isFunction$1(callback[name$$1])) {
- callback[name$$1].call(callback.scope);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getCaretPositionClientRects = function (caretPosition) {
+ var clientRects = [];
+ var beforeNode, node;
+ var addUniqueAndValidRect = function (clientRect) {
+ if (clientRect.height === 0) {
+ return;
+ }
+ if (clientRects.length > 0) {
+ if (isEqual(clientRect, clientRects[clientRects.length - 1])) {
+ 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">- });
- scriptLoadedCallbacks[url] = undefined;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ clientRects.push(clientRect);
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- queueLoadedCallbacks.push({
- success: success,
- failure: failure,
- scope: scope || this
- });
- loadScripts = function () {
- var loadingScripts = grep$2(scripts);
- scripts.length = 0;
- each$6(loadingScripts, function (url) {
- if (states[url] === LOADED) {
- execCallbacks('success', url);
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var addCharacterOffset = function (container, offset) {
+ var range$$1 = createRange(container.ownerDocument);
+ if (offset < container.data.length) {
+ if (isExtendingChar(container.data[offset])) {
+ return clientRects;
</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 (states[url] === FAILED) {
- execCallbacks('failure', url);
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isExtendingChar(container.data[offset - 1])) {
+ range$$1.setStart(container, offset);
+ range$$1.setEnd(container, offset + 1);
+ if (!isHiddenWhiteSpaceRange(range$$1)) {
+ addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(range$$1), false));
+ return clientRects;
+ }
</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 (states[url] !== LOADING) {
- states[url] = LOADING;
- loading++;
- loadScript(url, function () {
- states[url] = LOADED;
- loading--;
- execCallbacks('success', url);
- loadScripts();
- }, function () {
- states[url] = FAILED;
- loading--;
- failures.push(url);
- execCallbacks('failure', url);
- loadScripts();
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (offset > 0) {
+ range$$1.setStart(container, offset - 1);
+ range$$1.setEnd(container, offset);
+ if (!isHiddenWhiteSpaceRange(range$$1)) {
+ addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(range$$1), 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 (!loading) {
- var notifyCallbacks = queueLoadedCallbacks.slice(0);
- queueLoadedCallbacks.length = 0;
- each$6(notifyCallbacks, function (callback) {
- if (failures.length === 0) {
- if (isFunction$1(callback.success)) {
- callback.success.call(callback.scope);
- }
- } else {
- if (isFunction$1(callback.failure)) {
- callback.failure.call(callback.scope, failures);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (offset < container.data.length) {
+ range$$1.setStart(container, offset);
+ range$$1.setEnd(container, offset + 1);
+ if (!isHiddenWhiteSpaceRange(range$$1)) {
+ addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(range$$1), true));
+ }
+ }
+ };
+ if (isText$4(caretPosition.container())) {
+ addCharacterOffset(caretPosition.container(), caretPosition.offset());
+ return clientRects;
+ }
+ if (isElement$3(caretPosition.container())) {
+ if (caretPosition.isAtEnd()) {
+ node = resolveIndex(caretPosition.container(), caretPosition.offset());
+ if (isText$4(node)) {
+ addCharacterOffset(node, node.data.length);
+ }
+ if (isValidElementCaretCandidate(node) && !isBr$3(node)) {
+ addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(node), false));
+ }
+ } else {
+ node = resolveIndex(caretPosition.container(), caretPosition.offset());
+ if (isText$4(node)) {
+ addCharacterOffset(node, 0);
+ }
+ if (isValidElementCaretCandidate(node) && caretPosition.isAtEnd()) {
+ addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(node), false));
+ return clientRects;
+ }
+ beforeNode = resolveIndex(caretPosition.container(), caretPosition.offset() - 1);
+ if (isValidElementCaretCandidate(beforeNode) && !isBr$3(beforeNode)) {
+ if (isBlock$1(beforeNode) || isBlock$1(node) || !isValidElementCaretCandidate(node)) {
+ addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(beforeNode), 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">- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (isValidElementCaretCandidate(node)) {
+ addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(node), 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 clientRects;
+ };
+ function CaretPosition(container, offset, clientRects) {
+ var isAtStart = function () {
+ if (isText$4(container)) {
+ return offset === 0;
+ }
+ return 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">- loadScripts();
- };
- };
- ScriptLoader.ScriptLoader = new ScriptLoader();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isAtEnd = function () {
+ if (isText$4(container)) {
+ return offset >= container.data.length;
+ }
+ return offset >= container.childNodes.length;
+ };
+ var toRange = function () {
+ var range$$1;
+ range$$1 = createRange(container.ownerDocument);
+ range$$1.setStart(container, offset);
+ range$$1.setEnd(container, offset);
+ return range$$1;
+ };
+ var getClientRects = function () {
+ if (!clientRects) {
+ clientRects = getCaretPositionClientRects(CaretPosition(container, offset));
+ }
+ return clientRects;
+ };
+ var isVisible = function () {
+ return getClientRects().length > 0;
+ };
+ var isEqual$$1 = function (caretPosition) {
+ return caretPosition && container === caretPosition.container() && offset === caretPosition.offset();
+ };
+ var getNode$$1 = function (before) {
+ return resolveIndex(container, before ? offset - 1 : offset);
+ };
+ return {
+ container: constant(container),
+ offset: constant(offset),
+ toRange: toRange,
+ getClientRects: getClientRects,
+ isVisible: isVisible,
+ isAtStart: isAtStart,
+ isAtEnd: isAtEnd,
+ isEqual: isEqual$$1,
+ getNode: getNode$$1
+ };
+ }
+ (function (CaretPosition) {
+ CaretPosition.fromRangeStart = function (range$$1) {
+ return CaretPosition(range$$1.startContainer, range$$1.startOffset);
+ };
+ CaretPosition.fromRangeEnd = function (range$$1) {
+ return CaretPosition(range$$1.endContainer, range$$1.endOffset);
+ };
+ CaretPosition.after = function (node) {
+ return CaretPosition(node.parentNode, nodeIndex(node) + 1);
+ };
+ CaretPosition.before = function (node) {
+ return CaretPosition(node.parentNode, nodeIndex(node));
+ };
+ CaretPosition.isAbove = function (pos1, pos2) {
+ return liftN([
+ head(pos2.getClientRects()),
+ last(pos1.getClientRects())
+ ], isAbove).getOr(false);
+ };
+ CaretPosition.isBelow = function (pos1, pos2) {
+ return liftN([
+ last(pos2.getClientRects()),
+ head(pos1.getClientRects())
+ ], isBelow).getOr(false);
+ };
+ CaretPosition.isAtStart = function (pos) {
+ return pos ? pos.isAtStart() : false;
+ };
+ CaretPosition.isAtEnd = function (pos) {
+ return pos ? pos.isAtEnd() : false;
+ };
+ CaretPosition.isTextPosition = function (pos) {
+ return pos ? NodeType.isText(pos.container()) : false;
+ };
+ CaretPosition.isElementPosition = function (pos) {
+ return CaretPosition.isTextPosition(pos) === false;
+ };
+ }(CaretPosition || (CaretPosition = {})));
+ var CaretPosition$1 = CaretPosition;
</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 each$7 = $_6cwiepljjgwe7j4.each;
- function AddOnManager() {
- var _this = this;
- var items = [];
- var urls = {};
- var lookup = {};
- var _listeners = [];
- var get = function (name) {
- if (lookup[name]) {
- return lookup[name].instance;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isText$5 = NodeType.isText;
+ var isBogus$1 = NodeType.isBogus;
+ var nodeIndex$1 = DOMUtils$1.nodeIndex;
+ var normalizedParent = function (node) {
+ var parentNode = node.parentNode;
+ if (isBogus$1(parentNode)) {
+ return normalizedParent(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 undefined;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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 dependencies = function (name) {
- var result;
- if (lookup[name]) {
- result = lookup[name].dependencies;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getChildNodes = function (node) {
+ if (!node) {
+ 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 result || [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ArrUtils.reduce(node.childNodes, function (result, node) {
+ if (isBogus$1(node) && node.nodeName !== 'BR') {
+ result = result.concat(getChildNodes(node));
+ } else {
+ result.push(node);
+ }
+ return result;
+ }, []);
</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 requireLangPack = function (name, languages) {
- var language = AddOnManager.language;
- if (language && AddOnManager.languageLoad !== false) {
- if (languages) {
- languages = ',' + languages + ',';
- if (languages.indexOf(',' + language.substr(0, 2) + ',') !== -1) {
- language = language.substr(0, 2);
- } else if (languages.indexOf(',' + language + ',') === -1) {
- return;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var normalizedTextOffset = function (node, offset) {
+ while (node = node.previousSibling) {
+ if (!isText$5(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">- ScriptLoader.ScriptLoader.add(urls[name] + '/langs/' + language + '.js');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ offset += node.data.length;
</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 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 add = function (id, addOn, dependencies) {
- items.push(addOn);
- lookup[id] = {
- instance: addOn,
- dependencies: dependencies
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var equal$1 = function (a) {
+ return function (b) {
+ return a === b;
</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 result = partition(_listeners, function (listener) {
- return listener.name === id;
- });
- _listeners = result.fail;
- each$7(result.pass, function (listener) {
- listener.callback();
- });
- return addOn;
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var remove = function (name) {
- delete urls[name];
- delete lookup[name];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var normalizedNodeIndex = function (node) {
+ var nodes, index, numTextFragments;
+ nodes = getChildNodes(normalizedParent(node));
+ index = ArrUtils.findIndex(nodes, equal$1(node), node);
+ nodes = nodes.slice(0, index + 1);
+ numTextFragments = ArrUtils.reduce(nodes, function (result, node, i) {
+ if (isText$5(node) && isText$5(nodes[i - 1])) {
+ result++;
+ }
+ return result;
+ }, 0);
+ nodes = ArrUtils.filter(nodes, NodeType.matchNodeNames(node.nodeName));
+ index = ArrUtils.findIndex(nodes, equal$1(node), node);
+ return index - numTextFragments;
</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 createUrl = function (baseUrl, dep) {
- if (typeof dep === 'object') {
- return dep;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createPathItem = function (node) {
+ var name;
+ if (isText$5(node)) {
+ name = 'text()';
+ } else {
+ name = node.nodeName.toLowerCase();
</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 typeof baseUrl === 'string' ? {
- prefix: '',
- resource: dep,
- suffix: ''
- } : {
- prefix: baseUrl.prefix,
- resource: dep,
- suffix: baseUrl.suffix
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return name + '[' + normalizedNodeIndex(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 addComponents = function (pluginName, scripts) {
- var pluginUrl = _this.urls[pluginName];
- each$7(scripts, function (script) {
- ScriptLoader.ScriptLoader.add(pluginUrl + '/' + script);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var parentsUntil = function (root, node, predicate) {
+ var parents = [];
+ for (node = node.parentNode; node !== root; node = node.parentNode) {
+ if (predicate && predicate(node)) {
+ break;
+ }
+ parents.push(node);
+ }
+ return parents;
</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 loadDependencies = function (name, addOnUrl, success, scope) {
- var deps = dependencies(name);
- each$7(deps, function (dep) {
- var newUrl = createUrl(addOnUrl, dep);
- load(newUrl.resource, newUrl, undefined, undefined);
- });
- if (success) {
- if (scope) {
- success.call(scope);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var create$2 = function (root, caretPosition) {
+ var container, offset, path = [], outputOffset, childNodes, parents;
+ container = caretPosition.container();
+ offset = caretPosition.offset();
+ if (isText$5(container)) {
+ outputOffset = normalizedTextOffset(container, offset);
+ } else {
+ childNodes = container.childNodes;
+ if (offset >= childNodes.length) {
+ outputOffset = 'after';
+ offset = childNodes.length - 1;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- success.call(ScriptLoader);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ outputOffset = 'before';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ container = childNodes[offset];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ path.push(createPathItem(container));
+ parents = parentsUntil(root, container);
+ parents = ArrUtils.filter(parents, not(NodeType.isBogus));
+ path = path.concat(ArrUtils.map(parents, function (node) {
+ return createPathItem(node);
+ }));
+ return path.reverse().join('/') + ',' + outputOffset;
</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 load = function (name, addOnUrl, success, scope, failure) {
- if (urls[name]) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var resolvePathItem = function (node, name, index) {
+ var nodes = getChildNodes(node);
+ nodes = ArrUtils.filter(nodes, function (node, index) {
+ return !isText$5(node) || !isText$5(nodes[index - 1]);
+ });
+ nodes = ArrUtils.filter(nodes, NodeType.matchNodeNames(name));
+ return nodes[index];
+ };
+ var findTextPosition = function (container, offset) {
+ var node = container, targetOffset = 0, dataLen;
+ while (isText$5(node)) {
+ dataLen = node.data.length;
+ if (offset >= targetOffset && offset <= targetOffset + dataLen) {
+ container = node;
+ offset = offset - targetOffset;
+ break;
+ }
+ if (!isText$5(node.nextSibling)) {
+ container = node;
+ offset = dataLen;
+ break;
+ }
+ targetOffset += dataLen;
+ 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">- var urlString = typeof addOnUrl === 'string' ? addOnUrl : addOnUrl.prefix + addOnUrl.resource + addOnUrl.suffix;
- if (urlString.indexOf('/') !== 0 && urlString.indexOf('://') === -1) {
- urlString = AddOnManager.baseURL + '/' + urlString;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isText$5(container) && offset > container.data.length) {
+ offset = container.data.length;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- urls[name] = urlString.substring(0, urlString.lastIndexOf('/'));
- if (lookup[name]) {
- loadDependencies(name, addOnUrl, success, scope);
- } else {
- ScriptLoader.ScriptLoader.add(urlString, function () {
- return loadDependencies(name, addOnUrl, success, scope);
- }, scope, failure);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return CaretPosition$1(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">- var waitFor = function (name, callback) {
- if (lookup.hasOwnProperty(name)) {
- callback();
- } else {
- _listeners.push({
- name: name,
- callback: callback
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var resolve$2 = function (root, path) {
+ var parts, container, offset;
+ if (!path) {
+ return null;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parts = path.split(',');
+ path = parts[0].split('/');
+ offset = parts.length > 1 ? parts[1] : 'before';
+ container = ArrUtils.reduce(path, function (result, value) {
+ value = /([\w\-\(\)]+)\[([0-9]+)\]/.exec(value);
+ if (!value) {
+ return null;
+ }
+ if (value[1] === 'text()') {
+ value[1] = '#text';
+ }
+ return resolvePathItem(result, value[1], parseInt(value[2], 10));
+ }, root);
+ if (!container) {
+ return null;
+ }
+ if (!isText$5(container)) {
+ if (offset === 'after') {
+ offset = nodeIndex$1(container) + 1;
+ } else {
+ offset = nodeIndex$1(container);
+ }
+ return CaretPosition$1(container.parentNode, offset);
+ }
+ return findTextPosition(container, parseInt(offset, 10));
</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 {
- items: items,
- urls: urls,
- lookup: lookup,
- _listeners: _listeners,
- get: get,
- dependencies: dependencies,
- requireLangPack: requireLangPack,
- add: add,
- remove: remove,
- createUrl: createUrl,
- addComponents: addComponents,
- load: load,
- waitFor: waitFor
- };
- }
- (function (AddOnManager) {
- AddOnManager.PluginManager = AddOnManager();
- AddOnManager.ThemeManager = AddOnManager();
- }(AddOnManager || (AddOnManager = {})));
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var before = function (marker, element) {
- var parent = $_d3rmjp18jjgwe7nc.parent(marker);
- parent.each(function (v) {
- v.dom().insertBefore(element.dom(), marker.dom());
- });
- };
- var after = function (marker, element) {
- var sibling = $_d3rmjp18jjgwe7nc.nextSibling(marker);
- sibling.fold(function () {
- var parent = $_d3rmjp18jjgwe7nc.parent(marker);
- parent.each(function (v) {
- append(v, element);
- });
- }, function (v) {
- before(v, element);
- });
- };
- var prepend = function (parent, element) {
- var firstChild = $_d3rmjp18jjgwe7nc.firstChild(parent);
- firstChild.fold(function () {
- append(parent, element);
- }, function (v) {
- parent.dom().insertBefore(element.dom(), v.dom());
- });
- };
- var append = function (parent, element) {
- parent.dom().appendChild(element.dom());
- };
- var appendAt = function (parent, element, index) {
- $_d3rmjp18jjgwe7nc.child(parent, index).fold(function () {
- append(parent, element);
- }, function (v) {
- before(v, element);
- });
- };
- var wrap$1 = function (element, wrapper) {
- before(element, wrapper);
- append(wrapper, element);
- };
- var $_ewo3u51yjjgwe7su = {
- before: before,
- after: after,
- prepend: prepend,
- append: append,
- appendAt: appendAt,
- wrap: wrap$1
- };
-
- var before$1 = function (marker, elements) {
- each(elements, function (x) {
- $_ewo3u51yjjgwe7su.before(marker, x);
- });
- };
- var after$1 = function (marker, elements) {
- each(elements, function (x, i) {
- var e = i === 0 ? marker : elements[i - 1];
- $_ewo3u51yjjgwe7su.after(e, x);
- });
- };
- var prepend$1 = function (parent, elements) {
- each(elements.slice().reverse(), function (x) {
- $_ewo3u51yjjgwe7su.prepend(parent, x);
- });
- };
- var append$1 = function (parent, elements) {
- each(elements, function (x) {
- $_ewo3u51yjjgwe7su.append(parent, x);
- });
- };
- var $_4wf3mo1xjjgwe7sq = {
- before: before$1,
- after: after$1,
- prepend: prepend$1,
- append: append$1
- };
-
- var empty = function (element) {
- element.dom().textContent = '';
- each($_d3rmjp18jjgwe7nc.children(element), function (rogue) {
- remove$2(rogue);
- });
- };
- var remove$2 = function (element) {
- var dom = element.dom();
- if (dom.parentNode !== null)
- dom.parentNode.removeChild(dom);
- };
- var unwrap = function (wrapper) {
- var children = $_d3rmjp18jjgwe7nc.children(wrapper);
- if (children.length > 0)
- $_4wf3mo1xjjgwe7sq.before(wrapper, children);
- remove$2(wrapper);
- };
- var $_81exq51wjjgwe7sm = {
- empty: empty,
- remove: remove$2,
- unwrap: unwrap
- };
-
- var first$1 = function (fn, rate) {
- var timer = null;
- var cancel = function () {
- if (timer !== null) {
- clearTimeout(timer);
- timer = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isContentEditableFalse$2 = NodeType.isContentEditableFalse;
+ var getNormalizedTextOffset = function (trim, container, offset) {
+ var node, trimmedOffset;
+ trimmedOffset = trim(container.data.slice(0, offset)).length;
+ for (node = container.previousSibling; node && NodeType.isText(node); node = node.previousSibling) {
+ trimmedOffset += trim(node.data).length;
</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 trimmedOffset;
</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 throttle = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getPoint = function (dom, trim, normalized, rng, start) {
+ var container = rng[start ? 'startContainer' : 'endContainer'];
+ var offset = rng[start ? 'startOffset' : 'endOffset'];
+ var point = [];
+ var childNodes, after = 0;
+ var root = dom.getRoot();
+ if (NodeType.isText(container)) {
+ point.push(normalized ? getNormalizedTextOffset(trim, container, offset) : offset);
+ } else {
+ childNodes = container.childNodes;
+ if (offset >= childNodes.length && childNodes.length) {
+ after = 1;
+ offset = Math.max(0, childNodes.length - 1);
+ }
+ point.push(dom.nodeIndex(childNodes[offset], normalized) + after);
</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 (timer === null) {
- timer = setTimeout(function () {
- fn.apply(null, args);
- timer = null;
- }, rate);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (; container && container !== root; container = container.parentNode) {
+ point.push(dom.nodeIndex(container, normalized));
</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 point;
</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 {
- cancel: cancel,
- throttle: throttle
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getLocation = function (trim, selection, normalized, rng) {
+ var dom = selection.dom, bookmark = {};
+ bookmark.start = getPoint(dom, trim, normalized, rng, true);
+ if (!selection.isCollapsed()) {
+ bookmark.end = getPoint(dom, trim, normalized, rng, false);
+ }
+ 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 last$3 = function (fn, rate) {
- var timer = null;
- var cancel = function () {
- if (timer !== null) {
- clearTimeout(timer);
- timer = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var trimEmptyTextNode = function (node) {
+ if (NodeType.isText(node) && node.data.length === 0) {
+ node.parentNode.removeChild(node);
</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">- var throttle = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var findIndex$3 = function (dom, name, element) {
+ var count = 0;
+ Tools.each(dom.select(name), function (node) {
+ if (node.getAttribute('data-mce-bogus') === 'all') {
+ return;
+ }
+ if (node === element) {
+ return false;
+ }
+ count++;
+ });
+ return count;
+ };
+ var moveEndPoint = function (rng, start) {
+ var container, offset, childNodes;
+ var prefix = start ? 'start' : 'end';
+ container = rng[prefix + 'Container'];
+ offset = rng[prefix + 'Offset'];
+ if (NodeType.isElement(container) && container.nodeName === 'TR') {
+ childNodes = container.childNodes;
+ container = childNodes[Math.min(start ? offset : offset - 1, childNodes.length - 1)];
+ if (container) {
+ offset = start ? 0 : container.childNodes.length;
+ rng['set' + (start ? 'Start' : 'End')](container, offset);
+ }
</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 (timer !== null)
- clearTimeout(timer);
- timer = setTimeout(function () {
- fn.apply(null, args);
- timer = null;
- }, rate);
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return {
- cancel: cancel,
- throttle: throttle
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var normalizeTableCellSelection = function (rng) {
+ moveEndPoint(rng, true);
+ moveEndPoint(rng, false);
+ return 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">- };
-
- var Cell = function (initial) {
- var value = initial;
- var get = function () {
- return value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var findSibling = function (node, offset) {
+ var sibling;
+ if (NodeType.isElement(node)) {
+ node = getNode(node, offset);
+ if (isContentEditableFalse$2(node)) {
+ return node;
+ }
+ }
+ if (isCaretContainer(node)) {
+ if (NodeType.isText(node) && isCaretContainerBlock(node)) {
+ node = node.parentNode;
+ }
+ sibling = node.previousSibling;
+ if (isContentEditableFalse$2(sibling)) {
+ return sibling;
+ }
+ sibling = node.nextSibling;
+ if (isContentEditableFalse$2(sibling)) {
+ return 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 set = function (v) {
- value = v;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var findAdjacentContentEditableFalseElm = function (rng) {
+ return findSibling(rng.startContainer, rng.startOffset) || findSibling(rng.endContainer, rng.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">- var clone = function () {
- return Cell(get());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getOffsetBookmark = function (trim, normalized, selection) {
+ var element = selection.getNode();
+ var name = element ? element.nodeName : null;
+ var rng = selection.getRng();
+ if (isContentEditableFalse$2(element) || name === 'IMG') {
+ return {
+ name: name,
+ index: findIndex$3(selection.dom, name, element)
+ };
+ }
+ var sibling = findAdjacentContentEditableFalseElm(rng);
+ if (sibling) {
+ name = sibling.tagName;
+ return {
+ name: name,
+ index: findIndex$3(selection.dom, name, sibling)
+ };
+ }
+ return getLocation(trim, selection, normalized, 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">- return {
- get: get,
- set: set,
- clone: clone
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getCaretBookmark = function (selection) {
+ var rng = selection.getRng();
+ return {
+ start: create$2(selection.dom.getRoot(), CaretPosition$1.fromRangeStart(rng)),
+ end: create$2(selection.dom.getRoot(), CaretPosition$1.fromRangeEnd(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">- };
-
- function Toggler (turnOff, turnOn, initial) {
- var active = initial || false;
- var on = function () {
- turnOn();
- active = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getRangeBookmark = function (selection) {
+ return { rng: selection.getRng() };
</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 off = function () {
- turnOff();
- active = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createBookmarkSpan = function (dom, id, filled) {
+ var args = {
+ 'data-mce-type': 'bookmark',
+ 'id': id,
+ 'style': 'overflow:hidden;line-height:0px'
+ };
+ return filled ? dom.create('span', args, '') : dom.create('span', args);
</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 toggle = function () {
- var f = active ? off : on;
- f();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getPersistentBookmark = function (selection, filled) {
+ var dom = selection.dom;
+ var rng = selection.getRng();
+ var id = dom.uniqueId();
+ var collapsed = selection.isCollapsed();
+ var element = selection.getNode();
+ var name = element.nodeName;
+ if (name === 'IMG') {
+ return {
+ name: name,
+ index: findIndex$3(dom, name, element)
+ };
+ }
+ var rng2 = normalizeTableCellSelection(rng.cloneRange());
+ if (!collapsed) {
+ rng2.collapse(false);
+ var endBookmarkNode = createBookmarkSpan(dom, id + '_end', filled);
+ rng2.insertNode(endBookmarkNode);
+ trimEmptyTextNode(endBookmarkNode.nextSibling);
+ }
+ rng = normalizeTableCellSelection(rng);
+ rng.collapse(true);
+ var startBookmarkNode = createBookmarkSpan(dom, id + '_start', filled);
+ rng.insertNode(startBookmarkNode);
+ trimEmptyTextNode(startBookmarkNode.previousSibling);
+ trimEmptyTextNode(startBookmarkNode.nextSibling);
+ selection.moveToBookmark({
+ id: id,
+ keep: 1
+ });
+ return { id: id };
</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 isOn = function () {
- return active;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getBookmark = function (selection, type, normalized) {
+ if (type === 2) {
+ return getOffsetBookmark(Zwsp.trim, normalized, selection);
+ } else if (type === 3) {
+ return getCaretBookmark(selection);
+ } else if (type) {
+ return getRangeBookmark(selection);
+ } else {
+ return getPersistentBookmark(selection, 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 {
- on: on,
- off: off,
- toggle: toggle,
- isOn: isOn
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var GetBookmark = {
+ getBookmark: getBookmark,
+ getUndoBookmark: curry(getOffsetBookmark, identity, true),
+ getPersistentBookmark: getPersistentBookmark
</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><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var read = function (element, attr) {
- var value = $_etx7gr15jjgwe7mr.get(element, attr);
- return value === undefined || value === '' ? [] : value.split(' ');
- };
- var add = function (element, attr, id) {
- var old = read(element, attr);
- var nu = old.concat([id]);
- $_etx7gr15jjgwe7mr.set(element, attr, nu.join(' '));
- return true;
- };
- var remove$3 = function (element, attr, id) {
- var nu = filter(read(element, attr), function (v) {
- return v !== id;
- });
- if (nu.length > 0)
- $_etx7gr15jjgwe7mr.set(element, attr, nu.join(' '));
- else
- $_etx7gr15jjgwe7mr.remove(element, attr);
- return false;
- };
- var $_93yq9626jjgwe7ub = {
- read: read,
- add: add,
- remove: remove$3
- };
-
- var supports = function (element) {
- return element.dom().classList !== undefined;
- };
- var get$2 = function (element) {
- return $_93yq9626jjgwe7ub.read(element, 'class');
- };
- var add$1 = function (element, clazz) {
- return $_93yq9626jjgwe7ub.add(element, 'class', clazz);
- };
- var remove$4 = function (element, clazz) {
- return $_93yq9626jjgwe7ub.remove(element, 'class', clazz);
- };
- var toggle = function (element, clazz) {
- if (contains(get$2(element), clazz)) {
- return remove$4(element, clazz);
- } else {
- return add$1(element, clazz);
- }
- };
- var $_4u1bru25jjgwe7u6 = {
- get: get$2,
- add: add$1,
- remove: remove$4,
- toggle: toggle,
- supports: supports
- };
-
- var add$2 = function (element, clazz) {
- if ($_4u1bru25jjgwe7u6.supports(element))
- element.dom().classList.add(clazz);
- else
- $_4u1bru25jjgwe7u6.add(element, clazz);
- };
- var cleanClass = function (element) {
- var classList = $_4u1bru25jjgwe7u6.supports(element) ? element.dom().classList : $_4u1bru25jjgwe7u6.get(element);
- if (classList.length === 0) {
- $_etx7gr15jjgwe7mr.remove(element, 'class');
- }
- };
- var remove$5 = function (element, clazz) {
- if ($_4u1bru25jjgwe7u6.supports(element)) {
- var classList = element.dom().classList;
- classList.remove(clazz);
- } else
- $_4u1bru25jjgwe7u6.remove(element, clazz);
- cleanClass(element);
- };
- var toggle$1 = function (element, clazz) {
- return $_4u1bru25jjgwe7u6.supports(element) ? element.dom().classList.toggle(clazz) : $_4u1bru25jjgwe7u6.toggle(element, clazz);
- };
- var toggler = function (element, clazz) {
- var hasClasslist = $_4u1bru25jjgwe7u6.supports(element);
- var classList = element.dom().classList;
- var off = function () {
- if (hasClasslist)
- classList.remove(clazz);
- else
- $_4u1bru25jjgwe7u6.remove(element, clazz);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var CARET_ID = '_mce_caret';
+ var isCaretNode = function (node) {
+ return NodeType.isElement(node) && node.id === CARET_ID;
</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 on = function () {
- if (hasClasslist)
- classList.add(clazz);
- else
- $_4u1bru25jjgwe7u6.add(element, clazz);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getParentCaretContainer = function (body, node) {
+ while (node && node !== body) {
+ if (node.id === CARET_ID) {
+ return node;
+ }
+ node = node.parentNode;
+ }
+ return 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 Toggler(off, on, has$1(element, clazz));
- };
- var has$1 = function (element, clazz) {
- return $_4u1bru25jjgwe7u6.supports(element) && element.dom().classList.contains(clazz);
- };
- var $_9lrjdk23jjgwe7u2 = {
- add: add$2,
- remove: remove$5,
- toggle: toggle$1,
- toggler: toggler,
- has: has$1
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var all$1 = function (predicate) {
- return descendants($_eu440l16jjgwe7n2.body(), predicate);
- };
- var ancestors = function (scope, predicate, isRoot) {
- return filter($_d3rmjp18jjgwe7nc.parents(scope, isRoot), predicate);
- };
- var siblings$1 = function (scope, predicate) {
- return filter($_d3rmjp18jjgwe7nc.siblings(scope), predicate);
- };
- var children$1 = function (scope, predicate) {
- return filter($_d3rmjp18jjgwe7nc.children(scope), predicate);
- };
- var descendants = function (scope, predicate) {
- var result = [];
- each($_d3rmjp18jjgwe7nc.children(scope), function (x) {
- if (predicate(x)) {
- result = result.concat([x]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isElement$4 = NodeType.isElement;
+ var isText$6 = NodeType.isText;
+ var removeNode = function (node) {
+ var parentNode = node.parentNode;
+ if (parentNode) {
+ parentNode.removeChild(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">- result = result.concat(descendants(x, predicate));
- });
- return result;
- };
- var $_15b10128jjgwe7uh = {
- all: all$1,
- ancestors: ancestors,
- siblings: siblings$1,
- children: children$1,
- descendants: descendants
- };
-
- var all$2 = function (selector) {
- return $_4yq1xp1gjjgwe7op.all(selector);
- };
- var ancestors$1 = function (scope, selector, isRoot) {
- return $_15b10128jjgwe7uh.ancestors(scope, function (e) {
- return $_4yq1xp1gjjgwe7op.is(e, selector);
- }, isRoot);
- };
- var siblings$2 = function (scope, selector) {
- return $_15b10128jjgwe7uh.siblings(scope, function (e) {
- return $_4yq1xp1gjjgwe7op.is(e, selector);
- });
- };
- var children$2 = function (scope, selector) {
- return $_15b10128jjgwe7uh.children(scope, function (e) {
- return $_4yq1xp1gjjgwe7op.is(e, selector);
- });
- };
- var descendants$1 = function (scope, selector) {
- return $_4yq1xp1gjjgwe7op.all(selector, scope);
- };
- var $_d3ydn427jjgwe7uf = {
- all: all$2,
- ancestors: ancestors$1,
- siblings: siblings$2,
- children: children$2,
- descendants: descendants$1
- };
-
- function ClosestOrAncestor (is, ancestor, scope, a, isRoot) {
- return is(scope, a) ? Option.some(scope) : isFunction(isRoot) && isRoot(scope) ? Option.none() : ancestor(scope, a, isRoot);
- }
-
- var first$2 = function (predicate) {
- return descendant($_eu440l16jjgwe7n2.body(), predicate);
- };
- var ancestor = function (scope, predicate, isRoot) {
- var element = scope.dom();
- var stop = isFunction(isRoot) ? isRoot : constant(false);
- while (element.parentNode) {
- element = element.parentNode;
- var el = Element$$1.fromDom(element);
- if (predicate(el))
- return Option.some(el);
- else if (stop(el))
- break;
- }
- return Option.none();
- };
- var closest = function (scope, predicate, isRoot) {
- var is = function (scope) {
- return predicate(scope);
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return ClosestOrAncestor(is, ancestor, scope, predicate, isRoot);
- };
- var sibling$1 = function (scope, predicate) {
- var element = scope.dom();
- if (!element.parentNode)
- return Option.none();
- return child$1(Element$$1.fromDom(element.parentNode), function (x) {
- return !$_5raon11ejjgwe7o5.eq(scope, x) && predicate(x);
- });
- };
- var child$1 = function (scope, predicate) {
- var result = find(scope.dom().childNodes, compose(predicate, Element$$1.fromDom));
- return result.map(Element$$1.fromDom);
- };
- var descendant = function (scope, predicate) {
- var descend = function (node) {
- for (var i = 0; i < node.childNodes.length; i++) {
- if (predicate(Element$$1.fromDom(node.childNodes[i])))
- return Option.some(Element$$1.fromDom(node.childNodes[i]));
- var res = descend(node.childNodes[i]);
- if (res.isSome())
- return res;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getNodeValue = function (node) {
+ try {
+ return node.nodeValue;
+ } catch (ex) {
+ 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 Option.none();
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return descend(scope.dom());
- };
- var $_7kjxyh2ajjgwe7un = {
- first: first$2,
- ancestor: ancestor,
- closest: closest,
- sibling: sibling$1,
- child: child$1,
- descendant: descendant
- };
-
- var first$3 = function (selector) {
- return $_4yq1xp1gjjgwe7op.one(selector);
- };
- var ancestor$1 = function (scope, selector, isRoot) {
- return $_7kjxyh2ajjgwe7un.ancestor(scope, function (e) {
- return $_4yq1xp1gjjgwe7op.is(e, selector);
- }, isRoot);
- };
- var sibling$2 = function (scope, selector) {
- return $_7kjxyh2ajjgwe7un.sibling(scope, function (e) {
- return $_4yq1xp1gjjgwe7op.is(e, selector);
- });
- };
- var child$2 = function (scope, selector) {
- return $_7kjxyh2ajjgwe7un.child(scope, function (e) {
- return $_4yq1xp1gjjgwe7op.is(e, selector);
- });
- };
- var descendant$1 = function (scope, selector) {
- return $_4yq1xp1gjjgwe7op.one(selector, scope);
- };
- var closest$1 = function (scope, selector, isRoot) {
- return ClosestOrAncestor($_4yq1xp1gjjgwe7op.is, ancestor$1, scope, selector, isRoot);
- };
- var $_ajwe9029jjgwe7ul = {
- first: first$3,
- ancestor: ancestor$1,
- sibling: sibling$2,
- child: child$2,
- descendant: descendant$1,
- closest: closest$1
- };
-
- var annotation = constant('mce-annotation');
- var dataAnnotation = constant('data-mce-annotation');
- var dataAnnotationId = constant('data-mce-annotation-uid');
-
- var identify = function (editor, annotationName) {
- var rng = editor.selection.getRng();
- var start = Element$$1.fromDom(rng.startContainer);
- var root = Element$$1.fromDom(editor.getBody());
- var selector = annotationName.fold(function () {
- return '.' + annotation();
- }, function (an) {
- return '[' + dataAnnotation() + '="' + an + '"]';
- });
- var newStart = $_d3rmjp18jjgwe7nc.child(start, rng.startOffset).getOr(start);
- var closest = $_ajwe9029jjgwe7ul.closest(newStart, selector, function (n) {
- return $_5raon11ejjgwe7o5.eq(n, root);
- });
- var getAttr = function (c, property) {
- if ($_etx7gr15jjgwe7mr.has(c, property)) {
- return Option.some($_etx7gr15jjgwe7mr.get(c, property));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setNodeValue = function (node, text) {
+ if (text.length === 0) {
+ removeNode(node);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return Option.none();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ node.nodeValue = text;
</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">- return closest.bind(function (c) {
- return getAttr(c, '' + dataAnnotationId()).bind(function (uid) {
- return getAttr(c, '' + dataAnnotation()).map(function (name) {
- var elements = findMarkers(editor, uid);
- return {
- uid: uid,
- name: name,
- elements: elements
- };
- });
- });
- });
- };
- var isAnnotation = function (elem) {
- return $_fxxo5411jjgwe7lq.isElement(elem) && $_9lrjdk23jjgwe7u2.has(elem, annotation());
- };
- var findMarkers = function (editor, uid) {
- var body = Element$$1.fromDom(editor.getBody());
- return $_d3ydn427jjgwe7uf.descendants(body, '[' + dataAnnotationId() + '="' + uid + '"]');
- };
- var findAll = function (editor, name) {
- var body = Element$$1.fromDom(editor.getBody());
- var markers = $_d3ydn427jjgwe7uf.descendants(body, '[' + dataAnnotation() + '="' + name + '"]');
- var directory = {};
- each(markers, function (m) {
- var uid = $_etx7gr15jjgwe7mr.get(m, dataAnnotationId());
- var nodesAlready = directory.hasOwnProperty(uid) ? directory[uid] : [];
- directory[uid] = nodesAlready.concat([m]);
- });
- return directory;
- };
-
- var setup = function (editor, registry) {
- var changeCallbacks = Cell({});
- var initData = function () {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var trimCount = function (text) {
+ var trimmedText = Zwsp.trim(text);
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- listeners: [],
- previous: Cell(Option.none())
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ count: text.length - trimmedText.length,
+ text: trimmedText
</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">- var withCallbacks = function (name, f) {
- updateCallbacks(name, function (data) {
- f(data);
- return data;
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var removeUnchanged = function (caretContainer, pos) {
+ remove$7(caretContainer);
+ return pos;
</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 updateCallbacks = function (name, f) {
- var callbackMap = changeCallbacks.get();
- var data = callbackMap.hasOwnProperty(name) ? callbackMap[name] : initData();
- var outputData = f(data);
- callbackMap[name] = outputData;
- changeCallbacks.set(callbackMap);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var removeTextAndReposition = function (caretContainer, pos) {
+ var before = trimCount(caretContainer.data.substr(0, pos.offset()));
+ var after = trimCount(caretContainer.data.substr(pos.offset()));
+ var text = before.text + after.text;
+ if (text.length > 0) {
+ setNodeValue(caretContainer, text);
+ return CaretPosition$1(caretContainer, pos.offset() - before.count);
+ } else {
+ return pos;
+ }
</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 fireCallbacks = function (name, uid, elements) {
- withCallbacks(name, function (data) {
- each(data.listeners, function (f) {
- return f(true, name, {
- uid: uid,
- nodes: map(elements, function (elem) {
- return elem.dom();
- })
- });
- });
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var removeElementAndReposition = function (caretContainer, pos) {
+ var parentNode = pos.container();
+ var newPosition = indexOf(from$1(parentNode.childNodes), caretContainer).map(function (index) {
+ return index < pos.offset() ? CaretPosition$1(parentNode, pos.offset() - 1) : pos;
+ }).getOr(pos);
+ remove$7(caretContainer);
+ return newPosition;
</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 fireNoAnnotation = function (name) {
- withCallbacks(name, function (data) {
- each(data.listeners, function (f) {
- return f(false, name);
- });
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var removeTextCaretContainer = function (caretContainer, pos) {
+ return isText$6(caretContainer) && pos.container() === caretContainer ? removeTextAndReposition(caretContainer, pos) : removeUnchanged(caretContainer, pos);
</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 onNodeChange = last$3(function () {
- var callbackMap = changeCallbacks.get();
- var annotations = sort(keys(callbackMap));
- each(annotations, function (name) {
- updateCallbacks(name, function (data) {
- var prev = data.previous.get();
- identify(editor, Option.some(name)).fold(function () {
- if (prev.isSome()) {
- fireNoAnnotation(name);
- data.previous.set(Option.none());
- }
- }, function (_a) {
- var uid = _a.uid, name = _a.name, elements = _a.elements;
- if (!prev.is(uid)) {
- fireCallbacks(name, uid, elements);
- data.previous.set(Option.some(uid));
- }
- });
- return {
- previous: data.previous,
- listeners: data.listeners
- };
- });
- });
- }, 30);
- editor.on('remove', function () {
- onNodeChange.cancel();
- });
- editor.on('nodeChange', function () {
- onNodeChange.throttle();
- });
- var addListener = function (name, f) {
- updateCallbacks(name, function (data) {
- return {
- previous: data.previous,
- listeners: data.listeners.concat([f])
- };
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var removeElementCaretContainer = function (caretContainer, pos) {
+ return pos.container() === caretContainer.parentNode ? removeElementAndReposition(caretContainer, pos) : removeUnchanged(caretContainer, pos);
</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 { addListener: addListener };
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var removeAndReposition = function (container, pos) {
+ return CaretPosition$1.isTextPosition(pos) ? removeTextCaretContainer(container, pos) : removeElementCaretContainer(container, pos);
+ };
+ var remove$7 = function (caretContainerNode) {
+ if (isElement$4(caretContainerNode) && isCaretContainer(caretContainerNode)) {
+ if (hasContent(caretContainerNode)) {
+ caretContainerNode.removeAttribute('data-mce-caret');
+ } else {
+ removeNode(caretContainerNode);
+ }
+ }
+ if (isText$6(caretContainerNode)) {
+ var text = Zwsp.trim(getNodeValue(caretContainerNode));
+ setNodeValue(caretContainerNode, text);
+ }
+ };
+ var CaretContainerRemove = {
+ removeAndReposition: removeAndReposition,
+ remove: remove$7
+ };
</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 setup$1 = function (editor, registry) {
- var identifyParserNode = function (span) {
- var optAnnotation = Option.from(span.attributes.map[dataAnnotation()]);
- return optAnnotation.bind(registry.lookup);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var browser$2 = PlatformDetection$1.detect().browser;
+ var isContentEditableFalse$3 = NodeType.isContentEditableFalse;
+ var isTableCell$1 = function (node) {
+ return NodeType.isElement(node) && /^(TD|TH)$/i.test(node.tagName);
</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.serializer.addNodeFilter('span', function (spans) {
- each(spans, function (span) {
- identifyParserNode(span).each(function (settings) {
- if (settings.persistent === false) {
- span.unwrap();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getAbsoluteClientRect = function (root, element, before) {
+ var clientRect = collapse(element.getBoundingClientRect(), before);
+ var docElm, scrollX, scrollY, margin, rootRect;
+ if (root.tagName === 'BODY') {
+ docElm = root.ownerDocument.documentElement;
+ scrollX = root.scrollLeft || docElm.scrollLeft;
+ scrollY = root.scrollTop || docElm.scrollTop;
+ } else {
+ rootRect = root.getBoundingClientRect();
+ scrollX = root.scrollLeft - rootRect.left;
+ scrollY = root.scrollTop - rootRect.top;
+ }
+ clientRect.left += scrollX;
+ clientRect.right += scrollX;
+ clientRect.top += scrollY;
+ clientRect.bottom += scrollY;
+ clientRect.width = 1;
+ margin = element.offsetWidth - element.clientWidth;
+ if (margin > 0) {
+ if (before) {
+ margin *= -1;
+ }
+ clientRect.left += margin;
+ clientRect.right += margin;
+ }
+ return clientRect;
+ };
+ var trimInlineCaretContainers = function (root) {
+ var contentEditableFalseNodes, node, sibling, i, data;
+ contentEditableFalseNodes = DomQuery('*[contentEditable=false]', root);
+ for (i = 0; i < contentEditableFalseNodes.length; i++) {
+ node = contentEditableFalseNodes[i];
+ sibling = node.previousSibling;
+ if (endsWithCaretContainer(sibling)) {
+ data = sibling.data;
+ if (data.length === 1) {
+ sibling.parentNode.removeChild(sibling);
+ } else {
+ sibling.deleteData(data.length - 1, 1);
+ }
+ }
+ sibling = node.nextSibling;
+ if (startsWithCaretContainer(sibling)) {
+ data = sibling.data;
+ if (data.length === 1) {
+ sibling.parentNode.removeChild(sibling);
+ } else {
+ sibling.deleteData(0, 1);
+ }
+ }
+ }
+ };
+ var FakeCaret = function (root, isBlock, hasFocus) {
+ var lastVisualCaret = Cell(Option.none());
+ var cursorInterval, caretContainerNode;
+ var show = function (before, element) {
+ var clientRect, rng;
+ hide();
+ if (isTableCell$1(element)) {
+ return null;
+ }
+ if (isBlock(element)) {
+ caretContainerNode = insertBlock('p', element, before);
+ clientRect = getAbsoluteClientRect(root, element, before);
+ DomQuery(caretContainerNode).css('top', clientRect.top);
+ var caret = DomQuery('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(clientRect).appendTo(root)[0];
+ lastVisualCaret.set(Option.some({
+ caret: caret,
+ element: element,
+ before: before
+ }));
+ lastVisualCaret.get().each(function (caretState) {
+ if (before) {
+ DomQuery(caretState.caret).addClass('mce-visual-caret-before');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ startBlink();
+ rng = element.ownerDocument.createRange();
+ rng.setStart(caretContainerNode, 0);
+ rng.setEnd(caretContainerNode, 0);
+ } else {
+ caretContainerNode = insertInline(element, before);
+ rng = element.ownerDocument.createRange();
+ if (isContentEditableFalse$3(caretContainerNode.nextSibling)) {
+ rng.setStart(caretContainerNode, 0);
+ rng.setEnd(caretContainerNode, 0);
+ } else {
+ rng.setStart(caretContainerNode, 1);
+ rng.setEnd(caretContainerNode, 1);
+ }
+ return rng;
+ }
+ return rng;
+ };
+ var hide = function () {
+ trimInlineCaretContainers(root);
+ if (caretContainerNode) {
+ CaretContainerRemove.remove(caretContainerNode);
+ caretContainerNode = null;
+ }
+ lastVisualCaret.get().each(function (caretState) {
+ DomQuery(caretState.caret).remove();
+ lastVisualCaret.set(Option.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 create$1 = function () {
- var annotations = {};
- var register = function (name, settings) {
- annotations[name] = {
- name: name,
- settings: settings
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ clearInterval(cursorInterval);
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var startBlink = function () {
+ cursorInterval = Delay.setInterval(function () {
+ if (hasFocus()) {
+ DomQuery('div.mce-visual-caret', root).toggleClass('mce-visual-caret-hidden');
+ } else {
+ DomQuery('div.mce-visual-caret', root).addClass('mce-visual-caret-hidden');
+ }
+ }, 500);
+ };
+ var reposition = function () {
+ lastVisualCaret.get().each(function (caretState) {
+ var clientRect = getAbsoluteClientRect(root, caretState.element, caretState.before);
+ DomQuery(caretState.caret).css(clientRect);
+ });
+ };
+ var destroy = function () {
+ return Delay.clearInterval(cursorInterval);
+ };
+ var getCss = function () {
+ return '.mce-visual-caret {' + 'position: absolute;' + 'background-color: black;' + 'background-color: currentcolor;' + '}' + '.mce-visual-caret-hidden {' + 'display: none;' + '}' + '*[data-mce-caret] {' + 'position: absolute;' + 'left: -1000px;' + 'right: auto;' + 'top: 0;' + 'margin: 0;' + 'padding: 0;' + '}';
+ };
+ return {
+ show: show,
+ hide: hide,
+ getCss: getCss,
+ reposition: reposition,
+ destroy: destroy
+ };
</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 lookup = function (name) {
- return annotations.hasOwnProperty(name) ? Option.from(annotations[name]).map(function (a) {
- return a.settings;
- }) : Option.none();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isFakeCaretTableBrowser = function () {
+ return browser$2.isIE() || browser$2.isEdge() || browser$2.isFirefox();
</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 {
- register: register,
- lookup: lookup
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isFakeCaretTarget = function (node) {
+ return isContentEditableFalse$3(node) || NodeType.isTable(node) && isFakeCaretTableBrowser();
</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><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var unique = 0;
- var generate = function (prefix) {
- var date = new Date();
- var time = date.getTime();
- var random = Math.floor(Math.random() * 1000000000);
- unique++;
- return prefix + '_' + random + unique + String(time);
- };
-
- var add$3 = function (element, classes) {
- each(classes, function (x) {
- $_9lrjdk23jjgwe7u2.add(element, x);
- });
- };
- var remove$6 = function (element, classes) {
- each(classes, function (x) {
- $_9lrjdk23jjgwe7u2.remove(element, x);
- });
- };
- var toggle$2 = function (element, classes) {
- each(classes, function (x) {
- $_9lrjdk23jjgwe7u2.toggle(element, x);
- });
- };
- var hasAll = function (element, classes) {
- return forall(classes, function (clazz) {
- return $_9lrjdk23jjgwe7u2.has(element, clazz);
- });
- };
- var hasAny = function (element, classes) {
- return exists(classes, function (clazz) {
- return $_9lrjdk23jjgwe7u2.has(element, clazz);
- });
- };
- var getNative = function (element) {
- var classList = element.dom().classList;
- var r = new Array(classList.length);
- for (var i = 0; i < classList.length; i++) {
- r[i] = classList.item(i);
- }
- return r;
- };
- var get$3 = function (element) {
- return $_4u1bru25jjgwe7u6.supports(element) ? getNative(element) : $_4u1bru25jjgwe7u6.get(element);
- };
- var $_cu95hr2hjjgwe7w8 = {
- add: add$3,
- remove: remove$6,
- toggle: toggle$2,
- hasAll: hasAll,
- hasAny: hasAny,
- get: get$3
- };
-
- var clone$1 = function (original, deep) {
- return Element$$1.fromDom(original.dom().cloneNode(deep));
- };
- var shallow = function (original) {
- return clone$1(original, false);
- };
- var deep = function (original) {
- return clone$1(original, true);
- };
- var shallowAs = function (original, tag) {
- var nu = Element$$1.fromTag(tag);
- var attributes = $_etx7gr15jjgwe7mr.clone(original);
- $_etx7gr15jjgwe7mr.setAll(nu, attributes);
- return nu;
- };
- var copy$1 = function (original, tag) {
- var nu = shallowAs(original, tag);
- var cloneChildren = $_d3rmjp18jjgwe7nc.children(deep(original));
- $_4wf3mo1xjjgwe7sq.append(nu, cloneChildren);
- return nu;
- };
- var mutate = function (original, tag) {
- var nu = shallowAs(original, tag);
- $_ewo3u51yjjgwe7su.before(original, nu);
- var children = $_d3rmjp18jjgwe7nc.children(original);
- $_4wf3mo1xjjgwe7sq.append(nu, children);
- $_81exq51wjjgwe7sm.remove(original);
- return nu;
- };
- var $_6do1m42ijjgwe7wd = {
- shallow: shallow,
- shallowAs: shallowAs,
- deep: deep,
- copy: copy$1,
- mutate: mutate
- };
-
- var slice$3 = [].slice;
- var constant$1 = function (value) {
- return function () {
- return value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var is$3 = function (expected) {
+ return function (actual) {
+ return expected === actual;
+ };
</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 negate = function (predicate) {
- return function (x) {
- return !predicate(x);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isNbsp = is$3('\xA0');
+ var isWhiteSpace$1 = function (chr) {
+ return /^[\r\n\t ]$/.test(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">- };
- var compose$2 = function (f, g) {
- return function (x) {
- return f(g(x));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isContent = function (chr) {
+ return !isWhiteSpace$1(chr) && !isNbsp(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">- };
- var or = function () {
- var x = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- x[_i] = arguments[_i];
- }
- var args = slice$3.call(arguments);
- return function (x) {
- for (var i = 0; i < args.length; i++) {
- if (args[i](x)) {
- return true;
- }
- }
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var isContentEditableFalse$4 = NodeType.isContentEditableFalse;
+ var isBlockLike = NodeType.matchStyleValues('display', 'block table table-cell table-caption list-item');
+ var isCaretContainer$2 = isCaretContainer;
+ var isCaretContainerBlock$1 = isCaretContainerBlock;
+ var isElement$5 = NodeType.isElement;
+ var isCaretCandidate$2 = isCaretCandidate;
+ var isForwards = function (direction) {
+ return direction > 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">- };
- var and = function () {
- var x = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- x[_i] = arguments[_i];
- }
- var args = slice$3.call(arguments);
- return function (x) {
- for (var i = 0; i < args.length; i++) {
- if (!args[i](x)) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isBackwards = function (direction) {
+ return direction < 0;
+ };
+ var skipCaretContainers = function (walk, shallow) {
+ var node;
+ while (node = walk(shallow)) {
+ if (!isCaretContainerBlock$1(node)) {
+ return node;
</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">- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- };
- var curry$1 = function (fn) {
- var x = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- x[_i - 1] = arguments[_i];
- }
- var args = slice$3.call(arguments);
- if (args.length - 1 >= fn.length) {
- return fn.apply(this, args.slice(1));
- }
- return function () {
- var tempArgs = args.concat([].slice.call(arguments));
- return curry$1.apply(this, tempArgs);
- };
- };
- var noop$1 = function () {
- };
- var $_4127e12ljjgwe7ww = {
- constant: constant$1,
- negate: negate,
- and: and,
- or: or,
- curry: curry$1,
- compose: compose$2,
- noop: noop$1
- };
-
- var ZWSP = '\uFEFF';
- var isZwsp = function (chr) {
- return chr === ZWSP;
- };
- var trim$3 = function (text) {
- return text.replace(new RegExp(ZWSP, 'g'), '');
- };
- var $_2xw7ul2pjjgwe7xs = {
- isZwsp: isZwsp,
- ZWSP: ZWSP,
- trim: trim$3
- };
-
- var isElement$2 = $_3b9u2y1rjjgwe7qe.isElement;
- var isText$2 = $_3b9u2y1rjjgwe7qe.isText;
- var isCaretContainerBlock = function (node) {
- if (isText$2(node)) {
- node = node.parentNode;
- }
- return isElement$2(node) && node.hasAttribute('data-mce-caret');
- };
- var isCaretContainerInline = function (node) {
- return isText$2(node) && $_2xw7ul2pjjgwe7xs.isZwsp(node.data);
- };
- var isCaretContainer = function (node) {
- return isCaretContainerBlock(node) || isCaretContainerInline(node);
- };
- var hasContent = function (node) {
- return node.firstChild !== node.lastChild || !$_3b9u2y1rjjgwe7qe.isBr(node.firstChild);
- };
- var insertInline = function (node, before) {
- var doc, sibling, textNode, parentNode;
- doc = node.ownerDocument;
- textNode = doc.createTextNode($_2xw7ul2pjjgwe7xs.ZWSP);
- parentNode = node.parentNode;
- if (!before) {
- sibling = node.nextSibling;
- if (isText$2(sibling)) {
- if (isCaretContainer(sibling)) {
- return sibling;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var findNode = function (node, direction, predicateFn, rootNode, shallow) {
+ var walker = new TreeWalker(node, rootNode);
+ if (isBackwards(direction)) {
+ if (isContentEditableFalse$4(node) || isCaretContainerBlock$1(node)) {
+ node = skipCaretContainers(walker.prev, true);
+ if (predicateFn(node)) {
+ return 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 (startsWithCaretContainer(sibling)) {
- sibling.splitText(1);
- return sibling;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ while (node = skipCaretContainers(walker.prev, shallow)) {
+ if (predicateFn(node)) {
+ return node;
+ }
</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">- if (node.nextSibling) {
- parentNode.insertBefore(textNode, node.nextSibling);
- } else {
- parentNode.appendChild(textNode);
- }
- } else {
- sibling = node.previousSibling;
- if (isText$2(sibling)) {
- if (isCaretContainer(sibling)) {
- return sibling;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isForwards(direction)) {
+ if (isContentEditableFalse$4(node) || isCaretContainerBlock$1(node)) {
+ node = skipCaretContainers(walker.next, true);
+ if (predicateFn(node)) {
+ return 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 (endsWithCaretContainer(sibling)) {
- return sibling.splitText(sibling.data.length - 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ while (node = skipCaretContainers(walker.next, shallow)) {
+ if (predicateFn(node)) {
+ return node;
+ }
</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">- parentNode.insertBefore(textNode, node);
- }
- return textNode;
- };
- var isBeforeInline = function (pos) {
- var container = pos.container();
- return pos && $_3b9u2y1rjjgwe7qe.isText(container) && container.data.charAt(pos.offset()) === $_2xw7ul2pjjgwe7xs.ZWSP;
- };
- var isAfterInline = function (pos) {
- var container = pos.container();
- return pos && $_3b9u2y1rjjgwe7qe.isText(container) && container.data.charAt(pos.offset() - 1) === $_2xw7ul2pjjgwe7xs.ZWSP;
- };
- var createBogusBr = function () {
- var br = document.createElement('br');
- br.setAttribute('data-mce-bogus', '1');
- return br;
- };
- var insertBlock = function (blockName, node, before) {
- var doc, blockNode, parentNode;
- doc = node.ownerDocument;
- blockNode = doc.createElement(blockName);
- blockNode.setAttribute('data-mce-caret', before ? 'before' : 'after');
- blockNode.setAttribute('data-mce-bogus', 'all');
- blockNode.appendChild(createBogusBr());
- parentNode = node.parentNode;
- if (!before) {
- if (node.nextSibling) {
- parentNode.insertBefore(blockNode, node.nextSibling);
- } else {
- parentNode.appendChild(blockNode);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return null;
+ };
+ var getParentBlock = function (node, rootNode) {
+ while (node && node !== rootNode) {
+ if (isBlockLike(node)) {
+ return node;
+ }
+ 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">- } else {
- parentNode.insertBefore(blockNode, node);
- }
- return blockNode;
- };
- var startsWithCaretContainer = function (node) {
- return isText$2(node) && node.data[0] === $_2xw7ul2pjjgwe7xs.ZWSP;
- };
- var endsWithCaretContainer = function (node) {
- return isText$2(node) && node.data[node.data.length - 1] === $_2xw7ul2pjjgwe7xs.ZWSP;
- };
- var trimBogusBr = function (elm) {
- var brs = elm.getElementsByTagName('br');
- var lastBr = brs[brs.length - 1];
- if ($_3b9u2y1rjjgwe7qe.isBogus(lastBr)) {
- lastBr.parentNode.removeChild(lastBr);
- }
- };
- var showCaretContainerBlock = function (caretContainer) {
- if (caretContainer && caretContainer.hasAttribute('data-mce-caret')) {
- trimBogusBr(caretContainer);
- caretContainer.removeAttribute('data-mce-caret');
- caretContainer.removeAttribute('data-mce-bogus');
- caretContainer.removeAttribute('style');
- caretContainer.removeAttribute('_moz_abspos');
- return caretContainer;
- }
- return null;
- };
- var isRangeInCaretContainerBlock = function (range) {
- return isCaretContainerBlock(range.startContainer);
- };
-
- var isContentEditableTrue$1 = $_3b9u2y1rjjgwe7qe.isContentEditableTrue;
- var isContentEditableFalse$1 = $_3b9u2y1rjjgwe7qe.isContentEditableFalse;
- var isBr$2 = $_3b9u2y1rjjgwe7qe.isBr;
- var isText$3 = $_3b9u2y1rjjgwe7qe.isText;
- var isInvalidTextElement = $_3b9u2y1rjjgwe7qe.matchNodeNames('script style textarea');
- var isAtomicInline = $_3b9u2y1rjjgwe7qe.matchNodeNames('img input textarea hr iframe video audio object');
- var isTable$1 = $_3b9u2y1rjjgwe7qe.matchNodeNames('table');
- var isCaretContainer$1 = isCaretContainer;
- var isCaretCandidate = function (node) {
- if (isCaretContainer$1(node)) {
- return false;
- }
- if (isText$3(node)) {
- if (isInvalidTextElement(node.parentNode)) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return null;
+ };
+ var isInSameBlock = function (caretPosition1, caretPosition2, rootNode) {
+ return getParentBlock(caretPosition1.container(), rootNode) === getParentBlock(caretPosition2.container(), rootNode);
+ };
+ var getChildNodeAtRelativeOffset = function (relativeOffset, caretPosition) {
+ var container, offset;
+ if (!caretPosition) {
+ return 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 true;
- }
- return isAtomicInline(node) || isBr$2(node) || isTable$1(node) || isNonUiContentEditableFalse(node);
- };
- var isUnselectable = function (node) {
- return $_3b9u2y1rjjgwe7qe.isElement(node) && node.getAttribute('unselectable') === 'true';
- };
- var isNonUiContentEditableFalse = function (node) {
- return isUnselectable(node) === false && isContentEditableFalse$1(node);
- };
- var isInEditable = function (node, root) {
- for (node = node.parentNode; node && node !== root; node = node.parentNode) {
- if (isNonUiContentEditableFalse(node)) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ container = caretPosition.container();
+ offset = caretPosition.offset();
+ if (!isElement$5(container)) {
+ return 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 (isContentEditableTrue$1(node)) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return container.childNodes[offset + relativeOffset];
+ };
+ var beforeAfter = function (before, node) {
+ var range = node.ownerDocument.createRange();
+ if (before) {
+ range.setStartBefore(node);
+ range.setEndBefore(node);
+ } else {
+ range.setStartAfter(node);
+ range.setEndAfter(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 true;
- };
- var isAtomicContentEditableFalse = function (node) {
- if (!isNonUiContentEditableFalse(node)) {
- return false;
- }
- return $_6t4axrmjjgwe7jf.reduce(node.getElementsByTagName('*'), function (result, elm) {
- return result || isContentEditableTrue$1(elm);
- }, false) !== true;
- };
- var isAtomic = function (node) {
- return isAtomicInline(node) || isAtomicContentEditableFalse(node);
- };
- var isEditableCaretCandidate = function (node, root) {
- return isCaretCandidate(node) && isInEditable(node, root);
- };
-
- var round = Math.round;
- var clone$2 = function (rect) {
- if (!rect) {
- return {
- left: 0,
- top: 0,
- bottom: 0,
- right: 0,
- width: 0,
- height: 0
- };
- }
- return {
- left: round(rect.left),
- top: round(rect.top),
- bottom: round(rect.bottom),
- right: round(rect.right),
- width: round(rect.width),
- height: round(rect.height)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return range;
</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 collapse = function (rect, toStart) {
- rect = clone$2(rect);
- if (toStart) {
- rect.right = rect.left;
- } else {
- rect.left = rect.left + rect.width;
- rect.right = rect.left;
- }
- rect.width = 0;
- return rect;
- };
- var isEqual = function (rect1, rect2) {
- return rect1.left === rect2.left && rect1.top === rect2.top && rect1.bottom === rect2.bottom && rect1.right === rect2.right;
- };
- var isValidOverflow = function (overflowY, rect1, rect2) {
- return overflowY >= 0 && overflowY <= Math.min(rect1.height, rect2.height) / 2;
- };
- var isAbove = function (rect1, rect2) {
- if (rect1.bottom - rect1.height / 2 < rect2.top) {
- return true;
- }
- if (rect1.top > rect2.bottom) {
- return false;
- }
- return isValidOverflow(rect2.top - rect1.bottom, rect1, rect2);
- };
- var isBelow = function (rect1, rect2) {
- if (rect1.top > rect2.bottom) {
- return true;
- }
- if (rect1.bottom < rect2.top) {
- return false;
- }
- return isValidOverflow(rect2.bottom - rect1.top, rect1, rect2);
- };
- var containsXY = function (rect, clientX, clientY) {
- return clientX >= rect.left && clientX <= rect.right && clientY >= rect.top && clientY <= rect.bottom;
- };
- var overflowX = function (outer, inner) {
- if (inner.left > outer.left && inner.right < outer.right) {
- return 0;
- } else {
- return inner.left < outer.left ? inner.left - outer.left : inner.right - outer.right;
- }
- };
- var overflowY = function (outer, inner) {
- if (inner.top > outer.top && inner.bottom < outer.bottom) {
- return 0;
- } else {
- return inner.top < outer.top ? inner.top - outer.top : inner.bottom - outer.bottom;
- }
- };
- var getOverflow = function (outer, inner) {
- return {
- x: overflowX(outer, inner),
- y: overflowY(outer, inner)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isNodesInSameBlock = function (root, node1, node2) {
+ return getParentBlock(node1, root) === getParentBlock(node2, root);
</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 getSelectedNode = function (range) {
- var startContainer = range.startContainer, startOffset = range.startOffset;
- if (startContainer.hasChildNodes() && range.endOffset === startOffset + 1) {
- return startContainer.childNodes[startOffset];
- }
- return null;
- };
- var getNode = function (container, offset) {
- if (container.nodeType === 1 && container.hasChildNodes()) {
- if (offset >= container.childNodes.length) {
- offset = container.childNodes.length - 1;
- }
- container = container.childNodes[offset];
- }
- return container;
- };
-
- var extendingChars = new RegExp('[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a' + '\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0' + '\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08E3-\u0902\u093a\u093c' + '\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3' + '\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc' + '\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57' + '\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56' + '\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44' + '\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\
u0eb4-\u0eb9' + '\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97' + '\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074' + '\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5' + '\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18' + '\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1ABE\u1b00-\u1b03\u1b34' + '\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9' + '\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9' + '\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20DD-\u20E0\u20e1\u20E2-\u20E4\u20e5-\u20f0\u2cef-\u2cf1' + '\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua6
6f\uA670-\uA672\ua674-\ua67d\uA69E-\ua69f\ua6f0-\ua6f1' + '\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc' + '\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1' + '\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\uFE2F\uff9e-\uff9f]');
- var isExtendingChar = function (ch) {
- return typeof ch === 'string' && ch.charCodeAt(0) >= 768 && extendingChars.test(ch);
- };
-
- var liftN = function (arr, f) {
- var r = [];
- for (var i = 0; i < arr.length; i++) {
- var x = arr[i];
- if (x.isSome()) {
- r.push(x.getOrDie());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var lean = function (left, root, node) {
+ var sibling, siblingName;
+ if (left) {
+ siblingName = 'previousSibling';
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return Option.none();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ siblingName = '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">- }
- return Option.some(f.apply(null, r));
- };
-
- var isElement$3 = $_3b9u2y1rjjgwe7qe.isElement;
- var isCaretCandidate$1 = isCaretCandidate;
- var isBlock$1 = $_3b9u2y1rjjgwe7qe.matchStyleValues('display', 'block table');
- var isFloated = $_3b9u2y1rjjgwe7qe.matchStyleValues('float', 'left right');
- var isValidElementCaretCandidate = $_4127e12ljjgwe7ww.and(isElement$3, isCaretCandidate$1, $_4127e12ljjgwe7ww.negate(isFloated));
- var isNotPre = $_4127e12ljjgwe7ww.negate($_3b9u2y1rjjgwe7qe.matchStyleValues('white-space', 'pre pre-line pre-wrap'));
- var isText$4 = $_3b9u2y1rjjgwe7qe.isText;
- var isBr$3 = $_3b9u2y1rjjgwe7qe.isBr;
- var nodeIndex = DOMUtils$1.nodeIndex;
- var resolveIndex = getNode;
- var createRange = function (doc) {
- return 'createRange' in doc ? doc.createRange() : DOMUtils$1.DOM.createRng();
- };
- var isWhiteSpace = function (chr) {
- return chr && /[\r\n\t ]/.test(chr);
- };
- var isRange = function (rng) {
- return !!rng.setStart && !!rng.setEnd;
- };
- var isHiddenWhiteSpaceRange = function (range$$1) {
- var container = range$$1.startContainer;
- var offset = range$$1.startOffset;
- var text;
- if (isWhiteSpace(range$$1.toString()) && isNotPre(container.parentNode) && $_3b9u2y1rjjgwe7qe.isText(container)) {
- text = container.data;
- if (isWhiteSpace(text[offset - 1]) || isWhiteSpace(text[offset + 1])) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ while (node && node !== root) {
+ sibling = node[siblingName];
+ if (isCaretContainer$2(sibling)) {
+ sibling = sibling[siblingName];
+ }
+ if (isContentEditableFalse$4(sibling)) {
+ if (isNodesInSameBlock(root, sibling, node)) {
+ return sibling;
+ }
+ break;
+ }
+ if (isCaretCandidate$2(sibling)) {
+ break;
+ }
+ 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">- }
- return false;
- };
- var getBrClientRect = function (brNode) {
- var doc = brNode.ownerDocument;
- var rng = createRange(doc);
- var nbsp = doc.createTextNode('\xA0');
- var parentNode = brNode.parentNode;
- var clientRect;
- parentNode.insertBefore(nbsp, brNode);
- rng.setStart(nbsp, 0);
- rng.setEnd(nbsp, 1);
- clientRect = clone$2(rng.getBoundingClientRect());
- parentNode.removeChild(nbsp);
- return clientRect;
- };
- var getBoundingClientRectWebKitText = function (rng) {
- var sc = rng.startContainer;
- var ec = rng.endContainer;
- var so = rng.startOffset;
- var eo = rng.endOffset;
- if (sc === ec && $_3b9u2y1rjjgwe7qe.isText(ec) && so === 0 && eo === 1) {
- var newRng = rng.cloneRange();
- newRng.setEndAfter(ec);
- return getBoundingClientRect(newRng);
- } else {
</del><span class="cx" style="display: block; padding: 0 10px"> return null;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- };
- var isZeroRect = function (r) {
- return r.left === 0 && r.right === 0 && r.top === 0 && r.bottom === 0;
- };
- var getBoundingClientRect = function (item) {
- var clientRect, clientRects;
- clientRects = item.getClientRects();
- if (clientRects.length > 0) {
- clientRect = clone$2(clientRects[0]);
- } else {
- clientRect = clone$2(item.getBoundingClientRect());
- }
- if (!isRange(item) && isBr$3(item) && isZeroRect(clientRect)) {
- return getBrClientRect(item);
- }
- if (isZeroRect(clientRect) && isRange(item)) {
- return getBoundingClientRectWebKitText(item);
- }
- return clientRect;
- };
- var collapseAndInflateWidth = function (clientRect, toStart) {
- var newClientRect = collapse(clientRect, toStart);
- newClientRect.width = 1;
- newClientRect.right = newClientRect.left + 1;
- return newClientRect;
- };
- var getCaretPositionClientRects = function (caretPosition) {
- var clientRects = [];
- var beforeNode, node;
- var addUniqueAndValidRect = function (clientRect) {
- if (clientRect.height === 0) {
- return;
- }
- if (clientRects.length > 0) {
- if (isEqual(clientRect, clientRects[clientRects.length - 1])) {
- return;
- }
- }
- clientRects.push(clientRect);
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var addCharacterOffset = function (container, offset) {
- var range$$1 = createRange(container.ownerDocument);
- if (offset < container.data.length) {
- if (isExtendingChar(container.data[offset])) {
- return clientRects;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var before$2 = curry(beforeAfter, true);
+ var after$2 = curry(beforeAfter, false);
+ var normalizeRange = function (direction, root, range) {
+ var node, container, offset, location;
+ var leanLeft = curry(lean, true, root);
+ var leanRight = curry(lean, false, root);
+ container = range.startContainer;
+ offset = range.startOffset;
+ if (isCaretContainerBlock(container)) {
+ if (!isElement$5(container)) {
+ 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">- if (isExtendingChar(container.data[offset - 1])) {
- range$$1.setStart(container, offset);
- range$$1.setEnd(container, offset + 1);
- if (!isHiddenWhiteSpaceRange(range$$1)) {
- addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(range$$1), false));
- return clientRects;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ location = container.getAttribute('data-mce-caret');
+ if (location === 'before') {
+ node = container.nextSibling;
+ if (isFakeCaretTarget(node)) {
+ return before$2(node);
</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">- }
- if (offset > 0) {
- range$$1.setStart(container, offset - 1);
- range$$1.setEnd(container, offset);
- if (!isHiddenWhiteSpaceRange(range$$1)) {
- addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(range$$1), false));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (location === 'after') {
+ node = container.previousSibling;
+ if (isFakeCaretTarget(node)) {
+ return after$2(node);
+ }
</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">- if (offset < container.data.length) {
- range$$1.setStart(container, offset);
- range$$1.setEnd(container, offset + 1);
- if (!isHiddenWhiteSpaceRange(range$$1)) {
- addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(range$$1), true));
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!range.collapsed) {
+ return range;
</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 (isText$4(caretPosition.container())) {
- addCharacterOffset(caretPosition.container(), caretPosition.offset());
- return clientRects;
- }
- if (isElement$3(caretPosition.container())) {
- if (caretPosition.isAtEnd()) {
- node = resolveIndex(caretPosition.container(), caretPosition.offset());
- if (isText$4(node)) {
- addCharacterOffset(node, node.data.length);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (NodeType.isText(container)) {
+ if (isCaretContainer$2(container)) {
+ if (direction === 1) {
+ node = leanRight(container);
+ if (node) {
+ return before$2(node);
+ }
+ node = leanLeft(container);
+ if (node) {
+ return after$2(node);
+ }
+ }
+ if (direction === -1) {
+ node = leanLeft(container);
+ if (node) {
+ return after$2(node);
+ }
+ node = leanRight(container);
+ if (node) {
+ return before$2(node);
+ }
+ }
+ return range;
</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 (isValidElementCaretCandidate(node) && !isBr$3(node)) {
- addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(node), false));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (endsWithCaretContainer(container) && offset >= container.data.length - 1) {
+ if (direction === 1) {
+ node = leanRight(container);
+ if (node) {
+ return before$2(node);
+ }
+ }
+ return range;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- node = resolveIndex(caretPosition.container(), caretPosition.offset());
- if (isText$4(node)) {
- addCharacterOffset(node, 0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (startsWithCaretContainer(container) && offset <= 1) {
+ if (direction === -1) {
+ node = leanLeft(container);
+ if (node) {
+ return after$2(node);
+ }
+ }
+ return range;
</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 (isValidElementCaretCandidate(node) && caretPosition.isAtEnd()) {
- addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(node), false));
- return clientRects;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (offset === container.data.length) {
+ node = leanRight(container);
+ if (node) {
+ return before$2(node);
+ }
+ return range;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- beforeNode = resolveIndex(caretPosition.container(), caretPosition.offset() - 1);
- if (isValidElementCaretCandidate(beforeNode) && !isBr$3(beforeNode)) {
- if (isBlock$1(beforeNode) || isBlock$1(node) || !isValidElementCaretCandidate(node)) {
- addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(beforeNode), false));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (offset === 0) {
+ node = leanLeft(container);
+ if (node) {
+ return after$2(node);
</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 range;
</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 (isValidElementCaretCandidate(node)) {
- addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(node), true));
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- return clientRects;
- };
- function CaretPosition(container, offset, clientRects) {
- var isAtStart = function () {
- if (isText$4(container)) {
- return offset === 0;
- }
- return offset === 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return range;
</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 isAtEnd = function () {
- if (isText$4(container)) {
- return offset >= container.data.length;
- }
- return offset >= container.childNodes.length;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isNextToContentEditableFalse = function (relativeOffset, caretPosition) {
+ var node = getChildNodeAtRelativeOffset(relativeOffset, caretPosition);
+ return isContentEditableFalse$4(node) && !NodeType.isBogusAll(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 toRange = function () {
- var range$$1;
- range$$1 = createRange(container.ownerDocument);
- range$$1.setStart(container, offset);
- range$$1.setEnd(container, offset);
- return range$$1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isNextToTable = function (relativeOffset, caretPosition) {
+ return NodeType.isTable(getChildNodeAtRelativeOffset(relativeOffset, caretPosition));
</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 getClientRects = function () {
- if (!clientRects) {
- clientRects = getCaretPositionClientRects(CaretPosition(container, offset));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getRelativeCefElm = function (forward, caretPosition) {
+ return Option.from(getChildNodeAtRelativeOffset(forward ? 0 : -1, caretPosition)).filter(isContentEditableFalse$4);
+ };
+ var getNormalizedRangeEndPoint = function (direction, root, range) {
+ var normalizedRange = normalizeRange(direction, root, range);
+ if (direction === -1) {
+ return CaretPosition.fromRangeStart(normalizedRange);
</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 clientRects;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return CaretPosition.fromRangeEnd(normalizedRange);
</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 isVisible = function () {
- return getClientRects().length > 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isBeforeContentEditableFalse = curry(isNextToContentEditableFalse, 0);
+ var isAfterContentEditableFalse = curry(isNextToContentEditableFalse, -1);
+ var isBeforeTable = curry(isNextToTable, 0);
+ var isAfterTable = curry(isNextToTable, -1);
+ var isChar = function (forward, predicate, pos) {
+ return Option.from(pos.container()).filter(NodeType.isText).exists(function (text) {
+ var delta = forward ? 0 : -1;
+ return predicate(text.data.charAt(pos.offset() + delta));
+ });
</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 isEqual$$1 = function (caretPosition) {
- return caretPosition && container === caretPosition.container() && offset === caretPosition.offset();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isBeforeSpace = curry(isChar, true, isWhiteSpace$1);
+ var isAfterSpace = curry(isChar, false, isWhiteSpace$1);
+ var getElementFromPosition = function (pos) {
+ return Option.from(pos.getNode()).map(Element$$1.fromDom);
</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 getNode$$1 = function (before) {
- return resolveIndex(container, before ? offset - 1 : offset);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getElementFromPrevPosition = function (pos) {
+ return Option.from(pos.getNode(true)).map(Element$$1.fromDom);
</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: $_4127e12ljjgwe7ww.constant(container),
- offset: $_4127e12ljjgwe7ww.constant(offset),
- toRange: toRange,
- getClientRects: getClientRects,
- isVisible: isVisible,
- isAtStart: isAtStart,
- isAtEnd: isAtEnd,
- isEqual: isEqual$$1,
- getNode: getNode$$1
- };
- }
- (function (CaretPosition) {
- CaretPosition.fromRangeStart = function (range$$1) {
- return CaretPosition(range$$1.startContainer, range$$1.startOffset);
- };
- CaretPosition.fromRangeEnd = function (range$$1) {
- return CaretPosition(range$$1.endContainer, range$$1.endOffset);
- };
- CaretPosition.after = function (node) {
- return CaretPosition(node.parentNode, nodeIndex(node) + 1);
- };
- CaretPosition.before = function (node) {
- return CaretPosition(node.parentNode, nodeIndex(node));
- };
- CaretPosition.isAbove = function (pos1, pos2) {
- return liftN([
- head(pos2.getClientRects()),
- last(pos1.getClientRects())
- ], isAbove).getOr(false);
- };
- CaretPosition.isBelow = function (pos1, pos2) {
- return liftN([
- last(pos2.getClientRects()),
- head(pos1.getClientRects())
- ], isBelow).getOr(false);
- };
- CaretPosition.isAtStart = function (pos) {
- return pos ? pos.isAtStart() : false;
- };
- CaretPosition.isAtEnd = function (pos) {
- return pos ? pos.isAtEnd() : false;
- };
- CaretPosition.isTextPosition = function (pos) {
- return pos ? $_3b9u2y1rjjgwe7qe.isText(pos.container()) : false;
- };
- CaretPosition.isElementPosition = function (pos) {
- return CaretPosition.isTextPosition(pos) === false;
- };
- }(CaretPosition || (CaretPosition = {})));
- var CaretPosition$1 = CaretPosition;
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var isText$5 = $_3b9u2y1rjjgwe7qe.isText;
- var isBogus$1 = $_3b9u2y1rjjgwe7qe.isBogus;
- var nodeIndex$1 = DOMUtils$1.nodeIndex;
- var normalizedParent = function (node) {
- var parentNode = node.parentNode;
- if (isBogus$1(parentNode)) {
- return normalizedParent(parentNode);
- }
- return parentNode;
- };
- var getChildNodes = function (node) {
- if (!node) {
- return [];
- }
- return $_6t4axrmjjgwe7jf.reduce(node.childNodes, function (result, node) {
- if (isBogus$1(node) && node.nodeName !== 'BR') {
- result = result.concat(getChildNodes(node));
- } else {
- result.push(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var HDirection;
+ (function (HDirection) {
+ HDirection[HDirection['Backwards'] = -1] = 'Backwards';
+ HDirection[HDirection['Forwards'] = 1] = 'Forwards';
+ }(HDirection || (HDirection = {})));
+ var isContentEditableFalse$5 = NodeType.isContentEditableFalse;
+ var isText$7 = NodeType.isText;
+ var isElement$6 = NodeType.isElement;
+ var isBr$4 = NodeType.isBr;
+ var isCaretCandidate$3 = isCaretCandidate;
+ var isAtomic$1 = isAtomic;
+ var isEditableCaretCandidate$1 = isEditableCaretCandidate;
+ var getParents = function (node, root) {
+ var parents = [];
+ while (node && node !== root) {
+ parents.push(node);
+ 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">- return result;
- }, []);
- };
- var normalizedTextOffset = function (node, offset) {
- while (node = node.previousSibling) {
- if (!isText$5(node)) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return parents;
+ };
+ var nodeAtIndex = function (container, offset) {
+ if (container.hasChildNodes() && offset < container.childNodes.length) {
+ return container.childNodes[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">- offset += node.data.length;
- }
- return offset;
- };
- var equal$1 = function (a) {
- return function (b) {
- return a === b;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- };
- var normalizedNodeIndex = function (node) {
- var nodes, index, numTextFragments;
- nodes = getChildNodes(normalizedParent(node));
- index = $_6t4axrmjjgwe7jf.findIndex(nodes, equal$1(node), node);
- nodes = nodes.slice(0, index + 1);
- numTextFragments = $_6t4axrmjjgwe7jf.reduce(nodes, function (result, node, i) {
- if (isText$5(node) && isText$5(nodes[i - 1])) {
- result++;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getCaretCandidatePosition = function (direction, node) {
+ if (isForwards(direction)) {
+ if (isCaretCandidate$3(node.previousSibling) && !isText$7(node.previousSibling)) {
+ return CaretPosition$1.before(node);
+ }
+ if (isText$7(node)) {
+ return CaretPosition$1(node, 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">- return result;
- }, 0);
- nodes = $_6t4axrmjjgwe7jf.filter(nodes, $_3b9u2y1rjjgwe7qe.matchNodeNames(node.nodeName));
- index = $_6t4axrmjjgwe7jf.findIndex(nodes, equal$1(node), node);
- return index - numTextFragments;
- };
- var createPathItem = function (node) {
- var name;
- if (isText$5(node)) {
- name = 'text()';
- } else {
- name = node.nodeName.toLowerCase();
- }
- return name + '[' + normalizedNodeIndex(node) + ']';
- };
- var parentsUntil = function (root, node, predicate) {
- var parents = [];
- for (node = node.parentNode; node !== root; node = node.parentNode) {
- if (predicate && predicate(node)) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isBackwards(direction)) {
+ if (isCaretCandidate$3(node.nextSibling) && !isText$7(node.nextSibling)) {
+ return CaretPosition$1.after(node);
+ }
+ if (isText$7(node)) {
+ return CaretPosition$1(node, node.data.length);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- parents.push(node);
- }
- return parents;
- };
- var create$2 = function (root, caretPosition) {
- var container, offset, path = [], outputOffset, childNodes, parents;
- container = caretPosition.container();
- offset = caretPosition.offset();
- if (isText$5(container)) {
- outputOffset = normalizedTextOffset(container, offset);
- } else {
- childNodes = container.childNodes;
- if (offset >= childNodes.length) {
- outputOffset = 'after';
- offset = childNodes.length - 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isBackwards(direction)) {
+ if (isBr$4(node)) {
+ return CaretPosition$1.before(node);
+ }
+ return CaretPosition$1.after(node);
+ }
+ return CaretPosition$1.before(node);
+ };
+ var moveForwardFromBr = function (root, nextNode) {
+ var nextSibling = nextNode.nextSibling;
+ if (nextSibling && isCaretCandidate$3(nextSibling)) {
+ if (isText$7(nextSibling)) {
+ return CaretPosition$1(nextSibling, 0);
+ } else {
+ return CaretPosition$1.before(nextSibling);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- outputOffset = 'before';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return findCaretPosition(HDirection.Forwards, CaretPosition$1.after(nextNode), root);
</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 = childNodes[offset];
- }
- path.push(createPathItem(container));
- parents = parentsUntil(root, container);
- parents = $_6t4axrmjjgwe7jf.filter(parents, $_4127e12ljjgwe7ww.negate($_3b9u2y1rjjgwe7qe.isBogus));
- path = path.concat($_6t4axrmjjgwe7jf.map(parents, function (node) {
- return createPathItem(node);
- }));
- return path.reverse().join('/') + ',' + outputOffset;
- };
- var resolvePathItem = function (node, name, index) {
- var nodes = getChildNodes(node);
- nodes = $_6t4axrmjjgwe7jf.filter(nodes, function (node, index) {
- return !isText$5(node) || !isText$5(nodes[index - 1]);
- });
- nodes = $_6t4axrmjjgwe7jf.filter(nodes, $_3b9u2y1rjjgwe7qe.matchNodeNames(name));
- return nodes[index];
- };
- var findTextPosition = function (container, offset) {
- var node = container, targetOffset = 0, dataLen;
- while (isText$5(node)) {
- dataLen = node.data.length;
- if (offset >= targetOffset && offset <= targetOffset + dataLen) {
- container = node;
- offset = offset - targetOffset;
- break;
- }
- if (!isText$5(node.nextSibling)) {
- container = node;
- offset = dataLen;
- break;
- }
- targetOffset += dataLen;
- node = node.nextSibling;
- }
- if (isText$5(container) && offset > container.data.length) {
- offset = container.data.length;
- }
- return CaretPosition$1(container, offset);
- };
- var resolve$2 = function (root, path) {
- var parts, container, offset;
- if (!path) {
- return null;
- }
- parts = path.split(',');
- path = parts[0].split('/');
- offset = parts.length > 1 ? parts[1] : 'before';
- container = $_6t4axrmjjgwe7jf.reduce(path, function (result, value) {
- value = /([\w\-\(\)]+)\[([0-9]+)\]/.exec(value);
- if (!value) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var findCaretPosition = function (direction, startPos, root) {
+ var node, nextNode, innerNode;
+ var rootContentEditableFalseElm, caretPosition;
+ if (!isElement$6(root) || !startPos) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return null;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (value[1] === 'text()') {
- value[1] = '#text';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (startPos.isEqual(CaretPosition$1.after(root)) && root.lastChild) {
+ caretPosition = CaretPosition$1.after(root.lastChild);
+ if (isBackwards(direction) && isCaretCandidate$3(root.lastChild) && isElement$6(root.lastChild)) {
+ return isBr$4(root.lastChild) ? CaretPosition$1.before(root.lastChild) : caretPosition;
+ }
+ } else {
+ caretPosition = startPos;
</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 resolvePathItem(result, value[1], parseInt(value[2], 10));
- }, root);
- if (!container) {
- return null;
- }
- if (!isText$5(container)) {
- if (offset === 'after') {
- offset = nodeIndex$1(container) + 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var container = caretPosition.container();
+ var offset = caretPosition.offset();
+ if (isText$7(container)) {
+ if (isBackwards(direction) && offset > 0) {
+ return CaretPosition$1(container, --offset);
+ }
+ if (isForwards(direction) && offset < container.length) {
+ return CaretPosition$1(container, ++offset);
+ }
+ node = container;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- offset = nodeIndex$1(container);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isBackwards(direction) && offset > 0) {
+ nextNode = nodeAtIndex(container, offset - 1);
+ if (isCaretCandidate$3(nextNode)) {
+ if (!isAtomic$1(nextNode)) {
+ innerNode = findNode(nextNode, direction, isEditableCaretCandidate$1, nextNode);
+ if (innerNode) {
+ if (isText$7(innerNode)) {
+ return CaretPosition$1(innerNode, innerNode.data.length);
+ }
+ return CaretPosition$1.after(innerNode);
+ }
+ }
+ if (isText$7(nextNode)) {
+ return CaretPosition$1(nextNode, nextNode.data.length);
+ }
+ return CaretPosition$1.before(nextNode);
+ }
+ }
+ if (isForwards(direction) && offset < container.childNodes.length) {
+ nextNode = nodeAtIndex(container, offset);
+ if (isCaretCandidate$3(nextNode)) {
+ if (isBr$4(nextNode)) {
+ return moveForwardFromBr(root, nextNode);
+ }
+ if (!isAtomic$1(nextNode)) {
+ innerNode = findNode(nextNode, direction, isEditableCaretCandidate$1, nextNode);
+ if (innerNode) {
+ if (isText$7(innerNode)) {
+ return CaretPosition$1(innerNode, 0);
+ }
+ return CaretPosition$1.before(innerNode);
+ }
+ }
+ if (isText$7(nextNode)) {
+ return CaretPosition$1(nextNode, 0);
+ }
+ return CaretPosition$1.after(nextNode);
+ }
+ }
+ node = nextNode ? nextNode : caretPosition.getNode();
</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 CaretPosition$1(container.parentNode, offset);
- }
- return findTextPosition(container, parseInt(offset, 10));
- };
-
- var isContentEditableFalse$2 = $_3b9u2y1rjjgwe7qe.isContentEditableFalse;
- var getNormalizedTextOffset = function (trim, container, offset) {
- var node, trimmedOffset;
- trimmedOffset = trim(container.data.slice(0, offset)).length;
- for (node = container.previousSibling; node && $_3b9u2y1rjjgwe7qe.isText(node); node = node.previousSibling) {
- trimmedOffset += trim(node.data).length;
- }
- return trimmedOffset;
- };
- var getPoint = function (dom, trim, normalized, rng, start) {
- var container = rng[start ? 'startContainer' : 'endContainer'];
- var offset = rng[start ? 'startOffset' : 'endOffset'];
- var point = [];
- var childNodes, after = 0;
- var root = dom.getRoot();
- if ($_3b9u2y1rjjgwe7qe.isText(container)) {
- point.push(normalized ? getNormalizedTextOffset(trim, container, offset) : offset);
- } else {
- childNodes = container.childNodes;
- if (offset >= childNodes.length && childNodes.length) {
- after = 1;
- offset = Math.max(0, childNodes.length - 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isForwards(direction) && caretPosition.isAtEnd() || isBackwards(direction) && caretPosition.isAtStart()) {
+ node = findNode(node, direction, constant(true), root, true);
+ if (isEditableCaretCandidate$1(node, root)) {
+ return getCaretCandidatePosition(direction, 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">- point.push(dom.nodeIndex(childNodes[offset], normalized) + after);
- }
- for (; container && container !== root; container = container.parentNode) {
- point.push(dom.nodeIndex(container, normalized));
- }
- return point;
- };
- var getLocation = function (trim, selection, normalized, rng) {
- var dom = selection.dom, bookmark = {};
- bookmark.start = getPoint(dom, trim, normalized, rng, true);
- if (!selection.isCollapsed()) {
- bookmark.end = getPoint(dom, trim, normalized, rng, false);
- }
- return bookmark;
- };
- var trimEmptyTextNode = function (node) {
- if ($_3b9u2y1rjjgwe7qe.isText(node) && node.data.length === 0) {
- node.parentNode.removeChild(node);
- }
- };
- var findIndex$3 = function (dom, name, element) {
- var count = 0;
- $_6cwiepljjgwe7j4.each(dom.select(name), function (node) {
- if (node.getAttribute('data-mce-bogus') === 'all') {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ nextNode = findNode(node, direction, isEditableCaretCandidate$1, root);
+ rootContentEditableFalseElm = ArrUtils.last(filter(getParents(container, root), isContentEditableFalse$5));
+ if (rootContentEditableFalseElm && (!nextNode || !rootContentEditableFalseElm.contains(nextNode))) {
+ if (isForwards(direction)) {
+ caretPosition = CaretPosition$1.after(rootContentEditableFalseElm);
+ } else {
+ caretPosition = CaretPosition$1.before(rootContentEditableFalseElm);
+ }
+ return caretPosition;
</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 === element) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (nextNode) {
+ return getCaretCandidatePosition(direction, nextNode);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- count++;
- });
- return count;
- };
- var moveEndPoint = function (rng, start) {
- var container, offset, childNodes;
- var prefix = start ? 'start' : 'end';
- container = rng[prefix + 'Container'];
- offset = rng[prefix + 'Offset'];
- if ($_3b9u2y1rjjgwe7qe.isElement(container) && container.nodeName === 'TR') {
- childNodes = container.childNodes;
- container = childNodes[Math.min(start ? offset : offset - 1, childNodes.length - 1)];
- if (container) {
- offset = start ? 0 : container.childNodes.length;
- rng['set' + (start ? 'Start' : 'End')](container, offset);
- }
- }
- };
- var normalizeTableCellSelection = function (rng) {
- moveEndPoint(rng, true);
- moveEndPoint(rng, false);
- return rng;
- };
- var findSibling = function (node, offset) {
- var sibling;
- if ($_3b9u2y1rjjgwe7qe.isElement(node)) {
- node = getNode(node, offset);
- if (isContentEditableFalse$2(node)) {
- return node;
- }
- }
- if (isCaretContainer(node)) {
- if ($_3b9u2y1rjjgwe7qe.isText(node) && isCaretContainerBlock(node)) {
- node = node.parentNode;
- }
- sibling = node.previousSibling;
- if (isContentEditableFalse$2(sibling)) {
- return sibling;
- }
- sibling = node.nextSibling;
- if (isContentEditableFalse$2(sibling)) {
- return sibling;
- }
- }
- };
- var findAdjacentContentEditableFalseElm = function (rng) {
- return findSibling(rng.startContainer, rng.startOffset) || findSibling(rng.endContainer, rng.endOffset);
- };
- var getOffsetBookmark = function (trim, normalized, selection) {
- var element = selection.getNode();
- var name = element ? element.nodeName : null;
- var rng = selection.getRng();
- if (isContentEditableFalse$2(element) || name === 'IMG') {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return null;
+ };
+ var CaretWalker = function (root) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- name: name,
- index: findIndex$3(selection.dom, name, element)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ next: function (caretPosition) {
+ return findCaretPosition(HDirection.Forwards, caretPosition, root);
+ },
+ prev: function (caretPosition) {
+ return findCaretPosition(HDirection.Backwards, caretPosition, root);
+ }
</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 sibling = findAdjacentContentEditableFalseElm(rng);
- if (sibling) {
- name = sibling.tagName;
- return {
- name: name,
- index: findIndex$3(selection.dom, name, sibling)
- };
- }
- return getLocation(trim, selection, normalized, rng);
- };
- var getCaretBookmark = function (selection) {
- var rng = selection.getRng();
- return {
- start: create$2(selection.dom.getRoot(), CaretPosition$1.fromRangeStart(rng)),
- end: create$2(selection.dom.getRoot(), CaretPosition$1.fromRangeEnd(rng))
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var getRangeBookmark = function (selection) {
- return { rng: selection.getRng() };
- };
- var createBookmarkSpan = function (dom, id, filled) {
- var args = {
- 'data-mce-type': 'bookmark',
- 'id': id,
- 'style': 'overflow:hidden;line-height:0px'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var walkToPositionIn = function (forward, root, start) {
+ var position = forward ? CaretPosition$1.before(start) : CaretPosition$1.after(start);
+ return fromPosition(forward, root, position);
</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 filled ? dom.create('span', args, '') : dom.create('span', args);
- };
- var getPersistentBookmark = function (selection, filled) {
- var dom = selection.dom;
- var rng = selection.getRng();
- var id = dom.uniqueId();
- var collapsed = selection.isCollapsed();
- var element = selection.getNode();
- var name = element.nodeName;
- if (name === 'IMG') {
- return {
- name: name,
- index: findIndex$3(dom, name, element)
- };
- }
- var rng2 = normalizeTableCellSelection(rng.cloneRange());
- if (!collapsed) {
- rng2.collapse(false);
- var endBookmarkNode = createBookmarkSpan(dom, id + '_end', filled);
- rng2.insertNode(endBookmarkNode);
- trimEmptyTextNode(endBookmarkNode.nextSibling);
- }
- rng = normalizeTableCellSelection(rng);
- rng.collapse(true);
- var startBookmarkNode = createBookmarkSpan(dom, id + '_start', filled);
- rng.insertNode(startBookmarkNode);
- trimEmptyTextNode(startBookmarkNode.previousSibling);
- selection.moveToBookmark({
- id: id,
- keep: 1
- });
- return { id: id };
- };
- var getBookmark = function (selection, type, normalized) {
- if (type === 2) {
- return getOffsetBookmark($_2xw7ul2pjjgwe7xs.trim, normalized, selection);
- } else if (type === 3) {
- return getCaretBookmark(selection);
- } else if (type) {
- return getRangeBookmark(selection);
- } else {
- return getPersistentBookmark(selection, false);
- }
- };
- var $_ga29lf2jjjgwe7wh = {
- getBookmark: getBookmark,
- getUndoBookmark: curry(getOffsetBookmark, identity, true),
- getPersistentBookmark: getPersistentBookmark
- };
-
- var CARET_ID = '_mce_caret';
- var isCaretNode = function (node) {
- return $_3b9u2y1rjjgwe7qe.isElement(node) && node.id === CARET_ID;
- };
- var getParentCaretContainer = function (body, node) {
- while (node && node !== body) {
- if (node.id === CARET_ID) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var afterElement = function (node) {
+ return NodeType.isBr(node) ? CaretPosition$1.before(node) : CaretPosition$1.after(node);
+ };
+ var isBeforeOrStart = function (position) {
+ if (CaretPosition$1.isTextPosition(position)) {
+ return position.offset() === 0;
+ } else {
+ return isCaretCandidate(position.getNode());
</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;
- }
- return null;
- };
-
- var isElement$4 = $_3b9u2y1rjjgwe7qe.isElement;
- var isText$6 = $_3b9u2y1rjjgwe7qe.isText;
- var removeNode = function (node) {
- var parentNode = node.parentNode;
- if (parentNode) {
- parentNode.removeChild(node);
- }
- };
- var getNodeValue = function (node) {
- try {
- return node.nodeValue;
- } catch (ex) {
- return '';
- }
- };
- var setNodeValue = function (node, text) {
- if (text.length === 0) {
- removeNode(node);
- } else {
- node.nodeValue = text;
- }
- };
- var trimCount = function (text) {
- var trimmedText = $_2xw7ul2pjjgwe7xs.trim(text);
- return {
- count: text.length - trimmedText.length,
- text: trimmedText
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var removeUnchanged = function (caretContainer, pos) {
- remove$7(caretContainer);
- return pos;
- };
- var removeTextAndReposition = function (caretContainer, pos) {
- var before = trimCount(caretContainer.data.substr(0, pos.offset()));
- var after = trimCount(caretContainer.data.substr(pos.offset()));
- var text = before.text + after.text;
- if (text.length > 0) {
- setNodeValue(caretContainer, text);
- return CaretPosition$1(caretContainer, pos.offset() - before.count);
- } else {
- return pos;
- }
- };
- var removeElementAndReposition = function (caretContainer, pos) {
- var parentNode = pos.container();
- var newPosition = indexOf(from$1(parentNode.childNodes), caretContainer).map(function (index) {
- return index < pos.offset() ? CaretPosition$1(parentNode, pos.offset() - 1) : pos;
- }).getOr(pos);
- remove$7(caretContainer);
- return newPosition;
- };
- var removeTextCaretContainer = function (caretContainer, pos) {
- return isText$6(caretContainer) && pos.container() === caretContainer ? removeTextAndReposition(caretContainer, pos) : removeUnchanged(caretContainer, pos);
- };
- var removeElementCaretContainer = function (caretContainer, pos) {
- return pos.container() === caretContainer.parentNode ? removeElementAndReposition(caretContainer, pos) : removeUnchanged(caretContainer, pos);
- };
- var removeAndReposition = function (container, pos) {
- return CaretPosition$1.isTextPosition(pos) ? removeTextCaretContainer(container, pos) : removeElementCaretContainer(container, pos);
- };
- var remove$7 = function (caretContainerNode) {
- if (isElement$4(caretContainerNode) && isCaretContainer(caretContainerNode)) {
- if (hasContent(caretContainerNode)) {
- caretContainerNode.removeAttribute('data-mce-caret');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isAfterOrEnd = function (position) {
+ if (CaretPosition$1.isTextPosition(position)) {
+ var container = position.container();
+ return position.offset() === container.data.length;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- removeNode(caretContainerNode);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return isCaretCandidate(position.getNode(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 (isText$6(caretContainerNode)) {
- var text = $_2xw7ul2pjjgwe7xs.trim(getNodeValue(caretContainerNode));
- setNodeValue(caretContainerNode, text);
- }
- };
- var $_cueauu31jjgwe7zy = {
- removeAndReposition: removeAndReposition,
- remove: remove$7
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var isBeforeAfterSameElement = function (from, to) {
+ return !CaretPosition$1.isTextPosition(from) && !CaretPosition$1.isTextPosition(to) && from.getNode() === to.getNode(true);
+ };
+ var isAtBr = function (position) {
+ return !CaretPosition$1.isTextPosition(position) && NodeType.isBr(position.getNode());
+ };
+ var shouldSkipPosition = function (forward, from, to) {
+ if (forward) {
+ return !isBeforeAfterSameElement(from, to) && !isAtBr(from) && isAfterOrEnd(from) && isBeforeOrStart(to);
+ } else {
+ return !isBeforeAfterSameElement(to, from) && isBeforeOrStart(from) && isAfterOrEnd(to);
+ }
+ };
+ var fromPosition = function (forward, root, pos) {
+ var walker = CaretWalker(root);
+ return Option.from(forward ? walker.next(pos) : walker.prev(pos));
+ };
+ var navigate = function (forward, root, from) {
+ return fromPosition(forward, root, from).bind(function (to) {
+ if (isInSameBlock(from, to, root) && shouldSkipPosition(forward, from, to)) {
+ return fromPosition(forward, root, to);
+ } else {
+ return Option.some(to);
+ }
+ });
+ };
+ var positionIn = function (forward, element) {
+ var startNode = forward ? element.firstChild : element.lastChild;
+ if (NodeType.isText(startNode)) {
+ return Option.some(CaretPosition$1(startNode, forward ? 0 : startNode.data.length));
+ } else if (startNode) {
+ if (isCaretCandidate(startNode)) {
+ return Option.some(forward ? CaretPosition$1.before(startNode) : afterElement(startNode));
+ } else {
+ return walkToPositionIn(forward, element, startNode);
+ }
+ } else {
+ return Option.none();
+ }
+ };
+ var nextPosition = curry(fromPosition, true);
+ var prevPosition = curry(fromPosition, false);
+ var CaretFinder = {
+ fromPosition: fromPosition,
+ nextPosition: nextPosition,
+ prevPosition: prevPosition,
+ navigate: navigate,
+ positionIn: positionIn,
+ firstPositionIn: curry(positionIn, true),
+ lastPositionIn: curry(positionIn, 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 isContentEditableTrue$2 = $_3b9u2y1rjjgwe7qe.isContentEditableTrue;
- var isContentEditableFalse$3 = $_3b9u2y1rjjgwe7qe.isContentEditableFalse;
- var showCaret = function (direction, editor, node, before, scrollIntoView) {
- return editor._selectionOverrides.showCaret(direction, node, before, scrollIntoView);
- };
- var getNodeRange = function (node) {
- var rng = node.ownerDocument.createRange();
- rng.selectNode(node);
- return rng;
- };
- var selectNode = function (editor, node) {
- var e = editor.fire('BeforeObjectSelected', { target: node });
- if (e.isDefaultPrevented()) {
- return null;
- }
- return getNodeRange(node);
- };
- var renderCaretAtRange = function (editor, range, scrollIntoView) {
- var normalizedRange = normalizeRange(1, editor.getBody(), range);
- var caretPosition = CaretPosition$1.fromRangeStart(normalizedRange);
- var caretPositionNode = caretPosition.getNode();
- if (isContentEditableFalse$3(caretPositionNode)) {
- return showCaret(1, editor, caretPositionNode, !caretPosition.isAtEnd(), false);
- }
- var caretPositionBeforeNode = caretPosition.getNode(true);
- if (isContentEditableFalse$3(caretPositionBeforeNode)) {
- return showCaret(1, editor, caretPositionBeforeNode, false, false);
- }
- var ceRoot = editor.dom.getParent(caretPosition.getNode(), function (node) {
- return isContentEditableFalse$3(node) || isContentEditableTrue$2(node);
- });
- if (isContentEditableFalse$3(ceRoot)) {
- return showCaret(1, editor, ceRoot, false, scrollIntoView);
- }
- return null;
- };
- var renderRangeCaret = function (editor, range, scrollIntoView) {
- if (!range || !range.collapsed) {
- return range;
- }
- var caretRange = renderCaretAtRange(editor, range, scrollIntoView);
- if (caretRange) {
- return caretRange;
- }
- return range;
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isStringPathBookmark = function (bookmark) {
+ return typeof bookmark.start === 'string';
+ };
+ var isRangeBookmark = function (bookmark) {
+ return bookmark.hasOwnProperty('rng');
+ };
+ var isIdBookmark = function (bookmark) {
+ return bookmark.hasOwnProperty('id');
+ };
+ var isIndexBookmark = function (bookmark) {
+ return bookmark.hasOwnProperty('name');
+ };
+ var isPathBookmark = function (bookmark) {
+ return Tools.isArray(bookmark.start);
+ };
</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 HDirection;
- (function (HDirection) {
- HDirection[HDirection['Backwards'] = -1] = 'Backwards';
- HDirection[HDirection['Forwards'] = 1] = 'Forwards';
- }(HDirection || (HDirection = {})));
- var isContentEditableFalse$4 = $_3b9u2y1rjjgwe7qe.isContentEditableFalse;
- var isText$7 = $_3b9u2y1rjjgwe7qe.isText;
- var isElement$5 = $_3b9u2y1rjjgwe7qe.isElement;
- var isBr$4 = $_3b9u2y1rjjgwe7qe.isBr;
- var isCaretCandidate$2 = isCaretCandidate;
- var isAtomic$1 = isAtomic;
- var isEditableCaretCandidate$1 = isEditableCaretCandidate;
- var getParents = function (node, root) {
- var parents = [];
- while (node && node !== root) {
- parents.push(node);
- node = node.parentNode;
- }
- return parents;
- };
- var nodeAtIndex = function (container, offset) {
- if (container.hasChildNodes() && offset < container.childNodes.length) {
- return container.childNodes[offset];
- }
- return null;
- };
- var getCaretCandidatePosition = function (direction, node) {
- if (isForwards(direction)) {
- if (isCaretCandidate$2(node.previousSibling) && !isText$7(node.previousSibling)) {
- return CaretPosition$1.before(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var addBogus = function (dom, node) {
+ if (dom.isBlock(node) && !node.innerHTML && !Env.ie) {
+ node.innerHTML = '<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">- if (isText$7(node)) {
- return CaretPosition$1(node, 0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return node;
+ };
+ var resolveCaretPositionBookmark = function (dom, bookmark) {
+ var rng, pos;
+ rng = dom.createRng();
+ pos = resolve$2(dom.getRoot(), bookmark.start);
+ rng.setStart(pos.container(), pos.offset());
+ pos = resolve$2(dom.getRoot(), bookmark.end);
+ rng.setEnd(pos.container(), pos.offset());
+ return rng;
+ };
+ var insertZwsp = function (node, rng) {
+ var textNode = node.ownerDocument.createTextNode(Zwsp.ZWSP);
+ node.appendChild(textNode);
+ rng.setStart(textNode, 0);
+ rng.setEnd(textNode, 0);
+ };
+ var isEmpty = function (node) {
+ return node.hasChildNodes() === false;
+ };
+ var tryFindRangePosition = function (node, rng) {
+ return CaretFinder.lastPositionIn(node).fold(function () {
+ return false;
+ }, function (pos) {
+ rng.setStart(pos.container(), pos.offset());
+ rng.setEnd(pos.container(), pos.offset());
+ return true;
+ });
+ };
+ var padEmptyCaretContainer = function (root, node, rng) {
+ if (isEmpty(node) && getParentCaretContainer(root, node)) {
+ insertZwsp(node, rng);
+ return true;
+ } else {
+ 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 (isBackwards(direction)) {
- if (isCaretCandidate$2(node.nextSibling) && !isText$7(node.nextSibling)) {
- return CaretPosition$1.after(node);
- }
- if (isText$7(node)) {
- return CaretPosition$1(node, node.data.length);
- }
- }
- if (isBackwards(direction)) {
- if (isBr$4(node)) {
- return CaretPosition$1.before(node);
- }
- return CaretPosition$1.after(node);
- }
- return CaretPosition$1.before(node);
- };
- var isBrBeforeBlock = function (node, root) {
- var next;
- if (!$_3b9u2y1rjjgwe7qe.isBr(node)) {
- return false;
- }
- next = findCaretPosition(1, CaretPosition$1.after(node), root);
- if (!next) {
- return false;
- }
- return !isInSameBlock(CaretPosition$1.before(node), CaretPosition$1.before(next), root);
- };
- var findCaretPosition = function (direction, startPos, root) {
- var node, nextNode, innerNode;
- var rootContentEditableFalseElm, caretPosition;
- if (!isElement$5(root) || !startPos) {
- return null;
- }
- if (startPos.isEqual(CaretPosition$1.after(root)) && root.lastChild) {
- caretPosition = CaretPosition$1.after(root.lastChild);
- if (isBackwards(direction) && isCaretCandidate$2(root.lastChild) && isElement$5(root.lastChild)) {
- return isBr$4(root.lastChild) ? CaretPosition$1.before(root.lastChild) : caretPosition;
- }
- } else {
- caretPosition = startPos;
- }
- var container = caretPosition.container();
- var offset = caretPosition.offset();
- if (isText$7(container)) {
- if (isBackwards(direction) && offset > 0) {
- return CaretPosition$1(container, --offset);
- }
- if (isForwards(direction) && offset < container.length) {
- return CaretPosition$1(container, ++offset);
- }
- node = container;
- } else {
- if (isBackwards(direction) && offset > 0) {
- nextNode = nodeAtIndex(container, offset - 1);
- if (isCaretCandidate$2(nextNode)) {
- if (!isAtomic$1(nextNode)) {
- innerNode = findNode(nextNode, direction, isEditableCaretCandidate$1, nextNode);
- if (innerNode) {
- if (isText$7(innerNode)) {
- return CaretPosition$1(innerNode, innerNode.data.length);
- }
- return CaretPosition$1.after(innerNode);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var setEndPoint = function (dom, start, bookmark, rng) {
+ var point = bookmark[start ? 'start' : 'end'];
+ var i, node, offset, children;
+ var root = dom.getRoot();
+ if (point) {
+ offset = point[0];
+ for (node = root, i = point.length - 1; i >= 1; i--) {
+ children = node.childNodes;
+ if (padEmptyCaretContainer(root, node, rng)) {
+ return true;
+ }
+ if (point[i] > children.length - 1) {
+ if (padEmptyCaretContainer(root, node, rng)) {
+ 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 tryFindRangePosition(node, 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">- if (isText$7(nextNode)) {
- return CaretPosition$1(nextNode, nextNode.data.length);
- }
- return CaretPosition$1.before(nextNode);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ node = children[point[i]];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (node.nodeType === 3) {
+ offset = Math.min(point[0], node.nodeValue.length);
+ }
+ if (node.nodeType === 1) {
+ offset = Math.min(point[0], node.childNodes.length);
+ }
+ if (start) {
+ rng.setStart(node, offset);
+ } else {
+ rng.setEnd(node, 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 (isForwards(direction) && offset < container.childNodes.length) {
- nextNode = nodeAtIndex(container, offset);
- if (isCaretCandidate$2(nextNode)) {
- if (isBr$4(nextNode) && root.lastChild === nextNode) {
- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return true;
+ };
+ var isValidTextNode = function (node) {
+ return NodeType.isText(node) && node.data.length > 0;
+ };
+ var restoreEndPoint = function (dom, suffix, bookmark) {
+ var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev;
+ var keep = bookmark.keep;
+ var container, offset;
+ if (marker) {
+ node = marker.parentNode;
+ if (suffix === 'start') {
+ if (!keep) {
+ idx = dom.nodeIndex(marker);
+ } else {
+ if (marker.hasChildNodes()) {
+ node = marker.firstChild;
+ idx = 1;
+ } else if (isValidTextNode(marker.nextSibling)) {
+ node = marker.nextSibling;
+ idx = 0;
+ } else if (isValidTextNode(marker.previousSibling)) {
+ node = marker.previousSibling;
+ idx = marker.previousSibling.data.length;
+ } else {
+ node = marker.parentNode;
+ idx = dom.nodeIndex(marker) + 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 (isBrBeforeBlock(nextNode, root)) {
- return findCaretPosition(direction, CaretPosition$1.after(nextNode), root);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ container = node;
+ offset = idx;
+ } else {
+ if (!keep) {
+ idx = dom.nodeIndex(marker);
+ } else {
+ if (marker.hasChildNodes()) {
+ node = marker.firstChild;
+ idx = 1;
+ } else if (isValidTextNode(marker.previousSibling)) {
+ node = marker.previousSibling;
+ idx = marker.previousSibling.data.length;
+ } else {
+ node = marker.parentNode;
+ idx = dom.nodeIndex(marker);
+ }
</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 (!isAtomic$1(nextNode)) {
- innerNode = findNode(nextNode, direction, isEditableCaretCandidate$1, nextNode);
- if (innerNode) {
- if (isText$7(innerNode)) {
- return CaretPosition$1(innerNode, 0);
- }
- return CaretPosition$1.before(innerNode);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ container = node;
+ offset = idx;
+ }
+ if (!keep) {
+ prev = marker.previousSibling;
+ next = marker.nextSibling;
+ Tools.each(Tools.grep(marker.childNodes), function (node) {
+ if (NodeType.isText(node)) {
+ node.nodeValue = node.nodeValue.replace(/\uFEFF/g, '');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ while (marker = dom.get(bookmark.id + '_' + suffix)) {
+ dom.remove(marker, 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 (isText$7(nextNode)) {
- return CaretPosition$1(nextNode, 0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (prev && next && prev.nodeType === next.nodeType && NodeType.isText(prev) && !Env.opera) {
+ idx = prev.nodeValue.length;
+ prev.appendData(next.nodeValue);
+ dom.remove(next);
+ if (suffix === 'start') {
+ container = prev;
+ offset = idx;
+ } else {
+ container = prev;
+ offset = 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 CaretPosition$1.after(nextNode);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- node = nextNode ? nextNode : caretPosition.getNode();
- }
- if (isForwards(direction) && caretPosition.isAtEnd() || isBackwards(direction) && caretPosition.isAtStart()) {
- node = findNode(node, direction, $_4127e12ljjgwe7ww.constant(true), root, true);
- if (isEditableCaretCandidate$1(node, root)) {
- return getCaretCandidatePosition(direction, node);
- }
- }
- nextNode = findNode(node, direction, isEditableCaretCandidate$1, root);
- rootContentEditableFalseElm = $_6t4axrmjjgwe7jf.last($_6t4axrmjjgwe7jf.filter(getParents(container, root), isContentEditableFalse$4));
- if (rootContentEditableFalseElm && (!nextNode || !rootContentEditableFalseElm.contains(nextNode))) {
- if (isForwards(direction)) {
- caretPosition = CaretPosition$1.after(rootContentEditableFalseElm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Option.some(CaretPosition$1(container, offset));
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- caretPosition = CaretPosition$1.before(rootContentEditableFalseElm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Option.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">- return caretPosition;
- }
- if (nextNode) {
- return getCaretCandidatePosition(direction, nextNode);
- }
- return null;
- };
- var CaretWalker = function (root) {
- return {
- next: function (caretPosition) {
- return findCaretPosition(HDirection.Forwards, caretPosition, root);
- },
- prev: function (caretPosition) {
- return findCaretPosition(HDirection.Backwards, caretPosition, root);
- }
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
-
- var BreakType;
- (function (BreakType) {
- BreakType[BreakType['Br'] = 0] = 'Br';
- BreakType[BreakType['Block'] = 1] = 'Block';
- BreakType[BreakType['Wrap'] = 2] = 'Wrap';
- BreakType[BreakType['Eol'] = 3] = 'Eol';
- }(BreakType || (BreakType = {})));
- var flip = function (direction, positions) {
- return direction === HDirection.Backwards ? positions.reverse() : positions;
- };
- var walk$1 = function (direction, caretWalker, pos) {
- return direction === HDirection.Forwards ? caretWalker.next(pos) : caretWalker.prev(pos);
- };
- var getBreakType = function (scope, direction, currentPos, nextPos) {
- if ($_3b9u2y1rjjgwe7qe.isBr(nextPos.getNode(direction === HDirection.Forwards))) {
- return BreakType.Br;
- } else if (isInSameBlock(currentPos, nextPos) === false) {
- return BreakType.Block;
- } else {
- return BreakType.Wrap;
- }
- };
- var getPositionsUntil = function (predicate, direction, scope, start) {
- var caretWalker = CaretWalker(scope);
- var currentPos = start, nextPos;
- var positions = [];
- while (currentPos) {
- nextPos = walk$1(direction, caretWalker, currentPos);
- if (!nextPos) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var alt = function (o1, o2) {
+ return o1.isSome() ? o1 : o2;
+ };
+ var resolvePaths = function (dom, bookmark) {
+ var rng = dom.createRng();
+ if (setEndPoint(dom, true, bookmark, rng) && setEndPoint(dom, false, bookmark, rng)) {
+ return Option.some(rng);
+ } else {
+ return Option.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">- if ($_3b9u2y1rjjgwe7qe.isBr(nextPos.getNode(false))) {
- if (direction === HDirection.Forwards) {
- return {
- positions: flip(direction, positions).concat([nextPos]),
- breakType: BreakType.Br,
- breakAt: Option.some(nextPos)
- };
- } else {
- return {
- positions: flip(direction, positions),
- breakType: BreakType.Br,
- breakAt: Option.some(nextPos)
- };
- }
- }
- if (!nextPos.isVisible()) {
- currentPos = nextPos;
- continue;
- }
- if (predicate(currentPos, nextPos)) {
- var breakType = getBreakType(scope, direction, currentPos, nextPos);
- return {
- positions: flip(direction, positions),
- breakType: breakType,
- breakAt: Option.some(nextPos)
- };
- }
- positions.push(nextPos);
- currentPos = nextPos;
- }
- return {
- positions: flip(direction, positions),
- breakType: BreakType.Eol,
- breakAt: Option.none()
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var getAdjacentLinePositions = function (direction, getPositionsUntilBreak, scope, start) {
- return getPositionsUntilBreak(scope, start).breakAt.map(function (pos) {
- var positions = getPositionsUntilBreak(scope, pos).positions;
- return direction === HDirection.Backwards ? positions.concat(pos) : [pos].concat(positions);
- }).getOr([]);
- };
- var findClosestHorizontalPositionFromPoint = function (positions, x) {
- return foldl(positions, function (acc, newPos) {
- return acc.fold(function () {
- return Option.some(newPos);
- }, function (lastPos) {
- return liftN([
- head(lastPos.getClientRects()),
- head(newPos.getClientRects())
- ], function (lastRect, newRect) {
- var lastDist = Math.abs(x - lastRect.left);
- var newDist = Math.abs(x - newRect.left);
- return newDist <= lastDist ? newPos : lastPos;
- }).or(acc);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var resolveId = function (dom, bookmark) {
+ var startPos = restoreEndPoint(dom, 'start', bookmark);
+ var endPos = restoreEndPoint(dom, 'end', bookmark);
+ return liftN([
+ startPos,
+ alt(endPos, startPos)
+ ], function (spos, epos) {
+ var rng = dom.createRng();
+ rng.setStart(addBogus(dom, spos.container()), spos.offset());
+ rng.setEnd(addBogus(dom, epos.container()), epos.offset());
+ return 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">- }, Option.none());
- };
- var findClosestHorizontalPosition = function (positions, pos) {
- return head(pos.getClientRects()).bind(function (targetRect) {
- return findClosestHorizontalPositionFromPoint(positions, targetRect.left);
- });
- };
- var getPositionsUntilPreviousLine = curry(getPositionsUntil, CaretPosition.isAbove, -1);
- var getPositionsUntilNextLine = curry(getPositionsUntil, CaretPosition.isBelow, 1);
- var getPositionsAbove = curry(getAdjacentLinePositions, -1, getPositionsUntilPreviousLine);
- var getPositionsBelow = curry(getAdjacentLinePositions, 1, getPositionsUntilNextLine);
- var getFirstLinePositions = function (scope) {
- return $_8q1ver2yjjgwe7z3.firstPositionIn(scope).map(function (pos) {
- return [pos].concat(getPositionsUntilNextLine(scope, pos).positions);
- }).getOr([]);
- };
- var getLastLinePositions = function (scope) {
- return $_8q1ver2yjjgwe7z3.lastPositionIn(scope).map(function (pos) {
- return getPositionsUntilPreviousLine(scope, pos).positions.concat(pos);
- }).getOr([]);
- };
-
- var deflate = function (rect, delta) {
- return {
- left: rect.left - delta,
- top: rect.top - delta,
- right: rect.right + delta * 2,
- bottom: rect.bottom + delta * 2,
- width: rect.width + delta,
- height: rect.height + delta
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var getCorners = function (getYAxisValue, tds) {
- return bind(tds, function (td) {
- var rect = deflate(td.getBoundingClientRect(), -1);
- return [
- {
- x: rect.left,
- y: getYAxisValue(rect),
- cell: td
- },
- {
- x: rect.right,
- y: getYAxisValue(rect),
- cell: td
- }
- ];
- });
- };
- var findClosestCorner = function (corners, x, y) {
- return foldl(corners, function (acc, newCorner) {
- return acc.fold(function () {
- return Option.some(newCorner);
- }, function (oldCorner) {
- var oldDist = Math.sqrt(Math.abs(oldCorner.x - x) + Math.abs(oldCorner.y - y));
- var newDist = Math.sqrt(Math.abs(newCorner.x - x) + Math.abs(newCorner.y - y));
- return Option.some(newDist < oldDist ? newCorner : oldCorner);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var resolveIndex$1 = function (dom, bookmark) {
+ return Option.from(dom.select(bookmark.name)[bookmark.index]).map(function (elm) {
+ var rng = dom.createRng();
+ rng.selectNode(elm);
+ return 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">- }, Option.none());
- };
- var getClosestCell = function (getYAxisValue, isTargetCorner, table, x, y) {
- var cells = $_d3ydn427jjgwe7uf.descendants(Element$$1.fromDom(table), 'td,th').map(function (e) {
- return e.dom();
- });
- var corners = filter(getCorners(getYAxisValue, cells), function (corner) {
- return isTargetCorner(corner, y);
- });
- return findClosestCorner(corners, x, y).map(function (corner) {
- return corner.cell;
- });
- };
- var getBottomValue = function (rect) {
- return rect.bottom;
- };
- var getTopValue = function (rect) {
- return rect.top;
- };
- var isAbove$1 = function (corner, y) {
- return corner.y < y;
- };
- var isBelow$1 = function (corner, y) {
- return corner.y > y;
- };
- var getClosestCellAbove = curry(getClosestCell, getBottomValue, isAbove$1);
- var getClosestCellBelow = curry(getClosestCell, getTopValue, isBelow$1);
- var findClosestPositionInAboveCell = function (table, pos) {
- return head(pos.getClientRects()).bind(function (rect) {
- return getClosestCellAbove(table, rect.left, rect.top);
- }).bind(function (cell) {
- return findClosestHorizontalPosition(getLastLinePositions(cell), pos);
- });
- };
- var findClosestPositionInBelowCell = function (table, pos) {
- return last(pos.getClientRects()).bind(function (rect) {
- return getClosestCellBelow(table, rect.left, rect.top);
- }).bind(function (cell) {
- return findClosestHorizontalPosition(getFirstLinePositions(cell), pos);
- });
- };
-
- var getPos$1 = function (elm) {
- var x = 0, y = 0;
- var offsetParent = elm;
- while (offsetParent && offsetParent.nodeType) {
- x += offsetParent.offsetLeft || 0;
- y += offsetParent.offsetTop || 0;
- offsetParent = offsetParent.offsetParent;
- }
- return {
- x: x,
- y: y
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var fireScrollIntoViewEvent = function (editor, elm, alignToTop) {
- var scrollEvent = {
- elm: elm,
- alignToTop: alignToTop
- };
- editor.fire('scrollIntoView', scrollEvent);
- return scrollEvent.isDefaultPrevented();
- };
- var scrollElementIntoView = function (editor, elm, alignToTop) {
- var y, viewPort;
- var dom = editor.dom;
- var root = dom.getRoot();
- var viewPortY, viewPortH, offsetY = 0;
- if (fireScrollIntoViewEvent(editor, elm, alignToTop)) {
- return;
- }
- if (!$_3b9u2y1rjjgwe7qe.isElement(elm)) {
- return;
- }
- if (alignToTop === false) {
- offsetY = elm.offsetHeight;
- }
- if (root.nodeName !== 'BODY') {
- var scrollContainer = editor.selection.getScrollContainer();
- if (scrollContainer) {
- y = getPos$1(elm).y - getPos$1(scrollContainer).y + offsetY;
- viewPortH = scrollContainer.clientHeight;
- viewPortY = scrollContainer.scrollTop;
- if (y < viewPortY || y + 25 > viewPortY + viewPortH) {
- scrollContainer.scrollTop = y < viewPortY ? y : y - viewPortH + 25;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var resolve$3 = function (selection, bookmark) {
+ var dom = selection.dom;
+ if (bookmark) {
+ if (isPathBookmark(bookmark)) {
+ return resolvePaths(dom, bookmark);
+ } else if (isStringPathBookmark(bookmark)) {
+ return Option.some(resolveCaretPositionBookmark(dom, bookmark));
+ } else if (isIdBookmark(bookmark)) {
+ return resolveId(dom, bookmark);
+ } else if (isIndexBookmark(bookmark)) {
+ return resolveIndex$1(dom, bookmark);
+ } else if (isRangeBookmark(bookmark)) {
+ return Option.some(bookmark.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">- return;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- viewPort = dom.getViewPort(editor.getWin());
- y = dom.getPos(elm).y + offsetY;
- viewPortY = viewPort.y;
- viewPortH = viewPort.h;
- if (y < viewPort.y || y + 25 > viewPortY + viewPortH) {
- editor.getWin().scrollTo(0, y < viewPortY ? y : y - viewPortH + 25);
- }
- };
- var getViewPortRect = function (editor) {
- if (editor.inline) {
- return editor.getBody().getBoundingClientRect();
- } else {
- var win = editor.getWin();
- return {
- left: 0,
- right: win.innerWidth,
- top: 0,
- bottom: win.innerHeight,
- width: win.innerWidth,
- height: win.innerHeight
- };
- }
- };
- var scrollBy = function (editor, dx, dy) {
- if (editor.inline) {
- editor.getBody().scrollLeft += dx;
- editor.getBody().scrollTop += dy;
- } else {
- editor.getWin().scrollBy(dx, dy);
- }
- };
- var scrollRangeIntoView = function (editor, rng) {
- head(CaretPosition.fromRangeStart(rng).getClientRects()).each(function (rngRect) {
- var bodyRect = getViewPortRect(editor);
- var overflow = getOverflow(bodyRect, rngRect);
- var margin = 4;
- var dx = overflow.x > 0 ? overflow.x + margin : overflow.x - margin;
- var dy = overflow.y > 0 ? overflow.y + margin : overflow.y - margin;
- scrollBy(editor, overflow.x !== 0 ? dx : 0, overflow.y !== 0 ? dy : 0);
- });
- };
- var $_1mgvl137jjgwe825 = {
- scrollElementIntoView: scrollElementIntoView,
- scrollRangeIntoView: scrollRangeIntoView
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Option.none();
+ };
+ var ResolveBookmark = { resolve: resolve$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 getBodySetting = function (editor, name, defaultValue) {
- var value = editor.getParam(name, defaultValue);
- if (value.indexOf('=') !== -1) {
- var bodyObj = editor.getParam(name, '', 'hash');
- return bodyObj.hasOwnProperty(editor.id) ? bodyObj[editor.id] : defaultValue;
- } else {
- return value;
- }
- };
- var getIframeAttrs = function (editor) {
- return editor.getParam('iframe_attrs', {});
- };
- var getDocType = function (editor) {
- return editor.getParam('doctype', '<!DOCTYPE html>');
- };
- var getDocumentBaseUrl = function (editor) {
- return editor.getParam('document_base_url', '');
- };
- var getBodyId = function (editor) {
- return getBodySetting(editor, 'body_id', 'tinymce');
- };
- var getBodyClass = function (editor) {
- return getBodySetting(editor, 'body_class', '');
- };
- var getContentSecurityPolicy = function (editor) {
- return editor.getParam('content_security_policy', '');
- };
- var shouldPutBrInPre = function (editor) {
- return editor.getParam('br_in_pre', true);
- };
- var getForcedRootBlock = function (editor) {
- if (editor.getParam('force_p_newlines', false)) {
- return 'p';
- }
- var block = editor.getParam('forced_root_block', 'p');
- return block === false ? '' : block;
- };
- var getForcedRootBlockAttrs = function (editor) {
- return editor.getParam('forced_root_block_attrs', {});
- };
- var getBrNewLineSelector = function (editor) {
- return editor.getParam('br_newline_selector', '.mce-toc h2,figcaption,caption');
- };
- var getNoNewLineSelector = function (editor) {
- return editor.getParam('no_newline_selector', '');
- };
- var shouldKeepStyles = function (editor) {
- return editor.getParam('keep_styles', true);
- };
- var shouldEndContainerOnEmptyBlock = function (editor) {
- return editor.getParam('end_container_on_empty_block', false);
- };
- var getFontStyleValues = function (editor) {
- return $_6cwiepljjgwe7j4.explode(editor.getParam('font_size_style_values', ''));
- };
- var getFontSizeClasses = function (editor) {
- return $_6cwiepljjgwe7j4.explode(editor.getParam('font_size_classes', ''));
- };
- var $_259vs538jjgwe82a = {
- getIframeAttrs: getIframeAttrs,
- getDocType: getDocType,
- getDocumentBaseUrl: getDocumentBaseUrl,
- getBodyId: getBodyId,
- getBodyClass: getBodyClass,
- getContentSecurityPolicy: getContentSecurityPolicy,
- shouldPutBrInPre: shouldPutBrInPre,
- getForcedRootBlock: getForcedRootBlock,
- getForcedRootBlockAttrs: getForcedRootBlockAttrs,
- getBrNewLineSelector: getBrNewLineSelector,
- getNoNewLineSelector: getNoNewLineSelector,
- shouldKeepStyles: shouldKeepStyles,
- shouldEndContainerOnEmptyBlock: shouldEndContainerOnEmptyBlock,
- getFontStyleValues: getFontStyleValues,
- getFontSizeClasses: getFontSizeClasses
- };
-
- var browser$2 = $_7vg267ojjgwe7k0.detect().browser;
- var isFakeCaretTableBrowser = function () {
- return browser$2.isIE() || browser$2.isEdge() || browser$2.isFirefox();
- };
- var moveToRange = function (editor, rng) {
- editor.selection.setRng(rng);
- $_1mgvl137jjgwe825.scrollRangeIntoView(editor, rng);
- };
- var isAtTableCellLine = function (getPositionsUntil, scope, pos) {
- var lineInfo = getPositionsUntil(scope, pos);
- if (lineInfo.breakType === BreakType.Wrap && lineInfo.positions.length === 0) {
- return lineInfo.breakAt.map(function (breakPos) {
- return getPositionsUntil(scope, breakPos).breakAt.isNone();
- }).getOr(true);
- } else {
- return lineInfo.breakAt.isNone();
- }
- };
- var isAtFirstTableCellLine = $_4127e12ljjgwe7ww.curry(isAtTableCellLine, getPositionsUntilPreviousLine);
- var isAtLastTableCellLine = $_4127e12ljjgwe7ww.curry(isAtTableCellLine, getPositionsUntilNextLine);
- var isCaretAtStartOrEndOfTable = function (forward, rng, table) {
- var caretPos = CaretPosition$1.fromRangeStart(rng);
- return $_8q1ver2yjjgwe7z3.positionIn(!forward, table).map(function (pos) {
- return pos.isEqual(caretPos);
- }).getOr(false);
- };
- var navigateHorizontally = function (editor, forward, table, td) {
- var rng = editor.selection.getRng();
- var direction = forward ? 1 : -1;
- if (isFakeCaretTableBrowser() && isCaretAtStartOrEndOfTable(forward, rng, table)) {
- var newRng = showCaret(direction, editor, table, !forward, true);
- moveToRange(editor, newRng);
- return true;
- }
- return false;
- };
- var getClosestAbovePosition = function (root, table, start) {
- return findClosestPositionInAboveCell(table, start).orThunk(function () {
- return head(start.getClientRects()).bind(function (rect) {
- return findClosestHorizontalPositionFromPoint(getPositionsAbove(root, CaretPosition$1.before(table)), rect.left);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getBookmark$1 = function (selection, type, normalized) {
+ return GetBookmark.getBookmark(selection, type, normalized);
+ };
+ var moveToBookmark = function (selection, bookmark) {
+ ResolveBookmark.resolve(selection, bookmark).each(function (rng) {
+ selection.setRng(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">- }).getOr(CaretPosition$1.before(table));
- };
- var getClosestBelowPosition = function (root, table, start) {
- return findClosestPositionInBelowCell(table, start).orThunk(function () {
- return head(start.getClientRects()).bind(function (rect) {
- return findClosestHorizontalPositionFromPoint(getPositionsBelow(root, CaretPosition$1.after(table)), rect.left);
- });
- }).getOr(CaretPosition$1.after(table));
- };
- var getTable = function (previous, pos) {
- var node = pos.getNode(previous);
- return $_3b9u2y1rjjgwe7qe.isElement(node) && node.nodeName === 'TABLE' ? Option.some(node) : Option.none();
- };
- var renderBlock = function (down, editor, table, pos) {
- var forcedRootBlock = $_259vs538jjgwe82a.getForcedRootBlock(editor);
- if (forcedRootBlock) {
- editor.undoManager.transact(function () {
- var element = Element$$1.fromTag(forcedRootBlock);
- $_etx7gr15jjgwe7mr.setAll(element, $_259vs538jjgwe82a.getForcedRootBlockAttrs(editor));
- $_ewo3u51yjjgwe7su.append(element, Element$$1.fromTag('br'));
- if (down) {
- $_ewo3u51yjjgwe7su.after(Element$$1.fromDom(table), element);
- } else {
- $_ewo3u51yjjgwe7su.before(Element$$1.fromDom(table), element);
- }
- var rng = editor.dom.createRng();
- rng.setStart(element.dom(), 0);
- rng.setEnd(element.dom(), 0);
- moveToRange(editor, rng);
- });
- } else {
- moveToRange(editor, pos.toRange());
- }
- };
- var moveCaret = function (editor, down, pos) {
- var table = down ? getTable(true, pos) : getTable(false, pos);
- var last$$1 = down === false;
- table.fold(function () {
- return moveToRange(editor, pos.toRange());
- }, function (table) {
- return $_8q1ver2yjjgwe7z3.positionIn(last$$1, editor.getBody()).filter(function (lastPos) {
- return lastPos.isEqual(pos);
- }).fold(function () {
- return moveToRange(editor, pos.toRange());
- }, function (_) {
- return renderBlock(down, editor, table, pos);
- });
- });
- };
- var navigateVertically = function (editor, down, table, td) {
- var rng = editor.selection.getRng();
- var pos = CaretPosition$1.fromRangeStart(rng);
- var root = editor.getBody();
- if (!down && isAtFirstTableCellLine(td, pos)) {
- var newPos = getClosestAbovePosition(root, table, pos);
- moveCaret(editor, down, newPos);
- return true;
- } else if (down && isAtLastTableCellLine(td, pos)) {
- var newPos = getClosestBelowPosition(root, table, pos);
- moveCaret(editor, down, newPos);
- return true;
- } else {
- return false;
- }
- };
- var moveH = function (editor, forward) {
- return function () {
- return Option.from(editor.dom.getParent(editor.selection.getNode(), 'td,th')).bind(function (td) {
- return Option.from(editor.dom.getParent(td, 'table')).map(function (table) {
- return navigateHorizontally(editor, forward, table, td);
- });
- }).getOr(false);
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var moveV = function (editor, forward) {
- return function () {
- return Option.from(editor.dom.getParent(editor.selection.getNode(), 'td,th')).bind(function (td) {
- return Option.from(editor.dom.getParent(td, 'table')).map(function (table) {
- return navigateVertically(editor, forward, table, td);
- });
- }).getOr(false);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isBookmarkNode$1 = function (node) {
+ return NodeType.isElement(node) && node.tagName === 'SPAN' && node.getAttribute('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">- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Bookmarks = {
+ getBookmark: getBookmark$1,
+ moveToBookmark: moveToBookmark,
+ isBookmarkNode: isBookmarkNode$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">- var isContentEditableFalse$5 = $_3b9u2y1rjjgwe7qe.isContentEditableFalse;
- var isTableCell$1 = function (node) {
- return $_3b9u2y1rjjgwe7qe.isElement(node) && /^(TD|TH)$/i.test(node.tagName);
- };
- var getAbsoluteClientRect = function (root, element, before) {
- var clientRect = collapse(element.getBoundingClientRect(), before);
- var docElm, scrollX, scrollY, margin, rootRect;
- if (root.tagName === 'BODY') {
- docElm = root.ownerDocument.documentElement;
- scrollX = root.scrollLeft || docElm.scrollLeft;
- scrollY = root.scrollTop || docElm.scrollTop;
- } else {
- rootRect = root.getBoundingClientRect();
- scrollX = root.scrollLeft - rootRect.left;
- scrollY = root.scrollTop - rootRect.top;
- }
- clientRect.left += scrollX;
- clientRect.right += scrollX;
- clientRect.top += scrollY;
- clientRect.bottom += scrollY;
- clientRect.width = 1;
- margin = element.offsetWidth - element.clientWidth;
- if (margin > 0) {
- if (before) {
- margin *= -1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isInlineBlock = function (node) {
+ return node && /^(IMG)$/.test(node.nodeName);
+ };
+ var moveStart = function (dom, selection, rng) {
+ var offset = rng.startOffset;
+ var container = rng.startContainer, walker, node, nodes;
+ if (rng.startContainer === rng.endContainer) {
+ if (isInlineBlock(rng.startContainer.childNodes[rng.startOffset])) {
+ 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">- clientRect.left += margin;
- clientRect.right += margin;
- }
- return clientRect;
- };
- var trimInlineCaretContainers = function (root) {
- var contentEditableFalseNodes, node, sibling, i, data;
- contentEditableFalseNodes = DomQuery('*[contentEditable=false]', root);
- for (i = 0; i < contentEditableFalseNodes.length; i++) {
- node = contentEditableFalseNodes[i];
- sibling = node.previousSibling;
- if (endsWithCaretContainer(sibling)) {
- data = sibling.data;
- if (data.length === 1) {
- sibling.parentNode.removeChild(sibling);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (container.nodeType === 1) {
+ nodes = container.childNodes;
+ if (offset < nodes.length) {
+ container = nodes[offset];
+ walker = new TreeWalker(container, dom.getParent(container, dom.isBlock));
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- sibling.deleteData(data.length - 1, 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ container = nodes[nodes.length - 1];
+ walker = new TreeWalker(container, dom.getParent(container, dom.isBlock));
+ walker.next(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">+ for (node = walker.current(); node; node = walker.next()) {
+ if (node.nodeType === 3 && !isWhiteSpaceNode(node)) {
+ rng.setStart(node, 0);
+ selection.setRng(rng);
+ 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">- sibling = node.nextSibling;
- if (startsWithCaretContainer(sibling)) {
- data = sibling.data;
- if (data.length === 1) {
- sibling.parentNode.removeChild(sibling);
- } else {
- sibling.deleteData(0, 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var getNonWhiteSpaceSibling = function (node, next, inc) {
+ if (node) {
+ next = next ? 'nextSibling' : 'previousSibling';
+ for (node = inc ? node : node[next]; node; node = node[next]) {
+ if (node.nodeType === 1 || !isWhiteSpaceNode(node)) {
+ return node;
+ }
</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">- }
- };
- var FakeCaret = function (root, isBlock, hasFocus) {
- var lastVisualCaret = Cell(Option.none());
- var cursorInterval, caretContainerNode;
- var show = function (before, element) {
- var clientRect, rng;
- hide();
- if (isTableCell$1(element)) {
- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var isTextBlock$1 = function (editor, name) {
+ if (name.nodeType) {
+ name = name.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 (isBlock(element)) {
- caretContainerNode = insertBlock('p', element, before);
- clientRect = getAbsoluteClientRect(root, element, before);
- DomQuery(caretContainerNode).css('top', clientRect.top);
- var caret = DomQuery('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(clientRect).appendTo(root)[0];
- lastVisualCaret.set(Option.some({
- caret: caret,
- element: element,
- before: before
- }));
- lastVisualCaret.get().each(function (caretState) {
- if (before) {
- DomQuery(caretState.caret).addClass('mce-visual-caret-before');
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return !!editor.schema.getTextBlockElements()[name.toLowerCase()];
+ };
+ var isValid = function (ed, parent, child) {
+ return ed.schema.isValidChild(parent, child);
+ };
+ var isWhiteSpaceNode = function (node) {
+ return node && node.nodeType === 3 && /^([\t \r\n]+|)$/.test(node.nodeValue);
+ };
+ var replaceVars = function (value, vars) {
+ if (typeof value !== 'string') {
+ value = value(vars);
+ } else if (vars) {
+ value = value.replace(/%(\w+)/g, function (str, name) {
+ return vars[name] || 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">- startBlink();
- rng = element.ownerDocument.createRange();
- rng.setStart(caretContainerNode, 0);
- rng.setEnd(caretContainerNode, 0);
- } else {
- caretContainerNode = insertInline(element, before);
- rng = element.ownerDocument.createRange();
- if (isContentEditableFalse$5(caretContainerNode.nextSibling)) {
- rng.setStart(caretContainerNode, 0);
- rng.setEnd(caretContainerNode, 0);
- } else {
- rng.setStart(caretContainerNode, 1);
- rng.setEnd(caretContainerNode, 1);
- }
- return rng;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return rng;
</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">- var hide = function () {
- trimInlineCaretContainers(root);
- if (caretContainerNode) {
- $_cueauu31jjgwe7zy.remove(caretContainerNode);
- caretContainerNode = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isEq = function (str1, str2) {
+ str1 = str1 || '';
+ str2 = str2 || '';
+ str1 = '' + (str1.nodeName || str1);
+ str2 = '' + (str2.nodeName || str2);
+ return str1.toLowerCase() === str2.toLowerCase();
+ };
+ var normalizeStyleValue = function (dom, value, name) {
+ if (name === 'color' || name === 'backgroundColor') {
+ value = dom.toHex(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">- lastVisualCaret.get().each(function (caretState) {
- DomQuery(caretState.caret).remove();
- lastVisualCaret.set(Option.none());
- });
- clearInterval(cursorInterval);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (name === 'fontWeight' && value === 700) {
+ value = 'bold';
+ }
+ if (name === 'fontFamily') {
+ value = value.replace(/[\'\"]/g, '').replace(/,\s+/g, ',');
+ }
+ 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">- var startBlink = function () {
- cursorInterval = $_9o1ijaijjgwe7dm.setInterval(function () {
- if (hasFocus()) {
- DomQuery('div.mce-visual-caret', root).toggleClass('mce-visual-caret-hidden');
- } else {
- DomQuery('div.mce-visual-caret', root).addClass('mce-visual-caret-hidden');
- }
- }, 500);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getStyle = function (dom, node, name) {
+ return normalizeStyleValue(dom, dom.getStyle(node, name), name);
</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 reposition = function () {
- lastVisualCaret.get().each(function (caretState) {
- var clientRect = getAbsoluteClientRect(root, caretState.element, caretState.before);
- DomQuery(caretState.caret).css(clientRect);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getTextDecoration = function (dom, node) {
+ var decoration;
+ dom.getParent(node, function (n) {
+ decoration = dom.getStyle(n, 'text-decoration');
+ return decoration && decoration !== 'none';
</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 decoration;
</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 destroy = function () {
- return $_9o1ijaijjgwe7dm.clearInterval(cursorInterval);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getParents$1 = function (dom, node, selector) {
+ return dom.getParents(node, selector, 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">- var getCss = function () {
- return '.mce-visual-caret {' + 'position: absolute;' + 'background-color: black;' + 'background-color: currentcolor;' + '}' + '.mce-visual-caret-hidden {' + 'display: none;' + '}' + '*[data-mce-caret] {' + 'position: absolute;' + 'left: -1000px;' + 'right: auto;' + 'top: 0;' + 'margin: 0;' + 'padding: 0;' + '}';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var FormatUtils = {
+ isInlineBlock: isInlineBlock,
+ moveStart: moveStart,
+ getNonWhiteSpaceSibling: getNonWhiteSpaceSibling,
+ isTextBlock: isTextBlock$1,
+ isValid: isValid,
+ isWhiteSpaceNode: isWhiteSpaceNode,
+ replaceVars: replaceVars,
+ isEq: isEq,
+ normalizeStyleValue: normalizeStyleValue,
+ getStyle: getStyle,
+ getTextDecoration: getTextDecoration,
+ getParents: getParents$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 {
- show: show,
- hide: hide,
- getCss: getCss,
- reposition: reposition,
- destroy: destroy
- };
- };
- var isFakeCaretTarget = function (node) {
- return isContentEditableFalse$5(node) || $_3b9u2y1rjjgwe7qe.isTable(node) && isFakeCaretTableBrowser();
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var isContentEditableFalse$6 = $_3b9u2y1rjjgwe7qe.isContentEditableFalse;
- var isBlockLike = $_3b9u2y1rjjgwe7qe.matchStyleValues('display', 'block table table-cell table-caption list-item');
- var isCaretContainer$2 = isCaretContainer;
- var isCaretContainerBlock$1 = isCaretContainerBlock;
- var curry$2 = $_4127e12ljjgwe7ww.curry;
- var isElement$6 = $_3b9u2y1rjjgwe7qe.isElement;
- var isCaretCandidate$3 = isCaretCandidate;
- var isForwards = function (direction) {
- return direction > 0;
- };
- var isBackwards = function (direction) {
- return direction < 0;
- };
- var skipCaretContainers = function (walk, shallow) {
- var node;
- while (node = walk(shallow)) {
- if (!isCaretContainerBlock$1(node)) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isBookmarkNode$2 = Bookmarks.isBookmarkNode;
+ var getParents$2 = FormatUtils.getParents, isWhiteSpaceNode$1 = FormatUtils.isWhiteSpaceNode, isTextBlock$2 = FormatUtils.isTextBlock;
+ var findLeaf = function (node, offset) {
+ if (typeof offset === 'undefined') {
+ offset = node.nodeType === 3 ? node.length : node.childNodes.length;
</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 null;
- };
- var findNode = function (node, direction, predicateFn, rootNode, shallow) {
- var walker = new TreeWalker(node, rootNode);
- if (isBackwards(direction)) {
- if (isContentEditableFalse$6(node) || isCaretContainerBlock$1(node)) {
- node = skipCaretContainers(walker.prev, true);
- if (predicateFn(node)) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ while (node && node.hasChildNodes()) {
+ node = node.childNodes[offset];
+ if (node) {
+ offset = node.nodeType === 3 ? node.length : node.childNodes.length;
</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">- while (node = skipCaretContainers(walker.prev, shallow)) {
- if (predicateFn(node)) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return {
+ node: node,
+ offset: offset
+ };
+ };
+ var excludeTrailingWhitespace = function (endContainer, endOffset) {
+ var leaf = findLeaf(endContainer, endOffset);
+ if (leaf.node) {
+ while (leaf.node && leaf.offset === 0 && leaf.node.previousSibling) {
+ leaf = findLeaf(leaf.node.previousSibling);
</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 (isForwards(direction)) {
- if (isContentEditableFalse$6(node) || isCaretContainerBlock$1(node)) {
- node = skipCaretContainers(walker.next, true);
- if (predicateFn(node)) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (leaf.node && leaf.offset > 0 && leaf.node.nodeType === 3 && leaf.node.nodeValue.charAt(leaf.offset - 1) === ' ') {
+ if (leaf.offset > 1) {
+ endContainer = leaf.node;
+ endContainer.splitText(leaf.offset - 1);
+ }
</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">- while (node = skipCaretContainers(walker.next, shallow)) {
- if (predicateFn(node)) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return endContainer;
+ };
+ var isBogusBr = function (node) {
+ return node.nodeName === 'BR' && node.getAttribute('data-mce-bogus') && !node.nextSibling;
+ };
+ var findParentContentEditable = function (dom, node) {
+ var parent = node;
+ while (parent) {
+ if (parent.nodeType === 1 && dom.getContentEditable(parent)) {
+ return dom.getContentEditable(parent) === 'false' ? parent : node;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parent = parent.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 null;
- };
- var getParentBlock = function (node, rootNode) {
- while (node && node !== rootNode) {
- if (isBlockLike(node)) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return node;
+ };
+ var findSpace = function (start, remove, node, offset) {
+ var pos, pos2;
+ var str = node.nodeValue;
+ if (typeof offset === 'undefined') {
+ offset = start ? str.length : 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">- node = node.parentNode;
- }
- return null;
- };
- var isInSameBlock = function (caretPosition1, caretPosition2, rootNode) {
- return getParentBlock(caretPosition1.container(), rootNode) === getParentBlock(caretPosition2.container(), rootNode);
- };
- var getChildNodeAtRelativeOffset = function (relativeOffset, caretPosition) {
- var container, offset;
- if (!caretPosition) {
- return null;
- }
- container = caretPosition.container();
- offset = caretPosition.offset();
- if (!isElement$6(container)) {
- return null;
- }
- return container.childNodes[offset + relativeOffset];
- };
- var beforeAfter = function (before, node) {
- var range = node.ownerDocument.createRange();
- if (before) {
- range.setStartBefore(node);
- range.setEndBefore(node);
- } else {
- range.setStartAfter(node);
- range.setEndAfter(node);
- }
- return range;
- };
- var isNodesInSameBlock = function (root, node1, node2) {
- return getParentBlock(node1, root) === getParentBlock(node2, root);
- };
- var lean = function (left, root, node) {
- var sibling, siblingName;
- if (left) {
- siblingName = 'previousSibling';
- } else {
- siblingName = 'nextSibling';
- }
- while (node && node !== root) {
- sibling = node[siblingName];
- if (isCaretContainer$2(sibling)) {
- sibling = sibling[siblingName];
- }
- if (isContentEditableFalse$6(sibling)) {
- if (isNodesInSameBlock(root, sibling, node)) {
- return sibling;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (start) {
+ pos = str.lastIndexOf(' ', offset);
+ pos2 = str.lastIndexOf('\xA0', offset);
+ pos = pos > pos2 ? pos : pos2;
+ if (pos !== -1 && !remove && (pos < offset || !start) && pos <= str.length) {
+ pos++;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ pos = str.indexOf(' ', offset);
+ pos2 = str.indexOf('\xA0', offset);
+ pos = pos !== -1 && (pos2 === -1 || pos < pos2) ? pos : pos2;
</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 (isCaretCandidate$3(sibling)) {
- break;
- }
- node = node.parentNode;
- }
- return null;
- };
- var before$2 = curry$2(beforeAfter, true);
- var after$2 = curry$2(beforeAfter, false);
- var normalizeRange = function (direction, root, range) {
- var node, container, offset, location;
- var leanLeft = curry$2(lean, true, root);
- var leanRight = curry$2(lean, false, root);
- container = range.startContainer;
- offset = range.startOffset;
- if (isCaretContainerBlock(container)) {
- if (!isElement$6(container)) {
- container = container.parentNode;
- }
- location = container.getAttribute('data-mce-caret');
- if (location === 'before') {
- node = container.nextSibling;
- if (isFakeCaretTarget(node)) {
- return before$2(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return pos;
+ };
+ var findWordEndPoint = function (dom, body, container, offset, start, remove) {
+ var walker, node, pos, lastTextNode;
+ if (container.nodeType === 3) {
+ pos = findSpace(start, remove, container, offset);
+ if (pos !== -1) {
+ return {
+ container: container,
+ offset: pos
+ };
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ lastTextNode = 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 (location === 'after') {
- node = container.previousSibling;
- if (isFakeCaretTarget(node)) {
- return after$2(node);
- }
- }
- }
- if (!range.collapsed) {
- return range;
- }
- if ($_3b9u2y1rjjgwe7qe.isText(container)) {
- if (isCaretContainer$2(container)) {
- if (direction === 1) {
- node = leanRight(container);
- if (node) {
- return before$2(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ walker = new TreeWalker(container, dom.getParent(container, dom.isBlock) || body);
+ while (node = walker[start ? 'prev' : 'next']()) {
+ if (node.nodeType === 3 && !isBookmarkNode$2(node.parentNode)) {
+ lastTextNode = node;
+ pos = findSpace(start, remove, node);
+ if (pos !== -1) {
+ return {
+ container: node,
+ offset: pos
+ };
</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 = leanLeft(container);
- if (node) {
- return after$2(node);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if (dom.isBlock(node) || FormatUtils.isEq(node, 'BR')) {
+ 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">- if (direction === -1) {
- node = leanLeft(container);
- if (node) {
- return after$2(node);
- }
- node = leanRight(container);
- if (node) {
- return before$2(node);
- }
- }
- return range;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (endsWithCaretContainer(container) && offset >= container.data.length - 1) {
- if (direction === 1) {
- node = leanRight(container);
- if (node) {
- return before$2(node);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (lastTextNode) {
+ if (start) {
+ offset = 0;
+ } else {
+ offset = lastTextNode.length;
</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;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return {
+ container: lastTextNode,
+ 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">- if (startsWithCaretContainer(container) && offset <= 1) {
- if (direction === -1) {
- node = leanLeft(container);
- if (node) {
- return after$2(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var findSelectorEndPoint = function (dom, format, rng, container, siblingName) {
+ var parents, i, y, curFormat;
+ if (container.nodeType === 3 && container.nodeValue.length === 0 && container[siblingName]) {
+ container = container[siblingName];
+ }
+ parents = getParents$2(dom, container);
+ for (i = 0; i < parents.length; i++) {
+ for (y = 0; y < format.length; y++) {
+ curFormat = format[y];
+ if ('collapsed' in curFormat && curFormat.collapsed !== rng.collapsed) {
+ continue;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (dom.is(parents[i], curFormat.selector)) {
+ return parents[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">- return range;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (offset === container.data.length) {
- node = leanRight(container);
- if (node) {
- return before$2(node);
- }
- return range;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return container;
+ };
+ var findBlockEndPoint = function (editor, format, container, siblingName) {
+ var node;
+ var dom = editor.dom;
+ var root = dom.getRoot();
+ if (!format[0].wrapper) {
+ node = dom.getParent(container, format[0].block, root);
</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 (offset === 0) {
- node = leanLeft(container);
- if (node) {
- return after$2(node);
- }
- return range;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!node) {
+ var scopeRoot = dom.getParent(container, 'LI,TD,TH');
+ node = dom.getParent(container.nodeType === 3 ? container.parentNode : container, function (node) {
+ return node !== root && isTextBlock$2(editor, node);
+ }, scopeRoot);
</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;
- };
- var isNextToContentEditableFalse = function (relativeOffset, caretPosition) {
- var node = getChildNodeAtRelativeOffset(relativeOffset, caretPosition);
- return isContentEditableFalse$6(node) && !$_3b9u2y1rjjgwe7qe.isBogusAll(node);
- };
- var isNextToTable = function (relativeOffset, caretPosition) {
- return $_3b9u2y1rjjgwe7qe.isTable(getChildNodeAtRelativeOffset(relativeOffset, caretPosition));
- };
- var getRelativeCefElm = function (forward, caretPosition) {
- return Option.from(getChildNodeAtRelativeOffset(forward ? 0 : -1, caretPosition)).filter(isContentEditableFalse$6);
- };
- var getNormalizedRangeEndPoint = function (direction, root, range) {
- var normalizedRange = normalizeRange(direction, root, range);
- if (direction === -1) {
- return CaretPosition.fromRangeStart(normalizedRange);
- }
- return CaretPosition.fromRangeEnd(normalizedRange);
- };
- var isBeforeContentEditableFalse = curry$2(isNextToContentEditableFalse, 0);
- var isAfterContentEditableFalse = curry$2(isNextToContentEditableFalse, -1);
- var isBeforeTable = curry$2(isNextToTable, 0);
- var isAfterTable = curry$2(isNextToTable, -1);
-
- var walkToPositionIn = function (forward, root, start) {
- var position = forward ? CaretPosition$1.before(start) : CaretPosition$1.after(start);
- return fromPosition(forward, root, position);
- };
- var afterElement = function (node) {
- return $_3b9u2y1rjjgwe7qe.isBr(node) ? CaretPosition$1.before(node) : CaretPosition$1.after(node);
- };
- var isBeforeOrStart = function (position) {
- if (CaretPosition$1.isTextPosition(position)) {
- return position.offset() === 0;
- } else {
- return isCaretCandidate(position.getNode());
- }
- };
- var isAfterOrEnd = function (position) {
- if (CaretPosition$1.isTextPosition(position)) {
- var container = position.container();
- return position.offset() === container.data.length;
- } else {
- return isCaretCandidate(position.getNode(true));
- }
- };
- var isBeforeAfterSameElement = function (from, to) {
- return !CaretPosition$1.isTextPosition(from) && !CaretPosition$1.isTextPosition(to) && from.getNode() === to.getNode(true);
- };
- var isAtBr = function (position) {
- return !CaretPosition$1.isTextPosition(position) && $_3b9u2y1rjjgwe7qe.isBr(position.getNode());
- };
- var shouldSkipPosition = function (forward, from, to) {
- if (forward) {
- return !isBeforeAfterSameElement(from, to) && !isAtBr(from) && isAfterOrEnd(from) && isBeforeOrStart(to);
- } else {
- return !isBeforeAfterSameElement(to, from) && isBeforeOrStart(from) && isAfterOrEnd(to);
- }
- };
- var fromPosition = function (forward, root, pos) {
- var walker = CaretWalker(root);
- return Option.from(forward ? walker.next(pos) : walker.prev(pos));
- };
- var navigate = function (forward, root, from) {
- return fromPosition(forward, root, from).bind(function (to) {
- if (isInSameBlock(from, to, root) && shouldSkipPosition(forward, from, to)) {
- return fromPosition(forward, root, to);
- } else {
- return Option.some(to);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (node && format[0].wrapper) {
+ node = getParents$2(dom, node, 'ul,ol').reverse()[0] || 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 positionIn = function (forward, element) {
- var startNode = forward ? element.firstChild : element.lastChild;
- if ($_3b9u2y1rjjgwe7qe.isText(startNode)) {
- return Option.some(CaretPosition$1(startNode, forward ? 0 : startNode.data.length));
- } else if (startNode) {
- if (isCaretCandidate(startNode)) {
- return Option.some(forward ? CaretPosition$1.before(startNode) : afterElement(startNode));
- } else {
- return walkToPositionIn(forward, element, startNode);
- }
- } else {
- return Option.none();
- }
- };
- var $_8q1ver2yjjgwe7z3 = {
- fromPosition: fromPosition,
- nextPosition: curry(fromPosition, true),
- prevPosition: curry(fromPosition, false),
- navigate: navigate,
- positionIn: positionIn,
- firstPositionIn: curry(positionIn, true),
- lastPositionIn: curry(positionIn, false)
- };
-
- var isStringPathBookmark = function (bookmark) {
- return typeof bookmark.start === 'string';
- };
- var isRangeBookmark = function (bookmark) {
- return bookmark.hasOwnProperty('rng');
- };
- var isIdBookmark = function (bookmark) {
- return bookmark.hasOwnProperty('id');
- };
- var isIndexBookmark = function (bookmark) {
- return bookmark.hasOwnProperty('name');
- };
- var isPathBookmark = function (bookmark) {
- return $_6cwiepljjgwe7j4.isArray(bookmark.start);
- };
-
- var addBogus = function (dom, node) {
- if (dom.isBlock(node) && !node.innerHTML && !$_bcvfv9ajjgwe79v.ie) {
- node.innerHTML = '<br data-mce-bogus="1" />';
- }
- return node;
- };
- var resolveCaretPositionBookmark = function (dom, bookmark) {
- var rng, pos;
- rng = dom.createRng();
- pos = resolve$2(dom.getRoot(), bookmark.start);
- rng.setStart(pos.container(), pos.offset());
- pos = resolve$2(dom.getRoot(), bookmark.end);
- rng.setEnd(pos.container(), pos.offset());
- return rng;
- };
- var insertZwsp = function (node, rng) {
- var textNode = node.ownerDocument.createTextNode($_2xw7ul2pjjgwe7xs.ZWSP);
- node.appendChild(textNode);
- rng.setStart(textNode, 0);
- rng.setEnd(textNode, 0);
- };
- var isEmpty = function (node) {
- return node.hasChildNodes() === false;
- };
- var tryFindRangePosition = function (node, rng) {
- return $_8q1ver2yjjgwe7z3.lastPositionIn(node).fold(function () {
- return false;
- }, function (pos) {
- rng.setStart(pos.container(), pos.offset());
- rng.setEnd(pos.container(), pos.offset());
- return true;
- });
- };
- var padEmptyCaretContainer = function (root, node, rng) {
- if (isEmpty(node) && getParentCaretContainer(root, node)) {
- insertZwsp(node, rng);
- return true;
- } else {
- return false;
- }
- };
- var setEndPoint = function (dom, start, bookmark, rng) {
- var point = bookmark[start ? 'start' : 'end'];
- var i, node, offset, children;
- var root = dom.getRoot();
- if (point) {
- offset = point[0];
- for (node = root, i = point.length - 1; i >= 1; i--) {
- children = node.childNodes;
- if (padEmptyCaretContainer(root, node, rng)) {
- return true;
- }
- if (point[i] > children.length - 1) {
- if (padEmptyCaretContainer(root, node, rng)) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!node) {
+ node = container;
+ while (node[siblingName] && !dom.isBlock(node[siblingName])) {
+ node = node[siblingName];
+ if (FormatUtils.isEq(node, 'br')) {
+ 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 tryFindRangePosition(node, rng);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- node = children[point[i]];
</del><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) {
- offset = Math.min(point[0], node.nodeValue.length);
- }
- if (node.nodeType === 1) {
- offset = Math.min(point[0], node.childNodes.length);
- }
- if (start) {
- rng.setStart(node, offset);
- } else {
- rng.setEnd(node, offset);
- }
- }
- return true;
- };
- var isValidTextNode = function (node) {
- return $_3b9u2y1rjjgwe7qe.isText(node) && node.data.length > 0;
- };
- var restoreEndPoint = function (dom, suffix, bookmark) {
- var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev;
- var keep = bookmark.keep;
- var container, offset;
- if (marker) {
- node = marker.parentNode;
- if (suffix === 'start') {
- if (!keep) {
- idx = dom.nodeIndex(marker);
- } else {
- if (marker.hasChildNodes()) {
- node = marker.firstChild;
- idx = 1;
- } else if (isValidTextNode(marker.nextSibling)) {
- node = marker.nextSibling;
- idx = 0;
- } else if (isValidTextNode(marker.previousSibling)) {
- node = marker.previousSibling;
- idx = marker.previousSibling.data.length;
- } else {
- node = marker.parentNode;
- idx = dom.nodeIndex(marker) + 1;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return node || container;
+ };
+ var findParentContainer = function (dom, format, startContainer, startOffset, endContainer, endOffset, start) {
+ var container, parent, sibling, siblingName, root;
+ container = parent = start ? startContainer : endContainer;
+ siblingName = start ? 'previousSibling' : 'nextSibling';
+ root = dom.getRoot();
+ if (container.nodeType === 3 && !isWhiteSpaceNode$1(container)) {
+ if (start ? startOffset > 0 : endOffset < container.nodeValue.length) {
+ 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 = node;
- offset = idx;
- } else {
- if (!keep) {
- idx = dom.nodeIndex(marker);
- } else {
- if (marker.hasChildNodes()) {
- node = marker.firstChild;
- idx = 1;
- } else if (isValidTextNode(marker.previousSibling)) {
- node = marker.previousSibling;
- idx = marker.previousSibling.data.length;
- } else {
- node = marker.parentNode;
- idx = dom.nodeIndex(marker);
- }
- }
- container = node;
- offset = idx;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (!keep) {
- prev = marker.previousSibling;
- next = marker.nextSibling;
- $_6cwiepljjgwe7j4.each($_6cwiepljjgwe7j4.grep(marker.childNodes), function (node) {
- if ($_3b9u2y1rjjgwe7qe.isText(node)) {
- node.nodeValue = node.nodeValue.replace(/\uFEFF/g, '');
- }
- });
- while (marker = dom.get(bookmark.id + '_' + suffix)) {
- dom.remove(marker, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ while (true) {
+ if (!format[0].block_expand && dom.isBlock(parent)) {
+ return parent;
</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 (prev && next && prev.nodeType === next.nodeType && $_3b9u2y1rjjgwe7qe.isText(prev) && !$_bcvfv9ajjgwe79v.opera) {
- idx = prev.nodeValue.length;
- prev.appendData(next.nodeValue);
- dom.remove(next);
- if (suffix === 'start') {
- container = prev;
- offset = idx;
- } else {
- container = prev;
- offset = idx;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) {
+ if (!isBookmarkNode$2(sibling) && !isWhiteSpaceNode$1(sibling) && !isBogusBr(sibling)) {
+ return parent;
</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">- }
- return Option.some(CaretPosition$1(container, offset));
- } else {
- return Option.none();
- }
- };
- var alt = function (o1, o2) {
- return o1.isSome() ? o1 : o2;
- };
- var resolvePaths = function (dom, bookmark) {
- var rng = dom.createRng();
- if (setEndPoint(dom, true, bookmark, rng) && setEndPoint(dom, false, bookmark, rng)) {
- return Option.some(rng);
- } else {
- return Option.none();
- }
- };
- var resolveId = function (dom, bookmark) {
- var startPos = restoreEndPoint(dom, 'start', bookmark);
- var endPos = restoreEndPoint(dom, 'end', bookmark);
- return liftN([
- startPos,
- alt(endPos, startPos)
- ], function (spos, epos) {
- var rng = dom.createRng();
- rng.setStart(addBogus(dom, spos.container()), spos.offset());
- rng.setEnd(addBogus(dom, epos.container()), epos.offset());
- return rng;
- });
- };
- var resolveIndex$1 = function (dom, bookmark) {
- return Option.from(dom.select(bookmark.name)[bookmark.index]).map(function (elm) {
- var rng = dom.createRng();
- rng.selectNode(elm);
- return rng;
- });
- };
- var resolve$3 = function (selection, bookmark) {
- var dom = selection.dom;
- if (bookmark) {
- if (isPathBookmark(bookmark)) {
- return resolvePaths(dom, bookmark);
- } else if (isStringPathBookmark(bookmark)) {
- return Option.some(resolveCaretPositionBookmark(dom, bookmark));
- } else if (isIdBookmark(bookmark)) {
- return resolveId(dom, bookmark);
- } else if (isIndexBookmark(bookmark)) {
- return resolveIndex$1(dom, bookmark);
- } else if (isRangeBookmark(bookmark)) {
- return Option.some(bookmark.rng);
- }
- }
- return Option.none();
- };
- var $_6xjyb22wjjgwe7yr = { resolve: resolve$3 };
-
- var getBookmark$1 = function (selection, type, normalized) {
- return $_ga29lf2jjjgwe7wh.getBookmark(selection, type, normalized);
- };
- var moveToBookmark = function (selection, bookmark) {
- $_6xjyb22wjjgwe7yr.resolve(selection, bookmark).each(function (rng) {
- selection.setRng(rng);
- });
- };
- var isBookmarkNode$1 = function (node) {
- return $_3b9u2y1rjjgwe7qe.isElement(node) && node.tagName === 'SPAN' && node.getAttribute('data-mce-type') === 'bookmark';
- };
- var $_6refgt2vjjgwe7yn = {
- getBookmark: getBookmark$1,
- moveToBookmark: moveToBookmark,
- isBookmarkNode: isBookmarkNode$1
- };
-
- var isInlineBlock = function (node) {
- return node && /^(IMG)$/.test(node.nodeName);
- };
- var moveStart = function (dom, selection, rng) {
- var offset = rng.startOffset;
- var container = rng.startContainer, walker, node, nodes;
- if (rng.startContainer === rng.endContainer) {
- if (isInlineBlock(rng.startContainer.childNodes[rng.startOffset])) {
- return;
- }
- }
- if (container.nodeType === 1) {
- nodes = container.childNodes;
- if (offset < nodes.length) {
- container = nodes[offset];
- walker = new TreeWalker(container, dom.getParent(container, dom.isBlock));
- } else {
- container = nodes[nodes.length - 1];
- walker = new TreeWalker(container, dom.getParent(container, dom.isBlock));
- walker.next(true);
- }
- for (node = walker.current(); node; node = walker.next()) {
- if (node.nodeType === 3 && !isWhiteSpaceNode(node)) {
- rng.setStart(node, 0);
- selection.setRng(rng);
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (parent === root || parent.parentNode === root) {
+ container = parent;
+ break;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parent = parent.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 getNonWhiteSpaceSibling = function (node, next, inc) {
- if (node) {
- next = next ? 'nextSibling' : 'previousSibling';
- for (node = inc ? node : node[next]; node; node = node[next]) {
- if (node.nodeType === 1 || !isWhiteSpaceNode(node)) {
- return node;
- }
- }
- }
- };
- var isTextBlock$1 = function (editor, name) {
- if (name.nodeType) {
- name = name.nodeName;
- }
- return !!editor.schema.getTextBlockElements()[name.toLowerCase()];
- };
- var isValid = function (ed, parent, child) {
- return ed.schema.isValidChild(parent, child);
- };
- var isWhiteSpaceNode = function (node) {
- return node && node.nodeType === 3 && /^([\t \r\n]+|)$/.test(node.nodeValue);
- };
- var replaceVars = function (value, vars) {
- if (typeof value !== 'string') {
- value = value(vars);
- } else if (vars) {
- value = value.replace(/%(\w+)/g, function (str, name) {
- return vars[name] || str;
- });
- }
- return value;
- };
- var isEq = function (str1, str2) {
- str1 = str1 || '';
- str2 = str2 || '';
- str1 = '' + (str1.nodeName || str1);
- str2 = '' + (str2.nodeName || str2);
- return str1.toLowerCase() === str2.toLowerCase();
- };
- var normalizeStyleValue = function (dom, value, name) {
- if (name === 'color' || name === 'backgroundColor') {
- value = dom.toHex(value);
- }
- if (name === 'fontWeight' && value === 700) {
- value = 'bold';
- }
- if (name === 'fontFamily') {
- value = value.replace(/[\'\"]/g, '').replace(/,\s+/g, ',');
- }
- return '' + value;
- };
- var getStyle = function (dom, node, name) {
- return normalizeStyleValue(dom, dom.getStyle(node, name), name);
- };
- var getTextDecoration = function (dom, node) {
- var decoration;
- dom.getParent(node, function (n) {
- decoration = dom.getStyle(n, 'text-decoration');
- return decoration && decoration !== 'none';
- });
- return decoration;
- };
- var getParents$1 = function (dom, node, selector) {
- return dom.getParents(node, selector, dom.getRoot());
- };
- var $_4301413ajjgwe82g = {
- isInlineBlock: isInlineBlock,
- moveStart: moveStart,
- getNonWhiteSpaceSibling: getNonWhiteSpaceSibling,
- isTextBlock: isTextBlock$1,
- isValid: isValid,
- isWhiteSpaceNode: isWhiteSpaceNode,
- replaceVars: replaceVars,
- isEq: isEq,
- normalizeStyleValue: normalizeStyleValue,
- getStyle: getStyle,
- getTextDecoration: getTextDecoration,
- getParents: getParents$1
- };
-
- var isBookmarkNode$2 = $_6refgt2vjjgwe7yn.isBookmarkNode;
- var getParents$2 = $_4301413ajjgwe82g.getParents;
- var isWhiteSpaceNode$1 = $_4301413ajjgwe82g.isWhiteSpaceNode;
- var isTextBlock$2 = $_4301413ajjgwe82g.isTextBlock;
- var findLeaf = function (node, offset) {
- if (typeof offset === 'undefined') {
- offset = node.nodeType === 3 ? node.length : node.childNodes.length;
- }
- while (node && node.hasChildNodes()) {
- node = node.childNodes[offset];
- if (node) {
- offset = node.nodeType === 3 ? node.length : node.childNodes.length;
- }
- }
- return {
- node: node,
- offset: offset
</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 excludeTrailingWhitespace = function (endContainer, endOffset) {
- var leaf = findLeaf(endContainer, endOffset);
- if (leaf.node) {
- while (leaf.node && leaf.offset === 0 && leaf.node.previousSibling) {
- leaf = findLeaf(leaf.node.previousSibling);
- }
- if (leaf.node && leaf.offset > 0 && leaf.node.nodeType === 3 && leaf.node.nodeValue.charAt(leaf.offset - 1) === ' ') {
- if (leaf.offset > 1) {
- endContainer = leaf.node;
- endContainer.splitText(leaf.offset - 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var expandRng = function (editor, rng, format, remove) {
+ var endPoint, startContainer = rng.startContainer, startOffset = rng.startOffset, endContainer = rng.endContainer, endOffset = rng.endOffset;
+ var dom = editor.dom;
+ if (startContainer.nodeType === 1 && startContainer.hasChildNodes()) {
+ startContainer = getNode(startContainer, startOffset);
+ if (startContainer.nodeType === 3) {
+ startOffset = 0;
</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">- }
- return endContainer;
- };
- var isBogusBr = function (node) {
- return node.nodeName === 'BR' && node.getAttribute('data-mce-bogus') && !node.nextSibling;
- };
- var findParentContentEditable = function (dom, node) {
- var parent = node;
- while (parent) {
- if (parent.nodeType === 1 && dom.getContentEditable(parent)) {
- return dom.getContentEditable(parent) === 'false' ? parent : node;
- }
- parent = parent.parentNode;
- }
- return node;
- };
- var findSpace = function (start, remove, node, offset) {
- var pos, pos2;
- var str = node.nodeValue;
- if (typeof offset === 'undefined') {
- offset = start ? str.length : 0;
- }
- if (start) {
- pos = str.lastIndexOf(' ', offset);
- pos2 = str.lastIndexOf('\xA0', offset);
- pos = pos > pos2 ? pos : pos2;
- if (pos !== -1 && !remove) {
- pos++;
- }
- } else {
- pos = str.indexOf(' ', offset);
- pos2 = str.indexOf('\xA0', offset);
- pos = pos !== -1 && (pos2 === -1 || pos < pos2) ? pos : pos2;
- }
- return pos;
- };
- var findWordEndPoint = function (dom, body, container, offset, start, remove) {
- var walker, node, pos, lastTextNode;
- if (container.nodeType === 3) {
- pos = findSpace(start, remove, container, offset);
- if (pos !== -1) {
- return {
- container: container,
- offset: pos
- };
- }
- lastTextNode = container;
- }
- walker = new TreeWalker(container, dom.getParent(container, dom.isBlock) || body);
- while (node = walker[start ? 'prev' : 'next']()) {
- if (node.nodeType === 3) {
- lastTextNode = node;
- pos = findSpace(start, remove, node);
- if (pos !== -1) {
- return {
- container: node,
- offset: pos
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (endContainer.nodeType === 1 && endContainer.hasChildNodes()) {
+ endContainer = getNode(endContainer, rng.collapsed ? endOffset : endOffset - 1);
+ if (endContainer.nodeType === 3) {
+ endOffset = endContainer.nodeValue.length;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else if (dom.isBlock(node)) {
- break;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (lastTextNode) {
- if (start) {
- offset = 0;
- } else {
- offset = lastTextNode.length;
- }
- return {
- container: lastTextNode,
- offset: offset
- };
- }
- };
- var findSelectorEndPoint = function (dom, format, rng, container, siblingName) {
- var parents, i, y, curFormat;
- if (container.nodeType === 3 && container.nodeValue.length === 0 && container[siblingName]) {
- container = container[siblingName];
- }
- parents = getParents$2(dom, container);
- for (i = 0; i < parents.length; i++) {
- for (y = 0; y < format.length; y++) {
- curFormat = format[y];
- if ('collapsed' in curFormat && curFormat.collapsed !== rng.collapsed) {
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ startContainer = findParentContentEditable(dom, startContainer);
+ endContainer = findParentContentEditable(dom, endContainer);
+ if (isBookmarkNode$2(startContainer.parentNode) || isBookmarkNode$2(startContainer)) {
+ startContainer = isBookmarkNode$2(startContainer) ? startContainer : startContainer.parentNode;
+ if (rng.collapsed) {
+ startContainer = startContainer.previousSibling || startContainer;
+ } else {
+ startContainer = startContainer.nextSibling || startContainer;
</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.is(parents[i], curFormat.selector)) {
- return parents[i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (startContainer.nodeType === 3) {
+ startOffset = rng.collapsed ? startContainer.length : 0;
</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">- }
- return container;
- };
- var findBlockEndPoint = function (editor, format, container, siblingName) {
- var node;
- var dom = editor.dom;
- var root = dom.getRoot();
- if (!format[0].wrapper) {
- node = dom.getParent(container, format[0].block, root);
- }
- if (!node) {
- var scopeRoot = dom.getParent(container, 'LI,TD,TH');
- node = dom.getParent(container.nodeType === 3 ? container.parentNode : container, function (node) {
- return node !== root && isTextBlock$2(editor, node);
- }, scopeRoot);
- }
- if (node && format[0].wrapper) {
- node = getParents$2(dom, node, 'ul,ol').reverse()[0] || node;
- }
- if (!node) {
- node = container;
- while (node[siblingName] && !dom.isBlock(node[siblingName])) {
- node = node[siblingName];
- if ($_4301413ajjgwe82g.isEq(node, 'br')) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isBookmarkNode$2(endContainer.parentNode) || isBookmarkNode$2(endContainer)) {
+ endContainer = isBookmarkNode$2(endContainer) ? endContainer : endContainer.parentNode;
+ if (rng.collapsed) {
+ endContainer = endContainer.nextSibling || endContainer;
+ } else {
+ endContainer = endContainer.previousSibling || endContainer;
</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 node || container;
- };
- var findParentContainer = function (dom, format, startContainer, startOffset, endContainer, endOffset, start) {
- var container, parent, sibling, siblingName, root;
- container = parent = start ? startContainer : endContainer;
- siblingName = start ? 'previousSibling' : 'nextSibling';
- root = dom.getRoot();
- if (container.nodeType === 3 && !isWhiteSpaceNode$1(container)) {
- if (start ? startOffset > 0 : endOffset < container.nodeValue.length) {
- return container;
- }
- }
- while (true) {
- if (!format[0].block_expand && dom.isBlock(parent)) {
- return parent;
- }
- for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) {
- if (!isBookmarkNode$2(sibling) && !isWhiteSpaceNode$1(sibling) && !isBogusBr(sibling)) {
- return parent;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (endContainer.nodeType === 3) {
+ endOffset = rng.collapsed ? 0 : endContainer.length;
</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">- if (parent === root || parent.parentNode === root) {
- container = parent;
- break;
- }
- parent = parent.parentNode;
- }
- return container;
- };
- var expandRng = function (editor, rng, format, remove) {
- var endPoint, startContainer = rng.startContainer, startOffset = rng.startOffset, endContainer = rng.endContainer, endOffset = rng.endOffset;
- var dom = editor.dom;
- if (startContainer.nodeType === 1 && startContainer.hasChildNodes()) {
- startContainer = getNode(startContainer, startOffset);
- if (startContainer.nodeType === 3) {
- startOffset = 0;
- }
- }
- if (endContainer.nodeType === 1 && endContainer.hasChildNodes()) {
- endContainer = getNode(endContainer, rng.collapsed ? endOffset : endOffset - 1);
- if (endContainer.nodeType === 3) {
- endOffset = endContainer.nodeValue.length;
- }
- }
- startContainer = findParentContentEditable(dom, startContainer);
- endContainer = findParentContentEditable(dom, endContainer);
- if (isBookmarkNode$2(startContainer.parentNode) || isBookmarkNode$2(startContainer)) {
- startContainer = isBookmarkNode$2(startContainer) ? startContainer : startContainer.parentNode;
- startContainer = startContainer.nextSibling || startContainer;
- if (startContainer.nodeType === 3) {
- startOffset = 0;
- }
- }
- if (isBookmarkNode$2(endContainer.parentNode) || isBookmarkNode$2(endContainer)) {
- endContainer = isBookmarkNode$2(endContainer) ? endContainer : endContainer.parentNode;
- endContainer = endContainer.previousSibling || endContainer;
- if (endContainer.nodeType === 3) {
- endOffset = endContainer.length;
- }
- }
- if (format[0].inline) {
</del><span class="cx" style="display: block; padding: 0 10px"> if (rng.collapsed) {
</span><span class="cx" style="display: block; padding: 0 10px"> endPoint = findWordEndPoint(dom, editor.getBody(), startContainer, startOffset, true, remove);
</span><span class="cx" style="display: block; padding: 0 10px"> if (endPoint) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -10630,800 +9573,773 @@
</span><span class="cx" style="display: block; padding: 0 10px"> endOffset = endPoint.offset;
</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">- endContainer = remove ? endContainer : excludeTrailingWhitespace(endContainer, endOffset);
- }
- if (format[0].inline || format[0].block_expand) {
- if (!format[0].inline || (startContainer.nodeType !== 3 || startOffset === 0)) {
- startContainer = findParentContainer(dom, format, startContainer, startOffset, endContainer, endOffset, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (format[0].inline) {
+ endContainer = remove ? endContainer : excludeTrailingWhitespace(endContainer, 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 (!format[0].inline || (endContainer.nodeType !== 3 || endOffset === endContainer.nodeValue.length)) {
- endContainer = findParentContainer(dom, format, startContainer, startOffset, endContainer, endOffset, false);
- }
- }
- if (format[0].selector && format[0].expand !== false && !format[0].inline) {
- startContainer = findSelectorEndPoint(dom, format, rng, startContainer, 'previousSibling');
- endContainer = findSelectorEndPoint(dom, format, rng, endContainer, 'nextSibling');
- }
- if (format[0].block || format[0].selector) {
- startContainer = findBlockEndPoint(editor, format, startContainer, 'previousSibling');
- endContainer = findBlockEndPoint(editor, format, endContainer, 'nextSibling');
- if (format[0].block) {
- if (!dom.isBlock(startContainer)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (format[0].inline || format[0].block_expand) {
+ if (!format[0].inline || (startContainer.nodeType !== 3 || startOffset === 0)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> startContainer = findParentContainer(dom, format, startContainer, startOffset, endContainer, endOffset, true);
</span><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(endContainer)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!format[0].inline || (endContainer.nodeType !== 3 || endOffset === endContainer.nodeValue.length)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> endContainer = findParentContainer(dom, format, startContainer, startOffset, endContainer, endOffset, false);
</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">- }
- if (startContainer.nodeType === 1) {
- startOffset = dom.nodeIndex(startContainer);
- startContainer = startContainer.parentNode;
- }
- if (endContainer.nodeType === 1) {
- endOffset = dom.nodeIndex(endContainer) + 1;
- endContainer = endContainer.parentNode;
- }
- return {
- startContainer: startContainer,
- startOffset: startOffset,
- endContainer: endContainer,
- endOffset: endOffset
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (format[0].selector && format[0].expand !== false && !format[0].inline) {
+ startContainer = findSelectorEndPoint(dom, format, rng, startContainer, 'previousSibling');
+ endContainer = findSelectorEndPoint(dom, format, rng, endContainer, 'nextSibling');
+ }
+ if (format[0].block || format[0].selector) {
+ startContainer = findBlockEndPoint(editor, format, startContainer, 'previousSibling');
+ endContainer = findBlockEndPoint(editor, format, endContainer, 'nextSibling');
+ if (format[0].block) {
+ if (!dom.isBlock(startContainer)) {
+ startContainer = findParentContainer(dom, format, startContainer, startOffset, endContainer, endOffset, true);
+ }
+ if (!dom.isBlock(endContainer)) {
+ endContainer = findParentContainer(dom, format, startContainer, startOffset, endContainer, endOffset, false);
+ }
+ }
+ }
+ if (startContainer.nodeType === 1) {
+ startOffset = dom.nodeIndex(startContainer);
+ startContainer = startContainer.parentNode;
+ }
+ if (endContainer.nodeType === 1) {
+ endOffset = dom.nodeIndex(endContainer) + 1;
+ endContainer = endContainer.parentNode;
+ }
+ return {
+ startContainer: startContainer,
+ startOffset: startOffset,
+ endContainer: endContainer,
+ endOffset: 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">- };
- var $_1f06hv2ujjgwe7y7 = { expandRng: expandRng };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ExpandRange = { expandRng: expandRng };
</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 each$8 = $_6cwiepljjgwe7j4.each;
- var getEndChild = function (container, index) {
- var childNodes = container.childNodes;
- index--;
- if (index > childNodes.length - 1) {
- index = childNodes.length - 1;
- } else if (index < 0) {
- index = 0;
- }
- return childNodes[index] || container;
- };
- var walk$2 = function (dom, rng, callback) {
- var startContainer = rng.startContainer;
- var startOffset = rng.startOffset;
- var endContainer = rng.endContainer;
- var endOffset = rng.endOffset;
- var ancestor;
- var startPoint;
- var endPoint;
- var node;
- var parent;
- var siblings;
- var nodes;
- nodes = dom.select('td[data-mce-selected],th[data-mce-selected]');
- if (nodes.length > 0) {
- each$8(nodes, function (node) {
- callback([node]);
- });
- return;
- }
- var exclude = function (nodes) {
- var node;
- node = nodes[0];
- if (node.nodeType === 3 && node === startContainer && startOffset >= node.nodeValue.length) {
- nodes.splice(0, 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var each$8 = Tools.each;
+ var getEndChild = function (container, index) {
+ var childNodes = container.childNodes;
+ index--;
+ if (index > childNodes.length - 1) {
+ index = childNodes.length - 1;
+ } else if (index < 0) {
+ index = 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">- node = nodes[nodes.length - 1];
- if (endOffset === 0 && nodes.length > 0 && node === endContainer && node.nodeType === 3) {
- nodes.splice(nodes.length - 1, 1);
- }
- return nodes;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return childNodes[index] || 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 collectSiblings = function (node, name, endNode) {
- var siblings = [];
- for (; node && node !== endNode; node = node[name]) {
- siblings.push(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var walk$1 = function (dom, rng, callback) {
+ var startContainer = rng.startContainer;
+ var startOffset = rng.startOffset;
+ var endContainer = rng.endContainer;
+ var endOffset = rng.endOffset;
+ var ancestor;
+ var startPoint;
+ var endPoint;
+ var node;
+ var parent;
+ var siblings;
+ var nodes;
+ nodes = dom.select('td[data-mce-selected],th[data-mce-selected]');
+ if (nodes.length > 0) {
+ each$8(nodes, function (node) {
+ callback([node]);
+ });
+ 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 siblings;
- };
- var findEndPoint = function (node, root) {
- do {
- if (node.parentNode === root) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var exclude = function (nodes) {
+ var node;
+ node = nodes[0];
+ if (node.nodeType === 3 && node === startContainer && startOffset >= node.nodeValue.length) {
+ nodes.splice(0, 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">- node = node.parentNode;
- } while (node);
- };
- var walkBoundary = function (startNode, endNode, next) {
- var siblingName = next ? 'nextSibling' : 'previousSibling';
- for (node = startNode, parent = node.parentNode; node && node !== endNode; node = parent) {
- parent = node.parentNode;
- siblings = collectSiblings(node === startNode ? node : node[siblingName], siblingName);
- if (siblings.length) {
- if (!next) {
- siblings.reverse();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ node = nodes[nodes.length - 1];
+ if (endOffset === 0 && nodes.length > 0 && node === endContainer && node.nodeType === 3) {
+ nodes.splice(nodes.length - 1, 1);
+ }
+ return nodes;
+ };
+ var collectSiblings = function (node, name, endNode) {
+ var siblings = [];
+ for (; node && node !== endNode; node = node[name]) {
+ siblings.push(node);
+ }
+ return siblings;
+ };
+ var findEndPoint = function (node, root) {
+ do {
+ if (node.parentNode === root) {
+ return 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">- callback(exclude(siblings));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ node = node.parentNode;
+ } while (node);
+ };
+ var walkBoundary = function (startNode, endNode, next) {
+ var siblingName = next ? 'nextSibling' : 'previousSibling';
+ for (node = startNode, parent = node.parentNode; node && node !== endNode; node = parent) {
+ parent = node.parentNode;
+ siblings = collectSiblings(node === startNode ? node : node[siblingName], siblingName);
+ if (siblings.length) {
+ if (!next) {
+ siblings.reverse();
+ }
+ callback(exclude(siblings));
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ if (startContainer.nodeType === 1 && startContainer.hasChildNodes()) {
+ startContainer = startContainer.childNodes[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">- };
- if (startContainer.nodeType === 1 && startContainer.hasChildNodes()) {
- startContainer = startContainer.childNodes[startOffset];
- }
- if (endContainer.nodeType === 1 && endContainer.hasChildNodes()) {
- endContainer = getEndChild(endContainer, endOffset);
- }
- if (startContainer === endContainer) {
- return callback(exclude([startContainer]));
- }
- ancestor = dom.findCommonAncestor(startContainer, endContainer);
- for (node = startContainer; node; node = node.parentNode) {
- if (node === endContainer) {
- return walkBoundary(startContainer, ancestor, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (endContainer.nodeType === 1 && endContainer.hasChildNodes()) {
+ endContainer = getEndChild(endContainer, 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 (node === ancestor) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (startContainer === endContainer) {
+ return callback(exclude([startContainer]));
</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 = endContainer; node; node = node.parentNode) {
- if (node === startContainer) {
- return walkBoundary(endContainer, ancestor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ancestor = dom.findCommonAncestor(startContainer, endContainer);
+ for (node = startContainer; node; node = node.parentNode) {
+ if (node === endContainer) {
+ return walkBoundary(startContainer, ancestor, true);
+ }
+ if (node === ancestor) {
+ 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">- if (node === ancestor) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (node = endContainer; node; node = node.parentNode) {
+ if (node === startContainer) {
+ return walkBoundary(endContainer, ancestor);
+ }
+ if (node === ancestor) {
+ break;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ startPoint = findEndPoint(startContainer, ancestor) || startContainer;
+ endPoint = findEndPoint(endContainer, ancestor) || endContainer;
+ walkBoundary(startContainer, startPoint, true);
+ siblings = collectSiblings(startPoint === startContainer ? startPoint : startPoint.nextSibling, 'nextSibling', endPoint === endContainer ? endPoint.nextSibling : endPoint);
+ if (siblings.length) {
+ callback(exclude(siblings));
+ }
+ walkBoundary(endContainer, endPoint);
+ };
+ var RangeWalk = { walk: walk$1 };
+
+ var zeroWidth = function () {
+ return '\uFEFF';
+ };
+
+ function NodeValue (is, name) {
+ var get = function (element) {
+ if (!is(element))
+ throw new Error('Can only get ' + name + ' value of a ' + name + ' node');
+ return getOption(element).getOr('');
+ };
+ var getOptionIE10 = function (element) {
+ try {
+ return getOptionSafe(element);
+ } catch (e) {
+ return Option.none();
+ }
+ };
+ var getOptionSafe = function (element) {
+ return is(element) ? Option.from(element.dom().nodeValue) : Option.none();
+ };
+ var browser = PlatformDetection$1.detect().browser;
+ var getOption = browser.isIE() && browser.version.major === 10 ? getOptionIE10 : getOptionSafe;
+ var set = function (element, value) {
+ if (!is(element))
+ throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node');
+ element.dom().nodeValue = value;
+ };
+ return {
+ get: get,
+ getOption: getOption,
+ set: set
+ };
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- startPoint = findEndPoint(startContainer, ancestor) || startContainer;
- endPoint = findEndPoint(endContainer, ancestor) || endContainer;
- walkBoundary(startContainer, startPoint, true);
- siblings = collectSiblings(startPoint === startContainer ? startPoint : startPoint.nextSibling, 'nextSibling', endPoint === endContainer ? endPoint.nextSibling : endPoint);
- if (siblings.length) {
- callback(exclude(siblings));
- }
- walkBoundary(endContainer, endPoint);
- };
- var $_e2gzn43bjjgwe82k = { walk: walk$2 };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var zeroWidth = function () {
- return '\uFEFF';
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var api = NodeValue(isText, 'text');
+ var get$6 = function (element) {
+ return api.get(element);
+ };
</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 NodeValue (is, name) {
- var get = function (element) {
- if (!is(element))
- throw new Error('Can only get ' + name + ' value of a ' + name + ' node');
- return getOption(element).getOr('');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isZeroWidth = function (elem) {
+ return isText(elem) && get$6(elem) === zeroWidth();
</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 getOptionIE10 = function (element) {
- try {
- return getOptionSafe(element);
- } catch (e) {
- return Option.none();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var context = function (editor, elem, wrapName, nodeName) {
+ return parent(elem).fold(function () {
+ return 'skipping';
+ }, function (parent$$1) {
+ if (nodeName === 'br' || isZeroWidth(elem)) {
+ return 'valid';
+ } else if (isAnnotation(elem)) {
+ return 'existing';
+ } else if (isCaretNode(elem)) {
+ return 'caret';
+ } else if (!FormatUtils.isValid(editor, wrapName, nodeName) || !FormatUtils.isValid(editor, name(parent$$1), wrapName)) {
+ return 'invalid-child';
+ } else {
+ return 'valid';
+ }
+ });
</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 getOptionSafe = function (element) {
- return is(element) ? Option.from(element.dom().nodeValue) : Option.none();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var shouldApplyToTrailingSpaces = function (rng) {
+ return rng.startContainer.nodeType === 3 && rng.startContainer.nodeValue.length >= rng.startOffset && rng.startContainer.nodeValue[rng.startOffset] === '\xA0';
</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 browser = $_7vg267ojjgwe7k0.detect().browser;
- var getOption = browser.isIE() && browser.version.major === 10 ? getOptionIE10 : getOptionSafe;
- var set = function (element, value) {
- if (!is(element))
- throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node');
- element.dom().nodeValue = value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var applyWordGrab = function (editor, rng) {
+ var r = ExpandRange.expandRng(editor, rng, [{ inline: true }], shouldApplyToTrailingSpaces(rng));
+ rng.setStart(r.startContainer, r.startOffset);
+ rng.setEnd(r.endContainer, r.endOffset);
+ editor.selection.setRng(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">- return {
- get: get,
- getOption: getOption,
- set: set
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var makeAnnotation = function (eDoc, _a, annotationName, decorate) {
+ var _b = _a.uid, uid = _b === void 0 ? generate('mce-annotation') : _b, data = __rest(_a, ['uid']);
+ var master = Element$$1.fromTag('span', eDoc);
+ add$2(master, annotation());
+ set(master, '' + dataAnnotationId(), uid);
+ set(master, '' + dataAnnotation(), annotationName);
+ var _c = decorate(uid, data), _d = _c.attributes, attributes = _d === void 0 ? {} : _d, _e = _c.classes, classes = _e === void 0 ? [] : _e;
+ setAll(master, attributes);
+ add$3(master, classes);
+ return master;
</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">+ var annotate = function (editor, rng, annotationName, decorate, data) {
+ var newWrappers = [];
+ var master = makeAnnotation(editor.getDoc(), data, annotationName, decorate);
+ var wrapper = Cell(Option.none());
+ var finishWrapper = function () {
+ wrapper.set(Option.none());
+ };
+ var getOrOpenWrapper = function () {
+ return wrapper.get().getOrThunk(function () {
+ var nu = shallow(master);
+ newWrappers.push(nu);
+ wrapper.set(Option.some(nu));
+ return nu;
+ });
+ };
+ var processElements = function (elems) {
+ each(elems, processElement);
+ };
+ var processElement = function (elem) {
+ var ctx = context(editor, elem, 'span', name(elem));
+ switch (ctx) {
+ case 'invalid-child': {
+ finishWrapper();
+ var children$$1 = children(elem);
+ processElements(children$$1);
+ finishWrapper();
+ break;
+ }
+ case 'valid': {
+ var w = getOrOpenWrapper();
+ wrap$1(elem, w);
+ break;
+ }
+ case 'skipping':
+ case 'existing':
+ case 'caret':
+ }
+ };
+ var processNodes = function (nodes) {
+ var elems = map(nodes, Element$$1.fromDom);
+ processElements(elems);
+ };
+ RangeWalk.walk(editor.dom, rng, function (nodes) {
+ finishWrapper();
+ processNodes(nodes);
+ });
+ return newWrappers;
+ };
+ var annotateWithBookmark = function (editor, name$$1, settings, data) {
+ editor.undoManager.transact(function () {
+ var initialRng = editor.selection.getRng();
+ if (initialRng.collapsed) {
+ applyWordGrab(editor, initialRng);
+ }
+ if (editor.selection.getRng().collapsed) {
+ var wrapper = makeAnnotation(editor.getDoc(), data, name$$1, settings.decorate);
+ set$2(wrapper, '\xA0');
+ editor.selection.getRng().insertNode(wrapper.dom());
+ editor.selection.select(wrapper.dom());
+ } else {
+ var bookmark = GetBookmark.getPersistentBookmark(editor.selection, false);
+ var rng = editor.selection.getRng();
+ annotate(editor, rng, name$$1, settings.decorate, data);
+ editor.selection.moveToBookmark(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 api = NodeValue($_fxxo5411jjgwe7lq.isText, 'text');
- var get$4 = function (element) {
- return api.get(element);
- };
- var getOption = function (element) {
- return api.getOption(element);
- };
- var set$2 = function (element, value) {
- api.set(element, value);
- };
- var $_8mxs233ejjgwe82u = {
- get: get$4,
- getOption: getOption,
- set: set$2
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function Annotator (editor) {
+ var registry = create$1();
+ setup$1(editor, registry);
+ var changes = setup(editor, registry);
+ return {
+ register: function (name, settings) {
+ registry.register(name, settings);
+ },
+ annotate: function (name, data) {
+ registry.lookup(name).each(function (settings) {
+ annotateWithBookmark(editor, name, settings, data);
+ });
+ },
+ annotationChanged: function (name, callback) {
+ changes.addListener(name, callback);
+ },
+ remove: function (name) {
+ identify(editor, Option.some(name)).each(function (_a) {
+ var elements = _a.elements;
+ each(elements, unwrap);
+ });
+ },
+ getAll: function (name) {
+ var directory = findAll(editor, name);
+ return map$2(directory, function (elems) {
+ return map(elems, function (elem) {
+ return elem.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 isZeroWidth = function (elem) {
- return $_fxxo5411jjgwe7lq.isText(elem) && $_8mxs233ejjgwe82u.get(elem) === zeroWidth();
- };
- var context = function (editor, elem, wrapName, nodeName) {
- return $_d3rmjp18jjgwe7nc.parent(elem).fold(function () {
- return 'skipping';
- }, function (parent) {
- if (nodeName === 'br' || isZeroWidth(elem)) {
- return 'skipping';
- } else if (isAnnotation(elem)) {
- return 'existing';
- } else if (isCaretNode(elem)) {
- return 'caret';
- } else if (!$_4301413ajjgwe82g.isValid(editor, wrapName, nodeName) || !$_4301413ajjgwe82g.isValid(editor, $_fxxo5411jjgwe7lq.name(parent), wrapName)) {
- return 'invalid-child';
- } else {
- return 'valid';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasOnlyOneChild = function (node) {
+ return node.firstChild && node.firstChild === node.lastChild;
+ };
+ var isPaddingNode = function (node) {
+ return node.name === 'br' || node.value === '\xA0';
+ };
+ var isPaddedEmptyBlock = function (schema, node) {
+ var blockElements = schema.getBlockElements();
+ return blockElements[node.name] && hasOnlyOneChild(node) && isPaddingNode(node.firstChild);
+ };
+ var isEmptyFragmentElement = function (schema, node) {
+ var nonEmptyElements = schema.getNonEmptyElements();
+ return node && (node.isEmpty(nonEmptyElements) || isPaddedEmptyBlock(schema, node));
+ };
+ var isListFragment = function (schema, fragment) {
+ var firstChild = fragment.firstChild;
+ var lastChild = fragment.lastChild;
+ if (firstChild && firstChild.name === 'meta') {
+ firstChild = firstChild.next;
</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 __rest = undefined && undefined.__rest || function (s, e) {
- var t = {};
- for (var p in s)
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
- t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === 'function')
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++)
- if (e.indexOf(p[i]) < 0)
- t[p[i]] = s[p[i]];
- return t;
- };
- var applyWordGrab = function (editor, rng) {
- var r = $_1f06hv2ujjgwe7y7.expandRng(editor, rng, [{ inline: true }], false);
- rng.setStart(r.startContainer, r.startOffset);
- rng.setEnd(r.endContainer, r.endOffset);
- editor.selection.setRng(rng);
- };
- var annotate = function (editor, rng, annotationName, decorate, _a) {
- var _b = _a.uid, uid = _b === void 0 ? generate('mce-annotation') : _b, data = __rest(_a, ['uid']);
- var newWrappers = [];
- var master = Element$$1.fromTag('span');
- $_9lrjdk23jjgwe7u2.add(master, annotation());
- $_etx7gr15jjgwe7mr.set(master, '' + dataAnnotationId(), uid);
- $_etx7gr15jjgwe7mr.set(master, '' + dataAnnotation(), annotationName);
- var _c = decorate(uid, data), _d = _c.attributes, attributes = _d === void 0 ? {} : _d, _e = _c.classes, classes = _e === void 0 ? [] : _e;
- $_etx7gr15jjgwe7mr.setAll(master, attributes);
- $_cu95hr2hjjgwe7w8.add(master, classes);
- var wrapper = Cell(Option.none());
- var finishWrapper = function () {
- wrapper.set(Option.none());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (lastChild && lastChild.attr('id') === 'mce_marker') {
+ lastChild = lastChild.prev;
+ }
+ if (isEmptyFragmentElement(schema, lastChild)) {
+ lastChild = lastChild.prev;
+ }
+ if (!firstChild || firstChild !== lastChild) {
+ return false;
+ }
+ return firstChild.name === 'ul' || firstChild.name === 'ol';
</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 getOrOpenWrapper = function () {
- return wrapper.get().getOrThunk(function () {
- var nu = $_6do1m42ijjgwe7wd.shallow(master);
- newWrappers.push(nu);
- wrapper.set(Option.some(nu));
- return nu;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var cleanupDomFragment = function (domFragment) {
+ var firstChild = domFragment.firstChild;
+ var lastChild = domFragment.lastChild;
+ if (firstChild && firstChild.nodeName === 'META') {
+ firstChild.parentNode.removeChild(firstChild);
+ }
+ if (lastChild && lastChild.id === 'mce_marker') {
+ lastChild.parentNode.removeChild(lastChild);
+ }
+ return domFragment;
+ };
+ var toDomFragment = function (dom, serializer, fragment) {
+ var html = serializer.serialize(fragment);
+ var domFragment = dom.createFragment(html);
+ return cleanupDomFragment(domFragment);
+ };
+ var listItems$1 = function (elm) {
+ return Tools.grep(elm.childNodes, function (child) {
+ return child.nodeName === 'LI';
</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">- var processElements = function (elems) {
- each(elems, processElement);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isPadding = function (node) {
+ return node.data === '\xA0' || NodeType.isBr(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 processElement = function (elem) {
- var ctx = context(editor, elem, 'span', $_fxxo5411jjgwe7lq.name(elem));
- switch (ctx) {
- case 'invalid-child': {
- finishWrapper();
- var children = $_d3rmjp18jjgwe7nc.children(elem);
- processElements(children);
- finishWrapper();
- break;
- }
- case 'valid': {
- var w = getOrOpenWrapper();
- $_ewo3u51yjjgwe7su.wrap(elem, w);
- break;
- }
- case 'skipping':
- case 'existing':
- case 'caret':
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isListItemPadded = function (node) {
+ return node && node.firstChild && node.firstChild === node.lastChild && isPadding(node.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">- var processNodes = function (nodes) {
- var elems = map(nodes, Element$$1.fromDom);
- processElements(elems);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isEmptyOrPadded = function (elm) {
+ return !elm.firstChild || isListItemPadded(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">- $_e2gzn43bjjgwe82k.walk(editor.dom, rng, function (nodes) {
- finishWrapper();
- processNodes(nodes);
- });
- return newWrappers;
- };
- var annotateWithBookmark = function (editor, name, settings, data) {
- editor.undoManager.transact(function () {
- var initialRng = editor.selection.getRng();
- if (initialRng.collapsed) {
- applyWordGrab(editor, initialRng);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var trimListItems = function (elms) {
+ return elms.length > 0 && isEmptyOrPadded(elms[elms.length - 1]) ? elms.slice(0, -1) : elms;
+ };
+ var getParentLi = function (dom, node) {
+ var parentBlock = dom.getParent(node, dom.isBlock);
+ return parentBlock && parentBlock.nodeName === 'LI' ? parentBlock : null;
+ };
+ var isParentBlockLi = function (dom, node) {
+ return !!getParentLi(dom, node);
+ };
+ var getSplit = function (parentNode, rng) {
+ var beforeRng = rng.cloneRange();
+ var afterRng = rng.cloneRange();
+ beforeRng.setStartBefore(parentNode);
+ afterRng.setEndAfter(parentNode);
+ return [
+ beforeRng.cloneContents(),
+ afterRng.cloneContents()
+ ];
+ };
+ var findFirstIn = function (node, rootNode) {
+ var caretPos = CaretPosition$1.before(node);
+ var caretWalker = CaretWalker(rootNode);
+ var newCaretPos = caretWalker.next(caretPos);
+ return newCaretPos ? newCaretPos.toRange() : null;
+ };
+ var findLastOf = function (node, rootNode) {
+ var caretPos = CaretPosition$1.after(node);
+ var caretWalker = CaretWalker(rootNode);
+ var newCaretPos = caretWalker.prev(caretPos);
+ return newCaretPos ? newCaretPos.toRange() : null;
+ };
+ var insertMiddle = function (target, elms, rootNode, rng) {
+ var parts = getSplit(target, rng);
+ var parentElm = target.parentNode;
+ parentElm.insertBefore(parts[0], target);
+ Tools.each(elms, function (li) {
+ parentElm.insertBefore(li, target);
+ });
+ parentElm.insertBefore(parts[1], target);
+ parentElm.removeChild(target);
+ return findLastOf(elms[elms.length - 1], rootNode);
+ };
+ var insertBefore = function (target, elms, rootNode) {
+ var parentElm = target.parentNode;
+ Tools.each(elms, function (elm) {
+ parentElm.insertBefore(elm, target);
+ });
+ return findFirstIn(target, rootNode);
+ };
+ var insertAfter = function (target, elms, rootNode, dom) {
+ dom.insertAfter(elms.reverse(), target);
+ return findLastOf(elms[0], rootNode);
+ };
+ var insertAtCaret = function (serializer, dom, rng, fragment) {
+ var domFragment = toDomFragment(dom, serializer, fragment);
+ var liTarget = getParentLi(dom, rng.startContainer);
+ var liElms = trimListItems(listItems$1(domFragment.firstChild));
+ var BEGINNING = 1, END = 2;
+ var rootNode = dom.getRoot();
+ var isAt = function (location) {
+ var caretPos = CaretPosition$1.fromRangeStart(rng);
+ var caretWalker = CaretWalker(dom.getRoot());
+ var newPos = location === BEGINNING ? caretWalker.prev(caretPos) : caretWalker.next(caretPos);
+ return newPos ? getParentLi(dom, newPos.getNode()) !== liTarget : true;
+ };
+ if (isAt(BEGINNING)) {
+ return insertBefore(liTarget, liElms, rootNode);
+ } else if (isAt(END)) {
+ return insertAfter(liTarget, liElms, rootNode, 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 bookmark = $_ga29lf2jjjgwe7wh.getPersistentBookmark(editor.selection, true);
- var rng = editor.selection.getRng();
- annotate(editor, rng, name, settings.decorate, data);
- editor.selection.moveToBookmark(bookmark);
- });
- };
-
- function Annotator (editor) {
- var registry = create$1();
- setup$1(editor, registry);
- var changes = setup(editor, registry);
- return {
- register: function (name, settings) {
- registry.register(name, settings);
- },
- annotate: function (name, data) {
- registry.lookup(name).each(function (settings) {
- annotateWithBookmark(editor, name, settings, data);
- });
- },
- annotationChanged: function (name, callback) {
- changes.addListener(name, callback);
- },
- remove: function (name) {
- identify(editor, Option.some(name)).each(function (_a) {
- var elements = _a.elements;
- each(elements, $_81exq51wjjgwe7sm.unwrap);
- });
- },
- getAll: function (name) {
- var directory = findAll(editor, name);
- return map$2(directory, function (elems) {
- return map(elems, function (elem) {
- return elem.dom();
- });
- });
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return insertMiddle(liTarget, liElms, rootNode, 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">- }
-
- var hasOnlyOneChild = function (node) {
- return node.firstChild && node.firstChild === node.lastChild;
- };
- var isPaddingNode = function (node) {
- return node.name === 'br' || node.value === '\xA0';
- };
- var isPaddedEmptyBlock = function (schema, node) {
- var blockElements = schema.getBlockElements();
- return blockElements[node.name] && hasOnlyOneChild(node) && isPaddingNode(node.firstChild);
- };
- var isEmptyFragmentElement = function (schema, node) {
- var nonEmptyElements = schema.getNonEmptyElements();
- return node && (node.isEmpty(nonEmptyElements) || isPaddedEmptyBlock(schema, node));
- };
- var isListFragment = function (schema, fragment) {
- var firstChild = fragment.firstChild;
- var lastChild = fragment.lastChild;
- if (firstChild && firstChild.name === 'meta') {
- firstChild = firstChild.next;
- }
- if (lastChild && lastChild.attr('id') === 'mce_marker') {
- lastChild = lastChild.prev;
- }
- if (isEmptyFragmentElement(schema, lastChild)) {
- lastChild = lastChild.prev;
- }
- if (!firstChild || firstChild !== lastChild) {
- return false;
- }
- return firstChild.name === 'ul' || firstChild.name === 'ol';
- };
- var cleanupDomFragment = function (domFragment) {
- var firstChild = domFragment.firstChild;
- var lastChild = domFragment.lastChild;
- if (firstChild && firstChild.nodeName === 'META') {
- firstChild.parentNode.removeChild(firstChild);
- }
- if (lastChild && lastChild.id === 'mce_marker') {
- lastChild.parentNode.removeChild(lastChild);
- }
- return domFragment;
- };
- var toDomFragment = function (dom, serializer, fragment) {
- var html = serializer.serialize(fragment);
- var domFragment = dom.createFragment(html);
- return cleanupDomFragment(domFragment);
- };
- var listItems$1 = function (elm) {
- return $_6cwiepljjgwe7j4.grep(elm.childNodes, function (child) {
- return child.nodeName === 'LI';
- });
- };
- var isPadding = function (node) {
- return node.data === '\xA0' || $_3b9u2y1rjjgwe7qe.isBr(node);
- };
- var isListItemPadded = function (node) {
- return node && node.firstChild && node.firstChild === node.lastChild && isPadding(node.firstChild);
- };
- var isEmptyOrPadded = function (elm) {
- return !elm.firstChild || isListItemPadded(elm);
- };
- var trimListItems = function (elms) {
- return elms.length > 0 && isEmptyOrPadded(elms[elms.length - 1]) ? elms.slice(0, -1) : elms;
- };
- var getParentLi = function (dom, node) {
- var parentBlock = dom.getParent(node, dom.isBlock);
- return parentBlock && parentBlock.nodeName === 'LI' ? parentBlock : null;
- };
- var isParentBlockLi = function (dom, node) {
- return !!getParentLi(dom, node);
- };
- var getSplit = function (parentNode, rng) {
- var beforeRng = rng.cloneRange();
- var afterRng = rng.cloneRange();
- beforeRng.setStartBefore(parentNode);
- afterRng.setEndAfter(parentNode);
- return [
- beforeRng.cloneContents(),
- afterRng.cloneContents()
- ];
- };
- var findFirstIn = function (node, rootNode) {
- var caretPos = CaretPosition$1.before(node);
- var caretWalker = CaretWalker(rootNode);
- var newCaretPos = caretWalker.next(caretPos);
- return newCaretPos ? newCaretPos.toRange() : null;
- };
- var findLastOf = function (node, rootNode) {
- var caretPos = CaretPosition$1.after(node);
- var caretWalker = CaretWalker(rootNode);
- var newCaretPos = caretWalker.prev(caretPos);
- return newCaretPos ? newCaretPos.toRange() : null;
- };
- var insertMiddle = function (target, elms, rootNode, rng) {
- var parts = getSplit(target, rng);
- var parentElm = target.parentNode;
- parentElm.insertBefore(parts[0], target);
- $_6cwiepljjgwe7j4.each(elms, function (li) {
- parentElm.insertBefore(li, target);
- });
- parentElm.insertBefore(parts[1], target);
- parentElm.removeChild(target);
- return findLastOf(elms[elms.length - 1], rootNode);
- };
- var insertBefore = function (target, elms, rootNode) {
- var parentElm = target.parentNode;
- $_6cwiepljjgwe7j4.each(elms, function (elm) {
- parentElm.insertBefore(elm, target);
- });
- return findFirstIn(target, rootNode);
- };
- var insertAfter = function (target, elms, rootNode, dom) {
- dom.insertAfter(elms.reverse(), target);
- return findLastOf(elms[0], rootNode);
- };
- var insertAtCaret = function (serializer, dom, rng, fragment) {
- var domFragment = toDomFragment(dom, serializer, fragment);
- var liTarget = getParentLi(dom, rng.startContainer);
- var liElms = trimListItems(listItems$1(domFragment.firstChild));
- var BEGINNING = 1, END = 2;
- var rootNode = dom.getRoot();
- var isAt = function (location) {
- var caretPos = CaretPosition$1.fromRangeStart(rng);
- var caretWalker = CaretWalker(dom.getRoot());
- var newPos = location === BEGINNING ? caretWalker.prev(caretPos) : caretWalker.next(caretPos);
- return newPos ? getParentLi(dom, newPos.getNode()) !== liTarget : true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var InsertList = {
+ isListFragment: isListFragment,
+ insertAtCaret: insertAtCaret,
+ isParentBlockLi: isParentBlockLi,
+ trimListItems: trimListItems,
+ listItems: listItems$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 (isAt(BEGINNING)) {
- return insertBefore(liTarget, liElms, rootNode);
- } else if (isAt(END)) {
- return insertAfter(liTarget, liElms, rootNode, dom);
- }
- return insertMiddle(liTarget, liElms, rootNode, rng);
- };
- var $_1z3gsr3jjjgwe84c = {
- isListFragment: isListFragment,
- insertAtCaret: insertAtCaret,
- isParentBlockLi: isParentBlockLi,
- trimListItems: trimListItems,
- listItems: listItems$1
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var each$9 = $_6cwiepljjgwe7j4.each;
- var ElementUtils = function (dom) {
- this.compare = function (node1, node2) {
- if (node1.nodeName !== node2.nodeName) {
- return false;
- }
- var getAttribs = function (node) {
- var attribs = {};
- each$9(dom.getAttribs(node), function (attr) {
- var name = attr.nodeName.toLowerCase();
- if (name.indexOf('_') !== 0 && name !== 'style' && name.indexOf('data-') !== 0) {
- attribs[name] = dom.getAttrib(node, name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var each$9 = Tools.each;
+ var ElementUtils = function (dom) {
+ this.compare = function (node1, node2) {
+ if (node1.nodeName !== node2.nodeName) {
+ return false;
+ }
+ var getAttribs = function (node) {
+ var attribs = {};
+ each$9(dom.getAttribs(node), function (attr) {
+ var name = attr.nodeName.toLowerCase();
+ if (name.indexOf('_') !== 0 && name !== 'style' && name.indexOf('data-') !== 0) {
+ attribs[name] = dom.getAttrib(node, name);
+ }
+ });
+ return attribs;
+ };
+ var compareObjects = function (obj1, obj2) {
+ var value, name;
+ for (name in obj1) {
+ if (obj1.hasOwnProperty(name)) {
+ value = obj2[name];
+ if (typeof value === 'undefined') {
+ return false;
+ }
+ if (obj1[name] !== value) {
+ return false;
+ }
+ delete obj2[name];
+ }
</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 attribs;
- };
- var compareObjects = function (obj1, obj2) {
- var value, name;
- for (name in obj1) {
- if (obj1.hasOwnProperty(name)) {
- value = obj2[name];
- if (typeof value === 'undefined') {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (name in obj2) {
+ if (obj2.hasOwnProperty(name)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (obj1[name] !== value) {
- return false;
- }
- delete obj2[name];
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return true;
+ };
+ if (!compareObjects(getAttribs(node1), getAttribs(node2))) {
+ 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">- for (name in obj2) {
- if (obj2.hasOwnProperty(name)) {
- return false;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) {
+ 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 true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return !Bookmarks.isBookmarkNode(node1) && !Bookmarks.isBookmarkNode(node2);
</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 (!compareObjects(getAttribs(node1), getAttribs(node2))) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+
+ var getLastChildren = function (elm) {
+ var children$$1 = [];
+ var rawNode = elm.dom();
+ while (rawNode) {
+ children$$1.push(Element$$1.fromDom(rawNode));
+ rawNode = rawNode.lastChild;
</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 (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return children$$1;
+ };
+ var removeTrailingBr = function (elm) {
+ var allBrs = descendants$1(elm, 'br');
+ var brs = filter(getLastChildren(elm).slice(-1), isBr);
+ if (allBrs.length === brs.length) {
+ each(brs, remove$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">- return !$_6refgt2vjjgwe7yn.isBookmarkNode(node1) && !$_6refgt2vjjgwe7yn.isBookmarkNode(node2);
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
-
- var getLastChildren = function (elm) {
- var children = [];
- var rawNode = elm.dom();
- while (rawNode) {
- children.push(Element$$1.fromDom(rawNode));
- rawNode = rawNode.lastChild;
- }
- return children;
- };
- var removeTrailingBr = function (elm) {
- var allBrs = $_d3ydn427jjgwe7uf.descendants(elm, 'br');
- var brs = filter(getLastChildren(elm).slice(-1), isBr);
- if (allBrs.length === brs.length) {
- each(brs, $_81exq51wjjgwe7sm.remove);
- }
- };
- var fillWithPaddingBr = function (elm) {
- $_81exq51wjjgwe7sm.empty(elm);
- $_ewo3u51yjjgwe7su.append(elm, Element$$1.fromHtml('<br data-mce-bogus="1">'));
- };
- var isPaddingContents = function (elm) {
- return $_fxxo5411jjgwe7lq.isText(elm) ? $_8mxs233ejjgwe82u.get(elm) === '\xA0' : isBr(elm);
- };
- var isPaddedElement = function (elm) {
- return filter($_d3rmjp18jjgwe7nc.children(elm), isPaddingContents).length === 1;
- };
- var trimBlockTrailingBr = function (elm) {
- $_d3rmjp18jjgwe7nc.lastChild(elm).each(function (lastChild) {
- $_d3rmjp18jjgwe7nc.prevSibling(lastChild).each(function (lastChildPrevSibling) {
- if (isBlock(elm) && isBr(lastChild) && isBlock(lastChildPrevSibling)) {
- $_81exq51wjjgwe7sm.remove(lastChild);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fillWithPaddingBr = function (elm) {
+ empty(elm);
+ append(elm, Element$$1.fromHtml('<br data-mce-bogus="1">'));
+ };
+ var isPaddingContents = function (elm) {
+ return isText(elm) ? get$6(elm) === '\xA0' : isBr(elm);
+ };
+ var isPaddedElement = function (elm) {
+ return filter(children(elm), isPaddingContents).length === 1;
+ };
+ var trimBlockTrailingBr = function (elm) {
+ lastChild(elm).each(function (lastChild$$1) {
+ prevSibling(lastChild$$1).each(function (lastChildPrevSibling) {
+ if (isBlock(elm) && isBr(lastChild$$1) && isBlock(lastChildPrevSibling)) {
+ remove$2(lastChild$$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">- });
- };
- var $_fhp7pa3ljjgwe84n = {
- removeTrailingBr: removeTrailingBr,
- fillWithPaddingBr: fillWithPaddingBr,
- isPaddedElement: isPaddedElement,
- trimBlockTrailingBr: trimBlockTrailingBr
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var PaddingBr = {
+ removeTrailingBr: removeTrailingBr,
+ fillWithPaddingBr: fillWithPaddingBr,
+ isPaddedElement: isPaddedElement,
+ trimBlockTrailingBr: trimBlockTrailingBr
+ };
</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 makeMap$3 = $_6cwiepljjgwe7j4.makeMap;
- function Writer (settings) {
- var html = [];
- var indent, indentBefore, indentAfter, encode, htmlOutput;
- settings = settings || {};
- indent = settings.indent;
- indentBefore = makeMap$3(settings.indent_before || '');
- indentAfter = makeMap$3(settings.indent_after || '');
- encode = $_6pqr9q1sjjgwe7qj.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities);
- htmlOutput = settings.element_format === 'html';
- return {
- start: function (name, attrs, empty) {
- var i, l, attr, value;
- if (indent && indentBefore[name] && html.length > 0) {
- value = html[html.length - 1];
- if (value.length > 0 && value !== '\n') {
- html.push('\n');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var makeMap$3 = Tools.makeMap;
+ function Writer (settings) {
+ var html = [];
+ var indent, indentBefore, indentAfter, encode, htmlOutput;
+ settings = settings || {};
+ indent = settings.indent;
+ indentBefore = makeMap$3(settings.indent_before || '');
+ indentAfter = makeMap$3(settings.indent_after || '');
+ encode = Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities);
+ htmlOutput = settings.element_format === 'html';
+ return {
+ start: function (name, attrs, empty) {
+ var i, l, attr, value;
+ if (indent && indentBefore[name] && html.length > 0) {
+ value = html[html.length - 1];
+ if (value.length > 0 && value !== '\n') {
+ html.push('\n');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- html.push('<', name);
- if (attrs) {
- for (i = 0, l = attrs.length; i < l; i++) {
- attr = attrs[i];
- html.push(' ', attr.name, '="', encode(attr.value, true), '"');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ html.push('<', name);
+ if (attrs) {
+ for (i = 0, l = attrs.length; i < l; i++) {
+ attr = attrs[i];
+ html.push(' ', attr.name, '="', encode(attr.value, true), '"');
+ }
</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 (!empty || htmlOutput) {
- html[html.length] = '>';
- } else {
- html[html.length] = ' />';
- }
- if (empty && indent && indentAfter[name] && html.length > 0) {
- value = html[html.length - 1];
- if (value.length > 0 && value !== '\n') {
- html.push('\n');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!empty || htmlOutput) {
+ html[html.length] = '>';
+ } else {
+ html[html.length] = ' />';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- },
- end: function (name) {
- var value;
- html.push('</', name, '>');
- if (indent && indentAfter[name] && html.length > 0) {
- value = html[html.length - 1];
- if (value.length > 0 && value !== '\n') {
- html.push('\n');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (empty && indent && indentAfter[name] && html.length > 0) {
+ value = html[html.length - 1];
+ if (value.length > 0 && value !== '\n') {
+ html.push('\n');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- },
- text: function (text, raw) {
- if (text.length > 0) {
- html[html.length] = raw ? text : encode(text);
- }
- },
- cdata: function (text) {
- html.push('<![CDATA[', text, ']]>');
- },
- comment: function (text) {
- html.push('<!--', text, '-->');
- },
- pi: function (name, text) {
- if (text) {
- html.push('<?', name, ' ', encode(text), '?>');
- } else {
- html.push('<?', name, '?>');
- }
- if (indent) {
- html.push('\n');
- }
- },
- doctype: function (text) {
- html.push('<!DOCTYPE', text, '>', indent ? '\n' : '');
- },
- reset: function () {
- html.length = 0;
- },
- getContent: function () {
- return html.join('').replace(/\n$/, '');
- }
- };
- }
-
- function HtmlSerializer (settings, schema) {
- if (schema === void 0) {
- schema = Schema();
- }
- var writer = Writer(settings);
- settings = settings || {};
- settings.validate = 'validate' in settings ? settings.validate : true;
- var serialize = function (node) {
- var handlers, validate;
- validate = settings.validate;
- handlers = {
- 3: function (node) {
- writer.text(node.value, node.raw);
</del><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 8: function (node) {
- writer.comment(node.value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ end: function (name) {
+ var value;
+ html.push('</', name, '>');
+ if (indent && indentAfter[name] && html.length > 0) {
+ value = html[html.length - 1];
+ if (value.length > 0 && value !== '\n') {
+ html.push('\n');
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 7: function (node) {
- writer.pi(node.name, node.value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ text: function (text, raw) {
+ if (text.length > 0) {
+ html[html.length] = raw ? text : encode(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">- 10: function (node) {
- writer.doctype(node.value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ cdata: function (text) {
+ html.push('<![CDATA[', 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">- 4: function (node) {
- writer.cdata(node.value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ comment: function (text) {
+ html.push('<!--', 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">- 11: function (node) {
- if (node = node.firstChild) {
- do {
- walk(node);
- } while (node = node.next);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ pi: function (name, text) {
+ if (text) {
+ html.push('<?', name, ' ', encode(text), '?>');
+ } else {
+ html.push('<?', name, '?>');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (indent) {
+ html.push('\n');
+ }
+ },
+ doctype: function (text) {
+ html.push('<!DOCTYPE', text, '>', indent ? '\n' : '');
+ },
+ reset: function () {
+ html.length = 0;
+ },
+ getContent: function () {
+ return html.join('').replace(/\n$/, '');
</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">- writer.reset();
- var walk = function (node) {
- var handler = handlers[node.type];
- var name, isEmpty, attrs, attrName, attrValue, sortedAttrs, i, l, elementRule;
- if (!handler) {
- name = node.name;
- isEmpty = node.shortEnded;
- attrs = node.attributes;
- if (validate && attrs && attrs.length > 1) {
- sortedAttrs = [];
- sortedAttrs.map = {};
- elementRule = schema.getElementRule(node.name);
- if (elementRule) {
- for (i = 0, l = elementRule.attributesOrder.length; i < l; i++) {
- attrName = elementRule.attributesOrder[i];
- if (attrName in attrs.map) {
- attrValue = attrs.map[attrName];
- sortedAttrs.map[attrName] = attrValue;
- sortedAttrs.push({
- name: attrName,
- value: attrValue
- });
- }
- }
- for (i = 0, l = attrs.length; i < l; i++) {
- attrName = attrs[i].name;
- if (!(attrName in sortedAttrs.map)) {
- attrValue = attrs.map[attrName];
- sortedAttrs.map[attrName] = attrValue;
- sortedAttrs.push({
- name: attrName,
- value: attrValue
- });
- }
- }
- attrs = sortedAttrs;
- }
- }
- writer.start(node.name, attrs, isEmpty);
- if (!isEmpty) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+
+ function Serializer (settings, schema) {
+ if (schema === void 0) {
+ schema = Schema();
+ }
+ var writer = Writer(settings);
+ settings = settings || {};
+ settings.validate = 'validate' in settings ? settings.validate : true;
+ var serialize = function (node) {
+ var handlers, validate;
+ validate = settings.validate;
+ handlers = {
+ 3: function (node) {
+ writer.text(node.value, node.raw);
+ },
+ 8: function (node) {
+ writer.comment(node.value);
+ },
+ 7: function (node) {
+ writer.pi(node.name, node.value);
+ },
+ 10: function (node) {
+ writer.doctype(node.value);
+ },
+ 4: function (node) {
+ writer.cdata(node.value);
+ },
+ 11: function (node) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (node = node.firstChild) {
</span><span class="cx" style="display: block; padding: 0 10px"> do {
</span><span class="cx" style="display: block; padding: 0 10px"> walk(node);
</span><span class="cx" style="display: block; padding: 0 10px"> } while (node = node.next);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- writer.end(name);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ writer.reset();
+ var walk = function (node) {
+ var handler = handlers[node.type];
+ var name, isEmpty, attrs, attrName, attrValue, sortedAttrs, i, l, elementRule;
+ if (!handler) {
+ name = node.name;
+ isEmpty = node.shortEnded;
+ attrs = node.attributes;
+ if (validate && attrs && attrs.length > 1) {
+ sortedAttrs = [];
+ sortedAttrs.map = {};
+ elementRule = schema.getElementRule(node.name);
+ if (elementRule) {
+ for (i = 0, l = elementRule.attributesOrder.length; i < l; i++) {
+ attrName = elementRule.attributesOrder[i];
+ if (attrName in attrs.map) {
+ attrValue = attrs.map[attrName];
+ sortedAttrs.map[attrName] = attrValue;
+ sortedAttrs.push({
+ name: attrName,
+ value: attrValue
+ });
+ }
+ }
+ for (i = 0, l = attrs.length; i < l; i++) {
+ attrName = attrs[i].name;
+ if (!(attrName in sortedAttrs.map)) {
+ attrValue = attrs.map[attrName];
+ sortedAttrs.map[attrName] = attrValue;
+ sortedAttrs.push({
+ name: attrName,
+ value: attrValue
+ });
+ }
+ }
+ attrs = sortedAttrs;
+ }
+ }
+ writer.start(node.name, attrs, isEmpty);
+ if (!isEmpty) {
+ if (node = node.firstChild) {
+ do {
+ walk(node);
+ } while (node = node.next);
+ }
+ writer.end(name);
+ }
+ } else {
+ handler(node);
+ }
+ };
+ if (node.type === 1 && !settings.inner) {
+ walk(node);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- handler(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ handlers[11](node);
</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 writer.getContent();
</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.type === 1 && !settings.inner) {
- walk(node);
- } else {
- handlers[11](node);
- }
- return writer.getContent();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return { serialize: serialize };
+ }
+
+ var createRange$1 = function (sc, so, ec, eo) {
+ var rng = document.createRange();
+ rng.setStart(sc, so);
+ rng.setEnd(ec, eo);
+ return 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">- return { serialize: serialize };
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var normalizeBlockSelectionRange = function (rng) {
+ var startPos = CaretPosition$1.fromRangeStart(rng);
+ var endPos = CaretPosition$1.fromRangeEnd(rng);
+ var rootNode = rng.commonAncestorContainer;
+ return CaretFinder.fromPosition(false, rootNode, endPos).map(function (newEndPos) {
+ if (!isInSameBlock(startPos, endPos, rootNode) && isInSameBlock(startPos, newEndPos, rootNode)) {
+ return createRange$1(startPos.container(), startPos.offset(), newEndPos.container(), newEndPos.offset());
+ } else {
+ return rng;
+ }
+ }).getOr(rng);
+ };
+ var normalize = function (rng) {
+ return rng.collapsed ? rng : normalizeBlockSelectionRange(rng);
+ };
+ var RangeNormalizer = { normalize: normalize };
</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 createRange$1 = function (sc, so, ec, eo) {
- var rng = document.createRange();
- rng.setStart(sc, so);
- rng.setEnd(ec, eo);
- return rng;
- };
- var normalizeBlockSelectionRange = function (rng) {
- var startPos = CaretPosition$1.fromRangeStart(rng);
- var endPos = CaretPosition$1.fromRangeEnd(rng);
- var rootNode = rng.commonAncestorContainer;
- return $_8q1ver2yjjgwe7z3.fromPosition(false, rootNode, endPos).map(function (newEndPos) {
- if (!isInSameBlock(startPos, endPos, rootNode) && isInSameBlock(startPos, newEndPos, rootNode)) {
- return createRange$1(startPos.container(), startPos.offset(), newEndPos.container(), newEndPos.offset());
- } else {
- return rng;
- }
- }).getOr(rng);
- };
- var normalize = function (rng) {
- return rng.collapsed ? rng : normalizeBlockSelectionRange(rng);
- };
- var $_e1wrz53ojjgwe85f = { normalize: normalize };
-
- var isTableCell$2 = $_3b9u2y1rjjgwe7qe.matchNodeNames('td th');
- var validInsertion = function (editor, value, parentNode) {
- if (parentNode.getAttribute('data-mce-bogus') === 'all') {
- parentNode.parentNode.insertBefore(editor.dom.createFragment(value), parentNode);
- } else {
- var node = parentNode.firstChild;
- var node2 = parentNode.lastChild;
- if (!node || node === node2 && node.nodeName === 'BR') {
- editor.dom.setHTML(parentNode, value);
- } else {
- editor.selection.setContent(value);
- }
- }
- };
- var trimBrsFromTableCell = function (dom, elm) {
- Option.from(dom.getParent(elm, 'td,th')).map(Element$$1.fromDom).each($_fhp7pa3ljjgwe84n.trimBlockTrailingBr);
- };
- var insertHtmlAtCaret = function (editor, value, details) {
- var parser, serializer, parentNode, rootNode, fragment, args;
- var marker, rng, node, node2, bookmarkHtml, merge;
- var textInlineElements = editor.schema.getTextInlineElements();
- var selection = editor.selection, dom = editor.dom;
- var trimOrPaddLeftRight = function (html) {
- var rng, container, offset;
- rng = selection.getRng();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isAfterNbsp = function (container, offset) {
+ return NodeType.isText(container) && container.nodeValue[offset - 1] === '\xA0';
+ };
+ var trimOrPadLeftRight = function (rng, html) {
+ var container, offset;
</ins><span class="cx" style="display: block; padding: 0 10px"> container = rng.startContainer;
</span><span class="cx" style="display: block; padding: 0 10px"> offset = rng.startOffset;
</span><span class="cx" style="display: block; padding: 0 10px"> var hasSiblingText = function (siblingName) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11443,9 +10359,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return html;
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var trimNbspAfterDeleteAndPaddValue = function () {
- var rng, container, offset;
- rng = selection.getRng();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var trimNbspAfterDeleteAndPadValue = function (rng, value) {
+ var container, offset;
</ins><span class="cx" style="display: block; padding: 0 10px"> container = rng.startContainer;
</span><span class="cx" style="display: block; padding: 0 10px"> offset = rng.startOffset;
</span><span class="cx" style="display: block; padding: 0 10px"> if (container.nodeType === 3 && rng.collapsed) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11461,11 +10376,45 @@
</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><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">- var reduceInlineTextElements = function () {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var isTableCell$2 = NodeType.matchNodeNames('td th');
+ var selectionSetContent = function (editor, content) {
+ var rng = editor.selection.getRng();
+ var container = rng.startContainer;
+ var offset = rng.startOffset;
+ if (rng.collapsed && isAfterNbsp(container, offset) && NodeType.isText(container)) {
+ container.insertData(offset - 1, ' ');
+ container.deleteData(offset, 1);
+ rng.setStart(container, offset);
+ rng.setEnd(container, offset);
+ editor.selection.setRng(rng);
+ }
+ editor.selection.setContent(content);
+ };
+ var validInsertion = function (editor, value, parentNode) {
+ if (parentNode.getAttribute('data-mce-bogus') === 'all') {
+ parentNode.parentNode.insertBefore(editor.dom.createFragment(value), parentNode);
+ } else {
+ var node = parentNode.firstChild;
+ var node2 = parentNode.lastChild;
+ if (!node || node === node2 && node.nodeName === 'BR') {
+ editor.dom.setHTML(parentNode, value);
+ } else {
+ selectionSetContent(editor, value);
+ }
+ }
+ };
+ var trimBrsFromTableCell = function (dom, elm) {
+ Option.from(dom.getParent(elm, 'td,th')).map(Element$$1.fromDom).each(PaddingBr.trimBlockTrailingBr);
+ };
+ var reduceInlineTextElements = function (editor, merge) {
+ var textInlineElements = editor.schema.getTextInlineElements();
+ var dom = editor.dom;
</ins><span class="cx" style="display: block; padding: 0 10px"> if (merge) {
</span><span class="cx" style="display: block; padding: 0 10px"> var root_1 = editor.getBody(), elementUtils_1 = new ElementUtils(dom);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_6cwiepljjgwe7j4.each(dom.select('*[data-mce-fragment]'), function (node) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Tools.each(dom.select('*[data-mce-fragment]'), function (node) {
</ins><span class="cx" style="display: block; padding: 0 10px"> for (var testNode = node.parentNode; testNode && testNode !== root_1; testNode = testNode.parentNode) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (textInlineElements[node.nodeName.toLowerCase()] && elementUtils_1.compare(testNode, node)) {
</span><span class="cx" style="display: block; padding: 0 10px"> dom.remove(node, true);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11483,7 +10432,7 @@
</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"> var umarkFragmentElements = function (elm) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_6cwiepljjgwe7j4.each(elm.getElementsByTagName('*'), function (elm) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Tools.each(elm.getElementsByTagName('*'), function (elm) {
</ins><span class="cx" style="display: block; padding: 0 10px"> elm.removeAttribute('data-mce-fragment');
</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">@@ -11490,11 +10439,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var isPartOfFragment = function (node) {
</span><span class="cx" style="display: block; padding: 0 10px"> return !!node.getAttribute('data-mce-fragment');
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var canHaveChildren = function (node) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var canHaveChildren = function (editor, node) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return node && !editor.schema.getShortEndedElements()[node.nodeName];
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var moveSelectionToMarker = function (marker) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var moveSelectionToMarker = function (editor, marker) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var parentEditableFalseElm, parentBlock, nextRng;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var dom = editor.dom, selection = editor.selection;
+ var node, node2;
</ins><span class="cx" style="display: block; padding: 0 10px"> var getContentEditableFalseParent = function (node) {
</span><span class="cx" style="display: block; padding: 0 10px"> var root = editor.getBody();
</span><span class="cx" style="display: block; padding: 0 10px"> for (; node && node !== root; node = node.parentNode) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11507,7 +10458,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if (!marker) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- selection.scrollIntoView(marker);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.selection.scrollIntoView(marker);
</ins><span class="cx" style="display: block; padding: 0 10px"> parentEditableFalseElm = getContentEditableFalseParent(marker);
</span><span class="cx" style="display: block; padding: 0 10px"> if (parentEditableFalseElm) {
</span><span class="cx" style="display: block; padding: 0 10px"> dom.remove(marker);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11514,11 +10465,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> selection.select(parentEditableFalseElm);
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- rng = dom.createRng();
</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"> node = marker.previousSibling;
</span><span class="cx" style="display: block; padding: 0 10px"> if (node && node.nodeType === 3) {
</span><span class="cx" style="display: block; padding: 0 10px"> rng.setStart(node, node.nodeValue.length);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (!$_bcvfv9ajjgwe79v.ie) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!Env.ie) {
</ins><span class="cx" style="display: block; padding: 0 10px"> node2 = marker.nextSibling;
</span><span class="cx" style="display: block; padding: 0 10px"> if (node2 && node2.nodeType === 3) {
</span><span class="cx" style="display: block; padding: 0 10px"> node.appendData(node2.data);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11552,2379 +10503,2527 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> selection.setRng(rng);
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (/^ | $/.test(value)) {
- value = trimOrPaddLeftRight(value);
- }
- parser = editor.parser;
- merge = details.merge;
- serializer = HtmlSerializer({ validate: editor.settings.validate }, editor.schema);
- bookmarkHtml = '<span id="mce_marker" data-mce-type="bookmark">​</span>';
- args = {
- content: value,
- format: 'html',
- selection: true,
- paste: details.paste
- };
- args = editor.fire('BeforeSetContent', args);
- if (args.isDefaultPrevented()) {
- editor.fire('SetContent', {
- content: args.content,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var insertHtmlAtCaret = function (editor, value, details) {
+ var parser, serializer, parentNode, rootNode, fragment, args;
+ var marker, rng, node, bookmarkHtml, merge;
+ var selection = editor.selection, dom = editor.dom;
+ if (/^ | $/.test(value)) {
+ value = trimOrPadLeftRight(selection.getRng(), value);
+ }
+ parser = editor.parser;
+ merge = details.merge;
+ serializer = Serializer({ validate: editor.settings.validate }, editor.schema);
+ bookmarkHtml = '<span id="mce_marker" data-mce-type="bookmark">​</span>';
+ args = {
+ content: value,
</ins><span class="cx" style="display: block; padding: 0 10px"> format: 'html',
</span><span class="cx" style="display: block; padding: 0 10px"> selection: true,
</span><span class="cx" style="display: block; padding: 0 10px"> paste: details.paste
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- return;
- }
- value = args.content;
- if (value.indexOf('{$caret}') === -1) {
- value += '{$caret}';
- }
- value = value.replace(/\{\$caret\}/, bookmarkHtml);
- rng = selection.getRng();
- var caretElement = rng.startContainer || (rng.parentElement ? rng.parentElement() : null);
- var body = editor.getBody();
- if (caretElement === body && selection.isCollapsed()) {
- if (dom.isBlock(body.firstChild) && canHaveChildren(body.firstChild) && dom.isEmpty(body.firstChild)) {
- rng = dom.createRng();
- rng.setStart(body.firstChild, 0);
- rng.setEnd(body.firstChild, 0);
- selection.setRng(rng);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ args = editor.fire('BeforeSetContent', args);
+ if (args.isDefaultPrevented()) {
+ editor.fire('SetContent', {
+ content: args.content,
+ format: 'html',
+ selection: true,
+ paste: details.paste
+ });
+ 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 (!selection.isCollapsed()) {
- editor.selection.setRng($_e1wrz53ojjgwe85f.normalize(editor.selection.getRng()));
- editor.getDoc().execCommand('Delete', false, null);
- trimNbspAfterDeleteAndPaddValue();
- }
- parentNode = selection.getNode();
- var parserArgs = {
- context: parentNode.nodeName.toLowerCase(),
- data: details.data,
- insert: true
- };
- fragment = parser.parse(value, parserArgs);
- if (details.paste === true && $_1z3gsr3jjjgwe84c.isListFragment(editor.schema, fragment) && $_1z3gsr3jjjgwe84c.isParentBlockLi(dom, parentNode)) {
- rng = $_1z3gsr3jjjgwe84c.insertAtCaret(serializer, dom, editor.selection.getRng(), fragment);
- editor.selection.setRng(rng);
- editor.fire('SetContent', args);
- return;
- }
- markFragmentElements(fragment);
- node = fragment.lastChild;
- if (node.attr('id') === 'mce_marker') {
- marker = node;
- for (node = node.prev; node; node = node.walk(true)) {
- if (node.type === 3 || !dom.isBlock(node.name)) {
- if (editor.schema.isValidChild(node.parent.name, 'span')) {
- node.parent.insert(marker, node, node.name === 'br');
- }
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ value = args.content;
+ if (value.indexOf('{$caret}') === -1) {
+ value += '{$caret}';
+ }
+ value = value.replace(/\{\$caret\}/, bookmarkHtml);
+ rng = selection.getRng();
+ var caretElement = rng.startContainer || (rng.parentElement ? rng.parentElement() : null);
+ var body = editor.getBody();
+ if (caretElement === body && selection.isCollapsed()) {
+ if (dom.isBlock(body.firstChild) && canHaveChildren(editor, body.firstChild) && dom.isEmpty(body.firstChild)) {
+ rng = dom.createRng();
+ rng.setStart(body.firstChild, 0);
+ rng.setEnd(body.firstChild, 0);
+ selection.setRng(rng);
</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">- }
- editor._selectionOverrides.showBlockCaretContainer(parentNode);
- if (!parserArgs.invalid) {
- value = serializer.serialize(fragment);
- validInsertion(editor, value, parentNode);
- } else {
- selection.setContent(bookmarkHtml);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!selection.isCollapsed()) {
+ editor.selection.setRng(RangeNormalizer.normalize(editor.selection.getRng()));
+ editor.getDoc().execCommand('Delete', false, null);
+ value = trimNbspAfterDeleteAndPadValue(editor.selection.getRng(), value);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> parentNode = selection.getNode();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- rootNode = editor.getBody();
- if (parentNode.nodeType === 9) {
- parentNode = node = rootNode;
- } else {
- node = parentNode;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var parserArgs = {
+ context: parentNode.nodeName.toLowerCase(),
+ data: details.data,
+ insert: true
+ };
+ fragment = parser.parse(value, parserArgs);
+ if (details.paste === true && InsertList.isListFragment(editor.schema, fragment) && InsertList.isParentBlockLi(dom, parentNode)) {
+ rng = InsertList.insertAtCaret(serializer, dom, editor.selection.getRng(), fragment);
+ editor.selection.setRng(rng);
+ editor.fire('SetContent', args);
+ 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">- while (node !== rootNode) {
- parentNode = node;
- node = node.parentNode;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ markFragmentElements(fragment);
+ node = fragment.lastChild;
+ if (node.attr('id') === 'mce_marker') {
+ marker = node;
+ for (node = node.prev; node; node = node.walk(true)) {
+ if (node.type === 3 || !dom.isBlock(node.name)) {
+ if (editor.schema.isValidChild(node.parent.name, 'span')) {
+ node.parent.insert(marker, node, node.name === 'br');
+ }
+ 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">- value = parentNode === rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode);
- value = serializer.serialize(parser.parse(value.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i, function () {
- return serializer.serialize(fragment);
- })));
- if (parentNode === rootNode) {
- dom.setHTML(rootNode, value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor._selectionOverrides.showBlockCaretContainer(parentNode);
+ if (!parserArgs.invalid) {
+ value = serializer.serialize(fragment);
+ validInsertion(editor, value, parentNode);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- dom.setOuterHTML(parentNode, value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ selectionSetContent(editor, bookmarkHtml);
+ parentNode = selection.getNode();
+ rootNode = editor.getBody();
+ if (parentNode.nodeType === 9) {
+ parentNode = node = rootNode;
+ } else {
+ node = parentNode;
+ }
+ while (node !== rootNode) {
+ parentNode = node;
+ node = node.parentNode;
+ }
+ value = parentNode === rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode);
+ value = serializer.serialize(parser.parse(value.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i, function () {
+ return serializer.serialize(fragment);
+ })));
+ if (parentNode === rootNode) {
+ dom.setHTML(rootNode, value);
+ } else {
+ dom.setOuterHTML(parentNode, 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">- }
- reduceInlineTextElements();
- moveSelectionToMarker(dom.get('mce_marker'));
- umarkFragmentElements(editor.getBody());
- trimBrsFromTableCell(editor.dom, editor.selection.getStart());
- editor.fire('SetContent', args);
- editor.addVisual();
- };
- var processValue = function (value) {
- var details;
- if (typeof value !== 'string') {
- details = $_6cwiepljjgwe7j4.extend({
- paste: value.paste,
- data: { paste: value.paste }
- }, value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ reduceInlineTextElements(editor, merge);
+ moveSelectionToMarker(editor, dom.get('mce_marker'));
+ umarkFragmentElements(editor.getBody());
+ trimBrsFromTableCell(editor.dom, editor.selection.getStart());
+ editor.fire('SetContent', args);
+ editor.addVisual();
+ };
+ var processValue = function (value) {
+ var details;
+ if (typeof value !== 'string') {
+ details = Tools.extend({
+ paste: value.paste,
+ data: { paste: value.paste }
+ }, value);
+ return {
+ content: value.content,
+ details: details
+ };
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- content: value.content,
- details: details
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ content: value,
+ details: {}
</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 {
- content: value,
- details: {}
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var insertAtCaret$1 = function (editor, value) {
- var result = processValue(value);
- insertHtmlAtCaret(editor, result.content, result.details);
- };
- var $_7w0ed33ijjgwe841 = { insertAtCaret: insertAtCaret$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var insertAtCaret$1 = function (editor, value) {
+ var result = processValue(value);
+ insertHtmlAtCaret(editor, result.content, result.details);
+ };
+ var InsertContent = { insertAtCaret: insertAtCaret$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">- var sectionResult = Immutable('sections', 'settings');
- var detection = $_7vg267ojjgwe7k0.detect();
- var isTouch = detection.deviceType.isTouch();
- var mobilePlugins = [
- 'lists',
- 'autolink',
- 'autosave'
- ];
- var defaultMobileSettings = { theme: 'mobile' };
- var normalizePlugins = function (plugins) {
- var pluginNames = isArray(plugins) ? plugins.join(' ') : plugins;
- var trimmedPlugins = map(isString(pluginNames) ? pluginNames.split(' ') : [], trim$2);
- return filter(trimmedPlugins, function (item) {
- return item.length > 0;
- });
- };
- var filterMobilePlugins = function (plugins) {
- return filter(plugins, curry(contains, mobilePlugins));
- };
- var extractSections = function (keys$$1, settings) {
- var result = bifilter(settings, function (value, key) {
- return contains(keys$$1, key);
- });
- return sectionResult(result.t, result.f);
- };
- var getSection = function (sectionResult, name, defaults) {
- var sections = sectionResult.sections();
- var sectionSettings = sections.hasOwnProperty(name) ? sections[name] : {};
- return $_6cwiepljjgwe7j4.extend({}, defaults, sectionSettings);
- };
- var hasSection = function (sectionResult, name) {
- return sectionResult.sections().hasOwnProperty(name);
- };
- var getDefaultSettings = function (id, documentBaseUrl, editor) {
- return {
- id: id,
- theme: 'modern',
- delta_width: 0,
- delta_height: 0,
- popup_css: '',
- plugins: '',
- document_base_url: documentBaseUrl,
- add_form_submit_trigger: true,
- submit_patch: true,
- add_unload_trigger: true,
- convert_urls: true,
- relative_urls: true,
- remove_script_host: true,
- object_resizing: true,
- doctype: '<!DOCTYPE html>',
- visual: true,
- font_size_style_values: 'xx-small,x-small,small,medium,large,x-large,xx-large',
- font_size_legacy_values: 'xx-small,small,medium,large,x-large,xx-large,300%',
- forced_root_block: 'p',
- hidden_input: true,
- render_ui: true,
- indentation: '30px',
- inline_styles: true,
- convert_fonts_to_spans: true,
- indent: 'simple',
- indent_before: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' + 'tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist',
- indent_after: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' + 'tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist',
- entity_encoding: 'named',
- url_converter: editor.convertURL,
- url_converter_scope: editor,
- ie7_compat: true
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var sectionResult = Immutable('sections', 'settings');
+ var detection = PlatformDetection$1.detect();
+ var isTouch = detection.deviceType.isTouch();
+ var mobilePlugins = [
+ 'lists',
+ 'autolink',
+ 'autosave'
+ ];
+ var defaultMobileSettings = { theme: 'mobile' };
+ var normalizePlugins = function (plugins) {
+ var pluginNames = isArray(plugins) ? plugins.join(' ') : plugins;
+ var trimmedPlugins = map(isString(pluginNames) ? pluginNames.split(' ') : [], trim$2);
+ return filter(trimmedPlugins, function (item) {
+ return item.length > 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">- };
- var getExternalPlugins = function (overrideSettings, settings) {
- var userDefinedExternalPlugins = settings.external_plugins ? settings.external_plugins : {};
- if (overrideSettings && overrideSettings.external_plugins) {
- return $_6cwiepljjgwe7j4.extend({}, overrideSettings.external_plugins, userDefinedExternalPlugins);
- } else {
- return userDefinedExternalPlugins;
- }
- };
- var combinePlugins = function (forcedPlugins, plugins) {
- return [].concat(normalizePlugins(forcedPlugins)).concat(normalizePlugins(plugins));
- };
- var processPlugins = function (isTouchDevice, sectionResult, defaultOverrideSettings, settings) {
- var forcedPlugins = normalizePlugins(defaultOverrideSettings.forced_plugins);
- var plugins = normalizePlugins(settings.plugins);
- var platformPlugins = isTouchDevice && hasSection(sectionResult, 'mobile') ? filterMobilePlugins(plugins) : plugins;
- var combinedPlugins = combinePlugins(forcedPlugins, platformPlugins);
- return $_6cwiepljjgwe7j4.extend(settings, { plugins: combinedPlugins.join(' ') });
- };
- var isOnMobile = function (isTouchDevice, sectionResult) {
- var isInline = sectionResult.settings().inline;
- return isTouchDevice && hasSection(sectionResult, 'mobile') && !isInline;
- };
- var combineSettings = function (isTouchDevice, defaultSettings, defaultOverrideSettings, settings) {
- var sectionResult = extractSections(['mobile'], settings);
- var extendedSettings = $_6cwiepljjgwe7j4.extend(defaultSettings, defaultOverrideSettings, sectionResult.settings(), isOnMobile(isTouchDevice, sectionResult) ? getSection(sectionResult, 'mobile', defaultMobileSettings) : {}, {
- validate: true,
- content_editable: sectionResult.settings().inline,
- external_plugins: getExternalPlugins(defaultOverrideSettings, sectionResult.settings())
- });
- return processPlugins(isTouchDevice, sectionResult, defaultOverrideSettings, extendedSettings);
- };
- var getEditorSettings = function (editor, id, documentBaseUrl, defaultOverrideSettings, settings) {
- var defaultSettings = getDefaultSettings(id, documentBaseUrl, editor);
- return combineSettings(isTouch, defaultSettings, defaultOverrideSettings, settings);
- };
- var getFiltered = function (predicate, editor, name) {
- return Option.from(editor.settings[name]).filter(predicate);
- };
- var getString = curry(getFiltered, isString);
- var getParamObject = function (value) {
- var output = {};
- if (typeof value === 'string') {
- each(value.indexOf('=') > 0 ? value.split(/[;,](?![^=;,]*(?:[;,]|$))/) : value.split(','), function (val) {
- var arr = val.split('=');
- if (arr.length > 1) {
- output[$_6cwiepljjgwe7j4.trim(arr[0])] = $_6cwiepljjgwe7j4.trim(arr[1]);
- } else {
- output[$_6cwiepljjgwe7j4.trim(arr[0])] = $_6cwiepljjgwe7j4.trim(arr);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var filterMobilePlugins = function (plugins) {
+ return filter(plugins, curry(contains, mobilePlugins));
+ };
+ var extractSections = function (keys$$1, settings) {
+ var result = bifilter(settings, function (value, key) {
+ return contains(keys$$1, key);
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- output = value;
- }
- return output;
- };
- var isArrayOf = function (p) {
- return function (a) {
- return isArray(a) && forall(a, p);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return sectionResult(result.t, result.f);
</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 getParam = function (editor, name, defaultVal, type) {
- var value = name in editor.settings ? editor.settings[name] : defaultVal;
- if (type === 'hash') {
- return getParamObject(value);
- } else if (type === 'string') {
- return getFiltered(isString, editor, name).getOr(defaultVal);
- } else if (type === 'number') {
- return getFiltered(isNumber, editor, name).getOr(defaultVal);
- } else if (type === 'boolean') {
- return getFiltered(isBoolean, editor, name).getOr(defaultVal);
- } else if (type === 'object') {
- return getFiltered(isObject, editor, name).getOr(defaultVal);
- } else if (type === 'array') {
- return getFiltered(isArray, editor, name).getOr(defaultVal);
- } else if (type === 'string[]') {
- return getFiltered(isArrayOf(isString), editor, name).getOr(defaultVal);
- } else if (type === 'function') {
- return getFiltered(isFunction, editor, name).getOr(defaultVal);
- } else {
- return value;
- }
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getSection = function (sectionResult, name, defaults) {
+ var sections = sectionResult.sections();
+ var sectionSettings = sections.hasOwnProperty(name) ? sections[name] : {};
+ return Tools.extend({}, defaults, sectionSettings);
+ };
+ var hasSection = function (sectionResult, name) {
+ return sectionResult.sections().hasOwnProperty(name);
+ };
+ var getDefaultSettings = function (id, documentBaseUrl, editor) {
+ return {
+ id: id,
+ theme: 'modern',
+ delta_width: 0,
+ delta_height: 0,
+ popup_css: '',
+ plugins: '',
+ document_base_url: documentBaseUrl,
+ add_form_submit_trigger: true,
+ submit_patch: true,
+ add_unload_trigger: true,
+ convert_urls: true,
+ relative_urls: true,
+ remove_script_host: true,
+ object_resizing: true,
+ doctype: '<!DOCTYPE html>',
+ visual: true,
+ font_size_style_values: 'xx-small,x-small,small,medium,large,x-large,xx-large',
+ font_size_legacy_values: 'xx-small,small,medium,large,x-large,xx-large,300%',
+ forced_root_block: 'p',
+ hidden_input: true,
+ render_ui: true,
+ indentation: '40px',
+ inline_styles: true,
+ convert_fonts_to_spans: true,
+ indent: 'simple',
+ indent_before: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' + 'tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist',
+ indent_after: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' + 'tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist',
+ entity_encoding: 'named',
+ url_converter: editor.convertURL,
+ url_converter_scope: editor,
+ ie7_compat: true
+ };
+ };
+ var getExternalPlugins = function (overrideSettings, settings) {
+ var userDefinedExternalPlugins = settings.external_plugins ? settings.external_plugins : {};
+ if (overrideSettings && overrideSettings.external_plugins) {
+ return Tools.extend({}, overrideSettings.external_plugins, userDefinedExternalPlugins);
+ } else {
+ return userDefinedExternalPlugins;
+ }
+ };
+ var combinePlugins = function (forcedPlugins, plugins) {
+ return [].concat(normalizePlugins(forcedPlugins)).concat(normalizePlugins(plugins));
+ };
+ var processPlugins = function (isTouchDevice, sectionResult, defaultOverrideSettings, settings) {
+ var forcedPlugins = normalizePlugins(defaultOverrideSettings.forced_plugins);
+ var plugins = normalizePlugins(settings.plugins);
+ var platformPlugins = isTouchDevice && hasSection(sectionResult, 'mobile') ? filterMobilePlugins(plugins) : plugins;
+ var combinedPlugins = combinePlugins(forcedPlugins, platformPlugins);
+ return Tools.extend(settings, { plugins: combinedPlugins.join(' ') });
+ };
+ var isOnMobile = function (isTouchDevice, sectionResult) {
+ var isInline = sectionResult.settings().inline;
+ return isTouchDevice && hasSection(sectionResult, 'mobile') && !isInline;
+ };
+ var combineSettings = function (isTouchDevice, defaultSettings, defaultOverrideSettings, settings) {
+ var sectionResult = extractSections(['mobile'], settings);
+ var extendedSettings = Tools.extend(defaultSettings, defaultOverrideSettings, sectionResult.settings(), isOnMobile(isTouchDevice, sectionResult) ? getSection(sectionResult, 'mobile', defaultMobileSettings) : {}, {
+ validate: true,
+ content_editable: sectionResult.settings().inline,
+ external_plugins: getExternalPlugins(defaultOverrideSettings, sectionResult.settings())
+ });
+ return processPlugins(isTouchDevice, sectionResult, defaultOverrideSettings, extendedSettings);
+ };
+ var getEditorSettings = function (editor, id, documentBaseUrl, defaultOverrideSettings, settings) {
+ var defaultSettings = getDefaultSettings(id, documentBaseUrl, editor);
+ return combineSettings(isTouch, defaultSettings, defaultOverrideSettings, settings);
+ };
+ var getFiltered = function (predicate, editor, name) {
+ return Option.from(editor.settings[name]).filter(predicate);
+ };
+ var getString = curry(getFiltered, isString);
+ var getParamObject = function (value) {
+ var output = {};
+ if (typeof value === 'string') {
+ each(value.indexOf('=') > 0 ? value.split(/[;,](?![^=;,]*(?:[;,]|$))/) : value.split(','), function (val) {
+ var arr = val.split('=');
+ if (arr.length > 1) {
+ output[Tools.trim(arr[0])] = Tools.trim(arr[1]);
+ } else {
+ output[Tools.trim(arr[0])] = Tools.trim(arr);
+ }
+ });
+ } else {
+ output = value;
+ }
+ return output;
+ };
+ var isArrayOf = function (p) {
+ return function (a) {
+ return isArray(a) && forall(a, p);
+ };
+ };
+ var getParam = function (editor, name, defaultVal, type) {
+ var value = name in editor.settings ? editor.settings[name] : defaultVal;
+ if (type === 'hash') {
+ return getParamObject(value);
+ } else if (type === 'string') {
+ return getFiltered(isString, editor, name).getOr(defaultVal);
+ } else if (type === 'number') {
+ return getFiltered(isNumber, editor, name).getOr(defaultVal);
+ } else if (type === 'boolean') {
+ return getFiltered(isBoolean, editor, name).getOr(defaultVal);
+ } else if (type === 'object') {
+ return getFiltered(isObject, editor, name).getOr(defaultVal);
+ } else if (type === 'array') {
+ return getFiltered(isArray, editor, name).getOr(defaultVal);
+ } else if (type === 'string[]') {
+ return getFiltered(isArrayOf(isString), editor, name).getOr(defaultVal);
+ } else if (type === 'function') {
+ return getFiltered(isFunction, editor, name).getOr(defaultVal);
+ } else {
+ 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">- var strongRtl = /[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/;
- var hasStrongRtl = function (text) {
- return strongRtl.test(text);
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var strongRtl = /[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/;
+ var hasStrongRtl = function (text) {
+ return strongRtl.test(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">- var isInlineTarget = function (editor, elm) {
- var selector = getString(editor, 'inline_boundaries_selector').getOr('a[href],code');
- return $_4yq1xp1gjjgwe7op.is(Element$$1.fromDom(elm), selector);
- };
- var isRtl = function (element) {
- return DOMUtils$1.DOM.getStyle(element, 'direction', true) === 'rtl' || hasStrongRtl(element.textContent);
- };
- var findInlineParents = function (isInlineTarget, rootNode, pos) {
- return filter(DOMUtils$1.DOM.getParents(pos.container(), '*', rootNode), isInlineTarget);
- };
- var findRootInline = function (isInlineTarget, rootNode, pos) {
- var parents = findInlineParents(isInlineTarget, rootNode, pos);
- return Option.from(parents[parents.length - 1]);
- };
- var hasSameParentBlock = function (rootNode, node1, node2) {
- var block1 = getParentBlock(node1, rootNode);
- var block2 = getParentBlock(node2, rootNode);
- return block1 && block1 === block2;
- };
- var isAtZwsp = function (pos) {
- return isBeforeInline(pos) || isAfterInline(pos);
- };
- var normalizePosition = function (forward, pos) {
- var container = pos.container(), offset = pos.offset();
- if (forward) {
- if (isCaretContainerInline(container)) {
- if ($_3b9u2y1rjjgwe7qe.isText(container.nextSibling)) {
- return CaretPosition$1(container.nextSibling, 0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isInlineTarget = function (editor, elm) {
+ var selector = getString(editor, 'inline_boundaries_selector').getOr('a[href],code');
+ return is$1(Element$$1.fromDom(elm), selector);
+ };
+ var isRtl = function (element) {
+ return DOMUtils$1.DOM.getStyle(element, 'direction', true) === 'rtl' || hasStrongRtl(element.textContent);
+ };
+ var findInlineParents = function (isInlineTarget, rootNode, pos) {
+ return filter(DOMUtils$1.DOM.getParents(pos.container(), '*', rootNode), isInlineTarget);
+ };
+ var findRootInline = function (isInlineTarget, rootNode, pos) {
+ var parents = findInlineParents(isInlineTarget, rootNode, pos);
+ return Option.from(parents[parents.length - 1]);
+ };
+ var hasSameParentBlock = function (rootNode, node1, node2) {
+ var block1 = getParentBlock(node1, rootNode);
+ var block2 = getParentBlock(node2, rootNode);
+ return block1 && block1 === block2;
+ };
+ var isAtZwsp = function (pos) {
+ return isBeforeInline(pos) || isAfterInline(pos);
+ };
+ var normalizePosition = function (forward, pos) {
+ var container = pos.container(), offset = pos.offset();
+ if (forward) {
+ if (isCaretContainerInline(container)) {
+ if (NodeType.isText(container.nextSibling)) {
+ return CaretPosition$1(container.nextSibling, 0);
+ } else {
+ return CaretPosition$1.after(container);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return CaretPosition$1.after(container);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return isBeforeInline(pos) ? CaretPosition$1(container, offset + 1) : pos;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return isBeforeInline(pos) ? CaretPosition$1(container, offset + 1) : pos;
- }
- } else {
- if (isCaretContainerInline(container)) {
- if ($_3b9u2y1rjjgwe7qe.isText(container.previousSibling)) {
- return CaretPosition$1(container.previousSibling, container.previousSibling.data.length);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isCaretContainerInline(container)) {
+ if (NodeType.isText(container.previousSibling)) {
+ return CaretPosition$1(container.previousSibling, container.previousSibling.data.length);
+ } else {
+ return CaretPosition$1.before(container);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return CaretPosition$1.before(container);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return isAfterInline(pos) ? CaretPosition$1(container, offset - 1) : pos;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- return isAfterInline(pos) ? CaretPosition$1(container, offset - 1) : pos;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- };
- var normalizeForwards = curry(normalizePosition, true);
- var normalizeBackwards = curry(normalizePosition, false);
- var $_av9utf3tjjgwe86b = {
- isInlineTarget: isInlineTarget,
- findRootInline: findRootInline,
- isRtl: isRtl,
- isAtZwsp: isAtZwsp,
- normalizePosition: normalizePosition,
- normalizeForwards: normalizeForwards,
- normalizeBackwards: normalizeBackwards,
- hasSameParentBlock: hasSameParentBlock
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var normalizeForwards = curry(normalizePosition, true);
+ var normalizeBackwards = curry(normalizePosition, false);
+ var InlineUtils = {
+ isInlineTarget: isInlineTarget,
+ findRootInline: findRootInline,
+ isRtl: isRtl,
+ isAtZwsp: isAtZwsp,
+ normalizePosition: normalizePosition,
+ normalizeForwards: normalizeForwards,
+ normalizeBackwards: normalizeBackwards,
+ hasSameParentBlock: hasSameParentBlock
+ };
</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 isBeforeRoot = function (rootNode) {
- return function (elm) {
- return $_5raon11ejjgwe7o5.eq(rootNode, Element$$1.fromDom(elm.dom().parentNode));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isBeforeRoot = function (rootNode) {
+ return function (elm) {
+ return eq(rootNode, Element$$1.fromDom(elm.dom().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 getParentBlock$1 = function (rootNode, elm) {
- return $_5raon11ejjgwe7o5.contains(rootNode, elm) ? $_7kjxyh2ajjgwe7un.closest(elm, function (element) {
- return isTextBlock(element) || isListItem(element);
- }, isBeforeRoot(rootNode)) : Option.none();
- };
- var placeCaretInEmptyBody = function (editor) {
- var body = editor.getBody();
- var node = body.firstChild && editor.dom.isBlock(body.firstChild) ? body.firstChild : body;
- editor.selection.setCursorLocation(node, 0);
- };
- var paddEmptyBody = function (editor) {
- if (editor.dom.isEmpty(editor.getBody())) {
- editor.setContent('');
- placeCaretInEmptyBody(editor);
- }
- };
- var willDeleteLastPositionInElement = function (forward, fromPos, elm) {
- return liftN([
- $_8q1ver2yjjgwe7z3.firstPositionIn(elm),
- $_8q1ver2yjjgwe7z3.lastPositionIn(elm)
- ], function (firstPos, lastPos) {
- var normalizedFirstPos = $_av9utf3tjjgwe86b.normalizePosition(true, firstPos);
- var normalizedLastPos = $_av9utf3tjjgwe86b.normalizePosition(false, lastPos);
- var normalizedFromPos = $_av9utf3tjjgwe86b.normalizePosition(false, fromPos);
- if (forward) {
- return $_8q1ver2yjjgwe7z3.nextPosition(elm, normalizedFromPos).map(function (nextPos) {
- return nextPos.isEqual(normalizedLastPos) && fromPos.isEqual(normalizedFirstPos);
- }).getOr(false);
- } else {
- return $_8q1ver2yjjgwe7z3.prevPosition(elm, normalizedFromPos).map(function (prevPos) {
- return prevPos.isEqual(normalizedFirstPos) && fromPos.isEqual(normalizedLastPos);
- }).getOr(false);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getParentBlock$1 = function (rootNode, elm) {
+ return contains$3(rootNode, elm) ? closest(elm, function (element) {
+ return isTextBlock(element) || isListItem(element);
+ }, isBeforeRoot(rootNode)) : Option.none();
+ };
+ var placeCaretInEmptyBody = function (editor) {
+ var body = editor.getBody();
+ var node = body.firstChild && editor.dom.isBlock(body.firstChild) ? body.firstChild : body;
+ editor.selection.setCursorLocation(node, 0);
+ };
+ var paddEmptyBody = function (editor) {
+ if (editor.dom.isEmpty(editor.getBody())) {
+ editor.setContent('');
+ placeCaretInEmptyBody(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">- }).getOr(true);
- };
- var $_3vi93f3sjjgwe861 = {
- getParentBlock: getParentBlock$1,
- paddEmptyBody: paddEmptyBody,
- willDeleteLastPositionInElement: willDeleteLastPositionInElement
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var willDeleteLastPositionInElement = function (forward, fromPos, elm) {
+ return liftN([
+ CaretFinder.firstPositionIn(elm),
+ CaretFinder.lastPositionIn(elm)
+ ], function (firstPos, lastPos) {
+ var normalizedFirstPos = InlineUtils.normalizePosition(true, firstPos);
+ var normalizedLastPos = InlineUtils.normalizePosition(false, lastPos);
+ var normalizedFromPos = InlineUtils.normalizePosition(false, fromPos);
+ if (forward) {
+ return CaretFinder.nextPosition(elm, normalizedFromPos).map(function (nextPos) {
+ return nextPos.isEqual(normalizedLastPos) && fromPos.isEqual(normalizedFirstPos);
+ }).getOr(false);
+ } else {
+ return CaretFinder.prevPosition(elm, normalizedFromPos).map(function (prevPos) {
+ return prevPos.isEqual(normalizedFirstPos) && fromPos.isEqual(normalizedLastPos);
+ }).getOr(false);
+ }
+ }).getOr(true);
+ };
+ var DeleteUtils = {
+ getParentBlock: getParentBlock$1,
+ paddEmptyBody: paddEmptyBody,
+ willDeleteLastPositionInElement: willDeleteLastPositionInElement
+ };
</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 any = function (selector) {
- return $_ajwe9029jjgwe7ul.first(selector).isSome();
- };
- var ancestor$2 = function (scope, selector, isRoot) {
- return $_ajwe9029jjgwe7ul.ancestor(scope, selector, isRoot).isSome();
- };
- var sibling$3 = function (scope, selector) {
- return $_ajwe9029jjgwe7ul.sibling(scope, selector).isSome();
- };
- var child$3 = function (scope, selector) {
- return $_ajwe9029jjgwe7ul.child(scope, selector).isSome();
- };
- var descendant$2 = function (scope, selector) {
- return $_ajwe9029jjgwe7ul.descendant(scope, selector).isSome();
- };
- var closest$2 = function (scope, selector, isRoot) {
- return $_ajwe9029jjgwe7ul.closest(scope, selector, isRoot).isSome();
- };
- var $_ct3yqg3xjjgwe8b2 = {
- any: any,
- ancestor: ancestor$2,
- sibling: sibling$3,
- child: child$3,
- descendant: descendant$2,
- closest: closest$2
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ancestor$2 = function (scope, selector, isRoot) {
+ return ancestor$1(scope, selector, isRoot).isSome();
+ };
</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 hasWhitespacePreserveParent = function (rootNode, node) {
- var rootElement = Element$$1.fromDom(rootNode);
- var startNode = Element$$1.fromDom(node);
- return $_ct3yqg3xjjgwe8b2.ancestor(startNode, 'pre,code', curry($_5raon11ejjgwe7o5.eq, rootElement));
- };
- var isWhitespace = function (rootNode, node) {
- return $_3b9u2y1rjjgwe7qe.isText(node) && /^[ \t\r\n]*$/.test(node.data) && hasWhitespacePreserveParent(rootNode, node) === false;
- };
- var isNamedAnchor = function (node) {
- return $_3b9u2y1rjjgwe7qe.isElement(node) && node.nodeName === 'A' && node.hasAttribute('name');
- };
- var isContent = function (rootNode, node) {
- return isCaretCandidate(node) && isWhitespace(rootNode, node) === false || isNamedAnchor(node) || isBookmark(node);
- };
- var isBookmark = $_3b9u2y1rjjgwe7qe.hasAttribute('data-mce-bookmark');
- var isBogus$2 = $_3b9u2y1rjjgwe7qe.hasAttribute('data-mce-bogus');
- var isBogusAll$1 = $_3b9u2y1rjjgwe7qe.hasAttributeValue('data-mce-bogus', 'all');
- var isEmptyNode = function (targetNode) {
- var walker, node, brCount = 0;
- if (isContent(targetNode, targetNode)) {
- return false;
- } else {
- node = targetNode.firstChild;
- if (!node) {
- return true;
- }
- walker = new TreeWalker(node, targetNode);
- do {
- if (isBogusAll$1(node)) {
- node = walker.next(true);
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasWhitespacePreserveParent = function (rootNode, node) {
+ var rootElement = Element$$1.fromDom(rootNode);
+ var startNode = Element$$1.fromDom(node);
+ return ancestor$2(startNode, 'pre,code', curry(eq, rootElement));
+ };
+ var isWhitespace = function (rootNode, node) {
+ return NodeType.isText(node) && /^[ \t\r\n]*$/.test(node.data) && hasWhitespacePreserveParent(rootNode, node) === false;
+ };
+ var isNamedAnchor = function (node) {
+ return NodeType.isElement(node) && node.nodeName === 'A' && node.hasAttribute('name');
+ };
+ var isContent$1 = function (rootNode, node) {
+ return isCaretCandidate(node) && isWhitespace(rootNode, node) === false || isNamedAnchor(node) || isBookmark(node);
+ };
+ var isBookmark = NodeType.hasAttribute('data-mce-bookmark');
+ var isBogus$2 = NodeType.hasAttribute('data-mce-bogus');
+ var isBogusAll$1 = NodeType.hasAttributeValue('data-mce-bogus', 'all');
+ var isEmptyNode = function (targetNode) {
+ var walker, node, brCount = 0;
+ if (isContent$1(targetNode, targetNode)) {
+ return false;
+ } else {
+ node = targetNode.firstChild;
+ if (!node) {
+ 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 (isBogus$2(node)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ walker = new TreeWalker(node, targetNode);
+ do {
+ if (isBogusAll$1(node)) {
+ node = walker.next(true);
+ continue;
+ }
+ if (isBogus$2(node)) {
+ node = walker.next();
+ continue;
+ }
+ if (NodeType.isBr(node)) {
+ brCount++;
+ node = walker.next();
+ continue;
+ }
+ if (isContent$1(targetNode, node)) {
+ return false;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> node = walker.next();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- continue;
- }
- if ($_3b9u2y1rjjgwe7qe.isBr(node)) {
- brCount++;
- node = walker.next();
- continue;
- }
- if (isContent(targetNode, node)) {
- return false;
- }
- node = walker.next();
- } while (node);
- return brCount <= 1;
- }
- };
- var isEmpty$1 = function (elm) {
- return isEmptyNode(elm.dom());
- };
- var $_99xuux3wjjgwe8as = { isEmpty: isEmpty$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } while (node);
+ return brCount <= 1;
+ }
+ };
+ var isEmpty$1 = function (elm) {
+ return isEmptyNode(elm.dom());
+ };
+ var Empty = { isEmpty: isEmpty$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">- var BlockPosition = Immutable('block', 'position');
- var BlockBoundary = Immutable('from', 'to');
- var getBlockPosition = function (rootNode, pos) {
- var rootElm = Element$$1.fromDom(rootNode);
- var containerElm = Element$$1.fromDom(pos.container());
- return $_3vi93f3sjjgwe861.getParentBlock(rootElm, containerElm).map(function (block) {
- return BlockPosition(block, pos);
- });
- };
- var isDifferentBlocks = function (blockBoundary) {
- return $_5raon11ejjgwe7o5.eq(blockBoundary.from().block(), blockBoundary.to().block()) === false;
- };
- var hasSameParent = function (blockBoundary) {
- return $_d3rmjp18jjgwe7nc.parent(blockBoundary.from().block()).bind(function (parent1) {
- return $_d3rmjp18jjgwe7nc.parent(blockBoundary.to().block()).filter(function (parent2) {
- return $_5raon11ejjgwe7o5.eq(parent1, parent2);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var BlockPosition = Immutable('block', 'position');
+ var BlockBoundary = Immutable('from', 'to');
+ var getBlockPosition = function (rootNode, pos) {
+ var rootElm = Element$$1.fromDom(rootNode);
+ var containerElm = Element$$1.fromDom(pos.container());
+ return DeleteUtils.getParentBlock(rootElm, containerElm).map(function (block) {
+ return BlockPosition(block, pos);
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }).isSome();
- };
- var isEditable = function (blockBoundary) {
- return $_3b9u2y1rjjgwe7qe.isContentEditableFalse(blockBoundary.from().block()) === false && $_3b9u2y1rjjgwe7qe.isContentEditableFalse(blockBoundary.to().block()) === false;
- };
- var skipLastBr = function (rootNode, forward, blockPosition) {
- if ($_3b9u2y1rjjgwe7qe.isBr(blockPosition.position().getNode()) && $_99xuux3wjjgwe8as.isEmpty(blockPosition.block()) === false) {
- return $_8q1ver2yjjgwe7z3.positionIn(false, blockPosition.block().dom()).bind(function (lastPositionInBlock) {
- if (lastPositionInBlock.isEqual(blockPosition.position())) {
- return $_8q1ver2yjjgwe7z3.fromPosition(forward, rootNode, lastPositionInBlock).bind(function (to) {
- return getBlockPosition(rootNode, to);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var isDifferentBlocks = function (blockBoundary) {
+ return eq(blockBoundary.from().block(), blockBoundary.to().block()) === false;
+ };
+ var hasSameParent = function (blockBoundary) {
+ return parent(blockBoundary.from().block()).bind(function (parent1) {
+ return parent(blockBoundary.to().block()).filter(function (parent2) {
+ return eq(parent1, parent2);
+ });
+ }).isSome();
+ };
+ var isEditable = function (blockBoundary) {
+ return NodeType.isContentEditableFalse(blockBoundary.from().block()) === false && NodeType.isContentEditableFalse(blockBoundary.to().block()) === false;
+ };
+ var skipLastBr = function (rootNode, forward, blockPosition) {
+ if (NodeType.isBr(blockPosition.position().getNode()) && Empty.isEmpty(blockPosition.block()) === false) {
+ return CaretFinder.positionIn(false, blockPosition.block().dom()).bind(function (lastPositionInBlock) {
+ if (lastPositionInBlock.isEqual(blockPosition.position())) {
+ return CaretFinder.fromPosition(forward, rootNode, lastPositionInBlock).bind(function (to) {
+ return getBlockPosition(rootNode, to);
+ });
+ } else {
+ return Option.some(blockPosition);
+ }
+ }).getOr(blockPosition);
+ } else {
+ return blockPosition;
+ }
+ };
+ var readFromRange = function (rootNode, forward, rng) {
+ var fromBlockPos = getBlockPosition(rootNode, CaretPosition$1.fromRangeStart(rng));
+ var toBlockPos = fromBlockPos.bind(function (blockPos) {
+ return CaretFinder.fromPosition(forward, rootNode, blockPos.position()).bind(function (to) {
+ return getBlockPosition(rootNode, to).map(function (blockPos) {
+ return skipLastBr(rootNode, forward, blockPos);
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- return Option.some(blockPosition);
- }
- }).getOr(blockPosition);
- } else {
- return blockPosition;
- }
- };
- var readFromRange = function (rootNode, forward, rng) {
- var fromBlockPos = getBlockPosition(rootNode, CaretPosition$1.fromRangeStart(rng));
- var toBlockPos = fromBlockPos.bind(function (blockPos) {
- return $_8q1ver2yjjgwe7z3.fromPosition(forward, rootNode, blockPos.position()).bind(function (to) {
- return getBlockPosition(rootNode, to).map(function (blockPos) {
- return skipLastBr(rootNode, forward, blockPos);
</del><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">- });
- return liftN([
- fromBlockPos,
- toBlockPos
- ], BlockBoundary).filter(function (blockBoundary) {
- return isDifferentBlocks(blockBoundary) && hasSameParent(blockBoundary) && isEditable(blockBoundary);
- });
- };
- var read$1 = function (rootNode, forward, rng) {
- return rng.collapsed ? readFromRange(rootNode, forward, rng) : Option.none();
- };
- var $_6p32rm3rjjgwe85q = { read: read$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return liftN([
+ fromBlockPos,
+ toBlockPos
+ ], BlockBoundary).filter(function (blockBoundary) {
+ return isDifferentBlocks(blockBoundary) && hasSameParent(blockBoundary) && isEditable(blockBoundary);
+ });
+ };
+ var read$1 = function (rootNode, forward, rng) {
+ return rng.collapsed ? readFromRange(rootNode, forward, rng) : Option.none();
+ };
+ var BlockMergeBoundary = { read: read$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">- var dropLast = function (xs) {
- return xs.slice(0, -1);
- };
- var parentsUntil$1 = function (startNode, rootElm, predicate) {
- if ($_5raon11ejjgwe7o5.contains(rootElm, startNode)) {
- return dropLast($_d3rmjp18jjgwe7nc.parents(startNode, function (elm) {
- return predicate(elm) || $_5raon11ejjgwe7o5.eq(elm, rootElm);
- }));
- } else {
- return [];
- }
- };
- var parents$1 = function (startNode, rootElm) {
- return parentsUntil$1(startNode, rootElm, constant(false));
- };
- var parentsAndSelf = function (startNode, rootElm) {
- return [startNode].concat(parents$1(startNode, rootElm));
- };
- var $_cvft7x3zjjgwe8bh = {
- parentsUntil: parentsUntil$1,
- parents: parents$1,
- parentsAndSelf: parentsAndSelf
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var dropLast = function (xs) {
+ return xs.slice(0, -1);
+ };
+ var parentsUntil$1 = function (start, root, predicate) {
+ if (contains$3(root, start)) {
+ return dropLast(parents(start, function (elm) {
+ return predicate(elm) || eq(elm, root);
+ }));
+ } else {
+ return [];
+ }
+ };
+ var parents$1 = function (start, root) {
+ return parentsUntil$1(start, root, constant(false));
+ };
+ var parentsAndSelf = function (start, root) {
+ return [start].concat(parents$1(start, root));
+ };
+ var Parents = {
+ parentsUntil: parentsUntil$1,
+ parents: parents$1,
+ parentsAndSelf: parentsAndSelf
+ };
</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 getChildrenUntilBlockBoundary = function (block) {
- var children = $_d3rmjp18jjgwe7nc.children(block);
- return findIndex(children, isBlock).fold(function () {
- return children;
- }, function (index) {
- return children.slice(0, index);
- });
- };
- var extractChildren = function (block) {
- var children = getChildrenUntilBlockBoundary(block);
- each(children, function (node) {
- $_81exq51wjjgwe7sm.remove(node);
- });
- return children;
- };
- var trimBr = function (first, block) {
- $_8q1ver2yjjgwe7z3.positionIn(first, block.dom()).each(function (position) {
- var node = position.getNode();
- if ($_3b9u2y1rjjgwe7qe.isBr(node)) {
- $_81exq51wjjgwe7sm.remove(Element$$1.fromDom(node));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getChildrenUntilBlockBoundary = function (block) {
+ var children$$1 = children(block);
+ return findIndex(children$$1, isBlock).fold(function () {
+ return children$$1;
+ }, function (index) {
+ return children$$1.slice(0, index);
+ });
+ };
+ var extractChildren = function (block) {
+ var children$$1 = getChildrenUntilBlockBoundary(block);
+ each(children$$1, remove$2);
+ return children$$1;
+ };
+ var removeEmptyRoot = function (rootNode, block) {
+ var parents$$1 = Parents.parentsAndSelf(block, rootNode);
+ return find(parents$$1.reverse(), Empty.isEmpty).each(remove$2);
+ };
+ var isEmptyBefore = function (el) {
+ return filter(prevSiblings(el), function (el) {
+ return !Empty.isEmpty(el);
+ }).length === 0;
+ };
+ var nestedBlockMerge = function (rootNode, fromBlock, toBlock, insertionPoint) {
+ if (Empty.isEmpty(toBlock)) {
+ PaddingBr.fillWithPaddingBr(toBlock);
+ return CaretFinder.firstPositionIn(toBlock.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 removeEmptyRoot = function (rootNode, block) {
- var parents = $_cvft7x3zjjgwe8bh.parentsAndSelf(block, rootNode);
- return find(parents.reverse(), $_99xuux3wjjgwe8as.isEmpty).each($_81exq51wjjgwe7sm.remove);
- };
- var findParentInsertPoint = function (toBlock, block) {
- var parents = $_d3rmjp18jjgwe7nc.parents(block, function (elm) {
- return $_5raon11ejjgwe7o5.eq(elm, toBlock);
- });
- return Option.from(parents[parents.length - 2]);
- };
- var getInsertionPoint = function (fromBlock, toBlock) {
- if ($_5raon11ejjgwe7o5.contains(toBlock, fromBlock)) {
- return $_d3rmjp18jjgwe7nc.parent(fromBlock).bind(function (parent) {
- return $_5raon11ejjgwe7o5.eq(parent, toBlock) ? Option.some(fromBlock) : findParentInsertPoint(toBlock, fromBlock);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isEmptyBefore(insertionPoint) && Empty.isEmpty(fromBlock)) {
+ before(insertionPoint, Element$$1.fromTag('br'));
+ }
+ var position = CaretFinder.prevPosition(toBlock.dom(), CaretPosition$1.before(insertionPoint.dom()));
+ each(extractChildren(fromBlock), function (child$$1) {
+ before(insertionPoint, child$$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">- } else {
- return Option.none();
- }
- };
- var mergeBlockInto = function (rootNode, fromBlock, toBlock) {
- if ($_99xuux3wjjgwe8as.isEmpty(toBlock)) {
- $_81exq51wjjgwe7sm.remove(toBlock);
- if ($_99xuux3wjjgwe8as.isEmpty(fromBlock)) {
- $_fhp7pa3ljjgwe84n.fillWithPaddingBr(fromBlock);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ removeEmptyRoot(rootNode, fromBlock);
+ return position;
+ };
+ var sidelongBlockMerge = function (rootNode, fromBlock, toBlock) {
+ if (Empty.isEmpty(toBlock)) {
+ remove$2(toBlock);
+ if (Empty.isEmpty(fromBlock)) {
+ PaddingBr.fillWithPaddingBr(fromBlock);
+ }
+ return CaretFinder.firstPositionIn(fromBlock.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">- return $_8q1ver2yjjgwe7z3.firstPositionIn(fromBlock.dom());
- } else {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var position = CaretFinder.lastPositionIn(toBlock.dom());
+ each(extractChildren(fromBlock), function (child$$1) {
+ append(toBlock, child$$1);
+ });
+ removeEmptyRoot(rootNode, fromBlock);
+ return position;
+ };
+ var findInsertionPoint = function (toBlock, block) {
+ var parentsAndSelf = Parents.parentsAndSelf(block, toBlock);
+ return Option.from(parentsAndSelf[parentsAndSelf.length - 1]);
+ };
+ var getInsertionPoint = function (fromBlock, toBlock) {
+ return contains$3(toBlock, fromBlock) ? findInsertionPoint(toBlock, fromBlock) : Option.none();
+ };
+ var trimBr = function (first, block) {
+ CaretFinder.positionIn(first, block.dom()).map(function (position) {
+ return position.getNode();
+ }).map(Element$$1.fromDom).filter(isBr).each(remove$2);
+ };
+ var mergeBlockInto = function (rootNode, fromBlock, toBlock) {
</ins><span class="cx" style="display: block; padding: 0 10px"> trimBr(true, fromBlock);
</span><span class="cx" style="display: block; padding: 0 10px"> trimBr(false, toBlock);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var children_1 = extractChildren(fromBlock);
- return getInsertionPoint(fromBlock, toBlock).fold(function () {
- removeEmptyRoot(rootNode, fromBlock);
- var position = $_8q1ver2yjjgwe7z3.lastPositionIn(toBlock.dom());
- each(children_1, function (node) {
- $_ewo3u51yjjgwe7su.append(toBlock, node);
- });
- return position;
- }, function (target) {
- var position = $_8q1ver2yjjgwe7z3.prevPosition(toBlock.dom(), CaretPosition$1.before(target.dom()));
- each(children_1, function (node) {
- $_ewo3u51yjjgwe7su.before(target, node);
- });
- removeEmptyRoot(rootNode, fromBlock);
- return position;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return getInsertionPoint(fromBlock, toBlock).fold(curry(sidelongBlockMerge, rootNode, fromBlock, toBlock), curry(nestedBlockMerge, rootNode, fromBlock, toBlock));
+ };
+ var mergeBlocks = function (rootNode, forward, block1, block2) {
+ return forward ? mergeBlockInto(rootNode, block2, block1) : mergeBlockInto(rootNode, block1, block2);
+ };
+ var MergeBlocks = { mergeBlocks: mergeBlocks };
+
+ var backspaceDelete = function (editor, forward) {
+ var position;
+ var rootNode = Element$$1.fromDom(editor.getBody());
+ position = BlockMergeBoundary.read(rootNode.dom(), forward, editor.selection.getRng()).bind(function (blockBoundary) {
+ return MergeBlocks.mergeBlocks(rootNode, forward, blockBoundary.from().block(), blockBoundary.to().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">- }
- };
- var mergeBlocks = function (rootNode, forward, block1, block2) {
- return forward ? mergeBlockInto(rootNode, block2, block1) : mergeBlockInto(rootNode, block1, block2);
- };
- var $_307srp3yjjgwe8b4 = { mergeBlocks: mergeBlocks };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ position.each(function (pos) {
+ editor.selection.setRng(pos.toRange());
+ });
+ return position.isSome();
+ };
+ var BlockBoundaryDelete = { backspaceDelete: backspaceDelete };
</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 backspaceDelete = function (editor, forward) {
- var position;
- var rootNode = Element$$1.fromDom(editor.getBody());
- position = $_6p32rm3rjjgwe85q.read(rootNode.dom(), forward, editor.selection.getRng()).bind(function (blockBoundary) {
- return $_307srp3yjjgwe8b4.mergeBlocks(rootNode, forward, blockBoundary.from().block(), blockBoundary.to().block());
- });
- position.each(function (pos) {
- editor.selection.setRng(pos.toRange());
- });
- return position.isSome();
- };
- var $_6q4s8w3qjjgwe85j = { backspaceDelete: backspaceDelete };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var deleteRangeMergeBlocks = function (rootNode, selection) {
+ var rng = selection.getRng();
+ return liftN([
+ DeleteUtils.getParentBlock(rootNode, Element$$1.fromDom(rng.startContainer)),
+ DeleteUtils.getParentBlock(rootNode, Element$$1.fromDom(rng.endContainer))
+ ], function (block1, block2) {
+ if (eq(block1, block2) === false) {
+ rng.deleteContents();
+ MergeBlocks.mergeBlocks(rootNode, true, block1, block2).each(function (pos) {
+ selection.setRng(pos.toRange());
+ });
+ return true;
+ } else {
+ return false;
+ }
+ }).getOr(false);
+ };
+ var isRawNodeInTable = function (root, rawNode) {
+ var node = Element$$1.fromDom(rawNode);
+ var isRoot = curry(eq, root);
+ return ancestor(node, isTableCell, isRoot).isSome();
+ };
+ var isSelectionInTable = function (root, rng) {
+ return isRawNodeInTable(root, rng.startContainer) || isRawNodeInTable(root, rng.endContainer);
+ };
+ var isEverythingSelected = function (root, rng) {
+ var noPrevious = CaretFinder.prevPosition(root.dom(), CaretPosition$1.fromRangeStart(rng)).isNone();
+ var noNext = CaretFinder.nextPosition(root.dom(), CaretPosition$1.fromRangeEnd(rng)).isNone();
+ return !isSelectionInTable(root, rng) && noPrevious && noNext;
+ };
+ var emptyEditor = function (editor) {
+ editor.setContent('');
+ editor.selection.setCursorLocation();
+ return true;
+ };
+ var deleteRange = function (editor) {
+ var rootNode = Element$$1.fromDom(editor.getBody());
+ var rng = editor.selection.getRng();
+ return isEverythingSelected(rootNode, rng) ? emptyEditor(editor) : deleteRangeMergeBlocks(rootNode, editor.selection);
+ };
+ var backspaceDelete$1 = function (editor, forward) {
+ return editor.selection.isCollapsed() ? false : deleteRange(editor);
+ };
+ var BlockRangeDelete = { backspaceDelete: backspaceDelete$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">- var deleteRangeMergeBlocks = function (rootNode, selection) {
- var rng = selection.getRng();
- return liftN([
- $_3vi93f3sjjgwe861.getParentBlock(rootNode, Element$$1.fromDom(rng.startContainer)),
- $_3vi93f3sjjgwe861.getParentBlock(rootNode, Element$$1.fromDom(rng.endContainer))
- ], function (block1, block2) {
- if ($_5raon11ejjgwe7o5.eq(block1, block2) === false) {
- rng.deleteContents();
- $_307srp3yjjgwe8b4.mergeBlocks(rootNode, true, block1, block2).each(function (pos) {
- selection.setRng(pos.toRange());
- });
- return true;
- } else {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var generate$1 = function (cases) {
+ if (!isArray(cases)) {
+ throw new Error('cases must be an array');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }).getOr(false);
- };
- var isRawNodeInTable = function (root, rawNode) {
- var node = Element$$1.fromDom(rawNode);
- var isRoot = curry($_5raon11ejjgwe7o5.eq, root);
- return $_7kjxyh2ajjgwe7un.ancestor(node, isTableCell, isRoot).isSome();
- };
- var isSelectionInTable = function (root, rng) {
- return isRawNodeInTable(root, rng.startContainer) || isRawNodeInTable(root, rng.endContainer);
- };
- var isEverythingSelected = function (root, rng) {
- var noPrevious = $_8q1ver2yjjgwe7z3.prevPosition(root.dom(), CaretPosition$1.fromRangeStart(rng)).isNone();
- var noNext = $_8q1ver2yjjgwe7z3.nextPosition(root.dom(), CaretPosition$1.fromRangeEnd(rng)).isNone();
- return !isSelectionInTable(root, rng) && noPrevious && noNext;
- };
- var emptyEditor = function (editor) {
- editor.setContent('');
- editor.selection.setCursorLocation();
- return true;
- };
- var deleteRange = function (editor) {
- var rootNode = Element$$1.fromDom(editor.getBody());
- var rng = editor.selection.getRng();
- return isEverythingSelected(rootNode, rng) ? emptyEditor(editor) : deleteRangeMergeBlocks(rootNode, editor.selection);
- };
- var backspaceDelete$1 = function (editor, forward) {
- return editor.selection.isCollapsed() ? false : deleteRange(editor);
- };
- var $_8u9liw40jjgwe8bn = { backspaceDelete: backspaceDelete$1 };
-
- var generate$1 = function (cases) {
- if (!isArray(cases)) {
- throw new Error('cases must be an array');
- }
- if (cases.length === 0) {
- throw new Error('there must be at least one case');
- }
- var constructors = [];
- var adt = {};
- each(cases, function (acase, count) {
- var keys$$1 = keys(acase);
- if (keys$$1.length !== 1) {
- throw new Error('one and only one name per case');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (cases.length === 0) {
+ throw new Error('there must be at least one case');
</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 key = keys$$1[0];
- var value = acase[key];
- if (adt[key] !== undefined) {
- throw new Error('duplicate key detected:' + key);
- } else if (key === 'cata') {
- throw new Error('cannot have a case named cata (sorry)');
- } else if (!isArray(value)) {
- throw new Error('case arguments must be an array');
- }
- constructors.push(key);
- adt[key] = function () {
- var argLength = arguments.length;
- if (argLength !== value.length) {
- throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var constructors = [];
+ var adt = {};
+ each(cases, function (acase, count) {
+ var keys$$1 = keys(acase);
+ if (keys$$1.length !== 1) {
+ throw new Error('one and only one name per case');
</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 args = new Array(argLength);
- for (var i = 0; i < args.length; i++)
- args[i] = arguments[i];
- var match = function (branches) {
- var branchKeys = keys(branches);
- if (constructors.length !== branchKeys.length) {
- throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\nActual: ' + branchKeys.join(','));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var key = keys$$1[0];
+ var value = acase[key];
+ if (adt[key] !== undefined) {
+ throw new Error('duplicate key detected:' + key);
+ } else if (key === 'cata') {
+ throw new Error('cannot have a case named cata (sorry)');
+ } else if (!isArray(value)) {
+ throw new Error('case arguments must be an array');
+ }
+ constructors.push(key);
+ adt[key] = function () {
+ var argLength = arguments.length;
+ if (argLength !== value.length) {
+ throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength);
</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 allReqd = forall(constructors, function (reqKey) {
- return contains(branchKeys, reqKey);
- });
- if (!allReqd)
- throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', '));
- return branches[key].apply(null, args);
- };
- return {
- fold: function () {
- if (arguments.length !== cases.length) {
- throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + arguments.length);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var args = new Array(argLength);
+ for (var i = 0; i < args.length; i++)
+ args[i] = arguments[i];
+ var match = function (branches) {
+ var branchKeys = keys(branches);
+ if (constructors.length !== branchKeys.length) {
+ throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\nActual: ' + branchKeys.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">- var target = arguments[count];
- return target.apply(null, args);
- },
- match: match,
- log: function (label) {
- console.log(label, {
- constructors: constructors,
- constructor: key,
- params: args
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var allReqd = forall(constructors, function (reqKey) {
+ return contains(branchKeys, reqKey);
</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">+ if (!allReqd)
+ throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', '));
+ return branches[key].apply(null, args);
+ };
+ return {
+ fold: function () {
+ if (arguments.length !== cases.length) {
+ throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + arguments.length);
+ }
+ var target = arguments[count];
+ return target.apply(null, args);
+ },
+ match: match,
+ log: function (label) {
+ console.log(label, {
+ constructors: constructors,
+ constructor: key,
+ params: args
+ });
+ }
+ };
</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 adt;
- };
- var Adt = { generate: generate$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ return adt;
+ };
+ var Adt = { generate: generate$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">- var isCompoundElement = function (node) {
- return isTableCell(Element$$1.fromDom(node)) || isListItem(Element$$1.fromDom(node));
- };
- var DeleteAction = Adt.generate([
- { remove: ['element'] },
- { moveToElement: ['element'] },
- { moveToPosition: ['position'] }
- ]);
- var isAtContentEditableBlockCaret = function (forward, from) {
- var elm = from.getNode(forward === false);
- var caretLocation = forward ? 'after' : 'before';
- return $_3b9u2y1rjjgwe7qe.isElement(elm) && elm.getAttribute('data-mce-caret') === caretLocation;
- };
- var isDeleteFromCefDifferentBlocks = function (root, forward, from, to) {
- var inSameBlock = function (elm) {
- return isInline(Element$$1.fromDom(elm)) && !isInSameBlock(from, to, root);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isBr$5 = function (pos) {
+ return getElementFromPosition(pos).exists(isBr);
</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 getRelativeCefElm(!forward, from).fold(function () {
- return getRelativeCefElm(forward, to).fold(constant(false), inSameBlock);
- }, inSameBlock);
- };
- var deleteEmptyBlockOrMoveToCef = function (root, forward, from, to) {
- var toCefElm = to.getNode(forward === false);
- return $_3vi93f3sjjgwe861.getParentBlock(Element$$1.fromDom(root), Element$$1.fromDom(from.getNode())).map(function (blockElm) {
- return $_99xuux3wjjgwe8as.isEmpty(blockElm) ? DeleteAction.remove(blockElm.dom()) : DeleteAction.moveToElement(toCefElm);
- }).orThunk(function () {
- return Option.some(DeleteAction.moveToElement(toCefElm));
- });
- };
- var findCefPosition = function (root, forward, from) {
- return $_8q1ver2yjjgwe7z3.fromPosition(forward, root, from).bind(function (to) {
- if (isCompoundElement(to.getNode())) {
- return Option.none();
- } else if (isDeleteFromCefDifferentBlocks(root, forward, from, to)) {
- return Option.none();
- } else if (forward && $_3b9u2y1rjjgwe7qe.isContentEditableFalse(to.getNode())) {
- return deleteEmptyBlockOrMoveToCef(root, forward, from, to);
- } else if (forward === false && $_3b9u2y1rjjgwe7qe.isContentEditableFalse(to.getNode(true))) {
- return deleteEmptyBlockOrMoveToCef(root, forward, from, to);
- } else if (forward && isAfterContentEditableFalse(from)) {
- return Option.some(DeleteAction.moveToPosition(to));
- } else if (forward === false && isBeforeContentEditableFalse(from)) {
- return Option.some(DeleteAction.moveToPosition(to));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var findBr = function (forward, root, pos) {
+ var parentBlocks = filter(Parents.parentsAndSelf(Element$$1.fromDom(pos.container()), root), isBlock);
+ var scope = head(parentBlocks).getOr(root);
+ return CaretFinder.fromPosition(forward, scope.dom(), pos).filter(isBr$5);
+ };
+ var isBeforeBr = function (root, pos) {
+ return getElementFromPosition(pos).exists(isBr) || findBr(true, root, pos).isSome();
+ };
+ var isAfterBr = function (root, pos) {
+ return getElementFromPrevPosition(pos).exists(isBr) || findBr(false, root, pos).isSome();
+ };
+ var findPreviousBr = curry(findBr, false);
+ var findNextBr = curry(findBr, true);
+
+ var isCompoundElement = function (node) {
+ return isTableCell(Element$$1.fromDom(node)) || isListItem(Element$$1.fromDom(node));
+ };
+ var DeleteAction = Adt.generate([
+ { remove: ['element'] },
+ { moveToElement: ['element'] },
+ { moveToPosition: ['position'] }
+ ]);
+ var isAtContentEditableBlockCaret = function (forward, from) {
+ var elm = from.getNode(forward === false);
+ var caretLocation = forward ? 'after' : 'before';
+ return NodeType.isElement(elm) && elm.getAttribute('data-mce-caret') === caretLocation;
+ };
+ var isDeleteFromCefDifferentBlocks = function (root, forward, from, to) {
+ var inSameBlock = function (elm) {
+ return isInline(Element$$1.fromDom(elm)) && !isInSameBlock(from, to, root);
+ };
+ return getRelativeCefElm(!forward, from).fold(function () {
+ return getRelativeCefElm(forward, to).fold(constant(false), inSameBlock);
+ }, inSameBlock);
+ };
+ var deleteEmptyBlockOrMoveToCef = function (root, forward, from, to) {
+ var toCefElm = to.getNode(forward === false);
+ return DeleteUtils.getParentBlock(Element$$1.fromDom(root), Element$$1.fromDom(from.getNode())).map(function (blockElm) {
+ return Empty.isEmpty(blockElm) ? DeleteAction.remove(blockElm.dom()) : DeleteAction.moveToElement(toCefElm);
+ }).orThunk(function () {
+ return Option.some(DeleteAction.moveToElement(toCefElm));
+ });
+ };
+ var findCefPosition = function (root, forward, from) {
+ return CaretFinder.fromPosition(forward, root, from).bind(function (to) {
+ if (isCompoundElement(to.getNode())) {
+ return Option.none();
+ } else if (isDeleteFromCefDifferentBlocks(root, forward, from, to)) {
+ return Option.none();
+ } else if (forward && NodeType.isContentEditableFalse(to.getNode())) {
+ return deleteEmptyBlockOrMoveToCef(root, forward, from, to);
+ } else if (forward === false && NodeType.isContentEditableFalse(to.getNode(true))) {
+ return deleteEmptyBlockOrMoveToCef(root, forward, from, to);
+ } else if (forward && isAfterContentEditableFalse(from)) {
+ return Option.some(DeleteAction.moveToPosition(to));
+ } else if (forward === false && isBeforeContentEditableFalse(from)) {
+ return Option.some(DeleteAction.moveToPosition(to));
+ } else {
+ return Option.none();
+ }
+ });
+ };
+ var getContentEditableBlockAction = function (forward, elm) {
+ if (forward && NodeType.isContentEditableFalse(elm.nextSibling)) {
+ return Option.some(DeleteAction.moveToElement(elm.nextSibling));
+ } else if (forward === false && NodeType.isContentEditableFalse(elm.previousSibling)) {
+ return Option.some(DeleteAction.moveToElement(elm.previousSibling));
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> return Option.none();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- };
- var getContentEditableBlockAction = function (forward, elm) {
- if (forward && $_3b9u2y1rjjgwe7qe.isContentEditableFalse(elm.nextSibling)) {
- return Option.some(DeleteAction.moveToElement(elm.nextSibling));
- } else if (forward === false && $_3b9u2y1rjjgwe7qe.isContentEditableFalse(elm.previousSibling)) {
- return Option.some(DeleteAction.moveToElement(elm.previousSibling));
- } else {
- return Option.none();
- }
- };
- var skipMoveToActionFromInlineCefToContent = function (root, from, deleteAction) {
- return deleteAction.fold(function (elm) {
- return Option.some(DeleteAction.remove(elm));
- }, function (elm) {
- return Option.some(DeleteAction.moveToElement(elm));
- }, function (to) {
- if (isInSameBlock(from, to, root)) {
- return Option.none();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var skipMoveToActionFromInlineCefToContent = function (root, from, deleteAction) {
+ return deleteAction.fold(function (elm) {
+ return Option.some(DeleteAction.remove(elm));
+ }, function (elm) {
+ return Option.some(DeleteAction.moveToElement(elm));
+ }, function (to) {
+ if (isInSameBlock(from, to, root)) {
+ return Option.none();
+ } else {
+ return Option.some(DeleteAction.moveToPosition(to));
+ }
+ });
+ };
+ var getContentEditableAction = function (root, forward, from) {
+ if (isAtContentEditableBlockCaret(forward, from)) {
+ return getContentEditableBlockAction(forward, from.getNode(forward === false)).fold(function () {
+ return findCefPosition(root, forward, from);
+ }, Option.some);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return Option.some(DeleteAction.moveToPosition(to));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return findCefPosition(root, forward, from).bind(function (deleteAction) {
+ return skipMoveToActionFromInlineCefToContent(root, from, deleteAction);
+ });
</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 getContentEditableAction = function (root, forward, from) {
- if (isAtContentEditableBlockCaret(forward, from)) {
- return getContentEditableBlockAction(forward, from.getNode(forward === false)).fold(function () {
- return findCefPosition(root, forward, from);
- }, Option.some);
- } else {
- return findCefPosition(root, forward, from).bind(function (deleteAction) {
- return skipMoveToActionFromInlineCefToContent(root, from, deleteAction);
- });
- }
- };
- var read$2 = function (root, forward, rng) {
- var normalizedRange = normalizeRange(forward ? 1 : -1, root, rng);
- var from = CaretPosition$1.fromRangeStart(normalizedRange);
- if (forward === false && isAfterContentEditableFalse(from)) {
- return Option.some(DeleteAction.remove(from.getNode(true)));
- } else if (forward && isBeforeContentEditableFalse(from)) {
- return Option.some(DeleteAction.remove(from.getNode()));
- } else {
- return getContentEditableAction(root, forward, from);
- }
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var read$2 = function (root, forward, rng) {
+ var normalizedRange = normalizeRange(forward ? 1 : -1, root, rng);
+ var from = CaretPosition$1.fromRangeStart(normalizedRange);
+ var rootElement = Element$$1.fromDom(root);
+ if (forward === false && isAfterContentEditableFalse(from)) {
+ return Option.some(DeleteAction.remove(from.getNode(true)));
+ } else if (forward && isBeforeContentEditableFalse(from)) {
+ return Option.some(DeleteAction.remove(from.getNode()));
+ } else if (forward === false && isBeforeContentEditableFalse(from) && isAfterBr(rootElement, from)) {
+ return findPreviousBr(rootElement, from).map(function (br) {
+ return DeleteAction.remove(br.getNode());
+ });
+ } else if (forward && isAfterContentEditableFalse(from) && isBeforeBr(rootElement, from)) {
+ return findNextBr(rootElement, from).map(function (br) {
+ return DeleteAction.remove(br.getNode());
+ });
+ } else {
+ return getContentEditableAction(root, forward, from);
+ }
+ };
</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 needsReposition = function (pos, elm) {
- var container = pos.container();
- var offset = pos.offset();
- return CaretPosition$1.isTextPosition(pos) === false && container === elm.parentNode && offset > CaretPosition$1.before(elm).offset();
- };
- var reposition = function (elm, pos) {
- return needsReposition(pos, elm) ? CaretPosition$1(pos.container(), pos.offset() - 1) : pos;
- };
- var beforeOrStartOf = function (node) {
- return $_3b9u2y1rjjgwe7qe.isText(node) ? CaretPosition$1(node, 0) : CaretPosition$1.before(node);
- };
- var afterOrEndOf = function (node) {
- return $_3b9u2y1rjjgwe7qe.isText(node) ? CaretPosition$1(node, node.data.length) : CaretPosition$1.after(node);
- };
- var getPreviousSiblingCaretPosition = function (elm) {
- if (isCaretCandidate(elm.previousSibling)) {
- return Option.some(afterOrEndOf(elm.previousSibling));
- } else {
- return elm.previousSibling ? $_8q1ver2yjjgwe7z3.lastPositionIn(elm.previousSibling) : Option.none();
- }
- };
- var getNextSiblingCaretPosition = function (elm) {
- if (isCaretCandidate(elm.nextSibling)) {
- return Option.some(beforeOrStartOf(elm.nextSibling));
- } else {
- return elm.nextSibling ? $_8q1ver2yjjgwe7z3.firstPositionIn(elm.nextSibling) : Option.none();
- }
- };
- var findCaretPositionBackwardsFromElm = function (rootElement, elm) {
- var startPosition = CaretPosition$1.before(elm.previousSibling ? elm.previousSibling : elm.parentNode);
- return $_8q1ver2yjjgwe7z3.prevPosition(rootElement, startPosition).fold(function () {
- return $_8q1ver2yjjgwe7z3.nextPosition(rootElement, CaretPosition$1.after(elm));
- }, Option.some);
- };
- var findCaretPositionForwardsFromElm = function (rootElement, elm) {
- return $_8q1ver2yjjgwe7z3.nextPosition(rootElement, CaretPosition$1.after(elm)).fold(function () {
- return $_8q1ver2yjjgwe7z3.prevPosition(rootElement, CaretPosition$1.before(elm));
- }, Option.some);
- };
- var findCaretPositionBackwards = function (rootElement, elm) {
- return getPreviousSiblingCaretPosition(elm).orThunk(function () {
- return getNextSiblingCaretPosition(elm);
- }).orThunk(function () {
- return findCaretPositionBackwardsFromElm(rootElement, elm);
- });
- };
- var findCaretPositionForward = function (rootElement, elm) {
- return getNextSiblingCaretPosition(elm).orThunk(function () {
- return getPreviousSiblingCaretPosition(elm);
- }).orThunk(function () {
- return findCaretPositionForwardsFromElm(rootElement, elm);
- });
- };
- var findCaretPosition$1 = function (forward, rootElement, elm) {
- return forward ? findCaretPositionForward(rootElement, elm) : findCaretPositionBackwards(rootElement, elm);
- };
- var findCaretPosOutsideElmAfterDelete = function (forward, rootElement, elm) {
- return findCaretPosition$1(forward, rootElement, elm).map(curry(reposition, elm));
- };
- var setSelection = function (editor, forward, pos) {
- pos.fold(function () {
- editor.focus();
- }, function (pos) {
- editor.selection.setRng(pos.toRange(), forward);
- });
- };
- var eqRawNode = function (rawNode) {
- return function (elm) {
- return elm.dom() === rawNode;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isCollapsibleWhitespace = function (c) {
+ return ' \f\n\r\t\x0B'.indexOf(c) !== -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">- };
- var isBlock$2 = function (editor, elm) {
- return elm && editor.schema.getBlockElements().hasOwnProperty($_fxxo5411jjgwe7lq.name(elm));
- };
- var paddEmptyBlock = function (elm) {
- if ($_99xuux3wjjgwe8as.isEmpty(elm)) {
- var br = Element$$1.fromHtml('<br data-mce-bogus="1">');
- $_81exq51wjjgwe7sm.empty(elm);
- $_ewo3u51yjjgwe7su.append(elm, br);
- return Option.some(CaretPosition$1.before(br.dom()));
- } else {
- return Option.none();
- }
- };
- var deleteNormalized = function (elm, afterDeletePosOpt) {
- return liftN([
- $_d3rmjp18jjgwe7nc.prevSibling(elm),
- $_d3rmjp18jjgwe7nc.nextSibling(elm),
- afterDeletePosOpt
- ], function (prev, next, afterDeletePos) {
- var offset;
- var prevNode = prev.dom();
- var nextNode = next.dom();
- if ($_3b9u2y1rjjgwe7qe.isText(prevNode) && $_3b9u2y1rjjgwe7qe.isText(nextNode)) {
- offset = prevNode.data.length;
- prevNode.appendData(nextNode.data);
- $_81exq51wjjgwe7sm.remove(next);
- $_81exq51wjjgwe7sm.remove(elm);
- if (afterDeletePos.container() === nextNode) {
- return CaretPosition$1(prevNode, offset);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var normalizeContent = function (content, isStartOfContent, isEndOfContent) {
+ var result = foldl(content.split(''), function (acc, c) {
+ if (isCollapsibleWhitespace(c) || c === '\xA0') {
+ if (acc.previousCharIsSpace || acc.str === '' && isStartOfContent || acc.str.length === content.length - 1 && isEndOfContent) {
+ return {
+ previousCharIsSpace: false,
+ str: acc.str + '\xA0'
+ };
+ } else {
+ return {
+ previousCharIsSpace: true,
+ str: acc.str + ' '
+ };
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return afterDeletePos;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return {
+ previousCharIsSpace: false,
+ str: acc.str + c
+ };
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- $_81exq51wjjgwe7sm.remove(elm);
- return afterDeletePos;
- }
- }).orThunk(function () {
- $_81exq51wjjgwe7sm.remove(elm);
- return afterDeletePosOpt;
- });
- };
- var deleteElement = function (editor, forward, elm) {
- var afterDeletePos = findCaretPosOutsideElmAfterDelete(forward, editor.getBody(), elm.dom());
- var parentBlock = $_7kjxyh2ajjgwe7un.ancestor(elm, curry(isBlock$2, editor), eqRawNode(editor.getBody()));
- var normalizedAfterDeletePos = deleteNormalized(elm, afterDeletePos);
- if (editor.dom.isEmpty(editor.getBody())) {
- editor.setContent('');
- editor.selection.setCursorLocation();
- } else {
- parentBlock.bind(paddEmptyBlock).fold(function () {
- setSelection(editor, forward, normalizedAfterDeletePos);
- }, function (paddPos) {
- setSelection(editor, forward, Option.some(paddPos));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }, {
+ previousCharIsSpace: false,
+ 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">- }
- };
- var $_eg6ib44jjgwe8ck = { deleteElement: deleteElement };
-
- var deleteElement$1 = function (editor, forward) {
- return function (element) {
- editor._selectionOverrides.hideFakeCaret();
- $_eg6ib44jjgwe8ck.deleteElement(editor, forward, Element$$1.fromDom(element));
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return result.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">- };
- var moveToElement = function (editor, forward) {
- return function (element) {
- var pos = forward ? CaretPosition$1.before(element) : CaretPosition$1.after(element);
- editor.selection.setRng(pos.toRange());
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var normalize$1 = function (node, offset, count) {
+ if (count === 0) {
+ return;
+ }
+ var whitespace = node.data.slice(offset, offset + count);
+ var isEndOfContent = offset + count >= node.data.length;
+ var isStartOfContent = offset === 0;
+ node.replaceData(offset, count, normalizeContent(whitespace, isStartOfContent, isEndOfContent));
</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 moveToPosition = function (editor) {
- return function (pos) {
- editor.selection.setRng(pos.toRange());
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var normalizeWhitespaceAfter = function (node, offset) {
+ var content = node.data.slice(offset);
+ var whitespaceCount = content.length - lTrim(content).length;
+ return normalize$1(node, offset, whitespaceCount);
</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 backspaceDeleteCaret = function (editor, forward) {
- var result = read$2(editor.getBody(), forward, editor.selection.getRng()).map(function (deleteAction) {
- return deleteAction.fold(deleteElement$1(editor, forward), moveToElement(editor, forward), moveToPosition(editor));
- });
- return result.getOr(false);
- };
- var deleteOffscreenSelection = function (rootElement) {
- each($_d3ydn427jjgwe7uf.descendants(rootElement, '.mce-offscreen-selection'), $_81exq51wjjgwe7sm.remove);
- };
- var backspaceDeleteRange = function (editor, forward) {
- var selectedElement = editor.selection.getNode();
- if ($_3b9u2y1rjjgwe7qe.isContentEditableFalse(selectedElement)) {
- deleteOffscreenSelection(Element$$1.fromDom(editor.getBody()));
- $_eg6ib44jjgwe8ck.deleteElement(editor, forward, Element$$1.fromDom(editor.selection.getNode()));
- $_3vi93f3sjjgwe861.paddEmptyBody(editor);
- return true;
- } else {
- return false;
- }
- };
- var getContentEditableRoot = function (root, node) {
- while (node && node !== root) {
- if ($_3b9u2y1rjjgwe7qe.isContentEditableTrue(node) || $_3b9u2y1rjjgwe7qe.isContentEditableFalse(node)) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var normalizeWhitespaceBefore = function (node, offset) {
+ var content = node.data.slice(0, offset);
+ var whitespaceCount = content.length - rTrim(content).length;
+ return normalize$1(node, offset - whitespaceCount, whitespaceCount);
+ };
+ var mergeTextNodes = function (prevNode, nextNode, normalizeWhitespace) {
+ var whitespaceOffset = rTrim(prevNode.data).length;
+ prevNode.appendData(nextNode.data);
+ remove$2(Element$$1.fromDom(nextNode));
+ if (normalizeWhitespace) {
+ normalizeWhitespaceAfter(prevNode, whitespaceOffset);
</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;
- }
- return null;
- };
- var paddEmptyElement = function (editor) {
- var br;
- var ceRoot = getContentEditableRoot(editor.getBody(), editor.selection.getNode());
- if ($_3b9u2y1rjjgwe7qe.isContentEditableTrue(ceRoot) && editor.dom.isBlock(ceRoot) && editor.dom.isEmpty(ceRoot)) {
- br = editor.dom.create('br', { 'data-mce-bogus': '1' });
- editor.dom.setHTML(ceRoot, '');
- ceRoot.appendChild(br);
- editor.selection.setRng(CaretPosition$1.before(br).toRange());
- }
- return true;
- };
- var backspaceDelete$2 = function (editor, forward) {
- if (editor.selection.isCollapsed()) {
- return backspaceDeleteCaret(editor, forward);
- } else {
- return backspaceDeleteRange(editor, forward);
- }
- };
- var $_cc2jel41jjgwe8bx = {
- backspaceDelete: backspaceDelete$2,
- paddEmptyElement: paddEmptyElement
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return prevNode;
+ };
</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 isText$8 = $_3b9u2y1rjjgwe7qe.isText;
- var startsWithCaretContainer$1 = function (node) {
- return isText$8(node) && node.data[0] === $_2xw7ul2pjjgwe7xs.ZWSP;
- };
- var endsWithCaretContainer$1 = function (node) {
- return isText$8(node) && node.data[node.data.length - 1] === $_2xw7ul2pjjgwe7xs.ZWSP;
- };
- var createZwsp = function (node) {
- return node.ownerDocument.createTextNode($_2xw7ul2pjjgwe7xs.ZWSP);
- };
- var insertBefore$1 = function (node) {
- if (isText$8(node.previousSibling)) {
- if (endsWithCaretContainer$1(node.previousSibling)) {
- return node.previousSibling;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var needsReposition = function (pos, elm) {
+ var container = pos.container();
+ var offset = pos.offset();
+ return CaretPosition$1.isTextPosition(pos) === false && container === elm.parentNode && offset > CaretPosition$1.before(elm).offset();
+ };
+ var reposition = function (elm, pos) {
+ return needsReposition(pos, elm) ? CaretPosition$1(pos.container(), pos.offset() - 1) : pos;
+ };
+ var beforeOrStartOf = function (node) {
+ return NodeType.isText(node) ? CaretPosition$1(node, 0) : CaretPosition$1.before(node);
+ };
+ var afterOrEndOf = function (node) {
+ return NodeType.isText(node) ? CaretPosition$1(node, node.data.length) : CaretPosition$1.after(node);
+ };
+ var getPreviousSiblingCaretPosition = function (elm) {
+ if (isCaretCandidate(elm.previousSibling)) {
+ return Option.some(afterOrEndOf(elm.previousSibling));
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- node.previousSibling.appendData($_2xw7ul2pjjgwe7xs.ZWSP);
- return node.previousSibling;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return elm.previousSibling ? CaretFinder.lastPositionIn(elm.previousSibling) : Option.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">- } else if (isText$8(node)) {
- if (startsWithCaretContainer$1(node)) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var getNextSiblingCaretPosition = function (elm) {
+ if (isCaretCandidate(elm.nextSibling)) {
+ return Option.some(beforeOrStartOf(elm.nextSibling));
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- node.insertData(0, $_2xw7ul2pjjgwe7xs.ZWSP);
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return elm.nextSibling ? CaretFinder.firstPositionIn(elm.nextSibling) : Option.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">- } else {
- var newNode = createZwsp(node);
- node.parentNode.insertBefore(newNode, node);
- return newNode;
- }
- };
- var insertAfter$1 = function (node) {
- if (isText$8(node.nextSibling)) {
- if (startsWithCaretContainer$1(node.nextSibling)) {
- return node.nextSibling;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var findCaretPositionBackwardsFromElm = function (rootElement, elm) {
+ var startPosition = CaretPosition$1.before(elm.previousSibling ? elm.previousSibling : elm.parentNode);
+ return CaretFinder.prevPosition(rootElement, startPosition).fold(function () {
+ return CaretFinder.nextPosition(rootElement, CaretPosition$1.after(elm));
+ }, Option.some);
+ };
+ var findCaretPositionForwardsFromElm = function (rootElement, elm) {
+ return CaretFinder.nextPosition(rootElement, CaretPosition$1.after(elm)).fold(function () {
+ return CaretFinder.prevPosition(rootElement, CaretPosition$1.before(elm));
+ }, Option.some);
+ };
+ var findCaretPositionBackwards = function (rootElement, elm) {
+ return getPreviousSiblingCaretPosition(elm).orThunk(function () {
+ return getNextSiblingCaretPosition(elm);
+ }).orThunk(function () {
+ return findCaretPositionBackwardsFromElm(rootElement, elm);
+ });
+ };
+ var findCaretPositionForward = function (rootElement, elm) {
+ return getNextSiblingCaretPosition(elm).orThunk(function () {
+ return getPreviousSiblingCaretPosition(elm);
+ }).orThunk(function () {
+ return findCaretPositionForwardsFromElm(rootElement, elm);
+ });
+ };
+ var findCaretPosition$1 = function (forward, rootElement, elm) {
+ return forward ? findCaretPositionForward(rootElement, elm) : findCaretPositionBackwards(rootElement, elm);
+ };
+ var findCaretPosOutsideElmAfterDelete = function (forward, rootElement, elm) {
+ return findCaretPosition$1(forward, rootElement, elm).map(curry(reposition, elm));
+ };
+ var setSelection = function (editor, forward, pos) {
+ pos.fold(function () {
+ editor.focus();
+ }, function (pos) {
+ editor.selection.setRng(pos.toRange(), forward);
+ });
+ };
+ var eqRawNode = function (rawNode) {
+ return function (elm) {
+ return elm.dom() === rawNode;
+ };
+ };
+ var isBlock$2 = function (editor, elm) {
+ return elm && editor.schema.getBlockElements().hasOwnProperty(name(elm));
+ };
+ var paddEmptyBlock = function (elm) {
+ if (Empty.isEmpty(elm)) {
+ var br = Element$$1.fromHtml('<br data-mce-bogus="1">');
+ empty(elm);
+ append(elm, br);
+ return Option.some(CaretPosition$1.before(br.dom()));
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- node.nextSibling.insertData(0, $_2xw7ul2pjjgwe7xs.ZWSP);
- return node.nextSibling;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Option.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">- } else if (isText$8(node)) {
- if (endsWithCaretContainer$1(node)) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var deleteNormalized = function (elm, afterDeletePosOpt, normalizeWhitespace) {
+ var prevTextOpt = prevSibling(elm).filter(function (e) {
+ return NodeType.isText(e.dom());
+ });
+ var nextTextOpt = nextSibling(elm).filter(function (e) {
+ return NodeType.isText(e.dom());
+ });
+ remove$2(elm);
+ return liftN([
+ prevTextOpt,
+ nextTextOpt,
+ afterDeletePosOpt
+ ], function (prev, next, pos) {
+ var prevNode = prev.dom(), nextNode = next.dom();
+ var offset = prevNode.data.length;
+ mergeTextNodes(prevNode, nextNode, normalizeWhitespace);
+ return pos.container() === nextNode ? CaretPosition$1(prevNode, offset) : pos;
+ }).orThunk(function () {
+ if (normalizeWhitespace) {
+ prevTextOpt.each(function (elm) {
+ return normalizeWhitespaceBefore(elm.dom(), elm.dom().length);
+ });
+ nextTextOpt.each(function (elm) {
+ return normalizeWhitespaceAfter(elm.dom(), 0);
+ });
+ }
+ return afterDeletePosOpt;
+ });
+ };
+ var isInlineElement = function (editor, element) {
+ return has(editor.schema.getTextInlineElements(), name(element));
+ };
+ var deleteElement = function (editor, forward, elm, moveCaret) {
+ if (moveCaret === void 0) {
+ moveCaret = true;
+ }
+ var afterDeletePos = findCaretPosOutsideElmAfterDelete(forward, editor.getBody(), elm.dom());
+ var parentBlock = ancestor(elm, curry(isBlock$2, editor), eqRawNode(editor.getBody()));
+ var normalizedAfterDeletePos = deleteNormalized(elm, afterDeletePos, isInlineElement(editor, elm));
+ if (editor.dom.isEmpty(editor.getBody())) {
+ editor.setContent('');
+ editor.selection.setCursorLocation();
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- node.appendData($_2xw7ul2pjjgwe7xs.ZWSP);
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parentBlock.bind(paddEmptyBlock).fold(function () {
+ if (moveCaret) {
+ setSelection(editor, forward, normalizedAfterDeletePos);
+ }
+ }, function (paddPos) {
+ if (moveCaret) {
+ setSelection(editor, forward, Option.some(paddPos));
+ }
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- var newNode = createZwsp(node);
- if (node.nextSibling) {
- node.parentNode.insertBefore(newNode, node.nextSibling);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var DeleteElement = { deleteElement: deleteElement };
+
+ var deleteElement$1 = function (editor, forward) {
+ return function (element) {
+ editor._selectionOverrides.hideFakeCaret();
+ DeleteElement.deleteElement(editor, forward, Element$$1.fromDom(element));
+ return true;
+ };
+ };
+ var moveToElement = function (editor, forward) {
+ return function (element) {
+ var pos = forward ? CaretPosition$1.before(element) : CaretPosition$1.after(element);
+ editor.selection.setRng(pos.toRange());
+ return true;
+ };
+ };
+ var moveToPosition = function (editor) {
+ return function (pos) {
+ editor.selection.setRng(pos.toRange());
+ return true;
+ };
+ };
+ var backspaceDeleteCaret = function (editor, forward) {
+ var result = read$2(editor.getBody(), forward, editor.selection.getRng()).map(function (deleteAction) {
+ return deleteAction.fold(deleteElement$1(editor, forward), moveToElement(editor, forward), moveToPosition(editor));
+ });
+ return result.getOr(false);
+ };
+ var deleteOffscreenSelection = function (rootElement) {
+ each(descendants$1(rootElement, '.mce-offscreen-selection'), remove$2);
+ };
+ var backspaceDeleteRange = function (editor, forward) {
+ var selectedElement = editor.selection.getNode();
+ if (NodeType.isContentEditableFalse(selectedElement)) {
+ deleteOffscreenSelection(Element$$1.fromDom(editor.getBody()));
+ DeleteElement.deleteElement(editor, forward, Element$$1.fromDom(editor.selection.getNode()));
+ DeleteUtils.paddEmptyBody(editor);
+ return true;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- node.parentNode.appendChild(newNode);
</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">- return newNode;
- }
- };
- var insertInline$1 = function (before, node) {
- return before ? insertBefore$1(node) : insertAfter$1(node);
- };
- var insertInlineBefore = curry(insertInline$1, true);
- var insertInlineAfter = curry(insertInline$1, false);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var getContentEditableRoot = function (root, node) {
+ while (node && node !== root) {
+ if (NodeType.isContentEditableTrue(node) || NodeType.isContentEditableFalse(node)) {
+ return node;
+ }
+ node = node.parentNode;
+ }
+ return null;
+ };
+ var paddEmptyElement = function (editor) {
+ var br;
+ var ceRoot = getContentEditableRoot(editor.getBody(), editor.selection.getNode());
+ if (NodeType.isContentEditableTrue(ceRoot) && editor.dom.isBlock(ceRoot) && editor.dom.isEmpty(ceRoot)) {
+ br = editor.dom.create('br', { 'data-mce-bogus': '1' });
+ editor.dom.setHTML(ceRoot, '');
+ ceRoot.appendChild(br);
+ editor.selection.setRng(CaretPosition$1.before(br).toRange());
+ }
+ return true;
+ };
+ var backspaceDelete$2 = function (editor, forward) {
+ if (editor.selection.isCollapsed()) {
+ return backspaceDeleteCaret(editor, forward);
+ } else {
+ return backspaceDeleteRange(editor, forward);
+ }
+ };
+ var CefDelete = {
+ backspaceDelete: backspaceDelete$2,
+ paddEmptyElement: paddEmptyElement
+ };
</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 insertInlinePos = function (pos, before) {
- if ($_3b9u2y1rjjgwe7qe.isText(pos.container())) {
- return insertInline$1(before, pos.container());
- } else {
- return insertInline$1(before, pos.getNode());
- }
- };
- var isPosCaretContainer = function (pos, caret) {
- var caretNode = caret.get();
- return caretNode && pos.container() === caretNode && isCaretContainerInline(caretNode);
- };
- var renderCaret = function (caret, location) {
- return location.fold(function (element) {
- $_cueauu31jjgwe7zy.remove(caret.get());
- var text = insertInlineBefore(element);
- caret.set(text);
- return Option.some(CaretPosition$1(text, text.length - 1));
- }, function (element) {
- return $_8q1ver2yjjgwe7z3.firstPositionIn(element).map(function (pos) {
- if (!isPosCaretContainer(pos, caret)) {
- $_cueauu31jjgwe7zy.remove(caret.get());
- var text = insertInlinePos(pos, true);
- caret.set(text);
- return CaretPosition$1(text, 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isText$8 = NodeType.isText;
+ var startsWithCaretContainer$1 = function (node) {
+ return isText$8(node) && node.data[0] === Zwsp.ZWSP;
+ };
+ var endsWithCaretContainer$1 = function (node) {
+ return isText$8(node) && node.data[node.data.length - 1] === Zwsp.ZWSP;
+ };
+ var createZwsp = function (node) {
+ return node.ownerDocument.createTextNode(Zwsp.ZWSP);
+ };
+ var insertBefore$1 = function (node) {
+ if (isText$8(node.previousSibling)) {
+ if (endsWithCaretContainer$1(node.previousSibling)) {
+ return node.previousSibling;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return CaretPosition$1(caret.get(), 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ node.previousSibling.appendData(Zwsp.ZWSP);
+ return node.previousSibling;
</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 (element) {
- return $_8q1ver2yjjgwe7z3.lastPositionIn(element).map(function (pos) {
- if (!isPosCaretContainer(pos, caret)) {
- $_cueauu31jjgwe7zy.remove(caret.get());
- var text = insertInlinePos(pos, false);
- caret.set(text);
- return CaretPosition$1(text, text.length - 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if (isText$8(node)) {
+ if (startsWithCaretContainer$1(node)) {
+ return node;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return CaretPosition$1(caret.get(), caret.get().length - 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ node.insertData(0, Zwsp.ZWSP);
+ return node;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ var newNode = createZwsp(node);
+ node.parentNode.insertBefore(newNode, node);
+ return newNode;
+ }
+ };
+ var insertAfter$1 = function (node) {
+ if (isText$8(node.nextSibling)) {
+ if (startsWithCaretContainer$1(node.nextSibling)) {
+ return node.nextSibling;
+ } else {
+ node.nextSibling.insertData(0, Zwsp.ZWSP);
+ return node.nextSibling;
+ }
+ } else if (isText$8(node)) {
+ if (endsWithCaretContainer$1(node)) {
+ return node;
+ } else {
+ node.appendData(Zwsp.ZWSP);
+ return node;
+ }
+ } else {
+ var newNode = createZwsp(node);
+ if (node.nextSibling) {
+ node.parentNode.insertBefore(newNode, node.nextSibling);
+ } else {
+ node.parentNode.appendChild(newNode);
+ }
+ return newNode;
+ }
+ };
+ var insertInline$1 = function (before, node) {
+ return before ? insertBefore$1(node) : insertAfter$1(node);
+ };
+ var insertInlineBefore = curry(insertInline$1, true);
+ var insertInlineAfter = curry(insertInline$1, false);
+
+ var insertInlinePos = function (pos, before) {
+ if (NodeType.isText(pos.container())) {
+ return insertInline$1(before, pos.container());
+ } else {
+ return insertInline$1(before, pos.getNode());
+ }
+ };
+ var isPosCaretContainer = function (pos, caret) {
+ var caretNode = caret.get();
+ return caretNode && pos.container() === caretNode && isCaretContainerInline(caretNode);
+ };
+ var renderCaret = function (caret, location) {
+ return location.fold(function (element) {
+ CaretContainerRemove.remove(caret.get());
+ var text = insertInlineBefore(element);
+ caret.set(text);
+ return Option.some(CaretPosition$1(text, text.length - 1));
+ }, function (element) {
+ return CaretFinder.firstPositionIn(element).map(function (pos) {
+ if (!isPosCaretContainer(pos, caret)) {
+ CaretContainerRemove.remove(caret.get());
+ var text = insertInlinePos(pos, true);
+ caret.set(text);
+ return CaretPosition$1(text, 1);
+ } else {
+ return CaretPosition$1(caret.get(), 1);
+ }
+ });
+ }, function (element) {
+ return CaretFinder.lastPositionIn(element).map(function (pos) {
+ if (!isPosCaretContainer(pos, caret)) {
+ CaretContainerRemove.remove(caret.get());
+ var text = insertInlinePos(pos, false);
+ caret.set(text);
+ return CaretPosition$1(text, text.length - 1);
+ } else {
+ return CaretPosition$1(caret.get(), caret.get().length - 1);
+ }
+ });
+ }, function (element) {
+ CaretContainerRemove.remove(caret.get());
+ var text = insertInlineAfter(element);
+ caret.set(text);
+ return Option.some(CaretPosition$1(text, 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">- }, function (element) {
- $_cueauu31jjgwe7zy.remove(caret.get());
- var text = insertInlineAfter(element);
- caret.set(text);
- return Option.some(CaretPosition$1(text, 1));
- });
- };
- var $_huqsd46jjgwe8de = { renderCaret: renderCaret };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var BoundaryCaret = { renderCaret: renderCaret };
</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 evaluateUntil = function (fns, args) {
- for (var i = 0; i < fns.length; i++) {
- var result = fns[i].apply(null, args);
- if (result.isSome()) {
- return result;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var evaluateUntil = function (fns, args) {
+ for (var i = 0; i < fns.length; i++) {
+ var result = fns[i].apply(null, args);
+ if (result.isSome()) {
+ return result;
+ }
</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 Option.none();
- };
- var $_2racda49jjgwe8dz = { evaluateUntil: evaluateUntil };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Option.none();
+ };
+ var LazyEvaluator = { evaluateUntil: evaluateUntil };
</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 Location = Adt.generate([
- { before: ['element'] },
- { start: ['element'] },
- { end: ['element'] },
- { after: ['element'] }
- ]);
- var rescope = function (rootNode, node) {
- var parentBlock = getParentBlock(node, rootNode);
- return parentBlock ? parentBlock : rootNode;
- };
- var before$3 = function (isInlineTarget, rootNode, pos) {
- var nPos = $_av9utf3tjjgwe86b.normalizeForwards(pos);
- var scope = rescope(rootNode, nPos.container());
- return $_av9utf3tjjgwe86b.findRootInline(isInlineTarget, scope, nPos).fold(function () {
- return $_8q1ver2yjjgwe7z3.nextPosition(scope, nPos).bind(curry($_av9utf3tjjgwe86b.findRootInline, isInlineTarget, scope)).map(function (inline) {
- return Location.before(inline);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Location = Adt.generate([
+ { before: ['element'] },
+ { start: ['element'] },
+ { end: ['element'] },
+ { after: ['element'] }
+ ]);
+ var rescope = function (rootNode, node) {
+ var parentBlock = getParentBlock(node, rootNode);
+ return parentBlock ? parentBlock : rootNode;
+ };
+ var before$3 = function (isInlineTarget, rootNode, pos) {
+ var nPos = InlineUtils.normalizeForwards(pos);
+ var scope = rescope(rootNode, nPos.container());
+ return InlineUtils.findRootInline(isInlineTarget, scope, nPos).fold(function () {
+ return CaretFinder.nextPosition(scope, nPos).bind(curry(InlineUtils.findRootInline, isInlineTarget, scope)).map(function (inline) {
+ return Location.before(inline);
+ });
+ }, Option.none);
+ };
+ var isNotInsideFormatCaretContainer = function (rootNode, elm) {
+ return getParentCaretContainer(rootNode, elm) === null;
+ };
+ var findInsideRootInline = function (isInlineTarget, rootNode, pos) {
+ return InlineUtils.findRootInline(isInlineTarget, rootNode, pos).filter(curry(isNotInsideFormatCaretContainer, rootNode));
+ };
+ var start = function (isInlineTarget, rootNode, pos) {
+ var nPos = InlineUtils.normalizeBackwards(pos);
+ return findInsideRootInline(isInlineTarget, rootNode, nPos).bind(function (inline) {
+ var prevPos = CaretFinder.prevPosition(inline, nPos);
+ return prevPos.isNone() ? Option.some(Location.start(inline)) : Option.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">- }, Option.none);
- };
- var isNotInsideFormatCaretContainer = function (rootNode, elm) {
- return getParentCaretContainer(rootNode, elm) === null;
- };
- var findInsideRootInline = function (isInlineTarget, rootNode, pos) {
- return $_av9utf3tjjgwe86b.findRootInline(isInlineTarget, rootNode, pos).filter(curry(isNotInsideFormatCaretContainer, rootNode));
- };
- var start = function (isInlineTarget, rootNode, pos) {
- var nPos = $_av9utf3tjjgwe86b.normalizeBackwards(pos);
- return findInsideRootInline(isInlineTarget, rootNode, nPos).bind(function (inline) {
- var prevPos = $_8q1ver2yjjgwe7z3.prevPosition(inline, nPos);
- return prevPos.isNone() ? Option.some(Location.start(inline)) : Option.none();
- });
- };
- var end = function (isInlineTarget, rootNode, pos) {
- var nPos = $_av9utf3tjjgwe86b.normalizeForwards(pos);
- return findInsideRootInline(isInlineTarget, rootNode, nPos).bind(function (inline) {
- var nextPos = $_8q1ver2yjjgwe7z3.nextPosition(inline, nPos);
- return nextPos.isNone() ? Option.some(Location.end(inline)) : Option.none();
- });
- };
- var after$3 = function (isInlineTarget, rootNode, pos) {
- var nPos = $_av9utf3tjjgwe86b.normalizeBackwards(pos);
- var scope = rescope(rootNode, nPos.container());
- return $_av9utf3tjjgwe86b.findRootInline(isInlineTarget, scope, nPos).fold(function () {
- return $_8q1ver2yjjgwe7z3.prevPosition(scope, nPos).bind(curry($_av9utf3tjjgwe86b.findRootInline, isInlineTarget, scope)).map(function (inline) {
- return Location.after(inline);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var end = function (isInlineTarget, rootNode, pos) {
+ var nPos = InlineUtils.normalizeForwards(pos);
+ return findInsideRootInline(isInlineTarget, rootNode, nPos).bind(function (inline) {
+ var nextPos = CaretFinder.nextPosition(inline, nPos);
+ return nextPos.isNone() ? Option.some(Location.end(inline)) : Option.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">- }, Option.none);
- };
- var isValidLocation = function (location) {
- return $_av9utf3tjjgwe86b.isRtl(getElement(location)) === false;
- };
- var readLocation = function (isInlineTarget, rootNode, pos) {
- var location = $_2racda49jjgwe8dz.evaluateUntil([
- before$3,
- start,
- end,
- after$3
- ], [
- isInlineTarget,
- rootNode,
- pos
- ]);
- return location.filter(isValidLocation);
- };
- var getElement = function (location) {
- return location.fold(identity, identity, identity, identity);
- };
- var getName = function (location) {
- return location.fold(constant('before'), constant('start'), constant('end'), constant('after'));
- };
- var outside = function (location) {
- return location.fold(Location.before, Location.before, Location.after, Location.after);
- };
- var inside = function (location) {
- return location.fold(Location.start, Location.start, Location.end, Location.end);
- };
- var isEq$1 = function (location1, location2) {
- return getName(location1) === getName(location2) && getElement(location1) === getElement(location2);
- };
- var betweenInlines = function (forward, isInlineTarget, rootNode, from, to, location) {
- return liftN([
- $_av9utf3tjjgwe86b.findRootInline(isInlineTarget, rootNode, from),
- $_av9utf3tjjgwe86b.findRootInline(isInlineTarget, rootNode, to)
- ], function (fromInline, toInline) {
- if (fromInline !== toInline && $_av9utf3tjjgwe86b.hasSameParentBlock(rootNode, fromInline, toInline)) {
- return Location.after(forward ? fromInline : toInline);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var after$3 = function (isInlineTarget, rootNode, pos) {
+ var nPos = InlineUtils.normalizeBackwards(pos);
+ var scope = rescope(rootNode, nPos.container());
+ return InlineUtils.findRootInline(isInlineTarget, scope, nPos).fold(function () {
+ return CaretFinder.prevPosition(scope, nPos).bind(curry(InlineUtils.findRootInline, isInlineTarget, scope)).map(function (inline) {
+ return Location.after(inline);
+ });
+ }, Option.none);
+ };
+ var isValidLocation = function (location) {
+ return InlineUtils.isRtl(getElement(location)) === false;
+ };
+ var readLocation = function (isInlineTarget, rootNode, pos) {
+ var location = LazyEvaluator.evaluateUntil([
+ before$3,
+ start,
+ end,
+ after$3
+ ], [
+ isInlineTarget,
+ rootNode,
+ pos
+ ]);
+ return location.filter(isValidLocation);
+ };
+ var getElement = function (location) {
+ return location.fold(identity, identity, identity, identity);
+ };
+ var getName = function (location) {
+ return location.fold(constant('before'), constant('start'), constant('end'), constant('after'));
+ };
+ var outside = function (location) {
+ return location.fold(Location.before, Location.before, Location.after, Location.after);
+ };
+ var inside = function (location) {
+ return location.fold(Location.start, Location.start, Location.end, Location.end);
+ };
+ var isEq$1 = function (location1, location2) {
+ return getName(location1) === getName(location2) && getElement(location1) === getElement(location2);
+ };
+ var betweenInlines = function (forward, isInlineTarget, rootNode, from, to, location) {
+ return liftN([
+ InlineUtils.findRootInline(isInlineTarget, rootNode, from),
+ InlineUtils.findRootInline(isInlineTarget, rootNode, to)
+ ], function (fromInline, toInline) {
+ if (fromInline !== toInline && InlineUtils.hasSameParentBlock(rootNode, fromInline, toInline)) {
+ return Location.after(forward ? fromInline : toInline);
+ } else {
+ return location;
+ }
+ }).getOr(location);
+ };
+ var skipNoMovement = function (fromLocation, toLocation) {
+ return fromLocation.fold(constant(true), function (fromLocation) {
+ return !isEq$1(fromLocation, toLocation);
+ });
+ };
+ var findLocationTraverse = function (forward, isInlineTarget, rootNode, fromLocation, pos) {
+ var from = InlineUtils.normalizePosition(forward, pos);
+ var to = CaretFinder.fromPosition(forward, rootNode, from).map(curry(InlineUtils.normalizePosition, forward));
+ var location = to.fold(function () {
+ return fromLocation.map(outside);
+ }, function (to) {
+ return readLocation(isInlineTarget, rootNode, to).map(curry(betweenInlines, forward, isInlineTarget, rootNode, from, to)).filter(curry(skipNoMovement, fromLocation));
+ });
+ return location.filter(isValidLocation);
+ };
+ var findLocationSimple = function (forward, location) {
+ if (forward) {
+ return location.fold(compose(Option.some, Location.start), Option.none, compose(Option.some, Location.after), Option.none);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return location;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return location.fold(Option.none, compose(Option.some, Location.before), Option.none, compose(Option.some, Location.end));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }).getOr(location);
- };
- var skipNoMovement = function (fromLocation, toLocation) {
- return fromLocation.fold(constant(true), function (fromLocation) {
- return !isEq$1(fromLocation, toLocation);
- });
- };
- var findLocationTraverse = function (forward, isInlineTarget, rootNode, fromLocation, pos) {
- var from = $_av9utf3tjjgwe86b.normalizePosition(forward, pos);
- var to = $_8q1ver2yjjgwe7z3.fromPosition(forward, rootNode, from).map(curry($_av9utf3tjjgwe86b.normalizePosition, forward));
- var location = to.fold(function () {
- return fromLocation.map(outside);
- }, function (to) {
- return readLocation(isInlineTarget, rootNode, to).map(curry(betweenInlines, forward, isInlineTarget, rootNode, from, to)).filter(curry(skipNoMovement, fromLocation));
- });
- return location.filter(isValidLocation);
- };
- var findLocationSimple = function (forward, location) {
- if (forward) {
- return location.fold(compose(Option.some, Location.start), Option.none, compose(Option.some, Location.after), Option.none);
- } else {
- return location.fold(Option.none, compose(Option.some, Location.before), Option.none, compose(Option.some, Location.end));
- }
- };
- var findLocation = function (forward, isInlineTarget, rootNode, pos) {
- var from = $_av9utf3tjjgwe86b.normalizePosition(forward, pos);
- var fromLocation = readLocation(isInlineTarget, rootNode, from);
- return readLocation(isInlineTarget, rootNode, from).bind(curry(findLocationSimple, forward)).orThunk(function () {
- return findLocationTraverse(forward, isInlineTarget, rootNode, fromLocation, pos);
- });
- };
- var $_g20q2x48jjgwe8dp = {
- readLocation: readLocation,
- findLocation: findLocation,
- prevLocation: curry(findLocation, false),
- nextLocation: curry(findLocation, true),
- getElement: getElement,
- outside: outside,
- inside: inside
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var findLocation = function (forward, isInlineTarget, rootNode, pos) {
+ var from = InlineUtils.normalizePosition(forward, pos);
+ var fromLocation = readLocation(isInlineTarget, rootNode, from);
+ return readLocation(isInlineTarget, rootNode, from).bind(curry(findLocationSimple, forward)).orThunk(function () {
+ return findLocationTraverse(forward, isInlineTarget, rootNode, fromLocation, pos);
+ });
+ };
+ var BoundaryLocation = {
+ readLocation: readLocation,
+ findLocation: findLocation,
+ prevLocation: curry(findLocation, false),
+ nextLocation: curry(findLocation, true),
+ getElement: getElement,
+ outside: outside,
+ inside: inside
+ };
</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 hasSelectionModifyApi = function (editor) {
- return isFunction(editor.selection.getSel().modify);
- };
- var moveRel = function (forward, selection, pos) {
- var delta = forward ? 1 : -1;
- selection.setRng(CaretPosition$1(pos.container(), pos.offset() + delta).toRange());
- selection.getSel().modify('move', forward ? 'forward' : 'backward', 'word');
- return true;
- };
- var moveByWord = function (forward, editor) {
- var rng = editor.selection.getRng();
- var pos = forward ? CaretPosition$1.fromRangeEnd(rng) : CaretPosition$1.fromRangeStart(rng);
- if (!hasSelectionModifyApi(editor)) {
- return false;
- } else if (forward && isBeforeInline(pos)) {
- return moveRel(true, editor.selection, pos);
- } else if (!forward && isAfterInline(pos)) {
- return moveRel(false, editor.selection, pos);
- } else {
- return false;
- }
- };
- var $_c544rm4bjjgwe8ea = {
- hasSelectionModifyApi: hasSelectionModifyApi,
- moveByWord: moveByWord
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasSelectionModifyApi = function (editor) {
+ return isFunction(editor.selection.getSel().modify);
+ };
+ var moveRel = function (forward, selection, pos) {
+ var delta = forward ? 1 : -1;
+ selection.setRng(CaretPosition$1(pos.container(), pos.offset() + delta).toRange());
+ selection.getSel().modify('move', forward ? 'forward' : 'backward', 'word');
+ return true;
+ };
+ var moveByWord = function (forward, editor) {
+ var rng = editor.selection.getRng();
+ var pos = forward ? CaretPosition$1.fromRangeEnd(rng) : CaretPosition$1.fromRangeStart(rng);
+ if (!hasSelectionModifyApi(editor)) {
+ return false;
+ } else if (forward && isBeforeInline(pos)) {
+ return moveRel(true, editor.selection, pos);
+ } else if (!forward && isAfterInline(pos)) {
+ return moveRel(false, editor.selection, pos);
+ } else {
+ return false;
+ }
+ };
+ var WordSelection = {
+ hasSelectionModifyApi: hasSelectionModifyApi,
+ moveByWord: moveByWord
+ };
</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 setCaretPosition = function (editor, pos) {
- var rng = editor.dom.createRng();
- rng.setStart(pos.container(), pos.offset());
- rng.setEnd(pos.container(), pos.offset());
- editor.selection.setRng(rng);
- };
- var isFeatureEnabled = function (editor) {
- return editor.settings.inline_boundaries !== false;
- };
- var setSelected = function (state, elm) {
- if (state) {
- elm.setAttribute('data-mce-selected', 'inline-boundary');
- } else {
- elm.removeAttribute('data-mce-selected');
- }
- };
- var renderCaretLocation = function (editor, caret, location) {
- return $_huqsd46jjgwe8de.renderCaret(caret, location).map(function (pos) {
- setCaretPosition(editor, pos);
- return location;
- });
- };
- var findLocation$1 = function (editor, caret, forward) {
- var rootNode = editor.getBody();
- var from = CaretPosition$1.fromRangeStart(editor.selection.getRng());
- var isInlineTarget = curry($_av9utf3tjjgwe86b.isInlineTarget, editor);
- var location = $_g20q2x48jjgwe8dp.findLocation(forward, isInlineTarget, rootNode, from);
- return location.bind(function (location) {
- return renderCaretLocation(editor, caret, location);
- });
- };
- var toggleInlines = function (isInlineTarget, dom, elms) {
- var selectedInlines = filter(dom.select('*[data-mce-selected="inline-boundary"]'), isInlineTarget);
- var targetInlines = filter(elms, isInlineTarget);
- each(difference(selectedInlines, targetInlines), curry(setSelected, false));
- each(difference(targetInlines, selectedInlines), curry(setSelected, true));
- };
- var safeRemoveCaretContainer = function (editor, caret) {
- if (editor.selection.isCollapsed() && editor.composing !== true && caret.get()) {
- var pos = CaretPosition$1.fromRangeStart(editor.selection.getRng());
- if (CaretPosition$1.isTextPosition(pos) && $_av9utf3tjjgwe86b.isAtZwsp(pos) === false) {
- setCaretPosition(editor, $_cueauu31jjgwe7zy.removeAndReposition(caret.get(), pos));
- caret.set(null);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setCaretPosition = function (editor, pos) {
+ var rng = editor.dom.createRng();
+ rng.setStart(pos.container(), pos.offset());
+ rng.setEnd(pos.container(), pos.offset());
+ editor.selection.setRng(rng);
+ };
+ var isFeatureEnabled = function (editor) {
+ return editor.settings.inline_boundaries !== false;
+ };
+ var setSelected = function (state, elm) {
+ if (state) {
+ elm.setAttribute('data-mce-selected', 'inline-boundary');
+ } else {
+ elm.removeAttribute('data-mce-selected');
</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 renderInsideInlineCaret = function (isInlineTarget, editor, caret, elms) {
- if (editor.selection.isCollapsed()) {
- var inlines = filter(elms, isInlineTarget);
- each(inlines, function (inline) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var renderCaretLocation = function (editor, caret, location) {
+ return BoundaryCaret.renderCaret(caret, location).map(function (pos) {
+ setCaretPosition(editor, pos);
+ return location;
+ });
+ };
+ var findLocation$1 = function (editor, caret, forward) {
+ var rootNode = editor.getBody();
+ var from = CaretPosition$1.fromRangeStart(editor.selection.getRng());
+ var isInlineTarget = curry(InlineUtils.isInlineTarget, editor);
+ var location = BoundaryLocation.findLocation(forward, isInlineTarget, rootNode, from);
+ return location.bind(function (location) {
+ return renderCaretLocation(editor, caret, location);
+ });
+ };
+ var toggleInlines = function (isInlineTarget, dom, elms) {
+ var selectedInlines = filter(dom.select('*[data-mce-selected="inline-boundary"]'), isInlineTarget);
+ var targetInlines = filter(elms, isInlineTarget);
+ each(difference(selectedInlines, targetInlines), curry(setSelected, false));
+ each(difference(targetInlines, selectedInlines), curry(setSelected, true));
+ };
+ var safeRemoveCaretContainer = function (editor, caret) {
+ if (editor.selection.isCollapsed() && editor.composing !== true && caret.get()) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var pos = CaretPosition$1.fromRangeStart(editor.selection.getRng());
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_g20q2x48jjgwe8dp.readLocation(isInlineTarget, editor.getBody(), pos).bind(function (location) {
- return renderCaretLocation(editor, caret, location);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (CaretPosition$1.isTextPosition(pos) && InlineUtils.isAtZwsp(pos) === false) {
+ setCaretPosition(editor, CaretContainerRemove.removeAndReposition(caret.get(), pos));
+ caret.set(null);
+ }
+ }
+ };
+ var renderInsideInlineCaret = function (isInlineTarget, editor, caret, elms) {
+ if (editor.selection.isCollapsed()) {
+ var inlines = filter(elms, isInlineTarget);
+ each(inlines, function (inline) {
+ var pos = CaretPosition$1.fromRangeStart(editor.selection.getRng());
+ BoundaryLocation.readLocation(isInlineTarget, editor.getBody(), pos).bind(function (location) {
+ return renderCaretLocation(editor, caret, location);
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ };
+ var move = function (editor, caret, forward) {
+ return function () {
+ return isFeatureEnabled(editor) ? findLocation$1(editor, caret, forward).isSome() : false;
+ };
+ };
+ var moveWord = function (forward, editor, caret) {
+ return function () {
+ return isFeatureEnabled(editor) ? WordSelection.moveByWord(forward, editor) : false;
+ };
+ };
+ var setupSelectedState = function (editor) {
+ var caret = Cell(null);
+ var isInlineTarget = curry(InlineUtils.isInlineTarget, editor);
+ editor.on('NodeChange', function (e) {
+ if (isFeatureEnabled(editor)) {
+ toggleInlines(isInlineTarget, editor.dom, e.parents);
+ safeRemoveCaretContainer(editor, caret);
+ renderInsideInlineCaret(isInlineTarget, editor, caret, e.parents);
+ }
</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 move = function (editor, caret, forward) {
- return function () {
- return isFeatureEnabled(editor) ? findLocation$1(editor, caret, forward).isSome() : false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return caret;
</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 moveWord = function (forward, editor, caret) {
- return function () {
- return isFeatureEnabled(editor) ? $_c544rm4bjjgwe8ea.moveByWord(forward, editor) : false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var moveNextWord = curry(moveWord, true);
+ var movePrevWord = curry(moveWord, false);
+ var BoundarySelection = {
+ move: move,
+ moveNextWord: moveNextWord,
+ movePrevWord: movePrevWord,
+ setupSelectedState: setupSelectedState,
+ setCaretPosition: setCaretPosition
</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 setupSelectedState = function (editor) {
- var caret = Cell(null);
- var isInlineTarget = curry($_av9utf3tjjgwe86b.isInlineTarget, editor);
- editor.on('NodeChange', function (e) {
- if (isFeatureEnabled(editor)) {
- toggleInlines(isInlineTarget, editor.dom, e.parents);
- safeRemoveCaretContainer(editor, caret);
- renderInsideInlineCaret(isInlineTarget, editor, caret, e.parents);
- }
- });
- return caret;
- };
- var moveNextWord = curry(moveWord, true);
- var movePrevWord = curry(moveWord, false);
- var $_80ia3a4ajjgwe8e2 = {
- move: move,
- moveNextWord: moveNextWord,
- movePrevWord: movePrevWord,
- setupSelectedState: setupSelectedState,
- setCaretPosition: setCaretPosition
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var isFeatureEnabled$1 = function (editor) {
- return editor.settings.inline_boundaries !== false;
- };
- var rangeFromPositions = function (from, to) {
- var range = document.createRange();
- range.setStart(from.container(), from.offset());
- range.setEnd(to.container(), to.offset());
- return range;
- };
- var hasOnlyTwoOrLessPositionsLeft = function (elm) {
- return liftN([
- $_8q1ver2yjjgwe7z3.firstPositionIn(elm),
- $_8q1ver2yjjgwe7z3.lastPositionIn(elm)
- ], function (firstPos, lastPos) {
- var normalizedFirstPos = $_av9utf3tjjgwe86b.normalizePosition(true, firstPos);
- var normalizedLastPos = $_av9utf3tjjgwe86b.normalizePosition(false, lastPos);
- return $_8q1ver2yjjgwe7z3.nextPosition(elm, normalizedFirstPos).map(function (pos) {
- return pos.isEqual(normalizedLastPos);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isFeatureEnabled$1 = function (editor) {
+ return editor.settings.inline_boundaries !== false;
+ };
+ var rangeFromPositions = function (from, to) {
+ var range = document.createRange();
+ range.setStart(from.container(), from.offset());
+ range.setEnd(to.container(), to.offset());
+ return range;
+ };
+ var hasOnlyTwoOrLessPositionsLeft = function (elm) {
+ return liftN([
+ CaretFinder.firstPositionIn(elm),
+ CaretFinder.lastPositionIn(elm)
+ ], function (firstPos, lastPos) {
+ var normalizedFirstPos = InlineUtils.normalizePosition(true, firstPos);
+ var normalizedLastPos = InlineUtils.normalizePosition(false, lastPos);
+ return CaretFinder.nextPosition(elm, normalizedFirstPos).map(function (pos) {
+ return pos.isEqual(normalizedLastPos);
+ }).getOr(true);
</ins><span class="cx" style="display: block; padding: 0 10px"> }).getOr(true);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }).getOr(true);
- };
- var setCaretLocation = function (editor, caret) {
- return function (location$$1) {
- return $_huqsd46jjgwe8de.renderCaret(caret, location$$1).map(function (pos) {
- $_80ia3a4ajjgwe8e2.setCaretPosition(editor, pos);
- return true;
- }).getOr(false);
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var deleteFromTo = function (editor, caret, from, to) {
- var rootNode = editor.getBody();
- var isInlineTarget = curry($_av9utf3tjjgwe86b.isInlineTarget, editor);
- editor.undoManager.ignore(function () {
- editor.selection.setRng(rangeFromPositions(from, to));
- editor.execCommand('Delete');
- $_g20q2x48jjgwe8dp.readLocation(isInlineTarget, rootNode, CaretPosition$1.fromRangeStart(editor.selection.getRng())).map($_g20q2x48jjgwe8dp.inside).map(setCaretLocation(editor, caret));
- });
- editor.nodeChanged();
- };
- var rescope$1 = function (rootNode, node) {
- var parentBlock = getParentBlock(node, rootNode);
- return parentBlock ? parentBlock : rootNode;
- };
- var backspaceDeleteCollapsed = function (editor, caret, forward, from) {
- var rootNode = rescope$1(editor.getBody(), from.container());
- var isInlineTarget = curry($_av9utf3tjjgwe86b.isInlineTarget, editor);
- var fromLocation = $_g20q2x48jjgwe8dp.readLocation(isInlineTarget, rootNode, from);
- return fromLocation.bind(function (location$$1) {
- if (forward) {
- return location$$1.fold(constant(Option.some($_g20q2x48jjgwe8dp.inside(location$$1))), Option.none, constant(Option.some($_g20q2x48jjgwe8dp.outside(location$$1))), Option.none);
- } else {
- return location$$1.fold(Option.none, constant(Option.some($_g20q2x48jjgwe8dp.outside(location$$1))), Option.none, constant(Option.some($_g20q2x48jjgwe8dp.inside(location$$1))));
- }
- }).map(setCaretLocation(editor, caret)).getOrThunk(function () {
- var toPosition = $_8q1ver2yjjgwe7z3.navigate(forward, rootNode, from);
- var toLocation = toPosition.bind(function (pos) {
- return $_g20q2x48jjgwe8dp.readLocation(isInlineTarget, rootNode, pos);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setCaretLocation = function (editor, caret) {
+ return function (location$$1) {
+ return BoundaryCaret.renderCaret(caret, location$$1).map(function (pos) {
+ BoundarySelection.setCaretPosition(editor, pos);
+ return true;
+ }).getOr(false);
+ };
+ };
+ var deleteFromTo = function (editor, caret, from, to) {
+ var rootNode = editor.getBody();
+ var isInlineTarget = curry(InlineUtils.isInlineTarget, editor);
+ editor.undoManager.ignore(function () {
+ editor.selection.setRng(rangeFromPositions(from, to));
+ editor.execCommand('Delete');
+ BoundaryLocation.readLocation(isInlineTarget, rootNode, CaretPosition$1.fromRangeStart(editor.selection.getRng())).map(BoundaryLocation.inside).map(setCaretLocation(editor, caret));
</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 (fromLocation.isSome() && toLocation.isSome()) {
- return $_av9utf3tjjgwe86b.findRootInline(isInlineTarget, rootNode, from).map(function (elm) {
- if (hasOnlyTwoOrLessPositionsLeft(elm)) {
- $_eg6ib44jjgwe8ck.deleteElement(editor, forward, Element$$1.fromDom(elm));
- return true;
- } else {
- return false;
- }
- }).getOr(false);
- } else {
- return toLocation.bind(function (_) {
- return toPosition.map(function (to) {
- if (forward) {
- deleteFromTo(editor, caret, from, to);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.nodeChanged();
+ };
+ var rescope$1 = function (rootNode, node) {
+ var parentBlock = getParentBlock(node, rootNode);
+ return parentBlock ? parentBlock : rootNode;
+ };
+ var backspaceDeleteCollapsed = function (editor, caret, forward, from) {
+ var rootNode = rescope$1(editor.getBody(), from.container());
+ var isInlineTarget = curry(InlineUtils.isInlineTarget, editor);
+ var fromLocation = BoundaryLocation.readLocation(isInlineTarget, rootNode, from);
+ return fromLocation.bind(function (location$$1) {
+ if (forward) {
+ return location$$1.fold(constant(Option.some(BoundaryLocation.inside(location$$1))), Option.none, constant(Option.some(BoundaryLocation.outside(location$$1))), Option.none);
+ } else {
+ return location$$1.fold(Option.none, constant(Option.some(BoundaryLocation.outside(location$$1))), Option.none, constant(Option.some(BoundaryLocation.inside(location$$1))));
+ }
+ }).map(setCaretLocation(editor, caret)).getOrThunk(function () {
+ var toPosition = CaretFinder.navigate(forward, rootNode, from);
+ var toLocation = toPosition.bind(function (pos) {
+ return BoundaryLocation.readLocation(isInlineTarget, rootNode, pos);
+ });
+ if (fromLocation.isSome() && toLocation.isSome()) {
+ return InlineUtils.findRootInline(isInlineTarget, rootNode, from).map(function (elm) {
+ if (hasOnlyTwoOrLessPositionsLeft(elm)) {
+ DeleteElement.deleteElement(editor, forward, Element$$1.fromDom(elm));
+ return true;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- deleteFromTo(editor, caret, to, from);
</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">- return true;
- });
- }).getOr(false);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }).getOr(false);
+ } else {
+ return toLocation.bind(function (_) {
+ return toPosition.map(function (to) {
+ if (forward) {
+ deleteFromTo(editor, caret, from, to);
+ } else {
+ deleteFromTo(editor, caret, to, from);
+ }
+ return true;
+ });
+ }).getOr(false);
+ }
+ });
+ };
+ var backspaceDelete$3 = function (editor, caret, forward) {
+ if (editor.selection.isCollapsed() && isFeatureEnabled$1(editor)) {
+ var from = CaretPosition$1.fromRangeStart(editor.selection.getRng());
+ return backspaceDeleteCollapsed(editor, caret, forward, from);
</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 backspaceDelete$3 = function (editor, caret, forward) {
- if (editor.selection.isCollapsed() && isFeatureEnabled$1(editor)) {
- var from = CaretPosition$1.fromRangeStart(editor.selection.getRng());
- return backspaceDeleteCollapsed(editor, caret, forward, from);
- }
- return false;
- };
- var $_fwrmt445jjgwe8d5 = { backspaceDelete: backspaceDelete$3 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return false;
+ };
+ var InlineBoundaryDelete = { backspaceDelete: backspaceDelete$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 tableCellRng = Immutable('start', 'end');
- var tableSelection = Immutable('rng', 'table', 'cells');
- var deleteAction = Adt.generate([
- { removeTable: ['element'] },
- { emptyCells: ['cells'] }
- ]);
- var isRootFromElement = function (root) {
- return curry($_5raon11ejjgwe7o5.eq, root);
- };
- var getClosestCell$1 = function (container, isRoot) {
- return $_ajwe9029jjgwe7ul.closest(Element$$1.fromDom(container), 'td,th', isRoot);
- };
- var getClosestTable = function (cell, isRoot) {
- return $_ajwe9029jjgwe7ul.ancestor(cell, 'table', isRoot);
- };
- var isExpandedCellRng = function (cellRng) {
- return $_5raon11ejjgwe7o5.eq(cellRng.start(), cellRng.end()) === false;
- };
- var getTableFromCellRng = function (cellRng, isRoot) {
- return getClosestTable(cellRng.start(), isRoot).bind(function (startParentTable) {
- return getClosestTable(cellRng.end(), isRoot).bind(function (endParentTable) {
- return $_5raon11ejjgwe7o5.eq(startParentTable, endParentTable) ? Option.some(startParentTable) : Option.none();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var tableCellRng = Immutable('start', 'end');
+ var tableSelection = Immutable('rng', 'table', 'cells');
+ var deleteAction = Adt.generate([
+ { removeTable: ['element'] },
+ { emptyCells: ['cells'] }
+ ]);
+ var isRootFromElement = function (root) {
+ return curry(eq, root);
+ };
+ var getClosestCell = function (container, isRoot) {
+ return closest$1(Element$$1.fromDom(container), 'td,th', isRoot);
+ };
+ var getClosestTable = function (cell, isRoot) {
+ return ancestor$1(cell, 'table', isRoot);
+ };
+ var isExpandedCellRng = function (cellRng) {
+ return eq(cellRng.start(), cellRng.end()) === false;
+ };
+ var getTableFromCellRng = function (cellRng, isRoot) {
+ return getClosestTable(cellRng.start(), isRoot).bind(function (startParentTable) {
+ return getClosestTable(cellRng.end(), isRoot).bind(function (endParentTable) {
+ return eq(startParentTable, endParentTable) ? Option.some(startParentTable) : Option.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 getTableCells = function (table) {
- return $_d3ydn427jjgwe7uf.descendants(table, 'td,th');
- };
- var getCellRangeFromStartTable = function (cellRng, isRoot) {
- return getClosestTable(cellRng.start(), isRoot).bind(function (table) {
- return last(getTableCells(table)).map(function (endCell) {
- return tableCellRng(cellRng.start(), endCell);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var getTableCells = function (table) {
+ return descendants$1(table, 'td,th');
+ };
+ var getCellRangeFromStartTable = function (cellRng, isRoot) {
+ return getClosestTable(cellRng.start(), isRoot).bind(function (table) {
+ return last(getTableCells(table)).map(function (endCell) {
+ return tableCellRng(cellRng.start(), endCell);
+ });
</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 partialSelection = function (isRoot, rng) {
- var startCell = getClosestCell$1(rng.startContainer, isRoot);
- var endCell = getClosestCell$1(rng.endContainer, isRoot);
- return rng.collapsed ? Option.none() : liftN([
- startCell,
- endCell
- ], tableCellRng).fold(function () {
- return startCell.fold(function () {
- return endCell.bind(function (endCell) {
- return getClosestTable(endCell, isRoot).bind(function (table) {
- return head(getTableCells(table)).map(function (startCell) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var partialSelection = function (isRoot, rng) {
+ var startCell = getClosestCell(rng.startContainer, isRoot);
+ var endCell = getClosestCell(rng.endContainer, isRoot);
+ return rng.collapsed ? Option.none() : liftN([
+ startCell,
+ endCell
+ ], tableCellRng).fold(function () {
+ return startCell.fold(function () {
+ return endCell.bind(function (endCell) {
+ return getClosestTable(endCell, isRoot).bind(function (table) {
+ return head(getTableCells(table)).map(function (startCell) {
+ return tableCellRng(startCell, endCell);
+ });
+ });
+ });
+ }, function (startCell) {
+ return getClosestTable(startCell, isRoot).bind(function (table) {
+ return last(getTableCells(table)).map(function (endCell) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return tableCellRng(startCell, endCell);
</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">- }, function (startCell) {
- return getClosestTable(startCell, isRoot).bind(function (table) {
- return last(getTableCells(table)).map(function (endCell) {
- return tableCellRng(startCell, endCell);
- });
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }, function (cellRng) {
+ return isWithinSameTable(isRoot, cellRng) ? Option.none() : getCellRangeFromStartTable(cellRng, isRoot);
</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 (cellRng) {
- return isWithinSameTable(isRoot, cellRng) ? Option.none() : getCellRangeFromStartTable(cellRng, isRoot);
- });
- };
- var isWithinSameTable = function (isRoot, cellRng) {
- return getTableFromCellRng(cellRng, isRoot).isSome();
- };
- var getCellRng = function (rng, isRoot) {
- var startCell = getClosestCell$1(rng.startContainer, isRoot);
- var endCell = getClosestCell$1(rng.endContainer, isRoot);
- return liftN([
- startCell,
- endCell
- ], tableCellRng).filter(isExpandedCellRng).filter(function (cellRng) {
- return isWithinSameTable(isRoot, cellRng);
- }).orThunk(function () {
- return partialSelection(isRoot, rng);
- });
- };
- var getTableSelectionFromCellRng = function (cellRng, isRoot) {
- return getTableFromCellRng(cellRng, isRoot).map(function (table) {
- return tableSelection(cellRng, table, getTableCells(table));
- });
- };
- var getTableSelectionFromRng = function (root, rng) {
- var isRoot = isRootFromElement(root);
- return getCellRng(rng, isRoot).bind(function (cellRng) {
- return getTableSelectionFromCellRng(cellRng, isRoot);
- });
- };
- var getCellIndex = function (cells, cell) {
- return findIndex(cells, function (x) {
- return $_5raon11ejjgwe7o5.eq(x, cell);
- });
- };
- var getSelectedCells = function (tableSelection) {
- return liftN([
- getCellIndex(tableSelection.cells(), tableSelection.rng().start()),
- getCellIndex(tableSelection.cells(), tableSelection.rng().end())
- ], function (startIndex, endIndex) {
- return tableSelection.cells().slice(startIndex, endIndex + 1);
- });
- };
- var getAction = function (tableSelection) {
- return getSelectedCells(tableSelection).map(function (selected) {
- var cells = tableSelection.cells();
- return selected.length === cells.length ? deleteAction.removeTable(tableSelection.table()) : deleteAction.emptyCells(selected);
- });
- };
- var getActionFromCells = function (cells) {
- return deleteAction.emptyCells(cells);
- };
- var getActionFromRange = function (root, rng) {
- return getTableSelectionFromRng(root, rng).bind(getAction);
- };
- var $_cyt1v04djjgwe8ex = {
- getActionFromRange: getActionFromRange,
- getActionFromCells: getActionFromCells
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var isWithinSameTable = function (isRoot, cellRng) {
+ return getTableFromCellRng(cellRng, isRoot).isSome();
+ };
+ var getCellRng = function (rng, isRoot) {
+ var startCell = getClosestCell(rng.startContainer, isRoot);
+ var endCell = getClosestCell(rng.endContainer, isRoot);
+ return liftN([
+ startCell,
+ endCell
+ ], tableCellRng).filter(isExpandedCellRng).filter(function (cellRng) {
+ return isWithinSameTable(isRoot, cellRng);
+ }).orThunk(function () {
+ return partialSelection(isRoot, rng);
+ });
+ };
+ var getTableSelectionFromCellRng = function (cellRng, isRoot) {
+ return getTableFromCellRng(cellRng, isRoot).map(function (table) {
+ return tableSelection(cellRng, table, getTableCells(table));
+ });
+ };
+ var getTableSelectionFromRng = function (root, rng) {
+ var isRoot = isRootFromElement(root);
+ return getCellRng(rng, isRoot).bind(function (cellRng) {
+ return getTableSelectionFromCellRng(cellRng, isRoot);
+ });
+ };
+ var getCellIndex = function (cells, cell) {
+ return findIndex(cells, function (x) {
+ return eq(x, cell);
+ });
+ };
+ var getSelectedCells = function (tableSelection) {
+ return liftN([
+ getCellIndex(tableSelection.cells(), tableSelection.rng().start()),
+ getCellIndex(tableSelection.cells(), tableSelection.rng().end())
+ ], function (startIndex, endIndex) {
+ return tableSelection.cells().slice(startIndex, endIndex + 1);
+ });
+ };
+ var getAction = function (tableSelection) {
+ return getSelectedCells(tableSelection).map(function (selected) {
+ var cells = tableSelection.cells();
+ return selected.length === cells.length ? deleteAction.removeTable(tableSelection.table()) : deleteAction.emptyCells(selected);
+ });
+ };
+ var getActionFromCells = function (cells) {
+ return deleteAction.emptyCells(cells);
+ };
+ var getActionFromRange = function (root, rng) {
+ return getTableSelectionFromRng(root, rng).bind(getAction);
+ };
+ var TableDeleteAction = {
+ getActionFromRange: getActionFromRange,
+ getActionFromCells: getActionFromCells
+ };
</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 getRanges = function (selection) {
- var ranges = [];
- if (selection) {
- for (var i = 0; i < selection.rangeCount; i++) {
- ranges.push(selection.getRangeAt(i));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getRanges = function (selection) {
+ var ranges = [];
+ if (selection) {
+ for (var i = 0; i < selection.rangeCount; i++) {
+ ranges.push(selection.getRangeAt(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">- }
- return ranges;
- };
- var getSelectedNodes = function (ranges) {
- return bind(ranges, function (range$$1) {
- var node = getSelectedNode(range$$1);
- return node ? [Element$$1.fromDom(node)] : [];
- });
- };
- var hasMultipleRanges = function (selection) {
- return getRanges(selection).length > 1;
- };
- var $_2y1a8s4fjjgwe8fm = {
- getRanges: getRanges,
- getSelectedNodes: getSelectedNodes,
- hasMultipleRanges: hasMultipleRanges
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return ranges;
+ };
+ var getSelectedNodes = function (ranges) {
+ return bind(ranges, function (range$$1) {
+ var node = getSelectedNode(range$$1);
+ return node ? [Element$$1.fromDom(node)] : [];
+ });
+ };
+ var hasMultipleRanges = function (selection) {
+ return getRanges(selection).length > 1;
+ };
+ var MultiRange = {
+ getRanges: getRanges,
+ getSelectedNodes: getSelectedNodes,
+ hasMultipleRanges: hasMultipleRanges
+ };
</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 getCellsFromRanges = function (ranges) {
- return filter($_2y1a8s4fjjgwe8fm.getSelectedNodes(ranges), isTableCell);
- };
- var getCellsFromElement = function (elm) {
- var selectedCells = $_d3ydn427jjgwe7uf.descendants(elm, 'td[data-mce-selected],th[data-mce-selected]');
- return selectedCells;
- };
- var getCellsFromElementOrRanges = function (ranges, element) {
- var selectedCells = getCellsFromElement(element);
- var rangeCells = getCellsFromRanges(ranges);
- return selectedCells.length > 0 ? selectedCells : rangeCells;
- };
- var getCellsFromEditor = function (editor) {
- return getCellsFromElementOrRanges($_2y1a8s4fjjgwe8fm.getRanges(editor.selection.getSel()), Element$$1.fromDom(editor.getBody()));
- };
- var $_97ifsc4ejjgwe8fg = {
- getCellsFromRanges: getCellsFromRanges,
- getCellsFromElement: getCellsFromElement,
- getCellsFromElementOrRanges: getCellsFromElementOrRanges,
- getCellsFromEditor: getCellsFromEditor
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getCellsFromRanges = function (ranges) {
+ return filter(MultiRange.getSelectedNodes(ranges), isTableCell);
+ };
+ var getCellsFromElement = function (elm) {
+ var selectedCells = descendants$1(elm, 'td[data-mce-selected],th[data-mce-selected]');
+ return selectedCells;
+ };
+ var getCellsFromElementOrRanges = function (ranges, element) {
+ var selectedCells = getCellsFromElement(element);
+ var rangeCells = getCellsFromRanges(ranges);
+ return selectedCells.length > 0 ? selectedCells : rangeCells;
+ };
+ var getCellsFromEditor = function (editor) {
+ return getCellsFromElementOrRanges(MultiRange.getRanges(editor.selection.getSel()), Element$$1.fromDom(editor.getBody()));
+ };
+ var TableCellSelection = {
+ getCellsFromRanges: getCellsFromRanges,
+ getCellsFromElement: getCellsFromElement,
+ getCellsFromElementOrRanges: getCellsFromElementOrRanges,
+ getCellsFromEditor: getCellsFromEditor
+ };
</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 emptyCells = function (editor, cells) {
- each(cells, $_fhp7pa3ljjgwe84n.fillWithPaddingBr);
- editor.selection.setCursorLocation(cells[0].dom(), 0);
- return true;
- };
- var deleteTableElement = function (editor, table) {
- $_eg6ib44jjgwe8ck.deleteElement(editor, false, table);
- return true;
- };
- var deleteCellRange = function (editor, rootElm, rng) {
- return $_cyt1v04djjgwe8ex.getActionFromRange(rootElm, rng).map(function (action) {
- return action.fold(curry(deleteTableElement, editor), curry(emptyCells, editor));
- });
- };
- var deleteCaptionRange = function (editor, caption) {
- return emptyElement(editor, caption);
- };
- var deleteTableRange = function (editor, rootElm, rng, startElm) {
- return getParentCaption(rootElm, startElm).fold(function () {
- return deleteCellRange(editor, rootElm, rng);
- }, function (caption) {
- return deleteCaptionRange(editor, caption);
- }).getOr(false);
- };
- var deleteRange$1 = function (editor, startElm) {
- var rootNode = Element$$1.fromDom(editor.getBody());
- var rng = editor.selection.getRng();
- var selectedCells = $_97ifsc4ejjgwe8fg.getCellsFromEditor(editor);
- return selectedCells.length !== 0 ? emptyCells(editor, selectedCells) : deleteTableRange(editor, rootNode, rng, startElm);
- };
- var getParentCell = function (rootElm, elm) {
- return find($_cvft7x3zjjgwe8bh.parentsAndSelf(elm, rootElm), isTableCell);
- };
- var getParentCaption = function (rootElm, elm) {
- return find($_cvft7x3zjjgwe8bh.parentsAndSelf(elm, rootElm), function (elm) {
- return $_fxxo5411jjgwe7lq.name(elm) === 'caption';
- });
- };
- var deleteBetweenCells = function (editor, rootElm, forward, fromCell, from) {
- return $_8q1ver2yjjgwe7z3.navigate(forward, editor.getBody(), from).bind(function (to) {
- return getParentCell(rootElm, Element$$1.fromDom(to.getNode())).map(function (toCell) {
- return $_5raon11ejjgwe7o5.eq(toCell, fromCell) === false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var emptyCells = function (editor, cells) {
+ each(cells, PaddingBr.fillWithPaddingBr);
+ editor.selection.setCursorLocation(cells[0].dom(), 0);
+ return true;
+ };
+ var deleteTableElement = function (editor, table) {
+ DeleteElement.deleteElement(editor, false, table);
+ return true;
+ };
+ var deleteCellRange = function (editor, rootElm, rng) {
+ return TableDeleteAction.getActionFromRange(rootElm, rng).map(function (action) {
+ return action.fold(curry(deleteTableElement, editor), curry(emptyCells, 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">- });
- };
- var emptyElement = function (editor, elm) {
- $_fhp7pa3ljjgwe84n.fillWithPaddingBr(elm);
- editor.selection.setCursorLocation(elm.dom(), 0);
- return Option.some(true);
- };
- var isDeleteOfLastCharPos = function (fromCaption, forward, from, to) {
- return $_8q1ver2yjjgwe7z3.firstPositionIn(fromCaption.dom()).bind(function (first) {
- return $_8q1ver2yjjgwe7z3.lastPositionIn(fromCaption.dom()).map(function (last$$1) {
- return forward ? from.isEqual(first) && to.isEqual(last$$1) : from.isEqual(last$$1) && to.isEqual(first);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var deleteCaptionRange = function (editor, caption) {
+ return emptyElement(editor, caption);
+ };
+ var deleteTableRange = function (editor, rootElm, rng, startElm) {
+ return getParentCaption(rootElm, startElm).fold(function () {
+ return deleteCellRange(editor, rootElm, rng);
+ }, function (caption) {
+ return deleteCaptionRange(editor, caption);
+ }).getOr(false);
+ };
+ var deleteRange$1 = function (editor, startElm) {
+ var rootNode = Element$$1.fromDom(editor.getBody());
+ var rng = editor.selection.getRng();
+ var selectedCells = TableCellSelection.getCellsFromEditor(editor);
+ return selectedCells.length !== 0 ? emptyCells(editor, selectedCells) : deleteTableRange(editor, rootNode, rng, startElm);
+ };
+ var getParentCell = function (rootElm, elm) {
+ return find(Parents.parentsAndSelf(elm, rootElm), isTableCell);
+ };
+ var getParentCaption = function (rootElm, elm) {
+ return find(Parents.parentsAndSelf(elm, rootElm), function (elm) {
+ return name(elm) === '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">- }).getOr(true);
- };
- var emptyCaretCaption = function (editor, elm) {
- return emptyElement(editor, elm);
- };
- var validateCaretCaption = function (rootElm, fromCaption, to) {
- return getParentCaption(rootElm, Element$$1.fromDom(to.getNode())).map(function (toCaption) {
- return $_5raon11ejjgwe7o5.eq(toCaption, fromCaption) === false;
- });
- };
- var deleteCaretInsideCaption = function (editor, rootElm, forward, fromCaption, from) {
- return $_8q1ver2yjjgwe7z3.navigate(forward, editor.getBody(), from).bind(function (to) {
- return isDeleteOfLastCharPos(fromCaption, forward, from, to) ? emptyCaretCaption(editor, fromCaption) : validateCaretCaption(rootElm, fromCaption, to);
- }).or(Option.some(true));
- };
- var deleteCaretCells = function (editor, forward, rootElm, startElm) {
- var from = CaretPosition$1.fromRangeStart(editor.selection.getRng());
- return getParentCell(rootElm, startElm).bind(function (fromCell) {
- return $_99xuux3wjjgwe8as.isEmpty(fromCell) ? emptyElement(editor, fromCell) : deleteBetweenCells(editor, rootElm, forward, fromCell, from);
- });
- };
- var deleteCaretCaption = function (editor, forward, rootElm, fromCaption) {
- var from = CaretPosition$1.fromRangeStart(editor.selection.getRng());
- return $_99xuux3wjjgwe8as.isEmpty(fromCaption) ? emptyElement(editor, fromCaption) : deleteCaretInsideCaption(editor, rootElm, forward, fromCaption, from);
- };
- var deleteCaret = function (editor, forward, startElm) {
- var rootElm = Element$$1.fromDom(editor.getBody());
- return getParentCaption(rootElm, startElm).fold(function () {
- return deleteCaretCells(editor, forward, rootElm, startElm);
- }, function (fromCaption) {
- return deleteCaretCaption(editor, forward, rootElm, fromCaption);
- }).getOr(false);
- };
- var backspaceDelete$4 = function (editor, forward) {
- var startElm = Element$$1.fromDom(editor.selection.getStart(true));
- var cells = $_97ifsc4ejjgwe8fg.getCellsFromEditor(editor);
- return editor.selection.isCollapsed() && cells.length === 0 ? deleteCaret(editor, forward, startElm) : deleteRange$1(editor, startElm);
- };
- var $_f2hioa4cjjgwe8ee = { backspaceDelete: backspaceDelete$4 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var deleteBetweenCells = function (editor, rootElm, forward, fromCell, from) {
+ return CaretFinder.navigate(forward, editor.getBody(), from).bind(function (to) {
+ return getParentCell(rootElm, Element$$1.fromDom(to.getNode())).map(function (toCell) {
+ return eq(toCell, fromCell) === false;
+ });
+ });
+ };
+ var emptyElement = function (editor, elm) {
+ PaddingBr.fillWithPaddingBr(elm);
+ editor.selection.setCursorLocation(elm.dom(), 0);
+ return Option.some(true);
+ };
+ var isDeleteOfLastCharPos = function (fromCaption, forward, from, to) {
+ return CaretFinder.firstPositionIn(fromCaption.dom()).bind(function (first) {
+ return CaretFinder.lastPositionIn(fromCaption.dom()).map(function (last$$1) {
+ return forward ? from.isEqual(first) && to.isEqual(last$$1) : from.isEqual(last$$1) && to.isEqual(first);
+ });
+ }).getOr(true);
+ };
+ var emptyCaretCaption = function (editor, elm) {
+ return emptyElement(editor, elm);
+ };
+ var validateCaretCaption = function (rootElm, fromCaption, to) {
+ return getParentCaption(rootElm, Element$$1.fromDom(to.getNode())).map(function (toCaption) {
+ return eq(toCaption, fromCaption) === false;
+ });
+ };
+ var deleteCaretInsideCaption = function (editor, rootElm, forward, fromCaption, from) {
+ return CaretFinder.navigate(forward, editor.getBody(), from).bind(function (to) {
+ return isDeleteOfLastCharPos(fromCaption, forward, from, to) ? emptyCaretCaption(editor, fromCaption) : validateCaretCaption(rootElm, fromCaption, to);
+ }).or(Option.some(true));
+ };
+ var deleteCaretCells = function (editor, forward, rootElm, startElm) {
+ var from = CaretPosition$1.fromRangeStart(editor.selection.getRng());
+ return getParentCell(rootElm, startElm).bind(function (fromCell) {
+ return Empty.isEmpty(fromCell) ? emptyElement(editor, fromCell) : deleteBetweenCells(editor, rootElm, forward, fromCell, from);
+ });
+ };
+ var deleteCaretCaption = function (editor, forward, rootElm, fromCaption) {
+ var from = CaretPosition$1.fromRangeStart(editor.selection.getRng());
+ return Empty.isEmpty(fromCaption) ? emptyElement(editor, fromCaption) : deleteCaretInsideCaption(editor, rootElm, forward, fromCaption, from);
+ };
+ var deleteCaret = function (editor, forward, startElm) {
+ var rootElm = Element$$1.fromDom(editor.getBody());
+ return getParentCaption(rootElm, startElm).fold(function () {
+ return deleteCaretCells(editor, forward, rootElm, startElm);
+ }, function (fromCaption) {
+ return deleteCaretCaption(editor, forward, rootElm, fromCaption);
+ }).getOr(false);
+ };
+ var backspaceDelete$4 = function (editor, forward) {
+ var startElm = Element$$1.fromDom(editor.selection.getStart(true));
+ var cells = TableCellSelection.getCellsFromEditor(editor);
+ return editor.selection.isCollapsed() && cells.length === 0 ? deleteCaret(editor, forward, startElm) : deleteRange$1(editor, startElm);
+ };
+ var TableDelete = { backspaceDelete: backspaceDelete$4 };
</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 nativeCommand = function (editor, command) {
- editor.getDoc().execCommand(command, false, null);
- };
- var deleteCommand = function (editor) {
- if ($_cc2jel41jjgwe8bx.backspaceDelete(editor, false)) {
- return;
- } else if ($_fwrmt445jjgwe8d5.backspaceDelete(editor, false)) {
- return;
- } else if ($_6q4s8w3qjjgwe85j.backspaceDelete(editor, false)) {
- return;
- } else if ($_f2hioa4cjjgwe8ee.backspaceDelete(editor)) {
- return;
- } else if ($_8u9liw40jjgwe8bn.backspaceDelete(editor, false)) {
- return;
- } else {
- nativeCommand(editor, 'Delete');
- $_3vi93f3sjjgwe861.paddEmptyBody(editor);
- }
- };
- var forwardDeleteCommand = function (editor) {
- if ($_cc2jel41jjgwe8bx.backspaceDelete(editor, true)) {
- return;
- } else if ($_fwrmt445jjgwe8d5.backspaceDelete(editor, true)) {
- return;
- } else if ($_6q4s8w3qjjgwe85j.backspaceDelete(editor, true)) {
- return;
- } else if ($_f2hioa4cjjgwe8ee.backspaceDelete(editor)) {
- return;
- } else if ($_8u9liw40jjgwe8bn.backspaceDelete(editor, true)) {
- return;
- } else {
- nativeCommand(editor, 'ForwardDelete');
- }
- };
- var $_36hh3g3pjjgwe85i = {
- deleteCommand: deleteCommand,
- forwardDeleteCommand: forwardDeleteCommand
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var nativeCommand = function (editor, command) {
+ editor.getDoc().execCommand(command, false, null);
+ };
+ var deleteCommand = function (editor) {
+ if (CefDelete.backspaceDelete(editor, false)) {
+ return;
+ } else if (InlineBoundaryDelete.backspaceDelete(editor, false)) {
+ return;
+ } else if (BlockBoundaryDelete.backspaceDelete(editor, false)) {
+ return;
+ } else if (TableDelete.backspaceDelete(editor)) {
+ return;
+ } else if (BlockRangeDelete.backspaceDelete(editor, false)) {
+ return;
+ } else {
+ nativeCommand(editor, 'Delete');
+ DeleteUtils.paddEmptyBody(editor);
+ }
+ };
+ var forwardDeleteCommand = function (editor) {
+ if (CefDelete.backspaceDelete(editor, true)) {
+ return;
+ } else if (InlineBoundaryDelete.backspaceDelete(editor, true)) {
+ return;
+ } else if (BlockBoundaryDelete.backspaceDelete(editor, true)) {
+ return;
+ } else if (TableDelete.backspaceDelete(editor)) {
+ return;
+ } else if (BlockRangeDelete.backspaceDelete(editor, true)) {
+ return;
+ } else {
+ nativeCommand(editor, 'ForwardDelete');
+ }
+ };
+ var DeleteCommands = {
+ deleteCommand: deleteCommand,
+ forwardDeleteCommand: forwardDeleteCommand
+ };
</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 getSpecifiedFontProp = function (propName, rootElm, elm) {
- var getProperty = function (elm) {
- return $_e0ei5w13jjgwe7m4.getRaw(elm, propName);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getBodySetting = function (editor, name, defaultValue) {
+ var value = editor.getParam(name, defaultValue);
+ if (value.indexOf('=') !== -1) {
+ var bodyObj = editor.getParam(name, '', 'hash');
+ return bodyObj.hasOwnProperty(editor.id) ? bodyObj[editor.id] : defaultValue;
+ } else {
+ 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">- var isRoot = function (elm) {
- return $_5raon11ejjgwe7o5.eq(Element$$1.fromDom(rootElm), elm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getIframeAttrs = function (editor) {
+ return editor.getParam('iframe_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">- return $_7kjxyh2ajjgwe7un.closest(Element$$1.fromDom(elm), function (elm) {
- return getProperty(elm).isSome();
- }, isRoot).bind(getProperty);
- };
- var round$1 = function (number, precision) {
- var factor = Math.pow(10, precision);
- return Math.round(number * factor) / factor;
- };
- var toPt = function (fontSize, precision) {
- if (/[0-9.]+px$/.test(fontSize)) {
- return round$1(parseInt(fontSize, 10) * 72 / 96, precision || 0) + 'pt';
- }
- return fontSize;
- };
- var normalizeFontFamily = function (fontFamily) {
- return fontFamily.replace(/[\'\"\\]/g, '').replace(/,\s+/g, ',');
- };
- var getComputedFontProp = function (propName, elm) {
- return Option.from(DOMUtils$1.DOM.getStyle(elm, propName, true));
- };
- var getFontProp = function (propName) {
- return function (rootElm, elm) {
- return Option.from(elm).map(Element$$1.fromDom).filter($_fxxo5411jjgwe7lq.isElement).bind(function (element) {
- return getSpecifiedFontProp(propName, rootElm, element.dom()).or(getComputedFontProp(propName, element.dom()));
- }).getOr('');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getDocType = function (editor) {
+ return editor.getParam('doctype', '<!DOCTYPE html>');
</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 $_1jxybs4hjjgwe8fu = {
- getFontSize: getFontProp('font-size'),
- getFontFamily: compose(normalizeFontFamily, getFontProp('font-family')),
- toPt: toPt
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getDocumentBaseUrl = function (editor) {
+ return editor.getParam('document_base_url', '');
+ };
+ var getBodyId = function (editor) {
+ return getBodySetting(editor, 'body_id', 'tinymce');
+ };
+ var getBodyClass = function (editor) {
+ return getBodySetting(editor, 'body_class', '');
+ };
+ var getContentSecurityPolicy = function (editor) {
+ return editor.getParam('content_security_policy', '');
+ };
+ var shouldPutBrInPre = function (editor) {
+ return editor.getParam('br_in_pre', true);
+ };
+ var getForcedRootBlock = function (editor) {
+ if (editor.getParam('force_p_newlines', false)) {
+ return 'p';
+ }
+ var block = editor.getParam('forced_root_block', 'p');
+ return block === false ? '' : block;
+ };
+ var getForcedRootBlockAttrs = function (editor) {
+ return editor.getParam('forced_root_block_attrs', {});
+ };
+ var getBrNewLineSelector = function (editor) {
+ return editor.getParam('br_newline_selector', '.mce-toc h2,figcaption,caption');
+ };
+ var getNoNewLineSelector = function (editor) {
+ return editor.getParam('no_newline_selector', '');
+ };
+ var shouldKeepStyles = function (editor) {
+ return editor.getParam('keep_styles', true);
+ };
+ var shouldEndContainerOnEmptyBlock = function (editor) {
+ return editor.getParam('end_container_on_empty_block', false);
+ };
+ var getFontStyleValues = function (editor) {
+ return Tools.explode(editor.getParam('font_size_style_values', ''));
+ };
+ var getFontSizeClasses = function (editor) {
+ return Tools.explode(editor.getParam('font_size_classes', ''));
+ };
+ var getImagesDataImgFilter = function (editor) {
+ return editor.getParam('images_dataimg_filter', constant(true), 'function');
+ };
+ var isAutomaticUploadsEnabled = function (editor) {
+ return editor.getParam('automatic_uploads', true, 'boolean');
+ };
+ var shouldReuseFileName = function (editor) {
+ return editor.getParam('images_reuse_filename', false, 'boolean');
+ };
+ var shouldReplaceBlobUris = function (editor) {
+ return editor.getParam('images_replace_blob_uris', true, 'boolean');
+ };
+ var getImageUploadUrl = function (editor) {
+ return editor.getParam('images_upload_url', '', 'string');
+ };
+ var getImageUploadBasePath = function (editor) {
+ return editor.getParam('images_upload_base_path', '', 'string');
+ };
+ var getImagesUploadCredentials = function (editor) {
+ return editor.getParam('images_upload_credentials', false, 'boolean');
+ };
+ var getImagesUploadHandler = function (editor) {
+ return editor.getParam('images_upload_handler', null, 'function');
+ };
+ var shouldUseContentCssCors = function (editor) {
+ return editor.getParam('content_css_cors', false, 'boolean');
+ };
+ var Settings = {
+ getIframeAttrs: getIframeAttrs,
+ getDocType: getDocType,
+ getDocumentBaseUrl: getDocumentBaseUrl,
+ getBodyId: getBodyId,
+ getBodyClass: getBodyClass,
+ getContentSecurityPolicy: getContentSecurityPolicy,
+ shouldPutBrInPre: shouldPutBrInPre,
+ getForcedRootBlock: getForcedRootBlock,
+ getForcedRootBlockAttrs: getForcedRootBlockAttrs,
+ getBrNewLineSelector: getBrNewLineSelector,
+ getNoNewLineSelector: getNoNewLineSelector,
+ shouldKeepStyles: shouldKeepStyles,
+ shouldEndContainerOnEmptyBlock: shouldEndContainerOnEmptyBlock,
+ getFontStyleValues: getFontStyleValues,
+ getFontSizeClasses: getFontSizeClasses,
+ getImagesDataImgFilter: getImagesDataImgFilter,
+ isAutomaticUploadsEnabled: isAutomaticUploadsEnabled,
+ shouldReuseFileName: shouldReuseFileName,
+ shouldReplaceBlobUris: shouldReplaceBlobUris,
+ getImageUploadUrl: getImageUploadUrl,
+ getImageUploadBasePath: getImageUploadBasePath,
+ getImagesUploadCredentials: getImagesUploadCredentials,
+ getImagesUploadHandler: getImagesUploadHandler,
+ shouldUseContentCssCors: shouldUseContentCssCors
+ };
</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 findFirstCaretElement = function (editor) {
- return $_8q1ver2yjjgwe7z3.firstPositionIn(editor.getBody()).map(function (caret) {
- var container = caret.container();
- return $_3b9u2y1rjjgwe7qe.isText(container) ? container.parentNode : container;
- });
- };
- var isRangeAtStartOfNode = function (rng, root) {
- return rng.startContainer === root && rng.startOffset === 0;
- };
- var getCaretElement = function (editor) {
- return Option.from(editor.selection.getRng()).bind(function (rng) {
- var root = editor.getBody();
- return isRangeAtStartOfNode(rng, root) ? Option.none() : Option.from(editor.selection.getStart(true));
- });
- };
- var fromFontSizeNumber = function (editor, value) {
- if (/^[0-9\.]+$/.test(value)) {
- var fontSizeNumber = parseInt(value, 10);
- if (fontSizeNumber >= 1 && fontSizeNumber <= 7) {
- var fontSizes = $_259vs538jjgwe82a.getFontStyleValues(editor);
- var fontClasses = $_259vs538jjgwe82a.getFontSizeClasses(editor);
- if (fontClasses) {
- return fontClasses[fontSizeNumber - 1] || value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getSpecifiedFontProp = function (propName, rootElm, elm) {
+ var getProperty = function (elm) {
+ return getRaw(elm, propName);
+ };
+ var isRoot = function (elm) {
+ return eq(Element$$1.fromDom(rootElm), elm);
+ };
+ return closest(Element$$1.fromDom(elm), function (elm) {
+ return getProperty(elm).isSome();
+ }, isRoot).bind(getProperty);
+ };
+ var round$1 = function (number, precision) {
+ var factor = Math.pow(10, precision);
+ return Math.round(number * factor) / factor;
+ };
+ var toPt = function (fontSize, precision) {
+ if (/[0-9.]+px$/.test(fontSize)) {
+ return round$1(parseInt(fontSize, 10) * 72 / 96, precision || 0) + 'pt';
+ }
+ return fontSize;
+ };
+ var normalizeFontFamily = function (fontFamily) {
+ return fontFamily.replace(/[\'\"\\]/g, '').replace(/,\s+/g, ',');
+ };
+ var getComputedFontProp = function (propName, elm) {
+ return Option.from(DOMUtils$1.DOM.getStyle(elm, propName, true));
+ };
+ var getFontProp = function (propName) {
+ return function (rootElm, elm) {
+ return Option.from(elm).map(Element$$1.fromDom).filter(isElement).bind(function (element) {
+ return getSpecifiedFontProp(propName, rootElm, element.dom()).or(getComputedFontProp(propName, element.dom()));
+ }).getOr('');
+ };
+ };
+ var FontInfo = {
+ getFontSize: getFontProp('font-size'),
+ getFontFamily: compose(normalizeFontFamily, getFontProp('font-family')),
+ toPt: toPt
+ };
+
+ var findFirstCaretElement = function (editor) {
+ return CaretFinder.firstPositionIn(editor.getBody()).map(function (caret) {
+ var container = caret.container();
+ return NodeType.isText(container) ? container.parentNode : container;
+ });
+ };
+ var isRangeAtStartOfNode = function (rng, root) {
+ return rng.startContainer === root && rng.startOffset === 0;
+ };
+ var getCaretElement = function (editor) {
+ return Option.from(editor.selection.getRng()).bind(function (rng) {
+ var root = editor.getBody();
+ return isRangeAtStartOfNode(rng, root) ? Option.none() : Option.from(editor.selection.getStart(true));
+ });
+ };
+ var fromFontSizeNumber = function (editor, value) {
+ if (/^[0-9\.]+$/.test(value)) {
+ var fontSizeNumber = parseInt(value, 10);
+ if (fontSizeNumber >= 1 && fontSizeNumber <= 7) {
+ var fontSizes = Settings.getFontStyleValues(editor);
+ var fontClasses = Settings.getFontSizeClasses(editor);
+ if (fontClasses) {
+ return fontClasses[fontSizeNumber - 1] || value;
+ } else {
+ return fontSizes[fontSizeNumber - 1] || value;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return fontSizes[fontSizeNumber - 1] || value;
</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><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> return value;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- return value;
- }
- };
- var fontNameAction = function (editor, value) {
- editor.formatter.toggle('fontname', { value: fromFontSizeNumber(editor, value) });
- editor.nodeChanged();
- };
- var fontNameQuery = function (editor) {
- return getCaretElement(editor).fold(function () {
- return findFirstCaretElement(editor).map(function (caretElement) {
- return $_1jxybs4hjjgwe8fu.getFontFamily(editor.getBody(), caretElement);
- }).getOr('');
- }, function (caretElement) {
- return $_1jxybs4hjjgwe8fu.getFontFamily(editor.getBody(), caretElement);
- });
- };
- var fontSizeAction = function (editor, value) {
- editor.formatter.toggle('fontsize', { value: fromFontSizeNumber(editor, value) });
- editor.nodeChanged();
- };
- var fontSizeQuery = function (editor) {
- return getCaretElement(editor).fold(function () {
- return findFirstCaretElement(editor).map(function (caretElement) {
- return $_1jxybs4hjjgwe8fu.getFontSize(editor.getBody(), caretElement);
- }).getOr('');
- }, function (caretElement) {
- return $_1jxybs4hjjgwe8fu.getFontSize(editor.getBody(), caretElement);
- });
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var fontNameAction = function (editor, value) {
+ editor.formatter.toggle('fontname', { value: fromFontSizeNumber(editor, value) });
+ editor.nodeChanged();
+ };
+ var fontNameQuery = function (editor) {
+ return getCaretElement(editor).fold(function () {
+ return findFirstCaretElement(editor).map(function (caretElement) {
+ return FontInfo.getFontFamily(editor.getBody(), caretElement);
+ }).getOr('');
+ }, function (caretElement) {
+ return FontInfo.getFontFamily(editor.getBody(), caretElement);
+ });
+ };
+ var fontSizeAction = function (editor, value) {
+ editor.formatter.toggle('fontsize', { value: fromFontSizeNumber(editor, value) });
+ editor.nodeChanged();
+ };
+ var fontSizeQuery = function (editor) {
+ return getCaretElement(editor).fold(function () {
+ return findFirstCaretElement(editor).map(function (caretElement) {
+ return FontInfo.getFontSize(editor.getBody(), caretElement);
+ }).getOr('');
+ }, function (caretElement) {
+ return FontInfo.getFontSize(editor.getBody(), caretElement);
+ });
+ };
</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 isEq$2 = function (rng1, rng2) {
- return rng1 && rng2 && (rng1.startContainer === rng2.startContainer && rng1.startOffset === rng2.startOffset) && (rng1.endContainer === rng2.endContainer && rng1.endOffset === rng2.endOffset);
- };
- var $_g1gkxh4kjjgwe8gw = { isEq: isEq$2 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isEq$2 = function (rng1, rng2) {
+ return rng1 && rng2 && (rng1.startContainer === rng2.startContainer && rng1.startOffset === rng2.startOffset) && (rng1.endContainer === rng2.endContainer && rng1.endOffset === rng2.endOffset);
+ };
+ var RangeCompare = { isEq: isEq$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">- var findParent = function (node, rootNode, predicate) {
- while (node && node !== rootNode) {
- if (predicate(node)) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var findParent = function (node, rootNode, predicate) {
+ while (node && node !== rootNode) {
+ if (predicate(node)) {
+ return node;
+ }
+ 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">- node = node.parentNode;
- }
- return null;
- };
- var hasParent = function (node, rootNode, predicate) {
- return findParent(node, rootNode, predicate) !== null;
- };
- var hasParentWithName = function (node, rootNode, name) {
- return hasParent(node, rootNode, function (node) {
- return node.nodeName === name;
- });
- };
- var isTable$2 = function (node) {
- return node && node.nodeName === 'TABLE';
- };
- var isTableCell$3 = function (node) {
- return node && /^(TD|TH|CAPTION)$/.test(node.nodeName);
- };
- var isCeFalseCaretContainer = function (node, rootNode) {
- return isCaretContainer(node) && hasParent(node, rootNode, isCaretNode) === false;
- };
- var hasBrBeforeAfter = function (dom, node, left) {
- var walker = new TreeWalker(node, dom.getParent(node.parentNode, dom.isBlock) || dom.getRoot());
- while (node = walker[left ? 'prev' : 'next']()) {
- if ($_3b9u2y1rjjgwe7qe.isBr(node)) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return null;
+ };
+ var hasParent = function (node, rootNode, predicate) {
+ return findParent(node, rootNode, predicate) !== null;
+ };
+ var hasParentWithName = function (node, rootNode, name) {
+ return hasParent(node, rootNode, function (node) {
+ return node.nodeName === name;
+ });
+ };
+ var isTable$2 = function (node) {
+ return node && node.nodeName === 'TABLE';
+ };
+ var isTableCell$3 = function (node) {
+ return node && /^(TD|TH|CAPTION)$/.test(node.nodeName);
+ };
+ var isCeFalseCaretContainer = function (node, rootNode) {
+ return isCaretContainer(node) && hasParent(node, rootNode, isCaretNode) === false;
+ };
+ var hasBrBeforeAfter = function (dom, node, left) {
+ var walker = new TreeWalker(node, dom.getParent(node.parentNode, dom.isBlock) || dom.getRoot());
+ while (node = walker[left ? 'prev' : 'next']()) {
+ if (NodeType.isBr(node)) {
+ 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">- }
- };
- var isPrevNode = function (node, name) {
- return node.previousSibling && node.previousSibling.nodeName === name;
- };
- var hasContentEditableFalseParent = function (body, node) {
- while (node && node !== body) {
- if ($_3b9u2y1rjjgwe7qe.isContentEditableFalse(node)) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var isPrevNode = function (node, name) {
+ return node.previousSibling && node.previousSibling.nodeName === name;
+ };
+ var hasContentEditableFalseParent = function (body, node) {
+ while (node && node !== body) {
+ if (NodeType.isContentEditableFalse(node)) {
+ return true;
+ }
+ 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">- node = node.parentNode;
- }
- return false;
- };
- var findTextNodeRelative = function (dom, isAfterNode, collapsed, left, startNode) {
- var walker, lastInlineElement, parentBlockContainer;
- var body = dom.getRoot();
- var node;
- var nonEmptyElementsMap = dom.schema.getNonEmptyElements();
- parentBlockContainer = dom.getParent(startNode.parentNode, dom.isBlock) || body;
- if (left && $_3b9u2y1rjjgwe7qe.isBr(startNode) && isAfterNode && dom.isEmpty(parentBlockContainer)) {
- return Option.some(CaretPosition(startNode.parentNode, dom.nodeIndex(startNode)));
- }
- walker = new TreeWalker(startNode, parentBlockContainer);
- while (node = walker[left ? 'prev' : 'next']()) {
- if (dom.getContentEditableParent(node) === 'false' || isCeFalseCaretContainer(node, body)) {
- return Option.none();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return false;
+ };
+ var findTextNodeRelative = function (dom, isAfterNode, collapsed, left, startNode) {
+ var walker, lastInlineElement, parentBlockContainer;
+ var body = dom.getRoot();
+ var node;
+ var nonEmptyElementsMap = dom.schema.getNonEmptyElements();
+ parentBlockContainer = dom.getParent(startNode.parentNode, dom.isBlock) || body;
+ if (left && NodeType.isBr(startNode) && isAfterNode && dom.isEmpty(parentBlockContainer)) {
+ return Option.some(CaretPosition(startNode.parentNode, dom.nodeIndex(startNode)));
</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 ($_3b9u2y1rjjgwe7qe.isText(node) && node.nodeValue.length > 0) {
- if (hasParentWithName(node, body, 'A') === false) {
- return Option.some(CaretPosition(node, left ? node.nodeValue.length : 0));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ walker = new TreeWalker(startNode, parentBlockContainer);
+ while (node = walker[left ? 'prev' : 'next']()) {
+ if (dom.getContentEditableParent(node) === 'false' || isCeFalseCaretContainer(node, body)) {
+ return Option.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">- return Option.none();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (NodeType.isText(node) && node.nodeValue.length > 0) {
+ if (hasParentWithName(node, body, 'A') === false) {
+ return Option.some(CaretPosition(node, left ? node.nodeValue.length : 0));
+ }
+ return Option.none();
+ }
+ if (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
+ return Option.none();
+ }
+ lastInlineElement = 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 (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (collapsed && lastInlineElement) {
+ return Option.some(CaretPosition(lastInlineElement, 0));
+ }
+ return Option.none();
+ };
+ var normalizeEndPoint = function (dom, collapsed, start, rng) {
+ var container, offset, walker;
+ var body = dom.getRoot();
+ var node, nonEmptyElementsMap;
+ var directionLeft, isAfterNode, normalized = false;
+ container = rng[(start ? 'start' : 'end') + 'Container'];
+ offset = rng[(start ? 'start' : 'end') + 'Offset'];
+ isAfterNode = NodeType.isElement(container) && offset === container.childNodes.length;
+ nonEmptyElementsMap = dom.schema.getNonEmptyElements();
+ directionLeft = start;
+ if (isCaretContainer(container)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return Option.none();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- lastInlineElement = node;
- }
- if (collapsed && lastInlineElement) {
- return Option.some(CaretPosition(lastInlineElement, 0));
- }
- return Option.none();
- };
- var normalizeEndPoint = function (dom, collapsed, start, rng) {
- var container, offset, walker;
- var body = dom.getRoot();
- var node, nonEmptyElementsMap;
- var directionLeft, isAfterNode, normalized = false;
- container = rng[(start ? 'start' : 'end') + 'Container'];
- offset = rng[(start ? 'start' : 'end') + 'Offset'];
- isAfterNode = $_3b9u2y1rjjgwe7qe.isElement(container) && offset === container.childNodes.length;
- nonEmptyElementsMap = dom.schema.getNonEmptyElements();
- directionLeft = start;
- if (isCaretContainer(container)) {
- return Option.none();
- }
- if ($_3b9u2y1rjjgwe7qe.isElement(container) && offset > container.childNodes.length - 1) {
- directionLeft = false;
- }
- if ($_3b9u2y1rjjgwe7qe.isDocument(container)) {
- container = body;
- offset = 0;
- }
- if (container === body) {
- if (directionLeft) {
- node = container.childNodes[offset > 0 ? offset - 1 : 0];
- if (node) {
- if (isCaretContainer(node)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (NodeType.isElement(container) && offset > container.childNodes.length - 1) {
+ directionLeft = false;
+ }
+ if (NodeType.isDocument(container)) {
+ container = body;
+ offset = 0;
+ }
+ if (container === body) {
+ if (directionLeft) {
+ node = container.childNodes[offset > 0 ? offset - 1 : 0];
+ if (node) {
+ if (isCaretContainer(node)) {
+ return Option.none();
+ }
+ if (nonEmptyElementsMap[node.nodeName] || isTable$2(node)) {
+ return Option.none();
+ }
+ }
+ }
+ if (container.hasChildNodes()) {
+ offset = Math.min(!directionLeft && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1);
+ container = container.childNodes[offset];
+ offset = NodeType.isText(container) && isAfterNode ? container.data.length : 0;
+ if (!collapsed && container === body.lastChild && isTable$2(container)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return Option.none();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (nonEmptyElementsMap[node.nodeName] || isTable$2(node)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (hasContentEditableFalseParent(body, container) || isCaretContainer(container)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return Option.none();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (container.hasChildNodes() && isTable$2(container) === false) {
+ node = container;
+ walker = new TreeWalker(container, body);
+ do {
+ if (NodeType.isContentEditableFalse(node) || isCaretContainer(node)) {
+ normalized = false;
+ break;
+ }
+ if (NodeType.isText(node) && node.nodeValue.length > 0) {
+ offset = directionLeft ? 0 : node.nodeValue.length;
+ container = node;
+ normalized = true;
+ break;
+ }
+ if (nonEmptyElementsMap[node.nodeName.toLowerCase()] && !isTableCell$3(node)) {
+ offset = dom.nodeIndex(node);
+ container = node.parentNode;
+ if (!directionLeft) {
+ offset++;
+ }
+ normalized = true;
+ break;
+ }
+ } while (node = directionLeft ? walker.next() : walker.prev());
+ }
</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">- if (container.hasChildNodes()) {
- offset = Math.min(!directionLeft && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1);
- container = container.childNodes[offset];
- offset = $_3b9u2y1rjjgwe7qe.isText(container) && isAfterNode ? container.data.length : 0;
- if (!collapsed && container === body.lastChild && isTable$2(container)) {
- return Option.none();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (collapsed) {
+ if (NodeType.isText(container) && offset === 0) {
+ findTextNodeRelative(dom, isAfterNode, collapsed, true, container).each(function (pos) {
+ container = pos.container();
+ offset = pos.offset();
+ normalized = 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 (hasContentEditableFalseParent(body, container) || isCaretContainer(container)) {
- return Option.none();
- }
- if (container.hasChildNodes() && isTable$2(container) === false) {
- node = container;
- walker = new TreeWalker(container, body);
- do {
- if ($_3b9u2y1rjjgwe7qe.isContentEditableFalse(node) || isCaretContainer(node)) {
- normalized = false;
- break;
- }
- if ($_3b9u2y1rjjgwe7qe.isText(node) && node.nodeValue.length > 0) {
- offset = directionLeft ? 0 : node.nodeValue.length;
- container = node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (NodeType.isElement(container)) {
+ node = container.childNodes[offset];
+ if (!node) {
+ node = container.childNodes[offset - 1];
+ }
+ if (node && NodeType.isBr(node) && !isPrevNode(node, 'A') && !hasBrBeforeAfter(dom, node, false) && !hasBrBeforeAfter(dom, node, true)) {
+ findTextNodeRelative(dom, isAfterNode, collapsed, true, node).each(function (pos) {
+ container = pos.container();
+ offset = pos.offset();
</ins><span class="cx" style="display: block; padding: 0 10px"> normalized = true;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- break;
- }
- if (nonEmptyElementsMap[node.nodeName.toLowerCase()] && !isTableCell$3(node)) {
- offset = dom.nodeIndex(node);
- container = node.parentNode;
- if (!directionLeft) {
- offset++;
- }
- normalized = true;
- break;
- }
- } while (node = directionLeft ? walker.next() : walker.prev());
</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><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (collapsed) {
- if ($_3b9u2y1rjjgwe7qe.isText(container) && offset === 0) {
- findTextNodeRelative(dom, isAfterNode, collapsed, true, container).each(function (pos) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (directionLeft && !collapsed && NodeType.isText(container) && offset === container.nodeValue.length) {
+ findTextNodeRelative(dom, isAfterNode, collapsed, false, container).each(function (pos) {
</ins><span class="cx" style="display: block; padding: 0 10px"> container = pos.container();
</span><span class="cx" style="display: block; padding: 0 10px"> offset = pos.offset();
</span><span class="cx" style="display: block; padding: 0 10px"> normalized = true;
</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">- if ($_3b9u2y1rjjgwe7qe.isElement(container)) {
- node = container.childNodes[offset];
- if (!node) {
- node = container.childNodes[offset - 1];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return normalized ? Option.some(CaretPosition(container, offset)) : Option.none();
+ };
+ var normalize$2 = function (dom, rng) {
+ var collapsed = rng.collapsed, normRng = rng.cloneRange();
+ var startPos = CaretPosition.fromRangeStart(rng);
+ normalizeEndPoint(dom, collapsed, true, normRng).each(function (pos) {
+ if (!collapsed || !CaretPosition.isAbove(startPos, pos)) {
+ normRng.setStart(pos.container(), pos.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 (node && $_3b9u2y1rjjgwe7qe.isBr(node) && !isPrevNode(node, 'A') && !hasBrBeforeAfter(dom, node, false) && !hasBrBeforeAfter(dom, node, true)) {
- findTextNodeRelative(dom, isAfterNode, collapsed, true, node).each(function (pos) {
- container = pos.container();
- offset = pos.offset();
- normalized = true;
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ if (!collapsed) {
+ normalizeEndPoint(dom, collapsed, false, normRng).each(function (pos) {
+ normRng.setEnd(pos.container(), pos.offset());
+ });
+ }
+ if (collapsed) {
+ normRng.collapse(true);
+ }
+ return RangeCompare.isEq(rng, normRng) ? Option.none() : Option.some(normRng);
+ };
+ var NormalizeRange = { normalize: normalize$2 };
+
+ var hasRightSideContent = function (schema, container, parentBlock) {
+ var walker = new TreeWalker(container, parentBlock);
+ var node;
+ var nonEmptyElementsMap = schema.getNonEmptyElements();
+ while (node = walker.next()) {
+ if (nonEmptyElementsMap[node.nodeName.toLowerCase()] || node.length > 0) {
+ return true;
</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">- }
- if (directionLeft && !collapsed && $_3b9u2y1rjjgwe7qe.isText(container) && offset === container.nodeValue.length) {
- findTextNodeRelative(dom, isAfterNode, collapsed, false, container).each(function (pos) {
- container = pos.container();
- offset = pos.offset();
- normalized = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var scrollToBr = function (dom, selection, brElm) {
+ var marker = dom.create('span', {}, ' ');
+ brElm.parentNode.insertBefore(marker, brElm);
+ selection.scrollIntoView(marker);
+ dom.remove(marker);
+ };
+ var moveSelectionToBr = function (dom, selection, brElm, extraBr) {
+ var rng = dom.createRng();
+ if (!extraBr) {
+ rng.setStartAfter(brElm);
+ rng.setEndAfter(brElm);
+ } else {
+ rng.setStartBefore(brElm);
+ rng.setEndBefore(brElm);
+ }
+ selection.setRng(rng);
+ };
+ var insertBrAtCaret = function (editor, evt) {
+ var selection = editor.selection, dom = editor.dom;
+ var brElm, extraBr;
+ var rng = selection.getRng();
+ NormalizeRange.normalize(dom, rng).each(function (normRng) {
+ rng.setStart(normRng.startContainer, normRng.startOffset);
+ rng.setEnd(normRng.endContainer, normRng.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 normalized ? Option.some(CaretPosition(container, offset)) : Option.none();
- };
- var normalize$1 = function (dom, rng) {
- var collapsed = rng.collapsed, normRng = rng.cloneRange();
- var startPos = CaretPosition.fromRangeStart(rng);
- normalizeEndPoint(dom, collapsed, true, normRng).each(function (pos) {
- if (!collapsed || !CaretPosition.isAbove(startPos, pos)) {
- normRng.setStart(pos.container(), pos.offset());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var offset = rng.startOffset;
+ var container = rng.startContainer;
+ if (container.nodeType === 1 && container.hasChildNodes()) {
+ var isAfterLastNodeInContainer = offset > container.childNodes.length - 1;
+ container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
+ if (isAfterLastNodeInContainer && container.nodeType === 3) {
+ offset = container.nodeValue.length;
+ } else {
+ offset = 0;
+ }
</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 (!collapsed) {
- normalizeEndPoint(dom, collapsed, false, normRng).each(function (pos) {
- normRng.setEnd(pos.container(), pos.offset());
- });
- }
- if (collapsed) {
- normRng.collapse(true);
- }
- return $_g1gkxh4kjjgwe8gw.isEq(rng, normRng) ? Option.none() : Option.some(normRng);
- };
- var $_eqgqyj4jjjgwe8gi = { normalize: normalize$1 };
-
- var hasRightSideContent = function (schema, container, parentBlock) {
- var walker = new TreeWalker(container, parentBlock);
- var node;
- var nonEmptyElementsMap = schema.getNonEmptyElements();
- while (node = walker.next()) {
- if (nonEmptyElementsMap[node.nodeName.toLowerCase()] || node.length > 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var parentBlock = dom.getParent(container, dom.isBlock);
+ var containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null;
+ var containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : '';
+ var isControlKey = evt && evt.ctrlKey;
+ if (containerBlockName === 'LI' && !isControlKey) {
+ parentBlock = containerBlock;
+ }
+ if (container && container.nodeType === 3 && offset >= container.nodeValue.length) {
+ if (!hasRightSideContent(editor.schema, container, parentBlock)) {
+ brElm = dom.create('br');
+ rng.insertNode(brElm);
+ rng.setStartAfter(brElm);
+ rng.setEndAfter(brElm);
+ extraBr = true;
+ }
+ }
+ brElm = dom.create('br');
+ rng.insertNode(brElm);
+ scrollToBr(dom, selection, brElm);
+ moveSelectionToBr(dom, selection, brElm, extraBr);
+ editor.undoManager.add();
+ };
+ var insertBrBefore = function (editor, inline) {
+ var br = Element$$1.fromTag('br');
+ before(Element$$1.fromDom(inline), br);
+ editor.undoManager.add();
+ };
+ var insertBrAfter = function (editor, inline) {
+ if (!hasBrAfter(editor.getBody(), inline)) {
+ after(Element$$1.fromDom(inline), Element$$1.fromTag('br'));
+ }
+ var br = Element$$1.fromTag('br');
+ after(Element$$1.fromDom(inline), br);
+ scrollToBr(editor.dom, editor.selection, br.dom());
+ moveSelectionToBr(editor.dom, editor.selection, br.dom(), false);
+ editor.undoManager.add();
+ };
+ var isBeforeBr$1 = function (pos) {
+ return NodeType.isBr(pos.getNode());
+ };
+ var hasBrAfter = function (rootNode, startNode) {
+ if (isBeforeBr$1(CaretPosition$1.after(startNode))) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ return CaretFinder.nextPosition(rootNode, CaretPosition$1.after(startNode)).map(function (pos) {
+ return NodeType.isBr(pos.getNode());
+ }).getOr(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 scrollToBr = function (dom, selection, brElm) {
- var marker = dom.create('span', {}, ' ');
- brElm.parentNode.insertBefore(marker, brElm);
- selection.scrollIntoView(marker);
- dom.remove(marker);
- };
- var moveSelectionToBr = function (dom, selection, brElm, extraBr) {
- var rng = dom.createRng();
- if (!extraBr) {
- rng.setStartAfter(brElm);
- rng.setEndAfter(brElm);
- } else {
- rng.setStartBefore(brElm);
- rng.setEndBefore(brElm);
- }
- selection.setRng(rng);
- };
- var insertBrAtCaret = function (editor, evt) {
- var selection = editor.selection, dom = editor.dom;
- var brElm, extraBr;
- var rng = selection.getRng();
- $_eqgqyj4jjjgwe8gi.normalize(dom, rng).each(function (normRng) {
- rng.setStart(normRng.startContainer, normRng.startOffset);
- rng.setEnd(normRng.endContainer, normRng.endOffset);
- });
- var offset = rng.startOffset;
- var container = rng.startContainer;
- if (container.nodeType === 1 && container.hasChildNodes()) {
- var isAfterLastNodeInContainer = offset > container.childNodes.length - 1;
- container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
- if (isAfterLastNodeInContainer && container.nodeType === 3) {
- offset = container.nodeValue.length;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var isAnchorLink = function (elm) {
+ return elm && elm.nodeName === 'A' && 'href' in elm;
+ };
+ var isInsideAnchor = function (location) {
+ return location.fold(constant(false), isAnchorLink, isAnchorLink, constant(false));
+ };
+ var readInlineAnchorLocation = function (editor) {
+ var isInlineTarget = curry(InlineUtils.isInlineTarget, editor);
+ var position = CaretPosition$1.fromRangeStart(editor.selection.getRng());
+ return BoundaryLocation.readLocation(isInlineTarget, editor.getBody(), position).filter(isInsideAnchor);
+ };
+ var insertBrOutsideAnchor = function (editor, location) {
+ location.fold(noop, curry(insertBrBefore, editor), curry(insertBrAfter, editor), noop);
+ };
+ var insert = function (editor, evt) {
+ var anchorLocation = readInlineAnchorLocation(editor);
+ if (anchorLocation.isSome()) {
+ anchorLocation.each(curry(insertBrOutsideAnchor, editor));
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- offset = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ insertBrAtCaret(editor, evt);
</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 parentBlock = dom.getParent(container, dom.isBlock);
- var containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null;
- var containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : '';
- var isControlKey = evt && evt.ctrlKey;
- if (containerBlockName === 'LI' && !isControlKey) {
- parentBlock = containerBlock;
- }
- if (container && container.nodeType === 3 && offset >= container.nodeValue.length) {
- if (!hasRightSideContent(editor.schema, container, parentBlock)) {
- brElm = dom.create('br');
- rng.insertNode(brElm);
- rng.setStartAfter(brElm);
- rng.setEndAfter(brElm);
- extraBr = true;
- }
- }
- brElm = dom.create('br');
- rng.insertNode(brElm);
- scrollToBr(dom, selection, brElm);
- moveSelectionToBr(dom, selection, brElm, extraBr);
- editor.undoManager.add();
- };
- var insertBrBefore = function (editor, inline) {
- var br = Element$$1.fromTag('br');
- $_ewo3u51yjjgwe7su.before(Element$$1.fromDom(inline), br);
- editor.undoManager.add();
- };
- var insertBrAfter = function (editor, inline) {
- if (!hasBrAfter(editor.getBody(), inline)) {
- $_ewo3u51yjjgwe7su.after(Element$$1.fromDom(inline), Element$$1.fromTag('br'));
- }
- var br = Element$$1.fromTag('br');
- $_ewo3u51yjjgwe7su.after(Element$$1.fromDom(inline), br);
- scrollToBr(editor.dom, editor.selection, br.dom());
- moveSelectionToBr(editor.dom, editor.selection, br.dom(), false);
- editor.undoManager.add();
- };
- var isBeforeBr = function (pos) {
- return $_3b9u2y1rjjgwe7qe.isBr(pos.getNode());
- };
- var hasBrAfter = function (rootNode, startNode) {
- if (isBeforeBr(CaretPosition$1.after(startNode))) {
- return true;
- } else {
- return $_8q1ver2yjjgwe7z3.nextPosition(rootNode, CaretPosition$1.after(startNode)).map(function (pos) {
- return $_3b9u2y1rjjgwe7qe.isBr(pos.getNode());
- }).getOr(false);
- }
- };
- var isAnchorLink = function (elm) {
- return elm && elm.nodeName === 'A' && 'href' in elm;
- };
- var isInsideAnchor = function (location) {
- return location.fold(constant(false), isAnchorLink, isAnchorLink, constant(false));
- };
- var readInlineAnchorLocation = function (editor) {
- var isInlineTarget = curry($_av9utf3tjjgwe86b.isInlineTarget, editor);
- var position = CaretPosition$1.fromRangeStart(editor.selection.getRng());
- return $_g20q2x48jjgwe8dp.readLocation(isInlineTarget, editor.getBody(), position).filter(isInsideAnchor);
- };
- var insertBrOutsideAnchor = function (editor, location) {
- location.fold(noop, curry(insertBrBefore, editor), curry(insertBrAfter, editor), noop);
- };
- var insert = function (editor, evt) {
- var anchorLocation = readInlineAnchorLocation(editor);
- if (anchorLocation.isSome()) {
- anchorLocation.each(curry(insertBrOutsideAnchor, editor));
- } else {
- insertBrAtCaret(editor, evt);
- }
- };
- var $_4o98q44ijjgwe8g6 = { insert: insert };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var InsertBr = { insert: insert };
</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 adt = Adt.generate([
- { 'before': ['element'] },
- {
- 'on': [
- 'element',
- 'offset'
- ]
- },
- { after: ['element'] }
- ]);
- var cata = function (subject, onBefore, onOn, onAfter) {
- return subject.fold(onBefore, onOn, onAfter);
- };
- var getStart = function (situ) {
- return situ.fold(identity, identity, identity);
- };
- var $_budkgr4njjgwe8hk = {
- before: adt.before,
- on: adt.on,
- after: adt.after,
- cata: cata,
- getStart: getStart
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var adt = Adt.generate([
+ { 'before': ['element'] },
+ {
+ 'on': [
+ 'element',
+ 'offset'
+ ]
+ },
+ { after: ['element'] }
+ ]);
</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 type$1 = Adt.generate([
- { domRange: ['rng'] },
- {
- relative: [
- 'startSitu',
- 'finishSitu'
- ]
- },
- {
- exact: [
- 'start',
- 'soffset',
- 'finish',
- 'foffset'
- ]
- }
- ]);
- var range$1 = Immutable('start', 'soffset', 'finish', 'foffset');
- var exactFromRange = function (simRange) {
- return type$1.exact(simRange.start(), simRange.soffset(), simRange.finish(), simRange.foffset());
- };
- var getStart$1 = function (selection) {
- return selection.match({
- domRange: function (rng) {
- return Element$$1.fromDom(rng.startContainer);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var type$1 = Adt.generate([
+ { domRange: ['rng'] },
+ {
+ relative: [
+ 'startSitu',
+ 'finishSitu'
+ ]
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- relative: function (startSitu, finishSitu) {
- return $_budkgr4njjgwe8hk.getStart(startSitu);
- },
- exact: function (start, soffset, finish, foffset) {
- return start;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ {
+ exact: [
+ 'start',
+ 'soffset',
+ 'finish',
+ 'foffset'
+ ]
</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 getWin = function (selection) {
- var start = getStart$1(selection);
- return $_d3rmjp18jjgwe7nc.defaultView(start);
- };
- var $_2mbfo14mjjgwe8he = {
- domRange: type$1.domRange,
- relative: type$1.relative,
- exact: type$1.exact,
- exactFromRange: exactFromRange,
- range: range$1,
- getWin: getWin
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ]);
+ var range$1 = Immutable('start', 'soffset', 'finish', 'foffset');
+ var domRange = type$1.domRange;
+ var relative = type$1.relative;
+ var exact = type$1.exact;
</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 browser$3 = $_7vg267ojjgwe7k0.detect().browser;
- var clamp = function (offset, element) {
- var max = $_fxxo5411jjgwe7lq.isText(element) ? $_8mxs233ejjgwe82u.get(element).length : $_d3rmjp18jjgwe7nc.children(element).length + 1;
- if (offset > max) {
- return max;
- } else if (offset < 0) {
- return 0;
- }
- return offset;
- };
- var normalizeRng = function (rng) {
- return $_2mbfo14mjjgwe8he.range(rng.start(), clamp(rng.soffset(), rng.start()), rng.finish(), clamp(rng.foffset(), rng.finish()));
- };
- var isOrContains = function (root, elm) {
- return $_5raon11ejjgwe7o5.contains(root, elm) || $_5raon11ejjgwe7o5.eq(root, elm);
- };
- var isRngInRoot = function (root) {
- return function (rng) {
- return isOrContains(root, rng.start()) && isOrContains(root, rng.finish());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var browser$3 = PlatformDetection$1.detect().browser;
+ var clamp = function (offset, element) {
+ var max = isText(element) ? get$6(element).length : children(element).length + 1;
+ if (offset > max) {
+ return max;
+ } else if (offset < 0) {
+ return 0;
+ }
+ return 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 shouldStore = function (editor) {
- return editor.inline === true || browser$3.isIE();
- };
- var nativeRangeToSelectionRange = function (r) {
- return $_2mbfo14mjjgwe8he.range(Element$$1.fromDom(r.startContainer), r.startOffset, Element$$1.fromDom(r.endContainer), r.endOffset);
- };
- var readRange = function (win) {
- var selection = win.getSelection();
- var rng = !selection || selection.rangeCount === 0 ? Option.none() : Option.from(selection.getRangeAt(0));
- return rng.map(nativeRangeToSelectionRange);
- };
- var getBookmark$2 = function (root) {
- var win = $_d3rmjp18jjgwe7nc.defaultView(root);
- return readRange(win.dom()).filter(isRngInRoot(root));
- };
- var validate = function (root, bookmark) {
- return Option.from(bookmark).filter(isRngInRoot(root)).map(normalizeRng);
- };
- var bookmarkToNativeRng = function (bookmark) {
- var rng = document.createRange();
- try {
- rng.setStart(bookmark.start().dom(), bookmark.soffset());
- rng.setEnd(bookmark.finish().dom(), bookmark.foffset());
- return Option.some(rng);
- } catch (_) {
- return Option.none();
- }
- };
- var store = function (editor) {
- var newBookmark = shouldStore(editor) ? getBookmark$2(Element$$1.fromDom(editor.getBody())) : Option.none();
- editor.bookmark = newBookmark.isSome() ? newBookmark : editor.bookmark;
- };
- var storeNative = function (editor, rng) {
- var root = Element$$1.fromDom(editor.getBody());
- var range = shouldStore(editor) ? Option.from(rng) : Option.none();
- var newBookmark = range.map(nativeRangeToSelectionRange).filter(isRngInRoot(root));
- editor.bookmark = newBookmark.isSome() ? newBookmark : editor.bookmark;
- };
- var getRng = function (editor) {
- var bookmark = editor.bookmark ? editor.bookmark : Option.none();
- return bookmark.bind(curry(validate, Element$$1.fromDom(editor.getBody()))).bind(bookmarkToNativeRng);
- };
- var restore = function (editor) {
- getRng(editor).each(function (rng) {
- editor.selection.setRng(rng);
- });
- };
- var $_4wtqbt4ljjgwe8gy = {
- store: store,
- storeNative: storeNative,
- readRange: readRange,
- restore: restore,
- getRng: getRng,
- getBookmark: getBookmark$2,
- validate: validate
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var normalizeRng = function (rng) {
+ return range$1(rng.start(), clamp(rng.soffset(), rng.start()), rng.finish(), clamp(rng.foffset(), rng.finish()));
+ };
+ var isOrContains = function (root, elm) {
+ return contains$3(root, elm) || eq(root, elm);
+ };
+ var isRngInRoot = function (root) {
+ return function (rng) {
+ return isOrContains(root, rng.start()) && isOrContains(root, rng.finish());
+ };
+ };
+ var shouldStore = function (editor) {
+ return editor.inline === true || browser$3.isIE();
+ };
+ var nativeRangeToSelectionRange = function (r) {
+ return range$1(Element$$1.fromDom(r.startContainer), r.startOffset, Element$$1.fromDom(r.endContainer), r.endOffset);
+ };
+ var readRange = function (win) {
+ var selection = win.getSelection();
+ var rng = !selection || selection.rangeCount === 0 ? Option.none() : Option.from(selection.getRangeAt(0));
+ return rng.map(nativeRangeToSelectionRange);
+ };
+ var getBookmark$2 = function (root) {
+ var win = defaultView(root);
+ return readRange(win.dom()).filter(isRngInRoot(root));
+ };
+ var validate = function (root, bookmark) {
+ return Option.from(bookmark).filter(isRngInRoot(root)).map(normalizeRng);
+ };
+ var bookmarkToNativeRng = function (bookmark) {
+ var rng = document.createRange();
+ try {
+ rng.setStart(bookmark.start().dom(), bookmark.soffset());
+ rng.setEnd(bookmark.finish().dom(), bookmark.foffset());
+ return Option.some(rng);
+ } catch (_) {
+ return Option.none();
+ }
+ };
+ var store = function (editor) {
+ var newBookmark = shouldStore(editor) ? getBookmark$2(Element$$1.fromDom(editor.getBody())) : Option.none();
+ editor.bookmark = newBookmark.isSome() ? newBookmark : editor.bookmark;
+ };
+ var storeNative = function (editor, rng) {
+ var root = Element$$1.fromDom(editor.getBody());
+ var range = shouldStore(editor) ? Option.from(rng) : Option.none();
+ var newBookmark = range.map(nativeRangeToSelectionRange).filter(isRngInRoot(root));
+ editor.bookmark = newBookmark.isSome() ? newBookmark : editor.bookmark;
+ };
+ var getRng = function (editor) {
+ var bookmark = editor.bookmark ? editor.bookmark : Option.none();
+ return bookmark.bind(curry(validate, Element$$1.fromDom(editor.getBody()))).bind(bookmarkToNativeRng);
+ };
+ var restore = function (editor) {
+ getRng(editor).each(function (rng) {
+ editor.selection.setRng(rng);
+ });
+ };
+ var SelectionBookmark = {
+ store: store,
+ storeNative: storeNative,
+ readRange: readRange,
+ restore: restore,
+ getRng: getRng,
+ getBookmark: getBookmark$2,
+ validate: validate
+ };
</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 indentElement = function (dom, command, useMargin, value, unit, element) {
- if (dom.getContentEditable(element) === 'false') {
- return;
- }
- if (element.nodeName !== 'LI') {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var indentElement = function (dom, command, useMargin, value, unit, element) {
+ if (dom.getContentEditable(element) === 'false') {
+ return;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> var indentStyleName = useMargin ? 'margin' : 'padding';
</span><span class="cx" style="display: block; padding: 0 10px"> indentStyleName = element.nodeName === 'TABLE' ? 'margin' : indentStyleName;
</span><span class="cx" style="display: block; padding: 0 10px"> indentStyleName += dom.getStyle(element, 'direction', true) === 'rtl' ? 'Right' : 'Left';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13935,1687 +13034,1664 @@
</span><span class="cx" style="display: block; padding: 0 10px"> var styleValue = parseInt(element.style[indentStyleName] || 0, 10) + value + unit;
</span><span class="cx" style="display: block; padding: 0 10px"> dom.setStyle(element, indentStyleName, styleValue);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- };
- var handle = function (editor, command) {
- var settings = editor.settings, dom = editor.dom, selection = editor.selection, formatter = editor.formatter;
- var indentUnit = /[a-z%]+$/i.exec(settings.indentation)[0];
- var indentValue = parseInt(settings.indentation, 10);
- var useMargin = editor.getParam('indent_use_margin', false);
- if (!editor.queryCommandState('InsertUnorderedList') && !editor.queryCommandState('InsertOrderedList')) {
- if (!settings.forced_root_block && !dom.getParent(selection.getNode(), dom.isBlock)) {
- formatter.apply('div');
- }
- each(selection.getSelectedBlocks(), function (element) {
- return indentElement(dom, command, useMargin, indentValue, indentUnit, element);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var isListComponent = function (el) {
+ return isList(el) || isListItem(el);
+ };
+ var parentIsListComponent = function (el) {
+ return parent(el).map(isListComponent).getOr(false);
+ };
+ var getBlocksToIndent = function (editor) {
+ return filter(map(editor.selection.getSelectedBlocks(), Element$$1.fromDom), function (el) {
+ return !isListComponent(el) && !parentIsListComponent(el);
</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 each$10 = $_6cwiepljjgwe7j4.each;
- var extend$2 = $_6cwiepljjgwe7j4.extend;
- var map$3 = $_6cwiepljjgwe7j4.map;
- var inArray$2 = $_6cwiepljjgwe7j4.inArray;
- function EditorCommands (editor) {
- var dom, selection, formatter;
- var commands = {
- state: {},
- exec: {},
- value: {}
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var settings = editor.settings, bookmark;
- editor.on('PreInit', function () {
- dom = editor.dom;
- selection = editor.selection;
- settings = editor.settings;
- formatter = editor.formatter;
- });
- var execCommand = function (command, ui, value, args) {
- var func, customCommand, state = false;
- if (editor.removed) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var handle = function (editor, command) {
+ var settings = editor.settings, dom = editor.dom, selection = editor.selection, formatter = editor.formatter;
+ var indentUnit = /[a-z%]+$/i.exec(settings.indentation)[0];
+ var indentValue = parseInt(settings.indentation, 10);
+ var useMargin = editor.getParam('indent_use_margin', false);
+ if (!editor.queryCommandState('InsertUnorderedList') && !editor.queryCommandState('InsertOrderedList')) {
+ if (!settings.forced_root_block && !dom.getParent(selection.getNode(), dom.isBlock)) {
+ formatter.apply('div');
+ }
</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 (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(command) && (!args || !args.skip_focus)) {
- editor.focus();
- } else {
- $_4wtqbt4ljjgwe8gy.restore(editor);
- }
- args = editor.fire('BeforeExecCommand', {
- command: command,
- ui: ui,
- value: value
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ each(getBlocksToIndent(editor), function (block) {
+ indentElement(dom, command, useMargin, indentValue, indentUnit, block.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 (args.isDefaultPrevented()) {
- return false;
- }
- customCommand = command.toLowerCase();
- if (func = commands.exec[customCommand]) {
- func(customCommand, ui, value);
- editor.fire('ExecCommand', {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+
+ var each$a = Tools.each, extend$2 = Tools.extend;
+ var map$3 = Tools.map, inArray$2 = Tools.inArray;
+ function EditorCommands (editor) {
+ var dom, selection, formatter;
+ var commands = {
+ state: {},
+ exec: {},
+ value: {}
+ };
+ var settings = editor.settings, bookmark;
+ editor.on('PreInit', function () {
+ dom = editor.dom;
+ selection = editor.selection;
+ settings = editor.settings;
+ formatter = editor.formatter;
+ });
+ var execCommand = function (command, ui, value, args) {
+ var func, customCommand, state = false;
+ if (editor.removed) {
+ return;
+ }
+ if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(command) && (!args || !args.skip_focus)) {
+ editor.focus();
+ } else {
+ SelectionBookmark.restore(editor);
+ }
+ args = editor.fire('BeforeExecCommand', {
</ins><span class="cx" style="display: block; padding: 0 10px"> command: command,
</span><span class="cx" style="display: block; padding: 0 10px"> ui: ui,
</span><span class="cx" style="display: block; padding: 0 10px"> value: value
</span><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;
- }
- each$10(editor.plugins, function (p) {
- if (p.execCommand && p.execCommand(command, ui, value)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (args.isDefaultPrevented()) {
+ return false;
+ }
+ customCommand = command.toLowerCase();
+ if (func = commands.exec[customCommand]) {
+ func(customCommand, ui, value);
</ins><span class="cx" style="display: block; padding: 0 10px"> editor.fire('ExecCommand', {
</span><span class="cx" style="display: block; padding: 0 10px"> command: command,
</span><span class="cx" style="display: block; padding: 0 10px"> ui: ui,
</span><span class="cx" style="display: block; padding: 0 10px"> value: value
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- state = true;
- return false;
</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 (state) {
- return state;
- }
- if (editor.theme && editor.theme.execCommand && editor.theme.execCommand(command, ui, value)) {
- editor.fire('ExecCommand', {
- command: command,
- ui: ui,
- value: value
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ each$a(editor.plugins, function (p) {
+ if (p.execCommand && p.execCommand(command, ui, value)) {
+ editor.fire('ExecCommand', {
+ command: command,
+ ui: ui,
+ value: value
+ });
+ state = true;
+ 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 true;
- }
- try {
- state = editor.getDoc().execCommand(command, ui, value);
- } catch (ex) {
- }
- if (state) {
- editor.fire('ExecCommand', {
- command: command,
- ui: ui,
- value: value
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (state) {
+ return state;
+ }
+ if (editor.theme && editor.theme.execCommand && editor.theme.execCommand(command, ui, value)) {
+ editor.fire('ExecCommand', {
+ command: command,
+ ui: ui,
+ value: value
+ });
+ return true;
+ }
+ try {
+ state = editor.getDoc().execCommand(command, ui, value);
+ } catch (ex) {
+ }
+ if (state) {
+ editor.fire('ExecCommand', {
+ command: command,
+ ui: ui,
+ value: value
+ });
+ return true;
+ }
+ return false;
+ };
+ var queryCommandState = function (command) {
+ var func;
+ if (editor.quirks.isHidden() || editor.removed) {
+ return;
+ }
+ command = command.toLowerCase();
+ if (func = commands.state[command]) {
+ return func(command);
+ }
+ try {
+ return editor.getDoc().queryCommandState(command);
+ } catch (ex) {
+ }
+ return false;
+ };
+ var queryCommandValue = function (command) {
+ var func;
+ if (editor.quirks.isHidden() || editor.removed) {
+ return;
+ }
+ command = command.toLowerCase();
+ if (func = commands.value[command]) {
+ return func(command);
+ }
+ try {
+ return editor.getDoc().queryCommandValue(command);
+ } catch (ex) {
+ }
+ };
+ var addCommands = function (commandList, type) {
+ type = type || 'exec';
+ each$a(commandList, function (callback, command) {
+ each$a(command.toLowerCase().split(','), function (command) {
+ commands[type][command] = 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">- return true;
- }
- return false;
- };
- var queryCommandState = function (command) {
- var func;
- if (editor.quirks.isHidden() || editor.removed) {
- return;
- }
- command = command.toLowerCase();
- if (func = commands.state[command]) {
- return func(command);
- }
- try {
- return editor.getDoc().queryCommandState(command);
- } catch (ex) {
- }
- return false;
- };
- var queryCommandValue = function (command) {
- var func;
- if (editor.quirks.isHidden() || editor.removed) {
- return;
- }
- command = command.toLowerCase();
- if (func = commands.value[command]) {
- return func(command);
- }
- try {
- return editor.getDoc().queryCommandValue(command);
- } catch (ex) {
- }
- };
- var addCommands = function (commandList, type) {
- type = type || 'exec';
- each$10(commandList, function (callback, command) {
- each$10(command.toLowerCase().split(','), function (command) {
- commands[type][command] = callback;
- });
- });
- };
- var addCommand = function (command, callback, scope) {
- command = command.toLowerCase();
- commands.exec[command] = function (command, ui, value, args) {
- return callback.call(scope || editor, ui, value, args);
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var queryCommandSupported = function (command) {
- command = command.toLowerCase();
- if (commands.exec[command]) {
- return true;
- }
- try {
- return editor.getDoc().queryCommandSupported(command);
- } catch (ex) {
- }
- return false;
- };
- var addQueryStateHandler = function (command, callback, scope) {
- command = command.toLowerCase();
- commands.state[command] = function () {
- return callback.call(scope || editor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var addCommand = function (command, callback, scope) {
+ command = command.toLowerCase();
+ commands.exec[command] = function (command, ui, value, args) {
+ return callback.call(scope || editor, ui, value, args);
+ };
</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 addQueryValueHandler = function (command, callback, scope) {
- command = command.toLowerCase();
- commands.value[command] = function () {
- return callback.call(scope || editor);
- };
- };
- var hasCustomCommand = function (command) {
- command = command.toLowerCase();
- return !!commands.exec[command];
- };
- extend$2(this, {
- execCommand: execCommand,
- queryCommandState: queryCommandState,
- queryCommandValue: queryCommandValue,
- queryCommandSupported: queryCommandSupported,
- addCommands: addCommands,
- addCommand: addCommand,
- addQueryStateHandler: addQueryStateHandler,
- addQueryValueHandler: addQueryValueHandler,
- hasCustomCommand: hasCustomCommand
- });
- var execNativeCommand = function (command, ui, value) {
- if (ui === undefined) {
- ui = false;
- }
- if (value === undefined) {
- value = null;
- }
- return editor.getDoc().execCommand(command, ui, value);
- };
- var isFormatMatch = function (name) {
- return formatter.match(name);
- };
- var toggleFormat = function (name, value) {
- formatter.toggle(name, value ? { value: value } : undefined);
- editor.nodeChanged();
- };
- var storeSelection = function (type) {
- bookmark = selection.getBookmark(type);
- };
- var restoreSelection = function () {
- selection.moveToBookmark(bookmark);
- };
- addCommands({
- 'mceResetDesignMode,mceBeginUndoLevel': function () {
- },
- 'mceEndUndoLevel,mceAddUndoLevel': function () {
- editor.undoManager.add();
- },
- 'Cut,Copy,Paste': function (command) {
- var doc = editor.getDoc();
- var failed;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var queryCommandSupported = function (command) {
+ command = command.toLowerCase();
+ if (commands.exec[command]) {
+ return true;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> try {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- execNativeCommand(command);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return editor.getDoc().queryCommandSupported(command);
</ins><span class="cx" style="display: block; padding: 0 10px"> } catch (ex) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- failed = true;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (command === 'paste' && !doc.queryCommandEnabled(command)) {
- failed = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return false;
+ };
+ var addQueryStateHandler = function (command, callback, scope) {
+ command = command.toLowerCase();
+ commands.state[command] = function () {
+ return callback.call(scope || editor);
+ };
+ };
+ var addQueryValueHandler = function (command, callback, scope) {
+ command = command.toLowerCase();
+ commands.value[command] = function () {
+ return callback.call(scope || editor);
+ };
+ };
+ var hasCustomCommand = function (command) {
+ command = command.toLowerCase();
+ return !!commands.exec[command];
+ };
+ extend$2(this, {
+ execCommand: execCommand,
+ queryCommandState: queryCommandState,
+ queryCommandValue: queryCommandValue,
+ queryCommandSupported: queryCommandSupported,
+ addCommands: addCommands,
+ addCommand: addCommand,
+ addQueryStateHandler: addQueryStateHandler,
+ addQueryValueHandler: addQueryValueHandler,
+ hasCustomCommand: hasCustomCommand
+ });
+ var execNativeCommand = function (command, ui, value) {
+ if (ui === undefined) {
+ ui = 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 (failed || !doc.queryCommandSupported(command)) {
- var msg = editor.translate('Your browser doesn\'t support direct access to the clipboard. ' + 'Please use the Ctrl+X/C/V keyboard shortcuts instead.');
- if ($_bcvfv9ajjgwe79v.mac) {
- msg = msg.replace(/Ctrl\+/g, '\u2318+');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (value === undefined) {
+ value = null;
+ }
+ return editor.getDoc().execCommand(command, ui, value);
+ };
+ var isFormatMatch = function (name) {
+ return formatter.match(name);
+ };
+ var toggleFormat = function (name, value) {
+ formatter.toggle(name, value ? { value: value } : undefined);
+ editor.nodeChanged();
+ };
+ var storeSelection = function (type) {
+ bookmark = selection.getBookmark(type);
+ };
+ var restoreSelection = function () {
+ selection.moveToBookmark(bookmark);
+ };
+ addCommands({
+ 'mceResetDesignMode,mceBeginUndoLevel': function () {
+ },
+ 'mceEndUndoLevel,mceAddUndoLevel': function () {
+ editor.undoManager.add();
+ },
+ 'Cut,Copy,Paste': function (command) {
+ var doc = editor.getDoc();
+ var failed;
+ try {
+ execNativeCommand(command);
+ } catch (ex) {
+ failed = 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">- editor.notificationManager.open({
- text: msg,
- type: 'error'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (command === 'paste' && !doc.queryCommandEnabled(command)) {
+ failed = true;
+ }
+ if (failed || !doc.queryCommandSupported(command)) {
+ var msg = editor.translate('Your browser doesn\'t support direct access to the clipboard. ' + 'Please use the Ctrl+X/C/V keyboard shortcuts instead.');
+ if (Env.mac) {
+ msg = msg.replace(/Ctrl\+/g, '\u2318+');
+ }
+ editor.notificationManager.open({
+ text: msg,
+ type: 'error'
+ });
+ }
+ },
+ 'unlink': function () {
+ if (selection.isCollapsed()) {
+ var elm = editor.dom.getParent(editor.selection.getStart(), 'a');
+ if (elm) {
+ editor.dom.remove(elm, true);
+ }
+ return;
+ }
+ formatter.remove('link');
+ },
+ 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone': function (command) {
+ var align = command.substring(7);
+ if (align === 'full') {
+ align = 'justify';
+ }
+ each$a('left,center,right,justify'.split(','), function (name) {
+ if (align !== name) {
+ formatter.remove('align' + name);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- },
- 'unlink': function () {
- if (selection.isCollapsed()) {
- var elm = editor.dom.getParent(editor.selection.getStart(), 'a');
- if (elm) {
- editor.dom.remove(elm, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (align !== 'none') {
+ toggleFormat('align' + align);
</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;
- }
- formatter.remove('link');
- },
- 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone': function (command) {
- var align = command.substring(7);
- if (align === 'full') {
- align = 'justify';
- }
- each$10('left,center,right,justify'.split(','), function (name) {
- if (align !== name) {
- formatter.remove('align' + name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ 'InsertUnorderedList,InsertOrderedList': function (command) {
+ var listElm, listParent;
+ execNativeCommand(command);
+ listElm = dom.getParent(selection.getNode(), 'ol,ul');
+ if (listElm) {
+ listParent = listElm.parentNode;
+ if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) {
+ storeSelection();
+ dom.split(listParent, listElm);
+ restoreSelection();
+ }
</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 (align !== 'none') {
- toggleFormat('align' + align);
- }
- },
- 'InsertUnorderedList,InsertOrderedList': function (command) {
- var listElm, listParent;
- execNativeCommand(command);
- listElm = dom.getParent(selection.getNode(), 'ol,ul');
- if (listElm) {
- listParent = listElm.parentNode;
- if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function (command) {
+ toggleFormat(command);
+ },
+ 'ForeColor,HiliteColor': function (command, ui, value) {
+ toggleFormat(command, value);
+ },
+ 'FontName': function (command, ui, value) {
+ fontNameAction(editor, value);
+ },
+ 'FontSize': function (command, ui, value) {
+ fontSizeAction(editor, value);
+ },
+ 'RemoveFormat': function (command) {
+ formatter.remove(command);
+ },
+ 'mceBlockQuote': function () {
+ toggleFormat('blockquote');
+ },
+ 'FormatBlock': function (command, ui, value) {
+ return toggleFormat(value || 'p');
+ },
+ 'mceCleanup': function () {
+ var bookmark = selection.getBookmark();
+ editor.setContent(editor.getContent());
+ selection.moveToBookmark(bookmark);
+ },
+ 'mceRemoveNode': function (command, ui, value) {
+ var node = value || selection.getNode();
+ if (node !== editor.getBody()) {
</ins><span class="cx" style="display: block; padding: 0 10px"> storeSelection();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- dom.split(listParent, listElm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.dom.remove(node, true);
</ins><span class="cx" style="display: block; padding: 0 10px"> restoreSelection();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ 'mceSelectNodeDepth': function (command, ui, value) {
+ var counter = 0;
+ dom.getParent(selection.getNode(), function (node) {
+ if (node.nodeType === 1 && counter++ === value) {
+ selection.select(node);
+ return false;
+ }
+ }, editor.getBody());
+ },
+ 'mceSelectNode': function (command, ui, value) {
+ selection.select(value);
+ },
+ 'mceInsertContent': function (command, ui, value) {
+ InsertContent.insertAtCaret(editor, value);
+ },
+ 'mceInsertRawHTML': function (command, ui, value) {
+ selection.setContent('tiny_mce_marker');
+ var content = editor.getContent();
+ editor.setContent(content.replace(/tiny_mce_marker/g, function () {
+ return value;
+ }));
+ },
+ 'mceToggleFormat': function (command, ui, value) {
+ toggleFormat(value);
+ },
+ 'mceSetContent': function (command, ui, value) {
+ editor.setContent(value);
+ },
+ 'Indent,Outdent': function (command) {
+ handle(editor, command);
+ },
+ 'mceRepaint': function () {
+ },
+ 'InsertHorizontalRule': function () {
+ editor.execCommand('mceInsertContent', false, '<hr />');
+ },
+ 'mceToggleVisualAid': function () {
+ editor.hasVisual = !editor.hasVisual;
+ editor.addVisual();
+ },
+ 'mceReplaceContent': function (command, ui, value) {
+ editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, selection.getContent({ format: 'text' })));
+ },
+ 'mceInsertLink': function (command, ui, value) {
+ var anchor;
+ if (typeof value === 'string') {
+ value = { href: value };
+ }
+ anchor = dom.getParent(selection.getNode(), 'a');
+ value.href = value.href.replace(' ', '%20');
+ if (!anchor || !value.href) {
+ formatter.remove('link');
+ }
+ if (value.href) {
+ formatter.apply('link', value, anchor);
+ }
+ },
+ 'selectAll': function () {
+ var editingHost = dom.getParent(selection.getStart(), NodeType.isContentEditableTrue);
+ if (editingHost) {
+ var rng = dom.createRng();
+ rng.selectNodeContents(editingHost);
+ selection.setRng(rng);
+ }
+ },
+ 'delete': function () {
+ DeleteCommands.deleteCommand(editor);
+ },
+ 'forwardDelete': function () {
+ DeleteCommands.forwardDeleteCommand(editor);
+ },
+ 'mceNewDocument': function () {
+ editor.setContent('');
+ },
+ 'InsertLineBreak': function (command, ui, value) {
+ InsertBr.insert(editor, value);
+ 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">- },
- 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function (command) {
- toggleFormat(command);
- },
- 'ForeColor,HiliteColor': function (command, ui, value) {
- toggleFormat(command, value);
- },
- 'FontName': function (command, ui, value) {
- fontNameAction(editor, value);
- },
- 'FontSize': function (command, ui, value) {
- fontSizeAction(editor, value);
- },
- 'RemoveFormat': function (command) {
- formatter.remove(command);
- },
- 'mceBlockQuote': function () {
- toggleFormat('blockquote');
- },
- 'FormatBlock': function (command, ui, value) {
- return toggleFormat(value || 'p');
- },
- 'mceCleanup': function () {
- var bookmark = selection.getBookmark();
- editor.setContent(editor.getContent());
- selection.moveToBookmark(bookmark);
- },
- 'mceRemoveNode': function (command, ui, value) {
- var node = value || selection.getNode();
- if (node !== editor.getBody()) {
- storeSelection();
- editor.dom.remove(node, true);
- restoreSelection();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ var alignStates = function (name) {
+ return function () {
+ var nodes = selection.isCollapsed() ? [dom.getParent(selection.getNode(), dom.isBlock)] : selection.getSelectedBlocks();
+ var matches = map$3(nodes, function (node) {
+ return !!formatter.matchNode(node, name);
+ });
+ return inArray$2(matches, true) !== -1;
+ };
+ };
+ addCommands({
+ 'JustifyLeft': alignStates('alignleft'),
+ 'JustifyCenter': alignStates('aligncenter'),
+ 'JustifyRight': alignStates('alignright'),
+ 'JustifyFull': alignStates('alignjustify'),
+ 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function (command) {
+ return isFormatMatch(command);
+ },
+ 'mceBlockQuote': function () {
+ return isFormatMatch('blockquote');
+ },
+ 'Outdent': function () {
+ var node;
+ if (settings.inline_styles) {
+ if ((node = dom.getParent(selection.getStart(), dom.isBlock)) && parseInt(node.style.paddingLeft, 10) > 0) {
+ return true;
+ }
+ if ((node = dom.getParent(selection.getEnd(), dom.isBlock)) && parseInt(node.style.paddingLeft, 10) > 0) {
+ return true;
+ }
+ }
+ return queryCommandState('InsertUnorderedList') || queryCommandState('InsertOrderedList') || !settings.inline_styles && !!dom.getParent(selection.getNode(), 'BLOCKQUOTE');
+ },
+ 'InsertUnorderedList,InsertOrderedList': function (command) {
+ var list = dom.getParent(selection.getNode(), 'ul,ol');
+ return list && (command === 'insertunorderedlist' && list.tagName === 'UL' || command === 'insertorderedlist' && list.tagName === 'OL');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- },
- 'mceSelectNodeDepth': function (command, ui, value) {
- var counter = 0;
- dom.getParent(selection.getNode(), function (node) {
- if (node.nodeType === 1 && counter++ === value) {
- selection.select(node);
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }, 'state');
+ addCommands({
+ Undo: function () {
+ editor.undoManager.undo();
+ },
+ Redo: function () {
+ editor.undoManager.redo();
+ }
+ });
+ addQueryValueHandler('FontName', function () {
+ return fontNameQuery(editor);
+ }, this);
+ addQueryValueHandler('FontSize', function () {
+ return fontSizeQuery(editor);
+ }, this);
+ }
+
+ var nativeEvents = Tools.makeMap('focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange ' + 'mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover ' + 'draggesture dragdrop drop drag submit ' + 'compositionstart compositionend compositionupdate touchstart touchmove touchend', ' ');
+ var Dispatcher = function (settings) {
+ var self = this;
+ var scope, bindings = {}, toggleEvent;
+ var returnFalse = function () {
+ return false;
+ };
+ var returnTrue = function () {
+ return true;
+ };
+ settings = settings || {};
+ scope = settings.scope || self;
+ toggleEvent = settings.toggleEvent || returnFalse;
+ var fire = function (name, args) {
+ var handlers, i, l, callback;
+ name = name.toLowerCase();
+ args = args || {};
+ args.type = name;
+ if (!args.target) {
+ args.target = scope;
+ }
+ if (!args.preventDefault) {
+ args.preventDefault = function () {
+ args.isDefaultPrevented = returnTrue;
+ };
+ args.stopPropagation = function () {
+ args.isPropagationStopped = returnTrue;
+ };
+ args.stopImmediatePropagation = function () {
+ args.isImmediatePropagationStopped = returnTrue;
+ };
+ args.isDefaultPrevented = returnFalse;
+ args.isPropagationStopped = returnFalse;
+ args.isImmediatePropagationStopped = returnFalse;
+ }
+ if (settings.beforeFire) {
+ settings.beforeFire(args);
+ }
+ handlers = bindings[name];
+ if (handlers) {
+ for (i = 0, l = handlers.length; i < l; i++) {
+ callback = handlers[i];
+ if (callback.once) {
+ off(name, callback.func);
+ }
+ if (args.isImmediatePropagationStopped()) {
+ args.stopPropagation();
+ return args;
+ }
+ if (callback.func.call(scope, args) === false) {
+ args.preventDefault();
+ return args;
+ }
</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.getBody());
- },
- 'mceSelectNode': function (command, ui, value) {
- selection.select(value);
- },
- 'mceInsertContent': function (command, ui, value) {
- $_7w0ed33ijjgwe841.insertAtCaret(editor, value);
- },
- 'mceInsertRawHTML': function (command, ui, value) {
- var content = editor.getContent();
- selection.setContent('tiny_mce_marker');
- editor.setContent(content.replace(/tiny_mce_marker/g, function () {
- return value;
- }));
- },
- 'mceToggleFormat': function (command, ui, value) {
- toggleFormat(value);
- },
- 'mceSetContent': function (command, ui, value) {
- editor.setContent(value);
- },
- 'Indent,Outdent': function (command) {
- handle(editor, command);
- },
- 'mceRepaint': function () {
- },
- 'InsertHorizontalRule': function () {
- editor.execCommand('mceInsertContent', false, '<hr />');
- },
- 'mceToggleVisualAid': function () {
- editor.hasVisual = !editor.hasVisual;
- editor.addVisual();
- },
- 'mceReplaceContent': function (command, ui, value) {
- editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, selection.getContent({ format: 'text' })));
- },
- 'mceInsertLink': function (command, ui, value) {
- var anchor;
- if (typeof value === 'string') {
- value = { href: value };
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- anchor = dom.getParent(selection.getNode(), 'a');
- value.href = value.href.replace(' ', '%20');
- if (!anchor || !value.href) {
- formatter.remove('link');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return args;
+ };
+ var on = function (name, callback, prepend, extra) {
+ var handlers, names, i;
+ if (callback === false) {
+ callback = returnFalse;
</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 (value.href) {
- formatter.apply('link', value, anchor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (callback) {
+ callback = { func: callback };
+ if (extra) {
+ Tools.extend(callback, extra);
+ }
+ names = name.toLowerCase().split(' ');
+ i = names.length;
+ while (i--) {
+ name = names[i];
+ handlers = bindings[name];
+ if (!handlers) {
+ handlers = bindings[name] = [];
+ toggleEvent(name, true);
+ }
+ if (prepend) {
+ handlers.unshift(callback);
+ } else {
+ handlers.push(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">- },
- 'selectAll': function () {
- var editingHost = dom.getParent(selection.getStart(), $_3b9u2y1rjjgwe7qe.isContentEditableTrue);
- if (editingHost) {
- var rng = dom.createRng();
- rng.selectNodeContents(editingHost);
- selection.setRng(rng);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self;
+ };
+ var off = function (name, callback) {
+ var i, handlers, bindingName, names, hi;
+ if (name) {
+ names = name.toLowerCase().split(' ');
+ i = names.length;
+ while (i--) {
+ name = names[i];
+ handlers = bindings[name];
+ if (!name) {
+ for (bindingName in bindings) {
+ toggleEvent(bindingName, false);
+ delete bindings[bindingName];
+ }
+ return self;
+ }
+ if (handlers) {
+ if (!callback) {
+ handlers.length = 0;
+ } else {
+ hi = handlers.length;
+ while (hi--) {
+ if (handlers[hi].func === callback) {
+ handlers = handlers.slice(0, hi).concat(handlers.slice(hi + 1));
+ bindings[name] = handlers;
+ }
+ }
+ }
+ if (!handlers.length) {
+ toggleEvent(name, false);
+ delete bindings[name];
+ }
+ }
+ }
+ } else {
+ for (name in bindings) {
+ toggleEvent(name, false);
+ }
+ bindings = {};
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- },
- 'delete': function () {
- $_36hh3g3pjjgwe85i.deleteCommand(editor);
- },
- 'forwardDelete': function () {
- $_36hh3g3pjjgwe85i.forwardDeleteCommand(editor);
- },
- 'mceNewDocument': function () {
- editor.setContent('');
- },
- 'InsertLineBreak': function (command, ui, value) {
- $_4o98q44ijjgwe8g6.insert(editor, value);
- return true;
- }
- });
- var alignStates = function (name) {
- return function () {
- var nodes = selection.isCollapsed() ? [dom.getParent(selection.getNode(), dom.isBlock)] : selection.getSelectedBlocks();
- var matches = map$3(nodes, function (node) {
- return !!formatter.matchNode(node, name);
- });
- return inArray$2(matches, true) !== -1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self;
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var once = function (name, callback, prepend) {
+ return on(name, callback, prepend, { once: true });
+ };
+ var has = function (name) {
+ name = name.toLowerCase();
+ return !(!bindings[name] || bindings[name].length === 0);
+ };
+ self.fire = fire;
+ self.on = on;
+ self.off = off;
+ self.once = once;
+ self.has = has;
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- addCommands({
- 'JustifyLeft': alignStates('alignleft'),
- 'JustifyCenter': alignStates('aligncenter'),
- 'JustifyRight': alignStates('alignright'),
- 'JustifyFull': alignStates('alignjustify'),
- 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function (command) {
- return isFormatMatch(command);
- },
- 'mceBlockQuote': function () {
- return isFormatMatch('blockquote');
- },
- 'Outdent': function () {
- var node;
- if (settings.inline_styles) {
- if ((node = dom.getParent(selection.getStart(), dom.isBlock)) && parseInt(node.style.paddingLeft, 10) > 0) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Dispatcher.isNative = function (name) {
+ return !!nativeEvents[name.toLowerCase()];
+ };
+
+ var getEventDispatcher = function (obj) {
+ if (!obj._eventDispatcher) {
+ obj._eventDispatcher = new Dispatcher({
+ scope: obj,
+ toggleEvent: function (name, state) {
+ if (Dispatcher.isNative(name) && obj.toggleNativeEvent) {
+ obj.toggleNativeEvent(name, 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 ((node = dom.getParent(selection.getEnd(), dom.isBlock)) && parseInt(node.style.paddingLeft, 10) > 0) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ }
+ return obj._eventDispatcher;
+ };
+ var Observable = {
+ fire: function (name, args, bubble) {
+ var self = this;
+ if (self.removed && name !== 'remove') {
+ return args;
+ }
+ args = getEventDispatcher(self).fire(name, args, bubble);
+ if (bubble !== false && self.parent) {
+ var parent = self.parent();
+ while (parent && !args.isPropagationStopped()) {
+ parent.fire(name, args, false);
+ parent = parent.parent();
</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">- return queryCommandState('InsertUnorderedList') || queryCommandState('InsertOrderedList') || !settings.inline_styles && !!dom.getParent(selection.getNode(), 'BLOCKQUOTE');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return args;
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'InsertUnorderedList,InsertOrderedList': function (command) {
- var list = dom.getParent(selection.getNode(), 'ul,ol');
- return list && (command === 'insertunorderedlist' && list.tagName === 'UL' || command === 'insertorderedlist' && list.tagName === 'OL');
- }
- }, 'state');
- addCommands({
- Undo: function () {
- editor.undoManager.undo();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ on: function (name, callback, prepend) {
+ return getEventDispatcher(this).on(name, callback, 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">- Redo: function () {
- editor.undoManager.redo();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ off: function (name, callback) {
+ return getEventDispatcher(this).off(name, callback);
+ },
+ once: function (name, callback) {
+ return getEventDispatcher(this).once(name, callback);
+ },
+ hasEventListeners: function (name) {
+ return getEventDispatcher(this).has(name);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- addQueryValueHandler('FontName', function () {
- return fontNameQuery(editor);
- }, this);
- addQueryValueHandler('FontSize', function () {
- return fontSizeQuery(editor);
- }, this);
- }
</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">- var nativeEvents = $_6cwiepljjgwe7j4.makeMap('focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange ' + 'mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover ' + 'draggesture dragdrop drop drag submit ' + 'compositionstart compositionend compositionupdate touchstart touchmove touchend', ' ');
- var Dispatcher = function (settings) {
- var self = this;
- var scope, bindings = {}, toggleEvent;
- var returnFalse = function () {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var firePreProcess = function (editor, args) {
+ return editor.fire('PreProcess', args);
</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 returnTrue = function () {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var firePostProcess = function (editor, args) {
+ return editor.fire('PostProcess', args);
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- settings = settings || {};
- scope = settings.scope || self;
- toggleEvent = settings.toggleEvent || returnFalse;
- var fire = function (name, args) {
- var handlers, i, l, callback;
- name = name.toLowerCase();
- args = args || {};
- args.type = name;
- if (!args.target) {
- args.target = scope;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fireRemove = function (editor) {
+ return editor.fire('remove');
+ };
+ var fireSwitchMode = function (editor, mode) {
+ return editor.fire('SwitchMode', { mode: mode });
+ };
+ var fireObjectResizeStart = function (editor, target, width, height) {
+ editor.fire('ObjectResizeStart', {
+ target: target,
+ width: width,
+ height: height
+ });
+ };
+ var fireObjectResized = function (editor, target, width, height) {
+ editor.fire('ObjectResized', {
+ target: target,
+ width: width,
+ height: height
+ });
+ };
+ var Events = {
+ firePreProcess: firePreProcess,
+ firePostProcess: firePostProcess,
+ fireRemove: fireRemove,
+ fireSwitchMode: fireSwitchMode,
+ fireObjectResizeStart: fireObjectResizeStart,
+ fireObjectResized: fireObjectResized
+ };
+
+ var setEditorCommandState = function (editor, cmd, state) {
+ try {
+ editor.getDoc().execCommand(cmd, false, state);
+ } catch (ex) {
</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 (!args.preventDefault) {
- args.preventDefault = function () {
- args.isDefaultPrevented = returnTrue;
- };
- args.stopPropagation = function () {
- args.isPropagationStopped = returnTrue;
- };
- args.stopImmediatePropagation = function () {
- args.isImmediatePropagationStopped = returnTrue;
- };
- args.isDefaultPrevented = returnFalse;
- args.isPropagationStopped = returnFalse;
- args.isImmediatePropagationStopped = returnFalse;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var toggleClass = function (elm, cls, state) {
+ if (has$2(elm, cls) && state === false) {
+ remove$5(elm, cls);
+ } else if (state) {
+ add$2(elm, cls);
</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.beforeFire) {
- settings.beforeFire(args);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var toggleReadOnly = function (editor, state) {
+ toggleClass(Element$$1.fromDom(editor.getBody()), 'mce-content-readonly', state);
+ if (state) {
+ editor.selection.controlSelection.hideResizeRect();
+ editor.readonly = true;
+ editor.getBody().contentEditable = 'false';
+ } else {
+ editor.readonly = false;
+ editor.getBody().contentEditable = 'true';
+ setEditorCommandState(editor, 'StyleWithCSS', false);
+ setEditorCommandState(editor, 'enableInlineTableEditing', false);
+ setEditorCommandState(editor, 'enableObjectResizing', false);
+ 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">- handlers = bindings[name];
- if (handlers) {
- for (i = 0, l = handlers.length; i < l; i++) {
- callback = handlers[i];
- if (callback.once) {
- off(name, callback.func);
- }
- if (args.isImmediatePropagationStopped()) {
- args.stopPropagation();
- return args;
- }
- if (callback.func.call(scope, args) === false) {
- args.preventDefault();
- return args;
- }
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var setMode = function (editor, mode) {
+ if (mode === getMode(editor)) {
+ 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 args;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (editor.initialized) {
+ toggleReadOnly(editor, mode === 'readonly');
+ } else {
+ editor.on('init', function () {
+ toggleReadOnly(editor, mode === 'readonly');
+ });
+ }
+ Events.fireSwitchMode(editor, mode);
</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 on = function (name, callback, prepend, extra) {
- var handlers, names, i;
- if (callback === false) {
- callback = returnFalse;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getMode = function (editor) {
+ return editor.readonly ? 'readonly' : 'design';
+ };
+ var isReadOnly = function (editor) {
+ return editor.readonly === true;
+ };
+
+ var DOM$1 = DOMUtils$1.DOM;
+ var customEventRootDelegates;
+ var getEventTarget = function (editor, eventName) {
+ if (eventName === 'selectionchange') {
+ return editor.getDoc();
</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) {
- callback = { func: callback };
- if (extra) {
- $_6cwiepljjgwe7j4.extend(callback, extra);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!editor.inline && /^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(eventName)) {
+ return editor.getDoc().documentElement;
+ }
+ if (editor.settings.event_root) {
+ if (!editor.eventRoot) {
+ editor.eventRoot = DOM$1.select(editor.settings.event_root)[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">- names = name.toLowerCase().split(' ');
- i = names.length;
- while (i--) {
- name = names[i];
- handlers = bindings[name];
- if (!handlers) {
- handlers = bindings[name] = [];
- toggleEvent(name, true);
- }
- if (prepend) {
- handlers.unshift(callback);
- } else {
- handlers.push(callback);
- }
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return editor.eventRoot;
</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 self;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- var off = function (name, callback) {
- var i, handlers, bindingName, names, hi;
- if (name) {
- names = name.toLowerCase().split(' ');
- i = names.length;
- while (i--) {
- name = names[i];
- handlers = bindings[name];
- if (!name) {
- for (bindingName in bindings) {
- toggleEvent(bindingName, false);
- delete bindings[bindingName];
- }
- return self;
- }
- if (handlers) {
- if (!callback) {
- handlers.length = 0;
- } else {
- hi = handlers.length;
- while (hi--) {
- if (handlers[hi].func === callback) {
- handlers = handlers.slice(0, hi).concat(handlers.slice(hi + 1));
- bindings[name] = handlers;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isListening = function (editor) {
+ return !editor.hidden && !editor.readonly;
+ };
+ var fireEvent = function (editor, eventName, e) {
+ if (isListening(editor)) {
+ editor.fire(eventName, e);
+ } else if (isReadOnly(editor)) {
+ e.preventDefault();
+ }
+ };
+ var bindEventDelegate = function (editor, eventName) {
+ var eventRootElm, delegate;
+ if (!editor.delegates) {
+ editor.delegates = {};
+ }
+ if (editor.delegates[eventName] || editor.removed) {
+ return;
+ }
+ eventRootElm = getEventTarget(editor, eventName);
+ if (editor.settings.event_root) {
+ if (!customEventRootDelegates) {
+ customEventRootDelegates = {};
+ editor.editorManager.on('removeEditor', function () {
+ var name;
+ if (!editor.editorManager.activeEditor) {
+ if (customEventRootDelegates) {
+ for (name in customEventRootDelegates) {
+ editor.dom.unbind(getEventTarget(editor, name));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ customEventRootDelegates = null;
</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">- if (!handlers.length) {
- toggleEvent(name, false);
- delete bindings[name];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ }
+ if (customEventRootDelegates[eventName]) {
+ return;
+ }
+ delegate = function (e) {
+ var target = e.target;
+ var editors = editor.editorManager.get();
+ var i = editors.length;
+ while (i--) {
+ var body = editors[i].getBody();
+ if (body === target || DOM$1.isChildOf(target, body)) {
+ fireEvent(editors[i], eventName, e);
</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">- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ customEventRootDelegates[eventName] = delegate;
+ DOM$1.bind(eventRootElm, eventName, delegate);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- for (name in bindings) {
- toggleEvent(name, false);
- }
- bindings = {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ delegate = function (e) {
+ fireEvent(editor, eventName, e);
+ };
+ DOM$1.bind(eventRootElm, eventName, delegate);
+ editor.delegates[eventName] = delegate;
</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 self;
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var once = function (name, callback, prepend) {
- return on(name, callback, prepend, { once: true });
- };
- var has = function (name) {
- name = name.toLowerCase();
- return !(!bindings[name] || bindings[name].length === 0);
- };
- self.fire = fire;
- self.on = on;
- self.off = off;
- self.once = once;
- self.has = has;
- };
- Dispatcher.isNative = function (name) {
- return !!nativeEvents[name.toLowerCase()];
- };
-
- var getEventDispatcher = function (obj) {
- if (!obj._eventDispatcher) {
- obj._eventDispatcher = new Dispatcher({
- scope: obj,
- toggleEvent: function (name, state) {
- if (Dispatcher.isNative(name) && obj.toggleNativeEvent) {
- obj.toggleNativeEvent(name, state);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var EditorObservable = {
+ bindPendingEventDelegates: function () {
+ var self = this;
+ Tools.each(self._pendingNativeEvents, function (name) {
+ bindEventDelegate(self, name);
+ });
+ },
+ toggleNativeEvent: function (name, state) {
+ var self = this;
+ if (name === 'focus' || name === 'blur') {
+ return;
+ }
+ if (state) {
+ if (self.initialized) {
+ bindEventDelegate(self, name);
+ } else {
+ if (!self._pendingNativeEvents) {
+ self._pendingNativeEvents = [name];
+ } else {
+ self._pendingNativeEvents.push(name);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if (self.initialized) {
+ self.dom.unbind(getEventTarget(self, name), name, self.delegates[name]);
+ delete self.delegates[name];
</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._eventDispatcher;
- };
- var $_5fwo104qjjgwe8hz = {
- fire: function (name, args, bubble) {
- var self = this;
- if (self.removed && name !== 'remove') {
- return args;
- }
- args = getEventDispatcher(self).fire(name, args, bubble);
- if (bubble !== false && self.parent) {
- var parent = self.parent();
- while (parent && !args.isPropagationStopped()) {
- parent.fire(name, args, false);
- parent = parent.parent();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ unbindAllNativeEvents: function () {
+ var self = this;
+ var body = self.getBody();
+ var dom = self.dom;
+ var name;
+ if (self.delegates) {
+ for (name in self.delegates) {
+ self.dom.unbind(getEventTarget(self, name), name, self.delegates[name]);
+ }
+ delete self.delegates;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!self.inline && body && dom) {
+ body.onload = null;
+ dom.unbind(self.getWin());
+ dom.unbind(self.getDoc());
+ }
+ if (dom) {
+ dom.unbind(body);
+ dom.unbind(self.getContainer());
+ }
</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 args;
- },
- on: function (name, callback, prepend) {
- return getEventDispatcher(this).on(name, callback, prepend);
- },
- off: function (name, callback) {
- return getEventDispatcher(this).off(name, callback);
- },
- once: function (name, callback) {
- return getEventDispatcher(this).once(name, callback);
- },
- hasEventListeners: function (name) {
- return getEventDispatcher(this).has(name);
- }
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ EditorObservable = Tools.extend({}, Observable, EditorObservable);
+ var EditorObservable$1 = EditorObservable;
</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 firePreProcess = function (editor, args) {
- return editor.fire('PreProcess', args);
- };
- var firePostProcess = function (editor, args) {
- return editor.fire('PostProcess', args);
- };
- var fireRemove = function (editor) {
- return editor.fire('remove');
- };
- var fireSwitchMode = function (editor, mode) {
- return editor.fire('SwitchMode', { mode: mode });
- };
- var fireObjectResizeStart = function (editor, target, width, height) {
- editor.fire('ObjectResizeStart', {
- target: target,
- width: width,
- height: height
- });
- };
- var fireObjectResized = function (editor, target, width, height) {
- editor.fire('ObjectResized', {
- target: target,
- width: width,
- height: height
- });
- };
- var $_b2ca654tjjgwe8ic = {
- firePreProcess: firePreProcess,
- firePostProcess: firePostProcess,
- fireRemove: fireRemove,
- fireSwitchMode: fireSwitchMode,
- fireObjectResizeStart: fireObjectResizeStart,
- fireObjectResized: fireObjectResized
- };
-
- var setEditorCommandState = function (editor, cmd, state) {
- try {
- editor.getDoc().execCommand(cmd, false, state);
- } catch (ex) {
- }
- };
- var toggleClass = function (elm, cls, state) {
- if ($_9lrjdk23jjgwe7u2.has(elm, cls) && state === false) {
- $_9lrjdk23jjgwe7u2.remove(elm, cls);
- } else if (state) {
- $_9lrjdk23jjgwe7u2.add(elm, cls);
- }
- };
- var toggleReadOnly = function (editor, state) {
- toggleClass(Element$$1.fromDom(editor.getBody()), 'mce-content-readonly', state);
- if (state) {
- editor.selection.controlSelection.hideResizeRect();
- editor.readonly = true;
- editor.getBody().contentEditable = 'false';
- } else {
- editor.readonly = false;
- editor.getBody().contentEditable = 'true';
- setEditorCommandState(editor, 'StyleWithCSS', false);
- setEditorCommandState(editor, 'enableInlineTableEditing', false);
- setEditorCommandState(editor, 'enableObjectResizing', false);
- editor.focus();
- editor.nodeChanged();
- }
- };
- var setMode = function (editor, mode) {
- if (mode === getMode(editor)) {
- return;
- }
- if (editor.initialized) {
- toggleReadOnly(editor, mode === 'readonly');
- } else {
- editor.on('init', function () {
- toggleReadOnly(editor, mode === 'readonly');
- });
- }
- $_b2ca654tjjgwe8ic.fireSwitchMode(editor, mode);
- };
- var getMode = function (editor) {
- return editor.readonly ? 'readonly' : 'design';
- };
- var isReadOnly = function (editor) {
- return editor.readonly === true;
- };
-
- var DOM$1 = DOMUtils$1.DOM;
- var customEventRootDelegates;
- var getEventTarget = function (editor, eventName) {
- if (eventName === 'selectionchange') {
- return editor.getDoc();
- }
- if (!editor.inline && /^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(eventName)) {
- return editor.getDoc().documentElement;
- }
- if (editor.settings.event_root) {
- if (!editor.eventRoot) {
- editor.eventRoot = DOM$1.select(editor.settings.event_root)[0];
- }
- return editor.eventRoot;
- }
- return editor.getBody();
- };
- var isListening = function (editor) {
- return !editor.hidden && !editor.readonly;
- };
- var fireEvent = function (editor, eventName, e) {
- if (isListening(editor)) {
- editor.fire(eventName, e);
- } else if (isReadOnly(editor)) {
- e.preventDefault();
- }
- };
- var bindEventDelegate = function (editor, eventName) {
- var eventRootElm, delegate;
- if (!editor.delegates) {
- editor.delegates = {};
- }
- if (editor.delegates[eventName] || editor.removed) {
- return;
- }
- eventRootElm = getEventTarget(editor, eventName);
- if (editor.settings.event_root) {
- if (!customEventRootDelegates) {
- customEventRootDelegates = {};
- editor.editorManager.on('removeEditor', function () {
- var name;
- if (!editor.editorManager.activeEditor) {
- if (customEventRootDelegates) {
- for (name in customEventRootDelegates) {
- editor.dom.unbind(getEventTarget(editor, name));
- }
- customEventRootDelegates = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var each$b = Tools.each, explode$2 = Tools.explode;
+ var keyCodeLookup = {
+ f9: 120,
+ f10: 121,
+ f11: 122
+ };
+ var modifierNames = Tools.makeMap('alt,ctrl,shift,meta,access');
+ function Shortcuts (editor) {
+ var self = this;
+ var shortcuts = {};
+ var pendingPatterns = [];
+ var parseShortcut = function (pattern) {
+ var id, key;
+ var shortcut = {};
+ each$b(explode$2(pattern, '+'), function (value) {
+ if (value in modifierNames) {
+ shortcut[value] = true;
+ } else {
+ if (/^[0-9]{2,}$/.test(value)) {
+ shortcut.keyCode = parseInt(value, 10);
+ } else {
+ shortcut.charCode = value.charCodeAt(0);
+ shortcut.keyCode = keyCodeLookup[value] || value.toUpperCase().charCodeAt(0);
</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">- }
- if (customEventRootDelegates[eventName]) {
- return;
- }
- delegate = function (e) {
- var target = e.target;
- var editors = editor.editorManager.get();
- var i = editors.length;
- while (i--) {
- var body = editors[i].getBody();
- if (body === target || DOM$1.isChildOf(target, body)) {
- fireEvent(editors[i], eventName, e);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ id = [shortcut.keyCode];
+ for (key in modifierNames) {
+ if (shortcut[key]) {
+ id.push(key);
+ } else {
+ shortcut[key] = false;
</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">- };
- customEventRootDelegates[eventName] = delegate;
- DOM$1.bind(eventRootElm, eventName, delegate);
- } else {
- delegate = function (e) {
- fireEvent(editor, eventName, e);
- };
- DOM$1.bind(eventRootElm, eventName, delegate);
- editor.delegates[eventName] = delegate;
- }
- };
- var EditorObservable = {
- bindPendingEventDelegates: function () {
- var self = this;
- $_6cwiepljjgwe7j4.each(self._pendingNativeEvents, function (name) {
- bindEventDelegate(self, name);
- });
- },
- toggleNativeEvent: function (name, state) {
- var self = this;
- if (name === 'focus' || name === 'blur') {
- return;
- }
- if (state) {
- if (self.initialized) {
- bindEventDelegate(self, name);
- } else {
- if (!self._pendingNativeEvents) {
- self._pendingNativeEvents = [name];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ shortcut.id = id.join(',');
+ if (shortcut.access) {
+ shortcut.alt = true;
+ if (Env.mac) {
+ shortcut.ctrl = true;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self._pendingNativeEvents.push(name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ shortcut.shift = true;
</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">- } else if (self.initialized) {
- self.dom.unbind(getEventTarget(self, name), name, self.delegates[name]);
- delete self.delegates[name];
- }
- },
- unbindAllNativeEvents: function () {
- var self = this;
- var body = self.getBody();
- var dom = self.dom;
- var name;
- if (self.delegates) {
- for (name in self.delegates) {
- self.dom.unbind(getEventTarget(self, name), name, self.delegates[name]);
- }
- delete self.delegates;
- }
- if (!self.inline && body && dom) {
- body.onload = null;
- dom.unbind(self.getWin());
- dom.unbind(self.getDoc());
- }
- if (dom) {
- dom.unbind(body);
- dom.unbind(self.getContainer());
- }
- }
- };
- EditorObservable = $_6cwiepljjgwe7j4.extend({}, $_5fwo104qjjgwe8hz, EditorObservable);
- var EditorObservable$1 = EditorObservable;
-
- var each$11 = $_6cwiepljjgwe7j4.each;
- var explode$2 = $_6cwiepljjgwe7j4.explode;
- var keyCodeLookup = {
- f9: 120,
- f10: 121,
- f11: 122
- };
- var modifierNames = $_6cwiepljjgwe7j4.makeMap('alt,ctrl,shift,meta,access');
- function Shortcuts (editor) {
- var self = this;
- var shortcuts = {};
- var pendingPatterns = [];
- var parseShortcut = function (pattern) {
- var id, key;
- var shortcut = {};
- each$11(explode$2(pattern, '+'), function (value) {
- if (value in modifierNames) {
- shortcut[value] = true;
- } else {
- if (/^[0-9]{2,}$/.test(value)) {
- shortcut.keyCode = parseInt(value, 10);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (shortcut.meta) {
+ if (Env.mac) {
+ shortcut.meta = true;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- shortcut.charCode = value.charCodeAt(0);
- shortcut.keyCode = keyCodeLookup[value] || value.toUpperCase().charCodeAt(0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ shortcut.ctrl = true;
+ shortcut.meta = false;
</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">- });
- id = [shortcut.keyCode];
- for (key in modifierNames) {
- if (shortcut[key]) {
- id.push(key);
- } else {
- shortcut[key] = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return shortcut;
+ };
+ var createShortcut = function (pattern, desc, cmdFunc, scope) {
+ var shortcuts;
+ shortcuts = Tools.map(explode$2(pattern, '>'), parseShortcut);
+ shortcuts[shortcuts.length - 1] = Tools.extend(shortcuts[shortcuts.length - 1], {
+ func: cmdFunc,
+ scope: scope || editor
+ });
+ return Tools.extend(shortcuts[0], {
+ desc: editor.translate(desc),
+ subpatterns: shortcuts.slice(1)
+ });
+ };
+ var hasModifier = function (e) {
+ return e.altKey || e.ctrlKey || e.metaKey;
+ };
+ var isFunctionKey = function (e) {
+ return e.type === 'keydown' && e.keyCode >= 112 && e.keyCode <= 123;
+ };
+ var matchShortcut = function (e, shortcut) {
+ if (!shortcut) {
+ 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">- }
- shortcut.id = id.join(',');
- if (shortcut.access) {
- shortcut.alt = true;
- if ($_bcvfv9ajjgwe79v.mac) {
- shortcut.ctrl = true;
- } else {
- shortcut.shift = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (shortcut.ctrl !== e.ctrlKey || shortcut.meta !== e.metaKey) {
+ 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 (shortcut.meta) {
- if ($_bcvfv9ajjgwe79v.mac) {
- shortcut.meta = true;
- } else {
- shortcut.ctrl = true;
- shortcut.meta = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (shortcut.alt !== e.altKey || shortcut.shift !== e.shiftKey) {
+ 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 shortcut;
- };
- var createShortcut = function (pattern, desc, cmdFunc, scope) {
- var shortcuts;
- shortcuts = $_6cwiepljjgwe7j4.map(explode$2(pattern, '>'), parseShortcut);
- shortcuts[shortcuts.length - 1] = $_6cwiepljjgwe7j4.extend(shortcuts[shortcuts.length - 1], {
- func: cmdFunc,
- scope: scope || editor
- });
- return $_6cwiepljjgwe7j4.extend(shortcuts[0], {
- desc: editor.translate(desc),
- subpatterns: shortcuts.slice(1)
- });
- };
- var hasModifier = function (e) {
- return e.altKey || e.ctrlKey || e.metaKey;
- };
- var isFunctionKey = function (e) {
- return e.type === 'keydown' && e.keyCode >= 112 && e.keyCode <= 123;
- };
- var matchShortcut = function (e, shortcut) {
- if (!shortcut) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (e.keyCode === shortcut.keyCode || e.charCode && e.charCode === shortcut.charCode) {
+ e.preventDefault();
+ return true;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (shortcut.ctrl !== e.ctrlKey || shortcut.meta !== e.metaKey) {
- return false;
- }
- if (shortcut.alt !== e.altKey || shortcut.shift !== e.shiftKey) {
- return false;
- }
- if (e.keyCode === shortcut.keyCode || e.charCode && e.charCode === shortcut.charCode) {
- e.preventDefault();
- return true;
- }
- return false;
- };
- var executeShortcutAction = function (shortcut) {
- return shortcut.func ? shortcut.func.call(shortcut.scope) : null;
- };
- editor.on('keyup keypress keydown', function (e) {
- if ((hasModifier(e) || isFunctionKey(e)) && !e.isDefaultPrevented()) {
- each$11(shortcuts, function (shortcut) {
- if (matchShortcut(e, shortcut)) {
- pendingPatterns = shortcut.subpatterns.slice(0);
- if (e.type === 'keydown') {
- executeShortcutAction(shortcut);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var executeShortcutAction = function (shortcut) {
+ return shortcut.func ? shortcut.func.call(shortcut.scope) : null;
+ };
+ editor.on('keyup keypress keydown', function (e) {
+ if ((hasModifier(e) || isFunctionKey(e)) && !e.isDefaultPrevented()) {
+ each$b(shortcuts, function (shortcut) {
+ if (matchShortcut(e, shortcut)) {
+ pendingPatterns = shortcut.subpatterns.slice(0);
+ if (e.type === 'keydown') {
+ executeShortcutAction(shortcut);
+ }
+ 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;
- }
- });
- if (matchShortcut(e, pendingPatterns[0])) {
- if (pendingPatterns.length === 1) {
- if (e.type === 'keydown') {
- executeShortcutAction(pendingPatterns[0]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ if (matchShortcut(e, pendingPatterns[0])) {
+ if (pendingPatterns.length === 1) {
+ if (e.type === 'keydown') {
+ executeShortcutAction(pendingPatterns[0]);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ pendingPatterns.shift();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- pendingPatterns.shift();
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- });
- self.add = function (pattern, desc, cmdFunc, scope) {
- var cmd;
- cmd = cmdFunc;
- if (typeof cmdFunc === 'string') {
- cmdFunc = function () {
- editor.execCommand(cmd, false, null);
- };
- } else if ($_6cwiepljjgwe7j4.isArray(cmd)) {
- cmdFunc = function () {
- editor.execCommand(cmd[0], cmd[1], cmd[2]);
- };
- }
- each$11(explode$2($_6cwiepljjgwe7j4.trim(pattern.toLowerCase())), function (pattern) {
- var shortcut = createShortcut(pattern, desc, cmdFunc, scope);
- shortcuts[shortcut.id] = shortcut;
</del><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;
- };
- self.remove = function (pattern) {
- var shortcut = createShortcut(pattern);
- if (shortcuts[shortcut.id]) {
- delete shortcuts[shortcut.id];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.add = function (pattern, desc, cmdFunc, scope) {
+ var cmd;
+ cmd = cmdFunc;
+ if (typeof cmdFunc === 'string') {
+ cmdFunc = function () {
+ editor.execCommand(cmd, false, null);
+ };
+ } else if (Tools.isArray(cmd)) {
+ cmdFunc = function () {
+ editor.execCommand(cmd[0], cmd[1], cmd[2]);
+ };
+ }
+ each$b(explode$2(Tools.trim(pattern.toLowerCase())), function (pattern) {
+ var shortcut = createShortcut(pattern, desc, cmdFunc, scope);
+ shortcuts[shortcut.id] = shortcut;
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- return false;
- };
- }
-
- var any$1 = function (predicate) {
- return $_7kjxyh2ajjgwe7un.first(predicate).isSome();
- };
- var ancestor$3 = function (scope, predicate, isRoot) {
- return $_7kjxyh2ajjgwe7un.ancestor(scope, predicate, isRoot).isSome();
- };
- var closest$3 = function (scope, predicate, isRoot) {
- return $_7kjxyh2ajjgwe7un.closest(scope, predicate, isRoot).isSome();
- };
- var sibling$4 = function (scope, predicate) {
- return $_7kjxyh2ajjgwe7un.sibling(scope, predicate).isSome();
- };
- var child$4 = function (scope, predicate) {
- return $_7kjxyh2ajjgwe7un.child(scope, predicate).isSome();
- };
- var descendant$3 = function (scope, predicate) {
- return $_7kjxyh2ajjgwe7un.descendant(scope, predicate).isSome();
- };
- var $_d5mwxr4xjjgwe8j6 = {
- any: any$1,
- ancestor: ancestor$3,
- closest: closest$3,
- sibling: sibling$4,
- child: child$4,
- descendant: descendant$3
- };
-
- var focus$$1 = function (element) {
- element.dom().focus();
- };
- var blur$$1 = function (element) {
- element.dom().blur();
- };
- var hasFocus = function (element) {
- var doc = $_d3rmjp18jjgwe7nc.owner(element).dom();
- return element.dom() === doc.activeElement;
- };
- var active = function (_doc) {
- var doc = _doc !== undefined ? _doc.dom() : document;
- return Option.from(doc.activeElement).map(Element$$1.fromDom);
- };
- var focusInside = function (element) {
- var doc = $_d3rmjp18jjgwe7nc.owner(element);
- var inside = active(doc).filter(function (a) {
- return $_d5mwxr4xjjgwe8j6.closest(a, curry($_5raon11ejjgwe7o5.eq, element));
- });
- inside.fold(function () {
- focus$$1(element);
- }, noop);
- };
- var search = function (element) {
- return active($_d3rmjp18jjgwe7nc.owner(element)).filter(function (e) {
- return element.dom().contains(e.dom());
- });
- };
- var $_a8y7p34wjjgwe8j0 = {
- hasFocus: hasFocus,
- focus: focus$$1,
- blur: blur$$1,
- active: active,
- search: search,
- focusInside: focusInside
- };
-
- var getContentEditableHost = function (editor, node) {
- return editor.dom.getParent(node, function (node) {
- return editor.dom.getContentEditable(node) === 'true';
- });
- };
- var getCollapsedNode = function (rng) {
- return rng.collapsed ? Option.from(getNode(rng.startContainer, rng.startOffset)).map(Element$$1.fromDom) : Option.none();
- };
- var getFocusInElement = function (root, rng) {
- return getCollapsedNode(rng).bind(function (node) {
- if (isTableSection(node)) {
- return Option.some(node);
- } else if ($_5raon11ejjgwe7o5.contains(root, node) === false) {
- return Option.some(root);
- } else {
- return Option.none();
- }
- });
- };
- var normalizeSelection = function (editor, rng) {
- getFocusInElement(Element$$1.fromDom(editor.getBody()), rng).bind(function (elm) {
- return $_8q1ver2yjjgwe7z3.firstPositionIn(elm.dom());
- }).fold(function () {
- editor.selection.normalize();
- return;
- }, function (caretPos) {
- return editor.selection.setRng(caretPos.toRange());
- });
- };
- var focusBody = function (body) {
- if (body.setActive) {
- try {
- body.setActive();
- } catch (ex) {
- body.focus();
- }
- } else {
- body.focus();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ self.remove = function (pattern) {
+ var shortcut = createShortcut(pattern);
+ if (shortcuts[shortcut.id]) {
+ delete shortcuts[shortcut.id];
+ return true;
+ }
+ 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 hasElementFocus = function (elm) {
- return $_a8y7p34wjjgwe8j0.hasFocus(elm) || $_a8y7p34wjjgwe8j0.search(elm).isSome();
- };
- var hasIframeFocus = function (editor) {
- return editor.iframeElement && $_a8y7p34wjjgwe8j0.hasFocus(Element$$1.fromDom(editor.iframeElement));
- };
- var hasInlineFocus = function (editor) {
- var rawBody = editor.getBody();
- return rawBody && hasElementFocus(Element$$1.fromDom(rawBody));
- };
- var hasFocus$1 = function (editor) {
- return editor.inline ? hasInlineFocus(editor) : hasIframeFocus(editor);
- };
- var focusEditor = function (editor) {
- var selection = editor.selection, contentEditable = editor.settings.content_editable;
- var body = editor.getBody();
- var rng = selection.getRng();
- editor.quirks.refreshContentEditable();
- var contentEditableHost = getContentEditableHost(editor, selection.getNode());
- if (editor.$.contains(body, contentEditableHost)) {
- focusBody(contentEditableHost);
- normalizeSelection(editor, rng);
- activateEditor(editor);
- return;
- }
- if (editor.bookmark !== undefined && hasFocus$1(editor) === false) {
- $_4wtqbt4ljjgwe8gy.getRng(editor).each(function (bookmarkRng) {
- editor.selection.setRng(bookmarkRng);
- rng = bookmarkRng;
- });
- }
- if (!contentEditable) {
- if (!$_bcvfv9ajjgwe79v.opera) {
- focusBody(body);
- }
- editor.getWin().focus();
- }
- if ($_bcvfv9ajjgwe79v.gecko || contentEditable) {
- focusBody(body);
- normalizeSelection(editor, rng);
- }
- activateEditor(editor);
- };
- var activateEditor = function (editor) {
- return editor.editorManager.setActive(editor);
- };
- var focus$1 = function (editor, skipFocus) {
- if (editor.removed) {
- return;
- }
- skipFocus ? activateEditor(editor) : focusEditor(editor);
- };
- var $_5eyh7w4vjjgwe8ik = {
- focus: focus$1,
- hasFocus: hasFocus$1
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var getProp = function (propName, elm) {
- var rawElm = elm.dom();
- return rawElm[propName];
- };
- var getComputedSizeProp = function (propName, elm) {
- return parseInt($_e0ei5w13jjgwe7m4.get(elm, propName), 10);
- };
- var getClientWidth = curry(getProp, 'clientWidth');
- var getClientHeight = curry(getProp, 'clientHeight');
- var getMarginTop = curry(getComputedSizeProp, 'margin-top');
- var getMarginLeft = curry(getComputedSizeProp, 'margin-left');
- var getBoundingClientRect$1 = function (elm) {
- return elm.dom().getBoundingClientRect();
- };
- var isInsideElementContentArea = function (bodyElm, clientX, clientY) {
- var clientWidth = getClientWidth(bodyElm);
- var clientHeight = getClientHeight(bodyElm);
- return clientX >= 0 && clientY >= 0 && clientX <= clientWidth && clientY <= clientHeight;
- };
- var transpose = function (inline, elm, clientX, clientY) {
- var clientRect = getBoundingClientRect$1(elm);
- var deltaX = inline ? clientRect.left + elm.dom().clientLeft + getMarginLeft(elm) : 0;
- var deltaY = inline ? clientRect.top + elm.dom().clientTop + getMarginTop(elm) : 0;
- var x = clientX - deltaX;
- var y = clientY - deltaY;
- return {
- x: x,
- y: y
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasFocus = function (element) {
+ var doc = owner(element).dom();
+ return element.dom() === doc.activeElement;
</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 isXYInContentArea = function (editor, clientX, clientY) {
- var bodyElm = Element$$1.fromDom(editor.getBody());
- var targetElm = editor.inline ? bodyElm : $_d3rmjp18jjgwe7nc.documentElement(bodyElm);
- var transposedPoint = transpose(editor.inline, targetElm, clientX, clientY);
- return isInsideElementContentArea(targetElm, transposedPoint.x, transposedPoint.y);
- };
- var fromDomSafe = function (node) {
- return Option.from(node).map(Element$$1.fromDom);
- };
- var isEditorAttachedToDom = function (editor) {
- var rawContainer = editor.inline ? editor.getBody() : editor.getContentAreaContainer();
- return fromDomSafe(rawContainer).map(function (container) {
- return $_5raon11ejjgwe7o5.contains($_d3rmjp18jjgwe7nc.owner(container), container);
- }).getOr(false);
- };
- var $_3j45vj50jjgwe8jq = {
- isXYInContentArea: isXYInContentArea,
- isEditorAttachedToDom: isEditorAttachedToDom
- };
-
- function NotificationManagerImpl () {
- var unimplemented = function () {
- throw new Error('Theme did not provide a NotificationManager implementation.');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var active = function (_doc) {
+ var doc = _doc !== undefined ? _doc.dom() : document;
+ return Option.from(doc.activeElement).map(Element$$1.fromDom);
</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 {
- open: unimplemented,
- close: unimplemented,
- reposition: unimplemented,
- getArgs: unimplemented
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var search = function (element) {
+ return active(owner(element)).filter(function (e) {
+ return element.dom().contains(e.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">- }
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function NotificationManager (editor) {
- var notifications = [];
- var getImplementation = function () {
- var theme = editor.theme;
- return theme && theme.getNotificationManagerImpl ? theme.getNotificationManagerImpl() : NotificationManagerImpl();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getContentEditableHost = function (editor, node) {
+ return editor.dom.getParent(node, function (node) {
+ return editor.dom.getContentEditable(node) === '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">- var getTopNotification = function () {
- return Option.from(notifications[0]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getCollapsedNode = function (rng) {
+ return rng.collapsed ? Option.from(getNode(rng.startContainer, rng.startOffset)).map(Element$$1.fromDom) : Option.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 isEqual = function (a, b) {
- return a.type === b.type && a.text === b.text && !a.progressBar && !a.timeout && !b.progressBar && !b.timeout;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getFocusInElement = function (root, rng) {
+ return getCollapsedNode(rng).bind(function (node) {
+ if (isTableSection(node)) {
+ return Option.some(node);
+ } else if (contains$3(root, node) === false) {
+ return Option.some(root);
+ } else {
+ return Option.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 reposition = function () {
- if (notifications.length > 0) {
- getImplementation().reposition(notifications);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var normalizeSelection = function (editor, rng) {
+ getFocusInElement(Element$$1.fromDom(editor.getBody()), rng).bind(function (elm) {
+ return CaretFinder.firstPositionIn(elm.dom());
+ }).fold(function () {
+ editor.selection.normalize();
+ return;
+ }, function (caretPos) {
+ return editor.selection.setRng(caretPos.toRange());
+ });
+ };
+ var focusBody = function (body) {
+ if (body.setActive) {
+ try {
+ body.setActive();
+ } catch (ex) {
+ body.focus();
+ }
+ } else {
+ body.focus();
</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">- var addNotification = function (notification) {
- notifications.push(notification);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasElementFocus = function (elm) {
+ return hasFocus(elm) || search(elm).isSome();
</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 closeNotification = function (notification) {
- findIndex(notifications, function (otherNotification) {
- return otherNotification === notification;
- }).each(function (index) {
- notifications.splice(index, 1);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasIframeFocus = function (editor) {
+ return editor.iframeElement && hasFocus(Element$$1.fromDom(editor.iframeElement));
</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 open = function (args) {
- if (editor.removed || !$_3j45vj50jjgwe8jq.isEditorAttachedToDom(editor)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasInlineFocus = function (editor) {
+ var rawBody = editor.getBody();
+ return rawBody && hasElementFocus(Element$$1.fromDom(rawBody));
+ };
+ var hasFocus$1 = function (editor) {
+ return editor.inline ? hasInlineFocus(editor) : hasIframeFocus(editor);
+ };
+ var focusEditor = function (editor) {
+ var selection = editor.selection, contentEditable = editor.settings.content_editable;
+ var body = editor.getBody();
+ var rng = selection.getRng();
+ editor.quirks.refreshContentEditable();
+ var contentEditableHost = getContentEditableHost(editor, selection.getNode());
+ if (editor.$.contains(body, contentEditableHost)) {
+ focusBody(contentEditableHost);
+ normalizeSelection(editor, rng);
+ activateEditor(editor);
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return find(notifications, function (notification) {
- return isEqual(getImplementation().getArgs(notification), args);
- }).getOrThunk(function () {
- editor.editorManager.setActive(editor);
- var notification = getImplementation().open(args, function () {
- closeNotification(notification);
- reposition();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (editor.bookmark !== undefined && hasFocus$1(editor) === false) {
+ SelectionBookmark.getRng(editor).each(function (bookmarkRng) {
+ editor.selection.setRng(bookmarkRng);
+ rng = bookmarkRng;
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- addNotification(notification);
- reposition();
- return notification;
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (!contentEditable) {
+ if (!Env.opera) {
+ focusBody(body);
+ }
+ editor.getWin().focus();
+ }
+ if (Env.gecko || contentEditable) {
+ focusBody(body);
+ normalizeSelection(editor, rng);
+ }
+ activateEditor(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">- var close = function () {
- getTopNotification().each(function (notification) {
- getImplementation().close(notification);
- closeNotification(notification);
- reposition();
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var activateEditor = function (editor) {
+ return editor.editorManager.setActive(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">- var getNotifications = function () {
- return notifications;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var focus$1 = function (editor, skipFocus) {
+ if (editor.removed) {
+ return;
+ }
+ skipFocus ? activateEditor(editor) : focusEditor(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">- var registerEvents = function (editor) {
- editor.on('SkinLoaded', function () {
- var serviceMessage = editor.settings.service_message;
- if (serviceMessage) {
- open({
- text: serviceMessage,
- type: 'warning',
- timeout: 0,
- icon: ''
- });
- }
- });
- editor.on('ResizeEditor ResizeWindow', function () {
- $_9o1ijaijjgwe7dm.requestAnimationFrame(reposition);
- });
- editor.on('remove', function () {
- each(notifications, function (notification) {
- getImplementation().close(notification);
- });
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var EditorFocus = {
+ focus: focus$1,
+ hasFocus: hasFocus$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">- registerEvents(editor);
- return {
- open: open,
- close: close,
- getNotifications: getNotifications
- };
- }
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function WindowManagerImpl () {
- var unimplemented = function () {
- throw new Error('Theme did not provide a WindowManager implementation.');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getProp = function (propName, elm) {
+ var rawElm = elm.dom();
+ return rawElm[propName];
</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 {
- open: unimplemented,
- alert: unimplemented,
- confirm: unimplemented,
- close: unimplemented,
- getParams: unimplemented,
- setParams: unimplemented
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getComputedSizeProp = function (propName, elm) {
+ return parseInt(get$2(elm, propName), 10);
</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 WindowManager (editor) {
- var windows = [];
- var getImplementation = function () {
- var theme = editor.theme;
- return theme && theme.getWindowManagerImpl ? theme.getWindowManagerImpl() : WindowManagerImpl();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getClientWidth = curry(getProp, 'clientWidth');
+ var getClientHeight = curry(getProp, 'clientHeight');
+ var getMarginTop = curry(getComputedSizeProp, 'margin-top');
+ var getMarginLeft = curry(getComputedSizeProp, 'margin-left');
+ var getBoundingClientRect$1 = function (elm) {
+ return elm.dom().getBoundingClientRect();
</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 funcBind = function (scope, f) {
- return function () {
- return f ? f.apply(scope, arguments) : undefined;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isInsideElementContentArea = function (bodyElm, clientX, clientY) {
+ var clientWidth = getClientWidth(bodyElm);
+ var clientHeight = getClientHeight(bodyElm);
+ return clientX >= 0 && clientY >= 0 && clientX <= clientWidth && clientY <= clientHeight;
+ };
+ var transpose = function (inline, elm, clientX, clientY) {
+ var clientRect = getBoundingClientRect$1(elm);
+ var deltaX = inline ? clientRect.left + elm.dom().clientLeft + getMarginLeft(elm) : 0;
+ var deltaY = inline ? clientRect.top + elm.dom().clientTop + getMarginTop(elm) : 0;
+ var x = clientX - deltaX;
+ var y = clientY - deltaY;
+ return {
+ x: x,
+ y: y
</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">- var fireOpenEvent = function (win) {
- editor.fire('OpenWindow', { win: win });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isXYInContentArea = function (editor, clientX, clientY) {
+ var bodyElm = Element$$1.fromDom(editor.getBody());
+ var targetElm = editor.inline ? bodyElm : documentElement(bodyElm);
+ var transposedPoint = transpose(editor.inline, targetElm, clientX, clientY);
+ return isInsideElementContentArea(targetElm, transposedPoint.x, transposedPoint.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">- var fireCloseEvent = function (win) {
- editor.fire('CloseWindow', { win: win });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fromDomSafe = function (node) {
+ return Option.from(node).map(Element$$1.fromDom);
</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 addWindow = function (win) {
- windows.push(win);
- fireOpenEvent(win);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isEditorAttachedToDom = function (editor) {
+ var rawContainer = editor.inline ? editor.getBody() : editor.getContentAreaContainer();
+ return fromDomSafe(rawContainer).map(function (container) {
+ return contains$3(owner(container), container);
+ }).getOr(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 closeWindow = function (win) {
- findIndex(windows, function (otherWindow) {
- return otherWindow === win;
- }).each(function (index) {
- windows.splice(index, 1);
- fireCloseEvent(win);
- if (windows.length === 0) {
- editor.focus();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var EditorView = {
+ isXYInContentArea: isXYInContentArea,
+ isEditorAttachedToDom: isEditorAttachedToDom
+ };
+
+ function NotificationManagerImpl () {
+ var unimplemented = function () {
+ throw new Error('Theme did not provide a NotificationManager implementation.');
+ };
+ return {
+ open: unimplemented,
+ close: unimplemented,
+ reposition: unimplemented,
+ getArgs: unimplemented
+ };
+ }
+
+ function NotificationManager (editor) {
+ var notifications = [];
+ var getImplementation = function () {
+ var theme = editor.theme;
+ return theme && theme.getNotificationManagerImpl ? theme.getNotificationManagerImpl() : NotificationManagerImpl();
+ };
+ var getTopNotification = function () {
+ return Option.from(notifications[0]);
+ };
+ var isEqual = function (a, b) {
+ return a.type === b.type && a.text === b.text && !a.progressBar && !a.timeout && !b.progressBar && !b.timeout;
+ };
+ var reposition = function () {
+ if (notifications.length > 0) {
+ getImplementation().reposition(notifications);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var addNotification = function (notification) {
+ notifications.push(notification);
+ };
+ var closeNotification = function (notification) {
+ findIndex(notifications, function (otherNotification) {
+ return otherNotification === notification;
+ }).each(function (index) {
+ notifications.splice(index, 1);
+ });
+ };
+ var open = function (args) {
+ if (editor.removed || !EditorView.isEditorAttachedToDom(editor)) {
+ return;
+ }
+ return find(notifications, function (notification) {
+ return isEqual(getImplementation().getArgs(notification), args);
+ }).getOrThunk(function () {
+ editor.editorManager.setActive(editor);
+ var notification = getImplementation().open(args, function () {
+ closeNotification(notification);
+ reposition();
+ });
+ addNotification(notification);
+ reposition();
+ return notification;
+ });
+ };
+ var close = function () {
+ getTopNotification().each(function (notification) {
+ getImplementation().close(notification);
+ closeNotification(notification);
+ reposition();
+ });
+ };
+ var getNotifications = function () {
+ return notifications;
+ };
+ var registerEvents = function (editor) {
+ editor.on('SkinLoaded', function () {
+ var serviceMessage = editor.settings.service_message;
+ if (serviceMessage) {
+ open({
+ text: serviceMessage,
+ type: 'warning',
+ timeout: 0,
+ icon: ''
+ });
+ }
+ });
+ editor.on('ResizeEditor ResizeWindow', function () {
+ Delay.requestAnimationFrame(reposition);
+ });
+ editor.on('remove', function () {
+ each(notifications.slice(), function (notification) {
+ getImplementation().close(notification);
+ });
+ });
+ };
+ registerEvents(editor);
+ return {
+ open: open,
+ close: close,
+ getNotifications: getNotifications
+ };
+ }
+
+ function WindowManagerImpl () {
+ var unimplemented = function () {
+ throw new Error('Theme did not provide a WindowManager implementation.');
+ };
+ return {
+ open: unimplemented,
+ alert: unimplemented,
+ confirm: unimplemented,
+ close: unimplemented,
+ getParams: unimplemented,
+ setParams: unimplemented
+ };
+ }
+
+ function WindowManager (editor) {
+ var windows = [];
+ var getImplementation = function () {
+ var theme = editor.theme;
+ return theme && theme.getWindowManagerImpl ? theme.getWindowManagerImpl() : WindowManagerImpl();
+ };
+ var funcBind = function (scope, f) {
+ return function () {
+ return f ? f.apply(scope, arguments) : undefined;
+ };
+ };
+ var fireOpenEvent = function (win) {
+ editor.fire('OpenWindow', { win: win });
+ };
+ var fireCloseEvent = function (win) {
+ editor.fire('CloseWindow', { win: win });
+ };
+ var addWindow = function (win) {
+ windows.push(win);
+ fireOpenEvent(win);
+ };
+ var closeWindow = function (win) {
+ findIndex(windows, function (otherWindow) {
+ return otherWindow === win;
+ }).each(function (index) {
+ windows.splice(index, 1);
+ fireCloseEvent(win);
+ if (windows.length === 0) {
+ editor.focus();
+ }
+ });
+ };
+ var getTopWindow = function () {
+ return Option.from(windows[windows.length - 1]);
+ };
+ var open = function (args, params) {
+ editor.editorManager.setActive(editor);
+ SelectionBookmark.store(editor);
+ var win = getImplementation().open(args, params, closeWindow);
+ addWindow(win);
+ return win;
+ };
+ var alert = function (message, callback, scope) {
+ var win = getImplementation().alert(message, funcBind(scope ? scope : this, callback), closeWindow);
+ addWindow(win);
+ };
+ var confirm = function (message, callback, scope) {
+ var win = getImplementation().confirm(message, funcBind(scope ? scope : this, callback), closeWindow);
+ addWindow(win);
+ };
+ var close = function () {
+ getTopWindow().each(function (win) {
+ getImplementation().close(win);
+ closeWindow(win);
+ });
+ };
+ var getParams = function () {
+ return getTopWindow().map(getImplementation().getParams).getOr(null);
+ };
+ var setParams = function (params) {
+ getTopWindow().each(function (win) {
+ getImplementation().setParams(win, params);
+ });
+ };
+ var getWindows = function () {
+ return windows;
+ };
+ editor.on('remove', function () {
+ each(windows.slice(0), function (win) {
+ getImplementation().close(win);
+ });
</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 {
+ windows: windows,
+ open: open,
+ alert: alert,
+ confirm: confirm,
+ close: close,
+ getParams: getParams,
+ setParams: setParams,
+ getWindows: getWindows
+ };
+ }
+
+ var PluginManager = AddOnManager.PluginManager;
+ var resolvePluginName = function (targetUrl, suffix) {
+ for (var name$$1 in PluginManager.urls) {
+ var matchUrl = PluginManager.urls[name$$1] + '/plugin' + suffix + '.js';
+ if (matchUrl === targetUrl) {
+ return name$$1;
+ }
+ }
+ return 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">- var getTopWindow = function () {
- return Option.from(windows[windows.length - 1]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var pluginUrlToMessage = function (editor, url) {
+ var plugin = resolvePluginName(url, editor.suffix);
+ return plugin ? 'Failed to load plugin: ' + plugin + ' from url ' + url : 'Failed to load plugin url: ' + 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">- var open = function (args, params) {
- editor.editorManager.setActive(editor);
- $_4wtqbt4ljjgwe8gy.store(editor);
- var win = getImplementation().open(args, params, closeWindow);
- addWindow(win);
- return win;
- };
- var alert = function (message, callback, scope) {
- var win = getImplementation().alert(message, funcBind(scope ? scope : this, callback), closeWindow);
- addWindow(win);
- };
- var confirm = function (message, callback, scope) {
- var win = getImplementation().confirm(message, funcBind(scope ? scope : this, callback), closeWindow);
- addWindow(win);
- };
- var close = function () {
- getTopWindow().each(function (win) {
- getImplementation().close(win);
- closeWindow(win);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var displayNotification = function (editor, message) {
+ editor.notificationManager.open({
+ type: 'error',
+ text: message
</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">- var getParams = function () {
- return getTopWindow().map(getImplementation().getParams).getOr(null);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var displayError = function (editor, message) {
+ if (editor._skinLoaded) {
+ displayNotification(editor, message);
+ } else {
+ editor.on('SkinLoaded', function () {
+ displayNotification(editor, message);
+ });
+ }
</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 setParams = function (params) {
- getTopWindow().each(function (win) {
- getImplementation().setParams(win, params);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var uploadError = function (editor, message) {
+ displayError(editor, 'Failed to upload image: ' + message);
</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 getWindows = function () {
- return windows;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var pluginLoadError = function (editor, url) {
+ displayError(editor, pluginUrlToMessage(editor, 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">- editor.on('remove', function () {
- each(windows.slice(0), function (win) {
- getImplementation().close(win);
- });
- });
- return {
- windows: windows,
- open: open,
- alert: alert,
- confirm: confirm,
- close: close,
- getParams: getParams,
- setParams: setParams,
- getWindows: getWindows
- };
- }
-
- var PluginManager = AddOnManager.PluginManager;
- var resolvePluginName = function (targetUrl, suffix) {
- for (var name$$1 in PluginManager.urls) {
- var matchUrl = PluginManager.urls[name$$1] + '/plugin' + suffix + '.js';
- if (matchUrl === targetUrl) {
- return name$$1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var initError = function (message) {
+ var x = [];
+ for (var _i = 1; _i < arguments.length; _i++) {
+ x[_i - 1] = arguments[_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">- }
- return null;
- };
- var pluginUrlToMessage = function (editor, url) {
- var plugin = resolvePluginName(url, editor.suffix);
- return plugin ? 'Failed to load plugin: ' + plugin + ' from url ' + url : 'Failed to load plugin url: ' + url;
- };
- var displayNotification = function (editor, message) {
- editor.notificationManager.open({
- type: 'error',
- text: message
- });
- };
- var displayError = function (editor, message) {
- if (editor._skinLoaded) {
- displayNotification(editor, message);
- } else {
- editor.on('SkinLoaded', function () {
- displayNotification(editor, message);
- });
- }
- };
- var uploadError = function (editor, message) {
- displayError(editor, 'Failed to upload image: ' + message);
- };
- var pluginLoadError = function (editor, url) {
- displayError(editor, pluginUrlToMessage(editor, url));
- };
- var initError = function (message) {
- var x = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- x[_i - 1] = arguments[_i];
- }
- var console$$1 = window.console;
- if (console$$1) {
- if (console$$1.error) {
- console$$1.error.apply(console$$1, arguments);
- } else {
- console$$1.log.apply(console$$1, arguments);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var console$$1 = window.console;
+ if (console$$1) {
+ if (console$$1.error) {
+ console$$1.error.apply(console$$1, arguments);
+ } else {
+ console$$1.log.apply(console$$1, 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">- }
- };
- var $_5ksiiu54jjgwe8k7 = {
- pluginLoadError: pluginLoadError,
- uploadError: uploadError,
- displayError: displayError,
- initError: initError
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var ErrorReporter = {
+ pluginLoadError: pluginLoadError,
+ uploadError: uploadError,
+ displayError: displayError,
+ initError: initError
+ };
</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 PluginManager$1 = AddOnManager.PluginManager;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var PluginManager$1 = AddOnManager.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">- var ThemeManager = AddOnManager.ThemeManager;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ThemeManager = AddOnManager.ThemeManager;
</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 XMLHttpRequest () {
- var f = $_6xhbl4cjjgwe7a3.getOrDie('XMLHttpRequest');
- return new f();
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function XMLHttpRequest () {
+ var f = Global$1.getOrDie('XMLHttpRequest');
+ return new f();
+ }
</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 Uploader (uploadStatus, settings) {
- var pendingPromises = {};
- var pathJoin = function (path1, path2) {
- if (path1) {
- return path1.replace(/\/$/, '') + '/' + path2.replace(/^\//, '');
- }
- return path2;
- };
- var defaultHandler = function (blobInfo, success, failure, progress) {
- var xhr, formData;
- xhr = new XMLHttpRequest();
- xhr.open('POST', settings.url);
- xhr.withCredentials = settings.credentials;
- xhr.upload.onprogress = function (e) {
- progress(e.loaded / e.total * 100);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function Uploader (uploadStatus, settings) {
+ var pendingPromises = {};
+ var pathJoin = function (path1, path2) {
+ if (path1) {
+ return path1.replace(/\/$/, '') + '/' + path2.replace(/^\//, '');
+ }
+ return path2;
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- xhr.onerror = function () {
- failure('Image upload failed due to a XHR Transport error. Code: ' + xhr.status);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var defaultHandler = function (blobInfo, success, failure, progress) {
+ var xhr, formData;
+ xhr = XMLHttpRequest();
+ xhr.open('POST', settings.url);
+ xhr.withCredentials = settings.credentials;
+ xhr.upload.onprogress = function (e) {
+ progress(e.loaded / e.total * 100);
+ };
+ xhr.onerror = function () {
+ failure('Image upload failed due to a XHR Transport error. Code: ' + xhr.status);
+ };
+ xhr.onload = function () {
+ var json;
+ if (xhr.status < 200 || xhr.status >= 300) {
+ failure('HTTP Error: ' + xhr.status);
+ return;
+ }
+ json = JSON.parse(xhr.responseText);
+ if (!json || typeof json.location !== 'string') {
+ failure('Invalid JSON: ' + xhr.responseText);
+ return;
+ }
+ success(pathJoin(settings.basePath, json.location));
+ };
+ formData = new FormData();
+ formData.append('file', blobInfo.blob(), blobInfo.filename());
+ xhr.send(formData);
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- xhr.onload = function () {
- var json;
- if (xhr.status < 200 || xhr.status >= 300) {
- failure('HTTP Error: ' + xhr.status);
- return;
- }
- json = JSON.parse(xhr.responseText);
- if (!json || typeof json.location !== 'string') {
- failure('Invalid JSON: ' + xhr.responseText);
- return;
- }
- success(pathJoin(settings.basePath, json.location));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var noUpload = function () {
+ return new promiseObj(function (resolve) {
+ 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">- formData = new FormData();
- formData.append('file', blobInfo.blob(), blobInfo.filename());
- xhr.send(formData);
- };
- var noUpload = function () {
- return new promiseObj(function (resolve) {
- resolve([]);
- });
- };
- var handlerSuccess = function (blobInfo, url) {
- return {
- url: url,
- blobInfo: blobInfo,
- status: true
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var handlerSuccess = function (blobInfo, url) {
+ return {
+ url: url,
+ blobInfo: blobInfo,
+ status: 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">- };
- var handlerFailure = function (blobInfo, error) {
- return {
- url: '',
- blobInfo: blobInfo,
- status: false,
- error: error
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var handlerFailure = function (blobInfo, error) {
+ return {
+ url: '',
+ blobInfo: blobInfo,
+ status: false,
+ error: error
+ };
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var resolvePending = function (blobUri, result) {
+ Tools.each(pendingPromises[blobUri], function (resolve) {
+ resolve(result);
+ });
+ delete pendingPromises[blobUri];
+ };
+ var uploadBlobInfo = function (blobInfo, handler, openNotification) {
+ uploadStatus.markPending(blobInfo.blobUri());
+ return new promiseObj(function (resolve) {
+ var notification, progress;
+ var noop = function () {
+ };
+ try {
+ var closeNotification_1 = function () {
+ if (notification) {
+ notification.close();
+ progress = noop;
+ }
+ };
+ var success = function (url) {
+ closeNotification_1();
+ uploadStatus.markUploaded(blobInfo.blobUri(), url);
+ resolvePending(blobInfo.blobUri(), handlerSuccess(blobInfo, url));
+ resolve(handlerSuccess(blobInfo, url));
+ };
+ var failure = function (error) {
+ closeNotification_1();
+ uploadStatus.removeFailed(blobInfo.blobUri());
+ resolvePending(blobInfo.blobUri(), handlerFailure(blobInfo, error));
+ resolve(handlerFailure(blobInfo, error));
+ };
+ progress = function (percent) {
+ if (percent < 0 || percent > 100) {
+ return;
+ }
+ if (!notification) {
+ notification = openNotification();
+ }
+ notification.progressBar.value(percent);
+ };
+ handler(blobInfo, success, failure, progress);
+ } catch (ex) {
+ resolve(handlerFailure(blobInfo, ex.message));
+ }
+ });
+ };
+ var isDefaultHandler = function (handler) {
+ return handler === defaultHandler;
+ };
+ var pendingUploadBlobInfo = function (blobInfo) {
+ var blobUri = blobInfo.blobUri();
+ return new promiseObj(function (resolve) {
+ pendingPromises[blobUri] = pendingPromises[blobUri] || [];
+ pendingPromises[blobUri].push(resolve);
+ });
+ };
+ var uploadBlobs = function (blobInfos, openNotification) {
+ blobInfos = Tools.grep(blobInfos, function (blobInfo) {
+ return !uploadStatus.isUploaded(blobInfo.blobUri());
+ });
+ return promiseObj.all(Tools.map(blobInfos, function (blobInfo) {
+ return uploadStatus.isPending(blobInfo.blobUri()) ? pendingUploadBlobInfo(blobInfo) : uploadBlobInfo(blobInfo, settings.handler, openNotification);
+ }));
+ };
+ var upload = function (blobInfos, openNotification) {
+ return !settings.url && isDefaultHandler(settings.handler) ? noUpload() : uploadBlobs(blobInfos, openNotification);
+ };
+ if (isFunction(settings.handler) === false) {
+ settings.handler = defaultHandler;
+ }
+ return { upload: upload };
+ }
+
+ function FileReader () {
+ var f = Global$1.getOrDie('FileReader');
+ return new f();
+ }
+
+ function Uint8Array (arr) {
+ var f = Global$1.getOrDie('Uint8Array');
+ return new f(arr);
+ }
+
+ var requestAnimationFrame$1 = function (callback) {
+ var f = Global$1.getOrDie('requestAnimationFrame');
+ f(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">- var resolvePending = function (blobUri, result) {
- $_6cwiepljjgwe7j4.each(pendingPromises[blobUri], function (resolve) {
- resolve(result);
- });
- delete pendingPromises[blobUri];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var atob = function (base64) {
+ var f = Global$1.getOrDie('atob');
+ return f(base64);
</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 uploadBlobInfo = function (blobInfo, handler, openNotification) {
- uploadStatus.markPending(blobInfo.blobUri());
- return new promiseObj(function (resolve) {
- var notification, progress;
- var noop = function () {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Window = {
+ atob: atob,
+ requestAnimationFrame: requestAnimationFrame$1
+ };
+
+ var blobUriToBlob = function (url) {
+ return new promiseObj(function (resolve, reject) {
+ var rejectWithError = function () {
+ reject('Cannot convert ' + url + ' to Blob. Resource might not exist or is inaccessible.');
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px"> try {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var closeNotification_1 = function () {
- if (notification) {
- notification.close();
- progress = noop;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var xhr = XMLHttpRequest();
+ xhr.open('GET', url, true);
+ xhr.responseType = 'blob';
+ xhr.onload = function () {
+ if (this.status === 200) {
+ resolve(this.response);
+ } else {
+ rejectWithError();
</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">- var success = function (url) {
- closeNotification_1();
- uploadStatus.markUploaded(blobInfo.blobUri(), url);
- resolvePending(blobInfo.blobUri(), handlerSuccess(blobInfo, url));
- resolve(handlerSuccess(blobInfo, url));
- };
- var failure = function (error) {
- closeNotification_1();
- uploadStatus.removeFailed(blobInfo.blobUri());
- resolvePending(blobInfo.blobUri(), handlerFailure(blobInfo, error));
- resolve(handlerFailure(blobInfo, error));
- };
- progress = function (percent) {
- if (percent < 0 || percent > 100) {
- return;
- }
- if (!notification) {
- notification = openNotification();
- }
- notification.progressBar.value(percent);
- };
- handler(blobInfo, success, failure, progress);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ xhr.onerror = rejectWithError;
+ xhr.send();
</ins><span class="cx" style="display: block; padding: 0 10px"> } catch (ex) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- resolve(handlerFailure(blobInfo, ex.message));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rejectWithError();
</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">- var isDefaultHandler = function (handler) {
- return handler === defaultHandler;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var parseDataUri = function (uri) {
+ var type, matches;
+ var uriParts = decodeURIComponent(uri).split(',');
+ matches = /data:([^;]+)/.exec(uriParts[0]);
+ if (matches) {
+ type = matches[1];
+ }
+ return {
+ type: type,
+ data: uriParts[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">- var pendingUploadBlobInfo = function (blobInfo) {
- var blobUri = blobInfo.blobUri();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var dataUriToBlob = function (uri) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return new promiseObj(function (resolve) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- pendingPromises[blobUri] = pendingPromises[blobUri] || [];
- pendingPromises[blobUri].push(resolve);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var str, arr, i;
+ var uriParts = parseDataUri(uri);
+ try {
+ str = Window.atob(uriParts.data);
+ } catch (e) {
+ resolve(new Blob([]));
+ return;
+ }
+ arr = Uint8Array(str.length);
+ for (i = 0; i < arr.length; i++) {
+ arr[i] = str.charCodeAt(i);
+ }
+ resolve(new Blob([arr], { type: uriParts.type }));
</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">- var uploadBlobs = function (blobInfos, openNotification) {
- blobInfos = $_6cwiepljjgwe7j4.grep(blobInfos, function (blobInfo) {
- return !uploadStatus.isUploaded(blobInfo.blobUri());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var uriToBlob = function (url) {
+ if (url.indexOf('blob:') === 0) {
+ return blobUriToBlob(url);
+ }
+ if (url.indexOf('data:') === 0) {
+ return dataUriToBlob(url);
+ }
+ return null;
+ };
+ var blobToDataUri = function (blob) {
+ return new promiseObj(function (resolve) {
+ var reader = FileReader();
+ reader.onloadend = function () {
+ resolve(reader.result);
+ };
+ reader.readAsDataURL(blob);
</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 promiseObj.all($_6cwiepljjgwe7j4.map(blobInfos, function (blobInfo) {
- return uploadStatus.isPending(blobInfo.blobUri()) ? pendingUploadBlobInfo(blobInfo) : uploadBlobInfo(blobInfo, settings.handler, openNotification);
- }));
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var upload = function (blobInfos, openNotification) {
- return !settings.url && isDefaultHandler(settings.handler) ? noUpload() : uploadBlobs(blobInfos, openNotification);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Conversions = {
+ uriToBlob: uriToBlob,
+ blobToDataUri: blobToDataUri,
+ parseDataUri: parseDataUri
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- settings = $_6cwiepljjgwe7j4.extend({
- credentials: false,
- handler: defaultHandler
- }, settings);
- return { upload: upload };
- }
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function Blob (parts, properties) {
- var f = $_6xhbl4cjjgwe7a3.getOrDie('Blob');
- return new f(parts, properties);
- }
-
- function FileReader () {
- var f = $_6xhbl4cjjgwe7a3.getOrDie('FileReader');
- return new f();
- }
-
- function Uint8Array (arr) {
- var f = $_6xhbl4cjjgwe7a3.getOrDie('Uint8Array');
- return new f(arr);
- }
-
- var requestAnimationFrame$1 = function (callback) {
- var f = $_6xhbl4cjjgwe7a3.getOrDie('requestAnimationFrame');
- f(callback);
- };
- var atob = function (base64) {
- var f = $_6xhbl4cjjgwe7a3.getOrDie('atob');
- return f(base64);
- };
- var $_dx5bag5hjjgwe8lz = {
- atob: atob,
- requestAnimationFrame: requestAnimationFrame$1
- };
-
- var blobUriToBlob = function (url) {
- return new promiseObj(function (resolve, reject) {
- var rejectWithError = function () {
- reject('Cannot convert ' + url + ' to Blob. Resource might not exist or is inaccessible.');
- };
- try {
- var xhr = new XMLHttpRequest();
- xhr.open('GET', url, true);
- xhr.responseType = 'blob';
- xhr.onload = function () {
- if (this.status === 200) {
- resolve(this.response);
- } else {
- rejectWithError();
- }
- };
- xhr.onerror = rejectWithError;
- xhr.send();
- } catch (ex) {
- rejectWithError();
- }
- });
- };
- var parseDataUri = function (uri) {
- var type, matches;
- uri = decodeURIComponent(uri).split(',');
- matches = /data:([^;]+)/.exec(uri[0]);
- if (matches) {
- type = matches[1];
- }
- return {
- type: type,
- data: uri[1]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var count = 0;
+ var uniqueId = function (prefix) {
+ return (prefix || 'blobid') + count++;
</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 dataUriToBlob = function (uri) {
- return new promiseObj(function (resolve) {
- var str, arr, i;
- uri = parseDataUri(uri);
- try {
- str = $_dx5bag5hjjgwe8lz.atob(uri.data);
- } catch (e) {
- resolve(new Blob([]));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var imageToBlobInfo = function (blobCache, img, resolve, reject) {
+ var base64, blobInfo;
+ if (img.src.indexOf('blob:') === 0) {
+ blobInfo = blobCache.getByUri(img.src);
+ if (blobInfo) {
+ resolve({
+ image: img,
+ blobInfo: blobInfo
+ });
+ } else {
+ Conversions.uriToBlob(img.src).then(function (blob) {
+ Conversions.blobToDataUri(blob).then(function (dataUri) {
+ base64 = Conversions.parseDataUri(dataUri).data;
+ blobInfo = blobCache.create(uniqueId(), blob, base64);
+ blobCache.add(blobInfo);
+ resolve({
+ image: img,
+ blobInfo: blobInfo
+ });
+ });
+ }, function (err) {
+ reject(err);
+ });
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- arr = new Uint8Array(str.length);
- for (i = 0; i < arr.length; i++) {
- arr[i] = str.charCodeAt(i);
- }
- resolve(new Blob([arr], { type: uri.type }));
- });
- };
- var uriToBlob = function (url) {
- if (url.indexOf('blob:') === 0) {
- return blobUriToBlob(url);
- }
- if (url.indexOf('data:') === 0) {
- return dataUriToBlob(url);
- }
- return null;
- };
- var blobToDataUri = function (blob) {
- return new promiseObj(function (resolve) {
- var reader = new FileReader();
- reader.onloadend = function () {
- resolve(reader.result);
- };
- reader.readAsDataURL(blob);
- });
- };
- var $_5vfmmd5djjgwe8ln = {
- uriToBlob: uriToBlob,
- blobToDataUri: blobToDataUri,
- parseDataUri: parseDataUri
- };
-
- var count = 0;
- var uniqueId = function (prefix) {
- return (prefix || 'blobid') + count++;
- };
- var imageToBlobInfo = function (blobCache, img, resolve, reject) {
- var base64, blobInfo;
- if (img.src.indexOf('blob:') === 0) {
- blobInfo = blobCache.getByUri(img.src);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ base64 = Conversions.parseDataUri(img.src).data;
+ blobInfo = blobCache.findFirst(function (cachedBlobInfo) {
+ return cachedBlobInfo.base64() === base64;
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> if (blobInfo) {
</span><span class="cx" style="display: block; padding: 0 10px"> resolve({
</span><span class="cx" style="display: block; padding: 0 10px"> image: img,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -15622,1782 +14698,1808 @@
</span><span class="cx" style="display: block; padding: 0 10px"> blobInfo: blobInfo
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_5vfmmd5djjgwe8ln.uriToBlob(img.src).then(function (blob) {
- $_5vfmmd5djjgwe8ln.blobToDataUri(blob).then(function (dataUri) {
- base64 = $_5vfmmd5djjgwe8ln.parseDataUri(dataUri).data;
- blobInfo = blobCache.create(uniqueId(), blob, base64);
- blobCache.add(blobInfo);
- resolve({
- image: img,
- blobInfo: blobInfo
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Conversions.uriToBlob(img.src).then(function (blob) {
+ blobInfo = blobCache.create(uniqueId(), blob, base64);
+ blobCache.add(blobInfo);
+ resolve({
+ image: img,
+ blobInfo: blobInfo
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> }, function (err) {
</span><span class="cx" style="display: block; padding: 0 10px"> reject(err);
</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">- return;
- }
- base64 = $_5vfmmd5djjgwe8ln.parseDataUri(img.src).data;
- blobInfo = blobCache.findFirst(function (cachedBlobInfo) {
- return cachedBlobInfo.base64() === base64;
- });
- if (blobInfo) {
- resolve({
- image: img,
- blobInfo: blobInfo
- });
- } else {
- $_5vfmmd5djjgwe8ln.uriToBlob(img.src).then(function (blob) {
- blobInfo = blobCache.create(uniqueId(), blob, base64);
- blobCache.add(blobInfo);
- resolve({
- image: img,
- blobInfo: blobInfo
- });
- }, function (err) {
- reject(err);
- });
- }
- };
- var getAllImages = function (elm) {
- return elm ? elm.getElementsByTagName('img') : [];
- };
- function ImageScanner (uploadStatus, blobCache) {
- var cachedPromises = {};
- var findAll = function (elm, predicate) {
- var images;
- if (!predicate) {
- predicate = $_4127e12ljjgwe7ww.constant(true);
- }
- images = $_6t4axrmjjgwe7jf.filter(getAllImages(elm), function (img) {
- var src = img.src;
- if (!$_bcvfv9ajjgwe79v.fileApi) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var getAllImages = function (elm) {
+ return elm ? from$1(elm.getElementsByTagName('img')) : [];
+ };
+ function ImageScanner (uploadStatus, blobCache) {
+ var cachedPromises = {};
+ var findAll = function (elm, predicate) {
+ var images;
+ if (!predicate) {
+ predicate = constant(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 (img.hasAttribute('data-mce-bogus')) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ images = filter(getAllImages(elm), function (img) {
+ var src = img.src;
+ if (!Env.fileApi) {
+ return false;
+ }
+ if (img.hasAttribute('data-mce-bogus')) {
+ return false;
+ }
+ if (img.hasAttribute('data-mce-placeholder')) {
+ return false;
+ }
+ if (!src || src === Env.transparentSrc) {
+ return false;
+ }
+ if (src.indexOf('blob:') === 0) {
+ return !uploadStatus.isUploaded(src) && predicate(img);
+ }
+ if (src.indexOf('data:') === 0) {
+ return predicate(img);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (img.hasAttribute('data-mce-placeholder')) {
- return false;
- }
- if (!src || src === $_bcvfv9ajjgwe79v.transparentSrc) {
- return false;
- }
- if (src.indexOf('blob:') === 0) {
- return !uploadStatus.isUploaded(src);
- }
- if (src.indexOf('data:') === 0) {
- return predicate(img);
- }
- return false;
- });
- var promises = $_6t4axrmjjgwe7jf.map(images, function (img) {
- if (cachedPromises[img.src]) {
- return new promiseObj(function (resolve) {
- cachedPromises[img.src].then(function (imageInfo) {
- if (typeof imageInfo === 'string') {
- return imageInfo;
- }
- resolve({
- image: img,
- blobInfo: imageInfo.blobInfo
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ var promises = map(images, function (img) {
+ if (cachedPromises[img.src]) {
+ return new promiseObj(function (resolve) {
+ cachedPromises[img.src].then(function (imageInfo) {
+ if (typeof imageInfo === 'string') {
+ return imageInfo;
+ }
+ resolve({
+ image: img,
+ blobInfo: imageInfo.blobInfo
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ var newPromise = new promiseObj(function (resolve, reject) {
+ imageToBlobInfo(blobCache, img, resolve, reject);
+ }).then(function (result) {
+ delete cachedPromises[result.image.src];
+ return result;
+ }).catch(function (error) {
+ delete cachedPromises[img.src];
+ return error;
</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 newPromise = new promiseObj(function (resolve, reject) {
- imageToBlobInfo(blobCache, img, resolve, reject);
- }).then(function (result) {
- delete cachedPromises[result.image.src];
- return result;
- }).catch(function (error) {
- delete cachedPromises[img.src];
- return error;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ cachedPromises[img.src] = newPromise;
+ return newPromise;
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- cachedPromises[img.src] = newPromise;
- return newPromise;
- });
- return promiseObj.all(promises);
- };
- return { findAll: findAll };
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return promiseObj.all(promises);
+ };
+ return { findAll: findAll };
+ }
</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 count$1 = 0;
- var seed = function () {
- var rnd = function () {
- return Math.round(Math.random() * 4294967295).toString(36);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var count$1 = 0;
+ var seed = function () {
+ var rnd = function () {
+ return Math.round(Math.random() * 4294967295).toString(36);
+ };
+ var now = new Date().getTime();
+ return 's' + now.toString(36) + rnd() + rnd() + rnd();
</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 now = new Date().getTime();
- return 's' + now.toString(36) + rnd() + rnd() + rnd();
- };
- var uuid = function (prefix) {
- return prefix + count$1++ + seed();
- };
- var $_637o4x5jjjgwe8m5 = { uuid: uuid };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var uuid = function (prefix) {
+ return prefix + count$1++ + seed();
+ };
+ var Uuid = { uuid: uuid };
</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 BlobCache () {
- var cache = [];
- var constant = $_4127e12ljjgwe7ww.constant;
- var mimeToExt = function (mime) {
- var mimes = {
- 'image/jpeg': 'jpg',
- 'image/jpg': 'jpg',
- 'image/gif': 'gif',
- 'image/png': 'png'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function BlobCache () {
+ var cache = [];
+ var mimeToExt = function (mime) {
+ var mimes = {
+ 'image/jpeg': 'jpg',
+ 'image/jpg': 'jpg',
+ 'image/gif': 'gif',
+ 'image/png': 'png'
+ };
+ return mimes[mime.toLowerCase()] || 'dat';
</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 mimes[mime.toLowerCase()] || 'dat';
- };
- var create = function (o, blob, base64, filename) {
- return typeof o === 'object' ? toBlobInfo(o) : toBlobInfo({
- id: o,
- name: filename,
- blob: blob,
- base64: base64
- });
- };
- var toBlobInfo = function (o) {
- var id, name;
- if (!o.blob || !o.base64) {
- throw new Error('blob and base64 representations of the image are required for BlobInfo to be created');
- }
- id = o.id || $_637o4x5jjjgwe8m5.uuid('blobid');
- name = o.name || id;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var create = function (o, blob, base64, filename) {
+ if (isString(o)) {
+ var id = o;
+ return toBlobInfo({
+ id: id,
+ name: filename,
+ blob: blob,
+ base64: base64
+ });
+ } else if (isObject(o)) {
+ return toBlobInfo(o);
+ } else {
+ throw new Error('Unknown input type');
+ }
+ };
+ var toBlobInfo = function (o) {
+ var id, name;
+ if (!o.blob || !o.base64) {
+ throw new Error('blob and base64 representations of the image are required for BlobInfo to be created');
+ }
+ id = o.id || Uuid.uuid('blobid');
+ name = o.name || id;
+ return {
+ id: constant(id),
+ name: constant(name),
+ filename: constant(name + '.' + mimeToExt(o.blob.type)),
+ blob: constant(o.blob),
+ base64: constant(o.base64),
+ blobUri: constant(o.blobUri || URL.createObjectURL(o.blob)),
+ uri: constant(o.uri)
+ };
+ };
+ var add = function (blobInfo) {
+ if (!get(blobInfo.id())) {
+ cache.push(blobInfo);
+ }
+ };
+ var get = function (id) {
+ return findFirst(function (cachedBlobInfo) {
+ return cachedBlobInfo.id() === id;
+ });
+ };
+ var findFirst = function (predicate) {
+ return filter(cache, predicate)[0];
+ };
+ var getByUri = function (blobUri) {
+ return findFirst(function (blobInfo) {
+ return blobInfo.blobUri() === blobUri;
+ });
+ };
+ var removeByUri = function (blobUri) {
+ cache = filter(cache, function (blobInfo) {
+ if (blobInfo.blobUri() === blobUri) {
+ URL.revokeObjectURL(blobInfo.blobUri());
+ return false;
+ }
+ return true;
+ });
+ };
+ var destroy = function () {
+ each(cache, function (cachedBlobInfo) {
+ URL.revokeObjectURL(cachedBlobInfo.blobUri());
+ });
+ cache = [];
+ };
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- id: constant(id),
- name: constant(name),
- filename: constant(name + '.' + mimeToExt(o.blob.type)),
- blob: constant(o.blob),
- base64: constant(o.base64),
- blobUri: constant(o.blobUri || $_r9uyubjjgwe7a2.createObjectURL(o.blob)),
- uri: constant(o.uri)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ create: create,
+ add: add,
+ get: get,
+ getByUri: getByUri,
+ findFirst: findFirst,
+ removeByUri: removeByUri,
+ destroy: destroy
</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 add = function (blobInfo) {
- if (!get(blobInfo.id())) {
- cache.push(blobInfo);
- }
- };
- var get = function (id) {
- return findFirst(function (cachedBlobInfo) {
- return cachedBlobInfo.id() === id;
- });
- };
- var findFirst = function (predicate) {
- return $_6t4axrmjjgwe7jf.filter(cache, predicate)[0];
- };
- var getByUri = function (blobUri) {
- return findFirst(function (blobInfo) {
- return blobInfo.blobUri() === blobUri;
- });
- };
- var removeByUri = function (blobUri) {
- cache = $_6t4axrmjjgwe7jf.filter(cache, function (blobInfo) {
- if (blobInfo.blobUri() === blobUri) {
- $_r9uyubjjgwe7a2.revokeObjectURL(blobInfo.blobUri());
- return false;
- }
- return true;
- });
- };
- var destroy = function () {
- $_6t4axrmjjgwe7jf.each(cache, function (cachedBlobInfo) {
- $_r9uyubjjgwe7a2.revokeObjectURL(cachedBlobInfo.blobUri());
- });
- cache = [];
- };
- return {
- create: create,
- add: add,
- get: get,
- getByUri: getByUri,
- findFirst: findFirst,
- removeByUri: removeByUri,
- destroy: destroy
- };
- }
</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">- function UploadStatus () {
- var PENDING = 1, UPLOADED = 2;
- var blobUriStatuses = {};
- var createStatus = function (status, resultUri) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function UploadStatus () {
+ var PENDING = 1, UPLOADED = 2;
+ var blobUriStatuses = {};
+ var createStatus = function (status, resultUri) {
+ return {
+ status: status,
+ resultUri: resultUri
+ };
+ };
+ var hasBlobUri = function (blobUri) {
+ return blobUri in blobUriStatuses;
+ };
+ var getResultUri = function (blobUri) {
+ var result = blobUriStatuses[blobUri];
+ return result ? result.resultUri : null;
+ };
+ var isPending = function (blobUri) {
+ return hasBlobUri(blobUri) ? blobUriStatuses[blobUri].status === PENDING : false;
+ };
+ var isUploaded = function (blobUri) {
+ return hasBlobUri(blobUri) ? blobUriStatuses[blobUri].status === UPLOADED : false;
+ };
+ var markPending = function (blobUri) {
+ blobUriStatuses[blobUri] = createStatus(PENDING, null);
+ };
+ var markUploaded = function (blobUri, resultUri) {
+ blobUriStatuses[blobUri] = createStatus(UPLOADED, resultUri);
+ };
+ var removeFailed = function (blobUri) {
+ delete blobUriStatuses[blobUri];
+ };
+ var destroy = function () {
+ blobUriStatuses = {};
+ };
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- status: status,
- resultUri: resultUri
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ hasBlobUri: hasBlobUri,
+ getResultUri: getResultUri,
+ isPending: isPending,
+ isUploaded: isUploaded,
+ markPending: markPending,
+ markUploaded: markUploaded,
+ removeFailed: removeFailed,
+ destroy: destroy
</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 hasBlobUri = function (blobUri) {
- return blobUri in blobUriStatuses;
- };
- var getResultUri = function (blobUri) {
- var result = blobUriStatuses[blobUri];
- return result ? result.resultUri : null;
- };
- var isPending = function (blobUri) {
- return hasBlobUri(blobUri) ? blobUriStatuses[blobUri].status === PENDING : false;
- };
- var isUploaded = function (blobUri) {
- return hasBlobUri(blobUri) ? blobUriStatuses[blobUri].status === UPLOADED : false;
- };
- var markPending = function (blobUri) {
- blobUriStatuses[blobUri] = createStatus(PENDING, null);
- };
- var markUploaded = function (blobUri, resultUri) {
- blobUriStatuses[blobUri] = createStatus(UPLOADED, resultUri);
- };
- var removeFailed = function (blobUri) {
- delete blobUriStatuses[blobUri];
- };
- var destroy = function () {
- blobUriStatuses = {};
- };
- return {
- hasBlobUri: hasBlobUri,
- getResultUri: getResultUri,
- isPending: isPending,
- isUploaded: isUploaded,
- markPending: markPending,
- markUploaded: markUploaded,
- removeFailed: removeFailed,
- destroy: destroy
- };
- }
</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">- function EditorUpload (editor) {
- var blobCache = BlobCache();
- var uploader, imageScanner;
- var settings = editor.settings;
- var uploadStatus = UploadStatus();
- var aliveGuard = function (callback) {
- return function (result) {
- if (editor.selection) {
- return callback(result);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function EditorUpload (editor) {
+ var blobCache = BlobCache();
+ var uploader, imageScanner;
+ var uploadStatus = UploadStatus();
+ var urlFilters = [];
+ var aliveGuard = function (callback) {
+ return function (result) {
+ if (editor.selection) {
+ return callback(result);
+ }
+ return [];
+ };
+ };
+ var cacheInvalidator = function () {
+ return '?' + new Date().getTime();
+ };
+ var replaceString = function (content, search, replace) {
+ var index = 0;
+ do {
+ index = content.indexOf(search, index);
+ if (index !== -1) {
+ content = content.substring(0, index) + replace + content.substr(index + search.length);
+ index += replace.length - search.length + 1;
+ }
+ } while (index !== -1);
+ return content;
+ };
+ var replaceImageUrl = function (content, targetUrl, replacementUrl) {
+ content = replaceString(content, 'src="' + targetUrl + '"', 'src="' + replacementUrl + '"');
+ content = replaceString(content, 'data-mce-src="' + targetUrl + '"', 'data-mce-src="' + replacementUrl + '"');
+ return content;
+ };
+ var replaceUrlInUndoStack = function (targetUrl, replacementUrl) {
+ each(editor.undoManager.data, function (level) {
+ if (level.type === 'fragmented') {
+ level.fragments = map(level.fragments, function (fragment) {
+ return replaceImageUrl(fragment, targetUrl, replacementUrl);
+ });
+ } else {
+ level.content = replaceImageUrl(level.content, targetUrl, replacementUrl);
+ }
+ });
+ };
+ var openNotification = function () {
+ return editor.notificationManager.open({
+ text: editor.translate('Image uploading...'),
+ type: 'info',
+ timeout: -1,
+ progressBar: true
+ });
+ };
+ var replaceImageUri = function (image, resultUri) {
+ blobCache.removeByUri(image.src);
+ replaceUrlInUndoStack(image.src, resultUri);
+ editor.$(image).attr({
+ 'src': Settings.shouldReuseFileName(editor) ? resultUri + cacheInvalidator() : resultUri,
+ 'data-mce-src': editor.convertURL(resultUri, 'src')
+ });
+ };
+ var uploadImages = function (callback) {
+ if (!uploader) {
+ uploader = Uploader(uploadStatus, {
+ url: Settings.getImageUploadUrl(editor),
+ basePath: Settings.getImageUploadBasePath(editor),
+ credentials: Settings.getImagesUploadCredentials(editor),
+ handler: Settings.getImagesUploadHandler(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 [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return scanForImages().then(aliveGuard(function (imageInfos) {
+ var blobInfos;
+ blobInfos = map(imageInfos, function (imageInfo) {
+ return imageInfo.blobInfo;
+ });
+ return uploader.upload(blobInfos, openNotification).then(aliveGuard(function (result) {
+ var filteredResult = map(result, function (uploadInfo, index) {
+ var image = imageInfos[index].image;
+ if (uploadInfo.status && Settings.shouldReplaceBlobUris(editor)) {
+ replaceImageUri(image, uploadInfo.url);
+ } else if (uploadInfo.error) {
+ ErrorReporter.uploadError(editor, uploadInfo.error);
+ }
+ return {
+ element: image,
+ status: uploadInfo.status
+ };
+ });
+ if (callback) {
+ callback(filteredResult);
+ }
+ return filteredResult;
+ }));
+ }));
</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 cacheInvalidator = function () {
- return '?' + new Date().getTime();
- };
- var replaceString = function (content, search, replace) {
- var index = 0;
- do {
- index = content.indexOf(search, index);
- if (index !== -1) {
- content = content.substring(0, index) + replace + content.substr(index + search.length);
- index += replace.length - search.length + 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var uploadImagesAuto = function (callback) {
+ if (Settings.isAutomaticUploadsEnabled(editor)) {
+ return uploadImages(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">- } while (index !== -1);
- return content;
- };
- var replaceImageUrl = function (content, targetUrl, replacementUrl) {
- content = replaceString(content, 'src="' + targetUrl + '"', 'src="' + replacementUrl + '"');
- content = replaceString(content, 'data-mce-src="' + targetUrl + '"', 'data-mce-src="' + replacementUrl + '"');
- return content;
- };
- var replaceUrlInUndoStack = function (targetUrl, replacementUrl) {
- $_6t4axrmjjgwe7jf.each(editor.undoManager.data, function (level) {
- if (level.type === 'fragmented') {
- level.fragments = $_6t4axrmjjgwe7jf.map(level.fragments, function (fragment) {
- return replaceImageUrl(fragment, targetUrl, replacementUrl);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var isValidDataUriImage = function (imgElm) {
+ if (forall(urlFilters, function (filter$$1) {
+ return filter$$1(imgElm);
+ }) === false) {
+ return false;
+ }
+ if (imgElm.getAttribute('src').indexOf('data:') === 0) {
+ var dataImgFilter = Settings.getImagesDataImgFilter(editor);
+ return dataImgFilter(imgElm);
+ }
+ return true;
+ };
+ var addFilter = function (filter$$1) {
+ urlFilters.push(filter$$1);
+ };
+ var scanForImages = function () {
+ if (!imageScanner) {
+ imageScanner = ImageScanner(uploadStatus, blobCache);
+ }
+ return imageScanner.findAll(editor.getBody(), isValidDataUriImage).then(aliveGuard(function (result) {
+ result = filter(result, function (resultItem) {
+ if (typeof resultItem === 'string') {
+ ErrorReporter.displayError(editor, resultItem);
+ return false;
+ }
+ 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">+ each(result, function (resultItem) {
+ replaceUrlInUndoStack(resultItem.image.src, resultItem.blobInfo.blobUri());
+ resultItem.image.src = resultItem.blobInfo.blobUri();
+ resultItem.image.removeAttribute('data-mce-src');
+ });
+ return result;
+ }));
+ };
+ var destroy = function () {
+ blobCache.destroy();
+ uploadStatus.destroy();
+ imageScanner = uploader = null;
+ };
+ var replaceBlobUris = function (content) {
+ return content.replace(/src="(blob:[^"]+)"/g, function (match, blobUri) {
+ var resultUri = uploadStatus.getResultUri(blobUri);
+ if (resultUri) {
+ return 'src="' + resultUri + '"';
+ }
+ var blobInfo = blobCache.getByUri(blobUri);
+ if (!blobInfo) {
+ blobInfo = foldl(editor.editorManager.get(), function (result, editor) {
+ return result || editor.editorUpload && editor.editorUpload.blobCache.getByUri(blobUri);
+ }, null);
+ }
+ if (blobInfo) {
+ var blob = blobInfo.blob();
+ return 'src="data:' + blob.type + ';base64,' + blobInfo.base64() + '"';
+ }
+ return match;
+ });
+ };
+ editor.on('setContent', function () {
+ if (Settings.isAutomaticUploadsEnabled(editor)) {
+ uploadImagesAuto();
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- level.content = replaceImageUrl(level.content, targetUrl, replacementUrl);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ scanForImages();
</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">- };
- var openNotification = function () {
- return editor.notificationManager.open({
- text: editor.translate('Image uploading...'),
- type: 'info',
- timeout: -1,
- progressBar: true
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('RawSaveContent', function (e) {
+ e.content = replaceBlobUris(e.content);
</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 replaceImageUri = function (image, resultUri) {
- blobCache.removeByUri(image.src);
- replaceUrlInUndoStack(image.src, resultUri);
- editor.$(image).attr({
- 'src': settings.images_reuse_filename ? resultUri + cacheInvalidator() : resultUri,
- 'data-mce-src': editor.convertURL(resultUri, 'src')
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('getContent', function (e) {
+ if (e.source_view || e.format === 'raw') {
+ return;
+ }
+ e.content = replaceBlobUris(e.content);
</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 uploadImages = function (callback) {
- if (!uploader) {
- uploader = Uploader(uploadStatus, {
- url: settings.images_upload_url,
- basePath: settings.images_upload_base_path,
- credentials: settings.images_upload_credentials,
- handler: settings.images_upload_handler
- });
- }
- return scanForImages().then(aliveGuard(function (imageInfos) {
- var blobInfos;
- blobInfos = $_6t4axrmjjgwe7jf.map(imageInfos, function (imageInfo) {
- return imageInfo.blobInfo;
- });
- return uploader.upload(blobInfos, openNotification).then(aliveGuard(function (result) {
- var filteredResult = $_6t4axrmjjgwe7jf.map(result, function (uploadInfo, index) {
- var image = imageInfos[index].image;
- if (uploadInfo.status && editor.settings.images_replace_blob_uris !== false) {
- replaceImageUri(image, uploadInfo.url);
- } else if (uploadInfo.error) {
- $_5ksiiu54jjgwe8k7.uploadError(editor, uploadInfo.error);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('PostRender', function () {
+ editor.parser.addNodeFilter('img', function (images) {
+ each(images, function (img) {
+ var src = img.attr('src');
+ if (blobCache.getByUri(src)) {
+ 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 {
- element: image,
- status: uploadInfo.status
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var resultUri = uploadStatus.getResultUri(src);
+ if (resultUri) {
+ img.attr('src', resultUri);
+ }
</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) {
- callback(filteredResult);
- }
- return filteredResult;
- }));
- }));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ });
+ return {
+ blobCache: blobCache,
+ addFilter: addFilter,
+ uploadImages: uploadImages,
+ uploadImagesAuto: uploadImagesAuto,
+ scanForImages: scanForImages,
+ destroy: destroy
+ };
+ }
+
+ var isBlockElement = function (blockElements, node) {
+ return blockElements.hasOwnProperty(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 uploadImagesAuto = function (callback) {
- if (settings.automatic_uploads !== false) {
- return uploadImages(callback);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isValidTarget = function (blockElements, node) {
+ if (NodeType.isText(node)) {
+ return true;
+ } else if (NodeType.isElement(node)) {
+ return !isBlockElement(blockElements, node) && !Bookmarks.isBookmarkNode(node);
+ } else {
+ return false;
</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">- var isValidDataUriImage = function (imgElm) {
- return settings.images_dataimg_filter ? settings.images_dataimg_filter(imgElm) : true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasBlockParent = function (blockElements, root, node) {
+ return exists(Parents.parents(Element$$1.fromDom(node), Element$$1.fromDom(root)), function (elm) {
+ return isBlockElement(blockElements, elm.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 scanForImages = function () {
- if (!imageScanner) {
- imageScanner = ImageScanner(uploadStatus, blobCache);
- }
- return imageScanner.findAll(editor.getBody(), isValidDataUriImage).then(aliveGuard(function (result) {
- result = $_6t4axrmjjgwe7jf.filter(result, function (resultItem) {
- if (typeof resultItem === 'string') {
- $_5ksiiu54jjgwe8k7.displayError(editor, resultItem);
- return false;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var shouldRemoveTextNode = function (blockElements, node) {
+ if (NodeType.isText(node)) {
+ if (node.nodeValue.length === 0) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- $_6t4axrmjjgwe7jf.each(result, function (resultItem) {
- replaceUrlInUndoStack(resultItem.image.src, resultItem.blobInfo.blobUri());
- resultItem.image.src = resultItem.blobInfo.blobUri();
- resultItem.image.removeAttribute('data-mce-src');
- });
- return result;
- }));
- };
- var destroy = function () {
- blobCache.destroy();
- uploadStatus.destroy();
- imageScanner = uploader = null;
- };
- var replaceBlobUris = function (content) {
- return content.replace(/src="(blob:[^"]+)"/g, function (match, blobUri) {
- var resultUri = uploadStatus.getResultUri(blobUri);
- if (resultUri) {
- return 'src="' + resultUri + '"';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if (/^\s+$/.test(node.nodeValue) && (!node.nextSibling || isBlockElement(blockElements, node.nextSibling))) {
+ 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">- var blobInfo = blobCache.getByUri(blobUri);
- if (!blobInfo) {
- blobInfo = $_6t4axrmjjgwe7jf.reduce(editor.editorManager.get(), function (result, editor) {
- return result || editor.editorUpload && editor.editorUpload.blobCache.getByUri(blobUri);
- }, null);
- }
- if (blobInfo) {
- return 'src="data:' + blobInfo.blob().type + ';base64,' + blobInfo.base64() + '"';
- }
- return match;
- });
</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">- editor.on('setContent', function () {
- if (editor.settings.automatic_uploads !== false) {
- uploadImagesAuto();
- } else {
- scanForImages();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var addRootBlocks = function (editor) {
+ var settings = editor.settings, dom = editor.dom, selection = editor.selection;
+ var schema = editor.schema, blockElements = schema.getBlockElements();
+ var node = selection.getStart();
+ var rootNode = editor.getBody();
+ var rng;
+ var startContainer, startOffset, endContainer, endOffset, rootBlockNode;
+ var tempNode, wrapped, restoreSelection;
+ var rootNodeName, forcedRootBlock;
+ forcedRootBlock = settings.forced_root_block;
+ if (!node || !NodeType.isElement(node) || !forcedRootBlock) {
+ 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">- });
- editor.on('RawSaveContent', function (e) {
- e.content = replaceBlobUris(e.content);
- });
- editor.on('getContent', function (e) {
- if (e.source_view || e.format === 'raw') {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rootNodeName = rootNode.nodeName.toLowerCase();
+ if (!schema.isValidChild(rootNodeName, forcedRootBlock.toLowerCase()) || hasBlockParent(blockElements, rootNode, node)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- e.content = replaceBlobUris(e.content);
- });
- editor.on('PostRender', function () {
- editor.parser.addNodeFilter('img', function (images) {
- $_6t4axrmjjgwe7jf.each(images, function (img) {
- var src = img.attr('src');
- if (blobCache.getByUri(src)) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rng = selection.getRng();
+ startContainer = rng.startContainer;
+ startOffset = rng.startOffset;
+ endContainer = rng.endContainer;
+ endOffset = rng.endOffset;
+ restoreSelection = EditorFocus.hasFocus(editor);
+ node = rootNode.firstChild;
+ while (node) {
+ if (isValidTarget(blockElements, node)) {
+ if (shouldRemoveTextNode(blockElements, node)) {
+ tempNode = node;
+ node = node.nextSibling;
+ dom.remove(tempNode);
+ continue;
</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 resultUri = uploadStatus.getResultUri(src);
- if (resultUri) {
- img.attr('src', resultUri);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!rootBlockNode) {
+ rootBlockNode = dom.create(forcedRootBlock, editor.settings.forced_root_block_attrs);
+ node.parentNode.insertBefore(rootBlockNode, node);
+ wrapped = 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 {
- blobCache: blobCache,
- uploadImages: uploadImages,
- uploadImagesAuto: uploadImagesAuto,
- scanForImages: scanForImages,
- destroy: destroy
- };
- }
-
- var isBlockElement = function (blockElements, node) {
- return blockElements.hasOwnProperty(node.nodeName);
- };
- var isValidTarget = function (blockElements, node) {
- if ($_3b9u2y1rjjgwe7qe.isText(node)) {
- return true;
- } else if ($_3b9u2y1rjjgwe7qe.isElement(node)) {
- return !isBlockElement(blockElements, node) && !$_6refgt2vjjgwe7yn.isBookmarkNode(node);
- } else {
- return false;
- }
- };
- var hasBlockParent = function (blockElements, root, node) {
- return exists($_cvft7x3zjjgwe8bh.parents(Element$$1.fromDom(node), Element$$1.fromDom(root)), function (elm) {
- return isBlockElement(blockElements, elm.dom());
- });
- };
- var shouldRemoveTextNode = function (blockElements, node) {
- if ($_3b9u2y1rjjgwe7qe.isText(node)) {
- if (node.nodeValue.length === 0) {
- return true;
- } else if (/^\s+$/.test(node.nodeValue) && (!node.nextSibling || isBlockElement(blockElements, node.nextSibling))) {
- return true;
- }
- }
- return false;
- };
- var addRootBlocks = function (editor) {
- var settings = editor.settings, dom = editor.dom, selection = editor.selection;
- var schema = editor.schema, blockElements = schema.getBlockElements();
- var node = selection.getStart();
- var rootNode = editor.getBody();
- var rng;
- var startContainer, startOffset, endContainer, endOffset, rootBlockNode;
- var tempNode, wrapped, restoreSelection;
- var rootNodeName, forcedRootBlock;
- forcedRootBlock = settings.forced_root_block;
- if (!node || !$_3b9u2y1rjjgwe7qe.isElement(node) || !forcedRootBlock) {
- return;
- }
- rootNodeName = rootNode.nodeName.toLowerCase();
- if (!schema.isValidChild(rootNodeName, forcedRootBlock.toLowerCase()) || hasBlockParent(blockElements, rootNode, node)) {
- return;
- }
- rng = selection.getRng();
- startContainer = rng.startContainer;
- startOffset = rng.startOffset;
- endContainer = rng.endContainer;
- endOffset = rng.endOffset;
- restoreSelection = $_5eyh7w4vjjgwe8ik.hasFocus(editor);
- node = rootNode.firstChild;
- while (node) {
- if (isValidTarget(blockElements, node)) {
- if (shouldRemoveTextNode(blockElements, node)) {
</del><span class="cx" style="display: block; padding: 0 10px"> tempNode = node;
</span><span class="cx" style="display: block; padding: 0 10px"> node = node.nextSibling;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- dom.remove(tempNode);
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rootBlockNode.appendChild(tempNode);
+ } else {
+ rootBlockNode = null;
+ 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">- if (!rootBlockNode) {
- rootBlockNode = dom.create(forcedRootBlock, editor.settings.forced_root_block_attrs);
- node.parentNode.insertBefore(rootBlockNode, node);
- wrapped = true;
- }
- tempNode = node;
- node = node.nextSibling;
- rootBlockNode.appendChild(tempNode);
- } else {
- rootBlockNode = null;
- node = node.nextSibling;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (wrapped && restoreSelection) {
- rng.setStart(startContainer, startOffset);
- rng.setEnd(endContainer, endOffset);
- selection.setRng(rng);
- editor.nodeChanged();
- }
- };
- var setup$2 = function (editor) {
- if (editor.settings.forced_root_block) {
- editor.on('NodeChange', curry(addRootBlocks, editor));
- }
- };
- var $_g8uzqo5ljjgwe8m8 = { setup: setup$2 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (wrapped && restoreSelection) {
+ rng.setStart(startContainer, startOffset);
+ rng.setEnd(endContainer, endOffset);
+ selection.setRng(rng);
+ editor.nodeChanged();
+ }
+ };
+ var setup$2 = function (editor) {
+ if (editor.settings.forced_root_block) {
+ editor.on('NodeChange', curry(addRootBlocks, editor));
+ }
+ };
+ var ForceBlocks = { setup: setup$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">- var getStartNode = function (rng) {
- var sc = rng.startContainer, so = rng.startOffset;
- if ($_3b9u2y1rjjgwe7qe.isText(sc)) {
- return so === 0 ? Option.some(Element$$1.fromDom(sc)) : Option.none();
- } else {
- return Option.from(sc.childNodes[so]).map(Element$$1.fromDom);
- }
- };
- var getEndNode = function (rng) {
- var ec = rng.endContainer, eo = rng.endOffset;
- if ($_3b9u2y1rjjgwe7qe.isText(ec)) {
- return eo === ec.data.length ? Option.some(Element$$1.fromDom(ec)) : Option.none();
- } else {
- return Option.from(ec.childNodes[eo - 1]).map(Element$$1.fromDom);
- }
- };
- var getFirstChildren = function (node) {
- return $_d3rmjp18jjgwe7nc.firstChild(node).fold(constant([node]), function (child) {
- return [node].concat(getFirstChildren(child));
- });
- };
- var getLastChildren$1 = function (node) {
- return $_d3rmjp18jjgwe7nc.lastChild(node).fold(constant([node]), function (child) {
- if ($_fxxo5411jjgwe7lq.name(child) === 'br') {
- return $_d3rmjp18jjgwe7nc.prevSibling(child).map(function (sibling) {
- return [node].concat(getLastChildren$1(sibling));
- }).getOr([]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getStartNode = function (rng) {
+ var sc = rng.startContainer, so = rng.startOffset;
+ if (NodeType.isText(sc)) {
+ return so === 0 ? Option.some(Element$$1.fromDom(sc)) : Option.none();
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return [node].concat(getLastChildren$1(child));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Option.from(sc.childNodes[so]).map(Element$$1.fromDom);
</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 hasAllContentsSelected = function (elm, rng) {
- return liftN([
- getStartNode(rng),
- getEndNode(rng)
- ], function (startNode, endNode) {
- var start = find(getFirstChildren(elm), curry($_5raon11ejjgwe7o5.eq, startNode));
- var end = find(getLastChildren$1(elm), curry($_5raon11ejjgwe7o5.eq, endNode));
- return start.isSome() && end.isSome();
- }).getOr(false);
- };
- var moveEndPoint$1 = function (dom, rng, node, start) {
- var root = node, walker = new TreeWalker(node, root);
- var nonEmptyElementsMap = dom.schema.getNonEmptyElements();
- do {
- if (node.nodeType === 3 && $_6cwiepljjgwe7j4.trim(node.nodeValue).length !== 0) {
- if (start) {
- rng.setStart(node, 0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var getEndNode = function (rng) {
+ var ec = rng.endContainer, eo = rng.endOffset;
+ if (NodeType.isText(ec)) {
+ return eo === ec.data.length ? Option.some(Element$$1.fromDom(ec)) : Option.none();
+ } else {
+ return Option.from(ec.childNodes[eo - 1]).map(Element$$1.fromDom);
+ }
+ };
+ var getFirstChildren = function (node) {
+ return firstChild(node).fold(constant([node]), function (child$$1) {
+ return [node].concat(getFirstChildren(child$$1));
+ });
+ };
+ var getLastChildren$1 = function (node) {
+ return lastChild(node).fold(constant([node]), function (child$$1) {
+ if (name(child$$1) === 'br') {
+ return prevSibling(child$$1).map(function (sibling) {
+ return [node].concat(getLastChildren$1(sibling));
+ }).getOr([]);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- rng.setEnd(node, node.nodeValue.length);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return [node].concat(getLastChildren$1(child$$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;
- }
- if (nonEmptyElementsMap[node.nodeName] && !/^(TD|TH)$/.test(node.nodeName)) {
- if (start) {
- rng.setStartBefore(node);
- } else {
- if (node.nodeName === 'BR') {
- rng.setEndBefore(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ var hasAllContentsSelected = function (elm, rng) {
+ return liftN([
+ getStartNode(rng),
+ getEndNode(rng)
+ ], function (startNode, endNode) {
+ var start = find(getFirstChildren(elm), curry(eq, startNode));
+ var end = find(getLastChildren$1(elm), curry(eq, endNode));
+ return start.isSome() && end.isSome();
+ }).getOr(false);
+ };
+ var moveEndPoint$1 = function (dom, rng, node, start) {
+ var root = node, walker = new TreeWalker(node, root);
+ var nonEmptyElementsMap = dom.schema.getNonEmptyElements();
+ do {
+ if (node.nodeType === 3 && Tools.trim(node.nodeValue).length !== 0) {
+ if (start) {
+ rng.setStart(node, 0);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- rng.setEndAfter(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rng.setEnd(node, node.nodeValue.length);
</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;
</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;
- }
- if ($_bcvfv9ajjgwe79v.ie && $_bcvfv9ajjgwe79v.ie < 11 && dom.isBlock(node) && dom.isEmpty(node)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (nonEmptyElementsMap[node.nodeName] && !/^(TD|TH)$/.test(node.nodeName)) {
+ if (start) {
+ rng.setStartBefore(node);
+ } else {
+ if (node.nodeName === 'BR') {
+ rng.setEndBefore(node);
+ } else {
+ rng.setEndAfter(node);
+ }
+ }
+ return;
+ }
+ if (Env.ie && Env.ie < 11 && dom.isBlock(node) && dom.isEmpty(node)) {
+ if (start) {
+ rng.setStart(node, 0);
+ } else {
+ rng.setEnd(node, 0);
+ }
+ return;
+ }
+ } while (node = start ? walker.next() : walker.prev());
+ if (root.nodeName === 'BODY') {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (start) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- rng.setStart(node, 0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rng.setStart(root, 0);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- rng.setEnd(node, 0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rng.setEnd(root, root.childNodes.length);
</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><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 = start ? walker.next() : walker.prev());
- if (root.nodeName === 'BODY') {
- if (start) {
- rng.setStart(root, 0);
- } else {
- rng.setEnd(root, root.childNodes.length);
- }
- }
- };
- var hasAnyRanges = function (editor) {
- var sel = editor.selection.getSel();
- return sel && sel.rangeCount > 0;
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var hasAnyRanges = function (editor) {
+ var sel = editor.selection.getSel();
+ return sel && sel.rangeCount > 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">- function NodeChange (editor) {
- var lastRng, lastPath = [];
- var isSameElementPath = function (startElm) {
- var i, currentPath;
- currentPath = editor.$(startElm).parentsUntil(editor.getBody()).add(startElm);
- if (currentPath.length === lastPath.length) {
- for (i = currentPath.length; i >= 0; i--) {
- if (currentPath[i] !== lastPath[i]) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function NodeChange (editor) {
+ var lastRng, lastPath = [];
+ var isSameElementPath = function (startElm) {
+ var i, currentPath;
+ currentPath = editor.$(startElm).parentsUntil(editor.getBody()).add(startElm);
+ if (currentPath.length === lastPath.length) {
+ for (i = currentPath.length; i >= 0; i--) {
+ if (currentPath[i] !== lastPath[i]) {
+ break;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (i === -1) {
+ lastPath = currentPath;
+ 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 (i === -1) {
- lastPath = currentPath;
- return true;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ lastPath = currentPath;
+ return false;
+ };
+ if (!('onselectionchange' in editor.getDoc())) {
+ editor.on('NodeChange Click MouseUp KeyUp Focus', function (e) {
+ var nativeRng, fakeRng;
+ nativeRng = editor.selection.getRng();
+ fakeRng = {
+ startContainer: nativeRng.startContainer,
+ startOffset: nativeRng.startOffset,
+ endContainer: nativeRng.endContainer,
+ endOffset: nativeRng.endOffset
+ };
+ if (e.type === 'nodechange' || !RangeCompare.isEq(fakeRng, lastRng)) {
+ editor.fire('SelectionChange');
+ }
+ lastRng = fakeRng;
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- lastPath = currentPath;
- return false;
- };
- if (!('onselectionchange' in editor.getDoc())) {
- editor.on('NodeChange Click MouseUp KeyUp Focus', function (e) {
- var nativeRng, fakeRng;
- nativeRng = editor.selection.getRng();
- fakeRng = {
- startContainer: nativeRng.startContainer,
- startOffset: nativeRng.startOffset,
- endContainer: nativeRng.endContainer,
- endOffset: nativeRng.endOffset
- };
- if (e.type === 'nodechange' || !$_g1gkxh4kjjgwe8gw.isEq(fakeRng, lastRng)) {
- editor.fire('SelectionChange');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('contextmenu', function () {
+ editor.fire('SelectionChange');
+ });
+ editor.on('SelectionChange', function () {
+ var startElm = editor.selection.getStart(true);
+ if (!startElm || !Env.range && editor.selection.isCollapsed()) {
+ 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">- lastRng = fakeRng;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (hasAnyRanges(editor) && !isSameElementPath(startElm) && editor.dom.isChildOf(startElm, editor.getBody())) {
+ editor.nodeChanged({ selectionChange: 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">- }
- editor.on('contextmenu', function () {
- editor.fire('SelectionChange');
- });
- editor.on('SelectionChange', function () {
- var startElm = editor.selection.getStart(true);
- if (!startElm || !$_bcvfv9ajjgwe79v.range && editor.selection.isCollapsed()) {
- return;
- }
- if (hasAnyRanges(editor) && !isSameElementPath(startElm) && editor.dom.isChildOf(startElm, editor.getBody())) {
- editor.nodeChanged({ selectionChange: true });
- }
- });
- editor.on('MouseUp', function (e) {
- if (!e.isDefaultPrevented() && hasAnyRanges(editor)) {
- if (editor.selection.getNode().nodeName === 'IMG') {
- $_9o1ijaijjgwe7dm.setEditorTimeout(editor, function () {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('MouseUp', function (e) {
+ if (!e.isDefaultPrevented() && hasAnyRanges(editor)) {
+ if (editor.selection.getNode().nodeName === 'IMG') {
+ Delay.setEditorTimeout(editor, function () {
+ editor.nodeChanged();
+ });
+ } else {
</ins><span class="cx" style="display: block; padding: 0 10px"> editor.nodeChanged();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ }
+ });
+ this.nodeChanged = function (args) {
+ var selection = editor.selection;
+ var node, parents, root;
+ if (editor.initialized && selection && !editor.settings.disable_nodechange && !editor.readonly) {
+ root = editor.getBody();
+ node = selection.getStart(true) || root;
+ if (node.ownerDocument !== editor.getDoc() || !editor.dom.isChildOf(node, root)) {
+ node = root;
+ }
+ parents = [];
+ editor.dom.getParent(node, function (node) {
+ if (node === root) {
+ return true;
+ }
+ parents.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">- } else {
- editor.nodeChanged();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ args = args || {};
+ args.element = node;
+ args.parents = parents;
+ editor.fire('NodeChange', args);
</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.nodeChanged = function (args) {
- var selection = editor.selection;
- var node, parents, root;
- if (editor.initialized && selection && !editor.settings.disable_nodechange && !editor.readonly) {
- root = editor.getBody();
- node = selection.getStart(true) || root;
- if (node.ownerDocument !== editor.getDoc() || !editor.dom.isChildOf(node, root)) {
- node = root;
- }
- parents = [];
- editor.dom.getParent(node, function (node) {
- if (node === root) {
- return true;
- }
- parents.push(node);
- });
- args = args || {};
- args.element = node;
- args.parents = parents;
- editor.fire('NodeChange', args);
- }
- };
- }
</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">- var getAbsolutePosition = function (elm) {
- var doc, docElem, win, clientRect;
- clientRect = elm.getBoundingClientRect();
- doc = elm.ownerDocument;
- docElem = doc.documentElement;
- win = doc.defaultView;
- return {
- top: clientRect.top + win.pageYOffset - docElem.clientTop,
- left: clientRect.left + win.pageXOffset - docElem.clientLeft
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getAbsolutePosition = function (elm) {
+ var doc, docElem, win, clientRect;
+ clientRect = elm.getBoundingClientRect();
+ doc = elm.ownerDocument;
+ docElem = doc.documentElement;
+ win = doc.defaultView;
+ return {
+ top: clientRect.top + win.pageYOffset - docElem.clientTop,
+ left: clientRect.left + win.pageXOffset - docElem.clientLeft
+ };
</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 getBodyPosition = function (editor) {
- return editor.inline ? getAbsolutePosition(editor.getBody()) : {
- left: 0,
- top: 0
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getBodyPosition = function (editor) {
+ return editor.inline ? getAbsolutePosition(editor.getBody()) : {
+ left: 0,
+ top: 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">- };
- var getScrollPosition = function (editor) {
- var body = editor.getBody();
- return editor.inline ? {
- left: body.scrollLeft,
- top: body.scrollTop
- } : {
- left: 0,
- top: 0
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getScrollPosition = function (editor) {
+ var body = editor.getBody();
+ return editor.inline ? {
+ left: body.scrollLeft,
+ top: body.scrollTop
+ } : {
+ left: 0,
+ top: 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">- };
- var getBodyScroll = function (editor) {
- var body = editor.getBody(), docElm = editor.getDoc().documentElement;
- var inlineScroll = {
- left: body.scrollLeft,
- top: body.scrollTop
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getBodyScroll = function (editor) {
+ var body = editor.getBody(), docElm = editor.getDoc().documentElement;
+ var inlineScroll = {
+ left: body.scrollLeft,
+ top: body.scrollTop
+ };
+ var iframeScroll = {
+ left: body.scrollLeft || docElm.scrollLeft,
+ top: body.scrollTop || docElm.scrollTop
+ };
+ return editor.inline ? inlineScroll : iframeScroll;
</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 iframeScroll = {
- left: body.scrollLeft || docElm.scrollLeft,
- top: body.scrollTop || docElm.scrollTop
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getMousePosition = function (editor, event) {
+ if (event.target.ownerDocument !== editor.getDoc()) {
+ var iframePosition = getAbsolutePosition(editor.getContentAreaContainer());
+ var scrollPosition = getBodyScroll(editor);
+ return {
+ left: event.pageX - iframePosition.left + scrollPosition.left,
+ top: event.pageY - iframePosition.top + scrollPosition.top
+ };
+ }
+ return {
+ left: event.pageX,
+ top: event.pageY
+ };
</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 editor.inline ? inlineScroll : iframeScroll;
- };
- var getMousePosition = function (editor, event) {
- if (event.target.ownerDocument !== editor.getDoc()) {
- var iframePosition = getAbsolutePosition(editor.getContentAreaContainer());
- var scrollPosition = getBodyScroll(editor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var calculatePosition = function (bodyPosition, scrollPosition, mousePosition) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- left: event.pageX - iframePosition.left + scrollPosition.left,
- top: event.pageY - iframePosition.top + scrollPosition.top
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ pageX: mousePosition.left - bodyPosition.left + scrollPosition.left,
+ pageY: mousePosition.top - bodyPosition.top + scrollPosition.top
</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 {
- left: event.pageX,
- top: event.pageY
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var calculatePosition = function (bodyPosition, scrollPosition, mousePosition) {
- return {
- pageX: mousePosition.left - bodyPosition.left + scrollPosition.left,
- pageY: mousePosition.top - bodyPosition.top + scrollPosition.top
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var calc = function (editor, event) {
+ return calculatePosition(getBodyPosition(editor), getScrollPosition(editor), getMousePosition(editor, event));
</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 calc = function (editor, event) {
- return calculatePosition(getBodyPosition(editor), getScrollPosition(editor), getMousePosition(editor, event));
- };
- var $_ddlajs5qjjgwe8o0 = { calc: calc };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var MousePosition = { calc: calc };
</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 isContentEditableFalse$7 = $_3b9u2y1rjjgwe7qe.isContentEditableFalse;
- var isContentEditableTrue$4 = $_3b9u2y1rjjgwe7qe.isContentEditableTrue;
- var isDraggable = function (rootElm, elm) {
- return isContentEditableFalse$7(elm) && elm !== rootElm;
- };
- var isValidDropTarget = function (editor, targetElement, dragElement) {
- if (targetElement === dragElement || editor.dom.isChildOf(targetElement, dragElement)) {
- return false;
- }
- if (isContentEditableFalse$7(targetElement)) {
- return false;
- }
- return true;
- };
- var cloneElement = function (elm) {
- var cloneElm = elm.cloneNode(true);
- cloneElm.removeAttribute('data-mce-selected');
- return cloneElm;
- };
- var createGhost = function (editor, elm, width, height) {
- var clonedElm = elm.cloneNode(true);
- editor.dom.setStyles(clonedElm, {
- width: width,
- height: height
- });
- editor.dom.setAttrib(clonedElm, 'data-mce-selected', null);
- var ghostElm = editor.dom.create('div', {
- 'class': 'mce-drag-container',
- 'data-mce-bogus': 'all',
- 'unselectable': 'on',
- 'contenteditable': 'false'
- });
- editor.dom.setStyles(ghostElm, {
- position: 'absolute',
- opacity: 0.5,
- overflow: 'hidden',
- border: 0,
- padding: 0,
- margin: 0,
- width: width,
- height: height
- });
- editor.dom.setStyles(clonedElm, {
- margin: 0,
- boxSizing: 'border-box'
- });
- ghostElm.appendChild(clonedElm);
- return ghostElm;
- };
- var appendGhostToBody = function (ghostElm, bodyElm) {
- if (ghostElm.parentNode !== bodyElm) {
- bodyElm.appendChild(ghostElm);
- }
- };
- var moveGhost = function (ghostElm, position, width, height, maxX, maxY) {
- var overflowX = 0, overflowY = 0;
- ghostElm.style.left = position.pageX + 'px';
- ghostElm.style.top = position.pageY + 'px';
- if (position.pageX + width > maxX) {
- overflowX = position.pageX + width - maxX;
- }
- if (position.pageY + height > maxY) {
- overflowY = position.pageY + height - maxY;
- }
- ghostElm.style.width = width - overflowX + 'px';
- ghostElm.style.height = height - overflowY + 'px';
- };
- var removeElement = function (elm) {
- if (elm && elm.parentNode) {
- elm.parentNode.removeChild(elm);
- }
- };
- var isLeftMouseButtonPressed = function (e) {
- return e.button === 0;
- };
- var hasDraggableElement = function (state) {
- return state.element;
- };
- var applyRelPos = function (state, position) {
- return {
- pageX: position.pageX - state.relX,
- pageY: position.pageY + 5
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isContentEditableFalse$6 = NodeType.isContentEditableFalse, isContentEditableTrue$3 = NodeType.isContentEditableTrue;
+ var isDraggable = function (rootElm, elm) {
+ return isContentEditableFalse$6(elm) && elm !== rootElm;
</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 start$1 = function (state, editor) {
- return function (e) {
- if (isLeftMouseButtonPressed(e)) {
- var ceElm = $_6t4axrmjjgwe7jf.find(editor.dom.getParents(e.target), $_4127e12ljjgwe7ww.or(isContentEditableFalse$7, isContentEditableTrue$4));
- if (isDraggable(editor.getBody(), ceElm)) {
- var elmPos = editor.dom.getPos(ceElm);
- var bodyElm = editor.getBody();
- var docElm = editor.getDoc().documentElement;
- state.element = ceElm;
- state.screenX = e.screenX;
- state.screenY = e.screenY;
- state.maxX = (editor.inline ? bodyElm.scrollWidth : docElm.offsetWidth) - 2;
- state.maxY = (editor.inline ? bodyElm.scrollHeight : docElm.offsetHeight) - 2;
- state.relX = e.pageX - elmPos.x;
- state.relY = e.pageY - elmPos.y;
- state.width = ceElm.offsetWidth;
- state.height = ceElm.offsetHeight;
- state.ghost = createGhost(editor, ceElm, state.width, state.height);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isValidDropTarget = function (editor, targetElement, dragElement) {
+ if (targetElement === dragElement || editor.dom.isChildOf(targetElement, dragElement)) {
+ return false;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isContentEditableFalse$6(targetElement)) {
+ return false;
+ }
+ 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">- };
- var move$1 = function (state, editor) {
- var throttledPlaceCaretAt = $_9o1ijaijjgwe7dm.throttle(function (clientX, clientY) {
- editor._selectionOverrides.hideFakeCaret();
- editor.selection.placeCaretAt(clientX, clientY);
- }, 0);
- return function (e) {
- var movement = Math.max(Math.abs(e.screenX - state.screenX), Math.abs(e.screenY - state.screenY));
- if (hasDraggableElement(state) && !state.dragging && movement > 10) {
- var args = editor.fire('dragstart', { target: state.element });
- if (args.isDefaultPrevented()) {
- return;
- }
- state.dragging = true;
- editor.focus();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var cloneElement = function (elm) {
+ var cloneElm = elm.cloneNode(true);
+ cloneElm.removeAttribute('data-mce-selected');
+ return cloneElm;
+ };
+ var createGhost = function (editor, elm, width, height) {
+ var clonedElm = elm.cloneNode(true);
+ editor.dom.setStyles(clonedElm, {
+ width: width,
+ height: height
+ });
+ editor.dom.setAttrib(clonedElm, 'data-mce-selected', null);
+ var ghostElm = editor.dom.create('div', {
+ 'class': 'mce-drag-container',
+ 'data-mce-bogus': 'all',
+ 'unselectable': 'on',
+ 'contenteditable': 'false'
+ });
+ editor.dom.setStyles(ghostElm, {
+ position: 'absolute',
+ opacity: 0.5,
+ overflow: 'hidden',
+ border: 0,
+ padding: 0,
+ margin: 0,
+ width: width,
+ height: height
+ });
+ editor.dom.setStyles(clonedElm, {
+ margin: 0,
+ boxSizing: 'border-box'
+ });
+ ghostElm.appendChild(clonedElm);
+ return ghostElm;
+ };
+ var appendGhostToBody = function (ghostElm, bodyElm) {
+ if (ghostElm.parentNode !== bodyElm) {
+ bodyElm.appendChild(ghostElm);
</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 (state.dragging) {
- var targetPos = applyRelPos(state, $_ddlajs5qjjgwe8o0.calc(editor, e));
- appendGhostToBody(state.ghost, editor.getBody());
- moveGhost(state.ghost, targetPos, state.width, state.height, state.maxX, state.maxY);
- throttledPlaceCaretAt(e.clientX, e.clientY);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var moveGhost = function (ghostElm, position, width, height, maxX, maxY) {
+ var overflowX = 0, overflowY = 0;
+ ghostElm.style.left = position.pageX + 'px';
+ ghostElm.style.top = position.pageY + 'px';
+ if (position.pageX + width > maxX) {
+ overflowX = position.pageX + width - maxX;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (position.pageY + height > maxY) {
+ overflowY = position.pageY + height - maxY;
+ }
+ ghostElm.style.width = width - overflowX + 'px';
+ ghostElm.style.height = height - overflowY + '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">- };
- var getRawTarget = function (selection) {
- var rng = selection.getSel().getRangeAt(0);
- var startContainer = rng.startContainer;
- return startContainer.nodeType === 3 ? startContainer.parentNode : startContainer;
- };
- var drop = function (state, editor) {
- return function (e) {
- if (state.dragging) {
- if (isValidDropTarget(editor, getRawTarget(editor.selection), state.element)) {
- var targetClone_1 = cloneElement(state.element);
- var args = editor.fire('drop', {
- targetClone: targetClone_1,
- clientX: e.clientX,
- clientY: e.clientY
- });
- if (!args.isDefaultPrevented()) {
- targetClone_1 = args.targetClone;
- editor.undoManager.transact(function () {
- removeElement(state.element);
- editor.insertContent(editor.dom.getOuterHTML(targetClone_1));
- editor._selectionOverrides.hideFakeCaret();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var removeElement = function (elm) {
+ if (elm && elm.parentNode) {
+ elm.parentNode.removeChild(elm);
+ }
+ };
+ var isLeftMouseButtonPressed = function (e) {
+ return e.button === 0;
+ };
+ var hasDraggableElement = function (state) {
+ return state.element;
+ };
+ var applyRelPos = function (state, position) {
+ return {
+ pageX: position.pageX - state.relX,
+ pageY: position.pageY + 5
+ };
+ };
+ var start$1 = function (state, editor) {
+ return function (e) {
+ if (isLeftMouseButtonPressed(e)) {
+ var ceElm = find(editor.dom.getParents(e.target), Predicate.or(isContentEditableFalse$6, isContentEditableTrue$3)).getOr(null);
+ if (isDraggable(editor.getBody(), ceElm)) {
+ var elmPos = editor.dom.getPos(ceElm);
+ var bodyElm = editor.getBody();
+ var docElm = editor.getDoc().documentElement;
+ state.element = ceElm;
+ state.screenX = e.screenX;
+ state.screenY = e.screenY;
+ state.maxX = (editor.inline ? bodyElm.scrollWidth : docElm.offsetWidth) - 2;
+ state.maxY = (editor.inline ? bodyElm.scrollHeight : docElm.offsetHeight) - 2;
+ state.relX = e.pageX - elmPos.x;
+ state.relY = e.pageY - elmPos.y;
+ state.width = ceElm.offsetWidth;
+ state.height = ceElm.offsetHeight;
+ state.ghost = createGhost(editor, ceElm, state.width, state.height);
+ }
+ }
+ };
+ };
+ var move$1 = function (state, editor) {
+ var throttledPlaceCaretAt = Delay.throttle(function (clientX, clientY) {
+ editor._selectionOverrides.hideFakeCaret();
+ editor.selection.placeCaretAt(clientX, clientY);
+ }, 0);
+ return function (e) {
+ var movement = Math.max(Math.abs(e.screenX - state.screenX), Math.abs(e.screenY - state.screenY));
+ if (hasDraggableElement(state) && !state.dragging && movement > 10) {
+ var args = editor.fire('dragstart', { target: state.element });
+ if (args.isDefaultPrevented()) {
+ return;
+ }
+ state.dragging = true;
+ editor.focus();
+ }
+ if (state.dragging) {
+ var targetPos = applyRelPos(state, MousePosition.calc(editor, e));
+ appendGhostToBody(state.ghost, editor.getBody());
+ moveGhost(state.ghost, targetPos, state.width, state.height, state.maxX, state.maxY);
+ throttledPlaceCaretAt(e.clientX, e.clientY);
+ }
+ };
+ };
+ var getRawTarget = function (selection) {
+ var rng = selection.getSel().getRangeAt(0);
+ var startContainer = rng.startContainer;
+ return startContainer.nodeType === 3 ? startContainer.parentNode : startContainer;
+ };
+ var drop = function (state, editor) {
+ return function (e) {
+ if (state.dragging) {
+ if (isValidDropTarget(editor, getRawTarget(editor.selection), state.element)) {
+ var targetClone_1 = cloneElement(state.element);
+ var args = editor.fire('drop', {
+ targetClone: targetClone_1,
+ clientX: e.clientX,
+ clientY: e.clientY
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!args.isDefaultPrevented()) {
+ targetClone_1 = args.targetClone;
+ editor.undoManager.transact(function () {
+ removeElement(state.element);
+ editor.insertContent(editor.dom.getOuterHTML(targetClone_1));
+ editor._selectionOverrides.hideFakeCaret();
+ });
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ removeDragState(state);
+ };
+ };
+ var stop$$1 = function (state, editor) {
+ return function () {
+ if (state.dragging) {
+ editor.fire('dragend');
+ }
+ removeDragState(state);
+ };
+ };
+ var removeDragState = function (state) {
+ state.dragging = false;
+ state.element = null;
+ removeElement(state.ghost);
+ };
+ var bindFakeDragEvents = function (editor) {
+ var state = {};
+ var pageDom, dragStartHandler, dragHandler, dropHandler, dragEndHandler, rootDocument;
+ pageDom = DOMUtils$1.DOM;
+ rootDocument = document;
+ dragStartHandler = start$1(state, editor);
+ dragHandler = move$1(state, editor);
+ dropHandler = drop(state, editor);
+ dragEndHandler = stop$$1(state, editor);
+ editor.on('mousedown', dragStartHandler);
+ editor.on('mousemove', dragHandler);
+ editor.on('mouseup', dropHandler);
+ pageDom.bind(rootDocument, 'mousemove', dragHandler);
+ pageDom.bind(rootDocument, 'mouseup', dragEndHandler);
+ editor.on('remove', function () {
+ pageDom.unbind(rootDocument, 'mousemove', dragHandler);
+ pageDom.unbind(rootDocument, 'mouseup', dragEndHandler);
+ });
+ };
+ var blockIeDrop = function (editor) {
+ editor.on('drop', function (e) {
+ var realTarget = typeof e.clientX !== 'undefined' ? editor.getDoc().elementFromPoint(e.clientX, e.clientY) : null;
+ if (isContentEditableFalse$6(realTarget) || isContentEditableFalse$6(editor.dom.getContentEditableParent(realTarget))) {
+ e.preventDefault();
+ }
+ });
+ };
+ var init = function (editor) {
+ bindFakeDragEvents(editor);
+ blockIeDrop(editor);
+ };
+ var DragDropOverrides = { init: init };
+
+ var getNodeClientRects = function (node) {
+ var toArrayWithNode = function (clientRects) {
+ return map(clientRects, function (clientRect) {
+ clientRect = clone$2(clientRect);
+ clientRect.node = node;
+ return clientRect;
+ });
+ };
+ if (NodeType.isElement(node)) {
+ return toArrayWithNode(node.getClientRects());
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- removeDragState(state);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (NodeType.isText(node)) {
+ var rng = node.ownerDocument.createRange();
+ rng.setStart(node, 0);
+ rng.setEnd(node, node.data.length);
+ return toArrayWithNode(rng.getClientRects());
+ }
</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 stop$$1 = function (state, editor) {
- return function () {
- if (state.dragging) {
- editor.fire('dragend');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getClientRects = function (node) {
+ return foldl(node, function (result, node) {
+ return result.concat(getNodeClientRects(node));
+ }, []);
+ };
+
+ var VDirection;
+ (function (VDirection) {
+ VDirection[VDirection['Up'] = -1] = 'Up';
+ VDirection[VDirection['Down'] = 1] = 'Down';
+ }(VDirection || (VDirection = {})));
+ var findUntil = function (direction, root, predicateFn, node) {
+ while (node = findNode(node, direction, isEditableCaretCandidate, root)) {
+ if (predicateFn(node)) {
+ 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">- removeDragState(state);
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var removeDragState = function (state) {
- state.dragging = false;
- state.element = null;
- removeElement(state.ghost);
- };
- var bindFakeDragEvents = function (editor) {
- var state = {};
- var pageDom, dragStartHandler, dragHandler, dropHandler, dragEndHandler, rootDocument;
- pageDom = DOMUtils$1.DOM;
- rootDocument = document;
- dragStartHandler = start$1(state, editor);
- dragHandler = move$1(state, editor);
- dropHandler = drop(state, editor);
- dragEndHandler = stop$$1(state, editor);
- editor.on('mousedown', dragStartHandler);
- editor.on('mousemove', dragHandler);
- editor.on('mouseup', dropHandler);
- pageDom.bind(rootDocument, 'mousemove', dragHandler);
- pageDom.bind(rootDocument, 'mouseup', dragEndHandler);
- editor.on('remove', function () {
- pageDom.unbind(rootDocument, 'mousemove', dragHandler);
- pageDom.unbind(rootDocument, 'mouseup', dragEndHandler);
- });
- };
- var blockIeDrop = function (editor) {
- editor.on('drop', function (e) {
- var realTarget = typeof e.clientX !== 'undefined' ? editor.getDoc().elementFromPoint(e.clientX, e.clientY) : null;
- if (isContentEditableFalse$7(realTarget) || isContentEditableFalse$7(editor.dom.getContentEditableParent(realTarget))) {
- e.preventDefault();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var walkUntil = function (direction, isAboveFn, isBeflowFn, root, predicateFn, caretPosition) {
+ var line = 0, node;
+ var result = [];
+ var targetClientRect;
+ var add = function (node) {
+ var i, clientRect, clientRects;
+ clientRects = getClientRects([node]);
+ if (direction === -1) {
+ clientRects = clientRects.reverse();
+ }
+ for (i = 0; i < clientRects.length; i++) {
+ clientRect = clientRects[i];
+ if (isBeflowFn(clientRect, targetClientRect)) {
+ continue;
+ }
+ if (result.length > 0 && isAboveFn(clientRect, ArrUtils.last(result))) {
+ line++;
+ }
+ clientRect.line = line;
+ if (predicateFn(clientRect)) {
+ return true;
+ }
+ result.push(clientRect);
+ }
+ };
+ targetClientRect = ArrUtils.last(caretPosition.getClientRects());
+ if (!targetClientRect) {
+ return result;
</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 init = function (editor) {
- bindFakeDragEvents(editor);
- blockIeDrop(editor);
- };
- var $_d2ggl65pjjgwe8nv = { init: init };
-
- var getNodeClientRects = function (node) {
- var toArrayWithNode = function (clientRects) {
- return $_6t4axrmjjgwe7jf.map(clientRects, function (clientRect) {
- clientRect = clone$2(clientRect);
- clientRect.node = node;
- return clientRect;
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ node = caretPosition.getNode();
+ add(node);
+ findUntil(direction, root, add, node);
+ return result;
</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 ($_3b9u2y1rjjgwe7qe.isElement(node)) {
- return toArrayWithNode(node.getClientRects());
- }
- if ($_3b9u2y1rjjgwe7qe.isText(node)) {
- var rng = node.ownerDocument.createRange();
- rng.setStart(node, 0);
- rng.setEnd(node, node.data.length);
- return toArrayWithNode(rng.getClientRects());
- }
- };
- var getClientRects = function (node) {
- return $_6t4axrmjjgwe7jf.reduce(node, function (result, node) {
- return result.concat(getNodeClientRects(node));
- }, []);
- };
-
- var VDirection;
- (function (VDirection) {
- VDirection[VDirection['Up'] = -1] = 'Up';
- VDirection[VDirection['Down'] = 1] = 'Down';
- }(VDirection || (VDirection = {})));
- var findUntil = function (direction, root, predicateFn, node) {
- while (node = findNode(node, direction, isEditableCaretCandidate, root)) {
- if (predicateFn(node)) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var aboveLineNumber = function (lineNumber, clientRect) {
+ return clientRect.line > lineNumber;
+ };
+ var isLineNumber = function (lineNumber, clientRect) {
+ return clientRect.line === lineNumber;
+ };
+ var upUntil = curry(walkUntil, VDirection.Up, isAbove, isBelow);
+ var downUntil = curry(walkUntil, VDirection.Down, isBelow, isAbove);
+ var positionsUntil = function (direction, root, predicateFn, node) {
+ var caretWalker = CaretWalker(root);
+ var walkFn, isBelowFn, isAboveFn, caretPosition;
+ var result = [];
+ var line = 0, clientRect, targetClientRect;
+ var getClientRect = function (caretPosition) {
+ if (direction === 1) {
+ return ArrUtils.last(caretPosition.getClientRects());
+ }
+ return ArrUtils.last(caretPosition.getClientRects());
+ };
+ if (direction === 1) {
+ walkFn = caretWalker.next;
+ isBelowFn = isBelow;
+ isAboveFn = isAbove;
+ caretPosition = CaretPosition$1.after(node);
+ } else {
+ walkFn = caretWalker.prev;
+ isBelowFn = isAbove;
+ isAboveFn = isBelow;
+ caretPosition = CaretPosition$1.before(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 walkUntil = function (direction, isAboveFn, isBeflowFn, root, predicateFn, caretPosition) {
- var line = 0, node;
- var result = [];
- var targetClientRect;
- var add = function (node) {
- var i, clientRect, clientRects;
- clientRects = getClientRects([node]);
- if (direction === -1) {
- clientRects = clientRects.reverse();
- }
- for (i = 0; i < clientRects.length; i++) {
- clientRect = clientRects[i];
- if (isBeflowFn(clientRect, targetClientRect)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ targetClientRect = getClientRect(caretPosition);
+ do {
+ if (!caretPosition.isVisible()) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (result.length > 0 && isAboveFn(clientRect, $_6t4axrmjjgwe7jf.last(result))) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ clientRect = getClientRect(caretPosition);
+ if (isAboveFn(clientRect, targetClientRect)) {
+ continue;
+ }
+ if (result.length > 0 && isBelowFn(clientRect, ArrUtils.last(result))) {
</ins><span class="cx" style="display: block; padding: 0 10px"> line++;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ clientRect = clone$2(clientRect);
+ clientRect.position = caretPosition;
</ins><span class="cx" style="display: block; padding: 0 10px"> clientRect.line = line;
</span><span class="cx" style="display: block; padding: 0 10px"> if (predicateFn(clientRect)) {
</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 result;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> result.push(clientRect);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- };
- targetClientRect = $_6t4axrmjjgwe7jf.last(caretPosition.getClientRects());
- if (!targetClientRect) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } while (caretPosition = walkFn(caretPosition));
</ins><span class="cx" style="display: block; padding: 0 10px"> return result;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- node = caretPosition.getNode();
- add(node);
- findUntil(direction, root, add, node);
- return result;
- };
- var aboveLineNumber = function (lineNumber, clientRect) {
- return clientRect.line > lineNumber;
- };
- var isLineNumber = function (lineNumber, clientRect) {
- return clientRect.line === lineNumber;
- };
- var upUntil = curry(walkUntil, VDirection.Up, isAbove, isBelow);
- var downUntil = curry(walkUntil, VDirection.Down, isBelow, isAbove);
- var positionsUntil = function (direction, root, predicateFn, node) {
- var caretWalker = CaretWalker(root);
- var walkFn, isBelowFn, isAboveFn, caretPosition;
- var result = [];
- var line = 0, clientRect, targetClientRect;
- var getClientRect = function (caretPosition) {
- if (direction === 1) {
- return $_6t4axrmjjgwe7jf.last(caretPosition.getClientRects());
- }
- return $_6t4axrmjjgwe7jf.last(caretPosition.getClientRects());
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (direction === 1) {
- walkFn = caretWalker.next;
- isBelowFn = isBelow;
- isAboveFn = isAbove;
- caretPosition = CaretPosition$1.after(node);
- } else {
- walkFn = caretWalker.prev;
- isBelowFn = isAbove;
- isAboveFn = isBelow;
- caretPosition = CaretPosition$1.before(node);
- }
- targetClientRect = getClientRect(caretPosition);
- do {
- if (!caretPosition.isVisible()) {
- continue;
- }
- clientRect = getClientRect(caretPosition);
- if (isAboveFn(clientRect, targetClientRect)) {
- continue;
- }
- if (result.length > 0 && isBelowFn(clientRect, $_6t4axrmjjgwe7jf.last(result))) {
- line++;
- }
- clientRect = clone$2(clientRect);
- clientRect.position = caretPosition;
- clientRect.line = line;
- if (predicateFn(clientRect)) {
- return result;
- }
- result.push(clientRect);
- } while (caretPosition = walkFn(caretPosition));
- return result;
- };
- var isAboveLine = function (lineNumber) {
- return function (clientRect) {
- return aboveLineNumber(lineNumber, clientRect);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isAboveLine = function (lineNumber) {
+ return function (clientRect) {
+ return aboveLineNumber(lineNumber, clientRect);
+ };
</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 isLine = function (lineNumber) {
- return function (clientRect) {
- return isLineNumber(lineNumber, clientRect);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isLine = function (lineNumber) {
+ return function (clientRect) {
+ return isLineNumber(lineNumber, clientRect);
+ };
</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><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var isContentEditableFalse$8 = $_3b9u2y1rjjgwe7qe.isContentEditableFalse;
- var findNode$1 = findNode;
- var distanceToRectLeft = function (clientRect, clientX) {
- return Math.abs(clientRect.left - clientX);
- };
- var distanceToRectRight = function (clientRect, clientX) {
- return Math.abs(clientRect.right - clientX);
- };
- var isInside = function (clientX, clientRect) {
- return clientX >= clientRect.left && clientX <= clientRect.right;
- };
- var findClosestClientRect = function (clientRects, clientX) {
- return $_6t4axrmjjgwe7jf.reduce(clientRects, function (oldClientRect, clientRect) {
- var oldDistance, newDistance;
- oldDistance = Math.min(distanceToRectLeft(oldClientRect, clientX), distanceToRectRight(oldClientRect, clientX));
- newDistance = Math.min(distanceToRectLeft(clientRect, clientX), distanceToRectRight(clientRect, clientX));
- if (isInside(clientX, clientRect)) {
- return clientRect;
- }
- if (isInside(clientX, oldClientRect)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isContentEditableFalse$7 = NodeType.isContentEditableFalse;
+ var findNode$1 = findNode;
+ var distanceToRectLeft = function (clientRect, clientX) {
+ return Math.abs(clientRect.left - clientX);
+ };
+ var distanceToRectRight = function (clientRect, clientX) {
+ return Math.abs(clientRect.right - clientX);
+ };
+ var isInside = function (clientX, clientRect) {
+ return clientX >= clientRect.left && clientX <= clientRect.right;
+ };
+ var findClosestClientRect = function (clientRects, clientX) {
+ return ArrUtils.reduce(clientRects, function (oldClientRect, clientRect) {
+ var oldDistance, newDistance;
+ oldDistance = Math.min(distanceToRectLeft(oldClientRect, clientX), distanceToRectRight(oldClientRect, clientX));
+ newDistance = Math.min(distanceToRectLeft(clientRect, clientX), distanceToRectRight(clientRect, clientX));
+ if (isInside(clientX, clientRect)) {
+ return clientRect;
+ }
+ if (isInside(clientX, oldClientRect)) {
+ return oldClientRect;
+ }
+ if (newDistance === oldDistance && isContentEditableFalse$7(clientRect.node)) {
+ return clientRect;
+ }
+ if (newDistance < oldDistance) {
+ return clientRect;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return oldClientRect;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (newDistance === oldDistance && isContentEditableFalse$8(clientRect.node)) {
- return clientRect;
- }
- if (newDistance < oldDistance) {
- return clientRect;
- }
- return oldClientRect;
- });
- };
- var walkUntil$1 = function (direction, root, predicateFn, node) {
- while (node = findNode$1(node, direction, isEditableCaretCandidate, root)) {
- if (predicateFn(node)) {
- return;
- }
- }
- };
- var findLineNodeRects = function (root, targetNodeRect) {
- var clientRects = [];
- var collect = function (checkPosFn, node) {
- var lineRects;
- lineRects = $_6t4axrmjjgwe7jf.filter(getClientRects([node]), function (clientRect) {
- return !checkPosFn(clientRect, targetNodeRect);
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- clientRects = clientRects.concat(lineRects);
- return lineRects.length === 0;
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- clientRects.push(targetNodeRect);
- walkUntil$1(VDirection.Up, root, curry(collect, isAbove), targetNodeRect.node);
- walkUntil$1(VDirection.Down, root, curry(collect, isBelow), targetNodeRect.node);
- return clientRects;
- };
- var getFakeCaretTargets = function (root) {
- return $_6t4axrmjjgwe7jf.filter($_6t4axrmjjgwe7jf.toArray(root.getElementsByTagName('*')), isFakeCaretTarget);
- };
- var caretInfo = function (clientRect, clientX) {
- return {
- node: clientRect.node,
- before: distanceToRectLeft(clientRect, clientX) < distanceToRectRight(clientRect, clientX)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var walkUntil$1 = function (direction, root, predicateFn, node) {
+ while (node = findNode$1(node, direction, isEditableCaretCandidate, root)) {
+ if (predicateFn(node)) {
+ 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 closestCaret = function (root, clientX, clientY) {
- var closestNodeRect;
- var contentEditableFalseNodeRects = getClientRects(getFakeCaretTargets(root));
- var targetNodeRects = $_6t4axrmjjgwe7jf.filter(contentEditableFalseNodeRects, function (rect) {
- return clientY >= rect.top && clientY <= rect.bottom;
- });
- closestNodeRect = findClosestClientRect(targetNodeRects, clientX);
- if (closestNodeRect) {
- closestNodeRect = findClosestClientRect(findLineNodeRects(root, closestNodeRect), clientX);
- if (closestNodeRect && isFakeCaretTarget(closestNodeRect.node)) {
- return caretInfo(closestNodeRect, clientX);
- }
- }
- return null;
- };
-
- var isXYWithinRange = function (clientX, clientY, range$$1) {
- if (range$$1.collapsed) {
- return false;
- }
- return foldl(range$$1.getClientRects(), function (state, rect) {
- return state || containsXY(rect, clientX, clientY);
- }, false);
- };
- var $_bswl8d5ujjgwe8oh = { isXYWithinRange: isXYWithinRange };
-
- var setup$3 = function (editor) {
- var renderFocusCaret = first$1(function () {
- if (!editor.removed) {
- var rng = editor.selection.getRng();
- if (rng.collapsed) {
- var caretRange = renderRangeCaret(editor, editor.selection.getRng(), false);
- editor.selection.setRng(caretRange);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var findLineNodeRects = function (root, targetNodeRect) {
+ var clientRects = [];
+ var collect = function (checkPosFn, node) {
+ var lineRects;
+ lineRects = filter(getClientRects([node]), function (clientRect) {
+ return !checkPosFn(clientRect, targetNodeRect);
+ });
+ clientRects = clientRects.concat(lineRects);
+ return lineRects.length === 0;
+ };
+ clientRects.push(targetNodeRect);
+ walkUntil$1(VDirection.Up, root, curry(collect, isAbove), targetNodeRect.node);
+ walkUntil$1(VDirection.Down, root, curry(collect, isBelow), targetNodeRect.node);
+ return clientRects;
+ };
+ var getFakeCaretTargets = function (root) {
+ return filter(from$1(root.getElementsByTagName('*')), isFakeCaretTarget);
+ };
+ var caretInfo = function (clientRect, clientX) {
+ return {
+ node: clientRect.node,
+ before: distanceToRectLeft(clientRect, clientX) < distanceToRectRight(clientRect, clientX)
+ };
+ };
+ var closestCaret = function (root, clientX, clientY) {
+ var closestNodeRect;
+ var contentEditableFalseNodeRects = getClientRects(getFakeCaretTargets(root));
+ var targetNodeRects = filter(contentEditableFalseNodeRects, function (rect) {
+ return clientY >= rect.top && clientY <= rect.bottom;
+ });
+ closestNodeRect = findClosestClientRect(targetNodeRects, clientX);
+ if (closestNodeRect) {
+ closestNodeRect = findClosestClientRect(findLineNodeRects(root, closestNodeRect), clientX);
+ if (closestNodeRect && isFakeCaretTarget(closestNodeRect.node)) {
+ return caretInfo(closestNodeRect, clientX);
</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">- }, 0);
- editor.on('focus', function () {
- renderFocusCaret.throttle();
- });
- editor.on('blur', function () {
- renderFocusCaret.cancel();
- });
- };
- var $_gvlmc5vjjgwe8ok = { setup: setup$3 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- var $_9udk9k5wjjgwe8on = {
- BACKSPACE: 8,
- DELETE: 46,
- DOWN: 40,
- ENTER: 13,
- LEFT: 37,
- RIGHT: 39,
- SPACEBAR: 32,
- TAB: 9,
- UP: 38,
- modifierPressed: function (e) {
- return e.shiftKey || e.ctrlKey || e.altKey || this.metaKeyPressed(e);
- },
- metaKeyPressed: function (e) {
- return $_bcvfv9ajjgwe79v.mac ? e.metaKey : e.ctrlKey && !e.altKey;
- }
- };
-
- var isContentEditableTrue$5 = $_3b9u2y1rjjgwe7qe.isContentEditableTrue;
- var isContentEditableFalse$9 = $_3b9u2y1rjjgwe7qe.isContentEditableFalse;
- var isAfterContentEditableFalse$1 = isAfterContentEditableFalse;
- var isBeforeContentEditableFalse$1 = isBeforeContentEditableFalse;
- var getContentEditableRoot$1 = function (editor, node) {
- var root = editor.getBody();
- while (node && node !== root) {
- if (isContentEditableTrue$5(node) || isContentEditableFalse$9(node)) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isXYWithinRange = function (clientX, clientY, range$$1) {
+ if (range$$1.collapsed) {
+ 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">- node = node.parentNode;
- }
- return null;
- };
- var SelectionOverrides = function (editor) {
- var isBlock = function (node) {
- return editor.dom.isBlock(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return foldl(range$$1.getClientRects(), function (state, rect) {
+ return state || containsXY(rect, clientX, clientY);
+ }, 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 rootNode = editor.getBody();
- var fakeCaret = FakeCaret(editor.getBody(), isBlock, function () {
- return $_5eyh7w4vjjgwe8ik.hasFocus(editor);
- });
- var realSelectionId = 'sel-' + editor.dom.uniqueId();
- var selectedContentEditableNode;
- var isFakeSelectionElement = function (elm) {
- return editor.dom.hasClass(elm, 'mce-offscreen-selection');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var RangePoint = { isXYWithinRange: isXYWithinRange };
+
+ var isContentEditableTrue$4 = NodeType.isContentEditableTrue;
+ var isContentEditableFalse$8 = NodeType.isContentEditableFalse;
+ var showCaret = function (direction, editor, node, before, scrollIntoView) {
+ return editor._selectionOverrides.showCaret(direction, node, before, scrollIntoView);
</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 getRealSelectionElement = function () {
- var container = editor.dom.get(realSelectionId);
- return container ? container.getElementsByTagName('*')[0] : container;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getNodeRange = function (node) {
+ var rng = node.ownerDocument.createRange();
+ rng.selectNode(node);
+ return 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">- var setRange = function (range$$1) {
- if (range$$1) {
- editor.selection.setRng(range$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var selectNode = function (editor, node) {
+ var e = editor.fire('BeforeObjectSelected', { target: node });
+ if (e.isDefaultPrevented()) {
+ return null;
</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 getNodeRange(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 getRange = function () {
- return editor.selection.getRng();
- };
- var showCaret$$1 = function (direction, node, before, scrollIntoView) {
- if (scrollIntoView === void 0) {
- scrollIntoView = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var renderCaretAtRange = function (editor, range, scrollIntoView) {
+ var normalizedRange = normalizeRange(1, editor.getBody(), range);
+ var caretPosition = CaretPosition$1.fromRangeStart(normalizedRange);
+ var caretPositionNode = caretPosition.getNode();
+ if (isContentEditableFalse$8(caretPositionNode)) {
+ return showCaret(1, editor, caretPositionNode, !caretPosition.isAtEnd(), 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 e;
- e = editor.fire('ShowCaret', {
- target: node,
- direction: direction,
- before: before
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var caretPositionBeforeNode = caretPosition.getNode(true);
+ if (isContentEditableFalse$8(caretPositionBeforeNode)) {
+ return showCaret(1, editor, caretPositionBeforeNode, false, false);
+ }
+ var ceRoot = editor.dom.getParent(caretPosition.getNode(), function (node) {
+ return isContentEditableFalse$8(node) || isContentEditableTrue$4(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 (e.isDefaultPrevented()) {
- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isContentEditableFalse$8(ceRoot)) {
+ return showCaret(1, editor, ceRoot, false, scrollIntoView);
</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 (scrollIntoView) {
- editor.selection.scrollIntoView(node, direction === -1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return null;
+ };
+ var renderRangeCaret = function (editor, range, scrollIntoView) {
+ if (!range || !range.collapsed) {
+ return range;
</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 fakeCaret.show(before, node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var caretRange = renderCaretAtRange(editor, range, scrollIntoView);
+ if (caretRange) {
+ return caretRange;
+ }
+ return range;
</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 getNormalizedRangeEndPoint$$1 = function (direction, range$$1) {
- range$$1 = normalizeRange(direction, rootNode, range$$1);
- if (direction === -1) {
- return CaretPosition$1.fromRangeStart(range$$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var setup$3 = function (editor) {
+ var renderFocusCaret = first$1(function () {
+ if (!editor.removed) {
+ var rng = editor.selection.getRng();
+ if (rng.collapsed) {
+ var caretRange = renderRangeCaret(editor, editor.selection.getRng(), false);
+ editor.selection.setRng(caretRange);
+ }
+ }
+ }, 0);
+ editor.on('focus', function () {
+ renderFocusCaret.throttle();
+ });
+ editor.on('blur', function () {
+ renderFocusCaret.cancel();
+ });
+ };
+ var CefFocus = { setup: setup$3 };
+
+ var VK = {
+ BACKSPACE: 8,
+ DELETE: 46,
+ DOWN: 40,
+ ENTER: 13,
+ LEFT: 37,
+ RIGHT: 39,
+ SPACEBAR: 32,
+ TAB: 9,
+ UP: 38,
+ modifierPressed: function (e) {
+ return e.shiftKey || e.ctrlKey || e.altKey || this.metaKeyPressed(e);
+ },
+ metaKeyPressed: function (e) {
+ return Env.mac ? e.metaKey : e.ctrlKey && !e.altKey;
</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 CaretPosition$1.fromRangeEnd(range$$1);
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var showBlockCaretContainer = function (blockCaretContainer) {
- if (blockCaretContainer.hasAttribute('data-mce-caret')) {
- showCaretContainerBlock(blockCaretContainer);
- setRange(getRange());
- editor.selection.scrollIntoView(blockCaretContainer[0]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var isContentEditableTrue$5 = NodeType.isContentEditableTrue;
+ var isContentEditableFalse$9 = NodeType.isContentEditableFalse;
+ var isAfterContentEditableFalse$1 = isAfterContentEditableFalse;
+ var isBeforeContentEditableFalse$1 = isBeforeContentEditableFalse;
+ var getContentEditableRoot$1 = function (editor, node) {
+ var root = editor.getBody();
+ while (node && node !== root) {
+ if (isContentEditableTrue$5(node) || isContentEditableFalse$9(node)) {
+ return node;
+ }
+ node = node.parentNode;
</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 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">- var registerEvents = function () {
- editor.on('mouseup', function (e) {
- var range$$1 = getRange();
- if (range$$1.collapsed && $_3j45vj50jjgwe8jq.isXYInContentArea(editor, e.clientX, e.clientY)) {
- setRange(renderCaretAtRange(editor, range$$1, false));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var SelectionOverrides = function (editor) {
+ var isBlock = function (node) {
+ return editor.dom.isBlock(node);
+ };
+ var rootNode = editor.getBody();
+ var fakeCaret = FakeCaret(editor.getBody(), isBlock, function () {
+ return EditorFocus.hasFocus(editor);
+ });
+ var realSelectionId = 'sel-' + editor.dom.uniqueId();
+ var selectedContentEditableNode;
+ var isFakeSelectionElement = function (elm) {
+ return editor.dom.hasClass(elm, 'mce-offscreen-selection');
+ };
+ var getRealSelectionElement = function () {
+ var container = editor.dom.get(realSelectionId);
+ return container ? container.getElementsByTagName('*')[0] : container;
+ };
+ var setRange = function (range$$1) {
+ if (range$$1) {
+ editor.selection.setRng(range$$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">- });
- editor.on('click', function (e) {
- var contentEditableRoot;
- contentEditableRoot = getContentEditableRoot$1(editor, e.target);
- if (contentEditableRoot) {
- if (isContentEditableFalse$9(contentEditableRoot)) {
- e.preventDefault();
- editor.focus();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var getRange = function () {
+ return editor.selection.getRng();
+ };
+ var showCaret$$1 = function (direction, node, before, scrollIntoView) {
+ if (scrollIntoView === void 0) {
+ scrollIntoView = true;
+ }
+ var e;
+ e = editor.fire('ShowCaret', {
+ target: node,
+ direction: direction,
+ before: before
+ });
+ if (e.isDefaultPrevented()) {
+ return null;
+ }
+ if (scrollIntoView) {
+ editor.selection.scrollIntoView(node, direction === -1);
+ }
+ return fakeCaret.show(before, node);
+ };
+ var getNormalizedRangeEndPoint$$1 = function (direction, range$$1) {
+ range$$1 = normalizeRange(direction, rootNode, range$$1);
+ if (direction === -1) {
+ return CaretPosition$1.fromRangeStart(range$$1);
+ }
+ return CaretPosition$1.fromRangeEnd(range$$1);
+ };
+ var showBlockCaretContainer = function (blockCaretContainer) {
+ if (blockCaretContainer.hasAttribute('data-mce-caret')) {
+ showCaretContainerBlock(blockCaretContainer);
+ setRange(getRange());
+ editor.selection.scrollIntoView(blockCaretContainer[0]);
+ }
+ };
+ var registerEvents = function () {
+ editor.on('mouseup', function (e) {
+ var range$$1 = getRange();
+ if (range$$1.collapsed && EditorView.isXYInContentArea(editor, e.clientX, e.clientY)) {
+ setRange(renderCaretAtRange(editor, range$$1, 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 (isContentEditableTrue$5(contentEditableRoot)) {
- if (editor.dom.isChildOf(contentEditableRoot, editor.selection.getNode())) {
- removeContentEditableSelection();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ editor.on('click', function (e) {
+ var contentEditableRoot;
+ contentEditableRoot = getContentEditableRoot$1(editor, e.target);
+ if (contentEditableRoot) {
+ if (isContentEditableFalse$9(contentEditableRoot)) {
+ e.preventDefault();
+ editor.focus();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isContentEditableTrue$5(contentEditableRoot)) {
+ if (editor.dom.isChildOf(contentEditableRoot, editor.selection.getNode())) {
+ removeContentEditableSelection();
+ }
+ }
</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('blur NewBlock', function () {
- removeContentEditableSelection();
- });
- editor.on('ResizeWindow FullscreenStateChanged', function () {
- return fakeCaret.reposition();
- });
- var handleTouchSelect = function (editor) {
- var moved = false;
- editor.on('touchstart', function () {
- moved = false;
</del><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('touchmove', function () {
- moved = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('blur NewBlock', function () {
+ removeContentEditableSelection();
</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('touchend', function (e) {
- var contentEditableRoot = getContentEditableRoot$1(editor, e.target);
- if (isContentEditableFalse$9(contentEditableRoot)) {
- if (!moved) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('ResizeWindow FullscreenStateChanged', function () {
+ return fakeCaret.reposition();
+ });
+ var handleTouchSelect = function (editor) {
+ var moved = false;
+ editor.on('touchstart', function () {
+ moved = false;
+ });
+ editor.on('touchmove', function () {
+ moved = true;
+ });
+ editor.on('touchend', function (e) {
+ var contentEditableRoot = getContentEditableRoot$1(editor, e.target);
+ if (isContentEditableFalse$9(contentEditableRoot)) {
+ if (!moved) {
+ e.preventDefault();
+ setContentEditableSelection(selectNode(editor, contentEditableRoot));
+ }
+ }
+ });
+ };
+ var hasNormalCaretPosition = function (elm) {
+ var caretWalker = CaretWalker(elm);
+ if (!elm.firstChild) {
+ return false;
+ }
+ var startPos = CaretPosition$1.before(elm.firstChild);
+ var newPos = caretWalker.next(startPos);
+ return newPos && !isBeforeContentEditableFalse$1(newPos) && !isAfterContentEditableFalse$1(newPos);
+ };
+ var isInSameBlock$$1 = function (node1, node2) {
+ var block1 = editor.dom.getParent(node1, editor.dom.isBlock);
+ var block2 = editor.dom.getParent(node2, editor.dom.isBlock);
+ return block1 === block2;
+ };
+ var hasBetterMouseTarget = function (targetNode, caretNode) {
+ var targetBlock = editor.dom.getParent(targetNode, editor.dom.isBlock);
+ var caretBlock = editor.dom.getParent(caretNode, editor.dom.isBlock);
+ if (targetBlock && editor.dom.isChildOf(targetBlock, caretBlock) && isContentEditableFalse$9(getContentEditableRoot$1(editor, targetBlock)) === false) {
+ return true;
+ }
+ return targetBlock && !isInSameBlock$$1(targetBlock, caretBlock) && hasNormalCaretPosition(targetBlock);
+ };
+ handleTouchSelect(editor);
+ editor.on('mousedown', function (e) {
+ var contentEditableRoot;
+ var targetElm = e.target;
+ if (targetElm !== rootNode && targetElm.nodeName !== 'HTML' && !editor.dom.isChildOf(targetElm, rootNode)) {
+ return;
+ }
+ if (EditorView.isXYInContentArea(editor, e.clientX, e.clientY) === false) {
+ return;
+ }
+ contentEditableRoot = getContentEditableRoot$1(editor, targetElm);
+ if (contentEditableRoot) {
+ if (isContentEditableFalse$9(contentEditableRoot)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> e.preventDefault();
</span><span class="cx" style="display: block; padding: 0 10px"> setContentEditableSelection(selectNode(editor, contentEditableRoot));
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ removeContentEditableSelection();
+ if (!(isContentEditableTrue$5(contentEditableRoot) && e.shiftKey) && !RangePoint.isXYWithinRange(e.clientX, e.clientY, editor.selection.getRng())) {
+ hideFakeCaret();
+ editor.selection.placeCaretAt(e.clientX, e.clientY);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if (isFakeCaretTarget(targetElm) === false) {
+ removeContentEditableSelection();
+ hideFakeCaret();
+ var caretInfo = closestCaret(rootNode, e.clientX, e.clientY);
+ if (caretInfo) {
+ if (!hasBetterMouseTarget(e.target, caretInfo.node)) {
+ e.preventDefault();
+ var range$$1 = showCaret$$1(1, caretInfo.node, caretInfo.before, false);
+ editor.getBody().focus();
+ setRange(range$$1);
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('keypress', function (e) {
+ if (VK.modifierPressed(e)) {
+ return;
+ }
+ switch (e.keyCode) {
+ default:
+ if (isContentEditableFalse$9(editor.selection.getNode())) {
+ e.preventDefault();
+ }
+ break;
+ }
+ });
+ editor.on('getSelectionRange', function (e) {
+ var rng = e.range;
+ if (selectedContentEditableNode) {
+ if (!selectedContentEditableNode.parentNode) {
+ selectedContentEditableNode = null;
+ return;
+ }
+ rng = rng.cloneRange();
+ rng.selectNode(selectedContentEditableNode);
+ e.range = rng;
+ }
+ });
+ editor.on('setSelectionRange', function (e) {
+ var rng;
+ rng = setContentEditableSelection(e.range, e.forward);
+ if (rng) {
+ e.range = rng;
+ }
+ });
+ var isPasteBin = function (node) {
+ return node.id === 'mcepastebin';
+ };
+ editor.on('AfterSetSelectionRange', function (e) {
+ var rng = e.range;
+ if (!isRangeInCaretContainer(rng) && !isPasteBin(rng.startContainer.parentNode)) {
+ hideFakeCaret();
+ }
+ if (!isFakeSelectionElement(rng.startContainer.parentNode)) {
+ removeContentEditableSelection();
+ }
+ });
+ editor.on('copy', function (e) {
+ var clipboardData = e.clipboardData;
+ if (!e.isDefaultPrevented() && e.clipboardData && !Env.ie) {
+ var realSelectionElement = getRealSelectionElement();
+ if (realSelectionElement) {
+ e.preventDefault();
+ clipboardData.clearData();
+ clipboardData.setData('text/html', realSelectionElement.outerHTML);
+ clipboardData.setData('text/plain', realSelectionElement.outerText);
+ }
+ }
+ });
+ DragDropOverrides.init(editor);
+ CefFocus.setup(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">- var hasNormalCaretPosition = function (elm) {
- var caretWalker = CaretWalker(elm);
- if (!elm.firstChild) {
- return false;
- }
- var startPos = CaretPosition$1.before(elm.firstChild);
- var newPos = caretWalker.next(startPos);
- return newPos && !isBeforeContentEditableFalse$1(newPos) && !isAfterContentEditableFalse$1(newPos);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var addCss = function () {
+ var styles = editor.contentStyles, rootClass = '.mce-content-body';
+ styles.push(fakeCaret.getCss());
+ styles.push(rootClass + ' .mce-offscreen-selection {' + 'position: absolute;' + 'left: -9999999999px;' + 'max-width: 1000000px;' + '}' + rootClass + ' *[contentEditable=false] {' + 'cursor: default;' + '}' + rootClass + ' *[contentEditable=true] {' + 'cursor: 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">- var isInSameBlock$$1 = function (node1, node2) {
- var block1 = editor.dom.getParent(node1, editor.dom.isBlock);
- var block2 = editor.dom.getParent(node2, editor.dom.isBlock);
- return block1 === block2;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isWithinCaretContainer = function (node) {
+ return isCaretContainer(node) || startsWithCaretContainer(node) || endsWithCaretContainer(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 hasBetterMouseTarget = function (targetNode, caretNode) {
- var targetBlock = editor.dom.getParent(targetNode, editor.dom.isBlock);
- var caretBlock = editor.dom.getParent(caretNode, editor.dom.isBlock);
- if (targetBlock && editor.dom.isChildOf(targetBlock, caretBlock) && isContentEditableFalse$9(getContentEditableRoot$1(editor, targetBlock)) === false) {
- return true;
- }
- return targetBlock && !isInSameBlock$$1(targetBlock, caretBlock) && hasNormalCaretPosition(targetBlock);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isRangeInCaretContainer = function (rng) {
+ return isWithinCaretContainer(rng.startContainer) || isWithinCaretContainer(rng.endContainer);
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- handleTouchSelect(editor);
- editor.on('mousedown', function (e) {
- var contentEditableRoot;
- var targetElm = e.target;
- if (targetElm !== rootNode && targetElm.nodeName !== 'HTML' && !editor.dom.isChildOf(targetElm, rootNode)) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setContentEditableSelection = function (range$$1, forward) {
+ var node;
+ var $ = editor.$;
+ var dom = editor.dom;
+ var $realSelectionContainer, sel, startContainer, startOffset, endOffset, e, caretPosition, targetClone, origTargetClone;
+ if (!range$$1) {
+ return 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 ($_3j45vj50jjgwe8jq.isXYInContentArea(editor, e.clientX, e.clientY) === false) {
- return;
- }
- contentEditableRoot = getContentEditableRoot$1(editor, targetElm);
- if (contentEditableRoot) {
- if (isContentEditableFalse$9(contentEditableRoot)) {
- e.preventDefault();
- setContentEditableSelection(selectNode(editor, contentEditableRoot));
- } else {
- removeContentEditableSelection();
- if (!(isContentEditableTrue$5(contentEditableRoot) && e.shiftKey) && !$_bswl8d5ujjgwe8oh.isXYWithinRange(e.clientX, e.clientY, editor.selection.getRng())) {
- hideFakeCaret();
- editor.selection.placeCaretAt(e.clientX, e.clientY);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (range$$1.collapsed) {
+ if (!isRangeInCaretContainer(range$$1)) {
+ if (forward === false) {
+ caretPosition = getNormalizedRangeEndPoint$$1(-1, range$$1);
+ if (isFakeCaretTarget(caretPosition.getNode(true))) {
+ return showCaret$$1(-1, caretPosition.getNode(true), false, false);
+ }
+ if (isFakeCaretTarget(caretPosition.getNode())) {
+ return showCaret$$1(-1, caretPosition.getNode(), !caretPosition.isAtEnd(), false);
+ }
+ } else {
+ caretPosition = getNormalizedRangeEndPoint$$1(1, range$$1);
+ if (isFakeCaretTarget(caretPosition.getNode())) {
+ return showCaret$$1(1, caretPosition.getNode(), !caretPosition.isAtEnd(), false);
+ }
+ if (isFakeCaretTarget(caretPosition.getNode(true))) {
+ return showCaret$$1(1, caretPosition.getNode(true), false, false);
+ }
</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">- } else if (isFakeCaretTarget(targetElm) === false) {
- removeContentEditableSelection();
- hideFakeCaret();
- var caretInfo = closestCaret(rootNode, e.clientX, e.clientY);
- if (caretInfo) {
- if (!hasBetterMouseTarget(e.target, caretInfo.node)) {
- e.preventDefault();
- var range$$1 = showCaret$$1(1, caretInfo.node, caretInfo.before, false);
- editor.getBody().focus();
- setRange(range$$1);
- }
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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.on('keypress', function (e) {
- if ($_9udk9k5wjjgwe8on.modifierPressed(e)) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ startContainer = range$$1.startContainer;
+ startOffset = range$$1.startOffset;
+ endOffset = range$$1.endOffset;
+ if (startContainer.nodeType === 3 && startOffset === 0 && isContentEditableFalse$9(startContainer.parentNode)) {
+ startContainer = startContainer.parentNode;
+ startOffset = dom.nodeIndex(startContainer);
+ startContainer = startContainer.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">- switch (e.keyCode) {
- default:
- if (isContentEditableFalse$9(editor.selection.getNode())) {
- e.preventDefault();
- }
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (startContainer.nodeType !== 1) {
+ return 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.on('getSelectionRange', function (e) {
- var rng = e.range;
- if (selectedContentEditableNode) {
- if (!selectedContentEditableNode.parentNode) {
- selectedContentEditableNode = null;
- return;
- }
- rng = rng.cloneRange();
- rng.selectNode(selectedContentEditableNode);
- e.range = rng;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (endOffset === startOffset + 1) {
+ node = startContainer.childNodes[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">- });
- editor.on('setSelectionRange', function (e) {
- var rng;
- rng = setContentEditableSelection(e.range, e.forward);
- if (rng) {
- e.range = rng;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!isContentEditableFalse$9(node)) {
+ return 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.on('AfterSetSelectionRange', function (e) {
- var rng = e.range;
- if (!isRangeInCaretContainer(rng)) {
- hideFakeCaret();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ targetClone = origTargetClone = node.cloneNode(true);
+ e = editor.fire('ObjectSelected', {
+ target: node,
+ targetClone: targetClone
+ });
+ if (e.isDefaultPrevented()) {
+ return 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 (!isFakeSelectionElement(rng.startContainer.parentNode)) {
- removeContentEditableSelection();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $realSelectionContainer = descendant$1(Element$$1.fromDom(editor.getBody()), '#' + realSelectionId).fold(function () {
+ return $([]);
+ }, function (elm) {
+ return $([elm.dom()]);
+ });
+ targetClone = e.targetClone;
+ if ($realSelectionContainer.length === 0) {
+ $realSelectionContainer = $('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr('id', realSelectionId);
+ $realSelectionContainer.appendTo(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">- });
- editor.on('copy', function (e) {
- var clipboardData = e.clipboardData;
- if (!e.isDefaultPrevented() && e.clipboardData && !$_bcvfv9ajjgwe79v.ie) {
- var realSelectionElement = getRealSelectionElement();
- if (realSelectionElement) {
- e.preventDefault();
- clipboardData.clearData();
- clipboardData.setData('text/html', realSelectionElement.outerHTML);
- clipboardData.setData('text/plain', realSelectionElement.outerText);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ range$$1 = editor.dom.createRng();
+ if (targetClone === origTargetClone && Env.ie) {
+ $realSelectionContainer.empty().append('<p style="font-size: 0" data-mce-bogus="all">\xA0</p>').append(targetClone);
+ range$$1.setStartAfter($realSelectionContainer[0].firstChild.firstChild);
+ range$$1.setEndAfter(targetClone);
+ } else {
+ $realSelectionContainer.empty().append('\xA0').append(targetClone).append('\xA0');
+ range$$1.setStart($realSelectionContainer[0].firstChild, 1);
+ range$$1.setEnd($realSelectionContainer[0].lastChild, 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">- });
- $_d2ggl65pjjgwe8nv.init(editor);
- $_gvlmc5vjjgwe8ok.setup(editor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $realSelectionContainer.css({ top: dom.getPos(node, editor.getBody()).y });
+ $realSelectionContainer[0].focus();
+ sel = editor.selection.getSel();
+ sel.removeAllRanges();
+ sel.addRange(range$$1);
+ each(descendants$1(Element$$1.fromDom(editor.getBody()), '*[data-mce-selected]'), function (elm) {
+ remove(elm, 'data-mce-selected');
+ });
+ node.setAttribute('data-mce-selected', '1');
+ selectedContentEditableNode = node;
+ hideFakeCaret();
+ return range$$1;
+ };
+ var removeContentEditableSelection = function () {
+ if (selectedContentEditableNode) {
+ selectedContentEditableNode.removeAttribute('data-mce-selected');
+ descendant$1(Element$$1.fromDom(editor.getBody()), '#' + realSelectionId).each(remove$2);
+ selectedContentEditableNode = null;
+ }
+ descendant$1(Element$$1.fromDom(editor.getBody()), '#' + realSelectionId).each(remove$2);
+ selectedContentEditableNode = null;
+ };
+ var destroy = function () {
+ fakeCaret.destroy();
+ selectedContentEditableNode = null;
+ };
+ var hideFakeCaret = function () {
+ fakeCaret.hide();
+ };
+ if (Env.ceFalse) {
+ registerEvents();
+ addCss();
+ }
+ return {
+ showCaret: showCaret$$1,
+ showBlockCaretContainer: showBlockCaretContainer,
+ hideFakeCaret: hideFakeCaret,
+ destroy: destroy
+ };
</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 addCss = function () {
- var styles = editor.contentStyles, rootClass = '.mce-content-body';
- styles.push(fakeCaret.getCss());
- styles.push(rootClass + ' .mce-offscreen-selection {' + 'position: absolute;' + 'left: -9999999999px;' + 'max-width: 1000000px;' + '}' + rootClass + ' *[contentEditable=false] {' + 'cursor: default;' + '}' + rootClass + ' *[contentEditable=true] {' + 'cursor: text;' + '}');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var isValidPrefixAttrName = function (name) {
+ return name.indexOf('data-') === 0 || name.indexOf('aria-') === 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">- var isWithinCaretContainer = function (node) {
- return isCaretContainer(node) || startsWithCaretContainer(node) || endsWithCaretContainer(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var trimComments = function (text) {
+ return text.replace(/<!--|-->/g, '');
</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 isRangeInCaretContainer = function (rng) {
- return isWithinCaretContainer(rng.startContainer) || isWithinCaretContainer(rng.endContainer);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isInvalidUri = function (settings, uri) {
+ if (settings.allow_html_data_urls) {
+ return false;
+ } else if (/^data:image\//i.test(uri)) {
+ return settings.allow_svg_data_urls === false && /^data:image\/svg\+xml/i.test(uri);
+ } else {
+ return /^data:/i.test(uri);
+ }
</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 setContentEditableSelection = function (range$$1, forward) {
- var node;
- var $ = editor.$;
- var dom = editor.dom;
- var $realSelectionContainer, sel, startContainer, startOffset, endOffset, e, caretPosition, targetClone, origTargetClone;
- if (!range$$1) {
- return null;
- }
- if (range$$1.collapsed) {
- if (!isRangeInCaretContainer(range$$1)) {
- if (forward === false) {
- caretPosition = getNormalizedRangeEndPoint$$1(-1, range$$1);
- if (isFakeCaretTarget(caretPosition.getNode(true))) {
- return showCaret$$1(-1, caretPosition.getNode(true), false, false);
- }
- if (isFakeCaretTarget(caretPosition.getNode())) {
- return showCaret$$1(-1, caretPosition.getNode(), !caretPosition.isAtEnd(), false);
- }
- } else {
- caretPosition = getNormalizedRangeEndPoint$$1(1, range$$1);
- if (isFakeCaretTarget(caretPosition.getNode())) {
- return showCaret$$1(1, caretPosition.getNode(), !caretPosition.isAtEnd(), false);
- }
- if (isFakeCaretTarget(caretPosition.getNode(true))) {
- return showCaret$$1(1, caretPosition.getNode(true), false, false);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var findEndTagIndex = function (schema, html, startIndex) {
+ var count = 1, index, matches, tokenRegExp, shortEndedElements;
+ shortEndedElements = schema.getShortEndedElements();
+ tokenRegExp = /<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;
+ tokenRegExp.lastIndex = index = startIndex;
+ while (matches = tokenRegExp.exec(html)) {
+ index = tokenRegExp.lastIndex;
+ if (matches[1] === '/') {
+ count--;
+ } else if (!matches[1]) {
+ if (matches[2] in shortEndedElements) {
+ continue;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ count++;
</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 null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (count === 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">- startContainer = range$$1.startContainer;
- startOffset = range$$1.startOffset;
- endOffset = range$$1.endOffset;
- if (startContainer.nodeType === 3 && startOffset === 0 && isContentEditableFalse$9(startContainer.parentNode)) {
- startContainer = startContainer.parentNode;
- startOffset = dom.nodeIndex(startContainer);
- startContainer = startContainer.parentNode;
- }
- if (startContainer.nodeType !== 1) {
- return null;
- }
- if (endOffset === startOffset + 1) {
- node = startContainer.childNodes[startOffset];
- }
- if (!isContentEditableFalse$9(node)) {
- return null;
- }
- targetClone = origTargetClone = node.cloneNode(true);
- e = editor.fire('ObjectSelected', {
- target: node,
- targetClone: targetClone
- });
- if (e.isDefaultPrevented()) {
- return null;
- }
- $realSelectionContainer = $_ajwe9029jjgwe7ul.descendant(Element$$1.fromDom(editor.getBody()), '#' + realSelectionId).fold(function () {
- return $([]);
- }, function (elm) {
- return $([elm.dom()]);
- });
- targetClone = e.targetClone;
- if ($realSelectionContainer.length === 0) {
- $realSelectionContainer = $('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr('id', realSelectionId);
- $realSelectionContainer.appendTo(editor.getBody());
- }
- range$$1 = editor.dom.createRng();
- if (targetClone === origTargetClone && $_bcvfv9ajjgwe79v.ie) {
- $realSelectionContainer.empty().append('<p style="font-size: 0" data-mce-bogus="all">\xA0</p>').append(targetClone);
- range$$1.setStartAfter($realSelectionContainer[0].firstChild.firstChild);
- range$$1.setEndAfter(targetClone);
- } else {
- $realSelectionContainer.empty().append('\xA0').append(targetClone).append('\xA0');
- range$$1.setStart($realSelectionContainer[0].firstChild, 1);
- range$$1.setEnd($realSelectionContainer[0].lastChild, 0);
- }
- $realSelectionContainer.css({ top: dom.getPos(node, editor.getBody()).y });
- $realSelectionContainer[0].focus();
- sel = editor.selection.getSel();
- sel.removeAllRanges();
- sel.addRange(range$$1);
- each($_d3ydn427jjgwe7uf.descendants(Element$$1.fromDom(editor.getBody()), '*[data-mce-selected]'), function (elm) {
- $_etx7gr15jjgwe7mr.remove(elm, 'data-mce-selected');
- });
- node.setAttribute('data-mce-selected', '1');
- selectedContentEditableNode = node;
- hideFakeCaret();
- return range$$1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return index;
</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 removeContentEditableSelection = function () {
- if (selectedContentEditableNode) {
- selectedContentEditableNode.removeAttribute('data-mce-selected');
- $_ajwe9029jjgwe7ul.descendant(Element$$1.fromDom(editor.getBody()), '#' + realSelectionId).each($_81exq51wjjgwe7sm.remove);
- selectedContentEditableNode = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function SaxParser(settings, schema) {
+ if (schema === void 0) {
+ schema = Schema();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_ajwe9029jjgwe7ul.descendant(Element$$1.fromDom(editor.getBody()), '#' + realSelectionId).each($_81exq51wjjgwe7sm.remove);
- selectedContentEditableNode = null;
- };
- var destroy = function () {
- fakeCaret.destroy();
- selectedContentEditableNode = null;
- };
- var hideFakeCaret = function () {
- fakeCaret.hide();
- };
- if ($_bcvfv9ajjgwe79v.ceFalse) {
- registerEvents();
- addCss();
- }
- return {
- showCaret: showCaret$$1,
- showBlockCaretContainer: showBlockCaretContainer,
- hideFakeCaret: hideFakeCaret,
- destroy: destroy
- };
- };
-
- var isValidPrefixAttrName = function (name) {
- return name.indexOf('data-') === 0 || name.indexOf('aria-') === 0;
- };
- var trimComments = function (text) {
- return text.replace(/<!--|-->/g, '');
- };
- var isInvalidUri = function (settings, uri) {
- if (settings.allow_html_data_urls) {
- return false;
- } else if (/^data:image\//i.test(uri)) {
- return settings.allow_svg_data_urls === false && /^data:image\/svg\+xml/i.test(uri);
- } else {
- return /^data:/i.test(uri);
- }
- };
- var findEndTagIndex = function (schema, html, startIndex) {
- var count = 1, index, matches, tokenRegExp, shortEndedElements;
- shortEndedElements = schema.getShortEndedElements();
- tokenRegExp = /<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;
- tokenRegExp.lastIndex = index = startIndex;
- while (matches = tokenRegExp.exec(html)) {
- index = tokenRegExp.lastIndex;
- if (matches[1] === '/') {
- count--;
- } else if (!matches[1]) {
- if (matches[2] in shortEndedElements) {
- continue;
- }
- count++;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var noop = function () {
+ };
+ settings = settings || {};
+ if (settings.fix_self_closing !== false) {
+ settings.fix_self_closing = 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 (count === 0) {
- break;
- }
- }
- return index;
- };
- function SaxParser(settings, schema) {
- if (schema === void 0) {
- schema = Schema();
- }
- var noop = function () {
- };
- settings = settings || {};
- if (settings.fix_self_closing !== false) {
- settings.fix_self_closing = true;
- }
- var comment = settings.comment ? settings.comment : noop;
- var cdata = settings.cdata ? settings.cdata : noop;
- var text = settings.text ? settings.text : noop;
- var start = settings.start ? settings.start : noop;
- var end = settings.end ? settings.end : noop;
- var pi = settings.pi ? settings.pi : noop;
- var doctype = settings.doctype ? settings.doctype : noop;
- var parse = function (html) {
- var matches, index = 0, value, endRegExp;
- var stack = [];
- var attrList, i, textData, name;
- var isInternalElement, removeInternalElements, shortEndedElements, fillAttrsMap, isShortEnded;
- var validate, elementRule, isValidElement, attr, attribsValue, validAttributesMap, validAttributePatterns;
- var attributesRequired, attributesDefault, attributesForced, processHtml;
- var anyAttributesRequired, selfClosing, tokenRegExp, attrRegExp, specialElements, attrValue, idCount = 0;
- var decode = $_6pqr9q1sjjgwe7qj.decode;
- var fixSelfClosing;
- var filteredUrlAttrs = $_6cwiepljjgwe7j4.makeMap('src,href,data,background,formaction,poster,xlink:href');
- var scriptUriRegExp = /((java|vb)script|mhtml):/i;
- var processEndTag = function (name) {
- var pos, i;
- pos = stack.length;
- while (pos--) {
- if (stack[pos].name === name) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var comment = settings.comment ? settings.comment : noop;
+ var cdata = settings.cdata ? settings.cdata : noop;
+ var text = settings.text ? settings.text : noop;
+ var start = settings.start ? settings.start : noop;
+ var end = settings.end ? settings.end : noop;
+ var pi = settings.pi ? settings.pi : noop;
+ var doctype = settings.doctype ? settings.doctype : noop;
+ var parse = function (html) {
+ var matches, index = 0, value, endRegExp;
+ var stack = [];
+ var attrList, i, textData, name;
+ var isInternalElement, removeInternalElements, shortEndedElements, fillAttrsMap, isShortEnded;
+ var validate, elementRule, isValidElement, attr, attribsValue, validAttributesMap, validAttributePatterns;
+ var attributesRequired, attributesDefault, attributesForced, processHtml;
+ var anyAttributesRequired, selfClosing, tokenRegExp, attrRegExp, specialElements, attrValue, idCount = 0;
+ var decode = Entities.decode;
+ var fixSelfClosing;
+ var filteredUrlAttrs = Tools.makeMap('src,href,data,background,formaction,poster,xlink:href');
+ var scriptUriRegExp = /((java|vb)script|mhtml):/i;
+ var processEndTag = function (name) {
+ var pos, i;
+ pos = stack.length;
+ while (pos--) {
+ if (stack[pos].name === name) {
+ 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">- }
- if (pos >= 0) {
- for (i = stack.length - 1; i >= pos; i--) {
- name = stack[i];
- if (name.valid) {
- end(name.name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (pos >= 0) {
+ for (i = stack.length - 1; i >= pos; i--) {
+ name = stack[i];
+ if (name.valid) {
+ end(name.name);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ stack.length = pos;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- stack.length = pos;
- }
- };
- var parseAttribute = function (match, name, value, val2, val3) {
- var attrRule, i;
- var trimRegExp = /[\s\u0000-\u001F]+/g;
- name = name.toLowerCase();
- value = name in fillAttrsMap ? name : decode(value || val2 || val3 || '');
- if (validate && !isInternalElement && isValidPrefixAttrName(name) === false) {
- attrRule = validAttributesMap[name];
- if (!attrRule && validAttributePatterns) {
- i = validAttributePatterns.length;
- while (i--) {
- attrRule = validAttributePatterns[i];
- if (attrRule.pattern.test(name)) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var parseAttribute = function (match, name, value, val2, val3) {
+ var attrRule, i;
+ var trimRegExp = /[\s\u0000-\u001F]+/g;
+ name = name.toLowerCase();
+ value = name in fillAttrsMap ? name : decode(value || val2 || val3 || '');
+ if (validate && !isInternalElement && isValidPrefixAttrName(name) === false) {
+ attrRule = validAttributesMap[name];
+ if (!attrRule && validAttributePatterns) {
+ i = validAttributePatterns.length;
+ while (i--) {
+ attrRule = validAttributePatterns[i];
+ if (attrRule.pattern.test(name)) {
+ break;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (i === -1) {
+ attrRule = 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 (i === -1) {
- attrRule = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!attrRule) {
+ return;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (attrRule.validValues && !(value in attrRule.validValues)) {
+ 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 (!attrRule) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (filteredUrlAttrs[name] && !settings.allow_script_urls) {
+ var uri = value.replace(trimRegExp, '');
+ try {
+ uri = decodeURIComponent(uri);
+ } catch (ex) {
+ uri = unescape(uri);
+ }
+ if (scriptUriRegExp.test(uri)) {
+ return;
+ }
+ if (isInvalidUri(settings, uri)) {
+ 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 (attrRule.validValues && !(value in attrRule.validValues)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isInternalElement && (name in filteredUrlAttrs || name.indexOf('on') === 0)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (filteredUrlAttrs[name] && !settings.allow_script_urls) {
- var uri = value.replace(trimRegExp, '');
- try {
- uri = decodeURIComponent(uri);
- } catch (ex) {
- uri = unescape(uri);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ attrList.map[name] = value;
+ attrList.push({
+ name: name,
+ value: value
+ });
+ };
+ tokenRegExp = new RegExp('<(?:' + '(?:!--([\\w\\W]*?)-->)|' + '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + '(?:!DOCTYPE([\\w\\W]*?)>)|' + '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + '(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|' + '(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + ')', 'g');
+ attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;
+ shortEndedElements = schema.getShortEndedElements();
+ selfClosing = settings.self_closing_elements || schema.getSelfClosingElements();
+ fillAttrsMap = schema.getBoolAttrs();
+ validate = settings.validate;
+ removeInternalElements = settings.remove_internals;
+ fixSelfClosing = settings.fix_self_closing;
+ specialElements = schema.getSpecialElements();
+ processHtml = html + '>';
+ while (matches = tokenRegExp.exec(processHtml)) {
+ if (index < matches.index) {
+ text(decode(html.substr(index, matches.index - index)));
</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 (scriptUriRegExp.test(uri)) {
- return;
- }
- if (isInvalidUri(settings, uri)) {
- return;
- }
- }
- if (isInternalElement && (name in filteredUrlAttrs || name.indexOf('on') === 0)) {
- return;
- }
- attrList.map[name] = value;
- attrList.push({
- name: name,
- value: value
- });
- };
- tokenRegExp = new RegExp('<(?:' + '(?:!--([\\w\\W]*?)-->)|' + '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + '(?:!DOCTYPE([\\w\\W]*?)>)|' + '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + '(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|' + '(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + ')', 'g');
- attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g;
- shortEndedElements = schema.getShortEndedElements();
- selfClosing = settings.self_closing_elements || schema.getSelfClosingElements();
- fillAttrsMap = schema.getBoolAttrs();
- validate = settings.validate;
- removeInternalElements = settings.remove_internals;
- fixSelfClosing = settings.fix_self_closing;
- specialElements = schema.getSpecialElements();
- processHtml = html + '>';
- while (matches = tokenRegExp.exec(processHtml)) {
- if (index < matches.index) {
- text(decode(html.substr(index, matches.index - index)));
- }
- if (value = matches[6]) {
- value = value.toLowerCase();
- if (value.charAt(0) === ':') {
- value = value.substr(1);
- }
- processEndTag(value);
- } else if (value = matches[7]) {
- if (matches.index + matches[0].length > html.length) {
- text(decode(html.substr(matches.index)));
- index = matches.index + matches[0].length;
- continue;
- }
- value = value.toLowerCase();
- if (value.charAt(0) === ':') {
- value = value.substr(1);
- }
- isShortEnded = value in shortEndedElements;
- if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (value = matches[6]) {
+ value = value.toLowerCase();
+ if (value.charAt(0) === ':') {
+ value = value.substr(1);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> processEndTag(value);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (!validate || (elementRule = schema.getElementRule(value))) {
- isValidElement = true;
- if (validate) {
- validAttributesMap = elementRule.attributes;
- validAttributePatterns = elementRule.attributePatterns;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if (value = matches[7]) {
+ if (matches.index + matches[0].length > html.length) {
+ text(decode(html.substr(matches.index)));
+ index = matches.index + matches[0].length;
+ continue;
</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 (attribsValue = matches[8]) {
- isInternalElement = attribsValue.indexOf('data-mce-type') !== -1;
- if (isInternalElement && removeInternalElements) {
- isValidElement = false;
- }
- attrList = [];
- attrList.map = {};
- attribsValue.replace(attrRegExp, parseAttribute);
- } else {
- attrList = [];
- attrList.map = {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ value = value.toLowerCase();
+ if (value.charAt(0) === ':') {
+ value = value.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 (validate && !isInternalElement) {
- attributesRequired = elementRule.attributesRequired;
- attributesDefault = elementRule.attributesDefault;
- attributesForced = elementRule.attributesForced;
- anyAttributesRequired = elementRule.removeEmptyAttrs;
- if (anyAttributesRequired && !attrList.length) {
- isValidElement = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ isShortEnded = value in shortEndedElements;
+ if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) {
+ processEndTag(value);
+ }
+ if (!validate || (elementRule = schema.getElementRule(value))) {
+ isValidElement = true;
+ if (validate) {
+ validAttributesMap = elementRule.attributes;
+ validAttributePatterns = elementRule.attributePatterns;
</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 (attributesForced) {
- i = attributesForced.length;
- while (i--) {
- attr = attributesForced[i];
- name = attr.name;
- attrValue = attr.value;
- if (attrValue === '{$uid}') {
- attrValue = 'mce_' + idCount++;
- }
- attrList.map[name] = attrValue;
- attrList.push({
- name: name,
- value: attrValue
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (attribsValue = matches[8]) {
+ isInternalElement = attribsValue.indexOf('data-mce-type') !== -1;
+ if (isInternalElement && removeInternalElements) {
+ isValidElement = false;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ attrList = [];
+ attrList.map = {};
+ attribsValue.replace(attrRegExp, parseAttribute);
+ } else {
+ attrList = [];
+ attrList.map = {};
</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 (attributesDefault) {
- i = attributesDefault.length;
- while (i--) {
- attr = attributesDefault[i];
- name = attr.name;
- if (!(name in attrList.map)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (validate && !isInternalElement) {
+ attributesRequired = elementRule.attributesRequired;
+ attributesDefault = elementRule.attributesDefault;
+ attributesForced = elementRule.attributesForced;
+ anyAttributesRequired = elementRule.removeEmptyAttrs;
+ if (anyAttributesRequired && !attrList.length) {
+ isValidElement = false;
+ }
+ if (attributesForced) {
+ i = attributesForced.length;
+ while (i--) {
+ attr = attributesForced[i];
+ name = attr.name;
</ins><span class="cx" style="display: block; padding: 0 10px"> attrValue = attr.value;
</span><span class="cx" style="display: block; padding: 0 10px"> if (attrValue === '{$uid}') {
</span><span class="cx" style="display: block; padding: 0 10px"> attrValue = 'mce_' + idCount++;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17409,3464 +16511,3326 @@
</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">- }
- if (attributesRequired) {
- i = attributesRequired.length;
- while (i--) {
- if (attributesRequired[i] in attrList.map) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (attributesDefault) {
+ i = attributesDefault.length;
+ while (i--) {
+ attr = attributesDefault[i];
+ name = attr.name;
+ if (!(name in attrList.map)) {
+ attrValue = attr.value;
+ if (attrValue === '{$uid}') {
+ attrValue = 'mce_' + idCount++;
+ }
+ attrList.map[name] = attrValue;
+ attrList.push({
+ name: name,
+ value: attrValue
+ });
+ }
</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">- if (i === -1) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (attributesRequired) {
+ i = attributesRequired.length;
+ while (i--) {
+ if (attributesRequired[i] in attrList.map) {
+ break;
+ }
+ }
+ if (i === -1) {
+ isValidElement = false;
+ }
+ }
+ if (attr = attrList.map['data-mce-bogus']) {
+ if (attr === 'all') {
+ index = findEndTagIndex(schema, html, tokenRegExp.lastIndex);
+ tokenRegExp.lastIndex = index;
+ continue;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> isValidElement = false;
</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">- if (attr = attrList.map['data-mce-bogus']) {
- if (attr === 'all') {
- index = findEndTagIndex(schema, html, tokenRegExp.lastIndex);
- tokenRegExp.lastIndex = index;
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isValidElement) {
+ start(value, attrList, isShortEnded);
+ }
+ } else {
+ isValidElement = false;
+ }
+ if (endRegExp = specialElements[value]) {
+ endRegExp.lastIndex = index = matches.index + matches[0].length;
+ if (matches = endRegExp.exec(html)) {
+ if (isValidElement) {
+ textData = html.substr(index, matches.index - index);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- isValidElement = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ index = matches.index + matches[0].length;
+ } else {
+ textData = html.substr(index);
+ index = html.length;
</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 (isValidElement) {
- start(value, attrList, isShortEnded);
- }
- } else {
- isValidElement = false;
- }
- if (endRegExp = specialElements[value]) {
- endRegExp.lastIndex = index = matches.index + matches[0].length;
- if (matches = endRegExp.exec(html)) {
</del><span class="cx" style="display: block; padding: 0 10px"> if (isValidElement) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- textData = html.substr(index, matches.index - index);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (textData.length > 0) {
+ text(textData, true);
+ }
+ end(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">- index = matches.index + matches[0].length;
- } else {
- textData = html.substr(index);
- index = html.length;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ tokenRegExp.lastIndex = index;
+ continue;
</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 (isValidElement) {
- if (textData.length > 0) {
- text(textData, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!isShortEnded) {
+ if (!attribsValue || attribsValue.indexOf('/') !== attribsValue.length - 1) {
+ stack.push({
+ name: value,
+ valid: isValidElement
+ });
+ } else if (isValidElement) {
+ end(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">- end(value);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- tokenRegExp.lastIndex = index;
- continue;
- }
- if (!isShortEnded) {
- if (!attribsValue || attribsValue.indexOf('/') !== attribsValue.length - 1) {
- stack.push({
- name: value,
- valid: isValidElement
- });
- } else if (isValidElement) {
- end(value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if (value = matches[1]) {
+ if (value.charAt(0) === '>') {
+ value = ' ' + value;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!settings.allow_conditional_comments && value.substr(0, 3).toLowerCase() === '[if') {
+ value = ' ' + value;
+ }
+ comment(value);
+ } else if (value = matches[2]) {
+ cdata(trimComments(value));
+ } else if (value = matches[3]) {
+ doctype(value);
+ } else if (value = matches[4]) {
+ pi(value, matches[5]);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else if (value = matches[1]) {
- if (value.charAt(0) === '>') {
- value = ' ' + value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ index = matches.index + matches[0].length;
+ }
+ if (index < html.length) {
+ text(decode(html.substr(index)));
+ }
+ for (i = stack.length - 1; i >= 0; i--) {
+ value = stack[i];
+ if (value.valid) {
+ end(value.name);
</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.allow_conditional_comments && value.substr(0, 3).toLowerCase() === '[if') {
- value = ' ' + value;
- }
- comment(value);
- } else if (value = matches[2]) {
- cdata(trimComments(value));
- } else if (value = matches[3]) {
- doctype(value);
- } else if (value = matches[4]) {
- pi(value, matches[5]);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- index = matches.index + matches[0].length;
- }
- if (index < html.length) {
- text(decode(html.substr(index)));
- }
- for (i = stack.length - 1; i >= 0; i--) {
- value = stack[i];
- if (value.valid) {
- end(value.name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ return { parse: parse };
+ }
+ (function (SaxParser) {
+ SaxParser.findEndTag = findEndTagIndex;
+ }(SaxParser || (SaxParser = {})));
+ var SaxParser$1 = SaxParser;
+
+ var trimHtml = function (tempAttrs, html) {
+ var trimContentRegExp = new RegExp(['\\s?(' + tempAttrs.join('|') + ')="[^"]+"'].join('|'), 'gi');
+ return html.replace(trimContentRegExp, '');
+ };
+ var trimInternal = function (serializer, html) {
+ var content = html;
+ var bogusAllRegExp = /<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g;
+ var endTagIndex, index, matchLength, matches, shortEndedElements;
+ var schema = serializer.schema;
+ content = trimHtml(serializer.getTempAttrs(), content);
+ shortEndedElements = schema.getShortEndedElements();
+ while (matches = bogusAllRegExp.exec(content)) {
+ index = bogusAllRegExp.lastIndex;
+ matchLength = matches[0].length;
+ if (shortEndedElements[matches[1]]) {
+ endTagIndex = index;
+ } else {
+ endTagIndex = SaxParser$1.findEndTag(schema, content, index);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ content = content.substring(0, index - matchLength) + content.substring(endTagIndex);
+ bogusAllRegExp.lastIndex = index - matchLength;
</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 Zwsp.trim(content);
</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 { parse: parse };
- }
- (function (SaxParser) {
- SaxParser.findEndTag = findEndTagIndex;
- }(SaxParser || (SaxParser = {})));
- var SaxParser$1 = SaxParser;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var trimExternal = trimInternal;
+ var TrimHtml = {
+ trimExternal: trimExternal,
+ trimInternal: trimInternal
+ };
</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 trimHtml = function (tempAttrs, html) {
- var trimContentRegExp = new RegExp(['\\s?(' + tempAttrs.join('|') + ')="[^"]+"'].join('|'), 'gi');
- return html.replace(trimContentRegExp, '');
- };
- var trimInternal = function (serializer, html) {
- var content = html;
- var bogusAllRegExp = /<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g;
- var endTagIndex, index, matchLength, matches, shortEndedElements;
- var schema = serializer.schema;
- content = trimHtml(serializer.getTempAttrs(), content);
- shortEndedElements = schema.getShortEndedElements();
- while (matches = bogusAllRegExp.exec(content)) {
- index = bogusAllRegExp.lastIndex;
- matchLength = matches[0].length;
- if (shortEndedElements[matches[1]]) {
- endTagIndex = index;
- } else {
- endTagIndex = SaxParser$1.findEndTag(schema, content, index);
- }
- content = content.substring(0, index - matchLength) + content.substring(endTagIndex);
- bogusAllRegExp.lastIndex = index - matchLength;
- }
- return $_2xw7ul2pjjgwe7xs.trim(content);
- };
- var trimExternal = trimInternal;
- var $_87j7cq5zjjgwe8pf = {
- trimExternal: trimExternal,
- trimInternal: trimInternal
- };
-
- var KEEP = 0;
- var INSERT = 1;
- var DELETE = 2;
- var diff = function (left, right) {
- var size = left.length + right.length + 2;
- var vDown = new Array(size);
- var vUp = new Array(size);
- var snake = function (start, end, diag) {
- return {
- start: start,
- end: end,
- diag: diag
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var KEEP = 0, INSERT = 1, DELETE = 2;
+ var diff = function (left, right) {
+ var size = left.length + right.length + 2;
+ var vDown = new Array(size);
+ var vUp = new Array(size);
+ var snake = function (start, end, diag) {
+ return {
+ start: start,
+ end: end,
+ diag: diag
+ };
</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 buildScript = function (start1, end1, start2, end2, script) {
- var middle = getMiddleSnake(start1, end1, start2, end2);
- if (middle === null || middle.start === end1 && middle.diag === end1 - end2 || middle.end === start1 && middle.diag === start1 - start2) {
- var i = start1;
- var j = start2;
- while (i < end1 || j < end2) {
- if (i < end1 && j < end2 && left[i] === right[j]) {
- script.push([
- KEEP,
- left[i]
- ]);
- ++i;
- ++j;
- } else {
- if (end1 - start1 > end2 - start2) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var buildScript = function (start1, end1, start2, end2, script) {
+ var middle = getMiddleSnake(start1, end1, start2, end2);
+ if (middle === null || middle.start === end1 && middle.diag === end1 - end2 || middle.end === start1 && middle.diag === start1 - start2) {
+ var i = start1;
+ var j = start2;
+ while (i < end1 || j < end2) {
+ if (i < end1 && j < end2 && left[i] === right[j]) {
</ins><span class="cx" style="display: block; padding: 0 10px"> script.push([
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- DELETE,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ KEEP,
</ins><span class="cx" style="display: block; padding: 0 10px"> left[i]
</span><span class="cx" style="display: block; padding: 0 10px"> ]);
</span><span class="cx" style="display: block; padding: 0 10px"> ++i;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ++j;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- script.push([
- INSERT,
- right[j]
- ]);
- ++j;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (end1 - start1 > end2 - start2) {
+ script.push([
+ DELETE,
+ left[i]
+ ]);
+ ++i;
+ } else {
+ script.push([
+ INSERT,
+ right[j]
+ ]);
+ ++j;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ buildScript(start1, middle.start, start2, middle.start - middle.diag, script);
+ for (var i2 = middle.start; i2 < middle.end; ++i2) {
+ script.push([
+ KEEP,
+ left[i2]
+ ]);
+ }
+ buildScript(middle.end, end1, middle.end - middle.diag, end2, script);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- buildScript(start1, middle.start, start2, middle.start - middle.diag, script);
- for (var i2 = middle.start; i2 < middle.end; ++i2) {
- script.push([
- KEEP,
- left[i2]
- ]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var buildSnake = function (start, diag, end1, end2) {
+ var end = start;
+ while (end - diag < end2 && end < end1 && left[end] === right[end - diag]) {
+ ++end;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- buildScript(middle.end, end1, middle.end - middle.diag, end2, script);
- }
- };
- var buildSnake = function (start, diag, end1, end2) {
- var end = start;
- while (end - diag < end2 && end < end1 && left[end] === right[end - diag]) {
- ++end;
- }
- return snake(start, end, diag);
- };
- var getMiddleSnake = function (start1, end1, start2, end2) {
- var m = end1 - start1;
- var n = end2 - start2;
- if (m === 0 || n === 0) {
- return null;
- }
- var delta = m - n;
- var sum = n + m;
- var offset = (sum % 2 === 0 ? sum : sum + 1) / 2;
- vDown[1 + offset] = start1;
- vUp[1 + offset] = end1 + 1;
- var d, k, i, x, y;
- for (d = 0; d <= offset; ++d) {
- for (k = -d; k <= d; k += 2) {
- i = k + offset;
- if (k === -d || k !== d && vDown[i - 1] < vDown[i + 1]) {
- vDown[i] = vDown[i + 1];
- } else {
- vDown[i] = vDown[i - 1] + 1;
- }
- x = vDown[i];
- y = x - start1 + start2 - k;
- while (x < end1 && y < end2 && left[x] === right[y]) {
- vDown[i] = ++x;
- ++y;
- }
- if (delta % 2 !== 0 && delta - d <= k && k <= delta + d) {
- if (vUp[i - delta] <= vDown[i]) {
- return buildSnake(vUp[i - delta], k + start1 - start2, end1, end2);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return snake(start, end, diag);
+ };
+ var getMiddleSnake = function (start1, end1, start2, end2) {
+ var m = end1 - start1;
+ var n = end2 - start2;
+ if (m === 0 || n === 0) {
+ return null;
+ }
+ var delta = m - n;
+ var sum = n + m;
+ var offset = (sum % 2 === 0 ? sum : sum + 1) / 2;
+ vDown[1 + offset] = start1;
+ vUp[1 + offset] = end1 + 1;
+ var d, k, i, x, y;
+ for (d = 0; d <= offset; ++d) {
+ for (k = -d; k <= d; k += 2) {
+ i = k + offset;
+ if (k === -d || k !== d && vDown[i - 1] < vDown[i + 1]) {
+ vDown[i] = vDown[i + 1];
+ } else {
+ vDown[i] = vDown[i - 1] + 1;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ x = vDown[i];
+ y = x - start1 + start2 - k;
+ while (x < end1 && y < end2 && left[x] === right[y]) {
+ vDown[i] = ++x;
+ ++y;
+ }
+ if (delta % 2 !== 0 && delta - d <= k && k <= delta + d) {
+ if (vUp[i - delta] <= vDown[i]) {
+ return buildSnake(vUp[i - delta], k + start1 - start2, end1, end2);
+ }
+ }
</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 (k = delta - d; k <= delta + d; k += 2) {
- i = k + offset - delta;
- if (k === delta - d || k !== delta + d && vUp[i + 1] <= vUp[i - 1]) {
- vUp[i] = vUp[i + 1] - 1;
- } else {
- vUp[i] = vUp[i - 1];
- }
- x = vUp[i] - 1;
- y = x - start1 + start2 - k;
- while (x >= start1 && y >= start2 && left[x] === right[y]) {
- vUp[i] = x--;
- y--;
- }
- if (delta % 2 === 0 && -d <= k && k <= d) {
- if (vUp[i] <= vDown[i + delta]) {
- return buildSnake(vUp[i], k + start1 - start2, end1, end2);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (k = delta - d; k <= delta + d; k += 2) {
+ i = k + offset - delta;
+ if (k === delta - d || k !== delta + d && vUp[i + 1] <= vUp[i - 1]) {
+ vUp[i] = vUp[i + 1] - 1;
+ } else {
+ vUp[i] = vUp[i - 1];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ x = vUp[i] - 1;
+ y = x - start1 + start2 - k;
+ while (x >= start1 && y >= start2 && left[x] === right[y]) {
+ vUp[i] = x--;
+ y--;
+ }
+ if (delta % 2 === 0 && -d <= k && k <= d) {
+ if (vUp[i] <= vDown[i + delta]) {
+ return buildSnake(vUp[i], k + start1 - start2, end1, end2);
+ }
+ }
</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">- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var script = [];
+ buildScript(0, left.length, 0, right.length, script);
+ return script;
</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 script = [];
- buildScript(0, left.length, 0, right.length, script);
- return script;
- };
- var $_2llrn562jjgwe8py = {
- KEEP: KEEP,
- DELETE: DELETE,
- INSERT: INSERT,
- diff: diff
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Diff = {
+ KEEP: KEEP,
+ DELETE: DELETE,
+ INSERT: INSERT,
+ diff: diff
+ };
</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 getOuterHtml = function (elm) {
- if ($_3b9u2y1rjjgwe7qe.isElement(elm)) {
- return elm.outerHTML;
- } else if ($_3b9u2y1rjjgwe7qe.isText(elm)) {
- return $_6pqr9q1sjjgwe7qj.encodeRaw(elm.data, false);
- } else if ($_3b9u2y1rjjgwe7qe.isComment(elm)) {
- return '<!--' + elm.data + '-->';
- }
- return '';
- };
- var createFragment$1 = function (html) {
- var frag, node, container;
- container = document.createElement('div');
- frag = document.createDocumentFragment();
- if (html) {
- container.innerHTML = html;
- }
- while (node = container.firstChild) {
- frag.appendChild(node);
- }
- return frag;
- };
- var insertAt = function (elm, html, index) {
- var fragment = createFragment$1(html);
- if (elm.hasChildNodes() && index < elm.childNodes.length) {
- var target = elm.childNodes[index];
- target.parentNode.insertBefore(fragment, target);
- } else {
- elm.appendChild(fragment);
- }
- };
- var removeAt = function (elm, index) {
- if (elm.hasChildNodes() && index < elm.childNodes.length) {
- var target = elm.childNodes[index];
- target.parentNode.removeChild(target);
- }
- };
- var applyDiff = function (diff, elm) {
- var index = 0;
- $_6t4axrmjjgwe7jf.each(diff, function (action) {
- if (action[0] === $_2llrn562jjgwe8py.KEEP) {
- index++;
- } else if (action[0] === $_2llrn562jjgwe8py.INSERT) {
- insertAt(elm, action[1], index);
- index++;
- } else if (action[0] === $_2llrn562jjgwe8py.DELETE) {
- removeAt(elm, index);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getOuterHtml = function (elm) {
+ if (NodeType.isElement(elm)) {
+ return elm.outerHTML;
+ } else if (NodeType.isText(elm)) {
+ return Entities.encodeRaw(elm.data, false);
+ } else if (NodeType.isComment(elm)) {
+ return '<!--' + elm.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">- });
- };
- var read$3 = function (elm) {
- return $_6t4axrmjjgwe7jf.filter($_6t4axrmjjgwe7jf.map(elm.childNodes, getOuterHtml), function (item) {
- return item.length > 0;
- });
- };
- var write = function (fragments, elm) {
- var currentFragments = $_6t4axrmjjgwe7jf.map(elm.childNodes, getOuterHtml);
- applyDiff($_2llrn562jjgwe8py.diff(currentFragments, fragments), elm);
- return elm;
- };
- var $_6w5mhp61jjgwe8pt = {
- read: read$3,
- write: write
- };
-
- var fromHtml$1 = function (html, scope) {
- var doc = scope || document;
- var div = doc.createElement('div');
- div.innerHTML = html;
- return $_d3rmjp18jjgwe7nc.children(Element$$1.fromDom(div));
- };
- var fromTags = function (tags, scope) {
- return map(tags, function (x) {
- return Element$$1.fromTag(x, scope);
- });
- };
- var fromText$1 = function (texts, scope) {
- return map(texts, function (x) {
- return Element$$1.fromText(x, scope);
- });
- };
- var fromDom$1 = function (nodes) {
- return map(nodes, Element$$1.fromDom);
- };
- var $_28ipi364jjgwe8q6 = {
- fromHtml: fromHtml$1,
- fromTags: fromTags,
- fromText: fromText$1,
- fromDom: fromDom$1
- };
-
- var get$6 = function (element) {
- return element.dom().innerHTML;
- };
- var set$3 = function (element, content) {
- var owner = $_d3rmjp18jjgwe7nc.owner(element);
- var docDom = owner.dom();
- var fragment = Element$$1.fromDom(docDom.createDocumentFragment());
- var contentElements = $_28ipi364jjgwe8q6.fromHtml(content, docDom);
- $_4wf3mo1xjjgwe7sq.append(fragment, contentElements);
- $_81exq51wjjgwe7sm.empty(element);
- $_ewo3u51yjjgwe7su.append(element, fragment);
- };
- var getOuter = function (element) {
- var container = Element$$1.fromTag('div');
- var clone = Element$$1.fromDom(element.dom().cloneNode(true));
- $_ewo3u51yjjgwe7su.append(container, clone);
- return get$6(container);
- };
- var $_103qrc63jjgwe8q4 = {
- get: get$6,
- set: set$3,
- getOuter: getOuter
- };
-
- var undoLevelDocument = Cell(Option.none());
- var lazyTempDocument = function () {
- return undoLevelDocument.get().getOrThunk(function () {
- var doc = document.implementation.createHTMLDocument('undo');
- undoLevelDocument.set(Option.some(doc));
- return doc;
- });
- };
- var hasIframes = function (html) {
- return html.indexOf('</iframe>') !== -1;
- };
- var createFragmentedLevel = function (fragments) {
- return {
- type: 'fragmented',
- fragments: fragments,
- content: '',
- bookmark: null,
- beforeBookmark: null
</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 createCompleteLevel = function (content) {
- return {
- type: 'complete',
- fragments: null,
- content: content,
- bookmark: null,
- beforeBookmark: null
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createFragment$1 = function (html) {
+ var frag, node, container;
+ container = document.createElement('div');
+ frag = document.createDocumentFragment();
+ if (html) {
+ container.innerHTML = html;
+ }
+ while (node = container.firstChild) {
+ frag.appendChild(node);
+ }
+ return frag;
</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 createFromEditor = function (editor) {
- var fragments, content, trimmedFragments;
- fragments = $_6w5mhp61jjgwe8pt.read(editor.getBody());
- trimmedFragments = bind(fragments, function (html) {
- var trimmed = $_87j7cq5zjjgwe8pf.trimInternal(editor.serializer, html);
- return trimmed.length > 0 ? [trimmed] : [];
- });
- content = trimmedFragments.join('');
- return hasIframes(content) ? createFragmentedLevel(trimmedFragments) : createCompleteLevel(content);
- };
- var applyToEditor = function (editor, level, before) {
- if (level.type === 'fragmented') {
- $_6w5mhp61jjgwe8pt.write(level.fragments, editor.getBody());
- } else {
- editor.setContent(level.content, { format: 'raw' });
- }
- editor.selection.moveToBookmark(before ? level.beforeBookmark : level.bookmark);
- };
- var getLevelContent = function (level) {
- return level.type === 'fragmented' ? level.fragments.join('') : level.content;
- };
- var getCleanLevelContent = function (level) {
- var elm = Element$$1.fromTag('body', lazyTempDocument());
- $_103qrc63jjgwe8q4.set(elm, getLevelContent(level));
- each($_d3ydn427jjgwe7uf.descendants(elm, '*[data-mce-bogus]'), $_81exq51wjjgwe7sm.unwrap);
- return $_103qrc63jjgwe8q4.get(elm);
- };
- var hasEqualContent = function (level1, level2) {
- return getLevelContent(level1) === getLevelContent(level2);
- };
- var hasEqualCleanedContent = function (level1, level2) {
- return getCleanLevelContent(level1) === getCleanLevelContent(level2);
- };
- var isEq$3 = function (level1, level2) {
- if (!level1 || !level2) {
- return false;
- } else if (hasEqualContent(level1, level2)) {
- return true;
- } else {
- return hasEqualCleanedContent(level1, level2);
- }
- };
- var $_4qf2in5yjjgwe8ow = {
- createFragmentedLevel: createFragmentedLevel,
- createCompleteLevel: createCompleteLevel,
- createFromEditor: createFromEditor,
- applyToEditor: applyToEditor,
- isEq: isEq$3
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var insertAt = function (elm, html, index) {
+ var fragment = createFragment$1(html);
+ if (elm.hasChildNodes() && index < elm.childNodes.length) {
+ var target = elm.childNodes[index];
+ target.parentNode.insertBefore(fragment, target);
+ } else {
+ elm.appendChild(fragment);
+ }
+ };
+ var removeAt = function (elm, index) {
+ if (elm.hasChildNodes() && index < elm.childNodes.length) {
+ var target = elm.childNodes[index];
+ target.parentNode.removeChild(target);
+ }
+ };
+ var applyDiff = function (diff, elm) {
+ var index = 0;
+ each(diff, function (action) {
+ if (action[0] === Diff.KEEP) {
+ index++;
+ } else if (action[0] === Diff.INSERT) {
+ insertAt(elm, action[1], index);
+ index++;
+ } else if (action[0] === Diff.DELETE) {
+ removeAt(elm, index);
+ }
+ });
+ };
+ var read$3 = function (elm) {
+ return filter(map(from$1(elm.childNodes), getOuterHtml), function (item) {
+ return item.length > 0;
+ });
+ };
+ var write = function (fragments, elm) {
+ var currentFragments = map(from$1(elm.childNodes), getOuterHtml);
+ applyDiff(Diff.diff(currentFragments, fragments), elm);
+ return elm;
+ };
+ var Fragments = {
+ read: read$3,
+ write: write
+ };
</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 UndoManager (editor) {
- var self = this, index = 0, data = [], beforeBookmark, isFirstTypedCharacter, locks = 0;
- var isUnlocked = function () {
- return locks === 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var undoLevelDocument = Cell(Option.none());
+ var lazyTempDocument = function () {
+ return undoLevelDocument.get().getOrThunk(function () {
+ var doc = document.implementation.createHTMLDocument('undo');
+ undoLevelDocument.set(Option.some(doc));
+ return doc;
+ });
</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 setTyping = function (typing) {
- if (isUnlocked()) {
- self.typing = typing;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasIframes = function (html) {
+ return html.indexOf('</iframe>') !== -1;
+ };
+ var createFragmentedLevel = function (fragments) {
+ return {
+ type: 'fragmented',
+ fragments: fragments,
+ content: '',
+ bookmark: null,
+ beforeBookmark: null
+ };
+ };
+ var createCompleteLevel = function (content) {
+ return {
+ type: 'complete',
+ fragments: null,
+ content: content,
+ bookmark: null,
+ beforeBookmark: null
+ };
+ };
+ var createFromEditor = function (editor) {
+ var fragments, content, trimmedFragments;
+ fragments = Fragments.read(editor.getBody());
+ trimmedFragments = bind(fragments, function (html) {
+ var trimmed = TrimHtml.trimInternal(editor.serializer, html);
+ return trimmed.length > 0 ? [trimmed] : [];
+ });
+ content = trimmedFragments.join('');
+ return hasIframes(content) ? createFragmentedLevel(trimmedFragments) : createCompleteLevel(content);
+ };
+ var applyToEditor = function (editor, level, before) {
+ if (level.type === 'fragmented') {
+ Fragments.write(level.fragments, editor.getBody());
+ } else {
+ editor.setContent(level.content, { format: 'raw' });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.selection.moveToBookmark(before ? level.beforeBookmark : level.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 setDirty = function (state) {
- editor.setDirty(state);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getLevelContent = function (level) {
+ return level.type === 'fragmented' ? level.fragments.join('') : level.content;
</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 addNonTypingUndoLevel = function (e) {
- setTyping(false);
- self.add({}, e);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getCleanLevelContent = function (level) {
+ var elm = Element$$1.fromTag('body', lazyTempDocument());
+ set$2(elm, getLevelContent(level));
+ each(descendants$1(elm, '*[data-mce-bogus]'), unwrap);
+ return get$5(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">- var endTyping = function () {
- if (self.typing) {
- setTyping(false);
- self.add();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasEqualContent = function (level1, level2) {
+ return getLevelContent(level1) === getLevelContent(level2);
+ };
+ var hasEqualCleanedContent = function (level1, level2) {
+ return getCleanLevelContent(level1) === getCleanLevelContent(level2);
+ };
+ var isEq$3 = function (level1, level2) {
+ if (!level1 || !level2) {
+ return false;
+ } else if (hasEqualContent(level1, level2)) {
+ return true;
+ } else {
+ return hasEqualCleanedContent(level1, level2);
</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">- editor.on('init', function () {
- self.add();
- });
- editor.on('BeforeExecCommand', function (e) {
- var cmd = e.command;
- if (cmd !== 'Undo' && cmd !== 'Redo' && cmd !== 'mceRepaint') {
- endTyping();
- self.beforeChange();
- }
- });
- editor.on('ExecCommand', function (e) {
- var cmd = e.command;
- if (cmd !== 'Undo' && cmd !== 'Redo' && cmd !== 'mceRepaint') {
- addNonTypingUndoLevel(e);
- }
- });
- editor.on('ObjectResizeStart Cut', function () {
- self.beforeChange();
- });
- editor.on('SaveContent ObjectResized blur', addNonTypingUndoLevel);
- editor.on('DragEnd', addNonTypingUndoLevel);
- editor.on('KeyUp', function (e) {
- var keyCode = e.keyCode;
- if (e.isDefaultPrevented()) {
- return;
- }
- if (keyCode >= 33 && keyCode <= 36 || keyCode >= 37 && keyCode <= 40 || keyCode === 45 || e.ctrlKey) {
- addNonTypingUndoLevel();
- editor.nodeChanged();
- }
- if (keyCode === 46 || keyCode === 8) {
- editor.nodeChanged();
- }
- if (isFirstTypedCharacter && self.typing && $_4qf2in5yjjgwe8ow.isEq($_4qf2in5yjjgwe8ow.createFromEditor(editor), data[0]) === false) {
- if (editor.isDirty() === false) {
- setDirty(true);
- editor.fire('change', {
- level: data[0],
- lastLevel: null
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Levels = {
+ createFragmentedLevel: createFragmentedLevel,
+ createCompleteLevel: createCompleteLevel,
+ createFromEditor: createFromEditor,
+ applyToEditor: applyToEditor,
+ isEq: isEq$3
+ };
+
+ function UndoManager (editor) {
+ var self = this, index = 0, data = [], beforeBookmark, isFirstTypedCharacter, locks = 0;
+ var isUnlocked = function () {
+ return locks === 0;
+ };
+ var setTyping = function (typing) {
+ if (isUnlocked()) {
+ self.typing = typing;
</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('TypingUndo');
- isFirstTypedCharacter = false;
- editor.nodeChanged();
- }
- });
- editor.on('KeyDown', function (e) {
- var keyCode = e.keyCode;
- if (e.isDefaultPrevented()) {
- return;
- }
- if (keyCode >= 33 && keyCode <= 36 || keyCode >= 37 && keyCode <= 40 || keyCode === 45) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var setDirty = function (state) {
+ editor.setDirty(state);
+ };
+ var addNonTypingUndoLevel = function (e) {
+ setTyping(false);
+ self.add({}, e);
+ };
+ var endTyping = function () {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (self.typing) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ setTyping(false);
+ self.add();
+ }
+ };
+ editor.on('init', function () {
+ self.add();
+ });
+ editor.on('BeforeExecCommand', function (e) {
+ var cmd = e.command;
+ if (cmd !== 'Undo' && cmd !== 'Redo' && cmd !== 'mceRepaint') {
+ endTyping();
+ self.beforeChange();
+ }
+ });
+ editor.on('ExecCommand', function (e) {
+ var cmd = e.command;
+ if (cmd !== 'Undo' && cmd !== 'Redo' && cmd !== 'mceRepaint') {
</ins><span class="cx" style="display: block; padding: 0 10px"> addNonTypingUndoLevel(e);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return;
- }
- var modKey = e.ctrlKey && !e.altKey || e.metaKey;
- if ((keyCode < 16 || keyCode > 20) && keyCode !== 224 && keyCode !== 91 && !self.typing && !modKey) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ editor.on('ObjectResizeStart Cut', function () {
</ins><span class="cx" style="display: block; padding: 0 10px"> self.beforeChange();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- setTyping(true);
- self.add({}, e);
- isFirstTypedCharacter = true;
- }
- });
- editor.on('MouseDown', function (e) {
- if (self.typing) {
- addNonTypingUndoLevel(e);
- }
- });
- var isInsertReplacementText = function (event) {
- return event.inputType === 'insertReplacementText';
- };
- var isInsertTextDataNull = function (event) {
- return event.inputType === 'insertText' && event.data === null;
- };
- editor.on('input', function (e) {
- if (e.inputType && (isInsertReplacementText(e) || isInsertTextDataNull(e))) {
- addNonTypingUndoLevel(e);
- }
- });
- editor.addShortcut('meta+z', '', 'Undo');
- editor.addShortcut('meta+y,meta+shift+z', '', 'Redo');
- editor.on('AddUndo Undo Redo ClearUndos', function (e) {
- if (!e.isDefaultPrevented()) {
- editor.nodeChanged();
- }
- });
- self = {
- data: data,
- typing: false,
- beforeChange: function () {
- if (isUnlocked()) {
- beforeBookmark = $_ga29lf2jjjgwe7wh.getUndoBookmark(editor.selection);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ editor.on('SaveContent ObjectResized blur', addNonTypingUndoLevel);
+ editor.on('DragEnd', addNonTypingUndoLevel);
+ editor.on('KeyUp', function (e) {
+ var keyCode = e.keyCode;
+ if (e.isDefaultPrevented()) {
+ 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">- },
- add: function (level, event) {
- var i;
- var settings = editor.settings;
- var lastLevel, currentLevel;
- currentLevel = $_4qf2in5yjjgwe8ow.createFromEditor(editor);
- level = level || {};
- level = $_6cwiepljjgwe7j4.extend(level, currentLevel);
- if (isUnlocked() === false || editor.removed) {
- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (keyCode >= 33 && keyCode <= 36 || keyCode >= 37 && keyCode <= 40 || keyCode === 45 || e.ctrlKey) {
+ addNonTypingUndoLevel();
+ 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">- lastLevel = data[index];
- if (editor.fire('BeforeAddUndo', {
- level: level,
- lastLevel: lastLevel,
- originalEvent: event
- }).isDefaultPrevented()) {
- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (keyCode === 46 || keyCode === 8) {
+ 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 (lastLevel && $_4qf2in5yjjgwe8ow.isEq(lastLevel, level)) {
- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isFirstTypedCharacter && self.typing && Levels.isEq(Levels.createFromEditor(editor), data[0]) === false) {
+ if (editor.isDirty() === false) {
+ setDirty(true);
+ editor.fire('change', {
+ level: data[0],
+ lastLevel: null
+ });
+ }
+ editor.fire('TypingUndo');
+ isFirstTypedCharacter = false;
+ 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[index]) {
- data[index].beforeBookmark = beforeBookmark;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ editor.on('KeyDown', function (e) {
+ var keyCode = e.keyCode;
+ if (e.isDefaultPrevented()) {
+ 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 (settings.custom_undo_redo_levels) {
- if (data.length > settings.custom_undo_redo_levels) {
- for (i = 0; i < data.length - 1; i++) {
- data[i] = data[i + 1];
- }
- data.length--;
- index = data.length;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (keyCode >= 33 && keyCode <= 36 || keyCode >= 37 && keyCode <= 40 || keyCode === 45) {
+ if (self.typing) {
+ addNonTypingUndoLevel(e);
</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;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- level.bookmark = $_ga29lf2jjjgwe7wh.getUndoBookmark(editor.selection);
- if (index < data.length - 1) {
- data.length = index + 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var modKey = e.ctrlKey && !e.altKey || e.metaKey;
+ if ((keyCode < 16 || keyCode > 20) && keyCode !== 224 && keyCode !== 91 && !self.typing && !modKey) {
+ self.beforeChange();
+ setTyping(true);
+ self.add({}, e);
+ isFirstTypedCharacter = 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">- data.push(level);
- index = data.length - 1;
- var args = {
- level: level,
- lastLevel: lastLevel,
- originalEvent: event
- };
- editor.fire('AddUndo', args);
- if (index > 0) {
- setDirty(true);
- editor.fire('change', args);
- }
- return level;
- },
- undo: function () {
- var level;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ editor.on('MouseDown', function (e) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (self.typing) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.add();
- self.typing = false;
- setTyping(false);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ addNonTypingUndoLevel(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">- if (index > 0) {
- level = data[--index];
- $_4qf2in5yjjgwe8ow.applyToEditor(editor, level, true);
- setDirty(true);
- editor.fire('undo', { level: level });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ var isInsertReplacementText = function (event) {
+ return event.inputType === 'insertReplacementText';
+ };
+ var isInsertTextDataNull = function (event) {
+ return event.inputType === 'insertText' && event.data === null;
+ };
+ editor.on('input', function (e) {
+ if (e.inputType && (isInsertReplacementText(e) || isInsertTextDataNull(e))) {
+ addNonTypingUndoLevel(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">- return level;
- },
- redo: function () {
- var level;
- if (index < data.length - 1) {
- level = data[++index];
- $_4qf2in5yjjgwe8ow.applyToEditor(editor, level, false);
- setDirty(true);
- editor.fire('redo', { level: level });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ editor.addShortcut('meta+z', '', 'Undo');
+ editor.addShortcut('meta+y,meta+shift+z', '', 'Redo');
+ editor.on('AddUndo Undo Redo ClearUndos', function (e) {
+ if (!e.isDefaultPrevented()) {
+ 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 level;
- },
- clear: function () {
- data = [];
- index = 0;
- self.typing = false;
- self.data = data;
- editor.fire('ClearUndos');
- },
- hasUndo: function () {
- return index > 0 || self.typing && data[0] && !$_4qf2in5yjjgwe8ow.isEq($_4qf2in5yjjgwe8ow.createFromEditor(editor), data[0]);
- },
- hasRedo: function () {
- return index < data.length - 1 && !self.typing;
- },
- transact: function (callback) {
- endTyping();
- self.beforeChange();
- self.ignore(callback);
- return self.add();
- },
- ignore: function (callback) {
- try {
- locks++;
- callback();
- } finally {
- locks--;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ self = {
+ data: data,
+ typing: false,
+ beforeChange: function () {
+ if (isUnlocked()) {
+ beforeBookmark = GetBookmark.getUndoBookmark(editor.selection);
+ }
+ },
+ add: function (level, event) {
+ var i;
+ var settings = editor.settings;
+ var lastLevel, currentLevel;
+ currentLevel = Levels.createFromEditor(editor);
+ level = level || {};
+ level = Tools.extend(level, currentLevel);
+ if (isUnlocked() === false || editor.removed) {
+ return null;
+ }
+ lastLevel = data[index];
+ if (editor.fire('BeforeAddUndo', {
+ level: level,
+ lastLevel: lastLevel,
+ originalEvent: event
+ }).isDefaultPrevented()) {
+ return null;
+ }
+ if (lastLevel && Levels.isEq(lastLevel, level)) {
+ return null;
+ }
+ if (data[index]) {
+ data[index].beforeBookmark = beforeBookmark;
+ }
+ if (settings.custom_undo_redo_levels) {
+ if (data.length > settings.custom_undo_redo_levels) {
+ for (i = 0; i < data.length - 1; i++) {
+ data[i] = data[i + 1];
+ }
+ data.length--;
+ index = data.length;
+ }
+ }
+ level.bookmark = GetBookmark.getUndoBookmark(editor.selection);
+ if (index < data.length - 1) {
+ data.length = index + 1;
+ }
+ data.push(level);
+ index = data.length - 1;
+ var args = {
+ level: level,
+ lastLevel: lastLevel,
+ originalEvent: event
+ };
+ editor.fire('AddUndo', args);
+ if (index > 0) {
+ setDirty(true);
+ editor.fire('change', args);
+ }
+ return level;
+ },
+ undo: function () {
+ var level;
+ if (self.typing) {
+ self.add();
+ self.typing = false;
+ setTyping(false);
+ }
+ if (index > 0) {
+ level = data[--index];
+ Levels.applyToEditor(editor, level, true);
+ setDirty(true);
+ editor.fire('undo', { level: level });
+ }
+ return level;
+ },
+ redo: function () {
+ var level;
+ if (index < data.length - 1) {
+ level = data[++index];
+ Levels.applyToEditor(editor, level, false);
+ setDirty(true);
+ editor.fire('redo', { level: level });
+ }
+ return level;
+ },
+ clear: function () {
+ data = [];
+ index = 0;
+ self.typing = false;
+ self.data = data;
+ editor.fire('ClearUndos');
+ },
+ hasUndo: function () {
+ return index > 0 || self.typing && data[0] && !Levels.isEq(Levels.createFromEditor(editor), data[0]);
+ },
+ hasRedo: function () {
+ return index < data.length - 1 && !self.typing;
+ },
+ transact: function (callback) {
+ endTyping();
+ self.beforeChange();
+ self.ignore(callback);
+ return self.add();
+ },
+ ignore: function (callback) {
+ try {
+ locks++;
+ callback();
+ } finally {
+ locks--;
+ }
+ },
+ extra: function (callback1, callback2) {
+ var lastLevel, bookmark;
+ if (self.transact(callback1)) {
+ bookmark = data[index].bookmark;
+ lastLevel = data[index - 1];
+ Levels.applyToEditor(editor, lastLevel, true);
+ if (self.transact(callback2)) {
+ data[index - 1].beforeBookmark = 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">- },
- extra: function (callback1, callback2) {
- var lastLevel, bookmark;
- if (self.transact(callback1)) {
- bookmark = data[index].bookmark;
- lastLevel = data[index - 1];
- $_4qf2in5yjjgwe8ow.applyToEditor(editor, lastLevel, true);
- if (self.transact(callback2)) {
- data[index - 1].beforeBookmark = bookmark;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ return self;
+ }
+
+ var isEq$4 = FormatUtils.isEq;
+ var matchesUnInheritedFormatSelector = function (ed, node, name) {
+ var formatList = ed.formatter.get(name);
+ if (formatList) {
+ for (var i = 0; i < formatList.length; i++) {
+ if (formatList[i].inherit === false && ed.dom.is(node, formatList[i].selector)) {
+ return true;
</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><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">- return self;
- }
-
- function Experimental (editor) {
- var annotator = Annotator(editor);
- var experimental = {};
- Object.defineProperty(experimental, 'annotator', {
- get: function () {
- console.warn('Using experimental API: annotator');
- return annotator;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var matchParents = function (editor, node, name, vars) {
+ var root = editor.dom.getRoot();
+ if (node === root) {
+ 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 experimental;
- }
-
- var isEq$4 = $_4301413ajjgwe82g.isEq;
- var matchesUnInheritedFormatSelector = function (ed, node, name) {
- var formatList = ed.formatter.get(name);
- if (formatList) {
- for (var i = 0; i < formatList.length; i++) {
- if (formatList[i].inherit === false && ed.dom.is(node, formatList[i].selector)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ node = editor.dom.getParent(node, function (node) {
+ if (matchesUnInheritedFormatSelector(editor, node, name)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return node.parentNode === root || !!matchNode(editor, node, name, vars, true);
+ });
+ return matchNode(editor, node, name, vars);
+ };
+ var matchName = function (dom, node, format) {
+ if (isEq$4(node, format.inline)) {
+ 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;
- };
- var matchParents = function (editor, node, name, vars) {
- var root = editor.dom.getRoot();
- if (node === root) {
- return false;
- }
- node = editor.dom.getParent(node, function (node) {
- if (matchesUnInheritedFormatSelector(editor, node, name)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isEq$4(node, format.block)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return node.parentNode === root || !!matchNode(editor, node, name, vars, true);
- });
- return matchNode(editor, node, name, vars);
- };
- var matchName = function (dom, node, format) {
- if (isEq$4(node, format.inline)) {
- return true;
- }
- if (isEq$4(node, format.block)) {
- return true;
- }
- if (format.selector) {
- return node.nodeType === 1 && dom.is(node, format.selector);
- }
- };
- var matchItems = function (dom, node, format, itemName, similar, vars) {
- var key, value;
- var items = format[itemName];
- var i;
- if (format.onmatch) {
- return format.onmatch(node, format, itemName);
- }
- if (items) {
- if (typeof items.length === 'undefined') {
- for (key in items) {
- if (items.hasOwnProperty(key)) {
- if (itemName === 'attributes') {
- value = dom.getAttrib(node, key);
- } else {
- value = $_4301413ajjgwe82g.getStyle(dom, node, key);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (format.selector) {
+ return node.nodeType === 1 && dom.is(node, format.selector);
+ }
+ };
+ var matchItems = function (dom, node, format, itemName, similar, vars) {
+ var key, value;
+ var items = format[itemName];
+ var i;
+ if (format.onmatch) {
+ return format.onmatch(node, format, itemName);
+ }
+ if (items) {
+ if (typeof items.length === 'undefined') {
+ for (key in items) {
+ if (items.hasOwnProperty(key)) {
+ if (itemName === 'attributes') {
+ value = dom.getAttrib(node, key);
+ } else {
+ value = FormatUtils.getStyle(dom, node, key);
+ }
+ if (similar && !value && !format.exact) {
+ return;
+ }
+ if ((!similar || format.exact) && !isEq$4(value, FormatUtils.normalizeStyleValue(dom, FormatUtils.replaceVars(items[key], vars), key))) {
+ 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 (similar && !value && !format.exact) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ } else {
+ for (i = 0; i < items.length; i++) {
+ if (itemName === 'attributes' ? dom.getAttrib(node, items[i]) : FormatUtils.getStyle(dom, node, items[i])) {
+ return format;
</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 ((!similar || format.exact) && !isEq$4(value, $_4301413ajjgwe82g.normalizeStyleValue(dom, $_4301413ajjgwe82g.replaceVars(items[key], vars), key))) {
- return;
- }
</del><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">- } else {
- for (i = 0; i < items.length; i++) {
- if (itemName === 'attributes' ? dom.getAttrib(node, items[i]) : $_4301413ajjgwe82g.getStyle(dom, node, items[i])) {
- return format;
- }
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- return format;
- };
- var matchNode = function (ed, node, name, vars, similar) {
- var formatList = ed.formatter.get(name);
- var format, i, x, classes;
- var dom = ed.dom;
- if (formatList && node) {
- for (i = 0; i < formatList.length; i++) {
- format = formatList[i];
- if (matchName(ed.dom, node, format) && matchItems(dom, node, format, 'attributes', similar, vars) && matchItems(dom, node, format, 'styles', similar, vars)) {
- if (classes = format.classes) {
- for (x = 0; x < classes.length; x++) {
- if (!ed.dom.hasClass(node, classes[x])) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return format;
+ };
+ var matchNode = function (ed, node, name, vars, similar) {
+ var formatList = ed.formatter.get(name);
+ var format, i, x, classes;
+ var dom = ed.dom;
+ if (formatList && node) {
+ for (i = 0; i < formatList.length; i++) {
+ format = formatList[i];
+ if (matchName(ed.dom, node, format) && matchItems(dom, node, format, 'attributes', similar, vars) && matchItems(dom, node, format, 'styles', similar, vars)) {
+ if (classes = format.classes) {
+ for (x = 0; x < classes.length; x++) {
+ if (!ed.dom.hasClass(node, classes[x])) {
+ return;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return format;
</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 format;
</del><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">- }
- };
- var match = function (editor, name, vars, node) {
- var startNode;
- if (node) {
- return matchParents(editor, node, name, vars);
- }
- node = editor.selection.getNode();
- if (matchParents(editor, node, name, vars)) {
- return true;
- }
- startNode = editor.selection.getStart();
- if (startNode !== node) {
- if (matchParents(editor, startNode, name, vars)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var match = function (editor, name, vars, node) {
+ var startNode;
+ if (node) {
+ return matchParents(editor, node, name, vars);
+ }
+ node = editor.selection.getNode();
+ if (matchParents(editor, node, name, vars)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><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;
- };
- var matchAll = function (editor, names, vars) {
- var startElement;
- var matchedFormatNames = [];
- var checkedMap = {};
- startElement = editor.selection.getStart();
- editor.dom.getParent(startElement, function (node) {
- var i, name;
- for (i = 0; i < names.length; i++) {
- name = names[i];
- if (!checkedMap[name] && matchNode(editor, node, name, vars)) {
- checkedMap[name] = true;
- matchedFormatNames.push(name);
- }
- }
- }, editor.dom.getRoot());
- return matchedFormatNames;
- };
- var canApply = function (editor, name) {
- var formatList = editor.formatter.get(name);
- var startNode, parents, i, x, selector;
- var dom = editor.dom;
- if (formatList) {
</del><span class="cx" style="display: block; padding: 0 10px"> startNode = editor.selection.getStart();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- parents = $_4301413ajjgwe82g.getParents(dom, startNode);
- for (x = formatList.length - 1; x >= 0; x--) {
- selector = formatList[x].selector;
- if (!selector || formatList[x].defaultBlock) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (startNode !== node) {
+ if (matchParents(editor, startNode, name, vars)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><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 = parents.length - 1; i >= 0; i--) {
- if (dom.is(parents[i], selector)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ return false;
+ };
+ var matchAll = function (editor, names, vars) {
+ var startElement;
+ var matchedFormatNames = [];
+ var checkedMap = {};
+ startElement = editor.selection.getStart();
+ editor.dom.getParent(startElement, function (node) {
+ var i, name;
+ for (i = 0; i < names.length; i++) {
+ name = names[i];
+ if (!checkedMap[name] && matchNode(editor, node, name, vars)) {
+ checkedMap[name] = true;
+ matchedFormatNames.push(name);
+ }
+ }
+ }, editor.dom.getRoot());
+ return matchedFormatNames;
+ };
+ var canApply = function (editor, name) {
+ var formatList = editor.formatter.get(name);
+ var startNode, parents, i, x, selector;
+ var dom = editor.dom;
+ if (formatList) {
+ startNode = editor.selection.getStart();
+ parents = FormatUtils.getParents(dom, startNode);
+ for (x = formatList.length - 1; x >= 0; x--) {
+ selector = formatList[x].selector;
+ if (!selector || formatList[x].defaultBlock) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (i = parents.length - 1; i >= 0; i--) {
+ if (dom.is(parents[i], selector)) {
+ return true;
+ }
+ }
</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">- }
- return false;
- };
- var $_7svyif69jjgwe8rf = {
- matchNode: matchNode,
- matchName: matchName,
- match: match,
- matchAll: matchAll,
- canApply: canApply,
- matchesUnInheritedFormatSelector: matchesUnInheritedFormatSelector
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return false;
+ };
+ var MatchFormat = {
+ matchNode: matchNode,
+ matchName: matchName,
+ match: match,
+ matchAll: matchAll,
+ canApply: canApply,
+ matchesUnInheritedFormatSelector: matchesUnInheritedFormatSelector
+ };
</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 splitText = function (node, offset) {
- return node.splitText(offset);
- };
- var split$1 = function (rng) {
- var startContainer = rng.startContainer, startOffset = rng.startOffset, endContainer = rng.endContainer, endOffset = rng.endOffset;
- if (startContainer === endContainer && $_3b9u2y1rjjgwe7qe.isText(startContainer)) {
- if (startOffset > 0 && startOffset < startContainer.nodeValue.length) {
- endContainer = splitText(startContainer, startOffset);
- startContainer = endContainer.previousSibling;
- if (endOffset > startOffset) {
- endOffset = endOffset - startOffset;
- startContainer = endContainer = splitText(endContainer, endOffset).previousSibling;
- endOffset = endContainer.nodeValue.length;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var splitText = function (node, offset) {
+ return node.splitText(offset);
+ };
+ var split$1 = function (rng) {
+ var startContainer = rng.startContainer, startOffset = rng.startOffset, endContainer = rng.endContainer, endOffset = rng.endOffset;
+ if (startContainer === endContainer && NodeType.isText(startContainer)) {
+ if (startOffset > 0 && startOffset < startContainer.nodeValue.length) {
+ endContainer = splitText(startContainer, startOffset);
+ startContainer = endContainer.previousSibling;
+ if (endOffset > startOffset) {
+ endOffset = endOffset - startOffset;
+ startContainer = endContainer = splitText(endContainer, endOffset).previousSibling;
+ endOffset = endContainer.nodeValue.length;
+ startOffset = 0;
+ } else {
+ endOffset = 0;
+ }
+ }
+ } else {
+ if (NodeType.isText(startContainer) && startOffset > 0 && startOffset < startContainer.nodeValue.length) {
+ startContainer = splitText(startContainer, startOffset);
</ins><span class="cx" style="display: block; padding: 0 10px"> startOffset = 0;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- endOffset = 0;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (NodeType.isText(endContainer) && endOffset > 0 && endOffset < endContainer.nodeValue.length) {
+ endContainer = splitText(endContainer, endOffset).previousSibling;
+ endOffset = endContainer.nodeValue.length;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- if ($_3b9u2y1rjjgwe7qe.isText(startContainer) && startOffset > 0 && startOffset < startContainer.nodeValue.length) {
- startContainer = splitText(startContainer, startOffset);
- startOffset = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return {
+ startContainer: startContainer,
+ startOffset: startOffset,
+ endContainer: endContainer,
+ endOffset: endOffset
+ };
+ };
+ var SplitRange = { split: split$1 };
+
+ var ZWSP$1 = Zwsp.ZWSP, CARET_ID$1 = '_mce_caret';
+ var importNode = function (ownerDocument, node) {
+ return ownerDocument.importNode(node, true);
+ };
+ var getEmptyCaretContainers = function (node) {
+ var nodes = [];
+ while (node) {
+ if (node.nodeType === 3 && node.nodeValue !== ZWSP$1 || node.childNodes.length > 1) {
+ return [];
+ }
+ if (node.nodeType === 1) {
+ nodes.push(node);
+ }
+ node = node.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">- if ($_3b9u2y1rjjgwe7qe.isText(endContainer) && endOffset > 0 && endOffset < endContainer.nodeValue.length) {
- endContainer = splitText(endContainer, endOffset).previousSibling;
- endOffset = endContainer.nodeValue.length;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return nodes;
+ };
+ var isCaretContainerEmpty = function (node) {
+ return getEmptyCaretContainers(node).length > 0;
+ };
+ var findFirstTextNode = function (node) {
+ var walker;
+ if (node) {
+ walker = new TreeWalker(node, node);
+ for (node = walker.current(); node; node = walker.next()) {
+ if (node.nodeType === 3) {
+ return 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 {
- startContainer: startContainer,
- startOffset: startOffset,
- endContainer: endContainer,
- endOffset: endOffset
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- };
- var $_10670d6ajjgwe8rj = { split: split$1 };
-
- var ZWSP$1 = $_2xw7ul2pjjgwe7xs.ZWSP;
- var CARET_ID$1 = '_mce_caret';
- var importNode = function (ownerDocument, node) {
- return ownerDocument.importNode(node, true);
- };
- var getEmptyCaretContainers = function (node) {
- var nodes = [];
- while (node) {
- if (node.nodeType === 3 && node.nodeValue !== ZWSP$1 || node.childNodes.length > 1) {
- return [];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var createCaretContainer = function (fill) {
+ var caretContainer = Element$$1.fromTag('span');
+ setAll(caretContainer, {
+ 'id': CARET_ID$1,
+ 'data-mce-bogus': '1',
+ 'data-mce-type': 'format-caret'
+ });
+ if (fill) {
+ append(caretContainer, Element$$1.fromText(ZWSP$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 (node.nodeType === 1) {
- nodes.push(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return caretContainer;
+ };
+ var trimZwspFromCaretContainer = function (caretContainerNode) {
+ var textNode = findFirstTextNode(caretContainerNode);
+ if (textNode && textNode.nodeValue.charAt(0) === ZWSP$1) {
+ textNode.deleteData(0, 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">- node = node.firstChild;
- }
- return nodes;
- };
- var isCaretContainerEmpty = function (node) {
- return getEmptyCaretContainers(node).length > 0;
- };
- var findFirstTextNode = function (node) {
- var walker;
- if (node) {
- walker = new TreeWalker(node, node);
- for (node = walker.current(); node; node = walker.next()) {
- if (node.nodeType === 3) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return textNode;
+ };
+ var removeCaretContainerNode = function (editor, node, moveCaret) {
+ if (moveCaret === void 0) {
+ moveCaret = true;
+ }
+ var dom = editor.dom, selection = editor.selection;
+ if (isCaretContainerEmpty(node)) {
+ DeleteElement.deleteElement(editor, false, Element$$1.fromDom(node), moveCaret);
+ } else {
+ var rng = selection.getRng();
+ var block = dom.getParent(node, dom.isBlock);
+ var textNode = trimZwspFromCaretContainer(node);
+ if (rng.startContainer === textNode && rng.startOffset > 0) {
+ rng.setStart(textNode, rng.startOffset - 1);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rng.endContainer === textNode && rng.endOffset > 0) {
+ rng.setEnd(textNode, rng.endOffset - 1);
+ }
+ dom.remove(node, true);
+ if (block && dom.isEmpty(block)) {
+ PaddingBr.fillWithPaddingBr(Element$$1.fromDom(block));
+ }
+ selection.setRng(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">- }
- return null;
- };
- var createCaretContainer = function (fill) {
- var caretContainer = Element$$1.fromTag('span');
- $_etx7gr15jjgwe7mr.setAll(caretContainer, {
- 'id': CARET_ID$1,
- 'data-mce-bogus': '1',
- 'data-mce-type': 'format-caret'
- });
- if (fill) {
- $_ewo3u51yjjgwe7su.append(caretContainer, Element$$1.fromText(ZWSP$1));
- }
- return caretContainer;
- };
- var trimZwspFromCaretContainer = function (caretContainerNode) {
- var textNode = findFirstTextNode(caretContainerNode);
- if (textNode && textNode.nodeValue.charAt(0) === ZWSP$1) {
- textNode.deleteData(0, 1);
- }
- return textNode;
- };
- var removeCaretContainerNode = function (dom, selection, node, moveCaret) {
- var rng, block, textNode;
- rng = selection.getRng(true);
- block = dom.getParent(node, dom.isBlock);
- if (isCaretContainerEmpty(node)) {
- if (moveCaret !== false) {
- rng.setStartBefore(node);
- rng.setEndBefore(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var removeCaretContainer = function (editor, node, moveCaret) {
+ if (moveCaret === void 0) {
+ moveCaret = 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">- dom.remove(node);
- } else {
- textNode = trimZwspFromCaretContainer(node);
- if (rng.startContainer === textNode && rng.startOffset > 0) {
- rng.setStart(textNode, rng.startOffset - 1);
- }
- if (rng.endContainer === textNode && rng.endOffset > 0) {
- rng.setEnd(textNode, rng.endOffset - 1);
- }
- dom.remove(node, true);
- }
- if (block && dom.isEmpty(block)) {
- $_fhp7pa3ljjgwe84n.fillWithPaddingBr(Element$$1.fromDom(block));
- }
- selection.setRng(rng);
- };
- var removeCaretContainer = function (body, dom, selection, node, moveCaret) {
- if (!node) {
- node = getParentCaretContainer(body, selection.getStart());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var dom = editor.dom, selection = editor.selection;
</ins><span class="cx" style="display: block; padding: 0 10px"> if (!node) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- while (node = dom.get(CARET_ID$1)) {
- removeCaretContainerNode(dom, selection, node, false);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ node = getParentCaretContainer(editor.getBody(), selection.getStart());
+ if (!node) {
+ while (node = dom.get(CARET_ID$1)) {
+ removeCaretContainerNode(editor, node, false);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ removeCaretContainerNode(editor, node, moveCaret);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- removeCaretContainerNode(dom, selection, node, moveCaret);
- }
- };
- var insertCaretContainerNode = function (editor, caretContainer, formatNode) {
- var dom = editor.dom, block = dom.getParent(formatNode, $_4127e12ljjgwe7ww.curry($_4301413ajjgwe82g.isTextBlock, editor));
- if (block && dom.isEmpty(block)) {
- formatNode.parentNode.replaceChild(caretContainer, formatNode);
- } else {
- $_fhp7pa3ljjgwe84n.removeTrailingBr(Element$$1.fromDom(formatNode));
- if (dom.isEmpty(formatNode)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var insertCaretContainerNode = function (editor, caretContainer, formatNode) {
+ var dom = editor.dom, block = dom.getParent(formatNode, curry(FormatUtils.isTextBlock, editor));
+ if (block && dom.isEmpty(block)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> formatNode.parentNode.replaceChild(caretContainer, formatNode);
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- dom.insertAfter(caretContainer, formatNode);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ PaddingBr.removeTrailingBr(Element$$1.fromDom(formatNode));
+ if (dom.isEmpty(formatNode)) {
+ formatNode.parentNode.replaceChild(caretContainer, formatNode);
+ } else {
+ dom.insertAfter(caretContainer, formatNode);
+ }
</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 appendNode = function (parentNode, node) {
- parentNode.appendChild(node);
- return node;
- };
- var insertFormatNodesIntoCaretContainer = function (formatNodes, caretContainer) {
- var innerMostFormatNode = foldr(formatNodes, function (parentNode, formatNode) {
- return appendNode(parentNode, formatNode.cloneNode(false));
- }, caretContainer);
- return appendNode(innerMostFormatNode, innerMostFormatNode.ownerDocument.createTextNode(ZWSP$1));
- };
- var applyCaretFormat = function (editor, name, vars) {
- var rng, caretContainer, textNode, offset, bookmark, container, text;
- var selection = editor.selection;
- rng = selection.getRng(true);
- offset = rng.startOffset;
- container = rng.startContainer;
- text = container.nodeValue;
- caretContainer = getParentCaretContainer(editor.getBody(), selection.getStart());
- if (caretContainer) {
- textNode = findFirstTextNode(caretContainer);
- }
- var wordcharRegex = /[^\s\u00a0\u00ad\u200b\ufeff]/;
- if (text && offset > 0 && offset < text.length && wordcharRegex.test(text.charAt(offset)) && wordcharRegex.test(text.charAt(offset - 1))) {
- bookmark = selection.getBookmark();
- rng.collapse(true);
- rng = $_1f06hv2ujjgwe7y7.expandRng(editor, rng, editor.formatter.get(name));
- rng = $_10670d6ajjgwe8rj.split(rng);
- editor.formatter.apply(name, vars, rng);
- selection.moveToBookmark(bookmark);
- } else {
- if (!caretContainer || textNode.nodeValue !== ZWSP$1) {
- caretContainer = importNode(editor.getDoc(), createCaretContainer(true).dom());
- textNode = caretContainer.firstChild;
- rng.insertNode(caretContainer);
- offset = 1;
- editor.formatter.apply(name, vars, caretContainer);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var appendNode = function (parentNode, node) {
+ parentNode.appendChild(node);
+ return node;
+ };
+ var insertFormatNodesIntoCaretContainer = function (formatNodes, caretContainer) {
+ var innerMostFormatNode = foldr(formatNodes, function (parentNode, formatNode) {
+ return appendNode(parentNode, formatNode.cloneNode(false));
+ }, caretContainer);
+ return appendNode(innerMostFormatNode, innerMostFormatNode.ownerDocument.createTextNode(ZWSP$1));
+ };
+ var applyCaretFormat = function (editor, name$$1, vars) {
+ var rng, caretContainer, textNode, offset, bookmark, container, text;
+ var selection = editor.selection;
+ rng = selection.getRng(true);
+ offset = rng.startOffset;
+ container = rng.startContainer;
+ text = container.nodeValue;
+ caretContainer = getParentCaretContainer(editor.getBody(), selection.getStart());
+ if (caretContainer) {
+ textNode = findFirstTextNode(caretContainer);
+ }
+ var wordcharRegex = /[^\s\u00a0\u00ad\u200b\ufeff]/;
+ if (text && offset > 0 && offset < text.length && wordcharRegex.test(text.charAt(offset)) && wordcharRegex.test(text.charAt(offset - 1))) {
+ bookmark = selection.getBookmark();
+ rng.collapse(true);
+ rng = ExpandRange.expandRng(editor, rng, editor.formatter.get(name$$1));
+ rng = SplitRange.split(rng);
+ editor.formatter.apply(name$$1, vars, rng);
+ selection.moveToBookmark(bookmark);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- editor.formatter.apply(name, vars, caretContainer);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!caretContainer || textNode.nodeValue !== ZWSP$1) {
+ caretContainer = importNode(editor.getDoc(), createCaretContainer(true).dom());
+ textNode = caretContainer.firstChild;
+ rng.insertNode(caretContainer);
+ offset = 1;
+ editor.formatter.apply(name$$1, vars, caretContainer);
+ } else {
+ editor.formatter.apply(name$$1, vars, caretContainer);
+ }
+ selection.setCursorLocation(textNode, 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">- selection.setCursorLocation(textNode, offset);
- }
- };
- var removeCaretFormat = function (editor, name, vars, similar) {
- var dom = editor.dom, selection = editor.selection;
- var container, offset, bookmark;
- var hasContentAfter, node, formatNode;
- var parents = [], rng = selection.getRng();
- var caretContainer;
- container = rng.startContainer;
- offset = rng.startOffset;
- node = container;
- if (container.nodeType === 3) {
- if (offset !== container.nodeValue.length) {
- hasContentAfter = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var removeCaretFormat = function (editor, name$$1, vars, similar) {
+ var dom = editor.dom, selection = editor.selection;
+ var container, offset, bookmark;
+ var hasContentAfter, node, formatNode;
+ var parents = [], rng = selection.getRng();
+ var caretContainer;
+ container = rng.startContainer;
+ offset = rng.startOffset;
+ node = container;
+ if (container.nodeType === 3) {
+ if (offset !== container.nodeValue.length) {
+ hasContentAfter = true;
+ }
+ 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">- node = node.parentNode;
- }
- while (node) {
- if ($_7svyif69jjgwe8rf.matchNode(editor, node, name, vars, similar)) {
- formatNode = node;
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ while (node) {
+ if (MatchFormat.matchNode(editor, node, name$$1, vars, similar)) {
+ formatNode = node;
+ break;
+ }
+ if (node.nextSibling) {
+ hasContentAfter = true;
+ }
+ parents.push(node);
+ 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">- if (node.nextSibling) {
- hasContentAfter = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!formatNode) {
+ 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">- parents.push(node);
- node = node.parentNode;
- }
- if (!formatNode) {
- return;
- }
- if (hasContentAfter) {
- bookmark = selection.getBookmark();
- rng.collapse(true);
- var expandedRng = $_1f06hv2ujjgwe7y7.expandRng(editor, rng, editor.formatter.get(name), true);
- expandedRng = $_10670d6ajjgwe8rj.split(expandedRng);
- editor.formatter.remove(name, vars, expandedRng);
- selection.moveToBookmark(bookmark);
- } else {
- caretContainer = getParentCaretContainer(editor.getBody(), formatNode);
- var newCaretContainer = createCaretContainer(false).dom();
- var caretNode = insertFormatNodesIntoCaretContainer(parents, newCaretContainer);
- if (caretContainer) {
- insertCaretContainerNode(editor, newCaretContainer, caretContainer);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (hasContentAfter) {
+ bookmark = selection.getBookmark();
+ rng.collapse(true);
+ var expandedRng = ExpandRange.expandRng(editor, rng, editor.formatter.get(name$$1), true);
+ expandedRng = SplitRange.split(expandedRng);
+ editor.formatter.remove(name$$1, vars, expandedRng);
+ selection.moveToBookmark(bookmark);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- insertCaretContainerNode(editor, newCaretContainer, formatNode);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ caretContainer = getParentCaretContainer(editor.getBody(), formatNode);
+ var newCaretContainer = createCaretContainer(false).dom();
+ var caretNode = insertFormatNodesIntoCaretContainer(parents, newCaretContainer);
+ if (caretContainer) {
+ insertCaretContainerNode(editor, newCaretContainer, caretContainer);
+ } else {
+ insertCaretContainerNode(editor, newCaretContainer, formatNode);
+ }
+ removeCaretContainerNode(editor, caretContainer, false);
+ selection.setCursorLocation(caretNode, 1);
+ if (dom.isEmpty(formatNode)) {
+ dom.remove(formatNode);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- removeCaretContainerNode(dom, selection, caretContainer, false);
- selection.setCursorLocation(caretNode, 1);
- if (dom.isEmpty(formatNode)) {
- dom.remove(formatNode);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var disableCaretContainer = function (editor, keyCode) {
+ var selection = editor.selection, body = editor.getBody();
+ removeCaretContainer(editor, null, false);
+ if ((keyCode === 8 || keyCode === 46) && selection.isCollapsed() && selection.getStart().innerHTML === ZWSP$1) {
+ removeCaretContainer(editor, getParentCaretContainer(body, selection.getStart()));
</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 disableCaretContainer = function (body, dom, selection, keyCode) {
- removeCaretContainer(body, dom, selection, null, false);
- if (keyCode === 8 && selection.isCollapsed() && selection.getStart().innerHTML === ZWSP$1) {
- removeCaretContainer(body, dom, selection, getParentCaretContainer(body, selection.getStart()));
- }
- if (keyCode === 37 || keyCode === 39) {
- removeCaretContainer(body, dom, selection, getParentCaretContainer(body, selection.getStart()));
- }
- };
- var setup$4 = function (editor) {
- var dom = editor.dom, selection = editor.selection;
- var body = editor.getBody();
- editor.on('mouseup keydown', function (e) {
- disableCaretContainer(body, dom, selection, e.keyCode);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (keyCode === 37 || keyCode === 39) {
+ removeCaretContainer(editor, getParentCaretContainer(body, selection.getStart()));
+ }
+ };
+ var setup$4 = function (editor) {
+ editor.on('mouseup keydown', function (e) {
+ disableCaretContainer(editor, e.keyCode);
+ });
+ };
+ var replaceWithCaretFormat = function (targetNode, formatNodes) {
+ var caretContainer = createCaretContainer(false);
+ var innerMost = insertFormatNodesIntoCaretContainer(formatNodes, caretContainer.dom());
+ before(Element$$1.fromDom(targetNode), caretContainer);
+ remove$2(Element$$1.fromDom(targetNode));
+ return CaretPosition$1(innerMost, 0);
+ };
+ var isFormatElement = function (editor, element) {
+ var inlineElements = editor.schema.getTextInlineElements();
+ return inlineElements.hasOwnProperty(name(element)) && !isCaretNode(element.dom()) && !NodeType.isBogus(element.dom());
+ };
+ var isEmptyCaretFormatElement = function (element) {
+ return isCaretNode(element.dom()) && isCaretContainerEmpty(element.dom());
+ };
+
+ var postProcessHooks = {}, filter$2 = ArrUtils.filter, each$c = ArrUtils.each;
+ var addPostProcessHook = function (name, hook) {
+ var hooks = postProcessHooks[name];
+ if (!hooks) {
+ postProcessHooks[name] = hooks = [];
+ }
+ postProcessHooks[name].push(hook);
+ };
+ var postProcess = function (name, editor) {
+ each$c(postProcessHooks[name], function (hook) {
+ hook(editor);
+ });
+ };
+ addPostProcessHook('pre', function (editor) {
+ var rng = editor.selection.getRng();
+ var isPre, blocks;
+ var hasPreSibling = function (pre) {
+ return isPre(pre.previousSibling) && ArrUtils.indexOf(blocks, pre.previousSibling) !== -1;
+ };
+ var joinPre = function (pre1, pre2) {
+ DomQuery(pre2).remove();
+ DomQuery(pre1).append('<br><br>').append(pre2.childNodes);
+ };
+ isPre = NodeType.matchNodeNames('pre');
+ if (!rng.collapsed) {
+ blocks = editor.selection.getSelectedBlocks();
+ each$c(filter$2(filter$2(blocks, isPre), hasPreSibling), function (pre) {
+ joinPre(pre.previousSibling, pre);
+ });
+ }
</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 replaceWithCaretFormat = function (targetNode, formatNodes) {
- var caretContainer = createCaretContainer(false);
- var innerMost = insertFormatNodesIntoCaretContainer(formatNodes, caretContainer.dom());
- $_ewo3u51yjjgwe7su.before(Element$$1.fromDom(targetNode), caretContainer);
- $_81exq51wjjgwe7sm.remove(Element$$1.fromDom(targetNode));
- return CaretPosition$1(innerMost, 0);
- };
- var isFormatElement = function (editor, element) {
- var inlineElements = editor.schema.getTextInlineElements();
- return inlineElements.hasOwnProperty($_fxxo5411jjgwe7lq.name(element)) && !isCaretNode(element.dom()) && !$_3b9u2y1rjjgwe7qe.isBogus(element.dom());
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Hooks = { postProcess: postProcess };
</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 postProcessHooks = {};
- var filter$2 = $_6t4axrmjjgwe7jf.filter;
- var each$12 = $_6t4axrmjjgwe7jf.each;
- var addPostProcessHook = function (name, hook) {
- var hooks = postProcessHooks[name];
- if (!hooks) {
- postProcessHooks[name] = hooks = [];
- }
- postProcessHooks[name].push(hook);
- };
- var postProcess = function (name, editor) {
- each$12(postProcessHooks[name], function (hook) {
- hook(editor);
- });
- };
- addPostProcessHook('pre', function (editor) {
- var rng = editor.selection.getRng();
- var isPre, blocks;
- var hasPreSibling = function (pre) {
- return isPre(pre.previousSibling) && $_6t4axrmjjgwe7jf.indexOf(blocks, pre.previousSibling) !== -1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var MCE_ATTR_RE = /^(src|href|style)$/;
+ var each$d = Tools.each;
+ var isEq$5 = FormatUtils.isEq;
+ var isTableCell$4 = function (node) {
+ return /^(TH|TD)$/.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 joinPre = function (pre1, pre2) {
- DomQuery(pre2).remove();
- DomQuery(pre1).append('<br><br>').append(pre2.childNodes);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isChildOfInlineParent = function (dom, node, parent$$1) {
+ return dom.isChildOf(node, parent$$1) && node !== parent$$1 && !dom.isBlock(parent$$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">- isPre = $_3b9u2y1rjjgwe7qe.matchNodeNames('pre');
- if (!rng.collapsed) {
- blocks = editor.selection.getSelectedBlocks();
- each$12(filter$2(filter$2(blocks, isPre), hasPreSibling), function (pre) {
- joinPre(pre.previousSibling, pre);
- });
- }
- });
- var $_49rwy16bjjgwe8rl = { postProcess: postProcess };
-
- var MCE_ATTR_RE = /^(src|href|style)$/;
- var each$13 = $_6cwiepljjgwe7j4.each;
- var isEq$5 = $_4301413ajjgwe82g.isEq;
- var isTableCell$4 = function (node) {
- return /^(TH|TD)$/.test(node.nodeName);
- };
- var getContainer = function (ed, rng, start) {
- var container, offset, lastIdx;
- container = rng[start ? 'startContainer' : 'endContainer'];
- offset = rng[start ? 'startOffset' : 'endOffset'];
- if ($_3b9u2y1rjjgwe7qe.isElement(container)) {
- lastIdx = container.childNodes.length - 1;
- if (!start && offset) {
- offset--;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getContainer = function (ed, rng, start) {
+ var container, offset, lastIdx;
+ container = rng[start ? 'startContainer' : 'endContainer'];
+ offset = rng[start ? 'startOffset' : 'endOffset'];
+ if (NodeType.isElement(container)) {
+ lastIdx = container.childNodes.length - 1;
+ if (!start && offset) {
+ offset--;
+ }
+ container = container.childNodes[offset > lastIdx ? lastIdx : 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">- container = container.childNodes[offset > lastIdx ? lastIdx : offset];
- }
- if ($_3b9u2y1rjjgwe7qe.isText(container) && start && offset >= container.nodeValue.length) {
- container = new TreeWalker(container, ed.getBody()).next() || container;
- }
- if ($_3b9u2y1rjjgwe7qe.isText(container) && !start && offset === 0) {
- container = new TreeWalker(container, ed.getBody()).prev() || container;
- }
- return container;
- };
- var wrap$2 = function (dom, node, name, attrs) {
- var wrapper = dom.create(name, attrs);
- node.parentNode.insertBefore(wrapper, node);
- wrapper.appendChild(node);
- return wrapper;
- };
- var matchName$1 = function (dom, node, format) {
- if (isEq$5(node, format.inline)) {
- return true;
- }
- if (isEq$5(node, format.block)) {
- return true;
- }
- if (format.selector) {
- return $_3b9u2y1rjjgwe7qe.isElement(node) && dom.is(node, format.selector);
- }
- };
- var isColorFormatAndAnchor = function (node, format) {
- return format.links && node.tagName === 'A';
- };
- var find$4 = function (dom, node, next, inc) {
- node = $_4301413ajjgwe82g.getNonWhiteSpaceSibling(node, next, inc);
- return !node || (node.nodeName === 'BR' || dom.isBlock(node));
- };
- var removeNode$1 = function (ed, node, format) {
- var parentNode = node.parentNode;
- var rootBlockElm;
- var dom = ed.dom, forcedRootBlock = ed.settings.forced_root_block;
- if (format.block) {
- if (!forcedRootBlock) {
- if (dom.isBlock(node) && !dom.isBlock(parentNode)) {
- if (!find$4(dom, node, false) && !find$4(dom, node.firstChild, true, 1)) {
- node.insertBefore(dom.create('br'), node.firstChild);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (NodeType.isText(container) && start && offset >= container.nodeValue.length) {
+ container = new TreeWalker(container, ed.getBody()).next() || container;
+ }
+ if (NodeType.isText(container) && !start && offset === 0) {
+ container = new TreeWalker(container, ed.getBody()).prev() || container;
+ }
+ return container;
+ };
+ var wrap$2 = function (dom, node, name, attrs) {
+ var wrapper = dom.create(name, attrs);
+ node.parentNode.insertBefore(wrapper, node);
+ wrapper.appendChild(node);
+ return wrapper;
+ };
+ var wrapWithSiblings = function (dom, node, next, name, attrs) {
+ var start = Element$$1.fromDom(node);
+ var wrapper = Element$$1.fromDom(dom.create(name, attrs));
+ var siblings$$1 = next ? nextSiblings(start) : prevSiblings(start);
+ append$1(wrapper, siblings$$1);
+ if (next) {
+ before(start, wrapper);
+ prepend(wrapper, start);
+ } else {
+ after(start, wrapper);
+ append(wrapper, start);
+ }
+ return wrapper.dom();
+ };
+ var matchName$1 = function (dom, node, format) {
+ if (isEq$5(node, format.inline)) {
+ return true;
+ }
+ if (isEq$5(node, format.block)) {
+ return true;
+ }
+ if (format.selector) {
+ return NodeType.isElement(node) && dom.is(node, format.selector);
+ }
+ };
+ var isColorFormatAndAnchor = function (node, format) {
+ return format.links && node.tagName === 'A';
+ };
+ var find$4 = function (dom, node, next, inc) {
+ node = FormatUtils.getNonWhiteSpaceSibling(node, next, inc);
+ return !node || (node.nodeName === 'BR' || dom.isBlock(node));
+ };
+ var removeNode$1 = function (ed, node, format) {
+ var parentNode = node.parentNode;
+ var rootBlockElm;
+ var dom = ed.dom, forcedRootBlock = ed.settings.forced_root_block;
+ if (format.block) {
+ if (!forcedRootBlock) {
+ if (dom.isBlock(node) && !dom.isBlock(parentNode)) {
+ if (!find$4(dom, node, false) && !find$4(dom, node.firstChild, true, 1)) {
+ node.insertBefore(dom.create('br'), node.firstChild);
+ }
+ if (!find$4(dom, node, true) && !find$4(dom, node.lastChild, false, 1)) {
+ node.appendChild(dom.create('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">- if (!find$4(dom, node, true) && !find$4(dom, node.lastChild, false, 1)) {
- node.appendChild(dom.create('br'));
- }
- }
- } else {
- if (parentNode === dom.getRoot()) {
- if (!format.list_block || !isEq$5(node, format.list_block)) {
- each$13($_6cwiepljjgwe7j4.grep(node.childNodes), function (node) {
- if ($_4301413ajjgwe82g.isValid(ed, forcedRootBlock, node.nodeName.toLowerCase())) {
- if (!rootBlockElm) {
- rootBlockElm = wrap$2(dom, node, forcedRootBlock);
- dom.setAttribs(rootBlockElm, ed.settings.forced_root_block_attrs);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ if (parentNode === dom.getRoot()) {
+ if (!format.list_block || !isEq$5(node, format.list_block)) {
+ each$d(Tools.grep(node.childNodes), function (node) {
+ if (FormatUtils.isValid(ed, forcedRootBlock, node.nodeName.toLowerCase())) {
+ if (!rootBlockElm) {
+ rootBlockElm = wrap$2(dom, node, forcedRootBlock);
+ dom.setAttribs(rootBlockElm, ed.settings.forced_root_block_attrs);
+ } else {
+ rootBlockElm.appendChild(node);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- rootBlockElm.appendChild(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rootBlockElm = 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">- } else {
- rootBlockElm = 0;
- }
- });
</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><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">- }
- if (format.selector && format.inline && !isEq$5(format.inline, node)) {
- return;
- }
- dom.remove(node, 1);
- };
- var removeFormat = function (ed, format, vars, node, compareNode) {
- var i, attrs, stylesModified;
- var dom = ed.dom;
- if (!matchName$1(dom, node, format) && !isColorFormatAndAnchor(node, format)) {
- return false;
- }
- if (format.remove !== 'all') {
- each$13(format.styles, function (value, name) {
- value = $_4301413ajjgwe82g.normalizeStyleValue(dom, $_4301413ajjgwe82g.replaceVars(value, vars), name);
- if (typeof name === 'number') {
- name = value;
- compareNode = 0;
- }
- if (format.remove_similar || (!compareNode || isEq$5($_4301413ajjgwe82g.getStyle(dom, compareNode, name), value))) {
- dom.setStyle(node, name, '');
- }
- stylesModified = 1;
- });
- if (stylesModified && dom.getAttrib(node, 'style') === '') {
- node.removeAttribute('style');
- node.removeAttribute('data-mce-style');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (format.selector && format.inline && !isEq$5(format.inline, node)) {
+ 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">- each$13(format.attributes, function (value, name) {
- var valueOut;
- value = $_4301413ajjgwe82g.replaceVars(value, vars);
- if (typeof name === 'number') {
- name = value;
- compareNode = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ dom.remove(node, 1);
+ };
+ var removeFormat = function (ed, format, vars, node, compareNode) {
+ var i, attrs, stylesModified;
+ var dom = ed.dom;
+ if (!matchName$1(dom, node, format) && !isColorFormatAndAnchor(node, format)) {
+ return false;
+ }
+ if (format.remove !== 'all') {
+ each$d(format.styles, function (value, name) {
+ value = FormatUtils.normalizeStyleValue(dom, FormatUtils.replaceVars(value, vars), name);
+ if (typeof name === 'number') {
+ name = value;
+ compareNode = 0;
+ }
+ if (format.remove_similar || (!compareNode || isEq$5(FormatUtils.getStyle(dom, compareNode, name), value))) {
+ dom.setStyle(node, name, '');
+ }
+ stylesModified = 1;
+ });
+ if (stylesModified && dom.getAttrib(node, 'style') === '') {
+ node.removeAttribute('style');
+ node.removeAttribute('data-mce-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 (!compareNode || isEq$5(dom.getAttrib(compareNode, name), value)) {
- if (name === 'class') {
- value = dom.getAttrib(node, name);
- if (value) {
- valueOut = '';
- each$13(value.split(/\s+/), function (cls) {
- if (/mce\-\w+/.test(cls)) {
- valueOut += (valueOut ? ' ' : '') + cls;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ each$d(format.attributes, function (value, name) {
+ var valueOut;
+ value = FormatUtils.replaceVars(value, vars);
+ if (typeof name === 'number') {
+ name = value;
+ compareNode = 0;
+ }
+ if (!compareNode || isEq$5(dom.getAttrib(compareNode, name), value)) {
+ if (name === 'class') {
+ value = dom.getAttrib(node, name);
+ if (value) {
+ valueOut = '';
+ each$d(value.split(/\s+/), function (cls) {
+ if (/mce\-\w+/.test(cls)) {
+ valueOut += (valueOut ? ' ' : '') + cls;
+ }
+ });
+ if (valueOut) {
+ dom.setAttrib(node, name, valueOut);
+ 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 (valueOut) {
- dom.setAttrib(node, name, valueOut);
- return;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (name === 'class') {
+ node.removeAttribute('className');
+ }
+ if (MCE_ATTR_RE.test(name)) {
+ node.removeAttribute('data-mce-' + name);
+ }
+ node.removeAttribute(name);
</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 === 'class') {
- node.removeAttribute('className');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ each$d(format.classes, function (value) {
+ value = FormatUtils.replaceVars(value, vars);
+ if (!compareNode || dom.hasClass(compareNode, value)) {
+ dom.removeClass(node, 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 (MCE_ATTR_RE.test(name)) {
- node.removeAttribute('data-mce-' + name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ attrs = dom.getAttribs(node);
+ for (i = 0; i < attrs.length; i++) {
+ var attrName = attrs[i].nodeName;
+ if (attrName.indexOf('_') !== 0 && attrName.indexOf('data-') !== 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">- node.removeAttribute(name);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- each$13(format.classes, function (value) {
- value = $_4301413ajjgwe82g.replaceVars(value, vars);
- if (!compareNode || dom.hasClass(compareNode, value)) {
- dom.removeClass(node, value);
- }
- });
- attrs = dom.getAttribs(node);
- for (i = 0; i < attrs.length; i++) {
- var attrName = attrs[i].nodeName;
- if (attrName.indexOf('_') !== 0 && attrName.indexOf('data-') !== 0) {
- return false;
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (format.remove !== 'none') {
- removeNode$1(ed, node, format);
- return true;
- }
- };
- var findFormatRoot = function (editor, container, name, vars, similar) {
- var formatRoot;
- each$13($_4301413ajjgwe82g.getParents(editor.dom, container.parentNode).reverse(), function (parent) {
- var format;
- if (!formatRoot && parent.id !== '_start' && parent.id !== '_end') {
- format = $_7svyif69jjgwe8rf.matchNode(editor, parent, name, vars, similar);
- if (format && format.split !== false) {
- formatRoot = parent;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (format.remove !== 'none') {
+ removeNode$1(ed, node, format);
+ 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 formatRoot;
- };
- var wrapAndSplit = function (editor, formatList, formatRoot, container, target, split, format, vars) {
- var parent, clone, lastClone, firstClone, i, formatRootParent;
- var dom = editor.dom;
- if (formatRoot) {
- formatRootParent = formatRoot.parentNode;
- for (parent = container.parentNode; parent && parent !== formatRootParent; parent = parent.parentNode) {
- clone = dom.clone(parent, false);
- for (i = 0; i < formatList.length; i++) {
- if (removeFormat(editor, formatList[i], vars, clone, clone)) {
- clone = 0;
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var findFormatRoot = function (editor, container, name, vars, similar) {
+ var formatRoot;
+ each$d(FormatUtils.getParents(editor.dom, container.parentNode).reverse(), function (parent$$1) {
+ var format;
+ if (!formatRoot && parent$$1.id !== '_start' && parent$$1.id !== '_end') {
+ format = MatchFormat.matchNode(editor, parent$$1, name, vars, similar);
+ if (format && format.split !== false) {
+ formatRoot = parent$$1;
</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">- if (clone) {
- if (lastClone) {
- clone.appendChild(lastClone);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ return formatRoot;
+ };
+ var wrapAndSplit = function (editor, formatList, formatRoot, container, target, split, format, vars) {
+ var parent$$1, clone, lastClone, firstClone, i, formatRootParent;
+ var dom = editor.dom;
+ if (formatRoot) {
+ formatRootParent = formatRoot.parentNode;
+ for (parent$$1 = container.parentNode; parent$$1 && parent$$1 !== formatRootParent; parent$$1 = parent$$1.parentNode) {
+ clone = dom.clone(parent$$1, false);
+ for (i = 0; i < formatList.length; i++) {
+ if (removeFormat(editor, formatList[i], vars, clone, clone)) {
+ clone = 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">- if (!firstClone) {
- firstClone = clone;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (clone) {
+ if (lastClone) {
+ clone.appendChild(lastClone);
+ }
+ if (!firstClone) {
+ firstClone = clone;
+ }
+ lastClone = clone;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- lastClone = clone;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (split && (!format.mixed || !dom.isBlock(formatRoot))) {
+ container = dom.split(formatRoot, container);
+ }
+ if (lastClone) {
+ target.parentNode.insertBefore(lastClone, target);
+ firstClone.appendChild(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 (split && (!format.mixed || !dom.isBlock(formatRoot))) {
- container = dom.split(formatRoot, container);
- }
- if (lastClone) {
- target.parentNode.insertBefore(lastClone, target);
- firstClone.appendChild(target);
- }
- }
- return container;
- };
- var remove$8 = function (ed, name, vars, node, similar) {
- var formatList = ed.formatter.get(name), format = formatList[0];
- var bookmark, rng, contentEditable = true;
- var dom = ed.dom;
- var selection = ed.selection;
- var splitToFormatRoot = function (container) {
- var formatRoot = findFormatRoot(ed, container, name, vars, similar);
- return wrapAndSplit(ed, formatList, formatRoot, container, container, true, format, vars);
</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 process = function (node) {
- var children, i, l, lastContentEditable, hasContentEditableState;
- if ($_3b9u2y1rjjgwe7qe.isElement(node) && dom.getContentEditable(node)) {
- lastContentEditable = contentEditable;
- contentEditable = dom.getContentEditable(node) === 'true';
- hasContentEditableState = true;
- }
- children = $_6cwiepljjgwe7j4.grep(node.childNodes);
- if (contentEditable && !hasContentEditableState) {
- for (i = 0, l = formatList.length; i < l; i++) {
- if (removeFormat(ed, formatList[i], vars, node, node)) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var remove$8 = function (ed, name, vars, node, similar) {
+ var formatList = ed.formatter.get(name), format = formatList[0];
+ var bookmark, rng, contentEditable = true;
+ var dom = ed.dom;
+ var selection = ed.selection;
+ var splitToFormatRoot = function (container) {
+ var formatRoot = findFormatRoot(ed, container, name, vars, similar);
+ return wrapAndSplit(ed, formatList, formatRoot, container, container, true, format, vars);
+ };
+ var isRemoveBookmarkNode = function (node) {
+ return Bookmarks.isBookmarkNode(node) && NodeType.isElement(node) && (node.id === '_start' || node.id === '_end');
+ };
+ var process = function (node) {
+ var children$$1, i, l, lastContentEditable, hasContentEditableState;
+ if (NodeType.isElement(node) && dom.getContentEditable(node)) {
+ lastContentEditable = contentEditable;
+ contentEditable = dom.getContentEditable(node) === 'true';
+ hasContentEditableState = true;
+ }
+ children$$1 = Tools.grep(node.childNodes);
+ if (contentEditable && !hasContentEditableState) {
+ for (i = 0, l = formatList.length; i < l; i++) {
+ if (removeFormat(ed, formatList[i], vars, node, node)) {
+ break;
+ }
</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">- }
- if (format.deep) {
- if (children.length) {
- for (i = 0, l = children.length; i < l; i++) {
- process(children[i]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (format.deep) {
+ if (children$$1.length) {
+ for (i = 0, l = children$$1.length; i < l; i++) {
+ process(children$$1[i]);
+ }
+ if (hasContentEditableState) {
+ contentEditable = lastContentEditable;
+ }
</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 (hasContentEditableState) {
- contentEditable = lastContentEditable;
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- };
- var unwrap = function (start) {
- var node = dom.get(start ? '_start' : '_end');
- var out = node[start ? 'firstChild' : 'lastChild'];
- if ($_6refgt2vjjgwe7yn.isBookmarkNode(out)) {
- out = out[start ? 'firstChild' : 'lastChild'];
- }
- if ($_3b9u2y1rjjgwe7qe.isText(out) && out.data.length === 0) {
- out = start ? node.previousSibling || node.nextSibling : node.nextSibling || node.previousSibling;
- }
- dom.remove(node, true);
- return out;
- };
- var removeRngStyle = function (rng) {
- var startContainer, endContainer;
- var commonAncestorContainer = rng.commonAncestorContainer;
- rng = $_1f06hv2ujjgwe7y7.expandRng(ed, rng, formatList, true);
- if (format.split) {
- startContainer = getContainer(ed, rng, true);
- endContainer = getContainer(ed, rng);
- if (startContainer !== endContainer) {
- if (/^(TR|TH|TD)$/.test(startContainer.nodeName) && startContainer.firstChild) {
- if (startContainer.nodeName === 'TR') {
- startContainer = startContainer.firstChild.firstChild || startContainer;
- } else {
- startContainer = startContainer.firstChild || startContainer;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var unwrap = function (start) {
+ var node = dom.get(start ? '_start' : '_end');
+ var out = node[start ? 'firstChild' : 'lastChild'];
+ if (isRemoveBookmarkNode(out)) {
+ out = out[start ? 'firstChild' : 'lastChild'];
+ }
+ if (NodeType.isText(out) && out.data.length === 0) {
+ out = start ? node.previousSibling || node.nextSibling : node.nextSibling || node.previousSibling;
+ }
+ dom.remove(node, true);
+ return out;
+ };
+ var removeRngStyle = function (rng) {
+ var startContainer, endContainer;
+ var commonAncestorContainer = rng.commonAncestorContainer;
+ rng = ExpandRange.expandRng(ed, rng, formatList, true);
+ if (format.split) {
+ rng = SplitRange.split(rng);
+ startContainer = getContainer(ed, rng, true);
+ endContainer = getContainer(ed, rng);
+ if (startContainer !== endContainer) {
+ if (/^(TR|TH|TD)$/.test(startContainer.nodeName) && startContainer.firstChild) {
+ if (startContainer.nodeName === 'TR') {
+ startContainer = startContainer.firstChild.firstChild || startContainer;
+ } else {
+ startContainer = startContainer.firstChild || startContainer;
+ }
</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 (commonAncestorContainer && /^T(HEAD|BODY|FOOT|R)$/.test(commonAncestorContainer.nodeName) && isTableCell$4(endContainer) && endContainer.firstChild) {
- endContainer = endContainer.firstChild || endContainer;
- }
- if (dom.isChildOf(startContainer, endContainer) && startContainer !== endContainer && !dom.isBlock(endContainer) && !isTableCell$4(startContainer) && !isTableCell$4(endContainer)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (commonAncestorContainer && /^T(HEAD|BODY|FOOT|R)$/.test(commonAncestorContainer.nodeName) && isTableCell$4(endContainer) && endContainer.firstChild) {
+ endContainer = endContainer.firstChild || endContainer;
+ }
+ if (isChildOfInlineParent(dom, startContainer, endContainer)) {
+ var marker = Option.from(startContainer.firstChild).getOr(startContainer);
+ splitToFormatRoot(wrapWithSiblings(dom, marker, true, 'span', {
+ 'id': '_start',
+ 'data-mce-type': 'bookmark'
+ }));
+ unwrap(true);
+ return;
+ }
+ if (isChildOfInlineParent(dom, endContainer, startContainer)) {
+ var marker = Option.from(endContainer.lastChild).getOr(endContainer);
+ splitToFormatRoot(wrapWithSiblings(dom, marker, false, 'span', {
+ 'id': '_end',
+ 'data-mce-type': 'bookmark'
+ }));
+ unwrap(false);
+ return;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> startContainer = wrap$2(dom, startContainer, 'span', {
</span><span class="cx" style="display: block; padding: 0 10px"> 'id': '_start',
</span><span class="cx" style="display: block; padding: 0 10px"> 'data-mce-type': 'bookmark'
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ endContainer = wrap$2(dom, endContainer, 'span', {
+ 'id': '_end',
+ 'data-mce-type': 'bookmark'
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> splitToFormatRoot(startContainer);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ splitToFormatRoot(endContainer);
</ins><span class="cx" style="display: block; padding: 0 10px"> startContainer = unwrap(true);
</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">+ endContainer = unwrap();
+ } else {
+ startContainer = endContainer = splitToFormatRoot(startContainer);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- startContainer = wrap$2(dom, startContainer, 'span', {
- 'id': '_start',
- 'data-mce-type': 'bookmark'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rng.startContainer = startContainer.parentNode ? startContainer.parentNode : startContainer;
+ rng.startOffset = dom.nodeIndex(startContainer);
+ rng.endContainer = endContainer.parentNode ? endContainer.parentNode : endContainer;
+ rng.endOffset = dom.nodeIndex(endContainer) + 1;
+ }
+ RangeWalk.walk(dom, rng, function (nodes) {
+ each$d(nodes, function (node) {
+ process(node);
+ if (NodeType.isElement(node) && ed.dom.getStyle(node, 'text-decoration') === 'underline' && node.parentNode && FormatUtils.getTextDecoration(dom, node.parentNode) === 'underline') {
+ removeFormat(ed, {
+ deep: false,
+ exact: true,
+ inline: 'span',
+ styles: { textDecoration: 'underline' }
+ }, null, 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">- endContainer = wrap$2(dom, endContainer, 'span', {
- 'id': '_end',
- 'data-mce-type': 'bookmark'
- });
- splitToFormatRoot(startContainer);
- splitToFormatRoot(endContainer);
- startContainer = unwrap(true);
- endContainer = unwrap();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ if (node) {
+ if (node.nodeType) {
+ rng = dom.createRng();
+ rng.setStartBefore(node);
+ rng.setEndAfter(node);
+ removeRngStyle(rng);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- startContainer = endContainer = splitToFormatRoot(startContainer);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ removeRngStyle(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">- rng.startContainer = startContainer.parentNode ? startContainer.parentNode : startContainer;
- rng.startOffset = dom.nodeIndex(startContainer);
- rng.endContainer = endContainer.parentNode ? endContainer.parentNode : endContainer;
- rng.endOffset = dom.nodeIndex(endContainer) + 1;
</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">- $_e2gzn43bjjgwe82k.walk(dom, rng, function (nodes) {
- each$13(nodes, function (node) {
- process(node);
- if ($_3b9u2y1rjjgwe7qe.isElement(node) && ed.dom.getStyle(node, 'text-decoration') === 'underline' && node.parentNode && $_4301413ajjgwe82g.getTextDecoration(dom, node.parentNode) === 'underline') {
- removeFormat(ed, {
- deep: false,
- exact: true,
- inline: 'span',
- styles: { textDecoration: 'underline' }
- }, null, node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (dom.getContentEditable(selection.getNode()) === 'false') {
+ node = selection.getNode();
+ for (var i = 0, l = formatList.length; i < l; i++) {
+ if (formatList[i].ceFalseOverride) {
+ if (removeFormat(ed, formatList[i], vars, node, 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">- });
- });
- };
- if (node) {
- if (node.nodeType) {
- rng = dom.createRng();
- rng.setStartBefore(node);
- rng.setEndAfter(node);
- removeRngStyle(rng);
- } else {
- removeRngStyle(node);
</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;
- }
- if (dom.getContentEditable(selection.getNode()) === 'false') {
- node = selection.getNode();
- for (var i = 0, l = formatList.length; i < l; i++) {
- if (formatList[i].ceFalseOverride) {
- if (removeFormat(ed, formatList[i], vars, node, node)) {
- break;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!selection.isCollapsed() || !format.inline || dom.select('td[data-mce-selected],th[data-mce-selected]').length) {
+ bookmark = GetBookmark.getPersistentBookmark(ed.selection, true);
+ removeRngStyle(selection.getRng());
+ selection.moveToBookmark(bookmark);
+ if (format.inline && MatchFormat.match(ed, name, vars, selection.getStart())) {
+ FormatUtils.moveStart(dom, selection, selection.getRng());
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ed.nodeChanged();
+ } else {
+ removeCaretFormat(ed, name, vars, similar);
</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;
- }
- if (!selection.isCollapsed() || !format.inline || dom.select('td[data-mce-selected],th[data-mce-selected]').length) {
- bookmark = $_ga29lf2jjjgwe7wh.getPersistentBookmark(ed.selection, true);
- removeRngStyle(selection.getRng());
- selection.moveToBookmark(bookmark);
- if (format.inline && $_7svyif69jjgwe8rf.match(ed, name, vars, selection.getStart())) {
- $_4301413ajjgwe82g.moveStart(dom, selection, selection.getRng());
- }
- ed.nodeChanged();
- } else {
- removeCaretFormat(ed, name, vars, similar);
- }
- };
- var $_y6kng6djjgwe8ry = {
- removeFormat: removeFormat,
- remove: remove$8
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var RemoveFormat = {
+ removeFormat: removeFormat,
+ remove: remove$8
+ };
</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 each$14 = $_6cwiepljjgwe7j4.each;
- var isElementNode = function (node) {
- return node && node.nodeType === 1 && !$_6refgt2vjjgwe7yn.isBookmarkNode(node) && !isCaretNode(node) && !$_3b9u2y1rjjgwe7qe.isBogus(node);
- };
- var findElementSibling = function (node, siblingName) {
- var sibling;
- for (sibling = node; sibling; sibling = sibling[siblingName]) {
- if (sibling.nodeType === 3 && sibling.nodeValue.length !== 0) {
- return node;
- }
- if (sibling.nodeType === 1 && !$_6refgt2vjjgwe7yn.isBookmarkNode(sibling)) {
- return sibling;
- }
- }
- return node;
- };
- var mergeSiblingsNodes = function (dom, prev, next) {
- var sibling, tmpSibling;
- var elementUtils = new ElementUtils(dom);
- if (prev && next) {
- prev = findElementSibling(prev, 'previousSibling');
- next = findElementSibling(next, 'nextSibling');
- if (elementUtils.compare(prev, next)) {
- for (sibling = prev.nextSibling; sibling && sibling !== next;) {
- tmpSibling = sibling;
- sibling = sibling.nextSibling;
- prev.appendChild(tmpSibling);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var each$e = Tools.each;
+ var isElementNode = function (node) {
+ return node && node.nodeType === 1 && !Bookmarks.isBookmarkNode(node) && !isCaretNode(node) && !NodeType.isBogus(node);
+ };
+ var findElementSibling = function (node, siblingName) {
+ var sibling;
+ for (sibling = node; sibling; sibling = sibling[siblingName]) {
+ if (sibling.nodeType === 3 && sibling.nodeValue.length !== 0) {
+ return 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(next);
- $_6cwiepljjgwe7j4.each($_6cwiepljjgwe7j4.grep(next.childNodes), function (node) {
- prev.appendChild(node);
- });
- return prev;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (sibling.nodeType === 1 && !Bookmarks.isBookmarkNode(sibling)) {
+ return 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">- }
- return next;
- };
- var processChildElements = function (node, filter, process) {
- each$14(node.childNodes, function (node) {
- if (isElementNode(node)) {
- if (filter(node)) {
- process(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return node;
+ };
+ var mergeSiblingsNodes = function (dom, prev, next) {
+ var sibling, tmpSibling;
+ var elementUtils = new ElementUtils(dom);
+ if (prev && next) {
+ prev = findElementSibling(prev, 'previousSibling');
+ next = findElementSibling(next, 'nextSibling');
+ if (elementUtils.compare(prev, next)) {
+ for (sibling = prev.nextSibling; sibling && sibling !== next;) {
+ tmpSibling = sibling;
+ sibling = sibling.nextSibling;
+ prev.appendChild(tmpSibling);
+ }
+ dom.remove(next);
+ Tools.each(Tools.grep(next.childNodes), function (node) {
+ prev.appendChild(node);
+ });
+ return prev;
</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.hasChildNodes()) {
- processChildElements(node, filter, process);
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- };
- var hasStyle = function (dom, name) {
- return curry(function (name, node) {
- return !!(node && $_4301413ajjgwe82g.getStyle(dom, node, name));
- }, name);
- };
- var applyStyle = function (dom, name, value) {
- return curry(function (name, value, node) {
- dom.setStyle(node, name, value);
- if (node.getAttribute('style') === '') {
- node.removeAttribute('style');
- }
- unwrapEmptySpan(dom, node);
- }, name, value);
- };
- var unwrapEmptySpan = function (dom, node) {
- if (node.nodeName === 'SPAN' && dom.getAttribs(node).length === 0) {
- dom.remove(node, true);
- }
- };
- var processUnderlineAndColor = function (dom, node) {
- var textDecoration;
- if (node.nodeType === 1 && node.parentNode && node.parentNode.nodeType === 1) {
- textDecoration = $_4301413ajjgwe82g.getTextDecoration(dom, node.parentNode);
- if (dom.getStyle(node, 'color') && textDecoration) {
- dom.setStyle(node, 'text-decoration', textDecoration);
- } else if (dom.getStyle(node, 'text-decoration') === textDecoration) {
- dom.setStyle(node, 'text-decoration', null);
- }
- }
- };
- var mergeUnderlineAndColor = function (dom, format, vars, node) {
- if (format.styles.color || format.styles.textDecoration) {
- $_6cwiepljjgwe7j4.walk(node, curry(processUnderlineAndColor, dom), 'childNodes');
- processUnderlineAndColor(dom, node);
- }
- };
- var mergeBackgroundColorAndFontSize = function (dom, format, vars, node) {
- if (format.styles && format.styles.backgroundColor) {
- processChildElements(node, hasStyle(dom, 'fontSize'), applyStyle(dom, 'backgroundColor', $_4301413ajjgwe82g.replaceVars(format.styles.backgroundColor, vars)));
- }
- };
- var mergeSubSup = function (dom, format, vars, node) {
- if (format.inline === 'sub' || format.inline === 'sup') {
- processChildElements(node, hasStyle(dom, 'fontSize'), applyStyle(dom, 'fontSize', ''));
- dom.remove(dom.select(format.inline === 'sup' ? 'sub' : 'sup', node), true);
- }
- };
- var mergeSiblings = function (dom, format, vars, node) {
- if (node && format.merge_siblings !== false) {
- node = mergeSiblingsNodes(dom, $_4301413ajjgwe82g.getNonWhiteSpaceSibling(node), node);
- node = mergeSiblingsNodes(dom, node, $_4301413ajjgwe82g.getNonWhiteSpaceSibling(node, true));
- }
- };
- var clearChildStyles = function (dom, format, node) {
- if (format.clear_child_styles) {
- var selector = format.links ? '*:not(a)' : '*';
- each$14(dom.select(selector, node), function (node) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return next;
+ };
+ var processChildElements = function (node, filter, process) {
+ each$e(node.childNodes, function (node) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if (isElementNode(node)) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- each$14(format.styles, function (value, name) {
- dom.setStyle(node, name, '');
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (filter(node)) {
+ process(node);
+ }
+ if (node.hasChildNodes()) {
+ processChildElements(node, filter, process);
+ }
</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">- }
- };
- var mergeWithChildren = function (editor, formatList, vars, node) {
- each$14(formatList, function (format) {
- each$14(editor.dom.select(format.inline, node), function (child) {
- if (!isElementNode(child)) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var hasStyle = function (dom, name) {
+ return curry(function (name, node) {
+ return !!(node && FormatUtils.getStyle(dom, node, name));
+ }, name);
+ };
+ var applyStyle = function (dom, name, value) {
+ return curry(function (name, value, node) {
+ dom.setStyle(node, name, value);
+ if (node.getAttribute('style') === '') {
+ node.removeAttribute('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">- $_y6kng6djjgwe8ry.removeFormat(editor, format, vars, child, format.exact ? child : null);
- });
- clearChildStyles(editor.dom, format, node);
- });
- };
- var mergeWithParents = function (editor, format, name, vars, node) {
- if ($_7svyif69jjgwe8rf.matchNode(editor, node.parentNode, name, vars)) {
- if ($_y6kng6djjgwe8ry.removeFormat(editor, format, vars, node)) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ unwrapEmptySpan(dom, node);
+ }, name, value);
+ };
+ var unwrapEmptySpan = function (dom, node) {
+ if (node.nodeName === 'SPAN' && dom.getAttribs(node).length === 0) {
+ dom.remove(node, 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 (format.merge_with_parents) {
- editor.dom.getParent(node.parentNode, function (parent) {
- if ($_7svyif69jjgwe8rf.matchNode(editor, parent, name, vars)) {
- $_y6kng6djjgwe8ry.removeFormat(editor, format, vars, node);
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var processUnderlineAndColor = function (dom, node) {
+ var textDecoration;
+ if (node.nodeType === 1 && node.parentNode && node.parentNode.nodeType === 1) {
+ textDecoration = FormatUtils.getTextDecoration(dom, node.parentNode);
+ if (dom.getStyle(node, 'color') && textDecoration) {
+ dom.setStyle(node, 'text-decoration', textDecoration);
+ } else if (dom.getStyle(node, 'text-decoration') === textDecoration) {
+ dom.setStyle(node, 'text-decoration', 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">- });
- }
- };
- var $_3rh05e6cjjgwe8rp = {
- mergeWithChildren: mergeWithChildren,
- mergeUnderlineAndColor: mergeUnderlineAndColor,
- mergeBackgroundColorAndFontSize: mergeBackgroundColorAndFontSize,
- mergeSubSup: mergeSubSup,
- mergeSiblings: mergeSiblings,
- mergeWithParents: mergeWithParents
- };
-
- var each$15 = $_6cwiepljjgwe7j4.each;
- var isElementNode$1 = function (node) {
- return node && node.nodeType === 1 && !$_6refgt2vjjgwe7yn.isBookmarkNode(node) && !isCaretNode(node) && !$_3b9u2y1rjjgwe7qe.isBogus(node);
- };
- var applyFormat = function (ed, name, vars, node) {
- var formatList = ed.formatter.get(name);
- var format = formatList[0];
- var bookmark, rng;
- var isCollapsed = !node && ed.selection.isCollapsed();
- var dom = ed.dom, selection = ed.selection;
- var setElementFormat = function (elm, fmt) {
- fmt = fmt || format;
- if (elm) {
- if (fmt.onformat) {
- fmt.onformat(elm, fmt, vars, node);
- }
- each$15(fmt.styles, function (value, name) {
- dom.setStyle(elm, name, $_4301413ajjgwe82g.replaceVars(value, vars));
- });
- if (fmt.styles) {
- var styleVal = dom.getAttrib(elm, 'style');
- if (styleVal) {
- elm.setAttribute('data-mce-style', styleVal);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ };
+ var mergeUnderlineAndColor = function (dom, format, vars, node) {
+ if (format.styles.color || format.styles.textDecoration) {
+ Tools.walk(node, curry(processUnderlineAndColor, dom), 'childNodes');
+ processUnderlineAndColor(dom, node);
+ }
+ };
+ var mergeBackgroundColorAndFontSize = function (dom, format, vars, node) {
+ if (format.styles && format.styles.backgroundColor) {
+ processChildElements(node, hasStyle(dom, 'fontSize'), applyStyle(dom, 'backgroundColor', FormatUtils.replaceVars(format.styles.backgroundColor, vars)));
+ }
+ };
+ var mergeSubSup = function (dom, format, vars, node) {
+ if (format.inline === 'sub' || format.inline === 'sup') {
+ processChildElements(node, hasStyle(dom, 'fontSize'), applyStyle(dom, 'fontSize', ''));
+ dom.remove(dom.select(format.inline === 'sup' ? 'sub' : 'sup', node), true);
+ }
+ };
+ var mergeSiblings = function (dom, format, vars, node) {
+ if (node && format.merge_siblings !== false) {
+ node = mergeSiblingsNodes(dom, FormatUtils.getNonWhiteSpaceSibling(node), node);
+ node = mergeSiblingsNodes(dom, node, FormatUtils.getNonWhiteSpaceSibling(node, true));
+ }
+ };
+ var clearChildStyles = function (dom, format, node) {
+ if (format.clear_child_styles) {
+ var selector = format.links ? '*:not(a)' : '*';
+ each$e(dom.select(selector, node), function (node) {
+ if (isElementNode(node)) {
+ each$e(format.styles, function (value, name) {
+ dom.setStyle(node, name, '');
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- each$15(fmt.attributes, function (value, name) {
- dom.setAttrib(elm, name, $_4301413ajjgwe82g.replaceVars(value, vars));
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- each$15(fmt.classes, function (value) {
- value = $_4301413ajjgwe82g.replaceVars(value, vars);
- if (!dom.hasClass(elm, value)) {
- dom.addClass(elm, value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ };
+ var mergeWithChildren = function (editor, formatList, vars, node) {
+ each$e(formatList, function (format) {
+ each$e(editor.dom.select(format.inline, node), function (child) {
+ if (!isElementNode(child)) {
+ return;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ RemoveFormat.removeFormat(editor, format, vars, child, format.exact ? child : 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">- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ clearChildStyles(editor.dom, format, 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 applyNodeStyle = function (formatList, node) {
- var found = false;
- if (!format.selector) {
- return false;
- }
- each$15(formatList, function (format) {
- if ('collapsed' in format && format.collapsed !== isCollapsed) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var mergeWithParents = function (editor, format, name, vars, node) {
+ if (MatchFormat.matchNode(editor, node.parentNode, name, vars)) {
+ if (RemoveFormat.removeFormat(editor, format, vars, node)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><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.is(node, format.selector) && !isCaretNode(node)) {
- setElementFormat(node, format);
- found = true;
- return false;
- }
- });
- return found;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (format.merge_with_parents) {
+ editor.dom.getParent(node.parentNode, function (parent) {
+ if (MatchFormat.matchNode(editor, parent, name, vars)) {
+ RemoveFormat.removeFormat(editor, format, vars, node);
+ 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">- var applyRngStyle = function (dom, rng, bookmark, nodeSpecific) {
- var newWrappers = [];
- var wrapName, wrapElm, contentEditable = true;
- wrapName = format.inline || format.block;
- wrapElm = dom.create(wrapName);
- setElementFormat(wrapElm);
- $_e2gzn43bjjgwe82k.walk(dom, rng, function (nodes) {
- var currentWrapElm;
- var process = function (node) {
- var nodeName, parentName, hasContentEditableState, lastContentEditable;
- lastContentEditable = contentEditable;
- nodeName = node.nodeName.toLowerCase();
- parentName = node.parentNode.nodeName.toLowerCase();
- if (node.nodeType === 1 && dom.getContentEditable(node)) {
- lastContentEditable = contentEditable;
- contentEditable = dom.getContentEditable(node) === 'true';
- hasContentEditableState = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var MergeFormats = {
+ mergeWithChildren: mergeWithChildren,
+ mergeUnderlineAndColor: mergeUnderlineAndColor,
+ mergeBackgroundColorAndFontSize: mergeBackgroundColorAndFontSize,
+ mergeSubSup: mergeSubSup,
+ mergeSiblings: mergeSiblings,
+ mergeWithParents: mergeWithParents
+ };
+
+ var each$f = Tools.each;
+ var isElementNode$1 = function (node) {
+ return node && node.nodeType === 1 && !Bookmarks.isBookmarkNode(node) && !isCaretNode(node) && !NodeType.isBogus(node);
+ };
+ var applyFormat = function (ed, name, vars, node) {
+ var formatList = ed.formatter.get(name);
+ var format = formatList[0];
+ var bookmark, rng;
+ var isCollapsed = !node && ed.selection.isCollapsed();
+ var dom = ed.dom, selection = ed.selection;
+ var setElementFormat = function (elm, fmt) {
+ fmt = fmt || format;
+ if (elm) {
+ if (fmt.onformat) {
+ fmt.onformat(elm, fmt, vars, 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 ($_4301413ajjgwe82g.isEq(nodeName, 'br')) {
- currentWrapElm = 0;
- if (format.block) {
- dom.remove(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ each$f(fmt.styles, function (value, name) {
+ dom.setStyle(elm, name, FormatUtils.replaceVars(value, vars));
+ });
+ if (fmt.styles) {
+ var styleVal = dom.getAttrib(elm, 'style');
+ if (styleVal) {
+ elm.setAttribute('data-mce-style', styleVal);
</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><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (format.wrapper && $_7svyif69jjgwe8rf.matchNode(ed, node, name, vars)) {
- currentWrapElm = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ each$f(fmt.attributes, function (value, name) {
+ dom.setAttrib(elm, name, FormatUtils.replaceVars(value, vars));
+ });
+ each$f(fmt.classes, function (value) {
+ value = FormatUtils.replaceVars(value, vars);
+ if (!dom.hasClass(elm, value)) {
+ dom.addClass(elm, value);
+ }
+ });
+ }
+ };
+ var applyNodeStyle = function (formatList, node) {
+ var found = false;
+ if (!format.selector) {
+ return false;
+ }
+ each$f(formatList, function (format) {
+ if ('collapsed' in format && format.collapsed !== isCollapsed) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (contentEditable && !hasContentEditableState && format.block && !format.wrapper && $_4301413ajjgwe82g.isTextBlock(ed, nodeName) && $_4301413ajjgwe82g.isValid(ed, parentName, wrapName)) {
- node = dom.rename(node, wrapName);
- setElementFormat(node);
- newWrappers.push(node);
- currentWrapElm = 0;
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (dom.is(node, format.selector) && !isCaretNode(node)) {
+ setElementFormat(node, format);
+ found = true;
+ 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 (format.selector) {
- var found = applyNodeStyle(formatList, node);
- if (!format.inline || found) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ return found;
+ };
+ var applyRngStyle = function (dom, rng, bookmark, nodeSpecific) {
+ var newWrappers = [];
+ var wrapName, wrapElm, contentEditable = true;
+ wrapName = format.inline || format.block;
+ wrapElm = dom.create(wrapName);
+ setElementFormat(wrapElm);
+ RangeWalk.walk(dom, rng, function (nodes) {
+ var currentWrapElm;
+ var process = function (node) {
+ var nodeName, parentName, hasContentEditableState, lastContentEditable;
+ lastContentEditable = contentEditable;
+ nodeName = node.nodeName.toLowerCase();
+ parentName = node.parentNode.nodeName.toLowerCase();
+ if (node.nodeType === 1 && dom.getContentEditable(node)) {
+ lastContentEditable = contentEditable;
+ contentEditable = dom.getContentEditable(node) === 'true';
+ hasContentEditableState = true;
+ }
+ if (FormatUtils.isEq(nodeName, 'br')) {
</ins><span class="cx" style="display: block; padding: 0 10px"> currentWrapElm = 0;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (format.block) {
+ dom.remove(node);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (contentEditable && !hasContentEditableState && $_4301413ajjgwe82g.isValid(ed, wrapName, nodeName) && $_4301413ajjgwe82g.isValid(ed, parentName, wrapName) && !(!nodeSpecific && node.nodeType === 3 && node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 65279) && !isCaretNode(node) && (!format.inline || !dom.isBlock(node))) {
- if (!currentWrapElm) {
- currentWrapElm = dom.clone(wrapElm, false);
- node.parentNode.insertBefore(currentWrapElm, node);
- newWrappers.push(currentWrapElm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (format.wrapper && MatchFormat.matchNode(ed, node, name, vars)) {
+ currentWrapElm = 0;
+ 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">- currentWrapElm.appendChild(node);
- } else {
- currentWrapElm = 0;
- each$15($_6cwiepljjgwe7j4.grep(node.childNodes), process);
- if (hasContentEditableState) {
- contentEditable = lastContentEditable;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (contentEditable && !hasContentEditableState && format.block && !format.wrapper && FormatUtils.isTextBlock(ed, nodeName) && FormatUtils.isValid(ed, parentName, wrapName)) {
+ node = dom.rename(node, wrapName);
+ setElementFormat(node);
+ newWrappers.push(node);
+ currentWrapElm = 0;
+ 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">- currentWrapElm = 0;
- }
- };
- each$15(nodes, process);
- });
- if (format.links === true) {
- each$15(newWrappers, function (node) {
- var process = function (node) {
- if (node.nodeName === 'A') {
- setElementFormat(node, format);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (format.selector) {
+ var found = applyNodeStyle(formatList, node);
+ if (!format.inline || found) {
+ currentWrapElm = 0;
+ 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">- each$15($_6cwiepljjgwe7j4.grep(node.childNodes), process);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (contentEditable && !hasContentEditableState && FormatUtils.isValid(ed, wrapName, nodeName) && FormatUtils.isValid(ed, parentName, wrapName) && !(!nodeSpecific && node.nodeType === 3 && node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 65279) && !isCaretNode(node) && (!format.inline || !dom.isBlock(node))) {
+ if (!currentWrapElm) {
+ currentWrapElm = dom.clone(wrapElm, false);
+ node.parentNode.insertBefore(currentWrapElm, node);
+ newWrappers.push(currentWrapElm);
+ }
+ currentWrapElm.appendChild(node);
+ } else {
+ currentWrapElm = 0;
+ each$f(Tools.grep(node.childNodes), process);
+ if (hasContentEditableState) {
+ contentEditable = lastContentEditable;
+ }
+ currentWrapElm = 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">- process(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ each$f(nodes, process);
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- each$15(newWrappers, function (node) {
- var childCount;
- var getChildCount = function (node) {
- var count = 0;
- each$15(node.childNodes, function (node) {
- if (!$_4301413ajjgwe82g.isWhiteSpaceNode(node) && !$_6refgt2vjjgwe7yn.isBookmarkNode(node)) {
- count++;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (format.links === true) {
+ each$f(newWrappers, function (node) {
+ var process = function (node) {
+ if (node.nodeName === 'A') {
+ setElementFormat(node, format);
+ }
+ each$f(Tools.grep(node.childNodes), process);
+ };
+ process(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 count;
- };
- var getChildElementNode = function (root) {
- var child = false;
- each$15(root.childNodes, function (node) {
- if (isElementNode$1(node)) {
- child = node;
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ each$f(newWrappers, function (node) {
+ var childCount;
+ var getChildCount = function (node) {
+ var count = 0;
+ each$f(node.childNodes, function (node) {
+ if (!FormatUtils.isWhiteSpaceNode(node) && !Bookmarks.isBookmarkNode(node)) {
+ count++;
+ }
+ });
+ return count;
+ };
+ var getChildElementNode = function (root) {
+ var child = false;
+ each$f(root.childNodes, function (node) {
+ if (isElementNode$1(node)) {
+ child = node;
+ return false;
+ }
+ });
+ return child;
+ };
+ var mergeStyles = function (node) {
+ var child, clone;
+ child = getChildElementNode(node);
+ if (child && !Bookmarks.isBookmarkNode(child) && MatchFormat.matchName(dom, child, format)) {
+ clone = dom.clone(child, false);
+ setElementFormat(clone);
+ dom.replace(clone, node, true);
+ dom.remove(child, 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 child;
- };
- var mergeStyles = function (node) {
- var child, clone;
- child = getChildElementNode(node);
- if (child && !$_6refgt2vjjgwe7yn.isBookmarkNode(child) && $_7svyif69jjgwe8rf.matchName(dom, child, format)) {
- clone = dom.clone(child, false);
- setElementFormat(clone);
- dom.replace(clone, node, true);
- dom.remove(child, 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return clone || node;
+ };
+ childCount = getChildCount(node);
+ if ((newWrappers.length > 1 || !dom.isBlock(node)) && childCount === 0) {
+ dom.remove(node, 1);
+ 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 clone || node;
- };
- childCount = getChildCount(node);
- if ((newWrappers.length > 1 || !dom.isBlock(node)) && childCount === 0) {
- dom.remove(node, 1);
- return;
- }
- if (format.inline || format.wrapper) {
- if (!format.exact && childCount === 1) {
- node = mergeStyles(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (format.inline || format.wrapper) {
+ if (!format.exact && childCount === 1) {
+ node = mergeStyles(node);
+ }
+ MergeFormats.mergeWithChildren(ed, formatList, vars, node);
+ MergeFormats.mergeWithParents(ed, format, name, vars, node);
+ MergeFormats.mergeBackgroundColorAndFontSize(dom, format, vars, node);
+ MergeFormats.mergeSubSup(dom, format, vars, node);
+ MergeFormats.mergeSiblings(dom, format, vars, 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">- $_3rh05e6cjjgwe8rp.mergeWithChildren(ed, formatList, vars, node);
- $_3rh05e6cjjgwe8rp.mergeWithParents(ed, format, name, vars, node);
- $_3rh05e6cjjgwe8rp.mergeBackgroundColorAndFontSize(dom, format, vars, node);
- $_3rh05e6cjjgwe8rp.mergeSubSup(dom, format, vars, node);
- $_3rh05e6cjjgwe8rp.mergeSiblings(dom, format, vars, node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ if (dom.getContentEditable(selection.getNode()) === 'false') {
+ node = selection.getNode();
+ for (var i = 0, l = formatList.length; i < l; i++) {
+ if (formatList[i].ceFalseOverride && dom.is(node, formatList[i].selector)) {
+ setElementFormat(node, formatList[i]);
+ 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.getContentEditable(selection.getNode()) === 'false') {
- node = selection.getNode();
- for (var i = 0, l = formatList.length; i < l; i++) {
- if (formatList[i].ceFalseOverride && dom.is(node, formatList[i].selector)) {
- setElementFormat(node, formatList[i]);
- return;
- }
</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;
- }
- if (format) {
- if (node) {
- if (node.nodeType) {
- if (!applyNodeStyle(formatList, node)) {
- rng = dom.createRng();
- rng.setStartBefore(node);
- rng.setEndAfter(node);
- applyRngStyle(dom, $_1f06hv2ujjgwe7y7.expandRng(ed, rng, formatList), null, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (format) {
+ if (node) {
+ if (node.nodeType) {
+ if (!applyNodeStyle(formatList, node)) {
+ rng = dom.createRng();
+ rng.setStartBefore(node);
+ rng.setEndAfter(node);
+ applyRngStyle(dom, ExpandRange.expandRng(ed, rng, formatList), null, true);
+ }
+ } else {
+ applyRngStyle(dom, node, null, true);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- applyRngStyle(dom, node, null, true);
- }
- } else {
- if (!isCollapsed || !format.inline || dom.select('td[data-mce-selected],th[data-mce-selected]').length) {
- var curSelNode = ed.selection.getNode();
- if (!ed.settings.forced_root_block && formatList[0].defaultBlock && !dom.getParent(curSelNode, dom.isBlock)) {
- applyFormat(ed, formatList[0].defaultBlock);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!isCollapsed || !format.inline || dom.select('td[data-mce-selected],th[data-mce-selected]').length) {
+ var curSelNode = ed.selection.getNode();
+ if (!ed.settings.forced_root_block && formatList[0].defaultBlock && !dom.getParent(curSelNode, dom.isBlock)) {
+ applyFormat(ed, formatList[0].defaultBlock);
+ }
+ ed.selection.setRng(RangeNormalizer.normalize(ed.selection.getRng()));
+ bookmark = GetBookmark.getPersistentBookmark(ed.selection, true);
+ applyRngStyle(dom, ExpandRange.expandRng(ed, selection.getRng(), formatList), bookmark);
+ if (format.styles) {
+ MergeFormats.mergeUnderlineAndColor(dom, format, vars, curSelNode);
+ }
+ selection.moveToBookmark(bookmark);
+ FormatUtils.moveStart(dom, selection, selection.getRng());
+ ed.nodeChanged();
+ } else {
+ applyCaretFormat(ed, name, vars);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ed.selection.setRng($_e1wrz53ojjgwe85f.normalize(ed.selection.getRng()));
- bookmark = $_ga29lf2jjjgwe7wh.getPersistentBookmark(ed.selection, true);
- applyRngStyle(dom, $_1f06hv2ujjgwe7y7.expandRng(ed, selection.getRng(), formatList), bookmark);
- if (format.styles) {
- $_3rh05e6cjjgwe8rp.mergeUnderlineAndColor(dom, format, vars, curSelNode);
- }
- selection.moveToBookmark(bookmark);
- $_4301413ajjgwe82g.moveStart(dom, selection, selection.getRng());
- ed.nodeChanged();
- } else {
- applyCaretFormat(ed, name, vars);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Hooks.postProcess(name, ed);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_49rwy16bjjgwe8rl.postProcess(name, ed);
- }
- };
- var $_b0knyc67jjgwe8qi = { applyFormat: applyFormat };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var ApplyFormat = { applyFormat: applyFormat };
</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 each$16 = $_6cwiepljjgwe7j4.each;
- var setup$5 = function (formatChangeData, editor) {
- var currentFormats = {};
- formatChangeData.set({});
- editor.on('NodeChange', function (e) {
- var parents = $_4301413ajjgwe82g.getParents(editor.dom, e.element);
- var matchedFormats = {};
- parents = $_6cwiepljjgwe7j4.grep(parents, function (node) {
- return node.nodeType === 1 && !node.getAttribute('data-mce-bogus');
- });
- each$16(formatChangeData.get(), function (callbacks, format) {
- each$16(parents, function (node) {
- if (editor.formatter.matchNode(node, format, {}, callbacks.similar)) {
- if (!currentFormats[format]) {
- each$16(callbacks, function (callback) {
- callback(true, {
- node: node,
- format: format,
- parents: parents
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var each$g = Tools.each;
+ var setup$5 = function (formatChangeData, editor) {
+ var currentFormats = {};
+ formatChangeData.set({});
+ editor.on('NodeChange', function (e) {
+ var parents = FormatUtils.getParents(editor.dom, e.element);
+ var matchedFormats = {};
+ parents = Tools.grep(parents, function (node) {
+ return node.nodeType === 1 && !node.getAttribute('data-mce-bogus');
+ });
+ each$g(formatChangeData.get(), function (callbacks, format) {
+ each$g(parents, function (node) {
+ if (editor.formatter.matchNode(node, format, {}, callbacks.similar)) {
+ if (!currentFormats[format]) {
+ each$g(callbacks, function (callback) {
+ callback(true, {
+ node: node,
+ format: format,
+ parents: parents
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ currentFormats[format] = callbacks;
+ }
+ matchedFormats[format] = callbacks;
+ return false;
+ }
+ if (MatchFormat.matchesUnInheritedFormatSelector(editor, node, format)) {
+ return false;
+ }
+ });
+ });
+ each$g(currentFormats, function (callbacks, format) {
+ if (!matchedFormats[format]) {
+ delete currentFormats[format];
+ each$g(callbacks, function (callback) {
+ callback(false, {
+ node: e.element,
+ format: format,
+ parents: parents
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- currentFormats[format] = callbacks;
- }
- matchedFormats[format] = callbacks;
- return false;
</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">- if ($_7svyif69jjgwe8rf.matchesUnInheritedFormatSelector(editor, node, format)) {
- return false;
- }
</del><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">- each$16(currentFormats, function (callbacks, format) {
- if (!matchedFormats[format]) {
- delete currentFormats[format];
- each$16(callbacks, function (callback) {
- callback(false, {
- node: e.element,
- format: format,
- parents: parents
- });
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var addListeners = function (formatChangeData, formats, callback, similar) {
+ var formatChangeItems = formatChangeData.get();
+ each$g(formats.split(','), function (format) {
+ if (!formatChangeItems[format]) {
+ formatChangeItems[format] = [];
+ formatChangeItems[format].similar = similar;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ formatChangeItems[format].push(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">- });
- };
- var addListeners = function (formatChangeData, formats, callback, similar) {
- var formatChangeItems = formatChangeData.get();
- each$16(formats.split(','), function (format) {
- if (!formatChangeItems[format]) {
- formatChangeItems[format] = [];
- formatChangeItems[format].similar = similar;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ formatChangeData.set(formatChangeItems);
+ };
+ var formatChanged = function (editor, formatChangeState, formats, callback, similar) {
+ if (formatChangeState.get() === null) {
+ setup$5(formatChangeState, 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">- formatChangeItems[format].push(callback);
- });
- formatChangeData.set(formatChangeItems);
- };
- var formatChanged = function (editor, formatChangeState, formats, callback, similar) {
- if (formatChangeState.get() === null) {
- setup$5(formatChangeState, editor);
- }
- addListeners(formatChangeState, formats, callback, similar);
- };
- var $_4iv60i6ejjgwe8sa = { formatChanged: formatChanged };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ addListeners(formatChangeState, formats, callback, similar);
+ };
+ var FormatChanged = { formatChanged: formatChanged };
</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 get$7 = function (dom) {
- var formats = {
- valigntop: [{
- selector: 'td,th',
- styles: { verticalAlign: 'top' }
- }],
- valignmiddle: [{
- selector: 'td,th',
- styles: { verticalAlign: 'middle' }
- }],
- valignbottom: [{
- selector: 'td,th',
- styles: { verticalAlign: 'bottom' }
- }],
- alignleft: [
- {
- selector: 'figure.image',
- collapsed: false,
- classes: 'align-left',
- ceFalseOverride: true,
- preview: 'font-family font-size'
- },
- {
- selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li',
- styles: { textAlign: 'left' },
- inherit: false,
- preview: false,
- defaultBlock: 'div'
- },
- {
- selector: 'img,table',
- collapsed: false,
- styles: { float: 'left' },
- preview: 'font-family font-size'
- }
- ],
- aligncenter: [
- {
- selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li',
- styles: { textAlign: 'center' },
- inherit: false,
- preview: 'font-family font-size',
- defaultBlock: 'div'
- },
- {
- selector: 'figure.image',
- collapsed: false,
- classes: 'align-center',
- ceFalseOverride: true,
- preview: 'font-family font-size'
- },
- {
- selector: 'img',
- collapsed: false,
- styles: {
- display: 'block',
- marginLeft: 'auto',
- marginRight: 'auto'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var get$8 = function (dom) {
+ var formats = {
+ valigntop: [{
+ selector: 'td,th',
+ styles: { verticalAlign: 'top' }
+ }],
+ valignmiddle: [{
+ selector: 'td,th',
+ styles: { verticalAlign: 'middle' }
+ }],
+ valignbottom: [{
+ selector: 'td,th',
+ styles: { verticalAlign: 'bottom' }
+ }],
+ alignleft: [
+ {
+ selector: 'figure.image',
+ collapsed: false,
+ classes: 'align-left',
+ ceFalseOverride: true,
+ preview: 'font-family font-size'
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- preview: false
- },
- {
- selector: 'table',
- collapsed: false,
- styles: {
- marginLeft: 'auto',
- marginRight: 'auto'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ {
+ selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li',
+ styles: { textAlign: 'left' },
+ inherit: false,
+ preview: false,
+ defaultBlock: 'div'
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- preview: 'font-family font-size'
- }
- ],
- alignright: [
- {
- selector: 'figure.image',
- collapsed: false,
- classes: 'align-right',
- ceFalseOverride: true,
- preview: 'font-family font-size'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ {
+ selector: 'img,table',
+ collapsed: false,
+ styles: { float: 'left' },
+ preview: 'font-family font-size'
+ }
+ ],
+ aligncenter: [
+ {
+ selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li',
+ styles: { textAlign: 'center' },
+ inherit: false,
+ preview: 'font-family font-size',
+ defaultBlock: 'div'
+ },
+ {
+ selector: 'figure.image',
+ collapsed: false,
+ classes: 'align-center',
+ ceFalseOverride: true,
+ preview: 'font-family font-size'
+ },
+ {
+ selector: 'img',
+ collapsed: false,
+ styles: {
+ display: 'block',
+ marginLeft: 'auto',
+ marginRight: 'auto'
+ },
+ preview: false
+ },
+ {
+ selector: 'table',
+ collapsed: false,
+ styles: {
+ marginLeft: 'auto',
+ marginRight: 'auto'
+ },
+ preview: 'font-family font-size'
+ }
+ ],
+ alignright: [
+ {
+ selector: 'figure.image',
+ collapsed: false,
+ classes: 'align-right',
+ ceFalseOverride: true,
+ preview: 'font-family font-size'
+ },
+ {
+ selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li',
+ styles: { textAlign: 'right' },
+ inherit: false,
+ preview: 'font-family font-size',
+ defaultBlock: 'div'
+ },
+ {
+ selector: 'img,table',
+ collapsed: false,
+ styles: { float: 'right' },
+ preview: 'font-family font-size'
+ }
+ ],
+ alignjustify: [{
+ selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li',
+ styles: { textAlign: 'justify' },
+ inherit: false,
+ defaultBlock: 'div',
+ preview: 'font-family font-size'
+ }],
+ bold: [
+ {
+ inline: 'strong',
+ remove: 'all'
+ },
+ {
+ inline: 'span',
+ styles: { fontWeight: 'bold' }
+ },
+ {
+ inline: 'b',
+ remove: 'all'
+ }
+ ],
+ italic: [
+ {
+ inline: 'em',
+ remove: 'all'
+ },
+ {
+ inline: 'span',
+ styles: { fontStyle: 'italic' }
+ },
+ {
+ inline: 'i',
+ remove: 'all'
+ }
+ ],
+ underline: [
+ {
+ inline: 'span',
+ styles: { textDecoration: 'underline' },
+ exact: true
+ },
+ {
+ inline: 'u',
+ remove: 'all'
+ }
+ ],
+ strikethrough: [
+ {
+ inline: 'span',
+ styles: { textDecoration: 'line-through' },
+ exact: true
+ },
+ {
+ inline: 'strike',
+ remove: 'all'
+ }
+ ],
+ forecolor: {
+ inline: 'span',
+ styles: { color: '%value' },
+ links: true,
+ remove_similar: true,
+ clear_child_styles: 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">- {
- selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li',
- styles: { textAlign: 'right' },
- inherit: false,
- preview: 'font-family font-size',
- defaultBlock: 'div'
- },
- {
- selector: 'img,table',
- collapsed: false,
- styles: { float: 'right' },
- preview: 'font-family font-size'
- }
- ],
- alignjustify: [{
- selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li',
- styles: { textAlign: 'justify' },
- inherit: false,
- defaultBlock: 'div',
- preview: 'font-family font-size'
- }],
- bold: [
- {
- inline: 'strong',
- remove: 'all'
- },
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ hilitecolor: {
</ins><span class="cx" style="display: block; padding: 0 10px"> inline: 'span',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- styles: { fontWeight: 'bold' }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ styles: { backgroundColor: '%value' },
+ links: true,
+ remove_similar: true,
+ clear_child_styles: 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">- {
- inline: 'b',
- remove: 'all'
- }
- ],
- italic: [
- {
- inline: 'em',
- remove: 'all'
- },
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ fontname: {
</ins><span class="cx" style="display: block; padding: 0 10px"> inline: 'span',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- styles: { fontStyle: 'italic' }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ toggle: false,
+ styles: { fontFamily: '%value' },
+ clear_child_styles: 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">- {
- inline: 'i',
- remove: 'all'
- }
- ],
- underline: [
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ fontsize: {
</ins><span class="cx" style="display: block; padding: 0 10px"> inline: 'span',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- styles: { textDecoration: 'underline' },
- exact: true
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ toggle: false,
+ styles: { fontSize: '%value' },
+ clear_child_styles: 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">- {
- inline: 'u',
- remove: 'all'
- }
- ],
- strikethrough: [
- {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ fontsize_class: {
</ins><span class="cx" style="display: block; padding: 0 10px"> inline: 'span',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- styles: { textDecoration: 'line-through' },
- exact: true
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ attributes: { class: '%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">- {
- inline: 'strike',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ blockquote: {
+ block: 'blockquote',
+ wrapper: 1,
</ins><span class="cx" style="display: block; padding: 0 10px"> remove: 'all'
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- ],
- forecolor: {
- inline: 'span',
- styles: { color: '%value' },
- links: true,
- remove_similar: true,
- clear_child_styles: true
- },
- hilitecolor: {
- inline: 'span',
- styles: { backgroundColor: '%value' },
- links: true,
- remove_similar: true,
- clear_child_styles: true
- },
- fontname: {
- inline: 'span',
- toggle: false,
- styles: { fontFamily: '%value' },
- clear_child_styles: true
- },
- fontsize: {
- inline: 'span',
- toggle: false,
- styles: { fontSize: '%value' },
- clear_child_styles: true
- },
- fontsize_class: {
- inline: 'span',
- attributes: { class: '%value' }
- },
- blockquote: {
- block: 'blockquote',
- wrapper: 1,
- remove: 'all'
- },
- subscript: { inline: 'sub' },
- superscript: { inline: 'sup' },
- code: { inline: 'code' },
- link: {
- inline: 'a',
- selector: 'a',
- remove: 'all',
- split: true,
- deep: true,
- onmatch: function () {
- return true;
</del><span class="cx" style="display: block; padding: 0 10px"> },
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- onformat: function (elm, fmt, vars) {
- $_6cwiepljjgwe7j4.each(vars, function (value, key) {
- dom.setAttrib(elm, key, value);
- });
- }
- },
- removeformat: [
- {
- selector: 'b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ subscript: { inline: 'sub' },
+ superscript: { inline: 'sup' },
+ code: { inline: 'code' },
+ link: {
+ inline: 'a',
+ selector: 'a',
</ins><span class="cx" style="display: block; padding: 0 10px"> remove: 'all',
</span><span class="cx" style="display: block; padding: 0 10px"> split: true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- expand: false,
- block_expand: true,
- deep: true
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ deep: true,
+ onmatch: function () {
+ return true;
+ },
+ onformat: function (elm, fmt, vars) {
+ Tools.each(vars, function (value, key) {
+ dom.setAttrib(elm, 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">- {
- selector: 'span',
- attributes: [
- 'style',
- 'class'
- ],
- remove: 'empty',
- split: true,
- expand: false,
- deep: true
- },
- {
- selector: '*',
- attributes: [
- 'style',
- 'class'
- ],
- split: false,
- expand: false,
- deep: true
- }
- ]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ removeformat: [
+ {
+ selector: 'b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins',
+ remove: 'all',
+ split: true,
+ expand: false,
+ block_expand: true,
+ deep: true
+ },
+ {
+ selector: 'span',
+ attributes: [
+ 'style',
+ 'class'
+ ],
+ remove: 'empty',
+ split: true,
+ expand: false,
+ deep: true
+ },
+ {
+ selector: '*',
+ attributes: [
+ 'style',
+ 'class'
+ ],
+ split: false,
+ expand: false,
+ deep: true
+ }
+ ]
+ };
+ Tools.each('p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp'.split(/\s/), function (name) {
+ formats[name] = {
+ block: name,
+ remove: 'all'
+ };
+ });
+ return formats;
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_6cwiepljjgwe7j4.each('p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp'.split(/\s/), function (name) {
- formats[name] = {
- block: name,
- remove: 'all'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var DefaultFormats = { get: get$8 };
+
+ function FormatRegistry (editor) {
+ var formats = {};
+ var get = function (name) {
+ return name ? formats[name] : formats;
</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 formats;
- };
- var $_5phnzx6gjjgwe8sf = { get: get$7 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register = function (name, format) {
+ if (name) {
+ if (typeof name !== 'string') {
+ Tools.each(name, function (format, name) {
+ register(name, format);
+ });
+ } else {
+ format = format.length ? format : [format];
+ Tools.each(format, function (format) {
+ if (typeof format.deep === 'undefined') {
+ format.deep = !format.selector;
+ }
+ if (typeof format.split === 'undefined') {
+ format.split = !format.selector || format.inline;
+ }
+ if (typeof format.remove === 'undefined' && format.selector && !format.inline) {
+ format.remove = 'none';
+ }
+ if (format.selector && format.inline) {
+ format.mixed = true;
+ format.block_expand = true;
+ }
+ if (typeof format.classes === 'string') {
+ format.classes = format.classes.split(/\s+/);
+ }
+ });
+ formats[name] = format;
+ }
+ }
+ };
+ var unregister = function (name) {
+ if (name && formats[name]) {
+ delete formats[name];
+ }
+ return formats;
+ };
+ register(DefaultFormats.get(editor.dom));
+ register(editor.settings.formats);
+ return {
+ get: get,
+ register: register,
+ unregister: unregister
+ };
+ }
</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 FormatRegistry (editor) {
- var formats = {};
- var get = function (name) {
- return name ? formats[name] : formats;
- };
- var register = function (name, format) {
- if (name) {
- if (typeof name !== 'string') {
- $_6cwiepljjgwe7j4.each(name, function (format, name) {
- register(name, format);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var each$h = Tools.each;
+ var dom = DOMUtils$1.DOM;
+ var parsedSelectorToHtml = function (ancestry, editor) {
+ var elm, item, fragment;
+ var schema = editor && editor.schema || Schema({});
+ var decorate = function (elm, item) {
+ if (item.classes.length) {
+ dom.addClass(elm, item.classes.join(' '));
+ }
+ dom.setAttribs(elm, item.attrs);
+ };
+ var createElement = function (sItem) {
+ var elm;
+ item = typeof sItem === 'string' ? {
+ name: sItem,
+ classes: [],
+ attrs: {}
+ } : sItem;
+ elm = dom.create(item.name);
+ decorate(elm, item);
+ return elm;
+ };
+ var getRequiredParent = function (elm, candidate) {
+ var name = typeof elm !== 'string' ? elm.nodeName.toLowerCase() : elm;
+ var elmRule = schema.getElementRule(name);
+ var parentsRequired = elmRule && elmRule.parentsRequired;
+ if (parentsRequired && parentsRequired.length) {
+ return candidate && Tools.inArray(parentsRequired, candidate) !== -1 ? candidate : parentsRequired[0];
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- format = format.length ? format : [format];
- $_6cwiepljjgwe7j4.each(format, function (format) {
- if (typeof format.deep === 'undefined') {
- format.deep = !format.selector;
- }
- if (typeof format.split === 'undefined') {
- format.split = !format.selector || format.inline;
- }
- if (typeof format.remove === 'undefined' && format.selector && !format.inline) {
- format.remove = 'none';
- }
- if (format.selector && format.inline) {
- format.mixed = true;
- format.block_expand = true;
- }
- if (typeof format.classes === 'string') {
- format.classes = format.classes.split(/\s+/);
- }
- });
- formats[name] = format;
</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 unregister = function (name) {
- if (name && formats[name]) {
- delete formats[name];
- }
- return formats;
- };
- register($_5phnzx6gjjgwe8sf.get(editor.dom));
- register(editor.settings.formats);
- return {
- get: get,
- register: register,
- unregister: unregister
- };
- }
-
- var each$17 = $_6cwiepljjgwe7j4.each;
- var dom = DOMUtils$1.DOM;
- var parsedSelectorToHtml = function (ancestry, editor) {
- var elm, item, fragment;
- var schema = editor && editor.schema || Schema({});
- var decorate = function (elm, item) {
- if (item.classes.length) {
- dom.addClass(elm, item.classes.join(' '));
- }
- dom.setAttribs(elm, item.attrs);
- };
- var createElement = function (sItem) {
- var elm;
- item = typeof sItem === 'string' ? {
- name: sItem,
- classes: [],
- attrs: {}
- } : sItem;
- elm = dom.create(item.name);
- decorate(elm, item);
- return elm;
- };
- var getRequiredParent = function (elm, candidate) {
- var name = typeof elm !== 'string' ? elm.nodeName.toLowerCase() : elm;
- var elmRule = schema.getElementRule(name);
- var parentsRequired = elmRule && elmRule.parentsRequired;
- if (parentsRequired && parentsRequired.length) {
- return candidate && $_6cwiepljjgwe7j4.inArray(parentsRequired, candidate) !== -1 ? candidate : parentsRequired[0];
- } else {
- return false;
- }
- };
- var wrapInHtml = function (elm, ancestry, siblings) {
- var parent, parentCandidate, parentRequired;
- var ancestor = ancestry.length > 0 && ancestry[0];
- var ancestorName = ancestor && ancestor.name;
- parentRequired = getRequiredParent(elm, ancestorName);
- if (parentRequired) {
- if (ancestorName === parentRequired) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var wrapInHtml = function (elm, ancestry, siblings) {
+ var parent, parentCandidate, parentRequired;
+ var ancestor = ancestry.length > 0 && ancestry[0];
+ var ancestorName = ancestor && ancestor.name;
+ parentRequired = getRequiredParent(elm, ancestorName);
+ if (parentRequired) {
+ if (ancestorName === parentRequired) {
+ parentCandidate = ancestry[0];
+ ancestry = ancestry.slice(1);
+ } else {
+ parentCandidate = parentRequired;
+ }
+ } else if (ancestor) {
</ins><span class="cx" style="display: block; padding: 0 10px"> parentCandidate = ancestry[0];
</span><span class="cx" style="display: block; padding: 0 10px"> ancestry = ancestry.slice(1);
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- parentCandidate = parentRequired;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if (!siblings) {
+ 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">- } else if (ancestor) {
- parentCandidate = ancestry[0];
- ancestry = ancestry.slice(1);
- } else if (!siblings) {
- return elm;
- }
- if (parentCandidate) {
- parent = createElement(parentCandidate);
- parent.appendChild(elm);
- }
- if (siblings) {
- if (!parent) {
- parent = dom.create('div');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (parentCandidate) {
+ parent = createElement(parentCandidate);
</ins><span class="cx" style="display: block; padding: 0 10px"> parent.appendChild(elm);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_6cwiepljjgwe7j4.each(siblings, function (sibling) {
- var siblingElm = createElement(sibling);
- parent.insertBefore(siblingElm, elm);
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (siblings) {
+ if (!parent) {
+ parent = dom.create('div');
+ parent.appendChild(elm);
+ }
+ Tools.each(siblings, function (sibling) {
+ var siblingElm = createElement(sibling);
+ parent.insertBefore(siblingElm, elm);
+ });
+ }
+ return wrapInHtml(parent, ancestry, parentCandidate && parentCandidate.siblings);
+ };
+ if (ancestry && ancestry.length) {
+ item = ancestry[0];
+ elm = createElement(item);
+ fragment = dom.create('div');
+ fragment.appendChild(wrapInHtml(elm, ancestry.slice(1), item.siblings));
+ return fragment;
+ } else {
+ 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 wrapInHtml(parent, ancestry, parentCandidate && parentCandidate.siblings);
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (ancestry && ancestry.length) {
- item = ancestry[0];
- elm = createElement(item);
- fragment = dom.create('div');
- fragment.appendChild(wrapInHtml(elm, ancestry.slice(1), item.siblings));
- return fragment;
- } else {
- return '';
- }
- };
- var selectorToHtml = function (selector, editor) {
- return parsedSelectorToHtml(parseSelector(selector), editor);
- };
- var parseSelectorItem = function (item) {
- var tagName;
- var obj = {
- classes: [],
- attrs: {}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var selectorToHtml = function (selector, editor) {
+ return parsedSelectorToHtml(parseSelector(selector), 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">- item = obj.selector = $_6cwiepljjgwe7j4.trim(item);
- if (item !== '*') {
- tagName = item.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g, function ($0, $1, $2, $3, $4) {
- switch ($1) {
- case '#':
- obj.attrs.id = $2;
- break;
- case '.':
- obj.classes.push($2);
- break;
- case ':':
- if ($_6cwiepljjgwe7j4.inArray('checked disabled enabled read-only required'.split(' '), $2) !== -1) {
- obj.attrs[$2] = $2;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var parseSelectorItem = function (item) {
+ var tagName;
+ var obj = {
+ classes: [],
+ attrs: {}
+ };
+ item = obj.selector = Tools.trim(item);
+ if (item !== '*') {
+ tagName = item.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g, function ($0, $1, $2, $3, $4) {
+ switch ($1) {
+ case '#':
+ obj.attrs.id = $2;
+ break;
+ case '.':
+ obj.classes.push($2);
+ break;
+ case ':':
+ if (Tools.inArray('checked disabled enabled read-only required'.split(' '), $2) !== -1) {
+ obj.attrs[$2] = $2;
+ }
+ 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">- break;
- }
- if ($3 === '[') {
- var m = $4.match(/([\w\-]+)(?:\=\"([^\"]+))?/);
- if (m) {
- obj.attrs[m[1]] = m[2];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ($3 === '[') {
+ var m = $4.match(/([\w\-]+)(?:\=\"([^\"]+))?/);
+ if (m) {
+ obj.attrs[m[1]] = m[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">- }
- return '';
- });
- }
- obj.name = tagName || 'div';
- return obj;
- };
- var parseSelector = function (selector) {
- if (!selector || typeof selector !== 'string') {
- return [];
- }
- selector = selector.split(/\s*,\s*/)[0];
- selector = selector.replace(/\s*(~\+|~|\+|>)\s*/g, '$1');
- return $_6cwiepljjgwe7j4.map(selector.split(/(?:>|\s+(?![^\[\]]+\]))/), function (item) {
- var siblings = $_6cwiepljjgwe7j4.map(item.split(/(?:~\+|~|\+)/), parseSelectorItem);
- var obj = siblings.pop();
- if (siblings.length) {
- obj.siblings = siblings;
</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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ obj.name = tagName || 'div';
</ins><span class="cx" style="display: block; padding: 0 10px"> return obj;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }).reverse();
- };
- var getCssText = function (editor, format) {
- var name, previewFrag, previewElm, items;
- var previewCss = '', parentFontSize, previewStyles;
- previewStyles = editor.settings.preview_styles;
- if (previewStyles === false) {
- return '';
- }
- if (typeof previewStyles !== 'string') {
- previewStyles = 'font-family font-size font-weight font-style text-decoration ' + 'text-transform color background-color border border-radius outline text-shadow';
- }
- var removeVars = function (val) {
- return val.replace(/%(\w+)/g, '');
</del><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 format === 'string') {
- format = editor.formatter.get(format);
- if (!format) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var parseSelector = function (selector) {
+ if (!selector || typeof selector !== 'string') {
+ 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">- format = format[0];
- }
- if ('preview' in format) {
- previewStyles = format.preview;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ selector = selector.split(/\s*,\s*/)[0];
+ selector = selector.replace(/\s*(~\+|~|\+|>)\s*/g, '$1');
+ return Tools.map(selector.split(/(?:>|\s+(?![^\[\]]+\]))/), function (item) {
+ var siblings = Tools.map(item.split(/(?:~\+|~|\+)/), parseSelectorItem);
+ var obj = siblings.pop();
+ if (siblings.length) {
+ obj.siblings = siblings;
+ }
+ return obj;
+ }).reverse();
+ };
+ var getCssText = function (editor, format) {
+ var name, previewFrag, previewElm, items;
+ var previewCss = '', parentFontSize, previewStyles;
+ previewStyles = editor.settings.preview_styles;
</ins><span class="cx" style="display: block; padding: 0 10px"> if (previewStyles === false) {
</span><span class="cx" style="display: block; padding: 0 10px"> return '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- name = format.block || format.inline || 'span';
- items = parseSelector(format.selector);
- if (items.length) {
- if (!items[0].name) {
- items[0].name = name;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (typeof previewStyles !== 'string') {
+ previewStyles = 'font-family font-size font-weight font-style text-decoration ' + 'text-transform color background-color border border-radius outline text-shadow';
</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 = format.selector;
- previewFrag = parsedSelectorToHtml(items, editor);
- } else {
- previewFrag = parsedSelectorToHtml([name], editor);
- }
- previewElm = dom.select(name, previewFrag)[0] || previewFrag.firstChild;
- each$17(format.styles, function (value, name) {
- value = removeVars(value);
- if (value) {
- dom.setStyle(previewElm, name, value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var removeVars = function (val) {
+ return val.replace(/%(\w+)/g, '');
+ };
+ if (typeof format === 'string') {
+ format = editor.formatter.get(format);
+ if (!format) {
+ return;
+ }
+ format = format[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">- });
- each$17(format.attributes, function (value, name) {
- value = removeVars(value);
- if (value) {
- dom.setAttrib(previewElm, name, value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ('preview' in format) {
+ previewStyles = format.preview;
+ if (previewStyles === 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">- });
- each$17(format.classes, function (value) {
- value = removeVars(value);
- if (!dom.hasClass(previewElm, value)) {
- dom.addClass(previewElm, value);
- }
- });
- editor.fire('PreviewFormats');
- dom.setStyles(previewFrag, {
- position: 'absolute',
- left: -65535
- });
- editor.getBody().appendChild(previewFrag);
- parentFontSize = dom.getStyle(editor.getBody(), 'fontSize', true);
- parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0;
- each$17(previewStyles.split(' '), function (name) {
- var value = dom.getStyle(previewElm, name, true);
- if (name === 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) {
- value = dom.getStyle(editor.getBody(), name, true);
- if (dom.toHex(value).toLowerCase() === '#ffffff') {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ name = format.block || format.inline || 'span';
+ items = parseSelector(format.selector);
+ if (items.length) {
+ if (!items[0].name) {
+ items[0].name = name;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ name = format.selector;
+ previewFrag = parsedSelectorToHtml(items, editor);
+ } else {
+ previewFrag = parsedSelectorToHtml([name], 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">- if (name === 'color') {
- if (dom.toHex(value).toLowerCase() === '#000000') {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ previewElm = dom.select(name, previewFrag)[0] || previewFrag.firstChild;
+ each$h(format.styles, function (value, name) {
+ value = removeVars(value);
+ if (value) {
+ dom.setStyle(previewElm, 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">- }
- if (name === 'font-size') {
- if (/em|%$/.test(value)) {
- if (parentFontSize === 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ each$h(format.attributes, function (value, name) {
+ value = removeVars(value);
+ if (value) {
+ dom.setAttrib(previewElm, name, value);
+ }
+ });
+ each$h(format.classes, function (value) {
+ value = removeVars(value);
+ if (!dom.hasClass(previewElm, value)) {
+ dom.addClass(previewElm, value);
+ }
+ });
+ editor.fire('PreviewFormats');
+ dom.setStyles(previewFrag, {
+ position: 'absolute',
+ left: -65535
+ });
+ editor.getBody().appendChild(previewFrag);
+ parentFontSize = dom.getStyle(editor.getBody(), 'fontSize', true);
+ parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0;
+ each$h(previewStyles.split(' '), function (name) {
+ var value = dom.getStyle(previewElm, name, true);
+ if (name === 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) {
+ value = dom.getStyle(editor.getBody(), name, true);
+ if (dom.toHex(value).toLowerCase() === '#ffffff') {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var numValue = parseFloat(value) / (/%$/.test(value) ? 100 : 1);
- value = numValue * parentFontSize + 'px';
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (name === 'color') {
+ if (dom.toHex(value).toLowerCase() === '#000000') {
+ return;
+ }
+ }
+ if (name === 'font-size') {
+ if (/em|%$/.test(value)) {
+ if (parentFontSize === 0) {
+ return;
+ }
+ var numValue = parseFloat(value) / (/%$/.test(value) ? 100 : 1);
+ value = numValue * parentFontSize + 'px';
+ }
+ }
+ if (name === 'border' && value) {
+ previewCss += 'padding:0 2px;';
+ }
+ previewCss += name + ':' + value + ';';
+ });
+ editor.fire('AfterPreviewFormats');
+ dom.remove(previewFrag);
+ return previewCss;
+ };
+ var Preview = {
+ getCssText: getCssText,
+ parseSelector: parseSelector,
+ selectorToHtml: selectorToHtml
+ };
+
+ var toggle$3 = function (editor, formats, name, vars, node) {
+ var fmt = formats.get(name);
+ if (MatchFormat.match(editor, name, vars, node) && (!('toggle' in fmt[0]) || fmt[0].toggle)) {
+ RemoveFormat.remove(editor, name, vars, node);
+ } else {
+ ApplyFormat.applyFormat(editor, name, vars, 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 (name === 'border' && value) {
- previewCss += 'padding:0 2px;';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var ToggleFormat = { toggle: toggle$3 };
+
+ var setup$6 = function (editor) {
+ editor.addShortcut('meta+b', '', 'Bold');
+ editor.addShortcut('meta+i', '', 'Italic');
+ editor.addShortcut('meta+u', '', 'Underline');
+ for (var i = 1; i <= 6; i++) {
+ editor.addShortcut('access+' + i, '', [
+ 'FormatBlock',
+ false,
+ 'h' + 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">- previewCss += name + ':' + value + ';';
- });
- editor.fire('AfterPreviewFormats');
- dom.remove(previewFrag);
- return previewCss;
- };
- var $_6zfajg6hjjgwe8sl = {
- getCssText: getCssText,
- parseSelector: parseSelector,
- selectorToHtml: selectorToHtml
- };
-
- var toggle$3 = function (editor, formats, name, vars, node) {
- var fmt = formats.get(name);
- if ($_7svyif69jjgwe8rf.match(editor, name, vars, node) && (!('toggle' in fmt[0]) || fmt[0].toggle)) {
- $_y6kng6djjgwe8ry.remove(editor, name, vars, node);
- } else {
- $_b0knyc67jjgwe8qi.applyFormat(editor, name, vars, node);
- }
- };
- var $_d9x3256ijjgwe8sr = { toggle: toggle$3 };
-
- var setup$6 = function (editor) {
- editor.addShortcut('meta+b', '', 'Bold');
- editor.addShortcut('meta+i', '', 'Italic');
- editor.addShortcut('meta+u', '', 'Underline');
- for (var i = 1; i <= 6; i++) {
- editor.addShortcut('access+' + i, '', [
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.addShortcut('access+7', '', [
</ins><span class="cx" style="display: block; padding: 0 10px"> 'FormatBlock',
</span><span class="cx" style="display: block; padding: 0 10px"> false,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'h' + i
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'p'
</ins><span class="cx" style="display: block; padding: 0 10px"> ]);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.addShortcut('access+8', '', [
+ 'FormatBlock',
+ false,
+ 'div'
+ ]);
+ editor.addShortcut('access+9', '', [
+ 'FormatBlock',
+ false,
+ 'address'
+ ]);
+ };
+ var FormatShortcuts = { setup: setup$6 };
+
+ function Formatter (editor) {
+ var formats = FormatRegistry(editor);
+ var formatChangeState = Cell(null);
+ FormatShortcuts.setup(editor);
+ setup$4(editor);
+ return {
+ get: formats.get,
+ register: formats.register,
+ unregister: formats.unregister,
+ apply: curry(ApplyFormat.applyFormat, editor),
+ remove: curry(RemoveFormat.remove, editor),
+ toggle: curry(ToggleFormat.toggle, editor, formats),
+ match: curry(MatchFormat.match, editor),
+ matchAll: curry(MatchFormat.matchAll, editor),
+ matchNode: curry(MatchFormat.matchNode, editor),
+ canApply: curry(MatchFormat.canApply, editor),
+ formatChanged: curry(FormatChanged.formatChanged, editor, formatChangeState),
+ getCssText: curry(Preview.getCssText, 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">- editor.addShortcut('access+7', '', [
- 'FormatBlock',
- false,
- 'p'
- ]);
- editor.addShortcut('access+8', '', [
- 'FormatBlock',
- false,
- 'div'
- ]);
- editor.addShortcut('access+9', '', [
- 'FormatBlock',
- false,
- 'address'
- ]);
- };
- var $_5sdg916jjjgwe8ss = { setup: setup$6 };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function Formatter (editor) {
- var formats = FormatRegistry(editor);
- var formatChangeState = Cell(null);
- $_5sdg916jjjgwe8ss.setup(editor);
- setup$4(editor);
- return {
- get: formats.get,
- register: formats.register,
- unregister: formats.unregister,
- apply: curry($_b0knyc67jjgwe8qi.applyFormat, editor),
- remove: curry($_y6kng6djjgwe8ry.remove, editor),
- toggle: curry($_d9x3256ijjgwe8sr.toggle, editor, formats),
- match: curry($_7svyif69jjgwe8rf.match, editor),
- matchAll: curry($_7svyif69jjgwe8rf.matchAll, editor),
- matchNode: curry($_7svyif69jjgwe8rf.matchNode, editor),
- canApply: curry($_7svyif69jjgwe8rf.canApply, editor),
- formatChanged: curry($_4iv60i6ejjgwe8sa.formatChanged, editor, formatChangeState),
- getCssText: curry($_6zfajg6hjjgwe8sl.getCssText, editor)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
+ var shallow$1 = function (old, nu) {
+ return nu;
</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 hasOwnProperty$1 = Object.prototype.hasOwnProperty;
- var shallow$1 = function (old, nu) {
- return nu;
- };
- var baseMerge = function (merger) {
- return function () {
- var objects = new Array(arguments.length);
- for (var i = 0; i < objects.length; i++)
- objects[i] = arguments[i];
- if (objects.length === 0)
- throw new Error('Can\'t merge zero objects');
- var ret = {};
- for (var j = 0; j < objects.length; j++) {
- var curObject = objects[j];
- for (var key in curObject)
- if (hasOwnProperty$1.call(curObject, key)) {
- ret[key] = merger(ret[key], curObject[key]);
- }
- }
- return ret;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var baseMerge = function (merger) {
+ return function () {
+ var objects = new Array(arguments.length);
+ for (var i = 0; i < objects.length; i++)
+ objects[i] = arguments[i];
+ if (objects.length === 0)
+ throw new Error('Can\'t merge zero objects');
+ var ret = {};
+ for (var j = 0; j < objects.length; j++) {
+ var curObject = objects[j];
+ for (var key in curObject)
+ if (hasOwnProperty$2.call(curObject, key)) {
+ ret[key] = merger(ret[key], curObject[key]);
+ }
+ }
+ return ret;
+ };
</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">+ var merge = baseMerge(shallow$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">- var merge = baseMerge(shallow$1);
-
- var register = function (htmlParser, settings, dom) {
- htmlParser.addAttributeFilter('data-mce-tabindex', function (nodes, name) {
- var i = nodes.length, node;
- while (i--) {
- node = nodes[i];
- node.attr('tabindex', node.attributes.map['data-mce-tabindex']);
- node.attr(name, null);
- }
- });
- htmlParser.addAttributeFilter('src,href,style', function (nodes, name) {
- var i = nodes.length, node, value;
- var internalName = 'data-mce-' + name;
- var urlConverter = settings.url_converter;
- var urlConverterScope = settings.url_converter_scope;
- while (i--) {
- node = nodes[i];
- value = node.attributes.map[internalName];
- if (value !== undefined) {
- node.attr(name, value.length > 0 ? value : null);
- node.attr(internalName, null);
- } else {
- value = node.attributes.map[name];
- if (name === 'style') {
- value = dom.serializeStyle(dom.parseStyle(value), node.name);
- } else if (urlConverter) {
- value = urlConverter.call(urlConverterScope, value, name, node.name);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register = function (htmlParser, settings, dom) {
+ htmlParser.addAttributeFilter('data-mce-tabindex', function (nodes, name) {
+ var i = nodes.length, node;
+ while (i--) {
+ node = nodes[i];
+ node.attr('tabindex', node.attributes.map['data-mce-tabindex']);
+ node.attr(name, null);
+ }
+ });
+ htmlParser.addAttributeFilter('src,href,style', function (nodes, name) {
+ var i = nodes.length, node, value;
+ var internalName = 'data-mce-' + name;
+ var urlConverter = settings.url_converter;
+ var urlConverterScope = settings.url_converter_scope;
+ while (i--) {
+ node = nodes[i];
+ value = node.attributes.map[internalName];
+ if (value !== undefined) {
+ node.attr(name, value.length > 0 ? value : null);
+ node.attr(internalName, null);
+ } else {
+ value = node.attributes.map[name];
+ if (name === 'style') {
+ value = dom.serializeStyle(dom.parseStyle(value), node.name);
+ } else if (urlConverter) {
+ value = urlConverter.call(urlConverterScope, value, name, node.name);
+ }
+ node.attr(name, value.length > 0 ? value : null);
</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.attr(name, value.length > 0 ? value : null);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- });
- htmlParser.addAttributeFilter('class', function (nodes) {
- var i = nodes.length, node, value;
- while (i--) {
- node = nodes[i];
- value = node.attr('class');
- if (value) {
- value = node.attr('class').replace(/(?:^|\s)mce-item-\w+(?!\S)/g, '');
- node.attr('class', value.length > 0 ? value : null);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ htmlParser.addAttributeFilter('class', function (nodes) {
+ var i = nodes.length, node, value;
+ while (i--) {
+ node = nodes[i];
+ value = node.attr('class');
+ if (value) {
+ value = node.attr('class').replace(/(?:^|\s)mce-item-\w+(?!\S)/g, '');
+ node.attr('class', value.length > 0 ? value : 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">- }
- });
- htmlParser.addAttributeFilter('data-mce-type', function (nodes, name, args) {
- var i = nodes.length, node;
- while (i--) {
- node = nodes[i];
- if (node.attributes.map['data-mce-type'] === 'bookmark' && !args.cleanup) {
- node.remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ htmlParser.addAttributeFilter('data-mce-type', function (nodes, name, args) {
+ var i = nodes.length, node;
+ while (i--) {
+ node = nodes[i];
+ if (node.attributes.map['data-mce-type'] === 'bookmark' && !args.cleanup) {
+ node.remove();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- });
- htmlParser.addNodeFilter('noscript', function (nodes) {
- var i = nodes.length, node;
- while (i--) {
- node = nodes[i].firstChild;
- if (node) {
- node.value = $_6pqr9q1sjjgwe7qj.decode(node.value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ htmlParser.addNodeFilter('noscript', function (nodes) {
+ var i = nodes.length, node;
+ while (i--) {
+ node = nodes[i].firstChild;
+ if (node) {
+ node.value = Entities.decode(node.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">- }
- });
- htmlParser.addNodeFilter('script,style', function (nodes, name) {
- var i = nodes.length, node, value, type;
- var trim = function (value) {
- return value.replace(/(<!--\[CDATA\[|\]\]-->)/g, '\n').replace(/^[\r\n]*|[\r\n]*$/g, '').replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi, '').replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g, '');
- };
- while (i--) {
- node = nodes[i];
- value = node.firstChild ? node.firstChild.value : '';
- if (name === 'script') {
- type = node.attr('type');
- if (type) {
- node.attr('type', type === 'mce-no/type' ? null : type.replace(/^mce\-/, ''));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ htmlParser.addNodeFilter('script,style', function (nodes, name) {
+ var i = nodes.length, node, value, type;
+ var trim = function (value) {
+ return value.replace(/(<!--\[CDATA\[|\]\]-->)/g, '\n').replace(/^[\r\n]*|[\r\n]*$/g, '').replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi, '').replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g, '');
+ };
+ while (i--) {
+ node = nodes[i];
+ value = node.firstChild ? node.firstChild.value : '';
+ if (name === 'script') {
+ type = node.attr('type');
+ if (type) {
+ node.attr('type', type === 'mce-no/type' ? null : type.replace(/^mce\-/, ''));
+ }
+ if (settings.element_format === 'xhtml' && value.length > 0) {
+ node.firstChild.value = '// <![CDATA[\n' + trim(value) + '\n// ]]>';
+ }
+ } else {
+ if (settings.element_format === 'xhtml' && value.length > 0) {
+ node.firstChild.value = '<!--\n' + trim(value) + '\n-->';
+ }
</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.element_format === 'xhtml' && value.length > 0) {
- node.firstChild.value = '// <![CDATA[\n' + trim(value) + '\n// ]]>';
- }
- } else {
- if (settings.element_format === 'xhtml' && value.length > 0) {
- node.firstChild.value = '<!--\n' + trim(value) + '\n-->';
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- });
- htmlParser.addNodeFilter('#comment', function (nodes) {
- var i = nodes.length, node;
- while (i--) {
- node = nodes[i];
- if (node.value.indexOf('[CDATA[') === 0) {
- node.name = '#cdata';
- node.type = 4;
- node.value = node.value.replace(/^\[CDATA\[|\]\]$/g, '');
- } else if (node.value.indexOf('mce:protected ') === 0) {
- node.name = '#text';
- node.type = 3;
- node.raw = true;
- node.value = unescape(node.value).substr(14);
- }
- }
- });
- htmlParser.addNodeFilter('xml:namespace,input', function (nodes, name) {
- var i = nodes.length, node;
- while (i--) {
- node = nodes[i];
- if (node.type === 7) {
- node.remove();
- } else if (node.type === 1) {
- if (name === 'input' && !('type' in node.attributes.map)) {
- node.attr('type', 'text');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ htmlParser.addNodeFilter('#comment', function (nodes) {
+ var i = nodes.length, node;
+ while (i--) {
+ node = nodes[i];
+ if (node.value.indexOf('[CDATA[') === 0) {
+ node.name = '#cdata';
+ node.type = 4;
+ node.value = node.value.replace(/^\[CDATA\[|\]\]$/g, '');
+ } else if (node.value.indexOf('mce:protected ') === 0) {
+ node.name = '#text';
+ node.type = 3;
+ node.raw = true;
+ node.value = unescape(node.value).substr(14);
</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">- }
- });
- htmlParser.addAttributeFilter('data-mce-type', function (nodes) {
- each(nodes, function (node) {
- if (node.attr('data-mce-type') === 'format-caret') {
- if (node.isEmpty(htmlParser.schema.getNonEmptyElements())) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ htmlParser.addNodeFilter('xml:namespace,input', function (nodes, name) {
+ var i = nodes.length, node;
+ while (i--) {
+ node = nodes[i];
+ if (node.type === 7) {
</ins><span class="cx" style="display: block; padding: 0 10px"> node.remove();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- node.unwrap();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if (node.type === 1) {
+ if (name === 'input' && !('type' in node.attributes.map)) {
+ node.attr('type', 'text');
+ }
</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">- });
- htmlParser.addAttributeFilter('data-mce-src,data-mce-href,data-mce-style,' + 'data-mce-selected,data-mce-expando,' + 'data-mce-type,data-mce-resize', function (nodes, name) {
- var i = nodes.length;
- while (i--) {
- nodes[i].attr(name, null);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ htmlParser.addAttributeFilter('data-mce-type', function (nodes) {
+ each(nodes, function (node) {
+ if (node.attr('data-mce-type') === 'format-caret') {
+ if (node.isEmpty(htmlParser.schema.getNonEmptyElements())) {
+ node.remove();
+ } else {
+ node.unwrap();
+ }
+ }
+ });
+ });
+ htmlParser.addAttributeFilter('data-mce-src,data-mce-href,data-mce-style,' + 'data-mce-selected,data-mce-expando,' + 'data-mce-type,data-mce-resize', function (nodes, name) {
+ var i = nodes.length;
+ while (i--) {
+ nodes[i].attr(name, null);
+ }
+ });
+ };
+ var trimTrailingBr = function (rootNode) {
+ var brNode1, brNode2;
+ var isBr = function (node) {
+ return node && node.name === 'br';
+ };
+ brNode1 = rootNode.lastChild;
+ if (isBr(brNode1)) {
+ brNode2 = brNode1.prev;
+ if (isBr(brNode2)) {
+ brNode1.remove();
+ brNode2.remove();
+ }
</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 trimTrailingBr = function (rootNode) {
- var brNode1, brNode2;
- var isBr = function (node) {
- return node && node.name === 'br';
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- brNode1 = rootNode.lastChild;
- if (isBr(brNode1)) {
- brNode2 = brNode1.prev;
- if (isBr(brNode2)) {
- brNode1.remove();
- brNode2.remove();
- }
- }
- };
- var $_51rhs16njjgwe8ts = {
- register: register,
- trimTrailingBr: trimTrailingBr
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var DomSerializerFilters = {
+ register: register,
+ trimTrailingBr: trimTrailingBr
+ };
</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 preProcess = function (editor, node, args) {
- var impl, doc, oldDoc;
- var dom = editor.dom;
- node = node.cloneNode(true);
- impl = document.implementation;
- if (impl.createHTMLDocument) {
- doc = impl.createHTMLDocument('');
- $_6cwiepljjgwe7j4.each(node.nodeName === 'BODY' ? node.childNodes : [node], function (node) {
- doc.body.appendChild(doc.importNode(node, true));
- });
- if (node.nodeName !== 'BODY') {
- node = doc.body.firstChild;
- } else {
- node = doc.body;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var preProcess = function (editor, node, args) {
+ var impl, doc, oldDoc;
+ var dom = editor.dom;
+ node = node.cloneNode(true);
+ impl = document.implementation;
+ if (impl.createHTMLDocument) {
+ doc = impl.createHTMLDocument('');
+ Tools.each(node.nodeName === 'BODY' ? node.childNodes : [node], function (node) {
+ doc.body.appendChild(doc.importNode(node, true));
+ });
+ if (node.nodeName !== 'BODY') {
+ node = doc.body.firstChild;
+ } else {
+ node = doc.body;
+ }
+ oldDoc = dom.doc;
+ dom.doc = doc;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- oldDoc = dom.doc;
- dom.doc = doc;
- }
- $_b2ca654tjjgwe8ic.firePreProcess(editor, merge(args, { node: node }));
- if (oldDoc) {
- dom.doc = oldDoc;
- }
- return node;
- };
- var shouldFireEvent = function (editor, args) {
- return editor && editor.hasEventListeners('PreProcess') && !args.no_events;
- };
- var process = function (editor, node, args) {
- return shouldFireEvent(editor, args) ? preProcess(editor, node, args) : node;
- };
- var $_5u4dpu6ojjgwe8u3 = { process: process };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Events.firePreProcess(editor, merge(args, { node: node }));
+ if (oldDoc) {
+ dom.doc = oldDoc;
+ }
+ return node;
+ };
+ var shouldFireEvent = function (editor, args) {
+ return editor && editor.hasEventListeners('PreProcess') && !args.no_events;
+ };
+ var process = function (editor, node, args) {
+ return shouldFireEvent(editor, args) ? preProcess(editor, node, args) : node;
+ };
+ var DomSerializerPreProcess = { process: process };
</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 removeAttrs = function (node, names) {
- each(names, function (name) {
- node.attr(name, null);
- });
- };
- var addFontToSpansFilter = function (domParser, styles, fontSizes) {
- domParser.addNodeFilter('font', function (nodes) {
- each(nodes, function (node) {
- var props = styles.parse(node.attr('style'));
- var color = node.attr('color');
- var face = node.attr('face');
- var size = node.attr('size');
- if (color) {
- props.color = color;
- }
- if (face) {
- props['font-family'] = face;
- }
- if (size) {
- props['font-size'] = fontSizes[parseInt(node.attr('size'), 10) - 1];
- }
- node.name = 'span';
- node.attr('style', styles.serialize(props));
- removeAttrs(node, [
- 'color',
- 'face',
- 'size'
- ]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var removeAttrs = function (node, names) {
+ each(names, function (name) {
+ node.attr(name, 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">- });
- };
- var addStrikeToSpanFilter = function (domParser, styles) {
- domParser.addNodeFilter('strike', function (nodes) {
- each(nodes, function (node) {
- var props = styles.parse(node.attr('style'));
- props['text-decoration'] = 'line-through';
- node.name = 'span';
- node.attr('style', styles.serialize(props));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var addFontToSpansFilter = function (domParser, styles, fontSizes) {
+ domParser.addNodeFilter('font', function (nodes) {
+ each(nodes, function (node) {
+ var props = styles.parse(node.attr('style'));
+ var color = node.attr('color');
+ var face = node.attr('face');
+ var size = node.attr('size');
+ if (color) {
+ props.color = color;
+ }
+ if (face) {
+ props['font-family'] = face;
+ }
+ if (size) {
+ props['font-size'] = fontSizes[parseInt(node.attr('size'), 10) - 1];
+ }
+ node.name = 'span';
+ node.attr('style', styles.serialize(props));
+ removeAttrs(node, [
+ 'color',
+ 'face',
+ 'size'
+ ]);
+ });
</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 addFilters = function (domParser, settings) {
- var styles = Styles();
- if (settings.convert_fonts_to_spans) {
- addFontToSpansFilter(domParser, styles, $_6cwiepljjgwe7j4.explode(settings.font_size_legacy_values));
- }
- addStrikeToSpanFilter(domParser, styles);
- };
- var register$1 = function (domParser, settings) {
- if (settings.inline_styles) {
- addFilters(domParser, settings);
- }
- };
- var $_ee8az66qjjgwe8up = { register: register$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var addStrikeToSpanFilter = function (domParser, styles) {
+ domParser.addNodeFilter('strike', function (nodes) {
+ each(nodes, function (node) {
+ var props = styles.parse(node.attr('style'));
+ props['text-decoration'] = 'line-through';
+ node.name = 'span';
+ node.attr('style', styles.serialize(props));
+ });
+ });
+ };
+ var addFilters = function (domParser, settings) {
+ var styles = Styles();
+ if (settings.convert_fonts_to_spans) {
+ addFontToSpansFilter(domParser, styles, Tools.explode(settings.font_size_legacy_values));
+ }
+ addStrikeToSpanFilter(domParser, styles);
+ };
+ var register$1 = function (domParser, settings) {
+ if (settings.inline_styles) {
+ addFilters(domParser, settings);
+ }
+ };
+ var LegacyFilter = { register: register$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">- var whiteSpaceRegExp$3 = /^[ \t\r\n]*$/;
- var typeLookup = {
- '#text': 3,
- '#comment': 8,
- '#cdata': 4,
- '#pi': 7,
- '#doctype': 10,
- '#document-fragment': 11
- };
- var walk$3 = function (node, root, prev) {
- var sibling;
- var parent;
- var startName = prev ? 'lastChild' : 'firstChild';
- var siblingName = prev ? 'prev' : 'next';
- if (node[startName]) {
- return node[startName];
- }
- if (node !== root) {
- sibling = node[siblingName];
- if (sibling) {
- return sibling;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var whiteSpaceRegExp$3 = /^[ \t\r\n]*$/;
+ var typeLookup = {
+ '#text': 3,
+ '#comment': 8,
+ '#cdata': 4,
+ '#pi': 7,
+ '#doctype': 10,
+ '#document-fragment': 11
+ };
+ var walk$2 = function (node, root, prev) {
+ var sibling;
+ var parent;
+ var startName = prev ? 'lastChild' : 'firstChild';
+ var siblingName = prev ? 'prev' : 'next';
+ if (node[startName]) {
+ return node[startName];
</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 (parent = node.parent; parent && parent !== root; parent = parent.parent) {
- sibling = parent[siblingName];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (node !== root) {
+ sibling = node[siblingName];
</ins><span class="cx" style="display: block; padding: 0 10px"> if (sibling) {
</span><span class="cx" style="display: block; padding: 0 10px"> return sibling;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- }
- };
- var Node$2 = function () {
- function Node(name, type) {
- this.name = name;
- this.type = type;
- if (type === 1) {
- this.attributes = [];
- this.attributes.map = {};
- }
- }
- Node.create = function (name, attrs) {
- var node, attrName;
- node = new Node(name, typeLookup[name] || 1);
- if (attrs) {
- for (attrName in attrs) {
- node.attr(attrName, attrs[attrName]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (parent = node.parent; parent && parent !== root; parent = parent.parent) {
+ sibling = parent[siblingName];
+ if (sibling) {
+ return sibling;
+ }
</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">- return node;
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- Node.prototype.replace = function (node) {
- var self = this;
- if (node.parent) {
- node.remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var Node$2 = function () {
+ function Node(name, type) {
+ this.name = name;
+ this.type = type;
+ if (type === 1) {
+ this.attributes = [];
+ this.attributes.map = {};
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.insert(node, self);
- self.remove();
- return self;
- };
- Node.prototype.attr = function (name, value) {
- var self = this;
- var attrs, i;
- if (typeof name !== 'string') {
- for (i in name) {
- self.attr(i, name[i]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Node.create = function (name, attrs) {
+ var node, attrName;
+ node = new Node(name, typeLookup[name] || 1);
+ if (attrs) {
+ for (attrName in attrs) {
+ node.attr(attrName, attrs[attrName]);
+ }
</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 node;
+ };
+ Node.prototype.replace = function (node) {
+ var self = this;
+ if (node.parent) {
+ node.remove();
+ }
+ self.insert(node, self);
+ self.remove();
</ins><span class="cx" style="display: block; padding: 0 10px"> return self;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (attrs = self.attributes) {
- if (value !== undefined) {
- if (value === null) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ Node.prototype.attr = function (name, value) {
+ var self = this;
+ var attrs, i;
+ if (typeof name !== 'string') {
+ for (i in name) {
+ self.attr(i, name[i]);
+ }
+ return self;
+ }
+ if (attrs = self.attributes) {
+ if (value !== undefined) {
+ if (value === null) {
+ if (name in attrs.map) {
+ delete attrs.map[name];
+ i = attrs.length;
+ while (i--) {
+ if (attrs[i].name === name) {
+ attrs = attrs.splice(i, 1);
+ return self;
+ }
+ }
+ }
+ return self;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> if (name in attrs.map) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- delete attrs.map[name];
</del><span class="cx" style="display: block; padding: 0 10px"> i = attrs.length;
</span><span class="cx" style="display: block; padding: 0 10px"> while (i--) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (attrs[i].name === name) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- attrs = attrs.splice(i, 1);
- return self;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ attrs[i].value = value;
+ break;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ attrs.push({
+ name: name,
+ value: value
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ attrs.map[name] = value;
</ins><span class="cx" style="display: block; padding: 0 10px"> return self;
</span><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 in attrs.map) {
- i = attrs.length;
- while (i--) {
- if (attrs[i].name === name) {
- attrs[i].value = value;
- break;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return attrs.map[name];
+ }
+ };
+ Node.prototype.clone = function () {
+ var self = this;
+ var clone = new Node(self.name, self.type);
+ var i, l, selfAttrs, selfAttr, cloneAttrs;
+ if (selfAttrs = self.attributes) {
+ cloneAttrs = [];
+ cloneAttrs.map = {};
+ for (i = 0, l = selfAttrs.length; i < l; i++) {
+ selfAttr = selfAttrs[i];
+ if (selfAttr.name !== 'id') {
+ cloneAttrs[cloneAttrs.length] = {
+ name: selfAttr.name,
+ value: selfAttr.value
+ };
+ cloneAttrs.map[selfAttr.name] = selfAttr.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">- } else {
- attrs.push({
- name: name,
- value: value
- });
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- attrs.map[name] = value;
- return self;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ clone.attributes = cloneAttrs;
</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 attrs.map[name];
- }
- };
- Node.prototype.clone = function () {
- var self = this;
- var clone = new Node(self.name, self.type);
- var i, l, selfAttrs, selfAttr, cloneAttrs;
- if (selfAttrs = self.attributes) {
- cloneAttrs = [];
- cloneAttrs.map = {};
- for (i = 0, l = selfAttrs.length; i < l; i++) {
- selfAttr = selfAttrs[i];
- if (selfAttr.name !== 'id') {
- cloneAttrs[cloneAttrs.length] = {
- name: selfAttr.name,
- value: selfAttr.value
- };
- cloneAttrs.map[selfAttr.name] = selfAttr.value;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ clone.value = self.value;
+ clone.shortEnded = self.shortEnded;
+ return clone;
+ };
+ Node.prototype.wrap = function (wrapper) {
+ var self = this;
+ self.parent.insert(wrapper, self);
+ wrapper.append(self);
+ return self;
+ };
+ Node.prototype.unwrap = function () {
+ var self = this;
+ var node, next;
+ for (node = self.firstChild; node;) {
+ next = node.next;
+ self.insert(node, self, true);
+ node = next;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- clone.attributes = cloneAttrs;
- }
- clone.value = self.value;
- clone.shortEnded = self.shortEnded;
- return clone;
- };
- Node.prototype.wrap = function (wrapper) {
- var self = this;
- self.parent.insert(wrapper, self);
- wrapper.append(self);
- return self;
- };
- Node.prototype.unwrap = function () {
- var self = this;
- var node, next;
- for (node = self.firstChild; node;) {
- next = node.next;
- self.insert(node, self, true);
- node = next;
- }
- self.remove();
- };
- Node.prototype.remove = function () {
- var self = this, parent = self.parent, next = self.next, prev = self.prev;
- if (parent) {
- if (parent.firstChild === self) {
- parent.firstChild = next;
- if (next) {
- next.prev = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.remove();
+ };
+ Node.prototype.remove = function () {
+ var self = this, parent = self.parent, next = self.next, prev = self.prev;
+ if (parent) {
+ if (parent.firstChild === self) {
+ parent.firstChild = next;
+ if (next) {
+ next.prev = null;
+ }
+ } else {
+ prev.next = next;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- prev.next = next;
- }
- if (parent.lastChild === self) {
- parent.lastChild = prev;
- if (prev) {
- prev.next = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (parent.lastChild === self) {
+ parent.lastChild = prev;
+ if (prev) {
+ prev.next = null;
+ }
+ } else {
+ next.prev = prev;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- next.prev = prev;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.parent = self.next = self.prev = 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">- self.parent = self.next = self.prev = null;
- }
- return self;
- };
- Node.prototype.append = function (node) {
- var self = this;
- var last;
- if (node.parent) {
- node.remove();
- }
- last = self.lastChild;
- if (last) {
- last.next = node;
- node.prev = last;
- self.lastChild = node;
- } else {
- self.lastChild = self.firstChild = node;
- }
- node.parent = self;
- return node;
- };
- Node.prototype.insert = function (node, refNode, before) {
- var parent;
- if (node.parent) {
- node.remove();
- }
- parent = refNode.parent || this;
- if (before) {
- if (refNode === parent.firstChild) {
- parent.firstChild = node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self;
+ };
+ Node.prototype.append = function (node) {
+ var self = this;
+ var last;
+ if (node.parent) {
+ node.remove();
+ }
+ last = self.lastChild;
+ if (last) {
+ last.next = node;
+ node.prev = last;
+ self.lastChild = node;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- refNode.prev.next = node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.lastChild = self.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">- node.prev = refNode.prev;
- node.next = refNode;
- refNode.prev = node;
- } else {
- if (refNode === parent.lastChild) {
- parent.lastChild = node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ node.parent = self;
+ return node;
+ };
+ Node.prototype.insert = function (node, refNode, before) {
+ var parent;
+ if (node.parent) {
+ node.remove();
+ }
+ parent = refNode.parent || this;
+ if (before) {
+ if (refNode === parent.firstChild) {
+ parent.firstChild = node;
+ } else {
+ refNode.prev.next = node;
+ }
+ node.prev = refNode.prev;
+ node.next = refNode;
+ refNode.prev = node;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- refNode.next.prev = node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (refNode === parent.lastChild) {
+ parent.lastChild = node;
+ } else {
+ refNode.next.prev = node;
+ }
+ node.next = refNode.next;
+ node.prev = refNode;
+ refNode.next = 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">- node.next = refNode.next;
- node.prev = refNode;
- refNode.next = node;
- }
- node.parent = parent;
- return node;
- };
- Node.prototype.getAll = function (name) {
- var self = this;
- var node;
- var collection = [];
- for (node = self.firstChild; node; node = walk$3(node, self)) {
- if (node.name === name) {
- collection.push(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ node.parent = parent;
+ return node;
+ };
+ Node.prototype.getAll = function (name) {
+ var self = this;
+ var node;
+ var collection = [];
+ for (node = self.firstChild; node; node = walk$2(node, self)) {
+ if (node.name === name) {
+ collection.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">- }
- return collection;
- };
- Node.prototype.empty = function () {
- var self = this;
- var nodes, i, node;
- if (self.firstChild) {
- nodes = [];
- for (node = self.firstChild; node; node = walk$3(node, self)) {
- nodes.push(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return collection;
+ };
+ Node.prototype.empty = function () {
+ var self = this;
+ var nodes, i, node;
+ if (self.firstChild) {
+ nodes = [];
+ for (node = self.firstChild; node; node = walk$2(node, self)) {
+ nodes.push(node);
+ }
+ i = nodes.length;
+ while (i--) {
+ node = nodes[i];
+ node.parent = node.firstChild = node.lastChild = node.next = node.prev = 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">- i = nodes.length;
- while (i--) {
- node = nodes[i];
- node.parent = node.firstChild = node.lastChild = node.next = node.prev = null;
- }
- }
- self.firstChild = self.lastChild = null;
- return self;
- };
- Node.prototype.isEmpty = function (elements, whitespace, predicate) {
- var self = this;
- var node = self.firstChild, i, name;
- whitespace = whitespace || {};
- if (node) {
- do {
- if (node.type === 1) {
- if (node.attributes.map['data-mce-bogus']) {
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.firstChild = self.lastChild = null;
+ return self;
+ };
+ Node.prototype.isEmpty = function (elements, whitespace, predicate) {
+ var self = this;
+ var node = self.firstChild, i, name;
+ whitespace = whitespace || {};
+ if (node) {
+ do {
+ if (node.type === 1) {
+ if (node.attributes.map['data-mce-bogus']) {
+ continue;
+ }
+ if (elements[node.name]) {
+ return false;
+ }
+ i = node.attributes.length;
+ while (i--) {
+ name = node.attributes[i].name;
+ if (name === 'name' || name.indexOf('data-mce-bookmark') === 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">- if (elements[node.name]) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (node.type === 8) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- i = node.attributes.length;
- while (i--) {
- name = node.attributes[i].name;
- if (name === 'name' || name.indexOf('data-mce-bookmark') === 0) {
- return false;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (node.type === 3 && !whiteSpaceRegExp$3.test(node.value)) {
+ 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 (node.type === 8) {
- return false;
- }
- if (node.type === 3 && !whiteSpaceRegExp$3.test(node.value)) {
- return false;
- }
- if (node.type === 3 && node.parent && whitespace[node.parent.name] && whiteSpaceRegExp$3.test(node.value)) {
- return false;
- }
- if (predicate && predicate(node)) {
- return false;
- }
- } while (node = walk$3(node, self));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (node.type === 3 && node.parent && whitespace[node.parent.name] && whiteSpaceRegExp$3.test(node.value)) {
+ return false;
+ }
+ if (predicate && predicate(node)) {
+ return false;
+ }
+ } while (node = walk$2(node, self));
+ }
+ return true;
+ };
+ Node.prototype.walk = function (prev) {
+ return walk$2(this, null, prev);
+ };
+ return Node;
+ }();
+
+ var paddEmptyNode = function (settings, args, blockElements, node) {
+ var brPreferred = settings.padd_empty_with_br || args.insert;
+ if (brPreferred && blockElements[node.name]) {
+ node.empty().append(new Node$2('br', 1)).shortEnded = true;
+ } else {
+ node.empty().append(new Node$2('#text', 3)).value = '\xA0';
</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><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- Node.prototype.walk = function (prev) {
- return walk$3(this, null, prev);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isPaddedWithNbsp = function (node) {
+ return hasOnlyChild(node, '#text') && node.firstChild.value === '\xA0';
</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 Node;
- }();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasOnlyChild = function (node, name) {
+ return node && node.firstChild && node.firstChild === node.lastChild && node.firstChild.name === name;
+ };
+ var isPadded = function (schema, node) {
+ var rule = schema.getElementRule(node.name);
+ return rule && rule.paddEmpty;
+ };
+ var isEmpty$2 = function (schema, nonEmptyElements, whitespaceElements, node) {
+ return node.isEmpty(nonEmptyElements, whitespaceElements, function (node) {
+ return isPadded(schema, node);
+ });
+ };
+ var isLineBreakNode = function (node, blockElements) {
+ return node && (blockElements[node.name] || node.name === '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 paddEmptyNode = function (settings, args, blockElements, node) {
- var brPreferred = settings.padd_empty_with_br || args.insert;
- if (brPreferred && blockElements[node.name]) {
- node.empty().append(new Node$2('br', 1)).shortEnded = true;
- } else {
- node.empty().append(new Node$2('#text', 3)).value = '\xA0';
- }
- };
- var isPaddedWithNbsp = function (node) {
- return hasOnlyChild(node, '#text') && node.firstChild.value === '\xA0';
- };
- var hasOnlyChild = function (node, name) {
- return node && node.firstChild && node.firstChild === node.lastChild && node.firstChild.name === name;
- };
- var isPadded = function (schema, node) {
- var rule = schema.getElementRule(node.name);
- return rule && rule.paddEmpty;
- };
- var isEmpty$2 = function (schema, nonEmptyElements, whitespaceElements, node) {
- return node.isEmpty(nonEmptyElements, whitespaceElements, function (node) {
- return isPadded(schema, node);
- });
- };
- var isLineBreakNode = function (node, blockElements) {
- return node && (blockElements[node.name] || node.name === 'br');
- };
-
- var register$2 = function (parser, settings) {
- var schema = parser.schema;
- if (settings.remove_trailing_brs) {
- parser.addNodeFilter('br', function (nodes, _, args) {
- var i;
- var l = nodes.length;
- var node;
- var blockElements = $_6cwiepljjgwe7j4.extend({}, schema.getBlockElements());
- var nonEmptyElements = schema.getNonEmptyElements();
- var parent, lastParent, prev, prevName;
- var whiteSpaceElements = schema.getNonEmptyElements();
- var elementRule, textNode;
- blockElements.body = 1;
- for (i = 0; i < l; i++) {
- node = nodes[i];
- parent = node.parent;
- if (blockElements[node.parent.name] && node === parent.lastChild) {
- prev = node.prev;
- while (prev) {
- prevName = prev.name;
- if (prevName !== 'span' || prev.attr('data-mce-type') !== 'bookmark') {
- if (prevName !== 'br') {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var register$2 = function (parser, settings) {
+ var schema = parser.schema;
+ if (settings.remove_trailing_brs) {
+ parser.addNodeFilter('br', function (nodes, _, args) {
+ var i;
+ var l = nodes.length;
+ var node;
+ var blockElements = Tools.extend({}, schema.getBlockElements());
+ var nonEmptyElements = schema.getNonEmptyElements();
+ var parent, lastParent, prev, prevName;
+ var whiteSpaceElements = schema.getNonEmptyElements();
+ var elementRule, textNode;
+ blockElements.body = 1;
+ for (i = 0; i < l; i++) {
+ node = nodes[i];
+ parent = node.parent;
+ if (blockElements[node.parent.name] && node === parent.lastChild) {
+ prev = node.prev;
+ while (prev) {
+ prevName = prev.name;
+ if (prevName !== 'span' || prev.attr('data-mce-type') !== 'bookmark') {
+ if (prevName !== 'br') {
+ break;
+ }
+ if (prevName === 'br') {
+ node = null;
+ 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">- if (prevName === 'br') {
- node = null;
- break;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ prev = prev.prev;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- prev = prev.prev;
- }
- if (node) {
- node.remove();
- if (isEmpty$2(schema, nonEmptyElements, whiteSpaceElements, parent)) {
- elementRule = schema.getElementRule(parent.name);
- if (elementRule) {
- if (elementRule.removeEmpty) {
- parent.remove();
- } else if (elementRule.paddEmpty) {
- paddEmptyNode(settings, args, blockElements, parent);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (node) {
+ node.remove();
+ if (isEmpty$2(schema, nonEmptyElements, whiteSpaceElements, parent)) {
+ elementRule = schema.getElementRule(parent.name);
+ if (elementRule) {
+ if (elementRule.removeEmpty) {
+ parent.remove();
+ } else if (elementRule.paddEmpty) {
+ paddEmptyNode(settings, args, blockElements, parent);
+ }
</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">- }
- } else {
- lastParent = node;
- while (parent && parent.firstChild === lastParent && parent.lastChild === lastParent) {
- lastParent = parent;
- if (blockElements[parent.name]) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ lastParent = node;
+ while (parent && parent.firstChild === lastParent && parent.lastChild === lastParent) {
+ lastParent = parent;
+ if (blockElements[parent.name]) {
+ break;
+ }
+ parent = parent.parent;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- parent = parent.parent;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (lastParent === parent && settings.padd_empty_with_br !== true) {
+ textNode = new Node$2('#text', 3);
+ textNode.value = '\xA0';
+ node.replace(textNode);
+ }
</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 (lastParent === parent && settings.padd_empty_with_br !== true) {
- textNode = new Node$2('#text', 3);
- textNode.value = '\xA0';
- node.replace(textNode);
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- });
- }
- parser.addAttributeFilter('href', function (nodes) {
- var i = nodes.length, node;
- var appendRel = function (rel) {
- var parts = rel.split(' ').filter(function (p) {
- return p.length > 0;
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return parts.concat(['noopener']).sort().join(' ');
- };
- var addNoOpener = function (rel) {
- var newRel = rel ? $_6cwiepljjgwe7j4.trim(rel) : '';
- if (!/\b(noopener)\b/g.test(newRel)) {
- return appendRel(newRel);
- } else {
- return newRel;
- }
- };
- if (!settings.allow_unsafe_link_target) {
- while (i--) {
- node = nodes[i];
- if (node.name === 'a' && node.attr('target') === '_blank') {
- node.attr('rel', addNoOpener(node.attr('rel')));
- }
- }
</del><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.allow_html_in_named_anchor) {
- parser.addAttributeFilter('id,name', function (nodes) {
- var i = nodes.length, sibling, prevSibling, parent, node;
- while (i--) {
- node = nodes[i];
- if (node.name === 'a' && node.firstChild && !node.attr('href')) {
- parent = node.parent;
- sibling = node.lastChild;
- do {
- prevSibling = sibling.prev;
- parent.insert(sibling, node);
- sibling = prevSibling;
- } while (sibling);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parser.addAttributeFilter('href', function (nodes) {
+ var i = nodes.length, node;
+ var appendRel = function (rel) {
+ var parts = rel.split(' ').filter(function (p) {
+ return p.length > 0;
+ });
+ return parts.concat(['noopener']).sort().join(' ');
+ };
+ var addNoOpener = function (rel) {
+ var newRel = rel ? Tools.trim(rel) : '';
+ if (!/\b(noopener)\b/g.test(newRel)) {
+ return appendRel(newRel);
+ } else {
+ return newRel;
</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.fix_list_elements) {
- parser.addNodeFilter('ul,ol', function (nodes) {
- var i = nodes.length, node, parentNode;
- while (i--) {
- node = nodes[i];
- parentNode = node.parent;
- if (parentNode.name === 'ul' || parentNode.name === 'ol') {
- if (node.prev && node.prev.name === 'li') {
- node.prev.append(node);
- } else {
- var li = new Node$2('li', 1);
- li.attr('style', 'list-style-type: none');
- node.wrap(li);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ if (!settings.allow_unsafe_link_target) {
+ while (i--) {
+ node = nodes[i];
+ if (node.name === 'a' && node.attr('target') === '_blank') {
+ node.attr('rel', addNoOpener(node.attr('rel')));
</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="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (settings.validate && schema.getValidClasses()) {
- parser.addAttributeFilter('class', function (nodes) {
- var i = nodes.length, node, classList, ci, className, classValue;
- var validClasses = schema.getValidClasses();
- var validClassesMap, valid;
- while (i--) {
- node = nodes[i];
- classList = node.attr('class').split(' ');
- classValue = '';
- for (ci = 0; ci < classList.length; ci++) {
- className = classList[ci];
- valid = false;
- validClassesMap = validClasses['*'];
- if (validClassesMap && validClassesMap[className]) {
- valid = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!settings.allow_html_in_named_anchor) {
+ parser.addAttributeFilter('id,name', function (nodes) {
+ var i = nodes.length, sibling, prevSibling, parent, node;
+ while (i--) {
+ node = nodes[i];
+ if (node.name === 'a' && node.firstChild && !node.attr('href')) {
+ parent = node.parent;
+ sibling = node.lastChild;
+ do {
+ prevSibling = sibling.prev;
+ parent.insert(sibling, node);
+ sibling = prevSibling;
+ } while (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">- validClassesMap = validClasses[node.name];
- if (!valid && validClassesMap && validClassesMap[className]) {
- valid = true;
- }
- if (valid) {
- if (classValue) {
- classValue += ' ';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ });
+ }
+ if (settings.fix_list_elements) {
+ parser.addNodeFilter('ul,ol', function (nodes) {
+ var i = nodes.length, node, parentNode;
+ while (i--) {
+ node = nodes[i];
+ parentNode = node.parent;
+ if (parentNode.name === 'ul' || parentNode.name === 'ol') {
+ if (node.prev && node.prev.name === 'li') {
+ node.prev.append(node);
+ } else {
+ var li = new Node$2('li', 1);
+ li.attr('style', 'list-style-type: none');
+ node.wrap(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">- classValue += className;
</del><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">- if (!classValue.length) {
- classValue = null;
- }
- node.attr('class', classValue);
- }
- });
- }
- };
-
- var makeMap$4 = $_6cwiepljjgwe7j4.makeMap;
- var each$18 = $_6cwiepljjgwe7j4.each;
- var explode$3 = $_6cwiepljjgwe7j4.explode;
- var extend$3 = $_6cwiepljjgwe7j4.extend;
- function DomParser (settings, schema) {
- if (schema === void 0) {
- schema = Schema();
- }
- var nodeFilters = {};
- var attributeFilters = [];
- var matchedNodes = {};
- var matchedAttributes = {};
- settings = settings || {};
- settings.validate = 'validate' in settings ? settings.validate : true;
- settings.root_name = settings.root_name || 'body';
- var fixInvalidChildren = function (nodes) {
- var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i;
- var nonEmptyElements, whitespaceElements, nonSplitableElements, textBlockElements, specialElements, sibling, nextNode;
- nonSplitableElements = makeMap$4('tr,td,th,tbody,thead,tfoot,table');
- nonEmptyElements = schema.getNonEmptyElements();
- whitespaceElements = schema.getWhiteSpaceElements();
- textBlockElements = schema.getTextBlockElements();
- specialElements = schema.getSpecialElements();
- for (ni = 0; ni < nodes.length; ni++) {
- node = nodes[ni];
- if (!node.parent || node.fixed) {
- continue;
- }
- if (textBlockElements[node.name] && node.parent.name === 'li') {
- sibling = node.next;
- while (sibling) {
- if (textBlockElements[sibling.name]) {
- sibling.name = 'li';
- sibling.fixed = true;
- node.parent.insert(sibling, node.parent);
- } else {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ }
+ if (settings.validate && schema.getValidClasses()) {
+ parser.addAttributeFilter('class', function (nodes) {
+ var i = nodes.length, node, classList, ci, className, classValue;
+ var validClasses = schema.getValidClasses();
+ var validClassesMap, valid;
+ while (i--) {
+ node = nodes[i];
+ classList = node.attr('class').split(' ');
+ classValue = '';
+ for (ci = 0; ci < classList.length; ci++) {
+ className = classList[ci];
+ valid = false;
+ validClassesMap = validClasses['*'];
+ if (validClassesMap && validClassesMap[className]) {
+ valid = true;
+ }
+ validClassesMap = validClasses[node.name];
+ if (!valid && validClassesMap && validClassesMap[className]) {
+ valid = true;
+ }
+ if (valid) {
+ if (classValue) {
+ classValue += ' ';
+ }
+ classValue += 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">- sibling = sibling.next;
- }
- node.unwrap(node);
- continue;
- }
- parents = [node];
- for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) && !nonSplitableElements[parent.name]; parent = parent.parent) {
- parents.push(parent);
- }
- if (parent && parents.length > 1) {
- parents.reverse();
- newParent = currentNode = filterNode(parents[0].clone());
- for (i = 0; i < parents.length - 1; i++) {
- if (schema.isValidChild(currentNode.name, parents[i].name)) {
- tempNode = filterNode(parents[i].clone());
- currentNode.append(tempNode);
- } else {
- tempNode = currentNode;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!classValue.length) {
+ classValue = 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">- for (childNode = parents[i].firstChild; childNode && childNode !== parents[i + 1];) {
- nextNode = childNode.next;
- tempNode.append(childNode);
- childNode = nextNode;
- }
- currentNode = tempNode;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ node.attr('class', classValue);
</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 (!isEmpty$2(schema, nonEmptyElements, whitespaceElements, newParent)) {
- parent.insert(newParent, parents[0], true);
- parent.insert(node, newParent);
- } else {
- parent.insert(node, parents[0], true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ }
+ };
+
+ var makeMap$4 = Tools.makeMap, each$i = Tools.each, explode$3 = Tools.explode, extend$3 = Tools.extend;
+ function DomParser (settings, schema) {
+ if (schema === void 0) {
+ schema = Schema();
+ }
+ var nodeFilters = {};
+ var attributeFilters = [];
+ var matchedNodes = {};
+ var matchedAttributes = {};
+ settings = settings || {};
+ settings.validate = 'validate' in settings ? settings.validate : true;
+ settings.root_name = settings.root_name || 'body';
+ var fixInvalidChildren = function (nodes) {
+ var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i;
+ var nonEmptyElements, whitespaceElements, nonSplitableElements, textBlockElements, specialElements, sibling, nextNode;
+ nonSplitableElements = makeMap$4('tr,td,th,tbody,thead,tfoot,table');
+ nonEmptyElements = schema.getNonEmptyElements();
+ whitespaceElements = schema.getWhiteSpaceElements();
+ textBlockElements = schema.getTextBlockElements();
+ specialElements = schema.getSpecialElements();
+ for (ni = 0; ni < nodes.length; ni++) {
+ node = nodes[ni];
+ if (!node.parent || node.fixed) {
+ continue;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- parent = parents[0];
- if (isEmpty$2(schema, nonEmptyElements, whitespaceElements, parent) || hasOnlyChild(parent, 'br')) {
- parent.empty().remove();
- }
- } else if (node.parent) {
- if (node.name === 'li') {
- sibling = node.prev;
- if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) {
- sibling.append(node);
- continue;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (textBlockElements[node.name] && node.parent.name === 'li') {
</ins><span class="cx" style="display: block; padding: 0 10px"> sibling = node.next;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) {
- sibling.insert(node, sibling.firstChild, true);
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ while (sibling) {
+ if (textBlockElements[sibling.name]) {
+ sibling.name = 'li';
+ sibling.fixed = true;
+ node.parent.insert(sibling, node.parent);
+ } else {
+ break;
+ }
+ sibling = sibling.next;
</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.wrap(filterNode(new Node$2('ul', 1)));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ node.unwrap(node);
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) {
- node.wrap(filterNode(new Node$2('div', 1)));
- } else {
- if (specialElements[node.name]) {
- node.empty().remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parents = [node];
+ for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) && !nonSplitableElements[parent.name]; parent = parent.parent) {
+ parents.push(parent);
+ }
+ if (parent && parents.length > 1) {
+ parents.reverse();
+ newParent = currentNode = filterNode(parents[0].clone());
+ for (i = 0; i < parents.length - 1; i++) {
+ if (schema.isValidChild(currentNode.name, parents[i].name)) {
+ tempNode = filterNode(parents[i].clone());
+ currentNode.append(tempNode);
+ } else {
+ tempNode = currentNode;
+ }
+ for (childNode = parents[i].firstChild; childNode && childNode !== parents[i + 1];) {
+ nextNode = childNode.next;
+ tempNode.append(childNode);
+ childNode = nextNode;
+ }
+ currentNode = tempNode;
+ }
+ if (!isEmpty$2(schema, nonEmptyElements, whitespaceElements, newParent)) {
+ parent.insert(newParent, parents[0], true);
+ parent.insert(node, newParent);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- node.unwrap();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parent.insert(node, parents[0], 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">- }
- }
- }
- };
- var filterNode = function (node) {
- var i, name, list;
- if (name in nodeFilters) {
- list = matchedNodes[name];
- if (list) {
- list.push(node);
- } else {
- matchedNodes[name] = [node];
- }
- }
- i = attributeFilters.length;
- while (i--) {
- name = attributeFilters[i].name;
- if (name in node.attributes.map) {
- list = matchedAttributes[name];
- if (list) {
- list.push(node);
- } else {
- matchedAttributes[name] = [node];
- }
- }
- }
- return node;
- };
- var addNodeFilter = function (name, callback) {
- each$18(explode$3(name), function (name) {
- var list = nodeFilters[name];
- if (!list) {
- nodeFilters[name] = list = [];
- }
- list.push(callback);
- });
- };
- var getNodeFilters = function () {
- var out = [];
- for (var name in nodeFilters) {
- if (nodeFilters.hasOwnProperty(name)) {
- out.push({
- name: name,
- callbacks: nodeFilters[name]
- });
- }
- }
- return out;
- };
- var addAttributeFilter = function (name, callback) {
- each$18(explode$3(name), function (name) {
- var i;
- for (i = 0; i < attributeFilters.length; i++) {
- if (attributeFilters[i].name === name) {
- attributeFilters[i].callbacks.push(callback);
- return;
- }
- }
- attributeFilters.push({
- name: name,
- callbacks: [callback]
- });
- });
- };
- var getAttributeFilters = function () {
- return [].concat(attributeFilters);
- };
- var parse = function (html, args) {
- var parser, nodes, i, l, fi, fl, list, name;
- var blockElements;
- var invalidChildren = [];
- var isInWhiteSpacePreservedElement;
- var node;
- args = args || {};
- matchedNodes = {};
- matchedAttributes = {};
- blockElements = extend$3(makeMap$4('script,style,head,html,body,title,meta,param'), schema.getBlockElements());
- var nonEmptyElements = schema.getNonEmptyElements();
- var children = schema.children;
- var validate = settings.validate;
- var rootBlockName = 'forced_root_block' in args ? args.forced_root_block : settings.forced_root_block;
- var whiteSpaceElements = schema.getWhiteSpaceElements();
- var startWhiteSpaceRegExp = /^[ \t\r\n]+/;
- var endWhiteSpaceRegExp = /[ \t\r\n]+$/;
- var allWhiteSpaceRegExp = /[ \t\r\n]+/g;
- var isAllWhiteSpaceRegExp = /^[ \t\r\n]+$/;
- isInWhiteSpacePreservedElement = whiteSpaceElements.hasOwnProperty(args.context) || whiteSpaceElements.hasOwnProperty(settings.root_name);
- var addRootBlocks = function () {
- var node = rootNode.firstChild, next, rootBlockNode;
- var trim = function (rootBlockNode) {
- if (rootBlockNode) {
- node = rootBlockNode.firstChild;
- if (node && node.type === 3) {
- node.value = node.value.replace(startWhiteSpaceRegExp, '');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parent = parents[0];
+ if (isEmpty$2(schema, nonEmptyElements, whitespaceElements, parent) || hasOnlyChild(parent, 'br')) {
+ parent.empty().remove();
</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 = rootBlockNode.lastChild;
- if (node && node.type === 3) {
- node.value = node.value.replace(endWhiteSpaceRegExp, '');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if (node.parent) {
+ if (node.name === 'li') {
+ sibling = node.prev;
+ if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) {
+ sibling.append(node);
+ continue;
+ }
+ sibling = node.next;
+ if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) {
+ sibling.insert(node, sibling.firstChild, true);
+ continue;
+ }
+ node.wrap(filterNode(new Node$2('ul', 1)));
+ continue;
</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 (!schema.isValidChild(rootNode.name, rootBlockName.toLowerCase())) {
- return;
- }
- while (node) {
- next = node.next;
- if (node.type === 3 || node.type === 1 && node.name !== 'p' && !blockElements[node.name] && !node.attr('data-mce-type')) {
- if (!rootBlockNode) {
- rootBlockNode = createNode(rootBlockName, 1);
- rootBlockNode.attr(settings.forced_root_block_attrs);
- rootNode.insert(rootBlockNode, node);
- rootBlockNode.append(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) {
+ node.wrap(filterNode(new Node$2('div', 1)));
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- rootBlockNode.append(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (specialElements[node.name]) {
+ node.empty().remove();
+ } else {
+ node.unwrap();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- trim(rootBlockNode);
- rootBlockNode = null;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- node = next;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- trim(rootBlockNode);
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var createNode = function (name, type) {
- var node = new Node$2(name, type);
- var list;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var filterNode = function (node) {
+ var i, name, list;
+ name = node.name;
</ins><span class="cx" style="display: block; padding: 0 10px"> if (name in nodeFilters) {
</span><span class="cx" style="display: block; padding: 0 10px"> list = matchedNodes[name];
</span><span class="cx" style="display: block; padding: 0 10px"> if (list) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20875,215 +19839,321 @@
</span><span class="cx" style="display: block; padding: 0 10px"> matchedNodes[name] = [node];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ i = attributeFilters.length;
+ while (i--) {
+ name = attributeFilters[i].name;
+ if (name in node.attributes.map) {
+ list = matchedAttributes[name];
+ if (list) {
+ list.push(node);
+ } else {
+ matchedAttributes[name] = [node];
+ }
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return node;
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var removeWhitespaceBefore = function (node) {
- var textNode, textNodeNext, textVal, sibling;
- var blockElements = schema.getBlockElements();
- for (textNode = node.prev; textNode && textNode.type === 3;) {
- textVal = textNode.value.replace(endWhiteSpaceRegExp, '');
- if (textVal.length > 0) {
- textNode.value = textVal;
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var addNodeFilter = function (name, callback) {
+ each$i(explode$3(name), function (name) {
+ var list = nodeFilters[name];
+ if (!list) {
+ nodeFilters[name] = 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">- textNodeNext = textNode.next;
- if (textNodeNext) {
- if (textNodeNext.type === 3 && textNodeNext.value.length) {
- textNode = textNode.prev;
- continue;
- }
- if (!blockElements[textNodeNext.name] && textNodeNext.name !== 'script' && textNodeNext.name !== 'style') {
- textNode = textNode.prev;
- continue;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ list.push(callback);
+ });
+ };
+ var getNodeFilters = function () {
+ var out = [];
+ for (var name in nodeFilters) {
+ if (nodeFilters.hasOwnProperty(name)) {
+ out.push({
+ name: name,
+ callbacks: nodeFilters[name]
+ });
</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 = textNode.prev;
- textNode.remove();
- textNode = sibling;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return out;
</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 cloneAndExcludeBlocks = function (input) {
- var name;
- var output = {};
- for (name in input) {
- if (name !== 'li' && name !== 'p') {
- output[name] = input[name];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var addAttributeFilter = function (name, callback) {
+ each$i(explode$3(name), function (name) {
+ var i;
+ for (i = 0; i < attributeFilters.length; i++) {
+ if (attributeFilters[i].name === name) {
+ attributeFilters[i].callbacks.push(callback);
+ 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 output;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ attributeFilters.push({
+ name: name,
+ callbacks: [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">- parser = SaxParser$1({
- validate: validate,
- allow_script_urls: settings.allow_script_urls,
- allow_conditional_comments: settings.allow_conditional_comments,
- self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()),
- cdata: function (text) {
- node.append(createNode('#cdata', 4)).value = text;
- },
- text: function (text, raw) {
- var textNode;
- if (!isInWhiteSpacePreservedElement) {
- text = text.replace(allWhiteSpaceRegExp, ' ');
- if (isLineBreakNode(node.lastChild, blockElements)) {
- text = text.replace(startWhiteSpaceRegExp, '');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getAttributeFilters = function () {
+ return [].concat(attributeFilters);
+ };
+ var parse = function (html, args) {
+ var parser, nodes, i, l, fi, fl, list, name;
+ var blockElements;
+ var invalidChildren = [];
+ var isInWhiteSpacePreservedElement;
+ var node;
+ args = args || {};
+ matchedNodes = {};
+ matchedAttributes = {};
+ blockElements = extend$3(makeMap$4('script,style,head,html,body,title,meta,param'), schema.getBlockElements());
+ var nonEmptyElements = schema.getNonEmptyElements();
+ var children = schema.children;
+ var validate = settings.validate;
+ var rootBlockName = 'forced_root_block' in args ? args.forced_root_block : settings.forced_root_block;
+ var whiteSpaceElements = schema.getWhiteSpaceElements();
+ var startWhiteSpaceRegExp = /^[ \t\r\n]+/;
+ var endWhiteSpaceRegExp = /[ \t\r\n]+$/;
+ var allWhiteSpaceRegExp = /[ \t\r\n]+/g;
+ var isAllWhiteSpaceRegExp = /^[ \t\r\n]+$/;
+ isInWhiteSpacePreservedElement = whiteSpaceElements.hasOwnProperty(args.context) || whiteSpaceElements.hasOwnProperty(settings.root_name);
+ var addRootBlocks = function () {
+ var node = rootNode.firstChild, next, rootBlockNode;
+ var trim = function (rootBlockNode) {
+ if (rootBlockNode) {
+ node = rootBlockNode.firstChild;
+ if (node && node.type === 3) {
+ node.value = node.value.replace(startWhiteSpaceRegExp, '');
+ }
+ node = rootBlockNode.lastChild;
+ if (node && node.type === 3) {
+ node.value = node.value.replace(endWhiteSpaceRegExp, '');
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ if (!schema.isValidChild(rootNode.name, rootBlockName.toLowerCase())) {
+ 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 (text.length !== 0) {
- textNode = createNode('#text', 3);
- textNode.raw = !!raw;
- node.append(textNode).value = text;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ while (node) {
+ next = node.next;
+ if (node.type === 3 || node.type === 1 && node.name !== 'p' && !blockElements[node.name] && !node.attr('data-mce-type')) {
+ if (!rootBlockNode) {
+ rootBlockNode = createNode(rootBlockName, 1);
+ rootBlockNode.attr(settings.forced_root_block_attrs);
+ rootNode.insert(rootBlockNode, node);
+ rootBlockNode.append(node);
+ } else {
+ rootBlockNode.append(node);
+ }
+ } else {
+ trim(rootBlockNode);
+ rootBlockNode = null;
+ }
+ node = next;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- },
- comment: function (text) {
- node.append(createNode('#comment', 8)).value = text;
- },
- pi: function (name, text) {
- node.append(createNode(name, 7)).value = text;
- removeWhitespaceBefore(node);
- },
- doctype: function (text) {
- var newNode;
- newNode = node.append(createNode('#doctype', 10));
- newNode.value = text;
- removeWhitespaceBefore(node);
- },
- start: function (name, attrs, empty) {
- var newNode, attrFiltersLen, elementRule, attrName, parent;
- elementRule = validate ? schema.getElementRule(name) : {};
- if (elementRule) {
- newNode = createNode(elementRule.outputName || name, 1);
- newNode.attributes = attrs;
- newNode.shortEnded = empty;
- node.append(newNode);
- parent = children[node.name];
- if (parent && children[newNode.name] && !parent[newNode.name]) {
- invalidChildren.push(newNode);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ trim(rootBlockNode);
+ };
+ var createNode = function (name, type) {
+ var node = new Node$2(name, type);
+ var list;
+ if (name in nodeFilters) {
+ list = matchedNodes[name];
+ if (list) {
+ list.push(node);
+ } else {
+ matchedNodes[name] = [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">- attrFiltersLen = attributeFilters.length;
- while (attrFiltersLen--) {
- attrName = attributeFilters[attrFiltersLen].name;
- if (attrName in attrs.map) {
- list = matchedAttributes[attrName];
- if (list) {
- list.push(newNode);
- } else {
- matchedAttributes[attrName] = [newNode];
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ return node;
+ };
+ var removeWhitespaceBefore = function (node) {
+ var textNode, textNodeNext, textVal, sibling;
+ var blockElements = schema.getBlockElements();
+ for (textNode = node.prev; textNode && textNode.type === 3;) {
+ textVal = textNode.value.replace(endWhiteSpaceRegExp, '');
+ if (textVal.length > 0) {
+ textNode.value = textVal;
+ return;
+ }
+ textNodeNext = textNode.next;
+ if (textNodeNext) {
+ if (textNodeNext.type === 3 && textNodeNext.value.length) {
+ textNode = textNode.prev;
+ continue;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!blockElements[textNodeNext.name] && textNodeNext.name !== 'script' && textNodeNext.name !== 'style') {
+ textNode = textNode.prev;
+ continue;
+ }
</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[name]) {
- removeWhitespaceBefore(newNode);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ sibling = textNode.prev;
+ textNode.remove();
+ textNode = sibling;
+ }
+ };
+ var cloneAndExcludeBlocks = function (input) {
+ var name;
+ var output = {};
+ for (name in input) {
+ if (name !== 'li' && name !== 'p') {
+ output[name] = input[name];
</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 (!empty) {
- node = newNode;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ return output;
+ };
+ parser = SaxParser$1({
+ validate: validate,
+ allow_script_urls: settings.allow_script_urls,
+ allow_conditional_comments: settings.allow_conditional_comments,
+ self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()),
+ cdata: function (text) {
+ node.append(createNode('#cdata', 4)).value = text;
+ },
+ text: function (text, raw) {
+ var textNode;
+ if (!isInWhiteSpacePreservedElement) {
+ text = text.replace(allWhiteSpaceRegExp, ' ');
+ if (isLineBreakNode(node.lastChild, blockElements)) {
+ text = text.replace(startWhiteSpaceRegExp, '');
+ }
</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 (!isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
- isInWhiteSpacePreservedElement = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (text.length !== 0) {
+ textNode = createNode('#text', 3);
+ textNode.raw = !!raw;
+ node.append(textNode).value = 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">- }
- },
- end: function (name) {
- var textNode, elementRule, text, sibling, tempNode;
- elementRule = validate ? schema.getElementRule(name) : {};
- if (elementRule) {
- if (blockElements[name]) {
- if (!isInWhiteSpacePreservedElement) {
- textNode = node.firstChild;
- if (textNode && textNode.type === 3) {
- text = textNode.value.replace(startWhiteSpaceRegExp, '');
- if (text.length > 0) {
- textNode.value = text;
- textNode = textNode.next;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ comment: function (text) {
+ node.append(createNode('#comment', 8)).value = text;
+ },
+ pi: function (name, text) {
+ node.append(createNode(name, 7)).value = text;
+ removeWhitespaceBefore(node);
+ },
+ doctype: function (text) {
+ var newNode;
+ newNode = node.append(createNode('#doctype', 10));
+ newNode.value = text;
+ removeWhitespaceBefore(node);
+ },
+ start: function (name, attrs, empty) {
+ var newNode, attrFiltersLen, elementRule, attrName, parent;
+ elementRule = validate ? schema.getElementRule(name) : {};
+ if (elementRule) {
+ newNode = createNode(elementRule.outputName || name, 1);
+ newNode.attributes = attrs;
+ newNode.shortEnded = empty;
+ node.append(newNode);
+ parent = children[node.name];
+ if (parent && children[newNode.name] && !parent[newNode.name]) {
+ invalidChildren.push(newNode);
+ }
+ attrFiltersLen = attributeFilters.length;
+ while (attrFiltersLen--) {
+ attrName = attributeFilters[attrFiltersLen].name;
+ if (attrName in attrs.map) {
+ list = matchedAttributes[attrName];
+ if (list) {
+ list.push(newNode);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- sibling = textNode.next;
- textNode.remove();
- textNode = sibling;
- while (textNode && textNode.type === 3) {
- text = textNode.value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ matchedAttributes[attrName] = [newNode];
+ }
+ }
+ }
+ if (blockElements[name]) {
+ removeWhitespaceBefore(newNode);
+ }
+ if (!empty) {
+ node = newNode;
+ }
+ if (!isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
+ isInWhiteSpacePreservedElement = true;
+ }
+ }
+ },
+ end: function (name) {
+ var textNode, elementRule, text, sibling, tempNode;
+ elementRule = validate ? schema.getElementRule(name) : {};
+ if (elementRule) {
+ if (blockElements[name]) {
+ if (!isInWhiteSpacePreservedElement) {
+ textNode = node.firstChild;
+ if (textNode && textNode.type === 3) {
+ text = textNode.value.replace(startWhiteSpaceRegExp, '');
+ if (text.length > 0) {
+ textNode.value = text;
+ textNode = textNode.next;
+ } else {
</ins><span class="cx" style="display: block; padding: 0 10px"> sibling = textNode.next;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {
- textNode.remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ textNode.remove();
+ textNode = sibling;
+ while (textNode && textNode.type === 3) {
+ text = textNode.value;
+ sibling = textNode.next;
+ if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {
+ textNode.remove();
+ textNode = sibling;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> textNode = sibling;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- textNode = sibling;
</del><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">- }
- textNode = node.lastChild;
- if (textNode && textNode.type === 3) {
- text = textNode.value.replace(endWhiteSpaceRegExp, '');
- if (text.length > 0) {
- textNode.value = text;
- textNode = textNode.prev;
- } else {
- sibling = textNode.prev;
- textNode.remove();
- textNode = sibling;
- while (textNode && textNode.type === 3) {
- text = textNode.value;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ textNode = node.lastChild;
+ if (textNode && textNode.type === 3) {
+ text = textNode.value.replace(endWhiteSpaceRegExp, '');
+ if (text.length > 0) {
+ textNode.value = text;
+ textNode = textNode.prev;
+ } else {
</ins><span class="cx" style="display: block; padding: 0 10px"> sibling = textNode.prev;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {
- textNode.remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ textNode.remove();
+ textNode = sibling;
+ while (textNode && textNode.type === 3) {
+ text = textNode.value;
+ sibling = textNode.prev;
+ if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {
+ textNode.remove();
+ textNode = sibling;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> textNode = sibling;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- textNode = sibling;
</del><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="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
- isInWhiteSpacePreservedElement = false;
- }
- if (elementRule.removeEmpty && isEmpty$2(schema, nonEmptyElements, whiteSpaceElements, node)) {
- if (!node.attributes.map.name && !node.attr('id')) {
- tempNode = node.parent;
- if (blockElements[node.name]) {
- node.empty().remove();
- } else {
- node.unwrap();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
+ isInWhiteSpacePreservedElement = false;
+ }
+ if (elementRule.removeEmpty && isEmpty$2(schema, nonEmptyElements, whiteSpaceElements, node)) {
+ if (!node.attributes.map.name && !node.attr('id')) {
+ tempNode = node.parent;
+ if (blockElements[node.name]) {
+ node.empty().remove();
+ } else {
+ node.unwrap();
+ }
+ node = tempNode;
+ 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">- node = tempNode;
- return;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (elementRule.paddEmpty && (isPaddedWithNbsp(node) || isEmpty$2(schema, nonEmptyElements, whiteSpaceElements, node))) {
+ paddEmptyNode(settings, args, blockElements, node);
+ }
+ node = node.parent;
</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 (elementRule.paddEmpty && (isPaddedWithNbsp(node) || isEmpty$2(schema, nonEmptyElements, whiteSpaceElements, node))) {
- paddEmptyNode(settings, args, blockElements, node);
- }
- node = node.parent;
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }, schema);
+ var rootNode = node = new Node$2(args.context || settings.root_name, 11);
+ parser.parse(html);
+ if (validate && invalidChildren.length) {
+ if (!args.context) {
+ fixInvalidChildren(invalidChildren);
+ } else {
+ args.invalid = 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">- }, schema);
- var rootNode = node = new Node$2(args.context || settings.root_name, 11);
- parser.parse(html);
- if (validate && invalidChildren.length) {
- if (!args.context) {
- fixInvalidChildren(invalidChildren);
- } else {
- args.invalid = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rootBlockName && (rootNode.name === 'body' || args.isRootContent)) {
+ addRootBlocks();
</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 (rootBlockName && (rootNode.name === 'body' || args.isRootContent)) {
- addRootBlocks();
- }
- if (!args.invalid) {
- for (name in matchedNodes) {
- list = nodeFilters[name];
- nodes = matchedNodes[name];
- fi = nodes.length;
- while (fi--) {
- if (!nodes[fi].parent) {
- nodes.splice(fi, 1);
- }
- }
- for (i = 0, l = list.length; i < l; i++) {
- list[i](nodes, name, args);
- }
- }
- for (i = 0, l = attributeFilters.length; i < l; i++) {
- list = attributeFilters[i];
- if (list.name in matchedAttributes) {
- nodes = matchedAttributes[list.name];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!args.invalid) {
+ for (name in matchedNodes) {
+ list = nodeFilters[name];
+ nodes = matchedNodes[name];
</ins><span class="cx" style="display: block; padding: 0 10px"> fi = nodes.length;
</span><span class="cx" style="display: block; padding: 0 10px"> while (fi--) {
</span><span class="cx" style="display: block; padding: 0 10px"> if (!nodes[fi].parent) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21090,5678 +20160,6417 @@
</span><span class="cx" style="display: block; padding: 0 10px"> nodes.splice(fi, 1);
</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">- for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) {
- list.callbacks[fi](nodes, list.name, args);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (i = 0, l = list.length; i < l; i++) {
+ list[i](nodes, name, args);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (i = 0, l = attributeFilters.length; i < l; i++) {
+ list = attributeFilters[i];
+ if (list.name in matchedAttributes) {
+ nodes = matchedAttributes[list.name];
+ fi = nodes.length;
+ while (fi--) {
+ if (!nodes[fi].parent) {
+ nodes.splice(fi, 1);
+ }
+ }
+ for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) {
+ list.callbacks[fi](nodes, list.name, args);
+ }
+ }
+ }
</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 rootNode;
+ };
+ var exports = {
+ schema: schema,
+ addAttributeFilter: addAttributeFilter,
+ getAttributeFilters: getAttributeFilters,
+ addNodeFilter: addNodeFilter,
+ getNodeFilters: getNodeFilters,
+ filterNode: filterNode,
+ parse: parse
+ };
+ register$2(exports, settings);
+ LegacyFilter.register(exports, settings);
+ return exports;
+ }
+
+ var addTempAttr = function (htmlParser, tempAttrs, name) {
+ if (Tools.inArray(tempAttrs, name) === -1) {
+ htmlParser.addAttributeFilter(name, function (nodes, name) {
+ var i = nodes.length;
+ while (i--) {
+ nodes[i].attr(name, null);
+ }
+ });
+ tempAttrs.push(name);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var postProcess$1 = function (editor, args, content) {
+ if (!args.no_events && editor) {
+ var outArgs = Events.firePostProcess(editor, merge(args, { content: content }));
+ return outArgs.content;
+ } else {
+ return content;
+ }
+ };
+ var getHtmlFromNode = function (dom, node, args) {
+ var html = Zwsp.trim(args.getInner ? node.innerHTML : dom.getOuterHTML(node));
+ return args.selection || isWsPreserveElement(Element$$1.fromDom(node)) ? html : Tools.trim(html);
+ };
+ var parseHtml = function (htmlParser, html, args) {
+ var parserArgs = args.selection ? merge({ forced_root_block: false }, args) : args;
+ var rootNode = htmlParser.parse(html, parserArgs);
+ DomSerializerFilters.trimTrailingBr(rootNode);
</ins><span class="cx" style="display: block; padding: 0 10px"> return rootNode;
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var exports = {
- schema: schema,
- addAttributeFilter: addAttributeFilter,
- getAttributeFilters: getAttributeFilters,
- addNodeFilter: addNodeFilter,
- getNodeFilters: getNodeFilters,
- filterNode: filterNode,
- parse: parse
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var serializeNode = function (settings, schema, node) {
+ var htmlSerializer = Serializer(settings, schema);
+ return htmlSerializer.serialize(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">- register$2(exports, settings);
- $_ee8az66qjjgwe8up.register(exports, settings);
- return exports;
- }
-
- var addTempAttr = function (htmlParser, tempAttrs, name) {
- if ($_6cwiepljjgwe7j4.inArray(tempAttrs, name) === -1) {
- htmlParser.addAttributeFilter(name, function (nodes, name) {
- var i = nodes.length;
- while (i--) {
- nodes[i].attr(name, null);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var toHtml = function (editor, settings, schema, rootNode, args) {
+ var content = serializeNode(settings, schema, rootNode);
+ return postProcess$1(editor, args, content);
+ };
+ function DomSerializer (settings, editor) {
+ var dom, schema, htmlParser;
+ var tempAttrs = ['data-mce-selected'];
+ dom = editor && editor.dom ? editor.dom : DOMUtils$1.DOM;
+ schema = editor && editor.schema ? editor.schema : Schema(settings);
+ settings.entity_encoding = settings.entity_encoding || 'named';
+ settings.remove_trailing_brs = 'remove_trailing_brs' in settings ? settings.remove_trailing_brs : true;
+ htmlParser = DomParser(settings, schema);
+ DomSerializerFilters.register(htmlParser, settings, dom);
+ var serialize = function (node, parserArgs) {
+ var args = merge({ format: 'html' }, parserArgs ? parserArgs : {});
+ var targetNode = DomSerializerPreProcess.process(editor, node, args);
+ var html = getHtmlFromNode(dom, targetNode, args);
+ var rootNode = parseHtml(htmlParser, html, args);
+ return args.format === 'tree' ? rootNode : toHtml(editor, settings, schema, rootNode, args);
+ };
+ return {
+ schema: schema,
+ addNodeFilter: htmlParser.addNodeFilter,
+ addAttributeFilter: htmlParser.addAttributeFilter,
+ serialize: serialize,
+ addRules: function (rules) {
+ schema.addValidElements(rules);
+ },
+ setRules: function (rules) {
+ schema.setValidElements(rules);
+ },
+ addTempAttr: curry(addTempAttr, htmlParser, tempAttrs),
+ getTempAttrs: function () {
+ return tempAttrs;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- tempAttrs.push(name);
</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">- };
- var postProcess$1 = function (editor, args, content) {
- if (!args.no_events && editor) {
- var outArgs = $_b2ca654tjjgwe8ic.firePostProcess(editor, merge(args, { content: content }));
- return outArgs.content;
- } else {
- return content;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ function Serializer$1 (settings, editor) {
+ var domSerializer = DomSerializer(settings, editor);
+ return {
+ schema: domSerializer.schema,
+ addNodeFilter: domSerializer.addNodeFilter,
+ addAttributeFilter: domSerializer.addAttributeFilter,
+ serialize: domSerializer.serialize,
+ addRules: domSerializer.addRules,
+ setRules: domSerializer.setRules,
+ addTempAttr: domSerializer.addTempAttr,
+ getTempAttrs: domSerializer.getTempAttrs
+ };
</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 getHtmlFromNode = function (dom, node, args) {
- var html = $_2xw7ul2pjjgwe7xs.trim(args.getInner ? node.innerHTML : dom.getOuterHTML(node));
- return args.selection || isWsPreserveElement(Element$$1.fromDom(node)) ? html : $_6cwiepljjgwe7j4.trim(html);
- };
- var parseHtml = function (htmlParser, html, args) {
- var parserArgs = args.selection ? merge({ forced_root_block: false }, args) : args;
- var rootNode = htmlParser.parse(html, parserArgs);
- $_51rhs16njjgwe8ts.trimTrailingBr(rootNode);
- return rootNode;
- };
- var serializeNode = function (settings, schema, node) {
- var htmlSerializer = HtmlSerializer(settings, schema);
- return htmlSerializer.serialize(node);
- };
- var toHtml = function (editor, settings, schema, rootNode, args) {
- var content = serializeNode(settings, schema, rootNode);
- return postProcess$1(editor, args, content);
- };
- function DomSerializer (settings, editor) {
- var dom, schema, htmlParser;
- var tempAttrs = ['data-mce-selected'];
- dom = editor && editor.dom ? editor.dom : DOMUtils$1.DOM;
- schema = editor && editor.schema ? editor.schema : Schema(settings);
- settings.entity_encoding = settings.entity_encoding || 'named';
- settings.remove_trailing_brs = 'remove_trailing_brs' in settings ? settings.remove_trailing_brs : true;
- htmlParser = DomParser(settings, schema);
- $_51rhs16njjgwe8ts.register(htmlParser, settings, dom);
- var serialize = function (node, parserArgs) {
- var args = merge({ format: 'html' }, parserArgs ? parserArgs : {});
- var targetNode = $_5u4dpu6ojjgwe8u3.process(editor, node, args);
- var html = getHtmlFromNode(dom, targetNode, args);
- var rootNode = parseHtml(htmlParser, html, args);
- return args.format === 'tree' ? rootNode : toHtml(editor, settings, schema, rootNode, args);
- };
- return {
- schema: schema,
- addNodeFilter: htmlParser.addNodeFilter,
- addAttributeFilter: htmlParser.addAttributeFilter,
- serialize: serialize,
- addRules: function (rules) {
- schema.addValidElements(rules);
- },
- setRules: function (rules) {
- schema.setValidElements(rules);
- },
- addTempAttr: curry(addTempAttr, htmlParser, tempAttrs),
- getTempAttrs: function () {
- return tempAttrs;
- }
- };
- }
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function DomSerializer$1 (settings, editor) {
- var domSerializer = DomSerializer(settings, editor);
- return {
- schema: domSerializer.schema,
- addNodeFilter: domSerializer.addNodeFilter,
- addAttributeFilter: domSerializer.addAttributeFilter,
- serialize: domSerializer.serialize,
- addRules: domSerializer.addRules,
- setRules: domSerializer.setRules,
- addTempAttr: domSerializer.addTempAttr,
- getTempAttrs: domSerializer.getTempAttrs
- };
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function BookmarkManager(selection) {
+ return {
+ getBookmark: curry(Bookmarks.getBookmark, selection),
+ moveToBookmark: curry(Bookmarks.moveToBookmark, selection)
+ };
+ }
+ (function (BookmarkManager) {
+ BookmarkManager.isBookmarkNode = Bookmarks.isBookmarkNode;
+ }(BookmarkManager || (BookmarkManager = {})));
+ var BookmarkManager$1 = BookmarkManager;
</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 BookmarkManager(selection) {
- return {
- getBookmark: curry($_6refgt2vjjgwe7yn.getBookmark, selection),
- moveToBookmark: curry($_6refgt2vjjgwe7yn.moveToBookmark, selection)
- };
- }
- (function (BookmarkManager) {
- BookmarkManager.isBookmarkNode = $_6refgt2vjjgwe7yn.isBookmarkNode;
- }(BookmarkManager || (BookmarkManager = {})));
- var BookmarkManager$1 = BookmarkManager;
-
- var isContentEditableFalse$10 = $_3b9u2y1rjjgwe7qe.isContentEditableFalse;
- var isContentEditableTrue$6 = $_3b9u2y1rjjgwe7qe.isContentEditableTrue;
- var getContentEditableRoot$2 = function (root, node) {
- while (node && node !== root) {
- if (isContentEditableTrue$6(node) || isContentEditableFalse$10(node)) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isContentEditableFalse$a = NodeType.isContentEditableFalse;
+ var isContentEditableTrue$6 = NodeType.isContentEditableTrue;
+ var getContentEditableRoot$2 = function (root, node) {
+ while (node && node !== root) {
+ if (isContentEditableTrue$6(node) || isContentEditableFalse$a(node)) {
+ return node;
+ }
+ 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">- node = node.parentNode;
- }
- return null;
- };
- var ControlSelection = function (selection, editor) {
- var dom = editor.dom, each = $_6cwiepljjgwe7j4.each;
- var selectedElm, selectedElmGhost, resizeHelper, resizeHandles, selectedHandle;
- var startX, startY, selectedElmX, selectedElmY, startW, startH, ratio, resizeStarted;
- var width, height;
- var editableDoc = editor.getDoc(), rootDocument = document;
- var abs = Math.abs, round = Math.round, rootElement = editor.getBody();
- var startScrollWidth, startScrollHeight;
- resizeHandles = {
- nw: [
- 0,
- 0,
- -1,
- -1
- ],
- ne: [
- 1,
- 0,
- 1,
- -1
- ],
- se: [
- 1,
- 1,
- 1,
- 1
- ],
- sw: [
- 0,
- 1,
- -1,
- 1
- ]
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- var rootClass = '.mce-content-body';
- editor.contentStyles.push(rootClass + ' div.mce-resizehandle {' + 'position: absolute;' + 'border: 1px solid black;' + 'box-sizing: content-box;' + 'background: #FFF;' + 'width: 7px;' + 'height: 7px;' + 'z-index: 10000' + '}' + rootClass + ' .mce-resizehandle:hover {' + 'background: #000' + '}' + rootClass + ' img[data-mce-selected],' + rootClass + ' hr[data-mce-selected] {' + 'outline: 1px solid black;' + 'resize: none' + '}' + rootClass + ' .mce-clonedresizable {' + 'position: absolute;' + ($_bcvfv9ajjgwe79v.gecko ? '' : 'outline: 1px dashed black;') + 'opacity: .5;' + 'filter: alpha(opacity=50);' + 'z-index: 10000' + '}' + rootClass + ' .mce-resize-helper {' + 'background: #555;' + 'background: rgba(0,0,0,0.75);' + 'border-radius: 3px;' + 'border: 1px;' + 'color: white;' + 'display: none;' + 'font-family: sans-serif;' + 'font-size: 12px;' + 'white-space: nowrap;' + 'line-height: 14px;' + 'margin: 5px 10px;' + 'padding: 5px;' + 'position: absolute;' + 'z-index: 10001' + '}');
- var isImage = function (elm) {
- return elm && (elm.nodeName === 'IMG' || editor.dom.is(elm, 'figure.image'));
- };
- var isEventOnImageOutsideRange = function (evt, range) {
- return isImage(evt.target) && !$_bswl8d5ujjgwe8oh.isXYWithinRange(evt.clientX, evt.clientY, range);
- };
- var contextMenuSelectImage = function (evt) {
- var target = evt.target;
- if (isEventOnImageOutsideRange(evt, editor.selection.getRng()) && !evt.isDefaultPrevented()) {
- evt.preventDefault();
- editor.selection.select(target);
- }
- };
- var getResizeTarget = function (elm) {
- return editor.dom.is(elm, 'figure.image') ? elm.querySelector('img') : elm;
- };
- var isResizable = function (elm) {
- var selector = editor.settings.object_resizing;
- if (selector === false || $_bcvfv9ajjgwe79v.iOS) {
- return false;
- }
- if (typeof selector !== 'string') {
- selector = 'table,img,figure.image,div';
- }
- if (elm.getAttribute('data-mce-resize') === 'false') {
- return false;
- }
- if (elm === editor.getBody()) {
- return false;
- }
- return $_4yq1xp1gjjgwe7op.is(Element$$1.fromDom(elm), selector);
- };
- var resizeGhostElement = function (e) {
- var deltaX, deltaY, proportional;
- var resizeHelperX, resizeHelperY;
- deltaX = e.screenX - startX;
- deltaY = e.screenY - startY;
- width = deltaX * selectedHandle[2] + startW;
- height = deltaY * selectedHandle[3] + startH;
- width = width < 5 ? 5 : width;
- height = height < 5 ? 5 : height;
- if (isImage(selectedElm) && editor.settings.resize_img_proportional !== false) {
- proportional = !$_9udk9k5wjjgwe8on.modifierPressed(e);
- } else {
- proportional = $_9udk9k5wjjgwe8on.modifierPressed(e) || isImage(selectedElm) && selectedHandle[2] * selectedHandle[3] !== 0;
- }
- if (proportional) {
- if (abs(deltaX) > abs(deltaY)) {
- height = round(width * ratio);
- width = round(height / ratio);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ControlSelection = function (selection, editor) {
+ var dom = editor.dom, each = Tools.each;
+ var selectedElm, selectedElmGhost, resizeHelper, resizeHandles, selectedHandle;
+ var startX, startY, selectedElmX, selectedElmY, startW, startH, ratio, resizeStarted;
+ var width, height;
+ var editableDoc = editor.getDoc(), rootDocument = document;
+ var abs = Math.abs, round = Math.round, rootElement = editor.getBody();
+ var startScrollWidth, startScrollHeight;
+ resizeHandles = {
+ nw: [
+ 0,
+ 0,
+ -1,
+ -1
+ ],
+ ne: [
+ 1,
+ 0,
+ 1,
+ -1
+ ],
+ se: [
+ 1,
+ 1,
+ 1,
+ 1
+ ],
+ sw: [
+ 0,
+ 1,
+ -1,
+ 1
+ ]
+ };
+ var rootClass = '.mce-content-body';
+ editor.contentStyles.push(rootClass + ' div.mce-resizehandle {' + 'position: absolute;' + 'border: 1px solid black;' + 'box-sizing: content-box;' + 'background: #FFF;' + 'width: 7px;' + 'height: 7px;' + 'z-index: 10000' + '}' + rootClass + ' .mce-resizehandle:hover {' + 'background: #000' + '}' + rootClass + ' img[data-mce-selected],' + rootClass + ' hr[data-mce-selected] {' + 'outline: 1px solid black;' + 'resize: none' + '}' + rootClass + ' .mce-clonedresizable {' + 'position: absolute;' + (Env.gecko ? '' : 'outline: 1px dashed black;') + 'opacity: .5;' + 'filter: alpha(opacity=50);' + 'z-index: 10000' + '}' + rootClass + ' .mce-resize-helper {' + 'background: #555;' + 'background: rgba(0,0,0,0.75);' + 'border-radius: 3px;' + 'border: 1px;' + 'color: white;' + 'display: none;' + 'font-family: sans-serif;' + 'font-size: 12px;' + 'white-space: nowrap;' + 'line-height: 14px;' + 'margin: 5px 10px;' + 'padding: 5px;' + 'position: absolute;' + 'z-index: 10001' + '}');
+ var isImage = function (elm) {
+ return elm && (elm.nodeName === 'IMG' || editor.dom.is(elm, 'figure.image'));
+ };
+ var isEventOnImageOutsideRange = function (evt, range) {
+ return isImage(evt.target) && !RangePoint.isXYWithinRange(evt.clientX, evt.clientY, range);
+ };
+ var contextMenuSelectImage = function (evt) {
+ var target = evt.target;
+ if (isEventOnImageOutsideRange(evt, editor.selection.getRng()) && !evt.isDefaultPrevented()) {
+ evt.preventDefault();
+ editor.selection.select(target);
+ }
+ };
+ var getResizeTarget = function (elm) {
+ return editor.dom.is(elm, 'figure.image') ? elm.querySelector('img') : elm;
+ };
+ var isResizable = function (elm) {
+ var selector = editor.settings.object_resizing;
+ if (selector === false || Env.iOS) {
+ return false;
+ }
+ if (typeof selector !== 'string') {
+ selector = 'table,img,figure.image,div';
+ }
+ if (elm.getAttribute('data-mce-resize') === 'false') {
+ return false;
+ }
+ if (elm === editor.getBody()) {
+ return false;
+ }
+ return is$1(Element$$1.fromDom(elm), selector);
+ };
+ var resizeGhostElement = function (e) {
+ var deltaX, deltaY, proportional;
+ var resizeHelperX, resizeHelperY;
+ deltaX = e.screenX - startX;
+ deltaY = e.screenY - startY;
+ width = deltaX * selectedHandle[2] + startW;
+ height = deltaY * selectedHandle[3] + startH;
+ width = width < 5 ? 5 : width;
+ height = height < 5 ? 5 : height;
+ if (isImage(selectedElm) && editor.settings.resize_img_proportional !== false) {
+ proportional = !VK.modifierPressed(e);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- width = round(height / ratio);
- height = round(width * ratio);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ proportional = VK.modifierPressed(e) || isImage(selectedElm) && selectedHandle[2] * selectedHandle[3] !== 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">- }
- dom.setStyles(getResizeTarget(selectedElmGhost), {
- width: width,
- height: height
- });
- resizeHelperX = selectedHandle.startPos.x + deltaX;
- resizeHelperY = selectedHandle.startPos.y + deltaY;
- resizeHelperX = resizeHelperX > 0 ? resizeHelperX : 0;
- resizeHelperY = resizeHelperY > 0 ? resizeHelperY : 0;
- dom.setStyles(resizeHelper, {
- left: resizeHelperX,
- top: resizeHelperY,
- display: 'block'
- });
- resizeHelper.innerHTML = width + ' × ' + height;
- if (selectedHandle[2] < 0 && selectedElmGhost.clientWidth <= width) {
- dom.setStyle(selectedElmGhost, 'left', selectedElmX + (startW - width));
- }
- if (selectedHandle[3] < 0 && selectedElmGhost.clientHeight <= height) {
- dom.setStyle(selectedElmGhost, 'top', selectedElmY + (startH - height));
- }
- deltaX = rootElement.scrollWidth - startScrollWidth;
- deltaY = rootElement.scrollHeight - startScrollHeight;
- if (deltaX + deltaY !== 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (proportional) {
+ if (abs(deltaX) > abs(deltaY)) {
+ height = round(width * ratio);
+ width = round(height / ratio);
+ } else {
+ width = round(height / ratio);
+ height = round(width * ratio);
+ }
+ }
+ dom.setStyles(getResizeTarget(selectedElmGhost), {
+ width: width,
+ height: height
+ });
+ resizeHelperX = selectedHandle.startPos.x + deltaX;
+ resizeHelperY = selectedHandle.startPos.y + deltaY;
+ resizeHelperX = resizeHelperX > 0 ? resizeHelperX : 0;
+ resizeHelperY = resizeHelperY > 0 ? resizeHelperY : 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> dom.setStyles(resizeHelper, {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- left: resizeHelperX - deltaX,
- top: resizeHelperY - deltaY
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ left: resizeHelperX,
+ top: resizeHelperY,
+ display: '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 (!resizeStarted) {
- $_b2ca654tjjgwe8ic.fireObjectResizeStart(editor, selectedElm, startW, startH);
- resizeStarted = true;
- }
- };
- var endGhostResize = function () {
- resizeStarted = false;
- var setSizeProp = function (name$$1, value) {
- if (value) {
- if (selectedElm.style[name$$1] || !editor.schema.isValid(selectedElm.nodeName.toLowerCase(), name$$1)) {
- dom.setStyle(getResizeTarget(selectedElm), name$$1, value);
- } else {
- dom.setAttrib(getResizeTarget(selectedElm), name$$1, value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ resizeHelper.innerHTML = width + ' × ' + height;
+ if (selectedHandle[2] < 0 && selectedElmGhost.clientWidth <= width) {
+ dom.setStyle(selectedElmGhost, 'left', selectedElmX + (startW - width));
+ }
+ if (selectedHandle[3] < 0 && selectedElmGhost.clientHeight <= height) {
+ dom.setStyle(selectedElmGhost, 'top', selectedElmY + (startH - height));
+ }
+ deltaX = rootElement.scrollWidth - startScrollWidth;
+ deltaY = rootElement.scrollHeight - startScrollHeight;
+ if (deltaX + deltaY !== 0) {
+ dom.setStyles(resizeHelper, {
+ left: resizeHelperX - deltaX,
+ top: resizeHelperY - deltaY
+ });
+ }
+ if (!resizeStarted) {
+ Events.fireObjectResizeStart(editor, selectedElm, startW, startH);
+ resizeStarted = true;
+ }
+ };
+ var endGhostResize = function () {
+ resizeStarted = false;
+ var setSizeProp = function (name$$1, value) {
+ if (value) {
+ if (selectedElm.style[name$$1] || !editor.schema.isValid(selectedElm.nodeName.toLowerCase(), name$$1)) {
+ dom.setStyle(getResizeTarget(selectedElm), name$$1, value);
+ } else {
+ dom.setAttrib(getResizeTarget(selectedElm), name$$1, value);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ setSizeProp('width', width);
+ setSizeProp('height', height);
+ dom.unbind(editableDoc, 'mousemove', resizeGhostElement);
+ dom.unbind(editableDoc, 'mouseup', endGhostResize);
+ if (rootDocument !== editableDoc) {
+ dom.unbind(rootDocument, 'mousemove', resizeGhostElement);
+ dom.unbind(rootDocument, 'mouseup', endGhostResize);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ dom.remove(selectedElmGhost);
+ dom.remove(resizeHelper);
+ showResizeRect(selectedElm);
+ Events.fireObjectResized(editor, selectedElm, width, height);
+ dom.setAttrib(selectedElm, 'style', dom.getAttrib(selectedElm, 'style'));
+ 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">- setSizeProp('width', width);
- setSizeProp('height', height);
- dom.unbind(editableDoc, 'mousemove', resizeGhostElement);
- dom.unbind(editableDoc, 'mouseup', endGhostResize);
- if (rootDocument !== editableDoc) {
- dom.unbind(rootDocument, 'mousemove', resizeGhostElement);
- dom.unbind(rootDocument, 'mouseup', endGhostResize);
- }
- dom.remove(selectedElmGhost);
- dom.remove(resizeHelper);
- showResizeRect(selectedElm);
- $_b2ca654tjjgwe8ic.fireObjectResized(editor, selectedElm, width, height);
- dom.setAttrib(selectedElm, 'style', dom.getAttrib(selectedElm, 'style'));
- editor.nodeChanged();
- };
- var showResizeRect = function (targetElm) {
- var position, targetWidth, targetHeight, e, rect;
- hideResizeRect();
- unbindResizeHandleEvents();
- position = dom.getPos(targetElm, rootElement);
- selectedElmX = position.x;
- selectedElmY = position.y;
- rect = targetElm.getBoundingClientRect();
- targetWidth = rect.width || rect.right - rect.left;
- targetHeight = rect.height || rect.bottom - rect.top;
- if (selectedElm !== targetElm) {
- selectedElm = targetElm;
- width = height = 0;
- }
- e = editor.fire('ObjectSelected', { target: targetElm });
- if (isResizable(targetElm) && !e.isDefaultPrevented()) {
- each(resizeHandles, function (handle, name$$1) {
- var handleElm;
- var startDrag = function (e) {
- startX = e.screenX;
- startY = e.screenY;
- startW = getResizeTarget(selectedElm).clientWidth;
- startH = getResizeTarget(selectedElm).clientHeight;
- ratio = startH / startW;
- selectedHandle = handle;
- handle.startPos = {
- x: targetWidth * handle[0] + selectedElmX,
- y: targetHeight * handle[1] + selectedElmY
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var showResizeRect = function (targetElm) {
+ var position, targetWidth, targetHeight, e, rect;
+ hideResizeRect();
+ unbindResizeHandleEvents();
+ position = dom.getPos(targetElm, rootElement);
+ selectedElmX = position.x;
+ selectedElmY = position.y;
+ rect = targetElm.getBoundingClientRect();
+ targetWidth = rect.width || rect.right - rect.left;
+ targetHeight = rect.height || rect.bottom - rect.top;
+ if (selectedElm !== targetElm) {
+ selectedElm = targetElm;
+ width = height = 0;
+ }
+ e = editor.fire('ObjectSelected', { target: targetElm });
+ if (isResizable(targetElm) && !e.isDefaultPrevented()) {
+ each(resizeHandles, function (handle, name$$1) {
+ var handleElm;
+ var startDrag = function (e) {
+ startX = e.screenX;
+ startY = e.screenY;
+ startW = getResizeTarget(selectedElm).clientWidth;
+ startH = getResizeTarget(selectedElm).clientHeight;
+ ratio = startH / startW;
+ selectedHandle = handle;
+ handle.startPos = {
+ x: targetWidth * handle[0] + selectedElmX,
+ y: targetHeight * handle[1] + selectedElmY
+ };
+ startScrollWidth = rootElement.scrollWidth;
+ startScrollHeight = rootElement.scrollHeight;
+ selectedElmGhost = selectedElm.cloneNode(true);
+ dom.addClass(selectedElmGhost, 'mce-clonedresizable');
+ dom.setAttrib(selectedElmGhost, 'data-mce-bogus', 'all');
+ selectedElmGhost.contentEditable = false;
+ selectedElmGhost.unSelectabe = true;
+ dom.setStyles(selectedElmGhost, {
+ left: selectedElmX,
+ top: selectedElmY,
+ margin: 0
+ });
+ selectedElmGhost.removeAttribute('data-mce-selected');
+ rootElement.appendChild(selectedElmGhost);
+ dom.bind(editableDoc, 'mousemove', resizeGhostElement);
+ dom.bind(editableDoc, 'mouseup', endGhostResize);
+ if (rootDocument !== editableDoc) {
+ dom.bind(rootDocument, 'mousemove', resizeGhostElement);
+ dom.bind(rootDocument, 'mouseup', endGhostResize);
+ }
+ resizeHelper = dom.add(rootElement, 'div', {
+ 'class': 'mce-resize-helper',
+ 'data-mce-bogus': 'all'
+ }, startW + ' × ' + startH);
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- startScrollWidth = rootElement.scrollWidth;
- startScrollHeight = rootElement.scrollHeight;
- selectedElmGhost = selectedElm.cloneNode(true);
- dom.addClass(selectedElmGhost, 'mce-clonedresizable');
- dom.setAttrib(selectedElmGhost, 'data-mce-bogus', 'all');
- selectedElmGhost.contentEditable = false;
- selectedElmGhost.unSelectabe = true;
- dom.setStyles(selectedElmGhost, {
- left: selectedElmX,
- top: selectedElmY,
- margin: 0
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ handleElm = dom.get('mceResizeHandle' + name$$1);
+ if (handleElm) {
+ dom.remove(handleElm);
+ }
+ handleElm = dom.add(rootElement, 'div', {
+ 'id': 'mceResizeHandle' + name$$1,
+ 'data-mce-bogus': 'all',
+ 'class': 'mce-resizehandle',
+ 'unselectable': true,
+ 'style': 'cursor:' + name$$1 + '-resize; margin:0; padding: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">- selectedElmGhost.removeAttribute('data-mce-selected');
- rootElement.appendChild(selectedElmGhost);
- dom.bind(editableDoc, 'mousemove', resizeGhostElement);
- dom.bind(editableDoc, 'mouseup', endGhostResize);
- if (rootDocument !== editableDoc) {
- dom.bind(rootDocument, 'mousemove', resizeGhostElement);
- dom.bind(rootDocument, 'mouseup', endGhostResize);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (Env.ie === 11) {
+ handleElm.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">- resizeHelper = dom.add(rootElement, 'div', {
- 'class': 'mce-resize-helper',
- 'data-mce-bogus': 'all'
- }, startW + ' × ' + startH);
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ dom.bind(handleElm, 'mousedown', function (e) {
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ startDrag(e);
+ });
+ handle.elm = handleElm;
+ dom.setStyles(handleElm, {
+ left: targetWidth * handle[0] + selectedElmX - handleElm.offsetWidth / 2,
+ top: targetHeight * handle[1] + selectedElmY - handleElm.offsetHeight / 2
+ });
+ });
+ } else {
+ hideResizeRect();
+ }
+ selectedElm.setAttribute('data-mce-selected', '1');
+ };
+ var hideResizeRect = function () {
+ var name$$1, handleElm;
+ unbindResizeHandleEvents();
+ if (selectedElm) {
+ selectedElm.removeAttribute('data-mce-selected');
+ }
+ for (name$$1 in resizeHandles) {
</ins><span class="cx" style="display: block; padding: 0 10px"> handleElm = dom.get('mceResizeHandle' + name$$1);
</span><span class="cx" style="display: block; padding: 0 10px"> if (handleElm) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ dom.unbind(handleElm);
</ins><span class="cx" style="display: block; padding: 0 10px"> dom.remove(handleElm);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- handleElm = dom.add(rootElement, 'div', {
- 'id': 'mceResizeHandle' + name$$1,
- 'data-mce-bogus': 'all',
- 'class': 'mce-resizehandle',
- 'unselectable': true,
- 'style': 'cursor:' + name$$1 + '-resize; margin:0; padding:0'
- });
- if ($_bcvfv9ajjgwe79v.ie === 11) {
- handleElm.contentEditable = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ };
+ var updateResizeRect = function (e) {
+ var startElm, controlElm;
+ var isChildOrEqual = function (node, parent$$1) {
+ if (node) {
+ do {
+ if (node === parent$$1) {
+ return true;
+ }
+ } while (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">- dom.bind(handleElm, 'mousedown', function (e) {
- e.stopImmediatePropagation();
- e.preventDefault();
- startDrag(e);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ if (resizeStarted || editor.removed) {
+ return;
+ }
+ each(dom.select('img[data-mce-selected],hr[data-mce-selected]'), function (img) {
+ img.removeAttribute('data-mce-selected');
+ });
+ controlElm = e.type === 'mousedown' ? e.target : selection.getNode();
+ controlElm = dom.$(controlElm).closest('table,img,figure.image,hr')[0];
+ if (isChildOrEqual(controlElm, rootElement)) {
+ disableGeckoResize();
+ startElm = selection.getStart(true);
+ if (isChildOrEqual(startElm, controlElm) && isChildOrEqual(selection.getEnd(true), controlElm)) {
+ showResizeRect(controlElm);
+ return;
+ }
+ }
+ hideResizeRect();
+ };
+ var isWithinContentEditableFalse = function (elm) {
+ return isContentEditableFalse$a(getContentEditableRoot$2(editor.getBody(), elm));
+ };
+ var unbindResizeHandleEvents = function () {
+ for (var name$$1 in resizeHandles) {
+ var handle = resizeHandles[name$$1];
+ if (handle.elm) {
+ dom.unbind(handle.elm);
+ delete handle.elm;
+ }
+ }
+ };
+ var disableGeckoResize = function () {
+ try {
+ editor.getDoc().execCommand('enableObjectResizing', false, false);
+ } catch (ex) {
+ }
+ };
+ editor.on('init', function () {
+ disableGeckoResize();
+ if (Env.ie && Env.ie >= 11) {
+ editor.on('mousedown click', function (e) {
+ var target = e.target, nodeName = target.nodeName;
+ if (!resizeStarted && /^(TABLE|IMG|HR)$/.test(nodeName) && !isWithinContentEditableFalse(target)) {
+ if (e.button !== 2) {
+ editor.selection.select(target, nodeName === 'TABLE');
+ }
+ if (e.type === 'mousedown') {
+ 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">- handle.elm = handleElm;
- dom.setStyles(handleElm, {
- left: targetWidth * handle[0] + selectedElmX - handleElm.offsetWidth / 2,
- top: targetHeight * handle[1] + selectedElmY - handleElm.offsetHeight / 2
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.dom.bind(rootElement, 'mscontrolselect', function (e) {
+ var delayedSelect = function (node) {
+ Delay.setEditorTimeout(editor, function () {
+ editor.selection.select(node);
+ });
+ };
+ if (isWithinContentEditableFalse(e.target)) {
+ e.preventDefault();
+ delayedSelect(e.target);
+ return;
+ }
+ if (/^(TABLE|IMG|HR)$/.test(e.target.nodeName)) {
+ e.preventDefault();
+ if (e.target.tagName === 'IMG') {
+ delayedSelect(e.target);
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ var throttledUpdateResizeRect = Delay.throttle(function (e) {
+ if (!editor.composing) {
+ updateResizeRect(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">- } else {
- hideResizeRect();
- }
- selectedElm.setAttribute('data-mce-selected', '1');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('nodechange ResizeEditor ResizeWindow drop FullscreenStateChanged', throttledUpdateResizeRect);
+ editor.on('keyup compositionend', function (e) {
+ if (selectedElm && selectedElm.nodeName === 'TABLE') {
+ throttledUpdateResizeRect(e);
+ }
+ });
+ editor.on('hide blur', hideResizeRect);
+ editor.on('contextmenu', contextMenuSelectImage);
+ });
+ editor.on('remove', unbindResizeHandleEvents);
+ var destroy = function () {
+ selectedElm = selectedElmGhost = null;
+ };
+ return {
+ isResizable: isResizable,
+ showResizeRect: showResizeRect,
+ hideResizeRect: hideResizeRect,
+ updateResizeRect: updateResizeRect,
+ destroy: destroy
+ };
</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 hideResizeRect = function () {
- var name$$1, handleElm;
- unbindResizeHandleEvents();
- if (selectedElm) {
- selectedElm.removeAttribute('data-mce-selected');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var getPos$1 = function (elm) {
+ var x = 0, y = 0;
+ var offsetParent = elm;
+ while (offsetParent && offsetParent.nodeType) {
+ x += offsetParent.offsetLeft || 0;
+ y += offsetParent.offsetTop || 0;
+ offsetParent = offsetParent.offsetParent;
</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 (name$$1 in resizeHandles) {
- handleElm = dom.get('mceResizeHandle' + name$$1);
- if (handleElm) {
- dom.unbind(handleElm);
- dom.remove(handleElm);
- }
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return {
+ x: x,
+ y: 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">- var updateResizeRect = function (e) {
- var startElm, controlElm;
- var isChildOrEqual = function (node, parent$$1) {
- if (node) {
- do {
- if (node === parent$$1) {
- return true;
- }
- } while (node = node.parentNode);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fireScrollIntoViewEvent = function (editor, elm, alignToTop) {
+ var scrollEvent = {
+ elm: elm,
+ alignToTop: alignToTop
</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 (resizeStarted || editor.removed) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.fire('scrollIntoView', scrollEvent);
+ return scrollEvent.isDefaultPrevented();
+ };
+ var scrollElementIntoView = function (editor, elm, alignToTop) {
+ var y, viewPort;
+ var dom = editor.dom;
+ var root = dom.getRoot();
+ var viewPortY, viewPortH, offsetY = 0;
+ if (fireScrollIntoViewEvent(editor, elm, alignToTop)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- each(dom.select('img[data-mce-selected],hr[data-mce-selected]'), function (img) {
- img.removeAttribute('data-mce-selected');
- });
- controlElm = e.type === 'mousedown' ? e.target : selection.getNode();
- controlElm = dom.$(controlElm).closest('table,img,figure.image,hr')[0];
- if (isChildOrEqual(controlElm, rootElement)) {
- disableGeckoResize();
- startElm = selection.getStart(true);
- if (isChildOrEqual(startElm, controlElm) && isChildOrEqual(selection.getEnd(true), controlElm)) {
- showResizeRect(controlElm);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!NodeType.isElement(elm)) {
+ return;
+ }
+ if (alignToTop === false) {
+ offsetY = elm.offsetHeight;
+ }
+ if (root.nodeName !== 'BODY') {
+ var scrollContainer = editor.selection.getScrollContainer();
+ if (scrollContainer) {
+ y = getPos$1(elm).y - getPos$1(scrollContainer).y + offsetY;
+ viewPortH = scrollContainer.clientHeight;
+ viewPortY = scrollContainer.scrollTop;
+ if (y < viewPortY || y + 25 > viewPortY + viewPortH) {
+ scrollContainer.scrollTop = y < viewPortY ? y : y - viewPortH + 25;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</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">- hideResizeRect();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ viewPort = dom.getViewPort(editor.getWin());
+ y = dom.getPos(elm).y + offsetY;
+ viewPortY = viewPort.y;
+ viewPortH = viewPort.h;
+ if (y < viewPort.y || y + 25 > viewPortY + viewPortH) {
+ editor.getWin().scrollTo(0, y < viewPortY ? y : y - viewPortH + 25);
+ }
</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 isWithinContentEditableFalse = function (elm) {
- return isContentEditableFalse$10(getContentEditableRoot$2(editor.getBody(), elm));
- };
- var unbindResizeHandleEvents = function () {
- for (var name$$1 in resizeHandles) {
- var handle = resizeHandles[name$$1];
- if (handle.elm) {
- dom.unbind(handle.elm);
- delete handle.elm;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getViewPortRect = function (editor) {
+ if (editor.inline) {
+ return editor.getBody().getBoundingClientRect();
+ } else {
+ var win = editor.getWin();
+ return {
+ left: 0,
+ right: win.innerWidth,
+ top: 0,
+ bottom: win.innerHeight,
+ width: win.innerWidth,
+ height: win.innerHeight
+ };
</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">- var disableGeckoResize = function () {
- try {
- editor.getDoc().execCommand('enableObjectResizing', false, false);
- } catch (ex) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var scrollBy = function (editor, dx, dy) {
+ if (editor.inline) {
+ editor.getBody().scrollLeft += dx;
+ editor.getBody().scrollTop += dy;
+ } else {
+ editor.getWin().scrollBy(dx, dy);
</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">- editor.on('init', function () {
- disableGeckoResize();
- if ($_bcvfv9ajjgwe79v.ie && $_bcvfv9ajjgwe79v.ie >= 11) {
- editor.on('mousedown click', function (e) {
- var target = e.target, nodeName = target.nodeName;
- if (!resizeStarted && /^(TABLE|IMG|HR)$/.test(nodeName) && !isWithinContentEditableFalse(target)) {
- if (e.button !== 2) {
- editor.selection.select(target, nodeName === 'TABLE');
- }
- if (e.type === 'mousedown') {
- editor.nodeChanged();
- }
- }
- });
- editor.dom.bind(rootElement, 'mscontrolselect', function (e) {
- var delayedSelect = function (node) {
- $_9o1ijaijjgwe7dm.setEditorTimeout(editor, function () {
- editor.selection.select(node);
- });
- };
- if (isWithinContentEditableFalse(e.target)) {
- e.preventDefault();
- delayedSelect(e.target);
- return;
- }
- if (/^(TABLE|IMG|HR)$/.test(e.target.nodeName)) {
- e.preventDefault();
- if (e.target.tagName === 'IMG') {
- delayedSelect(e.target);
- }
- }
- });
- }
- var throttledUpdateResizeRect = $_9o1ijaijjgwe7dm.throttle(function (e) {
- if (!editor.composing) {
- updateResizeRect(e);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var scrollRangeIntoView = function (editor, rng) {
+ head(CaretPosition.fromRangeStart(rng).getClientRects()).each(function (rngRect) {
+ var bodyRect = getViewPortRect(editor);
+ var overflow = getOverflow(bodyRect, rngRect);
+ var margin = 4;
+ var dx = overflow.x > 0 ? overflow.x + margin : overflow.x - margin;
+ var dy = overflow.y > 0 ? overflow.y + margin : overflow.y - margin;
+ scrollBy(editor, overflow.x !== 0 ? dx : 0, overflow.y !== 0 ? dy : 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">- editor.on('nodechange ResizeEditor ResizeWindow drop FullscreenStateChanged', throttledUpdateResizeRect);
- editor.on('keyup compositionend', function (e) {
- if (selectedElm && selectedElm.nodeName === 'TABLE') {
- throttledUpdateResizeRect(e);
- }
- });
- editor.on('hide blur', hideResizeRect);
- editor.on('contextmenu', contextMenuSelectImage);
- });
- editor.on('remove', unbindResizeHandleEvents);
- var destroy = function () {
- selectedElm = selectedElmGhost = null;
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return {
- isResizable: isResizable,
- showResizeRect: showResizeRect,
- hideResizeRect: hideResizeRect,
- updateResizeRect: updateResizeRect,
- destroy: destroy
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var ScrollIntoView = {
+ scrollElementIntoView: scrollElementIntoView,
+ scrollRangeIntoView: scrollRangeIntoView
</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><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var hasCeProperty = function (node) {
- return $_3b9u2y1rjjgwe7qe.isContentEditableTrue(node) || $_3b9u2y1rjjgwe7qe.isContentEditableFalse(node);
- };
- var findParent$1 = function (node, rootNode, predicate) {
- while (node && node !== rootNode) {
- if (predicate(node)) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasCeProperty = function (node) {
+ return NodeType.isContentEditableTrue(node) || NodeType.isContentEditableFalse(node);
+ };
+ var findParent$1 = function (node, rootNode, predicate) {
+ while (node && node !== rootNode) {
+ if (predicate(node)) {
+ return node;
+ }
+ 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">- node = node.parentNode;
- }
- return null;
- };
- var findClosestIeRange = function (clientX, clientY, doc) {
- var element, rng, rects;
- element = doc.elementFromPoint(clientX, clientY);
- rng = doc.body.createTextRange();
- if (!element || element.tagName === 'HTML') {
- element = doc.body;
- }
- rng.moveToElementText(element);
- rects = $_6cwiepljjgwe7j4.toArray(rng.getClientRects());
- rects = rects.sort(function (a, b) {
- a = Math.abs(Math.max(a.top - clientY, a.bottom - clientY));
- b = Math.abs(Math.max(b.top - clientY, b.bottom - clientY));
- return a - b;
- });
- if (rects.length > 0) {
- clientY = (rects[0].bottom + rects[0].top) / 2;
- try {
- rng.moveToPoint(clientX, clientY);
- rng.collapse(true);
- return rng;
- } catch (ex) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return null;
+ };
+ var findClosestIeRange = function (clientX, clientY, doc) {
+ var element, rng, rects;
+ element = doc.elementFromPoint(clientX, clientY);
+ rng = doc.body.createTextRange();
+ if (!element || element.tagName === 'HTML') {
+ element = 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 null;
- };
- var moveOutOfContentEditableFalse = function (rng, rootNode) {
- var parentElement = rng && rng.parentElement ? rng.parentElement() : null;
- return $_3b9u2y1rjjgwe7qe.isContentEditableFalse(findParent$1(parentElement, rootNode, hasCeProperty)) ? null : rng;
- };
- var fromPoint$1 = function (clientX, clientY, doc) {
- var rng, point;
- var pointDoc = doc;
- if (pointDoc.caretPositionFromPoint) {
- point = pointDoc.caretPositionFromPoint(clientX, clientY);
- if (point) {
- rng = doc.createRange();
- rng.setStart(point.offsetNode, point.offset);
- rng.collapse(true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rng.moveToElementText(element);
+ rects = Tools.toArray(rng.getClientRects());
+ rects = rects.sort(function (a, b) {
+ a = Math.abs(Math.max(a.top - clientY, a.bottom - clientY));
+ b = Math.abs(Math.max(b.top - clientY, b.bottom - clientY));
+ return a - b;
+ });
+ if (rects.length > 0) {
+ clientY = (rects[0].bottom + rects[0].top) / 2;
+ try {
+ rng.moveToPoint(clientX, clientY);
+ rng.collapse(true);
+ return rng;
+ } catch (ex) {
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else if (doc.caretRangeFromPoint) {
- rng = doc.caretRangeFromPoint(clientX, clientY);
- } else if (pointDoc.body.createTextRange) {
- rng = pointDoc.body.createTextRange();
- try {
- rng.moveToPoint(clientX, clientY);
- rng.collapse(true);
- } catch (ex) {
- rng = findClosestIeRange(clientX, clientY, doc);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return null;
+ };
+ var moveOutOfContentEditableFalse = function (rng, rootNode) {
+ var parentElement = rng && rng.parentElement ? rng.parentElement() : null;
+ return NodeType.isContentEditableFalse(findParent$1(parentElement, rootNode, hasCeProperty)) ? null : rng;
+ };
+ var fromPoint$1 = function (clientX, clientY, doc) {
+ var rng, point;
+ var pointDoc = doc;
+ if (pointDoc.caretPositionFromPoint) {
+ point = pointDoc.caretPositionFromPoint(clientX, clientY);
+ if (point) {
+ rng = doc.createRange();
+ rng.setStart(point.offsetNode, point.offset);
+ rng.collapse(true);
+ }
+ } else if (doc.caretRangeFromPoint) {
+ rng = doc.caretRangeFromPoint(clientX, clientY);
+ } else if (pointDoc.body.createTextRange) {
+ rng = pointDoc.body.createTextRange();
+ try {
+ rng.moveToPoint(clientX, clientY);
+ rng.collapse(true);
+ } catch (ex) {
+ rng = findClosestIeRange(clientX, clientY, doc);
+ }
+ return moveOutOfContentEditableFalse(rng, 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 moveOutOfContentEditableFalse(rng, doc.body);
- }
- return rng;
- };
- var $_269jak6xjjgwe8wp = { fromPoint: fromPoint$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return rng;
+ };
+ var CaretRangeFromPoint = { fromPoint: fromPoint$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">- var processRanges = function (editor, ranges) {
- return map(ranges, function (range$$1) {
- var evt = editor.fire('GetSelectionRange', { range: range$$1 });
- return evt.range !== range$$1 ? evt.range : range$$1;
- });
- };
- var $_atnm1d6yjjgwe8wr = { processRanges: processRanges };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var processRanges = function (editor, ranges) {
+ return map(ranges, function (range$$1) {
+ var evt = editor.fire('GetSelectionRange', { range: range$$1 });
+ return evt.range !== range$$1 ? evt.range : range$$1;
+ });
+ };
+ var EventProcessRanges = { processRanges: processRanges };
</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 fromElements = function (elements, scope) {
- var doc = scope || document;
- var fragment = doc.createDocumentFragment();
- each(elements, function (element) {
- fragment.appendChild(element.dom());
- });
- return Element$$1.fromDom(fragment);
- };
- var $_xpi1671jjgwe8xg = { fromElements: fromElements };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var fromElements = function (elements, scope) {
+ var doc = scope || document;
+ var fragment = doc.createDocumentFragment();
+ each(elements, function (element) {
+ fragment.appendChild(element.dom());
+ });
+ return Element$$1.fromDom(fragment);
+ };
</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 tableModel = Immutable('element', 'width', 'rows');
- var tableRow = Immutable('element', 'cells');
- var cellPosition = Immutable('x', 'y');
- var getSpan = function (td, key) {
- var value = parseInt($_etx7gr15jjgwe7mr.get(td, key), 10);
- return isNaN(value) ? 1 : value;
- };
- var fillout = function (table, x, y, tr, td) {
- var rowspan = getSpan(td, 'rowspan');
- var colspan = getSpan(td, 'colspan');
- var rows = table.rows();
- for (var y2 = y; y2 < y + rowspan; y2++) {
- if (!rows[y2]) {
- rows[y2] = tableRow($_6do1m42ijjgwe7wd.deep(tr), []);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var tableModel = Immutable('element', 'width', 'rows');
+ var tableRow = Immutable('element', 'cells');
+ var cellPosition = Immutable('x', 'y');
+ var getSpan = function (td, key) {
+ var value = parseInt(get$1(td, key), 10);
+ return isNaN(value) ? 1 : value;
+ };
+ var fillout = function (table, x, y, tr, td) {
+ var rowspan = getSpan(td, 'rowspan');
+ var colspan = getSpan(td, 'colspan');
+ var rows = table.rows();
+ for (var y2 = y; y2 < y + rowspan; y2++) {
+ if (!rows[y2]) {
+ rows[y2] = tableRow(deep(tr), []);
+ }
+ for (var x2 = x; x2 < x + colspan; x2++) {
+ var cells = rows[y2].cells();
+ cells[x2] = y2 === y && x2 === x ? td : shallow(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">- for (var x2 = x; x2 < x + colspan; x2++) {
- var cells = rows[y2].cells();
- cells[x2] = y2 === y && x2 === x ? td : $_6do1m42ijjgwe7wd.shallow(td);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var cellExists = function (table, x, y) {
+ var rows = table.rows();
+ var cells = rows[y] ? rows[y].cells() : [];
+ return !!cells[x];
+ };
+ var skipCellsX = function (table, x, y) {
+ while (cellExists(table, x, y)) {
+ x++;
</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 cellExists = function (table, x, y) {
- var rows = table.rows();
- var cells = rows[y] ? rows[y].cells() : [];
- return !!cells[x];
- };
- var skipCellsX = function (table, x, y) {
- while (cellExists(table, x, y)) {
- x++;
- }
- return x;
- };
- var getWidth = function (rows) {
- return foldl(rows, function (acc, row) {
- return row.cells().length > acc ? row.cells().length : acc;
- }, 0);
- };
- var findElementPos = function (table, element) {
- var rows = table.rows();
- for (var y = 0; y < rows.length; y++) {
- var cells = rows[y].cells();
- for (var x = 0; x < cells.length; x++) {
- if ($_5raon11ejjgwe7o5.eq(cells[x], element)) {
- return Option.some(cellPosition(x, y));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return x;
+ };
+ var getWidth = function (rows) {
+ return foldl(rows, function (acc, row) {
+ return row.cells().length > acc ? row.cells().length : acc;
+ }, 0);
+ };
+ var findElementPos = function (table, element) {
+ var rows = table.rows();
+ for (var y = 0; y < rows.length; y++) {
+ var cells = rows[y].cells();
+ for (var x = 0; x < cells.length; x++) {
+ if (eq(cells[x], element)) {
+ return Option.some(cellPosition(x, y));
+ }
</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">- }
- return Option.none();
- };
- var extractRows = function (table, sx, sy, ex, ey) {
- var newRows = [];
- var rows = table.rows();
- for (var y = sy; y <= ey; y++) {
- var cells = rows[y].cells();
- var slice = sx < ex ? cells.slice(sx, ex + 1) : cells.slice(ex, sx + 1);
- newRows.push(tableRow(rows[y].element(), slice));
- }
- return newRows;
- };
- var subTable = function (table, startPos, endPos) {
- var sx = startPos.x(), sy = startPos.y();
- var ex = endPos.x(), ey = endPos.y();
- var newRows = sy < ey ? extractRows(table, sx, sy, ex, ey) : extractRows(table, sx, ey, ex, sy);
- return tableModel(table.element(), getWidth(newRows), newRows);
- };
- var createDomTable = function (table, rows) {
- var tableElement = $_6do1m42ijjgwe7wd.shallow(table.element());
- var tableBody = Element$$1.fromTag('tbody');
- $_4wf3mo1xjjgwe7sq.append(tableBody, rows);
- $_ewo3u51yjjgwe7su.append(tableElement, tableBody);
- return tableElement;
- };
- var modelRowsToDomRows = function (table) {
- return map(table.rows(), function (row) {
- var cells = map(row.cells(), function (cell) {
- var td = $_6do1m42ijjgwe7wd.deep(cell);
- $_etx7gr15jjgwe7mr.remove(td, 'colspan');
- $_etx7gr15jjgwe7mr.remove(td, 'rowspan');
- return td;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Option.none();
+ };
+ var extractRows = function (table, sx, sy, ex, ey) {
+ var newRows = [];
+ var rows = table.rows();
+ for (var y = sy; y <= ey; y++) {
+ var cells = rows[y].cells();
+ var slice = sx < ex ? cells.slice(sx, ex + 1) : cells.slice(ex, sx + 1);
+ newRows.push(tableRow(rows[y].element(), slice));
+ }
+ return newRows;
+ };
+ var subTable = function (table, startPos, endPos) {
+ var sx = startPos.x(), sy = startPos.y();
+ var ex = endPos.x(), ey = endPos.y();
+ var newRows = sy < ey ? extractRows(table, sx, sy, ex, ey) : extractRows(table, sx, ey, ex, sy);
+ return tableModel(table.element(), getWidth(newRows), newRows);
+ };
+ var createDomTable = function (table, rows) {
+ var tableElement = shallow(table.element());
+ var tableBody = Element$$1.fromTag('tbody');
+ append$1(tableBody, rows);
+ append(tableElement, tableBody);
+ return tableElement;
+ };
+ var modelRowsToDomRows = function (table) {
+ return map(table.rows(), function (row) {
+ var cells = map(row.cells(), function (cell) {
+ var td = deep(cell);
+ remove(td, 'colspan');
+ remove(td, 'rowspan');
+ return td;
+ });
+ var tr = shallow(row.element());
+ append$1(tr, cells);
+ return 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">- var tr = $_6do1m42ijjgwe7wd.shallow(row.element());
- $_4wf3mo1xjjgwe7sq.append(tr, cells);
- return tr;
- });
- };
- var fromDom$2 = function (tableElm) {
- var table = tableModel($_6do1m42ijjgwe7wd.shallow(tableElm), 0, []);
- each($_d3ydn427jjgwe7uf.descendants(tableElm, 'tr'), function (tr, y) {
- each($_d3ydn427jjgwe7uf.descendants(tr, 'td,th'), function (td, x) {
- fillout(table, skipCellsX(table, x, y), y, tr, td);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var fromDom$2 = function (tableElm) {
+ var table = tableModel(shallow(tableElm), 0, []);
+ each(descendants$1(tableElm, 'tr'), function (tr, y) {
+ each(descendants$1(tr, 'td,th'), function (td, x) {
+ fillout(table, skipCellsX(table, x, y), y, tr, 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">- });
- return tableModel(table.element(), getWidth(table.rows()), table.rows());
- };
- var toDom = function (table) {
- return createDomTable(table, modelRowsToDomRows(table));
- };
- var subsection = function (table, startElement, endElement) {
- return findElementPos(table, startElement).bind(function (startPos) {
- return findElementPos(table, endElement).map(function (endPos) {
- return subTable(table, startPos, endPos);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return tableModel(table.element(), getWidth(table.rows()), table.rows());
+ };
+ var toDom = function (table) {
+ return createDomTable(table, modelRowsToDomRows(table));
+ };
+ var subsection = function (table, startElement, endElement) {
+ return findElementPos(table, startElement).bind(function (startPos) {
+ return findElementPos(table, endElement).map(function (endPos) {
+ return subTable(table, startPos, endPos);
+ });
</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 $_frz8qx72jjgwe8xv = {
- fromDom: fromDom$2,
- toDom: toDom,
- subsection: subsection
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var SimpleTableModel = {
+ fromDom: fromDom$2,
+ toDom: toDom,
+ subsection: subsection
+ };
</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 findParentListContainer = function (parents) {
- return find(parents, function (elm) {
- return $_fxxo5411jjgwe7lq.name(elm) === 'ul' || $_fxxo5411jjgwe7lq.name(elm) === 'ol';
- });
- };
- var getFullySelectedListWrappers = function (parents, rng) {
- return find(parents, function (elm) {
- return $_fxxo5411jjgwe7lq.name(elm) === 'li' && hasAllContentsSelected(elm, rng);
- }).fold(constant([]), function (li) {
- return findParentListContainer(parents).map(function (listCont) {
- return [
- Element$$1.fromTag('li'),
- Element$$1.fromTag($_fxxo5411jjgwe7lq.name(listCont))
- ];
- }).getOr([]);
- });
- };
- var wrap$3 = function (innerElm, elms) {
- var wrapped = foldl(elms, function (acc, elm) {
- $_ewo3u51yjjgwe7su.append(elm, acc);
- return elm;
- }, innerElm);
- return elms.length > 0 ? $_xpi1671jjgwe8xg.fromElements([wrapped]) : wrapped;
- };
- var directListWrappers = function (commonAnchorContainer) {
- if (isListItem(commonAnchorContainer)) {
- return $_d3rmjp18jjgwe7nc.parent(commonAnchorContainer).filter(isList).fold(constant([]), function (listElm) {
- return [
- commonAnchorContainer,
- listElm
- ];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var findParentListContainer = function (parents$$1) {
+ return find(parents$$1, function (elm) {
+ return name(elm) === 'ul' || name(elm) === 'ol';
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- return isList(commonAnchorContainer) ? [commonAnchorContainer] : [];
- }
- };
- var getWrapElements = function (rootNode, rng) {
- var commonAnchorContainer = Element$$1.fromDom(rng.commonAncestorContainer);
- var parents = $_cvft7x3zjjgwe8bh.parentsAndSelf(commonAnchorContainer, rootNode);
- var wrapElements = filter(parents, function (elm) {
- return isInline(elm) || isHeading(elm);
- });
- var listWrappers = getFullySelectedListWrappers(parents, rng);
- var allWrappers = wrapElements.concat(listWrappers.length ? listWrappers : directListWrappers(commonAnchorContainer));
- return map(allWrappers, $_6do1m42ijjgwe7wd.shallow);
- };
- var emptyFragment = function () {
- return $_xpi1671jjgwe8xg.fromElements([]);
- };
- var getFragmentFromRange = function (rootNode, rng) {
- return wrap$3(Element$$1.fromDom(rng.cloneContents()), getWrapElements(rootNode, rng));
- };
- var getParentTable = function (rootElm, cell) {
- return $_ajwe9029jjgwe7ul.ancestor(cell, 'table', curry($_5raon11ejjgwe7o5.eq, rootElm));
- };
- var getTableFragment = function (rootNode, selectedTableCells) {
- return getParentTable(rootNode, selectedTableCells[0]).bind(function (tableElm) {
- var firstCell = selectedTableCells[0];
- var lastCell = selectedTableCells[selectedTableCells.length - 1];
- var fullTableModel = $_frz8qx72jjgwe8xv.fromDom(tableElm);
- return $_frz8qx72jjgwe8xv.subsection(fullTableModel, firstCell, lastCell).map(function (sectionedTableModel) {
- return $_xpi1671jjgwe8xg.fromElements([$_frz8qx72jjgwe8xv.toDom(sectionedTableModel)]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var getFullySelectedListWrappers = function (parents$$1, rng) {
+ return find(parents$$1, function (elm) {
+ return name(elm) === 'li' && hasAllContentsSelected(elm, rng);
+ }).fold(constant([]), function (li) {
+ return findParentListContainer(parents$$1).map(function (listCont) {
+ return [
+ Element$$1.fromTag('li'),
+ Element$$1.fromTag(name(listCont))
+ ];
+ }).getOr([]);
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }).getOrThunk(emptyFragment);
- };
- var getSelectionFragment = function (rootNode, ranges) {
- return ranges.length > 0 && ranges[0].collapsed ? emptyFragment() : getFragmentFromRange(rootNode, ranges[0]);
- };
- var read$4 = function (rootNode, ranges) {
- var selectedCells = $_97ifsc4ejjgwe8fg.getCellsFromElementOrRanges(ranges, rootNode);
- return selectedCells.length > 0 ? getTableFragment(rootNode, selectedCells) : getSelectionFragment(rootNode, ranges);
- };
- var $_c5lgd70jjgwe8wz = { read: read$4 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var wrap$3 = function (innerElm, elms) {
+ var wrapped = foldl(elms, function (acc, elm) {
+ append(elm, acc);
+ return elm;
+ }, innerElm);
+ return elms.length > 0 ? fromElements([wrapped]) : wrapped;
+ };
+ var directListWrappers = function (commonAnchorContainer) {
+ if (isListItem(commonAnchorContainer)) {
+ return parent(commonAnchorContainer).filter(isList).fold(constant([]), function (listElm) {
+ return [
+ commonAnchorContainer,
+ listElm
+ ];
+ });
+ } else {
+ return isList(commonAnchorContainer) ? [commonAnchorContainer] : [];
+ }
+ };
+ var getWrapElements = function (rootNode, rng) {
+ var commonAnchorContainer = Element$$1.fromDom(rng.commonAncestorContainer);
+ var parents$$1 = Parents.parentsAndSelf(commonAnchorContainer, rootNode);
+ var wrapElements = filter(parents$$1, function (elm) {
+ return isInline(elm) || isHeading(elm);
+ });
+ var listWrappers = getFullySelectedListWrappers(parents$$1, rng);
+ var allWrappers = wrapElements.concat(listWrappers.length ? listWrappers : directListWrappers(commonAnchorContainer));
+ return map(allWrappers, shallow);
+ };
+ var emptyFragment = function () {
+ return fromElements([]);
+ };
+ var getFragmentFromRange = function (rootNode, rng) {
+ return wrap$3(Element$$1.fromDom(rng.cloneContents()), getWrapElements(rootNode, rng));
+ };
+ var getParentTable = function (rootElm, cell) {
+ return ancestor$1(cell, 'table', curry(eq, rootElm));
+ };
+ var getTableFragment = function (rootNode, selectedTableCells) {
+ return getParentTable(rootNode, selectedTableCells[0]).bind(function (tableElm) {
+ var firstCell = selectedTableCells[0];
+ var lastCell = selectedTableCells[selectedTableCells.length - 1];
+ var fullTableModel = SimpleTableModel.fromDom(tableElm);
+ return SimpleTableModel.subsection(fullTableModel, firstCell, lastCell).map(function (sectionedTableModel) {
+ return fromElements([SimpleTableModel.toDom(sectionedTableModel)]);
+ });
+ }).getOrThunk(emptyFragment);
+ };
+ var getSelectionFragment = function (rootNode, ranges) {
+ return ranges.length > 0 && ranges[0].collapsed ? emptyFragment() : getFragmentFromRange(rootNode, ranges[0]);
+ };
+ var read$4 = function (rootNode, ranges) {
+ var selectedCells = TableCellSelection.getCellsFromElementOrRanges(ranges, rootNode);
+ return selectedCells.length > 0 ? getTableFragment(rootNode, selectedCells) : getSelectionFragment(rootNode, ranges);
+ };
+ var FragmentReader = { read: read$4 };
</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 getContent = function (editor, args) {
- var rng = editor.selection.getRng(), tmpElm = editor.dom.create('body');
- var sel = editor.selection.getSel();
- var fragment;
- var ranges = $_atnm1d6yjjgwe8wr.processRanges(editor, $_2y1a8s4fjjgwe8fm.getRanges(sel));
- args = args || {};
- args.get = true;
- args.format = args.format || 'html';
- args.selection = true;
- args = editor.fire('BeforeGetContent', args);
- if (args.isDefaultPrevented()) {
- editor.fire('GetContent', args);
- return args.content;
- }
- if (args.format === 'text') {
- return editor.selection.isCollapsed() ? '' : $_2xw7ul2pjjgwe7xs.trim(rng.text || (sel.toString ? sel.toString() : ''));
- }
- if (rng.cloneContents) {
- fragment = args.contextual ? $_c5lgd70jjgwe8wz.read(Element$$1.fromDom(editor.getBody()), ranges).dom() : rng.cloneContents();
- if (fragment) {
- tmpElm.appendChild(fragment);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getTextContent = function (editor) {
+ return Option.from(editor.selection.getRng()).map(function (r) {
+ return Zwsp.trim(r.toString());
+ }).getOr('');
+ };
+ var getHtmlContent = function (editor, args) {
+ var rng = editor.selection.getRng(), tmpElm = editor.dom.create('body');
+ var sel = editor.selection.getSel();
+ var fragment;
+ var ranges = EventProcessRanges.processRanges(editor, MultiRange.getRanges(sel));
+ if (rng.cloneContents) {
+ fragment = args.contextual ? FragmentReader.read(Element$$1.fromDom(editor.getBody()), ranges).dom() : rng.cloneContents();
+ if (fragment) {
+ tmpElm.appendChild(fragment);
+ }
+ } else {
+ tmpElm.innerHTML = rng.toString();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else if (rng.item !== undefined || rng.htmlText !== undefined) {
- tmpElm.innerHTML = '<br>' + (rng.item ? rng.item(0).outerHTML : rng.htmlText);
- tmpElm.removeChild(tmpElm.firstChild);
- } else {
- tmpElm.innerHTML = rng.toString();
- }
- args.getInner = true;
- var content = editor.selection.serializer.serialize(tmpElm, args);
- if (args.format === 'tree') {
- return content;
- }
- args.content = editor.selection.isCollapsed() ? '' : content;
- editor.fire('GetContent', args);
- return args.content;
- };
- var $_41mrdx6zjjgwe8wu = { getContent: getContent };
-
- var setContent = function (editor, content, args) {
- var rng = editor.selection.getRng(), caretNode;
- var doc = editor.getDoc();
- var frag, temp;
- args = args || { format: 'html' };
- args.set = true;
- args.selection = true;
- args.content = content;
- if (!args.no_events) {
- args = editor.fire('BeforeSetContent', args);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return editor.selection.serializer.serialize(tmpElm, args);
+ };
+ var getContent = function (editor, args) {
+ if (args === void 0) {
+ args = {};
+ }
+ args.get = true;
+ args.format = args.format || 'html';
+ args.selection = true;
+ args = editor.fire('BeforeGetContent', args);
</ins><span class="cx" style="display: block; padding: 0 10px"> if (args.isDefaultPrevented()) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- editor.fire('SetContent', args);
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.fire('GetContent', args);
+ return args.content;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- content = args.content;
- if (rng.insertNode) {
- content += '<span id="__caret">_</span>';
- if (rng.startContainer === doc && rng.endContainer === doc) {
- doc.body.innerHTML = content;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (args.format === 'text') {
+ return getTextContent(editor);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- rng.deleteContents();
- if (doc.body.childNodes.length === 0) {
- doc.body.innerHTML = content;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ args.getInner = true;
+ var content = getHtmlContent(editor, args);
+ if (args.format === 'tree') {
+ return content;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (rng.createContextualFragment) {
- rng.insertNode(rng.createContextualFragment(content));
- } else {
- frag = doc.createDocumentFragment();
- temp = doc.createElement('div');
- frag.appendChild(temp);
- temp.outerHTML = content;
- rng.insertNode(frag);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ args.content = editor.selection.isCollapsed() ? '' : content;
+ editor.fire('GetContent', args);
+ return args.content;
</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">- caretNode = editor.dom.get('__caret');
- rng = doc.createRange();
- rng.setStartBefore(caretNode);
- rng.setEndBefore(caretNode);
- editor.selection.setRng(rng);
- editor.dom.remove('__caret');
- try {
- editor.selection.setRng(rng);
- } catch (ex) {
- }
- } else {
- if (rng.item) {
- doc.execCommand('Delete', false, null);
- rng = editor.getRng();
- }
- if (/^\s+/.test(content)) {
- rng.pasteHTML('<span id="__mce_tmp">_</span>' + content);
- editor.dom.remove('__mce_tmp');
- } else {
- rng.pasteHTML(content);
- }
- }
- if (!args.no_events) {
- editor.fire('SetContent', args);
- }
- };
- var $_e043ey73jjgwe8yg = { setContent: setContent };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var GetSelectionContent = { getContent: getContent };
</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 getEndpointElement = function (root, rng, start, real, resolve) {
- var container = start ? rng.startContainer : rng.endContainer;
- var offset = start ? rng.startOffset : rng.endOffset;
- return Option.from(container).map(Element$$1.fromDom).map(function (elm) {
- return !real || !rng.collapsed ? $_d3rmjp18jjgwe7nc.child(elm, resolve(elm, offset)).getOr(elm) : elm;
- }).bind(function (elm) {
- return $_fxxo5411jjgwe7lq.isElement(elm) ? Option.some(elm) : $_d3rmjp18jjgwe7nc.parent(elm);
- }).map(function (elm) {
- return elm.dom();
- }).getOr(root);
- };
- var getStart$2 = function (root, rng, real) {
- return getEndpointElement(root, rng, true, real, function (elm, offset) {
- return Math.min($_d3rmjp18jjgwe7nc.childNodesCount(elm), offset);
- });
- };
- var getEnd = function (root, rng, real) {
- return getEndpointElement(root, rng, false, real, function (elm, offset) {
- return offset > 0 ? offset - 1 : offset;
- });
- };
- var skipEmptyTextNodes = function (node, forwards) {
- var orig = node;
- while (node && $_3b9u2y1rjjgwe7qe.isText(node) && node.length === 0) {
- node = forwards ? node.nextSibling : node.previousSibling;
- }
- return node || orig;
- };
- var getNode$1 = function (root, rng) {
- var elm, startContainer, endContainer, startOffset, endOffset;
- if (!rng) {
- return root;
- }
- startContainer = rng.startContainer;
- endContainer = rng.endContainer;
- startOffset = rng.startOffset;
- endOffset = rng.endOffset;
- elm = rng.commonAncestorContainer;
- if (!rng.collapsed) {
- if (startContainer === endContainer) {
- if (endOffset - startOffset < 2) {
- if (startContainer.hasChildNodes()) {
- elm = startContainer.childNodes[startOffset];
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setContent = function (editor, content, args) {
+ var rng = editor.selection.getRng(), caretNode;
+ var doc = editor.getDoc();
+ var frag, temp;
+ args = args || { format: 'html' };
+ args.set = true;
+ args.selection = true;
+ args.content = content;
+ if (!args.no_events) {
+ args = editor.fire('BeforeSetContent', args);
+ if (args.isDefaultPrevented()) {
+ editor.fire('SetContent', args);
+ return;
</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">- if (startContainer.nodeType === 3 && endContainer.nodeType === 3) {
- if (startContainer.length === startOffset) {
- startContainer = skipEmptyTextNodes(startContainer.nextSibling, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ content = args.content;
+ if (rng.insertNode) {
+ content += '<span id="__caret">_</span>';
+ if (rng.startContainer === doc && rng.endContainer === doc) {
+ doc.body.innerHTML = content;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- startContainer = startContainer.parentNode;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rng.deleteContents();
+ if (doc.body.childNodes.length === 0) {
+ doc.body.innerHTML = content;
+ } else {
+ if (rng.createContextualFragment) {
+ rng.insertNode(rng.createContextualFragment(content));
+ } else {
+ frag = doc.createDocumentFragment();
+ temp = doc.createElement('div');
+ frag.appendChild(temp);
+ temp.outerHTML = content;
+ rng.insertNode(frag);
+ }
+ }
</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 (endOffset === 0) {
- endContainer = skipEmptyTextNodes(endContainer.previousSibling, false);
- } else {
- endContainer = endContainer.parentNode;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ caretNode = editor.dom.get('__caret');
+ rng = doc.createRange();
+ rng.setStartBefore(caretNode);
+ rng.setEndBefore(caretNode);
+ editor.selection.setRng(rng);
+ editor.dom.remove('__caret');
+ try {
+ editor.selection.setRng(rng);
+ } catch (ex) {
</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 (startContainer && startContainer === endContainer) {
- return startContainer;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ if (rng.item) {
+ doc.execCommand('Delete', false, null);
+ rng = editor.getRng();
</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 (elm && elm.nodeType === 3) {
- return elm.parentNode;
- }
- return elm;
- };
- var getSelectedBlocks = function (dom, rng, startElm, endElm) {
- var node, root;
- var selectedBlocks = [];
- root = dom.getRoot();
- startElm = dom.getParent(startElm || getStart$2(root, rng, false), dom.isBlock);
- endElm = dom.getParent(endElm || getEnd(root, rng, false), dom.isBlock);
- if (startElm && startElm !== root) {
- selectedBlocks.push(startElm);
- }
- if (startElm && endElm && startElm !== endElm) {
- node = startElm;
- var walker = new TreeWalker(startElm, root);
- while ((node = walker.next()) && node !== endElm) {
- if (dom.isBlock(node)) {
- selectedBlocks.push(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (/^\s+/.test(content)) {
+ rng.pasteHTML('<span id="__mce_tmp">_</span>' + content);
+ editor.dom.remove('__mce_tmp');
+ } else {
+ rng.pasteHTML(content);
</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">- }
- if (endElm && startElm !== endElm && endElm !== root) {
- selectedBlocks.push(endElm);
- }
- return selectedBlocks;
- };
- var select$1 = function (dom, node, content) {
- return Option.from(node).map(function (node) {
- var idx = dom.nodeIndex(node);
- var rng = dom.createRng();
- rng.setStart(node.parentNode, idx);
- rng.setEnd(node.parentNode, idx + 1);
- if (content) {
- moveEndPoint$1(dom, rng, node, true);
- moveEndPoint$1(dom, rng, node, false);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!args.no_events) {
+ editor.fire('SetContent', args);
</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 rng;
- });
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var SetSelectionContent = { setContent: setContent };
</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 each$19 = $_6cwiepljjgwe7j4.each;
- var isNativeIeSelection = function (rng) {
- return !!rng.select;
- };
- var isAttachedToDom = function (node) {
- return !!(node && node.ownerDocument) && $_5raon11ejjgwe7o5.contains(Element$$1.fromDom(node.ownerDocument), Element$$1.fromDom(node));
- };
- var isValidRange = function (rng) {
- if (!rng) {
- return false;
- } else if (isNativeIeSelection(rng)) {
- return true;
- } else {
- return isAttachedToDom(rng.startContainer) && isAttachedToDom(rng.endContainer);
- }
- };
- var Selection$1 = function (dom, win, serializer, editor) {
- var bookmarkManager, controlSelection;
- var selectedRange, explicitRange, selectorChangedData;
- var setCursorLocation = function (node, offset) {
- var rng = dom.createRng();
- if (!node) {
- moveEndPoint$1(dom, rng, editor.getBody(), true);
- setRng(rng);
- } else {
- rng.setStart(node, offset);
- rng.setEnd(node, offset);
- setRng(rng);
- collapse(false);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getEndpointElement = function (root, rng, start, real, resolve) {
+ var container = start ? rng.startContainer : rng.endContainer;
+ var offset = start ? rng.startOffset : rng.endOffset;
+ return Option.from(container).map(Element$$1.fromDom).map(function (elm) {
+ return !real || !rng.collapsed ? child(elm, resolve(elm, offset)).getOr(elm) : elm;
+ }).bind(function (elm) {
+ return isElement(elm) ? Option.some(elm) : parent(elm);
+ }).map(function (elm) {
+ return elm.dom();
+ }).getOr(root);
</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 getContent = function (args) {
- return $_41mrdx6zjjgwe8wu.getContent(editor, args);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getStart$2 = function (root, rng, real) {
+ return getEndpointElement(root, rng, true, real, function (elm, offset) {
+ return Math.min(childNodesCount(elm), 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 setContent = function (content, args) {
- return $_e043ey73jjgwe8yg.setContent(editor, content, args);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getEnd = function (root, rng, real) {
+ return getEndpointElement(root, rng, false, real, function (elm, offset) {
+ return offset > 0 ? offset - 1 : 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 getStart = function (real) {
- return getStart$2(editor.getBody(), getRng(), real);
- };
- var getEnd$$1 = function (real) {
- return getEnd(editor.getBody(), getRng(), real);
- };
- var getBookmark = function (type, normalized) {
- return bookmarkManager.getBookmark(type, normalized);
- };
- var moveToBookmark = function (bookmark) {
- return bookmarkManager.moveToBookmark(bookmark);
- };
- var select = function (node, content) {
- select$1(dom, node, content).each(setRng);
- return node;
- };
- var isCollapsed = function () {
- var rng = getRng(), sel = getSel();
- if (!rng || rng.item) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var skipEmptyTextNodes = function (node, forwards) {
+ var orig = node;
+ while (node && NodeType.isText(node) && node.length === 0) {
+ node = forwards ? node.nextSibling : node.previousSibling;
</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.compareEndPoints) {
- return rng.compareEndPoints('StartToEnd', rng) === 0;
- }
- return !sel || rng.collapsed;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return node || orig;
</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 collapse = function (toStart) {
- var rng = getRng();
- rng.collapse(!!toStart);
- setRng(rng);
- };
- var getSel = function () {
- return win.getSelection ? win.getSelection() : win.document.selection;
- };
- var getRng = function () {
- var selection, rng, elm, doc;
- var tryCompareBoundaryPoints = function (how, sourceRange, destinationRange) {
- try {
- return sourceRange.compareBoundaryPoints(how, destinationRange);
- } catch (ex) {
- return -1;
- }
- };
- if (!win) {
- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getNode$1 = function (root, rng) {
+ var elm, startContainer, endContainer, startOffset, endOffset;
+ if (!rng) {
+ return root;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- doc = win.document;
- if (typeof doc === 'undefined' || doc === null) {
- return null;
- }
- if (editor.bookmark !== undefined && $_5eyh7w4vjjgwe8ik.hasFocus(editor) === false) {
- var bookmark = $_4wtqbt4ljjgwe8gy.getRng(editor);
- if (bookmark.isSome()) {
- return bookmark.map(function (r) {
- return $_atnm1d6yjjgwe8wr.processRanges(editor, [r])[0];
- }).getOr(doc.createRange());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ startContainer = rng.startContainer;
+ endContainer = rng.endContainer;
+ startOffset = rng.startOffset;
+ endOffset = rng.endOffset;
+ elm = rng.commonAncestorContainer;
+ if (!rng.collapsed) {
+ if (startContainer === endContainer) {
+ if (endOffset - startOffset < 2) {
+ if (startContainer.hasChildNodes()) {
+ elm = startContainer.childNodes[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">- }
- try {
- if (selection = getSel()) {
- if (selection.rangeCount > 0) {
- rng = selection.getRangeAt(0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (startContainer.nodeType === 3 && endContainer.nodeType === 3) {
+ if (startContainer.length === startOffset) {
+ startContainer = skipEmptyTextNodes(startContainer.nextSibling, true);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- rng = selection.createRange ? selection.createRange() : doc.createRange();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ startContainer = startContainer.parentNode;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (endOffset === 0) {
+ endContainer = skipEmptyTextNodes(endContainer.previousSibling, false);
+ } else {
+ endContainer = endContainer.parentNode;
+ }
+ if (startContainer && startContainer === endContainer) {
+ return startContainer;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } catch (ex) {
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- rng = $_atnm1d6yjjgwe8wr.processRanges(editor, [rng])[0];
- if (!rng) {
- rng = doc.createRange ? doc.createRange() : doc.body.createTextRange();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (elm && elm.nodeType === 3) {
+ return 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">- if (rng.setStart && rng.startContainer.nodeType === 9 && rng.collapsed) {
- elm = dom.getRoot();
- rng.setStart(elm, 0);
- rng.setEnd(elm, 0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return elm;
+ };
+ var getSelectedBlocks = function (dom, rng, startElm, endElm) {
+ var node, root;
+ var selectedBlocks = [];
+ root = dom.getRoot();
+ startElm = dom.getParent(startElm || getStart$2(root, rng, rng.collapsed), dom.isBlock);
+ endElm = dom.getParent(endElm || getEnd(root, rng, rng.collapsed), dom.isBlock);
+ if (startElm && startElm !== root) {
+ selectedBlocks.push(startElm);
</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 (selectedRange && explicitRange) {
- if (tryCompareBoundaryPoints(rng.START_TO_START, rng, selectedRange) === 0 && tryCompareBoundaryPoints(rng.END_TO_END, rng, selectedRange) === 0) {
- rng = explicitRange;
- } else {
- selectedRange = null;
- explicitRange = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (startElm && endElm && startElm !== endElm) {
+ node = startElm;
+ var walker = new TreeWalker(startElm, root);
+ while ((node = walker.next()) && node !== endElm) {
+ if (dom.isBlock(node)) {
+ selectedBlocks.push(node);
+ }
</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">- return rng;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (endElm && startElm !== endElm && endElm !== root) {
+ selectedBlocks.push(endElm);
+ }
+ return selectedBlocks;
</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 setRng = function (rng, forward) {
- var sel, node, evt;
- if (!isValidRange(rng)) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var select$1 = function (dom, node, content) {
+ return Option.from(node).map(function (node) {
+ var idx = dom.nodeIndex(node);
+ var rng = dom.createRng();
+ rng.setStart(node.parentNode, idx);
+ rng.setEnd(node.parentNode, idx + 1);
+ if (content) {
+ moveEndPoint$1(dom, rng, node, true);
+ moveEndPoint$1(dom, rng, node, false);
+ }
+ return rng;
+ });
+ };
+
+ var each$j = Tools.each;
+ var isNativeIeSelection = function (rng) {
+ return !!rng.select;
+ };
+ var isAttachedToDom = function (node) {
+ return !!(node && node.ownerDocument) && contains$3(Element$$1.fromDom(node.ownerDocument), Element$$1.fromDom(node));
+ };
+ var isValidRange = function (rng) {
+ if (!rng) {
+ return false;
+ } else if (isNativeIeSelection(rng)) {
+ return true;
+ } else {
+ return isAttachedToDom(rng.startContainer) && isAttachedToDom(rng.endContainer);
</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 ieRange = isNativeIeSelection(rng) ? rng : null;
- if (ieRange) {
- explicitRange = null;
- try {
- ieRange.select();
- } catch (ex) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var Selection = function (dom, win, serializer, editor) {
+ var bookmarkManager, controlSelection;
+ var selectedRange, explicitRange, selectorChangedData;
+ var setCursorLocation = function (node, offset) {
+ var rng = dom.createRng();
+ if (!node) {
+ moveEndPoint$1(dom, rng, editor.getBody(), true);
+ setRng(rng);
+ } else {
+ rng.setStart(node, offset);
+ rng.setEnd(node, offset);
+ setRng(rng);
+ collapse(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;
- }
- sel = getSel();
- evt = editor.fire('SetSelectionRange', {
- range: rng,
- forward: forward
- });
- rng = evt.range;
- if (sel) {
- explicitRange = rng;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var getContent = function (args) {
+ return GetSelectionContent.getContent(editor, args);
+ };
+ var setContent = function (content, args) {
+ return SetSelectionContent.setContent(editor, content, args);
+ };
+ var getStart = function (real) {
+ return getStart$2(editor.getBody(), getRng(), real);
+ };
+ var getEnd$$1 = function (real) {
+ return getEnd(editor.getBody(), getRng(), real);
+ };
+ var getBookmark = function (type, normalized) {
+ return bookmarkManager.getBookmark(type, normalized);
+ };
+ var moveToBookmark = function (bookmark) {
+ return bookmarkManager.moveToBookmark(bookmark);
+ };
+ var select = function (node, content) {
+ select$1(dom, node, content).each(setRng);
+ return node;
+ };
+ var isCollapsed = function () {
+ var rng = getRng(), sel = getSel();
+ if (!rng || rng.item) {
+ return false;
+ }
+ if (rng.compareEndPoints) {
+ return rng.compareEndPoints('StartToEnd', rng) === 0;
+ }
+ return !sel || rng.collapsed;
+ };
+ var collapse = function (toStart) {
+ var rng = getRng();
+ rng.collapse(!!toStart);
+ setRng(rng);
+ };
+ var getSel = function () {
+ return win.getSelection ? win.getSelection() : win.document.selection;
+ };
+ var getRng = function () {
+ var selection, rng, elm, doc;
+ var tryCompareBoundaryPoints = function (how, sourceRange, destinationRange) {
+ try {
+ return sourceRange.compareBoundaryPoints(how, destinationRange);
+ } catch (ex) {
+ return -1;
+ }
+ };
+ if (!win) {
+ return null;
+ }
+ doc = win.document;
+ if (typeof doc === 'undefined' || doc === null) {
+ return null;
+ }
+ if (editor.bookmark !== undefined && EditorFocus.hasFocus(editor) === false) {
+ var bookmark = SelectionBookmark.getRng(editor);
+ if (bookmark.isSome()) {
+ return bookmark.map(function (r) {
+ return EventProcessRanges.processRanges(editor, [r])[0];
+ }).getOr(doc.createRange());
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> try {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- sel.removeAllRanges();
- sel.addRange(rng);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (selection = getSel()) {
+ if (selection.rangeCount > 0) {
+ rng = selection.getRangeAt(0);
+ } else {
+ rng = selection.createRange ? selection.createRange() : doc.createRange();
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } catch (ex) {
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (forward === false && sel.extend) {
- sel.collapse(rng.endContainer, rng.endOffset);
- sel.extend(rng.startContainer, rng.startOffset);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rng = EventProcessRanges.processRanges(editor, [rng])[0];
+ if (!rng) {
+ rng = doc.createRange ? doc.createRange() : doc.body.createTextRange();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- selectedRange = sel.rangeCount > 0 ? sel.getRangeAt(0) : null;
- }
- if (!rng.collapsed && rng.startContainer === rng.endContainer && sel.setBaseAndExtent && !$_bcvfv9ajjgwe79v.ie) {
- if (rng.endOffset - rng.startOffset < 2) {
- if (rng.startContainer.hasChildNodes()) {
- node = rng.startContainer.childNodes[rng.startOffset];
- if (node && node.tagName === 'IMG') {
- sel.setBaseAndExtent(rng.startContainer, rng.startOffset, rng.endContainer, rng.endOffset);
- if (sel.anchorNode !== rng.startContainer || sel.focusNode !== rng.endContainer) {
- sel.setBaseAndExtent(node, 0, node, 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rng.setStart && rng.startContainer.nodeType === 9 && rng.collapsed) {
+ elm = dom.getRoot();
+ rng.setStart(elm, 0);
+ rng.setEnd(elm, 0);
+ }
+ if (selectedRange && explicitRange) {
+ if (tryCompareBoundaryPoints(rng.START_TO_START, rng, selectedRange) === 0 && tryCompareBoundaryPoints(rng.END_TO_END, rng, selectedRange) === 0) {
+ rng = explicitRange;
+ } else {
+ selectedRange = null;
+ explicitRange = null;
+ }
+ }
+ return rng;
+ };
+ var setRng = function (rng, forward) {
+ var sel, node, evt;
+ if (!isValidRange(rng)) {
+ return;
+ }
+ var ieRange = isNativeIeSelection(rng) ? rng : null;
+ if (ieRange) {
+ explicitRange = null;
+ try {
+ ieRange.select();
+ } catch (ex) {
+ }
+ return;
+ }
+ sel = getSel();
+ evt = editor.fire('SetSelectionRange', {
+ range: rng,
+ forward: forward
+ });
+ rng = evt.range;
+ if (sel) {
+ explicitRange = rng;
+ try {
+ sel.removeAllRanges();
+ sel.addRange(rng);
+ } catch (ex) {
+ }
+ if (forward === false && sel.extend) {
+ sel.collapse(rng.endContainer, rng.endOffset);
+ sel.extend(rng.startContainer, rng.startOffset);
+ }
+ selectedRange = sel.rangeCount > 0 ? sel.getRangeAt(0) : null;
+ }
+ if (!rng.collapsed && rng.startContainer === rng.endContainer && sel.setBaseAndExtent && !Env.ie) {
+ if (rng.endOffset - rng.startOffset < 2) {
+ if (rng.startContainer.hasChildNodes()) {
+ node = rng.startContainer.childNodes[rng.startOffset];
+ if (node && node.tagName === 'IMG') {
+ sel.setBaseAndExtent(rng.startContainer, rng.startOffset, rng.endContainer, rng.endOffset);
+ if (sel.anchorNode !== rng.startContainer || sel.focusNode !== rng.endContainer) {
+ sel.setBaseAndExtent(node, 0, node, 1);
+ }
</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="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- editor.fire('AfterSetSelectionRange', {
- range: rng,
- forward: forward
- });
- };
- var setNode = function (elm) {
- setContent(dom.getOuterHTML(elm));
- return elm;
- };
- var getNode = function () {
- return getNode$1(editor.getBody(), getRng());
- };
- var getSelectedBlocks$$1 = function (startElm, endElm) {
- return getSelectedBlocks(dom, getRng(), startElm, endElm);
- };
- var isForward = function () {
- var sel = getSel();
- var anchorRange, focusRange;
- if (!sel || !sel.anchorNode || !sel.focusNode) {
- return true;
- }
- anchorRange = dom.createRng();
- anchorRange.setStart(sel.anchorNode, sel.anchorOffset);
- anchorRange.collapse(true);
- focusRange = dom.createRng();
- focusRange.setStart(sel.focusNode, sel.focusOffset);
- focusRange.collapse(true);
- return anchorRange.compareBoundaryPoints(anchorRange.START_TO_START, focusRange) <= 0;
- };
- var normalize = function () {
- var rng = getRng();
- var sel = getSel();
- if (!$_2y1a8s4fjjgwe8fm.hasMultipleRanges(sel) && hasAnyRanges(editor)) {
- var normRng = $_eqgqyj4jjjgwe8gi.normalize(dom, rng);
- normRng.each(function (normRng) {
- setRng(normRng, isForward());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.fire('AfterSetSelectionRange', {
+ range: rng,
+ forward: forward
</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 normRng.getOr(rng);
- }
- return rng;
- };
- var selectorChanged = function (selector, callback) {
- var currentSelectors;
- if (!selectorChangedData) {
- selectorChangedData = {};
- currentSelectors = {};
- editor.on('NodeChange', function (e) {
- var node = e.element, parents = dom.getParents(node, null, dom.getRoot()), matchedSelectors = {};
- each$19(selectorChangedData, function (callbacks, selector) {
- each$19(parents, function (node) {
- if (dom.is(node, selector)) {
- if (!currentSelectors[selector]) {
- each$19(callbacks, function (callback) {
- callback(true, {
- node: node,
- selector: selector,
- parents: parents
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var setNode = function (elm) {
+ setContent(dom.getOuterHTML(elm));
+ return elm;
+ };
+ var getNode = function () {
+ return getNode$1(editor.getBody(), getRng());
+ };
+ var getSelectedBlocks$$1 = function (startElm, endElm) {
+ return getSelectedBlocks(dom, getRng(), startElm, endElm);
+ };
+ var isForward = function () {
+ var sel = getSel();
+ var anchorRange, focusRange;
+ if (!sel || !sel.anchorNode || !sel.focusNode) {
+ return true;
+ }
+ anchorRange = dom.createRng();
+ anchorRange.setStart(sel.anchorNode, sel.anchorOffset);
+ anchorRange.collapse(true);
+ focusRange = dom.createRng();
+ focusRange.setStart(sel.focusNode, sel.focusOffset);
+ focusRange.collapse(true);
+ return anchorRange.compareBoundaryPoints(anchorRange.START_TO_START, focusRange) <= 0;
+ };
+ var normalize = function () {
+ var rng = getRng();
+ var sel = getSel();
+ if (!MultiRange.hasMultipleRanges(sel) && hasAnyRanges(editor)) {
+ var normRng = NormalizeRange.normalize(dom, rng);
+ normRng.each(function (normRng) {
+ setRng(normRng, isForward());
+ });
+ return normRng.getOr(rng);
+ }
+ return rng;
+ };
+ var selectorChanged = function (selector, callback) {
+ var currentSelectors;
+ if (!selectorChangedData) {
+ selectorChangedData = {};
+ currentSelectors = {};
+ editor.on('NodeChange', function (e) {
+ var node = e.element, parents = dom.getParents(node, null, dom.getRoot()), matchedSelectors = {};
+ each$j(selectorChangedData, function (callbacks, selector) {
+ each$j(parents, function (node) {
+ if (dom.is(node, selector)) {
+ if (!currentSelectors[selector]) {
+ each$j(callbacks, function (callback) {
+ callback(true, {
+ node: node,
+ selector: selector,
+ parents: parents
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ currentSelectors[selector] = callbacks;
+ }
+ matchedSelectors[selector] = callbacks;
+ return false;
+ }
+ });
+ });
+ each$j(currentSelectors, function (callbacks, selector) {
+ if (!matchedSelectors[selector]) {
+ delete currentSelectors[selector];
+ each$j(callbacks, function (callback) {
+ callback(false, {
+ node: node,
+ selector: selector,
+ parents: parents
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- currentSelectors[selector] = callbacks;
- }
- matchedSelectors[selector] = callbacks;
- return false;
</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><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">- each$19(currentSelectors, function (callbacks, selector) {
- if (!matchedSelectors[selector]) {
- delete currentSelectors[selector];
- each$19(callbacks, function (callback) {
- callback(false, {
- node: node,
- selector: selector,
- parents: parents
- });
- });
- }
- });
- });
- }
- if (!selectorChangedData[selector]) {
- selectorChangedData[selector] = [];
- }
- selectorChangedData[selector].push(callback);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ if (!selectorChangedData[selector]) {
+ selectorChangedData[selector] = [];
+ }
+ selectorChangedData[selector].push(callback);
+ return exports;
+ };
+ var getScrollContainer = function () {
+ var scrollContainer;
+ var node = dom.getRoot();
+ while (node && node.nodeName !== 'BODY') {
+ if (node.scrollHeight > node.clientHeight) {
+ scrollContainer = node;
+ break;
+ }
+ node = node.parentNode;
+ }
+ return scrollContainer;
+ };
+ var scrollIntoView = function (elm, alignToTop) {
+ return ScrollIntoView.scrollElementIntoView(editor, elm, alignToTop);
+ };
+ var placeCaretAt = function (clientX, clientY) {
+ return setRng(CaretRangeFromPoint.fromPoint(clientX, clientY, editor.getDoc()));
+ };
+ var getBoundingClientRect = function () {
+ var rng = getRng();
+ return rng.collapsed ? CaretPosition$1.fromRangeStart(rng).getClientRects()[0] : rng.getBoundingClientRect();
+ };
+ var destroy = function () {
+ win = selectedRange = explicitRange = null;
+ controlSelection.destroy();
+ };
+ var exports = {
+ bookmarkManager: null,
+ controlSelection: null,
+ dom: dom,
+ win: win,
+ serializer: serializer,
+ editor: editor,
+ collapse: collapse,
+ setCursorLocation: setCursorLocation,
+ getContent: getContent,
+ setContent: setContent,
+ getBookmark: getBookmark,
+ moveToBookmark: moveToBookmark,
+ select: select,
+ isCollapsed: isCollapsed,
+ isForward: isForward,
+ setNode: setNode,
+ getNode: getNode,
+ getSel: getSel,
+ setRng: setRng,
+ getRng: getRng,
+ getStart: getStart,
+ getEnd: getEnd$$1,
+ getSelectedBlocks: getSelectedBlocks$$1,
+ normalize: normalize,
+ selectorChanged: selectorChanged,
+ getScrollContainer: getScrollContainer,
+ scrollIntoView: scrollIntoView,
+ placeCaretAt: placeCaretAt,
+ getBoundingClientRect: getBoundingClientRect,
+ destroy: destroy
+ };
+ bookmarkManager = BookmarkManager$1(exports);
+ controlSelection = ControlSelection(exports, editor);
+ exports.bookmarkManager = bookmarkManager;
+ exports.controlSelection = controlSelection;
</ins><span class="cx" style="display: block; padding: 0 10px"> return exports;
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var getScrollContainer = function () {
- var scrollContainer;
- var node = dom.getRoot();
- while (node && node.nodeName !== 'BODY') {
- if (node.scrollHeight > node.clientHeight) {
- scrollContainer = node;
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var isContentEditableFalse$b = NodeType.isContentEditableFalse;
+ var getSelectedNode$1 = getSelectedNode;
+ var isAfterContentEditableFalse$2 = isAfterContentEditableFalse;
+ var isBeforeContentEditableFalse$2 = isBeforeContentEditableFalse;
+ var getVisualCaretPosition = function (walkFn, caretPosition) {
+ while (caretPosition = walkFn(caretPosition)) {
+ if (caretPosition.isVisible()) {
+ return caretPosition;
</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><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return scrollContainer;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return caretPosition;
</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 scrollIntoView = function (elm, alignToTop) {
- return $_1mgvl137jjgwe825.scrollElementIntoView(editor, elm, alignToTop);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isMoveInsideSameBlock = function (from, to) {
+ var inSameBlock = isInSameBlock(from, to);
+ if (!inSameBlock && NodeType.isBr(from.getNode())) {
+ return true;
+ }
+ return inSameBlock;
</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 placeCaretAt = function (clientX, clientY) {
- return setRng($_269jak6xjjgwe8wp.fromPoint(clientX, clientY, editor.getDoc()));
- };
- var getBoundingClientRect = function () {
- var rng = getRng();
- return rng.collapsed ? CaretPosition$1.fromRangeStart(rng).getClientRects()[0] : rng.getBoundingClientRect();
- };
- var destroy = function () {
- win = selectedRange = explicitRange = null;
- controlSelection.destroy();
- };
- var exports = {
- bookmarkManager: null,
- controlSelection: null,
- dom: dom,
- win: win,
- serializer: serializer,
- editor: editor,
- collapse: collapse,
- setCursorLocation: setCursorLocation,
- getContent: getContent,
- setContent: setContent,
- getBookmark: getBookmark,
- moveToBookmark: moveToBookmark,
- select: select,
- isCollapsed: isCollapsed,
- isForward: isForward,
- setNode: setNode,
- getNode: getNode,
- getSel: getSel,
- setRng: setRng,
- getRng: getRng,
- getStart: getStart,
- getEnd: getEnd$$1,
- getSelectedBlocks: getSelectedBlocks$$1,
- normalize: normalize,
- selectorChanged: selectorChanged,
- getScrollContainer: getScrollContainer,
- scrollIntoView: scrollIntoView,
- placeCaretAt: placeCaretAt,
- getBoundingClientRect: getBoundingClientRect,
- destroy: destroy
- };
- bookmarkManager = BookmarkManager$1(exports);
- controlSelection = ControlSelection(exports, editor);
- exports.bookmarkManager = bookmarkManager;
- exports.controlSelection = controlSelection;
- return exports;
- };
-
- var isContentEditableFalse$11 = $_3b9u2y1rjjgwe7qe.isContentEditableFalse;
- var getSelectedNode$1 = getSelectedNode;
- var isAfterContentEditableFalse$2 = isAfterContentEditableFalse;
- var isBeforeContentEditableFalse$2 = isBeforeContentEditableFalse;
- var getVisualCaretPosition = function (walkFn, caretPosition) {
- while (caretPosition = walkFn(caretPosition)) {
- if (caretPosition.isVisible()) {
- return caretPosition;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var moveToCeFalseHorizontally = function (direction, editor, getNextPosFn, range$$1) {
+ var node, caretPosition, peekCaretPosition, rangeIsInContainerBlock;
+ var forwards = direction === HDirection.Forwards;
+ var isBeforeContentEditableFalseFn = forwards ? isBeforeContentEditableFalse$2 : isAfterContentEditableFalse$2;
+ if (!range$$1.collapsed) {
+ node = getSelectedNode$1(range$$1);
+ if (isContentEditableFalse$b(node)) {
+ return showCaret(direction, editor, node, direction === HDirection.Backwards, 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 caretPosition;
- };
- var isMoveInsideSameBlock = function (from, to) {
- var inSameBlock = isInSameBlock(from, to);
- if (!inSameBlock && $_3b9u2y1rjjgwe7qe.isBr(from.getNode())) {
- return true;
- }
- return inSameBlock;
- };
- var moveToCeFalseHorizontally = function (direction, editor, getNextPosFn, range) {
- var node, caretPosition, peekCaretPosition, rangeIsInContainerBlock;
- var forwards = direction === HDirection.Forwards;
- var isBeforeContentEditableFalseFn = forwards ? isBeforeContentEditableFalse$2 : isAfterContentEditableFalse$2;
- if (!range.collapsed) {
- node = getSelectedNode$1(range);
- if (isContentEditableFalse$11(node)) {
- return showCaret(direction, editor, node, direction === HDirection.Backwards, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rangeIsInContainerBlock = isRangeInCaretContainerBlock(range$$1);
+ caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range$$1);
+ if (isBeforeContentEditableFalseFn(caretPosition)) {
+ return selectNode(editor, caretPosition.getNode(!forwards));
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- rangeIsInContainerBlock = isRangeInCaretContainerBlock(range);
- caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range);
- if (isBeforeContentEditableFalseFn(caretPosition)) {
- return selectNode(editor, caretPosition.getNode(!forwards));
- }
- caretPosition = getNextPosFn(caretPosition);
- if (!caretPosition) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ caretPosition = getNextPosFn(caretPosition);
+ if (!caretPosition) {
+ if (rangeIsInContainerBlock) {
+ return range$$1;
+ }
+ return null;
+ }
+ if (isBeforeContentEditableFalseFn(caretPosition)) {
+ return showCaret(direction, editor, caretPosition.getNode(!forwards), forwards, true);
+ }
+ peekCaretPosition = getNextPosFn(caretPosition);
+ if (isBeforeContentEditableFalseFn(peekCaretPosition)) {
+ if (isMoveInsideSameBlock(caretPosition, peekCaretPosition)) {
+ return showCaret(direction, editor, peekCaretPosition.getNode(!forwards), forwards, true);
+ }
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> if (rangeIsInContainerBlock) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return range;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return renderRangeCaret(editor, caretPosition.toRange(), true);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return null;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (isBeforeContentEditableFalseFn(caretPosition)) {
- return showCaret(direction, editor, caretPosition.getNode(!forwards), forwards, true);
- }
- peekCaretPosition = getNextPosFn(caretPosition);
- if (isBeforeContentEditableFalseFn(peekCaretPosition)) {
- if (isMoveInsideSameBlock(caretPosition, peekCaretPosition)) {
- return showCaret(direction, editor, peekCaretPosition.getNode(!forwards), forwards, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var moveToCeFalseVertically = function (direction, editor, walkerFn, range$$1) {
+ var caretPosition, linePositions, nextLinePositions;
+ var closestNextLineRect, caretClientRect, clientX;
+ var dist1, dist2, contentEditableFalseNode;
+ contentEditableFalseNode = getSelectedNode$1(range$$1);
+ caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range$$1);
+ linePositions = walkerFn(editor.getBody(), isAboveLine(1), caretPosition);
+ nextLinePositions = filter(linePositions, isLine(1));
+ caretClientRect = ArrUtils.last(caretPosition.getClientRects());
+ if (isBeforeContentEditableFalse$2(caretPosition) || isBeforeTable(caretPosition)) {
+ contentEditableFalseNode = caretPosition.getNode();
</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 (rangeIsInContainerBlock) {
- return renderRangeCaret(editor, caretPosition.toRange(), true);
- }
- return null;
- };
- var moveToCeFalseVertically = function (direction, editor, walkerFn, range) {
- var caretPosition, linePositions, nextLinePositions;
- var closestNextLineRect, caretClientRect, clientX;
- var dist1, dist2, contentEditableFalseNode;
- contentEditableFalseNode = getSelectedNode$1(range);
- caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range);
- linePositions = walkerFn(editor.getBody(), isAboveLine(1), caretPosition);
- nextLinePositions = $_6t4axrmjjgwe7jf.filter(linePositions, isLine(1));
- caretClientRect = $_6t4axrmjjgwe7jf.last(caretPosition.getClientRects());
- if (isBeforeContentEditableFalse$2(caretPosition) || isBeforeTable(caretPosition)) {
- contentEditableFalseNode = caretPosition.getNode();
- }
- if (isAfterContentEditableFalse$2(caretPosition) || isAfterTable(caretPosition)) {
- contentEditableFalseNode = caretPosition.getNode(true);
- }
- if (!caretClientRect) {
- return null;
- }
- clientX = caretClientRect.left;
- closestNextLineRect = findClosestClientRect(nextLinePositions, clientX);
- if (closestNextLineRect) {
- if (isContentEditableFalse$11(closestNextLineRect.node)) {
- dist1 = Math.abs(clientX - closestNextLineRect.left);
- dist2 = Math.abs(clientX - closestNextLineRect.right);
- return showCaret(direction, editor, closestNextLineRect.node, dist1 < dist2, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isAfterContentEditableFalse$2(caretPosition) || isAfterTable(caretPosition)) {
+ contentEditableFalseNode = caretPosition.getNode(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 (contentEditableFalseNode) {
- var caretPositions = positionsUntil(direction, editor.getBody(), isAboveLine(1), contentEditableFalseNode);
- closestNextLineRect = findClosestClientRect($_6t4axrmjjgwe7jf.filter(caretPositions, isLine(1)), clientX);
- if (closestNextLineRect) {
- return renderRangeCaret(editor, closestNextLineRect.position.toRange(), true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!caretClientRect) {
+ return 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">- closestNextLineRect = $_6t4axrmjjgwe7jf.last($_6t4axrmjjgwe7jf.filter(caretPositions, isLine(0)));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ clientX = caretClientRect.left;
+ closestNextLineRect = findClosestClientRect(nextLinePositions, clientX);
</ins><span class="cx" style="display: block; padding: 0 10px"> if (closestNextLineRect) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return renderRangeCaret(editor, closestNextLineRect.position.toRange(), true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isContentEditableFalse$b(closestNextLineRect.node)) {
+ dist1 = Math.abs(clientX - closestNextLineRect.left);
+ dist2 = Math.abs(clientX - closestNextLineRect.right);
+ return showCaret(direction, editor, closestNextLineRect.node, dist1 < dist2, 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">- }
- };
- var createTextBlock = function (editor) {
- var textBlock = editor.dom.create(editor.settings.forced_root_block);
- if (!$_bcvfv9ajjgwe79v.ie || $_bcvfv9ajjgwe79v.ie >= 11) {
- textBlock.innerHTML = '<br data-mce-bogus="1">';
- }
- return textBlock;
- };
- var exitPreBlock = function (editor, direction, range) {
- var pre, caretPos, newBlock;
- var caretWalker = CaretWalker(editor.getBody());
- var getNextVisualCaretPosition = $_4127e12ljjgwe7ww.curry(getVisualCaretPosition, caretWalker.next);
- var getPrevVisualCaretPosition = $_4127e12ljjgwe7ww.curry(getVisualCaretPosition, caretWalker.prev);
- if (range.collapsed && editor.settings.forced_root_block) {
- pre = editor.dom.getParent(range.startContainer, 'PRE');
- if (!pre) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (contentEditableFalseNode) {
+ var caretPositions = positionsUntil(direction, editor.getBody(), isAboveLine(1), contentEditableFalseNode);
+ closestNextLineRect = findClosestClientRect(filter(caretPositions, isLine(1)), clientX);
+ if (closestNextLineRect) {
+ return renderRangeCaret(editor, closestNextLineRect.position.toRange(), true);
+ }
+ closestNextLineRect = ArrUtils.last(filter(caretPositions, isLine(0)));
+ if (closestNextLineRect) {
+ return renderRangeCaret(editor, closestNextLineRect.position.toRange(), 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 (direction === 1) {
- caretPos = getNextVisualCaretPosition(CaretPosition$1.fromRangeStart(range));
- } else {
- caretPos = getPrevVisualCaretPosition(CaretPosition$1.fromRangeStart(range));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var createTextBlock = function (editor) {
+ var textBlock = editor.dom.create(editor.settings.forced_root_block);
+ if (!Env.ie || Env.ie >= 11) {
+ textBlock.innerHTML = '<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">- if (!caretPos) {
- newBlock = createTextBlock(editor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return textBlock;
+ };
+ var exitPreBlock = function (editor, direction, range$$1) {
+ var pre, caretPos, newBlock;
+ var caretWalker = CaretWalker(editor.getBody());
+ var getNextVisualCaretPosition = curry(getVisualCaretPosition, caretWalker.next);
+ var getPrevVisualCaretPosition = curry(getVisualCaretPosition, caretWalker.prev);
+ if (range$$1.collapsed && editor.settings.forced_root_block) {
+ pre = editor.dom.getParent(range$$1.startContainer, 'PRE');
+ if (!pre) {
+ return;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> if (direction === 1) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- editor.$(pre).after(newBlock);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ caretPos = getNextVisualCaretPosition(CaretPosition$1.fromRangeStart(range$$1));
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- editor.$(pre).before(newBlock);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ caretPos = getPrevVisualCaretPosition(CaretPosition$1.fromRangeStart(range$$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">- editor.selection.select(newBlock, true);
- editor.selection.collapse();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!caretPos) {
+ newBlock = createTextBlock(editor);
+ if (direction === 1) {
+ editor.$(pre).after(newBlock);
+ } else {
+ editor.$(pre).before(newBlock);
+ }
+ editor.selection.select(newBlock, true);
+ editor.selection.collapse();
+ }
</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 getHorizontalRange = function (editor, forward) {
- var caretWalker = CaretWalker(editor.getBody());
- var getNextVisualCaretPosition = $_4127e12ljjgwe7ww.curry(getVisualCaretPosition, caretWalker.next);
- var getPrevVisualCaretPosition = $_4127e12ljjgwe7ww.curry(getVisualCaretPosition, caretWalker.prev);
- var newRange;
- var direction = forward ? HDirection.Forwards : HDirection.Backwards;
- var getNextPosFn = forward ? getNextVisualCaretPosition : getPrevVisualCaretPosition;
- var range = editor.selection.getRng();
- newRange = moveToCeFalseHorizontally(direction, editor, getNextPosFn, range);
- if (newRange) {
- return newRange;
- }
- newRange = exitPreBlock(editor, direction, range);
- if (newRange) {
- return newRange;
- }
- return null;
- };
- var getVerticalRange = function (editor, down) {
- var newRange;
- var direction = down ? 1 : -1;
- var walkerFn = down ? downUntil : upUntil;
- var range = editor.selection.getRng();
- newRange = moveToCeFalseVertically(direction, editor, walkerFn, range);
- if (newRange) {
- return newRange;
- }
- newRange = exitPreBlock(editor, direction, range);
- if (newRange) {
- return newRange;
- }
- return null;
- };
- var moveH$1 = function (editor, forward) {
- return function () {
- var newRng = getHorizontalRange(editor, forward);
- if (newRng) {
- editor.selection.setRng(newRng);
- return true;
- } else {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var getHorizontalRange = function (editor, forward) {
+ var caretWalker = CaretWalker(editor.getBody());
+ var getNextVisualCaretPosition = curry(getVisualCaretPosition, caretWalker.next);
+ var getPrevVisualCaretPosition = curry(getVisualCaretPosition, caretWalker.prev);
+ var newRange;
+ var direction = forward ? HDirection.Forwards : HDirection.Backwards;
+ var getNextPosFn = forward ? getNextVisualCaretPosition : getPrevVisualCaretPosition;
+ var range$$1 = editor.selection.getRng();
+ newRange = moveToCeFalseHorizontally(direction, editor, getNextPosFn, range$$1);
+ if (newRange) {
+ return newRange;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ newRange = exitPreBlock(editor, direction, range$$1);
+ if (newRange) {
+ return newRange;
+ }
+ return 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">- };
- var moveV$1 = function (editor, down) {
- return function () {
- var newRng = getVerticalRange(editor, down);
- if (newRng) {
- editor.selection.setRng(newRng);
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getVerticalRange = function (editor, down) {
+ var newRange;
+ var direction = down ? 1 : -1;
+ var walkerFn = down ? downUntil : upUntil;
+ var range$$1 = editor.selection.getRng();
+ newRange = moveToCeFalseVertically(direction, editor, walkerFn, range$$1);
+ if (newRange) {
+ return newRange;
+ }
+ newRange = exitPreBlock(editor, direction, range$$1);
+ if (newRange) {
+ return newRange;
+ }
+ return null;
+ };
+ var moveH = function (editor, forward) {
+ return function () {
+ var newRng = getHorizontalRange(editor, forward);
+ if (newRng) {
+ editor.selection.setRng(newRng);
+ return true;
+ } else {
+ return false;
+ }
+ };
+ };
+ var moveV = function (editor, down) {
+ return function () {
+ var newRng = getVerticalRange(editor, down);
+ if (newRng) {
+ editor.selection.setRng(newRng);
+ return true;
+ } else {
+ return false;
+ }
+ };
+ };
+
+ var BreakType;
+ (function (BreakType) {
+ BreakType[BreakType['Br'] = 0] = 'Br';
+ BreakType[BreakType['Block'] = 1] = 'Block';
+ BreakType[BreakType['Wrap'] = 2] = 'Wrap';
+ BreakType[BreakType['Eol'] = 3] = 'Eol';
+ }(BreakType || (BreakType = {})));
+ var flip = function (direction, positions) {
+ return direction === HDirection.Backwards ? positions.reverse() : positions;
+ };
+ var walk$3 = function (direction, caretWalker, pos) {
+ return direction === HDirection.Forwards ? caretWalker.next(pos) : caretWalker.prev(pos);
+ };
+ var getBreakType = function (scope, direction, currentPos, nextPos) {
+ if (NodeType.isBr(nextPos.getNode(direction === HDirection.Forwards))) {
+ return BreakType.Br;
+ } else if (isInSameBlock(currentPos, nextPos) === false) {
+ return BreakType.Block;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</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 BreakType.Wrap;
</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">- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getPositionsUntil = function (predicate, direction, scope, start) {
+ var caretWalker = CaretWalker(scope);
+ var currentPos = start, nextPos;
+ var positions = [];
+ while (currentPos) {
+ nextPos = walk$3(direction, caretWalker, currentPos);
+ if (!nextPos) {
+ break;
+ }
+ if (NodeType.isBr(nextPos.getNode(false))) {
+ if (direction === HDirection.Forwards) {
+ return {
+ positions: flip(direction, positions).concat([nextPos]),
+ breakType: BreakType.Br,
+ breakAt: Option.some(nextPos)
+ };
+ } else {
+ return {
+ positions: flip(direction, positions),
+ breakType: BreakType.Br,
+ breakAt: Option.some(nextPos)
+ };
+ }
+ }
+ if (!nextPos.isVisible()) {
+ currentPos = nextPos;
+ continue;
+ }
+ if (predicate(currentPos, nextPos)) {
+ var breakType = getBreakType(scope, direction, currentPos, nextPos);
+ return {
+ positions: flip(direction, positions),
+ breakType: breakType,
+ breakAt: Option.some(nextPos)
+ };
+ }
+ positions.push(nextPos);
+ currentPos = nextPos;
+ }
+ return {
+ positions: flip(direction, positions),
+ breakType: BreakType.Eol,
+ breakAt: Option.none()
+ };
+ };
+ var getAdjacentLinePositions = function (direction, getPositionsUntilBreak, scope, start) {
+ return getPositionsUntilBreak(scope, start).breakAt.map(function (pos) {
+ var positions = getPositionsUntilBreak(scope, pos).positions;
+ return direction === HDirection.Backwards ? positions.concat(pos) : [pos].concat(positions);
+ }).getOr([]);
+ };
+ var findClosestHorizontalPositionFromPoint = function (positions, x) {
+ return foldl(positions, function (acc, newPos) {
+ return acc.fold(function () {
+ return Option.some(newPos);
+ }, function (lastPos) {
+ return liftN([
+ head(lastPos.getClientRects()),
+ head(newPos.getClientRects())
+ ], function (lastRect, newRect) {
+ var lastDist = Math.abs(x - lastRect.left);
+ var newDist = Math.abs(x - newRect.left);
+ return newDist <= lastDist ? newPos : lastPos;
+ }).or(acc);
+ });
+ }, Option.none());
+ };
+ var findClosestHorizontalPosition = function (positions, pos) {
+ return head(pos.getClientRects()).bind(function (targetRect) {
+ return findClosestHorizontalPositionFromPoint(positions, targetRect.left);
+ });
+ };
+ var getPositionsUntilPreviousLine = curry(getPositionsUntil, CaretPosition.isAbove, -1);
+ var getPositionsUntilNextLine = curry(getPositionsUntil, CaretPosition.isBelow, 1);
+ var isAtFirstLine = function (scope, pos) {
+ return getPositionsUntilPreviousLine(scope, pos).breakAt.isNone();
+ };
+ var isAtLastLine = function (scope, pos) {
+ return getPositionsUntilNextLine(scope, pos).breakAt.isNone();
+ };
+ var getPositionsAbove = curry(getAdjacentLinePositions, -1, getPositionsUntilPreviousLine);
+ var getPositionsBelow = curry(getAdjacentLinePositions, 1, getPositionsUntilNextLine);
+ var getFirstLinePositions = function (scope) {
+ return CaretFinder.firstPositionIn(scope).map(function (pos) {
+ return [pos].concat(getPositionsUntilNextLine(scope, pos).positions);
+ }).getOr([]);
+ };
+ var getLastLinePositions = function (scope) {
+ return CaretFinder.lastPositionIn(scope).map(function (pos) {
+ return getPositionsUntilPreviousLine(scope, pos).positions.concat(pos);
+ }).getOr([]);
+ };
</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 defaultPatterns = function (patterns) {
- return map(patterns, function (pattern) {
- return merge({
- shiftKey: false,
- altKey: false,
- ctrlKey: false,
- metaKey: false,
- keyCode: 0,
- action: noop
- }, pattern);
- });
- };
- var matchesEvent = function (pattern, evt) {
- return evt.keyCode === pattern.keyCode && evt.shiftKey === pattern.shiftKey && evt.altKey === pattern.altKey && evt.ctrlKey === pattern.ctrlKey && evt.metaKey === pattern.metaKey;
- };
- var match$1 = function (patterns, evt) {
- return bind(defaultPatterns(patterns), function (pattern) {
- return matchesEvent(pattern, evt) ? [pattern] : [];
- });
- };
- var action = function (f) {
- var x = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- x[_i - 1] = arguments[_i];
- }
- var args = Array.prototype.slice.call(arguments, 1);
- return function () {
- return f.apply(null, args);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var deflate = function (rect, delta) {
+ return {
+ left: rect.left - delta,
+ top: rect.top - delta,
+ right: rect.right + delta * 2,
+ bottom: rect.bottom + delta * 2,
+ width: rect.width + delta,
+ height: rect.height + delta
+ };
</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 execute = function (patterns, evt) {
- return find(match$1(patterns, evt), function (pattern) {
- return pattern.action();
- });
- };
- var $_4hb46d78jjgwe8z6 = {
- match: match$1,
- action: action,
- execute: execute
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getCorners = function (getYAxisValue, tds) {
+ return bind(tds, function (td) {
+ var rect = deflate(clone$2(td.getBoundingClientRect()), -1);
+ return [
+ {
+ x: rect.left,
+ y: getYAxisValue(rect),
+ cell: td
+ },
+ {
+ x: rect.right,
+ y: getYAxisValue(rect),
+ cell: td
+ }
+ ];
+ });
+ };
+ var findClosestCorner = function (corners, x, y) {
+ return foldl(corners, function (acc, newCorner) {
+ return acc.fold(function () {
+ return Option.some(newCorner);
+ }, function (oldCorner) {
+ var oldDist = Math.sqrt(Math.abs(oldCorner.x - x) + Math.abs(oldCorner.y - y));
+ var newDist = Math.sqrt(Math.abs(newCorner.x - x) + Math.abs(newCorner.y - y));
+ return Option.some(newDist < oldDist ? newCorner : oldCorner);
+ });
+ }, Option.none());
+ };
+ var getClosestCell$1 = function (getYAxisValue, isTargetCorner, table, x, y) {
+ var cells = descendants$1(Element$$1.fromDom(table), 'td,th,caption').map(function (e) {
+ return e.dom();
+ });
+ var corners = filter(getCorners(getYAxisValue, cells), function (corner) {
+ return isTargetCorner(corner, y);
+ });
+ return findClosestCorner(corners, x, y).map(function (corner) {
+ return corner.cell;
+ });
+ };
+ var getBottomValue = function (rect) {
+ return rect.bottom;
+ };
+ var getTopValue = function (rect) {
+ return rect.top;
+ };
+ var isAbove$1 = function (corner, y) {
+ return corner.y < y;
+ };
+ var isBelow$1 = function (corner, y) {
+ return corner.y > y;
+ };
+ var getClosestCellAbove = curry(getClosestCell$1, getBottomValue, isAbove$1);
+ var getClosestCellBelow = curry(getClosestCell$1, getTopValue, isBelow$1);
+ var findClosestPositionInAboveCell = function (table, pos) {
+ return head(pos.getClientRects()).bind(function (rect) {
+ return getClosestCellAbove(table, rect.left, rect.top);
+ }).bind(function (cell) {
+ return findClosestHorizontalPosition(getLastLinePositions(cell), pos);
+ });
+ };
+ var findClosestPositionInBelowCell = function (table, pos) {
+ return last(pos.getClientRects()).bind(function (rect) {
+ return getClosestCellBelow(table, rect.left, rect.top);
+ }).bind(function (cell) {
+ return findClosestHorizontalPosition(getFirstLinePositions(cell), pos);
+ });
+ };
</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 executeKeydownOverride = function (editor, caret, evt) {
- var os = $_7vg267ojjgwe7k0.detect().os;
- $_4hb46d78jjgwe8z6.execute([
- {
- keyCode: $_9udk9k5wjjgwe8on.RIGHT,
- action: moveH$1(editor, true)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.LEFT,
- action: moveH$1(editor, false)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.UP,
- action: moveV$1(editor, false)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.DOWN,
- action: moveV$1(editor, true)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.RIGHT,
- action: moveH(editor, true)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.LEFT,
- action: moveH(editor, false)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.UP,
- action: moveV(editor, false)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.DOWN,
- action: moveV(editor, true)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.RIGHT,
- action: $_80ia3a4ajjgwe8e2.move(editor, caret, true)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.LEFT,
- action: $_80ia3a4ajjgwe8e2.move(editor, caret, false)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.RIGHT,
- ctrlKey: !os.isOSX(),
- altKey: os.isOSX(),
- action: $_80ia3a4ajjgwe8e2.moveNextWord(editor, caret)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.LEFT,
- ctrlKey: !os.isOSX(),
- altKey: os.isOSX(),
- action: $_80ia3a4ajjgwe8e2.movePrevWord(editor, caret)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var moveToRange = function (editor, rng) {
+ editor.selection.setRng(rng);
+ ScrollIntoView.scrollRangeIntoView(editor, rng);
+ };
+ var hasNextBreak = function (getPositionsUntil, scope, lineInfo) {
+ return lineInfo.breakAt.map(function (breakPos) {
+ return getPositionsUntil(scope, breakPos).breakAt.isSome();
+ }).getOr(false);
+ };
+ var startsWithWrapBreak = function (lineInfo) {
+ return lineInfo.breakType === BreakType.Wrap && lineInfo.positions.length === 0;
+ };
+ var startsWithBrBreak = function (lineInfo) {
+ return lineInfo.breakType === BreakType.Br && lineInfo.positions.length === 1;
+ };
+ var isAtTableCellLine = function (getPositionsUntil, scope, pos) {
+ var lineInfo = getPositionsUntil(scope, pos);
+ if (startsWithWrapBreak(lineInfo) || !NodeType.isBr(pos.getNode()) && startsWithBrBreak(lineInfo)) {
+ return !hasNextBreak(getPositionsUntil, scope, lineInfo);
+ } else {
+ return lineInfo.breakAt.isNone();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ], evt).each(function (_) {
- evt.preventDefault();
- });
- };
- var setup$7 = function (editor, caret) {
- editor.on('keydown', function (evt) {
- if (evt.isDefaultPrevented() === false) {
- executeKeydownOverride(editor, caret, evt);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var isAtFirstTableCellLine = curry(isAtTableCellLine, getPositionsUntilPreviousLine);
+ var isAtLastTableCellLine = curry(isAtTableCellLine, getPositionsUntilNextLine);
+ var isCaretAtStartOrEndOfTable = function (forward, rng, table) {
+ var caretPos = CaretPosition$1.fromRangeStart(rng);
+ return CaretFinder.positionIn(!forward, table).map(function (pos) {
+ return pos.isEqual(caretPos);
+ }).getOr(false);
+ };
+ var navigateHorizontally = function (editor, forward, table, td) {
+ var rng = editor.selection.getRng();
+ var direction = forward ? 1 : -1;
+ if (isFakeCaretTableBrowser() && isCaretAtStartOrEndOfTable(forward, rng, table)) {
+ var newRng = showCaret(direction, editor, table, !forward, true);
+ moveToRange(editor, newRng);
+ 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">- });
- };
- var $_97nc1t76jjgwe8yv = { setup: setup$7 };
-
- var getParentInlines = function (rootElm, startElm) {
- var parents = $_cvft7x3zjjgwe8bh.parentsAndSelf(startElm, rootElm);
- return findIndex(parents, isBlock).fold(constant(parents), function (index) {
- return parents.slice(0, index);
- });
- };
- var hasOnlyOneChild$1 = function (elm) {
- return $_d3rmjp18jjgwe7nc.children(elm).length === 1;
- };
- var deleteLastPosition = function (forward, editor, target, parentInlines) {
- var isFormatElement$$1 = curry(isFormatElement, editor);
- var formatNodes = map(filter(parentInlines, isFormatElement$$1), function (elm) {
- return elm.dom();
- });
- if (formatNodes.length === 0) {
- $_eg6ib44jjgwe8ck.deleteElement(editor, forward, target);
- } else {
- var pos = replaceWithCaretFormat(target.dom(), formatNodes);
- editor.selection.setRng(pos.toRange());
- }
- };
- var deleteCaret$1 = function (editor, forward) {
- var rootElm = Element$$1.fromDom(editor.getBody());
- var startElm = Element$$1.fromDom(editor.selection.getStart());
- var parentInlines = filter(getParentInlines(rootElm, startElm), hasOnlyOneChild$1);
- return last(parentInlines).map(function (target) {
- var fromPos = CaretPosition$1.fromRangeStart(editor.selection.getRng());
- if ($_3vi93f3sjjgwe861.willDeleteLastPositionInElement(forward, fromPos, target.dom())) {
- deleteLastPosition(forward, editor, target, parentInlines);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return false;
+ };
+ var getClosestAbovePosition = function (root, table, start) {
+ return findClosestPositionInAboveCell(table, start).orThunk(function () {
+ return head(start.getClientRects()).bind(function (rect) {
+ return findClosestHorizontalPositionFromPoint(getPositionsAbove(root, CaretPosition$1.before(table)), rect.left);
+ });
+ }).getOr(CaretPosition$1.before(table));
+ };
+ var getClosestBelowPosition = function (root, table, start) {
+ return findClosestPositionInBelowCell(table, start).orThunk(function () {
+ return head(start.getClientRects()).bind(function (rect) {
+ return findClosestHorizontalPositionFromPoint(getPositionsBelow(root, CaretPosition$1.after(table)), rect.left);
+ });
+ }).getOr(CaretPosition$1.after(table));
+ };
+ var getTable = function (previous, pos) {
+ var node = pos.getNode(previous);
+ return NodeType.isElement(node) && node.nodeName === 'TABLE' ? Option.some(node) : Option.none();
+ };
+ var renderBlock = function (down, editor, table, pos) {
+ var forcedRootBlock = Settings.getForcedRootBlock(editor);
+ if (forcedRootBlock) {
+ editor.undoManager.transact(function () {
+ var element = Element$$1.fromTag(forcedRootBlock);
+ setAll(element, Settings.getForcedRootBlockAttrs(editor));
+ append(element, Element$$1.fromTag('br'));
+ if (down) {
+ after(Element$$1.fromDom(table), element);
+ } else {
+ before(Element$$1.fromDom(table), element);
+ }
+ var rng = editor.dom.createRng();
+ rng.setStart(element.dom(), 0);
+ rng.setEnd(element.dom(), 0);
+ moveToRange(editor, rng);
+ });
+ } else {
+ moveToRange(editor, pos.toRange());
+ }
+ };
+ var moveCaret = function (editor, down, pos) {
+ var table = down ? getTable(true, pos) : getTable(false, pos);
+ var last$$1 = down === false;
+ table.fold(function () {
+ return moveToRange(editor, pos.toRange());
+ }, function (table) {
+ return CaretFinder.positionIn(last$$1, editor.getBody()).filter(function (lastPos) {
+ return lastPos.isEqual(pos);
+ }).fold(function () {
+ return moveToRange(editor, pos.toRange());
+ }, function (_) {
+ return renderBlock(down, editor, table, pos);
+ });
+ });
+ };
+ var navigateVertically = function (editor, down, table, td) {
+ var rng = editor.selection.getRng();
+ var pos = CaretPosition$1.fromRangeStart(rng);
+ var root = editor.getBody();
+ if (!down && isAtFirstTableCellLine(td, pos)) {
+ var newPos = getClosestAbovePosition(root, table, pos);
+ moveCaret(editor, down, newPos);
</ins><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if (down && isAtLastTableCellLine(td, pos)) {
+ var newPos = getClosestBelowPosition(root, table, pos);
+ moveCaret(editor, down, newPos);
+ return true;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }).getOr(false);
- };
- var backspaceDelete$5 = function (editor, forward) {
- return editor.selection.isCollapsed() ? deleteCaret$1(editor, forward) : false;
- };
- var $_529ibl7ajjgwe8zf = { backspaceDelete: backspaceDelete$5 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var moveH$1 = function (editor, forward) {
+ return function () {
+ return Option.from(editor.dom.getParent(editor.selection.getNode(), 'td,th')).bind(function (td) {
+ return Option.from(editor.dom.getParent(td, 'table')).map(function (table) {
+ return navigateHorizontally(editor, forward, table, td);
+ });
+ }).getOr(false);
+ };
+ };
+ var moveV$1 = function (editor, forward) {
+ return function () {
+ return Option.from(editor.dom.getParent(editor.selection.getNode(), 'td,th')).bind(function (td) {
+ return Option.from(editor.dom.getParent(td, 'table')).map(function (table) {
+ return navigateVertically(editor, forward, table, td);
+ });
+ }).getOr(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 executeKeydownOverride$1 = function (editor, caret, evt) {
- $_4hb46d78jjgwe8z6.execute([
- {
- keyCode: $_9udk9k5wjjgwe8on.BACKSPACE,
- action: $_4hb46d78jjgwe8z6.action($_cc2jel41jjgwe8bx.backspaceDelete, editor, false)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.DELETE,
- action: $_4hb46d78jjgwe8z6.action($_cc2jel41jjgwe8bx.backspaceDelete, editor, true)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.BACKSPACE,
- action: $_4hb46d78jjgwe8z6.action($_fwrmt445jjgwe8d5.backspaceDelete, editor, caret, false)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.DELETE,
- action: $_4hb46d78jjgwe8z6.action($_fwrmt445jjgwe8d5.backspaceDelete, editor, caret, true)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.BACKSPACE,
- action: $_4hb46d78jjgwe8z6.action($_f2hioa4cjjgwe8ee.backspaceDelete, editor, false)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.DELETE,
- action: $_4hb46d78jjgwe8z6.action($_f2hioa4cjjgwe8ee.backspaceDelete, editor, true)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.BACKSPACE,
- action: $_4hb46d78jjgwe8z6.action($_8u9liw40jjgwe8bn.backspaceDelete, editor, false)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.DELETE,
- action: $_4hb46d78jjgwe8z6.action($_8u9liw40jjgwe8bn.backspaceDelete, editor, true)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.BACKSPACE,
- action: $_4hb46d78jjgwe8z6.action($_6q4s8w3qjjgwe85j.backspaceDelete, editor, false)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.DELETE,
- action: $_4hb46d78jjgwe8z6.action($_6q4s8w3qjjgwe85j.backspaceDelete, editor, true)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.BACKSPACE,
- action: $_4hb46d78jjgwe8z6.action($_529ibl7ajjgwe8zf.backspaceDelete, editor, false)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.DELETE,
- action: $_4hb46d78jjgwe8z6.action($_529ibl7ajjgwe8zf.backspaceDelete, editor, true)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isTarget = function (node) {
+ return contains(['figcaption'], name(node));
+ };
+ var rangeBefore = function (target) {
+ var rng = document.createRange();
+ rng.setStartBefore(target.dom());
+ rng.setEndBefore(target.dom());
+ return rng;
+ };
+ var insertElement = function (root, elm, forward) {
+ if (forward) {
+ append(root, elm);
+ } else {
+ prepend(root, 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">- ], evt).each(function (_) {
- evt.preventDefault();
- });
- };
- var executeKeyupOverride = function (editor, evt) {
- $_4hb46d78jjgwe8z6.execute([
- {
- keyCode: $_9udk9k5wjjgwe8on.BACKSPACE,
- action: $_4hb46d78jjgwe8z6.action($_cc2jel41jjgwe8bx.paddEmptyElement, editor)
- },
- {
- keyCode: $_9udk9k5wjjgwe8on.DELETE,
- action: $_4hb46d78jjgwe8z6.action($_cc2jel41jjgwe8bx.paddEmptyElement, editor)
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var insertBr = function (root, forward) {
+ var br = Element$$1.fromTag('br');
+ insertElement(root, br, forward);
+ return rangeBefore(br);
+ };
+ var insertBlock$1 = function (root, forward, blockName, attrs) {
+ var block = Element$$1.fromTag(blockName);
+ var br = Element$$1.fromTag('br');
+ setAll(block, attrs);
+ append(block, br);
+ insertElement(root, block, forward);
+ return rangeBefore(br);
+ };
+ var insertEmptyLine = function (root, rootBlockName, attrs, forward) {
+ if (rootBlockName === '') {
+ return insertBr(root, forward);
+ } else {
+ return insertBlock$1(root, forward, rootBlockName, 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">- ], evt);
- };
- var setup$8 = function (editor, caret) {
- editor.on('keydown', function (evt) {
- if (evt.isDefaultPrevented() === false) {
- executeKeydownOverride$1(editor, caret, evt);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var getClosestTargetBlock = function (pos, root) {
+ var isRoot = curry(eq, root);
+ return closest(Element$$1.fromDom(pos.container()), isBlock, isRoot).filter(isTarget);
+ };
+ var isAtFirstOrLastLine = function (root, forward, pos) {
+ return forward ? isAtLastLine(root.dom(), pos) : isAtFirstLine(root.dom(), pos);
+ };
+ var moveCaretToNewEmptyLine = function (editor, forward) {
+ var root = Element$$1.fromDom(editor.getBody());
+ var pos = CaretPosition$1.fromRangeStart(editor.selection.getRng());
+ var rootBlock = Settings.getForcedRootBlock(editor);
+ var rootBlockAttrs = Settings.getForcedRootBlockAttrs(editor);
+ return getClosestTargetBlock(pos, root).exists(function () {
+ if (isAtFirstOrLastLine(root, forward, pos)) {
+ var rng = insertEmptyLine(root, rootBlock, rootBlockAttrs, forward);
+ editor.selection.setRng(rng);
+ return true;
+ } else {
+ return false;
+ }
+ });
+ };
+ var moveV$2 = function (editor, forward) {
+ return function () {
+ if (editor.selection.isCollapsed()) {
+ return moveCaretToNewEmptyLine(editor, forward);
+ } else {
+ return false;
+ }
+ };
+ };
+
+ var defaultPatterns = function (patterns) {
+ return map(patterns, function (pattern) {
+ return merge({
+ shiftKey: false,
+ altKey: false,
+ ctrlKey: false,
+ metaKey: false,
+ keyCode: 0,
+ action: noop
+ }, pattern);
+ });
+ };
+ var matchesEvent = function (pattern, evt) {
+ return evt.keyCode === pattern.keyCode && evt.shiftKey === pattern.shiftKey && evt.altKey === pattern.altKey && evt.ctrlKey === pattern.ctrlKey && evt.metaKey === pattern.metaKey;
+ };
+ var match$1 = function (patterns, evt) {
+ return bind(defaultPatterns(patterns), function (pattern) {
+ return matchesEvent(pattern, evt) ? [pattern] : [];
+ });
+ };
+ var action = function (f) {
+ var x = [];
+ for (var _i = 1; _i < arguments.length; _i++) {
+ x[_i - 1] = arguments[_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.on('keyup', function (evt) {
- if (evt.isDefaultPrevented() === false) {
- executeKeyupOverride(editor, evt);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var args = Array.prototype.slice.call(arguments, 1);
+ return function () {
+ return f.apply(null, args);
+ };
+ };
+ var execute = function (patterns, evt) {
+ return find(match$1(patterns, evt), function (pattern) {
+ return pattern.action();
+ });
+ };
+ var MatchKeys = {
+ match: match$1,
+ action: action,
+ execute: execute
+ };
+
+ var executeKeydownOverride = function (editor, caret, evt) {
+ var os = PlatformDetection$1.detect().os;
+ MatchKeys.execute([
+ {
+ keyCode: VK.RIGHT,
+ action: moveH(editor, true)
+ },
+ {
+ keyCode: VK.LEFT,
+ action: moveH(editor, false)
+ },
+ {
+ keyCode: VK.UP,
+ action: moveV(editor, false)
+ },
+ {
+ keyCode: VK.DOWN,
+ action: moveV(editor, true)
+ },
+ {
+ keyCode: VK.RIGHT,
+ action: moveH$1(editor, true)
+ },
+ {
+ keyCode: VK.LEFT,
+ action: moveH$1(editor, false)
+ },
+ {
+ keyCode: VK.UP,
+ action: moveV$1(editor, false)
+ },
+ {
+ keyCode: VK.DOWN,
+ action: moveV$1(editor, true)
+ },
+ {
+ keyCode: VK.RIGHT,
+ action: BoundarySelection.move(editor, caret, true)
+ },
+ {
+ keyCode: VK.LEFT,
+ action: BoundarySelection.move(editor, caret, false)
+ },
+ {
+ keyCode: VK.RIGHT,
+ ctrlKey: !os.isOSX(),
+ altKey: os.isOSX(),
+ action: BoundarySelection.moveNextWord(editor, caret)
+ },
+ {
+ keyCode: VK.LEFT,
+ ctrlKey: !os.isOSX(),
+ altKey: os.isOSX(),
+ action: BoundarySelection.movePrevWord(editor, caret)
+ },
+ {
+ keyCode: VK.UP,
+ action: moveV$2(editor, false)
+ },
+ {
+ keyCode: VK.DOWN,
+ action: moveV$2(editor, true)
+ }
+ ], evt).each(function (_) {
+ evt.preventDefault();
+ });
+ };
+ var setup$7 = function (editor, caret) {
+ editor.on('keydown', function (evt) {
+ if (evt.isDefaultPrevented() === false) {
+ executeKeydownOverride(editor, caret, evt);
+ }
+ });
+ };
+ var ArrowKeys = { setup: setup$7 };
+
+ var getParentInlines = function (rootElm, startElm) {
+ var parents$$1 = Parents.parentsAndSelf(startElm, rootElm);
+ return findIndex(parents$$1, isBlock).fold(constant(parents$$1), function (index) {
+ return parents$$1.slice(0, index);
+ });
+ };
+ var hasOnlyOneChild$1 = function (elm) {
+ return children(elm).length === 1;
+ };
+ var deleteLastPosition = function (forward, editor, target, parentInlines) {
+ var isFormatElement$$1 = curry(isFormatElement, editor);
+ var formatNodes = map(filter(parentInlines, isFormatElement$$1), function (elm) {
+ return elm.dom();
+ });
+ if (formatNodes.length === 0) {
+ DeleteElement.deleteElement(editor, forward, target);
+ } else {
+ var pos = replaceWithCaretFormat(target.dom(), formatNodes);
+ editor.selection.setRng(pos.toRange());
</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 $_cacenr79jjgwe8zc = { setup: setup$8 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var deleteCaret$1 = function (editor, forward) {
+ var rootElm = Element$$1.fromDom(editor.getBody());
+ var startElm = Element$$1.fromDom(editor.selection.getStart());
+ var parentInlines = filter(getParentInlines(rootElm, startElm), hasOnlyOneChild$1);
+ return last(parentInlines).map(function (target) {
+ var fromPos = CaretPosition$1.fromRangeStart(editor.selection.getRng());
+ if (DeleteUtils.willDeleteLastPositionInElement(forward, fromPos, target.dom()) && !isEmptyCaretFormatElement(target)) {
+ deleteLastPosition(forward, editor, target, parentInlines);
+ return true;
+ } else {
+ return false;
+ }
+ }).getOr(false);
+ };
+ var backspaceDelete$5 = function (editor, forward) {
+ return editor.selection.isCollapsed() ? deleteCaret$1(editor, forward) : false;
+ };
+ var InlineFormatDelete = { backspaceDelete: backspaceDelete$5 };
</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 firstNonWhiteSpaceNodeSibling = function (node) {
- while (node) {
- if (node.nodeType === 1 || node.nodeType === 3 && node.data && /[\r\n\s]/.test(node.data)) {
- return node;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var executeKeydownOverride$1 = function (editor, caret, evt) {
+ MatchKeys.execute([
+ {
+ keyCode: VK.BACKSPACE,
+ action: MatchKeys.action(CefDelete.backspaceDelete, editor, false)
+ },
+ {
+ keyCode: VK.DELETE,
+ action: MatchKeys.action(CefDelete.backspaceDelete, editor, true)
+ },
+ {
+ keyCode: VK.BACKSPACE,
+ action: MatchKeys.action(InlineBoundaryDelete.backspaceDelete, editor, caret, false)
+ },
+ {
+ keyCode: VK.DELETE,
+ action: MatchKeys.action(InlineBoundaryDelete.backspaceDelete, editor, caret, true)
+ },
+ {
+ keyCode: VK.BACKSPACE,
+ action: MatchKeys.action(TableDelete.backspaceDelete, editor, false)
+ },
+ {
+ keyCode: VK.DELETE,
+ action: MatchKeys.action(TableDelete.backspaceDelete, editor, true)
+ },
+ {
+ keyCode: VK.BACKSPACE,
+ action: MatchKeys.action(BlockRangeDelete.backspaceDelete, editor, false)
+ },
+ {
+ keyCode: VK.DELETE,
+ action: MatchKeys.action(BlockRangeDelete.backspaceDelete, editor, true)
+ },
+ {
+ keyCode: VK.BACKSPACE,
+ action: MatchKeys.action(BlockBoundaryDelete.backspaceDelete, editor, false)
+ },
+ {
+ keyCode: VK.DELETE,
+ action: MatchKeys.action(BlockBoundaryDelete.backspaceDelete, editor, true)
+ },
+ {
+ keyCode: VK.BACKSPACE,
+ action: MatchKeys.action(InlineFormatDelete.backspaceDelete, editor, false)
+ },
+ {
+ keyCode: VK.DELETE,
+ action: MatchKeys.action(InlineFormatDelete.backspaceDelete, editor, true)
+ }
+ ], evt).each(function (_) {
+ evt.preventDefault();
+ });
+ };
+ var executeKeyupOverride = function (editor, evt) {
+ MatchKeys.execute([
+ {
+ keyCode: VK.BACKSPACE,
+ action: MatchKeys.action(CefDelete.paddEmptyElement, editor)
+ },
+ {
+ keyCode: VK.DELETE,
+ action: MatchKeys.action(CefDelete.paddEmptyElement, editor)
+ }
+ ], evt);
+ };
+ var setup$8 = function (editor, caret) {
+ editor.on('keydown', function (evt) {
+ if (evt.isDefaultPrevented() === false) {
+ executeKeydownOverride$1(editor, caret, evt);
+ }
+ });
+ editor.on('keyup', function (evt) {
+ if (evt.isDefaultPrevented() === false) {
+ executeKeyupOverride(editor, evt);
+ }
+ });
+ };
+ var DeleteBackspaceKeys = { setup: setup$8 };
+
+ var firstNonWhiteSpaceNodeSibling = function (node) {
+ while (node) {
+ if (node.nodeType === 1 || node.nodeType === 3 && node.data && /[\r\n\s]/.test(node.data)) {
+ return node;
+ }
+ 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">- node = node.nextSibling;
- }
- };
- var moveToCaretPosition = function (editor, root) {
- var walker, node, rng, lastNode = root, tempElm;
- var dom = editor.dom;
- var moveCaretBeforeOnEnterElementsMap = editor.schema.getMoveCaretBeforeOnEnterElements();
- if (!root) {
- return;
- }
- if (/^(LI|DT|DD)$/.test(root.nodeName)) {
- var firstChild = firstNonWhiteSpaceNodeSibling(root.firstChild);
- if (firstChild && /^(UL|OL|DL)$/.test(firstChild.nodeName)) {
- root.insertBefore(dom.doc.createTextNode('\xA0'), root.firstChild);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var moveToCaretPosition = function (editor, root) {
+ var walker, node, rng, lastNode = root, tempElm;
+ var dom = editor.dom;
+ var moveCaretBeforeOnEnterElementsMap = editor.schema.getMoveCaretBeforeOnEnterElements();
+ if (!root) {
+ 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">- }
- rng = dom.createRng();
- root.normalize();
- if (root.hasChildNodes()) {
- walker = new TreeWalker(root, root);
- while (node = walker.current()) {
- if ($_3b9u2y1rjjgwe7qe.isText(node)) {
- rng.setStart(node, 0);
- rng.setEnd(node, 0);
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (/^(LI|DT|DD)$/.test(root.nodeName)) {
+ var firstChild = firstNonWhiteSpaceNodeSibling(root.firstChild);
+ if (firstChild && /^(UL|OL|DL)$/.test(firstChild.nodeName)) {
+ root.insertBefore(dom.doc.createTextNode('\xA0'), root.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">- if (moveCaretBeforeOnEnterElementsMap[node.nodeName.toLowerCase()]) {
- rng.setStartBefore(node);
- rng.setEndBefore(node);
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ rng = dom.createRng();
+ root.normalize();
+ if (root.hasChildNodes()) {
+ walker = new TreeWalker(root, root);
+ while (node = walker.current()) {
+ if (NodeType.isText(node)) {
+ rng.setStart(node, 0);
+ rng.setEnd(node, 0);
+ break;
+ }
+ if (moveCaretBeforeOnEnterElementsMap[node.nodeName.toLowerCase()]) {
+ rng.setStartBefore(node);
+ rng.setEndBefore(node);
+ break;
+ }
+ lastNode = node;
+ node = walker.next();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- lastNode = node;
- node = walker.next();
- }
- if (!node) {
- rng.setStart(lastNode, 0);
- rng.setEnd(lastNode, 0);
- }
- } else {
- if ($_3b9u2y1rjjgwe7qe.isBr(root)) {
- if (root.nextSibling && dom.isBlock(root.nextSibling)) {
- rng.setStartBefore(root);
- rng.setEndBefore(root);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!node) {
+ rng.setStart(lastNode, 0);
+ rng.setEnd(lastNode, 0);
+ }
+ } else {
+ if (NodeType.isBr(root)) {
+ if (root.nextSibling && dom.isBlock(root.nextSibling)) {
+ rng.setStartBefore(root);
+ rng.setEndBefore(root);
+ } else {
+ rng.setStartAfter(root);
+ rng.setEndAfter(root);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- rng.setStartAfter(root);
- rng.setEndAfter(root);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rng.setStart(root, 0);
+ rng.setEnd(root, 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">- } else {
- rng.setStart(root, 0);
- rng.setEnd(root, 0);
</del><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(rng);
- dom.remove(tempElm);
- editor.selection.scrollIntoView(root);
- };
- var getEditableRoot = function (dom, node) {
- var root = dom.getRoot();
- var parent, editableRoot;
- parent = node;
- while (parent !== root && dom.getContentEditable(parent) !== 'false') {
- if (dom.getContentEditable(parent) === 'true') {
- editableRoot = parent;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.selection.setRng(rng);
+ dom.remove(tempElm);
+ editor.selection.scrollIntoView(root);
+ };
+ var getEditableRoot = function (dom, node) {
+ var root = dom.getRoot();
+ var parent, editableRoot;
+ parent = node;
+ while (parent !== root && dom.getContentEditable(parent) !== 'false') {
+ if (dom.getContentEditable(parent) === 'true') {
+ editableRoot = parent;
+ }
+ parent = parent.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">- parent = parent.parentNode;
- }
- return parent !== root ? editableRoot : root;
- };
- var getParentBlock$2 = function (editor) {
- return Option.from(editor.dom.getParent(editor.selection.getStart(true), editor.dom.isBlock));
- };
- var getParentBlockName = function (editor) {
- return getParentBlock$2(editor).fold(constant(''), function (parentBlock) {
- return parentBlock.nodeName.toUpperCase();
- });
- };
- var isListItemParentBlock = function (editor) {
- return getParentBlock$2(editor).filter(function (elm) {
- return isListItem(Element$$1.fromDom(elm));
- }).isSome();
- };
- var $_7rkd6o7fjjgwe90j = {
- moveToCaretPosition: moveToCaretPosition,
- getEditableRoot: getEditableRoot,
- getParentBlock: getParentBlock$2,
- getParentBlockName: getParentBlockName,
- isListItemParentBlock: isListItemParentBlock
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return parent !== root ? editableRoot : root;
+ };
+ var getParentBlock$2 = function (editor) {
+ return Option.from(editor.dom.getParent(editor.selection.getStart(true), editor.dom.isBlock));
+ };
+ var getParentBlockName = function (editor) {
+ return getParentBlock$2(editor).fold(constant(''), function (parentBlock) {
+ return parentBlock.nodeName.toUpperCase();
+ });
+ };
+ var isListItemParentBlock = function (editor) {
+ return getParentBlock$2(editor).filter(function (elm) {
+ return isListItem(Element$$1.fromDom(elm));
+ }).isSome();
+ };
+ var NewLineUtils = {
+ moveToCaretPosition: moveToCaretPosition,
+ getEditableRoot: getEditableRoot,
+ getParentBlock: getParentBlock$2,
+ getParentBlockName: getParentBlockName,
+ isListItemParentBlock: isListItemParentBlock
+ };
</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 hasFirstChild = function (elm, name) {
- return elm.firstChild && elm.firstChild.nodeName === name;
- };
- var hasParent$1 = function (elm, parentName) {
- return elm && elm.parentNode && elm.parentNode.nodeName === parentName;
- };
- var isListBlock = function (elm) {
- return elm && /^(OL|UL|LI)$/.test(elm.nodeName);
- };
- var isNestedList = function (elm) {
- return isListBlock(elm) && isListBlock(elm.parentNode);
- };
- var getContainerBlock = function (containerBlock) {
- var containerBlockParent = containerBlock.parentNode;
- if (/^(LI|DT|DD)$/.test(containerBlockParent.nodeName)) {
- return containerBlockParent;
- }
- return containerBlock;
- };
- var isFirstOrLastLi = function (containerBlock, parentBlock, first) {
- var node = containerBlock[first ? 'firstChild' : 'lastChild'];
- while (node) {
- if ($_3b9u2y1rjjgwe7qe.isElement(node)) {
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasFirstChild = function (elm, name) {
+ return elm.firstChild && elm.firstChild.nodeName === name;
+ };
+ var hasParent$1 = function (elm, parentName) {
+ return elm && elm.parentNode && elm.parentNode.nodeName === parentName;
+ };
+ var isListBlock = function (elm) {
+ return elm && /^(OL|UL|LI)$/.test(elm.nodeName);
+ };
+ var isNestedList = function (elm) {
+ return isListBlock(elm) && isListBlock(elm.parentNode);
+ };
+ var getContainerBlock = function (containerBlock) {
+ var containerBlockParent = containerBlock.parentNode;
+ if (/^(LI|DT|DD)$/.test(containerBlockParent.nodeName)) {
+ return containerBlockParent;
</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[first ? 'nextSibling' : 'previousSibling'];
- }
- return node === parentBlock;
- };
- var insert$1 = function (editor, createNewBlock, containerBlock, parentBlock, newBlockName) {
- var dom = editor.dom;
- var rng = editor.selection.getRng();
- if (containerBlock === editor.getBody()) {
- return;
- }
- if (isNestedList(containerBlock)) {
- newBlockName = 'LI';
- }
- var newBlock = newBlockName ? createNewBlock(newBlockName) : dom.create('BR');
- if (isFirstOrLastLi(containerBlock, parentBlock, true) && isFirstOrLastLi(containerBlock, parentBlock, false)) {
- if (hasParent$1(containerBlock, 'LI')) {
- dom.insertAfter(newBlock, getContainerBlock(containerBlock));
- } else {
- dom.replace(newBlock, containerBlock);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return containerBlock;
+ };
+ var isFirstOrLastLi = function (containerBlock, parentBlock, first) {
+ var node = containerBlock[first ? 'firstChild' : 'lastChild'];
+ while (node) {
+ if (NodeType.isElement(node)) {
+ break;
+ }
+ node = node[first ? 'nextSibling' : 'previousSibling'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else if (isFirstOrLastLi(containerBlock, parentBlock, true)) {
- if (hasParent$1(containerBlock, 'LI')) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return node === parentBlock;
+ };
+ var insert$1 = function (editor, createNewBlock, containerBlock, parentBlock, newBlockName) {
+ var dom = editor.dom;
+ var rng = editor.selection.getRng();
+ if (containerBlock === editor.getBody()) {
+ return;
+ }
+ if (isNestedList(containerBlock)) {
+ newBlockName = 'LI';
+ }
+ var newBlock = newBlockName ? createNewBlock(newBlockName) : dom.create('BR');
+ if (isFirstOrLastLi(containerBlock, parentBlock, true) && isFirstOrLastLi(containerBlock, parentBlock, false)) {
+ if (hasParent$1(containerBlock, 'LI')) {
+ dom.insertAfter(newBlock, getContainerBlock(containerBlock));
+ } else {
+ dom.replace(newBlock, containerBlock);
+ }
+ } else if (isFirstOrLastLi(containerBlock, parentBlock, true)) {
+ if (hasParent$1(containerBlock, 'LI')) {
+ dom.insertAfter(newBlock, getContainerBlock(containerBlock));
+ newBlock.appendChild(dom.doc.createTextNode(' '));
+ newBlock.appendChild(containerBlock);
+ } else {
+ containerBlock.parentNode.insertBefore(newBlock, containerBlock);
+ }
+ } else if (isFirstOrLastLi(containerBlock, parentBlock, false)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> dom.insertAfter(newBlock, getContainerBlock(containerBlock));
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- newBlock.appendChild(dom.doc.createTextNode(' '));
- newBlock.appendChild(containerBlock);
</del><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- containerBlock.parentNode.insertBefore(newBlock, containerBlock);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ containerBlock = getContainerBlock(containerBlock);
+ var tmpRng = rng.cloneRange();
+ tmpRng.setStartAfter(parentBlock);
+ tmpRng.setEndAfter(containerBlock);
+ var fragment = tmpRng.extractContents();
+ if (newBlockName === 'LI' && hasFirstChild(fragment, 'LI')) {
+ newBlock = fragment.firstChild;
+ dom.insertAfter(fragment, containerBlock);
+ } else {
+ dom.insertAfter(fragment, containerBlock);
+ dom.insertAfter(newBlock, containerBlock);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else if (isFirstOrLastLi(containerBlock, parentBlock, false)) {
- dom.insertAfter(newBlock, getContainerBlock(containerBlock));
- } else {
- containerBlock = getContainerBlock(containerBlock);
- var tmpRng = rng.cloneRange();
- tmpRng.setStartAfter(parentBlock);
- tmpRng.setEndAfter(containerBlock);
- var fragment = tmpRng.extractContents();
- if (newBlockName === 'LI' && hasFirstChild(fragment, 'LI')) {
- newBlock = fragment.firstChild;
- dom.insertAfter(fragment, containerBlock);
- } else {
- dom.insertAfter(fragment, containerBlock);
- dom.insertAfter(newBlock, containerBlock);
- }
- }
- dom.remove(parentBlock);
- $_7rkd6o7fjjgwe90j.moveToCaretPosition(editor, newBlock);
- };
- var $_6mi4nu7ejjgwe90f = { insert: insert$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ dom.remove(parentBlock);
+ NewLineUtils.moveToCaretPosition(editor, newBlock);
+ };
+ var InsertLi = { insert: insert$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">- var isEmptyAnchor = function (elm) {
- return elm && elm.nodeName === 'A' && $_6cwiepljjgwe7j4.trim($_2xw7ul2pjjgwe7xs.trim(elm.innerText || elm.textContent)).length === 0;
- };
- var isTableCell$5 = function (node) {
- return node && /^(TD|TH|CAPTION)$/.test(node.nodeName);
- };
- var emptyBlock = function (elm) {
- elm.innerHTML = '<br data-mce-bogus="1">';
- };
- var containerAndSiblingName = function (container, nodeName) {
- return container.nodeName === nodeName || container.previousSibling && container.previousSibling.nodeName === nodeName;
- };
- var canSplitBlock = function (dom, node) {
- return node && dom.isBlock(node) && !/^(TD|TH|CAPTION|FORM)$/.test(node.nodeName) && !/^(fixed|absolute)/i.test(node.style.position) && dom.getContentEditable(node) !== 'true';
- };
- var trimInlineElementsOnLeftSideOfBlock = function (dom, nonEmptyElementsMap, block) {
- var node = block;
- var firstChilds = [];
- var i;
- if (!node) {
- return;
- }
- while (node = node.firstChild) {
- if (dom.isBlock(node)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var trimZwsp = function (fragment) {
+ each(descendants(Element$$1.fromDom(fragment), isText), function (text) {
+ var rawNode = text.dom();
+ rawNode.nodeValue = Zwsp.trim(rawNode.nodeValue);
+ });
+ };
+ var isEmptyAnchor = function (dom, elm) {
+ return elm && elm.nodeName === 'A' && dom.isEmpty(elm);
+ };
+ var isTableCell$5 = function (node) {
+ return node && /^(TD|TH|CAPTION)$/.test(node.nodeName);
+ };
+ var emptyBlock = function (elm) {
+ elm.innerHTML = '<br data-mce-bogus="1">';
+ };
+ var containerAndSiblingName = function (container, nodeName) {
+ return container.nodeName === nodeName || container.previousSibling && container.previousSibling.nodeName === nodeName;
+ };
+ var canSplitBlock = function (dom, node) {
+ return node && dom.isBlock(node) && !/^(TD|TH|CAPTION|FORM)$/.test(node.nodeName) && !/^(fixed|absolute)/i.test(node.style.position) && dom.getContentEditable(node) !== 'true';
+ };
+ var trimInlineElementsOnLeftSideOfBlock = function (dom, nonEmptyElementsMap, block) {
+ var node = block;
+ var firstChilds = [];
+ var i;
+ if (!node) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ($_3b9u2y1rjjgwe7qe.isElement(node) && !nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
- firstChilds.push(node);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ while (node = node.firstChild) {
+ if (dom.isBlock(node)) {
+ return;
+ }
+ if (NodeType.isElement(node) && !nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
+ firstChilds.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">- }
- i = firstChilds.length;
- while (i--) {
- node = firstChilds[i];
- if (!node.hasChildNodes() || node.firstChild === node.lastChild && node.firstChild.nodeValue === '') {
- dom.remove(node);
- } else {
- if (isEmptyAnchor(node)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ i = firstChilds.length;
+ while (i--) {
+ node = firstChilds[i];
+ if (!node.hasChildNodes() || node.firstChild === node.lastChild && node.firstChild.nodeValue === '') {
</ins><span class="cx" style="display: block; padding: 0 10px"> dom.remove(node);
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ if (isEmptyAnchor(dom, node)) {
+ dom.remove(node);
+ }
</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">- }
- };
- var normalizeZwspOffset = function (start, container, offset) {
- if ($_3b9u2y1rjjgwe7qe.isText(container) === false) {
- return offset;
- } else if (start) {
- return offset === 1 && container.data.charAt(offset - 1) === $_2xw7ul2pjjgwe7xs.ZWSP ? 0 : offset;
- } else {
- return offset === container.data.length - 1 && container.data.charAt(offset) === $_2xw7ul2pjjgwe7xs.ZWSP ? container.data.length : offset;
- }
- };
- var includeZwspInRange = function (rng) {
- var newRng = rng.cloneRange();
- newRng.setStart(rng.startContainer, normalizeZwspOffset(true, rng.startContainer, rng.startOffset));
- newRng.setEnd(rng.endContainer, normalizeZwspOffset(false, rng.endContainer, rng.endOffset));
- return newRng;
- };
- var trimLeadingLineBreaks = function (node) {
- do {
- if ($_3b9u2y1rjjgwe7qe.isText(node)) {
- node.nodeValue = node.nodeValue.replace(/^[\r\n]+/, '');
- }
- node = node.firstChild;
- } while (node);
- };
- var getEditableRoot$1 = function (dom, node) {
- var root = dom.getRoot();
- var parent, editableRoot;
- parent = node;
- while (parent !== root && dom.getContentEditable(parent) !== 'false') {
- if (dom.getContentEditable(parent) === 'true') {
- editableRoot = parent;
- }
- parent = parent.parentNode;
- }
- return parent !== root ? editableRoot : root;
- };
- var setForcedBlockAttrs = function (editor, node) {
- var forcedRootBlockName = $_259vs538jjgwe82a.getForcedRootBlock(editor);
- if (forcedRootBlockName && forcedRootBlockName.toLowerCase() === node.tagName.toLowerCase()) {
- editor.dom.setAttribs(node, $_259vs538jjgwe82a.getForcedRootBlockAttrs(editor));
- }
- };
- var wrapSelfAndSiblingsInDefaultBlock = function (editor, newBlockName, rng, container, offset) {
- var newBlock, parentBlock, startNode, node, next, rootBlockName;
- var blockName = newBlockName || 'P';
- var dom = editor.dom, editableRoot = getEditableRoot$1(dom, container);
- parentBlock = dom.getParent(container, dom.isBlock);
- if (!parentBlock || !canSplitBlock(dom, parentBlock)) {
- parentBlock = parentBlock || editableRoot;
- if (parentBlock === editor.getBody() || isTableCell$5(parentBlock)) {
- rootBlockName = parentBlock.nodeName.toLowerCase();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var normalizeZwspOffset = function (start, container, offset) {
+ if (NodeType.isText(container) === false) {
+ return offset;
+ } else if (start) {
+ return offset === 1 && container.data.charAt(offset - 1) === Zwsp.ZWSP ? 0 : offset;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- rootBlockName = parentBlock.parentNode.nodeName.toLowerCase();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return offset === container.data.length - 1 && container.data.charAt(offset) === Zwsp.ZWSP ? container.data.length : 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 (!parentBlock.hasChildNodes()) {
- newBlock = dom.create(blockName);
- setForcedBlockAttrs(editor, newBlock);
- parentBlock.appendChild(newBlock);
- rng.setStart(newBlock, 0);
- rng.setEnd(newBlock, 0);
- return newBlock;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var includeZwspInRange = function (rng) {
+ var newRng = rng.cloneRange();
+ newRng.setStart(rng.startContainer, normalizeZwspOffset(true, rng.startContainer, rng.startOffset));
+ newRng.setEnd(rng.endContainer, normalizeZwspOffset(false, rng.endContainer, rng.endOffset));
+ return newRng;
+ };
+ var trimLeadingLineBreaks = function (node) {
+ do {
+ if (NodeType.isText(node)) {
+ node.nodeValue = node.nodeValue.replace(/^[\r\n]+/, '');
+ }
+ node = node.firstChild;
+ } while (node);
+ };
+ var getEditableRoot$1 = function (dom, node) {
+ var root = dom.getRoot();
+ var parent, editableRoot;
+ parent = node;
+ while (parent !== root && dom.getContentEditable(parent) !== 'false') {
+ if (dom.getContentEditable(parent) === 'true') {
+ editableRoot = parent;
+ }
+ parent = parent.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 = container;
- while (node.parentNode !== parentBlock) {
- node = node.parentNode;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return parent !== root ? editableRoot : root;
+ };
+ var setForcedBlockAttrs = function (editor, node) {
+ var forcedRootBlockName = Settings.getForcedRootBlock(editor);
+ if (forcedRootBlockName && forcedRootBlockName.toLowerCase() === node.tagName.toLowerCase()) {
+ editor.dom.setAttribs(node, Settings.getForcedRootBlockAttrs(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">- while (node && !dom.isBlock(node)) {
- startNode = node;
- node = node.previousSibling;
- }
- if (startNode && editor.schema.isValidChild(rootBlockName, blockName.toLowerCase())) {
- newBlock = dom.create(blockName);
- setForcedBlockAttrs(editor, newBlock);
- startNode.parentNode.insertBefore(newBlock, startNode);
- node = startNode;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var wrapSelfAndSiblingsInDefaultBlock = function (editor, newBlockName, rng, container, offset) {
+ var newBlock, parentBlock, startNode, node, next, rootBlockName;
+ var blockName = newBlockName || 'P';
+ var dom = editor.dom, editableRoot = getEditableRoot$1(dom, container);
+ parentBlock = dom.getParent(container, dom.isBlock);
+ if (!parentBlock || !canSplitBlock(dom, parentBlock)) {
+ parentBlock = parentBlock || editableRoot;
+ if (parentBlock === editor.getBody() || isTableCell$5(parentBlock)) {
+ rootBlockName = parentBlock.nodeName.toLowerCase();
+ } else {
+ rootBlockName = parentBlock.parentNode.nodeName.toLowerCase();
+ }
+ if (!parentBlock.hasChildNodes()) {
+ newBlock = dom.create(blockName);
+ setForcedBlockAttrs(editor, newBlock);
+ parentBlock.appendChild(newBlock);
+ rng.setStart(newBlock, 0);
+ rng.setEnd(newBlock, 0);
+ return newBlock;
+ }
+ node = container;
+ while (node.parentNode !== parentBlock) {
+ node = node.parentNode;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> while (node && !dom.isBlock(node)) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- next = node.nextSibling;
- newBlock.appendChild(node);
- node = next;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ startNode = node;
+ node = node.previousSibling;
</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(container, offset);
- rng.setEnd(container, offset);
- }
- }
- return container;
- };
- var addBrToBlockIfNeeded = function (dom, block) {
- var lastChild;
- block.normalize();
- lastChild = block.lastChild;
- if (!lastChild || /^(left|right)$/gi.test(dom.getStyle(lastChild, 'float', true))) {
- dom.add(block, 'br');
- }
- };
- var insert$2 = function (editor, evt) {
- var tmpRng, editableRoot, container, offset, parentBlock, shiftKey;
- var newBlock, fragment, containerBlock, parentBlockName, containerBlockName, newBlockName, isAfterLastNodeInContainer;
- var dom = editor.dom;
- var schema = editor.schema, nonEmptyElementsMap = schema.getNonEmptyElements();
- var rng = editor.selection.getRng();
- var createNewBlock = function (name) {
- var node = container, block, clonedNode, caretNode;
- var textInlineElements = schema.getTextInlineElements();
- if (name || parentBlockName === 'TABLE' || parentBlockName === 'HR') {
- block = dom.create(name || newBlockName);
- setForcedBlockAttrs(editor, block);
- } else {
- block = parentBlock.cloneNode(false);
- }
- caretNode = block;
- if ($_259vs538jjgwe82a.shouldKeepStyles(editor) === false) {
- dom.setAttrib(block, 'style', null);
- dom.setAttrib(block, 'class', null);
- } else {
- do {
- if (textInlineElements[node.nodeName]) {
- if (isCaretNode(node)) {
- continue;
- }
- clonedNode = node.cloneNode(false);
- dom.setAttrib(clonedNode, 'id', '');
- if (block.hasChildNodes()) {
- clonedNode.appendChild(block.firstChild);
- block.appendChild(clonedNode);
- } else {
- caretNode = clonedNode;
- block.appendChild(clonedNode);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (startNode && editor.schema.isValidChild(rootBlockName, blockName.toLowerCase())) {
+ newBlock = dom.create(blockName);
+ setForcedBlockAttrs(editor, newBlock);
+ startNode.parentNode.insertBefore(newBlock, startNode);
+ node = startNode;
+ while (node && !dom.isBlock(node)) {
+ next = node.nextSibling;
+ newBlock.appendChild(node);
+ node = next;
</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.parentNode) && node !== editableRoot);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ rng.setStart(container, offset);
+ rng.setEnd(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">- emptyBlock(caretNode);
- return block;
</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 isCaretAtStartOrEndOfBlock = function (start) {
- var walker, node, name, normalizedOffset;
- normalizedOffset = normalizeZwspOffset(start, container, offset);
- if ($_3b9u2y1rjjgwe7qe.isText(container) && (start ? normalizedOffset > 0 : normalizedOffset < container.nodeValue.length)) {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var addBrToBlockIfNeeded = function (dom, block) {
+ var lastChild;
+ block.normalize();
+ lastChild = block.lastChild;
+ if (!lastChild || /^(left|right)$/gi.test(dom.getStyle(lastChild, 'float', true))) {
+ dom.add(block, '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">- if (container.parentNode === parentBlock && isAfterLastNodeInContainer && !start) {
- return true;
- }
- if (start && $_3b9u2y1rjjgwe7qe.isElement(container) && container === parentBlock.firstChild) {
- return true;
- }
- if (containerAndSiblingName(container, 'TABLE') || containerAndSiblingName(container, 'HR')) {
- return isAfterLastNodeInContainer && !start || !isAfterLastNodeInContainer && start;
- }
- walker = new TreeWalker(container, parentBlock);
- if ($_3b9u2y1rjjgwe7qe.isText(container)) {
- if (start && normalizedOffset === 0) {
- walker.prev();
- } else if (!start && normalizedOffset === container.nodeValue.length) {
- walker.next();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var insert$2 = function (editor, evt) {
+ var tmpRng, editableRoot, container, offset, parentBlock, shiftKey;
+ var newBlock, fragment, containerBlock, parentBlockName, containerBlockName, newBlockName, isAfterLastNodeInContainer;
+ var dom = editor.dom;
+ var schema = editor.schema, nonEmptyElementsMap = schema.getNonEmptyElements();
+ var rng = editor.selection.getRng();
+ var createNewBlock = function (name$$1) {
+ var node = container, block, clonedNode, caretNode;
+ var textInlineElements = schema.getTextInlineElements();
+ if (name$$1 || parentBlockName === 'TABLE' || parentBlockName === 'HR') {
+ block = dom.create(name$$1 || newBlockName);
+ setForcedBlockAttrs(editor, block);
+ } else {
+ block = parentBlock.cloneNode(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">- }
- while (node = walker.current()) {
- if ($_3b9u2y1rjjgwe7qe.isElement(node)) {
- if (!node.getAttribute('data-mce-bogus')) {
- name = node.nodeName.toLowerCase();
- if (nonEmptyElementsMap[name] && name !== 'br') {
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ caretNode = block;
+ if (Settings.shouldKeepStyles(editor) === false) {
+ dom.setAttrib(block, 'style', null);
+ dom.setAttrib(block, 'class', null);
+ } else {
+ do {
+ if (textInlineElements[node.nodeName]) {
+ if (isCaretNode(node)) {
+ continue;
+ }
+ clonedNode = node.cloneNode(false);
+ dom.setAttrib(clonedNode, 'id', '');
+ if (block.hasChildNodes()) {
+ clonedNode.appendChild(block.firstChild);
+ block.appendChild(clonedNode);
+ } else {
+ caretNode = clonedNode;
+ block.appendChild(clonedNode);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- } else if ($_3b9u2y1rjjgwe7qe.isText(node) && !/^[ \t\r\n]*$/.test(node.nodeValue)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } while ((node = node.parentNode) && node !== editableRoot);
+ }
+ emptyBlock(caretNode);
+ return block;
+ };
+ var isCaretAtStartOrEndOfBlock = function (start) {
+ var walker, node, name$$1, normalizedOffset;
+ normalizedOffset = normalizeZwspOffset(start, container, offset);
+ if (NodeType.isText(container) && (start ? normalizedOffset > 0 : normalizedOffset < container.nodeValue.length)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><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) {
- walker.prev();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (container.parentNode === parentBlock && isAfterLastNodeInContainer && !start) {
+ return true;
+ }
+ if (start && NodeType.isElement(container) && container === parentBlock.firstChild) {
+ return true;
+ }
+ if (containerAndSiblingName(container, 'TABLE') || containerAndSiblingName(container, 'HR')) {
+ return isAfterLastNodeInContainer && !start || !isAfterLastNodeInContainer && start;
+ }
+ walker = new TreeWalker(container, parentBlock);
+ if (NodeType.isText(container)) {
+ if (start && normalizedOffset === 0) {
+ walker.prev();
+ } else if (!start && normalizedOffset === container.nodeValue.length) {
+ walker.next();
+ }
+ }
+ while (node = walker.current()) {
+ if (NodeType.isElement(node)) {
+ if (!node.getAttribute('data-mce-bogus')) {
+ name$$1 = node.nodeName.toLowerCase();
+ if (nonEmptyElementsMap[name$$1] && name$$1 !== 'br') {
+ return false;
+ }
+ }
+ } else if (NodeType.isText(node) && !/^[ \t\r\n]*$/.test(node.nodeValue)) {
+ return false;
+ }
+ if (start) {
+ walker.prev();
+ } else {
+ walker.next();
+ }
+ }
+ return true;
+ };
+ var insertNewBlockAfter = function () {
+ if (/^(H[1-6]|PRE|FIGURE)$/.test(parentBlockName) && containerBlockName !== 'HGROUP') {
+ newBlock = createNewBlock(newBlockName);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- walker.next();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ newBlock = createNewBlock();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (Settings.shouldEndContainerOnEmptyBlock(editor) && canSplitBlock(dom, containerBlock) && dom.isEmpty(parentBlock)) {
+ newBlock = dom.split(containerBlock, parentBlock);
+ } else {
+ dom.insertAfter(newBlock, parentBlock);
+ }
+ NewLineUtils.moveToCaretPosition(editor, newBlock);
+ };
+ NormalizeRange.normalize(dom, rng).each(function (normRng) {
+ rng.setStart(normRng.startContainer, normRng.startOffset);
+ rng.setEnd(normRng.endContainer, normRng.endOffset);
+ });
+ container = rng.startContainer;
+ offset = rng.startOffset;
+ newBlockName = Settings.getForcedRootBlock(editor);
+ shiftKey = evt.shiftKey;
+ if (NodeType.isElement(container) && container.hasChildNodes()) {
+ isAfterLastNodeInContainer = offset > container.childNodes.length - 1;
+ container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
+ if (isAfterLastNodeInContainer && NodeType.isText(container)) {
+ offset = container.nodeValue.length;
+ } else {
+ 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">- return true;
- };
- var insertNewBlockAfter = function () {
- if (/^(H[1-6]|PRE|FIGURE)$/.test(parentBlockName) && containerBlockName !== 'HGROUP') {
- newBlock = createNewBlock(newBlockName);
- } else {
- newBlock = createNewBlock();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editableRoot = getEditableRoot$1(dom, container);
+ if (!editableRoot) {
+ 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 ($_259vs538jjgwe82a.shouldEndContainerOnEmptyBlock(editor) && canSplitBlock(dom, containerBlock) && dom.isEmpty(parentBlock)) {
- newBlock = dom.split(containerBlock, parentBlock);
- } else {
- dom.insertAfter(newBlock, parentBlock);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (newBlockName && !shiftKey || !newBlockName && shiftKey) {
+ container = wrapSelfAndSiblingsInDefaultBlock(editor, newBlockName, rng, 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">- $_7rkd6o7fjjgwe90j.moveToCaretPosition(editor, newBlock);
- };
- $_eqgqyj4jjjgwe8gi.normalize(dom, rng).each(function (normRng) {
- rng.setStart(normRng.startContainer, normRng.startOffset);
- rng.setEnd(normRng.endContainer, normRng.endOffset);
- });
- container = rng.startContainer;
- offset = rng.startOffset;
- newBlockName = $_259vs538jjgwe82a.getForcedRootBlock(editor);
- shiftKey = evt.shiftKey;
- if ($_3b9u2y1rjjgwe7qe.isElement(container) && container.hasChildNodes()) {
- isAfterLastNodeInContainer = offset > container.childNodes.length - 1;
- container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container;
- if (isAfterLastNodeInContainer && $_3b9u2y1rjjgwe7qe.isText(container)) {
- offset = container.nodeValue.length;
- } else {
- offset = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parentBlock = dom.getParent(container, dom.isBlock);
+ containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null;
+ parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : '';
+ containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : '';
+ if (containerBlockName === 'LI' && !evt.ctrlKey) {
+ parentBlock = containerBlock;
+ containerBlock = containerBlock.parentNode;
+ parentBlockName = containerBlockName;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- editableRoot = getEditableRoot$1(dom, container);
- if (!editableRoot) {
- return;
- }
- if (newBlockName && !shiftKey || !newBlockName && shiftKey) {
- container = wrapSelfAndSiblingsInDefaultBlock(editor, newBlockName, rng, container, offset);
- }
- parentBlock = dom.getParent(container, dom.isBlock);
- containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null;
- parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : '';
- containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : '';
- if (containerBlockName === 'LI' && !evt.ctrlKey) {
- parentBlock = containerBlock;
- containerBlock = containerBlock.parentNode;
- parentBlockName = containerBlockName;
- }
- if (/^(LI|DT|DD)$/.test(parentBlockName)) {
- if (dom.isEmpty(parentBlock)) {
- $_6mi4nu7ejjgwe90f.insert(editor, createNewBlock, containerBlock, parentBlock, newBlockName);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (/^(LI|DT|DD)$/.test(parentBlockName)) {
+ if (dom.isEmpty(parentBlock)) {
+ InsertLi.insert(editor, createNewBlock, containerBlock, parentBlock, newBlockName);
+ return;
+ }
+ }
+ if (newBlockName && parentBlock === editor.getBody()) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (newBlockName && parentBlock === editor.getBody()) {
- return;
- }
- newBlockName = newBlockName || 'P';
- if (isCaretContainerBlock(parentBlock)) {
- newBlock = showCaretContainerBlock(parentBlock);
- if (dom.isEmpty(parentBlock)) {
- emptyBlock(parentBlock);
- }
- $_7rkd6o7fjjgwe90j.moveToCaretPosition(editor, newBlock);
- } else if (isCaretAtStartOrEndOfBlock()) {
- insertNewBlockAfter();
- } else if (isCaretAtStartOrEndOfBlock(true)) {
- newBlock = parentBlock.parentNode.insertBefore(createNewBlock(), parentBlock);
- $_7rkd6o7fjjgwe90j.moveToCaretPosition(editor, containerAndSiblingName(parentBlock, 'HR') ? newBlock : parentBlock);
- } else {
- tmpRng = includeZwspInRange(rng).cloneRange();
- tmpRng.setEndAfter(parentBlock);
- fragment = tmpRng.extractContents();
- trimLeadingLineBreaks(fragment);
- newBlock = fragment.firstChild;
- dom.insertAfter(fragment, parentBlock);
- trimInlineElementsOnLeftSideOfBlock(dom, nonEmptyElementsMap, newBlock);
- addBrToBlockIfNeeded(dom, parentBlock);
- if (dom.isEmpty(parentBlock)) {
- emptyBlock(parentBlock);
- }
- newBlock.normalize();
- if (dom.isEmpty(newBlock)) {
- dom.remove(newBlock);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ newBlockName = newBlockName || 'P';
+ if (isCaretContainerBlock(parentBlock)) {
+ newBlock = showCaretContainerBlock(parentBlock);
+ if (dom.isEmpty(parentBlock)) {
+ emptyBlock(parentBlock);
+ }
+ NewLineUtils.moveToCaretPosition(editor, newBlock);
+ } else if (isCaretAtStartOrEndOfBlock()) {
</ins><span class="cx" style="display: block; padding: 0 10px"> insertNewBlockAfter();
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else if (isCaretAtStartOrEndOfBlock(true)) {
+ newBlock = parentBlock.parentNode.insertBefore(createNewBlock(), parentBlock);
+ NewLineUtils.moveToCaretPosition(editor, containerAndSiblingName(parentBlock, 'HR') ? newBlock : parentBlock);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_7rkd6o7fjjgwe90j.moveToCaretPosition(editor, newBlock);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ tmpRng = includeZwspInRange(rng).cloneRange();
+ tmpRng.setEndAfter(parentBlock);
+ fragment = tmpRng.extractContents();
+ trimZwsp(fragment);
+ trimLeadingLineBreaks(fragment);
+ newBlock = fragment.firstChild;
+ dom.insertAfter(fragment, parentBlock);
+ trimInlineElementsOnLeftSideOfBlock(dom, nonEmptyElementsMap, newBlock);
+ addBrToBlockIfNeeded(dom, parentBlock);
+ if (dom.isEmpty(parentBlock)) {
+ emptyBlock(parentBlock);
+ }
+ newBlock.normalize();
+ if (dom.isEmpty(newBlock)) {
+ dom.remove(newBlock);
+ insertNewBlockAfter();
+ } else {
+ NewLineUtils.moveToCaretPosition(editor, 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">- }
- dom.setAttrib(newBlock, 'id', '');
- editor.fire('NewBlock', { newBlock: newBlock });
- };
- var $_546sjh7djjgwe905 = { insert: insert$2 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ dom.setAttrib(newBlock, 'id', '');
+ editor.fire('NewBlock', { newBlock: newBlock });
+ };
+ var InsertBlock = { insert: insert$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">- var matchesSelector = function (editor, selector) {
- return $_7rkd6o7fjjgwe90j.getParentBlock(editor).filter(function (parentBlock) {
- return selector.length > 0 && $_4yq1xp1gjjgwe7op.is(Element$$1.fromDom(parentBlock), selector);
- }).isSome();
- };
- var shouldInsertBr = function (editor) {
- return matchesSelector(editor, $_259vs538jjgwe82a.getBrNewLineSelector(editor));
- };
- var shouldBlockNewLine = function (editor) {
- return matchesSelector(editor, $_259vs538jjgwe82a.getNoNewLineSelector(editor));
- };
- var $_aulrkk7hjjgwe90w = {
- shouldInsertBr: shouldInsertBr,
- shouldBlockNewLine: shouldBlockNewLine
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var matchesSelector = function (editor, selector) {
+ return NewLineUtils.getParentBlock(editor).filter(function (parentBlock) {
+ return selector.length > 0 && is$1(Element$$1.fromDom(parentBlock), selector);
+ }).isSome();
+ };
+ var shouldInsertBr = function (editor) {
+ return matchesSelector(editor, Settings.getBrNewLineSelector(editor));
+ };
+ var shouldBlockNewLine = function (editor) {
+ return matchesSelector(editor, Settings.getNoNewLineSelector(editor));
+ };
+ var ContextSelectors = {
+ shouldInsertBr: shouldInsertBr,
+ shouldBlockNewLine: shouldBlockNewLine
+ };
</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 newLineAction = Adt.generate([
- { br: [] },
- { block: [] },
- { none: [] }
- ]);
- var shouldBlockNewLine$1 = function (editor, shiftKey) {
- return $_aulrkk7hjjgwe90w.shouldBlockNewLine(editor);
- };
- var isBrMode = function (requiredState) {
- return function (editor, shiftKey) {
- var brMode = $_259vs538jjgwe82a.getForcedRootBlock(editor) === '';
- return brMode === requiredState;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var newLineAction = Adt.generate([
+ { br: [] },
+ { block: [] },
+ { none: [] }
+ ]);
+ var shouldBlockNewLine$1 = function (editor, shiftKey) {
+ return ContextSelectors.shouldBlockNewLine(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">- };
- var inListBlock = function (requiredState) {
- return function (editor, shiftKey) {
- return $_7rkd6o7fjjgwe90j.isListItemParentBlock(editor) === requiredState;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isBrMode = function (requiredState) {
+ return function (editor, shiftKey) {
+ var brMode = Settings.getForcedRootBlock(editor) === '';
+ return brMode === requiredState;
+ };
</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 inBlock = function (blockName, requiredState) {
- return function (editor, shiftKey) {
- var state = $_7rkd6o7fjjgwe90j.getParentBlockName(editor) === blockName.toUpperCase();
- return state === requiredState;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var inListBlock = function (requiredState) {
+ return function (editor, shiftKey) {
+ return NewLineUtils.isListItemParentBlock(editor) === requiredState;
+ };
</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 inPreBlock = function (requiredState) {
- return inBlock('pre', requiredState);
- };
- var inSummaryBlock = function () {
- return inBlock('summary', true);
- };
- var shouldPutBrInPre$1 = function (requiredState) {
- return function (editor, shiftKey) {
- return $_259vs538jjgwe82a.shouldPutBrInPre(editor) === requiredState;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var inBlock = function (blockName, requiredState) {
+ return function (editor, shiftKey) {
+ var state = NewLineUtils.getParentBlockName(editor) === blockName.toUpperCase();
+ return state === requiredState;
+ };
</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 inBrContext = function (editor, shiftKey) {
- return $_aulrkk7hjjgwe90w.shouldInsertBr(editor);
- };
- var hasShiftKey = function (editor, shiftKey) {
- return shiftKey;
- };
- var canInsertIntoEditableRoot = function (editor) {
- var forcedRootBlock = $_259vs538jjgwe82a.getForcedRootBlock(editor);
- var rootEditable = $_7rkd6o7fjjgwe90j.getEditableRoot(editor.dom, editor.selection.getStart());
- return rootEditable && editor.schema.isValidChild(rootEditable.nodeName, forcedRootBlock ? forcedRootBlock : 'P');
- };
- var match$2 = function (predicates, action) {
- return function (editor, shiftKey) {
- var isMatch = foldl(predicates, function (res, p) {
- return res && p(editor, shiftKey);
- }, true);
- return isMatch ? Option.some(action) : Option.none();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var inPreBlock = function (requiredState) {
+ return inBlock('pre', requiredState);
</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 getAction$1 = function (editor, evt) {
- return $_2racda49jjgwe8dz.evaluateUntil([
- match$2([shouldBlockNewLine$1], newLineAction.none()),
- match$2([inSummaryBlock()], newLineAction.br()),
- match$2([
- inPreBlock(true),
- shouldPutBrInPre$1(false),
- hasShiftKey
- ], newLineAction.br()),
- match$2([
- inPreBlock(true),
- shouldPutBrInPre$1(false)
- ], newLineAction.block()),
- match$2([
- inPreBlock(true),
- shouldPutBrInPre$1(true),
- hasShiftKey
- ], newLineAction.block()),
- match$2([
- inPreBlock(true),
- shouldPutBrInPre$1(true)
- ], newLineAction.br()),
- match$2([
- inListBlock(true),
- hasShiftKey
- ], newLineAction.br()),
- match$2([inListBlock(true)], newLineAction.block()),
- match$2([
- isBrMode(true),
- hasShiftKey,
- canInsertIntoEditableRoot
- ], newLineAction.block()),
- match$2([isBrMode(true)], newLineAction.br()),
- match$2([inBrContext], newLineAction.br()),
- match$2([
- isBrMode(false),
- hasShiftKey
- ], newLineAction.br()),
- match$2([canInsertIntoEditableRoot], newLineAction.block())
- ], [
- editor,
- evt.shiftKey
- ]).getOr(newLineAction.none());
- };
- var $_csna0e7gjjgwe90q = { getAction: getAction$1 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var inSummaryBlock = function () {
+ return inBlock('summary', true);
+ };
+ var shouldPutBrInPre$1 = function (requiredState) {
+ return function (editor, shiftKey) {
+ return Settings.shouldPutBrInPre(editor) === requiredState;
+ };
+ };
+ var inBrContext = function (editor, shiftKey) {
+ return ContextSelectors.shouldInsertBr(editor);
+ };
+ var hasShiftKey = function (editor, shiftKey) {
+ return shiftKey;
+ };
+ var canInsertIntoEditableRoot = function (editor) {
+ var forcedRootBlock = Settings.getForcedRootBlock(editor);
+ var rootEditable = NewLineUtils.getEditableRoot(editor.dom, editor.selection.getStart());
+ return rootEditable && editor.schema.isValidChild(rootEditable.nodeName, forcedRootBlock ? forcedRootBlock : 'P');
+ };
+ var match$2 = function (predicates, action) {
+ return function (editor, shiftKey) {
+ var isMatch = foldl(predicates, function (res, p) {
+ return res && p(editor, shiftKey);
+ }, true);
+ return isMatch ? Option.some(action) : Option.none();
+ };
+ };
+ var getAction$1 = function (editor, evt) {
+ return LazyEvaluator.evaluateUntil([
+ match$2([shouldBlockNewLine$1], newLineAction.none()),
+ match$2([inSummaryBlock()], newLineAction.br()),
+ match$2([
+ inPreBlock(true),
+ shouldPutBrInPre$1(false),
+ hasShiftKey
+ ], newLineAction.br()),
+ match$2([
+ inPreBlock(true),
+ shouldPutBrInPre$1(false)
+ ], newLineAction.block()),
+ match$2([
+ inPreBlock(true),
+ shouldPutBrInPre$1(true),
+ hasShiftKey
+ ], newLineAction.block()),
+ match$2([
+ inPreBlock(true),
+ shouldPutBrInPre$1(true)
+ ], newLineAction.br()),
+ match$2([
+ inListBlock(true),
+ hasShiftKey
+ ], newLineAction.br()),
+ match$2([inListBlock(true)], newLineAction.block()),
+ match$2([
+ isBrMode(true),
+ hasShiftKey,
+ canInsertIntoEditableRoot
+ ], newLineAction.block()),
+ match$2([isBrMode(true)], newLineAction.br()),
+ match$2([inBrContext], newLineAction.br()),
+ match$2([
+ isBrMode(false),
+ hasShiftKey
+ ], newLineAction.br()),
+ match$2([canInsertIntoEditableRoot], newLineAction.block())
+ ], [
+ editor,
+ evt.shiftKey
+ ]).getOr(newLineAction.none());
+ };
+ var NewLineAction = { getAction: getAction$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">- var insert$3 = function (editor, evt) {
- $_csna0e7gjjgwe90q.getAction(editor, evt).fold(function () {
- $_4o98q44ijjgwe8g6.insert(editor, evt);
- }, function () {
- $_546sjh7djjgwe905.insert(editor, evt);
- }, noop);
- };
- var $_8clxtd7cjjgwe8zw = { insert: insert$3 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var insert$3 = function (editor, evt) {
+ NewLineAction.getAction(editor, evt).fold(function () {
+ InsertBr.insert(editor, evt);
+ }, function () {
+ InsertBlock.insert(editor, evt);
+ }, noop);
+ };
+ var InsertNewLine = { insert: insert$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 endTypingLevel = function (undoManager) {
- if (undoManager.typing) {
- undoManager.typing = false;
- undoManager.add();
- }
- };
- var handleEnterKeyEvent = function (editor, event) {
- if (event.isDefaultPrevented()) {
- return;
- }
- event.preventDefault();
- endTypingLevel(editor.undoManager);
- editor.undoManager.transact(function () {
- if (editor.selection.isCollapsed() === false) {
- editor.execCommand('Delete');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var endTypingLevel = function (undoManager) {
+ if (undoManager.typing) {
+ undoManager.typing = false;
+ undoManager.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">- $_8clxtd7cjjgwe8zw.insert(editor, event);
- });
- };
- var setup$9 = function (editor) {
- editor.on('keydown', function (event) {
- if (event.keyCode === $_9udk9k5wjjgwe8on.ENTER) {
- handleEnterKeyEvent(editor, event);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var handleEnterKeyEvent = function (editor, event) {
+ if (event.isDefaultPrevented()) {
+ 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 $_6sjbmj7bjjgwe8zo = { setup: setup$9 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ event.preventDefault();
+ endTypingLevel(editor.undoManager);
+ editor.undoManager.transact(function () {
+ if (editor.selection.isCollapsed() === false) {
+ editor.execCommand('Delete');
+ }
+ InsertNewLine.insert(editor, event);
+ });
+ };
+ var setup$9 = function (editor) {
+ editor.on('keydown', function (event) {
+ if (event.keyCode === VK.ENTER) {
+ handleEnterKeyEvent(editor, event);
+ }
+ });
+ };
+ var EnterKey = { setup: setup$9 };
</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 isValidInsertPoint = function (location, caretPosition) {
- return isAtStartOrEnd(location) && $_3b9u2y1rjjgwe7qe.isText(caretPosition.container());
- };
- var insertNbspAtPosition = function (editor, caretPosition) {
- var container = caretPosition.container();
- var offset = caretPosition.offset();
- container.insertData(offset, '\xA0');
- editor.selection.setCursorLocation(container, offset + 1);
- };
- var insertAtLocation = function (editor, caretPosition, location) {
- if (isValidInsertPoint(location, caretPosition)) {
- insertNbspAtPosition(editor, caretPosition);
- return true;
- } else {
- return false;
- }
- };
- var insertAtCaret$2 = function (editor) {
- var isInlineTarget = curry($_av9utf3tjjgwe86b.isInlineTarget, editor);
- var caretPosition = CaretPosition$1.fromRangeStart(editor.selection.getRng());
- var boundaryLocation = $_g20q2x48jjgwe8dp.readLocation(isInlineTarget, editor.getBody(), caretPosition);
- return boundaryLocation.map(curry(insertAtLocation, editor, caretPosition)).getOr(false);
- };
- var isAtStartOrEnd = function (location) {
- return location.fold(constant(false), constant(true), constant(true), constant(false));
- };
- var insertAtSelection = function (editor) {
- return editor.selection.isCollapsed() ? insertAtCaret$2(editor) : false;
- };
- var $_azr5r97jjjgwe913 = { insertAtSelection: insertAtSelection };
-
- var executeKeydownOverride$2 = function (editor, evt) {
- $_4hb46d78jjgwe8z6.execute([{
- keyCode: $_9udk9k5wjjgwe8on.SPACEBAR,
- action: $_4hb46d78jjgwe8z6.action($_azr5r97jjjgwe913.insertAtSelection, editor)
- }], evt).each(function (_) {
- evt.preventDefault();
- });
- };
- var setup$10 = function (editor) {
- editor.on('keydown', function (evt) {
- if (evt.isDefaultPrevented() === false) {
- executeKeydownOverride$2(editor, evt);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var insertTextAtPosition = function (text, pos) {
+ var container = pos.container();
+ var offset = pos.offset();
+ if (NodeType.isText(container)) {
+ container.insertData(offset, text);
+ return Option.some(CaretPosition(container, offset + text.length));
+ } else {
+ return getElementFromPosition(pos).map(function (elm) {
+ var textNode = Element$$1.fromText(text);
+ if (pos.isAtEnd()) {
+ after(elm, textNode);
+ } else {
+ before(elm, textNode);
+ }
+ return CaretPosition(textNode.dom(), text.length);
+ });
</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 $_biwd8y7ijjgwe910 = { setup: setup$10 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var insertNbspAtPosition = curry(insertTextAtPosition, '\xA0');
+ var insertSpaceAtPosition = curry(insertTextAtPosition, ' ');
</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 findBlockCaretContainer = function (editor) {
- return $_ajwe9029jjgwe7ul.descendant(Element$$1.fromDom(editor.getBody()), '*[data-mce-caret]').fold(constant(null), function (elm) {
- return elm.dom();
- });
- };
- var removeIeControlRect = function (editor) {
- editor.selection.setRng(editor.selection.getRng());
- };
- var showBlockCaretContainer = function (editor, blockCaretContainer) {
- if (blockCaretContainer.hasAttribute('data-mce-caret')) {
- showCaretContainerBlock(blockCaretContainer);
- removeIeControlRect(editor);
- editor.selection.scrollIntoView(blockCaretContainer);
- }
- };
- var handleBlockContainer = function (editor, e) {
- var blockCaretContainer = findBlockCaretContainer(editor);
- if (!blockCaretContainer) {
- return;
- }
- if (e.type === 'compositionstart') {
- e.preventDefault();
- e.stopPropagation();
- showBlockCaretContainer(editor, blockCaretContainer);
- return;
- }
- if (hasContent(blockCaretContainer)) {
- showBlockCaretContainer(editor, blockCaretContainer);
- editor.undoManager.add();
- }
- };
- var setup$11 = function (editor) {
- editor.on('keyup compositionstart', curry(handleBlockContainer, editor));
- };
- var $_1hbznl7kjjgwe916 = { setup: setup$11 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isAtBlockBoundary = function (forward, root, pos) {
+ var parentBlocks = filter(Parents.parentsAndSelf(Element$$1.fromDom(pos.container()), root), isBlock);
+ return head(parentBlocks).fold(function () {
+ return CaretFinder.navigate(forward, root.dom(), pos).forall(function (newPos) {
+ return isInSameBlock(newPos, pos, root.dom()) === false;
+ });
+ }, function (parent) {
+ return CaretFinder.navigate(forward, parent.dom(), pos).isNone();
+ });
+ };
+ var isAtStartOfBlock = curry(isAtBlockBoundary, false);
+ var isAtEndOfBlock = curry(isAtBlockBoundary, 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">- var setup$12 = function (editor) {
- var caret = $_80ia3a4ajjgwe8e2.setupSelectedState(editor);
- $_1hbznl7kjjgwe916.setup(editor);
- $_97nc1t76jjgwe8yv.setup(editor, caret);
- $_cacenr79jjgwe8zc.setup(editor, caret);
- $_6sjbmj7bjjgwe8zo.setup(editor);
- $_biwd8y7ijjgwe910.setup(editor);
- };
- var $_ajiltf75jjgwe8yt = { setup: setup$12 };
-
- function Quirks (editor) {
- var each = $_6cwiepljjgwe7j4.each;
- var BACKSPACE = $_9udk9k5wjjgwe8on.BACKSPACE, DELETE = $_9udk9k5wjjgwe8on.DELETE, dom = editor.dom, selection = editor.selection, settings = editor.settings, parser = editor.parser;
- var isGecko = $_bcvfv9ajjgwe79v.gecko, isIE = $_bcvfv9ajjgwe79v.ie, isWebKit = $_bcvfv9ajjgwe79v.webkit;
- var mceInternalUrlPrefix = 'data:text/mce-internal,';
- var mceInternalDataType = isIE ? 'Text' : 'URL';
- var setEditorCommandState = function (cmd, state) {
- try {
- editor.getDoc().execCommand(cmd, false, state);
- } catch (ex) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var nbsp = '\xA0';
+ var isInMiddleOfText = function (pos) {
+ return CaretPosition.isTextPosition(pos) && !pos.isAtStart() && !pos.isAtEnd();
+ };
+ var getClosestBlock = function (root, pos) {
+ var parentBlocks = filter(Parents.parentsAndSelf(Element$$1.fromDom(pos.container()), root), isBlock);
+ return head(parentBlocks).getOr(root);
+ };
+ var hasSpaceBefore = function (root, pos) {
+ if (isInMiddleOfText(pos)) {
+ return isAfterSpace(pos);
+ } else {
+ return isAfterSpace(pos) || CaretFinder.prevPosition(getClosestBlock(root, pos).dom(), pos).exists(isAfterSpace);
</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">- var isDefaultPrevented = function (e) {
- return e.isDefaultPrevented();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hasSpaceAfter = function (root, pos) {
+ if (isInMiddleOfText(pos)) {
+ return isBeforeSpace(pos);
+ } else {
+ return isBeforeSpace(pos) || CaretFinder.nextPosition(getClosestBlock(root, pos).dom(), pos).exists(isBeforeSpace);
+ }
</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 setMceInternalContent = function (e) {
- var selectionHtml, internalContent;
- if (e.dataTransfer) {
- if (editor.selection.isCollapsed() && e.target.tagName === 'IMG') {
- selection.select(e.target);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isPreValue = function (value$$1) {
+ return contains([
+ 'pre',
+ 'pre-line',
+ 'pre-wrap'
+ ], value$$1);
+ };
+ var isInPre = function (pos) {
+ return getElementFromPosition(pos).bind(function (elm) {
+ return closest(elm, isElement);
+ }).exists(function (elm) {
+ return isPreValue(get$2(elm, 'white-space'));
+ });
+ };
+ var isAtBeginningOfBody = function (root, pos) {
+ return CaretFinder.prevPosition(root.dom(), pos).isNone();
+ };
+ var isAtEndOfBody = function (root, pos) {
+ return CaretFinder.nextPosition(root.dom(), pos).isNone();
+ };
+ var isAtLineBoundary = function (root, pos) {
+ return isAtBeginningOfBody(root, pos) || isAtEndOfBody(root, pos) || isAtStartOfBlock(root, pos) || isAtEndOfBlock(root, pos) || isAfterBr(root, pos) || isBeforeBr(root, pos);
+ };
+ var needsToHaveNbsp = function (root, pos) {
+ if (isInPre(pos)) {
+ return false;
+ } else {
+ return isAtLineBoundary(root, pos) || hasSpaceBefore(root, pos) || hasSpaceAfter(root, pos);
+ }
+ };
+ var needsToBeNbspLeft = function (root, pos) {
+ if (isInPre(pos)) {
+ return false;
+ } else {
+ return isAtStartOfBlock(root, pos) || isAfterBr(root, pos) || hasSpaceBefore(root, pos);
+ }
+ };
+ var needsToBeNbspRight = function (root, pos) {
+ if (isInPre(pos)) {
+ return false;
+ } else {
+ return isAtEndOfBlock(root, pos) || isBeforeBr(root, pos) || hasSpaceAfter(root, pos);
+ }
+ };
+ var isNbspAt = function (text, offset) {
+ return isNbsp(text.charAt(offset));
+ };
+ var hasNbsp = function (pos) {
+ var container = pos.container();
+ return NodeType.isText(container) && contains$2(container.data, nbsp);
+ };
+ var normalizeNbspAtStart = function (root, node, text) {
+ var firstPos = CaretPosition(node, 0);
+ if (isNbspAt(text, 0) && !needsToBeNbspLeft(root, firstPos)) {
+ return ' ' + text.slice(1);
+ } else {
+ return text;
+ }
+ };
+ var normalizeNbspMiddle = function (text) {
+ return map(text.split(''), function (chr, i, chars) {
+ if (isNbsp(chr) && i > 0 && i < chars.length - 1 && isContent(chars[i - 1]) && isContent(chars[i + 1])) {
+ return ' ';
+ } else {
+ return 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">- selectionHtml = editor.selection.getContent();
- if (selectionHtml.length > 0) {
- internalContent = mceInternalUrlPrefix + escape(editor.id) + ',' + escape(selectionHtml);
- e.dataTransfer.setData(mceInternalDataType, internalContent);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }).join('');
+ };
+ var normalizeNbspAtEnd = function (root, node, text) {
+ var lastPos = CaretPosition(node, text.length);
+ if (isNbspAt(text, text.length - 1) && !needsToBeNbspRight(root, lastPos)) {
+ return text.slice(0, -1) + ' ';
+ } else {
+ return text;
</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">- var getMceInternalContent = function (e) {
- var internalContent;
- if (e.dataTransfer) {
- internalContent = e.dataTransfer.getData(mceInternalDataType);
- if (internalContent && internalContent.indexOf(mceInternalUrlPrefix) >= 0) {
- internalContent = internalContent.substr(mceInternalUrlPrefix.length).split(',');
- return {
- id: unescape(internalContent[0]),
- html: unescape(internalContent[1])
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var normalizeNbsps = function (root, pos) {
+ return Option.some(pos).filter(hasNbsp).bind(function (pos) {
+ var container = pos.container();
+ var text = container.nodeValue;
+ var newText = normalizeNbspAtStart(root, container, normalizeNbspMiddle(normalizeNbspAtEnd(root, container, text)));
+ if (text !== newText) {
+ pos.container().nodeValue = newText;
+ return Option.some(pos);
+ } else {
+ return Option.none();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ var normalizeNbspsInEditor = function (editor) {
+ var root = Element$$1.fromDom(editor.getBody());
+ if (editor.selection.isCollapsed()) {
+ normalizeNbsps(root, CaretPosition.fromRangeStart(editor.selection.getRng())).each(function (pos) {
+ editor.selection.setRng(pos.toRange());
+ });
</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 null;
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var insertClipboardContents = function (content, internal) {
- if (editor.queryCommandSupported('mceInsertClipboardContent')) {
- editor.execCommand('mceInsertClipboardContent', false, {
- content: content,
- internal: internal
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var locationToCaretPosition = function (root) {
+ return function (location) {
+ return location.fold(function (element) {
+ return CaretFinder.prevPosition(root.dom(), CaretPosition$1.before(element));
+ }, function (element) {
+ return CaretFinder.firstPositionIn(element);
+ }, function (element) {
+ return CaretFinder.lastPositionIn(element);
+ }, function (element) {
+ return CaretFinder.nextPosition(root.dom(), CaretPosition$1.after(element));
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ };
+ var insertInlineBoundarySpaceOrNbsp = function (root, pos) {
+ return function (checkPos) {
+ return needsToHaveNbsp(root, checkPos) ? insertNbspAtPosition(pos) : insertSpaceAtPosition(pos);
+ };
+ };
+ var setSelection$1 = function (editor) {
+ return function (pos) {
+ editor.selection.setRng(pos.toRange());
+ editor.nodeChanged();
+ return true;
+ };
+ };
+ var insertSpaceOrNbspAtSelection = function (editor) {
+ var pos = CaretPosition$1.fromRangeStart(editor.selection.getRng());
+ var root = Element$$1.fromDom(editor.getBody());
+ if (editor.selection.isCollapsed()) {
+ var isInlineTarget = curry(InlineUtils.isInlineTarget, editor);
+ var caretPosition = CaretPosition$1.fromRangeStart(editor.selection.getRng());
+ return BoundaryLocation.readLocation(isInlineTarget, editor.getBody(), caretPosition).bind(locationToCaretPosition(root)).bind(insertInlineBoundarySpaceOrNbsp(root, pos)).exists(setSelection$1(editor));
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- editor.execCommand('mceInsertContent', false, content);
</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><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var emptyEditorWhenDeleting = function () {
- var serializeRng = function (rng) {
- var body = dom.create('body');
- var contents = rng.cloneContents();
- body.appendChild(contents);
- return selection.serializer.serialize(body, { format: 'html' });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var executeKeydownOverride$2 = function (editor, evt) {
+ MatchKeys.execute([{
+ keyCode: VK.SPACEBAR,
+ action: MatchKeys.action(insertSpaceOrNbspAtSelection, editor)
+ }], evt).each(function (_) {
+ evt.preventDefault();
+ });
+ };
+ var setup$a = function (editor) {
+ editor.on('keydown', function (evt) {
+ if (evt.isDefaultPrevented() === false) {
+ executeKeydownOverride$2(editor, evt);
+ }
+ });
+ };
+ var SpaceKey = { setup: setup$a };
+
+ var findBlockCaretContainer = function (editor) {
+ return descendant$1(Element$$1.fromDom(editor.getBody()), '*[data-mce-caret]').fold(constant(null), function (elm) {
+ return elm.dom();
+ });
+ };
+ var removeIeControlRect = function (editor) {
+ editor.selection.setRng(editor.selection.getRng());
+ };
+ var showBlockCaretContainer = function (editor, blockCaretContainer) {
+ if (blockCaretContainer.hasAttribute('data-mce-caret')) {
+ showCaretContainerBlock(blockCaretContainer);
+ removeIeControlRect(editor);
+ editor.selection.scrollIntoView(blockCaretContainer);
+ }
+ };
+ var handleBlockContainer = function (editor, e) {
+ var blockCaretContainer = findBlockCaretContainer(editor);
+ if (!blockCaretContainer) {
+ return;
+ }
+ if (e.type === 'compositionstart') {
+ e.preventDefault();
+ e.stopPropagation();
+ showBlockCaretContainer(editor, blockCaretContainer);
+ return;
+ }
+ if (hasContent(blockCaretContainer)) {
+ showBlockCaretContainer(editor, blockCaretContainer);
+ editor.undoManager.add();
+ }
+ };
+ var setup$b = function (editor) {
+ editor.on('keyup compositionstart', curry(handleBlockContainer, editor));
+ };
+ var CaretContainerInput = { setup: setup$b };
+
+ var browser$4 = PlatformDetection$1.detect().browser;
+ var setupIeInput = function (editor) {
+ var keypressThrotter = first$1(function () {
+ if (!editor.composing) {
+ normalizeNbspsInEditor(editor);
+ }
+ }, 0);
+ if (browser$4.isIE()) {
+ editor.on('keypress', function (e) {
+ keypressThrotter.throttle();
+ });
+ editor.on('remove', function (e) {
+ keypressThrotter.cancel();
+ });
+ }
+ };
+ var setup$c = function (editor) {
+ setupIeInput(editor);
+ editor.on('input', function (e) {
+ if (e.isComposing === false) {
+ normalizeNbspsInEditor(editor);
+ }
+ });
+ };
+
+ var setup$d = function (editor) {
+ var caret = BoundarySelection.setupSelectedState(editor);
+ CaretContainerInput.setup(editor);
+ ArrowKeys.setup(editor, caret);
+ DeleteBackspaceKeys.setup(editor, caret);
+ EnterKey.setup(editor);
+ SpaceKey.setup(editor);
+ setup$c(editor);
+ };
+ var KeyboardOverrides = { setup: setup$d };
+
+ function Quirks (editor) {
+ var each = Tools.each;
+ var BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection, settings = editor.settings, parser = editor.parser;
+ var isGecko = Env.gecko, isIE = Env.ie, isWebKit = Env.webkit;
+ var mceInternalUrlPrefix = 'data:text/mce-internal,';
+ var mceInternalDataType = isIE ? 'Text' : 'URL';
+ var setEditorCommandState = function (cmd, state) {
+ try {
+ editor.getDoc().execCommand(cmd, false, state);
+ } catch (ex) {
+ }
</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 allContentsSelected = function (rng) {
- var selection = serializeRng(rng);
- var allRng = dom.createRng();
- allRng.selectNode(editor.getBody());
- var allSelection = serializeRng(allRng);
- return selection === allSelection;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isDefaultPrevented = function (e) {
+ return e.isDefaultPrevented();
</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('keydown', function (e) {
- var keyCode = e.keyCode;
- var isCollapsed, body;
- if (!isDefaultPrevented(e) && (keyCode === DELETE || keyCode === BACKSPACE)) {
- isCollapsed = editor.selection.isCollapsed();
- body = editor.getBody();
- if (isCollapsed && !dom.isEmpty(body)) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setMceInternalContent = function (e) {
+ var selectionHtml, internalContent;
+ if (e.dataTransfer) {
+ if (editor.selection.isCollapsed() && e.target.tagName === 'IMG') {
+ selection.select(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">- if (!isCollapsed && !allContentsSelected(editor.selection.getRng())) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ selectionHtml = editor.selection.getContent();
+ if (selectionHtml.length > 0) {
+ internalContent = mceInternalUrlPrefix + escape(editor.id) + ',' + escape(selectionHtml);
+ e.dataTransfer.setData(mceInternalDataType, internalContent);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- e.preventDefault();
- editor.setContent('');
- if (body.firstChild && dom.isBlock(body.firstChild)) {
- editor.selection.setCursorLocation(body.firstChild, 0);
- } else {
- editor.selection.setCursorLocation(body, 0);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ };
+ var getMceInternalContent = function (e) {
+ var internalContent;
+ if (e.dataTransfer) {
+ internalContent = e.dataTransfer.getData(mceInternalDataType);
+ if (internalContent && internalContent.indexOf(mceInternalUrlPrefix) >= 0) {
+ internalContent = internalContent.substr(mceInternalUrlPrefix.length).split(',');
+ return {
+ id: unescape(internalContent[0]),
+ html: unescape(internalContent[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">- editor.nodeChanged();
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- };
- var selectAll = function () {
- editor.shortcuts.add('meta+a', null, 'SelectAll');
- };
- var inputMethodFocus = function () {
- if (!editor.settings.content_editable) {
- dom.bind(editor.getDoc(), 'mousedown mouseup', function (e) {
- var rng;
- if (e.target === editor.getDoc().documentElement) {
- rng = selection.getRng();
- editor.getBody().focus();
- if (e.type === 'mousedown') {
- if (isCaretContainer(rng.startContainer)) {
- return;
- }
- selection.placeCaretAt(e.clientX, e.clientY);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return null;
+ };
+ var insertClipboardContents = function (content, internal) {
+ if (editor.queryCommandSupported('mceInsertClipboardContent')) {
+ editor.execCommand('mceInsertClipboardContent', false, {
+ content: content,
+ internal: internal
+ });
+ } else {
+ editor.execCommand('mceInsertContent', false, content);
+ }
+ };
+ var emptyEditorWhenDeleting = function () {
+ var serializeRng = function (rng) {
+ var body = dom.create('body');
+ var contents = rng.cloneContents();
+ body.appendChild(contents);
+ return selection.serializer.serialize(body, { format: 'html' });
+ };
+ var allContentsSelected = function (rng) {
+ var selection = serializeRng(rng);
+ var allRng = dom.createRng();
+ allRng.selectNode(editor.getBody());
+ var allSelection = serializeRng(allRng);
+ return selection === allSelection;
+ };
+ editor.on('keydown', function (e) {
+ var keyCode = e.keyCode;
+ var isCollapsed, body;
+ if (!isDefaultPrevented(e) && (keyCode === DELETE || keyCode === BACKSPACE)) {
+ isCollapsed = editor.selection.isCollapsed();
+ body = editor.getBody();
+ if (isCollapsed && !dom.isEmpty(body)) {
+ return;
+ }
+ if (!isCollapsed && !allContentsSelected(editor.selection.getRng())) {
+ return;
+ }
+ e.preventDefault();
+ editor.setContent('');
+ if (body.firstChild && dom.isBlock(body.firstChild)) {
+ editor.selection.setCursorLocation(body.firstChild, 0);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- selection.setRng(rng);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.selection.setCursorLocation(body, 0);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><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><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- };
- var removeHrOnBackspace = function () {
- editor.on('keydown', function (e) {
- if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
- if (!editor.getBody().getElementsByTagName('hr').length) {
- return;
- }
- if (selection.isCollapsed() && selection.getRng().startOffset === 0) {
- var node = selection.getNode();
- var previousSibling = node.previousSibling;
- if (node.nodeName === 'HR') {
- dom.remove(node);
- e.preventDefault();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var selectAll = function () {
+ editor.shortcuts.add('meta+a', null, 'SelectAll');
+ };
+ var inputMethodFocus = function () {
+ if (!editor.settings.content_editable) {
+ dom.bind(editor.getDoc(), 'mousedown mouseup', function (e) {
+ var rng;
+ if (e.target === editor.getDoc().documentElement) {
+ rng = selection.getRng();
+ editor.getBody().focus();
+ if (e.type === 'mousedown') {
+ if (isCaretContainer(rng.startContainer)) {
+ return;
+ }
+ selection.placeCaretAt(e.clientX, e.clientY);
+ } else {
+ selection.setRng(rng);
+ }
+ }
+ });
+ }
+ };
+ var removeHrOnBackspace = function () {
+ editor.on('keydown', function (e) {
+ if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
+ if (!editor.getBody().getElementsByTagName('hr').length) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === 'hr') {
- dom.remove(previousSibling);
- e.preventDefault();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (selection.isCollapsed() && selection.getRng().startOffset === 0) {
+ var node = selection.getNode();
+ var previousSibling = node.previousSibling;
+ if (node.nodeName === 'HR') {
+ dom.remove(node);
+ e.preventDefault();
+ return;
+ }
+ if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === 'hr') {
+ dom.remove(previousSibling);
+ e.preventDefault();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ };
+ var focusBody = function () {
+ if (!Range.prototype.getClientRects) {
+ editor.on('mousedown', function (e) {
+ if (!isDefaultPrevented(e) && e.target.nodeName === 'HTML') {
+ var body_1 = editor.getBody();
+ body_1.blur();
+ Delay.setEditorTimeout(editor, function () {
+ body_1.focus();
+ });
+ }
+ });
</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 focusBody = function () {
- if (!Range.prototype.getClientRects) {
- editor.on('mousedown', function (e) {
- if (!isDefaultPrevented(e) && e.target.nodeName === 'HTML') {
- var body_1 = editor.getBody();
- body_1.blur();
- $_9o1ijaijjgwe7dm.setEditorTimeout(editor, function () {
- body_1.focus();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var selectControlElements = function () {
+ editor.on('click', function (e) {
+ var target = e.target;
+ if (/^(IMG|HR)$/.test(target.nodeName) && dom.getContentEditableParent(target) !== 'false') {
+ e.preventDefault();
+ editor.selection.select(target);
+ editor.nodeChanged();
+ }
+ if (target.nodeName === 'A' && dom.hasClass(target, 'mce-item-anchor')) {
+ e.preventDefault();
+ selection.select(target);
+ }
+ });
+ };
+ var removeStylesWhenDeletingAcrossBlockElements = function () {
+ var getAttributeApplyFunction = function () {
+ var template = dom.getAttribs(selection.getStart().cloneNode(false));
+ return function () {
+ var target = selection.getStart();
+ if (target !== editor.getBody()) {
+ dom.setAttrib(target, 'style', null);
+ each(template, function (attr) {
+ target.setAttributeNode(attr.cloneNode(true));
+ });
+ }
+ };
+ };
+ var isSelectionAcrossElements = function () {
+ return !selection.isCollapsed() && dom.getParent(selection.getStart(), dom.isBlock) !== dom.getParent(selection.getEnd(), dom.isBlock);
+ };
+ editor.on('keypress', function (e) {
+ var applyAttributes;
+ if (!isDefaultPrevented(e) && (e.keyCode === 8 || e.keyCode === 46) && isSelectionAcrossElements()) {
+ applyAttributes = getAttributeApplyFunction();
+ editor.getDoc().execCommand('delete', false, null);
+ applyAttributes();
+ e.preventDefault();
+ return false;
+ }
+ });
+ dom.bind(editor.getDoc(), 'cut', function (e) {
+ var applyAttributes;
+ if (!isDefaultPrevented(e) && isSelectionAcrossElements()) {
+ applyAttributes = getAttributeApplyFunction();
+ Delay.setEditorTimeout(editor, function () {
+ applyAttributes();
</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">- }
- };
- var selectControlElements = function () {
- editor.on('click', function (e) {
- var target = e.target;
- if (/^(IMG|HR)$/.test(target.nodeName) && dom.getContentEditableParent(target) !== 'false') {
- e.preventDefault();
- editor.selection.select(target);
- editor.nodeChanged();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var disableBackspaceIntoATable = function () {
+ editor.on('keydown', function (e) {
+ if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
+ if (selection.isCollapsed() && selection.getRng().startOffset === 0) {
+ var previousSibling = selection.getNode().previousSibling;
+ if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === 'table') {
+ e.preventDefault();
+ return false;
+ }
+ }
+ }
+ });
+ };
+ var removeBlockQuoteOnBackSpace = function () {
+ editor.on('keydown', function (e) {
+ var rng, container, offset, root, parent$$1;
+ if (isDefaultPrevented(e) || e.keyCode !== VK.BACKSPACE) {
+ return;
+ }
+ rng = selection.getRng();
+ container = rng.startContainer;
+ offset = rng.startOffset;
+ root = dom.getRoot();
+ parent$$1 = container;
+ if (!rng.collapsed || offset !== 0) {
+ return;
+ }
+ while (parent$$1 && parent$$1.parentNode && parent$$1.parentNode.firstChild === parent$$1 && parent$$1.parentNode !== root) {
+ parent$$1 = parent$$1.parentNode;
+ }
+ if (parent$$1.tagName === 'BLOCKQUOTE') {
+ editor.formatter.toggle('blockquote', null, parent$$1);
+ rng = dom.createRng();
+ rng.setStart(container, 0);
+ rng.setEnd(container, 0);
+ selection.setRng(rng);
+ }
+ });
+ };
+ var setGeckoEditingOptions = function () {
+ var setOpts = function () {
+ setEditorCommandState('StyleWithCSS', false);
+ setEditorCommandState('enableInlineTableEditing', false);
+ if (!settings.object_resizing) {
+ setEditorCommandState('enableObjectResizing', false);
+ }
+ };
+ if (!settings.readonly) {
+ editor.on('BeforeExecCommand MouseDown', setOpts);
</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 (target.nodeName === 'A' && dom.hasClass(target, 'mce-item-anchor')) {
- e.preventDefault();
- selection.select(target);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var addBrAfterLastLinks = function () {
+ var fixLinks = function () {
+ each(dom.select('a'), function (node) {
+ var parentNode = node.parentNode;
+ var root = dom.getRoot();
+ if (parentNode.lastChild === node) {
+ while (parentNode && !dom.isBlock(parentNode)) {
+ if (parentNode.parentNode.lastChild !== parentNode || parentNode === root) {
+ return;
+ }
+ parentNode = parentNode.parentNode;
+ }
+ dom.add(parentNode, 'br', { 'data-mce-bogus': 1 });
+ }
+ });
+ };
+ editor.on('SetContent ExecCommand', function (e) {
+ if (e.type === 'setcontent' || e.command === 'mceInsertLink') {
+ fixLinks();
+ }
+ });
+ };
+ var setDefaultBlockType = function () {
+ if (settings.forced_root_block) {
+ editor.on('init', function () {
+ setEditorCommandState('DefaultParagraphSeparator', 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">- });
- };
- var removeStylesWhenDeletingAcrossBlockElements = function () {
- var getAttributeApplyFunction = function () {
- var template = dom.getAttribs(selection.getStart().cloneNode(false));
- return function () {
- var target = selection.getStart();
- if (target !== editor.getBody()) {
- dom.setAttrib(target, 'style', null);
- each(template, function (attr) {
- target.setAttributeNode(attr.cloneNode(true));
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var normalizeSelection = function () {
+ editor.on('keyup focusin mouseup', function (e) {
+ if (!VK.modifierPressed(e)) {
+ selection.normalize();
</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">+ }, 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">- var isSelectionAcrossElements = function () {
- return !selection.isCollapsed() && dom.getParent(selection.getStart(), dom.isBlock) !== dom.getParent(selection.getEnd(), dom.isBlock);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var showBrokenImageIcon = function () {
+ editor.contentStyles.push('img:-moz-broken {' + '-moz-force-broken-image-icon:1;' + 'min-width:24px;' + 'min-height:24px' + '}');
</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('keypress', function (e) {
- var applyAttributes;
- if (!isDefaultPrevented(e) && (e.keyCode === 8 || e.keyCode === 46) && isSelectionAcrossElements()) {
- applyAttributes = getAttributeApplyFunction();
- editor.getDoc().execCommand('delete', false, null);
- applyAttributes();
- e.preventDefault();
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var restoreFocusOnKeyDown = function () {
+ if (!editor.inline) {
+ editor.on('keydown', function () {
+ if (document.activeElement === document.body) {
+ editor.getWin().focus();
+ }
+ });
</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(editor.getDoc(), 'cut', function (e) {
- var applyAttributes;
- if (!isDefaultPrevented(e) && isSelectionAcrossElements()) {
- applyAttributes = getAttributeApplyFunction();
- $_9o1ijaijjgwe7dm.setEditorTimeout(editor, function () {
- applyAttributes();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var bodyHeight = function () {
+ if (!editor.inline) {
+ editor.contentStyles.push('body {min-height: 150px}');
+ editor.on('click', function (e) {
+ var rng;
+ if (e.target.nodeName === 'HTML') {
+ if (Env.ie > 11) {
+ editor.getBody().focus();
+ return;
+ }
+ rng = editor.selection.getRng();
+ editor.getBody().focus();
+ editor.selection.setRng(rng);
+ editor.selection.normalize();
+ editor.nodeChanged();
+ }
</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">- });
- };
- var disableBackspaceIntoATable = function () {
- editor.on('keydown', function (e) {
- if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) {
- if (selection.isCollapsed() && selection.getRng().startOffset === 0) {
- var previousSibling = selection.getNode().previousSibling;
- if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === 'table') {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var blockCmdArrowNavigation = function () {
+ if (Env.mac) {
+ editor.on('keydown', function (e) {
+ if (VK.metaKeyPressed(e) && !e.shiftKey && (e.keyCode === 37 || e.keyCode === 39)) {
</ins><span class="cx" style="display: block; padding: 0 10px"> e.preventDefault();
</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">+ editor.selection.getSel().modify('move', e.keyCode === 37 ? 'backward' : 'forward', 'lineboundary');
</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">+ });
</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 removeBlockQuoteOnBackSpace = function () {
- editor.on('keydown', function (e) {
- var rng, container, offset, root, parent$$1;
- if (isDefaultPrevented(e) || e.keyCode !== $_9udk9k5wjjgwe8on.BACKSPACE) {
- return;
- }
- rng = selection.getRng();
- container = rng.startContainer;
- offset = rng.startOffset;
- root = dom.getRoot();
- parent$$1 = container;
- if (!rng.collapsed || offset !== 0) {
- return;
- }
- while (parent$$1 && parent$$1.parentNode && parent$$1.parentNode.firstChild === parent$$1 && parent$$1.parentNode !== root) {
- parent$$1 = parent$$1.parentNode;
- }
- if (parent$$1.tagName === 'BLOCKQUOTE') {
- editor.formatter.toggle('blockquote', null, parent$$1);
- rng = dom.createRng();
- rng.setStart(container, 0);
- rng.setEnd(container, 0);
- selection.setRng(rng);
- }
- });
- };
- var setGeckoEditingOptions = function () {
- var setOpts = function () {
- setEditorCommandState('StyleWithCSS', false);
- setEditorCommandState('enableInlineTableEditing', false);
- if (!settings.object_resizing) {
- setEditorCommandState('enableObjectResizing', false);
- }
</del><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.readonly) {
- editor.on('BeforeExecCommand MouseDown', setOpts);
- }
- };
- var addBrAfterLastLinks = function () {
- var fixLinks = function () {
- each(dom.select('a'), function (node) {
- var parentNode = node.parentNode;
- var root = dom.getRoot();
- if (parentNode.lastChild === node) {
- while (parentNode && !dom.isBlock(parentNode)) {
- if (parentNode.parentNode.lastChild !== parentNode || parentNode === root) {
- return;
- }
- parentNode = parentNode.parentNode;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var disableAutoUrlDetect = function () {
+ setEditorCommandState('AutoUrlDetect', false);
+ };
+ var tapLinksAndImages = function () {
+ editor.on('click', function (e) {
+ var elm = e.target;
+ do {
+ if (elm.tagName === 'A') {
+ e.preventDefault();
+ 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">- dom.add(parentNode, 'br', { 'data-mce-bogus': 1 });
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } while (elm = elm.parentNode);
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.contentStyles.push('.mce-content-body {-webkit-touch-callout: 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">- editor.on('SetContent ExecCommand', function (e) {
- if (e.type === 'setcontent' || e.command === 'mceInsertLink') {
- fixLinks();
- }
- });
- };
- var setDefaultBlockType = function () {
- if (settings.forced_root_block) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var blockFormSubmitInsideEditor = function () {
</ins><span class="cx" style="display: block; padding: 0 10px"> editor.on('init', function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- setEditorCommandState('DefaultParagraphSeparator', settings.forced_root_block);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.dom.bind(editor.getBody(), 'submit', function (e) {
+ e.preventDefault();
+ });
</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 normalizeSelection = function () {
- editor.on('keyup focusin mouseup', function (e) {
- if (!$_9udk9k5wjjgwe8on.modifierPressed(e)) {
- selection.normalize();
- }
- }, true);
- };
- var showBrokenImageIcon = function () {
- editor.contentStyles.push('img:-moz-broken {' + '-moz-force-broken-image-icon:1;' + 'min-width:24px;' + 'min-height:24px' + '}');
- };
- var restoreFocusOnKeyDown = function () {
- if (!editor.inline) {
- editor.on('keydown', function () {
- if (document.activeElement === document.body) {
- editor.getWin().focus();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var removeAppleInterchangeBrs = function () {
+ parser.addNodeFilter('br', function (nodes) {
+ var i = nodes.length;
+ while (i--) {
+ if (nodes[i].attr('class') === 'Apple-interchange-newline') {
+ nodes[i].remove();
+ }
</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">- }
- };
- var bodyHeight = function () {
- if (!editor.inline) {
- editor.contentStyles.push('body {min-height: 150px}');
- editor.on('click', function (e) {
- var rng;
- if (e.target.nodeName === 'HTML') {
- if ($_bcvfv9ajjgwe79v.ie > 11) {
- editor.getBody().focus();
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var ieInternalDragAndDrop = function () {
+ editor.on('dragstart', function (e) {
+ setMceInternalContent(e);
+ });
+ editor.on('drop', function (e) {
+ if (!isDefaultPrevented(e)) {
+ var internalContent = getMceInternalContent(e);
+ if (internalContent && internalContent.id !== editor.id) {
+ e.preventDefault();
+ var rng = CaretRangeFromPoint.fromPoint(e.x, e.y, editor.getDoc());
+ selection.setRng(rng);
+ insertClipboardContents(internalContent.html, 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">- rng = editor.selection.getRng();
- editor.getBody().focus();
- editor.selection.setRng(rng);
- editor.selection.normalize();
- editor.nodeChanged();
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var refreshContentEditable = function () {
+ };
+ var isHidden = function () {
+ var sel;
+ if (!isGecko || editor.removed) {
+ return 0;
+ }
+ sel = editor.selection.getSel();
+ return !sel || !sel.rangeCount || sel.rangeCount === 0;
+ };
+ removeBlockQuoteOnBackSpace();
+ emptyEditorWhenDeleting();
+ if (!Env.windowsPhone) {
+ normalizeSelection();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isWebKit) {
+ inputMethodFocus();
+ selectControlElements();
+ setDefaultBlockType();
+ blockFormSubmitInsideEditor();
+ disableBackspaceIntoATable();
+ removeAppleInterchangeBrs();
+ if (Env.iOS) {
+ restoreFocusOnKeyDown();
+ bodyHeight();
+ tapLinksAndImages();
+ } else {
+ selectAll();
+ }
+ }
+ if (Env.ie >= 11) {
+ bodyHeight();
+ disableBackspaceIntoATable();
+ }
+ if (Env.ie) {
+ selectAll();
+ disableAutoUrlDetect();
+ ieInternalDragAndDrop();
+ }
+ if (isGecko) {
+ removeHrOnBackspace();
+ focusBody();
+ removeStylesWhenDeletingAcrossBlockElements();
+ setGeckoEditingOptions();
+ addBrAfterLastLinks();
+ showBrokenImageIcon();
+ blockCmdArrowNavigation();
+ disableBackspaceIntoATable();
+ }
+ return {
+ refreshContentEditable: refreshContentEditable,
+ isHidden: isHidden
+ };
+ }
+
+ var isTextBlockNode = function (node) {
+ return NodeType.isElement(node) && isTextBlock(Element$$1.fromDom(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 blockCmdArrowNavigation = function () {
- if ($_bcvfv9ajjgwe79v.mac) {
- editor.on('keydown', function (e) {
- if ($_9udk9k5wjjgwe8on.metaKeyPressed(e) && !e.shiftKey && (e.keyCode === 37 || e.keyCode === 39)) {
- e.preventDefault();
- editor.selection.getSel().modify('move', e.keyCode === 37 ? 'backward' : 'forward', 'lineboundary');
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var normalizeSelection$1 = function (editor) {
+ var rng = editor.selection.getRng();
+ var startPos = CaretPosition.fromRangeStart(rng);
+ var endPos = CaretPosition.fromRangeEnd(rng);
+ if (CaretPosition.isElementPosition(startPos)) {
+ var container = startPos.container();
+ if (isTextBlockNode(container)) {
+ CaretFinder.firstPositionIn(container).each(function (pos) {
+ return rng.setStart(pos.container(), pos.offset());
+ });
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (CaretPosition.isElementPosition(endPos)) {
+ var container = startPos.container();
+ if (isTextBlockNode(container)) {
+ CaretFinder.lastPositionIn(container).each(function (pos) {
+ return rng.setEnd(pos.container(), pos.offset());
+ });
+ }
+ }
+ editor.selection.setRng(RangeNormalizer.normalize(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">- var disableAutoUrlDetect = function () {
- setEditorCommandState('AutoUrlDetect', false);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setup$e = function (editor) {
+ editor.on('click', function (e) {
+ if (e.detail >= 3) {
+ normalizeSelection$1(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">- var tapLinksAndImages = function () {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var preventSummaryToggle = function (editor) {
</ins><span class="cx" style="display: block; padding: 0 10px"> editor.on('click', function (e) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var elm = e.target;
- do {
- if (elm.tagName === 'A') {
- e.preventDefault();
- return;
- }
- } while (elm = elm.parentNode);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (editor.dom.getParent(e.target, 'details')) {
+ e.preventDefault();
+ }
</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.contentStyles.push('.mce-content-body {-webkit-touch-callout: none}');
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var blockFormSubmitInsideEditor = function () {
- editor.on('init', function () {
- editor.dom.bind(editor.getBody(), 'submit', function (e) {
- e.preventDefault();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var filterDetails = function (editor) {
+ editor.parser.addNodeFilter('details', function (elms) {
+ each(elms, function (details) {
+ details.attr('data-mce-open', details.attr('open'));
+ details.attr('open', 'open');
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.serializer.addNodeFilter('details', function (elms) {
+ each(elms, function (details) {
+ var open = details.attr('data-mce-open');
+ details.attr('open', isString(open) ? open : null);
+ details.attr('data-mce-open', 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">- var removeAppleInterchangeBrs = function () {
- parser.addNodeFilter('br', function (nodes) {
- var i = nodes.length;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var setup$f = function (editor) {
+ preventSummaryToggle(editor);
+ filterDetails(editor);
+ };
+
+ var DOM$2 = DOMUtils$1.DOM;
+ var appendStyle = function (editor, text) {
+ var head = Element$$1.fromDom(editor.getDoc().head);
+ var tag = Element$$1.fromTag('style');
+ set(tag, 'type', 'text/css');
+ append(tag, Element$$1.fromText(text));
+ append(head, tag);
+ };
+ var createParser = function (editor) {
+ var parser = DomParser(editor.settings, editor.schema);
+ parser.addAttributeFilter('src,href,style,tabindex', function (nodes, name$$1) {
+ var i = nodes.length, node;
+ var dom = editor.dom;
+ var value, internalName;
</ins><span class="cx" style="display: block; padding: 0 10px"> while (i--) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (nodes[i].attr('class') === 'Apple-interchange-newline') {
- nodes[i].remove();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ node = nodes[i];
+ value = node.attr(name$$1);
+ internalName = 'data-mce-' + name$$1;
+ if (!node.attributes.map[internalName]) {
+ if (value.indexOf('data:') === 0 || value.indexOf('blob:') === 0) {
+ continue;
+ }
+ if (name$$1 === 'style') {
+ value = dom.serializeStyle(dom.parseStyle(value), node.name);
+ if (!value.length) {
+ value = null;
+ }
+ node.attr(internalName, value);
+ node.attr(name$$1, value);
+ } else if (name$$1 === 'tabindex') {
+ node.attr(internalName, value);
+ node.attr(name$$1, null);
+ } else {
+ node.attr(internalName, editor.convertURL(value, name$$1, node.name));
+ }
</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">- };
- var ieInternalDragAndDrop = function () {
- editor.on('dragstart', function (e) {
- setMceInternalContent(e);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parser.addNodeFilter('script', function (nodes) {
+ var i = nodes.length, node, type;
+ while (i--) {
+ node = nodes[i];
+ type = node.attr('type') || 'no/type';
+ if (type.indexOf('mce-') !== 0) {
+ node.attr('type', 'mce-' + 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">- editor.on('drop', function (e) {
- if (!isDefaultPrevented(e)) {
- var internalContent = getMceInternalContent(e);
- if (internalContent && internalContent.id !== editor.id) {
- e.preventDefault();
- var rng = $_269jak6xjjgwe8wp.fromPoint(e.x, e.y, editor.getDoc());
- selection.setRng(rng);
- insertClipboardContents(internalContent.html, true);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ parser.addNodeFilter('#cdata', function (nodes) {
+ var i = nodes.length, node;
+ while (i--) {
+ node = nodes[i];
+ node.type = 8;
+ node.name = '#comment';
+ node.value = '[CDATA[' + node.value + ']]';
+ }
+ });
+ parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function (nodes) {
+ var i = nodes.length, node;
+ var nonEmptyElements = editor.schema.getNonEmptyElements();
+ while (i--) {
+ node = nodes[i];
+ if (node.isEmpty(nonEmptyElements) && node.getAll('br').length === 0) {
+ node.append(new Node$2('br', 1)).shortEnded = true;
</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><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return parser;
</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 refreshContentEditable = function () {
- };
- var isHidden = function () {
- var sel;
- if (!isGecko || editor.removed) {
- return 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var autoFocus = function (editor) {
+ if (editor.settings.auto_focus) {
+ Delay.setEditorTimeout(editor, function () {
+ var focusEditor;
+ if (editor.settings.auto_focus === true) {
+ focusEditor = editor;
+ } else {
+ focusEditor = editor.editorManager.get(editor.settings.auto_focus);
+ }
+ if (!focusEditor.destroyed) {
+ focusEditor.focus();
+ }
+ }, 100);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- sel = editor.selection.getSel();
- return !sel || !sel.rangeCount || sel.rangeCount === 0;
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- removeBlockQuoteOnBackSpace();
- emptyEditorWhenDeleting();
- if (!$_bcvfv9ajjgwe79v.windowsPhone) {
- normalizeSelection();
- }
- if (isWebKit) {
- inputMethodFocus();
- selectControlElements();
- setDefaultBlockType();
- blockFormSubmitInsideEditor();
- disableBackspaceIntoATable();
- removeAppleInterchangeBrs();
- if ($_bcvfv9ajjgwe79v.iOS) {
- restoreFocusOnKeyDown();
- bodyHeight();
- tapLinksAndImages();
- } else {
- selectAll();
- }
- }
- if ($_bcvfv9ajjgwe79v.ie >= 11) {
- bodyHeight();
- disableBackspaceIntoATable();
- }
- if ($_bcvfv9ajjgwe79v.ie) {
- selectAll();
- disableAutoUrlDetect();
- ieInternalDragAndDrop();
- }
- if (isGecko) {
- removeHrOnBackspace();
- focusBody();
- removeStylesWhenDeletingAcrossBlockElements();
- setGeckoEditingOptions();
- addBrAfterLastLinks();
- showBrokenImageIcon();
- blockCmdArrowNavigation();
- disableBackspaceIntoATable();
- }
- return {
- refreshContentEditable: refreshContentEditable,
- isHidden: isHidden
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var initEditor = function (editor) {
+ editor.bindPendingEventDelegates();
+ editor.initialized = true;
+ editor.fire('init');
+ editor.focus(true);
+ editor.nodeChanged({ initial: true });
+ editor.execCallback('init_instance_callback', editor);
+ autoFocus(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">- }
-
- var isTextBlockNode = function (node) {
- return $_3b9u2y1rjjgwe7qe.isElement(node) && isTextBlock(Element$$1.fromDom(node));
- };
- var normalizeSelection$1 = function (editor) {
- var rng = editor.selection.getRng();
- var startPos = CaretPosition.fromRangeStart(rng);
- var endPos = CaretPosition.fromRangeEnd(rng);
- if (CaretPosition.isElementPosition(startPos)) {
- var container = startPos.container();
- if (isTextBlockNode(container)) {
- $_8q1ver2yjjgwe7z3.firstPositionIn(container).each(function (pos) {
- return rng.setStart(pos.container(), pos.offset());
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var getStyleSheetLoader = function (editor) {
+ return editor.inline ? DOM$2.styleSheetLoader : editor.dom.styleSheetLoader;
+ };
+ var initContentBody = function (editor, skipWrite) {
+ var settings = editor.settings;
+ var targetElm = editor.getElement();
+ var doc = editor.getDoc(), body, contentCssText;
+ if (!settings.inline) {
+ editor.getElement().style.visibility = editor.orgVisibility;
</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 (CaretPosition.isElementPosition(endPos)) {
- var container = startPos.container();
- if (isTextBlockNode(container)) {
- $_8q1ver2yjjgwe7z3.lastPositionIn(container).each(function (pos) {
- return rng.setEnd(pos.container(), pos.offset());
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!skipWrite && !settings.content_editable) {
+ doc.open();
+ doc.write(editor.iframeHTML);
+ doc.close();
+ }
+ if (settings.content_editable) {
+ editor.on('remove', function () {
+ var bodyEl = this.getBody();
+ DOM$2.removeClass(bodyEl, 'mce-content-body');
+ DOM$2.removeClass(bodyEl, 'mce-edit-focus');
+ DOM$2.setAttrib(bodyEl, 'contentEditable', null);
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ DOM$2.addClass(targetElm, 'mce-content-body');
+ editor.contentDocument = doc = settings.content_document || document;
+ editor.contentWindow = settings.content_window || window;
+ editor.bodyElement = targetElm;
+ settings.content_document = settings.content_window = null;
+ settings.root_name = targetElm.nodeName.toLowerCase();
</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($_e1wrz53ojjgwe85f.normalize(rng));
- };
- var setup$13 = function (editor) {
- editor.on('click', function (e) {
- if (e.detail === 3) {
- normalizeSelection$1(editor);
- }
- });
- };
- var $_y8ycw7mjjgwe91o = { setup: setup$13 };
-
- var preventSummaryToggle = function (editor) {
- editor.on('click', function (e) {
- if (editor.dom.getParent(e.target, 'details')) {
- e.preventDefault();
- }
- });
- };
- var filterDetails = function (editor) {
- editor.parser.addNodeFilter('details', function (elms) {
- each(elms, function (details) {
- details.attr('data-mce-open', details.attr('open'));
- details.attr('open', 'open');
- });
- });
- editor.serializer.addNodeFilter('details', function (elms) {
- each(elms, function (details) {
- var open = details.attr('data-mce-open');
- details.attr('open', isString(open) ? open : null);
- details.attr('data-mce-open', null);
- });
- });
- };
- var setup$14 = function (editor) {
- preventSummaryToggle(editor);
- filterDetails(editor);
- };
-
- var DOM$2 = DOMUtils$1.DOM;
- var appendStyle = function (editor, text) {
- var head = Element$$1.fromDom(editor.getDoc().head);
- var tag = Element$$1.fromTag('style');
- $_etx7gr15jjgwe7mr.set(tag, 'type', 'text/css');
- $_ewo3u51yjjgwe7su.append(tag, Element$$1.fromText(text));
- $_ewo3u51yjjgwe7su.append(head, tag);
- };
- var createParser = function (editor) {
- var parser = DomParser(editor.settings, editor.schema);
- parser.addAttributeFilter('src,href,style,tabindex', function (nodes, name$$1) {
- var i = nodes.length, node;
- var dom = editor.dom;
- var value, internalName;
- while (i--) {
- node = nodes[i];
- value = node.attr(name$$1);
- internalName = 'data-mce-' + name$$1;
- if (!node.attributes.map[internalName]) {
- if (value.indexOf('data:') === 0 || value.indexOf('blob:') === 0) {
- continue;
- }
- if (name$$1 === 'style') {
- value = dom.serializeStyle(dom.parseStyle(value), node.name);
- if (!value.length) {
- value = null;
- }
- node.attr(internalName, value);
- node.attr(name$$1, value);
- } else if (name$$1 === 'tabindex') {
- node.attr(internalName, value);
- node.attr(name$$1, null);
- } else {
- node.attr(internalName, editor.convertURL(value, name$$1, node.name));
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ body = editor.getBody();
+ body.disabled = true;
+ editor.readonly = settings.readonly;
+ if (!editor.readonly) {
+ if (editor.inline && DOM$2.getStyle(body, 'position', true) === 'static') {
+ body.style.position = 'relative';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ body.contentEditable = editor.getParam('content_editable_state', 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">- });
- parser.addNodeFilter('script', function (nodes) {
- var i = nodes.length, node, type;
- while (i--) {
- node = nodes[i];
- type = node.attr('type') || 'no/type';
- if (type.indexOf('mce-') !== 0) {
- node.attr('type', 'mce-' + type);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ body.disabled = false;
+ editor.editorUpload = EditorUpload(editor);
+ editor.schema = Schema(settings);
+ editor.dom = DOMUtils$1(doc, {
+ keep_values: true,
+ url_converter: editor.convertURL,
+ url_converter_scope: editor,
+ hex_colors: settings.force_hex_style_colors,
+ class_filter: settings.class_filter,
+ update_styles: true,
+ root_element: editor.inline ? editor.getBody() : null,
+ collect: settings.content_editable,
+ schema: editor.schema,
+ contentCssCors: Settings.shouldUseContentCssCors(editor),
+ onSetAttrib: function (e) {
+ editor.fire('SetAttrib', e);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ editor.parser = createParser(editor);
+ editor.serializer = Serializer$1(settings, editor);
+ editor.selection = Selection(editor.dom, editor.getWin(), editor.serializer, editor);
+ editor.annotator = Annotator(editor);
+ editor.formatter = Formatter(editor);
+ editor.undoManager = UndoManager(editor);
+ editor._nodeChangeDispatcher = new NodeChange(editor);
+ editor._selectionOverrides = SelectionOverrides(editor);
+ setup$f(editor);
+ setup$e(editor);
+ KeyboardOverrides.setup(editor);
+ ForceBlocks.setup(editor);
+ editor.fire('PreInit');
+ if (!settings.browser_spellcheck && !settings.gecko_spellcheck) {
+ doc.body.spellcheck = false;
+ DOM$2.setAttrib(body, 'spellcheck', '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">- });
- parser.addNodeFilter('#cdata', function (nodes) {
- var i = nodes.length, node;
- while (i--) {
- node = nodes[i];
- node.type = 8;
- node.name = '#comment';
- node.value = '[CDATA[' + node.value + ']]';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.quirks = Quirks(editor);
+ editor.fire('PostRender');
+ if (settings.directionality) {
+ body.dir = settings.directionality;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function (nodes) {
- var i = nodes.length, node;
- var nonEmptyElements = editor.schema.getNonEmptyElements();
- while (i--) {
- node = nodes[i];
- if (node.isEmpty(nonEmptyElements) && node.getAll('br').length === 0) {
- node.append(new Node$2('br', 1)).shortEnded = true;
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (settings.nowrap) {
+ body.style.whiteSpace = 'nowrap';
</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 parser;
- };
- var autoFocus = function (editor) {
- if (editor.settings.auto_focus) {
- $_9o1ijaijjgwe7dm.setEditorTimeout(editor, function () {
- var focusEditor;
- if (editor.settings.auto_focus === true) {
- focusEditor = editor;
- } else {
- focusEditor = editor.editorManager.get(editor.settings.auto_focus);
- }
- if (!focusEditor.destroyed) {
- focusEditor.focus();
- }
- }, 100);
- }
- };
- var initEditor = function (editor) {
- editor.bindPendingEventDelegates();
- editor.initialized = true;
- editor.fire('init');
- editor.focus(true);
- editor.nodeChanged({ initial: true });
- editor.execCallback('init_instance_callback', editor);
- autoFocus(editor);
- };
- var getStyleSheetLoader = function (editor) {
- return editor.inline ? DOM$2.styleSheetLoader : editor.dom.styleSheetLoader;
- };
- var initContentBody = function (editor, skipWrite) {
- var settings = editor.settings;
- var targetElm = editor.getElement();
- var doc = editor.getDoc(), body, contentCssText;
- if (!settings.inline) {
- editor.getElement().style.visibility = editor.orgVisibility;
- }
- if (!skipWrite && !settings.content_editable) {
- doc.open();
- doc.write(editor.iframeHTML);
- doc.close();
- }
- if (settings.content_editable) {
- editor.on('remove', function () {
- var bodyEl = this.getBody();
- DOM$2.removeClass(bodyEl, 'mce-content-body');
- DOM$2.removeClass(bodyEl, 'mce-edit-focus');
- DOM$2.setAttrib(bodyEl, 'contentEditable', null);
- });
- DOM$2.addClass(targetElm, 'mce-content-body');
- editor.contentDocument = doc = settings.content_document || document;
- editor.contentWindow = settings.content_window || window;
- editor.bodyElement = targetElm;
- settings.content_document = settings.content_window = null;
- settings.root_name = targetElm.nodeName.toLowerCase();
- }
- body = editor.getBody();
- body.disabled = true;
- editor.readonly = settings.readonly;
- if (!editor.readonly) {
- if (editor.inline && DOM$2.getStyle(body, 'position', true) === 'static') {
- body.style.position = 'relative';
- }
- body.contentEditable = editor.getParam('content_editable_state', true);
- }
- body.disabled = false;
- editor.editorUpload = EditorUpload(editor);
- editor.schema = Schema(settings);
- editor.dom = DOMUtils$1(doc, {
- keep_values: true,
- url_converter: editor.convertURL,
- url_converter_scope: editor,
- hex_colors: settings.force_hex_style_colors,
- class_filter: settings.class_filter,
- update_styles: true,
- root_element: editor.inline ? editor.getBody() : null,
- collect: settings.content_editable,
- schema: editor.schema,
- onSetAttrib: function (e) {
- editor.fire('SetAttrib', e);
- }
- });
- editor.parser = createParser(editor);
- editor.serializer = DomSerializer$1(settings, editor);
- editor.selection = Selection$1(editor.dom, editor.getWin(), editor.serializer, editor);
- editor.experimental = Experimental(editor);
- editor.formatter = Formatter(editor);
- editor.undoManager = UndoManager(editor);
- editor._nodeChangeDispatcher = new NodeChange(editor);
- editor._selectionOverrides = SelectionOverrides(editor);
- setup$14(editor);
- $_y8ycw7mjjgwe91o.setup(editor);
- $_ajiltf75jjgwe8yt.setup(editor);
- $_g8uzqo5ljjgwe8m8.setup(editor);
- editor.fire('PreInit');
- if (!settings.browser_spellcheck && !settings.gecko_spellcheck) {
- doc.body.spellcheck = false;
- DOM$2.setAttrib(body, 'spellcheck', 'false');
- }
- editor.quirks = Quirks(editor);
- editor.fire('PostRender');
- if (settings.directionality) {
- body.dir = settings.directionality;
- }
- if (settings.nowrap) {
- body.style.whiteSpace = 'nowrap';
- }
- if (settings.protect) {
- editor.on('BeforeSetContent', function (e) {
- $_6cwiepljjgwe7j4.each(settings.protect, function (pattern) {
- e.content = e.content.replace(pattern, function (str) {
- return '<!--mce:protected ' + escape(str) + '-->';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (settings.protect) {
+ editor.on('BeforeSetContent', function (e) {
+ Tools.each(settings.protect, function (pattern) {
+ e.content = e.content.replace(pattern, function (str) {
+ return '<!--mce:protected ' + escape(str) + '-->';
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ editor.on('SetContent', function () {
+ editor.addVisual(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">- }
- editor.on('SetContent', function () {
- editor.addVisual(editor.getBody());
- });
- editor.load({
- initial: true,
- format: 'html'
- });
- editor.startContent = editor.getContent({ format: 'raw' });
- editor.on('compositionstart compositionend', function (e) {
- editor.composing = e.type === 'compositionstart';
- });
- if (editor.contentStyles.length > 0) {
- contentCssText = '';
- $_6cwiepljjgwe7j4.each(editor.contentStyles, function (style) {
- contentCssText += style + '\r\n';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.load({
+ initial: true,
+ format: 'html'
</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.dom.addStyle(contentCssText);
- }
- getStyleSheetLoader(editor).loadAll(editor.contentCSS, function (_) {
- initEditor(editor);
- }, function (urls) {
- initEditor(editor);
- });
- if (settings.content_style) {
- appendStyle(editor, settings.content_style);
- }
- };
- var $_e2a9gf58jjgwe8kl = { initContentBody: initContentBody };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.startContent = editor.getContent({ format: 'raw' });
+ editor.on('compositionstart compositionend', function (e) {
+ editor.composing = e.type === 'compositionstart';
+ });
+ if (editor.contentStyles.length > 0) {
+ contentCssText = '';
+ Tools.each(editor.contentStyles, function (style) {
+ contentCssText += style + '\r\n';
+ });
+ editor.dom.addStyle(contentCssText);
+ }
+ getStyleSheetLoader(editor).loadAll(editor.contentCSS, function (_) {
+ initEditor(editor);
+ }, function (urls) {
+ initEditor(editor);
+ });
+ if (settings.content_style) {
+ appendStyle(editor, settings.content_style);
+ }
+ };
+ var InitContentBody = { initContentBody: initContentBody };
</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 DOM$3 = DOMUtils$1.DOM;
- var relaxDomain = function (editor, ifr) {
- if (document.domain !== window.location.hostname && $_bcvfv9ajjgwe79v.ie && $_bcvfv9ajjgwe79v.ie < 12) {
- var bodyUuid = $_637o4x5jjjgwe8m5.uuid('mce');
- editor[bodyUuid] = function () {
- $_e2a9gf58jjgwe8kl.initContentBody(editor);
- };
- var domainRelaxUrl = 'javascript:(function(){' + 'document.open();document.domain="' + document.domain + '";' + 'var ed = window.parent.tinymce.get("' + editor.id + '");document.write(ed.iframeHTML);' + 'document.close();ed.' + bodyUuid + '(true);})()';
- DOM$3.setAttrib(ifr, 'src', domainRelaxUrl);
- return true;
- }
- return false;
- };
- var normalizeHeight = function (height) {
- var normalizedHeight = typeof height === 'number' ? height + 'px' : height;
- return normalizedHeight ? normalizedHeight : '';
- };
- var createIframeElement = function (id, title, height, customAttrs) {
- var iframe = Element$$1.fromTag('iframe');
- $_etx7gr15jjgwe7mr.setAll(iframe, customAttrs);
- $_etx7gr15jjgwe7mr.setAll(iframe, {
- id: id + '_ifr',
- frameBorder: '0',
- allowTransparency: 'true',
- title: title
- });
- $_e0ei5w13jjgwe7m4.setAll(iframe, {
- width: '100%',
- height: normalizeHeight(height),
- display: 'block'
- });
- return iframe;
- };
- var getIframeHtml = function (editor) {
- var bodyId, bodyClass, iframeHTML;
- iframeHTML = $_259vs538jjgwe82a.getDocType(editor) + '<html><head>';
- if ($_259vs538jjgwe82a.getDocumentBaseUrl(editor) !== editor.documentBaseUrl) {
- iframeHTML += '<base href="' + editor.documentBaseURI.getURI() + '" />';
- }
- iframeHTML += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
- bodyId = $_259vs538jjgwe82a.getBodyId(editor);
- bodyClass = $_259vs538jjgwe82a.getBodyClass(editor);
- if ($_259vs538jjgwe82a.getContentSecurityPolicy(editor)) {
- iframeHTML += '<meta http-equiv="Content-Security-Policy" content="' + $_259vs538jjgwe82a.getContentSecurityPolicy(editor) + '" />';
- }
- iframeHTML += '</head><body id="' + bodyId + '" class="mce-content-body ' + bodyClass + '" data-id="' + editor.id + '"><br></body></html>';
- return iframeHTML;
- };
- var createIframe = function (editor, o) {
- var title = editor.editorManager.translate('Rich Text Area. Press ALT-F9 for menu. ' + 'Press ALT-F10 for toolbar. Press ALT-0 for help');
- var ifr = createIframeElement(editor.id, title, o.height, $_259vs538jjgwe82a.getIframeAttrs(editor)).dom();
- ifr.onload = function () {
- ifr.onload = null;
- editor.fire('load');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var DOM$3 = DOMUtils$1.DOM;
+ var relaxDomain = function (editor, ifr) {
+ if (document.domain !== window.location.hostname && Env.ie && Env.ie < 12) {
+ var bodyUuid = Uuid.uuid('mce');
+ editor[bodyUuid] = function () {
+ InitContentBody.initContentBody(editor);
+ };
+ var domainRelaxUrl = 'javascript:(function(){' + 'document.open();document.domain="' + document.domain + '";' + 'var ed = window.parent.tinymce.get("' + editor.id + '");document.write(ed.iframeHTML);' + 'document.close();ed.' + bodyUuid + '(true);})()';
+ DOM$3.setAttrib(ifr, 'src', domainRelaxUrl);
+ return true;
+ }
+ 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 isDomainRelaxed = relaxDomain(editor, ifr);
- editor.contentAreaContainer = o.iframeContainer;
- editor.iframeElement = ifr;
- editor.iframeHTML = getIframeHtml(editor);
- DOM$3.add(o.iframeContainer, ifr);
- return isDomainRelaxed;
- };
- var init$1 = function (editor, boxInfo) {
- var isDomainRelaxed = createIframe(editor, boxInfo);
- if (boxInfo.editorContainer) {
- DOM$3.get(boxInfo.editorContainer).style.display = editor.orgDisplay;
- editor.hidden = DOM$3.isHidden(boxInfo.editorContainer);
- }
- editor.getElement().style.display = 'none';
- DOM$3.setAttrib(editor.id, 'aria-hidden', 'true');
- if (!isDomainRelaxed) {
- $_e2a9gf58jjgwe8kl.initContentBody(editor);
- }
- };
- var $_9gp6wy7ojjgwe924 = { init: init$1 };
-
- var DOM$4 = DOMUtils$1.DOM;
- var initPlugin = function (editor, initializedPlugins, plugin) {
- var Plugin = PluginManager$1.get(plugin);
- var pluginUrl, pluginInstance;
- pluginUrl = PluginManager$1.urls[plugin] || editor.documentBaseUrl.replace(/\/$/, '');
- plugin = $_6cwiepljjgwe7j4.trim(plugin);
- if (Plugin && $_6cwiepljjgwe7j4.inArray(initializedPlugins, plugin) === -1) {
- $_6cwiepljjgwe7j4.each(PluginManager$1.dependencies(plugin), function (dep) {
- initPlugin(editor, initializedPlugins, dep);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var normalizeHeight = function (height) {
+ var normalizedHeight = typeof height === 'number' ? height + 'px' : height;
+ return normalizedHeight ? normalizedHeight : '';
+ };
+ var createIframeElement = function (id, title, height, customAttrs) {
+ var iframe = Element$$1.fromTag('iframe');
+ setAll(iframe, customAttrs);
+ setAll(iframe, {
+ id: id + '_ifr',
+ frameBorder: '0',
+ allowTransparency: 'true',
+ title: 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 (editor.plugins[plugin]) {
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ setAll$1(iframe, {
+ width: '100%',
+ height: normalizeHeight(height),
+ display: 'block'
+ });
+ return iframe;
+ };
+ var getIframeHtml = function (editor) {
+ var bodyId, bodyClass, iframeHTML;
+ iframeHTML = Settings.getDocType(editor) + '<html><head>';
+ if (Settings.getDocumentBaseUrl(editor) !== editor.documentBaseUrl) {
+ iframeHTML += '<base href="' + editor.documentBaseURI.getURI() + '" />';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- pluginInstance = new Plugin(editor, pluginUrl, editor.$);
- editor.plugins[plugin] = pluginInstance;
- if (pluginInstance.init) {
- pluginInstance.init(editor, pluginUrl);
- initializedPlugins.push(plugin);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ iframeHTML += '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
+ bodyId = Settings.getBodyId(editor);
+ bodyClass = Settings.getBodyClass(editor);
+ if (Settings.getContentSecurityPolicy(editor)) {
+ iframeHTML += '<meta http-equiv="Content-Security-Policy" content="' + Settings.getContentSecurityPolicy(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">- }
- };
- var trimLegacyPrefix = function (name) {
- return name.replace(/^\-/, '');
- };
- var initPlugins = function (editor) {
- var initializedPlugins = [];
- $_6cwiepljjgwe7j4.each(editor.settings.plugins.split(/[ ,]/), function (name) {
- initPlugin(editor, initializedPlugins, trimLegacyPrefix(name));
- });
- };
- var initTheme = function (editor) {
- var Theme;
- var theme = editor.settings.theme;
- if (isString(theme)) {
- editor.settings.theme = trimLegacyPrefix(theme);
- Theme = ThemeManager.get(theme);
- editor.theme = new Theme(editor, ThemeManager.urls[theme]);
- if (editor.theme.init) {
- editor.theme.init(editor, ThemeManager.urls[theme] || editor.documentBaseUrl.replace(/\/$/, ''), editor.$);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ iframeHTML += '</head><body id="' + bodyId + '" class="mce-content-body ' + bodyClass + '" data-id="' + editor.id + '"><br></body></html>';
+ return iframeHTML;
+ };
+ var createIframe = function (editor, o) {
+ var title = editor.editorManager.translate('Rich Text Area. Press ALT-F9 for menu. ' + 'Press ALT-F10 for toolbar. Press ALT-0 for help');
+ var ifr = createIframeElement(editor.id, title, o.height, Settings.getIframeAttrs(editor)).dom();
+ ifr.onload = function () {
+ ifr.onload = null;
+ editor.fire('load');
+ };
+ var isDomainRelaxed = relaxDomain(editor, ifr);
+ editor.contentAreaContainer = o.iframeContainer;
+ editor.iframeElement = ifr;
+ editor.iframeHTML = getIframeHtml(editor);
+ DOM$3.add(o.iframeContainer, ifr);
+ return isDomainRelaxed;
+ };
+ var init$1 = function (editor, boxInfo) {
+ var isDomainRelaxed = createIframe(editor, boxInfo);
+ if (boxInfo.editorContainer) {
+ DOM$3.get(boxInfo.editorContainer).style.display = editor.orgDisplay;
+ editor.hidden = DOM$3.isHidden(boxInfo.editorContainer);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- editor.theme = {};
- }
- };
- var renderFromLoadedTheme = function (editor) {
- var w, h, minHeight, re, info;
- var settings = editor.settings;
- var elm = editor.getElement();
- w = settings.width || DOM$4.getStyle(elm, 'width') || '100%';
- h = settings.height || DOM$4.getStyle(elm, 'height') || elm.offsetHeight;
- minHeight = settings.min_height || 100;
- re = /^[0-9\.]+(|px)$/i;
- if (re.test('' + w)) {
- w = Math.max(parseInt(w, 10), 100);
- }
- if (re.test('' + h)) {
- h = Math.max(parseInt(h, 10), minHeight);
- }
- info = editor.theme.renderUI({
- targetNode: elm,
- width: w,
- height: h,
- deltaWidth: settings.delta_width,
- deltaHeight: settings.delta_height
- });
- if (!settings.content_editable) {
- h = (info.iframeHeight || h) + (typeof h === 'number' ? info.deltaHeight || 0 : '');
- if (h < minHeight) {
- h = minHeight;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.getElement().style.display = 'none';
+ DOM$3.setAttrib(editor.id, 'aria-hidden', 'true');
+ if (!isDomainRelaxed) {
+ InitContentBody.initContentBody(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">- }
- info.height = h;
- return info;
- };
- var renderFromThemeFunc = function (editor) {
- var info;
- var elm = editor.getElement();
- info = editor.settings.theme(editor, elm);
- if (info.editorContainer.nodeType) {
- info.editorContainer.id = info.editorContainer.id || editor.id + '_parent';
- }
- if (info.iframeContainer && info.iframeContainer.nodeType) {
- info.iframeContainer.id = info.iframeContainer.id || editor.id + '_iframecontainer';
- }
- info.height = info.iframeHeight ? info.iframeHeight : elm.offsetHeight;
- return info;
- };
- var createThemeFalseResult = function (element) {
- return {
- editorContainer: element,
- iframeContainer: element
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- var renderThemeFalseIframe = function (targetElement) {
- var iframeContainer = DOM$4.create('div');
- DOM$4.insertAfter(iframeContainer, targetElement);
- return createThemeFalseResult(iframeContainer);
- };
- var renderThemeFalse = function (editor) {
- var targetElement = editor.getElement();
- return editor.inline ? createThemeFalseResult(null) : renderThemeFalseIframe(targetElement);
- };
- var renderThemeUi = function (editor) {
- var settings = editor.settings, elm = editor.getElement();
- editor.orgDisplay = elm.style.display;
- if (isString(settings.theme)) {
- return renderFromLoadedTheme(editor);
- } else if (isFunction(settings.theme)) {
- return renderFromThemeFunc(editor);
- } else {
- return renderThemeFalse(editor);
- }
- };
- var init$2 = function (editor) {
- var settings = editor.settings;
- var elm = editor.getElement();
- var boxInfo;
- editor.rtl = settings.rtl_ui || editor.editorManager.i18n.rtl;
- editor.editorManager.i18n.setCode(settings.language);
- settings.aria_label = settings.aria_label || DOM$4.getAttrib(elm, 'aria-label', editor.getLang('aria.rich_text_area'));
- editor.fire('ScriptsLoaded');
- initTheme(editor);
- initPlugins(editor);
- boxInfo = renderThemeUi(editor);
- editor.editorContainer = boxInfo.editorContainer ? boxInfo.editorContainer : null;
- if (settings.content_css) {
- $_6cwiepljjgwe7j4.each($_6cwiepljjgwe7j4.explode(settings.content_css), function (u) {
- editor.contentCSS.push(editor.documentBaseURI.toAbsolute(u));
- });
- }
- if (settings.content_editable) {
- return $_e2a9gf58jjgwe8kl.initContentBody(editor);
- } else {
- return $_9gp6wy7ojjgwe924.init(editor, boxInfo);
- }
- };
- var $_4jdwwz55jjgwe8kc = { init: init$2 };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var InitIframe = { init: init$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">- var DOM$5 = DOMUtils$1.DOM;
- var hasSkipLoadPrefix = function (name$$1) {
- return name$$1.charAt(0) === '-';
- };
- var loadLanguage = function (scriptLoader, editor) {
- var settings = editor.settings;
- if (settings.language && settings.language !== 'en' && !settings.language_url) {
- settings.language_url = editor.editorManager.baseURL + '/langs/' + settings.language + '.js';
- }
- if (settings.language_url && !editor.editorManager.i18n.data[settings.language]) {
- scriptLoader.add(settings.language_url);
- }
- };
- var loadTheme = function (scriptLoader, editor, suffix, callback) {
- var settings = editor.settings, theme = settings.theme;
- if (isString(theme)) {
- if (!hasSkipLoadPrefix(theme) && !ThemeManager.urls.hasOwnProperty(theme)) {
- var themeUrl = settings.theme_url;
- if (themeUrl) {
- ThemeManager.load(theme, editor.documentBaseURI.toAbsolute(themeUrl));
- } else {
- ThemeManager.load(theme, 'themes/' + theme + '/theme' + suffix + '.js');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var DOM$4 = DOMUtils$1.DOM;
+ var initPlugin = function (editor, initializedPlugins, plugin) {
+ var Plugin = PluginManager$1.get(plugin);
+ var pluginUrl, pluginInstance;
+ pluginUrl = PluginManager$1.urls[plugin] || editor.documentBaseUrl.replace(/\/$/, '');
+ plugin = Tools.trim(plugin);
+ if (Plugin && Tools.inArray(initializedPlugins, plugin) === -1) {
+ Tools.each(PluginManager$1.dependencies(plugin), function (dep) {
+ initPlugin(editor, initializedPlugins, dep);
+ });
+ if (editor.plugins[plugin]) {
+ return;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ pluginInstance = new Plugin(editor, pluginUrl, editor.$);
+ editor.plugins[plugin] = pluginInstance;
+ if (pluginInstance.init) {
+ pluginInstance.init(editor, pluginUrl);
+ initializedPlugins.push(plugin);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- scriptLoader.loadQueue(function () {
- ThemeManager.waitFor(theme, callback);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var trimLegacyPrefix = function (name) {
+ return name.replace(/^\-/, '');
+ };
+ var initPlugins = function (editor) {
+ var initializedPlugins = [];
+ Tools.each(editor.settings.plugins.split(/[ ,]/), function (name) {
+ initPlugin(editor, initializedPlugins, trimLegacyPrefix(name));
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- callback();
- }
- };
- var loadPlugins = function (settings, suffix) {
- if ($_6cwiepljjgwe7j4.isArray(settings.plugins)) {
- settings.plugins = settings.plugins.join(' ');
- }
- $_6cwiepljjgwe7j4.each(settings.external_plugins, function (url, name$$1) {
- PluginManager$1.load(name$$1, url);
- settings.plugins += ' ' + name$$1;
- });
- $_6cwiepljjgwe7j4.each(settings.plugins.split(/[ ,]/), function (plugin) {
- plugin = $_6cwiepljjgwe7j4.trim(plugin);
- if (plugin && !PluginManager$1.urls[plugin]) {
- if (hasSkipLoadPrefix(plugin)) {
- plugin = plugin.substr(1, plugin.length);
- var dependencies = PluginManager$1.dependencies(plugin);
- $_6cwiepljjgwe7j4.each(dependencies, function (dep) {
- var defaultSettings = {
- prefix: 'plugins/',
- resource: dep,
- suffix: '/plugin' + suffix + '.js'
- };
- dep = PluginManager$1.createUrl(defaultSettings, dep);
- PluginManager$1.load(dep.resource, dep);
- });
- } else {
- PluginManager$1.load(plugin, {
- prefix: 'plugins/',
- resource: plugin,
- suffix: '/plugin' + suffix + '.js'
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var initTheme = function (editor) {
+ var Theme;
+ var theme = editor.settings.theme;
+ if (isString(theme)) {
+ editor.settings.theme = trimLegacyPrefix(theme);
+ Theme = ThemeManager.get(theme);
+ editor.theme = new Theme(editor, ThemeManager.urls[theme]);
+ if (editor.theme.init) {
+ editor.theme.init(editor, ThemeManager.urls[theme] || editor.documentBaseUrl.replace(/\/$/, ''), editor.$);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } else {
+ editor.theme = {};
</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 loadScripts = function (editor, suffix) {
- var scriptLoader = ScriptLoader.ScriptLoader;
- loadTheme(scriptLoader, editor, suffix, function () {
- loadLanguage(scriptLoader, editor);
- loadPlugins(editor.settings, suffix);
- scriptLoader.loadQueue(function () {
- if (!editor.removed) {
- $_4jdwwz55jjgwe8kc.init(editor);
- }
- }, editor, function (urls) {
- $_5ksiiu54jjgwe8k7.pluginLoadError(editor, urls[0]);
- if (!editor.removed) {
- $_4jdwwz55jjgwe8kc.init(editor);
- }
- });
- });
- };
- var render = function (editor) {
- var settings = editor.settings, id = editor.id;
- var readyHandler = function () {
- DOM$5.unbind(window, 'ready', readyHandler);
- editor.render();
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (!EventUtils.Event.domLoaded) {
- DOM$5.bind(window, 'ready', readyHandler);
- return;
- }
- if (!editor.getElement()) {
- return;
- }
- if (!$_bcvfv9ajjgwe79v.contentEditable) {
- return;
- }
- if (!settings.inline) {
- editor.orgVisibility = editor.getElement().style.visibility;
- editor.getElement().style.visibility = 'hidden';
- } else {
- editor.inline = true;
- }
- var form = editor.getElement().form || DOM$5.getParent(id, 'form');
- if (form) {
- editor.formElement = form;
- if (settings.hidden_input && !/TEXTAREA|INPUT/i.test(editor.getElement().nodeName)) {
- DOM$5.insertAfter(DOM$5.create('input', {
- type: 'hidden',
- name: id
- }), id);
- editor.hasHiddenInput = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var renderFromLoadedTheme = function (editor) {
+ var w, h, minHeight, re, info;
+ var settings = editor.settings;
+ var elm = editor.getElement();
+ w = settings.width || DOM$4.getStyle(elm, 'width') || '100%';
+ h = settings.height || DOM$4.getStyle(elm, 'height') || elm.offsetHeight;
+ minHeight = settings.min_height || 100;
+ re = /^[0-9\.]+(|px)$/i;
+ if (re.test('' + w)) {
+ w = Math.max(parseInt(w, 10), 100);
</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.formEventDelegate = function (e) {
- editor.fire(e.type, e);
- };
- DOM$5.bind(form, 'submit reset', editor.formEventDelegate);
- editor.on('reset', function () {
- editor.setContent(editor.startContent, { format: 'raw' });
- });
- if (settings.submit_patch && !form.submit.nodeType && !form.submit.length && !form._mceOldSubmit) {
- form._mceOldSubmit = form.submit;
- form.submit = function () {
- editor.editorManager.triggerSave();
- editor.setDirty(false);
- return form._mceOldSubmit(form);
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (re.test('' + h)) {
+ h = Math.max(parseInt(h, 10), minHeight);
</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.windowManager = WindowManager(editor);
- editor.notificationManager = NotificationManager(editor);
- if (settings.encoding === 'xml') {
- editor.on('GetContent', function (e) {
- if (e.save) {
- e.content = DOM$5.encode(e.content);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ info = editor.theme.renderUI({
+ targetNode: elm,
+ width: w,
+ height: h,
+ deltaWidth: settings.delta_width,
+ deltaHeight: settings.delta_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 (settings.add_form_submit_trigger) {
- editor.on('submit', function () {
- if (editor.initialized) {
- editor.save();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!settings.content_editable) {
+ h = (info.iframeHeight || h) + (typeof h === 'number' ? info.deltaHeight || 0 : '');
+ if (h < minHeight) {
+ h = minHeight;
</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.add_unload_trigger) {
- editor._beforeUnload = function () {
- if (editor.initialized && !editor.destroyed && !editor.isHidden()) {
- editor.save({
- format: 'raw',
- no_events: true,
- set_dirty: false
- });
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ info.height = h;
+ return info;
+ };
+ var renderFromThemeFunc = function (editor) {
+ var info;
+ var elm = editor.getElement();
+ info = editor.settings.theme(editor, elm);
+ if (info.editorContainer.nodeType) {
+ info.editorContainer.id = info.editorContainer.id || editor.id + '_parent';
+ }
+ if (info.iframeContainer && info.iframeContainer.nodeType) {
+ info.iframeContainer.id = info.iframeContainer.id || editor.id + '_iframecontainer';
+ }
+ info.height = info.iframeHeight ? info.iframeHeight : elm.offsetHeight;
+ return info;
+ };
+ var createThemeFalseResult = function (element) {
+ return {
+ editorContainer: element,
+ iframeContainer: element
</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.editorManager.on('BeforeUnload', editor._beforeUnload);
- }
- editor.editorManager.add(editor);
- loadScripts(editor, editor.suffix);
- };
- var $_f3cxe94yjjgwe8ja = { render: render };
-
- var add$4 = function (editor, name, settings) {
- var sidebars = editor.sidebars ? editor.sidebars : [];
- sidebars.push({
- name: name,
- settings: settings
- });
- editor.sidebars = sidebars;
- };
- var $_9tpo0o7pjjgwe92c = { add: add$4 };
-
- var each$20 = $_6cwiepljjgwe7j4.each;
- var trim$4 = $_6cwiepljjgwe7j4.trim;
- var queryParts = 'source protocol authority userInfo user password host port relative path directory file query anchor'.split(' ');
- var DEFAULT_PORTS = {
- ftp: 21,
- http: 80,
- https: 443,
- mailto: 25
- };
- var URI = function (url, settings) {
- var self$$1 = this;
- var baseUri, baseUrl;
- url = trim$4(url);
- settings = self$$1.settings = settings || {};
- baseUri = settings.base_uri;
- if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) {
- self$$1.source = url;
- return;
- }
- var isProtocolRelative = url.indexOf('//') === 0;
- if (url.indexOf('/') === 0 && !isProtocolRelative) {
- url = (baseUri ? baseUri.protocol || 'http' : 'http') + '://mce_host' + url;
- }
- if (!/^[\w\-]*:?\/\//.test(url)) {
- baseUrl = settings.base_uri ? settings.base_uri.path : new URI(document.location.href).directory;
- if (settings.base_uri.protocol == '') {
- url = '//mce_host' + self$$1.toAbsPath(baseUrl, url);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var renderThemeFalseIframe = function (targetElement) {
+ var iframeContainer = DOM$4.create('div');
+ DOM$4.insertAfter(iframeContainer, targetElement);
+ return createThemeFalseResult(iframeContainer);
+ };
+ var renderThemeFalse = function (editor) {
+ var targetElement = editor.getElement();
+ return editor.inline ? createThemeFalseResult(null) : renderThemeFalseIframe(targetElement);
+ };
+ var renderThemeUi = function (editor) {
+ var settings = editor.settings, elm = editor.getElement();
+ editor.orgDisplay = elm.style.display;
+ if (isString(settings.theme)) {
+ return renderFromLoadedTheme(editor);
+ } else if (isFunction(settings.theme)) {
+ return renderFromThemeFunc(editor);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- url = /([^#?]*)([#?]?.*)/.exec(url);
- url = (baseUri && baseUri.protocol || 'http') + '://mce_host' + self$$1.toAbsPath(baseUrl, url[1]) + url[2];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return renderThemeFalse(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">- }
- url = url.replace(/@@/g, '(mce_at)');
- url = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url);
- each$20(queryParts, function (v, i) {
- var part = url[i];
- if (part) {
- part = part.replace(/\(mce_at\)/g, '@@');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var init$2 = function (editor) {
+ var settings = editor.settings;
+ var elm = editor.getElement();
+ var boxInfo;
+ editor.rtl = settings.rtl_ui || editor.editorManager.i18n.rtl;
+ editor.editorManager.i18n.setCode(settings.language);
+ settings.aria_label = settings.aria_label || DOM$4.getAttrib(elm, 'aria-label', editor.getLang('aria.rich_text_area'));
+ editor.fire('ScriptsLoaded');
+ initTheme(editor);
+ initPlugins(editor);
+ boxInfo = renderThemeUi(editor);
+ editor.editorContainer = boxInfo.editorContainer ? boxInfo.editorContainer : null;
+ if (settings.content_css) {
+ Tools.each(Tools.explode(settings.content_css), function (u) {
+ editor.contentCSS.push(editor.documentBaseURI.toAbsolute(u));
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1[v] = part;
- });
- if (baseUri) {
- if (!self$$1.protocol) {
- self$$1.protocol = baseUri.protocol;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (settings.content_editable) {
+ return InitContentBody.initContentBody(editor);
+ } else {
+ return InitIframe.init(editor, boxInfo);
</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 (!self$$1.userInfo) {
- self$$1.userInfo = baseUri.userInfo;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var Init = { init: init$2 };
+
+ var DOM$5 = DOMUtils$1.DOM;
+ var hasSkipLoadPrefix = function (name$$1) {
+ return name$$1.charAt(0) === '-';
+ };
+ var loadLanguage = function (scriptLoader, editor) {
+ var settings = editor.settings;
+ if (settings.language && settings.language !== 'en' && !settings.language_url) {
+ settings.language_url = editor.editorManager.baseURL + '/langs/' + settings.language + '.js';
</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 (!self$$1.port && self$$1.host === 'mce_host') {
- self$$1.port = baseUri.port;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (settings.language_url && !editor.editorManager.i18n.data[settings.language]) {
+ scriptLoader.add(settings.language_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">- if (!self$$1.host || self$$1.host === 'mce_host') {
- self$$1.host = baseUri.host;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var loadTheme = function (scriptLoader, editor, suffix, callback) {
+ var settings = editor.settings, theme = settings.theme;
+ if (isString(theme)) {
+ if (!hasSkipLoadPrefix(theme) && !ThemeManager.urls.hasOwnProperty(theme)) {
+ var themeUrl = settings.theme_url;
+ if (themeUrl) {
+ ThemeManager.load(theme, editor.documentBaseURI.toAbsolute(themeUrl));
+ } else {
+ ThemeManager.load(theme, 'themes/' + theme + '/theme' + suffix + '.js');
+ }
+ }
+ scriptLoader.loadQueue(function () {
+ ThemeManager.waitFor(theme, callback);
+ });
+ } else {
+ 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">- self$$1.source = '';
- }
- if (isProtocolRelative) {
- self$$1.protocol = '';
- }
- };
- URI.prototype = {
- setPath: function (path) {
- var self$$1 = this;
- path = /^(.*?)\/?(\w+)?$/.exec(path);
- self$$1.path = path[0];
- self$$1.directory = path[1];
- self$$1.file = path[2];
- self$$1.source = '';
- self$$1.getURI();
- },
- toRelative: function (uri) {
- var self$$1 = this;
- var output;
- if (uri === './') {
- return uri;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var loadPlugins = function (settings, suffix) {
+ if (Tools.isArray(settings.plugins)) {
+ settings.plugins = settings.plugins.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">- uri = new URI(uri, { base_uri: self$$1 });
- if (uri.host !== 'mce_host' && self$$1.host !== uri.host && uri.host || self$$1.port !== uri.port || self$$1.protocol !== uri.protocol && uri.protocol !== '') {
- return uri.getURI();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ Tools.each(settings.external_plugins, function (url, name$$1) {
+ PluginManager$1.load(name$$1, url);
+ settings.plugins += ' ' + name$$1;
+ });
+ Tools.each(settings.plugins.split(/[ ,]/), function (plugin) {
+ plugin = Tools.trim(plugin);
+ if (plugin && !PluginManager$1.urls[plugin]) {
+ if (hasSkipLoadPrefix(plugin)) {
+ plugin = plugin.substr(1, plugin.length);
+ var dependencies = PluginManager$1.dependencies(plugin);
+ Tools.each(dependencies, function (dep) {
+ var defaultSettings = {
+ prefix: 'plugins/',
+ resource: dep,
+ suffix: '/plugin' + suffix + '.js'
+ };
+ dep = PluginManager$1.createUrl(defaultSettings, dep);
+ PluginManager$1.load(dep.resource, dep);
+ });
+ } else {
+ PluginManager$1.load(plugin, {
+ prefix: 'plugins/',
+ resource: plugin,
+ suffix: '/plugin' + suffix + '.js'
+ });
+ }
+ }
+ });
+ };
+ var loadScripts = function (editor, suffix) {
+ var scriptLoader = ScriptLoader.ScriptLoader;
+ loadTheme(scriptLoader, editor, suffix, function () {
+ loadLanguage(scriptLoader, editor);
+ loadPlugins(editor.settings, suffix);
+ scriptLoader.loadQueue(function () {
+ if (!editor.removed) {
+ Init.init(editor);
+ }
+ }, editor, function (urls) {
+ ErrorReporter.pluginLoadError(editor, urls[0]);
+ if (!editor.removed) {
+ Init.init(editor);
+ }
+ });
+ });
+ };
+ var render = function (editor) {
+ var settings = editor.settings, id = editor.id;
+ var readyHandler = function () {
+ DOM$5.unbind(window, 'ready', readyHandler);
+ editor.render();
+ };
+ if (!EventUtils.Event.domLoaded) {
+ DOM$5.bind(window, 'ready', readyHandler);
+ 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 tu = self$$1.getURI(), uu = uri.getURI();
- if (tu === uu || tu.charAt(tu.length - 1) === '/' && tu.substr(0, tu.length - 1) === uu) {
- return tu;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!editor.getElement()) {
+ 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">- output = self$$1.toRelPath(self$$1.path, uri.path);
- if (uri.query) {
- output += '?' + uri.query;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!Env.contentEditable) {
+ 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 (uri.anchor) {
- output += '#' + uri.anchor;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!settings.inline) {
+ editor.orgVisibility = editor.getElement().style.visibility;
+ editor.getElement().style.visibility = 'hidden';
+ } else {
+ editor.inline = 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 output;
- },
- toAbsolute: function (uri, noHost) {
- uri = new URI(uri, { base_uri: this });
- return uri.getURI(noHost && this.isSameOrigin(uri));
- },
- isSameOrigin: function (uri) {
- if (this.host == uri.host && this.protocol == uri.protocol) {
- if (this.port == uri.port) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var form = editor.getElement().form || DOM$5.getParent(id, 'form');
+ if (form) {
+ editor.formElement = form;
+ if (settings.hidden_input && !/TEXTAREA|INPUT/i.test(editor.getElement().nodeName)) {
+ DOM$5.insertAfter(DOM$5.create('input', {
+ type: 'hidden',
+ name: id
+ }), id);
+ editor.hasHiddenInput = 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">- var defaultPort = DEFAULT_PORTS[this.protocol];
- if (defaultPort && (this.port || defaultPort) == (uri.port || defaultPort)) {
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.formEventDelegate = function (e) {
+ editor.fire(e.type, e);
+ };
+ DOM$5.bind(form, 'submit reset', editor.formEventDelegate);
+ editor.on('reset', function () {
+ editor.setContent(editor.startContent, { format: 'raw' });
+ });
+ if (settings.submit_patch && !form.submit.nodeType && !form.submit.length && !form._mceOldSubmit) {
+ form._mceOldSubmit = form.submit;
+ form.submit = function () {
+ editor.editorManager.triggerSave();
+ editor.setDirty(false);
+ return form._mceOldSubmit(form);
+ };
</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">- return false;
- },
- toRelPath: function (base, path) {
- var items, breakPoint = 0, out = '', i, l;
- base = base.substring(0, base.lastIndexOf('/'));
- base = base.split('/');
- items = path.split('/');
- if (base.length >= items.length) {
- for (i = 0, l = base.length; i < l; i++) {
- if (i >= items.length || base[i] !== items[i]) {
- breakPoint = i + 1;
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.windowManager = WindowManager(editor);
+ editor.notificationManager = NotificationManager(editor);
+ if (settings.encoding === 'xml') {
+ editor.on('GetContent', function (e) {
+ if (e.save) {
+ e.content = DOM$5.encode(e.content);
</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">+ });
</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 (base.length < items.length) {
- for (i = 0, l = items.length; i < l; i++) {
- if (i >= base.length || base[i] !== items[i]) {
- breakPoint = i + 1;
- break;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (settings.add_form_submit_trigger) {
+ editor.on('submit', function () {
+ if (editor.initialized) {
+ editor.save();
</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">+ });
</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 (breakPoint === 1) {
- return path;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (settings.add_unload_trigger) {
+ editor._beforeUnload = function () {
+ if (editor.initialized && !editor.destroyed && !editor.isHidden()) {
+ editor.save({
+ format: 'raw',
+ no_events: true,
+ set_dirty: false
+ });
+ }
+ };
+ editor.editorManager.on('BeforeUnload', editor._beforeUnload);
</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, l = base.length - (breakPoint - 1); i < l; i++) {
- out += '../';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.editorManager.add(editor);
+ loadScripts(editor, editor.suffix);
+ };
+ var Render = { render: render };
+
+ var add$4 = function (editor, name, settings) {
+ var sidebars = editor.sidebars ? editor.sidebars : [];
+ sidebars.push({
+ name: name,
+ settings: settings
+ });
+ editor.sidebars = sidebars;
+ };
+ var Sidebar = { add: add$4 };
+
+ var each$k = Tools.each, trim$4 = Tools.trim;
+ var queryParts = 'source protocol authority userInfo user password host port relative path directory file query anchor'.split(' ');
+ var DEFAULT_PORTS = {
+ ftp: 21,
+ http: 80,
+ https: 443,
+ mailto: 25
+ };
+ var URI = function (url, settings) {
+ var self$$1 = this;
+ var baseUri, baseUrl;
+ url = trim$4(url);
+ settings = self$$1.settings = settings || {};
+ baseUri = settings.base_uri;
+ if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) {
+ self$$1.source = url;
+ 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 (i = breakPoint - 1, l = items.length; i < l; i++) {
- if (i !== breakPoint - 1) {
- out += '/' + items[i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isProtocolRelative = url.indexOf('//') === 0;
+ if (url.indexOf('/') === 0 && !isProtocolRelative) {
+ url = (baseUri ? baseUri.protocol || 'http' : 'http') + '://mce_host' + url;
+ }
+ if (!/^[\w\-]*:?\/\//.test(url)) {
+ baseUrl = settings.base_uri ? settings.base_uri.path : new URI(document.location.href).directory;
+ if (settings.base_uri.protocol == '') {
+ url = '//mce_host' + self$$1.toAbsPath(baseUrl, url);
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- out += items[i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ url = /([^#?]*)([#?]?.*)/.exec(url);
+ url = (baseUri && baseUri.protocol || 'http') + '://mce_host' + self$$1.toAbsPath(baseUrl, url[1]) + url[2];
</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">- return out;
- },
- toAbsPath: function (base, path) {
- var i, nb = 0, o = [], tr, outPath;
- tr = /\/$/.test(path) ? '/' : '';
- base = base.split('/');
- path = path.split('/');
- each$20(base, function (k) {
- if (k) {
- o.push(k);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ url = url.replace(/@@/g, '(mce_at)');
+ url = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url);
+ each$k(queryParts, function (v, i) {
+ var part = url[i];
+ if (part) {
+ part = part.replace(/\(mce_at\)/g, '@@');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1[v] = part;
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- base = o;
- for (i = path.length - 1, o = []; i >= 0; i--) {
- if (path[i].length === 0 || path[i] === '.') {
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (baseUri) {
+ if (!self$$1.protocol) {
+ self$$1.protocol = baseUri.protocol;
</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 (path[i] === '..') {
- nb++;
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!self$$1.userInfo) {
+ self$$1.userInfo = baseUri.userInfo;
</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 (nb > 0) {
- nb--;
- continue;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!self$$1.port && self$$1.host === 'mce_host') {
+ self$$1.port = baseUri.port;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- o.push(path[i]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!self$$1.host || self$$1.host === 'mce_host') {
+ self$$1.host = baseUri.host;
+ }
+ self$$1.source = '';
</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 = base.length - nb;
- if (i <= 0) {
- outPath = o.reverse().join('/');
- } else {
- outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isProtocolRelative) {
+ self$$1.protocol = '';
</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 (outPath.indexOf('/') !== 0) {
- outPath = '/' + outPath;
- }
- if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) {
- outPath += tr;
- }
- return outPath;
- },
- getURI: function (noProtoHost) {
- var s;
- var self$$1 = this;
- if (!self$$1.source || noProtoHost) {
- s = '';
- if (!noProtoHost) {
- if (self$$1.protocol) {
- s += self$$1.protocol + '://';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ URI.prototype = {
+ setPath: function (path) {
+ var self$$1 = this;
+ path = /^(.*?)\/?(\w+)?$/.exec(path);
+ self$$1.path = path[0];
+ self$$1.directory = path[1];
+ self$$1.file = path[2];
+ self$$1.source = '';
+ self$$1.getURI();
+ },
+ toRelative: function (uri) {
+ var self$$1 = this;
+ var output;
+ if (uri === './') {
+ return uri;
+ }
+ uri = new URI(uri, { base_uri: self$$1 });
+ if (uri.host !== 'mce_host' && self$$1.host !== uri.host && uri.host || self$$1.port !== uri.port || self$$1.protocol !== uri.protocol && uri.protocol !== '') {
+ return uri.getURI();
+ }
+ var tu = self$$1.getURI(), uu = uri.getURI();
+ if (tu === uu || tu.charAt(tu.length - 1) === '/' && tu.substr(0, tu.length - 1) === uu) {
+ return tu;
+ }
+ output = self$$1.toRelPath(self$$1.path, uri.path);
+ if (uri.query) {
+ output += '?' + uri.query;
+ }
+ if (uri.anchor) {
+ output += '#' + uri.anchor;
+ }
+ return output;
+ },
+ toAbsolute: function (uri, noHost) {
+ uri = new URI(uri, { base_uri: this });
+ return uri.getURI(noHost && this.isSameOrigin(uri));
+ },
+ isSameOrigin: function (uri) {
+ if (this.host == uri.host && this.protocol == uri.protocol) {
+ if (this.port == uri.port) {
+ return true;
+ }
+ var defaultPort = DEFAULT_PORTS[this.protocol];
+ if (defaultPort && (this.port || defaultPort) == (uri.port || defaultPort)) {
+ return true;
+ }
+ }
+ return false;
+ },
+ toRelPath: function (base, path) {
+ var items, breakPoint = 0, out = '', i, l;
+ base = base.substring(0, base.lastIndexOf('/'));
+ base = base.split('/');
+ items = path.split('/');
+ if (base.length >= items.length) {
+ for (i = 0, l = base.length; i < l; i++) {
+ if (i >= items.length || base[i] !== items[i]) {
+ breakPoint = i + 1;
+ break;
+ }
+ }
+ }
+ if (base.length < items.length) {
+ for (i = 0, l = items.length; i < l; i++) {
+ if (i >= base.length || base[i] !== items[i]) {
+ breakPoint = i + 1;
+ break;
+ }
+ }
+ }
+ if (breakPoint === 1) {
+ return path;
+ }
+ for (i = 0, l = base.length - (breakPoint - 1); i < l; i++) {
+ out += '../';
+ }
+ for (i = breakPoint - 1, l = items.length; i < l; i++) {
+ if (i !== breakPoint - 1) {
+ out += '/' + items[i];
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- s += '//';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ out += items[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 (self$$1.userInfo) {
- s += self$$1.userInfo + '@';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ return out;
+ },
+ toAbsPath: function (base, path) {
+ var i, nb = 0, o = [], tr, outPath;
+ tr = /\/$/.test(path) ? '/' : '';
+ base = base.split('/');
+ path = path.split('/');
+ each$k(base, function (k) {
+ if (k) {
+ o.push(k);
</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 (self$$1.host) {
- s += self$$1.host;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ base = o;
+ for (i = path.length - 1, o = []; i >= 0; i--) {
+ if (path[i].length === 0 || path[i] === '.') {
+ continue;
</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 (self$$1.port) {
- s += ':' + self$$1.port;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (path[i] === '..') {
+ nb++;
+ continue;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (nb > 0) {
+ nb--;
+ continue;
+ }
+ o.push(path[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 (self$$1.path) {
- s += self$$1.path;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ i = base.length - nb;
+ if (i <= 0) {
+ outPath = o.reverse().join('/');
+ } else {
+ outPath = base.slice(0, i).join('/') + '/' + o.reverse().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">- if (self$$1.query) {
- s += '?' + self$$1.query;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (outPath.indexOf('/') !== 0) {
+ outPath = '/' + outPath;
</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 (self$$1.anchor) {
- s += '#' + self$$1.anchor;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) {
+ outPath += 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">- self$$1.source = s;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return outPath;
+ },
+ getURI: function (noProtoHost) {
+ var s;
+ var self$$1 = this;
+ if (!self$$1.source || noProtoHost) {
+ s = '';
+ if (!noProtoHost) {
+ if (self$$1.protocol) {
+ s += self$$1.protocol + '://';
+ } else {
+ s += '//';
+ }
+ if (self$$1.userInfo) {
+ s += self$$1.userInfo + '@';
+ }
+ if (self$$1.host) {
+ s += self$$1.host;
+ }
+ if (self$$1.port) {
+ s += ':' + self$$1.port;
+ }
+ }
+ if (self$$1.path) {
+ s += self$$1.path;
+ }
+ if (self$$1.query) {
+ s += '?' + self$$1.query;
+ }
+ if (self$$1.anchor) {
+ s += '#' + self$$1.anchor;
+ }
+ self$$1.source = s;
+ }
+ return self$$1.source;
</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 self$$1.source;
- }
- };
- URI.parseDataUri = function (uri) {
- var type, matches;
- uri = decodeURIComponent(uri).split(',');
- matches = /data:([^;]+)/.exec(uri[0]);
- if (matches) {
- type = matches[1];
- }
- return {
- type: type,
- data: uri[1]
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- URI.getDocumentBaseUrl = function (loc) {
- var baseUrl;
- if (loc.protocol.indexOf('http') !== 0 && loc.protocol !== 'file:') {
- baseUrl = loc.href;
- } else {
- baseUrl = loc.protocol + '//' + loc.host + loc.pathname;
- }
- if (/^[^:]+:\/\/\/?[^\/]+\//.test(baseUrl)) {
- baseUrl = baseUrl.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
- if (!/[\/\\]$/.test(baseUrl)) {
- baseUrl += '/';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ URI.parseDataUri = function (uri) {
+ var type, matches;
+ uri = decodeURIComponent(uri).split(',');
+ matches = /data:([^;]+)/.exec(uri[0]);
+ if (matches) {
+ type = matches[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 baseUrl;
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return {
+ type: type,
+ data: uri[1]
+ };
+ };
+ URI.getDocumentBaseUrl = function (loc) {
+ var baseUrl;
+ if (loc.protocol.indexOf('http') !== 0 && loc.protocol !== 'file:') {
+ baseUrl = loc.href;
+ } else {
+ baseUrl = loc.protocol + '//' + loc.host + loc.pathname;
+ }
+ if (/^[^:]+:\/\/\/?[^\/]+\//.test(baseUrl)) {
+ baseUrl = baseUrl.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
+ if (!/[\/\\]$/.test(baseUrl)) {
+ baseUrl += '/';
+ }
+ }
+ return baseUrl;
+ };
</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 defaultFormat = 'html';
- var trimEmptyContents = function (editor, html) {
- var blockName = $_259vs538jjgwe82a.getForcedRootBlock(editor);
- var emptyRegExp = new RegExp('^(<' + blockName + '[^>]*>( | |\\s|\xA0|<br \\/>|)<\\/' + blockName + '>[\r\n]*|<br \\/>[\r\n]*)$');
- return html.replace(emptyRegExp, '');
- };
- var getContentFromBody = function (editor, args, body) {
- var content;
- args.format = args.format ? args.format : defaultFormat;
- args.get = true;
- args.getInner = true;
- if (!args.no_events) {
- editor.fire('BeforeGetContent', args);
- }
- if (args.format === 'raw') {
- content = $_6cwiepljjgwe7j4.trim($_87j7cq5zjjgwe8pf.trimExternal(editor.serializer, body.innerHTML));
- } else if (args.format === 'text') {
- content = $_2xw7ul2pjjgwe7xs.trim(body.innerText || body.textContent);
- } else if (args.format === 'tree') {
- return editor.serializer.serialize(body, args);
- } else {
- content = trimEmptyContents(editor, editor.serializer.serialize(body, args));
- }
- if (args.format !== 'text' && !isWsPreserveElement(Element$$1.fromDom(body))) {
- args.content = $_6cwiepljjgwe7j4.trim(content);
- } else {
- args.content = content;
- }
- if (!args.no_events) {
- editor.fire('GetContent', args);
- }
- return args.content;
- };
- var getContent$1 = function (editor, args) {
- if (args === void 0) {
- args = {};
- }
- return Option.from(editor.getBody()).fold(constant(args.format === 'tree' ? new Node$2('body', 11) : ''), function (body) {
- return getContentFromBody(editor, args, body);
- });
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var defaultFormat = 'html';
+ var trimEmptyContents = function (editor, html) {
+ var blockName = Settings.getForcedRootBlock(editor);
+ var emptyRegExp = new RegExp('^(<' + blockName + '[^>]*>( | |\\s|\xA0|<br \\/>|)<\\/' + blockName + '>[\r\n]*|<br \\/>[\r\n]*)$');
+ return html.replace(emptyRegExp, '');
+ };
+ var getContentFromBody = function (editor, args, body) {
+ var content;
+ args.format = args.format ? args.format : defaultFormat;
+ args.get = true;
+ args.getInner = true;
+ if (!args.no_events) {
+ editor.fire('BeforeGetContent', args);
+ }
+ if (args.format === 'raw') {
+ content = Tools.trim(TrimHtml.trimExternal(editor.serializer, body.innerHTML));
+ } else if (args.format === 'text') {
+ content = Zwsp.trim(body.innerText || body.textContent);
+ } else if (args.format === 'tree') {
+ return editor.serializer.serialize(body, args);
+ } else {
+ content = trimEmptyContents(editor, editor.serializer.serialize(body, args));
+ }
+ if (args.format !== 'text' && !isWsPreserveElement(Element$$1.fromDom(body))) {
+ args.content = Tools.trim(content);
+ } else {
+ args.content = content;
+ }
+ if (!args.no_events) {
+ editor.fire('GetContent', args);
+ }
+ return args.content;
+ };
+ var getContent$1 = function (editor, args) {
+ if (args === void 0) {
+ args = {};
+ }
+ return Option.from(editor.getBody()).fold(constant(args.format === 'tree' ? new Node$2('body', 11) : ''), function (body) {
+ return getContentFromBody(editor, args, 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">- var traverse = function (node, fn) {
- fn(node);
- if (node.firstChild) {
- traverse(node.firstChild, fn);
- }
- if (node.next) {
- traverse(node.next, fn);
- }
- };
- var findMatchingNodes = function (nodeFilters, attributeFilters, node) {
- var nodeMatches = {};
- var attrMatches = {};
- var matches = [];
- if (node.firstChild) {
- traverse(node.firstChild, function (node) {
- each(nodeFilters, function (filter$$1) {
- if (filter$$1.name === node.name) {
- if (nodeMatches[filter$$1.name]) {
- nodeMatches[filter$$1.name].nodes.push(node);
- } else {
- nodeMatches[filter$$1.name] = {
- filter: filter$$1,
- nodes: [node]
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var traverse = function (node, fn) {
+ fn(node);
+ if (node.firstChild) {
+ traverse(node.firstChild, fn);
+ }
+ if (node.next) {
+ traverse(node.next, fn);
+ }
+ };
+ var findMatchingNodes = function (nodeFilters, attributeFilters, node) {
+ var nodeMatches = {};
+ var attrMatches = {};
+ var matches = [];
+ if (node.firstChild) {
+ traverse(node.firstChild, function (node) {
+ each(nodeFilters, function (filter$$1) {
+ if (filter$$1.name === node.name) {
+ if (nodeMatches[filter$$1.name]) {
+ nodeMatches[filter$$1.name].nodes.push(node);
+ } else {
+ nodeMatches[filter$$1.name] = {
+ filter: filter$$1,
+ nodes: [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">- }
- });
- each(attributeFilters, function (filter$$1) {
- if (typeof node.attr(filter$$1.name) === 'string') {
- if (attrMatches[filter$$1.name]) {
- attrMatches[filter$$1.name].nodes.push(node);
- } else {
- attrMatches[filter$$1.name] = {
- filter: filter$$1,
- nodes: [node]
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ each(attributeFilters, function (filter$$1) {
+ if (typeof node.attr(filter$$1.name) === 'string') {
+ if (attrMatches[filter$$1.name]) {
+ attrMatches[filter$$1.name].nodes.push(node);
+ } else {
+ attrMatches[filter$$1.name] = {
+ filter: filter$$1,
+ nodes: [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">- }
</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">- });
- }
- for (var name in nodeMatches) {
- if (nodeMatches.hasOwnProperty(name)) {
- matches.push(nodeMatches[name]);
</del><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 name in attrMatches) {
- if (attrMatches.hasOwnProperty(name)) {
- matches.push(attrMatches[name]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (var name in nodeMatches) {
+ if (nodeMatches.hasOwnProperty(name)) {
+ matches.push(nodeMatches[name]);
+ }
</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 matches;
- };
- var filter$3 = function (nodeFilters, attributeFilters, node) {
- var matches = findMatchingNodes(nodeFilters, attributeFilters, node);
- each(matches, function (match) {
- each(match.filter.callbacks, function (callback) {
- callback(match.nodes, match.filter.name, {});
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (var name in attrMatches) {
+ if (attrMatches.hasOwnProperty(name)) {
+ matches.push(attrMatches[name]);
+ }
+ }
+ return matches;
+ };
+ var filter$3 = function (nodeFilters, attributeFilters, node) {
+ var matches = findMatchingNodes(nodeFilters, attributeFilters, node);
+ each(matches, function (match) {
+ each(match.filter.callbacks, function (callback) {
+ callback(match.nodes, match.filter.name, {});
+ });
</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">+ };
</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 defaultFormat$1 = 'html';
- var isTreeNode = function (content) {
- return content instanceof Node$2;
- };
- var moveSelection = function (editor) {
- if ($_5eyh7w4vjjgwe8ik.hasFocus(editor)) {
- $_8q1ver2yjjgwe7z3.firstPositionIn(editor.getBody()).each(function (pos) {
- var node = pos.getNode();
- var caretPos = $_3b9u2y1rjjgwe7qe.isTable(node) ? $_8q1ver2yjjgwe7z3.firstPositionIn(node).getOr(pos) : pos;
- editor.selection.setRng(caretPos.toRange());
- });
- }
- };
- var setEditorHtml = function (editor, html) {
- editor.dom.setHTML(editor.getBody(), html);
- moveSelection(editor);
- };
- var setContentString = function (editor, body, content, args) {
- var forcedRootBlockName, padd;
- if (content.length === 0 || /^\s+$/.test(content)) {
- padd = '<br data-mce-bogus="1">';
- if (body.nodeName === 'TABLE') {
- content = '<tr><td>' + padd + '</td></tr>';
- } else if (/^(UL|OL)$/.test(body.nodeName)) {
- content = '<li>' + padd + '</li>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var defaultFormat$1 = 'html';
+ var isTreeNode = function (content) {
+ return content instanceof Node$2;
+ };
+ var moveSelection = function (editor) {
+ if (EditorFocus.hasFocus(editor)) {
+ CaretFinder.firstPositionIn(editor.getBody()).each(function (pos) {
+ var node = pos.getNode();
+ var caretPos = NodeType.isTable(node) ? CaretFinder.firstPositionIn(node).getOr(pos) : pos;
+ editor.selection.setRng(caretPos.toRange());
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- forcedRootBlockName = $_259vs538jjgwe82a.getForcedRootBlock(editor);
- if (forcedRootBlockName && editor.schema.isValidChild(body.nodeName.toLowerCase(), forcedRootBlockName.toLowerCase())) {
- content = padd;
- content = editor.dom.createHTML(forcedRootBlockName, editor.settings.forced_root_block_attrs, content);
- } else if (!content) {
- content = '<br data-mce-bogus="1">';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var setEditorHtml = function (editor, html) {
+ editor.dom.setHTML(editor.getBody(), html);
+ moveSelection(editor);
+ };
+ var setContentString = function (editor, body, content, args) {
+ var forcedRootBlockName, padd;
+ if (content.length === 0 || /^\s+$/.test(content)) {
+ padd = '<br data-mce-bogus="1">';
+ if (body.nodeName === 'TABLE') {
+ content = '<tr><td>' + padd + '</td></tr>';
+ } else if (/^(UL|OL)$/.test(body.nodeName)) {
+ content = '<li>' + padd + '</li>';
+ }
+ forcedRootBlockName = Settings.getForcedRootBlock(editor);
+ if (forcedRootBlockName && editor.schema.isValidChild(body.nodeName.toLowerCase(), forcedRootBlockName.toLowerCase())) {
+ content = padd;
+ content = editor.dom.createHTML(forcedRootBlockName, editor.settings.forced_root_block_attrs, content);
+ } else if (!content) {
+ content = '<br data-mce-bogus="1">';
+ }
+ setEditorHtml(editor, content);
+ editor.fire('SetContent', args);
+ } else {
+ if (args.format !== 'raw') {
+ content = Serializer({ validate: editor.validate }, editor.schema).serialize(editor.parser.parse(content, {
+ isRootContent: true,
+ insert: true
+ }));
+ }
+ args.content = isWsPreserveElement(Element$$1.fromDom(body)) ? content : Tools.trim(content);
+ setEditorHtml(editor, args.content);
+ if (!args.no_events) {
+ editor.fire('SetContent', args);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- setEditorHtml(editor, content);
- editor.fire('SetContent', args);
- } else {
- if (args.format !== 'raw') {
- content = HtmlSerializer({ validate: editor.validate }, editor.schema).serialize(editor.parser.parse(content, {
- isRootContent: true,
- insert: true
- }));
- }
- args.content = isWsPreserveElement(Element$$1.fromDom(body)) ? content : $_6cwiepljjgwe7j4.trim(content);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return args.content;
+ };
+ var setContentTree = function (editor, body, content, args) {
+ filter$3(editor.parser.getNodeFilters(), editor.parser.getAttributeFilters(), content);
+ var html = Serializer({ validate: editor.validate }, editor.schema).serialize(content);
+ args.content = isWsPreserveElement(Element$$1.fromDom(body)) ? html : Tools.trim(html);
</ins><span class="cx" style="display: block; padding: 0 10px"> setEditorHtml(editor, args.content);
</span><span class="cx" style="display: block; padding: 0 10px"> if (!args.no_events) {
</span><span class="cx" style="display: block; padding: 0 10px"> editor.fire('SetContent', args);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- return args.content;
- };
- var setContentTree = function (editor, body, content, args) {
- filter$3(editor.parser.getNodeFilters(), editor.parser.getAttributeFilters(), content);
- var html = HtmlSerializer({ validate: editor.validate }, editor.schema).serialize(content);
- args.content = isWsPreserveElement(Element$$1.fromDom(body)) ? html : $_6cwiepljjgwe7j4.trim(html);
- setEditorHtml(editor, args.content);
- if (!args.no_events) {
- editor.fire('SetContent', args);
- }
- return content;
- };
- var setContent$1 = function (editor, content, args) {
- if (args === void 0) {
- args = {};
- }
- args.format = args.format ? args.format : defaultFormat$1;
- args.set = true;
- args.content = isTreeNode(content) ? '' : content;
- if (!isTreeNode(content) && !args.no_events) {
- editor.fire('BeforeSetContent', args);
- content = args.content;
- }
- return Option.from(editor.getBody()).fold(constant(content), function (body) {
- return isTreeNode(content) ? setContentTree(editor, body, content, args) : setContentString(editor, body, content, args);
- });
- };
-
- var DOM$6 = DOMUtils$1.DOM;
- var restoreOriginalStyles = function (editor) {
- DOM$6.setStyle(editor.id, 'display', editor.orgDisplay);
- };
- var safeDestroy = function (x) {
- return Option.from(x).each(function (x) {
- return x.destroy();
- });
- };
- var clearDomReferences = function (editor) {
- editor.contentAreaContainer = editor.formElement = editor.container = editor.editorContainer = null;
- editor.bodyElement = editor.contentDocument = editor.contentWindow = null;
- editor.iframeElement = editor.targetElm = null;
- if (editor.selection) {
- editor.selection = editor.selection.win = editor.selection.dom = editor.selection.dom.doc = null;
- }
- };
- var restoreForm = function (editor) {
- var form = editor.formElement;
- if (form) {
- if (form._mceOldSubmit) {
- form.submit = form._mceOldSubmit;
- form._mceOldSubmit = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return content;
+ };
+ var setContent$1 = function (editor, content, args) {
+ if (args === void 0) {
+ args = {};
</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$6.unbind(form, 'submit reset', editor.formEventDelegate);
- }
- };
- var remove$9 = function (editor) {
- if (!editor.removed) {
- var _selectionOverrides = editor._selectionOverrides, editorUpload = editor.editorUpload;
- var body = editor.getBody();
- var element = editor.getElement();
- if (body) {
- editor.save();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ args.format = args.format ? args.format : defaultFormat$1;
+ args.set = true;
+ args.content = isTreeNode(content) ? '' : content;
+ if (!isTreeNode(content) && !args.no_events) {
+ editor.fire('BeforeSetContent', args);
+ content = args.content;
</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.removed = true;
- editor.unbindAllNativeEvents();
- if (editor.hasHiddenInput && element) {
- DOM$6.remove(element.nextSibling);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return Option.from(editor.getBody()).fold(constant(content), function (body) {
+ return isTreeNode(content) ? setContentTree(editor, body, content, args) : setContentString(editor, body, content, args);
+ });
+ };
+
+ var DOM$6 = DOMUtils$1.DOM;
+ var restoreOriginalStyles = function (editor) {
+ DOM$6.setStyle(editor.id, 'display', editor.orgDisplay);
+ };
+ var safeDestroy = function (x) {
+ return Option.from(x).each(function (x) {
+ return x.destroy();
+ });
+ };
+ var clearDomReferences = function (editor) {
+ editor.contentAreaContainer = editor.formElement = editor.container = editor.editorContainer = null;
+ editor.bodyElement = editor.contentDocument = editor.contentWindow = null;
+ editor.iframeElement = editor.targetElm = null;
+ if (editor.selection) {
+ editor.selection = editor.selection.win = editor.selection.dom = editor.selection.dom.doc = 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.inline && body) {
- restoreOriginalStyles(editor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var restoreForm = function (editor) {
+ var form = editor.formElement;
+ if (form) {
+ if (form._mceOldSubmit) {
+ form.submit = form._mceOldSubmit;
+ form._mceOldSubmit = null;
+ }
+ DOM$6.unbind(form, 'submit reset', editor.formEventDelegate);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_b2ca654tjjgwe8ic.fireRemove(editor);
- editor.editorManager.remove(editor);
- DOM$6.remove(editor.getContainer());
- safeDestroy(_selectionOverrides);
- safeDestroy(editorUpload);
- editor.destroy();
- }
- };
- var destroy = function (editor, automatic) {
- var selection = editor.selection, dom = editor.dom;
- if (editor.destroyed) {
- return;
- }
- if (!automatic && !editor.removed) {
- editor.remove();
- return;
- }
- if (!automatic) {
- editor.editorManager.off('beforeunload', editor._beforeUnload);
- if (editor.theme && editor.theme.destroy) {
- editor.theme.destroy();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var remove$9 = function (editor) {
+ if (!editor.removed) {
+ var _selectionOverrides = editor._selectionOverrides, editorUpload = editor.editorUpload;
+ var body = editor.getBody();
+ var element = editor.getElement();
+ if (body) {
+ editor.save({ is_removing: true });
+ }
+ editor.removed = true;
+ editor.unbindAllNativeEvents();
+ if (editor.hasHiddenInput && element) {
+ DOM$6.remove(element.nextSibling);
+ }
+ if (!editor.inline && body) {
+ restoreOriginalStyles(editor);
+ }
+ Events.fireRemove(editor);
+ editor.editorManager.remove(editor);
+ DOM$6.remove(editor.getContainer());
+ safeDestroy(_selectionOverrides);
+ safeDestroy(editorUpload);
+ editor.destroy();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- safeDestroy(selection);
- safeDestroy(dom);
- }
- restoreForm(editor);
- clearDomReferences(editor);
- editor.destroyed = true;
- };
-
- var DOM$7 = DOMUtils$1.DOM;
- var extend$4 = $_6cwiepljjgwe7j4.extend;
- var each$21 = $_6cwiepljjgwe7j4.each;
- var resolve$4 = $_6cwiepljjgwe7j4.resolve;
- var ie$2 = $_bcvfv9ajjgwe79v.ie;
- var Editor = function (id, settings, editorManager) {
- var self = this;
- var documentBaseUrl = self.documentBaseUrl = editorManager.documentBaseURL;
- var baseUri = editorManager.baseURI;
- settings = getEditorSettings(self, id, documentBaseUrl, editorManager.defaultSettings, settings);
- self.settings = settings;
- AddOnManager.language = settings.language || 'en';
- AddOnManager.languageLoad = settings.language_load;
- AddOnManager.baseURL = editorManager.baseURL;
- self.id = id;
- self.setDirty(false);
- self.plugins = {};
- self.documentBaseURI = new URI(settings.document_base_url, { base_uri: baseUri });
- self.baseURI = baseUri;
- self.contentCSS = [];
- self.contentStyles = [];
- self.shortcuts = new Shortcuts(self);
- self.loadedCSS = {};
- self.editorCommands = new EditorCommands(self);
- self.suffix = editorManager.suffix;
- self.editorManager = editorManager;
- self.inline = settings.inline;
- self.buttons = {};
- self.menuItems = {};
- if (settings.cache_suffix) {
- $_bcvfv9ajjgwe79v.cacheSuffix = settings.cache_suffix.replace(/^[\?\&]+/, '');
- }
- if (settings.override_viewport === false) {
- $_bcvfv9ajjgwe79v.overrideViewPort = false;
- }
- editorManager.fire('SetupEditor', { editor: self });
- self.execCallback('setup', self);
- self.$ = DomQuery.overrideDefaults(function () {
- return {
- context: self.inline ? self.getBody() : self.getDoc(),
- element: self.getBody()
- };
- });
- };
- Editor.prototype = {
- render: function () {
- $_f3cxe94yjjgwe8ja.render(this);
- },
- focus: function (skipFocus) {
- $_5eyh7w4vjjgwe8ik.focus(this, skipFocus);
- },
- hasFocus: function () {
- return $_5eyh7w4vjjgwe8ik.hasFocus(this);
- },
- execCallback: function (name) {
- var x = [];
- for (var _i = 1; _i < arguments.length; _i++) {
- x[_i - 1] = arguments[_i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var destroy = function (editor, automatic) {
+ var selection = editor.selection, dom = editor.dom;
+ if (editor.destroyed) {
+ 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 self = this;
- var callback = self.settings[name], scope;
- if (!callback) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!automatic && !editor.removed) {
+ editor.remove();
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (self.callbackLookup && (scope = self.callbackLookup[name])) {
- callback = scope.func;
- scope = scope.scope;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!automatic) {
+ editor.editorManager.off('beforeunload', editor._beforeUnload);
+ if (editor.theme && editor.theme.destroy) {
+ editor.theme.destroy();
+ }
+ safeDestroy(selection);
+ safeDestroy(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 (typeof callback === 'string') {
- scope = callback.replace(/\.\w+$/, '');
- scope = scope ? resolve$4(scope) : 0;
- callback = resolve$4(callback);
- self.callbackLookup = self.callbackLookup || {};
- self.callbackLookup[name] = {
- func: callback,
- scope: scope
- };
- }
- return callback.apply(scope || self, Array.prototype.slice.call(arguments, 1));
- },
- translate: function (text) {
- if (text && $_6cwiepljjgwe7j4.is(text, 'string')) {
- var lang_1 = this.settings.language || 'en', i18n_1 = this.editorManager.i18n;
- text = i18n_1.data[lang_1 + '.' + text] || text.replace(/\{\#([^\}]+)\}/g, function (a, b) {
- return i18n_1.data[lang_1 + '.' + b] || '{#' + b + '}';
- });
- }
- return this.editorManager.translate(text);
- },
- getLang: function (name, defaultVal) {
- return this.editorManager.i18n.data[(this.settings.language || 'en') + '.' + name] || (defaultVal !== undefined ? defaultVal : '{#' + name + '}');
- },
- getParam: function (name, defaultVal, type) {
- return getParam(this, name, defaultVal, type);
- },
- nodeChanged: function (args) {
- this._nodeChangeDispatcher.nodeChanged(args);
- },
- addButton: function (name, settings) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ restoreForm(editor);
+ clearDomReferences(editor);
+ editor.destroyed = true;
+ };
+
+ var DOM$7 = DOMUtils$1.DOM;
+ var extend$4 = Tools.extend, each$l = Tools.each;
+ var resolve$4 = Tools.resolve;
+ var ie$2 = Env.ie;
+ var Editor = function (id, settings, editorManager) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var self = this;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (settings.cmd) {
- settings.onclick = function () {
- self.execCommand(settings.cmd);
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var documentBaseUrl = self.documentBaseUrl = editorManager.documentBaseURL;
+ var baseUri = editorManager.baseURI;
+ settings = getEditorSettings(self, id, documentBaseUrl, editorManager.defaultSettings, settings);
+ self.settings = settings;
+ AddOnManager.language = settings.language || 'en';
+ AddOnManager.languageLoad = settings.language_load;
+ AddOnManager.baseURL = editorManager.baseURL;
+ self.id = id;
+ self.setDirty(false);
+ self.plugins = {};
+ self.documentBaseURI = new URI(settings.document_base_url, { base_uri: baseUri });
+ self.baseURI = baseUri;
+ self.contentCSS = [];
+ self.contentStyles = [];
+ self.shortcuts = new Shortcuts(self);
+ self.loadedCSS = {};
+ self.editorCommands = new EditorCommands(self);
+ self.suffix = editorManager.suffix;
+ self.editorManager = editorManager;
+ self.inline = settings.inline;
+ self.buttons = {};
+ self.menuItems = {};
+ if (settings.cache_suffix) {
+ Env.cacheSuffix = settings.cache_suffix.replace(/^[\?\&]+/, '');
</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.stateSelector && typeof settings.active === 'undefined') {
- settings.active = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (settings.override_viewport === false) {
+ Env.overrideViewPort = 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 (!settings.text && !settings.icon) {
- settings.icon = name;
- }
- self.buttons = self.buttons;
- settings.tooltip = settings.tooltip || settings.title;
- self.buttons[name] = settings;
- },
- addSidebar: function (name, settings) {
- return $_9tpo0o7pjjgwe92c.add(this, name, settings);
- },
- addMenuItem: function (name, settings) {
- var self = this;
- if (settings.cmd) {
- settings.onclick = function () {
- self.execCommand(settings.cmd);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editorManager.fire('SetupEditor', { editor: self });
+ self.execCallback('setup', self);
+ self.$ = DomQuery.overrideDefaults(function () {
+ return {
+ context: self.inline ? self.getBody() : self.getDoc(),
+ element: self.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">- }
- self.menuItems = self.menuItems;
- self.menuItems[name] = settings;
- },
- addContextToolbar: function (predicate, items) {
- var self = this;
- var selector;
- self.contextToolbars = self.contextToolbars || [];
- if (typeof predicate === 'string') {
- selector = predicate;
- predicate = function (elm) {
- return self.dom.is(elm, selector);
- };
- }
- self.contextToolbars.push({
- id: $_637o4x5jjjgwe8m5.uuid('mcet'),
- predicate: predicate,
- items: items
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- },
- addCommand: function (name, callback, scope) {
- this.editorCommands.addCommand(name, callback, scope);
- },
- addQueryStateHandler: function (name, callback, scope) {
- this.editorCommands.addQueryStateHandler(name, callback, scope);
- },
- addQueryValueHandler: function (name, callback, scope) {
- this.editorCommands.addQueryValueHandler(name, callback, scope);
- },
- addShortcut: function (pattern, desc, cmdFunc, scope) {
- this.shortcuts.add(pattern, desc, cmdFunc, scope);
- },
- execCommand: function (cmd, ui, value, args) {
- return this.editorCommands.execCommand(cmd, ui, value, args);
- },
- queryCommandState: function (cmd) {
- return this.editorCommands.queryCommandState(cmd);
- },
- queryCommandValue: function (cmd) {
- return this.editorCommands.queryCommandValue(cmd);
- },
- queryCommandSupported: function (cmd) {
- return this.editorCommands.queryCommandSupported(cmd);
- },
- show: function () {
- var self = this;
- if (self.hidden) {
- self.hidden = false;
- if (self.inline) {
- self.getBody().contentEditable = true;
- } else {
- DOM$7.show(self.getContainer());
- DOM$7.hide(self.id);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ Editor.prototype = {
+ render: function () {
+ Render.render(this);
+ },
+ focus: function (skipFocus) {
+ EditorFocus.focus(this, skipFocus);
+ },
+ hasFocus: function () {
+ return EditorFocus.hasFocus(this);
+ },
+ execCallback: function (name) {
+ var x = [];
+ for (var _i = 1; _i < arguments.length; _i++) {
+ x[_i - 1] = arguments[_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">- self.load();
- self.fire('show');
- }
- },
- hide: function () {
- var self = this, doc = self.getDoc();
- if (!self.hidden) {
- if (ie$2 && doc && !self.inline) {
- doc.execCommand('SelectAll');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var self = this;
+ var callback = self.settings[name], scope;
+ if (!callback) {
+ 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">- self.save();
- if (self.inline) {
- self.getBody().contentEditable = false;
- if (self === self.editorManager.focusedEditor) {
- self.editorManager.focusedEditor = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (self.callbackLookup && (scope = self.callbackLookup[name])) {
+ callback = scope.func;
+ scope = scope.scope;
+ }
+ if (typeof callback === 'string') {
+ scope = callback.replace(/\.\w+$/, '');
+ scope = scope ? resolve$4(scope) : 0;
+ callback = resolve$4(callback);
+ self.callbackLookup = self.callbackLookup || {};
+ self.callbackLookup[name] = {
+ func: callback,
+ scope: scope
+ };
+ }
+ return callback.apply(scope || self, Array.prototype.slice.call(arguments, 1));
+ },
+ translate: function (text) {
+ if (text && Tools.is(text, 'string')) {
+ var lang_1 = this.settings.language || 'en', i18n_1 = this.editorManager.i18n;
+ text = i18n_1.data[lang_1 + '.' + text] || text.replace(/\{\#([^\}]+)\}/g, function (a, b) {
+ return i18n_1.data[lang_1 + '.' + b] || '{#' + b + '}';
+ });
+ }
+ return this.editorManager.translate(text);
+ },
+ getLang: function (name, defaultVal) {
+ return this.editorManager.i18n.data[(this.settings.language || 'en') + '.' + name] || (defaultVal !== undefined ? defaultVal : '{#' + name + '}');
+ },
+ getParam: function (name, defaultVal, type) {
+ return getParam(this, name, defaultVal, type);
+ },
+ nodeChanged: function (args) {
+ this._nodeChangeDispatcher.nodeChanged(args);
+ },
+ addButton: function (name, settings) {
+ var self = this;
+ if (settings.cmd) {
+ settings.onclick = function () {
+ self.execCommand(settings.cmd);
+ };
+ }
+ if (settings.stateSelector && typeof settings.active === 'undefined') {
+ settings.active = false;
+ }
+ if (!settings.text && !settings.icon) {
+ settings.icon = name;
+ }
+ settings.tooltip = settings.tooltip || settings.title;
+ self.buttons[name] = settings;
+ },
+ addSidebar: function (name, settings) {
+ return Sidebar.add(this, name, settings);
+ },
+ addMenuItem: function (name, settings) {
+ var self = this;
+ if (settings.cmd) {
+ settings.onclick = function () {
+ self.execCommand(settings.cmd);
+ };
+ }
+ self.menuItems[name] = settings;
+ },
+ addContextToolbar: function (predicate, items) {
+ var self = this;
+ var selector;
+ self.contextToolbars = self.contextToolbars || [];
+ if (typeof predicate === 'string') {
+ selector = predicate;
+ predicate = function (elm) {
+ return self.dom.is(elm, selector);
+ };
+ }
+ self.contextToolbars.push({
+ id: Uuid.uuid('mcet'),
+ predicate: predicate,
+ items: items
+ });
+ },
+ addCommand: function (name, callback, scope) {
+ this.editorCommands.addCommand(name, callback, scope);
+ },
+ addQueryStateHandler: function (name, callback, scope) {
+ this.editorCommands.addQueryStateHandler(name, callback, scope);
+ },
+ addQueryValueHandler: function (name, callback, scope) {
+ this.editorCommands.addQueryValueHandler(name, callback, scope);
+ },
+ addShortcut: function (pattern, desc, cmdFunc, scope) {
+ this.shortcuts.add(pattern, desc, cmdFunc, scope);
+ },
+ execCommand: function (cmd, ui, value, args) {
+ return this.editorCommands.execCommand(cmd, ui, value, args);
+ },
+ queryCommandState: function (cmd) {
+ return this.editorCommands.queryCommandState(cmd);
+ },
+ queryCommandValue: function (cmd) {
+ return this.editorCommands.queryCommandValue(cmd);
+ },
+ queryCommandSupported: function (cmd) {
+ return this.editorCommands.queryCommandSupported(cmd);
+ },
+ show: function () {
+ var self = this;
+ if (self.hidden) {
+ self.hidden = false;
+ if (self.inline) {
+ self.getBody().contentEditable = true;
+ } else {
+ DOM$7.show(self.getContainer());
+ DOM$7.hide(self.id);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- DOM$7.hide(self.getContainer());
- DOM$7.setStyle(self.id, 'display', self.orgDisplay);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.load();
+ self.fire('show');
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.hidden = true;
- self.fire('hide');
- }
- },
- isHidden: function () {
- return !!this.hidden;
- },
- setProgressState: function (state, time) {
- this.fire('ProgressState', {
- state: state,
- time: time
- });
- },
- load: function (args) {
- var self = this;
- var elm = self.getElement(), html;
- if (self.removed) {
- return '';
- }
- if (elm) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ hide: function () {
+ var self = this, doc = self.getDoc();
+ if (!self.hidden) {
+ if (ie$2 && doc && !self.inline) {
+ doc.execCommand('SelectAll');
+ }
+ self.save();
+ if (self.inline) {
+ self.getBody().contentEditable = false;
+ if (self === self.editorManager.focusedEditor) {
+ self.editorManager.focusedEditor = null;
+ }
+ } else {
+ DOM$7.hide(self.getContainer());
+ DOM$7.setStyle(self.id, 'display', self.orgDisplay);
+ }
+ self.hidden = true;
+ self.fire('hide');
+ }
+ },
+ isHidden: function () {
+ return !!this.hidden;
+ },
+ setProgressState: function (state, time) {
+ this.fire('ProgressState', {
+ state: state,
+ time: time
+ });
+ },
+ load: function (args) {
+ var self = this;
+ var elm = self.getElement(), html;
+ if (self.removed) {
+ return '';
+ }
+ if (elm) {
+ args = args || {};
+ args.load = true;
+ html = self.setContent(elm.value !== undefined ? elm.value : elm.innerHTML, args);
+ args.element = elm;
+ if (!args.no_events) {
+ self.fire('LoadContent', args);
+ }
+ args.element = elm = null;
+ return html;
+ }
+ },
+ save: function (args) {
+ var self = this;
+ var elm = self.getElement(), html, form;
+ if (!elm || !self.initialized || self.removed) {
+ return;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> args = args || {};
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- args.load = true;
- html = self.setContent(elm.value !== undefined ? elm.value : elm.innerHTML, args);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ args.save = true;
</ins><span class="cx" style="display: block; padding: 0 10px"> args.element = elm;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ html = args.content = self.getContent(args);
</ins><span class="cx" style="display: block; padding: 0 10px"> if (!args.no_events) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self.fire('LoadContent', args);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.fire('SaveContent', args);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (args.format === 'raw') {
+ self.fire('RawSaveContent', args);
+ }
+ html = args.content;
+ if (!/TEXTAREA|INPUT/i.test(elm.nodeName)) {
+ if (args.is_removing || !self.inline) {
+ elm.innerHTML = html;
+ }
+ if (form = DOM$7.getParent(self.id, 'form')) {
+ each$l(form.elements, function (elm) {
+ if (elm.name === self.id) {
+ elm.value = html;
+ return false;
+ }
+ });
+ }
+ } else {
+ elm.value = html;
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> args.element = elm = null;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (args.set_dirty !== false) {
+ self.setDirty(false);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> return html;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- },
- save: function (args) {
- var self = this;
- var elm = self.getElement(), html, form;
- if (!elm || !self.initialized || self.removed) {
- return;
- }
- args = args || {};
- args.save = true;
- args.element = elm;
- html = args.content = self.getContent(args);
- if (!args.no_events) {
- self.fire('SaveContent', args);
- }
- if (args.format === 'raw') {
- self.fire('RawSaveContent', args);
- }
- html = args.content;
- if (!/TEXTAREA|INPUT/i.test(elm.nodeName)) {
- elm.innerHTML = html;
- if (form = DOM$7.getParent(self.id, 'form')) {
- each$21(form.elements, function (elm) {
- if (elm.name === self.id) {
- elm.value = html;
- return false;
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ setContent: function (content, args) {
+ return setContent$1(this, content, args);
+ },
+ getContent: function (args) {
+ return getContent$1(this, args);
+ },
+ insertContent: function (content, args) {
+ if (args) {
+ content = extend$4({ content: content }, args);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- elm.value = html;
- }
- args.element = elm = null;
- if (args.set_dirty !== false) {
- self.setDirty(false);
- }
- return html;
- },
- setContent: function (content, args) {
- return setContent$1(this, content, args);
- },
- getContent: function (args) {
- return getContent$1(this, args);
- },
- insertContent: function (content, args) {
- if (args) {
- content = extend$4({ content: content }, args);
- }
- this.execCommand('mceInsertContent', false, content);
- },
- isDirty: function () {
- return !this.isNotDirty;
- },
- setDirty: function (state) {
- var oldState = !this.isNotDirty;
- this.isNotDirty = !state;
- if (state && state !== oldState) {
- this.fire('dirty');
- }
- },
- setMode: function (mode) {
- setMode(this, mode);
- },
- getContainer: function () {
- var self = this;
- if (!self.container) {
- self.container = DOM$7.get(self.editorContainer || self.id + '_parent');
- }
- return self.container;
- },
- getContentAreaContainer: function () {
- return this.contentAreaContainer;
- },
- getElement: function () {
- if (!this.targetElm) {
- this.targetElm = DOM$7.get(this.id);
- }
- return this.targetElm;
- },
- getWin: function () {
- var self = this;
- var elm;
- if (!self.contentWindow) {
- elm = self.iframeElement;
- if (elm) {
- self.contentWindow = elm.contentWindow;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.execCommand('mceInsertContent', false, content);
+ },
+ isDirty: function () {
+ return !this.isNotDirty;
+ },
+ setDirty: function (state) {
+ var oldState = !this.isNotDirty;
+ this.isNotDirty = !state;
+ if (state && state !== oldState) {
+ this.fire('dirty');
</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 self.contentWindow;
- },
- getDoc: function () {
- var self = this;
- var win;
- if (!self.contentDocument) {
- win = self.getWin();
- if (win) {
- self.contentDocument = win.document;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ setMode: function (mode) {
+ setMode(this, mode);
+ },
+ getContainer: function () {
+ var self = this;
+ if (!self.container) {
+ self.container = DOM$7.get(self.editorContainer || self.id + '_parent');
</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 self.contentDocument;
- },
- getBody: function () {
- var doc = this.getDoc();
- return this.bodyElement || (doc ? doc.body : null);
- },
- convertURL: function (url, name, elm) {
- var self = this, settings = self.settings;
- if (settings.urlconverter_callback) {
- return self.execCallback('urlconverter_callback', url, elm, true, name);
- }
- if (!settings.convert_urls || elm && elm.nodeName === 'LINK' || url.indexOf('file:') === 0 || url.length === 0) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return self.container;
+ },
+ getContentAreaContainer: function () {
+ return this.contentAreaContainer;
+ },
+ getElement: function () {
+ if (!this.targetElm) {
+ this.targetElm = DOM$7.get(this.id);
+ }
+ return this.targetElm;
+ },
+ getWin: function () {
+ var self = this;
+ var elm;
+ if (!self.contentWindow) {
+ elm = self.iframeElement;
+ if (elm) {
+ self.contentWindow = elm.contentWindow;
+ }
+ }
+ return self.contentWindow;
+ },
+ getDoc: function () {
+ var self = this;
+ var win;
+ if (!self.contentDocument) {
+ win = self.getWin();
+ if (win) {
+ self.contentDocument = win.document;
+ }
+ }
+ return self.contentDocument;
+ },
+ getBody: function () {
+ var doc = this.getDoc();
+ return this.bodyElement || (doc ? doc.body : null);
+ },
+ convertURL: function (url, name, elm) {
+ var self = this, settings = self.settings;
+ if (settings.urlconverter_callback) {
+ return self.execCallback('urlconverter_callback', url, elm, true, name);
+ }
+ if (!settings.convert_urls || elm && elm.nodeName === 'LINK' || url.indexOf('file:') === 0 || url.length === 0) {
+ return url;
+ }
+ if (settings.relative_urls) {
+ return self.documentBaseURI.toRelative(url);
+ }
+ url = self.documentBaseURI.toAbsolute(url, settings.remove_script_host);
</ins><span class="cx" style="display: block; padding: 0 10px"> return url;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (settings.relative_urls) {
- return self.documentBaseURI.toRelative(url);
- }
- url = self.documentBaseURI.toAbsolute(url, settings.remove_script_host);
- return url;
- },
- addVisual: function (elm) {
- var self = this;
- var settings = self.settings;
- var dom = self.dom;
- var cls;
- elm = elm || self.getBody();
- if (self.hasVisual === undefined) {
- self.hasVisual = settings.visual;
- }
- each$21(dom.select('table,a', elm), function (elm) {
- var value;
- switch (elm.nodeName) {
- case 'TABLE':
- cls = settings.visual_table_class || 'mce-item-table';
- value = dom.getAttrib(elm, 'border');
- if ((!value || value === '0') && self.hasVisual) {
- dom.addClass(elm, cls);
- } else {
- dom.removeClass(elm, cls);
- }
- return;
- case 'A':
- if (!dom.getAttrib(elm, 'href')) {
- value = dom.getAttrib(elm, 'name') || elm.id;
- cls = settings.visual_anchor_class || 'mce-item-anchor';
- if (value && self.hasVisual) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ addVisual: function (elm) {
+ var self = this;
+ var settings = self.settings;
+ var dom = self.dom;
+ var cls;
+ elm = elm || self.getBody();
+ if (self.hasVisual === undefined) {
+ self.hasVisual = settings.visual;
+ }
+ each$l(dom.select('table,a', elm), function (elm) {
+ var value;
+ switch (elm.nodeName) {
+ case 'TABLE':
+ cls = settings.visual_table_class || 'mce-item-table';
+ value = dom.getAttrib(elm, 'border');
+ if ((!value || value === '0') && self.hasVisual) {
</ins><span class="cx" style="display: block; padding: 0 10px"> dom.addClass(elm, cls);
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> dom.removeClass(elm, cls);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return;
+ case 'A':
+ if (!dom.getAttrib(elm, 'href')) {
+ value = dom.getAttrib(elm, 'name') || elm.id;
+ cls = settings.visual_anchor_class || 'mce-item-anchor';
+ if (value && self.hasVisual) {
+ dom.addClass(elm, cls);
+ } else {
+ dom.removeClass(elm, cls);
+ }
+ }
+ 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;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ self.fire('VisualAid', {
+ element: elm,
+ hasVisual: self.hasVisual
+ });
+ },
+ remove: function () {
+ remove$9(this);
+ },
+ destroy: function (automatic) {
+ destroy(this, automatic);
+ },
+ uploadImages: function (callback) {
+ return this.editorUpload.uploadImages(callback);
+ },
+ _scanForImages: function () {
+ return this.editorUpload.scanForImages();
+ }
+ };
+ extend$4(Editor.prototype, EditorObservable$1);
+
+ var isEditorUIElement = function (elm) {
+ return elm.className.toString().indexOf('mce-') !== -1;
+ };
+ var FocusManager = { isEditorUIElement: isEditorUIElement };
+
+ var isManualNodeChange = function (e) {
+ return e.type === 'nodechange' && e.selectionChange;
+ };
+ var registerPageMouseUp = function (editor, throttledStore) {
+ var mouseUpPage = function () {
+ throttledStore.throttle();
+ };
+ DOMUtils$1.DOM.bind(document, 'mouseup', mouseUpPage);
+ editor.on('remove', function () {
+ DOMUtils$1.DOM.unbind(document, 'mouseup', mouseUpPage);
+ });
+ };
+ var registerFocusOut = function (editor) {
+ editor.on('focusout', function () {
+ SelectionBookmark.store(editor);
+ });
+ };
+ var registerMouseUp = function (editor, throttledStore) {
+ editor.on('mouseup touchend', function (e) {
+ throttledStore.throttle();
+ });
+ };
+ var registerEditorEvents = function (editor, throttledStore) {
+ var browser = PlatformDetection$1.detect().browser;
+ if (browser.isIE()) {
+ registerFocusOut(editor);
+ } else {
+ registerMouseUp(editor, throttledStore);
+ }
+ editor.on('keyup nodechange', function (e) {
+ if (!isManualNodeChange(e)) {
+ SelectionBookmark.store(editor);
</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">- self.fire('VisualAid', {
- element: elm,
- hasVisual: self.hasVisual
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var register$3 = function (editor) {
+ var throttledStore = first$1(function () {
+ SelectionBookmark.store(editor);
+ }, 0);
+ if (editor.inline) {
+ registerPageMouseUp(editor, throttledStore);
+ }
+ editor.on('init', function () {
+ registerEditorEvents(editor, throttledStore);
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- },
- remove: function () {
- remove$9(this);
- },
- destroy: function (automatic) {
- destroy(this, automatic);
- },
- uploadImages: function (callback) {
- return this.editorUpload.uploadImages(callback);
- },
- _scanForImages: function () {
- return this.editorUpload.scanForImages();
- }
- };
- extend$4(Editor.prototype, EditorObservable$1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('remove', function () {
+ throttledStore.cancel();
+ });
+ };
+ var SelectionRestore = { register: register$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 isEditorUIElement = function (elm) {
- return elm.className.toString().indexOf('mce-') !== -1;
- };
- var $_264dtu7yjjgwe947 = { isEditorUIElement: isEditorUIElement };
-
- var isManualNodeChange = function (e) {
- return e.type === 'nodechange' && e.selectionChange;
- };
- var registerPageMouseUp = function (editor, throttledStore) {
- var mouseUpPage = function () {
- throttledStore.throttle();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var documentFocusInHandler;
+ var DOM$8 = DOMUtils$1.DOM;
+ var isEditorUIElement$1 = function (elm) {
+ return FocusManager.isEditorUIElement(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">- DOMUtils$1.DOM.bind(document, 'mouseup', mouseUpPage);
- editor.on('remove', function () {
- DOMUtils$1.DOM.unbind(document, 'mouseup', mouseUpPage);
- });
- };
- var registerFocusOut = function (editor) {
- editor.on('focusout', function () {
- $_4wtqbt4ljjgwe8gy.store(editor);
- });
- };
- var registerMouseUp = function (editor, throttledStore) {
- editor.on('mouseup touchend', function (e) {
- throttledStore.throttle();
- });
- };
- var registerEditorEvents = function (editor, throttledStore) {
- var browser = $_7vg267ojjgwe7k0.detect().browser;
- if (browser.isIE()) {
- registerFocusOut(editor);
- } else {
- registerMouseUp(editor, throttledStore);
- }
- editor.on('keyup nodechange', function (e) {
- if (!isManualNodeChange(e)) {
- $_4wtqbt4ljjgwe8gy.store(editor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var isUIElement = function (editor, elm) {
+ var customSelector = editor ? editor.settings.custom_ui_selector : '';
+ var parent$$1 = DOM$8.getParent(elm, function (elm) {
+ return isEditorUIElement$1(elm) || (customSelector ? editor.dom.is(elm, customSelector) : false);
+ });
+ return parent$$1 !== null;
+ };
+ var getActiveElement = function () {
+ try {
+ return document.activeElement;
+ } catch (ex) {
+ return document.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">- });
- };
- var register$3 = function (editor) {
- var throttledStore = first$1(function () {
- $_4wtqbt4ljjgwe8gy.store(editor);
- }, 0);
- if (editor.inline) {
- registerPageMouseUp(editor, throttledStore);
- }
- editor.on('init', function () {
- registerEditorEvents(editor, throttledStore);
- });
- editor.on('remove', function () {
- throttledStore.cancel();
- });
- };
- var $_6aodh87zjjgwe948 = { register: register$3 };
-
- var documentFocusInHandler;
- var DOM$8 = DOMUtils$1.DOM;
- var isEditorUIElement$1 = function (elm) {
- return $_264dtu7yjjgwe947.isEditorUIElement(elm);
- };
- var isUIElement = function (editor, elm) {
- var customSelector = editor ? editor.settings.custom_ui_selector : '';
- var parent$$1 = DOM$8.getParent(elm, function (elm) {
- return isEditorUIElement$1(elm) || (customSelector ? editor.dom.is(elm, customSelector) : false);
- });
- return parent$$1 !== null;
- };
- var getActiveElement = function () {
- try {
- return document.activeElement;
- } catch (ex) {
- return document.body;
- }
- };
- var registerEvents = function (editorManager, e) {
- var editor = e.editor;
- $_6aodh87zjjgwe948.register(editor);
- editor.on('focusin', function () {
- var self$$1 = this;
- var focusedEditor = editorManager.focusedEditor;
- if (focusedEditor !== self$$1) {
- if (focusedEditor) {
- focusedEditor.fire('blur', { focusedEditor: self$$1 });
- }
- editorManager.setActive(self$$1);
- editorManager.focusedEditor = self$$1;
- self$$1.fire('focus', { blurredEditor: focusedEditor });
- self$$1.focus(true);
- }
- });
- editor.on('focusout', function () {
- var self$$1 = this;
- $_9o1ijaijjgwe7dm.setEditorTimeout(self$$1, function () {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var registerEvents = function (editorManager, e) {
+ var editor = e.editor;
+ SelectionRestore.register(editor);
+ editor.on('focusin', function () {
+ var self$$1 = this;
</ins><span class="cx" style="display: block; padding: 0 10px"> var focusedEditor = editorManager.focusedEditor;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (!isUIElement(self$$1, getActiveElement()) && focusedEditor === self$$1) {
- self$$1.fire('blur', { focusedEditor: null });
- editorManager.focusedEditor = null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (focusedEditor !== self$$1) {
+ if (focusedEditor) {
+ focusedEditor.fire('blur', { focusedEditor: self$$1 });
+ }
+ editorManager.setActive(self$$1);
+ editorManager.focusedEditor = self$$1;
+ self$$1.fire('focus', { blurredEditor: focusedEditor });
+ self$$1.focus(true);
</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">- });
- if (!documentFocusInHandler) {
- documentFocusInHandler = function (e) {
- var activeEditor = editorManager.activeEditor;
- var target;
- target = e.target;
- if (activeEditor && target.ownerDocument === document) {
- if (target !== document.body && !isUIElement(activeEditor, target) && editorManager.focusedEditor === activeEditor) {
- activeEditor.fire('blur', { focusedEditor: null });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.on('focusout', function () {
+ var self$$1 = this;
+ Delay.setEditorTimeout(self$$1, function () {
+ var focusedEditor = editorManager.focusedEditor;
+ if (!isUIElement(self$$1, getActiveElement()) && focusedEditor === self$$1) {
+ self$$1.fire('blur', { focusedEditor: null });
</ins><span class="cx" style="display: block; padding: 0 10px"> editorManager.focusedEditor = null;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- };
- DOM$8.bind(document, 'focusin', documentFocusInHandler);
- }
- };
- var unregisterDocumentEvents = function (editorManager, e) {
- if (editorManager.focusedEditor === e.editor) {
- editorManager.focusedEditor = null;
- }
- if (!editorManager.activeEditor) {
- DOM$8.unbind(document, 'focusin', documentFocusInHandler);
- documentFocusInHandler = null;
- }
- };
- var setup$15 = function (editorManager) {
- editorManager.on('AddEditor', curry(registerEvents, editorManager));
- editorManager.on('RemoveEditor', curry(unregisterDocumentEvents, editorManager));
- };
- var $_8o8it37xjjgwe943 = {
- setup: setup$15,
- isEditorUIElement: isEditorUIElement$1,
- isUIElement: isUIElement
- };
-
- var data = {};
- var code = 'en';
- var $_65s8hc80jjgwe94e = {
- setCode: function (newCode) {
- if (newCode) {
- code = newCode;
- this.rtl = this.data[newCode] ? this.data[newCode]._dir === 'rtl' : false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ });
+ if (!documentFocusInHandler) {
+ documentFocusInHandler = function (e) {
+ var activeEditor = editorManager.activeEditor;
+ var target;
+ target = e.target;
+ if (activeEditor && target.ownerDocument === document) {
+ if (target !== document.body && !isUIElement(activeEditor, target) && editorManager.focusedEditor === activeEditor) {
+ activeEditor.fire('blur', { focusedEditor: null });
+ editorManager.focusedEditor = null;
+ }
+ }
+ };
+ DOM$8.bind(document, 'focusin', documentFocusInHandler);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- },
- getCode: function () {
- return code;
- },
- rtl: false,
- add: function (code, items) {
- var langData = data[code];
- if (!langData) {
- data[code] = langData = {};
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var unregisterDocumentEvents = function (editorManager, e) {
+ if (editorManager.focusedEditor === e.editor) {
+ editorManager.focusedEditor = 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">- for (var name in items) {
- langData[name] = items[name];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!editorManager.activeEditor) {
+ DOM$8.unbind(document, 'focusin', documentFocusInHandler);
+ documentFocusInHandler = 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">- this.setCode(code);
- },
- translate: function (text) {
- var langData = data[code] || {};
- var toString = function (obj) {
- if ($_6cwiepljjgwe7j4.is(obj, 'function')) {
- return Object.prototype.toString.call(obj);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var setup$g = function (editorManager) {
+ editorManager.on('AddEditor', curry(registerEvents, editorManager));
+ editorManager.on('RemoveEditor', curry(unregisterDocumentEvents, editorManager));
+ };
+ var FocusController = {
+ setup: setup$g,
+ isEditorUIElement: isEditorUIElement$1,
+ isUIElement: isUIElement
+ };
+
+ var data = {};
+ var code = 'en';
+ var I18n = {
+ setCode: function (newCode) {
+ if (newCode) {
+ code = newCode;
+ this.rtl = this.data[newCode] ? this.data[newCode]._dir === 'rtl' : 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 !isEmpty(obj) ? '' + obj : '';
- };
- var isEmpty = function (text) {
- return text === '' || text === null || $_6cwiepljjgwe7j4.is(text, 'undefined');
- };
- var getLangData = function (text) {
- text = toString(text);
- return $_6cwiepljjgwe7j4.hasOwn(langData, text) ? toString(langData[text]) : text;
- };
- if (isEmpty(text)) {
- return '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ getCode: function () {
+ return code;
+ },
+ rtl: false,
+ add: function (code, items) {
+ var langData = data[code];
+ if (!langData) {
+ data[code] = langData = {};
+ }
+ for (var name in items) {
+ langData[name] = items[name];
+ }
+ this.setCode(code);
+ },
+ translate: function (text) {
+ var langData = data[code] || {};
+ var toString = function (obj) {
+ if (Tools.is(obj, 'function')) {
+ return Object.prototype.toString.call(obj);
+ }
+ return !isEmpty(obj) ? '' + obj : '';
+ };
+ var isEmpty = function (text) {
+ return text === '' || text === null || Tools.is(text, 'undefined');
+ };
+ var getLangData = function (text) {
+ text = toString(text);
+ return Tools.hasOwn(langData, text) ? toString(langData[text]) : text;
+ };
+ if (isEmpty(text)) {
+ return '';
+ }
+ if (Tools.is(text, 'object') && Tools.hasOwn(text, 'raw')) {
+ return toString(text.raw);
+ }
+ if (Tools.is(text, 'array')) {
+ var values_1 = text.slice(1);
+ text = getLangData(text[0]).replace(/\{([0-9]+)\}/g, function ($1, $2) {
+ return Tools.hasOwn(values_1, $2) ? toString(values_1[$2]) : $1;
+ });
+ }
+ return getLangData(text).replace(/{context:\w+}$/, '');
+ },
+ data: data
+ };
+
+ var DOM$9 = DOMUtils$1.DOM;
+ var explode$4 = Tools.explode, each$m = Tools.each, extend$5 = Tools.extend;
+ var instanceCounter = 0, beforeUnloadDelegate, EditorManager, boundGlobalEvents = false;
+ var legacyEditors = [];
+ var editors = [];
+ var isValidLegacyKey = function (id) {
+ return id !== 'length';
+ };
+ var globalEventDelegate = function (e) {
+ each$m(EditorManager.get(), function (editor) {
+ if (e.type === 'scroll') {
+ editor.fire('ScrollWindow', e);
+ } else {
+ editor.fire('ResizeWindow', e);
+ }
+ });
+ };
+ var toggleGlobalEvents = function (state) {
+ if (state !== boundGlobalEvents) {
+ if (state) {
+ DomQuery(window).on('resize scroll', globalEventDelegate);
+ } else {
+ DomQuery(window).off('resize scroll', globalEventDelegate);
+ }
+ boundGlobalEvents = 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 ($_6cwiepljjgwe7j4.is(text, 'object') && $_6cwiepljjgwe7j4.hasOwn(text, 'raw')) {
- return toString(text.raw);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var removeEditorFromList = function (targetEditor) {
+ var oldEditors = editors;
+ delete legacyEditors[targetEditor.id];
+ for (var i = 0; i < legacyEditors.length; i++) {
+ if (legacyEditors[i] === targetEditor) {
+ legacyEditors.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">- if ($_6cwiepljjgwe7j4.is(text, 'array')) {
- var values_1 = text.slice(1);
- text = getLangData(text[0]).replace(/\{([0-9]+)\}/g, function ($1, $2) {
- return $_6cwiepljjgwe7j4.hasOwn(values_1, $2) ? toString(values_1[$2]) : $1;
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editors = filter(editors, function (editor) {
+ return targetEditor !== editor;
+ });
+ if (EditorManager.activeEditor === targetEditor) {
+ EditorManager.activeEditor = editors.length > 0 ? editors[0] : 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 getLangData(text).replace(/{context:\w+}$/, '');
- },
- data: data
- };
-
- var DOM$9 = DOMUtils$1.DOM;
- var explode$4 = $_6cwiepljjgwe7j4.explode;
- var each$22 = $_6cwiepljjgwe7j4.each;
- var extend$5 = $_6cwiepljjgwe7j4.extend;
- var instanceCounter = 0;
- var beforeUnloadDelegate;
- var EditorManager;
- var boundGlobalEvents = false;
- var legacyEditors = [];
- var editors = [];
- var isValidLegacyKey = function (id) {
- return id !== 'length';
- };
- var globalEventDelegate = function (e) {
- each$22(EditorManager.get(), function (editor) {
- if (e.type === 'scroll') {
- editor.fire('ScrollWindow', e);
- } else {
- editor.fire('ResizeWindow', e);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (EditorManager.focusedEditor === targetEditor) {
+ EditorManager.focusedEditor = 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">- });
- };
- var toggleGlobalEvents = function (state) {
- if (state !== boundGlobalEvents) {
- if (state) {
- DomQuery(window).on('resize scroll', globalEventDelegate);
- } else {
- DomQuery(window).off('resize scroll', globalEventDelegate);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return oldEditors.length !== editors.length;
+ };
+ var purgeDestroyedEditor = function (editor) {
+ if (editor && editor.initialized && !(editor.getContainer() || editor.getBody()).parentNode) {
+ removeEditorFromList(editor);
+ editor.unbindAllNativeEvents();
+ editor.destroy(true);
+ editor.removed = true;
+ editor = 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">- boundGlobalEvents = state;
- }
- };
- var removeEditorFromList = function (targetEditor) {
- var oldEditors = editors;
- delete legacyEditors[targetEditor.id];
- for (var i = 0; i < legacyEditors.length; i++) {
- if (legacyEditors[i] === targetEditor) {
- legacyEditors.splice(i, 1);
- break;
- }
- }
- editors = filter(editors, function (editor) {
- return targetEditor !== editor;
- });
- if (EditorManager.activeEditor === targetEditor) {
- EditorManager.activeEditor = editors.length > 0 ? editors[0] : null;
- }
- if (EditorManager.focusedEditor === targetEditor) {
- EditorManager.focusedEditor = null;
- }
- return oldEditors.length !== editors.length;
- };
- var purgeDestroyedEditor = function (editor) {
- if (editor && editor.initialized && !(editor.getContainer() || editor.getBody()).parentNode) {
- removeEditorFromList(editor);
- editor.unbindAllNativeEvents();
- editor.destroy(true);
- editor.removed = true;
- editor = null;
- }
- return editor;
- };
- EditorManager = {
- defaultSettings: {},
- $: DomQuery,
- majorVersion: '4',
- minorVersion: '8.0',
- releaseDate: '2018-06-27',
- editors: legacyEditors,
- i18n: $_65s8hc80jjgwe94e,
- activeEditor: null,
- settings: {},
- setup: function () {
- var self$$1 = this;
- var baseURL, documentBaseURL, suffix = '', preInit, src;
- documentBaseURL = URI.getDocumentBaseUrl(document.location);
- if (/^[^:]+:\/\/\/?[^\/]+\//.test(documentBaseURL)) {
- documentBaseURL = documentBaseURL.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
- if (!/[\/\\]$/.test(documentBaseURL)) {
- documentBaseURL += '/';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return editor;
+ };
+ EditorManager = {
+ defaultSettings: {},
+ $: DomQuery,
+ majorVersion: '4',
+ minorVersion: '9.2',
+ releaseDate: '2018-12-17',
+ editors: legacyEditors,
+ i18n: I18n,
+ activeEditor: null,
+ settings: {},
+ setup: function () {
+ var self$$1 = this;
+ var baseURL, documentBaseURL, suffix = '', preInit, src;
+ documentBaseURL = URI.getDocumentBaseUrl(document.location);
+ if (/^[^:]+:\/\/\/?[^\/]+\//.test(documentBaseURL)) {
+ documentBaseURL = documentBaseURL.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, '');
+ if (!/[\/\\]$/.test(documentBaseURL)) {
+ documentBaseURL += '/';
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- preInit = window.tinymce || window.tinyMCEPreInit;
- if (preInit) {
- baseURL = preInit.base || preInit.baseURL;
- suffix = preInit.suffix;
- } else {
- var scripts = document.getElementsByTagName('script');
- for (var i = 0; i < scripts.length; i++) {
- src = scripts[i].src;
- var srcScript = src.substring(src.lastIndexOf('/'));
- if (/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(src)) {
- if (srcScript.indexOf('.min') !== -1) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ preInit = window.tinymce || window.tinyMCEPreInit;
+ if (preInit) {
+ baseURL = preInit.base || preInit.baseURL;
+ suffix = preInit.suffix;
+ } else {
+ var scripts = document.getElementsByTagName('script');
+ for (var i = 0; i < scripts.length; i++) {
+ src = scripts[i].src;
+ var srcScript = src.substring(src.lastIndexOf('/'));
+ if (/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(src)) {
+ if (srcScript.indexOf('.min') !== -1) {
+ suffix = '.min';
+ }
+ baseURL = src.substring(0, src.lastIndexOf('/'));
+ break;
+ }
+ }
+ if (!baseURL && document.currentScript) {
+ src = document.currentScript.src;
+ if (src.indexOf('.min') !== -1) {
</ins><span class="cx" style="display: block; padding: 0 10px"> suffix = '.min';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> baseURL = src.substring(0, src.lastIndexOf('/'));
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- break;
</del><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">- if (!baseURL && document.currentScript) {
- src = document.currentScript.src;
- if (src.indexOf('.min') !== -1) {
- suffix = '.min';
- }
- baseURL = src.substring(0, src.lastIndexOf('/'));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self$$1.baseURL = new URI(documentBaseURL).toAbsolute(baseURL);
+ self$$1.documentBaseURL = documentBaseURL;
+ self$$1.baseURI = new URI(self$$1.baseURL);
+ self$$1.suffix = suffix;
+ FocusController.setup(self$$1);
+ },
+ overrideDefaults: function (defaultSettings) {
+ var baseUrl, suffix;
+ baseUrl = defaultSettings.base_url;
+ if (baseUrl) {
+ this.baseURL = new URI(this.documentBaseURL).toAbsolute(baseUrl.replace(/\/+$/, ''));
+ this.baseURI = new URI(this.baseURL);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- self$$1.baseURL = new URI(documentBaseURL).toAbsolute(baseURL);
- self$$1.documentBaseURL = documentBaseURL;
- self$$1.baseURI = new URI(self$$1.baseURL);
- self$$1.suffix = suffix;
- $_8o8it37xjjgwe943.setup(self$$1);
- },
- overrideDefaults: function (defaultSettings) {
- var baseUrl, suffix;
- baseUrl = defaultSettings.base_url;
- if (baseUrl) {
- this.baseURL = new URI(this.documentBaseURL).toAbsolute(baseUrl.replace(/\/+$/, ''));
- this.baseURI = new URI(this.baseURL);
- }
- suffix = defaultSettings.suffix;
- if (defaultSettings.suffix) {
- this.suffix = suffix;
- }
- this.defaultSettings = defaultSettings;
- var pluginBaseUrls = defaultSettings.plugin_base_urls;
- for (var name$$1 in pluginBaseUrls) {
- AddOnManager.PluginManager.urls[name$$1] = pluginBaseUrls[name$$1];
- }
- },
- init: function (settings) {
- var self$$1 = this;
- var result, invalidInlineTargets;
- invalidInlineTargets = $_6cwiepljjgwe7j4.makeMap('area base basefont br col frame hr img input isindex link meta param embed source wbr track ' + 'colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu', ' ');
- var isInvalidInlineTarget = function (settings, elm) {
- return settings.inline && elm.tagName.toLowerCase() in invalidInlineTargets;
- };
- var createId = function (elm) {
- var id = elm.id;
- if (!id) {
- id = elm.name;
- if (id && !DOM$9.get(id)) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ suffix = defaultSettings.suffix;
+ if (defaultSettings.suffix) {
+ this.suffix = suffix;
+ }
+ this.defaultSettings = defaultSettings;
+ var pluginBaseUrls = defaultSettings.plugin_base_urls;
+ for (var name$$1 in pluginBaseUrls) {
+ AddOnManager.PluginManager.urls[name$$1] = pluginBaseUrls[name$$1];
+ }
+ },
+ init: function (settings) {
+ var self$$1 = this;
+ var result, invalidInlineTargets;
+ invalidInlineTargets = Tools.makeMap('area base basefont br col frame hr img input isindex link meta param embed source wbr track ' + 'colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu', ' ');
+ var isInvalidInlineTarget = function (settings, elm) {
+ return settings.inline && elm.tagName.toLowerCase() in invalidInlineTargets;
+ };
+ var createId = function (elm) {
+ var id = elm.id;
+ if (!id) {
</ins><span class="cx" style="display: block; padding: 0 10px"> id = elm.name;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- id = DOM$9.uniqueId();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (id && !DOM$9.get(id)) {
+ id = elm.name;
+ } else {
+ id = DOM$9.uniqueId();
+ }
+ elm.setAttribute('id', id);
</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.setAttribute('id', id);
- }
- return id;
- };
- var execCallback = function (name$$1) {
- var callback = settings[name$$1];
- if (!callback) {
- return;
- }
- return callback.apply(self$$1, Array.prototype.slice.call(arguments, 2));
- };
- var hasClass = function (elm, className) {
- return className.constructor === RegExp ? className.test(elm.className) : DOM$9.hasClass(elm, className);
- };
- var findTargets = function (settings) {
- var l, targets = [];
- if ($_bcvfv9ajjgwe79v.ie && $_bcvfv9ajjgwe79v.ie < 11) {
- $_5ksiiu54jjgwe8k7.initError('TinyMCE does not support the browser you are using. For a list of supported' + ' browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/');
- return [];
- }
- if (settings.types) {
- each$22(settings.types, function (type) {
- targets = targets.concat(DOM$9.select(type.selector));
- });
- return targets;
- } else if (settings.selector) {
- return DOM$9.select(settings.selector);
- } else if (settings.target) {
- return [settings.target];
- }
- switch (settings.mode) {
- case 'exact':
- l = settings.elements || '';
- if (l.length > 0) {
- each$22(explode$4(l), function (id) {
- var elm;
- if (elm = DOM$9.get(id)) {
- targets.push(elm);
- } else {
- each$22(document.forms, function (f) {
- each$22(f.elements, function (e) {
- if (e.name === id) {
- id = 'mce_editor_' + instanceCounter++;
- DOM$9.setAttrib(e, 'id', id);
- targets.push(e);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return id;
+ };
+ var execCallback = function (name$$1) {
+ var callback = settings[name$$1];
+ if (!callback) {
+ return;
+ }
+ return callback.apply(self$$1, Array.prototype.slice.call(arguments, 2));
+ };
+ var hasClass = function (elm, className) {
+ return className.constructor === RegExp ? className.test(elm.className) : DOM$9.hasClass(elm, className);
+ };
+ var findTargets = function (settings) {
+ var l, targets = [];
+ if (Env.ie && Env.ie < 11) {
+ ErrorReporter.initError('TinyMCE does not support the browser you are using. For a list of supported' + ' browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/');
+ return [];
+ }
+ if (settings.types) {
+ each$m(settings.types, function (type) {
+ targets = targets.concat(DOM$9.select(type.selector));
+ });
+ return targets;
+ } else if (settings.selector) {
+ return DOM$9.select(settings.selector);
+ } else if (settings.target) {
+ return [settings.target];
+ }
+ switch (settings.mode) {
+ case 'exact':
+ l = settings.elements || '';
+ if (l.length > 0) {
+ each$m(explode$4(l), function (id) {
+ var elm;
+ if (elm = DOM$9.get(id)) {
+ targets.push(elm);
+ } else {
+ each$m(document.forms, function (f) {
+ each$m(f.elements, function (e) {
+ if (e.name === id) {
+ id = 'mce_editor_' + instanceCounter++;
+ DOM$9.setAttrib(e, 'id', id);
+ targets.push(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">- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ });
+ }
+ break;
+ case 'textareas':
+ case 'specific_textareas':
+ each$m(DOM$9.select('textarea'), function (elm) {
+ if (settings.editor_deselector && hasClass(elm, settings.editor_deselector)) {
+ return;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (!settings.editor_selector || hasClass(elm, settings.editor_selector)) {
+ targets.push(elm);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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">- break;
- case 'textareas':
- case 'specific_textareas':
- each$22(DOM$9.select('textarea'), function (elm) {
- if (settings.editor_deselector && hasClass(elm, settings.editor_deselector)) {
- return;
- }
- if (!settings.editor_selector || hasClass(elm, settings.editor_selector)) {
- targets.push(elm);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return targets;
+ };
+ var provideResults = function (editors) {
+ result = editors;
+ };
+ var initEditors = function () {
+ var initCount = 0;
+ var editors = [];
+ var targets;
+ var createEditor = function (id, settings, targetElm) {
+ var editor = new Editor(id, settings, self$$1);
+ editors.push(editor);
+ editor.on('init', function () {
+ if (++initCount === targets.length) {
+ provideResults(editors);
+ }
+ });
+ editor.targetElm = editor.targetElm || targetElm;
+ editor.render();
+ };
+ DOM$9.unbind(window, 'ready', initEditors);
+ execCallback('onpageload');
+ targets = DomQuery.unique(findTargets(settings));
+ if (settings.types) {
+ each$m(settings.types, function (type) {
+ Tools.each(targets, function (elm) {
+ if (DOM$9.is(elm, type.selector)) {
+ createEditor(createId(elm), extend$5({}, settings, type), elm);
+ return false;
+ }
+ return true;
+ });
+ });
+ return;
+ }
+ Tools.each(targets, function (elm) {
+ purgeDestroyedEditor(self$$1.get(elm.id));
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- break;
- }
- return targets;
- };
- var provideResults = function (editors) {
- result = editors;
- };
- var initEditors = function () {
- var initCount = 0;
- var editors = [];
- var targets;
- var createEditor = function (id, settings, targetElm) {
- var editor = new Editor(id, settings, self$$1);
- editors.push(editor);
- editor.on('init', function () {
- if (++initCount === targets.length) {
- provideResults(editors);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ targets = Tools.grep(targets, function (elm) {
+ return !self$$1.get(elm.id);
</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.targetElm = editor.targetElm || targetElm;
- editor.render();
- };
- DOM$9.unbind(window, 'ready', initEditors);
- execCallback('onpageload');
- targets = DomQuery.unique(findTargets(settings));
- if (settings.types) {
- each$22(settings.types, function (type) {
- $_6cwiepljjgwe7j4.each(targets, function (elm) {
- if (DOM$9.is(elm, type.selector)) {
- createEditor(createId(elm), extend$5({}, settings, type), elm);
- return false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (targets.length === 0) {
+ provideResults([]);
+ } else {
+ each$m(targets, function (elm) {
+ if (isInvalidInlineTarget(settings, elm)) {
+ ErrorReporter.initError('Could not initialize inline editor on invalid inline target element', elm);
+ } else {
+ createEditor(createId(elm), settings, 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">- return true;
</del><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- return;
- }
- $_6cwiepljjgwe7j4.each(targets, function (elm) {
- purgeDestroyedEditor(self$$1.get(elm.id));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
+ };
+ self$$1.settings = settings;
+ DOM$9.bind(window, 'ready', initEditors);
+ return new promiseObj(function (resolve) {
+ if (result) {
+ resolve(result);
+ } else {
+ provideResults = function (editors) {
+ resolve(editors);
+ };
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> });
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- targets = $_6cwiepljjgwe7j4.grep(targets, function (elm) {
- return !self$$1.get(elm.id);
- });
- if (targets.length === 0) {
- provideResults([]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ get: function (id) {
+ if (arguments.length === 0) {
+ return editors.slice(0);
+ } else if (isString(id)) {
+ return find(editors, function (editor) {
+ return editor.id === id;
+ }).getOr(null);
+ } else if (isNumber(id)) {
+ return editors[id] ? editors[id] : null;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- each$22(targets, function (elm) {
- if (isInvalidInlineTarget(settings, elm)) {
- $_5ksiiu54jjgwe8k7.initError('Could not initialize inline editor on invalid inline target element', elm);
- } else {
- createEditor(createId(elm), settings, elm);
- }
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- };
- self$$1.settings = settings;
- DOM$9.bind(window, 'ready', initEditors);
- return new promiseObj(function (resolve) {
- if (result) {
- resolve(result);
- } else {
- provideResults = function (editors) {
- resolve(editors);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ add: function (editor) {
+ var self$$1 = this;
+ var existingEditor;
+ existingEditor = legacyEditors[editor.id];
+ if (existingEditor === editor) {
+ return editor;
+ }
+ if (self$$1.get(editor.id) === null) {
+ if (isValidLegacyKey(editor.id)) {
+ legacyEditors[editor.id] = editor;
+ }
+ legacyEditors.push(editor);
+ editors.push(editor);
+ }
+ toggleGlobalEvents(true);
+ self$$1.activeEditor = editor;
+ self$$1.fire('AddEditor', { editor: editor });
+ if (!beforeUnloadDelegate) {
+ beforeUnloadDelegate = function () {
+ self$$1.fire('BeforeUnload');
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ DOM$9.bind(window, 'beforeunload', beforeUnloadDelegate);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- });
- },
- get: function (id) {
- if (arguments.length === 0) {
- return editors.slice(0);
- } else if (isString(id)) {
- return find(editors, function (editor) {
- return editor.id === id;
- }).getOr(null);
- } else if (isNumber(id)) {
- return editors[id] ? editors[id] : null;
- } else {
- return null;
- }
- },
- add: function (editor) {
- var self$$1 = this;
- var existingEditor;
- existingEditor = legacyEditors[editor.id];
- if (existingEditor === editor) {
</del><span class="cx" style="display: block; padding: 0 10px"> return editor;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (self$$1.get(editor.id) === null) {
- if (isValidLegacyKey(editor.id)) {
- legacyEditors[editor.id] = editor;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
+ createEditor: function (id, settings) {
+ return this.add(new Editor(id, settings, this));
+ },
+ remove: function (selector) {
+ var self$$1 = this;
+ var i, editor;
+ if (!selector) {
+ for (i = editors.length - 1; i >= 0; i--) {
+ self$$1.remove(editors[i]);
+ }
+ 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">- legacyEditors.push(editor);
- editors.push(editor);
- }
- toggleGlobalEvents(true);
- self$$1.activeEditor = editor;
- self$$1.fire('AddEditor', { editor: editor });
- if (!beforeUnloadDelegate) {
- beforeUnloadDelegate = function () {
- self$$1.fire('BeforeUnload');
- };
- DOM$9.bind(window, 'beforeunload', beforeUnloadDelegate);
- }
- return editor;
- },
- createEditor: function (id, settings) {
- return this.add(new Editor(id, settings, this));
- },
- remove: function (selector) {
- var self$$1 = this;
- var i, editor;
- if (!selector) {
- for (i = editors.length - 1; i >= 0; i--) {
- self$$1.remove(editors[i]);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (isString(selector)) {
+ each$m(DOM$9.select(selector), function (elm) {
+ editor = self$$1.get(elm.id);
+ if (editor) {
+ self$$1.remove(editor);
+ }
+ });
+ 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;
- }
- if (isString(selector)) {
- each$22(DOM$9.select(selector), function (elm) {
- editor = self$$1.get(elm.id);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor = selector;
+ if (isNull(self$$1.get(editor.id))) {
+ return null;
+ }
+ if (removeEditorFromList(editor)) {
+ self$$1.fire('RemoveEditor', { editor: editor });
+ }
+ if (editors.length === 0) {
+ DOM$9.unbind(window, 'beforeunload', beforeUnloadDelegate);
+ }
+ editor.remove();
+ toggleGlobalEvents(editors.length > 0);
+ return editor;
+ },
+ execCommand: function (cmd, ui, value) {
+ var self$$1 = this, editor = self$$1.get(value);
+ switch (cmd) {
+ case 'mceAddEditor':
+ if (!self$$1.get(value)) {
+ new Editor(value, self$$1.settings, self$$1).render();
+ }
+ return true;
+ case 'mceRemoveEditor':
</ins><span class="cx" style="display: block; padding: 0 10px"> if (editor) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- self$$1.remove(editor);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ editor.remove();
</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 true;
+ case 'mceToggleEditor':
+ if (!editor) {
+ self$$1.execCommand('mceAddEditor', 0, value);
+ return true;
+ }
+ if (editor.isHidden()) {
+ editor.show();
+ } else {
+ editor.hide();
+ }
+ return true;
+ }
+ if (self$$1.activeEditor) {
+ return self$$1.activeEditor.execCommand(cmd, ui, value);
+ }
+ return false;
+ },
+ triggerSave: function () {
+ each$m(editors, function (editor) {
+ editor.save();
</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">+ },
+ addI18n: function (code, items) {
+ I18n.add(code, items);
+ },
+ translate: function (text) {
+ return I18n.translate(text);
+ },
+ setActive: function (editor) {
+ var activeEditor = this.activeEditor;
+ if (this.activeEditor !== editor) {
+ if (activeEditor) {
+ activeEditor.fire('deactivate', { relatedTarget: editor });
+ }
+ editor.fire('activate', { relatedTarget: activeEditor });
+ }
+ this.activeEditor = 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">- editor = selector;
- if (isNull(self$$1.get(editor.id))) {
- return null;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ extend$5(EditorManager, Observable);
+ EditorManager.setup();
+ var EditorManager$1 = EditorManager;
+
+ function RangeUtils(dom) {
+ var walk = function (rng, callback) {
+ return RangeWalk.walk(dom, rng, callback);
+ };
+ var split = SplitRange.split;
+ var normalize = function (rng) {
+ return NormalizeRange.normalize(dom, rng).fold(constant(false), function (normalizedRng) {
+ rng.setStart(normalizedRng.startContainer, normalizedRng.startOffset);
+ rng.setEnd(normalizedRng.endContainer, normalizedRng.endOffset);
+ return true;
+ });
+ };
+ return {
+ walk: walk,
+ split: split,
+ normalize: normalize
+ };
+ }
+ (function (RangeUtils) {
+ RangeUtils.compareRanges = RangeCompare.isEq;
+ RangeUtils.getCaretRangeFromPoint = CaretRangeFromPoint.fromPoint;
+ RangeUtils.getSelectedNode = getSelectedNode;
+ RangeUtils.getNode = getNode;
+ }(RangeUtils || (RangeUtils = {})));
+ var RangeUtils$1 = RangeUtils;
+
+ var min = Math.min, max = Math.max, round$2 = Math.round;
+ var relativePosition = function (rect, targetRect, rel) {
+ var x, y, w, h, targetW, targetH;
+ x = targetRect.x;
+ y = targetRect.y;
+ w = rect.w;
+ h = rect.h;
+ targetW = targetRect.w;
+ targetH = targetRect.h;
+ rel = (rel || '').split('');
+ if (rel[0] === 'b') {
+ y += targetH;
</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 (removeEditorFromList(editor)) {
- self$$1.fire('RemoveEditor', { editor: editor });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rel[1] === 'r') {
+ x += targetW;
</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 (editors.length === 0) {
- DOM$9.unbind(window, 'beforeunload', beforeUnloadDelegate);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rel[0] === 'c') {
+ y += round$2(targetH / 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">- editor.remove();
- toggleGlobalEvents(editors.length > 0);
- return editor;
- },
- execCommand: function (cmd, ui, value) {
- var self$$1 = this, editor = self$$1.get(value);
- switch (cmd) {
- case 'mceAddEditor':
- if (!self$$1.get(value)) {
- new Editor(value, self$$1.settings, self$$1).render();
- }
- return true;
- case 'mceRemoveEditor':
- if (editor) {
- editor.remove();
- }
- return true;
- case 'mceToggleEditor':
- if (!editor) {
- self$$1.execCommand('mceAddEditor', 0, value);
- return true;
- }
- if (editor.isHidden()) {
- editor.show();
- } else {
- editor.hide();
- }
- return true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rel[1] === 'c') {
+ x += round$2(targetW / 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">- if (self$$1.activeEditor) {
- return self$$1.activeEditor.execCommand(cmd, ui, value);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rel[3] === 'b') {
+ y -= 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">- return false;
- },
- triggerSave: function () {
- each$22(editors, function (editor) {
- editor.save();
- });
- },
- addI18n: function (code, items) {
- $_65s8hc80jjgwe94e.add(code, items);
- },
- translate: function (text) {
- return $_65s8hc80jjgwe94e.translate(text);
- },
- setActive: function (editor) {
- var activeEditor = this.activeEditor;
- if (this.activeEditor !== editor) {
- if (activeEditor) {
- activeEditor.fire('deactivate', { relatedTarget: editor });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (rel[4] === 'r') {
+ x -= w;
+ }
+ if (rel[3] === 'c') {
+ y -= round$2(h / 2);
+ }
+ if (rel[4] === 'c') {
+ x -= round$2(w / 2);
+ }
+ return create$3(x, y, w, h);
+ };
+ var findBestRelativePosition = function (rect, targetRect, constrainRect, rels) {
+ var pos, i;
+ for (i = 0; i < rels.length; i++) {
+ pos = relativePosition(rect, targetRect, rels[i]);
+ if (pos.x >= constrainRect.x && pos.x + pos.w <= constrainRect.w + constrainRect.x && pos.y >= constrainRect.y && pos.y + pos.h <= constrainRect.h + constrainRect.y) {
+ return rels[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.fire('activate', { relatedTarget: activeEditor });
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.activeEditor = editor;
- }
- };
- extend$5(EditorManager, $_5fwo104qjjgwe8hz);
- EditorManager.setup();
- var EditorManager$1 = EditorManager;
-
- function RangeUtils(dom) {
- var walk = function (rng, callback) {
- return $_e2gzn43bjjgwe82k.walk(dom, rng, callback);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return 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">- var split = $_10670d6ajjgwe8rj.split;
- var normalize = function (rng) {
- return $_eqgqyj4jjjgwe8gi.normalize(dom, rng).fold(constant(false), function (normalizedRng) {
- rng.setStart(normalizedRng.startContainer, normalizedRng.startOffset);
- rng.setEnd(normalizedRng.endContainer, normalizedRng.endOffset);
- return true;
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var inflate = function (rect, w, h) {
+ return create$3(rect.x - w, rect.y - h, rect.w + w * 2, rect.h + h * 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">- return {
- walk: walk,
- split: split,
- normalize: normalize
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var intersect = function (rect, cropRect) {
+ var x1, y1, x2, y2;
+ x1 = max(rect.x, cropRect.x);
+ y1 = max(rect.y, cropRect.y);
+ x2 = min(rect.x + rect.w, cropRect.x + cropRect.w);
+ y2 = min(rect.y + rect.h, cropRect.y + cropRect.h);
+ if (x2 - x1 < 0 || y2 - y1 < 0) {
+ return null;
+ }
+ return create$3(x1, y1, x2 - x1, y2 - y1);
</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 (RangeUtils) {
- RangeUtils.compareRanges = $_g1gkxh4kjjgwe8gw.isEq;
- RangeUtils.getCaretRangeFromPoint = $_269jak6xjjgwe8wp.fromPoint;
- RangeUtils.getSelectedNode = getSelectedNode;
- RangeUtils.getNode = getNode;
- }(RangeUtils || (RangeUtils = {})));
- var RangeUtils$1 = RangeUtils;
-
- var min = Math.min;
- var max = Math.max;
- var round$2 = Math.round;
- var relativePosition = function (rect, targetRect, rel) {
- var x, y, w, h, targetW, targetH;
- x = targetRect.x;
- y = targetRect.y;
- w = rect.w;
- h = rect.h;
- targetW = targetRect.w;
- targetH = targetRect.h;
- rel = (rel || '').split('');
- if (rel[0] === 'b') {
- y += targetH;
- }
- if (rel[1] === 'r') {
- x += targetW;
- }
- if (rel[0] === 'c') {
- y += round$2(targetH / 2);
- }
- if (rel[1] === 'c') {
- x += round$2(targetW / 2);
- }
- if (rel[3] === 'b') {
- y -= h;
- }
- if (rel[4] === 'r') {
- x -= w;
- }
- if (rel[3] === 'c') {
- y -= round$2(h / 2);
- }
- if (rel[4] === 'c') {
- x -= round$2(w / 2);
- }
- return create$3(x, y, w, h);
- };
- var findBestRelativePosition = function (rect, targetRect, constrainRect, rels) {
- var pos, i;
- for (i = 0; i < rels.length; i++) {
- pos = relativePosition(rect, targetRect, rels[i]);
- if (pos.x >= constrainRect.x && pos.x + pos.w <= constrainRect.w + constrainRect.x && pos.y >= constrainRect.y && pos.y + pos.h <= constrainRect.h + constrainRect.y) {
- return rels[i];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var clamp$1 = function (rect, clampRect, fixedSize) {
+ var underflowX1, underflowY1, overflowX2, overflowY2, x1, y1, x2, y2, cx2, cy2;
+ x1 = rect.x;
+ y1 = rect.y;
+ x2 = rect.x + rect.w;
+ y2 = rect.y + rect.h;
+ cx2 = clampRect.x + clampRect.w;
+ cy2 = clampRect.y + clampRect.h;
+ underflowX1 = max(0, clampRect.x - x1);
+ underflowY1 = max(0, clampRect.y - y1);
+ overflowX2 = max(0, x2 - cx2);
+ overflowY2 = max(0, y2 - cy2);
+ x1 += underflowX1;
+ y1 += underflowY1;
+ if (fixedSize) {
+ x2 += underflowX1;
+ y2 += underflowY1;
+ x1 -= overflowX2;
+ y1 -= overflowY2;
</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 null;
- };
- var inflate = function (rect, w, h) {
- return create$3(rect.x - w, rect.y - h, rect.w + w * 2, rect.h + h * 2);
- };
- var intersect = function (rect, cropRect) {
- var x1, y1, x2, y2;
- x1 = max(rect.x, cropRect.x);
- y1 = max(rect.y, cropRect.y);
- x2 = min(rect.x + rect.w, cropRect.x + cropRect.w);
- y2 = min(rect.y + rect.h, cropRect.y + cropRect.h);
- if (x2 - x1 < 0 || y2 - y1 < 0) {
- return null;
- }
- return create$3(x1, y1, x2 - x1, y2 - y1);
- };
- var clamp$1 = function (rect, clampRect, fixedSize) {
- var underflowX1, underflowY1, overflowX2, overflowY2, x1, y1, x2, y2, cx2, cy2;
- x1 = rect.x;
- y1 = rect.y;
- x2 = rect.x + rect.w;
- y2 = rect.y + rect.h;
- cx2 = clampRect.x + clampRect.w;
- cy2 = clampRect.y + clampRect.h;
- underflowX1 = max(0, clampRect.x - x1);
- underflowY1 = max(0, clampRect.y - y1);
- overflowX2 = max(0, x2 - cx2);
- overflowY2 = max(0, y2 - cy2);
- x1 += underflowX1;
- y1 += underflowY1;
- if (fixedSize) {
- x2 += underflowX1;
- y2 += underflowY1;
- x1 -= overflowX2;
- y1 -= overflowY2;
- }
- x2 -= overflowX2;
- y2 -= overflowY2;
- return create$3(x1, y1, x2 - x1, y2 - y1);
- };
- var create$3 = function (x, y, w, h) {
- return {
- x: x,
- y: y,
- w: w,
- h: h
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ x2 -= overflowX2;
+ y2 -= overflowY2;
+ return create$3(x1, y1, x2 - x1, y2 - y1);
</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 fromClientRect = function (clientRect) {
- return create$3(clientRect.left, clientRect.top, clientRect.width, clientRect.height);
- };
- var $_5hxmix82jjgwe94o = {
- inflate: inflate,
- relativePosition: relativePosition,
- findBestRelativePosition: findBestRelativePosition,
- intersect: intersect,
- clamp: clamp$1,
- create: create$3,
- fromClientRect: fromClientRect
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var create$3 = function (x, y, w, h) {
+ return {
+ x: x,
+ y: y,
+ w: w,
+ h: h
+ };
+ };
+ var fromClientRect = function (clientRect) {
+ return create$3(clientRect.left, clientRect.top, clientRect.width, clientRect.height);
+ };
+ var Rect = {
+ inflate: inflate,
+ relativePosition: relativePosition,
+ findBestRelativePosition: findBestRelativePosition,
+ intersect: intersect,
+ clamp: clamp$1,
+ create: create$3,
+ fromClientRect: fromClientRect
+ };
</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 types = {};
- var $_9yg02e83jjgwe94t = {
- add: function (type, typeClass) {
- types[type.toLowerCase()] = typeClass;
- },
- has: function (type) {
- return !!types[type.toLowerCase()];
- },
- get: function (type) {
- var lctype = type.toLowerCase();
- var controlType = types.hasOwnProperty(lctype) ? types[lctype] : null;
- if (controlType === null) {
- throw new Error('Could not find module for type: ' + type);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var types = {};
+ var Factory = {
+ add: function (type, typeClass) {
+ types[type.toLowerCase()] = typeClass;
+ },
+ has: function (type) {
+ return !!types[type.toLowerCase()];
+ },
+ get: function (type) {
+ var lctype = type.toLowerCase();
+ var controlType = types.hasOwnProperty(lctype) ? types[lctype] : null;
+ if (controlType === null) {
+ throw new Error('Could not find module for type: ' + type);
+ }
+ return controlType;
+ },
+ create: function (type, settings) {
+ var ControlType;
+ if (typeof type === 'string') {
+ settings = settings || {};
+ settings.type = type;
+ } else {
+ settings = type;
+ type = settings.type;
+ }
+ type = type.toLowerCase();
+ ControlType = types[type];
+ if (!ControlType) {
+ throw new Error('Could not find control by type: ' + type);
+ }
+ ControlType = new ControlType(settings);
+ ControlType.type = type;
+ return ControlType;
</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 controlType;
- },
- create: function (type, settings) {
- var ControlType;
- if (typeof type === 'string') {
- settings = settings || {};
- settings.type = type;
- } else {
- settings = type;
- type = settings.type;
- }
- type = type.toLowerCase();
- ControlType = types[type];
- if (!ControlType) {
- throw new Error('Could not find control by type: ' + type);
- }
- ControlType = new ControlType(settings);
- ControlType.type = type;
- return ControlType;
- }
- };
</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">- var each$23 = $_6cwiepljjgwe7j4.each;
- var extend$6 = $_6cwiepljjgwe7j4.extend;
- var extendClass;
- var initializing;
- var Class$1 = function () {
- };
- Class$1.extend = extendClass = function (prop) {
- var self = this;
- var _super = self.prototype;
- var prototype, name, member;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var each$n = Tools.each, extend$6 = Tools.extend;
+ var extendClass, initializing;
</ins><span class="cx" style="display: block; padding: 0 10px"> var Class = function () {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var i, mixins, mixin;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ Class.extend = extendClass = function (prop) {
</ins><span class="cx" style="display: block; padding: 0 10px"> var self = this;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (!initializing) {
- if (self.init) {
- self.init.apply(self, arguments);
- }
- mixins = self.Mixins;
- if (mixins) {
- i = mixins.length;
- while (i--) {
- mixin = mixins[i];
- if (mixin.init) {
- mixin.init.apply(self, arguments);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var _super = self.prototype;
+ var prototype, name, member;
+ var Class = function () {
+ var i, mixins, mixin;
+ var self = this;
+ if (!initializing) {
+ if (self.init) {
+ self.init.apply(self, arguments);
+ }
+ mixins = self.Mixins;
+ if (mixins) {
+ i = mixins.length;
+ while (i--) {
+ mixin = mixins[i];
+ if (mixin.init) {
+ mixin.init.apply(self, arguments);
+ }
</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">- }
- };
- var dummy = function () {
- return this;
- };
- var createMethod = function (name, fn) {
- return function () {
- var self = this;
- var tmp = self._super;
- var ret;
- self._super = _super[name];
- ret = fn.apply(self, arguments);
- self._super = tmp;
- return ret;
</del><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- initializing = true;
- prototype = new self();
- initializing = false;
- if (prop.Mixins) {
- each$23(prop.Mixins, function (mixin) {
- for (var name_1 in mixin) {
- if (name_1 !== 'init') {
- prop[name_1] = mixin[name_1];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var dummy = function () {
+ return this;
+ };
+ var createMethod = function (name, fn) {
+ return function () {
+ var self = this;
+ var tmp = self._super;
+ var ret;
+ self._super = _super[name];
+ ret = fn.apply(self, arguments);
+ self._super = tmp;
+ return ret;
+ };
+ };
+ initializing = true;
+ prototype = new self();
+ initializing = false;
+ if (prop.Mixins) {
+ each$n(prop.Mixins, function (mixin) {
+ for (var name_1 in mixin) {
+ if (name_1 !== 'init') {
+ prop[name_1] = mixin[name_1];
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ });
+ if (_super.Mixins) {
+ prop.Mixins = _super.Mixins.concat(prop.Mixins);
</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 (_super.Mixins) {
- prop.Mixins = _super.Mixins.concat(prop.Mixins);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- if (prop.Methods) {
- each$23(prop.Methods.split(','), function (name) {
- prop[name] = dummy;
- });
- }
- if (prop.Properties) {
- each$23(prop.Properties.split(','), function (name) {
- var fieldName = '_' + name;
- prop[name] = function (value) {
- var self = this;
- if (value !== undefined) {
- self[fieldName] = value;
- return self;
- }
- return self[fieldName];
- };
- });
- }
- if (prop.Statics) {
- each$23(prop.Statics, function (func, name) {
- Class[name] = func;
- });
- }
- if (prop.Defaults && _super.Defaults) {
- prop.Defaults = extend$6({}, _super.Defaults, prop.Defaults);
- }
- for (name in prop) {
- member = prop[name];
- if (typeof member === 'function' && _super[name]) {
- prototype[name] = createMethod(name, member);
- } else {
- prototype[name] = member;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (prop.Methods) {
+ each$n(prop.Methods.split(','), function (name) {
+ prop[name] = dummy;
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- Class.prototype = prototype;
- Class.constructor = Class;
- Class.extend = extendClass;
- return Class;
- };
-
- var min$1 = Math.min;
- var max$1 = Math.max;
- var round$3 = Math.round;
- var Color = function (value) {
- var self = {};
- var r = 0, g = 0, b = 0;
- var rgb2hsv = function (r, g, b) {
- var h, s, v, d, minRGB, maxRGB;
- h = 0;
- s = 0;
- v = 0;
- r = r / 255;
- g = g / 255;
- b = b / 255;
- minRGB = min$1(r, min$1(g, b));
- maxRGB = max$1(r, max$1(g, b));
- if (minRGB === maxRGB) {
- v = minRGB;
- return {
- h: 0,
- s: 0,
- v: v * 100
- };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (prop.Properties) {
+ each$n(prop.Properties.split(','), function (name) {
+ var fieldName = '_' + name;
+ prop[name] = function (value) {
+ var self = this;
+ if (value !== undefined) {
+ self[fieldName] = value;
+ return self;
+ }
+ return self[fieldName];
+ };
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- d = r === minRGB ? g - b : b === minRGB ? r - g : b - r;
- h = r === minRGB ? 3 : b === minRGB ? 1 : 5;
- h = 60 * (h - d / (maxRGB - minRGB));
- s = (maxRGB - minRGB) / maxRGB;
- v = maxRGB;
- return {
- h: round$3(h),
- s: round$3(s * 100),
- v: round$3(v * 100)
- };
- };
- var hsvToRgb = function (hue, saturation, brightness) {
- var side, chroma, x, match;
- hue = (parseInt(hue, 10) || 0) % 360;
- saturation = parseInt(saturation, 10) / 100;
- brightness = parseInt(brightness, 10) / 100;
- saturation = max$1(0, min$1(saturation, 1));
- brightness = max$1(0, min$1(brightness, 1));
- if (saturation === 0) {
- r = g = b = round$3(255 * brightness);
- return;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (prop.Statics) {
+ each$n(prop.Statics, function (func, name) {
+ Class[name] = func;
+ });
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- side = hue / 60;
- chroma = brightness * saturation;
- x = chroma * (1 - Math.abs(side % 2 - 1));
- match = brightness - chroma;
- switch (Math.floor(side)) {
- case 0:
- r = chroma;
- g = x;
- b = 0;
- break;
- case 1:
- r = x;
- g = chroma;
- b = 0;
- break;
- case 2:
- r = 0;
- g = chroma;
- b = x;
- break;
- case 3:
- r = 0;
- g = x;
- b = chroma;
- break;
- case 4:
- r = x;
- g = 0;
- b = chroma;
- break;
- case 5:
- r = chroma;
- g = 0;
- b = x;
- break;
- default:
- r = g = b = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if (prop.Defaults && _super.Defaults) {
+ prop.Defaults = extend$6({}, _super.Defaults, prop.Defaults);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- r = round$3(255 * (r + match));
- g = round$3(255 * (g + match));
- b = round$3(255 * (b + match));
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for (name in prop) {
+ member = prop[name];
+ if (typeof member === 'function' && _super[name]) {
+ prototype[name] = createMethod(name, member);
+ } else {
+ prototype[name] = member;
+ }
+ }
+ Class.prototype = prototype;
+ Class.constructor = Class;
+ Class.extend = extendClass;
+ return 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">- var toHex = function () {
- var hex = function (val) {
- val = parseInt(val, 10).toString(16);
- return val.length > 1 ? val : '0' + val;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ var min$1 = Math.min, max$1 = Math.max, round$3 = Math.round;
+ var Color = function (value) {
+ var self = {};
+ var r = 0, g = 0, b = 0;
+ var rgb2hsv = function (r, g, b) {
+ var h, s, v, d, minRGB, maxRGB;
+ h = 0;
+ s = 0;
+ v = 0;
+ r = r / 255;
+ g = g / 255;
+ b = b / 255;
+ minRGB = min$1(r, min$1(g, b));
+ maxRGB = max$1(r, max$1(g, b));
+ if (minRGB === maxRGB) {
+ v = minRGB;
+ return {
+ h: 0,
+ s: 0,
+ v: v * 100
+ };
+ }
+ d = r === minRGB ? g - b : b === minRGB ? r - g : b - r;
+ h = r === minRGB ? 3 : b === minRGB ? 1 : 5;
+ h = 60 * (h - d / (maxRGB - minRGB));
+ s = (maxRGB - minRGB) / maxRGB;
+ v = maxRGB;
+ return {
+ h: round$3(h),
+ s: round$3(s * 100),
+ v: round$3(v * 100)
+ };
</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 '#' + hex(r) + hex(g) + hex(b);
- };
- var toRgb = function () {
- return {
- r: r,
- g: g,
- b: b
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var hsvToRgb = function (hue, saturation, brightness) {
+ var side, chroma, x, match;
+ hue = (parseInt(hue, 10) || 0) % 360;
+ saturation = parseInt(saturation, 10) / 100;
+ brightness = parseInt(brightness, 10) / 100;
+ saturation = max$1(0, min$1(saturation, 1));
+ brightness = max$1(0, min$1(brightness, 1));
+ if (saturation === 0) {
+ r = g = b = round$3(255 * brightness);
+ return;
+ }
+ side = hue / 60;
+ chroma = brightness * saturation;
+ x = chroma * (1 - Math.abs(side % 2 - 1));
+ match = brightness - chroma;
+ switch (Math.floor(side)) {
+ case 0:
+ r = chroma;
+ g = x;
+ b = 0;
+ break;
+ case 1:
+ r = x;
+ g = chroma;
+ b = 0;
+ break;
+ case 2:
+ r = 0;
+ g = chroma;
+ b = x;
+ break;
+ case 3:
+ r = 0;
+ g = x;
+ b = chroma;
+ break;
+ case 4:
+ r = x;
+ g = 0;
+ b = chroma;
+ break;
+ case 5:
+ r = chroma;
+ g = 0;
+ b = x;
+ break;
+ default:
+ r = g = b = 0;
+ }
+ r = round$3(255 * (r + match));
+ g = round$3(255 * (g + match));
+ b = round$3(255 * (b + match));
</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 toHsv = function () {
- return rgb2hsv(r, g, b);
- };
- var parse = function (value) {
- var matches;
- if (typeof value === 'object') {
- if ('r' in value) {
- r = value.r;
- g = value.g;
- b = value.b;
- } else if ('v' in value) {
- hsvToRgb(value.h, value.s, value.v);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var toHex = function () {
+ var hex = function (val) {
+ val = parseInt(val, 10).toString(16);
+ return val.length > 1 ? val : '0' + val;
+ };
+ return '#' + hex(r) + hex(g) + hex(b);
+ };
+ var toRgb = function () {
+ return {
+ r: r,
+ g: g,
+ b: b
+ };
+ };
+ var toHsv = function () {
+ return rgb2hsv(r, g, b);
+ };
+ var parse = function (value) {
+ var matches;
+ if (typeof value === 'object') {
+ if ('r' in value) {
+ r = value.r;
+ g = value.g;
+ b = value.b;
+ } else if ('v' in value) {
+ hsvToRgb(value.h, value.s, value.v);
+ }
+ } else {
+ if (matches = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(value)) {
+ r = parseInt(matches[1], 10);
+ g = parseInt(matches[2], 10);
+ b = parseInt(matches[3], 10);
+ } else if (matches = /#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(value)) {
+ r = parseInt(matches[1], 16);
+ g = parseInt(matches[2], 16);
+ b = parseInt(matches[3], 16);
+ } else if (matches = /#([0-F])([0-F])([0-F])/gi.exec(value)) {
+ r = parseInt(matches[1] + matches[1], 16);
+ g = parseInt(matches[2] + matches[2], 16);
+ b = parseInt(matches[3] + matches[3], 16);
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- if (matches = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(value)) {
- r = parseInt(matches[1], 10);
- g = parseInt(matches[2], 10);
- b = parseInt(matches[3], 10);
- } else if (matches = /#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(value)) {
- r = parseInt(matches[1], 16);
- g = parseInt(matches[2], 16);
- b = parseInt(matches[3], 16);
- } else if (matches = /#([0-F])([0-F])([0-F])/gi.exec(value)) {
- r = parseInt(matches[1] + matches[1], 16);
- g = parseInt(matches[2] + matches[2], 16);
- b = parseInt(matches[3] + matches[3], 16);
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ r = r < 0 ? 0 : r > 255 ? 255 : r;
+ g = g < 0 ? 0 : g > 255 ? 255 : g;
+ b = b < 0 ? 0 : b > 255 ? 255 : b;
+ return self;
+ };
+ if (value) {
+ parse(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">- r = r < 0 ? 0 : r > 255 ? 255 : r;
- g = g < 0 ? 0 : g > 255 ? 255 : g;
- b = b < 0 ? 0 : b > 255 ? 255 : b;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ self.toRgb = toRgb;
+ self.toHsv = toHsv;
+ self.toHex = toHex;
+ self.parse = parse;
</ins><span class="cx" style="display: block; padding: 0 10px"> return self;
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if (value) {
- parse(value);
- }
- self.toRgb = toRgb;
- self.toHsv = toHsv;
- self.toHex = toHex;
- self.parse = parse;
- return self;
- };
</del><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- var serialize = function (o, quote) {
- var i, v, t, name;
- quote = quote || '"';
- if (o === null) {
- return 'null';
- }
- t = typeof o;
- if (t === 'string') {
- v = '\bb\tt\nn\ff\rr""\'\'\\\\';
- return quote + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g, function (a, b) {
- if (quote === '"' && a === '\'') {
- return a;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var serialize = function (o, quote) {
+ var i, v, t, name;
+ quote = quote || '"';
+ if (o === null) {
+ return 'null';
+ }
+ t = typeof o;
+ if (t === 'string') {
+ v = '\bb\tt\nn\ff\rr""\'\'\\\\';
+ return quote + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g, function (a, b) {
+ if (quote === '"' && a === '\'') {
+ return a;
+ }
+ i = v.indexOf(b);
+ if (i + 1) {
+ return '\\' + v.charAt(i + 1);
+ }
+ a = b.charCodeAt().toString(16);
+ return '\\u' + '0000'.substring(a.length) + a;
+ }) + quote;
+ }
+ if (t === 'object') {
+ if (o.hasOwnProperty && Object.prototype.toString.call(o) === '[object Array]') {
+ for (i = 0, v = '['; i < o.length; i++) {
+ v += (i > 0 ? ',' : '') + serialize(o[i], quote);
+ }
+ return v + ']';
</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 = v.indexOf(b);
- if (i + 1) {
- return '\\' + v.charAt(i + 1);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ v = '{';
+ for (name in o) {
+ if (o.hasOwnProperty(name)) {
+ v += typeof o[name] !== 'function' ? (v.length > 1 ? ',' + quote : quote) + name + quote + ':' + serialize(o[name], quote) : '';
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- a = b.charCodeAt().toString(16);
- return '\\u' + '0000'.substring(a.length) + a;
- }) + quote;
- }
- if (t === 'object') {
- if (o.hasOwnProperty && Object.prototype.toString.call(o) === '[object Array]') {
- for (i = 0, v = '['; i < o.length; i++) {
- v += (i > 0 ? ',' : '') + serialize(o[i], quote);
- }
- return v + ']';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return v + '}';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- v = '{';
- for (name in o) {
- if (o.hasOwnProperty(name)) {
- v += typeof o[name] !== 'function' ? (v.length > 1 ? ',' + quote : quote) + name + quote + ':' + serialize(o[name], quote) : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return '' + o;
+ };
+ var JSON$1 = {
+ serialize: serialize,
+ parse: function (text) {
+ try {
+ return JSON.parse(text);
+ } catch (ex) {
</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">- return v + '}';
- }
- return '' + o;
- };
- var $_28aphl86jjgwe953 = {
- serialize: serialize,
- parse: function (text) {
- try {
- return JSON.parse(text);
- } catch (ex) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+
+ var JSONP = {
+ callbacks: {},
+ count: 0,
+ send: function (settings) {
+ var self = this, dom = DOMUtils$1.DOM, count = settings.count !== undefined ? settings.count : self.count;
+ var id = 'tinymce_jsonp_' + count;
+ self.callbacks[count] = function (json) {
+ dom.remove(id);
+ delete self.callbacks[count];
+ settings.callback(json);
+ };
+ dom.add(dom.doc.body, 'script', {
+ id: id,
+ src: settings.url,
+ type: 'text/javascript'
+ });
+ self.count++;
</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">+ };
</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 $_cmhhqy87jjgwe955 = {
- callbacks: {},
- count: 0,
- send: function (settings) {
- var self = this, dom = DOMUtils$1.DOM, count = settings.count !== undefined ? settings.count : self.count;
- var id = 'tinymce_jsonp_' + count;
- self.callbacks[count] = function (json) {
- dom.remove(id);
- delete self.callbacks[count];
- settings.callback(json);
- };
- dom.add(dom.doc.body, 'script', {
- id: id,
- src: settings.url,
- type: 'text/javascript'
- });
- self.count++;
- }
- };
-
- var XHR = {
- send: function (settings) {
- var xhr, count = 0;
- var ready = function () {
- if (!settings.async || xhr.readyState === 4 || count++ > 10000) {
- if (settings.success && count < 10000 && xhr.status === 200) {
- settings.success.call(settings.success_scope, '' + xhr.responseText, xhr, settings);
- } else if (settings.error) {
- settings.error.call(settings.error_scope, count > 10000 ? 'TIMED_OUT' : 'GENERAL', xhr, settings);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var XHR = {
+ send: function (settings) {
+ var xhr, count = 0;
+ var ready = function () {
+ if (!settings.async || xhr.readyState === 4 || count++ > 10000) {
+ if (settings.success && count < 10000 && xhr.status === 200) {
+ settings.success.call(settings.success_scope, '' + xhr.responseText, xhr, settings);
+ } else if (settings.error) {
+ settings.error.call(settings.error_scope, count > 10000 ? 'TIMED_OUT' : 'GENERAL', xhr, settings);
+ }
+ xhr = null;
+ } else {
+ setTimeout(ready, 10);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- xhr = null;
- } else {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ settings.scope = settings.scope || this;
+ settings.success_scope = settings.success_scope || settings.scope;
+ settings.error_scope = settings.error_scope || settings.scope;
+ settings.async = settings.async === false ? false : true;
+ settings.data = settings.data || '';
+ XHR.fire('beforeInitialize', { settings: settings });
+ xhr = XMLHttpRequest();
+ if (xhr) {
+ if (xhr.overrideMimeType) {
+ xhr.overrideMimeType(settings.content_type);
+ }
+ xhr.open(settings.type || (settings.data ? 'POST' : 'GET'), settings.url, settings.async);
+ if (settings.crossDomain) {
+ xhr.withCredentials = true;
+ }
+ if (settings.content_type) {
+ xhr.setRequestHeader('Content-Type', settings.content_type);
+ }
+ if (settings.requestheaders) {
+ Tools.each(settings.requestheaders, function (header) {
+ xhr.setRequestHeader(header.key, header.value);
+ });
+ }
+ xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
+ xhr = XHR.fire('beforeSend', {
+ xhr: xhr,
+ settings: settings
+ }).xhr;
+ xhr.send(settings.data);
+ if (!settings.async) {
+ return ready();
+ }
</ins><span class="cx" style="display: block; padding: 0 10px"> setTimeout(ready, 10);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- };
- settings.scope = settings.scope || this;
- settings.success_scope = settings.success_scope || settings.scope;
- settings.error_scope = settings.error_scope || settings.scope;
- settings.async = settings.async === false ? false : true;
- settings.data = settings.data || '';
- XHR.fire('beforeInitialize', { settings: settings });
- xhr = new XMLHttpRequest();
- if (xhr) {
- if (xhr.overrideMimeType) {
- xhr.overrideMimeType(settings.content_type);
- }
- xhr.open(settings.type || (settings.data ? 'POST' : 'GET'), settings.url, settings.async);
- if (settings.crossDomain) {
- xhr.withCredentials = true;
- }
- if (settings.content_type) {
- xhr.setRequestHeader('Content-Type', settings.content_type);
- }
- if (settings.requestheaders) {
- $_6cwiepljjgwe7j4.each(settings.requestheaders, function (header) {
- xhr.setRequestHeader(header.key, header.value);
- });
- }
- xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
- xhr = XHR.fire('beforeSend', {
- xhr: xhr,
- settings: settings
- }).xhr;
- xhr.send(settings.data);
- if (!settings.async) {
- return ready();
- }
- setTimeout(ready, 10);
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
- };
- $_6cwiepljjgwe7j4.extend(XHR, $_5fwo104qjjgwe8hz);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ Tools.extend(XHR, Observable);
</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 extend$7 = $_6cwiepljjgwe7j4.extend;
- var JSONRequest = function (settings) {
- this.settings = extend$7({}, settings);
- this.count = 0;
- };
- JSONRequest.sendRPC = function (o) {
- return new JSONRequest().send(o);
- };
- JSONRequest.prototype = {
- send: function (args) {
- var ecb = args.error, scb = args.success;
- args = extend$7(this.settings, args);
- args.success = function (c, x) {
- c = $_28aphl86jjgwe953.parse(c);
- if (typeof c === 'undefined') {
- c = { error: 'JSON Parse error.' };
- }
- if (c.error) {
- ecb.call(args.error_scope || args.scope, c.error, x);
- } else {
- scb.call(args.success_scope || args.scope, c.result);
- }
- };
- args.error = function (ty, x) {
- if (ecb) {
- ecb.call(args.error_scope || args.scope, ty, x);
- }
- };
- args.data = $_28aphl86jjgwe953.serialize({
- id: args.id || 'c' + this.count++,
- method: args.method,
- params: args.params
- });
- args.content_type = 'application/json';
- XHR.send(args);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var extend$7 = Tools.extend;
+ var JSONRequest = function (settings) {
+ this.settings = extend$7({}, settings);
+ this.count = 0;
+ };
+ JSONRequest.sendRPC = function (o) {
+ return new JSONRequest().send(o);
+ };
+ JSONRequest.prototype = {
+ send: function (args) {
+ var ecb = args.error, scb = args.success;
+ args = extend$7(this.settings, args);
+ args.success = function (c, x) {
+ c = JSON$1.parse(c);
+ if (typeof c === 'undefined') {
+ c = { error: 'JSON Parse error.' };
+ }
+ if (c.error) {
+ ecb.call(args.error_scope || args.scope, c.error, x);
+ } else {
+ scb.call(args.success_scope || args.scope, c.result);
+ }
+ };
+ args.error = function (ty, x) {
+ if (ecb) {
+ ecb.call(args.error_scope || args.scope, ty, x);
+ }
+ };
+ args.data = JSON$1.serialize({
+ id: args.id || 'c' + this.count++,
+ method: args.method,
+ params: args.params
+ });
+ args.content_type = 'application/json';
+ XHR.send(args);
+ }
+ };
+
+ var create$4 = function () {
+ return function () {
+ var data = {};
+ var keys = [];
+ var storage = {
+ getItem: function (key) {
+ var item = data[key];
+ return item ? item : null;
+ },
+ setItem: function (key, value) {
+ keys.push(key);
+ data[key] = String(value);
+ },
+ key: function (index) {
+ return keys[index];
+ },
+ removeItem: function (key) {
+ keys = keys.filter(function (k) {
+ return k === key;
+ });
+ delete data[key];
+ },
+ clear: function () {
+ keys = [];
+ data = {};
+ },
+ length: 0
+ };
+ Object.defineProperty(storage, 'length', {
+ get: function () {
+ return keys.length;
+ },
+ configurable: false,
+ enumerable: false
+ });
+ return storage;
+ }();
+ };
+
+ var localStorage$$1;
+ try {
+ localStorage$$1 = window.localStorage;
+ } catch (e) {
+ localStorage$$1 = create$4();
</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">+ var LocalStorage = localStorage$$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">- var localStorage$$1 = window.localStorage;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var tinymce = EditorManager$1;
+ var publicApi = {
+ geom: { Rect: Rect },
+ util: {
+ Promise: promiseObj,
+ Delay: Delay,
+ Tools: Tools,
+ VK: VK,
+ URI: URI,
+ Class: Class,
+ EventDispatcher: Dispatcher,
+ Observable: Observable,
+ I18n: I18n,
+ XHR: XHR,
+ JSON: JSON$1,
+ JSONRequest: JSONRequest,
+ JSONP: JSONP,
+ LocalStorage: LocalStorage,
+ Color: Color
+ },
+ dom: {
+ EventUtils: EventUtils,
+ Sizzle: Sizzle,
+ DomQuery: DomQuery,
+ TreeWalker: TreeWalker,
+ DOMUtils: DOMUtils$1,
+ ScriptLoader: ScriptLoader,
+ RangeUtils: RangeUtils$1,
+ Serializer: Serializer$1,
+ ControlSelection: ControlSelection,
+ BookmarkManager: BookmarkManager$1,
+ Selection: Selection,
+ Event: EventUtils.Event
+ },
+ html: {
+ Styles: Styles,
+ Entities: Entities,
+ Node: Node$2,
+ Schema: Schema,
+ SaxParser: SaxParser$1,
+ DomParser: DomParser,
+ Writer: Writer,
+ Serializer: Serializer
+ },
+ ui: { Factory: Factory },
+ Env: Env,
+ AddOnManager: AddOnManager,
+ Annotator: Annotator,
+ Formatter: Formatter,
+ UndoManager: UndoManager,
+ EditorCommands: EditorCommands,
+ WindowManager: WindowManager,
+ NotificationManager: NotificationManager,
+ EditorObservable: EditorObservable$1,
+ Shortcuts: Shortcuts,
+ Editor: Editor,
+ FocusManager: FocusManager,
+ EditorManager: EditorManager$1,
+ DOM: DOMUtils$1.DOM,
+ ScriptLoader: ScriptLoader.ScriptLoader,
+ PluginManager: AddOnManager.PluginManager,
+ ThemeManager: AddOnManager.ThemeManager,
+ trim: Tools.trim,
+ isArray: Tools.isArray,
+ is: Tools.is,
+ toArray: Tools.toArray,
+ makeMap: Tools.makeMap,
+ each: Tools.each,
+ map: Tools.map,
+ grep: Tools.grep,
+ inArray: Tools.inArray,
+ extend: Tools.extend,
+ create: Tools.create,
+ walk: Tools.walk,
+ createNS: Tools.createNS,
+ resolve: Tools.resolve,
+ explode: Tools.explode,
+ _addCacheSuffix: Tools._addCacheSuffix,
+ isOpera: Env.opera,
+ isWebKit: Env.webkit,
+ isIE: Env.ie,
+ isGecko: Env.gecko,
+ isMac: Env.mac
+ };
+ tinymce = Tools.extend(tinymce, publicApi);
+ var Tinymce = tinymce;
</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 tinymce = EditorManager$1;
- var publicApi = {
- geom: { Rect: $_5hxmix82jjgwe94o },
- util: {
- Promise: promiseObj,
- Delay: $_9o1ijaijjgwe7dm,
- Tools: $_6cwiepljjgwe7j4,
- VK: $_9udk9k5wjjgwe8on,
- URI: URI,
- Class: Class$1,
- EventDispatcher: Dispatcher,
- Observable: $_5fwo104qjjgwe8hz,
- I18n: $_65s8hc80jjgwe94e,
- XHR: XHR,
- JSON: $_28aphl86jjgwe953,
- JSONRequest: JSONRequest,
- JSONP: $_cmhhqy87jjgwe955,
- LocalStorage: localStorage$$1,
- Color: Color
- },
- dom: {
- EventUtils: EventUtils,
- Sizzle: Sizzle,
- DomQuery: DomQuery,
- TreeWalker: TreeWalker,
- DOMUtils: DOMUtils$1,
- ScriptLoader: ScriptLoader,
- RangeUtils: RangeUtils$1,
- Serializer: DomSerializer$1,
- ControlSelection: ControlSelection,
- BookmarkManager: BookmarkManager$1,
- Selection: Selection$1,
- Event: EventUtils.Event
- },
- html: {
- Styles: Styles,
- Entities: $_6pqr9q1sjjgwe7qj,
- Node: Node$2,
- Schema: Schema,
- SaxParser: SaxParser$1,
- DomParser: DomParser,
- Writer: Writer,
- Serializer: HtmlSerializer
- },
- ui: { Factory: $_9yg02e83jjgwe94t },
- Env: $_bcvfv9ajjgwe79v,
- AddOnManager: AddOnManager,
- Annotator: Annotator,
- Formatter: Formatter,
- UndoManager: UndoManager,
- EditorCommands: EditorCommands,
- WindowManager: WindowManager,
- NotificationManager: NotificationManager,
- EditorObservable: EditorObservable$1,
- Shortcuts: Shortcuts,
- Editor: Editor,
- FocusManager: $_264dtu7yjjgwe947,
- EditorManager: EditorManager$1,
- DOM: DOMUtils$1.DOM,
- ScriptLoader: ScriptLoader.ScriptLoader,
- PluginManager: AddOnManager.PluginManager,
- ThemeManager: AddOnManager.ThemeManager,
- trim: $_6cwiepljjgwe7j4.trim,
- isArray: $_6cwiepljjgwe7j4.isArray,
- is: $_6cwiepljjgwe7j4.is,
- toArray: $_6cwiepljjgwe7j4.toArray,
- makeMap: $_6cwiepljjgwe7j4.makeMap,
- each: $_6cwiepljjgwe7j4.each,
- map: $_6cwiepljjgwe7j4.map,
- grep: $_6cwiepljjgwe7j4.grep,
- inArray: $_6cwiepljjgwe7j4.inArray,
- extend: $_6cwiepljjgwe7j4.extend,
- create: $_6cwiepljjgwe7j4.create,
- walk: $_6cwiepljjgwe7j4.walk,
- createNS: $_6cwiepljjgwe7j4.createNS,
- resolve: $_6cwiepljjgwe7j4.resolve,
- explode: $_6cwiepljjgwe7j4.explode,
- _addCacheSuffix: $_6cwiepljjgwe7j4._addCacheSuffix,
- isOpera: $_bcvfv9ajjgwe79v.opera,
- isWebKit: $_bcvfv9ajjgwe79v.webkit,
- isIE: $_bcvfv9ajjgwe79v.ie,
- isGecko: $_bcvfv9ajjgwe79v.gecko,
- isMac: $_bcvfv9ajjgwe79v.mac
- };
- tinymce = $_6cwiepljjgwe7j4.extend(tinymce, publicApi);
- var Tinymce = tinymce;
-
- var exportToModuleLoaders = function (tinymce) {
- if (typeof module === 'object') {
- try {
- module.exports = tinymce;
- } catch (_) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var exportToModuleLoaders = function (tinymce) {
+ if (typeof module === 'object') {
+ try {
+ module.exports = tinymce;
+ } catch (_) {
+ }
</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 exportToWindowGlobal = function (tinymce) {
- window.tinymce = tinymce;
- window.tinyMCE = tinymce;
- };
- exportToWindowGlobal(Tinymce);
- exportToModuleLoaders(Tinymce);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ };
+ var exportToWindowGlobal = function (tinymce) {
+ window.tinymce = tinymce;
+ window.tinyMCE = tinymce;
+ };
+ exportToWindowGlobal(Tinymce);
+ exportToModuleLoaders(Tinymce);
</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="trunksrcjs_enqueuesvendortinymcetinymceminjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/js/_enqueues/vendor/tinymce/tinymce.min.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/js/_enqueues/vendor/tinymce/tinymce.min.js 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/js/_enqueues/vendor/tinymce/tinymce.min.js 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,2 +1,2 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-// 4.8.0 (2018-06-27)
-!function(){"use strict";var e,t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},q=function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,arguments))}},H=function(e){return function(){return e}},j=function(e){return e},b=function(i){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var a=new Array(arguments.length-1),n=1;n<arguments.length;n++)a[n-1]=arguments[n];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];var o=a.concat(n);return i.apply(null,o)}},y=H(!1),C=H(!0),x=y,w=C,N=function(){return E},E=(r={fold:function(e,t){return e()},is:x,isSome:x,isNone:w,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){ret
urn null},getOrUndefined:function(){return undefined},or:n,orThunk:t,map:N,ap:N,each:function(){},bind:N,flatten:N,exists:x,forall:w,filter:N,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:H("none()")},Object.freeze&&Object.freeze(r),r),S=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:w,isNone:x,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return S(e(n))},ap:function(e){return e.fold(N,function(e){return S(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:E},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(x,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},A={some:S,none:N,from:function(e){return null===e||e===undefi
ned?E:S(e)}},T=function(t){return function(e){return function(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},k=T("string"),_=T("object"),R=T("array"),D=T("null"),B=T("boolean"),O=T("function"),P=T("number"),L=(o=Array.prototype.indexOf)===undefined?function(e,t){return X(e,t)}:function(e,t){return o.call(e,t)},I=function(e,t){return-1<L(e,t)},M=function(e,t){return K(e,t).isSome()},$=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o,e)}return r},F=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)},W=function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o,e)?n:r).push(a)}return{pass:n,fail:r}},U=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r
];t(i,r,e)&&n.push(i)}return n},z=function(e,t,n){return F(e,function(e){n=t(n,e)}),n},V=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return A.some(o)}return A.none()},K=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n,e))return A.some(n);return A.none()},X=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},Y=Array.prototype.push,G=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);Y.apply(t,e[n])}return t}($(e,t))},J=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n,e))return!1;return!0},Q=Array.prototype.slice,Z=function(e,t){return U(e,function(e){return!I(t,e)})},ee=function(e){return 0===e.length?A.none():A.some(e[0])},te=function(e){return 0===e.length?A.none():A.some(e[e.length-1])},ne=O(Array.from)?Array.from:function(e){return Q.call(e)}
,re="undefined"!=typeof window?window:Function("return this;")(),oe=function(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:re,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},ie={getOrDie:function(e,t){var n=oe(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n}},ae=function(){return ie.getOrDie("URL")},ue={createObjectURL:function(e){return ae().createObjectURL(e)},revokeObjectURL:function(e){ae().revokeObjectURL(e)}},se=navigator,ce=se.userAgent,le=function(e){return"matchMedia"in window&&matchMedia(e).matches};d=/Android/.test(ce),a=(a=!(i=/WebKit/.test(ce))&&/MSIE/gi.test(ce)&&/Explorer/gi.test(se.appName))&&/MSIE (\w+)\./.exec(ce)[1],u=-1!==ce.indexOf("Trident/")&&(-1!==ce.indexOf("rv:")||-1!==se.appName.indexOf("Netscape"))&&11,s=-1!==ce
.indexOf("Edge/")&&!a&&!u&&12,a=a||u||s,c=!i&&!u&&/Gecko/.test(ce),l=-1!==ce.indexOf("Mac"),f=/(iPad|iPhone)/.test(ce),m="FormData"in window&&"FileReader"in window&&"URL"in window&&!!ue.createObjectURL,g=le("only screen and (max-device-width: 480px)")&&(d||f),p=le("only screen and (min-width: 800px)")&&(d||f),h=-1!==ce.indexOf("Windows Phone"),s&&(i=!1);var fe,de,me,ge,pe,he,ve,be,ye,Ce,xe,we,Ne,Ee,Se,Te,ke,Ae,_e,Re={opera:!1,webkit:i,ie:a,gecko:c,mac:l,iOS:f,android:d,contentEditable:!f||m||534<=parseInt(ce.match(/AppleWebKit\/(\d*)/)[1],10),transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!==a,range:window.getSelection&&"Range"in window,documentMode:a&&!s?document.documentMode||7:10,fileApi:m,ceFalse:!1===a||8<a,cach
eSuffix:null,container:null,overrideViewPort:null,experimentalShadowDom:!1,canHaveCSP:!1===a||11<a,desktop:!g&&!p,windowsPhone:h},De=window.Promise?window.Promise:function(){function r(e,t){return function(){e.apply(t,arguments)}}var e=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(e,r(o,this),r(u,this))},t=i.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)};function a(r){var o=this;null!==this._state?t(function(){var e=o._state?r.onFulfilled:r.onRejected;if(null!==e){var t;try{t=e(o._value)}catch(n){return void r.reject(n)}r.resolve(t)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o
(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void l(r(t,e),r(o,this),r(u,this))}this._state=!0,this._value=e,s.call(this)}catch(n){u.call(this,n)}}function u(e){this._state=!1,this._value=e,s.call(this)}function s(){for(var e=0,t=this._deferreds.length;e<t;e++)a.call(this,this._deferreds[e]);this._deferreds=null}function c(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function l(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(o){if(r)return;r=!0,n(o)}}return i.prototype["catch"]=function(e){return this.then(null,e)},i.prototype.then=function(n,r){var o=this;return new i(function(e,t){a.call(o,new c(n,r,e,t))})},i.all=function(){var s=Array.prototype.slice.
call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new i(function(o,i){if(0===s.length)return o([]);var a=s.length;function u(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){u(t,e)},i)}s[t]=e,0==--a&&o(s)}catch(r){i(r)}}for(var e=0;e<s.length;e++)u(e,s[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i}(),Be=function(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)},Oe=function(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)},Pe=function(t,n){var r,e;return(e=function(){var e=arguments;clearTimeout(r),r=Be(function(){t.apply(this,e)},n)}).stop=func
tion(){clearTimeout(r)},e},Le={requestAnimationFrame:function(e,t){fe?fe.then(e):fe=new De(function(e){t||(t=document.body),function(e,t){var n,r=window.requestAnimationFrame,o=["ms","moz","webkit"];for(n=0;n<o.length&&!r;n++)r=window[o[n]+"RequestAnimationFrame"];r||(r=function(e){window.setTimeout(e,0)}),r(e,t)}(e,t)}).then(e)},setTimeout:Be,setInterval:Oe,setEditorTimeout:function(e,t,n){return Be(function(){e.removed||t()},n)},setEditorInterval:function(e,t,n){var r;return r=Oe(function(){e.removed?clearInterval(r):t()},n)},debounce:Pe,throttle:Pe,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},Ie=/^(?:mouse|contextmenu)|click/,Me={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1},Fe=function(){return!1},Ue=function(){return!0},ze=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachE
vent("on"+t,n)},Ve=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n)},qe=function(e,t){var n,r,o,i,a,u,s=t||{};for(n in e)Me[n]||(s[n]=e[n]);if(s.target||(s.target=s.srcElement||document),Re.experimentalShadowDom&&(s.target=(r=e,o=s.target,a=o,(i=r.path)&&0<i.length&&(a=i[0]),r.composedPath&&(i=r.composedPath())&&0<i.length&&(a=i[0]),a)),e&&Ie.test(e.type)&&e.pageX===undefined&&e.clientX!==undefined){var c=s.target.ownerDocument||document,l=c.documentElement,f=c.body;s.pageX=e.clientX+(l&&l.scrollLeft||f&&f.scrollLeft||0)-(l&&l.clientLeft||f&&f.clientLeft||0),s.pageY=e.clientY+(l&&l.scrollTop||f&&f.scrollTop||0)-(l&&l.clientTop||f&&f.clientTop||0)}return s.preventDefault=function(){s.isDefaultPrevented=Ue,e&&(e.preventDefault?e.preventDefault():e.
returnValue=!1)},s.stopPropagation=function(){s.isPropagationStopped=Ue,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},!(s.stopImmediatePropagation=function(){s.isImmediatePropagationStopped=Ue,s.stopPropagation()})==((u=s).isDefaultPrevented===Ue||u.isDefaultPrevented===Fe)&&(s.isDefaultPrevented=Fe,s.isPropagationStopped=Fe,s.isImmediatePropagationStopped=Fe),"undefined"==typeof s.metaKey&&(s.metaKey=!1),s},He=function(e,t,n){var r=e.document,o={type:"ready"};if(n.domLoaded)t(o);else{var i=function(){return"complete"===r.readyState||"interactive"===r.readyState&&r.body},a=function(){n.domLoaded||(n.domLoaded=!0,t(o))},u=function(){i()&&(Ve(r,"readystatechange",u),a())},s=function(){try{r.documentElement.doScroll("left")}catch(e){return void Le.setTimeout(s)}a()};!r.addEventListener||Re.ie&&Re.ie<11?(ze(r,"readystatechange",u),r.documentElement.doS
croll&&e.self===e.top&&s()):i()?a():ze(e,"DOMContentLoaded",a),ze(e,"load",a)}},je=function(){var m,g,p,h,v,b=this,y={};g="mce-data-"+(+new Date).toString(32),h="onmouseenter"in document.documentElement,p="onfocusin"in document.documentElement,v={mouseenter:"mouseover",mouseleave:"mouseout"},m=1,b.domLoaded=!1,b.events=y;var C=function(e,t){var n,r,o,i,a=y[t];if(n=a&&a[e.type])for(r=0,o=n.length;r<o;r++)if((i=n[r])&&!1===i.func.call(i.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return};b.bind=function(e,t,n,r){var o,i,a,u,s,c,l,f=window,d=function(e){C(qe(e||f.event),o)};if(e&&3!==e.nodeType&&8!==e.nodeType){for(e[g]?o=e[g]:(o=m++,e[g]=o,y[o]={}),r=r||e,a=(t=t.split(" ")).length;a--;)c=d,s=l=!1,"DOMContentLoaded"===(u=t[a])&&(u="ready"),b.domLoaded&&"ready"===u&&"comple
te"===e.readyState?n.call(r,qe({type:u})):(h||(s=v[u])&&(c=function(e){var t,n;if(t=e.currentTarget,(n=e.relatedTarget)&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n.parentNode;n||((e=qe(e||f.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,C(e,o))}),p||"focusin"!==u&&"focusout"!==u||(l=!0,s="focusin"===u?"focus":"blur",c=function(e){(e=qe(e||f.event)).type="focus"===e.type?"focusin":"focusout",C(e,o)}),(i=y[o][u])?"ready"===u&&b.domLoaded?n({type:u}):i.push({func:n,scope:r}):(y[o][u]=i=[{func:n,scope:r}],i.fakeName=s,i.capture=l,i.nativeHandler=c,"ready"===u?He(e,c,b):ze(e,s||u,c,l)));return e=i=0,n}},b.unbind=function(e,t,n){var r,o,i,a,u,s;if(!e||3===e.nodeType||8===e.nodeType)return b;if(r=e[g]){if(s=y[r],t){for(i=(t=t.split(" ")).length;i--;)if(o=s[u=t[i]]){if(n)for(a=o
.length;a--;)if(o[a].func===n){var c=o.nativeHandler,l=o.fakeName,f=o.capture;(o=o.slice(0,a).concat(o.slice(a+1))).nativeHandler=c,o.fakeName=l,o.capture=f,s[u]=o}n&&0!==o.length||(delete s[u],Ve(e,o.fakeName||u,o.nativeHandler,o.capture))}}else{for(u in s)o=s[u],Ve(e,o.fakeName||u,o.nativeHandler,o.capture);s={}}for(u in s)return b;delete y[r];try{delete e[g]}catch(d){e[g]=null}}return b},b.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return b;for((n=qe(null,n)).type=t,n.target=e;(r=e[g])&&C(n,r),(e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow)&&!n.isPropagationStopped(););return b},b.clean=function(e){var t,n,r=b.unbind;if(!e||3===e.nodeType||8===e.nodeType)return b;if(e[g]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),t=(n=e.getElementsByTagName("*")).length;t--;)(e=n[t])[g]&&r(e);return b},b.destroy=function(){y={}},b.cancel=function(e){return e&&a
mp;(e.preventDefault(),e.stopImmediatePropagation()),!1}};je.Event=new je,je.Event.bind(window,"ready",function(){});var $e="sizzle"+-new Date,We=window.document,Ke=0,Xe=0,Ye=kt(),Ge=kt(),Je=kt(),Qe=function(e,t){return e===t&&(we=!0),0},Ze=typeof undefined,et={}.hasOwnProperty,tt=[],nt=tt.pop,rt=tt.push,ot=tt.push,it=tt.slice,at=tt.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},ut="[\\x20\\t\\r\\n\\f]",st="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ct="\\["+ut+"*("+st+")(?:"+ut+"*([*^$|!~]?=)"+ut+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+st+"))|)"+ut+"*\\]",lt=":("+st+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ct+")*)|.*)\\)|)",ft=new RegExp("^"+ut+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ut+"+$&q
uot;,"g"),dt=new RegExp("^"+ut+"*,"+ut+"*"),mt=new RegExp("^"+ut+"*([>+~]|"+ut+")"+ut+"*"),gt=new RegExp("="+ut+"*([^\\]'\"]*?)"+ut+"*\\]","g"),pt=new RegExp(lt),ht=new RegExp("^"+st+"$"),vt={ID:new RegExp("^#("+st+")"),CLASS:new RegExp("^\\.("+st+")"),TAG:new RegExp("^("+st+"|[*])"),ATTR:new RegExp("^"+ct),PSEUDO:new RegExp("^"+lt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ut+"*(even|odd|(([+-]|)(\\d*)n|)"+ut+"*(?:([+-]|)"+ut+"*(\\d+)|))"+ut+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+ut+&qu
ot;*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ut+"*((?:-\\d)?\\d*)"+ut+"*\\)|)(?=[^-]|$)","i")},bt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,Ct=/^[^{]+\{\s*\[native \w/,xt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,wt=/[+~]/,Nt=/'|\\/g,Et=new RegExp("\\\\([\\da-f]{1,6}"+ut+"?|("+ut+")|.)","ig"),St=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{ot.apply(tt=it.call(We.childNodes),We.childNodes),tt[We.childNodes.length].nodeType}catch(Kw){ot={apply:tt.length?function(e,t){rt.apply(e,it.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var Tt=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m;if((t?t.ownerDocument||t:We)!==Ee&&Ne(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||Ee).nodeType)&&9!==u)return[];if(Te&&!r){if(o=xt.exec(
e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(a))&&_e(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return ot.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&me.getElementsByClassName)return ot.apply(n,t.getElementsByClassName(a)),n}if(me.qsa&&(!ke||!ke.test(e))){if(f=l=$e,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(c=ve(e),(l=t.getAttribute("id"))?f=l.replace(Nt,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+Lt(c[s]);d=wt.test(e)&&Ot(t.parentNode)||t,m=c.join(",")}if(m)try{return ot.apply(n,d.querySelectorAll(m)),n}catch(g){}finally{l||t.removeAttribute("id")}}}return ye(e.replace(ft,"$1"),t,n,r)};function kt(){var r=[];return function e(t,n){return r.push(t+&quo
t; ")>ge.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function At(e){return e[$e]=!0,e}function _t(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function Rt(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function Dt(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function Bt(a){return At(function(i){return i=+i,At(function(e,t){for(var n,r=a([],e.length,i),o=r.length;o--;)e[n=r[o]]&&(e[n]=!(t[n]=e[n]))})})}function Ot(e){return e&&typeof e.getElementsByTagName!==Ze&&e}for(de in me=Tt.support={},he=Tt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},Ne=Tt.setDocument=fu
nction(e){var t,s=e?e.ownerDocument||e:We,n=s.defaultView;return s!==Ee&&9===s.nodeType&&s.documentElement?(Se=(Ee=s).documentElement,Te=!he(s),n&&n!==function(e){try{return e.top}catch(t){}return null}(n)&&(n.addEventListener?n.addEventListener("unload",function(){Ne()},!1):n.attachEvent&&n.attachEvent("onunload",function(){Ne()})),me.attributes=!0,me.getElementsByTagName=!0,me.getElementsByClassName=Ct.test(s.getElementsByClassName),me.getById=!0,ge.find.ID=function(e,t){if(typeof t.getElementById!==Ze&&Te){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},ge.filter.ID=function(e){var t=e.replace(Et,St);return function(e){return e.getAttribute("id")===t}},ge.find.TAG=me.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==Ze)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&a
mp;r.push(n);return r}return i},ge.find.CLASS=me.getElementsByClassName&&function(e,t){if(Te)return t.getElementsByClassName(e)},Ae=[],ke=[],me.disconnectedMatch=!0,ke=ke.length&&new RegExp(ke.join("|")),Ae=Ae.length&&new RegExp(Ae.join("|")),t=Ct.test(Se.compareDocumentPosition),_e=t||Ct.test(Se.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Qe=t?function(e,t){if(e===t)return we=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!me.sortDetached&&t.compareDocumentPosition(e)===n?e===s||e.ownerDocument===We&&_e(We,e)?-1:t===s||t.ownerDocument===We&&_e(We,t)?1:xe?
at.call(xe,e)-at.call(xe,t):0:4&n?-1:1)}:function(e,t){if(e===t)return we=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],u=[t];if(!o||!i)return e===s?-1:t===s?1:o?-1:i?1:xe?at.call(xe,e)-at.call(xe,t):0;if(o===i)return _t(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?_t(a[r],u[r]):a[r]===We?-1:u[r]===We?1:0},s):Ee},Tt.matches=function(e,t){return Tt(e,null,null,t)},Tt.matchesSelector=function(e,t){if((e.ownerDocument||e)!==Ee&&Ne(e),t=t.replace(gt,"='$1']"),me.matchesSelector&&Te&&(!Ae||!Ae.test(t))&&(!ke||!ke.test(t)))try{var n=(void 0).call(e,t);if(n||me.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(Kw){}return 0<Tt(t,Ee,null,[e]).length},Tt.contains=function(e,t){return(e.ownerDocument||e)!==Ee&&Ne(e),_e(e,t)},Tt.attr=function(e,t){(e.ownerDocument||e)!==Ee&&Ne(e);var n=ge.attrHandle[t.toLowerCase()],r=n&&et.
call(ge.attrHandle,t.toLowerCase())?n(e,t,!Te):undefined;return r!==undefined?r:me.attributes||!Te?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},Tt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},Tt.uniqueSort=function(e){var t,n=[],r=0,o=0;if(we=!me.detectDuplicates,xe=!me.sortStable&&e.slice(0),e.sort(Qe),we){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return xe=null,e},pe=Tt.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=pe(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=pe(t);return n},(ge=Tt.selectors={cacheLength:50,createPseudo:At,match:vt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSib
ling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Et,St),e[3]=(e[3]||e[4]||e[5]||"").replace(Et,St),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||Tt.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&Tt.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return vt.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&pt.test(n)&&(t=ve(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Et,St).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:func
tion(e){var t=Ye[e+" "];return t||(t=new RegExp("(^|"+ut+")"+e+"("+ut+"|$)"))&&Ye(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Ze&&e.getAttribute("class")||"")})},ATTR:function(n,r,o){return function(e){var t=Tt.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===o:"!="===r?t!==o:"^="===r?o&&0===t.indexOf(o):"*="===r?o&&-1<t.indexOf(o):"$="===r?o&&t.slice(-o.length)===o:"~="===r?-1<(" "+t+" ").indexOf(o):"|="===r&&(t===o||t.slice(0,o.length+1)===o+"-"))}},CHILD:function(m,e,t,g,p){var h="nth"!==m.slice(0,3),v="last"!==m.slice(-4),b="of-type"===e;return 1===g&&0===p?function(e){return!!e.parentNode}:function(e,t,n){var r,o,i,a,u,s,c=h!
==v?"nextSibling":"previousSibling",l=e.parentNode,f=b&&e.nodeName.toLowerCase(),d=!n&&!b;if(l){if(h){for(;c;){for(i=e;i=i[c];)if(b?i.nodeName.toLowerCase()===f:1===i.nodeType)return!1;s=c="only"===m&&!s&&"nextSibling"}return!0}if(s=[v?l.firstChild:l.lastChild],v&&d){for(u=(r=(o=l[$e]||(l[$e]={}))[m]||[])[0]===Ke&&r[1],a=r[0]===Ke&&r[2],i=u&&l.childNodes[u];i=++u&&i&&i[c]||(a=u=0)||s.pop();)if(1===i.nodeType&&++a&&i===e){o[m]=[Ke,u,a];break}}else if(d&&(r=(e[$e]||(e[$e]={}))[m])&&r[0]===Ke)a=r[1];else for(;(i=++u&&i&&i[c]||(a=u=0)||s.pop())&&((b?i.nodeName.toLowerCase()!==f:1!==i.nodeType)||!++a||(d&&((i[$e]||(i[$e]={}))[m]=[Ke,a]),i!==e)););return(a-=p)===g||a%g==0&&0<=a/g}}},PSEUDO:function(e,i){var t,a=ge.pseudos[e]||ge.setFilters[e.toLowerCase()]||Tt.error("unsupported pseudo: "
;+e);return a[$e]?a(i):1<a.length?(t=[e,e,"",i],ge.setFilters.hasOwnProperty(e.toLowerCase())?At(function(e,t){for(var n,r=a(e,i),o=r.length;o--;)e[n=at.call(e,r[o])]=!(t[n]=r[o])}):function(e){return a(e,0,t)}):a}},pseudos:{not:At(function(e){var r=[],o=[],u=be(e.replace(ft,"$1"));return u[$e]?At(function(e,t,n,r){for(var o,i=u(e,null,r,[]),a=e.length;a--;)(o=i[a])&&(e[a]=!(t[a]=o))}):function(e,t,n){return r[0]=e,u(r,null,n,o),!o.pop()}}),has:At(function(t){return function(e){return 0<Tt(t,e).length}}),contains:At(function(t){return t=t.replace(Et,St),function(e){return-1<(e.textContent||e.innerText||pe(e)).indexOf(t)}}),lang:At(function(n){return ht.test(n||"")||Tt.error("unsupported lang: "+n),n=n.replace(Et,St).toLowerCase(),function(e){var t;do{if(t=Te?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&
;1===e.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===Se},focus:function(e){return e===Ee.activeElement&&(!Ee.hasFocus||Ee.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!ge.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return bt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},
text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:Bt(function(){return[0]}),last:Bt(function(e,t){return[t-1]}),eq:Bt(function(e,t,n){return[n<0?n+t:n]}),even:Bt(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:Bt(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:Bt(function(e,t,n){for(var r=n<0?n+t:n;0<=--r;)e.push(r);return e}),gt:Bt(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=ge.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})ge.pseudos[de]=Rt(de);for(de in{submit:!0,reset:!0})ge.pseudos[de]=Dt(de);function Pt(){}function Lt(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function It(a,e,t){var u=e.dir,s=t&&"parentNode"===u,c=Xe++;return e.first?function(e,t,n){for(;e=e[u];)if(1===e.nodeType||
s)return a(e,t,n)}:function(e,t,n){var r,o,i=[Ke,c];if(n){for(;e=e[u];)if((1===e.nodeType||s)&&a(e,t,n))return!0}else for(;e=e[u];)if(1===e.nodeType||s){if((r=(o=e[$e]||(e[$e]={}))[u])&&r[0]===Ke&&r[1]===c)return i[2]=r[2];if((o[u]=i)[2]=a(e,t,n))return!0}}}function Mt(o){return 1<o.length?function(e,t,n){for(var r=o.length;r--;)if(!o[r](e,t,n))return!1;return!0}:o[0]}function Ft(e,t,n,r,o){for(var i,a=[],u=0,s=e.length,c=null!=t;u<s;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),c&&t.push(u)));return a}function Ut(m,g,p,h,v,e){return h&&!h[$e]&&(h=Ut(h)),v&&!v[$e]&&(v=Ut(v,e)),At(function(e,t,n,r){var o,i,a,u=[],s=[],c=t.length,l=e||function(e,t,n){for(var r=0,o=t.length;r<o;r++)Tt(e,t[r],n);return n}(g||"*",n.nodeType?[n]:n,[]),f=!m||!e&&g?l:Ft(l,u,m,n,r),d=p?v||(e?m:c||h)?[]:t:f;if(p&&p(f,d,n,r),h)for(o=Ft(d,s),h(o,[],n,r),i=o.length;i--;)(a=o[i])&&(d[s[i]]=!(f[s[i]
]=a));if(e){if(v||m){if(v){for(o=[],i=d.length;i--;)(a=d[i])&&o.push(f[i]=a);v(null,d=[],o,r)}for(i=d.length;i--;)(a=d[i])&&-1<(o=v?at.call(e,a):u[i])&&(e[o]=!(t[o]=a))}}else d=Ft(d===t?d.splice(c,d.length):d),v?v(null,t,d,r):ot.apply(t,d)})}function zt(e){for(var r,t,n,o=e.length,i=ge.relative[e[0].type],a=i||ge.relative[" "],u=i?1:0,s=It(function(e){return e===r},a,!0),c=It(function(e){return-1<at.call(r,e)},a,!0),l=[function(e,t,n){return!i&&(n||t!==Ce)||((r=t).nodeType?s(e,t,n):c(e,t,n))}];u<o;u++)if(t=ge.relative[e[u].type])l=[It(Mt(l),t)];else{if((t=ge.filter[e[u].type].apply(null,e[u].matches))[$e]){for(n=++u;n<o&&!ge.relative[e[n].type];n++);return Ut(1<u&&Mt(l),1<u&&Lt(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(ft,"$1"),t,u<n&&zt(e.slice(u,n)),n<o&&zt(e=e.slice(n)),n<o&&Lt(e))}l.push(t)}return Mt(l
)}Pt.prototype=ge.filters=ge.pseudos,ge.setFilters=new Pt,ve=Tt.tokenize=function(e,t){var n,r,o,i,a,u,s,c=Ge[e+" "];if(c)return t?0:c.slice(0);for(a=e,u=[],s=ge.preFilter;a;){for(i in n&&!(r=dt.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=mt.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(ft," ")}),a=a.slice(n.length)),ge.filter)!(r=vt[i].exec(a))||s[i]&&!(r=s[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?Tt.error(e):Ge(e,u).slice(0)},be=Tt.compile=function(e,t){var n,h,v,b,y,r,o=[],i=[],a=Je[e+" "];if(!a){for(t||(t=ve(e)),n=t.length;n--;)(a=zt(t[n]))[$e]?o.push(a):i.push(a);(a=Je(e,(h=i,b=0<(v=o).length,y=0<h.length,r=function(e,t,n,r,o){var i,a,u,s=0,c="0",l=e&&[],f=[],d=Ce,m=e||y&&ge.find.TAG("*",o),g=Ke+=null==d?1:Math.random()||.1,p=m.length;for(o&&(Ce=t!==Ee&&t);c!==p&
amp;&null!=(i=m[c]);c++){if(y&&i){for(a=0;u=h[a++];)if(u(i,t,n)){r.push(i);break}o&&(Ke=g)}b&&((i=!u&&i)&&s--,e&&l.push(i))}if(s+=c,b&&c!==s){for(a=0;u=v[a++];)u(l,f,t,n);if(e){if(0<s)for(;c--;)l[c]||f[c]||(f[c]=nt.call(r));f=Ft(f)}ot.apply(r,f),o&&!e&&0<f.length&&1<s+v.length&&Tt.uniqueSort(r)}return o&&(Ke=g,Ce=d),l},b?At(r):r))).selector=e}return a},ye=Tt.select=function(e,t,n,r){var o,i,a,u,s,c="function"==typeof e&&e,l=!r&&ve(e=c.selector||e);if(n=n||[],1===l.length){if(2<(i=l[0]=l[0].slice(0)).length&&"ID"===(a=i[0]).type&&me.getById&&9===t.nodeType&&Te&&ge.relative[i[1].type]){if(!(t=(ge.find.ID(a.matches[0].replace(Et,St),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=vt.needsContext.test(e)?0:i.length;o--&&(a=i[o],!ge.relative[u=a.type]);)i
f((s=ge.find[u])&&(r=s(a.matches[0].replace(Et,St),wt.test(i[0].type)&&Ot(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&Lt(i)))return ot.apply(n,r),n;break}}return(c||be(e,l))(r,t,!Te,n,wt.test(e)&&Ot(t.parentNode)||t),n},me.sortStable=$e.split("").sort(Qe).join("")===$e,me.detectDuplicates=!!we,Ne(),me.sortDetached=!0;var Vt=Array.isArray,qt=function(e,t,n){var r,o;if(!e)return 0;if(n=n||e,e.length!==undefined){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return 0}else for(r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))return 0;return 1},Ht=function(e,t,n){var r,o;for(r=0,o=e.length;r<o;r++)if(t.call(n,e[r],r,e))return r;return-1},jt={isArray:Vt,toArray:function(e){var t,n,r=e;if(!Vt(e))for(r=[],t=0,n=e.length;t<n;t++)r[t]=e[t];return r},each:qt,map:function(n,r){var o=[];return qt(n,function(e,t){o.push(r(e,t,n))}),o},filter:function(n,r){var o=[];return qt(n,function(e,t){r&&!r(e,t,
n)||o.push(e)}),o},indexOf:function(e,t){var n,r;if(e)for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},reduce:function(e,t,n,r){var o=0;for(arguments.length<3&&(n=e[0]);o<e.length;o++)n=t.call(r,n,e[o],o);return n},findIndex:Ht,find:function(e,t,n){var r=Ht(e,t,n);return-1!==r?e[r]:undefined},last:function(e){return e[e.length-1]}},$t=/^\s*|\s*$/g,Wt=function(e){return null===e||e===undefined?"":(""+e).replace($t,"")},Kt=function(e,t){return t?!("array"!==t||!jt.isArray(e))||typeof e===t:e!==undefined},Xt=function(e,n,r,o){o=o||this,e&&(r&&(e=e[r]),jt.each(e,function(e,t){if(!1===n.call(o,e,t,r))return!1;Xt(e,n,r,o)}))},Yt={trim:Wt,isArray:jt.isArray,is:Kt,toArray:jt.toArray,makeMap:function(e,t,n){var r;for(t=t||",","string"==typeof(e=e||[])&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n},each:jt.each,map:jt.map,grep:jt.filter,inArray:jt.indexOf,hasOwn:function
(e,t){return Object.prototype.hasOwnProperty.call(e,t)},extend:function(e,t){for(var n,r,o,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var u,s=arguments;for(n=1,r=s.length;n<r;n++)for(o in t=s[n])t.hasOwnProperty(o)&&(u=t[o])!==undefined&&(e[o]=u);return e},create:function(e,t,n){var r,o,i,a,u,s=this,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),i=e[3].match(/(^|\.)(\w+)$/i)[2],!(o=s.createNS(e[3].replace(/\.\w+$/,""),n))[i]){if("static"===e[2])return o[i]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[i]));t[i]||(t[i]=function(){},c=1),o[i]=t[i],s.extend(o[i].prototype,t),e[5]&&(r=s.resolve(e[5]).prototype,a=e[5].match(/\.(\w+)$/i)[1],u=o[i],o[i]=c?function(){return r[a].apply(this,arguments)}:function(){return this.parent=r[a],u.apply(this,arguments)},o[i].prototype[i]=o[i],s.each(r,function(e,t){o[i].prototype[t]=r[t]}),s.each(t,function(e,t){r[t]?o[i].prototype[t]=function(){return this.parent=r[t],e.apply
(this,arguments)}:t!==i&&(o[i].prototype[t]=e)})),s.each(t["static"],function(e,t){o[i][t]=e})}},walk:Xt,createNS:function(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)t[r=e[n]]||(t[r]={}),t=t[r];return t},resolve:function(e,t){var n,r;for(t=t||window,n=0,r=(e=e.split(".")).length;n<r&&(t=t[e[n]]);n++);return t},explode:function(e,t){return!e||Kt(e,"array")?e:jt.map(e.split(t||","),Wt)},_addCacheSuffix:function(e){var t=Re.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Gt=document,Jt=Array.prototype.push,Qt=Array.prototype.slice,Zt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,en=je.Event,tn=Yt.makeMap("children,contents,next,prev"),nn=function(e){return void 0!==e},rn=function(e){return"string"==typeof e},on=function(e,t){var n,r,o;for(o=(t=t||Gt).createElement("div"),n=t.createDocumentFragment(),o
.innerHTML=e;r=o.firstChild;)n.appendChild(r);return n},an=function(e,t,n,r){var o;if(rn(t))t=on(t,Cn(e[0]));else if(t.length&&!t.nodeType){if(t=pn.makeArray(t),r)for(o=t.length-1;0<=o;o--)an(e,t[o],n,r);else for(o=0;o<t.length;o++)an(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},un=function(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")},sn=function(e,t,n){var r,o;return t=pn(t)[0],e.each(function(){var e=this;n&&r===e.parentNode||(r=e.parentNode,o=t.cloneNode(!1),e.parentNode.insertBefore(o,e)),o.appendChild(e)}),e},cn=Yt.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),ln=Yt.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),fn={"for":"htmlFor","class":"className",readonly:"read
Only"},dn={"float":"cssFloat"},mn={},gn={},pn=function(e,t){return new pn.fn.init(e,t)},hn=/^\s*|\s*$/g,vn=function(e){return null===e||e===undefined?"":(""+e).replace(hn,"")},bn=function(e,t){var n,r,o,i;if(e)if((n=e.length)===undefined){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e},yn=function(e,n){var r=[];return bn(e,function(e,t){n(t,e)&&r.push(t)}),r},Cn=function(e){return e?9===e.nodeType?e:e.ownerDocument:Gt};pn.fn=pn.prototype={constructor:pn,selector:"",context:null,length:0,init:function(e,t){var n,r,o=this;if(!e)return o;if(e.nodeType)return o.context=o[0]=e,o.length=1,o;if(t&&t.nodeType)o.context=t;else{if(t)return pn(e).attr(t);o.context=t=document}if(rn(e)){if(!(n="<"===(o.selector=e).charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,
null]:Zt.exec(e)))return pn(t).find(e);if(n[1])for(r=on(e,Cn(t)).firstChild;r;)Jt.call(o,r),r=r.nextSibling;else{if(!(r=Cn(t).getElementById(n[2])))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r}}else this.add(e,!1);return o},toArray:function(){return Yt.toArray(this)},add:function(e,t){var n,r,o=this;if(rn(e))return o.add(pn(e));if(!1!==t)for(n=pn.unique(o.toArray().concat(pn.makeArray(e))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else Jt.apply(o,pn.makeArray(e));return o},attr:function(t,n){var e,r=this;if("object"==typeof t)bn(t,function(e,t){r.attr(e,t)});else{if(!nn(n)){if(r[0]&&1===r[0].nodeType){if((e=mn[t])&&e.get)return e.get(r[0],t);if(ln[t])return r.prop(t)?t:undefined;null===(n=r[0].getAttribute(t,2))&&(n=undefined)}return n}this.each(function(){var e;if(1===this.nodeType){if((e=mn[t])&&e.set)return void e.set(this,n);null===n?this.removeAttribute(t,2):this.setAttribute(t,n,2)}})}return r},removeAttr:function
(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=fn[e]||e))bn(e,function(e,t){n.prop(e,t)});else{if(!nn(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1===this.nodeType&&(this[e]=t)})}return n},css:function(n,r){var e,o,i=this,t=function(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})},a=function(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})};if("object"==typeof n)bn(n,function(e,t){i.css(e,t)});else if(nn(r))n=t(n),"number"!=typeof r||cn[n]||(r=r.toString()+"px"),i.each(function(){var e=this.style;if((o=gn[n])&&o.set)o.set(this,r);else{try{this.style[dn[n]||n]=r}catch(t){}null!==r&&""!==r||(e.removeProperty?e.removeProperty(a(n)):e.removeAttribute(n))}});else{if(e=i[0],(o=gn[n])&&o.get)return o.get(e);if(!e.ownerDocument.defaultView)return e.currentStyle?e.currentStyle[t(n)]:"";tr
y{return e.ownerDocument.defaultView.getComputedStyle(e,null).getPropertyValue(a(n))}catch(u){return undefined}}return i},remove:function(){for(var e,t=this.length;t--;)e=this[t],en.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(e){var t,n=this;if(nn(e)){t=n.length;try{for(;t--;)n[t].innerHTML=e}catch(r){pn(n[t]).empty().append(e)}return n}return n[0]?n[0].innerHTML:""},text:function(e){var t,n=this;if(nn(e)){for(t=n.length;t--;)"innerText"in n[t]?n[t].innerText=e:n[0].textContent=e;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return an(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return an(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType
)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){return this[0]&&this[0].parentNode?an(this,arguments,function(e){this.parentNode.insertBefore(e,this)}):this},after:function(){return this[0]&&this[0].parentNode?an(this,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):this},appendTo:function(e){return pn(e).append(this),this},prependTo:function(e){return pn(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return sn(this,e)},wrapAll:function(e){return sn(this,e,!0)},wrapInner:function(e){return this.each(function(){pn(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){pn(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),pn(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(o,i){var e=t
his;return"string"!=typeof o||(-1!==o.indexOf(" ")?bn(o.split(" "),function(){e.toggleClass(this,i)}):e.each(function(e,t){var n,r;(r=un(t,o))!==i&&(n=t.className,r?t.className=vn((" "+n+" ").replace(" "+o+" "," ")):t.className+=n?" "+o:o)})),e},hasClass:function(e){return un(this[0],e)},each:function(e){return bn(this,e)},on:function(e,t){return this.each(function(){en.bind(this,e,t)})},off:function(e,t){return this.each(function(){en.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?en.fire(this,e.type,e):en.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new pn(Qt.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return thi
s.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;t<n;t++)pn.find(e,this[t],r);return pn(r)},filter:function(n){return pn("function"==typeof n?yn(this.toArray(),function(e,t){return n(t,e)}):pn.filter(n,this.toArray()))},closest:function(n){var r=[];return n instanceof pn&&(n=n[0]),this.each(function(e,t){for(;t;){if("string"==typeof n&&pn(t).is(n)){r.push(t);break}if(t===n){r.push(t);break}t=t.parentNode}}),pn(r)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):((t=this[0])&&(r=(n=t.ownerDocument).documentElement,t.getBoundingClientRect&&(i=(o=t.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Jt,sort:[].sort,splice:[].splice},Yt.extend(pn,{extend:Yt.extend,makeArray:function(e){return(t=e)&&t===t.window||e.nodeType?[e]:Yt.toArray(e);var t},inArray:function(e,t){var n;if(t.indexOf)return t.inde
xOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1},isArray:Yt.isArray,each:bn,trim:vn,grep:yn,find:Tt,expr:Tt.selectors,unique:Tt.uniqueSort,text:Tt.getText,contains:Tt.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!==t[r].nodeType&&t.splice(r,1);return t=1===t.length?pn.find.matchesSelector(t[0],e)?[t[0]]:[]:pn.find.matches(e,t)}});var xn=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof pn&&(n=n[0]);o&&9!==o.nodeType;){if(n!==undefined){if(o===n)break;if("string"==typeof n&&pn(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r},wn=function(e,t,n,r){var o=[];for(r instanceof pn&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(r!==undefined){if(e===r)break;if("string"==typeof r&&pn(e).is(r))break}o.push(e)}return o},Nn=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};bn({parent
:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return xn(e,"parentNode")},next:function(e){return Nn(e,"nextSibling",1)},prev:function(e){return Nn(e,"previousSibling",1)},children:function(e){return wn(e.firstChild,"nextSibling",1)},contents:function(e){return Yt.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,r){pn.fn[e]=function(t){var n=[];return this.each(function(){var e=r.call(n,this,t,n);e&&(pn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(tn[e]||(n=pn.unique(n)),0===e.indexOf("parents")&&(n=n.reverse())),n=pn(n),t?n.filter(t):n}}),bn({parentsUntil:function(e,t){return xn(e,"parentNode",t)},nextUntil:function(e,t){return wn(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return wn(e,"previousSibling",1,t).slice(1)}},function(r,o){pn.fn[r]=fu
nction(t,e){var n=[];return this.each(function(){var e=o.call(n,this,t,n);e&&(pn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(n=pn.unique(n),0!==r.indexOf("parents")&&"prevUntil"!==r||(n=n.reverse())),n=pn(n),e?n.filter(e):n}}),pn.fn.is=function(e){return!!e&&0<this.filter(e).length},pn.fn.init.prototype=pn.fn,pn.overrideDefaults=function(n){var r,o=function(e,t){return r=r||n(),0===arguments.length&&(e=r.element),t||(t=r.context),new o.fn.init(e,t)};return pn.extend(o,this),o};var En=function(n,r,e){bn(e,function(e,t){n[e]=n[e]||{},n[e][r]=t})};Re.ie&&Re.ie<8&&(En(mn,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?undefined:t},size:function(e){var t=e.size;return 20===t?undefined:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?undefined:t}}),En(mn,"set",{"class":function(
e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),Re.ie&&Re.ie<9&&(dn["float"]="styleFloat",En(gn,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),pn.attrHooks=mn,pn.cssHooks=gn;var Sn=function(n){var r,o=!1;return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o||(o=!0,r=n.apply(null,e)),r}},Tn=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return An(r(1),r(2))},kn=function(){return An(0,0)},An=function(e,t){return{major:e,minor:t}},_n={nu:An,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?kn():Tn(e,n)},unknown:kn},Rn="Firefox",Dn=function(e,t){return function(){retu
rn t===e}},Bn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:Dn("Edge",t),isChrome:Dn("Chrome",t),isIE:Dn("IE",t),isOpera:Dn("Opera",t),isFirefox:Dn(Rn,t),isSafari:Dn("Safari",t)}},On={unknown:function(){return Bn({current:undefined,version:_n.unknown()})},nu:Bn,edge:H("Edge"),chrome:H("Chrome"),ie:H("IE"),opera:H("Opera"),firefox:H(Rn),safari:H("Safari")},Pn="Windows",Ln="Android",In="Solaris",Mn="FreeBSD",Fn=function(e,t){return function(){return t===e}},Un=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Fn(Pn,t),isiOS:Fn("iOS",t),isAndroid:Fn(Ln,t),isOSX:Fn("OSX",t),isLinux:Fn("Linux",t),isSolaris:Fn(In,t),isFreeBSD:Fn(Mn,t)}},zn={unknown:function(){return Un({current:undefined,version:_n.unknown()})},nu:Un,windows:H(Pn),ios:H("iOS"),android:H(Ln),linux:H(
"Linux"),osx:H("OSX"),solaris:H(In),freebsd:H(Mn)},Vn=function(e,t){var n=String(t).toLowerCase();return V(e,function(e){return e.search(n)})},qn=function(e,n){return Vn(e,n).map(function(e){var t=_n.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Hn=function(e,n){return Vn(e,n).map(function(e){var t=_n.detect(e.versionRegexes,n);return{current:e.name,version:t}})},jn=function(e,t){return-1!==e.indexOf(t)},$n=function(e){return e.replace(/^\s+|\s+$/g,"")},Wn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Kn=function(t){return function(e){return jn(e,t)}},Xn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return jn(e,"edge/")&&jn(e,"chrome")&&jn(e,"safari")&&jn(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Wn],search:function(e){return jn(e,"chrome")&&!jn(e,"chromeframe&q
uot;)}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return jn(e,"msie")||jn(e,"trident")}},{name:"Opera",versionRegexes:[Wn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Kn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Kn("firefox")},{name:"Safari",versionRegexes:[Wn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(jn(e,"safari")||jn(e,"mobile/"))&&jn(e,"applewebkit")}}],Yn=[{name:"Windows",search:Kn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return jn(e,"iphone")||jn(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Kn("android"
),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Kn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Kn("linux"),versionRegexes:[]},{name:"Solaris",search:Kn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Kn("freebsd"),versionRegexes:[]}],Gn={browsers:H(Xn),oses:H(Yn)},Jn=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=Gn.browsers(),m=Gn.oses(),g=qn(d,e).fold(On.unknown,On.nu),p=Hn(m,e).fold(zn.unknown,zn.nu);return{browser:g,os:p,deviceType:(n=g,r=e,o=(t=p).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,a=t.isAndroid()&&3===t.version.major,u=t.isAndroid()&&4===t.version.major,s=o||a||u&&!0===/mobile/i.test(r),c=t.isiOS()||t.isAndroid(),l=c&&!s,f=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:H(o),isiPhone:H(i),isTablet:H(s),isPhone:H(l),isTouch:H(c),isAndroid:t.isAndroid,isiOS:t.i
siOS,isWebView:H(f)})}},Qn={detect:Sn(function(){var e=navigator.userAgent;return Jn(e)})},Zn=function(e){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:H(e)}},er={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),"HTML must have a single root node";return Zn(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return Zn(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return Zn(n)},fromDom:Zn,fromPoint:function(e,t,n){var r=e.dom();return A.from(r.elementFromPoint(t,n)).map(Zn)}},tr={ATTRIBUTE:Node.ATTRIBUTE_NODE,CDATA_SECTION:Node.CDATA_SECTION_NODE,COMMENT:Node.COMMENT_NODE,DOCUMENT:Node.DOCUMENT_NODE,DOCUMENT_TYPE:Node.DOCUMENT_TYPE_NODE,DOCUMENT_FRAGMENT:Node.DOCUMENT_FRAGMENT_NODE,ELEMENT:Node.ELEMENT_NODE,TEXT:Node.TEX
T_NODE,PROCESSING_INSTRUCTION:Node.PROCESSING_INSTRUCTION_NODE,ENTITY_REFERENCE:Node.ENTITY_REFERENCE_NODE,ENTITY:Node.ENTITY_NODE,NOTATION:Node.NOTATION_NODE},nr=function(e){return e.dom().nodeName.toLowerCase()},rr=function(e){return e.dom().nodeType},or=function(t){return function(e){return rr(e)===t}},ir=or(tr.ELEMENT),ar=or(tr.TEXT),ur=or(tr.DOCUMENT),sr={name:nr,type:rr,value:function(e){return e.dom().nodeValue},isElement:ir,isText:ar,isDocument:ur,isComment:function(e){return rr(e)===tr.COMMENT||"#comment"===nr(e)}},cr=Object.keys,lr=function(e,t){for(var n=cr(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}},fr=function(e,r){return dr(e,function(e,t,n){return{k:t,v:r(e,t,n)}})},dr=function(r,o){var i={};return lr(r,function(e,t){var n=o(e,t,r);i[n.k]=n.v}),i},mr=function(e,t,n){if(!(k(n)||B(n)||P(n)))throw console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simpl
e");e.setAttribute(t,n+"")},gr=function(e,t,n){mr(e.dom(),t,n)},pr=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},hr=function(e,t){var n=e.dom();return!(!n||!n.hasAttribute)&&n.hasAttribute(t)},vr={clone:function(e){return z(e.dom().attributes,function(e,t){return e[t.name]=t.value,e},{})},set:gr,setAll:function(e,t){var n=e.dom();lr(t,function(e,t){mr(n,t,e)})},get:pr,has:hr,remove:function(e,t){e.dom().removeAttribute(t)},hasNone:function(e){var t=e.dom().attributes;return t===undefined||null===t||0===t.length},transfer:function(o,i,e){sr.isElement(o)&&sr.isElement(i)&&F(e,function(e){var t,n,r;n=i,hr(t=o,r=e)&&!hr(n,r)&&gr(n,r,pr(t,r))})}},br=Sn(function(){return yr(er.fromDom(document))}),yr=function(e){var t=e.dom().body;if(null===t||t===undefined)throw"Body is not available yet";return er.fromDom(t)},Cr={body:br,getBody:yr,inBody:function(e){var t=sr.isText(e)?e.dom().parentNode:e.dom();
return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}},xr=function(e){return e.style!==undefined},wr=function(e,t,n){if(!k(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS value must be a string: "+n);xr(e)&&e.style.setProperty(t,n)},Nr=function(e,t){return xr(e)?e.style.getPropertyValue(t):""},Er=function(e,t){var n=e.dom(),r=Nr(n,t);return A.from(r).filter(function(e){return 0<e.length})},Sr=function(e,t){var n=e.dom();lr(t,function(e,t){wr(n,t,e)})},Tr=function(e,t){var n=e.dom(),r=window.getComputedStyle(n).getPropertyValue(t),o=""!==r||Cr.inBody(e)?r:Nr(n,t);return null===o?undefined:o},kr=Er,Ar=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Exp
ected "['+t.length+']", got '+n.length+" arguments");var r={};return F(t,function(e,t){r[e]=H(n[t])}),r}},_r=function(e,t){for(var n=[],r=function(e){return n.push(e),t(e)},o=t(e);(o=o.bind(r)).isSome(););return n},Rr=function(){return ie.getOrDie("Node")},Dr=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},Br=function(e,t){return Dr(e,t,Rr().DOCUMENT_POSITION_CONTAINED_BY)},Or=tr.ELEMENT,Pr=tr.DOCUMENT,Lr=function(e){return e.nodeType!==Or&&e.nodeType!==Pr||0===e.childElementCount},Ir={all:function(e,t){var n=t===undefined?document:t.dom();return Lr(n)?[]:$(n.querySelectorAll(e),er.fromDom)},is:function(e,t){var n=e.dom();if(n.nodeType!==Or)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks
native selectors")},one:function(e,t){var n=t===undefined?document:t.dom();return Lr(n)?A.none():A.from(n.querySelector(e)).map(er.fromDom)}},Mr=function(e,t){return e.dom()===t.dom()},Fr=Qn.detect().browser.isIE()?function(e,t){return Br(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},Ur={eq:Mr,isEqualNode:function(e,t){return e.dom().isEqualNode(t.dom())},member:function(e,t){return M(t,b(Mr,e))},contains:Fr,is:Ir.is},zr=function(e){var t=e.dom();return A.from(t.parentNode).map(er.fromDom)},Vr=function(e){var t=e.dom();return A.from(t.previousSibling).map(er.fromDom)},qr=function(e){var t=e.dom();return A.from(t.nextSibling).map(er.fromDom)},Hr=function(e){var t=e.dom();return $(t.childNodes,er.fromDom)},jr=function(e,t){var n=e.dom().childNodes;return A.from(n[t]).map(er.fromDom)},$r=Ar("element","offset"),Wr={owner:function(e){return er.fromDom(e.dom().ownerDocument)},defaultView:function(e){var t=e.dom().own
erDocument.defaultView;return er.fromDom(t)},documentElement:function(e){return er.fromDom(e.dom().ownerDocument.documentElement)},parent:zr,findIndex:function(n){return zr(n).bind(function(e){var t=Hr(e);return K(t,function(e){return Ur.eq(n,e)})})},parents:function(e,t){for(var n=O(t)?t:H(!1),r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=er.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o},siblings:function(t){return zr(t).map(Hr).map(function(e){return U(e,function(e){return!Ur.eq(t,e)})}).getOr([])},prevSibling:Vr,offsetParent:function(e){var t=e.dom();return A.from(t.offsetParent).map(er.fromDom)},prevSiblings:function(e){return t=_r(e,Vr),(n=Q.call(t,0)).reverse(),n;var t,n},nextSibling:qr,nextSiblings:function(e){return _r(e,qr)},children:Hr,child:jr,firstChild:function(e){return jr(e,0)},lastChild:function(e){return jr(e,e.dom().childNodes.length-1)},childNodesCount:function(e){return e.dom().childNodes.length},hasChildNodes:
function(e){return e.dom().hasChildNodes()},leaf:function(e,t){var n=Hr(e);return 0<n.length&&t<n.length?$r(n[t],0):$r(e,t)}},Kr=Qn.detect().browser,Xr=function(e){return V(e,sr.isElement)},Yr={getPos:function(e,t,n){var r,o,i,a=0,u=0,s=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===Tr(er.fromDom(e),"position"))return{x:a=(o=t.getBoundingClientRect()).left+(s.documentElement.scrollLeft||e.scrollLeft)-s.documentElement.clientLeft,y:u=o.top+(s.documentElement.scrollTop||e.scrollTop)-s.documentElement.clientTop};for(r=t;r&&r!==n&&r.nodeType;)a+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!==n&&r.nodeType;)a-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;u+=(i=er.fromDom(t),Kr.isFirefox()&&"table"===sr.name(i)?Xr(Wr.children(i)).filter(function(e){return"caption"===sr.name(e)}).bind(function(o){return Xr(Wr.nextSibling
s(o)).map(function(e){var t=e.dom().offsetTop,n=o.dom().offsetTop,r=o.dom().offsetHeight;return t<=n?-r:0})}).getOr(0):0)}return{x:a,y:u}}},Gr=function(e){var n=A.none(),t=[],r=function(e){o()?a(e):t.push(e)},o=function(){return n.isSome()},i=function(e){F(e,a)},a=function(t){n.each(function(e){setTimeout(function(){t(e)},0)})};return e(function(e){n=A.some(e),i(t),t=[]}),{get:r,map:function(n){return Gr(function(t){r(function(e){t(n(e))})})},isReady:o}},Jr={nu:Gr,pure:function(t){return Gr(function(e){e(t)})}},Qr=function(t){var e=function(e){var r;t((r=e,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this;setTimeout(function(){r.apply(n,e)},0)}))};return{map:function(r){return Qr(function(n){e(function(e){var t=r(e);n(t)})})},bind:function(n){return Qr(function(t){e(function(e){n(e).get(t)})})},anonBind:function(n){return Qr(function(t){e(function(e){n.get(t)})})},toLazy:function(){return Jr.nu(e)},get:e}},Zr={nu:Qr,pure:function(t){return Qr(func
tion(e){e(t)})}},eo=function(a,e){return e(function(r){var o=[],i=0;0===a.length?r([]):F(a,function(e,t){var n;e.get((n=t,function(e){o[n]=e,++i>=a.length&&r(o)}))})})},to=function(e){return eo(e,Zr.nu)},no=function(n){return{is:function(e){return n===e},isValue:C,isError:y,getOr:H(n),getOrThunk:H(n),getOrDie:H(n),or:function(e){return no(n)},orThunk:function(e){return no(n)},fold:function(e,t){return t(n)},map:function(e){return no(e(n))},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return A.some(n)}}},ro=function(n){return{is:y,isValue:y,isError:C,getOr:j,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return ro(n)},each:v,bind:function(e){return ro(n)},exists:y,forall:C,toOption:A.none}},oo={value:no,error:ro};
function io(e,u){var t=e,n=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==u){if(o=e[n])return o;for(i=e.parentNode;i&&i!==u;i=i.parentNode)if(o=i[n])return o}}};this.current=function(){return t},this.next=function(e){return t=n(t,"firstChild","nextSibling",e)},this.prev=function(e){return t=n(t,"lastChild","previousSibling",e)},this.prev2=function(e){return t=function(e,t,n,r){var o,i,a;if(e){if(o=e[n],u&&o===u)return;if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}if((i=e.parentNode)&&i!==u)return i}}(t,"lastChild","previousSibling",e)}}var ao,uo,so,co=function(t){var n;return function(e){return(n=n||function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r)}return n}(t,H(!0))).hasOwnProperty(sr.name(e))}},lo=co(["h1","h2","h3","h4","h5","h6"]),fo=co(["article","asi
de","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),mo=function(e){return sr.isElement(e)&&!fo(e)},go=function(e){return sr.isElement(e)&&"br"===sr.name(e)},po=co(["h1","h2",&q
uot;h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),ho=co(["ul","ol","dl"]),vo=co(["li","dd","dt"]),bo=co(["area","base","basefont","br","col","frame","hr","img","input","isindex","link","meta","param","embed","source","wbr","track"]),yo=co(["thead","tbody","tfoot"]),Co=co(["td","th"]),xo=co(["pre","script","textarea","style"]),wo=function(t){return funct
ion(e){return!!e&&e.nodeType===t}},No=wo(1),Eo=function(e){var r=e.toLowerCase().split(" ");return function(e){var t,n;if(e&&e.nodeType)for(n=e.nodeName.toLowerCase(),t=0;t<r.length;t++)if(n===r[t])return!0;return!1}},So=function(t){return function(e){if(No(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},To=wo(3),ko=wo(8),Ao=wo(9),_o=Eo("br"),Ro=So("true"),Do=So("false"),Bo={isText:To,isElement:No,isComment:ko,isDocument:Ao,isBr:_o,isContentEditableTrue:Ro,isContentEditableFalse:Do,matchNodeNames:Eo,hasPropValue:function(t,n){return function(e){return No(e)&&e[t]===n}},hasAttribute:function(t,e){return function(e){return No(e)&&e.hasAttribute(t)}},hasAttributeValue:function(t,n){return function(e){return No(e)&&e.getAttribute(t)===n}},matchStyleValues:function(r,e){var o=e.toLowerCase().split(" ");return function(e){var t;
if(No(e))for(t=0;t<o.length;t++){var n=e.ownerDocument.defaultView.getComputedStyle(e,null);if((n?n.getPropertyValue(r):null)===o[t])return!0}return!1}},isBogus:function(e){return No(e)&&e.hasAttribute("data-mce-bogus")},isBogusAll:function(e){return No(e)&&"all"===e.getAttribute("data-mce-bogus")},isTable:function(e){return No(e)&&"TABLE"===e.tagName}},Oo=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Po=function(e,t){var n,r=t.childNodes;if(!Bo.isElement(t)||!Oo(t)){for(n=r.length-1;0<=n;n--)Po(e,r[n]);if(!1===Bo.isDocument(t)){if(Bo.isText(t)&&0<t.nodeValue.length){var o=Yt.trim(t.nodeValue).length;if(e.isBlock(t.parentNode)||0<o)return;if(0===o&&(a=(i=t).previousSibling&&"SPAN"===i.previousSibling.nodeName,u=i.nextSibling&&"SPAN"===i.nextSibling.nodeName,a&&u)
)return}else if(Bo.isElement(t)&&(1===(r=t.childNodes).length&&Oo(r[0])&&t.parentNode.insertBefore(r[0],t),r.length||bo(er.fromDom(t))))return;e.remove(t)}var i,a,u;return t}},Lo={trimNode:Po},Io=Yt.makeMap,Mo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Fo=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Uo=/[<>&\"\']/g,zo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Vo={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"
;\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};uo={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},so={"<":"<",">":">","&":"&",""":'"',"'":"'"};var qo=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode(parseInt(e[n],t)),uo[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}};ao=qo("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,
frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsi
lon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro&quo
t;,32);var Ho=function(e,t){return e.replace(t?Mo:Fo,function(e){return uo[e]||e})},jo=function(e,t){return e.replace(t?Mo:Fo,function(e){return 1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":uo[e]||"&#"+e.charCodeAt(0)+";"})},$o=function(e,t,n){return n=n||ao,e.replace(t?Mo:Fo,function(e){return uo[e]||n[e]||e})},Wo={encodeRaw:Ho,encodeAllRaw:function(e){return(""+e).replace(Uo,function(e){return uo[e]||e})},encodeNumeric:jo,encodeNamed:$o,getEncodeFunc:function(e,t){var n=qo(t)||ao,r=Io(e.replace(/\+/g,","));return r.named&&r.numeric?function(e,t){return e.replace(t?Mo:Fo,function(e){return uo[e]!==undefined?uo[e]:n[e]!==undefined?n[e]:1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"})}:r.named?t?function(e,t){return $o(e,t,n)}:$o:r.numeric?jo:Ho},decode:function(
e){return e.replace(zo,function(e,t){return t?65535<(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):Vo[t]||String.fromCharCode(t):so[e]||ao[e]||(n=e,(r=er.fromTag("div").dom()).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},Ko={},Xo={},Yo=Yt.makeMap,Go=Yt.each,Jo=Yt.extend,Qo=Yt.explode,Zo=Yt.inArray,ei=function(e,t){return(e=Yt.trim(e))?e.split(t||" "):[]},ti=function(e){var u,t,n,r,o,i,s={},a=function(e,t,n){var r,o,i,a=function(e,t){var n,r,o={};for(n=0,r=e.length;n<r;n++)o[e[n]]=t||{};return o};for(t=t||"","string"==typeof(n=n||[])&&(n=ei(n)),r=(e=ei(e)).length;r--;)i={attributes:a(o=ei([u,t].join(" "))),attributesOrder:o,children:a(n,Xo)},s[e[r]]=i},c=function(e,t){var n,r,o,i;for(n=(e=ei(e)).length,t=ei(t);n--;)for(r=s[e[n]],o=0,i=t.length;o<i;o++)r.attributes[t[o]]={},r.attributesOrder.push(t[o]
)};return Ko[e]?Ko[e]:(u="id accesskey class dir lang style tabindex title role",t="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",n="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e&&(u+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",t+=" article aside details dialog figure header footer hgroup section nav",n+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==e&&(u+=" xml:lang",n=[n,i="acronym applet basefont big font strike tt"].join(" "),Go(ei(i),function(e){a(e,"",n)}),t=[t,o="center dir isindex noframes"].join(" "),r=[t,n].join(" "),Go(ei
(o),function(e){a(e,"",r)})),r=r||[t,n].join(" "),a("html","manifest","head body"),a("head","","base command link meta noscript script style title"),a("title hr noscript br"),a("base","href target"),a("link","href rel media hreflang type sizes hreflang"),a("meta","name http-equiv content charset"),a("style","media type scoped"),a("script","src async defer type charset"),a("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",r),a("address dt dd div caption","",r),a("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",n),a("blockquote",&
quot;cite",r),a("ol","reversed start type","li"),a("ul","","li"),a("li","value",r),a("dl","","dt dd"),a("a","href target rel media hreflang type",n),a("q","cite",n),a("ins del","cite datetime",r),a("img","src sizes srcset alt usemap ismap width height"),a("iframe","src name width height",r),a("embed","src type width height"),a("object","data type typemustmatch name usemap form width height",[r,"param"].join(" ")),a("param","name value"),a("map","name",[r,"area"].join(" ")),a("area","alt coords shape href target rel media hreflang type"),a("table","border","caption colgroup thead tfoot tbody tr"+("htm
l4"===e?" col":"")),a("colgroup","span","col"),a("col","span"),a("tbody thead tfoot","","tr"),a("tr","","td th"),a("td","colspan rowspan headers",r),a("th","colspan rowspan headers scope abbr",r),a("form","accept-charset action autocomplete enctype method name novalidate target",r),a("fieldset","disabled form name",[r,"legend"].join(" ")),a("label","form for",n),a("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),a("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","
html4"===e?r:n),a("select","disabled form multiple name required size","option optgroup"),a("optgroup","disabled label","option"),a("option","disabled label selected value"),a("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),a("menu","type label",[r,"li"].join(" ")),a("noscript","",r),"html4"!==e&&(a("wbr"),a("ruby","",[n,"rt rp"].join(" ")),a("figcaption","",r),a("mark rt rp summary bdi","",n),a("canvas","width height",r),a("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[r,"track source"].join(" ")),a("audio","src crossorigin preload autoplay mediagro
up loop muted controls buffered volume",[r,"track source"].join(" ")),a("picture","","img source"),a("source","src srcset type media sizes"),a("track","kind src srclang label default"),a("datalist","",[n,"option"].join(" ")),a("article section nav aside header footer","",r),a("hgroup","","h1 h2 h3 h4 h5 h6"),a("figure","",[r,"figcaption"].join(" ")),a("time","datetime",n),a("dialog","open",r),a("command","type label icon disabled checked radiogroup command"),a("output","for form name",n),a("progress","value max",n),a("meter","value min max low high optimum",n),a("details","open",[r,"summary"].join(" ")),a
("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(c("script","language xml:space"),c("style","xml:space"),c("object","declare classid code codebase codetype archive standby align border hspace vspace"),c("embed","align name hspace vspace"),c("param","valuetype type"),c("a","charset name rev shape coords"),c("br","clear"),c("applet","codebase archive code object alt name width height align hspace vspace"),c("img","name longdesc align border hspace vspace"),c("iframe","longdesc frameborder marginwidth marginheight scrolling align"),c("font basefont","size color face"),c("input","usemap align"),c("select","onchange"),c("textarea"),c("h1 h2 h3 h4 h
5 h6 div p legend caption","align"),c("ul","type compact"),c("li","type"),c("ol dl menu dir","compact"),c("pre","width xml:space"),c("hr","align noshade size width"),c("isindex","prompt"),c("table","summary width frame rules cellspacing cellpadding align bgcolor"),c("col","width align char charoff valign"),c("colgroup","width align char charoff valign"),c("thead","align char charoff valign"),c("tr","align char charoff valign bgcolor"),c("th","axis align char charoff valign nowrap bgcolor width height"),c("form","accept"),c("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),c("tfoot","align char charoff valign"),c("tbody","align char
charoff valign"),c("area","nohref"),c("body","background bgcolor text link vlink alink")),"html4"!==e&&(c("input button select textarea","autofocus"),c("input textarea","placeholder"),c("a","download"),c("link script img","crossorigin"),c("iframe","sandbox seamless allowfullscreen")),Go(ei("a form meter progress dfn"),function(e){s[e]&&delete s[e].children[e]}),delete s.caption.children.table,delete s.script,Ko[e]=s)},ni=function(e,n){var r;return e&&(r={},"string"==typeof e&&(e={"*":e}),Go(e,function(e,t){r[t]=r[t.toUpperCase()]="map"===n?Yo(e,/[, ]/):Qo(e,/[, ]/)})),r};function ri(i){var e,t,n,r,o,a,u,s,c,l,f,d,m,N={},g={},E=[],p={},h={},v=function(e,t,n){var r=i[e];return r?r=Yo(r,/[, ]/,Yo(r.toUpperCase(),/[, ]/)):(r=Ko[e])||(r=Yo(t," ",Yo(t.toU
pperCase()," ")),r=Jo(r,n),Ko[e]=r),r};n=ti((i=i||{}).schema),!1===i.verify_html&&(i.valid_elements="*[*]"),e=ni(i.valid_styles),t=ni(i.invalid_styles,"map"),s=ni(i.valid_classes,"map"),r=v("whitespace_elements","pre script noscript style textarea video audio iframe object code"),o=v("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),a=v("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),u=v("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),l=v("non_empty_elements","td th iframe video audio object script pre code",a),f=v("move_caret_before_on_enter_elements","table",l),d=v("text_block_elements","h1 h2 h3 h4 h5 h6 p
div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),c=v("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",d),m=v("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),Go((i.special||"script noscript noframes noembed title style textarea xmp").split(" "),function(e){h[e]=new RegExp("</"+e+"[^>]*>","gi")});var S=function(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")},b=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,x=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,w=/[*?+]/;if(e)for(e=ei(e,","),N["@"]&&(h=N["@"].attri
butes,v=N["@"].attributesOrder),t=0,n=e.length;t<n;t++)if(i=C.exec(e[t])){if(g=i[1],c=i[2],p=i[3],s=i[5],a={attributes:d={},attributesOrder:m=[]},"#"===g&&(a.paddEmpty=!0),"-"===g&&(a.removeEmpty=!0),"!"===i[4]&&(a.removeEmptyAttrs=!0),h){for(b in h)d[b]=h[b];m.push.apply(m,v)}if(s)for(r=0,o=(s=ei(s,"|")).length;r<o;r++)if(i=x.exec(s[r])){if(u={},f=i[1],l=i[2].replace(/[\\:]:/g,":"),g=i[3],y=i[4],"!"===f&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(l),u.required=!0),"-"===f){delete d[l],m.splice(Zo(m,l),1);continue}g&&("="===g&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:l,value:y}),u.defaultValue=y),":"===g&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:l,value:y}),u.forcedValue=y),"<"===g&&(u.validValues=Yo(y,"
;?"))),w.test(l)?(a.attributePatterns=a.attributePatterns||[],u.pattern=S(l),a.attributePatterns.push(u)):(d[l]||m.push(l),d[l]=u)}h||"@"!==c||(h=d,v=m),p&&(a.outputName=c,N[p]=a),w.test(c)?(a.pattern=S(c),E.push(a)):N[c]=a}},y=function(e){N={},E=[],b(e),Go(n,function(e,t){g[t]=e.children})},C=function(e){var a=/^(~)?(.+)$/;e&&(Ko.text_block_elements=Ko.block_elements=null,Go(ei(e,","),function(e){var t=a.exec(e),n="~"===t[1],r=n?"span":"div",o=t[2];if(g[o]=g[r],p[o]=r,n||(c[o.toUpperCase()]={},c[o]={}),!N[o]){var i=N[r];delete(i=Jo({},i)).removeEmptyAttrs,delete i.removeEmpty,N[o]=i}Go(g,function(e,t){e[r]&&(g[t]=e=Jo({},g[t]),e[o]=e[r])})}))},x=function(e){var o=/^([+\-]?)(\w+)\[([^\]]+)\]$/;Ko[i.schema]=null,e&&Go(ei(e,","),function(e){var t,n,r=o.exec(e);r&&(n=r[1],t=n?g[r[2]]:g[r[2]]={"#comment":{}},t=g[r[2]],Go(ei(r[3],"|"),function(e){"-"===n?
delete t[e]:t[e]={}}))})},w=function(e){var t,n=N[e];if(n)return n;for(t=E.length;t--;)if((n=E[t]).pattern.test(e))return n};return i.valid_elements?y(i.valid_elements):(Go(n,function(e,t){N[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},g[t]=e.children}),"html5"!==i.schema&&Go(ei("strong/b em/i"),function(e){e=ei(e,"/"),N[e[1]].outputName=e[0]}),Go(ei("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){N[e]&&(N[e].removeEmpty=!0)}),Go(ei("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(e){N[e].paddEmpty=!0}),Go(ei("span"),function(e){N[e].removeEmptyAttrs=!0})),C(i.custom_elements),x(i.valid_children),b(i.extended_valid_elements),x("+ol[ul|ol],+ul[ul|ol]"),Go({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:
"table",legend:"fieldset",area:"map",param:"video audio object"},function(e,t){N[t]&&(N[t].parentsRequired=ei(e))}),i.invalid_elements&&Go(Qo(i.invalid_elements),function(e){N[e]&&delete N[e]}),w("span")||b("span[!data-mce-type|*]"),{children:g,elements:N,getValidStyles:function(){return e},getValidClasses:function(){return s},getBlockElements:function(){return c},getInvalidStyles:function(){return t},getShortEndedElements:function(){return a},getTextBlockElements:function(){return d},getTextInlineElements:function(){return m},getBoolAttrs:function(){return u},getElementRule:w,getSelfClosingElements:function(){return o},getNonEmptyElements:function(){return l},getMoveCaretBeforeOnEnterElements:function(){return f},getWhiteSpaceElements:function(){return r},getSpecialElements:function(){return h},isValidChild:function(e,t){var n=g[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},isValid:function(e,t
){var n,r,o=w(e);if(o){if(!t)return!0;if(o.attributes[t])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},getCustomElements:function(){return p},addValidElements:b,setValidElements:y,addCustomElements:C,addValidChildren:x}}var oi=function(e,t,n,r){var o=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+o(t)+o(n)+o(r)};function ii(y,e){var C,t,c,l,x=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,w=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,N=/\s*([^:]+):\s*([^;]+);?/g,E=/\s+$/,S={},T="\ufeff";for(y=y||{},e&&(c=e.getValidStyles(),l=e.getInvalidStyles()),t=("\\\" \\' \\; \\: ; : "+T).split(" "),C=0;C<t.length;C++)S[t[C]]=T+C,S[T+C]=t[C];return{toHex:function(e){return e.replace(x,oi)},parse:function(e){var t,n,r,o,i,a,
u,s,c={},l=y.url_converter,f=y.url_converter_scope||this,d=function(e,t,n){var r,o,i,a;if((r=c[e+"-top"+t])&&(o=c[e+"-right"+t])&&(i=c[e+"-bottom"+t])&&(a=c[e+"-left"+t])){var u=[r,o,i,a];for(C=u.length-1;C--&&u[C]===u[C+1];);-1<C&&n||(c[e+t]=-1===C?u[0]:u.join(" "),delete c[e+"-top"+t],delete c[e+"-right"+t],delete c[e+"-bottom"+t],delete c[e+"-left"+t])}},m=function(e){var t,n=c[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return!1;return c[e]=n[0],!0}},g=function(e){return o=!0,S[e]},p=function(e,t){return o&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return S[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e},h=function(e){return String.fromCharCode(parseInt(e.slice(1),16))},v=function(e){return e.replace(/\\[0-9a-f]+/gi,h)},b=function(e,t,n,r,o,i){if(o=o||i)return"'"+(o=p(o)).replace(/\'/g,"\
\'")+"'";if(t=p(t||n||r),!y.allow_script_urls){var a=t.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!y.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return l&&(t=l.call(f,t,"style")),"url('"+t.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,g).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,g)});t=N.exec(e);)if(N.lastIndex=t.index+t[0].length,n=t[1].replace(E,"").toLowerCase(),r=t[2].replace(E,""),n&&r){if(n=v(n),r=v(r),-1!==n.indexOf(T)||-1!==n.indexOf('"'))continue;if(!y.allow_script_urls&&("behavior"===n||/expression\s*\(|\/\*|\*\//.test(r)))continue;"font-weight"===n&&"700"===r?r="bold":"color"!==n&&"background-color"!==n||(
r=r.toLowerCase()),r=(r=r.replace(x,oi)).replace(w,b),c[n]=o?p(r,!0):r}d("border","",!0),d("border","-width"),d("border","-color"),d("border","-style"),d("padding",""),d("margin",""),i="border",u="border-style",s="border-color",m(a="border-width")&&m(u)&&m(s)&&(c[i]=c[a]+" "+c[u]+" "+c[s],delete c[a],delete c[u],delete c[s]),"medium none"===c.border&&delete c.border,"none"===c["border-image"]&&delete c["border-image"]}return c},serialize:function(i,e){var t,n,r,o,a,u="",s=function(e){var t,n,r,o;if(t=c[e])for(n=0,r=t.length;n<r;n++)e=t[n],(o=i[e])&&(u+=(0<u.length?" ":"")+e+": "+o+";")};if(e&&c)s("*"),s(e);else for(t in i)!(n=i[t])||l&&(r=
t,o=e,a=void 0,(a=l["*"])&&a[r]||(a=l[o])&&a[r])||(u+=(0<u.length?" ":"")+t+": "+n+";");return u}}}var ai,ui=Yt.each,si=Yt.grep,ci=Re.ie,li=/^([a-z0-9],?)+$/i,fi=/^[ \t\r\n]*$/,di=function(n,r,o){var e={},i=r.keep_values,t={set:function(e,t,n){r.url_converter&&(t=r.url_converter.call(r.url_converter_scope||o(),t,n,e[0])),e.attr("data-mce-"+n,t).attr(n,t)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}};return e={style:{set:function(e,t){null===t||"object"!=typeof t?(i&&e.attr("data-mce-style",t),e.attr("style",t)):e.css(t)},get:function(e){var t=e.attr("data-mce-style")||e.attr("style");return t=n.serialize(n.parse(t),e[0].nodeName)}}},i&&(e.href=e.src=t),e},mi=function(e,t){var n=t.attr("style"),r=e.serialize(e.parse(n),t[0].nodeName);r||(r=null),t.attr("data-mce-style",r)},gi=function(e,t)
{var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o};function pi(a,u){var s,c=this;void 0===u&&(u={});var r={},i=window,o={},t=0,e=function(m,e){var g,p=0,h={};g=(e=e||{}).maxLoadTime||5e3;var v=function(e){m.getElementsByTagName("head")[0].appendChild(e)},n=function(e,t,n){var o,r,i,a,u=function(){for(var e=a.passed,t=e.length;t--;)e[t]();a.status=2,a.passed=[],a.failed=[]},s=function(){for(var e=a.failed,t=e.length;t--;)e[t]();a.status=3,a.passed=[],a.failed=[]},c=function(e,t){e()||((new Date).getTime()-i<g?Le.setTimeout(t):s())},l=function(){c(function(){for(var e,t,n=m.styleSheets,r=n.length;r--;)if((t=(e=n[r]).ownerNode?e.ownerNode:e.owningElement)&&t.id===o.id)return u(),!0},l)},f=function(){c(function(){try{var e=r.sheet.cssRules;return u(),!!e}catch(t){}},f)};if(e=Yt._addCacheSuffix(e),h[e]?a=h[e]:(a={passed:[],failed:[]},h[e]=a),t&am
p;&a.passed.push(t),n&&a.failed.push(n),1!==a.status)if(2!==a.status)if(3!==a.status){if(a.status=1,(o=m.createElement("link")).rel="stylesheet",o.type="text/css",o.id="u"+p++,o.async=!1,o.defer=!1,i=(new Date).getTime(),"onload"in o&&!((d=navigator.userAgent.match(/WebKit\/(\d*)/))&&parseInt(d[1],10)<536))o.onload=l,o.onerror=s;else{if(0<navigator.userAgent.indexOf("Firefox"))return(r=m.createElement("style")).textContent='@import "'+e+'"',f(),void v(r);l()}var d;v(o),o.href=e}else s();else u()},t=function(t){return Zr.nu(function(e){n(t,q(e,H(oo.value(t))),q(e,H(oo.error(t))))})},o=function(e){return e.fold(j,j)};return{load:n,loadAll:function(e,n,r){to($(e,t)).get(function(e){var t=W(e,function(e){return e.isValue()});0<t.fail.length?r(t.fail.map(o)):n(t.pass.map(o))})}}}(a),l=[],f=u.schema?u.schema:ri({}),d=ii({url_converter:u.url_converter,url_converter_scope:u.u
rl_converter_scope},u.schema),m=u.ownEvents?new je(u.proxy):je.Event,n=f.getBlockElements(),g=pn.overrideDefaults(function(){return{context:a,element:V.getRoot()}}),p=function(e){if(e&&a&&"string"==typeof e){var t=a.getElementById(e);return t&&t.id!==e?a.getElementsByName(e)[1]:t}return e},h=function(e){return"string"==typeof e&&(e=p(e)),g(e)},v=function(e,t,n){var r,o,i=h(e);return i.length&&(o=(r=s[t])&&r.get?r.get(i,t):i.attr(t)),void 0===o&&(o=n||""),o},b=function(e){var t=p(e);return t?t.attributes:[]},y=function(e,t,n){var r,o;""===n&&(n=null);var i=h(e);r=i.attr(t),i.length&&((o=s[t])&&o.set?o.set(i,n,t):i.attr(t,n),r!==n&&u.onSetAttrib&&u.onSetAttrib({attrElm:i,attrName:t,attrValue:n}))},C=function(){return u.root_element||a.body},x=function(e,t){return Yr.getPos(a.body,p(e),t)},w=function(e,t,n){var r=h(e);return n?r.css(t):("float&quo
t;===(t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}))&&(t=Re.ie&&Re.ie<12?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:undefined)},N=function(e){var t,n;return e=p(e),t=w(e,"width"),n=w(e,"height"),-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}},E=function(e,t){var n;if(!e)return!1;if(!Array.isArray(e)){if("*"===t)return 1===e.nodeType;if(li.test(t)){var r=t.toLowerCase().split(/,/),o=e.nodeName.toLowerCase();for(n=r.length-1;0<=n;n--)if(r[n]===o)return!0;return!1}if(e.nodeType&&1!==e.nodeType)return!1}var i=Array.isArray(e)?e:[e];return 0<Tt(t,i[0].ownerDocument||i[0],null,i).length},S=function(e,t,n,r){var o,i=[],a=p(e);for(r=r===undefined,n=n||("BODY"!==C().nodeName?C().parentNode:null),Yt.is(t,"string")&am
p;&(t="*"===(o=t)?function(e){return 1===e.nodeType}:function(e){return E(e,o)});a&&a!==n&&a.nodeType&&9!==a.nodeType;){if(!t||"function"==typeof t&&t(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null},T=function(e,t,n){var r=t;if(e)for("string"==typeof t&&(r=function(e){return E(e,t)}),e=e[n];e;e=e[n])if("function"==typeof r&&r(e))return e;return null},k=function(e,n,r){var o,t="string"==typeof e?p(e):e;if(!t)return!1;if(Yt.isArray(t)&&(t.length||0===t.length))return o=[],ui(t,function(e,t){e&&("string"==typeof e&&(e=p(e)),o.push(n.call(r,e,t)))}),o;var i=r||c;return n.call(i,t)},A=function(e,t){h(e).each(function(e,n){ui(t,function(e,t){y(n,t,e)})})},_=function(e,r){var t=h(e);ci?t.each(function(e,t){if(!1!==t.canHaveHTML){for(;t.firstChild;)t.removeChild(t.firstChild);try{t.innerHTML="<br>"+r,t.removeChild(t.firstChild)
}catch(n){pn("<div></div>").html("<br>"+r).contents().slice(1).appendTo(t)}return r}}):t.html(r)},R=function(e,n,r,o,i){return k(e,function(e){var t="string"==typeof n?a.createElement(n):n;return A(t,r),o&&("string"!=typeof o&&o.nodeType?t.appendChild(o):"string"==typeof o&&_(t,o)),i?t:e.appendChild(t)})},D=function(e,t,n){return R(a.createElement(e),e,t,n,!0)},B=Wo.decode,O=Wo.encodeAllRaw,P=function(e,t){var n=h(e);return t?n.each(function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():n.remove(),1<n.length?n.toArray():n[0]},L=function(e,t,n){h(e).toggleClass(t,n).each(function(){""===this.className&&pn(this).attr("class",null)})},I=function(t,e,n){return k(e,function(e){return Yt.is(e,"array")&&(t=t.cloneNode(!0)),n&&ui(si(e.childNodes),func
tion(e){t.appendChild(e)}),e.parentNode.replaceChild(t,e)})},M=function(){return a.createRange()},F=function(e,t,n,r){if(Yt.isArray(e)){for(var o=e.length;o--;)e[o]=F(e[o],t,n,r);return e}return!u.collect||e!==a&&e!==i||l.push([e,t,n,r]),m.bind(e,t,n,r||V)},U=function(e,t,n){var r;if(Yt.isArray(e)){for(r=e.length;r--;)e[r]=U(e[r],t,n);return e}if(l&&(e===a||e===i))for(r=l.length;r--;){var o=l[r];e!==o[0]||t&&t!==o[1]||n&&n!==o[2]||m.unbind(o[0],o[1],o[2])}return m.unbind(e,t,n)},z=function(e){if(e&&Bo.isElement(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},V={doc:a,settings:u,win:i,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:e,boundEvents:l,styles:d,schema:f,events:m,isBlock:function(e){if("string"==typeof e)return!!n[e];if(e){var t=e.nodeType;if(t)return!(1!==t||!n[e.nodeName])}return!1},$:g,$$
:h,root:null,clone:function(t,e){if(!ci||1!==t.nodeType||e)return t.cloneNode(e);if(!e){var n=a.createElement(t.nodeName);return ui(b(t),function(e){y(n,e.nodeName,v(t,e.nodeName))}),n}return null},getRoot:C,getViewPort:function(e){var t=e||i,n=t.document,r=n.documentElement;return{x:t.pageXOffset||r.scrollLeft,y:t.pageYOffset||r.scrollTop,w:t.innerWidth||r.clientWidth,h:t.innerHeight||r.clientHeight}},getRect:function(e){var t,n;return e=p(e),t=x(e),n=N(e),{x:t.x,y:t.y,w:n.w,h:n.h}},getSize:N,getParent:function(e,t,n){var r=S(e,t,n,!1);return r&&0<r.length?r[0]:null},getParents:S,get:p,getNext:function(e,t){return T(e,t,"nextSibling")},getPrev:function(e,t){return T(e,t,"previousSibling")},select:function(e,t){return Tt(e,p(t)||u.root_element||a,[])},is:E,add:R,create:D,createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)t.hasOwnProperty(r)&&null!==t[r]&&"undefined"!=typeof t[r]&&(o+="
; "+r+'="'+O(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(e){var t,n=a.createElement("div"),r=a.createDocumentFragment();for(e&&(n.innerHTML=e);t=n.firstChild;)r.appendChild(t);return r},remove:P,setStyle:function(e,t,n){var r=h(e).css(t,n);u.update_styles&&mi(d,r)},getStyle:w,setStyles:function(e,t){var n=h(e).css(t);u.update_styles&&mi(d,n)},removeAllAttribs:function(e){return k(e,function(e){var t,n=e.attributes;for(t=n.length-1;0<=t;t--)e.removeAttributeNode(n.item(t))})},setAttrib:y,setAttribs:A,getAttrib:v,getPos:x,parseStyle:function(e){return d.parse(e)},serializeStyle:function(e,t){return d.serialize(e,t)},addStyle:function(e){var t,n;if(V!==pi.DOM&&a===document){if(r[e])return;r[e]=!0}(n=a.getElementById("mceDefaultStyles"))||((n=a.createElement("style")).id="mceDefaultStyles",n.type="text/css
",(t=a.getElementsByTagName("head")[0]).firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(a.createTextNode(e))},loadCSS:function(e){var n;V===pi.DOM||a!==document?(e||(e=""),n=a.getElementsByTagName("head")[0],ui(e.split(","),function(e){var t;e=Yt._addCacheSuffix(e),o[e]||(o[e]=!0,t=D("link",{rel:"stylesheet",href:e}),n.appendChild(t))})):pi.DOM.loadCSS(e)},addClass:function(e,t){h(e).addClass(t)},removeClass:function(e,t){L(e,t,!1)},hasClass:function(e,t){return h(e).hasClass(t)},toggleClass:L,show:function(e){h(e).show()},hide:function(e){h(e).hide()},isHidden:function(e){return"none"===h(e).css("display")},uniqueId:function(e){return(e||"mce_")+t++},setHTML:_,getOuterHTML:function(e){var t="string"==typeof e?p(e):e;return Bo.isElement(t)?t.outerHTML:pn("<div></div>").append(pn(t).clone()).html(
)},setOuterHTML:function(e,t){h(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}P(pn(this).html(t),!0)})},decode:B,encode:O,insertAfter:function(e,t){var r=p(t);return k(e,function(e){var t,n;return t=r.parentNode,(n=r.nextSibling)?t.insertBefore(e,n):t.appendChild(e),e})},replace:I,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=D(e),ui(b(t),function(e){y(n,e.nodeName,v(t,e.nodeName))}),I(n,t,!0)),n||t},findCommonAncestor:function(e,t){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&e.ownerDocument?e.ownerDocument.documentElement:r},toHex:function(e){return d.toHex(Yt.trim(e))},run:k,getAttribs:b,isEmpty:function(e,t){var n,r,o,i,a,u,s=0;if(e=e.firstChild){a=new io(e,e.parentNode),t=t||(f?f.getNonEmptyElements():null),i=f?f.getWhiteSpaceElements():{};do{if(o=e.nodeType,Bo.isElement(e)){var c=e.getAttribute("data-mce-bogus");if(c){e=a.next(&q
uot;all"===c);continue}if(u=e.nodeName.toLowerCase(),t&&t[u]){if("br"===u){s++,e=a.next();continue}return!1}for(n=(r=b(e)).length;n--;)if("name"===(u=r[n].nodeName)||"data-mce-bookmark"===u)return!1}if(8===o)return!1;if(3===o&&!fi.test(e.nodeValue))return!1;if(3===o&&e.parentNode&&i[e.parentNode.nodeName]&&fi.test(e.nodeValue))return!1;e=a.next()}while(e)}return s<=1},createRng:M,nodeIndex:gi,split:function(e,t,n){var r,o,i,a=M();if(e&&t)return a.setStart(e.parentNode,gi(e)),a.setEnd(t.parentNode,gi(t)),r=a.extractContents(),(a=M()).setStart(t.parentNode,gi(t)+1),a.setEnd(e.parentNode,gi(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(Lo.trimNode(V,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(Lo.trimNode(V,o),e),P(e),n||t},bind:F,unbind:U,fire:function(e,t,n){return m.fire(e,t,n)},getContentEditable:z,getContentEditableParent:function(e){for(var t=C(),n=null;e&&e
!==t&&null===(n=z(e));e=e.parentNode);return n},destroy:function(){if(l)for(var e=l.length;e--;){var t=l[e];m.unbind(t[0],t[1],t[2])}Tt.setDocument&&Tt.setDocument()},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset}};return s=di(d,u,function(){return V}),V}(ai=pi||(pi={})).DOM=ai(document),ai.nodeIndex=gi;var hi=pi,vi=hi.DOM,bi=Yt.each,yi=Yt.grep,Ci=function(e){return"function"==typeof e},xi=function(){var f={},o=[],i={},a=[],d=0;this.isDone=function(e){return 2===f[e]},this.markDone=function(e){f[e]=2},this.add=this.load=function(e,t,n,r){f[e]===undefined&&(o.push(e),f[e]=0),t&&(i[e]||(i[e]=[]),i[e].push({success:t,failure:r,scope:n||this}))},this.remove=function(e){delete f[e],delete i[e]},this.loadQue
ue=function(e,t,n){this.loadScripts(o,e,t,n)},this.loadScripts=function(n,e,t,r){var s,c=[],l=function(t,e){bi(i[e],function(e){Ci(e[t])&&e[t].call(e.scope)}),i[e]=undefined};a.push({success:e,failure:r,scope:t||this}),(s=function(){var e=yi(n);if(n.length=0,bi(e,function(e){var t,n,r,o,i,a,u;2!==f[e]?3!==f[e]?1!==f[e]&&(f[e]=1,d++,t=e,n=function(){f[e]=2,d--,l("success",e),s()},r=function(){f[e]=3,d--,c.push(e),l("failure",e),s()},u=function(){a.remove(i),o&&(o.onreadystatechange=o.onload=o=null),n()},i=(a=vi).uniqueId(),(o=document.createElement("script")).id=i,o.type="text/javascript",o.src=Yt._addCacheSuffix(t),"onreadystatechange"in o?o.onreadystatechange=function(){/loaded|complete/.test(o.readyState)&&u()}:o.onload=u,o.onerror=function(){Ci(r)?r():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName
("head")[0]||document.body).appendChild(o)):l("failure",e):l("success",e)}),!d){var t=a.slice(0);a.length=0,bi(t,function(e){0===c.length?Ci(e.success)&&e.success.call(e.scope):Ci(e.failure)&&e.failure.call(e.scope,c)})}})()}};xi.ScriptLoader=new xi;var wi,Ni=Yt.each;function Ei(){var r=this,o=[],a={},u={},i=[],s=function(e){var t;return u[e]&&(t=u[e].dependencies),t||[]},c=function(e,t){return"object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}},l=function(e,n,t,r){var o=s(e);Ni(o,function(e){var t=c(n,e);f(t.resource,t,undefined,undefined)}),t&&(r?t.call(r):t.call(xi))},f=function(e,t,n,r,o){if(!a[e]){var i="string"==typeof t?t:t.prefix+t.resource+t.suffix;0!==i.indexOf("/")&&-1===i.indexOf("://")&&(i=Ei.baseURL+"/"+i),a[e]=i.substring(0,i.lastIndexOf("/&qu
ot;)),u[e]?l(e,t,n,r):xi.ScriptLoader.add(i,function(){return l(e,t,n,r)},r,o)}};return{items:o,urls:a,lookup:u,_listeners:i,get:function(e){return u[e]?u[e].instance:undefined},dependencies:s,requireLangPack:function(e,t){var n=Ei.language;if(n&&!1!==Ei.languageLoad){if(t)if(-1!==(t=","+t+",").indexOf(","+n.substr(0,2)+","))n=n.substr(0,2);else if(-1===t.indexOf(","+n+","))return;xi.ScriptLoader.add(a[e]+"/langs/"+n+".js")}},add:function(t,e,n){o.push(e),u[t]={instance:e,dependencies:n};var r=W(i,function(e){return e.name===t});return i=r.fail,Ni(r.pass,function(e){e.callback()}),e},remove:function(e){delete a[e],delete u[e]},createUrl:c,addComponents:function(e,t){var n=r.urls[e];Ni(t,function(e){xi.ScriptLoader.add(n+"/"+e)})},load:f,waitFor:function(e,t){u.hasOwnProperty(e)?t():i.push({name:e,callback:t})}}}(wi=Ei||(Ei={})).PluginManager=wi(),wi.ThemeManager=wi();var Si=function(t,n
){Wr.parent(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})},Ti=function(e,t){e.dom().appendChild(t.dom())},ki={before:Si,after:function(e,t){Wr.nextSibling(e).fold(function(){Wr.parent(e).each(function(e){Ti(e,t)})},function(e){Si(e,t)})},prepend:function(t,n){Wr.firstChild(t).fold(function(){Ti(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},append:Ti,appendAt:function(e,t,n){Wr.child(e,n).fold(function(){Ti(e,t)},function(e){Si(e,t)})},wrap:function(e,t){Si(e,t),Ti(t,e)}},Ai=function(t,e){F(e,function(e){ki.before(t,e)})},_i=function(t,e){F(e,function(e){ki.append(t,e)})},Ri=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},Di={empty:function(e){e.dom().textContent="",F(Wr.children(e),function(e){Ri(e)})},remove:Ri,unwrap:function(e){var t=Wr.children(e);0<t.length&&Ai(e,t),Ri(e)}},Bi=function(n,r){var o=null;return{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(va
r e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null===o&&(o=setTimeout(function(){n.apply(null,e),o=null},r))}}},Oi=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return Oi(n())}}},Pi=function(e,t){var n=vr.get(e,t);return n===undefined||""===n?[]:n.split(" ")},Li=Pi,Ii=function(e,t,n){var r=Pi(e,t).concat([n]);return vr.set(e,t,r.join(" ")),!0},Mi=function(e,t,n){var r=U(Pi(e,t),function(e){return e!==n});return 0<r.length?vr.set(e,t,r.join(" ")):vr.remove(e,t),!1},Fi=function(e){return Li(e,"class")},Ui=function(e,t){return Ii(e,"class",t)},zi=function(e,t){return Mi(e,"class",t)},Vi=Fi,qi=Ui,Hi=zi,ji=function(e,t){return I(Fi(e),t)?zi(e,t):Ui(e,t)},$i=function(e){return e.dom().classList!==undefined},Wi=function(e,t){return $i(e)&&e.dom().classList.contains(t)},Ki={add:function(e,t){$i(e)?e.dom().classList.add(t):qi(e,t)},remove:function(
e,t){var n;$i(e)?e.dom().classList.remove(t):Hi(e,t),0===($i(n=e)?n.dom().classList:Vi(n)).length&&vr.remove(n,"class")},toggle:function(e,t){return $i(e)?e.dom().classList.toggle(t):ji(e,t)},toggler:function(e,t){var n,r,o,i,a,u,s=$i(e),c=e.dom().classList;return n=function(){s?c.remove(t):Hi(e,t)},r=function(){s?c.add(t):qi(e,t)},o=Wi(e,t),i=o||!1,{on:a=function(){r(),i=!0},off:u=function(){n(),i=!1},toggle:function(){(i?u:a)()},isOn:function(){return i}}},has:Wi},Xi=function(e,t){return Ir.all(t,e)};function Yi(e,t,n,r,o){return e(n,r)?A.some(n):O(o)&&o(n)?A.none():t(n,r,o)}var Gi,Ji=function(e,t,n){for(var r=e.dom(),o=O(n)?n:H(!1);r.parentNode;){r=r.parentNode;var i=er.fromDom(r);if(t(i))return A.some(i);if(o(i))break}return A.none()},Qi=function(e,t){return V(e.dom().childNodes,q(t,er.fromDom)).map(er.fromDom)},Zi=function(e,r){var o=function(e){for(var t=0;t<e.childNodes.length;t++){if(r(er.fromDom(e.childNodes[t])))return A.some(er.fromDom(e.child
Nodes[t]));var n=o(e.childNodes[t]);if(n.isSome())return n}return A.none()};return o(e.dom())},ea={first:function(e){return Zi(Cr.body(),e)},ancestor:Ji,closest:function(e,t,n){return Yi(function(e){return t(e)},Ji,e,t,n)},sibling:function(t,n){var e=t.dom();return e.parentNode?Qi(er.fromDom(e.parentNode),function(e){return!Ur.eq(t,e)&&n(e)}):A.none()},child:Qi,descendant:Zi},ta=function(e,t,n){return ea.ancestor(e,function(e){return Ir.is(e,t)},n)},na=ta,ra=function(e,t){return Ir.one(t,e)},oa=function(e,t,n){return Yi(Ir.is,ta,e,t,n)},ia=H("mce-annotation"),aa=H("data-mce-annotation"),ua=H("data-mce-annotation-uid"),sa=function(r,e){var t=r.selection.getRng(),n=er.fromDom(t.startContainer),o=er.fromDom(r.getBody()),i=e.fold(function(){return"."+ia()},function(e){return"["+aa()+'="'+e+'"]'}),a=Wr.child(n,t.startOffset).getOr(n),u=oa(a,i,function(e){return Ur.eq(e,o)}),s=function(e,t){return vr.has(e,t)?A.some(vr.ge
t(e,t)):A.none()};return u.bind(function(e){return s(e,""+ua()).bind(function(n){return s(e,""+aa()).map(function(e){var t=ca(r,n);return{uid:n,name:e,elements:t}})})})},ca=function(e,t){var n=er.fromDom(e.getBody());return Xi(n,"["+ua()+'="'+t+'"]')},la=function(e,t){var n=er.fromDom(e.getBody()),r=Xi(n,"["+aa()+'="'+t+'"]'),o={};return F(r,function(e){var t=vr.get(e,ua()),n=o.hasOwnProperty(t)?o[t]:[];o[t]=n.concat([e])}),o},fa=function(i,e){var n,r,o,a=Oi({}),c=function(e,t){u(e,function(e){return t(e),e})},u=function(e,t){var n=a.get(),r=t(n.hasOwnProperty(e)?n[e]:{listeners:[],previous:Oi(A.none())});n[e]=r,a.set(n)},t=(n=function(){var e,t,n,r=a.get(),o=(e=cr(r),(n=Q.call(e,0)).sort(t),n);F(o,function(e){u(e,function(u){var s=u.previous.get();return sa(i,A.some(e)).fold(function(){var t;s.isSome()&&(c(t=e,function(e){F(e.listeners,function(e){return e(!1,t)})}),u.previous.set(A.none()))},function(e){var t,n,r,
o=e.uid,i=e.name,a=e.elements;s.is(o)||(n=o,r=a,c(t=i,function(e){F(e.listeners,function(e){return e(!0,t,{uid:n,nodes:$(r,function(e){return e.dom()})})})}),u.previous.set(A.some(o)))}),{previous:u.previous,listeners:u.listeners}})})},r=30,o=null,{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==o&&clearTimeout(o),o=setTimeout(function(){n.apply(null,e),o=null},r)}});return i.on("remove",function(){t.cancel()}),i.on("nodeChange",function(){t.throttle()}),{addListener:function(e,t){u(e,function(e){return{previous:e.previous,listeners:e.listeners.concat([t])}})}}},da=function(e,n){e.on("init",function(){e.serializer.addNodeFilter("span",function(e){F(e,function(t){var e;(e=t,A.from(e.attributes.map[aa()]).bind(n.lookup)).each(function(e){!1===e.persistent&&t.unwrap()})})})})},ma=function(){var n={};return{register:function(e,t){n
[e]={name:e,settings:t}},lookup:function(e){return n.hasOwnProperty(e)?A.from(n[e]).map(function(e){return e.settings}):A.none()}}},ga=0,pa=function(t,e){F(e,function(e){Ki.add(t,e)})},ha=function(e,t){return er.fromDom(e.dom().cloneNode(t))},va=function(e){return ha(e,!0)},ba=function(e){return ha(e,!1)},ya=va,Ca=[].slice,xa=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Ca.call(arguments);return r.length-1>=e.length?e.apply(this,r.slice(1)):function(){var e=r.concat([].slice.call(arguments));return xa.apply(this,e)}},wa={constant:function(e){return function(){return e}},negate:function(t){return function(e){return!t(e)}},and:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Ca.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(!n[t](e))return!1;return!0}},or:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Ca.call(arguments);return function(e){for(var t=0;t<n.length;t+
+)if(n[t](e))return!0;return!1}},curry:xa,compose:function(t,n){return function(e){return t(n(e))}},noop:function(){}},Na="\ufeff",Ea=function(e){return e===Na},Sa=Na,Ta=function(e){return e.replace(new RegExp(Na,"g"),"")},ka=Bo.isElement,Aa=Bo.isText,_a=function(e){return Aa(e)&&(e=e.parentNode),ka(e)&&e.hasAttribute("data-mce-caret")},Ra=function(e){return Aa(e)&&Ea(e.data)},Da=function(e){return _a(e)||Ra(e)},Ba=function(e){return e.firstChild!==e.lastChild||!Bo.isBr(e.firstChild)},Oa=function(e){var t=e.container();return e&&Bo.isText(t)&&t.data.charAt(e.offset())===Sa},Pa=function(e){var t=e.container();return e&&Bo.isText(t)&&t.data.charAt(e.offset()-1)===Sa},La=function(e,t,n){var r,o,i;return(r=t.ownerDocument.createElement(e)).setAttribute("data-mce-caret",n?"before":"after"),r.setAttribute("data-mce-bogus","all"),r.appendChild(((
i=document.createElement("br")).setAttribute("data-mce-bogus","1"),i)),o=t.parentNode,n?o.insertBefore(r,t):t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r),r},Ia=function(e){return Aa(e)&&e.data[0]===Sa},Ma=function(e){return Aa(e)&&e.data[e.data.length-1]===Sa},Fa=function(e){return e&&e.hasAttribute("data-mce-caret")?(t=e.getElementsByTagName("br"),n=t[t.length-1],Bo.isBogus(n)&&n.parentNode.removeChild(n),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null;var t,n},Ua=Bo.isContentEditableTrue,za=Bo.isContentEditableFalse,Va=Bo.isBr,qa=Bo.isText,Ha=Bo.matchNodeNames("script style textarea"),ja=Bo.matchNodeNames("img input textarea hr iframe video audio object"),$a=Bo.matchNodeNames("table"),Wa=Da,Ka=function(e){return!Wa(e)&&a
mp;(qa(e)?!Ha(e.parentNode):ja(e)||Va(e)||$a(e)||Xa(e))},Xa=function(e){return!1===(t=e,Bo.isElement(t)&&"true"===t.getAttribute("unselectable"))&&za(e);var t},Ya=function(e,t){return Ka(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if(Xa(e))return!1;if(Ua(e))return!0}return!0}(e,t)},Ga=Math.round,Ja=function(e){return e?{left:Ga(e.left),top:Ga(e.top),bottom:Ga(e.bottom),right:Ga(e.right),width:Ga(e.width),height:Ga(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},Qa=function(e,t){return e=Ja(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e},Za=function(e,t,n){return 0<=e&&e<=Math.min(t.height,n.height)/2},eu=function(e,t){return e.bottom-e.height/2<t.top||!(e.top>t.bottom)&&Za(t.top-e.bottom,e,t)},tu=function(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&Za(t.bottom-e.top,e,t)},nu=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes
()&&e.endOffset===n+1?t.childNodes[n]:null},ru=function(e,t){return 1===e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},ou=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u
0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u
20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]"),iu=function(e){return"string"==typeof e&&768<=e.charCodeAt(0)&&ou.test(e)},au=function(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r];if(!o.isSome())return A.none();n.push(o.getOrDie())}return A.some(t.apply(null,n))},uu=Bo.isElement,su=Ka,cu=Bo.matchStyleValues("display","block table"),lu=Bo.matchStyleValues("float","left right"),fu=wa.and(uu,su,wa.negate(lu)),du=wa.negate(Bo.matchStyleValues("white-space","pre pre-line
pre-wrap")),mu=Bo.isText,gu=Bo.isBr,pu=hi.nodeIndex,hu=ru,vu=function(e){return"createRange"in e?e.createRange():hi.DOM.createRng()},bu=function(e){return e&&/[\r\n\t ]/.test(e)},yu=function(e){return!!e.setStart&&!!e.setEnd},Cu=function(e){var t,n=e.startContainer,r=e.startOffset;return!!(bu(e.toString())&&du(n.parentNode)&&Bo.isText(n)&&(t=n.data,bu(t[r-1])||bu(t[r+1])))},xu=function(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom},wu=function(e){var t,n,r,o,i,a,u,s;return t=0<(n=e.getClientRects()).length?Ja(n[0]):Ja(e.getBoundingClientRect()),!yu(e)&&gu(e)&&xu(t)?(i=(r=e).ownerDocument,a=vu(i),u=i.createTextNode("\xa0"),(s=r.parentNode).insertBefore(u,r),a.setStart(u,0),a.setEnd(u,1),o=Ja(a.getBoundingClientRect()),s.removeChild(u),o):xu(t)&&yu(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&Bo.isTe
xt(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),wu(i)}return null}(e):t},Nu=function(e,t){var n=Qa(e,t);return n.width=1,n.right=n.left+1,n},Eu=function(e){var t,n,r=[],o=function(e){var t,n;0!==e.height&&(0<r.length&&(t=e,n=r[r.length-1],t.left===n.left&&t.top===n.top&&t.bottom===n.bottom&&t.right===n.right)||r.push(e))},i=function(e,t){var n=vu(e.ownerDocument);if(t<e.data.length){if(iu(e.data[t]))return r;if(iu(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!Cu(n)))return o(Nu(wu(n),!1)),r}0<t&&(n.setStart(e,t-1),n.setEnd(e,t),Cu(n)||o(Nu(wu(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),Cu(n)||o(Nu(wu(n),!0)))};if(mu(e.container()))return i(e.container(),e.offset()),r;if(uu(e.container()))if(e.isAtEnd())n=hu(e.container(),e.offset()),mu(n)&&i(n,n.data.length),fu(n)&&!gu(n)&&o(Nu(wu(n),!1));else{if(n=hu(e.container(),e.offset()),mu(n)&a
mp;&i(n,0),fu(n)&&e.isAtEnd())return o(Nu(wu(n),!1)),r;t=hu(e.container(),e.offset()-1),fu(t)&&!gu(t)&&(cu(t)||cu(n)||!fu(n))&&o(Nu(wu(t),!1)),fu(n)&&o(Nu(wu(n),!0))}return r};function Su(t,n,e){var r=function(){return e||(e=Eu(Su(t,n))),e};return{container:wa.constant(t),offset:wa.constant(n),toRange:function(){var e;return(e=vu(t.ownerDocument)).setStart(t,n),e.setEnd(t,n),e},getClientRects:r,isVisible:function(){return 0<r().length},isAtStart:function(){return mu(t),0===n},isAtEnd:function(){return mu(t)?n>=t.data.length:n>=t.childNodes.length},isEqual:function(e){return e&&t===e.container()&&n===e.offset()},getNode:function(e){return hu(t,e?n-1:n)}}}(Gi=Su||(Su={})).fromRangeStart=function(e){return Gi(e.startContainer,e.startOffset)},Gi.fromRangeEnd=function(e){return Gi(e.endContainer,e.endOffset)},Gi.after=function(e){return Gi(e.parentNode,pu(e)+1)},Gi.before=function(e){return Gi(e.parentNode,pu(e))},Gi.is
Above=function(e,t){return au([ee(t.getClientRects()),te(e.getClientRects())],eu).getOr(!1)},Gi.isBelow=function(e,t){return au([te(t.getClientRects()),ee(e.getClientRects())],tu).getOr(!1)},Gi.isAtStart=function(e){return!!e&&e.isAtStart()},Gi.isAtEnd=function(e){return!!e&&e.isAtEnd()},Gi.isTextPosition=function(e){return!!e&&Bo.isText(e.container())},Gi.isElementPosition=function(e){return!1===Gi.isTextPosition(e)};var Tu,ku,Au=Su,_u=Bo.isText,Ru=Bo.isBogus,Du=hi.nodeIndex,Bu=function(e){var t=e.parentNode;return Ru(t)?Bu(t):t},Ou=function(e){return e?jt.reduce(e.childNodes,function(e,t){return Ru(t)&&"BR"!==t.nodeName?e=e.concat(Ou(t)):e.push(t),e},[]):[]},Pu=function(t){return function(e){return t===e}},Lu=function(e){var t,r,n,o;return(_u(e)?"text()":e.nodeName.toLowerCase())+"["+(r=Ou(Bu(t=e)),n=jt.findIndex(r,Pu(t),t),r=r.slice(0,n+1),o=jt.reduce(r,function(e,t,n){return _u(t)&&_u(r[n-1])&&e++,e},0
),r=jt.filter(r,Bo.matchNodeNames(t.nodeName)),(n=jt.findIndex(r,Pu(t),t))-o)+"]"},Iu=function(e,t){var n,r,o,i,a,u=[];return n=t.container(),r=t.offset(),_u(n)?o=function(e,t){for(;(e=e.previousSibling)&&_u(e);)t+=e.data.length;return t}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(Lu(n)),a=function(e,t,n){var r=[];for(t=t.parentNode;!(t===e||n&&n(t));t=t.parentNode)r.push(t);return r}(e,n),a=jt.filter(a,wa.negate(Bo.isBogus)),(u=u.concat(jt.map(a,function(e){return Lu(e)}))).reverse().join("/")+","+o},Mu=function(e,t){var n,r,o;return t?(t=(n=t.split(","))[0].split("/"),o=1<n.length?n[1]:"before",(r=jt.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),n=e,r=t[1],o=parseInt(t[2],10),i=Ou(n),i=jt.filter(i,function(e,t){return!_u(e)||!_u(i[t-1])}),(i=jt.filter(i,Bo.m
atchNodeNames(r)))[o]):null;var n,r,o,i},e))?_u(r)?function(e,t){for(var n,r=e,o=0;_u(r);){if(n=r.data.length,o<=t&&t<=o+n){e=r,t-=o;break}if(!_u(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return _u(e)&&t>e.data.length&&(t=e.data.length),Au(e,t)}(r,parseInt(o,10)):(o="after"===o?Du(r)+1:Du(r),Au(r.parentNode,o)):null):null},Fu=Bo.isContentEditableFalse,Uu=function(e,t,n,r,o){var i,a=r[o?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],s=[],c=0,l=e.getRoot();for(Bo.isText(a)?s.push(n?function(e,t,n){var r,o;for(o=e(t.data.slice(0,n)).length,r=t.previousSibling;r&&Bo.isText(r);r=r.previousSibling)o+=e(r.data).length;return o}(t,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(c=1,u=Math.max(0,i.length-1)),s.push(e.nodeIndex(i[u],n)+c));a&&a!==l;a=a.parentNode)s.push(e.nodeIndex(a,n));return s},zu=function(e){Bo.isText(e)&&0===e.data.leng
th&&e.parentNode.removeChild(e)},Vu=function(e,t,n){var r=0;return Yt.each(e.select(t),function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++}),r},qu=function(e,t){var n,r,o,i=t?"start":"end";n=e[i+"Container"],r=e[i+"Offset"],Bo.isElement(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(t?r:r-1,o.length-1)])&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r))},Hu=function(e){return qu(e,!0),qu(e,!1),e},ju=function(e,t){var n;if(Bo.isElement(e)&&(e=ru(e,t),Fu(e)))return e;if(Da(e)){if(Bo.isText(e)&&_a(e)&&(e=e.parentNode),n=e.previousSibling,Fu(n))return n;if(n=e.nextSibling,Fu(n))return n}},$u=function(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(Fu(r)||"IMG"===o)return{name:o,index:Vu(n.dom,o,r)};var a,u,s,c,l,f,d,m=ju((a=i).startContainer,a.startOffset)||ju(
a.endContainer,a.endOffset);return m?{name:o=m.tagName,index:Vu(n.dom,o,m)}:(u=e,c=t,l=i,f=(s=n).dom,(d={}).start=Uu(f,u,c,l,!0),s.isCollapsed()||(d.end=Uu(f,u,c,l,!1)),d)},Wu=function(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,""):e.create("span",r)},Ku=function(e,t){var n=e.dom,r=e.getRng(),o=n.uniqueId(),i=e.isCollapsed(),a=e.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:Vu(n,u,a)};var s=Hu(r.cloneRange());if(!i){s.collapse(!1);var c=Wu(n,o+"_end",t);s.insertNode(c),zu(c.nextSibling)}(r=Hu(r)).collapse(!0);var l=Wu(n,o+"_start",t);return r.insertNode(l),zu(l.previousSibling),e.moveToBookmark({id:o,keep:1}),{id:o}},Xu={getBookmark:function(e,t,n){return 2===t?$u(Ta,n,e):3===t?(o=(r=e).getRng(),{start:Iu(r.dom.getRoot(),Au.fromRangeStart(o)),end:Iu(r.dom.getRoot(),Au.fromRangeEnd(o))}):t?{rng:e.getRng(
)}:Ku(e,!1);var r,o},getUndoBookmark:b($u,j,!0),getPersistentBookmark:Ku},Yu="_mce_caret",Gu=function(e){return Bo.isElement(e)&&e.id===Yu},Ju=function(e,t){for(;t&&t!==e;){if(t.id===Yu)return t;t=t.parentNode}return null},Qu=Bo.isElement,Zu=Bo.isText,es=function(e){var t=e.parentNode;t&&t.removeChild(e)},ts=function(e,t){0===t.length?es(e):e.nodeValue=t},ns=function(e){var t=Ta(e);return{count:e.length-t.length,text:t}},rs=function(e,t){return as(e),t},os=function(e,t){var n,r,o,i=t.container(),a=(n=ne(i.childNodes),r=e,o=L(n,r),-1===o?A.none():A.some(o)).map(function(e){return e<t.offset()?Au(i,t.offset()-1):t}).getOr(t);return as(e),a},is=function(e,t){return Zu(e)&&t.container()===e?(r=t,o=ns((n=e).data.substr(0,r.offset())),i=ns(n.data.substr(r.offset())),0<(a=o.text+i.text).length?(ts(n,a),Au(n,r.offset()-o.count)):r):rs(e,t);var n,r,o,i,a},as=function(e){if(Qu(e)&&Da(e)&&(Ba(e)?e.removeAttribute("data-mce-ca
ret"):es(e)),Zu(e)){var t=Ta(function(e){try{return e.nodeValue}catch(t){return""}}(e));ts(e,t)}},us={removeAndReposition:function(e,t){return Au.isTextPosition(t)?is(e,t):(n=e,(r=t).container()===n.parentNode?os(n,r):rs(n,r));var n,r},remove:as},ss=Bo.isContentEditableTrue,cs=Bo.isContentEditableFalse,ls=function(e,t,n,r,o){return t._selectionOverrides.showCaret(e,n,r,o)},fs=function(e,t){var n,r;return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?null:((r=(n=t).ownerDocument.createRange()).selectNode(n),r)},ds=function(e,t,n){var r=$c(1,e.getBody(),t),o=Au.fromRangeStart(r),i=o.getNode();if(cs(i))return ls(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(cs(a))return ls(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),function(e){return cs(e)||ss(e)});return cs(u)?ls(1,e,u,!1,n):null},ms=function(e,t,n){if(!t||!t.collapsed)return t;var r=ds(e,t,n);return r||t};(ku=Tu||(Tu={}))[ku.Backwards=-1]="Backwards",ku[ku.Forwards=1]="Forw
ards";var gs,ps,hs=Bo.isContentEditableFalse,vs=Bo.isText,bs=Bo.isElement,ys=Bo.isBr,Cs=Ka,xs=function(e){return ja(e)||!!Xa(t=e)&&!0!==jt.reduce(t.getElementsByTagName("*"),function(e,t){return e||Ua(t)},!1);var t},ws=Ya,Ns=function(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null},Es=function(e,t){if(Pc(e)){if(Cs(t.previousSibling)&&!vs(t.previousSibling))return Au.before(t);if(vs(t))return Au(t,0)}if(Lc(e)){if(Cs(t.nextSibling)&&!vs(t.nextSibling))return Au.after(t);if(vs(t))return Au(t,t.data.length)}return Lc(e)?ys(t)?Au.before(t):Au.after(t):Au.before(t)},Ss=function(e,t,n){var r,o,i,a,u;if(!bs(n)||!t)return null;if(t.isEqual(Au.after(n))&&n.lastChild){if(u=Au.after(n.lastChild),Lc(e)&&Cs(n.lastChild)&&bs(n.lastChild))return ys(n.lastChild)?Au.before(n.lastChild):u}else u=t;var s,c,l,f=u.container(),d=u.offset();if(vs(f)){if(Lc(e)&&0<d)return Au(f,--d);if(Pc(e)&&am
p;d<f.length)return Au(f,++d);r=f}else{if(Lc(e)&&0<d&&(o=Ns(f,d-1),Cs(o)))return!xs(o)&&(i=Mc(o,e,ws,o))?vs(i)?Au(i,i.data.length):Au.after(i):vs(o)?Au(o,o.data.length):Au.before(o);if(Pc(e)&&d<f.childNodes.length&&(o=Ns(f,d),Cs(o)))return ys(o)&&n.lastChild===o?null:(s=o,c=n,Bo.isBr(s)&&(l=Ss(1,Au.after(s),c))&&!Uc(Au.before(s),Au.before(l),c)?Ss(e,Au.after(o),n):!xs(o)&&(i=Mc(o,e,ws,o))?vs(i)?Au(i,0):Au.before(i):vs(o)?Au(o,0):Au.after(o));r=o||u.getNode()}return(Pc(e)&&u.isAtEnd()||Lc(e)&&u.isAtStart())&&(r=Mc(r,e,wa.constant(!0),n,!0),ws(r,n))?Es(e,r):(o=Mc(r,e,ws,n),!(a=jt.last(jt.filter(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNode;return n}(f,n),hs)))||o&&a.contains(o)?o?Es(e,o):null:u=Pc(e)?Au.after(a):Au.before(a))},Ts=function(t){return{next:function(e){return Ss(Tu.Forwards,e,t)},prev:function(e){return Ss(Tu.Backwards,e,t)}}};(ps=gs||(g
s={}))[ps.Br=0]="Br",ps[ps.Block=1]="Block",ps[ps.Wrap=2]="Wrap",ps[ps.Eol=3]="Eol";var ks,As,_s,Rs,Ds,Bs=function(e,t){return e===Tu.Backwards?t.reverse():t},Os=function(e,t,n,r){for(var o,i,a,u,s,c,l=Ts(n),f=r,d=[];f&&(s=l,c=f,o=t===Tu.Forwards?s.next(c):s.prev(c));){if(Bo.isBr(o.getNode(!1)))return t===Tu.Forwards?{positions:Bs(t,d).concat([o]),breakType:gs.Br,breakAt:A.some(o)}:{positions:Bs(t,d),breakType:gs.Br,breakAt:A.some(o)};if(o.isVisible()){if(e(f,o)){var m=(i=t,a=f,u=o,Bo.isBr(u.getNode(i===Tu.Forwards))?gs.Br:!1===Uc(a,u)?gs.Block:gs.Wrap);return{positions:Bs(t,d),breakType:m,breakAt:A.some(o)}}d.push(o),f=o}else f=o}return{positions:Bs(t,d),breakType:gs.Eol,breakAt:A.none()}},Ps=function(n,r,o,e){return r(o,e).breakAt.map(function(e){var t=r(o,e).positions;return n===Tu.Backwards?t.concat(e):[e].concat(t)}).getOr([])},Ls=function(e,i){return z(e,function(e,o){return e.fold(function(){return A.some(o)},function(r){return
au([ee(r.getClientRects()),ee(o.getClientRects())],function(e,t){var n=Math.abs(i-e.left);return Math.abs(i-t.left)<=n?o:r}).or(e)})},A.none())},Is=function(t,e){return ee(e.getClientRects()).bind(function(e){return Ls(t,e.left)})},Ms=b(Os,Su.isAbove,-1),Fs=b(Os,Su.isBelow,1),Us=b(Ps,-1,Ms),zs=b(Ps,1,Fs),Vs=function(e,t,n,r,o){var i,a,u,s,c=Xi(er.fromDom(n),"td,th").map(function(e){return e.dom()}),l=U((i=e,G(c,function(e){var t,n,r=(t=e.getBoundingClientRect(),n=-1,{left:t.left-n,top:t.top-n,right:t.right+2*n,bottom:t.bottom+2*n,width:t.width+n,height:t.height+n});return[{x:r.left,y:i(r),cell:e},{x:r.right,y:i(r),cell:e}]})),function(e){return t(e,o)});return(a=l,u=r,s=o,z(a,function(e,r){return e.fold(function(){return A.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-u)+Math.abs(e.y-s)),n=Math.sqrt(Math.abs(r.x-u)+Math.abs(r.y-s));return A.some(n<t?r:e)})},A.none())).map(function(e){return e.cell})},qs=b(Vs,function(e){return e.bottom},function(e,t){return e.y&l
t;t}),Hs=b(Vs,function(e){return e.top},function(e,t){return e.y>t}),js=function(t,n){return ee(n.getClientRects()).bind(function(e){return qs(t,e.left,e.top)}).bind(function(e){return Is((t=e,al.lastPositionIn(t).map(function(e){return Ms(t,e).positions.concat(e)}).getOr([])),n);var t})},$s=function(t,n){return te(n.getClientRects()).bind(function(e){return Hs(t,e.left,e.top)}).bind(function(e){return Is((t=e,al.firstPositionIn(t).map(function(e){return[e].concat(Fs(t,e).positions)}).getOr([])),n);var t})},Ws=function(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}},Ks=function(e,t,n){var r,o,i,a,u,s=e.dom,c=s.getRoot(),l=0;if(u={elm:t,alignToTop:n},e.fire("scrollIntoView",u),!u.isDefaultPrevented()&&Bo.isElement(t)){if(!1===n&&(l=t.offsetHeight),"BODY"!==c.nodeName){var f=e.selection.getScrollContainer();if(f)return r=Ws(t).y-Ws(f).y+l,a=f.clientHeight,void((r<(i=f.scrollT
op)||i+a<r+25)&&(f.scrollTop=r<i?r:r-a+25))}o=s.getViewPort(e.getWin()),r=s.getPos(t).y+l,i=o.y,a=o.h,(r<o.y||i+a<r+25)&&e.getWin().scrollTo(0,r<i?r:r-a+25)}},Xs=function(d,e){ee(Su.fromRangeStart(e).getClientRects()).each(function(e){var t,n,r,o,i,a,u,s,c,l=function(e){if(e.inline)return e.getBody().getBoundingClientRect();var t=e.getWin();return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight,width:t.innerWidth,height:t.innerHeight}}(d),f={x:(i=t=l,a=n=e,a.left>i.left&&a.right<i.right?0:a.left<i.left?a.left-i.left:a.right-i.right),y:(r=t,o=n,o.top>r.top&&o.bottom<r.bottom?0:o.top<r.top?o.top-r.top:o.bottom-r.bottom)};s=0!==f.x?0<f.x?f.x+4:f.x-4:0,c=0!==f.y?0<f.y?f.y+4:f.y-4:0,(u=d).inline?(u.getBody().scrollLeft+=s,u.getBody().scrollTop+=c):u.getWin().scrollBy(s,c)})},Ys=function(e,t,n){var r=e.getParam(t,n);if(-1!==r.indexOf("=")){var o=e.getParam(t,"","hash");return o.hasOwn
Property(e.id)?o[e.id]:n}return r},Gs=function(e){return e.getParam("iframe_attrs",{})},Js=function(e){return e.getParam("doctype","<!DOCTYPE html>")},Qs=function(e){return e.getParam("document_base_url","")},Zs=function(e){return Ys(e,"body_id","tinymce")},ec=function(e){return Ys(e,"body_class","")},tc=function(e){return e.getParam("content_security_policy","")},nc=function(e){return e.getParam("br_in_pre",!0)},rc=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":t},oc=function(e){return e.getParam("forced_root_block_attrs",{})},ic=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},ac=function(e){return e.getParam("no_newline_selector","")},uc=function(e){re
turn e.getParam("keep_styles",!0)},sc=function(e){return e.getParam("end_container_on_empty_block",!1)},cc=function(e){return Yt.explode(e.getParam("font_size_style_values",""))},lc=function(e){return Yt.explode(e.getParam("font_size_classes",""))},fc=Qn.detect().browser,dc=function(){return fc.isIE()||fc.isEdge()||fc.isFirefox()},mc=function(e,t){e.selection.setRng(t),Xs(e,t)},gc=function(t,n,e){var r=t(n,e);return r.breakType===gs.Wrap&&0===r.positions.length?r.breakAt.map(function(e){return t(n,e).breakAt.isNone()}).getOr(!0):r.breakAt.isNone()},pc=wa.curry(gc,Ms),hc=wa.curry(gc,Fs),vc=function(e,t,n,r){var o,i,a,u,s=e.selection.getRng(),c=t?1:-1;if(dc()&&(o=t,i=s,a=n,u=Au.fromRangeStart(i),al.positionIn(!o,a).map(function(e){return e.isEqual(u)}).getOr(!1))){var l=ls(c,e,n,!t,!0);return mc(e,l),!0}return!1},bc=function(e,t){var n=t.getNode(e);return Bo.isElement(n)&&"TABLE"===n.nodeName
?A.some(n):A.none()},yc=function(u,s,c){var e=bc(!!s,c),t=!1===s;e.fold(function(){return mc(u,c.toRange())},function(a){return al.positionIn(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return mc(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=rc(r=u))?r.undoManager.transact(function(){var e=er.fromTag(i);vr.setAll(e,oc(r)),ki.append(e,er.fromTag("br")),n?ki.after(er.fromDom(o),e):ki.before(er.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom(),0),t.setEnd(e.dom(),0),mc(r,t)}):mc(r,t.toRange()));var n,r,o,t,i})})},Cc=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=Au.fromRangeStart(l),d=e.getBody();if(!t&&pc(r,f)){var m=(u=d,js(s=n,c=f).orThunk(function(){return ee(c.getClientRects()).bind(function(e){return Ls(Us(u,Au.before(s)),e.left)})}).getOr(Au.before(s)));return yc(e,t,m),!0}return!(!t||!hc(r,f))&&(o=d,m=$s(i=n,a=f).orThunk(function(){return ee(a.getClientRects()).bind(function(e){return Ls(zs(o,Au.a
fter(i)),e.left)})}).getOr(Au.after(i)),yc(e,t,m),!0)},xc=function(t,n){return function(){return A.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(e){return A.from(t.dom.getParent(e,"table")).map(function(e){return vc(t,n,e)})}).getOr(!1)}},wc=function(n,r){return function(){return A.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return A.from(n.dom.getParent(t,"table")).map(function(e){return Cc(n,r,e,t)})}).getOr(!1)}},Nc=Bo.isContentEditableFalse,Ec=function(e,t,n){var r,o,i,a,u,s=Qa(t.getBoundingClientRect(),n);return"BODY"===e.tagName?(r=e.ownerDocument.documentElement,o=e.scrollLeft||r.scrollLeft,i=e.scrollTop||r.scrollTop):(u=e.getBoundingClientRect(),o=e.scrollLeft-u.left,i=e.scrollTop-u.top),s.left+=o,s.right+=o,s.top+=i,s.bottom+=i,s.width=1,0<(a=t.offsetWidth-t.clientWidth)&&(n&&(a*=-1),s.left+=a,s.right+=a),s},Sc=function(a,u,e){var t,s,c=Oi(A.none()),l=function
(){!function(e){var t,n,r,o,i;for(t=pn("*[contentEditable=false]",e),o=0;o<t.length;o++)r=(n=t[o]).previousSibling,Ma(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(i.length-1,1)),r=n.nextSibling,Ia(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(0,1))}(a),s&&(us.remove(s),s=null),c.get().each(function(e){pn(e.caret).remove(),c.set(A.none())}),clearInterval(t)},f=function(){t=Le.setInterval(function(){e()?pn("div.mce-visual-caret",a).toggleClass("mce-visual-caret-hidden"):pn("div.mce-visual-caret",a).addClass("mce-visual-caret-hidden")},500)};return{show:function(t,e){var n,r,o;if(l(),o=e,Bo.isElement(o)&&/^(TD|TH)$/i.test(o.tagName))return null;if(!u(e))return s=function(e,t){var n,r,o;if(r=e.ownerDocument.createTextNode(Sa),o=e.parentNode,t){if(n=e.previousSibling,Aa(n)){if(Da(n))return n;if(Ma(n))return n.splitText(n.data.length-1)}o.insertBefore(r,e)}else
{if(n=e.nextSibling,Aa(n)){if(Da(n))return n;if(Ia(n))return n.splitText(1),n}e.nextSibling?o.insertBefore(r,e.nextSibling):o.appendChild(r)}return r}(e,t),r=e.ownerDocument.createRange(),Nc(s.nextSibling)?(r.setStart(s,0),r.setEnd(s,0)):(r.setStart(s,1),r.setEnd(s,1)),r;s=La("p",e,t),n=Ec(a,e,t),pn(s).css("top",n.top);var i=pn('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(n).appendTo(a)[0];return c.set(A.some({caret:i,element:e,before:t})),c.get().each(function(e){t&&pn(e.caret).addClass("mce-visual-caret-before")}),f(),(r=e.ownerDocument.createRange()).setStart(s,0),r.setEnd(s,0),r},hide:l,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){c.get().each(function
(e){var t=Ec(a,e.element,e.before);pn(e.caret).css(t)})},destroy:function(){return Le.clearInterval(t)}}},Tc=function(e){return Nc(e)||Bo.isTable(e)&&dc()},kc=Bo.isContentEditableFalse,Ac=Bo.matchStyleValues("display","block table table-cell table-caption list-item"),_c=Da,Rc=_a,Dc=wa.curry,Bc=Bo.isElement,Oc=Ka,Pc=function(e){return 0<e},Lc=function(e){return e<0},Ic=function(e,t){for(var n;n=e(t);)if(!Rc(n))return n;return null},Mc=function(e,t,n,r,o){var i=new io(e,r);if(Lc(t)){if((kc(e)||Rc(e))&&n(e=Ic(i.prev,!0)))return e;for(;e=Ic(i.prev,o);)if(n(e))return e}if(Pc(t)){if((kc(e)||Rc(e))&&n(e=Ic(i.next,!0)))return e;for(;e=Ic(i.next,o);)if(n(e))return e}return null},Fc=function(e,t){for(;e&&e!==t;){if(Ac(e))return e;e=e.parentNode}return null},Uc=function(e,t,n){return Fc(e.container(),n)===Fc(t.container(),n)},zc=function(e,t){var n,r;return t?(n=t.container(),r=t.offset(),Bc(n)?n.childNodes[r+e]:null):null},Vc=function(
e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},qc=function(e,t,n){var r,o,i,a;for(o=e?"previousSibling":"nextSibling";n&&n!==t;){if(r=n[o],_c(r)&&(r=r[o]),kc(r)){if(a=n,Fc(r,i=t)===Fc(a,i))return r;break}if(Oc(r))break;n=n.parentNode}return null},Hc=Dc(Vc,!0),jc=Dc(Vc,!1),$c=function(e,t,n){var r,o,i,a,u=Dc(qc,!0,t),s=Dc(qc,!1,t);if(o=n.startContainer,i=n.startOffset,_a(o)){if(Bc(o)||(o=o.parentNode),"before"===(a=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,Tc(r)))return Hc(r);if("after"===a&&(r=o.previousSibling,Tc(r)))return jc(r)}if(!n.collapsed)return n;if(Bo.isText(o)){if(_c(o)){if(1===e){if(r=s(o))return Hc(r);if(r=u(o))return jc(r)}if(-1===e){if(r=u(o))return jc(r);if(r=s(o))return Hc(r)}return n}if(Ma(o)&&i>=o.data.length-1)return 1===e&&(r=s(o))?Hc(r):n;if(Ia(o)&&i<=1)retur
n-1===e&&(r=u(o))?jc(r):n;if(i===o.data.length)return(r=s(o))?Hc(r):n;if(0===i)return(r=u(o))?jc(r):n}return n},Wc=function(e,t){var n=zc(e,t);return kc(n)&&!Bo.isBogusAll(n)},Kc=function(e,t){return Bo.isTable(zc(e,t))},Xc=function(e,t){return A.from(zc(e?0:-1,t)).filter(kc)},Yc=function(e,t,n){var r=$c(e,t,n);return-1===e?Su.fromRangeStart(r):Su.fromRangeEnd(r)},Gc=Dc(Wc,0),Jc=Dc(Wc,-1),Qc=Dc(Kc,0),Zc=Dc(Kc,-1),el=function(e){return Au.isTextPosition(e)?0===e.offset():Ka(e.getNode())},tl=function(e){if(Au.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return Ka(e.getNode(!0))},nl=function(e,t){return!Au.isTextPosition(e)&&!Au.isTextPosition(t)&&e.getNode()===t.getNode(!0)},rl=function(e,t,n){return e?!nl(t,n)&&(r=t,!(!Au.isTextPosition(r)&&Bo.isBr(r.getNode())))&&tl(t)&&el(n):!nl(n,t)&&el(t)&&tl(n);var r},ol=function(e,t,n){var r=Ts(t);return A.from(e?r.next(n):r.prev(n))},il=
function(e,t){var n,r,o,i,a,u=e?t.firstChild:t.lastChild;return Bo.isText(u)?A.some(Au(u,e?0:u.data.length)):u?Ka(u)?A.some(e?Au.before(u):(a=u,Bo.isBr(a)?Au.before(a):Au.after(a))):(r=t,o=u,i=(n=e)?Au.before(o):Au.after(o),ol(n,r,i)):A.none()},al={fromPosition:ol,nextPosition:b(ol,!0),prevPosition:b(ol,!1),navigate:function(t,n,r){return ol(t,n,r).bind(function(e){return Uc(r,e,n)&&rl(t,r,e)?ol(t,n,e):A.some(e)})},positionIn:il,firstPositionIn:b(il,!0),lastPositionIn:b(il,!1)},ul=function(e,t){return!e.isBlock(t)||t.innerHTML||Re.ie||(t.innerHTML='<br data-mce-bogus="1" />'),t},sl=function(e,t){return al.lastPositionIn(e).fold(function(){return!1},function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0})},cl=function(e,t,n){return!(!1!==t.hasChildNodes()||!Ju(e,t)||(o=n,i=(r=t).ownerDocument.createTextNode(Sa),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),0));var r,o,i},ll=function(e,t,n,r){var o,i,a,u,s=n[t?"start
":"end"],c=e.getRoot();if(s){for(a=s[0],i=c,o=s.length-1;1<=o;o--){if(u=i.childNodes,cl(c,i,r))return!0;if(s[o]>u.length-1)return!!cl(c,i,r)||sl(i,r);i=u[s[o]]}3===i.nodeType&&(a=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},fl=function(e){return Bo.isText(e)&&0<e.data.length},dl=function(e,t,n){var r,o,i,a,u,s,c=e.get(n.id+"_"+t),l=n.keep;if(c){if(r=c.parentNode,"start"===t?l?c.hasChildNodes()?(r=c.firstChild,o=1):fl(c.nextSibling)?(r=c.nextSibling,o=0):fl(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=e.nodeIndex(c)+1):o=e.nodeIndex(c):l?c.hasChildNodes()?(r=c.firstChild,o=1):fl(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=e.nodeIndex(c)):o=e.nodeIndex(c),u=r,s=o,!l){for(a=c.previousSibling,i=c.nextSibling,Yt.each(Yt.grep(c.childNodes),funct
ion(e){Bo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});c=e.get(n.id+"_"+t);)e.remove(c,!0);a&&i&&a.nodeType===i.nodeType&&Bo.isText(a)&&!Re.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,s=o)}return A.some(Au(u,s))}return A.none()},ml=function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b=e.dom;if(t){if(v=t,Yt.isArray(v.start))return p=t,h=(g=b).createRng(),ll(g,!0,p,h)&&ll(g,!1,p,h)?A.some(h):A.none();if("string"==typeof t.start)return A.some((f=t,d=(l=b).createRng(),m=Mu(l.getRoot(),f.start),d.setStart(m.container(),m.offset()),m=Mu(l.getRoot(),f.end),d.setEnd(m.container(),m.offset()),d));if(t.hasOwnProperty("id"))return s=dl(o=b,"start",i=t),c=dl(o,"end",i),au([s,(a=c,u=s,a.isSome()?a:u)],function(e,t){var n=o.createRng();return n.setStart(ul(o,e.container()),e.offset()),n.setEnd(ul(o,t.container()),t.offset()),n});if(t.hasOwnPr
operty("name"))return n=b,r=t,A.from(n.select(r.name)[r.index]).map(function(e){var t=n.createRng();return t.selectNode(e),t});if(t.hasOwnProperty("rng"))return A.some(t.rng)}return A.none()},gl=function(e,t,n){return Xu.getBookmark(e,t,n)},pl=function(t,e){ml(t,e).each(function(e){t.setRng(e)})},hl=function(e){return Bo.isElement(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},vl=function(e){return e&&/^(IMG)$/.test(e.nodeName)},bl=function(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)},yl=function(e,t,n){return"color"!==n&&"backgroundColor"!==n||(t=e.toHex(t)),"fontWeight"===n&&700===t&&(t="bold"),"fontFamily"===n&&(t=t.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+t},Cl={isInlineBlock:vl,moveStart:function(e,t,n){var r,o,i,a=n.startOff
set,u=n.startContainer;if((n.startContainer!==n.endContainer||!vl(n.startContainer.childNodes[n.startOffset]))&&1===u.nodeType)for(a<(i=u.childNodes).length?r=new io(u=i[a],e.getParent(u,e.isBlock)):(r=new io(u=i[i.length-1],e.getParent(u,e.isBlock))).next(!0),o=r.current();o;o=r.next())if(3===o.nodeType&&!bl(o))return n.setStart(o,0),void t.setRng(n)},getNonWhiteSpaceSibling:function(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1===e.nodeType||!bl(e))return e},isTextBlock:function(e,t){return t.nodeType&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]},isValid:function(e,t,n){return e.schema.isValidChild(t,n)},isWhiteSpaceNode:bl,replaceVars:function(e,n){return"string"!=typeof e?e=e(n):n&&(e=e.replace(/%(\w+)/g,function(e,t){return n[t]||e})),e},isEq:function(e,t){return t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.
toLowerCase()===t.toLowerCase()},normalizeStyleValue:yl,getStyle:function(e,t,n){return yl(e,e.getStyle(t,n),n)},getTextDecoration:function(t,e){var n;return t.getParent(e,function(e){return(n=t.getStyle(e,"text-decoration"))&&"none"!==n}),n},getParents:function(e,t,n){return e.getParents(t,n,e.getRoot())}},xl=hl,wl=Cl.getParents,Nl=Cl.isWhiteSpaceNode,El=Cl.isTextBlock,Sl=function(e,t){for(void 0===t&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)(e=e.childNodes[t])&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}},Tl=function(e,t){for(var n=t;n;){if(1===n.nodeType&&e.getContentEditable(n))return"false"===e.getContentEditable(n)?n:t;n=n.parentNode}return t},kl=function(e,t,n,r){var o,i,a=n.nodeValue;return void 0===r&&(r=e?a.length:0),e?(o=a.lastIndexOf(" ",r),-1===(o=(i=a.lastIndexOf("\xa0",r))<o?o:i)||t||o++):(o=a.indexOf(" &quo
t;,r),i=a.indexOf("\xa0",r),o=-1!==o&&(-1===i||o<i)?o:i),o},Al=function(e,t,n,r,o,i){var a,u,s,c;if(3===n.nodeType){if(-1!==(s=kl(o,i,n,r)))return{container:n,offset:s};c=n}for(a=new io(n,e.getParent(n,e.isBlock)||t);u=a[o?"prev":"next"]();)if(3===u.nodeType){if(-1!==(s=kl(o,i,c=u)))return{container:u,offset:s}}else if(e.isBlock(u))break;if(c)return{container:c,offset:r=o?0:c.length}},_l=function(e,t,n,r,o){var i,a,u,s;for(3===r.nodeType&&0===r.nodeValue.length&&r[o]&&(r=r[o]),i=wl(e,r),a=0;a<i.length;a++)for(u=0;u<t.length;u++)if(!("collapsed"in(s=t[u])&&s.collapsed!==n.collapsed)&&e.is(i[a],s.selector))return i[a];return r},Rl=function(t,e,n,r){var o,i=t.dom,a=i.getRoot();if(e[0].wrapper||(o=i.getParent(n,e[0].block,a)),!o){var u=i.getParent(n,"LI,TD,TH");o=i.getParent(3===n.nodeType?n.parentNode:n,function(e){return e!==a&&El(t,e)},u)}if(o&&e[0].wrapper&&
amp;(o=wl(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&(o=o[r],!Cl.isEq(o,"br")););return o||n},Dl=function(e,t,n,r,o,i,a){var u,s,c,l,f,d;if(u=s=a?n:o,l=a?"previousSibling":"nextSibling",f=e.getRoot(),3===u.nodeType&&!Nl(u)&&(a?0<r:i<u.nodeValue.length))return u;for(;;){if(!t[0].block_expand&&e.isBlock(s))return s;for(c=s[l];c;c=c[l])if(!xl(c)&&!Nl(c)&&("BR"!==(d=c).nodeName||!d.getAttribute("data-mce-bogus")||d.nextSibling))return s;if(s===f||s.parentNode===f){u=s;break}s=s.parentNode}return u},Bl=function(e,t,n,r){var o,i=t.startContainer,a=t.startOffset,u=t.endContainer,s=t.endOffset,c=e.dom;return 1===i.nodeType&&i.hasChildNodes()&&3===(i=ru(i,a)).nodeType&&(a=0),1===u.nodeType&&u.hasChildNodes()&&3===(u=ru(u,t.collapsed?s:s-1)).nodeType&&(s=u.nodeValue.length),i=Tl(c,i),u=Tl(c,u),(xl(i.pare
ntNode)||xl(i))&&3===(i=(i=xl(i)?i:i.parentNode).nextSibling||i).nodeType&&(a=0),(xl(u.parentNode)||xl(u))&&3===(u=(u=xl(u)?u:u.parentNode).previousSibling||u).nodeType&&(s=u.length),n[0].inline&&(t.collapsed&&((o=Al(c,e.getBody(),i,a,!0,r))&&(i=o.container,a=o.offset),(o=Al(c,e.getBody(),u,s,!1,r))&&(u=o.container,s=o.offset)),u=r?u:function(e,t){var n=Sl(e,t);if(n.node){for(;n.node&&0===n.offset&&n.node.previousSibling;)n=Sl(n.node.previousSibling);n.node&&0<n.offset&&3===n.node.nodeType&&" "===n.node.nodeValue.charAt(n.offset-1)&&1<n.offset&&(e=n.node).splitText(n.offset-1)}return e}(u,s)),(n[0].inline||n[0].block_expand)&&(n[0].inline&&3===i.nodeType&&0!==a||(i=Dl(c,n,i,a,u,s,!0)),n[0].inline&&3===u.nodeType&&s!==u.nodeValue.length||(u=Dl(c,n,i,a,u,s,!1))),n[0].selector&&!1!==n[0].expand&&!
n[0].inline&&(i=_l(c,n,t,i,"previousSibling"),u=_l(c,n,t,u,"nextSibling")),(n[0].block||n[0].selector)&&(i=Rl(e,n,i,"previousSibling"),u=Rl(e,n,u,"nextSibling"),n[0].block&&(c.isBlock(i)||(i=Dl(c,n,i,a,u,s,!0)),c.isBlock(u)||(u=Dl(c,n,i,a,u,s,!1)))),1===i.nodeType&&(a=c.nodeIndex(i),i=i.parentNode),1===u.nodeType&&(s=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:i,startOffset:a,endContainer:u,endOffset:s}},Ol=Yt.each,Pl=function(e,t,o){var n,r,i,a,u,s,c,l=t.startContainer,f=t.startOffset,d=t.endContainer,m=t.endOffset;if(0<(c=e.select("td[data-mce-selected],th[data-mce-selected]")).length)Ol(c,function(e){o([e])});else{var g,p,h,v=function(e){var t;return 3===(t=e[0]).nodeType&&t===l&&f>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===m&&0<e.length&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e},b=function(e,t,n){for(va
r r=[];e&&e!==n;e=e[t])r.push(e);return r},y=function(e,t){do{if(e.parentNode===t)return e;e=e.parentNode}while(e)},C=function(e,t,n){var r=n?"nextSibling":"previousSibling";for(u=(a=e).parentNode;a&&a!==t;a=u)u=a.parentNode,(s=b(a===e?a:a[r],r)).length&&(n||s.reverse(),o(v(s)))};if(1===l.nodeType&&l.hasChildNodes()&&(l=l.childNodes[f]),1===d.nodeType&&d.hasChildNodes()&&(p=m,h=(g=d).childNodes,--p>h.length-1?p=h.length-1:p<0&&(p=0),d=h[p]||g),l===d)return o(v([l]));for(n=e.findCommonAncestor(l,d),a=l;a;a=a.parentNode){if(a===d)return C(l,n,!0);if(a===n)break}for(a=d;a;a=a.parentNode){if(a===l)return C(d,n);if(a===n)break}r=y(l,n)||l,i=y(d,n)||d,C(l,r,!0),(s=b(r===l?r:r.nextSibling,"nextSibling",i===d?i.nextSibling:i)).length&&o(v(s)),C(d,i)}},Ll=(ks=sr.isText,As="text",_s=function(e){return ks(e)?A.from(e.dom().nodeValue):A.none()},Rs=Qn.detect().browser,{get:functi
on(e){if(!ks(e))throw new Error("Can only get "+As+" value of a "+As+" node");return Ds(e).getOr("")},getOption:Ds=Rs.isIE()&&10===Rs.version.major?function(e){try{return _s(e)}catch(Kw){return A.none()}}:_s,set:function(e,t){if(!ks(e))throw new Error("Can only set raw "+As+" value of a "+As+" node");e.dom().nodeValue=t}}),Il=function(e){return Ll.get(e)},Ml=function(r,o,i,a){return Wr.parent(o).fold(function(){return"skipping"},function(e){return"br"===a||(n=o,sr.isText(n)&&"\ufeff"===Il(n))?"skipping":(t=o,sr.isElement(t)&&Ki.has(t,ia())?"existing":Gu(o)?"caret":Cl.isValid(r,i,a)&&Cl.isValid(r,sr.name(e),i)?"valid":"invalid-child");var t,n})},Fl=undefined&&undefined.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=
e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n},Ul=function(r,e,t,n,o){var i,a,u=o.uid,s=void 0===u?(i="mce-annotation",a=(new Date).getTime(),i+"_"+Math.floor(1e9*Math.random())+ ++ga+String(a)):u,c=Fl(o,["uid"]),l=[],f=er.fromTag("span");Ki.add(f,ia()),vr.set(f,""+ua(),s),vr.set(f,""+aa(),t);var d=n(s,c),m=d.attributes,g=void 0===m?{}:m,p=d.classes,h=void 0===p?[]:p;vr.setAll(f,g),pa(f,h);var v=Oi(A.none()),b=function(){v.set(A.none())},y=function(e){F(e,C)},C=function(e){switch(Ml(r,e,"span",sr.name(e))){case"invalid-child":b();var t=Wr.children(e);y(t),b();break;case"valid":var n=v.get().getOrThunk(function(){var e=ba(f);return l.push(e),v.set(A.some(e)),e});ki.wrap(e,n)}};return Pl(r.dom,e,function(e){var t;b(),t=$(e,er.fromDom),y(t)
}),l},zl=function(a,u,s,c){a.undoManager.transact(function(){var e,t,n,r=a.selection.getRng();r.collapsed&&(n=Bl(e=a,t=r,[{inline:!0}],!1),t.setStart(n.startContainer,n.startOffset),t.setEnd(n.endContainer,n.endOffset),e.selection.setRng(t));var o=Xu.getPersistentBookmark(a.selection,!0),i=a.selection.getRng();Ul(a,i,u,s.decorate,c),a.selection.moveToBookmark(o)})};function Vl(r){var o=ma();da(r,o);var n=fa(r,o);return{register:function(e,t){o.register(e,t)},annotate:function(t,n){o.lookup(t).each(function(e){zl(r,t,e,n)})},annotationChanged:function(e,t){n.addListener(e,t)},remove:function(e){sa(r,A.some(e)).each(function(e){var t=e.elements;F(t,Di.unwrap)})},getAll:function(e){var t=la(r,e);return fr(t,function(e){return $(e,function(e){return e.dom()})})}}}var ql=function(e){return Yt.grep(e.childNodes,function(e){return"LI"===e.nodeName})},Hl=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&("\xa0"===(t=e.firstCh
ild).data||Bo.isBr(t));var t},jl=function(e){return 0<e.length&&(!(t=e[e.length-1]).firstChild||Hl(t))?e.slice(0,-1):e;var t},$l=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},Wl=function(e,t){var n=Au.after(e),r=Ts(t).prev(n);return r?r.toRange():null},Kl=function(t,e,n){var r,o,i,a,u=t.parentNode;return Yt.each(e,function(e){u.insertBefore(e,t)}),r=t,o=n,i=Au.before(r),(a=Ts(o).next(i))?a.toRange():null},Xl=function(e,t){var n,r,o,i,a,u,s=t.firstChild,c=t.lastChild;return s&&"meta"===s.name&&(s=s.next),c&&"mce_marker"===c.attr("id")&&(c=c.prev),r=c,u=(n=e).getNonEmptyElements(),r&&(r.isEmpty(u)||(o=r,n.getBlockElements()[o.name]&&(a=o).firstChild&&a.firstChild===a.lastChild&&("br"===(i=o.firstChild).name||"\xa0"===i.value)))&&(c=c.prev),!(!s||s!==c||"ul"!==s.name&&"ol"!==
s.name)},Yl=function(e,o,i,t){var n,r,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C,x,w,N=(n=o,r=t,c=e.serialize(r),l=n.createFragment(c),u=(a=l).firstChild,s=a.lastChild,u&&"META"===u.nodeName&&u.parentNode.removeChild(u),s&&"mce_marker"===s.id&&s.parentNode.removeChild(s),a),E=$l(o,i.startContainer),S=jl(ql(N.firstChild)),T=o.getRoot(),k=function(e){var t=Au.fromRangeStart(i),n=Ts(o.getRoot()),r=1===e?n.prev(t):n.next(t);return!r||$l(o,r.getNode())!==E};return k(1)?Kl(E,S,T):k(2)?(f=E,d=S,m=T,o.insertAfter(d.reverse(),f),Wl(d[0],m)):(p=S,h=T,v=g=E,y=(b=i).cloneRange(),C=b.cloneRange(),y.setStartBefore(v),C.setEndAfter(v),x=[y.cloneContents(),C.cloneContents()],(w=g.parentNode).insertBefore(x[0],g),Yt.each(p,function(e){w.insertBefore(e,g)}),w.insertBefore(x[1],g),w.removeChild(g),Wl(p[p.length-1],h))},Gl=function(e,t){return!!$l(e,t)},Jl=Yt.each,Ql=function(o){this.compare=function(e,t){if(e.nodeName!==t.nodeName)return!1;var n=function(n){var r
={};return Jl(o.getAttribs(n),function(e){var t=e.nodeName.toLowerCase();0!==t.indexOf("_")&&"style"!==t&&0!==t.indexOf("data-")&&(r[t]=o.getAttrib(n,t))}),r},r=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!(!r(n(e),n(t))||!r(o.parseStyle(o.getAttrib(e,"style")),o.parseStyle(o.getAttrib(t,"style")))||hl(e)||hl(t))}},Zl=function(e){var t=Xi(e,"br"),n=U(function(e){for(var t=[],n=e.dom();n;)t.push(er.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),go);t.length===n.length&&F(n,Di.remove)},ef=function(e){Di.empty(e),ki.append(e,er.fromHtml('<br data-mce-bogus="1">'))},tf=function(n){Wr.lastChild(n).each(function(t){Wr.prevSibling(t).each(function(e){fo(n)&&go(t)&&fo(e)&&Di.remove(t)})})},nf=Yt.makeMap;function rf(e){var u,s,
c,l,f,d=[];return u=(e=e||{}).indent,s=nf(e.indent_before||""),c=nf(e.indent_after||""),l=Wo.getEncodeFunc(e.entity_encoding||"raw",e.entities),f="html"===e.element_format,{start:function(e,t,n){var r,o,i,a;if(u&&s[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n"),d.push("<",e),t)for(r=0,o=t.length;r<o;r++)i=t[r],d.push(" ",i.name,'="',l(i.value,!0),'"');d[d.length]=!n||f?">":" />",n&&u&&c[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n")},end:function(e){var t;d.push("</",e,">"),u&&c[e]&&0<d.length&&0<(t=d[d.length-1]).length&&"\n"!==t&&d.push("\n")},text:function(e,t){0<e.length&&(d[d.length]=t?e:l(e))},cdata
:function(e){d.push("<![CDATA[",e,"]]>")},comment:function(e){d.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?d.push("<?",e," ",l(t),"?>"):d.push("<?",e,"?>"),u&&d.push("\n")},doctype:function(e){d.push("<!DOCTYPE",e,">",u?"\n":"")},reset:function(){d.length=0},getContent:function(){return d.join("").replace(/\n$/,"")}}}function of(t,g){void 0===g&&(g=ri());var p=rf(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(e){var f,d;d=t.validate,f={3:function(e){p.text(e.value,e.raw)},8:function(e){p.comment(e.value)},7:function(e){p.pi(e.name,e.value)},10:function(e){p.doctype(e.value)},4:function(e){p.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}},p.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=f[e.type];if(l)l(e);else{if(t
=e.name,n=e.shortEnded,r=e.attributes,d&&r&&1<r.length&&((a=[]).map={},c=g.getElementRule(e.name))){for(u=0,s=c.attributesOrder.length;u<s;u++)(o=c.attributesOrder[u])in r.map&&(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));for(u=0,s=r.length;u<s;u++)(o=r[u].name)in a.map||(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));r=a}if(p.start(e.name,r,n),!n){if(e=e.firstChild)for(;m(e),e=e.next;);p.end(t)}}};return 1!==e.type||t.inner?f[11](e):m(e),p.getContent()}}}var af=function(a){var u=Au.fromRangeStart(a),s=Au.fromRangeEnd(a),c=a.commonAncestorContainer;return al.fromPosition(!1,c,s).map(function(e){return!Uc(u,s,c)&&Uc(u,e,c)?(t=u.container(),n=u.offset(),r=e.container(),o=e.offset(),(i=document.createRange()).setStart(t,n),i.setEnd(r,o),i):a;var t,n,r,o,i}).getOr(a)},uf=function(e){return e.collapsed?e:af(e)},sf=Bo.matchNodeNames("td th"),cf=function(o,e,t){var n,r,i,a,u,s,c,l,f,d,m,g,p=o.schema.getTextInlineElements(),h=o
.selection,v=o.dom;if(/^ | $/.test(e)&&(e=function(e){var t,n,r;t=h.getRng(),n=t.startContainer,r=t.startOffset;var o=function(e){return n[e]&&3===n[e].nodeType};return 3===n.nodeType&&(0<r?e=e.replace(/^ /," "):o("previousSibling")||(e=e.replace(/^ /," ")),r<n.length?e=e.replace(/ (<br>|)$/," "):o("nextSibling")||(e=e.replace(/( | )(<br>|)$/," "))),e}(e)),n=o.parser,g=t.merge,r=of({validate:o.settings.validate},o.schema),m='<span id="mce_marker" data-mce-type="bookmark">​</span>',s={content:e,format:"html",selection:!0,paste:t.paste},(s=o.fire("BeforeSetContent",s)).isDefaultPrevented())o.fire("SetContent",{content:s.content,format:"html",selection:!0,paste:t.paste});else{-1===(e=s.content).indexOf("{$caret}")&&(e+="{$car
et}"),e=e.replace(/\{\$caret\}/,m);var b,y,C,x,w=(l=h.getRng()).startContainer||(l.parentElement?l.parentElement():null),N=o.getBody();w===N&&h.isCollapsed()&&v.isBlock(N.firstChild)&&(b=N.firstChild)&&!o.schema.getShortEndedElements()[b.nodeName]&&v.isEmpty(N.firstChild)&&((l=v.createRng()).setStart(N.firstChild,0),l.setEnd(N.firstChild,0),h.setRng(l)),h.isCollapsed()||(o.selection.setRng(uf(o.selection.getRng())),o.getDoc().execCommand("Delete",!1,null),C=(y=h.getRng()).startContainer,x=y.startOffset,3===C.nodeType&&y.collapsed&&("\xa0"===C.data[x]?(C.deleteData(x,1),/[\u00a0| ]$/.test(e)||(e+=" ")):"\xa0"===C.data[x-1]&&(C.deleteData(x-1,1),/[\u00a0| ]$/.test(e)||(e=" "+e))));var E,S,T,k={context:(i=h.getNode()).nodeName.toLowerCase(),data:t.data,insert:!0};if(u=n.parse(e,k),!0===t.paste&&Xl(o.schema,u)&&Gl(v,i))return l=Yl(r,v,o.selection
.getRng(),u),o.selection.setRng(l),void o.fire("SetContent",s);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(u),"mce_marker"===(f=u.lastChild).attr("id"))for(f=(c=f).prev;f;f=f.walk(!0))if(3===f.type||!v.isBlock(f.name)){o.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(o._selectionOverrides.showBlockCaretContainer(i),k.invalid){for(h.setContent(m),i=h.getNode(),a=o.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)f=(i=f).parentNode;e=i===a?a.innerHTML:v.getOuterHTML(i),e=r.serialize(n.parse(e.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return r.serialize(u)}))),i===a?v.setHTML(a,e):v.setOuterHTML(i,e)}else e=r.serialize(u),function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.la
stChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t):e.selection.setContent(t)}}(o,e,i);!function(){if(g){var n=o.getBody(),r=new Ql(v);Yt.each(v.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==n;t=t.parentNode)p[e.nodeName.toLowerCase()]&&r.compare(t,e)&&v.remove(e,!0)})}}(),function(e){var t,n,r;if(e){if(h.scrollIntoView(e),t=function(e){for(var t=o.getBody();e&&e!==t;e=e.parentNode)if("false"===o.dom.getContentEditable(e))return e;return null}(e))return v.remove(e),h.select(t);l=v.createRng(),(f=e.previousSibling)&&3===f.nodeType?(l.setStart(f,f.nodeValue.length),Re.ie||(d=e.nextSibling)&&3===d.nodeType&&(f.appendData(d.data),d.parentNode.removeChild(d))):(l.setStartBefore(e),l.setEndBefore(e)),n=v.getParent(e,v.isBlock),v.remove(e),n&&v.isEmpty(n)&&(o.$(n).empty(),l.setStart(n,0),l.setEnd(n,0),sf(n)||n.getAttribute("data-mce-fragment"
;)||!(r=function(e){var t=Au.fromRangeStart(e);if(t=Ts(o.getBody()).next(t))return t.toRange()}(l))?v.add(n,v.create("br",{"data-mce-bogus":"1"})):(l=r,v.remove(n))),h.setRng(l)}}(v.get("mce_marker")),E=o.getBody(),Yt.each(E.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),S=o.dom,T=o.selection.getStart(),A.from(S.getParent(T,"td,th")).map(er.fromDom).each(tf),o.fire("SetContent",s),o.addVisual()}},lf=function(e,t){var n,r,o="string"!=typeof(n=t)?(r=Yt.extend({paste:n.paste,data:{paste:n.paste}},n),{content:n.content,details:r}):{content:n,details:{}};cf(e,o.content,o.details)},ff=Ar("sections","settings"),df=Qn.detect().deviceType.isTouch(),mf=["lists","autolink","autosave"],gf={theme:"mobile"},pf=function(e){var t=R(e)?e.join(" "):e,n=$(k(t)?t.split(" "):[],$n);return U(n,function(e){
return 0<e.length})},hf=function(n,e){var r,o,i,t=(r=function(e,t){return I(n,t)},o={},i={},lr(e,function(e,t){(r(e,t)?o:i)[t]=e}),{t:o,f:i});return ff(t.t,t.f)},vf=function(e,t){return e.sections().hasOwnProperty(t)},bf=function(e,t,n,r){var o,i=pf(n.forced_plugins),a=pf(r.plugins),u=e&&vf(t,"mobile")?U(a,b(I,mf)):a,s=(o=u,[].concat(pf(i)).concat(pf(o)));return Yt.extend(r,{plugins:s.join(" ")})},yf=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g=hf(["mobile"],r),p=Yt.extend(t,n,g.settings(),(f=e,m=(d=g).settings().inline,f&&vf(d,"mobile")&&!m?(u="mobile",s=gf,c=g.sections(),l=c.hasOwnProperty(u)?c[u]:{},Yt.extend({},s,l)):{}),{validate:!0,content_editable:g.settings().inline,external_plugins:(o=n,i=g.settings(),a=i.external_plugins?i.external_plugins:{},o&&o.external_plugins?Yt.extend({},o.external_plugins,a):a)});return bf(e,g,n,p)},Cf=function(e,t,n){return A.from(t.settings[n]).filter(e)},xf=b(Cf,k
),wf=function(e,t,n,r){var o,i,a,u=t in e.settings?e.settings[t]:n;return"hash"===r?(a={},"string"==typeof(i=u)?F(0<i.indexOf("=")?i.split(/[;,](?![^=;,]*(?:[;,]|$))/):i.split(","),function(e){var t=e.split("=");1<t.length?a[Yt.trim(t[0])]=Yt.trim(t[1]):a[Yt.trim(t[0])]=Yt.trim(t)}):a=i,a):"string"===r?Cf(k,e,t).getOr(n):"number"===r?Cf(P,e,t).getOr(n):"boolean"===r?Cf(B,e,t).getOr(n):"object"===r?Cf(_,e,t).getOr(n):"array"===r?Cf(R,e,t).getOr(n):"string[]"===r?Cf((o=k,function(e){return R(e)&&J(e,o)}),e,t).getOr(n):"function"===r?Cf(O,e,t).getOr(n):u},Nf=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,Ef=function(e,t){var n=t.container(),r=t.offset();return e?Ra(n)?Bo.isText(n.nextSibling)?Au(n.nextSibling,0):Au.after(n):Oa(t)?Au(n,r+1):t:Ra(n)?Bo.isText(n.previousSibling)?Au(n.previousSibling,n.previousSibling.data.length):Au.before(n):Pa(t)?Au(n,r-1):t
},Sf={isInlineTarget:function(e,t){var n=xf(e,"inline_boundaries_selector").getOr("a[href],code");return Ir.is(er.fromDom(t),n)},findRootInline:function(e,t,n){var r,o,i,a=(r=e,o=t,i=n,U(hi.DOM.getParents(i.container(),"*",o),r));return A.from(a[a.length-1])},isRtl:function(e){return"rtl"===hi.DOM.getStyle(e,"direction",!0)||(t=e.textContent,Nf.test(t));var t},isAtZwsp:function(e){return Oa(e)||Pa(e)},normalizePosition:Ef,normalizeForwards:b(Ef,!0),normalizeBackwards:b(Ef,!1),hasSameParentBlock:function(e,t,n){var r=Fc(t,e),o=Fc(n,e);return r&&r===o}},Tf=function(e,t){return Ur.contains(e,t)?ea.closest(t,function(e){return po(e)||vo(e)},(n=e,function(e){return Ur.eq(n,er.fromDom(e.dom().parentNode))})):A.none();var n},kf=function(e){var t,n,r;e.dom.isEmpty(e.getBody())&&(e.setContent(""),n=(t=e).getBody(),r=n.firstChild&&t.dom.isBlock(n.firstChild)?n.firstChild:n,t.selection.setCursorLocation(r,0))},
Af=function(i,a,u){return au([al.firstPositionIn(u),al.lastPositionIn(u)],function(e,t){var n=Sf.normalizePosition(!0,e),r=Sf.normalizePosition(!1,t),o=Sf.normalizePosition(!1,a);return i?al.nextPosition(u,o).map(function(e){return e.isEqual(r)&&a.isEqual(n)}).getOr(!1):al.prevPosition(u,o).map(function(e){return e.isEqual(n)&&a.isEqual(r)}).getOr(!1)}).getOr(!0)},_f=function(e,t,n){return na(e,t,n).isSome()},Rf=function(e,t){return Bo.isText(t)&&/^[ \t\r\n]*$/.test(t.data)&&!1===(n=e,r=t,o=er.fromDom(n),i=er.fromDom(r),_f(i,"pre,code",b(Ur.eq,o)));var n,r,o,i},Df=function(e,t){return Ka(t)&&!1===Rf(e,t)||(n=t,Bo.isElement(n)&&"A"===n.nodeName&&n.hasAttribute("name"))||Bf(t);var n},Bf=Bo.hasAttribute("data-mce-bookmark"),Of=Bo.hasAttribute("data-mce-bogus"),Pf=Bo.hasAttributeValue("data-mce-bogus","all"),Lf=function(e){return function(e){var t,n,r=0;if(Df(e,e
))return!1;if(!(n=e.firstChild))return!0;t=new io(n,e);do{if(Pf(n))n=t.next(!0);else if(Of(n))n=t.next();else if(Bo.isBr(n))r++,n=t.next();else{if(Df(e,n))return!1;n=t.next()}}while(n);return r<=1}(e.dom())},If=Ar("block","position"),Mf=Ar("from","to"),Ff=function(e,t){var n=er.fromDom(e),r=er.fromDom(t.container());return Tf(n,r).map(function(e){return If(e,t)})},Uf=function(o,i,e){var t=Ff(o,Au.fromRangeStart(e)),n=t.bind(function(e){return al.fromPosition(i,o,e.position()).bind(function(e){return Ff(o,e).map(function(e){return t=o,n=i,r=e,Bo.isBr(r.position().getNode())&&!1===Lf(r.block())?al.positionIn(!1,r.block().dom()).bind(function(e){return e.isEqual(r.position())?al.fromPosition(n,t,e).bind(function(e){return Ff(t,e)}):A.some(r)}).getOr(r):r;var t,n,r})})});return au([t,n],Mf).filter(function(e){return r=e,!1===Ur.eq(r.from().block(),r.to().block())&&(n=e,Wr.parent(n.from().block()).bind(function(t){return Wr.paren
t(n.to().block()).filter(function(e){return Ur.eq(t,e)})}).isSome())&&(t=e,!1===Bo.isContentEditableFalse(t.from().block())&&!1===Bo.isContentEditableFalse(t.to().block()));var t,n,r})},zf=function(e,t,n){return n.collapsed?Uf(e,t,n):A.none()},Vf=function(e,t,n){return Ur.contains(t,e)?Wr.parents(e,function(e){return n(e)||Ur.eq(e,t)}).slice(0,-1):[]},qf=function(e,t){return Vf(e,t,H(!1))},Hf=qf,jf=function(e,t){return[e].concat(qf(e,t))},$f=function(e){var t,n,r=(t=e,n=Wr.children(t),K(n,fo).fold(function(){return n},function(e){return n.slice(0,e)}));return F(r,function(e){Di.remove(e)}),r},Wf=function(e,t){al.positionIn(e,t.dom()).each(function(e){var t=e.getNode();Bo.isBr(t)&&Di.remove(er.fromDom(t))})},Kf=function(e,t){var n=jf(t,e);return V(n.reverse(),Lf).each(Di.remove)},Xf=function(o,i){return Ur.contains(i,o)?Wr.parent(o).bind(function(e){return Ur.eq(e,i)?A.some(o):(t=i,n=o,r=Wr.parents(n,function(e){return Ur.eq(e,t)}),A.from(r[r.length-2]));var t
,n,r}):A.none()},Yf=function(n,r,o){if(Lf(o))return Di.remove(o),Lf(r)&&ef(r),al.firstPositionIn(r.dom());Wf(!0,r),Wf(!1,o);var i=$f(r);return Xf(r,o).fold(function(){Kf(n,r);var e=al.lastPositionIn(o.dom());return F(i,function(e){ki.append(o,e)}),e},function(t){var e=al.prevPosition(o.dom(),Au.before(t.dom()));return F(i,function(e){ki.before(t,e)}),Kf(n,r),e})},Gf=function(e,t,n,r){return t?Yf(e,r,n):Yf(e,n,r)},Jf=function(t,n){var e,r=er.fromDom(t.getBody());return(e=zf(r.dom(),n,t.selection.getRng()).bind(function(e){return Gf(r,n,e.from().block(),e.to().block())})).each(function(e){t.selection.setRng(e.toRange())}),e.isSome()},Qf=function(e,t){var n=er.fromDom(t),r=b(Ur.eq,e);return ea.ancestor(n,Co,r).isSome()},Zf=function(e,t){var n,r,o=al.prevPosition(e.dom(),Au.fromRangeStart(t)).isNone(),i=al.nextPosition(e.dom(),Au.fromRangeEnd(t)).isNone();return!(Qf(n=e,(r=t).startContainer)||Qf(n,r.endContainer))&&o&&i},ed=function(e){var n,r,o,t,i=er.fromDom(e.
getBody()),a=e.selection.getRng();return Zf(i,a)?((t=e).setContent(""),t.selection.setCursorLocation(),!0):(n=i,r=e.selection,o=r.getRng(),au([Tf(n,er.fromDom(o.startContainer)),Tf(n,er.fromDom(o.endContainer))],function(e,t){return!1===Ur.eq(e,t)&&(o.deleteContents(),Gf(n,!0,e,t).each(function(e){r.setRng(e.toRange())}),!0)}).getOr(!1))},td=function(e,t){return!e.selection.isCollapsed()&&ed(e)},nd=function(a){if(!R(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return F(a,function(e,r){var t=cr(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!R(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){var e=argume
nts.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=cr(e);if(u.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+t.join(","));if(!J(u,function(e){return I(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+u.join(", "));return e[o].apply(null,n)},log:function(e){console.log(e,{constructors:u,constructor:o,params:n})}}}}),n},rd=nd([{remove:["element"]},{moveToElement:["e
lement"]},{moveToPosition:["position"]}]),od=function(e,t,n,r){var o=r.getNode(!1===t);return Tf(er.fromDom(e),er.fromDom(n.getNode())).map(function(e){return Lf(e)?rd.remove(e.dom()):rd.moveToElement(o)}).orThunk(function(){return A.some(rd.moveToElement(o))})},id=function(u,s,c){return al.fromPosition(s,u,c).bind(function(e){return a=e.getNode(),Co(er.fromDom(a))||vo(er.fromDom(a))?A.none():(t=u,o=e,i=function(e){return mo(er.fromDom(e))&&!Uc(r,o,t)},Xc(!(n=s),r=c).fold(function(){return Xc(n,o).fold(H(!1),i)},i)?A.none():s&&Bo.isContentEditableFalse(e.getNode())?od(u,s,c,e):!1===s&&Bo.isContentEditableFalse(e.getNode(!0))?od(u,s,c,e):s&&Jc(c)?A.some(rd.moveToPosition(e)):!1===s&&Gc(c)?A.some(rd.moveToPosition(e)):A.none());var t,n,r,o,i,a})},ad=function(r,e,o){return i=e,a=o.getNode(!1===i),u=i?"after":"before",Bo.isElement(a)&&a.getAttribute("data-mce-caret")===u?(t=e,n=o.getNode(!1===e)
,t&&Bo.isContentEditableFalse(n.nextSibling)?A.some(rd.moveToElement(n.nextSibling)):!1===t&&Bo.isContentEditableFalse(n.previousSibling)?A.some(rd.moveToElement(n.previousSibling)):A.none()).fold(function(){return id(r,e,o)},A.some):id(r,e,o).bind(function(e){return t=r,n=o,e.fold(function(e){return A.some(rd.remove(e))},function(e){return A.some(rd.moveToElement(e))},function(e){return Uc(n,e,t)?A.none():A.some(rd.moveToPosition(e))});var t,n});var t,n,i,a,u},ud=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===Au.isTextPosition(n)&&o===r.parentNode&&i>Au.before(r).offset()?Au(t.container(),t.offset()-1):t;var n,r,o,i},sd=function(e){return Ka(e.previousSibling)?A.some((t=e.previousSibling,Bo.isText(t)?Au(t,t.data.length):Au.after(t))):e.previousSibling?al.lastPositionIn(e.previousSibling):A.none();var t},cd=function(e){return Ka(e.nextSibling)?A.some((t=e.nextSibling,Bo.isText(t)?Au(t,0):Au.before(t))):e.nextSibling?al.firstPosition
In(e.nextSibling):A.none();var t},ld=function(r,o){return sd(o).orThunk(function(){return cd(o)}).orThunk(function(){return e=r,t=o,n=Au.before(t.previousSibling?t.previousSibling:t.parentNode),al.prevPosition(e,n).fold(function(){return al.nextPosition(e,Au.after(t))},A.some);var e,t,n})},fd=function(n,r){return cd(r).orThunk(function(){return sd(r)}).orThunk(function(){return e=n,t=r,al.nextPosition(e,Au.after(t)).fold(function(){return al.prevPosition(e,Au.before(t))},A.some);var e,t})},dd=function(e,t,n){return(r=e,o=t,i=n,r?fd(o,i):ld(o,i)).map(b(ud,n));var r,o,i},md=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},gd=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(sr.name(t))},pd=function(e){if(Lf(e)){var t=er.fromHtml('<br data-mce-bogus="1">');return Di.empty(e),ki.append(e,t),A.some(Au.before(t.dom()))}return A.none()},hd=function(t,n,e){var r,a,o,i=dd(n,t.getBody(),e.dom()),u=ea.ancesto
r(e,b(gd,t),(r=t.getBody(),function(e){return e.dom()===r})),s=(a=e,o=i,au([Wr.prevSibling(a),Wr.nextSibling(a),o],function(e,t,n){var r,o=e.dom(),i=t.dom();return Bo.isText(o)&&Bo.isText(i)?(r=o.data.length,o.appendData(i.data),Di.remove(t),Di.remove(a),n.container()===i?Au(o,r):n):(Di.remove(a),n)}).orThunk(function(){return Di.remove(a),o}));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(pd).fold(function(){md(t,n,s)},function(e){md(t,n,A.some(e))})},vd=function(a,u){var e,t,n,r,o;return(e=a.getBody(),t=u,n=a.selection.getRng(),r=$c(t?1:-1,e,n),o=Au.fromRangeStart(r),!1===t&&Jc(o)?A.some(rd.remove(o.getNode(!0))):t&&Gc(o)?A.some(rd.remove(o.getNode())):ad(e,t,o)).map(function(e){return e.fold((o=a,i=u,function(e){return o._selectionOverrides.hideFakeCaret(),hd(o,i,er.fromDom(e)),!0}),(n=a,r=u,function(e){var t=r?Au.before(e):Au.after(e);return n.selection.setRng(t.toRange()),!0}),(t=a,function(e){return t.sel
ection.setRng(e.toRange()),!0}));var t,n,r,o,i}).getOr(!1)},bd=function(e,t){var n,r=e.selection.getNode();return!!Bo.isContentEditableFalse(r)&&(n=er.fromDom(e.getBody()),F(Xi(n,".mce-offscreen-selection"),Di.remove),hd(e,t,er.fromDom(e.selection.getNode())),kf(e),!0)},yd=function(e,t){return e.selection.isCollapsed()?vd(e,t):bd(e,t)},Cd=function(e){var t,n=function(e,t){for(;t&&t!==e;){if(Bo.isContentEditableTrue(t)||Bo.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return Bo.isContentEditableTrue(n)&&e.dom.isBlock(n)&&e.dom.isEmpty(n)&&(t=e.dom.create("br",{"data-mce-bogus":"1"}),e.dom.setHTML(n,""),n.appendChild(t),e.selection.setRng(Au.before(t).toRange())),!0},xd=Bo.isText,wd=function(e){return xd(e)&&e.data[0]===Sa},Nd=function(e){return xd(e)&&e.data[e.data.length-1]===Sa},Ed=function(e){return e.ownerDocument.createText
Node(Sa)},Sd=function(e,t){return e?function(e){if(xd(e.previousSibling))return Nd(e.previousSibling)||e.previousSibling.appendData(Sa),e.previousSibling;if(xd(e))return wd(e)||e.insertData(0,Sa),e;var t=Ed(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(xd(e.nextSibling))return wd(e.nextSibling)||e.nextSibling.insertData(0,Sa),e.nextSibling;if(xd(e))return Nd(e)||e.appendData(Sa),e;var t=Ed(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},Td=b(Sd,!0),kd=b(Sd,!1),Ad=function(e,t){return Bo.isText(e.container())?Sd(t,e.container()):Sd(t,e.getNode())},_d=function(e,t){var n=t.get();return n&&e.container()===n&&Ra(n)},Rd=function(n,e){return e.fold(function(e){us.remove(n.get());var t=Td(e);return n.set(t),A.some(Au(t,t.length-1))},function(e){return al.firstPositionIn(e).map(function(e){if(_d(e,n))return Au(n.get(),1);us.remove(n.get());var t=Ad(e,!0);return n.set(t),Au(t,1)})},function(e){return al.las
tPositionIn(e).map(function(e){if(_d(e,n))return Au(n.get(),n.get().length-1);us.remove(n.get());var t=Ad(e,!1);return n.set(t),Au(t,t.length-1)})},function(e){us.remove(n.get());var t=kd(e);return n.set(t),A.some(Au(t,1))})},Dd=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}return A.none()},Bd=nd([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),Od=function(e,t){var n=Fc(t,e);return n||e},Pd=function(e,t,n){var r=Sf.normalizeForwards(n),o=Od(t,r.container());return Sf.findRootInline(e,o,r).fold(function(){return al.nextPosition(o,r).bind(b(Sf.findRootInline,e,o)).map(function(e){return Bd.before(e)})},A.none)},Ld=function(e,t){return null===Ju(e,t)},Id=function(e,t,n){return Sf.findRootInline(e,t,n).filter(b(Ld,t))},Md=function(e,t,n){var r=Sf.normalizeBackwards(n);return Id(e,t,r).bind(function(e){return al.prevPosition(e,r).isNone()?A.some(Bd.start(e)):A.none()})}
,Fd=function(e,t,n){var r=Sf.normalizeForwards(n);return Id(e,t,r).bind(function(e){return al.nextPosition(e,r).isNone()?A.some(Bd.end(e)):A.none()})},Ud=function(e,t,n){var r=Sf.normalizeBackwards(n),o=Od(t,r.container());return Sf.findRootInline(e,o,r).fold(function(){return al.prevPosition(o,r).bind(b(Sf.findRootInline,e,o)).map(function(e){return Bd.after(e)})},A.none)},zd=function(e){return!1===Sf.isRtl(qd(e))},Vd=function(e,t,n){return Dd([Pd,Md,Fd,Ud],[e,t,n]).filter(zd)},qd=function(e){return e.fold(j,j,j,j)},Hd=function(e){return e.fold(H("before"),H("start"),H("end"),H("after"))},jd=function(e){return e.fold(Bd.before,Bd.before,Bd.after,Bd.after)},$d=function(n,e,r,t,o,i){return au([Sf.findRootInline(e,r,t),Sf.findRootInline(e,r,o)],function(e,t){return e!==t&&Sf.hasSameParentBlock(r,e,t)?Bd.after(n?e:t):i}).getOr(i)},Wd=function(e,r){return e.fold(H(!0),function(e){return n=r,!(Hd(t=e)===Hd(n)&&qd(t)===qd(n));var t,n
})},Kd=function(e,t){return e?t.fold(q(A.some,Bd.start),A.none,q(A.some,Bd.after),A.none):t.fold(A.none,q(A.some,Bd.before),A.none,q(A.some,Bd.end))},Xd=function(a,u,s,c){var e=Sf.normalizePosition(a,c),l=Vd(u,s,e);return Vd(u,s,e).bind(b(Kd,a)).orThunk(function(){return t=a,n=u,r=s,o=l,e=c,i=Sf.normalizePosition(t,e),al.fromPosition(t,r,i).map(b(Sf.normalizePosition,t)).fold(function(){return o.map(jd)},function(e){return Vd(n,r,e).map(b($d,t,n,r,i,e)).filter(b(Wd,o))}).filter(zd);var t,n,r,o,e,i})},Yd=Vd,Gd=Xd,Jd=(b(Xd,!1),b(Xd,!0),jd),Qd=function(e){return e.fold(Bd.start,Bd.start,Bd.end,Bd.end)},Zd=function(e){return O(e.selection.getSel().modify)},em=function(e,t,n){var r=e?1:-1;return t.setRng(Au(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},tm=function(e,t){var n=t.selection.getRng(),r=e?Au.fromRangeEnd(n):Au.fromRangeStart(n);return!!Zd(t)&&(e&&Oa(r)?em(!0,t.selection
,r):!(e||!Pa(r))&&em(!1,t.selection,r))},nm=function(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)},rm=function(e){return!1!==e.settings.inline_boundaries},om=function(e,t){e?t.setAttribute("data-mce-selected","inline-boundary"):t.removeAttribute("data-mce-selected")},im=function(t,e,n){return Rd(e,n).map(function(e){return nm(t,e),n})},am=function(e,t,n){return function(){return!!rm(t)&&tm(e,t)}},um={move:function(a,u,s){return function(){return!!rm(a)&&(t=a,n=u,e=s,r=t.getBody(),o=Au.fromRangeStart(t.selection.getRng()),i=b(Sf.isInlineTarget,t),Gd(e,i,r,o).bind(function(e){return im(t,n,e)})).isSome();var t,n,e,r,o,i}},moveNextWord:b(am,!0),movePrevWord:b(am,!1),setupSelectedState:function(a){var u=Oi(null),s=b(Sf.isInlineTarget,a);return a.on("NodeChange",function(e){var t,n,r,o,i;rm(a)&&(t=s,n=a.dom,r=e.parents,o=U(n.select('*[data-
mce-selected="inline-boundary"]'),t),i=U(r,t),F(Z(o,i),b(om,!1)),F(Z(i,o),b(om,!0)),function(e,t){if(e.selection.isCollapsed()&&!0!==e.composing&&t.get()){var n=Au.fromRangeStart(e.selection.getRng());Au.isTextPosition(n)&&!1===Sf.isAtZwsp(n)&&(nm(e,us.removeAndReposition(t.get(),n)),t.set(null))}}(a,u),function(n,r,o,e){if(r.selection.isCollapsed()){var t=U(e,n);F(t,function(e){var t=Au.fromRangeStart(r.selection.getRng());Yd(n,r.getBody(),t).bind(function(e){return im(r,o,e)})})}}(s,a,u,e.parents))}),u},setCaretPosition:nm},sm=function(t,n){return function(e){return Rd(n,e).map(function(e){return um.setCaretPosition(t,e),!0}).getOr(!1)}},cm=function(r,o,i,a){var u=r.getBody(),s=b(Sf.isInlineTarget,r);r.undoManager.ignore(function(){var e,t,n;r.selection.setRng((e=i,t=a,(n=document.createRange()).setStart(e.container(),e.offset()),n.setEnd(t.container(),t.offset()),n)),r.execCommand("Delete"),Yd(s,u,Au.fromRangeStart(r.selection.g
etRng())).map(Qd).map(sm(r,o))}),r.nodeChanged()},lm=function(n,r,i,o){var e,t,a=(e=n.getBody(),t=o.container(),Fc(t,e)||e),u=b(Sf.isInlineTarget,n),s=Yd(u,a,o);return s.bind(function(e){return i?e.fold(H(A.some(Qd(e))),A.none,H(A.some(Jd(e))),A.none):e.fold(A.none,H(A.some(Jd(e))),A.none,H(A.some(Qd(e))))}).map(sm(n,r)).getOrThunk(function(){var t=al.navigate(i,a,o),e=t.bind(function(e){return Yd(u,a,e)});return s.isSome()&&e.isSome()?Sf.findRootInline(u,a,o).map(function(e){return o=e,!!au([al.firstPositionIn(o),al.lastPositionIn(o)],function(e,t){var n=Sf.normalizePosition(!0,e),r=Sf.normalizePosition(!1,t);return al.nextPosition(o,n).map(function(e){return e.isEqual(r)}).getOr(!0)}).getOr(!0)&&(hd(n,i,er.fromDom(e)),!0);var o}).getOr(!1):e.bind(function(e){return t.map(function(e){return i?cm(n,r,o,e):cm(n,r,e,o),!0})}).getOr(!1)})},fm=function(e,t,n){if(e.selection.isCollapsed()&&!1!==e.settings.inline_boundaries){var r=Au.fromRangeStart(e.selection.getR
ng());return lm(e,t,n,r)}return!1},dm=Ar("start","end"),mm=Ar("rng","table","cells"),gm=nd([{removeTable:["element"]},{emptyCells:["cells"]}]),pm=function(e,t){return oa(er.fromDom(e),"td,th",t)},hm=function(e,t){return na(e,"table",t)},vm=function(e){return!1===Ur.eq(e.start(),e.end())},bm=function(e,n){return hm(e.start(),n).bind(function(t){return hm(e.end(),n).bind(function(e){return Ur.eq(t,e)?A.some(t):A.none()})})},ym=function(e){return Xi(e,"td,th")},Cm=function(r,e){var t=pm(e.startContainer,r),n=pm(e.endContainer,r);return e.collapsed?A.none():au([t,n],dm).fold(function(){return t.fold(function(){return n.bind(function(t){return hm(t,r).bind(function(e){return ee(ym(e)).map(function(e){return dm(e,t)})})})},function(t){return hm(t,r).bind(function(e){return te(ym(e)).map(function(e){return dm(t,e)})})})},function(e){return xm(r,e)?A.none():(n=r,hm((t=e).start(),n).bind(funct
ion(e){return te(ym(e)).map(function(e){return dm(t.start(),e)})}));var t,n})},xm=function(e,t){return bm(t,e).isSome()},wm=function(e,t){var n,r,o,i,a,u=(n=e,b(Ur.eq,n));return(r=t,o=u,i=pm(r.startContainer,o),a=pm(r.endContainer,o),au([i,a],dm).filter(vm).filter(function(e){return xm(o,e)}).orThunk(function(){return Cm(o,r)})).bind(function(e){return bm(t=e,u).map(function(e){return mm(t,e,ym(e))});var t})},Nm=function(e,t){return K(e,function(e){return Ur.eq(e,t)})},Em=function(n){return(r=n,au([Nm(r.cells(),r.rng().start()),Nm(r.cells(),r.rng().end())],function(e,t){return r.cells().slice(e,t+1)})).map(function(e){var t=n.cells();return e.length===t.length?gm.removeTable(n.table()):gm.emptyCells(e)});var r},Sm=function(e,t){return wm(e,t).bind(Em)},Tm=function(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},km=Tm,Am=function(e){return G(e,function(e){var t=nu(e);return t?[er.fromDom(t)]:[]})},_m=function(e){return 1<Tm(e).length},Rm=functi
on(e){return U(Am(e),Co)},Dm=function(e){return Xi(e,"td[data-mce-selected],th[data-mce-selected]")},Bm=function(e,t){var n=Dm(t),r=Rm(e);return 0<n.length?n:r},Om=Bm,Pm=function(e){return Bm(km(e.selection.getSel()),er.fromDom(e.getBody()))},Lm=function(e,t){return F(t,ef),e.selection.setCursorLocation(t[0].dom(),0),!0},Im=function(e,t){return hd(e,!1,t),!0},Mm=function(n,e,r,t){return Um(e,t).fold(function(){return t=n,Sm(e,r).map(function(e){return e.fold(b(Im,t),b(Lm,t))});var t},function(e){return zm(n,e)}).getOr(!1)},Fm=function(e,t){return V(jf(t,e),Co)},Um=function(e,t){return V(jf(t,e),function(e){return"caption"===sr.name(e)})},zm=function(e,t){return ef(t),e.selection.setCursorLocation(t.dom(),0),A.some(!0)},Vm=function(u,s,c,l,f){return al.navigate(c,u.getBody(),f).bind(function(e){return r=l,o=c,i=f,a=e,al.firstPositionIn(r.dom()).bind(function(t){return al.lastPositionIn(r.dom()).map(function(e){return o?i.isEqual(t)&&a.isEqual(e):i.isEqu
al(e)&&a.isEqual(t)})}).getOr(!0)?zm(u,l):(t=l,n=e,Um(s,er.fromDom(n.getNode())).map(function(e){return!1===Ur.eq(e,t)}));var t,n,r,o,i,a}).or(A.some(!0))},qm=function(a,u,s,e){var c=Au.fromRangeStart(a.selection.getRng());return Fm(s,e).bind(function(e){return Lf(e)?zm(a,e):(t=a,n=s,r=u,o=e,i=c,al.navigate(r,t.getBody(),i).bind(function(e){return Fm(n,er.fromDom(e.getNode())).map(function(e){return!1===Ur.eq(e,o)})}));var t,n,r,o,i})},Hm=function(a,u,e){var s=er.fromDom(a.getBody());return Um(s,e).fold(function(){return qm(a,u,s,e)},function(e){return t=a,n=u,r=s,o=e,i=Au.fromRangeStart(t.selection.getRng()),Lf(o)?zm(t,o):Vm(t,r,n,o,i);var t,n,r,o,i}).getOr(!1)},jm=function(e,t){var n,r,o,i,a,u=er.fromDom(e.selection.getStart(!0)),s=Pm(e);return e.selection.isCollapsed()&&0===s.length?Hm(e,t,u):(n=e,r=u,o=er.fromDom(n.getBody()),i=n.selection.getRng(),0!==(a=Pm(n)).length?Lm(n,a):Mm(n,o,i,r))},$m=function(e,t){e.getDoc().execCommand(t,!1,null)},Wm=function(e){yd(e,!
1)||fm(e,!1)||Jf(e,!1)||jm(e)||td(e,!1)||($m(e,"Delete"),kf(e))},Km=function(e){yd(e,!0)||fm(e,!0)||Jf(e,!0)||jm(e)||td(e,!0)||$m(e,"ForwardDelete")},Xm=function(s){return function(u,e){return A.from(e).map(er.fromDom).filter(sr.isElement).bind(function(e){return(r=s,o=u,i=e.dom(),a=function(e){return kr(e,r)},ea.closest(er.fromDom(i),function(e){return a(e).isSome()},function(e){return Ur.eq(er.fromDom(o),e)}).bind(a)).or((t=s,n=e.dom(),A.from(hi.DOM.getStyle(n,t,!0))));var t,n,r,o,i,a}).getOr("")}},Ym={getFontSize:Xm("font-size"),getFontFamily:q(function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},Xm("font-family")),toPt:function(e,t){return/[0-9.]+px$/.test(e)?(n=72*parseInt(e,10)/96,r=t||0,o=Math.pow(10,r),Math.round(n*o)/o+"pt"):e;var n,r,o}},Gm=function(e){return al.firstPositionIn(e.getBody()).map(function(e){var t=e.container();return Bo.isText(t)?t.parentNode:t})},Jm=function(
o){return A.from(o.selection.getRng()).bind(function(e){var t,n,r=o.getBody();return n=r,(t=e).startContainer===n&&0===t.startOffset?A.none():A.from(o.selection.getStart(!0))})},Qm=function(e,t){if(/^[0-9\.]+$/.test(t)){var n=parseInt(t,10);if(1<=n&&n<=7){var r=cc(e),o=lc(e);return o?o[n-1]||t:r[n-1]||t}return t}return t},Zm=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},eg=function(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(e,t,n)},tg=function(e,t,n){return eg(e,t,function(e){return e.nodeName===n})},ng=function(e){return e&&"TABLE"===e.nodeName},rg=function(e,t,n){for(var r=new io(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(Bo.isBr(t))return!0},og=function(e,t,n,r,o){var i,a,u,s,c
,l,f=e.getRoot(),d=e.schema.getNonEmptyElements();if(u=e.getParent(o.parentNode,e.isBlock)||f,r&&Bo.isBr(o)&&t&&e.isEmpty(u))return A.some(Su(o.parentNode,e.nodeIndex(o)));for(i=new io(o,u);s=i[r?"prev":"next"]();){if("false"===e.getContentEditableParent(s)||(l=f,Da(c=s)&&!1===eg(c,l,Gu)))return A.none();if(Bo.isText(s)&&0<s.nodeValue.length)return!1===tg(s,f,"A")?A.some(Su(s,r?s.nodeValue.length:0)):A.none();if(e.isBlock(s)||d[s.nodeName.toLowerCase()])return A.none();a=s}return n&&a?A.some(Su(a,0)):A.none()},ig=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g=e.getRoot(),p=!1;if(o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"],l=Bo.isElement(o)&&i===o.childNodes.length,s=e.schema.getNonEmptyElements(),c=n,Da(o))return A.none();if(Bo.isElement(o)&&i>o.childNodes.length-1&&(c=!1),Bo.isDocument(o
)&&(o=g,i=0),o===g){if(c&&(u=o.childNodes[0<i?i-1:0])){if(Da(u))return A.none();if(s[u.nodeName]||ng(u))return A.none()}if(o.hasChildNodes()){if(i=Math.min(!c&&0<i?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=Bo.isText(o)&&l?o.data.length:0,!t&&o===g.lastChild&&ng(o))return A.none();if(function(e,t){for(;t&&t!==e;){if(Bo.isContentEditableFalse(t))return!0;t=t.parentNode}return!1}(g,o)||Da(o))return A.none();if(o.hasChildNodes()&&!1===ng(o)){a=new io(u=o,g);do{if(Bo.isContentEditableFalse(u)||Da(u)){p=!1;break}if(Bo.isText(u)&&0<u.nodeValue.length){i=c?0:u.nodeValue.length,o=u,p=!0;break}if(s[u.nodeName.toLowerCase()]&&(!(f=u)||!/^(TD|TH|CAPTION)$/.test(f.nodeName))){i=e.nodeIndex(u),o=u.parentNode,c||i++,p=!0;break}}while(u=c?a.next():a.prev())}}}return t&&(Bo.isText(o)&&0===i&&og(e,l,t,!0,o).each(function(e){o=e.container(),i=e.offset(),p=!0}),Bo.isElement(o)&&am
p;((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!Bo.isBr(u)||(m="A",(d=u).previousSibling&&d.previousSibling.nodeName===m)||rg(e,u,!1)||rg(e,u,!0)||og(e,l,t,!0,u).each(function(e){o=e.container(),i=e.offset(),p=!0}))),c&&!t&&Bo.isText(o)&&i===o.nodeValue.length&&og(e,l,t,!1,o).each(function(e){o=e.container(),i=e.offset(),p=!0}),p?A.some(Su(o,i)):A.none()},ag=function(e,t){var n=t.collapsed,r=t.cloneRange(),o=Su.fromRangeStart(t);return ig(e,n,!0,r).each(function(e){n&&Su.isAbove(o,e)||r.setStart(e.container(),e.offset())}),n||ig(e,n,!1,r).each(function(e){r.setEnd(e.container(),e.offset())}),n&&r.collapse(!0),Zm(t,r)?A.none():A.some(r)},ug=function(e,t,n){var r=e.create("span",{}," ");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},sg=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),t.setRng(o)},cg=func
tion(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();ag(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u=a.startOffset,s=a.startContainer;if(1===s.nodeType&&s.hasChildNodes()){var c=u>s.childNodes.length-1;s=s.childNodes[Math.min(u,s.childNodes.length-1)]||s,u=c&&3===s.nodeType?s.nodeValue.length:0}var l=i.getParent(s,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=t&&t.ctrlKey;"LI"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&(function(e,t,n){for(var r,o=new io(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0<r.length)return!0}(e.schema,s,l)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),a.insertNode(n),ug(i,o,n),sg(i,o,n,r),e.undoManager.add()},lg=function(e,t){var n=er.fromTag("br");ki.be
fore(er.fromDom(t),n),e.undoManager.add()},fg=function(e,t){dg(e.getBody(),t)||ki.after(er.fromDom(t),er.fromTag("br"));var n=er.fromTag("br");ki.after(er.fromDom(t),n),ug(e.dom,e.selection,n.dom()),sg(e.dom,e.selection,n.dom(),!1),e.undoManager.add()},dg=function(e,t){return n=Au.after(t),!!Bo.isBr(n.getNode())||al.nextPosition(e,Au.after(t)).map(function(e){return Bo.isBr(e.getNode())}).getOr(!1);var n},mg=function(e){return e&&"A"===e.nodeName&&"href"in e},gg=function(e){return e.fold(H(!1),mg,mg,H(!1))},pg=function(e,t){t.fold(v,b(lg,e),b(fg,e),v)},hg=function(e,t){var n,r,o,i=(n=e,r=b(Sf.isInlineTarget,n),o=Au.fromRangeStart(n.selection.getRng()),Yd(r,n.getBody(),o).filter(gg));i.isSome()?i.each(b(pg,e)):cg(e,t)},vg=nd([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),bg=(vg.before,vg.on,vg.after,function(e){return e.fold(j,j,j)}),yg=nd([{domRange:["rng"
]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),Cg=Ar("start","soffset","finish","foffset"),xg={domRange:yg.domRange,relative:yg.relative,exact:yg.exact,exactFromRange:function(e){return yg.exact(e.start(),e.soffset(),e.finish(),e.foffset())},range:Cg,getWin:function(e){var t=e.match({domRange:function(e){return er.fromDom(e.startContainer)},relative:function(e,t){return bg(e)},exact:function(e,t,n,r){return e}});return Wr.defaultView(t)}},wg=Qn.detect().browser,Ng=function(e,t){var n=sr.isText(t)?Il(t).length:Wr.children(t).length+1;return n<e?n:e<0?0:e},Eg=function(e){return xg.range(e.start(),Ng(e.soffset(),e.start()),e.finish(),Ng(e.foffset(),e.finish()))},Sg=function(e,t){return Ur.contains(e,t)||Ur.eq(e,t)},Tg=function(t){return function(e){return Sg(t,e.start())&&Sg(t,e.finish())}},kg=function(e){return!0===e.inline||wg.is
IE()},Ag=function(e){return xg.range(er.fromDom(e.startContainer),e.startOffset,er.fromDom(e.endContainer),e.endOffset)},_g=function(e){var t=e.getSelection();return(t&&0!==t.rangeCount?A.from(t.getRangeAt(0)):A.none()).map(Ag)},Rg=function(e){var t=Wr.defaultView(e);return _g(t.dom()).filter(Tg(e))},Dg=function(e,t){return A.from(t).filter(Tg(e)).map(Eg)},Bg=function(e){var t=document.createRange();try{return t.setStart(e.start().dom(),e.soffset()),t.setEnd(e.finish().dom(),e.foffset()),A.some(t)}catch(n){return A.none()}},Og=function(e){return(e.bookmark?e.bookmark:A.none()).bind(b(Dg,er.fromDom(e.getBody()))).bind(Bg)},Pg=function(e){var t=kg(e)?Rg(er.fromDom(e.getBody())):A.none();e.bookmark=t.isSome()?t:e.bookmark},Lg=function(t){Og(t).each(function(e){t.selection.setRng(e)})},Ig=Og,Mg=function(e,t){var n=e.settings,r=e.dom,o=e.selection,i=e.formatter,a=/[a-z%]+$/i.exec(n.indentation)[0],u=parseInt(n.indentation,10),s=e.getParam("indent_use_margin",!1);e.query
CommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||(n.forced_root_block||r.getParent(o.getNode(),r.isBlock)||i.apply("div"),F(o.getSelectedBlocks(),function(e){return function(e,t,n,r,o,i){if("false"!==e.getContentEditable(i)&&"LI"!==i.nodeName){var a=n?"margin":"padding";if(a="TABLE"===i.nodeName?"margin":a,a+="rtl"===e.getStyle(i,"direction",!0)?"Right":"Left","outdent"===t){var u=Math.max(0,parseInt(i.style[a]||0,10)-r);e.setStyle(i,a,u?u+o:"")}else u=parseInt(i.style[a]||0,10)+r+o,e.setStyle(i,a,u)}}(r,t,s,u,a,e)}))},Fg=Yt.each,Ug=Yt.extend,zg=Yt.map,Vg=Yt.inArray;function qg(s){var o,i,a,t,c={state:{},exec:{},value:{}},n=s.settings;s.on("PreInit",function(){o=s.dom,i=s.selection,n=s.settings,a=s.formatter});var r=function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toL
owerCase(),t=c.state[e])return t(e);try{return s.getDoc().queryCommandState(e)}catch(n){}return!1}},e=function(e,n){n=n||"exec",Fg(e,function(t,e){Fg(e.toLowerCase().split(","),function(e){c[n][e]=t})})},u=function(e,t,n){e=e.toLowerCase(),c.value[e]=function(){return t.call(n||s)}};Ug(this,{execCommand:function(t,n,r,e){var o,i,a=!1;if(!s.removed){if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||e&&e.skip_focus?Lg(s):s.focus(),(e=s.fire("BeforeExecCommand",{command:t,ui:n,value:r})).isDefaultPrevented())return!1;if(i=t.toLowerCase(),o=c.exec[i])return o(i,n,r),s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;if(Fg(s.plugins,function(e){if(e.execCommand&&e.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!(a=!0)}),a)return a;if(s.theme&&s.theme.execCommand&&s.theme.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!
0;try{a=s.getDoc().execCommand(t,n,r)}catch(u){}return!!a&&(s.fire("ExecCommand",{command:t,ui:n,value:r}),!0)}},queryCommandState:r,queryCommandValue:function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=c.value[e])return t(e);try{return s.getDoc().queryCommandValue(e)}catch(n){}}},queryCommandSupported:function(e){if(e=e.toLowerCase(),c.exec[e])return!0;try{return s.getDoc().queryCommandSupported(e)}catch(t){}return!1},addCommands:e,addCommand:function(e,o,i){e=e.toLowerCase(),c.exec[e]=function(e,t,n,r){return o.call(i||s,t,n,r)}},addQueryStateHandler:function(e,t,n){e=e.toLowerCase(),c.state[e]=function(){return t.call(n||s)}},addQueryValueHandler:u,hasCustomCommand:function(e){return e=e.toLowerCase(),!!c.exec[e]}});var l=function(e,t,n){return t===undefined&&(t=!1),n===undefined&&(n=null),s.getDoc().execCommand(e,t,n)},f=function(e){return a.match(e)},d=function(e,t){a.toggle(e,t?{value:t}:undefined),s.nodeChang
ed()},m=function(e){t=i.getBookmark(e)},g=function(){i.moveToBookmark(t)};e({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){s.undoManager.add()},"Cut,Copy,Paste":function(e){var t,n=s.getDoc();try{l(e)}catch(o){t=!0}if("paste"!==e||n.queryCommandEnabled(e)||(t=!0),t||!n.queryCommandSupported(e)){var r=s.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");Re.mac&&(r=r.replace(/Ctrl\+/g,"\u2318+")),s.notificationManager.open({text:r,type:"error"})}},unlink:function(){if(i.isCollapsed()){var e=s.dom.getParent(s.selection.getStart(),"a");e&&s.dom.remove(e,!0)}else a.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"===t&&(t="justify"),Fg("left,cent
er,right,justify".split(","),function(e){t!==e&&a.remove("align"+e)}),"none"!==t&&d("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;l(e),(t=o.getParent(i.getNode(),"ol,ul"))&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(m(),o.split(n,t),g()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){d(e)},"ForeColor,HiliteColor":function(e,t,n){d(e,n)},FontName:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontname",{value:Qm(r,o)}),r.nodeChanged()},FontSize:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontsize",{value:Qm(r,o)}),r.nodeChanged()},RemoveFormat:function(e){a.remove(e)},mceBlockQuote:function(){d("blockquote")},FormatBlock:function(e,t,n){return d(n||"p")},mceCleanup:function(){var e=i.getBookmark();s.setContent(s.getContent()),i.moveToBookmark(e)}
,mceRemoveNode:function(e,t,n){var r=n||i.getNode();r!==s.getBody()&&(m(),s.dom.remove(r,!0),g())},mceSelectNodeDepth:function(e,t,n){var r=0;o.getParent(i.getNode(),function(e){if(1===e.nodeType&&r++===n)return i.select(e),!1},s.getBody())},mceSelectNode:function(e,t,n){i.select(n)},mceInsertContent:function(e,t,n){lf(s,n)},mceInsertRawHTML:function(e,t,n){var r=s.getContent();i.setContent("tiny_mce_marker"),s.setContent(r.replace(/tiny_mce_marker/g,function(){return n}))},mceToggleFormat:function(e,t,n){d(n)},mceSetContent:function(e,t,n){s.setContent(n)},"Indent,Outdent":function(e){Mg(s,e)},mceRepaint:function(){},InsertHorizontalRule:function(){s.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){s.hasVisual=!s.hasVisual,s.addVisual()},mceReplaceContent:function(e,t,n){s.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInser
tLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=o.getParent(i.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||a.remove("link"),n.href&&a.apply("link",n,r)},selectAll:function(){var e=o.getParent(i.getStart(),Bo.isContentEditableTrue);if(e){var t=o.createRng();t.selectNodeContents(e),i.setRng(t)}},"delete":function(){Wm(s)},forwardDelete:function(){Km(s)},mceNewDocument:function(){s.setContent("")},InsertLineBreak:function(e,t,n){return hg(s,n),!0}});var p=function(n){return function(){var e=i.isCollapsed()?[o.getParent(i.getNode(),o.isBlock)]:i.getSelectedBlocks(),t=zg(e,function(e){return!!a.matchNode(e,n)});return-1!==Vg(t,!0)}};e({JustifyLeft:p("alignleft"),JustifyCenter:p("aligncenter"),JustifyRight:p("alignright"),JustifyFull:p("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript"
;:function(e){return f(e)},mceBlockQuote:function(){return f("blockquote")},Outdent:function(){var e;if(n.inline_styles){if((e=o.getParent(i.getStart(),o.isBlock))&&0<parseInt(e.style.paddingLeft,10))return!0;if((e=o.getParent(i.getEnd(),o.isBlock))&&0<parseInt(e.style.paddingLeft,10))return!0}return r("InsertUnorderedList")||r("InsertOrderedList")||!n.inline_styles&&!!o.getParent(i.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=o.getParent(i.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),e({Undo:function(){s.undoManager.undo()},Redo:function(){s.undoManager.redo()}}),u("FontName",function(){return Jm(t=s).fold(function(){return Gm(t).map(function(e){return Ym.getFontFamily(t.getBody(),e)}).getOr
("")},function(e){return Ym.getFontFamily(t.getBody(),e)});var t},this),u("FontSize",function(){return Jm(t=s).fold(function(){return Gm(t).map(function(e){return Ym.getFontSize(t.getBody(),e)}).getOr("")},function(e){return Ym.getFontSize(t.getBody(),e)});var t},this)}var Hg=Yt.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," "),jg=function(a){var u,s,c=this,l={},f=function(){return!1},d=function(){return!0};u=(a=a||{}).scope||c,s=a.toggleEvent||f;var r=function(e,t,n,r){var o,i,a;if(!1===t&&(t=f),t)for(t={func:t},r&&Yt.extend(t,r),a=(i=e.toLowerCase().split(" ")).length;a--;)e=i[a],(o=l[e])||(o=l[e]=[]
,s(e,!0)),n?o.unshift(t):o.push(t);return c},m=function(e,t){var n,r,o,i,a;if(e)for(n=(i=e.toLowerCase().split(" ")).length;n--;){if(e=i[n],r=l[e],!e){for(o in l)s(o,!1),delete l[o];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0,a).concat(r.slice(a+1)),l[e]=r);else r.length=0;r.length||(s(e,!1),delete l[e])}}else{for(e in l)s(e,!1);l={}}return c};c.fire=function(e,t){var n,r,o,i;if(e=e.toLowerCase(),(t=t||{}).type=e,t.target||(t.target=u),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=d},t.stopPropagation=function(){t.isPropagationStopped=d},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=d},t.isDefaultPrevented=f,t.isPropagationStopped=f,t.isImmediatePropagationStopped=f),a.beforeFire&&a.beforeFire(t),n=l[e])for(r=0,o=n.length;r<o;r++){if((i=n[r]).once&&m(e,i.func),t.isImmediatePropagationStopped())return t.stopPropagation(),t;if(!1===i.func.call(u,t))return t.preventDefault(),t}ret
urn t},c.on=r,c.off=m,c.once=function(e,t,n){return r(e,t,n,{once:!0})},c.has=function(e){return e=e.toLowerCase(),!(!l[e]||0===l[e].length)}};jg.isNative=function(e){return!!Hg[e.toLowerCase()]};var $g,Wg=function(n){return n._eventDispatcher||(n._eventDispatcher=new jg({scope:n,toggleEvent:function(e,t){jg.isNative(e)&&n.toggleNativeEvent&&n.toggleNativeEvent(e,t)}})),n._eventDispatcher},Kg={fire:function(e,t,n){if(this.removed&&"remove"!==e)return t;if(t=Wg(this).fire(e,t,n),!1!==n&&this.parent)for(var r=this.parent();r&&!t.isPropagationStopped();)r.fire(e,t,!1),r=r.parent();return t},on:function(e,t,n){return Wg(this).on(e,t,n)},off:function(e,t){return Wg(this).off(e,t)},once:function(e,t){return Wg(this).once(e,t)},hasEventListeners:function(e){return Wg(this).has(e)}},Xg=function(e,t){return e.fire("PreProcess",t)},Yg=function(e,t){return e.fire("PostProcess",t)},Gg=function(e){return e.fire("remove&qu
ot;)},Jg=function(e,t){return e.fire("SwitchMode",{mode:t})},Qg=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},Zg=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},ep=function(e,t,n){try{e.getDoc().execCommand(t,!1,n)}catch(r){}},tp=function(e,t){var n,r,o;n=er.fromDom(e.getBody()),r="mce-content-readonly",o=t,Ki.has(n,r)&&!1===o?Ki.remove(n,r):o&&Ki.add(n,r),t?(e.selection.controlSelection.hideResizeRect(),e.readonly=!0,e.getBody().contentEditable="false"):(e.readonly=!1,e.getBody().contentEditable="true",ep(e,"StyleWithCSS",!1),ep(e,"enableInlineTableEditing",!1),ep(e,"enableObjectResizing",!1),e.focus(),e.nodeChanged())},np=function(e){return e.readonly?"readonly":"design"},rp=hi.DOM,op=function(e,t){return"selectionchange"===t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|drag
over|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=rp.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()},ip=function(e,t,n){var r;(r=e).hidden||r.readonly?!0===e.readonly&&n.preventDefault():e.fire(t,n)},ap=function(i,a){var e,t;if(i.delegates||(i.delegates={}),!i.delegates[a]&&!i.removed)if(e=op(i,a),i.settings.event_root){if($g||($g={},i.editorManager.on("removeEditor",function(){var e;if(!i.editorManager.activeEditor&&$g){for(e in $g)i.dom.unbind(op(i,e));$g=null}})),$g[a])return;t=function(e){for(var t=e.target,n=i.editorManager.get(),r=n.length;r--;){var o=n[r].getBody();(o===t||rp.isChildOf(t,o))&&ip(n[r],a,e)}},$g[a]=t,rp.bind(e,a,t)}else t=function(e){ip(i,a,e)},rp.bind(e,a,t),i.delegates[a]=t},up={bindPendingEventDelegates:function(){var t=this;Yt.each(t._pendingNativeEvents,function(e){ap(t,e)})},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"b
lur"!==e&&(t?n.initialized?ap(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(op(n,e),e,n.delegates[e]),delete n.delegates[e]))},unbindAllNativeEvents:function(){var e,t=this,n=t.getBody(),r=t.dom;if(t.delegates){for(e in t.delegates)t.dom.unbind(op(t,e),e,t.delegates[e]);delete t.delegates}!t.inline&&n&&r&&(n.onload=null,r.unbind(t.getWin()),r.unbind(t.getDoc())),r&&(r.unbind(n),r.unbind(t.getContainer()))}},sp=up=Yt.extend({},Kg,up),cp=Yt.each,lp=Yt.explode,fp={f9:120,f10:121,f11:122},dp=Yt.makeMap("alt,ctrl,shift,meta,access");function mp(i){var a={},r=[],u=function(e){var t,n,r={};for(n in cp(lp(e,"+"),function(e){e in dp?r[e]=!0:/^[0-9]{2,}$/.test(e)?r.keyCode=parseInt(e,10):(r.charCode=e.charCodeAt(0),r.keyCode=fp[e]||e.toUpperCase().charCodeAt(0))}),t=[r.keyCode],dp)r[n]?t.push(n):r[n]=!1;return r.id=t.join(","),r.access&&am
p;(r.alt=!0,Re.mac?r.ctrl=!0:r.shift=!0),r.meta&&(Re.mac?r.meta=!0:(r.ctrl=!0,r.meta=!1)),r},s=function(e,t,n,r){var o;return(o=Yt.map(lp(e,">"),u))[o.length-1]=Yt.extend(o[o.length-1],{func:n,scope:r||i}),Yt.extend(o[0],{desc:i.translate(t),subpatterns:o.slice(1)})},o=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},c=function(e){return e.func?e.func.call(e.scope):null};i.on("keyup keypress keydown",function(t){var e,n;((n=t).altKey||n.ctrlKey||n.metaKey||"keydown"===(e=t).type&&112<=e.keyCode&&e.keyCode<=123)&&!t.isDefaultPrevented()&&(cp(a,function(e){if(o(t,e))return r=e.subpatterns.slice(0),"keydown"===t.type&&c(e),!0}),o(t,r[0])&&(1===r.length&&"keydown"===t.
type&&c(r[0]),r.shift()))}),this.add=function(e,n,r,o){var t;return"string"==typeof(t=r)?r=function(){i.execCommand(t,!1,null)}:Yt.isArray(t)&&(r=function(){i.execCommand(t[0],t[1],t[2])}),cp(lp(Yt.trim(e.toLowerCase())),function(e){var t=s(e,n,r,o);a[t.id]=t}),!0},this.remove=function(e){var t=s(e);return!!a[t.id]&&(delete a[t.id],!0)}}var gp=function(e){var t=e!==undefined?e.dom():document;return A.from(t.activeElement).map(er.fromDom)},pp=function(e){var t=Wr.owner(e).dom();return e.dom()===t.activeElement},hp=function(t){return gp(Wr.owner(t)).filter(function(e){return t.dom().contains(e.dom())})},vp=function(t,e){return(n=e,n.collapsed?A.from(ru(n.startContainer,n.startOffset)).map(er.fromDom):A.none()).bind(function(e){return yo(e)?A.some(e):!1===Ur.contains(t,e)?A.some(t):A.none()});var n},bp=function(t,e){vp(er.fromDom(t.getBody()),e).bind(function(e){return al.firstPositionIn(e.dom())}).fold(function(){t.selection.normalize()},function(e){r
eturn t.selection.setRng(e.toRange())})},yp=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},Cp=function(e){var t,n=e.getBody();return n&&(t=er.fromDom(n),pp(t)||hp(t).isSome())},xp=function(e){return e.inline?Cp(e):(t=e).iframeElement&&pp(er.fromDom(t.iframeElement));var t},wp=function(e){return e.editorManager.setActive(e)},Np=function(e,t){e.removed||(t?wp(e):function(t){var e=t.selection,n=t.settings.content_editable,r=t.getBody(),o=e.getRng();t.quirks.refreshContentEditable();var i,a,u=(i=t,a=e.getNode(),i.dom.getParent(a,function(e){return"true"===i.dom.getContentEditable(e)}));if(t.$.contains(r,u))return yp(u),bp(t,o),wp(t);t.bookmark!==undefined&&!1===xp(t)&&Ig(t).each(function(e){t.selection.setRng(e),o=e}),n||(Re.opera||yp(r),t.getWin().focus()),(Re.gecko||n)&&(yp(r),bp(t,o)),wp(t)}(e))},Ep=xp,Sp=function(e,t){return t.dom()[e]},Tp=function(e,t){return parseInt(Tr(t,e),10)},kp=b(Sp,"clien
tWidth"),Ap=b(Sp,"clientHeight"),_p=b(Tp,"margin-top"),Rp=b(Tp,"margin-left"),Dp=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m=er.fromDom(e.getBody()),g=e.inline?m:Wr.documentElement(m),p=(r=e.inline,i=t,a=n,u=(o=g).dom().getBoundingClientRect(),{x:i-(r?u.left+o.dom().clientLeft+Rp(o):0),y:a-(r?u.top+o.dom().clientTop+_p(o):0)});return c=p.x,l=p.y,f=kp(s=g),d=Ap(s),0<=c&&0<=l&&c<=f&&l<=d},Bp=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return(t=n,A.from(t).map(er.fromDom)).map(function(e){return Ur.contains(Wr.owner(e),e)}).getOr(!1)};function Op(n){var t,o=[],i=function(){var e,t=n.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},a=function(){0<o.length&&i().reposition(o)},u=function(t){K(o,function(e){retur
n e===t}).each(function(e){o.splice(e,1)})},r=function(r){if(!n.removed&&Bp(n))return V(o,function(e){return t=i().getArgs(e),n=r,!(t.type!==n.type||t.text!==n.text||t.progressBar||t.timeout||n.progressBar||n.timeout);var t,n}).getOrThunk(function(){n.editorManager.setActive(n);var e,t=i().open(r,function(){u(t),a()});return e=t,o.push(e),a(),t})};return(t=n).on("SkinLoaded",function(){var e=t.settings.service_message;e&&r({text:e,type:"warning",timeout:0,icon:""})}),t.on("ResizeEditor ResizeWindow",function(){Le.requestAnimationFrame(a)}),t.on("remove",function(){F(o,function(e){i().close(e)})}),{open:r,close:function(){A.from(o[0]).each(function(e){i().close(e),u(e),a()})},getNotifications:function(){return o}}}function Pp(r){var o=[],i=function(){var e,t=r.theme;return t&&t.getWindowManagerImpl?t.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementa
tion.")},alert:e,confirm:e,close:e,getParams:e,setParams:e}},a=function(e,t){return function(){return t?t.apply(e,arguments):undefined}},u=function(e){var t;o.push(e),t=e,r.fire("OpenWindow",{win:t})},s=function(n){K(o,function(e){return e===n}).each(function(e){var t;o.splice(e,1),t=n,r.fire("CloseWindow",{win:t}),0===o.length&&r.focus()})},e=function(){return A.from(o[o.length-1])};return r.on("remove",function(){F(o.slice(0),function(e){i().close(e)})}),{windows:o,open:function(e,t){r.editorManager.setActive(r),Pg(r);var n=i().open(e,t,s);return u(n),n},alert:function(e,t,n){var r=i().alert(e,a(n||this,t),s);u(r)},confirm:function(e,t,n){var r=i().confirm(e,a(n||this,t),s);u(r)},close:function(){e().each(function(e){i().close(e),s(e)})},getParams:function(){return e().map(i().getParams).getOr(null)},setParams:function(t){e().each(function(e){i().setParams(e,t)})},getWindows:function(){return o}}}var Lp=Ei.PluginManager,Ip=function(e,t){v
ar n=function(e,t){for(var n in Lp.urls)if(Lp.urls[n]+"/plugin"+t+".js"===e)return n;return null}(t,e.suffix);return n?"Failed to load plugin: "+n+" from url "+t:"Failed to load plugin url: "+t},Mp=function(e,t){e.notificationManager.open({type:"error",text:t})},Fp=function(e,t){e._skinLoaded?Mp(e,t):e.on("SkinLoaded",function(){Mp(e,t)})},Up=function(e,t){Fp(e,Ip(e,t))},zp=function(e,t){Fp(e,"Failed to upload image: "+t)},Vp=Fp,qp=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,arguments):r.log.apply(r,arguments))},Hp=Ei.PluginManager,jp=Ei.ThemeManager;function $p(){return new(ie.getOrDie("XMLHttpRequest"))}function Wp(u,s){var r={},n=function(e,r,o,t){var i,n;(i=new $p).open("POST",s.url),i.withCredentials=s.credentials,i.upload.onprogress=function(e){t(e.loaded/e.total*100)},i.onerror=function(){o(
"Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var e,t,n;i.status<200||300<=i.status?o("HTTP Error: "+i.status):(e=JSON.parse(i.responseText))&&"string"==typeof e.location?r((t=s.basePath,n=e.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):o("Invalid JSON: "+i.responseText)},(n=new FormData).append("file",e.blob(),e.filename()),i.send(n)},c=function(e,t){return{url:t,blobInfo:e,status:!0}},l=function(e,t){return{url:"",blobInfo:e,status:!1,error:t}},f=function(e,t){Yt.each(r[e],function(e){e(t)}),delete r[e]},o=function(e,n){return e=Yt.grep(e,function(e){return!u.isUploaded(e.blobUri())}),De.all(Yt.map(e,function(e){return u.isPending(e.blobUri())?(t=e.blobUri(),new De(function(e){r[t]=r[t]||[],r[t].push(e)})):(o=e,i=s.handler,a=n,u.markPending(o.blobUri()),new De(function(t){var n;try{var r=function(){n&&n.close()};i(
o,function(e){r(),u.markUploaded(o.blobUri(),e),f(o.blobUri(),c(o,e)),t(c(o,e))},function(e){r(),u.removeFailed(o.blobUri()),f(o.blobUri(),l(o,e)),t(l(o,e))},function(e){e<0||100<e||(n||(n=a()),n.progressBar.value(e))})}catch(e){t(l(o,e.message))}}));var o,i,a,t}))};return s=Yt.extend({credentials:!1,handler:n},s),{upload:function(e,t){return s.url||s.handler!==n?o(e,t):new De(function(e){e([])})}}}function Kp(e,t){return new(ie.getOrDie("Blob"))(e,t)}function Xp(){return new(ie.getOrDie("FileReader"))}function Yp(e){return new(ie.getOrDie("Uint8Array"))(e)}var Gp=function(e){return ie.getOrDie("atob")(e)},Jp=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},Qp=function(e){return 0===e.indexOf("blob:")?(i=e,new De(function(e,t){var n=function(){t("Cannot convert "+i+" to Blob. Resource might not exist or is inaccessible.&quo
t;)};try{var r=new $p;r.open("GET",i,!0),r.responseType="blob",r.onload=function(){200===this.status?e(this.response):n()},r.onerror=n,r.send()}catch(o){n()}})):0===e.indexOf("data:")?(o=e,new De(function(e){var t,n,r;o=Jp(o);try{t=Gp(o.data)}catch(Kw){return void e(new Kp([]))}for(n=new Yp(t.length),r=0;r<n.length;r++)n[r]=t.charCodeAt(r);e(new Kp([n],{type:o.type}))})):null;var i,o},Zp=function(n){return new De(function(e){var t=new Xp;t.onloadend=function(){e(t.result)},t.readAsDataURL(n)})},eh=Jp,th=0,nh=function(e){return(e||"blobid")+th++},rh=function(n,r,o,t){var i,a;0!==r.src.indexOf("blob:")?(i=eh(r.src).data,(a=n.findFirst(function(e){return e.base64()===i}))?o({image:r,blobInfo:a}):Qp(r.src).then(function(e){a=n.create(nh(),e,i),n.add(a),o({image:r,blobInfo:a})},function(e){t(e)})):(a=n.getByUri(r.src))?o({image:r,blobInfo:a}):Qp(r.src).then(function(t){Zp(t).then(function(e){i=eh(e).data,a=n.create(nh(),t,i),n.add(a),o
({image:r,blobInfo:a})})},function(e){t(e)})},oh=function(e){return e?e.getElementsByTagName("img"):[]},ih=0,ah={uuid:function(e){return e+ih+++(t=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+t()+t()+t());var t}};function uh(u){var n,o,i,t,e,a,r,s,c,l,f=(n=[],o=wa.constant,i=function(e){var t,n,r;if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");return t=e.id||ah.uuid("blobid"),n=e.name||t,{id:o(t),name:o(n),filename:o(n+"."+(r=e.blob.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"}[r.toLowerCase()]||"dat")),blob:o(e.blob),base64:o(e.base64),blobUri:o(e.blobUri||ue.createObjectURL(e.blob)),uri:o(e.uri)}},{create:function(e,t,n,r){return i("object"==typeof e?e:{id:e,name
:r,blob:t,base64:n})},add:function(e){t(e.id())||n.push(e)},get:t=function(t){return e(function(e){return e.id()===t})},getByUri:function(t){return e(function(e){return e.blobUri()===t})},findFirst:e=function(e){return jt.filter(n,e)[0]},removeByUri:function(t){n=jt.filter(n,function(e){return e.blobUri()!==t||(ue.revokeObjectURL(e.blobUri()),!1)})},destroy:function(){jt.each(n,function(e){ue.revokeObjectURL(e.blobUri())}),n=[]}}),d=u.settings,m=(s={},c=function(e,t){return{status:e,resultUri:t}},{hasBlobUri:l=function(e){return e in s},getResultUri:function(e){var t=s[e];return t?t.resultUri:null},isPending:function(e){return!!l(e)&&1===s[e].status},isUploaded:function(e){return!!l(e)&&2===s[e].status},markPending:function(e){s[e]=c(1,null)},markUploaded:function(e,t){s[e]=c(2,t)},removeFailed:function(e){delete s[e]},destroy:function(){s={}}}),g=function(t){return function(e){return u.selection?t(e):[]}},p=function(e,t,n){for(var r=0;-1!==(r=e.indexOf(t,r))&&am
p;(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1),-1!==r;);return e},h=function(e,t,n){return e=p(e,'src="'+t+'"','src="'+n+'"'),e=p(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},v=function(t,n){jt.each(u.undoManager.data,function(e){"fragmented"===e.type?e.fragments=jt.map(e.fragments,function(e){return h(e,t,n)}):e.content=h(e.content,t,n)})},b=function(){return u.notificationManager.open({text:u.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},y=function(e,t){f.removeByUri(e.src),v(e.src,t),u.$(e).attr({src:d.images_reuse_filename?t+"?"+(new Date).getTime():t,"data-mce-src":u.convertURL(t,"src")})},C=function(n){return a||(a=Wp(m,{url:d.images_upload_url,basePath:d.images_upload_base_path,credentials:d.images_upload_credentials,handler:d.images_upload_handler})),N().then(g(function(r){var e;return e=jt.map(r,function(e){return e.blobIn
fo}),a.upload(e,b).then(g(function(e){var t=jt.map(e,function(e,t){var n=r[t].image;return e.status&&!1!==u.settings.images_replace_blob_uris?y(n,e.url):e.error&&zp(u,e.error),{element:n,status:e.status}});return n&&n(t),t}))}))},x=function(e){if(!1!==d.automatic_uploads)return C(e)},w=function(e){return!d.images_dataimg_filter||d.images_dataimg_filter(e)},N=function(){var o,i,a;return r||(o=m,i=f,a={},r={findAll:function(e,n){var t;n||(n=wa.constant(!0)),t=jt.filter(oh(e),function(e){var t=e.src;return!!Re.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!t||t===Re.transparentSrc)&&(0===t.indexOf("blob:")?!o.isUploaded(t):0===t.indexOf("data:")&&n(e))});var r=jt.map(t,function(n){if(a[n.src])return new De(function(t){a[n.src].then(function(e){if("string"==typeof e)return e;t({image:n,blobInfo:e.blobInfo})})});var e=new De(function(e
,t){rh(i,n,e,t)}).then(function(e){return delete a[e.image.src],e})["catch"](function(e){return delete a[n.src],e});return a[n.src]=e});return De.all(r)}}),r.findAll(u.getBody(),w).then(g(function(e){return e=jt.filter(e,function(e){return"string"!=typeof e||(Vp(u,e),!1)}),jt.each(e,function(e){v(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),e}))},E=function(e){return e.replace(/src="(blob:[^"]+)"/g,function(e,n){var t=m.getResultUri(n);if(t)return'src="'+t+'"';var r=f.getByUri(n);return r||(r=jt.reduce(u.editorManager.get(),function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)},null)),r?'src="data:'+r.blob().type+";base64,"+r.base64()+'"':e})};return u.on("setContent",function(){!1!==u.settings.automatic_uploads?x():N()}),u.on("RawSaveContent",function(e){e.content=E(e.content)}),u.on("getCo
ntent",function(e){e.source_view||"raw"===e.format||(e.content=E(e.content))}),u.on("PostRender",function(){u.parser.addNodeFilter("img",function(e){jt.each(e,function(e){var t=e.attr("src");if(!f.getByUri(t)){var n=m.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:f,uploadImages:C,uploadImagesAuto:x,scanForImages:N,destroy:function(){f.destroy(),m.destroy(),r=a=null}}}var sh=function(e,t){return e.hasOwnProperty(t.nodeName)},ch=function(e,t){if(Bo.isText(t)){if(0===t.nodeValue.length)return!0;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||sh(e,t.nextSibling)))return!0}return!1},lh=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.dom,g=e.selection,p=e.schema,h=p.getBlockElements(),v=g.getStart(),b=e.getBody();if(f=d.forced_root_block,v&&Bo.isElement(v)&&f&&(l=b.nodeName.toLowerCase(),p.isValidChild(l,f.toLowerCase())&&(y=h,C=b,x=v,!M(Hf(er.fromDom(x),er.fromDom(C)),funct
ion(e){return sh(y,e.dom())})))){var y,C,x,w,N;for(n=(t=g.getRng()).startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,c=Ep(e),v=b.firstChild;v;)if(w=h,N=v,Bo.isText(N)||Bo.isElement(N)&&!sh(w,N)&&!hl(N)){if(ch(h,v)){v=(u=v).nextSibling,m.remove(u);continue}a||(a=m.create(f,e.settings.forced_root_block_attrs),v.parentNode.insertBefore(a,v),s=!0),v=(u=v).nextSibling,a.appendChild(u)}else a=null,v=v.nextSibling;s&&c&&(t.setStart(n,r),t.setEnd(o,i),g.setRng(t),e.nodeChanged())}},fh=function(e){e.settings.forced_root_block&&e.on("NodeChange",b(lh,e))},dh=function(t){return Wr.firstChild(t).fold(H([t]),function(e){return[t].concat(dh(e))})},mh=function(t){return Wr.lastChild(t).fold(H([t]),function(e){return"br"===sr.name(e)?Wr.prevSibling(e).map(function(e){return[t].concat(mh(e))}).getOr([]):[t].concat(mh(e))})},gh=function(o,e){return au([(i=e,a=i.startContainer,u=i.startOffset,Bo.isText(a)?0===u?A.some(er.fromDom(
a)):A.none():A.from(a.childNodes[u]).map(er.fromDom)),(t=e,n=t.endContainer,r=t.endOffset,Bo.isText(n)?r===n.data.length?A.some(er.fromDom(n)):A.none():A.from(n.childNodes[r-1]).map(er.fromDom))],function(e,t){var n=V(dh(o),b(Ur.eq,e)),r=V(mh(o),b(Ur.eq,t));return n.isSome()&&r.isSome()}).getOr(!1);var t,n,r,i,a,u},ph=function(e,t,n,r){var o=n,i=new io(n,o),a=e.schema.getNonEmptyElements();do{if(3===n.nodeType&&0!==Yt.trim(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(Re.ie&&Re.ie<11&&e.isBlock(n)&&e.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length))},hh=function(e){var t=e.selection.getSel();return t&&0<t.rangeCount}
;function vh(i){var r,o=[];"onselectionchange"in i.getDoc()||i.on("NodeChange Click MouseUp KeyUp Focus",function(e){var t,n;n={startContainer:(t=i.selection.getRng()).startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset},"nodechange"!==e.type&&Zm(n,r)||i.fire("SelectionChange"),r=n}),i.on("contextmenu",function(){i.fire("SelectionChange")}),i.on("SelectionChange",function(){var e=i.selection.getStart(!0);!e||!Re.range&&i.selection.isCollapsed()||hh(i)&&!function(e){var t,n;if((n=i.$(e).parentsUntil(i.getBody()).add(e)).length===o.length){for(t=n.length;0<=t&&n[t]===o[t];t--);if(-1===t)return o=n,!0}return o=n,!1}(e)&&i.dom.isChildOf(e,i.getBody())&&i.nodeChanged({selectionChange:!0})}),i.on("MouseUp",function(e){!e.isDefaultPrevented()&&hh(i)&&("IMG"===i.selection.getNode().nodeName?Le.setE
ditorTimeout(i,function(){i.nodeChanged()}):i.nodeChanged())}),this.nodeChanged=function(e){var t,n,r,o=i.selection;i.initialized&&o&&!i.settings.disable_nodechange&&!i.readonly&&(r=i.getBody(),(t=o.getStart(!0)||r).ownerDocument===i.getDoc()&&i.dom.isChildOf(t,r)||(t=r),n=[],i.dom.getParent(t,function(e){if(e===r)return!0;n.push(e)}),(e=e||{}).element=t,e.parents=n,i.fire("NodeChange",e))}}var bh,yh,Ch=function(e){var t,n,r,o;return o=e.getBoundingClientRect(),n=(t=e.ownerDocument).documentElement,r=t.defaultView,{top:o.top+r.pageYOffset-n.clientTop,left:o.left+r.pageXOffset-n.clientLeft}},xh=function(e,t){return n=(u=e).inline?Ch(u.getBody()):{left:0,top:0},a=(i=e).getBody(),r=i.inline?{left:a.scrollLeft,top:a.scrollTop}:{left:0,top:0},{pageX:(o=function(e,t){if(t.target.ownerDocument!==e.getDoc()){var n=Ch(e.getContentAreaContainer()),r=(i=(o=e).getBody(),a=o.getDoc().documentElement,u={left:i.scrollLeft,top:i.scrollTop},s={left:i
.scrollLeft||a.scrollLeft,top:i.scrollTop||a.scrollTop},o.inline?u:s);return{left:t.pageX-n.left+r.left,top:t.pageY-n.top+r.top}}var o,i,a,u,s;return{left:t.pageX,top:t.pageY}}(e,t)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o,i,a,u},wh=Bo.isContentEditableFalse,Nh=Bo.isContentEditableTrue,Eh=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},Sh=function(u,s){return function(e){if(0===e.button){var t=jt.find(s.dom.getParents(e.target),wa.or(wh,Nh));if(i=s.getBody(),wh(a=t)&&a!==i){var n=s.dom.getPos(t),r=s.getBody(),o=s.getDoc().documentElement;u.element=t,u.screenX=e.screenX,u.screenY=e.screenY,u.maxX=(s.inline?r.scrollWidth:o.offsetWidth)-2,u.maxY=(s.inline?r.scrollHeight:o.offsetHeight)-2,u.relX=e.pageX-n.x,u.relY=e.pageY-n.y,u.width=t.offsetWidth,u.height=t.offsetHeight,u.ghost=function(e,t,n,r){var o=t.cloneNode(!0);e.dom.setStyles(o,{width:n,height:r}),e.dom.setAttrib(o,"data-mce-selected",null);var i=e.dom.create("div&qu
ot;,{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(s,t,u.width,u.height)}}var i,a}},Th=function(l,f){return function(e){if(l.dragging&&(s=(i=f).selection,c=s.getSel().getRangeAt(0).startContainer,a=3===c.nodeType?c.parentNode:c,u=l.element,a!==u&&!i.dom.isChildOf(a,u)&&!wh(a))){var t=(r=l.element,(o=r.cloneNode(!0)).removeAttribute("data-mce-selected"),o),n=f.fire("drop",{targetClone:t,clientX:e.clientX,clientY:e.clientY});n.isDefaultPrevented()||(t=n.targetClone,f.undoManager.transact(function(){Eh(l.element),f.insertContent(f.dom.getOuterHTML(t)),f._selectionOverrides.hideFakeCaret()}))}var r,o,i,a,u,s,c;kh(l
)}},kh=function(e){e.dragging=!1,e.element=null,Eh(e.ghost)},Ah=function(e){var t,n,r,o,i,a,p,h,v,u,s,c={};t=hi.DOM,a=document,n=Sh(c,e),p=c,h=e,v=Le.throttle(function(e,t){h._selectionOverrides.hideFakeCaret(),h.selection.placeCaretAt(e,t)},0),r=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m=Math.max(Math.abs(e.screenX-p.screenX),Math.abs(e.screenY-p.screenY));if(p.element&&!p.dragging&&10<m){if(h.fire("dragstart",{target:p.element}).isDefaultPrevented())return;p.dragging=!0,h.focus()}if(p.dragging){var g=(f=p,{pageX:(d=xh(h,e)).pageX-f.relX,pageY:d.pageY+5});c=p.ghost,l=h.getBody(),c.parentNode!==l&&l.appendChild(c),t=p.ghost,n=g,r=p.width,o=p.height,i=p.maxX,a=p.maxY,s=u=0,t.style.left=n.pageX+"px",t.style.top=n.pageY+"px",n.pageX+r>i&&(u=n.pageX+r-i),n.pageY+o>a&&(s=n.pageY+o-a),t.style.width=r-u+"px",t.style.height=o-s+"px",v(e.clientX,e.clientY)}},o=Th(c,e),u=c,i=function(){u.dragging
&&s.fire("dragend"),kh(u)},(s=e).on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o),t.bind(a,"mousemove",r),t.bind(a,"mouseup",i),e.on("remove",function(){t.unbind(a,"mousemove",r),t.unbind(a,"mouseup",i)})},_h=function(e){var n;Ah(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;(wh(t)||wh(n.dom.getContentEditableParent(t)))&&e.preventDefault()})},Rh=function(e){return jt.reduce(e,function(e,t){return e.concat(function(t){var e=function(e){return jt.map(e,function(e){return(e=Ja(e)).node=t,e})};if(Bo.isElement(t))return e(t.getClientRects());if(Bo.isText(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}}(t))},[])};(yh=bh||(bh={}))[yh.Up=-1]="Up",yh[yh.Down=1]="Down";var Dh=function(o,i,a,e,u,t){var n,s
,c=0,l=[],r=function(e){var t,n,r;for(r=Rh([e]),-1===o&&(r=r.reverse()),t=0;t<r.length;t++)if(n=r[t],!a(n,s)){if(0<l.length&&i(n,jt.last(l))&&c++,n.line=c,u(n))return!0;l.push(n)}};return(s=jt.last(t.getClientRects()))&&(r(n=t.getNode()),function(e,t,n,r){for(;r=Mc(r,e,Ya,t);)if(n(r))return}(o,e,r,n)),l},Bh=b(Dh,bh.Up,eu,tu),Oh=b(Dh,bh.Down,tu,eu),Ph=function(n){return function(e){return t=n,e.line>t;var t}},Lh=function(n){return function(e){return t=n,e.line===t;var t}},Ih=Bo.isContentEditableFalse,Mh=Mc,Fh=function(e,t){return Math.abs(e.left-t)},Uh=function(e,t){return Math.abs(e.right-t)},zh=function(e,t){return e>=t.left&&e<=t.right},Vh=function(e,o){return jt.reduce(e,function(e,t){var n,r;return n=Math.min(Fh(e,o),Uh(e,o)),r=Math.min(Fh(t,o),Uh(t,o)),zh(o,t)?t:zh(o,e)?e:r===n&&Ih(t.node)?t:r<n?t:e})},qh=function(e,t,n,r){for(;r=Mh(r,e,Ya,t);)if(n(r))return},Hh=function(e,t,n){var r,o,i,a,u,s,c,l,f=Rh((o=e,jt.fi
lter(jt.toArray(o.getElementsByTagName("*")),Tc))),d=jt.filter(f,function(e){return n>=e.top&&n<=e.bottom});return(r=Vh(d,t))&&(r=Vh((u=e,l=function(t,e){var n;return n=jt.filter(Rh([e]),function(e){return!t(e,s)}),c=c.concat(n),0===n.length},(c=[]).push(s=r),qh(bh.Up,u,b(l,eu),s.node),qh(bh.Down,u,b(l,tu),s.node),c),t))&&Tc(r.node)?(a=t,{node:(i=r).node,before:Fh(i,a)<Uh(i,a)}):null},jh=function(i,a,e){return!e.collapsed&&z(e.getClientRects(),function(e,t){return e||(o=a,(r=i)>=(n=t).left&&r<=n.right&&o>=n.top&&o<=n.bottom);var n,r,o},!1)},$h=function(t){var e=Bi(function(){if(!t.removed&&t.selection.getRng().collapsed){var e=ms(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0);t.on("focus",function(){e.throttle()}),t.on("blur",function(){e.cancel()})},Wh={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){re
turn e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(e){return Re.mac?e.metaKey:e.ctrlKey&&!e.altKey}},Kh=Bo.isContentEditableTrue,Xh=Bo.isContentEditableFalse,Yh=Jc,Gh=Gc,Jh=function(e,t){for(var n=e.getBody();t&&t!==n;){if(Kh(t)||Xh(t))return t;t=t.parentNode}return null},Qh=function(g){var p,e,t,a=g.getBody(),o=Sc(g.getBody(),function(e){return g.dom.isBlock(e)},function(){return Ep(g)}),h="sel-"+g.dom.uniqueId(),u=function(e){e&&g.selection.setRng(e)},s=function(){return g.selection.getRng()},v=function(e,t,n,r){return void 0===r&&(r=!0),g.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&g.selection.scrollIntoView(t,-1===e),o.show(n,t))},b=function(e,t){return t=$c(e,a,t),-1===e?Au.fromRangeStart(t):Au.fromRangeEnd(t)},n=function(e){return Da(e)||Ia(e)||Ma(e)},y=function(e){return n(e.startContainer)||n(e.endContainer)},c=function(e,t){var n,r,o,i,a,u,s,c,l
,f,d=g.$,m=g.dom;if(!e)return null;if(e.collapsed){if(!y(e))if(!1===t){if(c=b(-1,e),Tc(c.getNode(!0)))return v(-1,c.getNode(!0),!1,!1);if(Tc(c.getNode()))return v(-1,c.getNode(),!c.isAtEnd(),!1)}else{if(c=b(1,e),Tc(c.getNode()))return v(1,c.getNode(),!c.isAtEnd(),!1);if(Tc(c.getNode(!0)))return v(1,c.getNode(!0),!1,!1)}return null}return i=e.startContainer,a=e.startOffset,u=e.endOffset,3===i.nodeType&&0===a&&Xh(i.parentNode)&&(i=i.parentNode,a=m.nodeIndex(i),i=i.parentNode),1!==i.nodeType?null:(u===a+1&&(n=i.childNodes[a]),Xh(n)?(l=f=n.cloneNode(!0),(s=g.fire("ObjectSelected",{target:n,targetClone:l})).isDefaultPrevented()?null:(r=ra(er.fromDom(g.getBody()),"#"+h).fold(function(){return d([])},function(e){return d([e.dom()])}),l=s.targetClone,0===r.length&&(r=d('<div data-mce-bogus="all" class="mce-offscreen-selection"></div>').attr("id",h)).appendTo(g.getBody()),e=g.dom.createRng()
,l===f&&Re.ie?(r.empty().append('<p style="font-size: 0" data-mce-bogus="all">\xa0</p>').append(l),e.setStartAfter(r[0].firstChild.firstChild),e.setEndAfter(l)):(r.empty().append("\xa0").append(l).append("\xa0"),e.setStart(r[0].firstChild,1),e.setEnd(r[0].lastChild,0)),r.css({top:m.getPos(n,g.getBody()).y}),r[0].focus(),(o=g.selection.getSel()).removeAllRanges(),o.addRange(e),F(Xi(er.fromDom(g.getBody()),"*[data-mce-selected]"),function(e){vr.remove(e,"data-mce-selected")}),n.setAttribute("data-mce-selected","1"),p=n,C(),e)):null)},l=function(){p&&(p.removeAttribute("data-mce-selected"),ra(er.fromDom(g.getBody()),"#"+h).each(Di.remove),p=null),ra(er.fromDom(g.getBody()),"#"+h).each(Di.remove),p=null},C=function(){o.hide()};return Re.ceFalse&&(function(){g.on("mouseup",function(e){var t=s();t.collapsed&&Dp(g,e.clientX,e.cl
ientY)&&u(ds(g,t,!1))}),g.on("click",function(e){var t;(t=Jh(g,e.target))&&(Xh(t)&&(e.preventDefault(),g.focus()),Kh(t)&&g.dom.isChildOf(t,g.selection.getNode())&&l())}),g.on("blur NewBlock",function(){l()}),g.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var n,r,i=function(e,t){var n,r,o=g.dom.getParent(e,g.dom.isBlock),i=g.dom.getParent(t,g.dom.isBlock);return!(!o||!g.dom.isChildOf(o,i)||!1!==Xh(Jh(g,o)))||o&&(n=o,r=i,!(g.dom.getParent(n,g.dom.isBlock)===g.dom.getParent(r,g.dom.isBlock)))&&function(e){var t=Ts(e);if(!e.firstChild)return!1;var n=Au.before(e.firstChild),r=t.next(n);return r&&!Gh(r)&&!Yh(r)}(o)};r=!1,(n=g).on("touchstart",function(){r=!1}),n.on("touchmove",function(){r=!0}),n.on("touchend",function(e){var t=Jh(n,e.target);Xh(t)&&(r||(e.preventDefault(),c(fs(n,t))))}),g.on("mousedown",functi
on(e){var t,n=e.target;if((n===a||"HTML"===n.nodeName||g.dom.isChildOf(n,a))&&!1!==Dp(g,e.clientX,e.clientY))if(t=Jh(g,n))Xh(t)?(e.preventDefault(),c(fs(g,t))):(l(),Kh(t)&&e.shiftKey||jh(e.clientX,e.clientY,g.selection.getRng())||(C(),g.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===Tc(n)){l(),C();var r=Hh(a,e.clientX,e.clientY);if(r&&!i(e.target,r.node)){e.preventDefault();var o=v(1,r.node,r.before,!1);g.getBody().focus(),u(o)}}}),g.on("keypress",function(e){Wh.modifierPressed(e)||(e.keyCode,Xh(g.selection.getNode())&&e.preventDefault())}),g.on("getSelectionRange",function(e){var t=e.range;if(p){if(!p.parentNode)return void(p=null);(t=t.cloneRange()).selectNode(p),e.range=t}}),g.on("setSelectionRange",function(e){var t;(t=c(e.range,e.forward))&&(e.range=t)}),g.on("AfterSetSelectionRange",function(e){var t,n=e.range;y(n)||C(),t=n.startContainer.parentNode,g.dom.hasClass(t,"mce-
offscreen-selection")||l()}),g.on("copy",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!Re.ie){var r=(t=g.dom.get(h))?t.getElementsByTagName("*")[0]:t;r&&(e.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),_h(g),$h(g)}(),e=g.contentStyles,t=".mce-content-body",e.push(o.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;max-width: 1000000px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")),{showCaret:v,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Fa(e),u(s()),g.selection.scrollIntoView(e[0]))},hideFakeCaret:C,destroy:function(){o.destroy(),p=null}}},Zh=function(e,t,n){var r,o,i,a,u=1;for(a=e.getShortEndedElements(),(i=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[
^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g).lastIndex=r=n;o=i.exec(t);){if(r=i.lastIndex,"/"===o[1])u--;else if(!o[1]){if(o[2]in a)continue;u++}if(0===u)break}return r};function ev(F,U){void 0===U&&(U=ri());var e=function(){};!1!==(F=F||{}).fix_self_closing&&(F.fix_self_closing=!0);var z=F.comment?F.comment:e,V=F.cdata?F.cdata:e,q=F.text?F.text:e,H=F.start?F.start:e,j=F.end?F.end:e,$=F.pi?F.pi:e,W=F.doctype?F.doctype:e;return{parse:function(e){var t,n,r,d,o,i,a,m,u,s,g,c,p,l,f,h,v,b,y,C,x,w,N,E,S,T,k,A,_,R=0,D=[],B=0,O=Wo.decode,P=Yt.makeMap("src,href,data,background,formaction,poster,xlink:href"),L=/((java|vb)script|mhtml):/i,I=function(e){var t,n;for(t=D.length;t--&&D[t].name!==e;);if(0<=t){for(n=D.length-1;t<=n;n--)(e=D[n]).valid&&j(e.name);D.length=t}},M=function(e,t,n,r,o){var i,a,u,s,c;if(n=(t=t.toLowerCase())in g?t:O(n||r||o||""),p&&!m&&0==(0===(u=t).
indexOf("data-")||0===u.indexOf("aria-"))){if(!(i=b[t])&&y){for(a=y.length;a--&&!(i=y[a]).pattern.test(t););-1===a&&(i=null)}if(!i)return;if(i.validValues&&!(n in i.validValues))return}if(P[t]&&!F.allow_script_urls){var l=n.replace(/[\s\u0000-\u001F]+/g,"");try{l=decodeURIComponent(l)}catch(f){l=unescape(l)}if(L.test(l))return;if(c=l,!(s=F).allow_html_data_urls&&(/^data:image\//i.test(c)?!1===s.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(c):/^data:/i.test(c)))return}m&&(t in P||0===t.indexOf("on"))||(d.map[t]=n,d.push({name:t,value:n}))};for(S=new RegExp("<(?:(?:!--([\\w\\W]*?)--\x3e)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+
)>))","g"),T=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,s=U.getShortEndedElements(),E=F.self_closing_elements||U.getSelfClosingElements(),g=U.getBoolAttrs(),p=F.validate,u=F.remove_internals,_=F.fix_self_closing,k=U.getSpecialElements(),N=e+">";t=S.exec(N);){if(R<t.index&&q(O(e.substr(R,t.index-R))),n=t[6])":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),I(n);else if(n=t[7]){if(t.index+t[0].length>e.length){q(O(e.substr(t.index))),R=t.index+t[0].length;continue}if(":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),c=n in s,_&&E[n]&&0<D.length&&D[D.length-1].name===n&&I(n),!p||(l=U.getElementRule(n))){if(f=!0,p&&(b=l.attributes,y=l.attributePatterns),(v=t[8])?((m=-1!==v.indexOf("data-mce-type"))&&u&&(f=!1),(d=[]).map={},v.replace(T,M)):(d=[]).map={},p&&!m){if(C=l.attr
ibutesRequired,x=l.attributesDefault,w=l.attributesForced,l.removeEmptyAttrs&&!d.length&&(f=!1),w)for(o=w.length;o--;)a=(h=w[o]).name,"{$uid}"===(A=h.value)&&(A="mce_"+B++),d.map[a]=A,d.push({name:a,value:A});if(x)for(o=x.length;o--;)(a=(h=x[o]).name)in d.map||("{$uid}"===(A=h.value)&&(A="mce_"+B++),d.map[a]=A,d.push({name:a,value:A}));if(C){for(o=C.length;o--&&!(C[o]in d.map););-1===o&&(f=!1)}if(h=d.map["data-mce-bogus"]){if("all"===h){R=Zh(U,e,S.lastIndex),S.lastIndex=R;continue}f=!1}}f&&H(n,d,c)}else f=!1;if(r=k[n]){r.lastIndex=R=t.index+t[0].length,(t=r.exec(e))?(f&&(i=e.substr(R,t.index-R)),R=t.index+t[0].length):(i=e.substr(R),R=e.length),f&&(0<i.length&&q(i,!0),j(n)),S.lastIndex=R;continue}c||(v&&v.indexOf("/")===v.length-1?f&&j(n):D.push({name:n,valid:f}))}else(n=t[1])?(">"===n.charAt(0)&&
;(n=" "+n),F.allow_conditional_comments||"[if"!==n.substr(0,3).toLowerCase()||(n=" "+n),z(n)):(n=t[2])?V(n.replace(/<!--|-->/g,"")):(n=t[3])?W(n):(n=t[4])&&$(n,t[5]);R=t.index+t[0].length}for(R<e.length&&q(O(e.substr(R))),o=D.length-1;0<=o;o--)(n=D[o]).valid&&j(n.name)}}}(ev||(ev={})).findEndTag=Zh;var tv=ev,nv=function(e,t){var n,r,o,i,a,u,s,c,l=t,f=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,d=e.schema;for(u=e.getTempAttrs(),s=l,c=new RegExp(["\\s?("+u.join("|")+')="[^"]+"'].join("|"),"gi"),l=s.replace(c,""),a=d.getShortEndedElements();i=f.exec(l);)r=f.lastIndex,o=i[0].length,n=a[i[1]]?r:tv.findEndTag(d,l,r),l=l.substring(0,r-o)+l.substring(n),f.lastIndex=r-o;return Ta(l)},rv={trimExternal:nv,trimInternal:nv},ov=0,iv=2,av=1,uv=function(g,p){var e=g.length+p.length+2,h=new Array(e),v=new Array(e),c=function(e,t,n,r,o){var i
=l(e,t,n,r);if(null===i||i.start===t&&i.diag===t-r||i.end===e&&i.diag===e-n)for(var a=e,u=n;a<t||u<r;)a<t&&u<r&&g[a]===p[u]?(o.push([0,g[a]]),++a,++u):r-n<t-e?(o.push([2,g[a]]),++a):(o.push([1,p[u]]),++u);else{c(e,i.start,n,i.start-i.diag,o);for(var s=i.start;s<i.end;++s)o.push([0,g[s]]);c(i.end,t,i.end-i.diag,r,o)}},b=function(e,t,n,r){for(var o=e;o-t<r&&o<n&&g[o]===p[o-t];)++o;return{start:e,end:o,diag:t}},l=function(e,t,n,r){var o=t-e,i=r-n;if(0===o||0===i)return null;var a,u,s,c,l,f=o-i,d=i+o,m=(d%2==0?d:d+1)/2;for(h[1+m]=e,v[1+m]=t+1,a=0;a<=m;++a){for(u=-a;u<=a;u+=2){for(s=u+m,u===-a||u!==a&&h[s-1]<h[s+1]?h[s]=h[s+1]:h[s]=h[s-1]+1,l=(c=h[s])-e+n-u;c<t&&l<r&&g[c]===p[l];)h[s]=++c,++l;if(f%2!=0&&f-a<=u&&u<=f+a&&v[s-f]<=h[s])return b(v[s-f],u+e-n,t,r)}for(u=f-a;u<=f+a;u+=2){for(s=u+m-f,u===f-a||u!==f+a&&v[s+1]<=v[s-1]?v[s]=v[
s+1]-1:v[s]=v[s-1],l=(c=v[s]-1)-e+n-u;e<=c&&n<=l&&g[c]===p[l];)v[s]=c--,l--;if(f%2==0&&-a<=u&&u<=a&&v[s]<=h[s+f])return b(v[s],u+e-n,t,r)}}},t=[];return c(0,g.length,0,p.length,t),t},sv=function(e){return Bo.isElement(e)?e.outerHTML:Bo.isText(e)?Wo.encodeRaw(e.data,!1):Bo.isComment(e)?"\x3c!--"+e.data+"--\x3e":""},cv=function(e,t,n){var r=function(e){var t,n,r;for(r=document.createElement("div"),t=document.createDocumentFragment(),e&&(r.innerHTML=e);n=r.firstChild;)t.appendChild(n);return t}(t);if(e.hasChildNodes()&&n<e.childNodes.length){var o=e.childNodes[n];o.parentNode.insertBefore(r,o)}else e.appendChild(r)},lv=function(e){return jt.filter(jt.map(e.childNodes,sv),function(e){return 0<e.length})},fv=function(e,t){var n,r,o,i=jt.map(t.childNodes,sv);return n=uv(i,e),r=t,o=0,jt.each(n,function(e){e[0]===ov?o++:e[0]===av?(cv(r,e[1],o),o++):e[0]===iv&&function
(e,t){if(e.hasChildNodes()&&t<e.childNodes.length){var n=e.childNodes[t];n.parentNode.removeChild(n)}}(r,o)}),t},dv=function(e,t){var n=(t||document).createElement("div");return n.innerHTML=e,Wr.children(er.fromDom(n))},mv=function(e){return e.dom().innerHTML},gv=mv,pv=function(e,t){var n=Wr.owner(e).dom(),r=er.fromDom(n.createDocumentFragment()),o=dv(t,n);_i(r,o),Di.empty(e),ki.append(e,r)},hv=Oi(A.none()),vv=function(e){return{type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}},bv=function(e){return{type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}},yv=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},Cv=function(e){var t=er.fromTag("body",hv.get().getOrThunk(function(){var e=document.implementation.createHTMLDocument("undo");return hv.set(A.some(e)),e}));return pv(t,yv(e)),F(Xi(t,"*[data-mce-bogus]"),Di.unwra
p),gv(t)},xv=function(n){var e,t,r;return e=lv(n.getBody()),-1!==(t=(r=G(e,function(e){var t=rv.trimInternal(n.serializer,e);return 0<t.length?[t]:[]})).join("")).indexOf("</iframe>")?vv(r):bv(t)},wv=function(e,t,n){"fragmented"===t.type?fv(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},Nv=function(e,t){return!(!e||!t)&&(r=t,yv(e)===yv(r)||(n=t,Cv(e)===Cv(n)));var n,r};function Ev(u){var s,r,o=this,c=0,l=[],t=0,f=function(){return 0===t},i=function(e){f()&&(o.typing=e)},d=function(e){u.setDirty(e)},a=function(e){i(!1),o.add({},e)},n=function(){o.typing&&(i(!1),o.add())};return u.on("init",function(){o.add()}),u.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&(n(),o.beforeChange())}),u.on("ExecCommand",function
(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&a(e)}),u.on("ObjectResizeStart Cut",function(){o.beforeChange()}),u.on("SaveContent ObjectResized blur",a),u.on("DragEnd",a),u.on("KeyUp",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),u.nodeChanged()),46!==t&&8!==t||u.nodeChanged(),r&&o.typing&&!1===Nv(xv(u),l[0])&&(!1===u.isDirty()&&(d(!0),u.fire("change",{level:l[0],lastLevel:null})),u.fire("TypingUndo"),r=!1,u.nodeChanged()))}),u.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented())if(33<=t&&t<=36||37<=t&&t<=40||45===t)o.typing&&a(e);else{var n=e.ctrlKey&&!e.altKey||e.metaKey;!(t<16||20<t)||224===t||91===t||o.typing||n||(o.beforeChange(),i(!0),o.add
({},e),r=!0)}}),u.on("MouseDown",function(e){o.typing&&a(e)}),u.on("input",function(e){var t;e.inputType&&("insertReplacementText"===e.inputType||"insertText"===(t=e).inputType&&null===t.data)&&a(e)}),u.addShortcut("meta+z","","Undo"),u.addShortcut("meta+y,meta+shift+z","","Redo"),u.on("AddUndo Undo Redo ClearUndos",function(e){e.isDefaultPrevented()||u.nodeChanged()}),o={data:l,typing:!1,beforeChange:function(){f()&&(s=Xu.getUndoBookmark(u.selection))},add:function(e,t){var n,r,o,i=u.settings;if(o=xv(u),e=e||{},e=Yt.extend(e,o),!1===f()||u.removed)return null;if(r=l[c],u.fire("BeforeAddUndo",{level:e,lastLevel:r,originalEvent:t}).isDefaultPrevented())return null;if(r&&Nv(r,e))return null;if(l[c]&&(l[c].beforeBookmark=s),i.custom_undo_redo_levels&&l.length>i.custom_undo_redo_levels){for(n=0;n<l.l
ength-1;n++)l[n]=l[n+1];l.length--,c=l.length}e.bookmark=Xu.getUndoBookmark(u.selection),c<l.length-1&&(l.length=c+1),l.push(e),c=l.length-1;var a={level:e,lastLevel:r,originalEvent:t};return u.fire("AddUndo",a),0<c&&(d(!0),u.fire("change",a)),e},undo:function(){var e;return o.typing&&(o.add(),o.typing=!1,i(!1)),0<c&&(e=l[--c],wv(u,e,!0),d(!0),u.fire("undo",{level:e})),e},redo:function(){var e;return c<l.length-1&&(e=l[++c],wv(u,e,!1),d(!0),u.fire("redo",{level:e})),e},clear:function(){l=[],c=0,o.typing=!1,o.data=l,u.fire("ClearUndos")},hasUndo:function(){return 0<c||o.typing&&l[0]&&!Nv(xv(u),l[0])},hasRedo:function(){return c<l.length-1&&!o.typing},transact:function(e){return n(),o.beforeChange(),o.ignore(e),o.add()},ignore:function(e){try{t++,e()}finally{t--}},extra:function(e,t){var n,r;o.transact(e)&&(r=l[c].bookmark,n=l[c-1],wv(u,n,!0),o.tr
ansact(t)&&(l[c-1].beforeBookmark=r))}}}var Sv,Tv,kv=Cl.isEq,Av=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o<r.length;o++)if(!1===r[o].inherit&&e.dom.is(t,r[o].selector))return!0;return!1},_v=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,function(e){return!!Av(t,e,n)||e.parentNode===o||!!Bv(t,e,n,r,!0)}),Bv(t,e,n,r))},Rv=function(e,t,n){return!!kv(t,n.inline)||!!kv(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0)},Dv=function(e,t,n,r,o,i){var a,u,s,c=n[r];if(n.onmatch)return n.onmatch(t,n,r);if(c)if("undefined"==typeof c.length){for(a in c)if(c.hasOwnProperty(a)){if(u="attributes"===r?e.getAttrib(t,a):Cl.getStyle(e,t,a),o&&!u&&!n.exact)return;if((!o||n.exact)&&!kv(u,Cl.normalizeStyleValue(e,Cl.replaceVars(c[a],i),a)))return}}else for(s=0;s<c.length;s++)if("attributes"===r?e.getAttrib(t,c[s]):Cl.getStyle(e,t,c[s]))return n;return n}
,Bv=function(e,t,n,r,o){var i,a,u,s,c=e.formatter.get(n),l=e.dom;if(c&&t)for(a=0;a<c.length;a++)if(i=c[a],Rv(e.dom,t,i)&&Dv(l,t,i,"attributes",o,r)&&Dv(l,t,i,"styles",o,r)){if(s=i.classes)for(u=0;u<s.length;u++)if(!e.dom.hasClass(t,s[u]))return;return i}},Ov={matchNode:Bv,matchName:Rv,match:function(e,t,n,r){var o;return r?_v(e,r,t,n):(r=e.selection.getNode(),!!_v(e,r,t,n)||!((o=e.selection.getStart())===r||!_v(e,o,t,n)))},matchAll:function(r,o,i){var e,a=[],u={};return e=r.selection.getStart(),r.dom.getParent(e,function(e){var t,n;for(t=0;t<o.length;t++)n=o[t],!u[n]&&Bv(r,e,n,i)&&(u[n]=!0,a.push(n))},r.dom.getRoot()),a},canApply:function(e,t){var n,r,o,i,a,u=e.formatter.get(t),s=e.dom;if(u)for(n=e.selection.getStart(),r=Cl.getParents(s,n),i=u.length-1;0<=i;i--){if(!(a=u[i].selector)||u[i].defaultBlock)return!0;for(o=r.length-1;0<=o;o--)if(s.is(r[o],a))return!0}return!1},matchesUnInheritedFormatSelector:Av},P
v=function(e,t){return e.splitText(t)},Lv=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t===r&&Bo.isText(t)?0<n&&n<t.nodeValue.length&&(t=(r=Pv(t,n)).previousSibling,n<o?(t=r=Pv(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(Bo.isText(t)&&0<n&&n<t.nodeValue.length&&(t=Pv(t,n),n=0),Bo.isText(r)&&0<o&&o<r.nodeValue.length&&(o=(r=Pv(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}},Iv=Sa,Mv="_mce_caret",Fv=function(e){return 0<function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==Iv||1<e.childNodes.length)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t}(e).length},Uv=function(e){var t;if(e)for(e=(t=new io(e,e)).current();e;e=t.next())if(3===e.nodeType)return e;return null},zv=function(e){var t=er.fromTag("span");return vr.setAll(t,{
id:Mv,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&ki.append(t,er.fromText(Iv)),t},Vv=function(e,t,n,r){var o,i,a,u;o=t.getRng(!0),i=e.getParent(n,e.isBlock),Fv(n)?(!1!==r&&(o.setStartBefore(n),o.setEndBefore(n)),e.remove(n)):((u=Uv(n))&&u.nodeValue.charAt(0)===Iv&&u.deleteData(0,1),a=u,o.startContainer===a&&0<o.startOffset&&o.setStart(a,o.startOffset-1),o.endContainer===a&&0<o.endOffset&&o.setEnd(a,o.endOffset-1),e.remove(n,!0)),i&&e.isEmpty(i)&&ef(er.fromDom(i)),t.setRng(o)},qv=function(e,t,n,r,o){if(r)Vv(t,n,r,o);else if(!(r=Ju(e,n.getStart())))for(;r=t.get(Mv);)Vv(t,n,r,!1)},Hv=function(e,t,n){var r=e.dom,o=r.getParent(n,wa.curry(Cl.isTextBlock,e));o&&r.isEmpty(o)?n.parentNode.replaceChild(t,n):(Zl(er.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(t,n):r.insertAfter(t,n))},jv=function(e,t){return e.appendChild(t),t},$v=function(e,t
){var n,r,o=(n=function(e,t){return jv(e,t.cloneNode(!1))},r=t,function(e,t){for(var n=e.length-1;0<=n;n--)t(e[n],n,e)}(e,function(e){r=n(r,e)}),r);return jv(o,o.ownerDocument.createTextNode(Iv))},Wv=function(e){var i=e.dom,a=e.selection,u=e.getBody();e.on("mouseup keydown",function(e){var t,n,r,o;t=u,n=i,r=a,o=e.keyCode,qv(t,n,r,null,!1),8===o&&r.isCollapsed()&&r.getStart().innerHTML===Iv&&qv(t,n,r,Ju(t,r.getStart())),37!==o&&39!==o||qv(t,n,r,Ju(t,r.getStart()))})},Kv=function(e,t){return e.schema.getTextInlineElements().hasOwnProperty(sr.name(t))&&!Gu(t.dom())&&!Bo.isBogus(t.dom())},Xv={},Yv=jt.filter,Gv=jt.each;Tv=function(e){var t,n,r=e.selection.getRng();t=Bo.matchNodeNames("pre"),r.collapsed||(n=e.selection.getSelectedBlocks(),Gv(Yv(Yv(n,t),function(e){return t(e.previousSibling)&&-1!==jt.indexOf(n,e.previousSibling)}),function(e){var t,n;t=e.previousSibling,pn(n=e).remove(),pn(t).append("<b
r><br>").append(n.childNodes)}))},Xv[Sv="pre"]||(Xv[Sv]=[]),Xv[Sv].push(Tv);var Jv=function(e,t){Gv(Xv[e],function(e){e(t)})},Qv=/^(src|href|style)$/,Zv=Yt.each,eb=Cl.isEq,tb=function(e){return/^(TH|TD)$/.test(e.nodeName)},nb=function(e,t,n){var r,o,i;return r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],Bo.isElement(r)&&(i=r.childNodes.length-1,!n&&o&&o--,r=r.childNodes[i<o?i:o]),Bo.isText(r)&&n&&o>=r.nodeValue.length&&(r=new io(r,e.getBody()).next()||r),Bo.isText(r)&&!n&&0===o&&(r=new io(r,e.getBody()).prev()||r),r},rb=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},ob=function(e,t,n,r){return!(t=Cl.getNonWhiteSpaceSibling(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},ib=function(e,n,r,o,i){var t,a,u,s,c,l,f,d,m,g,p,h,v,b,y=e.dom;if(c=y,!(eb(l=o,(f=n).inline)||eb(
l,f.block)||(f.selector?Bo.isElement(l)&&c.is(l,f.selector):void 0)||(s=o,n.links&&"A"===s.tagName)))return!1;if("all"!==n.remove)for(Zv(n.styles,function(e,t){e=Cl.normalizeStyleValue(y,Cl.replaceVars(e,r),t),"number"==typeof t&&(t=e,i=0),(n.remove_similar||!i||eb(Cl.getStyle(y,i,t),e))&&y.setStyle(o,t,""),u=1}),u&&""===y.getAttrib(o,"style")&&(o.removeAttribute("style"),o.removeAttribute("data-mce-style")),Zv(n.attributes,function(e,t){var n;if(e=Cl.replaceVars(e,r),"number"==typeof t&&(t=e,i=0),!i||eb(y.getAttrib(i,t),e)){if("class"===t&&(e=y.getAttrib(o,t))&&(n="",Zv(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(n+=(n?" ":"")+e)}),n))return void y.setAttrib(o,t,n);"class"===t&&o.removeAttribute("className"),Qv.test(t)&&o.removeAttribut
e("data-mce-"+t),o.removeAttribute(t)}}),Zv(n.classes,function(e){e=Cl.replaceVars(e,r),i&&!y.hasClass(i,e)||y.removeClass(o,e)}),a=y.getAttribs(o),t=0;t<a.length;t++){var C=a[t].nodeName;if(0!==C.indexOf("_")&&0!==C.indexOf("data-"))return!1}return"none"!==n.remove?(d=e,g=n,h=(m=o).parentNode,v=d.dom,b=d.settings.forced_root_block,g.block&&(b?h===v.getRoot()&&(g.list_block&&eb(m,g.list_block)||Zv(Yt.grep(m.childNodes),function(e){Cl.isValid(d,b,e.nodeName.toLowerCase())?p?p.appendChild(e):(p=rb(v,e,b),v.setAttribs(p,d.settings.forced_root_block_attrs)):p=0})):v.isBlock(m)&&!v.isBlock(h)&&(ob(v,m,!1)||ob(v,m.firstChild,!0,1)||m.insertBefore(v.create("br"),m.firstChild),ob(v,m,!0)||ob(v,m.lastChild,!1,1)||m.appendChild(v.create("br")))),g.selector&&g.inline&&!eb(g.inline,m)||v.remove(m,1),!0):void 0},ab=ib,ub=function(s,c,l,e,f){var t,n,d=s.formatter.
get(c),m=d[0],a=!0,u=s.dom,r=s.selection,o=function(e){var n,t,r,o,i,a,u=(n=s,t=e,r=c,o=l,i=f,Zv(Cl.getParents(n.dom,t.parentNode).reverse(),function(e){var t;a||"_start"===e.id||"_end"===e.id||(t=Ov.matchNode(n,e,r,o,i))&&!1!==t.split&&(a=e)}),a);return function(e,t,n,r,o,i,a,u){var s,c,l,f,d,m,g=e.dom;if(n){for(m=n.parentNode,s=r.parentNode;s&&s!==m;s=s.parentNode){for(c=g.clone(s,!1),d=0;d<t.length;d++)if(ib(e,t[d],u,c,c)){c=0;break}c&&(l&&c.appendChild(l),f||(f=c),l=c)}!i||a.mixed&&g.isBlock(n)||(r=g.split(n,r)),l&&(o.parentNode.insertBefore(l,o),f.appendChild(o))}return r}(s,d,u,e,e,!0,m,l)},g=function(e){var t,n,r,o,i;if(Bo.isElement(e)&&u.getContentEditable(e)&&(o=a,a="true"===u.getContentEditable(e),i=!0),t=Yt.grep(e.childNodes),a&&!i)for(n=0,r=d.length;n<r&&!ib(s,d[n],l,e,e);n++);if(m.deep&&t.length){for(n=0,r=t.length;n<r;n++)g(t[n]);i&
&(a=o)}},i=function(e){var t=u.get(e?"_start":"_end"),n=t[e?"firstChild":"lastChild"];return hl(n)&&(n=n[e?"firstChild":"lastChild"]),Bo.isText(n)&&0===n.data.length&&(n=e?t.previousSibling||t.nextSibling:t.nextSibling||t.previousSibling),u.remove(t,!0),n},p=function(e){var t,n,r=e.commonAncestorContainer;if(e=Bl(s,e,d,!0),m.split){if((t=nb(s,e,!0))!==(n=nb(s,e))){if(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"===t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),r&&/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName)&&tb(n)&&n.firstChild&&(n=n.firstChild||n),u.isChildOf(t,n)&&t!==n&&!u.isBlock(n)&&!tb(t)&&!tb(n))return t=rb(u,t,"span",{id:"_start","data-mce-type":"bookmark"}),o(t),void(t=i(!0));t=rb(u,t,"span",{id:"_start","data-mce-type&quo
t;:"bookmark"}),n=rb(u,n,"span",{id:"_end","data-mce-type":"bookmark"}),o(t),o(n),t=i(!0),n=i()}else t=n=o(t);e.startContainer=t.parentNode?t.parentNode:t,e.startOffset=u.nodeIndex(t),e.endContainer=n.parentNode?n.parentNode:n,e.endOffset=u.nodeIndex(n)+1}Pl(u,e,function(e){Zv(e,function(e){g(e),Bo.isElement(e)&&"underline"===s.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===Cl.getTextDecoration(u,e.parentNode)&&ib(s,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})};if(e)e.nodeType?((n=u.createRng()).setStartBefore(e),n.setEndAfter(e),p(n)):p(e);else if("false"!==u.getContentEditable(r.getNode()))r.isCollapsed()&&m.inline&&!u.select("td[data-mce-selected],th[data-mce-selected]").length?function(e,t,n,r){var o,i,a,u,s,c,l,f=e.dom,d=e.selection,m=[],g=d.getRng();for(o=g.sta
rtContainer,i=g.startOffset,3===(s=o).nodeType&&(i!==o.nodeValue.length&&(u=!0),s=s.parentNode);s;){if(Ov.matchNode(e,s,t,n,r)){c=s;break}s.nextSibling&&(u=!0),m.push(s),s=s.parentNode}if(c)if(u){a=d.getBookmark(),g.collapse(!0);var p=Bl(e,g,e.formatter.get(t),!0);p=Lv(p),e.formatter.remove(t,n,p),d.moveToBookmark(a)}else{l=Ju(e.getBody(),c);var h=zv(!1).dom(),v=$v(m,h);Hv(e,h,l||c),Vv(f,d,l,!1),d.setCursorLocation(v,1),f.isEmpty(c)&&f.remove(c)}}(s,c,l,f):(t=Xu.getPersistentBookmark(s.selection,!0),p(r.getRng()),r.moveToBookmark(t),m.inline&&Ov.match(s,c,l,r.getStart())&&Cl.moveStart(u,r,r.getRng()),s.nodeChanged());else{e=r.getNode();for(var h=0,v=d.length;h<v&&(!d[h].ceFalseOverride||!ib(s,d[h],l,e,e));h++);}},sb=Yt.each,cb=function(e){return e&&1===e.nodeType&&!hl(e)&&!Gu(e)&&!Bo.isBogus(e)},lb=function(e,t){var n;for(n=e;n;n=n[t]){if(3===n.nodeType&&0!==n.nodeValue.length)return e
;if(1===n.nodeType&&!hl(n))return n}return e},fb=function(e,t,n){var r,o,i=new Ql(e);if(t&&n&&(t=lb(t,"previousSibling"),n=lb(n,"nextSibling"),i.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)r=(o=r).nextSibling,t.appendChild(o);return e.remove(n),Yt.each(Yt.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n},db=function(e,t,n){sb(e.childNodes,function(e){cb(e)&&(t(e)&&n(e),e.hasChildNodes()&&db(e,t,n))})},mb=function(n,e){return b(function(e,t){return!(!t||!Cl.getStyle(n,t,e))},e)},gb=function(r,e,t){return b(function(e,t,n){r.setStyle(n,e,t),""===n.getAttribute("style")&&n.removeAttribute("style"),pb(r,n)},e,t)},pb=function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)},hb=function(e,t){var n;1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType&&(n=Cl.getTextDecoration(e,t.parentNode),e
.getStyle(t,"color")&&n?e.setStyle(t,"text-decoration",n):e.getStyle(t,"text-decoration")===n&&e.setStyle(t,"text-decoration",null))},vb=function(n,e,r,o){sb(e,function(t){sb(n.dom.select(t.inline,o),function(e){cb(e)&&ab(n,t,r,e,t.exact?e:null)}),function(r,e,t){if(e.clear_child_styles){var n=e.links?"*:not(a)":"*";sb(r.select(n,t),function(n){cb(n)&&sb(e.styles,function(e,t){r.setStyle(n,t,"")})})}}(n.dom,t,o)})},bb=function(e,t,n,r){(t.styles.color||t.styles.textDecoration)&&(Yt.walk(r,b(hb,e),"childNodes"),hb(e,r))},yb=function(e,t,n,r){t.styles&&t.styles.backgroundColor&&db(r,mb(e,"fontSize"),gb(e,"backgroundColor",Cl.replaceVars(t.styles.backgroundColor,n)))},Cb=function(e,t,n,r){"sub"!==t.inline&&"sup"!==t.inline||(db(r,mb(e,"fontSize"),gb(e,"fontSize","")),e.remove
(e.select("sup"===t.inline?"sub":"sup",r),!0))},xb=function(e,t,n,r){r&&!1!==t.merge_siblings&&(r=fb(e,Cl.getNonWhiteSpaceSibling(r),r),r=fb(e,r,Cl.getNonWhiteSpaceSibling(r,!0)))},wb=function(t,n,r,o,i){Ov.matchNode(t,i.parentNode,r,o)&&ab(t,n,o,i)||n.merge_with_parents&&t.dom.getParent(i.parentNode,function(e){if(Ov.matchNode(t,e,r,o))return ab(t,n,o,i),!0})},Nb=Yt.each,Eb=function(g,p,h,r){var e,t,v=g.formatter.get(p),b=v[0],o=!r&&g.selection.isCollapsed(),i=g.dom,n=g.selection,y=function(n,e){if(e=e||b,n){if(e.onformat&&e.onformat(n,e,h,r),Nb(e.styles,function(e,t){i.setStyle(n,t,Cl.replaceVars(e,h))}),e.styles){var t=i.getAttrib(n,"style");t&&n.setAttribute("data-mce-style",t)}Nb(e.attributes,function(e,t){i.setAttrib(n,t,Cl.replaceVars(e,h))}),Nb(e.classes,function(e){e=Cl.replaceVars(e,h),i.hasClass(n,e)||i.addClass(n,e)})}},C=function(e,t){var n=!1;return!!b.selector&
;&(Nb(e,function(e){if(!("collapsed"in e&&e.collapsed!==o))return i.is(t,e.selector)&&!Gu(t)?(y(t,e),!(n=!0)):void 0}),n)},a=function(s,e,t,c){var l,f,d=[],m=!0;l=b.inline||b.block,f=s.create(l),y(f),Pl(s,e,function(e){var a,u=function(e){var t,n,r,o;if(o=m,t=e.nodeName.toLowerCase(),n=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&s.getContentEditable(e)&&(o=m,m="true"===s.getContentEditable(e),r=!0),Cl.isEq(t,"br"))return a=0,void(b.block&&s.remove(e));if(b.wrapper&&Ov.matchNode(g,e,p,h))a=0;else{if(m&&!r&&b.block&&!b.wrapper&&Cl.isTextBlock(g,t)&&Cl.isValid(g,n,l))return e=s.rename(e,l),y(e),d.push(e),void(a=0);if(b.selector){var i=C(v,e);if(!b.inline||i)return void(a=0)}!m||r||!Cl.isValid(g,l,t)||!Cl.isValid(g,n,l)||!c&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||Gu(e)||b.inline&&s.isBlock(e)
?(a=0,Nb(Yt.grep(e.childNodes),u),r&&(m=o),a=0):(a||(a=s.clone(f,!1),e.parentNode.insertBefore(a,e),d.push(a)),a.appendChild(e))}};Nb(e,u)}),!0===b.links&&Nb(d,function(e){var t=function(e){"A"===e.nodeName&&y(e,b),Nb(Yt.grep(e.childNodes),t)};t(e)}),Nb(d,function(e){var t,n,r,o,i,a=function(e){var n=!1;return Nb(e.childNodes,function(e){if((t=e)&&1===t.nodeType&&!hl(t)&&!Gu(t)&&!Bo.isBogus(t))return n=e,!1;var t}),n};n=0,Nb(e.childNodes,function(e){Cl.isWhiteSpaceNode(e)||hl(e)||n++}),t=n,!(1<d.length)&&s.isBlock(e)||0!==t?(b.inline||b.wrapper)&&(b.exact||1!==t||((o=a(r=e))&&!hl(o)&&Ov.matchName(s,o,b)&&(i=s.clone(o,!1),y(i),s.replace(i,r,!0),s.remove(o,1)),e=i||r),vb(g,v,h,e),wb(g,b,p,h,e),yb(s,b,h,e),Cb(s,b,h,e),xb(s,b,h,e)):s.remove(e,1)})};if("false"!==i.getContentEditable(n.getNode())){if(b){if(r)r.nodeType?C(v,r)||((t=i.createRng()).setStartBefore(r),t.setEnd
After(r),a(i,Bl(g,t,v),0,!0)):a(i,r,0,!0);else if(o&&b.inline&&!i.select("td[data-mce-selected],th[data-mce-selected]").length)!function(e,t,n){var r,o,i,a,u,s,c=e.selection;a=(r=c.getRng(!0)).startOffset,s=r.startContainer.nodeValue,(o=Ju(e.getBody(),c.getStart()))&&(i=Uv(o));var l,f,d=/[^\s\u00a0\u00ad\u200b\ufeff]/;s&&0<a&&a<s.length&&d.test(s.charAt(a))&&d.test(s.charAt(a-1))?(u=c.getBookmark(),r.collapse(!0),r=Bl(e,r,e.formatter.get(t)),r=Lv(r),e.formatter.apply(t,n,r),c.moveToBookmark(u)):(o&&i.nodeValue===Iv||(l=e.getDoc(),f=zv(!0).dom(),i=(o=l.importNode(f,!0)).firstChild,r.insertNode(o),a=1),e.formatter.apply(t,n,o),c.setCursorLocation(i,a))}(g,p,h);else{var u=g.selection.getNode();g.settings.forced_root_block||!v[0].defaultBlock||i.getParent(u,i.isBlock)||Eb(g,v[0].defaultBlock),g.selection.setRng(uf(g.selection.getRng())),e=Xu.getPersistentBookmark(g.selection,!0),a(i,Bl(g,n.getRng(),v)),b.sty
les&&bb(i,b,h,u),n.moveToBookmark(e),Cl.moveStart(i,n,n.getRng()),g.nodeChanged()}Jv(p,g)}}else{r=n.getNode();for(var s=0,c=v.length;s<c;s++)if(v[s].ceFalseOverride&&i.is(r,v[s].selector))return void y(r,v[s])}},Sb={applyFormat:Eb},Tb=Yt.each,kb=function(e,t,n,r,o){var i,a,u,s,c,l,f,d;null===t.get()&&(a=e,u={},(i=t).set({}),a.on("NodeChange",function(n){var r=Cl.getParents(a.dom,n.element),o={};r=Yt.grep(r,function(e){return 1===e.nodeType&&!e.getAttribute("data-mce-bogus")}),Tb(i.get(),function(e,n){Tb(r,function(t){return a.formatter.matchNode(t,n,{},e.similar)?(u[n]||(Tb(e,function(e){e(!0,{node:t,format:n,parents:r})}),u[n]=e),o[n]=e,!1):!Ov.matchesUnInheritedFormatSelector(a,t,n)&&void 0})}),Tb(u,function(e,t){o[t]||(delete u[t],Tb(e,function(e){e(!1,{node:n.element,format:t,parents:r})}))})})),c=n,l=r,f=o,d=(s=t).get(),Tb(c.split(","),function(e){d[e]||(d[e]=[],d[e].similar=f),d[e].push(l)}),s.set(d)},Ab=
{get:function(r){var t={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"},preview:"font-family font-size"}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-cent
er",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"
;div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"
%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(n,e,t){Yt.each(t,function(e,t){r.setAttrib(n,t,e)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expa
nd:!1,deep:!0}]};return Yt.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){t[e]={block:e,remove:"all"}}),t}},_b=Yt.each,Rb=hi.DOM,Db=function(e,t){var n,o,r,m=t&&t.schema||ri({}),g=function(e){var t,n,r;return o="string"==typeof e?{name:e,classes:[],attrs:{}}:e,t=Rb.create(o.name),n=t,(r=o).classes.length&&Rb.addClass(n,r.classes.join(" ")),Rb.setAttribs(n,r.attrs),t},p=function(n,e,t){var r,o,i,a,u,s,c,l,f=0<e.length&&e[0],d=f&&f.name;if(u=d,s="string"!=typeof(a=n)?a.nodeName.toLowerCase():a,c=m.getElementRule(s),i=!(!(l=c&&c.parentsRequired)||!l.length)&&(u&&-1!==Yt.inArray(l,u)?u:l[0]))d===i?(o=e[0],e=e.slice(1)):o=i;else if(f)o=e[0],e=e.slice(1);else if(!t)return n;return o&&(r=g(o)).appendChild(n),t&&(r||(r=Rb.create("div")).appendChild(n),Yt.each(t,function(e){var t=g(e);r.insertBefore(t,n)})),p(r,e,o&&
o.siblings)};return e&&e.length?(o=e[0],n=g(o),(r=Rb.create("div")).appendChild(p(n,e.slice(1),o.siblings)),r):""},Bb=function(e){var t,a={classes:[],attrs:{}};return"*"!==(e=a.selector=Yt.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,function(e,t,n,r,o){switch(t){case"#":a.attrs.id=n;break;case".":a.classes.push(n);break;case":":-1!==Yt.inArray("checked disabled enabled read-only required".split(" "),n)&&(a.attrs[n]=n)}if("["===r){var i=o.match(/([\w\-]+)(?:\=\"([^\"]+))?/);i&&(a.attrs[i[1]]=i[2])}return""})),a.name=t||"div",a},Ob=function(e){return e&&"string"==typeof e?(e=(e=e.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),Yt.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=Yt.map(e.split(/(?:~\+|~|\+)/),Bb),n=t.pop();return t.length&&(n.siblings=t),n
}).reverse()):[]},Pb=function(n,e){var t,r,o,i,a,u,s="";if(!1===(u=n.settings.preview_styles))return"";"string"!=typeof u&&(u="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");var c=function(e){return e.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=n.formatter.get(e)))return;e=e[0]}return"preview"in e&&!1===(u=e.preview)?"":(t=e.block||e.inline||"span",(i=Ob(e.selector)).length?(i[0].name||(i[0].name=t),t=e.selector,r=Db(i,n)):r=Db([t],n),o=Rb.select(t,r)[0]||r.firstChild,_b(e.styles,function(e,t){(e=c(e))&&Rb.setStyle(o,t,e)}),_b(e.attributes,function(e,t){(e=c(e))&&Rb.setAttrib(o,t,e)}),_b(e.classes,function(e){e=c(e),Rb.hasClass(o,e)||Rb.addClass(o,e)}),n.fire("PreviewFormats"),Rb.setStyles(r,{position:"absolute",left:-65535}),n.getBody().app
endChild(r),a=Rb.getStyle(n.getBody(),"fontSize",!0),a=/px$/.test(a)?parseInt(a,10):0,_b(u.split(" "),function(e){var t=Rb.getStyle(o,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=Rb.getStyle(n.getBody(),e,!0),"#ffffff"===Rb.toHex(t).toLowerCase())||"color"===e&&"#000000"===Rb.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===a)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*a+"px"}"border"===e&&t&&(s+="padding:0 2px;"),s+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),Rb.remove(r),s)},Lb=function(e,t,n,r,o){var i=t.get(n);!Ov.match(e,n,r,o)||"toggle"in i[0]&&!i[0].toggle?Sb.applyFormat(e,n,r,o):ub(e,n,r,o)},Ib=function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Ital
ic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])};function Mb(e){var t,n,r,o=(t=e,n={},(r=function(e,t){e&&("string"!=typeof e?Yt.each(e,function(e,t){r(t,e)}):(t=t.length?t:[t],Yt.each(t,function(e){"undefined"==typeof e.deep&&(e.deep=!e.selector),"undefined"==typeof e.split&&(e.split=!e.selector||e.inline),"undefined"==typeof e.remove&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string&quo
t;==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),n[e]=t))})(Ab.get(t.dom)),r(t.settings.formats),{get:function(e){return e?n[e]:n},register:r,unregister:function(e){return e&&n[e]&&delete n[e],n}}),i=Oi(null);return Ib(e),Wv(e),{get:o.get,register:o.register,unregister:o.unregister,apply:b(Sb.applyFormat,e),remove:b(ub,e),toggle:b(Lb,e,o),match:b(Ov.match,e),matchAll:b(Ov.matchAll,e),matchNode:b(Ov.matchNode,e),canApply:b(Ov.canApply,e),formatChanged:b(kb,e,i),getCssText:b(Pb,e)}}var Fb,Ub=Object.prototype.hasOwnProperty,zb=(Fb=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Ub.call(o,i)&&(n[i]=Fb(n[i],o[i]))}return n}),Vb={register:function(t,s,c){t.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n,r=e.length;r--;)(n=e[r]).a
ttr("tabindex",n.attributes.map["data-mce-tabindex"]),n.attr(t,null)}),t.addAttributeFilter("src,href,style",function(e,t){for(var n,r,o=e.length,i="data-mce-"+t,a=s.url_converter,u=s.url_converter_scope;o--;)(r=(n=e[o]).attributes.map[i])!==undefined?(n.attr(t,0<r.length?r:null),n.attr(i,null)):(r=n.attributes.map[t],"style"===t?r=c.serializeStyle(c.parseStyle(r),n.name):a&&(r=a.call(u,r,t,n.name)),n.attr(t,0<r.length?r:null))}),t.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)(n=(t=e[r]).attr("class"))&&(n=t.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),t.attr("class",0<n.length?n:null))}),t.addAttributeFilter("data-mce-type",function(e,t,n){for(var r,o=e.length;o--;)"bookmark"!==(r=e[o]).attributes.map["data-mce-type"]||n.cleanup||r.remove()}),t.addNodeFilter("noscript",function(e){for(va
r t,n=e.length;n--;)(t=e[n].firstChild)&&(t.value=Wo.decode(t.value))}),t.addNodeFilter("script,style",function(e,t){for(var n,r,o,i=e.length,a=function(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="// <![CDATA[\n"+a(r)+"\n// ]]>")):"xhtml"===s.element_forma
t&&0<r.length&&(n.firstChild.value="\x3c!--\n"+a(r)+"\n--\x3e")}),t.addNodeFilter("#comment",function(e){for(var t,n=e.length;n--;)0===(t=e[n]).value.indexOf("[CDATA[")?(t.name="#cdata",t.type=4,t.value=t.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===t.value.indexOf("mce:protected ")&&(t.name="#text",t.type=3,t.raw=!0,t.value=unescape(t.value).substr(14))}),t.addNodeFilter("xml:namespace,input",function(e,t){for(var n,r=e.length;r--;)7===(n=e[r]).type?n.remove():1===n.type&&("input"!==t||"type"in n.attributes.map||n.attr("type","text"))}),t.addAttributeFilter("data-mce-type",function(e){F(e,function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())})}),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-m
ce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)})},trimTrailingBr:function(e){var t,n,r=function(e){return e&&"br"===e.name};r(t=e.lastChild)&&r(n=t.prev)&&(t.remove(),n.remove())}},qb={process:function(e,t,n){return f=n,(l=e)&&l.hasEventListeners("PreProcess")&&!f.no_events?(o=t,i=n,c=(r=e).dom,o=o.cloneNode(!0),(a=document.implementation).createHTMLDocument&&(u=a.createHTMLDocument(""),Yt.each("BODY"===o.nodeName?o.childNodes:[o],function(e){u.body.appendChild(u.importNode(e,!0))}),o="BODY"!==o.nodeName?u.body.firstChild:u.body,s=c.doc,c.doc=u),Xg(r,zb(i,{node:o})),s&&(c.doc=s),o):t;var r,o,i,a,u,s,c,l,f}},Hb=function(e,a,u){e.addNodeFilter("font",function(e){F(e,function(e){var t,n=a.parse(e.attr("style")),r=e.attr("color"),o=e.attr("face"),i=e.attr("size"
;);r&&(n.color=r),o&&(n["font-family"]=o),i&&(n["font-size"]=u[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",a.serialize(n)),t=e,F(["color","face","size"],function(e){t.attr(e,null)})})})},jb=function(e,t){var n,r=ii();t.convert_fonts_to_spans&&Hb(e,r,Yt.explode(t.font_size_legacy_values)),n=r,e.addNodeFilter("strike",function(e){F(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})},$b={register:function(e,t){t.inline_styles&&jb(e,t)}},Wb=/^[ \t\r\n]*$/,Kb={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Xb=function(e,t,n){var r,o,i=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[i
])return e[i];if(e!==t){if(r=e[a])return r;for(o=e.parent;o&&o!==t;o=o.parent)if(r=o[a])return r}},Yb=function(){function a(e,t){this.name=e,1===(this.type=t)&&(this.attributes=[],this.attributes.map={})}return a.create=function(e,t){var n,r;if(n=new a(e,Kb[e]||1),t)for(r in t)n.attr(r,t[r]);return n},a.prototype.replace=function(e){return e.parent&&e.remove(),this.insert(e,this),this.remove(),this},a.prototype.attr=function(e,t){var n,r;if("string"!=typeof e){for(r in e)this.attr(r,e[r]);return this}if(n=this.attributes){if(t!==undefined){if(null===t){if(e in n.map)for(delete n.map[e],r=n.length;r--;)if(n[r].name===e)return n=n.splice(r,1),this;return this}if(e in n.map){for(r=n.length;r--;)if(n[r].name===e){n[r].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,this}return n.map[e]}},a.prototype.clone=function(){var e,t,n,r,o,i=new a(this.name,this.type);if(n=this.attributes){for((o=[]).map={},e=0,t=n.length;e<t;e++)"id"!
==(r=n[e]).name&&(o[o.length]={name:r.name,value:r.value},o.map[r.name]=r.value);i.attributes=o}return i.value=this.value,i.shortEnded=this.shortEnded,i},a.prototype.wrap=function(e){return this.parent.insert(e,this),e.append(this),this},a.prototype.unwrap=function(){var e,t;for(e=this.firstChild;e;)t=e.next,this.insert(e,this,!0),e=t;this.remove()},a.prototype.remove=function(){var e=this.parent,t=this.next,n=this.prev;return e&&(e.firstChild===this?(e.firstChild=t)&&(t.prev=null):n.next=t,e.lastChild===this?(e.lastChild=n)&&(n.next=null):t.prev=n,this.parent=this.next=this.prev=null),this},a.prototype.append=function(e){var t;return e.parent&&e.remove(),(t=this.lastChild)?((t.next=e).prev=t,this.lastChild=e):this.lastChild=this.firstChild=e,e.parent=this,e},a.prototype.insert=function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,(e.next=t).prev=e):(t===r.last
Child?r.lastChild=e:t.next.prev=e,e.next=t.next,(e.prev=t).next=e),e.parent=r,e},a.prototype.getAll=function(e){var t,n=[];for(t=this.firstChild;t;t=Xb(t,this))t.name===e&&n.push(t);return n},a.prototype.empty=function(){var e,t,n;if(this.firstChild){for(e=[],n=this.firstChild;n;n=Xb(n,this))e.push(n);for(t=e.length;t--;)(n=e[t]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}return this.firstChild=this.lastChild=null,this},a.prototype.isEmpty=function(e,t,n){var r,o,i=this.firstChild;if(t=t||{},i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(e[i.name])return!1;for(r=i.attributes.length;r--;)if("name"===(o=i.attributes[r].name)||0===o.indexOf("data-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!Wb.test(i.value))return!1;if(3===i.type&&i.parent&&t[i.parent.name]&&Wb.test(i.value))return!1;if(n&&n(i))return!1}while(i=Xb(i,this));return!0},a.prototype.walk=function(e)
{return Xb(this,null,e)},a}(),Gb=function(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new Yb("br",1)).shortEnded=!0:r.empty().append(new Yb("#text",3)).value="\xa0"},Jb=function(e){return Qb(e,"#text")&&"\xa0"===e.firstChild.value},Qb=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},Zb=function(r,e,t,n){return n.isEmpty(e,t,function(e){return t=e,(n=r.getElementRule(t.name))&&n.paddEmpty;var t,n})},ey=function(e,t){return e&&(t[e.name]||"br"===e.name)},ty=function(e,p){var h=e.schema;p.remove_trailing_brs&&e.addNodeFilter("br",function(e,t,n){var r,o,i,a,u,s,c,l,f=e.length,d=Yt.extend({},h.getBlockElements()),m=h.getNonEmptyElements(),g=h.getNonEmptyElements();for(d.body=1,r=0;r<f;r++)if(i=(o=e[r]).parent,d[o.parent.name]&&o===i.lastChild){for(u=o.prev;u;){if("span"
!==(s=u.name)||"bookmark"!==u.attr("data-mce-type")){if("br"!==s)break;if("br"===s){o=null;break}}u=u.prev}o&&(o.remove(),Zb(h,m,g,i)&&(c=h.getElementRule(i.name))&&(c.removeEmpty?i.remove():c.paddEmpty&&Gb(p,n,d,i)))}else{for(a=o;i&&i.firstChild===a&&i.lastChild===a&&!d[(a=i).name];)i=i.parent;a===i&&!0!==p.padd_empty_with_br&&((l=new Yb("#text",3)).value="\xa0",o.replace(l))}}),e.addAttributeFilter("href",function(e){var t,n,r,o=e.length;if(!p.allow_unsafe_link_target)for(;o--;)"a"===(t=e[o]).name&&"_blank"===t.attr("target")&&t.attr("rel",(n=t.attr("rel"),r=n?Yt.trim(n):"",/\b(noopener)\b/g.test(r)?r:r.split(" ").filter(function(e){return 0<e.length}).concat(["noopener"]).sort().join(" ")))}),p.allow_html_in_named_anchor||e.addAttrib
uteFilter("id,name",function(e){for(var t,n,r,o,i=e.length;i--;)if("a"===(o=e[i]).name&&o.firstChild&&!o.attr("href"))for(r=o.parent,t=o.lastChild;n=t.prev,r.insert(t,o),t=n;);}),p.fix_list_elements&&e.addNodeFilter("ul,ol",function(e){for(var t,n,r=e.length;r--;)if("ul"===(n=(t=e[r]).parent).name||"ol"===n.name)if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{var o=new Yb("li",1);o.attr("style","list-style-type: none"),t.wrap(o)}}),p.validate&&h.getValidClasses()&&e.addAttributeFilter("class",function(e){for(var t,n,r,o,i,a,u,s=e.length,c=h.getValidClasses();s--;){for(n=(t=e[s]).attr("class").split(" "),i="",r=0;r<n.length;r++)o=n[r],u=!1,(a=c["*"])&&a[o]&&(u=!0),a=c[t.name],!u&&a&&a[o]&&(u=!0),u&&(i&&(i+=" "),i+=o);
i.length||(i=null),t.attr("class",i)}})},ny=Yt.makeMap,ry=Yt.each,oy=Yt.explode,iy=Yt.extend;function ay(T,k){void 0===k&&(k=ri());var A={},_=[],R={},D={};(T=T||{}).validate=!("validate"in T)||T.validate,T.root_name=T.root_name||"body";var B=function(e){var t,n,r;n in A&&((r=R[n])?r.push(e):R[n]=[e]),t=_.length;for(;t--;)(n=_[t].name)in e.attributes.map&&((r=D[n])?r.push(e):D[n]=[e]);return e},e={schema:k,addAttributeFilter:function(e,n){ry(oy(e),function(e){var t;for(t=0;t<_.length;t++)if(_[t].name===e)return void _[t].callbacks.push(n);_.push({name:e,callbacks:[n]})})},getAttributeFilters:function(){return[].concat(_)},addNodeFilter:function(e,n){ry(oy(e),function(e){var t=A[e];t||(A[e]=t=[]),t.push(n)})},getNodeFilters:function(){var e=[];for(var t in A)A.hasOwnProperty(t)&&e.push({name:t,callbacks:A[t]});return e},filterNode:B,parse:function(e,a){var t,n,r,o,i,u,s,c,l,f,d,m=[];a=a||{},R={},D={},l=iy(ny("script
,style,head,html,body,title,meta,param"),k.getBlockElements());var g=k.getNonEmptyElements(),p=k.children,h=T.validate,v="forced_root_block"in a?a.forced_root_block:T.forced_root_block,b=k.getWhiteSpaceElements(),y=/^[ \t\r\n]+/,C=/[ \t\r\n]+$/,x=/[ \t\r\n]+/g,w=/^[ \t\r\n]+$/;f=b.hasOwnProperty(a.context)||b.hasOwnProperty(T.root_name);var N=function(e,t){var n,r=new Yb(e,t);return e in A&&((n=R[e])?n.push(r):R[e]=[r]),r},E=function(e){var t,n,r,o,i=k.getBlockElements();for(t=e.prev;t&&3===t.type;){if(0<(r=t.value.replace(C,"")).length)return void(t.value=r);if(n=t.next){if(3===n.type&&n.value.length){t=t.prev;continue}if(!i[n.name]&&"script"!==n.name&&"style"!==n.name){t=t.prev;continue}}o=t.prev,t.remove(),t=o}};t=tv({validate:h,allow_script_urls:T.allow_script_urls,allow_conditional_comments:T.allow_conditional_comments,self_closing_elements:function(e){var t,n={};for(t in e)"li"!==
t&&"p"!==t&&(n[t]=e[t]);return n}(k.getSelfClosingElements()),cdata:function(e){d.append(N("#cdata",4)).value=e},text:function(e,t){var n;f||(e=e.replace(x," "),ey(d.lastChild,l)&&(e=e.replace(y,""))),0!==e.length&&((n=N("#text",3)).raw=!!t,d.append(n).value=e)},comment:function(e){d.append(N("#comment",8)).value=e},pi:function(e,t){d.append(N(e,7)).value=t,E(d)},doctype:function(e){d.append(N("#doctype",10)).value=e,E(d)},start:function(e,t,n){var r,o,i,a,u;if(i=h?k.getElementRule(e):{}){for((r=N(i.outputName||e,1)).attributes=t,r.shortEnded=n,d.append(r),(u=p[d.name])&&p[r.name]&&!u[r.name]&&m.push(r),o=_.length;o--;)(a=_[o].name)in t.map&&((s=D[a])?s.push(r):D[a]=[r]);l[e]&&E(r),n||(d=r),!f&&b[e]&&(f=!0)}},end:function(e){var t,n,r,o,i;if(n=h?k.getElementRule(e):{}){if(l[e]&&!f){if((t=d.firstChild)&&3===t.typ
e)if(0<(r=t.value.replace(y,"")).length)t.value=r,t=t.next;else for(o=t.next,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.next,(0===r.length||w.test(r))&&(t.remove(),t=o),t=o;if((t=d.lastChild)&&3===t.type)if(0<(r=t.value.replace(C,"")).length)t.value=r,t=t.prev;else for(o=t.prev,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.prev,(0===r.length||w.test(r))&&(t.remove(),t=o),t=o}if(f&&b[e]&&(f=!1),n.removeEmpty&&Zb(k,g,b,d)&&!d.attributes.map.name&&!d.attr("id"))return i=d.parent,l[d.name]?d.empty().remove():d.unwrap(),void(d=i);n.paddEmpty&&(Jb(d)||Zb(k,g,b,d))&&Gb(T,a,l,d),d=d.parent}}},k);var S=d=new Yb(a.context||T.root_name,11);if(t.parse(e),h&&m.length&&(a.context?a.invalid=!0:function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h;for(d=ny("tr,td,th,tbody,thead,tfoot,table"),l=k.getNonEmptyElements(),f=k.getWhiteSpaceElements(),m=k.g
etTextBlockElements(),g=k.getSpecialElements(),t=0;t<e.length;t++)if((n=e[t]).parent&&!n.fixed)if(m[n.name]&&"li"===n.parent.name){for(p=n.next;p&&m[p.name];)p.name="li",p.fixed=!0,n.parent.insert(p,n.parent),p=p.next;n.unwrap(n)}else{for(o=[n],r=n.parent;r&&!k.isValidChild(r.name,n.name)&&!d[r.name];r=r.parent)o.push(r);if(r&&1<o.length){for(o.reverse(),i=a=B(o[0].clone()),c=0;c<o.length-1;c++){for(k.isValidChild(a.name,o[c].name)?(u=B(o[c].clone()),a.append(u)):u=a,s=o[c].firstChild;s&&s!==o[c+1];)h=s.next,u.append(s),s=h;a=u}Zb(k,l,f,i)?r.insert(n,o[0],!0):(r.insert(i,o[0],!0),r.insert(n,i)),r=o[0],(Zb(k,l,f,r)||Qb(r,"br"))&&r.empty().remove()}else if(n.parent){if("li"===n.name){if((p=n.prev)&&("ul"===p.name||"ul"===p.name)){p.append(n);continue}if((p=n.next)&&("ul"===p.name||"ul"===p.name)){p.insert(n,p.firstChil
d,!0);continue}n.wrap(B(new Yb("ul",1)));continue}k.isValidChild(n.parent.name,"div")&&k.isValidChild("div",n.name)?n.wrap(B(new Yb("div",1))):g[n.name]?n.empty().remove():n.unwrap()}}}(m)),v&&("body"===S.name||a.isRootContent)&&function(){var e,t,n=S.firstChild,r=function(e){e&&((n=e.firstChild)&&3===n.type&&(n.value=n.value.replace(y,"")),(n=e.lastChild)&&3===n.type&&(n.value=n.value.replace(C,"")))};if(k.isValidChild(S.name,v.toLowerCase())){for(;n;)e=n.next,3===n.type||1===n.type&&"p"!==n.name&&!l[n.name]&&!n.attr("data-mce-type")?(t||((t=N(v,1)).attr(T.forced_root_block_attrs),S.insert(t,n)),t.append(n)):(r(t),t=null),n=e;r(t)}}(),!a.invalid){for(c in R){for(s=A[c],i=(n=R[c]).length;i--;)n[i].parent||n.splice(i,1);for(r=0,o=s.length;r<o;r++)s[r](n,c,a)}for(r=0,o=_.length;r<o;r++)if((s=_[r]).name i
n D){for(i=(n=D[s.name]).length;i--;)n[i].parent||n.splice(i,1);for(i=0,u=s.callbacks.length;i<u;i++)s.callbacks[i](n,s.name,a)}}return S}};return ty(e,T),$b.register(e,T),e}var uy=function(e,t,n){-1===Yt.inArray(t,n)&&(e.addAttributeFilter(n,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),t.push(n))},sy=function(e,t,n){var r=Ta(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection||xo(er.fromDom(t))?r:Yt.trim(r)},cy=function(e,t,n){var r=n.selection?zb({forced_root_block:!1},n):n,o=e.parse(t,r);return Vb.trimTrailingBr(o),o},ly=function(e,t,n,r,o){var i,a,u,s,c=(i=r,of(t,n).serialize(i));return a=e,s=c,!(u=o).no_events&&a?Yg(a,zb(u,{content:s})).content:s};function fy(e,t){var a,u,s,c,l,n,r=(a=e,n=["data-mce-selected"],s=(u=t)&&u.dom?u.dom:hi.DOM,c=u&&u.schema?u.schema:ri(a),a.entity_encoding=a.entity_encoding||"named",a.remove_trailing_brs=!("remove_trailing_brs"in a)||a.remove_trailing_brs,l=ay(a,c)
,Vb.register(l,a,s),{schema:c,addNodeFilter:l.addNodeFilter,addAttributeFilter:l.addAttributeFilter,serialize:function(e,t){var n=zb({format:"html"},t||{}),r=qb.process(u,e,n),o=sy(s,r,n),i=cy(l,o,n);return"tree"===n.format?i:ly(u,a,c,i,n)},addRules:function(e){c.addValidElements(e)},setRules:function(e){c.setValidElements(e)},addTempAttr:b(uy,l,n),getTempAttrs:function(){return n}});return{schema:r.schema,addNodeFilter:r.addNodeFilter,addAttributeFilter:r.addAttributeFilter,serialize:r.serialize,addRules:r.addRules,setRules:r.setRules,addTempAttr:r.addTempAttr,getTempAttrs:r.getTempAttrs}}function dy(e){return{getBookmark:b(gl,e),moveToBookmark:b(pl,e)}}(dy||(dy={})).isBookmarkNode=hl;var my=dy,gy=Bo.isContentEditableFalse,py=Bo.isContentEditableTrue,hy=function(r,a){var u,s,c,l,f,d,m,g,p,h,v,b,i,y,C,x,w,N=a.dom,E=Yt.each,S=a.getDoc(),T=document,k=Math.abs,A=Math.round,_=a.getBody();l={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var e=".mce-con
tent-body";a.contentStyles.push(e+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: content-box;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+e+" .mce-resizehandle:hover {background: #000}"+e+" img[data-mce-selected],"+e+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+e+" .mce-clonedresizable {position: absolute;"+(Re.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+e+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}");var R=function(e){return e&&("IMG"===e.nodeName||a.dom.is(e,"figure.image"))},n=function(e){var t,n,r=e.target;t=e,n=a.selection.
getRng(),!R(t.target)||jh(t.clientX,t.clientY,n)||e.isDefaultPrevented()||(e.preventDefault(),a.selection.select(r))},D=function(e){return a.dom.is(e,"figure.image")?e.querySelector("img"):e},B=function(e){var t=a.settings.object_resizing;return!1!==t&&!Re.iOS&&("string"!=typeof t&&(t="table,img,figure.image,div"),"false"!==e.getAttribute("data-mce-resize")&&e!==a.getBody()&&Ir.is(er.fromDom(e),t))},O=function(e){var t,n,r,o;t=e.screenX-d,n=e.screenY-m,y=t*f[2]+h,C=n*f[3]+v,y=y<5?5:y,C=C<5?5:C,(R(u)&&!1!==a.settings.resize_img_proportional?!Wh.modifierPressed(e):Wh.modifierPressed(e)||R(u)&&f[2]*f[3]!=0)&&(k(t)>k(n)?(C=A(y*b),y=A(C/b)):(y=A(C/b),C=A(y*b))),N.setStyles(D(s),{width:y,height:C}),r=0<(r=f.startPos.x+t)?r:0,o=0<(o=f.startPos.y+n)?o:0,N.setStyles(c,{left:r,top:o,display:"block"}),c.innerHTML=y+" × "+C,f[2]
<0&&s.clientWidth<=y&&N.setStyle(s,"left",g+(h-y)),f[3]<0&&s.clientHeight<=C&&N.setStyle(s,"top",p+(v-C)),(t=_.scrollWidth-x)+(n=_.scrollHeight-w)!=0&&N.setStyles(c,{left:r-t,top:o-n}),i||(Qg(a,u,h,v),i=!0)},P=function(){i=!1;var e=function(e,t){t&&(u.style[e]||!a.schema.isValid(u.nodeName.toLowerCase(),e)?N.setStyle(D(u),e,t):N.setAttrib(D(u),e,t))};e("width",y),e("height",C),N.unbind(S,"mousemove",O),N.unbind(S,"mouseup",P),T!==S&&(N.unbind(T,"mousemove",O),N.unbind(T,"mouseup",P)),N.remove(s),N.remove(c),o(u),Zg(a,u,y,C),N.setAttrib(u,"style",N.getAttrib(u,"style")),a.nodeChanged()},o=function(e){var t,r,o,n,i;L(),F(),t=N.getPos(e,_),g=t.x,p=t.y,i=e.getBoundingClientRect(),r=i.width||i.right-i.left,o=i.height||i.bottom-i.top,u!==e&&(u=e,y=C=0),n=a.fire("ObjectSelected",{target:e}),B(e)&&!n
.isDefaultPrevented()?E(l,function(n,e){var t;(t=N.get("mceResizeHandle"+e))&&N.remove(t),t=N.add(_,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===Re.ie&&(t.contentEditable=!1),N.bind(t,"mousedown",function(e){var t;e.stopImmediatePropagation(),e.preventDefault(),d=(t=e).screenX,m=t.screenY,h=D(u).clientWidth,v=D(u).clientHeight,b=v/h,(f=n).startPos={x:r*n[0]+g,y:o*n[1]+p},x=_.scrollWidth,w=_.scrollHeight,s=u.cloneNode(!0),N.addClass(s,"mce-clonedresizable"),N.setAttrib(s,"data-mce-bogus","all"),s.contentEditable=!1,s.unSelectabe=!0,N.setStyles(s,{left:g,top:p,margin:0}),s.removeAttribute("data-mce-selected"),_.appendChild(s),N.bind(S,"mousemove",O),N.bind(S,"mouseup",P),T!==S&&(N.bind(T,"mouse
move",O),N.bind(T,"mouseup",P)),c=N.add(_,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},h+" × "+v)}),n.elm=t,N.setStyles(t,{left:r*n[0]+g-t.offsetWidth/2,top:o*n[1]+p-t.offsetHeight/2})}):L(),u.setAttribute("data-mce-selected","1")},L=function(){var e,t;for(e in F(),u&&u.removeAttribute("data-mce-selected"),l)(t=N.get("mceResizeHandle"+e))&&(N.unbind(t),N.remove(t))},I=function(e){var t,n=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};i||a.removed||(E(N.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),t="mousedown"===e.type?e.target:r.getNode(),n(t=N.$(t).closest("table,img,figure.image,hr")[0],_)&&(U(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?o(t):L())},M=function(e){return gy(function(e,t){for(;t&&
amp;t!==e;){if(py(t)||gy(t))return t;t=t.parentNode}return null}(a.getBody(),e))},F=function(){for(var e in l){var t=l[e];t.elm&&(N.unbind(t.elm),delete t.elm)}},U=function(){try{a.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};return a.on("init",function(){U(),Re.ie&&11<=Re.ie&&(a.on("mousedown click",function(e){var t=e.target,n=t.nodeName;i||!/^(TABLE|IMG|HR)$/.test(n)||M(t)||(2!==e.button&&a.selection.select(t,"TABLE"===n),"mousedown"===e.type&&a.nodeChanged())}),a.dom.bind(_,"mscontrolselect",function(e){var t=function(e){Le.setEditorTimeout(a,function(){a.selection.select(e)})};if(M(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))}));var t=Le.throttle(function(e){a.composing||I(e)});a.on("nodechange ResizeEditor ResizeWindow
drop FullscreenStateChanged",t),a.on("keyup compositionend",function(e){u&&"TABLE"===u.nodeName&&t(e)}),a.on("hide blur",L),a.on("contextmenu",n)}),a.on("remove",F),{isResizable:B,showResizeRect:o,hideResizeRect:L,updateResizeRect:I,destroy:function(){u=s=null}}},vy=function(e){return Bo.isContentEditableTrue(e)||Bo.isContentEditableFalse(e)},by=function(e,t,n){var r,o,i,a,u,s=n;if(s.caretPositionFromPoint)(o=s.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(s.body.createTextRange){r=s.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(c){r=function(e,n,t){var r,o,i;if(r=t.elementFromPoint(e,n),o=t.body.createTextRange(),r&&"HTML"!==r.tagName||(r=t.body),o.moveToElementText(r),0<(i=(i=Yt.toArray(o.getClientRects())).sort(function(e,t){return(e=Math.abs
(Math.max(e.top-n,e.bottom-n)))-(t=Math.abs(Math.max(t.top-n,t.bottom-n)))})).length){n=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,n),o.collapse(!0),o}catch(a){}}return null}(e,t,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,Bo.isContentEditableFalse(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(u,a,vy))?null:i}return r},yy=function(n,e){return $(e,function(e){var t=n.fire("GetSelectionRange",{range:e});return t.range!==e?t.range:e})},Cy=function(e,t){var n=(t||document).createDocumentFragment();return F(e,function(e){n.appendChild(e.dom())}),er.fromDom(n)},xy=Ar("element","width","rows"),wy=Ar("element","cells"),Ny=Ar("x","y"),Ey=function(e,t){var n=parseInt(vr.get(e,t),10);return isNaN(n)?1:n},Sy=function(e){return z(e,function(e,t){return t.cells().length>e?t.cells().length:e},0)},Ty=function(e,t){for(var n=e.rows(),r=0;r&
lt;n.length;r++)for(var o=n[r].cells(),i=0;i<o.length;i++)if(Ur.eq(o[i],t))return A.some(Ny(i,r));return A.none()},ky=function(e,t,n,r,o){for(var i=[],a=e.rows(),u=n;u<=o;u++){var s=a[u].cells(),c=t<r?s.slice(t,r+1):s.slice(r,t+1);i.push(wy(a[u].element(),c))}return i},Ay=function(e){var o=xy(ba(e),0,[]);return F(Xi(e,"tr"),function(n,r){F(Xi(n,"td,th"),function(e,t){!function(e,t,n,r,o){for(var i=Ey(o,"rowspan"),a=Ey(o,"colspan"),u=e.rows(),s=n;s<n+i;s++){u[s]||(u[s]=wy(ya(r),[]));for(var c=t;c<t+a;c++)u[s].cells()[c]=s===n&&c===t?o:ba(o)}}(o,function(e,t,n){for(;r=t,o=n,i=void 0,((i=e.rows())[o]?i[o].cells():[])[r];)t++;var r,o,i;return t}(o,t,r),r,n,e)})}),xy(o.element(),Sy(o.rows()),o.rows())},_y=function(e){return n=$((t=e).rows(),function(e){var t=$(e.cells(),function(e){var t=ya(e);return vr.remove(t,"colspan"),vr.remove(t,"rowspan"),t}),n=ba(e.element());return _i(n,t),n}),r=ba(t.element()),o=
er.fromTag("tbody"),_i(o,n),ki.append(r,o),r;var t,n,r,o},Ry=function(l,e,t){return Ty(l,e).bind(function(c){return Ty(l,t).map(function(e){return t=l,r=e,o=(n=c).x(),i=n.y(),a=r.x(),u=r.y(),s=i<u?ky(t,o,i,a,u):ky(t,o,u,a,i),xy(t.element(),Sy(s),s);var t,n,r,o,i,a,u,s})})},Dy=function(n,t){return V(n,function(e){return"li"===sr.name(e)&&gh(e,t)}).fold(H([]),function(e){return(t=n,V(t,function(e){return"ul"===sr.name(e)||"ol"===sr.name(e)})).map(function(e){return[er.fromTag("li"),er.fromTag(sr.name(e))]}).getOr([]);var t})},By=function(e,t){var n,r=er.fromDom(t.commonAncestorContainer),o=jf(r,e),i=U(o,function(e){return mo(e)||lo(e)}),a=Dy(o,t),u=i.concat(a.length?a:vo(n=r)?Wr.parent(n).filter(ho).fold(H([]),function(e){return[n,e]}):ho(n)?[n]:[]);return $(u,ba)},Oy=function(){return Cy([])},Py=function(e,t){return n=er.fromDom(t.cloneContents()),r=By(e,t),o=z(r,function(e,t){return ki.append(t,e),t},n),0<r.length?Cy([o
]):o;var n,r,o},Ly=function(e,o){return(t=e,n=o[0],na(n,"table",b(Ur.eq,t))).bind(function(e){var t=o[0],n=o[o.length-1],r=Ay(e);return Ry(r,t,n).map(function(e){return Cy([_y(e)])})}).getOrThunk(Oy);var t,n},Iy=function(e,t){var n,r,o=Om(t,e);return 0<o.length?Ly(e,o):(n=e,0<(r=t).length&&r[0].collapsed?Oy():Py(n,r[0]))},My=function(e,t){var n,r=e.selection.getRng(),o=e.dom.create("body"),i=e.selection.getSel(),a=yy(e,km(i));if((t=t||{}).get=!0,t.format=t.format||"html",t.selection=!0,(t=e.fire("BeforeGetContent",t)).isDefaultPrevented())return e.fire("GetContent",t),t.content;if("text"===t.format)return e.selection.isCollapsed()?"":Ta(r.text||(i.toString?i.toString():""));r.cloneContents?(n=t.contextual?Iy(er.fromDom(e.getBody()),a).dom():r.cloneContents())&&o.appendChild(n):r.item!==undefined||r.htmlText!==undefined?(o.innerHTML="<br>"+(r.item?r.item(0).outerHTML:
r.htmlText),o.removeChild(o.firstChild)):o.innerHTML=r.toString(),t.getInner=!0;var u=e.selection.serializer.serialize(o,t);return"tree"===t.format?u:(t.content=e.selection.isCollapsed()?"":u,e.fire("GetContent",t),t.content)},Fy=function(e,t,n){var r,o,i,a=e.selection.getRng(),u=e.getDoc();if((n=n||{format:"html"}).set=!0,n.selection=!0,n.content=t,n.no_events||!(n=e.fire("BeforeSetContent",n)).isDefaultPrevented()){if(t=n.content,a.insertNode){t+='<span id="__caret">_</span>',a.startContainer===u&&a.endContainer===u?u.body.innerHTML=t:(a.deleteContents(),0===u.body.childNodes.length?u.body.innerHTML=t:a.createContextualFragment?a.insertNode(a.createContextualFragment(t)):(o=u.createDocumentFragment(),i=u.createElement("div"),o.appendChild(i),i.outerHTML=t,a.insertNode(o))),r=e.dom.get("__caret"),(a=u.createRange()).setStartBefore(r),a.setEndBefore(r),e.selection.setRng(a),e.dom.remo
ve("__caret");try{e.selection.setRng(a)}catch(s){}}else a.item&&(u.execCommand("Delete",!1,null),a=e.getRng()),/^\s+/.test(t)?(a.pasteHTML('<span id="__mce_tmp">_</span>'+t),e.dom.remove("__mce_tmp")):a.pasteHTML(t);n.no_events||e.fire("SetContent",n)}else e.fire("SetContent",n)},Uy=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return A.from(i).map(er.fromDom).map(function(e){return r&&t.collapsed?e:Wr.child(e,o(e,a)).getOr(e)}).bind(function(e){return sr.isElement(e)?A.some(e):Wr.parent(e)}).map(function(e){return e.dom()}).getOr(e)},zy=function(e,t,n){return Uy(e,t,!0,n,function(e,t){return Math.min(Wr.childNodesCount(e),t)})},Vy=function(e,t,n){return Uy(e,t,!1,n,function(e,t){return 0<t?t-1:t})},qy=function(e,t){for(var n=e;e&&Bo.isText(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},Hy=Yt.each,jy=function(e){re
turn!!e.select},$y=function(e){return!(!e||!e.ownerDocument)&&Ur.contains(er.fromDom(e.ownerDocument),er.fromDom(e))},Wy=function(u,s,e,c){var n,t,l,f,a,r=function(e,t){return Fy(c,e,t)},o=function(e){var t=m();t.collapse(!!e),i(t)},d=function(){return s.getSelection?s.getSelection():s.document.selection},m=function(){var e,t,n,r,o=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}};if(!s)return null;if(null==(r=s.document))return null;if(c.bookmark!==undefined&&!1===Ep(c)){var i=Ig(c);if(i.isSome())return i.map(function(e){return yy(c,[e])[0]}).getOr(r.createRange())}try{(e=d())&&(t=0<e.rangeCount?e.getRangeAt(0):e.createRange?e.createRange():r.createRange())}catch(a){}return(t=yy(c,[t])[0])||(t=r.createRange?r.createRange():r.body.createTextRange()),t.setStart&&9===t.startContainer.nodeType&&t.collapsed&&(n=u.getRoot(),t.setStart(n,0),t.setEnd(n,0)),l&&f&&(0===o(t.START_TO_START,t,l)&&am
p;0===o(t.END_TO_END,t,l)?t=f:f=l=null),t},i=function(e,t){var n,r;if((o=e)&&(jy(o)||$y(o.startContainer)&&$y(o.endContainer))){var o,i=jy(e)?e:null;if(i){f=null;try{i.select()}catch(a){}}else{if(n=d(),e=c.fire("SetSelectionRange",{range:e,forward:t}).range,n){f=e;try{n.removeAllRanges(),n.addRange(e)}catch(a){}!1===t&&n.extend&&(n.collapse(e.endContainer,e.endOffset),n.extend(e.startContainer,e.startOffset)),l=0<n.rangeCount?n.getRangeAt(0):null}e.collapsed||e.startContainer!==e.endContainer||!n.setBaseAndExtent||Re.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(r=e.startContainer.childNodes[e.startOffset])&&"IMG"===r.tagName&&(n.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),n.anchorNode===e.startContainer&&n.focusNode===e.endContainer||n.setBaseAndExtent(r,0,r,1)),c.fire("AfterSetSelectionRange",{range:e,forward:t})}}},g=fun
ction(){var e,t,n=d();return!(n&&n.anchorNode&&n.focusNode)||((e=u.createRng()).setStart(n.anchorNode,n.anchorOffset),e.collapse(!0),(t=u.createRng()).setStart(n.focusNode,n.focusOffset),t.collapse(!0),e.compareBoundaryPoints(e.START_TO_START,t)<=0)},p={bookmarkManager:null,controlSelection:null,dom:u,win:s,serializer:e,editor:c,collapse:o,setCursorLocation:function(e,t){var n=u.createRng();e?(n.setStart(e,t),n.setEnd(e,t),i(n),o(!1)):(ph(u,n,c.getBody(),!0),i(n))},getContent:function(e){return My(c,e)},setContent:r,getBookmark:function(e,t){return n.getBookmark(e,t)},moveToBookmark:function(e){return n.moveToBookmark(e)},select:function(e,t){var r,n,o;return(r=u,n=e,o=t,A.from(n).map(function(e){var t=r.nodeIndex(e),n=r.createRng();return n.setStart(e.parentNode,t),n.setEnd(e.parentNode,t+1),o&&(ph(r,n,e,!0),ph(r,n,e,!1)),n})).each(i),e},isCollapsed:function(){var e=m(),t=d();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("St
artToEnd",e):!t||e.collapsed)},isForward:g,setNode:function(e){return r(u.getOuterHTML(e)),e},getNode:function(){return e=c.getBody(),(t=m())?(r=t.startContainer,o=t.endContainer,i=t.startOffset,a=t.endOffset,n=t.commonAncestorContainer,!t.collapsed&&(r===o&&a-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?qy(r.nextSibling,!0):r.parentNode,o=0===a?qy(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n):e;var e,t,n,r,o,i,a},getSel:d,setRng:i,getRng:m,getStart:function(e){return zy(c.getBody(),m(),e)},getEnd:function(e){return Vy(c.getBody(),m(),e)},getSelectedBlocks:function(e,t){return function(e,t,n,r){var o,i,a=[];if(i=e.getRoot(),n=e.getParent(n||zy(i,t,!1),e.isBlock),r=e.getParent(r||Vy(i,t,!1),e.isBlock),n&&n!==i&&a.push(n),n&&r&&n!==r)for(var u=new io(o=n,i);(o=u.next())&&o!==r;)e.isBlock(o)&am
p;&a.push(o);return r&&n!==r&&r!==i&&a.push(r),a}(u,m(),e,t)},normalize:function(){var e=m(),t=d();if(!_m(t)&&hh(c)){var n=ag(u,e);return n.each(function(e){i(e,g())}),n.getOr(e)}return e},selectorChanged:function(e,t){var i;return a||(a={},i={},c.on("NodeChange",function(e){var n=e.element,r=u.getParents(n,null,u.getRoot()),o={};Hy(a,function(e,n){Hy(r,function(t){if(u.is(t,n))return i[n]||(Hy(e,function(e){e(!0,{node:t,selector:n,parents:r})}),i[n]=e),o[n]=e,!1})}),Hy(i,function(e,t){o[t]||(delete i[t],Hy(e,function(e){e(!1,{node:n,selector:t,parents:r})}))})})),a[e]||(a[e]=[]),a[e].push(t),p},getScrollContainer:function(){for(var e,t=u.getRoot();t&&"BODY"!==t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return Ks(c,e,t)},placeCaretAt:function(e,t){return i(by(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=m();return e.collapsed?Au.fromRangeS
tart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,t.destroy()}};return n=my(p),t=hy(p,c),p.bookmarkManager=n,p.controlSelection=t,p},Ky=Bo.isContentEditableFalse,Xy=nu,Yy=Jc,Gy=Gc,Jy=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},Qy=function(e,t,n,r){var o,i,a,u,s,c,l=e===Tu.Forwards,f=l?Gy:Yy;return!r.collapsed&&(o=Xy(r),Ky(o))?ls(e,t,o,e===Tu.Backwards,!0):(u=_a(r.startContainer),f(i=Yc(e,t.getBody(),r))?fs(t,i.getNode(!l)):(i=n(i))?f(i)?ls(e,t,i.getNode(!l),l,!0):f(a=n(i))&&(!(c=Uc(s=i,a))&&Bo.isBr(s.getNode())||c)?ls(e,t,a.getNode(!l),l,!0):u?ms(t,i.toRange(),!0):null:u?r:null)},Zy=function(e,t,n,r){var o,i,a,u,s,c,l,f,d;if(d=Xy(r),o=Yc(e,t.getBody(),r),i=n(t.getBody(),Ph(1),o),a=jt.filter(i,Lh(1)),s=jt.last(o.getClientRects()),(Gy(o)||Qc(o))&&(d=o.getNode()),(Yy(o)||Zc(o))&&(d=o.getNode(!0)),!s)return null;if(c=s.left,(u=Vh(a,c))&&Ky(u.node))return l=Math.abs(c-u.left),f=Math.abs(
c-u.right),ls(e,t,u.node,l<f,!0);if(d){var m=function(e,t,n,r){var o,i,a,u,s,c,l=Ts(t),f=[],d=0,m=function(e){return jt.last(e.getClientRects())};1===e?(o=l.next,i=tu,a=eu,u=Au.after(r)):(o=l.prev,i=eu,a=tu,u=Au.before(r)),c=m(u);do{if(u.isVisible()&&!a(s=m(u),c)){if(0<f.length&&i(s,jt.last(f))&&d++,(s=Ja(s)).position=u,s.line=d,n(s))return f;f.push(s)}}while(u=o(u));return f}(e,t.getBody(),Ph(1),d);if(u=Vh(jt.filter(m,Lh(1)),c))return ms(t,u.position.toRange(),!0);if(u=jt.last(jt.filter(m,Lh(0))))return ms(t,u.position.toRange(),!0)}},eC=function(e,t,n){var r,o,i,a,u=Ts(e.getBody()),s=wa.curry(Jy,u.next),c=wa.curry(Jy,u.prev);if(n.collapsed&&e.settings.forced_root_block){if(!(r=e.dom.getParent(n.startContainer,"PRE")))return;(1===t?s(Au.fromRangeStart(n)):c(Au.fromRangeStart(n)))||(a=(i=e).dom.create(i.settings.forced_root_block),(!Re.ie||11<=Re.ie)&&(a.innerHTML='<br data-mce-bogus="1">'),o=a,1===t?e.$(r).a
fter(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},tC=function(l,f){return function(){var e,t,n,r,o,i,a,u,s,c=(t=f,r=Ts((e=l).getBody()),o=wa.curry(Jy,r.next),i=wa.curry(Jy,r.prev),a=t?Tu.Forwards:Tu.Backwards,u=t?o:i,s=e.selection.getRng(),(n=Qy(a,e,u,s))?n:(n=eC(e,a,s))||null);return!!c&&(l.selection.setRng(c),!0)}},nC=function(u,s){return function(){var e,t,n,r,o,i,a=(r=(t=s)?1:-1,o=t?Oh:Bh,i=(e=u).selection.getRng(),(n=Zy(r,e,o,i))?n:(n=eC(e,r,i))||null);return!!a&&(u.selection.setRng(a),!0)}},rC=function(e,r){return G($(e,function(e){return zb({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:v},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},oC=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.prototype.slice.call(arguments,1);return function(
){return e.apply(null,r)}},iC=function(e,t){return V(rC(e,t),function(e){return e.action()})},aC=function(i,a){i.on("keydown",function(e){var t,n,r,o;!1===e.isDefaultPrevented()&&(t=i,n=a,r=e,o=Qn.detect().os,iC([{keyCode:Wh.RIGHT,action:tC(t,!0)},{keyCode:Wh.LEFT,action:tC(t,!1)},{keyCode:Wh.UP,action:nC(t,!1)},{keyCode:Wh.DOWN,action:nC(t,!0)},{keyCode:Wh.RIGHT,action:xc(t,!0)},{keyCode:Wh.LEFT,action:xc(t,!1)},{keyCode:Wh.UP,action:wc(t,!1)},{keyCode:Wh.DOWN,action:wc(t,!0)},{keyCode:Wh.RIGHT,action:um.move(t,n,!0)},{keyCode:Wh.LEFT,action:um.move(t,n,!1)},{keyCode:Wh.RIGHT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:um.moveNextWord(t,n)},{keyCode:Wh.LEFT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:um.movePrevWord(t,n)}],r).each(function(e){r.preventDefault()}))})},uC=function(e){return 1===Wr.children(e).length},sC=function(e,t,n,r){var o,i,a,u,s=b(Kv,t),c=$(U(r,s),function(e){return e.dom()});if(0===c.length)hd(t,e,n);else{var l=(o=n.dom(),i=c,a=zv(!1),u=$v(i,a.
dom()),ki.before(er.fromDom(o),a),Di.remove(er.fromDom(o)),Au(u,0));t.selection.setRng(l.toRange())}},cC=function(n,r){var t,e=er.fromDom(n.getBody()),o=er.fromDom(n.selection.getStart()),i=U((t=jf(o,e),K(t,fo).fold(H(t),function(e){return t.slice(0,e)})),uC);return te(i).map(function(e){var t=Au.fromRangeStart(n.selection.getRng());return!!Af(r,t,e.dom())&&(sC(r,n,e,i),!0)}).getOr(!1)},lC=function(e,t){return!!e.selection.isCollapsed()&&cC(e,t)},fC=function(o,i){o.on("keydown",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(t=o,n=i,r=e,iC([{keyCode:Wh.BACKSPACE,action:oC(yd,t,!1)},{keyCode:Wh.DELETE,action:oC(yd,t,!0)},{keyCode:Wh.BACKSPACE,action:oC(fm,t,n,!1)},{keyCode:Wh.DELETE,action:oC(fm,t,n,!0)},{keyCode:Wh.BACKSPACE,action:oC(jm,t,!1)},{keyCode:Wh.DELETE,action:oC(jm,t,!0)},{keyCode:Wh.BACKSPACE,action:oC(td,t,!1)},{keyCode:Wh.DELETE,action:oC(td,t,!0)},{keyCode:Wh.BACKSPACE,action:oC(Jf,t,!1)},{keyCode:Wh.DELETE,action:oC(Jf,t,!0)},{ke
yCode:Wh.BACKSPACE,action:oC(lC,t,!1)},{keyCode:Wh.DELETE,action:oC(lC,t,!0)}],r).each(function(e){r.preventDefault()}))}),o.on("keyup",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=o,n=e,iC([{keyCode:Wh.BACKSPACE,action:oC(Cd,t)},{keyCode:Wh.DELETE,action:oC(Cd,t)}],n))})},dC=function(e){return A.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},mC=function(e,t){var n,r,o,i=t,a=e.dom,u=e.schema.getMoveCaretBeforeOnEnterElements();if(t){if(/^(LI|DT|DD)$/.test(t.nodeName)){var s=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild);s&&/^(UL|OL|DL)$/.test(s.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(o=a.createRng(),t.normalize(),t.hasChildNodes()){for(n=new io(t,t);r=n.current();){if(Bo.isText(r)){o.setStart(r,0),o.setEnd(r,0);break}if(u[r.nodeName.toLowerCase()]){o.setStartBefore(r),o.setEndBefore(r);bre
ak}i=r,r=n.next()}r||(o.setStart(i,0),o.setEnd(i,0))}else Bo.isBr(t)?t.nextSibling&&a.isBlock(t.nextSibling)?(o.setStartBefore(t),o.setEndBefore(t)):(o.setStartAfter(t),o.setEndAfter(t)):(o.setStart(t,0),o.setEnd(t,0));e.selection.setRng(o),a.remove(void 0),e.selection.scrollIntoView(t)}},gC=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},pC=dC,hC=function(e){return dC(e).fold(H(""),function(e){return e.nodeName.toUpperCase()})},vC=function(e){return dC(e).filter(function(e){return vo(er.fromDom(e))}).isSome()},bC=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},yC=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},CC=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},xC=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&am
p;!Bo.isElement(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},wC=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){var u;yC(u=n)&&yC(u.parentNode)&&(o="LI");var s,c,l=o?t(o):i.create("BR");if(xC(n,r,!0)&&xC(n,r,!1))bC(n,"LI")?i.insertAfter(l,CC(n)):i.replace(l,n);else if(xC(n,r,!0))bC(n,"LI")?(i.insertAfter(l,CC(n)),l.appendChild(i.doc.createTextNode(" ")),l.appendChild(n)):n.parentNode.insertBefore(l,n);else if(xC(n,r,!1))i.insertAfter(l,CC(n));else{n=CC(n);var f=a.cloneRange();f.setStartAfter(r),f.setEndAfter(n);var d=f.extractContents();"LI"===o&&(c="LI",(s=d).firstChild&&s.firstChild.nodeName===c)?(l=d.firstChild,i.insertAfter(d,n)):(i.insertAfter(d,n),i.insertAfter(l,n))}i.remove(r),mC(e,l)}},NC=function(e){e.innerHTML='<br data-mce-bogus="1">'},EC=function(e,t){return e.nodeName===t||e.previousSibl
ing&&e.previousSibling.nodeName===t},SC=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},TC=function(e,t,n){return!1===Bo.isText(t)?n:e?1===n&&t.data.charAt(n-1)===Sa?0:n:n===t.data.length-1&&t.data.charAt(n)===Sa?t.data.length:n},kC=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},AC=function(e,t){var n=rc(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&e.dom.setAttribs(t,oc(e))},_C=function(a,e){var t,u,s,i,c,n,r,o,l,f,d,m,g,p,h,v,b,y,C=a.dom,x=a.schema,w=x.getNonEmptyElements(),N=a.selection.getRng(),E=function(e){var t,n,r,o=s,i=x.getTextInlineElements();if(e||"TABLE"===f||"HR"===f?(t=C.create(e||m),AC(a,t)):t=c.cloneNode(!
1),r=t,!1===uc(a))C.setAttrib(t,"style",null),C.setAttrib(t,"class",null);else do{if(i[o.nodeName]){if(Gu(o))continue;n=o.cloneNode(!1),C.setAttrib(n,"id",""),t.hasChildNodes()?n.appendChild(t.firstChild):r=n,t.appendChild(n)}}while((o=o.parentNode)&&o!==u);return NC(r),t},S=function(e){var t,n,r,o;if(o=TC(e,s,i),Bo.isText(s)&&(e?0<o:o<s.nodeValue.length))return!1;if(s.parentNode===c&&g&&!e)return!0;if(e&&Bo.isElement(s)&&s===c.firstChild)return!0;if(EC(s,"TABLE")||EC(s,"HR"))return g&&!e||!g&&e;for(t=new io(s,c),Bo.isText(s)&&(e&&0===o?t.prev():e||o!==s.nodeValue.length||t.next());n=t.current();){if(Bo.isElement(n)){if(!n.getAttribute("data-mce-bogus")&&(r=n.nodeName.toLowerCase(),w[r]&&"br"!==r))return!1}else if(Bo.isText(n)&&!/^[ \t\r\n]*$/.test(n.nodeValue))return!1;e?t.prev():t.next()}return
!0},T=function(){r=/^(H[1-6]|PRE|FIGURE)$/.test(f)&&"HGROUP"!==d?E(m):E(),sc(a)&&SC(C,l)&&C.isEmpty(c)?r=C.split(l,c):C.insertAfter(r,c),mC(a,r)};ag(C,N).each(function(e){N.setStart(e.startContainer,e.startOffset),N.setEnd(e.endContainer,e.endOffset)}),s=N.startContainer,i=N.startOffset,m=rc(a),n=e.shiftKey,Bo.isElement(s)&&s.hasChildNodes()&&(g=i>s.childNodes.length-1,s=s.childNodes[Math.min(i,s.childNodes.length-1)]||s,i=g&&Bo.isText(s)?s.nodeValue.length:0),(u=kC(C,s))&&((m&&!n||!m&&n)&&(s=function(e,t,n,r,o){var i,a,u,s,c,l,f,d=t||"P",m=e.dom,g=kC(m,r);if(!(a=m.getParent(r,m.isBlock))||!SC(m,a)){if(l=(a=a||g)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),AC(e,i),a.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&
amp;&!m.isBlock(s);)s=(u=s).previousSibling;if(u&&e.schema.isValidChild(l,d.toLowerCase())){for(i=m.create(d),AC(e,i),u.parentNode.insertBefore(i,u),s=u;s&&!m.isBlock(s);)c=s.nextSibling,i.appendChild(s),s=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,m,N,s,i)),c=C.getParent(s,C.isBlock),l=c?C.getParent(c.parentNode,C.isBlock):null,f=c?c.nodeName.toUpperCase():"","LI"!==(d=l?l.nodeName.toUpperCase():"")||e.ctrlKey||(l=(c=l).parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&C.isEmpty(c)?wC(a,E,l,c,m):m&&c===a.getBody()||(m=m||"P",_a(c)?(r=Fa(c),C.isEmpty(c)&&NC(c),mC(a,r)):S()?T():S(!0)?(r=c.parentNode.insertBefore(E(),c),mC(a,EC(c,"HR")?r:c)):((t=(b=N,y=b.cloneRange(),y.setStart(b.startContainer,TC(!0,b.startContainer,b.startOffset)),y.setEnd(b.endContainer,TC(!1,b.endContainer,b.endOffset)),y).cloneRange()).setEndAfter(c),function(e){for(;Bo.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n
]+/,"")),e=e.firstChild;);}(o=t.extractContents()),r=o.firstChild,C.insertAfter(o,c),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;Bo.isElement(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(a=o)&&"A"===a.nodeName&&0===Yt.trim(Ta(a.innerText||a.textContent)).length&&e.remove(o);var a}}(C,w,r),p=C,(h=c).normalize(),(v=h.lastChild)&&!/^(left|right)$/gi.test(p.getStyle(v,"float",!0))||p.add(h,"br"),C.isEmpty(c)&&NC(c),r.normalize(),C.isEmpty(r)?(C.remove(r),T()):mC(a,r)),C.setAttrib(r,"id",""),a.fire("NewBlock",{newBlock:r})))},RC=function(e,t){return pC(e).filter(function(e){return 0<t.length&&Ir.is(er.fromDom(e),t)}).isSome()},DC=function(e){return RC(e,ic(e))},BC=function(e){return RC
(e,ac(e))},OC=nd([{br:[]},{block:[]},{none:[]}]),PC=function(e,t){return BC(e)},LC=function(n){return function(e,t){return""===rc(e)===n}},IC=function(n){return function(e,t){return vC(e)===n}},MC=function(n,r){return function(e,t){return hC(e)===n.toUpperCase()===r}},FC=function(e){return MC("pre",e)},UC=function(n){return function(e,t){return nc(e)===n}},zC=function(e,t){return DC(e)},VC=function(e,t){return t},qC=function(e){var t=rc(e),n=gC(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},HC=function(e,t){return function(n,r){return z(e,function(e,t){return e&&t(n,r)},!0)?A.some(t):A.none()}},jC=function(e,t){return Dd([HC([PC],OC.none()),HC([MC("summary",!0)],OC.br()),HC([FC(!0),UC(!1),VC],OC.br()),HC([FC(!0),UC(!1)],OC.block()),HC([FC(!0),UC(!0),VC],OC.block()),HC([FC(!0),UC(!0)],OC.br()),HC([IC(!0),VC],OC.br()),HC([IC(!0)],OC.block()),HC([LC(!0),VC,qC],OC.block()),HC([LC(!0)],OC.br()),HC(
[zC],OC.br()),HC([LC(!1),VC],OC.br()),HC([qC],OC.block())],[e,t.shiftKey]).getOr(OC.none())},$C=function(e,t){jC(e,t).fold(function(){hg(e,t)},function(){_C(e,t)},v)},WC=function(o){o.on("keydown",function(e){var t,n,r;e.keyCode===Wh.ENTER&&(t=o,(n=e).isDefaultPrevented()||(n.preventDefault(),(r=t.undoManager).typing&&(r.typing=!1,r.add()),t.undoManager.transact(function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),$C(t,n)})))})},KC=function(e,t,n){return u=t,!(!XC(n)||!Bo.isText(u.container())||(r=e,i=(o=t).container(),a=o.offset(),i.insertData(a,"\xa0"),r.selection.setCursorLocation(i,a+1),0));var r,o,i,a,u},XC=function(e){return e.fold(H(!1),H(!0),H(!0),H(!1))},YC=function(e){return!!e.selection.isCollapsed()&&(t=e,n=b(Sf.isInlineTarget,t),r=Au.fromRangeStart(t.selection.getRng()),Yd(n,t.getBody(),r).map(b(KC,t,r)).getOr(!1));var t,n,r},GC=function(r){r.on("keydown",function(e){var t,n;!1===e.isD
efaultPrevented()&&(t=r,n=e,iC([{keyCode:Wh.SPACEBAR,action:oC(YC,t)}],n).each(function(e){n.preventDefault()}))})},JC=function(e,t){var n;t.hasAttribute("data-mce-caret")&&(Fa(t),(n=e).selection.setRng(n.selection.getRng()),e.selection.scrollIntoView(t))},QC=function(e,t){var n,r=(n=e,ra(er.fromDom(n.getBody()),"*[data-mce-caret]").fold(H(null),function(e){return e.dom()}));if(r)return"compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void JC(e,r)):void(Ba(r)&&(JC(e,r),e.undoManager.add()))},ZC=function(e){e.on("keyup compositionstart",b(QC,e))},ex=function(e){var t=um.setupSelectedState(e);ZC(e),aC(e,t),fC(e,t),WC(e),GC(e)};function tx(u){var s,n,r,o=Yt.each,c=Wh.BACKSPACE,l=Wh.DELETE,f=u.dom,d=u.selection,e=u.settings,t=u.parser,i=Re.gecko,a=Re.ie,m=Re.webkit,g="data:text/mce-internal,",p=a?"Text":"URL",h=function(e,t){try{u.getDoc().execCommand(e,!1,t)}catch(n){}},v=fun
ction(e){return e.isDefaultPrevented()},b=function(){u.shortcuts.add("meta+a",null,"SelectAll")},y=function(){u.on("keydown",function(e){if(!v(e)&&e.keyCode===c&&d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},C=function(){u.inline||(u.contentStyles.push("body {min-height: 150px}"),u.on("click",function(e){var t;if("HTML"===e.target.nodeName){if(11<Re.ie)return void u.getBody().focus();t=u.selection.getRng(),u.getBody().focus(),u.selection.setRng(t),u.selection.normalize(),u.nodeChanged()}}))};return u.on("keydown",function(e){var t,n,r,o,i;if(!v(e)&&e.keyCode===Wh.BACKSPACE&&(n=(t=d.getRng()).startContainer,r=t.startOffset,o=f.getRoot(),i=n,t.collapsed&&0===r)){for(;i&&i.parentNode&&i.parentNode.firstChild=
==i&&i.parentNode!==o;)i=i.parentNode;"BLOCKQUOTE"===i.tagName&&(u.formatter.toggle("blockquote",null,i),(t=f.createRng()).setStart(n,0),t.setEnd(n,0),d.setRng(t))}}),s=function(e){var t=f.create("body"),n=e.cloneContents();return t.appendChild(n),d.serializer.serialize(t,{format:"html"})},u.on("keydown",function(e){var t,n,r,o,i,a=e.keyCode;if(!v(e)&&(a===l||a===c)){if(t=u.selection.isCollapsed(),n=u.getBody(),t&&!f.isEmpty(n))return;if(!t&&(r=u.selection.getRng(),o=s(r),(i=f.createRng()).selectNode(u.getBody()),o!==s(i)))return;e.preventDefault(),u.setContent(""),n.firstChild&&f.isBlock(n.firstChild)?u.selection.setCursorLocation(n.firstChild,0):u.selection.setCursorLocation(n,0),u.nodeChanged()}}),Re.windowsPhone||u.on("keyup focusin mouseup",function(e){Wh.modifierPressed(e)||d.normalize()},!0),m&&(u.settings.content_editable||f.bind(u.getDoc(),"mous
edown mouseup",function(e){var t;if(e.target===u.getDoc().documentElement)if(t=d.getRng(),u.getBody().focus(),"mousedown"===e.type){if(Da(t.startContainer))return;d.placeCaretAt(e.clientX,e.clientY)}else d.setRng(t)}),u.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==f.getContentEditableParent(t)&&(e.preventDefault(),u.selection.select(t),u.nodeChanged()),"A"===t.nodeName&&f.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),d.select(t))}),e.forced_root_block&&u.on("init",function(){h("DefaultParagraphSeparator",e.forced_root_block)}),u.on("init",function(){u.dom.bind(u.getBody(),"submit",function(e){e.preventDefault()})}),y(),t.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()}),Re.iOS?(u.inline||u.on("keydow
n",function(){document.activeElement===document.body&&u.getWin().focus()}),C(),u.on("click",function(e){var t=e.target;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)}),u.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):b()),11<=Re.ie&&(C(),y()),Re.ie&&(b(),h("AutoUrlDetect",!1),u.on("dragstart",function(e){var t,n,r;(t=e).dataTransfer&&(u.selection.isCollapsed()&&"IMG"===t.target.tagName&&d.select(t.target),0<(n=u.selection.getContent()).length&&(r=g+escape(u.id)+","+escape(n),t.dataTransfer.setData(p,r)))}),u.on("drop",function(e){if(!v(e)){var t=(i=e).dataTransfer&&(a=i.dataTransfer.getData(p))&&0<=a.indexOf(g)?(a=a.substr(g.length).split(","),{id:unescape(a[0]),html:unescape(a[1])}):null;if(t&&t.id!==u.id){e.preventDefault();var n=by(e.x,e.y,u.getDoc
());d.setRng(n),r=t.html,o=!0,u.queryCommandSupported("mceInsertClipboardContent")?u.execCommand("mceInsertClipboardContent",!1,{content:r,internal:o}):u.execCommand("mceInsertContent",!1,r)}}var r,o,i,a})),i&&(u.on("keydown",function(e){if(!v(e)&&e.keyCode===c){if(!u.getBody().getElementsByTagName("hr").length)return;if(d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode(),n=t.previousSibling;if("HR"===t.nodeName)return f.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(f.remove(n),e.preventDefault())}}}),Range.prototype.getClientRects||u.on("mousedown",function(e){if(!v(e)&&"HTML"===e.target.nodeName){var t=u.getBody();t.blur(),Le.setEditorTimeout(u,function(){t.focus()})}}),n=function(){var e=f.getAttribs(d.getStart().cloneNode(!1));return function(){var t=d.getStart();t!==u.getBody()&&
(f.setAttrib(t,"style",null),o(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}},r=function(){return!d.isCollapsed()&&f.getParent(d.getStart(),f.isBlock)!==f.getParent(d.getEnd(),f.isBlock)},u.on("keypress",function(e){var t;if(!v(e)&&(8===e.keyCode||46===e.keyCode)&&r())return t=n(),u.getDoc().execCommand("delete",!1,null),t(),e.preventDefault(),!1}),f.bind(u.getDoc(),"cut",function(e){var t;!v(e)&&r()&&(t=n(),Le.setEditorTimeout(u,function(){t()}))}),e.readonly||u.on("BeforeExecCommand MouseDown",function(){h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),e.object_resizing||h("enableObjectResizing",!1)}),u.on("SetContent ExecCommand",function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||o(f.select("a"),function(e){var t=e.parentNode,n=f.getRoot();if(t.lastChild===e){for(;t&&!f.isBlock(t);
){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}f.add(t,"br",{"data-mce-bogus":1})}})}),u.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),Re.mac&&u.on("keydown",function(e){!Wh.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),u.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}),y()),{refreshContentEditable:function(){},isHidden:function(){var e;return!i||u.removed?0:!(e=u.selection.getSel())||!e.rangeCount||0===e.rangeCount}}}var nx=function(e){return Bo.isElement(e)&&po(er.fromDom(e))},rx=function(t){t.on("click",function(e){3===e.detail&&function(e){var t=e.selection.getRng(),n=Su.fromRangeStart(t),r=Su.fromRangeEnd(t);if(Su.isElementPosition(n)){var o=n.container();nx(o)&&al.firstPositionIn(o).each(function(e){return
t.setStart(e.container(),e.offset())})}Su.isElementPosition(r)&&(o=n.container(),nx(o)&&al.lastPositionIn(o).each(function(e){return t.setEnd(e.container(),e.offset())})),e.selection.setRng(uf(t))}(t)})},ox=function(e){var t,n;(t=e).on("click",function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}),(n=e).parser.addNodeFilter("details",function(e){F(e,function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open")})}),n.serializer.addNodeFilter("details",function(e){F(e,function(e){var t=e.attr("data-mce-open");e.attr("open",k(t)?t:null),e.attr("data-mce-open",null)})})},ix=hi.DOM,ax=function(e){var t;e.bindPendingEventDelegates(),e.initialized=!0,e.fire("init"),e.focus(!0),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),(t=e).settings.auto_focus&&Le.setEditorTimeout(t,function(
){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()},100)},ux=function(t,e){var n,r,u,o,i,a,s,c,l,f,d,m=t.settings,g=t.getElement(),p=t.getDoc();m.inline||(t.getElement().style.visibility=t.orgVisibility),e||m.content_editable||(p.open(),p.write(t.iframeHTML),p.close()),m.content_editable&&(t.on("remove",function(){var e=this.getBody();ix.removeClass(e,"mce-content-body"),ix.removeClass(e,"mce-edit-focus"),ix.setAttrib(e,"contentEditable",null)}),ix.addClass(g,"mce-content-body"),t.contentDocument=p=m.content_document||document,t.contentWindow=m.content_window||window,t.bodyElement=g,m.content_document=m.content_window=null,m.root_name=g.nodeName.toLowerCase()),(n=t.getBody()).disabled=!0,t.readonly=m.readonly,t.readonly||(t.inline&&"static"===ix.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable=t.getPar
am("content_editable_state",!0)),n.disabled=!1,t.editorUpload=uh(t),t.schema=ri(m),t.dom=hi(p,{keep_values:!0,url_converter:t.convertURL,url_converter_scope:t,hex_colors:m.force_hex_style_colors,class_filter:m.class_filter,update_styles:!0,root_element:t.inline?t.getBody():null,collect:m.content_editable,schema:t.schema,onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=((o=ay((u=t).settings,u.schema)).addAttributeFilter("src,href,style,tabindex",function(e,t){for(var n,r,o,i=e.length,a=u.dom;i--;)if(r=(n=e[i]).attr(t),o="data-mce-"+t,!n.attributes.map[o]){if(0===r.indexOf("data:")||0===r.indexOf("blob:"))continue;"style"===t?((r=a.serializeStyle(a.parseStyle(r),n.name)).length||(r=null),n.attr(o,r),n.attr(t,r)):"tabindex"===t?(n.attr(o,r),n.attr(t,null)):n.attr(o,u.convertURL(r,t,n.name))}}),o.addNodeFilter("script",function(e){for(var t,n,r=e.length;r--;)0!==(n=(t=e[r]).attr("type
")||"no/type").indexOf("mce-")&&t.attr("type","mce-"+n)}),o.addNodeFilter("#cdata",function(e){for(var t,n=e.length;n--;)(t=e[n]).type=8,t.name="#comment",t.value="[CDATA["+t.value+"]]"}),o.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t,n=e.length,r=u.schema.getNonEmptyElements();n--;)(t=e[n]).isEmpty(r)&&0===t.getAll("br").length&&(t.append(new Yb("br",1)).shortEnded=!0)}),o),t.serializer=fy(m,t),t.selection=Wy(t.dom,t.getWin(),t.serializer,t),t.experimental=(i=Vl(t),a={},Object.defineProperty(a,"annotator",{get:function(){return console.warn("Using experimental API: annotator"),i}}),a),t.formatter=Mb(t),t.undoManager=Ev(t),t._nodeChangeDispatcher=new vh(t),t._selectionOverrides=Qh(t),ox(t),rx(t),ex(t),fh(t),t.fire("PreInit"),m.browser_spellcheck||m.gecko_spellcheck||(p.body.spellcheck=!1,ix.setAttrib
(n,"spellcheck","false")),t.quirks=tx(t),t.fire("PostRender"),m.directionality&&(n.dir=m.directionality),m.nowrap&&(n.style.whiteSpace="nowrap"),m.protect&&t.on("BeforeSetContent",function(t){Yt.each(m.protect,function(e){t.content=t.content.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})})}),t.on("SetContent",function(){t.addVisual(t.getBody())}),t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.on("compositionstart compositionend",function(e){t.composing="compositionstart"===e.type}),0<t.contentStyles.length&&(r="",Yt.each(t.contentStyles,function(e){r+=e+"\r\n"}),t.dom.addStyle(r)),(s=t,s.inline?ix.styleSheetLoader:s.dom.styleSheetLoader).loadAll(t.contentCSS,function(e){ax(t)},function(e){ax(t)}),m.content_style&&(c=t,l=m.content_style,f=er.fro
mDom(c.getDoc().head),d=er.fromTag("style"),vr.set(d,"type","text/css"),ki.append(d,er.fromText(l)),ki.append(f,d))},sx=hi.DOM,cx=function(e,t){var n,r,o,i,a,u,s,c=e.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),l=(n=e.id,r=c,o=t.height,i=Gs(e),s=er.fromTag("iframe"),vr.setAll(s,i),vr.setAll(s,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),Sr(s,{width:"100%",height:(a=o,u="number"==typeof a?a+"px":a,u||""),display:"block"}),s).dom();l.onload=function(){l.onload=null,e.fire("load")};var f,d,m,g,p=function(e,t){if(document.domain!==window.location.hostname&&Re.ie&&Re.ie<12){var n=ah.uuid("mce");e[n]=function(){ux(e)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tin
ymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return sx.setAttrib(t,"src",r),!0}return!1}(e,l);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=l,e.iframeHTML=(g=Js(f=e)+"<html><head>",Qs(f)!==f.documentBaseUrl&&(g+='<base href="'+f.documentBaseURI.getURI()+'" />'),g+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',d=Zs(f),m=ec(f),tc(f)&&(g+='<meta http-equiv="Content-Security-Policy" content="'+tc(f)+'" />'),g+='</head><body id="'+d+'" class="mce-content-body '+m+'" data-id="'+f.id+'"><br></body></html>'),sx.add(t.iframeContainer,l),p},lx=function(e,t){var n=cx(e,t);t.editorContainer&&(sx.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=sx.isHidden(t.editorContainer)),e.getElement().style.di
splay="none",sx.setAttrib(e.id,"aria-hidden","true"),n||ux(e)},fx=hi.DOM,dx=function(t,n,e){var r,o,i=Hp.get(e);if(r=Hp.urls[e]||t.documentBaseUrl.replace(/\/$/,""),e=Yt.trim(e),i&&-1===Yt.inArray(n,e)){if(Yt.each(Hp.dependencies(e),function(e){dx(t,n,e)}),t.plugins[e])return;o=new i(t,r,t.$),(t.plugins[e]=o).init&&(o.init(t,r),n.push(e))}},mx=function(e){return e.replace(/^\-/,"")},gx=function(e){return{editorContainer:e,iframeContainer:e}},px=function(e){var t,n,r=e.getElement();return e.inline?gx(null):(t=r,n=fx.create("div"),fx.insertAfter(n,t),gx(n))},hx=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.getElement();return e.orgDisplay=m.style.display,k(d.theme)?(l=(o=e).settings,f=o.getElement(),i=l.width||fx.getStyle(f,"width")||"100%",a=l.height||fx.getStyle(f,"height")||f.offsetHeight,u=l.min_height||100,(s=/^[0-9\.]+(|px)$/i).test(""+i)&&(i=Math.
max(parseInt(i,10),100)),s.test(""+a)&&(a=Math.max(parseInt(a,10),u)),c=o.theme.renderUI({targetNode:f,width:i,height:a,deltaWidth:l.delta_width,deltaHeight:l.delta_height}),l.content_editable||(a=(c.iframeHeight||a)+("number"==typeof a?c.deltaHeight||0:""))<u&&(a=u),c.height=a,c):O(d.theme)?(r=(t=e).getElement(),(n=t.settings.theme(t,r)).editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:r.offsetHeight,n):px(e)},vx=function(t){var e,n,r,o,i,a,u=t.settings,s=t.getElement();return t.rtl=u.rtl_ui||t.editorManager.i18n.rtl,t.editorManager.i18n.setCode(u.language),u.aria_label=u.aria_label||fx.getAttrib(s,"aria-label",t.getLang("aria.rich_text_area")),t.fire("ScriptsLoaded"),o=(n
=t).settings.theme,k(o)?(n.settings.theme=mx(o),r=jp.get(o),n.theme=new r(n,jp.urls[o]),n.theme.init&&n.theme.init(n,jp.urls[o]||n.documentBaseUrl.replace(/\/$/,""),n.$)):n.theme={},i=t,a=[],Yt.each(i.settings.plugins.split(/[ ,]/),function(e){dx(i,a,mx(e))}),e=hx(t),t.editorContainer=e.editorContainer?e.editorContainer:null,u.content_css&&Yt.each(Yt.explode(u.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),u.content_editable?ux(t):lx(t,e)},bx=hi.DOM,yx=function(e){return"-"===e.charAt(0)},Cx=function(i,a){var u=xi.ScriptLoader;!function(e,t,n,r){var o=t.settings,i=o.theme;if(k(i)){if(!yx(i)&&!jp.urls.hasOwnProperty(i)){var a=o.theme_url;a?jp.load(i,t.documentBaseURI.toAbsolute(a)):jp.load(i,"themes/"+i+"/theme"+n+".js")}e.loadQueue(function(){jp.waitFor(i,r)})}else r()}(u,i,a,function(){var e,t,n,r,o;e=u,(n=(t=i).settings).language&&"en"!==n.language&&!n
.language_url&&(n.language_url=t.editorManager.baseURL+"/langs/"+n.language+".js"),n.language_url&&!t.editorManager.i18n.data[n.language]&&e.add(n.language_url),r=i.settings,o=a,Yt.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),Yt.each(r.external_plugins,function(e,t){Hp.load(t,e),r.plugins+=" "+t}),Yt.each(r.plugins.split(/[ ,]/),function(e){if((e=Yt.trim(e))&&!Hp.urls[e])if(yx(e)){e=e.substr(1,e.length);var t=Hp.dependencies(e);Yt.each(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=Hp.createUrl(t,e),Hp.load(e.resource,e)})}else Hp.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),u.loadQueue(function(){i.removed||vx(i)},i,function(e){Up(i,e[0]),i.removed||vx(i)})})},xx=function(t){var e=t.settings,n=t.id,r=function(){bx.unbind(window,"ready",r),t.render()};if(je.Event.domLoaded){if(
t.getElement()&&Re.contentEditable){e.inline?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var o=t.getElement().form||bx.getParent(n,"form");o&&(t.formElement=o,e.hidden_input&&!/TEXTAREA|INPUT/i.test(t.getElement().nodeName)&&(bx.insertAfter(bx.create("input",{type:"hidden",name:n}),n),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},bx.bind(o,"submit reset",t.formEventDelegate),t.on("reset",function(){t.setContent(t.startContent,{format:"raw"})}),!e.submit_patch||o.submit.nodeType||o.submit.length||o._mceOldSubmit||(o._mceOldSubmit=o.submit,o.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),o._mceOldSubmit(o)})),t.windowManager=Pp(t),t.notificationManager=Op(t),"xml"===e.encoding&&t.on("GetContent",function(e){e.save&&(e.content=bx.encode(e.conten
t))}),e.add_form_submit_trigger&&t.on("submit",function(){t.initialized&&t.save()}),e.add_unload_trigger&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("BeforeUnload",t._beforeUnload)),t.editorManager.add(t),Cx(t,t.suffix)}}else bx.bind(window,"ready",r)},wx=function(e,t,n){var r=e.sidebars?e.sidebars:[];r.push({name:t,settings:n}),e.sidebars=r},Nx=Yt.each,Ex=Yt.trim,Sx="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),Tx={ftp:21,http:80,https:443,mailto:25},kx=function(r,e){var t,n,o=this;if(r=Ex(r),t=(e=o.settings=e||{}).base_uri,/^([\w\-]+):([^\/]{2})/i.test(r)||/^\s*#/.test(r))o.source=r;else{var i=0===r.indexOf("//");0!==r.indexOf("/")||i||(r=(t&&t.protocol||"http")+"://mce_host"+r),/^[\w\-]*:
?\/\//.test(r)||(n=e.base_uri?e.base_uri.path:new kx(document.location.href).directory,""==e.base_uri.protocol?r="//mce_host"+o.toAbsPath(n,r):(r=/([^#?]*)([#?]?.*)/.exec(r),r=(t&&t.protocol||"http")+"://mce_host"+o.toAbsPath(n,r[1])+r[2])),r=r.replace(/@@/g,"(mce_at)"),r=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(r),Nx(Sx,function(e,t){var n=r[t];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[e]=n}),t&&(o.protocol||(o.protocol=t.protocol),o.userInfo||(o.userInfo=t.userInfo),o.port||"mce_host"!==o.host||(o.port=t.port),o.host&&"mce_host"!==o.host||(o.host=t.host),o.source=""),i&&(o.protocol="")}};kx.prototype={setPath:function(e){e=/^(.*?)\/?(\w+)?$/.exec(e),this.path=e[0],this.directory=e[1],this.f
ile=e[2],this.source="",this.getURI()},toRelative:function(e){var t;if("./"===e)return e;if("mce_host"!==(e=new kx(e,{base_uri:this})).host&&this.host!==e.host&&e.host||this.port!==e.port||this.protocol!==e.protocol&&""!==e.protocol)return e.getURI();var n=this.getURI(),r=e.getURI();return n===r||"/"===n.charAt(n.length-1)&&n.substr(0,n.length-1)===r?n:(t=this.toRelPath(this.path,e.path),e.query&&(t+="?"+e.query),e.anchor&&(t+="#"+e.anchor),t)},toAbsolute:function(e,t){return(e=new kx(e,{base_uri:this})).getURI(t&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=Tx[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r,o,i=0,a="";if(e=(e=e.substring(0,e.lastIndexOf("/"))).split("/"),n=t.
split("/"),e.length>=n.length)for(r=0,o=e.length;r<o;r++)if(r>=n.length||e[r]!==n[r]){i=r+1;break}if(e.length<n.length)for(r=0,o=n.length;r<o;r++)if(r>=e.length||e[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=e.length-(i-1);r<o;r++)a+="../";for(r=i-1,o=n.length;r<o;r++)a+=r!==i-1?"/"+n[r]:n[r];return a},toAbsPath:function(e,t){var n,r,o,i=0,a=[];for(r=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),Nx(e,function(e){e&&a.push(e)}),e=a,n=t.length-1,a=[];0<=n;n--)0!==t[n].length&&"."!==t[n]&&(".."!==t[n]?0<i?i--:a.push(t[n]):i++);return 0!==(o=(n=e.length-i)<=0?a.reverse().join("/"):e.slice(0,n).join("/")+"/"+a.reverse().join("/")).indexOf("/")&&(o="/"+o),r&&o.lastIndexOf("/")!==o.length-1&&(o+=r),o},getURI:function(e){var t,n=this;return n
.source&&!e||(t="",e||(n.protocol?t+=n.protocol+"://":t+="//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},kx.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},kx.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t};var Ax=function(e,t,n){var r,o,i,a,u;if(t.format=t.format?t.format:"html",t.get=!0,t.getInner=!0,t.no_events||e.fire("Befor
eGetContent",t),"raw"===t.format)r=Yt.trim(rv.trimExternal(e.serializer,n.innerHTML));else if("text"===t.format)r=Ta(n.innerText||n.textContent);else{if("tree"===t.format)return e.serializer.serialize(n,t);i=(o=e).serializer.serialize(n,t),a=rc(o),u=new RegExp("^(<"+a+"[^>]*>( | |\\s|\xa0|<br \\/>|)<\\/"+a+">[\r\n]*|<br \\/>[\r\n]*)$"),r=i.replace(u,"")}return"text"===t.format||xo(er.fromDom(n))?t.content=r:t.content=Yt.trim(r),t.no_events||e.fire("GetContent",t),t.content},_x=function(e,t){t(e),e.firstChild&&_x(e.firstChild,t),e.next&&_x(e.next,t)},Rx=function(e,t,n){var r=function(e,n,t){var r={},o={},i=[];for(var a in t.firstChild&&_x(t.firstChild,function(t){F(e,function(e){e.name===t.name&&(r[e.name]?r[e.name].nodes.push(t):r[e.name]={filter:e,nodes:[t]})}),F(n,function(e){"string"==typeof t.attr(e.
name)&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(e,t,n);F(r,function(t){F(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},Dx=function(e){return e instanceof Yb},Bx=function(e,t){var r;e.dom.setHTML(e.getBody(),t),Ep(r=e)&&al.firstPositionIn(r.getBody()).each(function(e){var t=e.getNode(),n=Bo.isTable(t)?al.firstPositionIn(t).getOr(e):e;r.selection.setRng(n.toRange())})},Ox=function(u,s,c){return void 0===c&&(c={}),c.format=c.format?c.format:"html",c.set=!0,c.content=Dx(s)?"":s,Dx(s)||c.no_events||(u.fire("BeforeSetContent",c),s=c.content),A.from(u.getBody()).fold(H(s),function(e){return Dx(s)?function(e,t,n,r){Rx(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=of({validate:e.validate},e.schema).serialize(n);return r.content=xo(er.fromDom(t))?o:Yt.trim(o),Bx(e
,r.content),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=s).length||/^\s+$/.test(r)?(a='<br data-mce-bogus="1">',"TABLE"===n.nodeName?r="<tr><td>"+a+"</td></tr>":/^(UL|OL)$/.test(n.nodeName)&&(r="<li>"+a+"</li>"),(i=rc(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,r=t.dom.createHTML(i,t.settings.forced_root_block_attrs,r)):r||(r='<br data-mce-bogus="1">'),Bx(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=of({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=xo(er.fromDom(n))?r:Yt.trim(r),Bx(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},Px=hi.DOM,Lx=function(e){return A.from(e).each(function(e){return e.destroy()})},Ix=function(e){if(!e.removed){var t=e._selectionOverr
ides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save(),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&Px.remove(o.nextSibling),!e.inline&&r&&(i=e,Px.setStyle(i.id,"display",i.orgDisplay)),Gg(e),e.editorManager.remove(e),Px.remove(e.getContainer()),Lx(t),Lx(n),e.destroy()}var i},Mx=function(e,t){var n,r,o,i=e.selection,a=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),Lx(i),Lx(a)),(r=(n=e).formElement)&&(r._mceOldSubmit&&(r.submit=r._mceOldSubmit,r._mceOldSubmit=null),Px.unbind(r,"submit reset",n.formEventDelegate)),(o=e).contentAreaContainer=o.formElement=o.container=o.editorContainer=null,o.bodyElement=o.contentDocument=o.contentWindow=null,o.iframeElement=o.targetElm=null,o.selection&&(o.selection=o.selection.win=o.selection.dom=o.selection.dom.doc=null),e.destroyed
=!0):e.remove())},Fx=hi.DOM,Ux=Yt.extend,zx=Yt.each,Vx=Yt.resolve,qx=Re.ie,Hx=function(e,t,n){var r,o,i,a,u,s,c,l=this,f=l.documentBaseUrl=n.documentBaseURL,d=n.baseURI;r=l,o=e,i=f,a=n.defaultSettings,u=t,c={id:o,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:i,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,
summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:(s=r).convertURL,url_converter_scope:s,ie7_compat:!0},t=yf(df,c,a,u),l.settings=t,Ei.language=t.language||"en",Ei.languageLoad=t.language_load,Ei.baseURL=n.baseURL,l.id=e,l.setDirty(!1),l.plugins={},l.documentBaseURI=new kx(t.document_base_url,{base_uri:d}),l.baseURI=d,l.contentCSS=[],l.contentStyles=[],l.shortcuts=new mp(l),l.loadedCSS={},l.editorCommands=new qg(l),l.suffix=n.suffix,l.editorManager=n,l.inline=t.inline,l.buttons={},l.menuItems={},t.cache_suffix&&(Re.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(Re.overrideViewPort=!1),n.fire("SetupEditor",{editor:
l}),l.execCallback("setup",l),l.$=pn.overrideDefaults(function(){return{context:l.inline?l.getBody():l.getDoc(),element:l.getBody()}})};Ux(Hx.prototype={render:function(){xx(this)},focus:function(e){Np(this,e)},hasFocus:function(){return Ep(this)},execCallback:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,o=this.settings[e];if(o)return this.callbackLookup&&(r=this.callbackLookup[e])&&(o=r.func,r=r.scope),"string"==typeof o&&(r=(r=o.replace(/\.\w+$/,""))?Vx(r):0,o=Vx(o),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[e]={func:o,scope:r}),o.apply(r||this,Array.prototype.slice.call(arguments,1))},translate:function(e){if(e&&Yt.is(e,"string")){var n=this.settings.language||"en",r=this.editorManager.i18n;e=r.data[n+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,t){return r.data[n+"."+t]||"{#"+t+"}"})}return this.edito
rManager.translate(e)},getLang:function(e,t){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(t!==undefined?t:"{#"+e+"}")},getParam:function(e,t,n){return wf(this,e,t,n)},nodeChanged:function(e){this._nodeChangeDispatcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.stateSelector&&"undefined"==typeof t.active&&(t.active=!1),t.text||t.icon||(t.icon=e),n.buttons=n.buttons,t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addSidebar:function(e,t){return wx(this,e,t)},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems,n.menuItems[e]=t},addContextToolbar:function(e,t){var n,r=this;r.contextToolbars=r.contextToolbars||[],"string"==typeof e&&(n=e,e=function(e){return r.dom.is(e,n)}),r.contextToolbars.push({id:ah.uuid("mcet"),predicate:e,ite
ms:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable=!0:(Fx.show(this.getContainer()),Fx.hide(this.id)),this.load(),this.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(qx&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1
,e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(Fx.hide(e.getContainer()),Fx.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var t,n=this.getElement();return this.removed?"":n?((e=e||{}).load=!0,t=this.setContent(n.value!==undefined?n.value:n.innerHTML,e),e.element=n,e.no_events||this.fire("LoadContent",e),e.element=n=null,t):void 0},save:function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,/TEXTAREA|INPUT/i.test(o.nodeName)?o.value=t:(o.innerHTML=t,(n=Fx.getParent(r.id,"form"))&&zx(n.elements,function
(e){if(e.name===r.id)return e.value=t,!1})),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},setContent:function(e,t){return Ox(this,e,t)},getContent:function(e){return t=this,void 0===(n=e)&&(n={}),A.from(t.getBody()).fold(H("tree"===n.format?new Yb("body",11):""),function(e){return Ax(t,n,e)});var t,n},insertContent:function(e,t){t&&(e=Ux({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty")},setMode:function(e){var t,n;(n=e)!==np(t=this)&&(t.initialized?tp(t,"readonly"===n):t.on("init",function(){tp(t,"readonly"===n)}),Jg(t,n))},getContainer:function(){return this.container||(this.container=Fx.get(this.editorContainer||this.id+"_parent")),this.container},getContentAreaContainer:function(){return this.co
ntentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=Fx.get(this.id)),this.targetElm},getWin:function(){var e;return this.contentWindow||(e=this.iframeElement)&&(this.contentWindow=e.contentWindow),this.contentWindow},getDoc:function(){var e;return this.contentDocument||(e=this.getWin())&&(this.contentDocument=e.document),this.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",e,n,!0,t):!r.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:r.relative_urls?this.documentBaseURI.toRelative(e):e=this.documentBaseURI.toAbsolute(e,r.remove_script_host)},addVisual:function(e){var n,r=this,o=r.settings,i=r.dom;e=e||r.getBody(),r.hasVisual===undefined&&(r.hasVisual=o.visual),zx(i.select("table,a",e),func
tion(e){var t;switch(e.nodeName){case"TABLE":return n=o.visual_table_class||"mce-item-table",void((t=i.getAttrib(e,"border"))&&"0"!==t||!r.hasVisual?i.removeClass(e,n):i.addClass(e,n));case"A":return void(i.getAttrib(e,"href")||(t=i.getAttrib(e,"name")||e.id,n=o.visual_anchor_class||"mce-item-anchor",t&&r.hasVisual?i.addClass(e,n):i.removeClass(e,n)))}}),r.fire("VisualAid",{element:e,hasVisual:r.hasVisual})},remove:function(){Ix(this)},destroy:function(e){Mx(this,e)},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},sp);var jx,$x,Wx,Kx={isEditorUIElement:function(e){return-1!==e.className.toString().indexOf("mce-")}},Xx=function(n,e){var t,r;Qn.detect().browser.isIE()?(r=n).on("focusout",function(){Pg(r)}):(t=e,n.on("mouseup touchend",function(e){t.throttle()})),n.
on("keyup nodechange",function(e){var t;"nodechange"===(t=e).type&&t.selectionChange||Pg(n)})},Yx=function(e){var t,n,r,o=Bi(function(){Pg(e)},0);e.inline&&(t=e,n=o,r=function(){n.throttle()},hi.DOM.bind(document,"mouseup",r),t.on("remove",function(){hi.DOM.unbind(document,"mouseup",r)})),e.on("init",function(){Xx(e,o)}),e.on("remove",function(){o.cancel()})},Gx=hi.DOM,Jx=function(e){return Kx.isEditorUIElement(e)},Qx=function(t,e){var n=t?t.settings.custom_ui_selector:"";return null!==Gx.getParent(e,function(e){return Jx(e)||!!n&&t.dom.is(e,n)})},Zx=function(r,e){var t=e.editor;Yx(t),t.on("focusin",function(){var e=r.focusedEditor;e!==this&&(e&&e.fire("blur",{focusedEditor:this}),r.setActive(this),(r.focusedEditor=this).fire("focus",{blurredEditor:e}),this.focus(!0))}),t.on("focusout",function(){var t=this;Le.setEditorTimeou
t(t,function(){var e=r.focusedEditor;Qx(t,function(){try{return document.activeElement}catch(e){return document.body}}())||e!==t||(t.fire("blur",{focusedEditor:null}),r.focusedEditor=null)})}),jx||(jx=function(e){var t,n=r.activeEditor;t=e.target,n&&t.ownerDocument===document&&(t===document.body||Qx(n,t)||r.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),r.focusedEditor=null))},Gx.bind(document,"focusin",jx))},ew=function(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(Gx.unbind(document,"focusin",jx),jx=null)},tw=function(e){e.on("AddEditor",b(Zx,e)),e.on("RemoveEditor",b(ew,e))},nw={},rw="en",ow={setCode:function(e){e&&(rw=e,this.rtl=!!this.data[e]&&"rtl"===this.data[e]._dir)},getCode:function(){return rw},rtl:!1,add:function(e,t){var n=nw[e];for(var r in n||(nw[e]=n={}),t)n[r]=t[r];this.setCode(e)},translate:function(e){var t=nw[
rw]||{},n=function(e){return Yt.is(e,"function")?Object.prototype.toString.call(e):r(e)?"":""+e},r=function(e){return""===e||null===e||Yt.is(e,"undefined")},o=function(e){return e=n(e),Yt.hasOwn(t,e)?n(t[e]):e};if(r(e))return"";if(Yt.is(e,"object")&&Yt.hasOwn(e,"raw"))return n(e.raw);if(Yt.is(e,"array")){var i=e.slice(1);e=o(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return Yt.hasOwn(i,t)?n(i[t]):e})}return o(e).replace(/{context:\w+}$/,"")},data:nw},iw=hi.DOM,aw=Yt.explode,uw=Yt.each,sw=Yt.extend,cw=0,lw=!1,fw=[],dw=[],mw=function(t){uw(Wx.get(),function(e){"scroll"===t.type?e.fire("ScrollWindow",t):e.fire("ResizeWindow",t)})},gw=function(e){e!==lw&&(e?pn(window).on("resize scroll",mw):pn(window).off("resize scroll",mw),lw=e)},pw=function(t){var e=dw;delete fw[t.id];for(var n=0;n<fw.length;n++)if(fw[n]===t){fw.spli
ce(n,1);break}return dw=U(dw,function(e){return t!==e}),Wx.activeEditor===t&&(Wx.activeEditor=0<dw.length?dw[0]:null),Wx.focusedEditor===t&&(Wx.focusedEditor=null),e.length!==dw.length};sw(Wx={defaultSettings:{},$:pn,majorVersion:"4",minorVersion:"8.0",releaseDate:"2018-06-27",editors:fw,i18n:ow,activeEditor:null,settings:{},setup:function(){var e,t,n,r,o="";if(t=kx.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),n=window.tinymce||window.tinyMCEPreInit)e=n.base||n.baseURL,o=n.suffix;else{for(var i=document.getElementsByTagName("script"),a=0;a<i.length;a++){var u=(r=i[a].src).substring(r.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(r)){-1!==u.indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("
;/"));break}}!e&&document.currentScript&&(-1!==(r=document.currentScript.src).indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/")))}this.baseURL=new kx(t).toAbsolute(e),this.documentBaseURL=t,this.baseURI=new kx(this.baseURL),this.suffix=o,tw(this)},overrideDefaults:function(e){var t,n;(t=e.base_url)&&(this.baseURL=new kx(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new kx(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n);var r=(this.defaultSettings=e).plugin_base_urls;for(var o in r)Ei.PluginManager.urls[o]=r[o]},init:function(r){var n,u,s=this;u=Yt.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var c=function(e){var t=e.id;return t||(t=(t=e.name)&&!iw.get(t)?e.name:iw.uniqueId()
,e.setAttribute("id",t)),t},l=function(e,t){return t.constructor===RegExp?t.test(e.className):iw.hasClass(e,t)},f=function(e){n=e},e=function(){var o,i=0,a=[],n=function(e,t,n){var r=new Hx(e,t,s);a.push(r),r.on("init",function(){++i===o.length&&f(a)}),r.targetElm=r.targetElm||n,r.render()};iw.unbind(window,"ready",e),function(e){var t=r[e];t&&t.apply(s,Array.prototype.slice.call(arguments,2))}("onpageload"),o=pn.unique(function(t){var e,n=[];if(Re.ie&&Re.ie<11)return qp("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(t.types)return uw(t.types,function(e){n=n.concat(iw.select(e.selector))}),n;if(t.selector)return iw.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":0<(e=t.elements||"").length&&uw(aw(e),function(t){var e;(e=iw.get(t))?
n.push(e):uw(document.forms,function(e){uw(e.elements,function(e){e.name===t&&(t="mce_editor_"+cw++,iw.setAttrib(e,"id",t),n.push(e))})})});break;case"textareas":case"specific_textareas":uw(iw.select("textarea"),function(e){t.editor_deselector&&l(e,t.editor_deselector)||t.editor_selector&&!l(e,t.editor_selector)||n.push(e)})}return n}(r)),r.types?uw(r.types,function(t){Yt.each(o,function(e){return!iw.is(e,t.selector)||(n(c(e),sw({},r,t),e),!1)})}):(Yt.each(o,function(e){var t;(t=s.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(pw(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null)}),0===(o=Yt.grep(o,function(e){return!s.get(e.id)})).length?f([]):uw(o,function(e){var t;t=e,r.inline&&t.tagName.toLowerCase()in u?qp("Could not initialize inline editor on invalid inline target element",e):n(c(e),r,e)}))};return s.settings=r,iw.bind(wind
ow,"ready",e),new De(function(t){n?t(n):f=function(e){t(e)}})},get:function(t){return 0===arguments.length?dw.slice(0):k(t)?V(dw,function(e){return e.id===t}).getOr(null):P(t)&&dw[t]?dw[t]:null},add:function(e){var t=this;return fw[e.id]===e||(null===t.get(e.id)&&("length"!==e.id&&(fw[e.id]=e),fw.push(e),dw.push(e)),gw(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),$x||($x=function(){t.fire("BeforeUnload")},iw.bind(window,"beforeunload",$x))),e},createEditor:function(e,t){return this.add(new Hx(e,t,this))},remove:function(e){var t,n,r=this;if(e){if(!k(e))return n=e,D(r.get(n.id))?null:(pw(n)&&r.fire("RemoveEditor",{editor:n}),0===dw.length&&iw.unbind(window,"beforeunload",$x),n.remove(),gw(0<dw.length),n);uw(iw.select(e),function(e){(n=r.get(e.id))&&r.remove(n)})}else for(t=dw.length-1;0<=t;t--)r.remove(dw[t])},execCommand:function(e,t,n){var r=this.get(n)
;switch(e){case"mceAddEditor":return this.get(n)||new Hx(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?r.isHidden()?r.show():r.hide():this.execCommand("mceAddEditor",0,n),!0}return!!this.activeEditor&&this.activeEditor.execCommand(e,t,n)},triggerSave:function(){uw(dw,function(e){e.save()})},addI18n:function(e,t){ow.add(e,t)},translate:function(e){return ow.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},Kg),Wx.setup();var hw,vw=Wx;function bw(n){return{walk:function(e,t){return Pl(n,e,t)},split:Lv,normalize:function(t){return ag(n,t).fold(H(!1),function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0})}}}(hw=bw||(bw={})).compareRanges=Zm,hw.getCaret
RangeFromPoint=by,hw.getSelectedNode=nu,hw.getNode=ru;var yw,Cw,xw=bw,ww=Math.min,Nw=Math.max,Ew=Math.round,Sw=function(e,t,n){var r,o,i,a,u,s;return r=t.x,o=t.y,i=e.w,a=e.h,u=t.w,s=t.h,"b"===(n=(n||"").split(""))[0]&&(o+=s),"r"===n[1]&&(r+=u),"c"===n[0]&&(o+=Ew(s/2)),"c"===n[1]&&(r+=Ew(u/2)),"b"===n[3]&&(o-=a),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=Ew(a/2)),"c"===n[4]&&(r-=Ew(i/2)),Tw(r,o,i,a)},Tw=function(e,t,n,r){return{x:e,y:t,w:n,h:r}},kw={inflate:function(e,t,n){return Tw(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:Sw,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i<r.length;i++)if((o=Sw(e,t,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n,r,o,i;return n=Nw(e.x,t.x),r=Nw(e.y,t.y),o=ww(e.x+e.w,t.x+t.w),
i=ww(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:Tw(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,u,s,c,l,f,d;return u=e.x,s=e.y,c=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=Nw(0,t.x-u),o=Nw(0,t.y-s),i=Nw(0,c-f),a=Nw(0,l-d),u+=r,s+=o,n&&(c+=r,l+=o,u-=i,s-=a),Tw(u,s,(c-=i)-u,(l-=a)-s)},create:Tw,fromClientRect:function(e){return Tw(e.left,e.top,e.width,e.height)}},Aw={},_w={add:function(e,t){Aw[e.toLowerCase()]=t},has:function(e){return!!Aw[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),n=Aw.hasOwnProperty(t)?Aw[t]:null;if(null===n)throw new Error("Could not find module for type: "+e);return n},create:function(e,t){var n;if("string"==typeof e?(t=t||{}).type=e:e=(t=e).type,e=e.toLowerCase(),!(n=Aw[e]))throw new Error("Could not find control by type: "+e);return(n=new n(t)).type=e,n}},Rw=Yt.each,Dw=Yt.extend,Bw=function(){};Bw.extend=yw=function(n){var e,t,r,o=this.prototype,i=function(){var e,t,n;if(!Cw&&(this.init&&this.init.
apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},a=function(){return this},u=function(n,r){return function(){var e,t=this._super;return this._super=o[n],e=r.apply(this,arguments),this._super=t,e}};for(t in Cw=!0,e=new this,Cw=!1,n.Mixins&&(Rw(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),o.Mixins&&(n.Mixins=o.Mixins.concat(n.Mixins))),n.Methods&&Rw(n.Methods.split(","),function(e){n[e]=a}),n.Properties&&Rw(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return e!==undefined?(this[t]=e,this):this[t]}}),n.Statics&&Rw(n.Statics,function(e,t){i[t]=e}),n.Defaults&&o.Defaults&&(n.Defaults=Dw({},o.Defaults,n.Defaults)),n)"function"==typeof(r=n[t])&&o[t]?e[t]=u(t,r):e[t]=r;return i.prototype=e,(i.constructor=i).extend=yw,i};var Ow=Math.min,Pw=Math.max,Lw=Math.round,Iw=function(e
,n){var r,o,t,i;if(n=n||'"',null===e)return"null";if("string"==(t=typeof e))return o="\bb\tt\nn\ff\rr\"\"''\\\\",n+e.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=o.indexOf(t))+1?"\\"+o.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e)})+n;if("object"===t){if(e.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(e)){for(r=0,o="[";r<e.length;r++)o+=(0<r?",":"")+Iw(e[r],n);return o+"]"}for(i in o="{",e)e.hasOwnProperty(i)&&(o+="function"!=typeof e[i]?(1<o.length?","+n:n)+i+n+":"+Iw(e[i],n):"");return o+"}"}return""+e},Mw={serialize:Iw,parse:function(e){try{return JSON.parse(e)}catch(t){}}},Fw={callbacks:{},count:0,send:function(t){var n=this,r=hi.DOM
,o=t.count!==undefined?t.count:n.count,i="tinymce_jsonp_"+o;n.callbacks[o]=function(e){r.remove(i),delete n.callbacks[o],t.callback(e)},r.add(r.doc.body,"script",{id:i,src:t.url,type:"text/javascript"}),n.count++}},Uw={send:function(e){var t,n=0,r=function(){!e.async||4===t.readyState||1e4<n++?(e.success&&n<1e4&&200===t.status?e.success.call(e.success_scope,""+t.responseText,t,e):e.error&&e.error.call(e.error_scope,1e4<n?"TIMED_OUT":"GENERAL",t,e),t=null):setTimeout(r,10)};if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",Uw.fire("beforeInitialize",{settings:e}),t=new $p){if(t.overrideMimeType&&t.overrideMimeType(e.content_type),t.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(t.withCredentials=!0),e.content_type&&t.set
RequestHeader("Content-Type",e.content_type),e.requestheaders&&Yt.each(e.requestheaders,function(e){t.setRequestHeader(e.key,e.value)}),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=Uw.fire("beforeSend",{xhr:t,settings:e}).xhr).send(e.data),!e.async)return r();setTimeout(r,10)}}};Yt.extend(Uw,Kg);var zw=Yt.extend,Vw=function(e){this.settings=zw({},e),this.count=0};Vw.sendRPC=function(e){return(new Vw).send(e)},Vw.prototype={send:function(n){var r=n.error,o=n.success;(n=zw(this.settings,n)).success=function(e,t){void 0===(e=Mw.parse(e))&&(e={error:"JSON Parse error."}),e.error?r.call(n.error_scope||n.scope,e.error,t):o.call(n.success_scope||n.scope,e.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=Mw.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",Uw.send(n)}};var qw,Hw=window.localStorage,jw=v
w,$w={geom:{Rect:kw},util:{Promise:De,Delay:Le,Tools:Yt,VK:Wh,URI:kx,Class:Bw,EventDispatcher:jg,Observable:Kg,I18n:ow,XHR:Uw,JSON:Mw,JSONRequest:Vw,JSONP:Fw,LocalStorage:Hw,Color:function(e){var n={},u=0,s=0,c=0,t=function(e){var t;return"object"==typeof e?"r"in e?(u=e.r,s=e.g,c=e.b):"v"in e&&function(e,t,n){var r,o,i,a;if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,n=parseInt(n,10)/100,t=Pw(0,Ow(t,1)),n=Pw(0,Ow(n,1)),0!==t){switch(r=e/60,i=(o=n*t)*(1-Math.abs(r%2-1)),a=n-o,Math.floor(r)){case 0:u=o,s=i,c=0;break;case 1:u=i,s=o,c=0;break;case 2:u=0,s=o,c=i;break;case 3:u=0,s=i,c=o;break;case 4:u=i,s=0,c=o;break;case 5:u=o,s=0,c=i;break;default:u=s=c=0}u=Lw(255*(u+a)),s=Lw(255*(s+a)),c=Lw(255*(c+a))}else u=s=c=Lw(255*n)}(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(u=parseInt(t[1],10),s=parseInt(t[2],10),c=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(u=parseInt(t[1],16),s=parse
Int(t[2],16),c=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(u=parseInt(t[1]+t[1],16),s=parseInt(t[2]+t[2],16),c=parseInt(t[3]+t[3],16)),u=u<0?0:255<u?255:u,s=s<0?0:255<s?255:s,c=c<0?0:255<c?255:c,n};return e&&t(e),n.toRgb=function(){return{r:u,g:s,b:c}},n.toHsv=function(){return e=u,t=s,n=c,o=0,(i=Ow(e/=255,Ow(t/=255,n/=255)))===(a=Pw(e,Pw(t,n)))?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,{h:Lw(60*((e===i?3:n===i?1:5)-(e===i?t-n:n===i?e-t:n-e)/((o=a)-i))),s:Lw(100*r),v:Lw(100*o)});var e,t,n,r,o,i,a},n.toHex=function(){var e=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+e(u)+e(s)+e(c)},n.parse=t,n}},dom:{EventUtils:je,Sizzle:Tt,DomQuery:pn,TreeWalker:io,DOMUtils:hi,ScriptLoader:xi,RangeUtils:xw,Serializer:fy,ControlSelection:hy,BookmarkManager:my,Selection:Wy,Event:je.Event},html:{Styles:ii,Entities:Wo,Node:Yb,Schema:ri,SaxParser:tv,DomParser:ay,Writer:rf,Serializer:of},ui:{Factory:_w},Env:
Re,AddOnManager:Ei,Annotator:Vl,Formatter:Mb,UndoManager:Ev,EditorCommands:qg,WindowManager:Pp,NotificationManager:Op,EditorObservable:sp,Shortcuts:mp,Editor:Hx,FocusManager:Kx,EditorManager:vw,DOM:hi.DOM,ScriptLoader:xi.ScriptLoader,PluginManager:Ei.PluginManager,ThemeManager:Ei.ThemeManager,trim:Yt.trim,isArray:Yt.isArray,is:Yt.is,toArray:Yt.toArray,makeMap:Yt.makeMap,each:Yt.each,map:Yt.map,grep:Yt.grep,inArray:Yt.inArray,extend:Yt.extend,create:Yt.create,walk:Yt.walk,createNS:Yt.createNS,resolve:Yt.resolve,explode:Yt.explode,_addCacheSuffix:Yt._addCacheSuffix,isOpera:Re.opera,isWebKit:Re.webkit,isIE:Re.ie,isGecko:Re.gecko,isMac:Re.mac},Ww=jw=Yt.extend(jw,$w);qw=Ww,window.tinymce=qw,window.tinyMCE=qw,function(e){if("object"==typeof module)try{module.exports=e}catch(t){}}(Ww)}();
</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">+// 4.9.2 (2018-12-17)
+!function(){"use strict";var o=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]},H=function(n,r){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n(r.apply(null,e))}},j=function(e){return function(){return e}},q=function(e){return e};function d(r){for(var o=[],e=1;e<arguments.length;e++)o[e-1]=arguments[e];return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=o.concat(e);return r.apply(null,n)}}var e,t,n,r,i,a,u,s,c,l,f,m,g,p,h,v,b,y=function(n){return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return!n.apply(null,e)}},C=j(!1),x=j(!0),w=C,N=x,E=function(){return S},S=(r={fold:function(e,t){return e()},is:w,isSome:w,isNone:N,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:function(){return null},getOrUndefined:function(){return undefined},o
r:n,orThunk:t,map:E,ap:E,each:function(){},bind:E,flatten:E,exists:w,forall:N,filter:E,equals:e=function(e){return e.isNone()},equals_:e,toArray:function(){return[]},toString:j("none()")},Object.freeze&&Object.freeze(r),r),k=function(n){var e=function(){return n},t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:N,isNone:w,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return k(e(n))},ap:function(e){return e.fold(E,function(e){return k(e(n))})},each:function(e){e(n)},bind:r,flatten:e,exists:r,forall:r,filter:function(e){return e(n)?o:S},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(w,function(e){return t(n,e)})},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},A={some:k,none:E,from:function(e){return null===e||e===undefined?S:k(e)}},T=function(t){return function(e){return fu
nction(e){if(null===e)return"null";var t=typeof e;return"object"===t&&Array.prototype.isPrototypeOf(e)?"array":"object"===t&&String.prototype.isPrototypeOf(e)?"string":t}(e)===t}},R=T("string"),_=T("object"),D=T("array"),B=T("null"),O=T("boolean"),P=T("function"),L=T("number"),I=(i=Array.prototype.indexOf)===undefined?function(e,t){return X(e,t)}:function(e,t){return i.call(e,t)},M=function(e,t){return-1<I(e,t)},$=function(e,t){for(var n=e.length,r=new Array(n),o=0;o<n;o++){var i=e[o];r[o]=t(i,o,e)}return r},F=function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n,e)},W=function(e,t){for(var n=[],r=[],o=0,i=e.length;o<i;o++){var a=e[o];(t(a,o,e)?n:r).push(a)}return{pass:n,fail:r}},z=function(e,t){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];t(i,r,e)&&n.push(i)}return n},U=function(e,t,n){return F(e,function(e){n=t(n,e)}),n},
V=function(e,t){for(var n=0,r=e.length;n<r;n++){var o=e[n];if(t(o,n,e))return A.some(o)}return A.none()},K=function(e,t){for(var n=0,r=e.length;n<r;n++)if(t(e[n],n,e))return A.some(n);return A.none()},X=function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return n;return-1},Y=Array.prototype.push,G=function(e,t){return function(e){for(var t=[],n=0,r=e.length;n<r;++n){if(!Array.prototype.isPrototypeOf(e[n]))throw new Error("Arr.flatten item "+n+" was not an array, input: "+e);Y.apply(t,e[n])}return t}($(e,t))},J=function(e,t){for(var n=0,r=e.length;n<r;++n)if(!0!==t(e[n],n,e))return!1;return!0},Q=Array.prototype.slice,Z=function(e,t){return z(e,function(e){return!M(t,e)})},ee=function(e){return 0===e.length?A.none():A.some(e[0])},te=function(e){return 0===e.length?A.none():A.some(e[e.length-1])},ne=P(Array.from)?Array.from:function(e){return Q.call(e)},re="undefined"!=typeof window?window:Function("return this;")(),oe=functio
n(e,t){return function(e,t){for(var n=t!==undefined&&null!==t?t:re,r=0;r<e.length&&n!==undefined&&null!==n;++r)n=n[e[r]];return n}(e.split("."),t)},ie={getOrDie:function(e,t){var n=oe(e,t);if(n===undefined||null===n)throw e+" not available on this browser";return n}},ae=function(){return ie.getOrDie("URL")},ue={createObjectURL:function(e){return ae().createObjectURL(e)},revokeObjectURL:function(e){ae().revokeObjectURL(e)}},se=navigator,ce=se.userAgent,le=function(e){return"matchMedia"in window&&matchMedia(e).matches};g=/Android/.test(ce),u=(u=!(a=/WebKit/.test(ce))&&/MSIE/gi.test(ce)&&/Explorer/gi.test(se.appName))&&/MSIE (\w+)\./.exec(ce)[1],s=-1!==ce.indexOf("Trident/")&&(-1!==ce.indexOf("rv:")||-1!==se.appName.indexOf("Netscape"))&&11,c=-1!==ce.indexOf("Edge/")&&!u&&!s&&12,u=u||s||c,l=!a&&!s&
&/Gecko/.test(ce),f=-1!==ce.indexOf("Mac"),m=/(iPad|iPhone)/.test(ce),p="FormData"in window&&"FileReader"in window&&"URL"in window&&!!ue.createObjectURL,h=le("only screen and (max-device-width: 480px)")&&(g||m),v=le("only screen and (min-width: 800px)")&&(g||m),b=-1!==ce.indexOf("Windows Phone"),c&&(a=!1);var fe,de={opera:!1,webkit:a,ie:u,gecko:l,mac:f,iOS:m,android:g,contentEditable:!m||p||534<=parseInt(ce.match(/AppleWebKit\/(\d*)/)[1],10),transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!==u,range:window.getSelection&&"Range"in window,documentMode:u&&!c?document.documentMode||7:10,fileApi:p,ceFalse:!1===u||8<u,cacheSuffix:null,container:null,overrideViewPort:null,experimentalShadowDom:!1,canHaveCSP:!1===u||11<u,desktop:!h&&!v,windowsPhone:b},me=windo
w.Promise?window.Promise:function(){function r(e,t){return function(){e.apply(t,arguments)}}var e=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(e,r(o,this),r(u,this))},t=i.immediateFn||"function"==typeof setImmediate&&setImmediate||function(e){setTimeout(e,1)};function a(r){var o=this;null!==this._state?t(function(){var e=o._state?r.onFulfilled:r.onRejected;if(null!==e){var t;try{t=e(o._value)}catch(n){return void r.reject(n)}r.resolve(t)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function o(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"fun
ction"==typeof e)){var t=e.then;if("function"==typeof t)return void l(r(t,e),r(o,this),r(u,this))}this._state=!0,this._value=e,s.call(this)}catch(n){u.call(this,n)}}function u(e){this._state=!1,this._value=e,s.call(this)}function s(){for(var e=0,t=this._deferreds.length;e<t;e++)a.call(this,this._deferreds[e]);this._deferreds=null}function c(e,t,n,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r}function l(e,t,n){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,n(e))})}catch(o){if(r)return;r=!0,n(o)}}return i.prototype["catch"]=function(e){return this.then(null,e)},i.prototype.then=function(n,r){var o=this;return new i(function(e,t){a.call(o,new c(n,r,e,t))})},i.all=function(){var s=Array.prototype.slice.call(1===arguments.length&&e(arguments[0])?arguments[0]:arguments);return new i(function(o,i){if(0===s.length)return o([]);var a=s.length;fun
ction u(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){u(t,e)},i)}s[t]=e,0==--a&&o(s)}catch(r){i(r)}}for(var e=0;e<s.length;e++)u(e,s[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i}(),ge=function(e,t){return"number"!=typeof t&&(t=0),setTimeout(e,t)},pe=function(e,t){return"number"!=typeof t&&(t=1),setInterval(e,t)},he=function(t,n){var r,e;return(e=function(){var e=arguments;clearTimeout(r),r=ge(function(){t.apply(this,e)},n)}).stop=function(){clearTimeout(r)},e},ve={requestAnimationFrame:function(e,t){fe?fe.then(e):fe=new me(function(e){t||(t=document.body),function(e,t){var n,r=win
dow.requestAnimationFrame,o=["ms","moz","webkit"];for(n=0;n<o.length&&!r;n++)r=window[o[n]+"RequestAnimationFrame"];r||(r=function(e){window.setTimeout(e,0)}),r(e,t)}(e,t)}).then(e)},setTimeout:ge,setInterval:pe,setEditorTimeout:function(e,t,n){return ge(function(){e.removed||t()},n)},setEditorInterval:function(e,t,n){var r;return r=pe(function(){e.removed?clearInterval(r):t()},n)},debounce:he,throttle:he,clearInterval:function(e){return clearInterval(e)},clearTimeout:function(e){return clearTimeout(e)}},be=/^(?:mouse|contextmenu)|click/,ye={keyLocation:1,layerX:1,layerY:1,returnValue:1,webkitMovementX:1,webkitMovementY:1,keyIdentifier:1},Ce=function(){return!1},xe=function(){return!0},we=function(e,t,n,r){e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n)},Ne=function(e,t,n,r){e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on&q
uot;+t,n)},Ee=function(e,t){var n,r,o=t||{};for(n in e)ye[n]||(o[n]=e[n]);if(o.target||(o.target=o.srcElement||document),de.experimentalShadowDom&&(o.target=function(e,t){if(e.composedPath){var n=e.composedPath();if(n&&0<n.length)return n[0]}return t}(e,o.target)),e&&be.test(e.type)&&e.pageX===undefined&&e.clientX!==undefined){var i=o.target.ownerDocument||document,a=i.documentElement,u=i.body;o.pageX=e.clientX+(a&&a.scrollLeft||u&&u.scrollLeft||0)-(a&&a.clientLeft||u&&u.clientLeft||0),o.pageY=e.clientY+(a&&a.scrollTop||u&&u.scrollTop||0)-(a&&a.clientTop||u&&u.clientTop||0)}return o.preventDefault=function(){o.isDefaultPrevented=xe,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},o.stopPropagation=function(){o.isPropagationStopped=xe,e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)},!(o.stopImmediatePropagation=function(){o.isImmediatePropa
gationStopped=xe,o.stopPropagation()})==((r=o).isDefaultPrevented===xe||r.isDefaultPrevented===Ce)&&(o.isDefaultPrevented=Ce,o.isPropagationStopped=Ce,o.isImmediatePropagationStopped=Ce),"undefined"==typeof o.metaKey&&(o.metaKey=!1),o},Se=function(e,t,n){var r=e.document,o={type:"ready"};if(n.domLoaded)t(o);else{var i=function(){return"complete"===r.readyState||"interactive"===r.readyState&&r.body},a=function(){n.domLoaded||(n.domLoaded=!0,t(o))},u=function(){i()&&(Ne(r,"readystatechange",u),a())},s=function(){try{r.documentElement.doScroll("left")}catch(e){return void ve.setTimeout(s)}a()};!r.addEventListener||de.ie&&de.ie<11?(we(r,"readystatechange",u),r.documentElement.doScroll&&e.self===e.top&&s()):i()?a():we(e,"DOMContentLoaded",a),we(e,"load",a)}},ke=function(){var m,g,p,h,v,b=this,y={};g="mce-data-"+(+new Date).toString
(32),h="onmouseenter"in document.documentElement,p="onfocusin"in document.documentElement,v={mouseenter:"mouseover",mouseleave:"mouseout"},m=1,b.domLoaded=!1,b.events=y;var C=function(e,t){var n,r,o,i,a=y[t];if(n=a&&a[e.type])for(r=0,o=n.length;r<o;r++)if((i=n[r])&&!1===i.func.call(i.scope,e)&&e.preventDefault(),e.isImmediatePropagationStopped())return};b.bind=function(e,t,n,r){var o,i,a,u,s,c,l,f=window,d=function(e){C(Ee(e||f.event),o)};if(e&&3!==e.nodeType&&8!==e.nodeType){for(e[g]?o=e[g]:(o=m++,e[g]=o,y[o]={}),r=r||e,a=(t=t.split(" ")).length;a--;)c=d,s=l=!1,"DOMContentLoaded"===(u=t[a])&&(u="ready"),b.domLoaded&&"ready"===u&&"complete"===e.readyState?n.call(r,Ee({type:u})):(h||(s=v[u])&&(c=function(e){var t,n;if(t=e.currentTarget,(n=e.relatedTarget)&&t.contains)n=t.contains(n);else for(;n&&n!==t;)n=n
.parentNode;n||((e=Ee(e||f.event)).type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,C(e,o))}),p||"focusin"!==u&&"focusout"!==u||(l=!0,s="focusin"===u?"focus":"blur",c=function(e){(e=Ee(e||f.event)).type="focus"===e.type?"focusin":"focusout",C(e,o)}),(i=y[o][u])?"ready"===u&&b.domLoaded?n({type:u}):i.push({func:n,scope:r}):(y[o][u]=i=[{func:n,scope:r}],i.fakeName=s,i.capture=l,i.nativeHandler=c,"ready"===u?Se(e,c,b):we(e,s||u,c,l)));return e=i=0,n}},b.unbind=function(e,t,n){var r,o,i,a,u,s;if(!e||3===e.nodeType||8===e.nodeType)return b;if(r=e[g]){if(s=y[r],t){for(i=(t=t.split(" ")).length;i--;)if(o=s[u=t[i]]){if(n)for(a=o.length;a--;)if(o[a].func===n){var c=o.nativeHandler,l=o.fakeName,f=o.capture;(o=o.slice(0,a).concat(o.slice(a+1))).nativeHandler=c,o.fakeName=l,o.capture=f,s[u]=o}n&&0!==o.length||(delete s[u
],Ne(e,o.fakeName||u,o.nativeHandler,o.capture))}}else{for(u in s)o=s[u],Ne(e,o.fakeName||u,o.nativeHandler,o.capture);s={}}for(u in s)return b;delete y[r];try{delete e[g]}catch(d){e[g]=null}}return b},b.fire=function(e,t,n){var r;if(!e||3===e.nodeType||8===e.nodeType)return b;for((n=Ee(null,n)).type=t,n.target=e;(r=e[g])&&C(n,r),(e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow)&&!n.isPropagationStopped(););return b},b.clean=function(e){var t,n,r=b.unbind;if(!e||3===e.nodeType||8===e.nodeType)return b;if(e[g]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),t=(n=e.getElementsByTagName("*")).length;t--;)(e=n[t])[g]&&r(e);return b},b.destroy=function(){y={}},b.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}};ke.Event=new ke,ke.Event.bind(window,"ready",function(){});var Te,Ae,Re,_e,De,Be,Oe,Pe,Le,Ie,Me,Fe,ze,Ue,Ve,He,je,qe,$e="sizzle
"+-new Date,We=window.document,Ke=0,Xe=0,Ye=Tt(),Ge=Tt(),Je=Tt(),Qe=function(e,t){return e===t&&(Me=!0),0},Ze=typeof undefined,et={}.hasOwnProperty,tt=[],nt=tt.pop,rt=tt.push,ot=tt.push,it=tt.slice,at=tt.indexOf||function(e){for(var t=0,n=this.length;t<n;t++)if(this[t]===e)return t;return-1},ut="[\\x20\\t\\r\\n\\f]",st="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ct="\\["+ut+"*("+st+")(?:"+ut+"*([*^$|!~]?=)"+ut+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+st+"))|)"+ut+"*\\]",lt=":("+st+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ct+")*)|.*)\\)|)",ft=new RegExp("^"+ut+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ut+"+$","g"),dt=new RegExp("^"+ut+"*,"+ut+"*"),mt=new RegExp("^"+ut+"*([>+~]|"+ut+&quo
t;)"+ut+"*"),gt=new RegExp("="+ut+"*([^\\]'\"]*?)"+ut+"*\\]","g"),pt=new RegExp(lt),ht=new RegExp("^"+st+"$"),vt={ID:new RegExp("^#("+st+")"),CLASS:new RegExp("^\\.("+st+")"),TAG:new RegExp("^("+st+"|[*])"),ATTR:new RegExp("^"+ct),PSEUDO:new RegExp("^"+lt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ut+"*(even|odd|(([+-]|)(\\d*)n|)"+ut+"*(?:([+-]|)"+ut+"*(\\d+)|))"+ut+"*\\)|)","i"),bool:new RegExp("^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$","i"),needsContext:new RegExp("^"+ut+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ut+"*((?:-\\d)?\\d*)"+ut+"*\\)|)(?=[^-]|$)","i")},bt=/^
(?:input|select|textarea|button)$/i,yt=/^h\d$/i,Ct=/^[^{]+\{\s*\[native \w/,xt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,wt=/[+~]/,Nt=/'|\\/g,Et=new RegExp("\\\\([\\da-f]{1,6}"+ut+"?|("+ut+")|.)","ig"),St=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{ot.apply(tt=it.call(We.childNodes),We.childNodes),tt[We.childNodes.length].nodeType}catch(LN){ot={apply:tt.length?function(e,t){rt.apply(e,it.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}var kt=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m;if((t?t.ownerDocument||t:We)!==ze&&Fe(t),n=n||[],!e||"string"!=typeof e)return n;if(1!==(u=(t=t||ze).nodeType)&&9!==u)return[];if(Ve&&!r){if(o=xt.exec(e))if(a=o[1]){if(9===u){if(!(i=t.getElementById(a))||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(t.ownerDocument&&(i=t.o
wnerDocument.getElementById(a))&&qe(t,i)&&i.id===a)return n.push(i),n}else{if(o[2])return ot.apply(n,t.getElementsByTagName(e)),n;if((a=o[3])&&Ae.getElementsByClassName)return ot.apply(n,t.getElementsByClassName(a)),n}if(Ae.qsa&&(!He||!He.test(e))){if(f=l=$e,d=t,m=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){for(c=Be(e),(l=t.getAttribute("id"))?f=l.replace(Nt,"\\$&"):t.setAttribute("id",f),f="[id='"+f+"'] ",s=c.length;s--;)c[s]=f+Lt(c[s]);d=wt.test(e)&&Ot(t.parentNode)||t,m=c.join(",")}if(m)try{return ot.apply(n,d.querySelectorAll(m)),n}catch(g){}finally{l||t.removeAttribute("id")}}}return Pe(e.replace(ft,"$1"),t,n,r)};function Tt(){var r=[];return function e(t,n){return r.push(t+" ")>Re.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function At(e){return e[$e]=!0,e}function Rt(e,t){var n=t&&
;e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||1<<31)-(~e.sourceIndex||1<<31);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function _t(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function Dt(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function Bt(a){return At(function(i){return i=+i,At(function(e,t){for(var n,r=a([],e.length,i),o=r.length;o--;)e[n=r[o]]&&(e[n]=!(t[n]=e[n]))})})}function Ot(e){return e&&typeof e.getElementsByTagName!==Ze&&e}for(Te in Ae=kt.support={},De=kt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},Fe=kt.setDocument=function(e){var t,s=e?e.ownerDocument||e:We,n=s.defaultView;return s!==ze&&9===s.nodeType&&s.documentElement?(Ue=(ze=s).documentElem
ent,Ve=!De(s),n&&n!==function(e){try{return e.top}catch(t){}return null}(n)&&(n.addEventListener?n.addEventListener("unload",function(){Fe()},!1):n.attachEvent&&n.attachEvent("onunload",function(){Fe()})),Ae.attributes=!0,Ae.getElementsByTagName=!0,Ae.getElementsByClassName=Ct.test(s.getElementsByClassName),Ae.getById=!0,Re.find.ID=function(e,t){if(typeof t.getElementById!==Ze&&Ve){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},Re.filter.ID=function(e){var t=e.replace(Et,St);return function(e){return e.getAttribute("id")===t}},Re.find.TAG=Ae.getElementsByTagName?function(e,t){if(typeof t.getElementsByTagName!==Ze)return t.getElementsByTagName(e)}:function(e,t){var n,r=[],o=0,i=t.getElementsByTagName(e);if("*"===e){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},Re.find.CLASS=Ae.getElementsByClassName&&function(e,t){if(Ve)return t.getElementsByClassName(e)},je=[],He=
[],Ae.disconnectedMatch=!0,He=He.length&&new RegExp(He.join("|")),je=je.length&&new RegExp(je.join("|")),t=Ct.test(Ue.compareDocumentPosition),qe=t||Ct.test(Ue.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Qe=t?function(e,t){if(e===t)return Me=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!Ae.sortDetached&&t.compareDocumentPosition(e)===n?e===s||e.ownerDocument===We&&qe(We,e)?-1:t===s||t.ownerDocument===We&&qe(We,t)?1:Ie?at.call(Ie,e)-at.call(Ie,t):0:4&n?-1:1)}:function(e,t){if(e===t)return Me=!0,0;var n,r=0,o=e.parentNode,i=t.parentNode,a=[e],u=[t];if(!o||!i)r
eturn e===s?-1:t===s?1:o?-1:i?1:Ie?at.call(Ie,e)-at.call(Ie,t):0;if(o===i)return Rt(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?Rt(a[r],u[r]):a[r]===We?-1:u[r]===We?1:0},s):ze},kt.matches=function(e,t){return kt(e,null,null,t)},kt.matchesSelector=function(e,t){if((e.ownerDocument||e)!==ze&&Fe(e),t=t.replace(gt,"='$1']"),Ae.matchesSelector&&Ve&&(!je||!je.test(t))&&(!He||!He.test(t)))try{var n=(void 0).call(e,t);if(n||Ae.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(LN){}return 0<kt(t,ze,null,[e]).length},kt.contains=function(e,t){return(e.ownerDocument||e)!==ze&&Fe(e),qe(e,t)},kt.attr=function(e,t){(e.ownerDocument||e)!==ze&&Fe(e);var n=Re.attrHandle[t.toLowerCase()],r=n&&et.call(Re.attrHandle,t.toLowerCase())?n(e,t,!Ve):undefined;return r!==undefined?r:Ae.attributes||!Ve?e.getAttribute(t):(r=e.getAttributeNode(t))&
;&r.specified?r.value:null},kt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},kt.uniqueSort=function(e){var t,n=[],r=0,o=0;if(Me=!Ae.detectDuplicates,Ie=!Ae.sortStable&&e.slice(0),e.sort(Qe),Me){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)e.splice(n[r],1)}return Ie=null,e},_e=kt.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=_e(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r++];)n+=_e(t);return n},(Re=kt.selectors={cacheLength:50,createPseudo:At,match:vt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Et,St),e[3]=(e[3]||e[4]
||e[5]||"").replace(Et,St),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||kt.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&kt.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return vt.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&pt.test(n)&&(t=Be(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Et,St).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=Ye[e+" "];return t||(t=new RegExp("(^|"+ut+")"+e+"("+ut+"|$)"))&&Ye(e,func
tion(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==Ze&&e.getAttribute("class")||"")})},ATTR:function(n,r,o){return function(e){var t=kt.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===o:"!="===r?t!==o:"^="===r?o&&0===t.indexOf(o):"*="===r?o&&-1<t.indexOf(o):"$="===r?o&&t.slice(-o.length)===o:"~="===r?-1<(" "+t+" ").indexOf(o):"|="===r&&(t===o||t.slice(0,o.length+1)===o+"-"))}},CHILD:function(m,e,t,g,p){var h="nth"!==m.slice(0,3),v="last"!==m.slice(-4),b="of-type"===e;return 1===g&&0===p?function(e){return!!e.parentNode}:function(e,t,n){var r,o,i,a,u,s,c=h!==v?"nextSibling":"previousSibling",l=e.parentNode,f=b&&e.nodeName.toLowerCase(),d=!n&&!b;if(l){if(h){for(;c;)
{for(i=e;i=i[c];)if(b?i.nodeName.toLowerCase()===f:1===i.nodeType)return!1;s=c="only"===m&&!s&&"nextSibling"}return!0}if(s=[v?l.firstChild:l.lastChild],v&&d){for(u=(r=(o=l[$e]||(l[$e]={}))[m]||[])[0]===Ke&&r[1],a=r[0]===Ke&&r[2],i=u&&l.childNodes[u];i=++u&&i&&i[c]||(a=u=0)||s.pop();)if(1===i.nodeType&&++a&&i===e){o[m]=[Ke,u,a];break}}else if(d&&(r=(e[$e]||(e[$e]={}))[m])&&r[0]===Ke)a=r[1];else for(;(i=++u&&i&&i[c]||(a=u=0)||s.pop())&&((b?i.nodeName.toLowerCase()!==f:1!==i.nodeType)||!++a||(d&&((i[$e]||(i[$e]={}))[m]=[Ke,a]),i!==e)););return(a-=p)===g||a%g==0&&0<=a/g}}},PSEUDO:function(e,i){var t,a=Re.pseudos[e]||Re.setFilters[e.toLowerCase()]||kt.error("unsupported pseudo: "+e);return a[$e]?a(i):1<a.length?(t=[e,e,"",i],Re.setFilters.hasOwnProperty(e.toLowerCase())?At(function(e,t){for(var n,r=a(e,i),o=r
.length;o--;)e[n=at.call(e,r[o])]=!(t[n]=r[o])}):function(e){return a(e,0,t)}):a}},pseudos:{not:At(function(e){var r=[],o=[],u=Oe(e.replace(ft,"$1"));return u[$e]?At(function(e,t,n,r){for(var o,i=u(e,null,r,[]),a=e.length;a--;)(o=i[a])&&(e[a]=!(t[a]=o))}):function(e,t,n){return r[0]=e,u(r,null,n,o),!o.pop()}}),has:At(function(t){return function(e){return 0<kt(t,e).length}}),contains:At(function(t){return t=t.replace(Et,St),function(e){return-1<(e.textContent||e.innerText||_e(e)).indexOf(t)}}),lang:At(function(n){return ht.test(n||"")||kt.error("unsupported lang: "+n),n=n.replace(Et,St).toLowerCase(),function(e){var t;do{if(t=Ve?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:func
tion(e){return e===Ue},focus:function(e){return e===ze.activeElement&&(!ze.hasFocus||ze.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!Re.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return bt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute(&qu
ot;type"))||"text"===t.toLowerCase())},first:Bt(function(){return[0]}),last:Bt(function(e,t){return[t-1]}),eq:Bt(function(e,t,n){return[n<0?n+t:n]}),even:Bt(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:Bt(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:Bt(function(e,t,n){for(var r=n<0?n+t:n;0<=--r;)e.push(r);return e}),gt:Bt(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=Re.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})Re.pseudos[Te]=_t(Te);for(Te in{submit:!0,reset:!0})Re.pseudos[Te]=Dt(Te);function Pt(){}function Lt(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function It(a,e,t){var u=e.dir,s=t&&"parentNode"===u,c=Xe++;return e.first?function(e,t,n){for(;e=e[u];)if(1===e.nodeType||s)return a(e,t,n)}:function(e,t,n){var r,o,i=[Ke,c];if(n){for(;e=e[u];)if((1===e.nodeType||s)&&a(e,t,n))return!0}else for(;e=e[u];)if(1===
e.nodeType||s){if((r=(o=e[$e]||(e[$e]={}))[u])&&r[0]===Ke&&r[1]===c)return i[2]=r[2];if((o[u]=i)[2]=a(e,t,n))return!0}}}function Mt(o){return 1<o.length?function(e,t,n){for(var r=o.length;r--;)if(!o[r](e,t,n))return!1;return!0}:o[0]}function Ft(e,t,n,r,o){for(var i,a=[],u=0,s=e.length,c=null!=t;u<s;u++)(i=e[u])&&(n&&!n(i,r,o)||(a.push(i),c&&t.push(u)));return a}function zt(m,g,p,h,v,e){return h&&!h[$e]&&(h=zt(h)),v&&!v[$e]&&(v=zt(v,e)),At(function(e,t,n,r){var o,i,a,u=[],s=[],c=t.length,l=e||function(e,t,n){for(var r=0,o=t.length;r<o;r++)kt(e,t[r],n);return n}(g||"*",n.nodeType?[n]:n,[]),f=!m||!e&&g?l:Ft(l,u,m,n,r),d=p?v||(e?m:c||h)?[]:t:f;if(p&&p(f,d,n,r),h)for(o=Ft(d,s),h(o,[],n,r),i=o.length;i--;)(a=o[i])&&(d[s[i]]=!(f[s[i]]=a));if(e){if(v||m){if(v){for(o=[],i=d.length;i--;)(a=d[i])&&o.push(f[i]=a);v(null,d=[],o,r)}for(i=d.length;i--;)(a=d[i])&&-1<
(o=v?at.call(e,a):u[i])&&(e[o]=!(t[o]=a))}}else d=Ft(d===t?d.splice(c,d.length):d),v?v(null,t,d,r):ot.apply(t,d)})}function Ut(e){for(var r,t,n,o=e.length,i=Re.relative[e[0].type],a=i||Re.relative[" "],u=i?1:0,s=It(function(e){return e===r},a,!0),c=It(function(e){return-1<at.call(r,e)},a,!0),l=[function(e,t,n){return!i&&(n||t!==Le)||((r=t).nodeType?s(e,t,n):c(e,t,n))}];u<o;u++)if(t=Re.relative[e[u].type])l=[It(Mt(l),t)];else{if((t=Re.filter[e[u].type].apply(null,e[u].matches))[$e]){for(n=++u;n<o&&!Re.relative[e[n].type];n++);return zt(1<u&&Mt(l),1<u&&Lt(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(ft,"$1"),t,u<n&&Ut(e.slice(u,n)),n<o&&Ut(e=e.slice(n)),n<o&&Lt(e))}l.push(t)}return Mt(l)}Pt.prototype=Re.filters=Re.pseudos,Re.setFilters=new Pt,Be=kt.tokenize=function(e,t){var n,r,o,i,a,u,s,c=Ge[e+" "];if(c)return t?0:c.s
lice(0);for(a=e,u=[],s=Re.preFilter;a;){for(i in n&&!(r=dt.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=mt.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(ft," ")}),a=a.slice(n.length)),Re.filter)!(r=vt[i].exec(a))||s[i]&&!(r=s[i](r))||(n=r.shift(),o.push({value:n,type:i,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?kt.error(e):Ge(e,u).slice(0)},Oe=kt.compile=function(e,t){var n,h,v,b,y,r,o=[],i=[],a=Je[e+" "];if(!a){for(t||(t=Be(e)),n=t.length;n--;)(a=Ut(t[n]))[$e]?o.push(a):i.push(a);(a=Je(e,(h=i,b=0<(v=o).length,y=0<h.length,r=function(e,t,n,r,o){var i,a,u,s=0,c="0",l=e&&[],f=[],d=Le,m=e||y&&Re.find.TAG("*",o),g=Ke+=null==d?1:Math.random()||.1,p=m.length;for(o&&(Le=t!==ze&&t);c!==p&&null!=(i=m[c]);c++){if(y&&i){for(a=0;u=h[a++];)if(u(i,t,n)){r.push(i);break}o&&(Ke=g)}b&&((i=!u&&i)&&
amp;s--,e&&l.push(i))}if(s+=c,b&&c!==s){for(a=0;u=v[a++];)u(l,f,t,n);if(e){if(0<s)for(;c--;)l[c]||f[c]||(f[c]=nt.call(r));f=Ft(f)}ot.apply(r,f),o&&!e&&0<f.length&&1<s+v.length&&kt.uniqueSort(r)}return o&&(Ke=g,Le=d),l},b?At(r):r))).selector=e}return a},Pe=kt.select=function(e,t,n,r){var o,i,a,u,s,c="function"==typeof e&&e,l=!r&&Be(e=c.selector||e);if(n=n||[],1===l.length){if(2<(i=l[0]=l[0].slice(0)).length&&"ID"===(a=i[0]).type&&Ae.getById&&9===t.nodeType&&Ve&&Re.relative[i[1].type]){if(!(t=(Re.find.ID(a.matches[0].replace(Et,St),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(i.shift().value.length)}for(o=vt.needsContext.test(e)?0:i.length;o--&&(a=i[o],!Re.relative[u=a.type]);)if((s=Re.find[u])&&(r=s(a.matches[0].replace(Et,St),wt.test(i[0].type)&&Ot(t.parentNode)||t))){if(i.splice(o,1),!(e=r.length&&a
mp;Lt(i)))return ot.apply(n,r),n;break}}return(c||Oe(e,l))(r,t,!Ve,n,wt.test(e)&&Ot(t.parentNode)||t),n},Ae.sortStable=$e.split("").sort(Qe).join("")===$e,Ae.detectDuplicates=!!Me,Fe(),Ae.sortDetached=!0;var Vt=Array.isArray,Ht=function(e,t,n){var r,o;if(!e)return 0;if(n=n||e,e.length!==undefined){for(r=0,o=e.length;r<o;r++)if(!1===t.call(n,e[r],r,e))return 0}else for(r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,e[r],r,e))return 0;return 1},jt=function(e,t,n){var r,o;for(r=0,o=e.length;r<o;r++)if(t.call(n,e[r],r,e))return r;return-1},qt={isArray:Vt,toArray:function(e){var t,n,r=e;if(!Vt(e))for(r=[],t=0,n=e.length;t<n;t++)r[t]=e[t];return r},each:Ht,map:function(n,r){var o=[];return Ht(n,function(e,t){o.push(r(e,t,n))}),o},filter:function(n,r){var o=[];return Ht(n,function(e,t){r&&!r(e,t,n)||o.push(e)}),o},indexOf:function(e,t){var n,r;if(e)for(n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},reduce:function(e,t,n,r){var o=
0;for(arguments.length<3&&(n=e[0]);o<e.length;o++)n=t.call(r,n,e[o],o);return n},findIndex:jt,find:function(e,t,n){var r=jt(e,t,n);return-1!==r?e[r]:undefined},last:function(e){return e[e.length-1]}},$t=/^\s*|\s*$/g,Wt=function(e){return null===e||e===undefined?"":(""+e).replace($t,"")},Kt=function(e,t){return t?!("array"!==t||!qt.isArray(e))||typeof e===t:e!==undefined},Xt=function(e,n,r,o){o=o||this,e&&(r&&(e=e[r]),qt.each(e,function(e,t){if(!1===n.call(o,e,t,r))return!1;Xt(e,n,r,o)}))},Yt={trim:Wt,isArray:qt.isArray,is:Kt,toArray:qt.toArray,makeMap:function(e,t,n){var r;for(t=t||",","string"==typeof(e=e||[])&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n},each:qt.each,map:qt.map,grep:qt.filter,inArray:qt.indexOf,hasOwn:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},extend:function(e,t){for(var n,r,o,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];
var u,s=arguments;for(n=1,r=s.length;n<r;n++)for(o in t=s[n])t.hasOwnProperty(o)&&(u=t[o])!==undefined&&(e[o]=u);return e},create:function(e,t,n){var r,o,i,a,u,s=this,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),i=e[3].match(/(^|\.)(\w+)$/i)[2],!(o=s.createNS(e[3].replace(/\.\w+$/,""),n))[i]){if("static"===e[2])return o[i]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[i]));t[i]||(t[i]=function(){},c=1),o[i]=t[i],s.extend(o[i].prototype,t),e[5]&&(r=s.resolve(e[5]).prototype,a=e[5].match(/\.(\w+)$/i)[1],u=o[i],o[i]=c?function(){return r[a].apply(this,arguments)}:function(){return this.parent=r[a],u.apply(this,arguments)},o[i].prototype[i]=o[i],s.each(r,function(e,t){o[i].prototype[t]=r[t]}),s.each(t,function(e,t){r[t]?o[i].prototype[t]=function(){return this.parent=r[t],e.apply(this,arguments)}:t!==i&&(o[i].prototype[t]=e)})),s.each(t["static"],function(e,t){o[i][t]=e})}},walk:Xt,createNS:function(e,t){
var n,r;for(t=t||window,e=e.split("."),n=0;n<e.length;n++)t[r=e[n]]||(t[r]={}),t=t[r];return t},resolve:function(e,t){var n,r;for(t=t||window,n=0,r=(e=e.split(".")).length;n<r&&(t=t[e[n]]);n++);return t},explode:function(e,t){return!e||Kt(e,"array")?e:qt.map(e.split(t||","),Wt)},_addCacheSuffix:function(e){var t=de.cacheSuffix;return t&&(e+=(-1===e.indexOf("?")?"?":"&")+t),e}},Gt=document,Jt=Array.prototype.push,Qt=Array.prototype.slice,Zt=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,en=ke.Event,tn=Yt.makeMap("children,contents,next,prev"),nn=function(e){return void 0!==e},rn=function(e){return"string"==typeof e},on=function(e,t){var n,r,o;for(o=(t=t||Gt).createElement("div"),n=t.createDocumentFragment(),o.innerHTML=e;r=o.firstChild;)n.appendChild(r);return n},an=function(e,t,n,r){var o;if(rn(t))t=on(t,Cn(e[0]));else if(t.length&&!t.nodeType
){if(t=pn.makeArray(t),r)for(o=t.length-1;0<=o;o--)an(e,t[o],n,r);else for(o=0;o<t.length;o++)an(e,t[o],n,r);return e}if(t.nodeType)for(o=e.length;o--;)n.call(e[o],t);return e},un=function(e,t){return e&&t&&-1!==(" "+e.className+" ").indexOf(" "+t+" ")},sn=function(e,t,n){var r,o;return t=pn(t)[0],e.each(function(){var e=this;n&&r===e.parentNode||(r=e.parentNode,o=t.cloneNode(!1),e.parentNode.insertBefore(o,e)),o.appendChild(e)}),e},cn=Yt.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," "),ln=Yt.makeMap("checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected"," "),fn={"for":"htmlFor","class":"className",readonly:"readOnly"},dn={"float":"cssFloat"},mn={},gn={},pn=function(e,t){return new pn.fn.init(e,t)},hn=/^\s*|\s*$/g,vn=function(e){re
turn null===e||e===undefined?"":(""+e).replace(hn,"")},bn=function(e,t){var n,r,o,i;if(e)if((n=e.length)===undefined){for(r in e)if(e.hasOwnProperty(r)&&(i=e[r],!1===t.call(i,r,i)))break}else for(o=0;o<n&&(i=e[o],!1!==t.call(i,o,i));o++);return e},yn=function(e,n){var r=[];return bn(e,function(e,t){n(t,e)&&r.push(t)}),r},Cn=function(e){return e?9===e.nodeType?e:e.ownerDocument:Gt};pn.fn=pn.prototype={constructor:pn,selector:"",context:null,length:0,init:function(e,t){var n,r,o=this;if(!e)return o;if(e.nodeType)return o.context=o[0]=e,o.length=1,o;if(t&&t.nodeType)o.context=t;else{if(t)return pn(e).attr(t);o.context=t=document}if(rn(e)){if(!(n="<"===(o.selector=e).charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:Zt.exec(e)))return pn(t).find(e);if(n[1])for(r=on(e,Cn(t)).firstChild;r;)Jt.call(o,r),r=r.nextSibling;else{if(!(r=Cn(t).getElementById(n[2])
))return o;if(r.id!==n[2])return o.find(e);o.length=1,o[0]=r}}else this.add(e,!1);return o},toArray:function(){return Yt.toArray(this)},add:function(e,t){var n,r,o=this;if(rn(e))return o.add(pn(e));if(!1!==t)for(n=pn.unique(o.toArray().concat(pn.makeArray(e))),o.length=n.length,r=0;r<n.length;r++)o[r]=n[r];else Jt.apply(o,pn.makeArray(e));return o},attr:function(t,n){var e,r=this;if("object"==typeof t)bn(t,function(e,t){r.attr(e,t)});else{if(!nn(n)){if(r[0]&&1===r[0].nodeType){if((e=mn[t])&&e.get)return e.get(r[0],t);if(ln[t])return r.prop(t)?t:undefined;null===(n=r[0].getAttribute(t,2))&&(n=undefined)}return n}this.each(function(){var e;if(1===this.nodeType){if((e=mn[t])&&e.set)return void e.set(this,n);null===n?this.removeAttribute(t,2):this.setAttribute(t,n,2)}})}return r},removeAttr:function(e){return this.attr(e,null)},prop:function(e,t){var n=this;if("object"==typeof(e=fn[e]||e))bn(e,function(e,t){n.prop(e,t)});else{if(!nn
(t))return n[0]&&n[0].nodeType&&e in n[0]?n[0][e]:t;this.each(function(){1===this.nodeType&&(this[e]=t)})}return n},css:function(n,r){var e,o,i=this,t=function(e){return e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()})},a=function(e){return e.replace(/[A-Z]/g,function(e){return"-"+e})};if("object"==typeof n)bn(n,function(e,t){i.css(e,t)});else if(nn(r))n=t(n),"number"!=typeof r||cn[n]||(r=r.toString()+"px"),i.each(function(){var e=this.style;if((o=gn[n])&&o.set)o.set(this,r);else{try{this.style[dn[n]||n]=r}catch(t){}null!==r&&""!==r||(e.removeProperty?e.removeProperty(a(n)):e.removeAttribute(n))}});else{if(e=i[0],(o=gn[n])&&o.get)return o.get(e);if(!e.ownerDocument.defaultView)return e.currentStyle?e.currentStyle[t(n)]:"";try{return e.ownerDocument.defaultView.getComputedStyle(e,null).getPropertyValue(a(n))}catch(u){return undefined}}return i},remove:function(){for(va
r e,t=this.length;t--;)e=this[t],en.clean(e),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var e,t=this.length;t--;)for(e=this[t];e.firstChild;)e.removeChild(e.firstChild);return this},html:function(e){var t,n=this;if(nn(e)){t=n.length;try{for(;t--;)n[t].innerHTML=e}catch(r){pn(n[t]).empty().append(e)}return n}return n[0]?n[0].innerHTML:""},text:function(e){var t,n=this;if(nn(e)){for(t=n.length;t--;)"innerText"in n[t]?n[t].innerText=e:n[0].textContent=e;return n}return n[0]?n[0].innerText||n[0].textContent:""},append:function(){return an(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.appendChild(e)})},prepend:function(){return an(this,arguments,function(e){(1===this.nodeType||this.host&&1===this.host.nodeType)&&this.insertBefore(e,this.firstChild)},!0)},before:function(){return this[0]&&this[0].parentNode?an(this,arguments,function(e){t
his.parentNode.insertBefore(e,this)}):this},after:function(){return this[0]&&this[0].parentNode?an(this,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)},!0):this},appendTo:function(e){return pn(e).append(this),this},prependTo:function(e){return pn(e).prepend(this),this},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){return sn(this,e)},wrapAll:function(e){return sn(this,e,!0)},wrapInner:function(e){return this.each(function(){pn(this).contents().wrapAll(e)}),this},unwrap:function(){return this.parent().each(function(){pn(this).replaceWith(this.childNodes)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),pn(e)},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(o,i){var e=this;return"string"!=typeof o||(-1!==o.indexOf(" ")?bn(o.split(" "),function(){e.toggleClass(this,i)}):e.each(functio
n(e,t){var n,r;(r=un(t,o))!==i&&(n=t.className,r?t.className=vn((" "+n+" ").replace(" "+o+" "," ")):t.className+=n?" "+o:o)})),e},hasClass:function(e){return un(this[0],e)},each:function(e){return bn(this,e)},on:function(e,t){return this.each(function(){en.bind(this,e,t)})},off:function(e,t){return this.each(function(){en.unbind(this,e,t)})},trigger:function(e){return this.each(function(){"object"==typeof e?en.fire(this,e.type,e):en.fire(this,e)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new pn(Qt.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},find:function(e){var t,n,r=[];for(t=0,n=this.length;t<n;t++)pn.find(e,this[t],r);return pn(r)},filter:function(n){return pn("fun
ction"==typeof n?yn(this.toArray(),function(e,t){return n(t,e)}):pn.filter(n,this.toArray()))},closest:function(n){var r=[];return n instanceof pn&&(n=n[0]),this.each(function(e,t){for(;t;){if("string"==typeof n&&pn(t).is(n)){r.push(t);break}if(t===n){r.push(t);break}t=t.parentNode}}),pn(r)},offset:function(e){var t,n,r,o,i=0,a=0;return e?this.css(e):((t=this[0])&&(r=(n=t.ownerDocument).documentElement,t.getBoundingClientRect&&(i=(o=t.getBoundingClientRect()).left+(r.scrollLeft||n.body.scrollLeft)-r.clientLeft,a=o.top+(r.scrollTop||n.body.scrollTop)-r.clientTop)),{left:i,top:a})},push:Jt,sort:[].sort,splice:[].splice},Yt.extend(pn,{extend:Yt.extend,makeArray:function(e){return(t=e)&&t===t.window||e.nodeType?[e]:Yt.toArray(e);var t},inArray:function(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1},isArray:Yt.isArray,each:bn,trim:vn,grep:yn,find:kt,expr:kt.selectors,unique:kt.uniqueSor
t,text:kt.getText,contains:kt.contains,filter:function(e,t,n){var r=t.length;for(n&&(e=":not("+e+")");r--;)1!==t[r].nodeType&&t.splice(r,1);return t=1===t.length?pn.find.matchesSelector(t[0],e)?[t[0]]:[]:pn.find.matches(e,t)}});var xn=function(e,t,n){var r=[],o=e[t];for("string"!=typeof n&&n instanceof pn&&(n=n[0]);o&&9!==o.nodeType;){if(n!==undefined){if(o===n)break;if("string"==typeof n&&pn(o).is(n))break}1===o.nodeType&&r.push(o),o=o[t]}return r},wn=function(e,t,n,r){var o=[];for(r instanceof pn&&(r=r[0]);e;e=e[t])if(!n||e.nodeType===n){if(r!==undefined){if(e===r)break;if("string"==typeof r&&pn(e).is(r))break}o.push(e)}return o},Nn=function(e,t,n){for(e=e[t];e;e=e[t])if(e.nodeType===n)return e;return null};bn({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return xn(e,"parentNode")},next:function(e
){return Nn(e,"nextSibling",1)},prev:function(e){return Nn(e,"previousSibling",1)},children:function(e){return wn(e.firstChild,"nextSibling",1)},contents:function(e){return Yt.toArray(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,r){pn.fn[e]=function(t){var n=[];return this.each(function(){var e=r.call(n,this,t,n);e&&(pn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.length&&(tn[e]||(n=pn.unique(n)),0===e.indexOf("parents")&&(n=n.reverse())),n=pn(n),t?n.filter(t):n}}),bn({parentsUntil:function(e,t){return xn(e,"parentNode",t)},nextUntil:function(e,t){return wn(e,"nextSibling",1,t).slice(1)},prevUntil:function(e,t){return wn(e,"previousSibling",1,t).slice(1)}},function(r,o){pn.fn[r]=function(t,e){var n=[];return this.each(function(){var e=o.call(n,this,t,n);e&&(pn.isArray(e)?n.push.apply(n,e):n.push(e))}),1<this.lengt
h&&(n=pn.unique(n),0!==r.indexOf("parents")&&"prevUntil"!==r||(n=n.reverse())),n=pn(n),e?n.filter(e):n}}),pn.fn.is=function(e){return!!e&&0<this.filter(e).length},pn.fn.init.prototype=pn.fn,pn.overrideDefaults=function(n){var r,o=function(e,t){return r=r||n(),0===arguments.length&&(e=r.element),t||(t=r.context),new o.fn.init(e,t)};return pn.extend(o,this),o};var En=function(n,r,e){bn(e,function(e,t){n[e]=n[e]||{},n[e][r]=t})};de.ie&&de.ie<8&&(En(mn,"get",{maxlength:function(e){var t=e.maxLength;return 2147483647===t?undefined:t},size:function(e){var t=e.size;return 20===t?undefined:t},"class":function(e){return e.className},style:function(e){var t=e.style.cssText;return 0===t.length?undefined:t}}),En(mn,"set",{"class":function(e,t){e.className=t},style:function(e,t){e.style.cssText=t}})),de.ie&&de.ie<9&&(dn["float"]="styleFloat",En(
gn,"set",{opacity:function(e,t){var n=e.style;null===t||""===t?n.removeAttribute("filter"):(n.zoom=1,n.filter="alpha(opacity="+100*t+")")}})),pn.attrHooks=mn,pn.cssHooks=gn;var Sn,kn,Tn,An=function(e,t){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.test(t))return r}return undefined}(e,t);if(!n)return{major:0,minor:0};var r=function(e){return Number(t.replace(n,"$"+e))};return _n(r(1),r(2))},Rn=function(){return _n(0,0)},_n=function(e,t){return{major:e,minor:t}},Dn={nu:_n,detect:function(e,t){var n=String(t).toLowerCase();return 0===e.length?Rn():An(e,n)},unknown:Rn},Bn="Firefox",On=function(e,t){return function(){return t===e}},Pn=function(e){var t=e.current;return{current:t,version:e.version,isEdge:On("Edge",t),isChrome:On("Chrome",t),isIE:On("IE",t),isOpera:On("Opera",t),isFirefox:On(Bn,t),isSafari:On("Safari",t)}},Ln={unknown:function(){retu
rn Pn({current:undefined,version:Dn.unknown()})},nu:Pn,edge:j("Edge"),chrome:j("Chrome"),ie:j("IE"),opera:j("Opera"),firefox:j(Bn),safari:j("Safari")},In="Windows",Mn="Android",Fn="Solaris",zn="FreeBSD",Un=function(e,t){return function(){return t===e}},Vn=function(e){var t=e.current;return{current:t,version:e.version,isWindows:Un(In,t),isiOS:Un("iOS",t),isAndroid:Un(Mn,t),isOSX:Un("OSX",t),isLinux:Un("Linux",t),isSolaris:Un(Fn,t),isFreeBSD:Un(zn,t)}},Hn={unknown:function(){return Vn({current:undefined,version:Dn.unknown()})},nu:Vn,windows:j(In),ios:j("iOS"),android:j(Mn),linux:j("Linux"),osx:j("OSX"),solaris:j(Fn),freebsd:j(zn)},jn=function(e,t){var n=String(t).toLowerCase();return V(e,function(e){return e.search(n)})},qn=function(e,n){return jn(e,n).map(function(e){var t=Dn.detect(e.versionRegexes,n);return{current:e.name,version:t}})
},$n=function(e,n){return jn(e,n).map(function(e){var t=Dn.detect(e.versionRegexes,n);return{current:e.name,version:t}})},Wn=function(e,t){return-1!==e.indexOf(t)},Kn=function(e){return e.replace(/^\s+|\s+$/g,"")},Xn=function(e){return e.replace(/\s+$/g,"")},Yn=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Gn=function(t){return function(e){return Wn(e,t)}},Jn=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Wn(e,"edge/")&&Wn(e,"chrome")&&Wn(e,"safari")&&Wn(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Yn],search:function(e){return Wn(e,"chrome")&&!Wn(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Wn(e,"msie")||Wn(e,"trident")}},{name:"Opera",versionRegexes:[
Yn,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Gn("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Gn("firefox")},{name:"Safari",versionRegexes:[Yn,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Wn(e,"safari")||Wn(e,"mobile/"))&&Wn(e,"applewebkit")}}],Qn=[{name:"Windows",search:Gn("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Wn(e,"iphone")||Wn(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Gn("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:Gn("os x"),versionRegexes:[/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Gn("linux"),versionRegexes:[
]},{name:"Solaris",search:Gn("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Gn("freebsd"),versionRegexes:[]}],Zn={browsers:j(Jn),oses:j(Qn)},er=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=Zn.browsers(),m=Zn.oses(),g=qn(d,e).fold(Ln.unknown,Ln.nu),p=$n(m,e).fold(Hn.unknown,Hn.nu);return{browser:g,os:p,deviceType:(n=g,r=e,o=(t=p).isiOS()&&!0===/ipad/i.test(r),i=t.isiOS()&&!o,a=t.isAndroid()&&3===t.version.major,u=t.isAndroid()&&4===t.version.major,s=o||a||u&&!0===/mobile/i.test(r),c=t.isiOS()||t.isAndroid(),l=c&&!s,f=n.isSafari()&&t.isiOS()&&!1===/safari/i.test(r),{isiPad:j(o),isiPhone:j(i),isTablet:j(s),isPhone:j(l),isTouch:j(c),isAndroid:t.isAndroid,isiOS:t.isiOS,isWebView:j(f)})}},tr={detect:(Sn=function(){var e=navigator.userAgent;return er(e)},Tn=!1,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Tn||(Tn=!0,kn=Sn.apply(null,e)),kn})},nr=function(e
){if(null===e||e===undefined)throw new Error("Node cannot be null or undefined");return{dom:j(e)}},rr={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),"HTML must have a single root node";return nr(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return nr(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return nr(n)},fromDom:nr,fromPoint:function(e,t,n){var r=e.dom();return A.from(r.elementFromPoint(t,n)).map(nr)}},or=(Node.ATTRIBUTE_NODE,Node.CDATA_SECTION_NODE,Node.COMMENT_NODE,Node.DOCUMENT_NODE),ir=(Node.DOCUMENT_TYPE_NODE,Node.DOCUMENT_FRAGMENT_NODE,Node.ELEMENT_NODE),ar=Node.TEXT_NODE,ur=(Node.PROCESSING_INSTRUCTION_NODE,Node.ENTITY_REFERENCE_NODE,Node.ENTITY_NODE,Node.NOTATION_NODE,function(e){return e.dom().nodeName.toLowerCase()}),sr=function(t){return
function(e){return e.dom().nodeType===t}},cr=sr(ir),lr=sr(ar),fr=Object.keys,dr=Object.hasOwnProperty,mr=function(e,t){for(var n=fr(e),r=0,o=n.length;r<o;r++){var i=n[r];t(e[i],i,e)}},gr=function(r,o){var i={};return mr(r,function(e,t){var n=o(e,t,r);i[n.k]=n.v}),i},pr=function(e,t,n){if(!(R(n)||O(n)||L(n)))throw console.error("Invalid call to Attr.set. Key ",t,":: Value ",n,":: Element ",e),new Error("Attribute value was not simple");e.setAttribute(t,n+"")},hr=function(e,t,n){pr(e.dom(),t,n)},vr=function(e,t){var n=e.dom();mr(t,function(e,t){pr(n,t,e)})},br=function(e,t){var n=e.dom().getAttribute(t);return null===n?undefined:n},yr=function(e,t){e.dom().removeAttribute(t)},Cr=function(e){return e.style!==undefined},xr=function(e,t){var n=e.dom();mr(t,function(e,t){!function(e,t,n){if(!R(n))throw console.error("Invalid call to CSS.set. Property ",t,":: Value ",n,":: Element ",e),new Error("CSS va
lue must be a string: "+n);Cr(e)&&e.style.setProperty(t,n)}(n,t,e)})},wr=function(e,t){var n,r,o=e.dom(),i=window.getComputedStyle(o).getPropertyValue(t),a=""!==i||(r=lr(n=e)?n.dom().parentNode:n.dom())!==undefined&&null!==r&&r.ownerDocument.body.contains(r)?i:Nr(o,t);return null===a?undefined:a},Nr=function(e,t){return Cr(e)?e.style.getPropertyValue(t):""},Er=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];if(t.length!==n.length)throw new Error('Wrong number of arguments to struct. Expected "['+t.length+']", got '+n.length+" arguments");var r={};return F(t,function(e,t){r[e]=j(n[t])}),r}},Sr=function(e,t){for(var n=[],r=function(e){return n.push(e),t(e)},o=t(e);(o=o.bind(r)).isSome(););return n},kr=function(){return ie.getOrDie("Node")},Tr=function(e,t,n){return 0!=(e.compareDocumentPosition(t)&n)},
Ar=function(e,t){return Tr(e,t,kr().DOCUMENT_POSITION_CONTAINED_BY)},Rr=ir,_r=or,Dr=function(e,t){var n=e.dom();if(n.nodeType!==Rr)return!1;if(n.matches!==undefined)return n.matches(t);if(n.msMatchesSelector!==undefined)return n.msMatchesSelector(t);if(n.webkitMatchesSelector!==undefined)return n.webkitMatchesSelector(t);if(n.mozMatchesSelector!==undefined)return n.mozMatchesSelector(t);throw new Error("Browser lacks native selectors")},Br=function(e){return e.nodeType!==Rr&&e.nodeType!==_r||0===e.childElementCount},Or=function(e,t){return e.dom()===t.dom()},Pr=tr.detect().browser.isIE()?function(e,t){return Ar(e.dom(),t.dom())}:function(e,t){var n=e.dom(),r=t.dom();return n!==r&&n.contains(r)},Lr=function(e){return rr.fromDom(e.dom().ownerDocument)},Ir=function(e){var t=e.dom();return A.from(t.parentNode).map(rr.fromDom)},Mr=function(e){var t=e.dom();return A.from(t.previousSibling).map(rr.fromDom)},Fr=function(e){var t=e.dom();return A.from(t.nextSibling)
.map(rr.fromDom)},zr=function(e){return t=Sr(e,Mr),(n=Q.call(t,0)).reverse(),n;var t,n},Ur=function(e){return Sr(e,Fr)},Vr=function(e){var t=e.dom();return $(t.childNodes,rr.fromDom)},Hr=function(e,t){var n=e.dom().childNodes;return A.from(n[t]).map(rr.fromDom)},jr=function(e){return Hr(e,0)},qr=function(e){return Hr(e,e.dom().childNodes.length-1)},$r=(Er("element","offset"),tr.detect().browser),Wr=function(e){return V(e,cr)},Kr={getPos:function(e,t,n){var r,o,i,a=0,u=0,s=e.ownerDocument;if(n=n||e,t){if(n===e&&t.getBoundingClientRect&&"static"===wr(rr.fromDom(e),"position"))return{x:a=(o=t.getBoundingClientRect()).left+(s.documentElement.scrollLeft||e.scrollLeft)-s.documentElement.clientLeft,y:u=o.top+(s.documentElement.scrollTop||e.scrollTop)-s.documentElement.clientTop};for(r=t;r&&r!==n&&r.nodeType;)a+=r.offsetLeft||0,u+=r.offsetTop||0,r=r.offsetParent;for(r=t.parentNode;r&&r!==n&&r.nodeType;)a
-=r.scrollLeft||0,u-=r.scrollTop||0,r=r.parentNode;u+=(i=rr.fromDom(t),$r.isFirefox()&&"table"===ur(i)?Wr(Vr(i)).filter(function(e){return"caption"===ur(e)}).bind(function(o){return Wr(Ur(o)).map(function(e){var t=e.dom().offsetTop,n=o.dom().offsetTop,r=o.dom().offsetHeight;return t<=n?-r:0})}).getOr(0):0)}return{x:a,y:u}}},Xr=function(e){var n=A.none(),t=[],r=function(e){o()?a(e):t.push(e)},o=function(){return n.isSome()},i=function(e){F(e,a)},a=function(t){n.each(function(e){setTimeout(function(){t(e)},0)})};return e(function(e){n=A.some(e),i(t),t=[]}),{get:r,map:function(n){return Xr(function(t){r(function(e){t(n(e))})})},isReady:o}},Yr={nu:Xr,pure:function(t){return Xr(function(e){e(t)})}},Gr=function(t){var e=function(e){var r;t((r=e,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=this;setTimeout(function(){r.apply(n,e)},0)}))},n=function(){return Yr.nu(e)};return{map:function(r){return Gr(function(n){e(function(e){va
r t=r(e);n(t)})})},bind:function(n){return Gr(function(t){e(function(e){n(e).get(t)})})},anonBind:function(n){return Gr(function(t){e(function(e){n.get(t)})})},toLazy:n,toCached:function(){var t=null;return Gr(function(e){null===t&&(t=n()),t.get(e)})},get:e}},Jr={nu:Gr,pure:function(t){return Gr(function(e){e(t)})}},Qr=function(a,e){return e(function(r){var o=[],i=0;0===a.length?r([]):F(a,function(e,t){var n;e.get((n=t,function(e){o[n]=e,++i>=a.length&&r(o)}))})})},Zr=function(e){return Qr(e,Jr.nu)},eo=function(n){return{is:function(e){return n===e},isValue:x,isError:C,getOr:j(n),getOrThunk:j(n),getOrDie:j(n),or:function(e){return eo(n)},orThunk:function(e){return eo(n)},fold:function(e,t){return t(n)},map:function(e){return eo(e(n))},mapError:function(e){return eo(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOption:function(){return A.some(n)}}},to=function(n){return{is:C,isValue:C,isEr
ror:x,getOr:q,getOrThunk:function(e){return e()},getOrDie:function(){return e=String(n),function(){throw new Error(e)}();var e},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return to(n)},mapError:function(e){return to(e(n))},each:o,bind:function(e){return to(n)},exists:C,forall:x,toOption:A.none}},no={value:eo,error:to};function ro(e,u){var t=e,n=function(e,t,n,r){var o,i;if(e){if(!r&&e[t])return e[t];if(e!==u){if(o=e[n])return o;for(i=e.parentNode;i&&i!==u;i=i.parentNode)if(o=i[n])return o}}};this.current=function(){return t},this.next=function(e){return t=n(t,"firstChild","nextSibling",e)},this.prev=function(e){return t=n(t,"lastChild","previousSibling",e)},this.prev2=function(e){return t=function(e,t,n,r){var o,i,a;if(e){if(o=e[n],u&&o===u)return;if(o){if(!r)for(a=o[t];a;a=a[t])if(!a[t])return a;return o}if((i=e.parentNode)&&i!==u)return i}}(t,"
lastChild","previousSibling",e)}}var oo,io,ao,uo=function(t){var n;return function(e){return(n=n||function(e,t){for(var n={},r=0,o=e.length;r<o;r++){var i=e[r];n[String(i)]=t(i,r)}return n}(t,j(!0))).hasOwnProperty(ur(e))}},so=uo(["h1","h2","h3","h4","h5","h6"]),co=uo(["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","di
r","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"]),lo=function(e){return cr(e)&&!co(e)},fo=function(e){return cr(e)&&"br"===ur(e)},mo=uo(["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"]),go=uo(["ul","ol","dl"]),po=uo(["li","dd","dt"]),ho=uo(["area","base","basefont","br","col","frame","hr","img","input","
;isindex","link","meta","param","embed","source","wbr","track"]),vo=uo(["thead","tbody","tfoot"]),bo=uo(["td","th"]),yo=uo(["pre","script","textarea","style"]),Co=function(t){return function(e){return!!e&&e.nodeType===t}},xo=Co(1),wo=function(e){var r=e.toLowerCase().split(" ");return function(e){var t,n;if(e&&e.nodeType)for(n=e.nodeName.toLowerCase(),t=0;t<r.length;t++)if(n===r[t])return!0;return!1}},No=function(t){return function(e){if(xo(e)){if(e.contentEditable===t)return!0;if(e.getAttribute("data-mce-contenteditable")===t)return!0}return!1}},Eo=Co(3),So=Co(8),ko=Co(9),To=wo("br"),Ao=No("true"),Ro=No("false"),_o={isText:Eo,isElement:xo,isComment:So,isDocument:ko,isBr:To,isContentEditableTrue:Ao,isContentEditableFalse:Ro,matchNodeNames:wo,hasPropValu
e:function(t,n){return function(e){return xo(e)&&e[t]===n}},hasAttribute:function(t,e){return function(e){return xo(e)&&e.hasAttribute(t)}},hasAttributeValue:function(t,n){return function(e){return xo(e)&&e.getAttribute(t)===n}},matchStyleValues:function(r,e){var o=e.toLowerCase().split(" ");return function(e){var t;if(xo(e))for(t=0;t<o.length;t++){var n=e.ownerDocument.defaultView.getComputedStyle(e,null);if((n?n.getPropertyValue(r):null)===o[t])return!0}return!1}},isBogus:function(e){return xo(e)&&e.hasAttribute("data-mce-bogus")},isBogusAll:function(e){return xo(e)&&"all"===e.getAttribute("data-mce-bogus")},isTable:function(e){return xo(e)&&"TABLE"===e.tagName}},Do=function(e){return e&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},Bo=function(e,t){var n,r=t.childNodes;if(!_o.isElement(t)||!Do(t)){for(n=r.length-1;0
<=n;n--)Bo(e,r[n]);if(!1===_o.isDocument(t)){if(_o.isText(t)&&0<t.nodeValue.length){var o=Yt.trim(t.nodeValue).length;if(e.isBlock(t.parentNode)||0<o)return;if(0===o&&(a=(i=t).previousSibling&&"SPAN"===i.previousSibling.nodeName,u=i.nextSibling&&"SPAN"===i.nextSibling.nodeName,a&&u))return}else if(_o.isElement(t)&&(1===(r=t.childNodes).length&&Do(r[0])&&t.parentNode.insertBefore(r[0],t),r.length||ho(rr.fromDom(t))))return;e.remove(t)}var i,a,u;return t}},Oo={trimNode:Bo},Po=Yt.makeMap,Lo=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Io=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Mo=/[<>&\"\']/g,Fo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,zo={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",13
6:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};io={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},ao={"<":"<",">":">","&":"&",""":'"',"'":"'"};var Uo=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n<e.length;n+=2)r=String.fromCharCode
(parseInt(e[n],t)),io[r]||(o="&"+e[n+1]+";",i[r]=o,i[o]=r);return i}};oo=Uo("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta
,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor
,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var Vo=function(e,t){return e.replace(t?Lo:Io,function(e){return io[e]||e})},Ho=function(e,t){return e.replace(t?Lo:Io,function(e){return 1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":io[e]||"&#"+e.charCodeAt(0)+";"})},jo=function(e,t,n){return n=n||oo,e.replace(t?Lo:Io,function(e){return io[e]||n[e]||e})},qo={encodeRaw:Vo,encodeAllRaw:function(e){return(""+e).replace(Mo,function(e){return io[e]||e})},encodeNumeric:Ho,encodeNamed:jo,getEncodeFunc:function(e,t){var n=Uo(t)||oo,r=Po(e.replace(/\+/g,","));return r.named&&
r.numeric?function(e,t){return e.replace(t?Lo:Io,function(e){return io[e]!==undefined?io[e]:n[e]!==undefined?n[e]:1<e.length?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":"&#"+e.charCodeAt(0)+";"})}:r.named?t?function(e,t){return jo(e,t,n)}:jo:r.numeric?Ho:Vo},decode:function(e){return e.replace(Fo,function(e,t){return t?65535<(t="x"===t.charAt(0).toLowerCase()?parseInt(t.substr(1),16):parseInt(t,10))?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):zo[t]||String.fromCharCode(t):ao[e]||oo[e]||(n=e,(r=rr.fromTag("div").dom()).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},$o={},Wo={},Ko=Yt.makeMap,Xo=Yt.each,Yo=Yt.extend,Go=Yt.explode,Jo=Yt.inArray,Qo=function(e,t){return(e=Yt.trim(e))?e.split(t||" "):[]},Zo=function(e){var u,t,n,r,o,i,s={},a=function(e,t,n){var r,o,i,a=function(e,t){var n,r,o={};for(n=0,r=e.length;n<r;n++)o[e[n]]=t||{};return o
};for(t=t||"","string"==typeof(n=n||[])&&(n=Qo(n)),r=(e=Qo(e)).length;r--;)i={attributes:a(o=Qo([u,t].join(" "))),attributesOrder:o,children:a(n,Wo)},s[e[r]]=i},c=function(e,t){var n,r,o,i;for(n=(e=Qo(e)).length,t=Qo(t);n--;)for(r=s[e[n]],o=0,i=t.length;o<i;o++)r.attributes[t[o]]={},r.attributesOrder.push(t[o])};return $o[e]?$o[e]:(u="id accesskey class dir lang style tabindex title role",t="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",n="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment","html4"!==e&&(u+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",t+=" article aside details dialog figure main header footer hgroup section nav",n+=" audio canvas command datalist mark me
ter output picture progress time wbr video ruby bdi keygen"),"html5-strict"!==e&&(u+=" xml:lang",n=[n,i="acronym applet basefont big font strike tt"].join(" "),Xo(Qo(i),function(e){a(e,"",n)}),t=[t,o="center dir isindex noframes"].join(" "),r=[t,n].join(" "),Xo(Qo(o),function(e){a(e,"",r)})),r=r||[t,n].join(" "),a("html","manifest","head body"),a("head","","base command link meta noscript script style title"),a("title hr noscript br"),a("base","href target"),a("link","href rel media hreflang type sizes hreflang"),a("meta","name http-equiv content charset"),a("style","media type scoped"),a("script","src async defer type charset"),a("body","onafterprint onbeforeprint onbeforeunload onblur one
rror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",r),a("address dt dd div caption","",r),a("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",n),a("blockquote","cite",r),a("ol","reversed start type","li"),a("ul","","li"),a("li","value",r),a("dl","","dt dd"),a("a","href target rel media hreflang type",n),a("q","cite",n),a("ins del","cite datetime",r),a("img","src sizes srcset alt usemap ismap width height"),a("iframe","src name width height",r),a("embed","src type width height"),a("object","data type typemustmatch name usemap form width heig
ht",[r,"param"].join(" ")),a("param","name value"),a("map","name",[r,"area"].join(" ")),a("area","alt coords shape href target rel media hreflang type"),a("table","border","caption colgroup thead tfoot tbody tr"+("html4"===e?" col":"")),a("colgroup","span","col"),a("col","span"),a("tbody thead tfoot","","tr"),a("tr","","td th"),a("td","colspan rowspan headers",r),a("th","colspan rowspan headers scope abbr",r),a("form","accept-charset action autocomplete enctype method name novalidate target",r),a("fieldset","disabled form name",[r,"legend"].join(" ")),a("label","form for",n),a("input",
"accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),a("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"===e?r:n),a("select","disabled form multiple name required size","option optgroup"),a("optgroup","disabled label","option"),a("option","disabled label selected value"),a("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),a("menu","type label",[r,"li"].join(" ")),a("noscript","",r),"html4"!==e&&(a("wbr"),a("ruby","",[n,"rt rp"].join(" ")),a("figcaption",&qu
ot;",r),a("mark rt rp summary bdi","",n),a("canvas","width height",r),a("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[r,"track source"].join(" ")),a("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[r,"track source"].join(" ")),a("picture","","img source"),a("source","src srcset type media sizes"),a("track","kind src srclang label default"),a("datalist","",[n,"option"].join(" ")),a("article section nav aside main header footer","",r),a("hgroup","","h1 h2 h3 h4 h5 h6"),a("figure","",[r,"figcaption"].join(" ")),a("time","datetime",n),a("dialog&
quot;,"open",r),a("command","type label icon disabled checked radiogroup command"),a("output","for form name",n),a("progress","value max",n),a("meter","value min max low high optimum",n),a("details","open",[r,"summary"].join(" ")),a("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!==e&&(c("script","language xml:space"),c("style","xml:space"),c("object","declare classid code codebase codetype archive standby align border hspace vspace"),c("embed","align name hspace vspace"),c("param","valuetype type"),c("a","charset name rev shape coords"),c("br","clear"),c("applet","codebase archive code object alt name width height align hspace vspace"
;),c("img","name longdesc align border hspace vspace"),c("iframe","longdesc frameborder marginwidth marginheight scrolling align"),c("font basefont","size color face"),c("input","usemap align"),c("select","onchange"),c("textarea"),c("h1 h2 h3 h4 h5 h6 div p legend caption","align"),c("ul","type compact"),c("li","type"),c("ol dl menu dir","compact"),c("pre","width xml:space"),c("hr","align noshade size width"),c("isindex","prompt"),c("table","summary width frame rules cellspacing cellpadding align bgcolor"),c("col","width align char charoff valign"),c("colgroup","width align char charoff valign"),c("thead","align char charoff valign"),c("tr","al
ign char charoff valign bgcolor"),c("th","axis align char charoff valign nowrap bgcolor width height"),c("form","accept"),c("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),c("tfoot","align char charoff valign"),c("tbody","align char charoff valign"),c("area","nohref"),c("body","background bgcolor text link vlink alink")),"html4"!==e&&(c("input button select textarea","autofocus"),c("input textarea","placeholder"),c("a","download"),c("link script img","crossorigin"),c("iframe","sandbox seamless allowfullscreen")),Xo(Qo("a form meter progress dfn"),function(e){s[e]&&delete s[e].children[e]}),delete s.caption.children.table,delete s.script,$o[e]=s)},ei=function(e,n){var r;return e
&&(r={},"string"==typeof e&&(e={"*":e}),Xo(e,function(e,t){r[t]=r[t.toUpperCase()]="map"===n?Ko(e,/[, ]/):Go(e,/[, ]/)})),r};function ti(i){var e,t,n,r,o,a,u,s,c,l,f,d,m,N={},g={},E=[],p={},h={},v=function(e,t,n){var r=i[e];return r?r=Ko(r,/[, ]/,Ko(r.toUpperCase(),/[, ]/)):(r=$o[e])||(r=Ko(t," ",Ko(t.toUpperCase()," ")),r=Yo(r,n),$o[e]=r),r};n=Zo((i=i||{}).schema),!1===i.verify_html&&(i.valid_elements="*[*]"),e=ei(i.valid_styles),t=ei(i.invalid_styles,"map"),s=ei(i.valid_classes,"map"),r=v("whitespace_elements","pre script noscript style textarea video audio iframe object code"),o=v("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),a=v("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),u=v("boolean_attributes","chec
ked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),l=v("non_empty_elements","td th iframe video audio object script pre code",a),f=v("move_caret_before_on_enter_elements","table",l),d=v("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),c=v("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",d),m=v("text_inline_elements","span strong b em i font strike u var cite dfn code mark q sup sub samp"),Xo((i.special||"script noscript noframes noembed title style textarea xmp").split(" "),function(e){h[e]=new RegExp("</"+e+"[^>]*>","gi")});var S=fun
ction(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")},b=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,x=/^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/,w=/[*?+]/;if(e)for(e=Qo(e,","),N["@"]&&(h=N["@"].attributes,v=N["@"].attributesOrder),t=0,n=e.length;t<n;t++)if(i=C.exec(e[t])){if(g=i[1],c=i[2],p=i[3],s=i[5],a={attributes:d={},attributesOrder:m=[]},"#"===g&&(a.paddEmpty=!0),"-"===g&&(a.removeEmpty=!0),"!"===i[4]&&(a.removeEmptyAttrs=!0),h){for(b in h)d[b]=h[b];m.push.apply(m,v)}if(s)for(r=0,o=(s=Qo(s,"|")).length;r<o;r++)if(i=x.exec(s[r])){if(u={},f=i[1],l=i[2].replace(/[\\:]:/g,":"),g=i[3],y=i[4],"!"===f&&(a.attributesRequired=a.attributesRequired||[],a.attributesRequired.push(l),u.required=!0),"-"===f){del
ete d[l],m.splice(Jo(m,l),1);continue}g&&("="===g&&(a.attributesDefault=a.attributesDefault||[],a.attributesDefault.push({name:l,value:y}),u.defaultValue=y),":"===g&&(a.attributesForced=a.attributesForced||[],a.attributesForced.push({name:l,value:y}),u.forcedValue=y),"<"===g&&(u.validValues=Ko(y,"?"))),w.test(l)?(a.attributePatterns=a.attributePatterns||[],u.pattern=S(l),a.attributePatterns.push(u)):(d[l]||m.push(l),d[l]=u)}h||"@"!==c||(h=d,v=m),p&&(a.outputName=c,N[p]=a),w.test(c)?(a.pattern=S(c),E.push(a)):N[c]=a}},y=function(e){N={},E=[],b(e),Xo(n,function(e,t){g[t]=e.children})},C=function(e){var a=/^(~)?(.+)$/;e&&($o.text_block_elements=$o.block_elements=null,Xo(Qo(e,","),function(e){var t=a.exec(e),n="~"===t[1],r=n?"span":"div",o=t[2];if(g[o]=g[r],p[o]=r,n||(c[o.toUpperCase()]={},c[o]={}),!N[o]){var i=N[r];delete(i=Yo({},i)).removeEmptyAt
trs,delete i.removeEmpty,N[o]=i}Xo(g,function(e,t){e[r]&&(g[t]=e=Yo({},g[t]),e[o]=e[r])})}))},x=function(e){var o=/^([+\-]?)(\w+)\[([^\]]+)\]$/;$o[i.schema]=null,e&&Xo(Qo(e,","),function(e){var t,n,r=o.exec(e);r&&(n=r[1],t=n?g[r[2]]:g[r[2]]={"#comment":{}},t=g[r[2]],Xo(Qo(r[3],"|"),function(e){"-"===n?delete t[e]:t[e]={}}))})},w=function(e){var t,n=N[e];if(n)return n;for(t=E.length;t--;)if((n=E[t]).pattern.test(e))return n};return i.valid_elements?y(i.valid_elements):(Xo(n,function(e,t){N[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},g[t]=e.children}),"html5"!==i.schema&&Xo(Qo("strong/b em/i"),function(e){e=Qo(e,"/"),N[e[1]].outputName=e[0]}),Xo(Qo("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){N[e]&&(N[e].removeEmpty=!0)}),Xo(Qo("p h1 h2 h3 h4 h5 h6 th td pre div address caption li"),function(e){N[e].pad
dEmpty=!0}),Xo(Qo("span"),function(e){N[e].removeEmptyAttrs=!0})),C(i.custom_elements),x(i.valid_children),b(i.extended_valid_elements),x("+ol[ul|ol],+ul[ul|ol]"),Xo({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},function(e,t){N[t]&&(N[t].parentsRequired=Qo(e))}),i.invalid_elements&&Xo(Go(i.invalid_elements),function(e){N[e]&&delete N[e]}),w("span")||b("span[!data-mce-type|*]"),{children:g,elements:N,getValidStyles:function(){return e},getValidClasses:function(){return s},getBlockElements:function(){return c},getInvalidStyles:function(){return t},getShortEndedElements:function(){return a},getTextBlockElements:function(){return d},getTextInlineElements:function(){return m},getBoolAttrs:
function(){return u},getElementRule:w,getSelfClosingElements:function(){return o},getNonEmptyElements:function(){return l},getMoveCaretBeforeOnEnterElements:function(){return f},getWhiteSpaceElements:function(){return r},getSpecialElements:function(){return h},isValidChild:function(e,t){var n=g[e.toLowerCase()];return!(!n||!n[t.toLowerCase()])},isValid:function(e,t){var n,r,o=w(e);if(o){if(!t)return!0;if(o.attributes[t])return!0;if(n=o.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},getCustomElements:function(){return p},addValidElements:b,setValidElements:y,addCustomElements:C,addValidChildren:x}}var ni=function(e,t,n,r){var o=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+o(t)+o(n)+o(r)};function ri(y,e){var C,t,c,l,x=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,w=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)
\')|(?:\"([^\"]+)\")/gi,N=/\s*([^:]+):\s*([^;]+);?/g,E=/\s+$/,S={},k="\ufeff";for(y=y||{},e&&(c=e.getValidStyles(),l=e.getInvalidStyles()),t=("\\\" \\' \\; \\: ; : "+k).split(" "),C=0;C<t.length;C++)S[t[C]]=k+C,S[k+C]=t[C];return{toHex:function(e){return e.replace(x,ni)},parse:function(e){var t,n,r,o,i,a,u,s,c={},l=y.url_converter,f=y.url_converter_scope||this,d=function(e,t,n){var r,o,i,a;if((r=c[e+"-top"+t])&&(o=c[e+"-right"+t])&&(i=c[e+"-bottom"+t])&&(a=c[e+"-left"+t])){var u=[r,o,i,a];for(C=u.length-1;C--&&u[C]===u[C+1];);-1<C&&n||(c[e+t]=-1===C?u[0]:u.join(" "),delete c[e+"-top"+t],delete c[e+"-right"+t],delete c[e+"-bottom"+t],delete c[e+"-left"+t])}},m=function(e){var t,n=c[e];if(n){for(t=(n=n.split(" ")).length;t--;)if(n[t]!==n[0])return!1;return c[e]=n[0],!0}},g=function(e)
{return o=!0,S[e]},p=function(e,t){return o&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return S[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e},h=function(e){return String.fromCharCode(parseInt(e.slice(1),16))},v=function(e){return e.replace(/\\[0-9a-f]+/gi,h)},b=function(e,t,n,r,o,i){if(o=o||i)return"'"+(o=p(o)).replace(/\'/g,"\\'")+"'";if(t=p(t||n||r),!y.allow_script_urls){var a=t.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(a))return"";if(!y.allow_svg_data_urls&&/^data:image\/svg/i.test(a))return""}return l&&(t=l.call(f,t,"style")),"url('"+t.replace(/\'/g,"\\'")+"')"};if(e){for(e=(e=e.replace(/[\u0000-\u001F]/g,"")).replace(/\\[\"\';:\uFEFF]/g,g).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,g)});t=N.exec(e);)if(N.lastIndex=t.index+t[0].length,n=t[1].replace(E,"").toLowerCas
e(),r=t[2].replace(E,""),n&&r){if(n=v(n),r=v(r),-1!==n.indexOf(k)||-1!==n.indexOf('"'))continue;if(!y.allow_script_urls&&("behavior"===n||/expression\s*\(|\/\*|\*\//.test(r)))continue;"font-weight"===n&&"700"===r?r="bold":"color"!==n&&"background-color"!==n||(r=r.toLowerCase()),r=(r=r.replace(x,ni)).replace(w,b),c[n]=o?p(r,!0):r}d("border","",!0),d("border","-width"),d("border","-color"),d("border","-style"),d("padding",""),d("margin",""),i="border",u="border-style",s="border-color",m(a="border-width")&&m(u)&&m(s)&&(c[i]=c[a]+" "+c[u]+" "+c[s],delete c[a],delete c[u],delete c[s]),"medium none"===c.border&&delete c.border,"none"===c["border-image
"]&&delete c["border-image"]}return c},serialize:function(i,e){var t,n,r,o,a,u="",s=function(e){var t,n,r,o;if(t=c[e])for(n=0,r=t.length;n<r;n++)e=t[n],(o=i[e])&&(u+=(0<u.length?" ":"")+e+": "+o+";")};if(e&&c)s("*"),s(e);else for(t in i)!(n=i[t])||l&&(r=t,o=e,a=void 0,(a=l["*"])&&a[r]||(a=l[o])&&a[r])||(u+=(0<u.length?" ":"")+t+": "+n+";");return u}}}var oi,ii=Yt.each,ai=Yt.grep,ui=de.ie,si=/^([a-z0-9],?)+$/i,ci=/^[ \t\r\n]*$/,li=function(n,r,o){var e={},i=r.keep_values,t={set:function(e,t,n){r.url_converter&&(t=r.url_converter.call(r.url_converter_scope||o(),t,n,e[0])),e.attr("data-mce-"+n,t).attr(n,t)},get:function(e,t){return e.attr("data-mce-"+t)||e.attr(t)}};return e={style:{set:function(e,t){null===t||"object"!=typeof t?(i&&e.attr("data-mce-style&q
uot;,t),e.attr("style",t)):e.css(t)},get:function(e){var t=e.attr("data-mce-style")||e.attr("style");return t=n.serialize(n.parse(t),e[0].nodeName)}}},i&&(e.href=e.src=t),e},fi=function(e,t){var n=t.attr("style"),r=e.serialize(e.parse(n),t[0].nodeName);r||(r=null),t.attr("data-mce-style",r)},di=function(e,t){var n,r,o=0;if(e)for(n=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)r=e.nodeType,(!t||3!==r||r!==n&&e.nodeValue.length)&&(o++,n=r);return o};function mi(a,u){var s,c=this;void 0===u&&(u={});var r={},i=window,o={},t=0,e=function(m,g){void 0===g&&(g={});var p,h=0,v={};p=g.maxLoadTime||5e3;var b=function(e){m.getElementsByTagName("head")[0].appendChild(e)},n=function(e,t,n){var o,r,i,a,u=function(){for(var e=a.passed,t=e.length;t--;)e[t]();a.status=2,a.passed=[],a.failed=[]},s=function(){for(var e=a.failed,t=e.length;t--;)e[t]();a.status=3,a.passed=[],a.failed=[]},c=function(
e,t){e()||((new Date).getTime()-i<p?ve.setTimeout(t):s())},l=function(){c(function(){for(var e,t,n=m.styleSheets,r=n.length;r--;)if((t=(e=n[r]).ownerNode?e.ownerNode:e.owningElement)&&t.id===o.id)return u(),!0},l)},f=function(){c(function(){try{var e=r.sheet.cssRules;return u(),!!e}catch(t){}},f)};if(e=Yt._addCacheSuffix(e),v[e]?a=v[e]:(a={passed:[],failed:[]},v[e]=a),t&&a.passed.push(t),n&&a.failed.push(n),1!==a.status)if(2!==a.status)if(3!==a.status){if(a.status=1,(o=m.createElement("link")).rel="stylesheet",o.type="text/css",o.id="u"+h++,o.async=!1,o.defer=!1,i=(new Date).getTime(),g.contentCssCors&&(o.crossOrigin="anonymous"),"onload"in o&&!((d=navigator.userAgent.match(/WebKit\/(\d*)/))&&parseInt(d[1],10)<536))o.onload=l,o.onerror=s;else{if(0<navigator.userAgent.indexOf("Firefox"))return(r=m.createElement("style")).textContent='@import "'
+e+'"',f(),void b(r);l()}var d;b(o),o.href=e}else s();else u()},t=function(t){return Jr.nu(function(e){n(t,H(e,j(no.value(t))),H(e,j(no.error(t))))})},o=function(e){return e.fold(q,q)};return{load:n,loadAll:function(e,n,r){Zr($(e,t)).get(function(e){var t=W(e,function(e){return e.isValue()});0<t.fail.length?r(t.fail.map(o)):n(t.pass.map(o))})}}}(a,{contentCssCors:u.contentCssCors}),l=[],f=u.schema?u.schema:ti({}),d=ri({url_converter:u.url_converter,url_converter_scope:u.url_converter_scope},u.schema),m=u.ownEvents?new ke(u.proxy):ke.Event,n=f.getBlockElements(),g=pn.overrideDefaults(function(){return{context:a,element:V.getRoot()}}),p=function(e){if(e&&a&&"string"==typeof e){var t=a.getElementById(e);return t&&t.id!==e?a.getElementsByName(e)[1]:t}return e},h=function(e){return"string"==typeof e&&(e=p(e)),g(e)},v=function(e,t,n){var r,o,i=h(e);return i.length&&(o=(r=s[t])&&r.get?r.get(i,t):i.attr(t)),void 0==
=o&&(o=n||""),o},b=function(e){var t=p(e);return t?t.attributes:[]},y=function(e,t,n){var r,o;""===n&&(n=null);var i=h(e);r=i.attr(t),i.length&&((o=s[t])&&o.set?o.set(i,n,t):i.attr(t,n),r!==n&&u.onSetAttrib&&u.onSetAttrib({attrElm:i,attrName:t,attrValue:n}))},C=function(){return u.root_element||a.body},x=function(e,t){return Kr.getPos(a.body,p(e),t)},w=function(e,t,n){var r=h(e);return n?r.css(t):("float"===(t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}))&&(t=de.ie&&de.ie<12?"styleFloat":"cssFloat"),r[0]&&r[0].style?r[0].style[t]:undefined)},N=function(e){var t,n;return e=p(e),t=w(e,"width"),n=w(e,"height"),-1===t.indexOf("px")&&(t=0),-1===n.indexOf("px")&&(n=0),{w:parseInt(t,10)||e.offsetWidth||e.clientWidth,h:parseInt(n,10)||e.offsetHeight||e.clientHeight}},E=function(e,t){var n;if(!e)retur
n!1;if(!Array.isArray(e)){if("*"===t)return 1===e.nodeType;if(si.test(t)){var r=t.toLowerCase().split(/,/),o=e.nodeName.toLowerCase();for(n=r.length-1;0<=n;n--)if(r[n]===o)return!0;return!1}if(e.nodeType&&1!==e.nodeType)return!1}var i=Array.isArray(e)?e:[e];return 0<kt(t,i[0].ownerDocument||i[0],null,i).length},S=function(e,t,n,r){var o,i=[],a=p(e);for(r=r===undefined,n=n||("BODY"!==C().nodeName?C().parentNode:null),Yt.is(t,"string")&&(t="*"===(o=t)?function(e){return 1===e.nodeType}:function(e){return E(e,o)});a&&a!==n&&a.nodeType&&9!==a.nodeType;){if(!t||"function"==typeof t&&t(a)){if(!r)return[a];i.push(a)}a=a.parentNode}return r?i:null},k=function(e,t,n){var r=t;if(e)for("string"==typeof t&&(r=function(e){return E(e,t)}),e=e[n];e;e=e[n])if("function"==typeof r&&r(e))return e;return null},T=function(e,n,r){var o,t="string"==typeof e
?p(e):e;if(!t)return!1;if(Yt.isArray(t)&&(t.length||0===t.length))return o=[],ii(t,function(e,t){e&&("string"==typeof e&&(e=p(e)),o.push(n.call(r,e,t)))}),o;var i=r||c;return n.call(i,t)},A=function(e,t){h(e).each(function(e,n){ii(t,function(e,t){y(n,t,e)})})},R=function(e,r){var t=h(e);ui?t.each(function(e,t){if(!1!==t.canHaveHTML){for(;t.firstChild;)t.removeChild(t.firstChild);try{t.innerHTML="<br>"+r,t.removeChild(t.firstChild)}catch(n){pn("<div></div>").html("<br>"+r).contents().slice(1).appendTo(t)}return r}}):t.html(r)},_=function(e,n,r,o,i){return T(e,function(e){var t="string"==typeof n?a.createElement(n):n;return A(t,r),o&&("string"!=typeof o&&o.nodeType?t.appendChild(o):"string"==typeof o&&R(t,o)),i?t:e.appendChild(t)})},D=function(e,t,n){return _(a.createElement(e),e,t,n,!0)},B=qo.decode,O=qo.encodeAllRaw,P=function(e,t){var n=h(e);
return t?n.each(function(){for(var e;e=this.firstChild;)3===e.nodeType&&0===e.data.length?this.removeChild(e):this.parentNode.insertBefore(e,this)}).remove():n.remove(),1<n.length?n.toArray():n[0]},L=function(e,t,n){h(e).toggleClass(t,n).each(function(){""===this.className&&pn(this).attr("class",null)})},I=function(t,e,n){return T(e,function(e){return Yt.is(e,"array")&&(t=t.cloneNode(!0)),n&&ii(ai(e.childNodes),function(e){t.appendChild(e)}),e.parentNode.replaceChild(t,e)})},M=function(){return a.createRange()},F=function(e,t,n,r){if(Yt.isArray(e)){for(var o=e.length;o--;)e[o]=F(e[o],t,n,r);return e}return!u.collect||e!==a&&e!==i||l.push([e,t,n,r]),m.bind(e,t,n,r||V)},z=function(e,t,n){var r;if(Yt.isArray(e)){for(r=e.length;r--;)e[r]=z(e[r],t,n);return e}if(l&&(e===a||e===i))for(r=l.length;r--;){var o=l[r];e!==o[0]||t&&t!==o[1]||n&&n!==o[2]||m.unbind(o[0],o[1],o[2])}return m.unbind(e,t,n
)},U=function(e){if(e&&_o.isElement(e)){var t=e.getAttribute("data-mce-contenteditable");return t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null}return null},V={doc:a,settings:u,win:i,files:o,stdMode:!0,boxModel:!0,styleSheetLoader:e,boundEvents:l,styles:d,schema:f,events:m,isBlock:function(e){if("string"==typeof e)return!!n[e];if(e){var t=e.nodeType;if(t)return!(1!==t||!n[e.nodeName])}return!1},$:g,$$:h,root:null,clone:function(t,e){if(!ui||1!==t.nodeType||e)return t.cloneNode(e);if(!e){var n=a.createElement(t.nodeName);return ii(b(t),function(e){y(n,e.nodeName,v(t,e.nodeName))}),n}return null},getRoot:C,getViewPort:function(e){var t=e||i,n=t.document,r=n.documentElement;return{x:t.pageXOffset||r.scrollLeft,y:t.pageYOffset||r.scrollTop,w:t.innerWidth||r.clientWidth,h:t.innerHeight||r.clientHeight}},getRect:function(e){var t,n;return e=p(e),t=x(e),n=N(e),{x:t.x,y:t.y,w:n.w,h:n.h}},getSize:N,getParent:func
tion(e,t,n){var r=S(e,t,n,!1);return r&&0<r.length?r[0]:null},getParents:S,get:p,getNext:function(e,t){return k(e,t,"nextSibling")},getPrev:function(e,t){return k(e,t,"previousSibling")},select:function(e,t){return kt(e,p(t)||u.root_element||a,[])},is:E,add:_,create:D,createHTML:function(e,t,n){var r,o="";for(r in o+="<"+e,t)t.hasOwnProperty(r)&&null!==t[r]&&"undefined"!=typeof t[r]&&(o+=" "+r+'="'+O(t[r])+'"');return void 0!==n?o+">"+n+"</"+e+">":o+" />"},createFragment:function(e){var t,n=a.createElement("div"),r=a.createDocumentFragment();for(e&&(n.innerHTML=e);t=n.firstChild;)r.appendChild(t);return r},remove:P,setStyle:function(e,t,n){var r=h(e).css(t,n);u.update_styles&&fi(d,r)},getStyle:w,setStyles:function(e,t){var n=h(e).css(t);u.update_styles&&fi(d,n)},removeAllAttribs:function(e){r
eturn T(e,function(e){var t,n=e.attributes;for(t=n.length-1;0<=t;t--)e.removeAttributeNode(n.item(t))})},setAttrib:y,setAttribs:A,getAttrib:v,getPos:x,parseStyle:function(e){return d.parse(e)},serializeStyle:function(e,t){return d.serialize(e,t)},addStyle:function(e){var t,n;if(V!==mi.DOM&&a===document){if(r[e])return;r[e]=!0}(n=a.getElementById("mceDefaultStyles"))||((n=a.createElement("style")).id="mceDefaultStyles",n.type="text/css",(t=a.getElementsByTagName("head")[0]).firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n)),n.styleSheet?n.styleSheet.cssText+=e:n.appendChild(a.createTextNode(e))},loadCSS:function(e){var n;V===mi.DOM||a!==document?(e||(e=""),n=a.getElementsByTagName("head")[0],ii(e.split(","),function(e){var t;e=Yt._addCacheSuffix(e),o[e]||(o[e]=!0,t=D("link",{rel:"stylesheet",href:e}),n.appendChild(t))})):mi.DOM.loadCSS(e)},addClass:function(e,t){h(e
).addClass(t)},removeClass:function(e,t){L(e,t,!1)},hasClass:function(e,t){return h(e).hasClass(t)},toggleClass:L,show:function(e){h(e).show()},hide:function(e){h(e).hide()},isHidden:function(e){return"none"===h(e).css("display")},uniqueId:function(e){return(e||"mce_")+t++},setHTML:R,getOuterHTML:function(e){var t="string"==typeof e?p(e):e;return _o.isElement(t)?t.outerHTML:pn("<div></div>").append(pn(t).clone()).html()},setOuterHTML:function(e,t){h(e).each(function(){try{if("outerHTML"in this)return void(this.outerHTML=t)}catch(e){}P(pn(this).html(t),!0)})},decode:B,encode:O,insertAfter:function(e,t){var r=p(t);return T(e,function(e){var t,n;return t=r.parentNode,(n=r.nextSibling)?t.insertBefore(e,n):t.appendChild(e),e})},replace:I,rename:function(t,e){var n;return t.nodeName!==e.toUpperCase()&&(n=D(e),ii(b(t),function(e){y(n,e.nodeName,v(t,e.nodeName))}),I(n,t,!0)),n||t},findCommonAncestor:function(e,t
){for(var n,r=e;r;){for(n=t;n&&r!==n;)n=n.parentNode;if(r===n)break;r=r.parentNode}return!r&&e.ownerDocument?e.ownerDocument.documentElement:r},toHex:function(e){return d.toHex(Yt.trim(e))},run:T,getAttribs:b,isEmpty:function(e,t){var n,r,o,i,a,u,s=0;if(e=e.firstChild){a=new ro(e,e.parentNode),t=t||(f?f.getNonEmptyElements():null),i=f?f.getWhiteSpaceElements():{};do{if(o=e.nodeType,_o.isElement(e)){var c=e.getAttribute("data-mce-bogus");if(c){e=a.next("all"===c);continue}if(u=e.nodeName.toLowerCase(),t&&t[u]){if("br"===u){s++,e=a.next();continue}return!1}for(n=(r=b(e)).length;n--;)if("name"===(u=r[n].nodeName)||"data-mce-bookmark"===u)return!1}if(8===o)return!1;if(3===o&&!ci.test(e.nodeValue))return!1;if(3===o&&e.parentNode&&i[e.parentNode.nodeName]&&ci.test(e.nodeValue))return!1;e=a.next()}while(e)}return s<=1},createRng:M,nodeIndex:di,split:function(e,t,n){var r,o,i,a=M();i
f(e&&t)return a.setStart(e.parentNode,di(e)),a.setEnd(t.parentNode,di(t)),r=a.extractContents(),(a=M()).setStart(t.parentNode,di(t)+1),a.setEnd(e.parentNode,di(e)+1),o=a.extractContents(),(i=e.parentNode).insertBefore(Oo.trimNode(V,r),e),n?i.insertBefore(n,e):i.insertBefore(t,e),i.insertBefore(Oo.trimNode(V,o),e),P(e),n||t},bind:F,unbind:z,fire:function(e,t,n){return m.fire(e,t,n)},getContentEditable:U,getContentEditableParent:function(e){for(var t=C(),n=null;e&&e!==t&&null===(n=U(e));e=e.parentNode);return n},destroy:function(){if(l)for(var e=l.length;e--;){var t=l[e];m.unbind(t[0],t[1],t[2])}kt.setDocument&&kt.setDocument()},isChildOf:function(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset}};return s=li(d,u,function(){return V}),
V}(oi=mi||(mi={})).DOM=oi(document),oi.nodeIndex=di;var gi=mi,pi=gi.DOM,hi=Yt.each,vi=Yt.grep,bi=function(e){return"function"==typeof e},yi=function(){var l={},o=[],i={},a=[],f=0;this.isDone=function(e){return 2===l[e]},this.markDone=function(e){l[e]=2},this.add=this.load=function(e,t,n,r){l[e]===undefined&&(o.push(e),l[e]=0),t&&(i[e]||(i[e]=[]),i[e].push({success:t,failure:r,scope:n||this}))},this.remove=function(e){delete l[e],delete i[e]},this.loadQueue=function(e,t,n){this.loadScripts(o,e,t,n)},this.loadScripts=function(n,e,t,r){var u,s=[],c=function(t,e){hi(i[e],function(e){bi(e[t])&&e[t].call(e.scope)}),i[e]=undefined};a.push({success:e,failure:r,scope:t||this}),(u=function(){var e=vi(n);if(n.length=0,hi(e,function(e){var t,n,r,o,i,a;2!==l[e]?3!==l[e]?1!==l[e]&&(l[e]=1,f++,t=e,n=function(){l[e]=2,f--,c("success",e),u()},r=function(){l[e]=3,f--,s.push(e),c("failure",e),u()},i=(a=pi).uniqueId(),(o=document.createEleme
nt("script")).id=i,o.type="text/javascript",o.src=Yt._addCacheSuffix(t),o.onload=function(){a.remove(i),o&&(o.onreadystatechange=o.onload=o=null),n()},o.onerror=function(){bi(r)?r():"undefined"!=typeof console&&console.log&&console.log("Failed to load script: "+t)},(document.getElementsByTagName("head")[0]||document.body).appendChild(o)):c("failure",e):c("success",e)}),!f){var t=a.slice(0);a.length=0,hi(t,function(e){0===s.length?bi(e.success)&&e.success.call(e.scope):bi(e.failure)&&e.failure.call(e.scope,s)})}})()}};yi.ScriptLoader=new yi;var Ci,xi=Yt.each;function wi(){var r=this,o=[],a={},u={},i=[],s=function(e){var t;return u[e]&&(t=u[e].dependencies),t||[]},c=function(e,t){return"object"==typeof t?t:"string"==typeof e?{prefix:"",resource:t,suffix:""}:{prefix:e.prefix,resource:t,suffix:e.suffix}},l=function(e,n,t,r){var o=s
(e);xi(o,function(e){var t=c(n,e);f(t.resource,t,undefined,undefined)}),t&&(r?t.call(r):t.call(yi))},f=function(e,t,n,r,o){if(!a[e]){var i="string"==typeof t?t:t.prefix+t.resource+t.suffix;0!==i.indexOf("/")&&-1===i.indexOf("://")&&(i=wi.baseURL+"/"+i),a[e]=i.substring(0,i.lastIndexOf("/")),u[e]?l(e,t,n,r):yi.ScriptLoader.add(i,function(){return l(e,t,n,r)},r,o)}};return{items:o,urls:a,lookup:u,_listeners:i,get:function(e){return u[e]?u[e].instance:undefined},dependencies:s,requireLangPack:function(e,t){var n=wi.language;if(n&&!1!==wi.languageLoad){if(t)if(-1!==(t=","+t+",").indexOf(","+n.substr(0,2)+","))n=n.substr(0,2);else if(-1===t.indexOf(","+n+","))return;yi.ScriptLoader.add(a[e]+"/langs/"+n+".js")}},add:function(t,e,n){o.push(e),u[t]={instance:e,dependencies:n};var r=W(i,function(e){return e.name===t});return i=r.fai
l,xi(r.pass,function(e){e.callback()}),e},remove:function(e){delete a[e],delete u[e]},createUrl:c,addComponents:function(e,t){var n=r.urls[e];xi(t,function(e){yi.ScriptLoader.add(n+"/"+e)})},load:f,waitFor:function(e,t){u.hasOwnProperty(e)?t():i.push({name:e,callback:t})}}}(Ci=wi||(wi={})).PluginManager=Ci(),Ci.ThemeManager=Ci();var Ni=function(t,n){Ir(t).each(function(e){e.dom().insertBefore(n.dom(),t.dom())})},Ei=function(e,t){Fr(e).fold(function(){Ir(e).each(function(e){ki(e,t)})},function(e){Ni(e,t)})},Si=function(t,n){jr(t).fold(function(){ki(t,n)},function(e){t.dom().insertBefore(n.dom(),e.dom())})},ki=function(e,t){e.dom().appendChild(t.dom())},Ti=function(t,e){F(e,function(e){ki(t,e)})},Ai=function(e){e.dom().textContent="",F(Vr(e),function(e){Ri(e)})},Ri=function(e){var t=e.dom();null!==t.parentNode&&t.parentNode.removeChild(t)},_i=function(e){var t,n=Vr(e);0<n.length&&(t=e,F(n,function(e){Ni(t,e)})),Ri(e)},Di=function(n,r){var o=null;
return{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null===o&&(o=setTimeout(function(){n.apply(null,e),o=null},r))}}},Bi=function(e){var t=e,n=function(){return t};return{get:n,set:function(e){t=e},clone:function(){return Bi(n())}}},Oi=function(e,t){var n=br(e,t);return n===undefined||""===n?[]:n.split(" ")},Pi=function(e){return e.dom().classList!==undefined},Li=function(e,t){return o=t,i=Oi(n=e,r="class").concat([o]),hr(n,r,i.join(" ")),!0;var n,r,o,i},Ii=function(e,t){return o=t,0<(i=z(Oi(n=e,r="class"),function(e){return e!==o})).length?hr(n,r,i.join(" ")):yr(n,r),!1;var n,r,o,i},Mi=function(e,t){Pi(e)?e.dom().classList.add(t):Li(e,t)},Fi=function(e){0===(Pi(e)?e.dom().classList:Oi(e,"class")).length&&yr(e,"class")},zi=function(e,t){return Pi(e)&&e.dom().classList.contains(t)},
Ui=function(e,t){var n=[];return F(Vr(e),function(e){t(e)&&(n=n.concat([e])),n=n.concat(Ui(e,t))}),n},Vi=function(e,t){return n=t,o=(r=e)===undefined?document:r.dom(),Br(o)?[]:$(o.querySelectorAll(n),rr.fromDom);var n,r,o};function Hi(e,t,n,r,o){return e(n,r)?A.some(n):P(o)&&o(n)?A.none():t(n,r,o)}var ji,qi=function(e,t,n){for(var r=e.dom(),o=P(n)?n:j(!1);r.parentNode;){r=r.parentNode;var i=rr.fromDom(r);if(t(i))return A.some(i);if(o(i))break}return A.none()},$i=function(e,t,n){return Hi(function(e){return t(e)},qi,e,t,n)},Wi=function(e,t,n){return qi(e,function(e){return Dr(e,t)},n)},Ki=function(e,t){return n=t,o=(r=e)===undefined?document:r.dom(),Br(o)?A.none():A.from(o.querySelector(n)).map(rr.fromDom);var n,r,o},Xi=function(e,t,n){return Hi(Dr,Wi,e,t,n)},Yi=j("mce-annotation"),Gi=j("data-mce-annotation"),Ji=j("data-mce-annotation-uid"),Qi=function(r,e){var t=r.selection.getRng(),n=rr.fromDom(t.startContainer),o=rr.fromDom(r.getBody()
),i=e.fold(function(){return"."+Yi()},function(e){return"["+Gi()+'="'+e+'"]'}),a=Hr(n,t.startOffset).getOr(n),u=Xi(a,i,function(e){return Or(e,o)}),s=function(e,t){return n=t,(r=e.dom())&&r.hasAttribute&&r.hasAttribute(n)?A.some(br(e,t)):A.none();var n,r};return u.bind(function(e){return s(e,""+Ji()).bind(function(n){return s(e,""+Gi()).map(function(e){var t=Zi(r,n);return{uid:n,name:e,elements:t}})})})},Zi=function(e,t){var n=rr.fromDom(e.getBody());return Vi(n,"["+Ji()+'="'+t+'"]')},ea=function(i,e){var n,r,o,a=Bi({}),c=function(e,t){u(e,function(e){return t(e),e})},u=function(e,t){var n=a.get(),r=t(n.hasOwnProperty(e)?n[e]:{listeners:[],previous:Bi(A.none())});n[e]=r,a.set(n)},t=(n=function(){var e,t,n,r=a.get(),o=(e=fr(r),(n=Q.call(e,0)).sort(t),n);F(o,function(e){u(e,function(u){var s=u.previous.get();return Qi(i,A.some(e)).fold(function(){var t;s.isSome()&&(c(t=e,function(e){F(e.liste
ners,function(e){return e(!1,t)})}),u.previous.set(A.none()))},function(e){var t,n,r,o=e.uid,i=e.name,a=e.elements;s.is(o)||(n=o,r=a,c(t=i,function(e){F(e.listeners,function(e){return e(!0,t,{uid:n,nodes:$(r,function(e){return e.dom()})})})}),u.previous.set(A.some(o)))}),{previous:u.previous,listeners:u.listeners}})})},r=30,o=null,{cancel:function(){null!==o&&(clearTimeout(o),o=null)},throttle:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];null!==o&&clearTimeout(o),o=setTimeout(function(){n.apply(null,e),o=null},r)}});return i.on("remove",function(){t.cancel()}),i.on("nodeChange",function(){t.throttle()}),{addListener:function(e,t){u(e,function(e){return{previous:e.previous,listeners:e.listeners.concat([t])}})}}},ta=function(e,n){e.on("init",function(){e.serializer.addNodeFilter("span",function(e){F(e,function(t){var e;(e=t,A.from(e.attributes.map[Gi()]).bind(n.lookup)).each(function(e){!1===e.persisten
t&&t.unwrap()})})})})},na=0,ra=function(e,t){return rr.fromDom(e.dom().cloneNode(t))},oa=function(e){return ra(e,!1)},ia=function(e){return ra(e,!0)},aa=function(e,t){var n,r,o=Lr(e).dom(),i=rr.fromDom(o.createDocumentFragment()),a=(n=t,(r=(o||document).createElement("div")).innerHTML=n,Vr(rr.fromDom(r)));Ti(i,a),Ai(e),ki(e,i)},ua="\ufeff",sa=function(e){return e===ua},ca=ua,la=function(e){return e.replace(new RegExp(ua,"g"),"")},fa=_o.isElement,da=_o.isText,ma=function(e){return da(e)&&(e=e.parentNode),fa(e)&&e.hasAttribute("data-mce-caret")},ga=function(e){return da(e)&&sa(e.data)},pa=function(e){return ma(e)||ga(e)},ha=function(e){return e.firstChild!==e.lastChild||!_o.isBr(e.firstChild)},va=function(e){var t=e.container();return e&&_o.isText(t)&&t.data.charAt(e.offset())===ca},ba=function(e){var t=e.container();return e&&_o.isText(t)&&t.data.charAt(e.offset()-1)===ca
},ya=function(e,t,n){var r,o,i;return(r=t.ownerDocument.createElement(e)).setAttribute("data-mce-caret",n?"before":"after"),r.setAttribute("data-mce-bogus","all"),r.appendChild(((i=document.createElement("br")).setAttribute("data-mce-bogus","1"),i)),o=t.parentNode,n?o.insertBefore(r,t):t.nextSibling?o.insertBefore(r,t.nextSibling):o.appendChild(r),r},Ca=function(e){return da(e)&&e.data[0]===ca},xa=function(e){return da(e)&&e.data[e.data.length-1]===ca},wa=function(e){return e&&e.hasAttribute("data-mce-caret")?(t=e.getElementsByTagName("br"),n=t[t.length-1],_o.isBogus(n)&&n.parentNode.removeChild(n),e.removeAttribute("data-mce-caret"),e.removeAttribute("data-mce-bogus"),e.removeAttribute("style"),e.removeAttribute("_moz_abspos"),e):null;var t,n},Na=_o.isContentEditableTrue,Ea=_o.isContentEditableFalse,Sa=_o.isBr,ka
=_o.isText,Ta=_o.matchNodeNames("script style textarea"),Aa=_o.matchNodeNames("img input textarea hr iframe video audio object"),Ra=_o.matchNodeNames("table"),_a=pa,Da=function(e){return!_a(e)&&(ka(e)?!Ta(e.parentNode):Aa(e)||Sa(e)||Ra(e)||Ba(e))},Ba=function(e){return!1===(t=e,_o.isElement(t)&&"true"===t.getAttribute("unselectable"))&&Ea(e);var t},Oa=function(e,t){return Da(e)&&function(e,t){for(e=e.parentNode;e&&e!==t;e=e.parentNode){if(Ba(e))return!1;if(Na(e))return!0}return!0}(e,t)},Pa=Math.round,La=function(e){return e?{left:Pa(e.left),top:Pa(e.top),bottom:Pa(e.bottom),right:Pa(e.right),width:Pa(e.width),height:Pa(e.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0}},Ia=function(e,t){return e=La(e),t||(e.left=e.left+e.width),e.right=e.left,e.width=0,e},Ma=function(e,t,n){return 0<=e&&e<=Math.min(t.height,n.height)/2},Fa=function(e,t){return e.bottom-e.height/2<t.top
||!(e.top>t.bottom)&&Ma(t.top-e.bottom,e,t)},za=function(e,t){return e.top>t.bottom||!(e.bottom<t.top)&&Ma(t.bottom-e.top,e,t)},Ua=function(e){var t=e.startContainer,n=e.startOffset;return t.hasChildNodes()&&e.endOffset===n+1?t.childNodes[n]:null},Va=function(e,t){return 1===e.nodeType&&e.hasChildNodes()&&(t>=e.childNodes.length&&(t=e.childNodes.length-1),e=e.childNodes[t]),e},Ha=new RegExp("[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc\u0ac1-\u0ac5\u0ac7-\u0a
c8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1abe\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b8
1\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20dd-\u20e0\u20e1\u20e2-\u20e4\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\ua670-\ua672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]"),ja=function(e){return"string"==typeof e&&768<=e.charCodeAt(0)&&Ha.test(e)},qa=function(e,t){for(var n=[],r=0;r<e.length;r++){var o=e[r];if(!o.isSome())return A.none();n.push(o.getOrDie())}return A.some(t.apply(null,n))},$a=[].slice,Wa=function(){for(va
r e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=$a.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(!n[t](e))return!1;return!0}},Ka=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=$a.call(arguments);return function(e){for(var t=0;t<n.length;t++)if(n[t](e))return!0;return!1}},Xa=_o.isElement,Ya=Da,Ga=_o.matchStyleValues("display","block table"),Ja=_o.matchStyleValues("float","left right"),Qa=Wa(Xa,Ya,y(Ja)),Za=y(_o.matchStyleValues("white-space","pre pre-line pre-wrap")),eu=_o.isText,tu=_o.isBr,nu=gi.nodeIndex,ru=Va,ou=function(e){return"createRange"in e?e.createRange():gi.DOM.createRng()},iu=function(e){return e&&/[\r\n\t ]/.test(e)},au=function(e){return!!e.setStart&&!!e.setEnd},uu=function(e){var t,n=e.startContainer,r=e.startOffset;return!!(iu(e.toString())&&Za(n.parentNode)&&_o.isText(n)&&(t=n.data,iu(t[r-1
])||iu(t[r+1])))},su=function(e){return 0===e.left&&0===e.right&&0===e.top&&0===e.bottom},cu=function(e){var t,n,r,o,i,a,u,s;return t=0<(n=e.getClientRects()).length?La(n[0]):La(e.getBoundingClientRect()),!au(e)&&tu(e)&&su(t)?(i=(r=e).ownerDocument,a=ou(i),u=i.createTextNode("\xa0"),(s=r.parentNode).insertBefore(u,r),a.setStart(u,0),a.setEnd(u,1),o=La(a.getBoundingClientRect()),s.removeChild(u),o):su(t)&&au(e)?function(e){var t=e.startContainer,n=e.endContainer,r=e.startOffset,o=e.endOffset;if(t===n&&_o.isText(n)&&0===r&&1===o){var i=e.cloneRange();return i.setEndAfter(n),cu(i)}return null}(e):t},lu=function(e,t){var n=Ia(e,t);return n.width=1,n.right=n.left+1,n},fu=function(e){var t,n,r=[],o=function(e){var t,n;0!==e.height&&(0<r.length&&(t=e,n=r[r.length-1],t.left===n.left&&t.top===n.top&&t.bottom===n.bottom&&t.right===n.right)||r.push(e))},i=function(e,t
){var n=ou(e.ownerDocument);if(t<e.data.length){if(ja(e.data[t]))return r;if(ja(e.data[t-1])&&(n.setStart(e,t),n.setEnd(e,t+1),!uu(n)))return o(lu(cu(n),!1)),r}0<t&&(n.setStart(e,t-1),n.setEnd(e,t),uu(n)||o(lu(cu(n),!1))),t<e.data.length&&(n.setStart(e,t),n.setEnd(e,t+1),uu(n)||o(lu(cu(n),!0)))};if(eu(e.container()))return i(e.container(),e.offset()),r;if(Xa(e.container()))if(e.isAtEnd())n=ru(e.container(),e.offset()),eu(n)&&i(n,n.data.length),Qa(n)&&!tu(n)&&o(lu(cu(n),!1));else{if(n=ru(e.container(),e.offset()),eu(n)&&i(n,0),Qa(n)&&e.isAtEnd())return o(lu(cu(n),!1)),r;t=ru(e.container(),e.offset()-1),Qa(t)&&!tu(t)&&(Ga(t)||Ga(n)||!Qa(n))&&o(lu(cu(t),!1)),Qa(n)&&o(lu(cu(n),!0))}return r};function du(t,n,e){var r=function(){return e||(e=fu(du(t,n))),e};return{container:j(t),offset:j(n),toRange:function(){var e;return(e=ou(t.ownerDocument)).setStart(t,n),e.setEnd(t,n),e},getClientR
ects:r,isVisible:function(){return 0<r().length},isAtStart:function(){return eu(t),0===n},isAtEnd:function(){return eu(t)?n>=t.data.length:n>=t.childNodes.length},isEqual:function(e){return e&&t===e.container()&&n===e.offset()},getNode:function(e){return ru(t,e?n-1:n)}}}(ji=du||(du={})).fromRangeStart=function(e){return ji(e.startContainer,e.startOffset)},ji.fromRangeEnd=function(e){return ji(e.endContainer,e.endOffset)},ji.after=function(e){return ji(e.parentNode,nu(e)+1)},ji.before=function(e){return ji(e.parentNode,nu(e))},ji.isAbove=function(e,t){return qa([ee(t.getClientRects()),te(e.getClientRects())],Fa).getOr(!1)},ji.isBelow=function(e,t){return qa([te(t.getClientRects()),ee(e.getClientRects())],za).getOr(!1)},ji.isAtStart=function(e){return!!e&&e.isAtStart()},ji.isAtEnd=function(e){return!!e&&e.isAtEnd()},ji.isTextPosition=function(e){return!!e&&_o.isText(e.container())},ji.isElementPosition=function(e){return!1===ji.isTextPo
sition(e)};var mu,gu,pu,hu=du,vu=_o.isText,bu=_o.isBogus,yu=gi.nodeIndex,Cu=function(e){var t=e.parentNode;return bu(t)?Cu(t):t},xu=function(e){return e?qt.reduce(e.childNodes,function(e,t){return bu(t)&&"BR"!==t.nodeName?e=e.concat(xu(t)):e.push(t),e},[]):[]},wu=function(t){return function(e){return t===e}},Nu=function(e){var t,r,n,o;return(vu(e)?"text()":e.nodeName.toLowerCase())+"["+(r=xu(Cu(t=e)),n=qt.findIndex(r,wu(t),t),r=r.slice(0,n+1),o=qt.reduce(r,function(e,t,n){return vu(t)&&vu(r[n-1])&&e++,e},0),r=qt.filter(r,_o.matchNodeNames(t.nodeName)),(n=qt.findIndex(r,wu(t),t))-o)+"]"},Eu=function(e,t){var n,r,o,i,a,u=[];return n=t.container(),r=t.offset(),vu(n)?o=function(e,t){for(;(e=e.previousSibling)&&vu(e);)t+=e.data.length;return t}(n,r):(r>=(i=n.childNodes).length?(o="after",r=i.length-1):o="before",n=i[r]),u.push(Nu(n)),a=function(e,t,n){var r=[];for(t=t.parentNode;!(t===e||n&
&n(t));t=t.parentNode)r.push(t);return r}(e,n),a=qt.filter(a,y(_o.isBogus)),(u=u.concat(qt.map(a,function(e){return Nu(e)}))).reverse().join("/")+","+o},Su=function(e,t){var n,r,o;return t?(t=(n=t.split(","))[0].split("/"),o=1<n.length?n[1]:"before",(r=qt.reduce(t,function(e,t){return(t=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(t))?("text()"===t[1]&&(t[1]="#text"),n=e,r=t[1],o=parseInt(t[2],10),i=xu(n),i=qt.filter(i,function(e,t){return!vu(e)||!vu(i[t-1])}),(i=qt.filter(i,_o.matchNodeNames(r)))[o]):null;var n,r,o,i},e))?vu(r)?function(e,t){for(var n,r=e,o=0;vu(r);){if(n=r.data.length,o<=t&&t<=o+n){e=r,t-=o;break}if(!vu(r.nextSibling)){e=r,t=n;break}o+=n,r=r.nextSibling}return vu(e)&&t>e.data.length&&(t=e.data.length),hu(e,t)}(r,parseInt(o,10)):(o="after"===o?yu(r)+1:yu(r),hu(r.parentNode,o)):null):null},ku=_o.isContentEditableFalse,Tu=function(e,t,n,r,o){var i,a=r[o
?"startContainer":"endContainer"],u=r[o?"startOffset":"endOffset"],s=[],c=0,l=e.getRoot();for(_o.isText(a)?s.push(n?function(e,t,n){var r,o;for(o=e(t.data.slice(0,n)).length,r=t.previousSibling;r&&_o.isText(r);r=r.previousSibling)o+=e(r.data).length;return o}(t,a,u):u):(u>=(i=a.childNodes).length&&i.length&&(c=1,u=Math.max(0,i.length-1)),s.push(e.nodeIndex(i[u],n)+c));a&&a!==l;a=a.parentNode)s.push(e.nodeIndex(a,n));return s},Au=function(e){_o.isText(e)&&0===e.data.length&&e.parentNode.removeChild(e)},Ru=function(e,t,n){var r=0;return Yt.each(e.select(t),function(e){if("all"!==e.getAttribute("data-mce-bogus"))return e!==n&&void r++}),r},_u=function(e,t){var n,r,o,i=t?"start":"end";n=e[i+"Container"],r=e[i+"Offset"],_o.isElement(n)&&"TR"===n.nodeName&&(n=(o=n.childNodes)[Math.min(t?r:r-1,o.length-1)])&
amp;&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r))},Du=function(e){return _u(e,!0),_u(e,!1),e},Bu=function(e,t){var n;if(_o.isElement(e)&&(e=Va(e,t),ku(e)))return e;if(pa(e)){if(_o.isText(e)&&ma(e)&&(e=e.parentNode),n=e.previousSibling,ku(n))return n;if(n=e.nextSibling,ku(n))return n}},Ou=function(e,t,n){var r=n.getNode(),o=r?r.nodeName:null,i=n.getRng();if(ku(r)||"IMG"===o)return{name:o,index:Ru(n.dom,o,r)};var a,u,s,c,l,f,d,m=Bu((a=i).startContainer,a.startOffset)||Bu(a.endContainer,a.endOffset);return m?{name:o=m.tagName,index:Ru(n.dom,o,m)}:(u=e,c=t,l=i,f=(s=n).dom,(d={}).start=Tu(f,u,c,l,!0),s.isCollapsed()||(d.end=Tu(f,u,c,l,!1)),d)},Pu=function(e,t,n){var r={"data-mce-type":"bookmark",id:t,style:"overflow:hidden;line-height:0px"};return n?e.create("span",r,""):e.create("span",r)},Lu=function(e,t){var n=e.dom,r=e.getRng(),o=n
.uniqueId(),i=e.isCollapsed(),a=e.getNode(),u=a.nodeName;if("IMG"===u)return{name:u,index:Ru(n,u,a)};var s=Du(r.cloneRange());if(!i){s.collapse(!1);var c=Pu(n,o+"_end",t);s.insertNode(c),Au(c.nextSibling)}(r=Du(r)).collapse(!0);var l=Pu(n,o+"_start",t);return r.insertNode(l),Au(l.previousSibling),Au(l.nextSibling),e.moveToBookmark({id:o,keep:1}),{id:o}},Iu={getBookmark:function(e,t,n){return 2===t?Ou(la,n,e):3===t?(o=(r=e).getRng(),{start:Eu(r.dom.getRoot(),hu.fromRangeStart(o)),end:Eu(r.dom.getRoot(),hu.fromRangeEnd(o))}):t?{rng:e.getRng()}:Lu(e,!1);var r,o},getUndoBookmark:d(Ou,q,!0),getPersistentBookmark:Lu},Mu="_mce_caret",Fu=function(e){return _o.isElement(e)&&e.id===Mu},zu=function(e,t){for(;t&&t!==e;){if(t.id===Mu)return t;t=t.parentNode}return null},Uu=_o.isElement,Vu=_o.isText,Hu=function(e){var t=e.parentNode;t&&t.removeChild(e)},ju=function(e,t){0===t.length?Hu(e):e.nodeValue=t},qu=function(e){var t=la(e);ret
urn{count:e.length-t.length,text:t}},$u=function(e,t){return Xu(e),t},Wu=function(e,t){var n,r,o,i=t.container(),a=(n=ne(i.childNodes),r=e,o=I(n,r),-1===o?A.none():A.some(o)).map(function(e){return e<t.offset()?hu(i,t.offset()-1):t}).getOr(t);return Xu(e),a},Ku=function(e,t){return Vu(e)&&t.container()===e?(r=t,o=qu((n=e).data.substr(0,r.offset())),i=qu(n.data.substr(r.offset())),0<(a=o.text+i.text).length?(ju(n,a),hu(n,r.offset()-o.count)):r):$u(e,t);var n,r,o,i,a},Xu=function(e){if(Uu(e)&&pa(e)&&(ha(e)?e.removeAttribute("data-mce-caret"):Hu(e)),Vu(e)){var t=la(function(e){try{return e.nodeValue}catch(t){return""}}(e));ju(e,t)}},Yu={removeAndReposition:function(e,t){return hu.isTextPosition(t)?Ku(e,t):(n=e,(r=t).container()===n.parentNode?Wu(n,r):$u(n,r));var n,r},remove:Xu},Gu=tr.detect().browser,Ju=_o.isContentEditableFalse,Qu=function(e,t,n){var r,o,i,a,u,s=Ia(t.getBoundingClientRect(),n);return"BODY"===e.tagName?(r=e.o
wnerDocument.documentElement,o=e.scrollLeft||r.scrollLeft,i=e.scrollTop||r.scrollTop):(u=e.getBoundingClientRect(),o=e.scrollLeft-u.left,i=e.scrollTop-u.top),s.left+=o,s.right+=o,s.top+=i,s.bottom+=i,s.width=1,0<(a=t.offsetWidth-t.clientWidth)&&(n&&(a*=-1),s.left+=a,s.right+=a),s},Zu=function(a,u,e){var t,s,c=Bi(A.none()),l=function(){!function(e){var t,n,r,o,i;for(t=pn("*[contentEditable=false]",e),o=0;o<t.length;o++)r=(n=t[o]).previousSibling,xa(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(i.length-1,1)),r=n.nextSibling,Ca(r)&&(1===(i=r.data).length?r.parentNode.removeChild(r):r.deleteData(0,1))}(a),s&&(Yu.remove(s),s=null),c.get().each(function(e){pn(e.caret).remove(),c.set(A.none())}),clearInterval(t)},f=function(){t=ve.setInterval(function(){e()?pn("div.mce-visual-caret",a).toggleClass("mce-visual-caret-hidden"):pn("div.mce-visual-caret",a).addClass("mce-visual-care
t-hidden")},500)};return{show:function(t,e){var n,r,o;if(l(),o=e,_o.isElement(o)&&/^(TD|TH)$/i.test(o.tagName))return null;if(!u(e))return s=function(e,t){var n,r,o;if(r=e.ownerDocument.createTextNode(ca),o=e.parentNode,t){if(n=e.previousSibling,da(n)){if(pa(n))return n;if(xa(n))return n.splitText(n.data.length-1)}o.insertBefore(r,e)}else{if(n=e.nextSibling,da(n)){if(pa(n))return n;if(Ca(n))return n.splitText(1),n}e.nextSibling?o.insertBefore(r,e.nextSibling):o.appendChild(r)}return r}(e,t),r=e.ownerDocument.createRange(),Ju(s.nextSibling)?(r.setStart(s,0),r.setEnd(s,0)):(r.setStart(s,1),r.setEnd(s,1)),r;s=ya("p",e,t),n=Qu(a,e,t),pn(s).css("top",n.top);var i=pn('<div class="mce-visual-caret" data-mce-bogus="all"></div>').css(n).appendTo(a)[0];return c.set(A.some({caret:i,element:e,before:t})),c.get().each(function(e){t&&pn(e.caret).addClass("mce-visual-caret-before")}),f(),(r=e.ownerDocument.createRan
ge()).setStart(s,0),r.setEnd(s,0),r},hide:l,getCss:function(){return".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}"},reposition:function(){c.get().each(function(e){var t=Qu(a,e.element,e.before);pn(e.caret).css(t)})},destroy:function(){return ve.clearInterval(t)}}},es=function(){return Gu.isIE()||Gu.isEdge()||Gu.isFirefox()},ts=function(e){return Ju(e)||_o.isTable(e)&&es()},ns=(mu="\xa0",function(e){return mu===e}),rs=function(e){return/^[\r\n\t ]$/.test(e)},os=function(e){return!rs(e)&&!ns(e)},is=_o.isContentEditableFalse,as=_o.matchStyleValues("display","block table table-cell table-caption list-item"),us=pa,ss=ma,cs=_o.isElement,ls=Da,fs=function(e){return 0<e},ds=function(e){return e<0},ms=function(e,t){for(var n;n=e(t);)if(!ss(n))return
n;return null},gs=function(e,t,n,r,o){var i=new ro(e,r);if(ds(t)){if((is(e)||ss(e))&&n(e=ms(i.prev,!0)))return e;for(;e=ms(i.prev,o);)if(n(e))return e}if(fs(t)){if((is(e)||ss(e))&&n(e=ms(i.next,!0)))return e;for(;e=ms(i.next,o);)if(n(e))return e}return null},ps=function(e,t){for(;e&&e!==t;){if(as(e))return e;e=e.parentNode}return null},hs=function(e,t,n){return ps(e.container(),n)===ps(t.container(),n)},vs=function(e,t){var n,r;return t?(n=t.container(),r=t.offset(),cs(n)?n.childNodes[r+e]:null):null},bs=function(e,t){var n=t.ownerDocument.createRange();return e?(n.setStartBefore(t),n.setEndBefore(t)):(n.setStartAfter(t),n.setEndAfter(t)),n},ys=function(e,t,n){var r,o,i,a;for(o=e?"previousSibling":"nextSibling";n&&n!==t;){if(r=n[o],us(r)&&(r=r[o]),is(r)){if(a=n,ps(r,i=t)===ps(a,i))return r;break}if(ls(r))break;n=n.parentNode}return null},Cs=d(bs,!0),xs=d(bs,!1),ws=function(e,t,n){var r,o,i,a,u=d(ys,!0,t),s=d(ys,!1,t);if(o=n
.startContainer,i=n.startOffset,ma(o)){if(cs(o)||(o=o.parentNode),"before"===(a=o.getAttribute("data-mce-caret"))&&(r=o.nextSibling,ts(r)))return Cs(r);if("after"===a&&(r=o.previousSibling,ts(r)))return xs(r)}if(!n.collapsed)return n;if(_o.isText(o)){if(us(o)){if(1===e){if(r=s(o))return Cs(r);if(r=u(o))return xs(r)}if(-1===e){if(r=u(o))return xs(r);if(r=s(o))return Cs(r)}return n}if(xa(o)&&i>=o.data.length-1)return 1===e&&(r=s(o))?Cs(r):n;if(Ca(o)&&i<=1)return-1===e&&(r=u(o))?xs(r):n;if(i===o.data.length)return(r=s(o))?Cs(r):n;if(0===i)return(r=u(o))?xs(r):n}return n},Ns=function(e,t){var n=vs(e,t);return is(n)&&!_o.isBogusAll(n)},Es=function(e,t){return _o.isTable(vs(e,t))},Ss=function(e,t){return A.from(vs(e?0:-1,t)).filter(is)},ks=function(e,t,n){var r=ws(e,t,n);return-1===e?du.fromRangeStart(r):du.fromRangeEnd(r)},Ts=d(Ns,0),As=d(Ns,-1),Rs=d(Es,0),_s=d(Es,-1),Ds=function(n,r,o){return A.f
rom(o.container()).filter(_o.isText).exists(function(e){var t=n?0:-1;return r(e.data.charAt(o.offset()+t))})},Bs=d(Ds,!0,rs),Os=d(Ds,!1,rs),Ps=function(e){return A.from(e.getNode()).map(rr.fromDom)};(pu=gu||(gu={}))[pu.Backwards=-1]="Backwards",pu[pu.Forwards=1]="Forwards";var Ls,Is,Ms,Fs,zs,Us=_o.isContentEditableFalse,Vs=_o.isText,Hs=_o.isElement,js=_o.isBr,qs=Da,$s=function(e){return Aa(e)||!!Ba(t=e)&&!0!==U(ne(t.getElementsByTagName("*")),function(e,t){return e||Na(t)},!1);var t},Ws=Oa,Ks=function(e,t){return e.hasChildNodes()&&t<e.childNodes.length?e.childNodes[t]:null},Xs=function(e,t){if(fs(e)){if(qs(t.previousSibling)&&!Vs(t.previousSibling))return hu.before(t);if(Vs(t))return hu(t,0)}if(ds(e)){if(qs(t.nextSibling)&&!Vs(t.nextSibling))return hu.after(t);if(Vs(t))return hu(t,t.data.length)}return ds(e)?js(t)?hu.before(t):hu.after(t):hu.before(t)},Ys=function(e,t,n){var r,o,i,a,u;if(!Hs(n)||!t)return null;if(t.is
Equal(hu.after(n))&&n.lastChild){if(u=hu.after(n.lastChild),ds(e)&&qs(n.lastChild)&&Hs(n.lastChild))return js(n.lastChild)?hu.before(n.lastChild):u}else u=t;var s,c,l,f=u.container(),d=u.offset();if(Vs(f)){if(ds(e)&&0<d)return hu(f,--d);if(fs(e)&&d<f.length)return hu(f,++d);r=f}else{if(ds(e)&&0<d&&(o=Ks(f,d-1),qs(o)))return!$s(o)&&(i=gs(o,e,Ws,o))?Vs(i)?hu(i,i.data.length):hu.after(i):Vs(o)?hu(o,o.data.length):hu.before(o);if(fs(e)&&d<f.childNodes.length&&(o=Ks(f,d),qs(o)))return js(o)?(s=n,(l=(c=o).nextSibling)&&qs(l)?Vs(l)?hu(l,0):hu.before(l):Ys(gu.Forwards,hu.after(c),s)):!$s(o)&&(i=gs(o,e,Ws,o))?Vs(i)?hu(i,0):hu.before(i):Vs(o)?hu(o,0):hu.after(o);r=o||u.getNode()}return(fs(e)&&u.isAtEnd()||ds(e)&&u.isAtStart())&&(r=gs(r,e,j(!0),n,!0),Ws(r,n))?Xs(e,r):(o=gs(r,e,Ws,n),!(a=qt.last(z(function(e,t){for(var n=[];e&&e!==t;)n.push(e),e=e.parentNod
e;return n}(f,n),Us)))||o&&a.contains(o)?o?Xs(e,o):null:u=fs(e)?hu.after(a):hu.before(a))},Gs=function(t){return{next:function(e){return Ys(gu.Forwards,e,t)},prev:function(e){return Ys(gu.Backwards,e,t)}}},Js=function(e){return hu.isTextPosition(e)?0===e.offset():Da(e.getNode())},Qs=function(e){if(hu.isTextPosition(e)){var t=e.container();return e.offset()===t.data.length}return Da(e.getNode(!0))},Zs=function(e,t){return!hu.isTextPosition(e)&&!hu.isTextPosition(t)&&e.getNode()===t.getNode(!0)},ec=function(e,t,n){return e?!Zs(t,n)&&(r=t,!(!hu.isTextPosition(r)&&_o.isBr(r.getNode())))&&Qs(t)&&Js(n):!Zs(n,t)&&Js(t)&&Qs(n);var r},tc=function(e,t,n){var r=Gs(t);return A.from(e?r.next(n):r.prev(n))},nc=function(e,t){var n,r,o,i,a,u=e?t.firstChild:t.lastChild;return _o.isText(u)?A.some(hu(u,e?0:u.data.length)):u?Da(u)?A.some(e?hu.before(u):(a=u,_o.isBr(a)?hu.before(a):hu.after(a))):(r=t,o=u,i=(n=e)?hu.before(o):hu.afte
r(o),tc(n,r,i)):A.none()},rc=d(tc,!0),oc=d(tc,!1),ic={fromPosition:tc,nextPosition:rc,prevPosition:oc,navigate:function(t,n,r){return tc(t,n,r).bind(function(e){return hs(r,e,n)&&ec(t,r,e)?tc(t,n,e):A.some(e)})},positionIn:nc,firstPositionIn:d(nc,!0),lastPositionIn:d(nc,!1)},ac=function(e,t){return!e.isBlock(t)||t.innerHTML||de.ie||(t.innerHTML='<br data-mce-bogus="1" />'),t},uc=function(e,t){return ic.lastPositionIn(e).fold(function(){return!1},function(e){return t.setStart(e.container(),e.offset()),t.setEnd(e.container(),e.offset()),!0})},sc=function(e,t,n){return!(!1!==t.hasChildNodes()||!zu(e,t)||(o=n,i=(r=t).ownerDocument.createTextNode(ca),r.appendChild(i),o.setStart(i,0),o.setEnd(i,0),0));var r,o,i},cc=function(e,t,n,r){var o,i,a,u,s=n[t?"start":"end"],c=e.getRoot();if(s){for(a=s[0],i=c,o=s.length-1;1<=o;o--){if(u=i.childNodes,sc(c,i,r))return!0;if(s[o]>u.length-1)return!!sc(c,i,r)||uc(i,r);i=u[s[o]]}3===i.nodeType&&(a
=Math.min(s[0],i.nodeValue.length)),1===i.nodeType&&(a=Math.min(s[0],i.childNodes.length)),t?r.setStart(i,a):r.setEnd(i,a)}return!0},lc=function(e){return _o.isText(e)&&0<e.data.length},fc=function(e,t,n){var r,o,i,a,u,s,c=e.get(n.id+"_"+t),l=n.keep;if(c){if(r=c.parentNode,"start"===t?l?c.hasChildNodes()?(r=c.firstChild,o=1):lc(c.nextSibling)?(r=c.nextSibling,o=0):lc(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=e.nodeIndex(c)+1):o=e.nodeIndex(c):l?c.hasChildNodes()?(r=c.firstChild,o=1):lc(c.previousSibling)?(r=c.previousSibling,o=c.previousSibling.data.length):(r=c.parentNode,o=e.nodeIndex(c)):o=e.nodeIndex(c),u=r,s=o,!l){for(a=c.previousSibling,i=c.nextSibling,Yt.each(Yt.grep(c.childNodes),function(e){_o.isText(e)&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});c=e.get(n.id+"_"+t);)e.remove(c,!0);a&&i&&a.nodeType===i.nodeType&&_o.isText(a)&
&!de.opera&&(o=a.nodeValue.length,a.appendData(i.nodeValue),e.remove(i),u=a,s=o)}return A.some(hu(u,s))}return A.none()},dc=function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,g,p,h,v,b=e.dom;if(t){if(v=t,Yt.isArray(v.start))return p=t,h=(g=b).createRng(),cc(g,!0,p,h)&&cc(g,!1,p,h)?A.some(h):A.none();if("string"==typeof t.start)return A.some((f=t,d=(l=b).createRng(),m=Su(l.getRoot(),f.start),d.setStart(m.container(),m.offset()),m=Su(l.getRoot(),f.end),d.setEnd(m.container(),m.offset()),d));if(t.hasOwnProperty("id"))return s=fc(o=b,"start",i=t),c=fc(o,"end",i),qa([s,(a=c,u=s,a.isSome()?a:u)],function(e,t){var n=o.createRng();return n.setStart(ac(o,e.container()),e.offset()),n.setEnd(ac(o,t.container()),t.offset()),n});if(t.hasOwnProperty("name"))return n=b,r=t,A.from(n.select(r.name)[r.index]).map(function(e){var t=n.createRng();return t.selectNode(e),t});if(t.hasOwnProperty("rng"))return A.some(t.rng)}return A.non
e()},mc=function(e,t,n){return Iu.getBookmark(e,t,n)},gc=function(t,e){dc(t,e).each(function(e){t.setRng(e)})},pc=function(e){return _o.isElement(e)&&"SPAN"===e.tagName&&"bookmark"===e.getAttribute("data-mce-type")},hc=function(e){return e&&/^(IMG)$/.test(e.nodeName)},vc=function(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)},bc=function(e,t,n){return"color"!==n&&"backgroundColor"!==n||(t=e.toHex(t)),"fontWeight"===n&&700===t&&(t="bold"),"fontFamily"===n&&(t=t.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+t},yc={isInlineBlock:hc,moveStart:function(e,t,n){var r,o,i,a=n.startOffset,u=n.startContainer;if((n.startContainer!==n.endContainer||!hc(n.startContainer.childNodes[n.startOffset]))&&1===u.nodeType)for(a<(i=u.childNodes).length?r=new ro(u=i[a],e.getParent(u,e.isBlock
)):(r=new ro(u=i[i.length-1],e.getParent(u,e.isBlock))).next(!0),o=r.current();o;o=r.next())if(3===o.nodeType&&!vc(o))return n.setStart(o,0),void t.setRng(n)},getNonWhiteSpaceSibling:function(e,t,n){if(e)for(t=t?"nextSibling":"previousSibling",e=n?e:e[t];e;e=e[t])if(1===e.nodeType||!vc(e))return e},isTextBlock:function(e,t){return t.nodeType&&(t=t.nodeName),!!e.schema.getTextBlockElements()[t.toLowerCase()]},isValid:function(e,t,n){return e.schema.isValidChild(t,n)},isWhiteSpaceNode:vc,replaceVars:function(e,n){return"string"!=typeof e?e=e(n):n&&(e=e.replace(/%(\w+)/g,function(e,t){return n[t]||e})),e},isEq:function(e,t){return t=t||"",e=""+((e=e||"").nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()===t.toLowerCase()},normalizeStyleValue:bc,getStyle:function(e,t,n){return bc(e,e.getStyle(t,n),n)},getTextDecoration:function(t,e){var n;return t.getParent(e,function(e){return(n=t.getStyle(e,&
quot;text-decoration"))&&"none"!==n}),n},getParents:function(e,t,n){return e.getParents(t,n,e.getRoot())}},Cc=pc,xc=yc.getParents,wc=yc.isWhiteSpaceNode,Nc=yc.isTextBlock,Ec=function(e,t){for(void 0===t&&(t=3===e.nodeType?e.length:e.childNodes.length);e&&e.hasChildNodes();)(e=e.childNodes[t])&&(t=3===e.nodeType?e.length:e.childNodes.length);return{node:e,offset:t}},Sc=function(e,t){for(var n=t;n;){if(1===n.nodeType&&e.getContentEditable(n))return"false"===e.getContentEditable(n)?n:t;n=n.parentNode}return t},kc=function(e,t,n,r){var o,i,a=n.nodeValue;return void 0===r&&(r=e?a.length:0),e?(o=a.lastIndexOf(" ",r),-1!==(o=(i=a.lastIndexOf("\xa0",r))<o?o:i)&&!t&&(o<r||!e)&&o<=a.length&&o++):(o=a.indexOf(" ",r),i=a.indexOf("\xa0",r),o=-1!==o&&(-1===i||o<i)?o:i),o},Tc=function(e,t,n,r,o,i){var a,u,s,c;if(3===n.nodeType){if(-1!=
=(s=kc(o,i,n,r)))return{container:n,offset:s};c=n}for(a=new ro(n,e.getParent(n,e.isBlock)||t);u=a[o?"prev":"next"]();)if(3!==u.nodeType||Cc(u.parentNode)){if(e.isBlock(u)||yc.isEq(u,"BR"))break}else if(-1!==(s=kc(o,i,c=u)))return{container:u,offset:s};if(c)return{container:c,offset:r=o?0:c.length}},Ac=function(e,t,n,r,o){var i,a,u,s;for(3===r.nodeType&&0===r.nodeValue.length&&r[o]&&(r=r[o]),i=xc(e,r),a=0;a<i.length;a++)for(u=0;u<t.length;u++)if(!("collapsed"in(s=t[u])&&s.collapsed!==n.collapsed)&&e.is(i[a],s.selector))return i[a];return r},Rc=function(t,e,n,r){var o,i=t.dom,a=i.getRoot();if(e[0].wrapper||(o=i.getParent(n,e[0].block,a)),!o){var u=i.getParent(n,"LI,TD,TH");o=i.getParent(3===n.nodeType?n.parentNode:n,function(e){return e!==a&&Nc(t,e)},u)}if(o&&e[0].wrapper&&(o=xc(i,o,"ul,ol").reverse()[0]||o),!o)for(o=n;o[r]&&!i.isBlock(o[r])&&am
p;(o=o[r],!yc.isEq(o,"br")););return o||n},_c=function(e,t,n,r,o,i,a){var u,s,c,l,f,d;if(u=s=a?n:o,l=a?"previousSibling":"nextSibling",f=e.getRoot(),3===u.nodeType&&!wc(u)&&(a?0<r:i<u.nodeValue.length))return u;for(;;){if(!t[0].block_expand&&e.isBlock(s))return s;for(c=s[l];c;c=c[l])if(!Cc(c)&&!wc(c)&&("BR"!==(d=c).nodeName||!d.getAttribute("data-mce-bogus")||d.nextSibling))return s;if(s===f||s.parentNode===f){u=s;break}s=s.parentNode}return u},Dc=function(e,t,n,r){var o,i=t.startContainer,a=t.startOffset,u=t.endContainer,s=t.endOffset,c=e.dom;return 1===i.nodeType&&i.hasChildNodes()&&3===(i=Va(i,a)).nodeType&&(a=0),1===u.nodeType&&u.hasChildNodes()&&3===(u=Va(u,t.collapsed?s:s-1)).nodeType&&(s=u.nodeValue.length),i=Sc(c,i),u=Sc(c,u),(Cc(i.parentNode)||Cc(i))&&(i=Cc(i)?i:i.parentNode,3===(i=t.collapsed?i.previousSibling||i:i.nextSibl
ing||i).nodeType&&(a=t.collapsed?i.length:0)),(Cc(u.parentNode)||Cc(u))&&(u=Cc(u)?u:u.parentNode,3===(u=t.collapsed?u.nextSibling||u:u.previousSibling||u).nodeType&&(s=t.collapsed?0:u.length)),t.collapsed&&((o=Tc(c,e.getBody(),i,a,!0,r))&&(i=o.container,a=o.offset),(o=Tc(c,e.getBody(),u,s,!1,r))&&(u=o.container,s=o.offset)),n[0].inline&&(u=r?u:function(e,t){var n=Ec(e,t);if(n.node){for(;n.node&&0===n.offset&&n.node.previousSibling;)n=Ec(n.node.previousSibling);n.node&&0<n.offset&&3===n.node.nodeType&&" "===n.node.nodeValue.charAt(n.offset-1)&&1<n.offset&&(e=n.node).splitText(n.offset-1)}return e}(u,s)),(n[0].inline||n[0].block_expand)&&(n[0].inline&&3===i.nodeType&&0!==a||(i=_c(c,n,i,a,u,s,!0)),n[0].inline&&3===u.nodeType&&s!==u.nodeValue.length||(u=_c(c,n,i,a,u,s,!1))),n[0].selector&&!1!==n[0].expand&&
;!n[0].inline&&(i=Ac(c,n,t,i,"previousSibling"),u=Ac(c,n,t,u,"nextSibling")),(n[0].block||n[0].selector)&&(i=Rc(e,n,i,"previousSibling"),u=Rc(e,n,u,"nextSibling"),n[0].block&&(c.isBlock(i)||(i=_c(c,n,i,a,u,s,!0)),c.isBlock(u)||(u=_c(c,n,i,a,u,s,!1)))),1===i.nodeType&&(a=c.nodeIndex(i),i=i.parentNode),1===u.nodeType&&(s=c.nodeIndex(u)+1,u=u.parentNode),{startContainer:i,startOffset:a,endContainer:u,endOffset:s}},Bc=Yt.each,Oc=function(e,t,o){var n,r,i,a,u,s,c,l=t.startContainer,f=t.startOffset,d=t.endContainer,m=t.endOffset;if(0<(c=e.select("td[data-mce-selected],th[data-mce-selected]")).length)Bc(c,function(e){o([e])});else{var g,p,h,v=function(e){var t;return 3===(t=e[0]).nodeType&&t===l&&f>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===m&&0<e.length&&t===d&&3===t.nodeType&&e.splice(e.length-1,1),e},b=function(e,t,n){for(
var r=[];e&&e!==n;e=e[t])r.push(e);return r},y=function(e,t){do{if(e.parentNode===t)return e;e=e.parentNode}while(e)},C=function(e,t,n){var r=n?"nextSibling":"previousSibling";for(u=(a=e).parentNode;a&&a!==t;a=u)u=a.parentNode,(s=b(a===e?a:a[r],r)).length&&(n||s.reverse(),o(v(s)))};if(1===l.nodeType&&l.hasChildNodes()&&(l=l.childNodes[f]),1===d.nodeType&&d.hasChildNodes()&&(p=m,h=(g=d).childNodes,--p>h.length-1?p=h.length-1:p<0&&(p=0),d=h[p]||g),l===d)return o(v([l]));for(n=e.findCommonAncestor(l,d),a=l;a;a=a.parentNode){if(a===d)return C(l,n,!0);if(a===n)break}for(a=d;a;a=a.parentNode){if(a===l)return C(d,n);if(a===n)break}r=y(l,n)||l,i=y(d,n)||d,C(l,r,!0),(s=b(r===l?r:r.nextSibling,"nextSibling",i===d?i.nextSibling:i)).length&&o(v(s)),C(d,i)}},Pc=(Ls=lr,Is="text",Ms=function(e){return Ls(e)?A.from(e.dom().nodeValue):A.none()},Fs=tr.detect().browser,{get:function(e)
{if(!Ls(e))throw new Error("Can only get "+Is+" value of a "+Is+" node");return zs(e).getOr("")},getOption:zs=Fs.isIE()&&10===Fs.version.major?function(e){try{return Ms(e)}catch(LN){return A.none()}}:Ms,set:function(e,t){if(!Ls(e))throw new Error("Can only set raw "+Is+" value of a "+Is+" node");e.dom().nodeValue=t}}),Lc=function(e){return Pc.get(e)},Ic=function(r,o,i,a){return Ir(o).fold(function(){return"skipping"},function(e){return"br"===a||lr(n=o)&&"\ufeff"===Lc(n)?"valid":cr(t=o)&&zi(t,Yi())?"existing":Fu(o)?"caret":yc.isValid(r,i,a)&&yc.isValid(r,ur(e),i)?"valid":"invalid-child";var t,n})},Mc=function(e,t,n,r){var o,i,a=t.uid,u=void 0===a?(o="mce-annotation",i=(new Date).getTime(),o+"_"+Math.floor(1e9*Math.random())+ ++na+String(i)):a,s=function(e,t){var n={};for(var r in e)Obj
ect.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n}(t,["uid"]),c=rr.fromTag("span",e);Mi(c,Yi()),hr(c,""+Ji(),u),hr(c,""+Gi(),n);var l,f=r(u,s),d=f.attributes,m=void 0===d?{}:d,g=f.classes,p=void 0===g?[]:g;return vr(c,m),l=c,F(p,function(e){Mi(l,e)}),c},Fc=function(i,e,t,n,r){var a=[],u=Mc(i.getDoc(),r,t,n),s=Bi(A.none()),c=function(){s.set(A.none())},l=function(e){F(e,o)},o=function(e){var t,n;switch(Ic(i,e,"span",ur(e))){case"invalid-child":c();var r=Vr(e);l(r),c();break;case"valid":var o=s.get().getOrThunk(function(){var e=oa(u);return a.push(e),s.set(A.some(e)),e});Ni(t=e,n=o),ki(n,t)}};return Oc(i.dom,e,function(e){var t;c(),t=$(e,rr.fromDom),l(t)}),a},zc=function(s,c,l,f){s.u
ndoManager.transact(function(){var e,t,n,r,o=s.selection.getRng();if(o.collapsed&&(r=Dc(e=s,t=o,[{inline:!0}],3===(n=t).startContainer.nodeType&&n.startContainer.nodeValue.length>=n.startOffset&&"\xa0"===n.startContainer.nodeValue[n.startOffset]),t.setStart(r.startContainer,r.startOffset),t.setEnd(r.endContainer,r.endOffset),e.selection.setRng(t)),s.selection.getRng().collapsed){var i=Mc(s.getDoc(),f,c,l.decorate);aa(i,"\xa0"),s.selection.getRng().insertNode(i.dom()),s.selection.select(i.dom())}else{var a=Iu.getPersistentBookmark(s.selection,!1),u=s.selection.getRng();Fc(s,u,c,l.decorate,f),s.selection.moveToBookmark(a)}})};function Uc(s){var n,r=(n={},{register:function(e,t){n[e]={name:e,settings:t}},lookup:function(e){return n.hasOwnProperty(e)?A.from(n[e]).map(function(e){return e.settings}):A.none()}});ta(s,r);var o=ea(s);return{register:function(e,t){r.register(e,t)},annotate:function(t,n){r.lookup(t).each(function(e){zc(s,t,e,n)})
},annotationChanged:function(e,t){o.addListener(e,t)},remove:function(e){Qi(s,A.some(e)).each(function(e){var t=e.elements;F(t,_i)})},getAll:function(e){var t,n,r,o,i,a,u=(t=s,n=e,r=rr.fromDom(t.getBody()),o=Vi(r,"["+Gi()+'="'+n+'"]'),i={},F(o,function(e){var t=br(e,Ji()),n=i.hasOwnProperty(t)?i[t]:[];i[t]=n.concat([e])}),i);return a=function(e){return $(e,function(e){return e.dom()})},gr(u,function(e,t,n){return{k:t,v:a(e,t,n)}})}}}var Vc=function(e){return Yt.grep(e.childNodes,function(e){return"LI"===e.nodeName})},Hc=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&("\xa0"===(t=e.firstChild).data||_o.isBr(t));var t},jc=function(e){return 0<e.length&&(!(t=e[e.length-1]).firstChild||Hc(t))?e.slice(0,-1):e;var t},qc=function(e,t){var n=e.getParent(t,e.isBlock);return n&&"LI"===n.nodeName?n:null},$c=function(e,t){var n=hu.after(e),r=Gs(t).prev(n);return r?r.toRange():null},Wc=f
unction(t,e,n){var r,o,i,a,u=t.parentNode;return Yt.each(e,function(e){u.insertBefore(e,t)}),r=t,o=n,i=hu.before(r),(a=Gs(o).next(i))?a.toRange():null},Kc=function(e,t){var n,r,o,i,a,u,s=t.firstChild,c=t.lastChild;return s&&"meta"===s.name&&(s=s.next),c&&"mce_marker"===c.attr("id")&&(c=c.prev),r=c,u=(n=e).getNonEmptyElements(),r&&(r.isEmpty(u)||(o=r,n.getBlockElements()[o.name]&&(a=o).firstChild&&a.firstChild===a.lastChild&&("br"===(i=o.firstChild).name||"\xa0"===i.value)))&&(c=c.prev),!(!s||s!==c||"ul"!==s.name&&"ol"!==s.name)},Xc=function(e,o,i,t){var n,r,a,u,s,c,l,f,d,m,g,p,h,v,b,y,C,x,w,N=(n=o,r=t,c=e.serialize(r),l=n.createFragment(c),u=(a=l).firstChild,s=a.lastChild,u&&"META"===u.nodeName&&u.parentNode.removeChild(u),s&&"mce_marker"===s.id&&s.parentNode.removeChild(s),a),E=qc(o,
i.startContainer),S=jc(Vc(N.firstChild)),k=o.getRoot(),T=function(e){var t=hu.fromRangeStart(i),n=Gs(o.getRoot()),r=1===e?n.prev(t):n.next(t);return!r||qc(o,r.getNode())!==E};return T(1)?Wc(E,S,k):T(2)?(f=E,d=S,m=k,o.insertAfter(d.reverse(),f),$c(d[0],m)):(p=S,h=k,v=g=E,y=(b=i).cloneRange(),C=b.cloneRange(),y.setStartBefore(v),C.setEndAfter(v),x=[y.cloneContents(),C.cloneContents()],(w=g.parentNode).insertBefore(x[0],g),Yt.each(p,function(e){w.insertBefore(e,g)}),w.insertBefore(x[1],g),w.removeChild(g),$c(p[p.length-1],h))},Yc=function(e,t){return!!qc(e,t)},Gc=Yt.each,Jc=function(o){this.compare=function(e,t){if(e.nodeName!==t.nodeName)return!1;var n=function(n){var r={};return Gc(o.getAttribs(n),function(e){var t=e.nodeName.toLowerCase();0!==t.indexOf("_")&&"style"!==t&&0!==t.indexOf("data-")&&(r[t]=o.getAttrib(n,t))}),r},r=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!
1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!(!r(n(e),n(t))||!r(o.parseStyle(o.getAttrib(e,"style")),o.parseStyle(o.getAttrib(t,"style")))||pc(e)||pc(t))}},Qc=function(e){var t=Vi(e,"br"),n=z(function(e){for(var t=[],n=e.dom();n;)t.push(rr.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),fo);t.length===n.length&&F(n,Ri)},Zc=function(e){Ai(e),ki(e,rr.fromHtml('<br data-mce-bogus="1">'))},el=function(n){qr(n).each(function(t){Mr(t).each(function(e){co(n)&&fo(t)&&co(e)&&Ri(t)})})},tl=Yt.makeMap;function nl(e){var u,s,c,l,f,d=[];return u=(e=e||{}).indent,s=tl(e.indent_before||""),c=tl(e.indent_after||""),l=qo.getEncodeFunc(e.entity_encoding||"raw",e.entities),f="html"===e.element_format,{start:function(e,t,n){var r,o,i,a;if(u&&s[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.pus
h("\n"),d.push("<",e),t)for(r=0,o=t.length;r<o;r++)i=t[r],d.push(" ",i.name,'="',l(i.value,!0),'"');d[d.length]=!n||f?">":" />",n&&u&&c[e]&&0<d.length&&0<(a=d[d.length-1]).length&&"\n"!==a&&d.push("\n")},end:function(e){var t;d.push("</",e,">"),u&&c[e]&&0<d.length&&0<(t=d[d.length-1]).length&&"\n"!==t&&d.push("\n")},text:function(e,t){0<e.length&&(d[d.length]=t?e:l(e))},cdata:function(e){d.push("<![CDATA[",e,"]]>")},comment:function(e){d.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?d.push("<?",e," ",l(t),"?>"):d.push("<?",e,"?>"),u&&d.push("\n")},doctype:function(e){d.push("<!DOCTYPE",e,">&qu
ot;,u?"\n":"")},reset:function(){d.length=0},getContent:function(){return d.join("").replace(/\n$/,"")}}}function rl(t,g){void 0===g&&(g=ti());var p=nl(t);return(t=t||{}).validate=!("validate"in t)||t.validate,{serialize:function(e){var f,d;d=t.validate,f={3:function(e){p.text(e.value,e.raw)},8:function(e){p.comment(e.value)},7:function(e){p.pi(e.name,e.value)},10:function(e){p.doctype(e.value)},4:function(e){p.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}},p.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=f[e.type];if(l)l(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,d&&r&&1<r.length&&((a=[]).map={},c=g.getElementRule(e.name))){for(u=0,s=c.attributesOrder.length;u<s;u++)(o=c.attributesOrder[u])in r.map&&(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));for(u=0,s=r.length;u<s;u++)(o=r[u].name)in a.map||(i=r.map[o],a.map[o]=i,a.push({name:o,value:i}));r=a}
if(p.start(e.name,r,n),!n){if(e=e.firstChild)for(;m(e),e=e.next;);p.end(t)}}};return 1!==e.type||t.inner?f[11](e):m(e),p.getContent()}}}var ol=function(a){var u=hu.fromRangeStart(a),s=hu.fromRangeEnd(a),c=a.commonAncestorContainer;return ic.fromPosition(!1,c,s).map(function(e){return!hs(u,s,c)&&hs(u,e,c)?(t=u.container(),n=u.offset(),r=e.container(),o=e.offset(),(i=document.createRange()).setStart(t,n),i.setEnd(r,o),i):a;var t,n,r,o,i}).getOr(a)},il=function(e){return e.collapsed?e:ol(e)},al=_o.matchNodeNames("td th"),ul=function(e,t){var n,r,o=e.selection.getRng(),i=o.startContainer,a=o.startOffset;o.collapsed&&(n=i,r=a,_o.isText(n)&&"\xa0"===n.nodeValue[r-1])&&_o.isText(i)&&(i.insertData(a-1," "),i.deleteData(a,1),o.setStart(i,a),o.setEnd(i,a),e.selection.setRng(o)),e.selection.setContent(t)},sl=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m,g=e.selection,p=e.dom;if(/^ | $/.test(t)&&(t=function(e,t){var n,r;n
=e.startContainer,r=e.startOffset;var o=function(e){return n[e]&&3===n[e].nodeType};return 3===n.nodeType&&(0<r?t=t.replace(/^ /," "):o("previousSibling")||(t=t.replace(/^ /," ")),r<n.length?t=t.replace(/ (<br>|)$/," "):o("nextSibling")||(t=t.replace(/( | )(<br>|)$/," "))),t}(g.getRng(),t)),r=e.parser,m=n.merge,o=rl({validate:e.settings.validate},e.schema),d='<span id="mce_marker" data-mce-type="bookmark">​</span>',s={content:t,format:"html",selection:!0,paste:n.paste},(s=e.fire("BeforeSetContent",s)).isDefaultPrevented())e.fire("SetContent",{content:s.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=s.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,d);var h,v,b,y,C,x,w=(l=g.getRng()).st
artContainer||(l.parentElement?l.parentElement():null),N=e.getBody();w===N&&g.isCollapsed()&&p.isBlock(N.firstChild)&&(h=e,(v=N.firstChild)&&!h.schema.getShortEndedElements()[v.nodeName])&&p.isEmpty(N.firstChild)&&((l=p.createRng()).setStart(N.firstChild,0),l.setEnd(N.firstChild,0),g.setRng(l)),g.isCollapsed()||(e.selection.setRng(il(e.selection.getRng())),e.getDoc().execCommand("Delete",!1,null),b=e.selection.getRng(),y=t,C=b.startContainer,x=b.startOffset,3===C.nodeType&&b.collapsed&&("\xa0"===C.data[x]?(C.deleteData(x,1),/[\u00a0| ]$/.test(y)||(y+=" ")):"\xa0"===C.data[x-1]&&(C.deleteData(x-1,1),/[\u00a0| ]$/.test(y)||(y=" "+y))),t=y);var E,S,k,T={context:(i=g.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0};if(u=r.parse(t,T),!0===n.paste&&Kc(e.schema,u)&&Yc(p,i))return l=Xc(o,p,e.selection.getRng(),u),e.selection.setRng(l),void e.fire(
"SetContent",s);if(function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(u),"mce_marker"===(f=u.lastChild).attr("id"))for(f=(c=f).prev;f;f=f.walk(!0))if(3===f.type||!p.isBlock(f.name)){e.schema.isValidChild(f.parent.name,"span")&&f.parent.insert(c,f,"br"===f.name);break}if(e._selectionOverrides.showBlockCaretContainer(i),T.invalid){for(ul(e,d),i=g.getNode(),a=e.getBody(),9===i.nodeType?i=f=a:f=i;f!==a;)f=(i=f).parentNode;t=i===a?a.innerHTML:p.getOuterHTML(i),t=o.serialize(r.parse(t.replace(/<span (id="mce_marker"|id=mce_marker).+?<\/span>/i,function(){return o.serialize(u)}))),i===a?p.setHTML(a,t):p.setOuterHTML(i,t)}else!function(e,t,n){if("all"===n.getAttribute("data-mce-bogus"))n.parentNode.insertBefore(e.dom.createFragment(t),n);else{var r=n.firstChild,o=n.lastChild;!r||r===o&&"BR"===r.nodeName?e.dom.setHTML(n,t
):ul(e,t)}}(e,t=o.serialize(u),i);!function(e,t){var n=e.schema.getTextInlineElements(),r=e.dom;if(t){var o=e.getBody(),i=new Jc(r);Yt.each(r.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==o;t=t.parentNode)n[e.nodeName.toLowerCase()]&&i.compare(t,e)&&r.remove(e,!0)})}}(e,m),function(n,e){var t,r,o,i,a,u=n.dom,s=n.selection;if(e){if(n.selection.scrollIntoView(e),t=function(e){for(var t=n.getBody();e&&e!==t;e=e.parentNode)if("false"===n.dom.getContentEditable(e))return e;return null}(e))return u.remove(e),s.select(t);var c=u.createRng();(i=e.previousSibling)&&3===i.nodeType?(c.setStart(i,i.nodeValue.length),de.ie||(a=e.nextSibling)&&3===a.nodeType&&(i.appendData(a.data),a.parentNode.removeChild(a))):(c.setStartBefore(e),c.setEndBefore(e)),r=u.getParent(e,u.isBlock),u.remove(e),r&&u.isEmpty(r)&&(n.$(r).empty(),c.setStart(r,0),c.setEnd(r,0),al(r)||r.getAttribute("da
ta-mce-fragment")||!(o=function(e){var t=hu.fromRangeStart(e);if(t=Gs(n.getBody()).next(t))return t.toRange()}(c))?u.add(r,u.create("br",{"data-mce-bogus":"1"})):(c=o,u.remove(r))),s.setRng(c)}}(e,p.get("mce_marker")),E=e.getBody(),Yt.each(E.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),S=e.dom,k=e.selection.getStart(),A.from(S.getParent(k,"td,th")).map(rr.fromDom).each(el),e.fire("SetContent",s),e.addVisual()}},cl=function(e,t){var n,r,o="string"!=typeof(n=t)?(r=Yt.extend({paste:n.paste,data:{paste:n.paste}},n),{content:n.content,details:r}):{content:n,details:{}};sl(e,o.content,o.details)},ll=Er("sections","settings"),fl=tr.detect().deviceType.isTouch(),dl=["lists","autolink","autosave"],ml={theme:"mobile"},gl=function(e){var t=D(e)?e.join(" "):e,n=$(R(t)?t.split(" "):[],Kn);r
eturn z(n,function(e){return 0<e.length})},pl=function(n,e){var r,o,i,t=(r=function(e,t){return M(n,t)},o={},i={},mr(e,function(e,t){(r(e,t)?o:i)[t]=e}),{t:o,f:i});return ll(t.t,t.f)},hl=function(e,t){return e.sections().hasOwnProperty(t)},vl=function(e,t,n,r){var o,i=gl(n.forced_plugins),a=gl(r.plugins),u=e&&hl(t,"mobile")?z(a,d(M,dl)):a,s=(o=u,[].concat(gl(i)).concat(gl(o)));return Yt.extend(r,{plugins:s.join(" ")})},bl=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g=pl(["mobile"],r),p=Yt.extend(t,n,g.settings(),(f=e,m=(d=g).settings().inline,f&&hl(d,"mobile")&&!m?(u="mobile",s=ml,c=g.sections(),l=c.hasOwnProperty(u)?c[u]:{},Yt.extend({},s,l)):{}),{validate:!0,content_editable:g.settings().inline,external_plugins:(o=n,i=g.settings(),a=i.external_plugins?i.external_plugins:{},o&&o.external_plugins?Yt.extend({},o.external_plugins,a):a)});return vl(e,g,n,p)},yl=function(e,t,n){return A.from(t.settings[n]
).filter(e)},Cl=d(yl,R),xl=function(e,t,n,r){var o,i,a,u=t in e.settings?e.settings[t]:n;return"hash"===r?(a={},"string"==typeof(i=u)?F(0<i.indexOf("=")?i.split(/[;,](?![^=;,]*(?:[;,]|$))/):i.split(","),function(e){var t=e.split("=");1<t.length?a[Yt.trim(t[0])]=Yt.trim(t[1]):a[Yt.trim(t[0])]=Yt.trim(t)}):a=i,a):"string"===r?yl(R,e,t).getOr(n):"number"===r?yl(L,e,t).getOr(n):"boolean"===r?yl(O,e,t).getOr(n):"object"===r?yl(_,e,t).getOr(n):"array"===r?yl(D,e,t).getOr(n):"string[]"===r?yl((o=R,function(e){return D(e)&&J(e,o)}),e,t).getOr(n):"function"===r?yl(P,e,t).getOr(n):u},wl=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,Nl=function(e,t){var n=t.container(),r=t.offset();return e?ga(n)?_o.isText(n.nextSibling)?hu(n.nextSibling,0):hu.after(n):va(t)?hu(n,r+1):t:ga(n)?_o.isText(n.previousSibling)?hu(n.previousSibling,n.previousSibling.data.length):hu.befor
e(n):ba(t)?hu(n,r-1):t},El={isInlineTarget:function(e,t){var n=Cl(e,"inline_boundaries_selector").getOr("a[href],code");return Dr(rr.fromDom(t),n)},findRootInline:function(e,t,n){var r,o,i,a=(r=e,o=t,i=n,z(gi.DOM.getParents(i.container(),"*",o),r));return A.from(a[a.length-1])},isRtl:function(e){return"rtl"===gi.DOM.getStyle(e,"direction",!0)||(t=e.textContent,wl.test(t));var t},isAtZwsp:function(e){return va(e)||ba(e)},normalizePosition:Nl,normalizeForwards:d(Nl,!0),normalizeBackwards:d(Nl,!1),hasSameParentBlock:function(e,t,n){var r=ps(t,e),o=ps(n,e);return r&&r===o}},Sl=function(e,t){return Pr(e,t)?$i(t,function(e){return mo(e)||po(e)},(n=e,function(e){return Or(n,rr.fromDom(e.dom().parentNode))})):A.none();var n},kl=function(e){var t,n,r;e.dom.isEmpty(e.getBody())&&(e.setContent(""),n=(t=e).getBody(),r=n.firstChild&&t.dom.isBlock(n.firstChild)?n.firstChild:n,t.selection.setCursorLocation(r,0))},T
l=function(i,a,u){return qa([ic.firstPositionIn(u),ic.lastPositionIn(u)],function(e,t){var n=El.normalizePosition(!0,e),r=El.normalizePosition(!1,t),o=El.normalizePosition(!1,a);return i?ic.nextPosition(u,o).map(function(e){return e.isEqual(r)&&a.isEqual(n)}).getOr(!1):ic.prevPosition(u,o).map(function(e){return e.isEqual(n)&&a.isEqual(r)}).getOr(!1)}).getOr(!0)},Al=function(e,t){var n,r,o,i=rr.fromDom(e),a=rr.fromDom(t);return n=a,r="pre,code",o=d(Or,i),Wi(n,r,o).isSome()},Rl=function(e,t){return Da(t)&&!1===(r=e,o=t,_o.isText(o)&&/^[ \t\r\n]*$/.test(o.data)&&!1===Al(r,o))||(n=t,_o.isElement(n)&&"A"===n.nodeName&&n.hasAttribute("name"))||_l(t);var n,r,o},_l=_o.hasAttribute("data-mce-bookmark"),Dl=_o.hasAttribute("data-mce-bogus"),Bl=_o.hasAttributeValue("data-mce-bogus","all"),Ol=function(e){return function(e){var t,n,r=0;if(Rl(e,e))return!1;if(!(n=e.firstCh
ild))return!0;t=new ro(n,e);do{if(Bl(n))n=t.next(!0);else if(Dl(n))n=t.next();else if(_o.isBr(n))r++,n=t.next();else{if(Rl(e,n))return!1;n=t.next()}}while(n);return r<=1}(e.dom())},Pl=Er("block","position"),Ll=Er("from","to"),Il=function(e,t){var n=rr.fromDom(e),r=rr.fromDom(t.container());return Sl(n,r).map(function(e){return Pl(e,t)})},Ml=function(o,i,e){var t=Il(o,hu.fromRangeStart(e)),n=t.bind(function(e){return ic.fromPosition(i,o,e.position()).bind(function(e){return Il(o,e).map(function(e){return t=o,n=i,r=e,_o.isBr(r.position().getNode())&&!1===Ol(r.block())?ic.positionIn(!1,r.block().dom()).bind(function(e){return e.isEqual(r.position())?ic.fromPosition(n,t,e).bind(function(e){return Il(t,e)}):A.some(r)}).getOr(r):r;var t,n,r})})});return qa([t,n],Ll).filter(function(e){return!1===Or((r=e).from().block(),r.to().block())&&Ir((n=e).from().block()).bind(function(t){return Ir(n.to().block()).filter(function(e){return Or
(t,e)})}).isSome()&&(t=e,!1===_o.isContentEditableFalse(t.from().block())&&!1===_o.isContentEditableFalse(t.to().block()));var t,n,r})},Fl=function(e,t,n){return n.collapsed?Ml(e,t,n):A.none()},zl=function(e,t,n){return Pr(t,e)?function(e,t){for(var n=P(t)?t:j(!1),r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=rr.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,function(e){return n(e)||Or(e,t)}).slice(0,-1):[]},Ul=function(e,t){return zl(e,t,j(!1))},Vl=Ul,Hl=function(e,t){return[e].concat(Ul(e,t))},jl=function(e){var t,n=(t=Vr(e),K(t,co).fold(function(){return t},function(e){return t.slice(0,e)}));return F(n,Ri),n},ql=function(e,t){var n=Hl(t,e);return V(n.reverse(),Ol).each(Ri)},$l=function(e,t,n,r){if(Ol(n))return Zc(n),ic.firstPositionIn(n.dom());0===z(zr(r),function(e){return!Ol(e)}).length&&Ol(t)&&Ni(r,rr.fromTag("br"));var o=ic.prevPosition(n.dom(),hu.before(r.dom()));return F(jl(t),f
unction(e){Ni(r,e)}),ql(e,t),o},Wl=function(e,t,n){if(Ol(n))return Ri(n),Ol(t)&&Zc(t),ic.firstPositionIn(t.dom());var r=ic.lastPositionIn(n.dom());return F(jl(t),function(e){ki(n,e)}),ql(e,t),r},Kl=function(e,t){return Pr(t,e)?(n=Hl(e,t),A.from(n[n.length-1])):A.none();var n},Xl=function(e,t){ic.positionIn(e,t.dom()).map(function(e){return e.getNode()}).map(rr.fromDom).filter(fo).each(Ri)},Yl=function(e,t,n){return Xl(!0,t),Xl(!1,n),Kl(t,n).fold(d(Wl,e,t,n),d($l,e,t,n))},Gl=function(e,t,n,r){return t?Yl(e,r,n):Yl(e,n,r)},Jl=function(t,n){var e,r=rr.fromDom(t.getBody());return(e=Fl(r.dom(),n,t.selection.getRng()).bind(function(e){return Gl(r,n,e.from().block(),e.to().block())})).each(function(e){t.selection.setRng(e.toRange())}),e.isSome()},Ql=function(e,t){var n=rr.fromDom(t),r=d(Or,e);return qi(n,bo,r).isSome()},Zl=function(e,t){var n,r,o=ic.prevPosition(e.dom(),hu.fromRangeStart(t)).isNone(),i=ic.nextPosition(e.dom(),hu.fromRangeEnd(t)).isNone();return!(Ql(n=e,(r=t).startC
ontainer)||Ql(n,r.endContainer))&&o&&i},ef=function(e){var n,r,o,t,i=rr.fromDom(e.getBody()),a=e.selection.getRng();return Zl(i,a)?((t=e).setContent(""),t.selection.setCursorLocation(),!0):(n=i,r=e.selection,o=r.getRng(),qa([Sl(n,rr.fromDom(o.startContainer)),Sl(n,rr.fromDom(o.endContainer))],function(e,t){return!1===Or(e,t)&&(o.deleteContents(),Gl(n,!0,e,t).each(function(e){r.setRng(e.toRange())}),!0)}).getOr(!1))},tf=function(e,t){return!e.selection.isCollapsed()&&ef(e)},nf=function(a){if(!D(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return F(a,function(e,r){var t=fr(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!D(i))thro
w new Error("case arguments must be an array");u.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t<n.length;t++)n[t]=arguments[t];return{fold:function(){if(arguments.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+arguments.length);return arguments[r].apply(null,n)},match:function(e){var t=fr(e);if(u.length!==t.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+t.join(","));if(!J(u,function(e){return M(t,e)}))throw new Error("Not all branches were specified when using match. Specified: "+t.join(", ")+"\nRequired: "+u.join(", "));return e[o].apply(null,n)},log:function(e){console.log(e,{constructors:u
,constructor:o,params:n})}}}}),n},rf=function(e){return Ps(e).exists(fo)},of=function(e,t,n){var r=z(Hl(rr.fromDom(n.container()),t),co),o=ee(r).getOr(t);return ic.fromPosition(e,o.dom(),n).filter(rf)},af=function(e,t){return Ps(t).exists(fo)||of(!0,e,t).isSome()},uf=function(e,t){return(n=t,A.from(n.getNode(!0)).map(rr.fromDom)).exists(fo)||of(!1,e,t).isSome();var n},sf=d(of,!1),cf=d(of,!0),lf=nf([{remove:["element"]},{moveToElement:["element"]},{moveToPosition:["position"]}]),ff=function(e,t,n,r){var o=r.getNode(!1===t);return Sl(rr.fromDom(e),rr.fromDom(n.getNode())).map(function(e){return Ol(e)?lf.remove(e.dom()):lf.moveToElement(o)}).orThunk(function(){return A.some(lf.moveToElement(o))})},df=function(u,s,c){return ic.fromPosition(s,u,c).bind(function(e){return a=e.getNode(),bo(rr.fromDom(a))||po(rr.fromDom(a))?A.none():(t=u,o=e,i=function(e){return lo(rr.fromDom(e))&&!hs(r,o,t)},Ss(!(n=s),r=c).fold(function(){return Ss(n,o).fold(j(!1),i)},
i)?A.none():s&&_o.isContentEditableFalse(e.getNode())?ff(u,s,c,e):!1===s&&_o.isContentEditableFalse(e.getNode(!0))?ff(u,s,c,e):s&&As(c)?A.some(lf.moveToPosition(e)):!1===s&&Ts(c)?A.some(lf.moveToPosition(e)):A.none());var t,n,r,o,i,a})},mf=function(r,e,o){return i=e,a=o.getNode(!1===i),u=i?"after":"before",_o.isElement(a)&&a.getAttribute("data-mce-caret")===u?(t=e,n=o.getNode(!1===e),t&&_o.isContentEditableFalse(n.nextSibling)?A.some(lf.moveToElement(n.nextSibling)):!1===t&&_o.isContentEditableFalse(n.previousSibling)?A.some(lf.moveToElement(n.previousSibling)):A.none()).fold(function(){return df(r,e,o)},A.some):df(r,e,o).bind(function(e){return t=r,n=o,e.fold(function(e){return A.some(lf.remove(e))},function(e){return A.some(lf.moveToElement(e))},function(e){return hs(n,e,t)?A.none():A.some(lf.moveToPosition(e))});var t,n});var t,n,i,a,u},gf=function(e,t,n){if(0!==n){var r,o,i,a=e.data.slice(t,t+n
),u=t+n>=e.data.length,s=0===t;e.replaceData(t,n,(o=s,i=u,U((r=a).split(""),function(e,t){return-1!==" \f\n\r\t\x0B".indexOf(t)||"\xa0"===t?e.previousCharIsSpace||""===e.str&&o||e.str.length===r.length-1&&i?{previousCharIsSpace:!1,str:e.str+"\xa0"}:{previousCharIsSpace:!0,str:e.str+" "}:{previousCharIsSpace:!1,str:e.str+t}},{previousCharIsSpace:!1,str:""}).str))}},pf=function(e,t){var n,r=e.data.slice(t),o=r.length-(n=r,n.replace(/^\s+/g,"")).length;return gf(e,t,o)},hf=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===hu.isTextPosition(n)&&o===r.parentNode&&i>hu.before(r).offset()?hu(t.container(),t.offset()-1):t;var n,r,o,i},vf=function(e){return Da(e.previousSibling)?A.some((t=e.previousSibling,_o.isText(t)?hu(t,t.data.length):hu.after(t))):e.previousSibling?ic.lastPositionIn(e.previousSibling):A.none();var t},bf=function(e){return Da(e.nextSibling)?A
.some((t=e.nextSibling,_o.isText(t)?hu(t,0):hu.before(t))):e.nextSibling?ic.firstPositionIn(e.nextSibling):A.none();var t},yf=function(r,o){return vf(o).orThunk(function(){return bf(o)}).orThunk(function(){return e=r,t=o,n=hu.before(t.previousSibling?t.previousSibling:t.parentNode),ic.prevPosition(e,n).fold(function(){return ic.nextPosition(e,hu.after(t))},A.some);var e,t,n})},Cf=function(n,r){return bf(r).orThunk(function(){return vf(r)}).orThunk(function(){return e=n,t=r,ic.nextPosition(e,hu.after(t)).fold(function(){return ic.prevPosition(e,hu.before(t))},A.some);var e,t})},xf=function(e,t,n){return(r=e,o=t,i=n,r?Cf(o,i):yf(o,i)).map(d(hf,n));var r,o,i},wf=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},Nf=function(e,t){return t&&e.schema.getBlockElements().hasOwnProperty(ur(t))},Ef=function(e){if(Ol(e)){var t=rr.fromHtml('<br data-mce-bogus="1">');return Ai(e),ki(e,t),A.some(hu.before(t.dom()))}return A.none()
},Sf=function(e,t,l){var n=Mr(e).filter(function(e){return _o.isText(e.dom())}),r=Fr(e).filter(function(e){return _o.isText(e.dom())});return Ri(e),qa([n,r,t],function(e,t,n){var r,o,i,a,u=e.dom(),s=t.dom(),c=u.data.length;return o=s,i=l,a=Xn((r=u).data).length,r.appendData(o.data),Ri(rr.fromDom(o)),i&&pf(r,a),n.container()===s?hu(u,c):n}).orThunk(function(){return l&&(n.each(function(e){return t=e.dom(),n=e.dom().length,r=t.data.slice(0,n),o=r.length-Xn(r).length,gf(t,n-o,o);var t,n,r,o}),r.each(function(e){return pf(e.dom(),0)})),t})},kf=function(e,t){return n=e.schema.getTextInlineElements(),r=ur(t),dr.call(n,r);var n,r},Tf=function(t,n,e,r){void 0===r&&(r=!0);var o,i=xf(n,t.getBody(),e.dom()),a=qi(e,d(Nf,t),(o=t.getBody(),function(e){return e.dom()===o})),u=Sf(e,i,kf(t,e));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):a.bind(Ef).fold(function(){r&&wf(t,n,u)},function(e){r&&wf(t,n,A.some(e))})},Af=f
unction(a,u){var e,t,n,r,o,i;return(e=a.getBody(),t=u,n=a.selection.getRng(),r=ws(t?1:-1,e,n),o=hu.fromRangeStart(r),i=rr.fromDom(e),!1===t&&As(o)?A.some(lf.remove(o.getNode(!0))):t&&Ts(o)?A.some(lf.remove(o.getNode())):!1===t&&Ts(o)&&uf(i,o)?sf(i,o).map(function(e){return lf.remove(e.getNode())}):t&&As(o)&&af(i,o)?cf(i,o).map(function(e){return lf.remove(e.getNode())}):mf(e,t,o)).map(function(e){return e.fold((o=a,i=u,function(e){return o._selectionOverrides.hideFakeCaret(),Tf(o,i,rr.fromDom(e)),!0}),(n=a,r=u,function(e){var t=r?hu.before(e):hu.after(e);return n.selection.setRng(t.toRange()),!0}),(t=a,function(e){return t.selection.setRng(e.toRange()),!0}));var t,n,r,o,i}).getOr(!1)},Rf=function(e,t){var n,r=e.selection.getNode();return!!_o.isContentEditableFalse(r)&&(n=rr.fromDom(e.getBody()),F(Vi(n,".mce-offscreen-selection"),Ri),Tf(e,t,rr.fromDom(e.selection.getNode())),kl(e),!0)},_f=function(e,t){return e.selecti
on.isCollapsed()?Af(e,t):Rf(e,t)},Df=function(e){var t,n=function(e,t){for(;t&&t!==e;){if(_o.isContentEditableTrue(t)||_o.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return _o.isContentEditableTrue(n)&&e.dom.isBlock(n)&&e.dom.isEmpty(n)&&(t=e.dom.create("br",{"data-mce-bogus":"1"}),e.dom.setHTML(n,""),n.appendChild(t),e.selection.setRng(hu.before(t).toRange())),!0},Bf=_o.isText,Of=function(e){return Bf(e)&&e.data[0]===ca},Pf=function(e){return Bf(e)&&e.data[e.data.length-1]===ca},Lf=function(e){return e.ownerDocument.createTextNode(ca)},If=function(e,t){return e?function(e){if(Bf(e.previousSibling))return Pf(e.previousSibling)||e.previousSibling.appendData(ca),e.previousSibling;if(Bf(e))return Of(e)||e.insertData(0,ca),e;var t=Lf(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(Bf(e.nextSibling))return Of(e.nextSibling)||e.nextSib
ling.insertData(0,ca),e.nextSibling;if(Bf(e))return Pf(e)||e.appendData(ca),e;var t=Lf(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},Mf=d(If,!0),Ff=d(If,!1),zf=function(e,t){return _o.isText(e.container())?If(t,e.container()):If(t,e.getNode())},Uf=function(e,t){var n=t.get();return n&&e.container()===n&&ga(n)},Vf=function(n,e){return e.fold(function(e){Yu.remove(n.get());var t=Mf(e);return n.set(t),A.some(hu(t,t.length-1))},function(e){return ic.firstPositionIn(e).map(function(e){if(Uf(e,n))return hu(n.get(),1);Yu.remove(n.get());var t=zf(e,!0);return n.set(t),hu(t,1)})},function(e){return ic.lastPositionIn(e).map(function(e){if(Uf(e,n))return hu(n.get(),n.get().length-1);Yu.remove(n.get());var t=zf(e,!1);return n.set(t),hu(t,t.length-1)})},function(e){Yu.remove(n.get());var t=Ff(e);return n.set(t),A.some(hu(t,1))})},Hf=function(e,t){for(var n=0;n<e.length;n++){var r=e[n].apply(null,t);if(r.isSome())return r}
return A.none()},jf=nf([{before:["element"]},{start:["element"]},{end:["element"]},{after:["element"]}]),qf=function(e,t){var n=ps(t,e);return n||e},$f=function(e,t,n){var r=El.normalizeForwards(n),o=qf(t,r.container());return El.findRootInline(e,o,r).fold(function(){return ic.nextPosition(o,r).bind(d(El.findRootInline,e,o)).map(function(e){return jf.before(e)})},A.none)},Wf=function(e,t){return null===zu(e,t)},Kf=function(e,t,n){return El.findRootInline(e,t,n).filter(d(Wf,t))},Xf=function(e,t,n){var r=El.normalizeBackwards(n);return Kf(e,t,r).bind(function(e){return ic.prevPosition(e,r).isNone()?A.some(jf.start(e)):A.none()})},Yf=function(e,t,n){var r=El.normalizeForwards(n);return Kf(e,t,r).bind(function(e){return ic.nextPosition(e,r).isNone()?A.some(jf.end(e)):A.none()})},Gf=function(e,t,n){var r=El.normalizeBackwards(n),o=qf(t,r.container());return El.findRootInline(e,o,r).fold(function(){return ic.prevPosition(o,r).bind(d(El.findRootInlin
e,e,o)).map(function(e){return jf.after(e)})},A.none)},Jf=function(e){return!1===El.isRtl(Zf(e))},Qf=function(e,t,n){return Hf([$f,Xf,Yf,Gf],[e,t,n]).filter(Jf)},Zf=function(e){return e.fold(q,q,q,q)},ed=function(e){return e.fold(j("before"),j("start"),j("end"),j("after"))},td=function(e){return e.fold(jf.before,jf.before,jf.after,jf.after)},nd=function(n,e,r,t,o,i){return qa([El.findRootInline(e,r,t),El.findRootInline(e,r,o)],function(e,t){return e!==t&&El.hasSameParentBlock(r,e,t)?jf.after(n?e:t):i}).getOr(i)},rd=function(e,r){return e.fold(j(!0),function(e){return n=r,!(ed(t=e)===ed(n)&&Zf(t)===Zf(n));var t,n})},od=function(e,t){return e?t.fold(H(A.some,jf.start),A.none,H(A.some,jf.after),A.none):t.fold(A.none,H(A.some,jf.before),A.none,H(A.some,jf.end))},id=function(a,u,s,c){var e=El.normalizePosition(a,c),l=Qf(u,s,e);return Qf(u,s,e).bind(d(od,a)).orThunk(function(){return t=a,n=u,r=s,o=l,e=c,i=El.normalizePosition(t,e),ic
.fromPosition(t,r,i).map(d(El.normalizePosition,t)).fold(function(){return o.map(td)},function(e){return Qf(n,r,e).map(d(nd,t,n,r,i,e)).filter(d(rd,o))}).filter(Jf);var t,n,r,o,e,i})},ad=Qf,ud=id,sd=(d(id,!1),d(id,!0),td),cd=function(e){return e.fold(jf.start,jf.start,jf.end,jf.end)},ld=function(e){return P(e.selection.getSel().modify)},fd=function(e,t,n){var r=e?1:-1;return t.setRng(hu(n.container(),n.offset()+r).toRange()),t.getSel().modify("move",e?"forward":"backward","word"),!0},dd=function(e,t){var n=t.selection.getRng(),r=e?hu.fromRangeEnd(n):hu.fromRangeStart(n);return!!ld(t)&&(e&&va(r)?fd(!0,t.selection,r):!(e||!ba(r))&&fd(!1,t.selection,r))},md=function(e,t){var n=e.dom.createRng();n.setStart(t.container(),t.offset()),n.setEnd(t.container(),t.offset()),e.selection.setRng(n)},gd=function(e){return!1!==e.settings.inline_boundaries},pd=function(e,t){e?t.setAttribute("data-mce-selected","inline-boun
dary"):t.removeAttribute("data-mce-selected")},hd=function(t,e,n){return Vf(e,n).map(function(e){return md(t,e),n})},vd=function(e,t,n){return function(){return!!gd(t)&&dd(e,t)}},bd={move:function(a,u,s){return function(){return!!gd(a)&&(t=a,n=u,e=s,r=t.getBody(),o=hu.fromRangeStart(t.selection.getRng()),i=d(El.isInlineTarget,t),ud(e,i,r,o).bind(function(e){return hd(t,n,e)})).isSome();var t,n,e,r,o,i}},moveNextWord:d(vd,!0),movePrevWord:d(vd,!1),setupSelectedState:function(a){var u=Bi(null),s=d(El.isInlineTarget,a);return a.on("NodeChange",function(e){var t,n,r,o,i;gd(a)&&(t=s,n=a.dom,r=e.parents,o=z(n.select('*[data-mce-selected="inline-boundary"]'),t),i=z(r,t),F(Z(o,i),d(pd,!1)),F(Z(i,o),d(pd,!0)),function(e,t){if(e.selection.isCollapsed()&&!0!==e.composing&&t.get()){var n=hu.fromRangeStart(e.selection.getRng());hu.isTextPosition(n)&&!1===El.isAtZwsp(n)&&(md(e,Yu.removeAndReposition(t.get()
,n)),t.set(null))}}(a,u),function(n,r,o,e){if(r.selection.isCollapsed()){var t=z(e,n);F(t,function(e){var t=hu.fromRangeStart(r.selection.getRng());ad(n,r.getBody(),t).bind(function(e){return hd(r,o,e)})})}}(s,a,u,e.parents))}),u},setCaretPosition:md},yd=function(t,n){return function(e){return Vf(n,e).map(function(e){return bd.setCaretPosition(t,e),!0}).getOr(!1)}},Cd=function(r,o,i,a){var u=r.getBody(),s=d(El.isInlineTarget,r);r.undoManager.ignore(function(){var e,t,n;r.selection.setRng((e=i,t=a,(n=document.createRange()).setStart(e.container(),e.offset()),n.setEnd(t.container(),t.offset()),n)),r.execCommand("Delete"),ad(s,u,hu.fromRangeStart(r.selection.getRng())).map(cd).map(yd(r,o))}),r.nodeChanged()},xd=function(n,r,i,o){var e,t,a=(e=n.getBody(),t=o.container(),ps(t,e)||e),u=d(El.isInlineTarget,n),s=ad(u,a,o);return s.bind(function(e){return i?e.fold(j(A.some(cd(e))),A.none,j(A.some(sd(e))),A.none):e.fold(A.none,j(A.some(sd(e))),A.none,j(A.some(cd(e))))}).map(yd(n,r))
.getOrThunk(function(){var t=ic.navigate(i,a,o),e=t.bind(function(e){return ad(u,a,e)});return s.isSome()&&e.isSome()?El.findRootInline(u,a,o).map(function(e){return o=e,!!qa([ic.firstPositionIn(o),ic.lastPositionIn(o)],function(e,t){var n=El.normalizePosition(!0,e),r=El.normalizePosition(!1,t);return ic.nextPosition(o,n).map(function(e){return e.isEqual(r)}).getOr(!0)}).getOr(!0)&&(Tf(n,i,rr.fromDom(e)),!0);var o}).getOr(!1):e.bind(function(e){return t.map(function(e){return i?Cd(n,r,o,e):Cd(n,r,e,o),!0})}).getOr(!1)})},wd=function(e,t,n){if(e.selection.isCollapsed()&&!1!==e.settings.inline_boundaries){var r=hu.fromRangeStart(e.selection.getRng());return xd(e,t,n,r)}return!1},Nd=Er("start","end"),Ed=Er("rng","table","cells"),Sd=nf([{removeTable:["element"]},{emptyCells:["cells"]}]),kd=function(e,t){return Xi(rr.fromDom(e),"td,th",t)},Td=function(e,t){return Wi(e,"table"
,t)},Ad=function(e){return!1===Or(e.start(),e.end())},Rd=function(e,n){return Td(e.start(),n).bind(function(t){return Td(e.end(),n).bind(function(e){return Or(t,e)?A.some(t):A.none()})})},_d=function(e){return Vi(e,"td,th")},Dd=function(r,e){var t=kd(e.startContainer,r),n=kd(e.endContainer,r);return e.collapsed?A.none():qa([t,n],Nd).fold(function(){return t.fold(function(){return n.bind(function(t){return Td(t,r).bind(function(e){return ee(_d(e)).map(function(e){return Nd(e,t)})})})},function(t){return Td(t,r).bind(function(e){return te(_d(e)).map(function(e){return Nd(t,e)})})})},function(e){return Bd(r,e)?A.none():(n=r,Td((t=e).start(),n).bind(function(e){return te(_d(e)).map(function(e){return Nd(t.start(),e)})}));var t,n})},Bd=function(e,t){return Rd(t,e).isSome()},Od=function(e,t){var n,r,o,i,a=d(Or,e);return(n=t,r=a,o=kd(n.startContainer,r),i=kd(n.endContainer,r),qa([o,i],Nd).filter(Ad).filter(function(e){return Bd(r,e)}).orThunk(function(){return Dd(r,n)})).bind(fun
ction(e){return Rd(t=e,a).map(function(e){return Ed(t,e,_d(e))});var t})},Pd=function(e,t){return K(e,function(e){return Or(e,t)})},Ld=function(n){return(r=n,qa([Pd(r.cells(),r.rng().start()),Pd(r.cells(),r.rng().end())],function(e,t){return r.cells().slice(e,t+1)})).map(function(e){var t=n.cells();return e.length===t.length?Sd.removeTable(n.table()):Sd.emptyCells(e)});var r},Id=function(e,t){return Od(e,t).bind(Ld)},Md=function(e){var t=[];if(e)for(var n=0;n<e.rangeCount;n++)t.push(e.getRangeAt(n));return t},Fd=Md,zd=function(e){return G(e,function(e){var t=Ua(e);return t?[rr.fromDom(t)]:[]})},Ud=function(e){return 1<Md(e).length},Vd=function(e){return z(zd(e),bo)},Hd=function(e){return Vi(e,"td[data-mce-selected],th[data-mce-selected]")},jd=function(e,t){var n=Hd(t),r=Vd(e);return 0<n.length?n:r},qd=jd,$d=function(e){return jd(Fd(e.selection.getSel()),rr.fromDom(e.getBody()))},Wd=function(e,t){return F(t,Zc),e.selection.setCursorLocation(t[0].dom(),0),!0},Kd=fun
ction(e,t){return Tf(e,!1,t),!0},Xd=function(n,e,r,t){return Gd(e,t).fold(function(){return t=n,Id(e,r).map(function(e){return e.fold(d(Kd,t),d(Wd,t))});var t},function(e){return Jd(n,e)}).getOr(!1)},Yd=function(e,t){return V(Hl(t,e),bo)},Gd=function(e,t){return V(Hl(t,e),function(e){return"caption"===ur(e)})},Jd=function(e,t){return Zc(t),e.selection.setCursorLocation(t.dom(),0),A.some(!0)},Qd=function(u,s,c,l,f){return ic.navigate(c,u.getBody(),f).bind(function(e){return r=l,o=c,i=f,a=e,ic.firstPositionIn(r.dom()).bind(function(t){return ic.lastPositionIn(r.dom()).map(function(e){return o?i.isEqual(t)&&a.isEqual(e):i.isEqual(e)&&a.isEqual(t)})}).getOr(!0)?Jd(u,l):(t=l,n=e,Gd(s,rr.fromDom(n.getNode())).map(function(e){return!1===Or(e,t)}));var t,n,r,o,i,a}).or(A.some(!0))},Zd=function(a,u,s,e){var c=hu.fromRangeStart(a.selection.getRng());return Yd(s,e).bind(function(e){return Ol(e)?Jd(a,e):(t=a,n=s,r=u,o=e,i=c,ic.navigate(r,t.getBody(),i).bind(function(e)
{return Yd(n,rr.fromDom(e.getNode())).map(function(e){return!1===Or(e,o)})}));var t,n,r,o,i})},em=function(a,u,e){var s=rr.fromDom(a.getBody());return Gd(s,e).fold(function(){return Zd(a,u,s,e)},function(e){return t=a,n=u,r=s,o=e,i=hu.fromRangeStart(t.selection.getRng()),Ol(o)?Jd(t,o):Qd(t,r,n,o,i);var t,n,r,o,i}).getOr(!1)},tm=function(e,t){var n,r,o,i,a,u=rr.fromDom(e.selection.getStart(!0)),s=$d(e);return e.selection.isCollapsed()&&0===s.length?em(e,t,u):(n=e,r=u,o=rr.fromDom(n.getBody()),i=n.selection.getRng(),0!==(a=$d(n)).length?Wd(n,a):Xd(n,o,i,r))},nm=function(e,t){e.getDoc().execCommand(t,!1,null)},rm=function(e){_f(e,!1)||wd(e,!1)||Jl(e,!1)||tm(e)||tf(e,!1)||(nm(e,"Delete"),kl(e))},om=function(e){_f(e,!0)||wd(e,!0)||Jl(e,!0)||tm(e)||tf(e,!0)||nm(e,"ForwardDelete")},im=function(e,t,n){var r=e.getParam(t,n);if(-1!==r.indexOf("=")){var o=e.getParam(t,"","hash");return o.hasOwnProperty(e.id)?o[e.id]:n}return r},am=funct
ion(e){return e.getParam("iframe_attrs",{})},um=function(e){return e.getParam("doctype","<!DOCTYPE html>")},sm=function(e){return e.getParam("document_base_url","")},cm=function(e){return im(e,"body_id","tinymce")},lm=function(e){return im(e,"body_class","")},fm=function(e){return e.getParam("content_security_policy","")},dm=function(e){return e.getParam("br_in_pre",!0)},mm=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":t},gm=function(e){return e.getParam("forced_root_block_attrs",{})},pm=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},hm=function(e){return e.getParam("no_newline_selector","")},vm=function(e){return e.getParam("keep_styles",!0)
},bm=function(e){return e.getParam("end_container_on_empty_block",!1)},ym=function(e){return Yt.explode(e.getParam("font_size_style_values",""))},Cm=function(e){return Yt.explode(e.getParam("font_size_classes",""))},xm=function(e){return e.getParam("images_dataimg_filter",j(!0),"function")},wm=function(e){return e.getParam("automatic_uploads",!0,"boolean")},Nm=function(e){return e.getParam("images_reuse_filename",!1,"boolean")},Em=function(e){return e.getParam("images_replace_blob_uris",!0,"boolean")},Sm=function(e){return e.getParam("images_upload_url","","string")},km=function(e){return e.getParam("images_upload_base_path","","string")},Tm=function(e){return e.getParam("images_upload_credentials",!1,"boolean")},Am=function(e){return e.getParam("images_upload_handler&quo
t;,null,"function")},Rm=function(e){return e.getParam("content_css_cors",!1,"boolean")},_m=function(o,t,e){var n=function(e){return t=o,n=e.dom(),r=Nr(n,t),A.from(r).filter(function(e){return 0<e.length});var t,n,r};return $i(rr.fromDom(e),function(e){return n(e).isSome()},function(e){return Or(rr.fromDom(t),e)}).bind(n)},Dm=function(o){return function(r,e){return A.from(e).map(rr.fromDom).filter(cr).bind(function(e){return _m(o,r,e.dom()).or((t=o,n=e.dom(),A.from(gi.DOM.getStyle(n,t,!0))));var t,n}).getOr("")}},Bm={getFontSize:Dm("font-size"),getFontFamily:H(function(e){return e.replace(/[\'\"\\]/g,"").replace(/,\s+/g,",")},Dm("font-family")),toPt:function(e,t){return/[0-9.]+px$/.test(e)?(n=72*parseInt(e,10)/96,r=t||0,o=Math.pow(10,r),Math.round(n*o)/o+"pt"):e;var n,r,o}},Om=function(e){return ic.firstPositionIn(e.getBody()).map(function(e){var t=e.container();return _o.isText(t)?t.par
entNode:t})},Pm=function(o){return A.from(o.selection.getRng()).bind(function(e){var t,n,r=o.getBody();return n=r,(t=e).startContainer===n&&0===t.startOffset?A.none():A.from(o.selection.getStart(!0))})},Lm=function(e,t){if(/^[0-9\.]+$/.test(t)){var n=parseInt(t,10);if(1<=n&&n<=7){var r=ym(e),o=Cm(e);return o?o[n-1]||t:r[n-1]||t}return t}return t},Im=function(e,t){return e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset},Mm=function(e,t,n){return null!==function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}return null}(e,t,n)},Fm=function(e,t,n){return Mm(e,t,function(e){return e.nodeName===n})},zm=function(e){return e&&"TABLE"===e.nodeName},Um=function(e,t,n){for(var r=new ro(t,e.getParent(t.parentNode,e.isBlock)||e.getRoot());t=r[n?"prev":"next"]();)if(_o.isBr(t))return!0},Vm=function
(e,t,n,r,o){var i,a,u,s,c,l,f=e.getRoot(),d=e.schema.getNonEmptyElements();if(u=e.getParent(o.parentNode,e.isBlock)||f,r&&_o.isBr(o)&&t&&e.isEmpty(u))return A.some(du(o.parentNode,e.nodeIndex(o)));for(i=new ro(o,u);s=i[r?"prev":"next"]();){if("false"===e.getContentEditableParent(s)||(l=f,pa(c=s)&&!1===Mm(c,l,Fu)))return A.none();if(_o.isText(s)&&0<s.nodeValue.length)return!1===Fm(s,f,"A")?A.some(du(s,r?s.nodeValue.length:0)):A.none();if(e.isBlock(s)||d[s.nodeName.toLowerCase()])return A.none();a=s}return n&&a?A.some(du(a,0)):A.none()},Hm=function(e,t,n,r){var o,i,a,u,s,c,l,f,d,m,g=e.getRoot(),p=!1;if(o=r[(n?"start":"end")+"Container"],i=r[(n?"start":"end")+"Offset"],l=_o.isElement(o)&&i===o.childNodes.length,s=e.schema.getNonEmptyElements(),c=n,pa(o))return A.none();if(_o.isElement(o)&&i>o.childNodes.length-1&&a
mp;(c=!1),_o.isDocument(o)&&(o=g,i=0),o===g){if(c&&(u=o.childNodes[0<i?i-1:0])){if(pa(u))return A.none();if(s[u.nodeName]||zm(u))return A.none()}if(o.hasChildNodes()){if(i=Math.min(!c&&0<i?i-1:i,o.childNodes.length-1),o=o.childNodes[i],i=_o.isText(o)&&l?o.data.length:0,!t&&o===g.lastChild&&zm(o))return A.none();if(function(e,t){for(;t&&t!==e;){if(_o.isContentEditableFalse(t))return!0;t=t.parentNode}return!1}(g,o)||pa(o))return A.none();if(o.hasChildNodes()&&!1===zm(o)){a=new ro(u=o,g);do{if(_o.isContentEditableFalse(u)||pa(u)){p=!1;break}if(_o.isText(u)&&0<u.nodeValue.length){i=c?0:u.nodeValue.length,o=u,p=!0;break}if(s[u.nodeName.toLowerCase()]&&(!(f=u)||!/^(TD|TH|CAPTION)$/.test(f.nodeName))){i=e.nodeIndex(u),o=u.parentNode,c||i++,p=!0;break}}while(u=c?a.next():a.prev())}}}return t&&(_o.isText(o)&&0===i&&Vm(e,l,t,!0,o).each(function(e){o=e.container(),i=e.offset(),p=!0}
),_o.isElement(o)&&((u=o.childNodes[i])||(u=o.childNodes[i-1]),!u||!_o.isBr(u)||(m="A",(d=u).previousSibling&&d.previousSibling.nodeName===m)||Um(e,u,!1)||Um(e,u,!0)||Vm(e,l,t,!0,u).each(function(e){o=e.container(),i=e.offset(),p=!0}))),c&&!t&&_o.isText(o)&&i===o.nodeValue.length&&Vm(e,l,t,!1,o).each(function(e){o=e.container(),i=e.offset(),p=!0}),p?A.some(du(o,i)):A.none()},jm=function(e,t){var n=t.collapsed,r=t.cloneRange(),o=du.fromRangeStart(t);return Hm(e,n,!0,r).each(function(e){n&&du.isAbove(o,e)||r.setStart(e.container(),e.offset())}),n||Hm(e,n,!1,r).each(function(e){r.setEnd(e.container(),e.offset())}),n&&r.collapse(!0),Im(t,r)?A.none():A.some(r)},qm=function(e,t,n){var r=e.create("span",{}," ");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},$m=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter
(n)),t.setRng(o)},Wm=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();jm(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u=a.startOffset,s=a.startContainer;if(1===s.nodeType&&s.hasChildNodes()){var c=u>s.childNodes.length-1;s=s.childNodes[Math.min(u,s.childNodes.length-1)]||s,u=c&&3===s.nodeType?s.nodeValue.length:0}var l=i.getParent(s,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=t&&t.ctrlKey;"LI"!==d||m||(l=f),s&&3===s.nodeType&&u>=s.nodeValue.length&&(function(e,t,n){for(var r,o=new ro(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0<r.length)return!0}(e.schema,s,l)||(n=i.create("br"),a.insertNode(n),a.setStartAfter(n),a.setEndAfter(n),r=!0)),n=i.create("br"),a.insertNode(n),qm(i,o,n),$m(i,o,n,r),e.undoManager.add()},Km=function(e,t){var n=rr.from
Tag("br");Ni(rr.fromDom(t),n),e.undoManager.add()},Xm=function(e,t){Ym(e.getBody(),t)||Ei(rr.fromDom(t),rr.fromTag("br"));var n=rr.fromTag("br");Ei(rr.fromDom(t),n),qm(e.dom,e.selection,n.dom()),$m(e.dom,e.selection,n.dom(),!1),e.undoManager.add()},Ym=function(e,t){return n=hu.after(t),!!_o.isBr(n.getNode())||ic.nextPosition(e,hu.after(t)).map(function(e){return _o.isBr(e.getNode())}).getOr(!1);var n},Gm=function(e){return e&&"A"===e.nodeName&&"href"in e},Jm=function(e){return e.fold(j(!1),Gm,Gm,j(!1))},Qm=function(e,t){t.fold(o,d(Km,e),d(Xm,e),o)},Zm=function(e,t){var n,r,o,i=(n=e,r=d(El.isInlineTarget,n),o=hu.fromRangeStart(n.selection.getRng()),ad(r,n.getBody(),o).filter(Jm));i.isSome()?i.each(d(Qm,e)):Wm(e,t)},eg=(nf([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),nf([{domRange:["rng"]},{relative:["startSitu","finishSitu"]}
,{exact:["start","soffset","finish","foffset"]}])),tg=Er("start","soffset","finish","foffset"),ng=(eg.domRange,eg.relative,eg.exact,tr.detect().browser),rg=function(e,t){var n=lr(t)?Lc(t).length:Vr(t).length+1;return n<e?n:e<0?0:e},og=function(e){return tg(e.start(),rg(e.soffset(),e.start()),e.finish(),rg(e.foffset(),e.finish()))},ig=function(e,t){return Pr(e,t)||Or(e,t)},ag=function(t){return function(e){return ig(t,e.start())&&ig(t,e.finish())}},ug=function(e){return!0===e.inline||ng.isIE()},sg=function(e){return tg(rr.fromDom(e.startContainer),e.startOffset,rr.fromDom(e.endContainer),e.endOffset)},cg=function(e){var t=e.getSelection();return(t&&0!==t.rangeCount?A.from(t.getRangeAt(0)):A.none()).map(sg)},lg=function(e){var t,n=(t=e.dom().ownerDocument.defaultView,rr.fromDom(t));return cg(n.dom()).filter(ag(e))},fg=function(e,t){return A.from(t).filter(ag(e)).map(og)},dg=function(e
){var t=document.createRange();try{return t.setStart(e.start().dom(),e.soffset()),t.setEnd(e.finish().dom(),e.foffset()),A.some(t)}catch(n){return A.none()}},mg=function(e){return(e.bookmark?e.bookmark:A.none()).bind(d(fg,rr.fromDom(e.getBody()))).bind(dg)},gg=function(e){var t=ug(e)?lg(rr.fromDom(e.getBody())):A.none();e.bookmark=t.isSome()?t:e.bookmark},pg=function(t){mg(t).each(function(e){t.selection.setRng(e)})},hg=mg,vg=function(e){return go(e)||po(e)},bg=function(e){return z($(e.selection.getSelectedBlocks(),rr.fromDom),function(e){return!vg(e)&&!Ir(e).map(vg).getOr(!1)})},yg=function(e,t){var n=e.settings,r=e.dom,o=e.selection,i=e.formatter,a=/[a-z%]+$/i.exec(n.indentation)[0],u=parseInt(n.indentation,10),s=e.getParam("indent_use_margin",!1);e.queryCommandState("InsertUnorderedList")||e.queryCommandState("InsertOrderedList")||n.forced_root_block||r.getParent(o.getNode(),r.isBlock)||i.apply("div"),F(bg(e),function(e){!function(e
,t,n,r,o,i){if("false"!==e.getContentEditable(i)){var a=n?"margin":"padding";if(a="TABLE"===i.nodeName?"margin":a,a+="rtl"===e.getStyle(i,"direction",!0)?"Right":"Left","outdent"===t){var u=Math.max(0,parseInt(i.style[a]||0,10)-r);e.setStyle(i,a,u?u+o:"")}else u=parseInt(i.style[a]||0,10)+r+o,e.setStyle(i,a,u)}}(r,t,s,u,a,e.dom())})},Cg=Yt.each,xg=Yt.extend,wg=Yt.map,Ng=Yt.inArray;function Eg(s){var o,i,a,t,c={state:{},exec:{},value:{}},n=s.settings;s.on("PreInit",function(){o=s.dom,i=s.selection,n=s.settings,a=s.formatter});var r=function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=c.state[e])return t(e);try{return s.getDoc().queryCommandState(e)}catch(n){}return!1}},e=function(e,n){n=n||"exec",Cg(e,function(t,e){Cg(e.toLowerCase().split(","),function(e){c[n][e]=t})})},u=function(e,t,n){e=e.toLowerCase(),c.value
[e]=function(){return t.call(n||s)}};xg(this,{execCommand:function(t,n,r,e){var o,i,a=!1;if(!s.removed){if(/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(t)||e&&e.skip_focus?pg(s):s.focus(),(e=s.fire("BeforeExecCommand",{command:t,ui:n,value:r})).isDefaultPrevented())return!1;if(i=t.toLowerCase(),o=c.exec[i])return o(i,n,r),s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;if(Cg(s.plugins,function(e){if(e.execCommand&&e.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!(a=!0)}),a)return a;if(s.theme&&s.theme.execCommand&&s.theme.execCommand(t,n,r))return s.fire("ExecCommand",{command:t,ui:n,value:r}),!0;try{a=s.getDoc().execCommand(t,n,r)}catch(u){}return!!a&&(s.fire("ExecCommand",{command:t,ui:n,value:r}),!0)}},queryCommandState:r,queryCommandValue:function(e){var t;if(!s.quirks.isHidden()&&!s.removed){if(e=e.toLowerCase(),t=c.value[e])r
eturn t(e);try{return s.getDoc().queryCommandValue(e)}catch(n){}}},queryCommandSupported:function(e){if(e=e.toLowerCase(),c.exec[e])return!0;try{return s.getDoc().queryCommandSupported(e)}catch(t){}return!1},addCommands:e,addCommand:function(e,o,i){e=e.toLowerCase(),c.exec[e]=function(e,t,n,r){return o.call(i||s,t,n,r)}},addQueryStateHandler:function(e,t,n){e=e.toLowerCase(),c.state[e]=function(){return t.call(n||s)}},addQueryValueHandler:u,hasCustomCommand:function(e){return e=e.toLowerCase(),!!c.exec[e]}});var l=function(e,t,n){return t===undefined&&(t=!1),n===undefined&&(n=null),s.getDoc().execCommand(e,t,n)},f=function(e){return a.match(e)},d=function(e,t){a.toggle(e,t?{value:t}:undefined),s.nodeChanged()},m=function(e){t=i.getBookmark(e)},g=function(){i.moveToBookmark(t)};e({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){s.undoManager.add()},"Cut,Copy,Paste":function(e){var t,n=s.get
Doc();try{l(e)}catch(o){t=!0}if("paste"!==e||n.queryCommandEnabled(e)||(t=!0),t||!n.queryCommandSupported(e)){var r=s.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");de.mac&&(r=r.replace(/Ctrl\+/g,"\u2318+")),s.notificationManager.open({text:r,type:"error"})}},unlink:function(){if(i.isCollapsed()){var e=s.dom.getParent(s.selection.getStart(),"a");e&&s.dom.remove(e,!0)}else a.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone":function(e){var t=e.substring(7);"full"===t&&(t="justify"),Cg("left,center,right,justify".split(","),function(e){t!==e&&a.remove("align"+e)}),"none"!==t&&d("align"+t)},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;l(e),(t=o.getParent(i.getNode(),"ol
,ul"))&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(m(),o.split(n,t),g()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){d(e)},"ForeColor,HiliteColor":function(e,t,n){d(e,n)},FontName:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontname",{value:Lm(r,o)}),r.nodeChanged()},FontSize:function(e,t,n){var r,o;o=n,(r=s).formatter.toggle("fontsize",{value:Lm(r,o)}),r.nodeChanged()},RemoveFormat:function(e){a.remove(e)},mceBlockQuote:function(){d("blockquote")},FormatBlock:function(e,t,n){return d(n||"p")},mceCleanup:function(){var e=i.getBookmark();s.setContent(s.getContent()),i.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var r=n||i.getNode();r!==s.getBody()&&(m(),s.dom.remove(r,!0),g())},mceSelectNodeDepth:function(e,t,n){var r=0;o.getParent(i.getNode(),function(e){if(1===e.nodeType&&r++===n)return i.select(e),!1},s.getBody())},mceSelect
Node:function(e,t,n){i.select(n)},mceInsertContent:function(e,t,n){cl(s,n)},mceInsertRawHTML:function(e,t,n){i.setContent("tiny_mce_marker");var r=s.getContent();s.setContent(r.replace(/tiny_mce_marker/g,function(){return n}))},mceToggleFormat:function(e,t,n){d(n)},mceSetContent:function(e,t,n){s.setContent(n)},"Indent,Outdent":function(e){yg(s,e)},mceRepaint:function(){},InsertHorizontalRule:function(){s.execCommand("mceInsertContent",!1,"<hr />")},mceToggleVisualAid:function(){s.hasVisual=!s.hasVisual,s.addVisual()},mceReplaceContent:function(e,t,n){s.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=o.getParent(i.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||a.remove("link"),n.href&&a.apply("link",n,r)},s
electAll:function(){var e=o.getParent(i.getStart(),_o.isContentEditableTrue);if(e){var t=o.createRng();t.selectNodeContents(e),i.setRng(t)}},"delete":function(){rm(s)},forwardDelete:function(){om(s)},mceNewDocument:function(){s.setContent("")},InsertLineBreak:function(e,t,n){return Zm(s,n),!0}});var p=function(n){return function(){var e=i.isCollapsed()?[o.getParent(i.getNode(),o.isBlock)]:i.getSelectedBlocks(),t=wg(e,function(e){return!!a.matchNode(e,n)});return-1!==Ng(t,!0)}};e({JustifyLeft:p("alignleft"),JustifyCenter:p("aligncenter"),JustifyRight:p("alignright"),JustifyFull:p("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return f(e)},mceBlockQuote:function(){return f("blockquote")},Outdent:function(){var e;if(n.inline_styles){if((e=o.getParent(i.getStart(),o.isBlock))&&0<parseInt(e.style.paddingLeft,10))return!0;if((e=o.getParent(i.getEnd(),o.isBloc
k))&&0<parseInt(e.style.paddingLeft,10))return!0}return r("InsertUnorderedList")||r("InsertOrderedList")||!n.inline_styles&&!!o.getParent(i.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=o.getParent(i.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),e({Undo:function(){s.undoManager.undo()},Redo:function(){s.undoManager.redo()}}),u("FontName",function(){return Pm(t=s).fold(function(){return Om(t).map(function(e){return Bm.getFontFamily(t.getBody(),e)}).getOr("")},function(e){return Bm.getFontFamily(t.getBody(),e)});var t},this),u("FontSize",function(){return Pm(t=s).fold(function(){return Om(t).map(function(e){return Bm.getFontSize(t.getBody(),e)}).getOr("")},function(e){return Bm.getFontSi
ze(t.getBody(),e)});var t},this)}var Sg=Yt.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend"," "),kg=function(a){var u,s,c=this,l={},f=function(){return!1},d=function(){return!0};u=(a=a||{}).scope||c,s=a.toggleEvent||f;var r=function(e,t,n,r){var o,i,a;if(!1===t&&(t=f),t)for(t={func:t},r&&Yt.extend(t,r),a=(i=e.toLowerCase().split(" ")).length;a--;)e=i[a],(o=l[e])||(o=l[e]=[],s(e,!0)),n?o.unshift(t):o.push(t);return c},m=function(e,t){var n,r,o,i,a;if(e)for(n=(i=e.toLowerCase().split(" ")).length;n--;){if(e=i[n],r=l[e],!e){for(o in l)s(o,!1),delete l[o];return c}if(r){if(t)for(a=r.length;a--;)r[a].func===t&&(r=r.slice(0
,a).concat(r.slice(a+1)),l[e]=r);else r.length=0;r.length||(s(e,!1),delete l[e])}}else{for(e in l)s(e,!1);l={}}return c};c.fire=function(e,t){var n,r,o,i;if(e=e.toLowerCase(),(t=t||{}).type=e,t.target||(t.target=u),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=d},t.stopPropagation=function(){t.isPropagationStopped=d},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=d},t.isDefaultPrevented=f,t.isPropagationStopped=f,t.isImmediatePropagationStopped=f),a.beforeFire&&a.beforeFire(t),n=l[e])for(r=0,o=n.length;r<o;r++){if((i=n[r]).once&&m(e,i.func),t.isImmediatePropagationStopped())return t.stopPropagation(),t;if(!1===i.func.call(u,t))return t.preventDefault(),t}return t},c.on=r,c.off=m,c.once=function(e,t,n){return r(e,t,n,{once:!0})},c.has=function(e){return e=e.toLowerCase(),!(!l[e]||0===l[e].length)}};kg.isNative=function(e){return!!Sg[e.toLowerCase()]};var Tg,Ag=function(n){return n._eventDispatcher||(n._eventDispatcher=ne
w kg({scope:n,toggleEvent:function(e,t){kg.isNative(e)&&n.toggleNativeEvent&&n.toggleNativeEvent(e,t)}})),n._eventDispatcher},Rg={fire:function(e,t,n){if(this.removed&&"remove"!==e)return t;if(t=Ag(this).fire(e,t,n),!1!==n&&this.parent)for(var r=this.parent();r&&!t.isPropagationStopped();)r.fire(e,t,!1),r=r.parent();return t},on:function(e,t,n){return Ag(this).on(e,t,n)},off:function(e,t){return Ag(this).off(e,t)},once:function(e,t){return Ag(this).once(e,t)},hasEventListeners:function(e){return Ag(this).has(e)}},_g=function(e,t){return e.fire("PreProcess",t)},Dg=function(e,t){return e.fire("PostProcess",t)},Bg=function(e){return e.fire("remove")},Og=function(e,t){return e.fire("SwitchMode",{mode:t})},Pg=function(e,t,n,r){e.fire("ObjectResizeStart",{target:t,width:n,height:r})},Lg=function(e,t,n,r){e.fire("ObjectResized",{target:t,width:n,height:r})},Ig=function(e,t,n){try{e
.getDoc().execCommand(t,!1,n)}catch(r){}},Mg=function(e,t,n){var r,o;zi(e,t)&&!1===n?(o=t,Pi(r=e)?r.dom().classList.remove(o):Ii(r,o),Fi(r)):n&&Mi(e,t)},Fg=function(e,t){Mg(rr.fromDom(e.getBody()),"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e.readonly=!0,e.getBody().contentEditable="false"):(e.readonly=!1,e.getBody().contentEditable="true",Ig(e,"StyleWithCSS",!1),Ig(e,"enableInlineTableEditing",!1),Ig(e,"enableObjectResizing",!1),e.focus(),e.nodeChanged())},zg=function(e){return e.readonly?"readonly":"design"},Ug=gi.DOM,Vg=function(e,t){return"selectionchange"===t?e.getDoc():!e.inline&&/^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(t)?e.getDoc().documentElement:e.settings.event_root?(e.eventRoot||(e.eventRoot=Ug.select(e.settings.event_root)[0]),e.eventRoot):e.getBody()},Hg=function(e,t,n){var r;(r=e).hidden||r.readonly?!0===e.
readonly&&n.preventDefault():e.fire(t,n)},jg=function(i,a){var e,t;if(i.delegates||(i.delegates={}),!i.delegates[a]&&!i.removed)if(e=Vg(i,a),i.settings.event_root){if(Tg||(Tg={},i.editorManager.on("removeEditor",function(){var e;if(!i.editorManager.activeEditor&&Tg){for(e in Tg)i.dom.unbind(Vg(i,e));Tg=null}})),Tg[a])return;t=function(e){for(var t=e.target,n=i.editorManager.get(),r=n.length;r--;){var o=n[r].getBody();(o===t||Ug.isChildOf(t,o))&&Hg(n[r],a,e)}},Tg[a]=t,Ug.bind(e,a,t)}else t=function(e){Hg(i,a,e)},Ug.bind(e,a,t),i.delegates[a]=t},qg={bindPendingEventDelegates:function(){var t=this;Yt.each(t._pendingNativeEvents,function(e){jg(t,e)})},toggleNativeEvent:function(e,t){var n=this;"focus"!==e&&"blur"!==e&&(t?n.initialized?jg(n,e):n._pendingNativeEvents?n._pendingNativeEvents.push(e):n._pendingNativeEvents=[e]:n.initialized&&(n.dom.unbind(Vg(n,e),e,n.delegates[e]),delete n.delegates[e]))},u
nbindAllNativeEvents:function(){var e,t=this,n=t.getBody(),r=t.dom;if(t.delegates){for(e in t.delegates)t.dom.unbind(Vg(t,e),e,t.delegates[e]);delete t.delegates}!t.inline&&n&&r&&(n.onload=null,r.unbind(t.getWin()),r.unbind(t.getDoc())),r&&(r.unbind(n),r.unbind(t.getContainer()))}},$g=qg=Yt.extend({},Rg,qg),Wg=Yt.each,Kg=Yt.explode,Xg={f9:120,f10:121,f11:122},Yg=Yt.makeMap("alt,ctrl,shift,meta,access");function Gg(i){var a={},r=[],u=function(e){var t,n,r={};for(n in Wg(Kg(e,"+"),function(e){e in Yg?r[e]=!0:/^[0-9]{2,}$/.test(e)?r.keyCode=parseInt(e,10):(r.charCode=e.charCodeAt(0),r.keyCode=Xg[e]||e.toUpperCase().charCodeAt(0))}),t=[r.keyCode],Yg)r[n]?t.push(n):r[n]=!1;return r.id=t.join(","),r.access&&(r.alt=!0,de.mac?r.ctrl=!0:r.shift=!0),r.meta&&(de.mac?r.meta=!0:(r.ctrl=!0,r.meta=!1)),r},s=function(e,t,n,r){var o;return(o=Yt.map(Kg(e,">"),u))[o.length-1]=Yt.extend(o[o.length-1],{func:n,scop
e:r||i}),Yt.extend(o[0],{desc:i.translate(t),subpatterns:o.slice(1)})},o=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},c=function(e){return e.func?e.func.call(e.scope):null};i.on("keyup keypress keydown",function(t){var e,n;((n=t).altKey||n.ctrlKey||n.metaKey||"keydown"===(e=t).type&&112<=e.keyCode&&e.keyCode<=123)&&!t.isDefaultPrevented()&&(Wg(a,function(e){if(o(t,e))return r=e.subpatterns.slice(0),"keydown"===t.type&&c(e),!0}),o(t,r[0])&&(1===r.length&&"keydown"===t.type&&c(r[0]),r.shift()))}),this.add=function(e,n,r,o){var t;return"string"==typeof(t=r)?r=function(){i.execCommand(t,!1,null)}:Yt.isArray(t)&&(r=function(){i.execCommand(t[0],t[1],t[2])}),Wg(
Kg(Yt.trim(e.toLowerCase())),function(e){var t=s(e,n,r,o);a[t.id]=t}),!0},this.remove=function(e){var t=s(e);return!!a[t.id]&&(delete a[t.id],!0)}}var Jg=function(e){var t=Lr(e).dom();return e.dom()===t.activeElement},Qg=function(t){return(e=Lr(t),n=e!==undefined?e.dom():document,A.from(n.activeElement).map(rr.fromDom)).filter(function(e){return t.dom().contains(e.dom())});var e,n},Zg=function(t,e){return(n=e,n.collapsed?A.from(Va(n.startContainer,n.startOffset)).map(rr.fromDom):A.none()).bind(function(e){return vo(e)?A.some(e):!1===Pr(t,e)?A.some(t):A.none()});var n},ep=function(t,e){Zg(rr.fromDom(t.getBody()),e).bind(function(e){return ic.firstPositionIn(e.dom())}).fold(function(){t.selection.normalize()},function(e){return t.selection.setRng(e.toRange())})},tp=function(e){if(e.setActive)try{e.setActive()}catch(t){e.focus()}else e.focus()},np=function(e){var t,n=e.getBody();return n&&(t=rr.fromDom(n),Jg(t)||Qg(t).isSome())},rp=function(e){return e.inline?np(e):(t=e
).iframeElement&&Jg(rr.fromDom(t.iframeElement));var t},op=function(e){return e.editorManager.setActive(e)},ip=function(e,t){e.removed||(t?op(e):function(t){var e=t.selection,n=t.settings.content_editable,r=t.getBody(),o=e.getRng();t.quirks.refreshContentEditable();var i,a,u=(i=t,a=e.getNode(),i.dom.getParent(a,function(e){return"true"===i.dom.getContentEditable(e)}));if(t.$.contains(r,u))return tp(u),ep(t,o),op(t);t.bookmark!==undefined&&!1===rp(t)&&hg(t).each(function(e){t.selection.setRng(e),o=e}),n||(de.opera||tp(r),t.getWin().focus()),(de.gecko||n)&&(tp(r),ep(t,o)),op(t)}(e))},ap=rp,up=function(e,t){return t.dom()[e]},sp=function(e,t){return parseInt(wr(t,e),10)},cp=d(up,"clientWidth"),lp=d(up,"clientHeight"),fp=d(sp,"margin-top"),dp=d(sp,"margin-left"),mp=function(e,t,n){var r,o,i,a,u,s,c,l,f,d,m,g=rr.fromDom(e.getBody()),p=e.inline?g:(r=g,rr.fromDom(r.dom().ownerDocument.documentElement)),h=(o=e
.inline,a=t,u=n,s=(i=p).dom().getBoundingClientRect(),{x:a-(o?s.left+i.dom().clientLeft+dp(i):0),y:u-(o?s.top+i.dom().clientTop+fp(i):0)});return l=h.x,f=h.y,d=cp(c=p),m=lp(c),0<=l&&0<=f&&l<=d&&f<=m},gp=function(e){var t,n=e.inline?e.getBody():e.getContentAreaContainer();return(t=n,A.from(t).map(rr.fromDom)).map(function(e){return Pr(Lr(e),e)}).getOr(!1)};function pp(n){var t,o=[],i=function(){var e,t=n.theme;return t&&t.getNotificationManagerImpl?t.getNotificationManagerImpl():{open:e=function(){throw new Error("Theme did not provide a NotificationManager implementation.")},close:e,reposition:e,getArgs:e}},a=function(){0<o.length&&i().reposition(o)},u=function(t){K(o,function(e){return e===t}).each(function(e){o.splice(e,1)})},r=function(r){if(!n.removed&&gp(n))return V(o,function(e){return t=i().getArgs(e),n=r,!(t.type!==n.type||t.text!==n.text||t.progressBar||t.timeout||n.progressBar||n.timeout);var t,n}).ge
tOrThunk(function(){n.editorManager.setActive(n);var e,t=i().open(r,function(){u(t),a()});return e=t,o.push(e),a(),t})};return(t=n).on("SkinLoaded",function(){var e=t.settings.service_message;e&&r({text:e,type:"warning",timeout:0,icon:""})}),t.on("ResizeEditor ResizeWindow",function(){ve.requestAnimationFrame(a)}),t.on("remove",function(){F(o.slice(),function(e){i().close(e)})}),{open:r,close:function(){A.from(o[0]).each(function(e){i().close(e),u(e),a()})},getNotifications:function(){return o}}}function hp(r){var o=[],i=function(){var e,t=r.theme;return t&&t.getWindowManagerImpl?t.getWindowManagerImpl():{open:e=function(){throw new Error("Theme did not provide a WindowManager implementation.")},alert:e,confirm:e,close:e,getParams:e,setParams:e}},a=function(e,t){return function(){return t?t.apply(e,arguments):undefined}},u=function(e){var t;o.push(e),t=e,r.fire("OpenWindow",{win:t})},s=function(n){
K(o,function(e){return e===n}).each(function(e){var t;o.splice(e,1),t=n,r.fire("CloseWindow",{win:t}),0===o.length&&r.focus()})},e=function(){return A.from(o[o.length-1])};return r.on("remove",function(){F(o.slice(0),function(e){i().close(e)})}),{windows:o,open:function(e,t){r.editorManager.setActive(r),gg(r);var n=i().open(e,t,s);return u(n),n},alert:function(e,t,n){var r=i().alert(e,a(n||this,t),s);u(r)},confirm:function(e,t,n){var r=i().confirm(e,a(n||this,t),s);u(r)},close:function(){e().each(function(e){i().close(e),s(e)})},getParams:function(){return e().map(i().getParams).getOr(null)},setParams:function(t){e().each(function(e){i().setParams(e,t)})},getWindows:function(){return o}}}var vp=wi.PluginManager,bp=function(e,t){var n=function(e,t){for(var n in vp.urls)if(vp.urls[n]+"/plugin"+t+".js"===e)return n;return null}(t,e.suffix);return n?"Failed to load plugin: "+n+" from url "+t:"Failed to load plugin
url: "+t},yp=function(e,t){e.notificationManager.open({type:"error",text:t})},Cp=function(e,t){e._skinLoaded?yp(e,t):e.on("SkinLoaded",function(){yp(e,t)})},xp=function(e,t){Cp(e,bp(e,t))},wp=function(e,t){Cp(e,"Failed to upload image: "+t)},Np=Cp,Ep=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=window.console;r&&(r.error?r.error.apply(r,arguments):r.log.apply(r,arguments))},Sp=wi.PluginManager,kp=wi.ThemeManager;function Tp(){return new(ie.getOrDie("XMLHttpRequest"))}function Ap(u,s){var r={},n=function(e,r,o,t){var i,n;(i=Tp()).open("POST",s.url),i.withCredentials=s.credentials,i.upload.onprogress=function(e){t(e.loaded/e.total*100)},i.onerror=function(){o("Image upload failed due to a XHR Transport error. Code: "+i.status)},i.onload=function(){var e,t,n;i.status<200||300<=i.status?o("HTTP Error: "+i.status):(e=JSON.parse(i.responseText))&&"strin
g"==typeof e.location?r((t=s.basePath,n=e.location,t?t.replace(/\/$/,"")+"/"+n.replace(/^\//,""):n)):o("Invalid JSON: "+i.responseText)},(n=new FormData).append("file",e.blob(),e.filename()),i.send(n)},c=function(e,t){return{url:t,blobInfo:e,status:!0}},l=function(e,t){return{url:"",blobInfo:e,status:!1,error:t}},f=function(e,t){Yt.each(r[e],function(e){e(t)}),delete r[e]},o=function(e,n){return e=Yt.grep(e,function(e){return!u.isUploaded(e.blobUri())}),me.all(Yt.map(e,function(e){return u.isPending(e.blobUri())?(t=e.blobUri(),new me(function(e){r[t]=r[t]||[],r[t].push(e)})):(o=e,i=s.handler,a=n,u.markPending(o.blobUri()),new me(function(t){var n;try{var r=function(){n&&n.close()};i(o,function(e){r(),u.markUploaded(o.blobUri(),e),f(o.blobUri(),c(o,e)),t(c(o,e))},function(e){r(),u.removeFailed(o.blobUri()),f(o.blobUri(),l(o,e)),t(l(o,e))},function(e){e<0||100<e||(n||(n=a()),n.progressBar.value(e))})}catch(
e){t(l(o,e.message))}}));var o,i,a,t}))};return!1===P(s.handler)&&(s.handler=n),{upload:function(e,t){return s.url||s.handler!==n?o(e,t):new me(function(e){e([])})}}}var Rp=function(e){return ie.getOrDie("atob")(e)},_p=function(e){var t,n,r=decodeURIComponent(e).split(",");return(n=/data:([^;]+)/.exec(r[0]))&&(t=n[1]),{type:t,data:r[1]}},Dp=function(a){return new me(function(e){var t,n,r,o,i=_p(a);try{t=Rp(i.data)}catch(LN){return void e(new Blob([]))}for(o=t.length,n=new(ie.getOrDie("Uint8Array"))(o),r=0;r<n.length;r++)n[r]=t.charCodeAt(r);e(new Blob([n],{type:i.type}))})},Bp=function(e){return 0===e.indexOf("blob:")?(i=e,new me(function(e,t){var n=function(){t("Cannot convert "+i+" to Blob. Resource might not exist or is inaccessible.")};try{var r=Tp();r.open("GET",i,!0),r.responseType="blob",r.onload=function(){200===this.status?e(this.response):n()},r.onerror=n,r.send()}catch(o){n(
)}})):0===e.indexOf("data:")?Dp(e):null;var i},Op=function(n){return new me(function(e){var t=new(ie.getOrDie("FileReader"));t.onloadend=function(){e(t.result)},t.readAsDataURL(n)})},Pp=_p,Lp=0,Ip=function(e){return(e||"blobid")+Lp++},Mp=function(n,r,o,t){var i,a;0!==r.src.indexOf("blob:")?(i=Pp(r.src).data,(a=n.findFirst(function(e){return e.base64()===i}))?o({image:r,blobInfo:a}):Bp(r.src).then(function(e){a=n.create(Ip(),e,i),n.add(a),o({image:r,blobInfo:a})},function(e){t(e)})):(a=n.getByUri(r.src))?o({image:r,blobInfo:a}):Bp(r.src).then(function(t){Op(t).then(function(e){i=Pp(e).data,a=n.create(Ip(),t,i),n.add(a),o({image:r,blobInfo:a})})},function(e){t(e)})},Fp=function(e){return e?ne(e.getElementsByTagName("img")):[]},zp=0,Up={uuid:function(e){return e+zp+++(t=function(){return Math.round(4294967295*Math.random()).toString(36)},"s"+(new Date).getTime().toString(36)+t()+t()+t());var t}};function Vp(u){var n,o,t,e,i,r,
a,s,c,l=(n=[],o=function(e){var t,n,r;if(!e.blob||!e.base64)throw new Error("blob and base64 representations of the image are required for BlobInfo to be created");return t=e.id||Up.uuid("blobid"),n=e.name||t,{id:j(t),name:j(n),filename:j(n+"."+(r=e.blob.type,{"image/jpeg":"jpg","image/jpg":"jpg","image/gif":"gif","image/png":"png"}[r.toLowerCase()]||"dat")),blob:j(e.blob),base64:j(e.base64),blobUri:j(e.blobUri||ue.createObjectURL(e.blob)),uri:j(e.uri)}},{create:function(e,t,n,r){if(R(e))return o({id:e,name:r,blob:t,base64:n});if(_(e))return o(e);throw new Error("Unknown input type")},add:function(e){t(e.id())||n.push(e)},get:t=function(t){return e(function(e){return e.id()===t})},getByUri:function(t){return e(function(e){return e.blobUri()===t})},findFirst:e=function(e){return z(n,e)[0]},removeByUri:function(t){n=z(n,function(e){return e.blobUri()!==t||(
ue.revokeObjectURL(e.blobUri()),!1)})},destroy:function(){F(n,function(e){ue.revokeObjectURL(e.blobUri())}),n=[]}}),f=(a={},s=function(e,t){return{status:e,resultUri:t}},{hasBlobUri:c=function(e){return e in a},getResultUri:function(e){var t=a[e];return t?t.resultUri:null},isPending:function(e){return!!c(e)&&1===a[e].status},isUploaded:function(e){return!!c(e)&&2===a[e].status},markPending:function(e){a[e]=s(1,null)},markUploaded:function(e,t){a[e]=s(2,t)},removeFailed:function(e){delete a[e]},destroy:function(){a={}}}),d=[],m=function(t){return function(e){return u.selection?t(e):[]}},g=function(e,t,n){for(var r=0;-1!==(r=e.indexOf(t,r))&&(e=e.substring(0,r)+n+e.substr(r+t.length),r+=n.length-t.length+1),-1!==r;);return e},p=function(e,t,n){return e=g(e,'src="'+t+'"','src="'+n+'"'),e=g(e,'data-mce-src="'+t+'"','data-mce-src="'+n+'"')},h=function(t,n){F(u.undoManager.data,function(e){"fragmented"===e.type?e.fr
agments=$(e.fragments,function(e){return p(e,t,n)}):e.content=p(e.content,t,n)})},v=function(){return u.notificationManager.open({text:u.translate("Image uploading..."),type:"info",timeout:-1,progressBar:!0})},b=function(e,t){l.removeByUri(e.src),h(e.src,t),u.$(e).attr({src:Nm(u)?t+"?"+(new Date).getTime():t,"data-mce-src":u.convertURL(t,"src")})},y=function(n){return i||(i=Ap(f,{url:Sm(u),basePath:km(u),credentials:Tm(u),handler:Am(u)})),w().then(m(function(r){var e;return e=$(r,function(e){return e.blobInfo}),i.upload(e,v).then(m(function(e){var t=$(e,function(e,t){var n=r[t].image;return e.status&&Em(u)?b(n,e.url):e.error&&wp(u,e.error),{element:n,status:e.status}});return n&&n(t),t}))}))},C=function(e){if(wm(u))return y(e)},x=function(t){return!1!==J(d,function(e){return e(t)})&&(0!==t.getAttribute("src").indexOf("data:")||xm(u)(t))},w=function(){var o,i,a;return r||(o=f,i=l,a={
},r={findAll:function(e,n){var t;n||(n=j(!0)),t=z(Fp(e),function(e){var t=e.src;return!!de.fileApi&&!e.hasAttribute("data-mce-bogus")&&!e.hasAttribute("data-mce-placeholder")&&!(!t||t===de.transparentSrc)&&(0===t.indexOf("blob:")?!o.isUploaded(t)&&n(e):0===t.indexOf("data:")&&n(e))});var r=$(t,function(n){if(a[n.src])return new me(function(t){a[n.src].then(function(e){if("string"==typeof e)return e;t({image:n,blobInfo:e.blobInfo})})});var e=new me(function(e,t){Mp(i,n,e,t)}).then(function(e){return delete a[e.image.src],e})["catch"](function(e){return delete a[n.src],e});return a[n.src]=e});return me.all(r)}}),r.findAll(u.getBody(),x).then(m(function(e){return e=z(e,function(e){return"string"!=typeof e||(Np(u,e),!1)}),F(e,function(e){h(e.image.src,e.blobInfo.blobUri()),e.image.src=e.blobInfo.blobUri(),e.image.removeAttribute("data-mce-src")}),e}))},N=functi
on(e){return e.replace(/src="(blob:[^"]+)"/g,function(e,n){var t=f.getResultUri(n);if(t)return'src="'+t+'"';var r=l.getByUri(n);return r||(r=U(u.editorManager.get(),function(e,t){return e||t.editorUpload&&t.editorUpload.blobCache.getByUri(n)},null)),r?'src="data:'+r.blob().type+";base64,"+r.base64()+'"':e})};return u.on("setContent",function(){wm(u)?C():w()}),u.on("RawSaveContent",function(e){e.content=N(e.content)}),u.on("getContent",function(e){e.source_view||"raw"===e.format||(e.content=N(e.content))}),u.on("PostRender",function(){u.parser.addNodeFilter("img",function(e){F(e,function(e){var t=e.attr("src");if(!l.getByUri(t)){var n=f.getResultUri(t);n&&e.attr("src",n)}})})}),{blobCache:l,addFilter:function(e){d.push(e)},uploadImages:y,uploadImagesAuto:C,scanForImages:w,destroy:function(){l.destroy(),f.destroy(),r=i=null}}}var Hp=function(e,t)
{return e.hasOwnProperty(t.nodeName)},jp=function(t,e,n){return r=Vl(rr.fromDom(n),rr.fromDom(e)),K(r,function(e){return Hp(t,e.dom())}).isSome();var r},qp=function(e,t){if(_o.isText(t)){if(0===t.nodeValue.length)return!0;if(/^\s+$/.test(t.nodeValue)&&(!t.nextSibling||Hp(e,t.nextSibling)))return!0}return!1},$p=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.dom,g=e.selection,p=e.schema,h=p.getBlockElements(),v=g.getStart(),b=e.getBody();if(f=d.forced_root_block,v&&_o.isElement(v)&&f&&(l=b.nodeName.toLowerCase(),p.isValidChild(l,f.toLowerCase())&&!jp(h,b,v))){for(n=(t=g.getRng()).startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,c=ap(e),v=b.firstChild;v;)if(y=h,C=v,_o.isText(C)||_o.isElement(C)&&!Hp(y,C)&&!pc(C)){if(qp(h,v)){v=(u=v).nextSibling,m.remove(u);continue}a||(a=m.create(f,e.settings.forced_root_block_attrs),v.parentNode.insertBefore(a,v),s=!0),v=(u=v).nextSibling,a.appendChild(u)}else a=null,v=v.next
Sibling;var y,C;s&&c&&(t.setStart(n,r),t.setEnd(o,i),g.setRng(t),e.nodeChanged())}},Wp=function(e){e.settings.forced_root_block&&e.on("NodeChange",d($p,e))},Kp=function(t){return jr(t).fold(j([t]),function(e){return[t].concat(Kp(e))})},Xp=function(t){return qr(t).fold(j([t]),function(e){return"br"===ur(e)?Mr(e).map(function(e){return[t].concat(Xp(e))}).getOr([]):[t].concat(Xp(e))})},Yp=function(o,e){return qa([(i=e,a=i.startContainer,u=i.startOffset,_o.isText(a)?0===u?A.some(rr.fromDom(a)):A.none():A.from(a.childNodes[u]).map(rr.fromDom)),(t=e,n=t.endContainer,r=t.endOffset,_o.isText(n)?r===n.data.length?A.some(rr.fromDom(n)):A.none():A.from(n.childNodes[r-1]).map(rr.fromDom))],function(e,t){var n=V(Kp(o),d(Or,e)),r=V(Xp(o),d(Or,t));return n.isSome()&&r.isSome()}).getOr(!1);var t,n,r,i,a,u},Gp=function(e,t,n,r){var o=n,i=new ro(n,o),a=e.schema.getNonEmptyElements();do{if(3===n.nodeType&&0!==Yt.trim(n.nodeValue).length)retur
n void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(a[n.nodeName]&&!/^(TD|TH)$/.test(n.nodeName))return void(r?t.setStartBefore(n):"BR"===n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(de.ie&&de.ie<11&&e.isBlock(n)&&e.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?i.next():i.prev());"BODY"===o.nodeName&&(r?t.setStart(o,0):t.setEnd(o,o.childNodes.length))},Jp=function(e){var t=e.selection.getSel();return t&&0<t.rangeCount};function Qp(i){var r,o=[];"onselectionchange"in i.getDoc()||i.on("NodeChange Click MouseUp KeyUp Focus",function(e){var t,n;n={startContainer:(t=i.selection.getRng()).startContainer,startOffset:t.startOffset,endContainer:t.endContainer,endOffset:t.endOffset},"nodechange"!==e.type&&Im(n,r)||i.fire("SelectionChange"),r=n}),i.on("contextmenu",function(){i.fire("SelectionChange")}),i.on("Selecti
onChange",function(){var e=i.selection.getStart(!0);!e||!de.range&&i.selection.isCollapsed()||Jp(i)&&!function(e){var t,n;if((n=i.$(e).parentsUntil(i.getBody()).add(e)).length===o.length){for(t=n.length;0<=t&&n[t]===o[t];t--);if(-1===t)return o=n,!0}return o=n,!1}(e)&&i.dom.isChildOf(e,i.getBody())&&i.nodeChanged({selectionChange:!0})}),i.on("MouseUp",function(e){!e.isDefaultPrevented()&&Jp(i)&&("IMG"===i.selection.getNode().nodeName?ve.setEditorTimeout(i,function(){i.nodeChanged()}):i.nodeChanged())}),this.nodeChanged=function(e){var t,n,r,o=i.selection;i.initialized&&o&&!i.settings.disable_nodechange&&!i.readonly&&(r=i.getBody(),(t=o.getStart(!0)||r).ownerDocument===i.getDoc()&&i.dom.isChildOf(t,r)||(t=r),n=[],i.dom.getParent(t,function(e){if(e===r)return!0;n.push(e)}),(e=e||{}).element=t,e.parents=n,i.fire("NodeChange",e))}}var Zp,eh,th=function(e)
{var t,n,r,o;return o=e.getBoundingClientRect(),n=(t=e.ownerDocument).documentElement,r=t.defaultView,{top:o.top+r.pageYOffset-n.clientTop,left:o.left+r.pageXOffset-n.clientLeft}},nh=function(e,t){return n=(u=e).inline?th(u.getBody()):{left:0,top:0},a=(i=e).getBody(),r=i.inline?{left:a.scrollLeft,top:a.scrollTop}:{left:0,top:0},{pageX:(o=function(e,t){if(t.target.ownerDocument!==e.getDoc()){var n=th(e.getContentAreaContainer()),r=(i=(o=e).getBody(),a=o.getDoc().documentElement,u={left:i.scrollLeft,top:i.scrollTop},s={left:i.scrollLeft||a.scrollLeft,top:i.scrollTop||a.scrollTop},o.inline?u:s);return{left:t.pageX-n.left+r.left,top:t.pageY-n.top+r.top}}var o,i,a,u,s;return{left:t.pageX,top:t.pageY}}(e,t)).left-n.left+r.left,pageY:o.top-n.top+r.top};var n,r,o,i,a,u},rh=_o.isContentEditableFalse,oh=_o.isContentEditableTrue,ih=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},ah=function(u,s){return function(e){if(0===e.button){var t=V(s.dom.getParents(e.target),Ka
(rh,oh)).getOr(null);if(i=s.getBody(),rh(a=t)&&a!==i){var n=s.dom.getPos(t),r=s.getBody(),o=s.getDoc().documentElement;u.element=t,u.screenX=e.screenX,u.screenY=e.screenY,u.maxX=(s.inline?r.scrollWidth:o.offsetWidth)-2,u.maxY=(s.inline?r.scrollHeight:o.offsetHeight)-2,u.relX=e.pageX-n.x,u.relY=e.pageY-n.y,u.width=t.offsetWidth,u.height=t.offsetHeight,u.ghost=function(e,t,n,r){var o=t.cloneNode(!0);e.dom.setStyles(o,{width:n,height:r}),e.dom.setAttrib(o,"data-mce-selected",null);var i=e.dom.create("div",{"class":"mce-drag-container","data-mce-bogus":"all",unselectable:"on",contenteditable:"false"});return e.dom.setStyles(i,{position:"absolute",opacity:.5,overflow:"hidden",border:0,padding:0,margin:0,width:n,height:r}),e.dom.setStyles(o,{margin:0,boxSizing:"border-box"}),i.appendChild(o),i}(s,t,u.width,u.height)}}var i,a}},uh=function(l,f){return function(e){if(l.dragg
ing&&(s=(i=f).selection,c=s.getSel().getRangeAt(0).startContainer,a=3===c.nodeType?c.parentNode:c,u=l.element,a!==u&&!i.dom.isChildOf(a,u)&&!rh(a))){var t=(r=l.element,(o=r.cloneNode(!0)).removeAttribute("data-mce-selected"),o),n=f.fire("drop",{targetClone:t,clientX:e.clientX,clientY:e.clientY});n.isDefaultPrevented()||(t=n.targetClone,f.undoManager.transact(function(){ih(l.element),f.insertContent(f.dom.getOuterHTML(t)),f._selectionOverrides.hideFakeCaret()}))}var r,o,i,a,u,s,c;sh(l)}},sh=function(e){e.dragging=!1,e.element=null,ih(e.ghost)},ch=function(e){var t,n,r,o,i,a,p,h,v,u,s,c={};t=gi.DOM,a=document,n=ah(c,e),p=c,h=e,v=ve.throttle(function(e,t){h._selectionOverrides.hideFakeCaret(),h.selection.placeCaretAt(e,t)},0),r=function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m=Math.max(Math.abs(e.screenX-p.screenX),Math.abs(e.screenY-p.screenY));if(p.element&&!p.dragging&&10<m){if(h.fire("dragstart",{target:p.element}).is
DefaultPrevented())return;p.dragging=!0,h.focus()}if(p.dragging){var g=(f=p,{pageX:(d=nh(h,e)).pageX-f.relX,pageY:d.pageY+5});c=p.ghost,l=h.getBody(),c.parentNode!==l&&l.appendChild(c),t=p.ghost,n=g,r=p.width,o=p.height,i=p.maxX,a=p.maxY,s=u=0,t.style.left=n.pageX+"px",t.style.top=n.pageY+"px",n.pageX+r>i&&(u=n.pageX+r-i),n.pageY+o>a&&(s=n.pageY+o-a),t.style.width=r-u+"px",t.style.height=o-s+"px",v(e.clientX,e.clientY)}},o=uh(c,e),u=c,i=function(){u.dragging&&s.fire("dragend"),sh(u)},(s=e).on("mousedown",n),e.on("mousemove",r),e.on("mouseup",o),t.bind(a,"mousemove",r),t.bind(a,"mouseup",i),e.on("remove",function(){t.unbind(a,"mousemove",r),t.unbind(a,"mouseup",i)})},lh=function(e){var n;ch(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.cli
entY):null;(rh(t)||rh(n.dom.getContentEditableParent(t)))&&e.preventDefault()})},fh=function(e){return U(e,function(e,t){return e.concat(function(t){var e=function(e){return $(e,function(e){return(e=La(e)).node=t,e})};if(_o.isElement(t))return e(t.getClientRects());if(_o.isText(t)){var n=t.ownerDocument.createRange();return n.setStart(t,0),n.setEnd(t,t.data.length),e(n.getClientRects())}}(t))},[])};(eh=Zp||(Zp={}))[eh.Up=-1]="Up",eh[eh.Down=1]="Down";var dh=function(o,i,a,e,u,t){var n,s,c=0,l=[],r=function(e){var t,n,r;for(r=fh([e]),-1===o&&(r=r.reverse()),t=0;t<r.length;t++)if(n=r[t],!a(n,s)){if(0<l.length&&i(n,qt.last(l))&&c++,n.line=c,u(n))return!0;l.push(n)}};return(s=qt.last(t.getClientRects()))&&(r(n=t.getNode()),function(e,t,n,r){for(;r=gs(r,e,Oa,t);)if(n(r))return}(o,e,r,n)),l},mh=d(dh,Zp.Up,Fa,za),gh=d(dh,Zp.Down,za,Fa),ph=function(n){return function(e){return t=n,e.line>t;var t}},hh=function(n){return fun
ction(e){return t=n,e.line===t;var t}},vh=_o.isContentEditableFalse,bh=gs,yh=function(e,t){return Math.abs(e.left-t)},Ch=function(e,t){return Math.abs(e.right-t)},xh=function(e,t){return e>=t.left&&e<=t.right},wh=function(e,o){return qt.reduce(e,function(e,t){var n,r;return n=Math.min(yh(e,o),Ch(e,o)),r=Math.min(yh(t,o),Ch(t,o)),xh(o,t)?t:xh(o,e)?e:r===n&&vh(t.node)?t:r<n?t:e})},Nh=function(e,t,n,r){for(;r=bh(r,e,Oa,t);)if(n(r))return},Eh=function(e,t,n){var r,o,i,a,u,s,c,l=fh(z(ne(e.getElementsByTagName("*")),ts)),f=z(l,function(e){return n>=e.top&&n<=e.bottom});return(r=wh(f,t))&&(r=wh((a=e,c=function(t,e){var n;return n=z(fh([e]),function(e){return!t(e,u)}),s=s.concat(n),0===n.length},(s=[]).push(u=r),Nh(Zp.Up,a,d(c,Fa),u.node),Nh(Zp.Down,a,d(c,za),u.node),s),t))&&ts(r.node)?(i=t,{node:(o=r).node,before:yh(o,i)<Ch(o,i)}):null},Sh=function(i,a,e){return!e.collapsed&&U(e.getClientRects(),function(e,t){retur
n e||(o=a,(r=i)>=(n=t).left&&r<=n.right&&o>=n.top&&o<=n.bottom);var n,r,o},!1)},kh=_o.isContentEditableTrue,Th=_o.isContentEditableFalse,Ah=function(e,t,n,r,o){return t._selectionOverrides.showCaret(e,n,r,o)},Rh=function(e,t){var n,r;return e.fire("BeforeObjectSelected",{target:t}).isDefaultPrevented()?null:((r=(n=t).ownerDocument.createRange()).selectNode(n),r)},_h=function(e,t,n){var r=ws(1,e.getBody(),t),o=hu.fromRangeStart(r),i=o.getNode();if(Th(i))return Ah(1,e,i,!o.isAtEnd(),!1);var a=o.getNode(!0);if(Th(a))return Ah(1,e,a,!1,!1);var u=e.dom.getParent(o.getNode(),function(e){return Th(e)||kh(e)});return Th(u)?Ah(1,e,u,!1,n):null},Dh=function(e,t,n){if(!t||!t.collapsed)return t;var r=_h(e,t,n);return r||t},Bh=function(t){var e=Di(function(){if(!t.removed&&t.selection.getRng().collapsed){var e=Dh(t,t.selection.getRng(),!1);t.selection.setRng(e)}},0);t.on("focus",function(){e.throttle()}),t.on("blur",functi
on(){e.cancel()})},Oh={BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey||this.metaKeyPressed(e)},metaKeyPressed:function(e){return de.mac?e.metaKey:e.ctrlKey&&!e.altKey}},Ph=_o.isContentEditableTrue,Lh=_o.isContentEditableFalse,Ih=As,Mh=Ts,Fh=function(e,t){for(var n=e.getBody();t&&t!==n;){if(Ph(t)||Lh(t))return t;t=t.parentNode}return null},zh=function(g){var p,e,t,a=g.getBody(),o=Zu(g.getBody(),function(e){return g.dom.isBlock(e)},function(){return ap(g)}),h="sel-"+g.dom.uniqueId(),u=function(e){e&&g.selection.setRng(e)},s=function(){return g.selection.getRng()},v=function(e,t,n,r){return void 0===r&&(r=!0),g.fire("ShowCaret",{target:t,direction:e,before:n}).isDefaultPrevented()?null:(r&&g.selection.scrollIntoView(t,-1===e),o.show(n,t))},b=function(e,t){return t=ws(e,a,t),-1===e?hu.fromRangeStart(t):hu.fromRangeEnd(t)},n=funct
ion(e){return pa(e)||Ca(e)||xa(e)},y=function(e){return n(e.startContainer)||n(e.endContainer)},c=function(e,t){var n,r,o,i,a,u,s,c,l,f,d=g.$,m=g.dom;if(!e)return null;if(e.collapsed){if(!y(e))if(!1===t){if(c=b(-1,e),ts(c.getNode(!0)))return v(-1,c.getNode(!0),!1,!1);if(ts(c.getNode()))return v(-1,c.getNode(),!c.isAtEnd(),!1)}else{if(c=b(1,e),ts(c.getNode()))return v(1,c.getNode(),!c.isAtEnd(),!1);if(ts(c.getNode(!0)))return v(1,c.getNode(!0),!1,!1)}return null}return i=e.startContainer,a=e.startOffset,u=e.endOffset,3===i.nodeType&&0===a&&Lh(i.parentNode)&&(i=i.parentNode,a=m.nodeIndex(i),i=i.parentNode),1!==i.nodeType?null:(u===a+1&&(n=i.childNodes[a]),Lh(n)?(l=f=n.cloneNode(!0),(s=g.fire("ObjectSelected",{target:n,targetClone:l})).isDefaultPrevented()?null:(r=Ki(rr.fromDom(g.getBody()),"#"+h).fold(function(){return d([])},function(e){return d([e.dom()])}),l=s.targetClone,0===r.length&&(r=d('<div data-mce-bogus="al
l" class="mce-offscreen-selection"></div>').attr("id",h)).appendTo(g.getBody()),e=g.dom.createRng(),l===f&&de.ie?(r.empty().append('<p style="font-size: 0" data-mce-bogus="all">\xa0</p>').append(l),e.setStartAfter(r[0].firstChild.firstChild),e.setEndAfter(l)):(r.empty().append("\xa0").append(l).append("\xa0"),e.setStart(r[0].firstChild,1),e.setEnd(r[0].lastChild,0)),r.css({top:m.getPos(n,g.getBody()).y}),r[0].focus(),(o=g.selection.getSel()).removeAllRanges(),o.addRange(e),F(Vi(rr.fromDom(g.getBody()),"*[data-mce-selected]"),function(e){yr(e,"data-mce-selected")}),n.setAttribute("data-mce-selected","1"),p=n,C(),e)):null)},l=function(){p&&(p.removeAttribute("data-mce-selected"),Ki(rr.fromDom(g.getBody()),"#"+h).each(Ri),p=null),Ki(rr.fromDom(g.getBody()),"#"+h).each(Ri),p=null},C=function(){o.hide()};return de.ceFa
lse&&(function(){g.on("mouseup",function(e){var t=s();t.collapsed&&mp(g,e.clientX,e.clientY)&&u(_h(g,t,!1))}),g.on("click",function(e){var t;(t=Fh(g,e.target))&&(Lh(t)&&(e.preventDefault(),g.focus()),Ph(t)&&g.dom.isChildOf(t,g.selection.getNode())&&l())}),g.on("blur NewBlock",function(){l()}),g.on("ResizeWindow FullscreenStateChanged",function(){return o.reposition()});var n,r,i=function(e,t){var n,r,o=g.dom.getParent(e,g.dom.isBlock),i=g.dom.getParent(t,g.dom.isBlock);return!(!o||!g.dom.isChildOf(o,i)||!1!==Lh(Fh(g,o)))||o&&(n=o,r=i,!(g.dom.getParent(n,g.dom.isBlock)===g.dom.getParent(r,g.dom.isBlock)))&&function(e){var t=Gs(e);if(!e.firstChild)return!1;var n=hu.before(e.firstChild),r=t.next(n);return r&&!Mh(r)&&!Ih(r)}(o)};r=!1,(n=g).on("touchstart",function(){r=!1}),n.on("touchmove",function(){r=!0}),n.on("touchend",function
(e){var t=Fh(n,e.target);Lh(t)&&(r||(e.preventDefault(),c(Rh(n,t))))}),g.on("mousedown",function(e){var t,n=e.target;if((n===a||"HTML"===n.nodeName||g.dom.isChildOf(n,a))&&!1!==mp(g,e.clientX,e.clientY))if(t=Fh(g,n))Lh(t)?(e.preventDefault(),c(Rh(g,t))):(l(),Ph(t)&&e.shiftKey||Sh(e.clientX,e.clientY,g.selection.getRng())||(C(),g.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===ts(n)){l(),C();var r=Eh(a,e.clientX,e.clientY);if(r&&!i(e.target,r.node)){e.preventDefault();var o=v(1,r.node,r.before,!1);g.getBody().focus(),u(o)}}}),g.on("keypress",function(e){Oh.modifierPressed(e)||(e.keyCode,Lh(g.selection.getNode())&&e.preventDefault())}),g.on("getSelectionRange",function(e){var t=e.range;if(p){if(!p.parentNode)return void(p=null);(t=t.cloneRange()).selectNode(p),e.range=t}}),g.on("setSelectionRange",function(e){var t;(t=c(e.range,e.forward))&&(e.range=t)}),g.on("AfterSetSele
ctionRange",function(e){var t,n=e.range;y(n)||"mcepastebin"===n.startContainer.parentNode.id||C(),t=n.startContainer.parentNode,g.dom.hasClass(t,"mce-offscreen-selection")||l()}),g.on("copy",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!de.ie){var r=(t=g.dom.get(h))?t.getElementsByTagName("*")[0]:t;r&&(e.preventDefault(),n.clearData(),n.setData("text/html",r.outerHTML),n.setData("text/plain",r.outerText))}}),lh(g),Bh(g)}(),e=g.contentStyles,t=".mce-content-body",e.push(o.getCss()),e.push(t+" .mce-offscreen-selection {position: absolute;left: -9999999999px;max-width: 1000000px;}"+t+" *[contentEditable=false] {cursor: default;}"+t+" *[contentEditable=true] {cursor: text;}")),{showCaret:v,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(wa(e),u(s()),g.selection.scrollIntoView(e[0]))},
hideFakeCaret:C,destroy:function(){o.destroy(),p=null}}},Uh=function(e,t,n){var r,o,i,a,u=1;for(a=e.getShortEndedElements(),(i=/<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g).lastIndex=r=n;o=i.exec(t);){if(r=i.lastIndex,"/"===o[1])u--;else if(!o[1]){if(o[2]in a)continue;u++}if(0===u)break}return r};function Vh(F,z){void 0===z&&(z=ti());var e=function(){};!1!==(F=F||{}).fix_self_closing&&(F.fix_self_closing=!0);var U=F.comment?F.comment:e,V=F.cdata?F.cdata:e,H=F.text?F.text:e,j=F.start?F.start:e,q=F.end?F.end:e,$=F.pi?F.pi:e,W=F.doctype?F.doctype:e;return{parse:function(e){var t,n,r,d,o,i,a,m,u,s,g,c,p,l,f,h,v,b,y,C,x,w,N,E,S,k,T,A,R,_=0,D=[],B=0,O=qo.decode,P=Yt.makeMap("src,href,data,background,formaction,poster,xlink:href"),L=/((java|vb)script|mhtml):/i,I=function(e){var t,n;for(t=D.length;t--&&D[t].name!==e;);if(0<=t){for(n=D.length-1;t<=n;n--)(e=D[n
]).valid&&q(e.name);D.length=t}},M=function(e,t,n,r,o){var i,a,u,s,c;if(n=(t=t.toLowerCase())in g?t:O(n||r||o||""),p&&!m&&0==(0===(u=t).indexOf("data-")||0===u.indexOf("aria-"))){if(!(i=b[t])&&y){for(a=y.length;a--&&!(i=y[a]).pattern.test(t););-1===a&&(i=null)}if(!i)return;if(i.validValues&&!(n in i.validValues))return}if(P[t]&&!F.allow_script_urls){var l=n.replace(/[\s\u0000-\u001F]+/g,"");try{l=decodeURIComponent(l)}catch(f){l=unescape(l)}if(L.test(l))return;if(c=l,!(s=F).allow_html_data_urls&&(/^data:image\//i.test(c)?!1===s.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(c):/^data:/i.test(c)))return}m&&(t in P||0===t.indexOf("on"))||(d.map[t]=n,d.push({name:t,value:n}))};for(S=new RegExp("<(?:(?:!--([\\w\\W]*?)--\x3e)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>
)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),k=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,s=z.getShortEndedElements(),E=F.self_closing_elements||z.getSelfClosingElements(),g=z.getBoolAttrs(),p=F.validate,u=F.remove_internals,R=F.fix_self_closing,T=z.getSpecialElements(),N=e+">";t=S.exec(N);){if(_<t.index&&H(O(e.substr(_,t.index-_))),n=t[6])":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),I(n);else if(n=t[7]){if(t.index+t[0].length>e.length){H(O(e.substr(t.index))),_=t.index+t[0].length;continue}if(":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),c=n in s,R&&E[n]&&0<D.length&&D[D.length-1].name===n&&I(n),!p||(l=z.getElementRule(n))){if(f=!0,p&&(b=l.attributes,y=l.at
tributePatterns),(v=t[8])?((m=-1!==v.indexOf("data-mce-type"))&&u&&(f=!1),(d=[]).map={},v.replace(k,M)):(d=[]).map={},p&&!m){if(C=l.attributesRequired,x=l.attributesDefault,w=l.attributesForced,l.removeEmptyAttrs&&!d.length&&(f=!1),w)for(o=w.length;o--;)a=(h=w[o]).name,"{$uid}"===(A=h.value)&&(A="mce_"+B++),d.map[a]=A,d.push({name:a,value:A});if(x)for(o=x.length;o--;)(a=(h=x[o]).name)in d.map||("{$uid}"===(A=h.value)&&(A="mce_"+B++),d.map[a]=A,d.push({name:a,value:A}));if(C){for(o=C.length;o--&&!(C[o]in d.map););-1===o&&(f=!1)}if(h=d.map["data-mce-bogus"]){if("all"===h){_=Uh(z,e,S.lastIndex),S.lastIndex=_;continue}f=!1}}f&&j(n,d,c)}else f=!1;if(r=T[n]){r.lastIndex=_=t.index+t[0].length,(t=r.exec(e))?(f&&(i=e.substr(_,t.index-_)),_=t.index+t[0].length):(i=e.substr(_),_=e.length),f&&(0<i.length&&H(i,!0),q(n)),S
.lastIndex=_;continue}c||(v&&v.indexOf("/")===v.length-1?f&&q(n):D.push({name:n,valid:f}))}else(n=t[1])?(">"===n.charAt(0)&&(n=" "+n),F.allow_conditional_comments||"[if"!==n.substr(0,3).toLowerCase()||(n=" "+n),U(n)):(n=t[2])?V(n.replace(/<!--|-->/g,"")):(n=t[3])?W(n):(n=t[4])&&$(n,t[5]);_=t.index+t[0].length}for(_<e.length&&H(O(e.substr(_))),o=D.length-1;0<=o;o--)(n=D[o]).valid&&q(n.name)}}}(Vh||(Vh={})).findEndTag=Uh;var Hh=Vh,jh=function(e,t){var n,r,o,i,a,u,s,c,l=t,f=/<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g,d=e.schema;for(u=e.getTempAttrs(),s=l,c=new RegExp(["\\s?("+u.join("|")+')="[^"]+"'].join("|"),"gi"),l=s.replace(c,""),a=d.getShortEndedElements();i=f.exec(l);)r=f.lastIndex,o=i[0].length,n=a[i[1]]?r:Hh.findEndTag(d,l,r),l=l.substring(0,r-o)+l.substring(n),f.lastIndex=
r-o;return la(l)},qh={trimExternal:jh,trimInternal:jh},$h=0,Wh=2,Kh=1,Xh=function(g,p){var e=g.length+p.length+2,h=new Array(e),v=new Array(e),c=function(e,t,n,r,o){var i=l(e,t,n,r);if(null===i||i.start===t&&i.diag===t-r||i.end===e&&i.diag===e-n)for(var a=e,u=n;a<t||u<r;)a<t&&u<r&&g[a]===p[u]?(o.push([0,g[a]]),++a,++u):r-n<t-e?(o.push([2,g[a]]),++a):(o.push([1,p[u]]),++u);else{c(e,i.start,n,i.start-i.diag,o);for(var s=i.start;s<i.end;++s)o.push([0,g[s]]);c(i.end,t,i.end-i.diag,r,o)}},b=function(e,t,n,r){for(var o=e;o-t<r&&o<n&&g[o]===p[o-t];)++o;return{start:e,end:o,diag:t}},l=function(e,t,n,r){var o=t-e,i=r-n;if(0===o||0===i)return null;var a,u,s,c,l,f=o-i,d=i+o,m=(d%2==0?d:d+1)/2;for(h[1+m]=e,v[1+m]=t+1,a=0;a<=m;++a){for(u=-a;u<=a;u+=2){for(s=u+m,u===-a||u!==a&&h[s-1]<h[s+1]?h[s]=h[s+1]:h[s]=h[s-1]+1,l=(c=h[s])-e+n-u;c<t&&l<r&&g[c]===p[l];)h[s]=++c,++l;if(f%2!=0&&
f-a<=u&&u<=f+a&&v[s-f]<=h[s])return b(v[s-f],u+e-n,t,r)}for(u=f-a;u<=f+a;u+=2){for(s=u+m-f,u===f-a||u!==f+a&&v[s+1]<=v[s-1]?v[s]=v[s+1]-1:v[s]=v[s-1],l=(c=v[s]-1)-e+n-u;e<=c&&n<=l&&g[c]===p[l];)v[s]=c--,l--;if(f%2==0&&-a<=u&&u<=a&&v[s]<=h[s+f])return b(v[s],u+e-n,t,r)}}},t=[];return c(0,g.length,0,p.length,t),t},Yh=function(e){return _o.isElement(e)?e.outerHTML:_o.isText(e)?qo.encodeRaw(e.data,!1):_o.isComment(e)?"\x3c!--"+e.data+"--\x3e":""},Gh=function(e,t,n){var r=function(e){var t,n,r;for(r=document.createElement("div"),t=document.createDocumentFragment(),e&&(r.innerHTML=e);n=r.firstChild;)t.appendChild(n);return t}(t);if(e.hasChildNodes()&&n<e.childNodes.length){var o=e.childNodes[n];o.parentNode.insertBefore(r,o)}else e.appendChild(r)},Jh=function(e){return z($(ne(e.childNodes),Yh),function(e){return 0<e.length})},Qh=functi
on(e,t){var n,r,o,i=$(ne(t.childNodes),Yh);return n=Xh(i,e),r=t,o=0,F(n,function(e){e[0]===$h?o++:e[0]===Kh?(Gh(r,e[1],o),o++):e[0]===Wh&&function(e,t){if(e.hasChildNodes()&&t<e.childNodes.length){var n=e.childNodes[t];n.parentNode.removeChild(n)}}(r,o)}),t},Zh=Bi(A.none()),ev=function(e){return{type:"fragmented",fragments:e,content:"",bookmark:null,beforeBookmark:null}},tv=function(e){return{type:"complete",fragments:null,content:e,bookmark:null,beforeBookmark:null}},nv=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},rv=function(e){var t=rr.fromTag("body",Zh.get().getOrThunk(function(){var e=document.implementation.createHTMLDocument("undo");return Zh.set(A.some(e)),e}));return aa(t,nv(e)),F(Vi(t,"*[data-mce-bogus]"),_i),t.dom().innerHTML},ov=function(n){var e,t,r;return e=Jh(n.getBody()),-1!==(t=(r=G(e,function(e){var t=qh.trimInternal(n.serializer,e);return 0
<t.length?[t]:[]})).join("")).indexOf("</iframe>")?ev(r):tv(t)},iv=function(e,t,n){"fragmented"===t.type?Qh(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},av=function(e,t){return!(!e||!t)&&(r=t,nv(e)===nv(r)||(n=t,rv(e)===rv(n)));var n,r};function uv(u){var s,r,o=this,c=0,l=[],t=0,f=function(){return 0===t},i=function(e){f()&&(o.typing=e)},d=function(e){u.setDirty(e)},a=function(e){i(!1),o.add({},e)},n=function(){o.typing&&(i(!1),o.add())};return u.on("init",function(){o.add()}),u.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&(n(),o.beforeChange())}),u.on("ExecCommand",function(e){var t=e.command;"Undo"!==t&&"Redo"!==t&&"mceRepaint"!==t&&a(e)}),u.on("
;ObjectResizeStart Cut",function(){o.beforeChange()}),u.on("SaveContent ObjectResized blur",a),u.on("DragEnd",a),u.on("KeyUp",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),u.nodeChanged()),46!==t&&8!==t||u.nodeChanged(),r&&o.typing&&!1===av(ov(u),l[0])&&(!1===u.isDirty()&&(d(!0),u.fire("change",{level:l[0],lastLevel:null})),u.fire("TypingUndo"),r=!1,u.nodeChanged()))}),u.on("KeyDown",function(e){var t=e.keyCode;if(!e.isDefaultPrevented())if(33<=t&&t<=36||37<=t&&t<=40||45===t)o.typing&&a(e);else{var n=e.ctrlKey&&!e.altKey||e.metaKey;!(t<16||20<t)||224===t||91===t||o.typing||n||(o.beforeChange(),i(!0),o.add({},e),r=!0)}}),u.on("MouseDown",function(e){o.typing&&a(e)}),u.on("input",function(e){var t;e.inputType&
amp;&("insertReplacementText"===e.inputType||"insertText"===(t=e).inputType&&null===t.data)&&a(e)}),u.addShortcut("meta+z","","Undo"),u.addShortcut("meta+y,meta+shift+z","","Redo"),u.on("AddUndo Undo Redo ClearUndos",function(e){e.isDefaultPrevented()||u.nodeChanged()}),o={data:l,typing:!1,beforeChange:function(){f()&&(s=Iu.getUndoBookmark(u.selection))},add:function(e,t){var n,r,o,i=u.settings;if(o=ov(u),e=e||{},e=Yt.extend(e,o),!1===f()||u.removed)return null;if(r=l[c],u.fire("BeforeAddUndo",{level:e,lastLevel:r,originalEvent:t}).isDefaultPrevented())return null;if(r&&av(r,e))return null;if(l[c]&&(l[c].beforeBookmark=s),i.custom_undo_redo_levels&&l.length>i.custom_undo_redo_levels){for(n=0;n<l.length-1;n++)l[n]=l[n+1];l.length--,c=l.length}e.bookmark=Iu.getUndoBookmark(u.selection),c<l.length-1&&(l.length=c+1),l.pu
sh(e),c=l.length-1;var a={level:e,lastLevel:r,originalEvent:t};return u.fire("AddUndo",a),0<c&&(d(!0),u.fire("change",a)),e},undo:function(){var e;return o.typing&&(o.add(),o.typing=!1,i(!1)),0<c&&(e=l[--c],iv(u,e,!0),d(!0),u.fire("undo",{level:e})),e},redo:function(){var e;return c<l.length-1&&(e=l[++c],iv(u,e,!1),d(!0),u.fire("redo",{level:e})),e},clear:function(){l=[],c=0,o.typing=!1,o.data=l,u.fire("ClearUndos")},hasUndo:function(){return 0<c||o.typing&&l[0]&&!av(ov(u),l[0])},hasRedo:function(){return c<l.length-1&&!o.typing},transact:function(e){return n(),o.beforeChange(),o.ignore(e),o.add()},ignore:function(e){try{t++,e()}finally{t--}},extra:function(e,t){var n,r;o.transact(e)&&(r=l[c].bookmark,n=l[c-1],iv(u,n,!0),o.transact(t)&&(l[c-1].beforeBookmark=r))}}}var sv,cv,lv=yc.isEq,fv=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o&l
t;r.length;o++)if(!1===r[o].inherit&&e.dom.is(t,r[o].selector))return!0;return!1},dv=function(t,e,n,r){var o=t.dom.getRoot();return e!==o&&(e=t.dom.getParent(e,function(e){return!!fv(t,e,n)||e.parentNode===o||!!pv(t,e,n,r,!0)}),pv(t,e,n,r))},mv=function(e,t,n){return!!lv(t,n.inline)||!!lv(t,n.block)||(n.selector?1===t.nodeType&&e.is(t,n.selector):void 0)},gv=function(e,t,n,r,o,i){var a,u,s,c=n[r];if(n.onmatch)return n.onmatch(t,n,r);if(c)if("undefined"==typeof c.length){for(a in c)if(c.hasOwnProperty(a)){if(u="attributes"===r?e.getAttrib(t,a):yc.getStyle(e,t,a),o&&!u&&!n.exact)return;if((!o||n.exact)&&!lv(u,yc.normalizeStyleValue(e,yc.replaceVars(c[a],i),a)))return}}else for(s=0;s<c.length;s++)if("attributes"===r?e.getAttrib(t,c[s]):yc.getStyle(e,t,c[s]))return n;return n},pv=function(e,t,n,r,o){var i,a,u,s,c=e.formatter.get(n),l=e.dom;if(c&&t)for(a=0;a<c.length;a++)if(i=c[a],mv(e.dom,t,i)&am
p;&gv(l,t,i,"attributes",o,r)&&gv(l,t,i,"styles",o,r)){if(s=i.classes)for(u=0;u<s.length;u++)if(!e.dom.hasClass(t,s[u]))return;return i}},hv={matchNode:pv,matchName:mv,match:function(e,t,n,r){var o;return r?dv(e,r,t,n):(r=e.selection.getNode(),!!dv(e,r,t,n)||!((o=e.selection.getStart())===r||!dv(e,o,t,n)))},matchAll:function(r,o,i){var e,a=[],u={};return e=r.selection.getStart(),r.dom.getParent(e,function(e){var t,n;for(t=0;t<o.length;t++)n=o[t],!u[n]&&pv(r,e,n,i)&&(u[n]=!0,a.push(n))},r.dom.getRoot()),a},canApply:function(e,t){var n,r,o,i,a,u=e.formatter.get(t),s=e.dom;if(u)for(n=e.selection.getStart(),r=yc.getParents(s,n),i=u.length-1;0<=i;i--){if(!(a=u[i].selector)||u[i].defaultBlock)return!0;for(o=r.length-1;0<=o;o--)if(s.is(r[o],a))return!0}return!1},matchesUnInheritedFormatSelector:fv},vv=function(e,t){return e.splitText(t)},bv=function(e){var t=e.startContainer,n=e.startOffset,r=e.endContainer,o=e.endOffset;return t=
==r&&_o.isText(t)?0<n&&n<t.nodeValue.length&&(t=(r=vv(t,n)).previousSibling,n<o?(t=r=vv(r,o-=n).previousSibling,o=r.nodeValue.length,n=0):o=0):(_o.isText(t)&&0<n&&n<t.nodeValue.length&&(t=vv(t,n),n=0),_o.isText(r)&&0<o&&o<r.nodeValue.length&&(o=(r=vv(r,o).previousSibling).nodeValue.length)),{startContainer:t,startOffset:n,endContainer:r,endOffset:o}},yv=ca,Cv="_mce_caret",xv=function(e){return 0<function(e){for(var t=[];e;){if(3===e.nodeType&&e.nodeValue!==yv||1<e.childNodes.length)return[];1===e.nodeType&&t.push(e),e=e.firstChild}return t}(e).length},wv=function(e){var t;if(e)for(e=(t=new ro(e,e)).current();e;e=t.next())if(3===e.nodeType)return e;return null},Nv=function(e){var t=rr.fromTag("span");return vr(t,{id:Cv,"data-mce-bogus":"1","data-mce-type":"format-caret"}),e&&ki(t,rr.fromText(yv)),t},Ev=f
unction(e,t,n){void 0===n&&(n=!0);var r,o=e.dom,i=e.selection;if(xv(t))Tf(e,!1,rr.fromDom(t),n);else{var a=i.getRng(),u=o.getParent(t,o.isBlock),s=((r=wv(t))&&r.nodeValue.charAt(0)===yv&&r.deleteData(0,1),r);a.startContainer===s&&0<a.startOffset&&a.setStart(s,a.startOffset-1),a.endContainer===s&&0<a.endOffset&&a.setEnd(s,a.endOffset-1),o.remove(t,!0),u&&o.isEmpty(u)&&Zc(rr.fromDom(u)),i.setRng(a)}},Sv=function(e,t,n){void 0===n&&(n=!0);var r=e.dom,o=e.selection;if(t)Ev(e,t,n);else if(!(t=zu(e.getBody(),o.getStart())))for(;t=r.get(Cv);)Ev(e,t,!1)},kv=function(e,t,n){var r=e.dom,o=r.getParent(n,d(yc.isTextBlock,e));o&&r.isEmpty(o)?n.parentNode.replaceChild(t,n):(Qc(rr.fromDom(n)),r.isEmpty(n)?n.parentNode.replaceChild(t,n):r.insertAfter(t,n))},Tv=function(e,t){return e.appendChild(t),t},Av=function(e,t){var n,r,o=(n=function(e,t){return Tv(e,t.cloneNode(!1))},r=t,function(e,t){for(var n=e.len
gth-1;0<=n;n--)t(e[n],n,e)}(e,function(e){r=n(r,e)}),r);return Tv(o,o.ownerDocument.createTextNode(yv))},Rv=function(i){i.on("mouseup keydown",function(e){var t,n,r,o;t=i,n=e.keyCode,r=t.selection,o=t.getBody(),Sv(t,null,!1),8!==n&&46!==n||!r.isCollapsed()||r.getStart().innerHTML!==yv||Sv(t,zu(o,r.getStart())),37!==n&&39!==n||Sv(t,zu(o,r.getStart()))})},_v=function(e,t){return e.schema.getTextInlineElements().hasOwnProperty(ur(t))&&!Fu(t.dom())&&!_o.isBogus(t.dom())},Dv={},Bv=qt.filter,Ov=qt.each;cv=function(e){var t,n,r=e.selection.getRng();t=_o.matchNodeNames("pre"),r.collapsed||(n=e.selection.getSelectedBlocks(),Ov(Bv(Bv(n,t),function(e){return t(e.previousSibling)&&-1!==qt.indexOf(n,e.previousSibling)}),function(e){var t,n;t=e.previousSibling,pn(n=e).remove(),pn(t).append("<br><br>").append(n.childNodes)}))},Dv[sv="pre"]||(Dv[sv]=[]),Dv[sv].push(cv);var Pv=function(e,t){Ov(Dv[e],functi
on(e){e(t)})},Lv=/^(src|href|style)$/,Iv=Yt.each,Mv=yc.isEq,Fv=function(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)},zv=function(e,t,n){var r,o,i;return r=t[n?"startContainer":"endContainer"],o=t[n?"startOffset":"endOffset"],_o.isElement(r)&&(i=r.childNodes.length-1,!n&&o&&o--,r=r.childNodes[i<o?i:o]),_o.isText(r)&&n&&o>=r.nodeValue.length&&(r=new ro(r,e.getBody()).next()||r),_o.isText(r)&&!n&&0===o&&(r=new ro(r,e.getBody()).prev()||r),r},Uv=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},Vv=function(e,t,n,r,o){var i=rr.fromDom(t),a=rr.fromDom(e.create(r,o)),u=n?Ur(i):zr(i);return Ti(a,u),n?(Ni(i,a),Si(a,i)):(Ei(i,a),ki(a,i)),a.dom()},Hv=function(e,t,n,r){return!(t=yc.getNonWhiteSpaceSibling(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},jv=function(e,n,r,o,i){var t,a,u,s,c,l,f,d,m,g,p,h,v,
b,y=e.dom;if(c=y,!(Mv(l=o,(f=n).inline)||Mv(l,f.block)||(f.selector?_o.isElement(l)&&c.is(l,f.selector):void 0)||(s=o,n.links&&"A"===s.tagName)))return!1;if("all"!==n.remove)for(Iv(n.styles,function(e,t){e=yc.normalizeStyleValue(y,yc.replaceVars(e,r),t),"number"==typeof t&&(t=e,i=0),(n.remove_similar||!i||Mv(yc.getStyle(y,i,t),e))&&y.setStyle(o,t,""),u=1}),u&&""===y.getAttrib(o,"style")&&(o.removeAttribute("style"),o.removeAttribute("data-mce-style")),Iv(n.attributes,function(e,t){var n;if(e=yc.replaceVars(e,r),"number"==typeof t&&(t=e,i=0),!i||Mv(y.getAttrib(i,t),e)){if("class"===t&&(e=y.getAttrib(o,t))&&(n="",Iv(e.split(/\s+/),function(e){/mce\-\w+/.test(e)&&(n+=(n?" ":"")+e)}),n))return void y.setAttrib(o,t,n);"class"===t&&o.removeAttribute("className
"),Lv.test(t)&&o.removeAttribute("data-mce-"+t),o.removeAttribute(t)}}),Iv(n.classes,function(e){e=yc.replaceVars(e,r),i&&!y.hasClass(i,e)||y.removeClass(o,e)}),a=y.getAttribs(o),t=0;t<a.length;t++){var C=a[t].nodeName;if(0!==C.indexOf("_")&&0!==C.indexOf("data-"))return!1}return"none"!==n.remove?(d=e,g=n,h=(m=o).parentNode,v=d.dom,b=d.settings.forced_root_block,g.block&&(b?h===v.getRoot()&&(g.list_block&&Mv(m,g.list_block)||Iv(Yt.grep(m.childNodes),function(e){yc.isValid(d,b,e.nodeName.toLowerCase())?p?p.appendChild(e):(p=Uv(v,e,b),v.setAttribs(p,d.settings.forced_root_block_attrs)):p=0})):v.isBlock(m)&&!v.isBlock(h)&&(Hv(v,m,!1)||Hv(v,m.firstChild,!0,1)||m.insertBefore(v.create("br"),m.firstChild),Hv(v,m,!0)||Hv(v,m.lastChild,!1,1)||m.appendChild(v.create("br")))),g.selector&&g.inline&&!Mv(g.inline,m)||v.remove(m,1),!0):void 0},qv=jv,$
v=function(s,c,l,e,f){var t,n,d=s.formatter.get(c),m=d[0],a=!0,u=s.dom,r=s.selection,i=function(e){var n,t,r,o,i,a,u=(n=s,t=e,r=c,o=l,i=f,Iv(yc.getParents(n.dom,t.parentNode).reverse(),function(e){var t;a||"_start"===e.id||"_end"===e.id||(t=hv.matchNode(n,e,r,o,i))&&!1!==t.split&&(a=e)}),a);return function(e,t,n,r,o,i,a,u){var s,c,l,f,d,m,g=e.dom;if(n){for(m=n.parentNode,s=r.parentNode;s&&s!==m;s=s.parentNode){for(c=g.clone(s,!1),d=0;d<t.length;d++)if(jv(e,t[d],u,c,c)){c=0;break}c&&(l&&c.appendChild(l),f||(f=c),l=c)}!i||a.mixed&&g.isBlock(n)||(r=g.split(n,r)),l&&(o.parentNode.insertBefore(l,o),f.appendChild(o))}return r}(s,d,u,e,e,!0,m,l)},g=function(e){var t,n,r,o,i;if(_o.isElement(e)&&u.getContentEditable(e)&&(o=a,a="true"===u.getContentEditable(e),i=!0),t=Yt.grep(e.childNodes),a&&!i)for(n=0,r=d.length;n<r&&!jv(s,d[n],l,e,e);n++);if(m.deep&&t.length){
for(n=0,r=t.length;n<r;n++)g(t[n]);i&&(a=o)}},p=function(e){var t,n=u.get(e?"_start":"_end"),r=n[e?"firstChild":"lastChild"];return pc(t=r)&&_o.isElement(t)&&("_start"===t.id||"_end"===t.id)&&(r=r[e?"firstChild":"lastChild"]),_o.isText(r)&&0===r.data.length&&(r=e?n.previousSibling||n.nextSibling:n.nextSibling||n.previousSibling),u.remove(n,!0),r},o=function(e){var t,n,r=e.commonAncestorContainer;if(e=Dc(s,e,d,!0),m.split){if(e=bv(e),(t=zv(s,e,!0))!==(n=zv(s,e))){if(/^(TR|TH|TD)$/.test(t.nodeName)&&t.firstChild&&(t="TR"===t.nodeName?t.firstChild.firstChild||t:t.firstChild||t),r&&/^T(HEAD|BODY|FOOT|R)$/.test(r.nodeName)&&/^(TH|TD)$/.test(n.nodeName)&&n.firstChild&&(n=n.firstChild||n),Fv(u,t,n)){var o=A.from(t.firstChild).getOr(t);return i(Vv(u,o,!0,"span",{id:"_start","data-
mce-type":"bookmark"})),void p(!0)}if(Fv(u,n,t))return o=A.from(n.lastChild).getOr(n),i(Vv(u,o,!1,"span",{id:"_end","data-mce-type":"bookmark"})),void p(!1);t=Uv(u,t,"span",{id:"_start","data-mce-type":"bookmark"}),n=Uv(u,n,"span",{id:"_end","data-mce-type":"bookmark"}),i(t),i(n),t=p(!0),n=p()}else t=n=i(t);e.startContainer=t.parentNode?t.parentNode:t,e.startOffset=u.nodeIndex(t),e.endContainer=n.parentNode?n.parentNode:n,e.endOffset=u.nodeIndex(n)+1}Oc(u,e,function(e){Iv(e,function(e){g(e),_o.isElement(e)&&"underline"===s.dom.getStyle(e,"text-decoration")&&e.parentNode&&"underline"===yc.getTextDecoration(u,e.parentNode)&&jv(s,{deep:!1,exact:!0,inline:"span",styles:{textDecoration:"underline"}},null,e)})})};if(e)e.nodeType?((n=u.createRng()).setStartBefore(e),n.setEndAf
ter(e),o(n)):o(e);else if("false"!==u.getContentEditable(r.getNode()))r.isCollapsed()&&m.inline&&!u.select("td[data-mce-selected],th[data-mce-selected]").length?function(e,t,n,r){var o,i,a,u,s,c,l,f=e.dom,d=e.selection,m=[],g=d.getRng();for(o=g.startContainer,i=g.startOffset,3===(s=o).nodeType&&(i!==o.nodeValue.length&&(u=!0),s=s.parentNode);s;){if(hv.matchNode(e,s,t,n,r)){c=s;break}s.nextSibling&&(u=!0),m.push(s),s=s.parentNode}if(c)if(u){a=d.getBookmark(),g.collapse(!0);var p=Dc(e,g,e.formatter.get(t),!0);p=bv(p),e.formatter.remove(t,n,p),d.moveToBookmark(a)}else{l=zu(e.getBody(),c);var h=Nv(!1).dom(),v=Av(m,h);kv(e,h,l||c),Ev(e,l,!1),d.setCursorLocation(v,1),f.isEmpty(c)&&f.remove(c)}}(s,c,l,f):(t=Iu.getPersistentBookmark(s.selection,!0),o(r.getRng()),r.moveToBookmark(t),m.inline&&hv.match(s,c,l,r.getStart())&&yc.moveStart(u,r,r.getRng()),s.nodeChanged());else{e=r.getNode();for(var h=0,v=d.length;
h<v&&(!d[h].ceFalseOverride||!jv(s,d[h],l,e,e));h++);}},Wv=Yt.each,Kv=function(e){return e&&1===e.nodeType&&!pc(e)&&!Fu(e)&&!_o.isBogus(e)},Xv=function(e,t){var n;for(n=e;n;n=n[t]){if(3===n.nodeType&&0!==n.nodeValue.length)return e;if(1===n.nodeType&&!pc(n))return n}return e},Yv=function(e,t,n){var r,o,i=new Jc(e);if(t&&n&&(t=Xv(t,"previousSibling"),n=Xv(n,"nextSibling"),i.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)r=(o=r).nextSibling,t.appendChild(o);return e.remove(n),Yt.each(Yt.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n},Gv=function(e,t,n){Wv(e.childNodes,function(e){Kv(e)&&(t(e)&&n(e),e.hasChildNodes()&&Gv(e,t,n))})},Jv=function(n,e){return d(function(e,t){return!(!t||!yc.getStyle(n,t,e))},e)},Qv=function(r,e,t){return d(function(e,t,n){r.setStyle(n,e,t),""===n.getAttribute("style")&&n.removeAttribute("
;style"),Zv(r,n)},e,t)},Zv=function(e,t){"SPAN"===t.nodeName&&0===e.getAttribs(t).length&&e.remove(t,!0)},eb=function(e,t){var n;1===t.nodeType&&t.parentNode&&1===t.parentNode.nodeType&&(n=yc.getTextDecoration(e,t.parentNode),e.getStyle(t,"color")&&n?e.setStyle(t,"text-decoration",n):e.getStyle(t,"text-decoration")===n&&e.setStyle(t,"text-decoration",null))},tb=function(n,e,r,o){Wv(e,function(t){Wv(n.dom.select(t.inline,o),function(e){Kv(e)&&qv(n,t,r,e,t.exact?e:null)}),function(r,e,t){if(e.clear_child_styles){var n=e.links?"*:not(a)":"*";Wv(r.select(n,t),function(n){Kv(n)&&Wv(e.styles,function(e,t){r.setStyle(n,t,"")})})}}(n.dom,t,o)})},nb=function(e,t,n,r){(t.styles.color||t.styles.textDecoration)&&(Yt.walk(r,d(eb,e),"childNodes"),eb(e,r))},rb=function(e,t,n,r){t.styles&&t.styles.backgroundColor&&
amp;Gv(r,Jv(e,"fontSize"),Qv(e,"backgroundColor",yc.replaceVars(t.styles.backgroundColor,n)))},ob=function(e,t,n,r){"sub"!==t.inline&&"sup"!==t.inline||(Gv(r,Jv(e,"fontSize"),Qv(e,"fontSize","")),e.remove(e.select("sup"===t.inline?"sub":"sup",r),!0))},ib=function(e,t,n,r){r&&!1!==t.merge_siblings&&(r=Yv(e,yc.getNonWhiteSpaceSibling(r),r),r=Yv(e,r,yc.getNonWhiteSpaceSibling(r,!0)))},ab=function(t,n,r,o,i){hv.matchNode(t,i.parentNode,r,o)&&qv(t,n,o,i)||n.merge_with_parents&&t.dom.getParent(i.parentNode,function(e){if(hv.matchNode(t,e,r,o))return qv(t,n,o,i),!0})},ub=Yt.each,sb=function(g,p,h,r){var e,t,v=g.formatter.get(p),b=v[0],o=!r&&g.selection.isCollapsed(),i=g.dom,n=g.selection,y=function(n,e){if(e=e||b,n){if(e.onformat&&e.onformat(n,e,h,r),ub(e.styles,function(e,t){i.setStyle(n,t,yc.replaceVars(e,h))}),e.styles){var t=i.getAt
trib(n,"style");t&&n.setAttribute("data-mce-style",t)}ub(e.attributes,function(e,t){i.setAttrib(n,t,yc.replaceVars(e,h))}),ub(e.classes,function(e){e=yc.replaceVars(e,h),i.hasClass(n,e)||i.addClass(n,e)})}},C=function(e,t){var n=!1;return!!b.selector&&(ub(e,function(e){if(!("collapsed"in e&&e.collapsed!==o))return i.is(t,e.selector)&&!Fu(t)?(y(t,e),!(n=!0)):void 0}),n)},a=function(s,e,t,c){var l,f,d=[],m=!0;l=b.inline||b.block,f=s.create(l),y(f),Oc(s,e,function(e){var a,u=function(e){var t,n,r,o;if(o=m,t=e.nodeName.toLowerCase(),n=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&s.getContentEditable(e)&&(o=m,m="true"===s.getContentEditable(e),r=!0),yc.isEq(t,"br"))return a=0,void(b.block&&s.remove(e));if(b.wrapper&&hv.matchNode(g,e,p,h))a=0;else{if(m&&!r&&b.block&&!b.wrapper&&yc.isTextBlock(g,t)&&yc.isValid(g,n,l))return e=s.ren
ame(e,l),y(e),d.push(e),void(a=0);if(b.selector){var i=C(v,e);if(!b.inline||i)return void(a=0)}!m||r||!yc.isValid(g,l,t)||!yc.isValid(g,n,l)||!c&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||Fu(e)||b.inline&&s.isBlock(e)?(a=0,ub(Yt.grep(e.childNodes),u),r&&(m=o),a=0):(a||(a=s.clone(f,!1),e.parentNode.insertBefore(a,e),d.push(a)),a.appendChild(e))}};ub(e,u)}),!0===b.links&&ub(d,function(e){var t=function(e){"A"===e.nodeName&&y(e,b),ub(Yt.grep(e.childNodes),t)};t(e)}),ub(d,function(e){var t,n,r,o,i,a=function(e){var n=!1;return ub(e.childNodes,function(e){if((t=e)&&1===t.nodeType&&!pc(t)&&!Fu(t)&&!_o.isBogus(t))return n=e,!1;var t}),n};n=0,ub(e.childNodes,function(e){yc.isWhiteSpaceNode(e)||pc(e)||n++}),t=n,!(1<d.length)&&s.isBlock(e)||0!==t?(b.inline||b.wrapper)&&(b.exact||1!==t||((o=a(r=e))&&!pc(o)&&hv.matchName(s,o,b)&
;&(i=s.clone(o,!1),y(i),s.replace(i,r,!0),s.remove(o,1)),e=i||r),tb(g,v,h,e),ab(g,b,p,h,e),rb(s,b,h,e),ob(s,b,h,e),ib(s,b,h,e)):s.remove(e,1)})};if("false"!==i.getContentEditable(n.getNode())){if(b){if(r)r.nodeType?C(v,r)||((t=i.createRng()).setStartBefore(r),t.setEndAfter(r),a(i,Dc(g,t,v),0,!0)):a(i,r,0,!0);else if(o&&b.inline&&!i.select("td[data-mce-selected],th[data-mce-selected]").length)!function(e,t,n){var r,o,i,a,u,s,c=e.selection;a=(r=c.getRng(!0)).startOffset,s=r.startContainer.nodeValue,(o=zu(e.getBody(),c.getStart()))&&(i=wv(o));var l,f,d=/[^\s\u00a0\u00ad\u200b\ufeff]/;s&&0<a&&a<s.length&&d.test(s.charAt(a))&&d.test(s.charAt(a-1))?(u=c.getBookmark(),r.collapse(!0),r=Dc(e,r,e.formatter.get(t)),r=bv(r),e.formatter.apply(t,n,r),c.moveToBookmark(u)):(o&&i.nodeValue===yv||(l=e.getDoc(),f=Nv(!0).dom(),i=(o=l.importNode(f,!0)).firstChild,r.insertNode(o),a=1),e.formatter.apply(t,n,o),c.
setCursorLocation(i,a))}(g,p,h);else{var u=g.selection.getNode();g.settings.forced_root_block||!v[0].defaultBlock||i.getParent(u,i.isBlock)||sb(g,v[0].defaultBlock),g.selection.setRng(il(g.selection.getRng())),e=Iu.getPersistentBookmark(g.selection,!0),a(i,Dc(g,n.getRng(),v)),b.styles&&nb(i,b,h,u),n.moveToBookmark(e),yc.moveStart(i,n,n.getRng()),g.nodeChanged()}Pv(p,g)}}else{r=n.getNode();for(var s=0,c=v.length;s<c;s++)if(v[s].ceFalseOverride&&i.is(r,v[s].selector))return void y(r,v[s])}},cb={applyFormat:sb},lb=Yt.each,fb=function(e,t,n,r,o){var i,a,u,s,c,l,f,d;null===t.get()&&(a=e,u={},(i=t).set({}),a.on("NodeChange",function(n){var r=yc.getParents(a.dom,n.element),o={};r=Yt.grep(r,function(e){return 1===e.nodeType&&!e.getAttribute("data-mce-bogus")}),lb(i.get(),function(e,n){lb(r,function(t){return a.formatter.matchNode(t,n,{},e.similar)?(u[n]||(lb(e,function(e){e(!0,{node:t,format:n,parents:r})}),u[n]=e),o[n]=e,!1):!hv.matche
sUnInheritedFormatSelector(a,t,n)&&void 0})}),lb(u,function(e,t){o[t]||(delete u[t],lb(e,function(e){e(!1,{node:n.element,format:t,parents:r})}))})})),c=n,l=r,f=o,d=(s=t).get(),lb(c.split(","),function(e){d[e]||(d[e]=[],d[e].similar=f),d[e].push(l)}),s.set(d)},db={get:function(r){var t={valigntop:[{selector:"td,th",styles:{verticalAlign:"top"}}],valignmiddle:[{selector:"td,th",styles:{verticalAlign:"middle"}}],valignbottom:[{selector:"td,th",styles:{verticalAlign:"bottom"}}],alignleft:[{selector:"figure.image",collapsed:!1,classes:"align-left",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},inherit:!1,preview:!1,defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"},preview:"font-family font-size&quo
t;}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{selector:"figure.image",collapsed:!1,classes:"align-center",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"},preview:!1},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"},preview:"font-family font-size"}],alignright:[{selector:"figure.image",collapsed:!1,classes:"align-right",ceFalseOverride:!0,preview:"font-family font-size"},{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},inherit:!1,preview:"font-family font-size",defaultBlock:"div"},{sele
ctor:"img,table",collapsed:!1,styles:{"float":"right"},preview:"font-family font-size"}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},inherit:!1,defaultBlock:"div",preview:"font-family font-size"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",st
yles:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},fontname:{inline:"span",toggle:!1,styles:{fontFamily:"%value"},clear_child_styles:!0},fontsize:{inline:"span",toggle:!1,styles:{fontSize:"%value"},clear_child_styles:!0},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(n,e,t){Yt.each(t,function(e,t){r.setAttrib(n,t,e)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",
remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]};return Yt.each("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){t[e]={block:e,remove:"all"}}),t}},mb=Yt.each,gb=gi.DOM,pb=function(e,t){var n,o,r,m=t&&t.schema||ti({}),g=function(e){var t,n,r;return o="string"==typeof e?{name:e,classes:[],attrs:{}}:e,t=gb.create(o.name),n=t,(r=o).classes.length&&gb.addClass(n,r.classes.join(" ")),gb.setAttribs(n,r.attrs),t},p=function(n,e,t){var r,o,i,a,u,s,c,l,f=0<e.length&&e[0],d=f&&f.name;if(u=d,s="string"!=typeof(a=n)?a.nodeName.toLowerCase():a,c=m.getElementRule(s),i=!(!(l=c&&c.parentsRequired)||!l.length)&&(u&&-1!==
Yt.inArray(l,u)?u:l[0]))d===i?(o=e[0],e=e.slice(1)):o=i;else if(f)o=e[0],e=e.slice(1);else if(!t)return n;return o&&(r=g(o)).appendChild(n),t&&(r||(r=gb.create("div")).appendChild(n),Yt.each(t,function(e){var t=g(e);r.insertBefore(t,n)})),p(r,e,o&&o.siblings)};return e&&e.length?(o=e[0],n=g(o),(r=gb.create("div")).appendChild(p(n,e.slice(1),o.siblings)),r):""},hb=function(e){var t,a={classes:[],attrs:{}};return"*"!==(e=a.selector=Yt.trim(e))&&(t=e.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g,function(e,t,n,r,o){switch(t){case"#":a.attrs.id=n;break;case".":a.classes.push(n);break;case":":-1!==Yt.inArray("checked disabled enabled read-only required".split(" "),n)&&(a.attrs[n]=n)}if("["===r){var i=o.match(/([\w\-]+)(?:\=\"([^\"]+))?/);i&&(a.attrs[i[1]]=i[2])}return""})),a.name=t||"div",a},vb=func
tion(e){return e&&"string"==typeof e?(e=(e=e.split(/\s*,\s*/)[0]).replace(/\s*(~\+|~|\+|>)\s*/g,"$1"),Yt.map(e.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=Yt.map(e.split(/(?:~\+|~|\+)/),hb),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[]},bb=function(n,e){var t,r,o,i,a,u,s="";if(!1===(u=n.settings.preview_styles))return"";"string"!=typeof u&&(u="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow");var c=function(e){return e.replace(/%(\w+)/g,"")};if("string"==typeof e){if(!(e=n.formatter.get(e)))return;e=e[0]}return"preview"in e&&!1===(u=e.preview)?"":(t=e.block||e.inline||"span",(i=vb(e.selector)).length?(i[0].name||(i[0].name=t),t=e.selector,r=pb(i,n)):r=pb([t],n),o=gb.select(t,r)[0]||r.firstChild,mb(e.styles,function(e,t){(e=c(e
))&&gb.setStyle(o,t,e)}),mb(e.attributes,function(e,t){(e=c(e))&&gb.setAttrib(o,t,e)}),mb(e.classes,function(e){e=c(e),gb.hasClass(o,e)||gb.addClass(o,e)}),n.fire("PreviewFormats"),gb.setStyles(r,{position:"absolute",left:-65535}),n.getBody().appendChild(r),a=gb.getStyle(n.getBody(),"fontSize",!0),a=/px$/.test(a)?parseInt(a,10):0,mb(u.split(" "),function(e){var t=gb.getStyle(o,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=gb.getStyle(n.getBody(),e,!0),"#ffffff"===gb.toHex(t).toLowerCase())||"color"===e&&"#000000"===gb.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===a)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*a+"px"}"border"===e&&t&&(s+="padding:0 2px;"),s+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),gb.remove(r),
s)},yb=function(e,t,n,r,o){var i=t.get(n);!hv.match(e,n,r,o)||"toggle"in i[0]&&!i[0].toggle?cb.applyFormat(e,n,r,o):$v(e,n,r,o)},Cb=function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])};function xb(e){var t,n,r,o=(t=e,n={},(r=function(e,t){e&&("string"!=typeof e?Yt.each(e,function(e,t){r(t,e)}):(t=t.length?t:[t],Yt.each(t,function(e){"undefined"==typeof e.deep&&(e.deep=!e.selecto
r),"undefined"==typeof e.split&&(e.split=!e.selector||e.inline),"undefined"==typeof e.remove&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),n[e]=t))})(db.get(t.dom)),r(t.settings.formats),{get:function(e){return e?n[e]:n},register:r,unregister:function(e){return e&&n[e]&&delete n[e],n}}),i=Bi(null);return Cb(e),Rv(e),{get:o.get,register:o.register,unregister:o.unregister,apply:d(cb.applyFormat,e),remove:d($v,e),toggle:d(yb,e,o),match:d(hv.match,e),matchAll:d(hv.matchAll,e),matchNode:d(hv.matchNode,e),canApply:d(hv.canApply,e),formatChanged:d(fb,e,i),getCssText:d(bb,e)}}var wb,Nb=Object.prototype.hasOwnProperty,Eb=(wb=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error(&q
uot;Can't merge zero objects");for(var n={},r=0;r<e.length;r++){var o=e[r];for(var i in o)Nb.call(o,i)&&(n[i]=wb(n[i],o[i]))}return n}),Sb={register:function(t,s,c){t.addAttributeFilter("data-mce-tabindex",function(e,t){for(var n,r=e.length;r--;)(n=e[r]).attr("tabindex",n.attributes.map["data-mce-tabindex"]),n.attr(t,null)}),t.addAttributeFilter("src,href,style",function(e,t){for(var n,r,o=e.length,i="data-mce-"+t,a=s.url_converter,u=s.url_converter_scope;o--;)(r=(n=e[o]).attributes.map[i])!==undefined?(n.attr(t,0<r.length?r:null),n.attr(i,null)):(r=n.attributes.map[t],"style"===t?r=c.serializeStyle(c.parseStyle(r),n.name):a&&(r=a.call(u,r,t,n.name)),n.attr(t,0<r.length?r:null))}),t.addAttributeFilter("class",function(e){for(var t,n,r=e.length;r--;)(n=(t=e[r]).attr("class"))&&(n=t.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),t.attr(&quo
t;class",0<n.length?n:null))}),t.addAttributeFilter("data-mce-type",function(e,t,n){for(var r,o=e.length;o--;)"bookmark"!==(r=e[o]).attributes.map["data-mce-type"]||n.cleanup||r.remove()}),t.addNodeFilter("noscript",function(e){for(var t,n=e.length;n--;)(t=e[n].firstChild)&&(t.value=qo.decode(t.value))}),t.addNodeFilter("script,style",function(e,t){for(var n,r,o,i=e.length,a=function(e){return e.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*((<!--)?(\s*\/\/)?\s*<!\[CDATA\[|(<!--\s*)?\/\*\s*<!\[CDATA\[\s*\*\/|(\/\/)?\s*<!--|\/\*\s*<!--\s*\*\/)\s*[\r\n]*/gi,"").replace(/\s*(\/\*\s*\]\]>\s*\*\/(-->)?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&
;&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="// <![CDATA[\n"+a(r)+"\n// ]]>")):"xhtml"===s.element_format&&0<r.length&&(n.firstChild.value="\x3c!--\n"+a(r)+"\n--\x3e")}),t.addNodeFilter("#comment",function(e){for(var t,n=e.length;n--;)0===(t=e[n]).value.indexOf("[CDATA[")?(t.name="#cdata",t.type=4,t.value=t.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===t.value.indexOf("mce:protected ")&&(t.name="#text",t.type=3,t.raw=!0,t.value=unescape(t.value).substr(14))}),t.addNodeFilter("xml:namespace,input",function(e,t){for(var n,r=e.length;r--;)7===(n=e[r]).type?n.remove():1===n.type&&("input"!==t||"type"in n.attributes.map||n.attr("type","text"))}),t.addAtt
ributeFilter("data-mce-type",function(e){F(e,function(e){"format-caret"===e.attr("data-mce-type")&&(e.isEmpty(t.schema.getNonEmptyElements())?e.remove():e.unwrap())})}),t.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected,data-mce-expando,data-mce-type,data-mce-resize",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)})},trimTrailingBr:function(e){var t,n,r=function(e){return e&&"br"===e.name};r(t=e.lastChild)&&r(n=t.prev)&&(t.remove(),n.remove())}},kb={process:function(e,t,n){return f=n,(l=e)&&l.hasEventListeners("PreProcess")&&!f.no_events?(o=t,i=n,c=(r=e).dom,o=o.cloneNode(!0),(a=document.implementation).createHTMLDocument&&(u=a.createHTMLDocument(""),Yt.each("BODY"===o.nodeName?o.childNodes:[o],function(e){u.body.appendChild(u.importNode(e,!0))}),o="BODY"!==o.nodeName?u.body.firstChild:u.body,s=c.doc,
c.doc=u),_g(r,Eb(i,{node:o})),s&&(c.doc=s),o):t;var r,o,i,a,u,s,c,l,f}},Tb=function(e,a,u){e.addNodeFilter("font",function(e){F(e,function(e){var t,n=a.parse(e.attr("style")),r=e.attr("color"),o=e.attr("face"),i=e.attr("size");r&&(n.color=r),o&&(n["font-family"]=o),i&&(n["font-size"]=u[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",a.serialize(n)),t=e,F(["color","face","size"],function(e){t.attr(e,null)})})})},Ab=function(e,t){var n,r=ri();t.convert_fonts_to_spans&&Tb(e,r,Yt.explode(t.font_size_legacy_values)),n=r,e.addNodeFilter("strike",function(e){F(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})},Rb={register:function(e,t){t.inline_styles&&Ab(e,t)}},_
b=/^[ \t\r\n]*$/,Db={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11},Bb=function(e,t,n){var r,o,i=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[i])return e[i];if(e!==t){if(r=e[a])return r;for(o=e.parent;o&&o!==t;o=o.parent)if(r=o[a])return r}},Ob=function(){function a(e,t){this.name=e,1===(this.type=t)&&(this.attributes=[],this.attributes.map={})}return a.create=function(e,t){var n,r;if(n=new a(e,Db[e]||1),t)for(r in t)n.attr(r,t[r]);return n},a.prototype.replace=function(e){return e.parent&&e.remove(),this.insert(e,this),this.remove(),this},a.prototype.attr=function(e,t){var n,r;if("string"!=typeof e){for(r in e)this.attr(r,e[r]);return this}if(n=this.attributes){if(t!==undefined){if(null===t){if(e in n.map)for(delete n.map[e],r=n.length;r--;)if(n[r].name===e)return n=n.splice(r,1),this;return this}if(e in n.map){
for(r=n.length;r--;)if(n[r].name===e){n[r].value=t;break}}else n.push({name:e,value:t});return n.map[e]=t,this}return n.map[e]}},a.prototype.clone=function(){var e,t,n,r,o,i=new a(this.name,this.type);if(n=this.attributes){for((o=[]).map={},e=0,t=n.length;e<t;e++)"id"!==(r=n[e]).name&&(o[o.length]={name:r.name,value:r.value},o.map[r.name]=r.value);i.attributes=o}return i.value=this.value,i.shortEnded=this.shortEnded,i},a.prototype.wrap=function(e){return this.parent.insert(e,this),e.append(this),this},a.prototype.unwrap=function(){var e,t;for(e=this.firstChild;e;)t=e.next,this.insert(e,this,!0),e=t;this.remove()},a.prototype.remove=function(){var e=this.parent,t=this.next,n=this.prev;return e&&(e.firstChild===this?(e.firstChild=t)&&(t.prev=null):n.next=t,e.lastChild===this?(e.lastChild=n)&&(n.next=null):t.prev=n,this.parent=this.next=this.prev=null),this},a.prototype.append=function(e){var t;return e.parent&&e.remove(),(t=this.las
tChild)?((t.next=e).prev=t,this.lastChild=e):this.lastChild=this.firstChild=e,e.parent=this,e},a.prototype.insert=function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,(e.next=t).prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,(e.prev=t).next=e),e.parent=r,e},a.prototype.getAll=function(e){var t,n=[];for(t=this.firstChild;t;t=Bb(t,this))t.name===e&&n.push(t);return n},a.prototype.empty=function(){var e,t,n;if(this.firstChild){for(e=[],n=this.firstChild;n;n=Bb(n,this))e.push(n);for(t=e.length;t--;)(n=e[t]).parent=n.firstChild=n.lastChild=n.next=n.prev=null}return this.firstChild=this.lastChild=null,this},a.prototype.isEmpty=function(e,t,n){var r,o,i=this.firstChild;if(t=t||{},i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(e[i.name])return!1;for(r=i.attributes.length;r--;)if("name"===(o=i.attributes[r].name)||0===o.indexOf("data
-mce-bookmark"))return!1}if(8===i.type)return!1;if(3===i.type&&!_b.test(i.value))return!1;if(3===i.type&&i.parent&&t[i.parent.name]&&_b.test(i.value))return!1;if(n&&n(i))return!1}while(i=Bb(i,this));return!0},a.prototype.walk=function(e){return Bb(this,null,e)},a}(),Pb=function(e,t,n,r){(e.padd_empty_with_br||t.insert)&&n[r.name]?r.empty().append(new Ob("br",1)).shortEnded=!0:r.empty().append(new Ob("#text",3)).value="\xa0"},Lb=function(e){return Ib(e,"#text")&&"\xa0"===e.firstChild.value},Ib=function(e,t){return e&&e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.name===t},Mb=function(r,e,t,n){return n.isEmpty(e,t,function(e){return t=e,(n=r.getElementRule(t.name))&&n.paddEmpty;var t,n})},Fb=function(e,t){return e&&(t[e.name]||"br"===e.name)},zb=function(e,p){var h=e.schema;p.remove_trailing_brs&&e.addNodeFilt
er("br",function(e,t,n){var r,o,i,a,u,s,c,l,f=e.length,d=Yt.extend({},h.getBlockElements()),m=h.getNonEmptyElements(),g=h.getNonEmptyElements();for(d.body=1,r=0;r<f;r++)if(i=(o=e[r]).parent,d[o.parent.name]&&o===i.lastChild){for(u=o.prev;u;){if("span"!==(s=u.name)||"bookmark"!==u.attr("data-mce-type")){if("br"!==s)break;if("br"===s){o=null;break}}u=u.prev}o&&(o.remove(),Mb(h,m,g,i)&&(c=h.getElementRule(i.name))&&(c.removeEmpty?i.remove():c.paddEmpty&&Pb(p,n,d,i)))}else{for(a=o;i&&i.firstChild===a&&i.lastChild===a&&!d[(a=i).name];)i=i.parent;a===i&&!0!==p.padd_empty_with_br&&((l=new Ob("#text",3)).value="\xa0",o.replace(l))}}),e.addAttributeFilter("href",function(e){var t,n,r,o=e.length;if(!p.allow_unsafe_link_target)for(;o--;)"a"===(t=e[o]).name&&"_blank"===t.attr("target")&a
mp;&t.attr("rel",(n=t.attr("rel"),r=n?Yt.trim(n):"",/\b(noopener)\b/g.test(r)?r:r.split(" ").filter(function(e){return 0<e.length}).concat(["noopener"]).sort().join(" ")))}),p.allow_html_in_named_anchor||e.addAttributeFilter("id,name",function(e){for(var t,n,r,o,i=e.length;i--;)if("a"===(o=e[i]).name&&o.firstChild&&!o.attr("href"))for(r=o.parent,t=o.lastChild;n=t.prev,r.insert(t,o),t=n;);}),p.fix_list_elements&&e.addNodeFilter("ul,ol",function(e){for(var t,n,r=e.length;r--;)if("ul"===(n=(t=e[r]).parent).name||"ol"===n.name)if(t.prev&&"li"===t.prev.name)t.prev.append(t);else{var o=new Ob("li",1);o.attr("style","list-style-type: none"),t.wrap(o)}}),p.validate&&h.getValidClasses()&&e.addAttributeFilter("class",function(e){for(var t,n,r,o,i,a,u,s=e.length,c=h.getVal
idClasses();s--;){for(n=(t=e[s]).attr("class").split(" "),i="",r=0;r<n.length;r++)o=n[r],u=!1,(a=c["*"])&&a[o]&&(u=!0),a=c[t.name],!u&&a&&a[o]&&(u=!0),u&&(i&&(i+=" "),i+=o);i.length||(i=null),t.attr("class",i)}})},Ub=Yt.makeMap,Vb=Yt.each,Hb=Yt.explode,jb=Yt.extend;function qb(k,T){void 0===T&&(T=ti());var A={},R=[],_={},D={};(k=k||{}).validate=!("validate"in k)||k.validate,k.root_name=k.root_name||"body";var B=function(e){var t,n,r;(n=e.name)in A&&((r=_[n])?r.push(e):_[n]=[e]),t=R.length;for(;t--;)(n=R[t].name)in e.attributes.map&&((r=D[n])?r.push(e):D[n]=[e]);return e},e={schema:T,addAttributeFilter:function(e,n){Vb(Hb(e),function(e){var t;for(t=0;t<R.length;t++)if(R[t].name===e)return void R[t].callbacks.push(n);R.push({name:e,callbacks:[n]})})},getAttributeFilters:function(){return[].concat(R)},addNodeFilter:functio
n(e,n){Vb(Hb(e),function(e){var t=A[e];t||(A[e]=t=[]),t.push(n)})},getNodeFilters:function(){var e=[];for(var t in A)A.hasOwnProperty(t)&&e.push({name:t,callbacks:A[t]});return e},filterNode:B,parse:function(e,a){var t,n,r,o,i,u,s,c,l,f,d,m=[];a=a||{},_={},D={},l=jb(Ub("script,style,head,html,body,title,meta,param"),T.getBlockElements());var g=T.getNonEmptyElements(),p=T.children,h=k.validate,v="forced_root_block"in a?a.forced_root_block:k.forced_root_block,b=T.getWhiteSpaceElements(),y=/^[ \t\r\n]+/,C=/[ \t\r\n]+$/,x=/[ \t\r\n]+/g,w=/^[ \t\r\n]+$/;f=b.hasOwnProperty(a.context)||b.hasOwnProperty(k.root_name);var N=function(e,t){var n,r=new Ob(e,t);return e in A&&((n=_[e])?n.push(r):_[e]=[r]),r},E=function(e){var t,n,r,o,i=T.getBlockElements();for(t=e.prev;t&&3===t.type;){if(0<(r=t.value.replace(C,"")).length)return void(t.value=r);if(n=t.next){if(3===n.type&&n.value.length){t=t.prev;continue}if(!i[n.name]&&&quo
t;script"!==n.name&&"style"!==n.name){t=t.prev;continue}}o=t.prev,t.remove(),t=o}};t=Hh({validate:h,allow_script_urls:k.allow_script_urls,allow_conditional_comments:k.allow_conditional_comments,self_closing_elements:function(e){var t,n={};for(t in e)"li"!==t&&"p"!==t&&(n[t]=e[t]);return n}(T.getSelfClosingElements()),cdata:function(e){d.append(N("#cdata",4)).value=e},text:function(e,t){var n;f||(e=e.replace(x," "),Fb(d.lastChild,l)&&(e=e.replace(y,""))),0!==e.length&&((n=N("#text",3)).raw=!!t,d.append(n).value=e)},comment:function(e){d.append(N("#comment",8)).value=e},pi:function(e,t){d.append(N(e,7)).value=t,E(d)},doctype:function(e){d.append(N("#doctype",10)).value=e,E(d)},start:function(e,t,n){var r,o,i,a,u;if(i=h?T.getElementRule(e):{}){for((r=N(i.outputName||e,1)).attributes=t,r.shortEnded=n,d.append(r),(u=p[d.name])&&p[r.name]&&
!u[r.name]&&m.push(r),o=R.length;o--;)(a=R[o].name)in t.map&&((s=D[a])?s.push(r):D[a]=[r]);l[e]&&E(r),n||(d=r),!f&&b[e]&&(f=!0)}},end:function(e){var t,n,r,o,i;if(n=h?T.getElementRule(e):{}){if(l[e]&&!f){if((t=d.firstChild)&&3===t.type)if(0<(r=t.value.replace(y,"")).length)t.value=r,t=t.next;else for(o=t.next,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.next,(0===r.length||w.test(r))&&(t.remove(),t=o),t=o;if((t=d.lastChild)&&3===t.type)if(0<(r=t.value.replace(C,"")).length)t.value=r,t=t.prev;else for(o=t.prev,t.remove(),t=o;t&&3===t.type;)r=t.value,o=t.prev,(0===r.length||w.test(r))&&(t.remove(),t=o),t=o}if(f&&b[e]&&(f=!1),n.removeEmpty&&Mb(T,g,b,d)&&!d.attributes.map.name&&!d.attr("id"))return i=d.parent,l[d.name]?d.empty().remove():d.unwrap(),void(d=i);n.paddEmpty&&(Lb(d)||Mb(T,g,b,d))&&Pb(k,a,l,d
),d=d.parent}}},T);var S=d=new Ob(a.context||k.root_name,11);if(t.parse(e),h&&m.length&&(a.context?a.invalid=!0:function(e){var t,n,r,o,i,a,u,s,c,l,f,d,m,g,p,h;for(d=Ub("tr,td,th,tbody,thead,tfoot,table"),l=T.getNonEmptyElements(),f=T.getWhiteSpaceElements(),m=T.getTextBlockElements(),g=T.getSpecialElements(),t=0;t<e.length;t++)if((n=e[t]).parent&&!n.fixed)if(m[n.name]&&"li"===n.parent.name){for(p=n.next;p&&m[p.name];)p.name="li",p.fixed=!0,n.parent.insert(p,n.parent),p=p.next;n.unwrap(n)}else{for(o=[n],r=n.parent;r&&!T.isValidChild(r.name,n.name)&&!d[r.name];r=r.parent)o.push(r);if(r&&1<o.length){for(o.reverse(),i=a=B(o[0].clone()),c=0;c<o.length-1;c++){for(T.isValidChild(a.name,o[c].name)?(u=B(o[c].clone()),a.append(u)):u=a,s=o[c].firstChild;s&&s!==o[c+1];)h=s.next,u.append(s),s=h;a=u}Mb(T,l,f,i)?r.insert(n,o[0],!0):(r.insert(i,o[0],!0),r.insert(n,i)),r=o[0],(Mb(T,l,f,r)|
|Ib(r,"br"))&&r.empty().remove()}else if(n.parent){if("li"===n.name){if((p=n.prev)&&("ul"===p.name||"ul"===p.name)){p.append(n);continue}if((p=n.next)&&("ul"===p.name||"ul"===p.name)){p.insert(n,p.firstChild,!0);continue}n.wrap(B(new Ob("ul",1)));continue}T.isValidChild(n.parent.name,"div")&&T.isValidChild("div",n.name)?n.wrap(B(new Ob("div",1))):g[n.name]?n.empty().remove():n.unwrap()}}}(m)),v&&("body"===S.name||a.isRootContent)&&function(){var e,t,n=S.firstChild,r=function(e){e&&((n=e.firstChild)&&3===n.type&&(n.value=n.value.replace(y,"")),(n=e.lastChild)&&3===n.type&&(n.value=n.value.replace(C,"")))};if(T.isValidChild(S.name,v.toLowerCase())){for(;n;)e=n.next,3===n.type||1===n.type&&"p"!==n.name&&!l[n.name]&&!n.attr("data-mce-
type")?(t||((t=N(v,1)).attr(k.forced_root_block_attrs),S.insert(t,n)),t.append(n)):(r(t),t=null),n=e;r(t)}}(),!a.invalid){for(c in _){for(s=A[c],i=(n=_[c]).length;i--;)n[i].parent||n.splice(i,1);for(r=0,o=s.length;r<o;r++)s[r](n,c,a)}for(r=0,o=R.length;r<o;r++)if((s=R[r]).name in D){for(i=(n=D[s.name]).length;i--;)n[i].parent||n.splice(i,1);for(i=0,u=s.callbacks.length;i<u;i++)s.callbacks[i](n,s.name,a)}}return S}};return zb(e,k),Rb.register(e,k),e}var $b=function(e,t,n){-1===Yt.inArray(t,n)&&(e.addAttributeFilter(n,function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),t.push(n))},Wb=function(e,t,n){var r=la(n.getInner?t.innerHTML:e.getOuterHTML(t));return n.selection||yo(rr.fromDom(t))?r:Yt.trim(r)},Kb=function(e,t,n){var r=n.selection?Eb({forced_root_block:!1},n):n,o=e.parse(t,r);return Sb.trimTrailingBr(o),o},Xb=function(e,t,n,r,o){var i,a,u,s,c=(i=r,rl(t,n).serialize(i));return a=e,s=c,!(u=o).no_events&&a?Dg(a,Eb(u,{content:s})).content:s};funct
ion Yb(e,t){var a,u,s,c,l,n,r=(a=e,n=["data-mce-selected"],s=(u=t)&&u.dom?u.dom:gi.DOM,c=u&&u.schema?u.schema:ti(a),a.entity_encoding=a.entity_encoding||"named",a.remove_trailing_brs=!("remove_trailing_brs"in a)||a.remove_trailing_brs,l=qb(a,c),Sb.register(l,a,s),{schema:c,addNodeFilter:l.addNodeFilter,addAttributeFilter:l.addAttributeFilter,serialize:function(e,t){var n=Eb({format:"html"},t||{}),r=kb.process(u,e,n),o=Wb(s,r,n),i=Kb(l,o,n);return"tree"===n.format?i:Xb(u,a,c,i,n)},addRules:function(e){c.addValidElements(e)},setRules:function(e){c.setValidElements(e)},addTempAttr:d($b,l,n),getTempAttrs:function(){return n}});return{schema:r.schema,addNodeFilter:r.addNodeFilter,addAttributeFilter:r.addAttributeFilter,serialize:r.serialize,addRules:r.addRules,setRules:r.setRules,addTempAttr:r.addTempAttr,getTempAttrs:r.getTempAttrs}}function Gb(e){return{getBookmark:d(mc,e),moveToBookmark:d(gc,e)}}(Gb||(Gb={})).isBookmark
Node=pc;var Jb,Qb,Zb=Gb,ey=_o.isContentEditableFalse,ty=_o.isContentEditableTrue,ny=function(r,a){var u,s,c,l,f,d,m,g,p,h,v,b,i,y,C,x,w,N=a.dom,E=Yt.each,S=a.getDoc(),k=document,T=Math.abs,A=Math.round,R=a.getBody();l={nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var e=".mce-content-body";a.contentStyles.push(e+" div.mce-resizehandle {position: absolute;border: 1px solid black;box-sizing: content-box;background: #FFF;width: 7px;height: 7px;z-index: 10000}"+e+" .mce-resizehandle:hover {background: #000}"+e+" img[data-mce-selected],"+e+" hr[data-mce-selected] {outline: 1px solid black;resize: none}"+e+" .mce-clonedresizable {position: absolute;"+(de.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"+e+" .mce-resize-helper {background: #555;background: rgba(0,0,0,0.75);border-radius: 3px;border: 1px;color: white;display: none;font-family
: sans-serif;font-size: 12px;white-space: nowrap;line-height: 14px;margin: 5px 10px;padding: 5px;position: absolute;z-index: 10001}");var _=function(e){return e&&("IMG"===e.nodeName||a.dom.is(e,"figure.image"))},n=function(e){var t,n,r=e.target;t=e,n=a.selection.getRng(),!_(t.target)||Sh(t.clientX,t.clientY,n)||e.isDefaultPrevented()||(e.preventDefault(),a.selection.select(r))},D=function(e){return a.dom.is(e,"figure.image")?e.querySelector("img"):e},B=function(e){var t=a.settings.object_resizing;return!1!==t&&!de.iOS&&("string"!=typeof t&&(t="table,img,figure.image,div"),"false"!==e.getAttribute("data-mce-resize")&&e!==a.getBody()&&Dr(rr.fromDom(e),t))},O=function(e){var t,n,r,o;t=e.screenX-d,n=e.screenY-m,y=t*f[2]+h,C=n*f[3]+v,y=y<5?5:y,C=C<5?5:C,(_(u)&&!1!==a.settings.resize_img_proportional?!Oh.modifierPressed(e):Oh.modifierPressed(e)
||_(u)&&f[2]*f[3]!=0)&&(T(t)>T(n)?(C=A(y*b),y=A(C/b)):(y=A(C/b),C=A(y*b))),N.setStyles(D(s),{width:y,height:C}),r=0<(r=f.startPos.x+t)?r:0,o=0<(o=f.startPos.y+n)?o:0,N.setStyles(c,{left:r,top:o,display:"block"}),c.innerHTML=y+" × "+C,f[2]<0&&s.clientWidth<=y&&N.setStyle(s,"left",g+(h-y)),f[3]<0&&s.clientHeight<=C&&N.setStyle(s,"top",p+(v-C)),(t=R.scrollWidth-x)+(n=R.scrollHeight-w)!=0&&N.setStyles(c,{left:r-t,top:o-n}),i||(Pg(a,u,h,v),i=!0)},P=function(){i=!1;var e=function(e,t){t&&(u.style[e]||!a.schema.isValid(u.nodeName.toLowerCase(),e)?N.setStyle(D(u),e,t):N.setAttrib(D(u),e,t))};e("width",y),e("height",C),N.unbind(S,"mousemove",O),N.unbind(S,"mouseup",P),k!==S&&(N.unbind(k,"mousemove",O),N.unbind(k,"mouseup",P)),N.remove(s),N.remove(c),o(u),Lg(a,u,y,C),N.setAttrib(u,"style&
quot;,N.getAttrib(u,"style")),a.nodeChanged()},o=function(e){var t,r,o,n,i;L(),F(),t=N.getPos(e,R),g=t.x,p=t.y,i=e.getBoundingClientRect(),r=i.width||i.right-i.left,o=i.height||i.bottom-i.top,u!==e&&(u=e,y=C=0),n=a.fire("ObjectSelected",{target:e}),B(e)&&!n.isDefaultPrevented()?E(l,function(n,e){var t;(t=N.get("mceResizeHandle"+e))&&N.remove(t),t=N.add(R,"div",{id:"mceResizeHandle"+e,"data-mce-bogus":"all","class":"mce-resizehandle",unselectable:!0,style:"cursor:"+e+"-resize; margin:0; padding:0"}),11===de.ie&&(t.contentEditable=!1),N.bind(t,"mousedown",function(e){var t;e.stopImmediatePropagation(),e.preventDefault(),d=(t=e).screenX,m=t.screenY,h=D(u).clientWidth,v=D(u).clientHeight,b=v/h,(f=n).startPos={x:r*n[0]+g,y:o*n[1]+p},x=R.scrollWidth,w=R.scrollHeight,s=u.cloneNode(!0),N.addClass(s,"mce-clonedresizable"),N.setAttri
b(s,"data-mce-bogus","all"),s.contentEditable=!1,s.unSelectabe=!0,N.setStyles(s,{left:g,top:p,margin:0}),s.removeAttribute("data-mce-selected"),R.appendChild(s),N.bind(S,"mousemove",O),N.bind(S,"mouseup",P),k!==S&&(N.bind(k,"mousemove",O),N.bind(k,"mouseup",P)),c=N.add(R,"div",{"class":"mce-resize-helper","data-mce-bogus":"all"},h+" × "+v)}),n.elm=t,N.setStyles(t,{left:r*n[0]+g-t.offsetWidth/2,top:o*n[1]+p-t.offsetHeight/2})}):L(),u.setAttribute("data-mce-selected","1")},L=function(){var e,t;for(e in F(),u&&u.removeAttribute("data-mce-selected"),l)(t=N.get("mceResizeHandle"+e))&&(N.unbind(t),N.remove(t))},I=function(e){var t,n=function(e,t){if(e)do{if(e===t)return!0}while(e=e.parentNode)};i||a.removed||(E(N.select("img[data-mce-selected],hr[data-mce-selected]"),function(e)
{e.removeAttribute("data-mce-selected")}),t="mousedown"===e.type?e.target:r.getNode(),n(t=N.$(t).closest("table,img,figure.image,hr")[0],R)&&(z(),n(r.getStart(!0),t)&&n(r.getEnd(!0),t))?o(t):L())},M=function(e){return ey(function(e,t){for(;t&&t!==e;){if(ty(t)||ey(t))return t;t=t.parentNode}return null}(a.getBody(),e))},F=function(){for(var e in l){var t=l[e];t.elm&&(N.unbind(t.elm),delete t.elm)}},z=function(){try{a.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}};return a.on("init",function(){z(),de.ie&&11<=de.ie&&(a.on("mousedown click",function(e){var t=e.target,n=t.nodeName;i||!/^(TABLE|IMG|HR)$/.test(n)||M(t)||(2!==e.button&&a.selection.select(t,"TABLE"===n),"mousedown"===e.type&&a.nodeChanged())}),a.dom.bind(R,"mscontrolselect",function(e){var t=function(e){ve.setEditorTimeout(a,function(){a.selection.select(
e)})};if(M(e.target))return e.preventDefault(),void t(e.target);/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"===e.target.tagName&&t(e.target))}));var t=ve.throttle(function(e){a.composing||I(e)});a.on("nodechange ResizeEditor ResizeWindow drop FullscreenStateChanged",t),a.on("keyup compositionend",function(e){u&&"TABLE"===u.nodeName&&t(e)}),a.on("hide blur",L),a.on("contextmenu",n)}),a.on("remove",F),{isResizable:B,showResizeRect:o,hideResizeRect:L,updateResizeRect:I,destroy:function(){u=s=null}}},ry=function(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}},oy=function(e,t,n){var r,o,i,a,u,s=e.dom,c=s.getRoot(),l=0;if(u={elm:t,alignToTop:n},e.fire("scrollIntoView",u),!u.isDefaultPrevented()&&_o.isElement(t)){if(!1===n&&(l=t.offsetHeight),"BODY"!==c.nodeName
){var f=e.selection.getScrollContainer();if(f)return r=ry(t).y-ry(f).y+l,a=f.clientHeight,void((r<(i=f.scrollTop)||i+a<r+25)&&(f.scrollTop=r<i?r:r-a+25))}o=s.getViewPort(e.getWin()),r=s.getPos(t).y+l,i=o.y,a=o.h,(r<o.y||i+a<r+25)&&e.getWin().scrollTo(0,r<i?r:r-a+25)}},iy=function(d,e){ee(du.fromRangeStart(e).getClientRects()).each(function(e){var t,n,r,o,i,a,u,s,c,l=function(e){if(e.inline)return e.getBody().getBoundingClientRect();var t=e.getWin();return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight,width:t.innerWidth,height:t.innerHeight}}(d),f={x:(i=t=l,a=n=e,a.left>i.left&&a.right<i.right?0:a.left<i.left?a.left-i.left:a.right-i.right),y:(r=t,o=n,o.top>r.top&&o.bottom<r.bottom?0:o.top<r.top?o.top-r.top:o.bottom-r.bottom)};s=0!==f.x?0<f.x?f.x+4:f.x-4:0,c=0!==f.y?0<f.y?f.y+4:f.y-4:0,(u=d).inline?(u.getBody().scrollLeft+=s,u.getBody().scrollTop+=c):u.getWin().scrollBy(s,c)})},ay=function(e){return _o.is
ContentEditableTrue(e)||_o.isContentEditableFalse(e)},uy=function(e,t,n){var r,o,i,a,u,s=n;if(s.caretPositionFromPoint)(o=s.caretPositionFromPoint(e,t))&&((r=n.createRange()).setStart(o.offsetNode,o.offset),r.collapse(!0));else if(n.caretRangeFromPoint)r=n.caretRangeFromPoint(e,t);else if(s.body.createTextRange){r=s.body.createTextRange();try{r.moveToPoint(e,t),r.collapse(!0)}catch(c){r=function(e,n,t){var r,o,i;if(r=t.elementFromPoint(e,n),o=t.body.createTextRange(),r&&"HTML"!==r.tagName||(r=t.body),o.moveToElementText(r),0<(i=(i=Yt.toArray(o.getClientRects())).sort(function(e,t){return(e=Math.abs(Math.max(e.top-n,e.bottom-n)))-(t=Math.abs(Math.max(t.top-n,t.bottom-n)))})).length){n=(i[0].bottom+i[0].top)/2;try{return o.moveToPoint(e,n),o.collapse(!0),o}catch(a){}}return null}(e,t,n)}return i=r,a=n.body,u=i&&i.parentElement?i.parentElement():null,_o.isContentEditableFalse(function(e,t,n){for(;e&&e!==t;){if(n(e))return e;e=e.parentNode}re
turn null}(u,a,ay))?null:i}return r},sy=function(n,e){return $(e,function(e){var t=n.fire("GetSelectionRange",{range:e});return t.range!==e?t.range:e})},cy=function(e,t){var n=(t||document).createDocumentFragment();return F(e,function(e){n.appendChild(e.dom())}),rr.fromDom(n)},ly=Er("element","width","rows"),fy=Er("element","cells"),dy=Er("x","y"),my=function(e,t){var n=parseInt(br(e,t),10);return isNaN(n)?1:n},gy=function(e){return U(e,function(e,t){return t.cells().length>e?t.cells().length:e},0)},py=function(e,t){for(var n=e.rows(),r=0;r<n.length;r++)for(var o=n[r].cells(),i=0;i<o.length;i++)if(Or(o[i],t))return A.some(dy(i,r));return A.none()},hy=function(e,t,n,r,o){for(var i=[],a=e.rows(),u=n;u<=o;u++){var s=a[u].cells(),c=t<r?s.slice(t,r+1):s.slice(r,t+1);i.push(fy(a[u].element(),c))}return i},vy=function(e){var o=ly(oa(e),0,[]);return F(Vi(e,"tr"),function(n,r){F(Vi(n,&quo
t;td,th"),function(e,t){!function(e,t,n,r,o){for(var i=my(o,"rowspan"),a=my(o,"colspan"),u=e.rows(),s=n;s<n+i;s++){u[s]||(u[s]=fy(ia(r),[]));for(var c=t;c<t+a;c++)u[s].cells()[c]=s===n&&c===t?o:oa(o)}}(o,function(e,t,n){for(;r=t,o=n,i=void 0,((i=e.rows())[o]?i[o].cells():[])[r];)t++;var r,o,i;return t}(o,t,r),r,n,e)})}),ly(o.element(),gy(o.rows()),o.rows())},by=function(e){return n=$((t=e).rows(),function(e){var t=$(e.cells(),function(e){var t=ia(e);return yr(t,"colspan"),yr(t,"rowspan"),t}),n=oa(e.element());return Ti(n,t),n}),r=oa(t.element()),o=rr.fromTag("tbody"),Ti(o,n),ki(r,o),r;var t,n,r,o},yy=function(l,e,t){return py(l,e).bind(function(c){return py(l,t).map(function(e){return t=l,r=e,o=(n=c).x(),i=n.y(),a=r.x(),u=r.y(),s=i<u?hy(t,o,i,a,u):hy(t,o,u,a,i),ly(t.element(),gy(s),s);var t,n,r,o,i,a,u,s})})},Cy=function(n,t){return V(n,function(e){return"li"===ur(e)&&Yp(e,t)}).fold(j([]),funct
ion(e){return(t=n,V(t,function(e){return"ul"===ur(e)||"ol"===ur(e)})).map(function(e){return[rr.fromTag("li"),rr.fromTag(ur(e))]}).getOr([]);var t})},xy=function(e,t){var n,r=rr.fromDom(t.commonAncestorContainer),o=Hl(r,e),i=z(o,function(e){return lo(e)||so(e)}),a=Cy(o,t),u=i.concat(a.length?a:po(n=r)?Ir(n).filter(go).fold(j([]),function(e){return[n,e]}):go(n)?[n]:[]);return $(u,oa)},wy=function(){return cy([])},Ny=function(e,t){return n=rr.fromDom(t.cloneContents()),r=xy(e,t),o=U(r,function(e,t){return ki(t,e),t},n),0<r.length?cy([o]):o;var n,r,o},Ey=function(e,o){return(t=e,n=o[0],Wi(n,"table",d(Or,t))).bind(function(e){var t=o[0],n=o[o.length-1],r=vy(e);return yy(r,t,n).map(function(e){return cy([by(e)])})}).getOrThunk(wy);var t,n},Sy=function(e,t){var n,r,o=qd(t,e);return 0<o.length?Ey(e,o):(n=e,0<(r=t).length&&r[0].collapsed?wy():Ny(n,r[0]))},ky=function(e,t){if(void 0===t&&(t={}),t.get=!0,t.format=t.format||"
;html",t.selection=!0,(t=e.fire("BeforeGetContent",t)).isDefaultPrevented())return e.fire("GetContent",t),t.content;if("text"===t.format)return c=e,A.from(c.selection.getRng()).map(function(e){return la(e.toString())}).getOr("");t.getInner=!0;var n,r,o,i,a,u,s,c,l=(r=t,i=(n=e).selection.getRng(),a=n.dom.create("body"),u=n.selection.getSel(),s=sy(n,Fd(u)),i.cloneContents?(o=r.contextual?Sy(rr.fromDom(n.getBody()),s).dom():i.cloneContents())&&a.appendChild(o):a.innerHTML=i.toString(),n.selection.serializer.serialize(a,r));return"tree"===t.format?l:(t.content=e.selection.isCollapsed()?"":l,e.fire("GetContent",t),t.content)},Ty=function(e,t,n){var r,o,i,a=e.selection.getRng(),u=e.getDoc();if((n=n||{format:"html"}).set=!0,n.selection=!0,n.content=t,n.no_events||!(n=e.fire("BeforeSetContent",n)).isDefaultPrevented()){if(t=n.content,a.insertNode){t+='<span id="__caret&qu
ot;>_</span>',a.startContainer===u&&a.endContainer===u?u.body.innerHTML=t:(a.deleteContents(),0===u.body.childNodes.length?u.body.innerHTML=t:a.createContextualFragment?a.insertNode(a.createContextualFragment(t)):(o=u.createDocumentFragment(),i=u.createElement("div"),o.appendChild(i),i.outerHTML=t,a.insertNode(o))),r=e.dom.get("__caret"),(a=u.createRange()).setStartBefore(r),a.setEndBefore(r),e.selection.setRng(a),e.dom.remove("__caret");try{e.selection.setRng(a)}catch(s){}}else a.item&&(u.execCommand("Delete",!1,null),a=e.getRng()),/^\s+/.test(t)?(a.pasteHTML('<span id="__mce_tmp">_</span>'+t),e.dom.remove("__mce_tmp")):a.pasteHTML(t);n.no_events||e.fire("SetContent",n)}else e.fire("SetContent",n)},Ay=function(e,t,n,r,o){var i=n?t.startContainer:t.endContainer,a=n?t.startOffset:t.endOffset;return A.from(i).map(rr.fromDom).map(function(e){return r&&t.collapsed
?e:Hr(e,o(e,a)).getOr(e)}).bind(function(e){return cr(e)?A.some(e):Ir(e)}).map(function(e){return e.dom()}).getOr(e)},Ry=function(e,t,n){return Ay(e,t,!0,n,function(e,t){return Math.min(e.dom().childNodes.length,t)})},_y=function(e,t,n){return Ay(e,t,!1,n,function(e,t){return 0<t?t-1:t})},Dy=function(e,t){for(var n=e;e&&_o.isText(e)&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n},By=Yt.each,Oy=function(e){return!!e.select},Py=function(e){return!(!e||!e.ownerDocument)&&Pr(rr.fromDom(e.ownerDocument),rr.fromDom(e))},Ly=function(u,s,e,c){var n,t,l,f,a,r=function(e,t){return Ty(c,e,t)},o=function(e){var t=m();t.collapse(!!e),i(t)},d=function(){return s.getSelection?s.getSelection():s.document.selection},m=function(){var e,t,n,r,o=function(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}};if(!s)return null;if(null==(r=s.document))return null;if(c.bookmark!==undefined&&!1===ap(c)){var i=hg(c);if(i.isSome())return i.map(fu
nction(e){return sy(c,[e])[0]}).getOr(r.createRange())}try{(e=d())&&(t=0<e.rangeCount?e.getRangeAt(0):e.createRange?e.createRange():r.createRange())}catch(a){}return(t=sy(c,[t])[0])||(t=r.createRange?r.createRange():r.body.createTextRange()),t.setStart&&9===t.startContainer.nodeType&&t.collapsed&&(n=u.getRoot(),t.setStart(n,0),t.setEnd(n,0)),l&&f&&(0===o(t.START_TO_START,t,l)&&0===o(t.END_TO_END,t,l)?t=f:f=l=null),t},i=function(e,t){var n,r;if((o=e)&&(Oy(o)||Py(o.startContainer)&&Py(o.endContainer))){var o,i=Oy(e)?e:null;if(i){f=null;try{i.select()}catch(a){}}else{if(n=d(),e=c.fire("SetSelectionRange",{range:e,forward:t}).range,n){f=e;try{n.removeAllRanges(),n.addRange(e)}catch(a){}!1===t&&n.extend&&(n.collapse(e.endContainer,e.endOffset),n.extend(e.startContainer,e.startOffset)),l=0<n.rangeCount?n.getRangeAt(0):null}e.collapsed||e.startContainer!==e.endContainer||!n.setBaseAndExt
ent||de.ie||e.endOffset-e.startOffset<2&&e.startContainer.hasChildNodes()&&(r=e.startContainer.childNodes[e.startOffset])&&"IMG"===r.tagName&&(n.setBaseAndExtent(e.startContainer,e.startOffset,e.endContainer,e.endOffset),n.anchorNode===e.startContainer&&n.focusNode===e.endContainer||n.setBaseAndExtent(r,0,r,1)),c.fire("AfterSetSelectionRange",{range:e,forward:t})}}},g=function(){var e,t,n=d();return!(n&&n.anchorNode&&n.focusNode)||((e=u.createRng()).setStart(n.anchorNode,n.anchorOffset),e.collapse(!0),(t=u.createRng()).setStart(n.focusNode,n.focusOffset),t.collapse(!0),e.compareBoundaryPoints(e.START_TO_START,t)<=0)},p={bookmarkManager:null,controlSelection:null,dom:u,win:s,serializer:e,editor:c,collapse:o,setCursorLocation:function(e,t){var n=u.createRng();e?(n.setStart(e,t),n.setEnd(e,t),i(n),o(!1)):(Gp(u,n,c.getBody(),!0),i(n))},getContent:function(e){return ky(c,e)},setContent:r,getBookmark:functio
n(e,t){return n.getBookmark(e,t)},moveToBookmark:function(e){return n.moveToBookmark(e)},select:function(e,t){var r,n,o;return(r=u,n=e,o=t,A.from(n).map(function(e){var t=r.nodeIndex(e),n=r.createRng();return n.setStart(e.parentNode,t),n.setEnd(e.parentNode,t+1),o&&(Gp(r,n,e,!0),Gp(r,n,e,!1)),n})).each(i),e},isCollapsed:function(){var e=m(),t=d();return!(!e||e.item)&&(e.compareEndPoints?0===e.compareEndPoints("StartToEnd",e):!t||e.collapsed)},isForward:g,setNode:function(e){return r(u.getOuterHTML(e)),e},getNode:function(){return e=c.getBody(),(t=m())?(r=t.startContainer,o=t.endContainer,i=t.startOffset,a=t.endOffset,n=t.commonAncestorContainer,!t.collapsed&&(r===o&&a-i<2&&r.hasChildNodes()&&(n=r.childNodes[i]),3===r.nodeType&&3===o.nodeType&&(r=r.length===i?Dy(r.nextSibling,!0):r.parentNode,o=0===a?Dy(o.previousSibling,!1):o.parentNode,r&&r===o))?r:n&&3===n.nodeType?n.parentNode:n):e;var e,
t,n,r,o,i,a},getSel:d,setRng:i,getRng:m,getStart:function(e){return Ry(c.getBody(),m(),e)},getEnd:function(e){return _y(c.getBody(),m(),e)},getSelectedBlocks:function(e,t){return function(e,t,n,r){var o,i,a=[];if(i=e.getRoot(),n=e.getParent(n||Ry(i,t,t.collapsed),e.isBlock),r=e.getParent(r||_y(i,t,t.collapsed),e.isBlock),n&&n!==i&&a.push(n),n&&r&&n!==r)for(var u=new ro(o=n,i);(o=u.next())&&o!==r;)e.isBlock(o)&&a.push(o);return r&&n!==r&&r!==i&&a.push(r),a}(u,m(),e,t)},normalize:function(){var e=m(),t=d();if(!Ud(t)&&Jp(c)){var n=jm(u,e);return n.each(function(e){i(e,g())}),n.getOr(e)}return e},selectorChanged:function(e,t){var i;return a||(a={},i={},c.on("NodeChange",function(e){var n=e.element,r=u.getParents(n,null,u.getRoot()),o={};By(a,function(e,n){By(r,function(t){if(u.is(t,n))return i[n]||(By(e,function(e){e(!0,{node:t,selector:n,parents:r})}),i[n]=e),o[n]=e,!1})}),By(i,function(e,t){o[t]|
|(delete i[t],By(e,function(e){e(!1,{node:n,selector:t,parents:r})}))})})),a[e]||(a[e]=[]),a[e].push(t),p},getScrollContainer:function(){for(var e,t=u.getRoot();t&&"BODY"!==t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return oy(c,e,t)},placeCaretAt:function(e,t){return i(uy(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=m();return e.collapsed?hu.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,t.destroy()}};return n=Zb(p),t=ny(p,c),p.bookmarkManager=n,p.controlSelection=t,p},Iy=_o.isContentEditableFalse,My=Ua,Fy=As,zy=Ts,Uy=function(e,t){for(;t=e(t);)if(t.isVisible())return t;return t},Vy=function(e,t,n,r){var o,i,a,u,s,c,l=e===gu.Forwards,f=l?zy:Fy;return!r.collapsed&&(o=My(r),Iy(o))?Ah(e,t,o,e===gu.Backwards,!0):(u=ma(r.startContainer),f(i=ks(e,t.getBody(),r))?Rh(t,i.getNode(!l)):(i=n(i))?f(i)?Ah(e,t,i.getNode(!l),l,!0):f(a=n(i))&am
p;&(!(c=hs(s=i,a))&&_o.isBr(s.getNode())||c)?Ah(e,t,a.getNode(!l),l,!0):u?Dh(t,i.toRange(),!0):null:u?r:null)},Hy=function(e,t,n,r){var o,i,a,u,s,c,l,f,d;if(d=My(r),o=ks(e,t.getBody(),r),i=n(t.getBody(),ph(1),o),a=z(i,hh(1)),s=qt.last(o.getClientRects()),(zy(o)||Rs(o))&&(d=o.getNode()),(Fy(o)||_s(o))&&(d=o.getNode(!0)),!s)return null;if(c=s.left,(u=wh(a,c))&&Iy(u.node))return l=Math.abs(c-u.left),f=Math.abs(c-u.right),Ah(e,t,u.node,l<f,!0);if(d){var m=function(e,t,n,r){var o,i,a,u,s,c,l=Gs(t),f=[],d=0,m=function(e){return qt.last(e.getClientRects())};1===e?(o=l.next,i=za,a=Fa,u=hu.after(r)):(o=l.prev,i=Fa,a=za,u=hu.before(r)),c=m(u);do{if(u.isVisible()&&!a(s=m(u),c)){if(0<f.length&&i(s,qt.last(f))&&d++,(s=La(s)).position=u,s.line=d,n(s))return f;f.push(s)}}while(u=o(u));return f}(e,t.getBody(),ph(1),d);if(u=wh(z(m,hh(1)),c))return Dh(t,u.position.toRange(),!0);if(u=qt.last(z(m,hh(0))))return Dh(t,u.position.toRange(),
!0)}},jy=function(e,t,n){var r,o,i,a,u=Gs(e.getBody()),s=d(Uy,u.next),c=d(Uy,u.prev);if(n.collapsed&&e.settings.forced_root_block){if(!(r=e.dom.getParent(n.startContainer,"PRE")))return;(1===t?s(hu.fromRangeStart(n)):c(hu.fromRangeStart(n)))||(a=(i=e).dom.create(i.settings.forced_root_block),(!de.ie||11<=de.ie)&&(a.innerHTML='<br data-mce-bogus="1">'),o=a,1===t?e.$(r).after(o):e.$(r).before(o),e.selection.select(o,!0),e.selection.collapse())}},qy=function(l,f){return function(){var e,t,n,r,o,i,a,u,s,c=(t=f,r=Gs((e=l).getBody()),o=d(Uy,r.next),i=d(Uy,r.prev),a=t?gu.Forwards:gu.Backwards,u=t?o:i,s=e.selection.getRng(),(n=Vy(a,e,u,s))?n:(n=jy(e,a,s))||null);return!!c&&(l.selection.setRng(c),!0)}},$y=function(u,s){return function(){var e,t,n,r,o,i,a=(r=(t=s)?1:-1,o=t?gh:mh,i=(e=u).selection.getRng(),(n=Hy(r,e,o,i))?n:(n=jy(e,r,i))||null);return!!a&&(u.selection.setRng(a),!0)}};(Qb=Jb||(Jb={}))[Qb.Br=0]="Br",Qb[Qb.Blo
ck=1]="Block",Qb[Qb.Wrap=2]="Wrap",Qb[Qb.Eol=3]="Eol";var Wy=function(e,t){return e===gu.Backwards?t.reverse():t},Ky=function(e,t,n,r){for(var o,i,a,u,s,c,l=Gs(n),f=r,d=[];f&&(s=l,c=f,o=t===gu.Forwards?s.next(c):s.prev(c));){if(_o.isBr(o.getNode(!1)))return t===gu.Forwards?{positions:Wy(t,d).concat([o]),breakType:Jb.Br,breakAt:A.some(o)}:{positions:Wy(t,d),breakType:Jb.Br,breakAt:A.some(o)};if(o.isVisible()){if(e(f,o)){var m=(i=t,a=f,u=o,_o.isBr(u.getNode(i===gu.Forwards))?Jb.Br:!1===hs(a,u)?Jb.Block:Jb.Wrap);return{positions:Wy(t,d),breakType:m,breakAt:A.some(o)}}d.push(o),f=o}else f=o}return{positions:Wy(t,d),breakType:Jb.Eol,breakAt:A.none()}},Xy=function(n,r,o,e){return r(o,e).breakAt.map(function(e){var t=r(o,e).positions;return n===gu.Backwards?t.concat(e):[e].concat(t)}).getOr([])},Yy=function(e,i){return U(e,function(e,o){return e.fold(function(){return A.some(o)},function(r){return qa([ee(r.getClientRects()),ee(o.getClientRects())],func
tion(e,t){var n=Math.abs(i-e.left);return Math.abs(i-t.left)<=n?o:r}).or(e)})},A.none())},Gy=function(t,e){return ee(e.getClientRects()).bind(function(e){return Yy(t,e.left)})},Jy=d(Ky,du.isAbove,-1),Qy=d(Ky,du.isBelow,1),Zy=d(Xy,-1,Jy),eC=d(Xy,1,Qy),tC=function(e,t,n,r,o){var i,a,u,s,c=Vi(rr.fromDom(n),"td,th,caption").map(function(e){return e.dom()}),l=z((i=e,G(c,function(e){var t,n,r=(t=La(e.getBoundingClientRect()),n=-1,{left:t.left-n,top:t.top-n,right:t.right+2*n,bottom:t.bottom+2*n,width:t.width+n,height:t.height+n});return[{x:r.left,y:i(r),cell:e},{x:r.right,y:i(r),cell:e}]})),function(e){return t(e,o)});return(a=l,u=r,s=o,U(a,function(e,r){return e.fold(function(){return A.some(r)},function(e){var t=Math.sqrt(Math.abs(e.x-u)+Math.abs(e.y-s)),n=Math.sqrt(Math.abs(r.x-u)+Math.abs(r.y-s));return A.some(n<t?r:e)})},A.none())).map(function(e){return e.cell})},nC=d(tC,function(e){return e.bottom},function(e,t){return e.y<t}),rC=d(tC,function(e){return e.top},fun
ction(e,t){return e.y>t}),oC=function(t,n){return ee(n.getClientRects()).bind(function(e){return nC(t,e.left,e.top)}).bind(function(e){return Gy((t=e,ic.lastPositionIn(t).map(function(e){return Jy(t,e).positions.concat(e)}).getOr([])),n);var t})},iC=function(t,n){return te(n.getClientRects()).bind(function(e){return rC(t,e.left,e.top)}).bind(function(e){return Gy((t=e,ic.firstPositionIn(t).map(function(e){return[e].concat(Qy(t,e).positions)}).getOr([])),n);var t})},aC=function(e,t){e.selection.setRng(t),iy(e,t)},uC=function(e,t,n){var r,o,i,a,u=e(t,n);return(a=u).breakType===Jb.Wrap&&0===a.positions.length||!_o.isBr(n.getNode())&&(i=u).breakType===Jb.Br&&1===i.positions.length?(r=e,o=t,!u.breakAt.map(function(e){return r(o,e).breakAt.isSome()}).getOr(!1)):u.breakAt.isNone()},sC=d(uC,Jy),cC=d(uC,Qy),lC=function(e,t,n,r){var o,i,a,u,s=e.selection.getRng(),c=t?1:-1;if(es()&&(o=t,i=s,a=n,u=hu.fromRangeStart(i),ic.positionIn(!o,a).map(function(e){return
e.isEqual(u)}).getOr(!1))){var l=Ah(c,e,n,!t,!0);return aC(e,l),!0}return!1},fC=function(e,t){var n=t.getNode(e);return _o.isElement(n)&&"TABLE"===n.nodeName?A.some(n):A.none()},dC=function(u,s,c){var e=fC(!!s,c),t=!1===s;e.fold(function(){return aC(u,c.toRange())},function(a){return ic.positionIn(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return aC(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=mm(r=u))?r.undoManager.transact(function(){var e=rr.fromTag(i);vr(e,gm(r)),ki(e,rr.fromTag("br")),n?Ei(rr.fromDom(o),e):Ni(rr.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom(),0),t.setEnd(e.dom(),0),aC(r,t)}):aC(r,t.toRange()));var n,r,o,t,i})})},mC=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=hu.fromRangeStart(l),d=e.getBody();if(!t&&sC(r,f)){var m=(u=d,oC(s=n,c=f).orThunk(function(){return ee(c.getClientRects()).bind(function(e){return Yy(Zy(u,hu.before(s)),e.left)})}).getOr(hu.before(s)));return
dC(e,t,m),!0}return!(!t||!cC(r,f))&&(o=d,m=iC(i=n,a=f).orThunk(function(){return ee(a.getClientRects()).bind(function(e){return Yy(eC(o,hu.after(i)),e.left)})}).getOr(hu.after(i)),dC(e,t,m),!0)},gC=function(t,n){return function(){return A.from(t.dom.getParent(t.selection.getNode(),"td,th")).bind(function(e){return A.from(t.dom.getParent(e,"table")).map(function(e){return lC(t,n,e)})}).getOr(!1)}},pC=function(n,r){return function(){return A.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return A.from(n.dom.getParent(t,"table")).map(function(e){return mC(n,r,e,t)})}).getOr(!1)}},hC=function(e){return M(["figcaption"],ur(e))},vC=function(e){var t=document.createRange();return t.setStartBefore(e.dom()),t.setEndBefore(e.dom()),t},bC=function(e,t,n){n?ki(e,t):Si(e,t)},yC=function(e,t,n,r){return""===t?(l=e,f=r,d=rr.fromTag("br"),bC(l,d,f),vC(d)):(o=e,i=r,a=t,u=n,s=rr.fromTag(a),c=rr.fromT
ag("br"),vr(s,u),ki(s,c),bC(o,s,i),vC(c));var o,i,a,u,s,c,l,f,d},CC=function(e,t,n){return t?(o=e.dom(),Qy(o,n).breakAt.isNone()):(r=e.dom(),Jy(r,n).breakAt.isNone());var r,o},xC=function(t,n){var e,r,o,i=rr.fromDom(t.getBody()),a=hu.fromRangeStart(t.selection.getRng()),u=mm(t),s=gm(t);return(e=a,r=i,o=d(Or,r),$i(rr.fromDom(e.container()),co,o).filter(hC)).exists(function(){if(CC(i,n,a)){var e=yC(i,u,s,n);return t.selection.setRng(e),!0}return!1})},wC=function(e,t){return function(){return!!e.selection.isCollapsed()&&xC(e,t)}},NC=function(e,r){return G($(e,function(e){return Eb({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:o},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},EC=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Array.prototype.slice.call(arguments,1);return fu
nction(){return e.apply(null,r)}},SC=function(e,t){return V(NC(e,t),function(e){return e.action()})},kC=function(i,a){i.on("keydown",function(e){var t,n,r,o;!1===e.isDefaultPrevented()&&(t=i,n=a,r=e,o=tr.detect().os,SC([{keyCode:Oh.RIGHT,action:qy(t,!0)},{keyCode:Oh.LEFT,action:qy(t,!1)},{keyCode:Oh.UP,action:$y(t,!1)},{keyCode:Oh.DOWN,action:$y(t,!0)},{keyCode:Oh.RIGHT,action:gC(t,!0)},{keyCode:Oh.LEFT,action:gC(t,!1)},{keyCode:Oh.UP,action:pC(t,!1)},{keyCode:Oh.DOWN,action:pC(t,!0)},{keyCode:Oh.RIGHT,action:bd.move(t,n,!0)},{keyCode:Oh.LEFT,action:bd.move(t,n,!1)},{keyCode:Oh.RIGHT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:bd.moveNextWord(t,n)},{keyCode:Oh.LEFT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:bd.movePrevWord(t,n)},{keyCode:Oh.UP,action:wC(t,!1)},{keyCode:Oh.DOWN,action:wC(t,!0)}],r).each(function(e){r.preventDefault()}))})},TC=function(e){return 1===Vr(e).length},AC=function(e,t,n,r){var o,i,a,u,s=d(_v,t),c=$(z(r,s),function(e){return e.dom()});if(0==
=c.length)Tf(t,e,n);else{var l=(o=n.dom(),i=c,a=Nv(!1),u=Av(i,a.dom()),Ni(rr.fromDom(o),a),Ri(rr.fromDom(o)),hu(u,0));t.selection.setRng(l.toRange())}},RC=function(r,o){var t,e=rr.fromDom(r.getBody()),n=rr.fromDom(r.selection.getStart()),i=z((t=Hl(n,e),K(t,co).fold(j(t),function(e){return t.slice(0,e)})),TC);return te(i).map(function(e){var t,n=hu.fromRangeStart(r.selection.getRng());return!(!Tl(o,n,e.dom())||Fu((t=e).dom())&&xv(t.dom())||(AC(o,r,e,i),0))}).getOr(!1)},_C=function(e,t){return!!e.selection.isCollapsed()&&RC(e,t)},DC=function(o,i){o.on("keydown",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(t=o,n=i,r=e,SC([{keyCode:Oh.BACKSPACE,action:EC(_f,t,!1)},{keyCode:Oh.DELETE,action:EC(_f,t,!0)},{keyCode:Oh.BACKSPACE,action:EC(wd,t,n,!1)},{keyCode:Oh.DELETE,action:EC(wd,t,n,!0)},{keyCode:Oh.BACKSPACE,action:EC(tm,t,!1)},{keyCode:Oh.DELETE,action:EC(tm,t,!0)},{keyCode:Oh.BACKSPACE,action:EC(tf,t,!1)},{keyCode:Oh.DELETE,action:EC(tf,t,!0)},{
keyCode:Oh.BACKSPACE,action:EC(Jl,t,!1)},{keyCode:Oh.DELETE,action:EC(Jl,t,!0)},{keyCode:Oh.BACKSPACE,action:EC(_C,t,!1)},{keyCode:Oh.DELETE,action:EC(_C,t,!0)}],r).each(function(e){r.preventDefault()}))}),o.on("keyup",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=o,n=e,SC([{keyCode:Oh.BACKSPACE,action:EC(Df,t)},{keyCode:Oh.DELETE,action:EC(Df,t)}],n))})},BC=function(e){return A.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},OC=function(e,t){var n,r,o,i=t,a=e.dom,u=e.schema.getMoveCaretBeforeOnEnterElements();if(t){if(/^(LI|DT|DD)$/.test(t.nodeName)){var s=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild);s&&/^(UL|OL|DL)$/.test(s.nodeName)&&t.insertBefore(a.doc.createTextNode("\xa0"),t.firstChild)}if(o=a.createRng(),t.normalize(),t.hasChildNodes()){for(n=new ro(t,t);r=n.current();){if(_o.isText(r)){o.setStart(r,0),o.setEnd(r
,0);break}if(u[r.nodeName.toLowerCase()]){o.setStartBefore(r),o.setEndBefore(r);break}i=r,r=n.next()}r||(o.setStart(i,0),o.setEnd(i,0))}else _o.isBr(t)?t.nextSibling&&a.isBlock(t.nextSibling)?(o.setStartBefore(t),o.setEndBefore(t)):(o.setStartAfter(t),o.setEndAfter(t)):(o.setStart(t,0),o.setEnd(t,0));e.selection.setRng(o),a.remove(void 0),e.selection.scrollIntoView(t)}},PC=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},LC=BC,IC=function(e){return BC(e).fold(j(""),function(e){return e.nodeName.toUpperCase()})},MC=function(e){return BC(e).filter(function(e){return po(rr.fromDom(e))}).isSome()},FC=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},zC=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},UC=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},VC=fu
nction(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!_o.isElement(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},HC=function(e,t,n,r,o){var i=e.dom,a=e.selection.getRng();if(n!==e.getBody()){var u;zC(u=n)&&zC(u.parentNode)&&(o="LI");var s,c,l=o?t(o):i.create("BR");if(VC(n,r,!0)&&VC(n,r,!1))FC(n,"LI")?i.insertAfter(l,UC(n)):i.replace(l,n);else if(VC(n,r,!0))FC(n,"LI")?(i.insertAfter(l,UC(n)),l.appendChild(i.doc.createTextNode(" ")),l.appendChild(n)):n.parentNode.insertBefore(l,n);else if(VC(n,r,!1))i.insertAfter(l,UC(n));else{n=UC(n);var f=a.cloneRange();f.setStartAfter(r),f.setEndAfter(n);var d=f.extractContents();"LI"===o&&(c="LI",(s=d).firstChild&&s.firstChild.nodeName===c)?(l=d.firstChild,i.insertAfter(d,n)):(i.insertAfter(d,n),i.insertAfter(l,n))}i.remove(r),OC(e,l)}},jC=function(e){e.innerHTML='<br data-m
ce-bogus="1">'},qC=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},$C=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},WC=function(e,t,n){return!1===_o.isText(t)?n:e?1===n&&t.data.charAt(n-1)===ca?0:n:n===t.data.length-1&&t.data.charAt(n)===ca?t.data.length:n},KC=function(e,t){var n,r,o=e.getRoot();for(n=t;n!==o&&"false"!==e.getContentEditable(n);)"true"===e.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==o?r:o},XC=function(e,t){var n=mm(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&e.dom.setAttribs(t,gm(e))},YC=function(a,e){var t,u,s,i,c,n,r,o,l,f,d,m,g,p,h,v,b,y,C,x=a.dom,w=a.schema,N=w.getNonEmptyElements(),E=a.selection.getRng(),S=function(e){var t,n,r,o=s,i=w.getTextInlineElements();if(e|
|"TABLE"===f||"HR"===f?(t=x.create(e||m),XC(a,t)):t=c.cloneNode(!1),r=t,!1===vm(a))x.setAttrib(t,"style",null),x.setAttrib(t,"class",null);else do{if(i[o.nodeName]){if(Fu(o))continue;n=o.cloneNode(!1),x.setAttrib(n,"id",""),t.hasChildNodes()?n.appendChild(t.firstChild):r=n,t.appendChild(n)}}while((o=o.parentNode)&&o!==u);return jC(r),t},k=function(e){var t,n,r,o;if(o=WC(e,s,i),_o.isText(s)&&(e?0<o:o<s.nodeValue.length))return!1;if(s.parentNode===c&&g&&!e)return!0;if(e&&_o.isElement(s)&&s===c.firstChild)return!0;if(qC(s,"TABLE")||qC(s,"HR"))return g&&!e||!g&&e;for(t=new ro(s,c),_o.isText(s)&&(e&&0===o?t.prev():e||o!==s.nodeValue.length||t.next());n=t.current();){if(_o.isElement(n)){if(!n.getAttribute("data-mce-bogus")&&(r=n.nodeName.toLowerCase(),N[r]&&"br"!==r))return!1}else if(_o.isT
ext(n)&&!/^[ \t\r\n]*$/.test(n.nodeValue))return!1;e?t.prev():t.next()}return!0},T=function(){r=/^(H[1-6]|PRE|FIGURE)$/.test(f)&&"HGROUP"!==d?S(m):S(),bm(a)&&$C(x,l)&&x.isEmpty(c)?r=x.split(l,c):x.insertAfter(r,c),OC(a,r)};jm(x,E).each(function(e){E.setStart(e.startContainer,e.startOffset),E.setEnd(e.endContainer,e.endOffset)}),s=E.startContainer,i=E.startOffset,m=mm(a),n=e.shiftKey,_o.isElement(s)&&s.hasChildNodes()&&(g=i>s.childNodes.length-1,s=s.childNodes[Math.min(i,s.childNodes.length-1)]||s,i=g&&_o.isText(s)?s.nodeValue.length:0),(u=KC(x,s))&&((m&&!n||!m&&n)&&(s=function(e,t,n,r,o){var i,a,u,s,c,l,f,d=t||"P",m=e.dom,g=KC(m,r);if(!(a=m.getParent(r,m.isBlock))||!$C(m,a)){if(l=(a=a||g)===e.getBody()||(f=a)&&/^(TD|TH|CAPTION)$/.test(f.nodeName)?a.nodeName.toLowerCase():a.parentNode.nodeName.toLowerCase(),!a.hasChildNodes())return i=m.create(d),XC(e,i),a.appendChil
d(i),n.setStart(i,0),n.setEnd(i,0),i;for(s=r;s.parentNode!==a;)s=s.parentNode;for(;s&&!m.isBlock(s);)s=(u=s).previousSibling;if(u&&e.schema.isValidChild(l,d.toLowerCase())){for(i=m.create(d),XC(e,i),u.parentNode.insertBefore(i,u),s=u;s&&!m.isBlock(s);)c=s.nextSibling,i.appendChild(s),s=c;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,m,E,s,i)),c=x.getParent(s,x.isBlock),l=c?x.getParent(c.parentNode,x.isBlock):null,f=c?c.nodeName.toUpperCase():"","LI"!==(d=l?l.nodeName.toUpperCase():"")||e.ctrlKey||(l=(c=l).parentNode,f=d),/^(LI|DT|DD)$/.test(f)&&x.isEmpty(c)?HC(a,S,l,c,m):m&&c===a.getBody()||(m=m||"P",ma(c)?(r=wa(c),x.isEmpty(c)&&jC(c),OC(a,r)):k()?T():k(!0)?(r=c.parentNode.insertBefore(S(),c),OC(a,qC(c,"HR")?r:c)):((t=(y=E,C=y.cloneRange(),C.setStart(y.startContainer,WC(!0,y.startContainer,y.startOffset)),C.setEnd(y.endContainer,WC(!1,y.endContainer,y.endOffset)),C).cloneRange()).setEndAft
er(c),o=t.extractContents(),b=o,F(Ui(rr.fromDom(b),lr),function(e){var t=e.dom();t.nodeValue=la(t.nodeValue)}),function(e){for(;_o.isText(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(o),r=o.firstChild,x.insertAfter(o,c),function(e,t,n){var r,o=n,i=[];if(o){for(;o=o.firstChild;){if(e.isBlock(o))return;_o.isElement(o)&&!t[o.nodeName.toLowerCase()]&&i.push(o)}for(r=i.length;r--;)!(o=i[r]).hasChildNodes()||o.firstChild===o.lastChild&&""===o.firstChild.nodeValue?e.remove(o):(a=e,(u=o)&&"A"===u.nodeName&&a.isEmpty(u)&&e.remove(o));var a,u}}(x,N,r),p=x,(h=c).normalize(),(v=h.lastChild)&&!/^(left|right)$/gi.test(p.getStyle(v,"float",!0))||p.add(h,"br"),x.isEmpty(c)&&jC(c),r.normalize(),x.isEmpty(r)?(x.remove(r),T()):OC(a,r)),x.setAttrib(r,"id",""),a.fire("NewBlock",{newBlock:r})))},GC=function(e,t){return LC(e).fil
ter(function(e){return 0<t.length&&Dr(rr.fromDom(e),t)}).isSome()},JC=function(e){return GC(e,pm(e))},QC=function(e){return GC(e,hm(e))},ZC=nf([{br:[]},{block:[]},{none:[]}]),ex=function(e,t){return QC(e)},tx=function(n){return function(e,t){return""===mm(e)===n}},nx=function(n){return function(e,t){return MC(e)===n}},rx=function(n,r){return function(e,t){return IC(e)===n.toUpperCase()===r}},ox=function(e){return rx("pre",e)},ix=function(n){return function(e,t){return dm(e)===n}},ax=function(e,t){return JC(e)},ux=function(e,t){return t},sx=function(e){var t=mm(e),n=PC(e.dom,e.selection.getStart());return n&&e.schema.isValidChild(n.nodeName,t||"P")},cx=function(e,t){return function(n,r){return U(e,function(e,t){return e&&t(n,r)},!0)?A.some(t):A.none()}},lx=function(e,t){return Hf([cx([ex],ZC.none()),cx([rx("summary",!0)],ZC.br()),cx([ox(!0),ix(!1),ux],ZC.br()),cx([ox(!0),ix(!1)],ZC.block()),cx([ox(!0),ix(!0),ux],ZC.bl
ock()),cx([ox(!0),ix(!0)],ZC.br()),cx([nx(!0),ux],ZC.br()),cx([nx(!0)],ZC.block()),cx([tx(!0),ux,sx],ZC.block()),cx([tx(!0)],ZC.br()),cx([ax],ZC.br()),cx([tx(!1),ux],ZC.br()),cx([sx],ZC.block())],[e,t.shiftKey]).getOr(ZC.none())},fx=function(e,t){lx(e,t).fold(function(){Zm(e,t)},function(){YC(e,t)},o)},dx=function(o){o.on("keydown",function(e){var t,n,r;e.keyCode===Oh.ENTER&&(t=o,(n=e).isDefaultPrevented()||(n.preventDefault(),(r=t.undoManager).typing&&(r.typing=!1,r.add()),t.undoManager.transact(function(){!1===t.selection.isCollapsed()&&t.execCommand("Delete"),fx(t,n)})))})},mx=function(n,r){var e=r.container(),t=r.offset();return _o.isText(e)?(e.insertData(t,n),A.some(du(e,t+n.length))):Ps(r).map(function(e){var t=rr.fromText(n);return r.isAtEnd()?Ei(e,t):Ni(e,t),du(t.dom(),n.length)})},gx=d(mx,"\xa0"),px=d(mx," "),hx=function(t,n,r){var e=z(Hl(rr.fromDom(r.container()),n),co);return ee(e).fold(function(){return ic.n
avigate(t,n.dom(),r).forall(function(e){return!1===hs(e,r,n.dom())})},function(e){return ic.navigate(t,e.dom(),r).isNone()})},vx=d(hx,!1),bx=d(hx,!0),yx=function(e){return du.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()},Cx=function(e,t){var n=z(Hl(rr.fromDom(t.container()),e),co);return ee(n).getOr(e)},xx=function(e,t){return yx(t)?Os(t):Os(t)||ic.prevPosition(Cx(e,t).dom(),t).exists(Os)},wx=function(e,t){return yx(t)?Bs(t):Bs(t)||ic.nextPosition(Cx(e,t).dom(),t).exists(Bs)},Nx=function(e){return Ps(e).bind(function(e){return $i(e,cr)}).exists(function(e){return t=wr(e,"white-space"),M(["pre","pre-line","pre-wrap"],t);var t})},Ex=function(e,t){return o=e,i=t,ic.prevPosition(o.dom(),i).isNone()||(n=e,r=t,ic.nextPosition(n.dom(),r).isNone())||vx(e,t)||bx(e,t)||uf(e,t)||af(e,t);var n,r,o,i},Sx=function(e,t){return ns(e.charAt(t))},kx=function(e){var t=e.container();return _o.isText(t)&&Wn(t.data,"\xa0")},Tx=f
unction(e,t,n){var r,o,i=du(t,0);return Sx(n,0)&&(r=e,Nx(o=i)||!(vx(r,o)||uf(r,o)||xx(r,o)))?" "+n.slice(1):n},Ax=function(e,t,n){var r,o,i=du(t,n.length);return Sx(n,n.length-1)&&(r=e,Nx(o=i)||!(bx(r,o)||af(r,o)||wx(r,o)))?n.slice(0,-1)+" ":n},Rx=function(i,e){return A.some(e).filter(kx).bind(function(e){var t,n=e.container(),r=n.nodeValue,o=Tx(i,n,(t=Ax(i,n,r),$(t.split(""),function(e,t,n){return ns(e)&&0<t&&t<n.length-1&&os(n[t-1])&&os(n[t+1])?" ":e}).join("")));return r!==o?(e.container().nodeValue=o,A.some(e)):A.none()})},_x=function(t){var e=rr.fromDom(t.getBody());t.selection.isCollapsed()&&Rx(e,du.fromRangeStart(t.selection.getRng())).each(function(e){t.selection.setRng(e.toRange())})},Dx=function(r,o){return function(e){return t=r,!Nx(n=e)&&(Ex(t,n)||xx(t,n)||wx(t,n))?gx(o):px(o);var t,n}},Bx=function(e){var t,n,r=hu.fromRangeStart(e.selection.getRng()),o=
rr.fromDom(e.getBody());if(e.selection.isCollapsed()){var i=d(El.isInlineTarget,e),a=hu.fromRangeStart(e.selection.getRng());return ad(i,e.getBody(),a).bind((n=o,function(e){return e.fold(function(e){return ic.prevPosition(n.dom(),hu.before(e))},function(e){return ic.firstPositionIn(e)},function(e){return ic.lastPositionIn(e)},function(e){return ic.nextPosition(n.dom(),hu.after(e))})})).bind(Dx(o,r)).exists((t=e,function(e){return t.selection.setRng(e.toRange()),t.nodeChanged(),!0}))}return!1},Ox=function(r){r.on("keydown",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=r,n=e,SC([{keyCode:Oh.SPACEBAR,action:EC(Bx,t)}],n).each(function(e){n.preventDefault()}))})},Px=function(e,t){var n;t.hasAttribute("data-mce-caret")&&(wa(t),(n=e).selection.setRng(n.selection.getRng()),e.selection.scrollIntoView(t))},Lx=function(e,t){var n,r=(n=e,Ki(rr.fromDom(n.getBody()),"*[data-mce-caret]").fold(j(null),function(e){return e.dom()}));if(r)return&qu
ot;compositionstart"===t.type?(t.preventDefault(),t.stopPropagation(),void Px(e,r)):void(ha(r)&&(Px(e,r),e.undoManager.add()))},Ix=function(e){e.on("keyup compositionstart",d(Lx,e))},Mx=tr.detect().browser,Fx=function(t){var e,n;e=t,n=Di(function(){e.composing||_x(e)},0),Mx.isIE()&&(e.on("keypress",function(e){n.throttle()}),e.on("remove",function(e){n.cancel()})),t.on("input",function(e){!1===e.isComposing&&_x(t)})},zx=function(e){var t=bd.setupSelectedState(e);Ix(e),kC(e,t),DC(e,t),dx(e),Ox(e),Fx(e)};function Ux(u){var s,n,r,o=Yt.each,c=Oh.BACKSPACE,l=Oh.DELETE,f=u.dom,d=u.selection,e=u.settings,t=u.parser,i=de.gecko,a=de.ie,m=de.webkit,g="data:text/mce-internal,",p=a?"Text":"URL",h=function(e,t){try{u.getDoc().execCommand(e,!1,t)}catch(n){}},v=function(e){return e.isDefaultPrevented()},b=function(){u.shortcuts.add("meta+a",null,"SelectAll")},y=function(){u.on(&qu
ot;keydown",function(e){if(!v(e)&&e.keyCode===c&&d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},C=function(){u.inline||(u.contentStyles.push("body {min-height: 150px}"),u.on("click",function(e){var t;if("HTML"===e.target.nodeName){if(11<de.ie)return void u.getBody().focus();t=u.selection.getRng(),u.getBody().focus(),u.selection.setRng(t),u.selection.normalize(),u.nodeChanged()}}))};return u.on("keydown",function(e){var t,n,r,o,i;if(!v(e)&&e.keyCode===Oh.BACKSPACE&&(n=(t=d.getRng()).startContainer,r=t.startOffset,o=f.getRoot(),i=n,t.collapsed&&0===r)){for(;i&&i.parentNode&&i.parentNode.firstChild===i&&i.parentNode!==o;)i=i.parentNode;"BLOCKQUOTE"===i.tagName&&(u.formatter.toggle("blockquote",null,
i),(t=f.createRng()).setStart(n,0),t.setEnd(n,0),d.setRng(t))}}),s=function(e){var t=f.create("body"),n=e.cloneContents();return t.appendChild(n),d.serializer.serialize(t,{format:"html"})},u.on("keydown",function(e){var t,n,r,o,i,a=e.keyCode;if(!v(e)&&(a===l||a===c)){if(t=u.selection.isCollapsed(),n=u.getBody(),t&&!f.isEmpty(n))return;if(!t&&(r=u.selection.getRng(),o=s(r),(i=f.createRng()).selectNode(u.getBody()),o!==s(i)))return;e.preventDefault(),u.setContent(""),n.firstChild&&f.isBlock(n.firstChild)?u.selection.setCursorLocation(n.firstChild,0):u.selection.setCursorLocation(n,0),u.nodeChanged()}}),de.windowsPhone||u.on("keyup focusin mouseup",function(e){Oh.modifierPressed(e)||d.normalize()},!0),m&&(u.settings.content_editable||f.bind(u.getDoc(),"mousedown mouseup",function(e){var t;if(e.target===u.getDoc().documentElement)if(t=d.getRng(),u.getBody().focus(),"mousedown"==
=e.type){if(pa(t.startContainer))return;d.placeCaretAt(e.clientX,e.clientY)}else d.setRng(t)}),u.on("click",function(e){var t=e.target;/^(IMG|HR)$/.test(t.nodeName)&&"false"!==f.getContentEditableParent(t)&&(e.preventDefault(),u.selection.select(t),u.nodeChanged()),"A"===t.nodeName&&f.hasClass(t,"mce-item-anchor")&&(e.preventDefault(),d.select(t))}),e.forced_root_block&&u.on("init",function(){h("DefaultParagraphSeparator",e.forced_root_block)}),u.on("init",function(){u.dom.bind(u.getBody(),"submit",function(e){e.preventDefault()})}),y(),t.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"===e[t].attr("class")&&e[t].remove()}),de.iOS?(u.inline||u.on("keydown",function(){document.activeElement===document.body&&u.getWin().focus()}),C(),u.on("click",function(e){var t=e.tar
get;do{if("A"===t.tagName)return void e.preventDefault()}while(t=t.parentNode)}),u.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")):b()),11<=de.ie&&(C(),y()),de.ie&&(b(),h("AutoUrlDetect",!1),u.on("dragstart",function(e){var t,n,r;(t=e).dataTransfer&&(u.selection.isCollapsed()&&"IMG"===t.target.tagName&&d.select(t.target),0<(n=u.selection.getContent()).length&&(r=g+escape(u.id)+","+escape(n),t.dataTransfer.setData(p,r)))}),u.on("drop",function(e){if(!v(e)){var t=(i=e).dataTransfer&&(a=i.dataTransfer.getData(p))&&0<=a.indexOf(g)?(a=a.substr(g.length).split(","),{id:unescape(a[0]),html:unescape(a[1])}):null;if(t&&t.id!==u.id){e.preventDefault();var n=uy(e.x,e.y,u.getDoc());d.setRng(n),r=t.html,o=!0,u.queryCommandSupported("mceInsertClipboardContent")?u.execCommand("mceInsertClipboardContent
",!1,{content:r,internal:o}):u.execCommand("mceInsertContent",!1,r)}}var r,o,i,a})),i&&(u.on("keydown",function(e){if(!v(e)&&e.keyCode===c){if(!u.getBody().getElementsByTagName("hr").length)return;if(d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode(),n=t.previousSibling;if("HR"===t.nodeName)return f.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(f.remove(n),e.preventDefault())}}}),Range.prototype.getClientRects||u.on("mousedown",function(e){if(!v(e)&&"HTML"===e.target.nodeName){var t=u.getBody();t.blur(),ve.setEditorTimeout(u,function(){t.focus()})}}),n=function(){var e=f.getAttribs(d.getStart().cloneNode(!1));return function(){var t=d.getStart();t!==u.getBody()&&(f.setAttrib(t,"style",null),o(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}},r=function(){return!d.isCollapsed()&&a
mp;f.getParent(d.getStart(),f.isBlock)!==f.getParent(d.getEnd(),f.isBlock)},u.on("keypress",function(e){var t;if(!v(e)&&(8===e.keyCode||46===e.keyCode)&&r())return t=n(),u.getDoc().execCommand("delete",!1,null),t(),e.preventDefault(),!1}),f.bind(u.getDoc(),"cut",function(e){var t;!v(e)&&r()&&(t=n(),ve.setEditorTimeout(u,function(){t()}))}),e.readonly||u.on("BeforeExecCommand MouseDown",function(){h("StyleWithCSS",!1),h("enableInlineTableEditing",!1),e.object_resizing||h("enableObjectResizing",!1)}),u.on("SetContent ExecCommand",function(e){"setcontent"!==e.type&&"mceInsertLink"!==e.command||o(f.select("a"),function(e){var t=e.parentNode,n=f.getRoot();if(t.lastChild===e){for(;t&&!f.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}f.add(t,"br",{"data-mce-bogus":1})}})}),u.contentStyles.p
ush("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"),de.mac&&u.on("keydown",function(e){!Oh.metaKeyPressed(e)||e.shiftKey||37!==e.keyCode&&39!==e.keyCode||(e.preventDefault(),u.selection.getSel().modify("move",37===e.keyCode?"backward":"forward","lineboundary"))}),y()),{refreshContentEditable:function(){},isHidden:function(){var e;return!i||u.removed?0:!(e=u.selection.getSel())||!e.rangeCount||0===e.rangeCount}}}var Vx=function(e){return _o.isElement(e)&&mo(rr.fromDom(e))},Hx=function(t){t.on("click",function(e){3<=e.detail&&function(e){var t=e.selection.getRng(),n=du.fromRangeStart(t),r=du.fromRangeEnd(t);if(du.isElementPosition(n)){var o=n.container();Vx(o)&&ic.firstPositionIn(o).each(function(e){return t.setStart(e.container(),e.offset())})}du.isElementPosition(r)&&(o=n.container(),Vx(o)&&ic.lastPositionIn(o).each(funct
ion(e){return t.setEnd(e.container(),e.offset())})),e.selection.setRng(il(t))}(t)})},jx=function(e){var t,n;(t=e).on("click",function(e){t.dom.getParent(e.target,"details")&&e.preventDefault()}),(n=e).parser.addNodeFilter("details",function(e){F(e,function(e){e.attr("data-mce-open",e.attr("open")),e.attr("open","open")})}),n.serializer.addNodeFilter("details",function(e){F(e,function(e){var t=e.attr("data-mce-open");e.attr("open",R(t)?t:null),e.attr("data-mce-open",null)})})},qx=gi.DOM,$x=function(e){var t;e.bindPendingEventDelegates(),e.initialized=!0,e.fire("init"),e.focus(!0),e.nodeChanged({initial:!0}),e.execCallback("init_instance_callback",e),(t=e).settings.auto_focus&&ve.setEditorTimeout(t,function(){var e;(e=!0===t.settings.auto_focus?t:t.editorManager.get(t.settings.auto_focus)).destroyed||e.focus()},100)},Wx=function(t,e){var n,r
,u,o,i,a,s,c,l,f=t.settings,d=t.getElement(),m=t.getDoc();f.inline||(t.getElement().style.visibility=t.orgVisibility),e||f.content_editable||(m.open(),m.write(t.iframeHTML),m.close()),f.content_editable&&(t.on("remove",function(){var e=this.getBody();qx.removeClass(e,"mce-content-body"),qx.removeClass(e,"mce-edit-focus"),qx.setAttrib(e,"contentEditable",null)}),qx.addClass(d,"mce-content-body"),t.contentDocument=m=f.content_document||document,t.contentWindow=f.content_window||window,t.bodyElement=d,f.content_document=f.content_window=null,f.root_name=d.nodeName.toLowerCase()),(n=t.getBody()).disabled=!0,t.readonly=f.readonly,t.readonly||(t.inline&&"static"===qx.getStyle(n,"position",!0)&&(n.style.position="relative"),n.contentEditable=t.getParam("content_editable_state",!0)),n.disabled=!1,t.editorUpload=Vp(t),t.schema=ti(f),t.dom=gi(m,{keep_values:!0,url_converter:t.conv
ertURL,url_converter_scope:t,hex_colors:f.force_hex_style_colors,class_filter:f.class_filter,update_styles:!0,root_element:t.inline?t.getBody():null,collect:f.content_editable,schema:t.schema,contentCssCors:Rm(t),onSetAttrib:function(e){t.fire("SetAttrib",e)}}),t.parser=((o=qb((u=t).settings,u.schema)).addAttributeFilter("src,href,style,tabindex",function(e,t){for(var n,r,o,i=e.length,a=u.dom;i--;)if(r=(n=e[i]).attr(t),o="data-mce-"+t,!n.attributes.map[o]){if(0===r.indexOf("data:")||0===r.indexOf("blob:"))continue;"style"===t?((r=a.serializeStyle(a.parseStyle(r),n.name)).length||(r=null),n.attr(o,r),n.attr(t,r)):"tabindex"===t?(n.attr(o,r),n.attr(t,null)):n.attr(o,u.convertURL(r,t,n.name))}}),o.addNodeFilter("script",function(e){for(var t,n,r=e.length;r--;)0!==(n=(t=e[r]).attr("type")||"no/type").indexOf("mce-")&&t.attr("type","mce-"+n)}),o.addNod
eFilter("#cdata",function(e){for(var t,n=e.length;n--;)(t=e[n]).type=8,t.name="#comment",t.value="[CDATA["+t.value+"]]"}),o.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t,n=e.length,r=u.schema.getNonEmptyElements();n--;)(t=e[n]).isEmpty(r)&&0===t.getAll("br").length&&(t.append(new Ob("br",1)).shortEnded=!0)}),o),t.serializer=Yb(f,t),t.selection=Ly(t.dom,t.getWin(),t.serializer,t),t.annotator=Uc(t),t.formatter=xb(t),t.undoManager=uv(t),t._nodeChangeDispatcher=new Qp(t),t._selectionOverrides=zh(t),jx(t),Hx(t),zx(t),Wp(t),t.fire("PreInit"),f.browser_spellcheck||f.gecko_spellcheck||(m.body.spellcheck=!1,qx.setAttrib(n,"spellcheck","false")),t.quirks=Ux(t),t.fire("PostRender"),f.directionality&&(n.dir=f.directionality),f.nowrap&&(n.style.whiteSpace="nowrap"),f.protect&&t.on("BeforeSetContent",function(t){Y
t.each(f.protect,function(e){t.content=t.content.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})})}),t.on("SetContent",function(){t.addVisual(t.getBody())}),t.load({initial:!0,format:"html"}),t.startContent=t.getContent({format:"raw"}),t.on("compositionstart compositionend",function(e){t.composing="compositionstart"===e.type}),0<t.contentStyles.length&&(r="",Yt.each(t.contentStyles,function(e){r+=e+"\r\n"}),t.dom.addStyle(r)),(i=t,i.inline?qx.styleSheetLoader:i.dom.styleSheetLoader).loadAll(t.contentCSS,function(e){$x(t)},function(e){$x(t)}),f.content_style&&(a=t,s=f.content_style,c=rr.fromDom(a.getDoc().head),l=rr.fromTag("style"),hr(l,"type","text/css"),ki(l,rr.fromText(s)),ki(c,l))},Kx=gi.DOM,Xx=function(e,t){var n,r,o,i,a,u,s,c=e.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for to
olbar. Press ALT-0 for help"),l=(n=e.id,r=c,o=t.height,i=am(e),s=rr.fromTag("iframe"),vr(s,i),vr(s,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),xr(s,{width:"100%",height:(a=o,u="number"==typeof a?a+"px":a,u||""),display:"block"}),s).dom();l.onload=function(){l.onload=null,e.fire("load")};var f,d,m,g,p=function(e,t){if(document.domain!==window.location.hostname&&de.ie&&de.ie<12){var n=Up.uuid("mce");e[n]=function(){Wx(e)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return Kx.setAttrib(t,"src",r),!0}return!1}(e,l);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=l,e.iframeHTML=(g=um(f=e)+"<html><head>",sm(f
)!==f.documentBaseUrl&&(g+='<base href="'+f.documentBaseURI.getURI()+'" />'),g+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />',d=cm(f),m=lm(f),fm(f)&&(g+='<meta http-equiv="Content-Security-Policy" content="'+fm(f)+'" />'),g+='</head><body id="'+d+'" class="mce-content-body '+m+'" data-id="'+f.id+'"><br></body></html>'),Kx.add(t.iframeContainer,l),p},Yx=function(e,t){var n=Xx(e,t);t.editorContainer&&(Kx.get(t.editorContainer).style.display=e.orgDisplay,e.hidden=Kx.isHidden(t.editorContainer)),e.getElement().style.display="none",Kx.setAttrib(e.id,"aria-hidden","true"),n||Wx(e)},Gx=gi.DOM,Jx=function(t,n,e){var r,o,i=Sp.get(e);if(r=Sp.urls[e]||t.documentBaseUrl.replace(/\/$/,""),e=Yt.trim(e),i&&-1===Yt.inArray(n,e)){if(Yt.each(Sp.dependencies(e),function(e){Jx(t,n
,e)}),t.plugins[e])return;o=new i(t,r,t.$),(t.plugins[e]=o).init&&(o.init(t,r),n.push(e))}},Qx=function(e){return e.replace(/^\-/,"")},Zx=function(e){return{editorContainer:e,iframeContainer:e}},ew=function(e){var t,n,r=e.getElement();return e.inline?Zx(null):(t=r,n=Gx.create("div"),Gx.insertAfter(n,t),Zx(n))},tw=function(e){var t,n,r,o,i,a,u,s,c,l,f,d=e.settings,m=e.getElement();return e.orgDisplay=m.style.display,R(d.theme)?(l=(o=e).settings,f=o.getElement(),i=l.width||Gx.getStyle(f,"width")||"100%",a=l.height||Gx.getStyle(f,"height")||f.offsetHeight,u=l.min_height||100,(s=/^[0-9\.]+(|px)$/i).test(""+i)&&(i=Math.max(parseInt(i,10),100)),s.test(""+a)&&(a=Math.max(parseInt(a,10),u)),c=o.theme.renderUI({targetNode:f,width:i,height:a,deltaWidth:l.delta_width,deltaHeight:l.delta_height}),l.content_editable||(a=(c.iframeHeight||a)+("number"==typeof a?c.deltaHeight||0:""))<
;u&&(a=u),c.height=a,c):P(d.theme)?(r=(t=e).getElement(),(n=t.settings.theme(t,r)).editorContainer.nodeType&&(n.editorContainer.id=n.editorContainer.id||t.id+"_parent"),n.iframeContainer&&n.iframeContainer.nodeType&&(n.iframeContainer.id=n.iframeContainer.id||t.id+"_iframecontainer"),n.height=n.iframeHeight?n.iframeHeight:r.offsetHeight,n):ew(e)},nw=function(t){var e,n,r,o,i,a,u=t.settings,s=t.getElement();return t.rtl=u.rtl_ui||t.editorManager.i18n.rtl,t.editorManager.i18n.setCode(u.language),u.aria_label=u.aria_label||Gx.getAttrib(s,"aria-label",t.getLang("aria.rich_text_area")),t.fire("ScriptsLoaded"),o=(n=t).settings.theme,R(o)?(n.settings.theme=Qx(o),r=kp.get(o),n.theme=new r(n,kp.urls[o]),n.theme.init&&n.theme.init(n,kp.urls[o]||n.documentBaseUrl.replace(/\/$/,""),n.$)):n.theme={},i=t,a=[],Yt.each(i.settings.plugins.split(/[ ,]/),function(e){Jx(i,a,Qx(e))}),e=tw(t),t.editorConta
iner=e.editorContainer?e.editorContainer:null,u.content_css&&Yt.each(Yt.explode(u.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),u.content_editable?Wx(t):Yx(t,e)},rw=gi.DOM,ow=function(e){return"-"===e.charAt(0)},iw=function(i,a){var u=yi.ScriptLoader;!function(e,t,n,r){var o=t.settings,i=o.theme;if(R(i)){if(!ow(i)&&!kp.urls.hasOwnProperty(i)){var a=o.theme_url;a?kp.load(i,t.documentBaseURI.toAbsolute(a)):kp.load(i,"themes/"+i+"/theme"+n+".js")}e.loadQueue(function(){kp.waitFor(i,r)})}else r()}(u,i,a,function(){var e,t,n,r,o;e=u,(n=(t=i).settings).language&&"en"!==n.language&&!n.language_url&&(n.language_url=t.editorManager.baseURL+"/langs/"+n.language+".js"),n.language_url&&!t.editorManager.i18n.data[n.language]&&e.add(n.language_url),r=i.settings,o=a,Yt.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),Yt.e
ach(r.external_plugins,function(e,t){Sp.load(t,e),r.plugins+=" "+t}),Yt.each(r.plugins.split(/[ ,]/),function(e){if((e=Yt.trim(e))&&!Sp.urls[e])if(ow(e)){e=e.substr(1,e.length);var t=Sp.dependencies(e);Yt.each(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=Sp.createUrl(t,e),Sp.load(e.resource,e)})}else Sp.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),u.loadQueue(function(){i.removed||nw(i)},i,function(e){xp(i,e[0]),i.removed||nw(i)})})},aw=function(t){var e=t.settings,n=t.id,r=function(){rw.unbind(window,"ready",r),t.render()};if(ke.Event.domLoaded){if(t.getElement()&&de.contentEditable){e.inline?t.inline=!0:(t.orgVisibility=t.getElement().style.visibility,t.getElement().style.visibility="hidden");var o=t.getElement().form||rw.getParent(n,"form");o&&(t.formElement=o,e.hidden_input&&!/TEXTAREA|INPUT/i.te
st(t.getElement().nodeName)&&(rw.insertAfter(rw.create("input",{type:"hidden",name:n}),n),t.hasHiddenInput=!0),t.formEventDelegate=function(e){t.fire(e.type,e)},rw.bind(o,"submit reset",t.formEventDelegate),t.on("reset",function(){t.setContent(t.startContent,{format:"raw"})}),!e.submit_patch||o.submit.nodeType||o.submit.length||o._mceOldSubmit||(o._mceOldSubmit=o.submit,o.submit=function(){return t.editorManager.triggerSave(),t.setDirty(!1),o._mceOldSubmit(o)})),t.windowManager=hp(t),t.notificationManager=pp(t),"xml"===e.encoding&&t.on("GetContent",function(e){e.save&&(e.content=rw.encode(e.content))}),e.add_form_submit_trigger&&t.on("submit",function(){t.initialized&&t.save()}),e.add_unload_trigger&&(t._beforeUnload=function(){!t.initialized||t.destroyed||t.isHidden()||t.save({format:"raw",no_events:!0,set_dirty:!1})},t.editorManager.on("Bef
oreUnload",t._beforeUnload)),t.editorManager.add(t),iw(t,t.suffix)}}else rw.bind(window,"ready",r)},uw=function(e,t,n){var r=e.sidebars?e.sidebars:[];r.push({name:t,settings:n}),e.sidebars=r},sw=Yt.each,cw=Yt.trim,lw="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),fw={ftp:21,http:80,https:443,mailto:25},dw=function(r,e){var t,n,o=this;if(r=cw(r),t=(e=o.settings=e||{}).base_uri,/^([\w\-]+):([^\/]{2})/i.test(r)||/^\s*#/.test(r))o.source=r;else{var i=0===r.indexOf("//");0!==r.indexOf("/")||i||(r=(t&&t.protocol||"http")+"://mce_host"+r),/^[\w\-]*:?\/\//.test(r)||(n=e.base_uri?e.base_uri.path:new dw(document.location.href).directory,""==e.base_uri.protocol?r="//mce_host"+o.toAbsPath(n,r):(r=/([^#?]*)([#?]?.*)/.exec(r),r=(t&&t.protocol||"http")+"://mce_host"+o.toAbsPath(n,r[1])+r[2])),r=r.replac
e(/@@/g,"(mce_at)"),r=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(r),sw(lw,function(e,t){var n=r[t];n&&(n=n.replace(/\(mce_at\)/g,"@@")),o[e]=n}),t&&(o.protocol||(o.protocol=t.protocol),o.userInfo||(o.userInfo=t.userInfo),o.port||"mce_host"!==o.host||(o.port=t.port),o.host&&"mce_host"!==o.host||(o.host=t.host),o.source=""),i&&(o.protocol="")}};dw.prototype={setPath:function(e){e=/^(.*?)\/?(\w+)?$/.exec(e),this.path=e[0],this.directory=e[1],this.file=e[2],this.source="",this.getURI()},toRelative:function(e){var t;if("./"===e)return e;if("mce_host"!==(e=new dw(e,{base_uri:this})).host&&this.host!==e.host&&e.host||this.port!==e.port||this.protocol!==e.protocol&&""!==e.protocol)re
turn e.getURI();var n=this.getURI(),r=e.getURI();return n===r||"/"===n.charAt(n.length-1)&&n.substr(0,n.length-1)===r?n:(t=this.toRelPath(this.path,e.path),e.query&&(t+="?"+e.query),e.anchor&&(t+="#"+e.anchor),t)},toAbsolute:function(e,t){return(e=new dw(e,{base_uri:this})).getURI(t&&this.isSameOrigin(e))},isSameOrigin:function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=fw[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},toRelPath:function(e,t){var n,r,o,i=0,a="";if(e=(e=e.substring(0,e.lastIndexOf("/"))).split("/"),n=t.split("/"),e.length>=n.length)for(r=0,o=e.length;r<o;r++)if(r>=n.length||e[r]!==n[r]){i=r+1;break}if(e.length<n.length)for(r=0,o=n.length;r<o;r++)if(r>=e.length||e[r]!==n[r]){i=r+1;break}if(1===i)return t;for(r=0,o=e.length-(i-1);r<o;r++)a+="../";for(r=i-1,o
=n.length;r<o;r++)a+=r!==i-1?"/"+n[r]:n[r];return a},toAbsPath:function(e,t){var n,r,o,i=0,a=[];for(r=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),sw(e,function(e){e&&a.push(e)}),e=a,n=t.length-1,a=[];0<=n;n--)0!==t[n].length&&"."!==t[n]&&(".."!==t[n]?0<i?i--:a.push(t[n]):i++);return 0!==(o=(n=e.length-i)<=0?a.reverse().join("/"):e.slice(0,n).join("/")+"/"+a.reverse().join("/")).indexOf("/")&&(o="/"+o),r&&o.lastIndexOf("/")!==o.length-1&&(o+=r),o},getURI:function(e){var t,n=this;return n.source&&!e||(t="",e||(n.protocol?t+=n.protocol+"://":t+="//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anch
or&&(t+="#"+n.anchor),n.source=t),n.source}},dw.parseDataUri=function(e){var t,n;return e=decodeURIComponent(e).split(","),(n=/data:([^;]+)/.exec(e[0]))&&(t=n[1]),{type:t,data:e[1]}},dw.getDocumentBaseUrl=function(e){var t;return t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname,/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t};var mw=function(e,t,n){var r,o,i,a,u;if(t.format=t.format?t.format:"html",t.get=!0,t.getInner=!0,t.no_events||e.fire("BeforeGetContent",t),"raw"===t.format)r=Yt.trim(qh.trimExternal(e.serializer,n.innerHTML));else if("text"===t.format)r=la(n.innerText||n.textContent);else{if("tree"===t.format)return e.serializer.serialize(n,t);i=(o=e).serializer.serialize(n,t),a=mm(o),u=new RegExp(&qu
ot;^(<"+a+"[^>]*>( | |\\s|\xa0|<br \\/>|)<\\/"+a+">[\r\n]*|<br \\/>[\r\n]*)$"),r=i.replace(u,"")}return"text"===t.format||yo(rr.fromDom(n))?t.content=r:t.content=Yt.trim(r),t.no_events||e.fire("GetContent",t),t.content},gw=function(e,t){t(e),e.firstChild&&gw(e.firstChild,t),e.next&&gw(e.next,t)},pw=function(e,t,n){var r=function(e,n,t){var r={},o={},i=[];for(var a in t.firstChild&&gw(t.firstChild,function(t){F(e,function(e){e.name===t.name&&(r[e.name]?r[e.name].nodes.push(t):r[e.name]={filter:e,nodes:[t]})}),F(n,function(e){"string"==typeof t.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var a in o)o.hasOwnProperty(a)&&i.push(o[a]);return i}(e,t,n);F(r,function(t){F(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},hw=function(e
){return e instanceof Ob},vw=function(e,t){var r;e.dom.setHTML(e.getBody(),t),ap(r=e)&&ic.firstPositionIn(r.getBody()).each(function(e){var t=e.getNode(),n=_o.isTable(t)?ic.firstPositionIn(t).getOr(e):e;r.selection.setRng(n.toRange())})},bw=function(u,s,c){return void 0===c&&(c={}),c.format=c.format?c.format:"html",c.set=!0,c.content=hw(s)?"":s,hw(s)||c.no_events||(u.fire("BeforeSetContent",c),s=c.content),A.from(u.getBody()).fold(j(s),function(e){return hw(s)?function(e,t,n,r){pw(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=rl({validate:e.validate},e.schema).serialize(n);return r.content=yo(rr.fromDom(t))?o:Yt.trim(o),vw(e,r.content),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=s).length||/^\s+$/.test(r)?(a='<br data-mce-bogus="1">',"TABLE"===n.nodeName?r="<tr><td>"+a+"</td></tr>":/^(UL|OL)$/.test(n.nodeName)&&
amp;(r="<li>"+a+"</li>"),(i=mm(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,r=t.dom.createHTML(i,t.settings.forced_root_block_attrs,r)):r||(r='<br data-mce-bogus="1">'),vw(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=rl({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=yo(rr.fromDom(n))?r:Yt.trim(r),vw(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},yw=gi.DOM,Cw=function(e){return A.from(e).each(function(e){return e.destroy()})},xw=function(e){if(!e.removed){var t=e._selectionOverrides,n=e.editorUpload,r=e.getBody(),o=e.getElement();r&&e.save({is_removing:!0}),e.removed=!0,e.unbindAllNativeEvents(),e.hasHiddenInput&&o&&yw.remove(o.nextSibling),!e.inline&&r&&(i=e,yw.setStyle(i.id,"display",i.orgDisplay)),Bg(e),e.editorManager.
remove(e),yw.remove(e.getContainer()),Cw(t),Cw(n),e.destroy()}var i},ww=function(e,t){var n,r,o,i=e.selection,a=e.dom;e.destroyed||(t||e.removed?(t||(e.editorManager.off("beforeunload",e._beforeUnload),e.theme&&e.theme.destroy&&e.theme.destroy(),Cw(i),Cw(a)),(r=(n=e).formElement)&&(r._mceOldSubmit&&(r.submit=r._mceOldSubmit,r._mceOldSubmit=null),yw.unbind(r,"submit reset",n.formEventDelegate)),(o=e).contentAreaContainer=o.formElement=o.container=o.editorContainer=null,o.bodyElement=o.contentDocument=o.contentWindow=null,o.iframeElement=o.targetElm=null,o.selection&&(o.selection=o.selection.win=o.selection.dom=o.selection.dom.doc=null),e.destroyed=!0):e.remove())},Nw=gi.DOM,Ew=Yt.extend,Sw=Yt.each,kw=Yt.resolve,Tw=de.ie,Aw=function(e,t,n){var r,o,i,a,u,s,c,l=this,f=l.documentBaseUrl=n.documentBaseURL,d=n.baseURI;r=l,o=e,i=f,a=n.defaultSettings,u=t,c={id:o,theme:"modern",delta_width:0,delta_height:0,popup_css:"
",plugins:"",document_base_url:i,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"<!DOCTYPE html>",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,render_ui:!0,indentation:"40px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,d
atalist",entity_encoding:"named",url_converter:(s=r).convertURL,url_converter_scope:s,ie7_compat:!0},t=bl(fl,c,a,u),l.settings=t,wi.language=t.language||"en",wi.languageLoad=t.language_load,wi.baseURL=n.baseURL,l.id=e,l.setDirty(!1),l.plugins={},l.documentBaseURI=new dw(t.document_base_url,{base_uri:d}),l.baseURI=d,l.contentCSS=[],l.contentStyles=[],l.shortcuts=new Gg(l),l.loadedCSS={},l.editorCommands=new Eg(l),l.suffix=n.suffix,l.editorManager=n,l.inline=t.inline,l.buttons={},l.menuItems={},t.cache_suffix&&(de.cacheSuffix=t.cache_suffix.replace(/^[\?\&]+/,"")),!1===t.override_viewport&&(de.overrideViewPort=!1),n.fire("SetupEditor",{editor:l}),l.execCallback("setup",l),l.$=pn.overrideDefaults(function(){return{context:l.inline?l.getBody():l.getDoc(),element:l.getBody()}})};Ew(Aw.prototype={render:function(){aw(this)},focus:function(e){ip(this,e)},hasFocus:function(){return ap(this)},execCallback:function(e){
for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r,o=this.settings[e];if(o)return this.callbackLookup&&(r=this.callbackLookup[e])&&(o=r.func,r=r.scope),"string"==typeof o&&(r=(r=o.replace(/\.\w+$/,""))?kw(r):0,o=kw(o),this.callbackLookup=this.callbackLookup||{},this.callbackLookup[e]={func:o,scope:r}),o.apply(r||this,Array.prototype.slice.call(arguments,1))},translate:function(e){if(e&&Yt.is(e,"string")){var n=this.settings.language||"en",r=this.editorManager.i18n;e=r.data[n+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,t){return r.data[n+"."+t]||"{#"+t+"}"})}return this.editorManager.translate(e)},getLang:function(e,t){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(t!==undefined?t:"{#"+e+"}")},getParam:function(e,t,n){return xl(this,e,t,n)},nodeChanged:function(e){this._nodeChangeDispa
tcher.nodeChanged(e)},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.stateSelector&&"undefined"==typeof t.active&&(t.active=!1),t.text||t.icon||(t.icon=e),t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addSidebar:function(e,t){return uw(this,e,t)},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems[e]=t},addContextToolbar:function(e,t){var n,r=this;r.contextToolbars=r.contextToolbars||[],"string"==typeof e&&(n=e,e=function(e){return r.dom.is(e,n)}),r.contextToolbars.push({id:Up.uuid("mcet"),predicate:e,items:t})},addCommand:function(e,t,n){this.editorCommands.addCommand(e,t,n)},addQueryStateHandler:function(e,t,n){this.editorCommands.addQueryStateHandler(e,t,n)},addQueryValueHandler:function(e,t,n){this.editorCommands.addQueryValueHandler(e,t,n)},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e
,t,n,r){return this.editorCommands.execCommand(e,t,n,r)},queryCommandState:function(e){return this.editorCommands.queryCommandState(e)},queryCommandValue:function(e){return this.editorCommands.queryCommandValue(e)},queryCommandSupported:function(e){return this.editorCommands.queryCommandSupported(e)},show:function(){this.hidden&&(this.hidden=!1,this.inline?this.getBody().contentEditable=!0:(Nw.show(this.getContainer()),Nw.hide(this.id)),this.load(),this.fire("show"))},hide:function(){var e=this,t=e.getDoc();e.hidden||(Tw&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),e.inline?(e.getBody().contentEditable=!1,e===e.editorManager.focusedEditor&&(e.editorManager.focusedEditor=null)):(Nw.hide(e.getContainer()),Nw.setStyle(e.id,"display",e.orgDisplay)),e.hidden=!0,e.fire("hide"))},isHidden:function(){return!!this.hidden},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},
load:function(e){var t,n=this.getElement();return this.removed?"":n?((e=e||{}).load=!0,t=this.setContent(n.value!==undefined?n.value:n.innerHTML,e),e.element=n,e.no_events||this.fire("LoadContent",e),e.element=n=null,t):void 0},save:function(e){var t,n,r=this,o=r.getElement();if(o&&r.initialized&&!r.removed)return(e=e||{}).save=!0,e.element=o,e.content=r.getContent(e),e.no_events||r.fire("SaveContent",e),"raw"===e.format&&r.fire("RawSaveContent",e),t=e.content,/TEXTAREA|INPUT/i.test(o.nodeName)?o.value=t:(!e.is_removing&&r.inline||(o.innerHTML=t),(n=Nw.getParent(r.id,"form"))&&Sw(n.elements,function(e){if(e.name===r.id)return e.value=t,!1})),e.element=o=null,!1!==e.set_dirty&&r.setDirty(!1),t},setContent:function(e,t){return bw(this,e,t)},getContent:function(e){return t=this,void 0===(n=e)&&(n={}),A.from(t.getBody()).fold(j("tree"===n.format?new Ob("body
",11):""),function(e){return mw(t,n,e)});var t,n},insertContent:function(e,t){t&&(e=Ew({content:e},t)),this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},setDirty:function(e){var t=!this.isNotDirty;this.isNotDirty=!e,e&&e!==t&&this.fire("dirty")},setMode:function(e){var t,n;(n=e)!==zg(t=this)&&(t.initialized?Fg(t,"readonly"===n):t.on("init",function(){Fg(t,"readonly"===n)}),Og(t,n))},getContainer:function(){return this.container||(this.container=Nw.get(this.editorContainer||this.id+"_parent")),this.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return this.targetElm||(this.targetElm=Nw.get(this.id)),this.targetElm},getWin:function(){var e;return this.contentWindow||(e=this.iframeElement)&&(this.contentWindow=e.contentWindow),this.contentWindow},getDoc:function(){var e;return this.c
ontentDocument||(e=this.getWin())&&(this.contentDocument=e.document),this.contentDocument},getBody:function(){var e=this.getDoc();return this.bodyElement||(e?e.body:null)},convertURL:function(e,t,n){var r=this.settings;return r.urlconverter_callback?this.execCallback("urlconverter_callback",e,n,!0,t):!r.convert_urls||n&&"LINK"===n.nodeName||0===e.indexOf("file:")||0===e.length?e:r.relative_urls?this.documentBaseURI.toRelative(e):e=this.documentBaseURI.toAbsolute(e,r.remove_script_host)},addVisual:function(e){var n,r=this,o=r.settings,i=r.dom;e=e||r.getBody(),r.hasVisual===undefined&&(r.hasVisual=o.visual),Sw(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return n=o.visual_table_class||"mce-item-table",void((t=i.getAttrib(e,"border"))&&"0"!==t||!r.hasVisual?i.removeClass(e,n):i.addClass(e,n));case"A":return void(i.getAttrib(e,"href&quo
t;)||(t=i.getAttrib(e,"name")||e.id,n=o.visual_anchor_class||"mce-item-anchor",t&&r.hasVisual?i.addClass(e,n):i.removeClass(e,n)))}}),r.fire("VisualAid",{element:e,hasVisual:r.hasVisual})},remove:function(){xw(this)},destroy:function(e){ww(this,e)},uploadImages:function(e){return this.editorUpload.uploadImages(e)},_scanForImages:function(){return this.editorUpload.scanForImages()}},$g);var Rw,_w,Dw,Bw={isEditorUIElement:function(e){return-1!==e.className.toString().indexOf("mce-")}},Ow=function(n,e){var t,r;tr.detect().browser.isIE()?(r=n).on("focusout",function(){gg(r)}):(t=e,n.on("mouseup touchend",function(e){t.throttle()})),n.on("keyup nodechange",function(e){var t;"nodechange"===(t=e).type&&t.selectionChange||gg(n)})},Pw=function(e){var t,n,r,o=Di(function(){gg(e)},0);e.inline&&(t=e,n=o,r=function(){n.throttle()},gi.DOM.bind(document,"mouseup",r),t.on("remove&q
uot;,function(){gi.DOM.unbind(document,"mouseup",r)})),e.on("init",function(){Ow(e,o)}),e.on("remove",function(){o.cancel()})},Lw=gi.DOM,Iw=function(e){return Bw.isEditorUIElement(e)},Mw=function(t,e){var n=t?t.settings.custom_ui_selector:"";return null!==Lw.getParent(e,function(e){return Iw(e)||!!n&&t.dom.is(e,n)})},Fw=function(r,e){var t=e.editor;Pw(t),t.on("focusin",function(){var e=r.focusedEditor;e!==this&&(e&&e.fire("blur",{focusedEditor:this}),r.setActive(this),(r.focusedEditor=this).fire("focus",{blurredEditor:e}),this.focus(!0))}),t.on("focusout",function(){var t=this;ve.setEditorTimeout(t,function(){var e=r.focusedEditor;Mw(t,function(){try{return document.activeElement}catch(e){return document.body}}())||e!==t||(t.fire("blur",{focusedEditor:null}),r.focusedEditor=null)})}),Rw||(Rw=function(e){var t,n=r.activeEditor;t=e.target,n&&t.ownerDocument===docum
ent&&(t===document.body||Mw(n,t)||r.focusedEditor!==n||(n.fire("blur",{focusedEditor:null}),r.focusedEditor=null))},Lw.bind(document,"focusin",Rw))},zw=function(e,t){e.focusedEditor===t.editor&&(e.focusedEditor=null),e.activeEditor||(Lw.unbind(document,"focusin",Rw),Rw=null)},Uw=function(e){e.on("AddEditor",d(Fw,e)),e.on("RemoveEditor",d(zw,e))},Vw={},Hw="en",jw={setCode:function(e){e&&(Hw=e,this.rtl=!!this.data[e]&&"rtl"===this.data[e]._dir)},getCode:function(){return Hw},rtl:!1,add:function(e,t){var n=Vw[e];for(var r in n||(Vw[e]=n={}),t)n[r]=t[r];this.setCode(e)},translate:function(e){var t=Vw[Hw]||{},n=function(e){return Yt.is(e,"function")?Object.prototype.toString.call(e):r(e)?"":""+e},r=function(e){return""===e||null===e||Yt.is(e,"undefined")},o=function(e){return e=n(e),Yt.hasOwn(t,e)?n(t[e]):e};if(r(e))return"";if(
Yt.is(e,"object")&&Yt.hasOwn(e,"raw"))return n(e.raw);if(Yt.is(e,"array")){var i=e.slice(1);e=o(e[0]).replace(/\{([0-9]+)\}/g,function(e,t){return Yt.hasOwn(i,t)?n(i[t]):e})}return o(e).replace(/{context:\w+}$/,"")},data:Vw},qw=gi.DOM,$w=Yt.explode,Ww=Yt.each,Kw=Yt.extend,Xw=0,Yw=!1,Gw=[],Jw=[],Qw=function(t){Ww(Dw.get(),function(e){"scroll"===t.type?e.fire("ScrollWindow",t):e.fire("ResizeWindow",t)})},Zw=function(e){e!==Yw&&(e?pn(window).on("resize scroll",Qw):pn(window).off("resize scroll",Qw),Yw=e)},eN=function(t){var e=Jw;delete Gw[t.id];for(var n=0;n<Gw.length;n++)if(Gw[n]===t){Gw.splice(n,1);break}return Jw=z(Jw,function(e){return t!==e}),Dw.activeEditor===t&&(Dw.activeEditor=0<Jw.length?Jw[0]:null),Dw.focusedEditor===t&&(Dw.focusedEditor=null),e.length!==Jw.length};Kw(Dw={defaultSettings:{},$:pn,majorVersion:"4",minorVersion:"9.2"
,releaseDate:"2018-12-17",editors:Gw,i18n:jw,activeEditor:null,settings:{},setup:function(){var e,t,n,r,o="";if(t=dw.getDocumentBaseUrl(document.location),/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),n=window.tinymce||window.tinyMCEPreInit)e=n.base||n.baseURL,o=n.suffix;else{for(var i=document.getElementsByTagName("script"),a=0;a<i.length;a++){var u=(r=i[a].src).substring(r.lastIndexOf("/"));if(/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(r)){-1!==u.indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/"));break}}!e&&document.currentScript&&(-1!==(r=document.currentScript.src).indexOf(".min")&&(o=".min"),e=r.substring(0,r.lastIndexOf("/")))}this.baseURL=new dw(t).toAbsolute(e),this.documentBaseURL=t,this.baseURI=new dw(this.base
URL),this.suffix=o,Uw(this)},overrideDefaults:function(e){var t,n;(t=e.base_url)&&(this.baseURL=new dw(this.documentBaseURL).toAbsolute(t.replace(/\/+$/,"")),this.baseURI=new dw(this.baseURL)),n=e.suffix,e.suffix&&(this.suffix=n);var r=(this.defaultSettings=e).plugin_base_urls;for(var o in r)wi.PluginManager.urls[o]=r[o]},init:function(r){var n,u,s=this;u=Yt.makeMap("area base basefont br col frame hr img input isindex link meta param embed source wbr track colgroup option tbody tfoot thead tr script noscript style textarea video audio iframe object menu"," ");var c=function(e){var t=e.id;return t||(t=(t=e.name)&&!qw.get(t)?e.name:qw.uniqueId(),e.setAttribute("id",t)),t},l=function(e,t){return t.constructor===RegExp?t.test(e.className):qw.hasClass(e,t)},f=function(e){n=e},e=function(){var o,i=0,a=[],n=function(e,t,n){var r=new Aw(e,t,s);a.push(r),r.on("init",function(){++i===o.length&&f(a)}),r.targetEl
m=r.targetElm||n,r.render()};qw.unbind(window,"ready",e),function(e){var t=r[e];t&&t.apply(s,Array.prototype.slice.call(arguments,2))}("onpageload"),o=pn.unique(function(t){var e,n=[];if(de.ie&&de.ie<11)return Ep("TinyMCE does not support the browser you are using. For a list of supported browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/"),[];if(t.types)return Ww(t.types,function(e){n=n.concat(qw.select(e.selector))}),n;if(t.selector)return qw.select(t.selector);if(t.target)return[t.target];switch(t.mode){case"exact":0<(e=t.elements||"").length&&Ww($w(e),function(t){var e;(e=qw.get(t))?n.push(e):Ww(document.forms,function(e){Ww(e.elements,function(e){e.name===t&&(t="mce_editor_"+Xw++,qw.setAttrib(e,"id",t),n.push(e))})})});break;case"textareas":case"specific_textareas":Ww(qw.select("textarea"),function(e){t.editor_
deselector&&l(e,t.editor_deselector)||t.editor_selector&&!l(e,t.editor_selector)||n.push(e)})}return n}(r)),r.types?Ww(r.types,function(t){Yt.each(o,function(e){return!qw.is(e,t.selector)||(n(c(e),Kw({},r,t),e),!1)})}):(Yt.each(o,function(e){var t;(t=s.get(e.id))&&t.initialized&&!(t.getContainer()||t.getBody()).parentNode&&(eN(t),t.unbindAllNativeEvents(),t.destroy(!0),t.removed=!0,t=null)}),0===(o=Yt.grep(o,function(e){return!s.get(e.id)})).length?f([]):Ww(o,function(e){var t;t=e,r.inline&&t.tagName.toLowerCase()in u?Ep("Could not initialize inline editor on invalid inline target element",e):n(c(e),r,e)}))};return s.settings=r,qw.bind(window,"ready",e),new me(function(t){n?t(n):f=function(e){t(e)}})},get:function(t){return 0===arguments.length?Jw.slice(0):R(t)?V(Jw,function(e){return e.id===t}).getOr(null):L(t)&&Jw[t]?Jw[t]:null},add:function(e){var t=this;return Gw[e.id]===e||(null===t.get(e.id)&&(
"length"!==e.id&&(Gw[e.id]=e),Gw.push(e),Jw.push(e)),Zw(!0),t.activeEditor=e,t.fire("AddEditor",{editor:e}),_w||(_w=function(){t.fire("BeforeUnload")},qw.bind(window,"beforeunload",_w))),e},createEditor:function(e,t){return this.add(new Aw(e,t,this))},remove:function(e){var t,n,r=this;if(e){if(!R(e))return n=e,B(r.get(n.id))?null:(eN(n)&&r.fire("RemoveEditor",{editor:n}),0===Jw.length&&qw.unbind(window,"beforeunload",_w),n.remove(),Zw(0<Jw.length),n);Ww(qw.select(e),function(e){(n=r.get(e.id))&&r.remove(n)})}else for(t=Jw.length-1;0<=t;t--)r.remove(Jw[t])},execCommand:function(e,t,n){var r=this.get(n);switch(e){case"mceAddEditor":return this.get(n)||new Aw(n,this.settings,this).render(),!0;case"mceRemoveEditor":return r&&r.remove(),!0;case"mceToggleEditor":return r?r.isHidden()?r.show():r.hide():this.execCommand("mceAddEditor",0,n),!0}retu
rn!!this.activeEditor&&this.activeEditor.execCommand(e,t,n)},triggerSave:function(){Ww(Jw,function(e){e.save()})},addI18n:function(e,t){jw.add(e,t)},translate:function(e){return jw.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!==e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},Rg),Dw.setup();var tN,nN=Dw;function rN(n){return{walk:function(e,t){return Oc(n,e,t)},split:bv,normalize:function(t){return jm(n,t).fold(j(!1),function(e){return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),!0})}}}(tN=rN||(rN={})).compareRanges=Im,tN.getCaretRangeFromPoint=uy,tN.getSelectedNode=Ua,tN.getNode=Va;var oN,iN,aN=rN,uN=Math.min,sN=Math.max,cN=Math.round,lN=function(e,t,n){var r,o,i,a,u,s;return r=t.x,o=t.y,i=e.w,a=e.h,u=t.w,s=t.h,"b"===(n=(n||"").split(""))[0]&&(o+=s),"r"===n[1]&&am
p;(r+=u),"c"===n[0]&&(o+=cN(s/2)),"c"===n[1]&&(r+=cN(u/2)),"b"===n[3]&&(o-=a),"r"===n[4]&&(r-=i),"c"===n[3]&&(o-=cN(a/2)),"c"===n[4]&&(r-=cN(i/2)),fN(r,o,i,a)},fN=function(e,t,n,r){return{x:e,y:t,w:n,h:r}},dN={inflate:function(e,t,n){return fN(e.x-t,e.y-n,e.w+2*t,e.h+2*n)},relativePosition:lN,findBestRelativePosition:function(e,t,n,r){var o,i;for(i=0;i<r.length;i++)if((o=lN(e,t,r[i])).x>=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n,r,o,i;return n=sN(e.x,t.x),r=sN(e.y,t.y),o=uN(e.x+e.w,t.x+t.w),i=uN(e.y+e.h,t.y+t.h),o-n<0||i-r<0?null:fN(n,r,o-n,i-r)},clamp:function(e,t,n){var r,o,i,a,u,s,c,l,f,d;return u=e.x,s=e.y,c=e.x+e.w,l=e.y+e.h,f=t.x+t.w,d=t.y+t.h,r=sN(0,t.x-u),o=sN(0,t.y-s),i=sN(0,c-f),a=sN(0,l-d),u+=r,s+=o,n&&(c+=r,l+=o,u-=i,s-=a),fN(u,s,(c-=i)-u,(l-=a)-s)},c
reate:fN,fromClientRect:function(e){return fN(e.left,e.top,e.width,e.height)}},mN={},gN={add:function(e,t){mN[e.toLowerCase()]=t},has:function(e){return!!mN[e.toLowerCase()]},get:function(e){var t=e.toLowerCase(),n=mN.hasOwnProperty(t)?mN[t]:null;if(null===n)throw new Error("Could not find module for type: "+e);return n},create:function(e,t){var n;if("string"==typeof e?(t=t||{}).type=e:e=(t=e).type,e=e.toLowerCase(),!(n=mN[e]))throw new Error("Could not find control by type: "+e);return(n=new n(t)).type=e,n}},pN=Yt.each,hN=Yt.extend,vN=function(){};vN.extend=oN=function(n){var e,t,r,o=this.prototype,i=function(){var e,t,n;if(!iN&&(this.init&&this.init.apply(this,arguments),t=this.Mixins))for(e=t.length;e--;)(n=t[e]).init&&n.init.apply(this,arguments)},a=function(){return this},u=function(n,r){return function(){var e,t=this._super;return this._super=o[n],e=r.apply(this,arguments),this._super=t,e}};for(t in iN=!0,e=new this,iN=!1,n
.Mixins&&(pN(n.Mixins,function(e){for(var t in e)"init"!==t&&(n[t]=e[t])}),o.Mixins&&(n.Mixins=o.Mixins.concat(n.Mixins))),n.Methods&&pN(n.Methods.split(","),function(e){n[e]=a}),n.Properties&&pN(n.Properties.split(","),function(e){var t="_"+e;n[e]=function(e){return e!==undefined?(this[t]=e,this):this[t]}}),n.Statics&&pN(n.Statics,function(e,t){i[t]=e}),n.Defaults&&o.Defaults&&(n.Defaults=hN({},o.Defaults,n.Defaults)),n)"function"==typeof(r=n[t])&&o[t]?e[t]=u(t,r):e[t]=r;return i.prototype=e,(i.constructor=i).extend=oN,i};var bN=Math.min,yN=Math.max,CN=Math.round,xN=function(e,n){var r,o,t,i;if(n=n||'"',null===e)return"null";if("string"==(t=typeof e))return o="\bb\tt\nn\ff\rr\"\"''\\\\",n+e.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=o.indexOf(t))+1
?"\\"+o.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e)})+n;if("object"===t){if(e.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(e)){for(r=0,o="[";r<e.length;r++)o+=(0<r?",":"")+xN(e[r],n);return o+"]"}for(i in o="{",e)e.hasOwnProperty(i)&&(o+="function"!=typeof e[i]?(1<o.length?","+n:n)+i+n+":"+xN(e[i],n):"");return o+"}"}return""+e},wN={serialize:xN,parse:function(e){try{return JSON.parse(e)}catch(t){}}},NN={callbacks:{},count:0,send:function(t){var n=this,r=gi.DOM,o=t.count!==undefined?t.count:n.count,i="tinymce_jsonp_"+o;n.callbacks[o]=function(e){r.remove(i),delete n.callbacks[o],t.callback(e)},r.add(r.doc.body,"script",{id:i,src:t.url,type:"text/javascript"}),n.count++}},EN={send:function(e){var t,n=0,r=function(){!e
.async||4===t.readyState||1e4<n++?(e.success&&n<1e4&&200===t.status?e.success.call(e.success_scope,""+t.responseText,t,e):e.error&&e.error.call(e.error_scope,1e4<n?"TIMED_OUT":"GENERAL",t,e),t=null):setTimeout(r,10)};if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=!1!==e.async,e.data=e.data||"",EN.fire("beforeInitialize",{settings:e}),t=Tp()){if(t.overrideMimeType&&t.overrideMimeType(e.content_type),t.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(t.withCredentials=!0),e.content_type&&t.setRequestHeader("Content-Type",e.content_type),e.requestheaders&&Yt.each(e.requestheaders,function(e){t.setRequestHeader(e.key,e.value)}),t.setRequestHeader("X-Requested-With","XMLHttpRequest"),(t=EN.fire("beforeSend",{xhr:t,settings:e}).xhr).send
(e.data),!e.async)return r();setTimeout(r,10)}}};Yt.extend(EN,Rg);var SN,kN,TN,AN,RN=Yt.extend,_N=function(e){this.settings=RN({},e),this.count=0};_N.sendRPC=function(e){return(new _N).send(e)},_N.prototype={send:function(n){var r=n.error,o=n.success;(n=RN(this.settings,n)).success=function(e,t){void 0===(e=wN.parse(e))&&(e={error:"JSON Parse error."}),e.error?r.call(n.error_scope||n.scope,e.error,t):o.call(n.success_scope||n.scope,e.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=wN.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",EN.send(n)}};try{SN=window.localStorage}catch(LN){kN={},TN=[],AN={getItem:function(e){var t=kN[e];return t||null},setItem:function(e,t){TN.push(e),kN[e]=String(t)},key:function(e){return TN[e]},removeItem:function(t){TN=TN.filter(function(e){return e===t}),delete kN[t]},clear:function(){TN=[],kN={}},length:0},Object.defineProp
erty(AN,"length",{get:function(){return TN.length},configurable:!1,enumerable:!1}),SN=AN}var DN,BN=nN,ON={geom:{Rect:dN},util:{Promise:me,Delay:ve,Tools:Yt,VK:Oh,URI:dw,Class:vN,EventDispatcher:kg,Observable:Rg,I18n:jw,XHR:EN,JSON:wN,JSONRequest:_N,JSONP:NN,LocalStorage:SN,Color:function(e){var n={},u=0,s=0,c=0,t=function(e){var t;return"object"==typeof e?"r"in e?(u=e.r,s=e.g,c=e.b):"v"in e&&function(e,t,n){var r,o,i,a;if(e=(parseInt(e,10)||0)%360,t=parseInt(t,10)/100,n=parseInt(n,10)/100,t=yN(0,bN(t,1)),n=yN(0,bN(n,1)),0!==t){switch(r=e/60,i=(o=n*t)*(1-Math.abs(r%2-1)),a=n-o,Math.floor(r)){case 0:u=o,s=i,c=0;break;case 1:u=i,s=o,c=0;break;case 2:u=0,s=o,c=i;break;case 3:u=0,s=i,c=o;break;case 4:u=i,s=0,c=o;break;case 5:u=o,s=0,c=i;break;default:u=s=c=0}u=CN(255*(u+a)),s=CN(255*(s+a)),c=CN(255*(c+a))}else u=s=c=CN(255*n)}(e.h,e.s,e.v):(t=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(e))?(u=parseInt(t[1],10),s=parse
Int(t[2],10),c=parseInt(t[3],10)):(t=/#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(e))?(u=parseInt(t[1],16),s=parseInt(t[2],16),c=parseInt(t[3],16)):(t=/#([0-F])([0-F])([0-F])/gi.exec(e))&&(u=parseInt(t[1]+t[1],16),s=parseInt(t[2]+t[2],16),c=parseInt(t[3]+t[3],16)),u=u<0?0:255<u?255:u,s=s<0?0:255<s?255:s,c=c<0?0:255<c?255:c,n};return e&&t(e),n.toRgb=function(){return{r:u,g:s,b:c}},n.toHsv=function(){return e=u,t=s,n=c,o=0,(i=bN(e/=255,bN(t/=255,n/=255)))===(a=yN(e,yN(t,n)))?{h:0,s:0,v:100*(o=i)}:(r=(a-i)/a,{h:CN(60*((e===i?3:n===i?1:5)-(e===i?t-n:n===i?e-t:n-e)/((o=a)-i))),s:CN(100*r),v:CN(100*o)});var e,t,n,r,o,i,a},n.toHex=function(){var e=function(e){return 1<(e=parseInt(e,10).toString(16)).length?e:"0"+e};return"#"+e(u)+e(s)+e(c)},n.parse=t,n}},dom:{EventUtils:ke,Sizzle:kt,DomQuery:pn,TreeWalker:ro,DOMUtils:gi,ScriptLoader:yi,RangeUtils:aN,Serializer:Yb,ControlSelection:ny,BookmarkManager:Zb,Selection:Ly,Event:ke.Event},html:{S
tyles:ri,Entities:qo,Node:Ob,Schema:ti,SaxParser:Hh,DomParser:qb,Writer:nl,Serializer:rl},ui:{Factory:gN},Env:de,AddOnManager:wi,Annotator:Uc,Formatter:xb,UndoManager:uv,EditorCommands:Eg,WindowManager:hp,NotificationManager:pp,EditorObservable:$g,Shortcuts:Gg,Editor:Aw,FocusManager:Bw,EditorManager:nN,DOM:gi.DOM,ScriptLoader:yi.ScriptLoader,PluginManager:wi.PluginManager,ThemeManager:wi.ThemeManager,trim:Yt.trim,isArray:Yt.isArray,is:Yt.is,toArray:Yt.toArray,makeMap:Yt.makeMap,each:Yt.each,map:Yt.map,grep:Yt.grep,inArray:Yt.inArray,extend:Yt.extend,create:Yt.create,walk:Yt.walk,createNS:Yt.createNS,resolve:Yt.resolve,explode:Yt.explode,_addCacheSuffix:Yt._addCacheSuffix,isOpera:de.opera,isWebKit:de.webkit,isIE:de.ie,isGecko:de.gecko,isMac:de.mac},PN=BN=Yt.extend(BN,ON);DN=PN,window.tinymce=DN,window.tinyMCE=DN,function(e){if("object"==typeof module)try{module.exports=e}catch(t){}}(PN)}();
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpincludesversionphp"></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/version.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/version.php 2019-01-29 19:09:22 UTC (rev 44712)
+++ trunk/src/wp-includes/version.php 2019-01-29 20:18:33 UTC (rev 44713)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -27,7 +27,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global string $tinymce_version
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-$tinymce_version = '4800-20180716';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+$tinymce_version = '4920-20181217';
</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"> * Holds the required PHP version
</span></span></pre>
</div>
</div>
</body>
</html>