diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 01f8f3dfb..179cdefe2 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,7 +2,12 @@ Changelog ========= -5.0.0 (2022-03-22) +5.0.1 (2022-03-24) +================== + +* Generated new static bundle. + +5.0.0 (2022-03-24) ================== * Drop support for Python 3.5 and 3.6 diff --git a/djangocms_text_ckeditor/__init__.py b/djangocms_text_ckeditor/__init__.py index 60bb2ae23..368b8badd 100644 --- a/djangocms_text_ckeditor/__init__.py +++ b/djangocms_text_ckeditor/__init__.py @@ -3,18 +3,19 @@ Release logic: 1. Increase version number (change __version__ below). - 2. Assure that all changes have been documented in CHANGELOG.rst. - 3. In setup.py check that + 2. Ensure the static bundle is upto date with ``nvm use && gulp bundle`` + 3. Assure that all changes have been documented in CHANGELOG.rst. + 4. In setup.py check that - versions from all third party packages are pinned in ``REQUIREMENTS``. - the list of ``CLASSIFIERS`` is up to date. - 4. git add djangocms_text_ckeditor/__init__.py CHANGELOG.rst setup.py - 5. git commit -m 'Bump to {new version}' - 6. git push - 7. Assure that all tests pass on https://github.com/django-cms/djangocms-text-ckeditor/actions - 8. Create a new release on https://github.com/django-cms/djangocms-text-ckeditor/releases/new - 9. Publish the release when ready -10. Github actions will publish the new package to pypi + 5. git add djangocms_text_ckeditor/__init__.py CHANGELOG.rst setup.py + 6. git commit -m 'Bump to {new version}' + 7. git push + 8. Assure that all tests pass on https://github.com/django-cms/djangocms-text-ckeditor/actions + 9. Create a new release on https://github.com/django-cms/djangocms-text-ckeditor/releases/new +10. Publish the release when ready +11. Github actions will publish the new package to pypi """ -__version__ = '5.0.0' +__version__ = '5.0.1' default_app_config = 'djangocms_text_ckeditor.apps.TextCkeditorConfig' diff --git a/djangocms_text_ckeditor/static/djangocms_text_ckeditor/js/dist/bundle-bb31a8b837.cms.ckeditor.min.js b/djangocms_text_ckeditor/static/djangocms_text_ckeditor/js/dist/bundle-bb31a8b837.cms.ckeditor.min.js deleted file mode 100644 index 565086e4b..000000000 --- a/djangocms_text_ckeditor/static/djangocms_text_ckeditor/js/dist/bundle-bb31a8b837.cms.ckeditor.min.js +++ /dev/null @@ -1,17730 +0,0 @@ -(function ($) { - $(function () { - - !(function (t) { - window.CKEDITOR_BASEPATH = t('[data-ckeditor-basepath]').attr('data-ckeditor-basepath'), CMS.CKEditor = { options: { language: 'en', skin: 'moono-lisa', toolbar_CMS: [['Undo', 'Redo'], ['cmsplugins', 'cmswidget', '-', 'ShowBlocks'], ['Format', 'Styles'], ['TextColor', 'BGColor', '-', 'PasteText', 'PasteFromWord'], ['Scayt'], ['Maximize', ''], '/', ['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'RemoveFormat'], ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], ['HorizontalRule'], ['NumberedList', 'BulletedList'], ['Outdent', 'Indent', '-', 'Blockquote', '-', 'Link', 'Unlink', '-', 'Table'], ['Source']], toolbar_HTMLField: [['Undo', 'Redo'], ['ShowBlocks'], ['Format', 'Styles'], ['TextColor', 'BGColor', '-', 'PasteText', 'PasteFromWord'], ['Scayt'], ['Maximize', ''], '/', ['Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'RemoveFormat'], ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], ['HorizontalRule'], ['Link', 'Unlink'], ['NumberedList', 'BulletedList'], ['Outdent', 'Indent', '-', 'Blockqote', '-', 'Link', 'Unlink', '-', 'Table'], ['Source']], allowedContent: !0, toolbarCanCollapse: !1, removePlugins: 'resize', extraPlugins: '' }, init: function (i, e, o) { - t('#' + i).length > 0 && (this.container = t('#' + i), this.container.data('ckeditor-initialized', !0), this.options.toolbar = o.toolbar, this.options = t.extend(!1, { settings: o }, this.options, e), this.options.extraPlugins = this.options.extraPlugins += ',cmsplugins,cmswidget,cmsdialog,cmsresize,widget', document.createElement('cms-plugin'), CKEDITOR.dtd['cms-plugin'] = CKEDITOR.dtd.div, CKEDITOR.dtd.$inline['cms-plugin'] = 1, CKEDITOR.dtd.$nonEditable['cms-plugin'] = 1, CKEDITOR.dtd.$transparent['cms-plugin'] = 1, CKEDITOR.dtd.body['cms-plugin'] = 1, CKEDITOR.skin.addIcon('cmsplugins', o.static_url + '/ckeditor_plugins/cmsplugins/icons/cmsplugins.svg'), this.editor = CKEDITOR.replace(i, this.options), CKEDITOR.on('instanceReady', t.proxy(CMS.CKEditor, 'setup'))); - }, setup: function () { - var i = this; var e = window.parent || window; - - this._isAloneInModal() && (i.editor.resize('100%', e.CMS.$('.cms-modal-frame').height() - 70), this.editor.execCommand('maximize'), t(window).on('resize.ckeditor', function () { - i._repositionDialog(CKEDITOR.dialog.getCurrent(), e); - }).trigger('resize.ckeditor'), e.CMS.API.Helpers.addEventListener('modal-maximized modal-restored', function () { - try { - t('.cke_maximized').length || (i.editor.resize('100%', e.CMS.$('.cms-modal-frame').height() - 70), setTimeout(function () { - i._repositionDialog(CKEDITOR.dialog.getCurrent(), e); - }, 0)); - } catch (t) {} - })), this.styles(), this._resizing(); - }, styles: function () { - t('.cke_button__maximize, .cke_button__source').parent().css('margin-right', 0).parent().css('float', 'right'); - }, _resizing: function () { - t(document).on('pointerdown', '.cms-ckeditor-resizer', function (i) { - i.preventDefault(); var e = new CMS.$.Event('mousedown'); - - t.extend(e, { screenX: i.originalEvent.screenX, screenY: i.originalEvent.screenY }), t(this).trigger(e); - }); - }, _isAloneInModal: function () { - var t = this.container.closest('body'); - - return t.is('.app-djangocms_text_ckeditor.model-text') || t.is('.djangocms_text_ckeditor-text'); - }, _repositionDialog: function (t) { - if (t) { - var i = t.getSize(); var e = t.getPosition(); var o = CKEDITOR.document.getWindow(); var n = o.getViewPaneSize(); var s = n.width; var r = n.height; - - e.x < 0 && (t.move(0, e.y), e.x = 0), e.y < 0 && (t.move(e.x, 0), e.y = 0), e.y + i.height > r && t.resize(i.width, r - e.y - 80), e.x + i.width > s && t.resize(s - e.x, i.height); - } - }, _initAll: function () { - var i = []; - - window._cmsCKEditors.forEach(function (t) { - t[0].match(/__prefix__/) ? i.push(t) : CMS.CKEditor.init(t[0], t[1], t[2]); - }), t('.add-row a').on('click', function () { - t('.CMS_CKEditor').each(function (e, o) { - var n = t(o); - - if (!n.data('ckeditor-initialized')) { - var s = n.attr('id'); - - i.forEach(function (t) { - var i = t[0]; var e = new RegExp(i.replace('__prefix__', '\\d+')); - - s.match(e) && CMS.CKEditor.init(s, t[1], t[2]); - }); - } - }); - }); - } }, setTimeout(function () { - CMS.CKEditor._initAll(); - }, 0); - })(CMS.$); - /* -Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. -For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license -*/ - (function () { - if (window.CKEDITOR && window.CKEDITOR.dom) { - return; - } window.CKEDITOR || (window.CKEDITOR = (function () { - var a = /(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i; var d = { timestamp: 'K5H9', version: '4.14.1', revision: 'eb2d11644', rnd: Math.floor(900 * Math.random()) + 100, _: { pending: [], basePathSrcPattern: a }, status: 'unloaded', basePath: (function () { - var b = window.CKEDITOR_BASEPATH || ''; - - if (!b) { - for (var c = document.getElementsByTagName('script'), d = 0; d < c.length; d++) { - var g = c[d].src.match(a); - - if (g) { - b = g[1]; break; - } - } - }b.indexOf(':/') == -1 && b.slice(0, 2) != '//' && (b = b.indexOf('/') === 0 ? location.href.match(/^.*?:\/\/[^\/]*/)[0] + -b : location.href.match(/^[^\?]*\/(?:)/)[0] + b); if (!b) { - throw 'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.'; - } return b; - })(), getUrl: function (a) { - a.indexOf(':/') == -1 && a.indexOf('/') !== 0 && (a = this.basePath + a); this.timestamp && a.charAt(a.length - 1) != '/' && !(/[&?]t=/).test(a) && (a += (a.indexOf('?') >= 0 ? '\x26' : '?') + 't\x3d' + this.timestamp); return a; - }, domReady: (function () { - function a() { - try { - document.addEventListener ? (document.removeEventListener('DOMContentLoaded', - a, !1), b()) : document.attachEvent && document.readyState === 'complete' && (document.detachEvent('onreadystatechange', a), b()); - } catch (c) {} - } function b() { - for (var a; a = c.shift();) { - a(); - } - } var c = []; - - return function (b) { - function d() { - try { - document.documentElement.doScroll('left'); - } catch (b) { - setTimeout(d, 1); return; - }a(); - }c.push(b); document.readyState === 'complete' && setTimeout(a, 1); if (c.length == 1) { - if (document.addEventListener) { - document.addEventListener('DOMContentLoaded', a, !1), window.addEventListener('load', a, !1); - } else if (document.attachEvent) { - document.attachEvent('onreadystatechange', - a); window.attachEvent('onload', a); b = !1; try { - b = !window.frameElement; - } catch (h) {}document.documentElement.doScroll && b && d(); - } - } - }; - })() }; var b = window.CKEDITOR_GETURL; - - if (b) { - var c = d.getUrl; - - d.getUrl = function (a) { - return b.call(d, a) || c.call(d, a); - }; - } return d; - })()); - CKEDITOR.event || (CKEDITOR.event = function () {}, CKEDITOR.event.implementOn = function (a) { - var d = CKEDITOR.event.prototype; var b; - - for (b in d) { - a[b] == null && (a[b] = d[b]); - } - }, CKEDITOR.event.prototype = (function () { - function a(a) { - var f = d(this); - - return f[a] || (f[a] = new b(a)); - } var d = function (a) { - a = a.getPrivate && a.getPrivate() || a._ || (a._ = {}); return a.events || (a.events = {}); - }; var b = function (a) { - this.name = a; this.listeners = []; - }; - - b.prototype = { getListenerIndex: function (a) { - for (var b = 0, d = this.listeners; b < d.length; b++) { - if (d[b].fn == a) { - return b; - } - } return -1; - } }; - return { define: function (b, d) { - var h = a.call(this, b); - - CKEDITOR.tools.extend(h, d, !0); - }, on: function (b, d, h, k, g) { - function l(a, x, w, e) { - a = { name: b, sender: this, editor: a, data: x, listenerData: k, stop: w, cancel: e, removeListener: u }; return !1 === d.call(h, a) ? !1 : a.data; - } function u() { - x.removeListener(b, d); - } var e = a.call(this, b); - - if (e.getListenerIndex(d) < 0) { - e = e.listeners; h || (h = this); isNaN(g) && (g = 10); var x = this; - - l.fn = d; l.priority = g; for (var w = e.length - 1; w >= 0; w--) { - if (e[w].priority <= g) { - return e.splice(w + 1, 0, l), { removeListener: u }; - } - } e.unshift(l); - } return { removeListener: u }; - }, - once: function () { - var a = Array.prototype.slice.call(arguments); var b = a[1]; - - a[1] = function (a) { - a.removeListener(); return b.apply(this, arguments); - }; return this.on.apply(this, a); - }, capture: function () { - CKEDITOR.event.useCapture = 1; var a = this.on.apply(this, arguments); - - CKEDITOR.event.useCapture = 0; return a; - }, fire: (function () { - var a = 0; var b = function () { - a = 1; - }; var h = 0; var k = function () { - h = 1; - }; - - return function (g, l, u) { - var e = d(this)[g]; - - g = a; var x = h; - - a = h = 0; if (e) { - var w = e.listeners; - - if (w.length) { - for (var w = w.slice(0), z, G = 0; G < w.length; G++) { - if (e.errorProof) { - try { - z = -w[G].call(this, u, l, b, k); - } catch (t) {} - } else { - z = w[G].call(this, u, l, b, k); - }!1 === z ? h = 1 : typeof z !== 'undefined' && (l = z); if (a || h) { - break; - } - } - } - }l = h ? !1 : typeof l === 'undefined' ? !0 : l; a = g; h = x; return l; - }; - })(), fireOnce: function (a, b, h) { - b = this.fire(a, b, h); delete d(this)[a]; return b; - }, removeListener: function (a, b) { - var h = d(this)[a]; - - if (h) { - var k = h.getListenerIndex(b); - - k >= 0 && h.listeners.splice(k, 1); - } - }, removeAllListeners: function () { - var a = d(this); var b; - - for (b in a) { - delete a[b]; - } - }, hasListeners: function (a) { - return (a = d(this)[a]) && a.listeners.length > 0; - } }; - })()); - CKEDITOR.editor || (CKEDITOR.editor = function () { - CKEDITOR._.pending.push([this, arguments]); CKEDITOR.event.call(this); - }, CKEDITOR.editor.prototype.fire = function (a, d) { - a in { instanceReady: 1, loaded: 1 } && (this[a] = !0); return CKEDITOR.event.prototype.fire.call(this, a, d, this); - }, CKEDITOR.editor.prototype.fireOnce = function (a, d) { - a in { instanceReady: 1, loaded: 1 } && (this[a] = !0); return CKEDITOR.event.prototype.fireOnce.call(this, a, d, this); - }, CKEDITOR.event.implementOn(CKEDITOR.editor.prototype)); - CKEDITOR.env || (CKEDITOR.env = (function () { - var a = navigator.userAgent.toLowerCase(); var d = a.match(/edge[ \/](\d+.?\d*)/); var b = a.indexOf('trident/') > -1; var b = !(!d && !b); var b = { ie: b, edge: !!d, webkit: !b && a.indexOf(' applewebkit/') > -1, air: a.indexOf(' adobeair/') > -1, mac: a.indexOf('macintosh') > -1, quirks: document.compatMode == 'BackCompat' && (!document.documentMode || document.documentMode < 10), mobile: a.indexOf('mobile') > -1, iOS: (/(ipad|iphone|ipod)/).test(a), isCustomDomain: function () { - if (!this.ie) { - return !1; - } var a = document.domain; var b = window.location.hostname; - - return a != b && a != '[' + b + ']'; - }, secure: location.protocol == 'https:' }; - - b.gecko = navigator.product == 'Gecko' && !b.webkit && !b.ie; b.webkit && (a.indexOf('chrome') > -1 ? b.chrome = !0 : b.safari = !0); var c = 0; - - b.ie && (c = d ? parseFloat(d[1]) : b.quirks || !document.documentMode ? parseFloat(a.match(/msie (\d+)/)[1]) : document.documentMode, b.ie9Compat = c == 9, b.ie8Compat = c == 8, b.ie7Compat = c == 7, b.ie6Compat = c < 7 || b.quirks); b.gecko && (d = a.match(/rv:([\d\.]+)/)) && (d = d[1].split('.'), c = 1E4 * d[0] + 100 * (d[1] || 0) + 1 * (d[2] || 0)); b.air && (c = parseFloat(a.match(/ adobeair\/(\d+)/)[1])); - b.webkit && (c = parseFloat(a.match(/ applewebkit\/(\d+)/)[1])); b.version = c; b.isCompatible = !(b.ie && c < 7) && !(b.gecko && c < 4E4) && !(b.webkit && c < 534); b.hidpi = window.devicePixelRatio >= 2; b.needsBrFiller = b.gecko || b.webkit || b.ie && c > 10; b.needsNbspFiller = b.ie && c < 11; b.cssClass = 'cke_browser_' + (b.ie ? 'ie' : b.gecko ? 'gecko' : b.webkit ? 'webkit' : 'unknown'); b.quirks && (b.cssClass += ' cke_browser_quirks'); b.ie && (b.cssClass += ' cke_browser_ie' + (b.quirks ? '6 cke_browser_iequirks' : b.version)); b.air && (b.cssClass += ' cke_browser_air'); - b.iOS && (b.cssClass += ' cke_browser_ios'); b.hidpi && (b.cssClass += ' cke_hidpi'); return b; - })()); - CKEDITOR.status == 'unloaded' && (function () { - CKEDITOR.event.implementOn(CKEDITOR); CKEDITOR.loadFullCore = function () { - if (CKEDITOR.status != 'basic_ready') { - CKEDITOR.loadFullCore._load = 1; - } else { - delete CKEDITOR.loadFullCore; var a = document.createElement('script'); - - a.type = 'text/javascript'; a.src = CKEDITOR.basePath + 'ckeditor.js'; document.getElementsByTagName('head')[0].appendChild(a); - } - }; CKEDITOR.loadFullCoreTimeout = 0; CKEDITOR.add = function (a) { - (this._.pending || (this._.pending = [])).push(a); - }; (function () { - CKEDITOR.domReady(function () { - var a = -CKEDITOR.loadFullCore; var d = CKEDITOR.loadFullCoreTimeout; - - a && (CKEDITOR.status = 'basic_ready', a && a._load ? a() : d && setTimeout(function () { - CKEDITOR.loadFullCore && CKEDITOR.loadFullCore(); - }, 1E3 * d)); - }); - })(); CKEDITOR.status = 'basic_loaded'; - })(); 'use strict'; CKEDITOR.VERBOSITY_WARN = 1; CKEDITOR.VERBOSITY_ERROR = 2; CKEDITOR.verbosity = CKEDITOR.VERBOSITY_WARN | CKEDITOR.VERBOSITY_ERROR; CKEDITOR.warn = function (a, d) { - CKEDITOR.verbosity & CKEDITOR.VERBOSITY_WARN && CKEDITOR.fire('log', { type: 'warn', errorCode: a, additionalData: d }); - }; - CKEDITOR.error = function (a, d) { - CKEDITOR.verbosity & CKEDITOR.VERBOSITY_ERROR && CKEDITOR.fire('log', { type: 'error', errorCode: a, additionalData: d }); - }; - CKEDITOR.on('log', function (a) { - if (window.console && window.console.log) { - var d = console[a.data.type] ? a.data.type : 'log'; var b = a.data.errorCode; - - if (a = a.data.additionalData) { - console[d]('[CKEDITOR] Error code: ' + b + '.', a); - } else { - console[d]('[CKEDITOR] Error code: ' + b + '.'); - }console[d]('[CKEDITOR] For more information about this error go to https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#' + b); - } - }, null, null, 999); CKEDITOR.dom = {}; - (function () { - function a(a, b, e) { - this._minInterval = a; this._context = e; this._lastOutput = this._scheduledTimer = 0; this._output = CKEDITOR.tools.bind(b, e || {}); var c = this; - - this.input = function () { - function a() { - c._lastOutput = new Date().getTime(); c._scheduledTimer = 0; c._call(); - } if (!c._scheduledTimer || !1 !== c._reschedule()) { - var x = new Date().getTime() - c._lastOutput; - - x < c._minInterval ? c._scheduledTimer = setTimeout(a, c._minInterval - x) : a(); - } - }; - } function d(x, b, e) { - a.call(this, x, b, e); this._args = []; var c = this; - - this.input = CKEDITOR.tools.override(this.input, - function (a) { - return function () { - c._args = Array.prototype.slice.call(arguments); a.call(this); - }; - }); - } var b = []; var c = CKEDITOR.env.gecko ? '-moz-' : CKEDITOR.env.webkit ? '-webkit-' : CKEDITOR.env.ie ? '-ms-' : ''; var f = /&/g; var h = />/g; var k = /|\s) /g, function (a, b) { - return b + '\x26nbsp;'; - }).replace(/ (?=<)/g, '\x26nbsp;'); - }, getNextNumber: (function () { - var a = 0; - - return function () { - return ++a; - }; - })(), getNextId: function () { - return 'cke_' + this.getNextNumber(); - }, getUniqueId: function () { - for (var a = 'e', b = 0; b < 8; b++) { - a += Math.floor(65536 * (1 + Math.random())).toString(16).substring(1); - } return a; - }, override: function (a, - b) { - var e = b(a); - - e.prototype = a.prototype; return e; - }, setTimeout: function (a, b, e, c, g) { - g || (g = window); e || (e = g); return g.setTimeout(function () { - c ? a.apply(e, [].concat(c)) : a.apply(e); - }, b || 0); - }, throttle: function (a, b, e) { - return new this.buffers.throttle(a, b, e); - }, trim: (function () { - var a = /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g; - - return function (b) { - return b.replace(a, ''); - }; - })(), ltrim: (function () { - var a = /^[ \t\n\r]+/g; - - return function (b) { - return b.replace(a, ''); - }; - })(), rtrim: (function () { - var a = /[ \t\n\r]+$/g; - - return function (b) { - return b.replace(a, - ''); - }; - })(), indexOf: function (a, b) { - if (typeof b === 'function') { - for (var e = 0, c = a.length; e < c; e++) { - if (b(a[e])) { - return e; - } - } - } else { - if (a.indexOf) { - return a.indexOf(b); - } e = 0; for (c = a.length; e < c; e++) { - if (a[e] === b) { - return e; - } - } - } return -1; - }, search: function (a, b) { - var e = CKEDITOR.tools.indexOf(a, b); - - return e >= 0 ? a[e] : null; - }, bind: function (a, b) { - var e = Array.prototype.slice.call(arguments, 2); - - return function () { - return a.apply(b, e.concat(Array.prototype.slice.call(arguments))); - }; - }, createClass: function (a) { - var b = a.$; var e = a.base; var c = a.privates || a._; var g = a.proto; - - a = a.statics; !b && (b = function () { - e && this.base.apply(this, arguments); - }); if (c) { - var n = b; var b = function () { - var a = this._ || (this._ = {}); var b; - - for (b in c) { - var e = c[b]; - - a[b] = typeof e === 'function' ? CKEDITOR.tools.bind(e, this) : e; - }n.apply(this, arguments); - }; - } - - e && (b.prototype = this.prototypedCopy(e.prototype), b.prototype.constructor = b, b.base = e, b.baseProto = e.prototype, b.prototype.base = function y() { - this.base = e.prototype.base; e.apply(this, arguments); this.base = y; - }); g && this.extend(b.prototype, g, !0); a && this.extend(b, a, !0); return b; - }, addFunction: function (a, - e) { - return b.push(function () { - return a.apply(e || this, arguments); - }) - 1; - }, removeFunction: function (a) { - b[a] = null; - }, callFunction: function (a) { - var e = b[a]; - - return e && e.apply(window, Array.prototype.slice.call(arguments, 1)); - }, cssLength: (function () { - var a = /^-?\d+\.?\d*px$/; var b; - - return function (e) { - b = CKEDITOR.tools.trim(e + '') + 'px'; return a.test(b) ? b : e || ''; - }; - })(), convertToPx: (function () { - var a; - - return function (b) { - a || (a = CKEDITOR.dom.element.createFromHtml('\x3cdiv style\x3d"position:absolute;left:-9999px;top:-9999px;margin:0px;padding:0px;border:0px;"\x3e\x3c/div\x3e', - CKEDITOR.document), CKEDITOR.document.getBody().append(a)); if (!(/%$/).test(b)) { - var e = parseFloat(b) < 0; - - e && (b = b.replace('-', '')); a.setStyle('width', b); b = a.$.clientWidth; return e ? -b : b; - } return b; - }; - })(), repeat: function (a, b) { - return Array(b + 1).join(a); - }, tryThese: function () { - for (var a, b = 0, e = arguments.length; b < e; b++) { - var c = arguments[b]; - - try { - a = c(); break; - } catch (g) {} - } return a; - }, genKey: function () { - return Array.prototype.slice.call(arguments).join('-'); - }, defer: function (a) { - return function () { - var b = arguments; var e = this; - - window.setTimeout(function () { - a.apply(e, - b); - }, 0); - }; - }, normalizeCssText: function (a, b) { - var e = []; var c; var g = CKEDITOR.tools.parseCssText(a, !0, b); - - for (c in g) { - e.push(c + ':' + g[c]); - }e.sort(); return e.length ? e.join(';') + ';' : ''; - }, convertRgbToHex: function (a) { - return a.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi, function (a, b, e, c) { - a = [b, e, c]; for (b = 0; b < 3; b++) { - a[b] = ('0' + parseInt(a[b], 10).toString(16)).slice(-2); - } return '#' + a.join(''); - }); - }, normalizeHex: function (a) { - return a.replace(/#(([0-9a-f]{3}){1,2})($|;|\s+)/gi, function (a, b, e, c) { - a = b.toLowerCase(); a.length == 3 && -(a = a.split(''), a = [a[0], a[0], a[1], a[1], a[2], a[2]].join('')); return '#' + a + c; - }); - }, parseCssText: function (a, b, e) { - var c = {}; - - e && (a = new CKEDITOR.dom.element('span').setAttribute('style', a).getAttribute('style') || ''); a && (a = CKEDITOR.tools.normalizeHex(CKEDITOR.tools.convertRgbToHex(a))); if (!a || a == ';') { - return c; - } a.replace(/"/g, '"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function (a, e, x) { - b && (e = e.toLowerCase(), e == 'font-family' && (x = x.replace(/\s*,\s*/g, ',')), x = CKEDITOR.tools.trim(x)); c[e] = x; - }); return c; - }, - writeCssText: function (a, b) { - var e; var c = []; - - for (e in a) { - c.push(e + ':' + a[e]); - }b && c.sort(); return c.join('; '); - }, objectCompare: function (a, b, e) { - var c; - - if (!a && !b) { - return !0; - } if (!a || !b) { - return !1; - } for (c in a) { - if (a[c] != b[c]) { - return !1; - } - } if (!e) { - for (c in b) { - if (a[c] != b[c]) { - return !1; - } - } - } return !0; - }, objectKeys: function (a) { - return CKEDITOR.tools.object.keys(a); - }, convertArrayToObject: function (a, b) { - var e = {}; - - arguments.length == 1 && (b = !0); for (var c = 0, g = a.length; c < g; ++c) { - e[a[c]] = b; - } return e; - }, fixDomain: function () { - for (var a; ;) { - try { - a = window.parent.document.domain; - break; - } catch (b) { - a = a ? a.replace(/.+?(?:\.|$)/, '') : document.domain; if (!a) { - break; - } document.domain = a; - } - } return !!a; - }, eventsBuffer: function (a, b, e) { - return new this.buffers.event(a, b, e); - }, enableHtml5Elements: function (a, b) { - for (var e = 'abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video'.split(' '), c = e.length, g; c--;) { - g = a.createElement(e[c]), b && a.appendChild(g); - } - }, checkIfAnyArrayItemMatches: function (a, b) { - for (var e = -0, c = a.length; e < c; ++e) { - if (a[e].match(b)) { - return !0; - } - } return !1; - }, checkIfAnyObjectPropertyMatches: function (a, b) { - for (var e in a) { - if (e.match(b)) { - return !0; - } - } return !1; - }, keystrokeToString: function (a, b) { - var e = this.keystrokeToArray(a, b); - - e.display = e.display.join('+'); e.aria = e.aria.join('+'); return e; - }, keystrokeToArray: function (a, b) { - var e = b & 16711680; var c = b & 65535; var g = CKEDITOR.env.mac; var n = []; var d = []; - - e & CKEDITOR.CTRL && (n.push(g ? '⌘' : a[17]), d.push(g ? a[224] : a[17])); e & CKEDITOR.ALT && (n.push(g ? '⌥' : a[18]), d.push(a[18])); e & CKEDITOR.SHIFT && (n.push(g ? - '⇧' : a[16]), d.push(a[16])); c && (a[c] ? (n.push(a[c]), d.push(a[c])) : (n.push(String.fromCharCode(c)), d.push(String.fromCharCode(c)))); return { display: n, aria: d }; - }, transparentImageData: 'data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw\x3d\x3d', getCookie: function (a) { - a = a.toLowerCase(); for (var b = document.cookie.split(';'), e, c, g = 0; g < b.length; g++) { - if (e = b[g].split('\x3d'), c = decodeURIComponent(CKEDITOR.tools.trim(e[0]).toLowerCase()), c === a) { - return decodeURIComponent(e.length > 1 ? e[1] : ''); - } - } - return null; - }, setCookie: function (a, b) { - document.cookie = encodeURIComponent(a) + '\x3d' + encodeURIComponent(b) + ';path\x3d/'; - }, getCsrfToken: function () { - var a = CKEDITOR.tools.getCookie('ckCsrfToken'); - - if (!a || a.length != 40) { - var a = []; var b = ''; - - if (window.crypto && window.crypto.getRandomValues) { - a = new Uint8Array(40), window.crypto.getRandomValues(a); - } else { - for (var e = 0; e < 40; e++) { - a.push(Math.floor(256 * Math.random())); - } - } for (e = 0; e < a.length; e++) { - var c = 'abcdefghijklmnopqrstuvwxyz0123456789'.charAt(a[e] % 36); var b = b + (Math.random() > 0.5 ? c.toUpperCase() : - c); - } a = b; CKEDITOR.tools.setCookie('ckCsrfToken', a); - } return a; - }, escapeCss: function (a) { - return a ? window.CSS && CSS.escape ? CSS.escape(a) : isNaN(parseInt(a.charAt(0), 10)) ? a : '\\3' + a.charAt(0) + ' ' + a.substring(1, a.length) : ''; - }, getMouseButton: function (a) { - return (a = a && a.data ? a.data.$ : a) ? CKEDITOR.tools.normalizeMouseButton(a.button) : !1; - }, normalizeMouseButton: function (a, b) { - if (!CKEDITOR.env.ie || CKEDITOR.env.version >= 9 && !CKEDITOR.env.ie6Compat) { - return a; - } for (var e = [[CKEDITOR.MOUSE_BUTTON_LEFT, 1], [CKEDITOR.MOUSE_BUTTON_MIDDLE, - 4], [CKEDITOR.MOUSE_BUTTON_RIGHT, 2]], c = 0; c < e.length; c++) { - var g = e[c]; - - if (g[0] === a && b) { - return g[1]; - } if (!b && g[1] === a) { - return g[0]; - } - } - }, convertHexStringToBytes: function (a) { - var b = []; var e = a.length / 2; var c; - - for (c = 0; c < e; c++) { - b.push(parseInt(a.substr(2 * c, 2), 16)); - } return b; - }, convertBytesToBase64: function (a) { - var b = ''; var e = a.length; var c; - - for (c = 0; c < e; c += 3) { - var g = a.slice(c, c + 3); var n = g.length; var d = []; var l; - - if (n < 3) { - for (l = n; l < 3; l++) { - g[l] = 0; - } - }d[0] = (g[0] & 252) >> 2; d[1] = (g[0] & 3) << 4 | g[1] >> 4; d[2] = (g[1] & 15) << 2 | (g[2] & 192) >> 6; d[3] = g[2] & 63; for (l = 0; l < 4; l++) { - b = l <= n ? - b + 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.charAt(d[l]) : b + '\x3d'; - } - } return b; - }, style: { parse: { _colors: { aliceblue: '#F0F8FF', antiquewhite: '#FAEBD7', aqua: '#00FFFF', aquamarine: '#7FFFD4', azure: '#F0FFFF', beige: '#F5F5DC', bisque: '#FFE4C4', black: '#000000', blanchedalmond: '#FFEBCD', blue: '#0000FF', blueviolet: '#8A2BE2', brown: '#A52A2A', burlywood: '#DEB887', cadetblue: '#5F9EA0', chartreuse: '#7FFF00', chocolate: '#D2691E', coral: '#FF7F50', cornflowerblue: '#6495ED', cornsilk: '#FFF8DC', crimson: '#DC143C', - cyan: '#00FFFF', darkblue: '#00008B', darkcyan: '#008B8B', darkgoldenrod: '#B8860B', darkgray: '#A9A9A9', darkgreen: '#006400', darkgrey: '#A9A9A9', darkkhaki: '#BDB76B', darkmagenta: '#8B008B', darkolivegreen: '#556B2F', darkorange: '#FF8C00', darkorchid: '#9932CC', darkred: '#8B0000', darksalmon: '#E9967A', darkseagreen: '#8FBC8F', darkslateblue: '#483D8B', darkslategray: '#2F4F4F', darkslategrey: '#2F4F4F', darkturquoise: '#00CED1', darkviolet: '#9400D3', deeppink: '#FF1493', deepskyblue: '#00BFFF', dimgray: '#696969', dimgrey: '#696969', dodgerblue: '#1E90FF', - firebrick: '#B22222', floralwhite: '#FFFAF0', forestgreen: '#228B22', fuchsia: '#FF00FF', gainsboro: '#DCDCDC', ghostwhite: '#F8F8FF', gold: '#FFD700', goldenrod: '#DAA520', gray: '#808080', green: '#008000', greenyellow: '#ADFF2F', grey: '#808080', honeydew: '#F0FFF0', hotpink: '#FF69B4', indianred: '#CD5C5C', indigo: '#4B0082', ivory: '#FFFFF0', khaki: '#F0E68C', lavender: '#E6E6FA', lavenderblush: '#FFF0F5', lawngreen: '#7CFC00', lemonchiffon: '#FFFACD', lightblue: '#ADD8E6', lightcoral: '#F08080', lightcyan: '#E0FFFF', lightgoldenrodyellow: '#FAFAD2', - lightgray: '#D3D3D3', lightgreen: '#90EE90', lightgrey: '#D3D3D3', lightpink: '#FFB6C1', lightsalmon: '#FFA07A', lightseagreen: '#20B2AA', lightskyblue: '#87CEFA', lightslategray: '#778899', lightslategrey: '#778899', lightsteelblue: '#B0C4DE', lightyellow: '#FFFFE0', lime: '#00FF00', limegreen: '#32CD32', linen: '#FAF0E6', magenta: '#FF00FF', maroon: '#800000', mediumaquamarine: '#66CDAA', mediumblue: '#0000CD', mediumorchid: '#BA55D3', mediumpurple: '#9370DB', mediumseagreen: '#3CB371', mediumslateblue: '#7B68EE', mediumspringgreen: '#00FA9A', - mediumturquoise: '#48D1CC', mediumvioletred: '#C71585', midnightblue: '#191970', mintcream: '#F5FFFA', mistyrose: '#FFE4E1', moccasin: '#FFE4B5', navajowhite: '#FFDEAD', navy: '#000080', oldlace: '#FDF5E6', olive: '#808000', olivedrab: '#6B8E23', orange: '#FFA500', orangered: '#FF4500', orchid: '#DA70D6', palegoldenrod: '#EEE8AA', palegreen: '#98FB98', paleturquoise: '#AFEEEE', palevioletred: '#DB7093', papayawhip: '#FFEFD5', peachpuff: '#FFDAB9', peru: '#CD853F', pink: '#FFC0CB', plum: '#DDA0DD', powderblue: '#B0E0E6', purple: '#800080', rebeccapurple: '#663399', - red: '#FF0000', rosybrown: '#BC8F8F', royalblue: '#4169E1', saddlebrown: '#8B4513', salmon: '#FA8072', sandybrown: '#F4A460', seagreen: '#2E8B57', seashell: '#FFF5EE', sienna: '#A0522D', silver: '#C0C0C0', skyblue: '#87CEEB', slateblue: '#6A5ACD', slategray: '#708090', slategrey: '#708090', snow: '#FFFAFA', springgreen: '#00FF7F', steelblue: '#4682B4', tan: '#D2B48C', teal: '#008080', thistle: '#D8BFD8', tomato: '#FF6347', turquoise: '#40E0D0', violet: '#EE82EE', windowtext: 'windowtext', wheat: '#F5DEB3', white: '#FFFFFF', whitesmoke: '#F5F5F5', yellow: '#FFFF00', - yellowgreen: '#9ACD32' }, _borderStyle: 'none hidden dotted dashed solid double groove ridge inset outset'.split(' '), _widthRegExp: /^(thin|medium|thick|[\+-]?\d+(\.\d+)?[a-z%]+|[\+-]?0+(\.0+)?|\.\d+[a-z%]+)$/, _rgbaRegExp: /rgba?\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*(?:,\s*[0-9.]+\s*)?\)/gi, _hslaRegExp: /hsla?\(\s*[0-9.]+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi, background: function (a) { - var b = {}; var e = this._findColor(a); - - e.length && (b.color = e[0], CKEDITOR.tools.array.forEach(e, function (b) { - a = a.replace(b, ''); - })); - if (a = CKEDITOR.tools.trim(a)) { - b.unprocessed = a; - } return b; - }, margin: function (a) { - return CKEDITOR.tools.style.parse.sideShorthand(a, function (a) { - return a.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset|revert)/g) || ['0px']; - }); - }, sideShorthand: function (a, b) { - function e(a) { - c.top = g[a[0]]; c.right = g[a[1]]; c.bottom = g[a[2]]; c.left = g[a[3]]; - } var c = {}; var g = b ? b(a) : a.split(/\s+/); - - switch (g.length) { - case 1:e([0, 0, 0, 0]); break; case 2:e([0, 1, 0, 1]); break; case 3:e([0, 1, 2, 1]); break; case 4:e([0, 1, 2, 3]); - } return c; - }, border: function (a) { - return CKEDITOR.tools.style.border.fromCssRule(a); - }, - _findColor: function (a) { - var b = []; var e = CKEDITOR.tools.array; var b = b.concat(a.match(this._rgbaRegExp) || []); var b = b.concat(a.match(this._hslaRegExp) || []); - - return b = b.concat(e.filter(a.split(/\s+/), function (a) { - return a.match(/^\#[a-f0-9]{3}(?:[a-f0-9]{3})?$/gi) ? !0 : a.toLowerCase() in CKEDITOR.tools.style.parse._colors; - })); - } } }, array: { filter: function (a, b, e) { - var c = []; - - this.forEach(a, function (g, n) { - b.call(e, g, n, a) && c.push(g); - }); return c; - }, find: function (a, b, e) { - for (var c = a.length, g = 0; g < c;) { - if (b.call(e, a[g], g, a)) { - return a[g]; - } g++; - } - }, - forEach: function (a, b, e) { - var c = a.length; var g; - - for (g = 0; g < c; g++) { - b.call(e, a[g], g, a); - } - }, map: function (a, b, e) { - for (var c = [], g = 0; g < a.length; g++) { - c.push(b.call(e, a[g], g, a)); - } return c; - }, reduce: function (a, b, e, c) { - for (var g = 0; g < a.length; g++) { - e = b.call(c, e, a[g], g, a); - } return e; - }, every: function (a, b, e) { - if (!a.length) { - return !0; - } b = this.filter(a, b, e); return a.length === b.length; - }, some: function (a, b, e) { - for (var c = 0; c < a.length; c++) { - if (b.call(e, a[c], c, a)) { - return !0; - } - } return !1; - } }, object: { DONT_ENUMS: 'toString toLocaleString valueOf hasOwnProperty isPrototypeOf propertyIsEnumerable constructor'.split(' '), - entries: function (a) { - return CKEDITOR.tools.array.map(CKEDITOR.tools.object.keys(a), function (b) { - return [b, a[b]]; - }); - }, values: function (a) { - return CKEDITOR.tools.array.map(CKEDITOR.tools.object.keys(a), function (b) { - return a[b]; - }); - }, keys: function (a) { - var b = Object.prototype.hasOwnProperty; var e = []; var c = CKEDITOR.tools.object.DONT_ENUMS; - - if (CKEDITOR.env.ie && CKEDITOR.env.version < 9 && (!a || typeof a !== 'object')) { - b = []; if (typeof a === 'string') { - for (e = 0; e < a.length; e++) { - b.push(String(e)); - } - } return b; - } for (var g in a) { - e.push(g); - } if (CKEDITOR.env.ie && -CKEDITOR.env.version < 9) { - for (g = 0; g < c.length; g++) { - b.call(a, c[g]) && e.push(c[g]); - } - } return e; - }, findKey: function (a, b) { - if (typeof a !== 'object') { - return null; - } for (var e in a) { - if (a[e] === b) { - return e; - } - } return null; - }, merge: function (a, b) { - var e = CKEDITOR.tools; var c = e.clone(a); var g = e.clone(b); - - e.array.forEach(e.object.keys(g), function (a) { - c[a] = typeof g[a] === 'object' && typeof c[a] === 'object' ? e.object.merge(c[a], g[a]) : g[a]; - }); return c; - } }, getAbsoluteRectPosition: function (a, b) { - function e(a) { - if (a) { - var b = a.getClientRect(); - - c.top += b.top; c.left += -b.left; 'x' in c && 'y' in c && (c.x += b.x, c.y += b.y); e(a.getWindow().getFrame()); - } - } var c = CKEDITOR.tools.copy(b); - - e(a.getFrame()); var g = CKEDITOR.document.getWindow().getScrollPosition(); - - c.top += g.y; c.left += g.x; 'x' in c && 'y' in c && (c.y += g.y, c.x += g.x); c.right = c.left + c.width; c.bottom = c.top + c.height; return c; - } }; a.prototype = { reset: function () { - this._lastOutput = 0; this._clearTimer(); - }, _reschedule: function () { - return !1; - }, _call: function () { - this._output(); - }, _clearTimer: function () { - this._scheduledTimer && clearTimeout(this._scheduledTimer); - this._scheduledTimer = 0; - } }; d.prototype = CKEDITOR.tools.prototypedCopy(a.prototype); d.prototype._reschedule = function () { - this._scheduledTimer && this._clearTimer(); - }; d.prototype._call = function () { - this._output.apply(this._context, this._args); - }; CKEDITOR.tools.buffers = {}; CKEDITOR.tools.buffers.event = a; CKEDITOR.tools.buffers.throttle = d; CKEDITOR.tools.style.border = CKEDITOR.tools.createClass({ $: function (a) { - a = a || {}; this.width = a.width; this.style = a.style; this.color = a.color; this._.normalize(); - }, _: { normalizeMap: { color: [[/windowtext/g, - 'black']] }, normalize: function () { - for (var a in this._.normalizeMap) { - var b = this[a]; - - b && (this[a] = CKEDITOR.tools.array.reduce(this._.normalizeMap[a], function (a, b) { - return a.replace(b[0], b[1]); - }, b)); - } - } }, proto: { toString: function () { - return CKEDITOR.tools.array.filter([this.width, this.style, this.color], function (a) { - return !!a; - }).join(' '); - } }, statics: { fromCssRule: function (a) { - var b = {}; var e = a.split(/\s+/g); - - a = CKEDITOR.tools.style.parse._findColor(a); a.length && (b.color = a[0]); CKEDITOR.tools.array.forEach(e, function (a) { - b.style || -CKEDITOR.tools.indexOf(CKEDITOR.tools.style.parse._borderStyle, a) === -1 ? !b.width && CKEDITOR.tools.style.parse._widthRegExp.test(a) && (b.width = a) : b.style = a; - }); return new CKEDITOR.tools.style.border(b); - }, splitCssValues: function (a, b) { - b = b || {}; var e = CKEDITOR.tools.array.reduce(['width', 'style', 'color'], function (e, c) { - var g = a['border-' + c] || b[c]; - - e[c] = g ? CKEDITOR.tools.style.parse.sideShorthand(g) : null; return e; - }, {}); - - return CKEDITOR.tools.array.reduce(['top', 'right', 'bottom', 'left'], function (b, c) { - var g = {}; var d; - - for (d in e) { - var l = -a['border-' + c + '-' + d]; - - g[d] = l ? l : e[d] && e[d][c]; - }b['border-' + c] = new CKEDITOR.tools.style.border(g); return b; - }, {}); - } } }); CKEDITOR.tools.array.indexOf = CKEDITOR.tools.indexOf; CKEDITOR.tools.array.isArray = CKEDITOR.tools.isArray; CKEDITOR.MOUSE_BUTTON_LEFT = 0; CKEDITOR.MOUSE_BUTTON_MIDDLE = 1; CKEDITOR.MOUSE_BUTTON_RIGHT = 2; - })(); - CKEDITOR.dtd = (function () { - var a = CKEDITOR.tools.extend; var d = function (a, b) { - for (var c = CKEDITOR.tools.clone(a), g = 1; g < arguments.length; g++) { - b = arguments[g]; for (var d in b) { - delete c[d]; - } - } return c; - }; var b = {}; var c = {}; var f = { address: 1, article: 1, aside: 1, blockquote: 1, details: 1, div: 1, dl: 1, fieldset: 1, figure: 1, footer: 1, form: 1, h1: 1, h2: 1, h3: 1, h4: 1, h5: 1, h6: 1, header: 1, hgroup: 1, hr: 1, main: 1, menu: 1, nav: 1, ol: 1, p: 1, pre: 1, section: 1, table: 1, ul: 1 }; var h = { command: 1, link: 1, meta: 1, noscript: 1, script: 1, style: 1 }; var k = {}; var g = { '#': 1 }; var l = { center: 1, dir: 1, noframes: 1 }; - - a(b, { a: 1, abbr: 1, area: 1, audio: 1, b: 1, bdi: 1, bdo: 1, br: 1, button: 1, canvas: 1, cite: 1, code: 1, command: 1, datalist: 1, del: 1, dfn: 1, em: 1, embed: 1, i: 1, iframe: 1, img: 1, input: 1, ins: 1, kbd: 1, keygen: 1, label: 1, map: 1, mark: 1, meter: 1, noscript: 1, object: 1, output: 1, progress: 1, q: 1, ruby: 1, s: 1, samp: 1, script: 1, select: 1, small: 1, span: 1, strong: 1, sub: 1, sup: 1, textarea: 1, time: 1, u: 1, var: 1, video: 1, wbr: 1 }, g, { acronym: 1, applet: 1, basefont: 1, big: 1, font: 1, isindex: 1, strike: 1, style: 1, tt: 1 }); a(c, f, b, l); d = { a: d(b, { a: 1, button: 1 }), abbr: b, address: c, - area: k, article: c, aside: c, audio: a({ source: 1, track: 1 }, c), b: b, base: k, bdi: b, bdo: b, blockquote: c, body: c, br: k, button: d(b, { a: 1, button: 1 }), canvas: b, caption: c, cite: b, code: b, col: k, colgroup: { col: 1 }, command: k, datalist: a({ option: 1 }, b), dd: c, del: b, details: a({ summary: 1 }, c), dfn: b, div: c, dl: { dt: 1, dd: 1 }, dt: c, em: b, embed: k, fieldset: a({ legend: 1 }, c), figcaption: c, figure: a({ figcaption: 1 }, c), footer: c, form: c, h1: b, h2: b, h3: b, h4: b, h5: b, h6: b, head: a({ title: 1, base: 1 }, h), header: c, hgroup: { h1: 1, h2: 1, h3: 1, h4: 1, h5: 1, h6: 1 }, hr: k, html: a({ head: 1, - body: 1 }, c, h), i: b, iframe: g, img: k, input: k, ins: b, kbd: b, keygen: k, label: b, legend: b, li: c, link: k, main: c, map: c, mark: b, menu: a({ li: 1 }, c), meta: k, meter: d(b, { meter: 1 }), nav: c, noscript: a({ link: 1, meta: 1, style: 1 }, b), object: a({ param: 1 }, b), ol: { li: 1 }, optgroup: { option: 1 }, option: g, output: b, p: b, param: k, pre: b, progress: d(b, { progress: 1 }), q: b, rp: b, rt: b, ruby: a({ rp: 1, rt: 1 }, b), s: b, samp: b, script: g, section: c, select: { optgroup: 1, option: 1 }, small: b, source: k, span: b, strong: b, style: g, sub: b, summary: a({ h1: 1, h2: 1, h3: 1, h4: 1, h5: 1, h6: 1 }, b), - sup: b, table: { caption: 1, colgroup: 1, thead: 1, tfoot: 1, tbody: 1, tr: 1 }, tbody: { tr: 1 }, td: c, textarea: g, tfoot: { tr: 1 }, th: c, thead: { tr: 1 }, time: d(b, { time: 1 }), title: g, tr: { th: 1, td: 1 }, track: k, u: b, ul: { li: 1 }, var: b, video: a({ source: 1, track: 1 }, c), wbr: k, acronym: b, applet: a({ param: 1 }, c), basefont: k, big: b, center: c, dialog: k, dir: { li: 1 }, font: b, isindex: k, noframes: c, strike: b, tt: b }; a(d, { $block: a({ audio: 1, dd: 1, dt: 1, figcaption: 1, li: 1, video: 1 }, f, l), $blockLimit: { article: 1, aside: 1, audio: 1, body: 1, caption: 1, details: 1, dir: 1, div: 1, dl: 1, - fieldset: 1, figcaption: 1, figure: 1, footer: 1, form: 1, header: 1, hgroup: 1, main: 1, menu: 1, nav: 1, ol: 1, section: 1, table: 1, td: 1, th: 1, tr: 1, ul: 1, video: 1 }, $cdata: { script: 1, style: 1 }, $editable: { address: 1, article: 1, aside: 1, blockquote: 1, body: 1, details: 1, div: 1, fieldset: 1, figcaption: 1, footer: 1, form: 1, h1: 1, h2: 1, h3: 1, h4: 1, h5: 1, h6: 1, header: 1, hgroup: 1, main: 1, nav: 1, p: 1, pre: 1, section: 1 }, $empty: { area: 1, base: 1, basefont: 1, br: 1, col: 1, command: 1, dialog: 1, embed: 1, hr: 1, img: 1, input: 1, isindex: 1, keygen: 1, link: 1, meta: 1, param: 1, source: 1, - track: 1, wbr: 1 }, $inline: b, $list: { dl: 1, ol: 1, ul: 1 }, $listItem: { dd: 1, dt: 1, li: 1 }, $nonBodyContent: a({ body: 1, head: 1, html: 1 }, d.head), $nonEditable: { applet: 1, audio: 1, button: 1, embed: 1, iframe: 1, map: 1, object: 1, option: 1, param: 1, script: 1, textarea: 1, video: 1 }, $object: { applet: 1, audio: 1, button: 1, hr: 1, iframe: 1, img: 1, input: 1, object: 1, select: 1, table: 1, textarea: 1, video: 1 }, $removeEmpty: { abbr: 1, acronym: 1, b: 1, bdi: 1, bdo: 1, big: 1, cite: 1, code: 1, del: 1, dfn: 1, em: 1, font: 1, i: 1, ins: 1, label: 1, kbd: 1, mark: 1, meter: 1, output: 1, q: 1, ruby: 1, - s: 1, samp: 1, small: 1, span: 1, strike: 1, strong: 1, sub: 1, sup: 1, time: 1, tt: 1, u: 1, var: 1 }, $tabIndex: { a: 1, area: 1, button: 1, input: 1, object: 1, select: 1, textarea: 1 }, $tableContent: { caption: 1, col: 1, colgroup: 1, tbody: 1, td: 1, tfoot: 1, th: 1, thead: 1, tr: 1 }, $transparent: { a: 1, audio: 1, canvas: 1, del: 1, ins: 1, map: 1, noscript: 1, object: 1, video: 1 }, $intermediate: { caption: 1, colgroup: 1, dd: 1, dt: 1, figcaption: 1, legend: 1, li: 1, optgroup: 1, option: 1, rp: 1, rt: 1, summary: 1, tbody: 1, td: 1, tfoot: 1, th: 1, thead: 1, tr: 1 } }); return d; - })(); - CKEDITOR.dom.event = function (a) { - this.$ = a; - }; - CKEDITOR.dom.event.prototype = { getKey: function () { - return this.$.keyCode || this.$.which; - }, getKeystroke: function () { - var a = this.getKey(); - - if (this.$.ctrlKey || this.$.metaKey) { - a += CKEDITOR.CTRL; - } this.$.shiftKey && (a += CKEDITOR.SHIFT); this.$.altKey && (a += CKEDITOR.ALT); return a; - }, preventDefault: function (a) { - var d = this.$; - - d.preventDefault ? d.preventDefault() : d.returnValue = !1; a && this.stopPropagation(); - }, stopPropagation: function () { - var a = this.$; - - a.stopPropagation ? a.stopPropagation() : a.cancelBubble = !0; - }, getTarget: function () { - var a = -this.$.target || this.$.srcElement; - - return a ? new CKEDITOR.dom.node(a) : null; - }, getPhase: function () { - return this.$.eventPhase || 2; - }, getPageOffset: function () { - var a = this.getTarget().getDocument().$; - - return { x: this.$.pageX || this.$.clientX + (a.documentElement.scrollLeft || a.body.scrollLeft), y: this.$.pageY || this.$.clientY + (a.documentElement.scrollTop || a.body.scrollTop) }; - } }; CKEDITOR.CTRL = 1114112; CKEDITOR.SHIFT = 2228224; CKEDITOR.ALT = 4456448; CKEDITOR.EVENT_PHASE_CAPTURING = 1; CKEDITOR.EVENT_PHASE_AT_TARGET = 2; - CKEDITOR.EVENT_PHASE_BUBBLING = 3; CKEDITOR.dom.domObject = function (a) { - a && (this.$ = a); - }; - CKEDITOR.dom.domObject.prototype = (function () { - var a = function (a, b) { - return function (c) { - typeof CKEDITOR !== 'undefined' && a.fire(b, new CKEDITOR.dom.event(c)); - }; - }; - - return { getPrivate: function () { - var a; - - (a = this.getCustomData('_')) || this.setCustomData('_', a = {}); return a; - }, on: function (d) { - var b = this.getCustomData('_cke_nativeListeners'); - - b || (b = {}, this.setCustomData('_cke_nativeListeners', b)); b[d] || (b = b[d] = a(this, d), this.$.addEventListener ? this.$.addEventListener(d, b, !!CKEDITOR.event.useCapture) : this.$.attachEvent && this.$.attachEvent('on' + -d, b)); return CKEDITOR.event.prototype.on.apply(this, arguments); - }, removeListener: function (a) { - CKEDITOR.event.prototype.removeListener.apply(this, arguments); if (!this.hasListeners(a)) { - var b = this.getCustomData('_cke_nativeListeners'); var c = b && b[a]; - - c && (this.$.removeEventListener ? this.$.removeEventListener(a, c, !1) : this.$.detachEvent && this.$.detachEvent('on' + a, c), delete b[a]); - } - }, removeAllListeners: function () { - try { - var a = this.getCustomData('_cke_nativeListeners'); var b; - - for (b in a) { - var c = a[b]; - - this.$.detachEvent ? this.$.detachEvent('on' + -b, c) : this.$.removeEventListener && this.$.removeEventListener(b, c, !1); delete a[b]; - } - } catch (f) { - if (!CKEDITOR.env.edge || f.number !== -2146828218) { - throw f; - } - }CKEDITOR.event.prototype.removeAllListeners.call(this); - } }; - })(); - (function (a) { - var d = {}; - - CKEDITOR.on('reset', function () { - d = {}; - }); a.equals = function (a) { - try { - return a && a.$ === this.$; - } catch (c) { - return !1; - } - }; a.setCustomData = function (a, c) { - var f = this.getUniqueId(); - - (d[f] || (d[f] = {}))[a] = c; return this; - }; a.getCustomData = function (a) { - var c = this.$['data-cke-expando']; - - return (c = c && d[c]) && a in c ? c[a] : null; - }; a.removeCustomData = function (a) { - var c = this.$['data-cke-expando']; var c = c && d[c]; var f; var h; - - c && (f = c[a], h = a in c, delete c[a]); return h ? f : null; - }; a.clearCustomData = function () { - this.removeAllListeners(); var a = -this.getUniqueId(); - - a && delete d[a]; - }; a.getUniqueId = function () { - return this.$['data-cke-expando'] || (this.$['data-cke-expando'] = CKEDITOR.tools.getNextNumber()); - }; CKEDITOR.event.implementOn(a); - })(CKEDITOR.dom.domObject.prototype); - CKEDITOR.dom.node = function (a) { - return a ? new CKEDITOR.dom[a.nodeType == CKEDITOR.NODE_DOCUMENT ? 'document' : a.nodeType == CKEDITOR.NODE_ELEMENT ? 'element' : a.nodeType == CKEDITOR.NODE_TEXT ? 'text' : a.nodeType == CKEDITOR.NODE_COMMENT ? 'comment' : a.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT ? 'documentFragment' : 'domObject'](a) : this; - }; CKEDITOR.dom.node.prototype = new CKEDITOR.dom.domObject(); CKEDITOR.NODE_ELEMENT = 1; CKEDITOR.NODE_DOCUMENT = 9; CKEDITOR.NODE_TEXT = 3; CKEDITOR.NODE_COMMENT = 8; CKEDITOR.NODE_DOCUMENT_FRAGMENT = 11; - CKEDITOR.POSITION_IDENTICAL = 0; CKEDITOR.POSITION_DISCONNECTED = 1; CKEDITOR.POSITION_FOLLOWING = 2; CKEDITOR.POSITION_PRECEDING = 4; CKEDITOR.POSITION_IS_CONTAINED = 8; CKEDITOR.POSITION_CONTAINS = 16; - CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype, { appendTo: function (a, d) { - a.append(this, d); return a; - }, clone: function (a, d) { - function b(c) { - c['data-cke-expando'] && (c['data-cke-expando'] = !1); if (c.nodeType == CKEDITOR.NODE_ELEMENT || c.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT) { - if (d || c.nodeType != CKEDITOR.NODE_ELEMENT || c.removeAttribute('id', !1), a) { - c = c.childNodes; for (var f = 0; f < c.length; f++) { - b(c[f]); - } - } - } - } function c(b) { - if (b.type == CKEDITOR.NODE_ELEMENT || b.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT) { - if (b.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) { - var d = -b.getName(); - - d[0] == ':' && b.renameNode(d.substring(1)); - } if (a) { - for (d = 0; d < b.getChildCount(); d++) { - c(b.getChild(d)); - } - } - } - } var f = this.$.cloneNode(a); - - b(f); f = new CKEDITOR.dom.node(f); CKEDITOR.env.ie && CKEDITOR.env.version < 9 && (this.type == CKEDITOR.NODE_ELEMENT || this.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT) && c(f); return f; - }, hasPrevious: function () { - return !!this.$.previousSibling; - }, hasNext: function () { - return !!this.$.nextSibling; - }, insertAfter: function (a) { - a.$.parentNode.insertBefore(this.$, a.$.nextSibling); return a; - }, insertBefore: function (a) { - a.$.parentNode.insertBefore(this.$, - a.$); return a; - }, insertBeforeMe: function (a) { - this.$.parentNode.insertBefore(a.$, this.$); return a; - }, getAddress: function (a) { - for (var d = [], b = this.getDocument().$.documentElement, c = this; c && c != b;) { - var f = c.getParent(); - - f && d.unshift(this.getIndex.call(c, a)); c = f; - } return d; - }, getDocument: function () { - return new CKEDITOR.dom.document(this.$.ownerDocument || this.$.parentNode.ownerDocument); - }, getIndex: function (a) { - function d(a, b) { - var c = b ? a.getNext() : a.getPrevious(); - - return c && c.type == CKEDITOR.NODE_TEXT ? c.isEmpty() ? d(c, b) : c : - null; - } var b = this; var c = -1; var f; - - if (!this.getParent() || a && b.type == CKEDITOR.NODE_TEXT && b.isEmpty() && !d(b) && !d(b, !0)) { - return -1; - } do { - if (!a || b.equals(this) || b.type != CKEDITOR.NODE_TEXT || !f && !b.isEmpty()) { - c++, f = b.type == CKEDITOR.NODE_TEXT; - } - } while (b = b.getPrevious()); return c; - }, getNextSourceNode: function (a, d, b) { - if (b && !b.call) { - var c = b; - - b = function (a) { - return !a.equals(c); - }; - }a = !a && this.getFirst && this.getFirst(); var f; - - if (!a) { - if (this.type == CKEDITOR.NODE_ELEMENT && b && !1 === b(this, !0)) { - return null; - } a = this.getNext(); - } for (;!a && (f = (f || this).getParent());) { - if (b && -!1 === b(f, !0)) { - return null; - } a = f.getNext(); - } return !a || b && !1 === b(a) ? null : d && d != a.type ? a.getNextSourceNode(!1, d, b) : a; - }, getPreviousSourceNode: function (a, d, b) { - if (b && !b.call) { - var c = b; - - b = function (a) { - return !a.equals(c); - }; - }a = !a && this.getLast && this.getLast(); var f; - - if (!a) { - if (this.type == CKEDITOR.NODE_ELEMENT && b && !1 === b(this, !0)) { - return null; - } a = this.getPrevious(); - } for (;!a && (f = (f || this).getParent());) { - if (b && !1 === b(f, !0)) { - return null; - } a = f.getPrevious(); - } return !a || b && !1 === b(a) ? null : d && a.type != d ? a.getPreviousSourceNode(!1, d, b) : - a; - }, getPrevious: function (a) { - var d = this.$; var b; - - do { - b = (d = d.previousSibling) && d.nodeType != 10 && new CKEDITOR.dom.node(d); - } while (b && a && !a(b)); return b; - }, getNext: function (a) { - var d = this.$; var b; - - do { - b = (d = d.nextSibling) && new CKEDITOR.dom.node(d); - } while (b && a && !a(b)); return b; - }, getParent: function (a) { - var d = this.$.parentNode; - - return d && (d.nodeType == CKEDITOR.NODE_ELEMENT || a && d.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT) ? new CKEDITOR.dom.node(d) : null; - }, getParents: function (a) { - var d = this; var b = []; - - do { - b[a ? 'push' : 'unshift'](d); - } while (d = d.getParent()); - return b; - }, getCommonAncestor: function (a) { - if (a.equals(this)) { - return this; - } if (a.contains && a.contains(this)) { - return a; - } var d = this.contains ? this : this.getParent(); - - do { - if (d.contains(a)) { - return d; - } - } while (d = d.getParent()); return null; - }, getPosition: function (a) { - var d = this.$; var b = a.$; - - if (d.compareDocumentPosition) { - return d.compareDocumentPosition(b); - } if (d == b) { - return CKEDITOR.POSITION_IDENTICAL; - } if (this.type == CKEDITOR.NODE_ELEMENT && a.type == CKEDITOR.NODE_ELEMENT) { - if (d.contains) { - if (d.contains(b)) { - return CKEDITOR.POSITION_CONTAINS + -CKEDITOR.POSITION_PRECEDING; - } if (b.contains(d)) { - return CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING; - } - } if ('sourceIndex' in d) { - return d.sourceIndex < 0 || b.sourceIndex < 0 ? CKEDITOR.POSITION_DISCONNECTED : d.sourceIndex < b.sourceIndex ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING; - } - }d = this.getAddress(); a = a.getAddress(); for (var b = Math.min(d.length, a.length), c = 0; c < b; c++) { - if (d[c] != a[c]) { - return d[c] < a[c] ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING; - } - } return d.length < a.length ? CKEDITOR.POSITION_CONTAINS + -CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING; - }, getAscendant: function (a, d) { - var b = this.$; var c; var f; - - d || (b = b.parentNode); typeof a === 'function' ? (f = !0, c = a) : (f = !1, c = function (b) { - b = typeof b.nodeName === 'string' ? b.nodeName.toLowerCase() : ''; return typeof a === 'string' ? b == a : b in a; - }); for (;b;) { - if (c(f ? new CKEDITOR.dom.node(b) : b)) { - return new CKEDITOR.dom.node(b); - } try { - b = b.parentNode; - } catch (h) { - b = null; - } - } return null; - }, hasAscendant: function (a, d) { - var b = this.$; - - d || (b = b.parentNode); for (;b;) { - if (b.nodeName && -b.nodeName.toLowerCase() == a) { - return !0; - } b = b.parentNode; - } return !1; - }, move: function (a, d) { - a.append(this.remove(), d); - }, remove: function (a) { - var d = this.$; var b = d.parentNode; - - if (b) { - if (a) { - for (;a = d.firstChild;) { - b.insertBefore(d.removeChild(a), d); - } - }b.removeChild(d); - } return this; - }, replace: function (a) { - this.insertBefore(a); a.remove(); - }, trim: function () { - this.ltrim(); this.rtrim(); - }, ltrim: function () { - for (var a; this.getFirst && (a = this.getFirst());) { - if (a.type == CKEDITOR.NODE_TEXT) { - var d = CKEDITOR.tools.ltrim(a.getText()); var b = a.getLength(); - - if (d) { - d.length < -b && (a.split(b - d.length), this.$.removeChild(this.$.firstChild)); - } else { - a.remove(); continue; - } - } break; - } - }, rtrim: function () { - for (var a; this.getLast && (a = this.getLast());) { - if (a.type == CKEDITOR.NODE_TEXT) { - var d = CKEDITOR.tools.rtrim(a.getText()); var b = a.getLength(); - - if (d) { - d.length < b && (a.split(d.length), this.$.lastChild.parentNode.removeChild(this.$.lastChild)); - } else { - a.remove(); continue; - } - } break; - }CKEDITOR.env.needsBrFiller && (a = this.$.lastChild) && a.type == 1 && a.nodeName.toLowerCase() == 'br' && a.parentNode.removeChild(a); - }, isReadOnly: function (a) { - var d = -this; - - this.type != CKEDITOR.NODE_ELEMENT && (d = this.getParent()); CKEDITOR.env.edge && d && d.is('textarea', 'input') && (a = !0); if (!a && d && typeof d.$.isContentEditable !== 'undefined') { - return !(d.$.isContentEditable || d.data('cke-editable')); - } for (;d;) { - if (d.data('cke-editable')) { - return !1; - } if (d.hasAttribute('contenteditable')) { - return d.getAttribute('contenteditable') == 'false'; - } d = d.getParent(); - } return !0; - } }); CKEDITOR.dom.window = function (a) { - CKEDITOR.dom.domObject.call(this, a); - }; CKEDITOR.dom.window.prototype = new CKEDITOR.dom.domObject(); - CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype, { focus: function () { - this.$.focus(); - }, getViewPaneSize: function () { - var a = this.$.document; var d = a.compatMode == 'CSS1Compat'; - - return { width: (d ? a.documentElement.clientWidth : a.body.clientWidth) || 0, height: (d ? a.documentElement.clientHeight : a.body.clientHeight) || 0 }; - }, getScrollPosition: function () { - var a = this.$; - - if ('pageXOffset' in a) { - return { x: a.pageXOffset || 0, y: a.pageYOffset || 0 }; - } a = a.document; return { x: a.documentElement.scrollLeft || a.body.scrollLeft || 0, y: a.documentElement.scrollTop || -a.body.scrollTop || 0 }; - }, getFrame: function () { - var a = this.$.frameElement; - - return a ? new CKEDITOR.dom.element.get(a) : null; - } }); CKEDITOR.dom.document = function (a) { - CKEDITOR.dom.domObject.call(this, a); - }; CKEDITOR.dom.document.prototype = new CKEDITOR.dom.domObject(); - CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype, { type: CKEDITOR.NODE_DOCUMENT, appendStyleSheet: function (a) { - if (this.$.createStyleSheet) { - this.$.createStyleSheet(a); - } else { - var d = new CKEDITOR.dom.element('link'); - - d.setAttributes({ rel: 'stylesheet', type: 'text/css', href: a }); this.getHead().append(d); - } - }, appendStyleText: function (a) { - if (this.$.createStyleSheet) { - var d = this.$.createStyleSheet(''); - - d.cssText = a; - } else { - var b = new CKEDITOR.dom.element('style', this); - - b.append(new CKEDITOR.dom.text(a, this)); this.getHead().append(b); - } return d || -b.$.sheet; - }, createElement: function (a, d) { - var b = new CKEDITOR.dom.element(a, this); - - d && (d.attributes && b.setAttributes(d.attributes), d.styles && b.setStyles(d.styles)); return b; - }, createText: function (a) { - return new CKEDITOR.dom.text(a, this); - }, focus: function () { - this.getWindow().focus(); - }, getActive: function () { - var a; - - try { - a = this.$.activeElement; - } catch (d) { - return null; - } return new CKEDITOR.dom.element(a); - }, getById: function (a) { - return (a = this.$.getElementById(a)) ? new CKEDITOR.dom.element(a) : null; - }, getByAddress: function (a, d) { - for (var b = -this.$.documentElement, c = 0; b && c < a.length; c++) { - var f = a[c]; - - if (d) { - for (var h = -1, k = 0; k < b.childNodes.length; k++) { - var g = b.childNodes[k]; - - if (!0 !== d || g.nodeType != 3 || !g.previousSibling || g.previousSibling.nodeType != 3) { - if (h++, h == f) { - b = g; break; - } - } - } - } else { - b = b.childNodes[f]; - } - } return b ? new CKEDITOR.dom.node(b) : null; - }, getElementsByTag: function (a, d) { - CKEDITOR.env.ie && document.documentMode <= 8 || !d || (a = d + ':' + a); return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a)); - }, getHead: function () { - var a = this.$.getElementsByTagName('head')[0]; - - return a = a ? new CKEDITOR.dom.element(a) : this.getDocumentElement().append(new CKEDITOR.dom.element('head'), !0); - }, getBody: function () { - return new CKEDITOR.dom.element(this.$.body); - }, getDocumentElement: function () { - return new CKEDITOR.dom.element(this.$.documentElement); - }, getWindow: function () { - return new CKEDITOR.dom.window(this.$.parentWindow || this.$.defaultView); - }, write: function (a) { - this.$.open('text/html', 'replace'); CKEDITOR.env.ie && (a = a.replace(/(?:^\s*]*?>)|^/i, '$\x26\n\x3cscript data-cke-temp\x3d"1"\x3e(' + -CKEDITOR.tools.fixDomain + ')();\x3c/script\x3e')); this.$.write(a); this.$.close(); - }, find: function (a) { - return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(a)); - }, findOne: function (a) { - return (a = this.$.querySelector(a)) ? new CKEDITOR.dom.element(a) : null; - }, _getHtml5ShivFrag: function () { - var a = this.getCustomData('html5ShivFrag'); - - a || (a = this.$.createDocumentFragment(), CKEDITOR.tools.enableHtml5Elements(a, !0), this.setCustomData('html5ShivFrag', a)); return a; - } }); CKEDITOR.dom.nodeList = function (a) { - this.$ = a; - }; - CKEDITOR.dom.nodeList.prototype = { count: function () { - return this.$.length; - }, getItem: function (a) { - return a < 0 || a >= this.$.length ? null : (a = this.$[a]) ? new CKEDITOR.dom.node(a) : null; - }, toArray: function () { - return CKEDITOR.tools.array.map(this.$, function (a) { - return new CKEDITOR.dom.node(a); - }); - } }; CKEDITOR.dom.element = function (a, d) { - typeof a === 'string' && (a = (d ? d.$ : document).createElement(a)); CKEDITOR.dom.domObject.call(this, a); - }; - CKEDITOR.dom.element.get = function (a) { - return (a = typeof a === 'string' ? document.getElementById(a) || document.getElementsByName(a)[0] : a) && (a.$ ? a : new CKEDITOR.dom.element(a)); - }; CKEDITOR.dom.element.prototype = new CKEDITOR.dom.node(); CKEDITOR.dom.element.createFromHtml = function (a, d) { - var b = new CKEDITOR.dom.element('div', d); - - b.setHtml(a); return b.getFirst().remove(); - }; - CKEDITOR.dom.element.setMarker = function (a, d, b, c) { - var f = d.getCustomData('list_marker_id') || d.setCustomData('list_marker_id', CKEDITOR.tools.getNextNumber()).getCustomData('list_marker_id'); var h = d.getCustomData('list_marker_names') || d.setCustomData('list_marker_names', {}).getCustomData('list_marker_names'); - - a[f] = d; h[b] = 1; return d.setCustomData(b, c); - }; CKEDITOR.dom.element.clearAllMarkers = function (a) { - for (var d in a) { - CKEDITOR.dom.element.clearMarkers(a, a[d], 1); - } - }; - CKEDITOR.dom.element.clearMarkers = function (a, d, b) { - var c = d.getCustomData('list_marker_names'); var f = d.getCustomData('list_marker_id'); var h; - - for (h in c) { - d.removeCustomData(h); - }d.removeCustomData('list_marker_names'); b && (d.removeCustomData('list_marker_id'), delete a[f]); - }; - (function () { - function a(a, b) { - return (' ' + a + ' ').replace(h, ' ').indexOf(' ' + b + ' ') > -1; - } function d(a) { - var b = !0; - - a.$.id || (a.$.id = 'cke_tmp_' + CKEDITOR.tools.getNextNumber(), b = !1); return function () { - b || a.removeAttribute('id'); - }; - } function b(a, b) { - var c = CKEDITOR.tools.escapeCss(a.$.id); - - return '#' + c + ' ' + b.split(/,\s*/).join(', #' + c + ' '); - } function c(a) { - for (var b = 0, c = 0, e = k[a].length; c < e; c++) { - b += parseFloat(this.getComputedStyle(k[a][c]) || 0, 10) || 0; - } return b; - } var f = document.createElement('_').classList; var f = typeof f !== 'undefined' && -String(f.add).match(/\[Native code\]/gi) !== null; var h = /[\n\t\r]/g; - - CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype, { type: CKEDITOR.NODE_ELEMENT, addClass: f ? function (a) { - this.$.classList.add(a); return this; - } : function (b) { - var c = this.$.className; - - c && (a(c, b) || (c += ' ' + b)); this.$.className = c || b; return this; - }, removeClass: f ? function (a) { - var b = this.$; - - b.classList.remove(a); b.className || b.removeAttribute('class'); return this; - } : function (b) { - var c = this.getAttribute('class'); - - c && a(c, b) && ((c = c.replace(new RegExp('(?:^|\\s+)' + -b + '(?\x3d\\s|$)'), '').replace(/^\s+/, '')) ? this.setAttribute('class', c) : this.removeAttribute('class')); return this; - }, hasClass: function (b) { - return a(this.$.className, b); - }, append: function (a, b) { - typeof a === 'string' && (a = this.getDocument().createElement(a)); b ? this.$.insertBefore(a.$, this.$.firstChild) : this.$.appendChild(a.$); return a; - }, appendHtml: function (a) { - if (this.$.childNodes.length) { - var b = new CKEDITOR.dom.element('div', this.getDocument()); - - b.setHtml(a); b.moveChildren(this); - } else { - this.setHtml(a); - } - }, appendText: function (a) { - this.$.text != -null && CKEDITOR.env.ie && CKEDITOR.env.version < 9 ? this.$.text += a : this.append(new CKEDITOR.dom.text(a)); - }, appendBogus: function (a) { - if (a || CKEDITOR.env.needsBrFiller) { - for (a = this.getLast(); a && a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.rtrim(a.getText());) { - a = a.getPrevious(); - }a && a.is && a.is('br') || (a = this.getDocument().createElement('br'), CKEDITOR.env.gecko && a.setAttribute('type', '_moz'), this.append(a)); - } - }, breakParent: function (a, b) { - var c = new CKEDITOR.dom.range(this.getDocument()); - - c.setStartAfter(this); c.setEndAfter(a); - var e = c.extractContents(!1, b || !1); var d; - - c.insertNode(this.remove()); if (CKEDITOR.env.ie && !CKEDITOR.env.edge) { - for (c = new CKEDITOR.dom.element('div'); d = e.getFirst();) { - d.$.style.backgroundColor && (d.$.style.backgroundColor = d.$.style.backgroundColor), c.append(d); - }c.insertAfter(this); c.remove(!0); - } else { - e.insertAfterNode(this); - } - }, contains: document.compareDocumentPosition ? function (a) { - return !!(this.$.compareDocumentPosition(a.$) & 16); - } : function (a) { - var b = this.$; - - return a.type != CKEDITOR.NODE_ELEMENT ? b.contains(a.getParent().$) : - b != a.$ && b.contains(a.$); - }, focus: (function () { - function a() { - try { - this.$.focus(); - } catch (b) {} - } return function (b) { - b ? CKEDITOR.tools.setTimeout(a, 100, this) : a.call(this); - }; - })(), getHtml: function () { - var a = this.$.innerHTML; - - return CKEDITOR.env.ie ? a.replace(/<\?[^>]*>/g, '') : a; - }, getOuterHtml: function () { - if (this.$.outerHTML) { - return this.$.outerHTML.replace(/<\?[^>]*>/, ''); - } var a = this.$.ownerDocument.createElement('div'); - - a.appendChild(this.$.cloneNode(!0)); return a.innerHTML; - }, getClientRect: function (a) { - var b = CKEDITOR.tools.extend({}, - this.$.getBoundingClientRect()); - - !b.width && (b.width = b.right - b.left); !b.height && (b.height = b.bottom - b.top); return a ? CKEDITOR.tools.getAbsoluteRectPosition(this.getWindow(), b) : b; - }, setHtml: CKEDITOR.env.ie && CKEDITOR.env.version < 9 ? function (a) { - try { - var b = this.$; - - if (this.getParent()) { - return b.innerHTML = a; - } var c = this.getDocument()._getHtml5ShivFrag(); - - c.appendChild(b); b.innerHTML = a; c.removeChild(b); return a; - } catch (e) { - this.$.innerHTML = ''; b = new CKEDITOR.dom.element('body', this.getDocument()); b.$.innerHTML = a; for (b = b.getChildren(); b.count();) { - this.append(b.getItem(0)); - } - return a; - } - } : function (a) { - return this.$.innerHTML = a; - }, setText: (function () { - var a = document.createElement('p'); - - a.innerHTML = 'x'; a = a.textContent; return function (b) { - this.$[a ? 'textContent' : 'innerText'] = b; - }; - })(), getAttribute: (function () { - var a = function (a) { - return this.$.getAttribute(a, 2); - }; - - return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function (a) { - switch (a) { - case 'class':a = 'className'; break; case 'http-equiv':a = 'httpEquiv'; break; case 'name':return this.$.name; case 'tabindex':return a = this.$.getAttribute(a, - 2), a !== 0 && this.$.tabIndex === 0 && (a = null), a; case 'checked':return a = this.$.attributes.getNamedItem(a), (a.specified ? a.nodeValue : this.$.checked) ? 'checked' : null; case 'hspace':case 'value':return this.$[a]; case 'style':return this.$.style.cssText; case 'contenteditable':case 'contentEditable':return this.$.attributes.getNamedItem('contentEditable').specified ? this.$.getAttribute('contentEditable') : null; - } return this.$.getAttribute(a, 2); - } : a; - })(), getAttributes: function (a) { - var b = {}; var c = this.$.attributes; var e; - - a = CKEDITOR.tools.isArray(a) ? - a : []; for (e = 0; e < c.length; e++) { - CKEDITOR.tools.indexOf(a, c[e].name) === -1 && (b[c[e].name] = c[e].value); - } return b; - }, getChildren: function () { - return new CKEDITOR.dom.nodeList(this.$.childNodes); - }, getClientSize: function () { - return { width: this.$.clientWidth, height: this.$.clientHeight }; - }, getComputedStyle: document.defaultView && document.defaultView.getComputedStyle ? function (a) { - var b = this.getWindow().$.getComputedStyle(this.$, null); - - return b ? b.getPropertyValue(a) : ''; - } : function (a) { - return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(a)]; - }, - getDtd: function () { - var a = CKEDITOR.dtd[this.getName()]; - - this.getDtd = function () { - return a; - }; return a; - }, getElementsByTag: CKEDITOR.dom.document.prototype.getElementsByTag, getTabIndex: function () { - var a = this.$.tabIndex; - - return a !== 0 || CKEDITOR.dtd.$tabIndex[this.getName()] || parseInt(this.getAttribute('tabindex'), 10) === 0 ? a : -1; - }, getText: function () { - return this.$.textContent || this.$.innerText || ''; - }, getWindow: function () { - return this.getDocument().getWindow(); - }, getId: function () { - return this.$.id || null; - }, getNameAtt: function () { - return this.$.name || -null; - }, getName: function () { - var a = this.$.nodeName.toLowerCase(); - - if (CKEDITOR.env.ie && document.documentMode <= 8) { - var b = this.$.scopeName; - - b != 'HTML' && (a = b.toLowerCase() + ':' + a); - } this.getName = function () { - return a; - }; return this.getName(); - }, getValue: function () { - return this.$.value; - }, getFirst: function (a) { - var b = this.$.firstChild; - - (b = b && new CKEDITOR.dom.node(b)) && a && !a(b) && (b = b.getNext(a)); return b; - }, getLast: function (a) { - var b = this.$.lastChild; - - (b = b && new CKEDITOR.dom.node(b)) && a && !a(b) && (b = b.getPrevious(a)); return b; - }, getStyle: function (a) { - return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]; - }, - is: function () { - var a = this.getName(); - - if (typeof arguments[0] === 'object') { - return !!arguments[0][a]; - } for (var b = 0; b < arguments.length; b++) { - if (arguments[b] == a) { - return !0; - } - } return !1; - }, isEditable: function (a) { - var b = this.getName(); - - return this.isReadOnly() || this.getComputedStyle('display') == 'none' || this.getComputedStyle('visibility') == 'hidden' || CKEDITOR.dtd.$nonEditable[b] || CKEDITOR.dtd.$empty[b] || this.is('a') && (this.data('cke-saved-name') || this.hasAttribute('name')) && !this.getChildCount() ? !1 : !1 !== a ? (a = CKEDITOR.dtd[b] || -CKEDITOR.dtd.span, !(!a || !a['#'])) : !0; - }, isIdentical: function (a) { - var b = this.clone(0, 1); - - a = a.clone(0, 1); b.removeAttributes(['_moz_dirty', 'data-cke-expando', 'data-cke-saved-href', 'data-cke-saved-name']); a.removeAttributes(['_moz_dirty', 'data-cke-expando', 'data-cke-saved-href', 'data-cke-saved-name']); if (b.$.isEqualNode) { - return b.$.style.cssText = CKEDITOR.tools.normalizeCssText(b.$.style.cssText), a.$.style.cssText = CKEDITOR.tools.normalizeCssText(a.$.style.cssText), b.$.isEqualNode(a.$); - } b = b.getOuterHtml(); a = -a.getOuterHtml(); if (CKEDITOR.env.ie && CKEDITOR.env.version < 9 && this.is('a')) { - var c = this.getParent(); - - c.type == CKEDITOR.NODE_ELEMENT && (c = c.clone(), c.setHtml(b), b = c.getHtml(), c.setHtml(a), a = c.getHtml()); - } return b == a; - }, isVisible: function () { - var a = (this.$.offsetHeight || this.$.offsetWidth) && this.getComputedStyle('visibility') != 'hidden'; var b; var c; - - a && CKEDITOR.env.webkit && (b = this.getWindow(), !b.equals(CKEDITOR.document.getWindow()) && (c = b.$.frameElement) && (a = new CKEDITOR.dom.element(c).isVisible())); return !!a; - }, isEmptyInlineRemoveable: function () { - if (!CKEDITOR.dtd.$removeEmpty[this.getName()]) { - return !1; - } - for (var a = this.getChildren(), b = 0, c = a.count(); b < c; b++) { - var e = a.getItem(b); - - if (e.type != CKEDITOR.NODE_ELEMENT || !e.data('cke-bookmark')) { - if (e.type == CKEDITOR.NODE_ELEMENT && !e.isEmptyInlineRemoveable() || e.type == CKEDITOR.NODE_TEXT && CKEDITOR.tools.trim(e.getText())) { - return !1; - } - } - } return !0; - }, hasAttributes: CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function () { - for (var a = this.$.attributes, b = 0; b < a.length; b++) { - var c = a[b]; - - switch (c.nodeName) { - case 'class':if (this.getAttribute('class')) { - return !0; - } case 'data-cke-expando':continue; - default:if (c.specified) { - return !0; - } - } - } return !1; - } : function () { - var a = this.$.attributes; var b = a.length; var c = { 'data-cke-expando': 1, '_moz_dirty': 1 }; - - return b > 0 && (b > 2 || !c[a[0].nodeName] || b == 2 && !c[a[1].nodeName]); - }, hasAttribute: (function () { - function a(b) { - var c = this.$.attributes.getNamedItem(b); - - if (this.getName() == 'input') { - switch (b) { - case 'class':return this.$.className.length > 0; case 'checked':return !!this.$.checked; case 'value':return b = this.getAttribute('type'), b == 'checkbox' || b == 'radio' ? this.$.value != 'on' : !!this.$.value; - } - } return c ? - c.specified : !1; - } return CKEDITOR.env.ie ? CKEDITOR.env.version < 8 ? function (b) { - return b == 'name' ? !!this.$.name : a.call(this, b); - } : a : function (a) { - return !!this.$.attributes.getNamedItem(a); - }; - })(), hide: function () { - this.setStyle('display', 'none'); - }, moveChildren: function (a, b) { - var c = this.$; - - a = a.$; if (c != a) { - var e; - - if (b) { - for (;e = c.lastChild;) { - a.insertBefore(c.removeChild(e), a.firstChild); - } - } else { - for (;e = c.firstChild;) { - a.appendChild(c.removeChild(e)); - } - } - } - }, mergeSiblings: (function () { - function a(b, c, e) { - if (c && c.type == CKEDITOR.NODE_ELEMENT) { - for (var d = -[]; c.data('cke-bookmark') || c.isEmptyInlineRemoveable();) { - if (d.push(c), c = e ? c.getNext() : c.getPrevious(), !c || c.type != CKEDITOR.NODE_ELEMENT) { - return; - } - } if (b.isIdentical(c)) { - for (var g = e ? b.getLast() : b.getFirst(); d.length;) { - d.shift().move(b, !e); - }c.moveChildren(b, !e); c.remove(); g && g.type == CKEDITOR.NODE_ELEMENT && g.mergeSiblings(); - } - } - } return function (b) { - if (!1 === b || CKEDITOR.dtd.$removeEmpty[this.getName()] || this.is('a')) { - a(this, this.getNext(), !0), a(this, this.getPrevious()); - } - }; - })(), show: function () { - this.setStyles({ display: '', - visibility: '' }); - }, setAttribute: (function () { - var a = function (a, b) { - this.$.setAttribute(a, b); return this; - }; - - return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function (b, c) { - b == 'class' ? this.$.className = c : b == 'style' ? this.$.style.cssText = c : b == 'tabindex' ? this.$.tabIndex = c : b == 'checked' ? this.$.checked = c : b == 'contenteditable' ? a.call(this, 'contentEditable', c) : a.apply(this, arguments); return this; - } : CKEDITOR.env.ie8Compat && CKEDITOR.env.secure ? function (b, c) { - if (b == 'src' && c.match(/^http:\/\//)) { - try { - a.apply(this, - arguments); - } catch (e) {} - } else { - a.apply(this, arguments); - } return this; - } : a; - })(), setAttributes: function (a) { - for (var b in a) { - this.setAttribute(b, a[b]); - } return this; - }, setValue: function (a) { - this.$.value = a; return this; - }, removeAttribute: (function () { - var a = function (a) { - this.$.removeAttribute(a); - }; - - return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function (a) { - a == 'class' ? a = 'className' : a == 'tabindex' ? a = 'tabIndex' : a == 'contenteditable' && (a = 'contentEditable'); this.$.removeAttribute(a); - } : a; - })(), removeAttributes: function (a) { - if (CKEDITOR.tools.isArray(a)) { - for (var b = -0; b < a.length; b++) { - this.removeAttribute(a[b]); - } - } else { - for (b in a = a || this.getAttributes(), a) { - a.hasOwnProperty(b) && this.removeAttribute(b); - } - } - }, removeStyle: function (a) { - var b = this.$.style; - - if (b.removeProperty || a != 'border' && a != 'margin' && a != 'padding') { - b.removeProperty ? b.removeProperty(a) : b.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(a)), this.$.style.cssText || this.removeAttribute('style'); - } else { - var c = ['top', 'left', 'right', 'bottom']; var e; - - a == 'border' && (e = ['color', 'style', 'width']); for (var b = [], d = 0; d < c.length; d++) { - if (e) { - for (var w = -0; w < e.length; w++) { - b.push([a, c[d], e[w]].join('-')); - } - } else { - b.push([a, c[d]].join('-')); - } - } for (a = 0; a < b.length; a++) { - this.removeStyle(b[a]); - } - } - }, setStyle: function (a, b) { - this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)] = b; return this; - }, setStyles: function (a) { - for (var b in a) { - this.setStyle(b, a[b]); - } return this; - }, setOpacity: function (a) { - CKEDITOR.env.ie && CKEDITOR.env.version < 9 ? (a = Math.round(100 * a), this.setStyle('filter', a >= 100 ? '' : 'progid:DXImageTransform.Microsoft.Alpha(opacity\x3d' + a + ')')) : this.setStyle('opacity', a); - }, unselectable: function () { - this.setStyles(CKEDITOR.tools.cssVendorPrefix('user-select', - 'none')); if (CKEDITOR.env.ie) { - this.setAttribute('unselectable', 'on'); for (var a, b = this.getElementsByTag('*'), c = 0, e = b.count(); c < e; c++) { - a = b.getItem(c), a.setAttribute('unselectable', 'on'); - } - } - }, getPositionedAncestor: function () { - for (var a = this; a.getName() != 'html';) { - if (a.getComputedStyle('position') != 'static') { - return a; - } a = a.getParent(); - } return null; - }, getDocumentPosition: function (a) { - var b = 0; var c = 0; var e = this.getDocument(); var d = e.getBody(); var w = e.$.compatMode == 'BackCompat'; - - if (document.documentElement.getBoundingClientRect && (CKEDITOR.env.ie ? - CKEDITOR.env.version !== 8 : 1)) { - var f = this.$.getBoundingClientRect(); var h = e.$.documentElement; var t = h.clientTop || d.$.clientTop || 0; var n = h.clientLeft || d.$.clientLeft || 0; var k = !0; - - CKEDITOR.env.ie && (k = e.getDocumentElement().contains(this), e = e.getBody().contains(this), k = w && e || !w && k); k && (CKEDITOR.env.webkit || CKEDITOR.env.ie && CKEDITOR.env.version >= 12 ? (b = d.$.scrollLeft || h.scrollLeft, c = d.$.scrollTop || h.scrollTop) : (c = w ? d.$ : h, b = c.scrollLeft, c = c.scrollTop), b = f.left + b - n, c = f.top + c - t); - } else { - for (t = this, n = null; t && t.getName() != 'body' && -t.getName() != 'html';) { - b += t.$.offsetLeft - t.$.scrollLeft; c += t.$.offsetTop - t.$.scrollTop; t.equals(this) || (b += t.$.clientLeft || 0, c += t.$.clientTop || 0); for (;n && !n.equals(t);) { - b -= n.$.scrollLeft, c -= n.$.scrollTop, n = n.getParent(); - }n = t; t = (f = t.$.offsetParent) ? new CKEDITOR.dom.element(f) : null; - } - }a && (f = this.getWindow(), t = a.getWindow(), !f.equals(t) && f.$.frameElement && (a = new CKEDITOR.dom.element(f.$.frameElement).getDocumentPosition(a), b += a.x, c += a.y)); document.documentElement.getBoundingClientRect || !CKEDITOR.env.gecko || -w || (b += this.$.clientLeft ? 1 : 0, c += this.$.clientTop ? 1 : 0); return { x: b, y: c }; - }, scrollIntoView: function (a) { - var b = this.getParent(); - - if (b) { - do { - if ((b.$.clientWidth && b.$.clientWidth < b.$.scrollWidth || b.$.clientHeight && b.$.clientHeight < b.$.scrollHeight) && !b.is('body') && this.scrollIntoParent(b, a, 1), b.is('html')) { - var c = b.getWindow(); - - try { - var e = c.$.frameElement; - - e && (b = new CKEDITOR.dom.element(e)); - } catch (d) {} - } - } while (b = b.getParent()); - } - }, scrollIntoParent: function (a, b, c) { - var e; var d; var w; var f; - - function h(b, c) { - (/body|html/).test(a.getName()) ? - a.getWindow().$.scrollBy(b, c) : (a.$.scrollLeft += b, a.$.scrollTop += c); - } function t(a, b) { - var c = { x: 0, y: 0 }; - - if (!a.is(k ? 'body' : 'html')) { - var e = a.$.getBoundingClientRect(); - - c.x = e.left; c.y = e.top; - }e = a.getWindow(); e.equals(b) || (e = t(CKEDITOR.dom.element.get(e.$.frameElement), b), c.x += e.x, c.y += e.y); return c; - } function n(a, b) { - return parseInt(a.getComputedStyle('margin-' + b) || 0, 10) || 0; - }!a && (a = this.getWindow()); w = a.getDocument(); var k = w.$.compatMode == 'BackCompat'; - - a instanceof CKEDITOR.dom.window && (a = k ? w.getBody() : w.getDocumentElement()); - CKEDITOR.env.webkit && (w = this.getEditor(!1)) && (w._.previousScrollTop = null); w = a.getWindow(); d = t(this, w); var y = t(a, w); var H = this.$.offsetHeight; - - e = this.$.offsetWidth; var I = a.$.clientHeight; var m = a.$.clientWidth; - - w = d.x - n(this, 'left') - y.x || 0; f = d.y - n(this, 'top') - y.y || 0; e = d.x + e + n(this, 'right') - (y.x + m) || 0; d = d.y + H + n(this, 'bottom') - (y.y + I) || 0; (f < 0 || d > 0) && h(0, !0 === b ? f : !1 === b ? d : f < 0 ? f : d); c && (w < 0 || e > 0) && h(w < 0 ? w : e, 0); - }, setState: function (a, b, c) { - b = b || 'cke'; switch (a) { - case CKEDITOR.TRISTATE_ON:this.addClass(b + '_on'); this.removeClass(b + -'_off'); this.removeClass(b + '_disabled'); c && this.setAttribute('aria-pressed', !0); c && this.removeAttribute('aria-disabled'); break; case CKEDITOR.TRISTATE_DISABLED:this.addClass(b + '_disabled'); this.removeClass(b + '_off'); this.removeClass(b + '_on'); c && this.setAttribute('aria-disabled', !0); c && this.removeAttribute('aria-pressed'); break; default:this.addClass(b + '_off'), this.removeClass(b + '_on'), this.removeClass(b + '_disabled'), c && this.removeAttribute('aria-pressed'), c && this.removeAttribute('aria-disabled'); - } - }, - getFrameDocument: function () { - var a = this.$; - - try { - a.contentWindow.document; - } catch (b) { - a.src = a.src; - } return a && new CKEDITOR.dom.document(a.contentWindow.document); - }, copyAttributes: function (a, b) { - var c = this.$.attributes; - - b = b || {}; for (var e = 0; e < c.length; e++) { - var d = c[e]; var w = d.nodeName.toLowerCase(); var f; - - if (!(w in b)) { - if (w == 'checked' && (f = this.getAttribute(w))) { - a.setAttribute(w, f); - } else if (!CKEDITOR.env.ie || this.hasAttribute(w)) { - f = this.getAttribute(w), f === null && (f = d.nodeValue), a.setAttribute(w, f); - } - } - } this.$.style.cssText !== '' && -(a.$.style.cssText = this.$.style.cssText); - }, renameNode: function (a) { - if (this.getName() != a) { - var b = this.getDocument(); - - a = new CKEDITOR.dom.element(a, b); this.copyAttributes(a); this.moveChildren(a); this.getParent(!0) && this.$.parentNode.replaceChild(a.$, this.$); a.$['data-cke-expando'] = this.$['data-cke-expando']; this.$ = a.$; delete this.getName; - } - }, getChild: (function () { - function a(b, c) { - var e = b.childNodes; - - if (0 <= c && c < e.length) { - return e[c]; - } - } return function (b) { - var c = this.$; - - if (b.slice) { - for (b = b.slice(); b.length > 0 && c;) { - c = a(c, - b.shift()); - } - } else { - c = a(c, b); - } return c ? new CKEDITOR.dom.node(c) : null; - }; - })(), getChildCount: function () { - return this.$.childNodes.length; - }, disableContextMenu: function () { - function a(b) { - return b.type == CKEDITOR.NODE_ELEMENT && b.hasClass('cke_enable_context_menu'); - } this.on('contextmenu', function (b) { - b.data.getTarget().getAscendant(a, !0) || b.data.preventDefault(); - }); - }, getDirection: function (a) { - return a ? this.getComputedStyle('direction') || this.getDirection() || this.getParent() && this.getParent().getDirection(1) || this.getDocument().$.dir || -'ltr' : this.getStyle('direction') || this.getAttribute('dir'); - }, data: function (a, b) { - a = 'data-' + a; if (void 0 === b) { - return this.getAttribute(a); - } !1 === b ? this.removeAttribute(a) : this.setAttribute(a, b); return null; - }, getEditor: function (a) { - var b = CKEDITOR.instances; var c; var e; var d; - - a = a || void 0 === a; for (c in b) { - if (e = b[c], e.element.equals(this) && e.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO || !a && (d = e.editable()) && (d.equals(this) || d.contains(this))) { - return e; - } - } return null; - }, find: function (a) { - var c = d(this); - - a = new CKEDITOR.dom.nodeList(this.$.querySelectorAll(b(this, - a))); c(); return a; - }, findOne: function (a) { - var c = d(this); - - a = this.$.querySelector(b(this, a)); c(); return a ? new CKEDITOR.dom.element(a) : null; - }, forEach: function (a, b, c) { - if (!(c || b && this.type != b)) { - var e = a(this); - } - - if (!1 !== e) { - c = this.getChildren(); for (var d = 0; d < c.count(); d++) { - e = c.getItem(d), e.type == CKEDITOR.NODE_ELEMENT ? e.forEach(a, b) : b && e.type != b || a(e); - } - } - }, fireEventHandler: function (a, b) { - var c = 'on' + a; var e = this.$; - - if (CKEDITOR.env.ie && CKEDITOR.env.version < 9) { - var d = e.ownerDocument.createEventObject(); var f; - - for (f in b) { - d[f] = b[f]; - }e.fireEvent(c, - d); - } else { - e[e[a] ? a : c](b); - } - }, isDetached: function () { - var a = this.getDocument(); var b = a.getDocumentElement(); - - return b.equals(this) || b.contains(this) ? !CKEDITOR.env.ie || CKEDITOR.env.version > 8 && !CKEDITOR.env.quirks ? !a.$.defaultView : !1 : !0; - } }); var k = { width: ['border-left-width', 'border-right-width', 'padding-left', 'padding-right'], height: ['border-top-width', 'border-bottom-width', 'padding-top', 'padding-bottom'] }; - - CKEDITOR.dom.element.prototype.setSize = function (a, b, d) { - typeof b === 'number' && (!d || CKEDITOR.env.ie && CKEDITOR.env.quirks || -(b -= c.call(this, a)), this.setStyle(a, b + 'px')); - }; CKEDITOR.dom.element.prototype.getSize = function (a, b) { - var d = Math.max(this.$['offset' + CKEDITOR.tools.capitalize(a)], this.$['client' + CKEDITOR.tools.capitalize(a)]) || 0; - - b && (d -= c.call(this, a)); return d; - }; - })(); CKEDITOR.dom.documentFragment = function (a) { - a = a || CKEDITOR.document; this.$ = a.type == CKEDITOR.NODE_DOCUMENT ? a.$.createDocumentFragment() : a; - }; - CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype, CKEDITOR.dom.element.prototype, { type: CKEDITOR.NODE_DOCUMENT_FRAGMENT, insertAfterNode: function (a) { - a = a.$; a.parentNode.insertBefore(this.$, a.nextSibling); - }, getHtml: function () { - var a = new CKEDITOR.dom.element('div'); - - this.clone(1, 1).appendTo(a); return a.getHtml().replace(/\s*data-cke-expando=".*?"/g, ''); - } }, !0, { append: 1, appendBogus: 1, clone: 1, getFirst: 1, getHtml: 1, getLast: 1, getParent: 1, getNext: 1, getPrevious: 1, appendTo: 1, moveChildren: 1, insertBefore: 1, - insertAfterNode: 1, replace: 1, trim: 1, type: 1, ltrim: 1, rtrim: 1, getDocument: 1, getChildCount: 1, getChild: 1, getChildren: 1 }); CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype, CKEDITOR.dom.document.prototype, !0, { find: 1, findOne: 1 }); - (function () { - function a(a, b) { - var c = this.range; - - if (this._.end) { - return null; - } if (!this._.start) { - this._.start = 1; if (c.collapsed) { - return this.end(), null; - } c.optimize(); - } var e; var d = c.startContainer; - - e = c.endContainer; var f = c.startOffset; var x = c.endOffset; var h; var g = this.guard; var m = this.type; var C = a ? 'getPreviousSourceNode' : 'getNextSourceNode'; - - if (!a && !this._.guardLTR) { - var K = e.type == CKEDITOR.NODE_ELEMENT ? e : e.getParent(); var A = e.type == CKEDITOR.NODE_ELEMENT ? e.getChild(x) : e.getNext(); - - this._.guardLTR = function (a, b) { - return (!b || !K.equals(a)) && (!A || -!a.equals(A)) && (a.type != CKEDITOR.NODE_ELEMENT || !b || !a.equals(c.root)); - }; - } if (a && !this._.guardRTL) { - var k = d.type == CKEDITOR.NODE_ELEMENT ? d : d.getParent(); var r = d.type == CKEDITOR.NODE_ELEMENT ? f ? d.getChild(f - 1) : null : d.getPrevious(); - - this._.guardRTL = function (a, b) { - return (!b || !k.equals(a)) && (!r || !a.equals(r)) && (a.type != CKEDITOR.NODE_ELEMENT || !b || !a.equals(c.root)); - }; - } var D = a ? this._.guardRTL : this._.guardLTR; - - h = g ? function (a, b) { - return !1 === D(a, b) ? !1 : g(a, b); - } : D; this.current ? e = this.current[C](!1, m, h) : (a ? e.type == CKEDITOR.NODE_ELEMENT && -(e = x > 0 ? e.getChild(x - 1) : !1 === h(e, !0) ? null : e.getPreviousSourceNode(!0, m, h)) : (e = d, e.type == CKEDITOR.NODE_ELEMENT && ((e = e.getChild(f)) || (e = !1 === h(d, !0) ? null : d.getNextSourceNode(!0, m, h)))), e && !1 === h(e) && (e = null)); for (;e && !this._.end;) { - this.current = e; if (!this.evaluator || !1 !== this.evaluator(e)) { - if (!b) { - return e; - } - } else if (b && this.evaluator) { - return !1; - } e = e[C](!1, m, h); - } this.end(); return this.current = null; - } function d(b) { - for (var c, e = null; c = a.call(this, b);) { - e = c; - } return e; - }CKEDITOR.dom.walker = CKEDITOR.tools.createClass({ $: function (a) { - this.range = -a; this._ = {}; - }, proto: { end: function () { - this._.end = 1; - }, next: function () { - return a.call(this); - }, previous: function () { - return a.call(this, 1); - }, checkForward: function () { - return !1 !== a.call(this, 0, 1); - }, checkBackward: function () { - return !1 !== a.call(this, 1, 1); - }, lastForward: function () { - return d.call(this); - }, lastBackward: function () { - return d.call(this, 1); - }, reset: function () { - delete this.current; this._ = {}; - } } }); var b = { 'block': 1, 'list-item': 1, 'table': 1, 'table-row-group': 1, 'table-header-group': 1, 'table-footer-group': 1, 'table-row': 1, 'table-column-group': 1, - 'table-column': 1, 'table-cell': 1, 'table-caption': 1 }; var c = { absolute: 1, fixed: 1 }; - - CKEDITOR.dom.element.prototype.isBlockBoundary = function (a) { - return this.getComputedStyle('float') != 'none' || this.getComputedStyle('position') in c || !b[this.getComputedStyle('display')] ? !!(this.is(CKEDITOR.dtd.$block) || a && this.is(a)) : !0; - }; CKEDITOR.dom.walker.blockBoundary = function (a) { - return function (b) { - return !(b.type == CKEDITOR.NODE_ELEMENT && b.isBlockBoundary(a)); - }; - }; CKEDITOR.dom.walker.listItemBoundary = function () { - return this.blockBoundary({ br: 1 }); - }; - CKEDITOR.dom.walker.bookmark = function (a, b) { - function c(a) { - return a && a.getName && a.getName() == 'span' && a.data('cke-bookmark'); - } return function (e) { - var d; var f; - - d = e && e.type != CKEDITOR.NODE_ELEMENT && (f = e.getParent()) && c(f); d = a ? d : d || c(e); return !!(b ^ d); - }; - }; CKEDITOR.dom.walker.whitespaces = function (a) { - return function (b) { - var c; - - b && b.type == CKEDITOR.NODE_TEXT && (c = !CKEDITOR.tools.trim(b.getText()) || CKEDITOR.env.webkit && b.getText() == CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE); return !!(a ^ c); - }; - }; CKEDITOR.dom.walker.invisible = -function (a) { - var b = CKEDITOR.dom.walker.whitespaces(); var c = CKEDITOR.env.webkit ? 1 : 0; - - return function (e) { - b(e) ? e = 1 : (e.type == CKEDITOR.NODE_TEXT && (e = e.getParent()), e = e.$.offsetWidth <= c); return !!(a ^ e); - }; -}; CKEDITOR.dom.walker.nodeType = function (a, b) { - return function (c) { - return !!(b ^ c.type == a); - }; - }; CKEDITOR.dom.walker.bogus = function (a) { - function b(a) { - return !h(a) && !k(a); - } return function (c) { - var e = CKEDITOR.env.needsBrFiller ? c.is && c.is('br') : c.getText && f.test(c.getText()); - - e && (e = c.getParent(), c = c.getNext(b), e = e.isBlockBoundary() && -(!c || c.type == CKEDITOR.NODE_ELEMENT && c.isBlockBoundary())); return !!(a ^ e); - }; - }; CKEDITOR.dom.walker.temp = function (a) { - return function (b) { - b.type != CKEDITOR.NODE_ELEMENT && (b = b.getParent()); b = b && b.hasAttribute('data-cke-temp'); return !!(a ^ b); - }; - }; var f = /^[\t\r\n ]*(?: |\xa0)$/; var h = CKEDITOR.dom.walker.whitespaces(); var k = CKEDITOR.dom.walker.bookmark(); var g = CKEDITOR.dom.walker.temp(); var l = function (a) { - return k(a) || h(a) || a.type == CKEDITOR.NODE_ELEMENT && a.is(CKEDITOR.dtd.$inline) && !a.is(CKEDITOR.dtd.$empty); - }; - - CKEDITOR.dom.walker.ignored = -function (a) { - return function (b) { - b = h(b) || k(b) || g(b); return !!(a ^ b); - }; -}; var u = CKEDITOR.dom.walker.ignored(); - - CKEDITOR.dom.walker.empty = function (a) { - return function (b) { - for (var c = 0, e = b.getChildCount(); c < e; ++c) { - if (!u(b.getChild(c))) { - return !!a; - } - } return !a; - }; - }; var e = CKEDITOR.dom.walker.empty(); var x = CKEDITOR.dom.walker.validEmptyBlockContainers = CKEDITOR.tools.extend((function (a) { - var b = {}; var c; - - for (c in a) { - CKEDITOR.dtd[c]['#'] && (b[c] = 1); - } return b; - })(CKEDITOR.dtd.$block), { caption: 1, td: 1, th: 1 }); - - CKEDITOR.dom.walker.editable = function (a) { - return function (b) { - b = -u(b) ? !1 : b.type == CKEDITOR.NODE_TEXT || b.type == CKEDITOR.NODE_ELEMENT && (b.is(CKEDITOR.dtd.$inline) || b.is('hr') || b.getAttribute('contenteditable') == 'false' || !CKEDITOR.env.needsBrFiller && b.is(x) && e(b)) ? !0 : !1; return !!(a ^ b); - }; - }; CKEDITOR.dom.element.prototype.getBogus = function () { - var a = this; - - do { - a = a.getPreviousSourceNode(); - } while (l(a)); return a && (CKEDITOR.env.needsBrFiller ? a.is && a.is('br') : a.getText && f.test(a.getText())) ? a : !1; - }; - })(); - CKEDITOR.dom.range = function (a) { - this.endOffset = this.endContainer = this.startOffset = this.startContainer = null; this.collapsed = !0; var d = a instanceof CKEDITOR.dom.document; - - this.document = d ? a : a.getDocument(); this.root = d ? a.getBody() : a; - }; - (function () { - function a(a) { - a.collapsed = a.startContainer && a.endContainer && a.startContainer.equals(a.endContainer) && a.startOffset == a.endOffset; - } function d(a, b, c, d, f) { - function h(a, b, c, e) { - var E = c ? a.getPrevious() : a.getNext(); - - if (e && k) { - return E; - } l || e ? b.append(a.clone(!0, f), c) : (a.remove(), u && b.append(a, c)); return E; - } function n() { - var a; var b; var c; var e = Math.min(S.length, p.length); - - for (a = 0; a < e; a++) { - if (b = S[a], c = p[a], !b.equals(c)) { - return a; - } - } return a - 1; - } function g() { - var b = N - 1; var c = D && B && !m.equals(C); - - b < O - 1 || b < q - 1 || c ? (c ? a.moveToPosition(C, - CKEDITOR.POSITION_BEFORE_START) : q == b + 1 && r ? a.moveToPosition(p[b], CKEDITOR.POSITION_BEFORE_END) : a.moveToPosition(p[b + 1], CKEDITOR.POSITION_BEFORE_START), d && (b = S[b + 1]) && b.type == CKEDITOR.NODE_ELEMENT && (c = CKEDITOR.dom.element.createFromHtml('\x3cspan data-cke-bookmark\x3d"1" style\x3d"display:none"\x3e\x26nbsp;\x3c/span\x3e', a.document), c.insertAfter(b), b.mergeSiblings(!1), a.moveToBookmark({ startNode: c }))) : a.collapse(!0); - }a.optimizeBookmark(); var k = b === 0; var u = b == 1; var l = b == 2; - - b = l || u; var m = a.startContainer; var C = a.endContainer; - var K = a.startOffset; var A = a.endOffset; var M; var r; var D; var B; var v; var T; - - if (l && C.type == CKEDITOR.NODE_TEXT && (m.equals(C) || m.type === CKEDITOR.NODE_ELEMENT && m.getFirst().equals(C))) { - c.append(a.document.createText(C.substring(K, A))); - } else { - C.type == CKEDITOR.NODE_TEXT ? l ? T = !0 : C = C.split(A) : C.getChildCount() > 0 ? A >= C.getChildCount() ? (C = C.getChild(A - 1), r = !0) : C = C.getChild(A) : B = r = !0; m.type == CKEDITOR.NODE_TEXT ? l ? v = !0 : m.split(K) : m.getChildCount() > 0 ? K === 0 ? (m = m.getChild(K), M = !0) : m = m.getChild(K - 1) : D = M = !0; for (var S = m.getParents(), p = C.getParents(), N = n(), - O = S.length - 1, q = p.length - 1, F = c, E, ba, J, da = -1, U = N; U <= O; U++) { - ba = S[U]; J = ba.getNext(); for (U != O || ba.equals(p[U]) && O < q ? b && (E = F.append(ba.clone(0, f))) : M ? h(ba, F, !1, D) : v && F.append(a.document.createText(ba.substring(K))); J;) { - if (J.equals(p[U])) { - da = U; break; - }J = h(J, F); - }F = E; - }F = c; for (U = N; U <= q; U++) { - if (c = p[U], J = c.getPrevious(), c.equals(S[U])) { - b && (F = F.getChild(0)); - } else { - U != q || c.equals(S[U]) && q < O ? b && (E = F.append(c.clone(0, f))) : r ? h(c, F, !1, B) : T && F.append(a.document.createText(c.substring(0, A))); if (U > da) { - for (;J;) { - J = h(J, F, !0); - } - }F = E; - } - }l || -g(); - } - } function b() { - var a = !1; var b = CKEDITOR.dom.walker.whitespaces(); var c = CKEDITOR.dom.walker.bookmark(!0); var d = CKEDITOR.dom.walker.bogus(); - - return function (f) { - return c(f) || b(f) ? !0 : d(f) && !a ? a = !0 : f.type == CKEDITOR.NODE_TEXT && (f.hasAscendant('pre') || CKEDITOR.tools.trim(f.getText()).length) || f.type == CKEDITOR.NODE_ELEMENT && !f.is(h) ? !1 : !0; - }; - } function c(a) { - var b = CKEDITOR.dom.walker.whitespaces(); var c = CKEDITOR.dom.walker.bookmark(1); - - return function (d) { - return c(d) || b(d) ? !0 : !a && k(d) || d.type == CKEDITOR.NODE_ELEMENT && d.is(CKEDITOR.dtd.$removeEmpty); - }; - } - function f(a) { - return function () { - var b; - - return this[a ? 'getPreviousNode' : 'getNextNode'](function (a) { - !b && u(a) && (b = a); return l(a) && !(k(a) && a.equals(b)); - }); - }; - } var h = { abbr: 1, acronym: 1, b: 1, bdo: 1, big: 1, cite: 1, code: 1, del: 1, dfn: 1, em: 1, font: 1, i: 1, ins: 1, label: 1, kbd: 1, q: 1, samp: 1, small: 1, span: 1, strike: 1, strong: 1, sub: 1, sup: 1, tt: 1, u: 1, var: 1 }; var k = CKEDITOR.dom.walker.bogus(); var g = /^[\t\r\n ]*(?: |\xa0)$/; var l = CKEDITOR.dom.walker.editable(); var u = CKEDITOR.dom.walker.ignored(!0); - - CKEDITOR.dom.range.prototype = { clone: function () { - var a = -new CKEDITOR.dom.range(this.root); - - a._setStartContainer(this.startContainer); a.startOffset = this.startOffset; a._setEndContainer(this.endContainer); a.endOffset = this.endOffset; a.collapsed = this.collapsed; return a; - }, collapse: function (a) { - a ? (this._setEndContainer(this.startContainer), this.endOffset = this.startOffset) : (this._setStartContainer(this.endContainer), this.startOffset = this.endOffset); this.collapsed = !0; - }, cloneContents: function (a) { - var b = new CKEDITOR.dom.documentFragment(this.document); - - this.collapsed || -d(this, 2, b, !1, typeof a === 'undefined' ? !0 : a); return b; - }, deleteContents: function (a) { - this.collapsed || d(this, 0, null, a); - }, extractContents: function (a, b) { - var c = new CKEDITOR.dom.documentFragment(this.document); - - this.collapsed || d(this, 1, c, a, typeof b === 'undefined' ? !0 : b); return c; - }, equals: function (a) { - return this.startOffset === a.startOffset && this.endOffset === a.endOffset && this.startContainer.equals(a.startContainer) && this.endContainer.equals(a.endContainer); - }, createBookmark: function (a) { - function b(a) { - return a.getAscendant(function (a) { - var b; - - if (b = a.data && a.data('cke-temp')) { - b = CKEDITOR.tools.array.indexOf(['cke_copybin', 'cke_pastebin'], a.getAttribute('id')) === -1; - } return b; - }, !0); - } var c = this.startContainer; var d = this.endContainer; var f = this.collapsed; var h; var n; var g; var k; - - h = this.document.createElement('span'); h.data('cke-bookmark', 1); h.setStyle('display', 'none'); h.setHtml('\x26nbsp;'); a && (g = 'cke_bm_' + CKEDITOR.tools.getNextNumber(), h.setAttribute('id', g + (f ? 'C' : 'S'))); f || (n = h.clone(), n.setHtml('\x26nbsp;'), a && n.setAttribute('id', g + 'E'), k = this.clone(), b(d) && (d = b(d), - k.moveToPosition(d, CKEDITOR.POSITION_AFTER_END)), k.collapse(), k.insertNode(n)); k = this.clone(); b(c) && (d = b(c), k.moveToPosition(d, CKEDITOR.POSITION_BEFORE_START)); k.collapse(!0); k.insertNode(h); n ? (this.setStartAfter(h), this.setEndBefore(n)) : this.moveToPosition(h, CKEDITOR.POSITION_AFTER_END); return { startNode: a ? g + (f ? 'C' : 'S') : h, endNode: a ? g + 'E' : n, serializable: a, collapsed: f }; - }, createBookmark2: (function () { - function a(b) { - var e = b.container; var d = b.offset; var n; - - n = e; var f = d; - - n = n.type != CKEDITOR.NODE_ELEMENT || f === 0 || f == n.getChildCount() ? - 0 : n.getChild(f - 1).type == CKEDITOR.NODE_TEXT && n.getChild(f).type == CKEDITOR.NODE_TEXT; n && (e = e.getChild(d - 1), d = e.getLength()); if (e.type == CKEDITOR.NODE_ELEMENT && d > 0) { - a: { - for (n = e; d--;) { - if (f = n.getChild(d).getIndex(!0), f >= 0) { - d = f; break a; - } - }d = -1; - }d += 1; - } if (e.type == CKEDITOR.NODE_TEXT) { - n = e; for (f = 0; (n = n.getPrevious()) && n.type == CKEDITOR.NODE_TEXT;) { - f += n.getText().replace(CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE, '').length; - }n = f; e.isEmpty() ? (f = e.getPrevious(c), n ? (d = n, e = f ? f.getNext() : e.getParent().getFirst()) : (e = e.getParent(), - d = f ? f.getIndex(!0) + 1 : 0)) : d += n; - }b.container = e; b.offset = d; - } function b(a, c) { - var e = c.getCustomData('cke-fillingChar'); - - if (e) { - var d = a.container; - - e.equals(d) && (a.offset -= CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE.length, a.offset <= 0 && (a.offset = d.getIndex(), a.container = d.getParent())); - } - } var c = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT, !0); - - return function (c) { - var d = this.collapsed; var f = { container: this.startContainer, offset: this.startOffset }; var n = { container: this.endContainer, offset: this.endOffset }; - - c && (a(f), b(f, this.root), - d || (a(n), b(n, this.root))); return { start: f.container.getAddress(c), end: d ? null : n.container.getAddress(c), startOffset: f.offset, endOffset: n.offset, normalized: c, collapsed: d, is2: !0 }; - }; - })(), moveToBookmark: function (a) { - if (a.is2) { - var b = this.document.getByAddress(a.start, a.normalized); var c = a.startOffset; var d = a.end && this.document.getByAddress(a.end, a.normalized); - - a = a.endOffset; this.setStart(b, c); d ? this.setEnd(d, a) : this.collapse(!0); - } else { - b = (c = a.serializable) ? this.document.getById(a.startNode) : a.startNode, a = c ? this.document.getById(a.endNode) : - a.endNode, this.setStartBefore(b), b.remove(), a ? (this.setEndBefore(a), a.remove()) : this.collapse(!0); - } - }, getBoundaryNodes: function () { - var a = this.startContainer; var b = this.endContainer; var c = this.startOffset; var d = this.endOffset; var f; - - if (a.type == CKEDITOR.NODE_ELEMENT) { - if (f = a.getChildCount(), f > c) { - a = a.getChild(c); - } else if (f < 1) { - a = a.getPreviousSourceNode(); - } else { - for (a = a.$; a.lastChild;) { - a = a.lastChild; - }a = new CKEDITOR.dom.node(a); a = a.getNextSourceNode() || a; - } - } if (b.type == CKEDITOR.NODE_ELEMENT) { - if (f = b.getChildCount(), f > d) { - b = b.getChild(d).getPreviousSourceNode(!0); - } else if (f < 1) { - b = b.getPreviousSourceNode(); - } else { - for (b = b.$; b.lastChild;) { - b = b.lastChild; - }b = new CKEDITOR.dom.node(b); - } - }a.getPosition(b) & CKEDITOR.POSITION_FOLLOWING && (a = b); return { startNode: a, endNode: b }; - }, getCommonAncestor: function (a, b) { - var c = this.startContainer; var d = this.endContainer; var c = c.equals(d) ? a && c.type == CKEDITOR.NODE_ELEMENT && this.startOffset == this.endOffset - 1 ? c.getChild(this.startOffset) : c : c.getCommonAncestor(d); - - return b && !c.is ? c.getParent() : c; - }, optimize: function () { - var a = this.startContainer; var b = this.startOffset; - - a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setStartAfter(a) : this.setStartBefore(a)); a = this.endContainer; b = this.endOffset; a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setEndAfter(a) : this.setEndBefore(a)); - }, optimizeBookmark: function () { - var a = this.startContainer; var b = this.endContainer; - - a.is && a.is('span') && a.data('cke-bookmark') && this.setStartAt(a, CKEDITOR.POSITION_BEFORE_START); b && b.is && b.is('span') && b.data('cke-bookmark') && this.setEndAt(b, CKEDITOR.POSITION_AFTER_END); - }, trim: function (a, - b) { - var c = this.startContainer; var d = this.startOffset; var f = this.collapsed; - - if ((!a || f) && c && c.type == CKEDITOR.NODE_TEXT) { - if (d) { - if (d >= c.getLength()) { - d = c.getIndex() + 1, c = c.getParent(); - } else { - var h = c.split(d); var d = c.getIndex() + 1; var c = c.getParent(); - - this.startContainer.equals(this.endContainer) ? this.setEnd(h, this.endOffset - this.startOffset) : c.equals(this.endContainer) && (this.endOffset += 1); - } - } else { - d = c.getIndex(), c = c.getParent(); - } this.setStart(c, d); if (f) { - this.collapse(!0); return; - } - }c = this.endContainer; d = this.endOffset; b || f || !c || c.type != -CKEDITOR.NODE_TEXT || (d ? (d >= c.getLength() || c.split(d), d = c.getIndex() + 1) : d = c.getIndex(), c = c.getParent(), this.setEnd(c, d)); - }, enlarge: function (a, b) { - function c(a) { - return a && a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute('contenteditable') ? null : a; - } var d = new RegExp(/[^\s\ufeff]/); - - switch (a) { - case CKEDITOR.ENLARGE_INLINE:var f = 1; - - case CKEDITOR.ENLARGE_ELEMENT:var h = function (a, b) { - var c = new CKEDITOR.dom.range(g); - - c.setStart(a, b); c.setEndAt(g, CKEDITOR.POSITION_BEFORE_END); var c = new CKEDITOR.dom.walker(c); var e; - - for (c.guard = -function (a) { - return !(a.type == CKEDITOR.NODE_ELEMENT && a.isBlockBoundary()); -}; e = c.next();) { - if (e.type != CKEDITOR.NODE_TEXT) { - return !1; - } M = e != a ? e.getText() : e.substring(b); if (d.test(M)) { - return !1; - } - } return !0; - }; - - if (this.collapsed) { - break; - } var n = this.getCommonAncestor(); var g = this.root; var k; var u; var l; var m; var C; var K = !1; var A; var M; - - A = this.startContainer; var r = this.startOffset; - - A.type == CKEDITOR.NODE_TEXT ? (r && (A = !CKEDITOR.tools.trim(A.substring(0, r)).length && A, K = !!A), A && ((m = A.getPrevious()) || (l = A.getParent()))) : (r && (m = A.getChild(r - 1) || A.getLast()), m || (l = A)); - for (l = c(l); l || m;) { - if (l && !m) { - !C && l.equals(n) && (C = !0); if (f ? l.isBlockBoundary() : !g.contains(l)) { - break; - } K && l.getComputedStyle('display') == 'inline' || (K = !1, C ? k = l : this.setStartBefore(l)); m = l.getPrevious(); - } for (;m;) { - if (A = !1, m.type == CKEDITOR.NODE_COMMENT) { - m = m.getPrevious(); - } else { - if (m.type == CKEDITOR.NODE_TEXT) { - M = m.getText(), d.test(M) && (m = null), A = (/[\s\ufeff]$/).test(M); - } else if ((m.$.offsetWidth > (CKEDITOR.env.webkit ? 1 : 0) || b && m.is('br')) && !m.data('cke-bookmark')) { - if (K && CKEDITOR.dtd.$removeEmpty[m.getName()]) { - M = m.getText(); - if (d.test(M)) { - m = null; - } else { - for (var r = m.$.getElementsByTagName('*'), D = 0, B; B = r[D++];) { - if (!CKEDITOR.dtd.$removeEmpty[B.nodeName.toLowerCase()]) { - m = null; break; - } - } - }m && (A = !!M.length); - } else { - m = null; - } - }A && (K ? C ? k = l : l && this.setStartBefore(l) : K = !0); if (m) { - A = m.getPrevious(); if (!l && !A) { - l = m; m = null; break; - }m = A; - } else { - l = null; - } - } - }l && (l = c(l.getParent())); - }A = this.endContainer; r = this.endOffset; l = m = null; C = K = !1; A.type == CKEDITOR.NODE_TEXT ? CKEDITOR.tools.trim(A.substring(r)).length ? K = !0 : (K = !A.getLength(), r == A.getLength() ? (m = A.getNext()) || (l = A.getParent()) : - h(A, r) && (l = A.getParent())) : (m = A.getChild(r)) || (l = A); for (;l || m;) { - if (l && !m) { - !C && l.equals(n) && (C = !0); if (f ? l.isBlockBoundary() : !g.contains(l)) { - break; - } K && l.getComputedStyle('display') == 'inline' || (K = !1, C ? u = l : l && this.setEndAfter(l)); m = l.getNext(); - } for (;m;) { - A = !1; if (m.type == CKEDITOR.NODE_TEXT) { - M = m.getText(), h(m, 0) || (m = null), A = (/^[\s\ufeff]/).test(M); - } else if (m.type == CKEDITOR.NODE_ELEMENT) { - if ((m.$.offsetWidth > 0 || b && m.is('br')) && !m.data('cke-bookmark')) { - if (K && CKEDITOR.dtd.$removeEmpty[m.getName()]) { - M = m.getText(); if (d.test(M)) { - m = -null; - } else { - for (r = m.$.getElementsByTagName('*'), D = 0; B = r[D++];) { - if (!CKEDITOR.dtd.$removeEmpty[B.nodeName.toLowerCase()]) { - m = null; break; - } - } - }m && (A = !!M.length); - } else { - m = null; - } - } - } else { - A = 1; - }A && K && (C ? u = l : this.setEndAfter(l)); if (m) { - A = m.getNext(); if (!l && !A) { - l = m; m = null; break; - }m = A; - } else { - l = null; - } - }l && (l = c(l.getParent())); - }k && u && (n = k.contains(u) ? u : k, this.setStartBefore(n), this.setEndAfter(n)); break; case CKEDITOR.ENLARGE_BLOCK_CONTENTS:case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:l = new CKEDITOR.dom.range(this.root); g = this.root; l.setStartAt(g, - CKEDITOR.POSITION_AFTER_START); l.setEnd(this.startContainer, this.startOffset); l = new CKEDITOR.dom.walker(l); var v; var T; var S = CKEDITOR.dom.walker.blockBoundary(a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? { br: 1 } : null); var p = null; var N = function (a) { - if (a.type == CKEDITOR.NODE_ELEMENT && a.getAttribute('contenteditable') == 'false') { - if (p) { - if (p.equals(a)) { - p = null; return; - } - } else { - p = a; - } - } else if (p) { - return; - } var b = S(a); - - b || (v = a); return b; - }; var f = function (a) { - var b = N(a); - - !b && a.is && a.is('br') && (T = a); return b; - }; - - l.guard = N; l = l.lastBackward(); v = v || g; this.setStartAt(v, - !v.is('br') && (!l && this.checkStartOfBlock() || l && v.contains(l)) ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_AFTER_END); if (a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS) { - l = this.clone(); l = new CKEDITOR.dom.walker(l); var O = CKEDITOR.dom.walker.whitespaces(); var q = CKEDITOR.dom.walker.bookmark(); - - l.evaluator = function (a) { - return !O(a) && !q(a); - }; if ((l = l.previous()) && l.type == CKEDITOR.NODE_ELEMENT && l.is('br')) { - break; - } - }l = this.clone(); l.collapse(); l.setEndAt(g, CKEDITOR.POSITION_BEFORE_END); l = new CKEDITOR.dom.walker(l); l.guard = -a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? f : N; v = p = T = null; l = l.lastForward(); v = v || g; this.setEndAt(v, !l && this.checkEndOfBlock() || l && v.contains(l) ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_BEFORE_START); T && this.setEndAfter(T); - } - }, shrink: function (a, b, c) { - var d = typeof c === 'boolean' ? c : c && typeof c.shrinkOnBlockBoundary === 'boolean' ? c.shrinkOnBlockBoundary : !0; var f = c && c.skipBogus; - - if (!this.collapsed) { - a = a || CKEDITOR.SHRINK_TEXT; var h = this.clone(); var n = this.startContainer; var g = this.endContainer; var k = this.startOffset; var l = this.endOffset; - var u = c = 1; - - n && n.type == CKEDITOR.NODE_TEXT && (k ? k >= n.getLength() ? h.setStartAfter(n) : (h.setStartBefore(n), c = 0) : h.setStartBefore(n)); g && g.type == CKEDITOR.NODE_TEXT && (l ? l >= g.getLength() ? h.setEndAfter(g) : (h.setEndAfter(g), u = 0) : h.setEndBefore(g)); var h = new CKEDITOR.dom.walker(h); var m = CKEDITOR.dom.walker.bookmark(); var C = CKEDITOR.dom.walker.bogus(); - - h.evaluator = function (b) { - return b.type == (a == CKEDITOR.SHRINK_ELEMENT ? CKEDITOR.NODE_ELEMENT : CKEDITOR.NODE_TEXT); - }; var K; - - h.guard = function (b, c) { - if (f && C(b) || m(b)) { - return !0; - } if (a == CKEDITOR.SHRINK_ELEMENT && -b.type == CKEDITOR.NODE_TEXT || c && b.equals(K) || !1 === d && b.type == CKEDITOR.NODE_ELEMENT && b.isBlockBoundary() || b.type == CKEDITOR.NODE_ELEMENT && b.hasAttribute('contenteditable')) { - return !1; - } c || b.type != CKEDITOR.NODE_ELEMENT || (K = b); return !0; - }; c && (n = h[a == CKEDITOR.SHRINK_ELEMENT ? 'lastForward' : 'next']()) && this.setStartAt(n, b ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_START); u && (h.reset(), (h = h[a == CKEDITOR.SHRINK_ELEMENT ? 'lastBackward' : 'previous']()) && this.setEndAt(h, b ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_END)); - return !(!c && !u); - } - }, insertNode: function (a) { - this.optimizeBookmark(); this.trim(!1, !0); var b = this.startContainer; var c = b.getChild(this.startOffset); - - c ? a.insertBefore(c) : b.append(a); a.getParent() && a.getParent().equals(this.endContainer) && this.endOffset++; this.setStartBefore(a); - }, moveToPosition: function (a, b) { - this.setStartAt(a, b); this.collapse(!0); - }, moveToRange: function (a) { - this.setStart(a.startContainer, a.startOffset); this.setEnd(a.endContainer, a.endOffset); - }, selectNodeContents: function (a) { - this.setStart(a, 0); this.setEnd(a, - a.type == CKEDITOR.NODE_TEXT ? a.getLength() : a.getChildCount()); - }, setStart: function (b, c) { - b.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[b.getName()] && (c = b.getIndex(), b = b.getParent()); this._setStartContainer(b); this.startOffset = c; this.endContainer || (this._setEndContainer(b), this.endOffset = c); a(this); - }, setEnd: function (b, c) { - b.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[b.getName()] && (c = b.getIndex() + 1, b = b.getParent()); this._setEndContainer(b); this.endOffset = c; this.startContainer || (this._setStartContainer(b), - this.startOffset = c); a(this); - }, setStartAfter: function (a) { - this.setStart(a.getParent(), a.getIndex() + 1); - }, setStartBefore: function (a) { - this.setStart(a.getParent(), a.getIndex()); - }, setEndAfter: function (a) { - this.setEnd(a.getParent(), a.getIndex() + 1); - }, setEndBefore: function (a) { - this.setEnd(a.getParent(), a.getIndex()); - }, setStartAt: function (b, c) { - switch (c) { - case CKEDITOR.POSITION_AFTER_START:this.setStart(b, 0); break; case CKEDITOR.POSITION_BEFORE_END:b.type == CKEDITOR.NODE_TEXT ? this.setStart(b, b.getLength()) : this.setStart(b, - b.getChildCount()); break; case CKEDITOR.POSITION_BEFORE_START:this.setStartBefore(b); break; case CKEDITOR.POSITION_AFTER_END:this.setStartAfter(b); - }a(this); - }, setEndAt: function (b, c) { - switch (c) { - case CKEDITOR.POSITION_AFTER_START:this.setEnd(b, 0); break; case CKEDITOR.POSITION_BEFORE_END:b.type == CKEDITOR.NODE_TEXT ? this.setEnd(b, b.getLength()) : this.setEnd(b, b.getChildCount()); break; case CKEDITOR.POSITION_BEFORE_START:this.setEndBefore(b); break; case CKEDITOR.POSITION_AFTER_END:this.setEndAfter(b); - }a(this); - }, fixBlock: function (a, - b) { - var c = this.createBookmark(); var d = this.document.createElement(b); - - this.collapse(a); this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS); this.extractContents().appendTo(d); d.trim(); this.insertNode(d); var f = d.getBogus(); - - f && f.remove(); d.appendBogus(); this.moveToBookmark(c); return d; - }, splitBlock: function (a, b) { - var c = new CKEDITOR.dom.elementPath(this.startContainer, this.root); var d = new CKEDITOR.dom.elementPath(this.endContainer, this.root); var f = c.block; var h = d.block; var n = null; - - if (!c.blockLimit.equals(d.blockLimit)) { - return null; - } a != -'br' && (f || (f = this.fixBlock(!0, a), h = new CKEDITOR.dom.elementPath(this.endContainer, this.root).block), h || (h = this.fixBlock(!1, a))); c = f && this.checkStartOfBlock(); d = h && this.checkEndOfBlock(); this.deleteContents(); f && f.equals(h) && (d ? (n = new CKEDITOR.dom.elementPath(this.startContainer, this.root), this.moveToPosition(h, CKEDITOR.POSITION_AFTER_END), h = null) : c ? (n = new CKEDITOR.dom.elementPath(this.startContainer, this.root), this.moveToPosition(f, CKEDITOR.POSITION_BEFORE_START), f = null) : (h = this.splitElement(f, b || -!1), f.is('ul', 'ol') || f.appendBogus())); return { previousBlock: f, nextBlock: h, wasStartOfBlock: c, wasEndOfBlock: d, elementPath: n }; - }, splitElement: function (a, b) { - if (!this.collapsed) { - return null; - } this.setEndAt(a, CKEDITOR.POSITION_BEFORE_END); var c = this.extractContents(!1, b || !1); var d = a.clone(!1, b || !1); - - c.appendTo(d); d.insertAfter(a); this.moveToPosition(a, CKEDITOR.POSITION_AFTER_END); return d; - }, removeEmptyBlocksAtEnd: (function () { - function a(e) { - return function (a) { - return b(a) || c(a) || a.type == CKEDITOR.NODE_ELEMENT && a.isEmptyInlineRemoveable() || -e.is('table') && a.is('caption') ? !1 : !0; - }; - } var b = CKEDITOR.dom.walker.whitespaces(); var c = CKEDITOR.dom.walker.bookmark(!1); - - return function (b) { - for (var c = this.createBookmark(), d = this[b ? 'endPath' : 'startPath'](), f = d.block || d.blockLimit, h; f && !f.equals(d.root) && !f.getFirst(a(f));) { - h = f.getParent(), this[b ? 'setEndAt' : 'setStartAt'](f, CKEDITOR.POSITION_AFTER_END), f.remove(1), f = h; - } this.moveToBookmark(c); - }; - })(), startPath: function () { - return new CKEDITOR.dom.elementPath(this.startContainer, this.root); - }, endPath: function () { - return new CKEDITOR.dom.elementPath(this.endContainer, - this.root); - }, checkBoundaryOfElement: function (a, b) { - var d = b == CKEDITOR.START; var f = this.clone(); - - f.collapse(d); f[d ? 'setStartAt' : 'setEndAt'](a, d ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END); f = new CKEDITOR.dom.walker(f); f.evaluator = c(d); return f[d ? 'checkBackward' : 'checkForward'](); - }, checkStartOfBlock: function () { - var a = this.startContainer; var c = this.startOffset; - - CKEDITOR.env.ie && c && a.type == CKEDITOR.NODE_TEXT && (a = CKEDITOR.tools.ltrim(a.substring(0, c)), g.test(a) && this.trim(0, 1)); this.trim(); a = new CKEDITOR.dom.elementPath(this.startContainer, - this.root); c = this.clone(); c.collapse(!0); c.setStartAt(a.block || a.blockLimit, CKEDITOR.POSITION_AFTER_START); a = new CKEDITOR.dom.walker(c); a.evaluator = b(); return a.checkBackward(); - }, checkEndOfBlock: function () { - var a = this.endContainer; var c = this.endOffset; - - CKEDITOR.env.ie && a.type == CKEDITOR.NODE_TEXT && (a = CKEDITOR.tools.rtrim(a.substring(c)), g.test(a) && this.trim(1, 0)); this.trim(); a = new CKEDITOR.dom.elementPath(this.endContainer, this.root); c = this.clone(); c.collapse(!1); c.setEndAt(a.block || a.blockLimit, CKEDITOR.POSITION_BEFORE_END); - a = new CKEDITOR.dom.walker(c); a.evaluator = b(); return a.checkForward(); - }, getPreviousNode: function (a, b, c) { - var d = this.clone(); - - d.collapse(1); d.setStartAt(c || this.root, CKEDITOR.POSITION_AFTER_START); c = new CKEDITOR.dom.walker(d); c.evaluator = a; c.guard = b; return c.previous(); - }, getNextNode: function (a, b, c) { - var d = this.clone(); - - d.collapse(); d.setEndAt(c || this.root, CKEDITOR.POSITION_BEFORE_END); c = new CKEDITOR.dom.walker(d); c.evaluator = a; c.guard = b; return c.next(); - }, checkReadOnly: (function () { - function a(b, c) { - for (;b;) { - if (b.type == -CKEDITOR.NODE_ELEMENT) { - if (b.getAttribute('contentEditable') == 'false' && !b.data('cke-editable')) { - return 0; - } if (b.is('html') || b.getAttribute('contentEditable') == 'true' && (b.contains(c) || b.equals(c))) { - break; - } - }b = b.getParent(); - } return 1; - } return function () { - var b = this.startContainer; var c = this.endContainer; - - return !(a(b, c) && a(c, b)); - }; - })(), moveToElementEditablePosition: function (a, b) { - if (a.type == CKEDITOR.NODE_ELEMENT && !a.isEditable(!1)) { - return this.moveToPosition(a, b ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START), - !0; - } for (var c = 0; a;) { - if (a.type == CKEDITOR.NODE_TEXT) { - b && this.endContainer && this.checkEndOfBlock() && g.test(a.getText()) ? this.moveToPosition(a, CKEDITOR.POSITION_BEFORE_START) : this.moveToPosition(a, b ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START); c = 1; break; - } if (a.type == CKEDITOR.NODE_ELEMENT) { - if (a.isEditable()) { - this.moveToPosition(a, b ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_START), c = 1; - } else if (b && a.is('br') && this.endContainer && this.checkEndOfBlock()) { - this.moveToPosition(a, CKEDITOR.POSITION_BEFORE_START); - } else if (a.getAttribute('contenteditable') == 'false' && a.is(CKEDITOR.dtd.$block)) { - return this.setStartBefore(a), this.setEndAfter(a), !0; - } - } var d = a; var f = c; var h = void 0; - - d.type == CKEDITOR.NODE_ELEMENT && d.isEditable(!1) && (h = d[b ? 'getLast' : 'getFirst'](u)); f || h || (h = d[b ? 'getPrevious' : 'getNext'](u)); a = h; - } return !!c; - }, moveToClosestEditablePosition: function (a, b) { - var c; var d = 0; var f; var h; var n = [CKEDITOR.POSITION_AFTER_END, CKEDITOR.POSITION_BEFORE_START]; - - a ? (c = new CKEDITOR.dom.range(this.root), c.moveToPosition(a, n[b ? 0 : 1])) : c = this.clone(); if (a && -!a.is(CKEDITOR.dtd.$block)) { - d = 1; - } else if (f = c[b ? 'getNextEditableNode' : 'getPreviousEditableNode']()) { - d = 1, (h = f.type == CKEDITOR.NODE_ELEMENT) && f.is(CKEDITOR.dtd.$block) && f.getAttribute('contenteditable') == 'false' ? (c.setStartAt(f, CKEDITOR.POSITION_BEFORE_START), c.setEndAt(f, CKEDITOR.POSITION_AFTER_END)) : !CKEDITOR.env.needsBrFiller && h && f.is(CKEDITOR.dom.walker.validEmptyBlockContainers) ? (c.setEnd(f, 0), c.collapse()) : c.moveToPosition(f, n[b ? 1 : 0]); - }d && this.moveToRange(c); return !!d; - }, moveToElementEditStart: function (a) { - return this.moveToElementEditablePosition(a); - }, - moveToElementEditEnd: function (a) { - return this.moveToElementEditablePosition(a, !0); - }, getEnclosedNode: function () { - var a = this.clone(); - - a.optimize(); if (a.startContainer.type != CKEDITOR.NODE_ELEMENT || a.endContainer.type != CKEDITOR.NODE_ELEMENT) { - return null; - } var a = new CKEDITOR.dom.walker(a); var b = CKEDITOR.dom.walker.bookmark(!1, !0); var c = CKEDITOR.dom.walker.whitespaces(!0); - - a.evaluator = function (a) { - return c(a) && b(a); - }; var d = a.next(); - - a.reset(); return d && d.equals(a.previous()) ? d : null; - }, getTouchedStartNode: function () { - var a = this.startContainer; - - return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.startOffset) || a; - }, getTouchedEndNode: function () { - var a = this.endContainer; - - return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.endOffset - 1) || a; - }, getNextEditableNode: f(), getPreviousEditableNode: f(1), _getTableElement: function (a) { - a = a || { td: 1, th: 1, tr: 1, tbody: 1, thead: 1, tfoot: 1, table: 1 }; var b = this.getTouchedStartNode(); var c = this.getTouchedEndNode(); var d = b.getAscendant('table', !0); var c = c.getAscendant('table', !0); - - return d && !this.root.contains(d) ? - null : this.getEnclosedNode() ? this.getEnclosedNode().getAscendant(a, !0) : d && c && (d.equals(c) || d.contains(c) || c.contains(d)) ? b.getAscendant(a, !0) : null; - }, scrollIntoView: function () { - var a = new CKEDITOR.dom.element.createFromHtml('\x3cspan\x3e\x26nbsp;\x3c/span\x3e', this.document); var b; var c; var d; var f = this.clone(); - - f.optimize(); (d = f.startContainer.type == CKEDITOR.NODE_TEXT) ? (c = f.startContainer.getText(), b = f.startContainer.split(f.startOffset), a.insertAfter(f.startContainer)) : f.insertNode(a); a.scrollIntoView(); d && (f.startContainer.setText(c), - b.remove()); a.remove(); - }, getClientRects: (function () { - function a(b, c) { - var d = CKEDITOR.tools.array.map(b, function (a) { - return a; - }); var e = new CKEDITOR.dom.range(c.root); var f; var h; var g; - - c.startContainer instanceof CKEDITOR.dom.element && (h = c.startOffset === 0 && c.startContainer.hasAttribute('data-widget')); c.endContainer instanceof CKEDITOR.dom.element && (g = (g = c.endOffset === (c.endContainer.getChildCount ? c.endContainer.getChildCount() : c.endContainer.length)) && c.endContainer.hasAttribute('data-widget')); h && e.setStart(c.startContainer.getParent(), - c.startContainer.getIndex()); g && e.setEnd(c.endContainer.getParent(), c.endContainer.getIndex() + 1); if (h || g) { - c = e; - }e = c.cloneContents().find('[data-cke-widget-id]').toArray(); if (e = CKEDITOR.tools.array.map(e, function (a) { - var b = c.root.editor; - - a = a.getAttribute('data-cke-widget-id'); return b.widgets.instances[a].element; - })) { - return e = CKEDITOR.tools.array.map(e, function (a) { - var b; - - b = a.getParent().hasClass('cke_widget_wrapper') ? a.getParent() : a; f = this.root.getDocument().$.createRange(); f.setStart(b.getParent().$, b.getIndex()); - f.setEnd(b.getParent().$, b.getIndex() + 1); b = f.getClientRects(); b.widgetRect = a.getClientRect(); return b; - }, c), CKEDITOR.tools.array.forEach(e, function (a) { - function b(e) { - CKEDITOR.tools.array.forEach(d, function (b, f) { - var h = CKEDITOR.tools.objectCompare(a[e], b); - - h || (h = CKEDITOR.tools.objectCompare(a.widgetRect, b)); h && (Array.prototype.splice.call(d, f, a.length - e, a.widgetRect), c = !0); - }); c || (e < d.length - 1 ? b(e + 1) : d.push(a.widgetRect)); - } var c; - - b(0); - }), d; - } - } function b(a, c, e) { - var f; - - c.collapsed ? e.startContainer instanceof CKEDITOR.dom.element ? - (a = e.checkStartOfBlock(), f = new CKEDITOR.dom.text('​'), a ? e.startContainer.append(f, !0) : e.startOffset === 0 ? f.insertBefore(e.startContainer.getFirst()) : (e = e.startContainer.getChildren().getItem(e.startOffset - 1), f.insertAfter(e)), c.setStart(f.$, 0), c.setEnd(f.$, 0), a = c.getClientRects(), f.remove()) : e.startContainer instanceof CKEDITOR.dom.text && (e.startContainer.getText() === '' ? (e.startContainer.setText('​'), a = c.getClientRects(), e.startContainer.setText('')) : a = [d(e.createBookmark())]) : a = [d(e.createBookmark())]; - return a; - } function c(a, b, d) { - a = CKEDITOR.tools.extend({}, a); b && (a = CKEDITOR.tools.getAbsoluteRectPosition(d.document.getWindow(), a)); !a.width && (a.width = a.right - a.left); !a.height && (a.height = a.bottom - a.top); return a; - } function d(a) { - var b = a.startNode; - - a = a.endNode; var c; - - b.setText('​'); b.removeStyle('display'); a ? (a.setText('​'), a.removeStyle('display'), c = [b.getClientRect(), a.getClientRect()], a.remove()) : c = [b.getClientRect(), b.getClientRect()]; b.remove(); return { right: Math.max(c[0].right, c[1].right), bottom: Math.max(c[0].bottom, - c[1].bottom), left: Math.min(c[0].left, c[1].left), top: Math.min(c[0].top, c[1].top), width: Math.abs(c[0].left - c[1].left), height: Math.max(c[0].bottom, c[1].bottom) - Math.min(c[0].top, c[1].top) }; - } return void 0 !== this.document.getSelection ? function (d) { - var f = this.root.getDocument().$.createRange(); var n; - - f.setStart(this.startContainer.$, this.startOffset); f.setEnd(this.endContainer.$, this.endOffset); n = f.getClientRects(); n = a(n, this); n.length || (n = b(n, f, this)); return CKEDITOR.tools.array.map(n, function (a) { - return c(a, - d, this); - }, this); - } : function (a) { - return [c(d(this.createBookmark()), a, this)]; - }; - })(), _setStartContainer: function (a) { - this.startContainer = a; - }, _setEndContainer: function (a) { - this.endContainer = a; - }, _find: function (a, b) { - var c = this.getCommonAncestor(); var d = this.getBoundaryNodes(); var f = []; var h; var n; var g; var k; - - if (c && c.find) { - for (n = c.find(a), h = 0; h < n.count(); h++) { - if (c = n.getItem(h), b || !c.isReadOnly()) { - g = c.getPosition(d.startNode) & CKEDITOR.POSITION_FOLLOWING || d.startNode.equals(c), k = c.getPosition(d.endNode) & CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_IS_CONTAINED || -d.endNode.equals(c), g && k && f.push(c); - } - } - } return f; - } }; CKEDITOR.dom.range.mergeRanges = function (a) { - return CKEDITOR.tools.array.reduce(a, function (a, b) { - var c = a[a.length - 1]; var d = !1; - - b = b.clone(); b.enlarge(CKEDITOR.ENLARGE_ELEMENT); if (c) { - var e = new CKEDITOR.dom.range(b.root); var d = new CKEDITOR.dom.walker(e); var f = CKEDITOR.dom.walker.whitespaces(); - - e.setStart(c.endContainer, c.endOffset); e.setEnd(b.startContainer, b.startOffset); for (e = d.next(); f(e) || b.endContainer.equals(e);) { - e = d.next(); - }d = !e; - }d ? c.setEnd(b.endContainer, b.endOffset) : - a.push(b); return a; - }, []); - }; - })(); CKEDITOR.POSITION_AFTER_START = 1; CKEDITOR.POSITION_BEFORE_END = 2; CKEDITOR.POSITION_BEFORE_START = 3; CKEDITOR.POSITION_AFTER_END = 4; CKEDITOR.ENLARGE_ELEMENT = 1; CKEDITOR.ENLARGE_BLOCK_CONTENTS = 2; CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS = 3; CKEDITOR.ENLARGE_INLINE = 4; CKEDITOR.START = 1; CKEDITOR.END = 2; CKEDITOR.SHRINK_ELEMENT = 1; CKEDITOR.SHRINK_TEXT = 2; 'use strict'; - (function () { - function a(a) { - arguments.length < 1 || (this.range = a, this.forceBrBreak = 0, this.enlargeBr = 1, this.enforceRealBlocks = 0, this._ || (this._ = {})); - } function d(a) { - var b = []; - - a.forEach(function (a) { - if (a.getAttribute('contenteditable') == 'true') { - return b.push(a), !1; - } - }, CKEDITOR.NODE_ELEMENT, !0); return b; - } function b(a, c, f, h) { - a: { - h == null && (h = d(f)); for (var g; g = h.shift();) { - if (g.getDtd().p) { - h = { element: g, remaining: h }; break a; - } - }h = null; - } if (!h) { - return 0; - } if ((g = CKEDITOR.filter.instances[h.element.data('cke-filter')]) && !g.check(c)) { - return b(a, - c, f, h.remaining); - } c = new CKEDITOR.dom.range(h.element); c.selectNodeContents(h.element); c = c.createIterator(); c.enlargeBr = a.enlargeBr; c.enforceRealBlocks = a.enforceRealBlocks; c.activeFilter = c.filter = g; a._.nestedEditable = { element: h.element, container: f, remaining: h.remaining, iterator: c }; return 1; - } function c(a, b, c) { - if (!b) { - return !1; - } a = a.clone(); a.collapse(!c); return a.checkBoundaryOfElement(b, c ? CKEDITOR.START : CKEDITOR.END); - } var f = /^[\r\n\t ]+$/; var h = CKEDITOR.dom.walker.bookmark(!1, !0); var k = CKEDITOR.dom.walker.whitespaces(!0); - var g = function (a) { - return h(a) && k(a); - }; var l = { dd: 1, dt: 1, li: 1 }; - - a.prototype = { getNextParagraph: function (a) { - var d; var k; var w; var z; var G; - - a = a || 'p'; if (this._.nestedEditable) { - if (d = this._.nestedEditable.iterator.getNextParagraph(a)) { - return this.activeFilter = this._.nestedEditable.iterator.activeFilter, d; - } this.activeFilter = this.filter; if (b(this, a, this._.nestedEditable.container, this._.nestedEditable.remaining)) { - return this.activeFilter = this._.nestedEditable.iterator.activeFilter, this._.nestedEditable.iterator.getNextParagraph(a); - } this._.nestedEditable = -null; - } if (!this.range.root.getDtd()[a]) { - return null; - } if (!this._.started) { - var t = this.range.clone(); - - k = t.startPath(); var n = t.endPath(); var L = !t.collapsed && c(t, k.block); var y = !t.collapsed && c(t, n.block, 1); - - t.shrink(CKEDITOR.SHRINK_ELEMENT, !0); L && t.setStartAt(k.block, CKEDITOR.POSITION_BEFORE_END); y && t.setEndAt(n.block, CKEDITOR.POSITION_AFTER_START); k = t.endContainer.hasAscendant('pre', !0) || t.startContainer.hasAscendant('pre', !0); t.enlarge(this.forceBrBreak && !k || !this.enlargeBr ? CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS); - t.collapsed || (k = new CKEDITOR.dom.walker(t.clone()), n = CKEDITOR.dom.walker.bookmark(!0, !0), k.evaluator = n, this._.nextNode = k.next(), k = new CKEDITOR.dom.walker(t.clone()), k.evaluator = n, k = k.previous(), this._.lastNode = k.getNextSourceNode(!0, null, t.root), this._.lastNode && this._.lastNode.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(this._.lastNode.getText()) && this._.lastNode.getParent().isBlockBoundary() && (n = this.range.clone(), n.moveToPosition(this._.lastNode, CKEDITOR.POSITION_AFTER_END), n.checkEndOfBlock() && -(n = new CKEDITOR.dom.elementPath(n.endContainer, n.root), this._.lastNode = (n.block || n.blockLimit).getNextSourceNode(!0))), this._.lastNode && t.root.contains(this._.lastNode) || (this._.lastNode = this._.docEndMarker = t.document.createText(''), this._.lastNode.insertAfter(k)), t = null); this._.started = 1; k = t; - }n = this._.nextNode; t = this._.lastNode; for (this._.nextNode = null; n;) { - var L = 0; var y = n.hasAscendant('pre'); var H = n.type != CKEDITOR.NODE_ELEMENT; var I = 0; - - if (H) { - n.type == CKEDITOR.NODE_TEXT && f.test(n.getText()) && (H = 0); - } else { - var m = n.getName(); - - if (CKEDITOR.dtd.$block[m] && n.getAttribute('contenteditable') == 'false') { - d = n; b(this, a, d); break; - } else if (n.isBlockBoundary(this.forceBrBreak && !y && { br: 1 })) { - if (m == 'br') { - H = 1; - } else if (!k && !n.getChildCount() && m != 'hr') { - d = n; w = n.equals(t); break; - }k && (k.setEndAt(n, CKEDITOR.POSITION_BEFORE_START), m != 'br' && (this._.nextNode = n)); L = 1; - } else { - if (n.getFirst()) { - k || (k = this.range.clone(), k.setStartAt(n, CKEDITOR.POSITION_BEFORE_START)); n = n.getFirst(); continue; - }H = 1; - } - }H && !k && (k = this.range.clone(), k.setStartAt(n, CKEDITOR.POSITION_BEFORE_START)); - w = (!L || H) && n.equals(t); if (k && !L) { - for (;!n.getNext(g) && !w;) { - m = n.getParent(); if (m.isBlockBoundary(this.forceBrBreak && !y && { br: 1 })) { - L = 1; H = 0; w || m.equals(t); k.setEndAt(m, CKEDITOR.POSITION_BEFORE_END); break; - }n = m; H = 1; w = n.equals(t); I = 1; - } - }H && k.setEndAt(n, CKEDITOR.POSITION_AFTER_END); n = this._getNextSourceNode(n, I, t); if ((w = !n) || L && k) { - break; - } - } if (!d) { - if (!k) { - return this._.docEndMarker && this._.docEndMarker.remove(), this._.nextNode = null; - } d = new CKEDITOR.dom.elementPath(k.startContainer, k.root); n = d.blockLimit; L = { div: 1, th: 1, td: 1 }; - d = d.block; !d && n && !this.enforceRealBlocks && L[n.getName()] && k.checkStartOfBlock() && k.checkEndOfBlock() && !n.equals(k.root) ? d = n : !d || this.enforceRealBlocks && d.is(l) ? (d = this.range.document.createElement(a), k.extractContents().appendTo(d), d.trim(), k.insertNode(d), z = G = !0) : d.getName() != 'li' ? k.checkStartOfBlock() && k.checkEndOfBlock() || (d = d.clone(!1), k.extractContents().appendTo(d), d.trim(), G = k.splitBlock(), z = !G.wasStartOfBlock, G = !G.wasEndOfBlock, k.insertNode(d)) : w || (this._.nextNode = d.equals(t) ? null : this._getNextSourceNode(k.getBoundaryNodes().endNode, - 1, t)); - }z && (z = d.getPrevious()) && z.type == CKEDITOR.NODE_ELEMENT && (z.getName() == 'br' ? z.remove() : z.getLast() && z.getLast().$.nodeName.toLowerCase() == 'br' && z.getLast().remove()); G && (z = d.getLast()) && z.type == CKEDITOR.NODE_ELEMENT && z.getName() == 'br' && (!CKEDITOR.env.needsBrFiller || z.getPrevious(h) || z.getNext(h)) && z.remove(); this._.nextNode || (this._.nextNode = w || d.equals(t) || !t ? null : this._getNextSourceNode(d, 1, t)); return d; - }, _getNextSourceNode: function (a, b, c) { - function d(a) { - return !(a.equals(c) || a.equals(f)); - } var f = -this.range.root; - - for (a = a.getNextSourceNode(b, null, d); !h(a);) { - a = a.getNextSourceNode(b, null, d); - } return a; - } }; CKEDITOR.dom.range.prototype.createIterator = function () { - return new a(this); - }; - })(); - CKEDITOR.command = function (a, d) { - this.uiItems = []; this.exec = function (b) { - if (this.state == CKEDITOR.TRISTATE_DISABLED || !this.checkAllowed()) { - return !1; - } this.editorFocus && a.focus(); return !1 === this.fire('exec') ? !0 : !1 !== d.exec.call(this, a, b); - }; this.refresh = function (a, b) { - if (!this.readOnly && a.readOnly) { - return !0; - } if (this.context && !b.isContextFor(this.context) || !this.checkAllowed(!0)) { - return this.disable(), !0; - } this.startDisabled || this.enable(); this.modes && !this.modes[a.mode] && this.disable(); return !1 === this.fire('refresh', - { editor: a, path: b }) ? !0 : d.refresh && !1 !== d.refresh.apply(this, arguments); - }; var b; - - this.checkAllowed = function (c) { - return c || typeof b !== 'boolean' ? b = a.activeFilter.checkFeature(this) : b; - }; CKEDITOR.tools.extend(this, d, { modes: { wysiwyg: 1 }, editorFocus: 1, contextSensitive: !!d.context, state: CKEDITOR.TRISTATE_DISABLED }); CKEDITOR.event.call(this); - }; - CKEDITOR.command.prototype = { enable: function () { - this.state == CKEDITOR.TRISTATE_DISABLED && this.checkAllowed() && this.setState(this.preserveState && typeof this.previousState !== 'undefined' ? this.previousState : CKEDITOR.TRISTATE_OFF); - }, disable: function () { - this.setState(CKEDITOR.TRISTATE_DISABLED); - }, setState: function (a) { - if (this.state == a || a != CKEDITOR.TRISTATE_DISABLED && !this.checkAllowed()) { - return !1; - } this.previousState = this.state; this.state = a; this.fire('state'); return !0; - }, toggleState: function () { - this.state == CKEDITOR.TRISTATE_OFF ? - this.setState(CKEDITOR.TRISTATE_ON) : this.state == CKEDITOR.TRISTATE_ON && this.setState(CKEDITOR.TRISTATE_OFF); - } }; CKEDITOR.event.implementOn(CKEDITOR.command.prototype); CKEDITOR.ENTER_P = 1; CKEDITOR.ENTER_BR = 2; CKEDITOR.ENTER_DIV = 3; - CKEDITOR.config = { customConfig: 'config.js', autoUpdateElement: !0, language: '', defaultLanguage: 'en', contentsLangDirection: '', enterMode: CKEDITOR.ENTER_P, forceEnterMode: !1, shiftEnterMode: CKEDITOR.ENTER_BR, docType: '\x3c!DOCTYPE html\x3e', bodyId: '', bodyClass: '', fullPage: !1, height: 200, contentsCss: CKEDITOR.getUrl('contents.css'), extraPlugins: '', removePlugins: '', protectedSource: [], tabIndex: 0, width: '', baseFloatZIndex: 1E4, blockedKeystrokes: [CKEDITOR.CTRL + 66, CKEDITOR.CTRL + 73, CKEDITOR.CTRL + 85] }; - (function () { - function a(a, b, c, d, e) { - var f; var m; - - a = []; for (f in b) { - m = b[f]; m = typeof m === 'boolean' ? {} : typeof m === 'function' ? { match: m } : D(m); f.charAt(0) != '$' && (m.elements = f); c && (m.featureName = c.toLowerCase()); var q = m; - - q.elements = k(q.elements, /\s+/) || null; q.propertiesOnly = q.propertiesOnly || !0 === q.elements; var r = /\s*,\s*/; var B = void 0; - - for (B in T) { - q[B] = k(q[B], r) || null; var h = q; var p = S[B]; var n = k(q[S[B]], r); var g = q[B]; var v = []; var F = !0; var N = void 0; - - n ? F = !1 : n = {}; for (N in g) { - N.charAt(0) == '!' && (N = N.slice(1), v.push(N), n[N] = !0, F = !1); - } for (;N = v.pop();) { - g[N] = -g['!' + N], delete g['!' + N]; - }h[p] = (F ? !1 : n) || null; - }q.match = q.match || null; d.push(m); a.push(m); - }b = e.elements; e = e.generic; var C; - - c = 0; for (d = a.length; c < d; ++c) { - f = D(a[c]); m = !0 === f.classes || !0 === f.styles || !0 === f.attributes; q = f; B = p = r = void 0; for (r in T) { - q[r] = L(q[r]); - }h = !0; for (B in S) { - r = S[B]; p = q[r]; n = []; g = void 0; for (g in p) { - g.indexOf('*') > -1 ? n.push(new RegExp('^' + g.replace(/\*/g, '.*') + '$')) : n.push(g); - } p = n; p.length && (q[r] = p, h = !1); - }q.nothingRequired = h; q.noProperties = !(q.attributes || q.classes || q.styles); if (!0 === f.elements || -f.elements === null) { - e[m ? 'unshift' : 'push'](f); - } else { - for (C in q = f.elements, delete f.elements, q) { - if (b[C]) { - b[C][m ? 'unshift' : 'push'](f); - } else { - b[C] = [f]; - } - } - } - } - } function d(a, c, d, e) { - if (!a.match || a.match(c)) { - if (e || g(a, c)) { - if (a.propertiesOnly || (d.valid = !0), d.allAttributes || (d.allAttributes = b(a.attributes, c.attributes, d.validAttributes)), d.allStyles || (d.allStyles = b(a.styles, c.styles, d.validStyles)), !d.allClasses) { - a = a.classes; c = c.classes; e = d.validClasses; if (a) { - if (!0 === a) { - a = !0; - } else { - for (var f = 0, m = c.length, q; f < m; ++f) { - q = c[f], e[q] || -(e[q] = a(q)); - }a = !1; - } - } else { - a = !1; - }d.allClasses = a; - } - } - } - } function b(a, b, c) { - if (!a) { - return !1; - } if (!0 === a) { - return !0; - } for (var d in b) { - c[d] || (c[d] = a(d)); - } return !1; - } function c(a, b, c) { - if (!a.match || a.match(b)) { - if (a.noProperties) { - return !1; - } c.hadInvalidAttribute = f(a.attributes, b.attributes) || c.hadInvalidAttribute; c.hadInvalidStyle = f(a.styles, b.styles) || c.hadInvalidStyle; a = a.classes; b = b.classes; if (a) { - for (var d = !1, e = !0 === a, m = b.length; m--;) { - if (e || a(b[m])) { - b.splice(m, 1), d = !0; - } - }a = d; - } else { - a = !1; - }c.hadInvalidClass = a || c.hadInvalidClass; - } - } function f(a, - b) { - if (!a) { - return !1; - } var c = !1; var d = !0 === a; var e; - - for (e in b) { - if (d || a(e)) { - delete b[e], c = !0; - } - } return c; - } function h(a, b, c) { - if (a.disabled || a.customConfig && !c || !b) { - return !1; - } a._.cachedChecks = {}; return !0; - } function k(a, b) { - if (!a) { - return !1; - } if (!0 === a) { - return a; - } if (typeof a === 'string') { - return a = B(a), a == '*' ? !0 : CKEDITOR.tools.convertArrayToObject(a.split(b)); - } if (CKEDITOR.tools.isArray(a)) { - return a.length ? CKEDITOR.tools.convertArrayToObject(a) : !1; - } var c = {}; var d = 0; var e; - - for (e in a) { - c[e] = a[e], d++; - } return d ? c : !1; - } function g(a, b) { - if (a.nothingRequired) { - return !0; - } - var c; var d; var e; var f; - - if (e = a.requiredClasses) { - for (f = b.classes, c = 0; c < e.length; ++c) { - if (d = e[c], typeof d === 'string') { - if (CKEDITOR.tools.indexOf(f, d) == -1) { - return !1; - } - } else if (!CKEDITOR.tools.checkIfAnyArrayItemMatches(f, d)) { - return !1; - } - } - } return l(b.styles, a.requiredStyles) && l(b.attributes, a.requiredAttributes); - } function l(a, b) { - if (!b) { - return !0; - } for (var c = 0, d; c < b.length; ++c) { - if (d = b[c], typeof d === 'string') { - if (!(d in a)) { - return !1; - } - } else if (!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a, d)) { - return !1; - } - } return !0; - } function u(a) { - if (!a) { - return {}; - } - a = a.split(/\s*,\s*/).sort(); for (var b = {}; a.length;) { - b[a.shift()] = 'cke-test'; - } return b; - } function e(a) { - var b; var c; var d; var e; var f = {}; var m = 1; - - for (a = B(a); b = a.match(p);) { - (c = b[2]) ? (d = x(c, 'styles'), e = x(c, 'attrs'), c = x(c, 'classes')) : d = e = c = null, f['$' + m++] = { elements: b[1], classes: c, styles: d, attributes: e }, a = a.slice(b[0].length); - } return f; - } function x(a, b) { - var c = a.match(N[b]); - - return c ? B(c[1]) : null; - } function w(a) { - var b = a.styleBackup = a.attributes.style; var c = a.classBackup = a.attributes.class; - - a.styles || (a.styles = CKEDITOR.tools.parseCssText(b || -'', 1)); a.classes || (a.classes = c ? c.split(/\s+/) : []); - } function z(a, b, e, f) { - var r = 0; var B; - - f.toHtml && (b.name = b.name.replace(O, '$1')); if (f.doCallbacks && a.elementCallbacks) { - a: { - B = a.elementCallbacks; for (var p = 0, h = B.length, g; p < h; ++p) { - if (g = B[p](b)) { - B = g; break a; - } - }B = void 0; - } if (B) { - return B; - } - } if (f.doTransform && (B = a._.transformations[b.name])) { - w(b); for (p = 0; p < B.length; ++p) { - m(a, b, B[p]); - }t(b); - } if (f.doFilter) { - a: { - p = b.name; h = a._; a = h.allowedRules.elements[p]; B = h.allowedRules.generic; p = h.disallowedRules.elements[p]; h = h.disallowedRules.generic; - g = f.skipRequired; var k = { valid: !1, validAttributes: {}, validClasses: {}, validStyles: {}, allAttributes: !1, allClasses: !1, allStyles: !1, hadInvalidAttribute: !1, hadInvalidClass: !1, hadInvalidStyle: !1 }; var v; var D; - - if (a || B) { - w(b); if (p) { - for (v = 0, D = p.length; v < D; ++v) { - if (!1 === c(p[v], b, k)) { - a = null; break a; - } - } - } if (h) { - for (v = 0, D = h.length; v < D; ++v) { - c(h[v], b, k); - } - } if (a) { - for (v = 0, D = a.length; v < D; ++v) { - d(a[v], b, k, g); - } - } if (B) { - for (v = 0, D = B.length; v < D; ++v) { - d(B[v], b, k, g); - } - }a = k; - } else { - a = null; - } - } if (!a || !a.valid) { - return e.push(b), 1; - } D = a.validAttributes; var N = a.validStyles; - - B = a.validClasses; var p = b.attributes; var F = b.styles; var h = b.classes; - - g = b.classBackup; var C = b.styleBackup; var A; var K; var l = []; var k = []; var M = /^data-cke-/; - - v = !1; delete p.style; delete p.class; delete b.classBackup; delete b.styleBackup; if (!a.allAttributes) { - for (A in p) { - D[A] || (M.test(A) ? A == (K = A.replace(/^data-cke-saved-/, '')) || D[K] || (delete p[A], v = !0) : (delete p[A], v = !0)); - } - } if (!a.allStyles || a.hadInvalidStyle) { - for (A in F) { - a.allStyles || N[A] ? l.push(A + ':' + F[A]) : v = !0; - }l.length && (p.style = l.sort().join('; ')); - } else { - C && (p.style = C); - } if (!a.allClasses || -a.hadInvalidClass) { - for (A = 0; A < h.length; ++A) { - (a.allClasses || B[h[A]]) && k.push(h[A]); - }k.length && (p.class = k.sort().join(' ')); g && k.length < g.split(/\s+/).length && (v = !0); - } else { - g && (p.class = g); - }v && (r = 1); if (!f.skipFinalValidation && !n(b)) { - return e.push(b), 1; - } - }f.toHtml && (b.name = b.name.replace(q, 'cke:$1')); return r; - } function G(a) { - var b = []; var c; - - for (c in a) { - c.indexOf('*') > -1 && b.push(c.replace(/\*/g, '.*')); - } return b.length ? new RegExp('^(?:' + b.join('|') + ')$') : null; - } function t(a) { - var b = a.attributes; var c; - - delete b.style; delete b.class; - if (c = CKEDITOR.tools.writeCssText(a.styles, !0)) { - b.style = c; - }a.classes.length && (b.class = a.classes.sort().join(' ')); - } function n(a) { - switch (a.name) { - case 'a':if (!(a.children.length || a.attributes.name || a.attributes.id)) { - return !1; - } break; case 'img':if (!a.attributes.src) { - return !1; - } - } return !0; - } function L(a) { - if (!a) { - return !1; - } if (!0 === a) { - return !0; - } var b = G(a); - - return function (c) { - return c in a || b && c.match(b); - }; - } function y() { - return new CKEDITOR.htmlParser.element('br'); - } function H(a) { - return a.type == CKEDITOR.NODE_ELEMENT && (a.name == -'br' || r.$block[a.name]); - } function I(a, b, c) { - var d = a.name; - - if (r.$empty[d] || !a.children.length) { - d == 'hr' && b == 'br' ? a.replaceWith(y()) : (a.parent && c.push({ check: 'it', el: a.parent }), a.remove()); - } else if (r.$block[d] || d == 'tr') { - if (b == 'br') { - a.previous && !H(a.previous) && (b = y(), b.insertBefore(a)), a.next && !H(a.next) && (b = y(), b.insertAfter(a)), a.replaceWithChildren(); - } else { - var d = a.children; var e; - - b: { - e = r[b]; for (var f = 0, m = d.length, q; f < m; ++f) { - if (q = d[f], q.type == CKEDITOR.NODE_ELEMENT && !e[q.name]) { - e = !1; break b; - } - }e = !0; - } if (e) { - a.name = b, a.attributes = -{}, c.push({ check: 'parent-down', el: a }); - } else { - e = a.parent; for (var f = e.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || e.name == 'body', p, B, m = d.length; m > 0;) { - q = d[--m], f && (q.type == CKEDITOR.NODE_TEXT || q.type == CKEDITOR.NODE_ELEMENT && r.$inline[q.name]) ? (p || (p = new CKEDITOR.htmlParser.element(b), p.insertAfter(a), c.push({ check: 'parent-down', el: p })), p.add(q, 0)) : (p = null, B = r[e.name] || r.span, q.insertAfter(a), e.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || q.type != CKEDITOR.NODE_ELEMENT || B[q.name] || c.push({ check: 'el-up', el: q })); - }a.remove(); - } - } - } else { - d in -{ style: 1, script: 1 } ? a.remove() : (a.parent && c.push({ check: 'it', el: a.parent }), a.replaceWithChildren()); - } - } function m(a, b, c) { - var d; var e; - - for (d = 0; d < c.length; ++d) { - if (e = c[d], !(e.check && !a.check(e.check, !1) || e.left && !e.left(b))) { - e.right(b, F); break; - } - } - } function C(a, b) { - var c = b.getDefinition(); var d = c.attributes; var e = c.styles; var f; var m; var q; var p; - - if (a.name != c.element) { - return !1; - } for (f in d) { - if (f == 'class') { - for (c = d[f].split(/\s+/), q = a.classes.join('|'); p = c.pop();) { - if (q.indexOf(p) == -1) { - return !1; - } - } - } else if (a.attributes[f] != d[f]) { - return !1; - } - } for (m in e) { - if (a.styles[m] != -e[m]) { - return !1; - } - } return !0; - } function K(a, b) { - var c; var d; - - typeof a === 'string' ? c = a : a instanceof CKEDITOR.style ? d = a : (c = a[0], d = a[1]); return [{ element: c, left: d, right: function (a, c) { - c.transform(a, b); - } }]; - } function A(a) { - return function (b) { - return C(b, a); - }; - } function M(a) { - return function (b, c) { - c[a](b); - }; - } var r = CKEDITOR.dtd; var D = CKEDITOR.tools.copy; var B = CKEDITOR.tools.trim; var v = ['', 'p', 'br', 'div']; - - CKEDITOR.FILTER_SKIP_TREE = 2; CKEDITOR.filter = function (a, b) { - this.allowedContent = []; this.disallowedContent = []; this.elementCallbacks = null; this.disabled = -!1; this.editor = null; this.id = CKEDITOR.tools.getNextNumber(); this._ = { allowedRules: { elements: {}, generic: [] }, disallowedRules: { elements: {}, generic: [] }, transformations: {}, cachedTests: {}, cachedChecks: {} }; CKEDITOR.filter.instances[this.id] = this; var c = this.editor = a instanceof CKEDITOR.editor ? a : null; - - if (c && !b) { - this.customConfig = !0; var d = c.config.allowedContent; - - !0 === d ? this.disabled = !0 : (d || (this.customConfig = !1), this.allow(d, 'config', 1), this.allow(c.config.extraAllowedContent, 'extra', 1), this.allow(v[c.enterMode] + -' ' + v[c.shiftEnterMode], 'default', 1), this.disallow(c.config.disallowedContent)); - } else { - this.customConfig = !1, this.allow(b || a, 'default', 1); - } - }; CKEDITOR.filter.instances = {}; CKEDITOR.filter.prototype = { allow: function (b, c, d) { - if (!h(this, b, d)) { - return !1; - } var f; var m; - - if (typeof b === 'string') { - b = e(b); - } else if (b instanceof CKEDITOR.style) { - if (b.toAllowedContentRules) { - return this.allow(b.toAllowedContentRules(this.editor), c, d); - } f = b.getDefinition(); b = {}; d = f.attributes; b[f.element] = f = { styles: f.styles, requiredStyles: f.styles && CKEDITOR.tools.object.keys(f.styles) }; - d && (d = D(d), f.classes = d.class ? d.class.split(/\s+/) : null, f.requiredClasses = f.classes, delete d.class, f.attributes = d, f.requiredAttributes = d && CKEDITOR.tools.object.keys(d)); - } else if (CKEDITOR.tools.isArray(b)) { - for (f = 0; f < b.length; ++f) { - m = this.allow(b[f], c, d); - } return m; - }a(this, b, c, this.allowedContent, this._.allowedRules); return !0; - }, applyTo: function (a, b, c, d) { - if (this.disabled) { - return !1; - } var e = this; var f = []; var m = this.editor && this.editor.config.protectedSource; var q; var p = !1; var B = { doFilter: !c, doTransform: !0, doCallbacks: !0, toHtml: b }; - - a.forEach(function (a) { - if (a.type == CKEDITOR.NODE_ELEMENT) { - if (a.attributes['data-cke-filter'] == 'off') { - return !1; - } if (!b || a.name != 'span' || !~CKEDITOR.tools.object.keys(a.attributes).join('|').indexOf('data-cke-')) { - if (q = z(e, a, f, B), q & 1) { - p = !0; - } else if (q & 2) { - return !1; - } - } - } else if (a.type == CKEDITOR.NODE_COMMENT && a.value.match(/^\{cke_protected\}(?!\{C\})/)) { - var c; - - a: { - var d = decodeURIComponent(a.value.replace(/^\{cke_protected\}/, '')); - - c = []; var h; var r; var n; - - if (m) { - for (r = 0; r < m.length; ++r) { - if ((n = d.match(m[r])) && n[0].length == d.length) { - c = -!0; break a; - } - } - }d = CKEDITOR.htmlParser.fragment.fromHtml(d); d.children.length == 1 && (h = d.children[0]).type == CKEDITOR.NODE_ELEMENT && z(e, h, c, B); c = !c.length; - }c || f.push(a); - } - }, null, !0); f.length && (p = !0); var h; - - a = []; d = v[d || (this.editor ? this.editor.enterMode : CKEDITOR.ENTER_P)]; for (var g; c = f.pop();) { - c.type == CKEDITOR.NODE_ELEMENT ? I(c, d, a) : c.remove(); - } for (;h = a.pop();) { - if (c = h.el, c.parent) { - switch (g = r[c.parent.name] || r.span, h.check) { - case 'it':r.$removeEmpty[c.name] && !c.children.length ? I(c, d, a) : n(c) || I(c, d, a); break; case 'el-up':c.parent.type == -CKEDITOR.NODE_DOCUMENT_FRAGMENT || g[c.name] || I(c, d, a); break; case 'parent-down':c.parent.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || g[c.name] || I(c.parent, d, a); - } - } - } return p; - }, checkFeature: function (a) { - if (this.disabled || !a) { - return !0; - } a.toFeature && (a = a.toFeature(this.editor)); return !a.requiredContent || this.check(a.requiredContent); - }, disable: function () { - this.disabled = !0; - }, disallow: function (b) { - if (!h(this, b, !0)) { - return !1; - } typeof b === 'string' && (b = e(b)); a(this, b, null, this.disallowedContent, this._.disallowedRules); return !0; - }, - addContentForms: function (a) { - if (!this.disabled && a) { - var b; var c; var d = []; var e; - - for (b = 0; b < a.length && !e; ++b) { - c = a[b], (typeof c === 'string' || c instanceof CKEDITOR.style) && this.check(c) && (e = c); - } if (e) { - for (b = 0; b < a.length; ++b) { - d.push(K(a[b], e)); - } this.addTransformations(d); - } - } - }, addElementCallback: function (a) { - this.elementCallbacks || (this.elementCallbacks = []); this.elementCallbacks.push(a); - }, addFeature: function (a) { - if (this.disabled || !a) { - return !0; - } a.toFeature && (a = a.toFeature(this.editor)); this.allow(a.allowedContent, a.name); this.addTransformations(a.contentTransformations); - this.addContentForms(a.contentForms); return a.requiredContent && (this.customConfig || this.disallowedContent.length) ? this.check(a.requiredContent) : !0; - }, addTransformations: function (a) { - var b; var c; - - if (!this.disabled && a) { - var d = this._.transformations; var e; - - for (e = 0; e < a.length; ++e) { - b = a[e]; var f = void 0; var m = void 0; var q = void 0; var p = void 0; var B = void 0; var h = void 0; - - c = []; for (m = 0; m < b.length; ++m) { - q = b[m], typeof q === 'string' ? (q = q.split(/\s*:\s*/), p = q[0], B = null, h = q[1]) : (p = q.check, B = q.left, h = q.right), f || (f = q, f = f.element ? f.element : p ? p.match(/^([a-z0-9]+)/i)[0] : - f.left.getDefinition().element), B instanceof CKEDITOR.style && (B = A(B)), c.push({ check: p == f ? null : p, left: B, right: typeof h === 'string' ? M(h) : h }); - }b = f; d[b] || (d[b] = []); d[b].push(c); - } - } - }, check: function (a, b, c) { - if (this.disabled) { - return !0; - } if (CKEDITOR.tools.isArray(a)) { - for (var d = a.length; d--;) { - if (this.check(a[d], b, c)) { - return !0; - } - } return !1; - } var f; var q; - - if (typeof a === 'string') { - q = a + '\x3c' + (!1 === b ? '0' : '1') + (c ? '1' : '0') + '\x3e'; if (q in this._.cachedChecks) { - return this._.cachedChecks[q]; - } f = e(a).$1; var p = f.styles; var d = f.classes; - - f.name = f.elements; - f.classes = d = d ? d.split(/\s*,\s*/) : []; f.styles = u(p); f.attributes = u(f.attributes); f.children = []; d.length && (f.attributes.class = d.join(' ')); p && (f.attributes.style = CKEDITOR.tools.writeCssText(f.styles)); - } else { - f = a.getDefinition(), p = f.styles, d = f.attributes || {}, p && !CKEDITOR.tools.isEmpty(p) ? (p = D(p), d.style = CKEDITOR.tools.writeCssText(p, !0)) : p = {}, f = { name: f.element, attributes: d, classes: d.class ? d.class.split(/\s+/) : [], styles: p, children: [] }; - } var p = CKEDITOR.tools.clone(f); var B = []; var h; - - if (!1 !== b && (h = this._.transformations[f.name])) { - for (d = -0; d < h.length; ++d) { - m(this, f, h[d]); - }t(f); - }z(this, p, B, { doFilter: !0, doTransform: !1 !== b, skipRequired: !c, skipFinalValidation: !c }); B.length > 0 ? c = !1 : ((b = f.attributes.class) && (f.attributes.class = f.attributes.class.split(' ').sort().join(' ')), c = CKEDITOR.tools.objectCompare(f.attributes, p.attributes, !0), b && (f.attributes.class = b)); typeof a === 'string' && (this._.cachedChecks[q] = c); return c; - }, getAllowedEnterMode: (function () { - var a = ['p', 'div', 'br']; var b = { p: CKEDITOR.ENTER_P, div: CKEDITOR.ENTER_DIV, br: CKEDITOR.ENTER_BR }; - - return function (c, d) { - var f = a.slice(); var e; - - if (this.check(v[c])) { - return c; - } for (d || (f = f.reverse()); e = f.pop();) { - if (this.check(e)) { - return b[e]; - } - } return CKEDITOR.ENTER_BR; - }; - })(), clone: function () { - var a = new CKEDITOR.filter(); var b = CKEDITOR.tools.clone; - - a.allowedContent = b(this.allowedContent); a._.allowedRules = b(this._.allowedRules); a.disallowedContent = b(this.disallowedContent); a._.disallowedRules = b(this._.disallowedRules); a._.transformations = b(this._.transformations); a.disabled = this.disabled; a.editor = this.editor; return a; - }, destroy: function () { - delete CKEDITOR.filter.instances[this.id]; - delete this._; delete this.allowedContent; delete this.disallowedContent; - } }; var T = { styles: 1, attributes: 1, classes: 1 }; var S = { styles: 'requiredStyles', attributes: 'requiredAttributes', classes: 'requiredClasses' }; var p = /^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i; var N = { styles: /{([^}]+)}/, attrs: /\[([^\]]+)\]/, classes: /\(([^\)]+)\)/ }; var O = /^cke:(object|embed|param)$/; var q = /^(object|embed|param)$/; var F; - - F = CKEDITOR.filter.transformationsTools = { sizeToStyle: function (a) { - this.lengthToStyle(a, - 'width'); this.lengthToStyle(a, 'height'); - }, sizeToAttribute: function (a) { - this.lengthToAttribute(a, 'width'); this.lengthToAttribute(a, 'height'); - }, lengthToStyle: function (a, b, c) { - c = c || b; if (!(c in a.styles)) { - var d = a.attributes[b]; - - d && ((/^\d+$/).test(d) && (d += 'px'), a.styles[c] = d); - } delete a.attributes[b]; - }, lengthToAttribute: function (a, b, c) { - c = c || b; if (!(c in a.attributes)) { - var d = a.styles[b]; var f = d && d.match(/^(\d+)(?:\.\d*)?px$/); - - f ? a.attributes[c] = f[1] : d == 'cke-test' && (a.attributes[c] = 'cke-test'); - } delete a.styles[b]; - }, alignmentToStyle: function (a) { - if (!('float' in -a.styles)) { - var b = a.attributes.align; - - if (b == 'left' || b == 'right') { - a.styles.float = b; - } - } delete a.attributes.align; - }, alignmentToAttribute: function (a) { - if (!('align' in a.attributes)) { - var b = a.styles.float; - - if (b == 'left' || b == 'right') { - a.attributes.align = b; - } - } delete a.styles.float; - }, splitBorderShorthand: function (a) { - if (a.styles.border) { - var b = CKEDITOR.tools.style.parse.border(a.styles.border); - - b.color && (a.styles['border-color'] = b.color); b.style && (a.styles['border-style'] = b.style); b.width && (a.styles['border-width'] = b.width); - delete a.styles.border; - } - }, listTypeToStyle: function (a) { - if (a.attributes.type) { - switch (a.attributes.type) { - case 'a':a.styles['list-style-type'] = 'lower-alpha'; break; case 'A':a.styles['list-style-type'] = 'upper-alpha'; break; case 'i':a.styles['list-style-type'] = 'lower-roman'; break; case 'I':a.styles['list-style-type'] = 'upper-roman'; break; case '1':a.styles['list-style-type'] = 'decimal'; break; default:a.styles['list-style-type'] = a.attributes.type; - } - } - }, splitMarginShorthand: function (a) { - function b(d) { - a.styles['margin-top'] = -c[d[0]]; a.styles['margin-right'] = c[d[1]]; a.styles['margin-bottom'] = c[d[2]]; a.styles['margin-left'] = c[d[3]]; - } if (a.styles.margin) { - var c = a.styles.margin.match(/(\-?[\.\d]+\w+)/g) || ['0px']; - - switch (c.length) { - case 1:b([0, 0, 0, 0]); break; case 2:b([0, 1, 0, 1]); break; case 3:b([0, 1, 2, 1]); break; case 4:b([0, 1, 2, 3]); - } delete a.styles.margin; - } - }, matchesStyle: C, transform: function (a, b) { - if (typeof b === 'string') { - a.name = b; - } else { - var c = b.getDefinition(); var d = c.styles; var f = c.attributes; var e; var m; var q; var p; - - a.name = c.element; for (e in f) { - if (e == 'class') { - for (c = -a.classes.join('|'), q = f[e].split(/\s+/); p = q.pop();) { - c.indexOf(p) == -1 && a.classes.push(p); - } - } else { - a.attributes[e] = f[e]; - } - } for (m in d) { - a.styles[m] = d[m]; - } - } - } }; - })(); - (function () { - CKEDITOR.focusManager = function (a) { - if (a.focusManager) { - return a.focusManager; - } this.hasFocus = !1; this.currentActive = null; this._ = { editor: a }; return this; - }; CKEDITOR.focusManager._ = { blurDelay: 200 }; CKEDITOR.focusManager.prototype = { focus: function (a) { - this._.timer && clearTimeout(this._.timer); a && (this.currentActive = a); this.hasFocus || this._.locked || ((a = CKEDITOR.currentInstance) && a.focusManager.blur(1), this.hasFocus = !0, (a = this._.editor.container) && a.addClass('cke_focus'), this._.editor.fire('focus')); - }, lock: function () { - this._.locked = -1; - }, unlock: function () { - delete this._.locked; - }, blur: function (a) { - function d() { - if (this.hasFocus) { - this.hasFocus = !1; var a = this._.editor.container; - - a && a.removeClass('cke_focus'); this._.editor.fire('blur'); - } - } if (!this._.locked) { - this._.timer && clearTimeout(this._.timer); var b = CKEDITOR.focusManager._.blurDelay; - - a || !b ? d.call(this) : this._.timer = CKEDITOR.tools.setTimeout(function () { - delete this._.timer; d.call(this); - }, b, this); - } - }, add: function (a, d) { - var b = a.getCustomData('focusmanager'); - - if (!b || b != this) { - b && b.remove(a); var b = -'focus'; var c = 'blur'; - - d && (CKEDITOR.env.ie ? (b = 'focusin', c = 'focusout') : CKEDITOR.event.useCapture = 1); var f = { blur: function () { - a.equals(this.currentActive) && this.blur(); - }, focus: function () { - this.focus(a); - } }; - - a.on(b, f.focus, this); a.on(c, f.blur, this); d && (CKEDITOR.event.useCapture = 0); a.setCustomData('focusmanager', this); a.setCustomData('focusmanager_handlers', f); - } - }, remove: function (a) { - a.removeCustomData('focusmanager'); var d = a.removeCustomData('focusmanager_handlers'); - - a.removeListener('blur', d.blur); a.removeListener('focus', - d.focus); - } }; - })(); CKEDITOR.keystrokeHandler = function (a) { - if (a.keystrokeHandler) { - return a.keystrokeHandler; - } this.keystrokes = {}; this.blockedKeystrokes = {}; this._ = { editor: a }; return this; - }; - (function () { - var a; var d = function (b) { - b = b.data; var d = b.getKeystroke(); var h = this.keystrokes[d]; var k = this._.editor; - - a = !1 === k.fire('key', { keyCode: d, domEvent: b }); a || (h && (a = !1 !== k.execCommand(h, { from: 'keystrokeHandler' })), a || (a = !!this.blockedKeystrokes[d])); a && b.preventDefault(!0); return !a; - }; var b = function (b) { - a && (a = !1, b.data.preventDefault(!0)); - }; - - CKEDITOR.keystrokeHandler.prototype = { attach: function (a) { - a.on('keydown', d, this); if (CKEDITOR.env.gecko && CKEDITOR.env.mac) { - a.on('keypress', b, this); - } - } }; - })(); - (function () { - CKEDITOR.lang = { languages: { 'af': 1, 'ar': 1, 'az': 1, 'bg': 1, 'bn': 1, 'bs': 1, 'ca': 1, 'cs': 1, 'cy': 1, 'da': 1, 'de': 1, 'de-ch': 1, 'el': 1, 'en-au': 1, 'en-ca': 1, 'en-gb': 1, 'en': 1, 'eo': 1, 'es': 1, 'es-mx': 1, 'et': 1, 'eu': 1, 'fa': 1, 'fi': 1, 'fo': 1, 'fr-ca': 1, 'fr': 1, 'gl': 1, 'gu': 1, 'he': 1, 'hi': 1, 'hr': 1, 'hu': 1, 'id': 1, 'is': 1, 'it': 1, 'ja': 1, 'ka': 1, 'km': 1, 'ko': 1, 'ku': 1, 'lt': 1, 'lv': 1, 'mk': 1, 'mn': 1, 'ms': 1, 'nb': 1, 'nl': 1, 'no': 1, 'oc': 1, 'pl': 1, 'pt-br': 1, 'pt': 1, 'ro': 1, 'ru': 1, 'si': 1, 'sk': 1, 'sl': 1, 'sq': 1, 'sr-latn': 1, 'sr': 1, 'sv': 1, 'th': 1, 'tr': 1, 'tt': 1, 'ug': 1, 'uk': 1, 'vi': 1, 'zh-cn': 1, 'zh': 1 }, rtl: { ar: 1, fa: 1, he: 1, ku: 1, ug: 1 }, load: function (a, d, b) { - a && CKEDITOR.lang.languages[a] || -(a = this.detect(d, a)); var c = this; - - d = function () { - c[a].dir = c.rtl[a] ? 'rtl' : 'ltr'; b(a, c[a]); - }; this[a] ? d() : CKEDITOR.scriptLoader.load(CKEDITOR.getUrl('lang/' + a + '.js'), d, this); - }, detect: function (a, d) { - var b = this.languages; - - d = d || navigator.userLanguage || navigator.language || a; var c = d.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/); var f = c[1]; var c = c[2]; - - b[f + '-' + c] ? f = f + '-' + c : b[f] || (f = null); CKEDITOR.lang.detect = f ? function () { - return f; - } : function (a) { - return a; - }; return f || a; - } }; - })(); - CKEDITOR.scriptLoader = (function () { - var a = {}; var d = {}; - - return { load: function (b, c, f, h) { - var k = typeof b === 'string'; - - k && (b = [b]); f || (f = CKEDITOR); var g = b.length; var l = []; var u = []; var e = function (a) { - c && (k ? c.call(f, a) : c.call(f, l, u)); - }; - - if (g === 0) { - e(!0); - } else { - var x = function (a, b) { - (b ? l : u).push(a); --g <= 0 && (h && CKEDITOR.document.getDocumentElement().removeStyle('cursor'), e(b)); - }; var w = function (b, c) { - a[b] = 1; var f = d[b]; - - delete d[b]; for (var e = 0; e < f.length; e++) { - f[e](b, c); - } - }; var z = function (b) { - if (a[b]) { - x(b, !0); - } else { - var f = d[b] || (d[b] = []); - - f.push(x); if (!(f.length > 1)) { - var e = -new CKEDITOR.dom.element('script'); - - e.setAttributes({ type: 'text/javascript', src: b }); c && (CKEDITOR.env.ie && (CKEDITOR.env.version <= 8 || CKEDITOR.env.ie9Compat) ? e.$.onreadystatechange = function () { - if (e.$.readyState == 'loaded' || e.$.readyState == 'complete') { - e.$.onreadystatechange = null, w(b, !0); - } - } : (e.$.onload = function () { - setTimeout(function () { - e.$.onload = null; e.$.onerror = null; w(b, !0); - }, 0); - }, e.$.onerror = function () { - e.$.onload = null; e.$.onerror = null; w(b, !1); - })); e.appendTo(CKEDITOR.document.getHead()); - } - } - }; - - h && CKEDITOR.document.getDocumentElement().setStyle('cursor', - 'wait'); for (var G = 0; G < g; G++) { - z(b[G]); - } - } - }, queue: (function () { - function a() { - var b; - - (b = c[0]) && this.load(b.scriptUrl, b.callback, CKEDITOR, 0); - } var c = []; - - return function (d, h) { - var k = this; - - c.push({ scriptUrl: d, callback: function () { - h && h.apply(this, arguments); c.shift(); a.call(k); - } }); c.length == 1 && a.call(this); - }; - })() }; - })(); CKEDITOR.resourceManager = function (a, d) { - this.basePath = a; this.fileName = d; this.registered = {}; this.loaded = {}; this.externals = {}; this._ = { waitingList: {} }; - }; - CKEDITOR.resourceManager.prototype = { add: function (a, d) { - if (this.registered[a]) { - throw Error('[CKEDITOR.resourceManager.add] The resource name "' + a + '" is already registered.'); - } var b = this.registered[a] = d || {}; - - b.name = a; b.path = this.getPath(a); CKEDITOR.fire(a + CKEDITOR.tools.capitalize(this.fileName) + 'Ready', b); return this.get(a); - }, get: function (a) { - return this.registered[a] || null; - }, getPath: function (a) { - var d = this.externals[a]; - - return CKEDITOR.getUrl(d && d.dir || this.basePath + a + '/'); - }, getFilePath: function (a) { - var d = this.externals[a]; - - return CKEDITOR.getUrl(this.getPath(a) + (d ? d.file : this.fileName + '.js')); - }, addExternal: function (a, d, b) { - b || (d = d.replace(/[^\/]+$/, function (a) { - b = a; return ''; - })); b = b || this.fileName + '.js'; a = a.split(','); for (var c = 0; c < a.length; c++) { - this.externals[a[c]] = { dir: d, file: b }; - } - }, load: function (a, d, b) { - CKEDITOR.tools.isArray(a) || (a = a ? [a] : []); for (var c = this.loaded, f = this.registered, h = [], k = {}, g = {}, l = 0; l < a.length; l++) { - var u = a[l]; - - if (u) { - if (c[u] || f[u]) { - g[u] = this.get(u); - } else { - var e = this.getFilePath(u); - - h.push(e); e in k || (k[e] = []); k[e].push(u); - } - } - }CKEDITOR.scriptLoader.load(h, - function (a, e) { - if (e.length) { - throw Error('[CKEDITOR.resourceManager.load] Resource name "' + k[e[0]].join(',') + '" was not found at "' + e[0] + '".'); - } for (var f = 0; f < a.length; f++) { - for (var h = k[a[f]], l = 0; l < h.length; l++) { - var n = h[l]; - - g[n] = this.get(n); c[n] = 1; - } - }d.call(b, g); - }, this); - } }; CKEDITOR.plugins = new CKEDITOR.resourceManager('plugins/', 'plugin'); - CKEDITOR.plugins.load = CKEDITOR.tools.override(CKEDITOR.plugins.load, function (a) { - var d = {}; - - return function (b, c, f) { - var h = {}; var k = function (b) { - a.call(this, b, function (a) { - CKEDITOR.tools.extend(h, a); var b = []; var e; - - for (e in a) { - var g = a[e]; var w = g && g.requires; - - if (!d[e]) { - if (g.icons) { - for (var z = g.icons.split(','), G = z.length; G--;) { - CKEDITOR.skin.addIcon(z[G], g.path + 'icons/' + (CKEDITOR.env.hidpi && g.hidpi ? 'hidpi/' : '') + z[G] + '.png'); - } - }g.isSupportedEnvironment = g.isSupportedEnvironment || function () { - return !0; - }; d[e] = 1; - } if (w) { - for (w.split && (w = -w.split(',')), g = 0; g < w.length; g++) { - h[w[g]] || b.push(w[g]); - } - } - } if (b.length) { - k.call(this, b); - } else { - for (e in h) { - g = h[e], g.onLoad && !g.onLoad._called && (!1 === g.onLoad() && delete h[e], g.onLoad._called = 1); - }c && c.call(f || window, h); - } - }, this); - }; - - k.call(this, b); - }; - }); CKEDITOR.plugins.setLang = function (a, d, b) { - var c = this.get(a); - - a = c.langEntries || (c.langEntries = {}); c = c.lang || (c.lang = []); c.split && (c = c.split(',')); CKEDITOR.tools.indexOf(c, d) == -1 && c.push(d); a[d] = b; - }; - CKEDITOR.ui = function (a) { - if (a.ui) { - return a.ui; - } this.items = {}; this.instances = {}; this.editor = a; this._ = { handlers: {} }; return this; - }; - CKEDITOR.ui.prototype = { add: function (a, d, b) { - b.name = a.toLowerCase(); var c = this.items[a] = { type: d, command: b.command || null, args: Array.prototype.slice.call(arguments, 2) }; - - CKEDITOR.tools.extend(c, b); - }, get: function (a) { - return this.instances[a]; - }, create: function (a) { - var d = this.items[a]; var b = d && this._.handlers[d.type]; var c = d && d.command && this.editor.getCommand(d.command); var b = b && b.create.apply(this, d.args); - - this.instances[a] = b; c && c.uiItems.push(b); b && !b.type && (b.type = d.type); return b; - }, addHandler: function (a, d) { - this._.handlers[a] = -d; - }, space: function (a) { - return CKEDITOR.document.getById(this.spaceId(a)); - }, spaceId: function (a) { - return this.editor.id + '_' + a; - } }; CKEDITOR.event.implementOn(CKEDITOR.ui); - (function () { - function a(a, e, f) { - CKEDITOR.event.call(this); a = a && CKEDITOR.tools.clone(a); if (void 0 !== e) { - if (!(e instanceof CKEDITOR.dom.element)) { - throw Error('Expect element of type CKEDITOR.dom.element.'); - } if (!f) { - throw Error('One of the element modes must be specified.'); - } if (CKEDITOR.env.ie && CKEDITOR.env.quirks && f == CKEDITOR.ELEMENT_MODE_INLINE) { - throw Error('Inline element mode is not supported on IE quirks.'); - } if (!b(e, f)) { - throw Error('The specified element mode is not supported on element: "' + e.getName() + '".'); - } - this.element = e; this.elementMode = f; this.name = this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO && (e.getId() || e.getNameAtt()); - } else { - this.elementMode = CKEDITOR.ELEMENT_MODE_NONE; - } this._ = {}; this.commands = {}; this.templates = {}; this.name = this.name || d(); this.id = CKEDITOR.tools.getNextId(); this.status = 'unloaded'; this.config = CKEDITOR.tools.prototypedCopy(CKEDITOR.config); this.ui = new CKEDITOR.ui(this); this.focusManager = new CKEDITOR.focusManager(this); this.keystrokeHandler = new CKEDITOR.keystrokeHandler(this); this.on('readOnly', - c); this.on('selectionChange', function (a) { - h(this, a.data.path); - }); this.on('activeFilterChange', function () { - h(this, this.elementPath(), !0); - }); this.on('mode', c); CKEDITOR.dom.selection.setupEditorOptimization(this); this.on('instanceReady', function () { - if (this.config.startupFocus) { - if (this.config.startupFocus === 'end') { - var a = this.createRange(); - - a.selectNodeContents(this.editable()); a.shrink(CKEDITOR.SHRINK_ELEMENT, !0); a.collapse(); this.getSelection().selectRanges([a]); - } this.focus(); - } - }); CKEDITOR.fire('instanceCreated', - null, this); CKEDITOR.add(this); CKEDITOR.tools.setTimeout(function () { - this.isDestroyed() || this.isDetached() || g(this, a); - }, 0, this); - } function d() { - do { - var a = 'editor' + ++G; - } while (CKEDITOR.instances[a]); return a; - } function b(a, b) { - return b == CKEDITOR.ELEMENT_MODE_INLINE ? a.is(CKEDITOR.dtd.$editable) || a.is('textarea') : b == CKEDITOR.ELEMENT_MODE_REPLACE ? !a.is(CKEDITOR.dtd.$nonBodyContent) : 1; - } function c() { - var a = this.commands; var b; - - for (b in a) { - f(this, a[b]); - } - } function f(a, b) { - b[b.startDisabled ? 'disable' : a.readOnly && !b.readOnly ? 'disable' : - b.modes[a.mode] ? 'enable' : 'disable'](); - } function h(a, b, c) { - if (b) { - var d; var e; var f = a.commands; - - for (e in f) { - d = f[e], (c || d.contextSensitive) && d.refresh(a, b); - } - } - } function k(a) { - var b = a.config.customConfig; - - if (!b) { - return !1; - } var b = CKEDITOR.getUrl(b); var c = t[b] || (t[b] = {}); - - c.fn ? (c.fn.call(a, a.config), CKEDITOR.getUrl(a.config.customConfig) != b && k(a) || a.fireOnce('customConfigLoaded')) : CKEDITOR.scriptLoader.queue(b, function () { - c.fn = CKEDITOR.editorConfig ? CKEDITOR.editorConfig : function () {}; k(a); - }); return !0; - } function g(a, b) { - a.on('customConfigLoaded', - function () { - if (b) { - if (b.on) { - for (var c in b.on) { - a.on(c, b.on[c]); - } - }CKEDITOR.tools.extend(a.config, b, !0); delete a.config.on; - }c = a.config; a.readOnly = c.readOnly ? !0 : a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.element.is('textarea') ? a.element.hasAttribute('disabled') || a.element.hasAttribute('readonly') : a.element.isReadOnly() : a.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? a.element.hasAttribute('disabled') || a.element.hasAttribute('readonly') : !1; a.blockless = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? !(a.element.is('textarea') || -CKEDITOR.dtd[a.element.getName()].p) : !1; a.tabIndex = c.tabIndex || a.element && a.element.getAttribute('tabindex') || 0; a.activeEnterMode = a.enterMode = a.blockless ? CKEDITOR.ENTER_BR : c.enterMode; a.activeShiftEnterMode = a.shiftEnterMode = a.blockless ? CKEDITOR.ENTER_BR : c.shiftEnterMode; c.skin && (CKEDITOR.skinName = c.skin); a.fireOnce('configLoaded'); a.dataProcessor = new CKEDITOR.htmlDataProcessor(a); a.filter = a.activeFilter = new CKEDITOR.filter(a); l(a); - }); b && b.customConfig != null && (a.config.customConfig = b.customConfig); - k(a) || a.fireOnce('customConfigLoaded'); - } function l(a) { - CKEDITOR.skin.loadPart('editor', function () { - u(a); - }); - } function u(a) { - CKEDITOR.lang.load(a.config.language, a.config.defaultLanguage, function (b, c) { - var d = a.config.title; - - a.langCode = b; a.lang = CKEDITOR.tools.prototypedCopy(c); a.title = typeof d === 'string' || !1 === d ? d : [a.lang.editor, a.name].join(', '); a.config.contentsLangDirection || (a.config.contentsLangDirection = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.element.getDirection(1) : a.lang.dir); a.fire('langLoaded'); - e(a); - }); - } function e(a) { - a.getStylesSet(function (b) { - a.once('loaded', function () { - a.fire('stylesSet', { styles: b }); - }, null, null, 1); x(a); - }); - } function x(a) { - function b(a) { - if (!a) { - return ''; - } CKEDITOR.tools.isArray(a) && (a = a.join(',')); return a.replace(/\s/g, ''); - } var c = a.config; var d = b(c.plugins); var e = b(c.extraPlugins); var f = b(c.removePlugins); - - if (e) { - var h = new RegExp('(?:^|,)(?:' + e.replace(/,/g, '|') + ')(?\x3d,|$)', 'g'); var d = d.replace(h, ''); var d = d + (',' + e); - } - - if (f) { - var g = new RegExp('(?:^|,)(?:' + f.replace(/,/g, '|') + ')(?\x3d,|$)', 'g'); var d = d.replace(g, - ''); - } - - CKEDITOR.env.air && (d += ',adobeair'); CKEDITOR.plugins.load(d.split(','), function (b) { - var d = []; var e = []; var f = []; - - a.plugins = CKEDITOR.tools.extend({}, a.plugins, b); for (var m in b) { - var h = b[m]; var k = h.lang; var C = null; var p = h.requires; var N; - - CKEDITOR.tools.isArray(p) && (p = p.join(',')); if (p && (N = p.match(g))) { - for (;p = N.pop();) { - CKEDITOR.error('editor-plugin-required', { plugin: p.replace(',', ''), requiredBy: m }); - } - }k && !a.lang[m] && (k.split && (k = k.split(',')), CKEDITOR.tools.indexOf(k, a.langCode) >= 0 ? C = a.langCode : (C = a.langCode.replace(/-.*/, ''), C = -C != a.langCode && CKEDITOR.tools.indexOf(k, C) >= 0 ? C : CKEDITOR.tools.indexOf(k, 'en') >= 0 ? 'en' : k[0]), h.langEntries && h.langEntries[C] ? (a.lang[m] = h.langEntries[C], C = null) : f.push(CKEDITOR.getUrl(h.path + 'lang/' + C + '.js'))); e.push(C); d.push(h); - }CKEDITOR.scriptLoader.load(f, function () { - if (!a.isDestroyed() && !a.isDetached()) { - for (var b = ['beforeInit', 'init', 'afterInit'], f = 0; f < b.length; f++) { - for (var m = 0; m < d.length; m++) { - var p = d[m]; - - f === 0 && e[m] && p.lang && p.langEntries && (a.lang[p.name] = p.langEntries[e[m]]); if (p[b[f]]) { - p[b[f]](a); - } - } - }a.fireOnce('pluginsLoaded'); - c.keystrokes && a.setKeystroke(a.config.keystrokes); for (m = 0; m < a.config.blockedKeystrokes.length; m++) { - a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[m]] = 1; - }a.status = 'loaded'; a.fireOnce('loaded'); CKEDITOR.fire('instanceLoaded', null, a); - } - }); - }); - } function w() { - var a = this.element; - - if (a && this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO) { - var b = this.getData(); - - this.config.htmlEncodeOutput && (b = CKEDITOR.tools.htmlEncode(b)); a.is('textarea') ? a.setValue(b) : a.setHtml(b); return !0; - } return !1; - } function z(a, b) { - function c(a) { - var b = -a.startContainer; var d = a.endContainer; - - return b.is && (b.is('tr') || b.is('td') && b.equals(d) && a.endOffset === b.getChildCount()) ? !0 : !1; - } function d(a) { - var b = a.startContainer; - - return b.is('tr') ? a.cloneContents() : b.clone(!0); - } for (var e = new CKEDITOR.dom.documentFragment(), f, h, g, k = 0; k < a.length; k++) { - var l = a[k]; var r = l.startContainer.getAscendant('tr', !0); - - c(l) ? (f || (f = r.getAscendant('table').clone(), f.append(r.getAscendant({ thead: 1, tbody: 1, tfoot: 1 }).clone()), e.append(f), f = f.findOne('thead, tbody, tfoot')), h && h.equals(r) || (h = -r, g = r.clone(), f.append(g)), g.append(d(l))) : e.append(l.cloneContents()); - } return f ? e : b.getHtmlFromRange(a[0]); - }a.prototype = CKEDITOR.editor.prototype; CKEDITOR.editor = a; var G = 0; var t = {}; - - CKEDITOR.tools.extend(CKEDITOR.editor.prototype, { plugins: { detectConflict: function (a, b) { - for (var c = 0; c < b.length; c++) { - var d = b[c]; - - if (this[d]) { - return CKEDITOR.warn('editor-plugin-conflict', { plugin: a, replacedWith: d }), !0; - } - } return !1; - } }, addCommand: function (a, b) { - b.name = a.toLowerCase(); var c = b instanceof CKEDITOR.command ? b : new CKEDITOR.command(this, - b); - - this.mode && f(this, c); return this.commands[a] = c; - }, _attachToForm: function () { - function a(b) { - c.updateElement(); c._.required && !d.getValue() && !1 === c.fire('required') && b.data.preventDefault(); - } function b(a) { - return !!(a && a.call && a.apply); - } var c = this; var d = c.element; var f = new CKEDITOR.dom.element(d.$.form); - - d.is('textarea') && f && (f.on('submit', a), b(f.$.submit) && (f.$.submit = CKEDITOR.tools.override(f.$.submit, function (b) { - return function () { - a(); b.apply ? b.apply(this) : b(); - }; - })), c.on('destroy', function () { - f.removeListener('submit', - a); - })); - }, destroy: function (a) { - var b = CKEDITOR.filter.instances; var c = this; - - this.fire('beforeDestroy'); !a && w.call(this); this.editable(null); this.filter && delete this.filter; CKEDITOR.tools.array.forEach(CKEDITOR.tools.object.keys(b), function (a) { - a = b[a]; c === a.editor && a.destroy(); - }); delete this.activeFilter; this.status = 'destroyed'; this.fire('destroy'); this.removeAllListeners(); CKEDITOR.remove(this); CKEDITOR.fire('instanceDestroyed', null, this); - }, elementPath: function (a) { - if (!a) { - a = this.getSelection(); if (!a) { - return null; - } - a = a.getStartElement(); - } return a ? new CKEDITOR.dom.elementPath(a, this.editable()) : null; - }, createRange: function () { - var a = this.editable(); - - return a ? new CKEDITOR.dom.range(a) : null; - }, execCommand: function (a, b) { - var c = this.getCommand(a); var d = { name: a, commandData: b || {}, command: c }; - - return c && c.state != CKEDITOR.TRISTATE_DISABLED && !1 !== this.fire('beforeCommandExec', d) && (d.returnValue = c.exec(d.commandData), !c.async && !1 !== this.fire('afterCommandExec', d)) ? d.returnValue : !1; - }, getCommand: function (a) { - return this.commands[a]; - }, getData: function (a) { - !a && -this.fire('beforeGetData'); var b = this._.data; - - typeof b !== 'string' && (b = (b = this.element) && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? b.is('textarea') ? b.getValue() : b.getHtml() : ''); b = { dataValue: b }; !a && this.fire('getData', b); return b.dataValue; - }, getSnapshot: function () { - var a = this.fire('getSnapshot'); - - typeof a !== 'string' && (a = (a = this.element) && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? a.is('textarea') ? a.getValue() : a.getHtml() : ''); return a; - }, loadSnapshot: function (a) { - this.fire('loadSnapshot', a); - }, setData: function (a, - b, c) { - var d = !0; var f = b; - - b && typeof b === 'object' && (c = b.internal, f = b.callback, d = !b.noSnapshot); !c && d && this.fire('saveSnapshot'); if (f || !c) { - this.once('dataReady', function (a) { - !c && d && this.fire('saveSnapshot'); f && f.call(a.editor); - }); - } a = { dataValue: a }; !c && this.fire('setData', a); this._.data = a.dataValue; !c && this.fire('afterSetData', a); - }, setReadOnly: function (a) { - a = a == null || a; this.readOnly != a && (this.readOnly = a, this.keystrokeHandler.blockedKeystrokes[8] = +a, this.editable().setReadOnly(a), this.fire('readOnly')); - }, insertHtml: function (a, - b, c) { - this.fire('insertHtml', { dataValue: a, mode: b, range: c }); - }, insertText: function (a) { - this.fire('insertText', a); - }, insertElement: function (a) { - this.fire('insertElement', a); - }, getSelectedHtml: function (a) { - var b = this.editable(); var c = this.getSelection(); var c = c && c.getRanges(); - - if (!b || !c || c.length === 0) { - return null; - } b = z(c, b); return a ? b.getHtml() : b; - }, extractSelectedHtml: function (a, b) { - var c = this.editable(); var d = this.getSelection().getRanges(); var f = new CKEDITOR.dom.documentFragment(); var e; - - if (!c || d.length === 0) { - return null; - } for (e = 0; e < d.length; e++) { - f.append(c.extractHtmlFromRange(d[e], - b)); - }b || this.getSelection().selectRanges([d[0]]); return a ? f.getHtml() : f; - }, focus: function () { - this.fire('beforeFocus'); - }, checkDirty: function () { - return this.status == 'ready' && this._.previousValue !== this.getSnapshot(); - }, resetDirty: function () { - this._.previousValue = this.getSnapshot(); - }, updateElement: function () { - return w.call(this); - }, setKeystroke: function () { - for (var a = this.keystrokeHandler.keystrokes, b = CKEDITOR.tools.isArray(arguments[0]) ? arguments[0] : [[].slice.call(arguments, 0)], c, d, f = b.length; f--;) { - c = b[f], d = 0, CKEDITOR.tools.isArray(c) && -(d = c[1], c = c[0]), d ? a[c] = d : delete a[c]; - } - }, getCommandKeystroke: function (a, b) { - var c = typeof a === 'string' ? this.getCommand(a) : a; var d = []; - - if (c) { - var f = CKEDITOR.tools.object.findKey(this.commands, c); var e = this.keystrokeHandler.keystrokes; - - if (c.fakeKeystroke) { - d.push(c.fakeKeystroke); - } else { - for (var h in e) { - e[h] === f && d.push(h); - } - } - } return b ? d : d[0] || null; - }, addFeature: function (a) { - return this.filter.addFeature(a); - }, setActiveFilter: function (a) { - a || (a = this.filter); this.activeFilter !== a && (this.activeFilter = a, this.fire('activeFilterChange'), - a === this.filter ? this.setActiveEnterMode(null, null) : this.setActiveEnterMode(a.getAllowedEnterMode(this.enterMode), a.getAllowedEnterMode(this.shiftEnterMode, !0))); - }, setActiveEnterMode: function (a, b) { - a = a ? this.blockless ? CKEDITOR.ENTER_BR : a : this.enterMode; b = b ? this.blockless ? CKEDITOR.ENTER_BR : b : this.shiftEnterMode; if (this.activeEnterMode != a || this.activeShiftEnterMode != b) { - this.activeEnterMode = a, this.activeShiftEnterMode = b, this.fire('activeEnterModeChange'); - } - }, showNotification: function (a) { - alert(a); - }, isDetached: function () { - return !!this.container && -this.container.isDetached(); - }, isDestroyed: function () { - return this.status === 'destroyed'; - } }); CKEDITOR.editor._getEditorElement = function (a) { - if (!CKEDITOR.env.isCompatible) { - return null; - } var b = CKEDITOR.dom.element.get(a); - - return b ? b.getEditor() ? (CKEDITOR.error('editor-element-conflict', { editorName: b.getEditor().name }), null) : b : (CKEDITOR.error('editor-incorrect-element', { element: a }), null); - }; - })(); CKEDITOR.ELEMENT_MODE_NONE = 0; CKEDITOR.ELEMENT_MODE_REPLACE = 1; CKEDITOR.ELEMENT_MODE_APPENDTO = 2; - CKEDITOR.ELEMENT_MODE_INLINE = 3; CKEDITOR.htmlParser = function () { - this._ = { htmlPartsRegex: /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\x3e)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g }; - }; - (function () { - var a = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g; var d = { checked: 1, compact: 1, declare: 1, defer: 1, disabled: 1, ismap: 1, multiple: 1, nohref: 1, noresize: 1, noshade: 1, nowrap: 1, readonly: 1, selected: 1 }; - - CKEDITOR.htmlParser.prototype = { onTagOpen: function () {}, onTagClose: function () {}, onText: function () {}, onCDATA: function () {}, onComment: function () {}, parse: function (b) { - for (var c, f, h = 0, k; c = this._.htmlPartsRegex.exec(b);) { - f = c.index; if (f > h) { - if (h = b.substring(h, f), k) { - k.push(h); - } else { - this.onText(h); - } - } - h = this._.htmlPartsRegex.lastIndex; if (f = c[1]) { - if (f = f.toLowerCase(), k && CKEDITOR.dtd.$cdata[f] && (this.onCDATA(k.join('')), k = null), !k) { - this.onTagClose(f); continue; - } - } if (k) { - k.push(c[0]); - } else if (f = c[3]) { - if (f = f.toLowerCase(), !(/[=]"/).test(f)) { - var g = {}; var l; var u = c[4]; - - c = !!c[5]; if (u) { - for (;l = a.exec(u);) { - var e = l[1].toLowerCase(); - - l = l[2] || l[3] || l[4] || ''; g[e] = !l && d[e] ? e : CKEDITOR.tools.htmlDecodeAttr(l); - } - } this.onTagOpen(f, g, c); !k && CKEDITOR.dtd.$cdata[f] && (k = []); - } - } else if (f = c[2]) { - this.onComment(f); - } - } if (b.length > h) { - this.onText(b.substring(h, - b.length)); - } - } }; - })(); - CKEDITOR.htmlParser.basicWriter = CKEDITOR.tools.createClass({ $: function () { - this._ = { output: [] }; - }, proto: { openTag: function (a) { - this._.output.push('\x3c', a); - }, openTagClose: function (a, d) { - d ? this._.output.push(' /\x3e') : this._.output.push('\x3e'); - }, attribute: function (a, d) { - typeof d === 'string' && (d = CKEDITOR.tools.htmlEncodeAttr(d)); this._.output.push(' ', a, '\x3d"', d, '"'); - }, closeTag: function (a) { - this._.output.push('\x3c/', a, '\x3e'); - }, text: function (a) { - this._.output.push(a); - }, comment: function (a) { - this._.output.push('\x3c!--', a, - '--\x3e'); - }, write: function (a) { - this._.output.push(a); - }, reset: function () { - this._.output = []; this._.indent = !1; - }, getHtml: function (a) { - var d = this._.output.join(''); - - a && this.reset(); return d; - } } }); 'use strict'; - (function () { - CKEDITOR.htmlParser.node = function () {}; CKEDITOR.htmlParser.node.prototype = { remove: function () { - var a = this.parent.children; var d = CKEDITOR.tools.indexOf(a, this); var b = this.previous; var c = this.next; - - b && (b.next = c); c && (c.previous = b); a.splice(d, 1); this.parent = null; - }, replaceWith: function (a) { - var d = this.parent.children; var b = CKEDITOR.tools.indexOf(d, this); var c = a.previous = this.previous; var f = a.next = this.next; - - c && (c.next = a); f && (f.previous = a); d[b] = a; a.parent = this.parent; this.parent = null; - }, insertAfter: function (a) { - var d = a.parent.children; - var b = CKEDITOR.tools.indexOf(d, a); var c = a.next; - - d.splice(b + 1, 0, this); this.next = a.next; this.previous = a; a.next = this; c && (c.previous = this); this.parent = a.parent; - }, insertBefore: function (a) { - var d = a.parent.children; var b = CKEDITOR.tools.indexOf(d, a); - - d.splice(b, 0, this); this.next = a; (this.previous = a.previous) && (a.previous.next = this); a.previous = this; this.parent = a.parent; - }, getAscendant: function (a) { - var d = typeof a === 'function' ? a : typeof a === 'string' ? function (b) { - return b.name == a; - } : function (b) { - return b.name in a; - }; var b = this.parent; - - for (;b && -b.type == CKEDITOR.NODE_ELEMENT;) { - if (d(b)) { - return b; - } b = b.parent; - } return null; - }, wrapWith: function (a) { - this.replaceWith(a); a.add(this); return a; - }, getIndex: function () { - return CKEDITOR.tools.indexOf(this.parent.children, this); - }, getFilterContext: function (a) { - return a || {}; - } }; - })(); 'use strict'; CKEDITOR.htmlParser.comment = function (a) { - this.value = a; this._ = { isBlockLike: !1 }; - }; - CKEDITOR.htmlParser.comment.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node(), { type: CKEDITOR.NODE_COMMENT, filter: function (a, d) { - var b = this.value; - - if (!(b = a.onComment(d, b, this))) { - return this.remove(), !1; - } if (typeof b !== 'string') { - return this.replaceWith(b), !1; - } this.value = b; return !0; - }, writeHtml: function (a, d) { - d && this.filter(d); a.comment(this.value); - } }); 'use strict'; - (function () { - CKEDITOR.htmlParser.text = function (a) { - this.value = a; this._ = { isBlockLike: !1 }; - }; CKEDITOR.htmlParser.text.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node(), { type: CKEDITOR.NODE_TEXT, filter: function (a, d) { - if (!(this.value = a.onText(d, this.value, this))) { - return this.remove(), !1; - } - }, writeHtml: function (a, d) { - d && this.filter(d); a.text(this.value); - } }); - })(); 'use strict'; - (function () { - CKEDITOR.htmlParser.cdata = function (a) { - this.value = a; - }; CKEDITOR.htmlParser.cdata.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node(), { type: CKEDITOR.NODE_TEXT, filter: function () {}, writeHtml: function (a) { - a.write(this.value); - } }); - })(); 'use strict'; CKEDITOR.htmlParser.fragment = function () { - this.children = []; this.parent = null; this._ = { isBlockLike: !0, hasInlineStarted: !1 }; - }; - (function () { - function a(a) { - return a.attributes['data-cke-survive'] ? !1 : a.name == 'a' && a.attributes.href || CKEDITOR.dtd.$removeEmpty[a.name]; - } var d = CKEDITOR.tools.extend({ table: 1, ul: 1, ol: 1, dl: 1 }, CKEDITOR.dtd.table, CKEDITOR.dtd.ul, CKEDITOR.dtd.ol, CKEDITOR.dtd.dl); var b = { ol: 1, ul: 1 }; var c = CKEDITOR.tools.extend({}, { html: 1 }, CKEDITOR.dtd.html, CKEDITOR.dtd.body, CKEDITOR.dtd.head, { style: 1, script: 1 }); var f = { ul: 'li', ol: 'li', dl: 'dd', table: 'tbody', tbody: 'tr', thead: 'tr', tfoot: 'tr', tr: 'td' }; - - CKEDITOR.htmlParser.fragment.fromHtml = -function (h, k, g) { - function l(a) { - var b; - - if (n.length > 0) { - for (var c = 0; c < n.length; c++) { - var d = n[c]; var f = d.name; var e = CKEDITOR.dtd[f]; var h = y.name && CKEDITOR.dtd[y.name]; - - h && !h[f] || a && e && !e[a] && CKEDITOR.dtd[a] ? f == y.name && (x(y, y.parent, 1), c--) : (b || (u(), b = 1), d = d.clone(), d.parent = y, y = d, n.splice(c, 1), c--); - } - } - } function u() { - for (;L.length;) { - x(L.shift(), y); - } - } function e(a) { - if (a._.isBlockLike && a.name != 'pre' && a.name != 'textarea') { - var b = a.children.length; var c = a.children[b - 1]; var d; - - c && c.type == CKEDITOR.NODE_TEXT && ((d = CKEDITOR.tools.rtrim(c.value)) ? - c.value = d : a.children.length = b - 1); - } - } function x(b, c, d) { - c = c || y || t; var f = y; - - void 0 === b.previous && (w(c, b) && (y = c, G.onTagOpen(g, {}), b.returnPoint = c = y), e(b), a(b) && !b.children.length || c.add(b), b.name == 'pre' && (I = !1), b.name == 'textarea' && (H = !1)); b.returnPoint ? (y = b.returnPoint, delete b.returnPoint) : y = d ? c : f; - } function w(a, b) { - if ((a == t || a.name == 'body') && g && (!a.name || CKEDITOR.dtd[a.name][g])) { - var c; var d; - - return (c = b.attributes && (d = b.attributes['data-cke-real-element-type']) ? d : b.name) && c in CKEDITOR.dtd.$inline && !(c in CKEDITOR.dtd.head) && -!b.isOrphan || b.type == CKEDITOR.NODE_TEXT; - } - } function z(a, b) { - return a in CKEDITOR.dtd.$listItem || a in CKEDITOR.dtd.$tableContent ? a == b || a == 'dt' && b == 'dd' || a == 'dd' && b == 'dt' : !1; - } var G = new CKEDITOR.htmlParser(); var t = k instanceof CKEDITOR.htmlParser.element ? k : typeof k === 'string' ? new CKEDITOR.htmlParser.element(k) : new CKEDITOR.htmlParser.fragment(); var n = []; var L = []; var y = t; var H = t.name == 'textarea'; var I = t.name == 'pre'; - - G.onTagOpen = function (f, e, h, g) { - e = new CKEDITOR.htmlParser.element(f, e); e.isUnknown && h && (e.isEmpty = !0); e.isOptionalClose = g; - if (a(e)) { - n.push(e); - } else { - if (f == 'pre') { - I = !0; - } else { - if (f == 'br' && I) { - y.add(new CKEDITOR.htmlParser.text('\n')); return; - }f == 'textarea' && (H = !0); - } if (f == 'br') { - L.push(e); - } else { - for (;!(g = (h = y.name) ? CKEDITOR.dtd[h] || (y._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) : c, e.isUnknown || y.isUnknown || g[f]);) { - if (y.isOptionalClose) { - G.onTagClose(h); - } else if (f in b && h in b) { - h = y.children, (h = h[h.length - 1]) && h.name == 'li' || x(h = new CKEDITOR.htmlParser.element('li'), y), !e.returnPoint && (e.returnPoint = y), y = h; - } else if (f in CKEDITOR.dtd.$listItem && -!z(f, h)) { - G.onTagOpen(f == 'li' ? 'ul' : 'dl', {}, 0, 1); - } else if (h in d && !z(f, h)) { - !e.returnPoint && (e.returnPoint = y), y = y.parent; - } else if (h in CKEDITOR.dtd.$inline && n.unshift(y), y.parent) { - x(y, y.parent, 1); - } else { - e.isOrphan = 1; break; - } - }l(f); u(); e.parent = y; e.isEmpty ? x(e) : y = e; - } - } - }; G.onTagClose = function (a) { - for (var b = n.length - 1; b >= 0; b--) { - if (a == n[b].name) { - n.splice(b, 1); return; - } - } for (var c = [], d = [], f = y; f != t && f.name != a;) { - f._.isBlockLike || d.unshift(f), c.push(f), f = f.returnPoint || f.parent; - } if (f != t) { - for (b = 0; b < c.length; b++) { - var e = c[b]; - - x(e, e.parent); - }y = -f; f._.isBlockLike && u(); x(f, f.parent); f == y && (y = y.parent); n = n.concat(d); - }a == 'body' && (g = !1); - }; G.onText = function (a) { - if (!(y._.hasInlineStarted && !L.length || I || H) && (a = CKEDITOR.tools.ltrim(a), a.length === 0)) { - return; - } var b = y.name; var e = b ? CKEDITOR.dtd[b] || (y._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) : c; - - if (!H && !e['#'] && b in d) { - G.onTagOpen(f[b] || ''), G.onText(a); - } else { - u(); l(); I || H || (a = a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g, ' ')); a = new CKEDITOR.htmlParser.text(a); if (w(y, a)) { - this.onTagOpen(g, {}, 0, 1); - } y.add(a); - } - }; G.onCDATA = -function (a) { - y.add(new CKEDITOR.htmlParser.cdata(a)); -}; G.onComment = function (a) { - u(); l(); y.add(new CKEDITOR.htmlParser.comment(a)); - }; G.parse(h); for (u(); y != t;) { - x(y, y.parent, 1); - }e(t); return t; -}; CKEDITOR.htmlParser.fragment.prototype = { type: CKEDITOR.NODE_DOCUMENT_FRAGMENT, add: function (a, b) { - isNaN(b) && (b = this.children.length); var c = b > 0 ? this.children[b - 1] : null; - - if (c) { - if (a._.isBlockLike && c.type == CKEDITOR.NODE_TEXT && (c.value = CKEDITOR.tools.rtrim(c.value), c.value.length === 0)) { - this.children.pop(); this.add(a); return; - }c.next = -a; - }a.previous = c; a.parent = this; this.children.splice(b, 0, a); this._.hasInlineStarted || (this._.hasInlineStarted = a.type == CKEDITOR.NODE_TEXT || a.type == CKEDITOR.NODE_ELEMENT && !a._.isBlockLike); - }, filter: function (a, b) { - b = this.getFilterContext(b); a.onRoot(b, this); this.filterChildren(a, !1, b); - }, filterChildren: function (a, b, c) { - if (this.childrenFilteredBy != a.id) { - c = this.getFilterContext(c); if (b && !this.parent) { - a.onRoot(c, this); - } this.childrenFilteredBy = a.id; for (b = 0; b < this.children.length; b++) { - !1 === this.children[b].filter(a, - c) && b--; - } - } - }, writeHtml: function (a, b) { - b && this.filter(b); this.writeChildrenHtml(a); - }, writeChildrenHtml: function (a, b, c) { - var d = this.getFilterContext(); - - if (c && !this.parent && b) { - b.onRoot(d, this); - }b && this.filterChildren(b, !1, d); b = 0; c = this.children; for (d = c.length; b < d; b++) { - c[b].writeHtml(a); - } - }, forEach: function (a, b, c) { - if (!(c || b && this.type != b)) { - var d = a(this); - } - - if (!1 !== d) { - c = this.children; for (var f = 0; f < c.length; f++) { - d = c[f], d.type == CKEDITOR.NODE_ELEMENT ? d.forEach(a, b) : b && d.type != b || a(d); - } - } - }, getFilterContext: function (a) { - return a || -{}; - } }; - })(); 'use strict'; - (function () { - function a() { - this.rules = []; - } function d(b, c, d, h) { - var k; var g; - - for (k in c) { - (g = b[k]) || (g = b[k] = new a()), g.add(c[k], d, h); - } - }CKEDITOR.htmlParser.filter = CKEDITOR.tools.createClass({ $: function (b) { - this.id = CKEDITOR.tools.getNextNumber(); this.elementNameRules = new a(); this.attributeNameRules = new a(); this.elementsRules = {}; this.attributesRules = {}; this.textRules = new a(); this.commentRules = new a(); this.rootRules = new a(); b && this.addRules(b, 10); - }, proto: { addRules: function (a, c) { - var f; - - typeof c === 'number' ? f = c : c && 'priority' in c && (f = -c.priority); typeof f !== 'number' && (f = 10); typeof c !== 'object' && (c = {}); a.elementNames && this.elementNameRules.addMany(a.elementNames, f, c); a.attributeNames && this.attributeNameRules.addMany(a.attributeNames, f, c); a.elements && d(this.elementsRules, a.elements, f, c); a.attributes && d(this.attributesRules, a.attributes, f, c); a.text && this.textRules.add(a.text, f, c); a.comment && this.commentRules.add(a.comment, f, c); a.root && this.rootRules.add(a.root, f, c); - }, applyTo: function (a) { - a.filter(this); - }, onElementName: function (a, c) { - return this.elementNameRules.execOnName(a, - c); - }, onAttributeName: function (a, c) { - return this.attributeNameRules.execOnName(a, c); - }, onText: function (a, c, d) { - return this.textRules.exec(a, c, d); - }, onComment: function (a, c, d) { - return this.commentRules.exec(a, c, d); - }, onRoot: function (a, c) { - return this.rootRules.exec(a, c); - }, onElement: function (a, c) { - for (var d = [this.elementsRules['^'], this.elementsRules[c.name], this.elementsRules.$], h, k = 0; k < 3; k++) { - if (h = d[k]) { - h = h.exec(a, c, this); if (!1 === h) { - return null; - } if (h && h != c) { - return this.onNode(a, h); - } if (c.parent && !c.name) { - break; - } - } - } return c; - }, - onNode: function (a, c) { - var d = c.type; - - return d == CKEDITOR.NODE_ELEMENT ? this.onElement(a, c) : d == CKEDITOR.NODE_TEXT ? new CKEDITOR.htmlParser.text(this.onText(a, c.value, c)) : d == CKEDITOR.NODE_COMMENT ? new CKEDITOR.htmlParser.comment(this.onComment(a, c.value, c)) : null; - }, onAttribute: function (a, c, d, h) { - return (d = this.attributesRules[d]) ? d.exec(a, h, c, this) : h; - } } }); CKEDITOR.htmlParser.filterRulesGroup = a; a.prototype = { add: function (a, c, d) { - this.rules.splice(this.findIndex(c), 0, { value: a, priority: c, options: d }); - }, addMany: function (a, - c, d) { - for (var h = [this.findIndex(c), 0], k = 0, g = a.length; k < g; k++) { - h.push({ value: a[k], priority: c, options: d }); - } this.rules.splice.apply(this.rules, h); - }, findIndex: function (a) { - for (var c = this.rules, d = c.length - 1; d >= 0 && a < c[d].priority;) { - d--; - } return d + 1; - }, exec: function (a, c) { - var d = c instanceof CKEDITOR.htmlParser.node || c instanceof CKEDITOR.htmlParser.fragment; var h = Array.prototype.slice.call(arguments, 1); var k = this.rules; var g = k.length; var l; var u; var e; var x; - - for (x = 0; x < g; x++) { - if (d && (l = c.type, u = c.name), e = k[x], !(a.nonEditable && !e.options.applyToAll || -a.nestedEditable && e.options.excludeNestedEditable)) { - e = e.value.apply(null, h); if (!1 === e || d && e && (e.name != u || e.type != l)) { - return e; - } e != null && (h[0] = c = e); - } - } return c; - }, execOnName: function (a, c) { - for (var d = 0, h = this.rules, k = h.length, g; c && d < k; d++) { - g = h[d], a.nonEditable && !g.options.applyToAll || a.nestedEditable && g.options.excludeNestedEditable || (c = c.replace(g.value[0], g.value[1])); - } return c; - } }; - })(); - (function () { - function a(a, d) { - function e(a) { - return a || CKEDITOR.env.needsNbspFiller ? new CKEDITOR.htmlParser.text(' ') : new CKEDITOR.htmlParser.element('br', { 'data-cke-bogus': 1 }); - } function p(a, d) { - return function (f) { - if (f.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) { - var q = []; var p = b(f); var m; var r; - - if (p) { - for (B(p, 1) && q.push(p); p;) { - h(p) && (m = c(p)) && B(m) && ((r = c(m)) && !h(r) ? q.push(m) : (e(g).insertAfter(m), m.remove())), p = p.previous; - } - } for (p = 0; p < q.length; p++) { - q[p].remove(); - } if (q = !a || !1 !== (typeof d === 'function' ? d(f) : d)) { - g || CKEDITOR.env.needsBrFiller || -f.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT ? g || CKEDITOR.env.needsBrFiller || !(document.documentMode > 7 || f.name in CKEDITOR.dtd.tr || f.name in CKEDITOR.dtd.$listItem) ? (q = b(f), q = !q || f.name == 'form' && q.name == 'input') : q = !1 : q = !1; - }q && f.add(e(a)); - } - }; - } function B(a, b) { - if ((!g || CKEDITOR.env.needsBrFiller) && a.type == CKEDITOR.NODE_ELEMENT && a.name == 'br' && !a.attributes['data-cke-eol']) { - return !0; - } var c; - - return a.type == CKEDITOR.NODE_TEXT && (c = a.value.match(L)) && (c.index && (new CKEDITOR.htmlParser.text(a.value.substring(0, c.index)).insertBefore(a), - a.value = c[0]), !CKEDITOR.env.needsBrFiller && g && (!b || a.parent.name in v) || !g && ((c = a.previous) && c.name == 'br' || !c || h(c))) ? !0 : !1; - } var r = { elements: {} }; var g = d == 'html'; var v = CKEDITOR.tools.extend({}, m); var D; - - for (D in v) { - '#' in H[D] || delete v[D]; - } for (D in v) { - r.elements[D] = p(g, a.config.fillEmptyBlocks); - }r.root = p(g, !1); r.elements.br = (function (a) { - return function (b) { - if (b.parent.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) { - var d = b.attributes; - - if ('data-cke-bogus' in d || 'data-cke-eol' in d) { - delete d['data-cke-bogus']; - } else { - for (d = b.next; d && f(d);) { - d = -d.next; - } var q = c(b); - - !d && h(b.parent) ? k(b.parent, e(a)) : h(d) && q && !h(q) && e(a).insertBefore(d); - } - } - }; - })(g); return r; - } function d(a, b) { - return a != CKEDITOR.ENTER_BR && !1 !== b ? a == CKEDITOR.ENTER_DIV ? 'div' : 'p' : !1; - } function b(a) { - for (a = a.children[a.children.length - 1]; a && f(a);) { - a = a.previous; - } return a; - } function c(a) { - for (a = a.previous; a && f(a);) { - a = a.previous; - } return a; - } function f(a) { - return a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(a.value) || a.type == CKEDITOR.NODE_ELEMENT && a.attributes['data-cke-bookmark']; - } function h(a) { - return a && -(a.type == CKEDITOR.NODE_ELEMENT && a.name in m || a.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT); - } function k(a, b) { - var c = a.children[a.children.length - 1]; - - a.children.push(b); b.parent = a; c && (c.next = b, b.previous = c); - } function g(a) { - a = a.attributes; a.contenteditable != 'false' && (a['data-cke-editable'] = a.contenteditable ? 'true' : 1); a.contenteditable = 'false'; - } function l(a) { - a = a.attributes; switch (a['data-cke-editable']) { - case 'true':a.contenteditable = 'true'; break; case '1':delete a.contenteditable; - } - } function u(a) { - return a.replace(r, - function (a, b, c) { - return '\x3c' + b + c.replace(D, function (a, b) { - return B.test(b) && c.indexOf('data-cke-saved-' + b) == -1 ? ' data-cke-saved-' + a + ' data-cke-' + CKEDITOR.rnd + '-' + a : a; - }) + '\x3e'; - }); - } function e(a, b) { - return a.replace(b, function (a, b, c) { - a.indexOf('\x3ctextarea') === 0 && (a = b + z(c).replace(//g, '\x26gt;') + '\x3c/textarea\x3e'); return '\x3ccke:encoded\x3e' + encodeURIComponent(a) + '\x3c/cke:encoded\x3e'; - }); - } function x(a) { - return a.replace(S, function (a, b) { - return decodeURIComponent(b); - }); - } function w(a) { - return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g, - function (a) { - return '\x3c!--' + y + '{C}' + encodeURIComponent(a).replace(/--/g, '%2D%2D') + '--\x3e'; - }); - } function z(a) { - return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g, function (a, b) { - return decodeURIComponent(b); - }); - } function G(a, b) { - var c = b._.dataStore; - - return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g, function (a, b) { - return decodeURIComponent(b); - }).replace(/\{cke_protected_(\d+)\}/g, function (a, b) { - return c && c[b] || ''; - }); - } function t(a, b) { - var c = []; var d = b.config.protectedSource; var e = b._.dataStore || (b._.dataStore = -{ id: 1 }); var f = /<\!--\{cke_temp(comment)?\}(\d*?)--\x3e/g; var d = [/|$)/gi, //gi, //gi].concat(d); - - a = a.replace(/\x3c!--[\s\S]*?--\x3e/g, function (a) { - return '\x3c!--{cke_tempcomment}' + (c.push(a) - 1) + '--\x3e'; - }); for (var p = 0; p < d.length; p++) { - a = a.replace(d[p], function (a) { - a = a.replace(f, function (a, b, d) { - return c[d]; - }); return (/cke_temp(comment)?/).test(a) ? a : '\x3c!--{cke_temp}' + (c.push(a) - 1) + '--\x3e'; - }); - }a = a.replace(f, function (a, b, d) { - return '\x3c!--' + y + (b ? '{C}' : - '') + encodeURIComponent(c[d]).replace(/--/g, '%2D%2D') + '--\x3e'; - }); a = a.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g, function (a) { - return a.replace(/\x3c!--\{cke_protected\}([^>]*)--\x3e/g, function (a, b) { - e[e.id] = decodeURIComponent(b); return '{cke_protected_' + e.id++ + '}'; - }); - }); return a = a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g, function (a, c, d, e) { - return '\x3c' + c + d + '\x3e' + G(z(e), b) + '\x3c/' + c + '\x3e'; - }); - } var n; - - CKEDITOR.htmlDataProcessor = function (b) { - var c; - var f; var m = this; - - this.editor = b; this.dataFilter = c = new CKEDITOR.htmlParser.filter(); this.htmlFilter = f = new CKEDITOR.htmlParser.filter(); this.writer = new CKEDITOR.htmlParser.basicWriter(); c.addRules(C); c.addRules(K, { applyToAll: !0 }); c.addRules(a(b, 'data'), { applyToAll: !0 }); f.addRules(A); f.addRules(M, { applyToAll: !0 }); f.addRules(a(b, 'html'), { applyToAll: !0 }); b.on('toHtml', function (a) { - a = a.data; var c = a.dataValue; var f; var c = n(c); var c = t(c, b); var c = e(c, T); var c = u(c); var c = e(c, v); var c = c.replace(p, '$1cke:$2'); var c = c.replace(O, '\x3ccke:$1$2\x3e\x3c/cke:$1\x3e'); - var c = c.replace(/(]*>)(\r\n|\n)/g, '$1$2$2'); var c = c.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi, '$1data-cke-' + CKEDITOR.rnd + '-$2'); - - f = a.context || b.editable().getName(); var m; - - CKEDITOR.env.ie && CKEDITOR.env.version < 9 && f == 'pre' && (f = 'div', c = '\x3cpre\x3e' + c + '\x3c/pre\x3e', m = 1); f = b.document.createElement(f); f.setHtml('a' + c); c = f.getHtml().substr(1); c = c.replace(new RegExp('data-cke-' + CKEDITOR.rnd + '-', 'ig'), ''); m && (c = c.replace(/^
|<\/pre>$/gi, '')); c = c.replace(N, '$1$2'); c = x(c); c = z(c); f = !1 === a.fixForBody ? !1 :
-                            d(a.enterMode, b.config.autoParagraph); c = CKEDITOR.htmlParser.fragment.fromHtml(c, a.context, f); f && (m = c, !m.children.length && CKEDITOR.dtd[m.name][f] && (f = new CKEDITOR.htmlParser.element(f), m.add(f))); a.dataValue = c;
-                    }, null, null, 5); b.on('toHtml', function (a) {
-                        a.data.filter.applyTo(a.data.dataValue, !0, a.data.dontFilter, a.data.enterMode) && b.fire('dataFiltered');
-                    }, null, null, 6); b.on('toHtml', function (a) {
-                        a.data.dataValue.filterChildren(m.dataFilter, !0);
-                    }, null, null, 10); b.on('toHtml', function (a) {
-                        a = a.data; var b = a.dataValue;
-                        var c = new CKEDITOR.htmlParser.basicWriter();
-
-                        b.writeChildrenHtml(c); b = c.getHtml(!0); a.dataValue = w(b);
-                    }, null, null, 15); b.on('toDataFormat', function (a) {
-                        var c = a.data.dataValue;
-
-                        a.data.enterMode != CKEDITOR.ENTER_BR && (c = c.replace(/^
/i, '')); a.data.dataValue = CKEDITOR.htmlParser.fragment.fromHtml(c, a.data.context, d(a.data.enterMode, b.config.autoParagraph)); - }, null, null, 5); b.on('toDataFormat', function (a) { - a.data.dataValue.filterChildren(m.htmlFilter, !0); - }, null, null, 10); b.on('toDataFormat', function (a) { - a.data.filter.applyTo(a.data.dataValue, - !1, !0); - }, null, null, 11); b.on('toDataFormat', function (a) { - var c = a.data.dataValue; var d = m.writer; - - d.reset(); c.writeChildrenHtml(d); c = d.getHtml(!0); c = z(c); c = G(c, b); a.data.dataValue = c; - }, null, null, 15); - }; CKEDITOR.htmlDataProcessor.prototype = { toHtml: function (a, b, c, d) { - var f = this.editor; var e; var p; var m; var h; - - b && typeof b === 'object' ? (e = b.context, c = b.fixForBody, d = b.dontFilter, p = b.filter, m = b.enterMode, h = b.protectedWhitespaces) : e = b; e || e === null || (e = f.editable().getName()); return f.fire('toHtml', { dataValue: a, context: e, fixForBody: c, dontFilter: d, - filter: p || f.filter, enterMode: m || f.enterMode, protectedWhitespaces: h }).dataValue; - }, toDataFormat: function (a, b) { - var c; var d; var f; - - b && (c = b.context, d = b.filter, f = b.enterMode); c || c === null || (c = this.editor.editable().getName()); return this.editor.fire('toDataFormat', { dataValue: a, filter: d || this.editor.filter, context: c, enterMode: f || this.editor.enterMode }).dataValue; - } }; var L = /(?: |\xa0)$/; var y = '{cke_protected}'; var H = CKEDITOR.dtd; var I = 'caption colgroup col thead tfoot tbody'.split(' '); var m = CKEDITOR.tools.extend({}, H.$blockLimit, - H.$block); var C = { elements: { input: g, textarea: g } }; var K = { attributeNames: [[/^on/, 'data-cke-pa-on'], [/^srcdoc/, 'data-cke-pa-srcdoc'], [/^data-cke-expando$/, '']], elements: { iframe: function (a) { - if (a.attributes && a.attributes.src) { - var b = a.attributes.src.toLowerCase().replace(/[^a-z]/gi, ''); - - if (b.indexOf('javascript') === 0 || b.indexOf('data') === 0) { - a.attributes['data-cke-pa-src'] = a.attributes.src, delete a.attributes.src; - } - } - } } }; var A = { elements: { embed: function (a) { - var b = a.parent; - - if (b && b.name == 'object') { - var c = b.attributes.width; var b = b.attributes.height; - - c && (a.attributes.width = c); b && (a.attributes.height = b); - } - }, a: function (a) { - var b = a.attributes; - - if (!(a.children.length || b.name || b.id || a.attributes['data-cke-saved-name'])) { - return !1; - } - } } }; var M = { elementNames: [[/^cke:/, ''], [/^\?xml:namespace$/, '']], attributeNames: [[/^data-cke-(saved|pa)-/, ''], [/^data-cke-.*/, ''], ['hidefocus', '']], elements: { $: function (a) { - var b = a.attributes; - - if (b) { - if (b['data-cke-temp']) { - return !1; - } for (var c = ['name', 'href', 'src'], d, f = 0; f < c.length; f++) { - d = 'data-cke-saved-' + c[f], d in b && delete b[c[f]]; - } - } return a; - }, - table: function (a) { - a.children.slice(0).sort(function (a, b) { - var c; var d; - - a.type == CKEDITOR.NODE_ELEMENT && b.type == a.type && (c = CKEDITOR.tools.indexOf(I, a.name), d = CKEDITOR.tools.indexOf(I, b.name)); c > -1 && d > -1 && c != d || (c = a.parent ? a.getIndex() : -1, d = b.parent ? b.getIndex() : -1); return c > d ? 1 : -1; - }); - }, param: function (a) { - a.children = []; a.isEmpty = !0; return a; - }, span: function (a) { - a.attributes.class == 'Apple-style-span' && delete a.name; - }, html: function (a) { - delete a.attributes.contenteditable; delete a.attributes.class; - }, body: function (a) { - delete a.attributes.spellcheck; - delete a.attributes.contenteditable; - }, style: function (a) { - var b = a.children[0]; - - b && b.value && (b.value = CKEDITOR.tools.trim(b.value)); a.attributes.type || (a.attributes.type = 'text/css'); - }, title: function (a) { - var b = a.children[0]; - - !b && k(a, b = new CKEDITOR.htmlParser.text()); b.value = a.attributes['data-cke-title'] || ''; - }, input: l, textarea: l }, attributes: { class: function (a) { - return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g, '')) || !1; - } } }; - - CKEDITOR.env.ie && (M.attributes.style = function (a) { - return a.replace(/(^|;)([^\:]+)/g, - function (a) { - return a.toLowerCase(); - }); - }); var r = /<(a|area|img|input|source)\b([^>]*)>/gi; var D = /([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi; var B = /^(href|src|name)$/i; var v = /(?:])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi; var T = /(])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi; var S = /([^<]*)<\/cke:encoded>/gi; var p = /(<\/?)((?:object|embed|param|html|body|head|title)([\s][^>]*)?>)/gi; var N = /(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi; var O = /]*?)\/?>(?!\s*<\/cke:\1)/gi; - - n = (function () { - function a(c) { - return CKEDITOR.tools.array.reduce(c.split(''), function (a, c) { - var d = c.toLowerCase(); var f = c.toUpperCase(); var e = b(d); - - d !== f && (e += '|' + b(f)); return a + ('(' + e + ')'); - }, ''); - } function b(a) { - var c; - - c = a.charCodeAt(0); var d = c.toString(16); - - c = { htmlCode: '\x26#' + c + ';?', hex: '\x26#x0*' + d + ';?', entity: { '\x3c': '\x26lt;', '\x3e': '\x26gt;', ':': '\x26colon;' }[a] }; for (var f in c) { - c[f] && (a += '|' + c[f]); - } return a; - } var c = new RegExp('(' + a('\x3ccke:encoded\x3e') + '(.*?)' + a('\x3c/cke:encoded\x3e') + ')|(' + a('\x3c') + a('/') + -'?' + a('cke:encoded\x3e') + ')', 'gi'); var d = new RegExp('((' + a('{cke_protected') + ')(_[0-9]*)?' + a('}') + ')', 'gi'); - - return function (a) { - return a.replace(c, '').replace(d, ''); - }; - })(); - })(); 'use strict'; - CKEDITOR.htmlParser.element = function (a, d) { - this.name = a; this.attributes = d || {}; this.children = []; var b = a || ''; var c = b.match(/^cke:(.*)/); - - c && (b = c[1]); b = !!(CKEDITOR.dtd.$nonBodyContent[b] || CKEDITOR.dtd.$block[b] || CKEDITOR.dtd.$listItem[b] || CKEDITOR.dtd.$tableContent[b] || CKEDITOR.dtd.$nonEditable[b] || b == 'br'); this.isEmpty = !!CKEDITOR.dtd.$empty[a]; this.isUnknown = !CKEDITOR.dtd[a]; this._ = { isBlockLike: b, hasInlineStarted: this.isEmpty || !b }; - }; - CKEDITOR.htmlParser.cssStyle = function (a) { - var d = {}; - - ((a instanceof CKEDITOR.htmlParser.element ? a.attributes.style : a) || '').replace(/"/g, '"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function (a, c, f) { - c == 'font-family' && (f = f.replace(/["']/g, '')); d[c.toLowerCase()] = f; - }); return { rules: d, populate: function (a) { - var c = this.toString(); - - c && (a instanceof CKEDITOR.dom.element ? a.setAttribute('style', c) : a instanceof CKEDITOR.htmlParser.element ? a.attributes.style = c : a.style = c); - }, toString: function () { - var a = []; var c; - - for (c in d) { - d[c] && a.push(c, ':', d[c], ';'); - } return a.join(''); - } }; - }; - (function () { - function a(a) { - return function (b) { - return b.type == CKEDITOR.NODE_ELEMENT && (typeof a === 'string' ? b.name == a : b.name in a); - }; - } var d = function (a, b) { - a = a[0]; b = b[0]; return a < b ? -1 : a > b ? 1 : 0; - }; var b = CKEDITOR.htmlParser.fragment.prototype; - - CKEDITOR.htmlParser.element.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node(), { type: CKEDITOR.NODE_ELEMENT, add: b.add, clone: function () { - return new CKEDITOR.htmlParser.element(this.name, this.attributes); - }, filter: function (a, b) { - var d = this; var k; var g; - - b = d.getFilterContext(b); if (!d.parent) { - a.onRoot(b, - d); - } for (;;) { - k = d.name; if (!(g = a.onElementName(b, k))) { - return this.remove(), !1; - } d.name = g; if (!(d = a.onElement(b, d))) { - return this.remove(), !1; - } if (d !== this) { - return this.replaceWith(d), !1; - } if (d.name == k) { - break; - } if (d.type != CKEDITOR.NODE_ELEMENT) { - return this.replaceWith(d), !1; - } if (!d.name) { - return this.replaceWithChildren(), !1; - } - }k = d.attributes; var l; var u; - - for (l in k) { - for (g = k[l]; ;) { - if (u = a.onAttributeName(b, l)) { - if (u != l) { - delete k[l], l = u; - } else { - break; - } - } else { - delete k[l]; break; - } - }u && (!1 === (g = a.onAttribute(b, d, u, g)) ? delete k[u] : k[u] = g); - }d.isEmpty || -this.filterChildren(a, !1, b); return !0; - }, filterChildren: b.filterChildren, writeHtml: function (a, b) { - b && this.filter(b); var h = this.name; var k = []; var g = this.attributes; var l; var u; - - a.openTag(h, g); for (l in g) { - k.push([l, g[l]]); - }a.sortAttributes && k.sort(d); l = 0; for (u = k.length; l < u; l++) { - g = k[l], a.attribute(g[0], g[1]); - }a.openTagClose(h, this.isEmpty); this.writeChildrenHtml(a); this.isEmpty || a.closeTag(h); - }, writeChildrenHtml: b.writeChildrenHtml, replaceWithChildren: function () { - for (var a = this.children, b = a.length; b;) { - a[--b].insertAfter(this); - } - this.remove(); - }, forEach: b.forEach, getFirst: function (b) { - if (!b) { - return this.children.length ? this.children[0] : null; - } typeof b !== 'function' && (b = a(b)); for (var d = 0, h = this.children.length; d < h; ++d) { - if (b(this.children[d])) { - return this.children[d]; - } - } return null; - }, getHtml: function () { - var a = new CKEDITOR.htmlParser.basicWriter(); - - this.writeChildrenHtml(a); return a.getHtml(); - }, setHtml: function (a) { - a = this.children = CKEDITOR.htmlParser.fragment.fromHtml(a).children; for (var b = 0, d = a.length; b < d; ++b) { - a[b].parent = this; - } - }, getOuterHtml: function () { - var a = -new CKEDITOR.htmlParser.basicWriter(); - - this.writeHtml(a); return a.getHtml(); - }, split: function (a) { - for (var b = this.children.splice(a, this.children.length - a), d = this.clone(), k = 0; k < b.length; ++k) { - b[k].parent = d; - }d.children = b; b[0] && (b[0].previous = null); a > 0 && (this.children[a - 1].next = null); this.parent.add(d, this.getIndex() + 1); return d; - }, find: function (a, b) { - void 0 === b && (b = !1); var d = []; var k; - - for (k = 0; k < this.children.length; k++) { - var g = this.children[k]; - - typeof a === 'function' && a(g) ? d.push(g) : typeof a === 'string' && g.name === a && d.push(g); - b && g.find && (d = d.concat(g.find(a, b))); - } return d; - }, findOne: function (a, b) { - var d = null; var k = CKEDITOR.tools.array.find(this.children, function (g) { - var k = typeof a === 'function' ? a(g) : g.name === a; - - if (k || !b) { - return k; - } g.children && g.findOne && (d = g.findOne(a, !0)); return !!d; - }); - - return d || k || null; - }, addClass: function (a) { - if (!this.hasClass(a)) { - var b = this.attributes.class || ''; - - this.attributes.class = b + (b ? ' ' : '') + a; - } - }, removeClass: function (a) { - var b = this.attributes.class; - - b && ((b = CKEDITOR.tools.trim(b.replace(new RegExp('(?:\\s+|^)' + -a + '(?:\\s+|$)'), ' '))) ? this.attributes.class = b : delete this.attributes.class); - }, hasClass: function (a) { - var b = this.attributes.class; - - return b ? new RegExp('(?:^|\\s)' + a + '(?\x3d\\s|$)').test(b) : !1; - }, getFilterContext: function (a) { - var b = []; - - a || (a = { nonEditable: !1, nestedEditable: !1 }); a.nonEditable || this.attributes.contenteditable != 'false' ? a.nonEditable && !a.nestedEditable && this.attributes.contenteditable == 'true' && b.push('nestedEditable', !0) : b.push('nonEditable', !0); if (b.length) { - a = CKEDITOR.tools.copy(a); - for (var d = 0; d < b.length; d += 2) { - a[b[d]] = b[d + 1]; - } - } return a; - } }, !0); - })(); (function () { - var a = /{([^}]+)}/g; - - CKEDITOR.template = function (a) { - this.source = typeof a === 'function' ? a : String(a); - }; CKEDITOR.template.prototype.output = function (d, b) { - var c = (typeof this.source === 'function' ? this.source(d) : this.source).replace(a, function (a, b) { - return void 0 !== d[b] ? d[b] : a; - }); - - return b ? b.push(c) : c; - }; - })(); delete CKEDITOR.loadFullCore; CKEDITOR.instances = {}; CKEDITOR.document = new CKEDITOR.dom.document(document); - CKEDITOR.add = function (a) { - function d() { - CKEDITOR.currentInstance == a && (CKEDITOR.currentInstance = null, CKEDITOR.fire('currentInstance')); - }CKEDITOR.instances[a.name] = a; a.on('focus', function () { - CKEDITOR.currentInstance != a && (CKEDITOR.currentInstance = a, CKEDITOR.fire('currentInstance')); - }); a.on('blur', d); a.on('destroy', d); CKEDITOR.fire('instance', null, a); - }; CKEDITOR.remove = function (a) { - delete CKEDITOR.instances[a.name]; - }; - (function () { - var a = {}; - - CKEDITOR.addTemplate = function (d, b) { - var c = a[d]; - - if (c) { - return c; - } c = { name: d, source: b }; CKEDITOR.fire('template', c); return a[d] = new CKEDITOR.template(c.source); - }; CKEDITOR.getTemplate = function (d) { - return a[d]; - }; - })(); (function () { - var a = []; - - CKEDITOR.addCss = function (d) { - a.push(d); - }; CKEDITOR.getCss = function () { - return a.join('\n'); - }; - })(); CKEDITOR.on('instanceDestroyed', function () { - CKEDITOR.tools.isEmpty(this.instances) && CKEDITOR.fire('reset'); - }); CKEDITOR.TRISTATE_ON = 1; CKEDITOR.TRISTATE_OFF = 2; - CKEDITOR.TRISTATE_DISABLED = 0; - (function () { - CKEDITOR.inline = function (a, d) { - a = CKEDITOR.editor._getEditorElement(a); if (!a) { - return null; - } var b = new CKEDITOR.editor(d, a, CKEDITOR.ELEMENT_MODE_INLINE); var c = a.is('textarea') ? a : null; - - c ? (b.setData(c.getValue(), null, !0), a = CKEDITOR.dom.element.createFromHtml('\x3cdiv contenteditable\x3d"' + !!b.readOnly + '" class\x3d"cke_textarea_inline"\x3e' + c.getValue() + '\x3c/div\x3e', CKEDITOR.document), a.insertAfter(c), c.hide(), c.$.form && b._attachToForm()) : (d && typeof d.readOnly !== 'undefined' && !d.readOnly && a.setAttribute('contenteditable', - 'true'), b.setData(a.getHtml(), null, !0)); b.on('loaded', function () { - b.fire('uiReady'); b.editable(a); b.container = a; b.ui.contentsElement = a; b.setData(b.getData(1)); b.resetDirty(); b.fire('contentDom'); b.mode = 'wysiwyg'; b.fire('mode'); b.status = 'ready'; b.fireOnce('instanceReady'); CKEDITOR.fire('instanceReady', null, b); - }, null, null, 1E4); b.on('destroy', function () { - var a = b.container; - - c && a && (a.clearCustomData(), a.remove()); c && c.show(); b.element.clearCustomData(); delete b.element; - }); return b; - }; CKEDITOR.inlineAll = function () { - var a; - var d; var b; - - for (b in CKEDITOR.dtd.$editable) { - for (var c = CKEDITOR.document.getElementsByTag(b), f = 0, h = c.count(); f < h; f++) { - a = c.getItem(f), a.getAttribute('contenteditable') == 'true' && (d = { element: a, config: {} }, !1 !== CKEDITOR.fire('inline', d) && CKEDITOR.inline(a, d.config)); - } - } - }; CKEDITOR.domReady(function () { - !CKEDITOR.disableAutoInline && CKEDITOR.inlineAll(); - }); - })(); CKEDITOR.replaceClass = 'ckeditor'; - (function () { - function a(a, f, h, k) { - a = CKEDITOR.editor._getEditorElement(a); if (!a) { - return null; - } var g = new CKEDITOR.editor(f, a, k); - - k == CKEDITOR.ELEMENT_MODE_REPLACE && (a.setStyle('visibility', 'hidden'), g._.required = a.hasAttribute('required'), a.removeAttribute('required')); h && g.setData(h, null, !0); g.on('loaded', function () { - g.isDestroyed() || g.isDetached() || (b(g), k == CKEDITOR.ELEMENT_MODE_REPLACE && g.config.autoUpdateElement && a.$.form && g._attachToForm(), g.setMode(g.config.startupMode, function () { - g.resetDirty(); g.status = -'ready'; g.fireOnce('instanceReady'); CKEDITOR.fire('instanceReady', null, g); - })); - }); g.on('destroy', d); return g; - } function d() { - var a = this.container; var b = this.element; - - a && (a.clearCustomData(), a.remove()); b && (b.clearCustomData(), this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && (b.show(), this._.required && b.setAttribute('required', 'required')), delete this.element); - } function b(a) { - var b = a.name; var d = a.element; var k = a.elementMode; var g = a.fire('uiSpace', { space: 'top', html: '' }).html; var l = a.fire('uiSpace', { space: 'bottom', html: '' }).html; - var u = new CKEDITOR.template('\x3c{outerEl} id\x3d"cke_{name}" class\x3d"{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} ' + CKEDITOR.env.cssClass + '" dir\x3d"{langDir}" lang\x3d"{langCode}" role\x3d"application"' + (a.title ? ' aria-labelledby\x3d"cke_{name}_arialbl"' : '') + '\x3e' + (a.title ? '\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e' : '') + '\x3c{outerEl} class\x3d"cke_inner cke_reset" role\x3d"presentation"\x3e{topHtml}\x3c{outerEl} id\x3d"{contentId}" class\x3d"cke_contents cke_reset" role\x3d"presentation"\x3e\x3c/{outerEl}\x3e{bottomHtml}\x3c/{outerEl}\x3e\x3c/{outerEl}\x3e'); - var b = CKEDITOR.dom.element.createFromHtml(u.output({ id: a.id, name: b, langDir: a.lang.dir, langCode: a.langCode, voiceLabel: a.title, topHtml: g ? '\x3cspan id\x3d"' + a.ui.spaceId('top') + '" class\x3d"cke_top cke_reset_all" role\x3d"presentation" style\x3d"height:auto"\x3e' + g + '\x3c/span\x3e' : '', contentId: a.ui.spaceId('contents'), bottomHtml: l ? '\x3cspan id\x3d"' + a.ui.spaceId('bottom') + '" class\x3d"cke_bottom cke_reset_all" role\x3d"presentation"\x3e' + l + '\x3c/span\x3e' : '', outerEl: CKEDITOR.env.ie ? 'span' : 'div' })); - - k == CKEDITOR.ELEMENT_MODE_REPLACE ? - (d.hide(), b.insertAfter(d)) : d.append(b); a.container = b; a.ui.contentsElement = a.ui.space('contents'); g && a.ui.space('top').unselectable(); l && a.ui.space('bottom').unselectable(); d = a.config.width; k = a.config.height; d && b.setStyle('width', CKEDITOR.tools.cssLength(d)); k && a.ui.space('contents').setStyle('height', CKEDITOR.tools.cssLength(k)); b.disableContextMenu(); CKEDITOR.env.webkit && b.on('focus', function () { - a.focus(); - }); a.fireOnce('uiReady'); - }CKEDITOR.replace = function (b, d) { - return a(b, d, null, CKEDITOR.ELEMENT_MODE_REPLACE); - }; - CKEDITOR.appendTo = function (b, d, h) { - return a(b, d, h, CKEDITOR.ELEMENT_MODE_APPENDTO); - }; CKEDITOR.replaceAll = function () { - for (var a = document.getElementsByTagName('textarea'), b = 0; b < a.length; b++) { - var d = null; var k = a[b]; - - if (k.name || k.id) { - if (typeof arguments[0] === 'string') { - if (!new RegExp('(?:^|\\s)' + arguments[0] + '(?:$|\\s)').test(k.className)) { - continue; - } - } else if (typeof arguments[0] === 'function' && (d = {}, !1 === arguments[0](k, d))) { - continue; - } this.replace(k, d); - } - } - }; CKEDITOR.editor.prototype.addMode = function (a, b) { - (this._.modes || (this._.modes = -{}))[a] = b; - }; CKEDITOR.editor.prototype.setMode = function (a, b) { - var d = this; var k = this._.modes; - - if (a != d.mode && k && k[a]) { - d.fire('beforeSetMode', a); if (d.mode) { - var g = d.checkDirty(); var k = d._.previousModeData; var l; var u = 0; - - d.fire('beforeModeUnload'); d.editable(0); d._.previousMode = d.mode; d._.previousModeData = l = d.getData(1); d.mode == 'source' && k == l && (d.fire('lockSnapshot', { forceUpdate: !0 }), u = 1); d.ui.space('contents').setHtml(''); d.mode = ''; - } else { - d._.previousModeData = d.getData(1); - } this._.modes[a](function () { - d.mode = a; void 0 !== g && !g && -d.resetDirty(); u ? d.fire('unlockSnapshot') : a == 'wysiwyg' && d.fire('saveSnapshot'); setTimeout(function () { - d.isDestroyed() || d.isDetached() || (d.fire('mode'), b && b.call(d)); - }, 0); - }); - } - }; CKEDITOR.editor.prototype.resize = function (a, b, d, k) { - var g = this.container; var l = this.ui.space('contents'); var u = CKEDITOR.env.webkit && this.document && this.document.getWindow().$.frameElement; - - k = k ? this.container.getFirst(function (a) { - return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass('cke_inner'); - }) : g; a = CKEDITOR.tools.convertToPx(CKEDITOR.tools.cssLength(a)); - k.setSize('width', a, !0); u && (u.style.width = '1%'); b = CKEDITOR.tools.convertToPx(CKEDITOR.tools.cssLength(b)); var e = (k.$.offsetHeight || 0) - (l.$.clientHeight || 0); var g = Math.max(b - (d ? 0 : e), 0); - - b = d ? b + e : b; l.setStyle('height', CKEDITOR.tools.cssLength(g)); u && (u.style.width = '100%'); this.fire('resize', { outerHeight: b, contentsHeight: g, outerWidth: a || k.getSize('width') }); - }; CKEDITOR.editor.prototype.getResizable = function (a) { - return a ? this.ui.space('contents') : this.container; - }; CKEDITOR.domReady(function () { - CKEDITOR.replaceClass && -CKEDITOR.replaceAll(CKEDITOR.replaceClass); - }); - })(); CKEDITOR.config.startupMode = 'wysiwyg'; - (function () { - function a(a) { - var b = a.editor; var e = a.data.path; var f = e.blockLimit; var g = a.data.selection; var r = g.getRanges()[0]; var h; - - if (CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller) { - if (g = d(g, e)) { - g.appendBogus(), h = CKEDITOR.env.ie && !CKEDITOR.env.edge || CKEDITOR.env.edge && b._.previousActive; - } - }k(b, e.block, f) && r.collapsed && !r.getCommonAncestor().isReadOnly() && (e = r.clone(), e.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS), f = new CKEDITOR.dom.walker(e), f.guard = function (a) { - return !c(a) || a.type == CKEDITOR.NODE_COMMENT || a.isReadOnly(); - }, - !f.checkForward() || e.checkStartOfBlock() && e.checkEndOfBlock()) && (b = r.fixBlock(!0, b.activeEnterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p'), CKEDITOR.env.needsBrFiller || (b = b.getFirst(c)) && b.type == CKEDITOR.NODE_TEXT && CKEDITOR.tools.trim(b.getText()).match(/^(?: |\xa0)$/) && b.remove(), h = 1, a.cancel()); h && r.select(); - } function d(a, b) { - if (a.isFake) { - return 0; - } var d = b.block || b.blockLimit; var e = d && d.getLast(c); - - if (!(!d || !d.isBlockBoundary() || e && e.type == CKEDITOR.NODE_ELEMENT && e.isBlockBoundary() || d.is('pre') || d.getBogus())) { - return d; - } - } - function b(a) { - var b = a.data.getTarget(); - - b.is('input') && (b = b.getAttribute('type'), b != 'submit' && b != 'reset' || a.data.preventDefault()); - } function c(a) { - return x(a) && w(a); - } function f(a, b) { - return function (c) { - var d = c.data.$.toElement || c.data.$.fromElement || c.data.$.relatedTarget; - - (d = d && d.nodeType == CKEDITOR.NODE_ELEMENT ? new CKEDITOR.dom.element(d) : null) && (b.equals(d) || b.contains(d)) || a.call(this, c); - }; - } function h(a) { - function b(a) { - return function (b, e) { - e && b.type == CKEDITOR.NODE_ELEMENT && b.is(f) && (d = b); if (!(e || !c(b) || -a && G(b))) { - return !1; - } - }; - } var d; var e = a.getRanges()[0]; - - a = a.root; var f = { table: 1, ul: 1, ol: 1, dl: 1 }; - - if (e.startPath().contains(f)) { - var r = e.clone(); - - r.collapse(1); r.setStartAt(a, CKEDITOR.POSITION_AFTER_START); a = new CKEDITOR.dom.walker(r); a.guard = b(); a.checkBackward(); if (d) { - return r = e.clone(), r.collapse(), r.setEndAt(d, CKEDITOR.POSITION_AFTER_END), a = new CKEDITOR.dom.walker(r), a.guard = b(!0), d = !1, a.checkForward(), d; - } - } return null; - } function k(a, b, c) { - return !1 !== a.config.autoParagraph && a.activeEnterMode != CKEDITOR.ENTER_BR && (a.editable().equals(c) && -!b || b && b.getAttribute('contenteditable') == 'true'); - } function g(a) { - return a.activeEnterMode != CKEDITOR.ENTER_BR && !1 !== a.config.autoParagraph ? a.activeEnterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p' : !1; - } function l(a) { - a && a.isEmptyInlineRemoveable() && a.remove(); - } function u(a) { - var b = a.editor; - - b.getSelection().scrollIntoView(); setTimeout(function () { - b.fire('saveSnapshot'); - }, 0); - } function e(a, b, c) { - var d = a.getCommonAncestor(b); - - for (b = a = c ? b : a; (a = a.getParent()) && !d.equals(a) && a.getChildCount() == 1;) { - b = a; - }b.remove(); - } var x; var w; var z; var G; var t; - var n; var L; var y; var H; var I; - - CKEDITOR.editable = CKEDITOR.tools.createClass({ base: CKEDITOR.dom.element, $: function (a, b) { - this.base(b.$ || b); this.editor = a; this.status = 'unloaded'; this.hasFocus = !1; this.setup(); - }, proto: { focus: function () { - var a; - - if (CKEDITOR.env.webkit && !this.hasFocus && (a = this.editor._.previousActive || this.getDocument().getActive(), this.contains(a))) { - a.focus(); return; - }CKEDITOR.env.edge && CKEDITOR.env.version > 14 && !this.hasFocus && this.getDocument().equals(CKEDITOR.document) && (this.editor._.previousScrollTop = this.$.scrollTop); - try { - if (!CKEDITOR.env.ie || CKEDITOR.env.edge && CKEDITOR.env.version > 14 || !this.getDocument().equals(CKEDITOR.document)) { - if (CKEDITOR.env.chrome) { - var b = this.$.scrollTop; - - this.$.focus(); this.$.scrollTop = b; - } else { - this.$.focus(); - } - } else { - this.$.setActive(); - } - } catch (c) { - if (!CKEDITOR.env.ie) { - throw c; - } - }CKEDITOR.env.safari && !this.isInline() && (a = CKEDITOR.document.getActive(), a.equals(this.getWindow().getFrame()) || this.getWindow().focus()); - }, on: function (a, b) { - var c = Array.prototype.slice.call(arguments, 0); - - CKEDITOR.env.ie && (/^focus|blur$/).exec(a) && -(a = a == 'focus' ? 'focusin' : 'focusout', b = f(b, this), c[0] = a, c[1] = b); return CKEDITOR.dom.element.prototype.on.apply(this, c); - }, attachListener: function (a) { - !this._.listeners && (this._.listeners = []); var b = Array.prototype.slice.call(arguments, 1); var b = a.on.apply(a, b); - - this._.listeners.push(b); return b; - }, clearListeners: function () { - var a = this._.listeners; - - try { - for (;a.length;) { - a.pop().removeListener(); - } - } catch (b) {} - }, restoreAttrs: function () { - var a = this._.attrChanges; var b; var c; - - for (c in a) { - a.hasOwnProperty(c) && (b = a[c], b !== null ? this.setAttribute(c, - b) : this.removeAttribute(c)); - } - }, attachClass: function (a) { - var b = this.getCustomData('classes'); - - this.hasClass(a) || (!b && (b = []), b.push(a), this.setCustomData('classes', b), this.addClass(a)); - }, changeAttr: function (a, b) { - var c = this.getAttribute(a); - - b !== c && (!this._.attrChanges && (this._.attrChanges = {}), a in this._.attrChanges || (this._.attrChanges[a] = c), this.setAttribute(a, b)); - }, insertText: function (a) { - this.editor.focus(); this.insertHtml(this.transformPlainTextToHtml(a), 'text'); - }, transformPlainTextToHtml: function (a) { - var b = -this.editor.getSelection().getStartElement().hasAscendant('pre', !0) ? CKEDITOR.ENTER_BR : this.editor.activeEnterMode; - - return CKEDITOR.tools.transformPlainTextToHtml(a, b); - }, insertHtml: function (a, b, c) { - var d = this.editor; - - d.focus(); d.fire('saveSnapshot'); c || (c = d.getSelection().getRanges()[0]); n(this, b || 'html', a, c); c.select(); u(this); this.editor.fire('afterInsertHtml', {}); - }, insertHtmlIntoRange: function (a, b, c) { - n(this, c || 'html', a, b); this.editor.fire('afterInsertHtml', { intoRange: b }); - }, insertElement: function (a, b) { - var d = -this.editor; - - d.focus(); d.fire('saveSnapshot'); var e = d.activeEnterMode; var d = d.getSelection(); var f = a.getName(); var f = CKEDITOR.dtd.$block[f]; - - b || (b = d.getRanges()[0]); this.insertElementIntoRange(a, b) && (b.moveToPosition(a, CKEDITOR.POSITION_AFTER_END), f && ((f = a.getNext(function (a) { - return c(a) && !G(a); - })) && f.type == CKEDITOR.NODE_ELEMENT && f.is(CKEDITOR.dtd.$block) ? f.getDtd()['#'] ? b.moveToElementEditStart(f) : b.moveToElementEditEnd(a) : f || e == CKEDITOR.ENTER_BR || (f = b.fixBlock(!0, e == CKEDITOR.ENTER_DIV ? 'div' : 'p'), b.moveToElementEditStart(f)))); - d.selectRanges([b]); u(this); - }, insertElementIntoSelection: function (a) { - this.insertElement(a); - }, insertElementIntoRange: function (a, b) { - var c = this.editor; var d = c.config.enterMode; var e = a.getName(); var f = CKEDITOR.dtd.$block[e]; - - if (b.checkReadOnly()) { - return !1; - } b.deleteContents(1); b.startContainer.type == CKEDITOR.NODE_ELEMENT && (b.startContainer.is({ tr: 1, table: 1, tbody: 1, thead: 1, tfoot: 1 }) ? L(b) : b.startContainer.is(CKEDITOR.dtd.$list) && y(b)); var g; var B; - - if (f) { - for (;(g = b.getCommonAncestor(0, 1)) && (B = CKEDITOR.dtd[g.getName()]) && (!B || !B[e]);) { - if (g.getName() in -CKEDITOR.dtd.span) { - var f = b.splitElement(g); var h = b.createBookmark(); - - l(g); l(f); b.moveToBookmark(h); - } else { - b.checkStartOfBlock() && b.checkEndOfBlock() ? (b.setStartBefore(g), b.collapse(!0), g.remove()) : b.splitBlock(d == CKEDITOR.ENTER_DIV ? 'div' : 'p', c.editable()); - } - } - }b.insertNode(a); return !0; - }, setData: function (a, b) { - b || (a = this.editor.dataProcessor.toHtml(a)); this.setHtml(a); this.fixInitialSelection(); this.status == 'unloaded' && (this.status = 'ready'); this.editor.fire('dataReady'); - }, getData: function (a) { - var b = this.getHtml(); - - a || (b = this.editor.dataProcessor.toDataFormat(b)); return b; - }, setReadOnly: function (a) { - this.setAttribute('contenteditable', !a); - }, detach: function () { - this.status = 'detached'; this.editor.setData(this.editor.getData(), { internal: !0 }); this.clearListeners(); try { - this._.cleanCustomData(); - } catch (a) { - if (!CKEDITOR.env.ie || a.number !== -2146828218) { - throw a; - } - } this.editor.fire('contentDomUnload'); delete this.editor.document; delete this.editor.window; delete this.editor; - }, isInline: function () { - return this.getDocument().equals(CKEDITOR.document); - }, - fixInitialSelection: function () { - function a() { - var b = c.getDocument().$; var d = b.getSelection(); var e; - - a:if (d.anchorNode && d.anchorNode == c.$) { - e = !0; - } else { - if (CKEDITOR.env.webkit && (e = c.getDocument().getActive()) && e.equals(c) && !d.anchorNode) { - e = !0; break a; - }e = void 0; - }e && (e = new CKEDITOR.dom.range(c), e.moveToElementEditStart(c), b = b.createRange(), b.setStart(e.startContainer.$, e.startOffset), b.collapse(!0), d.removeAllRanges(), d.addRange(b)); - } function b() { - var a = c.getDocument().$; var d = a.selection; var e = c.getDocument().getActive(); - - d.type == -'None' && e.equals(c) && (d = new CKEDITOR.dom.range(c), a = a.body.createTextRange(), d.moveToElementEditStart(c), d = d.startContainer, d.type != CKEDITOR.NODE_ELEMENT && (d = d.getParent()), a.moveToElementText(d.$), a.collapse(!0), a.select()); - } var c = this; - - if (CKEDITOR.env.ie && (CKEDITOR.env.version < 9 || CKEDITOR.env.quirks)) { - this.hasFocus && (this.focus(), b()); - } else if (this.hasFocus) { - this.focus(), a(); - } else { - this.once('focus', function () { - a(); - }, null, null, -999); - } - }, getHtmlFromRange: function (a) { - if (a.collapsed) { - return new CKEDITOR.dom.documentFragment(a.document); - } - a = { doc: this.getDocument(), range: a.clone() }; H.eol.detect(a, this); H.bogus.exclude(a); H.cell.shrink(a); a.fragment = a.range.cloneContents(); H.tree.rebuild(a, this); H.eol.fix(a, this); return new CKEDITOR.dom.documentFragment(a.fragment.$); - }, extractHtmlFromRange: function (a, b) { - var c = I; var d = { range: a, doc: a.document }; var e = this.getHtmlFromRange(a); - - if (a.collapsed) { - return a.optimize(), e; - } a.enlarge(CKEDITOR.ENLARGE_INLINE, 1); c.table.detectPurge(d); d.bookmark = a.createBookmark(); delete d.range; var f = this.editor.createRange(); - - f.moveToPosition(d.bookmark.startNode, CKEDITOR.POSITION_BEFORE_START); d.targetBookmark = f.createBookmark(); c.list.detectMerge(d, this); c.table.detectRanges(d, this); c.block.detectMerge(d, this); d.tableContentsRanges ? (c.table.deleteRanges(d), a.moveToBookmark(d.bookmark), d.range = a) : (a.moveToBookmark(d.bookmark), d.range = a, a.extractContents(c.detectExtractMerge(d))); a.moveToBookmark(d.targetBookmark); a.optimize(); c.fixUneditableRangePosition(a); c.list.merge(d, this); c.table.purge(d, this); c.block.merge(d, this); - if (b) { - c = a.startPath(); if (d = a.checkStartOfBlock() && a.checkEndOfBlock() && c.block && !a.root.equals(c.block)) { - a: { - var d = c.block.getElementsByTag('span'); var f = 0; var g; - - if (d) { - for (;g = d.getItem(f++);) { - if (!w(g)) { - d = !0; break a; - } - } - }d = !1; - }d = !d; - }d && (a.moveToPosition(c.block, CKEDITOR.POSITION_BEFORE_START), c.block.remove()); - } else { - c.autoParagraph(this.editor, a), z(a.startContainer) && a.startContainer.appendBogus(); - }a.startContainer.mergeSiblings(); return e; - }, setup: function () { - var a = this.editor; - - this.attachListener(a, 'beforeGetData', function () { - var b = -this.getData(); - - this.is('textarea') || !1 !== a.config.ignoreEmptyParagraph && (b = b.replace(t, function (a, b) { - return b; - })); a.setData(b, null, 1); - }, this); this.attachListener(a, 'getSnapshot', function (a) { - a.data = this.getData(1); - }, this); this.attachListener(a, 'afterSetData', function () { - this.setData(a.getData(1)); - }, this); this.attachListener(a, 'loadSnapshot', function (a) { - this.setData(a.data, 1); - }, this); this.attachListener(a, 'beforeFocus', function () { - var b = a.getSelection(); - - (b = b && b.getNative()) && b.type == 'Control' || this.focus(); - }, - this); this.attachListener(a, 'insertHtml', function (a) { - this.insertHtml(a.data.dataValue, a.data.mode, a.data.range); - }, this); this.attachListener(a, 'insertElement', function (a) { - this.insertElement(a.data); - }, this); this.attachListener(a, 'insertText', function (a) { - this.insertText(a.data); - }, this); this.setReadOnly(a.readOnly); this.attachClass('cke_editable'); a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? this.attachClass('cke_editable_inline') : a.elementMode != CKEDITOR.ELEMENT_MODE_REPLACE && a.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO || -this.attachClass('cke_editable_themed'); this.attachClass('cke_contents_' + a.config.contentsLangDirection); a.keystrokeHandler.blockedKeystrokes[8] = +a.readOnly; a.keystrokeHandler.attach(this); this.on('blur', function () { - this.hasFocus = !1; - }, null, null, -1); this.on('focus', function () { - this.hasFocus = !0; - }, null, null, -1); if (CKEDITOR.env.webkit) { - this.on('scroll', function () { - a._.previousScrollTop = a.editable().$.scrollTop; - }, null, null, -1); - } if (CKEDITOR.env.edge && CKEDITOR.env.version > 14) { - var d = function () { - var b = a.editable(); - - a._.previousScrollTop != null && b.getDocument().equals(CKEDITOR.document) && (b.$.scrollTop = a._.previousScrollTop, a._.previousScrollTop = null, this.removeListener('scroll', d)); - }; - - this.on('scroll', d); - }a.focusManager.add(this); this.equals(CKEDITOR.document.getActive()) && (this.hasFocus = !0, a.once('contentDom', function () { - a.focusManager.focus(this); - }, this)); this.isInline() && this.changeAttr('tabindex', a.tabIndex); if (!this.is('textarea')) { - a.document = this.getDocument(); a.window = this.getWindow(); var f = a.document; - - this.changeAttr('spellcheck', - !a.config.disableNativeSpellChecker); var g = a.config.contentsLangDirection; - - this.getDirection(1) != g && this.changeAttr('dir', g); var k = CKEDITOR.getCss(); - - if (k) { - var g = f.getHead(); var r = g.getCustomData('stylesheet'); - - r ? k != r.getText() && (CKEDITOR.env.ie && CKEDITOR.env.version < 9 ? r.$.styleSheet.cssText = k : r.setText(k)) : (k = f.appendStyleText(k), k = new CKEDITOR.dom.element(k.ownerNode || k.owningElement), g.setCustomData('stylesheet', k), k.data('cke-temp', 1)); - }g = f.getCustomData('stylesheet_ref') || 0; f.setCustomData('stylesheet_ref', - g + 1); this.setCustomData('cke_includeReadonly', !a.config.disableReadonlyStyling); this.attachListener(this, 'click', function (a) { - a = a.data; var b = new CKEDITOR.dom.elementPath(a.getTarget(), this).contains('a'); - - b && a.$.button != 2 && b.isReadOnly() && a.preventDefault(); - }); var D = { 8: 1, 46: 1 }; - - this.attachListener(a, 'key', function (b) { - if (a.readOnly) { - return !0; - } var c = b.data.domEvent.getKey(); var d; - - b = a.getSelection(); if (b.getRanges().length !== 0) { - if (c in D) { - var e; var f = b.getRanges()[0]; var r = f.startPath(); var g; var q; var k; var c = c == 8; - - CKEDITOR.env.ie && -CKEDITOR.env.version < 11 && (e = b.getSelectedElement()) || (e = h(b)) ? (a.fire('saveSnapshot'), f.moveToPosition(e, CKEDITOR.POSITION_BEFORE_START), e.remove(), f.select(), a.fire('saveSnapshot'), d = 1) : f.collapsed && ((g = r.block) && (k = g[c ? 'getPrevious' : 'getNext'](x)) && k.type == CKEDITOR.NODE_ELEMENT && k.is('table') && f[c ? 'checkStartOfBlock' : 'checkEndOfBlock']() ? (a.fire('saveSnapshot'), f[c ? 'checkEndOfBlock' : 'checkStartOfBlock']() && g.remove(), f['moveToElementEdit' + (c ? 'End' : 'Start')](k), f.select(), a.fire('saveSnapshot'), - d = 1) : r.blockLimit && r.blockLimit.is('td') && (q = r.blockLimit.getAscendant('table')) && f.checkBoundaryOfElement(q, c ? CKEDITOR.START : CKEDITOR.END) && (k = q[c ? 'getPrevious' : 'getNext'](x)) ? (a.fire('saveSnapshot'), f['moveToElementEdit' + (c ? 'End' : 'Start')](k), f.checkStartOfBlock() && f.checkEndOfBlock() ? k.remove() : f.select(), a.fire('saveSnapshot'), d = 1) : (q = r.contains(['td', 'th', 'caption'])) && f.checkBoundaryOfElement(q, c ? CKEDITOR.START : CKEDITOR.END) && (d = 1)); - } return !d; - } - }); a.blockless && CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller && -this.attachListener(this, 'keyup', function (b) { - b.data.getKeystroke() in D && !this.getFirst(c) && (this.appendBogus(), b = a.createRange(), b.moveToPosition(this, CKEDITOR.POSITION_AFTER_START), b.select()); -}); this.attachListener(this, 'dblclick', function (b) { - if (a.readOnly) { - return !1; - } b = { element: b.data.getTarget() }; a.fire('doubleclick', b); - }); CKEDITOR.env.ie && this.attachListener(this, 'click', b); CKEDITOR.env.ie && !CKEDITOR.env.edge || this.attachListener(this, 'mousedown', function (b) { - var c = b.data.getTarget(); - - c.is('img', 'hr', - 'input', 'textarea', 'select') && !c.isReadOnly() && (a.getSelection().selectElement(c), c.is('input', 'textarea', 'select') && b.data.preventDefault()); - }); CKEDITOR.env.edge && this.attachListener(this, 'mouseup', function (b) { - (b = b.data.getTarget()) && b.is('img') && !b.isReadOnly() && a.getSelection().selectElement(b); - }); CKEDITOR.env.gecko && this.attachListener(this, 'mouseup', function (b) { - if (b.data.$.button == 2 && (b = b.data.getTarget(), !b.getAscendant('table') && !b.getOuterHtml().replace(t, ''))) { - var c = a.createRange(); - - c.moveToElementEditStart(b); - c.select(!0); - } - }); CKEDITOR.env.webkit && (this.attachListener(this, 'click', function (a) { - a.data.getTarget().is('input', 'select') && a.data.preventDefault(); - }), this.attachListener(this, 'mouseup', function (a) { - a.data.getTarget().is('input', 'textarea') && a.data.preventDefault(); - })); CKEDITOR.env.webkit && this.attachListener(a, 'key', function (b) { - if (a.readOnly) { - return !0; - } var c = b.data.domEvent.getKey(); - - if (c in D && (b = a.getSelection(), b.getRanges().length !== 0)) { - var c = c == 8; var d = b.getRanges()[0]; - - b = d.startPath(); if (d.collapsed) { - a: { - var f = -b.block; - - if (f && d[c ? 'checkStartOfBlock' : 'checkEndOfBlock']() && d.moveToClosestEditablePosition(f, !c) && d.collapsed) { - if (d.startContainer.type == CKEDITOR.NODE_ELEMENT) { - var p = d.startContainer.getChild(d.startOffset - (c ? 1 : 0)); - - if (p && p.type == CKEDITOR.NODE_ELEMENT && p.is('hr')) { - a.fire('saveSnapshot'); p.remove(); b = !0; break a; - } - }d = d.startPath().block; if (!d || d && d.contains(f)) { - b = void 0; - } else { - a.fire('saveSnapshot'); var r; - - (r = (c ? d : f).getBogus()) && r.remove(); r = a.getSelection(); p = r.createBookmarks(); (c ? f : d).moveChildren(c ? - d : f, !1); b.lastElement.mergeSiblings(); e(f, d, !c); r.selectBookmarks(p); b = !0; - } - } else { - b = !1; - } - } - } else { - c = d, r = b.block, d = c.endPath().block, r && d && !r.equals(d) ? (a.fire('saveSnapshot'), (f = r.getBogus()) && f.remove(), c.enlarge(CKEDITOR.ENLARGE_INLINE), c.deleteContents(), d.getParent() && (d.moveChildren(r, !1), b.lastElement.mergeSiblings(), e(r, d, !0)), c = a.getSelection().getRanges()[0], c.collapse(1), c.optimize(), c.startContainer.getHtml() === '' && c.startContainer.appendBogus(), c.select(), b = !0) : b = !1; - } if (!b) { - return; - } a.getSelection().scrollIntoView(); - a.fire('saveSnapshot'); return !1; - } - }, this, null, 100); - } - }, getUniqueId: function () { - var a; - - try { - this._.expandoNumber = a = CKEDITOR.dom.domObject.prototype.getUniqueId.call(this); - } catch (b) { - a = this._ && this._.expandoNumber; - } return a; - } }, _: { cleanCustomData: function () { - this.removeClass('cke_editable'); this.restoreAttrs(); for (var a = this.removeCustomData('classes'); a && a.length;) { - this.removeClass(a.pop()); - } if (!this.is('textarea')) { - var a = this.getDocument(); var b = a.getHead(); - - if (b.getCustomData('stylesheet')) { - var c = a.getCustomData('stylesheet_ref'); - - --c ? a.setCustomData('stylesheet_ref', c) : (a.removeCustomData('stylesheet_ref'), b.removeCustomData('stylesheet').remove()); - } - } - } } }); CKEDITOR.editor.prototype.editable = function (a) { - var b = this._.editable; - - if (b && a) { - return 0; - } if (!arguments.length) { - return b; - } a ? b = a instanceof CKEDITOR.editable ? a : new CKEDITOR.editable(this, a) : (b && b.detach(), b = null); return this._.editable = b; - }; CKEDITOR.on('instanceLoaded', function (b) { - var c = b.editor; - - c.on('insertElement', function (a) { - a = a.data; a.type == CKEDITOR.NODE_ELEMENT && (a.is('input') || -a.is('textarea')) && (a.getAttribute('contentEditable') != 'false' && a.data('cke-editable', a.hasAttribute('contenteditable') ? 'true' : '1'), a.setAttribute('contentEditable', !1)); - }); c.on('selectionChange', function (b) { - if (!c.readOnly) { - var d = c.getSelection(); - - d && !d.isLocked && (d = c.checkDirty(), c.fire('lockSnapshot'), a(b), c.fire('unlockSnapshot'), !d && c.resetDirty()); - } - }); - }); CKEDITOR.on('instanceCreated', function (a) { - var b = a.editor; - - b.on('mode', function () { - var a = b.editable(); - - if (a && a.isInline()) { - var c = b.title; - - a.changeAttr('role', - 'textbox'); a.changeAttr('aria-multiline', 'true'); a.changeAttr('aria-label', c); c && a.changeAttr('title', c); var d = b.fire('ariaEditorHelpLabel', {}).label; - - if (d && (c = this.ui.space(this.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? 'top' : 'contents'))) { - var e = CKEDITOR.tools.getNextId(); var d = CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"' + e + '" class\x3d"cke_voice_label"\x3e' + d + '\x3c/span\x3e'); - - c.append(d); a.changeAttr('aria-describedby', e); - } - } - }); - }); CKEDITOR.addCss('.cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}'); - x = CKEDITOR.dom.walker.whitespaces(!0); w = CKEDITOR.dom.walker.bookmark(!1, !0); z = CKEDITOR.dom.walker.empty(); G = CKEDITOR.dom.walker.bogus(); t = /(^|]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi; n = (function () { - function a(b) { - return b.type == CKEDITOR.NODE_ELEMENT; - } function b(c, d) { - var e; var f; var r; var g; var h = []; var k = d.range.startContainer; - - e = d.range.startPath(); for (var k = B[k.getName()], D = 0, v = c.getChildren(), l = v.count(), n = -1, A = -1, u = 0, T = e.contains(B.$list); D < -l; ++D) { - e = v.getItem(D), a(e) ? (r = e.getName(), T && r in CKEDITOR.dtd.$list ? h = h.concat(b(e, d)) : (g = !!k[r], r != 'br' || !e.data('cke-eol') || D && D != l - 1 || (u = (f = D ? h[D - 1].node : v.getItem(D + 1)) && (!a(f) || !f.is('br')), f = f && a(f) && B.$block[f.getName()]), n != -1 || g || (n = D), g || (A = D), h.push({ isElement: 1, isLineBreak: u, isBlock: e.isBlockBoundary(), hasBlockSibling: f, node: e, name: r, allowed: g }), f = u = 0)) : h.push({ isElement: 0, node: e, allowed: 1 }); - }n > -1 && (h[n].firstNotAllowed = 1); A > -1 && (h[A].lastNotAllowed = 1); return h; - } function d(b, c) { - var e = []; - var f = b.getChildren(); var r = f.count(); var g; var h = 0; var k = B[c]; var D = !b.is(B.$inline) || b.is('br'); - - for (D && e.push(' '); h < r; h++) { - g = f.getItem(h), a(g) && !g.is(k) ? e = e.concat(d(g, c)) : e.push(g); - }D && e.push(' '); return e; - } function e(b) { - return a(b.startContainer) && b.startContainer.getChild(b.startOffset - 1); - } function f(b) { - return b && a(b) && (b.is(B.$removeEmpty) || b.is('a') && !b.isBlockBoundary()); - } function r(b, c, d, e) { - var f = b.clone(); var g; var h; - - f.setEndAt(c, CKEDITOR.POSITION_BEFORE_END); (g = new CKEDITOR.dom.walker(f).next()) && a(g) && v[g.getName()] && -(h = g.getPrevious()) && a(h) && !h.getParent().equals(b.startContainer) && d.contains(h) && e.contains(g) && g.isIdentical(h) && (g.moveChildren(h), g.remove(), r(b, c, d, e)); - } function h(b, c) { - function d(b, c) { - if (c.isBlock && c.isElement && !c.node.is('br') && a(b) && b.is('br')) { - return b.remove(), 1; - } - } var e = c.endContainer.getChild(c.endOffset); var f = c.endContainer.getChild(c.endOffset - 1); - - e && d(e, b[b.length - 1]); f && d(f, b[0]) && (c.setEnd(c.endContainer, c.endOffset - 1), c.collapse()); - } var B = CKEDITOR.dtd; var v = { p: 1, div: 1, h1: 1, h2: 1, h3: 1, h4: 1, h5: 1, - h6: 1, ul: 1, ol: 1, li: 1, pre: 1, dl: 1, blockquote: 1 }; var n = { p: 1, div: 1, h1: 1, h2: 1, h3: 1, h4: 1, h5: 1, h6: 1 }; var u = CKEDITOR.tools.extend({}, B.$inline); - - delete u.br; return function (p, v, O, q) { - var F = p.editor; var E = !1; - - v == 'unfiltered_html' && (v = 'html', E = !0); if (!q.checkReadOnly()) { - var w = new CKEDITOR.dom.elementPath(q.startContainer, q.root).blockLimit || q.root; - - v = { type: v, dontFilter: E, editable: p, editor: F, range: q, blockLimit: w, mergeCandidates: [], zombies: [] }; var E = v.range; var w = v.mergeCandidates; var J = v.type === 'html'; var x; var t; var z; var y; var G; var V; - - v.type == 'text' && -E.shrink(CKEDITOR.SHRINK_ELEMENT, !0, !1) && (t = CKEDITOR.dom.element.createFromHtml('\x3cspan\x3e\x26nbsp;\x3c/span\x3e', E.document), E.insertNode(t), E.setStartAfter(t)); z = new CKEDITOR.dom.elementPath(E.startContainer); v.endPath = y = new CKEDITOR.dom.elementPath(E.endContainer); if (!E.collapsed) { - x = y.block || y.blockLimit; var aa = E.getCommonAncestor(); - - x && !x.equals(aa) && !x.contains(aa) && E.checkEndOfBlock() && v.zombies.push(x); E.deleteContents(); - } for (;(G = e(E)) && a(G) && G.isBlockBoundary() && z.contains(G);) { - E.moveToPosition(G, - CKEDITOR.POSITION_BEFORE_END); - }r(E, v.blockLimit, z, y); t && (E.setEndBefore(t), E.collapse(), t.remove()); t = E.startPath(); if (x = t.contains(f, !1, 1)) { - V = E.splitElement(x), v.inlineStylesRoot = x, v.inlineStylesPeak = t.lastElement; - }t = E.createBookmark(); J && (l(x), l(V)); (x = t.startNode.getPrevious(c)) && a(x) && f(x) && w.push(x); (x = t.startNode.getNext(c)) && a(x) && f(x) && w.push(x); for (x = t.startNode; (x = x.getParent()) && f(x);) { - w.push(x); - }E.moveToBookmark(t); F.enterMode === CKEDITOR.ENTER_DIV && F.getData(!0) === '' && ((F = p.getFirst()) && F.remove(), - q.setStartAt(p, CKEDITOR.POSITION_AFTER_START), q.collapse(!0)); if (p = O) { - p = v.range; if (v.type == 'text' && v.inlineStylesRoot) { - q = v.inlineStylesPeak; F = q.getDocument().createText('{cke-peak}'); for (V = v.inlineStylesRoot.getParent(); !q.equals(V);) { - F = F.appendTo(q.clone()), q = q.getParent(); - }O = F.getOuterHtml().split('{cke-peak}').join(O); - }q = v.blockLimit.getName(); if ((/^\s+|\s+$/).test(O) && 'span' in CKEDITOR.dtd[q]) { - var H = '\x3cspan data-cke-marker\x3d"1"\x3e\x26nbsp;\x3c/span\x3e'; - - O = H + O + H; - }O = v.editor.dataProcessor.toHtml(O, - { context: null, fixForBody: !1, protectedWhitespaces: !!H, dontFilter: v.dontFilter, filter: v.editor.activeFilter, enterMode: v.editor.activeEnterMode }); q = p.document.createElement('body'); q.setHtml(O); H && (q.getFirst().remove(), q.getLast().remove()); if ((H = p.startPath().block) && (H.getChildCount() != 1 || !H.getBogus())) { - a: { - var P; - - if (q.getChildCount() == 1 && a(P = q.getFirst()) && P.is(n) && !P.hasAttribute('contenteditable')) { - H = P.getElementsByTag('*'); p = 0; for (V = H.count(); p < V; p++) { - if (F = H.getItem(p), !F.is(u)) { - break a; - } - } P.moveChildren(P.getParent(1)); - P.remove(); - } - } - }v.dataWrapper = q; p = O; - } if (p) { - P = v.range; p = P.document; q = v.blockLimit; V = 0; var R; var H = []; var Q; var I; - - O = t = 0; var L; var F = P.startContainer; - - G = v.endPath.elements[0]; var Z; var E = G.getPosition(F); var w = !!G.getCommonAncestor(F) && E != CKEDITOR.POSITION_IDENTICAL && !(E & CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_IS_CONTAINED); var F = b(v.dataWrapper, v); - - for (h(F, P); V < F.length; V++) { - E = F[V]; if (J = E.isLineBreak) { - J = P, x = q, y = z = void 0, E.hasBlockSibling ? J = 1 : (z = J.startContainer.getAscendant(B.$block, 1)) && z.is({ div: 1, p: 1 }) ? (y = z.getPosition(x), y == -CKEDITOR.POSITION_IDENTICAL || y == CKEDITOR.POSITION_CONTAINS ? J = 0 : (x = J.splitElement(z), J.moveToPosition(x, CKEDITOR.POSITION_AFTER_START), J = 1)) : J = 0; - } if (J) { - O = V > 0; - } else { - J = P.startPath(); !E.isBlock && k(v.editor, J.block, J.blockLimit) && (I = g(v.editor)) && (I = p.createElement(I), I.appendBogus(), P.insertNode(I), CKEDITOR.env.needsBrFiller && (R = I.getBogus()) && R.remove(), P.moveToPosition(I, CKEDITOR.POSITION_BEFORE_END)); if ((J = P.startPath().block) && !J.equals(Q)) { - if (R = J.getBogus()) { - R.remove(), H.push(J); - }Q = J; - }E.firstNotAllowed && -(t = 1); if (t && E.isElement) { - J = P.startContainer; for (x = null; J && !B[J.getName()][E.name];) { - if (J.equals(q)) { - J = null; break; - }x = J; J = J.getParent(); - } if (J) { - x && (L = P.splitElement(x), v.zombies.push(L), v.zombies.push(x)); - } else { - x = q.getName(); Z = !V; J = V == F.length - 1; x = d(E.node, x); z = []; y = x.length; for (var aa = 0, ca = void 0, X = 0, W = -1; aa < y; aa++) { - ca = x[aa], ca == ' ' ? (X || Z && !aa || (z.push(new CKEDITOR.dom.text(' ')), W = z.length), X = 1) : (z.push(ca), X = 0); - }J && W == z.length && z.pop(); Z = z; - } - } if (Z) { - for (;J = Z.pop();) { - P.insertNode(J); - }Z = 0; - } else { - P.insertNode(E.node); - } - E.lastNotAllowed && V < F.length - 1 && ((L = w ? G : L) && P.setEndAt(L, CKEDITOR.POSITION_AFTER_START), t = 0); P.collapse(); - } - }F.length != 1 ? R = !1 : (R = F[0], R = R.isElement && R.node.getAttribute('contenteditable') == 'false'); R && (O = !0, J = F[0].node, P.setStartAt(J, CKEDITOR.POSITION_BEFORE_START), P.setEndAt(J, CKEDITOR.POSITION_AFTER_END)); v.dontMoveCaret = O; v.bogusNeededBlocks = H; - }R = v.range; var Y; - - L = v.bogusNeededBlocks; for (Z = R.createBookmark(); Q = v.zombies.pop();) { - Q.getParent() && (I = R.clone(), I.moveToElementEditStart(Q), I.removeEmptyBlocksAtEnd()); - } - if (L) { - for (;Q = L.pop();) { - CKEDITOR.env.needsBrFiller ? Q.appendBogus() : Q.append(R.document.createText(' ')); - } - } for (;Q = v.mergeCandidates.pop();) { - Q.mergeSiblings(); - }R.moveToBookmark(Z); if (!v.dontMoveCaret) { - for (Q = e(R); Q && a(Q) && !Q.is(B.$empty);) { - if (Q.isBlockBoundary()) { - R.moveToPosition(Q, CKEDITOR.POSITION_BEFORE_END); - } else { - if (f(Q) && Q.getHtml().match(/(\s| )$/g)) { - Y = null; break; - }Y = R.clone(); Y.moveToPosition(Q, CKEDITOR.POSITION_BEFORE_END); - }Q = Q.getLast(c); - }Y && R.moveToRange(Y); - } - } - }; - })(); L = (function () { - function a(b) { - b = new CKEDITOR.dom.walker(b); - b.guard = function (a, b) { - if (b) { - return !1; - } if (a.type == CKEDITOR.NODE_ELEMENT) { - return a.is(CKEDITOR.dtd.$tableContent); - } - }; b.evaluator = function (a) { - return a.type == CKEDITOR.NODE_ELEMENT; - }; return b; - } function b(a, c, d) { - c = a.getDocument().createElement(c); a.append(c, d); return c; - } function c(a) { - var b = a.count(); var d; - - for (b; b-- > 0;) { - d = a.getItem(b), CKEDITOR.tools.trim(d.getHtml()) || (d.appendBogus(), CKEDITOR.env.ie && CKEDITOR.env.version < 9 && d.getChildCount() && d.getFirst().remove()); - } - } return function (d) { - var e = d.startContainer; var f = e.getAscendant('table', - 1); var g = !1; - - c(f.getElementsByTag('td')); c(f.getElementsByTag('th')); f = d.clone(); f.setStart(e, 0); f = a(f).lastBackward(); f || (f = d.clone(), f.setEndAt(e, CKEDITOR.POSITION_BEFORE_END), f = a(f).lastForward(), g = !0); f || (f = e); f.is('table') ? (d.setStartAt(f, CKEDITOR.POSITION_BEFORE_START), d.collapse(!0), f.remove()) : (f.is({ tbody: 1, thead: 1, tfoot: 1 }) && (f = b(f, 'tr', g)), f.is('tr') && (f = b(f, f.getParent().is('thead') ? 'th' : 'td', g)), (e = f.getBogus()) && e.remove(), d.moveToPosition(f, g ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END)); - }; - })(); - y = (function () { - function a(b) { - b = new CKEDITOR.dom.walker(b); b.guard = function (a, b) { - if (b) { - return !1; - } if (a.type == CKEDITOR.NODE_ELEMENT) { - return a.is(CKEDITOR.dtd.$list) || a.is(CKEDITOR.dtd.$listItem); - } - }; b.evaluator = function (a) { - return a.type == CKEDITOR.NODE_ELEMENT && a.is(CKEDITOR.dtd.$listItem); - }; return b; - } return function (b) { - var c = b.startContainer; var d = !1; var e; - - e = b.clone(); e.setStart(c, 0); e = a(e).lastBackward(); e || (e = b.clone(), e.setEndAt(c, CKEDITOR.POSITION_BEFORE_END), e = a(e).lastForward(), d = !0); e || (e = c); e.is(CKEDITOR.dtd.$list) ? - (b.setStartAt(e, CKEDITOR.POSITION_BEFORE_START), b.collapse(!0), e.remove()) : ((c = e.getBogus()) && c.remove(), b.moveToPosition(e, d ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END), b.select()); - }; - })(); H = { eol: { detect: function (a, b) { - var c = a.range; var d = c.clone(); var e = c.clone(); var f = new CKEDITOR.dom.elementPath(c.startContainer, b); var g = new CKEDITOR.dom.elementPath(c.endContainer, b); - - d.collapse(1); e.collapse(); f.block && d.checkBoundaryOfElement(f.block, CKEDITOR.END) && (c.setStartAfter(f.block), a.prependEolBr = 1); g.block && -e.checkBoundaryOfElement(g.block, CKEDITOR.START) && (c.setEndBefore(g.block), a.appendEolBr = 1); - }, fix: function (a, b) { - var c = b.getDocument(); var d; - - a.appendEolBr && (d = this.createEolBr(c), a.fragment.append(d)); !a.prependEolBr || d && !d.getPrevious() || a.fragment.append(this.createEolBr(c), 1); - }, createEolBr: function (a) { - return a.createElement('br', { attributes: { 'data-cke-eol': 1 } }); - } }, bogus: { exclude: function (a) { - var b = a.range.getBoundaryNodes(); var c = b.startNode; var b = b.endNode; - - !b || !G(b) || c && c.equals(b) || a.range.setEndBefore(b); - } }, - tree: { rebuild: function (a, b) { - var c = a.range; var d = c.getCommonAncestor(); var e = new CKEDITOR.dom.elementPath(d, b); var f = new CKEDITOR.dom.elementPath(c.startContainer, b); var c = new CKEDITOR.dom.elementPath(c.endContainer, b); var g; - - d.type == CKEDITOR.NODE_TEXT && (d = d.getParent()); if (e.blockLimit.is({ tr: 1, table: 1 })) { - var h = e.contains('table').getParent(); - - g = function (a) { - return !a.equals(h); - }; - } else if (e.block && e.block.is(CKEDITOR.dtd.$listItem) && (f = f.contains(CKEDITOR.dtd.$list), c = c.contains(CKEDITOR.dtd.$list), !f.equals(c))) { - var k = e.contains(CKEDITOR.dtd.$list).getParent(); - - g = function (a) { - return !a.equals(k); - }; - }g || (g = function (a) { - return !a.equals(e.block) && !a.equals(e.blockLimit); - }); this.rebuildFragment(a, b, d, g); - }, rebuildFragment: function (a, b, c, d) { - for (var e; c && !c.equals(b) && d(c);) { - e = c.clone(0, 1), a.fragment.appendTo(e), a.fragment = e, c = c.getParent(); - } - } }, cell: { shrink: function (a) { - a = a.range; var b = a.startContainer; var c = a.endContainer; var d = a.startOffset; var e = a.endOffset; - - b.type == CKEDITOR.NODE_ELEMENT && b.equals(c) && b.is('tr') && ++d == e && a.shrink(CKEDITOR.SHRINK_TEXT); - } } }; I = (function () { - function a(b, c) { - var d = -b.getParent(); - - if (d.is(CKEDITOR.dtd.$inline)) { - b[c ? 'insertBefore' : 'insertAfter'](d); - } - } function b(c, d, e) { - a(d); a(e, 1); for (var f; f = e.getNext();) { - f.insertAfter(d), d = f; - }z(c) && c.remove(); - } function c(a, b) { - var d = new CKEDITOR.dom.range(a); - - d.setStartAfter(b.startNode); d.setEndBefore(b.endNode); return d; - } return { list: { detectMerge: function (a, b) { - var d = c(b, a.bookmark); var e = d.startPath(); var f = d.endPath(); var g = e.contains(CKEDITOR.dtd.$list); var h = f.contains(CKEDITOR.dtd.$list); - - a.mergeList = g && h && g.getParent().equals(h.getParent()) && !g.equals(h); - a.mergeListItems = e.block && f.block && e.block.is(CKEDITOR.dtd.$listItem) && f.block.is(CKEDITOR.dtd.$listItem); if (a.mergeList || a.mergeListItems) { - d = d.clone(), d.setStartBefore(a.bookmark.startNode), d.setEndAfter(a.bookmark.endNode), a.mergeListBookmark = d.createBookmark(); - } - }, merge: function (a, c) { - if (a.mergeListBookmark) { - var d = a.mergeListBookmark.startNode; var e = a.mergeListBookmark.endNode; var f = new CKEDITOR.dom.elementPath(d, c); var g = new CKEDITOR.dom.elementPath(e, c); - - if (a.mergeList) { - var h = f.contains(CKEDITOR.dtd.$list); var k = -g.contains(CKEDITOR.dtd.$list); - - h.equals(k) || (k.moveChildren(h), k.remove()); - }a.mergeListItems && (f = f.contains(CKEDITOR.dtd.$listItem), g = g.contains(CKEDITOR.dtd.$listItem), f.equals(g) || b(g, d, e)); d.remove(); e.remove(); - } - } }, block: { detectMerge: function (a, b) { - if (!a.tableContentsRanges && !a.mergeListBookmark) { - var c = new CKEDITOR.dom.range(b); - - c.setStartBefore(a.bookmark.startNode); c.setEndAfter(a.bookmark.endNode); a.mergeBlockBookmark = c.createBookmark(); - } - }, merge: function (a, c) { - if (a.mergeBlockBookmark && !a.purgeTableBookmark) { - var d = -a.mergeBlockBookmark.startNode; var e = a.mergeBlockBookmark.endNode; var f = new CKEDITOR.dom.elementPath(d, c); var g = new CKEDITOR.dom.elementPath(e, c); var f = f.block; var g = g.block; - - f && g && !f.equals(g) && b(g, d, e); d.remove(); e.remove(); - } - } }, table: (function () { - function a(c) { - var e = []; var f; var g = new CKEDITOR.dom.walker(c); var h = c.startPath().contains(d); var p = c.endPath().contains(d); var k = {}; - - g.guard = function (a, g) { - if (a.type == CKEDITOR.NODE_ELEMENT) { - var l = 'visited_' + (g ? 'out' : 'in'); - - if (a.getCustomData(l)) { - return; - } CKEDITOR.dom.element.setMarker(k, a, l, 1); - } if (g && -h && a.equals(h)) { - f = c.clone(), f.setEndAt(h, CKEDITOR.POSITION_BEFORE_END), e.push(f); - } else if (!g && p && a.equals(p)) { - f = c.clone(), f.setStartAt(p, CKEDITOR.POSITION_AFTER_START), e.push(f); - } else { - if (l = !g) { - l = a.type == CKEDITOR.NODE_ELEMENT && a.is(d) && (!h || b(a, h)) && (!p || b(a, p)); - } if (!l && (l = g)) { - if (a.is(d)) { - var l = h && h.getAscendant('table', !0); var n = p && p.getAscendant('table', !0); var m = a.getAscendant('table', !0); var l = l && l.contains(m) || n && n.contains(m); - } else { - l = void 0; - } - }l && (f = c.clone(), f.selectNodeContents(a), e.push(f)); - } - }; g.lastForward(); CKEDITOR.dom.element.clearAllMarkers(k); - return e; - } function b(a, c) { - var d = CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_IS_CONTAINED; var e = a.getPosition(c); - - return e === CKEDITOR.POSITION_IDENTICAL ? !1 : (e & d) === 0; - } var d = { td: 1, th: 1, caption: 1 }; - - return { detectPurge: function (a) { - var b = a.range; var c = b.clone(); - - c.enlarge(CKEDITOR.ENLARGE_ELEMENT); var c = new CKEDITOR.dom.walker(c); var e = 0; - - c.evaluator = function (a) { - a.type == CKEDITOR.NODE_ELEMENT && a.is(d) && ++e; - }; c.checkForward(); if (e > 1) { - var c = b.startPath().contains('table'); var f = b.endPath().contains('table'); - - c && f && b.checkBoundaryOfElement(c, - CKEDITOR.START) && b.checkBoundaryOfElement(f, CKEDITOR.END) && (b = a.range.clone(), b.setStartBefore(c), b.setEndAfter(f), a.purgeTableBookmark = b.createBookmark()); - } - }, detectRanges: function (e, f) { - var g = c(f, e.bookmark); var h = g.clone(); var k; var p; var l = g.getCommonAncestor(); - - l.is(CKEDITOR.dtd.$tableContent) && !l.is(d) && (l = l.getAscendant('table', !0)); p = l; l = new CKEDITOR.dom.elementPath(g.startContainer, p); p = new CKEDITOR.dom.elementPath(g.endContainer, p); l = l.contains('table'); p = p.contains('table'); if (l || p) { - l && p && b(l, p) ? (e.tableSurroundingRange = -h, h.setStartAt(l, CKEDITOR.POSITION_AFTER_END), h.setEndAt(p, CKEDITOR.POSITION_BEFORE_START), h = g.clone(), h.setEndAt(l, CKEDITOR.POSITION_AFTER_END), k = g.clone(), k.setStartAt(p, CKEDITOR.POSITION_BEFORE_START), k = a(h).concat(a(k))) : l ? p || (e.tableSurroundingRange = h, h.setStartAt(l, CKEDITOR.POSITION_AFTER_END), g.setEndAt(l, CKEDITOR.POSITION_AFTER_END)) : (e.tableSurroundingRange = h, h.setEndAt(p, CKEDITOR.POSITION_BEFORE_START), g.setStartAt(p, CKEDITOR.POSITION_AFTER_START)), e.tableContentsRanges = k ? k : a(g); - } - }, deleteRanges: function (a) { - for (var b; b = -a.tableContentsRanges.pop();) { - b.extractContents(), z(b.startContainer) && b.startContainer.appendBogus(); - }a.tableSurroundingRange && a.tableSurroundingRange.extractContents(); - }, purge: function (a) { - if (a.purgeTableBookmark) { - var b = a.doc; var c = a.range.clone(); var b = b.createElement('p'); - - b.insertBefore(a.purgeTableBookmark.startNode); c.moveToBookmark(a.purgeTableBookmark); c.deleteContents(); a.range.moveToPosition(b, CKEDITOR.POSITION_AFTER_START); - } - } }; - })(), detectExtractMerge: function (a) { - return !(a.range.startPath().contains(CKEDITOR.dtd.$listItem) && -a.range.endPath().contains(CKEDITOR.dtd.$listItem)); - }, fixUneditableRangePosition: function (a) { - a.startContainer.getDtd()['#'] || a.moveToClosestEditablePosition(null, !0); - }, autoParagraph: function (a, b) { - var c = b.startPath(); var d; - - k(a, c.block, c.blockLimit) && (d = g(a)) && (d = b.document.createElement(d), d.appendBogus(), b.insertNode(d), b.moveToPosition(d, CKEDITOR.POSITION_AFTER_START)); - } }; - })(); - })(); - (function () { - function a(a) { - return CKEDITOR.plugins.widget && CKEDITOR.plugins.widget.isDomWidget(a); - } function d(b, c) { - if (b.length === 0 || a(b[0].getEnclosedNode())) { - return !1; - } var d; var e; - - if ((d = !c && b.length === 1) && !(d = b[0].collapsed)) { - var f = b[0]; - - d = f.startContainer.getAscendant({ td: 1, th: 1 }, !0); var g = f.endContainer.getAscendant({ td: 1, th: 1 }, !0); - - e = CKEDITOR.tools.trim; d && d.equals(g) && !d.findOne('td, th, tr, tbody, table') ? (f = f.cloneContents(), d = f.getFirst() ? e(f.getFirst().getText()) !== e(d.getText()) : !0) : d = !1; - } if (d) { - return !1; - } - for (e = 0; e < b.length; e++) { - if (d = b[e]._getTableElement(), !d) { - return !1; - } - } return !0; - } function b(a) { - function b(a) { - a = a.find('td, th'); var c = []; var d; - - for (d = 0; d < a.count(); d++) { - c.push(a.getItem(d)); - } return c; - } var c = []; var d; var e; - - for (e = 0; e < a.length; e++) { - d = a[e]._getTableElement(), d.is && d.is({ td: 1, th: 1 }) ? c.push(d) : c = c.concat(b(d)); - } return c; - } function c(a) { - a = b(a); var c = ''; var d = []; var e; var f; - - for (f = 0; f < a.length; f++) { - e && !e.equals(a[f].getAscendant('tr')) ? (c += d.join('\t') + '\n', e = a[f].getAscendant('tr'), d = []) : f === 0 && (e = a[f].getAscendant('tr')), d.push(a[f].getText()); - } - return c += d.join('\t'); - } function f(a) { - var b = this.root.editor; var d = b.getSelection(1); - - this.reset(); I = !0; d.root.once('selectionchange', function (a) { - a.cancel(); - }, null, null, 0); d.selectRanges([a[0]]); d = this._.cache; d.ranges = new CKEDITOR.dom.rangeList(a); d.type = CKEDITOR.SELECTION_TEXT; d.selectedElement = a[0]._getTableElement(); d.selectedText = c(a); d.nativeSel = null; this.isFake = 1; this.rev = L++; b._.fakeSelection = this; I = !1; this.root.fire('selectionchange'); - } function h() { - var b = this._.fakeSelection; var c; - - if (b) { - c = this.getSelection(1); - var e; - - if (!(e = !c) && (e = !c.isHidden())) { - e = b; var f = c.getRanges(); var g = e.getRanges(); var h = f.length && f[0]._getTableElement() && f[0]._getTableElement().getAscendant('table', !0); var p = g.length && g[0]._getTableElement() && g[0]._getTableElement().getAscendant('table', !0); var k = f.length === 1 && f[0]._getTableElement() && f[0]._getTableElement().is('table'); var l = g.length === 1 && g[0]._getTableElement() && g[0]._getTableElement().is('table'); - - if (a(e.getSelectedElement())) { - e = !1; - } else { - var q = f.length === 1 && f[0].collapsed; var g = d(f, !!CKEDITOR.env.webkit) && -d(g); - - h = h && p ? h.equals(p) || p.contains(h) : !1; h && (q || g) ? (k && !l && e.selectRanges(f), e = !0) : e = !1; - }e = !e; - }e && (b.reset(), b = 0); - } if (!b && (b = c || this.getSelection(1), !b || b.getType() == CKEDITOR.SELECTION_NONE)) { - return; - } this.fire('selectionCheck', b); c = this.elementPath(); c.compare(this._.selectionPreviousPath) || (e = this._.selectionPreviousPath && this._.selectionPreviousPath.blockLimit.equals(c.blockLimit), !CKEDITOR.env.webkit && !CKEDITOR.env.gecko || e || (this._.previousActive = this.document.getActive()), this._.selectionPreviousPath = -c, this.fire('selectionChange', { selection: b, path: c })); - } function k() { - C = !0; m || (g.call(this), m = CKEDITOR.tools.setTimeout(g, 200, this)); - } function g() { - m = null; C && (CKEDITOR.tools.setTimeout(h, 0, this), C = !1); - } function l(a) { - return K(a) || a.type == CKEDITOR.NODE_ELEMENT && !a.is(CKEDITOR.dtd.$empty) ? !0 : !1; - } function u(a) { - function b(c, d) { - return c && c.type != CKEDITOR.NODE_TEXT ? a.clone()['moveToElementEdit' + (d ? 'End' : 'Start')](c) : !1; - } if (!(a.root instanceof CKEDITOR.editable)) { - return !1; - } var c = a.startContainer; var d = a.getPreviousNode(l, - null, c); var e = a.getNextNode(l, null, c); - - return b(d) || b(e, 1) || !(d || e || c.type == CKEDITOR.NODE_ELEMENT && c.isBlockBoundary() && c.getBogus()) ? !0 : !1; - } function e(a) { - x(a, !1); var b = a.getDocument().createText(y); - - a.setCustomData('cke-fillingChar', b); return b; - } function x(a, b) { - var c = a && a.removeCustomData('cke-fillingChar'); - - if (c) { - if (!1 !== b) { - var d = a.getDocument().getSelection().getNative(); var e = d && d.type != 'None' && d.getRangeAt(0); var f = y.length; - - if (c.getLength() > f && e && e.intersectsNode(c.$)) { - var g = [{ node: d.anchorNode, offset: d.anchorOffset }, - { node: d.focusNode, offset: d.focusOffset }]; - - d.anchorNode == c.$ && d.anchorOffset > f && (g[0].offset -= f); d.focusNode == c.$ && d.focusOffset > f && (g[1].offset -= f); - } - }c.setText(w(c.getText(), 1)); g && (c = a.getDocument().$, d = c.getSelection(), c = c.createRange(), c.setStart(g[0].node, g[0].offset), c.collapse(!0), d.removeAllRanges(), d.addRange(c), d.extend(g[1].node, g[1].offset)); - } - } function w(a, b) { - return b ? a.replace(H, function (a, b) { - return b ? ' ' : ''; - }) : a.replace(y, ''); - } function z(a, b) { - var c = b && CKEDITOR.tools.htmlEncode(b) || '\x26nbsp;'; - var c = CKEDITOR.dom.element.createFromHtml('\x3cdiv data-cke-hidden-sel\x3d"1" data-cke-temp\x3d"1" style\x3d"' + (CKEDITOR.env.ie && CKEDITOR.env.version < 14 ? 'display:none' : 'position:fixed;top:0;left:-1000px;width:0;height:0;overflow:hidden;') + '"\x3e' + c + '\x3c/div\x3e', a.document); - - a.fire('lockSnapshot'); a.editable().append(c); var d = a.getSelection(1); var e = a.createRange(); var f = d.root.on('selectionchange', function (a) { - a.cancel(); - }, null, null, 0); - - e.setStartAt(c, CKEDITOR.POSITION_AFTER_START); e.setEndAt(c, CKEDITOR.POSITION_BEFORE_END); - d.selectRanges([e]); f.removeListener(); a.fire('unlockSnapshot'); a._.hiddenSelectionContainer = c; - } function G(a) { - var b = { 37: 1, 39: 1, 8: 1, 46: 1 }; - - return function (c) { - var d = c.data.getKeystroke(); - - if (b[d]) { - var e = a.getSelection().getRanges(); var f = e[0]; - - e.length == 1 && f.collapsed && (d = f[d < 38 ? 'getPreviousEditableNode' : 'getNextEditableNode']()) && d.type == CKEDITOR.NODE_ELEMENT && d.getAttribute('contenteditable') == 'false' && (a.getSelection().fake(d), c.data.preventDefault(), c.cancel()); - } - }; - } function t(a) { - for (var b = 0; b < a.length; b++) { - var c = -a[b]; - - c.getCommonAncestor().isReadOnly() && a.splice(b, 1); if (!c.collapsed) { - if (c.startContainer.isReadOnly()) { - for (var d = c.startContainer, e; d && !((e = d.type == CKEDITOR.NODE_ELEMENT) && d.is('body') || !d.isReadOnly());) { - e && d.getAttribute('contentEditable') == 'false' && c.setStartAfter(d), d = d.getParent(); - } - }d = c.startContainer; e = c.endContainer; var f = c.startOffset; var g = c.endOffset; var h = c.clone(); - - d && d.type == CKEDITOR.NODE_TEXT && (f >= d.getLength() ? h.setStartAfter(d) : h.setStartBefore(d)); e && e.type == CKEDITOR.NODE_TEXT && (g ? h.setEndAfter(e) : - h.setEndBefore(e)); d = new CKEDITOR.dom.walker(h); d.evaluator = function (d) { - if (d.type == CKEDITOR.NODE_ELEMENT && d.isReadOnly()) { - var e = c.clone(); - - c.setEndBefore(d); c.collapsed && a.splice(b--, 1); d.getPosition(h.endContainer) & CKEDITOR.POSITION_CONTAINS || (e.setStartAfter(d), e.collapsed || a.splice(b + 1, 0, e)); return !0; - } return !1; - }; d.next(); - } - } return a; - } var n = typeof window.getSelection !== 'function'; var L = 1; var y = CKEDITOR.tools.repeat('​', 7); var H = new RegExp(y + '( )?', 'g'); var I; var m; var C; var K = CKEDITOR.dom.walker.invisible(1); var A = (function () { - function a(b) { - return function (a) { - var c = -a.editor.createRange(); - - c.moveToClosestEditablePosition(a.selected, b) && a.editor.getSelection().selectRanges([c]); return !1; - }; - } function b(a) { - return function (b) { - var c = b.editor; var d = c.createRange(); var e; - - if (!c.readOnly) { - return (e = d.moveToClosestEditablePosition(b.selected, a)) || (e = d.moveToClosestEditablePosition(b.selected, !a)), e && c.getSelection().selectRanges([d]), c.fire('saveSnapshot'), b.selected.remove(), e || (d.moveToElementEditablePosition(c.editable()), c.getSelection().selectRanges([d])), c.fire('saveSnapshot'), - !1; - } - }; - } var c = a(); var d = a(1); - - return { 37: c, 38: c, 39: d, 40: d, 8: b(), 46: b(1) }; - })(); - - CKEDITOR.on('instanceCreated', function (a) { - function b() { - var a = c.getSelection(); - - a && a.removeAllRanges(); - } var c = a.editor; - - c.on('contentDom', function () { - function a() { - u = new CKEDITOR.dom.selection(c.getSelection()); u.lock(); - } function b() { - g.removeListener('mouseup', b); r.removeListener('mouseup', b); var a = CKEDITOR.document.$.selection; var c = a.createRange(); - - a.type != 'None' && c.parentElement() && c.parentElement().ownerDocument == f.$ && c.select(); - } function d(a) { - var b; - var c; - - b = (b = this.document.getActive()) ? b.getName() === 'input' || b.getName() === 'textarea' : !1; b || (b = this.getSelection(1), (c = e(b)) && !c.equals(q) && (b.selectElement(c), a.data.preventDefault())); - } function e(a) { - a = a.getRanges()[0]; return a ? (a = a.startContainer.getAscendant(function (a) { - return a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute('contenteditable'); - }, !0)) && a.getAttribute('contenteditable') === 'false' ? a : null : null; - } var f = c.document; var g = CKEDITOR.document; var q = c.editable(); var l = f.getBody(); var r = f.getDocumentElement(); var D = q.isInline(); - var m; var u; - - CKEDITOR.env.gecko && q.attachListener(q, 'focus', function (a) { - a.removeListener(); m !== 0 && (a = c.getSelection().getNative()) && a.isCollapsed && a.anchorNode == q.$ && (a = c.createRange(), a.moveToElementEditStart(q), a.select()); - }, null, null, -2); q.attachListener(q, CKEDITOR.env.webkit || CKEDITOR.env.gecko ? 'focusin' : 'focus', function () { - if (m && (CKEDITOR.env.webkit || CKEDITOR.env.gecko)) { - m = c._.previousActive && c._.previousActive.equals(f.getActive()); var a = c._.previousScrollTop != null && c._.previousScrollTop != q.$.scrollTop; - - CKEDITOR.env.webkit && m && a && (q.$.scrollTop = c._.previousScrollTop); - }c.unlockSelection(m); m = 0; - }, null, null, -1); q.attachListener(q, 'mousedown', function () { - m = 0; - }); if (CKEDITOR.env.ie || CKEDITOR.env.gecko || D) { - n ? q.attachListener(q, 'beforedeactivate', a, null, null, -1) : q.attachListener(c, 'selectionCheck', a, null, null, -1), q.attachListener(q, CKEDITOR.env.webkit || CKEDITOR.env.gecko ? 'focusout' : 'blur', function () { - var a = u && (u.isFake || u.getRanges().length < 2); - - CKEDITOR.env.gecko && !D && a || (c.lockSelection(u), m = 1); - }, null, null, -1), - q.attachListener(q, 'mousedown', function () { - m = 0; - }); - } if (CKEDITOR.env.ie && !D) { - var w; - - q.attachListener(q, 'mousedown', function (a) { - a.data.$.button == 2 && ((a = c.document.getSelection()) && a.getType() != CKEDITOR.SELECTION_NONE || (w = c.window.getScrollPosition())); - }); q.attachListener(q, 'mouseup', function (a) { - a.data.$.button == 2 && w && (c.document.$.documentElement.scrollLeft = w.x, c.document.$.documentElement.scrollTop = w.y); w = null; - }); if (f.$.compatMode != 'BackCompat') { - if (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) { - var t; var z; - - r.on('mousedown', function (a) { - function b(a) { - a = a.data.$; if (t) { - var c = l.$.createTextRange(); - - try { - c.moveToPoint(a.clientX, a.clientY); - } catch (d) {}t.setEndPoint(z.compareEndPoints('StartToStart', c) < 0 ? 'EndToEnd' : 'StartToStart', c); t.select(); - } - } function c() { - r.removeListener('mousemove', b); g.removeListener('mouseup', c); r.removeListener('mouseup', c); t.select(); - }a = a.data; if (a.getTarget().is('html') && a.$.y < r.$.clientHeight && a.$.x < r.$.clientWidth) { - t = l.$.createTextRange(); try { - t.moveToPoint(a.$.clientX, a.$.clientY); - } catch (d) {}z = -t.duplicate(); r.on('mousemove', b); g.on('mouseup', c); r.on('mouseup', c); - } - }); - } if (CKEDITOR.env.version > 7 && CKEDITOR.env.version < 11) { - r.on('mousedown', function (a) { - a.data.getTarget().is('html') && (g.on('mouseup', b), r.on('mouseup', b)); - }); - } - } - }q.attachListener(q, 'selectionchange', h, c); q.attachListener(q, 'keyup', k, c); q.attachListener(q, 'touchstart', k, c); q.attachListener(q, 'touchend', k, c); CKEDITOR.env.ie && q.attachListener(q, 'keydown', d, c); q.attachListener(q, CKEDITOR.env.webkit || CKEDITOR.env.gecko ? 'focusin' : 'focus', function () { - c.forceNextSelectionCheck(); - c.selectionChange(1); - }); if (D && (CKEDITOR.env.webkit || CKEDITOR.env.gecko)) { - var y; - - q.attachListener(q, 'mousedown', function () { - y = 1; - }); q.attachListener(f.getDocumentElement(), 'mouseup', function () { - y && k.call(c); y = 0; - }); - } else { - q.attachListener(CKEDITOR.env.ie ? q : f.getDocumentElement(), 'mouseup', k, c); - }CKEDITOR.env.webkit && q.attachListener(f, 'keydown', function (a) { - switch (a.data.getKey()) { - case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:q.hasFocus && x(q); - } - }, null, null, -1); q.attachListener(q, - 'keydown', G(c), null, null, -1); - }); c.on('setData', function () { - c.unlockSelection(); CKEDITOR.env.webkit && b(); - }); c.on('contentDomUnload', function () { - c.unlockSelection(); - }); if (CKEDITOR.env.ie9Compat) { - c.on('beforeDestroy', b, null, null, 9); - }c.on('dataReady', function () { - delete c._.fakeSelection; delete c._.hiddenSelectionContainer; c.selectionChange(1); - }); c.on('loadSnapshot', function () { - var a = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT); var b = c.editable().getLast(a); - - b && b.hasAttribute('data-cke-hidden-sel') && (b.remove(), - CKEDITOR.env.gecko && (a = c.editable().getFirst(a)) && a.is('br') && a.getAttribute('_moz_editor_bogus_node') && a.remove()); - }, null, null, 100); c.on('key', function (a) { - if (c.mode == 'wysiwyg') { - var b = c.getSelection(); - - if (b.isFake) { - var d = A[a.data.keyCode]; - - if (d) { - return d({ editor: c, selected: b.getSelectedElement(), selection: b, keyEvent: a }); - } - } - } - }); - }); if (CKEDITOR.env.webkit) { - CKEDITOR.on('instanceReady', function (a) { - var b = a.editor; - - b.on('selectionChange', function () { - var a = b.editable(); var c = a.getCustomData('cke-fillingChar'); - - c && (c.getCustomData('ready') ? - (x(a), a.editor.fire('selectionCheck')) : c.setCustomData('ready', 1)); - }, null, null, -1); b.on('beforeSetMode', function () { - x(b.editable()); - }, null, null, -1); b.on('getSnapshot', function (a) { - a.data && (a.data = w(a.data)); - }, b, null, 20); b.on('toDataFormat', function (a) { - a.data.dataValue = w(a.data.dataValue); - }, null, null, 0); - }); - }CKEDITOR.editor.prototype.selectionChange = function (a) { - (a ? h : k).call(this); - }; CKEDITOR.editor.prototype.getSelection = function (a) { - return !this._.savedSelection && !this._.fakeSelection || a ? (a = this.editable()) && -this.mode == 'wysiwyg' ? new CKEDITOR.dom.selection(a) : null : this._.savedSelection || this._.fakeSelection; - }; CKEDITOR.editor.prototype.getSelectedRanges = function (a) { - var b = this.getSelection(); - - return b && b.getRanges(a) || []; - }; CKEDITOR.editor.prototype.lockSelection = function (a) { - a = a || this.getSelection(1); return a.getType() != CKEDITOR.SELECTION_NONE ? (!a.isLocked && a.lock(), this._.savedSelection = a, !0) : !1; - }; CKEDITOR.editor.prototype.unlockSelection = function (a) { - var b = this._.savedSelection; - - return b ? (b.unlock(a), delete this._.savedSelection, - !0) : !1; - }; CKEDITOR.editor.prototype.forceNextSelectionCheck = function () { - delete this._.selectionPreviousPath; - }; CKEDITOR.dom.document.prototype.getSelection = function () { - return new CKEDITOR.dom.selection(this); - }; CKEDITOR.dom.range.prototype.select = function () { - var a = this.root instanceof CKEDITOR.editable ? this.root.editor.getSelection() : new CKEDITOR.dom.selection(this.root); - - a.selectRanges([this]); return a; - }; CKEDITOR.SELECTION_NONE = 1; CKEDITOR.SELECTION_TEXT = 2; CKEDITOR.SELECTION_ELEMENT = 3; CKEDITOR.dom.selection = -function (a) { - if (a instanceof CKEDITOR.dom.selection) { - var b = a; - - a = a.root; - } var c = a instanceof CKEDITOR.dom.element; - - this.rev = b ? b.rev : L++; this.document = a instanceof CKEDITOR.dom.document ? a : a.getDocument(); this.root = c ? a : this.document.getBody(); this.isLocked = 0; this._ = { cache: {} }; if (b) { - return CKEDITOR.tools.extend(this._.cache, b._.cache), this.isFake = b.isFake, this.isLocked = b.isLocked, this; - } a = this.getNative(); var d; var e; - - if (a) { - if (a.getRangeAt) { - d = (e = a.rangeCount && a.getRangeAt(0)) && new CKEDITOR.dom.node(e.commonAncestorContainer); - } else { - try { - e = a.createRange(); - } catch (f) {}d = e && CKEDITOR.dom.element.get(e.item && e.item(0) || e.parentElement()); - } - } if (!d || d.type != CKEDITOR.NODE_ELEMENT && d.type != CKEDITOR.NODE_TEXT || !this.root.equals(d) && !this.root.contains(d)) { - this._.cache.type = CKEDITOR.SELECTION_NONE, this._.cache.startElement = null, this._.cache.selectedElement = null, this._.cache.selectedText = '', this._.cache.ranges = new CKEDITOR.dom.rangeList(); - } return this; -}; var M = { img: 1, hr: 1, li: 1, table: 1, tr: 1, td: 1, th: 1, embed: 1, object: 1, ol: 1, ul: 1, a: 1, input: 1, form: 1, - select: 1, textarea: 1, button: 1, fieldset: 1, thead: 1, tfoot: 1 }; - - CKEDITOR.tools.extend(CKEDITOR.dom.selection, { _removeFillingCharSequenceString: w, _createFillingCharSequenceNode: e, FILLING_CHAR_SEQUENCE: y }); CKEDITOR.dom.selection.prototype = { getNative: function () { - return void 0 !== this._.cache.nativeSel ? this._.cache.nativeSel : this._.cache.nativeSel = n ? this.document.$.selection : this.document.getWindow().$.getSelection(); - }, getType: n ? function () { - var a = this._.cache; - - if (a.type) { - return a.type; - } var b = CKEDITOR.SELECTION_NONE; - - try { - var c = this.getNative(); var d = c.type; - - d == 'Text' && (b = CKEDITOR.SELECTION_TEXT); d == 'Control' && (b = CKEDITOR.SELECTION_ELEMENT); c.createRange().parentElement() && (b = CKEDITOR.SELECTION_TEXT); - } catch (e) {} return a.type = b; - } : function () { - var a = this._.cache; - - if (a.type) { - return a.type; - } var b = CKEDITOR.SELECTION_TEXT; var c = this.getNative(); - - if (!c || !c.rangeCount) { - b = CKEDITOR.SELECTION_NONE; - } else if (c.rangeCount == 1) { - var c = c.getRangeAt(0); var d = c.startContainer; - - d == c.endContainer && d.nodeType == 1 && c.endOffset - c.startOffset == 1 && M[d.childNodes[c.startOffset].nodeName.toLowerCase()] && -(b = CKEDITOR.SELECTION_ELEMENT); - } return a.type = b; - }, getRanges: (function () { - var a = n ? (function () { - function a(b) { - return new CKEDITOR.dom.node(b).getIndex(); - } var b = function (b, c) { - b = b.duplicate(); b.collapse(c); var d = b.parentElement(); - - if (!d.hasChildNodes()) { - return { container: d, offset: 0 }; - } for (var e = d.children, f, g, h = b.duplicate(), k = 0, l = e.length - 1, r = -1, n, m; k <= l;) { - if (r = Math.floor((k + l) / 2), f = e[r], h.moveToElementText(f), n = h.compareEndPoints('StartToStart', b), n > 0) { - l = r - 1; - } else if (n < 0) { - k = r + 1; - } else { - return { container: d, offset: a(f) }; - } - } - if (r == -1 || r == e.length - 1 && n < 0) { - h.moveToElementText(d); h.setEndPoint('StartToStart', b); h = h.text.replace(/(\r\n|\r)/g, '\n').length; e = d.childNodes; if (!h) { - return f = e[e.length - 1], f.nodeType != CKEDITOR.NODE_TEXT ? { container: d, offset: e.length } : { container: f, offset: f.nodeValue.length }; - } for (d = e.length; h > 0 && d > 0;) { - g = e[--d], g.nodeType == CKEDITOR.NODE_TEXT && (m = g, h -= g.nodeValue.length); - } return { container: m, offset: -h }; - }h.collapse(n > 0 ? !0 : !1); h.setEndPoint(n > 0 ? 'StartToStart' : 'EndToStart', b); h = h.text.replace(/(\r\n|\r)/g, '\n').length; - if (!h) { - return { container: d, offset: a(f) + (n > 0 ? 0 : 1) }; - } for (;h > 0;) { - try { - g = f[n > 0 ? 'previousSibling' : 'nextSibling'], g.nodeType == CKEDITOR.NODE_TEXT && (h -= g.nodeValue.length, m = g), f = g; - } catch (u) { - return { container: d, offset: a(f) }; - } - } return { container: m, offset: n > 0 ? -h : m.nodeValue.length + h }; - }; - - return function () { - var a = this.getNative(); var c = a && a.createRange(); var d = this.getType(); - - if (!a) { - return []; - } if (d == CKEDITOR.SELECTION_TEXT) { - return a = new CKEDITOR.dom.range(this.root), d = b(c, !0), a.setStart(new CKEDITOR.dom.node(d.container), d.offset), d = b(c), - a.setEnd(new CKEDITOR.dom.node(d.container), d.offset), a.endContainer.getPosition(a.startContainer) & CKEDITOR.POSITION_PRECEDING && a.endOffset <= a.startContainer.getIndex() && a.collapse(), [a]; - } if (d == CKEDITOR.SELECTION_ELEMENT) { - for (var d = [], e = 0; e < c.length; e++) { - for (var f = c.item(e), g = f.parentNode, h = 0, a = new CKEDITOR.dom.range(this.root); h < g.childNodes.length && g.childNodes[h] != f; h++) { }a.setStart(new CKEDITOR.dom.node(g), h); a.setEnd(new CKEDITOR.dom.node(g), h + 1); d.push(a); - } return d; - } return []; - }; - })() : function () { - var a = -[]; var b; var c = this.getNative(); - - if (!c) { - return a; - } for (var d = 0; d < c.rangeCount; d++) { - var e = c.getRangeAt(d); - - b = new CKEDITOR.dom.range(this.root); b.setStart(new CKEDITOR.dom.node(e.startContainer), e.startOffset); b.setEnd(new CKEDITOR.dom.node(e.endContainer), e.endOffset); a.push(b); - } return a; - }; - - return function (b) { - var c = this._.cache; var d = c.ranges; - - d || (c.ranges = d = new CKEDITOR.dom.rangeList(a.call(this))); return b ? t(new CKEDITOR.dom.rangeList(d.slice())) : d; - }; - })(), getStartElement: function () { - var a = this._.cache; - - if (void 0 !== a.startElement) { - return a.startElement; - } - var b; - - switch (this.getType()) { - case CKEDITOR.SELECTION_ELEMENT:return this.getSelectedElement(); case CKEDITOR.SELECTION_TEXT:var c = this.getRanges()[0]; - - if (c) { - if (c.collapsed) { - b = c.startContainer, b.type != CKEDITOR.NODE_ELEMENT && (b = b.getParent()); - } else { - for (c.optimize(); b = c.startContainer, c.startOffset == (b.getChildCount ? b.getChildCount() : b.getLength()) && !b.isBlockBoundary();) { - c.setStartAfter(b); - }b = c.startContainer; if (b.type != CKEDITOR.NODE_ELEMENT) { - return b.getParent(); - } if ((b = b.getChild(c.startOffset)) && b.type == -CKEDITOR.NODE_ELEMENT) { - for (c = b.getFirst(); c && c.type == CKEDITOR.NODE_ELEMENT;) { - b = c, c = c.getFirst(); - } - } else { - b = c.startContainer; - } - }b = b.$; - } - } return a.startElement = b ? new CKEDITOR.dom.element(b) : null; - }, getSelectedElement: function () { - var a = this._.cache; - - if (void 0 !== a.selectedElement) { - return a.selectedElement; - } var b = this; var c = CKEDITOR.tools.tryThese(function () { - return b.getNative().createRange().item(0); - }, function () { - for (var a = b.getRanges()[0].clone(), c, d, e = 2; e && !((c = a.getEnclosedNode()) && c.type == CKEDITOR.NODE_ELEMENT && M[c.getName()] && -(d = c)); e--) { - a.shrink(CKEDITOR.SHRINK_ELEMENT); - } return d && d.$; - }); - - return a.selectedElement = c ? new CKEDITOR.dom.element(c) : null; - }, getSelectedText: function () { - var a = this._.cache; - - if (void 0 !== a.selectedText) { - return a.selectedText; - } var b = this.getNative(); var b = n ? b.type == 'Control' ? '' : b.createRange().text : b.toString(); - - return a.selectedText = b; - }, lock: function () { - this.getRanges(); this.getStartElement(); this.getSelectedElement(); this.getSelectedText(); this._.cache.nativeSel = null; this.isLocked = 1; - }, unlock: function (a) { - if (this.isLocked) { - if (a) { - var b = -this.getSelectedElement(); var c = this.getRanges(); var e = this.isFake; - } - - this.isLocked = 0; this.reset(); a && (a = b || c[0] && c[0].getCommonAncestor()) && a.getAscendant('body', 1) && ((a = this.root.editor) && a.plugins.tableselection && a.plugins.tableselection.isSupportedEnvironment(a) && d(c) ? f.call(this, c) : e ? this.fake(b) : b && c.length < 2 ? this.selectElement(b) : this.selectRanges(c)); - } - }, reset: function () { - this._.cache = {}; this.isFake = 0; var a = this.root.editor; - - if (a && a._.fakeSelection) { - if (this.rev == a._.fakeSelection.rev) { - delete a._.fakeSelection; - var b = a._.hiddenSelectionContainer; - - if (b) { - var c = a.checkDirty(); - - a.fire('lockSnapshot'); b.remove(); a.fire('unlockSnapshot'); !c && a.resetDirty(); - } delete a._.hiddenSelectionContainer; - } else { - CKEDITOR.warn('selection-fake-reset'); - } - } this.rev = L++; - }, selectElement: function (a) { - var b = new CKEDITOR.dom.range(this.root); - - b.setStartBefore(a); b.setEndAfter(a); this.selectRanges([b]); - }, selectRanges: function (a) { - var b = this.root.editor; var c = b && b._.hiddenSelectionContainer; - - this.reset(); if (c) { - for (var c = this.root, g, h = 0; h < a.length; ++h) { - g = -a[h], g.endContainer.equals(c) && (g.endOffset = Math.min(g.endOffset, c.getChildCount())); - } - } if (a.length) { - if (this.isLocked) { - var k = CKEDITOR.document.getActive(); - - this.unlock(); this.selectRanges(a); this.lock(); k && !k.equals(this.root) && k.focus(); - } else { - var p; - - a: { - var l; var m; - - if (a.length == 1 && !(m = a[0]).collapsed && (p = m.getEnclosedNode()) && p.type == CKEDITOR.NODE_ELEMENT && (m = m.clone(), m.shrink(CKEDITOR.SHRINK_ELEMENT, !0), (l = m.getEnclosedNode()) && l.type == CKEDITOR.NODE_ELEMENT && (p = l), p.getAttribute('contenteditable') == 'false')) { - break a; - } - p = void 0; - } if (p) { - this.fake(p); - } else if (b && b.plugins.tableselection && b.plugins.tableselection.isSupportedEnvironment(b) && d(a) && !I && !a[0]._getTableElement({ table: 1 }).hasAttribute('data-cke-tableselection-ignored')) { - f.call(this, a); - } else { - if (n) { - l = CKEDITOR.dom.walker.whitespaces(!0); p = /\ufeff|\u00a0/; m = { table: 1, tbody: 1, tr: 1 }; a.length > 1 && (b = a[a.length - 1], a[0].setEnd(b.endContainer, b.endOffset)); b = a[0]; a = b.collapsed; var q; var F; var E; - - if ((c = b.getEnclosedNode()) && c.type == CKEDITOR.NODE_ELEMENT && c.getName() in M && (!c.is('a') || -!c.getText())) { - try { - E = c.$.createControlRange(); E.addElement(c.$); E.select(); return; - } catch (w) {} - } if (b.startContainer.type == CKEDITOR.NODE_ELEMENT && b.startContainer.getName() in m || b.endContainer.type == CKEDITOR.NODE_ELEMENT && b.endContainer.getName() in m) { - b.shrink(CKEDITOR.NODE_ELEMENT, !0), a = b.collapsed; - }E = b.createBookmark(); m = E.startNode; a || (k = E.endNode); E = b.document.$.body.createTextRange(); E.moveToElementText(m.$); E.moveStart('character', 1); k ? (p = b.document.$.body.createTextRange(), p.moveToElementText(k.$), - E.setEndPoint('EndToEnd', p), E.moveEnd('character', -1)) : (q = m.getNext(l), F = m.hasAscendant('pre'), q = !(q && q.getText && q.getText().match(p)) && (F || !m.hasPrevious() || m.getPrevious().is && m.getPrevious().is('br')), F = b.document.createElement('span'), F.setHtml('\x26#65279;'), F.insertBefore(m), q && b.document.createText('').insertBefore(m)); b.setStartBefore(m); m.remove(); a ? (q ? (E.moveStart('character', -1), E.select(), b.document.$.selection.clear()) : E.select(), b.moveToPosition(F, CKEDITOR.POSITION_BEFORE_START), F.remove()) : - (b.setEndBefore(k), k.remove(), E.select()); - } else { - k = this.getNative(); if (!k) { - return; - } this.removeAllRanges(); for (E = 0; E < a.length; E++) { - if (E < a.length - 1 && (q = a[E], F = a[E + 1], p = q.clone(), p.setStart(q.endContainer, q.endOffset), p.setEnd(F.startContainer, F.startOffset), !p.collapsed && (p.shrink(CKEDITOR.NODE_ELEMENT, !0), b = p.getCommonAncestor(), p = p.getEnclosedNode(), b.isReadOnly() || p && p.isReadOnly()))) { - F.setStart(q.startContainer, q.startOffset); a.splice(E--, 1); continue; - }b = a[E]; F = this.document.$.createRange(); b.collapsed && -CKEDITOR.env.webkit && u(b) && (p = e(this.root), b.insertNode(p), (q = p.getNext()) && !p.getPrevious() && q.type == CKEDITOR.NODE_ELEMENT && q.getName() == 'br' ? (x(this.root), b.moveToPosition(q, CKEDITOR.POSITION_BEFORE_START)) : b.moveToPosition(p, CKEDITOR.POSITION_AFTER_END)); F.setStart(b.startContainer.$, b.startOffset); try { - F.setEnd(b.endContainer.$, b.endOffset); - } catch (t) { - if (t.toString().indexOf('NS_ERROR_ILLEGAL_VALUE') >= 0) { - b.collapse(1), F.setEnd(b.endContainer.$, b.endOffset); - } else { - throw t; - } - }k.addRange(F); - } - } this.reset(); - this.root.fire('selectionchange'); - } - } - } - }, fake: function (a, b) { - var c = this.root.editor; - - void 0 === b && a.hasAttribute('aria-label') && (b = a.getAttribute('aria-label')); this.reset(); z(c, b); var d = this._.cache; var e = new CKEDITOR.dom.range(this.root); - - e.setStartBefore(a); e.setEndAfter(a); d.ranges = new CKEDITOR.dom.rangeList(e); d.selectedElement = d.startElement = a; d.type = CKEDITOR.SELECTION_ELEMENT; d.selectedText = d.nativeSel = null; this.isFake = 1; this.rev = L++; c._.fakeSelection = this; this.root.fire('selectionchange'); - }, isHidden: function () { - var a = -this.getCommonAncestor(); - - a && a.type == CKEDITOR.NODE_TEXT && (a = a.getParent()); return !(!a || !a.data('cke-hidden-sel')); - }, isInTable: function (a) { - return d(this.getRanges(), a); - }, isCollapsed: function () { - var a = this.getRanges(); - - return a.length === 1 && a[0].collapsed; - }, createBookmarks: function (a) { - a = this.getRanges().createBookmarks(a); this.isFake && (a.isFake = 1); return a; - }, createBookmarks2: function (a) { - a = this.getRanges().createBookmarks2(a); this.isFake && (a.isFake = 1); return a; - }, selectBookmarks: function (a) { - for (var b = [], c, e = 0; e < -a.length; e++) { - var f = new CKEDITOR.dom.range(this.root); - - f.moveToBookmark(a[e]); b.push(f); - }a.isFake && (c = d(b) ? b[0]._getTableElement() : b[0].getEnclosedNode(), c && c.type == CKEDITOR.NODE_ELEMENT || (CKEDITOR.warn('selection-not-fake'), a.isFake = 0)); a.isFake && !d(b) ? this.fake(c) : this.selectRanges(b); return this; - }, getCommonAncestor: function () { - var a = this.getRanges(); - - return a.length ? a[0].startContainer.getCommonAncestor(a[a.length - 1].endContainer) : null; - }, scrollIntoView: function () { - this.type != CKEDITOR.SELECTION_NONE && -this.getRanges()[0].scrollIntoView(); - }, removeAllRanges: function () { - if (this.getType() != CKEDITOR.SELECTION_NONE) { - var a = this.getNative(); - - try { - a && a[n ? 'empty' : 'removeAllRanges'](); - } catch (b) {} this.reset(); - } - } }; - })(); 'use strict'; CKEDITOR.STYLE_BLOCK = 1; CKEDITOR.STYLE_INLINE = 2; CKEDITOR.STYLE_OBJECT = 3; - (function () { - function a(a, b) { - for (var c, d; (a = a.getParent()) && !a.equals(b);) { - if (a.getAttribute('data-nostyle')) { - c = a; - } else if (!d) { - var e = a.getAttribute('contentEditable'); - - e == 'false' ? c = a : e == 'true' && (d = 1); - } - } return c; - } function d(a, b, c, d) { - return (a.getPosition(b) | d) == d && (!c.childRule || c.childRule(a)); - } function b(c) { - var e = c.document; - - if (c.collapsed) { - e = L(this, e), c.insertNode(e), c.moveToPosition(e, CKEDITOR.POSITION_BEFORE_END); - } else { - var g = this.element; var h = this._.definition; var k; var l = h.ignoreReadonly; var m = l || h.includeReadonly; - - m == -null && (m = c.root.getCustomData('cke_includeReadonly')); var n = CKEDITOR.dtd[g]; - - n || (k = !0, n = CKEDITOR.dtd.span); c.enlarge(CKEDITOR.ENLARGE_INLINE, 1); c.trim(); var u = c.createBookmark(); var x = u.startNode; var w = u.endNode; var r = x; var t; - - if (!l) { - var v = c.getCommonAncestor(); var l = a(x, v); var v = a(w, v); - - l && (r = l.getNextSourceNode(!0)); v && (w = v); - } for (r.getPosition(w) == CKEDITOR.POSITION_FOLLOWING && (r = 0); r;) { - l = !1; if (r.equals(w)) { - r = null, l = !0; - } else { - var z = r.type == CKEDITOR.NODE_ELEMENT ? r.getName() : null; var v = z && r.getAttribute('contentEditable') == 'false'; var y = z && -r.getAttribute('data-nostyle'); - - if (z && r.data('cke-bookmark') || r.type === CKEDITOR.NODE_COMMENT) { - r = r.getNextSourceNode(!0); continue; - } if (v && m && CKEDITOR.dtd.$block[z]) { - for (var A = r, C = f(A), D = void 0, H = C.length, I = 0, A = H && new CKEDITOR.dom.range(A.getDocument()); I < H; ++I) { - var D = C[I]; var K = CKEDITOR.filter.instances[D.data('cke-filter')]; - - if (K ? K.check(this) : 1) { - A.selectNodeContents(D), b.call(this, A); - } - } - }C = z ? !n[z] || y ? 0 : v && !m ? 0 : d(r, w, h, T) : 1; if (C) { - if (D = r.getParent(), C = h, H = g, I = k, !D || !(D.getDtd() || CKEDITOR.dtd.span)[H] && !I || C.parentRule && -!C.parentRule(D)) { - l = !0; - } else if (t || z && CKEDITOR.dtd.$removeEmpty[z] && (r.getPosition(w) | T) != T || (t = c.clone(), t.setStartBefore(r)), z = r.type, z == CKEDITOR.NODE_TEXT || v || z == CKEDITOR.NODE_ELEMENT && !r.getChildCount()) { - for (var z = r, M; (l = !z.getNext(B)) && (M = z.getParent(), n[M.getName()]) && d(M, x, h, S);) { - z = M; - }t.setEndAfter(z); - } - } else { - l = !0; - }r = r.getNextSourceNode(y || v); - } if (l && t && !t.collapsed) { - for (var l = L(this, e), v = l.hasAttributes(), y = t.getCommonAncestor(), z = {}, C = {}, D = {}, H = {}, X, W, Y; l && y;) { - if (y.getName() == g) { - for (X in h.attributes) { - !H[X] && -(Y = y.getAttribute(W)) && (l.getAttribute(X) == Y ? C[X] = 1 : H[X] = 1); - } for (W in h.styles) { - !D[W] && (Y = y.getStyle(W)) && (l.getStyle(W) == Y ? z[W] = 1 : D[W] = 1); - } - }y = y.getParent(); - } for (X in C) { - l.removeAttribute(X); - } for (W in z) { - l.removeStyle(W); - }v && !l.hasAttributes() && (l = null); l ? (t.extractContents().appendTo(l), t.insertNode(l), G.call(this, l), l.mergeSiblings(), CKEDITOR.env.ie || l.$.normalize()) : (l = new CKEDITOR.dom.element('span'), t.extractContents().appendTo(l), t.insertNode(l), G.call(this, l), l.remove(!0)); t = null; - } - }c.moveToBookmark(u); - c.shrink(CKEDITOR.SHRINK_TEXT); c.shrink(CKEDITOR.NODE_ELEMENT, !0); - } - } function c(a) { - function b() { - for (var a = new CKEDITOR.dom.elementPath(d.getParent()), c = new CKEDITOR.dom.elementPath(m.getParent()), e = null, f = null, g = 0; g < a.elements.length; g++) { - var h = a.elements[g]; - - if (h == a.block || h == a.blockLimit) { - break; - } n.checkElementRemovable(h, !0) && (e = h); - } for (g = 0; g < c.elements.length; g++) { - h = c.elements[g]; if (h == c.block || h == c.blockLimit) { - break; - } n.checkElementRemovable(h, !0) && (f = h); - }f && m.breakParent(f); e && d.breakParent(e); - }a.enlarge(CKEDITOR.ENLARGE_INLINE, - 1); var c = a.createBookmark(); var d = c.startNode; var e = this._.definition.alwaysRemoveElement; - - if (a.collapsed) { - for (var f = new CKEDITOR.dom.elementPath(d.getParent(), a.root), g, h = 0, k; h < f.elements.length && (k = f.elements[h]) && k != f.block && k != f.blockLimit; h++) { - if (this.checkElementRemovable(k)) { - var l; - - !e && a.collapsed && (a.checkBoundaryOfElement(k, CKEDITOR.END) || (l = a.checkBoundaryOfElement(k, CKEDITOR.START))) ? (g = k, g.match = l ? 'start' : 'end') : (k.mergeSiblings(), k.is(this.element) ? z.call(this, k) : t(k, I(this)[k.getName()])); - } - } if (g) { - e = -d; for (h = 0; ;h++) { - k = f.elements[h]; if (k.equals(g)) { - break; - } else if (k.match) { - continue; - } else { - k = k.clone(); - }k.append(e); e = k; - }e[g.match == 'start' ? 'insertBefore' : 'insertAfter'](g); - } - } else { - var m = c.endNode; var n = this; - - b(); for (f = d; !f.equals(m);) { - g = f.getNextSourceNode(), f.type == CKEDITOR.NODE_ELEMENT && this.checkElementRemovable(f) && (f.getName() == this.element ? z.call(this, f) : t(f, I(this)[f.getName()]), g.type == CKEDITOR.NODE_ELEMENT && g.contains(d) && (b(), g = d.getNext())), f = g; - } - }a.moveToBookmark(c); a.shrink(CKEDITOR.NODE_ELEMENT, !0); - } function f(a) { - var b = -[]; - - a.forEach(function (a) { - if (a.getAttribute('contenteditable') == 'true') { - return b.push(a), !1; - } - }, CKEDITOR.NODE_ELEMENT, !0); return b; - } function h(a) { - var b = a.getEnclosedNode() || a.getCommonAncestor(!1, !0); - - (a = new CKEDITOR.dom.elementPath(b, a.root).contains(this.element, 1)) && !a.isReadOnly() && y(a, this); - } function k(a) { - var b = a.getCommonAncestor(!0, !0); - - if (a = new CKEDITOR.dom.elementPath(b, a.root).contains(this.element, 1)) { - var b = this._.definition; var c = b.attributes; - - if (c) { - for (var d in c) { - a.removeAttribute(d, c[d]); - } - } if (b.styles) { - for (var e in b.styles) { - b.styles.hasOwnProperty(e) && -a.removeStyle(e); - } - } - } - } function g(a) { - var b = a.createBookmark(!0); var c = a.createIterator(); - - c.enforceRealBlocks = !0; this._.enterMode && (c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR); for (var d, e = a.document, f; d = c.getNextParagraph();) { - !d.isReadOnly() && (c.activeFilter ? c.activeFilter.check(this) : 1) && (f = L(this, e, d), u(d, f)); - }a.moveToBookmark(b); - } function l(a) { - var b = a.createBookmark(1); var c = a.createIterator(); - - c.enforceRealBlocks = !0; c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR; for (var d, e; d = c.getNextParagraph();) { - this.checkElementRemovable(d) && -(d.is('pre') ? ((e = this._.enterMode == CKEDITOR.ENTER_BR ? null : a.document.createElement(this._.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div')) && d.copyAttributes(e), u(d, e)) : z.call(this, d)); - } a.moveToBookmark(b); - } function u(a, b) { - var c = !b; - - c && (b = a.getDocument().createElement('div'), a.copyAttributes(b)); var d = b && b.is('pre'); var f = a.is('pre'); var g = !d && f; - - if (d && !f) { - f = b; (g = a.getBogus()) && g.remove(); g = a.getHtml(); g = x(g, /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, ''); g = g.replace(/[ \t\r\n]*(]*>)[ \t\r\n]*/gi, '$1'); g = g.replace(/([ \t\n\r]+| )/g, - ' '); g = g.replace(/]*>/gi, '\n'); if (CKEDITOR.env.ie) { - var h = a.getDocument().createElement('div'); - - h.append(f); f.$.outerHTML = '\x3cpre\x3e' + g + '\x3c/pre\x3e'; f.copyAttributes(h.getFirst()); f = h.getFirst().remove(); - } else { - f.setHtml(g); - }b = f; - } else { - g ? b = w(c ? [a.getHtml()] : e(a), b) : a.moveChildren(b); - }b.replace(a); if (d) { - var c = b; var k; - - (k = c.getPrevious(v)) && k.type == CKEDITOR.NODE_ELEMENT && k.is('pre') && (d = x(k.getHtml(), /\n$/, '') + '\n\n' + x(c.getHtml(), /^\n/, ''), CKEDITOR.env.ie ? c.$.outerHTML = '\x3cpre\x3e' + d + '\x3c/pre\x3e' : - c.setHtml(d), k.remove()); - } else { - c && n(b); - } - } function e(a) { - var b = []; - - x(a.getOuterHtml(), /(\S\s*)\n(?:\s|(]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi, function (a, b, c) { - return b + '\x3c/pre\x3e' + c + '\x3cpre\x3e'; - }).replace(/([\s\S]*?)<\/pre>/gi, function (a, c) { - b.push(c); - }); return b; - } function x(a, b, c) { - var d = ''; var e = ''; - - a = a.replace(/(^]+data-cke-bookmark.*?\/span>)|(]+data-cke-bookmark.*?\/span>$)/gi, function (a, b, c) { - b && (d = b); c && (e = c); return ''; - }); return d + a.replace(b, c) + e; - } function w(a, b) { - var c; - - a.length > 1 && (c = new CKEDITOR.dom.documentFragment(b.getDocument())); for (var d = 0; d < a.length; d++) { - var e = a[d]; var e = e.replace(/(\r\n|\r)/g, '\n'); var e = x(e, /^[ \t]*\n/, ''); var e = x(e, /\n$/, ''); var e = x(e, /^[ \t]+|[ \t]+$/g, function (a, b) { - return a.length == 1 ? '\x26nbsp;' : b ? ' ' + CKEDITOR.tools.repeat('\x26nbsp;', a.length - 1) : CKEDITOR.tools.repeat('\x26nbsp;', a.length - 1) + ' '; - }); var e = e.replace(/\n/g, '\x3cbr\x3e'); var e = e.replace(/[ \t]{2,}/g, function (a) { - return CKEDITOR.tools.repeat('\x26nbsp;', a.length - 1) + ' '; - }); - - if (c) { - var f = b.clone(); - - f.setHtml(e); - c.append(f); - } else { - b.setHtml(e); - } - } return c || b; - } function z(a, b) { - var c = this._.definition; var d = c.attributes; var c = c.styles; var e = I(this)[a.getName()]; var f = CKEDITOR.tools.isEmpty(d) && CKEDITOR.tools.isEmpty(c); var g; - - for (g in d) { - if (g != 'class' && !this._.definition.fullMatch || a.getAttribute(g) == m(g, d[g])) { - b && g.slice(0, 5) == 'data-' || (f = a.hasAttribute(g), a.removeAttribute(g)); - } - } for (var h in c) { - this._.definition.fullMatch && a.getStyle(h) != m(h, c[h], !0) || (f = f || !!a.getStyle(h), a.removeStyle(h)); - } t(a, e, A[a.getName()]); f && (this._.definition.alwaysRemoveElement ? - n(a, 1) : !CKEDITOR.dtd.$block[a.getName()] || this._.enterMode == CKEDITOR.ENTER_BR && !a.hasAttributes() ? n(a) : a.renameNode(this._.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div')); - } function G(a) { - for (var b = I(this), c = a.getElementsByTag(this.element), d, e = c.count(); --e >= 0;) { - d = c.getItem(e), d.isReadOnly() || z.call(this, d, !0); - } for (var f in b) { - if (f != this.element) { - for (c = a.getElementsByTag(f), e = c.count() - 1; e >= 0; e--) { - d = c.getItem(e), d.isReadOnly() || t(d, b[f]); - } - } - } - } function t(a, b, c) { - if (b = b && b.attributes) { - for (var d = 0; d < b.length; d++) { - var e = b[d][0]; - var f; - - if (f = a.getAttribute(e)) { - var g = b[d][1]; - - (g === null || g.test && g.test(f) || typeof g === 'string' && f == g) && a.removeAttribute(e); - } - } - }c || n(a); - } function n(a, b) { - if (!a.hasAttributes() || b) { - if (CKEDITOR.dtd.$block[a.getName()]) { - var c = a.getPrevious(v); var d = a.getNext(v); - - !c || c.type != CKEDITOR.NODE_TEXT && c.isBlockBoundary({ br: 1 }) || a.append('br', 1); !d || d.type != CKEDITOR.NODE_TEXT && d.isBlockBoundary({ br: 1 }) || a.append('br'); a.remove(!0); - } else { - c = a.getFirst(), d = a.getLast(), a.remove(!0), c && (c.type == CKEDITOR.NODE_ELEMENT && c.mergeSiblings(), - d && !c.equals(d) && d.type == CKEDITOR.NODE_ELEMENT && d.mergeSiblings()); - } - } - } function L(a, b, c) { - var d; - - d = a.element; d == '*' && (d = 'span'); d = new CKEDITOR.dom.element(d, b); c && c.copyAttributes(d); d = y(d, a); b.getCustomData('doc_processing_style') && d.hasAttribute('id') ? d.removeAttribute('id') : b.setCustomData('doc_processing_style', 1); return d; - } function y(a, b) { - var c = b._.definition; var d = c.attributes; var c = CKEDITOR.style.getStyleText(c); - - if (d) { - for (var e in d) { - a.setAttribute(e, d[e]); - } - }c && a.setAttribute('style', c); a.getDocument().removeCustomData('doc_processing_style'); - return a; - } function H(a, b) { - for (var c in a) { - a[c] = a[c].replace(D, function (a, c) { - return b[c]; - }); - } - } function I(a) { - if (a._.overrides) { - return a._.overrides; - } var b = a._.overrides = {}; var c = a._.definition.overrides; - - if (c) { - CKEDITOR.tools.isArray(c) || (c = [c]); for (var d = 0; d < c.length; d++) { - var e = c[d]; var f; var g; - - typeof e === 'string' ? f = e.toLowerCase() : (f = e.element ? e.element.toLowerCase() : a.element, g = e.attributes); e = b[f] || (b[f] = {}); if (g) { - var e = e.attributes = e.attributes || []; var h; - - for (h in g) { - e.push([h.toLowerCase(), g[h]]); - } - } - } - } return b; - } function m(a, - b, c) { - var d = new CKEDITOR.dom.element('span'); - - d[c ? 'setStyle' : 'setAttribute'](a, b); return d[c ? 'getStyle' : 'getAttribute'](a); - } function C(a, b) { - function c(a, b) { - return b.toLowerCase() == 'font-family' ? a.replace(/["']/g, '') : a; - } typeof a === 'string' && (a = CKEDITOR.tools.parseCssText(a)); typeof b === 'string' && (b = CKEDITOR.tools.parseCssText(b, !0)); for (var d in a) { - if (!(d in b) || c(b[d], d) != c(a[d], d) && a[d] != 'inherit' && b[d] != 'inherit') { - return !1; - } - } return !0; - } function K(a, b, c) { - var d = a.getRanges(); - - b = b ? this.removeFromRange : this.applyToRange; - for (var e, f = d.createIterator(); e = f.getNextRange();) { - b.call(this, e, c); - }a.selectRanges(d); - } var A = { address: 1, div: 1, h1: 1, h2: 1, h3: 1, h4: 1, h5: 1, h6: 1, p: 1, pre: 1, section: 1, header: 1, footer: 1, nav: 1, article: 1, aside: 1, figure: 1, dialog: 1, hgroup: 1, time: 1, meter: 1, menu: 1, command: 1, keygen: 1, output: 1, progress: 1, details: 1, datagrid: 1, datalist: 1 }; var M = { a: 1, blockquote: 1, embed: 1, hr: 1, img: 1, li: 1, object: 1, ol: 1, table: 1, td: 1, tr: 1, th: 1, ul: 1, dl: 1, dt: 1, dd: 1, form: 1, audio: 1, video: 1 }; var r = /\s*(?:;\s*|$)/; var D = /#\((.+?)\)/g; var B = CKEDITOR.dom.walker.bookmark(0, - 1); var v = CKEDITOR.dom.walker.whitespaces(1); - - CKEDITOR.style = function (a, b) { - if (typeof a.type === 'string') { - return new CKEDITOR.style.customHandlers[a.type](a); - } var c = a.attributes; - - c && c.style && (a.styles = CKEDITOR.tools.extend({}, a.styles, CKEDITOR.tools.parseCssText(c.style)), delete c.style); b && (a = CKEDITOR.tools.clone(a), H(a.attributes, b), H(a.styles, b)); c = this.element = a.element ? typeof a.element === 'string' ? a.element.toLowerCase() : a.element : '*'; this.type = a.type || (A[c] ? CKEDITOR.STYLE_BLOCK : M[c] ? CKEDITOR.STYLE_OBJECT : - CKEDITOR.STYLE_INLINE); typeof this.element === 'object' && (this.type = CKEDITOR.STYLE_OBJECT); this._ = { definition: a }; - }; CKEDITOR.style.prototype = { apply: function (a) { - if (a instanceof CKEDITOR.dom.document) { - return K.call(this, a.getSelection()); - } if (this.checkApplicable(a.elementPath(), a)) { - var b = this._.enterMode; - - b || (this._.enterMode = a.activeEnterMode); K.call(this, a.getSelection(), 0, a); this._.enterMode = b; - } - }, remove: function (a) { - if (a instanceof CKEDITOR.dom.document) { - return K.call(this, a.getSelection(), 1); - } if (this.checkApplicable(a.elementPath(), - a)) { - var b = this._.enterMode; - - b || (this._.enterMode = a.activeEnterMode); K.call(this, a.getSelection(), 1, a); this._.enterMode = b; - } - }, applyToRange: function (a) { - this.applyToRange = this.type == CKEDITOR.STYLE_INLINE ? b : this.type == CKEDITOR.STYLE_BLOCK ? g : this.type == CKEDITOR.STYLE_OBJECT ? h : null; return this.applyToRange(a); - }, removeFromRange: function (a) { - this.removeFromRange = this.type == CKEDITOR.STYLE_INLINE ? c : this.type == CKEDITOR.STYLE_BLOCK ? l : this.type == CKEDITOR.STYLE_OBJECT ? k : null; return this.removeFromRange(a); - }, applyToObject: function (a) { - y(a, - this); - }, checkActive: function (a, b) { - switch (this.type) { - case CKEDITOR.STYLE_BLOCK:return this.checkElementRemovable(a.block || a.blockLimit, !0, b); case CKEDITOR.STYLE_OBJECT:case CKEDITOR.STYLE_INLINE:for (var c = a.elements, d = 0, e; d < c.length; d++) { - if (e = c[d], this.type != CKEDITOR.STYLE_INLINE || e != a.block && e != a.blockLimit) { - if (this.type == CKEDITOR.STYLE_OBJECT) { - var f = e.getName(); - - if (!(typeof this.element === 'string' ? f == this.element : f in this.element)) { - continue; - } - } if (this.checkElementRemovable(e, !0, b)) { - return !0; - } - } - } - } return !1; - }, checkApplicable: function (a, - b, c) { - b && b instanceof CKEDITOR.filter && (c = b); if (c && !c.check(this)) { - return !1; - } switch (this.type) { - case CKEDITOR.STYLE_OBJECT:return !!a.contains(this.element); case CKEDITOR.STYLE_BLOCK:return !!a.blockLimit.getDtd()[this.element]; - } return !0; - }, checkElementMatch: function (a, b) { - var c = this._.definition; - - if (!a || !c.ignoreReadonly && a.isReadOnly()) { - return !1; - } var d = a.getName(); - - if (typeof this.element === 'string' ? d == this.element : d in this.element) { - if (!b && !a.hasAttributes()) { - return !0; - } if (d = c._AC) { - c = d; - } else { - var d = {}; var e = 0; var f = c.attributes; - - if (f) { - for (var g in f) { - e++, d[g] = f[g]; - } - } if (g = CKEDITOR.style.getStyleText(c)) { - d.style || e++, d.style = g; - }d._length = e; c = c._AC = d; - } if (c._length) { - for (var h in c) { - if (h != '_length') { - if (d = a.getAttribute(h) || '', h == 'style' ? C(c[h], d) : c[h] == d) { - if (!b) { - return !0; - } - } else if (b) { - return !1; - } - } - } if (b) { - return !0; - } - } else { - return !0; - } - } return !1; - }, checkElementRemovable: function (a, b, c) { - if (this.checkElementMatch(a, b, c)) { - return !0; - } if (b = I(this)[a.getName()]) { - var d; - - if (!(b = b.attributes)) { - return !0; - } for (c = 0; c < b.length; c++) { - if (d = b[c][0], d = a.getAttribute(d)) { - var e = b[c][1]; - - if (e === null) { - return !0; - } if (typeof e === 'string') { - if (d == e) { - return !0; - } - } else if (e.test(d)) { - return !0; - } - } - } - } return !1; - }, buildPreview: function (a) { - var b = this._.definition; var c = []; var d = b.element; - - d == 'bdo' && (d = 'span'); var c = ['\x3c', d]; var e = b.attributes; - - if (e) { - for (var f in e) { - c.push(' ', f, '\x3d"', e[f], '"'); - } - }(e = CKEDITOR.style.getStyleText(b)) && c.push(' style\x3d"', e, '"'); c.push('\x3e', a || b.name, '\x3c/', d, '\x3e'); return c.join(''); - }, getDefinition: function () { - return this._.definition; - } }; CKEDITOR.style.getStyleText = function (a) { - var b = a._ST; - - if (b) { - return b; - } - var b = a.styles; var c = a.attributes && a.attributes.style || ''; var d = ''; - - c.length && (c = c.replace(r, ';')); for (var e in b) { - var f = b[e]; var g = (e + ':' + f).replace(r, ';'); - - f == 'inherit' ? d += g : c += g; - }c.length && (c = CKEDITOR.tools.normalizeCssText(c, !0)); return a._ST = c + d; - }; CKEDITOR.style.customHandlers = {}; CKEDITOR.style.addCustomHandler = function (a) { - var b = function (a) { - this._ = { definition: a }; this.setup && this.setup(a); - }; - - b.prototype = CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype), { assignedTo: CKEDITOR.STYLE_OBJECT }, - a, !0); return this.customHandlers[a.type] = b; - }; var T = CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED; var S = CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED; - })(); CKEDITOR.styleCommand = function (a, d) { - this.requiredContent = this.allowedContent = this.style = a; CKEDITOR.tools.extend(this, d, !0); - }; - CKEDITOR.styleCommand.prototype.exec = function (a) { - a.focus(); this.state == CKEDITOR.TRISTATE_OFF ? a.applyStyle(this.style) : this.state == CKEDITOR.TRISTATE_ON && a.removeStyle(this.style); - }; CKEDITOR.stylesSet = new CKEDITOR.resourceManager('', 'stylesSet'); CKEDITOR.addStylesSet = CKEDITOR.tools.bind(CKEDITOR.stylesSet.add, CKEDITOR.stylesSet); CKEDITOR.loadStylesSet = function (a, d, b) { - CKEDITOR.stylesSet.addExternal(a, d, ''); CKEDITOR.stylesSet.load(a, b); - }; - CKEDITOR.tools.extend(CKEDITOR.editor.prototype, { attachStyleStateChange: function (a, d) { - var b = this._.styleStateChangeCallbacks; - - b || (b = this._.styleStateChangeCallbacks = [], this.on('selectionChange', function (a) { - for (var d = 0; d < b.length; d++) { - var h = b[d]; var k = h.style.checkActive(a.data.path, this) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF; - - h.fn.call(this, k); - } - })); b.push({ style: a, fn: d }); - }, applyStyle: function (a) { - a.apply(this); - }, removeStyle: function (a) { - a.remove(this); - }, getStylesSet: function (a) { - if (this._.stylesDefinitions) { - a(this._.stylesDefinitions); - } else { - var d = this; var b = d.config.stylesCombo_stylesSet || d.config.stylesSet; - - if (!1 === b) { - a(null); - } else if (b instanceof Array) { - d._.stylesDefinitions = b, a(b); - } else { - b || (b = 'default'); var b = b.split(':'); var c = b[0]; - - CKEDITOR.stylesSet.addExternal(c, b[1] ? b.slice(1).join(':') : CKEDITOR.getUrl('styles.js'), ''); CKEDITOR.stylesSet.load(c, function (b) { - d._.stylesDefinitions = b[c]; a(d._.stylesDefinitions); - }); - } - } - } }); - (function () { - if (window.Promise) { - CKEDITOR.tools.promise = Promise; - } else { - var a = CKEDITOR.getUrl('vendor/promise.js'); - - if (typeof window.define === 'function' && window.define.amd && typeof window.require === 'function') { - return window.require([a], function (a) { - CKEDITOR.tools.promise = a; - }); - } CKEDITOR.scriptLoader.load(a, function (d) { - if (!d) { - return CKEDITOR.error('no-vendor-lib', { path: a }); - } if (typeof window.ES6Promise !== 'undefined') { - return CKEDITOR.tools.promise = ES6Promise; - } - }); - } - })(); - (function () { - function a(a, f, h) { - a.once('selectionCheck', function (a) { - if (!d) { - var c = a.data.getRanges()[0]; - - h.equals(c) ? a.cancel() : f.equals(c) && (b = !0); - } - }, null, null, -1); - } var d = !0; var b = !1; - - CKEDITOR.dom.selection.setupEditorOptimization = function (a) { - a.on('selectionCheck', function (a) { - a.data && !b && a.data.optimizeInElementEnds(); b = !1; - }); a.on('contentDom', function () { - var b = a.editable(); - - b && (b.attachListener(b, 'keydown', function (a) { - this._.shiftPressed = a.data.$.shiftKey; - }, this), b.attachListener(b, 'keyup', function (a) { - this._.shiftPressed = -a.data.$.shiftKey; - }, this)); - }); - }; CKEDITOR.dom.selection.prototype.optimizeInElementEnds = function () { - var b = this.getRanges()[0]; var f = this.root.editor; var h; - - if (this.root.editor._.shiftPressed || this.isFake || b.isCollapsed || b.startContainer.equals(b.endContainer)) { - h = !1; - } else if (b.endOffset === 0) { - h = !0; - } else { - h = b.startContainer.type === CKEDITOR.NODE_TEXT; var k = b.endContainer.type === CKEDITOR.NODE_TEXT; var g = h ? b.startContainer.getLength() : b.startContainer.getChildCount(); - - h = b.startOffset === g || h ^ k; - }h && (h = b.clone(), b.shrink(CKEDITOR.SHRINK_TEXT, - !1, { skipBogus: !CKEDITOR.env.webkit }), d = !1, a(f, b, h), b.select(), d = !0); - }; - })(); CKEDITOR.dom.comment = function (a, d) { - typeof a === 'string' && (a = (d ? d.$ : document).createComment(a)); CKEDITOR.dom.domObject.call(this, a); - }; CKEDITOR.dom.comment.prototype = new CKEDITOR.dom.node(); CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype, { type: CKEDITOR.NODE_COMMENT, getOuterHtml: function () { - return '\x3c!--' + this.$.nodeValue + '--\x3e'; - } }); 'use strict'; - (function () { - var a = {}; var d = {}; var b; - - for (b in CKEDITOR.dtd.$blockLimit) { - b in CKEDITOR.dtd.$list || (a[b] = 1); - } for (b in CKEDITOR.dtd.$block) { - b in CKEDITOR.dtd.$blockLimit || b in CKEDITOR.dtd.$empty || (d[b] = 1); - }CKEDITOR.dom.elementPath = function (b, f) { - var h = null; var k = null; var g = []; var l = b; var u; - - f = f || b.getDocument().getBody(); l || (l = f); do { - if (l.type == CKEDITOR.NODE_ELEMENT) { - g.push(l); if (!this.lastElement && (this.lastElement = l, l.is(CKEDITOR.dtd.$object) || l.getAttribute('contenteditable') == 'false')) { - continue; - } if (l.equals(f)) { - break; - } if (!k && (u = l.getName(), - l.getAttribute('contenteditable') == 'true' ? k = l : !h && d[u] && (h = l), a[u])) { - if (u = !h && u == 'div') { - a: { - u = l.getChildren(); for (var e = 0, x = u.count(); e < x; e++) { - var w = u.getItem(e); - - if (w.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$block[w.getName()]) { - u = !0; break a; - } - }u = !1; - }u = !u; - }u ? h = l : k = l; - } - } - } while (l = l.getParent()); k || (k = f); this.block = h; this.blockLimit = k; this.root = f; this.elements = g; - }; - })(); - CKEDITOR.dom.elementPath.prototype = { compare: function (a) { - var d = this.elements; - - a = a && a.elements; if (!a || d.length != a.length) { - return !1; - } for (var b = 0; b < d.length; b++) { - if (!d[b].equals(a[b])) { - return !1; - } - } return !0; - }, contains: function (a, d, b) { - var c = 0; var f; - - typeof a === 'string' && (f = function (b) { - return b.getName() == a; - }); a instanceof CKEDITOR.dom.element ? f = function (b) { - return b.equals(a); - } : CKEDITOR.tools.isArray(a) ? f = function (b) { - return CKEDITOR.tools.indexOf(a, b.getName()) > -1; - } : typeof a === 'function' ? f = a : typeof a === 'object' && (f = function (b) { - return b.getName() in -a; - }); var h = this.elements; var k = h.length; - - d && (b ? c += 1 : --k); b && (h = Array.prototype.slice.call(h, 0), h.reverse()); for (;c < k; c++) { - if (f(h[c])) { - return h[c]; - } - } return null; - }, isContextFor: function (a) { - var d; - - return a in CKEDITOR.dtd.$block ? (d = this.contains(CKEDITOR.dtd.$intermediate) || this.root.equals(this.block) && this.block || this.blockLimit, !!d.getDtd()[a]) : !0; - }, direction: function () { - return (this.block || this.blockLimit || this.root).getDirection(1); - } }; - CKEDITOR.dom.text = function (a, d) { - typeof a === 'string' && (a = (d ? d.$ : document).createTextNode(a)); this.$ = a; - }; CKEDITOR.dom.text.prototype = new CKEDITOR.dom.node(); - CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype, { type: CKEDITOR.NODE_TEXT, getLength: function () { - return this.$.nodeValue.length; - }, getText: function () { - return this.$.nodeValue; - }, setText: function (a) { - this.$.nodeValue = a; - }, isEmpty: function (a) { - var d = this.getText(); - - a && (d = CKEDITOR.tools.trim(d)); return !d || d === CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE; - }, split: function (a) { - var d = this.$.parentNode; var b = d.childNodes.length; var c = this.getLength(); var f = this.getDocument(); var h = new CKEDITOR.dom.text(this.$.splitText(a), f); - - d.childNodes.length == -b && (a >= c ? (h = f.createText(''), h.insertAfter(this)) : (a = f.createText(''), a.insertAfter(h), a.remove())); return h; - }, substring: function (a, d) { - return typeof d !== 'number' ? this.$.nodeValue.substr(a) : this.$.nodeValue.substring(a, d); - } }); - (function () { - function a(a, c, d) { - var h = a.serializable; var k = c[d ? 'endContainer' : 'startContainer']; var g = d ? 'endOffset' : 'startOffset'; var l = h ? c.document.getById(a.startNode) : a.startNode; - - a = h ? c.document.getById(a.endNode) : a.endNode; k.equals(l.getPrevious()) ? (c.startOffset = c.startOffset - k.getLength() - a.getPrevious().getLength(), k = a.getNext()) : k.equals(a.getPrevious()) && (c.startOffset -= k.getLength(), k = a.getNext()); k.equals(l.getParent()) && c[g]++; k.equals(a.getParent()) && c[g]++; c[d ? 'endContainer' : 'startContainer'] = k; return c; - } - CKEDITOR.dom.rangeList = function (a) { - if (a instanceof CKEDITOR.dom.rangeList) { - return a; - } a ? a instanceof CKEDITOR.dom.range && (a = [a]) : a = []; return CKEDITOR.tools.extend(a, d); - }; var d = { createIterator: function () { - var a = this; var c = CKEDITOR.dom.walker.bookmark(); var d = []; var h; - - return { getNextRange: function (k) { - h = void 0 === h ? 0 : h + 1; var g = a[h]; - - if (g && a.length > 1) { - if (!h) { - for (var l = a.length - 1; l >= 0; l--) { - d.unshift(a[l].createBookmark(!0)); - } - } if (k) { - for (var u = 0; a[h + u + 1];) { - var e = g.document; - - k = 0; l = e.getById(d[u].endNode); for (e = e.getById(d[u + 1].startNode); ;) { - l = -l.getNextSourceNode(!1); if (e.equals(l)) { - k = 1; - } else if (c(l) || l.type == CKEDITOR.NODE_ELEMENT && l.isBlockBoundary()) { - continue; - } break; - } if (!k) { - break; - } u++; - } - } for (g.moveToBookmark(d.shift()); u--;) { - l = a[++h], l.moveToBookmark(d.shift()), g.setEnd(l.endContainer, l.endOffset); - } - } return g; - } }; - }, createBookmarks: function (b) { - for (var c = [], d, h = 0; h < this.length; h++) { - c.push(d = this[h].createBookmark(b, !0)); for (var k = h + 1; k < this.length; k++) { - this[k] = a(d, this[k]), this[k] = a(d, this[k], !0); - } - } return c; - }, createBookmarks2: function (a) { - for (var c = [], d = 0; d < -this.length; d++) { - c.push(this[d].createBookmark2(a)); - } return c; - }, moveToBookmarks: function (a) { - for (var c = 0; c < this.length; c++) { - this[c].moveToBookmark(a[c]); - } - } }; - })(); - (function () { - function a() { - return CKEDITOR.getUrl(CKEDITOR.skinName.split(',')[1] || 'skins/' + CKEDITOR.skinName.split(',')[0] + '/'); - } function d(b) { - var c = CKEDITOR.skin['ua_' + b]; var d = CKEDITOR.env; - - if (c) { - for (var c = c.split(',').sort(function (a, b) { - return a > b ? -1 : 1; - }), f = 0, g; f < c.length; f++) { - if (g = c[f], d.ie && (g.replace(/^ie/, '') == d.version || d.quirks && g == 'iequirks') && (g = 'ie'), d[g]) { - b += '_' + c[f]; break; - } - } - } return CKEDITOR.getUrl(a() + b + '.css'); - } function b(a, b) { - h[a] || (CKEDITOR.document.appendStyleSheet(d(a)), h[a] = 1); b && b(); - } function c(a) { - var b = -a.getById(k); - - b || (b = a.getHead().append('style'), b.setAttribute('id', k), b.setAttribute('type', 'text/css')); return b; - } function f(a, b, c) { - var d; var f; var g; - - if (CKEDITOR.env.webkit) { - for (b = b.split('}').slice(0, -1), f = 0; f < b.length; f++) { - b[f] = b[f].split('{'); - } - } for (var h = 0; h < a.length; h++) { - if (CKEDITOR.env.webkit) { - for (f = 0; f < b.length; f++) { - g = b[f][1]; for (d = 0; d < c.length; d++) { - g = g.replace(c[d][0], c[d][1]); - }a[h].$.sheet.addRule(b[f][0], g); - } - } else { - g = b; for (d = 0; d < c.length; d++) { - g = g.replace(c[d][0], c[d][1]); - }CKEDITOR.env.ie && CKEDITOR.env.version < 11 ? - a[h].$.styleSheet.cssText += g : a[h].$.innerHTML += g; - } - } - } var h = {}; - - CKEDITOR.skin = { path: a, loadPart: function (c, d) { - CKEDITOR.skin.name != CKEDITOR.skinName.split(',')[0] ? CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a() + 'skin.js'), function () { - b(c, d); - }) : b(c, d); - }, getPath: function (a) { - return CKEDITOR.getUrl(d(a)); - }, icons: {}, addIcon: function (a, b, c, d) { - a = a.toLowerCase(); this.icons[a] || (this.icons[a] = { path: b, offset: c || 0, bgsize: d || '16px' }); - }, getIconStyle: function (a, b, c, d, f) { - var g; - - a && (a = a.toLowerCase(), b && (g = this.icons[a + '-rtl']), - g || (g = this.icons[a])); a = c || g && g.path || ''; d = d || g && g.offset; f = f || g && g.bgsize || '16px'; a && (a = a.replace(/'/g, "\\'")); return a && "background-image:url('" + CKEDITOR.getUrl(a) + "');background-position:0 " + d + 'px;background-size:' + f + ';'; - } }; CKEDITOR.tools.extend(CKEDITOR.editor.prototype, { getUiColor: function () { - return this.uiColor; - }, setUiColor: function (a) { - var b = c(CKEDITOR.document); - - return (this.setUiColor = function (a) { - this.uiColor = a; var c = CKEDITOR.skin.chameleon; var d = ''; var h = ''; - - typeof c === 'function' && (d = c(this, 'editor'), h = -c(this, 'panel')); a = [[l, a]]; f([b], d, a); f(g, h, a); - }).call(this, a); - } }); var k = 'cke_ui_color'; var g = []; var l = /\$color/g; - - CKEDITOR.on('instanceLoaded', function (a) { - if (!CKEDITOR.env.ie || !CKEDITOR.env.quirks) { - var b = a.editor; - - a = function (a) { - a = (a.data[0] || a.data).element.getElementsByTag('iframe').getItem(0).getFrameDocument(); if (!a.getById('cke_ui_color')) { - var d = c(a); - - g.push(d); b.on('destroy', function () { - g = CKEDITOR.tools.array.filter(g, function (a) { - return d !== a; - }); - }); (a = b.getUiColor()) && f([d], CKEDITOR.skin.chameleon(b, 'panel'), - [[l, a]]); - } - }; b.on('panelShow', a); b.on('menuShow', a); b.config.uiColor && b.setUiColor(b.config.uiColor); - } - }); - })(); - (function () { - if (CKEDITOR.env.webkit) { - CKEDITOR.env.hc = !1; - } else { - var a = CKEDITOR.dom.element.createFromHtml('\x3cdiv style\x3d"width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"\x3e\x3c/div\x3e', CKEDITOR.document); - - a.appendTo(CKEDITOR.document.getHead()); try { - var d = a.getComputedStyle('border-top-color'); var b = a.getComputedStyle('border-right-color'); - - CKEDITOR.env.hc = !(!d || d != b); - } catch (c) { - CKEDITOR.env.hc = !1; - }a.remove(); - }CKEDITOR.env.hc && (CKEDITOR.env.cssClass += ' cke_hc'); CKEDITOR.document.appendStyleText('.cke{visibility:hidden;}'); - CKEDITOR.status = 'loaded'; CKEDITOR.fireOnce('loaded'); if (a = CKEDITOR._.pending) { - for (delete CKEDITOR._.pending, d = 0; d < a.length; d++) { - CKEDITOR.editor.prototype.constructor.apply(a[d][0], a[d][1]), CKEDITOR.add(a[d][0]); - } - } - })();/* - Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. - For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license -*/ - CKEDITOR.skin.name = 'moono-lisa'; CKEDITOR.skin.ua_editor = 'ie,iequirks,ie8,gecko'; CKEDITOR.skin.ua_dialog = 'ie,iequirks,ie8'; - CKEDITOR.skin.chameleon = (function () { - var b = (function () { - return function (b, d) { - for (var a = b.match(/[^#]./g), e = 0; e < 3; e++) { - var f = e; var c; - - c = parseInt(a[e], 16); c = ('0' + (d < 0 ? 0 | c * (1 + d) : 0 | c + (255 - c) * d).toString(16)).slice(-2); a[f] = c; - } return '#' + a.join(''); - }; - })(); var f = { editor: new CKEDITOR.template('{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ background-color:{defaultBackground};border-bottom-color:{defaultBorder};] {id} .cke_bottom [background-color:{defaultBackground};border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [background-color:{defaultBackground};border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [background-color:{defaultBackground};outline-color:{defaultBorder};] {id} .cke_dialog_tab [background-color:{dialogTab};border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [background-color:{lightBackground};] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} a.cke_button_off:hover,{id} a.cke_button_off:focus,{id} a.cke_button_off:active [background-color:{darkBackground};border-color:{toolbarElementsBorder};] {id} .cke_button_on [background-color:{ckeButtonOn};border-color:{toolbarElementsBorder};] {id} .cke_toolbar_separator,{id} .cke_toolgroup a.cke_button:last-child:after,{id} .cke_toolgroup a.cke_button.cke_button_disabled:hover:last-child:after [background-color: {toolbarElementsBorder};border-color: {toolbarElementsBorder};] {id} a.cke_combo_button:hover,{id} a.cke_combo_button:focus,{id} .cke_combo_on a.cke_combo_button [border-color:{toolbarElementsBorder};background-color:{darkBackground};] {id} .cke_combo:after [border-color:{toolbarElementsBorder};] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover,{id} a.cke_path_item:focus,{id} a.cke_path_item:active [background-color:{darkBackground};] {id}.cke_panel [border-color:{defaultBorder};] '), panel: new CKEDITOR.template('.cke_panel_grouptitle [background-color:{lightBackground};border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover,.cke_menubutton:focus,.cke_menubutton:active [background-color:{menubuttonHover};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menubutton_disabled:hover .cke_menubutton_icon,.cke_menubutton_disabled:focus .cke_menubutton_icon,.cke_menubutton_disabled:active .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ') }; - - return function (g, d) { - var a = b(g.uiColor, 0.4); var a = { id: '.' + g.id, defaultBorder: b(a, -0.2), toolbarElementsBorder: b(a, -0.25), defaultBackground: a, lightBackground: b(a, 0.8), darkBackground: b(a, -0.15), ckeButtonOn: b(a, 0.4), ckeResizer: b(a, -0.4), ckeColorauto: b(a, 0.8), dialogBody: b(a, 0.7), dialogTab: b(a, 0.65), dialogTabSelected: '#FFF', dialogTabSelectedBorder: '#FFF', elementsPathColor: b(a, -0.6), menubuttonHover: b(a, 0.1), menubuttonIcon: b(a, 0.5), menubuttonIconHover: b(a, 0.3) }; - - return f[d].output(a).replace(/\[/g, '{').replace(/\]/g, '}'); - }; - })(); CKEDITOR.plugins.add('dialogui', { onLoad: function () { - var h = function (b) { - this._ || (this._ = {}); this._.default = this._.initValue = b.default || ''; this._.required = b.required || !1; for (var a = [this._], d = 1; d < arguments.length; d++) { - a.push(arguments[d]); - }a.push(!0); CKEDITOR.tools.extend.apply(CKEDITOR.tools, a); return this._; - }; var r = { build: function (b, a, d) { - return new CKEDITOR.ui.dialog.textInput(b, a, d); - } }; var n = { build: function (b, a, d) { - return new CKEDITOR.ui.dialog[a.type](b, a, d); - } }; var q = { isChanged: function () { - return this.getValue() != -this.getInitValue(); - }, reset: function (b) { - this.setValue(this.getInitValue(), b); - }, setInitValue: function () { - this._.initValue = this.getValue(); - }, resetInitValue: function () { - this._.initValue = this._.default; - }, getInitValue: function () { - return this._.initValue; - } }; var v = CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, { onChange: function (b, a) { - this._.domOnChangeRegistered || (b.on('load', function () { - this.getInputElement().on('change', function () { - b.parts.dialog.isVisible() && this.fire('change', { value: this.getValue() }); - }, - this); - }, this), this._.domOnChangeRegistered = !0); this.on('change', a); - } }, !0); var x = /^on([A-Z]\w+)/; var t = function (b) { - for (var a in b) { - (x.test(a) || a == 'title' || a == 'type') && delete b[a]; - } return b; - }; var w = function (b) { - b = b.data.getKeystroke(); b == CKEDITOR.SHIFT + CKEDITOR.ALT + 36 ? this.setDirectionMarker('ltr') : b == CKEDITOR.SHIFT + CKEDITOR.ALT + 35 && this.setDirectionMarker('rtl'); - }; - - CKEDITOR.tools.extend(CKEDITOR.ui.dialog, { labeledElement: function (b, a, d, f) { - if (!(arguments.length < 4)) { - var c = h.call(this, a); - - c.labelId = CKEDITOR.tools.getNextId() + -'_label'; this._.children = []; var e = { role: a.role || 'presentation' }; - - a.includeLabel && (e['aria-labelledby'] = c.labelId); CKEDITOR.ui.dialog.uiElement.call(this, b, a, d, 'div', null, e, function () { - var e = []; var g = a.required ? ' cke_required' : ''; - - a.labelLayout != 'horizontal' ? e.push('\x3clabel class\x3d"cke_dialog_ui_labeled_label' + g + '" ', ' id\x3d"' + c.labelId + '"', c.inputId ? ' for\x3d"' + c.inputId + '"' : '', (a.labelStyle ? ' style\x3d"' + a.labelStyle + '"' : '') + '\x3e', a.label, '\x3c/label\x3e', '\x3cdiv class\x3d"cke_dialog_ui_labeled_content"', - a.controlStyle ? ' style\x3d"' + a.controlStyle + '"' : '', ' role\x3d"presentation"\x3e', f.call(this, b, a), '\x3c/div\x3e') : (g = { type: 'hbox', widths: a.widths, padding: 0, children: [{ type: 'html', html: '\x3clabel class\x3d"cke_dialog_ui_labeled_label' + g + '" id\x3d"' + c.labelId + '" for\x3d"' + c.inputId + '"' + (a.labelStyle ? ' style\x3d"' + a.labelStyle + '"' : '') + '\x3e' + CKEDITOR.tools.htmlEncode(a.label) + '\x3c/label\x3e' }, { type: 'html', html: '\x3cspan class\x3d"cke_dialog_ui_labeled_content"' + (a.controlStyle ? ' style\x3d"' + a.controlStyle + -'"' : '') + '\x3e' + f.call(this, b, a) + '\x3c/span\x3e' }] }, CKEDITOR.dialog._.uiElementBuilders.hbox.build(b, g, e)); return e.join(''); - }); - } - }, textInput: function (b, a, d) { - if (!(arguments.length < 3)) { - h.call(this, a); var f = this._.inputId = CKEDITOR.tools.getNextId() + '_textInput'; var c = { class: 'cke_dialog_ui_input_' + a.type, id: f, type: a.type }; - - a.validate && (this.validate = a.validate); a.maxLength && (c.maxlength = a.maxLength); a.size && (c.size = a.size); a.inputStyle && (c.style = a.inputStyle); var e = this; var m = !1; - - b.on('load', function () { - e.getInputElement().on('keydown', - function (a) { - a.data.getKeystroke() == 13 && (m = !0); - }); e.getInputElement().on('keyup', function (a) { - a.data.getKeystroke() == 13 && m && (b.getButton('ok') && setTimeout(function () { - b.getButton('ok').click(); - }, 0), m = !1); e.bidi && w.call(e, a); - }, null, null, 1E3); - }); CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function () { - var b = ['\x3cdiv class\x3d"cke_dialog_ui_input_', a.type, '" role\x3d"presentation"']; - - a.width && b.push('style\x3d"width:' + a.width + '" '); b.push('\x3e\x3cinput '); c['aria-labelledby'] = this._.labelId; this._.required && -(c['aria-required'] = this._.required); for (var e in c) { - b.push(e + '\x3d"' + c[e] + '" '); - }b.push(' /\x3e\x3c/div\x3e'); return b.join(''); - }); - } - }, textarea: function (b, a, d) { - if (!(arguments.length < 3)) { - h.call(this, a); var f = this; var c = this._.inputId = CKEDITOR.tools.getNextId() + '_textarea'; var e = {}; - - a.validate && (this.validate = a.validate); e.rows = a.rows || 5; e.cols = a.cols || 20; e.class = 'cke_dialog_ui_input_textarea ' + (a.class || ''); typeof a.inputStyle !== 'undefined' && (e.style = a.inputStyle); a.dir && (e.dir = a.dir); if (f.bidi) { - b.on('load', - function () { - f.getInputElement().on('keyup', w); - }, f); - }CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function () { - e['aria-labelledby'] = this._.labelId; this._.required && (e['aria-required'] = this._.required); var a = ['\x3cdiv class\x3d"cke_dialog_ui_input_textarea" role\x3d"presentation"\x3e\x3ctextarea id\x3d"', c, '" ']; var b; - - for (b in e) { - a.push(b + '\x3d"' + CKEDITOR.tools.htmlEncode(e[b]) + '" '); - }a.push('\x3e', CKEDITOR.tools.htmlEncode(f._.default), '\x3c/textarea\x3e\x3c/div\x3e'); return a.join(''); - }); - } - }, checkbox: function (b, - a, d) { - if (!(arguments.length < 3)) { - var f = h.call(this, a, { default: !!a.default }); - - a.validate && (this.validate = a.validate); CKEDITOR.ui.dialog.uiElement.call(this, b, a, d, 'span', null, null, function () { - var c = CKEDITOR.tools.extend({}, a, { id: a.id ? a.id + '_checkbox' : CKEDITOR.tools.getNextId() + '_checkbox' }, !0); var e = []; var d = CKEDITOR.tools.getNextId() + '_label'; var g = { 'class': 'cke_dialog_ui_checkbox_input', 'type': 'checkbox', 'aria-labelledby': d }; - - t(c); a.default && (g.checked = 'checked'); typeof c.inputStyle !== 'undefined' && (c.style = c.inputStyle); - f.checkbox = new CKEDITOR.ui.dialog.uiElement(b, c, e, 'input', null, g); e.push(' \x3clabel id\x3d"', d, '" for\x3d"', g.id, '"' + (a.labelStyle ? ' style\x3d"' + a.labelStyle + '"' : '') + '\x3e', CKEDITOR.tools.htmlEncode(a.label), '\x3c/label\x3e'); return e.join(''); - }); - } - }, radio: function (b, a, d) { - if (!(arguments.length < 3)) { - h.call(this, a); this._.default || (this._.default = this._.initValue = a.items[0][1]); a.validate && (this.validate = a.validate); var f = []; var c = this; - - a.role = 'radiogroup'; a.includeLabel = !0; CKEDITOR.ui.dialog.labeledElement.call(this, - b, a, d, function () { - for (var e = [], d = [], g = (a.id ? a.id : CKEDITOR.tools.getNextId()) + '_radio', k = 0; k < a.items.length; k++) { - var l = a.items[k]; var h = void 0 !== l[2] ? l[2] : l[0]; var n = void 0 !== l[1] ? l[1] : l[0]; var p = CKEDITOR.tools.getNextId() + '_radio_input'; var q = p + '_label'; var p = CKEDITOR.tools.extend({}, a, { id: p, title: null, type: null }, !0); var h = CKEDITOR.tools.extend({}, p, { title: h }, !0); var r = { 'type': 'radio', 'class': 'cke_dialog_ui_radio_input', 'name': g, 'value': n, 'aria-labelledby': q }; var u = []; - - c._.default == n && (r.checked = 'checked'); t(p); t(h); typeof p.inputStyle !== 'undefined' && -(p.style = p.inputStyle); p.keyboardFocusable = !0; f.push(new CKEDITOR.ui.dialog.uiElement(b, p, u, 'input', null, r)); u.push(' '); new CKEDITOR.ui.dialog.uiElement(b, h, u, 'label', null, { id: q, for: r.id }, l[0]); e.push(u.join('')); - } new CKEDITOR.ui.dialog.hbox(b, f, e, d); return d.join(''); - }); this._.children = f; - } - }, button: function (b, a, d) { - if (arguments.length) { - typeof a === 'function' && (a = a(b.getParentEditor())); h.call(this, a, { disabled: a.disabled || !1 }); CKEDITOR.event.implementOn(this); var f = this; - - b.on('load', function () { - var a = this.getElement(); - - (function () { - a.on('click', function (a) { - f.click(); a.data.preventDefault(); - }); a.on('keydown', function (a) { - a.data.getKeystroke() in { 32: 1 } && (f.click(), a.data.preventDefault()); - }); - })(); a.unselectable(); - }, this); var c = CKEDITOR.tools.extend({}, a); - - delete c.style; var e = CKEDITOR.tools.getNextId() + '_label'; - - CKEDITOR.ui.dialog.uiElement.call(this, b, c, d, 'a', null, { 'style': a.style, 'href': 'javascript:void(0)', 'title': a.label, 'hidefocus': 'true', 'class': a.class, 'role': 'button', 'aria-labelledby': e }, '\x3cspan id\x3d"' + e + '" class\x3d"cke_dialog_ui_button"\x3e' + -CKEDITOR.tools.htmlEncode(a.label) + '\x3c/span\x3e'); - } - }, select: function (b, a, d) { - if (!(arguments.length < 3)) { - var f = h.call(this, a); - - a.validate && (this.validate = a.validate); f.inputId = CKEDITOR.tools.getNextId() + '_select'; CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function () { - var c = CKEDITOR.tools.extend({}, a, { id: a.id ? a.id + '_select' : CKEDITOR.tools.getNextId() + '_select' }, !0); var e = []; var d = []; var g = { 'id': f.inputId, 'class': 'cke_dialog_ui_input_select', 'aria-labelledby': this._.labelId }; - - e.push('\x3cdiv class\x3d"cke_dialog_ui_input_', - a.type, '" role\x3d"presentation"'); a.width && e.push('style\x3d"width:' + a.width + '" '); e.push('\x3e'); void 0 !== a.size && (g.size = a.size); void 0 !== a.multiple && (g.multiple = a.multiple); t(c); for (var k = 0, l; k < a.items.length && (l = a.items[k]); k++) { - d.push('\x3coption value\x3d"', CKEDITOR.tools.htmlEncode(void 0 !== l[1] ? l[1] : l[0]).replace(/"/g, '\x26quot;'), '" /\x3e ', CKEDITOR.tools.htmlEncode(l[0])); - } typeof c.inputStyle !== 'undefined' && (c.style = c.inputStyle); f.select = new CKEDITOR.ui.dialog.uiElement(b, c, e, 'select', null, - g, d.join('')); e.push('\x3c/div\x3e'); return e.join(''); - }); - } - }, file: function (b, a, d) { - if (!(arguments.length < 3)) { - void 0 === a.default && (a.default = ''); var f = CKEDITOR.tools.extend(h.call(this, a), { definition: a, buttons: [] }); - - a.validate && (this.validate = a.validate); b.on('load', function () { - CKEDITOR.document.getById(f.frameId).getParent().addClass('cke_dialog_ui_input_file'); - }); CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function () { - f.frameId = CKEDITOR.tools.getNextId() + '_fileInput'; var b = ['\x3ciframe frameborder\x3d"0" allowtransparency\x3d"0" class\x3d"cke_dialog_ui_input_file" role\x3d"presentation" id\x3d"', - f.frameId, '" title\x3d"', a.label, '" src\x3d"javascript:void(']; - - b.push(CKEDITOR.env.ie ? '(function(){' + encodeURIComponent('document.open();(' + CKEDITOR.tools.fixDomain + ')();document.close();') + '})()' : '0'); b.push(')"\x3e\x3c/iframe\x3e'); return b.join(''); - }); - } - }, fileButton: function (b, a, d) { - var f = this; - - if (!(arguments.length < 3)) { - h.call(this, a); a.validate && (this.validate = a.validate); var c = CKEDITOR.tools.extend({}, a); var e = c.onClick; - - c.className = (c.className ? c.className + ' ' : '') + 'cke_dialog_ui_button'; c.onClick = function (c) { - var d = -a.for; - - c = e ? e.call(this, c) : !1; !1 !== c && (c !== 'xhr' && b.getContentElement(d[0], d[1]).submit(), this.disable()); - }; b.on('load', function () { - b.getContentElement(a.for[0], a.for[1])._.buttons.push(f); - }); CKEDITOR.ui.dialog.button.call(this, b, c, d); - } - }, html: (function () { - var b = /^\s*<[\w:]+\s+([^>]*)?>/; var a = /^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/; var d = /\/$/; - - return function (f, c, e) { - if (!(arguments.length < 3)) { - var m = []; var g = c.html; - - g.charAt(0) != '\x3c' && (g = '\x3cspan\x3e' + g + '\x3c/span\x3e'); var k = c.focus; - - if (k) { - var l = this.focus; - - this.focus = function () { - (typeof k === 'function' ? k : l).call(this); this.fire('focus'); - }; c.isFocusable && (this.isFocusable = this.isFocusable); this.keyboardFocusable = !0; - }CKEDITOR.ui.dialog.uiElement.call(this, f, c, m, 'span', null, null, ''); m = m.join('').match(b); g = g.match(a) || ['', '', '']; d.test(g[1]) && (g[1] = g[1].slice(0, -1), g[2] = '/' + g[2]); e.push([g[1], ' ', m[1] || '', g[2]].join('')); - } - }; - })(), fieldset: function (b, a, d, f, c) { - var e = c.label; - - this._ = { children: a }; CKEDITOR.ui.dialog.uiElement.call(this, b, c, f, 'fieldset', null, null, function () { - var a = -[]; - - e && a.push('\x3clegend' + (c.labelStyle ? ' style\x3d"' + c.labelStyle + '"' : '') + '\x3e' + e + '\x3c/legend\x3e'); for (var b = 0; b < d.length; b++) { - a.push(d[b]); - } return a.join(''); - }); - } }, !0); CKEDITOR.ui.dialog.html.prototype = new CKEDITOR.ui.dialog.uiElement(); CKEDITOR.ui.dialog.labeledElement.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement(), { setLabel: function (b) { - var a = CKEDITOR.document.getById(this._.labelId); - - a.getChildCount() < 1 ? new CKEDITOR.dom.text(b, CKEDITOR.document).appendTo(a) : a.getChild(0).$.nodeValue = -b; return this; - }, getLabel: function () { - var b = CKEDITOR.document.getById(this._.labelId); - - return !b || b.getChildCount() < 1 ? '' : b.getChild(0).getText(); - }, eventProcessors: v }, !0); CKEDITOR.ui.dialog.button.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement(), { click: function () { - return this._.disabled ? !1 : this.fire('click', { dialog: this._.dialog }); - }, enable: function () { - this._.disabled = !1; var b = this.getElement(); - - b && b.removeClass('cke_disabled'); - }, disable: function () { - this._.disabled = !0; this.getElement().addClass('cke_disabled'); - }, - isVisible: function () { - return this.getElement().getFirst().isVisible(); - }, isEnabled: function () { - return !this._.disabled; - }, eventProcessors: CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, { onClick: function (b, a) { - this.on('click', function () { - a.apply(this, arguments); - }); - } }, !0), accessKeyUp: function () { - this.click(); - }, accessKeyDown: function () { - this.focus(); - }, keyboardFocusable: !0 }, !0); CKEDITOR.ui.dialog.textInput.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement(), { getInputElement: function () { - return CKEDITOR.document.getById(this._.inputId); - }, - focus: function () { - var b = this.selectParentTab(); - - setTimeout(function () { - var a = b.getInputElement(); - - a && a.$.focus(); - }, 0); - }, select: function () { - var b = this.selectParentTab(); - - setTimeout(function () { - var a = b.getInputElement(); - - a && (a.$.focus(), a.$.select()); - }, 0); - }, accessKeyUp: function () { - this.select(); - }, setValue: function (b) { - if (this.bidi) { - var a = b && b.charAt(0); - - (a = a == '‪' ? 'ltr' : a == '‫' ? 'rtl' : null) && (b = b.slice(1)); this.setDirectionMarker(a); - }b || (b = ''); return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this, arguments); - }, - getValue: function () { - var b = CKEDITOR.ui.dialog.uiElement.prototype.getValue.call(this); - - if (this.bidi && b) { - var a = this.getDirectionMarker(); - - a && (b = (a == 'ltr' ? '‪' : '‫') + b); - } return b; - }, setDirectionMarker: function (b) { - var a = this.getInputElement(); - - b ? a.setAttributes({ 'dir': b, 'data-cke-dir-marker': b }) : this.getDirectionMarker() && a.removeAttributes(['dir', 'data-cke-dir-marker']); - }, getDirectionMarker: function () { - return this.getInputElement().data('cke-dir-marker'); - }, keyboardFocusable: !0 }, q, !0); CKEDITOR.ui.dialog.textarea.prototype = -new CKEDITOR.ui.dialog.textInput(); CKEDITOR.ui.dialog.select.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement(), { getInputElement: function () { - return this._.select.getElement(); - }, add: function (b, a, d) { - var f = new CKEDITOR.dom.element('option', this.getDialog().getParentEditor().document); var c = this.getInputElement().$; - - f.$.text = b; f.$.value = void 0 === a || a === null ? b : a; void 0 === d || d === null ? CKEDITOR.env.ie ? c.add(f.$) : c.add(f.$, null) : c.add(f.$, d); return this; - }, remove: function (b) { - this.getInputElement().$.remove(b); - return this; - }, clear: function () { - for (var b = this.getInputElement().$; b.length > 0;) { - b.remove(0); - } return this; - }, keyboardFocusable: !0 }, q, !0); CKEDITOR.ui.dialog.checkbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement(), { getInputElement: function () { - return this._.checkbox.getElement(); - }, setValue: function (b, a) { - this.getInputElement().$.checked = b; !a && this.fire('change', { value: b }); - }, getValue: function () { - return this.getInputElement().$.checked; - }, accessKeyUp: function () { - this.setValue(!this.getValue()); - }, eventProcessors: { onChange: function (b, - a) { - if (!CKEDITOR.env.ie || CKEDITOR.env.version > 8) { - return v.onChange.apply(this, arguments); - } b.on('load', function () { - var a = this._.checkbox.getElement(); - - a.on('propertychange', function (b) { - b = b.data.$; b.propertyName == 'checked' && this.fire('change', { value: a.$.checked }); - }, this); - }, this); this.on('change', a); return null; - } }, keyboardFocusable: !0 }, q, !0); CKEDITOR.ui.dialog.radio.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement(), { setValue: function (b, a) { - for (var d = this._.children, f, c = 0; c < d.length && (f = d[c]); c++) { - f.getElement().$.checked = -f.getValue() == b; - }!a && this.fire('change', { value: b }); - }, getValue: function () { - for (var b = this._.children, a = 0; a < b.length; a++) { - if (b[a].getElement().$.checked) { - return b[a].getValue(); - } - } return null; - }, accessKeyUp: function () { - var b = this._.children; var a; - - for (a = 0; a < b.length; a++) { - if (b[a].getElement().$.checked) { - b[a].getElement().focus(); return; - } - }b[0].getElement().focus(); - }, eventProcessors: { onChange: function (b, a) { - if (!CKEDITOR.env.ie || CKEDITOR.env.version > 8) { - return v.onChange.apply(this, arguments); - } b.on('load', function () { - for (var a = -this._.children, b = this, c = 0; c < a.length; c++) { - a[c].getElement().on('propertychange', function (a) { - a = a.data.$; a.propertyName == 'checked' && this.$.checked && b.fire('change', { value: this.getAttribute('value') }); - }); - } - }, this); this.on('change', a); return null; - } } }, q, !0); CKEDITOR.ui.dialog.file.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement(), q, { getInputElement: function () { - var b = CKEDITOR.document.getById(this._.frameId).getFrameDocument(); - - return b.$.forms.length > 0 ? new CKEDITOR.dom.element(b.$.forms[0].elements[0]) : - this.getElement(); - }, submit: function () { - this.getInputElement().getParent().$.submit(); return this; - }, getAction: function () { - return this.getInputElement().getParent().$.action; - }, registerEvents: function (b) { - var a = /^on([A-Z]\w+)/; var d; var f = function (a, b, c, d) { - a.on('formLoaded', function () { - a.getInputElement().on(c, d, a); - }); - }; var c; - - for (c in b) { - if (d = c.match(a)) { - this.eventProcessors[c] ? this.eventProcessors[c].call(this, this._.dialog, b[c]) : f(this, this._.dialog, d[1].toLowerCase(), b[c]); - } - } return this; - }, reset: function () { - function b() { - d.$.open(); - var b = ''; - - f.size && (b = f.size - (CKEDITOR.env.ie ? 7 : 0)); var h = a.frameId + '_input'; - - d.$.write(['\x3chtml dir\x3d"' + g + '" lang\x3d"' + k + '"\x3e\x3chead\x3e\x3ctitle\x3e\x3c/title\x3e\x3c/head\x3e\x3cbody style\x3d"margin: 0; overflow: hidden; background: transparent;"\x3e', '\x3cform enctype\x3d"multipart/form-data" method\x3d"POST" dir\x3d"' + g + '" lang\x3d"' + k + '" action\x3d"', CKEDITOR.tools.htmlEncode(f.action), '"\x3e\x3clabel id\x3d"', a.labelId, '" for\x3d"', h, '" style\x3d"display:none"\x3e', CKEDITOR.tools.htmlEncode(f.label), - '\x3c/label\x3e\x3cinput style\x3d"width:100%" id\x3d"', h, '" aria-labelledby\x3d"', a.labelId, '" type\x3d"file" name\x3d"', CKEDITOR.tools.htmlEncode(f.id || 'cke_upload'), '" size\x3d"', CKEDITOR.tools.htmlEncode(b > 0 ? b : ''), '" /\x3e\x3c/form\x3e\x3c/body\x3e\x3c/html\x3e\x3cscript\x3e', CKEDITOR.env.ie ? '(' + CKEDITOR.tools.fixDomain + ')();' : '', 'window.parent.CKEDITOR.tools.callFunction(' + e + ');', 'window.onbeforeunload \x3d function() {window.parent.CKEDITOR.tools.callFunction(' + m + ')}', '\x3c/script\x3e'].join('')); - d.$.close(); for (b = 0; b < c.length; b++) { - c[b].enable(); - } - } var a = this._; var d = CKEDITOR.document.getById(a.frameId).getFrameDocument(); var f = a.definition; var c = a.buttons; var e = this.formLoadedNumber; var m = this.formUnloadNumber; var g = a.dialog._.editor.lang.dir; var k = a.dialog._.editor.langCode; - - e || (e = this.formLoadedNumber = CKEDITOR.tools.addFunction(function () { - this.fire('formLoaded'); - }, this), m = this.formUnloadNumber = CKEDITOR.tools.addFunction(function () { - this.getInputElement().clearCustomData(); - }, this), this.getDialog()._.editor.on('destroy', function () { - CKEDITOR.tools.removeFunction(e); - CKEDITOR.tools.removeFunction(m); - })); CKEDITOR.env.gecko ? setTimeout(b, 500) : b(); - }, getValue: function () { - return this.getInputElement().$.value || ''; - }, setInitValue: function () { - this._.initValue = ''; - }, eventProcessors: { onChange: function (b, a) { - this._.domOnChangeRegistered || (this.on('formLoaded', function () { - this.getInputElement().on('change', function () { - this.fire('change', { value: this.getValue() }); - }, this); - }, this), this._.domOnChangeRegistered = !0); this.on('change', a); - } }, keyboardFocusable: !0 }, !0); CKEDITOR.ui.dialog.fileButton.prototype = -new CKEDITOR.ui.dialog.button(); CKEDITOR.ui.dialog.fieldset.prototype = CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype); CKEDITOR.dialog.addUIElement('text', r); CKEDITOR.dialog.addUIElement('password', r); CKEDITOR.dialog.addUIElement('tel', r); CKEDITOR.dialog.addUIElement('textarea', n); CKEDITOR.dialog.addUIElement('checkbox', n); CKEDITOR.dialog.addUIElement('radio', n); CKEDITOR.dialog.addUIElement('button', n); CKEDITOR.dialog.addUIElement('select', n); CKEDITOR.dialog.addUIElement('file', n); CKEDITOR.dialog.addUIElement('fileButton', - n); CKEDITOR.dialog.addUIElement('html', n); CKEDITOR.dialog.addUIElement('fieldset', { build: function (b, a, d) { - for (var f = a.children, c, e = [], h = [], g = 0; g < f.length && (c = f[g]); g++) { - var k = []; - - e.push(k); h.push(CKEDITOR.dialog._.uiElementBuilders[c.type].build(b, c, k)); - } return new CKEDITOR.ui.dialog[a.type](b, h, e, d, a); - } }); - } }); CKEDITOR.DIALOG_RESIZE_NONE = 0; CKEDITOR.DIALOG_RESIZE_WIDTH = 1; CKEDITOR.DIALOG_RESIZE_HEIGHT = 2; CKEDITOR.DIALOG_RESIZE_BOTH = 3; CKEDITOR.DIALOG_STATE_IDLE = 1; CKEDITOR.DIALOG_STATE_BUSY = 2; - (function () { - function z(a) { - a._.tabBarMode = !0; a._.tabs[a._.currentTabId][0].focus(); a._.currentFocusIndex = -1; - } function A() { - for (var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId) + a, c = b - 1; c > b - a; c--) { - if (this._.tabs[this._.tabIdList[c % a]][0].$.offsetHeight) { - return this._.tabIdList[c % a]; - } - } return null; - } function V() { - for (var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId), c = b + 1; c < b + a; c++) { - if (this._.tabs[this._.tabIdList[c % a]][0].$.offsetHeight) { - return this._.tabIdList[c % -a]; - } - } return null; - } function K(a, b) { - for (var c = a.$.getElementsByTagName('input'), e = 0, d = c.length; e < d; e++) { - var f = new CKEDITOR.dom.element(c[e]); - - f.getAttribute('type').toLowerCase() == 'text' && (b ? (f.setAttribute('value', f.getCustomData('fake_value') || ''), f.removeCustomData('fake_value')) : (f.setCustomData('fake_value', f.getAttribute('value')), f.setAttribute('value', ''))); - } - } function W(a, b) { - var c = this.getInputElement(); - - c && (a ? c.removeAttribute('aria-invalid') : c.setAttribute('aria-invalid', !0)); a || (this.select ? this.select() : - this.focus()); b && alert(b); this.fire('validated', { valid: a, msg: b }); - } function X() { - var a = this.getInputElement(); - - a && a.removeAttribute('aria-invalid'); - } function Y(a) { - var b = CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate('dialog', Z).output({ id: CKEDITOR.tools.getNextNumber(), editorId: a.id, langDir: a.lang.dir, langCode: a.langCode, editorDialogClass: 'cke_editor_' + a.name.replace(/\./g, '\\.') + '_dialog', closeTitle: a.lang.common.close, hidpi: CKEDITOR.env.hidpi ? 'cke_hidpi' : '' })); var c = b.getChild([0, 0, 0, 0, 0]); var e = c.getChild(0); - var d = c.getChild(1); - - a.plugins.clipboard && CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(c); !CKEDITOR.env.ie || CKEDITOR.env.quirks || CKEDITOR.env.edge || (a = 'javascript:void(function(){' + encodeURIComponent('document.open();(' + CKEDITOR.tools.fixDomain + ')();document.close();') + '}())', CKEDITOR.dom.element.createFromHtml('\x3ciframe frameBorder\x3d"0" class\x3d"cke_iframe_shim" src\x3d"' + a + '" tabIndex\x3d"-1"\x3e\x3c/iframe\x3e').appendTo(c.getParent())); e.unselectable(); d.unselectable(); return { element: b, - parts: { dialog: b.getChild(0), title: e, close: d, tabs: c.getChild(2), contents: c.getChild([3, 0, 0, 0]), footer: c.getChild([3, 0, 1, 0]) } }; - } function L(a, b, c) { - this.element = b; this.focusIndex = c; this.tabIndex = 0; this.isFocusable = function () { - return !b.getAttribute('disabled') && b.isVisible(); - }; this.focus = function () { - a._.currentFocusIndex = this.focusIndex; this.element.focus(); - }; b.on('keydown', function (a) { - a.data.getKeystroke() in { 32: 1, 13: 1 } && this.fire('click'); - }); b.on('focus', function () { - this.fire('mouseover'); - }); b.on('blur', function () { - this.fire('mouseout'); - }); - } - function aa(a) { - function b() { - a.layout(); - } var c = CKEDITOR.document.getWindow(); - - c.on('resize', b); a.on('hide', function () { - c.removeListener('resize', b); - }); - } function M(a, b) { - this.dialog = a; for (var c = b.contents, e = 0, d; d = c[e]; e++) { - c[e] = d && new N(a, d); - }CKEDITOR.tools.extend(this, b); - } function N(a, b) { - this._ = { dialog: a }; CKEDITOR.tools.extend(this, b); - } function ba(a) { - function b(b) { - var c = a.getSize(); var k = a.parts.dialog.getParent().getClientSize(); var q = b.data.$.screenX; var l = b.data.$.screenY; var r = q - e.x; var n = l - e.y; - - e = { x: q, y: l }; d.x += r; d.y += n; q = -d.x + h[3] < g ? -h[3] : d.x - h[1] > k.width - c.width - g ? k.width - c.width + (f.lang.dir == 'rtl' ? 0 : h[1]) : d.x; c = d.y + h[0] < g ? -h[0] : d.y - h[2] > k.height - c.height - g ? k.height - c.height + h[2] : d.y; q = Math.floor(q); c = Math.floor(c); a.move(q, c, 1); b.data.preventDefault(); - } function c() { - CKEDITOR.document.removeListener('mousemove', b); CKEDITOR.document.removeListener('mouseup', c); if (CKEDITOR.env.ie6Compat) { - var a = u.getChild(0).getFrameDocument(); - - a.removeListener('mousemove', b); a.removeListener('mouseup', c); - } - } var e = null; var d = null; var f = a.getParentEditor(); - var g = f.config.dialog_magnetDistance; var h = CKEDITOR.skin.margins || [0, 0, 0, 0]; - - typeof g === 'undefined' && (g = 20); a.parts.title.on('mousedown', function (g) { - if (!a._.moved) { - var f = a._.element; - - f.getFirst().setStyle('position', 'absolute'); f.removeStyle('display'); a._.moved = !0; a.layout(); - }e = { x: g.data.$.screenX, y: g.data.$.screenY }; CKEDITOR.document.on('mousemove', b); CKEDITOR.document.on('mouseup', c); d = a.getPosition(); CKEDITOR.env.ie6Compat && (f = u.getChild(0).getFrameDocument(), f.on('mousemove', b), f.on('mouseup', c)); g.data.preventDefault(); - }, - a); - } function ca(a) { - function b(b) { - var c = f.lang.dir == 'rtl'; var q = k.width; var l = k.height; var w = q + (b.data.$.screenX - m.x) * (c ? -1 : 1) * (a._.moved ? 1 : 2); var C = l + (b.data.$.screenY - m.y) * (a._.moved ? 1 : 2); var E = a._.element.getFirst(); var E = c && parseInt(E.getComputedStyle('right'), 10); var v = a.getPosition(); - - v.x = v.x || 0; v.y = v.y || 0; v.y + C > p.height && (C = p.height - v.y); (c ? E : v.x) + w > p.width && (w = p.width - (c ? E : v.x)); C = Math.floor(C); w = Math.floor(w); if (d == CKEDITOR.DIALOG_RESIZE_WIDTH || d == CKEDITOR.DIALOG_RESIZE_BOTH) { - q = Math.max(e.minWidth || 0, w - g); - } if (d == CKEDITOR.DIALOG_RESIZE_HEIGHT || -d == CKEDITOR.DIALOG_RESIZE_BOTH) { - l = Math.max(e.minHeight || 0, C - h); - }a.resize(q, l); a._.moved && O(a, a._.position.x, a._.position.y); a._.moved || a.layout(); b.data.preventDefault(); - } function c() { - CKEDITOR.document.removeListener('mouseup', c); CKEDITOR.document.removeListener('mousemove', b); q && (q.remove(), q = null); if (CKEDITOR.env.ie6Compat) { - var a = u.getChild(0).getFrameDocument(); - - a.removeListener('mouseup', c); a.removeListener('mousemove', b); - } - } var e = a.definition; var d = e.resizable; - - if (d != CKEDITOR.DIALOG_RESIZE_NONE) { - var f = -a.getParentEditor(); var g; var h; var p; var m; var k; var q; var l = CKEDITOR.tools.addFunction(function (d) { - function e(a) { - return a.isVisible(); - }k = a.getSize(); var f = a.parts.contents; var l = f.$.getElementsByTagName('iframe').length; var w = !(CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.quirks); - - l && (q = CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_dialog_resize_cover" style\x3d"height: 100%; position: absolute; width: 100%; left:0; top:0;"\x3e\x3c/div\x3e'), f.append(q)); h = k.height - a.parts.contents.getFirst(e).getSize('height', w); - g = k.width - a.parts.contents.getFirst(e).getSize('width', 1); m = { x: d.screenX, y: d.screenY }; p = CKEDITOR.document.getWindow().getViewPaneSize(); CKEDITOR.document.on('mousemove', b); CKEDITOR.document.on('mouseup', c); CKEDITOR.env.ie6Compat && (f = u.getChild(0).getFrameDocument(), f.on('mousemove', b), f.on('mouseup', c)); d.preventDefault && d.preventDefault(); - }); - - a.on('load', function () { - var b = ''; - - d == CKEDITOR.DIALOG_RESIZE_WIDTH ? b = ' cke_resizer_horizontal' : d == CKEDITOR.DIALOG_RESIZE_HEIGHT && (b = ' cke_resizer_vertical'); b = CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_resizer' + -b + ' cke_resizer_' + f.lang.dir + '" title\x3d"' + CKEDITOR.tools.htmlEncode(f.lang.common.resize) + '" onmousedown\x3d"CKEDITOR.tools.callFunction(' + l + ', event )"\x3e' + (f.lang.dir == 'ltr' ? '◢' : '◣') + '\x3c/div\x3e'); a.parts.footer.append(b, 1); - }); f.on('destroy', function () { - CKEDITOR.tools.removeFunction(l); - }); - } - } function O(a, b, c) { - var e = a.parts.dialog.getParent().getClientSize(); var d = a.getSize(); var f = a._.viewportRatio; var g = Math.max(e.width - d.width, 0); var e = Math.max(e.height - d.height, 0); - - f.width = g ? b / g : f.width; f.height = e ? c / e : f.height; - a._.viewportRatio = f; - } function J(a) { - a.data.preventDefault(1); - } function P(a) { - var b = a.config; var c = CKEDITOR.skinName || a.config.skin; var e = b.dialog_backgroundCoverColor || (c == 'moono-lisa' ? 'black' : 'white'); var c = b.dialog_backgroundCoverOpacity; var d = b.baseFloatZIndex; var b = CKEDITOR.tools.genKey(e, c, d); var f = D[b]; - - CKEDITOR.document.getBody().addClass('cke_dialog_open'); f ? f.show() : (d = ['\x3cdiv tabIndex\x3d"-1" style\x3d"position: ', CKEDITOR.env.ie6Compat ? 'absolute' : 'fixed', '; z-index: ', d, '; top: 0px; left: 0px; ', '; width: 100%; height: 100%;', - CKEDITOR.env.ie6Compat ? '' : 'background-color: ' + e, '" class\x3d"cke_dialog_background_cover"\x3e'], CKEDITOR.env.ie6Compat && (e = "\x3chtml\x3e\x3cbody style\x3d\\'background-color:" + e + ";\\'\x3e\x3c/body\x3e\x3c/html\x3e", d.push('\x3ciframe hidefocus\x3d"true" frameborder\x3d"0" id\x3d"cke_dialog_background_iframe" src\x3d"javascript:'), d.push('void((function(){' + encodeURIComponent('document.open();(' + CKEDITOR.tools.fixDomain + ")();document.write( '" + e + "' );document.close();") + '})())'), d.push('" style\x3d"position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity\x3d0)"\x3e\x3c/iframe\x3e')), - d.push('\x3c/div\x3e'), f = CKEDITOR.dom.element.createFromHtml(d.join('')), f.setOpacity(void 0 !== c ? c : 0.5), f.on('keydown', J), f.on('keypress', J), f.on('keyup', J), f.appendTo(CKEDITOR.document.getBody()), D[b] = f); a.focusManager.add(f); u = f; CKEDITOR.env.mac && CKEDITOR.env.webkit || f.focus(); - } function Q(a) { - CKEDITOR.document.getBody().removeClass('cke_dialog_open'); u && (a.focusManager.remove(u), u.hide()); - } function R(a) { - var b = a.data.$.ctrlKey || a.data.$.metaKey; var c = a.data.$.altKey; var e = a.data.$.shiftKey; var d = String.fromCharCode(a.data.$.keyCode); - - (b = x[(b ? 'CTRL+' : '') + (c ? 'ALT+' : '') + (e ? 'SHIFT+' : '') + d]) && b.length && (b = b[b.length - 1], b.keydown && b.keydown.call(b.uiElement, b.dialog, b.key), a.data.preventDefault()); - } function S(a) { - var b = a.data.$.ctrlKey || a.data.$.metaKey; var c = a.data.$.altKey; var e = a.data.$.shiftKey; var d = String.fromCharCode(a.data.$.keyCode); - - (b = x[(b ? 'CTRL+' : '') + (c ? 'ALT+' : '') + (e ? 'SHIFT+' : '') + d]) && b.length && (b = b[b.length - 1], b.keyup && (b.keyup.call(b.uiElement, b.dialog, b.key), a.data.preventDefault())); - } function T(a, b, c, e, d) { - (x[c] || (x[c] = [])).push({ uiElement: a, - dialog: b, key: c, keyup: d || a.accessKeyUp, keydown: e || a.accessKeyDown }); - } function da(a) { - for (var b in x) { - for (var c = x[b], e = c.length - 1; e >= 0; e--) { - c[e].dialog != a && c[e].uiElement != a || c.splice(e, 1); - }c.length === 0 && delete x[b]; - } - } function ea(a, b) { - a._.accessKeyMap[b] && a.selectPage(a._.accessKeyMap[b]); - } function fa() {} var y = CKEDITOR.tools.cssLength; var U; var u; var F = !CKEDITOR.env.ie || CKEDITOR.env.edge; var Z = '\x3cdiv class\x3d"cke_reset_all cke_dialog_container {editorId} {editorDialogClass} {hidpi}" dir\x3d"{langDir}" style\x3d"' + (F ? - 'display:flex' : '') + '" lang\x3d"{langCode}" role\x3d"dialog" aria-labelledby\x3d"cke_dialog_title_{id}"\x3e\x3ctable class\x3d"cke_dialog ' + CKEDITOR.env.cssClass + ' cke_{langDir}" style\x3d"' + (F ? 'margin:auto' : 'position:absolute') + '" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd role\x3d"presentation"\x3e\x3cdiv class\x3d"cke_dialog_body" role\x3d"presentation"\x3e\x3cdiv id\x3d"cke_dialog_title_{id}" class\x3d"cke_dialog_title" role\x3d"presentation"\x3e\x3c/div\x3e\x3ca id\x3d"cke_dialog_close_button_{id}" class\x3d"cke_dialog_close_button" href\x3d"javascript:void(0)" title\x3d"{closeTitle}" role\x3d"button"\x3e\x3cspan class\x3d"cke_label"\x3eX\x3c/span\x3e\x3c/a\x3e\x3cdiv id\x3d"cke_dialog_tabs_{id}" class\x3d"cke_dialog_tabs" role\x3d"tablist"\x3e\x3c/div\x3e\x3ctable class\x3d"cke_dialog_contents" role\x3d"presentation"\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_contents_{id}" class\x3d"cke_dialog_contents_body" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3ctr\x3e\x3ctd id\x3d"cke_dialog_footer_{id}" class\x3d"cke_dialog_footer" role\x3d"presentation"\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/div\x3e'; - - CKEDITOR.dialog = function (a, b) { - function c() { - var a = n._.focusList; - - a.sort(function (a, b) { - return a.tabIndex != b.tabIndex ? b.tabIndex - a.tabIndex : a.focusIndex - b.focusIndex; - }); for (var b = a.length, c = 0; c < b; c++) { - a[c].focusIndex = c; - } - } function e(a) { - var b = n._.focusList; - - a = a || 0; if (!(b.length < 1)) { - var c = n._.currentFocusIndex; - - n._.tabBarMode && a < 0 && (c = 0); try { - b[c].getInputElement().$.blur(); - } catch (d) {} var e = c; var g = n._.pageCount > 1; - - do { - e += a; if (g && !n._.tabBarMode && (e == b.length || e == -1)) { - n._.tabBarMode = !0; n._.tabs[n._.currentTabId][0].focus(); - n._.currentFocusIndex = -1; return; - }e = (e + b.length) % b.length; if (e == c) { - break; - } - } while (a && !b[e].isFocusable()); b[e].focus(); b[e].type == 'text' && b[e].select(); - } - } function d(b) { - if (n == CKEDITOR.dialog._.currentTop) { - var c = b.data.getKeystroke(); var d = a.lang.dir == 'rtl'; var g = [37, 38, 39, 40]; - - q = l = 0; if (c == 9 || c == CKEDITOR.SHIFT + 9) { - e(c == CKEDITOR.SHIFT + 9 ? -1 : 1), q = 1; - } else if (c == CKEDITOR.ALT + 121 && !n._.tabBarMode && n.getPageCount() > 1) { - z(n), q = 1; - } else if (CKEDITOR.tools.indexOf(g, c) != -1 && n._.tabBarMode) { - c = CKEDITOR.tools.indexOf([d ? 39 : 37, 38], c) != -1 ? - A.call(n) : V.call(n), n.selectPage(c), n._.tabs[c][0].focus(), q = 1; - } else if (c != 13 && c != 32 || !n._.tabBarMode) { - if (c == 13) { - c = b.data.getTarget(), c.is('a', 'button', 'select', 'textarea') || c.is('input') && c.$.type == 'button' || ((c = this.getButton('ok')) && CKEDITOR.tools.setTimeout(c.click, 0, c), q = 1), l = 1; - } else if (c == 27) { - (c = this.getButton('cancel')) ? CKEDITOR.tools.setTimeout(c.click, 0, c) : !1 !== this.fire('cancel', { hide: !0 }).hide && this.hide(), l = 1; - } else { - return; - } - } else { - this.selectPage(this._.currentTabId), this._.tabBarMode = !1, this._.currentFocusIndex = --1, e(1), q = 1; - }f(b); - } - } function f(a) { - q ? a.data.preventDefault(1) : l && a.data.stopPropagation(); - } var g = CKEDITOR.dialog._.dialogDefinitions[b]; var h = CKEDITOR.tools.clone(U); var p = a.config.dialog_buttonsOrder || 'OS'; var m = a.lang.dir; var k = {}; var q; var l; - - (p == 'OS' && CKEDITOR.env.mac || p == 'rtl' && m == 'ltr' || p == 'ltr' && m == 'rtl') && h.buttons.reverse(); g = CKEDITOR.tools.extend(g(a), h); g = CKEDITOR.tools.clone(g); g = new M(this, g); h = Y(a); this._ = { editor: a, element: h.element, name: b, model: null, contentSize: { width: 0, height: 0 }, size: { width: 0, height: 0 }, contents: {}, - buttons: {}, accessKeyMap: {}, viewportRatio: { width: 0.5, height: 0.5 }, tabs: {}, tabIdList: [], currentTabId: null, currentTabIndex: null, pageCount: 0, lastTab: null, tabBarMode: !1, focusList: [], currentFocusIndex: 0, hasFocus: !1 }; this.parts = h.parts; CKEDITOR.tools.setTimeout(function () { - a.fire('ariaWidget', this.parts.contents); - }, 0, this); h = { top: 0, visibility: 'hidden' }; CKEDITOR.env.ie6Compat && (h.position = 'absolute'); h[m == 'rtl' ? 'right' : 'left'] = 0; this.parts.dialog.setStyles(h); CKEDITOR.event.call(this); this.definition = g = CKEDITOR.fire('dialogDefinition', - { name: b, definition: g, dialog: this }, a).definition; if (!('removeDialogTabs' in a._) && a.config.removeDialogTabs) { - h = a.config.removeDialogTabs.split(';'); for (m = 0; m < h.length; m++) { - if (p = h[m].split(':'), p.length == 2) { - var r = p[0]; - - k[r] || (k[r] = []); k[r].push(p[1]); - } - }a._.removeDialogTabs = k; - } if (a._.removeDialogTabs && (k = a._.removeDialogTabs[b])) { - for (m = 0; m < k.length; m++) { - g.removeContents(k[m]); - } - } if (g.onLoad) { - this.on('load', g.onLoad); - } if (g.onShow) { - this.on('show', g.onShow); - } if (g.onHide) { - this.on('hide', g.onHide); - } if (g.onOk) { - this.on('ok', - function (b) { - a.fire('saveSnapshot'); setTimeout(function () { - a.fire('saveSnapshot'); - }, 0); !1 === g.onOk.call(this, b) && (b.data.hide = !1); - }); - } this.state = CKEDITOR.DIALOG_STATE_IDLE; if (g.onCancel) { - this.on('cancel', function (a) { - !1 === g.onCancel.call(this, a) && (a.data.hide = !1); - }); - } var n = this; var t = function (a) { - var b = n._.contents; var c = !1; var d; - - for (d in b) { - for (var e in b[d]) { - if (c = a.call(this, b[d][e])) { - return; - } - } - } - }; - - this.on('ok', function (a) { - t(function (b) { - if (b.validate) { - var c = b.validate(this); var d = typeof c === 'string' || !1 === c; - - d && (a.data.hide = !1, a.stop()); - W.call(b, !d, typeof c === 'string' ? c : void 0); return d; - } - }); - }, this, null, 0); this.on('cancel', function (b) { - t(function (c) { - if (c.isChanged()) { - return a.config.dialog_noConfirmCancel || confirm(a.lang.common.confirmCancel) || (b.data.hide = !1), !0; - } - }); - }, this, null, 0); this.parts.close.on('click', function (a) { - !1 !== this.fire('cancel', { hide: !0 }).hide && this.hide(); a.data.preventDefault(); - }, this); this.changeFocus = e; var B = this._.element; - - a.focusManager.add(B, 1); this.on('show', function () { - B.on('keydown', d, this); if (CKEDITOR.env.gecko) { - B.on('keypress', - f, this); - } - }); this.on('hide', function () { - B.removeListener('keydown', d); CKEDITOR.env.gecko && B.removeListener('keypress', f); t(function (a) { - X.apply(a); - }); - }); this.on('iframeAdded', function (a) { - new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document).on('keydown', d, this, null, 0); - }); this.on('show', function () { - c(); var b = n._.pageCount > 1; - - a.config.dialog_startupFocusTab && b ? (n._.tabBarMode = !0, n._.tabs[n._.currentTabId][0].focus(), n._.currentFocusIndex = -1) : this._.hasFocus || (this._.currentFocusIndex = b ? -1 : this._.focusList.length - -1, g.onFocus ? (b = g.onFocus.call(this)) && b.focus() : e(1)); - }, this, null, 4294967295); if (CKEDITOR.env.ie6Compat) { - this.on('load', function () { - var a = this.getElement(); var b = a.getFirst(); - - b.remove(); b.appendTo(a); - }, this); - } ba(this); ca(this); new CKEDITOR.dom.text(g.title, CKEDITOR.document).appendTo(this.parts.title); for (m = 0; m < g.contents.length; m++) { - (k = g.contents[m]) && this.addPage(k); - } this.parts.tabs.on('click', function (a) { - var b = a.data.getTarget(); - - b.hasClass('cke_dialog_tab') && (b = b.$.id, this.selectPage(b.substring(4, b.lastIndexOf('_'))), - z(this), a.data.preventDefault()); - }, this); m = []; k = CKEDITOR.dialog._.uiElementBuilders.hbox.build(this, { type: 'hbox', className: 'cke_dialog_footer_buttons', widths: [], children: g.buttons }, m).getChild(); this.parts.footer.setHtml(m.join('')); for (m = 0; m < k.length; m++) { - this._.buttons[k[m].id] = k[m]; - } - }; CKEDITOR.dialog.prototype = { destroy: function () { - this.hide(); this._.element.remove(); - }, resize: function (a, b) { - if (!this._.contentSize || this._.contentSize.width != a || this._.contentSize.height != b) { - CKEDITOR.dialog.fire('resize', - { dialog: this, width: a, height: b }, this._.editor); this.fire('resize', { width: a, height: b }, this._.editor); this.parts.contents.setStyles({ width: a + 'px', height: b + 'px' }); if (this._.editor.lang.dir == 'rtl' && this._.position) { - var c = this.parts.dialog.getParent().getClientSize().width; - - this._.position.x = c - this._.contentSize.width - parseInt(this._.element.getFirst().getStyle('right'), 10); - } this._.contentSize = { width: a, height: b }; - } - }, getSize: function () { - var a = this._.element.getFirst(); - - return { width: a.$.offsetWidth || 0, height: a.$.offsetHeight || -0 }; - }, move: function (a, b, c) { - var e = this._.element.getFirst(); var d = this._.editor.lang.dir == 'rtl'; - - CKEDITOR.env.ie && e.setStyle('zoom', '100%'); var f = this.parts.dialog.getParent().getClientSize(); var g = this.getSize(); var h = this._.viewportRatio; var p = Math.max(f.width - g.width, 0); var f = Math.max(f.height - g.height, 0); - - this._.position && this._.position.x == a && this._.position.y == b ? (a = Math.floor(p * h.width), b = Math.floor(f * h.height)) : O(this, a, b); this._.position = { x: a, y: b }; d && (a = p - a); b = { top: (b > 0 ? b : 0) + 'px' }; b[d ? 'right' : 'left'] = (a > 0 ? a : 0) + 'px'; - e.setStyles(b); c && (this._.moved = 1); - }, getPosition: function () { - return CKEDITOR.tools.extend({}, this._.position); - }, show: function () { - var a = this._.element; var b = this.definition; var c = CKEDITOR.document.getBody(); var e = this._.editor.config.baseFloatZIndex; - - a.getParent() && a.getParent().equals(c) ? a.setStyle('display', F ? 'flex' : 'block') : a.appendTo(c); this.resize(this._.contentSize && this._.contentSize.width || b.width || b.minWidth, this._.contentSize && this._.contentSize.height || b.height || b.minHeight); this.reset(); this._.currentTabId === null && -this.selectPage(this.definition.contents[0].id); CKEDITOR.dialog._.currentZIndex === null && (CKEDITOR.dialog._.currentZIndex = e); this._.element.getFirst().setStyle('z-index', CKEDITOR.dialog._.currentZIndex += 10); this.getElement().setStyle('z-index', CKEDITOR.dialog._.currentZIndex); CKEDITOR.dialog._.currentTop === null ? (CKEDITOR.dialog._.currentTop = this, this._.parentDialog = null, P(this._.editor)) : (this._.parentDialog = CKEDITOR.dialog._.currentTop, c = this._.parentDialog.getElement().getFirst(), c.$.style.zIndex -= -Math.floor(e / 2), this._.parentDialog.getElement().setStyle('z-index', c.$.style.zIndex), CKEDITOR.dialog._.currentTop = this); a.on('keydown', R); a.on('keyup', S); this._.hasFocus = !1; for (var d in b.contents) { - if (b.contents[d]) { - var a = b.contents[d]; var e = this._.tabs[a.id]; var c = a.requiredContent; var f = 0; - - if (e) { - for (var g in this._.contents[a.id]) { - var h = this._.contents[a.id][g]; - - h.type != 'hbox' && h.type != 'vbox' && h.getInputElement() && (h.requiredContent && !this._.editor.activeFilter.check(h.requiredContent) ? h.disable() : (h.enable(), - f++)); - }!f || c && !this._.editor.activeFilter.check(c) ? e[0].addClass('cke_dialog_tab_disabled') : e[0].removeClass('cke_dialog_tab_disabled'); - } - } - }CKEDITOR.tools.setTimeout(function () { - this.layout(); aa(this); this.parts.dialog.setStyle('visibility', ''); this.fireOnce('load', {}); CKEDITOR.ui.fire('ready', this); this.fire('show', {}); this._.editor.fire('dialogShow', this); this._.parentDialog || this._.editor.focusManager.lock(); this.foreach(function (a) { - a.setInitValue && a.setInitValue(); - }); - }, 100, this); - }, layout: function () { - var a = -this.parts.dialog; - - if (this._.moved || !F) { - var b = this.getSize(); var c = CKEDITOR.document.getWindow().getViewPaneSize(); var e; - - this._.moved && this._.position ? (e = this._.position.x, b = this._.position.y) : (e = (c.width - b.width) / 2, b = (c.height - b.height) / 2); CKEDITOR.env.ie6Compat || (a.setStyle('position', 'absolute'), a.removeStyle('margin')); e = Math.floor(e); b = Math.floor(b); this.move(e, b); - } - }, foreach: function (a) { - for (var b in this._.contents) { - for (var c in this._.contents[b]) { - a.call(this, this._.contents[b][c]); - } - } return this; - }, reset: (function () { - var a = -function (a) { - a.reset && a.reset(1); -}; - - return function () { - this.foreach(a); return this; - }; - })(), setupContent: function () { - var a = arguments; - - this.foreach(function (b) { - b.setup && b.setup.apply(b, a); - }); - }, commitContent: function () { - var a = arguments; - - this.foreach(function (b) { - CKEDITOR.env.ie && this._.currentFocusIndex == b.focusIndex && b.getInputElement().$.blur(); b.commit && b.commit.apply(b, a); - }); - }, hide: function () { - if (this.parts.dialog.isVisible()) { - this.fire('hide', {}); this._.editor.fire('dialogHide', this); this.selectPage(this._.tabIdList[0]); - var a = this._.element; - - a.setStyle('display', 'none'); this.parts.dialog.setStyle('visibility', 'hidden'); for (da(this); CKEDITOR.dialog._.currentTop != this;) { - CKEDITOR.dialog._.currentTop.hide(); - } if (this._.parentDialog) { - var b = this._.parentDialog.getElement().getFirst(); - - this._.parentDialog.getElement().removeStyle('z-index'); b.setStyle('z-index', parseInt(b.$.style.zIndex, 10) + Math.floor(this._.editor.config.baseFloatZIndex / 2)); - } else { - Q(this._.editor); - } if (CKEDITOR.dialog._.currentTop = this._.parentDialog) { - CKEDITOR.dialog._.currentZIndex -= -10; - } else { - CKEDITOR.dialog._.currentZIndex = null; a.removeListener('keydown', R); a.removeListener('keyup', S); var c = this._.editor; - - c.focus(); setTimeout(function () { - c.focusManager.unlock(); CKEDITOR.env.iOS && c.window.focus(); - }, 0); - } delete this._.parentDialog; this.foreach(function (a) { - a.resetInitValue && a.resetInitValue(); - }); this.setState(CKEDITOR.DIALOG_STATE_IDLE); - } - }, addPage: function (a) { - if (!a.requiredContent || this._.editor.filter.check(a.requiredContent)) { - for (var b = [], c = a.label ? ' title\x3d"' + CKEDITOR.tools.htmlEncode(a.label) + -'"' : '', e = CKEDITOR.dialog._.uiElementBuilders.vbox.build(this, { type: 'vbox', className: 'cke_dialog_page_contents', children: a.elements, expand: !!a.expand, padding: a.padding, style: a.style || 'width: 100%;' }, b), d = this._.contents[a.id] = {}, f = e.getChild(), g = 0; e = f.shift();) { - e.notAllowed || e.type == 'hbox' || e.type == 'vbox' || g++, d[e.id] = e, typeof e.getChild === 'function' && f.push.apply(f, e.getChild()); - }g || (a.hidden = !0); b = CKEDITOR.dom.element.createFromHtml(b.join('')); b.setAttribute('role', 'tabpanel'); b.setStyle('min-height', - '100%'); e = CKEDITOR.env; d = 'cke_' + a.id + '_' + CKEDITOR.tools.getNextNumber(); c = CKEDITOR.dom.element.createFromHtml(['\x3ca class\x3d"cke_dialog_tab"', this._.pageCount > 0 ? ' cke_last' : 'cke_first', c, a.hidden ? ' style\x3d"display:none"' : '', ' id\x3d"', d, '"', e.gecko && !e.hc ? '' : ' href\x3d"javascript:void(0)"', ' tabIndex\x3d"-1" hidefocus\x3d"true" role\x3d"tab"\x3e', a.label, '\x3c/a\x3e'].join('')); b.setAttribute('aria-labelledby', d); this._.tabs[a.id] = [c, b]; this._.tabIdList.push(a.id); !a.hidden && this._.pageCount++; - this._.lastTab = c; this.updateStyle(); b.setAttribute('name', a.id); b.appendTo(this.parts.contents); c.unselectable(); this.parts.tabs.append(c); a.accessKey && (T(this, this, 'CTRL+' + a.accessKey, fa, ea), this._.accessKeyMap['CTRL+' + a.accessKey] = a.id); - } - }, selectPage: function (a) { - if (this._.currentTabId != a && !this._.tabs[a][0].hasClass('cke_dialog_tab_disabled') && !1 !== this.fire('selectPage', { page: a, currentPage: this._.currentTabId })) { - for (var b in this._.tabs) { - var c = this._.tabs[b][0]; var e = this._.tabs[b][1]; - - b != a && (c.removeClass('cke_dialog_tab_selected'), - c.removeAttribute('aria-selected'), e.hide()); e.setAttribute('aria-hidden', b != a); - } var d = this._.tabs[a]; - - d[0].addClass('cke_dialog_tab_selected'); d[0].setAttribute('aria-selected', !0); CKEDITOR.env.ie6Compat || CKEDITOR.env.ie7Compat ? (K(d[1]), d[1].show(), setTimeout(function () { - K(d[1], 1); - }, 0)) : d[1].show(); this._.currentTabId = a; this._.currentTabIndex = CKEDITOR.tools.indexOf(this._.tabIdList, a); - } - }, updateStyle: function () { - this.parts.dialog[(this._.pageCount === 1 ? 'add' : 'remove') + 'Class']('cke_single_page'); - }, hidePage: function (a) { - var b = -this._.tabs[a] && this._.tabs[a][0]; - - b && this._.pageCount != 1 && b.isVisible() && (a == this._.currentTabId && this.selectPage(A.call(this)), b.hide(), this._.pageCount--, this.updateStyle()); - }, showPage: function (a) { - if (a = this._.tabs[a] && this._.tabs[a][0]) { - a.show(), this._.pageCount++, this.updateStyle(); - } - }, getElement: function () { - return this._.element; - }, getName: function () { - return this._.name; - }, getContentElement: function (a, b) { - var c = this._.contents[a]; - - return c && c[b]; - }, getValueOf: function (a, b) { - return this.getContentElement(a, b).getValue(); - }, - setValueOf: function (a, b, c) { - return this.getContentElement(a, b).setValue(c); - }, getButton: function (a) { - return this._.buttons[a]; - }, click: function (a) { - return this._.buttons[a].click(); - }, disableButton: function (a) { - return this._.buttons[a].disable(); - }, enableButton: function (a) { - return this._.buttons[a].enable(); - }, getPageCount: function () { - return this._.pageCount; - }, getParentEditor: function () { - return this._.editor; - }, getSelectedElement: function () { - return this.getParentEditor().getSelection().getSelectedElement(); - }, addFocusable: function (a, - b) { - if (typeof b === 'undefined') { - b = this._.focusList.length, this._.focusList.push(new L(this, a, b)); - } else { - this._.focusList.splice(b, 0, new L(this, a, b)); for (var c = b + 1; c < this._.focusList.length; c++) { - this._.focusList[c].focusIndex++; - } - } - }, setState: function (a) { - if (this.state != a) { - this.state = a; if (a == CKEDITOR.DIALOG_STATE_BUSY) { - if (!this.parts.spinner) { - var b = this.getParentEditor().lang.dir; var c = { attributes: { class: 'cke_dialog_spinner' }, styles: { float: b == 'rtl' ? 'right' : 'left' } }; - - c.styles['margin-' + (b == 'rtl' ? 'left' : 'right')] = -'8px'; this.parts.spinner = CKEDITOR.document.createElement('div', c); this.parts.spinner.setHtml('\x26#8987;'); this.parts.spinner.appendTo(this.parts.title, 1); - } this.parts.spinner.show(); this.getButton('ok').disable(); - } else { - a == CKEDITOR.DIALOG_STATE_IDLE && (this.parts.spinner && this.parts.spinner.hide(), this.getButton('ok').enable()); - } this.fire('state', a); - } - }, getModel: function (a) { - return this._.model ? this._.model : this.definition.getModel ? this.definition.getModel(a) : null; - }, setModel: function (a) { - this._.model = a; - }, getMode: function (a) { - if (this.definition.getMode) { - return this.definition.getMode(a); - } - a = this.getModel(a); return !a || a instanceof CKEDITOR.dom.element && !a.getParent() ? CKEDITOR.dialog.CREATION_MODE : CKEDITOR.dialog.EDITING_MODE; - } }; CKEDITOR.tools.extend(CKEDITOR.dialog, { CREATION_MODE: 0, EDITING_MODE: 1, add: function (a, b) { - this._.dialogDefinitions[a] && typeof b !== 'function' || (this._.dialogDefinitions[a] = b); - }, exists: function (a) { - return !!this._.dialogDefinitions[a]; - }, getCurrent: function () { - return CKEDITOR.dialog._.currentTop; - }, isTabEnabled: function (a, b, c) { - a = a.config.removeDialogTabs; return !(a && a.match(new RegExp('(?:^|;)' + -b + ':' + c + '(?:$|;)', 'i'))); - }, okButton: (function () { - var a = function (a, c) { - c = c || {}; return CKEDITOR.tools.extend({ id: 'ok', type: 'button', label: a.lang.common.ok, class: 'cke_dialog_ui_button_ok', onClick: function (a) { - a = a.data.dialog; !1 !== a.fire('ok', { hide: !0 }).hide && a.hide(); - } }, c, !0); - }; - - a.type = 'button'; a.override = function (b) { - return CKEDITOR.tools.extend(function (c) { - return a(c, b); - }, { type: 'button' }, !0); - }; return a; - })(), cancelButton: (function () { - var a = function (a, c) { - c = c || {}; return CKEDITOR.tools.extend({ id: 'cancel', type: 'button', - label: a.lang.common.cancel, class: 'cke_dialog_ui_button_cancel', onClick: function (a) { - a = a.data.dialog; !1 !== a.fire('cancel', { hide: !0 }).hide && a.hide(); - } }, c, !0); - }; - - a.type = 'button'; a.override = function (b) { - return CKEDITOR.tools.extend(function (c) { - return a(c, b); - }, { type: 'button' }, !0); - }; return a; - })(), addUIElement: function (a, b) { - this._.uiElementBuilders[a] = b; - } }); CKEDITOR.dialog._ = { uiElementBuilders: {}, dialogDefinitions: {}, currentTop: null, currentZIndex: null }; CKEDITOR.event.implementOn(CKEDITOR.dialog); CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype); - U = { resizable: CKEDITOR.DIALOG_RESIZE_BOTH, minWidth: 600, minHeight: 400, buttons: [CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton] }; var G = function (a, b, c) { - for (var e = 0, d; d = a[e]; e++) { - if (d.id == b || c && d[c] && (d = G(d[c], b, c))) { - return d; - } - } return null; - }; var H = function (a, b, c, e, d) { - if (c) { - for (var f = 0, g; g = a[f]; f++) { - if (g.id == c) { - return a.splice(f, 0, b), b; - } if (e && g[e] && (g = H(g[e], b, c, e, !0))) { - return g; - } - } if (d) { - return null; - } - }a.push(b); return b; - }; var I = function (a, b, c) { - for (var e = 0, d; d = a[e]; e++) { - if (d.id == b) { - return a.splice(e, 1); - } if (c && d[c] && (d = I(d[c], - b, c))) { - return d; - } - } return null; - }; - - M.prototype = { getContents: function (a) { - return G(this.contents, a); - }, getButton: function (a) { - return G(this.buttons, a); - }, addContents: function (a, b) { - return H(this.contents, a, b); - }, addButton: function (a, b) { - return H(this.buttons, a, b); - }, removeContents: function (a) { - I(this.contents, a); - }, removeButton: function (a) { - I(this.buttons, a); - } }; N.prototype = { get: function (a) { - return G(this.elements, a, 'children'); - }, add: function (a, b) { - return H(this.elements, a, b, 'children'); - }, remove: function (a) { - I(this.elements, a, - 'children'); - } }; var D = {}; var x = {}; - - (function () { - CKEDITOR.ui.dialog = { uiElement: function (a, b, c, e, d, f, g) { - if (!(arguments.length < 4)) { - var h = (e.call ? e(b) : e) || 'div'; var p = ['\x3c', h, ' ']; var m = (d && d.call ? d(b) : d) || {}; var k = (f && f.call ? f(b) : f) || {}; var q = (g && g.call ? g.call(this, a, b) : g) || ''; var l = this.domId = k.id || CKEDITOR.tools.getNextId() + '_uiElement'; - - b.requiredContent && !a.getParentEditor().filter.check(b.requiredContent) && (m.display = 'none', this.notAllowed = !0); k.id = l; var r = {}; - - b.type && (r['cke_dialog_ui_' + b.type] = 1); b.className && (r[b.className] = -1); b.disabled && (r.cke_disabled = 1); for (var n = k.class && k.class.split ? k.class.split(' ') : [], l = 0; l < n.length; l++) { - n[l] && (r[n[l]] = 1); - }n = []; for (l in r) { - n.push(l); - }k.class = n.join(' '); b.title && (k.title = b.title); r = (b.style || '').split(';'); b.align && (n = b.align, m['margin-left'] = n == 'left' ? 0 : 'auto', m['margin-right'] = n == 'right' ? 0 : 'auto'); for (l in m) { - r.push(l + ':' + m[l]); - }b.hidden && r.push('display:none'); for (l = r.length - 1; l >= 0; l--) { - r[l] === '' && r.splice(l, 1); - } r.length > 0 && (k.style = (k.style ? k.style + '; ' : '') + r.join('; ')); - for (l in k) { - p.push(l + '\x3d"' + CKEDITOR.tools.htmlEncode(k[l]) + '" '); - }p.push('\x3e', q, '\x3c/', h, '\x3e'); c.push(p.join('')); (this._ || (this._ = {})).dialog = a; typeof b.isChanged === 'boolean' && (this.isChanged = function () { - return b.isChanged; - }); typeof b.isChanged === 'function' && (this.isChanged = b.isChanged); typeof b.setValue === 'function' && (this.setValue = CKEDITOR.tools.override(this.setValue, function (a) { - return function (c) { - a.call(this, b.setValue.call(this, c)); - }; - })); typeof b.getValue === 'function' && (this.getValue = CKEDITOR.tools.override(this.getValue, - function (a) { - return function () { - return b.getValue.call(this, a.call(this)); - }; - })); CKEDITOR.event.implementOn(this); this.registerEvents(b); this.accessKeyUp && this.accessKeyDown && b.accessKey && T(this, a, 'CTRL+' + b.accessKey); var t = this; - - a.on('load', function () { - var b = t.getInputElement(); - - if (b) { - var c = t.type in { checkbox: 1, ratio: 1 } && CKEDITOR.env.ie && CKEDITOR.env.version < 8 ? 'cke_dialog_ui_focused' : ''; - - b.on('focus', function () { - a._.tabBarMode = !1; a._.hasFocus = !0; t.fire('focus'); c && this.addClass(c); - }); b.on('blur', function () { - t.fire('blur'); - c && this.removeClass(c); - }); - } - }); CKEDITOR.tools.extend(this, b); this.keyboardFocusable && (this.tabIndex = b.tabIndex || 0, this.focusIndex = a._.focusList.push(this) - 1, this.on('focus', function () { - a._.currentFocusIndex = t.focusIndex; - })); - } - }, hbox: function (a, b, c, e, d) { - if (!(arguments.length < 4)) { - this._ || (this._ = {}); var f = this._.children = b; var g = d && d.widths || null; var h = d && d.height || null; var p; var m = { role: 'presentation' }; - - d && d.align && (m.align = d.align); CKEDITOR.ui.dialog.uiElement.call(this, a, d || { type: 'hbox' }, e, 'table', {}, m, function () { - var a = -['\x3ctbody\x3e\x3ctr class\x3d"cke_dialog_ui_hbox"\x3e']; - - for (p = 0; p < c.length; p++) { - var b = 'cke_dialog_ui_hbox_child'; var e = []; - - p === 0 && (b = 'cke_dialog_ui_hbox_first'); p == c.length - 1 && (b = 'cke_dialog_ui_hbox_last'); a.push('\x3ctd class\x3d"', b, '" role\x3d"presentation" '); g ? g[p] && e.push('width:' + y(g[p])) : e.push('width:' + Math.floor(100 / c.length) + '%'); h && e.push('height:' + y(h)); d && void 0 !== d.padding && e.push('padding:' + y(d.padding)); CKEDITOR.env.ie && CKEDITOR.env.quirks && f[p].align && e.push('text-align:' + f[p].align); - e.length > 0 && a.push('style\x3d"' + e.join('; ') + '" '); a.push('\x3e', c[p], '\x3c/td\x3e'); - }a.push('\x3c/tr\x3e\x3c/tbody\x3e'); return a.join(''); - }); - } - }, vbox: function (a, b, c, e, d) { - if (!(arguments.length < 3)) { - this._ || (this._ = {}); var f = this._.children = b; var g = d && d.width || null; var h = d && d.heights || null; - - CKEDITOR.ui.dialog.uiElement.call(this, a, d || { type: 'vbox' }, e, 'div', null, { role: 'presentation' }, function () { - var b = ['\x3ctable role\x3d"presentation" cellspacing\x3d"0" border\x3d"0" ']; - - b.push('style\x3d"'); d && d.expand && b.push('height:100%;'); - b.push('width:' + y(g || '100%'), ';'); CKEDITOR.env.webkit && b.push('float:none;'); b.push('"'); b.push('align\x3d"', CKEDITOR.tools.htmlEncode(d && d.align || (a.getParentEditor().lang.dir == 'ltr' ? 'left' : 'right')), '" '); b.push('\x3e\x3ctbody\x3e'); for (var e = 0; e < c.length; e++) { - var k = []; - - b.push('\x3ctr\x3e\x3ctd role\x3d"presentation" '); g && k.push('width:' + y(g || '100%')); h ? k.push('height:' + y(h[e])) : d && d.expand && k.push('height:' + Math.floor(100 / c.length) + '%'); d && void 0 !== d.padding && k.push('padding:' + y(d.padding)); CKEDITOR.env.ie && -CKEDITOR.env.quirks && f[e].align && k.push('text-align:' + f[e].align); k.length > 0 && b.push('style\x3d"', k.join('; '), '" '); b.push(' class\x3d"cke_dialog_ui_vbox_child"\x3e', c[e], '\x3c/td\x3e\x3c/tr\x3e'); - }b.push('\x3c/tbody\x3e\x3c/table\x3e'); return b.join(''); - }); - } - } }; - })(); CKEDITOR.ui.dialog.uiElement.prototype = { getElement: function () { - return CKEDITOR.document.getById(this.domId); - }, getInputElement: function () { - return this.getElement(); - }, getDialog: function () { - return this._.dialog; - }, setValue: function (a, b) { - this.getInputElement().setValue(a); - !b && this.fire('change', { value: a }); return this; - }, getValue: function () { - return this.getInputElement().getValue(); - }, isChanged: function () { - return !1; - }, selectParentTab: function () { - for (var a = this.getInputElement(); (a = a.getParent()) && a.$.className.search('cke_dialog_page_contents') == -1;) { } if (!a) { - return this; - } a = a.getAttribute('name'); this._.dialog._.currentTabId != a && this._.dialog.selectPage(a); return this; - }, focus: function () { - this.selectParentTab().getInputElement().focus(); return this; - }, registerEvents: function (a) { - var b = -/^on([A-Z]\w+)/; var c; var e = function (a, b, c, d) { - b.on('load', function () { - a.getInputElement().on(c, d, a); - }); - }; var d; - - for (d in a) { - if (c = d.match(b)) { - this.eventProcessors[d] ? this.eventProcessors[d].call(this, this._.dialog, a[d]) : e(this, this._.dialog, c[1].toLowerCase(), a[d]); - } - } return this; - }, eventProcessors: { onLoad: function (a, b) { - a.on('load', b, this); - }, onShow: function (a, b) { - a.on('show', b, this); - }, onHide: function (a, b) { - a.on('hide', b, this); - } }, accessKeyDown: function () { - this.focus(); - }, accessKeyUp: function () {}, disable: function () { - var a = this.getElement(); - - this.getInputElement().setAttribute('disabled', 'true'); a.addClass('cke_disabled'); - }, enable: function () { - var a = this.getElement(); - - this.getInputElement().removeAttribute('disabled'); a.removeClass('cke_disabled'); - }, isEnabled: function () { - return !this.getElement().hasClass('cke_disabled'); - }, isVisible: function () { - return this.getInputElement().isVisible(); - }, isFocusable: function () { - return this.isEnabled() && this.isVisible() ? !0 : !1; - } }; CKEDITOR.ui.dialog.hbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement(), - { getChild: function (a) { - if (arguments.length < 1) { - return this._.children.concat(); - } a.splice || (a = [a]); return a.length < 2 ? this._.children[a[0]] : this._.children[a[0]] && this._.children[a[0]].getChild ? this._.children[a[0]].getChild(a.slice(1, a.length)) : null; - } }, !0); CKEDITOR.ui.dialog.vbox.prototype = new CKEDITOR.ui.dialog.hbox(); (function () { - var a = { build: function (a, c, e) { - for (var d = c.children, f, g = [], h = [], p = 0; p < d.length && (f = d[p]); p++) { - var m = []; - - g.push(m); h.push(CKEDITOR.dialog._.uiElementBuilders[f.type].build(a, f, m)); - } return new CKEDITOR.ui.dialog[c.type](a, - h, g, e, c); - } }; - - CKEDITOR.dialog.addUIElement('hbox', a); CKEDITOR.dialog.addUIElement('vbox', a); - })(); CKEDITOR.dialogCommand = function (a, b) { - this.dialogName = a; CKEDITOR.tools.extend(this, b, !0); - }; CKEDITOR.dialogCommand.prototype = { exec: function (a) { - var b = this.tabId; - - a.openDialog(this.dialogName, function (a) { - b && a.selectPage(b); - }); - }, canUndo: !1, editorFocus: 1 }; (function () { - var a = /^([a]|[^a])+$/; var b = /^\d*$/; var c = /^\d*(?:\.\d+)?$/; var e = /^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/; var d = /^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i; - var f = /^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/; - - CKEDITOR.VALIDATE_OR = 1; CKEDITOR.VALIDATE_AND = 2; CKEDITOR.dialog.validate = { functions: function () { - var a = arguments; - - return function () { - var b = this && this.getValue ? this.getValue() : a[0]; var c; var d = CKEDITOR.VALIDATE_AND; var e = []; var f; - - for (f = 0; f < a.length; f++) { - if (typeof a[f] === 'function') { - e.push(a[f]); - } else { - break; - } - }f < a.length && typeof a[f] === 'string' && (c = a[f], f++); f < a.length && typeof a[f] === 'number' && (d = a[f]); var l = d == CKEDITOR.VALIDATE_AND ? !0 : !1; - - for (f = 0; f < e.length; f++) { - l = d == CKEDITOR.VALIDATE_AND ? l && -e[f](b) : l || e[f](b); - } return l ? !0 : c; - }; - }, regex: function (a, b) { - return function (c) { - c = this && this.getValue ? this.getValue() : c; return a.test(c) ? !0 : b; - }; - }, notEmpty: function (b) { - return this.regex(a, b); - }, integer: function (a) { - return this.regex(b, a); - }, number: function (a) { - return this.regex(c, a); - }, cssLength: function (a) { - return this.functions(function (a) { - return d.test(CKEDITOR.tools.trim(a)); - }, a); - }, htmlLength: function (a) { - return this.functions(function (a) { - return e.test(CKEDITOR.tools.trim(a)); - }, a); - }, inlineStyle: function (a) { - return this.functions(function (a) { - return f.test(CKEDITOR.tools.trim(a)); - }, - a); - }, equals: function (a, b) { - return this.functions(function (b) { - return b == a; - }, b); - }, notEqual: function (a, b) { - return this.functions(function (b) { - return b != a; - }, b); - } }; CKEDITOR.on('instanceDestroyed', function (a) { - if (CKEDITOR.tools.isEmpty(CKEDITOR.instances)) { - for (var b; b = CKEDITOR.dialog._.currentTop;) { - b.hide(); - } for (var c in D) { - D[c].remove(); - }D = {}; - }a = a.editor._.storedDialogs; for (var d in a) { - a[d].destroy(); - } - }); - })(); CKEDITOR.tools.extend(CKEDITOR.editor.prototype, { openDialog: function (a, b, c) { - var e = null; var d = CKEDITOR.dialog._.dialogDefinitions[a]; - - CKEDITOR.dialog._.currentTop === null && P(this); if (typeof d === 'function') { - d = this._.storedDialogs || (this._.storedDialogs = {}), e = d[a] || (d[a] = new CKEDITOR.dialog(this, a)), e.setModel(c), b && b.call(e, e), e.show(); - } else { - if (d == 'failed') { - throw Q(this), Error('[CKEDITOR.dialog.openDialog] Dialog "' + a + '" failed when loading definition.'); - } typeof d === 'string' && CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(d), function () { - typeof CKEDITOR.dialog._.dialogDefinitions[a] !== 'function' && (CKEDITOR.dialog._.dialogDefinitions[a] = 'failed'); - this.openDialog(a, b, c); - }, this, 0, 1); - }CKEDITOR.skin.loadPart('dialog'); if (e) { - e.once('hide', function () { - e.setModel(null); - }, null, null, 999); - } return e; - } }); - })(); var stylesLoaded = !1; - - CKEDITOR.plugins.add('dialog', { requires: 'dialogui', init: function (z) { - stylesLoaded || (CKEDITOR.document.appendStyleSheet(this.path + 'styles/dialog.css'), stylesLoaded = !0); z.on('doubleclick', function (A) { - A.data.dialog && z.openDialog(A.data.dialog); - }, null, null, 999); - } }); CKEDITOR.plugins.add('about', { requires: 'dialog', init: function (a) { - var b = a.addCommand('about', new CKEDITOR.dialogCommand('about')); - - b.modes = { wysiwyg: 1, source: 1 }; b.canUndo = !1; b.readOnly = 1; a.ui.addButton && a.ui.addButton('About', { label: a.lang.about.dlgTitle, command: 'about', toolbar: 'about' }); CKEDITOR.dialog.add('about', this.path + 'dialogs/about.js'); - } }); (function () { - CKEDITOR.plugins.add('a11yhelp', { requires: 'dialog', availableLangs: { 'af': 1, 'ar': 1, 'az': 1, 'bg': 1, 'ca': 1, 'cs': 1, 'cy': 1, 'da': 1, 'de': 1, 'de-ch': 1, 'el': 1, 'en': 1, 'en-au': 1, 'en-gb': 1, 'eo': 1, 'es': 1, 'es-mx': 1, 'et': 1, 'eu': 1, 'fa': 1, 'fi': 1, 'fo': 1, 'fr': 1, 'fr-ca': 1, 'gl': 1, 'gu': 1, 'he': 1, 'hi': 1, 'hr': 1, 'hu': 1, 'id': 1, 'it': 1, 'ja': 1, 'km': 1, 'ko': 1, 'ku': 1, 'lt': 1, 'lv': 1, 'mk': 1, 'mn': 1, 'nb': 1, 'nl': 1, 'no': 1, 'oc': 1, 'pl': 1, 'pt': 1, 'pt-br': 1, 'ro': 1, 'ru': 1, 'si': 1, 'sk': 1, 'sl': 1, 'sq': 1, 'sr': 1, 'sr-latn': 1, 'sv': 1, 'th': 1, 'tr': 1, 'tt': 1, 'ug': 1, 'uk': 1, 'vi': 1, 'zh': 1, 'zh-cn': 1 }, init: function (b) { - var c = this; - - b.addCommand('a11yHelp', { exec: function () { - var a = -b.langCode; var a = c.availableLangs[a] ? a : c.availableLangs[a.replace(/-.*/, '')] ? a.replace(/-.*/, '') : 'en'; - - CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(c.path + 'dialogs/lang/' + a + '.js'), function () { - b.lang.a11yhelp = c.langEntries[a]; b.openDialog('a11yHelp'); - }); - }, modes: { wysiwyg: 1, source: 1 }, readOnly: 1, canUndo: !1 }); b.setKeystroke(CKEDITOR.ALT + 48, 'a11yHelp'); CKEDITOR.dialog.add('a11yHelp', this.path + 'dialogs/a11yhelp.js'); b.on('ariaEditorHelpLabel', function (a) { - a.data.label = b.lang.common.editorHelp; - }); - } }); - })(); (function () { - function f(c) { - var a = this.att; - - c = c && c.hasAttribute(a) && c.getAttribute(a) || ''; void 0 !== c && this.setValue(c); - } function g() { - for (var c, a = 0; a < arguments.length; a++) { - if (arguments[a] instanceof CKEDITOR.dom.element) { - c = arguments[a]; break; - } - } if (c) { - var a = this.att; var b = this.getValue(); - - b ? c.setAttribute(a, b) : c.removeAttribute(a, b); - } - } var k = { id: 1, dir: 1, classes: 1, styles: 1 }; - - CKEDITOR.plugins.add('dialogadvtab', { requires: 'dialog', allowedContent: function (c) { - c || (c = k); var a = []; - - c.id && a.push('id'); c.dir && a.push('dir'); var b = -''; - - a.length && (b += '[' + a.join(',') + ']'); c.classes && (b += '(*)'); c.styles && (b += '{*}'); return b; - }, createAdvancedTab: function (c, a, b) { - a || (a = k); var d = c.lang.common; var h = { id: 'advanced', label: d.advancedTab, title: d.advancedTab, elements: [{ type: 'vbox', padding: 1, children: [] }] }; var e = []; - - if (a.id || a.dir) { - a.id && e.push({ id: 'advId', att: 'id', type: 'text', requiredContent: b ? b + '[id]' : null, label: d.id, setup: f, commit: g }), a.dir && e.push({ id: 'advLangDir', att: 'dir', type: 'select', requiredContent: b ? b + '[dir]' : null, label: d.langDir, default: '', - style: 'width:100%', items: [[d.notSet, ''], [d.langDirLTR, 'ltr'], [d.langDirRTL, 'rtl']], setup: f, commit: g }), h.elements[0].children.push({ type: 'hbox', widths: ['50%', '50%'], children: [].concat(e) }); - } if (a.styles || a.classes) { - e = [], a.styles && e.push({ id: 'advStyles', att: 'style', type: 'text', requiredContent: b ? b + '{cke-xyz}' : null, label: d.styles, default: '', validate: CKEDITOR.dialog.validate.inlineStyle(d.invalidInlineStyle), onChange: function () {}, getStyle: function (a, c) { - var b = this.getValue().match(new RegExp('(?:^|;)\\s*' + -a + '\\s*:\\s*([^;]*)', 'i')); - - return b ? b[1] : c; - }, updateStyle: function (a, b) { - var d = this.getValue(); var e = c.document.createElement('span'); - - e.setAttribute('style', d); e.setStyle(a, b); d = CKEDITOR.tools.normalizeCssText(e.getAttribute('style')); this.setValue(d, 1); - }, setup: f, commit: g }), a.classes && e.push({ type: 'hbox', widths: ['45%', '55%'], children: [{ id: 'advCSSClasses', att: 'class', type: 'text', requiredContent: b ? b + '(cke-xyz)' : null, label: d.cssClasses, default: '', setup: f, commit: g }] }), h.elements[0].children.push({ type: 'hbox', - widths: ['50%', '50%'], children: [].concat(e) }); - } return h; - } }); - })(); CKEDITOR.plugins.add('basicstyles', { init: function (c) { - var e = 0; var d = function (g, d, b, a) { - if (a) { - a = new CKEDITOR.style(a); var f = h[b]; - - f.unshift(a); c.attachStyleStateChange(a, function (a) { - !c.readOnly && c.getCommand(b).setState(a); - }); c.addCommand(b, new CKEDITOR.styleCommand(a, { contentForms: f })); c.ui.addButton && c.ui.addButton(g, { label: d, command: b, toolbar: 'basicstyles,' + (e += 10) }); - } - }; var h = { bold: ['strong', 'b', ['span', function (a) { - a = a.styles['font-weight']; return a == 'bold' || +a >= 700; - }]], italic: ['em', 'i', ['span', function (a) { - return a.styles['font-style'] == -'italic'; - }]], underline: ['u', ['span', function (a) { - return a.styles['text-decoration'] == 'underline'; - }]], strike: ['s', 'strike', ['span', function (a) { - return a.styles['text-decoration'] == 'line-through'; - }]], subscript: ['sub'], superscript: ['sup'] }; var b = c.config; var a = c.lang.basicstyles; - - d('Bold', a.bold, 'bold', b.coreStyles_bold); d('Italic', a.italic, 'italic', b.coreStyles_italic); d('Underline', a.underline, 'underline', b.coreStyles_underline); d('Strike', a.strike, 'strike', b.coreStyles_strike); d('Subscript', a.subscript, - 'subscript', b.coreStyles_subscript); d('Superscript', a.superscript, 'superscript', b.coreStyles_superscript); c.setKeystroke([[CKEDITOR.CTRL + 66, 'bold'], [CKEDITOR.CTRL + 73, 'italic'], [CKEDITOR.CTRL + 85, 'underline']]); - } }); CKEDITOR.config.coreStyles_bold = { element: 'strong', overrides: 'b' }; CKEDITOR.config.coreStyles_italic = { element: 'em', overrides: 'i' }; CKEDITOR.config.coreStyles_underline = { element: 'u' }; CKEDITOR.config.coreStyles_strike = { element: 's', overrides: 'strike' }; CKEDITOR.config.coreStyles_subscript = { element: 'sub' }; - CKEDITOR.config.coreStyles_superscript = { element: 'sup' }; (function () { - function q(a, f, d, b) { - if (!a.isReadOnly() && !a.equals(d.editable())) { - CKEDITOR.dom.element.setMarker(b, a, 'bidi_processed', 1); b = a; for (var c = d.editable(); (b = b.getParent()) && !b.equals(c);) { - if (b.getCustomData('bidi_processed')) { - a.removeStyle('direction'); a.removeAttribute('dir'); return; - } - }b = 'useComputedState' in d.config ? d.config.useComputedState : 1; (b ? a.getComputedStyle('direction') : a.getStyle('direction') || a.hasAttribute('dir')) != f && (a.removeStyle('direction'), b ? (a.removeAttribute('dir'), f != a.getComputedStyle('direction') && -a.setAttribute('dir', f)) : a.setAttribute('dir', f), d.forceNextSelectionCheck()); - } - } function v(a, f, d) { - var b = a.getCommonAncestor(!1, !0); - - a = a.clone(); a.enlarge(d == CKEDITOR.ENTER_BR ? CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS); if (a.checkBoundaryOfElement(b, CKEDITOR.START) && a.checkBoundaryOfElement(b, CKEDITOR.END)) { - for (var c; b && b.type == CKEDITOR.NODE_ELEMENT && (c = b.getParent()) && c.getChildCount() == 1 && !(b.getName() in f);) { - b = c; - } return b.type == CKEDITOR.NODE_ELEMENT && b.getName() in f && b; - } - } function p(a) { - return { context: 'p', - allowedContent: { 'h1 h2 h3 h4 h5 h6 table ul ol blockquote div tr p div li td': { propertiesOnly: !0, attributes: 'dir' } }, requiredContent: 'p[dir]', refresh: function (a, d) { - var b = a.config.useComputedState; var c; var b = void 0 === b || b; - - if (!b) { - c = d.lastElement; for (var h = a.editable(); c && !(c.getName() in u || c.equals(h));) { - var e = c.getParent(); - - if (!e) { - break; - } c = e; - } - }c = c || d.block || d.blockLimit; c.equals(a.editable()) && (h = a.getSelection().getRanges()[0].getEnclosedNode()) && h.type == CKEDITOR.NODE_ELEMENT && (c = h); c && (b = b ? c.getComputedStyle('direction') : - c.getStyle('direction') || c.getAttribute('dir'), a.getCommand('bidirtl').setState(b == 'rtl' ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF), a.getCommand('bidiltr').setState(b == 'ltr' ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF)); b = (d.block || d.blockLimit || a.editable()).getDirection(1); b != (a._.selDir || a.lang.dir) && (a._.selDir = b, a.fire('contentDirChanged', b)); - }, exec: function (f) { - var d = f.getSelection(); var b = f.config.enterMode; var c = d.getRanges(); - - if (c && c.length) { - for (var h = {}, e = d.createBookmarks(), c = c.createIterator(), g, - l = 0; g = c.getNextRange(1);) { - var k = g.getEnclosedNode(); - - k && (!k || k.type == CKEDITOR.NODE_ELEMENT && k.getName() in r) || (k = v(g, t, b)); k && q(k, a, f, h); var m = new CKEDITOR.dom.walker(g); var n = e[l].startNode; var p = e[l++].endNode; - - m.evaluator = function (a) { - var c = b == CKEDITOR.ENTER_P ? 'p' : 'div'; var d; - - if (d = (a ? a.type == CKEDITOR.NODE_ELEMENT : !1) && a.getName() in t) { - if (c = a.is(c)) { - c = (c = a.getParent()) ? c.type == CKEDITOR.NODE_ELEMENT : !1; - }d = !(c && a.getParent().is('blockquote')); - } return !!(d && a.getPosition(n) & CKEDITOR.POSITION_FOLLOWING && (a.getPosition(p) & -CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_CONTAINS) == CKEDITOR.POSITION_PRECEDING); - }; for (;k = m.next();) { - q(k, a, f, h); - }g = g.createIterator(); for (g.enlargeBr = b != CKEDITOR.ENTER_BR; k = g.getNextParagraph(b == CKEDITOR.ENTER_P ? 'p' : 'div');) { - q(k, a, f, h); - } - }CKEDITOR.dom.element.clearAllMarkers(h); f.forceNextSelectionCheck(); d.selectBookmarks(e); f.focus(); - } - } }; - } function w(a) { - var f = a == l.setAttribute; var d = a == l.removeAttribute; var b = /\bdirection\s*:\s*(.*?)\s*(:?$|;)/; - - return function (c, h) { - if (!this.isReadOnly()) { - var e; - - if (e = c == (f || d ? - 'dir' : 'direction') || c == 'style' && (d || b.test(h))) { - a: { - e = this; for (var g = e.getDocument().getBody().getParent(); e;) { - if (e.equals(g)) { - e = !1; break a; - }e = e.getParent(); - }e = !0; - }e = !e; - } if (e && (e = this.getDirection(1), g = a.apply(this, arguments), e != this.getDirection(1))) { - return this.getDocument().fire('dirChanged', this), g; - } - } return a.apply(this, arguments); - }; - } var t = { table: 1, ul: 1, ol: 1, blockquote: 1, div: 1 }; var r = {}; var u = {}; - - CKEDITOR.tools.extend(r, t, { tr: 1, p: 1, div: 1, li: 1 }); CKEDITOR.tools.extend(u, r, { td: 1 }); CKEDITOR.plugins.add('bidi', { init: function (a) { - function f(b, - c, d, e, f) { - a.addCommand(d, new CKEDITOR.command(a, e)); a.ui.addButton && a.ui.addButton(b, { label: c, command: d, toolbar: 'bidi,' + f }); - } if (!a.blockless) { - var d = a.lang.bidi; - - f('BidiLtr', d.ltr, 'bidiltr', p('ltr'), 10); f('BidiRtl', d.rtl, 'bidirtl', p('rtl'), 20); a.on('contentDom', function () { - a.document.on('dirChanged', function (b) { - a.fire('dirChanged', { node: b.data, dir: b.data.getDirection(1) }); - }); - }); a.on('contentDirChanged', function (b) { - b = (a.lang.dir != b.data ? 'add' : 'remove') + 'Class'; var c = a.ui.space(a.config.toolbarLocation); - - if (c) { - c[b]('cke_mixed_dir_content'); - } - }); - } - } }); - for (var l = CKEDITOR.dom.element.prototype, n = ['setStyle', 'removeStyle', 'setAttribute', 'removeAttribute'], m = 0; m < n.length; m++) { - l[n[m]] = CKEDITOR.tools.override(l[n[m]], w); - } - })(); (function () { - var m = { exec: function (g) { - var a = g.getCommand('blockquote').state; var k = g.getSelection(); var c = k && k.getRanges()[0]; - - if (c) { - var h = k.createBookmarks(); - - if (CKEDITOR.env.ie) { - var e = h[0].startNode; var b = h[0].endNode; var d; - - if (e && e.getParent().getName() == 'blockquote') { - for (d = e; d = d.getNext();) { - if (d.type == CKEDITOR.NODE_ELEMENT && d.isBlockBoundary()) { - e.move(d, !0); break; - } - } - } if (b && b.getParent().getName() == 'blockquote') { - for (d = b; d = d.getPrevious();) { - if (d.type == CKEDITOR.NODE_ELEMENT && d.isBlockBoundary()) { - b.move(d); break; - } - } - } - } var f = c.createIterator(); - - f.enlargeBr = g.config.enterMode != CKEDITOR.ENTER_BR; if (a == CKEDITOR.TRISTATE_OFF) { - for (e = []; a = f.getNextParagraph();) { - e.push(a); - }e.length < 1 && (a = g.document.createElement(g.config.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div'), b = h.shift(), c.insertNode(a), a.append(new CKEDITOR.dom.text('', g.document)), c.moveToBookmark(b), c.selectNodeContents(a), c.collapse(!0), b = c.createBookmark(), e.push(a), h.unshift(b)); d = e[0].getParent(); c = []; for (b = 0; b < e.length; b++) { - a = e[b], d = d.getCommonAncestor(a.getParent()); - } for (a = { table: 1, tbody: 1, - tr: 1, ol: 1, ul: 1 }; a[d.getName()];) { - d = d.getParent(); - } for (b = null; e.length > 0;) { - for (a = e.shift(); !a.getParent().equals(d);) { - a = a.getParent(); - }a.equals(b) || c.push(a); b = a; - } for (;c.length > 0;) { - if (a = c.shift(), a.getName() == 'blockquote') { - for (b = new CKEDITOR.dom.documentFragment(g.document); a.getFirst();) { - b.append(a.getFirst().remove()), e.push(b.getLast()); - }b.replace(a); - } else { - e.push(a); - } - }c = g.document.createElement('blockquote'); for (c.insertBefore(e[0]); e.length > 0;) { - a = e.shift(), c.append(a); - } - } else if (a == CKEDITOR.TRISTATE_ON) { - b = []; - for (d = {}; a = f.getNextParagraph();) { - for (e = c = null; a.getParent();) { - if (a.getParent().getName() == 'blockquote') { - c = a.getParent(); e = a; break; - }a = a.getParent(); - }c && e && !e.getCustomData('blockquote_moveout') && (b.push(e), CKEDITOR.dom.element.setMarker(d, e, 'blockquote_moveout', !0)); - }CKEDITOR.dom.element.clearAllMarkers(d); a = []; e = []; for (d = {}; b.length > 0;) { - f = b.shift(), c = f.getParent(), f.getPrevious() ? f.getNext() ? (f.breakParent(f.getParent()), e.push(f.getNext())) : f.remove().insertAfter(c) : f.remove().insertBefore(c), c.getCustomData('blockquote_processed') || -(e.push(c), CKEDITOR.dom.element.setMarker(d, c, 'blockquote_processed', !0)), a.push(f); - }CKEDITOR.dom.element.clearAllMarkers(d); for (b = e.length - 1; b >= 0; b--) { - c = e[b]; a: { - d = c; for (var f = 0, m = d.getChildCount(), l = void 0; f < m && (l = d.getChild(f)); f++) { - if (l.type == CKEDITOR.NODE_ELEMENT && l.isBlockBoundary()) { - d = !1; break a; - } - }d = !0; - }d && c.remove(); - } if (g.config.enterMode == CKEDITOR.ENTER_BR) { - for (c = !0; a.length;) { - if (f = a.shift(), f.getName() == 'div') { - b = new CKEDITOR.dom.documentFragment(g.document); !c || !f.getPrevious() || f.getPrevious().type == -CKEDITOR.NODE_ELEMENT && f.getPrevious().isBlockBoundary() || b.append(g.document.createElement('br')); for (c = f.getNext() && !(f.getNext().type == CKEDITOR.NODE_ELEMENT && f.getNext().isBlockBoundary()); f.getFirst();) { - f.getFirst().remove().appendTo(b); - }c && b.append(g.document.createElement('br')); b.replace(f); c = !1; - } - } - } - }k.selectBookmarks(h); g.focus(); - } - }, refresh: function (g, a) { - this.setState(g.elementPath(a.block || a.blockLimit).contains('blockquote', 1) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF); - }, context: 'blockquote', allowedContent: 'blockquote', - requiredContent: 'blockquote' }; - - CKEDITOR.plugins.add('blockquote', { init: function (g) { - g.blockless || (g.addCommand('blockquote', m), g.ui.addButton && g.ui.addButton('Blockquote', { label: g.lang.blockquote.toolbar, command: 'blockquote', toolbar: 'blocks,10' })); - } }); - })(); (function () { - function q(b, a) { - CKEDITOR.tools.extend(this, a, { editor: b, id: 'cke-' + CKEDITOR.tools.getUniqueId(), area: b._.notificationArea }); a.type || (this.type = 'info'); this.element = this._createElement(); b.plugins.clipboard && CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(this.element); - } function r(b) { - var a = this; - - this.editor = b; this.notifications = []; this.element = this._createElement(); this._uiBuffer = CKEDITOR.tools.eventsBuffer(10, this._layout, this); this._changeBuffer = CKEDITOR.tools.eventsBuffer(500, this._layout, - this); b.on('destroy', function () { - a._removeListeners(); a.element.remove(); - }); - }CKEDITOR.plugins.add('notification', { init: function (b) { - function a(b) { - var a = new CKEDITOR.dom.element('div'); - - a.setStyles({ 'position': 'fixed', 'margin-left': '-9999px' }); a.setAttributes({ 'aria-live': 'assertive', 'aria-atomic': 'true' }); a.setText(b); CKEDITOR.document.getBody().append(a); setTimeout(function () { - a.remove(); - }, 100); - }b._.notificationArea = new r(b); b.showNotification = function (a, d, e) { - var f; var l; - - d == 'progress' ? f = e : l = e; a = new CKEDITOR.plugins.notification(b, - { message: a, type: d, progress: f, duration: l }); a.show(); return a; - }; b.on('key', function (c) { - if (c.data.keyCode == 27) { - var d = b._.notificationArea.notifications; - - d.length && (a(b.lang.notification.closed), d[d.length - 1].hide(), c.cancel()); - } - }); - } }); q.prototype = { show: function () { - !1 !== this.editor.fire('notificationShow', { notification: this }) && (this.area.add(this), this._hideAfterTimeout()); - }, update: function (b) { - var a = !0; - - !1 === this.editor.fire('notificationUpdate', { notification: this, options: b }) && (a = !1); var c = this.element; var d = c.findOne('.cke_notification_message'); - var e = c.findOne('.cke_notification_progress'); var f = b.type; - - c.removeAttribute('role'); b.progress && this.type != 'progress' && (f = 'progress'); f && (c.removeClass(this._getClass()), c.removeAttribute('aria-label'), this.type = f, c.addClass(this._getClass()), c.setAttribute('aria-label', this.type), this.type != 'progress' || e ? this.type != 'progress' && e && e.remove() : (e = this._createProgressElement(), e.insertBefore(d))); void 0 !== b.message && (this.message = b.message, d.setHtml(this.message)); void 0 !== b.progress && (this.progress = b.progress, - e && e.setStyle('width', this._getPercentageProgress())); a && b.important && (c.setAttribute('role', 'alert'), this.isVisible() || this.area.add(this)); this.duration = b.duration; this._hideAfterTimeout(); - }, hide: function () { - !1 !== this.editor.fire('notificationHide', { notification: this }) && this.area.remove(this); - }, isVisible: function () { - return CKEDITOR.tools.indexOf(this.area.notifications, this) >= 0; - }, _createElement: function () { - var b = this; var a; var c; var d = this.editor.lang.common.close; - - a = new CKEDITOR.dom.element('div'); a.addClass('cke_notification'); - a.addClass(this._getClass()); a.setAttributes({ 'id': this.id, 'role': 'alert', 'aria-label': this.type }); this.type == 'progress' && a.append(this._createProgressElement()); c = new CKEDITOR.dom.element('p'); c.addClass('cke_notification_message'); c.setHtml(this.message); a.append(c); c = CKEDITOR.dom.element.createFromHtml('\x3ca class\x3d"cke_notification_close" href\x3d"javascript:void(0)" title\x3d"' + d + '" role\x3d"button" tabindex\x3d"-1"\x3e\x3cspan class\x3d"cke_label"\x3eX\x3c/span\x3e\x3c/a\x3e'); a.append(c); c.on('click', - function () { - b.editor.focus(); b.hide(); - }); return a; - }, _getClass: function () { - return this.type == 'progress' ? 'cke_notification_info' : 'cke_notification_' + this.type; - }, _createProgressElement: function () { - var b = new CKEDITOR.dom.element('span'); - - b.addClass('cke_notification_progress'); b.setStyle('width', this._getPercentageProgress()); return b; - }, _getPercentageProgress: function () { - return Math.round(100 * (this.progress || 0)) + '%'; - }, _hideAfterTimeout: function () { - var b = this; var a; - - this._hideTimeoutId && clearTimeout(this._hideTimeoutId); - if (typeof this.duration === 'number') { - a = this.duration; - } else if (this.type == 'info' || this.type == 'success') { - a = typeof this.editor.config.notification_duration === 'number' ? this.editor.config.notification_duration : 5E3; - }a && (b._hideTimeoutId = setTimeout(function () { - b.hide(); - }, a)); - } }; r.prototype = { add: function (b) { - this.notifications.push(b); this.element.append(b.element); this.element.getChildCount() == 1 && (CKEDITOR.document.getBody().append(this.element), this._attachListeners()); this._layout(); - }, remove: function (b) { - var a = CKEDITOR.tools.indexOf(this.notifications, - b); - - a < 0 || (this.notifications.splice(a, 1), b.element.remove(), this.element.getChildCount() || (this._removeListeners(), this.element.remove())); - }, _createElement: function () { - var b = this.editor; var a = b.config; var c = new CKEDITOR.dom.element('div'); - - c.addClass('cke_notifications_area'); c.setAttribute('id', 'cke_notifications_area_' + b.name); c.setStyle('z-index', a.baseFloatZIndex - 2); return c; - }, _attachListeners: function () { - var b = CKEDITOR.document.getWindow(); var a = this.editor; - - b.on('scroll', this._uiBuffer.input); b.on('resize', this._uiBuffer.input); - a.on('change', this._changeBuffer.input); a.on('floatingSpaceLayout', this._layout, this, null, 20); a.on('blur', this._layout, this, null, 20); - }, _removeListeners: function () { - var b = CKEDITOR.document.getWindow(); var a = this.editor; - - b.removeListener('scroll', this._uiBuffer.input); b.removeListener('resize', this._uiBuffer.input); a.removeListener('change', this._changeBuffer.input); a.removeListener('floatingSpaceLayout', this._layout); a.removeListener('blur', this._layout); - }, _layout: function () { - function b() { - a.setStyle('left', - k(n + d.width - g - h)); - } var a = this.element; var c = this.editor; var d = c.ui.contentsElement.getClientRect(); var e = c.ui.contentsElement.getDocumentPosition(); var f; var l; var u = a.getClientRect(); var m; var g = this._notificationWidth; var h = this._notificationMargin; - - m = CKEDITOR.document.getWindow(); var p = m.getScrollPosition(); var t = m.getViewPaneSize(); var q = CKEDITOR.document.getBody(); var r = q.getDocumentPosition(); var k = CKEDITOR.tools.cssLength; - - g && h || (m = this.element.getChild(0), g = this._notificationWidth = m.getClientRect().width, h = this._notificationMargin = parseInt(m.getComputedStyle('margin-left'), - 10) + parseInt(m.getComputedStyle('margin-right'), 10)); c.toolbar && (f = c.ui.space(c.config.toolbarLocation), l = f.getClientRect()); f && f.isVisible() && l.bottom > d.top && l.bottom < d.bottom - u.height ? a.setStyles({ position: 'fixed', top: k(l.bottom) }) : d.top > 0 ? a.setStyles({ position: 'absolute', top: k(e.y) }) : e.y + d.height - u.height > p.y ? a.setStyles({ position: 'fixed', top: 0 }) : a.setStyles({ position: 'absolute', top: k(e.y + d.height - u.height) }); var n = a.getStyle('position') == 'fixed' ? d.left : q.getComputedStyle('position') != 'static' ? - e.x - r.x : e.x; - - d.width < g + h ? e.x + g + h > p.x + t.width ? b() : a.setStyle('left', k(n)) : e.x + g + h > p.x + t.width ? a.setStyle('left', k(n)) : e.x + d.width / 2 + g / 2 + h > p.x + t.width ? a.setStyle('left', k(n - e.x + p.x + t.width - g - h)) : d.left + d.width - g - h < 0 ? b() : d.left + d.width / 2 - g / 2 < 0 ? a.setStyle('left', k(n - e.x + p.x)) : a.setStyle('left', k(n + d.width / 2 - g / 2 - h / 2)); - } }; CKEDITOR.plugins.notification = q; - })(); (function () { - var c = '\x3ca id\x3d"{id}" class\x3d"cke_button cke_button__{name} cke_button_{state} {cls}"' + (CKEDITOR.env.gecko && !CKEDITOR.env.hc ? '' : " href\x3d\"javascript:void('{titleJs}')\"") + ' title\x3d"{title}" tabindex\x3d"-1" hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasArrow}" aria-disabled\x3d"{ariaDisabled}"'; - - CKEDITOR.env.gecko && CKEDITOR.env.mac && (c += ' onkeypress\x3d"return false;"'); CKEDITOR.env.gecko && (c += -' onblur\x3d"this.style.cssText \x3d this.style.cssText;"'); var k = ''; - - CKEDITOR.env.ie && (k = 'return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26'); var c = c + (' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" onclick\x3d"' + k + 'CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{style}"') + -'\x3e\x26nbsp;\x3c/span\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_button_label cke_button__{name}_label" aria-hidden\x3d"false"\x3e{label}\x3c/span\x3e\x3cspan id\x3d"{id}_description" class\x3d"cke_button_label" aria-hidden\x3d"false"\x3e{ariaShortcut}\x3c/span\x3e{arrowHtml}\x3c/a\x3e'; var v = CKEDITOR.addTemplate('buttonArrow', '\x3cspan class\x3d"cke_button_arrow"\x3e' + (CKEDITOR.env.hc ? '\x26#9660;' : '') + '\x3c/span\x3e'); var w = CKEDITOR.addTemplate('button', c); - - CKEDITOR.plugins.add('button', { beforeInit: function (a) { - a.ui.addHandler(CKEDITOR.UI_BUTTON, - CKEDITOR.ui.button.handler); - } }); CKEDITOR.UI_BUTTON = 'button'; CKEDITOR.ui.button = function (a) { - CKEDITOR.tools.extend(this, a, { title: a.label, click: a.click || function (b) { - b.execCommand(a.command); - } }); this._ = {}; - }; CKEDITOR.ui.button.handler = { create: function (a) { - return new CKEDITOR.ui.button(a); - } }; CKEDITOR.ui.button.prototype = { render: function (a, b) { - function c() { - var f = a.mode; - - f && (f = this.modes[f] ? void 0 !== p[f] ? p[f] : CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, f = a.readOnly && !this.readOnly ? CKEDITOR.TRISTATE_DISABLED : - f, this.setState(f), this.refresh && this.refresh()); - } var p = null; var q = CKEDITOR.env; var r = this._.id = CKEDITOR.tools.getNextId(); var g = ''; var d = this.command; var k; var l; var m; - - this._.editor = a; var e = { id: r, button: this, editor: a, focus: function () { - CKEDITOR.document.getById(r).focus(); - }, execute: function () { - this.button.click(a); - }, attach: function (a) { - this.button.attach(a); - } }; var x = CKEDITOR.tools.addFunction(function (a) { - if (e.onkey) { - return a = new CKEDITOR.dom.event(a), !1 !== e.onkey(e, a.getKeystroke()); - } - }); var y = CKEDITOR.tools.addFunction(function (a) { - var b; - - e.onfocus && -(b = !1 !== e.onfocus(e, new CKEDITOR.dom.event(a))); return b; - }); var u = 0; - - e.clickFn = k = CKEDITOR.tools.addFunction(function () { - u && (a.unlockSelection(1), u = 0); e.execute(); q.iOS && a.focus(); - }); this.modes ? (p = {}, a.on('beforeModeUnload', function () { - a.mode && this._.state != CKEDITOR.TRISTATE_DISABLED && (p[a.mode] = this._.state); - }, this), a.on('activeFilterChange', c, this), a.on('mode', c, this), !this.readOnly && a.on('readOnly', c, this)) : d && (d = a.getCommand(d)) && (d.on('state', function () { - this.setState(d.state); - }, this), g += d.state == CKEDITOR.TRISTATE_ON ? - 'on' : d.state == CKEDITOR.TRISTATE_DISABLED ? 'disabled' : 'off'); var n; - - if (this.directional) { - a.on('contentDirChanged', function (b) { - var c = CKEDITOR.document.getById(this._.id); var d = c.getFirst(); - - b = b.data; b != a.lang.dir ? c.addClass('cke_' + b) : c.removeClass('cke_ltr').removeClass('cke_rtl'); d.setAttribute('style', CKEDITOR.skin.getIconStyle(n, b == 'rtl', this.icon, this.iconOffset)); - }, this); - }d ? (l = a.getCommandKeystroke(d)) && (m = CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard, l)) : g += 'off'; l = this.name || this.command; var h = -null; var t = this.icon; - - n = l; this.icon && !(/\./).test(this.icon) ? (n = this.icon, t = null) : (this.icon && (h = this.icon), CKEDITOR.env.hidpi && this.iconHiDpi && (h = this.iconHiDpi)); h ? (CKEDITOR.skin.addIcon(h, h), t = null) : h = n; g = { id: r, name: l, iconName: n, label: this.label, cls: (this.hasArrow ? 'cke_button_expandable ' : '') + (this.className || ''), state: g, ariaDisabled: g == 'disabled' ? 'true' : 'false', title: this.title + (m ? ' (' + m.display + ')' : ''), ariaShortcut: m ? a.lang.common.keyboardShortcut + ' ' + m.aria : '', titleJs: q.gecko && !q.hc ? '' : (this.title || -'').replace("'", ''), hasArrow: typeof this.hasArrow === 'string' && this.hasArrow || (this.hasArrow ? 'true' : 'false'), keydownFn: x, focusFn: y, clickFn: k, style: CKEDITOR.skin.getIconStyle(h, a.lang.dir == 'rtl', t, this.iconOffset), arrowHtml: this.hasArrow ? v.output() : '' }; w.output(g, b); if (this.onRender) { - this.onRender(); - } return e; - }, setState: function (a) { - if (this._.state == a) { - return !1; - } this._.state = a; var b = CKEDITOR.document.getById(this._.id); - - return b ? (b.setState(a, 'cke_button'), b.setAttribute('aria-disabled', a == CKEDITOR.TRISTATE_DISABLED), - this.hasArrow ? b.setAttribute('aria-expanded', a == CKEDITOR.TRISTATE_ON) : a === CKEDITOR.TRISTATE_ON ? b.setAttribute('aria-pressed', !0) : b.removeAttribute('aria-pressed'), !0) : !1; - }, getState: function () { - return this._.state; - }, toFeature: function (a) { - if (this._.feature) { - return this._.feature; - } var b = this; - - this.allowedContent || this.requiredContent || !this.command || (b = a.getCommand(this.command) || b); return this._.feature = b; - } }; CKEDITOR.ui.prototype.addButton = function (a, b) { - this.add(a, CKEDITOR.UI_BUTTON, b); - }; - })(); (function () { - function D(a) { - function d() { - for (var b = f(), e = CKEDITOR.tools.clone(a.config.toolbarGroups) || v(a), n = 0; n < e.length; n++) { - var g = e[n]; - - if (g != '/') { - typeof g === 'string' && (g = e[n] = { name: g }); var l; var d = g.groups; - - if (d) { - for (var h = 0; h < d.length; h++) { - l = d[h], (l = b[l]) && c(g, l); - } - }(l = b[g.name]) && c(g, l); - } - } return e; - } function f() { - var b = {}; var c; var e; var g; - - for (c in a.ui.items) { - e = a.ui.items[c], g = e.toolbar || 'others', g = g.split(','), e = g[0], g = parseInt(g[1] || -1, 10), b[e] || (b[e] = []), b[e].push({ name: c, order: g }); - } for (e in b) { - b[e] = b[e].sort(function (b, - a) { - return b.order == a.order ? 0 : a.order < 0 ? -1 : b.order < 0 ? 1 : b.order < a.order ? -1 : 1; - }); - } return b; - } function c(c, e) { - if (e.length) { - c.items ? c.items.push(a.ui.create('-')) : c.items = []; for (var d; d = e.shift();) { - d = typeof d === 'string' ? d : d.name, b && CKEDITOR.tools.indexOf(b, d) != -1 || (d = a.ui.create(d)) && a.addFeature(d) && c.items.push(d); - } - } - } function h(b) { - var a = []; var e; var d; var h; - - for (e = 0; e < b.length; ++e) { - d = b[e], h = {}, d == '/' ? a.push(d) : CKEDITOR.tools.isArray(d) ? (c(h, CKEDITOR.tools.clone(d)), a.push(h)) : d.items && (c(h, CKEDITOR.tools.clone(d.items)), - h.name = d.name, a.push(h)); - } return a; - } var b = a.config.removeButtons; var b = b && b.split(','); var e = a.config.toolbar; - - typeof e === 'string' && (e = a.config['toolbar_' + e]); return a.toolbar = e ? h(e) : d(); - } function v(a) { - return a._.toolbarGroups || (a._.toolbarGroups = [{ name: 'document', groups: ['mode', 'document', 'doctools'] }, { name: 'clipboard', groups: ['clipboard', 'undo'] }, { name: 'editing', groups: ['find', 'selection', 'spellchecker'] }, { name: 'forms' }, '/', { name: 'basicstyles', groups: ['basicstyles', 'cleanup'] }, { name: 'paragraph', groups: ['list', - 'indent', 'blocks', 'align', 'bidi'] }, { name: 'links' }, { name: 'insert' }, '/', { name: 'styles' }, { name: 'colors' }, { name: 'tools' }, { name: 'others' }, { name: 'about' }]); - } var z = function () { - this.toolbars = []; this.focusCommandExecuted = !1; - }; - - z.prototype.focus = function () { - for (var a = 0, d; d = this.toolbars[a++];) { - for (var f = 0, c; c = d.items[f++];) { - if (c.focus) { - c.focus(); return; - } - } - } - }; var E = { modes: { wysiwyg: 1, source: 1 }, readOnly: 1, exec: function (a) { - a.toolbox && (a.toolbox.focusCommandExecuted = !0, CKEDITOR.env.ie || CKEDITOR.env.air ? setTimeout(function () { - a.toolbox.focus(); - }, - 100) : a.toolbox.focus()); - } }; - - CKEDITOR.plugins.add('toolbar', { requires: 'button', init: function (a) { - var d; var f = function (c, h) { - var b; var e = a.lang.dir == 'rtl'; var k = a.config.toolbarGroupCycling; var q = e ? 37 : 39; var e = e ? 39 : 37; var k = void 0 === k || k; - - switch (h) { - case 9:case CKEDITOR.SHIFT + 9:for (;!b || !b.items.length;) { - if (b = h == 9 ? (b ? b.next : c.toolbar.next) || a.toolbox.toolbars[0] : (b ? b.previous : c.toolbar.previous) || a.toolbox.toolbars[a.toolbox.toolbars.length - 1], b.items.length) { - for (c = b.items[d ? b.items.length - 1 : 0]; c && !c.focus;) { - (c = d ? c.previous : c.next) || -(b = 0); - } - } - }c && c.focus(); return !1; case q:b = c; do { - b = b.next, !b && k && (b = c.toolbar.items[0]); - } while (b && !b.focus); b ? b.focus() : f(c, 9); return !1; case 40:return c.button && c.button.hasArrow ? c.execute() : f(c, h == 40 ? q : e), !1; case e:case 38:b = c; do { - b = b.previous, !b && k && (b = c.toolbar.items[c.toolbar.items.length - 1]); - } while (b && !b.focus); b ? b.focus() : (d = 1, f(c, CKEDITOR.SHIFT + 9), d = 0); return !1; case 27:return a.focus(), !1; case 13:case 32:return c.execute(), !1; - } return !0; - }; - - a.on('uiSpace', function (c) { - if (c.data.space == a.config.toolbarLocation) { - c.removeListener(); - a.toolbox = new z(); var d = CKEDITOR.tools.getNextId(); var b = ['\x3cspan id\x3d"', d, '" class\x3d"cke_voice_label"\x3e', a.lang.toolbar.toolbars, '\x3c/span\x3e', '\x3cspan id\x3d"' + a.ui.spaceId('toolbox') + '" class\x3d"cke_toolbox" role\x3d"group" aria-labelledby\x3d"', d, '" onmousedown\x3d"return false;"\x3e']; var d = !1 !== a.config.toolbarStartupExpanded; var e; var k; - - a.config.toolbarCanCollapse && a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE && b.push('\x3cspan class\x3d"cke_toolbox_main"' + (d ? '\x3e' : ' style\x3d"display:none"\x3e')); - for (var q = a.toolbox.toolbars, n = D(a), g = n.length, l = 0; l < g; l++) { - var r; var m = 0; var w; var p = n[l]; var v = p !== '/' && (n[l + 1] === '/' || l == g - 1); var x; - - if (p) { - if (e && (b.push('\x3c/span\x3e'), k = e = 0), p === '/') { - b.push('\x3cspan class\x3d"cke_toolbar_break"\x3e\x3c/span\x3e'); - } else { - x = p.items || p; for (var y = 0; y < x.length; y++) { - var t = x[y]; var A; - - if (t) { - var B = function (c) { - c = c.render(a, b); u = m.items.push(c) - 1; u > 0 && (c.previous = m.items[u - 1], c.previous.next = c); c.toolbar = m; c.onkey = f; c.onfocus = function () { - a.toolbox.focusCommandExecuted || a.focus(); - }; - }; - - if (t.type == CKEDITOR.UI_SEPARATOR) { - k = -e && t; - } else { - A = !1 !== t.canGroup; if (!m) { - r = CKEDITOR.tools.getNextId(); m = { id: r, items: [] }; w = p.name && (a.lang.toolbar.toolbarGroups[p.name] || p.name); b.push('\x3cspan id\x3d"', r, '" class\x3d"cke_toolbar' + (v ? ' cke_toolbar_last"' : '"'), w ? ' aria-labelledby\x3d"' + r + '_label"' : '', ' role\x3d"toolbar"\x3e'); w && b.push('\x3cspan id\x3d"', r, '_label" class\x3d"cke_voice_label"\x3e', w, '\x3c/span\x3e'); b.push('\x3cspan class\x3d"cke_toolbar_start"\x3e\x3c/span\x3e'); var u = q.push(m) - 1; - - u > 0 && (m.previous = q[u - 1], m.previous.next = -m); - }A ? e || (b.push('\x3cspan class\x3d"cke_toolgroup" role\x3d"presentation"\x3e'), e = 1) : e && (b.push('\x3c/span\x3e'), e = 0); k && (B(k), k = 0); B(t); - } - } - }e && (b.push('\x3c/span\x3e'), k = e = 0); m && b.push('\x3cspan class\x3d"cke_toolbar_end"\x3e\x3c/span\x3e\x3c/span\x3e'); - } - } - }a.config.toolbarCanCollapse && b.push('\x3c/span\x3e'); if (a.config.toolbarCanCollapse && a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) { - var C = CKEDITOR.tools.addFunction(function () { - a.execCommand('toolbarCollapse'); - }); - - a.on('destroy', function () { - CKEDITOR.tools.removeFunction(C); - }); - a.addCommand('toolbarCollapse', { readOnly: 1, exec: function (b) { - var a = b.ui.space('toolbar_collapser'); var c = a.getPrevious(); var d = b.ui.space('contents'); var e = c.getParent(); var h = parseInt(d.$.style.height, 10); var g = e.$.offsetHeight; var f = a.hasClass('cke_toolbox_collapser_min'); - - f ? (c.show(), a.removeClass('cke_toolbox_collapser_min'), a.setAttribute('title', b.lang.toolbar.toolbarCollapse)) : (c.hide(), a.addClass('cke_toolbox_collapser_min'), a.setAttribute('title', b.lang.toolbar.toolbarExpand)); a.getFirst().setText(f ? '▲' : '◀'); d.setStyle('height', - h - (e.$.offsetHeight - g) + 'px'); b.fire('resize', { outerHeight: b.container.$.offsetHeight, contentsHeight: d.$.offsetHeight, outerWidth: b.container.$.offsetWidth }); - }, modes: { wysiwyg: 1, source: 1 } }); a.setKeystroke(CKEDITOR.ALT + (CKEDITOR.env.ie || CKEDITOR.env.webkit ? 189 : 109), 'toolbarCollapse'); b.push('\x3ca title\x3d"' + (d ? a.lang.toolbar.toolbarCollapse : a.lang.toolbar.toolbarExpand) + '" id\x3d"' + a.ui.spaceId('toolbar_collapser') + '" tabIndex\x3d"-1" class\x3d"cke_toolbox_collapser'); d || b.push(' cke_toolbox_collapser_min'); - b.push('" onclick\x3d"CKEDITOR.tools.callFunction(' + C + ')"\x3e', '\x3cspan class\x3d"cke_arrow"\x3e\x26#9650;\x3c/span\x3e', '\x3c/a\x3e'); - }b.push('\x3c/span\x3e'); c.data.html += b.join(''); - } - }); a.on('destroy', function () { - if (this.toolbox) { - var a; var d = 0; var b; var e; var f; - - for (a = this.toolbox.toolbars; d < a.length; d++) { - for (e = a[d].items, b = 0; b < e.length; b++) { - f = e[b], f.clickFn && CKEDITOR.tools.removeFunction(f.clickFn), f.keyDownFn && CKEDITOR.tools.removeFunction(f.keyDownFn); - } - } - } - }); a.on('uiReady', function () { - var c = a.ui.space('toolbox'); - - c && a.focusManager.add(c, - 1); - }); a.addCommand('toolbarFocus', E); a.setKeystroke(CKEDITOR.ALT + 121, 'toolbarFocus'); a.ui.add('-', CKEDITOR.UI_SEPARATOR, {}); a.ui.addHandler(CKEDITOR.UI_SEPARATOR, { create: function () { - return { render: function (a, d) { - d.push('\x3cspan class\x3d"cke_toolbar_separator" role\x3d"separator"\x3e\x3c/span\x3e'); return {}; - } }; - } }); - } }); CKEDITOR.ui.prototype.addToolbarGroup = function (a, d, f) { - var c = v(this.editor); var h = d === 0; var b = { name: a }; - - if (f) { - if (f = CKEDITOR.tools.search(c, function (a) { - return a.name == f; - })) { - !f.groups && (f.groups = []); if (d && -(d = CKEDITOR.tools.indexOf(f.groups, d), d >= 0)) { - f.groups.splice(d + 1, 0, a); return; - }h ? f.groups.splice(0, 0, a) : f.groups.push(a); return; - }d = null; - }d && (d = CKEDITOR.tools.indexOf(c, function (a) { - return a.name == d; - })); h ? c.splice(0, 0, a) : typeof d === 'number' ? c.splice(d + 1, 0, b) : c.push(a); - }; - })(); CKEDITOR.UI_SEPARATOR = 'separator'; CKEDITOR.config.toolbarLocation = 'top'; (function () { - function r(a, b, c) { - b.type || (b.type = 'auto'); if (c && !1 === a.fire('beforePaste', b) || !b.dataValue && b.dataTransfer.isEmpty()) { - return !1; - } b.dataValue || (b.dataValue = ''); if (CKEDITOR.env.gecko && b.method == 'drop' && a.toolbox) { - a.once('afterPaste', function () { - a.toolbox.focus(); - }); - } return a.fire('paste', b); - } function x(a) { - function b() { - var b = a.editable(); - - if (CKEDITOR.plugins.clipboard.isCustomCopyCutSupported) { - var c = function (b) { - a.getSelection().isCollapsed() || (a.readOnly && b.name == 'cut' || p.initPasteDataTransfer(b, - a), b.data.preventDefault()); - }; - - b.on('copy', c); b.on('cut', c); b.on('cut', function () { - a.readOnly || a.extractSelectedHtml(); - }, null, null, 999); - }b.on(p.mainPasteEvent, function (a) { - p.mainPasteEvent == 'beforepaste' && n || k(a); - }); p.mainPasteEvent == 'beforepaste' && (b.on('paste', function (a) { - v || (f(), a.data.preventDefault(), k(a), e('paste')); - }), b.on('contextmenu', h, null, null, 0), b.on('beforepaste', function (a) { - !a.data || a.data.$.ctrlKey || a.data.$.shiftKey || h(); - }, null, null, 0)); b.on('beforecut', function () { - !n && g(a); - }); var d; - - b.attachListener(CKEDITOR.env.ie ? - b : a.document.getDocumentElement(), 'mouseup', function () { - d = setTimeout(u, 0); - }); a.on('destroy', function () { - clearTimeout(d); - }); b.on('keyup', u); - } function c(b) { - return { type: b, canUndo: b == 'cut', startDisabled: !0, fakeKeystroke: b == 'cut' ? CKEDITOR.CTRL + 88 : CKEDITOR.CTRL + 67, exec: function () { - this.type == 'cut' && g(); var b; var c = this.type; - - if (CKEDITOR.env.ie) { - b = e(c); - } else { - try { - b = a.document.$.execCommand(c, !1, null); - } catch (d) { - b = !1; - } - }b || a.showNotification(a.lang.clipboard[this.type + 'Error']); return b; - } }; - } function d() { - return { canUndo: !1, - async: !0, fakeKeystroke: CKEDITOR.CTRL + 86, exec: function (a, b) { - function c(b, g) { - g = typeof g !== 'undefined' ? g : !0; b ? (b.method = 'paste', b.dataTransfer || (b.dataTransfer = p.initPasteDataTransfer()), r(a, b, g)) : e && !a._.forcePasteDialog && a.showNotification(f, 'info', a.config.clipboard_notificationDuration); a._.forcePasteDialog = !1; a.fire('afterCommandExec', { name: 'paste', command: d, returnValue: !!b }); - }b = typeof b !== 'undefined' && b !== null ? b : {}; var d = this; var e = typeof b.notification !== 'undefined' ? b.notification : !0; var g = b.type; var m = CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard, - a.getCommandKeystroke(this)); var f = typeof e === 'string' ? e : a.lang.clipboard.pasteNotification.replace(/%1/, '\x3ckbd aria-label\x3d"' + m.aria + '"\x3e' + m.display + '\x3c/kbd\x3e'); var m = typeof b === 'string' ? b : b.dataValue; - - g && !0 !== a.config.forcePasteAsPlainText && a.config.forcePasteAsPlainText !== 'allow-word' ? a._.nextPasteType = g : delete a._.nextPasteType; typeof m === 'string' ? c({ dataValue: m }) : a.getClipboardData(c); - } }; - } function f() { - v = 1; setTimeout(function () { - v = 0; - }, 100); - } function h() { - n = 1; setTimeout(function () { - n = 0; - }, 10); - } function e(b) { - var c = -a.document; var d = c.getBody(); var e = !1; var g = function () { - e = !0; - }; - - d.on(b, g); CKEDITOR.env.version > 7 ? c.$.execCommand(b) : c.$.selection.createRange().execCommand(b); d.removeListener(b, g); return e; - } function g() { - if (CKEDITOR.env.ie && !CKEDITOR.env.quirks) { - var b = a.getSelection(); var c; var d; var e; - - b.getType() == CKEDITOR.SELECTION_ELEMENT && (c = b.getSelectedElement()) && (d = b.getRanges()[0], e = a.document.createText(''), e.insertBefore(c), d.setStartBefore(e), d.setEndAfter(c), b.selectRanges([d]), setTimeout(function () { - c.getParent() && (e.remove(), b.selectElement(c)); - }, - 0)); - } - } function l(b, c) { - var d = a.document; var e = a.editable(); var g = function (a) { - a.cancel(); - }; var m; - - if (!d.getById('cke_pastebin')) { - var f = a.getSelection(); var l = f.createBookmarks(); - - CKEDITOR.env.ie && f.root.fire('selectionchange'); var k = new CKEDITOR.dom.element(!CKEDITOR.env.webkit && !e.is('body') || CKEDITOR.env.ie ? 'div' : 'body', d); - - k.setAttributes({ 'id': 'cke_pastebin', 'data-cke-temp': '1' }); var h = 0; var d = d.getWindow(); - - CKEDITOR.env.webkit ? (e.append(k), k.addClass('cke_editable'), e.is('body') || (h = e.getComputedStyle('position') != 'static' ? - e : CKEDITOR.dom.element.get(e.$.offsetParent), h = h.getDocumentPosition().y)) : e.getAscendant(CKEDITOR.env.ie ? 'body' : 'html', 1).append(k); k.setStyles({ position: 'absolute', top: d.getScrollPosition().y - h + 10 + 'px', width: '1px', height: Math.max(1, d.getViewPaneSize().height - 20) + 'px', overflow: 'hidden', margin: 0, padding: 0 }); CKEDITOR.env.safari && k.setStyles(CKEDITOR.tools.cssVendorPrefix('user-select', 'text')); (h = k.getParent().isReadOnly()) ? (k.setOpacity(0), k.setAttribute('contenteditable', !0)) : k.setStyle(a.config.contentsLangDirection == 'ltr' ? - 'left' : 'right', '-10000px'); a.on('selectionChange', g, null, null, 0); if (CKEDITOR.env.webkit || CKEDITOR.env.gecko) { - m = e.once('blur', g, null, null, -100); - }h && k.focus(); h = new CKEDITOR.dom.range(k); h.selectNodeContents(k); var u = h.select(); - - CKEDITOR.env.ie && (m = e.once('blur', function () { - a.lockSelection(u); - })); var q = CKEDITOR.document.getWindow().getScrollPosition().y; - - setTimeout(function () { - CKEDITOR.env.webkit && (CKEDITOR.document.getBody().$.scrollTop = q); m && m.removeListener(); CKEDITOR.env.ie && e.focus(); f.selectBookmarks(l); - k.remove(); var b; - - CKEDITOR.env.webkit && (b = k.getFirst()) && b.is && b.hasClass('Apple-style-span') && (k = b); a.removeListener('selectionChange', g); c(k.getHtml()); - }, 0); - } - } function t() { - if (p.mainPasteEvent == 'paste') { - return a.fire('beforePaste', { type: 'auto', method: 'paste' }), !1; - } a.focus(); f(); var b = a.focusManager; - - b.lock(); if (a.editable().fire(p.mainPasteEvent) && !e('paste')) { - return b.unlock(), !1; - } b.unlock(); return !0; - } function m(b) { - if (a.mode == 'wysiwyg') { - switch (b.data.keyCode) { - case CKEDITOR.CTRL + 86:case CKEDITOR.SHIFT + 45:b = -a.editable(); f(); p.mainPasteEvent == 'paste' && b.fire('beforepaste'); break; case CKEDITOR.CTRL + 88:case CKEDITOR.SHIFT + 46:a.fire('saveSnapshot'), setTimeout(function () { - a.fire('saveSnapshot'); - }, 50); - } - } - } function k(b) { - var c = { type: 'auto', method: 'paste', dataTransfer: p.initPasteDataTransfer(b) }; - - c.dataTransfer.cacheData(); var e = !1 !== a.fire('beforePaste', c); - - e && p.canClipboardApiBeTrusted(c.dataTransfer, a) ? (b.data.preventDefault(), setTimeout(function () { - r(a, c); - }, 0)) : l(b, function (b) { - c.dataValue = b.replace(/]+data-cke-bookmark[^<]*?<\/span>/ig, - ''); e && r(a, c); - }); - } function u() { - if (a.mode == 'wysiwyg') { - var b = q('paste'); - - a.getCommand('cut').setState(q('cut')); a.getCommand('copy').setState(q('copy')); a.getCommand('paste').setState(b); a.fire('pasteState', b); - } - } function q(b) { - var c = a.getSelection(); var c = c && c.getRanges()[0]; - - if ((a.readOnly || c && c.checkReadOnly()) && b in { paste: 1, cut: 1 }) { - return CKEDITOR.TRISTATE_DISABLED; - } if (b == 'paste') { - return CKEDITOR.TRISTATE_OFF; - } b = a.getSelection(); c = b.getRanges(); return b.getType() == CKEDITOR.SELECTION_NONE || c.length == 1 && c[0].collapsed ? - CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_OFF; - } var p = CKEDITOR.plugins.clipboard; var n = 0; var v = 0; - - (function () { - a.on('key', m); a.on('contentDom', b); a.on('selectionChange', u); if (a.contextMenu) { - a.contextMenu.addListener(function () { - return { cut: q('cut'), copy: q('copy'), paste: q('paste') }; - }); var c = null; - - a.on('menuShow', function () { - c && (c.removeListener(), c = null); var b = a.contextMenu.findItemByCommandName('paste'); - - b && b.element && (c = b.element.on('touchend', function () { - a._.forcePasteDialog = !0; - })); - }); - } if (a.ui.addButton) { - a.once('instanceReady', - function () { - a._.pasteButtons && CKEDITOR.tools.array.forEach(a._.pasteButtons, function (b) { - if (b = a.ui.get(b)) { - if (b = CKEDITOR.document.getById(b._.id)) { - b.on('touchend', function () { - a._.forcePasteDialog = !0; - }); - } - } - }); - }); - } - })(); (function () { - function b(c, e, d, g, m) { - var k = a.lang.clipboard[e]; - - a.addCommand(e, d); a.ui.addButton && a.ui.addButton(c, { label: k, command: e, toolbar: 'clipboard,' + g }); a.addMenuItems && a.addMenuItem(e, { label: k, command: e, group: 'clipboard', order: m }); - }b('Cut', 'cut', c('cut'), 10, 1); b('Copy', 'copy', c('copy'), 20, 4); b('Paste', - 'paste', d(), 30, 8); a._.pasteButtons || (a._.pasteButtons = []); a._.pasteButtons.push('Paste'); - })(); a.getClipboardData = function (b, c) { - function e(a) { - a.removeListener(); a.cancel(); c(a.data); - } function d(a) { - a.removeListener(); a.cancel(); c({ type: m, dataValue: a.data.dataValue, dataTransfer: a.data.dataTransfer, method: 'paste' }); - } var g = !1; var m = 'auto'; - - c || (c = b, b = null); a.on('beforePaste', function (a) { - a.removeListener(); g = !0; m = a.data.type; - }, null, null, 1E3); a.on('paste', e, null, null, 0); !1 === t() && (a.removeListener('paste', e), a._.forcePasteDialog && -g && a.fire('pasteDialog') ? (a.on('pasteDialogCommit', d), a.on('dialogHide', function (a) { - a.removeListener(); a.data.removeListener('pasteDialogCommit', d); a.data._.committed || c(null); - })) : c(null)); - }; - } function y(a) { - if (CKEDITOR.env.webkit) { - if (!a.match(/^[^<]*$/g) && !a.match(/^(
<\/div>|
[^<]*<\/div>)*$/gi)) { - return 'html'; - } - } else if (CKEDITOR.env.ie) { - if (!a.match(/^([^<]|)*$/gi) && !a.match(/^(

([^<]|)*<\/p>|(\r\n))*$/gi)) { - return 'html'; - } - } else if (CKEDITOR.env.gecko) { - if (!a.match(/^([^<]|)*$/gi)) { - return 'html'; - } - } else { - return 'html'; - } - return 'htmlifiedtext'; - } function z(a, b) { - function c(a) { - return CKEDITOR.tools.repeat('\x3c/p\x3e\x3cp\x3e', ~~(a / 2)) + (a % 2 == 1 ? '\x3cbr\x3e' : ''); - }b = b.replace(/(?!\u3000)\s+/g, ' ').replace(/> +/gi, '\x3cbr\x3e'); b = b.replace(/<\/?[A-Z]+>/g, function (a) { - return a.toLowerCase(); - }); if (b.match(/^[^<]$/)) { - return b; - } CKEDITOR.env.webkit && b.indexOf('\x3cdiv\x3e') > -1 && (b = b.replace(/^(

(
|)<\/div>)(?!$|(
(
|)<\/div>))/g, '\x3cbr\x3e').replace(/^(
(
|)<\/div>){2}(?!$)/g, '\x3cdiv\x3e\x3c/div\x3e'), - b.match(/
(
|)<\/div>/) && (b = '\x3cp\x3e' + b.replace(/(
(
|)<\/div>)+/g, function (a) { - return c(a.split('\x3c/div\x3e\x3cdiv\x3e').length + 1); - }) + '\x3c/p\x3e'), b = b.replace(/<\/div>
/g, '\x3cbr\x3e'), b = b.replace(/<\/?div>/g, '')); CKEDITOR.env.gecko && a.enterMode != CKEDITOR.ENTER_BR && (CKEDITOR.env.gecko && (b = b.replace(/^

$/, '\x3cbr\x3e')), b.indexOf('\x3cbr\x3e\x3cbr\x3e') > -1 && (b = '\x3cp\x3e' + b.replace(/(
){2,}/g, function (a) { - return c(a.length / 4); - }) + '\x3c/p\x3e')); return A(a, b); - } function B(a) { - function b() { - var a = -{}; var b; - - for (b in CKEDITOR.dtd) { - b.charAt(0) != '$' && b != 'div' && b != 'span' && (a[b] = 1); - } return a; - } var c = {}; - - return { get: function (d) { - return d == 'plain-text' ? c.plainText || (c.plainText = new CKEDITOR.filter(a, 'br')) : d == 'semantic-content' ? ((d = c.semanticContent) || (d = new CKEDITOR.filter(a, {}), d.allow({ $1: { elements: b(), attributes: !0, styles: !1, classes: !1 } }), d = c.semanticContent = d), d) : d ? new CKEDITOR.filter(a, d) : null; - } }; - } function w(a, b, c) { - b = CKEDITOR.htmlParser.fragment.fromHtml(b); var d = new CKEDITOR.htmlParser.basicWriter(); - - c.applyTo(b, - !0, !1, a.activeEnterMode); b.writeHtml(d); return d.getHtml(); - } function A(a, b) { - a.enterMode == CKEDITOR.ENTER_BR ? b = b.replace(/(<\/p>

)+/g, function (a) { - return CKEDITOR.tools.repeat('\x3cbr\x3e', a.length / 7 * 2); - }).replace(/<\/?p>/g, '') : a.enterMode == CKEDITOR.ENTER_DIV && (b = b.replace(/<(\/)?p>/g, '\x3c$1div\x3e')); return b; - } function C(a) { - a.data.preventDefault(); a.data.$.dataTransfer.dropEffect = 'none'; - } function D(a) { - var b = CKEDITOR.plugins.clipboard; - - a.on('contentDom', function () { - function c(b, c, e) { - c.select(); r(a, { dataTransfer: e, - method: 'drop' }, 1); e.sourceEditor.fire('saveSnapshot'); e.sourceEditor.editable().extractHtmlFromRange(b); e.sourceEditor.getSelection().selectRanges([b]); e.sourceEditor.fire('saveSnapshot'); - } function d(c, e) { - c.select(); r(a, { dataTransfer: e, method: 'drop' }, 1); b.resetDragDataTransfer(); - } function f(b, c, e) { - var d = { $: b.data.$, target: b.data.getTarget() }; - - c && (d.dragRange = c); e && (d.dropRange = e); !1 === a.fire(b.name, d) && b.data.preventDefault(); - } function h(a) { - a.type != CKEDITOR.NODE_ELEMENT && (a = a.getParent()); return a.getChildCount(); - } - var e = a.editable(); var g = CKEDITOR.plugins.clipboard.getDropTarget(a); var l = a.ui.space('top'); var t = a.ui.space('bottom'); - - b.preventDefaultDropOnElement(l); b.preventDefaultDropOnElement(t); e.attachListener(g, 'dragstart', f); e.attachListener(a, 'dragstart', b.resetDragDataTransfer, b, null, 1); e.attachListener(a, 'dragstart', function (c) { - b.initDragDataTransfer(c, a); - }, null, null, 2); e.attachListener(a, 'dragstart', function () { - var c = b.dragRange = a.getSelection().getRanges()[0]; - - CKEDITOR.env.ie && CKEDITOR.env.version < 10 && (b.dragStartContainerChildCount = -c ? h(c.startContainer) : null, b.dragEndContainerChildCount = c ? h(c.endContainer) : null); - }, null, null, 100); e.attachListener(g, 'dragend', f); e.attachListener(a, 'dragend', b.initDragDataTransfer, b, null, 1); e.attachListener(a, 'dragend', b.resetDragDataTransfer, b, null, 100); e.attachListener(g, 'dragover', function (a) { - if (CKEDITOR.env.edge) { - a.data.preventDefault(); - } else { - var b = a.data.getTarget(); - - b && b.is && b.is('html') ? a.data.preventDefault() : CKEDITOR.env.ie && CKEDITOR.plugins.clipboard.isFileApiSupported && a.data.$.dataTransfer.types.contains('Files') && -a.data.preventDefault(); - } - }); e.attachListener(g, 'drop', function (c) { - if (!c.data.$.defaultPrevented && (c.data.preventDefault(), !a.readOnly)) { - var e = c.data.getTarget(); - - if (!e.isReadOnly() || e.type == CKEDITOR.NODE_ELEMENT && e.is('html')) { - var e = b.getRangeAtDropPosition(c, a); var d = b.dragRange; - - e && f(c, d, e); - } - } - }, null, null, 9999); e.attachListener(a, 'drop', b.initDragDataTransfer, b, null, 1); e.attachListener(a, 'drop', function (e) { - if (e = e.data) { - var g = e.dropRange; var f = e.dragRange; var l = e.dataTransfer; - - l.getTransferType(a) == CKEDITOR.DATA_TRANSFER_INTERNAL ? - setTimeout(function () { - b.internalDrop(f, g, l, a); - }, 0) : l.getTransferType(a) == CKEDITOR.DATA_TRANSFER_CROSS_EDITORS ? c(f, g, l) : d(g, l); - } - }, null, null, 9999); - }); - } var n; - - CKEDITOR.plugins.add('clipboard', { requires: 'dialog,notification,toolbar', init: function (a) { - function b(a) { - if (!a || h === a.id) { - return !1; - } var b = a.getTypes(); var b = b.length === 1 && b[0] === 'Files'; - - a = a.getFilesCount() === 1; return b && a; - } var c; var d = B(a); - - a.config.forcePasteAsPlainText ? c = 'plain-text' : a.config.pasteFilter ? c = a.config.pasteFilter : !CKEDITOR.env.webkit || 'pasteFilter' in -a.config || (c = 'semantic-content'); a.pasteFilter = d.get(c); x(a); D(a); CKEDITOR.dialog.add('paste', CKEDITOR.getUrl(this.path + 'dialogs/paste.js')); if (CKEDITOR.env.gecko) { - var f = ['image/png', 'image/jpeg', 'image/gif']; var h; - - a.on('paste', function (c) { - var d = c.data; var l = d.dataTransfer; - - if (!d.dataValue && d.method == 'paste' && b(l) && (l = l.getFile(0), CKEDITOR.tools.indexOf(f, l.type) != -1)) { - var t = new FileReader(); - - t.addEventListener('load', function () { - c.data.dataValue = '\x3cimg src\x3d"' + t.result + '" /\x3e'; a.fire('paste', c.data); - }, !1); - t.addEventListener('abort', function () { - a.fire('paste', c.data); - }, !1); t.addEventListener('error', function () { - a.fire('paste', c.data); - }, !1); t.readAsDataURL(l); h = d.dataTransfer.id; c.stop(); - } - }, null, null, 1); - }a.on('paste', function (b) { - b.data.dataTransfer || (b.data.dataTransfer = new CKEDITOR.plugins.clipboard.dataTransfer()); if (!b.data.dataValue) { - var c = b.data.dataTransfer; var d = c.getData('text/html'); - - if (d) { - b.data.dataValue = d, b.data.type = 'html'; - } else if (d = c.getData('text/plain')) { - b.data.dataValue = a.editable().transformPlainTextToHtml(d), - b.data.type = 'text'; - } - } - }, null, null, 1); a.on('paste', function (a) { - var b = a.data.dataValue; var c = CKEDITOR.dtd.$block; - - b.indexOf('Apple-') > -1 && (b = b.replace(/ <\/span>/gi, ' '), a.data.type != 'html' && (b = b.replace(/]*>([^<]*)<\/span>/gi, function (a, b) { - return b.replace(/\t/g, '\x26nbsp;\x26nbsp; \x26nbsp;'); - })), b.indexOf('\x3cbr class\x3d"Apple-interchange-newline"\x3e') > -1 && (a.data.startsWithEOL = 1, a.data.preSniffing = 'html', b = b.replace(/
/, - '')), b = b.replace(/(<[^>]+) class="Apple-[^"]*"/gi, '$1')); if (b.match(/^<[^<]+cke_(editable|contents)/i)) { - var d; var f; var h = new CKEDITOR.dom.element('div'); - - for (h.setHtml(b); h.getChildCount() == 1 && (d = h.getFirst()) && d.type == CKEDITOR.NODE_ELEMENT && (d.hasClass('cke_editable') || d.hasClass('cke_contents'));) { - h = f = d; - }f && (b = f.getHtml().replace(/
$/i, '')); - }CKEDITOR.env.ie ? b = b.replace(/^ (?: |\r\n)?<(\w+)/g, function (b, d) { - return d.toLowerCase() in c ? (a.data.preSniffing = 'html', '\x3c' + d) : b; - }) : CKEDITOR.env.webkit ? b = b.replace(/<\/(\w+)>


<\/div>$/, - function (b, d) { - return d in c ? (a.data.endsWithEOL = 1, '\x3c/' + d + '\x3e') : b; - }) : CKEDITOR.env.gecko && (b = b.replace(/(\s)
$/, '$1')); a.data.dataValue = b; - }, null, null, 3); a.on('paste', function (b) { - b = b.data; var c = a._.nextPasteType || b.type; var f = b.dataValue; var h; var m = a.config.clipboard_defaultContentType || 'html'; var k = b.dataTransfer.getTransferType(a) == CKEDITOR.DATA_TRANSFER_EXTERNAL; var n = !0 === a.config.forcePasteAsPlainText; - - h = c == 'html' || b.preSniffing == 'html' ? 'html' : y(f); delete a._.nextPasteType; h == 'htmlifiedtext' && (f = z(a.config, f)); - if (c == 'text' && h == 'html') { - f = w(a, f, d.get('plain-text')); - } else if (k && a.pasteFilter && !b.dontFilter || n) { - f = w(a, f, a.pasteFilter); - }b.startsWithEOL && (f = '\x3cbr data-cke-eol\x3d"1"\x3e' + f); b.endsWithEOL && (f += '\x3cbr data-cke-eol\x3d"1"\x3e'); c == 'auto' && (c = h == 'html' || m == 'html' ? 'html' : 'text'); b.type = c; b.dataValue = f; delete b.preSniffing; delete b.startsWithEOL; delete b.endsWithEOL; - }, null, null, 6); a.on('paste', function (b) { - b = b.data; b.dataValue && (a.insertHtml(b.dataValue, b.type, b.range), setTimeout(function () { - a.fire('afterPaste'); - }, - 0)); - }, null, null, 1E3); a.on('pasteDialog', function (b) { - setTimeout(function () { - a.openDialog('paste', b.data); - }, 0); - }); - } }); CKEDITOR.plugins.clipboard = { isCustomCopyCutSupported: CKEDITOR.env.ie && CKEDITOR.env.version < 16 || CKEDITOR.env.iOS && CKEDITOR.env.version < 605 ? !1 : !0, isCustomDataTypesSupported: !CKEDITOR.env.ie || CKEDITOR.env.version >= 16, isFileApiSupported: !CKEDITOR.env.ie || CKEDITOR.env.version > 9, mainPasteEvent: CKEDITOR.env.ie && !CKEDITOR.env.edge ? 'beforepaste' : 'paste', addPasteButton: function (a, b, c) { - a.ui.addButton && -(a.ui.addButton(b, c), a._.pasteButtons || (a._.pasteButtons = []), a._.pasteButtons.push(b)); - }, canClipboardApiBeTrusted: function (a, b) { - return a.getTransferType(b) != CKEDITOR.DATA_TRANSFER_EXTERNAL || CKEDITOR.env.chrome && !a.isEmpty() || CKEDITOR.env.gecko && (a.getData('text/html') || a.getFilesCount()) || CKEDITOR.env.safari && CKEDITOR.env.version >= 603 && !CKEDITOR.env.iOS || CKEDITOR.env.iOS && CKEDITOR.env.version >= 605 || CKEDITOR.env.edge && CKEDITOR.env.version >= 16 ? !0 : !1; - }, getDropTarget: function (a) { - var b = a.editable(); - - return CKEDITOR.env.ie && -CKEDITOR.env.version < 9 || b.isInline() ? b : a.document; - }, fixSplitNodesAfterDrop: function (a, b, c, d) { - function f(a, c, d) { - var f = a; - - f.type == CKEDITOR.NODE_TEXT && (f = a.getParent()); if (f.equals(c) && d != c.getChildCount()) { - return a = b.startContainer.getChild(b.startOffset - 1), c = b.startContainer.getChild(b.startOffset), a && a.type == CKEDITOR.NODE_TEXT && c && c.type == CKEDITOR.NODE_TEXT && (d = a.getLength(), a.setText(a.getText() + c.getText()), c.remove(), b.setStart(a, d), b.collapse(!0)), !0; - } - } var h = b.startContainer; - - typeof d === 'number' && typeof c === -'number' && h.type == CKEDITOR.NODE_ELEMENT && (f(a.startContainer, h, c) || f(a.endContainer, h, d)); - }, isDropRangeAffectedByDragRange: function (a, b) { - var c = b.startContainer; var d = b.endOffset; - - return a.endContainer.equals(c) && a.endOffset <= d || a.startContainer.getParent().equals(c) && a.startContainer.getIndex() < d || a.endContainer.getParent().equals(c) && a.endContainer.getIndex() < d ? !0 : !1; - }, internalDrop: function (a, b, c, d) { - var f = CKEDITOR.plugins.clipboard; var h = d.editable(); var e; var g; - - d.fire('saveSnapshot'); d.fire('lockSnapshot', { dontUpdate: 1 }); - CKEDITOR.env.ie && CKEDITOR.env.version < 10 && this.fixSplitNodesAfterDrop(a, b, f.dragStartContainerChildCount, f.dragEndContainerChildCount); (g = this.isDropRangeAffectedByDragRange(a, b)) || (e = a.createBookmark(!1)); f = b.clone().createBookmark(!1); g && (e = a.createBookmark(!1)); a = e.startNode; b = e.endNode; g = f.startNode; b && a.getPosition(g) & CKEDITOR.POSITION_PRECEDING && b.getPosition(g) & CKEDITOR.POSITION_FOLLOWING && g.insertBefore(a); a = d.createRange(); a.moveToBookmark(e); h.extractHtmlFromRange(a, 1); b = d.createRange(); - f.startNode.getCommonAncestor(h) || (f = d.getSelection().createBookmarks()[0]); b.moveToBookmark(f); r(d, { dataTransfer: c, method: 'drop', range: b }, 1); d.fire('unlockSnapshot'); - }, getRangeAtDropPosition: function (a, b) { - var c = a.data.$; var d = c.clientX; var f = c.clientY; var h = b.getSelection(!0).getRanges()[0]; var e = b.createRange(); - - if (a.data.testRange) { - return a.data.testRange; - } if (document.caretRangeFromPoint && b.document.$.caretRangeFromPoint(d, f)) { - c = b.document.$.caretRangeFromPoint(d, f), e.setStart(CKEDITOR.dom.node(c.startContainer), c.startOffset), - e.collapse(!0); - } else if (c.rangeParent) { - e.setStart(CKEDITOR.dom.node(c.rangeParent), c.rangeOffset), e.collapse(!0); - } else { - if (CKEDITOR.env.ie && CKEDITOR.env.version > 8 && h && b.editable().hasFocus) { - return h; - } if (document.body.createTextRange) { - b.focus(); c = b.document.getBody().$.createTextRange(); try { - for (var g = !1, l = 0; l < 20 && !g; l++) { - if (!g) { - try { - c.moveToPoint(d, f - l), g = !0; - } catch (n) {} - } if (!g) { - try { - c.moveToPoint(d, f + l), g = !0; - } catch (m) {} - } - } if (g) { - var k = 'cke-temp-' + new Date().getTime(); - - c.pasteHTML('\x3cspan id\x3d"' + k + '"\x3e​\x3c/span\x3e'); - var u = b.document.getById(k); - - e.moveToPosition(u, CKEDITOR.POSITION_BEFORE_START); u.remove(); - } else { - var q = b.document.$.elementFromPoint(d, f); var p = new CKEDITOR.dom.element(q); var r; - - if (p.equals(b.editable()) || p.getName() == 'html') { - return h && h.startContainer && !h.startContainer.equals(b.editable()) ? h : null; - } r = p.getClientRect(); d < r.left ? e.setStartAt(p, CKEDITOR.POSITION_AFTER_START) : e.setStartAt(p, CKEDITOR.POSITION_BEFORE_END); e.collapse(!0); - } - } catch (v) { - return null; - } - } else { - return null; - } - } return e; - }, initDragDataTransfer: function (a, - b) { - var c = a.data.$ ? a.data.$.dataTransfer : null; var d = new this.dataTransfer(c, b); - - a.name === 'dragstart' && d.storeId(); c ? this.dragData && d.id == this.dragData.id ? d = this.dragData : this.dragData = d : this.dragData ? d = this.dragData : this.dragData = d; a.data.dataTransfer = d; - }, resetDragDataTransfer: function () { - this.dragData = null; - }, initPasteDataTransfer: function (a, b) { - if (this.isCustomCopyCutSupported) { - if (a && a.data && a.data.$) { - var c = a.data.$.clipboardData; var d = new this.dataTransfer(c, b); - - a.name !== 'copy' && a.name !== 'cut' || d.storeId(); this.copyCutData && -d.id == this.copyCutData.id ? (d = this.copyCutData, d.$ = c) : this.copyCutData = d; return d; - } return new this.dataTransfer(null, b); - } return new this.dataTransfer(CKEDITOR.env.edge && a && a.data.$ && a.data.$.clipboardData || null, b); - }, preventDefaultDropOnElement: function (a) { - a && a.on('dragover', C); - } }; n = CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ? 'cke/id' : 'Text'; CKEDITOR.plugins.clipboard.dataTransfer = function (a, b) { - a && (this.$ = a); this._ = { metaRegExp: /^/i, bodyRegExp: /([\s\S]*)<\/body>/i, fragmentRegExp: /\s*\x3c!--StartFragment--\x3e|\x3c!--EndFragment--\x3e\s*/g, - data: {}, files: [], nativeHtmlCache: '', normalizeType: function (a) { - a = a.toLowerCase(); return a == 'text' || a == 'text/plain' ? 'Text' : a == 'url' ? 'URL' : a; - } }; this._.fallbackDataTransfer = new CKEDITOR.plugins.clipboard.fallbackDataTransfer(this); this.id = this.getData(n); this.id || (this.id = n == 'Text' ? '' : 'cke-' + CKEDITOR.tools.getUniqueId()); b && (this.sourceEditor = b, this.setData('text/html', b.getSelectedHtml(1)), n == 'Text' || this.getData('text/plain') || this.setData('text/plain', b.getSelection().getSelectedText())); - }; CKEDITOR.DATA_TRANSFER_INTERNAL = -1; CKEDITOR.DATA_TRANSFER_CROSS_EDITORS = 2; CKEDITOR.DATA_TRANSFER_EXTERNAL = 3; CKEDITOR.plugins.clipboard.dataTransfer.prototype = { getData: function (a, b) { - a = this._.normalizeType(a); var c = a == 'text/html' && b ? this._.nativeHtmlCache : this._.data[a]; - - if (void 0 === c || c === null || c === '') { - if (this._.fallbackDataTransfer.isRequired()) { - c = this._.fallbackDataTransfer.getData(a, b); - } else { - try { - c = this.$.getData(a) || ''; - } catch (d) { - c = ''; - } - }a != 'text/html' || b || (c = this._stripHtml(c)); - }a == 'Text' && CKEDITOR.env.gecko && this.getFilesCount() && c.substring(0, 7) == -'file://' && (c = ''); if (typeof c === 'string') { - var f = c.indexOf('\x3c/html\x3e'); var c = f !== -1 ? c.substring(0, f + 7) : c; - } - - return c; - }, setData: function (a, b) { - a = this._.normalizeType(a); a == 'text/html' ? (this._.data[a] = this._stripHtml(b), this._.nativeHtmlCache = b) : this._.data[a] = b; if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported || a == 'URL' || a == 'Text') { - if (n == 'Text' && a == 'Text' && (this.id = b), this._.fallbackDataTransfer.isRequired()) { - this._.fallbackDataTransfer.setData(a, b); - } else { - try { - this.$.setData(a, b); - } catch (c) {} - } - } - }, storeId: function () { - n !== -'Text' && this.setData(n, this.id); - }, getTransferType: function (a) { - return this.sourceEditor ? this.sourceEditor == a ? CKEDITOR.DATA_TRANSFER_INTERNAL : CKEDITOR.DATA_TRANSFER_CROSS_EDITORS : CKEDITOR.DATA_TRANSFER_EXTERNAL; - }, cacheData: function () { - function a(a) { - a = b._.normalizeType(a); var c = b.getData(a); - - a == 'text/html' && (b._.nativeHtmlCache = b.getData(a, !0), c = b._stripHtml(c)); c && (b._.data[a] = c); - } if (this.$) { - var b = this; var c; var d; - - if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported) { - if (this.$.types) { - for (c = 0; c < this.$.types.length; c++) { - a(this.$.types[c]); - } - } - } else { - a('Text'), - a('URL'); - }d = this._getImageFromClipboard(); if (this.$ && this.$.files || d) { - this._.files = []; if (this.$.files && this.$.files.length) { - for (c = 0; c < this.$.files.length; c++) { - this._.files.push(this.$.files[c]); - } - } this._.files.length === 0 && d && this._.files.push(d); - } - } - }, getFilesCount: function () { - return this._.files.length ? this._.files.length : this.$ && this.$.files && this.$.files.length ? this.$.files.length : this._getImageFromClipboard() ? 1 : 0; - }, getFile: function (a) { - return this._.files.length ? this._.files[a] : this.$ && this.$.files && this.$.files.length ? - this.$.files[a] : a === 0 ? this._getImageFromClipboard() : void 0; - }, isEmpty: function () { - var a = {}; var b; - - if (this.getFilesCount()) { - return !1; - } CKEDITOR.tools.array.forEach(CKEDITOR.tools.object.keys(this._.data), function (b) { - a[b] = 1; - }); if (this.$) { - if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported) { - if (this.$.types) { - for (var c = 0; c < this.$.types.length; c++) { - a[this.$.types[c]] = 1; - } - } - } else { - a.Text = 1, a.URL = 1; - } - }n != 'Text' && (a[n] = 0); for (b in a) { - if (a[b] && this.getData(b) !== '') { - return !1; - } - } return !0; - }, getTypes: function () { - return this.$ && this.$.types ? - [].slice.call(this.$.types) : []; - }, _getImageFromClipboard: function () { - var a; - - try { - if (this.$ && this.$.items && this.$.items[0] && (a = this.$.items[0].getAsFile()) && a.type) { - return a; - } - } catch (b) {} - }, _stripHtml: function (a) { - if (a && a.length) { - a = a.replace(this._.metaRegExp, ''); var b = this._.bodyRegExp.exec(a); - - b && b.length && (a = b[1], a = a.replace(this._.fragmentRegExp, '')); - } return a; - } }; CKEDITOR.plugins.clipboard.fallbackDataTransfer = function (a) { - this._dataTransfer = a; this._customDataFallbackType = 'text/html'; - }; CKEDITOR.plugins.clipboard.fallbackDataTransfer._isCustomMimeTypeSupported = -null; CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes = []; CKEDITOR.plugins.clipboard.fallbackDataTransfer.prototype = { isRequired: function () { - var a = CKEDITOR.plugins.clipboard.fallbackDataTransfer; var b = this._dataTransfer.$; - - if (a._isCustomMimeTypeSupported === null) { - if (b) { - a._isCustomMimeTypeSupported = !1; if (CKEDITOR.env.edge && CKEDITOR.env.version >= 17) { - return !0; - } try { - b.setData('cke/mimetypetest', 'cke test value'), a._isCustomMimeTypeSupported = b.getData('cke/mimetypetest') === 'cke test value', b.clearData('cke/mimetypetest'); - } catch (c) {} - } else { - return !1; - } - } - return !a._isCustomMimeTypeSupported; - }, getData: function (a, b) { - var c = this._getData(this._customDataFallbackType, !0); - - if (b) { - return c; - } var c = this._extractDataComment(c); var d = null; var d = a === this._customDataFallbackType ? c.content : c.data && c.data[a] ? c.data[a] : this._getData(a, !0); - - return d !== null ? d : ''; - }, setData: function (a, b) { - var c = a === this._customDataFallbackType; - - c && (b = this._applyDataComment(b, this._getFallbackTypeData())); var d = b; var f = this._dataTransfer.$; - - try { - f.setData(a, d), c && (this._dataTransfer._.nativeHtmlCache = d); - } catch (h) { - if (this._isUnsupportedMimeTypeError(h)) { - c = -CKEDITOR.plugins.clipboard.fallbackDataTransfer; CKEDITOR.tools.indexOf(c._customTypes, a) === -1 && c._customTypes.push(a); var c = this._getFallbackTypeContent(); var e = this._getFallbackTypeData(); - - e[a] = d; try { - d = this._applyDataComment(c, e), f.setData(this._customDataFallbackType, d), this._dataTransfer._.nativeHtmlCache = d; - } catch (g) { - d = ''; - } - } - } return d; - }, _getData: function (a, b) { - var c = this._dataTransfer._.data; - - if (!b && c[a]) { - return c[a]; - } try { - return this._dataTransfer.$.getData(a); - } catch (d) { - return null; - } - }, _getFallbackTypeContent: function () { - var a = -this._dataTransfer._.data[this._customDataFallbackType]; - - a || (a = this._extractDataComment(this._getData(this._customDataFallbackType, !0)).content); return a; - }, _getFallbackTypeData: function () { - var a = CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes; var b = this._extractDataComment(this._getData(this._customDataFallbackType, !0)).data || {}; var c = this._dataTransfer._.data; - - CKEDITOR.tools.array.forEach(a, function (a) { - void 0 !== c[a] ? b[a] = c[a] : void 0 !== b[a] && (b[a] = b[a]); - }, this); return b; - }, _isUnsupportedMimeTypeError: function (a) { - return a.message && -a.message.search(/element not found/gi) !== -1; - }, _extractDataComment: function (a) { - var b = { data: null, content: a || '' }; - - if (a && a.length > 16) { - var c; - - (c = (/\x3c!--cke-data:(.*?)--\x3e/g).exec(a)) && c[1] && (b.data = JSON.parse(decodeURIComponent(c[1])), b.content = a.replace(c[0], '')); - } return b; - }, _applyDataComment: function (a, b) { - var c = ''; - - b && CKEDITOR.tools.object.keys(b).length && (c = '\x3c!--cke-data:' + encodeURIComponent(JSON.stringify(b)) + '--\x3e'); return c + (a && a.length ? a : ''); - } }; - })(); - CKEDITOR.config.clipboard_notificationDuration = 1E4; CKEDITOR.plugins.add('panelbutton', { requires: 'button', onLoad: function () { - function e(c) { - var b = this._; - - b.state != CKEDITOR.TRISTATE_DISABLED && (this.createPanel(c), b.on ? b.panel.hide() : b.panel.showBlock(this._.id, this.document.getById(this._.id), 4)); - }CKEDITOR.ui.panelButton = CKEDITOR.tools.createClass({ base: CKEDITOR.ui.button, $: function (c) { - var b = c.panel || {}; - - delete c.panel; this.base(c); this.document = b.parent && b.parent.getDocument() || CKEDITOR.document; b.block = { attributes: b.attributes }; b.toolbarRelated = !0; this.hasArrow = -'listbox'; this.click = e; this._ = { panelDefinition: b }; - }, statics: { handler: { create: function (c) { - return new CKEDITOR.ui.panelButton(c); - } } }, proto: { createPanel: function (c) { - var b = this._; - - if (!b.panel) { - var f = this._.panelDefinition; var e = this._.panelDefinition.block; var h = f.parent || CKEDITOR.document.getBody(); var d = this._.panel = new CKEDITOR.ui.floatPanel(c, h, f); var f = d.addBlock(b.id, e); var a = this; var g = c.getCommand(this.command); - - d.onShow = function () { - a.className && this.element.addClass(a.className + '_panel'); a.setState(CKEDITOR.TRISTATE_ON); - b.on = 1; a.editorFocus && c.focus(); if (a.onOpen) { - a.onOpen(); - } - }; d.onHide = function (d) { - a.className && this.element.getFirst().removeClass(a.className + '_panel'); !a.modes && g ? a.setStateFromCommand(g) : a.setState(a.modes && a.modes[c.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED); b.on = 0; if (!d && a.onClose) { - a.onClose(); - } - }; d.onEscape = function () { - d.hide(1); a.document.getById(b.id).focus(); - }; if (this.onBlock) { - this.onBlock(d, f); - } f.onHide = function () { - b.on = 0; !a.modes && a.command ? a.setStateFromCommand(g) : a.setState(CKEDITOR.TRISTATE_OFF); - }; - } - }, - setStateFromCommand: function (c) { - this.setState(c.state); - } } }); - }, beforeInit: function (e) { - e.ui.addHandler(CKEDITOR.UI_PANELBUTTON, CKEDITOR.ui.panelButton.handler); - } }); CKEDITOR.UI_PANELBUTTON = 'panelbutton'; (function () { - CKEDITOR.plugins.add('panel', { beforeInit: function (a) { - a.ui.addHandler(CKEDITOR.UI_PANEL, CKEDITOR.ui.panel.handler); - } }); CKEDITOR.UI_PANEL = 'panel'; CKEDITOR.ui.panel = function (a, b) { - b && CKEDITOR.tools.extend(this, b); CKEDITOR.tools.extend(this, { className: '', css: [] }); this.id = CKEDITOR.tools.getNextId(); this.document = a; this.isFramed = this.forceIFrame || this.css.length; this._ = { blocks: {} }; - }; CKEDITOR.ui.panel.handler = { create: function (a) { - return new CKEDITOR.ui.panel(a); - } }; var g = CKEDITOR.addTemplate('panel', - '\x3cdiv lang\x3d"{langCode}" id\x3d"{id}" dir\x3d{dir} class\x3d"cke cke_reset_all {editorId} cke_panel cke_panel {cls} cke_{dir}" style\x3d"z-index:{z-index}" role\x3d"presentation"\x3e{frame}\x3c/div\x3e'); var h = CKEDITOR.addTemplate('panel-frame', '\x3ciframe id\x3d"{id}" class\x3d"cke_panel_frame" role\x3d"presentation" frameborder\x3d"0" src\x3d"{src}"\x3e\x3c/iframe\x3e'); var k = CKEDITOR.addTemplate('panel-frame-inner', '\x3c!DOCTYPE html\x3e\x3chtml class\x3d"cke_panel_container {env}" dir\x3d"{dir}" lang\x3d"{langCode}"\x3e\x3chead\x3e{css}\x3c/head\x3e\x3cbody class\x3d"cke_{dir}" style\x3d"margin:0;padding:0" onload\x3d"{onload}"\x3e\x3c/body\x3e\x3c/html\x3e'); - - CKEDITOR.ui.panel.prototype = { render: function (a, b) { - var e = { 'editorId': a.id, 'id': this.id, 'langCode': a.langCode, 'dir': a.lang.dir, 'cls': this.className, 'frame': '', 'env': CKEDITOR.env.cssClass, 'z-index': a.config.baseFloatZIndex + 1 }; - - this.getHolderElement = function () { - var a = this._.holder; - - if (!a) { - if (this.isFramed) { - var a = this.document.getById(this.id + '_frame'); var b = a.getParent(); var a = a.getFrameDocument(); - - CKEDITOR.env.iOS && b.setStyles({ 'overflow': 'scroll', '-webkit-overflow-scrolling': 'touch' }); b = CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function () { - this.isLoaded = -!0; if (this.onLoad) { - this.onLoad(); - } - }, this)); a.write(k.output(CKEDITOR.tools.extend({ css: CKEDITOR.tools.buildStyleHtml(this.css), onload: 'window.parent.CKEDITOR.tools.callFunction(' + b + ');' }, e))); a.getWindow().$.CKEDITOR = CKEDITOR; a.on('keydown', function (a) { - var b = a.data.getKeystroke(); var c = this.document.getById(this.id).getAttribute('dir'); - - if (a.data.getTarget().getName() !== 'input' || b !== 37 && b !== 39) { - this._.onKeyDown && !1 === this._.onKeyDown(b) ? a.data.getTarget().getName() === 'input' && b === 32 || a.data.preventDefault() : - (b == 27 || b == (c == 'rtl' ? 39 : 37)) && this.onEscape && !1 === this.onEscape(b) && a.data.preventDefault(); - } - }, this); a = a.getBody(); a.unselectable(); CKEDITOR.env.air && CKEDITOR.tools.callFunction(b); - } else { - a = this.document.getById(this.id); - } this._.holder = a; - } return a; - }; if (this.isFramed) { - var d = CKEDITOR.env.air ? 'javascript:void(0)' : CKEDITOR.env.ie && !CKEDITOR.env.edge ? 'javascript:void(function(){' + encodeURIComponent('document.open();(' + CKEDITOR.tools.fixDomain + ')();document.close();') + '}())' : ''; - - e.frame = h.output({ id: this.id + '_frame', - src: d }); - }d = g.output(e); b && b.push(d); return d; - }, addBlock: function (a, b) { - b = this._.blocks[a] = b instanceof CKEDITOR.ui.panel.block ? b : new CKEDITOR.ui.panel.block(this.getHolderElement(), b); this._.currentBlock || this.showBlock(a); return b; - }, getBlock: function (a) { - return this._.blocks[a]; - }, showBlock: function (a) { - a = this._.blocks[a]; var b = this._.currentBlock; var e = !this.forceIFrame || CKEDITOR.env.ie ? this._.holder : this.document.getById(this.id + '_frame'); - - b && b.hide(); this._.currentBlock = a; CKEDITOR.fire('ariaWidget', e); a._.focusIndex = --1; this._.onKeyDown = a.onKeyDown && CKEDITOR.tools.bind(a.onKeyDown, a); a.show(); return a; - }, destroy: function () { - this.element && this.element.remove(); - } }; CKEDITOR.ui.panel.block = CKEDITOR.tools.createClass({ $: function (a, b) { - this.element = a.append(a.getDocument().createElement('div', { attributes: { tabindex: -1, class: 'cke_panel_block' }, styles: { display: 'none' } })); b && CKEDITOR.tools.extend(this, b); this.element.setAttributes({ 'role': this.attributes.role || 'presentation', 'aria-label': this.attributes['aria-label'], 'title': this.attributes.title || -this.attributes['aria-label'] }); this.keys = {}; this._.focusIndex = -1; this.element.disableContextMenu(); - }, _: { markItem: function (a) { - a != -1 && (a = this._.getItems().getItem(this._.focusIndex = a), CKEDITOR.env.webkit && a.getDocument().getWindow().focus(), a.focus(), this.onMark && this.onMark(a)); - }, markFirstDisplayed: function (a) { - for (var b = function (a) { - return a.type == CKEDITOR.NODE_ELEMENT && a.getStyle('display') == 'none'; - }, e = this._.getItems(), d, c, f = e.count() - 1; f >= 0; f--) { - if (d = e.getItem(f), d.getAscendant(b) || (c = d, this._.focusIndex = -f), d.getAttribute('aria-selected') == 'true') { - c = d; this._.focusIndex = f; break; - } - }c && (a && a(), CKEDITOR.env.webkit && c.getDocument().getWindow().focus(), c.focus(), this.onMark && this.onMark(c)); - }, getItems: function () { - return this.element.find('a,input'); - } }, proto: { show: function () { - this.element.setStyle('display', ''); - }, hide: function () { - this.onHide && !0 === this.onHide.call(this) || this.element.setStyle('display', 'none'); - }, onKeyDown: function (a, b) { - var e = this.keys[a]; - - switch (e) { - case 'next':for (var d = this._.focusIndex, e = this._.getItems(), - c; c = e.getItem(++d);) { - if (c.getAttribute('_cke_focus') && c.$.offsetWidth) { - this._.focusIndex = d; c.focus(!0); break; - } - } return c || b ? !1 : (this._.focusIndex = -1, this.onKeyDown(a, 1)); case 'prev':d = this._.focusIndex; for (e = this._.getItems(); d > 0 && (c = e.getItem(--d));) { - if (c.getAttribute('_cke_focus') && c.$.offsetWidth) { - this._.focusIndex = d; c.focus(!0); break; - }c = null; - } return c || b ? !1 : (this._.focusIndex = e.count(), this.onKeyDown(a, 1)); case 'click':case 'mouseup':return d = this._.focusIndex, (c = d >= 0 && this._.getItems().getItem(d)) && -c.fireEventHandler(e, { button: CKEDITOR.tools.normalizeMouseButton(CKEDITOR.MOUSE_BUTTON_LEFT, !0) }), !1; - } return !0; - } } }); - })(); CKEDITOR.plugins.add('floatpanel', { requires: 'panel' }); - (function () { - function v(a, b, c, m, h) { - h = CKEDITOR.tools.genKey(b.getUniqueId(), c.getUniqueId(), a.lang.dir, a.uiColor || '', m.css || '', h || ''); var g = f[h]; - - g || (g = f[h] = new CKEDITOR.ui.panel(b, m), g.element = c.append(CKEDITOR.dom.element.createFromHtml(g.render(a), b)), g.element.setStyles({ display: 'none', position: 'absolute' })); return g; - } var f = {}; - - CKEDITOR.ui.floatPanel = CKEDITOR.tools.createClass({ $: function (a, b, c, m) { - function h() { - e.hide(); - }c.forceIFrame = 1; c.toolbarRelated && a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE && -(b = CKEDITOR.document.getById('cke_' + a.name)); var g = b.getDocument(); - - m = v(a, g, b, c, m || 0); var n = m.element; var l = n.getFirst(); var e = this; - - n.disableContextMenu(); this.element = n; this._ = { editor: a, panel: m, parentElement: b, definition: c, document: g, iframe: l, children: [], dir: a.lang.dir, showBlockParams: null, markFirst: void 0 !== c.markFirst ? c.markFirst : !0 }; a.on('mode', h); a.on('resize', h); g.getWindow().on('resize', function () { - this.reposition(); - }, this); - }, proto: { addBlock: function (a, b) { - return this._.panel.addBlock(a, b); - }, addListBlock: function (a, - b) { - return this._.panel.addListBlock(a, b); - }, getBlock: function (a) { - return this._.panel.getBlock(a); - }, showBlock: function (a, b, c, m, h, g) { - var n = this._.panel; var l = n.showBlock(a); - - this._.showBlockParams = [].slice.call(arguments); this.allowBlur(!1); var e = this._.editor.editable(); - - this._.returnFocus = e.hasFocus ? e : new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement); this._.hideTimeout = 0; var k = this.element; var e = this._.iframe; var e = CKEDITOR.env.ie && !CKEDITOR.env.edge ? e : new CKEDITOR.dom.window(e.$.contentWindow); var f = k.getDocument(); - var r = this._.parentElement.getPositionedAncestor(); var t = b.getDocumentPosition(f); var f = r ? r.getDocumentPosition(f) : { x: 0, y: 0 }; var q = this._.dir == 'rtl'; var d = t.x + (m || 0) - f.x; var p = t.y + (h || 0) - f.y; - - !q || c != 1 && c != 4 ? q || c != 2 && c != 3 || (d += b.$.offsetWidth - 1) : d += b.$.offsetWidth; if (c == 3 || c == 4) { - p += b.$.offsetHeight - 1; - } this._.panel._.offsetParentId = b.getId(); k.setStyles({ top: p + 'px', left: 0, display: '' }); k.setOpacity(0); k.getFirst().removeStyle('width'); this._.editor.focusManager.add(e); this._.blurSet || (CKEDITOR.event.useCapture = !0, e.on('blur', - function (a) { - function u() { - delete this._.returnFocus; this.hide(); - } this.allowBlur() && a.data.getPhase() == CKEDITOR.EVENT_PHASE_AT_TARGET && this.visible && !this._.activeChild && (CKEDITOR.env.iOS ? this._.hideTimeout || (this._.hideTimeout = CKEDITOR.tools.setTimeout(u, 0, this)) : u.call(this)); - }, this), e.on('focus', function () { - this._.focused = !0; this.hideChild(); this.allowBlur(!0); - }, this), CKEDITOR.env.iOS && (e.on('touchstart', function () { - clearTimeout(this._.hideTimeout); - }, this), e.on('touchend', function () { - this._.hideTimeout = -0; this.focus(); - }, this)), CKEDITOR.event.useCapture = !1, this._.blurSet = 1); n.onEscape = CKEDITOR.tools.bind(function (a) { - if (this.onEscape && !1 === this.onEscape(a)) { - return !1; - } - }, this); CKEDITOR.tools.setTimeout(function () { - var a = CKEDITOR.tools.bind(function () { - var a = k; - - a.removeStyle('width'); if (l.autoSize) { - var b = l.element.getDocument(); var b = (CKEDITOR.env.webkit || CKEDITOR.env.edge ? l.element : b.getBody()).$.scrollWidth; - - CKEDITOR.env.ie && CKEDITOR.env.quirks && b > 0 && (b += (a.$.offsetWidth || 0) - (a.$.clientWidth || 0) + 3); a.setStyle('width', - b + 10 + 'px'); b = l.element.$.scrollHeight; CKEDITOR.env.ie && CKEDITOR.env.quirks && b > 0 && (b += (a.$.offsetHeight || 0) - (a.$.clientHeight || 0) + 3); a.setStyle('height', b + 'px'); n._.currentBlock.element.setStyle('display', 'none').removeStyle('display'); - } else { - a.removeStyle('height'); - }q && (d -= k.$.offsetWidth); k.setStyle('left', d + 'px'); var b = n.element.getWindow(); var a = k.$.getBoundingClientRect(); var b = b.getViewPaneSize(); var c = a.width || a.right - a.left; var e = a.height || a.bottom - a.top; var m = q ? a.right : b.width - a.left; var h = q ? b.width - a.right : a.left; - - q ? m < c && (d = h > c ? d + c : b.width > c ? d - a.left : d - a.right + b.width) : m < c && (d = h > c ? d - c : b.width > c ? d - a.right + b.width : d - a.left); c = a.top; b.height - a.top < e && (p = c > e ? p - e : b.height > e ? p - a.bottom + b.height : p - a.top); CKEDITOR.env.ie && !CKEDITOR.env.edge && ((b = a = k.$.offsetParent && new CKEDITOR.dom.element(k.$.offsetParent)) && b.getName() == 'html' && (b = b.getDocument().getBody()), b && b.getComputedStyle('direction') == 'rtl' && (d = CKEDITOR.env.ie8Compat ? d - 2 * k.getDocument().getDocumentElement().$.scrollLeft : d - (a.$.scrollWidth - a.$.clientWidth))); - var a = k.getFirst(); var f; - - (f = a.getCustomData('activePanel')) && f.onHide && f.onHide.call(this, 1); a.setCustomData('activePanel', this); k.setStyles({ top: p + 'px', left: d + 'px' }); k.setOpacity(1); g && g(); - }, this); - - n.isLoaded ? a() : n.onLoad = a; CKEDITOR.tools.setTimeout(function () { - var a = CKEDITOR.env.webkit && CKEDITOR.document.getWindow().getScrollPosition().y; - - this.focus(); l.element.focus(); CKEDITOR.env.webkit && (CKEDITOR.document.getBody().$.scrollTop = a); this.allowBlur(!0); this._.markFirst && (CKEDITOR.env.ie ? CKEDITOR.tools.setTimeout(function () { - l.markFirstDisplayed ? - l.markFirstDisplayed() : l._.markFirstDisplayed(); - }, 0) : l.markFirstDisplayed ? l.markFirstDisplayed() : l._.markFirstDisplayed()); this._.editor.fire('panelShow', this); - }, 0, this); - }, CKEDITOR.env.air ? 200 : 0, this); this.visible = 1; this.onShow && this.onShow.call(this); - }, reposition: function () { - var a = this._.showBlockParams; - - this.visible && this._.showBlockParams && (this.hide(), this.showBlock.apply(this, a)); - }, focus: function () { - if (CKEDITOR.env.webkit) { - var a = CKEDITOR.document.getActive(); - - a && !a.equals(this._.iframe) && a.$.blur(); - }(this._.lastFocused || -this._.iframe.getFrameDocument().getWindow()).focus(); - }, blur: function () { - var a = this._.iframe.getFrameDocument().getActive(); - - a && a.is('a') && (this._.lastFocused = a); - }, hide: function (a) { - if (this.visible && (!this.onHide || !0 !== this.onHide.call(this))) { - this.hideChild(); CKEDITOR.env.gecko && this._.iframe.getFrameDocument().$.activeElement.blur(); this.element.setStyle('display', 'none'); this.visible = 0; this.element.getFirst().removeCustomData('activePanel'); if (a = a && this._.returnFocus) { - CKEDITOR.env.webkit && a.type && a.getWindow().$.focus(), - a.focus(); - } delete this._.lastFocused; this._.showBlockParams = null; this._.editor.fire('panelHide', this); - } - }, allowBlur: function (a) { - var b = this._.panel; - - void 0 !== a && (b.allowBlur = a); return b.allowBlur; - }, showAsChild: function (a, b, c, f, h, g) { - if (this._.activeChild != a || a._.panel._.offsetParentId != c.getId()) { - this.hideChild(), a.onHide = CKEDITOR.tools.bind(function () { - CKEDITOR.tools.setTimeout(function () { - this._.focused || this.hide(); - }, 0, this); - }, this), this._.activeChild = a, this._.focused = !1, a.showBlock(b, c, f, h, g), this.blur(), - (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) && setTimeout(function () { - a.element.getChild(0).$.style.cssText += ''; - }, 100); - } - }, hideChild: function (a) { - var b = this._.activeChild; - - b && (delete b.onHide, delete this._.activeChild, b.hide(), a && this.focus()); - } } }); CKEDITOR.on('instanceDestroyed', function () { - var a = CKEDITOR.tools.isEmpty(CKEDITOR.instances); var b; - - for (b in f) { - var c = f[b]; - - a ? c.destroy() : c.element.hide(); - }a && (f = {}); - }); - })(); CKEDITOR.plugins.add('colorbutton', { requires: 'panelbutton,floatpanel', init: function (d) { - function w(a) { - var u = a.name; var f = a.type; var h = a.title; var v = a.order; var t = a.commandName; - - a = a.contentTransformations || {}; var p = new CKEDITOR.style(k['colorButton_' + f + 'Style']); var q = CKEDITOR.tools.getNextId() + '_colorBox'; var r = { type: f }; var l = new CKEDITOR.style(k['colorButton_' + f + 'Style'], { color: 'inherit' }); var n; - - d.addCommand(t, { contextSensitive: !0, exec: function (a, b) { - if (!a.readOnly) { - var c = b.newStyle; - - a.removeStyle(l); a.focus(); c && a.applyStyle(c); a.fire('saveSnapshot'); - } - }, - refresh: function (a, b) { - l.checkApplicable(b, a, a.activeFilter) ? l.checkActive(b, a) ? this.setState(CKEDITOR.TRISTATE_ON) : this.setState(CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_DISABLED); - } }); d.ui.add(u, CKEDITOR.UI_PANELBUTTON, { label: h, title: h, command: t, editorFocus: 0, toolbar: 'colors,' + v, allowedContent: p, requiredContent: p, contentTransformations: a, panel: { css: CKEDITOR.skin.getPath('editor'), attributes: { 'role': 'listbox', 'aria-label': g.panelTitle } }, select: function (a) { - var b = k.colorButton_colors.split(','); - - a = CKEDITOR.tools.array.find(b, a); a = m(a); x(n, a); n._.markFirstDisplayed(); - }, onBlock: function (a, b) { - n = b; b.autoSize = !0; b.element.addClass('cke_colorblock'); b.element.setHtml(B({ type: f, colorBoxId: q, colorData: r, commandName: t })); b.element.getDocument().getBody().setStyle('overflow', 'hidden'); CKEDITOR.ui.fire('ready', this); var c = b.keys; var e = d.lang.dir == 'rtl'; - - c[e ? 37 : 39] = 'next'; c[40] = 'next'; c[9] = 'next'; c[e ? 39 : 37] = 'prev'; c[38] = 'prev'; c[CKEDITOR.SHIFT + 9] = 'prev'; c[32] = 'click'; - }, onOpen: function () { - var a = d.getSelection(); - var b = a && a.getStartElement(); var c = d.elementPath(b); - - if (!c) { - return null; - } b = c.block || c.blockLimit || d.document.getBody(); do { - c = b && b.getComputedStyle(f == 'back' ? 'background-color' : 'color') || 'transparent'; - } while (f == 'back' && c == 'transparent' && b && (b = b.getParent())); c && c != 'transparent' || (c = '#ffffff'); !1 !== k.colorButton_enableAutomatic && this._.panel._.iframe.getFrameDocument().getById(q).setStyle('background-color', c); if (b = a && a.getRanges()[0]) { - for (var a = new CKEDITOR.dom.walker(b), e = b.collapsed ? b.startContainer : a.next(), - b = ''; e;) { - e.type !== CKEDITOR.NODE_ELEMENT && (e = e.getParent()); e = m(e.getComputedStyle(f == 'back' ? 'background-color' : 'color')); b = b || e; if (b !== e) { - b = ''; break; - }e = a.next(); - }b == 'transparent' && (b = ''); f == 'fore' && (r.automaticTextColor = '#' + m(c)); r.selectionColor = b ? '#' + b : ''; x(n, b); - } return c; - } }); - } function B(a) { - function u(a) { - a = a && new CKEDITOR.style(n, { color: a }); d.execCommand(t, { newStyle: a }); - } var f = a.type; var h = a.colorBoxId; var v = a.colorData; var t = a.commandName; - - a = []; var p = k.colorButton_colors.split(','); var q = k.colorButton_colorsPerRow || -6; var r = d.plugins.colordialog && !1 !== k.colorButton_enableMore; var l = p.length + (r ? 2 : 1); var n = d.config['colorButton_' + f + 'Style']; - - n.childRule = f == 'back' ? function (a) { - return y(a); - } : function (a) { - return !(a.is('a') || a.getElementsByTag('a').count()) || y(a); - }; var m = CKEDITOR.tools.addFunction(function (a) { - d.focus(); d.fire('saveSnapshot'); a == '?' ? d.getColorFromDialog(function (a) { - a && u(a); - }, null, v) : u(a && '#' + a); - }); - - !1 !== k.colorButton_enableAutomatic && a.push('\x3ca class\x3d"cke_colorauto" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"', - g.auto, '" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(', m, ",null,'", f, "');return false;\" href\x3d\"javascript:void('", g.auto, '\')" role\x3d"option" aria-posinset\x3d"1" aria-setsize\x3d"', l, '"\x3e\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e\x3ctr\x3e\x3ctd colspan\x3d"' + q + '" align\x3d"center"\x3e\x3cspan class\x3d"cke_colorbox" id\x3d"', h, '"\x3e\x3c/span\x3e', g.auto, '\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/a\x3e'); - a.push('\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e'); for (h = 0; h < p.length; h++) { - h % q === 0 && a.push('\x3c/tr\x3e\x3ctr\x3e'); var b = p[h].split('/'); var c = b[0]; var e = b[1] || c; - - a.push('\x3ctd\x3e\x3ca class\x3d"cke_colorbox" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"', b[1] ? c : d.lang.colorbutton.colors[e] || e, '" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(', m, ",'", e, "','", f, "'); return false;\" href\x3d\"javascript:void('", e, '\')" data-value\x3d"' + -e + '" role\x3d"option" aria-posinset\x3d"', h + 2, '" aria-setsize\x3d"', l, '"\x3e\x3cspan class\x3d"cke_colorbox" style\x3d"background-color:#', e, '"\x3e\x3c/span\x3e\x3c/a\x3e\x3c/td\x3e'); - }r && a.push('\x3c/tr\x3e\x3ctr\x3e\x3ctd colspan\x3d"' + q + '" align\x3d"center"\x3e\x3ca class\x3d"cke_colormore" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"', g.more, '" draggable\x3d"false" ondragstart\x3d"return false;" onclick\x3d"CKEDITOR.tools.callFunction(', m, ",'?','", f, "');return false;\" href\x3d\"javascript:void('", - g.more, "')\"", ' role\x3d"option" aria-posinset\x3d"', l, '" aria-setsize\x3d"', l, '"\x3e', g.more, '\x3c/a\x3e\x3c/td\x3e'); a.push('\x3c/tr\x3e\x3c/table\x3e'); return a.join(''); - } function y(a) { - return a.getAttribute('contentEditable') == 'false' || a.getAttribute('data-nostyle'); - } function x(a, d) { - for (var f = a._.getItems(), h = 0; h < f.count(); h++) { - var g = f.getItem(h); - - g.removeAttribute('aria-selected'); d && d == m(g.getAttribute('data-value')) && g.setAttribute('aria-selected', !0); - } - } function m(a) { - return CKEDITOR.tools.normalizeHex('#' + -CKEDITOR.tools.convertRgbToHex(a || '')).replace(/#/g, ''); - } var k = d.config; var g = d.lang.colorbutton; - - if (!CKEDITOR.env.hc) { - w({ name: 'TextColor', type: 'fore', commandName: 'textColor', title: g.textColorTitle, order: 10, contentTransformations: [[{ element: 'font', check: 'span{color}', left: function (a) { - return !!a.attributes.color; - }, right: function (a) { - a.name = 'span'; a.attributes.color && (a.styles.color = a.attributes.color); delete a.attributes.color; - } }]] }); var z; var A = d.config.colorButton_normalizeBackground; - - if (void 0 === A || A) { - z = [[{ element: 'span', - left: function (a) { - var d = CKEDITOR.tools; - - if (a.name != 'span' || !a.styles || !a.styles.background) { - return !1; - } a = d.style.parse.background(a.styles.background); return a.color && d.object.keys(a).length === 1; - }, right: function (a) { - var g = new CKEDITOR.style(d.config.colorButton_backStyle, { color: a.styles.background }).getDefinition(); - - a.name = g.element; a.styles = g.styles; a.attributes = g.attributes || {}; return a; - } }]]; - }w({ name: 'BGColor', type: 'back', commandName: 'bgColor', title: g.bgColorTitle, order: 20, contentTransformations: z }); - } - } }); - CKEDITOR.config.colorButton_colors = '1ABC9C,2ECC71,3498DB,9B59B6,4E5F70,F1C40F,16A085,27AE60,2980B9,8E44AD,2C3E50,F39C12,E67E22,E74C3C,ECF0F1,95A5A6,DDD,FFF,D35400,C0392B,BDC3C7,7F8C8D,999,000'; CKEDITOR.config.colorButton_foreStyle = { element: 'span', styles: { color: '#(color)' }, overrides: [{ element: 'font', attributes: { color: null } }] }; CKEDITOR.config.colorButton_backStyle = { element: 'span', styles: { 'background-color': '#(color)' } }; CKEDITOR.plugins.colordialog = { requires: 'dialog', init: function (b) { - var d = new CKEDITOR.dialogCommand('colordialog'); - - d.editorFocus = !1; b.addCommand('colordialog', d); CKEDITOR.dialog.add('colordialog', this.path + 'dialogs/colordialog.js'); b.getColorFromDialog = function (d, k, g) { - var c; var e; var h; var f; - - c = function (a) { - h(this); a = a.name == 'ok' ? this.getValueOf('picker', 'selectedColor') : null; (/^[0-9a-f]{3}([0-9a-f]{3})?$/i).test(a) && (a = '#' + a); d.call(k, a); - }; e = function (a) { - g && (a.data = g); - }; h = function (a) { - a.removeListener('ok', c); a.removeListener('cancel', - c); a.removeListener('show', e); - }; f = function (a) { - a.on('ok', c); a.on('cancel', c); a.on('show', e, null, null, 5); - }; b.execCommand('colordialog'); if (b._.storedDialogs && b._.storedDialogs.colordialog) { - f(b._.storedDialogs.colordialog); - } else { - CKEDITOR.on('dialogDefinition', function (a) { - if (a.data.name == 'colordialog') { - var b = a.data.definition; - - a.removeListener(); b.onLoad = CKEDITOR.tools.override(b.onLoad, function (a) { - return function () { - f(this); b.onLoad = a; typeof a === 'function' && a.call(this); - }; - }); - } - }); - } - }; - } }; - CKEDITOR.plugins.add('colordialog', CKEDITOR.plugins.colordialog); (function () { - CKEDITOR.plugins.add('templates', { requires: 'dialog', init: function (a) { - CKEDITOR.dialog.add('templates', CKEDITOR.getUrl(this.path + 'dialogs/templates.js')); a.addCommand('templates', new CKEDITOR.dialogCommand('templates')); a.ui.addButton && a.ui.addButton('Templates', { label: a.lang.templates.button, command: 'templates', toolbar: 'doctools,10' }); - } }); var c = {}; var f = {}; - - CKEDITOR.addTemplates = function (a, d) { - c[a] = d; - }; CKEDITOR.getTemplates = function (a) { - return c[a]; - }; CKEDITOR.loadTemplates = function (a, d) { - for (var e = -[], b = 0, c = a.length; b < c; b++) { - f[a[b]] || (e.push(a[b]), f[a[b]] = 1); - }e.length ? CKEDITOR.scriptLoader.load(e, d) : setTimeout(d, 0); - }; - })(); CKEDITOR.config.templates_files = [CKEDITOR.getUrl('plugins/templates/templates/default.js')]; CKEDITOR.config.templates_replaceContent = !0; CKEDITOR.plugins.add('menu', { requires: 'floatpanel', beforeInit: function (m) { - for (var k = m.config.menu_groups.split(','), n = m._.menuGroups = {}, r = m._.menuItems = {}, p = 0; p < k.length; p++) { - n[k[p]] = p + 1; - }m.addMenuGroup = function (c, a) { - n[c] = a || 100; - }; m.addMenuItem = function (c, a) { - n[a.group] && (r[c] = new CKEDITOR.menuItem(this, c, a)); - }; m.addMenuItems = function (c) { - for (var a in c) { - this.addMenuItem(a, c[a]); - } - }; m.getMenuItem = function (c) { - return r[c]; - }; m.removeMenuItem = function (c) { - delete r[c]; - }; - } }); - (function () { - function m(a) { - a.sort(function (a, f) { - return a.group < f.group ? -1 : a.group > f.group ? 1 : a.order < f.order ? -1 : a.order > f.order ? 1 : 0; - }); - } var k = '\x3cspan class\x3d"cke_menuitem"\x3e\x3ca id\x3d"{id}" class\x3d"cke_menubutton cke_menubutton__{name} cke_menubutton_{state} {cls}" href\x3d"{href}" title\x3d"{title}" tabindex\x3d"-1" _cke_focus\x3d1 hidefocus\x3d"true" role\x3d"{role}" aria-label\x3d"{attrLabel}" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasPopup}" aria-disabled\x3d"{disabled}" {ariaChecked} draggable\x3d"false"'; - var n = ''; - - CKEDITOR.env.gecko && CKEDITOR.env.mac && (k += ' onkeypress\x3d"return false;"'); CKEDITOR.env.gecko && (k += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;" ondragstart\x3d"return false;"'); CKEDITOR.env.ie && (n = 'return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26'); var k = k + (' onmouseover\x3d"CKEDITOR.tools.callFunction({hoverFn},{index});" onmouseout\x3d"CKEDITOR.tools.callFunction({moveOutFn},{index});" onclick\x3d"' + n + 'CKEDITOR.tools.callFunction({clickFn},{index}); return false;"\x3e') + -'\x3cspan class\x3d"cke_menubutton_inner"\x3e\x3cspan class\x3d"cke_menubutton_icon"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{iconStyle}"\x3e\x3c/span\x3e\x3c/span\x3e\x3cspan class\x3d"cke_menubutton_label"\x3e{label}\x3c/span\x3e{shortcutHtml}{arrowHtml}\x3c/span\x3e\x3c/a\x3e\x3cspan id\x3d"{id}_description" class\x3d"cke_voice_label" aria-hidden\x3d"false"\x3e{ariaShortcut}\x3c/span\x3e\x3c/span\x3e'; var r = CKEDITOR.addTemplate('menuItem', k); var p = CKEDITOR.addTemplate('menuArrow', - '\x3cspan class\x3d"cke_menuarrow"\x3e\x3cspan\x3e{label}\x3c/span\x3e\x3c/span\x3e'); var c = CKEDITOR.addTemplate('menuShortcut', '\x3cspan class\x3d"cke_menubutton_label cke_menubutton_shortcut"\x3e{shortcut}\x3c/span\x3e'); - - CKEDITOR.menu = CKEDITOR.tools.createClass({ $: function (a, b) { - b = this._.definition = b || {}; this.id = CKEDITOR.tools.getNextId(); this.editor = a; this.items = []; this._.listeners = []; this._.level = b.level || 1; var f = CKEDITOR.tools.extend({}, b.panel, { css: [CKEDITOR.skin.getPath('editor')], level: this._.level - -1, block: {} }); var c = f.block.attributes = f.attributes || {}; - - !c.role && (c.role = 'menu'); this._.panelDefinition = f; - }, _: { onShow: function () { - var a = this.editor.getSelection(); var b = a && a.getStartElement(); var f = this.editor.elementPath(); var c = this._.listeners; - - this.removeAll(); for (var h = 0; h < c.length; h++) { - var l = c[h](b, a, f); - - if (l) { - for (var g in l) { - var e = this.editor.getMenuItem(g); - - !e || e.command && !this.editor.getCommand(e.command).state || (e.state = l[g], this.add(e)); - } - } - } - }, onClick: function (a) { - this.hide(); if (a.onClick) { - a.onClick(); - } else { - a.command && -this.editor.execCommand(a.command); - } - }, onEscape: function (a) { - var b = this.parent; - - b ? b._.panel.hideChild(1) : a == 27 && this.hide(1); return !1; - }, onHide: function () { - this.onHide && this.onHide(); - }, showSubMenu: function (a) { - var b = this._.subMenu; var f = this.items[a]; - - if (f = f.getItems && f.getItems()) { - b ? b.removeAll() : (b = this._.subMenu = new CKEDITOR.menu(this.editor, CKEDITOR.tools.extend({}, this._.definition, { level: this._.level + 1 }, !0)), b.parent = this, b._.onClick = CKEDITOR.tools.bind(this._.onClick, this)); for (var c in f) { - var h = this.editor.getMenuItem(c); - - h && (h.state = f[c], b.add(h)); - } var l = this._.panel.getBlock(this.id).element.getDocument().getById(this.id + String(a)); - - setTimeout(function () { - b.show(l, 2); - }, 0); - } else { - this._.panel.hideChild(1); - } - } }, proto: { add: function (a) { - a.order || (a.order = this.items.length); this.items.push(a); - }, removeAll: function () { - this.items = []; - }, show: function (a, b, f, c) { - if (!this.parent && (this._.onShow(), !this.items.length)) { - return; - } b = b || (this.editor.lang.dir == 'rtl' ? 2 : 1); var h = this.items; var l = this.editor; var g = this._.panel; var e = this._.element; - - if (!g) { - g = this._.panel = -new CKEDITOR.ui.floatPanel(this.editor, CKEDITOR.document.getBody(), this._.panelDefinition, this._.level); g.onEscape = CKEDITOR.tools.bind(function (a) { - if (!1 === this._.onEscape(a)) { - return !1; - } - }, this); g.onShow = function () { - g._.panel.getHolderElement().getParent().addClass('cke').addClass('cke_reset_all'); - }; g.onHide = CKEDITOR.tools.bind(function () { - this._.onHide && this._.onHide(); - }, this); e = g.addBlock(this.id, this._.panelDefinition.block); e.autoSize = !0; var d = e.keys; - - d[40] = 'next'; d[9] = 'next'; d[38] = 'prev'; d[CKEDITOR.SHIFT + -9] = 'prev'; d[l.lang.dir == 'rtl' ? 37 : 39] = CKEDITOR.env.ie ? 'mouseup' : 'click'; d[32] = CKEDITOR.env.ie ? 'mouseup' : 'click'; CKEDITOR.env.ie && (d[13] = 'mouseup'); e = this._.element = e.element; d = e.getDocument(); d.getBody().setStyle('overflow', 'hidden'); d.getElementsByTag('html').getItem(0).setStyle('overflow', 'hidden'); this._.itemOverFn = CKEDITOR.tools.addFunction(function (a) { - clearTimeout(this._.showSubTimeout); this._.showSubTimeout = CKEDITOR.tools.setTimeout(this._.showSubMenu, l.config.menu_subMenuDelay || 400, this, [a]); - }, - this); this._.itemOutFn = CKEDITOR.tools.addFunction(function () { - clearTimeout(this._.showSubTimeout); - }, this); this._.itemClickFn = CKEDITOR.tools.addFunction(function (a) { - var b = this.items[a]; - - if (b.state == CKEDITOR.TRISTATE_DISABLED) { - this.hide(1); - } else if (b.getItems) { - this._.showSubMenu(a); - } else { - this._.onClick(b); - } - }, this); - }m(h); for (var d = l.elementPath(), d = ['\x3cdiv class\x3d"cke_menu' + (d && d.direction() != l.lang.dir ? ' cke_mixed_dir_content' : '') + '" role\x3d"presentation"\x3e'], k = h.length, n = k && h[0].group, p = 0; p < k; p++) { - var q = -h[p]; - - n != q.group && (d.push('\x3cdiv class\x3d"cke_menuseparator" role\x3d"separator"\x3e\x3c/div\x3e'), n = q.group); q.render(this, p, d); - }d.push('\x3c/div\x3e'); e.setHtml(d.join('')); CKEDITOR.ui.fire('ready', this); this.parent ? this.parent._.panel.showAsChild(g, this.id, a, b, f, c) : g.showBlock(this.id, a, b, f, c); l.fire('menuShow', [g]); - }, addListener: function (a) { - this._.listeners.push(a); - }, hide: function (a) { - this._.onHide && this._.onHide(); this._.panel && this._.panel.hide(a); - }, findItemByCommandName: function (a) { - var b = CKEDITOR.tools.array.filter(this.items, - function (b) { - return a === b.command; - }); - - return b.length ? (b = b[0], { item: b, element: this._.element.findOne('.' + b.className) }) : null; - } } }); CKEDITOR.menuItem = CKEDITOR.tools.createClass({ $: function (a, b, c) { - CKEDITOR.tools.extend(this, c, { order: 0, className: 'cke_menubutton__' + b }); this.group = a._.menuGroups[this.group]; this.editor = a; this.name = b; - }, proto: { render: function (a, b, f) { - var k = a.id + String(b); var h = typeof this.state === 'undefined' ? CKEDITOR.TRISTATE_OFF : this.state; var l = ''; var g = this.editor; var e; var d; var m = h == CKEDITOR.TRISTATE_ON ? 'on' : h == CKEDITOR.TRISTATE_DISABLED ? - 'disabled' : 'off'; - - this.role in { menuitemcheckbox: 1, menuitemradio: 1 } && (l = ' aria-checked\x3d"' + (h == CKEDITOR.TRISTATE_ON ? 'true' : 'false') + '"'); var n = this.getItems; var t = '\x26#' + (this.editor.lang.dir == 'rtl' ? '9668' : '9658') + ';'; var q = this.name; - - this.icon && !(/\./).test(this.icon) && (q = this.icon); this.command && (e = g.getCommand(this.command), (e = g.getCommandKeystroke(e)) && (d = CKEDITOR.tools.keystrokeToString(g.lang.common.keyboard, e))); e = CKEDITOR.tools.htmlEncodeAttr(this.label); a = { id: k, name: this.name, iconName: q, label: this.label, - attrLabel: e, cls: this.className || '', state: m, hasPopup: n ? 'true' : 'false', disabled: h == CKEDITOR.TRISTATE_DISABLED, title: e + (d ? ' (' + d.display + ')' : ''), ariaShortcut: d ? g.lang.common.keyboardShortcut + ' ' + d.aria : '', href: "javascript:void('" + (e || '').replace("'") + "')", hoverFn: a._.itemOverFn, moveOutFn: a._.itemOutFn, clickFn: a._.itemClickFn, index: b, iconStyle: CKEDITOR.skin.getIconStyle(q, this.editor.lang.dir == 'rtl', q == this.icon ? null : this.icon, this.iconOffset), shortcutHtml: d ? c.output({ shortcut: d.display }) : '', arrowHtml: n ? - p.output({ label: t }) : '', role: this.role ? this.role : 'menuitem', ariaChecked: l }; r.output(a, f); - } } }); - })(); CKEDITOR.config.menu_groups = 'clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div'; CKEDITOR.plugins.add('contextmenu', { requires: 'menu', onLoad: function () { - CKEDITOR.plugins.contextMenu = CKEDITOR.tools.createClass({ base: CKEDITOR.menu, $: function (a) { - this.base.call(this, a, { panel: { css: a.config.contextmenu_contentsCss, className: 'cke_menu_panel', attributes: { 'aria-label': a.lang.contextmenu.options } } }); - }, proto: { addTarget: function (a, f) { - function c() { - e = !1; - } var d; var e; - - a.on('contextmenu', function (a) { - a = a.data; var b = CKEDITOR.env.webkit ? d : CKEDITOR.env.mac ? a.$.metaKey : a.$.ctrlKey; - - if (!f || !b) { - if (a.preventDefault(), - !e) { - if (CKEDITOR.env.mac && CKEDITOR.env.webkit) { - var b = this.editor; var c = new CKEDITOR.dom.elementPath(a.getTarget(), b.editable()).contains(function (a) { - return a.hasAttribute('contenteditable'); - }, !0); - - c && c.getAttribute('contenteditable') == 'false' && b.getSelection().fake(c); - } var c = a.getTarget().getDocument(); var g = a.getTarget().getDocument().getDocumentElement(); var b = !c.equals(CKEDITOR.document); var c = c.getWindow().getScrollPosition(); var h = b ? a.$.clientX : a.$.pageX || c.x + a.$.clientX; var k = b ? a.$.clientY : a.$.pageY || c.y + a.$.clientY; - - CKEDITOR.tools.setTimeout(function () { - this.open(g, null, h, k); - }, CKEDITOR.env.ie ? 200 : 0, this); - } - } - }, this); if (CKEDITOR.env.webkit) { - var b = function () { - d = 0; - }; - - a.on('keydown', function (a) { - d = CKEDITOR.env.mac ? a.data.$.metaKey : a.data.$.ctrlKey; - }); a.on('keyup', b); a.on('contextmenu', b); - }CKEDITOR.env.gecko && !CKEDITOR.env.mac && (a.on('keydown', function (a) { - a.data.$.shiftKey && a.data.$.keyCode === 121 && (e = !0); - }, null, null, 0), a.on('keyup', c), a.on('contextmenu', c)); - }, open: function (a, f, c, d) { - !1 !== this.editor.config.enableContextMenu && this.editor.getSelection().getType() !== -CKEDITOR.SELECTION_NONE && (this.editor.focus(), a = a || CKEDITOR.document.getDocumentElement(), this.editor.selectionChange(1), this.show(a, f, c, d)); - } } }); - }, beforeInit: function (a) { - var f = a.contextMenu = new CKEDITOR.plugins.contextMenu(a); - - a.on('contentDom', function () { - f.addTarget(a.editable(), !1 !== a.config.browserContextMenuOnCtrl); - }); a.addCommand('contextMenu', { exec: function (a) { - var d = 0; var e = 0; var b = a.getSelection().getRanges(); var b = b[b.length - 1].getClientRects(a.editable().isInline()); - - if (b = b[b.length - 1]) { - d = b[a.lang.dir === 'rtl' ? - 'left' : 'right'], e = b.bottom; - }a.contextMenu.open(a.document.getBody().getParent(), null, d, e); - } }); a.setKeystroke(CKEDITOR.SHIFT + 121, 'contextMenu'); a.setKeystroke(CKEDITOR.CTRL + CKEDITOR.SHIFT + 121, 'contextMenu'); - } }); (function () { - function k(a, b, e, d) { - var c = new CKEDITOR.dom.walker(a); - - if (a = a.startContainer.getAscendant(b, !0) || a.endContainer.getAscendant(b, !0)) { - if (e(a), d) { - return; - } - } for (;a = c.next();) { - if (a = a.getAscendant(b, !0)) { - if (e(a), d) { - break; - } - } - } - } function u(a, b) { - var e = { ul: 'ol', ol: 'ul' }; - - return l(b, function (b) { - return b.element === a || b.element === e[a]; - }) !== -1; - } function q(a) { - this.styles = null; this.sticky = !1; this.editor = a; this.filter = new CKEDITOR.filter(a, a.config.copyFormatting_allowRules); !0 === a.config.copyFormatting_allowRules && (this.filter.disabled = -!0); a.config.copyFormatting_disallowRules && this.filter.disallow(a.config.copyFormatting_disallowRules); - } var l = CKEDITOR.tools.indexOf; var r = CKEDITOR.tools.getMouseButton; var t = !1; - - CKEDITOR.plugins.add('copyformatting', { lang: 'az,de,en,it,ja,nb,nl,oc,pl,pt-br,ru,sv,tr,zh,zh-cn', icons: 'copyformatting', hidpi: !0, init: function (a) { - var b = CKEDITOR.plugins.copyformatting; - - b._addScreenReaderContainer(); t || (CKEDITOR.document.appendStyleSheet(this.path + 'styles/copyformatting.css'), t = !0); a.addContentsCss && a.addContentsCss(this.path + -'styles/copyformatting.css'); a.copyFormatting = new b.state(a); a.addCommand('copyFormatting', b.commands.copyFormatting); a.addCommand('applyFormatting', b.commands.applyFormatting); a.ui.addButton('CopyFormatting', { label: a.lang.copyformatting.label, command: 'copyFormatting', toolbar: 'cleanup,0' }); a.on('contentDom', function () { - var b = a.getCommand('copyFormatting'); var d = a.editable(); var c = d.isInline() ? d : a.document; var f = a.ui.get('CopyFormatting'); - - d.attachListener(c, 'mouseup', function (d) { - r(d) === CKEDITOR.MOUSE_BUTTON_LEFT && -b.state === CKEDITOR.TRISTATE_ON && a.execCommand('applyFormatting'); - }); d.attachListener(CKEDITOR.document, 'mouseup', function (c) { - r(c) !== CKEDITOR.MOUSE_BUTTON_LEFT || b.state !== CKEDITOR.TRISTATE_ON || d.contains(c.data.getTarget()) || a.execCommand('copyFormatting'); - }); f && (c = CKEDITOR.document.getById(f._.id), d.attachListener(c, 'dblclick', function () { - a.execCommand('copyFormatting', { sticky: !0 }); - }), d.attachListener(c, 'mouseup', function (a) { - a.data.stopPropagation(); - })); - }); a.config.copyFormatting_keystrokeCopy && a.setKeystroke(a.config.copyFormatting_keystrokeCopy, - 'copyFormatting'); a.on('key', function (b) { - var d = a.getCommand('copyFormatting'); - - b = b.data.domEvent; b.getKeystroke && b.getKeystroke() === 27 && d.state === CKEDITOR.TRISTATE_ON && a.execCommand('copyFormatting'); - }); a.copyFormatting.on('extractFormatting', function (e) { - var d = e.data.element; - - if (d.contains(a.editable()) || d.equals(a.editable())) { - return e.cancel(); - } d = b._convertElementToStyleDef(d); if (!a.copyFormatting.filter.check(new CKEDITOR.style(d), !0, !0)) { - return e.cancel(); - } e.data.styleDef = d; - }); a.copyFormatting.on('applyFormatting', - function (e) { - if (!e.data.preventFormatStripping) { - var d = e.data.range; var c = b._extractStylesFromRange(a, d); var f = b._determineContext(d); var g; var h; - - if (a.copyFormatting._isContextAllowed(f)) { - for (h = 0; h < c.length; h++) { - f = c[h], g = d.createBookmark(), l(b.preservedElements, f.element) === -1 ? CKEDITOR.env.webkit && !CKEDITOR.env.chrome ? c[h].removeFromRange(e.data.range, e.editor) : c[h].remove(e.editor) : u(f.element, e.data.styles) && b._removeStylesFromElementInRange(d, f.element), d.moveToBookmark(g); - } - } - } - }); a.copyFormatting.on('applyFormatting', - function (b) { - var d = CKEDITOR.plugins.copyformatting; var c = d._determineContext(b.data.range); - - c === 'list' && a.copyFormatting._isContextAllowed('list') ? d._applyStylesToListContext(b.editor, b.data.range, b.data.styles) : c === 'table' && a.copyFormatting._isContextAllowed('table') ? d._applyStylesToTableContext(b.editor, b.data.range, b.data.styles) : a.copyFormatting._isContextAllowed('text') && d._applyStylesToTextContext(b.editor, b.data.range, b.data.styles); - }, null, null, 999); - } }); q.prototype._isContextAllowed = function (a) { - var b = -this.editor.config.copyFormatting_allowedContexts; - - return !0 === b || l(b, a) !== -1; - }; CKEDITOR.event.implementOn(q.prototype); CKEDITOR.plugins.copyformatting = { state: q, inlineBoundary: 'h1 h2 h3 h4 h5 h6 p div'.split(' '), excludedAttributes: ['id', 'style', 'href', 'data-cke-saved-href', 'dir'], elementsForInlineTransform: ['li'], excludedElementsFromInlineTransform: ['table', 'thead', 'tbody', 'ul', 'ol'], excludedAttributesFromInlineTransform: ['value', 'type'], preservedElements: 'ul ol li td th tr thead tbody table'.split(' '), - breakOnElements: ['ul', 'ol', 'table'], _initialKeystrokePasteCommand: null, commands: { copyFormatting: { exec: function (a, b) { - var e = CKEDITOR.plugins.copyformatting; var d = a.copyFormatting; var c = b ? b.from == 'keystrokeHandler' : !1; var f = b ? b.sticky || c : !1; var g = e._getCursorContainer(a); var h = CKEDITOR.document.getDocumentElement(); - - if (this.state === CKEDITOR.TRISTATE_ON) { - return d.styles = null, d.sticky = !1, g.removeClass('cke_copyformatting_active'), h.removeClass('cke_copyformatting_disabled'), h.removeClass('cke_copyformatting_tableresize_cursor'), - e._putScreenReaderMessage(a, 'canceled'), e._detachPasteKeystrokeHandler(a), this.setState(CKEDITOR.TRISTATE_OFF); - } d.styles = e._extractStylesFromElement(a, a.elementPath().lastElement); this.setState(CKEDITOR.TRISTATE_ON); c || (g.addClass('cke_copyformatting_active'), h.addClass('cke_copyformatting_tableresize_cursor'), a.config.copyFormatting_outerCursor && h.addClass('cke_copyformatting_disabled')); d.sticky = f; e._putScreenReaderMessage(a, 'copied'); e._attachPasteKeystrokeHandler(a); - } }, applyFormatting: { editorFocus: CKEDITOR.env.ie && -!CKEDITOR.env.edge ? !1 : !0, exec: function (a, b) { - var e = a.getCommand('copyFormatting'); var d = b ? b.from == 'keystrokeHandler' : !1; var c = CKEDITOR.plugins.copyformatting; var f = a.copyFormatting; var g = c._getCursorContainer(a); var h = CKEDITOR.document.getDocumentElement(); - - if (d && !f.styles) { - return c._putScreenReaderMessage(a, 'failed'), c._detachPasteKeystrokeHandler(a), !1; - } d = c._applyFormat(a, f.styles); f.sticky || (f.styles = null, g.removeClass('cke_copyformatting_active'), h.removeClass('cke_copyformatting_disabled'), h.removeClass('cke_copyformatting_tableresize_cursor'), - e.setState(CKEDITOR.TRISTATE_OFF), c._detachPasteKeystrokeHandler(a)); c._putScreenReaderMessage(a, d ? 'applied' : 'canceled'); - } } }, _getCursorContainer: function (a) { - return a.elementMode === CKEDITOR.ELEMENT_MODE_INLINE ? a.editable() : a.editable().getParent(); - }, _convertElementToStyleDef: function (a) { - var b = CKEDITOR.tools; var e = a.getAttributes(CKEDITOR.plugins.copyformatting.excludedAttributes); var b = b.parseCssText(a.getAttribute('style'), !0, !0); - - return { element: a.getName(), type: CKEDITOR.STYLE_INLINE, attributes: e, styles: b }; - }, - _extractStylesFromElement: function (a, b) { - var e = {}; var d = []; - - do { - if (b.type === CKEDITOR.NODE_ELEMENT && !b.hasAttribute('data-cke-bookmark') && (e.element = b, a.copyFormatting.fire('extractFormatting', e, a) && e.styleDef && d.push(new CKEDITOR.style(e.styleDef)), b.getName && l(CKEDITOR.plugins.copyformatting.breakOnElements, b.getName()) !== -1)) { - break; - } - } while ((b = b.getParent()) && b.type === CKEDITOR.NODE_ELEMENT); return d; - }, _extractStylesFromRange: function (a, b) { - for (var e = [], d = new CKEDITOR.dom.walker(b), c; c = d.next();) { - e = e.concat(CKEDITOR.plugins.copyformatting._extractStylesFromElement(a, - c)); - } return e; - }, _removeStylesFromElementInRange: function (a, b) { - for (var e = l(['ol', 'ul', 'table'], b) !== -1, d = new CKEDITOR.dom.walker(a), c; c = d.next();) { - if (c = c.getAscendant(b, !0)) { - if (c.removeAttributes(c.getAttributes()), e) { - break; - } - } - } - }, _getSelectedWordOffset: function (a) { - function b(a, b) { - return a[b ? 'getPrevious' : 'getNext'](function (a) { - return a.type !== CKEDITOR.NODE_COMMENT; - }); - } function e(a) { - return a.type == CKEDITOR.NODE_ELEMENT ? (a = a.getHtml().replace(/ <\/span>/g, ''), a.replace(/<.*?>/g, '')) : a.getText(); - } function d(a, - c) { - var f = a; var g = /\s/g; var h = 'p br ol ul li td th div caption body'.split(' '); var m = !1; var k = !1; var p; var n; - - do { - for (p = b(f, c); !p && f.getParent();) { - f = f.getParent(); if (l(h, f.getName()) !== -1) { - k = m = !0; break; - }p = b(f, c); - } if (p && p.getName && l(h, p.getName()) !== -1) { - m = !0; break; - }f = p; - } while (f && f.getStyle && (f.getStyle('display') == 'none' || !f.getText())); for (f || (f = a); f.type !== CKEDITOR.NODE_TEXT;) { - f = !m || c || k ? f.getChild(0) : f.getChild(f.getChildCount() - 1); - } for (h = e(f); (k = g.exec(h)) != null && (n = k.index, c);) { } if (typeof n !== 'number' && !m) { - return d(f, c); - } if (m) { - c ? - n = 0 : (g = /([\.\b]*$)/, n = (k = g.exec(h)) ? k.index : h.length); - } else if (c && (n += 1, n > h.length)) { - return d(f); - } return { node: f, offset: n }; - } var c = /\b\w+\b/ig; var f; var g; var h; var m; var k; - - h = m = k = a.startContainer; for (f = e(h); (g = c.exec(f)) != null;) { - if (g.index + g[0].length >= a.startOffset) { - return a = g.index, c = g.index + g[0].length, g.index === 0 && (g = d(h, !0), m = g.node, a = g.offset), c >= f.length && (f = d(h), k = f.node, c = f.offset), { startNode: m, startOffset: a, endNode: k, endOffset: c }; - } - } return null; - }, _filterStyles: function (a) { - var b = CKEDITOR.tools.isEmpty; var e = []; var d; var c; - - for (c = 0; c < -a.length; c++) { - d = a[c]._.definition, CKEDITOR.tools.indexOf(CKEDITOR.plugins.copyformatting.inlineBoundary, d.element) !== -1 && (d.element = a[c].element = 'span'), d.element === 'span' && b(d.attributes) && b(d.styles) || e.push(a[c]); - } return e; - }, _determineContext: function (a) { - function b(b) { - var d = new CKEDITOR.dom.walker(a); var c; - - if (a.startContainer.getAscendant(b, !0) || a.endContainer.getAscendant(b, !0)) { - return !0; - } for (;c = d.next();) { - if (c.getAscendant(b, !0)) { - return !0; - } - } - } return b({ ul: 1, ol: 1 }) ? 'list' : b('table') ? 'table' : 'text'; - }, _applyStylesToTextContext: function (a, - b, e) { - var d = CKEDITOR.plugins.copyformatting; var c = d.excludedAttributesFromInlineTransform; var f; var g; - - CKEDITOR.env.webkit && !CKEDITOR.env.chrome && a.getSelection().selectRanges([b]); for (f = 0; f < e.length; f++) { - if (b = e[f], l(d.excludedElementsFromInlineTransform, b.element) === -1) { - if (l(d.elementsForInlineTransform, b.element) !== -1) { - for (b.element = b._.definition.element = 'span', g = 0; g < c.length; g++) { - b._.definition.attributes[c[g]] && delete b._.definition.attributes[c[g]]; - } - }b.apply(a); - } - } - }, _applyStylesToListContext: function (a, b, e) { - var d; - var c; var f; - - for (f = 0; f < e.length; f++) { - d = e[f], c = b.createBookmark(), d.element === 'ol' || d.element === 'ul' ? k(b, { ul: 1, ol: 1 }, function (a) { - var b = d; - - a.getName() !== b.element && a.renameNode(b.element); b.applyToObject(a); - }, !0) : d.element === 'li' ? k(b, 'li', function (a) { - d.applyToObject(a); - }) : CKEDITOR.plugins.copyformatting._applyStylesToTextContext(a, b, [d]), b.moveToBookmark(c); - } - }, _applyStylesToTableContext: function (a, b, e) { - function d(a, b) { - a.getName() !== b.element && (b = b.getDefinition(), b.element = a.getName(), b = new CKEDITOR.style(b)); b.applyToObject(a); - } - var c; var f; var g; - - for (g = 0; g < e.length; g++) { - c = e[g], f = b.createBookmark(), l(['table', 'tr'], c.element) !== -1 ? k(b, c.element, function (a) { - c.applyToObject(a); - }) : l(['td', 'th'], c.element) !== -1 ? k(b, { td: 1, th: 1 }, function (a) { - d(a, c); - }) : l(['thead', 'tbody'], c.element) !== -1 ? k(b, { thead: 1, tbody: 1 }, function (a) { - d(a, c); - }) : CKEDITOR.plugins.copyformatting._applyStylesToTextContext(a, b, [c]), b.moveToBookmark(f); - } - }, _applyFormat: function (a, b) { - var e = a.getSelection().getRanges()[0]; var d = CKEDITOR.plugins.copyformatting; var c; var f; - - if (!e) { - return !1; - } if (e.collapsed) { - f = -a.getSelection().createBookmarks(); if (!(c = d._getSelectedWordOffset(e))) { - return; - } e = a.createRange(); e.setStart(c.startNode, c.startOffset); e.setEnd(c.endNode, c.endOffset); e.select(); - }b = d._filterStyles(b); if (!a.copyFormatting.fire('applyFormatting', { styles: b, range: e, preventFormatStripping: !1 }, a)) { - return !1; - } f && a.getSelection().selectBookmarks(f); return !0; - }, _putScreenReaderMessage: function (a, b) { - var e = this._getScreenReaderContainer(); - - e && e.setText(a.lang.copyformatting.notification[b]); - }, _addScreenReaderContainer: function () { - if (this._getScreenReaderContainer()) { - return this._getScreenReaderContainer(); - } - if (!CKEDITOR.env.ie6Compat && !CKEDITOR.env.ie7Compat) { - return CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_screen_reader_only cke_copyformatting_notification"\x3e\x3cdiv aria-live\x3d"polite"\x3e\x3c/div\x3e\x3c/div\x3e')).getChild(0); - } - }, _getScreenReaderContainer: function () { - if (!CKEDITOR.env.ie6Compat && !CKEDITOR.env.ie7Compat) { - return CKEDITOR.document.getBody().findOne('.cke_copyformatting_notification div[aria-live]'); - } - }, _attachPasteKeystrokeHandler: function (a) { - var b = -a.config.copyFormatting_keystrokePaste; - - b && (this._initialKeystrokePasteCommand = a.keystrokeHandler.keystrokes[b], a.setKeystroke(b, 'applyFormatting')); - }, _detachPasteKeystrokeHandler: function (a) { - var b = a.config.copyFormatting_keystrokePaste; - - b && a.setKeystroke(b, this._initialKeystrokePasteCommand || !1); - } }; CKEDITOR.config.copyFormatting_outerCursor = !0; CKEDITOR.config.copyFormatting_allowRules = 'b s u i em strong span p div td th ol ul li(*)[*]{*}'; CKEDITOR.config.copyFormatting_disallowRules = '*[data-cke-widget*,data-widget*,data-cke-realelement](cke_widget*)'; - CKEDITOR.config.copyFormatting_allowedContexts = !0; CKEDITOR.config.copyFormatting_keystrokeCopy = CKEDITOR.CTRL + CKEDITOR.SHIFT + 67; CKEDITOR.config.copyFormatting_keystrokePaste = CKEDITOR.CTRL + CKEDITOR.SHIFT + 86; - })(); (function () { - CKEDITOR.plugins.add('div', { requires: 'dialog', init: function (a) { - if (!a.blockless) { - var c = a.lang.div; var b = 'div(*)'; - - CKEDITOR.dialog.isTabEnabled(a, 'editdiv', 'advanced') && (b += ';div[dir,id,lang,title]{*}'); a.addCommand('creatediv', new CKEDITOR.dialogCommand('creatediv', { allowedContent: b, requiredContent: 'div', contextSensitive: !0, contentTransformations: [['div: alignmentToStyle']], refresh: function (a, c) { - this.setState('div' in (a.config.div_wrapTable ? c.root : c.blockLimit).getDtd() ? CKEDITOR.TRISTATE_OFF : - CKEDITOR.TRISTATE_DISABLED); - } })); a.addCommand('editdiv', new CKEDITOR.dialogCommand('editdiv', { requiredContent: 'div' })); a.addCommand('removediv', { requiredContent: 'div', exec: function (a) { - function c(b) { - (b = CKEDITOR.plugins.div.getSurroundDiv(a, b)) && !b.data('cke-div-added') && (f.push(b), b.data('cke-div-added')); - } for (var b = a.getSelection(), g = b && b.getRanges(), e, h = b.createBookmarks(), f = [], d = 0; d < g.length; d++) { - e = g[d], e.collapsed ? c(b.getStartElement()) : (e = new CKEDITOR.dom.walker(e), e.evaluator = c, e.lastForward()); - } - for (d = 0; d < f.length; d++) { - f[d].remove(!0); - }b.selectBookmarks(h); - } }); a.ui.addButton && a.ui.addButton('CreateDiv', { label: c.toolbar, command: 'creatediv', toolbar: 'blocks,50' }); a.addMenuItems && (a.addMenuItems({ editdiv: { label: c.edit, command: 'editdiv', group: 'div', order: 1 }, removediv: { label: c.remove, command: 'removediv', group: 'div', order: 5 } }), a.contextMenu && a.contextMenu.addListener(function (b) { - return !b || b.isReadOnly() ? null : CKEDITOR.plugins.div.getSurroundDiv(a) ? { editdiv: CKEDITOR.TRISTATE_OFF, removediv: CKEDITOR.TRISTATE_OFF } : - null; - })); CKEDITOR.dialog.add('creatediv', this.path + 'dialogs/div.js'); CKEDITOR.dialog.add('editdiv', this.path + 'dialogs/div.js'); - } - } }); CKEDITOR.plugins.div = { getSurroundDiv: function (a, c) { - var b = a.elementPath(c); - - return a.elementPath(b.blockLimit).contains(function (a) { - return a.is('div') && !a.isReadOnly(); - }, 1); - } }; - })(); CKEDITOR.plugins.add('resize', { init: function (b) { - function f(d) { - var e = c.width; var m = c.height; var f = e + (d.data.$.screenX - n.x) * (g == 'rtl' ? -1 : 1); - - d = m + (d.data.$.screenY - n.y); h && (e = Math.max(a.resize_minWidth, Math.min(f, a.resize_maxWidth))); p && (m = Math.max(a.resize_minHeight, Math.min(d, a.resize_maxHeight))); b.resize(h ? e : null, m); - } function k() { - CKEDITOR.document.removeListener('mousemove', f); CKEDITOR.document.removeListener('mouseup', k); b.document && (b.document.removeListener('mousemove', f), b.document.removeListener('mouseup', - k)); - } var a = b.config; var r = b.ui.spaceId('resizer'); var g = b.element ? b.element.getDirection(1) : 'ltr'; - - !a.resize_dir && (a.resize_dir = 'vertical'); void 0 === a.resize_maxWidth && (a.resize_maxWidth = 3E3); void 0 === a.resize_maxHeight && (a.resize_maxHeight = 3E3); void 0 === a.resize_minWidth && (a.resize_minWidth = 750); void 0 === a.resize_minHeight && (a.resize_minHeight = 250); if (!1 !== a.resize_enabled) { - var l = null; var n; var c; var h = (a.resize_dir == 'both' || a.resize_dir == 'horizontal') && a.resize_minWidth != a.resize_maxWidth; var p = (a.resize_dir == 'both' || a.resize_dir == -'vertical') && a.resize_minHeight != a.resize_maxHeight; var q = CKEDITOR.tools.addFunction(function (d) { - l || (l = b.getResizable()); c = { width: l.$.offsetWidth || 0, height: l.$.offsetHeight || 0 }; n = { x: d.screenX, y: d.screenY }; a.resize_minWidth > c.width && (a.resize_minWidth = c.width); a.resize_minHeight > c.height && (a.resize_minHeight = c.height); CKEDITOR.document.on('mousemove', f); CKEDITOR.document.on('mouseup', k); b.document && (b.document.on('mousemove', f), b.document.on('mouseup', k)); d.preventDefault && d.preventDefault(); - }); - - b.on('destroy', - function () { - CKEDITOR.tools.removeFunction(q); - }); b.on('uiSpace', function (a) { - if (a.data.space == 'bottom') { - var e = ''; - - h && !p && (e = ' cke_resizer_horizontal'); !h && p && (e = ' cke_resizer_vertical'); var c = '\x3cspan id\x3d"' + r + '" class\x3d"cke_resizer' + e + ' cke_resizer_' + g + '" title\x3d"' + CKEDITOR.tools.htmlEncode(b.lang.common.resize) + '" onmousedown\x3d"CKEDITOR.tools.callFunction(' + q + ', event)"\x3e' + (g == 'ltr' ? '◢' : '◣') + '\x3c/span\x3e'; - - g == 'ltr' && e == 'ltr' ? a.data.html += c : a.data.html = c + a.data.html; - } - }, b, null, 100); b.on('maximize', - function (a) { - b.ui.space('resizer')[a.data == CKEDITOR.TRISTATE_ON ? 'hide' : 'show'](); - }); - } - } }); (function () { - function q(a, c) { - function k(b) { - b = h.list[b]; var e; - - b.equals(a.editable()) || b.getAttribute('contenteditable') == 'true' ? (e = a.createRange(), e.selectNodeContents(b), e = e.select()) : (e = a.getSelection(), e.selectElement(b)); CKEDITOR.env.ie && a.fire('selectionChange', { selection: e, path: new CKEDITOR.dom.elementPath(b) }); a.focus(); - } function l() { - m && m.setHtml('\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e'); delete h.list; - } var n = a.ui.spaceId('path'); var m; var h = a._.elementsPath; var q = h.idBase; - - c.html += '\x3cspan id\x3d"' + -n + '_label" class\x3d"cke_voice_label"\x3e' + a.lang.elementspath.eleLabel + '\x3c/span\x3e\x3cspan id\x3d"' + n + '" class\x3d"cke_path" role\x3d"group" aria-labelledby\x3d"' + n + '_label"\x3e\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e\x3c/span\x3e'; a.on('uiReady', function () { - var b = a.ui.space('path'); - - b && a.focusManager.add(b, 1); - }); h.onClick = k; var v = CKEDITOR.tools.addFunction(k); var w = CKEDITOR.tools.addFunction(function (b, e) { - var g = h.idBase; var d; - - e = new CKEDITOR.dom.event(e); d = a.lang.dir == 'rtl'; switch (e.getKeystroke()) { - case d ? - 39 : 37:case 9:return (d = CKEDITOR.document.getById(g + (b + 1))) || (d = CKEDITOR.document.getById(g + '0')), d.focus(), !1; case d ? 37 : 39:case CKEDITOR.SHIFT + 9:return (d = CKEDITOR.document.getById(g + (b - 1))) || (d = CKEDITOR.document.getById(g + (h.list.length - 1))), d.focus(), !1; case 27:return a.focus(), !1; case 13:case 32:return k(b), !1; - } return !0; - }); - - a.on('selectionChange', function (b) { - for (var e = [], g = h.list = [], d = [], c = h.filters, p = !0, k = b.data.path.elements, u = k.length; u--;) { - var f = k[u]; var r = 0; - - b = f.data('cke-display-name') ? f.data('cke-display-name') : - f.data('cke-real-element-type') ? f.data('cke-real-element-type') : f.getName(); (p = f.hasAttribute('contenteditable') ? f.getAttribute('contenteditable') == 'true' : p) || f.hasAttribute('contenteditable') || (r = 1); for (var t = 0; t < c.length; t++) { - var l = c[t](f, b); - - if (!1 === l) { - r = 1; break; - }b = l || b; - }r || (g.unshift(f), d.unshift(b)); - }g = g.length; for (c = 0; c < g; c++) { - b = d[c], p = a.lang.elementspath.eleTitle.replace(/%1/, b), b = x.output({ id: q + c, label: p, text: b, jsTitle: "javascript:void('" + b + "')", index: c, keyDownFn: w, clickFn: v }), e.unshift(b); - }m || -(m = CKEDITOR.document.getById(n)); d = m; d.setHtml(e.join('') + '\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e'); a.fire('elementsPathUpdate', { space: d }); - }); a.on('readOnly', l); a.on('contentDomUnload', l); a.addCommand('elementsPathFocus', y.toolbarFocus); a.setKeystroke(CKEDITOR.ALT + 122, 'elementsPathFocus'); - } var y = { toolbarFocus: { editorFocus: !1, readOnly: 1, exec: function (a) { - (a = CKEDITOR.document.getById(a._.elementsPath.idBase + '0')) && a.focus(CKEDITOR.env.ie || CKEDITOR.env.air); - } } }; var c = ''; - - CKEDITOR.env.gecko && -CKEDITOR.env.mac && (c += ' onkeypress\x3d"return false;"'); CKEDITOR.env.gecko && (c += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;"'); var x = CKEDITOR.addTemplate('pathItem', '\x3ca id\x3d"{id}" href\x3d"{jsTitle}" tabindex\x3d"-1" class\x3d"cke_path_item" title\x3d"{label}"' + c + ' hidefocus\x3d"true" draggable\x3d"false" ondragstart\x3d"return false;" onkeydown\x3d"return CKEDITOR.tools.callFunction({keyDownFn},{index}, event );" onclick\x3d"CKEDITOR.tools.callFunction({clickFn},{index}); return false;" role\x3d"button" aria-label\x3d"{label}"\x3e{text}\x3c/a\x3e'); - - CKEDITOR.plugins.add('elementspath', { init: function (a) { - a._.elementsPath = { idBase: 'cke_elementspath_' + CKEDITOR.tools.getNextNumber() + '_', filters: [] }; a.on('uiSpace', function (c) { - c.data.space == 'bottom' && q(a, c.data); - }); - } }); - })(); (function () { - function x(a, e, b) { - b = a.config.forceEnterMode || b; if (a.mode == 'wysiwyg') { - e || (e = a.activeEnterMode); var l = a.elementPath(); - - l && !l.isContextFor('p') && (e = CKEDITOR.ENTER_BR, b = 1); a.fire('saveSnapshot'); e == CKEDITOR.ENTER_BR ? u(a, e, null, b) : r(a, e, null, b); a.fire('saveSnapshot'); - } - } function y(a) { - a = a.getSelection().getRanges(!0); for (var e = a.length - 1; e > 0; e--) { - a[e].deleteContents(); - } return a[0]; - } function z(a) { - var e = a.startContainer.getAscendant(function (a) { - return a.type == CKEDITOR.NODE_ELEMENT && a.getAttribute('contenteditable') == 'true'; - }, - !0); - - if (a.root.equals(e)) { - return a; - } e = new CKEDITOR.dom.range(e); e.moveToRange(a); return e; - }CKEDITOR.plugins.add('enterkey', { init: function (a) { - a.addCommand('enter', { modes: { wysiwyg: 1 }, editorFocus: !1, exec: function (a) { - x(a); - } }); a.addCommand('shiftEnter', { modes: { wysiwyg: 1 }, editorFocus: !1, exec: function (a) { - x(a, a.activeShiftEnterMode, 1); - } }); a.setKeystroke([[13, 'enter'], [CKEDITOR.SHIFT + 13, 'shiftEnter']]); - } }); var A = CKEDITOR.dom.walker.whitespaces(); var B = CKEDITOR.dom.walker.bookmark(); var v; var u; var r; var w; - - CKEDITOR.plugins.enterkey = -{ enterBlock: function (a, e, b, l) { - function n(a) { - var b; - - if (a === CKEDITOR.ENTER_BR || CKEDITOR.tools.indexOf(['td', 'th'], p.lastElement.getName()) === -1 || p.lastElement.getChildCount() !== 1) { - return !1; - } a = p.lastElement.getChild(0).clone(!0); (b = a.getBogus()) && b.remove(); return a.getText().length ? !1 : !0; - } if (b = b || y(a)) { - b = z(b); var g = b.document; var f = b.checkStartOfBlock(); var k = b.checkEndOfBlock(); var p = a.elementPath(b.startContainer); var c = p.block; var m = e == CKEDITOR.ENTER_DIV ? 'div' : 'p'; var d; - - if (c && f && k) { - f = c.getParent(); if (f.is('li') && f.getChildCount() > 1) { - g = -new CKEDITOR.dom.element('li'); d = a.createRange(); g.insertAfter(f); c.remove(); d.setStart(g, 0); a.getSelection().selectRanges([d]); return; - } if (c.is('li') || c.getParent().is('li')) { - c.is('li') || (c = c.getParent(), f = c.getParent()); d = f.getParent(); b = !c.hasPrevious(); var h = !c.hasNext(); - - l = a.getSelection(); var m = l.createBookmarks(); var t = c.getDirection(1); var k = c.getAttribute('class'); var q = c.getAttribute('style'); var r = d.getDirection(1) != t; - - a = a.enterMode != CKEDITOR.ENTER_BR || r || q || k; if (d.is('li')) { - b || h ? (b && h && f.remove(), c[h ? 'insertAfter' : - 'insertBefore'](d)) : c.breakParent(d); - } else { - if (a) { - if (p.block.is('li') ? (d = g.createElement(e == CKEDITOR.ENTER_P ? 'p' : 'div'), r && d.setAttribute('dir', t), q && d.setAttribute('style', q), k && d.setAttribute('class', k), c.moveChildren(d)) : d = p.block, b || h) { - d[b ? 'insertBefore' : 'insertAfter'](f); - } else { - c.breakParent(f), d.insertAfter(f); - } - } else if (c.appendBogus(!0), b || h) { - for (;g = c[b ? 'getFirst' : 'getLast']();) { - g[b ? 'insertBefore' : 'insertAfter'](f); - } - } else { - for (c.breakParent(f); g = c.getLast();) { - g.insertAfter(f); - } - }c.remove(); - }l.selectBookmarks(m); - return; - } if (c && c.getParent().is('blockquote')) { - c.breakParent(c.getParent()); c.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1)) || c.getPrevious().remove(); c.getNext().getFirst(CKEDITOR.dom.walker.invisible(1)) || c.getNext().remove(); b.moveToElementEditStart(c); b.select(); return; - } - } else if (c && c.is('pre') && !k) { - u(a, e, b, l); return; - } if (q = b.splitBlock(m)) { - a = q.previousBlock; c = q.nextBlock; f = q.wasStartOfBlock; k = q.wasEndOfBlock; c ? (h = c.getParent(), h.is('li') && (c.breakParent(h), c.move(c.getNext(), 1))) : a && (h = a.getParent()) && -h.is('li') && (a.breakParent(h), h = a.getNext(), b.moveToElementEditStart(h), a.move(a.getPrevious())); if (f || k) { - if (n(e)) { - b.moveToElementEditStart(b.getTouchedStartNode()); - } else { - if (a) { - if (a.is('li') || !w.test(a.getName()) && !a.is('pre')) { - d = a.clone(); - } - } else { - c && (d = c.clone()); - }d ? l && !d.is('li') && d.renameNode(m) : h && h.is('li') ? d = h : (d = g.createElement(m), a && (t = a.getDirection()) && d.setAttribute('dir', t)); if (g = q.elementPath) { - for (e = 0, l = g.elements.length; e < l; e++) { - m = g.elements[e]; if (m.equals(g.block) || m.equals(g.blockLimit)) { - break; - } - CKEDITOR.dtd.$removeEmpty[m.getName()] && (m = m.clone(), d.moveChildren(m), d.append(m)); - } - }d.appendBogus(); d.getParent() || b.insertNode(d); d.is('li') && d.removeAttribute('value'); !CKEDITOR.env.ie || !f || k && a.getChildCount() || (b.moveToElementEditStart(k ? a : d), b.select()); b.moveToElementEditStart(f && !k ? c : d); - } - } else { - c.is('li') && (d = b.clone(), d.selectNodeContents(c), d = new CKEDITOR.dom.walker(d), d.evaluator = function (a) { - return !(B(a) || A(a) || a.type == CKEDITOR.NODE_ELEMENT && a.getName() in CKEDITOR.dtd.$inline && !(a.getName() in -CKEDITOR.dtd.$empty)); - }, (h = d.next()) && h.type == CKEDITOR.NODE_ELEMENT && h.is('ul', 'ol') && (CKEDITOR.env.needsBrFiller ? g.createElement('br') : g.createText(' ')).insertBefore(h)), c && b.moveToElementEditStart(c); - }b.select(); b.scrollIntoView(); - } - } -}, enterBr: function (a, e, b, l) { - if (b = b || y(a)) { - var n = b.document; var g = b.checkEndOfBlock(); var f = new CKEDITOR.dom.elementPath(a.getSelection().getStartElement()); var k = f.block; var p = k && f.block.getName(); - - l || p != 'li' ? (!l && g && w.test(p) ? (g = k.getDirection()) ? (n = n.createElement('div'), n.setAttribute('dir', - g), n.insertAfter(k), b.setStart(n, 0)) : (n.createElement('br').insertAfter(k), CKEDITOR.env.gecko && n.createText('').insertAfter(k), b.setStartAt(k.getNext(), CKEDITOR.env.ie ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_START)) : (a = p == 'pre' && CKEDITOR.env.ie && CKEDITOR.env.version < 8 ? n.createText('\r') : n.createElement('br'), b.deleteContents(), b.insertNode(a), CKEDITOR.env.needsBrFiller ? (n.createText('').insertAfter(a), g && (k || f.blockLimit).appendBogus(), a.getNext().$.nodeValue = '', b.setStartAt(a.getNext(), - CKEDITOR.POSITION_AFTER_START)) : b.setStartAt(a, CKEDITOR.POSITION_AFTER_END)), b.collapse(!0), b.select(), b.scrollIntoView()) : r(a, e, b, l); - } -} }; v = CKEDITOR.plugins.enterkey; u = v.enterBr; r = v.enterBlock; w = /^h[1-6]$/; - })(); (function () { - function k(a, f) { - var g = {}; var c = []; var e = { nbsp: ' ', shy: '­', gt: '\x3e', lt: '\x3c', amp: '\x26', apos: "'", quot: '"' }; - - a = a.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g, function (a, b) { - var d = f ? '\x26' + b + ';' : e[b]; - - g[d] = f ? e[b] : '\x26' + b + ';'; c.push(d); return ''; - }); a = a.replace(/,$/, ''); if (!f && a) { - a = a.split(','); var b = document.createElement('div'); var d; - - b.innerHTML = '\x26' + a.join(';\x26') + ';'; d = b.innerHTML; b = null; for (b = 0; b < d.length; b++) { - var h = d.charAt(b); - - g[h] = '\x26' + a[b] + ';'; c.push(h); - } - }g.regex = c.join(f ? '|' : ''); return g; - } - CKEDITOR.plugins.add('entities', { afterInit: function (a) { - function f(b) { - return h[b]; - } function g(a) { - return c.entities_processNumerical != 'force' && b[a] ? b[a] : '\x26#' + a.charCodeAt(0) + ';'; - } var c = a.config; - - if (a = (a = a.dataProcessor) && a.htmlFilter) { - var e = []; - - !1 !== c.basicEntities && e.push('nbsp,gt,lt,amp'); c.entities && (e.length && e.push('quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro'), - c.entities_latin && e.push('Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml'), c.entities_greek && e.push('Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv'), - c.entities_additional && e.push(c.entities_additional)); var b = k(e.join(',')); var d = b.regex ? '[' + b.regex + ']' : 'a^'; - - delete b.regex; c.entities && c.entities_processNumerical && (d = '[^ -~]|' + d); var d = new RegExp(d, 'g'); var h = k('nbsp,gt,lt,amp,shy', !0); var l = new RegExp(h.regex, 'g'); - - a.addRules({ text: function (a) { - return a.replace(l, f).replace(d, g); - } }, { applyToAll: !0, excludeNestedEditable: !0 }); - } - } }); - })(); CKEDITOR.config.basicEntities = !0; CKEDITOR.config.entities = !0; CKEDITOR.config.entities_latin = !0; CKEDITOR.config.entities_greek = !0; - CKEDITOR.config.entities_additional = '#39'; CKEDITOR.plugins.add('popup'); - CKEDITOR.tools.extend(CKEDITOR.editor.prototype, { popup: function (e, a, b, d) { - a = a || '80%'; b = b || '70%'; typeof a === 'string' && a.length > 1 && a.substr(a.length - 1, 1) == '%' && (a = parseInt(window.screen.width * parseInt(a, 10) / 100, 10)); typeof b === 'string' && b.length > 1 && b.substr(b.length - 1, 1) == '%' && (b = parseInt(window.screen.height * parseInt(b, 10) / 100, 10)); a < 640 && (a = 640); b < 420 && (b = 420); var f = parseInt((window.screen.height - b) / 2, 10); var g = parseInt((window.screen.width - a) / 2, 10); - - d = (d || 'location\x3dno,menubar\x3dno,toolbar\x3dno,dependent\x3dyes,minimizable\x3dno,modal\x3dyes,alwaysRaised\x3dyes,resizable\x3dyes,scrollbars\x3dyes') + ',width\x3d' + -a + ',height\x3d' + b + ',top\x3d' + f + ',left\x3d' + g; var c = window.open('', null, d, !0); - - if (!c) { - return !1; - } try { - navigator.userAgent.toLowerCase().indexOf(' chrome/') == -1 && (c.moveTo(g, f), c.resizeTo(a, b)), c.focus(), c.location.href = e; - } catch (h) { - window.open(e, null, d, !0); - } return !0; - } }); (function () { - function k(a) { - this.editor = a; this.loaders = []; - } function l(a, c, b) { - var d = a.config.fileTools_defaultFileName; - - this.editor = a; this.lang = a.lang; typeof c === 'string' ? (this.data = c, this.file = n(this.data), this.loaded = this.total = this.file.size) : (this.data = null, this.file = c, this.total = this.file.size, this.loaded = 0); b ? this.fileName = b : this.file.name ? this.fileName = this.file.name : (a = this.file.type.split('/'), d && (a[0] = d), this.fileName = a.join('.')); this.uploaded = 0; this.responseData = this.uploadTotal = null; this.status = -'created'; this.abort = function () { - this.changeStatus('abort'); - }; - } function n(a) { - var c = a.match(m)[1]; - - a = a.replace(m, ''); a = atob(a); var b = []; var d; var f; var g; var e; - - for (d = 0; d < a.length; d += 512) { - f = a.slice(d, d + 512); g = Array(f.length); for (e = 0; e < f.length; e++) { - g[e] = f.charCodeAt(e); - }f = new Uint8Array(g); b.push(f); - } return new Blob(b, { type: c }); - }CKEDITOR.plugins.add('filetools', { beforeInit: function (a) { - a.uploadRepository = new k(a); a.on('fileUploadRequest', function (a) { - var b = a.data.fileLoader; - - b.xhr.open('POST', b.uploadUrl, !0); a.data.requestData.upload = -{ file: b.file, name: b.fileName }; - }, null, null, 5); a.on('fileUploadRequest', function (c) { - var b = c.data.fileLoader; var d = new FormData(); - - c = c.data.requestData; var f = a.config.fileTools_requestHeaders; var g; var e; - - for (e in c) { - var h = c[e]; - - typeof h === 'object' && h.file ? d.append(e, h.file, h.name) : d.append(e, h); - }d.append('ckCsrfToken', CKEDITOR.tools.getCsrfToken()); if (f) { - for (g in f) { - b.xhr.setRequestHeader(g, f[g]); - } - }b.xhr.send(d); - }, null, null, 999); a.on('fileUploadResponse', function (a) { - var b = a.data.fileLoader; var d = b.xhr; var f = a.data; - - try { - var g = JSON.parse(d.responseText); - - g.error && g.error.message && (f.message = g.error.message); if (g.uploaded) { - for (var e in g) { - f[e] = g[e]; - } - } else { - a.cancel(); - } - } catch (h) { - f.message = b.lang.filetools.responseError, CKEDITOR.warn('filetools-response-error', { responseText: d.responseText }), a.cancel(); - } - }, null, null, 999); - } }); k.prototype = { create: function (a, c, b) { - b = b || l; var d = this.loaders.length; - - a = new b(this.editor, a, c); a.id = d; this.loaders[d] = a; this.fire('instanceCreated', a); return a; - }, isFinished: function () { - for (var a = 0; a < this.loaders.length; ++a) { - if (!this.loaders[a].isFinished()) { - return !1; - } - } - return !0; - } }; l.prototype = { loadAndUpload: function (a, c) { - var b = this; - - this.once('loaded', function (d) { - d.cancel(); b.once('update', function (a) { - a.cancel(); - }, null, null, 0); b.upload(a, c); - }, null, null, 0); this.load(); - }, load: function () { - var a = this; var c = this.reader = new FileReader(); - - a.changeStatus('loading'); this.abort = function () { - a.reader.abort(); - }; c.onabort = function () { - a.changeStatus('abort'); - }; c.onerror = function () { - a.message = a.lang.filetools.loadError; a.changeStatus('error'); - }; c.onprogress = function (b) { - a.loaded = b.loaded; a.update(); - }; - c.onload = function () { - a.loaded = a.total; a.data = c.result; a.changeStatus('loaded'); - }; c.readAsDataURL(this.file); - }, upload: function (a, c) { - var b = c || {}; - - a ? (this.uploadUrl = a, this.xhr = new XMLHttpRequest(), this.attachRequestListeners(), this.editor.fire('fileUploadRequest', { fileLoader: this, requestData: b }) && this.changeStatus('uploading')) : (this.message = this.lang.filetools.noUrlError, this.changeStatus('error')); - }, attachRequestListeners: function () { - function a() { - b.status != 'error' && (b.message = b.lang.filetools.networkError, - b.changeStatus('error')); - } function c() { - b.status != 'abort' && b.changeStatus('abort'); - } var b = this; var d = this.xhr; - - b.abort = function () { - d.abort(); c(); - }; d.onerror = a; d.onabort = c; d.upload ? (d.upload.onprogress = function (a) { - a.lengthComputable && (b.uploadTotal || (b.uploadTotal = a.total), b.uploaded = a.loaded, b.update()); - }, d.upload.onerror = a, d.upload.onabort = c) : (b.uploadTotal = b.total, b.update()); d.onload = function () { - b.update(); if (b.status != 'abort') { - if (b.uploaded = b.uploadTotal, d.status < 200 || d.status > 299) { - b.message = b.lang.filetools['httpError' + -d.status], b.message || (b.message = b.lang.filetools.httpError.replace('%1', d.status)), b.changeStatus('error'); - } else { - for (var a = { fileLoader: b }, c = ['message', 'fileName', 'url'], e = b.editor.fire('fileUploadResponse', a), h = 0; h < c.length; h++) { - var k = c[h]; - - typeof a[k] === 'string' && (b[k] = a[k]); - }b.responseData = a; delete b.responseData.fileLoader; !1 === e ? b.changeStatus('error') : b.changeStatus('uploaded'); - } - } - }; - }, changeStatus: function (a) { - this.status = a; if (a == 'error' || a == 'abort' || a == 'loaded' || a == 'uploaded') { - this.abort = function () {}; - } - this.fire(a); this.update(); - }, update: function () { - this.fire('update'); - }, isFinished: function () { - return !!this.status.match(/^(?:loaded|uploaded|error|abort)$/); - } }; CKEDITOR.event.implementOn(k.prototype); CKEDITOR.event.implementOn(l.prototype); var m = /^data:(\S*?);base64,/; - - CKEDITOR.fileTools || (CKEDITOR.fileTools = {}); CKEDITOR.tools.extend(CKEDITOR.fileTools, { uploadRepository: k, fileLoader: l, getUploadUrl: function (a, c) { - var b = CKEDITOR.tools.capitalize; - - return c && a[c + 'UploadUrl'] ? a[c + 'UploadUrl'] : a.uploadUrl ? a.uploadUrl : - c && a['filebrowser' + b(c, 1) + 'UploadUrl'] ? a['filebrowser' + b(c, 1) + 'UploadUrl'] + '\x26responseType\x3djson' : a.filebrowserUploadUrl ? a.filebrowserUploadUrl + '\x26responseType\x3djson' : null; - }, isTypeSupported: function (a, c) { - return !!a.type.match(c); - }, isFileUploadSupported: typeof FileReader === 'function' && typeof new FileReader().readAsDataURL === 'function' && typeof FormData === 'function' && typeof new FormData().append === 'function' && typeof XMLHttpRequest === 'function' && typeof Blob === 'function' }); - })(); (function () { - function g(a, b) { - var d = []; - - if (b) { - for (var c in b) { - d.push(c + '\x3d' + encodeURIComponent(b[c])); - } - } else { - return a; - } return a + (a.indexOf('?') != -1 ? '\x26' : '?') + d.join('\x26'); - } function p(a) { - return !a.match(/command=QuickUpload/) || a.match(/(\?|&)responseType=json/) ? a : g(a, { responseType: 'json' }); - } function k(a) { - a += ''; return a.charAt(0).toUpperCase() + a.substr(1); - } function q() { - var a = this.getDialog(); var b = a.getParentEditor(); - - b._.filebrowserSe = this; var d = b.config['filebrowser' + k(a.getName()) + 'WindowWidth'] || b.config.filebrowserWindowWidth || -'80%'; var a = b.config['filebrowser' + k(a.getName()) + 'WindowHeight'] || b.config.filebrowserWindowHeight || '70%'; var c = this.filebrowser.params || {}; - - c.CKEditor = b.name; c.CKEditorFuncNum = b._.filebrowserFn; c.langCode || (c.langCode = b.langCode); c = g(this.filebrowser.url, c); b.popup(c, d, a, b.config.filebrowserWindowFeatures || b.config.fileBrowserWindowFeatures); - } function r(a) { - var b = new CKEDITOR.dom.element(a.$.form); - - b && ((a = b.$.elements.ckCsrfToken) ? a = new CKEDITOR.dom.element(a) : (a = new CKEDITOR.dom.element('input'), a.setAttributes({ name: 'ckCsrfToken', - type: 'hidden' }), b.append(a)), a.setAttribute('value', CKEDITOR.tools.getCsrfToken())); - } function t() { - var a = this.getDialog(); - - a.getParentEditor()._.filebrowserSe = this; return a.getContentElement(this.for[0], this.for[1]).getInputElement().$.value && a.getContentElement(this.for[0], this.for[1]).getAction() ? !0 : !1; - } function u(a, b, d) { - var c = d.params || {}; - - c.CKEditor = a.name; c.CKEditorFuncNum = a._.filebrowserFn; c.langCode || (c.langCode = a.langCode); b.action = g(d.url, c); b.filebrowser = d; - } function l(a, b, d, c) { - if (c && -c.length) { - for (var e, g = c.length; g--;) { - if (e = c[g], e.type != 'hbox' && e.type != 'vbox' && e.type != 'fieldset' || l(a, b, d, e.children), e.filebrowser) { - if (typeof e.filebrowser === 'string' && (e.filebrowser = { action: e.type == 'fileButton' ? 'QuickUpload' : 'Browse', target: e.filebrowser }), e.filebrowser.action == 'Browse') { - var f = e.filebrowser.url; - - void 0 === f && (f = a.config['filebrowser' + k(b) + 'BrowseUrl'], void 0 === f && (f = a.config.filebrowserBrowseUrl)); f && (e.onClick = q, e.filebrowser.url = f, e.hidden = !1); - } else if (e.filebrowser.action == 'QuickUpload' && -e.for && (f = e.filebrowser.url, void 0 === f && (f = a.config['filebrowser' + k(b) + 'UploadUrl'], void 0 === f && (f = a.config.filebrowserUploadUrl)), f)) { - var h = e.onClick; - - e.onClick = function (b) { - var c = b.sender; var d = c.getDialog().getContentElement(this.for[0], this.for[1]).getInputElement(); var e = CKEDITOR.fileTools && CKEDITOR.fileTools.isFileUploadSupported; - - if (h && !1 === h.call(c, b)) { - return !1; - } if (t.call(c, b)) { - if (a.config.filebrowserUploadMethod !== 'form' && e) { - return b = a.uploadRepository.create(d.$.files[0]), b.on('uploaded', function (a) { - var b = -a.sender.responseData; - - m.call(a.sender.editor, b.url, b.message); - }), b.on('error', n.bind(this)), b.on('abort', n.bind(this)), b.loadAndUpload(p(f)), 'xhr'; - } r(d); return !0; - } return !1; - }; e.filebrowser.url = f; e.hidden = !1; u(a, d.getContents(e.for[0]).get(e.for[1]), e.filebrowser); - } - } - } - } - } function n(a) { - var b = {}; - - try { - b = JSON.parse(a.sender.xhr.response) || {}; - } catch (d) {} this.enable(); alert(b.error ? b.error.message : a.sender.message); - } function h(a, b, d) { - if (d.indexOf(';') !== -1) { - d = d.split(';'); for (var c = 0; c < d.length; c++) { - if (h(a, b, d[c])) { - return !0; - } - } - return !1; - } return (a = a.getContents(b).get(d).filebrowser) && a.url; - } function m(a, b) { - var d = this._.filebrowserSe.getDialog(); var c = this._.filebrowserSe.for; var e = this._.filebrowserSe.filebrowser.onSelect; - - c && d.getContentElement(c[0], c[1]).reset(); if (typeof b !== 'function' || !1 !== b.call(this._.filebrowserSe)) { - if (!e || !1 !== e.call(this._.filebrowserSe, a, b)) { - if (typeof b === 'string' && b && alert(b), a && (c = this._.filebrowserSe, d = c.getDialog(), c = c.filebrowser.target || null)) { - if (c = c.split(':'), e = d.getContentElement(c[0], c[1])) { - e.setValue(a), - d.selectPage(c[0]); - } - } - } - } - }CKEDITOR.plugins.add('filebrowser', { requires: 'popup,filetools', init: function (a) { - a._.filebrowserFn = CKEDITOR.tools.addFunction(m, a); a.on('destroy', function () { - CKEDITOR.tools.removeFunction(this._.filebrowserFn); - }); - } }); CKEDITOR.on('dialogDefinition', function (a) { - if (a.editor.plugins.filebrowser) { - for (var b = a.data.definition, d, c = 0; c < b.contents.length; ++c) { - if (d = b.contents[c]) { - l(a.editor, a.data.name, b, d.elements), d.hidden && d.filebrowser && (d.hidden = !h(b, d.id, d.filebrowser)); - } - } - } - }); - })(); CKEDITOR.plugins.add('find', { requires: 'dialog', init: function (a) { - var b = a.addCommand('find', new CKEDITOR.dialogCommand('find')); var c = a.addCommand('replace', new CKEDITOR.dialogCommand('find', { tabId: 'replace' })); - - b.canUndo = !1; b.readOnly = 1; c.canUndo = !1; a.ui.addButton && (a.ui.addButton('Find', { label: a.lang.find.find, command: 'find', toolbar: 'find,10' }), a.ui.addButton('Replace', { label: a.lang.find.replace, command: 'replace', toolbar: 'find,20' })); CKEDITOR.dialog.add('find', this.path + 'dialogs/find.js'); - } }); - CKEDITOR.config.find_highlight = { element: 'span', styles: { 'background-color': '#004', 'color': '#fff' } }; (function () { - function g(a, b) { - var c = l.exec(a); var d = l.exec(b); - - if (c) { - if (!c[2] && d[2] == 'px') { - return d[1]; - } if (c[2] == 'px' && !d[2]) { - return d[1] + 'px'; - } - } return b; - } var k = CKEDITOR.htmlParser.cssStyle; var h = CKEDITOR.tools.cssLength; var l = /^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i; var m = { elements: { $: function (a) { - var b = a.attributes; - - if ((b = (b = (b = b && b['data-cke-realelement']) && new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(b))) && b.children[0]) && a.attributes['data-cke-resizable']) { - var c = new k(a).rules; - - a = b.attributes; var d = c.width; - var c = c.height; - - d && (a.width = g(a.width, d)); c && (a.height = g(a.height, c)); - } return b; - } } }; - - CKEDITOR.plugins.add('fakeobjects', { init: function (a) { - a.filter.allow('img[!data-cke-realelement,src,alt,title](*){*}', 'fakeobjects'); - }, afterInit: function (a) { - (a = (a = a.dataProcessor) && a.htmlFilter) && a.addRules(m, { applyToAll: !0 }); - } }); CKEDITOR.editor.prototype.createFakeElement = function (a, b, c, d) { - var e = this.lang.fakeobjects; var e = e[c] || e.unknown; - - b = { 'class': b, 'data-cke-realelement': encodeURIComponent(a.getOuterHtml()), 'data-cke-real-node-type': a.type, - 'alt': e, 'title': e, 'align': a.getAttribute('align') || '' }; CKEDITOR.env.hc || (b.src = CKEDITOR.tools.transparentImageData); c && (b['data-cke-real-element-type'] = c); d && (b['data-cke-resizable'] = d, c = new k(), d = a.getAttribute('width'), a = a.getAttribute('height'), d && (c.rules.width = h(d)), a && (c.rules.height = h(a)), c.populate(b)); return this.document.createElement('img', { attributes: b }); - }; CKEDITOR.editor.prototype.createFakeParserElement = function (a, b, c, d) { - var e = this.lang.fakeobjects; var e = e[c] || e.unknown; var f; - - f = new CKEDITOR.htmlParser.basicWriter(); - a.writeHtml(f); f = f.getHtml(); b = { 'class': b, 'data-cke-realelement': encodeURIComponent(f), 'data-cke-real-node-type': a.type, 'alt': e, 'title': e, 'align': a.attributes.align || '' }; CKEDITOR.env.hc || (b.src = CKEDITOR.tools.transparentImageData); c && (b['data-cke-real-element-type'] = c); d && (b['data-cke-resizable'] = d, d = a.attributes, a = new k(), c = d.width, d = d.height, void 0 !== c && (a.rules.width = h(c)), void 0 !== d && (a.rules.height = h(d)), a.populate(b)); return new CKEDITOR.htmlParser.element('img', b); - }; CKEDITOR.editor.prototype.restoreRealElement = -function (a) { - if (a.data('cke-real-node-type') != CKEDITOR.NODE_ELEMENT) { - return null; - } var b = CKEDITOR.dom.element.createFromHtml(decodeURIComponent(a.data('cke-realelement')), this.document); - - if (a.data('cke-resizable')) { - var c = a.getStyle('width'); - - a = a.getStyle('height'); c && b.setAttribute('width', g(b.getAttribute('width'), c)); a && b.setAttribute('height', g(b.getAttribute('height'), a)); - } return b; -}; - })(); (function () { - function d(a) { - a = a.attributes; return a.type == 'application/x-shockwave-flash' || f.test(a.src || ''); - } function e(a, b) { - return a.createFakeParserElement(b, 'cke_flash', 'flash', !0); - } var f = /\.swf(?:$|\?)/i; - - CKEDITOR.plugins.add('flash', { requires: 'dialog,fakeobjects', onLoad: function () { - CKEDITOR.addCss('img.cke_flash{background-image: url(' + CKEDITOR.getUrl(this.path + 'images/placeholder.png') + ');background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 80px;height: 80px;}'); - }, - init: function (a) { - var b = 'object[classid,codebase,height,hspace,vspace,width];param[name,value];embed[height,hspace,pluginspage,src,type,vspace,width]'; - - CKEDITOR.dialog.isTabEnabled(a, 'flash', 'properties') && (b += ';object[align]; embed[allowscriptaccess,quality,scale,wmode]'); CKEDITOR.dialog.isTabEnabled(a, 'flash', 'advanced') && (b += ';object[id]{*}; embed[bgcolor]{*}(*)'); a.addCommand('flash', new CKEDITOR.dialogCommand('flash', { allowedContent: b, requiredContent: 'embed' })); a.ui.addButton && a.ui.addButton('Flash', - { label: a.lang.common.flash, command: 'flash', toolbar: 'insert,20' }); CKEDITOR.dialog.add('flash', this.path + 'dialogs/flash.js'); a.addMenuItems && a.addMenuItems({ flash: { label: a.lang.flash.properties, command: 'flash', group: 'flash' } }); a.on('doubleclick', function (a) { - var b = a.data.element; - - b.is('img') && b.data('cke-real-element-type') == 'flash' && (a.data.dialog = 'flash'); - }); a.contextMenu && a.contextMenu.addListener(function (a) { - if (a && a.is('img') && !a.isReadOnly() && a.data('cke-real-element-type') == 'flash') { - return { flash: CKEDITOR.TRISTATE_OFF }; - } - }); - }, - afterInit: function (a) { - var b = a.dataProcessor; - - (b = b && b.dataFilter) && b.addRules({ elements: { 'cke:object': function (b) { - var c = b.attributes; - - if (!(c.classid && String(c.classid).toLowerCase() || d(b))) { - for (c = 0; c < b.children.length; c++) { - if (b.children[c].name == 'cke:embed') { - if (!d(b.children[c])) { - break; - } return e(a, b); - } - } return null; - } return e(a, b); - }, 'cke:embed': function (b) { - return d(b) ? e(a, b) : null; - } } }, 5); - } }); - })(); CKEDITOR.tools.extend(CKEDITOR.config, { flashEmbedTagOnly: !1, flashAddEmbedTag: !0, flashConvertOnEdit: !1 }); (function () { - function k(a) { - var l = a.config; var p = a.fire('uiSpace', { space: 'top', html: '' }).html; var t = (function () { - function f(a, c, e) { - b.setStyle(c, w(e)); b.setStyle('position', a); - } function e(a) { - var b = k.getDocumentPosition(); - - switch (a) { - case 'top':f('absolute', 'top', b.y - q - r); break; case 'pin':f('fixed', 'top', x); break; case 'bottom':f('absolute', 'top', b.y + (c.height || c.bottom - c.top) + r); - }m = a; - } var m; var k; var n; var c; var h; var q; var v; var p = l.floatSpaceDockedOffsetX || 0; var r = l.floatSpaceDockedOffsetY || 0; var u = l.floatSpacePinnedOffsetX || 0; var x = l.floatSpacePinnedOffsetY || -0; - - return function (d) { - if (k = a.editable()) { - var f = d && d.name == 'focus'; - - f && b.show(); a.fire('floatingSpaceLayout', { show: f }); b.removeStyle('left'); b.removeStyle('right'); n = b.getClientRect(); c = k.getClientRect(); h = g.getViewPaneSize(); q = n.height; v = 'pageXOffset' in g.$ ? g.$.pageXOffset : CKEDITOR.document.$.documentElement.scrollLeft; m ? (q + r <= c.top ? e('top') : q + r > h.height - c.bottom ? e('pin') : e('bottom'), d = h.width / 2, d = l.floatSpacePreferRight ? 'right' : c.left > 0 && c.right < h.width && c.width > n.width ? l.contentsLangDirection == 'rtl' ? - 'right' : 'left' : d - c.left > c.right - d ? 'left' : 'right', n.width > h.width ? (d = 'left', f = 0) : (f = d == 'left' ? c.left > 0 ? c.left : 0 : c.right < h.width ? h.width - c.right : 0, f + n.width > h.width && (d = d == 'left' ? 'right' : 'left', f = 0)), b.setStyle(d, w((m == 'pin' ? u : p) + f + (m == 'pin' ? 0 : d == 'left' ? v : -v)))) : (m = 'pin', e('pin'), t(d)); - } - }; - })(); - - if (p) { - var k = new CKEDITOR.template('\x3cdiv id\x3d"cke_{name}" class\x3d"cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} ' + CKEDITOR.env.cssClass + '" dir\x3d"{langDir}" title\x3d"' + (CKEDITOR.env.gecko ? - ' ' : '') + '" lang\x3d"{langCode}" role\x3d"application" style\x3d"{style}"' + (a.title ? ' aria-labelledby\x3d"cke_{name}_arialbl"' : ' ') + '\x3e' + (a.title ? '\x3cspan id\x3d"cke_{name}_arialbl" class\x3d"cke_voice_label"\x3e{voiceLabel}\x3c/span\x3e' : ' ') + '\x3cdiv class\x3d"cke_inner"\x3e\x3cdiv id\x3d"{topId}" class\x3d"cke_top" role\x3d"presentation"\x3e{content}\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e'); var b = CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(k.output({ content: p, id: a.id, langDir: a.lang.dir, - langCode: a.langCode, name: a.name, style: 'display:none;z-index:' + (l.baseFloatZIndex - 1), topId: a.ui.spaceId('top'), voiceLabel: a.title }))); var u = CKEDITOR.tools.eventsBuffer(500, t); var e = CKEDITOR.tools.eventsBuffer(100, t); - - b.unselectable(); b.on('mousedown', function (a) { - a = a.data; a.getTarget().hasAscendant('a', 1) || a.preventDefault(); - }); a.on('focus', function (b) { - t(b); a.on('change', u.input); g.on('scroll', e.input); g.on('resize', e.input); - }); a.on('blur', function () { - b.hide(); a.removeListener('change', u.input); g.removeListener('scroll', - e.input); g.removeListener('resize', e.input); - }); a.on('destroy', function () { - g.removeListener('scroll', e.input); g.removeListener('resize', e.input); b.clearCustomData(); b.remove(); - }); a.focusManager.hasFocus && b.show(); a.focusManager.add(b, 1); - } - } var g = CKEDITOR.document.getWindow(); var w = CKEDITOR.tools.cssLength; - - CKEDITOR.plugins.add('floatingspace', { init: function (a) { - a.on('loaded', function () { - k(this); - }, null, null, 20); - } }); - })(); CKEDITOR.plugins.add('listblock', { requires: 'panel', onLoad: function () { - var f = CKEDITOR.addTemplate('panel-list', '\x3cul role\x3d"presentation" class\x3d"cke_panel_list"\x3e{items}\x3c/ul\x3e'); var g = CKEDITOR.addTemplate('panel-list-item', '\x3cli id\x3d"{id}" class\x3d"cke_panel_listItem" role\x3dpresentation\x3e\x3ca id\x3d"{id}_option" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"{title}" draggable\x3d"false" ondragstart\x3d"return false;" href\x3d"javascript:void(\'{val}\')" onclick\x3d"{onclick}CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role\x3d"option"\x3e{text}\x3c/a\x3e\x3c/li\x3e'); - var h = CKEDITOR.addTemplate('panel-list-group', '\x3ch1 id\x3d"{id}" draggable\x3d"false" ondragstart\x3d"return false;" class\x3d"cke_panel_grouptitle" role\x3d"presentation" \x3e{label}\x3c/h1\x3e'); var k = /\'/g; - - CKEDITOR.ui.panel.prototype.addListBlock = function (a, b) { - return this.addBlock(a, new CKEDITOR.ui.listBlock(this.getHolderElement(), b)); - }; CKEDITOR.ui.listBlock = CKEDITOR.tools.createClass({ base: CKEDITOR.ui.panel.block, $: function (a, b) { - b = b || {}; var c = b.attributes || (b.attributes = {}); - - (this.multiSelect = !!b.multiSelect) && -(c['aria-multiselectable'] = !0); !c.role && (c.role = 'listbox'); this.base.apply(this, arguments); this.element.setAttribute('role', c.role); c = this.keys; c[40] = 'next'; c[9] = 'next'; c[38] = 'prev'; c[CKEDITOR.SHIFT + 9] = 'prev'; c[32] = CKEDITOR.env.ie ? 'mouseup' : 'click'; CKEDITOR.env.ie && (c[13] = 'mouseup'); this._.pendingHtml = []; this._.pendingList = []; this._.items = {}; this._.groups = {}; - }, _: { close: function () { - if (this._.started) { - var a = f.output({ items: this._.pendingList.join('') }); - - this._.pendingList = []; this._.pendingHtml.push(a); - delete this._.started; - } - }, getClick: function () { - this._.click || (this._.click = CKEDITOR.tools.addFunction(function (a) { - var b = this.toggle(a); - - if (this.onClick) { - this.onClick(a, b); - } - }, this)); return this._.click; - } }, proto: { add: function (a, b, c) { - var d = CKEDITOR.tools.getNextId(); - - this._.started || (this._.started = 1, this._.size = this._.size || 0); this._.items[a] = d; var e; - - e = CKEDITOR.tools.htmlEncodeAttr(a).replace(k, "\\'"); a = { id: d, val: e, onclick: CKEDITOR.env.ie ? 'return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26' : - '', clickFn: this._.getClick(), title: CKEDITOR.tools.htmlEncodeAttr(c || a), text: b || a }; this._.pendingList.push(g.output(a)); - }, startGroup: function (a) { - this._.close(); var b = CKEDITOR.tools.getNextId(); - - this._.groups[a] = b; this._.pendingHtml.push(h.output({ id: b, label: a })); - }, commit: function () { - this._.close(); this.element.appendHtml(this._.pendingHtml.join('')); delete this._.size; this._.pendingHtml = []; - }, toggle: function (a) { - var b = this.isMarked(a); - - b ? this.unmark(a) : this.mark(a); return !b; - }, hideGroup: function (a) { - var b = (a = -this.element.getDocument().getById(this._.groups[a])) && a.getNext(); - - a && (a.setStyle('display', 'none'), b && b.getName() == 'ul' && b.setStyle('display', 'none')); - }, hideItem: function (a) { - this.element.getDocument().getById(this._.items[a]).setStyle('display', 'none'); - }, showAll: function () { - var a = this._.items; var b = this._.groups; var c = this.element.getDocument(); var d; - - for (d in a) { - c.getById(a[d]).setStyle('display', ''); - } for (var e in b) { - a = c.getById(b[e]), d = a.getNext(), a.setStyle('display', ''), d && d.getName() == 'ul' && d.setStyle('display', - ''); - } - }, mark: function (a) { - this.multiSelect || this.unmarkAll(); a = this._.items[a]; var b = this.element.getDocument().getById(a); - - b.addClass('cke_selected'); this.element.getDocument().getById(a + '_option').setAttribute('aria-selected', !0); this.onMark && this.onMark(b); - }, markFirstDisplayed: function () { - var a = this; - - this._.markFirstDisplayed(function () { - a.multiSelect || a.unmarkAll(); - }); - }, unmark: function (a) { - var b = this.element.getDocument(); - - a = this._.items[a]; var c = b.getById(a); - - c.removeClass('cke_selected'); b.getById(a + '_option').removeAttribute('aria-selected'); - this.onUnmark && this.onUnmark(c); - }, unmarkAll: function () { - var a = this._.items; var b = this.element.getDocument(); var c; - - for (c in a) { - var d = a[c]; - - b.getById(d).removeClass('cke_selected'); b.getById(d + '_option').removeAttribute('aria-selected'); - } this.onUnmark && this.onUnmark(); - }, isMarked: function (a) { - return this.element.getDocument().getById(this._.items[a]).hasClass('cke_selected'); - }, focus: function (a) { - this._.focusIndex = -1; var b = this.element.getElementsByTag('a'); var c; var d = -1; - - if (a) { - for (c = this.element.getDocument().getById(this._.items[a]).getFirst(); a = -b.getItem(++d);) { - if (a.equals(c)) { - this._.focusIndex = d; break; - } - } - } else { - this.element.focus(); - }c && setTimeout(function () { - c.focus(); - }, 0); - } } }); - } }); CKEDITOR.plugins.add('richcombo', { requires: 'floatpanel,listblock,button', beforeInit: function (d) { - d.ui.addHandler(CKEDITOR.UI_RICHCOMBO, CKEDITOR.ui.richCombo.handler); - } }); - (function () { - var d = '\x3cspan id\x3d"{id}" class\x3d"cke_combo cke_combo__{name} {cls}" role\x3d"presentation"\x3e\x3cspan id\x3d"{id}_label" class\x3d"cke_combo_label"\x3e{label}\x3c/span\x3e\x3ca class\x3d"cke_combo_button" title\x3d"{title}" tabindex\x3d"-1"' + (CKEDITOR.env.gecko && !CKEDITOR.env.hc ? '' : " href\x3d\"javascript:void('{titleJs}')\"") + ' hidefocus\x3d"true" role\x3d"button" aria-labelledby\x3d"{id}_label" aria-haspopup\x3d"listbox"'; var g = ''; - - CKEDITOR.env.gecko && CKEDITOR.env.mac && (d += ' onkeypress\x3d"return false;"'); - CKEDITOR.env.gecko && (d += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;"'); CKEDITOR.env.ie && (g = 'return false;" onmouseup\x3d"CKEDITOR.tools.getMouseButton(event)\x3d\x3dCKEDITOR.MOUSE_BUTTON_LEFT\x26\x26'); var d = d + (' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" onclick\x3d"' + g + 'CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan id\x3d"{id}_text" class\x3d"cke_combo_text cke_combo_inlinelabel"\x3e{label}\x3c/span\x3e\x3cspan class\x3d"cke_combo_open"\x3e\x3cspan class\x3d"cke_combo_arrow"\x3e' + -(CKEDITOR.env.hc ? '\x26#9660;' : CKEDITOR.env.air ? '\x26nbsp;' : '') + '\x3c/span\x3e\x3c/span\x3e\x3c/a\x3e\x3c/span\x3e'); var m = CKEDITOR.addTemplate('combo', d); - - CKEDITOR.UI_RICHCOMBO = 'richcombo'; CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass({ $: function (a) { - CKEDITOR.tools.extend(this, a, { canGroup: !1, title: a.label, modes: { wysiwyg: 1 }, editorFocus: 1 }); a = this.panel || {}; delete this.panel; this.id = CKEDITOR.tools.getNextNumber(); this.document = a.parent && a.parent.getDocument() || CKEDITOR.document; a.className = 'cke_combopanel'; - a.block = { multiSelect: a.multiSelect, attributes: a.attributes }; a.toolbarRelated = !0; this._ = { panelDefinition: a, items: {}, listeners: [] }; - }, proto: { renderHtml: function (a) { - var b = []; - - this.render(a, b); return b.join(''); - }, render: function (a, b) { - function k() { - if (this.getState() != CKEDITOR.TRISTATE_ON) { - var b = this.modes[a.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED; - - a.readOnly && !this.readOnly && (b = CKEDITOR.TRISTATE_DISABLED); this.setState(b); this.setValue(''); b != CKEDITOR.TRISTATE_DISABLED && this.refresh && this.refresh(); - } - } - var d = CKEDITOR.env; var f; var e; var c = 'cke_' + this.id; var l = CKEDITOR.tools.addFunction(function (b) { - e && (a.unlockSelection(1), e = 0); f.execute(b); - }, this); var h = this; - - f = { id: c, combo: this, focus: function () { - CKEDITOR.document.getById(c).getChild(1).focus(); - }, execute: function (b) { - var c = h._; - - if (c.state != CKEDITOR.TRISTATE_DISABLED) { - if (h.createPanel(a), c.on) { - c.panel.hide(); - } else { - h.commit(); var d = h.getValue(); - - d ? c.list.mark(d) : c.list.unmarkAll(); c.panel.showBlock(h.id, new CKEDITOR.dom.element(b), 4); - } - } - }, clickFn: l }; this._.listeners.push(a.on('activeFilterChange', - k, this)); this._.listeners.push(a.on('mode', k, this)); this._.listeners.push(a.on('selectionChange', k, this)); !this.readOnly && this._.listeners.push(a.on('readOnly', k, this)); var g = CKEDITOR.tools.addFunction(function (a, b) { - a = new CKEDITOR.dom.event(a); var c = a.getKeystroke(); - - switch (c) { - case 13:case 32:case 40:CKEDITOR.tools.callFunction(l, b); break; default:f.onkey(f, c); - }a.preventDefault(); - }); var n = CKEDITOR.tools.addFunction(function () { - f.onfocus && f.onfocus(); - }); - - e = 0; f.keyDownFn = g; d = { id: c, name: this.name || this.command, - label: this.label, title: this.title, cls: this.className || '', titleJs: d.gecko && !d.hc ? '' : (this.title || '').replace("'", ''), keydownFn: g, focusFn: n, clickFn: l }; m.output(d, b); if (this.onRender) { - this.onRender(); - } return f; - }, createPanel: function (a) { - if (!this._.panel) { - var b = this._.panelDefinition; var d = this._.panelDefinition.block; var g = b.parent || CKEDITOR.document.getBody(); var f = 'cke_combopanel__' + this.name; var e = new CKEDITOR.ui.floatPanel(a, g, b); var b = e.addListBlock(this.id, d); var c = this; - - e.onShow = function () { - this.element.addClass(f); c.setState(CKEDITOR.TRISTATE_ON); - c._.on = 1; c.editorFocus && !a.focusManager.hasFocus && a.focus(); if (c.onOpen) { - c.onOpen(); - } - }; e.onHide = function (b) { - this.element.removeClass(f); c.setState(c.modes && c.modes[a.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED); c._.on = 0; if (!b && c.onClose) { - c.onClose(); - } - }; e.onEscape = function () { - e.hide(1); - }; b.onClick = function (a, b) { - c.onClick && c.onClick.call(c, a, b); e.hide(); - }; this._.panel = e; this._.list = b; e.getBlock(this.id).onHide = function () { - c._.on = 0; c.setState(CKEDITOR.TRISTATE_OFF); - }; this.init && this.init(); - } - }, setValue: function (a, - b) { - this._.value = a; var d = this.document.getById('cke_' + this.id + '_text'); - - d && (a || b ? d.removeClass('cke_combo_inlinelabel') : (b = this.label, d.addClass('cke_combo_inlinelabel')), d.setText(typeof b !== 'undefined' ? b : a)); - }, getValue: function () { - return this._.value || ''; - }, unmarkAll: function () { - this._.list.unmarkAll(); - }, mark: function (a) { - this._.list.mark(a); - }, hideItem: function (a) { - this._.list.hideItem(a); - }, hideGroup: function (a) { - this._.list.hideGroup(a); - }, showAll: function () { - this._.list.showAll(); - }, add: function (a, b, d) { - this._.items[a] = -d || a; this._.list.add(a, b, d); - }, startGroup: function (a) { - this._.list.startGroup(a); - }, commit: function () { - this._.committed || (this._.list.commit(), this._.committed = 1, CKEDITOR.ui.fire('ready', this)); this._.committed = 1; - }, setState: function (a) { - if (this._.state != a) { - var b = this.document.getById('cke_' + this.id); - - b.setState(a, 'cke_combo'); a == CKEDITOR.TRISTATE_DISABLED ? b.setAttribute('aria-disabled', !0) : b.removeAttribute('aria-disabled'); this._.state = a; - } - }, getState: function () { - return this._.state; - }, enable: function () { - this._.state == -CKEDITOR.TRISTATE_DISABLED && this.setState(this._.lastState); - }, disable: function () { - this._.state != CKEDITOR.TRISTATE_DISABLED && (this._.lastState = this._.state, this.setState(CKEDITOR.TRISTATE_DISABLED)); - }, destroy: function () { - CKEDITOR.tools.array.forEach(this._.listeners, function (a) { - a.removeListener(); - }); this._.listeners = []; - }, select: function (a) { - if (!CKEDITOR.tools.isEmpty(this._.items)) { - for (var b in this._.items) { - if (a({ value: b, text: this._.items[b] })) { - this.setValue(b); break; - } - } - } - } }, statics: { handler: { create: function (a) { - return new CKEDITOR.ui.richCombo(a); - } } } }); - CKEDITOR.ui.prototype.addRichCombo = function (a, b) { - this.add(a, CKEDITOR.UI_RICHCOMBO, b); - }; - })(); (function () { - function k(a, b) { - var c = a.config; var d = b.lang; var e = new CKEDITOR.style(b.styleDefinition); var f = new l({ entries: b.entries, styleVariable: b.styleVariable, styleDefinition: b.styleDefinition }); var g; - - a.addCommand(b.commandName, { exec: function (a, b) { - var c = b.newStyle; var d = b.oldStyle; var e = a.getSelection().getRanges()[0]; var f = void 0 === c; - - if (d || c) { - if (d && e.collapsed && m({ editor: a, range: e, style: d }), f) { - a.removeStyle(d); - } else { - if (e = d) { - e = d instanceof CKEDITOR.style && c instanceof CKEDITOR.style ? CKEDITOR.style.getStyleText(d.getDefinition()) === -CKEDITOR.style.getStyleText(c.getDefinition()) : !1, e = !e; - }e && a.removeStyle(d); a.applyStyle(c); - } - } - }, refresh: function (a, b) { - e.checkApplicable(b, a, a.activeFilter) || this.setState(CKEDITOR.TRISTATE_DISABLED); - } }); g = a.getCommand(b.commandName); a.ui.addRichCombo(b.comboName, { label: d.label, title: d.panelTitle, command: b.commandName, toolbar: 'styles,' + b.order, defaultValue: 'cke-default', allowedContent: e, requiredContent: e, contentTransformations: b.styleDefinition.element === 'span' ? [[{ element: 'font', check: 'span', left: function (a) { - return !!a.attributes.size || -!!a.attributes.align || !!a.attributes.face; - }, right: function (a) { - var b = ' x-small small medium large x-large xx-large 48px'.split(' '); - - a.name = 'span'; a.attributes.size && (a.styles['font-size'] = b[a.attributes.size], delete a.attributes.size); a.attributes.align && (a.styles['text-align'] = a.attributes.align, delete a.attributes.align); a.attributes.face && (a.styles['font-family'] = a.attributes.face, delete a.attributes.face); - } }]] : null, panel: { css: [CKEDITOR.skin.getPath('editor')].concat(c.contentsCss), multiSelect: !1, - attributes: { 'aria-label': d.panelTitle } }, init: function () { - var b = '(' + a.lang.common.optionDefault + ')'; - - this.startGroup(d.panelTitle); this.add(this.defaultValue, b, b); f.addToCombo(this); - }, onClick: function (c) { - var d = this.getValue(); - - a.focus(); a.fire('saveSnapshot'); a.execCommand(b.commandName, { newStyle: f.getStyle(c), oldStyle: f.getStyle(d) }); a.fire('saveSnapshot'); - }, onRender: function () { - a.on('selectionChange', function (c) { - var d = this.getValue(); - - (c = f.getMatchingValue(a, c.data.path)) ? c != d && this.setValue(c) : this.setValue('', - b.defaultLabel); - }, this); g.on('state', function () { - this.setState(g.state); - }, this); - }, refresh: function () { - this.setState(g.state); - } }); - } function m(a) { - var b = a.editor; var c = a.range; var d = a.style; var e; var f; var g; - - e = b.elementPath(); if (a = e.contains(function (a) { - return d.checkElementRemovable(a); - })) { - f = c.checkBoundaryOfElement(a, CKEDITOR.START); g = c.checkBoundaryOfElement(a, CKEDITOR.END); if (f && g) { - for (f = c.createBookmark(); e = a.getFirst();) { - e.insertBefore(a); - }a.remove(); c.moveToBookmark(f); - } else { - f || g ? c.moveToPosition(a, f ? CKEDITOR.POSITION_BEFORE_START : - CKEDITOR.POSITION_AFTER_END) : (c.splitElement(a), c.moveToPosition(a, CKEDITOR.POSITION_AFTER_END)), h(c, e.elements.slice(), a); - }b.getSelection().selectRanges([c]); - } - } function h(a, b, c) { - var d = b.pop(); - - if (d) { - if (c) { - return h(a, b, d.equals(c) ? null : c); - } c = d.clone(); a.insertNode(c); a.moveToPosition(c, CKEDITOR.POSITION_AFTER_START); h(a, b); - } - } var l = CKEDITOR.tools.createClass({ $: function (a) { - var b = a.entries.split(';'); - - this._.data = {}; this._.names = []; for (var c = 0; c < b.length; c++) { - var d = b[c]; var e; var f; - - d ? (d = d.split('/'), e = d[0], d = d[1], - f = {}, f[a.styleVariable] = d || e, this._.data[e] = new CKEDITOR.style(a.styleDefinition, f), this._.data[e]._.definition.name = e, this._.names.push(e)) : (b.splice(c, 1), c--); - } - }, proto: { getStyle: function (a) { - return this._.data[a]; - }, addToCombo: function (a) { - for (var b = 0; b < this._.names.length; b++) { - var c = this._.names[b]; - - a.add(c, this.getStyle(c).buildPreview(), c); - } - }, getMatchingValue: function (a, b) { - for (var c = b.elements, d = 0, e; d < c.length; d++) { - if (e = c[d], e = this._.findMatchingStyleName(a, e)) { - return e; - } - } return null; - } }, _: { findMatchingStyleName: function (a, - b) { - return CKEDITOR.tools.array.find(this._.names, function (c) { - return this.getStyle(c).checkElementMatch(b, !0, a); - }, this); - } } }); - - CKEDITOR.plugins.add('font', { requires: 'richcombo', init: function (a) { - var b = a.config; - - k(a, { comboName: 'Font', commandName: 'font', styleVariable: 'family', lang: a.lang.font, entries: b.font_names, defaultLabel: b.font_defaultLabel, styleDefinition: b.font_style, order: 30 }); k(a, { comboName: 'FontSize', commandName: 'fontSize', styleVariable: 'size', lang: a.lang.font.fontSize, entries: b.fontSize_sizes, defaultLabel: b.fontSize_defaultLabel, - styleDefinition: b.fontSize_style, order: 40 }); - } }); - })(); CKEDITOR.config.font_names = 'Arial/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif'; CKEDITOR.config.font_defaultLabel = ''; - CKEDITOR.config.font_style = { element: 'span', styles: { 'font-family': '#(family)' }, overrides: [{ element: 'font', attributes: { face: null } }] }; CKEDITOR.config.fontSize_sizes = '8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px'; CKEDITOR.config.fontSize_defaultLabel = ''; CKEDITOR.config.fontSize_style = { element: 'span', styles: { 'font-size': '#(size)' }, overrides: [{ element: 'font', attributes: { size: null } }] }; CKEDITOR.plugins.add('forms', { requires: 'dialog,fakeobjects', onLoad: function () { - CKEDITOR.addCss('.cke_editable form{border: 1px dotted #FF0000;padding: 2px;}\n'); CKEDITOR.addCss('img.cke_hidden{background-image: url(' + CKEDITOR.getUrl(this.path + 'images/hiddenfield.gif') + ');background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 16px !important;height: 16px !important;}'); - }, init: function (b) { - var a = b.lang; var g = 0; var h = { email: 1, password: 1, search: 1, tel: 1, text: 1, url: 1 }; var l = { checkbox: 'input[type,name,checked,required]', - radio: 'input[type,name,checked,required]', textfield: 'input[type,name,value,size,maxlength,required]', textarea: 'textarea[cols,rows,name,required]', select: 'select[name,size,multiple,required]; option[value,selected]', button: 'input[type,name,value]', form: 'form[action,name,id,enctype,target,method]', hiddenfield: 'input[type,name,value]', imagebutton: 'input[type,alt,src]{width,height,border,border-width,border-style,margin,float}' }; var m = { checkbox: 'input', radio: 'input', textfield: 'input', textarea: 'textarea', - select: 'select', button: 'input', form: 'form', hiddenfield: 'input', imagebutton: 'input' }; var d = function (f, c, d) { - var h = { allowedContent: l[c], requiredContent: m[c] }; - - c == 'form' && (h.context = 'form'); b.addCommand(c, new CKEDITOR.dialogCommand(c, h)); b.ui.addButton && b.ui.addButton(f, { label: a.common[f.charAt(0).toLowerCase() + f.slice(1)], command: c, toolbar: 'forms,' + (g += 10) }); CKEDITOR.dialog.add(c, d); - }; var e = this.path + 'dialogs/'; - - !b.blockless && d('Form', 'form', e + 'form.js'); d('Checkbox', 'checkbox', e + 'checkbox.js'); d('Radio', 'radio', - e + 'radio.js'); d('TextField', 'textfield', e + 'textfield.js'); d('Textarea', 'textarea', e + 'textarea.js'); d('Select', 'select', e + 'select.js'); d('Button', 'button', e + 'button.js'); var k = b.plugins.image; - - k && !b.plugins.image2 && d('ImageButton', 'imagebutton', CKEDITOR.plugins.getPath('image') + 'dialogs/image.js'); d('HiddenField', 'hiddenfield', e + 'hiddenfield.js'); b.addMenuItems && (d = { checkbox: { label: a.forms.checkboxAndRadio.checkboxTitle, command: 'checkbox', group: 'checkbox' }, radio: { label: a.forms.checkboxAndRadio.radioTitle, - command: 'radio', group: 'radio' }, textfield: { label: a.forms.textfield.title, command: 'textfield', group: 'textfield' }, hiddenfield: { label: a.forms.hidden.title, command: 'hiddenfield', group: 'hiddenfield' }, button: { label: a.forms.button.title, command: 'button', group: 'button' }, select: { label: a.forms.select.title, command: 'select', group: 'select' }, textarea: { label: a.forms.textarea.title, command: 'textarea', group: 'textarea' } }, k && (d.imagebutton = { label: a.image.titleButton, command: 'imagebutton', group: 'imagebutton' }), !b.blockless && -(d.form = { label: a.forms.form.menu, command: 'form', group: 'form' }), b.addMenuItems(d)); b.contextMenu && (!b.blockless && b.contextMenu.addListener(function (f, c, b) { - if ((f = b.contains('form', 1)) && !f.isReadOnly()) { - return { form: CKEDITOR.TRISTATE_OFF }; - } - }), b.contextMenu.addListener(function (b) { - if (b && !b.isReadOnly()) { - var c = b.getName(); - - if (c == 'select') { - return { select: CKEDITOR.TRISTATE_OFF }; - } if (c == 'textarea') { - return { textarea: CKEDITOR.TRISTATE_OFF }; - } if (c == 'input') { - var a = b.getAttribute('type') || 'text'; - - switch (a) { - case 'button':case 'submit':case 'reset':return { button: CKEDITOR.TRISTATE_OFF }; - case 'checkbox':return { checkbox: CKEDITOR.TRISTATE_OFF }; case 'radio':return { radio: CKEDITOR.TRISTATE_OFF }; case 'image':return k ? { imagebutton: CKEDITOR.TRISTATE_OFF } : null; - } if (h[a]) { - return { textfield: CKEDITOR.TRISTATE_OFF }; - } - } if (c == 'img' && b.data('cke-real-element-type') == 'hiddenfield') { - return { hiddenfield: CKEDITOR.TRISTATE_OFF }; - } - } - })); b.on('doubleclick', function (a) { - var c = a.data.element; - - if (!b.blockless && c.is('form')) { - a.data.dialog = 'form'; - } else if (c.is('select')) { - a.data.dialog = 'select'; - } else if (c.is('textarea')) { - a.data.dialog = -'textarea'; - } else if (c.is('img') && c.data('cke-real-element-type') == 'hiddenfield') { - a.data.dialog = 'hiddenfield'; - } else if (c.is('input')) { - c = c.getAttribute('type') || 'text'; switch (c) { - case 'button':case 'submit':case 'reset':a.data.dialog = 'button'; break; case 'checkbox':a.data.dialog = 'checkbox'; break; case 'radio':a.data.dialog = 'radio'; break; case 'image':a.data.dialog = 'imagebutton'; - }h[c] && (a.data.dialog = 'textfield'); - } - }); - }, afterInit: function (b) { - var a = b.dataProcessor; var g = a && a.htmlFilter; var a = a && a.dataFilter; - - CKEDITOR.env.ie && -g && g.addRules({ elements: { input: function (a) { - a = a.attributes; var b = a.type; - - b || (a.type = 'text'); b != 'checkbox' && b != 'radio' || a.value != 'on' || delete a.value; - } } }, { applyToAll: !0 }); a && a.addRules({ elements: { input: function (a) { - if (a.attributes.type == 'hidden') { - return b.createFakeParserElement(a, 'cke_hidden', 'hiddenfield'); - } - } } }, { applyToAll: !0 }); - } }); CKEDITOR.plugins.forms = { _setupRequiredAttribute: function (b) { - this.setValue(b.hasAttribute('required')); - } }; CKEDITOR.plugins.add('format', { requires: 'richcombo', init: function (a) { - if (!a.blockless) { - for (var f = a.config, c = a.lang.format, l = f.format_tags.split(';'), d = {}, m = 0, n = [], g = 0; g < l.length; g++) { - var h = l[g]; var k = new CKEDITOR.style(f['format_' + h]); - - if (!a.filter.customConfig || a.filter.check(k)) { - m++, d[h] = k, d[h]._.enterMode = a.config.enterMode, n.push(k); - } - }m !== 0 && a.ui.addRichCombo('Format', { label: c.label, title: c.panelTitle, toolbar: 'styles,20', allowedContent: n, panel: { css: [CKEDITOR.skin.getPath('editor')].concat(f.contentsCss), - multiSelect: !1, attributes: { 'aria-label': c.panelTitle } }, init: function () { - this.startGroup(c.panelTitle); for (var a in d) { - var e = c['tag_' + a]; - - this.add(a, d[a].buildPreview(e), e); - } - }, onClick: function (b) { - a.focus(); a.fire('saveSnapshot'); b = d[b]; var e = a.elementPath(); - - b.checkActive(e, a) || a.applyStyle(b); setTimeout(function () { - a.fire('saveSnapshot'); - }, 0); - }, onRender: function () { - a.on('selectionChange', function (b) { - var e = this.getValue(); - - b = b.data.path; this.refresh(); for (var c in d) { - if (d[c].checkActive(b, a)) { - c != e && this.setValue(c, - a.lang.format['tag_' + c]); return; - } - } this.setValue(''); - }, this); - }, onOpen: function () { - this.showAll(); for (var b in d) { - a.activeFilter.check(d[b]) || this.hideItem(b); - } - }, refresh: function () { - var b = a.elementPath(); - - if (b) { - if (b.isContextFor('p')) { - for (var c in d) { - if (a.activeFilter.check(d[c])) { - return; - } - } - } this.setState(CKEDITOR.TRISTATE_DISABLED); - } - } }); - } - } }); CKEDITOR.config.format_tags = 'p;h1;h2;h3;h4;h5;h6;pre;address;div'; CKEDITOR.config.format_p = { element: 'p' }; CKEDITOR.config.format_div = { element: 'div' }; CKEDITOR.config.format_pre = { element: 'pre' }; - CKEDITOR.config.format_address = { element: 'address' }; CKEDITOR.config.format_h1 = { element: 'h1' }; CKEDITOR.config.format_h2 = { element: 'h2' }; CKEDITOR.config.format_h3 = { element: 'h3' }; CKEDITOR.config.format_h4 = { element: 'h4' }; CKEDITOR.config.format_h5 = { element: 'h5' }; CKEDITOR.config.format_h6 = { element: 'h6' }; (function () { - var b = { canUndo: !1, exec: function (a) { - var b = a.document.createElement('hr'); - - a.insertElement(b); - }, allowedContent: 'hr', requiredContent: 'hr' }; - - CKEDITOR.plugins.add('horizontalrule', { init: function (a) { - a.blockless || (a.addCommand('horizontalrule', b), a.ui.addButton && a.ui.addButton('HorizontalRule', { label: a.lang.horizontalrule.toolbar, command: 'horizontalrule', toolbar: 'insert,40' })); - } }); - })(); CKEDITOR.plugins.add('htmlwriter', { init: function (b) { - var a = new CKEDITOR.htmlWriter(); - - a.forceSimpleAmpersand = b.config.forceSimpleAmpersand; a.indentationChars = b.config.dataIndentationChars || '\t'; b.dataProcessor.writer = a; - } }); - CKEDITOR.htmlWriter = CKEDITOR.tools.createClass({ base: CKEDITOR.htmlParser.basicWriter, $: function () { - this.base(); this.indentationChars = '\t'; this.selfClosingEnd = ' /\x3e'; this.lineBreakChars = '\n'; this.sortAttributes = 1; this._.indent = 0; this._.indentation = ''; this._.inPre = 0; this._.rules = {}; var b = CKEDITOR.dtd; var a; - - for (a in CKEDITOR.tools.extend({}, b.$nonBodyContent, b.$block, b.$listItem, b.$tableContent)) { - this.setRules(a, { indent: !b[a]['#'], breakBeforeOpen: 1, breakBeforeClose: !b[a]['#'], breakAfterClose: 1, needsSpace: a in -b.$block && !(a in { li: 1, dt: 1, dd: 1 }) }); - } this.setRules('br', { breakAfterOpen: 1 }); this.setRules('title', { indent: 0, breakAfterOpen: 0 }); this.setRules('style', { indent: 0, breakBeforeClose: 1 }); this.setRules('pre', { breakAfterOpen: 1, indent: 0 }); - }, proto: { openTag: function (b) { - var a = this._.rules[b]; - - this._.afterCloser && a && a.needsSpace && this._.needsSpace && this._.output.push('\n'); this._.indent ? this.indentation() : a && a.breakBeforeOpen && (this.lineBreak(), this.indentation()); this._.output.push('\x3c', b); this._.afterCloser = 0; - }, - openTagClose: function (b, a) { - var c = this._.rules[b]; - - a ? (this._.output.push(this.selfClosingEnd), c && c.breakAfterClose && (this._.needsSpace = c.needsSpace)) : (this._.output.push('\x3e'), c && c.indent && (this._.indentation += this.indentationChars)); c && c.breakAfterOpen && this.lineBreak(); b == 'pre' && (this._.inPre = 1); - }, attribute: function (b, a) { - typeof a === 'string' && (a = CKEDITOR.tools.htmlEncodeAttr(a), this.forceSimpleAmpersand && (a = a.replace(/&/g, '\x26'))); this._.output.push(' ', b, '\x3d"', a, '"'); - }, closeTag: function (b) { - var a = -this._.rules[b]; - - a && a.indent && (this._.indentation = this._.indentation.substr(this.indentationChars.length)); this._.indent ? this.indentation() : a && a.breakBeforeClose && (this.lineBreak(), this.indentation()); this._.output.push('\x3c/', b, '\x3e'); b == 'pre' && (this._.inPre = 0); a && a.breakAfterClose && (this.lineBreak(), this._.needsSpace = a.needsSpace); this._.afterCloser = 1; - }, text: function (b) { - this._.indent && (this.indentation(), !this._.inPre && (b = CKEDITOR.tools.ltrim(b))); this._.output.push(b); - }, comment: function (b) { - this._.indent && -this.indentation(); this._.output.push('\x3c!--', b, '--\x3e'); - }, lineBreak: function () { - !this._.inPre && this._.output.length > 0 && this._.output.push(this.lineBreakChars); this._.indent = 1; - }, indentation: function () { - !this._.inPre && this._.indentation && this._.output.push(this._.indentation); this._.indent = 0; - }, reset: function () { - this._.output = []; this._.indent = 0; this._.indentation = ''; this._.afterCloser = 0; this._.inPre = 0; this._.needsSpace = 0; - }, setRules: function (b, a) { - var c = this._.rules[b]; - - c ? CKEDITOR.tools.extend(c, a, !0) : this._.rules[b] = -a; - } } }); (function () { - CKEDITOR.plugins.add('iframe', { requires: 'dialog,fakeobjects', onLoad: function () { - CKEDITOR.addCss('img.cke_iframe{background-image: url(' + CKEDITOR.getUrl(this.path + 'images/placeholder.png') + ');background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 80px;height: 80px;}'); - }, init: function (a) { - var b = a.lang.iframe; var c = 'iframe[align,longdesc,frameborder,height,name,scrolling,src,title,width]'; - - a.plugins.dialogadvtab && (c += ';iframe' + a.plugins.dialogadvtab.allowedContent({ id: 1, - classes: 1, styles: 1 })); CKEDITOR.dialog.add('iframe', this.path + 'dialogs/iframe.js'); a.addCommand('iframe', new CKEDITOR.dialogCommand('iframe', { allowedContent: c, requiredContent: 'iframe' })); a.ui.addButton && a.ui.addButton('Iframe', { label: b.toolbar, command: 'iframe', toolbar: 'insert,80' }); a.on('doubleclick', function (a) { - var b = a.data.element; - - b.is('img') && b.data('cke-real-element-type') == 'iframe' && (a.data.dialog = 'iframe'); - }); a.addMenuItems && a.addMenuItems({ iframe: { label: b.title, command: 'iframe', group: 'image' } }); - a.contextMenu && a.contextMenu.addListener(function (a) { - if (a && a.is('img') && a.data('cke-real-element-type') == 'iframe') { - return { iframe: CKEDITOR.TRISTATE_OFF }; - } - }); - }, afterInit: function (a) { - var b = a.dataProcessor; - - (b = b && b.dataFilter) && b.addRules({ elements: { iframe: function (b) { - return a.createFakeParserElement(b, 'cke_iframe', 'iframe', !0); - } } }); - } }); - })(); (function () { - function m(a) { - function e(a) { - var b = !1; - - g.attachListener(g, 'keydown', function () { - var d = c.getBody().getElementsByTag(a); - - if (!b) { - for (var f = 0; f < d.count(); f++) { - d.getItem(f).setCustomData('retain', !0); - }b = !0; - } - }, null, null, 1); g.attachListener(g, 'keyup', function () { - var d = c.getElementsByTag(a); - - b && (d.count() == 1 && !d.getItem(0).getCustomData('retain') && CKEDITOR.tools.isEmpty(d.getItem(0).getAttributes()) && d.getItem(0).remove(1), b = !1); - }); - } var b = this.editor; - - if (b && !b.isDetached()) { - var c = a.document; var d = c.body; var f = c.getElementById('cke_actscrpt'); - - f && f.parentNode.removeChild(f); (f = c.getElementById('cke_shimscrpt')) && f.parentNode.removeChild(f); (f = c.getElementById('cke_basetagscrpt')) && f.parentNode.removeChild(f); d.contentEditable = !0; CKEDITOR.env.ie && (d.hideFocus = !0, d.disabled = !0, d.removeAttribute('disabled')); delete this._.isLoadingData; this.$ = d; c = new CKEDITOR.dom.document(c); this.setup(); this.fixInitialSelection(); var g = this; - - CKEDITOR.env.ie && !CKEDITOR.env.edge && c.getDocumentElement().addClass(c.$.compatMode); CKEDITOR.env.ie && !CKEDITOR.env.edge && -b.enterMode != CKEDITOR.ENTER_P ? e('p') : CKEDITOR.env.edge && CKEDITOR.env.version < 15 && b.enterMode != CKEDITOR.ENTER_DIV && e('div'); if (CKEDITOR.env.webkit || CKEDITOR.env.ie && CKEDITOR.env.version > 10) { - c.getDocumentElement().on('mousedown', function (a) { - a.data.getTarget().is('html') && setTimeout(function () { - b.editable().focus(); - }); - }); - }n(b); try { - b.document.$.execCommand('2D-position', !1, !0); - } catch (h) {}(CKEDITOR.env.gecko || CKEDITOR.env.ie && b.document.$.compatMode == 'CSS1Compat') && this.attachListener(this, 'keydown', function (a) { - var c = -a.data.getKeystroke(); - - if (c == 33 || c == 34) { - if (CKEDITOR.env.ie) { - setTimeout(function () { - b.getSelection().scrollIntoView(); - }, 0); - } else if (b.window.$.innerHeight > this.$.offsetHeight) { - var d = b.createRange(); - - d[c == 33 ? 'moveToElementEditStart' : 'moveToElementEditEnd'](this); d.select(); a.data.preventDefault(); - } - } - }); CKEDITOR.env.ie && this.attachListener(c, 'blur', function () { - try { - c.$.selection.empty(); - } catch (a) {} - }); CKEDITOR.env.iOS && this.attachListener(c, 'touchend', function () { - a.focus(); - }); d = b.document.getElementsByTag('title').getItem(0); - d.data('cke-title', d.getText()); CKEDITOR.env.ie && (b.document.$.title = this._.docTitle); CKEDITOR.tools.setTimeout(function () { - this.status == 'unloaded' && (this.status = 'ready'); b.fire('contentDom'); this._.isPendingFocus && (b.focus(), this._.isPendingFocus = !1); setTimeout(function () { - b.fire('dataReady'); - }, 0); - }, 0, this); - } - } function n(a) { - function e() { - var c; - - a.editable().attachListener(a, 'selectionChange', function () { - var d = a.getSelection().getSelectedElement(); - - d && (c && (c.detachEvent('onresizestart', b), c = null), d.$.attachEvent('onresizestart', - b), c = d.$); - }); - } function b(a) { - a.returnValue = !1; - } if (CKEDITOR.env.gecko) { - try { - var c = a.document.$; - - c.execCommand('enableObjectResizing', !1, !a.config.disableObjectResizing); c.execCommand('enableInlineTableEditing', !1, !a.config.disableNativeTableHandles); - } catch (d) {} - } else { - CKEDITOR.env.ie && CKEDITOR.env.version < 11 && a.config.disableObjectResizing && e(a); - } - } function p() { - var a = []; - - if (CKEDITOR.document.$.documentMode >= 8) { - a.push('html.CSS1Compat [contenteditable\x3dfalse]{min-height:0 !important}'); var e = []; var b; - - for (b in CKEDITOR.dtd.$removeEmpty) { - e.push('html.CSS1Compat ' + -b + '[contenteditable\x3dfalse]'); - }a.push(e.join(',') + '{display:inline-block}'); - } else { - CKEDITOR.env.gecko && (a.push('html{height:100% !important}'), a.push('img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}')); - }a.push('html{cursor:text;*cursor:auto}'); a.push('img,input,textarea{cursor:default}'); return a.join('\n'); - } var l; - - CKEDITOR.plugins.add('wysiwygarea', { init: function (a) { - a.config.fullPage && a.addFeature({ allowedContent: 'html head title; style [media,type]; body (*)[id]; meta link [*]', - requiredContent: 'body' }); a.addMode('wysiwyg', function (e) { - function b(b) { - b && b.removeListener(); a.isDestroyed() || a.isDetached() || (a.editable(new l(a, d.$.contentWindow.document.body)), a.setData(a.getData(1), e)); - } var c = 'document.open();' + (CKEDITOR.env.ie ? '(' + CKEDITOR.tools.fixDomain + ')();' : '') + 'document.close();'; var c = CKEDITOR.env.air ? 'javascript:void(0)' : CKEDITOR.env.ie && !CKEDITOR.env.edge ? 'javascript:void(function(){' + encodeURIComponent(c) + '}())' : ''; var d = CKEDITOR.dom.element.createFromHtml('\x3ciframe src\x3d"' + -c + '" frameBorder\x3d"0"\x3e\x3c/iframe\x3e'); - - d.setStyles({ width: '100%', height: '100%' }); d.addClass('cke_wysiwyg_frame').addClass('cke_reset'); c = a.ui.space('contents'); c.append(d); var f = CKEDITOR.env.ie && !CKEDITOR.env.edge || CKEDITOR.env.gecko; - - if (f) { - d.on('load', b); - } var g = a.title; var h = a.fire('ariaEditorHelpLabel', {}).label; - - g && (CKEDITOR.env.ie && h && (g += ', ' + h), d.setAttribute('title', g)); if (h) { - var g = CKEDITOR.tools.getNextId(); var k = CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"' + g + '" class\x3d"cke_voice_label"\x3e' + -h + '\x3c/span\x3e'); - - c.append(k, 1); d.setAttribute('aria-describedby', g); - }a.on('beforeModeUnload', function (a) { - a.removeListener(); k && k.remove(); - }); d.setAttributes({ tabIndex: a.tabIndex, allowTransparency: 'true' }); !f && b(); a.fire('ariaWidget', d); - }); - } }); CKEDITOR.editor.prototype.addContentsCss = function (a) { - var e = this.config; var b = e.contentsCss; - - CKEDITOR.tools.isArray(b) || (e.contentsCss = b ? [b] : []); e.contentsCss.push(a); - }; l = CKEDITOR.tools.createClass({ $: function () { - this.base.apply(this, arguments); this._.frameLoadedHandler = -CKEDITOR.tools.addFunction(function (a) { - CKEDITOR.tools.setTimeout(m, 0, this, a); -}, this); this._.docTitle = this.getWindow().getFrame().getAttribute('title'); - }, base: CKEDITOR.editable, proto: { setData: function (a, e) { - var b = this.editor; - - if (e) { - this.setHtml(a), this.fixInitialSelection(), b.fire('dataReady'); - } else { - this._.isLoadingData = !0; b._.dataStore = { id: 1 }; var c = b.config; var d = c.fullPage; var f = c.docType; var g = CKEDITOR.tools.buildStyleHtml(p()).replace(/