panel.reposition(editor, result.id, result.rect);
var ignoreWhenFormIsVisible = function (editor, panel, f) {
if (!editor.removed && !panel.inForm()) {
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);
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')]);
panel.show(editor, result.id, result.rect, toolbars);
var renderInlineUI = function (editor, panel) {
SkinLoader.load(editor, function () {
bindContextualToolbarsEvents(editor, panel);
overrideLinkShortcut(editor, panel);
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 };
var constant = function (value) {
var never = constant(false);
var always = constant(true);
var call = function (thunk) {
getOrDie: function (msg) {
throw new Error(msg || 'error: getOrDie called on none.');
getOrNull: constant(null),
getOrUndefined: constant(undefined),
toString: constant('none()')
var some = function (a) {
var constant_a = constant(a);
var bind = function (f) {
getOrUndefined: constant_a,
return 'some(' + a + ')';
equals_: function (o, elementEq) {
return o.fold(never, function (b) {
var from = function (value) {
return value === null || value === undefined ? NONE : some(value);
var typeOf = function (x) {
if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
var isType$1 = function (type) {
return function (value) {
return typeOf(value) === type;
var isArray$1 = isType$1('array');
var isFunction$1 = isType$1('function');
var isNumber$1 = isType$1('number');
var nativeSlice = Array.prototype.slice;
var nativeIndexOf = Array.prototype.indexOf;
var nativePush = Array.prototype.push;
var rawIndexOf = function (ts, t) {
return nativeIndexOf.call(ts, t);
var indexOf = function (xs, x) {
var r = rawIndexOf(xs, x);
return r === -1 ? Option.none() : Option.some(r);
var exists = function (xs, pred) {
for (var i = 0, len = xs.length; i < len; i++) {
var map = function (xs, f) {
for (var i = 0; i < len; i++) {
var each = function (xs, f) {
for (var i = 0, len = xs.length; i < len; i++) {
var filter = function (xs, pred) {
for (var i = 0, len = xs.length; i < len; i++) {
var foldl = function (xs, f, acc) {
var find = function (xs, pred) {
for (var i = 0, len = xs.length; i < len; i++) {
var flatten$1 = function (xs) {
for (var i = 0, len = xs.length; i < len; ++i) {
throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs);
nativePush.apply(r, xs[i]);
var from$1 = isFunction$1(Array.from) ? Array.from : function (x) {
return nativeSlice.call(x);
return 'mceu_' + count++;
create: function (name, attrs, children) {
var elm = domGlobals.document.createElement(name);
global$2.DOM.setAttribs(elm, attrs);
if (typeof children === 'string') {
elm.innerHTML = children;
global$4.each(children, function (child) {
createFragment: function (html) {
return global$2.DOM.createFragment(html);
getWindowSize: function () {
return global$2.DOM.getViewPort();
getSize: function (elm) {
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);
height = elm.offsetHeight;
getPos: function (elm, root) {
return global$2.DOM.getPos(elm, root || funcs.getContainer());
getContainer: function () {
return global$1.container ? global$1.container : domGlobals.document.body;
getViewPort: function (win) {
return global$2.DOM.getViewPort(win);
return domGlobals.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, value) {
return global$2.DOM.setStyle(elm, name, value);
getRuntimeStyle: function (elm, name) {
return global$2.DOM.getStyle(elm, name, true);
on: function (target, name, callback, scope) {
return global$2.DOM.bind(target, name, callback, scope);
off: function (target, name, callback) {
return global$2.DOM.unbind(target, name, callback);
fire: function (target, name, args) {
return global$2.DOM.fire(target, name, 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');
parseBox: function (value) {
if (typeof value === 'number') {
value = value.split(' ');
value[1] = value[2] = value[3] = value[0];
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;
var computedStyle = defaultView.getComputedStyle(elm, null);
name = name.replace(/[A-Z]/g, function (a) {
return computedStyle.getPropertyValue(name);
return elm.currentStyle[name];
var val = parseFloat(getStyle(name));
return isNaN(val) ? 0 : val;
top: getSide(prefix + 'TopWidth'),
right: getSide(prefix + 'RightWidth'),
bottom: getSide(prefix + 'BottomWidth'),
left: getSide(prefix + 'LeftWidth')
function ClassList(onchange) {
this.onchange = onchange || noop$1;
global$4.extend(ClassList.prototype, {
if (cls && !this.contains(cls)) {
this.cls._map[cls] = true;
if (this.contains(cls)) {
for (i = 0; i < this.cls.length; i++) {
if (this.cls[i] === cls) {
delete this.cls._map[cls];
toggle: function (cls, state) {
var curState = this.contains(cls);
if (curState !== state) {
contains: function (cls) {
return !!this.cls._map[cls];
this.onchange.call(this);
ClassList.prototype.toString = function () {
for (var i = 0; i < this.cls.length; i++) {
value += this.prefix + this.cls[i];
var i = array.length, item;
delete uniqueItems[i].__checked;