if (elm.nodeType === 1) {
if (elm.nodeName === 'BR' || !!elm.getAttribute('data-mce-bogus')) {
if (elm.getAttribute('data-mce-type') === 'bookmark') {
if (editor.settings.elementpath !== false) {
self.on('select', function (e) {
editor.selection.select(this.row()[e.index].element);
editor.on('nodeChange', function (e) {
if (parents[i].nodeType === 1 && !isHidden(parents[i])) {
var args = editor.fire('ResolveName', {
name: parents[i].nodeName.toLowerCase(),
if (!args.isDefaultPrevented()) {
if (args.isPropagationStopped()) {
var FormItem = Container.extend({
renderHtml: function () {
var self = this, layout = self._layout, prefix = self.classPrefix;
self.classes.add('formitem');
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>';
var Form = Container.extend({
var self = this, items = self.items();
if (!self.settings.formItemDefaults) {
self.settings.formItemDefaults = {
items.each(function (ctrl) {
var label = ctrl.settings.label;
formItem = new FormItem(global$4.extend({
disabled: ctrl.disabled()
}, self.settings.formItemDefaults));
formItem.type = 'formitem';
ctrl.aria('labelledby', ctrl._id + '-l');
if (typeof ctrl.settings.flex === 'undefined') {
self.replace(ctrl, formItem);
return this.fire('submit', { data: this.toJSON() });
postRender: function () {
self.fromJSON(self.settings.data);
bindStates: function () {
function recalcLabels() {
if (self.settings.labelGapCalc === false) {
if (self.settings.labelGapCalc === 'children') {
items = self.find('formitem');
items.filter('formitem').each(function (item) {
var labelCtrl = item.items()[0], labelWidth = labelCtrl.getEl().clientWidth;
maxLabelWidth = labelWidth > maxLabelWidth ? labelWidth : maxLabelWidth;
labelGap = self.settings.labelGap || 0;
labels[i].settings.minWidth = maxLabelWidth + labelGap;
self.on('show', recalcLabels);
var FieldSet = Form.extend({
containerCls: 'fieldset',
renderHtml: function () {
var self = this, layout = self._layout, prefix = self.classPrefix;
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>';
var generate = function (prefix) {
var time = date.getTime();
var random = Math.floor(Math.random() * 1000000000);
return prefix + '_' + random + unique$1 + String(time);
var fromHtml = function (html, scope) {
var doc = scope || domGlobals.document;
var div = doc.createElement('div');
if (!div.hasChildNodes() || div.childNodes.length > 1) {
domGlobals.console.error('HTML does not have a single root node', html);
throw new Error('HTML must have a single root node');
return fromDom(div.childNodes[0]);
var fromTag = function (tag, scope) {
var doc = scope || domGlobals.document;
var node = doc.createElement(tag);
var fromText = function (text, scope) {
var doc = scope || domGlobals.document;
var node = doc.createTextNode(text);
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) {
return Option.from(doc.elementFromPoint(x, y)).map(fromDom);
var cached = function (f) {
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
var ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE;
var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE;
var COMMENT = domGlobals.Node.COMMENT_NODE;
var DOCUMENT = domGlobals.Node.DOCUMENT_NODE;
var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE;
var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE;
var ELEMENT = domGlobals.Node.ELEMENT_NODE;
var TEXT = domGlobals.Node.TEXT_NODE;
var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE;
var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE;
var ENTITY = domGlobals.Node.ENTITY_NODE;
var NOTATION = domGlobals.Node.NOTATION_NODE;
var Immutable = function () {
for (var _i = 0; _i < arguments.length; _i++) {
fields[_i] = arguments[_i];
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');
each(fields, function (name, i) {
struct[name] = constant(values[i]);
var f = Global$1.getOrDie('Node');
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);
documentPositionPreceding: documentPositionPreceding,
documentPositionContainedBy: documentPositionContainedBy
var firstMatch = function (regexes, s) {
for (var i = 0; i < regexes.length; i++) {
var find$1 = function (regexes, agent) {
var r = firstMatch(regexes, agent);
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 find$1(versionRegexes, cleanedAgent);
var unknown = function () {
var nu = function (major, minor) {
var isBrowser = function (name, current) {
var unknown$1 = function () {
version: Version.unknown()
var nu$1 = function (info) {
var current = info.current;
var version = info.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)
chrome: constant(chrome),
firefox: constant(firefox),
var windows$1 = 'Windows';
var isOS = function (name, current) {
var unknown$2 = function () {
version: Version.unknown()
var nu$2 = function (info) {
var current = info.current;
var version = info.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)
windows: constant(windows$1),
android: constant(android),
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;
isiPad: constant(isiPad),
isiPhone: constant(isiPhone),
isTablet: constant(isTablet),
isPhone: constant(isPhone),
isTouch: constant(isTouch),
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);
var detectOs = function (oses, userAgent) {
return detect$1(oses, userAgent).map(function (os) {
var version = Version.detect(os.versionRegexes, userAgent);
detectBrowser: detectBrowser,
var contains = function (str, substr) {
return str.indexOf(substr) !== -1;
var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/;
var checkContains = function (target) {
return function (uastring) {
return contains(uastring, target);
versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
search: function (uastring) {
return contains(uastring, 'edge/') && contains(uastring, 'chrome') && contains(uastring, 'safari') && contains(uastring, 'applewebkit');
/.*?chrome\/([0-9]+)\.([0-9]+).*/,
search: function (uastring) {
return contains(uastring, 'chrome') && !contains(uastring, 'chromeframe');
/.*?msie\ ?([0-9]+)\.([0-9]+).*/,
/.*?rv:([0-9]+)\.([0-9]+).*/
search: function (uastring) {
return contains(uastring, 'msie') || contains(uastring, 'trident');