tinymce-rails 4.9.10 → 4.9.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/source/tinymce/tinymce.js +137 -120
- data/lib/tinymce/rails/version.rb +2 -2
- data/vendor/assets/javascripts/tinymce/tinymce.js +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d4a9e6b463099f136b4a76925e428f4adbdc905d04d316a97b1ea3508a10ddf
|
4
|
+
data.tar.gz: 103162d595c1bd4948ef0f41c101a5388a77d521737855a076c4c077d7b92038
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80ed2f75eb71bab2b14c5d380d6c8c9400079f253baa34471102fd71afa3019a3931f1843375a00f47d0398e43eb672568a2c6960bb6cf06ce62a2f00bbc28c6
|
7
|
+
data.tar.gz: cbc4371630d008d8b2d308ad0cd9687b43487bfbdf9e6f1d15f0bff8295ea5c41a03fa213a3d1e488103ae234600cce3660993c411718d4bedf70ac6fe62ac14
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// 4.9.
|
1
|
+
// 4.9.11 (2020-07-13)
|
2
2
|
(function () {
|
3
3
|
(function (domGlobals) {
|
4
4
|
'use strict';
|
@@ -5657,7 +5657,7 @@
|
|
5657
5657
|
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');
|
5658
5658
|
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);
|
5659
5659
|
textInlineElementsMap = createLookupTable('text_inline_elements', 'span strong b em i font strike u var cite ' + 'dfn code mark q sup sub samp');
|
5660
|
-
each$4((settings.special || 'script noscript noframes noembed title style textarea xmp').split(' '), function (name) {
|
5660
|
+
each$4((settings.special || 'script noscript iframe noframes noembed title style textarea xmp').split(' '), function (name) {
|
5661
5661
|
specialElements[name] = new RegExp('</' + name + '[^>]*>', 'gi');
|
5662
5662
|
});
|
5663
5663
|
var patternToRegExp = function (str) {
|
@@ -8103,7 +8103,8 @@
|
|
8103
8103
|
return overflowY >= 0 && overflowY <= Math.min(rect1.height, rect2.height) / 2;
|
8104
8104
|
};
|
8105
8105
|
var isAbove = function (rect1, rect2) {
|
8106
|
-
|
8106
|
+
var halfHeight = Math.min(rect2.height / 2, rect1.height / 2);
|
8107
|
+
if (rect1.bottom - halfHeight < rect2.top) {
|
8107
8108
|
return true;
|
8108
8109
|
}
|
8109
8110
|
if (rect1.top > rect2.bottom) {
|
@@ -13290,6 +13291,99 @@
|
|
13290
13291
|
};
|
13291
13292
|
var InlineFormatDelete = { backspaceDelete: backspaceDelete$5 };
|
13292
13293
|
|
13294
|
+
var getPos$1 = function (elm) {
|
13295
|
+
var x = 0, y = 0;
|
13296
|
+
var offsetParent = elm;
|
13297
|
+
while (offsetParent && offsetParent.nodeType) {
|
13298
|
+
x += offsetParent.offsetLeft || 0;
|
13299
|
+
y += offsetParent.offsetTop || 0;
|
13300
|
+
offsetParent = offsetParent.offsetParent;
|
13301
|
+
}
|
13302
|
+
return {
|
13303
|
+
x: x,
|
13304
|
+
y: y
|
13305
|
+
};
|
13306
|
+
};
|
13307
|
+
var fireScrollIntoViewEvent = function (editor, elm, alignToTop) {
|
13308
|
+
var scrollEvent = {
|
13309
|
+
elm: elm,
|
13310
|
+
alignToTop: alignToTop
|
13311
|
+
};
|
13312
|
+
editor.fire('scrollIntoView', scrollEvent);
|
13313
|
+
return scrollEvent.isDefaultPrevented();
|
13314
|
+
};
|
13315
|
+
var scrollElementIntoView = function (editor, elm, alignToTop) {
|
13316
|
+
var y, viewPort;
|
13317
|
+
var dom = editor.dom;
|
13318
|
+
var root = dom.getRoot();
|
13319
|
+
var viewPortY, viewPortH, offsetY = 0;
|
13320
|
+
if (fireScrollIntoViewEvent(editor, elm, alignToTop)) {
|
13321
|
+
return;
|
13322
|
+
}
|
13323
|
+
if (!NodeType.isElement(elm)) {
|
13324
|
+
return;
|
13325
|
+
}
|
13326
|
+
if (alignToTop === false) {
|
13327
|
+
offsetY = elm.offsetHeight;
|
13328
|
+
}
|
13329
|
+
if (root.nodeName !== 'BODY') {
|
13330
|
+
var scrollContainer = editor.selection.getScrollContainer();
|
13331
|
+
if (scrollContainer) {
|
13332
|
+
y = getPos$1(elm).y - getPos$1(scrollContainer).y + offsetY;
|
13333
|
+
viewPortH = scrollContainer.clientHeight;
|
13334
|
+
viewPortY = scrollContainer.scrollTop;
|
13335
|
+
if (y < viewPortY || y + 25 > viewPortY + viewPortH) {
|
13336
|
+
scrollContainer.scrollTop = y < viewPortY ? y : y - viewPortH + 25;
|
13337
|
+
}
|
13338
|
+
return;
|
13339
|
+
}
|
13340
|
+
}
|
13341
|
+
viewPort = dom.getViewPort(editor.getWin());
|
13342
|
+
y = dom.getPos(elm).y + offsetY;
|
13343
|
+
viewPortY = viewPort.y;
|
13344
|
+
viewPortH = viewPort.h;
|
13345
|
+
if (y < viewPort.y || y + 25 > viewPortY + viewPortH) {
|
13346
|
+
editor.getWin().scrollTo(0, y < viewPortY ? y : y - viewPortH + 25);
|
13347
|
+
}
|
13348
|
+
};
|
13349
|
+
var getViewPortRect = function (editor) {
|
13350
|
+
if (editor.inline) {
|
13351
|
+
return editor.getBody().getBoundingClientRect();
|
13352
|
+
} else {
|
13353
|
+
var win = editor.getWin();
|
13354
|
+
return {
|
13355
|
+
left: 0,
|
13356
|
+
right: win.innerWidth,
|
13357
|
+
top: 0,
|
13358
|
+
bottom: win.innerHeight,
|
13359
|
+
width: win.innerWidth,
|
13360
|
+
height: win.innerHeight
|
13361
|
+
};
|
13362
|
+
}
|
13363
|
+
};
|
13364
|
+
var scrollBy = function (editor, dx, dy) {
|
13365
|
+
if (editor.inline) {
|
13366
|
+
editor.getBody().scrollLeft += dx;
|
13367
|
+
editor.getBody().scrollTop += dy;
|
13368
|
+
} else {
|
13369
|
+
editor.getWin().scrollBy(dx, dy);
|
13370
|
+
}
|
13371
|
+
};
|
13372
|
+
var scrollRangeIntoView = function (editor, rng) {
|
13373
|
+
head(CaretPosition.fromRangeStart(rng).getClientRects()).each(function (rngRect) {
|
13374
|
+
var bodyRect = getViewPortRect(editor);
|
13375
|
+
var overflow = getOverflow(bodyRect, rngRect);
|
13376
|
+
var margin = 4;
|
13377
|
+
var dx = overflow.x > 0 ? overflow.x + margin : overflow.x - margin;
|
13378
|
+
var dy = overflow.y > 0 ? overflow.y + margin : overflow.y - margin;
|
13379
|
+
scrollBy(editor, overflow.x !== 0 ? dx : 0, overflow.y !== 0 ? dy : 0);
|
13380
|
+
});
|
13381
|
+
};
|
13382
|
+
var ScrollIntoView = {
|
13383
|
+
scrollElementIntoView: scrollElementIntoView,
|
13384
|
+
scrollRangeIntoView: scrollRangeIntoView
|
13385
|
+
};
|
13386
|
+
|
13293
13387
|
var isContentEditableTrue$2 = NodeType.isContentEditableTrue;
|
13294
13388
|
var isContentEditableFalse$6 = NodeType.isContentEditableFalse;
|
13295
13389
|
var showCaret = function (direction, editor, node, before, scrollIntoView) {
|
@@ -13336,6 +13430,10 @@
|
|
13336
13430
|
}
|
13337
13431
|
return range;
|
13338
13432
|
};
|
13433
|
+
var moveToRange = function (editor, rng) {
|
13434
|
+
editor.selection.setRng(rng);
|
13435
|
+
ScrollIntoView.scrollRangeIntoView(editor, editor.selection.getRng());
|
13436
|
+
};
|
13339
13437
|
|
13340
13438
|
var trimEmptyTextNode$1 = function (dom, node) {
|
13341
13439
|
if (NodeType.isText(node) && node.data.length === 0) {
|
@@ -20415,7 +20513,7 @@
|
|
20415
20513
|
var blockElements = Tools.extend({}, schema.getBlockElements());
|
20416
20514
|
var nonEmptyElements = schema.getNonEmptyElements();
|
20417
20515
|
var parent, lastParent, prev, prevName;
|
20418
|
-
var whiteSpaceElements = schema.
|
20516
|
+
var whiteSpaceElements = schema.getWhiteSpaceElements();
|
20419
20517
|
var elementRule, textNode;
|
20420
20518
|
blockElements.body = 1;
|
20421
20519
|
for (i = 0; i < l; i++) {
|
@@ -21490,99 +21588,6 @@
|
|
21490
21588
|
};
|
21491
21589
|
};
|
21492
21590
|
|
21493
|
-
var getPos$1 = function (elm) {
|
21494
|
-
var x = 0, y = 0;
|
21495
|
-
var offsetParent = elm;
|
21496
|
-
while (offsetParent && offsetParent.nodeType) {
|
21497
|
-
x += offsetParent.offsetLeft || 0;
|
21498
|
-
y += offsetParent.offsetTop || 0;
|
21499
|
-
offsetParent = offsetParent.offsetParent;
|
21500
|
-
}
|
21501
|
-
return {
|
21502
|
-
x: x,
|
21503
|
-
y: y
|
21504
|
-
};
|
21505
|
-
};
|
21506
|
-
var fireScrollIntoViewEvent = function (editor, elm, alignToTop) {
|
21507
|
-
var scrollEvent = {
|
21508
|
-
elm: elm,
|
21509
|
-
alignToTop: alignToTop
|
21510
|
-
};
|
21511
|
-
editor.fire('scrollIntoView', scrollEvent);
|
21512
|
-
return scrollEvent.isDefaultPrevented();
|
21513
|
-
};
|
21514
|
-
var scrollElementIntoView = function (editor, elm, alignToTop) {
|
21515
|
-
var y, viewPort;
|
21516
|
-
var dom = editor.dom;
|
21517
|
-
var root = dom.getRoot();
|
21518
|
-
var viewPortY, viewPortH, offsetY = 0;
|
21519
|
-
if (fireScrollIntoViewEvent(editor, elm, alignToTop)) {
|
21520
|
-
return;
|
21521
|
-
}
|
21522
|
-
if (!NodeType.isElement(elm)) {
|
21523
|
-
return;
|
21524
|
-
}
|
21525
|
-
if (alignToTop === false) {
|
21526
|
-
offsetY = elm.offsetHeight;
|
21527
|
-
}
|
21528
|
-
if (root.nodeName !== 'BODY') {
|
21529
|
-
var scrollContainer = editor.selection.getScrollContainer();
|
21530
|
-
if (scrollContainer) {
|
21531
|
-
y = getPos$1(elm).y - getPos$1(scrollContainer).y + offsetY;
|
21532
|
-
viewPortH = scrollContainer.clientHeight;
|
21533
|
-
viewPortY = scrollContainer.scrollTop;
|
21534
|
-
if (y < viewPortY || y + 25 > viewPortY + viewPortH) {
|
21535
|
-
scrollContainer.scrollTop = y < viewPortY ? y : y - viewPortH + 25;
|
21536
|
-
}
|
21537
|
-
return;
|
21538
|
-
}
|
21539
|
-
}
|
21540
|
-
viewPort = dom.getViewPort(editor.getWin());
|
21541
|
-
y = dom.getPos(elm).y + offsetY;
|
21542
|
-
viewPortY = viewPort.y;
|
21543
|
-
viewPortH = viewPort.h;
|
21544
|
-
if (y < viewPort.y || y + 25 > viewPortY + viewPortH) {
|
21545
|
-
editor.getWin().scrollTo(0, y < viewPortY ? y : y - viewPortH + 25);
|
21546
|
-
}
|
21547
|
-
};
|
21548
|
-
var getViewPortRect = function (editor) {
|
21549
|
-
if (editor.inline) {
|
21550
|
-
return editor.getBody().getBoundingClientRect();
|
21551
|
-
} else {
|
21552
|
-
var win = editor.getWin();
|
21553
|
-
return {
|
21554
|
-
left: 0,
|
21555
|
-
right: win.innerWidth,
|
21556
|
-
top: 0,
|
21557
|
-
bottom: win.innerHeight,
|
21558
|
-
width: win.innerWidth,
|
21559
|
-
height: win.innerHeight
|
21560
|
-
};
|
21561
|
-
}
|
21562
|
-
};
|
21563
|
-
var scrollBy = function (editor, dx, dy) {
|
21564
|
-
if (editor.inline) {
|
21565
|
-
editor.getBody().scrollLeft += dx;
|
21566
|
-
editor.getBody().scrollTop += dy;
|
21567
|
-
} else {
|
21568
|
-
editor.getWin().scrollBy(dx, dy);
|
21569
|
-
}
|
21570
|
-
};
|
21571
|
-
var scrollRangeIntoView = function (editor, rng) {
|
21572
|
-
head(CaretPosition.fromRangeStart(rng).getClientRects()).each(function (rngRect) {
|
21573
|
-
var bodyRect = getViewPortRect(editor);
|
21574
|
-
var overflow = getOverflow(bodyRect, rngRect);
|
21575
|
-
var margin = 4;
|
21576
|
-
var dx = overflow.x > 0 ? overflow.x + margin : overflow.x - margin;
|
21577
|
-
var dy = overflow.y > 0 ? overflow.y + margin : overflow.y - margin;
|
21578
|
-
scrollBy(editor, overflow.x !== 0 ? dx : 0, overflow.y !== 0 ? dy : 0);
|
21579
|
-
});
|
21580
|
-
};
|
21581
|
-
var ScrollIntoView = {
|
21582
|
-
scrollElementIntoView: scrollElementIntoView,
|
21583
|
-
scrollRangeIntoView: scrollRangeIntoView
|
21584
|
-
};
|
21585
|
-
|
21586
21591
|
var hasCeProperty = function (node) {
|
21587
21592
|
return NodeType.isContentEditableTrue(node) || NodeType.isContentEditableFalse(node);
|
21588
21593
|
};
|
@@ -21901,22 +21906,37 @@
|
|
21901
21906
|
};
|
21902
21907
|
var GetSelectionContent = { getContent: getContent };
|
21903
21908
|
|
21909
|
+
var setupArgs = function (args, content) {
|
21910
|
+
return __assign(__assign({ format: 'html' }, args), {
|
21911
|
+
set: true,
|
21912
|
+
selection: true,
|
21913
|
+
content: content
|
21914
|
+
});
|
21915
|
+
};
|
21916
|
+
var cleanContent = function (editor, args) {
|
21917
|
+
if (args.format !== 'raw') {
|
21918
|
+
var node = editor.parser.parse(args.content, __assign({
|
21919
|
+
isRootContent: true,
|
21920
|
+
forced_root_block: false
|
21921
|
+
}, args));
|
21922
|
+
return HtmlSerializer({ validate: editor.validate }, editor.schema).serialize(node);
|
21923
|
+
} else {
|
21924
|
+
return args.content;
|
21925
|
+
}
|
21926
|
+
};
|
21904
21927
|
var setContent = function (editor, content, args) {
|
21928
|
+
var contentArgs = setupArgs(args, content);
|
21905
21929
|
var rng = editor.selection.getRng(), caretNode;
|
21906
21930
|
var doc = editor.getDoc();
|
21907
21931
|
var frag, temp;
|
21908
|
-
|
21909
|
-
|
21910
|
-
|
21911
|
-
|
21912
|
-
if (!args.no_events) {
|
21913
|
-
args = editor.fire('BeforeSetContent', args);
|
21914
|
-
if (args.isDefaultPrevented()) {
|
21915
|
-
editor.fire('SetContent', args);
|
21932
|
+
if (!contentArgs.no_events) {
|
21933
|
+
contentArgs = editor.fire('BeforeSetContent', contentArgs);
|
21934
|
+
if (contentArgs.isDefaultPrevented()) {
|
21935
|
+
editor.fire('SetContent', contentArgs);
|
21916
21936
|
return;
|
21917
21937
|
}
|
21918
21938
|
}
|
21919
|
-
content =
|
21939
|
+
content = cleanContent(editor, contentArgs);
|
21920
21940
|
if (rng.insertNode) {
|
21921
21941
|
content += '<span id="__caret">_</span>';
|
21922
21942
|
if (rng.startContainer === doc && rng.endContainer === doc) {
|
@@ -21948,19 +21968,20 @@
|
|
21948
21968
|
} catch (ex) {
|
21949
21969
|
}
|
21950
21970
|
} else {
|
21951
|
-
|
21971
|
+
var anyRng = rng;
|
21972
|
+
if (anyRng.item) {
|
21952
21973
|
doc.execCommand('Delete', false, null);
|
21953
|
-
|
21974
|
+
anyRng = editor.selection.getRng();
|
21954
21975
|
}
|
21955
21976
|
if (/^\s+/.test(content)) {
|
21956
|
-
|
21977
|
+
anyRng.pasteHTML('<span id="__mce_tmp">_</span>' + content);
|
21957
21978
|
editor.dom.remove('__mce_tmp');
|
21958
21979
|
} else {
|
21959
|
-
|
21980
|
+
anyRng.pasteHTML(content);
|
21960
21981
|
}
|
21961
21982
|
}
|
21962
|
-
if (!
|
21963
|
-
editor.fire('SetContent',
|
21983
|
+
if (!contentArgs.no_events) {
|
21984
|
+
editor.fire('SetContent', contentArgs);
|
21964
21985
|
}
|
21965
21986
|
};
|
21966
21987
|
var SetSelectionContent = { setContent: setContent };
|
@@ -22649,7 +22670,7 @@
|
|
22649
22670
|
return function () {
|
22650
22671
|
var newRng = getHorizontalRange(editor, forward);
|
22651
22672
|
if (newRng) {
|
22652
|
-
editor
|
22673
|
+
moveToRange(editor, newRng);
|
22653
22674
|
return true;
|
22654
22675
|
} else {
|
22655
22676
|
return false;
|
@@ -22660,7 +22681,7 @@
|
|
22660
22681
|
return function () {
|
22661
22682
|
var newRng = getVerticalRange(editor, down);
|
22662
22683
|
if (newRng) {
|
22663
|
-
editor
|
22684
|
+
moveToRange(editor, newRng);
|
22664
22685
|
return true;
|
22665
22686
|
} else {
|
22666
22687
|
return false;
|
@@ -22762,10 +22783,6 @@
|
|
22762
22783
|
});
|
22763
22784
|
};
|
22764
22785
|
|
22765
|
-
var moveToRange = function (editor, rng) {
|
22766
|
-
editor.selection.setRng(rng);
|
22767
|
-
ScrollIntoView.scrollRangeIntoView(editor, rng);
|
22768
|
-
};
|
22769
22786
|
var hasNextBreak = function (getPositionsUntil, scope, lineInfo) {
|
22770
22787
|
return lineInfo.breakAt.map(function (breakPos) {
|
22771
22788
|
return getPositionsUntil(scope, breakPos).breakAt.isSome();
|
@@ -26364,8 +26381,8 @@
|
|
26364
26381
|
defaultSettings: {},
|
26365
26382
|
$: DomQuery,
|
26366
26383
|
majorVersion: '4',
|
26367
|
-
minorVersion: '9.
|
26368
|
-
releaseDate: '2020-
|
26384
|
+
minorVersion: '9.11',
|
26385
|
+
releaseDate: '2020-07-13',
|
26369
26386
|
editors: legacyEditors,
|
26370
26387
|
i18n: I18n,
|
26371
26388
|
activeEditor: null,
|
@@ -1,2 +1,2 @@
|
|
1
|
-
// 4.9.
|
2
|
-
!function(V){"use strict";var o=function(){},H=function(n,r){return function(){for(var e=[],t=0;t ').css(n).appendTo(a)[0];return c.set(_.some({caret:i,element:e,before:t})),c.get().each(function(e){t&&gn(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=fs(a,e.element,e.before);gn(e.caret).css(t)})},destroy:function(){return he.clearInterval(t)}}},ms=function(){return cs.isIE()||cs.isEdge()||cs.isFirefox()},gs=function(e){return ls(e)||jo.isTable(e)&&ms()},ps=jo.isContentEditableFalse,hs=jo.matchStyleValues("display","block table table-cell table-caption list-item"),vs=ka,ys=Sa,bs=jo.isElement,Cs=Ha,xs=function(e){return 0"+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 _(t,r),o&&("string"!=typeof o&&o.nodeType?t.appendChild(o):"string"==typeof o&&A(t,o)),i?t:e.appendChild(t)})},D=function(e,t,n){return R(a.createElement(e),e,t,n,!0)},O=ti.decode,B=ti.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 |)$/," "))),t}(g.getRng(),t)),r=e.parser,m=n.merge,o=al({validate:e.settings.validate},e.schema),d='',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,y,b,C,x,w=(l=g.getRng()).startContainer||(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(cl(e.selection.getRng())),e.getDoc().execCommand("Delete",!1,null),y=e.selection.getRng(),b=t,C=y.startContainer,x=y.startOffset,3===C.nodeType&&y.collapsed&&("\xa0"===C.data[x]?(C.deleteData(x,1),/[\u00a0| ]$/.test(b)||(b+=" ")):"\xa0"===C.data[x-1]&&(C.deleteData(x-1,1),/[\u00a0| ]$/.test(b)||(b=" "+b))),t=b);var E,S,T,k={context:(i=g.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0};if(u=r.parse(t,k),!0===n.paste&&Gc(e.schema,u)&&Qc(p,i))return l=Jc(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),k.invalid){for(fl(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(//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):fl(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 el(r);Xt.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),fe.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),ll(r)||r.getAttribute("data-mce-fragment")||!(o=function(e){var t=_u.fromRangeStart(e);if(t=Js(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(),Xt.each(E.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),S=e.dom,T=e.selection.getStart(),_.from(S.getParent(T,"td,th")).map(ar.fromDom).each(rl),e.fire("SetContent",s),e.addVisual()}},ml=function(e,t){var n,r,o="string"!=typeof(n=t)?(r=Xt.extend({paste:n.paste,data:{paste:n.paste}},n),{content:n.content,details:r}):{content:n,details:{}};dl(e,o.content,o.details)},gl=/[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/,pl=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},hl=function(e){return e.getParam("iframe_attrs",{})},vl=function(e){return e.getParam("doctype","")},yl=function(e){return e.getParam("document_base_url","")},bl=function(e){return pl(e,"body_id","tinymce")},Cl=function(e){return pl(e,"body_class","")},xl=function(e){return e.getParam("content_security_policy","")},wl=function(e){return e.getParam("br_in_pre",!0)},Nl=function(e){if(e.getParam("force_p_newlines",!1))return"p";var t=e.getParam("forced_root_block","p");return!1===t?"":t},El=function(e){return e.getParam("forced_root_block_attrs",{})},Sl=function(e){return e.getParam("br_newline_selector",".mce-toc h2,figcaption,caption")},Tl=function(e){return e.getParam("no_newline_selector","")},kl=function(e){return e.getParam("keep_styles",!0)},_l=function(e){return e.getParam("end_container_on_empty_block",!1)},Al=function(e){return Xt.explode(e.getParam("font_size_style_values",""))},Rl=function(e){return Xt.explode(e.getParam("font_size_classes",""))},Dl=function(e){return e.getParam("images_dataimg_filter",q(!0),"function")},Ol=function(e){return e.getParam("automatic_uploads",!0,"boolean")},Bl=function(e){return e.getParam("images_reuse_filename",!1,"boolean")},Pl=function(e){return e.getParam("images_replace_blob_uris",!0,"boolean")},Il=function(e){return e.getParam("images_upload_url","","string")},Ll=function(e){return e.getParam("images_upload_base_path","","string")},Fl=function(e){return e.getParam("images_upload_credentials",!1,"boolean")},Ml=function(e){return e.getParam("images_upload_handler",null,"function")},zl=function(e){return e.getParam("content_css_cors",!1,"boolean")},Ul=function(e){return e.getParam("inline_boundaries_selector","a[href],code,.mce-annotation","string")},jl=function(e,t){if(!t)return t;var n=t.container(),r=t.offset();return e?Ta(n)?jo.isText(n.nextSibling)?_u(n.nextSibling,0):_u.after(n):Aa(t)?_u(n,r+1):t:Ta(n)?jo.isText(n.previousSibling)?_u(n.previousSibling,n.previousSibling.data.length):_u.before(n):Ra(t)?_u(n,r-1):t},Vl={isInlineTarget:function(e,t){return Lr(ar.fromDom(t),Ul(e))},findRootInline:function(e,t,n){var r,o,i,a=(r=e,o=t,i=n,U(Si.DOM.getParents(i.container(),"*",o),r));return _.from(a[a.length-1])},isRtl:function(e){return"rtl"===Si.DOM.getStyle(e,"direction",!0)||(t=e.textContent,gl.test(t));var t},isAtZwsp:function(e){return Aa(e)||Ra(e)},normalizePosition:jl,normalizeForwards:d(jl,!0),normalizeBackwards:d(jl,!1),hasSameParentBlock:function(e,t,n){var r=Ss(t,e),o=Ss(n,e);return r&&r===o}},Hl=function(e,t){return zr(e,t)?na(t,function(e){return No(e)||So(e)},(n=e,function(e){return Mr(n,ar.fromDom(e.dom().parentNode))})):_.none();var n},ql=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))},$l=function(i,a,u){return ru(sc.firstPositionIn(u),sc.lastPositionIn(u),function(e,t){var n=Vl.normalizePosition(!0,e),r=Vl.normalizePosition(!1,t),o=Vl.normalizePosition(!1,a);return i?sc.nextPosition(u,o).map(function(e){return e.isEqual(r)&&a.isEqual(n)}).getOr(!1):sc.prevPosition(u,o).map(function(e){return e.isEqual(n)&&a.isEqual(r)}).getOr(!1)}).getOr(!0)},Wl=function(e,t){var n,r,o,i=ar.fromDom(e),a=ar.fromDom(t);return n=a,r="pre,code",o=d(Mr,i),ra(n,r,o).isSome()},Kl=function(e,t){return Ha(t)&&!1===(r=e,o=t,jo.isText(o)&&/^[ \t\r\n]*$/.test(o.data)&&!1===Wl(r,o))||(n=t,jo.isElement(n)&&"A"===n.nodeName&&n.hasAttribute("name"))||Xl(t);var n,r,o},Xl=jo.hasAttribute("data-mce-bookmark"),Yl=jo.hasAttribute("data-mce-bogus"),Gl=jo.hasAttributeValue("data-mce-bogus","all"),Jl=function(e){return function(e){var t,n,r=0;if(Kl(e,e))return!1;if(!(n=e.firstChild))return!0;t=new go(n,e);do{if(Gl(n))n=t.next(!0);else if(Yl(n))n=t.next();else if(jo.isBr(n))r++,n=t.next();else{if(Kl(e,n))return!1;n=t.next()}}while(n);return r<=1}(e.dom())},Ql=Ar("block","position"),Zl=Ar("from","to"),ef=function(e,t){var n=ar.fromDom(e),r=ar.fromDom(t.container());return Hl(n,r).map(function(e){return Ql(e,t)})},tf=function(o,i,e){var t=ef(o,_u.fromRangeStart(e)),n=t.bind(function(e){return sc.fromPosition(i,o,e.position()).bind(function(e){return ef(o,e).map(function(e){return t=o,n=i,r=e,jo.isBr(r.position().getNode())&&!1===Jl(r.block())?sc.positionIn(!1,r.block().dom()).bind(function(e){return e.isEqual(r.position())?sc.fromPosition(n,t,e).bind(function(e){return ef(t,e)}):_.some(r)}).getOr(r):r;var t,n,r})})});return ru(t,n,Zl).filter(function(e){return!1===Mr((r=e).from().block(),r.to().block())&&Vr((n=e).from().block()).bind(function(t){return Vr(n.to().block()).filter(function(e){return Mr(t,e)})}).isSome()&&(t=e,!1===jo.isContentEditableFalse(t.from().block().dom())&&!1===jo.isContentEditableFalse(t.to().block().dom()));var t,n,r})},nf=function(e,t,n){return n.collapsed?tf(e,t,n):_.none()},rf=function(e,t,n){return zr(t,e)?function(e,t){for(var n=D(t)?t:b,r=e.dom(),o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=ar.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,function(e){return n(e)||Mr(e,t)}).slice(0,-1):[]},of=function(e,t){return rf(e,t,q(!1))},af=of,uf=function(e,t){return[e].concat(of(e,t))},sf=function(e){var t,n=(t=Kr(e),Y(t,Co).fold(function(){return t},function(e){return t.slice(0,e)}));return z(n,Ui),n},cf=function(e,t){var n=uf(t,e);return X(n.reverse(),Jl).each(Ui)},lf=function(e,t,n,r){if(Jl(n))return nl(n),sc.firstPositionIn(n.dom());0===U($r(r),function(e){return!Jl(e)}).length&&Jl(t)&&Pi(r,ar.fromTag("br"));var o=sc.prevPosition(n.dom(),_u.before(r.dom()));return z(sf(t),function(e){Pi(r,e)}),cf(e,t),o},ff=function(e,t,n){if(Jl(n))return Ui(n),Jl(t)&&nl(t),sc.firstPositionIn(t.dom());var r=sc.lastPositionIn(n.dom());return z(sf(t),function(e){Fi(n,e)}),cf(e,t),r},df=function(e,t){return zr(t,e)?(n=uf(e,t),_.from(n[n.length-1])):_.none();var n},mf=function(e,t){sc.positionIn(e,t.dom()).map(function(e){return e.getNode()}).map(ar.fromDom).filter(wo).each(Ui)},gf=function(e,t,n){return mf(!0,t),mf(!1,n),df(t,n).fold(d(ff,e,t,n),d(lf,e,t,n))},pf=function(e,t,n,r){return t?gf(e,r,n):gf(e,n,r)},hf=function(t,n){var e,r=ar.fromDom(t.getBody());return(e=nf(r.dom(),n,t.selection.getRng()).bind(function(e){return pf(r,n,e.from().block(),e.to().block())})).each(function(e){t.selection.setRng(e.toRange())}),e.isSome()},vf=function(e,t){var n=ar.fromDom(t),r=d(Mr,e);return ta(n,_o,r).isSome()},yf=function(e,t){var n,r,o=sc.prevPosition(e.dom(),_u.fromRangeStart(t)).isNone(),i=sc.nextPosition(e.dom(),_u.fromRangeEnd(t)).isNone();return!(vf(n=e,(r=t).startContainer)||vf(n,r.endContainer))&&o&&i},bf=function(e){var n,r,o,t,i=ar.fromDom(e.getBody()),a=e.selection.getRng();return yf(i,a)?((t=e).setContent(""),t.selection.setCursorLocation(),!0):(n=i,r=e.selection,o=r.getRng(),ru(Hl(n,ar.fromDom(o.startContainer)),Hl(n,ar.fromDom(o.endContainer)),function(e,t){return!1===Mr(e,t)&&(o.deleteContents(),pf(n,!0,e,t).each(function(e){r.setRng(e.toRange())}),!0)}).getOr(!1))},Cf=function(e,t){return!e.selection.isCollapsed()&&bf(e)},xf=function(a){if(!k(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 z(a,function(e,r){var t=gr(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(!k(i))throw 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 ');return zi(e),Fi(e,t),_.some(_u.before(t.dom()))}return _.none()},nd=function(e,t,l){var n,r,o,i,a=Hr(e).filter(mr),u=qr(e).filter(mr);return Ui(e),(n=a,r=u,o=t,i=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=Jn((r=u).data).length,r.appendData(o.data),Ui(ar.fromDom(o)),i&&Wf(r,a),n.container()===s?_u(u,c):n},n.isSome()&&r.isSome()&&o.isSome()?_.some(i(n.getOrDie(),r.getOrDie(),o.getOrDie())):_.none()).orThunk(function(){return l&&(a.each(function(e){return t=e.dom(),n=e.dom().length,r=t.data.slice(0,n),o=r.length-Jn(r).length,$f(t,n-o,o);var t,n,r,o}),u.each(function(e){return Wf(e.dom(),0)})),t})},rd=function(t,n,e,r){void 0===r&&(r=!0);var o,i,a=Qf(n,t.getBody(),e.dom()),u=ta(e,d(ed,t),(o=t.getBody(),function(e){return e.dom()===o})),s=nd(e,a,(i=e,br(t.schema.getTextInlineElements(),lr(i))));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(td).fold(function(){r&&Zf(t,n,s)},function(e){r&&Zf(t,n,_.some(e))})},od=function(a,u){var e,t,n,r,o,i;return(e=a.getBody(),t=u,n=a.selection.getRng(),r=Os(t?1:-1,e,n),o=_u.fromRangeStart(r),i=ar.fromDom(e),!1===t&&Ff(o)?_.some(jf.remove(o.getNode(!0))):t&&Lf(o)?_.some(jf.remove(o.getNode())):!1===t&&Lf(o)&&Sf(i,o)?Tf(i,o).map(function(e){return jf.remove(e.getNode())}):t&&Ff(o)&&Ef(i,o)?kf(i,o).map(function(e){return jf.remove(e.getNode())}):qf(e,t,o)).map(function(e){return e.fold((o=a,i=u,function(e){return o._selectionOverrides.hideFakeCaret(),rd(o,i,ar.fromDom(e)),!0}),(n=a,r=u,function(e){var t=r?_u.before(e):_u.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)},id=function(e,t){var n,r=e.selection.getNode();return!!jo.isContentEditableFalse(r)&&(n=ar.fromDom(e.getBody()),z(Qi(n,".mce-offscreen-selection"),Ui),rd(e,t,ar.fromDom(e.selection.getNode())),ql(e),!0)},ad=function(e,t){return e.selection.isCollapsed()?od(e,t):id(e,t)},ud=function(e){var t,n=function(e,t){for(;t&&t!==e;){if(jo.isContentEditableTrue(t)||jo.isContentEditableFalse(t))return t;t=t.parentNode}return null}(e.getBody(),e.selection.getNode());return jo.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(_u.before(t).toRange())),!0},sd=jo.isText,cd=function(e){return sd(e)&&e.data[0]===xa},ld=function(e){return sd(e)&&e.data[e.data.length-1]===xa},fd=function(e){return e.ownerDocument.createTextNode(xa)},dd=function(e,t){return e?function(e){if(sd(e.previousSibling))return ld(e.previousSibling)||e.previousSibling.appendData(xa),e.previousSibling;if(sd(e))return cd(e)||e.insertData(0,xa),e;var t=fd(e);return e.parentNode.insertBefore(t,e),t}(t):function(e){if(sd(e.nextSibling))return cd(e.nextSibling)||e.nextSibling.insertData(0,xa),e.nextSibling;if(sd(e))return ld(e)||e.appendData(xa),e;var t=fd(e);return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t}(t)},md=d(dd,!0),gd=d(dd,!1),pd=function(e,t){return jo.isText(e.container())?dd(t,e.container()):dd(t,e.getNode())},hd=function(e,t){var n=t.get();return n&&e.container()===n&&Ta(n)},vd=function(n,e){return e.fold(function(e){ss.remove(n.get());var t=md(e);return n.set(t),_.some(_u(t,t.length-1))},function(e){return sc.firstPositionIn(e).map(function(e){if(hd(e,n))return _u(n.get(),1);ss.remove(n.get());var t=pd(e,!0);return n.set(t),_u(t,1)})},function(e){return sc.lastPositionIn(e).map(function(e){if(hd(e,n))return _u(n.get(),n.get().length-1);ss.remove(n.get());var t=pd(e,!1);return n.set(t),_u(t,t.length-1)})},function(e){ss.remove(n.get());var t=gd(e);return n.set(t),_.some(_u(t,1))})},yd=function(e,t){for(var n=0;n \xa0 ').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),z(Qi(ar.fromDom(g.getBody()),"*[data-mce-selected]"),function(e){Sr(e,"data-mce-selected")}),n.setAttribute("data-mce-selected","1"),p=n,C(),e)):null)},f=function(){p&&(p.removeAttribute("data-mce-selected"),oa(ar.fromDom(g.getBody()),"#"+h).each(Ui),p=null),oa(ar.fromDom(g.getBody()),"#"+h).each(Ui),p=null},C=function(){o.hide()};return fe.ceFalse&&(function(){g.on("mouseup",function(e){var t=s();t.collapsed&&fh(g,e.clientX,e.clientY)&&u(ug(g,t,!1))}),g.on("click",function(e){var t;(t=_v(g,e.target))&&(kv(t)&&(e.preventDefault(),g.focus()),Tv(t)&&g.dom.isChildOf(t,g.selection.getNode())&&f())}),g.on("blur NewBlock",function(){f()}),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!==kv(_v(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=Js(e);if(!e.firstChild)return!1;var n=_u.before(e.firstChild),r=t.next(n);return r&&!Lf(r)&&!Ff(r)}(o)};r=!1,(n=g).on("touchstart",function(){r=!1}),n.on("touchmove",function(){r=!0}),n.on("touchend",function(e){var t=_v(n,e.target);kv(t)&&(r||(e.preventDefault(),l(ag(n,t))))}),g.on("mousedown",function(e){var t,n=e.target;if((n===a||"HTML"===n.nodeName||g.dom.isChildOf(n,a))&&!1!==fh(g,e.clientX,e.clientY))if(t=_v(g,n))kv(t)?(e.preventDefault(),l(ag(g,t))):(f(),Tv(t)&&e.shiftKey||gv(e.clientX,e.clientY,g.selection.getRng())||(C(),g.selection.placeCaretAt(e.clientX,e.clientY)));else if(!1===gs(n)){f(),C();var r=mv(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){Zh.modifierPressed(e)||(e.keyCode,kv(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){e.range=c(e.range);var t=l(e.range,e.forward);t&&(e.range=t)}),g.on("AfterSetSelectionRange",function(e){var t,n=e.range;b(n)||"mcepastebin"===n.startContainer.parentNode.id||C(),t=n.startContainer.parentNode,g.dom.hasClass(t,"mce-offscreen-selection")||f()}),g.on("copy",function(e){var t,n=e.clipboardData;if(!e.isDefaultPrevented()&&e.clipboardData&&!fe.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))}}),Ev(g),Sv(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")&&(Pa(e),u(s()),g.selection.scrollIntoView(e[0]))},hideFakeCaret:C,destroy:function(){o.destroy(),p=null}}},Rv=function(e){for(var t=e;/)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\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 |