You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

26722 lines
1.2 MiB

  1. /*
  2. Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
  3. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. (function() {
  6. if (window.CKEDITOR && window.CKEDITOR.dom) return;
  7. window.CKEDITOR || (window.CKEDITOR = function() {
  8. var a = /(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,
  9. d = {
  10. timestamp: "I8BG",
  11. version: "4.10.1",
  12. revision: "59246e9",
  13. rnd: Math.floor(900 * Math.random()) + 100,
  14. _: {
  15. pending: [],
  16. basePathSrcPattern: a
  17. },
  18. status: "unloaded",
  19. basePath: function() {
  20. var b = window.CKEDITOR_BASEPATH || "";
  21. if (!b)
  22. for (var c = document.getElementsByTagName("script"), d = 0; d < c.length; d++) {
  23. var g = c[d].src.match(a);
  24. if (g) {
  25. b = g[1];
  26. break
  27. }
  28. } - 1 == b.indexOf(":/") && "//" != b.slice(0, 2) && (b = 0 === b.indexOf("/") ? location.href.match(/^.*?:\/\/[^\/]*/)[0] +
  29. b : location.href.match(/^[^\?]*\/(?:)/)[0] + b);
  30. if (!b) throw 'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';
  31. return b
  32. }(),
  33. getUrl: function(a) {
  34. -1 == a.indexOf(":/") && 0 !== a.indexOf("/") && (a = this.basePath + a);
  35. this.timestamp && "/" != a.charAt(a.length - 1) && !/[&?]t=/.test(a) && (a += (0 <= a.indexOf("?") ? "\x26" : "?") + "t\x3d" + this.timestamp);
  36. return a
  37. },
  38. domReady: function() {
  39. function a() {
  40. try {
  41. document.addEventListener ? (document.removeEventListener("DOMContentLoaded",
  42. a, !1), b()) : document.attachEvent && "complete" === document.readyState && (document.detachEvent("onreadystatechange", a), b())
  43. } catch (c) {}
  44. }
  45. function b() {
  46. for (var a; a = c.shift();) a()
  47. }
  48. var c = [];
  49. return function(b) {
  50. function n() {
  51. try {
  52. document.documentElement.doScroll("left")
  53. } catch (e) {
  54. setTimeout(n, 1);
  55. return
  56. }
  57. a()
  58. }
  59. c.push(b);
  60. "complete" === document.readyState && setTimeout(a, 1);
  61. if (1 == c.length)
  62. if (document.addEventListener) document.addEventListener("DOMContentLoaded", a, !1), window.addEventListener("load", a, !1);
  63. else if (document.attachEvent) {
  64. document.attachEvent("onreadystatechange",
  65. a);
  66. window.attachEvent("onload", a);
  67. b = !1;
  68. try {
  69. b = !window.frameElement
  70. } catch (r) {}
  71. document.documentElement.doScroll && b && n()
  72. }
  73. }
  74. }()
  75. },
  76. b = window.CKEDITOR_GETURL;
  77. if (b) {
  78. var c = d.getUrl;
  79. d.getUrl = function(a) {
  80. return b.call(d, a) || c.call(d, a)
  81. }
  82. }
  83. return d
  84. }());
  85. CKEDITOR.event || (CKEDITOR.event = function() {}, CKEDITOR.event.implementOn = function(a) {
  86. var d = CKEDITOR.event.prototype,
  87. b;
  88. for (b in d) null == a[b] && (a[b] = d[b])
  89. }, CKEDITOR.event.prototype = function() {
  90. function a(a) {
  91. var f = d(this);
  92. return f[a] || (f[a] = new b(a))
  93. }
  94. var d = function(a) {
  95. a = a.getPrivate && a.getPrivate() || a._ || (a._ = {});
  96. return a.events || (a.events = {})
  97. },
  98. b = function(a) {
  99. this.name = a;
  100. this.listeners = []
  101. };
  102. b.prototype = {
  103. getListenerIndex: function(a) {
  104. for (var b = 0, d = this.listeners; b < d.length; b++)
  105. if (d[b].fn == a) return b;
  106. return -1
  107. }
  108. };
  109. return {
  110. define: function(b, d) {
  111. var h = a.call(this, b);
  112. CKEDITOR.tools.extend(h, d, !0)
  113. },
  114. on: function(b, d, h, k, g) {
  115. function n(e, a, y, v) {
  116. e = {
  117. name: b,
  118. sender: this,
  119. editor: e,
  120. data: a,
  121. listenerData: k,
  122. stop: y,
  123. cancel: v,
  124. removeListener: r
  125. };
  126. return !1 === d.call(h, e) ? !1 : e.data
  127. }
  128. function r() {
  129. y.removeListener(b, d)
  130. }
  131. var e = a.call(this, b);
  132. if (0 > e.getListenerIndex(d)) {
  133. e = e.listeners;
  134. h || (h = this);
  135. isNaN(g) && (g = 10);
  136. var y = this;
  137. n.fn = d;
  138. n.priority = g;
  139. for (var v = e.length - 1; 0 <= v; v--)
  140. if (e[v].priority <= g) return e.splice(v + 1, 0, n), {
  141. removeListener: r
  142. };
  143. e.unshift(n)
  144. }
  145. return {
  146. removeListener: r
  147. }
  148. },
  149. once: function() {
  150. var a = Array.prototype.slice.call(arguments),
  151. b = a[1];
  152. a[1] = function(a) {
  153. a.removeListener();
  154. return b.apply(this, arguments)
  155. };
  156. return this.on.apply(this, a)
  157. },
  158. capture: function() {
  159. CKEDITOR.event.useCapture = 1;
  160. var a = this.on.apply(this, arguments);
  161. CKEDITOR.event.useCapture = 0;
  162. return a
  163. },
  164. fire: function() {
  165. var a = 0,
  166. b = function() {
  167. a = 1
  168. },
  169. h = 0,
  170. k = function() {
  171. h = 1
  172. };
  173. return function(g, n, r) {
  174. var e = d(this)[g];
  175. g = a;
  176. var y = h;
  177. a = h = 0;
  178. if (e) {
  179. var v = e.listeners;
  180. if (v.length)
  181. for (var v = v.slice(0), B, D = 0; D < v.length; D++) {
  182. if (e.errorProof) try {
  183. B =
  184. v[D].call(this, r, n, b, k)
  185. } catch (x) {} else B = v[D].call(this, r, n, b, k);
  186. !1 === B ? h = 1 : "undefined" != typeof B && (n = B);
  187. if (a || h) break
  188. }
  189. }
  190. n = h ? !1 : "undefined" == typeof n ? !0 : n;
  191. a = g;
  192. h = y;
  193. return n
  194. }
  195. }(),
  196. fireOnce: function(a, b, h) {
  197. b = this.fire(a, b, h);
  198. delete d(this)[a];
  199. return b
  200. },
  201. removeListener: function(a, b) {
  202. var h = d(this)[a];
  203. if (h) {
  204. var k = h.getListenerIndex(b);
  205. 0 <= k && h.listeners.splice(k, 1)
  206. }
  207. },
  208. removeAllListeners: function() {
  209. var a = d(this),
  210. b;
  211. for (b in a) delete a[b]
  212. },
  213. hasListeners: function(a) {
  214. return (a = d(this)[a]) && 0 < a.listeners.length
  215. }
  216. }
  217. }());
  218. CKEDITOR.editor || (CKEDITOR.editor = function() {
  219. CKEDITOR._.pending.push([this, arguments]);
  220. CKEDITOR.event.call(this)
  221. }, CKEDITOR.editor.prototype.fire = function(a, d) {
  222. a in {
  223. instanceReady: 1,
  224. loaded: 1
  225. } && (this[a] = !0);
  226. return CKEDITOR.event.prototype.fire.call(this, a, d, this)
  227. }, CKEDITOR.editor.prototype.fireOnce = function(a, d) {
  228. a in {
  229. instanceReady: 1,
  230. loaded: 1
  231. } && (this[a] = !0);
  232. return CKEDITOR.event.prototype.fireOnce.call(this, a, d, this)
  233. }, CKEDITOR.event.implementOn(CKEDITOR.editor.prototype));
  234. CKEDITOR.env || (CKEDITOR.env = function() {
  235. var a = navigator.userAgent.toLowerCase(),
  236. d = a.match(/edge[ \/](\d+.?\d*)/),
  237. b = -1 < a.indexOf("trident/"),
  238. b = !(!d && !b),
  239. b = {
  240. ie: b,
  241. edge: !!d,
  242. webkit: !b && -1 < a.indexOf(" applewebkit/"),
  243. air: -1 < a.indexOf(" adobeair/"),
  244. mac: -1 < a.indexOf("macintosh"),
  245. quirks: "BackCompat" == document.compatMode && (!document.documentMode || 10 > document.documentMode),
  246. mobile: -1 < a.indexOf("mobile"),
  247. iOS: /(ipad|iphone|ipod)/.test(a),
  248. isCustomDomain: function() {
  249. if (!this.ie) return !1;
  250. var a = document.domain,
  251. b = window.location.hostname;
  252. return a != b && a != "[" + b + "]"
  253. },
  254. secure: "https:" == location.protocol
  255. };
  256. b.gecko = "Gecko" == navigator.product && !b.webkit && !b.ie;
  257. b.webkit && (-1 < a.indexOf("chrome") ? b.chrome = !0 : b.safari = !0);
  258. var c = 0;
  259. b.ie && (c = d ? parseFloat(d[1]) : b.quirks || !document.documentMode ? parseFloat(a.match(/msie (\d+)/)[1]) : document.documentMode, b.ie9Compat = 9 == c, b.ie8Compat = 8 == c, b.ie7Compat = 7 == c, b.ie6Compat = 7 > c || b.quirks);
  260. b.gecko && (d = a.match(/rv:([\d\.]+)/)) && (d = d[1].split("."), c = 1E4 * d[0] + 100 * (d[1] || 0) + 1 * (d[2] || 0));
  261. b.air && (c = parseFloat(a.match(/ adobeair\/(\d+)/)[1]));
  262. b.webkit && (c = parseFloat(a.match(/ applewebkit\/(\d+)/)[1]));
  263. b.version = c;
  264. b.isCompatible = !(b.ie && 7 > c) && !(b.gecko && 4E4 > c) && !(b.webkit && 534 > c);
  265. b.hidpi = 2 <= window.devicePixelRatio;
  266. b.needsBrFiller = b.gecko || b.webkit || b.ie && 10 < c;
  267. b.needsNbspFiller = b.ie && 11 > c;
  268. b.cssClass = "cke_browser_" + (b.ie ? "ie" : b.gecko ? "gecko" : b.webkit ? "webkit" : "unknown");
  269. b.quirks && (b.cssClass += " cke_browser_quirks");
  270. b.ie && (b.cssClass += " cke_browser_ie" + (b.quirks ? "6 cke_browser_iequirks" : b.version));
  271. b.air && (b.cssClass += " cke_browser_air");
  272. b.iOS && (b.cssClass += " cke_browser_ios");
  273. b.hidpi && (b.cssClass += " cke_hidpi");
  274. return b
  275. }());
  276. "unloaded" == CKEDITOR.status && function() {
  277. CKEDITOR.event.implementOn(CKEDITOR);
  278. CKEDITOR.loadFullCore = function() {
  279. if ("basic_ready" != CKEDITOR.status) CKEDITOR.loadFullCore._load = 1;
  280. else {
  281. delete CKEDITOR.loadFullCore;
  282. var a = document.createElement("script");
  283. a.type = "text/javascript";
  284. a.src = CKEDITOR.basePath + "ckeditor.js";
  285. document.getElementsByTagName("head")[0].appendChild(a)
  286. }
  287. };
  288. CKEDITOR.loadFullCoreTimeout = 0;
  289. CKEDITOR.add = function(a) {
  290. (this._.pending || (this._.pending = [])).push(a)
  291. };
  292. (function() {
  293. CKEDITOR.domReady(function() {
  294. var a =
  295. CKEDITOR.loadFullCore,
  296. d = CKEDITOR.loadFullCoreTimeout;
  297. a && (CKEDITOR.status = "basic_ready", a && a._load ? a() : d && setTimeout(function() {
  298. CKEDITOR.loadFullCore && CKEDITOR.loadFullCore()
  299. }, 1E3 * d))
  300. })
  301. })();
  302. CKEDITOR.status = "basic_loaded"
  303. }();
  304. "use strict";
  305. CKEDITOR.VERBOSITY_WARN = 1;
  306. CKEDITOR.VERBOSITY_ERROR = 2;
  307. CKEDITOR.verbosity = CKEDITOR.VERBOSITY_WARN | CKEDITOR.VERBOSITY_ERROR;
  308. CKEDITOR.warn = function(a, d) {
  309. CKEDITOR.verbosity & CKEDITOR.VERBOSITY_WARN && CKEDITOR.fire("log", {
  310. type: "warn",
  311. errorCode: a,
  312. additionalData: d
  313. })
  314. };
  315. CKEDITOR.error = function(a, d) {
  316. CKEDITOR.verbosity & CKEDITOR.VERBOSITY_ERROR && CKEDITOR.fire("log", {
  317. type: "error",
  318. errorCode: a,
  319. additionalData: d
  320. })
  321. };
  322. CKEDITOR.on("log", function(a) {
  323. if (window.console && window.console.log) {
  324. var d = console[a.data.type] ? a.data.type : "log",
  325. b = a.data.errorCode;
  326. if (a = a.data.additionalData) console[d]("[CKEDITOR] Error code: " + b + ".", a);
  327. else console[d]("[CKEDITOR] Error code: " + b + ".");
  328. console[d]("[CKEDITOR] For more information about this error go to https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#" + b)
  329. }
  330. }, null, null, 999);
  331. CKEDITOR.dom = {};
  332. (function() {
  333. var a = [],
  334. d = CKEDITOR.env.gecko ? "-moz-" : CKEDITOR.env.webkit ? "-webkit-" : CKEDITOR.env.ie ? "-ms-" : "",
  335. b = /&/g,
  336. c = />/g,
  337. f = /</g,
  338. h = /"/g,
  339. k = /&(lt|gt|amp|quot|nbsp|shy|#\d{1,5});/g,
  340. g = {
  341. lt: "\x3c",
  342. gt: "\x3e",
  343. amp: "\x26",
  344. quot: '"',
  345. nbsp: " ",
  346. shy: "­"
  347. },
  348. n = function(a, e) {
  349. return "#" == e[0] ? String.fromCharCode(parseInt(e.slice(1), 10)) : g[e]
  350. };
  351. CKEDITOR.on("reset", function() {
  352. a = []
  353. });
  354. CKEDITOR.tools = {
  355. arrayCompare: function(a, e) {
  356. if (!a && !e) return !0;
  357. if (!a || !e || a.length != e.length) return !1;
  358. for (var b = 0; b < a.length; b++)
  359. if (a[b] != e[b]) return !1;
  360. return !0
  361. },
  362. getIndex: function(a, e) {
  363. for (var b = 0; b < a.length; ++b)
  364. if (e(a[b])) return b;
  365. return -1
  366. },
  367. clone: function(a) {
  368. var e;
  369. if (a && a instanceof Array) {
  370. e = [];
  371. for (var b = 0; b < a.length; b++) e[b] = CKEDITOR.tools.clone(a[b]);
  372. return e
  373. }
  374. if (null === a || "object" != typeof a || a instanceof String || a instanceof Number || a instanceof Boolean || a instanceof Date || a instanceof RegExp || a.nodeType || a.window === a) return a;
  375. e = new a.constructor;
  376. for (b in a) e[b] = CKEDITOR.tools.clone(a[b]);
  377. return e
  378. },
  379. capitalize: function(a, e) {
  380. return a.charAt(0).toUpperCase() +
  381. (e ? a.slice(1) : a.slice(1).toLowerCase())
  382. },
  383. extend: function(a) {
  384. var e = arguments.length,
  385. b, v;
  386. "boolean" == typeof(b = arguments[e - 1]) ? e-- : "boolean" == typeof(b = arguments[e - 2]) && (v = arguments[e - 1], e -= 2);
  387. for (var c = 1; c < e; c++) {
  388. var g = arguments[c],
  389. d;
  390. for (d in g)
  391. if (!0 === b || null == a[d])
  392. if (!v || d in v) a[d] = g[d]
  393. }
  394. return a
  395. },
  396. prototypedCopy: function(a) {
  397. var e = function() {};
  398. e.prototype = a;
  399. return new e
  400. },
  401. copy: function(a) {
  402. var e = {},
  403. b;
  404. for (b in a) e[b] = a[b];
  405. return e
  406. },
  407. isArray: function(a) {
  408. return "[object Array]" == Object.prototype.toString.call(a)
  409. },
  410. isEmpty: function(a) {
  411. for (var e in a)
  412. if (a.hasOwnProperty(e)) return !1;
  413. return !0
  414. },
  415. cssVendorPrefix: function(a, e, b) {
  416. if (b) return d + a + ":" + e + ";" + a + ":" + e;
  417. b = {};
  418. b[a] = e;
  419. b[d + a] = e;
  420. return b
  421. },
  422. cssStyleToDomStyle: function() {
  423. var a = document.createElement("div").style,
  424. e = "undefined" != typeof a.cssFloat ? "cssFloat" : "undefined" != typeof a.styleFloat ? "styleFloat" : "float";
  425. return function(a) {
  426. return "float" == a ? e : a.replace(/-./g, function(a) {
  427. return a.substr(1).toUpperCase()
  428. })
  429. }
  430. }(),
  431. buildStyleHtml: function(a) {
  432. a = [].concat(a);
  433. for (var e,
  434. b = [], v = 0; v < a.length; v++)
  435. if (e = a[v]) /@import|[{}]/.test(e) ? b.push("\x3cstyle\x3e" + e + "\x3c/style\x3e") : b.push('\x3clink type\x3d"text/css" rel\x3dstylesheet href\x3d"' + e + '"\x3e');
  436. return b.join("")
  437. },
  438. htmlEncode: function(a) {
  439. return void 0 === a || null === a ? "" : String(a).replace(b, "\x26amp;").replace(c, "\x26gt;").replace(f, "\x26lt;")
  440. },
  441. htmlDecode: function(a) {
  442. return a.replace(k, n)
  443. },
  444. htmlEncodeAttr: function(a) {
  445. return CKEDITOR.tools.htmlEncode(a).replace(h, "\x26quot;")
  446. },
  447. htmlDecodeAttr: function(a) {
  448. return CKEDITOR.tools.htmlDecode(a)
  449. },
  450. transformPlainTextToHtml: function(a, e) {
  451. var b = e == CKEDITOR.ENTER_BR,
  452. v = this.htmlEncode(a.replace(/\r\n/g, "\n")),
  453. v = v.replace(/\t/g, "\x26nbsp;\x26nbsp; \x26nbsp;"),
  454. c = e == CKEDITOR.ENTER_P ? "p" : "div";
  455. if (!b) {
  456. var g = /\n{2}/g;
  457. if (g.test(v)) var d = "\x3c" + c + "\x3e",
  458. m = "\x3c/" + c + "\x3e",
  459. v = d + v.replace(g, function() {
  460. return m + d
  461. }) + m
  462. }
  463. v = v.replace(/\n/g, "\x3cbr\x3e");
  464. b || (v = v.replace(new RegExp("\x3cbr\x3e(?\x3d\x3c/" + c + "\x3e)"), function(a) {
  465. return CKEDITOR.tools.repeat(a, 2)
  466. }));
  467. v = v.replace(/^ | $/g, "\x26nbsp;");
  468. return v = v.replace(/(>|\s) /g,
  469. function(a, e) {
  470. return e + "\x26nbsp;"
  471. }).replace(/ (?=<)/g, "\x26nbsp;")
  472. },
  473. getNextNumber: function() {
  474. var a = 0;
  475. return function() {
  476. return ++a
  477. }
  478. }(),
  479. getNextId: function() {
  480. return "cke_" + this.getNextNumber()
  481. },
  482. getUniqueId: function() {
  483. for (var a = "e", e = 0; 8 > e; e++) a += Math.floor(65536 * (1 + Math.random())).toString(16).substring(1);
  484. return a
  485. },
  486. override: function(a, e) {
  487. var b = e(a);
  488. b.prototype = a.prototype;
  489. return b
  490. },
  491. setTimeout: function(a, e, b, c, g) {
  492. g || (g = window);
  493. b || (b = g);
  494. return g.setTimeout(function() {
  495. c ? a.apply(b, [].concat(c)) : a.apply(b)
  496. },
  497. e || 0)
  498. },
  499. throttle: function(a, e, b) {
  500. var c, g = 0;
  501. b = b || {};
  502. return {
  503. input: function() {
  504. function d() {
  505. g = (new Date).getTime();
  506. c = !1;
  507. e.apply(b, n)
  508. }
  509. var n = Array.prototype.slice.call(arguments);
  510. c && (clearTimeout(c), c = 0);
  511. var m = (new Date).getTime() - g;
  512. m < a ? c = setTimeout(d, a - m) : d()
  513. },
  514. reset: function() {
  515. c && (clearTimeout(c), c = g = 0)
  516. }
  517. }
  518. },
  519. trim: function() {
  520. var a = /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;
  521. return function(e) {
  522. return e.replace(a, "")
  523. }
  524. }(),
  525. ltrim: function() {
  526. var a = /^[ \t\n\r]+/g;
  527. return function(e) {
  528. return e.replace(a, "")
  529. }
  530. }(),
  531. rtrim: function() {
  532. var a =
  533. /[ \t\n\r]+$/g;
  534. return function(e) {
  535. return e.replace(a, "")
  536. }
  537. }(),
  538. indexOf: function(a, e) {
  539. if ("function" == typeof e)
  540. for (var b = 0, c = a.length; b < c; b++) {
  541. if (e(a[b])) return b
  542. } else {
  543. if (a.indexOf) return a.indexOf(e);
  544. b = 0;
  545. for (c = a.length; b < c; b++)
  546. if (a[b] === e) return b
  547. }
  548. return -1
  549. },
  550. search: function(a, e) {
  551. var b = CKEDITOR.tools.indexOf(a, e);
  552. return 0 <= b ? a[b] : null
  553. },
  554. bind: function(a, e) {
  555. return function() {
  556. return a.apply(e, arguments)
  557. }
  558. },
  559. createClass: function(a) {
  560. var e = a.$,
  561. b = a.base,
  562. c = a.privates || a._,
  563. g = a.proto;
  564. a = a.statics;
  565. !e && (e = function() {
  566. b &&
  567. this.base.apply(this, arguments)
  568. });
  569. if (c) var d = e,
  570. e = function() {
  571. var a = this._ || (this._ = {}),
  572. e;
  573. for (e in c) {
  574. var b = c[e];
  575. a[e] = "function" == typeof b ? CKEDITOR.tools.bind(b, this) : b
  576. }
  577. d.apply(this, arguments)
  578. };
  579. b && (e.prototype = this.prototypedCopy(b.prototype), e.prototype.constructor = e, e.base = b, e.baseProto = b.prototype, e.prototype.base = function() {
  580. this.base = b.prototype.base;
  581. b.apply(this, arguments);
  582. this.base = arguments.callee
  583. });
  584. g && this.extend(e.prototype, g, !0);
  585. a && this.extend(e, a, !0);
  586. return e
  587. },
  588. addFunction: function(b, e) {
  589. return a.push(function() {
  590. return b.apply(e ||
  591. this, arguments)
  592. }) - 1
  593. },
  594. removeFunction: function(b) {
  595. a[b] = null
  596. },
  597. callFunction: function(b) {
  598. var e = a[b];
  599. return e && e.apply(window, Array.prototype.slice.call(arguments, 1))
  600. },
  601. cssLength: function() {
  602. var a = /^-?\d+\.?\d*px$/,
  603. e;
  604. return function(b) {
  605. e = CKEDITOR.tools.trim(b + "") + "px";
  606. return a.test(e) ? e : b || ""
  607. }
  608. }(),
  609. convertToPx: function() {
  610. var a;
  611. return function(e) {
  612. 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),
  613. CKEDITOR.document.getBody().append(a));
  614. return /%$/.test(e) ? e : (a.setStyle("width", e), a.$.clientWidth)
  615. }
  616. }(),
  617. repeat: function(a, e) {
  618. return Array(e + 1).join(a)
  619. },
  620. tryThese: function() {
  621. for (var a, e = 0, b = arguments.length; e < b; e++) {
  622. var c = arguments[e];
  623. try {
  624. a = c();
  625. break
  626. } catch (g) {}
  627. }
  628. return a
  629. },
  630. genKey: function() {
  631. return Array.prototype.slice.call(arguments).join("-")
  632. },
  633. defer: function(a) {
  634. return function() {
  635. var e = arguments,
  636. b = this;
  637. window.setTimeout(function() {
  638. a.apply(b, e)
  639. }, 0)
  640. }
  641. },
  642. normalizeCssText: function(a, e) {
  643. var b = [],
  644. c, g = CKEDITOR.tools.parseCssText(a,
  645. !0, e);
  646. for (c in g) b.push(c + ":" + g[c]);
  647. b.sort();
  648. return b.length ? b.join(";") + ";" : ""
  649. },
  650. convertRgbToHex: function(a) {
  651. return a.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi, function(a, b, c, g) {
  652. a = [b, c, g];
  653. for (b = 0; 3 > b; b++) a[b] = ("0" + parseInt(a[b], 10).toString(16)).slice(-2);
  654. return "#" + a.join("")
  655. })
  656. },
  657. normalizeHex: function(a) {
  658. return a.replace(/#(([0-9a-f]{3}){1,2})($|;|\s+)/gi, function(a, b, c, g) {
  659. a = b.toLowerCase();
  660. 3 == a.length && (a = a.split(""), a = [a[0], a[0], a[1], a[1], a[2], a[2]].join(""));
  661. return "#" + a + g
  662. })
  663. },
  664. parseCssText: function(a,
  665. e, b) {
  666. var c = {};
  667. b && (a = (new CKEDITOR.dom.element("span")).setAttribute("style", a).getAttribute("style") || "");
  668. a && (a = CKEDITOR.tools.normalizeHex(CKEDITOR.tools.convertRgbToHex(a)));
  669. if (!a || ";" == a) return c;
  670. a.replace(/&quot;/g, '"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function(a, b, g) {
  671. e && (b = b.toLowerCase(), "font-family" == b && (g = g.replace(/\s*,\s*/g, ",")), g = CKEDITOR.tools.trim(g));
  672. c[b] = g
  673. });
  674. return c
  675. },
  676. writeCssText: function(a, e) {
  677. var b, c = [];
  678. for (b in a) c.push(b + ":" + a[b]);
  679. e && c.sort();
  680. return c.join("; ")
  681. },
  682. objectCompare: function(a, e, b) {
  683. var c;
  684. if (!a && !e) return !0;
  685. if (!a || !e) return !1;
  686. for (c in a)
  687. if (a[c] != e[c]) return !1;
  688. if (!b)
  689. for (c in e)
  690. if (a[c] != e[c]) return !1;
  691. return !0
  692. },
  693. objectKeys: function(a) {
  694. var e = [],
  695. b;
  696. for (b in a) e.push(b);
  697. return e
  698. },
  699. convertArrayToObject: function(a, e) {
  700. var b = {};
  701. 1 == arguments.length && (e = !0);
  702. for (var c = 0, g = a.length; c < g; ++c) b[a[c]] = e;
  703. return b
  704. },
  705. fixDomain: function() {
  706. for (var a;;) try {
  707. a = window.parent.document.domain;
  708. break
  709. } catch (e) {
  710. a = a ? a.replace(/.+?(?:\.|$)/, "") : document.domain;
  711. if (!a) break;
  712. document.domain =
  713. a
  714. }
  715. return !!a
  716. },
  717. eventsBuffer: function(a, e, b) {
  718. function c() {
  719. d = (new Date).getTime();
  720. g = !1;
  721. b ? e.call(b) : e()
  722. }
  723. var g, d = 0;
  724. return {
  725. input: function() {
  726. if (!g) {
  727. var e = (new Date).getTime() - d;
  728. e < a ? g = setTimeout(c, a - e) : c()
  729. }
  730. },
  731. reset: function() {
  732. g && clearTimeout(g);
  733. g = d = 0
  734. }
  735. }
  736. },
  737. enableHtml5Elements: function(a, e) {
  738. for (var b = "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 = b.length, g; c--;) g = a.createElement(b[c]),
  739. e && a.appendChild(g)
  740. },
  741. checkIfAnyArrayItemMatches: function(a, e) {
  742. for (var b = 0, c = a.length; b < c; ++b)
  743. if (a[b].match(e)) return !0;
  744. return !1
  745. },
  746. checkIfAnyObjectPropertyMatches: function(a, e) {
  747. for (var b in a)
  748. if (b.match(e)) return !0;
  749. return !1
  750. },
  751. keystrokeToString: function(a, e) {
  752. var b = this.keystrokeToArray(a, e);
  753. b.display = b.display.join("+");
  754. b.aria = b.aria.join("+");
  755. return b
  756. },
  757. keystrokeToArray: function(a, e) {
  758. var b = e & 16711680,
  759. c = e & 65535,
  760. g = CKEDITOR.env.mac,
  761. d = [],
  762. n = [];
  763. b & CKEDITOR.CTRL && (d.push(g ? "⌘" : a[17]), n.push(g ? a[224] : a[17]));
  764. b & CKEDITOR.ALT && (d.push(g ? "⌥" : a[18]), n.push(a[18]));
  765. b & CKEDITOR.SHIFT && (d.push(g ? "⇧" : a[16]), n.push(a[16]));
  766. c && (a[c] ? (d.push(a[c]), n.push(a[c])) : (d.push(String.fromCharCode(c)), n.push(String.fromCharCode(c))));
  767. return {
  768. display: d,
  769. aria: n
  770. }
  771. },
  772. transparentImageData: "data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw\x3d\x3d",
  773. getCookie: function(a) {
  774. a = a.toLowerCase();
  775. for (var e = document.cookie.split(";"), b, c, g = 0; g < e.length; g++)
  776. if (b = e[g].split("\x3d"), c = decodeURIComponent(CKEDITOR.tools.trim(b[0]).toLowerCase()),
  777. c === a) return decodeURIComponent(1 < b.length ? b[1] : "");
  778. return null
  779. },
  780. setCookie: function(a, e) {
  781. document.cookie = encodeURIComponent(a) + "\x3d" + encodeURIComponent(e) + ";path\x3d/"
  782. },
  783. getCsrfToken: function() {
  784. var a = CKEDITOR.tools.getCookie("ckCsrfToken");
  785. if (!a || 40 != a.length) {
  786. var a = [],
  787. e = "";
  788. if (window.crypto && window.crypto.getRandomValues) a = new Uint8Array(40), window.crypto.getRandomValues(a);
  789. else
  790. for (var b = 0; 40 > b; b++) a.push(Math.floor(256 * Math.random()));
  791. for (b = 0; b < a.length; b++) var c = "abcdefghijklmnopqrstuvwxyz0123456789".charAt(a[b] %
  792. 36),
  793. e = e + (.5 < Math.random() ? c.toUpperCase() : c);
  794. a = e;
  795. CKEDITOR.tools.setCookie("ckCsrfToken", a)
  796. }
  797. return a
  798. },
  799. escapeCss: function(a) {
  800. 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) : ""
  801. },
  802. getMouseButton: function(a) {
  803. var b = (a = a.data) && a.$;
  804. return a && b ? CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? 4 === b.button ? CKEDITOR.MOUSE_BUTTON_MIDDLE : 1 === b.button ? CKEDITOR.MOUSE_BUTTON_LEFT : CKEDITOR.MOUSE_BUTTON_RIGHT : b.button : !1
  805. },
  806. convertHexStringToBytes: function(a) {
  807. var b = [],
  808. c = a.length / 2,
  809. g;
  810. for (g = 0; g < c; g++) b.push(parseInt(a.substr(2 * g, 2), 16));
  811. return b
  812. },
  813. convertBytesToBase64: function(a) {
  814. var b = "",
  815. c = a.length,
  816. g;
  817. for (g = 0; g < c; g += 3) {
  818. var d = a.slice(g, g + 3),
  819. n = d.length,
  820. f = [],
  821. m;
  822. if (3 > n)
  823. for (m = n; 3 > m; m++) d[m] = 0;
  824. f[0] = (d[0] & 252) >> 2;
  825. f[1] = (d[0] & 3) << 4 | d[1] >> 4;
  826. f[2] = (d[1] & 15) << 2 | (d[2] & 192) >> 6;
  827. f[3] = d[2] & 63;
  828. for (m = 0; 4 > m; m++) b = m <= n ? b + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f[m]) : b + "\x3d"
  829. }
  830. return b
  831. },
  832. style: {
  833. parse: {
  834. _colors: {
  835. aliceblue: "#F0F8FF",
  836. antiquewhite: "#FAEBD7",
  837. aqua: "#00FFFF",
  838. aquamarine: "#7FFFD4",
  839. azure: "#F0FFFF",
  840. beige: "#F5F5DC",
  841. bisque: "#FFE4C4",
  842. black: "#000000",
  843. blanchedalmond: "#FFEBCD",
  844. blue: "#0000FF",
  845. blueviolet: "#8A2BE2",
  846. brown: "#A52A2A",
  847. burlywood: "#DEB887",
  848. cadetblue: "#5F9EA0",
  849. chartreuse: "#7FFF00",
  850. chocolate: "#D2691E",
  851. coral: "#FF7F50",
  852. cornflowerblue: "#6495ED",
  853. cornsilk: "#FFF8DC",
  854. crimson: "#DC143C",
  855. cyan: "#00FFFF",
  856. darkblue: "#00008B",
  857. darkcyan: "#008B8B",
  858. darkgoldenrod: "#B8860B",
  859. darkgray: "#A9A9A9",
  860. darkgreen: "#006400",
  861. darkgrey: "#A9A9A9",
  862. darkkhaki: "#BDB76B",
  863. darkmagenta: "#8B008B",
  864. darkolivegreen: "#556B2F",
  865. darkorange: "#FF8C00",
  866. darkorchid: "#9932CC",
  867. darkred: "#8B0000",
  868. darksalmon: "#E9967A",
  869. darkseagreen: "#8FBC8F",
  870. darkslateblue: "#483D8B",
  871. darkslategray: "#2F4F4F",
  872. darkslategrey: "#2F4F4F",
  873. darkturquoise: "#00CED1",
  874. darkviolet: "#9400D3",
  875. deeppink: "#FF1493",
  876. deepskyblue: "#00BFFF",
  877. dimgray: "#696969",
  878. dimgrey: "#696969",
  879. dodgerblue: "#1E90FF",
  880. firebrick: "#B22222",
  881. floralwhite: "#FFFAF0",
  882. forestgreen: "#228B22",
  883. fuchsia: "#FF00FF",
  884. gainsboro: "#DCDCDC",
  885. ghostwhite: "#F8F8FF",
  886. gold: "#FFD700",
  887. goldenrod: "#DAA520",
  888. gray: "#808080",
  889. green: "#008000",
  890. greenyellow: "#ADFF2F",
  891. grey: "#808080",
  892. honeydew: "#F0FFF0",
  893. hotpink: "#FF69B4",
  894. indianred: "#CD5C5C",
  895. indigo: "#4B0082",
  896. ivory: "#FFFFF0",
  897. khaki: "#F0E68C",
  898. lavender: "#E6E6FA",
  899. lavenderblush: "#FFF0F5",
  900. lawngreen: "#7CFC00",
  901. lemonchiffon: "#FFFACD",
  902. lightblue: "#ADD8E6",
  903. lightcoral: "#F08080",
  904. lightcyan: "#E0FFFF",
  905. lightgoldenrodyellow: "#FAFAD2",
  906. lightgray: "#D3D3D3",
  907. lightgreen: "#90EE90",
  908. lightgrey: "#D3D3D3",
  909. lightpink: "#FFB6C1",
  910. lightsalmon: "#FFA07A",
  911. lightseagreen: "#20B2AA",
  912. lightskyblue: "#87CEFA",
  913. lightslategray: "#778899",
  914. lightslategrey: "#778899",
  915. lightsteelblue: "#B0C4DE",
  916. lightyellow: "#FFFFE0",
  917. lime: "#00FF00",
  918. limegreen: "#32CD32",
  919. linen: "#FAF0E6",
  920. magenta: "#FF00FF",
  921. maroon: "#800000",
  922. mediumaquamarine: "#66CDAA",
  923. mediumblue: "#0000CD",
  924. mediumorchid: "#BA55D3",
  925. mediumpurple: "#9370DB",
  926. mediumseagreen: "#3CB371",
  927. mediumslateblue: "#7B68EE",
  928. mediumspringgreen: "#00FA9A",
  929. mediumturquoise: "#48D1CC",
  930. mediumvioletred: "#C71585",
  931. midnightblue: "#191970",
  932. mintcream: "#F5FFFA",
  933. mistyrose: "#FFE4E1",
  934. moccasin: "#FFE4B5",
  935. navajowhite: "#FFDEAD",
  936. navy: "#000080",
  937. oldlace: "#FDF5E6",
  938. olive: "#808000",
  939. olivedrab: "#6B8E23",
  940. orange: "#FFA500",
  941. orangered: "#FF4500",
  942. orchid: "#DA70D6",
  943. palegoldenrod: "#EEE8AA",
  944. palegreen: "#98FB98",
  945. paleturquoise: "#AFEEEE",
  946. palevioletred: "#DB7093",
  947. papayawhip: "#FFEFD5",
  948. peachpuff: "#FFDAB9",
  949. peru: "#CD853F",
  950. pink: "#FFC0CB",
  951. plum: "#DDA0DD",
  952. powderblue: "#B0E0E6",
  953. purple: "#800080",
  954. rebeccapurple: "#663399",
  955. red: "#FF0000",
  956. rosybrown: "#BC8F8F",
  957. royalblue: "#4169E1",
  958. saddlebrown: "#8B4513",
  959. salmon: "#FA8072",
  960. sandybrown: "#F4A460",
  961. seagreen: "#2E8B57",
  962. seashell: "#FFF5EE",
  963. sienna: "#A0522D",
  964. silver: "#C0C0C0",
  965. skyblue: "#87CEEB",
  966. slateblue: "#6A5ACD",
  967. slategray: "#708090",
  968. slategrey: "#708090",
  969. snow: "#FFFAFA",
  970. springgreen: "#00FF7F",
  971. steelblue: "#4682B4",
  972. tan: "#D2B48C",
  973. teal: "#008080",
  974. thistle: "#D8BFD8",
  975. tomato: "#FF6347",
  976. turquoise: "#40E0D0",
  977. violet: "#EE82EE",
  978. wheat: "#F5DEB3",
  979. white: "#FFFFFF",
  980. whitesmoke: "#F5F5F5",
  981. yellow: "#FFFF00",
  982. yellowgreen: "#9ACD32"
  983. },
  984. _borderStyle: "none hidden dotted dashed solid double groove ridge inset outset".split(" "),
  985. _widthRegExp: /^(thin|medium|thick|[\+-]?\d+(\.\d+)?[a-z%]+|[\+-]?0+(\.0+)?|\.\d+[a-z%]+)$/,
  986. _rgbaRegExp: /rgba?\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*(?:,\s*[0-9.]+\s*)?\)/gi,
  987. _hslaRegExp: /hsla?\(\s*[0-9.]+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi,
  988. background: function(a) {
  989. var b = {},
  990. c = this._findColor(a);
  991. c.length && (b.color = c[0], CKEDITOR.tools.array.forEach(c, function(b) {
  992. a = a.replace(b, "")
  993. }));
  994. if (a = CKEDITOR.tools.trim(a)) b.unprocessed = a;
  995. return b
  996. },
  997. margin: function(a) {
  998. function b(a) {
  999. c.top = g[a[0]];
  1000. c.right = g[a[1]];
  1001. c.bottom = g[a[2]];
  1002. c.left = g[a[3]]
  1003. }
  1004. var c = {},
  1005. g = a.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset)/g) || ["0px"];
  1006. switch (g.length) {
  1007. case 1:
  1008. b([0, 0, 0, 0]);
  1009. break;
  1010. case 2:
  1011. b([0, 1, 0, 1]);
  1012. break;
  1013. case 3:
  1014. b([0, 1, 2, 1]);
  1015. break;
  1016. case 4:
  1017. b([0, 1, 2, 3])
  1018. }
  1019. return c
  1020. },
  1021. border: function(a) {
  1022. var b = {},
  1023. c = a.split(/\s+/g);
  1024. a = CKEDITOR.tools.style.parse._findColor(a);
  1025. a.length && (b.color = a[0]);
  1026. CKEDITOR.tools.array.forEach(c, function(a) {
  1027. b.style || -1 === CKEDITOR.tools.indexOf(CKEDITOR.tools.style.parse._borderStyle, a) ? !b.width && CKEDITOR.tools.style.parse._widthRegExp.test(a) && (b.width = a) : b.style = a
  1028. });
  1029. return b
  1030. },
  1031. _findColor: function(a) {
  1032. var b = [],
  1033. c = CKEDITOR.tools.array,
  1034. b = b.concat(a.match(this._rgbaRegExp) || []),
  1035. b = b.concat(a.match(this._hslaRegExp) || []);
  1036. return b = b.concat(c.filter(a.split(/\s+/), function(a) {
  1037. return a.match(/^\#[a-f0-9]{3}(?:[a-f0-9]{3})?$/gi) ? !0 : a.toLowerCase() in CKEDITOR.tools.style.parse._colors
  1038. }))
  1039. }
  1040. }
  1041. },
  1042. array: {
  1043. filter: function(a, b, c) {
  1044. var g = [];
  1045. this.forEach(a, function(d, n) {
  1046. b.call(c, d, n, a) && g.push(d)
  1047. });
  1048. return g
  1049. },
  1050. forEach: function(a, b, c) {
  1051. var g = a.length,
  1052. d;
  1053. for (d = 0; d < g; d++) b.call(c, a[d], d, a)
  1054. },
  1055. map: function(a, b, c) {
  1056. for (var g = [], d = 0; d < a.length; d++) g.push(b.call(c,
  1057. a[d], d, a));
  1058. return g
  1059. },
  1060. reduce: function(a, b, c, g) {
  1061. for (var d = 0; d < a.length; d++) c = b.call(g, c, a[d], d, a);
  1062. return c
  1063. },
  1064. every: function(a, b, c) {
  1065. if (!a.length) return !0;
  1066. b = this.filter(a, b, c);
  1067. return a.length === b.length
  1068. }
  1069. },
  1070. object: {
  1071. findKey: function(a, b) {
  1072. if ("object" !== typeof a) return null;
  1073. for (var c in a)
  1074. if (a[c] === b) return c;
  1075. return null
  1076. },
  1077. merge: function(a, b) {
  1078. var c = CKEDITOR.tools,
  1079. g = c.clone(a),
  1080. d = c.clone(b);
  1081. c.array.forEach(c.objectKeys(d), function(a) {
  1082. g[a] = "object" === typeof d[a] && "object" === typeof g[a] ? c.object.merge(g[a], d[a]) :
  1083. d[a]
  1084. });
  1085. return g
  1086. }
  1087. },
  1088. getAbsoluteRectPosition: function(a, b) {
  1089. function c(a) {
  1090. if (a) {
  1091. var b = a.getClientRect();
  1092. g.top += b.top;
  1093. g.left += b.left;
  1094. "x" in g && "y" in g && (g.x += b.x, g.y += b.y);
  1095. c(a.getWindow().getFrame())
  1096. }
  1097. }
  1098. var g = CKEDITOR.tools.copy(b);
  1099. c(a.getFrame());
  1100. var d = CKEDITOR.document.getWindow().getScrollPosition();
  1101. g.top += d.y;
  1102. g.left += d.x;
  1103. "x" in g && "y" in g && (g.y += d.y, g.x += d.x);
  1104. g.right = g.left + g.width;
  1105. g.bottom = g.top + g.height;
  1106. return g
  1107. }
  1108. };
  1109. CKEDITOR.tools.array.indexOf = CKEDITOR.tools.indexOf;
  1110. CKEDITOR.tools.array.isArray = CKEDITOR.tools.isArray;
  1111. CKEDITOR.MOUSE_BUTTON_LEFT = 0;
  1112. CKEDITOR.MOUSE_BUTTON_MIDDLE = 1;
  1113. CKEDITOR.MOUSE_BUTTON_RIGHT = 2
  1114. })();
  1115. CKEDITOR.dtd = function() {
  1116. var a = CKEDITOR.tools.extend,
  1117. d = function(a, b) {
  1118. for (var c = CKEDITOR.tools.clone(a), g = 1; g < arguments.length; g++) {
  1119. b = arguments[g];
  1120. for (var d in b) delete c[d]
  1121. }
  1122. return c
  1123. },
  1124. b = {},
  1125. c = {},
  1126. f = {
  1127. address: 1,
  1128. article: 1,
  1129. aside: 1,
  1130. blockquote: 1,
  1131. details: 1,
  1132. div: 1,
  1133. dl: 1,
  1134. fieldset: 1,
  1135. figure: 1,
  1136. footer: 1,
  1137. form: 1,
  1138. h1: 1,
  1139. h2: 1,
  1140. h3: 1,
  1141. h4: 1,
  1142. h5: 1,
  1143. h6: 1,
  1144. header: 1,
  1145. hgroup: 1,
  1146. hr: 1,
  1147. main: 1,
  1148. menu: 1,
  1149. nav: 1,
  1150. ol: 1,
  1151. p: 1,
  1152. pre: 1,
  1153. section: 1,
  1154. table: 1,
  1155. ul: 1
  1156. },
  1157. h = {
  1158. command: 1,
  1159. link: 1,
  1160. meta: 1,
  1161. noscript: 1,
  1162. script: 1,
  1163. style: 1
  1164. },
  1165. k = {},
  1166. g = {
  1167. "#": 1
  1168. },
  1169. n = {
  1170. center: 1,
  1171. dir: 1,
  1172. noframes: 1
  1173. };
  1174. a(b, {
  1175. a: 1,
  1176. abbr: 1,
  1177. area: 1,
  1178. audio: 1,
  1179. b: 1,
  1180. bdi: 1,
  1181. bdo: 1,
  1182. br: 1,
  1183. button: 1,
  1184. canvas: 1,
  1185. cite: 1,
  1186. code: 1,
  1187. command: 1,
  1188. datalist: 1,
  1189. del: 1,
  1190. dfn: 1,
  1191. em: 1,
  1192. embed: 1,
  1193. i: 1,
  1194. iframe: 1,
  1195. img: 1,
  1196. input: 1,
  1197. ins: 1,
  1198. kbd: 1,
  1199. keygen: 1,
  1200. label: 1,
  1201. map: 1,
  1202. mark: 1,
  1203. meter: 1,
  1204. noscript: 1,
  1205. object: 1,
  1206. output: 1,
  1207. progress: 1,
  1208. q: 1,
  1209. ruby: 1,
  1210. s: 1,
  1211. samp: 1,
  1212. script: 1,
  1213. select: 1,
  1214. small: 1,
  1215. span: 1,
  1216. strong: 1,
  1217. sub: 1,
  1218. sup: 1,
  1219. textarea: 1,
  1220. time: 1,
  1221. u: 1,
  1222. "var": 1,
  1223. video: 1,
  1224. wbr: 1
  1225. }, g, {
  1226. acronym: 1,
  1227. applet: 1,
  1228. basefont: 1,
  1229. big: 1,
  1230. font: 1,
  1231. isindex: 1,
  1232. strike: 1,
  1233. style: 1,
  1234. tt: 1
  1235. });
  1236. a(c, f, b, n);
  1237. d = {
  1238. a: d(b, {
  1239. a: 1,
  1240. button: 1
  1241. }),
  1242. abbr: b,
  1243. address: c,
  1244. area: k,
  1245. article: c,
  1246. aside: c,
  1247. audio: a({
  1248. source: 1,
  1249. track: 1
  1250. }, c),
  1251. b: b,
  1252. base: k,
  1253. bdi: b,
  1254. bdo: b,
  1255. blockquote: c,
  1256. body: c,
  1257. br: k,
  1258. button: d(b, {
  1259. a: 1,
  1260. button: 1
  1261. }),
  1262. canvas: b,
  1263. caption: c,
  1264. cite: b,
  1265. code: b,
  1266. col: k,
  1267. colgroup: {
  1268. col: 1
  1269. },
  1270. command: k,
  1271. datalist: a({
  1272. option: 1
  1273. }, b),
  1274. dd: c,
  1275. del: b,
  1276. details: a({
  1277. summary: 1
  1278. }, c),
  1279. dfn: b,
  1280. div: c,
  1281. dl: {
  1282. dt: 1,
  1283. dd: 1
  1284. },
  1285. dt: c,
  1286. em: b,
  1287. embed: k,
  1288. fieldset: a({
  1289. legend: 1
  1290. }, c),
  1291. figcaption: c,
  1292. figure: a({
  1293. figcaption: 1
  1294. }, c),
  1295. footer: c,
  1296. form: c,
  1297. h1: b,
  1298. h2: b,
  1299. h3: b,
  1300. h4: b,
  1301. h5: b,
  1302. h6: b,
  1303. head: a({
  1304. title: 1,
  1305. base: 1
  1306. }, h),
  1307. header: c,
  1308. hgroup: {
  1309. h1: 1,
  1310. h2: 1,
  1311. h3: 1,
  1312. h4: 1,
  1313. h5: 1,
  1314. h6: 1
  1315. },
  1316. hr: k,
  1317. html: a({
  1318. head: 1,
  1319. body: 1
  1320. }, c, h),
  1321. i: b,
  1322. iframe: g,
  1323. img: k,
  1324. input: k,
  1325. ins: b,
  1326. kbd: b,
  1327. keygen: k,
  1328. label: b,
  1329. legend: b,
  1330. li: c,
  1331. link: k,
  1332. main: c,
  1333. map: c,
  1334. mark: b,
  1335. menu: a({
  1336. li: 1
  1337. }, c),
  1338. meta: k,
  1339. meter: d(b, {
  1340. meter: 1
  1341. }),
  1342. nav: c,
  1343. noscript: a({
  1344. link: 1,
  1345. meta: 1,
  1346. style: 1
  1347. }, b),
  1348. object: a({
  1349. param: 1
  1350. }, b),
  1351. ol: {
  1352. li: 1
  1353. },
  1354. optgroup: {
  1355. option: 1
  1356. },
  1357. option: g,
  1358. output: b,
  1359. p: b,
  1360. param: k,
  1361. pre: b,
  1362. progress: d(b, {
  1363. progress: 1
  1364. }),
  1365. q: b,
  1366. rp: b,
  1367. rt: b,
  1368. ruby: a({
  1369. rp: 1,
  1370. rt: 1
  1371. }, b),
  1372. s: b,
  1373. samp: b,
  1374. script: g,
  1375. section: c,
  1376. select: {
  1377. optgroup: 1,
  1378. option: 1
  1379. },
  1380. small: b,
  1381. source: k,
  1382. span: b,
  1383. strong: b,
  1384. style: g,
  1385. sub: b,
  1386. summary: a({
  1387. h1: 1,
  1388. h2: 1,
  1389. h3: 1,
  1390. h4: 1,
  1391. h5: 1,
  1392. h6: 1
  1393. }, b),
  1394. sup: b,
  1395. table: {
  1396. caption: 1,
  1397. colgroup: 1,
  1398. thead: 1,
  1399. tfoot: 1,
  1400. tbody: 1,
  1401. tr: 1
  1402. },
  1403. tbody: {
  1404. tr: 1
  1405. },
  1406. td: c,
  1407. textarea: g,
  1408. tfoot: {
  1409. tr: 1
  1410. },
  1411. th: c,
  1412. thead: {
  1413. tr: 1
  1414. },
  1415. time: d(b, {
  1416. time: 1
  1417. }),
  1418. title: g,
  1419. tr: {
  1420. th: 1,
  1421. td: 1
  1422. },
  1423. track: k,
  1424. u: b,
  1425. ul: {
  1426. li: 1
  1427. },
  1428. "var": b,
  1429. video: a({
  1430. source: 1,
  1431. track: 1
  1432. }, c),
  1433. wbr: k,
  1434. acronym: b,
  1435. applet: a({
  1436. param: 1
  1437. }, c),
  1438. basefont: k,
  1439. big: b,
  1440. center: c,
  1441. dialog: k,
  1442. dir: {
  1443. li: 1
  1444. },
  1445. font: b,
  1446. isindex: k,
  1447. noframes: c,
  1448. strike: b,
  1449. tt: b
  1450. };
  1451. a(d, {
  1452. $block: a({
  1453. audio: 1,
  1454. dd: 1,
  1455. dt: 1,
  1456. figcaption: 1,
  1457. li: 1,
  1458. video: 1
  1459. }, f, n),
  1460. $blockLimit: {
  1461. article: 1,
  1462. aside: 1,
  1463. audio: 1,
  1464. body: 1,
  1465. caption: 1,
  1466. details: 1,
  1467. dir: 1,
  1468. div: 1,
  1469. dl: 1,
  1470. fieldset: 1,
  1471. figcaption: 1,
  1472. figure: 1,
  1473. footer: 1,
  1474. form: 1,
  1475. header: 1,
  1476. hgroup: 1,
  1477. main: 1,
  1478. menu: 1,
  1479. nav: 1,
  1480. ol: 1,
  1481. section: 1,
  1482. table: 1,
  1483. td: 1,
  1484. th: 1,
  1485. tr: 1,
  1486. ul: 1,
  1487. video: 1
  1488. },
  1489. $cdata: {
  1490. script: 1,
  1491. style: 1
  1492. },
  1493. $editable: {
  1494. address: 1,
  1495. article: 1,
  1496. aside: 1,
  1497. blockquote: 1,
  1498. body: 1,
  1499. details: 1,
  1500. div: 1,
  1501. fieldset: 1,
  1502. figcaption: 1,
  1503. footer: 1,
  1504. form: 1,
  1505. h1: 1,
  1506. h2: 1,
  1507. h3: 1,
  1508. h4: 1,
  1509. h5: 1,
  1510. h6: 1,
  1511. header: 1,
  1512. hgroup: 1,
  1513. main: 1,
  1514. nav: 1,
  1515. p: 1,
  1516. pre: 1,
  1517. section: 1
  1518. },
  1519. $empty: {
  1520. area: 1,
  1521. base: 1,
  1522. basefont: 1,
  1523. br: 1,
  1524. col: 1,
  1525. command: 1,
  1526. dialog: 1,
  1527. embed: 1,
  1528. hr: 1,
  1529. img: 1,
  1530. input: 1,
  1531. isindex: 1,
  1532. keygen: 1,
  1533. link: 1,
  1534. meta: 1,
  1535. param: 1,
  1536. source: 1,
  1537. track: 1,
  1538. wbr: 1
  1539. },
  1540. $inline: b,
  1541. $list: {
  1542. dl: 1,
  1543. ol: 1,
  1544. ul: 1
  1545. },
  1546. $listItem: {
  1547. dd: 1,
  1548. dt: 1,
  1549. li: 1
  1550. },
  1551. $nonBodyContent: a({
  1552. body: 1,
  1553. head: 1,
  1554. html: 1
  1555. }, d.head),
  1556. $nonEditable: {
  1557. applet: 1,
  1558. audio: 1,
  1559. button: 1,
  1560. embed: 1,
  1561. iframe: 1,
  1562. map: 1,
  1563. object: 1,
  1564. option: 1,
  1565. param: 1,
  1566. script: 1,
  1567. textarea: 1,
  1568. video: 1
  1569. },
  1570. $object: {
  1571. applet: 1,
  1572. audio: 1,
  1573. button: 1,
  1574. hr: 1,
  1575. iframe: 1,
  1576. img: 1,
  1577. input: 1,
  1578. object: 1,
  1579. select: 1,
  1580. table: 1,
  1581. textarea: 1,
  1582. video: 1
  1583. },
  1584. $removeEmpty: {
  1585. abbr: 1,
  1586. acronym: 1,
  1587. b: 1,
  1588. bdi: 1,
  1589. bdo: 1,
  1590. big: 1,
  1591. cite: 1,
  1592. code: 1,
  1593. del: 1,
  1594. dfn: 1,
  1595. em: 1,
  1596. font: 1,
  1597. i: 1,
  1598. ins: 1,
  1599. label: 1,
  1600. kbd: 1,
  1601. mark: 1,
  1602. meter: 1,
  1603. output: 1,
  1604. q: 1,
  1605. ruby: 1,
  1606. s: 1,
  1607. samp: 1,
  1608. small: 1,
  1609. span: 1,
  1610. strike: 1,
  1611. strong: 1,
  1612. sub: 1,
  1613. sup: 1,
  1614. time: 1,
  1615. tt: 1,
  1616. u: 1,
  1617. "var": 1
  1618. },
  1619. $tabIndex: {
  1620. a: 1,
  1621. area: 1,
  1622. button: 1,
  1623. input: 1,
  1624. object: 1,
  1625. select: 1,
  1626. textarea: 1
  1627. },
  1628. $tableContent: {
  1629. caption: 1,
  1630. col: 1,
  1631. colgroup: 1,
  1632. tbody: 1,
  1633. td: 1,
  1634. tfoot: 1,
  1635. th: 1,
  1636. thead: 1,
  1637. tr: 1
  1638. },
  1639. $transparent: {
  1640. a: 1,
  1641. audio: 1,
  1642. canvas: 1,
  1643. del: 1,
  1644. ins: 1,
  1645. map: 1,
  1646. noscript: 1,
  1647. object: 1,
  1648. video: 1
  1649. },
  1650. $intermediate: {
  1651. caption: 1,
  1652. colgroup: 1,
  1653. dd: 1,
  1654. dt: 1,
  1655. figcaption: 1,
  1656. legend: 1,
  1657. li: 1,
  1658. optgroup: 1,
  1659. option: 1,
  1660. rp: 1,
  1661. rt: 1,
  1662. summary: 1,
  1663. tbody: 1,
  1664. td: 1,
  1665. tfoot: 1,
  1666. th: 1,
  1667. thead: 1,
  1668. tr: 1
  1669. }
  1670. });
  1671. return d
  1672. }();
  1673. CKEDITOR.dom.event = function(a) {
  1674. this.$ = a
  1675. };
  1676. CKEDITOR.dom.event.prototype = {
  1677. getKey: function() {
  1678. return this.$.keyCode || this.$.which
  1679. },
  1680. getKeystroke: function() {
  1681. var a = this.getKey();
  1682. if (this.$.ctrlKey || this.$.metaKey) a += CKEDITOR.CTRL;
  1683. this.$.shiftKey && (a += CKEDITOR.SHIFT);
  1684. this.$.altKey && (a += CKEDITOR.ALT);
  1685. return a
  1686. },
  1687. preventDefault: function(a) {
  1688. var d = this.$;
  1689. d.preventDefault ? d.preventDefault() : d.returnValue = !1;
  1690. a && this.stopPropagation()
  1691. },
  1692. stopPropagation: function() {
  1693. var a = this.$;
  1694. a.stopPropagation ? a.stopPropagation() : a.cancelBubble = !0
  1695. },
  1696. getTarget: function() {
  1697. var a =
  1698. this.$.target || this.$.srcElement;
  1699. return a ? new CKEDITOR.dom.node(a) : null
  1700. },
  1701. getPhase: function() {
  1702. return this.$.eventPhase || 2
  1703. },
  1704. getPageOffset: function() {
  1705. var a = this.getTarget().getDocument().$;
  1706. return {
  1707. x: this.$.pageX || this.$.clientX + (a.documentElement.scrollLeft || a.body.scrollLeft),
  1708. y: this.$.pageY || this.$.clientY + (a.documentElement.scrollTop || a.body.scrollTop)
  1709. }
  1710. }
  1711. };
  1712. CKEDITOR.CTRL = 1114112;
  1713. CKEDITOR.SHIFT = 2228224;
  1714. CKEDITOR.ALT = 4456448;
  1715. CKEDITOR.EVENT_PHASE_CAPTURING = 1;
  1716. CKEDITOR.EVENT_PHASE_AT_TARGET = 2;
  1717. CKEDITOR.EVENT_PHASE_BUBBLING = 3;
  1718. CKEDITOR.dom.domObject = function(a) {
  1719. a && (this.$ = a)
  1720. };
  1721. CKEDITOR.dom.domObject.prototype = function() {
  1722. var a = function(a, b) {
  1723. return function(c) {
  1724. "undefined" != typeof CKEDITOR && a.fire(b, new CKEDITOR.dom.event(c))
  1725. }
  1726. };
  1727. return {
  1728. getPrivate: function() {
  1729. var a;
  1730. (a = this.getCustomData("_")) || this.setCustomData("_", a = {});
  1731. return a
  1732. },
  1733. on: function(d) {
  1734. var b = this.getCustomData("_cke_nativeListeners");
  1735. b || (b = {}, this.setCustomData("_cke_nativeListeners", b));
  1736. b[d] || (b = b[d] = a(this, d), this.$.addEventListener ? this.$.addEventListener(d, b, !!CKEDITOR.event.useCapture) : this.$.attachEvent && this.$.attachEvent("on" +
  1737. d, b));
  1738. return CKEDITOR.event.prototype.on.apply(this, arguments)
  1739. },
  1740. removeListener: function(a) {
  1741. CKEDITOR.event.prototype.removeListener.apply(this, arguments);
  1742. if (!this.hasListeners(a)) {
  1743. var b = this.getCustomData("_cke_nativeListeners"),
  1744. c = b && b[a];
  1745. c && (this.$.removeEventListener ? this.$.removeEventListener(a, c, !1) : this.$.detachEvent && this.$.detachEvent("on" + a, c), delete b[a])
  1746. }
  1747. },
  1748. removeAllListeners: function() {
  1749. var a = this.getCustomData("_cke_nativeListeners"),
  1750. b;
  1751. for (b in a) {
  1752. var c = a[b];
  1753. this.$.detachEvent ? this.$.detachEvent("on" +
  1754. b, c) : this.$.removeEventListener && this.$.removeEventListener(b, c, !1);
  1755. delete a[b]
  1756. }
  1757. CKEDITOR.event.prototype.removeAllListeners.call(this)
  1758. }
  1759. }
  1760. }();
  1761. (function(a) {
  1762. var d = {};
  1763. CKEDITOR.on("reset", function() {
  1764. d = {}
  1765. });
  1766. a.equals = function(a) {
  1767. try {
  1768. return a && a.$ === this.$
  1769. } catch (c) {
  1770. return !1
  1771. }
  1772. };
  1773. a.setCustomData = function(a, c) {
  1774. var f = this.getUniqueId();
  1775. (d[f] || (d[f] = {}))[a] = c;
  1776. return this
  1777. };
  1778. a.getCustomData = function(a) {
  1779. var c = this.$["data-cke-expando"];
  1780. return (c = c && d[c]) && a in c ? c[a] : null
  1781. };
  1782. a.removeCustomData = function(a) {
  1783. var c = this.$["data-cke-expando"],
  1784. c = c && d[c],
  1785. f, h;
  1786. c && (f = c[a], h = a in c, delete c[a]);
  1787. return h ? f : null
  1788. };
  1789. a.clearCustomData = function() {
  1790. this.removeAllListeners();
  1791. var a =
  1792. this.$["data-cke-expando"];
  1793. a && delete d[a]
  1794. };
  1795. a.getUniqueId = function() {
  1796. return this.$["data-cke-expando"] || (this.$["data-cke-expando"] = CKEDITOR.tools.getNextNumber())
  1797. };
  1798. CKEDITOR.event.implementOn(a)
  1799. })(CKEDITOR.dom.domObject.prototype);
  1800. CKEDITOR.dom.node = function(a) {
  1801. 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
  1802. };
  1803. CKEDITOR.dom.node.prototype = new CKEDITOR.dom.domObject;
  1804. CKEDITOR.NODE_ELEMENT = 1;
  1805. CKEDITOR.NODE_DOCUMENT = 9;
  1806. CKEDITOR.NODE_TEXT = 3;
  1807. CKEDITOR.NODE_COMMENT = 8;
  1808. CKEDITOR.NODE_DOCUMENT_FRAGMENT = 11;
  1809. CKEDITOR.POSITION_IDENTICAL = 0;
  1810. CKEDITOR.POSITION_DISCONNECTED = 1;
  1811. CKEDITOR.POSITION_FOLLOWING = 2;
  1812. CKEDITOR.POSITION_PRECEDING = 4;
  1813. CKEDITOR.POSITION_IS_CONTAINED = 8;
  1814. CKEDITOR.POSITION_CONTAINS = 16;
  1815. CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype, {
  1816. appendTo: function(a, d) {
  1817. a.append(this, d);
  1818. return a
  1819. },
  1820. clone: function(a, d) {
  1821. function b(c) {
  1822. c["data-cke-expando"] && (c["data-cke-expando"] = !1);
  1823. if (c.nodeType == CKEDITOR.NODE_ELEMENT || c.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT)
  1824. if (d || c.nodeType != CKEDITOR.NODE_ELEMENT || c.removeAttribute("id", !1), a) {
  1825. c = c.childNodes;
  1826. for (var f = 0; f < c.length; f++) b(c[f])
  1827. }
  1828. }
  1829. function c(b) {
  1830. if (b.type == CKEDITOR.NODE_ELEMENT || b.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  1831. if (b.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  1832. var d =
  1833. b.getName();
  1834. ":" == d[0] && b.renameNode(d.substring(1))
  1835. }
  1836. if (a)
  1837. for (d = 0; d < b.getChildCount(); d++) c(b.getChild(d))
  1838. }
  1839. }
  1840. var f = this.$.cloneNode(a);
  1841. b(f);
  1842. f = new CKEDITOR.dom.node(f);
  1843. CKEDITOR.env.ie && 9 > CKEDITOR.env.version && (this.type == CKEDITOR.NODE_ELEMENT || this.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT) && c(f);
  1844. return f
  1845. },
  1846. hasPrevious: function() {
  1847. return !!this.$.previousSibling
  1848. },
  1849. hasNext: function() {
  1850. return !!this.$.nextSibling
  1851. },
  1852. insertAfter: function(a) {
  1853. a.$.parentNode.insertBefore(this.$, a.$.nextSibling);
  1854. return a
  1855. },
  1856. insertBefore: function(a) {
  1857. a.$.parentNode.insertBefore(this.$,
  1858. a.$);
  1859. return a
  1860. },
  1861. insertBeforeMe: function(a) {
  1862. this.$.parentNode.insertBefore(a.$, this.$);
  1863. return a
  1864. },
  1865. getAddress: function(a) {
  1866. for (var d = [], b = this.getDocument().$.documentElement, c = this.$; c && c != b;) {
  1867. var f = c.parentNode;
  1868. f && d.unshift(this.getIndex.call({
  1869. $: c
  1870. }, a));
  1871. c = f
  1872. }
  1873. return d
  1874. },
  1875. getDocument: function() {
  1876. return new CKEDITOR.dom.document(this.$.ownerDocument || this.$.parentNode.ownerDocument)
  1877. },
  1878. getIndex: function(a) {
  1879. function d(a, c) {
  1880. var n = c ? a.nextSibling : a.previousSibling;
  1881. return n && n.nodeType == CKEDITOR.NODE_TEXT ? b(n) ? d(n,
  1882. c) : n : null
  1883. }
  1884. function b(a) {
  1885. return !a.nodeValue || a.nodeValue == CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE
  1886. }
  1887. var c = this.$,
  1888. f = -1,
  1889. h;
  1890. if (!this.$.parentNode || a && c.nodeType == CKEDITOR.NODE_TEXT && b(c) && !d(c) && !d(c, !0)) return -1;
  1891. do a && c != this.$ && c.nodeType == CKEDITOR.NODE_TEXT && (h || b(c)) || (f++, h = c.nodeType == CKEDITOR.NODE_TEXT); while (c = c.previousSibling);
  1892. return f
  1893. },
  1894. getNextSourceNode: function(a, d, b) {
  1895. if (b && !b.call) {
  1896. var c = b;
  1897. b = function(a) {
  1898. return !a.equals(c)
  1899. }
  1900. }
  1901. a = !a && this.getFirst && this.getFirst();
  1902. var f;
  1903. if (!a) {
  1904. if (this.type ==
  1905. CKEDITOR.NODE_ELEMENT && b && !1 === b(this, !0)) return null;
  1906. a = this.getNext()
  1907. }
  1908. for (; !a && (f = (f || this).getParent());) {
  1909. if (b && !1 === b(f, !0)) return null;
  1910. a = f.getNext()
  1911. }
  1912. return !a || b && !1 === b(a) ? null : d && d != a.type ? a.getNextSourceNode(!1, d, b) : a
  1913. },
  1914. getPreviousSourceNode: function(a, d, b) {
  1915. if (b && !b.call) {
  1916. var c = b;
  1917. b = function(a) {
  1918. return !a.equals(c)
  1919. }
  1920. }
  1921. a = !a && this.getLast && this.getLast();
  1922. var f;
  1923. if (!a) {
  1924. if (this.type == CKEDITOR.NODE_ELEMENT && b && !1 === b(this, !0)) return null;
  1925. a = this.getPrevious()
  1926. }
  1927. for (; !a && (f = (f || this).getParent());) {
  1928. if (b && !1 ===
  1929. b(f, !0)) return null;
  1930. a = f.getPrevious()
  1931. }
  1932. return !a || b && !1 === b(a) ? null : d && a.type != d ? a.getPreviousSourceNode(!1, d, b) : a
  1933. },
  1934. getPrevious: function(a) {
  1935. var d = this.$,
  1936. b;
  1937. do b = (d = d.previousSibling) && 10 != d.nodeType && new CKEDITOR.dom.node(d); while (b && a && !a(b));
  1938. return b
  1939. },
  1940. getNext: function(a) {
  1941. var d = this.$,
  1942. b;
  1943. do b = (d = d.nextSibling) && new CKEDITOR.dom.node(d); while (b && a && !a(b));
  1944. return b
  1945. },
  1946. getParent: function(a) {
  1947. var d = this.$.parentNode;
  1948. return d && (d.nodeType == CKEDITOR.NODE_ELEMENT || a && d.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT) ?
  1949. new CKEDITOR.dom.node(d) : null
  1950. },
  1951. getParents: function(a) {
  1952. var d = this,
  1953. b = [];
  1954. do b[a ? "push" : "unshift"](d); while (d = d.getParent());
  1955. return b
  1956. },
  1957. getCommonAncestor: function(a) {
  1958. if (a.equals(this)) return this;
  1959. if (a.contains && a.contains(this)) return a;
  1960. var d = this.contains ? this : this.getParent();
  1961. do
  1962. if (d.contains(a)) return d; while (d = d.getParent());
  1963. return null
  1964. },
  1965. getPosition: function(a) {
  1966. var d = this.$,
  1967. b = a.$;
  1968. if (d.compareDocumentPosition) return d.compareDocumentPosition(b);
  1969. if (d == b) return CKEDITOR.POSITION_IDENTICAL;
  1970. if (this.type ==
  1971. CKEDITOR.NODE_ELEMENT && a.type == CKEDITOR.NODE_ELEMENT) {
  1972. if (d.contains) {
  1973. if (d.contains(b)) return CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING;
  1974. if (b.contains(d)) return CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING
  1975. }
  1976. if ("sourceIndex" in d) return 0 > d.sourceIndex || 0 > b.sourceIndex ? CKEDITOR.POSITION_DISCONNECTED : d.sourceIndex < b.sourceIndex ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING
  1977. }
  1978. d = this.getAddress();
  1979. a = a.getAddress();
  1980. for (var b = Math.min(d.length, a.length), c = 0; c < b; c++)
  1981. if (d[c] !=
  1982. a[c]) return d[c] < a[c] ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING;
  1983. return d.length < a.length ? CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING
  1984. },
  1985. getAscendant: function(a, d) {
  1986. var b = this.$,
  1987. c, f;
  1988. d || (b = b.parentNode);
  1989. "function" == typeof a ? (f = !0, c = a) : (f = !1, c = function(b) {
  1990. b = "string" == typeof b.nodeName ? b.nodeName.toLowerCase() : "";
  1991. return "string" == typeof a ? b == a : b in a
  1992. });
  1993. for (; b;) {
  1994. if (c(f ? new CKEDITOR.dom.node(b) : b)) return new CKEDITOR.dom.node(b);
  1995. try {
  1996. b = b.parentNode
  1997. } catch (h) {
  1998. b = null
  1999. }
  2000. }
  2001. return null
  2002. },
  2003. hasAscendant: function(a, d) {
  2004. var b = this.$;
  2005. d || (b = b.parentNode);
  2006. for (; b;) {
  2007. if (b.nodeName && b.nodeName.toLowerCase() == a) return !0;
  2008. b = b.parentNode
  2009. }
  2010. return !1
  2011. },
  2012. move: function(a, d) {
  2013. a.append(this.remove(), d)
  2014. },
  2015. remove: function(a) {
  2016. var d = this.$,
  2017. b = d.parentNode;
  2018. if (b) {
  2019. if (a)
  2020. for (; a = d.firstChild;) b.insertBefore(d.removeChild(a), d);
  2021. b.removeChild(d)
  2022. }
  2023. return this
  2024. },
  2025. replace: function(a) {
  2026. this.insertBefore(a);
  2027. a.remove()
  2028. },
  2029. trim: function() {
  2030. this.ltrim();
  2031. this.rtrim()
  2032. },
  2033. ltrim: function() {
  2034. for (var a; this.getFirst &&
  2035. (a = this.getFirst());) {
  2036. if (a.type == CKEDITOR.NODE_TEXT) {
  2037. var d = CKEDITOR.tools.ltrim(a.getText()),
  2038. b = a.getLength();
  2039. if (d) d.length < b && (a.split(b - d.length), this.$.removeChild(this.$.firstChild));
  2040. else {
  2041. a.remove();
  2042. continue
  2043. }
  2044. }
  2045. break
  2046. }
  2047. },
  2048. rtrim: function() {
  2049. for (var a; this.getLast && (a = this.getLast());) {
  2050. if (a.type == CKEDITOR.NODE_TEXT) {
  2051. var d = CKEDITOR.tools.rtrim(a.getText()),
  2052. b = a.getLength();
  2053. if (d) d.length < b && (a.split(d.length), this.$.lastChild.parentNode.removeChild(this.$.lastChild));
  2054. else {
  2055. a.remove();
  2056. continue
  2057. }
  2058. }
  2059. break
  2060. }
  2061. CKEDITOR.env.needsBrFiller &&
  2062. (a = this.$.lastChild) && 1 == a.type && "br" == a.nodeName.toLowerCase() && a.parentNode.removeChild(a)
  2063. },
  2064. isReadOnly: function(a) {
  2065. var d = this;
  2066. this.type != CKEDITOR.NODE_ELEMENT && (d = this.getParent());
  2067. CKEDITOR.env.edge && d && d.is("textarea", "input") && (a = !0);
  2068. if (!a && d && "undefined" != typeof d.$.isContentEditable) return !(d.$.isContentEditable || d.data("cke-editable"));
  2069. for (; d;) {
  2070. if (d.data("cke-editable")) return !1;
  2071. if (d.hasAttribute("contenteditable")) return "false" == d.getAttribute("contenteditable");
  2072. d = d.getParent()
  2073. }
  2074. return !0
  2075. }
  2076. });
  2077. CKEDITOR.dom.window = function(a) {
  2078. CKEDITOR.dom.domObject.call(this, a)
  2079. };
  2080. CKEDITOR.dom.window.prototype = new CKEDITOR.dom.domObject;
  2081. CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype, {
  2082. focus: function() {
  2083. this.$.focus()
  2084. },
  2085. getViewPaneSize: function() {
  2086. var a = this.$.document,
  2087. d = "CSS1Compat" == a.compatMode;
  2088. return {
  2089. width: (d ? a.documentElement.clientWidth : a.body.clientWidth) || 0,
  2090. height: (d ? a.documentElement.clientHeight : a.body.clientHeight) || 0
  2091. }
  2092. },
  2093. getScrollPosition: function() {
  2094. var a = this.$;
  2095. if ("pageXOffset" in a) return {
  2096. x: a.pageXOffset || 0,
  2097. y: a.pageYOffset || 0
  2098. };
  2099. a = a.document;
  2100. return {
  2101. x: a.documentElement.scrollLeft || a.body.scrollLeft || 0,
  2102. y: a.documentElement.scrollTop ||
  2103. a.body.scrollTop || 0
  2104. }
  2105. },
  2106. getFrame: function() {
  2107. var a = this.$.frameElement;
  2108. return a ? new CKEDITOR.dom.element.get(a) : null
  2109. }
  2110. });
  2111. CKEDITOR.dom.document = function(a) {
  2112. CKEDITOR.dom.domObject.call(this, a)
  2113. };
  2114. CKEDITOR.dom.document.prototype = new CKEDITOR.dom.domObject;
  2115. CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype, {
  2116. type: CKEDITOR.NODE_DOCUMENT,
  2117. appendStyleSheet: function(a) {
  2118. if (this.$.createStyleSheet) this.$.createStyleSheet(a);
  2119. else {
  2120. var d = new CKEDITOR.dom.element("link");
  2121. d.setAttributes({
  2122. rel: "stylesheet",
  2123. type: "text/css",
  2124. href: a
  2125. });
  2126. this.getHead().append(d)
  2127. }
  2128. },
  2129. appendStyleText: function(a) {
  2130. if (this.$.createStyleSheet) {
  2131. var d = this.$.createStyleSheet("");
  2132. d.cssText = a
  2133. } else {
  2134. var b = new CKEDITOR.dom.element("style", this);
  2135. b.append(new CKEDITOR.dom.text(a, this));
  2136. this.getHead().append(b)
  2137. }
  2138. return d ||
  2139. b.$.sheet
  2140. },
  2141. createElement: function(a, d) {
  2142. var b = new CKEDITOR.dom.element(a, this);
  2143. d && (d.attributes && b.setAttributes(d.attributes), d.styles && b.setStyles(d.styles));
  2144. return b
  2145. },
  2146. createText: function(a) {
  2147. return new CKEDITOR.dom.text(a, this)
  2148. },
  2149. focus: function() {
  2150. this.getWindow().focus()
  2151. },
  2152. getActive: function() {
  2153. var a;
  2154. try {
  2155. a = this.$.activeElement
  2156. } catch (d) {
  2157. return null
  2158. }
  2159. return new CKEDITOR.dom.element(a)
  2160. },
  2161. getById: function(a) {
  2162. return (a = this.$.getElementById(a)) ? new CKEDITOR.dom.element(a) : null
  2163. },
  2164. getByAddress: function(a, d) {
  2165. for (var b =
  2166. this.$.documentElement, c = 0; b && c < a.length; c++) {
  2167. var f = a[c];
  2168. if (d)
  2169. for (var h = -1, k = 0; k < b.childNodes.length; k++) {
  2170. var g = b.childNodes[k];
  2171. if (!0 !== d || 3 != g.nodeType || !g.previousSibling || 3 != g.previousSibling.nodeType)
  2172. if (h++, h == f) {
  2173. b = g;
  2174. break
  2175. }
  2176. } else b = b.childNodes[f]
  2177. }
  2178. return b ? new CKEDITOR.dom.node(b) : null
  2179. },
  2180. getElementsByTag: function(a, d) {
  2181. CKEDITOR.env.ie && 8 >= document.documentMode || !d || (a = d + ":" + a);
  2182. return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a))
  2183. },
  2184. getHead: function() {
  2185. var a = this.$.getElementsByTagName("head")[0];
  2186. return a = a ? new CKEDITOR.dom.element(a) : this.getDocumentElement().append(new CKEDITOR.dom.element("head"), !0)
  2187. },
  2188. getBody: function() {
  2189. return new CKEDITOR.dom.element(this.$.body)
  2190. },
  2191. getDocumentElement: function() {
  2192. return new CKEDITOR.dom.element(this.$.documentElement)
  2193. },
  2194. getWindow: function() {
  2195. return new CKEDITOR.dom.window(this.$.parentWindow || this.$.defaultView)
  2196. },
  2197. write: function(a) {
  2198. this.$.open("text/html", "replace");
  2199. CKEDITOR.env.ie && (a = a.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i, '$\x26\n\x3cscript data-cke-temp\x3d"1"\x3e(' +
  2200. CKEDITOR.tools.fixDomain + ")();\x3c/script\x3e"));
  2201. this.$.write(a);
  2202. this.$.close()
  2203. },
  2204. find: function(a) {
  2205. return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(a))
  2206. },
  2207. findOne: function(a) {
  2208. return (a = this.$.querySelector(a)) ? new CKEDITOR.dom.element(a) : null
  2209. },
  2210. _getHtml5ShivFrag: function() {
  2211. var a = this.getCustomData("html5ShivFrag");
  2212. a || (a = this.$.createDocumentFragment(), CKEDITOR.tools.enableHtml5Elements(a, !0), this.setCustomData("html5ShivFrag", a));
  2213. return a
  2214. }
  2215. });
  2216. CKEDITOR.dom.nodeList = function(a) {
  2217. this.$ = a
  2218. };
  2219. CKEDITOR.dom.nodeList.prototype = {
  2220. count: function() {
  2221. return this.$.length
  2222. },
  2223. getItem: function(a) {
  2224. return 0 > a || a >= this.$.length ? null : (a = this.$[a]) ? new CKEDITOR.dom.node(a) : null
  2225. },
  2226. toArray: function() {
  2227. return CKEDITOR.tools.array.map(this.$, function(a) {
  2228. return new CKEDITOR.dom.node(a)
  2229. })
  2230. }
  2231. };
  2232. CKEDITOR.dom.element = function(a, d) {
  2233. "string" == typeof a && (a = (d ? d.$ : document).createElement(a));
  2234. CKEDITOR.dom.domObject.call(this, a)
  2235. };
  2236. CKEDITOR.dom.element.get = function(a) {
  2237. return (a = "string" == typeof a ? document.getElementById(a) || document.getElementsByName(a)[0] : a) && (a.$ ? a : new CKEDITOR.dom.element(a))
  2238. };
  2239. CKEDITOR.dom.element.prototype = new CKEDITOR.dom.node;
  2240. CKEDITOR.dom.element.createFromHtml = function(a, d) {
  2241. var b = new CKEDITOR.dom.element("div", d);
  2242. b.setHtml(a);
  2243. return b.getFirst().remove()
  2244. };
  2245. CKEDITOR.dom.element.setMarker = function(a, d, b, c) {
  2246. var f = d.getCustomData("list_marker_id") || d.setCustomData("list_marker_id", CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),
  2247. h = d.getCustomData("list_marker_names") || d.setCustomData("list_marker_names", {}).getCustomData("list_marker_names");
  2248. a[f] = d;
  2249. h[b] = 1;
  2250. return d.setCustomData(b, c)
  2251. };
  2252. CKEDITOR.dom.element.clearAllMarkers = function(a) {
  2253. for (var d in a) CKEDITOR.dom.element.clearMarkers(a, a[d], 1)
  2254. };
  2255. CKEDITOR.dom.element.clearMarkers = function(a, d, b) {
  2256. var c = d.getCustomData("list_marker_names"),
  2257. f = d.getCustomData("list_marker_id"),
  2258. h;
  2259. for (h in c) d.removeCustomData(h);
  2260. d.removeCustomData("list_marker_names");
  2261. b && (d.removeCustomData("list_marker_id"), delete a[f])
  2262. };
  2263. (function() {
  2264. function a(a, b) {
  2265. return -1 < (" " + a + " ").replace(h, " ").indexOf(" " + b + " ")
  2266. }
  2267. function d(a) {
  2268. var b = !0;
  2269. a.$.id || (a.$.id = "cke_tmp_" + CKEDITOR.tools.getNextNumber(), b = !1);
  2270. return function() {
  2271. b || a.removeAttribute("id")
  2272. }
  2273. }
  2274. function b(a, b) {
  2275. var c = CKEDITOR.tools.escapeCss(a.$.id);
  2276. return "#" + c + " " + b.split(/,\s*/).join(", #" + c + " ")
  2277. }
  2278. function c(a) {
  2279. for (var b = 0, c = 0, e = k[a].length; c < e; c++) b += parseFloat(this.getComputedStyle(k[a][c]) || 0, 10) || 0;
  2280. return b
  2281. }
  2282. var f = document.createElement("_").classList,
  2283. f = "undefined" !== typeof f &&
  2284. null !== String(f.add).match(/\[Native code\]/gi),
  2285. h = /[\n\t\r]/g;
  2286. CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype, {
  2287. type: CKEDITOR.NODE_ELEMENT,
  2288. addClass: f ? function(a) {
  2289. this.$.classList.add(a);
  2290. return this
  2291. } : function(b) {
  2292. var c = this.$.className;
  2293. c && (a(c, b) || (c += " " + b));
  2294. this.$.className = c || b;
  2295. return this
  2296. },
  2297. removeClass: f ? function(a) {
  2298. var b = this.$;
  2299. b.classList.remove(a);
  2300. b.className || b.removeAttribute("class");
  2301. return this
  2302. } : function(b) {
  2303. var c = this.getAttribute("class");
  2304. c && a(c, b) && ((c = c.replace(new RegExp("(?:^|\\s+)" +
  2305. b + "(?\x3d\\s|$)"), "").replace(/^\s+/, "")) ? this.setAttribute("class", c) : this.removeAttribute("class"));
  2306. return this
  2307. },
  2308. hasClass: function(b) {
  2309. return a(this.$.className, b)
  2310. },
  2311. append: function(a, b) {
  2312. "string" == typeof a && (a = this.getDocument().createElement(a));
  2313. b ? this.$.insertBefore(a.$, this.$.firstChild) : this.$.appendChild(a.$);
  2314. return a
  2315. },
  2316. appendHtml: function(a) {
  2317. if (this.$.childNodes.length) {
  2318. var b = new CKEDITOR.dom.element("div", this.getDocument());
  2319. b.setHtml(a);
  2320. b.moveChildren(this)
  2321. } else this.setHtml(a)
  2322. },
  2323. appendText: function(a) {
  2324. null !=
  2325. this.$.text && CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? this.$.text += a : this.append(new CKEDITOR.dom.text(a))
  2326. },
  2327. appendBogus: function(a) {
  2328. if (a || CKEDITOR.env.needsBrFiller) {
  2329. for (a = this.getLast(); a && a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.rtrim(a.getText());) a = a.getPrevious();
  2330. a && a.is && a.is("br") || (a = this.getDocument().createElement("br"), CKEDITOR.env.gecko && a.setAttribute("type", "_moz"), this.append(a))
  2331. }
  2332. },
  2333. breakParent: function(a, b) {
  2334. var c = new CKEDITOR.dom.range(this.getDocument());
  2335. c.setStartAfter(this);
  2336. c.setEndAfter(a);
  2337. var e = c.extractContents(!1, b || !1),
  2338. d;
  2339. c.insertNode(this.remove());
  2340. if (CKEDITOR.env.ie && !CKEDITOR.env.edge) {
  2341. for (c = new CKEDITOR.dom.element("div"); d = e.getFirst();) d.$.style.backgroundColor && (d.$.style.backgroundColor = d.$.style.backgroundColor), c.append(d);
  2342. c.insertAfter(this);
  2343. c.remove(!0)
  2344. } else e.insertAfterNode(this)
  2345. },
  2346. contains: document.compareDocumentPosition ? function(a) {
  2347. return !!(this.$.compareDocumentPosition(a.$) & 16)
  2348. } : function(a) {
  2349. var b = this.$;
  2350. return a.type != CKEDITOR.NODE_ELEMENT ? b.contains(a.getParent().$) :
  2351. b != a.$ && b.contains(a.$)
  2352. },
  2353. focus: function() {
  2354. function a() {
  2355. try {
  2356. this.$.focus()
  2357. } catch (b) {}
  2358. }
  2359. return function(b) {
  2360. b ? CKEDITOR.tools.setTimeout(a, 100, this) : a.call(this)
  2361. }
  2362. }(),
  2363. getHtml: function() {
  2364. var a = this.$.innerHTML;
  2365. return CKEDITOR.env.ie ? a.replace(/<\?[^>]*>/g, "") : a
  2366. },
  2367. getOuterHtml: function() {
  2368. if (this.$.outerHTML) return this.$.outerHTML.replace(/<\?[^>]*>/, "");
  2369. var a = this.$.ownerDocument.createElement("div");
  2370. a.appendChild(this.$.cloneNode(!0));
  2371. return a.innerHTML
  2372. },
  2373. getClientRect: function(a) {
  2374. var b = CKEDITOR.tools.extend({},
  2375. this.$.getBoundingClientRect());
  2376. !b.width && (b.width = b.right - b.left);
  2377. !b.height && (b.height = b.bottom - b.top);
  2378. return a ? CKEDITOR.tools.getAbsoluteRectPosition(this.getWindow(), b) : b
  2379. },
  2380. setHtml: CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? function(a) {
  2381. try {
  2382. var b = this.$;
  2383. if (this.getParent()) return b.innerHTML = a;
  2384. var c = this.getDocument()._getHtml5ShivFrag();
  2385. c.appendChild(b);
  2386. b.innerHTML = a;
  2387. c.removeChild(b);
  2388. return a
  2389. } catch (e) {
  2390. this.$.innerHTML = "";
  2391. b = new CKEDITOR.dom.element("body", this.getDocument());
  2392. b.$.innerHTML = a;
  2393. for (b = b.getChildren(); b.count();) this.append(b.getItem(0));
  2394. return a
  2395. }
  2396. } : function(a) {
  2397. return this.$.innerHTML = a
  2398. },
  2399. setText: function() {
  2400. var a = document.createElement("p");
  2401. a.innerHTML = "x";
  2402. a = a.textContent;
  2403. return function(b) {
  2404. this.$[a ? "textContent" : "innerText"] = b
  2405. }
  2406. }(),
  2407. getAttribute: function() {
  2408. var a = function(a) {
  2409. return this.$.getAttribute(a, 2)
  2410. };
  2411. return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(a) {
  2412. switch (a) {
  2413. case "class":
  2414. a = "className";
  2415. break;
  2416. case "http-equiv":
  2417. a = "httpEquiv";
  2418. break;
  2419. case "name":
  2420. return this.$.name;
  2421. case "tabindex":
  2422. return a = this.$.getAttribute(a,
  2423. 2), 0 !== a && 0 === this.$.tabIndex && (a = null), a;
  2424. case "checked":
  2425. return a = this.$.attributes.getNamedItem(a), (a.specified ? a.nodeValue : this.$.checked) ? "checked" : null;
  2426. case "hspace":
  2427. case "value":
  2428. return this.$[a];
  2429. case "style":
  2430. return this.$.style.cssText;
  2431. case "contenteditable":
  2432. case "contentEditable":
  2433. return this.$.attributes.getNamedItem("contentEditable").specified ? this.$.getAttribute("contentEditable") : null
  2434. }
  2435. return this.$.getAttribute(a, 2)
  2436. } : a
  2437. }(),
  2438. getAttributes: function(a) {
  2439. var b = {},
  2440. c = this.$.attributes,
  2441. e;
  2442. a = CKEDITOR.tools.isArray(a) ?
  2443. a : [];
  2444. for (e = 0; e < c.length; e++) - 1 === CKEDITOR.tools.indexOf(a, c[e].name) && (b[c[e].name] = c[e].value);
  2445. return b
  2446. },
  2447. getChildren: function() {
  2448. return new CKEDITOR.dom.nodeList(this.$.childNodes)
  2449. },
  2450. getComputedStyle: document.defaultView && document.defaultView.getComputedStyle ? function(a) {
  2451. var b = this.getWindow().$.getComputedStyle(this.$, null);
  2452. return b ? b.getPropertyValue(a) : ""
  2453. } : function(a) {
  2454. return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(a)]
  2455. },
  2456. getDtd: function() {
  2457. var a = CKEDITOR.dtd[this.getName()];
  2458. this.getDtd =
  2459. function() {
  2460. return a
  2461. };
  2462. return a
  2463. },
  2464. getElementsByTag: CKEDITOR.dom.document.prototype.getElementsByTag,
  2465. getTabIndex: function() {
  2466. var a = this.$.tabIndex;
  2467. return 0 !== a || CKEDITOR.dtd.$tabIndex[this.getName()] || 0 === parseInt(this.getAttribute("tabindex"), 10) ? a : -1
  2468. },
  2469. getText: function() {
  2470. return this.$.textContent || this.$.innerText || ""
  2471. },
  2472. getWindow: function() {
  2473. return this.getDocument().getWindow()
  2474. },
  2475. getId: function() {
  2476. return this.$.id || null
  2477. },
  2478. getNameAtt: function() {
  2479. return this.$.name || null
  2480. },
  2481. getName: function() {
  2482. var a = this.$.nodeName.toLowerCase();
  2483. if (CKEDITOR.env.ie && 8 >= document.documentMode) {
  2484. var b = this.$.scopeName;
  2485. "HTML" != b && (a = b.toLowerCase() + ":" + a)
  2486. }
  2487. this.getName = function() {
  2488. return a
  2489. };
  2490. return this.getName()
  2491. },
  2492. getValue: function() {
  2493. return this.$.value
  2494. },
  2495. getFirst: function(a) {
  2496. var b = this.$.firstChild;
  2497. (b = b && new CKEDITOR.dom.node(b)) && a && !a(b) && (b = b.getNext(a));
  2498. return b
  2499. },
  2500. getLast: function(a) {
  2501. var b = this.$.lastChild;
  2502. (b = b && new CKEDITOR.dom.node(b)) && a && !a(b) && (b = b.getPrevious(a));
  2503. return b
  2504. },
  2505. getStyle: function(a) {
  2506. return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]
  2507. },
  2508. is: function() {
  2509. var a = this.getName();
  2510. if ("object" == typeof arguments[0]) return !!arguments[0][a];
  2511. for (var b = 0; b < arguments.length; b++)
  2512. if (arguments[b] == a) return !0;
  2513. return !1
  2514. },
  2515. isEditable: function(a) {
  2516. var b = this.getName();
  2517. return this.isReadOnly() || "none" == this.getComputedStyle("display") || "hidden" == this.getComputedStyle("visibility") || 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] ||
  2518. CKEDITOR.dtd.span, !(!a || !a["#"])) : !0
  2519. },
  2520. isIdentical: function(a) {
  2521. var b = this.clone(0, 1);
  2522. a = a.clone(0, 1);
  2523. b.removeAttributes(["_moz_dirty", "data-cke-expando", "data-cke-saved-href", "data-cke-saved-name"]);
  2524. a.removeAttributes(["_moz_dirty", "data-cke-expando", "data-cke-saved-href", "data-cke-saved-name"]);
  2525. 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.$);
  2526. b = b.getOuterHtml();
  2527. a =
  2528. a.getOuterHtml();
  2529. if (CKEDITOR.env.ie && 9 > CKEDITOR.env.version && this.is("a")) {
  2530. var c = this.getParent();
  2531. c.type == CKEDITOR.NODE_ELEMENT && (c = c.clone(), c.setHtml(b), b = c.getHtml(), c.setHtml(a), a = c.getHtml())
  2532. }
  2533. return b == a
  2534. },
  2535. isVisible: function() {
  2536. var a = (this.$.offsetHeight || this.$.offsetWidth) && "hidden" != this.getComputedStyle("visibility"),
  2537. b, c;
  2538. a && CKEDITOR.env.webkit && (b = this.getWindow(), !b.equals(CKEDITOR.document.getWindow()) && (c = b.$.frameElement) && (a = (new CKEDITOR.dom.element(c)).isVisible()));
  2539. return !!a
  2540. },
  2541. isEmptyInlineRemoveable: function() {
  2542. if (!CKEDITOR.dtd.$removeEmpty[this.getName()]) return !1;
  2543. for (var a = this.getChildren(), b = 0, c = a.count(); b < c; b++) {
  2544. var e = a.getItem(b);
  2545. if (e.type != CKEDITOR.NODE_ELEMENT || !e.data("cke-bookmark"))
  2546. if (e.type == CKEDITOR.NODE_ELEMENT && !e.isEmptyInlineRemoveable() || e.type == CKEDITOR.NODE_TEXT && CKEDITOR.tools.trim(e.getText())) return !1
  2547. }
  2548. return !0
  2549. },
  2550. hasAttributes: CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function() {
  2551. for (var a = this.$.attributes, b = 0; b < a.length; b++) {
  2552. var c = a[b];
  2553. switch (c.nodeName) {
  2554. case "class":
  2555. if (this.getAttribute("class")) return !0;
  2556. case "data-cke-expando":
  2557. continue;
  2558. default:
  2559. if (c.specified) return !0
  2560. }
  2561. }
  2562. return !1
  2563. } : function() {
  2564. var a = this.$.attributes,
  2565. b = a.length,
  2566. c = {
  2567. "data-cke-expando": 1,
  2568. _moz_dirty: 1
  2569. };
  2570. return 0 < b && (2 < b || !c[a[0].nodeName] || 2 == b && !c[a[1].nodeName])
  2571. },
  2572. hasAttribute: function() {
  2573. function a(b) {
  2574. var c = this.$.attributes.getNamedItem(b);
  2575. if ("input" == this.getName()) switch (b) {
  2576. case "class":
  2577. return 0 < this.$.className.length;
  2578. case "checked":
  2579. return !!this.$.checked;
  2580. case "value":
  2581. return b = this.getAttribute("type"), "checkbox" == b || "radio" == b ? "on" != this.$.value : !!this.$.value
  2582. }
  2583. return c ?
  2584. c.specified : !1
  2585. }
  2586. return CKEDITOR.env.ie ? 8 > CKEDITOR.env.version ? function(b) {
  2587. return "name" == b ? !!this.$.name : a.call(this, b)
  2588. } : a : function(a) {
  2589. return !!this.$.attributes.getNamedItem(a)
  2590. }
  2591. }(),
  2592. hide: function() {
  2593. this.setStyle("display", "none")
  2594. },
  2595. moveChildren: function(a, b) {
  2596. var c = this.$;
  2597. a = a.$;
  2598. if (c != a) {
  2599. var e;
  2600. if (b)
  2601. for (; e = c.lastChild;) a.insertBefore(c.removeChild(e), a.firstChild);
  2602. else
  2603. for (; e = c.firstChild;) a.appendChild(c.removeChild(e))
  2604. }
  2605. },
  2606. mergeSiblings: function() {
  2607. function a(b, c, e) {
  2608. if (c && c.type == CKEDITOR.NODE_ELEMENT) {
  2609. for (var d = []; c.data("cke-bookmark") || c.isEmptyInlineRemoveable();)
  2610. if (d.push(c), c = e ? c.getNext() : c.getPrevious(), !c || c.type != CKEDITOR.NODE_ELEMENT) return;
  2611. if (b.isIdentical(c)) {
  2612. for (var g = e ? b.getLast() : b.getFirst(); d.length;) d.shift().move(b, !e);
  2613. c.moveChildren(b, !e);
  2614. c.remove();
  2615. g && g.type == CKEDITOR.NODE_ELEMENT && g.mergeSiblings()
  2616. }
  2617. }
  2618. }
  2619. return function(b) {
  2620. if (!1 === b || CKEDITOR.dtd.$removeEmpty[this.getName()] || this.is("a")) a(this, this.getNext(), !0), a(this, this.getPrevious())
  2621. }
  2622. }(),
  2623. show: function() {
  2624. this.setStyles({
  2625. display: "",
  2626. visibility: ""
  2627. })
  2628. },
  2629. setAttribute: function() {
  2630. var a = function(a, b) {
  2631. this.$.setAttribute(a, b);
  2632. return this
  2633. };
  2634. return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(b, c) {
  2635. "class" == b ? this.$.className = c : "style" == b ? this.$.style.cssText = c : "tabindex" == b ? this.$.tabIndex = c : "checked" == b ? this.$.checked = c : "contenteditable" == b ? a.call(this, "contentEditable", c) : a.apply(this, arguments);
  2636. return this
  2637. } : CKEDITOR.env.ie8Compat && CKEDITOR.env.secure ? function(b, c) {
  2638. if ("src" == b && c.match(/^http:\/\//)) try {
  2639. a.apply(this,
  2640. arguments)
  2641. } catch (e) {} else a.apply(this, arguments);
  2642. return this
  2643. } : a
  2644. }(),
  2645. setAttributes: function(a) {
  2646. for (var b in a) this.setAttribute(b, a[b]);
  2647. return this
  2648. },
  2649. setValue: function(a) {
  2650. this.$.value = a;
  2651. return this
  2652. },
  2653. removeAttribute: function() {
  2654. var a = function(a) {
  2655. this.$.removeAttribute(a)
  2656. };
  2657. return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(a) {
  2658. "class" == a ? a = "className" : "tabindex" == a ? a = "tabIndex" : "contenteditable" == a && (a = "contentEditable");
  2659. this.$.removeAttribute(a)
  2660. } : a
  2661. }(),
  2662. removeAttributes: function(a) {
  2663. if (CKEDITOR.tools.isArray(a))
  2664. for (var b =
  2665. 0; b < a.length; b++) this.removeAttribute(a[b]);
  2666. else
  2667. for (b in a = a || this.getAttributes(), a) a.hasOwnProperty(b) && this.removeAttribute(b)
  2668. },
  2669. removeStyle: function(a) {
  2670. var b = this.$.style;
  2671. if (b.removeProperty || "border" != a && "margin" != a && "padding" != a) b.removeProperty ? b.removeProperty(a) : b.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(a)), this.$.style.cssText || this.removeAttribute("style");
  2672. else {
  2673. var c = ["top", "left", "right", "bottom"],
  2674. e;
  2675. "border" == a && (e = ["color", "style", "width"]);
  2676. for (var b = [], d = 0; d < c.length; d++)
  2677. if (e)
  2678. for (var v =
  2679. 0; v < e.length; v++) b.push([a, c[d], e[v]].join("-"));
  2680. else b.push([a, c[d]].join("-"));
  2681. for (a = 0; a < b.length; a++) this.removeStyle(b[a])
  2682. }
  2683. },
  2684. setStyle: function(a, b) {
  2685. this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)] = b;
  2686. return this
  2687. },
  2688. setStyles: function(a) {
  2689. for (var b in a) this.setStyle(b, a[b]);
  2690. return this
  2691. },
  2692. setOpacity: function(a) {
  2693. CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? (a = Math.round(100 * a), this.setStyle("filter", 100 <= a ? "" : "progid:DXImageTransform.Microsoft.Alpha(opacity\x3d" + a + ")")) : this.setStyle("opacity", a)
  2694. },
  2695. unselectable: function() {
  2696. this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select",
  2697. "none"));
  2698. if (CKEDITOR.env.ie) {
  2699. this.setAttribute("unselectable", "on");
  2700. for (var a, b = this.getElementsByTag("*"), c = 0, e = b.count(); c < e; c++) a = b.getItem(c), a.setAttribute("unselectable", "on")
  2701. }
  2702. },
  2703. getPositionedAncestor: function() {
  2704. for (var a = this;
  2705. "html" != a.getName();) {
  2706. if ("static" != a.getComputedStyle("position")) return a;
  2707. a = a.getParent()
  2708. }
  2709. return null
  2710. },
  2711. getDocumentPosition: function(a) {
  2712. var b = 0,
  2713. c = 0,
  2714. e = this.getDocument(),
  2715. d = e.getBody(),
  2716. v = "BackCompat" == e.$.compatMode;
  2717. if (document.documentElement.getBoundingClientRect && (CKEDITOR.env.ie ?
  2718. 8 !== CKEDITOR.env.version : 1)) {
  2719. var f = this.$.getBoundingClientRect(),
  2720. h = e.$.documentElement,
  2721. x = h.clientTop || d.$.clientTop || 0,
  2722. m = h.clientLeft || d.$.clientLeft || 0,
  2723. k = !0;
  2724. CKEDITOR.env.ie && (k = e.getDocumentElement().contains(this), e = e.getBody().contains(this), k = v && e || !v && k);
  2725. k && (CKEDITOR.env.webkit || CKEDITOR.env.ie && 12 <= CKEDITOR.env.version ? (b = d.$.scrollLeft || h.scrollLeft, c = d.$.scrollTop || h.scrollTop) : (c = v ? d.$ : h, b = c.scrollLeft, c = c.scrollTop), b = f.left + b - m, c = f.top + c - x)
  2726. } else
  2727. for (x = this, m = null; x && "body" != x.getName() &&
  2728. "html" != x.getName();) {
  2729. b += x.$.offsetLeft - x.$.scrollLeft;
  2730. c += x.$.offsetTop - x.$.scrollTop;
  2731. x.equals(this) || (b += x.$.clientLeft || 0, c += x.$.clientTop || 0);
  2732. for (; m && !m.equals(x);) b -= m.$.scrollLeft, c -= m.$.scrollTop, m = m.getParent();
  2733. m = x;
  2734. x = (f = x.$.offsetParent) ? new CKEDITOR.dom.element(f) : null
  2735. }
  2736. a && (f = this.getWindow(), x = a.getWindow(), !f.equals(x) && f.$.frameElement && (a = (new CKEDITOR.dom.element(f.$.frameElement)).getDocumentPosition(a), b += a.x, c += a.y));
  2737. document.documentElement.getBoundingClientRect || !CKEDITOR.env.gecko ||
  2738. v || (b += this.$.clientLeft ? 1 : 0, c += this.$.clientTop ? 1 : 0);
  2739. return {
  2740. x: b,
  2741. y: c
  2742. }
  2743. },
  2744. scrollIntoView: function(a) {
  2745. var b = this.getParent();
  2746. if (b) {
  2747. do
  2748. if ((b.$.clientWidth && b.$.clientWidth < b.$.scrollWidth || b.$.clientHeight && b.$.clientHeight < b.$.scrollHeight) && !b.is("body") && this.scrollIntoParent(b, a, 1), b.is("html")) {
  2749. var c = b.getWindow();
  2750. try {
  2751. var e = c.$.frameElement;
  2752. e && (b = new CKEDITOR.dom.element(e))
  2753. } catch (d) {}
  2754. } while (b = b.getParent())
  2755. }
  2756. },
  2757. scrollIntoParent: function(a, b, c) {
  2758. var e, d, v, f;
  2759. function h(b, c) {
  2760. /body|html/.test(a.getName()) ?
  2761. a.getWindow().$.scrollBy(b, c) : (a.$.scrollLeft += b, a.$.scrollTop += c)
  2762. }
  2763. function x(a, b) {
  2764. var c = {
  2765. x: 0,
  2766. y: 0
  2767. };
  2768. if (!a.is(k ? "body" : "html")) {
  2769. var e = a.$.getBoundingClientRect();
  2770. c.x = e.left;
  2771. c.y = e.top
  2772. }
  2773. e = a.getWindow();
  2774. e.equals(b) || (e = x(CKEDITOR.dom.element.get(e.$.frameElement), b), c.x += e.x, c.y += e.y);
  2775. return c
  2776. }
  2777. function m(a, b) {
  2778. return parseInt(a.getComputedStyle("margin-" + b) || 0, 10) || 0
  2779. }!a && (a = this.getWindow());
  2780. v = a.getDocument();
  2781. var k = "BackCompat" == v.$.compatMode;
  2782. a instanceof CKEDITOR.dom.window && (a = k ? v.getBody() : v.getDocumentElement());
  2783. CKEDITOR.env.webkit && (v = this.getEditor(!1)) && (v._.previousScrollTop = null);
  2784. v = a.getWindow();
  2785. d = x(this, v);
  2786. var u = x(a, v),
  2787. K = this.$.offsetHeight;
  2788. e = this.$.offsetWidth;
  2789. var l = a.$.clientHeight,
  2790. t = a.$.clientWidth;
  2791. v = d.x - m(this, "left") - u.x || 0;
  2792. f = d.y - m(this, "top") - u.y || 0;
  2793. e = d.x + e + m(this, "right") - (u.x + t) || 0;
  2794. d = d.y + K + m(this, "bottom") - (u.y + l) || 0;
  2795. (0 > f || 0 < d) && h(0, !0 === b ? f : !1 === b ? d : 0 > f ? f : d);
  2796. c && (0 > v || 0 < e) && h(0 > v ? v : e, 0)
  2797. },
  2798. setState: function(a, b, c) {
  2799. b = b || "cke";
  2800. switch (a) {
  2801. case CKEDITOR.TRISTATE_ON:
  2802. this.addClass(b + "_on");
  2803. this.removeClass(b +
  2804. "_off");
  2805. this.removeClass(b + "_disabled");
  2806. c && this.setAttribute("aria-pressed", !0);
  2807. c && this.removeAttribute("aria-disabled");
  2808. break;
  2809. case CKEDITOR.TRISTATE_DISABLED:
  2810. this.addClass(b + "_disabled");
  2811. this.removeClass(b + "_off");
  2812. this.removeClass(b + "_on");
  2813. c && this.setAttribute("aria-disabled", !0);
  2814. c && this.removeAttribute("aria-pressed");
  2815. break;
  2816. default:
  2817. this.addClass(b + "_off"), this.removeClass(b + "_on"), this.removeClass(b + "_disabled"), c && this.removeAttribute("aria-pressed"), c && this.removeAttribute("aria-disabled")
  2818. }
  2819. },
  2820. getFrameDocument: function() {
  2821. var a = this.$;
  2822. try {
  2823. a.contentWindow.document
  2824. } catch (b) {
  2825. a.src = a.src
  2826. }
  2827. return a && new CKEDITOR.dom.document(a.contentWindow.document)
  2828. },
  2829. copyAttributes: function(a, b) {
  2830. var c = this.$.attributes;
  2831. b = b || {};
  2832. for (var e = 0; e < c.length; e++) {
  2833. var d = c[e],
  2834. v = d.nodeName.toLowerCase(),
  2835. f;
  2836. if (!(v in b))
  2837. if ("checked" == v && (f = this.getAttribute(v))) a.setAttribute(v, f);
  2838. else if (!CKEDITOR.env.ie || this.hasAttribute(v)) f = this.getAttribute(v), null === f && (f = d.nodeValue), a.setAttribute(v, f)
  2839. }
  2840. "" !== this.$.style.cssText &&
  2841. (a.$.style.cssText = this.$.style.cssText)
  2842. },
  2843. renameNode: function(a) {
  2844. if (this.getName() != a) {
  2845. var b = this.getDocument();
  2846. a = new CKEDITOR.dom.element(a, b);
  2847. this.copyAttributes(a);
  2848. this.moveChildren(a);
  2849. this.getParent(!0) && this.$.parentNode.replaceChild(a.$, this.$);
  2850. a.$["data-cke-expando"] = this.$["data-cke-expando"];
  2851. this.$ = a.$;
  2852. delete this.getName
  2853. }
  2854. },
  2855. getChild: function() {
  2856. function a(b, c) {
  2857. var e = b.childNodes;
  2858. if (0 <= c && c < e.length) return e[c]
  2859. }
  2860. return function(b) {
  2861. var c = this.$;
  2862. if (b.slice)
  2863. for (b = b.slice(); 0 < b.length && c;) c = a(c,
  2864. b.shift());
  2865. else c = a(c, b);
  2866. return c ? new CKEDITOR.dom.node(c) : null
  2867. }
  2868. }(),
  2869. getChildCount: function() {
  2870. return this.$.childNodes.length
  2871. },
  2872. disableContextMenu: function() {
  2873. function a(b) {
  2874. return b.type == CKEDITOR.NODE_ELEMENT && b.hasClass("cke_enable_context_menu")
  2875. }
  2876. this.on("contextmenu", function(b) {
  2877. b.data.getTarget().getAscendant(a, !0) || b.data.preventDefault()
  2878. })
  2879. },
  2880. getDirection: function(a) {
  2881. return a ? this.getComputedStyle("direction") || this.getDirection() || this.getParent() && this.getParent().getDirection(1) || this.getDocument().$.dir ||
  2882. "ltr" : this.getStyle("direction") || this.getAttribute("dir")
  2883. },
  2884. data: function(a, b) {
  2885. a = "data-" + a;
  2886. if (void 0 === b) return this.getAttribute(a);
  2887. !1 === b ? this.removeAttribute(a) : this.setAttribute(a, b);
  2888. return null
  2889. },
  2890. getEditor: function(a) {
  2891. var b = CKEDITOR.instances,
  2892. c, e, d;
  2893. a = a || void 0 === a;
  2894. for (c in b)
  2895. 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;
  2896. return null
  2897. },
  2898. find: function(a) {
  2899. var c = d(this);
  2900. a = new CKEDITOR.dom.nodeList(this.$.querySelectorAll(b(this,
  2901. a)));
  2902. c();
  2903. return a
  2904. },
  2905. findOne: function(a) {
  2906. var c = d(this);
  2907. a = this.$.querySelector(b(this, a));
  2908. c();
  2909. return a ? new CKEDITOR.dom.element(a) : null
  2910. },
  2911. forEach: function(a, b, c) {
  2912. if (!(c || b && this.type != b)) var e = a(this);
  2913. if (!1 !== e) {
  2914. c = this.getChildren();
  2915. 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)
  2916. }
  2917. }
  2918. });
  2919. var k = {
  2920. width: ["border-left-width", "border-right-width", "padding-left", "padding-right"],
  2921. height: ["border-top-width", "border-bottom-width", "padding-top", "padding-bottom"]
  2922. };
  2923. CKEDITOR.dom.element.prototype.setSize = function(a, b, d) {
  2924. "number" == typeof b && (!d || CKEDITOR.env.ie && CKEDITOR.env.quirks || (b -= c.call(this, a)), this.setStyle(a, b + "px"))
  2925. };
  2926. CKEDITOR.dom.element.prototype.getSize = function(a, b) {
  2927. var d = Math.max(this.$["offset" + CKEDITOR.tools.capitalize(a)], this.$["client" + CKEDITOR.tools.capitalize(a)]) || 0;
  2928. b && (d -= c.call(this, a));
  2929. return d
  2930. }
  2931. })();
  2932. CKEDITOR.dom.documentFragment = function(a) {
  2933. a = a || CKEDITOR.document;
  2934. this.$ = a.type == CKEDITOR.NODE_DOCUMENT ? a.$.createDocumentFragment() : a
  2935. };
  2936. CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype, CKEDITOR.dom.element.prototype, {
  2937. type: CKEDITOR.NODE_DOCUMENT_FRAGMENT,
  2938. insertAfterNode: function(a) {
  2939. a = a.$;
  2940. a.parentNode.insertBefore(this.$, a.nextSibling)
  2941. },
  2942. getHtml: function() {
  2943. var a = new CKEDITOR.dom.element("div");
  2944. this.clone(1, 1).appendTo(a);
  2945. return a.getHtml().replace(/\s*data-cke-expando=".*?"/g, "")
  2946. }
  2947. }, !0, {
  2948. append: 1,
  2949. appendBogus: 1,
  2950. clone: 1,
  2951. getFirst: 1,
  2952. getHtml: 1,
  2953. getLast: 1,
  2954. getParent: 1,
  2955. getNext: 1,
  2956. getPrevious: 1,
  2957. appendTo: 1,
  2958. moveChildren: 1,
  2959. insertBefore: 1,
  2960. insertAfterNode: 1,
  2961. replace: 1,
  2962. trim: 1,
  2963. type: 1,
  2964. ltrim: 1,
  2965. rtrim: 1,
  2966. getDocument: 1,
  2967. getChildCount: 1,
  2968. getChild: 1,
  2969. getChildren: 1
  2970. });
  2971. (function() {
  2972. function a(a, b) {
  2973. var c = this.range;
  2974. if (this._.end) return null;
  2975. if (!this._.start) {
  2976. this._.start = 1;
  2977. if (c.collapsed) return this.end(), null;
  2978. c.optimize()
  2979. }
  2980. var e, d = c.startContainer;
  2981. e = c.endContainer;
  2982. var f = c.startOffset,
  2983. y = c.endOffset,
  2984. h, l = this.guard,
  2985. t = this.type,
  2986. g = a ? "getPreviousSourceNode" : "getNextSourceNode";
  2987. if (!a && !this._.guardLTR) {
  2988. var L = e.type == CKEDITOR.NODE_ELEMENT ? e : e.getParent(),
  2989. C = e.type == CKEDITOR.NODE_ELEMENT ? e.getChild(y) : e.getNext();
  2990. this._.guardLTR = function(a, b) {
  2991. return (!b || !L.equals(a)) && (!C ||
  2992. !a.equals(C)) && (a.type != CKEDITOR.NODE_ELEMENT || !b || !a.equals(c.root))
  2993. }
  2994. }
  2995. if (a && !this._.guardRTL) {
  2996. var k = d.type == CKEDITOR.NODE_ELEMENT ? d : d.getParent(),
  2997. q = d.type == CKEDITOR.NODE_ELEMENT ? f ? d.getChild(f - 1) : null : d.getPrevious();
  2998. this._.guardRTL = function(a, b) {
  2999. return (!b || !k.equals(a)) && (!q || !a.equals(q)) && (a.type != CKEDITOR.NODE_ELEMENT || !b || !a.equals(c.root))
  3000. }
  3001. }
  3002. var E = a ? this._.guardRTL : this._.guardLTR;
  3003. h = l ? function(a, b) {
  3004. return !1 === E(a, b) ? !1 : l(a, b)
  3005. } : E;
  3006. this.current ? e = this.current[g](!1, t, h) : (a ? e.type == CKEDITOR.NODE_ELEMENT &&
  3007. (e = 0 < y ? e.getChild(y - 1) : !1 === h(e, !0) ? null : e.getPreviousSourceNode(!0, t, h)) : (e = d, e.type == CKEDITOR.NODE_ELEMENT && ((e = e.getChild(f)) || (e = !1 === h(d, !0) ? null : d.getNextSourceNode(!0, t, h)))), e && !1 === h(e) && (e = null));
  3008. for (; e && !this._.end;) {
  3009. this.current = e;
  3010. if (!this.evaluator || !1 !== this.evaluator(e)) {
  3011. if (!b) return e
  3012. } else if (b && this.evaluator) return !1;
  3013. e = e[g](!1, t, h)
  3014. }
  3015. this.end();
  3016. return this.current = null
  3017. }
  3018. function d(b) {
  3019. for (var c, e = null; c = a.call(this, b);) e = c;
  3020. return e
  3021. }
  3022. CKEDITOR.dom.walker = CKEDITOR.tools.createClass({
  3023. $: function(a) {
  3024. this.range =
  3025. a;
  3026. this._ = {}
  3027. },
  3028. proto: {
  3029. end: function() {
  3030. this._.end = 1
  3031. },
  3032. next: function() {
  3033. return a.call(this)
  3034. },
  3035. previous: function() {
  3036. return a.call(this, 1)
  3037. },
  3038. checkForward: function() {
  3039. return !1 !== a.call(this, 0, 1)
  3040. },
  3041. checkBackward: function() {
  3042. return !1 !== a.call(this, 1, 1)
  3043. },
  3044. lastForward: function() {
  3045. return d.call(this)
  3046. },
  3047. lastBackward: function() {
  3048. return d.call(this, 1)
  3049. },
  3050. reset: function() {
  3051. delete this.current;
  3052. this._ = {}
  3053. }
  3054. }
  3055. });
  3056. var b = {
  3057. block: 1,
  3058. "list-item": 1,
  3059. table: 1,
  3060. "table-row-group": 1,
  3061. "table-header-group": 1,
  3062. "table-footer-group": 1,
  3063. "table-row": 1,
  3064. "table-column-group": 1,
  3065. "table-column": 1,
  3066. "table-cell": 1,
  3067. "table-caption": 1
  3068. },
  3069. c = {
  3070. absolute: 1,
  3071. fixed: 1
  3072. };
  3073. CKEDITOR.dom.element.prototype.isBlockBoundary = function(a) {
  3074. return "none" != this.getComputedStyle("float") || this.getComputedStyle("position") in c || !b[this.getComputedStyle("display")] ? !!(this.is(CKEDITOR.dtd.$block) || a && this.is(a)) : !0
  3075. };
  3076. CKEDITOR.dom.walker.blockBoundary = function(a) {
  3077. return function(b) {
  3078. return !(b.type == CKEDITOR.NODE_ELEMENT && b.isBlockBoundary(a))
  3079. }
  3080. };
  3081. CKEDITOR.dom.walker.listItemBoundary = function() {
  3082. return this.blockBoundary({
  3083. br: 1
  3084. })
  3085. };
  3086. CKEDITOR.dom.walker.bookmark = function(a, b) {
  3087. function c(a) {
  3088. return a && a.getName && "span" == a.getName() && a.data("cke-bookmark")
  3089. }
  3090. return function(e) {
  3091. var d, f;
  3092. d = e && e.type != CKEDITOR.NODE_ELEMENT && (f = e.getParent()) && c(f);
  3093. d = a ? d : d || c(e);
  3094. return !!(b ^ d)
  3095. }
  3096. };
  3097. CKEDITOR.dom.walker.whitespaces = function(a) {
  3098. return function(b) {
  3099. var c;
  3100. b && b.type == CKEDITOR.NODE_TEXT && (c = !CKEDITOR.tools.trim(b.getText()) || CKEDITOR.env.webkit && b.getText() == CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE);
  3101. return !!(a ^ c)
  3102. }
  3103. };
  3104. CKEDITOR.dom.walker.invisible =
  3105. function(a) {
  3106. var b = CKEDITOR.dom.walker.whitespaces(),
  3107. c = CKEDITOR.env.webkit ? 1 : 0;
  3108. return function(e) {
  3109. b(e) ? e = 1 : (e.type == CKEDITOR.NODE_TEXT && (e = e.getParent()), e = e.$.offsetWidth <= c);
  3110. return !!(a ^ e)
  3111. }
  3112. };
  3113. CKEDITOR.dom.walker.nodeType = function(a, b) {
  3114. return function(c) {
  3115. return !!(b ^ c.type == a)
  3116. }
  3117. };
  3118. CKEDITOR.dom.walker.bogus = function(a) {
  3119. function b(a) {
  3120. return !h(a) && !k(a)
  3121. }
  3122. return function(c) {
  3123. var e = CKEDITOR.env.needsBrFiller ? c.is && c.is("br") : c.getText && f.test(c.getText());
  3124. e && (e = c.getParent(), c = c.getNext(b), e = e.isBlockBoundary() &&
  3125. (!c || c.type == CKEDITOR.NODE_ELEMENT && c.isBlockBoundary()));
  3126. return !!(a ^ e)
  3127. }
  3128. };
  3129. CKEDITOR.dom.walker.temp = function(a) {
  3130. return function(b) {
  3131. b.type != CKEDITOR.NODE_ELEMENT && (b = b.getParent());
  3132. b = b && b.hasAttribute("data-cke-temp");
  3133. return !!(a ^ b)
  3134. }
  3135. };
  3136. var f = /^[\t\r\n ]*(?:&nbsp;|\xa0)$/,
  3137. h = CKEDITOR.dom.walker.whitespaces(),
  3138. k = CKEDITOR.dom.walker.bookmark(),
  3139. g = CKEDITOR.dom.walker.temp(),
  3140. n = function(a) {
  3141. return k(a) || h(a) || a.type == CKEDITOR.NODE_ELEMENT && a.is(CKEDITOR.dtd.$inline) && !a.is(CKEDITOR.dtd.$empty)
  3142. };
  3143. CKEDITOR.dom.walker.ignored =
  3144. function(a) {
  3145. return function(b) {
  3146. b = h(b) || k(b) || g(b);
  3147. return !!(a ^ b)
  3148. }
  3149. };
  3150. var r = CKEDITOR.dom.walker.ignored();
  3151. CKEDITOR.dom.walker.empty = function(a) {
  3152. return function(b) {
  3153. for (var c = 0, e = b.getChildCount(); c < e; ++c)
  3154. if (!r(b.getChild(c))) return !!a;
  3155. return !a
  3156. }
  3157. };
  3158. var e = CKEDITOR.dom.walker.empty(),
  3159. y = CKEDITOR.dom.walker.validEmptyBlockContainers = CKEDITOR.tools.extend(function(a) {
  3160. var b = {},
  3161. c;
  3162. for (c in a) CKEDITOR.dtd[c]["#"] && (b[c] = 1);
  3163. return b
  3164. }(CKEDITOR.dtd.$block), {
  3165. caption: 1,
  3166. td: 1,
  3167. th: 1
  3168. });
  3169. CKEDITOR.dom.walker.editable = function(a) {
  3170. return function(b) {
  3171. b =
  3172. r(b) ? !1 : b.type == CKEDITOR.NODE_TEXT || b.type == CKEDITOR.NODE_ELEMENT && (b.is(CKEDITOR.dtd.$inline) || b.is("hr") || "false" == b.getAttribute("contenteditable") || !CKEDITOR.env.needsBrFiller && b.is(y) && e(b)) ? !0 : !1;
  3173. return !!(a ^ b)
  3174. }
  3175. };
  3176. CKEDITOR.dom.element.prototype.getBogus = function() {
  3177. var a = this;
  3178. do a = a.getPreviousSourceNode(); while (n(a));
  3179. return a && (CKEDITOR.env.needsBrFiller ? a.is && a.is("br") : a.getText && f.test(a.getText())) ? a : !1
  3180. }
  3181. })();
  3182. CKEDITOR.dom.range = function(a) {
  3183. this.endOffset = this.endContainer = this.startOffset = this.startContainer = null;
  3184. this.collapsed = !0;
  3185. var d = a instanceof CKEDITOR.dom.document;
  3186. this.document = d ? a : a.getDocument();
  3187. this.root = d ? a.getBody() : a
  3188. };
  3189. (function() {
  3190. function a(a) {
  3191. a.collapsed = a.startContainer && a.endContainer && a.startContainer.equals(a.endContainer) && a.startOffset == a.endOffset
  3192. }
  3193. function d(a, b, c, d, f) {
  3194. function h(a, b, c, e) {
  3195. var d = c ? a.getPrevious() : a.getNext();
  3196. if (e && k) return d;
  3197. l || e ? b.append(a.clone(!0, f), c) : (a.remove(), r && b.append(a, c));
  3198. return d
  3199. }
  3200. function m() {
  3201. var a, b, c, e = Math.min(O.length, p.length);
  3202. for (a = 0; a < e; a++)
  3203. if (b = O[a], c = p[a], !b.equals(c)) return a;
  3204. return a - 1
  3205. }
  3206. function g() {
  3207. var b = N - 1,
  3208. c = E && z && !t.equals(F);
  3209. b < w - 1 || b < A - 1 || c ? (c ? a.moveToPosition(F,
  3210. CKEDITOR.POSITION_BEFORE_START) : A == b + 1 && q ? a.moveToPosition(p[b], CKEDITOR.POSITION_BEFORE_END) : a.moveToPosition(p[b + 1], CKEDITOR.POSITION_BEFORE_START), d && (b = O[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({
  3211. startNode: c
  3212. }))) : a.collapse(!0)
  3213. }
  3214. a.optimizeBookmark();
  3215. var k = 0 === b,
  3216. r = 1 == b,
  3217. l = 2 == b;
  3218. b = l || r;
  3219. var t = a.startContainer,
  3220. F = a.endContainer,
  3221. L = a.startOffset,
  3222. C = a.endOffset,
  3223. M, q, E, z, H, P;
  3224. if (l && F.type == CKEDITOR.NODE_TEXT && (t.equals(F) || t.type === CKEDITOR.NODE_ELEMENT && t.getFirst().equals(F))) c.append(a.document.createText(F.substring(L, C)));
  3225. else {
  3226. F.type == CKEDITOR.NODE_TEXT ? l ? P = !0 : F = F.split(C) : 0 < F.getChildCount() ? C >= F.getChildCount() ? (F = F.getChild(C - 1), q = !0) : F = F.getChild(C) : z = q = !0;
  3227. t.type == CKEDITOR.NODE_TEXT ? l ? H = !0 : t.split(L) : 0 < t.getChildCount() ? 0 === L ? (t = t.getChild(L), M = !0) : t = t.getChild(L - 1) : E = M = !0;
  3228. for (var O = t.getParents(), p = F.getParents(), N = m(),
  3229. w = O.length - 1, A = p.length - 1, G = c, I, X, V, da = -1, Q = N; Q <= w; Q++) {
  3230. X = O[Q];
  3231. V = X.getNext();
  3232. for (Q != w || X.equals(p[Q]) && w < A ? b && (I = G.append(X.clone(0, f))) : M ? h(X, G, !1, E) : H && G.append(a.document.createText(X.substring(L))); V;) {
  3233. if (V.equals(p[Q])) {
  3234. da = Q;
  3235. break
  3236. }
  3237. V = h(V, G)
  3238. }
  3239. G = I
  3240. }
  3241. G = c;
  3242. for (Q = N; Q <= A; Q++)
  3243. if (c = p[Q], V = c.getPrevious(), c.equals(O[Q])) b && (G = G.getChild(0));
  3244. else {
  3245. Q != A || c.equals(O[Q]) && A < w ? b && (I = G.append(c.clone(0, f))) : q ? h(c, G, !1, z) : P && G.append(a.document.createText(c.substring(0, C)));
  3246. if (Q > da)
  3247. for (; V;) V = h(V, G, !0);
  3248. G = I
  3249. } l || g()
  3250. }
  3251. }
  3252. function b() {
  3253. var a = !1,
  3254. b = CKEDITOR.dom.walker.whitespaces(),
  3255. c = CKEDITOR.dom.walker.bookmark(!0),
  3256. d = CKEDITOR.dom.walker.bogus();
  3257. return function(f) {
  3258. 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
  3259. }
  3260. }
  3261. function c(a) {
  3262. var b = CKEDITOR.dom.walker.whitespaces(),
  3263. c = CKEDITOR.dom.walker.bookmark(1);
  3264. return function(d) {
  3265. return c(d) || b(d) ? !0 : !a && k(d) || d.type == CKEDITOR.NODE_ELEMENT && d.is(CKEDITOR.dtd.$removeEmpty)
  3266. }
  3267. }
  3268. function f(a) {
  3269. return function() {
  3270. var b;
  3271. return this[a ? "getPreviousNode" : "getNextNode"](function(a) {
  3272. !b && r(a) && (b = a);
  3273. return n(a) && !(k(a) && a.equals(b))
  3274. })
  3275. }
  3276. }
  3277. var h = {
  3278. abbr: 1,
  3279. acronym: 1,
  3280. b: 1,
  3281. bdo: 1,
  3282. big: 1,
  3283. cite: 1,
  3284. code: 1,
  3285. del: 1,
  3286. dfn: 1,
  3287. em: 1,
  3288. font: 1,
  3289. i: 1,
  3290. ins: 1,
  3291. label: 1,
  3292. kbd: 1,
  3293. q: 1,
  3294. samp: 1,
  3295. small: 1,
  3296. span: 1,
  3297. strike: 1,
  3298. strong: 1,
  3299. sub: 1,
  3300. sup: 1,
  3301. tt: 1,
  3302. u: 1,
  3303. "var": 1
  3304. },
  3305. k = CKEDITOR.dom.walker.bogus(),
  3306. g = /^[\t\r\n ]*(?:&nbsp;|\xa0)$/,
  3307. n = CKEDITOR.dom.walker.editable(),
  3308. r = CKEDITOR.dom.walker.ignored(!0);
  3309. CKEDITOR.dom.range.prototype = {
  3310. clone: function() {
  3311. var a =
  3312. new CKEDITOR.dom.range(this.root);
  3313. a._setStartContainer(this.startContainer);
  3314. a.startOffset = this.startOffset;
  3315. a._setEndContainer(this.endContainer);
  3316. a.endOffset = this.endOffset;
  3317. a.collapsed = this.collapsed;
  3318. return a
  3319. },
  3320. collapse: function(a) {
  3321. a ? (this._setEndContainer(this.startContainer), this.endOffset = this.startOffset) : (this._setStartContainer(this.endContainer), this.startOffset = this.endOffset);
  3322. this.collapsed = !0
  3323. },
  3324. cloneContents: function(a) {
  3325. var b = new CKEDITOR.dom.documentFragment(this.document);
  3326. this.collapsed ||
  3327. d(this, 2, b, !1, "undefined" == typeof a ? !0 : a);
  3328. return b
  3329. },
  3330. deleteContents: function(a) {
  3331. this.collapsed || d(this, 0, null, a)
  3332. },
  3333. extractContents: function(a, b) {
  3334. var c = new CKEDITOR.dom.documentFragment(this.document);
  3335. this.collapsed || d(this, 1, c, a, "undefined" == typeof b ? !0 : b);
  3336. return c
  3337. },
  3338. createBookmark: function(a) {
  3339. var b, c, d, f, h = this.collapsed;
  3340. b = this.document.createElement("span");
  3341. b.data("cke-bookmark", 1);
  3342. b.setStyle("display", "none");
  3343. b.setHtml("\x26nbsp;");
  3344. a && (d = "cke_bm_" + CKEDITOR.tools.getNextNumber(), b.setAttribute("id",
  3345. d + (h ? "C" : "S")));
  3346. h || (c = b.clone(), c.setHtml("\x26nbsp;"), a && c.setAttribute("id", d + "E"), f = this.clone(), f.collapse(), f.insertNode(c));
  3347. f = this.clone();
  3348. f.collapse(!0);
  3349. f.insertNode(b);
  3350. c ? (this.setStartAfter(b), this.setEndBefore(c)) : this.moveToPosition(b, CKEDITOR.POSITION_AFTER_END);
  3351. return {
  3352. startNode: a ? d + (h ? "C" : "S") : b,
  3353. endNode: a ? d + "E" : c,
  3354. serializable: a,
  3355. collapsed: h
  3356. }
  3357. },
  3358. createBookmark2: function() {
  3359. function a(b) {
  3360. var e = b.container,
  3361. d = b.offset,
  3362. m;
  3363. m = e;
  3364. var f = d;
  3365. m = m.type != CKEDITOR.NODE_ELEMENT || 0 === f || f == m.getChildCount() ?
  3366. 0 : m.getChild(f - 1).type == CKEDITOR.NODE_TEXT && m.getChild(f).type == CKEDITOR.NODE_TEXT;
  3367. m && (e = e.getChild(d - 1), d = e.getLength());
  3368. if (e.type == CKEDITOR.NODE_ELEMENT && 0 < d) {
  3369. a: {
  3370. for (m = e; d--;)
  3371. if (f = m.getChild(d).getIndex(!0), 0 <= f) {
  3372. d = f;
  3373. break a
  3374. } d = -1
  3375. }
  3376. d += 1
  3377. }
  3378. if (e.type == CKEDITOR.NODE_TEXT) {
  3379. m = e;
  3380. for (f = 0;
  3381. (m = m.getPrevious()) && m.type == CKEDITOR.NODE_TEXT;) f += m.getText().replace(CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE, "").length;
  3382. m = f;
  3383. e.getText() ? d += m : (f = e.getPrevious(c), m ? (d = m, e = f ? f.getNext() : e.getParent().getFirst()) : (e =
  3384. e.getParent(), d = f ? f.getIndex(!0) + 1 : 0))
  3385. }
  3386. b.container = e;
  3387. b.offset = d
  3388. }
  3389. function b(a, c) {
  3390. var e = c.getCustomData("cke-fillingChar");
  3391. if (e) {
  3392. var d = a.container;
  3393. e.equals(d) && (a.offset -= CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE.length, 0 >= a.offset && (a.offset = d.getIndex(), a.container = d.getParent()))
  3394. }
  3395. }
  3396. var c = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT, !0);
  3397. return function(c) {
  3398. var d = this.collapsed,
  3399. f = {
  3400. container: this.startContainer,
  3401. offset: this.startOffset
  3402. },
  3403. m = {
  3404. container: this.endContainer,
  3405. offset: this.endOffset
  3406. };
  3407. c && (a(f),
  3408. b(f, this.root), d || (a(m), b(m, this.root)));
  3409. return {
  3410. start: f.container.getAddress(c),
  3411. end: d ? null : m.container.getAddress(c),
  3412. startOffset: f.offset,
  3413. endOffset: m.offset,
  3414. normalized: c,
  3415. collapsed: d,
  3416. is2: !0
  3417. }
  3418. }
  3419. }(),
  3420. moveToBookmark: function(a) {
  3421. if (a.is2) {
  3422. var b = this.document.getByAddress(a.start, a.normalized),
  3423. c = a.startOffset,
  3424. d = a.end && this.document.getByAddress(a.end, a.normalized);
  3425. a = a.endOffset;
  3426. this.setStart(b, c);
  3427. d ? this.setEnd(d, a) : this.collapse(!0)
  3428. } else b = (c = a.serializable) ? this.document.getById(a.startNode) : a.startNode,
  3429. a = c ? this.document.getById(a.endNode) : a.endNode, this.setStartBefore(b), b.remove(), a ? (this.setEndBefore(a), a.remove()) : this.collapse(!0)
  3430. },
  3431. getBoundaryNodes: function() {
  3432. var a = this.startContainer,
  3433. b = this.endContainer,
  3434. c = this.startOffset,
  3435. d = this.endOffset,
  3436. f;
  3437. if (a.type == CKEDITOR.NODE_ELEMENT)
  3438. if (f = a.getChildCount(), f > c) a = a.getChild(c);
  3439. else if (1 > f) a = a.getPreviousSourceNode();
  3440. else {
  3441. for (a = a.$; a.lastChild;) a = a.lastChild;
  3442. a = new CKEDITOR.dom.node(a);
  3443. a = a.getNextSourceNode() || a
  3444. }
  3445. if (b.type == CKEDITOR.NODE_ELEMENT)
  3446. if (f = b.getChildCount(),
  3447. f > d) b = b.getChild(d).getPreviousSourceNode(!0);
  3448. else if (1 > f) b = b.getPreviousSourceNode();
  3449. else {
  3450. for (b = b.$; b.lastChild;) b = b.lastChild;
  3451. b = new CKEDITOR.dom.node(b)
  3452. }
  3453. a.getPosition(b) & CKEDITOR.POSITION_FOLLOWING && (a = b);
  3454. return {
  3455. startNode: a,
  3456. endNode: b
  3457. }
  3458. },
  3459. getCommonAncestor: function(a, b) {
  3460. var c = this.startContainer,
  3461. d = this.endContainer,
  3462. c = c.equals(d) ? a && c.type == CKEDITOR.NODE_ELEMENT && this.startOffset == this.endOffset - 1 ? c.getChild(this.startOffset) : c : c.getCommonAncestor(d);
  3463. return b && !c.is ? c.getParent() : c
  3464. },
  3465. optimize: function() {
  3466. var a =
  3467. this.startContainer,
  3468. b = this.startOffset;
  3469. a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setStartAfter(a) : this.setStartBefore(a));
  3470. a = this.endContainer;
  3471. b = this.endOffset;
  3472. a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setEndAfter(a) : this.setEndBefore(a))
  3473. },
  3474. optimizeBookmark: function() {
  3475. var a = this.startContainer,
  3476. b = this.endContainer;
  3477. a.is && a.is("span") && a.data("cke-bookmark") && this.setStartAt(a, CKEDITOR.POSITION_BEFORE_START);
  3478. b && b.is && b.is("span") && b.data("cke-bookmark") && this.setEndAt(b, CKEDITOR.POSITION_AFTER_END)
  3479. },
  3480. trim: function(a, b) {
  3481. var c = this.startContainer,
  3482. d = this.startOffset,
  3483. f = this.collapsed;
  3484. if ((!a || f) && c && c.type == CKEDITOR.NODE_TEXT) {
  3485. if (d)
  3486. if (d >= c.getLength()) d = c.getIndex() + 1, c = c.getParent();
  3487. else {
  3488. var h = c.split(d),
  3489. d = c.getIndex() + 1,
  3490. c = c.getParent();
  3491. this.startContainer.equals(this.endContainer) ? this.setEnd(h, this.endOffset - this.startOffset) : c.equals(this.endContainer) && (this.endOffset += 1)
  3492. }
  3493. else d = c.getIndex(), c = c.getParent();
  3494. this.setStart(c, d);
  3495. if (f) {
  3496. this.collapse(!0);
  3497. return
  3498. }
  3499. }
  3500. c = this.endContainer;
  3501. d = this.endOffset;
  3502. 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))
  3503. },
  3504. enlarge: function(a, b) {
  3505. function c(a) {
  3506. return a && a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("contenteditable") ? null : a
  3507. }
  3508. var d = new RegExp(/[^\s\ufeff]/);
  3509. switch (a) {
  3510. case CKEDITOR.ENLARGE_INLINE:
  3511. var f = 1;
  3512. case CKEDITOR.ENLARGE_ELEMENT:
  3513. var h = function(a, b) {
  3514. var c = new CKEDITOR.dom.range(g);
  3515. c.setStart(a, b);
  3516. c.setEndAt(g, CKEDITOR.POSITION_BEFORE_END);
  3517. var c = new CKEDITOR.dom.walker(c),
  3518. e;
  3519. for (c.guard = function(a) {
  3520. return !(a.type == CKEDITOR.NODE_ELEMENT && a.isBlockBoundary())
  3521. }; e = c.next();) {
  3522. if (e.type != CKEDITOR.NODE_TEXT) return !1;
  3523. M = e != a ? e.getText() : e.substring(b);
  3524. if (d.test(M)) return !1
  3525. }
  3526. return !0
  3527. };
  3528. if (this.collapsed) break;
  3529. var m = this.getCommonAncestor(),
  3530. g = this.root,
  3531. k, r, l, t, F, L = !1,
  3532. C, M;
  3533. C = this.startContainer;
  3534. var q = this.startOffset;
  3535. C.type == CKEDITOR.NODE_TEXT ? (q && (C = !CKEDITOR.tools.trim(C.substring(0, q)).length && C, L = !!C), C && ((t = C.getPrevious()) || (l = C.getParent()))) : (q && (t = C.getChild(q - 1) || C.getLast()),
  3536. t || (l = C));
  3537. for (l = c(l); l || t;) {
  3538. if (l && !t) {
  3539. !F && l.equals(m) && (F = !0);
  3540. if (f ? l.isBlockBoundary() : !g.contains(l)) break;
  3541. L && "inline" == l.getComputedStyle("display") || (L = !1, F ? k = l : this.setStartBefore(l));
  3542. t = l.getPrevious()
  3543. }
  3544. for (; t;)
  3545. if (C = !1, t.type == CKEDITOR.NODE_COMMENT) t = t.getPrevious();
  3546. else {
  3547. if (t.type == CKEDITOR.NODE_TEXT) M = t.getText(), d.test(M) && (t = null), C = /[\s\ufeff]$/.test(M);
  3548. else if ((t.$.offsetWidth > (CKEDITOR.env.webkit ? 1 : 0) || b && t.is("br")) && !t.data("cke-bookmark"))
  3549. if (L && CKEDITOR.dtd.$removeEmpty[t.getName()]) {
  3550. M =
  3551. t.getText();
  3552. if (d.test(M)) t = null;
  3553. else
  3554. for (var q = t.$.getElementsByTagName("*"), E = 0, z; z = q[E++];)
  3555. if (!CKEDITOR.dtd.$removeEmpty[z.nodeName.toLowerCase()]) {
  3556. t = null;
  3557. break
  3558. } t && (C = !!M.length)
  3559. } else t = null;
  3560. C && (L ? F ? k = l : l && this.setStartBefore(l) : L = !0);
  3561. if (t) {
  3562. C = t.getPrevious();
  3563. if (!l && !C) {
  3564. l = t;
  3565. t = null;
  3566. break
  3567. }
  3568. t = C
  3569. } else l = null
  3570. } l && (l = c(l.getParent()))
  3571. }
  3572. C = this.endContainer;
  3573. q = this.endOffset;
  3574. l = t = null;
  3575. F = L = !1;
  3576. C.type == CKEDITOR.NODE_TEXT ? CKEDITOR.tools.trim(C.substring(q)).length ? L = !0 : (L = !C.getLength(), q == C.getLength() ? (t = C.getNext()) ||
  3577. (l = C.getParent()) : h(C, q) && (l = C.getParent())) : (t = C.getChild(q)) || (l = C);
  3578. for (; l || t;) {
  3579. if (l && !t) {
  3580. !F && l.equals(m) && (F = !0);
  3581. if (f ? l.isBlockBoundary() : !g.contains(l)) break;
  3582. L && "inline" == l.getComputedStyle("display") || (L = !1, F ? r = l : l && this.setEndAfter(l));
  3583. t = l.getNext()
  3584. }
  3585. for (; t;) {
  3586. C = !1;
  3587. if (t.type == CKEDITOR.NODE_TEXT) M = t.getText(), h(t, 0) || (t = null), C = /^[\s\ufeff]/.test(M);
  3588. else if (t.type == CKEDITOR.NODE_ELEMENT) {
  3589. if ((0 < t.$.offsetWidth || b && t.is("br")) && !t.data("cke-bookmark"))
  3590. if (L && CKEDITOR.dtd.$removeEmpty[t.getName()]) {
  3591. M =
  3592. t.getText();
  3593. if (d.test(M)) t = null;
  3594. else
  3595. for (q = t.$.getElementsByTagName("*"), E = 0; z = q[E++];)
  3596. if (!CKEDITOR.dtd.$removeEmpty[z.nodeName.toLowerCase()]) {
  3597. t = null;
  3598. break
  3599. } t && (C = !!M.length)
  3600. } else t = null
  3601. } else C = 1;
  3602. C && L && (F ? r = l : this.setEndAfter(l));
  3603. if (t) {
  3604. C = t.getNext();
  3605. if (!l && !C) {
  3606. l = t;
  3607. t = null;
  3608. break
  3609. }
  3610. t = C
  3611. } else l = null
  3612. }
  3613. l && (l = c(l.getParent()))
  3614. }
  3615. k && r && (m = k.contains(r) ? r : k, this.setStartBefore(m), this.setEndAfter(m));
  3616. break;
  3617. case CKEDITOR.ENLARGE_BLOCK_CONTENTS:
  3618. case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:
  3619. l = new CKEDITOR.dom.range(this.root);
  3620. g = this.root;
  3621. l.setStartAt(g, CKEDITOR.POSITION_AFTER_START);
  3622. l.setEnd(this.startContainer, this.startOffset);
  3623. l = new CKEDITOR.dom.walker(l);
  3624. var H, P, O = CKEDITOR.dom.walker.blockBoundary(a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? {
  3625. br: 1
  3626. } : null),
  3627. p = null,
  3628. N = function(a) {
  3629. if (a.type == CKEDITOR.NODE_ELEMENT && "false" == a.getAttribute("contenteditable"))
  3630. if (p) {
  3631. if (p.equals(a)) {
  3632. p = null;
  3633. return
  3634. }
  3635. } else p = a;
  3636. else if (p) return;
  3637. var b = O(a);
  3638. b || (H = a);
  3639. return b
  3640. },
  3641. f = function(a) {
  3642. var b = N(a);
  3643. !b && a.is && a.is("br") && (P = a);
  3644. return b
  3645. };
  3646. l.guard = N;
  3647. l = l.lastBackward();
  3648. H = H || g;
  3649. this.setStartAt(H, !H.is("br") && (!l && this.checkStartOfBlock() || l && H.contains(l)) ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_AFTER_END);
  3650. if (a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS) {
  3651. l = this.clone();
  3652. l = new CKEDITOR.dom.walker(l);
  3653. var w = CKEDITOR.dom.walker.whitespaces(),
  3654. A = CKEDITOR.dom.walker.bookmark();
  3655. l.evaluator = function(a) {
  3656. return !w(a) && !A(a)
  3657. };
  3658. if ((l = l.previous()) && l.type == CKEDITOR.NODE_ELEMENT && l.is("br")) break
  3659. }
  3660. l = this.clone();
  3661. l.collapse();
  3662. l.setEndAt(g, CKEDITOR.POSITION_BEFORE_END);
  3663. l = new CKEDITOR.dom.walker(l);
  3664. l.guard = a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? f : N;
  3665. H = p = P = null;
  3666. l = l.lastForward();
  3667. H = H || g;
  3668. this.setEndAt(H, !l && this.checkEndOfBlock() || l && H.contains(l) ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_BEFORE_START);
  3669. P && this.setEndAfter(P)
  3670. }
  3671. },
  3672. shrink: function(a, b, c) {
  3673. var d = "boolean" === typeof c ? c : c && "boolean" === typeof c.shrinkOnBlockBoundary ? c.shrinkOnBlockBoundary : !0,
  3674. f = c && c.skipBogus;
  3675. if (!this.collapsed) {
  3676. a = a || CKEDITOR.SHRINK_TEXT;
  3677. var h = this.clone(),
  3678. m = this.startContainer,
  3679. g = this.endContainer,
  3680. k = this.startOffset,
  3681. r = this.endOffset,
  3682. l = c = 1;
  3683. m && m.type == CKEDITOR.NODE_TEXT && (k ? k >= m.getLength() ? h.setStartAfter(m) : (h.setStartBefore(m), c = 0) : h.setStartBefore(m));
  3684. g && g.type == CKEDITOR.NODE_TEXT && (r ? r >= g.getLength() ? h.setEndAfter(g) : (h.setEndAfter(g), l = 0) : h.setEndBefore(g));
  3685. var h = new CKEDITOR.dom.walker(h),
  3686. t = CKEDITOR.dom.walker.bookmark(),
  3687. F = CKEDITOR.dom.walker.bogus();
  3688. h.evaluator = function(b) {
  3689. return b.type == (a == CKEDITOR.SHRINK_ELEMENT ? CKEDITOR.NODE_ELEMENT : CKEDITOR.NODE_TEXT)
  3690. };
  3691. var L;
  3692. h.guard = function(b, c) {
  3693. if (f && F(b) || t(b)) return !0;
  3694. if (a == CKEDITOR.SHRINK_ELEMENT && b.type == CKEDITOR.NODE_TEXT || c && b.equals(L) || !1 === d && b.type == CKEDITOR.NODE_ELEMENT && b.isBlockBoundary() || b.type == CKEDITOR.NODE_ELEMENT && b.hasAttribute("contenteditable")) return !1;
  3695. c || b.type != CKEDITOR.NODE_ELEMENT || (L = b);
  3696. return !0
  3697. };
  3698. c && (m = h[a == CKEDITOR.SHRINK_ELEMENT ? "lastForward" : "next"]()) && this.setStartAt(m, b ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_START);
  3699. l && (h.reset(), (h = h[a == CKEDITOR.SHRINK_ELEMENT ? "lastBackward" : "previous"]()) && this.setEndAt(h, b ? CKEDITOR.POSITION_BEFORE_END :
  3700. CKEDITOR.POSITION_AFTER_END));
  3701. return !(!c && !l)
  3702. }
  3703. },
  3704. insertNode: function(a) {
  3705. this.optimizeBookmark();
  3706. this.trim(!1, !0);
  3707. var b = this.startContainer,
  3708. c = b.getChild(this.startOffset);
  3709. c ? a.insertBefore(c) : b.append(a);
  3710. a.getParent() && a.getParent().equals(this.endContainer) && this.endOffset++;
  3711. this.setStartBefore(a)
  3712. },
  3713. moveToPosition: function(a, b) {
  3714. this.setStartAt(a, b);
  3715. this.collapse(!0)
  3716. },
  3717. moveToRange: function(a) {
  3718. this.setStart(a.startContainer, a.startOffset);
  3719. this.setEnd(a.endContainer, a.endOffset)
  3720. },
  3721. selectNodeContents: function(a) {
  3722. this.setStart(a,
  3723. 0);
  3724. this.setEnd(a, a.type == CKEDITOR.NODE_TEXT ? a.getLength() : a.getChildCount())
  3725. },
  3726. setStart: function(b, c) {
  3727. b.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[b.getName()] && (c = b.getIndex(), b = b.getParent());
  3728. this._setStartContainer(b);
  3729. this.startOffset = c;
  3730. this.endContainer || (this._setEndContainer(b), this.endOffset = c);
  3731. a(this)
  3732. },
  3733. setEnd: function(b, c) {
  3734. b.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[b.getName()] && (c = b.getIndex() + 1, b = b.getParent());
  3735. this._setEndContainer(b);
  3736. this.endOffset = c;
  3737. this.startContainer ||
  3738. (this._setStartContainer(b), this.startOffset = c);
  3739. a(this)
  3740. },
  3741. setStartAfter: function(a) {
  3742. this.setStart(a.getParent(), a.getIndex() + 1)
  3743. },
  3744. setStartBefore: function(a) {
  3745. this.setStart(a.getParent(), a.getIndex())
  3746. },
  3747. setEndAfter: function(a) {
  3748. this.setEnd(a.getParent(), a.getIndex() + 1)
  3749. },
  3750. setEndBefore: function(a) {
  3751. this.setEnd(a.getParent(), a.getIndex())
  3752. },
  3753. setStartAt: function(b, c) {
  3754. switch (c) {
  3755. case CKEDITOR.POSITION_AFTER_START:
  3756. this.setStart(b, 0);
  3757. break;
  3758. case CKEDITOR.POSITION_BEFORE_END:
  3759. b.type == CKEDITOR.NODE_TEXT ? this.setStart(b,
  3760. b.getLength()) : this.setStart(b, b.getChildCount());
  3761. break;
  3762. case CKEDITOR.POSITION_BEFORE_START:
  3763. this.setStartBefore(b);
  3764. break;
  3765. case CKEDITOR.POSITION_AFTER_END:
  3766. this.setStartAfter(b)
  3767. }
  3768. a(this)
  3769. },
  3770. setEndAt: function(b, c) {
  3771. switch (c) {
  3772. case CKEDITOR.POSITION_AFTER_START:
  3773. this.setEnd(b, 0);
  3774. break;
  3775. case CKEDITOR.POSITION_BEFORE_END:
  3776. b.type == CKEDITOR.NODE_TEXT ? this.setEnd(b, b.getLength()) : this.setEnd(b, b.getChildCount());
  3777. break;
  3778. case CKEDITOR.POSITION_BEFORE_START:
  3779. this.setEndBefore(b);
  3780. break;
  3781. case CKEDITOR.POSITION_AFTER_END:
  3782. this.setEndAfter(b)
  3783. }
  3784. a(this)
  3785. },
  3786. fixBlock: function(a, b) {
  3787. var c = this.createBookmark(),
  3788. d = this.document.createElement(b);
  3789. this.collapse(a);
  3790. this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);
  3791. this.extractContents().appendTo(d);
  3792. d.trim();
  3793. this.insertNode(d);
  3794. var f = d.getBogus();
  3795. f && f.remove();
  3796. d.appendBogus();
  3797. this.moveToBookmark(c);
  3798. return d
  3799. },
  3800. splitBlock: function(a, b) {
  3801. var c = new CKEDITOR.dom.elementPath(this.startContainer, this.root),
  3802. d = new CKEDITOR.dom.elementPath(this.endContainer, this.root),
  3803. f = c.block,
  3804. h = d.block,
  3805. m = null;
  3806. if (!c.blockLimit.equals(d.blockLimit)) return null;
  3807. "br" != a && (f || (f = this.fixBlock(!0, a), h = (new CKEDITOR.dom.elementPath(this.endContainer, this.root)).block), h || (h = this.fixBlock(!1, a)));
  3808. c = f && this.checkStartOfBlock();
  3809. d = h && this.checkEndOfBlock();
  3810. this.deleteContents();
  3811. f && f.equals(h) && (d ? (m = new CKEDITOR.dom.elementPath(this.startContainer, this.root), this.moveToPosition(h, CKEDITOR.POSITION_AFTER_END), h = null) : c ? (m = new CKEDITOR.dom.elementPath(this.startContainer, this.root), this.moveToPosition(f, CKEDITOR.POSITION_BEFORE_START), f = null) : (h = this.splitElement(f,
  3812. b || !1), f.is("ul", "ol") || f.appendBogus()));
  3813. return {
  3814. previousBlock: f,
  3815. nextBlock: h,
  3816. wasStartOfBlock: c,
  3817. wasEndOfBlock: d,
  3818. elementPath: m
  3819. }
  3820. },
  3821. splitElement: function(a, b) {
  3822. if (!this.collapsed) return null;
  3823. this.setEndAt(a, CKEDITOR.POSITION_BEFORE_END);
  3824. var c = this.extractContents(!1, b || !1),
  3825. d = a.clone(!1, b || !1);
  3826. c.appendTo(d);
  3827. d.insertAfter(a);
  3828. this.moveToPosition(a, CKEDITOR.POSITION_AFTER_END);
  3829. return d
  3830. },
  3831. removeEmptyBlocksAtEnd: function() {
  3832. function a(d) {
  3833. return function(a) {
  3834. return b(a) || c(a) || a.type == CKEDITOR.NODE_ELEMENT && a.isEmptyInlineRemoveable() ||
  3835. d.is("table") && a.is("caption") ? !1 : !0
  3836. }
  3837. }
  3838. var b = CKEDITOR.dom.walker.whitespaces(),
  3839. c = CKEDITOR.dom.walker.bookmark(!1);
  3840. return function(b) {
  3841. 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;
  3842. this.moveToBookmark(c)
  3843. }
  3844. }(),
  3845. startPath: function() {
  3846. return new CKEDITOR.dom.elementPath(this.startContainer, this.root)
  3847. },
  3848. endPath: function() {
  3849. return new CKEDITOR.dom.elementPath(this.endContainer,
  3850. this.root)
  3851. },
  3852. checkBoundaryOfElement: function(a, b) {
  3853. var d = b == CKEDITOR.START,
  3854. f = this.clone();
  3855. f.collapse(d);
  3856. f[d ? "setStartAt" : "setEndAt"](a, d ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END);
  3857. f = new CKEDITOR.dom.walker(f);
  3858. f.evaluator = c(d);
  3859. return f[d ? "checkBackward" : "checkForward"]()
  3860. },
  3861. checkStartOfBlock: function() {
  3862. var a = this.startContainer,
  3863. c = this.startOffset;
  3864. CKEDITOR.env.ie && c && a.type == CKEDITOR.NODE_TEXT && (a = CKEDITOR.tools.ltrim(a.substring(0, c)), g.test(a) && this.trim(0, 1));
  3865. this.trim();
  3866. a = new CKEDITOR.dom.elementPath(this.startContainer,
  3867. this.root);
  3868. c = this.clone();
  3869. c.collapse(!0);
  3870. c.setStartAt(a.block || a.blockLimit, CKEDITOR.POSITION_AFTER_START);
  3871. a = new CKEDITOR.dom.walker(c);
  3872. a.evaluator = b();
  3873. return a.checkBackward()
  3874. },
  3875. checkEndOfBlock: function() {
  3876. var a = this.endContainer,
  3877. c = this.endOffset;
  3878. CKEDITOR.env.ie && a.type == CKEDITOR.NODE_TEXT && (a = CKEDITOR.tools.rtrim(a.substring(c)), g.test(a) && this.trim(1, 0));
  3879. this.trim();
  3880. a = new CKEDITOR.dom.elementPath(this.endContainer, this.root);
  3881. c = this.clone();
  3882. c.collapse(!1);
  3883. c.setEndAt(a.block || a.blockLimit, CKEDITOR.POSITION_BEFORE_END);
  3884. a = new CKEDITOR.dom.walker(c);
  3885. a.evaluator = b();
  3886. return a.checkForward()
  3887. },
  3888. getPreviousNode: function(a, b, c) {
  3889. var d = this.clone();
  3890. d.collapse(1);
  3891. d.setStartAt(c || this.root, CKEDITOR.POSITION_AFTER_START);
  3892. c = new CKEDITOR.dom.walker(d);
  3893. c.evaluator = a;
  3894. c.guard = b;
  3895. return c.previous()
  3896. },
  3897. getNextNode: function(a, b, c) {
  3898. var d = this.clone();
  3899. d.collapse();
  3900. d.setEndAt(c || this.root, CKEDITOR.POSITION_BEFORE_END);
  3901. c = new CKEDITOR.dom.walker(d);
  3902. c.evaluator = a;
  3903. c.guard = b;
  3904. return c.next()
  3905. },
  3906. checkReadOnly: function() {
  3907. function a(b, c) {
  3908. for (; b;) {
  3909. if (b.type ==
  3910. CKEDITOR.NODE_ELEMENT) {
  3911. if ("false" == b.getAttribute("contentEditable") && !b.data("cke-editable")) return 0;
  3912. if (b.is("html") || "true" == b.getAttribute("contentEditable") && (b.contains(c) || b.equals(c))) break
  3913. }
  3914. b = b.getParent()
  3915. }
  3916. return 1
  3917. }
  3918. return function() {
  3919. var b = this.startContainer,
  3920. c = this.endContainer;
  3921. return !(a(b, c) && a(c, b))
  3922. }
  3923. }(),
  3924. moveToElementEditablePosition: function(a, b) {
  3925. if (a.type == CKEDITOR.NODE_ELEMENT && !a.isEditable(!1)) return this.moveToPosition(a, b ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START),
  3926. !0;
  3927. for (var c = 0; a;) {
  3928. if (a.type == CKEDITOR.NODE_TEXT) {
  3929. 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);
  3930. c = 1;
  3931. break
  3932. }
  3933. if (a.type == CKEDITOR.NODE_ELEMENT)
  3934. if (a.isEditable()) this.moveToPosition(a, b ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_START), c = 1;
  3935. else if (b && a.is("br") && this.endContainer && this.checkEndOfBlock()) this.moveToPosition(a, CKEDITOR.POSITION_BEFORE_START);
  3936. else if ("false" == a.getAttribute("contenteditable") && a.is(CKEDITOR.dtd.$block)) return this.setStartBefore(a), this.setEndAfter(a), !0;
  3937. var d = a,
  3938. f = c,
  3939. h = void 0;
  3940. d.type == CKEDITOR.NODE_ELEMENT && d.isEditable(!1) && (h = d[b ? "getLast" : "getFirst"](r));
  3941. f || h || (h = d[b ? "getPrevious" : "getNext"](r));
  3942. a = h
  3943. }
  3944. return !!c
  3945. },
  3946. moveToClosestEditablePosition: function(a, b) {
  3947. var c, d = 0,
  3948. f, h, m = [CKEDITOR.POSITION_AFTER_END, CKEDITOR.POSITION_BEFORE_START];
  3949. a ? (c = new CKEDITOR.dom.range(this.root), c.moveToPosition(a, m[b ? 0 : 1])) : c = this.clone();
  3950. if (a &&
  3951. !a.is(CKEDITOR.dtd.$block)) d = 1;
  3952. else if (f = c[b ? "getNextEditableNode" : "getPreviousEditableNode"]()) d = 1, (h = f.type == CKEDITOR.NODE_ELEMENT) && f.is(CKEDITOR.dtd.$block) && "false" == f.getAttribute("contenteditable") ? (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, m[b ? 1 : 0]);
  3953. d && this.moveToRange(c);
  3954. return !!d
  3955. },
  3956. moveToElementEditStart: function(a) {
  3957. return this.moveToElementEditablePosition(a)
  3958. },
  3959. moveToElementEditEnd: function(a) {
  3960. return this.moveToElementEditablePosition(a, !0)
  3961. },
  3962. getEnclosedNode: function() {
  3963. var a = this.clone();
  3964. a.optimize();
  3965. if (a.startContainer.type != CKEDITOR.NODE_ELEMENT || a.endContainer.type != CKEDITOR.NODE_ELEMENT) return null;
  3966. var a = new CKEDITOR.dom.walker(a),
  3967. b = CKEDITOR.dom.walker.bookmark(!1, !0),
  3968. c = CKEDITOR.dom.walker.whitespaces(!0);
  3969. a.evaluator = function(a) {
  3970. return c(a) && b(a)
  3971. };
  3972. var d = a.next();
  3973. a.reset();
  3974. return d && d.equals(a.previous()) ? d : null
  3975. },
  3976. getTouchedStartNode: function() {
  3977. var a = this.startContainer;
  3978. return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.startOffset) || a
  3979. },
  3980. getTouchedEndNode: function() {
  3981. var a = this.endContainer;
  3982. return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.endOffset - 1) || a
  3983. },
  3984. getNextEditableNode: f(),
  3985. getPreviousEditableNode: f(1),
  3986. _getTableElement: function(a) {
  3987. a = a || {
  3988. td: 1,
  3989. th: 1,
  3990. tr: 1,
  3991. tbody: 1,
  3992. thead: 1,
  3993. tfoot: 1,
  3994. table: 1
  3995. };
  3996. var b = this.startContainer,
  3997. c = this.endContainer,
  3998. d = b.getAscendant("table", !0),
  3999. f = c.getAscendant("table", !0);
  4000. return CKEDITOR.env.safari && d && c.equals(this.root) ?
  4001. b.getAscendant(a, !0) : this.getEnclosedNode() ? this.getEnclosedNode().getAscendant(a, !0) : d && f && (d.equals(f) || d.contains(f) || f.contains(d)) ? b.getAscendant(a, !0) : null
  4002. },
  4003. scrollIntoView: function() {
  4004. var a = new CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e", this.document),
  4005. b, c, d, f = this.clone();
  4006. f.optimize();
  4007. (d = f.startContainer.type == CKEDITOR.NODE_TEXT) ? (c = f.startContainer.getText(), b = f.startContainer.split(f.startOffset), a.insertAfter(f.startContainer)) : f.insertNode(a);
  4008. a.scrollIntoView();
  4009. d && (f.startContainer.setText(c), b.remove());
  4010. a.remove()
  4011. },
  4012. getClientRects: function() {
  4013. function a(b, c) {
  4014. var d = CKEDITOR.tools.array.map(b, function(a) {
  4015. return a
  4016. }),
  4017. e = new CKEDITOR.dom.range(c.root),
  4018. f, h, l;
  4019. c.startContainer instanceof CKEDITOR.dom.element && (h = 0 === c.startOffset && c.startContainer.hasAttribute("data-widget"));
  4020. c.endContainer instanceof CKEDITOR.dom.element && (l = (l = c.endOffset === (c.endContainer.getChildCount ? c.endContainer.getChildCount() : c.endContainer.length)) && c.endContainer.hasAttribute("data-widget"));
  4021. h && e.setStart(c.startContainer.getParent(), c.startContainer.getIndex());
  4022. l && e.setEnd(c.endContainer.getParent(), c.endContainer.getIndex() + 1);
  4023. if (h || l) c = e;
  4024. e = c.cloneContents();
  4025. e = CKEDITOR.dom.document.prototype.find.call(e, "[data-cke-widget-id]").toArray();
  4026. if (e = CKEDITOR.tools.array.map(e, function(a) {
  4027. var b = c.root.editor;
  4028. a = a.getAttribute("data-cke-widget-id");
  4029. return b.widgets.instances[a].element
  4030. })) return e = CKEDITOR.tools.array.map(e, function(a) {
  4031. var b;
  4032. b = a.getParent().hasClass("cke_widget_wrapper") ? a.getParent() :
  4033. a;
  4034. f = this.root.getDocument().$.createRange();
  4035. f.setStart(b.getParent().$, b.getIndex());
  4036. f.setEnd(b.getParent().$, b.getIndex() + 1);
  4037. b = f.getClientRects();
  4038. b.widgetRect = a.getClientRect();
  4039. return b
  4040. }, c), CKEDITOR.tools.array.forEach(e, function(a) {
  4041. function b(e) {
  4042. CKEDITOR.tools.array.forEach(d, function(b, f) {
  4043. var l = CKEDITOR.tools.objectCompare(a[e], b);
  4044. l || (l = CKEDITOR.tools.objectCompare(a.widgetRect, b));
  4045. l && (Array.prototype.splice.call(d, f, a.length - e, a.widgetRect), c = !0)
  4046. });
  4047. c || (e < d.length - 1 ? b(e + 1) : d.push(a.widgetRect))
  4048. }
  4049. var c;
  4050. b(0)
  4051. }), d
  4052. }
  4053. function b(a, c, e) {
  4054. var f;
  4055. c.collapsed ? e.startContainer instanceof CKEDITOR.dom.element ? (a = e.checkStartOfBlock(), f = new CKEDITOR.dom.text("​"), a ? e.startContainer.append(f, !0) : 0 === e.startOffset ? 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("​"),
  4056. a = c.getClientRects(), e.startContainer.setText("")) : a = [d(e.createBookmark())]) : a = [d(e.createBookmark())];
  4057. return a
  4058. }
  4059. function c(a, b, d) {
  4060. a = CKEDITOR.tools.extend({}, a);
  4061. b && (a = CKEDITOR.tools.getAbsoluteRectPosition(d.document.getWindow(), a));
  4062. !a.width && (a.width = a.right - a.left);
  4063. !a.height && (a.height = a.bottom - a.top);
  4064. return a
  4065. }
  4066. function d(a) {
  4067. var b = a.startNode;
  4068. a = a.endNode;
  4069. var c;
  4070. b.setText("​");
  4071. b.removeStyle("display");
  4072. a ? (a.setText("​"), a.removeStyle("display"), c = [b.getClientRect(), a.getClientRect()], a.remove()) : c = [b.getClientRect(), b.getClientRect()];
  4073. b.remove();
  4074. return {
  4075. right: Math.max(c[0].right, c[1].right),
  4076. bottom: Math.max(c[0].bottom, c[1].bottom),
  4077. left: Math.min(c[0].left, c[1].left),
  4078. top: Math.min(c[0].top, c[1].top),
  4079. width: Math.abs(c[0].left - c[1].left),
  4080. height: Math.max(c[0].bottom, c[1].bottom) - Math.min(c[0].top, c[1].top)
  4081. }
  4082. }
  4083. return void 0 !== this.document.getSelection ? function(d) {
  4084. var f = this.root.getDocument().$.createRange(),
  4085. m;
  4086. f.setStart(this.startContainer.$, this.startOffset);
  4087. f.setEnd(this.endContainer.$, this.endOffset);
  4088. m = f.getClientRects();
  4089. m = a(m, this);
  4090. m.length || (m = b(m, f, this));
  4091. return CKEDITOR.tools.array.map(m, function(a) {
  4092. return c(a, d, this)
  4093. }, this)
  4094. } : function(a) {
  4095. return [c(d(this.createBookmark()), a, this)]
  4096. }
  4097. }(),
  4098. _setStartContainer: function(a) {
  4099. this.startContainer = a
  4100. },
  4101. _setEndContainer: function(a) {
  4102. this.endContainer = a
  4103. },
  4104. _find: function(a, b) {
  4105. var c = this.getCommonAncestor(),
  4106. d = this.getBoundaryNodes(),
  4107. f = [],
  4108. h, m, g, k;
  4109. if (c && c.find)
  4110. for (m = c.find(a), h = 0; h < m.count(); h++)
  4111. if (c = m.getItem(h), b || !c.isReadOnly()) g = c.getPosition(d.startNode) & CKEDITOR.POSITION_FOLLOWING ||
  4112. 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);
  4113. return f
  4114. }
  4115. };
  4116. CKEDITOR.dom.range.mergeRanges = function(a) {
  4117. return CKEDITOR.tools.array.reduce(a, function(a, b) {
  4118. var c = a[a.length - 1],
  4119. d = !1;
  4120. b = b.clone();
  4121. b.enlarge(CKEDITOR.ENLARGE_ELEMENT);
  4122. if (c) {
  4123. var e = new CKEDITOR.dom.range(b.root),
  4124. d = new CKEDITOR.dom.walker(e),
  4125. f = CKEDITOR.dom.walker.whitespaces();
  4126. e.setStart(c.endContainer, c.endOffset);
  4127. e.setEnd(b.startContainer, b.startOffset);
  4128. for (e = d.next(); f(e) || b.endContainer.equals(e);) e = d.next();
  4129. d = !e
  4130. }
  4131. d ? c.setEnd(b.endContainer, b.endOffset) : a.push(b);
  4132. return a
  4133. }, [])
  4134. }
  4135. })();
  4136. CKEDITOR.POSITION_AFTER_START = 1;
  4137. CKEDITOR.POSITION_BEFORE_END = 2;
  4138. CKEDITOR.POSITION_BEFORE_START = 3;
  4139. CKEDITOR.POSITION_AFTER_END = 4;
  4140. CKEDITOR.ENLARGE_ELEMENT = 1;
  4141. CKEDITOR.ENLARGE_BLOCK_CONTENTS = 2;
  4142. CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS = 3;
  4143. CKEDITOR.ENLARGE_INLINE = 4;
  4144. CKEDITOR.START = 1;
  4145. CKEDITOR.END = 2;
  4146. CKEDITOR.SHRINK_ELEMENT = 1;
  4147. CKEDITOR.SHRINK_TEXT = 2;
  4148. "use strict";
  4149. (function() {
  4150. function a(a) {
  4151. 1 > arguments.length || (this.range = a, this.forceBrBreak = 0, this.enlargeBr = 1, this.enforceRealBlocks = 0, this._ || (this._ = {}))
  4152. }
  4153. function d(a) {
  4154. var b = [];
  4155. a.forEach(function(a) {
  4156. if ("true" == a.getAttribute("contenteditable")) return b.push(a), !1
  4157. }, CKEDITOR.NODE_ELEMENT, !0);
  4158. return b
  4159. }
  4160. function b(a, c, f, h) {
  4161. a: {
  4162. null == h && (h = d(f));
  4163. for (var g; g = h.shift();)
  4164. if (g.getDtd().p) {
  4165. h = {
  4166. element: g,
  4167. remaining: h
  4168. };
  4169. break a
  4170. } h = null
  4171. }
  4172. if (!h) return 0;
  4173. if ((g = CKEDITOR.filter.instances[h.element.data("cke-filter")]) && !g.check(c)) return b(a,
  4174. 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 = {
  4175. element: h.element,
  4176. container: f,
  4177. remaining: h.remaining,
  4178. iterator: c
  4179. };
  4180. return 1
  4181. }
  4182. function c(a, b, c) {
  4183. if (!b) return !1;
  4184. a = a.clone();
  4185. a.collapse(!c);
  4186. return a.checkBoundaryOfElement(b, c ? CKEDITOR.START : CKEDITOR.END)
  4187. }
  4188. var f = /^[\r\n\t ]+$/,
  4189. h = CKEDITOR.dom.walker.bookmark(!1, !0),
  4190. k = CKEDITOR.dom.walker.whitespaces(!0),
  4191. g = function(a) {
  4192. return h(a) && k(a)
  4193. },
  4194. n = {
  4195. dd: 1,
  4196. dt: 1,
  4197. li: 1
  4198. };
  4199. a.prototype = {
  4200. getNextParagraph: function(a) {
  4201. var d, k, v, B, D;
  4202. a = a || "p";
  4203. if (this._.nestedEditable) {
  4204. if (d = this._.nestedEditable.iterator.getNextParagraph(a)) return this.activeFilter = this._.nestedEditable.iterator.activeFilter, d;
  4205. this.activeFilter = this.filter;
  4206. if (b(this, a, this._.nestedEditable.container, this._.nestedEditable.remaining)) return this.activeFilter = this._.nestedEditable.iterator.activeFilter, this._.nestedEditable.iterator.getNextParagraph(a);
  4207. this._.nestedEditable =
  4208. null
  4209. }
  4210. if (!this.range.root.getDtd()[a]) return null;
  4211. if (!this._.started) {
  4212. var x = this.range.clone();
  4213. k = x.startPath();
  4214. var m = x.endPath(),
  4215. J = !x.collapsed && c(x, k.block),
  4216. u = !x.collapsed && c(x, m.block, 1);
  4217. x.shrink(CKEDITOR.SHRINK_ELEMENT, !0);
  4218. J && x.setStartAt(k.block, CKEDITOR.POSITION_BEFORE_END);
  4219. u && x.setEndAt(m.block, CKEDITOR.POSITION_AFTER_START);
  4220. k = x.endContainer.hasAscendant("pre", !0) || x.startContainer.hasAscendant("pre", !0);
  4221. x.enlarge(this.forceBrBreak && !k || !this.enlargeBr ? CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS);
  4222. x.collapsed || (k = new CKEDITOR.dom.walker(x.clone()), m = CKEDITOR.dom.walker.bookmark(!0, !0), k.evaluator = m, this._.nextNode = k.next(), k = new CKEDITOR.dom.walker(x.clone()), k.evaluator = m, k = k.previous(), this._.lastNode = k.getNextSourceNode(!0, null, x.root), this._.lastNode && this._.lastNode.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(this._.lastNode.getText()) && this._.lastNode.getParent().isBlockBoundary() && (m = this.range.clone(), m.moveToPosition(this._.lastNode, CKEDITOR.POSITION_AFTER_END), m.checkEndOfBlock() &&
  4223. (m = new CKEDITOR.dom.elementPath(m.endContainer, m.root), this._.lastNode = (m.block || m.blockLimit).getNextSourceNode(!0))), this._.lastNode && x.root.contains(this._.lastNode) || (this._.lastNode = this._.docEndMarker = x.document.createText(""), this._.lastNode.insertAfter(k)), x = null);
  4224. this._.started = 1;
  4225. k = x
  4226. }
  4227. m = this._.nextNode;
  4228. x = this._.lastNode;
  4229. for (this._.nextNode = null; m;) {
  4230. var J = 0,
  4231. u = m.hasAscendant("pre"),
  4232. K = m.type != CKEDITOR.NODE_ELEMENT,
  4233. l = 0;
  4234. if (K) m.type == CKEDITOR.NODE_TEXT && f.test(m.getText()) && (K = 0);
  4235. else {
  4236. var t = m.getName();
  4237. if (CKEDITOR.dtd.$block[t] && "false" == m.getAttribute("contenteditable")) {
  4238. d = m;
  4239. b(this, a, d);
  4240. break
  4241. } else if (m.isBlockBoundary(this.forceBrBreak && !u && {
  4242. br: 1
  4243. })) {
  4244. if ("br" == t) K = 1;
  4245. else if (!k && !m.getChildCount() && "hr" != t) {
  4246. d = m;
  4247. v = m.equals(x);
  4248. break
  4249. }
  4250. k && (k.setEndAt(m, CKEDITOR.POSITION_BEFORE_START), "br" != t && (this._.nextNode = m));
  4251. J = 1
  4252. } else {
  4253. if (m.getFirst()) {
  4254. k || (k = this.range.clone(), k.setStartAt(m, CKEDITOR.POSITION_BEFORE_START));
  4255. m = m.getFirst();
  4256. continue
  4257. }
  4258. K = 1
  4259. }
  4260. }
  4261. K && !k && (k = this.range.clone(), k.setStartAt(m, CKEDITOR.POSITION_BEFORE_START));
  4262. v = (!J || K) && m.equals(x);
  4263. if (k && !J)
  4264. for (; !m.getNext(g) && !v;) {
  4265. t = m.getParent();
  4266. if (t.isBlockBoundary(this.forceBrBreak && !u && {
  4267. br: 1
  4268. })) {
  4269. J = 1;
  4270. K = 0;
  4271. v || t.equals(x);
  4272. k.setEndAt(t, CKEDITOR.POSITION_BEFORE_END);
  4273. break
  4274. }
  4275. m = t;
  4276. K = 1;
  4277. v = m.equals(x);
  4278. l = 1
  4279. }
  4280. K && k.setEndAt(m, CKEDITOR.POSITION_AFTER_END);
  4281. m = this._getNextSourceNode(m, l, x);
  4282. if ((v = !m) || J && k) break
  4283. }
  4284. if (!d) {
  4285. if (!k) return this._.docEndMarker && this._.docEndMarker.remove(), this._.nextNode = null;
  4286. d = new CKEDITOR.dom.elementPath(k.startContainer, k.root);
  4287. m = d.blockLimit;
  4288. J = {
  4289. div: 1,
  4290. th: 1,
  4291. td: 1
  4292. };
  4293. d = d.block;
  4294. !d && m && !this.enforceRealBlocks && J[m.getName()] && k.checkStartOfBlock() && k.checkEndOfBlock() && !m.equals(k.root) ? d = m : !d || this.enforceRealBlocks && d.is(n) ? (d = this.range.document.createElement(a), k.extractContents().appendTo(d), d.trim(), k.insertNode(d), B = D = !0) : "li" != d.getName() ? k.checkStartOfBlock() && k.checkEndOfBlock() || (d = d.clone(!1), k.extractContents().appendTo(d), d.trim(), D = k.splitBlock(), B = !D.wasStartOfBlock, D = !D.wasEndOfBlock, k.insertNode(d)) : v || (this._.nextNode = d.equals(x) ? null : this._getNextSourceNode(k.getBoundaryNodes().endNode,
  4295. 1, x))
  4296. }
  4297. B && (B = d.getPrevious()) && B.type == CKEDITOR.NODE_ELEMENT && ("br" == B.getName() ? B.remove() : B.getLast() && "br" == B.getLast().$.nodeName.toLowerCase() && B.getLast().remove());
  4298. D && (B = d.getLast()) && B.type == CKEDITOR.NODE_ELEMENT && "br" == B.getName() && (!CKEDITOR.env.needsBrFiller || B.getPrevious(h) || B.getNext(h)) && B.remove();
  4299. this._.nextNode || (this._.nextNode = v || d.equals(x) || !x ? null : this._getNextSourceNode(d, 1, x));
  4300. return d
  4301. },
  4302. _getNextSourceNode: function(a, b, c) {
  4303. function d(a) {
  4304. return !(a.equals(c) || a.equals(f))
  4305. }
  4306. var f =
  4307. this.range.root;
  4308. for (a = a.getNextSourceNode(b, null, d); !h(a);) a = a.getNextSourceNode(b, null, d);
  4309. return a
  4310. }
  4311. };
  4312. CKEDITOR.dom.range.prototype.createIterator = function() {
  4313. return new a(this)
  4314. }
  4315. })();
  4316. CKEDITOR.command = function(a, d) {
  4317. this.uiItems = [];
  4318. this.exec = function(b) {
  4319. if (this.state == CKEDITOR.TRISTATE_DISABLED || !this.checkAllowed()) return !1;
  4320. this.editorFocus && a.focus();
  4321. return !1 === this.fire("exec") ? !0 : !1 !== d.exec.call(this, a, b)
  4322. };
  4323. this.refresh = function(a, b) {
  4324. if (!this.readOnly && a.readOnly) return !0;
  4325. if (this.context && !b.isContextFor(this.context) || !this.checkAllowed(!0)) return this.disable(), !0;
  4326. this.startDisabled || this.enable();
  4327. this.modes && !this.modes[a.mode] && this.disable();
  4328. return !1 === this.fire("refresh", {
  4329. editor: a,
  4330. path: b
  4331. }) ? !0 : d.refresh && !1 !== d.refresh.apply(this, arguments)
  4332. };
  4333. var b;
  4334. this.checkAllowed = function(c) {
  4335. return c || "boolean" != typeof b ? b = a.activeFilter.checkFeature(this) : b
  4336. };
  4337. CKEDITOR.tools.extend(this, d, {
  4338. modes: {
  4339. wysiwyg: 1
  4340. },
  4341. editorFocus: 1,
  4342. contextSensitive: !!d.context,
  4343. state: CKEDITOR.TRISTATE_DISABLED
  4344. });
  4345. CKEDITOR.event.call(this)
  4346. };
  4347. CKEDITOR.command.prototype = {
  4348. enable: function() {
  4349. this.state == CKEDITOR.TRISTATE_DISABLED && this.checkAllowed() && this.setState(this.preserveState && "undefined" != typeof this.previousState ? this.previousState : CKEDITOR.TRISTATE_OFF)
  4350. },
  4351. disable: function() {
  4352. this.setState(CKEDITOR.TRISTATE_DISABLED)
  4353. },
  4354. setState: function(a) {
  4355. if (this.state == a || a != CKEDITOR.TRISTATE_DISABLED && !this.checkAllowed()) return !1;
  4356. this.previousState = this.state;
  4357. this.state = a;
  4358. this.fire("state");
  4359. return !0
  4360. },
  4361. toggleState: function() {
  4362. this.state == CKEDITOR.TRISTATE_OFF ?
  4363. this.setState(CKEDITOR.TRISTATE_ON) : this.state == CKEDITOR.TRISTATE_ON && this.setState(CKEDITOR.TRISTATE_OFF)
  4364. }
  4365. };
  4366. CKEDITOR.event.implementOn(CKEDITOR.command.prototype);
  4367. CKEDITOR.ENTER_P = 1;
  4368. CKEDITOR.ENTER_BR = 2;
  4369. CKEDITOR.ENTER_DIV = 3;
  4370. CKEDITOR.config = {
  4371. customConfig: "config.js",
  4372. autoUpdateElement: !0,
  4373. language: "",
  4374. defaultLanguage: "en",
  4375. contentsLangDirection: "",
  4376. enterMode: CKEDITOR.ENTER_P,
  4377. forceEnterMode: !1,
  4378. shiftEnterMode: CKEDITOR.ENTER_BR,
  4379. docType: "\x3c!DOCTYPE html\x3e",
  4380. bodyId: "",
  4381. bodyClass: "",
  4382. fullPage: !1,
  4383. height: 200,
  4384. contentsCss: CKEDITOR.getUrl("contents.css"),
  4385. extraPlugins: "",
  4386. removePlugins: "",
  4387. protectedSource: [],
  4388. tabIndex: 0,
  4389. width: "",
  4390. baseFloatZIndex: 1E4,
  4391. blockedKeystrokes: [CKEDITOR.CTRL + 66, CKEDITOR.CTRL + 73, CKEDITOR.CTRL + 85]
  4392. };
  4393. (function() {
  4394. function a(a, b, c, d, f) {
  4395. var e, w;
  4396. a = [];
  4397. for (e in b) {
  4398. w = b[e];
  4399. w = "boolean" == typeof w ? {} : "function" == typeof w ? {
  4400. match: w
  4401. } : E(w);
  4402. "$" != e.charAt(0) && (w.elements = e);
  4403. c && (w.featureName = c.toLowerCase());
  4404. var l = w;
  4405. l.elements = k(l.elements, /\s+/) || null;
  4406. l.propertiesOnly = l.propertiesOnly || !0 === l.elements;
  4407. var p = /\s*,\s*/,
  4408. m = void 0;
  4409. for (m in P) {
  4410. l[m] = k(l[m], p) || null;
  4411. var h = l,
  4412. t = O[m],
  4413. q = k(l[O[m]], p),
  4414. A = l[m],
  4415. z = [],
  4416. g = !0,
  4417. H = void 0;
  4418. q ? g = !1 : q = {};
  4419. for (H in A) "!" == H.charAt(0) && (H = H.slice(1), z.push(H), q[H] = !0, g = !1);
  4420. for (; H = z.pop();) A[H] =
  4421. A["!" + H], delete A["!" + H];
  4422. h[t] = (g ? !1 : q) || null
  4423. }
  4424. l.match = l.match || null;
  4425. d.push(w);
  4426. a.push(w)
  4427. }
  4428. b = f.elements;
  4429. f = f.generic;
  4430. var F;
  4431. c = 0;
  4432. for (d = a.length; c < d; ++c) {
  4433. e = E(a[c]);
  4434. w = !0 === e.classes || !0 === e.styles || !0 === e.attributes;
  4435. l = e;
  4436. m = t = p = void 0;
  4437. for (p in P) l[p] = J(l[p]);
  4438. h = !0;
  4439. for (m in O) {
  4440. p = O[m];
  4441. t = l[p];
  4442. q = [];
  4443. A = void 0;
  4444. for (A in t) - 1 < A.indexOf("*") ? q.push(new RegExp("^" + A.replace(/\*/g, ".*") + "$")) : q.push(A);
  4445. t = q;
  4446. t.length && (l[p] = t, h = !1)
  4447. }
  4448. l.nothingRequired = h;
  4449. l.noProperties = !(l.attributes || l.classes || l.styles);
  4450. if (!0 === e.elements ||
  4451. null === e.elements) f[w ? "unshift" : "push"](e);
  4452. else
  4453. for (F in l = e.elements, delete e.elements, l)
  4454. if (b[F]) b[F][w ? "unshift" : "push"](e);
  4455. else b[F] = [e]
  4456. }
  4457. }
  4458. function d(a, c, d, f) {
  4459. if (!a.match || a.match(c))
  4460. if (f || g(a, c))
  4461. 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) {
  4462. a = a.classes;
  4463. c = c.classes;
  4464. f = d.validClasses;
  4465. if (a)
  4466. if (!0 === a) a = !0;
  4467. else {
  4468. for (var e = 0, w = c.length, l; e < w; ++e) l = c[e], f[l] ||
  4469. (f[l] = a(l));
  4470. a = !1
  4471. }
  4472. else a = !1;
  4473. d.allClasses = a
  4474. }
  4475. }
  4476. function b(a, b, c) {
  4477. if (!a) return !1;
  4478. if (!0 === a) return !0;
  4479. for (var d in b) c[d] || (c[d] = a(d));
  4480. return !1
  4481. }
  4482. function c(a, b, c) {
  4483. if (!a.match || a.match(b)) {
  4484. if (a.noProperties) return !1;
  4485. c.hadInvalidAttribute = f(a.attributes, b.attributes) || c.hadInvalidAttribute;
  4486. c.hadInvalidStyle = f(a.styles, b.styles) || c.hadInvalidStyle;
  4487. a = a.classes;
  4488. b = b.classes;
  4489. if (a) {
  4490. for (var d = !1, e = !0 === a, l = b.length; l--;)
  4491. if (e || a(b[l])) b.splice(l, 1), d = !0;
  4492. a = d
  4493. } else a = !1;
  4494. c.hadInvalidClass = a || c.hadInvalidClass
  4495. }
  4496. }
  4497. function f(a,
  4498. b) {
  4499. if (!a) return !1;
  4500. var c = !1,
  4501. d = !0 === a,
  4502. f;
  4503. for (f in b)
  4504. if (d || a(f)) delete b[f], c = !0;
  4505. return c
  4506. }
  4507. function h(a, b, c) {
  4508. if (a.disabled || a.customConfig && !c || !b) return !1;
  4509. a._.cachedChecks = {};
  4510. return !0
  4511. }
  4512. function k(a, b) {
  4513. if (!a) return !1;
  4514. if (!0 === a) return a;
  4515. if ("string" == typeof a) return a = z(a), "*" == a ? !0 : CKEDITOR.tools.convertArrayToObject(a.split(b));
  4516. if (CKEDITOR.tools.isArray(a)) return a.length ? CKEDITOR.tools.convertArrayToObject(a) : !1;
  4517. var c = {},
  4518. d = 0,
  4519. f;
  4520. for (f in a) c[f] = a[f], d++;
  4521. return d ? c : !1
  4522. }
  4523. function g(a, b) {
  4524. if (a.nothingRequired) return !0;
  4525. var c, d, f, e;
  4526. if (f = a.requiredClasses)
  4527. for (e = b.classes, c = 0; c < f.length; ++c)
  4528. if (d = f[c], "string" == typeof d) {
  4529. if (-1 == CKEDITOR.tools.indexOf(e, d)) return !1
  4530. } else if (!CKEDITOR.tools.checkIfAnyArrayItemMatches(e, d)) return !1;
  4531. return n(b.styles, a.requiredStyles) && n(b.attributes, a.requiredAttributes)
  4532. }
  4533. function n(a, b) {
  4534. if (!b) return !0;
  4535. for (var c = 0, d; c < b.length; ++c)
  4536. if (d = b[c], "string" == typeof d) {
  4537. if (!(d in a)) return !1
  4538. } else if (!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a, d)) return !1;
  4539. return !0
  4540. }
  4541. function r(a) {
  4542. if (!a) return {};
  4543. a = a.split(/\s*,\s*/).sort();
  4544. for (var b = {}; a.length;) b[a.shift()] = "cke-test";
  4545. return b
  4546. }
  4547. function e(a) {
  4548. var b, c, d, f, e = {},
  4549. l = 1;
  4550. for (a = z(a); b = a.match(p);)(c = b[2]) ? (d = y(c, "styles"), f = y(c, "attrs"), c = y(c, "classes")) : d = f = c = null, e["$" + l++] = {
  4551. elements: b[1],
  4552. classes: c,
  4553. styles: d,
  4554. attributes: f
  4555. }, a = a.slice(b[0].length);
  4556. return e
  4557. }
  4558. function y(a, b) {
  4559. var c = a.match(N[b]);
  4560. return c ? z(c[1]) : null
  4561. }
  4562. function v(a) {
  4563. var b = a.styleBackup = a.attributes.style,
  4564. c = a.classBackup = a.attributes["class"];
  4565. a.styles || (a.styles = CKEDITOR.tools.parseCssText(b ||
  4566. "", 1));
  4567. a.classes || (a.classes = c ? c.split(/\s+/) : [])
  4568. }
  4569. function B(a, b, f, e) {
  4570. var l = 0,
  4571. p;
  4572. e.toHtml && (b.name = b.name.replace(w, "$1"));
  4573. if (e.doCallbacks && a.elementCallbacks) {
  4574. a: {
  4575. p = a.elementCallbacks;
  4576. for (var h = 0, q = p.length, E; h < q; ++h)
  4577. if (E = p[h](b)) {
  4578. p = E;
  4579. break a
  4580. } p = void 0
  4581. }
  4582. if (p) return p
  4583. }
  4584. if (e.doTransform && (p = a._.transformations[b.name])) {
  4585. v(b);
  4586. for (h = 0; h < p.length; ++h) t(a, b, p[h]);
  4587. x(b)
  4588. }
  4589. if (e.doFilter) {
  4590. a: {
  4591. h = b.name;q = a._;a = q.allowedRules.elements[h];p = q.allowedRules.generic;h = q.disallowedRules.elements[h];q = q.disallowedRules.generic;
  4592. E = e.skipRequired;
  4593. var z = {
  4594. valid: !1,
  4595. validAttributes: {},
  4596. validClasses: {},
  4597. validStyles: {},
  4598. allAttributes: !1,
  4599. allClasses: !1,
  4600. allStyles: !1,
  4601. hadInvalidAttribute: !1,
  4602. hadInvalidClass: !1,
  4603. hadInvalidStyle: !1
  4604. },
  4605. g, k;
  4606. if (a || p) {
  4607. v(b);
  4608. if (h)
  4609. for (g = 0, k = h.length; g < k; ++g)
  4610. if (!1 === c(h[g], b, z)) {
  4611. a = null;
  4612. break a
  4613. } if (q)
  4614. for (g = 0, k = q.length; g < k; ++g) c(q[g], b, z);
  4615. if (a)
  4616. for (g = 0, k = a.length; g < k; ++g) d(a[g], b, z, E);
  4617. if (p)
  4618. for (g = 0, k = p.length; g < k; ++g) d(p[g], b, z, E);
  4619. a = z
  4620. } else a = null
  4621. }
  4622. if (!a || !a.valid) return f.push(b),
  4623. 1;k = a.validAttributes;
  4624. var H = a.validStyles;
  4625. p = a.validClasses;
  4626. var h = b.attributes,
  4627. F = b.styles,
  4628. q = b.classes;E = b.classBackup;
  4629. var L = b.styleBackup,
  4630. G, N, C = [],
  4631. z = [],
  4632. O = /^data-cke-/;g = !1;delete h.style;delete h["class"];delete b.classBackup;delete b.styleBackup;
  4633. if (!a.allAttributes)
  4634. for (G in h) k[G] || (O.test(G) ? G == (N = G.replace(/^data-cke-saved-/, "")) || k[N] || (delete h[G], g = !0) : (delete h[G], g = !0));
  4635. if (!a.allStyles || a.hadInvalidStyle) {
  4636. for (G in F) a.allStyles || H[G] ? C.push(G + ":" + F[G]) : g = !0;
  4637. C.length && (h.style = C.sort().join("; "))
  4638. } else L && (h.style = L);
  4639. if (!a.allClasses ||
  4640. a.hadInvalidClass) {
  4641. for (G = 0; G < q.length; ++G)(a.allClasses || p[q[G]]) && z.push(q[G]);
  4642. z.length && (h["class"] = z.sort().join(" "));
  4643. E && z.length < E.split(/\s+/).length && (g = !0)
  4644. } else E && (h["class"] = E);g && (l = 1);
  4645. if (!e.skipFinalValidation && !m(b)) return f.push(b),
  4646. 1
  4647. }
  4648. e.toHtml && (b.name = b.name.replace(A, "cke:$1"));
  4649. return l
  4650. }
  4651. function D(a) {
  4652. var b = [],
  4653. c;
  4654. for (c in a) - 1 < c.indexOf("*") && b.push(c.replace(/\*/g, ".*"));
  4655. return b.length ? new RegExp("^(?:" + b.join("|") + ")$") : null
  4656. }
  4657. function x(a) {
  4658. var b = a.attributes,
  4659. c;
  4660. delete b.style;
  4661. delete b["class"];
  4662. if (c = CKEDITOR.tools.writeCssText(a.styles, !0)) b.style = c;
  4663. a.classes.length && (b["class"] = a.classes.sort().join(" "))
  4664. }
  4665. function m(a) {
  4666. switch (a.name) {
  4667. case "a":
  4668. if (!(a.children.length || a.attributes.name || a.attributes.id)) return !1;
  4669. break;
  4670. case "img":
  4671. if (!a.attributes.src) return !1
  4672. }
  4673. return !0
  4674. }
  4675. function J(a) {
  4676. if (!a) return !1;
  4677. if (!0 === a) return !0;
  4678. var b = D(a);
  4679. return function(c) {
  4680. return c in a || b && c.match(b)
  4681. }
  4682. }
  4683. function u() {
  4684. return new CKEDITOR.htmlParser.element("br")
  4685. }
  4686. function K(a) {
  4687. return a.type == CKEDITOR.NODE_ELEMENT && ("br" ==
  4688. a.name || q.$block[a.name])
  4689. }
  4690. function l(a, b, c) {
  4691. var d = a.name;
  4692. if (q.$empty[d] || !a.children.length) "hr" == d && "br" == b ? a.replaceWith(u()) : (a.parent && c.push({
  4693. check: "it",
  4694. el: a.parent
  4695. }), a.remove());
  4696. else if (q.$block[d] || "tr" == d)
  4697. if ("br" == b) a.previous && !K(a.previous) && (b = u(), b.insertBefore(a)), a.next && !K(a.next) && (b = u(), b.insertAfter(a)), a.replaceWithChildren();
  4698. else {
  4699. var d = a.children,
  4700. f;
  4701. b: {
  4702. f = q[b];
  4703. for (var e = 0, l = d.length, w; e < l; ++e)
  4704. if (w = d[e], w.type == CKEDITOR.NODE_ELEMENT && !f[w.name]) {
  4705. f = !1;
  4706. break b
  4707. } f = !0
  4708. }
  4709. if (f) a.name = b, a.attributes = {}, c.push({
  4710. check: "parent-down",
  4711. el: a
  4712. });
  4713. else {
  4714. f = a.parent;
  4715. for (var e = f.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || "body" == f.name, p, h, l = d.length; 0 < l;) w = d[--l], e && (w.type == CKEDITOR.NODE_TEXT || w.type == CKEDITOR.NODE_ELEMENT && q.$inline[w.name]) ? (p || (p = new CKEDITOR.htmlParser.element(b), p.insertAfter(a), c.push({
  4716. check: "parent-down",
  4717. el: p
  4718. })), p.add(w, 0)) : (p = null, h = q[f.name] || q.span, w.insertAfter(a), f.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || w.type != CKEDITOR.NODE_ELEMENT || h[w.name] || c.push({
  4719. check: "el-up",
  4720. el: w
  4721. }));
  4722. a.remove()
  4723. }
  4724. }
  4725. else d in {
  4726. style: 1,
  4727. script: 1
  4728. } ? a.remove() : (a.parent && c.push({
  4729. check: "it",
  4730. el: a.parent
  4731. }), a.replaceWithChildren())
  4732. }
  4733. function t(a, b, c) {
  4734. var d, f;
  4735. for (d = 0; d < c.length; ++d)
  4736. if (f = c[d], !(f.check && !a.check(f.check, !1) || f.left && !f.left(b))) {
  4737. f.right(b, G);
  4738. break
  4739. }
  4740. }
  4741. function F(a, b) {
  4742. var c = b.getDefinition(),
  4743. d = c.attributes,
  4744. f = c.styles,
  4745. e, l, w, p;
  4746. if (a.name != c.element) return !1;
  4747. for (e in d)
  4748. if ("class" == e)
  4749. for (c = d[e].split(/\s+/), w = a.classes.join("|"); p = c.pop();) {
  4750. if (-1 == w.indexOf(p)) return !1
  4751. } else if (a.attributes[e] != d[e]) return !1;
  4752. for (l in f)
  4753. if (a.styles[l] !=
  4754. f[l]) return !1;
  4755. return !0
  4756. }
  4757. function L(a, b) {
  4758. var c, d;
  4759. "string" == typeof a ? c = a : a instanceof CKEDITOR.style ? d = a : (c = a[0], d = a[1]);
  4760. return [{
  4761. element: c,
  4762. left: d,
  4763. right: function(a, c) {
  4764. c.transform(a, b)
  4765. }
  4766. }]
  4767. }
  4768. function C(a) {
  4769. return function(b) {
  4770. return F(b, a)
  4771. }
  4772. }
  4773. function M(a) {
  4774. return function(b, c) {
  4775. c[a](b)
  4776. }
  4777. }
  4778. var q = CKEDITOR.dtd,
  4779. E = CKEDITOR.tools.copy,
  4780. z = CKEDITOR.tools.trim,
  4781. H = ["", "p", "br", "div"];
  4782. CKEDITOR.FILTER_SKIP_TREE = 2;
  4783. CKEDITOR.filter = function(a) {
  4784. this.allowedContent = [];
  4785. this.disallowedContent = [];
  4786. this.elementCallbacks = null;
  4787. this.disabled = !1;
  4788. this.editor = null;
  4789. this.id = CKEDITOR.tools.getNextNumber();
  4790. this._ = {
  4791. allowedRules: {
  4792. elements: {},
  4793. generic: []
  4794. },
  4795. disallowedRules: {
  4796. elements: {},
  4797. generic: []
  4798. },
  4799. transformations: {},
  4800. cachedTests: {},
  4801. cachedChecks: {}
  4802. };
  4803. CKEDITOR.filter.instances[this.id] = this;
  4804. if (a instanceof CKEDITOR.editor) {
  4805. a = this.editor = a;
  4806. this.customConfig = !0;
  4807. var b = a.config.allowedContent;
  4808. !0 === b ? this.disabled = !0 : (b || (this.customConfig = !1), this.allow(b, "config", 1), this.allow(a.config.extraAllowedContent, "extra", 1), this.allow(H[a.enterMode] + " " + H[a.shiftEnterMode],
  4809. "default", 1), this.disallow(a.config.disallowedContent))
  4810. } else this.customConfig = !1, this.allow(a, "default", 1)
  4811. };
  4812. CKEDITOR.filter.instances = {};
  4813. CKEDITOR.filter.prototype = {
  4814. allow: function(b, c, d) {
  4815. if (!h(this, b, d)) return !1;
  4816. var f, l;
  4817. if ("string" == typeof b) b = e(b);
  4818. else if (b instanceof CKEDITOR.style) {
  4819. if (b.toAllowedContentRules) return this.allow(b.toAllowedContentRules(this.editor), c, d);
  4820. f = b.getDefinition();
  4821. b = {};
  4822. d = f.attributes;
  4823. b[f.element] = f = {
  4824. styles: f.styles,
  4825. requiredStyles: f.styles && CKEDITOR.tools.objectKeys(f.styles)
  4826. };
  4827. d && (d = E(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.objectKeys(d))
  4828. } else if (CKEDITOR.tools.isArray(b)) {
  4829. for (f = 0; f < b.length; ++f) l = this.allow(b[f], c, d);
  4830. return l
  4831. }
  4832. a(this, b, c, this.allowedContent, this._.allowedRules);
  4833. return !0
  4834. },
  4835. applyTo: function(a, b, c, d) {
  4836. if (this.disabled) return !1;
  4837. var f = this,
  4838. e = [],
  4839. w = this.editor && this.editor.config.protectedSource,
  4840. p, h = !1,
  4841. t = {
  4842. doFilter: !c,
  4843. doTransform: !0,
  4844. doCallbacks: !0,
  4845. toHtml: b
  4846. };
  4847. a.forEach(function(a) {
  4848. if (a.type == CKEDITOR.NODE_ELEMENT) {
  4849. if ("off" == a.attributes["data-cke-filter"]) return !1;
  4850. if (!b || "span" != a.name || !~CKEDITOR.tools.objectKeys(a.attributes).join("|").indexOf("data-cke-"))
  4851. if (p = B(f, a, e, t), p & 1) h = !0;
  4852. else if (p & 2) return !1
  4853. } else if (a.type == CKEDITOR.NODE_COMMENT && a.value.match(/^\{cke_protected\}(?!\{C\})/)) {
  4854. var c;
  4855. a: {
  4856. var d = decodeURIComponent(a.value.replace(/^\{cke_protected\}/, ""));c = [];
  4857. var l, m, q;
  4858. if (w)
  4859. for (m = 0; m < w.length; ++m)
  4860. if ((q = d.match(w[m])) && q[0].length == d.length) {
  4861. c = !0;
  4862. break a
  4863. } d = CKEDITOR.htmlParser.fragment.fromHtml(d);1 == d.children.length && (l = d.children[0]).type == CKEDITOR.NODE_ELEMENT && B(f, l, c, t);c = !c.length
  4864. }
  4865. c || e.push(a)
  4866. }
  4867. }, null, !0);
  4868. e.length && (h = !0);
  4869. var E;
  4870. a = [];
  4871. d = H[d || (this.editor ? this.editor.enterMode : CKEDITOR.ENTER_P)];
  4872. for (var z; c = e.pop();) c.type == CKEDITOR.NODE_ELEMENT ? l(c, d, a) : c.remove();
  4873. for (; E = a.pop();)
  4874. if (c = E.el, c.parent) switch (z = q[c.parent.name] || q.span, E.check) {
  4875. case "it":
  4876. q.$removeEmpty[c.name] && !c.children.length ? l(c, d, a) : m(c) || l(c, d, a);
  4877. break;
  4878. case "el-up":
  4879. c.parent.type ==
  4880. CKEDITOR.NODE_DOCUMENT_FRAGMENT || z[c.name] || l(c, d, a);
  4881. break;
  4882. case "parent-down":
  4883. c.parent.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || z[c.name] || l(c.parent, d, a)
  4884. }
  4885. return h
  4886. },
  4887. checkFeature: function(a) {
  4888. if (this.disabled || !a) return !0;
  4889. a.toFeature && (a = a.toFeature(this.editor));
  4890. return !a.requiredContent || this.check(a.requiredContent)
  4891. },
  4892. disable: function() {
  4893. this.disabled = !0
  4894. },
  4895. disallow: function(b) {
  4896. if (!h(this, b, !0)) return !1;
  4897. "string" == typeof b && (b = e(b));
  4898. a(this, b, null, this.disallowedContent, this._.disallowedRules);
  4899. return !0
  4900. },
  4901. addContentForms: function(a) {
  4902. if (!this.disabled && a) {
  4903. var b, c, d = [],
  4904. f;
  4905. for (b = 0; b < a.length && !f; ++b) c = a[b], ("string" == typeof c || c instanceof CKEDITOR.style) && this.check(c) && (f = c);
  4906. if (f) {
  4907. for (b = 0; b < a.length; ++b) d.push(L(a[b], f));
  4908. this.addTransformations(d)
  4909. }
  4910. }
  4911. },
  4912. addElementCallback: function(a) {
  4913. this.elementCallbacks || (this.elementCallbacks = []);
  4914. this.elementCallbacks.push(a)
  4915. },
  4916. addFeature: function(a) {
  4917. if (this.disabled || !a) return !0;
  4918. a.toFeature && (a = a.toFeature(this.editor));
  4919. this.allow(a.allowedContent, a.name);
  4920. this.addTransformations(a.contentTransformations);
  4921. this.addContentForms(a.contentForms);
  4922. return a.requiredContent && (this.customConfig || this.disallowedContent.length) ? this.check(a.requiredContent) : !0
  4923. },
  4924. addTransformations: function(a) {
  4925. var b, c;
  4926. if (!this.disabled && a) {
  4927. var d = this._.transformations,
  4928. f;
  4929. for (f = 0; f < a.length; ++f) {
  4930. b = a[f];
  4931. var e = void 0,
  4932. l = void 0,
  4933. w = void 0,
  4934. p = void 0,
  4935. h = void 0,
  4936. m = void 0;
  4937. c = [];
  4938. for (l = 0; l < b.length; ++l) w = b[l], "string" == typeof w ? (w = w.split(/\s*:\s*/), p = w[0], h = null, m = w[1]) : (p = w.check, h = w.left, m = w.right), e || (e = w, e = e.element ? e.element : p ? p.match(/^([a-z0-9]+)/i)[0] :
  4939. e.left.getDefinition().element), h instanceof CKEDITOR.style && (h = C(h)), c.push({
  4940. check: p == e ? null : p,
  4941. left: h,
  4942. right: "string" == typeof m ? M(m) : m
  4943. });
  4944. b = e;
  4945. d[b] || (d[b] = []);
  4946. d[b].push(c)
  4947. }
  4948. }
  4949. },
  4950. check: function(a, b, c) {
  4951. if (this.disabled) return !0;
  4952. if (CKEDITOR.tools.isArray(a)) {
  4953. for (var d = a.length; d--;)
  4954. if (this.check(a[d], b, c)) return !0;
  4955. return !1
  4956. }
  4957. var f, w;
  4958. if ("string" == typeof a) {
  4959. w = a + "\x3c" + (!1 === b ? "0" : "1") + (c ? "1" : "0") + "\x3e";
  4960. if (w in this._.cachedChecks) return this._.cachedChecks[w];
  4961. f = e(a).$1;
  4962. var l = f.styles,
  4963. d = f.classes;
  4964. f.name = f.elements;
  4965. f.classes = d = d ? d.split(/\s*,\s*/) : [];
  4966. f.styles = r(l);
  4967. f.attributes = r(f.attributes);
  4968. f.children = [];
  4969. d.length && (f.attributes["class"] = d.join(" "));
  4970. l && (f.attributes.style = CKEDITOR.tools.writeCssText(f.styles))
  4971. } else f = a.getDefinition(), l = f.styles, d = f.attributes || {}, l && !CKEDITOR.tools.isEmpty(l) ? (l = E(l), d.style = CKEDITOR.tools.writeCssText(l, !0)) : l = {}, f = {
  4972. name: f.element,
  4973. attributes: d,
  4974. classes: d["class"] ? d["class"].split(/\s+/) : [],
  4975. styles: l,
  4976. children: []
  4977. };
  4978. var l = CKEDITOR.tools.clone(f),
  4979. p = [],
  4980. h;
  4981. if (!1 !== b && (h = this._.transformations[f.name])) {
  4982. for (d =
  4983. 0; d < h.length; ++d) t(this, f, h[d]);
  4984. x(f)
  4985. }
  4986. B(this, l, p, {
  4987. doFilter: !0,
  4988. doTransform: !1 !== b,
  4989. skipRequired: !c,
  4990. skipFinalValidation: !c
  4991. });
  4992. 0 < p.length ? c = !1 : ((b = f.attributes["class"]) && (f.attributes["class"] = f.attributes["class"].split(" ").sort().join(" ")), c = CKEDITOR.tools.objectCompare(f.attributes, l.attributes, !0), b && (f.attributes["class"] = b));
  4993. "string" == typeof a && (this._.cachedChecks[w] = c);
  4994. return c
  4995. },
  4996. getAllowedEnterMode: function() {
  4997. var a = ["p", "div", "br"],
  4998. b = {
  4999. p: CKEDITOR.ENTER_P,
  5000. div: CKEDITOR.ENTER_DIV,
  5001. br: CKEDITOR.ENTER_BR
  5002. };
  5003. return function(c, d) {
  5004. var f = a.slice(),
  5005. e;
  5006. if (this.check(H[c])) return c;
  5007. for (d || (f = f.reverse()); e = f.pop();)
  5008. if (this.check(e)) return b[e];
  5009. return CKEDITOR.ENTER_BR
  5010. }
  5011. }(),
  5012. clone: function() {
  5013. var a = new CKEDITOR.filter,
  5014. b = CKEDITOR.tools.clone;
  5015. a.allowedContent = b(this.allowedContent);
  5016. a._.allowedRules = b(this._.allowedRules);
  5017. a.disallowedContent = b(this.disallowedContent);
  5018. a._.disallowedRules = b(this._.disallowedRules);
  5019. a._.transformations = b(this._.transformations);
  5020. a.disabled = this.disabled;
  5021. a.editor = this.editor;
  5022. return a
  5023. },
  5024. destroy: function() {
  5025. delete CKEDITOR.filter.instances[this.id];
  5026. delete this._;
  5027. delete this.allowedContent;
  5028. delete this.disallowedContent
  5029. }
  5030. };
  5031. var P = {
  5032. styles: 1,
  5033. attributes: 1,
  5034. classes: 1
  5035. },
  5036. O = {
  5037. styles: "requiredStyles",
  5038. attributes: "requiredAttributes",
  5039. classes: "requiredClasses"
  5040. },
  5041. p = /^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,
  5042. N = {
  5043. styles: /{([^}]+)}/,
  5044. attrs: /\[([^\]]+)\]/,
  5045. classes: /\(([^\)]+)\)/
  5046. },
  5047. w = /^cke:(object|embed|param)$/,
  5048. A = /^(object|embed|param)$/,
  5049. G;
  5050. G = CKEDITOR.filter.transformationsTools = {
  5051. sizeToStyle: function(a) {
  5052. this.lengthToStyle(a,
  5053. "width");
  5054. this.lengthToStyle(a, "height")
  5055. },
  5056. sizeToAttribute: function(a) {
  5057. this.lengthToAttribute(a, "width");
  5058. this.lengthToAttribute(a, "height")
  5059. },
  5060. lengthToStyle: function(a, b, c) {
  5061. c = c || b;
  5062. if (!(c in a.styles)) {
  5063. var d = a.attributes[b];
  5064. d && (/^\d+$/.test(d) && (d += "px"), a.styles[c] = d)
  5065. }
  5066. delete a.attributes[b]
  5067. },
  5068. lengthToAttribute: function(a, b, c) {
  5069. c = c || b;
  5070. if (!(c in a.attributes)) {
  5071. var d = a.styles[b],
  5072. f = d && d.match(/^(\d+)(?:\.\d*)?px$/);
  5073. f ? a.attributes[c] = f[1] : "cke-test" == d && (a.attributes[c] = "cke-test")
  5074. }
  5075. delete a.styles[b]
  5076. },
  5077. alignmentToStyle: function(a) {
  5078. if (!("float" in
  5079. a.styles)) {
  5080. var b = a.attributes.align;
  5081. if ("left" == b || "right" == b) a.styles["float"] = b
  5082. }
  5083. delete a.attributes.align
  5084. },
  5085. alignmentToAttribute: function(a) {
  5086. if (!("align" in a.attributes)) {
  5087. var b = a.styles["float"];
  5088. if ("left" == b || "right" == b) a.attributes.align = b
  5089. }
  5090. delete a.styles["float"]
  5091. },
  5092. splitBorderShorthand: function(a) {
  5093. if (a.styles.border) {
  5094. var b = CKEDITOR.tools.style.parse.border(a.styles.border);
  5095. b.color && (a.styles["border-color"] = b.color);
  5096. b.style && (a.styles["border-style"] = b.style);
  5097. b.width && (a.styles["border-width"] = b.width);
  5098. delete a.styles.border
  5099. }
  5100. },
  5101. listTypeToStyle: function(a) {
  5102. if (a.attributes.type) switch (a.attributes.type) {
  5103. case "a":
  5104. a.styles["list-style-type"] = "lower-alpha";
  5105. break;
  5106. case "A":
  5107. a.styles["list-style-type"] = "upper-alpha";
  5108. break;
  5109. case "i":
  5110. a.styles["list-style-type"] = "lower-roman";
  5111. break;
  5112. case "I":
  5113. a.styles["list-style-type"] = "upper-roman";
  5114. break;
  5115. case "1":
  5116. a.styles["list-style-type"] = "decimal";
  5117. break;
  5118. default:
  5119. a.styles["list-style-type"] = a.attributes.type
  5120. }
  5121. },
  5122. splitMarginShorthand: function(a) {
  5123. function b(d) {
  5124. a.styles["margin-top"] =
  5125. c[d[0]];
  5126. a.styles["margin-right"] = c[d[1]];
  5127. a.styles["margin-bottom"] = c[d[2]];
  5128. a.styles["margin-left"] = c[d[3]]
  5129. }
  5130. if (a.styles.margin) {
  5131. var c = a.styles.margin.match(/(\-?[\.\d]+\w+)/g) || ["0px"];
  5132. switch (c.length) {
  5133. case 1:
  5134. b([0, 0, 0, 0]);
  5135. break;
  5136. case 2:
  5137. b([0, 1, 0, 1]);
  5138. break;
  5139. case 3:
  5140. b([0, 1, 2, 1]);
  5141. break;
  5142. case 4:
  5143. b([0, 1, 2, 3])
  5144. }
  5145. delete a.styles.margin
  5146. }
  5147. },
  5148. matchesStyle: F,
  5149. transform: function(a, b) {
  5150. if ("string" == typeof b) a.name = b;
  5151. else {
  5152. var c = b.getDefinition(),
  5153. d = c.styles,
  5154. f = c.attributes,
  5155. e, l, w, p;
  5156. a.name = c.element;
  5157. for (e in f)
  5158. if ("class" == e)
  5159. for (c =
  5160. a.classes.join("|"), w = f[e].split(/\s+/); p = w.pop();) - 1 == c.indexOf(p) && a.classes.push(p);
  5161. else a.attributes[e] = f[e];
  5162. for (l in d) a.styles[l] = d[l]
  5163. }
  5164. }
  5165. }
  5166. })();
  5167. (function() {
  5168. CKEDITOR.focusManager = function(a) {
  5169. if (a.focusManager) return a.focusManager;
  5170. this.hasFocus = !1;
  5171. this.currentActive = null;
  5172. this._ = {
  5173. editor: a
  5174. };
  5175. return this
  5176. };
  5177. CKEDITOR.focusManager._ = {
  5178. blurDelay: 200
  5179. };
  5180. CKEDITOR.focusManager.prototype = {
  5181. focus: function(a) {
  5182. this._.timer && clearTimeout(this._.timer);
  5183. a && (this.currentActive = a);
  5184. 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"))
  5185. },
  5186. lock: function() {
  5187. this._.locked =
  5188. 1
  5189. },
  5190. unlock: function() {
  5191. delete this._.locked
  5192. },
  5193. blur: function(a) {
  5194. function d() {
  5195. if (this.hasFocus) {
  5196. this.hasFocus = !1;
  5197. var a = this._.editor.container;
  5198. a && a.removeClass("cke_focus");
  5199. this._.editor.fire("blur")
  5200. }
  5201. }
  5202. if (!this._.locked) {
  5203. this._.timer && clearTimeout(this._.timer);
  5204. var b = CKEDITOR.focusManager._.blurDelay;
  5205. a || !b ? d.call(this) : this._.timer = CKEDITOR.tools.setTimeout(function() {
  5206. delete this._.timer;
  5207. d.call(this)
  5208. }, b, this)
  5209. }
  5210. },
  5211. add: function(a, d) {
  5212. var b = a.getCustomData("focusmanager");
  5213. if (!b || b != this) {
  5214. b && b.remove(a);
  5215. var b =
  5216. "focus",
  5217. c = "blur";
  5218. d && (CKEDITOR.env.ie ? (b = "focusin", c = "focusout") : CKEDITOR.event.useCapture = 1);
  5219. var f = {
  5220. blur: function() {
  5221. a.equals(this.currentActive) && this.blur()
  5222. },
  5223. focus: function() {
  5224. this.focus(a)
  5225. }
  5226. };
  5227. a.on(b, f.focus, this);
  5228. a.on(c, f.blur, this);
  5229. d && (CKEDITOR.event.useCapture = 0);
  5230. a.setCustomData("focusmanager", this);
  5231. a.setCustomData("focusmanager_handlers", f)
  5232. }
  5233. },
  5234. remove: function(a) {
  5235. a.removeCustomData("focusmanager");
  5236. var d = a.removeCustomData("focusmanager_handlers");
  5237. a.removeListener("blur", d.blur);
  5238. a.removeListener("focus",
  5239. d.focus)
  5240. }
  5241. }
  5242. })();
  5243. CKEDITOR.keystrokeHandler = function(a) {
  5244. if (a.keystrokeHandler) return a.keystrokeHandler;
  5245. this.keystrokes = {};
  5246. this.blockedKeystrokes = {};
  5247. this._ = {
  5248. editor: a
  5249. };
  5250. return this
  5251. };
  5252. (function() {
  5253. var a, d = function(b) {
  5254. b = b.data;
  5255. var d = b.getKeystroke(),
  5256. h = this.keystrokes[d],
  5257. k = this._.editor;
  5258. a = !1 === k.fire("key", {
  5259. keyCode: d,
  5260. domEvent: b
  5261. });
  5262. a || (h && (a = !1 !== k.execCommand(h, {
  5263. from: "keystrokeHandler"
  5264. })), a || (a = !!this.blockedKeystrokes[d]));
  5265. a && b.preventDefault(!0);
  5266. return !a
  5267. },
  5268. b = function(b) {
  5269. a && (a = !1, b.data.preventDefault(!0))
  5270. };
  5271. CKEDITOR.keystrokeHandler.prototype = {
  5272. attach: function(a) {
  5273. a.on("keydown", d, this);
  5274. if (CKEDITOR.env.gecko && CKEDITOR.env.mac) a.on("keypress", b, this)
  5275. }
  5276. }
  5277. })();
  5278. (function() {
  5279. CKEDITOR.lang = {
  5280. languages: {
  5281. af: 1,
  5282. ar: 1,
  5283. az: 1,
  5284. bg: 1,
  5285. bn: 1,
  5286. bs: 1,
  5287. ca: 1,
  5288. cs: 1,
  5289. cy: 1,
  5290. da: 1,
  5291. de: 1,
  5292. "de-ch": 1,
  5293. el: 1,
  5294. "en-au": 1,
  5295. "en-ca": 1,
  5296. "en-gb": 1,
  5297. en: 1,
  5298. eo: 1,
  5299. es: 1,
  5300. "es-mx": 1,
  5301. et: 1,
  5302. eu: 1,
  5303. fa: 1,
  5304. fi: 1,
  5305. fo: 1,
  5306. "fr-ca": 1,
  5307. fr: 1,
  5308. gl: 1,
  5309. gu: 1,
  5310. he: 1,
  5311. hi: 1,
  5312. hr: 1,
  5313. hu: 1,
  5314. id: 1,
  5315. is: 1,
  5316. it: 1,
  5317. ja: 1,
  5318. ka: 1,
  5319. km: 1,
  5320. ko: 1,
  5321. ku: 1,
  5322. lt: 1,
  5323. lv: 1,
  5324. mk: 1,
  5325. mn: 1,
  5326. ms: 1,
  5327. nb: 1,
  5328. nl: 1,
  5329. no: 1,
  5330. oc: 1,
  5331. pl: 1,
  5332. "pt-br": 1,
  5333. pt: 1,
  5334. ro: 1,
  5335. ru: 1,
  5336. si: 1,
  5337. sk: 1,
  5338. sl: 1,
  5339. sq: 1,
  5340. "sr-latn": 1,
  5341. sr: 1,
  5342. sv: 1,
  5343. th: 1,
  5344. tr: 1,
  5345. tt: 1,
  5346. ug: 1,
  5347. uk: 1,
  5348. vi: 1,
  5349. "zh-cn": 1,
  5350. zh: 1
  5351. },
  5352. rtl: {
  5353. ar: 1,
  5354. fa: 1,
  5355. he: 1,
  5356. ku: 1,
  5357. ug: 1
  5358. },
  5359. load: function(a, d, b) {
  5360. a && CKEDITOR.lang.languages[a] ||
  5361. (a = this.detect(d, a));
  5362. var c = this;
  5363. d = function() {
  5364. c[a].dir = c.rtl[a] ? "rtl" : "ltr";
  5365. b(a, c[a])
  5366. };
  5367. this[a] ? d() : CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/" + a + ".js"), d, this)
  5368. },
  5369. detect: function(a, d) {
  5370. var b = this.languages;
  5371. d = d || navigator.userLanguage || navigator.language || a;
  5372. var c = d.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),
  5373. f = c[1],
  5374. c = c[2];
  5375. b[f + "-" + c] ? f = f + "-" + c : b[f] || (f = null);
  5376. CKEDITOR.lang.detect = f ? function() {
  5377. return f
  5378. } : function(a) {
  5379. return a
  5380. };
  5381. return f || a
  5382. }
  5383. }
  5384. })();
  5385. CKEDITOR.scriptLoader = function() {
  5386. var a = {},
  5387. d = {};
  5388. return {
  5389. load: function(b, c, f, h) {
  5390. var k = "string" == typeof b;
  5391. k && (b = [b]);
  5392. f || (f = CKEDITOR);
  5393. var g = b.length,
  5394. n = [],
  5395. r = [],
  5396. e = function(a) {
  5397. c && (k ? c.call(f, a) : c.call(f, n, r))
  5398. };
  5399. if (0 === g) e(!0);
  5400. else {
  5401. var y = function(a, b) {
  5402. (b ? n : r).push(a);
  5403. 0 >= --g && (h && CKEDITOR.document.getDocumentElement().removeStyle("cursor"), e(b))
  5404. },
  5405. v = function(b, c) {
  5406. a[b] = 1;
  5407. var f = d[b];
  5408. delete d[b];
  5409. for (var e = 0; e < f.length; e++) f[e](b, c)
  5410. },
  5411. B = function(b) {
  5412. if (a[b]) y(b, !0);
  5413. else {
  5414. var f = d[b] || (d[b] = []);
  5415. f.push(y);
  5416. if (!(1 < f.length)) {
  5417. var e =
  5418. new CKEDITOR.dom.element("script");
  5419. e.setAttributes({
  5420. type: "text/javascript",
  5421. src: b
  5422. });
  5423. c && (CKEDITOR.env.ie && (8 >= CKEDITOR.env.version || CKEDITOR.env.ie9Compat) ? e.$.onreadystatechange = function() {
  5424. if ("loaded" == e.$.readyState || "complete" == e.$.readyState) e.$.onreadystatechange = null, v(b, !0)
  5425. } : (e.$.onload = function() {
  5426. setTimeout(function() {
  5427. v(b, !0)
  5428. }, 0)
  5429. }, e.$.onerror = function() {
  5430. v(b, !1)
  5431. }));
  5432. e.appendTo(CKEDITOR.document.getHead())
  5433. }
  5434. }
  5435. };
  5436. h && CKEDITOR.document.getDocumentElement().setStyle("cursor", "wait");
  5437. for (var D = 0; D < g; D++) B(b[D])
  5438. }
  5439. },
  5440. queue: function() {
  5441. function a() {
  5442. var b;
  5443. (b = c[0]) && this.load(b.scriptUrl, b.callback, CKEDITOR, 0)
  5444. }
  5445. var c = [];
  5446. return function(d, h) {
  5447. var k = this;
  5448. c.push({
  5449. scriptUrl: d,
  5450. callback: function() {
  5451. h && h.apply(this, arguments);
  5452. c.shift();
  5453. a.call(k)
  5454. }
  5455. });
  5456. 1 == c.length && a.call(this)
  5457. }
  5458. }()
  5459. }
  5460. }();
  5461. CKEDITOR.resourceManager = function(a, d) {
  5462. this.basePath = a;
  5463. this.fileName = d;
  5464. this.registered = {};
  5465. this.loaded = {};
  5466. this.externals = {};
  5467. this._ = {
  5468. waitingList: {}
  5469. }
  5470. };
  5471. CKEDITOR.resourceManager.prototype = {
  5472. add: function(a, d) {
  5473. if (this.registered[a]) throw Error('[CKEDITOR.resourceManager.add] The resource name "' + a + '" is already registered.');
  5474. var b = this.registered[a] = d || {};
  5475. b.name = a;
  5476. b.path = this.getPath(a);
  5477. CKEDITOR.fire(a + CKEDITOR.tools.capitalize(this.fileName) + "Ready", b);
  5478. return this.get(a)
  5479. },
  5480. get: function(a) {
  5481. return this.registered[a] || null
  5482. },
  5483. getPath: function(a) {
  5484. var d = this.externals[a];
  5485. return CKEDITOR.getUrl(d && d.dir || this.basePath + a + "/")
  5486. },
  5487. getFilePath: function(a) {
  5488. var d = this.externals[a];
  5489. return CKEDITOR.getUrl(this.getPath(a) + (d ? d.file : this.fileName + ".js"))
  5490. },
  5491. addExternal: function(a, d, b) {
  5492. a = a.split(",");
  5493. for (var c = 0; c < a.length; c++) {
  5494. var f = a[c];
  5495. b || (d = d.replace(/[^\/]+$/, function(a) {
  5496. b = a;
  5497. return ""
  5498. }));
  5499. this.externals[f] = {
  5500. dir: d,
  5501. file: b || this.fileName + ".js"
  5502. }
  5503. }
  5504. },
  5505. load: function(a, d, b) {
  5506. CKEDITOR.tools.isArray(a) || (a = a ? [a] : []);
  5507. for (var c = this.loaded, f = this.registered, h = [], k = {}, g = {}, n = 0; n < a.length; n++) {
  5508. var r = a[n];
  5509. if (r)
  5510. if (c[r] || f[r]) g[r] = this.get(r);
  5511. else {
  5512. var e = this.getFilePath(r);
  5513. h.push(e);
  5514. e in k || (k[e] = []);
  5515. k[e].push(r)
  5516. }
  5517. }
  5518. CKEDITOR.scriptLoader.load(h, function(a, f) {
  5519. if (f.length) throw Error('[CKEDITOR.resourceManager.load] Resource name "' + k[f[0]].join(",") + '" was not found at "' + f[0] + '".');
  5520. for (var e = 0; e < a.length; e++)
  5521. for (var h = k[a[e]], n = 0; n < h.length; n++) {
  5522. var m = h[n];
  5523. g[m] = this.get(m);
  5524. c[m] = 1
  5525. }
  5526. d.call(b, g)
  5527. }, this)
  5528. }
  5529. };
  5530. CKEDITOR.plugins = new CKEDITOR.resourceManager("plugins/", "plugin");
  5531. CKEDITOR.plugins.load = CKEDITOR.tools.override(CKEDITOR.plugins.load, function(a) {
  5532. var d = {};
  5533. return function(b, c, f) {
  5534. var h = {},
  5535. k = function(b) {
  5536. a.call(this, b, function(a) {
  5537. CKEDITOR.tools.extend(h, a);
  5538. var b = [],
  5539. e;
  5540. for (e in a) {
  5541. var g = a[e],
  5542. v = g && g.requires;
  5543. if (!d[e]) {
  5544. if (g.icons)
  5545. for (var B = g.icons.split(","), D = B.length; D--;) CKEDITOR.skin.addIcon(B[D], g.path + "icons/" + (CKEDITOR.env.hidpi && g.hidpi ? "hidpi/" : "") + B[D] + ".png");
  5546. d[e] = 1
  5547. }
  5548. if (v)
  5549. for (v.split && (v = v.split(",")), g = 0; g < v.length; g++) h[v[g]] || b.push(v[g])
  5550. }
  5551. if (b.length) k.call(this,
  5552. b);
  5553. else {
  5554. for (e in h) g = h[e], g.onLoad && !g.onLoad._called && (!1 === g.onLoad() && delete h[e], g.onLoad._called = 1);
  5555. c && c.call(f || window, h)
  5556. }
  5557. }, this)
  5558. };
  5559. k.call(this, b)
  5560. }
  5561. });
  5562. CKEDITOR.plugins.setLang = function(a, d, b) {
  5563. var c = this.get(a);
  5564. a = c.langEntries || (c.langEntries = {});
  5565. c = c.lang || (c.lang = []);
  5566. c.split && (c = c.split(",")); - 1 == CKEDITOR.tools.indexOf(c, d) && c.push(d);
  5567. a[d] = b
  5568. };
  5569. CKEDITOR.ui = function(a) {
  5570. if (a.ui) return a.ui;
  5571. this.items = {};
  5572. this.instances = {};
  5573. this.editor = a;
  5574. this._ = {
  5575. handlers: {}
  5576. };
  5577. return this
  5578. };
  5579. CKEDITOR.ui.prototype = {
  5580. add: function(a, d, b) {
  5581. b.name = a.toLowerCase();
  5582. var c = this.items[a] = {
  5583. type: d,
  5584. command: b.command || null,
  5585. args: Array.prototype.slice.call(arguments, 2)
  5586. };
  5587. CKEDITOR.tools.extend(c, b)
  5588. },
  5589. get: function(a) {
  5590. return this.instances[a]
  5591. },
  5592. create: function(a) {
  5593. var d = this.items[a],
  5594. b = d && this._.handlers[d.type],
  5595. c = d && d.command && this.editor.getCommand(d.command),
  5596. b = b && b.create.apply(this, d.args);
  5597. this.instances[a] = b;
  5598. c && c.uiItems.push(b);
  5599. b && !b.type && (b.type = d.type);
  5600. return b
  5601. },
  5602. addHandler: function(a, d) {
  5603. this._.handlers[a] =
  5604. d
  5605. },
  5606. space: function(a) {
  5607. return CKEDITOR.document.getById(this.spaceId(a))
  5608. },
  5609. spaceId: function(a) {
  5610. return this.editor.id + "_" + a
  5611. }
  5612. };
  5613. CKEDITOR.event.implementOn(CKEDITOR.ui);
  5614. (function() {
  5615. function a(a, f, e) {
  5616. CKEDITOR.event.call(this);
  5617. a = a && CKEDITOR.tools.clone(a);
  5618. if (void 0 !== f) {
  5619. if (!(f instanceof CKEDITOR.dom.element)) throw Error("Expect element of type CKEDITOR.dom.element.");
  5620. if (!e) throw Error("One of the element modes must be specified.");
  5621. if (CKEDITOR.env.ie && CKEDITOR.env.quirks && e == CKEDITOR.ELEMENT_MODE_INLINE) throw Error("Inline element mode is not supported on IE quirks.");
  5622. if (!b(f, e)) throw Error('The specified element mode is not supported on element: "' + f.getName() + '".');
  5623. this.element = f;
  5624. this.elementMode = e;
  5625. this.name = this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO && (f.getId() || f.getNameAtt())
  5626. } else this.elementMode = CKEDITOR.ELEMENT_MODE_NONE;
  5627. this._ = {};
  5628. this.commands = {};
  5629. this.templates = {};
  5630. this.name = this.name || d();
  5631. this.id = CKEDITOR.tools.getNextId();
  5632. this.status = "unloaded";
  5633. this.config = CKEDITOR.tools.prototypedCopy(CKEDITOR.config);
  5634. this.ui = new CKEDITOR.ui(this);
  5635. this.focusManager = new CKEDITOR.focusManager(this);
  5636. this.keystrokeHandler = new CKEDITOR.keystrokeHandler(this);
  5637. this.on("readOnly",
  5638. c);
  5639. this.on("selectionChange", function(a) {
  5640. h(this, a.data.path)
  5641. });
  5642. this.on("activeFilterChange", function() {
  5643. h(this, this.elementPath(), !0)
  5644. });
  5645. this.on("mode", c);
  5646. this.on("instanceReady", function() {
  5647. if (this.config.startupFocus) {
  5648. if ("end" === this.config.startupFocus) {
  5649. var a = this.createRange();
  5650. a.selectNodeContents(this.editable());
  5651. a.shrink(CKEDITOR.SHRINK_ELEMENT, !0);
  5652. a.collapse();
  5653. this.getSelection().selectRanges([a])
  5654. }
  5655. this.focus()
  5656. }
  5657. });
  5658. CKEDITOR.fire("instanceCreated", null, this);
  5659. CKEDITOR.add(this);
  5660. CKEDITOR.tools.setTimeout(function() {
  5661. "destroyed" !==
  5662. this.status ? g(this, a) : CKEDITOR.warn("editor-incorrect-destroy")
  5663. }, 0, this)
  5664. }
  5665. function d() {
  5666. do var a = "editor" + ++D; while (CKEDITOR.instances[a]);
  5667. return a
  5668. }
  5669. function b(a, b) {
  5670. 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
  5671. }
  5672. function c() {
  5673. var a = this.commands,
  5674. b;
  5675. for (b in a) f(this, a[b])
  5676. }
  5677. function f(a, b) {
  5678. b[b.startDisabled ? "disable" : a.readOnly && !b.readOnly ? "disable" : b.modes[a.mode] ? "enable" : "disable"]()
  5679. }
  5680. function h(a,
  5681. b, c) {
  5682. if (b) {
  5683. var d, f, e = a.commands;
  5684. for (f in e) d = e[f], (c || d.contextSensitive) && d.refresh(a, b)
  5685. }
  5686. }
  5687. function k(a) {
  5688. var b = a.config.customConfig;
  5689. if (!b) return !1;
  5690. var b = CKEDITOR.getUrl(b),
  5691. c = x[b] || (x[b] = {});
  5692. c.fn ? (c.fn.call(a, a.config), CKEDITOR.getUrl(a.config.customConfig) != b && k(a) || a.fireOnce("customConfigLoaded")) : CKEDITOR.scriptLoader.queue(b, function() {
  5693. c.fn = CKEDITOR.editorConfig ? CKEDITOR.editorConfig : function() {};
  5694. k(a)
  5695. });
  5696. return !0
  5697. }
  5698. function g(a, b) {
  5699. a.on("customConfigLoaded", function() {
  5700. if (b) {
  5701. if (b.on)
  5702. for (var c in b.on) a.on(c,
  5703. b.on[c]);
  5704. CKEDITOR.tools.extend(a.config, b, !0);
  5705. delete a.config.on
  5706. }
  5707. c = a.config;
  5708. 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;
  5709. a.blockless = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? !(a.element.is("textarea") || CKEDITOR.dtd[a.element.getName()].p) :
  5710. !1;
  5711. a.tabIndex = c.tabIndex || a.element && a.element.getAttribute("tabindex") || 0;
  5712. a.activeEnterMode = a.enterMode = a.blockless ? CKEDITOR.ENTER_BR : c.enterMode;
  5713. a.activeShiftEnterMode = a.shiftEnterMode = a.blockless ? CKEDITOR.ENTER_BR : c.shiftEnterMode;
  5714. c.skin && (CKEDITOR.skinName = c.skin);
  5715. a.fireOnce("configLoaded");
  5716. a.dataProcessor = new CKEDITOR.htmlDataProcessor(a);
  5717. a.filter = a.activeFilter = new CKEDITOR.filter(a);
  5718. n(a)
  5719. });
  5720. b && null != b.customConfig && (a.config.customConfig = b.customConfig);
  5721. k(a) || a.fireOnce("customConfigLoaded")
  5722. }
  5723. function n(a) {
  5724. CKEDITOR.skin.loadPart("editor", function() {
  5725. r(a)
  5726. })
  5727. }
  5728. function r(a) {
  5729. CKEDITOR.lang.load(a.config.language, a.config.defaultLanguage, function(b, c) {
  5730. var d = a.config.title;
  5731. a.langCode = b;
  5732. a.lang = CKEDITOR.tools.prototypedCopy(c);
  5733. a.title = "string" == typeof d || !1 === d ? d : [a.lang.editor, a.name].join(", ");
  5734. a.config.contentsLangDirection || (a.config.contentsLangDirection = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.element.getDirection(1) : a.lang.dir);
  5735. a.fire("langLoaded");
  5736. e(a)
  5737. })
  5738. }
  5739. function e(a) {
  5740. a.getStylesSet(function(b) {
  5741. a.once("loaded",
  5742. function() {
  5743. a.fire("stylesSet", {
  5744. styles: b
  5745. })
  5746. }, null, null, 1);
  5747. y(a)
  5748. })
  5749. }
  5750. function y(a) {
  5751. function b(a) {
  5752. if (!a) return "";
  5753. CKEDITOR.tools.isArray(a) && (a = a.join(","));
  5754. return a.replace(/\s/g, "")
  5755. }
  5756. var c = a.config,
  5757. d = b(c.plugins),
  5758. f = b(c.extraPlugins),
  5759. e = b(c.removePlugins);
  5760. if (f) var h = new RegExp("(?:^|,)(?:" + f.replace(/,/g, "|") + ")(?\x3d,|$)", "g"),
  5761. d = d.replace(h, ""),
  5762. d = d + ("," + f);
  5763. if (e) var g = new RegExp("(?:^|,)(?:" + e.replace(/,/g, "|") + ")(?\x3d,|$)", "g"),
  5764. d = d.replace(g, "");
  5765. CKEDITOR.env.air && (d += ",adobeair");
  5766. CKEDITOR.plugins.load(d.split(","),
  5767. function(b) {
  5768. var d = [],
  5769. f = [],
  5770. e = [];
  5771. a.plugins = CKEDITOR.tools.extend({}, a.plugins, b);
  5772. for (var l in b) {
  5773. var h = b[l],
  5774. t = h.lang,
  5775. k = null,
  5776. p = h.requires,
  5777. F;
  5778. CKEDITOR.tools.isArray(p) && (p = p.join(","));
  5779. if (p && (F = p.match(g)))
  5780. for (; p = F.pop();) CKEDITOR.error("editor-plugin-required", {
  5781. plugin: p.replace(",", ""),
  5782. requiredBy: l
  5783. });
  5784. t && !a.lang[l] && (t.split && (t = t.split(",")), 0 <= CKEDITOR.tools.indexOf(t, a.langCode) ? k = a.langCode : (k = a.langCode.replace(/-.*/, ""), k = k != a.langCode && 0 <= CKEDITOR.tools.indexOf(t, k) ? k : 0 <= CKEDITOR.tools.indexOf(t,
  5785. "en") ? "en" : t[0]), h.langEntries && h.langEntries[k] ? (a.lang[l] = h.langEntries[k], k = null) : e.push(CKEDITOR.getUrl(h.path + "lang/" + k + ".js")));
  5786. f.push(k);
  5787. d.push(h)
  5788. }
  5789. CKEDITOR.scriptLoader.load(e, function() {
  5790. for (var b = ["beforeInit", "init", "afterInit"], e = 0; e < b.length; e++)
  5791. for (var l = 0; l < d.length; l++) {
  5792. var p = d[l];
  5793. 0 === e && f[l] && p.lang && p.langEntries && (a.lang[p.name] = p.langEntries[f[l]]);
  5794. if (p[b[e]]) p[b[e]](a)
  5795. }
  5796. a.fireOnce("pluginsLoaded");
  5797. c.keystrokes && a.setKeystroke(a.config.keystrokes);
  5798. for (l = 0; l < a.config.blockedKeystrokes.length; l++) a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[l]] =
  5799. 1;
  5800. a.status = "loaded";
  5801. a.fireOnce("loaded");
  5802. CKEDITOR.fire("instanceLoaded", null, a)
  5803. })
  5804. })
  5805. }
  5806. function v() {
  5807. var a = this.element;
  5808. if (a && this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO) {
  5809. var b = this.getData();
  5810. this.config.htmlEncodeOutput && (b = CKEDITOR.tools.htmlEncode(b));
  5811. a.is("textarea") ? a.setValue(b) : a.setHtml(b);
  5812. return !0
  5813. }
  5814. return !1
  5815. }
  5816. function B(a, b) {
  5817. function c(a) {
  5818. var b = a.startContainer,
  5819. d = a.endContainer;
  5820. return b.is && (b.is("tr") || b.is("td") && b.equals(d) && a.endOffset === b.getChildCount()) ? !0 : !1
  5821. }
  5822. function d(a) {
  5823. var b = a.startContainer;
  5824. return b.is("tr") ? a.cloneContents() : b.clone(!0)
  5825. }
  5826. for (var f = new CKEDITOR.dom.documentFragment, e, h, g, k = 0; k < a.length; k++) {
  5827. var M = a[k],
  5828. q = M.startContainer.getAscendant("tr", !0);
  5829. c(M) ? (e || (e = q.getAscendant("table").clone(), e.append(q.getAscendant({
  5830. thead: 1,
  5831. tbody: 1,
  5832. tfoot: 1
  5833. }).clone()), f.append(e), e = e.findOne("thead, tbody, tfoot")), h && h.equals(q) || (h = q, g = q.clone(), e.append(g)), g.append(d(M))) : f.append(M.cloneContents())
  5834. }
  5835. return e ? f : b.getHtmlFromRange(a[0])
  5836. }
  5837. a.prototype = CKEDITOR.editor.prototype;
  5838. CKEDITOR.editor =
  5839. a;
  5840. var D = 0,
  5841. x = {};
  5842. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  5843. plugins: {
  5844. detectConflict: function(a, b) {
  5845. for (var c = 0; c < b.length; c++) {
  5846. var d = b[c];
  5847. if (this[d]) return CKEDITOR.warn("editor-plugin-conflict", {
  5848. plugin: a,
  5849. replacedWith: d
  5850. }), !0
  5851. }
  5852. return !1
  5853. }
  5854. },
  5855. addCommand: function(a, b) {
  5856. b.name = a.toLowerCase();
  5857. var c = b instanceof CKEDITOR.command ? b : new CKEDITOR.command(this, b);
  5858. this.mode && f(this, c);
  5859. return this.commands[a] = c
  5860. },
  5861. _attachToForm: function() {
  5862. function a(b) {
  5863. c.updateElement();
  5864. c._.required && !d.getValue() && !1 === c.fire("required") &&
  5865. b.data.preventDefault()
  5866. }
  5867. function b(a) {
  5868. return !!(a && a.call && a.apply)
  5869. }
  5870. var c = this,
  5871. d = c.element,
  5872. f = new CKEDITOR.dom.element(d.$.form);
  5873. d.is("textarea") && f && (f.on("submit", a), b(f.$.submit) && (f.$.submit = CKEDITOR.tools.override(f.$.submit, function(b) {
  5874. return function() {
  5875. a();
  5876. b.apply ? b.apply(this) : b()
  5877. }
  5878. })), c.on("destroy", function() {
  5879. f.removeListener("submit", a)
  5880. }))
  5881. },
  5882. destroy: function(a) {
  5883. this.fire("beforeDestroy");
  5884. !a && v.call(this);
  5885. this.editable(null);
  5886. this.filter && (this.filter.destroy(), delete this.filter);
  5887. delete this.activeFilter;
  5888. this.status = "destroyed";
  5889. this.fire("destroy");
  5890. this.removeAllListeners();
  5891. CKEDITOR.remove(this);
  5892. CKEDITOR.fire("instanceDestroyed", null, this)
  5893. },
  5894. elementPath: function(a) {
  5895. if (!a) {
  5896. a = this.getSelection();
  5897. if (!a) return null;
  5898. a = a.getStartElement()
  5899. }
  5900. return a ? new CKEDITOR.dom.elementPath(a, this.editable()) : null
  5901. },
  5902. createRange: function() {
  5903. var a = this.editable();
  5904. return a ? new CKEDITOR.dom.range(a) : null
  5905. },
  5906. execCommand: function(a, b) {
  5907. var c = this.getCommand(a),
  5908. d = {
  5909. name: a,
  5910. commandData: b || {},
  5911. command: c
  5912. };
  5913. return c && c.state != CKEDITOR.TRISTATE_DISABLED &&
  5914. !1 !== this.fire("beforeCommandExec", d) && (d.returnValue = c.exec(d.commandData), !c.async && !1 !== this.fire("afterCommandExec", d)) ? d.returnValue : !1
  5915. },
  5916. getCommand: function(a) {
  5917. return this.commands[a]
  5918. },
  5919. getData: function(a) {
  5920. !a && this.fire("beforeGetData");
  5921. var b = this._.data;
  5922. "string" != typeof b && (b = (b = this.element) && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? b.is("textarea") ? b.getValue() : b.getHtml() : "");
  5923. b = {
  5924. dataValue: b
  5925. };
  5926. !a && this.fire("getData", b);
  5927. return b.dataValue
  5928. },
  5929. getSnapshot: function() {
  5930. var a = this.fire("getSnapshot");
  5931. "string" != typeof a && (a = (a = this.element) && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? a.is("textarea") ? a.getValue() : a.getHtml() : "");
  5932. return a
  5933. },
  5934. loadSnapshot: function(a) {
  5935. this.fire("loadSnapshot", a)
  5936. },
  5937. setData: function(a, b, c) {
  5938. var d = !0,
  5939. f = b;
  5940. b && "object" == typeof b && (c = b.internal, f = b.callback, d = !b.noSnapshot);
  5941. !c && d && this.fire("saveSnapshot");
  5942. if (f || !c) this.once("dataReady", function(a) {
  5943. !c && d && this.fire("saveSnapshot");
  5944. f && f.call(a.editor)
  5945. });
  5946. a = {
  5947. dataValue: a
  5948. };
  5949. !c && this.fire("setData", a);
  5950. this._.data = a.dataValue;
  5951. !c && this.fire("afterSetData", a)
  5952. },
  5953. setReadOnly: function(a) {
  5954. a = null == a || a;
  5955. this.readOnly != a && (this.readOnly = a, this.keystrokeHandler.blockedKeystrokes[8] = +a, this.editable().setReadOnly(a), this.fire("readOnly"))
  5956. },
  5957. insertHtml: function(a, b, c) {
  5958. this.fire("insertHtml", {
  5959. dataValue: a,
  5960. mode: b,
  5961. range: c
  5962. })
  5963. },
  5964. insertText: function(a) {
  5965. this.fire("insertText", a)
  5966. },
  5967. insertElement: function(a) {
  5968. this.fire("insertElement", a)
  5969. },
  5970. getSelectedHtml: function(a) {
  5971. var b = this.editable(),
  5972. c = this.getSelection(),
  5973. c = c && c.getRanges();
  5974. if (!b || !c || 0 === c.length) return null;
  5975. b = B(c, b);
  5976. return a ? b.getHtml() : b
  5977. },
  5978. extractSelectedHtml: function(a, b) {
  5979. var c = this.editable(),
  5980. d = this.getSelection().getRanges(),
  5981. f = new CKEDITOR.dom.documentFragment,
  5982. e;
  5983. if (!c || 0 === d.length) return null;
  5984. for (e = 0; e < d.length; e++) f.append(c.extractHtmlFromRange(d[e], b));
  5985. b || this.getSelection().selectRanges([d[0]]);
  5986. return a ? f.getHtml() : f
  5987. },
  5988. focus: function() {
  5989. this.fire("beforeFocus")
  5990. },
  5991. checkDirty: function() {
  5992. return "ready" == this.status && this._.previousValue !== this.getSnapshot()
  5993. },
  5994. resetDirty: function() {
  5995. this._.previousValue =
  5996. this.getSnapshot()
  5997. },
  5998. updateElement: function() {
  5999. return v.call(this)
  6000. },
  6001. setKeystroke: function() {
  6002. for (var a = this.keystrokeHandler.keystrokes, b = CKEDITOR.tools.isArray(arguments[0]) ? arguments[0] : [
  6003. [].slice.call(arguments, 0)
  6004. ], 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]
  6005. },
  6006. getCommandKeystroke: function(a) {
  6007. if (a = "string" === typeof a ? this.getCommand(a) : a) {
  6008. var b = CKEDITOR.tools.object.findKey(this.commands, a),
  6009. c = this.keystrokeHandler.keystrokes,
  6010. d;
  6011. if (a.fakeKeystroke) return a.fakeKeystroke;
  6012. for (d in c)
  6013. if (c.hasOwnProperty(d) && c[d] == b) return d
  6014. }
  6015. return null
  6016. },
  6017. addFeature: function(a) {
  6018. return this.filter.addFeature(a)
  6019. },
  6020. setActiveFilter: function(a) {
  6021. a || (a = this.filter);
  6022. 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)))
  6023. },
  6024. setActiveEnterMode: function(a, b) {
  6025. a = a ? this.blockless ? CKEDITOR.ENTER_BR : a : this.enterMode;
  6026. b = b ? this.blockless ?
  6027. CKEDITOR.ENTER_BR : b : this.shiftEnterMode;
  6028. if (this.activeEnterMode != a || this.activeShiftEnterMode != b) this.activeEnterMode = a, this.activeShiftEnterMode = b, this.fire("activeEnterModeChange")
  6029. },
  6030. showNotification: function(a) {
  6031. alert(a)
  6032. }
  6033. })
  6034. })();
  6035. CKEDITOR.ELEMENT_MODE_NONE = 0;
  6036. CKEDITOR.ELEMENT_MODE_REPLACE = 1;
  6037. CKEDITOR.ELEMENT_MODE_APPENDTO = 2;
  6038. CKEDITOR.ELEMENT_MODE_INLINE = 3;
  6039. CKEDITOR.htmlParser = function() {
  6040. this._ = {
  6041. htmlPartsRegex: /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\x3e)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g
  6042. }
  6043. };
  6044. (function() {
  6045. var a = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,
  6046. d = {
  6047. checked: 1,
  6048. compact: 1,
  6049. declare: 1,
  6050. defer: 1,
  6051. disabled: 1,
  6052. ismap: 1,
  6053. multiple: 1,
  6054. nohref: 1,
  6055. noresize: 1,
  6056. noshade: 1,
  6057. nowrap: 1,
  6058. readonly: 1,
  6059. selected: 1
  6060. };
  6061. CKEDITOR.htmlParser.prototype = {
  6062. onTagOpen: function() {},
  6063. onTagClose: function() {},
  6064. onText: function() {},
  6065. onCDATA: function() {},
  6066. onComment: function() {},
  6067. parse: function(b) {
  6068. for (var c, f, h = 0, k; c = this._.htmlPartsRegex.exec(b);) {
  6069. f = c.index;
  6070. if (f > h)
  6071. if (h = b.substring(h, f), k) k.push(h);
  6072. else this.onText(h);
  6073. h = this._.htmlPartsRegex.lastIndex;
  6074. if (f = c[1])
  6075. if (f = f.toLowerCase(), k && CKEDITOR.dtd.$cdata[f] && (this.onCDATA(k.join("")), k = null), !k) {
  6076. this.onTagClose(f);
  6077. continue
  6078. } if (k) k.push(c[0]);
  6079. else if (f = c[3]) {
  6080. if (f = f.toLowerCase(), !/="/.test(f)) {
  6081. var g = {},
  6082. n, r = c[4];
  6083. c = !!c[5];
  6084. if (r)
  6085. for (; n = a.exec(r);) {
  6086. var e = n[1].toLowerCase();
  6087. n = n[2] || n[3] || n[4] || "";
  6088. g[e] = !n && d[e] ? e : CKEDITOR.tools.htmlDecodeAttr(n)
  6089. }
  6090. this.onTagOpen(f, g, c);
  6091. !k && CKEDITOR.dtd.$cdata[f] && (k = [])
  6092. }
  6093. } else if (f = c[2]) this.onComment(f)
  6094. }
  6095. if (b.length > h) this.onText(b.substring(h,
  6096. b.length))
  6097. }
  6098. }
  6099. })();
  6100. CKEDITOR.htmlParser.basicWriter = CKEDITOR.tools.createClass({
  6101. $: function() {
  6102. this._ = {
  6103. output: []
  6104. }
  6105. },
  6106. proto: {
  6107. openTag: function(a) {
  6108. this._.output.push("\x3c", a)
  6109. },
  6110. openTagClose: function(a, d) {
  6111. d ? this._.output.push(" /\x3e") : this._.output.push("\x3e")
  6112. },
  6113. attribute: function(a, d) {
  6114. "string" == typeof d && (d = CKEDITOR.tools.htmlEncodeAttr(d));
  6115. this._.output.push(" ", a, '\x3d"', d, '"')
  6116. },
  6117. closeTag: function(a) {
  6118. this._.output.push("\x3c/", a, "\x3e")
  6119. },
  6120. text: function(a) {
  6121. this._.output.push(a)
  6122. },
  6123. comment: function(a) {
  6124. this._.output.push("\x3c!--", a,
  6125. "--\x3e")
  6126. },
  6127. write: function(a) {
  6128. this._.output.push(a)
  6129. },
  6130. reset: function() {
  6131. this._.output = [];
  6132. this._.indent = !1
  6133. },
  6134. getHtml: function(a) {
  6135. var d = this._.output.join("");
  6136. a && this.reset();
  6137. return d
  6138. }
  6139. }
  6140. });
  6141. "use strict";
  6142. (function() {
  6143. CKEDITOR.htmlParser.node = function() {};
  6144. CKEDITOR.htmlParser.node.prototype = {
  6145. remove: function() {
  6146. var a = this.parent.children,
  6147. d = CKEDITOR.tools.indexOf(a, this),
  6148. b = this.previous,
  6149. c = this.next;
  6150. b && (b.next = c);
  6151. c && (c.previous = b);
  6152. a.splice(d, 1);
  6153. this.parent = null
  6154. },
  6155. replaceWith: function(a) {
  6156. var d = this.parent.children,
  6157. b = CKEDITOR.tools.indexOf(d, this),
  6158. c = a.previous = this.previous,
  6159. f = a.next = this.next;
  6160. c && (c.next = a);
  6161. f && (f.previous = a);
  6162. d[b] = a;
  6163. a.parent = this.parent;
  6164. this.parent = null
  6165. },
  6166. insertAfter: function(a) {
  6167. var d = a.parent.children,
  6168. b = CKEDITOR.tools.indexOf(d, a),
  6169. c = a.next;
  6170. d.splice(b + 1, 0, this);
  6171. this.next = a.next;
  6172. this.previous = a;
  6173. a.next = this;
  6174. c && (c.previous = this);
  6175. this.parent = a.parent
  6176. },
  6177. insertBefore: function(a) {
  6178. var d = a.parent.children,
  6179. b = CKEDITOR.tools.indexOf(d, a);
  6180. d.splice(b, 0, this);
  6181. this.next = a;
  6182. (this.previous = a.previous) && (a.previous.next = this);
  6183. a.previous = this;
  6184. this.parent = a.parent
  6185. },
  6186. getAscendant: function(a) {
  6187. var d = "function" == typeof a ? a : "string" == typeof a ? function(b) {
  6188. return b.name == a
  6189. } : function(b) {
  6190. return b.name in a
  6191. },
  6192. b = this.parent;
  6193. for (; b &&
  6194. b.type == CKEDITOR.NODE_ELEMENT;) {
  6195. if (d(b)) return b;
  6196. b = b.parent
  6197. }
  6198. return null
  6199. },
  6200. wrapWith: function(a) {
  6201. this.replaceWith(a);
  6202. a.add(this);
  6203. return a
  6204. },
  6205. getIndex: function() {
  6206. return CKEDITOR.tools.indexOf(this.parent.children, this)
  6207. },
  6208. getFilterContext: function(a) {
  6209. return a || {}
  6210. }
  6211. }
  6212. })();
  6213. "use strict";
  6214. CKEDITOR.htmlParser.comment = function(a) {
  6215. this.value = a;
  6216. this._ = {
  6217. isBlockLike: !1
  6218. }
  6219. };
  6220. CKEDITOR.htmlParser.comment.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  6221. type: CKEDITOR.NODE_COMMENT,
  6222. filter: function(a, d) {
  6223. var b = this.value;
  6224. if (!(b = a.onComment(d, b, this))) return this.remove(), !1;
  6225. if ("string" != typeof b) return this.replaceWith(b), !1;
  6226. this.value = b;
  6227. return !0
  6228. },
  6229. writeHtml: function(a, d) {
  6230. d && this.filter(d);
  6231. a.comment(this.value)
  6232. }
  6233. });
  6234. "use strict";
  6235. (function() {
  6236. CKEDITOR.htmlParser.text = function(a) {
  6237. this.value = a;
  6238. this._ = {
  6239. isBlockLike: !1
  6240. }
  6241. };
  6242. CKEDITOR.htmlParser.text.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  6243. type: CKEDITOR.NODE_TEXT,
  6244. filter: function(a, d) {
  6245. if (!(this.value = a.onText(d, this.value, this))) return this.remove(), !1
  6246. },
  6247. writeHtml: function(a, d) {
  6248. d && this.filter(d);
  6249. a.text(this.value)
  6250. }
  6251. })
  6252. })();
  6253. "use strict";
  6254. (function() {
  6255. CKEDITOR.htmlParser.cdata = function(a) {
  6256. this.value = a
  6257. };
  6258. CKEDITOR.htmlParser.cdata.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  6259. type: CKEDITOR.NODE_TEXT,
  6260. filter: function() {},
  6261. writeHtml: function(a) {
  6262. a.write(this.value)
  6263. }
  6264. })
  6265. })();
  6266. "use strict";
  6267. CKEDITOR.htmlParser.fragment = function() {
  6268. this.children = [];
  6269. this.parent = null;
  6270. this._ = {
  6271. isBlockLike: !0,
  6272. hasInlineStarted: !1
  6273. }
  6274. };
  6275. (function() {
  6276. function a(a) {
  6277. return a.attributes["data-cke-survive"] ? !1 : "a" == a.name && a.attributes.href || CKEDITOR.dtd.$removeEmpty[a.name]
  6278. }
  6279. var d = CKEDITOR.tools.extend({
  6280. table: 1,
  6281. ul: 1,
  6282. ol: 1,
  6283. dl: 1
  6284. }, CKEDITOR.dtd.table, CKEDITOR.dtd.ul, CKEDITOR.dtd.ol, CKEDITOR.dtd.dl),
  6285. b = {
  6286. ol: 1,
  6287. ul: 1
  6288. },
  6289. c = CKEDITOR.tools.extend({}, {
  6290. html: 1
  6291. }, CKEDITOR.dtd.html, CKEDITOR.dtd.body, CKEDITOR.dtd.head, {
  6292. style: 1,
  6293. script: 1
  6294. }),
  6295. f = {
  6296. ul: "li",
  6297. ol: "li",
  6298. dl: "dd",
  6299. table: "tbody",
  6300. tbody: "tr",
  6301. thead: "tr",
  6302. tfoot: "tr",
  6303. tr: "td"
  6304. };
  6305. CKEDITOR.htmlParser.fragment.fromHtml =
  6306. function(h, k, g) {
  6307. function n(a) {
  6308. var b;
  6309. if (0 < m.length)
  6310. for (var c = 0; c < m.length; c++) {
  6311. var d = m[c],
  6312. f = d.name,
  6313. e = CKEDITOR.dtd[f],
  6314. l = u.name && CKEDITOR.dtd[u.name];
  6315. l && !l[f] || a && e && !e[a] && CKEDITOR.dtd[a] ? f == u.name && (y(u, u.parent, 1), c--) : (b || (r(), b = 1), d = d.clone(), d.parent = u, u = d, m.splice(c, 1), c--)
  6316. }
  6317. }
  6318. function r() {
  6319. for (; J.length;) y(J.shift(), u)
  6320. }
  6321. function e(a) {
  6322. if (a._.isBlockLike && "pre" != a.name && "textarea" != a.name) {
  6323. var b = a.children.length,
  6324. c = a.children[b - 1],
  6325. d;
  6326. c && c.type == CKEDITOR.NODE_TEXT && ((d = CKEDITOR.tools.rtrim(c.value)) ?
  6327. c.value = d : a.children.length = b - 1)
  6328. }
  6329. }
  6330. function y(b, c, d) {
  6331. c = c || u || x;
  6332. var f = u;
  6333. void 0 === b.previous && (v(c, b) && (u = c, D.onTagOpen(g, {}), b.returnPoint = c = u), e(b), a(b) && !b.children.length || c.add(b), "pre" == b.name && (l = !1), "textarea" == b.name && (K = !1));
  6334. b.returnPoint ? (u = b.returnPoint, delete b.returnPoint) : u = d ? c : f
  6335. }
  6336. function v(a, b) {
  6337. if ((a == x || "body" == a.name) && g && (!a.name || CKEDITOR.dtd[a.name][g])) {
  6338. var c, d;
  6339. 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) &&
  6340. !b.isOrphan || b.type == CKEDITOR.NODE_TEXT
  6341. }
  6342. }
  6343. function B(a, b) {
  6344. return a in CKEDITOR.dtd.$listItem || a in CKEDITOR.dtd.$tableContent ? a == b || "dt" == a && "dd" == b || "dd" == a && "dt" == b : !1
  6345. }
  6346. var D = new CKEDITOR.htmlParser,
  6347. x = k instanceof CKEDITOR.htmlParser.element ? k : "string" == typeof k ? new CKEDITOR.htmlParser.element(k) : new CKEDITOR.htmlParser.fragment,
  6348. m = [],
  6349. J = [],
  6350. u = x,
  6351. K = "textarea" == x.name,
  6352. l = "pre" == x.name;
  6353. D.onTagOpen = function(f, e, h, g) {
  6354. e = new CKEDITOR.htmlParser.element(f, e);
  6355. e.isUnknown && h && (e.isEmpty = !0);
  6356. e.isOptionalClose = g;
  6357. if (a(e)) m.push(e);
  6358. else {
  6359. if ("pre" == f) l = !0;
  6360. else {
  6361. if ("br" == f && l) {
  6362. u.add(new CKEDITOR.htmlParser.text("\n"));
  6363. return
  6364. }
  6365. "textarea" == f && (K = !0)
  6366. }
  6367. if ("br" == f) J.push(e);
  6368. else {
  6369. for (; !(g = (h = u.name) ? CKEDITOR.dtd[h] || (u._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) : c, e.isUnknown || u.isUnknown || g[f]);)
  6370. if (u.isOptionalClose) D.onTagClose(h);
  6371. else if (f in b && h in b) h = u.children, (h = h[h.length - 1]) && "li" == h.name || y(h = new CKEDITOR.htmlParser.element("li"), u), !e.returnPoint && (e.returnPoint = u), u = h;
  6372. else if (f in CKEDITOR.dtd.$listItem &&
  6373. !B(f, h)) D.onTagOpen("li" == f ? "ul" : "dl", {}, 0, 1);
  6374. else if (h in d && !B(f, h)) !e.returnPoint && (e.returnPoint = u), u = u.parent;
  6375. else if (h in CKEDITOR.dtd.$inline && m.unshift(u), u.parent) y(u, u.parent, 1);
  6376. else {
  6377. e.isOrphan = 1;
  6378. break
  6379. }
  6380. n(f);
  6381. r();
  6382. e.parent = u;
  6383. e.isEmpty ? y(e) : u = e
  6384. }
  6385. }
  6386. };
  6387. D.onTagClose = function(a) {
  6388. for (var b = m.length - 1; 0 <= b; b--)
  6389. if (a == m[b].name) {
  6390. m.splice(b, 1);
  6391. return
  6392. } for (var c = [], d = [], f = u; f != x && f.name != a;) f._.isBlockLike || d.unshift(f), c.push(f), f = f.returnPoint || f.parent;
  6393. if (f != x) {
  6394. for (b = 0; b < c.length; b++) {
  6395. var e = c[b];
  6396. y(e, e.parent)
  6397. }
  6398. u =
  6399. f;
  6400. f._.isBlockLike && r();
  6401. y(f, f.parent);
  6402. f == u && (u = u.parent);
  6403. m = m.concat(d)
  6404. }
  6405. "body" == a && (g = !1)
  6406. };
  6407. D.onText = function(a) {
  6408. if (!(u._.hasInlineStarted && !J.length || l || K) && (a = CKEDITOR.tools.ltrim(a), 0 === a.length)) return;
  6409. var b = u.name,
  6410. e = b ? CKEDITOR.dtd[b] || (u._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) : c;
  6411. if (!K && !e["#"] && b in d) D.onTagOpen(f[b] || ""), D.onText(a);
  6412. else {
  6413. r();
  6414. n();
  6415. l || K || (a = a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g, " "));
  6416. a = new CKEDITOR.htmlParser.text(a);
  6417. if (v(u, a)) this.onTagOpen(g, {}, 0, 1);
  6418. u.add(a)
  6419. }
  6420. };
  6421. D.onCDATA =
  6422. function(a) {
  6423. u.add(new CKEDITOR.htmlParser.cdata(a))
  6424. };
  6425. D.onComment = function(a) {
  6426. r();
  6427. n();
  6428. u.add(new CKEDITOR.htmlParser.comment(a))
  6429. };
  6430. D.parse(h);
  6431. for (r(); u != x;) y(u, u.parent, 1);
  6432. e(x);
  6433. return x
  6434. };
  6435. CKEDITOR.htmlParser.fragment.prototype = {
  6436. type: CKEDITOR.NODE_DOCUMENT_FRAGMENT,
  6437. add: function(a, b) {
  6438. isNaN(b) && (b = this.children.length);
  6439. var c = 0 < b ? this.children[b - 1] : null;
  6440. if (c) {
  6441. if (a._.isBlockLike && c.type == CKEDITOR.NODE_TEXT && (c.value = CKEDITOR.tools.rtrim(c.value), 0 === c.value.length)) {
  6442. this.children.pop();
  6443. this.add(a);
  6444. return
  6445. }
  6446. c.next =
  6447. a
  6448. }
  6449. a.previous = c;
  6450. a.parent = this;
  6451. this.children.splice(b, 0, a);
  6452. this._.hasInlineStarted || (this._.hasInlineStarted = a.type == CKEDITOR.NODE_TEXT || a.type == CKEDITOR.NODE_ELEMENT && !a._.isBlockLike)
  6453. },
  6454. filter: function(a, b) {
  6455. b = this.getFilterContext(b);
  6456. a.onRoot(b, this);
  6457. this.filterChildren(a, !1, b)
  6458. },
  6459. filterChildren: function(a, b, c) {
  6460. if (this.childrenFilteredBy != a.id) {
  6461. c = this.getFilterContext(c);
  6462. if (b && !this.parent) a.onRoot(c, this);
  6463. this.childrenFilteredBy = a.id;
  6464. for (b = 0; b < this.children.length; b++) !1 === this.children[b].filter(a,
  6465. c) && b--
  6466. }
  6467. },
  6468. writeHtml: function(a, b) {
  6469. b && this.filter(b);
  6470. this.writeChildrenHtml(a)
  6471. },
  6472. writeChildrenHtml: function(a, b, c) {
  6473. var d = this.getFilterContext();
  6474. if (c && !this.parent && b) b.onRoot(d, this);
  6475. b && this.filterChildren(b, !1, d);
  6476. b = 0;
  6477. c = this.children;
  6478. for (d = c.length; b < d; b++) c[b].writeHtml(a)
  6479. },
  6480. forEach: function(a, b, c) {
  6481. if (!(c || b && this.type != b)) var d = a(this);
  6482. if (!1 !== d) {
  6483. c = this.children;
  6484. 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)
  6485. }
  6486. },
  6487. getFilterContext: function(a) {
  6488. return a || {}
  6489. }
  6490. }
  6491. })();
  6492. "use strict";
  6493. (function() {
  6494. function a() {
  6495. this.rules = []
  6496. }
  6497. function d(b, c, d, h) {
  6498. var k, g;
  6499. for (k in c)(g = b[k]) || (g = b[k] = new a), g.add(c[k], d, h)
  6500. }
  6501. CKEDITOR.htmlParser.filter = CKEDITOR.tools.createClass({
  6502. $: function(b) {
  6503. this.id = CKEDITOR.tools.getNextNumber();
  6504. this.elementNameRules = new a;
  6505. this.attributeNameRules = new a;
  6506. this.elementsRules = {};
  6507. this.attributesRules = {};
  6508. this.textRules = new a;
  6509. this.commentRules = new a;
  6510. this.rootRules = new a;
  6511. b && this.addRules(b, 10)
  6512. },
  6513. proto: {
  6514. addRules: function(a, c) {
  6515. var f;
  6516. "number" == typeof c ? f = c : c && "priority" in c && (f =
  6517. c.priority);
  6518. "number" != typeof f && (f = 10);
  6519. "object" != typeof c && (c = {});
  6520. a.elementNames && this.elementNameRules.addMany(a.elementNames, f, c);
  6521. a.attributeNames && this.attributeNameRules.addMany(a.attributeNames, f, c);
  6522. a.elements && d(this.elementsRules, a.elements, f, c);
  6523. a.attributes && d(this.attributesRules, a.attributes, f, c);
  6524. a.text && this.textRules.add(a.text, f, c);
  6525. a.comment && this.commentRules.add(a.comment, f, c);
  6526. a.root && this.rootRules.add(a.root, f, c)
  6527. },
  6528. applyTo: function(a) {
  6529. a.filter(this)
  6530. },
  6531. onElementName: function(a, c) {
  6532. return this.elementNameRules.execOnName(a,
  6533. c)
  6534. },
  6535. onAttributeName: function(a, c) {
  6536. return this.attributeNameRules.execOnName(a, c)
  6537. },
  6538. onText: function(a, c, d) {
  6539. return this.textRules.exec(a, c, d)
  6540. },
  6541. onComment: function(a, c, d) {
  6542. return this.commentRules.exec(a, c, d)
  6543. },
  6544. onRoot: function(a, c) {
  6545. return this.rootRules.exec(a, c)
  6546. },
  6547. onElement: function(a, c) {
  6548. for (var d = [this.elementsRules["^"], this.elementsRules[c.name], this.elementsRules.$], h, k = 0; 3 > k; k++)
  6549. if (h = d[k]) {
  6550. h = h.exec(a, c, this);
  6551. if (!1 === h) return null;
  6552. if (h && h != c) return this.onNode(a, h);
  6553. if (c.parent && !c.name) break
  6554. } return c
  6555. },
  6556. onNode: function(a, c) {
  6557. var d = c.type;
  6558. return d == CKEDITOR.NODE_ELEMENT ? this.onElement(a, c) : d == CKEDITOR.NODE_TEXT ? new CKEDITOR.htmlParser.text(this.onText(a, c.value)) : d == CKEDITOR.NODE_COMMENT ? new CKEDITOR.htmlParser.comment(this.onComment(a, c.value)) : null
  6559. },
  6560. onAttribute: function(a, c, d, h) {
  6561. return (d = this.attributesRules[d]) ? d.exec(a, h, c, this) : h
  6562. }
  6563. }
  6564. });
  6565. CKEDITOR.htmlParser.filterRulesGroup = a;
  6566. a.prototype = {
  6567. add: function(a, c, d) {
  6568. this.rules.splice(this.findIndex(c), 0, {
  6569. value: a,
  6570. priority: c,
  6571. options: d
  6572. })
  6573. },
  6574. addMany: function(a,
  6575. c, d) {
  6576. for (var h = [this.findIndex(c), 0], k = 0, g = a.length; k < g; k++) h.push({
  6577. value: a[k],
  6578. priority: c,
  6579. options: d
  6580. });
  6581. this.rules.splice.apply(this.rules, h)
  6582. },
  6583. findIndex: function(a) {
  6584. for (var c = this.rules, d = c.length - 1; 0 <= d && a < c[d].priority;) d--;
  6585. return d + 1
  6586. },
  6587. exec: function(a, c) {
  6588. var d = c instanceof CKEDITOR.htmlParser.node || c instanceof CKEDITOR.htmlParser.fragment,
  6589. h = Array.prototype.slice.call(arguments, 1),
  6590. k = this.rules,
  6591. g = k.length,
  6592. n, r, e, y;
  6593. for (y = 0; y < g; y++)
  6594. if (d && (n = c.type, r = c.name), e = k[y], !(a.nonEditable && !e.options.applyToAll ||
  6595. a.nestedEditable && e.options.excludeNestedEditable)) {
  6596. e = e.value.apply(null, h);
  6597. if (!1 === e || d && e && (e.name != r || e.type != n)) return e;
  6598. null != e && (h[0] = c = e)
  6599. } return c
  6600. },
  6601. execOnName: function(a, c) {
  6602. 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]));
  6603. return c
  6604. }
  6605. }
  6606. })();
  6607. (function() {
  6608. function a(a, d) {
  6609. function e(a) {
  6610. return a || CKEDITOR.env.needsNbspFiller ? new CKEDITOR.htmlParser.text(" ") : new CKEDITOR.htmlParser.element("br", {
  6611. "data-cke-bogus": 1
  6612. })
  6613. }
  6614. function p(a, d) {
  6615. return function(f) {
  6616. if (f.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  6617. var l = [],
  6618. w = b(f),
  6619. p, E;
  6620. if (w)
  6621. for (q(w, 1) && l.push(w); w;) h(w) && (p = c(w)) && q(p) && ((E = c(p)) && !h(E) ? l.push(p) : (e(z).insertAfter(p), p.remove())), w = w.previous;
  6622. for (w = 0; w < l.length; w++) l[w].remove();
  6623. if (l = !a || !1 !== ("function" == typeof d ? d(f) : d)) z || CKEDITOR.env.needsBrFiller ||
  6624. f.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT ? z || CKEDITOR.env.needsBrFiller || !(7 < document.documentMode || f.name in CKEDITOR.dtd.tr || f.name in CKEDITOR.dtd.$listItem) ? (l = b(f), l = !l || "form" == f.name && "input" == l.name) : l = !1 : l = !1;
  6625. l && f.add(e(a))
  6626. }
  6627. }
  6628. }
  6629. function q(a, b) {
  6630. if ((!z || CKEDITOR.env.needsBrFiller) && a.type == CKEDITOR.NODE_ELEMENT && "br" == a.name && !a.attributes["data-cke-eol"]) return !0;
  6631. var c;
  6632. return a.type == CKEDITOR.NODE_TEXT && (c = a.value.match(m)) && (c.index && ((new CKEDITOR.htmlParser.text(a.value.substring(0, c.index))).insertBefore(a),
  6633. a.value = c[0]), !CKEDITOR.env.needsBrFiller && z && (!b || a.parent.name in g) || !z && ((c = a.previous) && "br" == c.name || !c || h(c))) ? !0 : !1
  6634. }
  6635. var E = {
  6636. elements: {}
  6637. },
  6638. z = "html" == d,
  6639. g = CKEDITOR.tools.extend({}, l),
  6640. t;
  6641. for (t in g) "#" in u[t] || delete g[t];
  6642. for (t in g) E.elements[t] = p(z, a.config.fillEmptyBlocks);
  6643. E.root = p(z, !1);
  6644. E.elements.br = function(a) {
  6645. return function(b) {
  6646. if (b.parent.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
  6647. var d = b.attributes;
  6648. if ("data-cke-bogus" in d || "data-cke-eol" in d) delete d["data-cke-bogus"];
  6649. else {
  6650. for (d = b.next; d && f(d);) d =
  6651. d.next;
  6652. var l = c(b);
  6653. !d && h(b.parent) ? k(b.parent, e(a)) : h(d) && l && !h(l) && e(a).insertBefore(d)
  6654. }
  6655. }
  6656. }
  6657. }(z);
  6658. return E
  6659. }
  6660. function d(a, b) {
  6661. return a != CKEDITOR.ENTER_BR && !1 !== b ? a == CKEDITOR.ENTER_DIV ? "div" : "p" : !1
  6662. }
  6663. function b(a) {
  6664. for (a = a.children[a.children.length - 1]; a && f(a);) a = a.previous;
  6665. return a
  6666. }
  6667. function c(a) {
  6668. for (a = a.previous; a && f(a);) a = a.previous;
  6669. return a
  6670. }
  6671. function f(a) {
  6672. return a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(a.value) || a.type == CKEDITOR.NODE_ELEMENT && a.attributes["data-cke-bookmark"]
  6673. }
  6674. function h(a) {
  6675. return a &&
  6676. (a.type == CKEDITOR.NODE_ELEMENT && a.name in l || a.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT)
  6677. }
  6678. function k(a, b) {
  6679. var c = a.children[a.children.length - 1];
  6680. a.children.push(b);
  6681. b.parent = a;
  6682. c && (c.next = b, b.previous = c)
  6683. }
  6684. function g(a) {
  6685. a = a.attributes;
  6686. "false" != a.contenteditable && (a["data-cke-editable"] = a.contenteditable ? "true" : 1);
  6687. a.contenteditable = "false"
  6688. }
  6689. function n(a) {
  6690. a = a.attributes;
  6691. switch (a["data-cke-editable"]) {
  6692. case "true":
  6693. a.contenteditable = "true";
  6694. break;
  6695. case "1":
  6696. delete a.contenteditable
  6697. }
  6698. }
  6699. function r(a) {
  6700. return a.replace(M,
  6701. function(a, b, c) {
  6702. return "\x3c" + b + c.replace(q, function(a, b) {
  6703. return E.test(b) && -1 == c.indexOf("data-cke-saved-" + b) ? " data-cke-saved-" + a + " data-cke-" + CKEDITOR.rnd + "-" + a : a
  6704. }) + "\x3e"
  6705. })
  6706. }
  6707. function e(a, b) {
  6708. return a.replace(b, function(a, b, c) {
  6709. 0 === a.indexOf("\x3ctextarea") && (a = b + B(c).replace(/</g, "\x26lt;").replace(/>/g, "\x26gt;") + "\x3c/textarea\x3e");
  6710. return "\x3ccke:encoded\x3e" + encodeURIComponent(a) + "\x3c/cke:encoded\x3e"
  6711. })
  6712. }
  6713. function y(a) {
  6714. return a.replace(P, function(a, b) {
  6715. return decodeURIComponent(b)
  6716. })
  6717. }
  6718. function v(a) {
  6719. return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g,
  6720. function(a) {
  6721. return "\x3c!--" + J + "{C}" + encodeURIComponent(a).replace(/--/g, "%2D%2D") + "--\x3e"
  6722. })
  6723. }
  6724. function B(a) {
  6725. return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g, function(a, b) {
  6726. return decodeURIComponent(b)
  6727. })
  6728. }
  6729. function D(a, b) {
  6730. var c = b._.dataStore;
  6731. return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g, function(a, b) {
  6732. return decodeURIComponent(b)
  6733. }).replace(/\{cke_protected_(\d+)\}/g, function(a, b) {
  6734. return c && c[b] || ""
  6735. })
  6736. }
  6737. function x(a, b) {
  6738. var c = [],
  6739. d = b.config.protectedSource,
  6740. f = b._.dataStore || (b._.dataStore = {
  6741. id: 1
  6742. }),
  6743. e = /<\!--\{cke_temp(comment)?\}(\d*?)--\x3e/g,
  6744. d = [/<script[\s\S]*?(<\/script>|$)/gi, /<noscript[\s\S]*?<\/noscript>/gi, /<meta[\s\S]*?\/?>/gi].concat(d);
  6745. a = a.replace(/\x3c!--[\s\S]*?--\x3e/g, function(a) {
  6746. return "\x3c!--{cke_tempcomment}" + (c.push(a) - 1) + "--\x3e"
  6747. });
  6748. for (var l = 0; l < d.length; l++) a = a.replace(d[l], function(a) {
  6749. a = a.replace(e, function(a, b, d) {
  6750. return c[d]
  6751. });
  6752. return /cke_temp(comment)?/.test(a) ? a : "\x3c!--{cke_temp}" + (c.push(a) - 1) + "--\x3e"
  6753. });
  6754. a = a.replace(e, function(a, b, d) {
  6755. return "\x3c!--" + J + (b ? "{C}" :
  6756. "") + encodeURIComponent(c[d]).replace(/--/g, "%2D%2D") + "--\x3e"
  6757. });
  6758. a = a.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g, function(a) {
  6759. return a.replace(/\x3c!--\{cke_protected\}([^>]*)--\x3e/g, function(a, b) {
  6760. f[f.id] = decodeURIComponent(b);
  6761. return "{cke_protected_" + f.id++ + "}"
  6762. })
  6763. });
  6764. return a = a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g, function(a, c, d, f) {
  6765. return "\x3c" + c + d + "\x3e" + D(B(f), b) + "\x3c/" + c + "\x3e"
  6766. })
  6767. }
  6768. CKEDITOR.htmlDataProcessor = function(b) {
  6769. var c,
  6770. f, l = this;
  6771. this.editor = b;
  6772. this.dataFilter = c = new CKEDITOR.htmlParser.filter;
  6773. this.htmlFilter = f = new CKEDITOR.htmlParser.filter;
  6774. this.writer = new CKEDITOR.htmlParser.basicWriter;
  6775. c.addRules(t);
  6776. c.addRules(F, {
  6777. applyToAll: !0
  6778. });
  6779. c.addRules(a(b, "data"), {
  6780. applyToAll: !0
  6781. });
  6782. f.addRules(L);
  6783. f.addRules(C, {
  6784. applyToAll: !0
  6785. });
  6786. f.addRules(a(b, "html"), {
  6787. applyToAll: !0
  6788. });
  6789. b.on("toHtml", function(a) {
  6790. a = a.data;
  6791. var c = a.dataValue,
  6792. f, c = x(c, b),
  6793. c = e(c, H),
  6794. c = r(c),
  6795. c = e(c, z),
  6796. c = c.replace(O, "$1cke:$2"),
  6797. c = c.replace(N, "\x3ccke:$1$2\x3e\x3c/cke:$1\x3e"),
  6798. c = c.replace(/(<pre\b[^>]*>)(\r\n|\n)/g, "$1$2$2"),
  6799. c = c.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi, "$1data-cke-" + CKEDITOR.rnd + "-$2");
  6800. f = a.context || b.editable().getName();
  6801. var l;
  6802. CKEDITOR.env.ie && 9 > CKEDITOR.env.version && "pre" == f && (f = "div", c = "\x3cpre\x3e" + c + "\x3c/pre\x3e", l = 1);
  6803. f = b.document.createElement(f);
  6804. f.setHtml("a" + c);
  6805. c = f.getHtml().substr(1);
  6806. c = c.replace(new RegExp("data-cke-" + CKEDITOR.rnd + "-", "ig"), "");
  6807. l && (c = c.replace(/^<pre>|<\/pre>$/gi, ""));
  6808. c = c.replace(p, "$1$2");
  6809. c = y(c);
  6810. c = B(c);
  6811. f = !1 === a.fixForBody ? !1 :
  6812. d(a.enterMode, b.config.autoParagraph);
  6813. c = CKEDITOR.htmlParser.fragment.fromHtml(c, a.context, f);
  6814. f && (l = c, !l.children.length && CKEDITOR.dtd[l.name][f] && (f = new CKEDITOR.htmlParser.element(f), l.add(f)));
  6815. a.dataValue = c
  6816. }, null, null, 5);
  6817. b.on("toHtml", function(a) {
  6818. a.data.filter.applyTo(a.data.dataValue, !0, a.data.dontFilter, a.data.enterMode) && b.fire("dataFiltered")
  6819. }, null, null, 6);
  6820. b.on("toHtml", function(a) {
  6821. a.data.dataValue.filterChildren(l.dataFilter, !0)
  6822. }, null, null, 10);
  6823. b.on("toHtml", function(a) {
  6824. a = a.data;
  6825. var b = a.dataValue,
  6826. c = new CKEDITOR.htmlParser.basicWriter;
  6827. b.writeChildrenHtml(c);
  6828. b = c.getHtml(!0);
  6829. a.dataValue = v(b)
  6830. }, null, null, 15);
  6831. b.on("toDataFormat", function(a) {
  6832. var c = a.data.dataValue;
  6833. a.data.enterMode != CKEDITOR.ENTER_BR && (c = c.replace(/^<br *\/?>/i, ""));
  6834. a.data.dataValue = CKEDITOR.htmlParser.fragment.fromHtml(c, a.data.context, d(a.data.enterMode, b.config.autoParagraph))
  6835. }, null, null, 5);
  6836. b.on("toDataFormat", function(a) {
  6837. a.data.dataValue.filterChildren(l.htmlFilter, !0)
  6838. }, null, null, 10);
  6839. b.on("toDataFormat", function(a) {
  6840. a.data.filter.applyTo(a.data.dataValue,
  6841. !1, !0)
  6842. }, null, null, 11);
  6843. b.on("toDataFormat", function(a) {
  6844. var c = a.data.dataValue,
  6845. d = l.writer;
  6846. d.reset();
  6847. c.writeChildrenHtml(d);
  6848. c = d.getHtml(!0);
  6849. c = B(c);
  6850. c = D(c, b);
  6851. a.data.dataValue = c
  6852. }, null, null, 15)
  6853. };
  6854. CKEDITOR.htmlDataProcessor.prototype = {
  6855. toHtml: function(a, b, c, d) {
  6856. var f = this.editor,
  6857. e, l, p, h;
  6858. b && "object" == typeof b ? (e = b.context, c = b.fixForBody, d = b.dontFilter, l = b.filter, p = b.enterMode, h = b.protectedWhitespaces) : e = b;
  6859. e || null === e || (e = f.editable().getName());
  6860. return f.fire("toHtml", {
  6861. dataValue: a,
  6862. context: e,
  6863. fixForBody: c,
  6864. dontFilter: d,
  6865. filter: l || f.filter,
  6866. enterMode: p || f.enterMode,
  6867. protectedWhitespaces: h
  6868. }).dataValue
  6869. },
  6870. toDataFormat: function(a, b) {
  6871. var c, d, f;
  6872. b && (c = b.context, d = b.filter, f = b.enterMode);
  6873. c || null === c || (c = this.editor.editable().getName());
  6874. return this.editor.fire("toDataFormat", {
  6875. dataValue: a,
  6876. filter: d || this.editor.filter,
  6877. context: c,
  6878. enterMode: f || this.editor.enterMode
  6879. }).dataValue
  6880. }
  6881. };
  6882. var m = /(?:&nbsp;|\xa0)$/,
  6883. J = "{cke_protected}",
  6884. u = CKEDITOR.dtd,
  6885. K = "caption colgroup col thead tfoot tbody".split(" "),
  6886. l = CKEDITOR.tools.extend({}, u.$blockLimit,
  6887. u.$block),
  6888. t = {
  6889. elements: {
  6890. input: g,
  6891. textarea: g
  6892. }
  6893. },
  6894. F = {
  6895. attributeNames: [
  6896. [/^on/, "data-cke-pa-on"],
  6897. [/^srcdoc/, "data-cke-pa-srcdoc"],
  6898. [/^data-cke-expando$/, ""]
  6899. ],
  6900. elements: {
  6901. iframe: function(a) {
  6902. if (a.attributes && a.attributes.src) {
  6903. var b = a.attributes.src.toLowerCase().replace(/[^a-z]/gi, "");
  6904. if (0 === b.indexOf("javascript") || 0 === b.indexOf("data")) a.attributes["data-cke-pa-src"] = a.attributes.src, delete a.attributes.src
  6905. }
  6906. }
  6907. }
  6908. },
  6909. L = {
  6910. elements: {
  6911. embed: function(a) {
  6912. var b = a.parent;
  6913. if (b && "object" == b.name) {
  6914. var c = b.attributes.width,
  6915. b = b.attributes.height;
  6916. c && (a.attributes.width = c);
  6917. b && (a.attributes.height = b)
  6918. }
  6919. },
  6920. a: function(a) {
  6921. var b = a.attributes;
  6922. if (!(a.children.length || b.name || b.id || a.attributes["data-cke-saved-name"])) return !1
  6923. }
  6924. }
  6925. },
  6926. C = {
  6927. elementNames: [
  6928. [/^cke:/, ""],
  6929. [/^\?xml:namespace$/, ""]
  6930. ],
  6931. attributeNames: [
  6932. [/^data-cke-(saved|pa)-/, ""],
  6933. [/^data-cke-.*/, ""],
  6934. ["hidefocus", ""]
  6935. ],
  6936. elements: {
  6937. $: function(a) {
  6938. var b = a.attributes;
  6939. if (b) {
  6940. if (b["data-cke-temp"]) return !1;
  6941. 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]]
  6942. }
  6943. return a
  6944. },
  6945. table: function(a) {
  6946. a.children.slice(0).sort(function(a, b) {
  6947. var c, d;
  6948. a.type == CKEDITOR.NODE_ELEMENT && b.type == a.type && (c = CKEDITOR.tools.indexOf(K, a.name), d = CKEDITOR.tools.indexOf(K, b.name)); - 1 < c && -1 < d && c != d || (c = a.parent ? a.getIndex() : -1, d = b.parent ? b.getIndex() : -1);
  6949. return c > d ? 1 : -1
  6950. })
  6951. },
  6952. param: function(a) {
  6953. a.children = [];
  6954. a.isEmpty = !0;
  6955. return a
  6956. },
  6957. span: function(a) {
  6958. "Apple-style-span" == a.attributes["class"] && delete a.name
  6959. },
  6960. html: function(a) {
  6961. delete a.attributes.contenteditable;
  6962. delete a.attributes["class"]
  6963. },
  6964. body: function(a) {
  6965. delete a.attributes.spellcheck;
  6966. delete a.attributes.contenteditable
  6967. },
  6968. style: function(a) {
  6969. var b = a.children[0];
  6970. b && b.value && (b.value = CKEDITOR.tools.trim(b.value));
  6971. a.attributes.type || (a.attributes.type = "text/css")
  6972. },
  6973. title: function(a) {
  6974. var b = a.children[0];
  6975. !b && k(a, b = new CKEDITOR.htmlParser.text);
  6976. b.value = a.attributes["data-cke-title"] || ""
  6977. },
  6978. input: n,
  6979. textarea: n
  6980. },
  6981. attributes: {
  6982. "class": function(a) {
  6983. return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g, "")) || !1
  6984. }
  6985. }
  6986. };
  6987. CKEDITOR.env.ie && (C.attributes.style = function(a) {
  6988. return a.replace(/(^|;)([^\:]+)/g,
  6989. function(a) {
  6990. return a.toLowerCase()
  6991. })
  6992. });
  6993. var M = /<(a|area|img|input|source)\b([^>]*)>/gi,
  6994. q = /([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,
  6995. E = /^(href|src|name)$/i,
  6996. z = /(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,
  6997. H = /(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,
  6998. P = /<cke:encoded>([^<]*)<\/cke:encoded>/gi,
  6999. O = /(<\/?)((?:object|embed|param|html|body|head|title)([\s][^>]*)?>)/gi,
  7000. p = /(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,
  7001. N = /<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi
  7002. })();
  7003. "use strict";
  7004. CKEDITOR.htmlParser.element = function(a, d) {
  7005. this.name = a;
  7006. this.attributes = d || {};
  7007. this.children = [];
  7008. var b = a || "",
  7009. c = b.match(/^cke:(.*)/);
  7010. c && (b = c[1]);
  7011. b = !!(CKEDITOR.dtd.$nonBodyContent[b] || CKEDITOR.dtd.$block[b] || CKEDITOR.dtd.$listItem[b] || CKEDITOR.dtd.$tableContent[b] || CKEDITOR.dtd.$nonEditable[b] || "br" == b);
  7012. this.isEmpty = !!CKEDITOR.dtd.$empty[a];
  7013. this.isUnknown = !CKEDITOR.dtd[a];
  7014. this._ = {
  7015. isBlockLike: b,
  7016. hasInlineStarted: this.isEmpty || !b
  7017. }
  7018. };
  7019. CKEDITOR.htmlParser.cssStyle = function(a) {
  7020. var d = {};
  7021. ((a instanceof CKEDITOR.htmlParser.element ? a.attributes.style : a) || "").replace(/&quot;/g, '"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function(a, c, f) {
  7022. "font-family" == c && (f = f.replace(/["']/g, ""));
  7023. d[c.toLowerCase()] = f
  7024. });
  7025. return {
  7026. rules: d,
  7027. populate: function(a) {
  7028. var c = this.toString();
  7029. c && (a instanceof CKEDITOR.dom.element ? a.setAttribute("style", c) : a instanceof CKEDITOR.htmlParser.element ? a.attributes.style = c : a.style = c)
  7030. },
  7031. toString: function() {
  7032. var a = [],
  7033. c;
  7034. for (c in d) d[c] && a.push(c, ":", d[c], ";");
  7035. return a.join("")
  7036. }
  7037. }
  7038. };
  7039. (function() {
  7040. function a(a) {
  7041. return function(b) {
  7042. return b.type == CKEDITOR.NODE_ELEMENT && ("string" == typeof a ? b.name == a : b.name in a)
  7043. }
  7044. }
  7045. var d = function(a, b) {
  7046. a = a[0];
  7047. b = b[0];
  7048. return a < b ? -1 : a > b ? 1 : 0
  7049. },
  7050. b = CKEDITOR.htmlParser.fragment.prototype;
  7051. CKEDITOR.htmlParser.element.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
  7052. type: CKEDITOR.NODE_ELEMENT,
  7053. add: b.add,
  7054. clone: function() {
  7055. return new CKEDITOR.htmlParser.element(this.name, this.attributes)
  7056. },
  7057. filter: function(a, b) {
  7058. var d = this,
  7059. k, g;
  7060. b = d.getFilterContext(b);
  7061. if (b.off) return !0;
  7062. if (!d.parent) a.onRoot(b, d);
  7063. for (;;) {
  7064. k = d.name;
  7065. if (!(g = a.onElementName(b, k))) return this.remove(), !1;
  7066. d.name = g;
  7067. if (!(d = a.onElement(b, d))) return this.remove(), !1;
  7068. if (d !== this) return this.replaceWith(d), !1;
  7069. if (d.name == k) break;
  7070. if (d.type != CKEDITOR.NODE_ELEMENT) return this.replaceWith(d), !1;
  7071. if (!d.name) return this.replaceWithChildren(), !1
  7072. }
  7073. k = d.attributes;
  7074. var n, r;
  7075. for (n in k) {
  7076. for (g = k[n];;)
  7077. if (r = a.onAttributeName(b, n))
  7078. if (r != n) delete k[n], n = r;
  7079. else break;
  7080. else {
  7081. delete k[n];
  7082. break
  7083. }
  7084. r && (!1 === (g = a.onAttribute(b, d, r, g)) ? delete k[r] :
  7085. k[r] = g)
  7086. }
  7087. d.isEmpty || this.filterChildren(a, !1, b);
  7088. return !0
  7089. },
  7090. filterChildren: b.filterChildren,
  7091. writeHtml: function(a, b) {
  7092. b && this.filter(b);
  7093. var h = this.name,
  7094. k = [],
  7095. g = this.attributes,
  7096. n, r;
  7097. a.openTag(h, g);
  7098. for (n in g) k.push([n, g[n]]);
  7099. a.sortAttributes && k.sort(d);
  7100. n = 0;
  7101. for (r = k.length; n < r; n++) g = k[n], a.attribute(g[0], g[1]);
  7102. a.openTagClose(h, this.isEmpty);
  7103. this.writeChildrenHtml(a);
  7104. this.isEmpty || a.closeTag(h)
  7105. },
  7106. writeChildrenHtml: b.writeChildrenHtml,
  7107. replaceWithChildren: function() {
  7108. for (var a = this.children, b = a.length; b;) a[--b].insertAfter(this);
  7109. this.remove()
  7110. },
  7111. forEach: b.forEach,
  7112. getFirst: function(b) {
  7113. if (!b) return this.children.length ? this.children[0] : null;
  7114. "function" != typeof b && (b = a(b));
  7115. for (var d = 0, h = this.children.length; d < h; ++d)
  7116. if (b(this.children[d])) return this.children[d];
  7117. return null
  7118. },
  7119. getHtml: function() {
  7120. var a = new CKEDITOR.htmlParser.basicWriter;
  7121. this.writeChildrenHtml(a);
  7122. return a.getHtml()
  7123. },
  7124. setHtml: function(a) {
  7125. a = this.children = CKEDITOR.htmlParser.fragment.fromHtml(a).children;
  7126. for (var b = 0, d = a.length; b < d; ++b) a[b].parent = this
  7127. },
  7128. getOuterHtml: function() {
  7129. var a =
  7130. new CKEDITOR.htmlParser.basicWriter;
  7131. this.writeHtml(a);
  7132. return a.getHtml()
  7133. },
  7134. split: function(a) {
  7135. for (var b = this.children.splice(a, this.children.length - a), d = this.clone(), k = 0; k < b.length; ++k) b[k].parent = d;
  7136. d.children = b;
  7137. b[0] && (b[0].previous = null);
  7138. 0 < a && (this.children[a - 1].next = null);
  7139. this.parent.add(d, this.getIndex() + 1);
  7140. return d
  7141. },
  7142. find: function(a, b) {
  7143. void 0 === b && (b = !1);
  7144. var d = [],
  7145. k;
  7146. for (k = 0; k < this.children.length; k++) {
  7147. var g = this.children[k];
  7148. "function" == typeof a && a(g) ? d.push(g) : "string" == typeof a && g.name === a && d.push(g);
  7149. b && g.find && (d = d.concat(g.find(a, b)))
  7150. }
  7151. return d
  7152. },
  7153. addClass: function(a) {
  7154. if (!this.hasClass(a)) {
  7155. var b = this.attributes["class"] || "";
  7156. this.attributes["class"] = b + (b ? " " : "") + a
  7157. }
  7158. },
  7159. removeClass: function(a) {
  7160. var b = this.attributes["class"];
  7161. b && ((b = CKEDITOR.tools.trim(b.replace(new RegExp("(?:\\s+|^)" + a + "(?:\\s+|$)"), " "))) ? this.attributes["class"] = b : delete this.attributes["class"])
  7162. },
  7163. hasClass: function(a) {
  7164. var b = this.attributes["class"];
  7165. return b ? (new RegExp("(?:^|\\s)" + a + "(?\x3d\\s|$)")).test(b) : !1
  7166. },
  7167. getFilterContext: function(a) {
  7168. var b = [];
  7169. a || (a = {
  7170. off: !1,
  7171. nonEditable: !1,
  7172. nestedEditable: !1
  7173. });
  7174. a.off || "off" != this.attributes["data-cke-processor"] || b.push("off", !0);
  7175. a.nonEditable || "false" != this.attributes.contenteditable ? a.nonEditable && !a.nestedEditable && "true" == this.attributes.contenteditable && b.push("nestedEditable", !0) : b.push("nonEditable", !0);
  7176. if (b.length) {
  7177. a = CKEDITOR.tools.copy(a);
  7178. for (var d = 0; d < b.length; d += 2) a[b[d]] = b[d + 1]
  7179. }
  7180. return a
  7181. }
  7182. }, !0)
  7183. })();
  7184. (function() {
  7185. var a = /{([^}]+)}/g;
  7186. CKEDITOR.template = function(a) {
  7187. this.source = String(a)
  7188. };
  7189. CKEDITOR.template.prototype.output = function(d, b) {
  7190. var c = this.source.replace(a, function(a, b) {
  7191. return void 0 !== d[b] ? d[b] : a
  7192. });
  7193. return b ? b.push(c) : c
  7194. }
  7195. })();
  7196. delete CKEDITOR.loadFullCore;
  7197. CKEDITOR.instances = {};
  7198. CKEDITOR.document = new CKEDITOR.dom.document(document);
  7199. CKEDITOR.add = function(a) {
  7200. CKEDITOR.instances[a.name] = a;
  7201. a.on("focus", function() {
  7202. CKEDITOR.currentInstance != a && (CKEDITOR.currentInstance = a, CKEDITOR.fire("currentInstance"))
  7203. });
  7204. a.on("blur", function() {
  7205. CKEDITOR.currentInstance == a && (CKEDITOR.currentInstance = null, CKEDITOR.fire("currentInstance"))
  7206. });
  7207. CKEDITOR.fire("instance", null, a)
  7208. };
  7209. CKEDITOR.remove = function(a) {
  7210. delete CKEDITOR.instances[a.name]
  7211. };
  7212. (function() {
  7213. var a = {};
  7214. CKEDITOR.addTemplate = function(d, b) {
  7215. var c = a[d];
  7216. if (c) return c;
  7217. c = {
  7218. name: d,
  7219. source: b
  7220. };
  7221. CKEDITOR.fire("template", c);
  7222. return a[d] = new CKEDITOR.template(c.source)
  7223. };
  7224. CKEDITOR.getTemplate = function(d) {
  7225. return a[d]
  7226. }
  7227. })();
  7228. (function() {
  7229. var a = [];
  7230. CKEDITOR.addCss = function(d) {
  7231. a.push(d)
  7232. };
  7233. CKEDITOR.getCss = function() {
  7234. return a.join("\n")
  7235. }
  7236. })();
  7237. CKEDITOR.on("instanceDestroyed", function() {
  7238. CKEDITOR.tools.isEmpty(this.instances) && CKEDITOR.fire("reset")
  7239. });
  7240. CKEDITOR.TRISTATE_ON = 1;
  7241. CKEDITOR.TRISTATE_OFF = 2;
  7242. CKEDITOR.TRISTATE_DISABLED = 0;
  7243. (function() {
  7244. CKEDITOR.inline = function(a, d) {
  7245. if (!CKEDITOR.env.isCompatible) return null;
  7246. a = CKEDITOR.dom.element.get(a);
  7247. if (a.getEditor()) throw 'The editor instance "' + a.getEditor().name + '" is already attached to the provided element.';
  7248. var b = new CKEDITOR.editor(d, a, CKEDITOR.ELEMENT_MODE_INLINE),
  7249. c = a.is("textarea") ? a : null;
  7250. 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),
  7251. a.insertAfter(c), c.hide(), c.$.form && b._attachToForm()) : b.setData(a.getHtml(), null, !0);
  7252. b.on("loaded", function() {
  7253. b.fire("uiReady");
  7254. b.editable(a);
  7255. b.container = a;
  7256. b.ui.contentsElement = a;
  7257. b.setData(b.getData(1));
  7258. b.resetDirty();
  7259. b.fire("contentDom");
  7260. b.mode = "wysiwyg";
  7261. b.fire("mode");
  7262. b.status = "ready";
  7263. b.fireOnce("instanceReady");
  7264. CKEDITOR.fire("instanceReady", null, b)
  7265. }, null, null, 1E4);
  7266. b.on("destroy", function() {
  7267. c && (b.container.clearCustomData(), b.container.remove(), c.show());
  7268. b.element.clearCustomData();
  7269. delete b.element
  7270. });
  7271. return b
  7272. };
  7273. CKEDITOR.inlineAll = function() {
  7274. var a, d, b;
  7275. for (b in CKEDITOR.dtd.$editable)
  7276. for (var c = CKEDITOR.document.getElementsByTag(b), f = 0, h = c.count(); f < h; f++) a = c.getItem(f), "true" == a.getAttribute("contenteditable") && (d = {
  7277. element: a,
  7278. config: {}
  7279. }, !1 !== CKEDITOR.fire("inline", d) && CKEDITOR.inline(a, d.config))
  7280. };
  7281. CKEDITOR.domReady(function() {
  7282. !CKEDITOR.disableAutoInline && CKEDITOR.inlineAll()
  7283. })
  7284. })();
  7285. CKEDITOR.replaceClass = "ckeditor";
  7286. (function() {
  7287. function a(a, f, h, k) {
  7288. if (!CKEDITOR.env.isCompatible) return null;
  7289. a = CKEDITOR.dom.element.get(a);
  7290. if (a.getEditor()) throw 'The editor instance "' + a.getEditor().name + '" is already attached to the provided element.';
  7291. var g = new CKEDITOR.editor(f, a, k);
  7292. k == CKEDITOR.ELEMENT_MODE_REPLACE && (a.setStyle("visibility", "hidden"), g._.required = a.hasAttribute("required"), a.removeAttribute("required"));
  7293. h && g.setData(h, null, !0);
  7294. g.on("loaded", function() {
  7295. b(g);
  7296. k == CKEDITOR.ELEMENT_MODE_REPLACE && g.config.autoUpdateElement &&
  7297. a.$.form && g._attachToForm();
  7298. g.setMode(g.config.startupMode, function() {
  7299. g.resetDirty();
  7300. g.status = "ready";
  7301. g.fireOnce("instanceReady");
  7302. CKEDITOR.fire("instanceReady", null, g)
  7303. })
  7304. });
  7305. g.on("destroy", d);
  7306. return g
  7307. }
  7308. function d() {
  7309. var a = this.container,
  7310. b = this.element;
  7311. a && (a.clearCustomData(), a.remove());
  7312. b && (b.clearCustomData(), this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && (b.show(), this._.required && b.setAttribute("required", "required")), delete this.element)
  7313. }
  7314. function b(a) {
  7315. var b = a.name,
  7316. d = a.element,
  7317. k = a.elementMode,
  7318. g =
  7319. a.fire("uiSpace", {
  7320. space: "top",
  7321. html: ""
  7322. }).html,
  7323. n = a.fire("uiSpace", {
  7324. space: "bottom",
  7325. html: ""
  7326. }).html,
  7327. r = 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'),
  7328. b = CKEDITOR.dom.element.createFromHtml(r.output({
  7329. id: a.id,
  7330. name: b,
  7331. langDir: a.lang.dir,
  7332. langCode: a.langCode,
  7333. voiceLabel: a.title,
  7334. 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" : "",
  7335. contentId: a.ui.spaceId("contents"),
  7336. bottomHtml: n ? '\x3cspan id\x3d"' + a.ui.spaceId("bottom") + '" class\x3d"cke_bottom cke_reset_all" role\x3d"presentation"\x3e' + n + "\x3c/span\x3e" : "",
  7337. outerEl: CKEDITOR.env.ie ? "span" : "div"
  7338. }));
  7339. k == CKEDITOR.ELEMENT_MODE_REPLACE ?
  7340. (d.hide(), b.insertAfter(d)) : d.append(b);
  7341. a.container = b;
  7342. a.ui.contentsElement = a.ui.space("contents");
  7343. g && a.ui.space("top").unselectable();
  7344. n && a.ui.space("bottom").unselectable();
  7345. d = a.config.width;
  7346. k = a.config.height;
  7347. d && b.setStyle("width", CKEDITOR.tools.cssLength(d));
  7348. k && a.ui.space("contents").setStyle("height", CKEDITOR.tools.cssLength(k));
  7349. b.disableContextMenu();
  7350. CKEDITOR.env.webkit && b.on("focus", function() {
  7351. a.focus()
  7352. });
  7353. a.fireOnce("uiReady")
  7354. }
  7355. CKEDITOR.replace = function(b, d) {
  7356. return a(b, d, null, CKEDITOR.ELEMENT_MODE_REPLACE)
  7357. };
  7358. CKEDITOR.appendTo = function(b, d, h) {
  7359. return a(b, d, h, CKEDITOR.ELEMENT_MODE_APPENDTO)
  7360. };
  7361. CKEDITOR.replaceAll = function() {
  7362. for (var a = document.getElementsByTagName("textarea"), b = 0; b < a.length; b++) {
  7363. var d = null,
  7364. k = a[b];
  7365. if (k.name || k.id) {
  7366. if ("string" == typeof arguments[0]) {
  7367. if (!(new RegExp("(?:^|\\s)" + arguments[0] + "(?:$|\\s)")).test(k.className)) continue
  7368. } else if ("function" == typeof arguments[0] && (d = {}, !1 === arguments[0](k, d))) continue;
  7369. this.replace(k, d)
  7370. }
  7371. }
  7372. };
  7373. CKEDITOR.editor.prototype.addMode = function(a, b) {
  7374. (this._.modes || (this._.modes = {}))[a] = b
  7375. };
  7376. CKEDITOR.editor.prototype.setMode = function(a, b) {
  7377. var d = this,
  7378. k = this._.modes;
  7379. if (a != d.mode && k && k[a]) {
  7380. d.fire("beforeSetMode", a);
  7381. if (d.mode) {
  7382. var g = d.checkDirty(),
  7383. k = d._.previousModeData,
  7384. n, r = 0;
  7385. d.fire("beforeModeUnload");
  7386. d.editable(0);
  7387. d._.previousMode = d.mode;
  7388. d._.previousModeData = n = d.getData(1);
  7389. "source" == d.mode && k == n && (d.fire("lockSnapshot", {
  7390. forceUpdate: !0
  7391. }), r = 1);
  7392. d.ui.space("contents").setHtml("");
  7393. d.mode = ""
  7394. } else d._.previousModeData = d.getData(1);
  7395. this._.modes[a](function() {
  7396. d.mode = a;
  7397. void 0 !== g && !g &&
  7398. d.resetDirty();
  7399. r ? d.fire("unlockSnapshot") : "wysiwyg" == a && d.fire("saveSnapshot");
  7400. setTimeout(function() {
  7401. d.fire("mode");
  7402. b && b.call(d)
  7403. }, 0)
  7404. })
  7405. }
  7406. };
  7407. CKEDITOR.editor.prototype.resize = function(a, b, d, k) {
  7408. var g = this.container,
  7409. n = this.ui.space("contents"),
  7410. r = CKEDITOR.env.webkit && this.document && this.document.getWindow().$.frameElement;
  7411. k = k ? this.container.getFirst(function(a) {
  7412. return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_inner")
  7413. }) : g;
  7414. k.setSize("width", a, !0);
  7415. r && (r.style.width = "1%");
  7416. var e = (k.$.offsetHeight || 0) - (n.$.clientHeight ||
  7417. 0),
  7418. g = Math.max(b - (d ? 0 : e), 0);
  7419. b = d ? b + e : b;
  7420. n.setStyle("height", g + "px");
  7421. r && (r.style.width = "100%");
  7422. this.fire("resize", {
  7423. outerHeight: b,
  7424. contentsHeight: g,
  7425. outerWidth: a || k.getSize("width")
  7426. })
  7427. };
  7428. CKEDITOR.editor.prototype.getResizable = function(a) {
  7429. return a ? this.ui.space("contents") : this.container
  7430. };
  7431. CKEDITOR.domReady(function() {
  7432. CKEDITOR.replaceClass && CKEDITOR.replaceAll(CKEDITOR.replaceClass)
  7433. })
  7434. })();
  7435. CKEDITOR.config.startupMode = "wysiwyg";
  7436. (function() {
  7437. function a(a) {
  7438. var b = a.editor,
  7439. e = a.data.path,
  7440. f = e.blockLimit,
  7441. g = a.data.selection,
  7442. h = g.getRanges()[0],
  7443. q;
  7444. if (CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller)
  7445. if (g = d(g, e)) g.appendBogus(), q = CKEDITOR.env.ie;
  7446. k(b, e.block, f) && h.collapsed && !h.getCommonAncestor().isReadOnly() && (e = h.clone(), e.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS), f = new CKEDITOR.dom.walker(e), f.guard = function(a) {
  7447. return !c(a) || a.type == CKEDITOR.NODE_COMMENT || a.isReadOnly()
  7448. }, !f.checkForward() || e.checkStartOfBlock() && e.checkEndOfBlock()) &&
  7449. (b = h.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(/^(?:&nbsp;|\xa0)$/) && b.remove(), q = 1, a.cancel());
  7450. q && h.select()
  7451. }
  7452. function d(a, b) {
  7453. if (a.isFake) return 0;
  7454. var d = b.block || b.blockLimit,
  7455. e = d && d.getLast(c);
  7456. if (!(!d || !d.isBlockBoundary() || e && e.type == CKEDITOR.NODE_ELEMENT && e.isBlockBoundary() || d.is("pre") || d.getBogus())) return d
  7457. }
  7458. function b(a) {
  7459. var b = a.data.getTarget();
  7460. b.is("input") &&
  7461. (b = b.getAttribute("type"), "submit" != b && "reset" != b || a.data.preventDefault())
  7462. }
  7463. function c(a) {
  7464. return e(a) && y(a)
  7465. }
  7466. function f(a, b) {
  7467. return function(c) {
  7468. var d = c.data.$.toElement || c.data.$.fromElement || c.data.$.relatedTarget;
  7469. (d = d && d.nodeType == CKEDITOR.NODE_ELEMENT ? new CKEDITOR.dom.element(d) : null) && (b.equals(d) || b.contains(d)) || a.call(this, c)
  7470. }
  7471. }
  7472. function h(a) {
  7473. function b(a) {
  7474. return function(b, e) {
  7475. e && b.type == CKEDITOR.NODE_ELEMENT && b.is(f) && (d = b);
  7476. if (!(e || !c(b) || a && B(b))) return !1
  7477. }
  7478. }
  7479. var d, e = a.getRanges()[0];
  7480. a = a.root;
  7481. var f = {
  7482. table: 1,
  7483. ul: 1,
  7484. ol: 1,
  7485. dl: 1
  7486. };
  7487. if (e.startPath().contains(f)) {
  7488. var g = e.clone();
  7489. g.collapse(1);
  7490. g.setStartAt(a, CKEDITOR.POSITION_AFTER_START);
  7491. a = new CKEDITOR.dom.walker(g);
  7492. a.guard = b();
  7493. a.checkBackward();
  7494. if (d) return g = e.clone(), g.collapse(), g.setEndAt(d, CKEDITOR.POSITION_AFTER_END), a = new CKEDITOR.dom.walker(g), a.guard = b(!0), d = !1, a.checkForward(), d
  7495. }
  7496. return null
  7497. }
  7498. function k(a, b, c) {
  7499. return !1 !== a.config.autoParagraph && a.activeEnterMode != CKEDITOR.ENTER_BR && (a.editable().equals(c) && !b || b && "true" == b.getAttribute("contenteditable"))
  7500. }
  7501. function g(a) {
  7502. return a.activeEnterMode != CKEDITOR.ENTER_BR && !1 !== a.config.autoParagraph ? a.activeEnterMode == CKEDITOR.ENTER_DIV ? "div" : "p" : !1
  7503. }
  7504. function n(a) {
  7505. var b = a.editor;
  7506. b.getSelection().scrollIntoView();
  7507. setTimeout(function() {
  7508. b.fire("saveSnapshot")
  7509. }, 0)
  7510. }
  7511. function r(a, b, c) {
  7512. var d = a.getCommonAncestor(b);
  7513. for (b = a = c ? b : a;
  7514. (a = a.getParent()) && !d.equals(a) && 1 == a.getChildCount();) b = a;
  7515. b.remove()
  7516. }
  7517. var e, y, v, B, D, x, m, J, u, K;
  7518. CKEDITOR.editable = CKEDITOR.tools.createClass({
  7519. base: CKEDITOR.dom.element,
  7520. $: function(a, b) {
  7521. this.base(b.$ ||
  7522. b);
  7523. this.editor = a;
  7524. this.status = "unloaded";
  7525. this.hasFocus = !1;
  7526. this.setup()
  7527. },
  7528. proto: {
  7529. focus: function() {
  7530. var a;
  7531. if (CKEDITOR.env.webkit && !this.hasFocus && (a = this.editor._.previousActive || this.getDocument().getActive(), this.contains(a))) {
  7532. a.focus();
  7533. return
  7534. }
  7535. CKEDITOR.env.edge && 14 < CKEDITOR.env.version && !this.hasFocus && this.getDocument().equals(CKEDITOR.document) && (this.editor._.previousScrollTop = this.$.scrollTop);
  7536. try {
  7537. if (!CKEDITOR.env.ie || CKEDITOR.env.edge && 14 < CKEDITOR.env.version || !this.getDocument().equals(CKEDITOR.document))
  7538. if (CKEDITOR.env.chrome) {
  7539. var b =
  7540. this.$.scrollTop;
  7541. this.$.focus();
  7542. this.$.scrollTop = b
  7543. } else this.$.focus();
  7544. else this.$.setActive()
  7545. } catch (c) {
  7546. if (!CKEDITOR.env.ie) throw c;
  7547. }
  7548. CKEDITOR.env.safari && !this.isInline() && (a = CKEDITOR.document.getActive(), a.equals(this.getWindow().getFrame()) || this.getWindow().focus())
  7549. },
  7550. on: function(a, b) {
  7551. var c = Array.prototype.slice.call(arguments, 0);
  7552. CKEDITOR.env.ie && /^focus|blur$/.exec(a) && (a = "focus" == a ? "focusin" : "focusout", b = f(b, this), c[0] = a, c[1] = b);
  7553. return CKEDITOR.dom.element.prototype.on.apply(this, c)
  7554. },
  7555. attachListener: function(a) {
  7556. !this._.listeners &&
  7557. (this._.listeners = []);
  7558. var b = Array.prototype.slice.call(arguments, 1),
  7559. b = a.on.apply(a, b);
  7560. this._.listeners.push(b);
  7561. return b
  7562. },
  7563. clearListeners: function() {
  7564. var a = this._.listeners;
  7565. try {
  7566. for (; a.length;) a.pop().removeListener()
  7567. } catch (b) {}
  7568. },
  7569. restoreAttrs: function() {
  7570. var a = this._.attrChanges,
  7571. b, c;
  7572. for (c in a) a.hasOwnProperty(c) && (b = a[c], null !== b ? this.setAttribute(c, b) : this.removeAttribute(c))
  7573. },
  7574. attachClass: function(a) {
  7575. var b = this.getCustomData("classes");
  7576. this.hasClass(a) || (!b && (b = []), b.push(a), this.setCustomData("classes",
  7577. b), this.addClass(a))
  7578. },
  7579. changeAttr: function(a, b) {
  7580. var c = this.getAttribute(a);
  7581. b !== c && (!this._.attrChanges && (this._.attrChanges = {}), a in this._.attrChanges || (this._.attrChanges[a] = c), this.setAttribute(a, b))
  7582. },
  7583. insertText: function(a) {
  7584. this.editor.focus();
  7585. this.insertHtml(this.transformPlainTextToHtml(a), "text")
  7586. },
  7587. transformPlainTextToHtml: function(a) {
  7588. var b = this.editor.getSelection().getStartElement().hasAscendant("pre", !0) ? CKEDITOR.ENTER_BR : this.editor.activeEnterMode;
  7589. return CKEDITOR.tools.transformPlainTextToHtml(a,
  7590. b)
  7591. },
  7592. insertHtml: function(a, b, c) {
  7593. var d = this.editor;
  7594. d.focus();
  7595. d.fire("saveSnapshot");
  7596. c || (c = d.getSelection().getRanges()[0]);
  7597. x(this, b || "html", a, c);
  7598. c.select();
  7599. n(this);
  7600. this.editor.fire("afterInsertHtml", {})
  7601. },
  7602. insertHtmlIntoRange: function(a, b, c) {
  7603. x(this, c || "html", a, b);
  7604. this.editor.fire("afterInsertHtml", {
  7605. intoRange: b
  7606. })
  7607. },
  7608. insertElement: function(a, b) {
  7609. var d = this.editor;
  7610. d.focus();
  7611. d.fire("saveSnapshot");
  7612. var e = d.activeEnterMode,
  7613. d = d.getSelection(),
  7614. f = a.getName(),
  7615. f = CKEDITOR.dtd.$block[f];
  7616. b || (b = d.getRanges()[0]);
  7617. this.insertElementIntoRange(a,
  7618. b) && (b.moveToPosition(a, CKEDITOR.POSITION_AFTER_END), f && ((f = a.getNext(function(a) {
  7619. return c(a) && !B(a)
  7620. })) && 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))));
  7621. d.selectRanges([b]);
  7622. n(this)
  7623. },
  7624. insertElementIntoSelection: function(a) {
  7625. this.insertElement(a)
  7626. },
  7627. insertElementIntoRange: function(a, b) {
  7628. var c = this.editor,
  7629. d = c.config.enterMode,
  7630. e = a.getName(),
  7631. f = CKEDITOR.dtd.$block[e];
  7632. if (b.checkReadOnly()) return !1;
  7633. b.deleteContents(1);
  7634. b.startContainer.type == CKEDITOR.NODE_ELEMENT && (b.startContainer.is({
  7635. tr: 1,
  7636. table: 1,
  7637. tbody: 1,
  7638. thead: 1,
  7639. tfoot: 1
  7640. }) ? m(b) : b.startContainer.is(CKEDITOR.dtd.$list) && J(b));
  7641. var q, g;
  7642. if (f)
  7643. for (;
  7644. (q = b.getCommonAncestor(0, 1)) && (g = CKEDITOR.dtd[q.getName()]) && (!g || !g[e]);) q.getName() in CKEDITOR.dtd.span ? b.splitElement(q) : b.checkStartOfBlock() && b.checkEndOfBlock() ? (b.setStartBefore(q), b.collapse(!0), q.remove()) : b.splitBlock(d == CKEDITOR.ENTER_DIV ?
  7645. "div" : "p", c.editable());
  7646. b.insertNode(a);
  7647. return !0
  7648. },
  7649. setData: function(a, b) {
  7650. b || (a = this.editor.dataProcessor.toHtml(a));
  7651. this.setHtml(a);
  7652. this.fixInitialSelection();
  7653. "unloaded" == this.status && (this.status = "ready");
  7654. this.editor.fire("dataReady")
  7655. },
  7656. getData: function(a) {
  7657. var b = this.getHtml();
  7658. a || (b = this.editor.dataProcessor.toDataFormat(b));
  7659. return b
  7660. },
  7661. setReadOnly: function(a) {
  7662. this.setAttribute("contenteditable", !a)
  7663. },
  7664. detach: function() {
  7665. this.removeClass("cke_editable");
  7666. this.status = "detached";
  7667. var a = this.editor;
  7668. this._.detach();
  7669. delete a.document;
  7670. delete a.window
  7671. },
  7672. isInline: function() {
  7673. return this.getDocument().equals(CKEDITOR.document)
  7674. },
  7675. fixInitialSelection: function() {
  7676. function a() {
  7677. var b = c.getDocument().$,
  7678. d = b.getSelection(),
  7679. e;
  7680. a: if (d.anchorNode && d.anchorNode == c.$) e = !0;
  7681. else {
  7682. if (CKEDITOR.env.webkit && (e = c.getDocument().getActive()) && e.equals(c) && !d.anchorNode) {
  7683. e = !0;
  7684. break a
  7685. }
  7686. e = void 0
  7687. } e && (e = new CKEDITOR.dom.range(c), e.moveToElementEditStart(c), b = b.createRange(), b.setStart(e.startContainer.$, e.startOffset), b.collapse(!0), d.removeAllRanges(),
  7688. d.addRange(b))
  7689. }
  7690. function b() {
  7691. var a = c.getDocument().$,
  7692. d = a.selection,
  7693. e = c.getDocument().getActive();
  7694. "None" == d.type && 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())
  7695. }
  7696. var c = this;
  7697. if (CKEDITOR.env.ie && (9 > CKEDITOR.env.version || CKEDITOR.env.quirks)) this.hasFocus && (this.focus(), b());
  7698. else if (this.hasFocus) this.focus(), a();
  7699. else this.once("focus",
  7700. function() {
  7701. a()
  7702. }, null, null, -999)
  7703. },
  7704. getHtmlFromRange: function(a) {
  7705. if (a.collapsed) return new CKEDITOR.dom.documentFragment(a.document);
  7706. a = {
  7707. doc: this.getDocument(),
  7708. range: a.clone()
  7709. };
  7710. u.eol.detect(a, this);
  7711. u.bogus.exclude(a);
  7712. u.cell.shrink(a);
  7713. a.fragment = a.range.cloneContents();
  7714. u.tree.rebuild(a, this);
  7715. u.eol.fix(a, this);
  7716. return new CKEDITOR.dom.documentFragment(a.fragment.$)
  7717. },
  7718. extractHtmlFromRange: function(a, b) {
  7719. var c = K,
  7720. d = {
  7721. range: a,
  7722. doc: a.document
  7723. },
  7724. e = this.getHtmlFromRange(a);
  7725. if (a.collapsed) return a.optimize(), e;
  7726. a.enlarge(CKEDITOR.ENLARGE_INLINE,
  7727. 1);
  7728. c.table.detectPurge(d);
  7729. d.bookmark = a.createBookmark();
  7730. delete d.range;
  7731. var f = this.editor.createRange();
  7732. f.moveToPosition(d.bookmark.startNode, CKEDITOR.POSITION_BEFORE_START);
  7733. d.targetBookmark = f.createBookmark();
  7734. c.list.detectMerge(d, this);
  7735. c.table.detectRanges(d, this);
  7736. c.block.detectMerge(d, this);
  7737. 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)));
  7738. a.moveToBookmark(d.targetBookmark);
  7739. a.optimize();
  7740. c.fixUneditableRangePosition(a);
  7741. c.list.merge(d, this);
  7742. c.table.purge(d, this);
  7743. c.block.merge(d, this);
  7744. if (b) {
  7745. c = a.startPath();
  7746. if (d = a.checkStartOfBlock() && a.checkEndOfBlock() && c.block && !a.root.equals(c.block)) {
  7747. a: {
  7748. var d = c.block.getElementsByTag("span"),
  7749. f = 0,
  7750. q;
  7751. if (d)
  7752. for (; q = d.getItem(f++);)
  7753. if (!y(q)) {
  7754. d = !0;
  7755. break a
  7756. } d = !1
  7757. }
  7758. d = !d
  7759. }
  7760. d && (a.moveToPosition(c.block, CKEDITOR.POSITION_BEFORE_START), c.block.remove())
  7761. } else c.autoParagraph(this.editor, a), v(a.startContainer) && a.startContainer.appendBogus();
  7762. a.startContainer.mergeSiblings();
  7763. return e
  7764. },
  7765. setup: function() {
  7766. var a = this.editor;
  7767. this.attachListener(a, "beforeGetData", function() {
  7768. var b = this.getData();
  7769. this.is("textarea") || !1 !== a.config.ignoreEmptyParagraph && (b = b.replace(D, function(a, b) {
  7770. return b
  7771. }));
  7772. a.setData(b, null, 1)
  7773. }, this);
  7774. this.attachListener(a, "getSnapshot", function(a) {
  7775. a.data = this.getData(1)
  7776. }, this);
  7777. this.attachListener(a, "afterSetData", function() {
  7778. this.setData(a.getData(1))
  7779. }, this);
  7780. this.attachListener(a, "loadSnapshot", function(a) {
  7781. this.setData(a.data, 1)
  7782. }, this);
  7783. this.attachListener(a,
  7784. "beforeFocus",
  7785. function() {
  7786. var b = a.getSelection();
  7787. (b = b && b.getNative()) && "Control" == b.type || this.focus()
  7788. }, this);
  7789. this.attachListener(a, "insertHtml", function(a) {
  7790. this.insertHtml(a.data.dataValue, a.data.mode, a.data.range)
  7791. }, this);
  7792. this.attachListener(a, "insertElement", function(a) {
  7793. this.insertElement(a.data)
  7794. }, this);
  7795. this.attachListener(a, "insertText", function(a) {
  7796. this.insertText(a.data)
  7797. }, this);
  7798. this.setReadOnly(a.readOnly);
  7799. this.attachClass("cke_editable");
  7800. a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? this.attachClass("cke_editable_inline") :
  7801. a.elementMode != CKEDITOR.ELEMENT_MODE_REPLACE && a.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO || this.attachClass("cke_editable_themed");
  7802. this.attachClass("cke_contents_" + a.config.contentsLangDirection);
  7803. a.keystrokeHandler.blockedKeystrokes[8] = +a.readOnly;
  7804. a.keystrokeHandler.attach(this);
  7805. this.on("blur", function() {
  7806. this.hasFocus = !1
  7807. }, null, null, -1);
  7808. this.on("focus", function() {
  7809. this.hasFocus = !0
  7810. }, null, null, -1);
  7811. if (CKEDITOR.env.webkit) this.on("scroll", function() {
  7812. a._.previousScrollTop = a.editable().$.scrollTop
  7813. }, null,
  7814. null, -1);
  7815. if (CKEDITOR.env.edge && 14 < CKEDITOR.env.version) {
  7816. var d = function() {
  7817. var b = a.editable();
  7818. null != a._.previousScrollTop && b.getDocument().equals(CKEDITOR.document) && (b.$.scrollTop = a._.previousScrollTop, a._.previousScrollTop = null, this.removeListener("scroll", d))
  7819. };
  7820. this.on("scroll", d)
  7821. }
  7822. a.focusManager.add(this);
  7823. this.equals(CKEDITOR.document.getActive()) && (this.hasFocus = !0, a.once("contentDom", function() {
  7824. a.focusManager.focus(this)
  7825. }, this));
  7826. this.isInline() && this.changeAttr("tabindex", a.tabIndex);
  7827. if (!this.is("textarea")) {
  7828. a.document =
  7829. this.getDocument();
  7830. a.window = this.getWindow();
  7831. var f = a.document;
  7832. this.changeAttr("spellcheck", !a.config.disableNativeSpellChecker);
  7833. var g = a.config.contentsLangDirection;
  7834. this.getDirection(1) != g && this.changeAttr("dir", g);
  7835. var k = CKEDITOR.getCss();
  7836. if (k) {
  7837. var g = f.getHead(),
  7838. m = g.getCustomData("stylesheet");
  7839. m ? k != m.getText() && (CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? m.$.styleSheet.cssText = k : m.setText(k)) : (k = f.appendStyleText(k), k = new CKEDITOR.dom.element(k.ownerNode || k.owningElement), g.setCustomData("stylesheet",
  7840. k), k.data("cke-temp", 1))
  7841. }
  7842. g = f.getCustomData("stylesheet_ref") || 0;
  7843. f.setCustomData("stylesheet_ref", g + 1);
  7844. this.setCustomData("cke_includeReadonly", !a.config.disableReadonlyStyling);
  7845. this.attachListener(this, "click", function(a) {
  7846. a = a.data;
  7847. var b = (new CKEDITOR.dom.elementPath(a.getTarget(), this)).contains("a");
  7848. b && 2 != a.$.button && b.isReadOnly() && a.preventDefault()
  7849. });
  7850. var q = {
  7851. 8: 1,
  7852. 46: 1
  7853. };
  7854. this.attachListener(a, "key", function(b) {
  7855. if (a.readOnly) return !0;
  7856. var c = b.data.domEvent.getKey(),
  7857. d;
  7858. b = a.getSelection();
  7859. if (0 !== b.getRanges().length) {
  7860. if (c in
  7861. q) {
  7862. var f, g = b.getRanges()[0],
  7863. p = g.startPath(),
  7864. k, w, A, c = 8 == c;
  7865. CKEDITOR.env.ie && 11 > CKEDITOR.env.version && (f = b.getSelectedElement()) || (f = h(b)) ? (a.fire("saveSnapshot"), g.moveToPosition(f, CKEDITOR.POSITION_BEFORE_START), f.remove(), g.select(), a.fire("saveSnapshot"), d = 1) : g.collapsed && ((k = p.block) && (A = k[c ? "getPrevious" : "getNext"](e)) && A.type == CKEDITOR.NODE_ELEMENT && A.is("table") && g[c ? "checkStartOfBlock" : "checkEndOfBlock"]() ? (a.fire("saveSnapshot"), g[c ? "checkEndOfBlock" : "checkStartOfBlock"]() && k.remove(), g["moveToElementEdit" +
  7866. (c ? "End" : "Start")](A), g.select(), a.fire("saveSnapshot"), d = 1) : p.blockLimit && p.blockLimit.is("td") && (w = p.blockLimit.getAscendant("table")) && g.checkBoundaryOfElement(w, c ? CKEDITOR.START : CKEDITOR.END) && (A = w[c ? "getPrevious" : "getNext"](e)) ? (a.fire("saveSnapshot"), g["moveToElementEdit" + (c ? "End" : "Start")](A), g.checkStartOfBlock() && g.checkEndOfBlock() ? A.remove() : g.select(), a.fire("saveSnapshot"), d = 1) : (w = p.contains(["td", "th", "caption"])) && g.checkBoundaryOfElement(w, c ? CKEDITOR.START : CKEDITOR.END) && (d = 1))
  7867. }
  7868. return !d
  7869. }
  7870. });
  7871. a.blockless && CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller && this.attachListener(this, "keyup", function(b) {
  7872. b.data.getKeystroke() in q && !this.getFirst(c) && (this.appendBogus(), b = a.createRange(), b.moveToPosition(this, CKEDITOR.POSITION_AFTER_START), b.select())
  7873. });
  7874. this.attachListener(this, "dblclick", function(b) {
  7875. if (a.readOnly) return !1;
  7876. b = {
  7877. element: b.data.getTarget()
  7878. };
  7879. a.fire("doubleclick", b)
  7880. });
  7881. CKEDITOR.env.ie && this.attachListener(this, "click", b);
  7882. CKEDITOR.env.ie && !CKEDITOR.env.edge || this.attachListener(this, "mousedown",
  7883. function(b) {
  7884. var c = b.data.getTarget();
  7885. c.is("img", "hr", "input", "textarea", "select") && !c.isReadOnly() && (a.getSelection().selectElement(c), c.is("input", "textarea", "select") && b.data.preventDefault())
  7886. });
  7887. CKEDITOR.env.edge && this.attachListener(this, "mouseup", function(b) {
  7888. (b = b.data.getTarget()) && b.is("img") && !b.isReadOnly() && a.getSelection().selectElement(b)
  7889. });
  7890. CKEDITOR.env.gecko && this.attachListener(this, "mouseup", function(b) {
  7891. if (2 == b.data.$.button && (b = b.data.getTarget(), !b.getAscendant("table") && !b.getOuterHtml().replace(D,
  7892. ""))) {
  7893. var c = a.createRange();
  7894. c.moveToElementEditStart(b);
  7895. c.select(!0)
  7896. }
  7897. });
  7898. CKEDITOR.env.webkit && (this.attachListener(this, "click", function(a) {
  7899. a.data.getTarget().is("input", "select") && a.data.preventDefault()
  7900. }), this.attachListener(this, "mouseup", function(a) {
  7901. a.data.getTarget().is("input", "textarea") && a.data.preventDefault()
  7902. }));
  7903. CKEDITOR.env.webkit && this.attachListener(a, "key", function(b) {
  7904. if (a.readOnly) return !0;
  7905. var c = b.data.domEvent.getKey();
  7906. if (c in q && (b = a.getSelection(), 0 !== b.getRanges().length)) {
  7907. var c =
  7908. 8 == c,
  7909. d = b.getRanges()[0];
  7910. b = d.startPath();
  7911. if (d.collapsed) a: {
  7912. var e = b.block;
  7913. if (e && d[c ? "checkStartOfBlock" : "checkEndOfBlock"]() && d.moveToClosestEditablePosition(e, !c) && d.collapsed) {
  7914. if (d.startContainer.type == CKEDITOR.NODE_ELEMENT) {
  7915. var f = d.startContainer.getChild(d.startOffset - (c ? 1 : 0));
  7916. if (f && f.type == CKEDITOR.NODE_ELEMENT && f.is("hr")) {
  7917. a.fire("saveSnapshot");
  7918. f.remove();
  7919. b = !0;
  7920. break a
  7921. }
  7922. }
  7923. d = d.startPath().block;
  7924. if (!d || d && d.contains(e)) b = void 0;
  7925. else {
  7926. a.fire("saveSnapshot");
  7927. var p;
  7928. (p = (c ? d : e).getBogus()) && p.remove();
  7929. p = a.getSelection();
  7930. f = p.createBookmarks();
  7931. (c ? e : d).moveChildren(c ? d : e, !1);
  7932. b.lastElement.mergeSiblings();
  7933. r(e, d, !c);
  7934. p.selectBookmarks(f);
  7935. b = !0
  7936. }
  7937. } else b = !1
  7938. }
  7939. else c = d, p = b.block, d = c.endPath().block, p && d && !p.equals(d) ? (a.fire("saveSnapshot"), (e = p.getBogus()) && e.remove(), c.enlarge(CKEDITOR.ENLARGE_INLINE), c.deleteContents(), d.getParent() && (d.moveChildren(p, !1), b.lastElement.mergeSiblings(), r(p, d, !0)), c = a.getSelection().getRanges()[0], c.collapse(1), c.optimize(), "" === c.startContainer.getHtml() && c.startContainer.appendBogus(),
  7940. c.select(), b = !0) : b = !1;
  7941. if (!b) return;
  7942. a.getSelection().scrollIntoView();
  7943. a.fire("saveSnapshot");
  7944. return !1
  7945. }
  7946. }, this, null, 100)
  7947. }
  7948. }
  7949. },
  7950. _: {
  7951. detach: function() {
  7952. this.editor.setData(this.editor.getData(), 0, 1);
  7953. this.clearListeners();
  7954. this.restoreAttrs();
  7955. var a;
  7956. if (a = this.removeCustomData("classes"))
  7957. for (; a.length;) this.removeClass(a.pop());
  7958. if (!this.is("textarea")) {
  7959. a = this.getDocument();
  7960. var b = a.getHead();
  7961. if (b.getCustomData("stylesheet")) {
  7962. var c = a.getCustomData("stylesheet_ref");
  7963. --c ? a.setCustomData("stylesheet_ref", c) : (a.removeCustomData("stylesheet_ref"),
  7964. b.removeCustomData("stylesheet").remove())
  7965. }
  7966. }
  7967. this.editor.fire("contentDomUnload");
  7968. delete this.editor
  7969. }
  7970. }
  7971. });
  7972. CKEDITOR.editor.prototype.editable = function(a) {
  7973. var b = this._.editable;
  7974. if (b && a) return 0;
  7975. arguments.length && (b = this._.editable = a ? a instanceof CKEDITOR.editable ? a : new CKEDITOR.editable(this, a) : (b && b.detach(), null));
  7976. return b
  7977. };
  7978. CKEDITOR.on("instanceLoaded", function(b) {
  7979. var c = b.editor;
  7980. c.on("insertElement", function(a) {
  7981. a = a.data;
  7982. a.type == CKEDITOR.NODE_ELEMENT && (a.is("input") || a.is("textarea")) && ("false" != a.getAttribute("contentEditable") &&
  7983. a.data("cke-editable", a.hasAttribute("contenteditable") ? "true" : "1"), a.setAttribute("contentEditable", !1))
  7984. });
  7985. c.on("selectionChange", function(b) {
  7986. if (!c.readOnly) {
  7987. var d = c.getSelection();
  7988. d && !d.isLocked && (d = c.checkDirty(), c.fire("lockSnapshot"), a(b), c.fire("unlockSnapshot"), !d && c.resetDirty())
  7989. }
  7990. })
  7991. });
  7992. CKEDITOR.on("instanceCreated", function(a) {
  7993. var b = a.editor;
  7994. b.on("mode", function() {
  7995. var a = b.editable();
  7996. if (a && a.isInline()) {
  7997. var c = b.title;
  7998. a.changeAttr("role", "textbox");
  7999. a.changeAttr("aria-multiline", "true");
  8000. a.changeAttr("aria-label",
  8001. c);
  8002. c && a.changeAttr("title", c);
  8003. var d = b.fire("ariaEditorHelpLabel", {}).label;
  8004. if (d && (c = this.ui.space(this.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? "top" : "contents"))) {
  8005. var e = CKEDITOR.tools.getNextId(),
  8006. d = CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"' + e + '" class\x3d"cke_voice_label"\x3e' + d + "\x3c/span\x3e");
  8007. c.append(d);
  8008. a.changeAttr("aria-describedby", e)
  8009. }
  8010. }
  8011. })
  8012. });
  8013. CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");
  8014. e = CKEDITOR.dom.walker.whitespaces(!0);
  8015. y = CKEDITOR.dom.walker.bookmark(!1, !0);
  8016. v = CKEDITOR.dom.walker.empty();
  8017. B = CKEDITOR.dom.walker.bogus();
  8018. D = /(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;
  8019. x = function() {
  8020. function a(b) {
  8021. return b.type == CKEDITOR.NODE_ELEMENT
  8022. }
  8023. function b(c, d) {
  8024. var e, f, g, q, h = [],
  8025. z = d.range.startContainer;
  8026. e = d.range.startPath();
  8027. for (var z = E[z.getName()], k = 0, H = c.getChildren(), m = H.count(), n = -1, r = -1, C = 0, P = e.contains(E.$list); k < m; ++k) e = H.getItem(k), a(e) ? (g =
  8028. e.getName(), P && g in CKEDITOR.dtd.$list ? h = h.concat(b(e, d)) : (q = !!z[g], "br" != g || !e.data("cke-eol") || k && k != m - 1 || (C = (f = k ? h[k - 1].node : H.getItem(k + 1)) && (!a(f) || !f.is("br")), f = f && a(f) && E.$block[f.getName()]), -1 != n || q || (n = k), q || (r = k), h.push({
  8029. isElement: 1,
  8030. isLineBreak: C,
  8031. isBlock: e.isBlockBoundary(),
  8032. hasBlockSibling: f,
  8033. node: e,
  8034. name: g,
  8035. allowed: q
  8036. }), f = C = 0)) : h.push({
  8037. isElement: 0,
  8038. node: e,
  8039. allowed: 1
  8040. }); - 1 < n && (h[n].firstNotAllowed = 1); - 1 < r && (h[r].lastNotAllowed = 1);
  8041. return h
  8042. }
  8043. function d(b, c) {
  8044. var e = [],
  8045. f = b.getChildren(),
  8046. g = f.count(),
  8047. q, h = 0,
  8048. z = E[c],
  8049. k = !b.is(E.$inline) || b.is("br");
  8050. for (k && e.push(" "); h < g; h++) q = f.getItem(h), a(q) && !q.is(z) ? e = e.concat(d(q, c)) : e.push(q);
  8051. k && e.push(" ");
  8052. return e
  8053. }
  8054. function e(b) {
  8055. return a(b.startContainer) && b.startContainer.getChild(b.startOffset - 1)
  8056. }
  8057. function f(b) {
  8058. return b && a(b) && (b.is(E.$removeEmpty) || b.is("a") && !b.isBlockBoundary())
  8059. }
  8060. function h(b, c, d, e) {
  8061. var f = b.clone(),
  8062. g, q;
  8063. f.setEndAt(c, CKEDITOR.POSITION_BEFORE_END);
  8064. (g = (new CKEDITOR.dom.walker(f)).next()) && a(g) && z[g.getName()] && (q = g.getPrevious()) && a(q) && !q.getParent().equals(b.startContainer) &&
  8065. d.contains(q) && e.contains(g) && g.isIdentical(q) && (g.moveChildren(q), g.remove(), h(b, c, d, e))
  8066. }
  8067. function q(b, c) {
  8068. function d(b, c) {
  8069. if (c.isBlock && c.isElement && !c.node.is("br") && a(b) && b.is("br")) return b.remove(), 1
  8070. }
  8071. var e = c.endContainer.getChild(c.endOffset),
  8072. f = c.endContainer.getChild(c.endOffset - 1);
  8073. e && d(e, b[b.length - 1]);
  8074. f && d(f, b[0]) && (c.setEnd(c.endContainer, c.endOffset - 1), c.collapse())
  8075. }
  8076. var E = CKEDITOR.dtd,
  8077. z = {
  8078. p: 1,
  8079. div: 1,
  8080. h1: 1,
  8081. h2: 1,
  8082. h3: 1,
  8083. h4: 1,
  8084. h5: 1,
  8085. h6: 1,
  8086. ul: 1,
  8087. ol: 1,
  8088. li: 1,
  8089. pre: 1,
  8090. dl: 1,
  8091. blockquote: 1
  8092. },
  8093. H = {
  8094. p: 1,
  8095. div: 1,
  8096. h1: 1,
  8097. h2: 1,
  8098. h3: 1,
  8099. h4: 1,
  8100. h5: 1,
  8101. h6: 1
  8102. },
  8103. m = CKEDITOR.tools.extend({}, E.$inline);
  8104. delete m.br;
  8105. return function(z, p, N, w) {
  8106. var A = z.editor,
  8107. G = !1;
  8108. "unfiltered_html" == p && (p = "html", G = !0);
  8109. if (!w.checkReadOnly()) {
  8110. var I = (new CKEDITOR.dom.elementPath(w.startContainer, w.root)).blockLimit || w.root;
  8111. z = {
  8112. type: p,
  8113. dontFilter: G,
  8114. editable: z,
  8115. editor: A,
  8116. range: w,
  8117. blockLimit: I,
  8118. mergeCandidates: [],
  8119. zombies: []
  8120. };
  8121. p = z.range;
  8122. w = z.mergeCandidates;
  8123. var n, r;
  8124. "text" == z.type && p.shrink(CKEDITOR.SHRINK_ELEMENT, !0, !1) && (n = CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e",
  8125. p.document), p.insertNode(n), p.setStartAfter(n));
  8126. G = new CKEDITOR.dom.elementPath(p.startContainer);
  8127. z.endPath = I = new CKEDITOR.dom.elementPath(p.endContainer);
  8128. if (!p.collapsed) {
  8129. var A = I.block || I.blockLimit,
  8130. v = p.getCommonAncestor();
  8131. A && !A.equals(v) && !A.contains(v) && p.checkEndOfBlock() && z.zombies.push(A);
  8132. p.deleteContents()
  8133. }
  8134. for (;
  8135. (r = e(p)) && a(r) && r.isBlockBoundary() && G.contains(r);) p.moveToPosition(r, CKEDITOR.POSITION_BEFORE_END);
  8136. h(p, z.blockLimit, G, I);
  8137. n && (p.setEndBefore(n), p.collapse(), n.remove());
  8138. n = p.startPath();
  8139. if (A = n.contains(f, !1, 1)) p.splitElement(A), z.inlineStylesRoot = A, z.inlineStylesPeak = n.lastElement;
  8140. n = p.createBookmark();
  8141. (A = n.startNode.getPrevious(c)) && a(A) && f(A) && w.push(A);
  8142. (A = n.startNode.getNext(c)) && a(A) && f(A) && w.push(A);
  8143. for (A = n.startNode;
  8144. (A = A.getParent()) && f(A);) w.push(A);
  8145. p.moveToBookmark(n);
  8146. if (n = N) {
  8147. n = z.range;
  8148. if ("text" == z.type && z.inlineStylesRoot) {
  8149. r = z.inlineStylesPeak;
  8150. p = r.getDocument().createText("{cke-peak}");
  8151. for (w = z.inlineStylesRoot.getParent(); !r.equals(w);) p = p.appendTo(r.clone()), r = r.getParent();
  8152. N = p.getOuterHtml().split("{cke-peak}").join(N)
  8153. }
  8154. r = z.blockLimit.getName();
  8155. if (/^\s+|\s+$/.test(N) && "span" in CKEDITOR.dtd[r]) {
  8156. var x = '\x3cspan data-cke-marker\x3d"1"\x3e\x26nbsp;\x3c/span\x3e';
  8157. N = x + N + x
  8158. }
  8159. N = z.editor.dataProcessor.toHtml(N, {
  8160. context: null,
  8161. fixForBody: !1,
  8162. protectedWhitespaces: !!x,
  8163. dontFilter: z.dontFilter,
  8164. filter: z.editor.activeFilter,
  8165. enterMode: z.editor.activeEnterMode
  8166. });
  8167. r = n.document.createElement("body");
  8168. r.setHtml(N);
  8169. x && (r.getFirst().remove(), r.getLast().remove());
  8170. if ((x = n.startPath().block) && (1 !=
  8171. x.getChildCount() || !x.getBogus())) a: {
  8172. var y;
  8173. if (1 == r.getChildCount() && a(y = r.getFirst()) && y.is(H) && !y.hasAttribute("contenteditable")) {
  8174. x = y.getElementsByTag("*");
  8175. n = 0;
  8176. for (w = x.count(); n < w; n++)
  8177. if (p = x.getItem(n), !p.is(m)) break a;
  8178. y.moveChildren(y.getParent(1));
  8179. y.remove()
  8180. }
  8181. }
  8182. z.dataWrapper = r;
  8183. n = N
  8184. }
  8185. if (n) {
  8186. y = z.range;
  8187. n = y.document;
  8188. var u;
  8189. r = z.blockLimit;
  8190. w = 0;
  8191. var B, x = [],
  8192. D, T;
  8193. N = A = 0;
  8194. var J, K;
  8195. p = y.startContainer;
  8196. var G = z.endPath.elements[0],
  8197. W, I = G.getPosition(p),
  8198. v = !!G.getCommonAncestor(p) && I != CKEDITOR.POSITION_IDENTICAL && !(I & CKEDITOR.POSITION_CONTAINS +
  8199. CKEDITOR.POSITION_IS_CONTAINED);
  8200. p = b(z.dataWrapper, z);
  8201. for (q(p, y); w < p.length; w++) {
  8202. I = p[w];
  8203. if (u = I.isLineBreak) {
  8204. u = y;
  8205. J = r;
  8206. var S = void 0,
  8207. Y = void 0;
  8208. I.hasBlockSibling ? u = 1 : (S = u.startContainer.getAscendant(E.$block, 1)) && S.is({
  8209. div: 1,
  8210. p: 1
  8211. }) ? (Y = S.getPosition(J), Y == CKEDITOR.POSITION_IDENTICAL || Y == CKEDITOR.POSITION_CONTAINS ? u = 0 : (J = u.splitElement(S), u.moveToPosition(J, CKEDITOR.POSITION_AFTER_START), u = 1)) : u = 0
  8212. }
  8213. if (u) N = 0 < w;
  8214. else {
  8215. u = y.startPath();
  8216. !I.isBlock && k(z.editor, u.block, u.blockLimit) && (T = g(z.editor)) && (T = n.createElement(T),
  8217. T.appendBogus(), y.insertNode(T), CKEDITOR.env.needsBrFiller && (B = T.getBogus()) && B.remove(), y.moveToPosition(T, CKEDITOR.POSITION_BEFORE_END));
  8218. if ((u = y.startPath().block) && !u.equals(D)) {
  8219. if (B = u.getBogus()) B.remove(), x.push(u);
  8220. D = u
  8221. }
  8222. I.firstNotAllowed && (A = 1);
  8223. if (A && I.isElement) {
  8224. u = y.startContainer;
  8225. for (J = null; u && !E[u.getName()][I.name];) {
  8226. if (u.equals(r)) {
  8227. u = null;
  8228. break
  8229. }
  8230. J = u;
  8231. u = u.getParent()
  8232. }
  8233. if (u) J && (K = y.splitElement(J), z.zombies.push(K), z.zombies.push(J));
  8234. else {
  8235. J = r.getName();
  8236. W = !w;
  8237. u = w == p.length - 1;
  8238. J = d(I.node, J);
  8239. for (var S = [], Y = J.length, Z = 0, ba = void 0, ca = 0, U = -1; Z < Y; Z++) ba = J[Z], " " == ba ? (ca || W && !Z || (S.push(new CKEDITOR.dom.text(" ")), U = S.length), ca = 1) : (S.push(ba), ca = 0);
  8240. u && U == S.length && S.pop();
  8241. W = S
  8242. }
  8243. }
  8244. if (W) {
  8245. for (; u = W.pop();) y.insertNode(u);
  8246. W = 0
  8247. } else y.insertNode(I.node);
  8248. I.lastNotAllowed && w < p.length - 1 && ((K = v ? G : K) && y.setEndAt(K, CKEDITOR.POSITION_AFTER_START), A = 0);
  8249. y.collapse()
  8250. }
  8251. }
  8252. 1 != p.length ? B = !1 : (B = p[0], B = B.isElement && "false" == B.node.getAttribute("contenteditable"));
  8253. B && (N = !0, u = p[0].node, y.setStartAt(u, CKEDITOR.POSITION_BEFORE_START),
  8254. y.setEndAt(u, CKEDITOR.POSITION_AFTER_END));
  8255. z.dontMoveCaret = N;
  8256. z.bogusNeededBlocks = x
  8257. }
  8258. B = z.range;
  8259. var R;
  8260. K = z.bogusNeededBlocks;
  8261. for (W = B.createBookmark(); D = z.zombies.pop();) D.getParent() && (T = B.clone(), T.moveToElementEditStart(D), T.removeEmptyBlocksAtEnd());
  8262. if (K)
  8263. for (; D = K.pop();) CKEDITOR.env.needsBrFiller ? D.appendBogus() : D.append(B.document.createText(" "));
  8264. for (; D = z.mergeCandidates.pop();) D.mergeSiblings();
  8265. B.moveToBookmark(W);
  8266. if (!z.dontMoveCaret) {
  8267. for (D = e(B); D && a(D) && !D.is(E.$empty);) {
  8268. if (D.isBlockBoundary()) B.moveToPosition(D,
  8269. CKEDITOR.POSITION_BEFORE_END);
  8270. else {
  8271. if (f(D) && D.getHtml().match(/(\s|&nbsp;)$/g)) {
  8272. R = null;
  8273. break
  8274. }
  8275. R = B.clone();
  8276. R.moveToPosition(D, CKEDITOR.POSITION_BEFORE_END)
  8277. }
  8278. D = D.getLast(c)
  8279. }
  8280. R && B.moveToRange(R)
  8281. }
  8282. }
  8283. }
  8284. }();
  8285. m = function() {
  8286. function a(b) {
  8287. b = new CKEDITOR.dom.walker(b);
  8288. b.guard = function(a, b) {
  8289. if (b) return !1;
  8290. if (a.type == CKEDITOR.NODE_ELEMENT) return a.is(CKEDITOR.dtd.$tableContent)
  8291. };
  8292. b.evaluator = function(a) {
  8293. return a.type == CKEDITOR.NODE_ELEMENT
  8294. };
  8295. return b
  8296. }
  8297. function b(a, c, d) {
  8298. c = a.getDocument().createElement(c);
  8299. a.append(c, d);
  8300. return c
  8301. }
  8302. function c(a) {
  8303. var b = a.count(),
  8304. d;
  8305. for (b; 0 < b--;) d = a.getItem(b), CKEDITOR.tools.trim(d.getHtml()) || (d.appendBogus(), CKEDITOR.env.ie && 9 > CKEDITOR.env.version && d.getChildCount() && d.getFirst().remove())
  8306. }
  8307. return function(d) {
  8308. var e = d.startContainer,
  8309. f = e.getAscendant("table", 1),
  8310. g = !1;
  8311. c(f.getElementsByTag("td"));
  8312. c(f.getElementsByTag("th"));
  8313. f = d.clone();
  8314. f.setStart(e, 0);
  8315. f = a(f).lastBackward();
  8316. f || (f = d.clone(), f.setEndAt(e, CKEDITOR.POSITION_BEFORE_END), f = a(f).lastForward(), g = !0);
  8317. f || (f = e);
  8318. f.is("table") ? (d.setStartAt(f, CKEDITOR.POSITION_BEFORE_START),
  8319. d.collapse(!0), f.remove()) : (f.is({
  8320. tbody: 1,
  8321. thead: 1,
  8322. tfoot: 1
  8323. }) && (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))
  8324. }
  8325. }();
  8326. J = function() {
  8327. function a(b) {
  8328. b = new CKEDITOR.dom.walker(b);
  8329. b.guard = function(a, b) {
  8330. if (b) return !1;
  8331. if (a.type == CKEDITOR.NODE_ELEMENT) return a.is(CKEDITOR.dtd.$list) || a.is(CKEDITOR.dtd.$listItem)
  8332. };
  8333. b.evaluator = function(a) {
  8334. return a.type == CKEDITOR.NODE_ELEMENT &&
  8335. a.is(CKEDITOR.dtd.$listItem)
  8336. };
  8337. return b
  8338. }
  8339. return function(b) {
  8340. var c = b.startContainer,
  8341. d = !1,
  8342. e;
  8343. e = b.clone();
  8344. e.setStart(c, 0);
  8345. e = a(e).lastBackward();
  8346. e || (e = b.clone(), e.setEndAt(c, CKEDITOR.POSITION_BEFORE_END), e = a(e).lastForward(), d = !0);
  8347. e || (e = c);
  8348. 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())
  8349. }
  8350. }();
  8351. u = {
  8352. eol: {
  8353. detect: function(a, b) {
  8354. var c = a.range,
  8355. d = c.clone(),
  8356. e = c.clone(),
  8357. f = new CKEDITOR.dom.elementPath(c.startContainer, b),
  8358. g = new CKEDITOR.dom.elementPath(c.endContainer, b);
  8359. d.collapse(1);
  8360. e.collapse();
  8361. f.block && d.checkBoundaryOfElement(f.block, CKEDITOR.END) && (c.setStartAfter(f.block), a.prependEolBr = 1);
  8362. g.block && e.checkBoundaryOfElement(g.block, CKEDITOR.START) && (c.setEndBefore(g.block), a.appendEolBr = 1)
  8363. },
  8364. fix: function(a, b) {
  8365. var c = b.getDocument(),
  8366. d;
  8367. a.appendEolBr && (d = this.createEolBr(c), a.fragment.append(d));
  8368. !a.prependEolBr || d && !d.getPrevious() || a.fragment.append(this.createEolBr(c),
  8369. 1)
  8370. },
  8371. createEolBr: function(a) {
  8372. return a.createElement("br", {
  8373. attributes: {
  8374. "data-cke-eol": 1
  8375. }
  8376. })
  8377. }
  8378. },
  8379. bogus: {
  8380. exclude: function(a) {
  8381. var b = a.range.getBoundaryNodes(),
  8382. c = b.startNode,
  8383. b = b.endNode;
  8384. !b || !B(b) || c && c.equals(b) || a.range.setEndBefore(b)
  8385. }
  8386. },
  8387. tree: {
  8388. rebuild: function(a, b) {
  8389. var c = a.range,
  8390. d = c.getCommonAncestor(),
  8391. e = new CKEDITOR.dom.elementPath(d, b),
  8392. f = new CKEDITOR.dom.elementPath(c.startContainer, b),
  8393. c = new CKEDITOR.dom.elementPath(c.endContainer, b),
  8394. g;
  8395. d.type == CKEDITOR.NODE_TEXT && (d = d.getParent());
  8396. if (e.blockLimit.is({
  8397. tr: 1,
  8398. table: 1
  8399. })) {
  8400. var h = e.contains("table").getParent();
  8401. g = function(a) {
  8402. return !a.equals(h)
  8403. }
  8404. } 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))) {
  8405. var z = e.contains(CKEDITOR.dtd.$list).getParent();
  8406. g = function(a) {
  8407. return !a.equals(z)
  8408. }
  8409. }
  8410. g || (g = function(a) {
  8411. return !a.equals(e.block) && !a.equals(e.blockLimit)
  8412. });
  8413. this.rebuildFragment(a, b, d, g)
  8414. },
  8415. rebuildFragment: function(a, b, c, d) {
  8416. for (var e; c && !c.equals(b) && d(c);) e = c.clone(0, 1), a.fragment.appendTo(e),
  8417. a.fragment = e, c = c.getParent()
  8418. }
  8419. },
  8420. cell: {
  8421. shrink: function(a) {
  8422. a = a.range;
  8423. var b = a.startContainer,
  8424. c = a.endContainer,
  8425. d = a.startOffset,
  8426. e = a.endOffset;
  8427. b.type == CKEDITOR.NODE_ELEMENT && b.equals(c) && b.is("tr") && ++d == e && a.shrink(CKEDITOR.SHRINK_TEXT)
  8428. }
  8429. }
  8430. };
  8431. K = function() {
  8432. function a(b, c) {
  8433. var d = b.getParent();
  8434. if (d.is(CKEDITOR.dtd.$inline)) b[c ? "insertBefore" : "insertAfter"](d)
  8435. }
  8436. function b(c, d, e) {
  8437. a(d);
  8438. a(e, 1);
  8439. for (var f; f = e.getNext();) f.insertAfter(d), d = f;
  8440. v(c) && c.remove()
  8441. }
  8442. function c(a, b) {
  8443. var d = new CKEDITOR.dom.range(a);
  8444. d.setStartAfter(b.startNode);
  8445. d.setEndBefore(b.endNode);
  8446. return d
  8447. }
  8448. return {
  8449. list: {
  8450. detectMerge: function(a, b) {
  8451. var d = c(b, a.bookmark),
  8452. e = d.startPath(),
  8453. f = d.endPath(),
  8454. g = e.contains(CKEDITOR.dtd.$list),
  8455. h = f.contains(CKEDITOR.dtd.$list);
  8456. a.mergeList = g && h && g.getParent().equals(h.getParent()) && !g.equals(h);
  8457. a.mergeListItems = e.block && f.block && e.block.is(CKEDITOR.dtd.$listItem) && f.block.is(CKEDITOR.dtd.$listItem);
  8458. if (a.mergeList || a.mergeListItems) d = d.clone(), d.setStartBefore(a.bookmark.startNode), d.setEndAfter(a.bookmark.endNode), a.mergeListBookmark =
  8459. d.createBookmark()
  8460. },
  8461. merge: function(a, c) {
  8462. if (a.mergeListBookmark) {
  8463. var d = a.mergeListBookmark.startNode,
  8464. e = a.mergeListBookmark.endNode,
  8465. f = new CKEDITOR.dom.elementPath(d, c),
  8466. g = new CKEDITOR.dom.elementPath(e, c);
  8467. if (a.mergeList) {
  8468. var h = f.contains(CKEDITOR.dtd.$list),
  8469. k = g.contains(CKEDITOR.dtd.$list);
  8470. h.equals(k) || (k.moveChildren(h), k.remove())
  8471. }
  8472. a.mergeListItems && (f = f.contains(CKEDITOR.dtd.$listItem), g = g.contains(CKEDITOR.dtd.$listItem), f.equals(g) || b(g, d, e));
  8473. d.remove();
  8474. e.remove()
  8475. }
  8476. }
  8477. },
  8478. block: {
  8479. detectMerge: function(a,
  8480. b) {
  8481. if (!a.tableContentsRanges && !a.mergeListBookmark) {
  8482. var c = new CKEDITOR.dom.range(b);
  8483. c.setStartBefore(a.bookmark.startNode);
  8484. c.setEndAfter(a.bookmark.endNode);
  8485. a.mergeBlockBookmark = c.createBookmark()
  8486. }
  8487. },
  8488. merge: function(a, c) {
  8489. if (a.mergeBlockBookmark && !a.purgeTableBookmark) {
  8490. var d = a.mergeBlockBookmark.startNode,
  8491. e = a.mergeBlockBookmark.endNode,
  8492. f = new CKEDITOR.dom.elementPath(d, c),
  8493. g = new CKEDITOR.dom.elementPath(e, c),
  8494. f = f.block,
  8495. g = g.block;
  8496. f && g && !f.equals(g) && b(g, d, e);
  8497. d.remove();
  8498. e.remove()
  8499. }
  8500. }
  8501. },
  8502. table: function() {
  8503. function a(c) {
  8504. var e = [],
  8505. f, g = new CKEDITOR.dom.walker(c),
  8506. h = c.startPath().contains(d),
  8507. k = c.endPath().contains(d),
  8508. p = {};
  8509. g.guard = function(a, g) {
  8510. if (a.type == CKEDITOR.NODE_ELEMENT) {
  8511. var A = "visited_" + (g ? "out" : "in");
  8512. if (a.getCustomData(A)) return;
  8513. CKEDITOR.dom.element.setMarker(p, a, A, 1)
  8514. }
  8515. if (g && h && a.equals(h)) f = c.clone(), f.setEndAt(h, CKEDITOR.POSITION_BEFORE_END), e.push(f);
  8516. else if (!g && k && a.equals(k)) f = c.clone(), f.setStartAt(k, CKEDITOR.POSITION_AFTER_START), e.push(f);
  8517. else {
  8518. if (A = !g) A = a.type == CKEDITOR.NODE_ELEMENT && a.is(d) && (!h || b(a, h)) && (!k ||
  8519. b(a, k));
  8520. if (!A && (A = g))
  8521. if (a.is(d)) var A = h && h.getAscendant("table", !0),
  8522. l = k && k.getAscendant("table", !0),
  8523. H = a.getAscendant("table", !0),
  8524. A = A && A.contains(H) || l && l.contains(H);
  8525. else A = void 0;
  8526. A && (f = c.clone(), f.selectNodeContents(a), e.push(f))
  8527. }
  8528. };
  8529. g.lastForward();
  8530. CKEDITOR.dom.element.clearAllMarkers(p);
  8531. return e
  8532. }
  8533. function b(a, c) {
  8534. var d = CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_IS_CONTAINED,
  8535. e = a.getPosition(c);
  8536. return e === CKEDITOR.POSITION_IDENTICAL ? !1 : 0 === (e & d)
  8537. }
  8538. var d = {
  8539. td: 1,
  8540. th: 1,
  8541. caption: 1
  8542. };
  8543. return {
  8544. detectPurge: function(a) {
  8545. var b =
  8546. a.range,
  8547. c = b.clone();
  8548. c.enlarge(CKEDITOR.ENLARGE_ELEMENT);
  8549. var c = new CKEDITOR.dom.walker(c),
  8550. e = 0;
  8551. c.evaluator = function(a) {
  8552. a.type == CKEDITOR.NODE_ELEMENT && a.is(d) && ++e
  8553. };
  8554. c.checkForward();
  8555. if (1 < e) {
  8556. var c = b.startPath().contains("table"),
  8557. f = b.endPath().contains("table");
  8558. 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())
  8559. }
  8560. },
  8561. detectRanges: function(e, f) {
  8562. var g = c(f, e.bookmark),
  8563. h = g.clone(),
  8564. k, l, p = g.getCommonAncestor();
  8565. p.is(CKEDITOR.dtd.$tableContent) && !p.is(d) && (p = p.getAscendant("table", !0));
  8566. l = p;
  8567. p = new CKEDITOR.dom.elementPath(g.startContainer, l);
  8568. l = new CKEDITOR.dom.elementPath(g.endContainer, l);
  8569. p = p.contains("table");
  8570. l = l.contains("table");
  8571. if (p || l) p && l && b(p, l) ? (e.tableSurroundingRange = h, h.setStartAt(p, CKEDITOR.POSITION_AFTER_END), h.setEndAt(l, CKEDITOR.POSITION_BEFORE_START), h = g.clone(), h.setEndAt(p, CKEDITOR.POSITION_AFTER_END), k = g.clone(), k.setStartAt(l, CKEDITOR.POSITION_BEFORE_START),
  8572. k = a(h).concat(a(k))) : p ? l || (e.tableSurroundingRange = h, h.setStartAt(p, CKEDITOR.POSITION_AFTER_END), g.setEndAt(p, CKEDITOR.POSITION_AFTER_END)) : (e.tableSurroundingRange = h, h.setEndAt(l, CKEDITOR.POSITION_BEFORE_START), g.setStartAt(l, CKEDITOR.POSITION_AFTER_START)), e.tableContentsRanges = k ? k : a(g)
  8573. },
  8574. deleteRanges: function(a) {
  8575. for (var b; b = a.tableContentsRanges.pop();) b.extractContents(), v(b.startContainer) && b.startContainer.appendBogus();
  8576. a.tableSurroundingRange && a.tableSurroundingRange.extractContents()
  8577. },
  8578. purge: function(a) {
  8579. if (a.purgeTableBookmark) {
  8580. var b =
  8581. a.doc,
  8582. c = a.range.clone(),
  8583. b = b.createElement("p");
  8584. b.insertBefore(a.purgeTableBookmark.startNode);
  8585. c.moveToBookmark(a.purgeTableBookmark);
  8586. c.deleteContents();
  8587. a.range.moveToPosition(b, CKEDITOR.POSITION_AFTER_START)
  8588. }
  8589. }
  8590. }
  8591. }(),
  8592. detectExtractMerge: function(a) {
  8593. return !(a.range.startPath().contains(CKEDITOR.dtd.$listItem) && a.range.endPath().contains(CKEDITOR.dtd.$listItem))
  8594. },
  8595. fixUneditableRangePosition: function(a) {
  8596. a.startContainer.getDtd()["#"] || a.moveToClosestEditablePosition(null, !0)
  8597. },
  8598. autoParagraph: function(a, b) {
  8599. var c =
  8600. b.startPath(),
  8601. d;
  8602. 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))
  8603. }
  8604. }
  8605. }()
  8606. })();
  8607. (function() {
  8608. function a(a) {
  8609. return CKEDITOR.plugins.widget && CKEDITOR.plugins.widget.isDomWidget(a)
  8610. }
  8611. function d(b, c) {
  8612. if (0 === b.length || a(b[0].getEnclosedNode())) return !1;
  8613. var d, e;
  8614. if ((d = !c && 1 === b.length) && !(d = b[0].collapsed)) {
  8615. var f = b[0];
  8616. d = f.startContainer.getAscendant({
  8617. td: 1,
  8618. th: 1
  8619. }, !0);
  8620. var g = f.endContainer.getAscendant({
  8621. td: 1,
  8622. th: 1
  8623. }, !0);
  8624. e = CKEDITOR.tools.trim;
  8625. 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
  8626. }
  8627. if (d) return !1;
  8628. for (e = 0; e < b.length; e++)
  8629. if (d = b[e]._getTableElement(), !d) return !1;
  8630. return !0
  8631. }
  8632. function b(a) {
  8633. function b(a) {
  8634. a = a.find("td, th");
  8635. var c = [],
  8636. d;
  8637. for (d = 0; d < a.count(); d++) c.push(a.getItem(d));
  8638. return c
  8639. }
  8640. var c = [],
  8641. d, e;
  8642. for (e = 0; e < a.length; e++) d = a[e]._getTableElement(), d.is && d.is({
  8643. td: 1,
  8644. th: 1
  8645. }) ? c.push(d) : c = c.concat(b(d));
  8646. return c
  8647. }
  8648. function c(a) {
  8649. a = b(a);
  8650. var c = "",
  8651. d = [],
  8652. e, f;
  8653. 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 = []) : 0 === f && (e = a[f].getAscendant("tr")), d.push(a[f].getText());
  8654. return c += d.join("\t")
  8655. }
  8656. function f(a) {
  8657. var b = this.root.editor,
  8658. d = b.getSelection(1);
  8659. this.reset();
  8660. l = !0;
  8661. d.root.once("selectionchange", function(a) {
  8662. a.cancel()
  8663. }, null, null, 0);
  8664. d.selectRanges([a[0]]);
  8665. d = this._.cache;
  8666. d.ranges = new CKEDITOR.dom.rangeList(a);
  8667. d.type = CKEDITOR.SELECTION_TEXT;
  8668. d.selectedElement = a[0]._getTableElement();
  8669. d.selectedText = c(a);
  8670. d.nativeSel = null;
  8671. this.isFake = 1;
  8672. this.rev = J++;
  8673. b._.fakeSelection = this;
  8674. l = !1;
  8675. this.root.fire("selectionchange")
  8676. }
  8677. function h() {
  8678. var b = this._.fakeSelection,
  8679. c;
  8680. if (b) {
  8681. c = this.getSelection(1);
  8682. var e;
  8683. if (!(e = !c) && (e = !c.isHidden())) {
  8684. e = b;
  8685. var f = c.getRanges(),
  8686. g = e.getRanges(),
  8687. h = f.length && f[0]._getTableElement() && f[0]._getTableElement().getAscendant("table", !0),
  8688. p = g.length && g[0]._getTableElement() && g[0]._getTableElement().getAscendant("table", !0),
  8689. k = 1 === f.length && f[0]._getTableElement() && f[0]._getTableElement().is("table"),
  8690. w = 1 === g.length && g[0]._getTableElement() && g[0]._getTableElement().is("table");
  8691. if (a(e.getSelectedElement())) e = !1;
  8692. else {
  8693. var l = 1 === f.length && f[0].collapsed,
  8694. g = d(f, !!CKEDITOR.env.webkit) &&
  8695. d(g);
  8696. h = h && p ? h.equals(p) || p.contains(h) : !1;
  8697. h && (l || g) ? (k && !w && e.selectRanges(f), e = !0) : e = !1
  8698. }
  8699. e = !e
  8700. }
  8701. e && (b.reset(), b = 0)
  8702. }
  8703. if (!b && (b = c || this.getSelection(1), !b || b.getType() == CKEDITOR.SELECTION_NONE)) return;
  8704. this.fire("selectionCheck", b);
  8705. c = this.elementPath();
  8706. c.compare(this._.selectionPreviousPath) || (e = this._.selectionPreviousPath && this._.selectionPreviousPath.blockLimit.equals(c.blockLimit), CKEDITOR.env.webkit && !e && (this._.previousActive = this.document.getActive()), this._.selectionPreviousPath = c, this.fire("selectionChange", {
  8707. selection: b,
  8708. path: c
  8709. }))
  8710. }
  8711. function k() {
  8712. F = !0;
  8713. t || (g.call(this), t = CKEDITOR.tools.setTimeout(g, 200, this))
  8714. }
  8715. function g() {
  8716. t = null;
  8717. F && (CKEDITOR.tools.setTimeout(h, 0, this), F = !1)
  8718. }
  8719. function n(a) {
  8720. return L(a) || a.type == CKEDITOR.NODE_ELEMENT && !a.is(CKEDITOR.dtd.$empty) ? !0 : !1
  8721. }
  8722. function r(a) {
  8723. function b(c, d) {
  8724. return c && c.type != CKEDITOR.NODE_TEXT ? a.clone()["moveToElementEdit" + (d ? "End" : "Start")](c) : !1
  8725. }
  8726. if (!(a.root instanceof CKEDITOR.editable)) return !1;
  8727. var c = a.startContainer,
  8728. d = a.getPreviousNode(n, null, c),
  8729. e = a.getNextNode(n, null,
  8730. c);
  8731. return b(d) || b(e, 1) || !(d || e || c.type == CKEDITOR.NODE_ELEMENT && c.isBlockBoundary() && c.getBogus()) ? !0 : !1
  8732. }
  8733. function e(a) {
  8734. y(a, !1);
  8735. var b = a.getDocument().createText(u);
  8736. a.setCustomData("cke-fillingChar", b);
  8737. return b
  8738. }
  8739. function y(a, b) {
  8740. var c = a && a.removeCustomData("cke-fillingChar");
  8741. if (c) {
  8742. if (!1 !== b) {
  8743. var d = a.getDocument().getSelection().getNative(),
  8744. e = d && "None" != d.type && d.getRangeAt(0),
  8745. f = u.length;
  8746. if (c.getLength() > f && e && e.intersectsNode(c.$)) {
  8747. var g = [{
  8748. node: d.anchorNode,
  8749. offset: d.anchorOffset
  8750. }, {
  8751. node: d.focusNode,
  8752. offset: d.focusOffset
  8753. }];
  8754. d.anchorNode == c.$ && d.anchorOffset > f && (g[0].offset -= f);
  8755. d.focusNode == c.$ && d.focusOffset > f && (g[1].offset -= f)
  8756. }
  8757. }
  8758. c.setText(v(c.getText(), 1));
  8759. 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))
  8760. }
  8761. }
  8762. function v(a, b) {
  8763. return b ? a.replace(K, function(a, b) {
  8764. return b ? " " : ""
  8765. }) : a.replace(u, "")
  8766. }
  8767. function B(a, b) {
  8768. var c = b && CKEDITOR.tools.htmlEncode(b) || "\x26nbsp;",
  8769. c = CKEDITOR.dom.element.createFromHtml('\x3cdiv data-cke-hidden-sel\x3d"1" data-cke-temp\x3d"1" style\x3d"' +
  8770. (CKEDITOR.env.ie && 14 > CKEDITOR.env.version ? "display:none" : "position:fixed;top:0;left:-1000px") + '"\x3e' + c + "\x3c/div\x3e", a.document);
  8771. a.fire("lockSnapshot");
  8772. a.editable().append(c);
  8773. var d = a.getSelection(1),
  8774. e = a.createRange(),
  8775. f = d.root.on("selectionchange", function(a) {
  8776. a.cancel()
  8777. }, null, null, 0);
  8778. e.setStartAt(c, CKEDITOR.POSITION_AFTER_START);
  8779. e.setEndAt(c, CKEDITOR.POSITION_BEFORE_END);
  8780. d.selectRanges([e]);
  8781. f.removeListener();
  8782. a.fire("unlockSnapshot");
  8783. a._.hiddenSelectionContainer = c
  8784. }
  8785. function D(a) {
  8786. var b = {
  8787. 37: 1,
  8788. 39: 1,
  8789. 8: 1,
  8790. 46: 1
  8791. };
  8792. return function(c) {
  8793. var d = c.data.getKeystroke();
  8794. if (b[d]) {
  8795. var e = a.getSelection().getRanges(),
  8796. f = e[0];
  8797. 1 == e.length && f.collapsed && (d = f[38 > d ? "getPreviousEditableNode" : "getNextEditableNode"]()) && d.type == CKEDITOR.NODE_ELEMENT && "false" == d.getAttribute("contenteditable") && (a.getSelection().fake(d), c.data.preventDefault(), c.cancel())
  8798. }
  8799. }
  8800. }
  8801. function x(a) {
  8802. for (var b = 0; b < a.length; b++) {
  8803. var c = a[b];
  8804. c.getCommonAncestor().isReadOnly() && a.splice(b, 1);
  8805. if (!c.collapsed) {
  8806. if (c.startContainer.isReadOnly())
  8807. for (var d = c.startContainer,
  8808. e; d && !((e = d.type == CKEDITOR.NODE_ELEMENT) && d.is("body") || !d.isReadOnly());) e && "false" == d.getAttribute("contentEditable") && c.setStartAfter(d), d = d.getParent();
  8809. d = c.startContainer;
  8810. e = c.endContainer;
  8811. var f = c.startOffset,
  8812. g = c.endOffset,
  8813. h = c.clone();
  8814. d && d.type == CKEDITOR.NODE_TEXT && (f >= d.getLength() ? h.setStartAfter(d) : h.setStartBefore(d));
  8815. e && e.type == CKEDITOR.NODE_TEXT && (g ? h.setEndAfter(e) : h.setEndBefore(e));
  8816. d = new CKEDITOR.dom.walker(h);
  8817. d.evaluator = function(d) {
  8818. if (d.type == CKEDITOR.NODE_ELEMENT && d.isReadOnly()) {
  8819. var e =
  8820. c.clone();
  8821. c.setEndBefore(d);
  8822. c.collapsed && a.splice(b--, 1);
  8823. d.getPosition(h.endContainer) & CKEDITOR.POSITION_CONTAINS || (e.setStartAfter(d), e.collapsed || a.splice(b + 1, 0, e));
  8824. return !0
  8825. }
  8826. return !1
  8827. };
  8828. d.next()
  8829. }
  8830. }
  8831. return a
  8832. }
  8833. var m = "function" != typeof window.getSelection,
  8834. J = 1,
  8835. u = CKEDITOR.tools.repeat("​", 7),
  8836. K = new RegExp(u + "( )?", "g"),
  8837. l, t, F, L = CKEDITOR.dom.walker.invisible(1),
  8838. C = function() {
  8839. function a(b) {
  8840. return function(a) {
  8841. var c = a.editor.createRange();
  8842. c.moveToClosestEditablePosition(a.selected, b) && a.editor.getSelection().selectRanges([c]);
  8843. return !1
  8844. }
  8845. }
  8846. function b(a) {
  8847. return function(b) {
  8848. var c = b.editor,
  8849. d = c.createRange(),
  8850. e;
  8851. 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
  8852. }
  8853. }
  8854. var c = a(),
  8855. d = a(1);
  8856. return {
  8857. 37: c,
  8858. 38: c,
  8859. 39: d,
  8860. 40: d,
  8861. 8: b(),
  8862. 46: b(1)
  8863. }
  8864. }();
  8865. CKEDITOR.on("instanceCreated", function(a) {
  8866. function b() {
  8867. var a =
  8868. c.getSelection();
  8869. a && a.removeAllRanges()
  8870. }
  8871. var c = a.editor;
  8872. c.on("contentDom", function() {
  8873. function a() {
  8874. r = new CKEDITOR.dom.selection(c.getSelection());
  8875. r.lock()
  8876. }
  8877. function b() {
  8878. f.removeListener("mouseup", b);
  8879. q.removeListener("mouseup", b);
  8880. var a = CKEDITOR.document.$.selection,
  8881. c = a.createRange();
  8882. "None" != a.type && c.parentElement() && c.parentElement().ownerDocument == e.$ && c.select()
  8883. }
  8884. function d(a) {
  8885. a = a.getRanges()[0];
  8886. return a ? (a = a.startContainer.getAscendant(function(a) {
  8887. return a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("contenteditable")
  8888. },
  8889. !0)) && "false" === a.getAttribute("contenteditable") ? a : null : null
  8890. }
  8891. var e = c.document,
  8892. f = CKEDITOR.document,
  8893. g = c.editable(),
  8894. l = e.getBody(),
  8895. q = e.getDocumentElement(),
  8896. E = g.isInline(),
  8897. n, r;
  8898. CKEDITOR.env.gecko && g.attachListener(g, "focus", function(a) {
  8899. a.removeListener();
  8900. 0 !== n && (a = c.getSelection().getNative()) && a.isCollapsed && a.anchorNode == g.$ && (a = c.createRange(), a.moveToElementEditStart(g), a.select())
  8901. }, null, null, -2);
  8902. g.attachListener(g, CKEDITOR.env.webkit ? "DOMFocusIn" : "focus", function() {
  8903. n && CKEDITOR.env.webkit && (n = c._.previousActive &&
  8904. c._.previousActive.equals(e.getActive())) && null != c._.previousScrollTop && c._.previousScrollTop != g.$.scrollTop && (g.$.scrollTop = c._.previousScrollTop);
  8905. c.unlockSelection(n);
  8906. n = 0
  8907. }, null, null, -1);
  8908. g.attachListener(g, "mousedown", function() {
  8909. n = 0
  8910. });
  8911. if (CKEDITOR.env.ie || E) m ? g.attachListener(g, "beforedeactivate", a, null, null, -1) : g.attachListener(c, "selectionCheck", a, null, null, -1), g.attachListener(g, CKEDITOR.env.webkit ? "DOMFocusOut" : "blur", function() {
  8912. c.lockSelection(r);
  8913. n = 1
  8914. }, null, null, -1), g.attachListener(g, "mousedown",
  8915. function() {
  8916. n = 0
  8917. });
  8918. if (CKEDITOR.env.ie && !E) {
  8919. var v;
  8920. g.attachListener(g, "mousedown", function(a) {
  8921. 2 == a.data.$.button && ((a = c.document.getSelection()) && a.getType() != CKEDITOR.SELECTION_NONE || (v = c.window.getScrollPosition()))
  8922. });
  8923. g.attachListener(g, "mouseup", function(a) {
  8924. 2 == a.data.$.button && v && (c.document.$.documentElement.scrollLeft = v.x, c.document.$.documentElement.scrollTop = v.y);
  8925. v = null
  8926. });
  8927. if ("BackCompat" != e.$.compatMode) {
  8928. if (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) {
  8929. var t, u;
  8930. q.on("mousedown", function(a) {
  8931. function b(a) {
  8932. a =
  8933. a.data.$;
  8934. if (t) {
  8935. var c = l.$.createTextRange();
  8936. try {
  8937. c.moveToPoint(a.clientX, a.clientY)
  8938. } catch (d) {}
  8939. t.setEndPoint(0 > u.compareEndPoints("StartToStart", c) ? "EndToEnd" : "StartToStart", c);
  8940. t.select()
  8941. }
  8942. }
  8943. function c() {
  8944. q.removeListener("mousemove", b);
  8945. f.removeListener("mouseup", c);
  8946. q.removeListener("mouseup", c);
  8947. t.select()
  8948. }
  8949. a = a.data;
  8950. if (a.getTarget().is("html") && a.$.y < q.$.clientHeight && a.$.x < q.$.clientWidth) {
  8951. t = l.$.createTextRange();
  8952. try {
  8953. t.moveToPoint(a.$.clientX, a.$.clientY)
  8954. } catch (d) {}
  8955. u = t.duplicate();
  8956. q.on("mousemove", b);
  8957. f.on("mouseup",
  8958. c);
  8959. q.on("mouseup", c)
  8960. }
  8961. })
  8962. }
  8963. if (7 < CKEDITOR.env.version && 11 > CKEDITOR.env.version) q.on("mousedown", function(a) {
  8964. a.data.getTarget().is("html") && (f.on("mouseup", b), q.on("mouseup", b))
  8965. })
  8966. }
  8967. }
  8968. g.attachListener(g, "selectionchange", h, c);
  8969. g.attachListener(g, "keyup", k, c);
  8970. CKEDITOR.env.ie && g.attachListener(g, "keydown", function(a) {
  8971. var b = this.getSelection(1),
  8972. c = d(b);
  8973. c && !c.equals(g) && (b.selectElement(c), a.data.preventDefault())
  8974. }, c);
  8975. g.attachListener(g, CKEDITOR.env.webkit ? "DOMFocusIn" : "focus", function() {
  8976. c.forceNextSelectionCheck();
  8977. c.selectionChange(1)
  8978. });
  8979. if (E && (CKEDITOR.env.webkit || CKEDITOR.env.gecko)) {
  8980. var x;
  8981. g.attachListener(g, "mousedown", function() {
  8982. x = 1
  8983. });
  8984. g.attachListener(e.getDocumentElement(), "mouseup", function() {
  8985. x && k.call(c);
  8986. x = 0
  8987. })
  8988. } else g.attachListener(CKEDITOR.env.ie ? g : e.getDocumentElement(), "mouseup", k, c);
  8989. CKEDITOR.env.webkit && g.attachListener(e, "keydown", function(a) {
  8990. switch (a.data.getKey()) {
  8991. case 13:
  8992. case 33:
  8993. case 34:
  8994. case 35:
  8995. case 36:
  8996. case 37:
  8997. case 39:
  8998. case 8:
  8999. case 45:
  9000. case 46:
  9001. g.hasFocus && y(g)
  9002. }
  9003. }, null, null, -1);
  9004. g.attachListener(g,
  9005. "keydown", D(c), null, null, -1)
  9006. });
  9007. c.on("setData", function() {
  9008. c.unlockSelection();
  9009. CKEDITOR.env.webkit && b()
  9010. });
  9011. c.on("contentDomUnload", function() {
  9012. c.unlockSelection()
  9013. });
  9014. if (CKEDITOR.env.ie9Compat) c.on("beforeDestroy", b, null, null, 9);
  9015. c.on("dataReady", function() {
  9016. delete c._.fakeSelection;
  9017. delete c._.hiddenSelectionContainer;
  9018. c.selectionChange(1)
  9019. });
  9020. c.on("loadSnapshot", function() {
  9021. var a = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),
  9022. b = c.editable().getLast(a);
  9023. b && b.hasAttribute("data-cke-hidden-sel") && (b.remove(),
  9024. CKEDITOR.env.gecko && (a = c.editable().getFirst(a)) && a.is("br") && a.getAttribute("_moz_editor_bogus_node") && a.remove())
  9025. }, null, null, 100);
  9026. c.on("key", function(a) {
  9027. if ("wysiwyg" == c.mode) {
  9028. var b = c.getSelection();
  9029. if (b.isFake) {
  9030. var d = C[a.data.keyCode];
  9031. if (d) return d({
  9032. editor: c,
  9033. selected: b.getSelectedElement(),
  9034. selection: b,
  9035. keyEvent: a
  9036. })
  9037. }
  9038. }
  9039. })
  9040. });
  9041. if (CKEDITOR.env.webkit) CKEDITOR.on("instanceReady", function(a) {
  9042. var b = a.editor;
  9043. b.on("selectionChange", function() {
  9044. var a = b.editable(),
  9045. c = a.getCustomData("cke-fillingChar");
  9046. c && (c.getCustomData("ready") ?
  9047. (y(a), a.editor.fire("selectionCheck")) : c.setCustomData("ready", 1))
  9048. }, null, null, -1);
  9049. b.on("beforeSetMode", function() {
  9050. y(b.editable())
  9051. }, null, null, -1);
  9052. b.on("getSnapshot", function(a) {
  9053. a.data && (a.data = v(a.data))
  9054. }, b, null, 20);
  9055. b.on("toDataFormat", function(a) {
  9056. a.data.dataValue = v(a.data.dataValue)
  9057. }, null, null, 0)
  9058. });
  9059. CKEDITOR.editor.prototype.selectionChange = function(a) {
  9060. (a ? h : k).call(this)
  9061. };
  9062. CKEDITOR.editor.prototype.getSelection = function(a) {
  9063. return !this._.savedSelection && !this._.fakeSelection || a ? (a = this.editable()) &&
  9064. "wysiwyg" == this.mode ? new CKEDITOR.dom.selection(a) : null : this._.savedSelection || this._.fakeSelection
  9065. };
  9066. CKEDITOR.editor.prototype.lockSelection = function(a) {
  9067. a = a || this.getSelection(1);
  9068. return a.getType() != CKEDITOR.SELECTION_NONE ? (!a.isLocked && a.lock(), this._.savedSelection = a, !0) : !1
  9069. };
  9070. CKEDITOR.editor.prototype.unlockSelection = function(a) {
  9071. var b = this._.savedSelection;
  9072. return b ? (b.unlock(a), delete this._.savedSelection, !0) : !1
  9073. };
  9074. CKEDITOR.editor.prototype.forceNextSelectionCheck = function() {
  9075. delete this._.selectionPreviousPath
  9076. };
  9077. CKEDITOR.dom.document.prototype.getSelection = function() {
  9078. return new CKEDITOR.dom.selection(this)
  9079. };
  9080. CKEDITOR.dom.range.prototype.select = function() {
  9081. var a = this.root instanceof CKEDITOR.editable ? this.root.editor.getSelection() : new CKEDITOR.dom.selection(this.root);
  9082. a.selectRanges([this]);
  9083. return a
  9084. };
  9085. CKEDITOR.SELECTION_NONE = 1;
  9086. CKEDITOR.SELECTION_TEXT = 2;
  9087. CKEDITOR.SELECTION_ELEMENT = 3;
  9088. CKEDITOR.dom.selection = function(a) {
  9089. if (a instanceof CKEDITOR.dom.selection) {
  9090. var b = a;
  9091. a = a.root
  9092. }
  9093. var c = a instanceof CKEDITOR.dom.element;
  9094. this.rev = b ? b.rev : J++;
  9095. this.document = a instanceof CKEDITOR.dom.document ? a : a.getDocument();
  9096. this.root = c ? a : this.document.getBody();
  9097. this.isLocked = 0;
  9098. this._ = {
  9099. cache: {}
  9100. };
  9101. if (b) return CKEDITOR.tools.extend(this._.cache, b._.cache), this.isFake = b.isFake, this.isLocked = b.isLocked, this;
  9102. a = this.getNative();
  9103. var d, e;
  9104. if (a)
  9105. if (a.getRangeAt) d = (e = a.rangeCount && a.getRangeAt(0)) && new CKEDITOR.dom.node(e.commonAncestorContainer);
  9106. else {
  9107. try {
  9108. e = a.createRange()
  9109. } catch (f) {}
  9110. d = e && CKEDITOR.dom.element.get(e.item && e.item(0) || e.parentElement())
  9111. } if (!d ||
  9112. 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;
  9113. return this
  9114. };
  9115. var M = {
  9116. img: 1,
  9117. hr: 1,
  9118. li: 1,
  9119. table: 1,
  9120. tr: 1,
  9121. td: 1,
  9122. th: 1,
  9123. embed: 1,
  9124. object: 1,
  9125. ol: 1,
  9126. ul: 1,
  9127. a: 1,
  9128. input: 1,
  9129. form: 1,
  9130. select: 1,
  9131. textarea: 1,
  9132. button: 1,
  9133. fieldset: 1,
  9134. thead: 1,
  9135. tfoot: 1
  9136. };
  9137. CKEDITOR.tools.extend(CKEDITOR.dom.selection, {
  9138. _removeFillingCharSequenceString: v,
  9139. _createFillingCharSequenceNode: e,
  9140. FILLING_CHAR_SEQUENCE: u
  9141. });
  9142. CKEDITOR.dom.selection.prototype = {
  9143. getNative: function() {
  9144. return void 0 !== this._.cache.nativeSel ? this._.cache.nativeSel : this._.cache.nativeSel = m ? this.document.$.selection : this.document.getWindow().$.getSelection()
  9145. },
  9146. getType: m ? function() {
  9147. var a = this._.cache;
  9148. if (a.type) return a.type;
  9149. var b = CKEDITOR.SELECTION_NONE;
  9150. try {
  9151. var c = this.getNative(),
  9152. d = c.type;
  9153. "Text" == d && (b = CKEDITOR.SELECTION_TEXT);
  9154. "Control" == d && (b = CKEDITOR.SELECTION_ELEMENT);
  9155. c.createRange().parentElement() &&
  9156. (b = CKEDITOR.SELECTION_TEXT)
  9157. } catch (e) {}
  9158. return a.type = b
  9159. } : function() {
  9160. var a = this._.cache;
  9161. if (a.type) return a.type;
  9162. var b = CKEDITOR.SELECTION_TEXT,
  9163. c = this.getNative();
  9164. if (!c || !c.rangeCount) b = CKEDITOR.SELECTION_NONE;
  9165. else if (1 == c.rangeCount) {
  9166. var c = c.getRangeAt(0),
  9167. d = c.startContainer;
  9168. d == c.endContainer && 1 == d.nodeType && 1 == c.endOffset - c.startOffset && M[d.childNodes[c.startOffset].nodeName.toLowerCase()] && (b = CKEDITOR.SELECTION_ELEMENT)
  9169. }
  9170. return a.type = b
  9171. },
  9172. getRanges: function() {
  9173. var a = m ? function() {
  9174. function a(b) {
  9175. return (new CKEDITOR.dom.node(b)).getIndex()
  9176. }
  9177. var b = function(b, c) {
  9178. b = b.duplicate();
  9179. b.collapse(c);
  9180. var d = b.parentElement();
  9181. if (!d.hasChildNodes()) return {
  9182. container: d,
  9183. offset: 0
  9184. };
  9185. for (var e = d.children, f, g, h = b.duplicate(), k = 0, l = e.length - 1, q = -1, m, n; k <= l;)
  9186. if (q = Math.floor((k + l) / 2), f = e[q], h.moveToElementText(f), m = h.compareEndPoints("StartToStart", b), 0 < m) l = q - 1;
  9187. else if (0 > m) k = q + 1;
  9188. else return {
  9189. container: d,
  9190. offset: a(f)
  9191. };
  9192. if (-1 == q || q == e.length - 1 && 0 > m) {
  9193. h.moveToElementText(d);
  9194. h.setEndPoint("StartToStart", b);
  9195. h = h.text.replace(/(\r\n|\r)/g, "\n").length;
  9196. e = d.childNodes;
  9197. if (!h) return f =
  9198. e[e.length - 1], f.nodeType != CKEDITOR.NODE_TEXT ? {
  9199. container: d,
  9200. offset: e.length
  9201. } : {
  9202. container: f,
  9203. offset: f.nodeValue.length
  9204. };
  9205. for (d = e.length; 0 < h && 0 < d;) g = e[--d], g.nodeType == CKEDITOR.NODE_TEXT && (n = g, h -= g.nodeValue.length);
  9206. return {
  9207. container: n,
  9208. offset: -h
  9209. }
  9210. }
  9211. h.collapse(0 < m ? !0 : !1);
  9212. h.setEndPoint(0 < m ? "StartToStart" : "EndToStart", b);
  9213. h = h.text.replace(/(\r\n|\r)/g, "\n").length;
  9214. if (!h) return {
  9215. container: d,
  9216. offset: a(f) + (0 < m ? 0 : 1)
  9217. };
  9218. for (; 0 < h;) try {
  9219. g = f[0 < m ? "previousSibling" : "nextSibling"], g.nodeType == CKEDITOR.NODE_TEXT && (h -= g.nodeValue.length,
  9220. n = g), f = g
  9221. } catch (r) {
  9222. return {
  9223. container: d,
  9224. offset: a(f)
  9225. }
  9226. }
  9227. return {
  9228. container: n,
  9229. offset: 0 < m ? -h : n.nodeValue.length + h
  9230. }
  9231. };
  9232. return function() {
  9233. var a = this.getNative(),
  9234. c = a && a.createRange(),
  9235. d = this.getType();
  9236. if (!a) return [];
  9237. 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() &&
  9238. a.collapse(), [a];
  9239. if (d == CKEDITOR.SELECTION_ELEMENT) {
  9240. for (var d = [], e = 0; e < c.length; e++) {
  9241. 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++);
  9242. a.setStart(new CKEDITOR.dom.node(g), h);
  9243. a.setEnd(new CKEDITOR.dom.node(g), h + 1);
  9244. d.push(a)
  9245. }
  9246. return d
  9247. }
  9248. return []
  9249. }
  9250. }() : function() {
  9251. var a = [],
  9252. b, c = this.getNative();
  9253. if (!c) return a;
  9254. for (var d = 0; d < c.rangeCount; d++) {
  9255. var e = c.getRangeAt(d);
  9256. b = new CKEDITOR.dom.range(this.root);
  9257. b.setStart(new CKEDITOR.dom.node(e.startContainer),
  9258. e.startOffset);
  9259. b.setEnd(new CKEDITOR.dom.node(e.endContainer), e.endOffset);
  9260. a.push(b)
  9261. }
  9262. return a
  9263. };
  9264. return function(b) {
  9265. var c = this._.cache,
  9266. d = c.ranges;
  9267. d || (c.ranges = d = new CKEDITOR.dom.rangeList(a.call(this)));
  9268. return b ? x(new CKEDITOR.dom.rangeList(d.slice())) : d
  9269. }
  9270. }(),
  9271. getStartElement: function() {
  9272. var a = this._.cache;
  9273. if (void 0 !== a.startElement) return a.startElement;
  9274. var b;
  9275. switch (this.getType()) {
  9276. case CKEDITOR.SELECTION_ELEMENT:
  9277. return this.getSelectedElement();
  9278. case CKEDITOR.SELECTION_TEXT:
  9279. var c = this.getRanges()[0];
  9280. if (c) {
  9281. if (c.collapsed) b = c.startContainer, b.type != CKEDITOR.NODE_ELEMENT && (b = b.getParent());
  9282. else {
  9283. for (c.optimize(); b = c.startContainer, c.startOffset == (b.getChildCount ? b.getChildCount() : b.getLength()) && !b.isBlockBoundary();) c.setStartAfter(b);
  9284. b = c.startContainer;
  9285. if (b.type != CKEDITOR.NODE_ELEMENT) return b.getParent();
  9286. if ((b = b.getChild(c.startOffset)) && b.type == CKEDITOR.NODE_ELEMENT)
  9287. for (c = b.getFirst(); c && c.type == CKEDITOR.NODE_ELEMENT;) b = c, c = c.getFirst();
  9288. else b = c.startContainer
  9289. }
  9290. b = b.$
  9291. }
  9292. }
  9293. return a.startElement = b ?
  9294. new CKEDITOR.dom.element(b) : null
  9295. },
  9296. getSelectedElement: function() {
  9297. var a = this._.cache;
  9298. if (void 0 !== a.selectedElement) return a.selectedElement;
  9299. var b = this,
  9300. c = CKEDITOR.tools.tryThese(function() {
  9301. return b.getNative().createRange().item(0)
  9302. }, function() {
  9303. 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);
  9304. return d && d.$
  9305. });
  9306. return a.selectedElement = c ? new CKEDITOR.dom.element(c) : null
  9307. },
  9308. getSelectedText: function() {
  9309. var a =
  9310. this._.cache;
  9311. if (void 0 !== a.selectedText) return a.selectedText;
  9312. var b = this.getNative(),
  9313. b = m ? "Control" == b.type ? "" : b.createRange().text : b.toString();
  9314. return a.selectedText = b
  9315. },
  9316. lock: function() {
  9317. this.getRanges();
  9318. this.getStartElement();
  9319. this.getSelectedElement();
  9320. this.getSelectedText();
  9321. this._.cache.nativeSel = null;
  9322. this.isLocked = 1
  9323. },
  9324. unlock: function(a) {
  9325. if (this.isLocked) {
  9326. if (a) var b = this.getSelectedElement(),
  9327. c = this.getRanges(),
  9328. e = this.isFake;
  9329. this.isLocked = 0;
  9330. this.reset();
  9331. a && (a = b || c[0] && c[0].getCommonAncestor()) && a.getAscendant("body",
  9332. 1) && (d(c) ? f.call(this, c) : e ? this.fake(b) : b ? this.selectElement(b) : this.selectRanges(c))
  9333. }
  9334. },
  9335. reset: function() {
  9336. this._.cache = {};
  9337. this.isFake = 0;
  9338. var a = this.root.editor;
  9339. if (a && a._.fakeSelection)
  9340. if (this.rev == a._.fakeSelection.rev) {
  9341. delete a._.fakeSelection;
  9342. var b = a._.hiddenSelectionContainer;
  9343. if (b) {
  9344. var c = a.checkDirty();
  9345. a.fire("lockSnapshot");
  9346. b.remove();
  9347. a.fire("unlockSnapshot");
  9348. !c && a.resetDirty()
  9349. }
  9350. delete a._.hiddenSelectionContainer
  9351. } else CKEDITOR.warn("selection-fake-reset");
  9352. this.rev = J++
  9353. },
  9354. selectElement: function(a) {
  9355. var b =
  9356. new CKEDITOR.dom.range(this.root);
  9357. b.setStartBefore(a);
  9358. b.setEndAfter(a);
  9359. this.selectRanges([b])
  9360. },
  9361. selectRanges: function(a) {
  9362. var b = this.root.editor,
  9363. c = b && b._.hiddenSelectionContainer;
  9364. this.reset();
  9365. if (c)
  9366. 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()));
  9367. if (a.length)
  9368. if (this.isLocked) {
  9369. var k = CKEDITOR.document.getActive();
  9370. this.unlock();
  9371. this.selectRanges(a);
  9372. this.lock();
  9373. k && !k.equals(this.root) && k.focus()
  9374. } else {
  9375. var p;
  9376. a: {
  9377. var n, w;
  9378. if (1 == a.length &&
  9379. !(w = a[0]).collapsed && (p = w.getEnclosedNode()) && p.type == CKEDITOR.NODE_ELEMENT && (w = w.clone(), w.shrink(CKEDITOR.SHRINK_ELEMENT, !0), (n = w.getEnclosedNode()) && n.type == CKEDITOR.NODE_ELEMENT && (p = n), "false" == p.getAttribute("contenteditable"))) break a;p = void 0
  9380. }
  9381. if (p) this.fake(p);
  9382. else if (b && b.plugins.tableselection && CKEDITOR.plugins.tableselection.isSupportedEnvironment && d(a) && !l) f.call(this, a);
  9383. else {
  9384. if (m) {
  9385. n = CKEDITOR.dom.walker.whitespaces(!0);
  9386. p = /\ufeff|\u00a0/;
  9387. w = {
  9388. table: 1,
  9389. tbody: 1,
  9390. tr: 1
  9391. };
  9392. 1 < a.length && (b = a[a.length -
  9393. 1], a[0].setEnd(b.endContainer, b.endOffset));
  9394. b = a[0];
  9395. a = b.collapsed;
  9396. var A, G, I;
  9397. if ((c = b.getEnclosedNode()) && c.type == CKEDITOR.NODE_ELEMENT && c.getName() in M && (!c.is("a") || !c.getText())) try {
  9398. I = c.$.createControlRange();
  9399. I.addElement(c.$);
  9400. I.select();
  9401. return
  9402. } catch (v) {}
  9403. if (b.startContainer.type == CKEDITOR.NODE_ELEMENT && b.startContainer.getName() in w || b.endContainer.type == CKEDITOR.NODE_ELEMENT && b.endContainer.getName() in w) b.shrink(CKEDITOR.NODE_ELEMENT, !0), a = b.collapsed;
  9404. I = b.createBookmark();
  9405. w = I.startNode;
  9406. a || (k = I.endNode);
  9407. I = b.document.$.body.createTextRange();
  9408. I.moveToElementText(w.$);
  9409. I.moveStart("character", 1);
  9410. k ? (p = b.document.$.body.createTextRange(), p.moveToElementText(k.$), I.setEndPoint("EndToEnd", p), I.moveEnd("character", -1)) : (A = w.getNext(n), G = w.hasAscendant("pre"), A = !(A && A.getText && A.getText().match(p)) && (G || !w.hasPrevious() || w.getPrevious().is && w.getPrevious().is("br")), G = b.document.createElement("span"), G.setHtml("\x26#65279;"), G.insertBefore(w), A && b.document.createText("").insertBefore(w));
  9411. b.setStartBefore(w);
  9412. w.remove();
  9413. a ? (A ? (I.moveStart("character", -1), I.select(), b.document.$.selection.clear()) : I.select(), b.moveToPosition(G, CKEDITOR.POSITION_BEFORE_START), G.remove()) : (b.setEndBefore(k), k.remove(), I.select())
  9414. } else {
  9415. k = this.getNative();
  9416. if (!k) return;
  9417. this.removeAllRanges();
  9418. for (I = 0; I < a.length; I++) {
  9419. if (I < a.length - 1 && (A = a[I], G = a[I + 1], p = A.clone(), p.setStart(A.endContainer, A.endOffset), p.setEnd(G.startContainer, G.startOffset), !p.collapsed && (p.shrink(CKEDITOR.NODE_ELEMENT, !0), b = p.getCommonAncestor(), p = p.getEnclosedNode(),
  9420. b.isReadOnly() || p && p.isReadOnly()))) {
  9421. G.setStart(A.startContainer, A.startOffset);
  9422. a.splice(I--, 1);
  9423. continue
  9424. }
  9425. b = a[I];
  9426. G = this.document.$.createRange();
  9427. b.collapsed && CKEDITOR.env.webkit && r(b) && (p = e(this.root), b.insertNode(p), (A = p.getNext()) && !p.getPrevious() && A.type == CKEDITOR.NODE_ELEMENT && "br" == A.getName() ? (y(this.root), b.moveToPosition(A, CKEDITOR.POSITION_BEFORE_START)) : b.moveToPosition(p, CKEDITOR.POSITION_AFTER_END));
  9428. G.setStart(b.startContainer.$, b.startOffset);
  9429. try {
  9430. G.setEnd(b.endContainer.$, b.endOffset)
  9431. } catch (t) {
  9432. if (0 <=
  9433. t.toString().indexOf("NS_ERROR_ILLEGAL_VALUE")) b.collapse(1), G.setEnd(b.endContainer.$, b.endOffset);
  9434. else throw t;
  9435. }
  9436. k.addRange(G)
  9437. }
  9438. }
  9439. this.reset();
  9440. this.root.fire("selectionchange")
  9441. }
  9442. }
  9443. },
  9444. fake: function(a, b) {
  9445. var c = this.root.editor;
  9446. void 0 === b && a.hasAttribute("aria-label") && (b = a.getAttribute("aria-label"));
  9447. this.reset();
  9448. B(c, b);
  9449. var d = this._.cache,
  9450. e = new CKEDITOR.dom.range(this.root);
  9451. e.setStartBefore(a);
  9452. e.setEndAfter(a);
  9453. d.ranges = new CKEDITOR.dom.rangeList(e);
  9454. d.selectedElement = d.startElement = a;
  9455. d.type = CKEDITOR.SELECTION_ELEMENT;
  9456. d.selectedText = d.nativeSel = null;
  9457. this.isFake = 1;
  9458. this.rev = J++;
  9459. c._.fakeSelection = this;
  9460. this.root.fire("selectionchange")
  9461. },
  9462. isHidden: function() {
  9463. var a = this.getCommonAncestor();
  9464. a && a.type == CKEDITOR.NODE_TEXT && (a = a.getParent());
  9465. return !(!a || !a.data("cke-hidden-sel"))
  9466. },
  9467. isInTable: function(a) {
  9468. return d(this.getRanges(), a)
  9469. },
  9470. isCollapsed: function() {
  9471. var a = this.getRanges();
  9472. return 1 === a.length && a[0].collapsed
  9473. },
  9474. createBookmarks: function(a) {
  9475. a = this.getRanges().createBookmarks(a);
  9476. this.isFake && (a.isFake = 1);
  9477. return a
  9478. },
  9479. createBookmarks2: function(a) {
  9480. a =
  9481. this.getRanges().createBookmarks2(a);
  9482. this.isFake && (a.isFake = 1);
  9483. return a
  9484. },
  9485. selectBookmarks: function(a) {
  9486. for (var b = [], c, e = 0; e < a.length; e++) {
  9487. var f = new CKEDITOR.dom.range(this.root);
  9488. f.moveToBookmark(a[e]);
  9489. b.push(f)
  9490. }
  9491. 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));
  9492. a.isFake && !d(b) ? this.fake(c) : this.selectRanges(b);
  9493. return this
  9494. },
  9495. getCommonAncestor: function() {
  9496. var a = this.getRanges();
  9497. return a.length ? a[0].startContainer.getCommonAncestor(a[a.length -
  9498. 1].endContainer) : null
  9499. },
  9500. scrollIntoView: function() {
  9501. this.type != CKEDITOR.SELECTION_NONE && this.getRanges()[0].scrollIntoView()
  9502. },
  9503. removeAllRanges: function() {
  9504. if (this.getType() != CKEDITOR.SELECTION_NONE) {
  9505. var a = this.getNative();
  9506. try {
  9507. a && a[m ? "empty" : "removeAllRanges"]()
  9508. } catch (b) {}
  9509. this.reset()
  9510. }
  9511. }
  9512. }
  9513. })();
  9514. "use strict";
  9515. CKEDITOR.STYLE_BLOCK = 1;
  9516. CKEDITOR.STYLE_INLINE = 2;
  9517. CKEDITOR.STYLE_OBJECT = 3;
  9518. (function() {
  9519. function a(a, b) {
  9520. for (var c, d;
  9521. (a = a.getParent()) && !a.equals(b);)
  9522. if (a.getAttribute("data-nostyle")) c = a;
  9523. else if (!d) {
  9524. var e = a.getAttribute("contentEditable");
  9525. "false" == e ? c = a : "true" == e && (d = 1)
  9526. }
  9527. return c
  9528. }
  9529. function d(a, b, c, d) {
  9530. return (a.getPosition(b) | d) == d && (!c.childRule || c.childRule(a))
  9531. }
  9532. function b(c) {
  9533. var e = c.document;
  9534. if (c.collapsed) e = J(this, e), c.insertNode(e), c.moveToPosition(e, CKEDITOR.POSITION_BEFORE_END);
  9535. else {
  9536. var g = this.element,
  9537. h = this._.definition,
  9538. k, l = h.ignoreReadonly,
  9539. m = l || h.includeReadonly;
  9540. null ==
  9541. m && (m = c.root.getCustomData("cke_includeReadonly"));
  9542. var n = CKEDITOR.dtd[g];
  9543. n || (k = !0, n = CKEDITOR.dtd.span);
  9544. c.enlarge(CKEDITOR.ENLARGE_INLINE, 1);
  9545. c.trim();
  9546. var r = c.createBookmark(),
  9547. v = r.startNode,
  9548. t = r.endNode,
  9549. q = v,
  9550. u;
  9551. if (!l) {
  9552. var x = c.getCommonAncestor(),
  9553. l = a(v, x),
  9554. x = a(t, x);
  9555. l && (q = l.getNextSourceNode(!0));
  9556. x && (t = x)
  9557. }
  9558. for (q.getPosition(t) == CKEDITOR.POSITION_FOLLOWING && (q = 0); q;) {
  9559. l = !1;
  9560. if (q.equals(t)) q = null, l = !0;
  9561. else {
  9562. var y = q.type == CKEDITOR.NODE_ELEMENT ? q.getName() : null,
  9563. x = y && "false" == q.getAttribute("contentEditable"),
  9564. B = y &&
  9565. q.getAttribute("data-nostyle");
  9566. if (y && q.data("cke-bookmark")) {
  9567. q = q.getNextSourceNode(!0);
  9568. continue
  9569. }
  9570. if (x && m && CKEDITOR.dtd.$block[y])
  9571. for (var C = q, E = f(C), F = void 0, H = E.length, K = 0, C = H && new CKEDITOR.dom.range(C.getDocument()); K < H; ++K) {
  9572. var F = E[K],
  9573. L = CKEDITOR.filter.instances[F.data("cke-filter")];
  9574. if (L ? L.check(this) : 1) C.selectNodeContents(F), b.call(this, C)
  9575. }
  9576. E = y ? !n[y] || B ? 0 : x && !m ? 0 : d(q, t, h, P) : 1;
  9577. if (E)
  9578. if (F = q.getParent(), E = h, H = g, K = k, !F || !(F.getDtd() || CKEDITOR.dtd.span)[H] && !K || E.parentRule && !E.parentRule(F)) l = !0;
  9579. else {
  9580. if (u ||
  9581. y && CKEDITOR.dtd.$removeEmpty[y] && (q.getPosition(t) | P) != P || (u = c.clone(), u.setStartBefore(q)), y = q.type, y == CKEDITOR.NODE_TEXT || x || y == CKEDITOR.NODE_ELEMENT && !q.getChildCount()) {
  9582. for (var y = q, M;
  9583. (l = !y.getNext(z)) && (M = y.getParent(), n[M.getName()]) && d(M, v, h, O);) y = M;
  9584. u.setEndAfter(y)
  9585. }
  9586. }
  9587. else l = !0;
  9588. q = q.getNextSourceNode(B || x)
  9589. }
  9590. if (l && u && !u.collapsed) {
  9591. for (var l = J(this, e), x = l.hasAttributes(), B = u.getCommonAncestor(), y = {}, E = {}, F = {}, H = {}, U, R, aa; l && B;) {
  9592. if (B.getName() == g) {
  9593. for (U in h.attributes) !H[U] && (aa = B.getAttribute(R)) &&
  9594. (l.getAttribute(U) == aa ? E[U] = 1 : H[U] = 1);
  9595. for (R in h.styles) !F[R] && (aa = B.getStyle(R)) && (l.getStyle(R) == aa ? y[R] = 1 : F[R] = 1)
  9596. }
  9597. B = B.getParent()
  9598. }
  9599. for (U in E) l.removeAttribute(U);
  9600. for (R in y) l.removeStyle(R);
  9601. x && !l.hasAttributes() && (l = null);
  9602. l ? (u.extractContents().appendTo(l), u.insertNode(l), D.call(this, l), l.mergeSiblings(), CKEDITOR.env.ie || l.$.normalize()) : (l = new CKEDITOR.dom.element("span"), u.extractContents().appendTo(l), u.insertNode(l), D.call(this, l), l.remove(!0));
  9603. u = null
  9604. }
  9605. }
  9606. c.moveToBookmark(r);
  9607. c.shrink(CKEDITOR.SHRINK_TEXT);
  9608. c.shrink(CKEDITOR.NODE_ELEMENT, !0)
  9609. }
  9610. }
  9611. function c(a) {
  9612. function b() {
  9613. for (var a = new CKEDITOR.dom.elementPath(d.getParent()), c = new CKEDITOR.dom.elementPath(n.getParent()), e = null, f = null, g = 0; g < a.elements.length; g++) {
  9614. var h = a.elements[g];
  9615. if (h == a.block || h == a.blockLimit) break;
  9616. r.checkElementRemovable(h, !0) && (e = h)
  9617. }
  9618. for (g = 0; g < c.elements.length; g++) {
  9619. h = c.elements[g];
  9620. if (h == c.block || h == c.blockLimit) break;
  9621. r.checkElementRemovable(h, !0) && (f = h)
  9622. }
  9623. f && n.breakParent(f);
  9624. e && d.breakParent(e)
  9625. }
  9626. a.enlarge(CKEDITOR.ENLARGE_INLINE, 1);
  9627. var c =
  9628. a.createBookmark(),
  9629. d = c.startNode,
  9630. e = this._.definition.alwaysRemoveElement;
  9631. if (a.collapsed) {
  9632. 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++)
  9633. if (this.checkElementRemovable(k)) {
  9634. var m;
  9635. !e && a.collapsed && (a.checkBoundaryOfElement(k, CKEDITOR.END) || (m = a.checkBoundaryOfElement(k, CKEDITOR.START))) ? (g = k, g.match = m ? "start" : "end") : (k.mergeSiblings(), k.is(this.element) ? B.call(this, k) : x(k, l(this)[k.getName()]))
  9636. } if (g) {
  9637. e = d;
  9638. for (h =
  9639. 0;; h++) {
  9640. k = f.elements[h];
  9641. if (k.equals(g)) break;
  9642. else if (k.match) continue;
  9643. else k = k.clone();
  9644. k.append(e);
  9645. e = k
  9646. }
  9647. e["start" == g.match ? "insertBefore" : "insertAfter"](g)
  9648. }
  9649. } else {
  9650. var n = c.endNode,
  9651. r = this;
  9652. b();
  9653. for (f = d; !f.equals(n);) g = f.getNextSourceNode(), f.type == CKEDITOR.NODE_ELEMENT && this.checkElementRemovable(f) && (f.getName() == this.element ? B.call(this, f) : x(f, l(this)[f.getName()]), g.type == CKEDITOR.NODE_ELEMENT && g.contains(d) && (b(), g = d.getNext())), f = g
  9654. }
  9655. a.moveToBookmark(c);
  9656. a.shrink(CKEDITOR.NODE_ELEMENT, !0)
  9657. }
  9658. function f(a) {
  9659. var b = [];
  9660. a.forEach(function(a) {
  9661. if ("true" == a.getAttribute("contenteditable")) return b.push(a), !1
  9662. }, CKEDITOR.NODE_ELEMENT, !0);
  9663. return b
  9664. }
  9665. function h(a) {
  9666. var b = a.getEnclosedNode() || a.getCommonAncestor(!1, !0);
  9667. (a = (new CKEDITOR.dom.elementPath(b, a.root)).contains(this.element, 1)) && !a.isReadOnly() && u(a, this)
  9668. }
  9669. function k(a) {
  9670. var b = a.getCommonAncestor(!0, !0);
  9671. if (a = (new CKEDITOR.dom.elementPath(b, a.root)).contains(this.element, 1)) {
  9672. var b = this._.definition,
  9673. c = b.attributes;
  9674. if (c)
  9675. for (var d in c) a.removeAttribute(d, c[d]);
  9676. if (b.styles)
  9677. for (var e in b.styles) b.styles.hasOwnProperty(e) &&
  9678. a.removeStyle(e)
  9679. }
  9680. }
  9681. function g(a) {
  9682. var b = a.createBookmark(!0),
  9683. c = a.createIterator();
  9684. c.enforceRealBlocks = !0;
  9685. this._.enterMode && (c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR);
  9686. for (var d, e = a.document, f; d = c.getNextParagraph();) !d.isReadOnly() && (c.activeFilter ? c.activeFilter.check(this) : 1) && (f = J(this, e, d), r(d, f));
  9687. a.moveToBookmark(b)
  9688. }
  9689. function n(a) {
  9690. var b = a.createBookmark(1),
  9691. c = a.createIterator();
  9692. c.enforceRealBlocks = !0;
  9693. c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR;
  9694. for (var d, e; d = c.getNextParagraph();) this.checkElementRemovable(d) &&
  9695. (d.is("pre") ? ((e = this._.enterMode == CKEDITOR.ENTER_BR ? null : a.document.createElement(this._.enterMode == CKEDITOR.ENTER_P ? "p" : "div")) && d.copyAttributes(e), r(d, e)) : B.call(this, d));
  9696. a.moveToBookmark(b)
  9697. }
  9698. function r(a, b) {
  9699. var c = !b;
  9700. c && (b = a.getDocument().createElement("div"), a.copyAttributes(b));
  9701. var d = b && b.is("pre"),
  9702. f = a.is("pre"),
  9703. g = !d && f;
  9704. if (d && !f) {
  9705. f = b;
  9706. (g = a.getBogus()) && g.remove();
  9707. g = a.getHtml();
  9708. g = y(g, /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, "");
  9709. g = g.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi, "$1");
  9710. g = g.replace(/([ \t\n\r]+|&nbsp;)/g,
  9711. " ");
  9712. g = g.replace(/<br\b[^>]*>/gi, "\n");
  9713. if (CKEDITOR.env.ie) {
  9714. var h = a.getDocument().createElement("div");
  9715. h.append(f);
  9716. f.$.outerHTML = "\x3cpre\x3e" + g + "\x3c/pre\x3e";
  9717. f.copyAttributes(h.getFirst());
  9718. f = h.getFirst().remove()
  9719. } else f.setHtml(g);
  9720. b = f
  9721. } else g ? b = v(c ? [a.getHtml()] : e(a), b) : a.moveChildren(b);
  9722. b.replace(a);
  9723. if (d) {
  9724. var c = b,
  9725. k;
  9726. (k = c.getPrevious(H)) && k.type == CKEDITOR.NODE_ELEMENT && k.is("pre") && (d = y(k.getHtml(), /\n$/, "") + "\n\n" + y(c.getHtml(), /^\n/, ""), CKEDITOR.env.ie ? c.$.outerHTML = "\x3cpre\x3e" + d + "\x3c/pre\x3e" :
  9727. c.setHtml(d), k.remove())
  9728. } else c && m(b)
  9729. }
  9730. function e(a) {
  9731. var b = [];
  9732. y(a.getOuterHtml(), /(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi, function(a, b, c) {
  9733. return b + "\x3c/pre\x3e" + c + "\x3cpre\x3e"
  9734. }).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi, function(a, c) {
  9735. b.push(c)
  9736. });
  9737. return b
  9738. }
  9739. function y(a, b, c) {
  9740. var d = "",
  9741. e = "";
  9742. a = a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi, function(a, b, c) {
  9743. b && (d = b);
  9744. c && (e = c);
  9745. return ""
  9746. });
  9747. return d + a.replace(b, c) + e
  9748. }
  9749. function v(a, b) {
  9750. var c;
  9751. 1 < a.length && (c = new CKEDITOR.dom.documentFragment(b.getDocument()));
  9752. for (var d = 0; d < a.length; d++) {
  9753. var e = a[d],
  9754. e = e.replace(/(\r\n|\r)/g, "\n"),
  9755. e = y(e, /^[ \t]*\n/, ""),
  9756. e = y(e, /\n$/, ""),
  9757. e = y(e, /^[ \t]+|[ \t]+$/g, function(a, b) {
  9758. return 1 == a.length ? "\x26nbsp;" : b ? " " + CKEDITOR.tools.repeat("\x26nbsp;", a.length - 1) : CKEDITOR.tools.repeat("\x26nbsp;", a.length - 1) + " "
  9759. }),
  9760. e = e.replace(/\n/g, "\x3cbr\x3e"),
  9761. e = e.replace(/[ \t]{2,}/g, function(a) {
  9762. return CKEDITOR.tools.repeat("\x26nbsp;", a.length - 1) + " "
  9763. });
  9764. if (c) {
  9765. var f = b.clone();
  9766. f.setHtml(e);
  9767. c.append(f)
  9768. } else b.setHtml(e)
  9769. }
  9770. return c || b
  9771. }
  9772. function B(a, b) {
  9773. var c = this._.definition,
  9774. d = c.attributes,
  9775. c = c.styles,
  9776. e = l(this)[a.getName()],
  9777. f = CKEDITOR.tools.isEmpty(d) && CKEDITOR.tools.isEmpty(c),
  9778. g;
  9779. for (g in d)
  9780. if ("class" != g && !this._.definition.fullMatch || a.getAttribute(g) == t(g, d[g])) b && "data-" == g.slice(0, 5) || (f = a.hasAttribute(g), a.removeAttribute(g));
  9781. for (var h in c) this._.definition.fullMatch && a.getStyle(h) != t(h, c[h], !0) || (f = f || !!a.getStyle(h), a.removeStyle(h));
  9782. x(a, e, C[a.getName()]);
  9783. f && (this._.definition.alwaysRemoveElement ?
  9784. m(a, 1) : !CKEDITOR.dtd.$block[a.getName()] || this._.enterMode == CKEDITOR.ENTER_BR && !a.hasAttributes() ? m(a) : a.renameNode(this._.enterMode == CKEDITOR.ENTER_P ? "p" : "div"))
  9785. }
  9786. function D(a) {
  9787. for (var b = l(this), c = a.getElementsByTag(this.element), d, e = c.count(); 0 <= --e;) d = c.getItem(e), d.isReadOnly() || B.call(this, d, !0);
  9788. for (var f in b)
  9789. if (f != this.element)
  9790. for (c = a.getElementsByTag(f), e = c.count() - 1; 0 <= e; e--) d = c.getItem(e), d.isReadOnly() || x(d, b[f])
  9791. }
  9792. function x(a, b, c) {
  9793. if (b = b && b.attributes)
  9794. for (var d = 0; d < b.length; d++) {
  9795. var e = b[d][0],
  9796. f;
  9797. if (f = a.getAttribute(e)) {
  9798. var g = b[d][1];
  9799. (null === g || g.test && g.test(f) || "string" == typeof g && f == g) && a.removeAttribute(e)
  9800. }
  9801. }
  9802. c || m(a)
  9803. }
  9804. function m(a, b) {
  9805. if (!a.hasAttributes() || b)
  9806. if (CKEDITOR.dtd.$block[a.getName()]) {
  9807. var c = a.getPrevious(H),
  9808. d = a.getNext(H);
  9809. !c || c.type != CKEDITOR.NODE_TEXT && c.isBlockBoundary({
  9810. br: 1
  9811. }) || a.append("br", 1);
  9812. !d || d.type != CKEDITOR.NODE_TEXT && d.isBlockBoundary({
  9813. br: 1
  9814. }) || a.append("br");
  9815. a.remove(!0)
  9816. } else c = a.getFirst(), d = a.getLast(), a.remove(!0), c && (c.type == CKEDITOR.NODE_ELEMENT && c.mergeSiblings(),
  9817. d && !c.equals(d) && d.type == CKEDITOR.NODE_ELEMENT && d.mergeSiblings())
  9818. }
  9819. function J(a, b, c) {
  9820. var d;
  9821. d = a.element;
  9822. "*" == d && (d = "span");
  9823. d = new CKEDITOR.dom.element(d, b);
  9824. c && c.copyAttributes(d);
  9825. d = u(d, a);
  9826. b.getCustomData("doc_processing_style") && d.hasAttribute("id") ? d.removeAttribute("id") : b.setCustomData("doc_processing_style", 1);
  9827. return d
  9828. }
  9829. function u(a, b) {
  9830. var c = b._.definition,
  9831. d = c.attributes,
  9832. c = CKEDITOR.style.getStyleText(c);
  9833. if (d)
  9834. for (var e in d) a.setAttribute(e, d[e]);
  9835. c && a.setAttribute("style", c);
  9836. a.getDocument().removeCustomData("doc_processing_style");
  9837. return a
  9838. }
  9839. function K(a, b) {
  9840. for (var c in a) a[c] = a[c].replace(E, function(a, c) {
  9841. return b[c]
  9842. })
  9843. }
  9844. function l(a) {
  9845. if (a._.overrides) return a._.overrides;
  9846. var b = a._.overrides = {},
  9847. c = a._.definition.overrides;
  9848. if (c) {
  9849. CKEDITOR.tools.isArray(c) || (c = [c]);
  9850. for (var d = 0; d < c.length; d++) {
  9851. var e = c[d],
  9852. f, g;
  9853. "string" == typeof e ? f = e.toLowerCase() : (f = e.element ? e.element.toLowerCase() : a.element, g = e.attributes);
  9854. e = b[f] || (b[f] = {});
  9855. if (g) {
  9856. var e = e.attributes = e.attributes || [],
  9857. h;
  9858. for (h in g) e.push([h.toLowerCase(), g[h]])
  9859. }
  9860. }
  9861. }
  9862. return b
  9863. }
  9864. function t(a,
  9865. b, c) {
  9866. var d = new CKEDITOR.dom.element("span");
  9867. d[c ? "setStyle" : "setAttribute"](a, b);
  9868. return d[c ? "getStyle" : "getAttribute"](a)
  9869. }
  9870. function F(a, b) {
  9871. function c(a, b) {
  9872. return "font-family" == b.toLowerCase() ? a.replace(/["']/g, "") : a
  9873. }
  9874. "string" == typeof a && (a = CKEDITOR.tools.parseCssText(a));
  9875. "string" == typeof b && (b = CKEDITOR.tools.parseCssText(b, !0));
  9876. for (var d in a)
  9877. if (!(d in b) || c(b[d], d) != c(a[d], d) && "inherit" != a[d] && "inherit" != b[d]) return !1;
  9878. return !0
  9879. }
  9880. function L(a, b, c) {
  9881. var d = a.getRanges();
  9882. b = b ? this.removeFromRange : this.applyToRange;
  9883. var e, f;
  9884. if (a.isFake && a.isInTable())
  9885. for (e = [], f = 0; f < d.length; f++) e.push(d[f].clone());
  9886. for (var g = d.createIterator(); f = g.getNextRange();) b.call(this, f, c);
  9887. a.selectRanges(e || d)
  9888. }
  9889. var C = {
  9890. address: 1,
  9891. div: 1,
  9892. h1: 1,
  9893. h2: 1,
  9894. h3: 1,
  9895. h4: 1,
  9896. h5: 1,
  9897. h6: 1,
  9898. p: 1,
  9899. pre: 1,
  9900. section: 1,
  9901. header: 1,
  9902. footer: 1,
  9903. nav: 1,
  9904. article: 1,
  9905. aside: 1,
  9906. figure: 1,
  9907. dialog: 1,
  9908. hgroup: 1,
  9909. time: 1,
  9910. meter: 1,
  9911. menu: 1,
  9912. command: 1,
  9913. keygen: 1,
  9914. output: 1,
  9915. progress: 1,
  9916. details: 1,
  9917. datagrid: 1,
  9918. datalist: 1
  9919. },
  9920. M = {
  9921. a: 1,
  9922. blockquote: 1,
  9923. embed: 1,
  9924. hr: 1,
  9925. img: 1,
  9926. li: 1,
  9927. object: 1,
  9928. ol: 1,
  9929. table: 1,
  9930. td: 1,
  9931. tr: 1,
  9932. th: 1,
  9933. ul: 1,
  9934. dl: 1,
  9935. dt: 1,
  9936. dd: 1,
  9937. form: 1,
  9938. audio: 1,
  9939. video: 1
  9940. },
  9941. q = /\s*(?:;\s*|$)/,
  9942. E = /#\((.+?)\)/g,
  9943. z = CKEDITOR.dom.walker.bookmark(0, 1),
  9944. H = CKEDITOR.dom.walker.whitespaces(1);
  9945. CKEDITOR.style = function(a, b) {
  9946. if ("string" == typeof a.type) return new CKEDITOR.style.customHandlers[a.type](a);
  9947. var c = a.attributes;
  9948. c && c.style && (a.styles = CKEDITOR.tools.extend({}, a.styles, CKEDITOR.tools.parseCssText(c.style)), delete c.style);
  9949. b && (a = CKEDITOR.tools.clone(a), K(a.attributes, b), K(a.styles, b));
  9950. c = this.element = a.element ? "string" == typeof a.element ? a.element.toLowerCase() :
  9951. a.element : "*";
  9952. this.type = a.type || (C[c] ? CKEDITOR.STYLE_BLOCK : M[c] ? CKEDITOR.STYLE_OBJECT : CKEDITOR.STYLE_INLINE);
  9953. "object" == typeof this.element && (this.type = CKEDITOR.STYLE_OBJECT);
  9954. this._ = {
  9955. definition: a
  9956. }
  9957. };
  9958. CKEDITOR.style.prototype = {
  9959. apply: function(a) {
  9960. if (a instanceof CKEDITOR.dom.document) return L.call(this, a.getSelection());
  9961. if (this.checkApplicable(a.elementPath(), a)) {
  9962. var b = this._.enterMode;
  9963. b || (this._.enterMode = a.activeEnterMode);
  9964. L.call(this, a.getSelection(), 0, a);
  9965. this._.enterMode = b
  9966. }
  9967. },
  9968. remove: function(a) {
  9969. if (a instanceof CKEDITOR.dom.document) return L.call(this, a.getSelection(), 1);
  9970. if (this.checkApplicable(a.elementPath(), a)) {
  9971. var b = this._.enterMode;
  9972. b || (this._.enterMode = a.activeEnterMode);
  9973. L.call(this, a.getSelection(), 1, a);
  9974. this._.enterMode = b
  9975. }
  9976. },
  9977. applyToRange: function(a) {
  9978. this.applyToRange = this.type == CKEDITOR.STYLE_INLINE ? b : this.type == CKEDITOR.STYLE_BLOCK ? g : this.type == CKEDITOR.STYLE_OBJECT ? h : null;
  9979. return this.applyToRange(a)
  9980. },
  9981. removeFromRange: function(a) {
  9982. this.removeFromRange = this.type == CKEDITOR.STYLE_INLINE ? c : this.type == CKEDITOR.STYLE_BLOCK ?
  9983. n : this.type == CKEDITOR.STYLE_OBJECT ? k : null;
  9984. return this.removeFromRange(a)
  9985. },
  9986. applyToObject: function(a) {
  9987. u(a, this)
  9988. },
  9989. checkActive: function(a, b) {
  9990. switch (this.type) {
  9991. case CKEDITOR.STYLE_BLOCK:
  9992. return this.checkElementRemovable(a.block || a.blockLimit, !0, b);
  9993. case CKEDITOR.STYLE_OBJECT:
  9994. case CKEDITOR.STYLE_INLINE:
  9995. for (var c = a.elements, d = 0, e; d < c.length; d++)
  9996. if (e = c[d], this.type != CKEDITOR.STYLE_INLINE || e != a.block && e != a.blockLimit) {
  9997. if (this.type == CKEDITOR.STYLE_OBJECT) {
  9998. var f = e.getName();
  9999. if (!("string" == typeof this.element ?
  10000. f == this.element : f in this.element)) continue
  10001. }
  10002. if (this.checkElementRemovable(e, !0, b)) return !0
  10003. }
  10004. }
  10005. return !1
  10006. },
  10007. checkApplicable: function(a, b, c) {
  10008. b && b instanceof CKEDITOR.filter && (c = b);
  10009. if (c && !c.check(this)) return !1;
  10010. switch (this.type) {
  10011. case CKEDITOR.STYLE_OBJECT:
  10012. return !!a.contains(this.element);
  10013. case CKEDITOR.STYLE_BLOCK:
  10014. return !!a.blockLimit.getDtd()[this.element]
  10015. }
  10016. return !0
  10017. },
  10018. checkElementMatch: function(a, b) {
  10019. var c = this._.definition;
  10020. if (!a || !c.ignoreReadonly && a.isReadOnly()) return !1;
  10021. var d = a.getName();
  10022. if ("string" == typeof this.element ?
  10023. d == this.element : d in this.element) {
  10024. if (!b && !a.hasAttributes()) return !0;
  10025. if (d = c._AC) c = d;
  10026. else {
  10027. var d = {},
  10028. e = 0,
  10029. f = c.attributes;
  10030. if (f)
  10031. for (var g in f) e++, d[g] = f[g];
  10032. if (g = CKEDITOR.style.getStyleText(c)) d.style || e++, d.style = g;
  10033. d._length = e;
  10034. c = c._AC = d
  10035. }
  10036. if (c._length) {
  10037. for (var h in c)
  10038. if ("_length" != h)
  10039. if (d = a.getAttribute(h) || "", "style" == h ? F(c[h], d) : c[h] == d) {
  10040. if (!b) return !0
  10041. } else if (b) return !1;
  10042. if (b) return !0
  10043. } else return !0
  10044. }
  10045. return !1
  10046. },
  10047. checkElementRemovable: function(a, b, c) {
  10048. if (this.checkElementMatch(a, b, c)) return !0;
  10049. if (b = l(this)[a.getName()]) {
  10050. var d;
  10051. if (!(b = b.attributes)) return !0;
  10052. for (c = 0; c < b.length; c++)
  10053. if (d = b[c][0], d = a.getAttribute(d)) {
  10054. var e = b[c][1];
  10055. if (null === e) return !0;
  10056. if ("string" == typeof e) {
  10057. if (d == e) return !0
  10058. } else if (e.test(d)) return !0
  10059. }
  10060. }
  10061. return !1
  10062. },
  10063. buildPreview: function(a) {
  10064. var b = this._.definition,
  10065. c = [],
  10066. d = b.element;
  10067. "bdo" == d && (d = "span");
  10068. var c = ["\x3c", d],
  10069. e = b.attributes;
  10070. if (e)
  10071. for (var f in e) c.push(" ", f, '\x3d"', e[f], '"');
  10072. (e = CKEDITOR.style.getStyleText(b)) && c.push(' style\x3d"', e, '"');
  10073. c.push("\x3e", a || b.name, "\x3c/", d, "\x3e");
  10074. return c.join("")
  10075. },
  10076. getDefinition: function() {
  10077. return this._.definition
  10078. }
  10079. };
  10080. CKEDITOR.style.getStyleText = function(a) {
  10081. var b = a._ST;
  10082. if (b) return b;
  10083. var b = a.styles,
  10084. c = a.attributes && a.attributes.style || "",
  10085. d = "";
  10086. c.length && (c = c.replace(q, ";"));
  10087. for (var e in b) {
  10088. var f = b[e],
  10089. g = (e + ":" + f).replace(q, ";");
  10090. "inherit" == f ? d += g : c += g
  10091. }
  10092. c.length && (c = CKEDITOR.tools.normalizeCssText(c, !0));
  10093. return a._ST = c + d
  10094. };
  10095. CKEDITOR.style.customHandlers = {};
  10096. CKEDITOR.style.addCustomHandler = function(a) {
  10097. var b = function(a) {
  10098. this._ = {
  10099. definition: a
  10100. };
  10101. this.setup && this.setup(a)
  10102. };
  10103. b.prototype = CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype), {
  10104. assignedTo: CKEDITOR.STYLE_OBJECT
  10105. }, a, !0);
  10106. return this.customHandlers[a.type] = b
  10107. };
  10108. var P = CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED,
  10109. O = CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED
  10110. })();
  10111. CKEDITOR.styleCommand = function(a, d) {
  10112. this.requiredContent = this.allowedContent = this.style = a;
  10113. CKEDITOR.tools.extend(this, d, !0)
  10114. };
  10115. CKEDITOR.styleCommand.prototype.exec = function(a) {
  10116. a.focus();
  10117. this.state == CKEDITOR.TRISTATE_OFF ? a.applyStyle(this.style) : this.state == CKEDITOR.TRISTATE_ON && a.removeStyle(this.style)
  10118. };
  10119. CKEDITOR.stylesSet = new CKEDITOR.resourceManager("", "stylesSet");
  10120. CKEDITOR.addStylesSet = CKEDITOR.tools.bind(CKEDITOR.stylesSet.add, CKEDITOR.stylesSet);
  10121. CKEDITOR.loadStylesSet = function(a, d, b) {
  10122. CKEDITOR.stylesSet.addExternal(a, d, "");
  10123. CKEDITOR.stylesSet.load(a, b)
  10124. };
  10125. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  10126. attachStyleStateChange: function(a, d) {
  10127. var b = this._.styleStateChangeCallbacks;
  10128. b || (b = this._.styleStateChangeCallbacks = [], this.on("selectionChange", function(a) {
  10129. for (var d = 0; d < b.length; d++) {
  10130. var h = b[d],
  10131. k = h.style.checkActive(a.data.path, this) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF;
  10132. h.fn.call(this, k)
  10133. }
  10134. }));
  10135. b.push({
  10136. style: a,
  10137. fn: d
  10138. })
  10139. },
  10140. applyStyle: function(a) {
  10141. a.apply(this)
  10142. },
  10143. removeStyle: function(a) {
  10144. a.remove(this)
  10145. },
  10146. getStylesSet: function(a) {
  10147. if (this._.stylesDefinitions) a(this._.stylesDefinitions);
  10148. else {
  10149. var d = this,
  10150. b = d.config.stylesCombo_stylesSet || d.config.stylesSet;
  10151. if (!1 === b) a(null);
  10152. else if (b instanceof Array) d._.stylesDefinitions = b, a(b);
  10153. else {
  10154. b || (b = "default");
  10155. var b = b.split(":"),
  10156. c = b[0];
  10157. CKEDITOR.stylesSet.addExternal(c, b[1] ? b.slice(1).join(":") : CKEDITOR.getUrl("styles.js"), "");
  10158. CKEDITOR.stylesSet.load(c, function(b) {
  10159. d._.stylesDefinitions = b[c];
  10160. a(d._.stylesDefinitions)
  10161. })
  10162. }
  10163. }
  10164. }
  10165. });
  10166. CKEDITOR.dom.comment = function(a, d) {
  10167. "string" == typeof a && (a = (d ? d.$ : document).createComment(a));
  10168. CKEDITOR.dom.domObject.call(this, a)
  10169. };
  10170. CKEDITOR.dom.comment.prototype = new CKEDITOR.dom.node;
  10171. CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype, {
  10172. type: CKEDITOR.NODE_COMMENT,
  10173. getOuterHtml: function() {
  10174. return "\x3c!--" + this.$.nodeValue + "--\x3e"
  10175. }
  10176. });
  10177. "use strict";
  10178. (function() {
  10179. var a = {},
  10180. d = {},
  10181. b;
  10182. for (b in CKEDITOR.dtd.$blockLimit) b in CKEDITOR.dtd.$list || (a[b] = 1);
  10183. for (b in CKEDITOR.dtd.$block) b in CKEDITOR.dtd.$blockLimit || b in CKEDITOR.dtd.$empty || (d[b] = 1);
  10184. CKEDITOR.dom.elementPath = function(b, f) {
  10185. var h = null,
  10186. k = null,
  10187. g = [],
  10188. n = b,
  10189. r;
  10190. f = f || b.getDocument().getBody();
  10191. n || (n = f);
  10192. do
  10193. if (n.type == CKEDITOR.NODE_ELEMENT) {
  10194. g.push(n);
  10195. if (!this.lastElement && (this.lastElement = n, n.is(CKEDITOR.dtd.$object) || "false" == n.getAttribute("contenteditable"))) continue;
  10196. if (n.equals(f)) break;
  10197. if (!k && (r = n.getName(),
  10198. "true" == n.getAttribute("contenteditable") ? k = n : !h && d[r] && (h = n), a[r])) {
  10199. if (r = !h && "div" == r) {
  10200. a: {
  10201. r = n.getChildren();
  10202. for (var e = 0, y = r.count(); e < y; e++) {
  10203. var v = r.getItem(e);
  10204. if (v.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$block[v.getName()]) {
  10205. r = !0;
  10206. break a
  10207. }
  10208. }
  10209. r = !1
  10210. }
  10211. r = !r
  10212. }
  10213. r ? h = n : k = n
  10214. }
  10215. } while (n = n.getParent());
  10216. k || (k = f);
  10217. this.block = h;
  10218. this.blockLimit = k;
  10219. this.root = f;
  10220. this.elements = g
  10221. }
  10222. })();
  10223. CKEDITOR.dom.elementPath.prototype = {
  10224. compare: function(a) {
  10225. var d = this.elements;
  10226. a = a && a.elements;
  10227. if (!a || d.length != a.length) return !1;
  10228. for (var b = 0; b < d.length; b++)
  10229. if (!d[b].equals(a[b])) return !1;
  10230. return !0
  10231. },
  10232. contains: function(a, d, b) {
  10233. var c = 0,
  10234. f;
  10235. "string" == typeof a && (f = function(b) {
  10236. return b.getName() == a
  10237. });
  10238. a instanceof CKEDITOR.dom.element ? f = function(b) {
  10239. return b.equals(a)
  10240. } : CKEDITOR.tools.isArray(a) ? f = function(b) {
  10241. return -1 < CKEDITOR.tools.indexOf(a, b.getName())
  10242. } : "function" == typeof a ? f = a : "object" == typeof a && (f = function(b) {
  10243. return b.getName() in
  10244. a
  10245. });
  10246. var h = this.elements,
  10247. k = h.length;
  10248. d && (b ? c += 1 : --k);
  10249. b && (h = Array.prototype.slice.call(h, 0), h.reverse());
  10250. for (; c < k; c++)
  10251. if (f(h[c])) return h[c];
  10252. return null
  10253. },
  10254. isContextFor: function(a) {
  10255. var d;
  10256. 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
  10257. },
  10258. direction: function() {
  10259. return (this.block || this.blockLimit || this.root).getDirection(1)
  10260. }
  10261. };
  10262. CKEDITOR.dom.text = function(a, d) {
  10263. "string" == typeof a && (a = (d ? d.$ : document).createTextNode(a));
  10264. this.$ = a
  10265. };
  10266. CKEDITOR.dom.text.prototype = new CKEDITOR.dom.node;
  10267. CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype, {
  10268. type: CKEDITOR.NODE_TEXT,
  10269. getLength: function() {
  10270. return this.$.nodeValue.length
  10271. },
  10272. getText: function() {
  10273. return this.$.nodeValue
  10274. },
  10275. setText: function(a) {
  10276. this.$.nodeValue = a
  10277. },
  10278. split: function(a) {
  10279. var d = this.$.parentNode,
  10280. b = d.childNodes.length,
  10281. c = this.getLength(),
  10282. f = this.getDocument(),
  10283. h = new CKEDITOR.dom.text(this.$.splitText(a), f);
  10284. d.childNodes.length == b && (a >= c ? (h = f.createText(""), h.insertAfter(this)) : (a = f.createText(""), a.insertAfter(h), a.remove()));
  10285. return h
  10286. },
  10287. substring: function(a,
  10288. d) {
  10289. return "number" != typeof d ? this.$.nodeValue.substr(a) : this.$.nodeValue.substring(a, d)
  10290. }
  10291. });
  10292. (function() {
  10293. function a(a, c, d) {
  10294. var h = a.serializable,
  10295. k = c[d ? "endContainer" : "startContainer"],
  10296. g = d ? "endOffset" : "startOffset",
  10297. n = h ? c.document.getById(a.startNode) : a.startNode;
  10298. a = h ? c.document.getById(a.endNode) : a.endNode;
  10299. k.equals(n.getPrevious()) ? (c.startOffset = c.startOffset - k.getLength() - a.getPrevious().getLength(), k = a.getNext()) : k.equals(a.getPrevious()) && (c.startOffset -= k.getLength(), k = a.getNext());
  10300. k.equals(n.getParent()) && c[g]++;
  10301. k.equals(a.getParent()) && c[g]++;
  10302. c[d ? "endContainer" : "startContainer"] = k;
  10303. return c
  10304. }
  10305. CKEDITOR.dom.rangeList = function(a) {
  10306. if (a instanceof CKEDITOR.dom.rangeList) return a;
  10307. a ? a instanceof CKEDITOR.dom.range && (a = [a]) : a = [];
  10308. return CKEDITOR.tools.extend(a, d)
  10309. };
  10310. var d = {
  10311. createIterator: function() {
  10312. var a = this,
  10313. c = CKEDITOR.dom.walker.bookmark(),
  10314. d = [],
  10315. h;
  10316. return {
  10317. getNextRange: function(k) {
  10318. h = void 0 === h ? 0 : h + 1;
  10319. var g = a[h];
  10320. if (g && 1 < a.length) {
  10321. if (!h)
  10322. for (var n = a.length - 1; 0 <= n; n--) d.unshift(a[n].createBookmark(!0));
  10323. if (k)
  10324. for (var r = 0; a[h + r + 1];) {
  10325. var e = g.document;
  10326. k = 0;
  10327. n = e.getById(d[r].endNode);
  10328. for (e = e.getById(d[r + 1].startNode);;) {
  10329. n =
  10330. n.getNextSourceNode(!1);
  10331. if (e.equals(n)) k = 1;
  10332. else if (c(n) || n.type == CKEDITOR.NODE_ELEMENT && n.isBlockBoundary()) continue;
  10333. break
  10334. }
  10335. if (!k) break;
  10336. r++
  10337. }
  10338. for (g.moveToBookmark(d.shift()); r--;) n = a[++h], n.moveToBookmark(d.shift()), g.setEnd(n.endContainer, n.endOffset)
  10339. }
  10340. return g
  10341. }
  10342. }
  10343. },
  10344. createBookmarks: function(b) {
  10345. for (var c = [], d, h = 0; h < this.length; h++) {
  10346. c.push(d = this[h].createBookmark(b, !0));
  10347. for (var k = h + 1; k < this.length; k++) this[k] = a(d, this[k]), this[k] = a(d, this[k], !0)
  10348. }
  10349. return c
  10350. },
  10351. createBookmarks2: function(a) {
  10352. for (var c = [], d = 0; d <
  10353. this.length; d++) c.push(this[d].createBookmark2(a));
  10354. return c
  10355. },
  10356. moveToBookmarks: function(a) {
  10357. for (var c = 0; c < this.length; c++) this[c].moveToBookmark(a[c])
  10358. }
  10359. }
  10360. })();
  10361. (function() {
  10362. function a() {
  10363. return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1] || "skins/" + CKEDITOR.skinName.split(",")[0] + "/")
  10364. }
  10365. function d(b) {
  10366. var c = CKEDITOR.skin["ua_" + b],
  10367. d = CKEDITOR.env;
  10368. if (c)
  10369. for (var c = c.split(",").sort(function(a, b) {
  10370. return a > b ? -1 : 1
  10371. }), f = 0, g; f < c.length; f++)
  10372. if (g = c[f], d.ie && (g.replace(/^ie/, "") == d.version || d.quirks && "iequirks" == g) && (g = "ie"), d[g]) {
  10373. b += "_" + c[f];
  10374. break
  10375. } return CKEDITOR.getUrl(a() + b + ".css")
  10376. }
  10377. function b(a, b) {
  10378. h[a] || (CKEDITOR.document.appendStyleSheet(d(a)), h[a] = 1);
  10379. b && b()
  10380. }
  10381. function c(a) {
  10382. var b =
  10383. a.getById(k);
  10384. b || (b = a.getHead().append("style"), b.setAttribute("id", k), b.setAttribute("type", "text/css"));
  10385. return b
  10386. }
  10387. function f(a, b, c) {
  10388. var d, f, g;
  10389. if (CKEDITOR.env.webkit)
  10390. for (b = b.split("}").slice(0, -1), f = 0; f < b.length; f++) b[f] = b[f].split("{");
  10391. for (var h = 0; h < a.length; h++)
  10392. if (CKEDITOR.env.webkit)
  10393. for (f = 0; f < b.length; f++) {
  10394. g = b[f][1];
  10395. for (d = 0; d < c.length; d++) g = g.replace(c[d][0], c[d][1]);
  10396. a[h].$.sheet.addRule(b[f][0], g)
  10397. } else {
  10398. g = b;
  10399. for (d = 0; d < c.length; d++) g = g.replace(c[d][0], c[d][1]);
  10400. CKEDITOR.env.ie && 11 > CKEDITOR.env.version ?
  10401. a[h].$.styleSheet.cssText += g : a[h].$.innerHTML += g
  10402. }
  10403. }
  10404. var h = {};
  10405. CKEDITOR.skin = {
  10406. path: a,
  10407. loadPart: function(c, d) {
  10408. CKEDITOR.skin.name != CKEDITOR.skinName.split(",")[0] ? CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a() + "skin.js"), function() {
  10409. b(c, d)
  10410. }) : b(c, d)
  10411. },
  10412. getPath: function(a) {
  10413. return CKEDITOR.getUrl(d(a))
  10414. },
  10415. icons: {},
  10416. addIcon: function(a, b, c, d) {
  10417. a = a.toLowerCase();
  10418. this.icons[a] || (this.icons[a] = {
  10419. path: b,
  10420. offset: c || 0,
  10421. bgsize: d || "16px"
  10422. })
  10423. },
  10424. getIconStyle: function(a, b, c, d, f) {
  10425. var g;
  10426. a && (a = a.toLowerCase(), b && (g = this.icons[a + "-rtl"]),
  10427. g || (g = this.icons[a]));
  10428. a = c || g && g.path || "";
  10429. d = d || g && g.offset;
  10430. f = f || g && g.bgsize || "16px";
  10431. a && (a = a.replace(/'/g, "\\'"));
  10432. return a && "background-image:url('" + CKEDITOR.getUrl(a) + "');background-position:0 " + d + "px;background-size:" + f + ";"
  10433. }
  10434. };
  10435. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  10436. getUiColor: function() {
  10437. return this.uiColor
  10438. },
  10439. setUiColor: function(a) {
  10440. var b = c(CKEDITOR.document);
  10441. return (this.setUiColor = function(a) {
  10442. this.uiColor = a;
  10443. var c = CKEDITOR.skin.chameleon,
  10444. d = "",
  10445. h = "";
  10446. "function" == typeof c && (d = c(this, "editor"), h =
  10447. c(this, "panel"));
  10448. a = [
  10449. [n, a]
  10450. ];
  10451. f([b], d, a);
  10452. f(g, h, a)
  10453. }).call(this, a)
  10454. }
  10455. });
  10456. var k = "cke_ui_color",
  10457. g = [],
  10458. n = /\$color/g;
  10459. CKEDITOR.on("instanceLoaded", function(a) {
  10460. if (!CKEDITOR.env.ie || !CKEDITOR.env.quirks) {
  10461. var b = a.editor;
  10462. a = function(a) {
  10463. a = (a.data[0] || a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();
  10464. if (!a.getById("cke_ui_color")) {
  10465. a = c(a);
  10466. g.push(a);
  10467. var d = b.getUiColor();
  10468. d && f([a], CKEDITOR.skin.chameleon(b, "panel"), [
  10469. [n, d]
  10470. ])
  10471. }
  10472. };
  10473. b.on("panelShow", a);
  10474. b.on("menuShow", a);
  10475. b.config.uiColor && b.setUiColor(b.config.uiColor)
  10476. }
  10477. })
  10478. })();
  10479. (function() {
  10480. if (CKEDITOR.env.webkit) CKEDITOR.env.hc = !1;
  10481. else {
  10482. 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);
  10483. a.appendTo(CKEDITOR.document.getHead());
  10484. try {
  10485. var d = a.getComputedStyle("border-top-color"),
  10486. b = a.getComputedStyle("border-right-color");
  10487. CKEDITOR.env.hc = !(!d || d != b)
  10488. } catch (c) {
  10489. CKEDITOR.env.hc = !1
  10490. }
  10491. a.remove()
  10492. }
  10493. CKEDITOR.env.hc && (CKEDITOR.env.cssClass += " cke_hc");
  10494. CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");
  10495. CKEDITOR.status = "loaded";
  10496. CKEDITOR.fireOnce("loaded");
  10497. if (a = CKEDITOR._.pending)
  10498. 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])
  10499. })();
  10500. /*
  10501. Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
  10502. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  10503. */
  10504. CKEDITOR.skin.name = "moono-lisa";
  10505. CKEDITOR.skin.ua_editor = "ie,iequirks,ie8,gecko";
  10506. CKEDITOR.skin.ua_dialog = "ie,iequirks,ie8";
  10507. CKEDITOR.skin.chameleon = function() {
  10508. var b = function() {
  10509. return function(b, d) {
  10510. for (var a = b.match(/[^#]./g), e = 0; 3 > e; e++) {
  10511. var f = e,
  10512. c;
  10513. c = parseInt(a[e], 16);
  10514. c = ("0" + (0 > d ? 0 | c * (1 + d) : 0 | c + (255 - c) * d).toString(16)).slice(-2);
  10515. a[f] = c
  10516. }
  10517. return "#" + a.join("")
  10518. }
  10519. }(),
  10520. f = {
  10521. 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};] "),
  10522. 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};] ")
  10523. };
  10524. return function(g, d) {
  10525. var a = b(g.uiColor, .4),
  10526. a = {
  10527. id: "." + g.id,
  10528. defaultBorder: b(a, -.2),
  10529. toolbarElementsBorder: b(a, -.25),
  10530. defaultBackground: a,
  10531. lightBackground: b(a, .8),
  10532. darkBackground: b(a, -.15),
  10533. ckeButtonOn: b(a, .4),
  10534. ckeResizer: b(a, -.4),
  10535. ckeColorauto: b(a, .8),
  10536. dialogBody: b(a, .7),
  10537. dialogTab: b(a, .65),
  10538. dialogTabSelected: "#FFF",
  10539. dialogTabSelectedBorder: "#FFF",
  10540. elementsPathColor: b(a, -.6),
  10541. menubuttonHover: b(a, .1),
  10542. menubuttonIcon: b(a, .5),
  10543. menubuttonIconHover: b(a, .3)
  10544. };
  10545. return f[d].output(a).replace(/\[/g, "{").replace(/\]/g, "}")
  10546. }
  10547. }();
  10548. CKEDITOR.plugins.add("dialogui", {
  10549. onLoad: function() {
  10550. var h = function(b) {
  10551. this._ || (this._ = {});
  10552. this._["default"] = this._.initValue = b["default"] || "";
  10553. this._.required = b.required || !1;
  10554. for (var a = [this._], d = 1; d < arguments.length; d++) a.push(arguments[d]);
  10555. a.push(!0);
  10556. CKEDITOR.tools.extend.apply(CKEDITOR.tools, a);
  10557. return this._
  10558. },
  10559. v = {
  10560. build: function(b, a, d) {
  10561. return new CKEDITOR.ui.dialog.textInput(b, a, d)
  10562. }
  10563. },
  10564. n = {
  10565. build: function(b, a, d) {
  10566. return new CKEDITOR.ui.dialog[a.type](b, a, d)
  10567. }
  10568. },
  10569. q = {
  10570. isChanged: function() {
  10571. return this.getValue() !=
  10572. this.getInitValue()
  10573. },
  10574. reset: function(b) {
  10575. this.setValue(this.getInitValue(), b)
  10576. },
  10577. setInitValue: function() {
  10578. this._.initValue = this.getValue()
  10579. },
  10580. resetInitValue: function() {
  10581. this._.initValue = this._["default"]
  10582. },
  10583. getInitValue: function() {
  10584. return this._.initValue
  10585. }
  10586. },
  10587. r = CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, {
  10588. onChange: function(b, a) {
  10589. this._.domOnChangeRegistered || (b.on("load", function() {
  10590. this.getInputElement().on("change", function() {
  10591. b.parts.dialog.isVisible() && this.fire("change", {
  10592. value: this.getValue()
  10593. })
  10594. },
  10595. this)
  10596. }, this), this._.domOnChangeRegistered = !0);
  10597. this.on("change", a)
  10598. }
  10599. }, !0),
  10600. x = /^on([A-Z]\w+)/,
  10601. t = function(b) {
  10602. for (var a in b)(x.test(a) || "title" == a || "type" == a) && delete b[a];
  10603. return b
  10604. },
  10605. w = function(b) {
  10606. b = b.data.getKeystroke();
  10607. b == CKEDITOR.SHIFT + CKEDITOR.ALT + 36 ? this.setDirectionMarker("ltr") : b == CKEDITOR.SHIFT + CKEDITOR.ALT + 35 && this.setDirectionMarker("rtl")
  10608. };
  10609. CKEDITOR.tools.extend(CKEDITOR.ui.dialog, {
  10610. labeledElement: function(b, a, d, f) {
  10611. if (!(4 > arguments.length)) {
  10612. var c = h.call(this, a);
  10613. c.labelId = CKEDITOR.tools.getNextId() +
  10614. "_label";
  10615. this._.children = [];
  10616. var e = {
  10617. role: a.role || "presentation"
  10618. };
  10619. a.includeLabel && (e["aria-labelledby"] = c.labelId);
  10620. CKEDITOR.ui.dialog.uiElement.call(this, b, a, d, "div", null, e, function() {
  10621. var e = [],
  10622. g = a.required ? " cke_required" : "";
  10623. "horizontal" != a.labelLayout ? 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"',
  10624. a.controlStyle ? ' style\x3d"' + a.controlStyle + '"' : "", ' role\x3d"presentation"\x3e', f.call(this, b, a), "\x3c/div\x3e") : (g = {
  10625. type: "hbox",
  10626. widths: a.widths,
  10627. padding: 0,
  10628. children: [{
  10629. type: "html",
  10630. 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"
  10631. }, {
  10632. type: "html",
  10633. html: '\x3cspan class\x3d"cke_dialog_ui_labeled_content"' + (a.controlStyle ? ' style\x3d"' + a.controlStyle +
  10634. '"' : "") + "\x3e" + f.call(this, b, a) + "\x3c/span\x3e"
  10635. }]
  10636. }, CKEDITOR.dialog._.uiElementBuilders.hbox.build(b, g, e));
  10637. return e.join("")
  10638. })
  10639. }
  10640. },
  10641. textInput: function(b, a, d) {
  10642. if (!(3 > arguments.length)) {
  10643. h.call(this, a);
  10644. var f = this._.inputId = CKEDITOR.tools.getNextId() + "_textInput",
  10645. c = {
  10646. "class": "cke_dialog_ui_input_" + a.type,
  10647. id: f,
  10648. type: a.type
  10649. };
  10650. a.validate && (this.validate = a.validate);
  10651. a.maxLength && (c.maxlength = a.maxLength);
  10652. a.size && (c.size = a.size);
  10653. a.inputStyle && (c.style = a.inputStyle);
  10654. var e = this,
  10655. m = !1;
  10656. b.on("load", function() {
  10657. e.getInputElement().on("keydown",
  10658. function(a) {
  10659. 13 == a.data.getKeystroke() && (m = !0)
  10660. });
  10661. e.getInputElement().on("keyup", function(a) {
  10662. 13 == a.data.getKeystroke() && m && (b.getButton("ok") && setTimeout(function() {
  10663. b.getButton("ok").click()
  10664. }, 0), m = !1);
  10665. e.bidi && w.call(e, a)
  10666. }, null, null, 1E3)
  10667. });
  10668. CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function() {
  10669. var b = ['\x3cdiv class\x3d"cke_dialog_ui_input_', a.type, '" role\x3d"presentation"'];
  10670. a.width && b.push('style\x3d"width:' + a.width + '" ');
  10671. b.push("\x3e\x3cinput ");
  10672. c["aria-labelledby"] = this._.labelId;
  10673. this._.required &&
  10674. (c["aria-required"] = this._.required);
  10675. for (var e in c) b.push(e + '\x3d"' + c[e] + '" ');
  10676. b.push(" /\x3e\x3c/div\x3e");
  10677. return b.join("")
  10678. })
  10679. }
  10680. },
  10681. textarea: function(b, a, d) {
  10682. if (!(3 > arguments.length)) {
  10683. h.call(this, a);
  10684. var f = this,
  10685. c = this._.inputId = CKEDITOR.tools.getNextId() + "_textarea",
  10686. e = {};
  10687. a.validate && (this.validate = a.validate);
  10688. e.rows = a.rows || 5;
  10689. e.cols = a.cols || 20;
  10690. e["class"] = "cke_dialog_ui_input_textarea " + (a["class"] || "");
  10691. "undefined" != typeof a.inputStyle && (e.style = a.inputStyle);
  10692. a.dir && (e.dir = a.dir);
  10693. if (f.bidi) b.on("load",
  10694. function() {
  10695. f.getInputElement().on("keyup", w)
  10696. }, f);
  10697. CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function() {
  10698. e["aria-labelledby"] = this._.labelId;
  10699. this._.required && (e["aria-required"] = this._.required);
  10700. var a = ['\x3cdiv class\x3d"cke_dialog_ui_input_textarea" role\x3d"presentation"\x3e\x3ctextarea id\x3d"', c, '" '],
  10701. b;
  10702. for (b in e) a.push(b + '\x3d"' + CKEDITOR.tools.htmlEncode(e[b]) + '" ');
  10703. a.push("\x3e", CKEDITOR.tools.htmlEncode(f._["default"]), "\x3c/textarea\x3e\x3c/div\x3e");
  10704. return a.join("")
  10705. })
  10706. }
  10707. },
  10708. checkbox: function(b,
  10709. a, d) {
  10710. if (!(3 > arguments.length)) {
  10711. var f = h.call(this, a, {
  10712. "default": !!a["default"]
  10713. });
  10714. a.validate && (this.validate = a.validate);
  10715. CKEDITOR.ui.dialog.uiElement.call(this, b, a, d, "span", null, null, function() {
  10716. var c = CKEDITOR.tools.extend({}, a, {
  10717. id: a.id ? a.id + "_checkbox" : CKEDITOR.tools.getNextId() + "_checkbox"
  10718. }, !0),
  10719. e = [],
  10720. d = CKEDITOR.tools.getNextId() + "_label",
  10721. g = {
  10722. "class": "cke_dialog_ui_checkbox_input",
  10723. type: "checkbox",
  10724. "aria-labelledby": d
  10725. };
  10726. t(c);
  10727. a["default"] && (g.checked = "checked");
  10728. "undefined" != typeof c.inputStyle && (c.style = c.inputStyle);
  10729. f.checkbox = new CKEDITOR.ui.dialog.uiElement(b, c, e, "input", null, g);
  10730. 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");
  10731. return e.join("")
  10732. })
  10733. }
  10734. },
  10735. radio: function(b, a, d) {
  10736. if (!(3 > arguments.length)) {
  10737. h.call(this, a);
  10738. this._["default"] || (this._["default"] = this._.initValue = a.items[0][1]);
  10739. a.validate && (this.validate = a.validate);
  10740. var f = [],
  10741. c = this;
  10742. a.role = "radiogroup";
  10743. a.includeLabel = !0;
  10744. CKEDITOR.ui.dialog.labeledElement.call(this,
  10745. b, a, d,
  10746. function() {
  10747. for (var e = [], d = [], g = (a.id ? a.id : CKEDITOR.tools.getNextId()) + "_radio", k = 0; k < a.items.length; k++) {
  10748. var l = a.items[k],
  10749. h = void 0 !== l[2] ? l[2] : l[0],
  10750. n = void 0 !== l[1] ? l[1] : l[0],
  10751. p = CKEDITOR.tools.getNextId() + "_radio_input",
  10752. q = p + "_label",
  10753. p = CKEDITOR.tools.extend({}, a, {
  10754. id: p,
  10755. title: null,
  10756. type: null
  10757. }, !0),
  10758. h = CKEDITOR.tools.extend({}, p, {
  10759. title: h
  10760. }, !0),
  10761. r = {
  10762. type: "radio",
  10763. "class": "cke_dialog_ui_radio_input",
  10764. name: g,
  10765. value: n,
  10766. "aria-labelledby": q
  10767. },
  10768. u = [];
  10769. c._["default"] == n && (r.checked = "checked");
  10770. t(p);
  10771. t(h);
  10772. "undefined" != typeof p.inputStyle &&
  10773. (p.style = p.inputStyle);
  10774. p.keyboardFocusable = !0;
  10775. f.push(new CKEDITOR.ui.dialog.uiElement(b, p, u, "input", null, r));
  10776. u.push(" ");
  10777. new CKEDITOR.ui.dialog.uiElement(b, h, u, "label", null, {
  10778. id: q,
  10779. "for": r.id
  10780. }, l[0]);
  10781. e.push(u.join(""))
  10782. }
  10783. new CKEDITOR.ui.dialog.hbox(b, f, e, d);
  10784. return d.join("")
  10785. });
  10786. this._.children = f
  10787. }
  10788. },
  10789. button: function(b, a, d) {
  10790. if (arguments.length) {
  10791. "function" == typeof a && (a = a(b.getParentEditor()));
  10792. h.call(this, a, {
  10793. disabled: a.disabled || !1
  10794. });
  10795. CKEDITOR.event.implementOn(this);
  10796. var f = this;
  10797. b.on("load", function() {
  10798. var a = this.getElement();
  10799. (function() {
  10800. a.on("click", function(a) {
  10801. f.click();
  10802. a.data.preventDefault()
  10803. });
  10804. a.on("keydown", function(a) {
  10805. a.data.getKeystroke() in {
  10806. 32: 1
  10807. } && (f.click(), a.data.preventDefault())
  10808. })
  10809. })();
  10810. a.unselectable()
  10811. }, this);
  10812. var c = CKEDITOR.tools.extend({}, a);
  10813. delete c.style;
  10814. var e = CKEDITOR.tools.getNextId() + "_label";
  10815. CKEDITOR.ui.dialog.uiElement.call(this, b, c, d, "a", null, {
  10816. style: a.style,
  10817. href: "javascript:void(0)",
  10818. title: a.label,
  10819. hidefocus: "true",
  10820. "class": a["class"],
  10821. role: "button",
  10822. "aria-labelledby": e
  10823. }, '\x3cspan id\x3d"' + e + '" class\x3d"cke_dialog_ui_button"\x3e' +
  10824. CKEDITOR.tools.htmlEncode(a.label) + "\x3c/span\x3e")
  10825. }
  10826. },
  10827. select: function(b, a, d) {
  10828. if (!(3 > arguments.length)) {
  10829. var f = h.call(this, a);
  10830. a.validate && (this.validate = a.validate);
  10831. f.inputId = CKEDITOR.tools.getNextId() + "_select";
  10832. CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function() {
  10833. var c = CKEDITOR.tools.extend({}, a, {
  10834. id: a.id ? a.id + "_select" : CKEDITOR.tools.getNextId() + "_select"
  10835. }, !0),
  10836. e = [],
  10837. d = [],
  10838. g = {
  10839. id: f.inputId,
  10840. "class": "cke_dialog_ui_input_select",
  10841. "aria-labelledby": this._.labelId
  10842. };
  10843. e.push('\x3cdiv class\x3d"cke_dialog_ui_input_',
  10844. a.type, '" role\x3d"presentation"');
  10845. a.width && e.push('style\x3d"width:' + a.width + '" ');
  10846. e.push("\x3e");
  10847. void 0 !== a.size && (g.size = a.size);
  10848. void 0 !== a.multiple && (g.multiple = a.multiple);
  10849. t(c);
  10850. 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]));
  10851. "undefined" != typeof c.inputStyle && (c.style = c.inputStyle);
  10852. f.select = new CKEDITOR.ui.dialog.uiElement(b, c, e, "select", null,
  10853. g, d.join(""));
  10854. e.push("\x3c/div\x3e");
  10855. return e.join("")
  10856. })
  10857. }
  10858. },
  10859. file: function(b, a, d) {
  10860. if (!(3 > arguments.length)) {
  10861. void 0 === a["default"] && (a["default"] = "");
  10862. var f = CKEDITOR.tools.extend(h.call(this, a), {
  10863. definition: a,
  10864. buttons: []
  10865. });
  10866. a.validate && (this.validate = a.validate);
  10867. b.on("load", function() {
  10868. CKEDITOR.document.getById(f.frameId).getParent().addClass("cke_dialog_ui_input_file")
  10869. });
  10870. CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function() {
  10871. f.frameId = CKEDITOR.tools.getNextId() + "_fileInput";
  10872. var b = ['\x3ciframe frameborder\x3d"0" allowtransparency\x3d"0" class\x3d"cke_dialog_ui_input_file" role\x3d"presentation" id\x3d"',
  10873. f.frameId, '" title\x3d"', a.label, '" src\x3d"javascript:void('
  10874. ];
  10875. b.push(CKEDITOR.env.ie ? "(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "})()" : "0");
  10876. b.push(')"\x3e\x3c/iframe\x3e');
  10877. return b.join("")
  10878. })
  10879. }
  10880. },
  10881. fileButton: function(b, a, d) {
  10882. var f = this;
  10883. if (!(3 > arguments.length)) {
  10884. h.call(this, a);
  10885. a.validate && (this.validate = a.validate);
  10886. var c = CKEDITOR.tools.extend({}, a),
  10887. e = c.onClick;
  10888. c.className = (c.className ? c.className + " " : "") + "cke_dialog_ui_button";
  10889. c.onClick = function(c) {
  10890. var d =
  10891. a["for"];
  10892. c = e ? e.call(this, c) : !1;
  10893. !1 !== c && ("xhr" !== c && b.getContentElement(d[0], d[1]).submit(), this.disable())
  10894. };
  10895. b.on("load", function() {
  10896. b.getContentElement(a["for"][0], a["for"][1])._.buttons.push(f)
  10897. });
  10898. CKEDITOR.ui.dialog.button.call(this, b, c, d)
  10899. }
  10900. },
  10901. html: function() {
  10902. var b = /^\s*<[\w:]+\s+([^>]*)?>/,
  10903. a = /^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,
  10904. d = /\/$/;
  10905. return function(f, c, e) {
  10906. if (!(3 > arguments.length)) {
  10907. var m = [],
  10908. g = c.html;
  10909. "\x3c" != g.charAt(0) && (g = "\x3cspan\x3e" + g + "\x3c/span\x3e");
  10910. var k = c.focus;
  10911. if (k) {
  10912. var l = this.focus;
  10913. this.focus = function() {
  10914. ("function" == typeof k ? k : l).call(this);
  10915. this.fire("focus")
  10916. };
  10917. c.isFocusable && (this.isFocusable = this.isFocusable);
  10918. this.keyboardFocusable = !0
  10919. }
  10920. CKEDITOR.ui.dialog.uiElement.call(this, f, c, m, "span", null, null, "");
  10921. m = m.join("").match(b);
  10922. g = g.match(a) || ["", "", ""];
  10923. d.test(g[1]) && (g[1] = g[1].slice(0, -1), g[2] = "/" + g[2]);
  10924. e.push([g[1], " ", m[1] || "", g[2]].join(""))
  10925. }
  10926. }
  10927. }(),
  10928. fieldset: function(b, a, d, f, c) {
  10929. var e = c.label;
  10930. this._ = {
  10931. children: a
  10932. };
  10933. CKEDITOR.ui.dialog.uiElement.call(this, b, c, f, "fieldset", null, null, function() {
  10934. var a = [];
  10935. e && a.push("\x3clegend" + (c.labelStyle ? ' style\x3d"' + c.labelStyle + '"' : "") + "\x3e" + e + "\x3c/legend\x3e");
  10936. for (var b = 0; b < d.length; b++) a.push(d[b]);
  10937. return a.join("")
  10938. })
  10939. }
  10940. }, !0);
  10941. CKEDITOR.ui.dialog.html.prototype = new CKEDITOR.ui.dialog.uiElement;
  10942. CKEDITOR.ui.dialog.labeledElement.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  10943. setLabel: function(b) {
  10944. var a = CKEDITOR.document.getById(this._.labelId);
  10945. 1 > a.getChildCount() ? (new CKEDITOR.dom.text(b, CKEDITOR.document)).appendTo(a) : a.getChild(0).$.nodeValue =
  10946. b;
  10947. return this
  10948. },
  10949. getLabel: function() {
  10950. var b = CKEDITOR.document.getById(this._.labelId);
  10951. return !b || 1 > b.getChildCount() ? "" : b.getChild(0).getText()
  10952. },
  10953. eventProcessors: r
  10954. }, !0);
  10955. CKEDITOR.ui.dialog.button.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  10956. click: function() {
  10957. return this._.disabled ? !1 : this.fire("click", {
  10958. dialog: this._.dialog
  10959. })
  10960. },
  10961. enable: function() {
  10962. this._.disabled = !1;
  10963. var b = this.getElement();
  10964. b && b.removeClass("cke_disabled")
  10965. },
  10966. disable: function() {
  10967. this._.disabled = !0;
  10968. this.getElement().addClass("cke_disabled")
  10969. },
  10970. isVisible: function() {
  10971. return this.getElement().getFirst().isVisible()
  10972. },
  10973. isEnabled: function() {
  10974. return !this._.disabled
  10975. },
  10976. eventProcessors: CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, {
  10977. onClick: function(b, a) {
  10978. this.on("click", function() {
  10979. a.apply(this, arguments)
  10980. })
  10981. }
  10982. }, !0),
  10983. accessKeyUp: function() {
  10984. this.click()
  10985. },
  10986. accessKeyDown: function() {
  10987. this.focus()
  10988. },
  10989. keyboardFocusable: !0
  10990. }, !0);
  10991. CKEDITOR.ui.dialog.textInput.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, {
  10992. getInputElement: function() {
  10993. return CKEDITOR.document.getById(this._.inputId)
  10994. },
  10995. focus: function() {
  10996. var b = this.selectParentTab();
  10997. setTimeout(function() {
  10998. var a = b.getInputElement();
  10999. a && a.$.focus()
  11000. }, 0)
  11001. },
  11002. select: function() {
  11003. var b = this.selectParentTab();
  11004. setTimeout(function() {
  11005. var a = b.getInputElement();
  11006. a && (a.$.focus(), a.$.select())
  11007. }, 0)
  11008. },
  11009. accessKeyUp: function() {
  11010. this.select()
  11011. },
  11012. setValue: function(b) {
  11013. if (this.bidi) {
  11014. var a = b && b.charAt(0);
  11015. (a = "‪" == a ? "ltr" : "‫" == a ? "rtl" : null) && (b = b.slice(1));
  11016. this.setDirectionMarker(a)
  11017. }
  11018. b || (b = "");
  11019. return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this, arguments)
  11020. },
  11021. getValue: function() {
  11022. var b = CKEDITOR.ui.dialog.uiElement.prototype.getValue.call(this);
  11023. if (this.bidi && b) {
  11024. var a = this.getDirectionMarker();
  11025. a && (b = ("ltr" == a ? "‪" : "‫") + b)
  11026. }
  11027. return b
  11028. },
  11029. setDirectionMarker: function(b) {
  11030. var a = this.getInputElement();
  11031. b ? a.setAttributes({
  11032. dir: b,
  11033. "data-cke-dir-marker": b
  11034. }) : this.getDirectionMarker() && a.removeAttributes(["dir", "data-cke-dir-marker"])
  11035. },
  11036. getDirectionMarker: function() {
  11037. return this.getInputElement().data("cke-dir-marker")
  11038. },
  11039. keyboardFocusable: !0
  11040. }, q, !0);
  11041. CKEDITOR.ui.dialog.textarea.prototype =
  11042. new CKEDITOR.ui.dialog.textInput;
  11043. CKEDITOR.ui.dialog.select.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, {
  11044. getInputElement: function() {
  11045. return this._.select.getElement()
  11046. },
  11047. add: function(b, a, d) {
  11048. var f = new CKEDITOR.dom.element("option", this.getDialog().getParentEditor().document),
  11049. c = this.getInputElement().$;
  11050. f.$.text = b;
  11051. f.$.value = void 0 === a || null === a ? b : a;
  11052. void 0 === d || null === d ? CKEDITOR.env.ie ? c.add(f.$) : c.add(f.$, null) : c.add(f.$, d);
  11053. return this
  11054. },
  11055. remove: function(b) {
  11056. this.getInputElement().$.remove(b);
  11057. return this
  11058. },
  11059. clear: function() {
  11060. for (var b = this.getInputElement().$; 0 < b.length;) b.remove(0);
  11061. return this
  11062. },
  11063. keyboardFocusable: !0
  11064. }, q, !0);
  11065. CKEDITOR.ui.dialog.checkbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  11066. getInputElement: function() {
  11067. return this._.checkbox.getElement()
  11068. },
  11069. setValue: function(b, a) {
  11070. this.getInputElement().$.checked = b;
  11071. !a && this.fire("change", {
  11072. value: b
  11073. })
  11074. },
  11075. getValue: function() {
  11076. return this.getInputElement().$.checked
  11077. },
  11078. accessKeyUp: function() {
  11079. this.setValue(!this.getValue())
  11080. },
  11081. eventProcessors: {
  11082. onChange: function(b,
  11083. a) {
  11084. if (!CKEDITOR.env.ie || 8 < CKEDITOR.env.version) return r.onChange.apply(this, arguments);
  11085. b.on("load", function() {
  11086. var a = this._.checkbox.getElement();
  11087. a.on("propertychange", function(b) {
  11088. b = b.data.$;
  11089. "checked" == b.propertyName && this.fire("change", {
  11090. value: a.$.checked
  11091. })
  11092. }, this)
  11093. }, this);
  11094. this.on("change", a);
  11095. return null
  11096. }
  11097. },
  11098. keyboardFocusable: !0
  11099. }, q, !0);
  11100. CKEDITOR.ui.dialog.radio.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  11101. setValue: function(b, a) {
  11102. for (var d = this._.children, f, c = 0; c < d.length && (f = d[c]); c++) f.getElement().$.checked =
  11103. f.getValue() == b;
  11104. !a && this.fire("change", {
  11105. value: b
  11106. })
  11107. },
  11108. getValue: function() {
  11109. for (var b = this._.children, a = 0; a < b.length; a++)
  11110. if (b[a].getElement().$.checked) return b[a].getValue();
  11111. return null
  11112. },
  11113. accessKeyUp: function() {
  11114. var b = this._.children,
  11115. a;
  11116. for (a = 0; a < b.length; a++)
  11117. if (b[a].getElement().$.checked) {
  11118. b[a].getElement().focus();
  11119. return
  11120. } b[0].getElement().focus()
  11121. },
  11122. eventProcessors: {
  11123. onChange: function(b, a) {
  11124. if (!CKEDITOR.env.ie || 8 < CKEDITOR.env.version) return r.onChange.apply(this, arguments);
  11125. b.on("load", function() {
  11126. for (var a =
  11127. this._.children, b = this, c = 0; c < a.length; c++) a[c].getElement().on("propertychange", function(a) {
  11128. a = a.data.$;
  11129. "checked" == a.propertyName && this.$.checked && b.fire("change", {
  11130. value: this.getAttribute("value")
  11131. })
  11132. })
  11133. }, this);
  11134. this.on("change", a);
  11135. return null
  11136. }
  11137. }
  11138. }, q, !0);
  11139. CKEDITOR.ui.dialog.file.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, q, {
  11140. getInputElement: function() {
  11141. var b = CKEDITOR.document.getById(this._.frameId).getFrameDocument();
  11142. return 0 < b.$.forms.length ? new CKEDITOR.dom.element(b.$.forms[0].elements[0]) :
  11143. this.getElement()
  11144. },
  11145. submit: function() {
  11146. this.getInputElement().getParent().$.submit();
  11147. return this
  11148. },
  11149. getAction: function() {
  11150. return this.getInputElement().getParent().$.action
  11151. },
  11152. registerEvents: function(b) {
  11153. var a = /^on([A-Z]\w+)/,
  11154. d, f = function(a, b, c, d) {
  11155. a.on("formLoaded", function() {
  11156. a.getInputElement().on(c, d, a)
  11157. })
  11158. },
  11159. c;
  11160. for (c in b)
  11161. 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]);
  11162. return this
  11163. },
  11164. reset: function() {
  11165. function b() {
  11166. d.$.open();
  11167. var b = "";
  11168. f.size && (b = f.size - (CKEDITOR.env.ie ? 7 : 0));
  11169. var h = a.frameId + "_input";
  11170. 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),
  11171. '\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(0 < b ? 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"
  11172. ].join(""));
  11173. d.$.close();
  11174. for (b = 0; b < c.length; b++) c[b].enable()
  11175. }
  11176. var a = this._,
  11177. d = CKEDITOR.document.getById(a.frameId).getFrameDocument(),
  11178. f = a.definition,
  11179. c = a.buttons,
  11180. e = this.formLoadedNumber,
  11181. m = this.formUnloadNumber,
  11182. g = a.dialog._.editor.lang.dir,
  11183. k = a.dialog._.editor.langCode;
  11184. e || (e = this.formLoadedNumber = CKEDITOR.tools.addFunction(function() {
  11185. this.fire("formLoaded")
  11186. }, this), m = this.formUnloadNumber = CKEDITOR.tools.addFunction(function() {
  11187. this.getInputElement().clearCustomData()
  11188. }, this), this.getDialog()._.editor.on("destroy", function() {
  11189. CKEDITOR.tools.removeFunction(e);
  11190. CKEDITOR.tools.removeFunction(m)
  11191. }));
  11192. CKEDITOR.env.gecko ? setTimeout(b, 500) : b()
  11193. },
  11194. getValue: function() {
  11195. return this.getInputElement().$.value || ""
  11196. },
  11197. setInitValue: function() {
  11198. this._.initValue = ""
  11199. },
  11200. eventProcessors: {
  11201. onChange: function(b, a) {
  11202. this._.domOnChangeRegistered || (this.on("formLoaded", function() {
  11203. this.getInputElement().on("change", function() {
  11204. this.fire("change", {
  11205. value: this.getValue()
  11206. })
  11207. }, this)
  11208. }, this), this._.domOnChangeRegistered = !0);
  11209. this.on("change", a)
  11210. }
  11211. },
  11212. keyboardFocusable: !0
  11213. }, !0);
  11214. CKEDITOR.ui.dialog.fileButton.prototype =
  11215. new CKEDITOR.ui.dialog.button;
  11216. CKEDITOR.ui.dialog.fieldset.prototype = CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype);
  11217. CKEDITOR.dialog.addUIElement("text", v);
  11218. CKEDITOR.dialog.addUIElement("password", v);
  11219. CKEDITOR.dialog.addUIElement("textarea", n);
  11220. CKEDITOR.dialog.addUIElement("checkbox", n);
  11221. CKEDITOR.dialog.addUIElement("radio", n);
  11222. CKEDITOR.dialog.addUIElement("button", n);
  11223. CKEDITOR.dialog.addUIElement("select", n);
  11224. CKEDITOR.dialog.addUIElement("file", n);
  11225. CKEDITOR.dialog.addUIElement("fileButton", n);
  11226. CKEDITOR.dialog.addUIElement("html",
  11227. n);
  11228. CKEDITOR.dialog.addUIElement("fieldset", {
  11229. build: function(b, a, d) {
  11230. for (var f = a.children, c, e = [], h = [], g = 0; g < f.length && (c = f[g]); g++) {
  11231. var k = [];
  11232. e.push(k);
  11233. h.push(CKEDITOR.dialog._.uiElementBuilders[c.type].build(b, c, k))
  11234. }
  11235. return new CKEDITOR.ui.dialog[a.type](b, h, e, d, a)
  11236. }
  11237. })
  11238. }
  11239. });
  11240. CKEDITOR.DIALOG_RESIZE_NONE = 0;
  11241. CKEDITOR.DIALOG_RESIZE_WIDTH = 1;
  11242. CKEDITOR.DIALOG_RESIZE_HEIGHT = 2;
  11243. CKEDITOR.DIALOG_RESIZE_BOTH = 3;
  11244. CKEDITOR.DIALOG_STATE_IDLE = 1;
  11245. CKEDITOR.DIALOG_STATE_BUSY = 2;
  11246. (function() {
  11247. function x() {
  11248. for (var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId) + a, c = b - 1; c > b - a; c--)
  11249. if (this._.tabs[this._.tabIdList[c % a]][0].$.offsetHeight) return this._.tabIdList[c % a];
  11250. return null
  11251. }
  11252. function A() {
  11253. for (var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId), c = b + 1; c < b + a; c++)
  11254. if (this._.tabs[this._.tabIdList[c % a]][0].$.offsetHeight) return this._.tabIdList[c % a];
  11255. return null
  11256. }
  11257. function K(a, b) {
  11258. for (var c = a.$.getElementsByTagName("input"),
  11259. e = 0, d = c.length; e < d; e++) {
  11260. var f = new CKEDITOR.dom.element(c[e]);
  11261. "text" == f.getAttribute("type").toLowerCase() && (b ? (f.setAttribute("value", f.getCustomData("fake_value") || ""), f.removeCustomData("fake_value")) : (f.setCustomData("fake_value", f.getAttribute("value")), f.setAttribute("value", "")))
  11262. }
  11263. }
  11264. function T(a, b) {
  11265. var c = this.getInputElement();
  11266. c && (a ? c.removeAttribute("aria-invalid") : c.setAttribute("aria-invalid", !0));
  11267. a || (this.select ? this.select() : this.focus());
  11268. b && alert(b);
  11269. this.fire("validated", {
  11270. valid: a,
  11271. msg: b
  11272. })
  11273. }
  11274. function U() {
  11275. var a = this.getInputElement();
  11276. a && a.removeAttribute("aria-invalid")
  11277. }
  11278. function V(a) {
  11279. var b = CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog", W).output({
  11280. id: CKEDITOR.tools.getNextNumber(),
  11281. editorId: a.id,
  11282. langDir: a.lang.dir,
  11283. langCode: a.langCode,
  11284. editorDialogClass: "cke_editor_" + a.name.replace(/\./g, "\\.") + "_dialog",
  11285. closeTitle: a.lang.common.close,
  11286. hidpi: CKEDITOR.env.hidpi ? "cke_hidpi" : ""
  11287. })),
  11288. c = b.getChild([0, 0, 0, 0, 0]),
  11289. e = c.getChild(0),
  11290. d = c.getChild(1);
  11291. a.plugins.clipboard && CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(c);
  11292. !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()));
  11293. e.unselectable();
  11294. d.unselectable();
  11295. return {
  11296. element: b,
  11297. parts: {
  11298. dialog: b.getChild(0),
  11299. title: e,
  11300. close: d,
  11301. tabs: c.getChild(2),
  11302. contents: c.getChild([3, 0, 0, 0]),
  11303. footer: c.getChild([3, 0, 1, 0])
  11304. }
  11305. }
  11306. }
  11307. function L(a, b, c) {
  11308. this.element = b;
  11309. this.focusIndex = c;
  11310. this.tabIndex = 0;
  11311. this.isFocusable = function() {
  11312. return !b.getAttribute("disabled") && b.isVisible()
  11313. };
  11314. this.focus = function() {
  11315. a._.currentFocusIndex = this.focusIndex;
  11316. this.element.focus()
  11317. };
  11318. b.on("keydown", function(a) {
  11319. a.data.getKeystroke() in {
  11320. 32: 1,
  11321. 13: 1
  11322. } && this.fire("click")
  11323. });
  11324. b.on("focus", function() {
  11325. this.fire("mouseover")
  11326. });
  11327. b.on("blur", function() {
  11328. this.fire("mouseout")
  11329. })
  11330. }
  11331. function X(a) {
  11332. function b() {
  11333. a.layout()
  11334. }
  11335. var c = CKEDITOR.document.getWindow();
  11336. c.on("resize", b);
  11337. a.on("hide", function() {
  11338. c.removeListener("resize", b)
  11339. })
  11340. }
  11341. function M(a, b) {
  11342. this._ = {
  11343. dialog: a
  11344. };
  11345. CKEDITOR.tools.extend(this, b)
  11346. }
  11347. function Y(a) {
  11348. function b(b) {
  11349. var c = a.getSize(),
  11350. k = CKEDITOR.document.getWindow().getViewPaneSize(),
  11351. q = b.data.$.screenX,
  11352. n = b.data.$.screenY,
  11353. r = q - e.x,
  11354. l = n - e.y;
  11355. e = {
  11356. x: q,
  11357. y: n
  11358. };
  11359. d.x += r;
  11360. d.y += l;
  11361. a.move(d.x + h[3] < g ? -h[3] : d.x - h[1] > k.width - c.width - g ? k.width - c.width + ("rtl" == f.lang.dir ? 0 : h[1]) : d.x, d.y + h[0] < g ? -h[0] : d.y - h[2] > k.height - c.height - g ? k.height - c.height + h[2] : d.y, 1);
  11362. b.data.preventDefault()
  11363. }
  11364. function c() {
  11365. CKEDITOR.document.removeListener("mousemove", b);
  11366. CKEDITOR.document.removeListener("mouseup", c);
  11367. if (CKEDITOR.env.ie6Compat) {
  11368. var a = u.getChild(0).getFrameDocument();
  11369. a.removeListener("mousemove", b);
  11370. a.removeListener("mouseup", c)
  11371. }
  11372. }
  11373. var e = null,
  11374. d = null,
  11375. f = a.getParentEditor(),
  11376. g = f.config.dialog_magnetDistance,
  11377. h = CKEDITOR.skin.margins || [0, 0, 0, 0];
  11378. "undefined" == typeof g && (g = 20);
  11379. a.parts.title.on("mousedown", function(g) {
  11380. e = {
  11381. x: g.data.$.screenX,
  11382. y: g.data.$.screenY
  11383. };
  11384. CKEDITOR.document.on("mousemove", b);
  11385. CKEDITOR.document.on("mouseup",
  11386. c);
  11387. d = a.getPosition();
  11388. if (CKEDITOR.env.ie6Compat) {
  11389. var f = u.getChild(0).getFrameDocument();
  11390. f.on("mousemove", b);
  11391. f.on("mouseup", c)
  11392. }
  11393. g.data.preventDefault()
  11394. }, a)
  11395. }
  11396. function Z(a) {
  11397. function b(b) {
  11398. var c = "rtl" == f.lang.dir,
  11399. n = k.width,
  11400. q = k.height,
  11401. G = n + (b.data.$.screenX - m.x) * (c ? -1 : 1) * (a._.moved ? 1 : 2),
  11402. H = q + (b.data.$.screenY - m.y) * (a._.moved ? 1 : 2),
  11403. B = a._.element.getFirst(),
  11404. B = c && B.getComputedStyle("right"),
  11405. C = a.getPosition();
  11406. C.y + H > p.height && (H = p.height - C.y);
  11407. (c ? B : C.x) + G > p.width && (G = p.width - (c ? B : C.x));
  11408. if (d == CKEDITOR.DIALOG_RESIZE_WIDTH ||
  11409. d == CKEDITOR.DIALOG_RESIZE_BOTH) n = Math.max(e.minWidth || 0, G - g);
  11410. if (d == CKEDITOR.DIALOG_RESIZE_HEIGHT || d == CKEDITOR.DIALOG_RESIZE_BOTH) q = Math.max(e.minHeight || 0, H - h);
  11411. a.resize(n, q);
  11412. a._.moved || a.layout();
  11413. b.data.preventDefault()
  11414. }
  11415. function c() {
  11416. CKEDITOR.document.removeListener("mouseup", c);
  11417. CKEDITOR.document.removeListener("mousemove", b);
  11418. q && (q.remove(), q = null);
  11419. if (CKEDITOR.env.ie6Compat) {
  11420. var a = u.getChild(0).getFrameDocument();
  11421. a.removeListener("mouseup", c);
  11422. a.removeListener("mousemove", b)
  11423. }
  11424. }
  11425. var e = a.definition,
  11426. d = e.resizable;
  11427. if (d != CKEDITOR.DIALOG_RESIZE_NONE) {
  11428. var f = a.getParentEditor(),
  11429. g, h, p, m, k, q, n = CKEDITOR.tools.addFunction(function(d) {
  11430. k = a.getSize();
  11431. var e = a.parts.contents;
  11432. e.$.getElementsByTagName("iframe").length && (q = CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_dialog_resize_cover" style\x3d"height: 100%; position: absolute; width: 100%;"\x3e\x3c/div\x3e'), e.append(q));
  11433. h = k.height - a.parts.contents.getSize("height", !(CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.quirks));
  11434. g = k.width - a.parts.contents.getSize("width",
  11435. 1);
  11436. m = {
  11437. x: d.screenX,
  11438. y: d.screenY
  11439. };
  11440. p = CKEDITOR.document.getWindow().getViewPaneSize();
  11441. CKEDITOR.document.on("mousemove", b);
  11442. CKEDITOR.document.on("mouseup", c);
  11443. CKEDITOR.env.ie6Compat && (e = u.getChild(0).getFrameDocument(), e.on("mousemove", b), e.on("mouseup", c));
  11444. d.preventDefault && d.preventDefault()
  11445. });
  11446. a.on("load", function() {
  11447. var b = "";
  11448. d == CKEDITOR.DIALOG_RESIZE_WIDTH ? b = " cke_resizer_horizontal" : d == CKEDITOR.DIALOG_RESIZE_HEIGHT && (b = " cke_resizer_vertical");
  11449. b = CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_resizer' +
  11450. b + " cke_resizer_" + f.lang.dir + '" title\x3d"' + CKEDITOR.tools.htmlEncode(f.lang.common.resize) + '" onmousedown\x3d"CKEDITOR.tools.callFunction(' + n + ', event )"\x3e' + ("ltr" == f.lang.dir ? "◢" : "◣") + "\x3c/div\x3e");
  11451. a.parts.footer.append(b, 1)
  11452. });
  11453. f.on("destroy", function() {
  11454. CKEDITOR.tools.removeFunction(n)
  11455. })
  11456. }
  11457. }
  11458. function I(a) {
  11459. a.data.preventDefault(1)
  11460. }
  11461. function N(a) {
  11462. var b = CKEDITOR.document.getWindow(),
  11463. c = a.config,
  11464. e = CKEDITOR.skinName || a.config.skin,
  11465. d = c.dialog_backgroundCoverColor || ("moono-lisa" == e ? "black" : "white"),
  11466. e = c.dialog_backgroundCoverOpacity,
  11467. f = c.baseFloatZIndex,
  11468. c = CKEDITOR.tools.genKey(d, e, f),
  11469. g = z[c];
  11470. g ? g.show() : (f = ['\x3cdiv tabIndex\x3d"-1" style\x3d"position: ', CKEDITOR.env.ie6Compat ? "absolute" : "fixed", "; z-index: ", f, "; top: 0px; left: 0px; ", CKEDITOR.env.ie6Compat ? "" : "background-color: " + d, '" class\x3d"cke_dialog_background_cover"\x3e'], CKEDITOR.env.ie6Compat && (d = "\x3chtml\x3e\x3cbody style\x3d\\'background-color:" + d + ";\\'\x3e\x3c/body\x3e\x3c/html\x3e", f.push('\x3ciframe hidefocus\x3d"true" frameborder\x3d"0" id\x3d"cke_dialog_background_iframe" src\x3d"javascript:'),
  11471. f.push("void((function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.write( '" + d + "' );document.close();") + "})())"), f.push('" style\x3d"position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity\x3d0)"\x3e\x3c/iframe\x3e')), f.push("\x3c/div\x3e"), g = CKEDITOR.dom.element.createFromHtml(f.join("")), g.setOpacity(void 0 !== e ? e : .5), g.on("keydown", I), g.on("keypress", I), g.on("keyup", I), g.appendTo(CKEDITOR.document.getBody()),
  11472. z[c] = g);
  11473. a.focusManager.add(g);
  11474. u = g;
  11475. a = function() {
  11476. var a = b.getViewPaneSize();
  11477. g.setStyles({
  11478. width: a.width + "px",
  11479. height: a.height + "px"
  11480. })
  11481. };
  11482. var h = function() {
  11483. var a = b.getScrollPosition(),
  11484. c = CKEDITOR.dialog._.currentTop;
  11485. g.setStyles({
  11486. left: a.x + "px",
  11487. top: a.y + "px"
  11488. });
  11489. if (c) {
  11490. do a = c.getPosition(), c.move(a.x, a.y); while (c = c._.parentDialog)
  11491. }
  11492. };
  11493. J = a;
  11494. b.on("resize", a);
  11495. a();
  11496. CKEDITOR.env.mac && CKEDITOR.env.webkit || g.focus();
  11497. if (CKEDITOR.env.ie6Compat) {
  11498. var p = function() {
  11499. h();
  11500. arguments.callee.prevScrollHandler.apply(this, arguments)
  11501. };
  11502. b.$.setTimeout(function() {
  11503. p.prevScrollHandler =
  11504. window.onscroll || function() {};
  11505. window.onscroll = p
  11506. }, 0);
  11507. h()
  11508. }
  11509. }
  11510. function O(a) {
  11511. u && (a.focusManager.remove(u), a = CKEDITOR.document.getWindow(), u.hide(), a.removeListener("resize", J), CKEDITOR.env.ie6Compat && a.$.setTimeout(function() {
  11512. window.onscroll = window.onscroll && window.onscroll.prevScrollHandler || null
  11513. }, 0), J = null)
  11514. }
  11515. var v = CKEDITOR.tools.cssLength,
  11516. W = '\x3cdiv class\x3d"cke_reset_all {editorId} {editorDialogClass} {hidpi}" dir\x3d"{langDir}" lang\x3d"{langCode}" role\x3d"dialog" aria-labelledby\x3d"cke_dialog_title_{id}"\x3e\x3ctable class\x3d"cke_dialog ' +
  11517. CKEDITOR.env.cssClass + ' cke_{langDir}" style\x3d"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';
  11518. CKEDITOR.dialog = function(a, b) {
  11519. function c() {
  11520. var a = l._.focusList;
  11521. a.sort(function(a, b) {
  11522. return a.tabIndex != b.tabIndex ? b.tabIndex - a.tabIndex : a.focusIndex - b.focusIndex
  11523. });
  11524. for (var b = a.length, c = 0; c < b; c++) a[c].focusIndex = c
  11525. }
  11526. function e(a) {
  11527. var b = l._.focusList;
  11528. a = a || 0;
  11529. if (!(1 > b.length)) {
  11530. var c = l._.currentFocusIndex;
  11531. l._.tabBarMode && 0 > a && (c = 0);
  11532. try {
  11533. b[c].getInputElement().$.blur()
  11534. } catch (d) {}
  11535. var e = c,
  11536. g = 1 < l._.pageCount;
  11537. do {
  11538. e += a;
  11539. if (g && !l._.tabBarMode && (e == b.length || -1 == e)) {
  11540. l._.tabBarMode = !0;
  11541. l._.tabs[l._.currentTabId][0].focus();
  11542. l._.currentFocusIndex = -1;
  11543. return
  11544. }
  11545. e = (e + b.length) % b.length;
  11546. if (e == c) break
  11547. } while (a && !b[e].isFocusable());
  11548. b[e].focus();
  11549. "text" == b[e].type && b[e].select()
  11550. }
  11551. }
  11552. function d(b) {
  11553. if (l == CKEDITOR.dialog._.currentTop) {
  11554. var c = b.data.getKeystroke(),
  11555. d = "rtl" == a.lang.dir,
  11556. g = [37, 38, 39, 40];
  11557. q = n = 0;
  11558. if (9 == c || c == CKEDITOR.SHIFT + 9) e(c == CKEDITOR.SHIFT + 9 ? -1 : 1), q = 1;
  11559. else if (c == CKEDITOR.ALT + 121 && !l._.tabBarMode && 1 < l.getPageCount()) l._.tabBarMode = !0, l._.tabs[l._.currentTabId][0].focus(), l._.currentFocusIndex = -1, q = 1;
  11560. else if (-1 != CKEDITOR.tools.indexOf(g,
  11561. c) && l._.tabBarMode) c = -1 != CKEDITOR.tools.indexOf([d ? 39 : 37, 38], c) ? x.call(l) : A.call(l), l.selectPage(c), l._.tabs[c][0].focus(), q = 1;
  11562. else if (13 != c && 32 != c || !l._.tabBarMode)
  11563. if (13 == c) c = b.data.getTarget(), c.is("a", "button", "select", "textarea") || c.is("input") && "button" == c.$.type || ((c = this.getButton("ok")) && CKEDITOR.tools.setTimeout(c.click, 0, c), q = 1), n = 1;
  11564. else if (27 == c)(c = this.getButton("cancel")) ? CKEDITOR.tools.setTimeout(c.click, 0, c) : !1 !== this.fire("cancel", {
  11565. hide: !0
  11566. }).hide && this.hide(), n = 1;
  11567. else return;
  11568. else this.selectPage(this._.currentTabId),
  11569. this._.tabBarMode = !1, this._.currentFocusIndex = -1, e(1), q = 1;
  11570. f(b)
  11571. }
  11572. }
  11573. function f(a) {
  11574. q ? a.data.preventDefault(1) : n && a.data.stopPropagation()
  11575. }
  11576. var g = CKEDITOR.dialog._.dialogDefinitions[b],
  11577. h = CKEDITOR.tools.clone(aa),
  11578. p = a.config.dialog_buttonsOrder || "OS",
  11579. m = a.lang.dir,
  11580. k = {},
  11581. q, n;
  11582. ("OS" == p && CKEDITOR.env.mac || "rtl" == p && "ltr" == m || "ltr" == p && "rtl" == m) && h.buttons.reverse();
  11583. g = CKEDITOR.tools.extend(g(a), h);
  11584. g = CKEDITOR.tools.clone(g);
  11585. g = new P(this, g);
  11586. h = V(a);
  11587. this._ = {
  11588. editor: a,
  11589. element: h.element,
  11590. name: b,
  11591. contentSize: {
  11592. width: 0,
  11593. height: 0
  11594. },
  11595. size: {
  11596. width: 0,
  11597. height: 0
  11598. },
  11599. contents: {},
  11600. buttons: {},
  11601. accessKeyMap: {},
  11602. tabs: {},
  11603. tabIdList: [],
  11604. currentTabId: null,
  11605. currentTabIndex: null,
  11606. pageCount: 0,
  11607. lastTab: null,
  11608. tabBarMode: !1,
  11609. focusList: [],
  11610. currentFocusIndex: 0,
  11611. hasFocus: !1
  11612. };
  11613. this.parts = h.parts;
  11614. CKEDITOR.tools.setTimeout(function() {
  11615. a.fire("ariaWidget", this.parts.contents)
  11616. }, 0, this);
  11617. h = {
  11618. position: CKEDITOR.env.ie6Compat ? "absolute" : "fixed",
  11619. top: 0,
  11620. visibility: "hidden"
  11621. };
  11622. h["rtl" == m ? "right" : "left"] = 0;
  11623. this.parts.dialog.setStyles(h);
  11624. CKEDITOR.event.call(this);
  11625. this.definition = g = CKEDITOR.fire("dialogDefinition", {
  11626. name: b,
  11627. definition: g
  11628. }, a).definition;
  11629. if (!("removeDialogTabs" in a._) && a.config.removeDialogTabs) {
  11630. h = a.config.removeDialogTabs.split(";");
  11631. for (m = 0; m < h.length; m++)
  11632. if (p = h[m].split(":"), 2 == p.length) {
  11633. var r = p[0];
  11634. k[r] || (k[r] = []);
  11635. k[r].push(p[1])
  11636. } a._.removeDialogTabs = k
  11637. }
  11638. if (a._.removeDialogTabs && (k = a._.removeDialogTabs[b]))
  11639. for (m = 0; m < k.length; m++) g.removeContents(k[m]);
  11640. if (g.onLoad) this.on("load", g.onLoad);
  11641. if (g.onShow) this.on("show", g.onShow);
  11642. if (g.onHide) this.on("hide", g.onHide);
  11643. if (g.onOk) this.on("ok", function(b) {
  11644. a.fire("saveSnapshot");
  11645. setTimeout(function() {
  11646. a.fire("saveSnapshot")
  11647. }, 0);
  11648. !1 === g.onOk.call(this, b) && (b.data.hide = !1)
  11649. });
  11650. this.state = CKEDITOR.DIALOG_STATE_IDLE;
  11651. if (g.onCancel) this.on("cancel", function(a) {
  11652. !1 === g.onCancel.call(this, a) && (a.data.hide = !1)
  11653. });
  11654. var l = this,
  11655. t = function(a) {
  11656. var b = l._.contents,
  11657. c = !1,
  11658. d;
  11659. for (d in b)
  11660. for (var e in b[d])
  11661. if (c = a.call(this, b[d][e])) return
  11662. };
  11663. this.on("ok", function(a) {
  11664. t(function(b) {
  11665. if (b.validate) {
  11666. var c = b.validate(this),
  11667. d = "string" == typeof c || !1 === c;
  11668. d && (a.data.hide = !1, a.stop());
  11669. T.call(b, !d, "string" == typeof c ?
  11670. c : void 0);
  11671. return d
  11672. }
  11673. })
  11674. }, this, null, 0);
  11675. this.on("cancel", function(b) {
  11676. t(function(c) {
  11677. if (c.isChanged()) return a.config.dialog_noConfirmCancel || confirm(a.lang.common.confirmCancel) || (b.data.hide = !1), !0
  11678. })
  11679. }, this, null, 0);
  11680. this.parts.close.on("click", function(a) {
  11681. !1 !== this.fire("cancel", {
  11682. hide: !0
  11683. }).hide && this.hide();
  11684. a.data.preventDefault()
  11685. }, this);
  11686. this.changeFocus = e;
  11687. var y = this._.element;
  11688. a.focusManager.add(y, 1);
  11689. this.on("show", function() {
  11690. y.on("keydown", d, this);
  11691. if (CKEDITOR.env.gecko) y.on("keypress", f, this)
  11692. });
  11693. this.on("hide",
  11694. function() {
  11695. y.removeListener("keydown", d);
  11696. CKEDITOR.env.gecko && y.removeListener("keypress", f);
  11697. t(function(a) {
  11698. U.apply(a)
  11699. })
  11700. });
  11701. this.on("iframeAdded", function(a) {
  11702. (new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document)).on("keydown", d, this, null, 0)
  11703. });
  11704. this.on("show", function() {
  11705. c();
  11706. var b = 1 < l._.pageCount;
  11707. a.config.dialog_startupFocusTab && b ? (l._.tabBarMode = !0, l._.tabs[l._.currentTabId][0].focus(), l._.currentFocusIndex = -1) : this._.hasFocus || (this._.currentFocusIndex = b ? -1 : this._.focusList.length - 1, g.onFocus ?
  11708. (b = g.onFocus.call(this)) && b.focus() : e(1))
  11709. }, this, null, 4294967295);
  11710. if (CKEDITOR.env.ie6Compat) this.on("load", function() {
  11711. var a = this.getElement(),
  11712. b = a.getFirst();
  11713. b.remove();
  11714. b.appendTo(a)
  11715. }, this);
  11716. Y(this);
  11717. Z(this);
  11718. (new CKEDITOR.dom.text(g.title, CKEDITOR.document)).appendTo(this.parts.title);
  11719. for (m = 0; m < g.contents.length; m++)(k = g.contents[m]) && this.addPage(k);
  11720. this.parts.tabs.on("click", function(a) {
  11721. var b = a.data.getTarget();
  11722. b.hasClass("cke_dialog_tab") && (b = b.$.id, this.selectPage(b.substring(4, b.lastIndexOf("_"))),
  11723. this._.tabBarMode && (this._.tabBarMode = !1, this._.currentFocusIndex = -1, e(1)), a.data.preventDefault())
  11724. }, this);
  11725. m = [];
  11726. k = CKEDITOR.dialog._.uiElementBuilders.hbox.build(this, {
  11727. type: "hbox",
  11728. className: "cke_dialog_footer_buttons",
  11729. widths: [],
  11730. children: g.buttons
  11731. }, m).getChild();
  11732. this.parts.footer.setHtml(m.join(""));
  11733. for (m = 0; m < k.length; m++) this._.buttons[k[m].id] = k[m]
  11734. };
  11735. CKEDITOR.dialog.prototype = {
  11736. destroy: function() {
  11737. this.hide();
  11738. this._.element.remove()
  11739. },
  11740. resize: function() {
  11741. return function(a, b) {
  11742. this._.contentSize && this._.contentSize.width ==
  11743. a && this._.contentSize.height == b || (CKEDITOR.dialog.fire("resize", {
  11744. dialog: this,
  11745. width: a,
  11746. height: b
  11747. }, this._.editor), this.fire("resize", {
  11748. width: a,
  11749. height: b
  11750. }, this._.editor), this.parts.contents.setStyles({
  11751. width: a + "px",
  11752. height: b + "px"
  11753. }), "rtl" == this._.editor.lang.dir && this._.position && (this._.position.x = CKEDITOR.document.getWindow().getViewPaneSize().width - this._.contentSize.width - parseInt(this._.element.getFirst().getStyle("right"), 10)), this._.contentSize = {
  11754. width: a,
  11755. height: b
  11756. })
  11757. }
  11758. }(),
  11759. getSize: function() {
  11760. var a = this._.element.getFirst();
  11761. return {
  11762. width: a.$.offsetWidth || 0,
  11763. height: a.$.offsetHeight || 0
  11764. }
  11765. },
  11766. move: function(a, b, c) {
  11767. var e = this._.element.getFirst(),
  11768. d = "rtl" == this._.editor.lang.dir,
  11769. f = "fixed" == e.getComputedStyle("position");
  11770. CKEDITOR.env.ie && e.setStyle("zoom", "100%");
  11771. f && this._.position && this._.position.x == a && this._.position.y == b || (this._.position = {
  11772. x: a,
  11773. y: b
  11774. }, f || (f = CKEDITOR.document.getWindow().getScrollPosition(), a += f.x, b += f.y), d && (f = this.getSize(), a = CKEDITOR.document.getWindow().getViewPaneSize().width - f.width - a), b = {
  11775. top: (0 < b ? b : 0) + "px"
  11776. },
  11777. b[d ? "right" : "left"] = (0 < a ? a : 0) + "px", e.setStyles(b), c && (this._.moved = 1))
  11778. },
  11779. getPosition: function() {
  11780. return CKEDITOR.tools.extend({}, this._.position)
  11781. },
  11782. show: function() {
  11783. var a = this._.element,
  11784. b = this.definition;
  11785. a.getParent() && a.getParent().equals(CKEDITOR.document.getBody()) ? a.setStyle("display", "block") : a.appendTo(CKEDITOR.document.getBody());
  11786. this.resize(this._.contentSize && this._.contentSize.width || b.width || b.minWidth, this._.contentSize && this._.contentSize.height || b.height || b.minHeight);
  11787. this.reset();
  11788. null ===
  11789. this._.currentTabId && this.selectPage(this.definition.contents[0].id);
  11790. null === CKEDITOR.dialog._.currentZIndex && (CKEDITOR.dialog._.currentZIndex = this._.editor.config.baseFloatZIndex);
  11791. this._.element.getFirst().setStyle("z-index", CKEDITOR.dialog._.currentZIndex += 10);
  11792. null === CKEDITOR.dialog._.currentTop ? (CKEDITOR.dialog._.currentTop = this, this._.parentDialog = null, N(this._.editor)) : (this._.parentDialog = CKEDITOR.dialog._.currentTop, this._.parentDialog.getElement().getFirst().$.style.zIndex -= Math.floor(this._.editor.config.baseFloatZIndex /
  11793. 2), CKEDITOR.dialog._.currentTop = this);
  11794. a.on("keydown", Q);
  11795. a.on("keyup", R);
  11796. this._.hasFocus = !1;
  11797. for (var c in b.contents)
  11798. if (b.contents[c]) {
  11799. var a = b.contents[c],
  11800. e = this._.tabs[a.id],
  11801. d = a.requiredContent,
  11802. f = 0;
  11803. if (e) {
  11804. for (var g in this._.contents[a.id]) {
  11805. var h = this._.contents[a.id][g];
  11806. "hbox" != h.type && "vbox" != h.type && h.getInputElement() && (h.requiredContent && !this._.editor.activeFilter.check(h.requiredContent) ? h.disable() : (h.enable(), f++))
  11807. }!f || d && !this._.editor.activeFilter.check(d) ? e[0].addClass("cke_dialog_tab_disabled") :
  11808. e[0].removeClass("cke_dialog_tab_disabled")
  11809. }
  11810. } CKEDITOR.tools.setTimeout(function() {
  11811. this.layout();
  11812. X(this);
  11813. this.parts.dialog.setStyle("visibility", "");
  11814. this.fireOnce("load", {});
  11815. CKEDITOR.ui.fire("ready", this);
  11816. this.fire("show", {});
  11817. this._.editor.fire("dialogShow", this);
  11818. this._.parentDialog || this._.editor.focusManager.lock();
  11819. this.foreach(function(a) {
  11820. a.setInitValue && a.setInitValue()
  11821. })
  11822. }, 100, this)
  11823. },
  11824. layout: function() {
  11825. var a = this.parts.dialog,
  11826. b = this.getSize(),
  11827. c = CKEDITOR.document.getWindow().getViewPaneSize(),
  11828. e =
  11829. (c.width - b.width) / 2,
  11830. d = (c.height - b.height) / 2;
  11831. CKEDITOR.env.ie6Compat || (b.height + (0 < d ? d : 0) > c.height || b.width + (0 < e ? e : 0) > c.width ? a.setStyle("position", "absolute") : a.setStyle("position", "fixed"));
  11832. this.move(this._.moved ? this._.position.x : e, this._.moved ? this._.position.y : d)
  11833. },
  11834. foreach: function(a) {
  11835. for (var b in this._.contents)
  11836. for (var c in this._.contents[b]) a.call(this, this._.contents[b][c]);
  11837. return this
  11838. },
  11839. reset: function() {
  11840. var a = function(a) {
  11841. a.reset && a.reset(1)
  11842. };
  11843. return function() {
  11844. this.foreach(a);
  11845. return this
  11846. }
  11847. }(),
  11848. setupContent: function() {
  11849. var a = arguments;
  11850. this.foreach(function(b) {
  11851. b.setup && b.setup.apply(b, a)
  11852. })
  11853. },
  11854. commitContent: function() {
  11855. var a = arguments;
  11856. this.foreach(function(b) {
  11857. CKEDITOR.env.ie && this._.currentFocusIndex == b.focusIndex && b.getInputElement().$.blur();
  11858. b.commit && b.commit.apply(b, a)
  11859. })
  11860. },
  11861. hide: function() {
  11862. if (this.parts.dialog.isVisible()) {
  11863. this.fire("hide", {});
  11864. this._.editor.fire("dialogHide", this);
  11865. this.selectPage(this._.tabIdList[0]);
  11866. var a = this._.element;
  11867. a.setStyle("display", "none");
  11868. this.parts.dialog.setStyle("visibility",
  11869. "hidden");
  11870. for (ba(this); CKEDITOR.dialog._.currentTop != this;) CKEDITOR.dialog._.currentTop.hide();
  11871. if (this._.parentDialog) {
  11872. var b = this._.parentDialog.getElement().getFirst();
  11873. b.setStyle("z-index", parseInt(b.$.style.zIndex, 10) + Math.floor(this._.editor.config.baseFloatZIndex / 2))
  11874. } else O(this._.editor);
  11875. if (CKEDITOR.dialog._.currentTop = this._.parentDialog) CKEDITOR.dialog._.currentZIndex -= 10;
  11876. else {
  11877. CKEDITOR.dialog._.currentZIndex = null;
  11878. a.removeListener("keydown", Q);
  11879. a.removeListener("keyup", R);
  11880. var c = this._.editor;
  11881. c.focus();
  11882. setTimeout(function() {
  11883. c.focusManager.unlock();
  11884. CKEDITOR.env.iOS && c.window.focus()
  11885. }, 0)
  11886. }
  11887. delete this._.parentDialog;
  11888. this.foreach(function(a) {
  11889. a.resetInitValue && a.resetInitValue()
  11890. });
  11891. this.setState(CKEDITOR.DIALOG_STATE_IDLE)
  11892. }
  11893. },
  11894. addPage: function(a) {
  11895. if (!a.requiredContent || this._.editor.filter.check(a.requiredContent)) {
  11896. for (var b = [], c = a.label ? ' title\x3d"' + CKEDITOR.tools.htmlEncode(a.label) + '"' : "", e = CKEDITOR.dialog._.uiElementBuilders.vbox.build(this, {
  11897. type: "vbox",
  11898. className: "cke_dialog_page_contents",
  11899. children: a.elements,
  11900. expand: !!a.expand,
  11901. padding: a.padding,
  11902. style: a.style || "width: 100%;"
  11903. }, b), d = this._.contents[a.id] = {}, f = e.getChild(), g = 0; e = f.shift();) e.notAllowed || "hbox" == e.type || "vbox" == e.type || g++, d[e.id] = e, "function" == typeof e.getChild && f.push.apply(f, e.getChild());
  11904. g || (a.hidden = !0);
  11905. b = CKEDITOR.dom.element.createFromHtml(b.join(""));
  11906. b.setAttribute("role", "tabpanel");
  11907. e = CKEDITOR.env;
  11908. d = "cke_" + a.id + "_" + CKEDITOR.tools.getNextNumber();
  11909. c = CKEDITOR.dom.element.createFromHtml(['\x3ca class\x3d"cke_dialog_tab"',
  11910. 0 < this._.pageCount ? " 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"
  11911. ].join(""));
  11912. b.setAttribute("aria-labelledby", d);
  11913. this._.tabs[a.id] = [c, b];
  11914. this._.tabIdList.push(a.id);
  11915. !a.hidden && this._.pageCount++;
  11916. this._.lastTab = c;
  11917. this.updateStyle();
  11918. b.setAttribute("name", a.id);
  11919. b.appendTo(this.parts.contents);
  11920. c.unselectable();
  11921. this.parts.tabs.append(c);
  11922. a.accessKey &&
  11923. (S(this, this, "CTRL+" + a.accessKey, ca, da), this._.accessKeyMap["CTRL+" + a.accessKey] = a.id)
  11924. }
  11925. },
  11926. selectPage: function(a) {
  11927. if (this._.currentTabId != a && !this._.tabs[a][0].hasClass("cke_dialog_tab_disabled") && !1 !== this.fire("selectPage", {
  11928. page: a,
  11929. currentPage: this._.currentTabId
  11930. })) {
  11931. for (var b in this._.tabs) {
  11932. var c = this._.tabs[b][0],
  11933. e = this._.tabs[b][1];
  11934. b != a && (c.removeClass("cke_dialog_tab_selected"), e.hide());
  11935. e.setAttribute("aria-hidden", b != a)
  11936. }
  11937. var d = this._.tabs[a];
  11938. d[0].addClass("cke_dialog_tab_selected");
  11939. CKEDITOR.env.ie6Compat ||
  11940. CKEDITOR.env.ie7Compat ? (K(d[1]), d[1].show(), setTimeout(function() {
  11941. K(d[1], 1)
  11942. }, 0)) : d[1].show();
  11943. this._.currentTabId = a;
  11944. this._.currentTabIndex = CKEDITOR.tools.indexOf(this._.tabIdList, a)
  11945. }
  11946. },
  11947. updateStyle: function() {
  11948. this.parts.dialog[(1 === this._.pageCount ? "add" : "remove") + "Class"]("cke_single_page")
  11949. },
  11950. hidePage: function(a) {
  11951. var b = this._.tabs[a] && this._.tabs[a][0];
  11952. b && 1 != this._.pageCount && b.isVisible() && (a == this._.currentTabId && this.selectPage(x.call(this)), b.hide(), this._.pageCount--, this.updateStyle())
  11953. },
  11954. showPage: function(a) {
  11955. if (a =
  11956. this._.tabs[a] && this._.tabs[a][0]) a.show(), this._.pageCount++, this.updateStyle()
  11957. },
  11958. getElement: function() {
  11959. return this._.element
  11960. },
  11961. getName: function() {
  11962. return this._.name
  11963. },
  11964. getContentElement: function(a, b) {
  11965. var c = this._.contents[a];
  11966. return c && c[b]
  11967. },
  11968. getValueOf: function(a, b) {
  11969. return this.getContentElement(a, b).getValue()
  11970. },
  11971. setValueOf: function(a, b, c) {
  11972. return this.getContentElement(a, b).setValue(c)
  11973. },
  11974. getButton: function(a) {
  11975. return this._.buttons[a]
  11976. },
  11977. click: function(a) {
  11978. return this._.buttons[a].click()
  11979. },
  11980. disableButton: function(a) {
  11981. return this._.buttons[a].disable()
  11982. },
  11983. enableButton: function(a) {
  11984. return this._.buttons[a].enable()
  11985. },
  11986. getPageCount: function() {
  11987. return this._.pageCount
  11988. },
  11989. getParentEditor: function() {
  11990. return this._.editor
  11991. },
  11992. getSelectedElement: function() {
  11993. return this.getParentEditor().getSelection().getSelectedElement()
  11994. },
  11995. addFocusable: function(a, b) {
  11996. if ("undefined" == typeof b) b = this._.focusList.length, this._.focusList.push(new L(this, a, b));
  11997. else {
  11998. this._.focusList.splice(b, 0, new L(this, a, b));
  11999. for (var c = b + 1; c < this._.focusList.length; c++) this._.focusList[c].focusIndex++
  12000. }
  12001. },
  12002. setState: function(a) {
  12003. if (this.state != a) {
  12004. this.state = a;
  12005. if (a == CKEDITOR.DIALOG_STATE_BUSY) {
  12006. if (!this.parts.spinner) {
  12007. var b = this.getParentEditor().lang.dir,
  12008. c = {
  12009. attributes: {
  12010. "class": "cke_dialog_spinner"
  12011. },
  12012. styles: {
  12013. "float": "rtl" == b ? "right" : "left"
  12014. }
  12015. };
  12016. c.styles["margin-" + ("rtl" == b ? "left" : "right")] = "8px";
  12017. this.parts.spinner = CKEDITOR.document.createElement("div", c);
  12018. this.parts.spinner.setHtml("\x26#8987;");
  12019. this.parts.spinner.appendTo(this.parts.title, 1)
  12020. }
  12021. this.parts.spinner.show();
  12022. this.getButton("ok").disable()
  12023. } else a ==
  12024. CKEDITOR.DIALOG_STATE_IDLE && (this.parts.spinner && this.parts.spinner.hide(), this.getButton("ok").enable());
  12025. this.fire("state", a)
  12026. }
  12027. }
  12028. };
  12029. CKEDITOR.tools.extend(CKEDITOR.dialog, {
  12030. add: function(a, b) {
  12031. this._.dialogDefinitions[a] && "function" != typeof b || (this._.dialogDefinitions[a] = b)
  12032. },
  12033. exists: function(a) {
  12034. return !!this._.dialogDefinitions[a]
  12035. },
  12036. getCurrent: function() {
  12037. return CKEDITOR.dialog._.currentTop
  12038. },
  12039. isTabEnabled: function(a, b, c) {
  12040. a = a.config.removeDialogTabs;
  12041. return !(a && a.match(new RegExp("(?:^|;)" + b + ":" + c + "(?:$|;)",
  12042. "i")))
  12043. },
  12044. okButton: function() {
  12045. var a = function(a, c) {
  12046. c = c || {};
  12047. return CKEDITOR.tools.extend({
  12048. id: "ok",
  12049. type: "button",
  12050. label: a.lang.common.ok,
  12051. "class": "cke_dialog_ui_button_ok",
  12052. onClick: function(a) {
  12053. a = a.data.dialog;
  12054. !1 !== a.fire("ok", {
  12055. hide: !0
  12056. }).hide && a.hide()
  12057. }
  12058. }, c, !0)
  12059. };
  12060. a.type = "button";
  12061. a.override = function(b) {
  12062. return CKEDITOR.tools.extend(function(c) {
  12063. return a(c, b)
  12064. }, {
  12065. type: "button"
  12066. }, !0)
  12067. };
  12068. return a
  12069. }(),
  12070. cancelButton: function() {
  12071. var a = function(a, c) {
  12072. c = c || {};
  12073. return CKEDITOR.tools.extend({
  12074. id: "cancel",
  12075. type: "button",
  12076. label: a.lang.common.cancel,
  12077. "class": "cke_dialog_ui_button_cancel",
  12078. onClick: function(a) {
  12079. a = a.data.dialog;
  12080. !1 !== a.fire("cancel", {
  12081. hide: !0
  12082. }).hide && a.hide()
  12083. }
  12084. }, c, !0)
  12085. };
  12086. a.type = "button";
  12087. a.override = function(b) {
  12088. return CKEDITOR.tools.extend(function(c) {
  12089. return a(c, b)
  12090. }, {
  12091. type: "button"
  12092. }, !0)
  12093. };
  12094. return a
  12095. }(),
  12096. addUIElement: function(a, b) {
  12097. this._.uiElementBuilders[a] = b
  12098. }
  12099. });
  12100. CKEDITOR.dialog._ = {
  12101. uiElementBuilders: {},
  12102. dialogDefinitions: {},
  12103. currentTop: null,
  12104. currentZIndex: null
  12105. };
  12106. CKEDITOR.event.implementOn(CKEDITOR.dialog);
  12107. CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype);
  12108. var aa = {
  12109. resizable: CKEDITOR.DIALOG_RESIZE_BOTH,
  12110. minWidth: 600,
  12111. minHeight: 400,
  12112. buttons: [CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton]
  12113. },
  12114. D = function(a, b, c) {
  12115. for (var e = 0, d; d = a[e]; e++)
  12116. if (d.id == b || c && d[c] && (d = D(d[c], b, c))) return d;
  12117. return null
  12118. },
  12119. E = function(a, b, c, e, d) {
  12120. if (c) {
  12121. for (var f = 0, g; g = a[f]; f++) {
  12122. if (g.id == c) return a.splice(f, 0, b), b;
  12123. if (e && g[e] && (g = E(g[e], b, c, e, !0))) return g
  12124. }
  12125. if (d) return null
  12126. }
  12127. a.push(b);
  12128. return b
  12129. },
  12130. F = function(a, b, c) {
  12131. for (var e = 0, d; d = a[e]; e++) {
  12132. if (d.id == b) return a.splice(e, 1);
  12133. if (c && d[c] && (d = F(d[c],
  12134. b, c))) return d
  12135. }
  12136. return null
  12137. },
  12138. P = function(a, b) {
  12139. this.dialog = a;
  12140. for (var c = b.contents, e = 0, d; d = c[e]; e++) c[e] = d && new M(a, d);
  12141. CKEDITOR.tools.extend(this, b)
  12142. };
  12143. P.prototype = {
  12144. getContents: function(a) {
  12145. return D(this.contents, a)
  12146. },
  12147. getButton: function(a) {
  12148. return D(this.buttons, a)
  12149. },
  12150. addContents: function(a, b) {
  12151. return E(this.contents, a, b)
  12152. },
  12153. addButton: function(a, b) {
  12154. return E(this.buttons, a, b)
  12155. },
  12156. removeContents: function(a) {
  12157. F(this.contents, a)
  12158. },
  12159. removeButton: function(a) {
  12160. F(this.buttons, a)
  12161. }
  12162. };
  12163. M.prototype = {
  12164. get: function(a) {
  12165. return D(this.elements,
  12166. a, "children")
  12167. },
  12168. add: function(a, b) {
  12169. return E(this.elements, a, b, "children")
  12170. },
  12171. remove: function(a) {
  12172. F(this.elements, a, "children")
  12173. }
  12174. };
  12175. var J, z = {},
  12176. u, w = {},
  12177. Q = function(a) {
  12178. var b = a.data.$.ctrlKey || a.data.$.metaKey,
  12179. c = a.data.$.altKey,
  12180. e = a.data.$.shiftKey,
  12181. d = String.fromCharCode(a.data.$.keyCode);
  12182. (b = w[(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())
  12183. },
  12184. R = function(a) {
  12185. var b = a.data.$.ctrlKey || a.data.$.metaKey,
  12186. c = a.data.$.altKey,
  12187. e = a.data.$.shiftKey,
  12188. d = String.fromCharCode(a.data.$.keyCode);
  12189. (b = w[(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()))
  12190. },
  12191. S = function(a, b, c, e, d) {
  12192. (w[c] || (w[c] = [])).push({
  12193. uiElement: a,
  12194. dialog: b,
  12195. key: c,
  12196. keyup: d || a.accessKeyUp,
  12197. keydown: e || a.accessKeyDown
  12198. })
  12199. },
  12200. ba = function(a) {
  12201. for (var b in w) {
  12202. for (var c = w[b], e = c.length - 1; 0 <= e; e--) c[e].dialog != a && c[e].uiElement != a || c.splice(e, 1);
  12203. 0 === c.length && delete w[b]
  12204. }
  12205. },
  12206. da = function(a,
  12207. b) {
  12208. a._.accessKeyMap[b] && a.selectPage(a._.accessKeyMap[b])
  12209. },
  12210. ca = function() {};
  12211. (function() {
  12212. CKEDITOR.ui.dialog = {
  12213. uiElement: function(a, b, c, e, d, f, g) {
  12214. if (!(4 > arguments.length)) {
  12215. var h = (e.call ? e(b) : e) || "div",
  12216. p = ["\x3c", h, " "],
  12217. m = (d && d.call ? d(b) : d) || {},
  12218. k = (f && f.call ? f(b) : f) || {},
  12219. q = (g && g.call ? g.call(this, a, b) : g) || "",
  12220. n = this.domId = k.id || CKEDITOR.tools.getNextId() + "_uiElement";
  12221. b.requiredContent && !a.getParentEditor().filter.check(b.requiredContent) && (m.display = "none", this.notAllowed = !0);
  12222. k.id = n;
  12223. var r = {};
  12224. b.type && (r["cke_dialog_ui_" +
  12225. b.type] = 1);
  12226. b.className && (r[b.className] = 1);
  12227. b.disabled && (r.cke_disabled = 1);
  12228. for (var l = k["class"] && k["class"].split ? k["class"].split(" ") : [], n = 0; n < l.length; n++) l[n] && (r[l[n]] = 1);
  12229. l = [];
  12230. for (n in r) l.push(n);
  12231. k["class"] = l.join(" ");
  12232. b.title && (k.title = b.title);
  12233. r = (b.style || "").split(";");
  12234. b.align && (l = b.align, m["margin-left"] = "left" == l ? 0 : "auto", m["margin-right"] = "right" == l ? 0 : "auto");
  12235. for (n in m) r.push(n + ":" + m[n]);
  12236. b.hidden && r.push("display:none");
  12237. for (n = r.length - 1; 0 <= n; n--) "" === r[n] && r.splice(n, 1);
  12238. 0 < r.length && (k.style =
  12239. (k.style ? k.style + "; " : "") + r.join("; "));
  12240. for (n in k) p.push(n + '\x3d"' + CKEDITOR.tools.htmlEncode(k[n]) + '" ');
  12241. p.push("\x3e", q, "\x3c/", h, "\x3e");
  12242. c.push(p.join(""));
  12243. (this._ || (this._ = {})).dialog = a;
  12244. "boolean" == typeof b.isChanged && (this.isChanged = function() {
  12245. return b.isChanged
  12246. });
  12247. "function" == typeof b.isChanged && (this.isChanged = b.isChanged);
  12248. "function" == typeof b.setValue && (this.setValue = CKEDITOR.tools.override(this.setValue, function(a) {
  12249. return function(c) {
  12250. a.call(this, b.setValue.call(this, c))
  12251. }
  12252. }));
  12253. "function" == typeof b.getValue &&
  12254. (this.getValue = CKEDITOR.tools.override(this.getValue, function(a) {
  12255. return function() {
  12256. return b.getValue.call(this, a.call(this))
  12257. }
  12258. }));
  12259. CKEDITOR.event.implementOn(this);
  12260. this.registerEvents(b);
  12261. this.accessKeyUp && this.accessKeyDown && b.accessKey && S(this, a, "CTRL+" + b.accessKey);
  12262. var t = this;
  12263. a.on("load", function() {
  12264. var b = t.getInputElement();
  12265. if (b) {
  12266. var c = t.type in {
  12267. checkbox: 1,
  12268. ratio: 1
  12269. } && CKEDITOR.env.ie && 8 > CKEDITOR.env.version ? "cke_dialog_ui_focused" : "";
  12270. b.on("focus", function() {
  12271. a._.tabBarMode = !1;
  12272. a._.hasFocus = !0;
  12273. t.fire("focus");
  12274. c && this.addClass(c)
  12275. });
  12276. b.on("blur", function() {
  12277. t.fire("blur");
  12278. c && this.removeClass(c)
  12279. })
  12280. }
  12281. });
  12282. CKEDITOR.tools.extend(this, b);
  12283. this.keyboardFocusable && (this.tabIndex = b.tabIndex || 0, this.focusIndex = a._.focusList.push(this) - 1, this.on("focus", function() {
  12284. a._.currentFocusIndex = t.focusIndex
  12285. }))
  12286. }
  12287. },
  12288. hbox: function(a, b, c, e, d) {
  12289. if (!(4 > arguments.length)) {
  12290. this._ || (this._ = {});
  12291. var f = this._.children = b,
  12292. g = d && d.widths || null,
  12293. h = d && d.height || null,
  12294. p, m = {
  12295. role: "presentation"
  12296. };
  12297. d && d.align && (m.align = d.align);
  12298. CKEDITOR.ui.dialog.uiElement.call(this,
  12299. a, d || {
  12300. type: "hbox"
  12301. }, e, "table", {}, m,
  12302. function() {
  12303. var a = ['\x3ctbody\x3e\x3ctr class\x3d"cke_dialog_ui_hbox"\x3e'];
  12304. for (p = 0; p < c.length; p++) {
  12305. var b = "cke_dialog_ui_hbox_child",
  12306. e = [];
  12307. 0 === p && (b = "cke_dialog_ui_hbox_first");
  12308. p == c.length - 1 && (b = "cke_dialog_ui_hbox_last");
  12309. a.push('\x3ctd class\x3d"', b, '" role\x3d"presentation" ');
  12310. g ? g[p] && e.push("width:" + v(g[p])) : e.push("width:" + Math.floor(100 / c.length) + "%");
  12311. h && e.push("height:" + v(h));
  12312. d && void 0 !== d.padding && e.push("padding:" + v(d.padding));
  12313. CKEDITOR.env.ie && CKEDITOR.env.quirks &&
  12314. f[p].align && e.push("text-align:" + f[p].align);
  12315. 0 < e.length && a.push('style\x3d"' + e.join("; ") + '" ');
  12316. a.push("\x3e", c[p], "\x3c/td\x3e")
  12317. }
  12318. a.push("\x3c/tr\x3e\x3c/tbody\x3e");
  12319. return a.join("")
  12320. })
  12321. }
  12322. },
  12323. vbox: function(a, b, c, e, d) {
  12324. if (!(3 > arguments.length)) {
  12325. this._ || (this._ = {});
  12326. var f = this._.children = b,
  12327. g = d && d.width || null,
  12328. h = d && d.heights || null;
  12329. CKEDITOR.ui.dialog.uiElement.call(this, a, d || {
  12330. type: "vbox"
  12331. }, e, "div", null, {
  12332. role: "presentation"
  12333. }, function() {
  12334. var b = ['\x3ctable role\x3d"presentation" cellspacing\x3d"0" border\x3d"0" '];
  12335. b.push('style\x3d"');
  12336. d && d.expand && b.push("height:100%;");
  12337. b.push("width:" + v(g || "100%"), ";");
  12338. CKEDITOR.env.webkit && b.push("float:none;");
  12339. b.push('"');
  12340. b.push('align\x3d"', CKEDITOR.tools.htmlEncode(d && d.align || ("ltr" == a.getParentEditor().lang.dir ? "left" : "right")), '" ');
  12341. b.push("\x3e\x3ctbody\x3e");
  12342. for (var e = 0; e < c.length; e++) {
  12343. var k = [];
  12344. b.push('\x3ctr\x3e\x3ctd role\x3d"presentation" ');
  12345. g && k.push("width:" + v(g || "100%"));
  12346. h ? k.push("height:" + v(h[e])) : d && d.expand && k.push("height:" + Math.floor(100 / c.length) + "%");
  12347. d && void 0 !== d.padding && k.push("padding:" + v(d.padding));
  12348. CKEDITOR.env.ie && CKEDITOR.env.quirks && f[e].align && k.push("text-align:" + f[e].align);
  12349. 0 < k.length && b.push('style\x3d"', k.join("; "), '" ');
  12350. b.push(' class\x3d"cke_dialog_ui_vbox_child"\x3e', c[e], "\x3c/td\x3e\x3c/tr\x3e")
  12351. }
  12352. b.push("\x3c/tbody\x3e\x3c/table\x3e");
  12353. return b.join("")
  12354. })
  12355. }
  12356. }
  12357. }
  12358. })();
  12359. CKEDITOR.ui.dialog.uiElement.prototype = {
  12360. getElement: function() {
  12361. return CKEDITOR.document.getById(this.domId)
  12362. },
  12363. getInputElement: function() {
  12364. return this.getElement()
  12365. },
  12366. getDialog: function() {
  12367. return this._.dialog
  12368. },
  12369. setValue: function(a, b) {
  12370. this.getInputElement().setValue(a);
  12371. !b && this.fire("change", {
  12372. value: a
  12373. });
  12374. return this
  12375. },
  12376. getValue: function() {
  12377. return this.getInputElement().getValue()
  12378. },
  12379. isChanged: function() {
  12380. return !1
  12381. },
  12382. selectParentTab: function() {
  12383. for (var a = this.getInputElement();
  12384. (a = a.getParent()) && -1 == a.$.className.search("cke_dialog_page_contents"););
  12385. if (!a) return this;
  12386. a = a.getAttribute("name");
  12387. this._.dialog._.currentTabId != a && this._.dialog.selectPage(a);
  12388. return this
  12389. },
  12390. focus: function() {
  12391. this.selectParentTab().getInputElement().focus();
  12392. return this
  12393. },
  12394. registerEvents: function(a) {
  12395. var b = /^on([A-Z]\w+)/,
  12396. c, e = function(a, b, c, d) {
  12397. b.on("load", function() {
  12398. a.getInputElement().on(c, d, a)
  12399. })
  12400. },
  12401. d;
  12402. for (d in a)
  12403. 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]);
  12404. return this
  12405. },
  12406. eventProcessors: {
  12407. onLoad: function(a, b) {
  12408. a.on("load", b, this)
  12409. },
  12410. onShow: function(a, b) {
  12411. a.on("show", b, this)
  12412. },
  12413. onHide: function(a, b) {
  12414. a.on("hide", b, this)
  12415. }
  12416. },
  12417. accessKeyDown: function() {
  12418. this.focus()
  12419. },
  12420. accessKeyUp: function() {},
  12421. disable: function() {
  12422. var a = this.getElement();
  12423. this.getInputElement().setAttribute("disabled", "true");
  12424. a.addClass("cke_disabled")
  12425. },
  12426. enable: function() {
  12427. var a = this.getElement();
  12428. this.getInputElement().removeAttribute("disabled");
  12429. a.removeClass("cke_disabled")
  12430. },
  12431. isEnabled: function() {
  12432. return !this.getElement().hasClass("cke_disabled")
  12433. },
  12434. isVisible: function() {
  12435. return this.getInputElement().isVisible()
  12436. },
  12437. isFocusable: function() {
  12438. return this.isEnabled() && this.isVisible() ? !0 : !1
  12439. }
  12440. };
  12441. CKEDITOR.ui.dialog.hbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
  12442. getChild: function(a) {
  12443. if (1 > arguments.length) return this._.children.concat();
  12444. a.splice || (a = [a]);
  12445. return 2 > a.length ? this._.children[a[0]] : this._.children[a[0]] && this._.children[a[0]].getChild ? this._.children[a[0]].getChild(a.slice(1, a.length)) : null
  12446. }
  12447. }, !0);
  12448. CKEDITOR.ui.dialog.vbox.prototype = new CKEDITOR.ui.dialog.hbox;
  12449. (function() {
  12450. var a = {
  12451. build: function(a, c, e) {
  12452. for (var d = c.children, f, g = [], h = [], p = 0; p < d.length && (f = d[p]); p++) {
  12453. var m = [];
  12454. g.push(m);
  12455. h.push(CKEDITOR.dialog._.uiElementBuilders[f.type].build(a, f, m))
  12456. }
  12457. return new CKEDITOR.ui.dialog[c.type](a,
  12458. h, g, e, c)
  12459. }
  12460. };
  12461. CKEDITOR.dialog.addUIElement("hbox", a);
  12462. CKEDITOR.dialog.addUIElement("vbox", a)
  12463. })();
  12464. CKEDITOR.dialogCommand = function(a, b) {
  12465. this.dialogName = a;
  12466. CKEDITOR.tools.extend(this, b, !0)
  12467. };
  12468. CKEDITOR.dialogCommand.prototype = {
  12469. exec: function(a) {
  12470. var b = this.tabId;
  12471. a.openDialog(this.dialogName, function(a) {
  12472. b && a.selectPage(b)
  12473. })
  12474. },
  12475. canUndo: !1,
  12476. editorFocus: 1
  12477. };
  12478. (function() {
  12479. var a = /^([a]|[^a])+$/,
  12480. b = /^\d*$/,
  12481. c = /^\d*(?:\.\d+)?$/,
  12482. e = /^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,
  12483. d = /^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,
  12484. f = /^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/;
  12485. CKEDITOR.VALIDATE_OR = 1;
  12486. CKEDITOR.VALIDATE_AND = 2;
  12487. CKEDITOR.dialog.validate = {
  12488. functions: function() {
  12489. var a = arguments;
  12490. return function() {
  12491. var b = this && this.getValue ? this.getValue() : a[0],
  12492. c, d = CKEDITOR.VALIDATE_AND,
  12493. e = [],
  12494. f;
  12495. for (f = 0; f < a.length; f++)
  12496. if ("function" == typeof a[f]) e.push(a[f]);
  12497. else break;
  12498. f < a.length && "string" == typeof a[f] && (c = a[f], f++);
  12499. f < a.length && "number" == typeof a[f] && (d = a[f]);
  12500. var n = d == CKEDITOR.VALIDATE_AND ? !0 : !1;
  12501. for (f = 0; f < e.length; f++) n = d == CKEDITOR.VALIDATE_AND ? n &&
  12502. e[f](b) : n || e[f](b);
  12503. return n ? !0 : c
  12504. }
  12505. },
  12506. regex: function(a, b) {
  12507. return function(c) {
  12508. c = this && this.getValue ? this.getValue() : c;
  12509. return a.test(c) ? !0 : b
  12510. }
  12511. },
  12512. notEmpty: function(b) {
  12513. return this.regex(a, b)
  12514. },
  12515. integer: function(a) {
  12516. return this.regex(b, a)
  12517. },
  12518. number: function(a) {
  12519. return this.regex(c, a)
  12520. },
  12521. cssLength: function(a) {
  12522. return this.functions(function(a) {
  12523. return d.test(CKEDITOR.tools.trim(a))
  12524. }, a)
  12525. },
  12526. htmlLength: function(a) {
  12527. return this.functions(function(a) {
  12528. return e.test(CKEDITOR.tools.trim(a))
  12529. }, a)
  12530. },
  12531. inlineStyle: function(a) {
  12532. return this.functions(function(a) {
  12533. return f.test(CKEDITOR.tools.trim(a))
  12534. },
  12535. a)
  12536. },
  12537. equals: function(a, b) {
  12538. return this.functions(function(b) {
  12539. return b == a
  12540. }, b)
  12541. },
  12542. notEqual: function(a, b) {
  12543. return this.functions(function(b) {
  12544. return b != a
  12545. }, b)
  12546. }
  12547. };
  12548. CKEDITOR.on("instanceDestroyed", function(a) {
  12549. if (CKEDITOR.tools.isEmpty(CKEDITOR.instances)) {
  12550. for (var b; b = CKEDITOR.dialog._.currentTop;) b.hide();
  12551. for (var c in z) z[c].remove();
  12552. z = {}
  12553. }
  12554. a = a.editor._.storedDialogs;
  12555. for (var d in a) a[d].destroy()
  12556. })
  12557. })();
  12558. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  12559. openDialog: function(a, b) {
  12560. var c = null,
  12561. e = CKEDITOR.dialog._.dialogDefinitions[a];
  12562. null === CKEDITOR.dialog._.currentTop && N(this);
  12563. if ("function" == typeof e) c = this._.storedDialogs || (this._.storedDialogs = {}), c = c[a] || (c[a] = new CKEDITOR.dialog(this, a)), b && b.call(c, c), c.show();
  12564. else {
  12565. if ("failed" == e) throw O(this), Error('[CKEDITOR.dialog.openDialog] Dialog "' + a + '" failed when loading definition.');
  12566. "string" == typeof e && CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(e), function() {
  12567. "function" != typeof CKEDITOR.dialog._.dialogDefinitions[a] && (CKEDITOR.dialog._.dialogDefinitions[a] = "failed");
  12568. this.openDialog(a,
  12569. b)
  12570. }, this, 0, 1)
  12571. }
  12572. CKEDITOR.skin.loadPart("dialog");
  12573. return c
  12574. }
  12575. })
  12576. })();
  12577. CKEDITOR.plugins.add("dialog", {
  12578. requires: "dialogui",
  12579. init: function(x) {
  12580. x.on("doubleclick", function(A) {
  12581. A.data.dialog && x.openDialog(A.data.dialog)
  12582. }, null, null, 999)
  12583. }
  12584. });
  12585. CKEDITOR.plugins.add("about", {
  12586. requires: "dialog",
  12587. init: function(a) {
  12588. var b = a.addCommand("about", new CKEDITOR.dialogCommand("about"));
  12589. b.modes = {
  12590. wysiwyg: 1,
  12591. source: 1
  12592. };
  12593. b.canUndo = !1;
  12594. b.readOnly = 1;
  12595. a.ui.addButton && a.ui.addButton("About", {
  12596. label: a.lang.about.dlgTitle,
  12597. command: "about",
  12598. toolbar: "about"
  12599. });
  12600. CKEDITOR.dialog.add("about", this.path + "dialogs/about.js")
  12601. }
  12602. });
  12603. (function() {
  12604. CKEDITOR.plugins.add("a11yhelp", {
  12605. requires: "dialog",
  12606. availableLangs: {
  12607. af: 1,
  12608. ar: 1,
  12609. az: 1,
  12610. bg: 1,
  12611. ca: 1,
  12612. cs: 1,
  12613. cy: 1,
  12614. da: 1,
  12615. de: 1,
  12616. "de-ch": 1,
  12617. el: 1,
  12618. en: 1,
  12619. "en-au": 1,
  12620. "en-gb": 1,
  12621. eo: 1,
  12622. es: 1,
  12623. "es-mx": 1,
  12624. et: 1,
  12625. eu: 1,
  12626. fa: 1,
  12627. fi: 1,
  12628. fo: 1,
  12629. fr: 1,
  12630. "fr-ca": 1,
  12631. gl: 1,
  12632. gu: 1,
  12633. he: 1,
  12634. hi: 1,
  12635. hr: 1,
  12636. hu: 1,
  12637. id: 1,
  12638. it: 1,
  12639. ja: 1,
  12640. km: 1,
  12641. ko: 1,
  12642. ku: 1,
  12643. lt: 1,
  12644. lv: 1,
  12645. mk: 1,
  12646. mn: 1,
  12647. nb: 1,
  12648. nl: 1,
  12649. no: 1,
  12650. oc: 1,
  12651. pl: 1,
  12652. pt: 1,
  12653. "pt-br": 1,
  12654. ro: 1,
  12655. ru: 1,
  12656. si: 1,
  12657. sk: 1,
  12658. sl: 1,
  12659. sq: 1,
  12660. sr: 1,
  12661. "sr-latn": 1,
  12662. sv: 1,
  12663. th: 1,
  12664. tr: 1,
  12665. tt: 1,
  12666. ug: 1,
  12667. uk: 1,
  12668. vi: 1,
  12669. zh: 1,
  12670. "zh-cn": 1
  12671. },
  12672. init: function(b) {
  12673. var c = this;
  12674. b.addCommand("a11yHelp", {
  12675. exec: function() {
  12676. var a =
  12677. b.langCode,
  12678. a = c.availableLangs[a] ? a : c.availableLangs[a.replace(/-.*/, "")] ? a.replace(/-.*/, "") : "en";
  12679. CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(c.path + "dialogs/lang/" + a + ".js"), function() {
  12680. b.lang.a11yhelp = c.langEntries[a];
  12681. b.openDialog("a11yHelp")
  12682. })
  12683. },
  12684. modes: {
  12685. wysiwyg: 1,
  12686. source: 1
  12687. },
  12688. readOnly: 1,
  12689. canUndo: !1
  12690. });
  12691. b.setKeystroke(CKEDITOR.ALT + 48, "a11yHelp");
  12692. CKEDITOR.dialog.add("a11yHelp", this.path + "dialogs/a11yhelp.js");
  12693. b.on("ariaEditorHelpLabel", function(a) {
  12694. a.data.label = b.lang.common.editorHelp
  12695. })
  12696. }
  12697. })
  12698. })();
  12699. (function() {
  12700. function f(c) {
  12701. var a = this.att;
  12702. c = c && c.hasAttribute(a) && c.getAttribute(a) || "";
  12703. void 0 !== c && this.setValue(c)
  12704. }
  12705. function g() {
  12706. for (var c, a = 0; a < arguments.length; a++)
  12707. if (arguments[a] instanceof CKEDITOR.dom.element) {
  12708. c = arguments[a];
  12709. break
  12710. } if (c) {
  12711. var a = this.att,
  12712. b = this.getValue();
  12713. b ? c.setAttribute(a, b) : c.removeAttribute(a, b)
  12714. }
  12715. }
  12716. var k = {
  12717. id: 1,
  12718. dir: 1,
  12719. classes: 1,
  12720. styles: 1
  12721. };
  12722. CKEDITOR.plugins.add("dialogadvtab", {
  12723. requires: "dialog",
  12724. allowedContent: function(c) {
  12725. c || (c = k);
  12726. var a = [];
  12727. c.id && a.push("id");
  12728. c.dir && a.push("dir");
  12729. var b =
  12730. "";
  12731. a.length && (b += "[" + a.join(",") + "]");
  12732. c.classes && (b += "(*)");
  12733. c.styles && (b += "{*}");
  12734. return b
  12735. },
  12736. createAdvancedTab: function(c, a, b) {
  12737. a || (a = k);
  12738. var d = c.lang.common,
  12739. h = {
  12740. id: "advanced",
  12741. label: d.advancedTab,
  12742. title: d.advancedTab,
  12743. elements: [{
  12744. type: "vbox",
  12745. padding: 1,
  12746. children: []
  12747. }]
  12748. },
  12749. e = [];
  12750. if (a.id || a.dir) a.id && e.push({
  12751. id: "advId",
  12752. att: "id",
  12753. type: "text",
  12754. requiredContent: b ? b + "[id]" : null,
  12755. label: d.id,
  12756. setup: f,
  12757. commit: g
  12758. }), a.dir && e.push({
  12759. id: "advLangDir",
  12760. att: "dir",
  12761. type: "select",
  12762. requiredContent: b ? b + "[dir]" : null,
  12763. label: d.langDir,
  12764. "default": "",
  12765. style: "width:100%",
  12766. items: [
  12767. [d.notSet, ""],
  12768. [d.langDirLTR, "ltr"],
  12769. [d.langDirRTL, "rtl"]
  12770. ],
  12771. setup: f,
  12772. commit: g
  12773. }), h.elements[0].children.push({
  12774. type: "hbox",
  12775. widths: ["50%", "50%"],
  12776. children: [].concat(e)
  12777. });
  12778. if (a.styles || a.classes) e = [], a.styles && e.push({
  12779. id: "advStyles",
  12780. att: "style",
  12781. type: "text",
  12782. requiredContent: b ? b + "{cke-xyz}" : null,
  12783. label: d.styles,
  12784. "default": "",
  12785. validate: CKEDITOR.dialog.validate.inlineStyle(d.invalidInlineStyle),
  12786. onChange: function() {},
  12787. getStyle: function(a, c) {
  12788. var b = this.getValue().match(new RegExp("(?:^|;)\\s*" +
  12789. a + "\\s*:\\s*([^;]*)", "i"));
  12790. return b ? b[1] : c
  12791. },
  12792. updateStyle: function(a, b) {
  12793. var d = this.getValue(),
  12794. e = c.document.createElement("span");
  12795. e.setAttribute("style", d);
  12796. e.setStyle(a, b);
  12797. d = CKEDITOR.tools.normalizeCssText(e.getAttribute("style"));
  12798. this.setValue(d, 1)
  12799. },
  12800. setup: f,
  12801. commit: g
  12802. }), a.classes && e.push({
  12803. type: "hbox",
  12804. widths: ["45%", "55%"],
  12805. children: [{
  12806. id: "advCSSClasses",
  12807. att: "class",
  12808. type: "text",
  12809. requiredContent: b ? b + "(cke-xyz)" : null,
  12810. label: d.cssClasses,
  12811. "default": "",
  12812. setup: f,
  12813. commit: g
  12814. }]
  12815. }), h.elements[0].children.push({
  12816. type: "hbox",
  12817. widths: ["50%", "50%"],
  12818. children: [].concat(e)
  12819. });
  12820. return h
  12821. }
  12822. })
  12823. })();
  12824. CKEDITOR.plugins.add("basicstyles", {
  12825. init: function(c) {
  12826. var e = 0,
  12827. d = function(g, d, b, a) {
  12828. if (a) {
  12829. a = new CKEDITOR.style(a);
  12830. var f = h[b];
  12831. f.unshift(a);
  12832. c.attachStyleStateChange(a, function(a) {
  12833. !c.readOnly && c.getCommand(b).setState(a)
  12834. });
  12835. c.addCommand(b, new CKEDITOR.styleCommand(a, {
  12836. contentForms: f
  12837. }));
  12838. c.ui.addButton && c.ui.addButton(g, {
  12839. label: d,
  12840. command: b,
  12841. toolbar: "basicstyles," + (e += 10)
  12842. })
  12843. }
  12844. },
  12845. h = {
  12846. bold: ["strong", "b", ["span", function(a) {
  12847. a = a.styles["font-weight"];
  12848. return "bold" == a || 700 <= +a
  12849. }]],
  12850. italic: ["em", "i", ["span", function(a) {
  12851. return "italic" ==
  12852. a.styles["font-style"]
  12853. }]],
  12854. underline: ["u", ["span", function(a) {
  12855. return "underline" == a.styles["text-decoration"]
  12856. }]],
  12857. strike: ["s", "strike", ["span", function(a) {
  12858. return "line-through" == a.styles["text-decoration"]
  12859. }]],
  12860. subscript: ["sub"],
  12861. superscript: ["sup"]
  12862. },
  12863. b = c.config,
  12864. a = c.lang.basicstyles;
  12865. d("Bold", a.bold, "bold", b.coreStyles_bold);
  12866. d("Italic", a.italic, "italic", b.coreStyles_italic);
  12867. d("Underline", a.underline, "underline", b.coreStyles_underline);
  12868. d("Strike", a.strike, "strike", b.coreStyles_strike);
  12869. d("Subscript", a.subscript,
  12870. "subscript", b.coreStyles_subscript);
  12871. d("Superscript", a.superscript, "superscript", b.coreStyles_superscript);
  12872. c.setKeystroke([
  12873. [CKEDITOR.CTRL + 66, "bold"],
  12874. [CKEDITOR.CTRL + 73, "italic"],
  12875. [CKEDITOR.CTRL + 85, "underline"]
  12876. ])
  12877. }
  12878. });
  12879. CKEDITOR.config.coreStyles_bold = {
  12880. element: "strong",
  12881. overrides: "b"
  12882. };
  12883. CKEDITOR.config.coreStyles_italic = {
  12884. element: "em",
  12885. overrides: "i"
  12886. };
  12887. CKEDITOR.config.coreStyles_underline = {
  12888. element: "u"
  12889. };
  12890. CKEDITOR.config.coreStyles_strike = {
  12891. element: "s",
  12892. overrides: "strike"
  12893. };
  12894. CKEDITOR.config.coreStyles_subscript = {
  12895. element: "sub"
  12896. };
  12897. CKEDITOR.config.coreStyles_superscript = {
  12898. element: "sup"
  12899. };
  12900. (function() {
  12901. function q(a, f, d, b) {
  12902. if (!a.isReadOnly() && !a.equals(d.editable())) {
  12903. CKEDITOR.dom.element.setMarker(b, a, "bidi_processed", 1);
  12904. b = a;
  12905. for (var c = d.editable();
  12906. (b = b.getParent()) && !b.equals(c);)
  12907. if (b.getCustomData("bidi_processed")) {
  12908. a.removeStyle("direction");
  12909. a.removeAttribute("dir");
  12910. return
  12911. } b = "useComputedState" in d.config ? d.config.useComputedState : 1;
  12912. (b ? a.getComputedStyle("direction") : a.getStyle("direction") || a.hasAttribute("dir")) != f && (a.removeStyle("direction"), b ? (a.removeAttribute("dir"), f != a.getComputedStyle("direction") &&
  12913. a.setAttribute("dir", f)) : a.setAttribute("dir", f), d.forceNextSelectionCheck())
  12914. }
  12915. }
  12916. function v(a, f, d) {
  12917. var b = a.getCommonAncestor(!1, !0);
  12918. a = a.clone();
  12919. a.enlarge(d == CKEDITOR.ENTER_BR ? CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS);
  12920. if (a.checkBoundaryOfElement(b, CKEDITOR.START) && a.checkBoundaryOfElement(b, CKEDITOR.END)) {
  12921. for (var c; b && b.type == CKEDITOR.NODE_ELEMENT && (c = b.getParent()) && 1 == c.getChildCount() && !(b.getName() in f);) b = c;
  12922. return b.type == CKEDITOR.NODE_ELEMENT && b.getName() in f && b
  12923. }
  12924. }
  12925. function p(a) {
  12926. return {
  12927. context: "p",
  12928. allowedContent: {
  12929. "h1 h2 h3 h4 h5 h6 table ul ol blockquote div tr p div li td": {
  12930. propertiesOnly: !0,
  12931. attributes: "dir"
  12932. }
  12933. },
  12934. requiredContent: "p[dir]",
  12935. refresh: function(a, d) {
  12936. var b = a.config.useComputedState,
  12937. c, b = void 0 === b || b;
  12938. if (!b) {
  12939. c = d.lastElement;
  12940. for (var h = a.editable(); c && !(c.getName() in u || c.equals(h));) {
  12941. var e = c.getParent();
  12942. if (!e) break;
  12943. c = e
  12944. }
  12945. }
  12946. c = c || d.block || d.blockLimit;
  12947. c.equals(a.editable()) && (h = a.getSelection().getRanges()[0].getEnclosedNode()) && h.type == CKEDITOR.NODE_ELEMENT && (c = h);
  12948. c && (b = b ? c.getComputedStyle("direction") :
  12949. c.getStyle("direction") || c.getAttribute("dir"), a.getCommand("bidirtl").setState("rtl" == b ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF), a.getCommand("bidiltr").setState("ltr" == b ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF));
  12950. b = (d.block || d.blockLimit || a.editable()).getDirection(1);
  12951. b != (a._.selDir || a.lang.dir) && (a._.selDir = b, a.fire("contentDirChanged", b))
  12952. },
  12953. exec: function(f) {
  12954. var d = f.getSelection(),
  12955. b = f.config.enterMode,
  12956. c = d.getRanges();
  12957. if (c && c.length) {
  12958. for (var h = {}, e = d.createBookmarks(), c = c.createIterator(), g,
  12959. l = 0; g = c.getNextRange(1);) {
  12960. var k = g.getEnclosedNode();
  12961. k && (!k || k.type == CKEDITOR.NODE_ELEMENT && k.getName() in r) || (k = v(g, t, b));
  12962. k && q(k, a, f, h);
  12963. var m = new CKEDITOR.dom.walker(g),
  12964. n = e[l].startNode,
  12965. p = e[l++].endNode;
  12966. m.evaluator = function(a) {
  12967. var c = b == CKEDITOR.ENTER_P ? "p" : "div",
  12968. d;
  12969. if (d = (a ? a.type == CKEDITOR.NODE_ELEMENT : !1) && a.getName() in t) {
  12970. if (c = a.is(c)) c = (c = a.getParent()) ? c.type == CKEDITOR.NODE_ELEMENT : !1;
  12971. d = !(c && a.getParent().is("blockquote"))
  12972. }
  12973. return !!(d && a.getPosition(n) & CKEDITOR.POSITION_FOLLOWING && (a.getPosition(p) &
  12974. CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_CONTAINS) == CKEDITOR.POSITION_PRECEDING)
  12975. };
  12976. for (; k = m.next();) q(k, a, f, h);
  12977. g = g.createIterator();
  12978. for (g.enlargeBr = b != CKEDITOR.ENTER_BR; k = g.getNextParagraph(b == CKEDITOR.ENTER_P ? "p" : "div");) q(k, a, f, h)
  12979. }
  12980. CKEDITOR.dom.element.clearAllMarkers(h);
  12981. f.forceNextSelectionCheck();
  12982. d.selectBookmarks(e);
  12983. f.focus()
  12984. }
  12985. }
  12986. }
  12987. }
  12988. function w(a) {
  12989. var f = a == l.setAttribute,
  12990. d = a == l.removeAttribute,
  12991. b = /\bdirection\s*:\s*(.*?)\s*(:?$|;)/;
  12992. return function(c, h) {
  12993. if (!this.isReadOnly()) {
  12994. var e;
  12995. if (e = c == (f || d ?
  12996. "dir" : "direction") || "style" == c && (d || b.test(h))) {
  12997. a: {
  12998. e = this;
  12999. for (var g = e.getDocument().getBody().getParent(); e;) {
  13000. if (e.equals(g)) {
  13001. e = !1;
  13002. break a
  13003. }
  13004. e = e.getParent()
  13005. }
  13006. e = !0
  13007. }
  13008. e = !e
  13009. }
  13010. if (e && (e = this.getDirection(1), g = a.apply(this, arguments), e != this.getDirection(1))) return this.getDocument().fire("dirChanged", this), g
  13011. }
  13012. return a.apply(this, arguments)
  13013. }
  13014. }
  13015. var t = {
  13016. table: 1,
  13017. ul: 1,
  13018. ol: 1,
  13019. blockquote: 1,
  13020. div: 1
  13021. },
  13022. r = {},
  13023. u = {};
  13024. CKEDITOR.tools.extend(r, t, {
  13025. tr: 1,
  13026. p: 1,
  13027. div: 1,
  13028. li: 1
  13029. });
  13030. CKEDITOR.tools.extend(u, r, {
  13031. td: 1
  13032. });
  13033. CKEDITOR.plugins.add("bidi", {
  13034. init: function(a) {
  13035. function f(b,
  13036. c, d, e, f) {
  13037. a.addCommand(d, new CKEDITOR.command(a, e));
  13038. a.ui.addButton && a.ui.addButton(b, {
  13039. label: c,
  13040. command: d,
  13041. toolbar: "bidi," + f
  13042. })
  13043. }
  13044. if (!a.blockless) {
  13045. var d = a.lang.bidi;
  13046. f("BidiLtr", d.ltr, "bidiltr", p("ltr"), 10);
  13047. f("BidiRtl", d.rtl, "bidirtl", p("rtl"), 20);
  13048. a.on("contentDom", function() {
  13049. a.document.on("dirChanged", function(b) {
  13050. a.fire("dirChanged", {
  13051. node: b.data,
  13052. dir: b.data.getDirection(1)
  13053. })
  13054. })
  13055. });
  13056. a.on("contentDirChanged", function(b) {
  13057. b = (a.lang.dir != b.data ? "add" : "remove") + "Class";
  13058. var c = a.ui.space(a.config.toolbarLocation);
  13059. if (c) c[b]("cke_mixed_dir_content")
  13060. })
  13061. }
  13062. }
  13063. });
  13064. 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)
  13065. })();
  13066. (function() {
  13067. var m = {
  13068. exec: function(g) {
  13069. var a = g.getCommand("blockquote").state,
  13070. k = g.getSelection(),
  13071. c = k && k.getRanges()[0];
  13072. if (c) {
  13073. var h = k.createBookmarks();
  13074. if (CKEDITOR.env.ie) {
  13075. var e = h[0].startNode,
  13076. b = h[0].endNode,
  13077. d;
  13078. if (e && "blockquote" == e.getParent().getName())
  13079. for (d = e; d = d.getNext();)
  13080. if (d.type == CKEDITOR.NODE_ELEMENT && d.isBlockBoundary()) {
  13081. e.move(d, !0);
  13082. break
  13083. } if (b && "blockquote" == b.getParent().getName())
  13084. for (d = b; d = d.getPrevious();)
  13085. if (d.type == CKEDITOR.NODE_ELEMENT && d.isBlockBoundary()) {
  13086. b.move(d);
  13087. break
  13088. }
  13089. }
  13090. var f = c.createIterator();
  13091. f.enlargeBr = g.config.enterMode != CKEDITOR.ENTER_BR;
  13092. if (a == CKEDITOR.TRISTATE_OFF) {
  13093. for (e = []; a = f.getNextParagraph();) e.push(a);
  13094. 1 > e.length && (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));
  13095. d = e[0].getParent();
  13096. c = [];
  13097. for (b = 0; b < e.length; b++) a = e[b], d = d.getCommonAncestor(a.getParent());
  13098. for (a = {
  13099. table: 1,
  13100. tbody: 1,
  13101. tr: 1,
  13102. ol: 1,
  13103. ul: 1
  13104. }; a[d.getName()];) d = d.getParent();
  13105. for (b = null; 0 < e.length;) {
  13106. for (a = e.shift(); !a.getParent().equals(d);) a = a.getParent();
  13107. a.equals(b) || c.push(a);
  13108. b = a
  13109. }
  13110. for (; 0 < c.length;)
  13111. if (a = c.shift(), "blockquote" == a.getName()) {
  13112. for (b = new CKEDITOR.dom.documentFragment(g.document); a.getFirst();) b.append(a.getFirst().remove()), e.push(b.getLast());
  13113. b.replace(a)
  13114. } else e.push(a);
  13115. c = g.document.createElement("blockquote");
  13116. for (c.insertBefore(e[0]); 0 < e.length;) a = e.shift(), c.append(a)
  13117. } else if (a == CKEDITOR.TRISTATE_ON) {
  13118. b = [];
  13119. for (d = {}; a = f.getNextParagraph();) {
  13120. for (e = c = null; a.getParent();) {
  13121. if ("blockquote" == a.getParent().getName()) {
  13122. c = a.getParent();
  13123. e = a;
  13124. break
  13125. }
  13126. a = a.getParent()
  13127. }
  13128. c && e && !e.getCustomData("blockquote_moveout") && (b.push(e), CKEDITOR.dom.element.setMarker(d, e, "blockquote_moveout", !0))
  13129. }
  13130. CKEDITOR.dom.element.clearAllMarkers(d);
  13131. a = [];
  13132. e = [];
  13133. for (d = {}; 0 < b.length;) 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") ||
  13134. (e.push(c), CKEDITOR.dom.element.setMarker(d, c, "blockquote_processed", !0)), a.push(f);
  13135. CKEDITOR.dom.element.clearAllMarkers(d);
  13136. for (b = e.length - 1; 0 <= b; b--) {
  13137. c = e[b];
  13138. a: {
  13139. d = c;
  13140. for (var f = 0, m = d.getChildCount(), l = void 0; f < m && (l = d.getChild(f)); f++)
  13141. if (l.type == CKEDITOR.NODE_ELEMENT && l.isBlockBoundary()) {
  13142. d = !1;
  13143. break a
  13144. } d = !0
  13145. }
  13146. d && c.remove()
  13147. }
  13148. if (g.config.enterMode == CKEDITOR.ENTER_BR)
  13149. for (c = !0; a.length;)
  13150. if (f = a.shift(), "div" == f.getName()) {
  13151. b = new CKEDITOR.dom.documentFragment(g.document);
  13152. !c || !f.getPrevious() || f.getPrevious().type ==
  13153. CKEDITOR.NODE_ELEMENT && f.getPrevious().isBlockBoundary() || b.append(g.document.createElement("br"));
  13154. for (c = f.getNext() && !(f.getNext().type == CKEDITOR.NODE_ELEMENT && f.getNext().isBlockBoundary()); f.getFirst();) f.getFirst().remove().appendTo(b);
  13155. c && b.append(g.document.createElement("br"));
  13156. b.replace(f);
  13157. c = !1
  13158. }
  13159. }
  13160. k.selectBookmarks(h);
  13161. g.focus()
  13162. }
  13163. },
  13164. refresh: function(g, a) {
  13165. this.setState(g.elementPath(a.block || a.blockLimit).contains("blockquote", 1) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF)
  13166. },
  13167. context: "blockquote",
  13168. allowedContent: "blockquote",
  13169. requiredContent: "blockquote"
  13170. };
  13171. CKEDITOR.plugins.add("blockquote", {
  13172. init: function(g) {
  13173. g.blockless || (g.addCommand("blockquote", m), g.ui.addButton && g.ui.addButton("Blockquote", {
  13174. label: g.lang.blockquote.toolbar,
  13175. command: "blockquote",
  13176. toolbar: "blocks,10"
  13177. }))
  13178. }
  13179. })
  13180. })();
  13181. (function() {
  13182. function q(b, a) {
  13183. CKEDITOR.tools.extend(this, a, {
  13184. editor: b,
  13185. id: "cke-" + CKEDITOR.tools.getUniqueId(),
  13186. area: b._.notificationArea
  13187. });
  13188. a.type || (this.type = "info");
  13189. this.element = this._createElement();
  13190. b.plugins.clipboard && CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(this.element)
  13191. }
  13192. function r(b) {
  13193. var a = this;
  13194. this.editor = b;
  13195. this.notifications = [];
  13196. this.element = this._createElement();
  13197. this._uiBuffer = CKEDITOR.tools.eventsBuffer(10, this._layout, this);
  13198. this._changeBuffer = CKEDITOR.tools.eventsBuffer(500, this._layout,
  13199. this);
  13200. b.on("destroy", function() {
  13201. a._removeListeners();
  13202. a.element.remove()
  13203. })
  13204. }
  13205. CKEDITOR.plugins.add("notification", {
  13206. init: function(b) {
  13207. function a(b) {
  13208. var a = new CKEDITOR.dom.element("div");
  13209. a.setStyles({
  13210. position: "fixed",
  13211. "margin-left": "-9999px"
  13212. });
  13213. a.setAttributes({
  13214. "aria-live": "assertive",
  13215. "aria-atomic": "true"
  13216. });
  13217. a.setText(b);
  13218. CKEDITOR.document.getBody().append(a);
  13219. setTimeout(function() {
  13220. a.remove()
  13221. }, 100)
  13222. }
  13223. b._.notificationArea = new r(b);
  13224. b.showNotification = function(a, d, e) {
  13225. var f, l;
  13226. "progress" == d ? f = e : l = e;
  13227. a = new CKEDITOR.plugins.notification(b, {
  13228. message: a,
  13229. type: d,
  13230. progress: f,
  13231. duration: l
  13232. });
  13233. a.show();
  13234. return a
  13235. };
  13236. b.on("key", function(c) {
  13237. if (27 == c.data.keyCode) {
  13238. var d = b._.notificationArea.notifications;
  13239. d.length && (a(b.lang.notification.closed), d[d.length - 1].hide(), c.cancel())
  13240. }
  13241. })
  13242. }
  13243. });
  13244. q.prototype = {
  13245. show: function() {
  13246. !1 !== this.editor.fire("notificationShow", {
  13247. notification: this
  13248. }) && (this.area.add(this), this._hideAfterTimeout())
  13249. },
  13250. update: function(b) {
  13251. var a = !0;
  13252. !1 === this.editor.fire("notificationUpdate", {
  13253. notification: this,
  13254. options: b
  13255. }) && (a = !1);
  13256. var c = this.element,
  13257. d = c.findOne(".cke_notification_message"),
  13258. e = c.findOne(".cke_notification_progress"),
  13259. f = b.type;
  13260. c.removeAttribute("role");
  13261. b.progress && "progress" != this.type && (f = "progress");
  13262. f && (c.removeClass(this._getClass()), c.removeAttribute("aria-label"), this.type = f, c.addClass(this._getClass()), c.setAttribute("aria-label", this.type), "progress" != this.type || e ? "progress" != this.type && e && e.remove() : (e = this._createProgressElement(), e.insertBefore(d)));
  13263. void 0 !== b.message && (this.message = b.message, d.setHtml(this.message));
  13264. void 0 !== b.progress && (this.progress = b.progress,
  13265. e && e.setStyle("width", this._getPercentageProgress()));
  13266. a && b.important && (c.setAttribute("role", "alert"), this.isVisible() || this.area.add(this));
  13267. this.duration = b.duration;
  13268. this._hideAfterTimeout()
  13269. },
  13270. hide: function() {
  13271. !1 !== this.editor.fire("notificationHide", {
  13272. notification: this
  13273. }) && this.area.remove(this)
  13274. },
  13275. isVisible: function() {
  13276. return 0 <= CKEDITOR.tools.indexOf(this.area.notifications, this)
  13277. },
  13278. _createElement: function() {
  13279. var b = this,
  13280. a, c, d = this.editor.lang.common.close;
  13281. a = new CKEDITOR.dom.element("div");
  13282. a.addClass("cke_notification");
  13283. a.addClass(this._getClass());
  13284. a.setAttributes({
  13285. id: this.id,
  13286. role: "alert",
  13287. "aria-label": this.type
  13288. });
  13289. "progress" == this.type && a.append(this._createProgressElement());
  13290. c = new CKEDITOR.dom.element("p");
  13291. c.addClass("cke_notification_message");
  13292. c.setHtml(this.message);
  13293. a.append(c);
  13294. 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');
  13295. a.append(c);
  13296. c.on("click",
  13297. function() {
  13298. b.editor.focus();
  13299. b.hide()
  13300. });
  13301. return a
  13302. },
  13303. _getClass: function() {
  13304. return "progress" == this.type ? "cke_notification_info" : "cke_notification_" + this.type
  13305. },
  13306. _createProgressElement: function() {
  13307. var b = new CKEDITOR.dom.element("span");
  13308. b.addClass("cke_notification_progress");
  13309. b.setStyle("width", this._getPercentageProgress());
  13310. return b
  13311. },
  13312. _getPercentageProgress: function() {
  13313. return Math.round(100 * (this.progress || 0)) + "%"
  13314. },
  13315. _hideAfterTimeout: function() {
  13316. var b = this,
  13317. a;
  13318. this._hideTimeoutId && clearTimeout(this._hideTimeoutId);
  13319. if ("number" == typeof this.duration) a = this.duration;
  13320. else if ("info" == this.type || "success" == this.type) a = "number" == typeof this.editor.config.notification_duration ? this.editor.config.notification_duration : 5E3;
  13321. a && (b._hideTimeoutId = setTimeout(function() {
  13322. b.hide()
  13323. }, a))
  13324. }
  13325. };
  13326. r.prototype = {
  13327. add: function(b) {
  13328. this.notifications.push(b);
  13329. this.element.append(b.element);
  13330. 1 == this.element.getChildCount() && (CKEDITOR.document.getBody().append(this.element), this._attachListeners());
  13331. this._layout()
  13332. },
  13333. remove: function(b) {
  13334. var a = CKEDITOR.tools.indexOf(this.notifications,
  13335. b);
  13336. 0 > a || (this.notifications.splice(a, 1), b.element.remove(), this.element.getChildCount() || (this._removeListeners(), this.element.remove()))
  13337. },
  13338. _createElement: function() {
  13339. var b = this.editor,
  13340. a = b.config,
  13341. c = new CKEDITOR.dom.element("div");
  13342. c.addClass("cke_notifications_area");
  13343. c.setAttribute("id", "cke_notifications_area_" + b.name);
  13344. c.setStyle("z-index", a.baseFloatZIndex - 2);
  13345. return c
  13346. },
  13347. _attachListeners: function() {
  13348. var b = CKEDITOR.document.getWindow(),
  13349. a = this.editor;
  13350. b.on("scroll", this._uiBuffer.input);
  13351. b.on("resize", this._uiBuffer.input);
  13352. a.on("change", this._changeBuffer.input);
  13353. a.on("floatingSpaceLayout", this._layout, this, null, 20);
  13354. a.on("blur", this._layout, this, null, 20)
  13355. },
  13356. _removeListeners: function() {
  13357. var b = CKEDITOR.document.getWindow(),
  13358. a = this.editor;
  13359. b.removeListener("scroll", this._uiBuffer.input);
  13360. b.removeListener("resize", this._uiBuffer.input);
  13361. a.removeListener("change", this._changeBuffer.input);
  13362. a.removeListener("floatingSpaceLayout", this._layout);
  13363. a.removeListener("blur", this._layout)
  13364. },
  13365. _layout: function() {
  13366. function b() {
  13367. a.setStyle("left",
  13368. k(n + d.width - g - h))
  13369. }
  13370. var a = this.element,
  13371. c = this.editor,
  13372. d = c.ui.contentsElement.getClientRect(),
  13373. e = c.ui.contentsElement.getDocumentPosition(),
  13374. f, l, u = a.getClientRect(),
  13375. m, g = this._notificationWidth,
  13376. h = this._notificationMargin;
  13377. m = CKEDITOR.document.getWindow();
  13378. var p = m.getScrollPosition(),
  13379. t = m.getViewPaneSize(),
  13380. q = CKEDITOR.document.getBody(),
  13381. r = q.getDocumentPosition(),
  13382. k = CKEDITOR.tools.cssLength;
  13383. g && h || (m = this.element.getChild(0), g = this._notificationWidth = m.getClientRect().width, h = this._notificationMargin = parseInt(m.getComputedStyle("margin-left"),
  13384. 10) + parseInt(m.getComputedStyle("margin-right"), 10));
  13385. c.toolbar && (f = c.ui.space("top"), l = f.getClientRect());
  13386. f && f.isVisible() && l.bottom > d.top && l.bottom < d.bottom - u.height ? a.setStyles({
  13387. position: "fixed",
  13388. top: k(l.bottom)
  13389. }) : 0 < d.top ? a.setStyles({
  13390. position: "absolute",
  13391. top: k(e.y)
  13392. }) : e.y + d.height - u.height > p.y ? a.setStyles({
  13393. position: "fixed",
  13394. top: 0
  13395. }) : a.setStyles({
  13396. position: "absolute",
  13397. top: k(e.y + d.height - u.height)
  13398. });
  13399. var n = "fixed" == a.getStyle("position") ? d.left : "static" != q.getComputedStyle("position") ? e.x - r.x : e.x;
  13400. d.width <
  13401. 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)) : 0 > d.left + d.width - g - h ? b() : 0 > d.left + d.width / 2 - g / 2 ? a.setStyle("left", k(n - e.x + p.x)) : a.setStyle("left", k(n + d.width / 2 - g / 2 - h / 2))
  13402. }
  13403. };
  13404. CKEDITOR.plugins.notification = q
  13405. })();
  13406. (function() {
  13407. 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}"';
  13408. CKEDITOR.env.gecko && CKEDITOR.env.mac && (c += ' onkeypress\x3d"return false;"');
  13409. CKEDITOR.env.gecko && (c +=
  13410. ' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');
  13411. var c = c + (' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" ' + (CKEDITOR.env.ie ? 'onclick\x3d"return false;" onmouseup' : "onclick") + '\x3d"CKEDITOR.tools.callFunction({clickFn},this);return false;"\x3e\x3cspan class\x3d"cke_button_icon cke_button__{iconName}_icon" style\x3d"{style}"'),
  13412. c = c + '\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',
  13413. v = CKEDITOR.addTemplate("buttonArrow", '\x3cspan class\x3d"cke_button_arrow"\x3e' + (CKEDITOR.env.hc ? "\x26#9660;" : "") + "\x3c/span\x3e"),
  13414. w = CKEDITOR.addTemplate("button", c);
  13415. CKEDITOR.plugins.add("button", {
  13416. beforeInit: function(a) {
  13417. a.ui.addHandler(CKEDITOR.UI_BUTTON, CKEDITOR.ui.button.handler)
  13418. }
  13419. });
  13420. CKEDITOR.UI_BUTTON = "button";
  13421. CKEDITOR.ui.button = function(a) {
  13422. CKEDITOR.tools.extend(this, a, {
  13423. title: a.label,
  13424. click: a.click || function(b) {
  13425. b.execCommand(a.command)
  13426. }
  13427. });
  13428. this._ = {}
  13429. };
  13430. CKEDITOR.ui.button.handler = {
  13431. create: function(a) {
  13432. return new CKEDITOR.ui.button(a)
  13433. }
  13434. };
  13435. CKEDITOR.ui.button.prototype = {
  13436. render: function(a, b) {
  13437. function c() {
  13438. var f = a.mode;
  13439. f && (f = this.modes[f] ? void 0 !== n[f] ? n[f] : CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, f = a.readOnly && !this.readOnly ? CKEDITOR.TRISTATE_DISABLED : f, this.setState(f), this.refresh && this.refresh())
  13440. }
  13441. var n = null,
  13442. p = CKEDITOR.env,
  13443. q = this._.id = CKEDITOR.tools.getNextId(),
  13444. g = "",
  13445. d = this.command,
  13446. t, k, l;
  13447. this._.editor = a;
  13448. var e = {
  13449. id: q,
  13450. button: this,
  13451. editor: a,
  13452. focus: function() {
  13453. CKEDITOR.document.getById(q).focus()
  13454. },
  13455. execute: function() {
  13456. this.button.click(a)
  13457. },
  13458. attach: function(a) {
  13459. this.button.attach(a)
  13460. }
  13461. },
  13462. x = CKEDITOR.tools.addFunction(function(a) {
  13463. if (e.onkey) return a = new CKEDITOR.dom.event(a), !1 !== e.onkey(e, a.getKeystroke())
  13464. }),
  13465. y = CKEDITOR.tools.addFunction(function(a) {
  13466. var b;
  13467. e.onfocus && (b = !1 !== e.onfocus(e, new CKEDITOR.dom.event(a)));
  13468. return b
  13469. }),
  13470. u = 0;
  13471. e.clickFn = t = CKEDITOR.tools.addFunction(function() {
  13472. u && (a.unlockSelection(1), u = 0);
  13473. e.execute();
  13474. p.iOS && a.focus()
  13475. });
  13476. this.modes ? (n = {}, a.on("beforeModeUnload", function() {
  13477. a.mode && this._.state != CKEDITOR.TRISTATE_DISABLED && (n[a.mode] =
  13478. this._.state)
  13479. }, 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() {
  13480. this.setState(d.state)
  13481. }, this), g += d.state == CKEDITOR.TRISTATE_ON ? "on" : d.state == CKEDITOR.TRISTATE_DISABLED ? "disabled" : "off");
  13482. var m;
  13483. if (this.directional) a.on("contentDirChanged", function(b) {
  13484. var c = CKEDITOR.document.getById(this._.id),
  13485. d = c.getFirst();
  13486. b = b.data;
  13487. b != a.lang.dir ? c.addClass("cke_" + b) : c.removeClass("cke_ltr").removeClass("cke_rtl");
  13488. d.setAttribute("style",
  13489. CKEDITOR.skin.getIconStyle(m, "rtl" == b, this.icon, this.iconOffset))
  13490. }, this);
  13491. d ? (k = a.getCommandKeystroke(d)) && (l = CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard, k)) : g += "off";
  13492. k = this.name || this.command;
  13493. var h = null,
  13494. r = this.icon;
  13495. m = k;
  13496. this.icon && !/\./.test(this.icon) ? (m = this.icon, r = null) : (this.icon && (h = this.icon), CKEDITOR.env.hidpi && this.iconHiDpi && (h = this.iconHiDpi));
  13497. h ? (CKEDITOR.skin.addIcon(h, h), r = null) : h = m;
  13498. g = {
  13499. id: q,
  13500. name: k,
  13501. iconName: m,
  13502. label: this.label,
  13503. cls: this.className || "",
  13504. state: g,
  13505. ariaDisabled: "disabled" ==
  13506. g ? "true" : "false",
  13507. title: this.title + (l ? " (" + l.display + ")" : ""),
  13508. ariaShortcut: l ? a.lang.common.keyboardShortcut + " " + l.aria : "",
  13509. titleJs: p.gecko && !p.hc ? "" : (this.title || "").replace("'", ""),
  13510. hasArrow: this.hasArrow ? "true" : "false",
  13511. keydownFn: x,
  13512. focusFn: y,
  13513. clickFn: t,
  13514. style: CKEDITOR.skin.getIconStyle(h, "rtl" == a.lang.dir, r, this.iconOffset),
  13515. arrowHtml: this.hasArrow ? v.output() : ""
  13516. };
  13517. w.output(g, b);
  13518. if (this.onRender) this.onRender();
  13519. return e
  13520. },
  13521. setState: function(a) {
  13522. if (this._.state == a) return !1;
  13523. this._.state = a;
  13524. var b = CKEDITOR.document.getById(this._.id);
  13525. return b ? (b.setState(a, "cke_button"), a == CKEDITOR.TRISTATE_DISABLED ? b.setAttribute("aria-disabled", !0) : b.removeAttribute("aria-disabled"), this.hasArrow ? (a = a == CKEDITOR.TRISTATE_ON ? this._.editor.lang.button.selectedLabel.replace(/%1/g, this.label) : this.label, CKEDITOR.document.getById(this._.id + "_label").setText(a)) : a == CKEDITOR.TRISTATE_ON ? b.setAttribute("aria-pressed", !0) : b.removeAttribute("aria-pressed"), !0) : !1
  13526. },
  13527. getState: function() {
  13528. return this._.state
  13529. },
  13530. toFeature: function(a) {
  13531. if (this._.feature) return this._.feature;
  13532. var b = this;
  13533. this.allowedContent || this.requiredContent || !this.command || (b = a.getCommand(this.command) || b);
  13534. return this._.feature = b
  13535. }
  13536. };
  13537. CKEDITOR.ui.prototype.addButton = function(a, b) {
  13538. this.add(a, CKEDITOR.UI_BUTTON, b)
  13539. }
  13540. })();
  13541. (function() {
  13542. function D(a) {
  13543. function d() {
  13544. for (var b = f(), e = CKEDITOR.tools.clone(a.config.toolbarGroups) || v(a), n = 0; n < e.length; n++) {
  13545. var g = e[n];
  13546. if ("/" != g) {
  13547. "string" == typeof g && (g = e[n] = {
  13548. name: g
  13549. });
  13550. var l, d = g.groups;
  13551. if (d)
  13552. for (var h = 0; h < d.length; h++) l = d[h], (l = b[l]) && c(g, l);
  13553. (l = b[g.name]) && c(g, l)
  13554. }
  13555. }
  13556. return e
  13557. }
  13558. function f() {
  13559. var b = {},
  13560. c, e, g;
  13561. 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({
  13562. name: c,
  13563. order: g
  13564. });
  13565. for (e in b) b[e] = b[e].sort(function(b,
  13566. a) {
  13567. return b.order == a.order ? 0 : 0 > a.order ? -1 : 0 > b.order ? 1 : b.order < a.order ? -1 : 1
  13568. });
  13569. return b
  13570. }
  13571. function c(c, e) {
  13572. if (e.length) {
  13573. c.items ? c.items.push(a.ui.create("-")) : c.items = [];
  13574. for (var d; d = e.shift();) d = "string" == typeof d ? d : d.name, b && -1 != CKEDITOR.tools.indexOf(b, d) || (d = a.ui.create(d)) && a.addFeature(d) && c.items.push(d)
  13575. }
  13576. }
  13577. function h(b) {
  13578. var a = [],
  13579. e, d, h;
  13580. 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)),
  13581. h.name = d.name, a.push(h));
  13582. return a
  13583. }
  13584. var b = a.config.removeButtons,
  13585. b = b && b.split(","),
  13586. e = a.config.toolbar;
  13587. "string" == typeof e && (e = a.config["toolbar_" + e]);
  13588. return a.toolbar = e ? h(e) : d()
  13589. }
  13590. function v(a) {
  13591. return a._.toolbarGroups || (a._.toolbarGroups = [{
  13592. name: "document",
  13593. groups: ["mode", "document", "doctools"]
  13594. }, {
  13595. name: "clipboard",
  13596. groups: ["clipboard", "undo"]
  13597. }, {
  13598. name: "editing",
  13599. groups: ["find", "selection", "spellchecker"]
  13600. }, {
  13601. name: "forms"
  13602. }, "/", {
  13603. name: "basicstyles",
  13604. groups: ["basicstyles", "cleanup"]
  13605. }, {
  13606. name: "paragraph",
  13607. groups: ["list",
  13608. "indent", "blocks", "align", "bidi"
  13609. ]
  13610. }, {
  13611. name: "links"
  13612. }, {
  13613. name: "insert"
  13614. }, "/", {
  13615. name: "styles"
  13616. }, {
  13617. name: "colors"
  13618. }, {
  13619. name: "tools"
  13620. }, {
  13621. name: "others"
  13622. }, {
  13623. name: "about"
  13624. }])
  13625. }
  13626. var z = function() {
  13627. this.toolbars = [];
  13628. this.focusCommandExecuted = !1
  13629. };
  13630. z.prototype.focus = function() {
  13631. for (var a = 0, d; d = this.toolbars[a++];)
  13632. for (var f = 0, c; c = d.items[f++];)
  13633. if (c.focus) {
  13634. c.focus();
  13635. return
  13636. }
  13637. };
  13638. var E = {
  13639. modes: {
  13640. wysiwyg: 1,
  13641. source: 1
  13642. },
  13643. readOnly: 1,
  13644. exec: function(a) {
  13645. a.toolbox && (a.toolbox.focusCommandExecuted = !0, CKEDITOR.env.ie || CKEDITOR.env.air ? setTimeout(function() {
  13646. a.toolbox.focus()
  13647. },
  13648. 100) : a.toolbox.focus())
  13649. }
  13650. };
  13651. CKEDITOR.plugins.add("toolbar", {
  13652. requires: "button",
  13653. init: function(a) {
  13654. var d, f = function(c, h) {
  13655. var b, e = "rtl" == a.lang.dir,
  13656. k = a.config.toolbarGroupCycling,
  13657. q = e ? 37 : 39,
  13658. e = e ? 39 : 37,
  13659. k = void 0 === k || k;
  13660. switch (h) {
  13661. case 9:
  13662. case CKEDITOR.SHIFT + 9:
  13663. for (; !b || !b.items.length;)
  13664. if (b = 9 == h ? (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)
  13665. for (c = b.items[d ? b.items.length - 1 : 0]; c && !c.focus;)(c = d ? c.previous : c.next) ||
  13666. (b = 0);
  13667. c && c.focus();
  13668. return !1;
  13669. case q:
  13670. b = c;
  13671. do b = b.next, !b && k && (b = c.toolbar.items[0]); while (b && !b.focus);
  13672. b ? b.focus() : f(c, 9);
  13673. return !1;
  13674. case 40:
  13675. return c.button && c.button.hasArrow ? c.execute() : f(c, 40 == h ? q : e), !1;
  13676. case e:
  13677. case 38:
  13678. b = c;
  13679. do b = b.previous, !b && k && (b = c.toolbar.items[c.toolbar.items.length - 1]); while (b && !b.focus);
  13680. b ? b.focus() : (d = 1, f(c, CKEDITOR.SHIFT + 9), d = 0);
  13681. return !1;
  13682. case 27:
  13683. return a.focus(), !1;
  13684. case 13:
  13685. case 32:
  13686. return c.execute(), !1
  13687. }
  13688. return !0
  13689. };
  13690. a.on("uiSpace", function(c) {
  13691. if (c.data.space == a.config.toolbarLocation) {
  13692. c.removeListener();
  13693. a.toolbox = new z;
  13694. var d = CKEDITOR.tools.getNextId(),
  13695. 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'],
  13696. d = !1 !== a.config.toolbarStartupExpanded,
  13697. e, k;
  13698. a.config.toolbarCanCollapse && a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE && b.push('\x3cspan class\x3d"cke_toolbox_main"' + (d ? "\x3e" : ' style\x3d"display:none"\x3e'));
  13699. for (var q = a.toolbox.toolbars, n = D(a), g = n.length, l = 0; l < g; l++) {
  13700. var r, m = 0,
  13701. w, p = n[l],
  13702. v = "/" !== p && ("/" === n[l + 1] || l == g - 1),
  13703. x;
  13704. if (p)
  13705. if (e && (b.push("\x3c/span\x3e"), k = e = 0), "/" === p) b.push('\x3cspan class\x3d"cke_toolbar_break"\x3e\x3c/span\x3e');
  13706. else {
  13707. x = p.items || p;
  13708. for (var y = 0; y < x.length; y++) {
  13709. var t = x[y],
  13710. A;
  13711. if (t) {
  13712. var B = function(c) {
  13713. c = c.render(a, b);
  13714. u = m.items.push(c) - 1;
  13715. 0 < u && (c.previous = m.items[u - 1], c.previous.next = c);
  13716. c.toolbar = m;
  13717. c.onkey = f;
  13718. c.onfocus = function() {
  13719. a.toolbox.focusCommandExecuted || a.focus()
  13720. }
  13721. };
  13722. if (t.type == CKEDITOR.UI_SEPARATOR) k =
  13723. e && t;
  13724. else {
  13725. A = !1 !== t.canGroup;
  13726. if (!m) {
  13727. r = CKEDITOR.tools.getNextId();
  13728. m = {
  13729. id: r,
  13730. items: []
  13731. };
  13732. w = p.name && (a.lang.toolbar.toolbarGroups[p.name] || p.name);
  13733. b.push('\x3cspan id\x3d"', r, '" class\x3d"cke_toolbar' + (v ? ' cke_toolbar_last"' : '"'), w ? ' aria-labelledby\x3d"' + r + '_label"' : "", ' role\x3d"toolbar"\x3e');
  13734. w && b.push('\x3cspan id\x3d"', r, '_label" class\x3d"cke_voice_label"\x3e', w, "\x3c/span\x3e");
  13735. b.push('\x3cspan class\x3d"cke_toolbar_start"\x3e\x3c/span\x3e');
  13736. var u = q.push(m) - 1;
  13737. 0 < u && (m.previous = q[u - 1], m.previous.next =
  13738. m)
  13739. }
  13740. A ? e || (b.push('\x3cspan class\x3d"cke_toolgroup" role\x3d"presentation"\x3e'), e = 1) : e && (b.push("\x3c/span\x3e"), e = 0);
  13741. k && (B(k), k = 0);
  13742. B(t)
  13743. }
  13744. }
  13745. }
  13746. e && (b.push("\x3c/span\x3e"), k = e = 0);
  13747. m && b.push('\x3cspan class\x3d"cke_toolbar_end"\x3e\x3c/span\x3e\x3c/span\x3e')
  13748. }
  13749. }
  13750. a.config.toolbarCanCollapse && b.push("\x3c/span\x3e");
  13751. if (a.config.toolbarCanCollapse && a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
  13752. var C = CKEDITOR.tools.addFunction(function() {
  13753. a.execCommand("toolbarCollapse")
  13754. });
  13755. a.on("destroy", function() {
  13756. CKEDITOR.tools.removeFunction(C)
  13757. });
  13758. a.addCommand("toolbarCollapse", {
  13759. readOnly: 1,
  13760. exec: function(b) {
  13761. var a = b.ui.space("toolbar_collapser"),
  13762. c = a.getPrevious(),
  13763. d = b.ui.space("contents"),
  13764. e = c.getParent(),
  13765. h = parseInt(d.$.style.height, 10),
  13766. g = e.$.offsetHeight,
  13767. f = a.hasClass("cke_toolbox_collapser_min");
  13768. 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));
  13769. a.getFirst().setText(f ? "▲" : "◀");
  13770. d.setStyle("height",
  13771. h - (e.$.offsetHeight - g) + "px");
  13772. b.fire("resize", {
  13773. outerHeight: b.container.$.offsetHeight,
  13774. contentsHeight: d.$.offsetHeight,
  13775. outerWidth: b.container.$.offsetWidth
  13776. })
  13777. },
  13778. modes: {
  13779. wysiwyg: 1,
  13780. source: 1
  13781. }
  13782. });
  13783. a.setKeystroke(CKEDITOR.ALT + (CKEDITOR.env.ie || CKEDITOR.env.webkit ? 189 : 109), "toolbarCollapse");
  13784. 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');
  13785. d || b.push(" cke_toolbox_collapser_min");
  13786. b.push('" onclick\x3d"CKEDITOR.tools.callFunction(' + C + ')"\x3e', '\x3cspan class\x3d"cke_arrow"\x3e\x26#9650;\x3c/span\x3e', "\x3c/a\x3e")
  13787. }
  13788. b.push("\x3c/span\x3e");
  13789. c.data.html += b.join("")
  13790. }
  13791. });
  13792. a.on("destroy", function() {
  13793. if (this.toolbox) {
  13794. var a, d = 0,
  13795. b, e, f;
  13796. for (a = this.toolbox.toolbars; d < a.length; d++)
  13797. 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)
  13798. }
  13799. });
  13800. a.on("uiReady", function() {
  13801. var c = a.ui.space("toolbox");
  13802. c && a.focusManager.add(c,
  13803. 1)
  13804. });
  13805. a.addCommand("toolbarFocus", E);
  13806. a.setKeystroke(CKEDITOR.ALT + 121, "toolbarFocus");
  13807. a.ui.add("-", CKEDITOR.UI_SEPARATOR, {});
  13808. a.ui.addHandler(CKEDITOR.UI_SEPARATOR, {
  13809. create: function() {
  13810. return {
  13811. render: function(a, d) {
  13812. d.push('\x3cspan class\x3d"cke_toolbar_separator" role\x3d"separator"\x3e\x3c/span\x3e');
  13813. return {}
  13814. }
  13815. }
  13816. }
  13817. })
  13818. }
  13819. });
  13820. CKEDITOR.ui.prototype.addToolbarGroup = function(a, d, f) {
  13821. var c = v(this.editor),
  13822. h = 0 === d,
  13823. b = {
  13824. name: a
  13825. };
  13826. if (f) {
  13827. if (f = CKEDITOR.tools.search(c, function(a) {
  13828. return a.name == f
  13829. })) {
  13830. !f.groups && (f.groups = []);
  13831. if (d &&
  13832. (d = CKEDITOR.tools.indexOf(f.groups, d), 0 <= d)) {
  13833. f.groups.splice(d + 1, 0, a);
  13834. return
  13835. }
  13836. h ? f.groups.splice(0, 0, a) : f.groups.push(a);
  13837. return
  13838. }
  13839. d = null
  13840. }
  13841. d && (d = CKEDITOR.tools.indexOf(c, function(a) {
  13842. return a.name == d
  13843. }));
  13844. h ? c.splice(0, 0, a) : "number" == typeof d ? c.splice(d + 1, 0, b) : c.push(a)
  13845. }
  13846. })();
  13847. CKEDITOR.UI_SEPARATOR = "separator";
  13848. CKEDITOR.config.toolbarLocation = "top";
  13849. (function() {
  13850. function r(a, b, c) {
  13851. b.type || (b.type = "auto");
  13852. if (c && !1 === a.fire("beforePaste", b) || !b.dataValue && b.dataTransfer.isEmpty()) return !1;
  13853. b.dataValue || (b.dataValue = "");
  13854. if (CKEDITOR.env.gecko && "drop" == b.method && a.toolbox) a.once("afterPaste", function() {
  13855. a.toolbox.focus()
  13856. });
  13857. return a.fire("paste", b)
  13858. }
  13859. function x(a) {
  13860. function b() {
  13861. var b = a.editable();
  13862. if (CKEDITOR.plugins.clipboard.isCustomCopyCutSupported) {
  13863. var c = function(b) {
  13864. a.getSelection().isCollapsed() || (a.readOnly && "cut" == b.name || p.initPasteDataTransfer(b,
  13865. a), b.data.preventDefault())
  13866. };
  13867. b.on("copy", c);
  13868. b.on("cut", c);
  13869. b.on("cut", function() {
  13870. a.readOnly || a.extractSelectedHtml()
  13871. }, null, null, 999)
  13872. }
  13873. b.on(p.mainPasteEvent, function(a) {
  13874. "beforepaste" == p.mainPasteEvent && m || k(a)
  13875. });
  13876. "beforepaste" == p.mainPasteEvent && (b.on("paste", function(a) {
  13877. u || (g(), a.data.preventDefault(), k(a), e("paste"))
  13878. }), b.on("contextmenu", h, null, null, 0), b.on("beforepaste", function(a) {
  13879. !a.data || a.data.$.ctrlKey || a.data.$.shiftKey || h()
  13880. }, null, null, 0));
  13881. b.on("beforecut", function() {
  13882. !m && f(a)
  13883. });
  13884. var d;
  13885. b.attachListener(CKEDITOR.env.ie ?
  13886. b : a.document.getDocumentElement(), "mouseup",
  13887. function() {
  13888. d = setTimeout(function() {
  13889. t()
  13890. }, 0)
  13891. });
  13892. a.on("destroy", function() {
  13893. clearTimeout(d)
  13894. });
  13895. b.on("keyup", t)
  13896. }
  13897. function c(b) {
  13898. return {
  13899. type: b,
  13900. canUndo: "cut" == b,
  13901. startDisabled: !0,
  13902. fakeKeystroke: "cut" == b ? CKEDITOR.CTRL + 88 : CKEDITOR.CTRL + 67,
  13903. exec: function() {
  13904. "cut" == this.type && f();
  13905. var b;
  13906. var c = this.type;
  13907. if (CKEDITOR.env.ie) b = e(c);
  13908. else try {
  13909. b = a.document.$.execCommand(c, !1, null)
  13910. } catch (d) {
  13911. b = !1
  13912. }
  13913. b || a.showNotification(a.lang.clipboard[this.type + "Error"]);
  13914. return b
  13915. }
  13916. }
  13917. }
  13918. function d() {
  13919. return {
  13920. canUndo: !1,
  13921. async: !0,
  13922. fakeKeystroke: CKEDITOR.CTRL + 86,
  13923. exec: function(a, b) {
  13924. function c(b, h) {
  13925. h = "undefined" !== typeof h ? h : !0;
  13926. b ? (b.method = "paste", b.dataTransfer || (b.dataTransfer = p.initPasteDataTransfer()), r(a, b, h)) : e && !a._.forcePasteDialog && a.showNotification(n, "info", a.config.clipboard_notificationDuration);
  13927. a._.forcePasteDialog = !1;
  13928. a.fire("afterCommandExec", {
  13929. name: "paste",
  13930. command: d,
  13931. returnValue: !!b
  13932. })
  13933. }
  13934. b = "undefined" !== typeof b && null !== b ? b : {};
  13935. var d = this,
  13936. e = "undefined" !== typeof b.notification ? b.notification : !0,
  13937. h = b.type,
  13938. f = CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard,
  13939. a.getCommandKeystroke(this)),
  13940. n = "string" === typeof e ? e : a.lang.clipboard.pasteNotification.replace(/%1/, '\x3ckbd aria-label\x3d"' + f.aria + '"\x3e' + f.display + "\x3c/kbd\x3e"),
  13941. f = "string" === typeof b ? b : b.dataValue;
  13942. h && !0 !== a.config.forcePasteAsPlainText && "allow-word" !== a.config.forcePasteAsPlainText ? a._.nextPasteType = h : delete a._.nextPasteType;
  13943. "string" === typeof f ? c({
  13944. dataValue: f
  13945. }) : a.getClipboardData(c)
  13946. }
  13947. }
  13948. }
  13949. function g() {
  13950. u = 1;
  13951. setTimeout(function() {
  13952. u = 0
  13953. }, 100)
  13954. }
  13955. function h() {
  13956. m = 1;
  13957. setTimeout(function() {
  13958. m = 0
  13959. }, 10)
  13960. }
  13961. function e(b) {
  13962. var c =
  13963. a.document,
  13964. d = c.getBody(),
  13965. e = !1,
  13966. h = function() {
  13967. e = !0
  13968. };
  13969. d.on(b, h);
  13970. 7 < CKEDITOR.env.version ? c.$.execCommand(b) : c.$.selection.createRange().execCommand(b);
  13971. d.removeListener(b, h);
  13972. return e
  13973. }
  13974. function f() {
  13975. if (CKEDITOR.env.ie && !CKEDITOR.env.quirks) {
  13976. var b = a.getSelection(),
  13977. c, d, e;
  13978. 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() {
  13979. c.getParent() && (e.remove(), b.selectElement(c))
  13980. },
  13981. 0))
  13982. }
  13983. }
  13984. function l(b, c) {
  13985. var d = a.document,
  13986. e = a.editable(),
  13987. h = function(a) {
  13988. a.cancel()
  13989. },
  13990. f;
  13991. if (!d.getById("cke_pastebin")) {
  13992. var n = a.getSelection(),
  13993. g = n.createBookmarks();
  13994. CKEDITOR.env.ie && n.root.fire("selectionchange");
  13995. var k = new CKEDITOR.dom.element(!CKEDITOR.env.webkit && !e.is("body") || CKEDITOR.env.ie ? "div" : "body", d);
  13996. k.setAttributes({
  13997. id: "cke_pastebin",
  13998. "data-cke-temp": "1"
  13999. });
  14000. var l = 0,
  14001. d = d.getWindow();
  14002. CKEDITOR.env.webkit ? (e.append(k), k.addClass("cke_editable"), e.is("body") || (l = "static" != e.getComputedStyle("position") ?
  14003. e : CKEDITOR.dom.element.get(e.$.offsetParent), l = l.getDocumentPosition().y)) : e.getAscendant(CKEDITOR.env.ie ? "body" : "html", 1).append(k);
  14004. k.setStyles({
  14005. position: "absolute",
  14006. top: d.getScrollPosition().y - l + 10 + "px",
  14007. width: "1px",
  14008. height: Math.max(1, d.getViewPaneSize().height - 20) + "px",
  14009. overflow: "hidden",
  14010. margin: 0,
  14011. padding: 0
  14012. });
  14013. CKEDITOR.env.safari && k.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select", "text"));
  14014. (l = k.getParent().isReadOnly()) ? (k.setOpacity(0), k.setAttribute("contenteditable", !0)) : k.setStyle("ltr" == a.config.contentsLangDirection ?
  14015. "left" : "right", "-10000px");
  14016. a.on("selectionChange", h, null, null, 0);
  14017. if (CKEDITOR.env.webkit || CKEDITOR.env.gecko) f = e.once("blur", h, null, null, -100);
  14018. l && k.focus();
  14019. l = new CKEDITOR.dom.range(k);
  14020. l.selectNodeContents(k);
  14021. var t = l.select();
  14022. CKEDITOR.env.ie && (f = e.once("blur", function() {
  14023. a.lockSelection(t)
  14024. }));
  14025. var q = CKEDITOR.document.getWindow().getScrollPosition().y;
  14026. setTimeout(function() {
  14027. CKEDITOR.env.webkit && (CKEDITOR.document.getBody().$.scrollTop = q);
  14028. f && f.removeListener();
  14029. CKEDITOR.env.ie && e.focus();
  14030. n.selectBookmarks(g);
  14031. k.remove();
  14032. var b;
  14033. CKEDITOR.env.webkit && (b = k.getFirst()) && b.is && b.hasClass("Apple-style-span") && (k = b);
  14034. a.removeListener("selectionChange", h);
  14035. c(k.getHtml())
  14036. }, 0)
  14037. }
  14038. }
  14039. function y() {
  14040. if ("paste" == p.mainPasteEvent) return a.fire("beforePaste", {
  14041. type: "auto",
  14042. method: "paste"
  14043. }), !1;
  14044. a.focus();
  14045. g();
  14046. var b = a.focusManager;
  14047. b.lock();
  14048. if (a.editable().fire(p.mainPasteEvent) && !e("paste")) return b.unlock(), !1;
  14049. b.unlock();
  14050. return !0
  14051. }
  14052. function n(b) {
  14053. if ("wysiwyg" == a.mode) switch (b.data.keyCode) {
  14054. case CKEDITOR.CTRL + 86:
  14055. case CKEDITOR.SHIFT + 45:
  14056. b =
  14057. a.editable();
  14058. g();
  14059. "paste" == p.mainPasteEvent && b.fire("beforepaste");
  14060. break;
  14061. case CKEDITOR.CTRL + 88:
  14062. case CKEDITOR.SHIFT + 46:
  14063. a.fire("saveSnapshot"), setTimeout(function() {
  14064. a.fire("saveSnapshot")
  14065. }, 50)
  14066. }
  14067. }
  14068. function k(b) {
  14069. var c = {
  14070. type: "auto",
  14071. method: "paste",
  14072. dataTransfer: p.initPasteDataTransfer(b)
  14073. };
  14074. c.dataTransfer.cacheData();
  14075. var d = !1 !== a.fire("beforePaste", c);
  14076. d && p.canClipboardApiBeTrusted(c.dataTransfer, a) ? (b.data.preventDefault(), setTimeout(function() {
  14077. r(a, c)
  14078. }, 0)) : l(b, function(b) {
  14079. c.dataValue = b.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig,
  14080. "");
  14081. d && r(a, c)
  14082. })
  14083. }
  14084. function t() {
  14085. if ("wysiwyg" == a.mode) {
  14086. var b = q("paste");
  14087. a.getCommand("cut").setState(q("cut"));
  14088. a.getCommand("copy").setState(q("copy"));
  14089. a.getCommand("paste").setState(b);
  14090. a.fire("pasteState", b)
  14091. }
  14092. }
  14093. function q(b) {
  14094. if (v && b in {
  14095. paste: 1,
  14096. cut: 1
  14097. }) return CKEDITOR.TRISTATE_DISABLED;
  14098. if ("paste" == b) return CKEDITOR.TRISTATE_OFF;
  14099. b = a.getSelection();
  14100. var c = b.getRanges();
  14101. return b.getType() == CKEDITOR.SELECTION_NONE || 1 == c.length && c[0].collapsed ? CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_OFF
  14102. }
  14103. var p = CKEDITOR.plugins.clipboard,
  14104. m = 0,
  14105. u = 0,
  14106. v = 0;
  14107. (function() {
  14108. a.on("key", n);
  14109. a.on("contentDom", b);
  14110. a.on("selectionChange", function(a) {
  14111. v = a.data.selection.getRanges()[0].checkReadOnly();
  14112. t()
  14113. });
  14114. if (a.contextMenu) {
  14115. a.contextMenu.addListener(function(a, b) {
  14116. v = b.getRanges()[0].checkReadOnly();
  14117. return {
  14118. cut: q("cut"),
  14119. copy: q("copy"),
  14120. paste: q("paste")
  14121. }
  14122. });
  14123. var c = null;
  14124. a.on("menuShow", function() {
  14125. c && (c.removeListener(), c = null);
  14126. var b = a.contextMenu.findItemByCommandName("paste");
  14127. b && b.element && (c = b.element.on("touchend", function() {
  14128. a._.forcePasteDialog = !0
  14129. }))
  14130. })
  14131. }
  14132. if (a.ui.addButton) a.once("instanceReady",
  14133. function() {
  14134. a._.pasteButtons && CKEDITOR.tools.array.forEach(a._.pasteButtons, function(b) {
  14135. if (b = a.ui.get(b))
  14136. if (b = CKEDITOR.document.getById(b._.id)) b.on("touchend", function() {
  14137. a._.forcePasteDialog = !0
  14138. })
  14139. })
  14140. })
  14141. })();
  14142. (function() {
  14143. function b(c, d, e, h, f) {
  14144. var n = a.lang.clipboard[d];
  14145. a.addCommand(d, e);
  14146. a.ui.addButton && a.ui.addButton(c, {
  14147. label: n,
  14148. command: d,
  14149. toolbar: "clipboard," + h
  14150. });
  14151. a.addMenuItems && a.addMenuItem(d, {
  14152. label: n,
  14153. command: d,
  14154. group: "clipboard",
  14155. order: f
  14156. })
  14157. }
  14158. b("Cut", "cut", c("cut"), 10, 1);
  14159. b("Copy", "copy", c("copy"), 20, 4);
  14160. b("Paste",
  14161. "paste", d(), 30, 8);
  14162. a._.pasteButtons || (a._.pasteButtons = []);
  14163. a._.pasteButtons.push("Paste")
  14164. })();
  14165. a.getClipboardData = function(b, c) {
  14166. function d(a) {
  14167. a.removeListener();
  14168. a.cancel();
  14169. c(a.data)
  14170. }
  14171. function e(a) {
  14172. a.removeListener();
  14173. a.cancel();
  14174. c({
  14175. type: f,
  14176. dataValue: a.data.dataValue,
  14177. dataTransfer: a.data.dataTransfer,
  14178. method: "paste"
  14179. })
  14180. }
  14181. var h = !1,
  14182. f = "auto";
  14183. c || (c = b, b = null);
  14184. a.on("beforePaste", function(a) {
  14185. a.removeListener();
  14186. h = !0;
  14187. f = a.data.type
  14188. }, null, null, 1E3);
  14189. a.on("paste", d, null, null, 0);
  14190. !1 === y() && (a.removeListener("paste", d), a._.forcePasteDialog &&
  14191. h && a.fire("pasteDialog") ? (a.on("pasteDialogCommit", e), a.on("dialogHide", function(a) {
  14192. a.removeListener();
  14193. a.data.removeListener("pasteDialogCommit", e);
  14194. a.data._.committed || c(null)
  14195. })) : c(null))
  14196. }
  14197. }
  14198. function z(a) {
  14199. if (CKEDITOR.env.webkit) {
  14200. if (!a.match(/^[^<]*$/g) && !a.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi)) return "html"
  14201. } else if (CKEDITOR.env.ie) {
  14202. if (!a.match(/^([^<]|<br( ?\/)?>)*$/gi) && !a.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi)) return "html"
  14203. } else if (CKEDITOR.env.gecko) {
  14204. if (!a.match(/^([^<]|<br( ?\/)?>)*$/gi)) return "html"
  14205. } else return "html";
  14206. return "htmlifiedtext"
  14207. }
  14208. function A(a, b) {
  14209. function c(a) {
  14210. return CKEDITOR.tools.repeat("\x3c/p\x3e\x3cp\x3e", ~~(a / 2)) + (1 == a % 2 ? "\x3cbr\x3e" : "")
  14211. }
  14212. b = b.replace(/(?!\u3000)\s+/g, " ").replace(/> +</g, "\x3e\x3c").replace(/<br ?\/>/gi, "\x3cbr\x3e");
  14213. b = b.replace(/<\/?[A-Z]+>/g, function(a) {
  14214. return a.toLowerCase()
  14215. });
  14216. if (b.match(/^[^<]$/)) return b;
  14217. CKEDITOR.env.webkit && -1 < b.indexOf("\x3cdiv\x3e") && (b = b.replace(/^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g, "\x3cbr\x3e").replace(/^(<div>(<br>|)<\/div>){2}(?!$)/g, "\x3cdiv\x3e\x3c/div\x3e"),
  14218. b.match(/<div>(<br>|)<\/div>/) && (b = "\x3cp\x3e" + b.replace(/(<div>(<br>|)<\/div>)+/g, function(a) {
  14219. return c(a.split("\x3c/div\x3e\x3cdiv\x3e").length + 1)
  14220. }) + "\x3c/p\x3e"), b = b.replace(/<\/div><div>/g, "\x3cbr\x3e"), b = b.replace(/<\/?div>/g, ""));
  14221. CKEDITOR.env.gecko && a.enterMode != CKEDITOR.ENTER_BR && (CKEDITOR.env.gecko && (b = b.replace(/^<br><br>$/, "\x3cbr\x3e")), -1 < b.indexOf("\x3cbr\x3e\x3cbr\x3e") && (b = "\x3cp\x3e" + b.replace(/(<br>){2,}/g, function(a) {
  14222. return c(a.length / 4)
  14223. }) + "\x3c/p\x3e"));
  14224. return B(a, b)
  14225. }
  14226. function C() {
  14227. function a() {
  14228. var a = {},
  14229. b;
  14230. for (b in CKEDITOR.dtd) "$" != b.charAt(0) && "div" != b && "span" != b && (a[b] = 1);
  14231. return a
  14232. }
  14233. var b = {};
  14234. return {
  14235. get: function(c) {
  14236. return "plain-text" == c ? b.plainText || (b.plainText = new CKEDITOR.filter("br")) : "semantic-content" == c ? ((c = b.semanticContent) || (c = new CKEDITOR.filter, c.allow({
  14237. $1: {
  14238. elements: a(),
  14239. attributes: !0,
  14240. styles: !1,
  14241. classes: !1
  14242. }
  14243. }), c = b.semanticContent = c), c) : c ? new CKEDITOR.filter(c) : null
  14244. }
  14245. }
  14246. }
  14247. function w(a, b, c) {
  14248. b = CKEDITOR.htmlParser.fragment.fromHtml(b);
  14249. var d = new CKEDITOR.htmlParser.basicWriter;
  14250. c.applyTo(b, !0, !1,
  14251. a.activeEnterMode);
  14252. b.writeHtml(d);
  14253. return d.getHtml()
  14254. }
  14255. function B(a, b) {
  14256. a.enterMode == CKEDITOR.ENTER_BR ? b = b.replace(/(<\/p><p>)+/g, function(a) {
  14257. return CKEDITOR.tools.repeat("\x3cbr\x3e", a.length / 7 * 2)
  14258. }).replace(/<\/?p>/g, "") : a.enterMode == CKEDITOR.ENTER_DIV && (b = b.replace(/<(\/)?p>/g, "\x3c$1div\x3e"));
  14259. return b
  14260. }
  14261. function D(a) {
  14262. a.data.preventDefault();
  14263. a.data.$.dataTransfer.dropEffect = "none"
  14264. }
  14265. function E(a) {
  14266. var b = CKEDITOR.plugins.clipboard;
  14267. a.on("contentDom", function() {
  14268. function c(b, c, e) {
  14269. c.select();
  14270. r(a, {
  14271. dataTransfer: e,
  14272. method: "drop"
  14273. }, 1);
  14274. e.sourceEditor.fire("saveSnapshot");
  14275. e.sourceEditor.editable().extractHtmlFromRange(b);
  14276. e.sourceEditor.getSelection().selectRanges([b]);
  14277. e.sourceEditor.fire("saveSnapshot")
  14278. }
  14279. function d(c, e) {
  14280. c.select();
  14281. r(a, {
  14282. dataTransfer: e,
  14283. method: "drop"
  14284. }, 1);
  14285. b.resetDragDataTransfer()
  14286. }
  14287. function g(b, c, e) {
  14288. var d = {
  14289. $: b.data.$,
  14290. target: b.data.getTarget()
  14291. };
  14292. c && (d.dragRange = c);
  14293. e && (d.dropRange = e);
  14294. !1 === a.fire(b.name, d) && b.data.preventDefault()
  14295. }
  14296. function h(a) {
  14297. a.type != CKEDITOR.NODE_ELEMENT && (a = a.getParent());
  14298. return a.getChildCount()
  14299. }
  14300. var e = a.editable(),
  14301. f = CKEDITOR.plugins.clipboard.getDropTarget(a),
  14302. l = a.ui.space("top"),
  14303. m = a.ui.space("bottom");
  14304. b.preventDefaultDropOnElement(l);
  14305. b.preventDefaultDropOnElement(m);
  14306. e.attachListener(f, "dragstart", g);
  14307. e.attachListener(a, "dragstart", b.resetDragDataTransfer, b, null, 1);
  14308. e.attachListener(a, "dragstart", function(c) {
  14309. b.initDragDataTransfer(c, a)
  14310. }, null, null, 2);
  14311. e.attachListener(a, "dragstart", function() {
  14312. var c = b.dragRange = a.getSelection().getRanges()[0];
  14313. CKEDITOR.env.ie && 10 > CKEDITOR.env.version && (b.dragStartContainerChildCount =
  14314. c ? h(c.startContainer) : null, b.dragEndContainerChildCount = c ? h(c.endContainer) : null)
  14315. }, null, null, 100);
  14316. e.attachListener(f, "dragend", g);
  14317. e.attachListener(a, "dragend", b.initDragDataTransfer, b, null, 1);
  14318. e.attachListener(a, "dragend", b.resetDragDataTransfer, b, null, 100);
  14319. e.attachListener(f, "dragover", function(a) {
  14320. if (CKEDITOR.env.edge) a.data.preventDefault();
  14321. else {
  14322. var b = a.data.getTarget();
  14323. b && b.is && b.is("html") ? a.data.preventDefault() : CKEDITOR.env.ie && CKEDITOR.plugins.clipboard.isFileApiSupported && a.data.$.dataTransfer.types.contains("Files") &&
  14324. a.data.preventDefault()
  14325. }
  14326. });
  14327. e.attachListener(f, "drop", function(c) {
  14328. if (!c.data.$.defaultPrevented) {
  14329. c.data.preventDefault();
  14330. var e = c.data.getTarget();
  14331. if (!e.isReadOnly() || e.type == CKEDITOR.NODE_ELEMENT && e.is("html")) {
  14332. var e = b.getRangeAtDropPosition(c, a),
  14333. d = b.dragRange;
  14334. e && g(c, d, e)
  14335. }
  14336. }
  14337. }, null, null, 9999);
  14338. e.attachListener(a, "drop", b.initDragDataTransfer, b, null, 1);
  14339. e.attachListener(a, "drop", function(e) {
  14340. if (e = e.data) {
  14341. var h = e.dropRange,
  14342. f = e.dragRange,
  14343. g = e.dataTransfer;
  14344. g.getTransferType(a) == CKEDITOR.DATA_TRANSFER_INTERNAL ?
  14345. setTimeout(function() {
  14346. b.internalDrop(f, h, g, a)
  14347. }, 0) : g.getTransferType(a) == CKEDITOR.DATA_TRANSFER_CROSS_EDITORS ? c(f, h, g) : d(h, g)
  14348. }
  14349. }, null, null, 9999)
  14350. })
  14351. }
  14352. var m;
  14353. CKEDITOR.plugins.add("clipboard", {
  14354. requires: "dialog,notification,toolbar",
  14355. init: function(a) {
  14356. var b, c = C();
  14357. a.config.forcePasteAsPlainText ? b = "plain-text" : a.config.pasteFilter ? b = a.config.pasteFilter : !CKEDITOR.env.webkit || "pasteFilter" in a.config || (b = "semantic-content");
  14358. a.pasteFilter = c.get(b);
  14359. x(a);
  14360. E(a);
  14361. CKEDITOR.dialog.add("paste", CKEDITOR.getUrl(this.path +
  14362. "dialogs/paste.js"));
  14363. if (CKEDITOR.env.gecko) {
  14364. var d = ["image/png", "image/jpeg", "image/gif"],
  14365. g;
  14366. a.on("paste", function(b) {
  14367. var c = b.data,
  14368. f = c.dataTransfer;
  14369. if (!c.dataValue && "paste" == c.method && f && 1 == f.getFilesCount() && g != f.id && (f = f.getFile(0), -1 != CKEDITOR.tools.indexOf(d, f.type))) {
  14370. var l = new FileReader;
  14371. l.addEventListener("load", function() {
  14372. b.data.dataValue = '\x3cimg src\x3d"' + l.result + '" /\x3e';
  14373. a.fire("paste", b.data)
  14374. }, !1);
  14375. l.addEventListener("abort", function() {
  14376. a.fire("paste", b.data)
  14377. }, !1);
  14378. l.addEventListener("error",
  14379. function() {
  14380. a.fire("paste", b.data)
  14381. }, !1);
  14382. l.readAsDataURL(f);
  14383. g = c.dataTransfer.id;
  14384. b.stop()
  14385. }
  14386. }, null, null, 1)
  14387. }
  14388. a.on("paste", function(b) {
  14389. b.data.dataTransfer || (b.data.dataTransfer = new CKEDITOR.plugins.clipboard.dataTransfer);
  14390. if (!b.data.dataValue) {
  14391. var c = b.data.dataTransfer,
  14392. d = c.getData("text/html");
  14393. if (d) b.data.dataValue = d, b.data.type = "html";
  14394. else if (d = c.getData("text/plain")) b.data.dataValue = a.editable().transformPlainTextToHtml(d), b.data.type = "text"
  14395. }
  14396. }, null, null, 1);
  14397. a.on("paste", function(a) {
  14398. var b = a.data.dataValue,
  14399. c = CKEDITOR.dtd.$block; - 1 < b.indexOf("Apple-") && (b = b.replace(/<span class="Apple-converted-space">&nbsp;<\/span>/gi, " "), "html" != a.data.type && (b = b.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi, function(a, b) {
  14400. return b.replace(/\t/g, "\x26nbsp;\x26nbsp; \x26nbsp;")
  14401. })), -1 < b.indexOf('\x3cbr class\x3d"Apple-interchange-newline"\x3e') && (a.data.startsWithEOL = 1, a.data.preSniffing = "html", b = b.replace(/<br class="Apple-interchange-newline">/, "")), b = b.replace(/(<[^>]+) class="Apple-[^"]*"/gi, "$1"));
  14402. if (b.match(/^<[^<]+cke_(editable|contents)/i)) {
  14403. var d, g, n = new CKEDITOR.dom.element("div");
  14404. for (n.setHtml(b); 1 == n.getChildCount() && (d = n.getFirst()) && d.type == CKEDITOR.NODE_ELEMENT && (d.hasClass("cke_editable") || d.hasClass("cke_contents"));) n = g = d;
  14405. g && (b = g.getHtml().replace(/<br>$/i, ""))
  14406. }
  14407. CKEDITOR.env.ie ? b = b.replace(/^&nbsp;(?: |\r\n)?<(\w+)/g, function(b, d) {
  14408. return d.toLowerCase() in c ? (a.data.preSniffing = "html", "\x3c" + d) : b
  14409. }) : CKEDITOR.env.webkit ? b = b.replace(/<\/(\w+)><div><br><\/div>$/, function(b, d) {
  14410. return d in
  14411. c ? (a.data.endsWithEOL = 1, "\x3c/" + d + "\x3e") : b
  14412. }) : CKEDITOR.env.gecko && (b = b.replace(/(\s)<br>$/, "$1"));
  14413. a.data.dataValue = b
  14414. }, null, null, 3);
  14415. a.on("paste", function(b) {
  14416. b = b.data;
  14417. var d = a._.nextPasteType || b.type,
  14418. f = b.dataValue,
  14419. g, m = a.config.clipboard_defaultContentType || "html",
  14420. n = b.dataTransfer.getTransferType(a) == CKEDITOR.DATA_TRANSFER_EXTERNAL,
  14421. k = !0 === a.config.forcePasteAsPlainText;
  14422. g = "html" == d || "html" == b.preSniffing ? "html" : z(f);
  14423. delete a._.nextPasteType;
  14424. "htmlifiedtext" == g && (f = A(a.config, f));
  14425. if ("text" == d && "html" == g) f =
  14426. w(a, f, c.get("plain-text"));
  14427. else if (n && a.pasteFilter && !b.dontFilter || k) f = w(a, f, a.pasteFilter);
  14428. b.startsWithEOL && (f = '\x3cbr data-cke-eol\x3d"1"\x3e' + f);
  14429. b.endsWithEOL && (f += '\x3cbr data-cke-eol\x3d"1"\x3e');
  14430. "auto" == d && (d = "html" == g || "html" == m ? "html" : "text");
  14431. b.type = d;
  14432. b.dataValue = f;
  14433. delete b.preSniffing;
  14434. delete b.startsWithEOL;
  14435. delete b.endsWithEOL
  14436. }, null, null, 6);
  14437. a.on("paste", function(b) {
  14438. b = b.data;
  14439. b.dataValue && (a.insertHtml(b.dataValue, b.type, b.range), setTimeout(function() {
  14440. a.fire("afterPaste")
  14441. }, 0))
  14442. }, null, null,
  14443. 1E3);
  14444. a.on("pasteDialog", function(b) {
  14445. setTimeout(function() {
  14446. a.openDialog("paste", b.data)
  14447. }, 0)
  14448. })
  14449. }
  14450. });
  14451. CKEDITOR.plugins.clipboard = {
  14452. isCustomCopyCutSupported: (!CKEDITOR.env.ie || 16 <= CKEDITOR.env.version) && !CKEDITOR.env.iOS,
  14453. isCustomDataTypesSupported: !CKEDITOR.env.ie || 16 <= CKEDITOR.env.version,
  14454. isFileApiSupported: !CKEDITOR.env.ie || 9 < CKEDITOR.env.version,
  14455. mainPasteEvent: CKEDITOR.env.ie && !CKEDITOR.env.edge ? "beforepaste" : "paste",
  14456. addPasteButton: function(a, b, c) {
  14457. a.ui.addButton && (a.ui.addButton(b, c), a._.pasteButtons ||
  14458. (a._.pasteButtons = []), a._.pasteButtons.push(b))
  14459. },
  14460. canClipboardApiBeTrusted: function(a, b) {
  14461. 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 && 603 <= CKEDITOR.env.version && !CKEDITOR.env.iOS || CKEDITOR.env.edge && 16 <= CKEDITOR.env.version ? !0 : !1
  14462. },
  14463. getDropTarget: function(a) {
  14464. var b = a.editable();
  14465. return CKEDITOR.env.ie && 9 > CKEDITOR.env.version || b.isInline() ? b : a.document
  14466. },
  14467. fixSplitNodesAfterDrop: function(a,
  14468. b, c, d) {
  14469. function g(a, c, d) {
  14470. var g = a;
  14471. g.type == CKEDITOR.NODE_TEXT && (g = a.getParent());
  14472. if (g.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
  14473. }
  14474. var h = b.startContainer;
  14475. "number" == typeof d && "number" == typeof c && h.type == CKEDITOR.NODE_ELEMENT && (g(a.startContainer, h, c) || g(a.endContainer,
  14476. h, d))
  14477. },
  14478. isDropRangeAffectedByDragRange: function(a, b) {
  14479. var c = b.startContainer,
  14480. d = b.endOffset;
  14481. 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
  14482. },
  14483. internalDrop: function(a, b, c, d) {
  14484. var g = CKEDITOR.plugins.clipboard,
  14485. h = d.editable(),
  14486. e, f;
  14487. d.fire("saveSnapshot");
  14488. d.fire("lockSnapshot", {
  14489. dontUpdate: 1
  14490. });
  14491. CKEDITOR.env.ie && 10 > CKEDITOR.env.version && this.fixSplitNodesAfterDrop(a, b, g.dragStartContainerChildCount,
  14492. g.dragEndContainerChildCount);
  14493. (f = this.isDropRangeAffectedByDragRange(a, b)) || (e = a.createBookmark(!1));
  14494. g = b.clone().createBookmark(!1);
  14495. f && (e = a.createBookmark(!1));
  14496. a = e.startNode;
  14497. b = e.endNode;
  14498. f = g.startNode;
  14499. b && a.getPosition(f) & CKEDITOR.POSITION_PRECEDING && b.getPosition(f) & CKEDITOR.POSITION_FOLLOWING && f.insertBefore(a);
  14500. a = d.createRange();
  14501. a.moveToBookmark(e);
  14502. h.extractHtmlFromRange(a, 1);
  14503. b = d.createRange();
  14504. b.moveToBookmark(g);
  14505. r(d, {
  14506. dataTransfer: c,
  14507. method: "drop",
  14508. range: b
  14509. }, 1);
  14510. d.fire("unlockSnapshot")
  14511. },
  14512. getRangeAtDropPosition: function(a,
  14513. b) {
  14514. var c = a.data.$,
  14515. d = c.clientX,
  14516. g = c.clientY,
  14517. h = b.getSelection(!0).getRanges()[0],
  14518. e = b.createRange();
  14519. if (a.data.testRange) return a.data.testRange;
  14520. if (document.caretRangeFromPoint && b.document.$.caretRangeFromPoint(d, g)) c = b.document.$.caretRangeFromPoint(d, g), e.setStart(CKEDITOR.dom.node(c.startContainer), c.startOffset), e.collapse(!0);
  14521. else if (c.rangeParent) e.setStart(CKEDITOR.dom.node(c.rangeParent), c.rangeOffset), e.collapse(!0);
  14522. else {
  14523. if (CKEDITOR.env.ie && 8 < CKEDITOR.env.version && h && b.editable().hasFocus) return h;
  14524. if (document.body.createTextRange) {
  14525. b.focus();
  14526. c = b.document.getBody().$.createTextRange();
  14527. try {
  14528. for (var f = !1, l = 0; 20 > l && !f; l++) {
  14529. if (!f) try {
  14530. c.moveToPoint(d, g - l), f = !0
  14531. } catch (m) {}
  14532. if (!f) try {
  14533. c.moveToPoint(d, g + l), f = !0
  14534. } catch (n) {}
  14535. }
  14536. if (f) {
  14537. var k = "cke-temp-" + (new Date).getTime();
  14538. c.pasteHTML('\x3cspan id\x3d"' + k + '"\x3e​\x3c/span\x3e');
  14539. var t = b.document.getById(k);
  14540. e.moveToPosition(t, CKEDITOR.POSITION_BEFORE_START);
  14541. t.remove()
  14542. } else {
  14543. var q = b.document.$.elementFromPoint(d, g),
  14544. p = new CKEDITOR.dom.element(q),
  14545. r;
  14546. if (p.equals(b.editable()) ||
  14547. "html" == p.getName()) return h && h.startContainer && !h.startContainer.equals(b.editable()) ? h : null;
  14548. r = p.getClientRect();
  14549. d < r.left ? e.setStartAt(p, CKEDITOR.POSITION_AFTER_START) : e.setStartAt(p, CKEDITOR.POSITION_BEFORE_END);
  14550. e.collapse(!0)
  14551. }
  14552. } catch (u) {
  14553. return null
  14554. }
  14555. } else return null
  14556. }
  14557. return e
  14558. },
  14559. initDragDataTransfer: function(a, b) {
  14560. var c = a.data.$ ? a.data.$.dataTransfer : null,
  14561. d = new this.dataTransfer(c, b);
  14562. "dragstart" === a.name && d.storeId();
  14563. c ? this.dragData && d.id == this.dragData.id ? d = this.dragData : this.dragData = d : this.dragData ?
  14564. d = this.dragData : this.dragData = d;
  14565. a.data.dataTransfer = d
  14566. },
  14567. resetDragDataTransfer: function() {
  14568. this.dragData = null
  14569. },
  14570. initPasteDataTransfer: function(a, b) {
  14571. if (this.isCustomCopyCutSupported) {
  14572. if (a && a.data && a.data.$) {
  14573. var c = a.data.$.clipboardData,
  14574. d = new this.dataTransfer(c, b);
  14575. "copy" !== a.name && "cut" !== a.name || d.storeId();
  14576. this.copyCutData && d.id == this.copyCutData.id ? (d = this.copyCutData, d.$ = c) : this.copyCutData = d;
  14577. return d
  14578. }
  14579. return new this.dataTransfer(null, b)
  14580. }
  14581. return new this.dataTransfer(CKEDITOR.env.edge && a && a.data.$ &&
  14582. a.data.$.clipboardData || null, b)
  14583. },
  14584. preventDefaultDropOnElement: function(a) {
  14585. a && a.on("dragover", D)
  14586. }
  14587. };
  14588. m = CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ? "cke/id" : "Text";
  14589. CKEDITOR.plugins.clipboard.dataTransfer = function(a, b) {
  14590. a && (this.$ = a);
  14591. this._ = {
  14592. metaRegExp: /^<meta.*?>/i,
  14593. bodyRegExp: /<body(?:[\s\S]*?)>([\s\S]*)<\/body>/i,
  14594. fragmentRegExp: /\x3c!--(?:Start|End)Fragment--\x3e/g,
  14595. data: {},
  14596. files: [],
  14597. nativeHtmlCache: "",
  14598. normalizeType: function(a) {
  14599. a = a.toLowerCase();
  14600. return "text" == a || "text/plain" == a ? "Text" : "url" == a ?
  14601. "URL" : a
  14602. }
  14603. };
  14604. this._.fallbackDataTransfer = new CKEDITOR.plugins.clipboard.fallbackDataTransfer(this);
  14605. this.id = this.getData(m);
  14606. this.id || (this.id = "Text" == m ? "" : "cke-" + CKEDITOR.tools.getUniqueId());
  14607. b && (this.sourceEditor = b, this.setData("text/html", b.getSelectedHtml(1)), "Text" == m || this.getData("text/plain") || this.setData("text/plain", b.getSelection().getSelectedText()))
  14608. };
  14609. CKEDITOR.DATA_TRANSFER_INTERNAL = 1;
  14610. CKEDITOR.DATA_TRANSFER_CROSS_EDITORS = 2;
  14611. CKEDITOR.DATA_TRANSFER_EXTERNAL = 3;
  14612. CKEDITOR.plugins.clipboard.dataTransfer.prototype = {
  14613. getData: function(a, b) {
  14614. a = this._.normalizeType(a);
  14615. var c = "text/html" == a && b ? this._.nativeHtmlCache : this._.data[a];
  14616. if (void 0 === c || null === c || "" === c) {
  14617. if (this._.fallbackDataTransfer.isRequired()) c = this._.fallbackDataTransfer.getData(a, b);
  14618. else try {
  14619. c = this.$.getData(a) || ""
  14620. } catch (d) {
  14621. c = ""
  14622. }
  14623. "text/html" != a || b || (c = this._stripHtml(c))
  14624. }
  14625. "Text" == a && CKEDITOR.env.gecko && this.getFilesCount() && "file://" == c.substring(0, 7) && (c = "");
  14626. if ("string" === typeof c) var g = c.indexOf("\x3c/html\x3e"),
  14627. c = -1 !== g ? c.substring(0, g + 7) : c;
  14628. return c
  14629. },
  14630. setData: function(a, b) {
  14631. a = this._.normalizeType(a);
  14632. "text/html" == a ? (this._.data[a] = this._stripHtml(b), this._.nativeHtmlCache = b) : this._.data[a] = b;
  14633. if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported || "URL" == a || "Text" == a)
  14634. if ("Text" == m && "Text" == a && (this.id = b), this._.fallbackDataTransfer.isRequired()) this._.fallbackDataTransfer.setData(a, b);
  14635. else try {
  14636. this.$.setData(a, b)
  14637. } catch (c) {}
  14638. },
  14639. storeId: function() {
  14640. "Text" !== m && this.setData(m, this.id)
  14641. },
  14642. getTransferType: function(a) {
  14643. return this.sourceEditor ? this.sourceEditor ==
  14644. a ? CKEDITOR.DATA_TRANSFER_INTERNAL : CKEDITOR.DATA_TRANSFER_CROSS_EDITORS : CKEDITOR.DATA_TRANSFER_EXTERNAL
  14645. },
  14646. cacheData: function() {
  14647. function a(a) {
  14648. a = b._.normalizeType(a);
  14649. var c = b.getData(a);
  14650. "text/html" == a && (b._.nativeHtmlCache = b.getData(a, !0), c = b._stripHtml(c));
  14651. c && (b._.data[a] = c)
  14652. }
  14653. if (this.$) {
  14654. var b = this,
  14655. c, d;
  14656. if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported) {
  14657. if (this.$.types)
  14658. for (c = 0; c < this.$.types.length; c++) a(this.$.types[c])
  14659. } else a("Text"), a("URL");
  14660. d = this._getImageFromClipboard();
  14661. if (this.$ && this.$.files ||
  14662. d) {
  14663. this._.files = [];
  14664. if (this.$.files && this.$.files.length)
  14665. for (c = 0; c < this.$.files.length; c++) this._.files.push(this.$.files[c]);
  14666. 0 === this._.files.length && d && this._.files.push(d)
  14667. }
  14668. }
  14669. },
  14670. getFilesCount: function() {
  14671. return this._.files.length ? this._.files.length : this.$ && this.$.files && this.$.files.length ? this.$.files.length : this._getImageFromClipboard() ? 1 : 0
  14672. },
  14673. getFile: function(a) {
  14674. return this._.files.length ? this._.files[a] : this.$ && this.$.files && this.$.files.length ? this.$.files[a] : 0 === a ? this._getImageFromClipboard() :
  14675. void 0
  14676. },
  14677. isEmpty: function() {
  14678. var a = {},
  14679. b;
  14680. if (this.getFilesCount()) return !1;
  14681. CKEDITOR.tools.array.forEach(CKEDITOR.tools.objectKeys(this._.data), function(b) {
  14682. a[b] = 1
  14683. });
  14684. if (this.$)
  14685. if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported) {
  14686. if (this.$.types)
  14687. for (var c = 0; c < this.$.types.length; c++) a[this.$.types[c]] = 1
  14688. } else a.Text = 1, a.URL = 1;
  14689. "Text" != m && (a[m] = 0);
  14690. for (b in a)
  14691. if (a[b] && "" !== this.getData(b)) return !1;
  14692. return !0
  14693. },
  14694. _getImageFromClipboard: function() {
  14695. var a;
  14696. if (this.$ && this.$.items && this.$.items[0]) try {
  14697. if ((a = this.$.items[0].getAsFile()) &&
  14698. a.type) return a
  14699. } catch (b) {}
  14700. },
  14701. _stripHtml: function(a) {
  14702. if (a && a.length) {
  14703. a = a.replace(this._.metaRegExp, "");
  14704. var b = this._.bodyRegExp.exec(a);
  14705. b && b.length && (a = b[1], a = a.replace(this._.fragmentRegExp, ""))
  14706. }
  14707. return a
  14708. }
  14709. };
  14710. CKEDITOR.plugins.clipboard.fallbackDataTransfer = function(a) {
  14711. this._dataTransfer = a;
  14712. this._customDataFallbackType = "text/html"
  14713. };
  14714. CKEDITOR.plugins.clipboard.fallbackDataTransfer._isCustomMimeTypeSupported = null;
  14715. CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes = [];
  14716. CKEDITOR.plugins.clipboard.fallbackDataTransfer.prototype = {
  14717. isRequired: function() {
  14718. var a = CKEDITOR.plugins.clipboard.fallbackDataTransfer,
  14719. b = this._dataTransfer.$;
  14720. if (null === a._isCustomMimeTypeSupported)
  14721. if (b) {
  14722. a._isCustomMimeTypeSupported = !1;
  14723. if (CKEDITOR.env.edge && 17 <= CKEDITOR.env.version) return !0;
  14724. try {
  14725. b.setData("cke/mimetypetest", "cke test value"), a._isCustomMimeTypeSupported = "cke test value" === b.getData("cke/mimetypetest"), b.clearData("cke/mimetypetest")
  14726. } catch (c) {}
  14727. } else return !1;
  14728. return !a._isCustomMimeTypeSupported
  14729. },
  14730. getData: function(a, b) {
  14731. var c = this._getData(this._customDataFallbackType,
  14732. !0);
  14733. if (b) return c;
  14734. var c = this._extractDataComment(c),
  14735. d = null,
  14736. d = a === this._customDataFallbackType ? c.content : c.data && c.data[a] ? c.data[a] : this._getData(a, !0);
  14737. return null !== d ? d : ""
  14738. },
  14739. setData: function(a, b) {
  14740. var c = a === this._customDataFallbackType;
  14741. c && (b = this._applyDataComment(b, this._getFallbackTypeData()));
  14742. var d = b,
  14743. g = this._dataTransfer.$;
  14744. try {
  14745. g.setData(a, d), c && (this._dataTransfer._.nativeHtmlCache = d)
  14746. } catch (h) {
  14747. if (this._isUnsupportedMimeTypeError(h)) {
  14748. c = CKEDITOR.plugins.clipboard.fallbackDataTransfer; - 1 === CKEDITOR.tools.indexOf(c._customTypes,
  14749. a) && c._customTypes.push(a);
  14750. var c = this._getFallbackTypeContent(),
  14751. e = this._getFallbackTypeData();
  14752. e[a] = d;
  14753. try {
  14754. d = this._applyDataComment(c, e), g.setData(this._customDataFallbackType, d), this._dataTransfer._.nativeHtmlCache = d
  14755. } catch (f) {
  14756. d = ""
  14757. }
  14758. }
  14759. }
  14760. return d
  14761. },
  14762. _getData: function(a, b) {
  14763. var c = this._dataTransfer._.data;
  14764. if (!b && c[a]) return c[a];
  14765. try {
  14766. return this._dataTransfer.$.getData(a)
  14767. } catch (d) {
  14768. return null
  14769. }
  14770. },
  14771. _getFallbackTypeContent: function() {
  14772. var a = this._dataTransfer._.data[this._customDataFallbackType];
  14773. a || (a = this._extractDataComment(this._getData(this._customDataFallbackType,
  14774. !0)).content);
  14775. return a
  14776. },
  14777. _getFallbackTypeData: function() {
  14778. var a = CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes,
  14779. b = this._extractDataComment(this._getData(this._customDataFallbackType, !0)).data || {},
  14780. c = this._dataTransfer._.data;
  14781. CKEDITOR.tools.array.forEach(a, function(a) {
  14782. void 0 !== c[a] ? b[a] = c[a] : void 0 !== b[a] && (b[a] = b[a])
  14783. }, this);
  14784. return b
  14785. },
  14786. _isUnsupportedMimeTypeError: function(a) {
  14787. return a.message && -1 !== a.message.search(/element not found/gi)
  14788. },
  14789. _extractDataComment: function(a) {
  14790. var b = {
  14791. data: null,
  14792. content: a ||
  14793. ""
  14794. };
  14795. if (a && 16 < a.length) {
  14796. var c;
  14797. (c = /\x3c!--cke-data:(.*?)--\x3e/g.exec(a)) && c[1] && (b.data = JSON.parse(decodeURIComponent(c[1])), b.content = a.replace(c[0], ""))
  14798. }
  14799. return b
  14800. },
  14801. _applyDataComment: function(a, b) {
  14802. var c = "";
  14803. b && CKEDITOR.tools.objectKeys(b).length && (c = "\x3c!--cke-data:" + encodeURIComponent(JSON.stringify(b)) + "--\x3e");
  14804. return c + (a && a.length ? a : "")
  14805. }
  14806. }
  14807. })();
  14808. CKEDITOR.config.clipboard_notificationDuration = 1E4;
  14809. CKEDITOR.plugins.add("panelbutton", {
  14810. requires: "button",
  14811. onLoad: function() {
  14812. function e(c) {
  14813. var a = this._;
  14814. a.state != CKEDITOR.TRISTATE_DISABLED && (this.createPanel(c), a.on ? a.panel.hide() : a.panel.showBlock(this._.id, this.document.getById(this._.id), 4))
  14815. }
  14816. CKEDITOR.ui.panelButton = CKEDITOR.tools.createClass({
  14817. base: CKEDITOR.ui.button,
  14818. $: function(c) {
  14819. var a = c.panel || {};
  14820. delete c.panel;
  14821. this.base(c);
  14822. this.document = a.parent && a.parent.getDocument() || CKEDITOR.document;
  14823. a.block = {
  14824. attributes: a.attributes
  14825. };
  14826. this.hasArrow = a.toolbarRelated = !0;
  14827. this.click = e;
  14828. this._ = {
  14829. panelDefinition: a
  14830. }
  14831. },
  14832. statics: {
  14833. handler: {
  14834. create: function(c) {
  14835. return new CKEDITOR.ui.panelButton(c)
  14836. }
  14837. }
  14838. },
  14839. proto: {
  14840. createPanel: function(c) {
  14841. var a = this._;
  14842. if (!a.panel) {
  14843. var f = this._.panelDefinition,
  14844. e = this._.panelDefinition.block,
  14845. g = f.parent || CKEDITOR.document.getBody(),
  14846. d = this._.panel = new CKEDITOR.ui.floatPanel(c, g, f),
  14847. f = d.addBlock(a.id, e),
  14848. b = this;
  14849. d.onShow = function() {
  14850. b.className && this.element.addClass(b.className + "_panel");
  14851. b.setState(CKEDITOR.TRISTATE_ON);
  14852. a.on = 1;
  14853. b.editorFocus && c.focus();
  14854. if (b.onOpen) b.onOpen()
  14855. };
  14856. d.onHide = function(d) {
  14857. b.className && this.element.getFirst().removeClass(b.className + "_panel");
  14858. b.setState(b.modes && b.modes[c.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
  14859. a.on = 0;
  14860. if (!d && b.onClose) b.onClose()
  14861. };
  14862. d.onEscape = function() {
  14863. d.hide(1);
  14864. b.document.getById(a.id).focus()
  14865. };
  14866. if (this.onBlock) this.onBlock(d, f);
  14867. f.onHide = function() {
  14868. a.on = 0;
  14869. b.setState(CKEDITOR.TRISTATE_OFF)
  14870. }
  14871. }
  14872. }
  14873. }
  14874. })
  14875. },
  14876. beforeInit: function(e) {
  14877. e.ui.addHandler(CKEDITOR.UI_PANELBUTTON, CKEDITOR.ui.panelButton.handler)
  14878. }
  14879. });
  14880. CKEDITOR.UI_PANELBUTTON = "panelbutton";
  14881. (function() {
  14882. CKEDITOR.plugins.add("panel", {
  14883. beforeInit: function(a) {
  14884. a.ui.addHandler(CKEDITOR.UI_PANEL, CKEDITOR.ui.panel.handler)
  14885. }
  14886. });
  14887. CKEDITOR.UI_PANEL = "panel";
  14888. CKEDITOR.ui.panel = function(a, b) {
  14889. b && CKEDITOR.tools.extend(this, b);
  14890. CKEDITOR.tools.extend(this, {
  14891. className: "",
  14892. css: []
  14893. });
  14894. this.id = CKEDITOR.tools.getNextId();
  14895. this.document = a;
  14896. this.isFramed = this.forceIFrame || this.css.length;
  14897. this._ = {
  14898. blocks: {}
  14899. }
  14900. };
  14901. CKEDITOR.ui.panel.handler = {
  14902. create: function(a) {
  14903. return new CKEDITOR.ui.panel(a)
  14904. }
  14905. };
  14906. var g = CKEDITOR.addTemplate("panel",
  14907. '\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'),
  14908. 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'),
  14909. 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');
  14910. CKEDITOR.ui.panel.prototype = {
  14911. render: function(a, b) {
  14912. this.getHolderElement = function() {
  14913. var a = this._.holder;
  14914. if (!a) {
  14915. if (this.isFramed) {
  14916. var a = this.document.getById(this.id + "_frame"),
  14917. b = a.getParent(),
  14918. a = a.getFrameDocument();
  14919. CKEDITOR.env.iOS && b.setStyles({
  14920. overflow: "scroll",
  14921. "-webkit-overflow-scrolling": "touch"
  14922. });
  14923. b = CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function() {
  14924. this.isLoaded = !0;
  14925. if (this.onLoad) this.onLoad()
  14926. }, this));
  14927. a.write(k.output(CKEDITOR.tools.extend({
  14928. css: CKEDITOR.tools.buildStyleHtml(this.css),
  14929. onload: "window.parent.CKEDITOR.tools.callFunction(" +
  14930. b + ");"
  14931. }, e)));
  14932. a.getWindow().$.CKEDITOR = CKEDITOR;
  14933. a.on("keydown", function(a) {
  14934. var b = a.data.getKeystroke(),
  14935. c = this.document.getById(this.id).getAttribute("dir");
  14936. this._.onKeyDown && !1 === this._.onKeyDown(b) ? a.data.preventDefault() : (27 == b || b == ("rtl" == c ? 39 : 37)) && this.onEscape && !1 === this.onEscape(b) && a.data.preventDefault()
  14937. }, this);
  14938. a = a.getBody();
  14939. a.unselectable();
  14940. CKEDITOR.env.air && CKEDITOR.tools.callFunction(b)
  14941. } else a = this.document.getById(this.id);
  14942. this._.holder = a
  14943. }
  14944. return a
  14945. };
  14946. var e = {
  14947. editorId: a.id,
  14948. id: this.id,
  14949. langCode: a.langCode,
  14950. dir: a.lang.dir,
  14951. cls: this.className,
  14952. frame: "",
  14953. env: CKEDITOR.env.cssClass,
  14954. "z-index": a.config.baseFloatZIndex + 1
  14955. };
  14956. if (this.isFramed) {
  14957. var d = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie ? "javascript:void(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "}())" : "";
  14958. e.frame = h.output({
  14959. id: this.id + "_frame",
  14960. src: d
  14961. })
  14962. }
  14963. d = g.output(e);
  14964. b && b.push(d);
  14965. return d
  14966. },
  14967. addBlock: function(a, b) {
  14968. b = this._.blocks[a] = b instanceof CKEDITOR.ui.panel.block ? b : new CKEDITOR.ui.panel.block(this.getHolderElement(),
  14969. b);
  14970. this._.currentBlock || this.showBlock(a);
  14971. return b
  14972. },
  14973. getBlock: function(a) {
  14974. return this._.blocks[a]
  14975. },
  14976. showBlock: function(a) {
  14977. a = this._.blocks[a];
  14978. var b = this._.currentBlock,
  14979. e = !this.forceIFrame || CKEDITOR.env.ie ? this._.holder : this.document.getById(this.id + "_frame");
  14980. b && b.hide();
  14981. this._.currentBlock = a;
  14982. CKEDITOR.fire("ariaWidget", e);
  14983. a._.focusIndex = -1;
  14984. this._.onKeyDown = a.onKeyDown && CKEDITOR.tools.bind(a.onKeyDown, a);
  14985. a.show();
  14986. return a
  14987. },
  14988. destroy: function() {
  14989. this.element && this.element.remove()
  14990. }
  14991. };
  14992. CKEDITOR.ui.panel.block =
  14993. CKEDITOR.tools.createClass({
  14994. $: function(a, b) {
  14995. this.element = a.append(a.getDocument().createElement("div", {
  14996. attributes: {
  14997. tabindex: -1,
  14998. "class": "cke_panel_block"
  14999. },
  15000. styles: {
  15001. display: "none"
  15002. }
  15003. }));
  15004. b && CKEDITOR.tools.extend(this, b);
  15005. this.element.setAttributes({
  15006. role: this.attributes.role || "presentation",
  15007. "aria-label": this.attributes["aria-label"],
  15008. title: this.attributes.title || this.attributes["aria-label"]
  15009. });
  15010. this.keys = {};
  15011. this._.focusIndex = -1;
  15012. this.element.disableContextMenu()
  15013. },
  15014. _: {
  15015. markItem: function(a) {
  15016. -1 != a && (a = this.element.getElementsByTag("a").getItem(this._.focusIndex =
  15017. a), CKEDITOR.env.webkit && a.getDocument().getWindow().focus(), a.focus(), this.onMark && this.onMark(a))
  15018. },
  15019. markFirstDisplayed: function(a) {
  15020. for (var b = function(a) {
  15021. return a.type == CKEDITOR.NODE_ELEMENT && "none" == a.getStyle("display")
  15022. }, e = this._.getItems(), d, c, f = e.count() - 1; 0 <= f; f--)
  15023. if (d = e.getItem(f), d.getAscendant(b) || (c = d, this._.focusIndex = f), "true" == d.getAttribute("aria-selected")) {
  15024. c = d;
  15025. this._.focusIndex = f;
  15026. break
  15027. } c && (a && a(), CKEDITOR.env.webkit && c.getDocument().getWindow().focus(), c.focus(), this.onMark && this.onMark(c))
  15028. },
  15029. getItems: function() {
  15030. return this.element.getElementsByTag("a")
  15031. }
  15032. },
  15033. proto: {
  15034. show: function() {
  15035. this.element.setStyle("display", "")
  15036. },
  15037. hide: function() {
  15038. this.onHide && !0 === this.onHide.call(this) || this.element.setStyle("display", "none")
  15039. },
  15040. onKeyDown: function(a, b) {
  15041. var e = this.keys[a];
  15042. switch (e) {
  15043. case "next":
  15044. for (var d = this._.focusIndex, e = this.element.getElementsByTag("a"), c; c = e.getItem(++d);)
  15045. if (c.getAttribute("_cke_focus") && c.$.offsetWidth) {
  15046. this._.focusIndex = d;
  15047. c.focus();
  15048. break
  15049. } return c || b ? !1 : (this._.focusIndex = -1, this.onKeyDown(a,
  15050. 1));
  15051. case "prev":
  15052. d = this._.focusIndex;
  15053. for (e = this.element.getElementsByTag("a"); 0 < d && (c = e.getItem(--d));) {
  15054. if (c.getAttribute("_cke_focus") && c.$.offsetWidth) {
  15055. this._.focusIndex = d;
  15056. c.focus();
  15057. break
  15058. }
  15059. c = null
  15060. }
  15061. return c || b ? !1 : (this._.focusIndex = e.count(), this.onKeyDown(a, 1));
  15062. case "click":
  15063. case "mouseup":
  15064. return d = this._.focusIndex, (c = 0 <= d && this.element.getElementsByTag("a").getItem(d)) && (c.$[e] ? c.$[e]() : c.$["on" + e]()), !1
  15065. }
  15066. return !0
  15067. }
  15068. }
  15069. })
  15070. })();
  15071. CKEDITOR.plugins.add("floatpanel", {
  15072. requires: "panel"
  15073. });
  15074. (function() {
  15075. function v(a, b, c, m, h) {
  15076. h = CKEDITOR.tools.genKey(b.getUniqueId(), c.getUniqueId(), a.lang.dir, a.uiColor || "", m.css || "", h || "");
  15077. var g = f[h];
  15078. 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({
  15079. display: "none",
  15080. position: "absolute"
  15081. }));
  15082. return g
  15083. }
  15084. var f = {};
  15085. CKEDITOR.ui.floatPanel = CKEDITOR.tools.createClass({
  15086. $: function(a, b, c, m) {
  15087. function h() {
  15088. e.hide()
  15089. }
  15090. c.forceIFrame = 1;
  15091. c.toolbarRelated && a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE &&
  15092. (b = CKEDITOR.document.getById("cke_" + a.name));
  15093. var g = b.getDocument();
  15094. m = v(a, g, b, c, m || 0);
  15095. var n = m.element,
  15096. k = n.getFirst(),
  15097. e = this;
  15098. n.disableContextMenu();
  15099. this.element = n;
  15100. this._ = {
  15101. editor: a,
  15102. panel: m,
  15103. parentElement: b,
  15104. definition: c,
  15105. document: g,
  15106. iframe: k,
  15107. children: [],
  15108. dir: a.lang.dir,
  15109. showBlockParams: null
  15110. };
  15111. a.on("mode", h);
  15112. a.on("resize", h);
  15113. g.getWindow().on("resize", function() {
  15114. this.reposition()
  15115. }, this)
  15116. },
  15117. proto: {
  15118. addBlock: function(a, b) {
  15119. return this._.panel.addBlock(a, b)
  15120. },
  15121. addListBlock: function(a, b) {
  15122. return this._.panel.addListBlock(a,
  15123. b)
  15124. },
  15125. getBlock: function(a) {
  15126. return this._.panel.getBlock(a)
  15127. },
  15128. showBlock: function(a, b, c, m, h, g) {
  15129. var n = this._.panel,
  15130. k = n.showBlock(a);
  15131. this._.showBlockParams = [].slice.call(arguments);
  15132. this.allowBlur(!1);
  15133. var e = this._.editor.editable();
  15134. this._.returnFocus = e.hasFocus ? e : new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement);
  15135. this._.hideTimeout = 0;
  15136. var l = this.element,
  15137. e = this._.iframe,
  15138. e = CKEDITOR.env.ie && !CKEDITOR.env.edge ? e : new CKEDITOR.dom.window(e.$.contentWindow),
  15139. f = l.getDocument(),
  15140. r = this._.parentElement.getPositionedAncestor(),
  15141. t = b.getDocumentPosition(f),
  15142. f = r ? r.getDocumentPosition(f) : {
  15143. x: 0,
  15144. y: 0
  15145. },
  15146. q = "rtl" == this._.dir,
  15147. d = t.x + (m || 0) - f.x,
  15148. p = t.y + (h || 0) - f.y;
  15149. !q || 1 != c && 4 != c ? q || 2 != c && 3 != c || (d += b.$.offsetWidth - 1) : d += b.$.offsetWidth;
  15150. if (3 == c || 4 == c) p += b.$.offsetHeight - 1;
  15151. this._.panel._.offsetParentId = b.getId();
  15152. l.setStyles({
  15153. top: p + "px",
  15154. left: 0,
  15155. display: ""
  15156. });
  15157. l.setOpacity(0);
  15158. l.getFirst().removeStyle("width");
  15159. this._.editor.focusManager.add(e);
  15160. this._.blurSet || (CKEDITOR.event.useCapture = !0, e.on("blur", function(a) {
  15161. function u() {
  15162. delete this._.returnFocus;
  15163. this.hide()
  15164. }
  15165. 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))
  15166. }, this), e.on("focus", function() {
  15167. this._.focused = !0;
  15168. this.hideChild();
  15169. this.allowBlur(!0)
  15170. }, this), CKEDITOR.env.iOS && (e.on("touchstart", function() {
  15171. clearTimeout(this._.hideTimeout)
  15172. }, this), e.on("touchend", function() {
  15173. this._.hideTimeout = 0;
  15174. this.focus()
  15175. }, this)), CKEDITOR.event.useCapture = !1,
  15176. this._.blurSet = 1);
  15177. n.onEscape = CKEDITOR.tools.bind(function(a) {
  15178. if (this.onEscape && !1 === this.onEscape(a)) return !1
  15179. }, this);
  15180. CKEDITOR.tools.setTimeout(function() {
  15181. var a = CKEDITOR.tools.bind(function() {
  15182. var a = l;
  15183. a.removeStyle("width");
  15184. if (k.autoSize) {
  15185. var b = k.element.getDocument(),
  15186. b = (CKEDITOR.env.webkit || CKEDITOR.env.edge ? k.element : b.getBody()).$.scrollWidth;
  15187. CKEDITOR.env.ie && CKEDITOR.env.quirks && 0 < b && (b += (a.$.offsetWidth || 0) - (a.$.clientWidth || 0) + 3);
  15188. a.setStyle("width", b + 10 + "px");
  15189. b = k.element.$.scrollHeight;
  15190. CKEDITOR.env.ie &&
  15191. CKEDITOR.env.quirks && 0 < b && (b += (a.$.offsetHeight || 0) - (a.$.clientHeight || 0) + 3);
  15192. a.setStyle("height", b + "px");
  15193. n._.currentBlock.element.setStyle("display", "none").removeStyle("display")
  15194. } else a.removeStyle("height");
  15195. q && (d -= l.$.offsetWidth);
  15196. l.setStyle("left", d + "px");
  15197. var b = n.element.getWindow(),
  15198. a = l.$.getBoundingClientRect(),
  15199. b = b.getViewPaneSize(),
  15200. c = a.width || a.right - a.left,
  15201. e = a.height || a.bottom - a.top,
  15202. m = q ? a.right : b.width - a.left,
  15203. h = q ? b.width - a.right : a.left;
  15204. q ? m < c && (d = h > c ? d + c : b.width > c ? d - a.left : d - a.right + b.width) :
  15205. m < c && (d = h > c ? d - c : b.width > c ? d - a.right + b.width : d - a.left);
  15206. c = a.top;
  15207. b.height - a.top < e && (p = c > e ? p - e : b.height > e ? p - a.bottom + b.height : p - a.top);
  15208. CKEDITOR.env.ie && (b = a = new CKEDITOR.dom.element(l.$.offsetParent), "html" == b.getName() && (b = b.getDocument().getBody()), "rtl" == b.getComputedStyle("direction") && (d = CKEDITOR.env.ie8Compat ? d - 2 * l.getDocument().getDocumentElement().$.scrollLeft : d - (a.$.scrollWidth - a.$.clientWidth)));
  15209. var a = l.getFirst(),
  15210. f;
  15211. (f = a.getCustomData("activePanel")) && f.onHide && f.onHide.call(this, 1);
  15212. a.setCustomData("activePanel",
  15213. this);
  15214. l.setStyles({
  15215. top: p + "px",
  15216. left: d + "px"
  15217. });
  15218. l.setOpacity(1);
  15219. g && g()
  15220. }, this);
  15221. n.isLoaded ? a() : n.onLoad = a;
  15222. CKEDITOR.tools.setTimeout(function() {
  15223. var a = CKEDITOR.env.webkit && CKEDITOR.document.getWindow().getScrollPosition().y;
  15224. this.focus();
  15225. k.element.focus();
  15226. CKEDITOR.env.webkit && (CKEDITOR.document.getBody().$.scrollTop = a);
  15227. this.allowBlur(!0);
  15228. CKEDITOR.env.ie ? CKEDITOR.tools.setTimeout(function() {
  15229. k.markFirstDisplayed ? k.markFirstDisplayed() : k._.markFirstDisplayed()
  15230. }, 0) : k.markFirstDisplayed ? k.markFirstDisplayed() :
  15231. k._.markFirstDisplayed();
  15232. this._.editor.fire("panelShow", this)
  15233. }, 0, this)
  15234. }, CKEDITOR.env.air ? 200 : 0, this);
  15235. this.visible = 1;
  15236. this.onShow && this.onShow.call(this)
  15237. },
  15238. reposition: function() {
  15239. var a = this._.showBlockParams;
  15240. this.visible && this._.showBlockParams && (this.hide(), this.showBlock.apply(this, a))
  15241. },
  15242. focus: function() {
  15243. if (CKEDITOR.env.webkit) {
  15244. var a = CKEDITOR.document.getActive();
  15245. a && !a.equals(this._.iframe) && a.$.blur()
  15246. }(this._.lastFocused || this._.iframe.getFrameDocument().getWindow()).focus()
  15247. },
  15248. blur: function() {
  15249. var a =
  15250. this._.iframe.getFrameDocument().getActive();
  15251. a && a.is("a") && (this._.lastFocused = a)
  15252. },
  15253. hide: function(a) {
  15254. if (this.visible && (!this.onHide || !0 !== this.onHide.call(this))) {
  15255. this.hideChild();
  15256. CKEDITOR.env.gecko && this._.iframe.getFrameDocument().$.activeElement.blur();
  15257. this.element.setStyle("display", "none");
  15258. this.visible = 0;
  15259. this.element.getFirst().removeCustomData("activePanel");
  15260. if (a = a && this._.returnFocus) CKEDITOR.env.webkit && a.type && a.getWindow().$.focus(), a.focus();
  15261. delete this._.lastFocused;
  15262. this._.showBlockParams =
  15263. null;
  15264. this._.editor.fire("panelHide", this)
  15265. }
  15266. },
  15267. allowBlur: function(a) {
  15268. var b = this._.panel;
  15269. void 0 !== a && (b.allowBlur = a);
  15270. return b.allowBlur
  15271. },
  15272. showAsChild: function(a, b, c, f, h, g) {
  15273. if (this._.activeChild != a || a._.panel._.offsetParentId != c.getId()) this.hideChild(), a.onHide = CKEDITOR.tools.bind(function() {
  15274. CKEDITOR.tools.setTimeout(function() {
  15275. this._.focused || this.hide()
  15276. }, 0, this)
  15277. }, this), this._.activeChild = a, this._.focused = !1, a.showBlock(b, c, f, h, g), this.blur(), (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) && setTimeout(function() {
  15278. a.element.getChild(0).$.style.cssText +=
  15279. ""
  15280. }, 100)
  15281. },
  15282. hideChild: function(a) {
  15283. var b = this._.activeChild;
  15284. b && (delete b.onHide, delete this._.activeChild, b.hide(), a && this.focus())
  15285. }
  15286. }
  15287. });
  15288. CKEDITOR.on("instanceDestroyed", function() {
  15289. var a = CKEDITOR.tools.isEmpty(CKEDITOR.instances),
  15290. b;
  15291. for (b in f) {
  15292. var c = f[b];
  15293. a ? c.destroy() : c.element.hide()
  15294. }
  15295. a && (f = {})
  15296. })
  15297. })();
  15298. CKEDITOR.plugins.add("colorbutton", {
  15299. requires: "panelbutton,floatpanel",
  15300. init: function(e) {
  15301. function t(a, d, g, r, k) {
  15302. var p = new CKEDITOR.style(l["colorButton_" + d + "Style"]),
  15303. m = CKEDITOR.tools.getNextId() + "_colorBox",
  15304. q;
  15305. k = k || {};
  15306. e.ui.add(a, CKEDITOR.UI_PANELBUTTON, {
  15307. label: g,
  15308. title: g,
  15309. modes: {
  15310. wysiwyg: 1
  15311. },
  15312. editorFocus: 0,
  15313. toolbar: "colors," + r,
  15314. allowedContent: p,
  15315. requiredContent: p,
  15316. contentTransformations: k.contentTransformations,
  15317. panel: {
  15318. css: CKEDITOR.skin.getPath("editor"),
  15319. attributes: {
  15320. role: "listbox",
  15321. "aria-label": h.panelTitle
  15322. }
  15323. },
  15324. onBlock: function(a,
  15325. b) {
  15326. q = b;
  15327. b.autoSize = !0;
  15328. b.element.addClass("cke_colorblock");
  15329. b.element.setHtml(y(a, d, m));
  15330. b.element.getDocument().getBody().setStyle("overflow", "hidden");
  15331. CKEDITOR.ui.fire("ready", this);
  15332. var c = b.keys,
  15333. f = "rtl" == e.lang.dir;
  15334. c[f ? 37 : 39] = "next";
  15335. c[40] = "next";
  15336. c[9] = "next";
  15337. c[f ? 39 : 37] = "prev";
  15338. c[38] = "prev";
  15339. c[CKEDITOR.SHIFT + 9] = "prev";
  15340. c[32] = "click"
  15341. },
  15342. refresh: function() {
  15343. e.activeFilter.check(p) || this.setState(CKEDITOR.TRISTATE_DISABLED)
  15344. },
  15345. onOpen: function() {
  15346. var a = e.getSelection(),
  15347. b = a && a.getStartElement(),
  15348. c = e.elementPath(b);
  15349. if (c) {
  15350. b = c.block || c.blockLimit || e.document.getBody();
  15351. do c = b && b.getComputedStyle("back" == d ? "background-color" : "color") || "transparent"; while ("back" == d && "transparent" == c && b && (b = b.getParent()));
  15352. c && "transparent" != c || (c = "#ffffff");
  15353. !1 !== l.colorButton_enableAutomatic && this._.panel._.iframe.getFrameDocument().getById(m).setStyle("background-color", c);
  15354. if (b = a && a.getRanges()[0]) {
  15355. for (var a = new CKEDITOR.dom.walker(b), f = b.collapsed ? b.startContainer : a.next(), b = ""; f;) {
  15356. f.type !== CKEDITOR.NODE_ELEMENT && (f = f.getParent());
  15357. f = u(f.getComputedStyle("back" == d ? "background-color" : "color"));
  15358. b = b || f;
  15359. if (b !== f) {
  15360. b = "";
  15361. break
  15362. }
  15363. f = a.next()
  15364. }
  15365. a = b;
  15366. b = q._.getItems();
  15367. for (f = 0; f < b.count(); f++) {
  15368. var g = b.getItem(f);
  15369. g.removeAttribute("aria-selected");
  15370. a && a == u(g.getAttribute("data-value")) && g.setAttribute("aria-selected", !0)
  15371. }
  15372. }
  15373. return c
  15374. }
  15375. }
  15376. })
  15377. }
  15378. function y(a, d, g) {
  15379. a = [];
  15380. var r = l.colorButton_colors.split(","),
  15381. k = l.colorButton_colorsPerRow || 6,
  15382. p = e.plugins.colordialog && !1 !== l.colorButton_enableMore,
  15383. m = r.length + (p ? 2 : 1),
  15384. q = CKEDITOR.tools.addFunction(function(a, b) {
  15385. function c(a) {
  15386. var d =
  15387. l["colorButton_" + b + "Style"];
  15388. e.removeStyle(new CKEDITOR.style(d, {
  15389. color: "inherit"
  15390. }));
  15391. d.childRule = "back" == b ? function(a) {
  15392. return v(a)
  15393. } : function(a) {
  15394. return !(a.is("a") || a.getElementsByTag("a").count()) || v(a)
  15395. };
  15396. e.focus();
  15397. a && e.applyStyle(new CKEDITOR.style(d, {
  15398. color: a
  15399. }));
  15400. e.fire("saveSnapshot")
  15401. }
  15402. e.focus();
  15403. e.fire("saveSnapshot");
  15404. if ("?" == a) e.getColorFromDialog(function(a) {
  15405. if (a) return c(a)
  15406. });
  15407. else return c(a)
  15408. });
  15409. !1 !== l.colorButton_enableAutomatic && a.push('\x3ca class\x3d"cke_colorauto" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"',
  15410. h.auto, '" onclick\x3d"CKEDITOR.tools.callFunction(', q, ",null,'", d, "');return false;\" href\x3d\"javascript:void('", h.auto, '\')" role\x3d"option" aria-posinset\x3d"1" aria-setsize\x3d"', m, '"\x3e\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e\x3ctr\x3e\x3ctd colspan\x3d"' + k + '" align\x3d"center"\x3e\x3cspan class\x3d"cke_colorbox" id\x3d"', g, '"\x3e\x3c/span\x3e', h.auto, "\x3c/td\x3e\x3c/tr\x3e\x3c/table\x3e\x3c/a\x3e");
  15411. a.push('\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e');
  15412. for (g = 0; g < r.length; g++) {
  15413. 0 === g % k && a.push("\x3c/tr\x3e\x3ctr\x3e");
  15414. var n = r[g].split("/"),
  15415. b = n[0],
  15416. c = n[1] || b;
  15417. n[1] ? n = b : (b = "#" + b.replace(/^(.)(.)(.)$/, "$1$1$2$2$3$3"), n = e.lang.colorbutton.colors[c] || c);
  15418. a.push('\x3ctd\x3e\x3ca class\x3d"cke_colorbox" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"', n, '" onclick\x3d"CKEDITOR.tools.callFunction(', q, ",'", b, "','", d, "'); return false;\" href\x3d\"javascript:void('", n, '\')" data-value\x3d"' + c + '" role\x3d"option" aria-posinset\x3d"', g + 2, '" aria-setsize\x3d"', m, '"\x3e\x3cspan class\x3d"cke_colorbox" style\x3d"background-color:#',
  15419. c, '"\x3e\x3c/span\x3e\x3c/a\x3e\x3c/td\x3e')
  15420. }
  15421. p && a.push('\x3c/tr\x3e\x3ctr\x3e\x3ctd colspan\x3d"' + k + '" align\x3d"center"\x3e\x3ca class\x3d"cke_colormore" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"', h.more, '" onclick\x3d"CKEDITOR.tools.callFunction(', q, ",'?','", d, "');return false;\" href\x3d\"javascript:void('", h.more, "')\"", ' role\x3d"option" aria-posinset\x3d"', m, '" aria-setsize\x3d"', m, '"\x3e', h.more, "\x3c/a\x3e\x3c/td\x3e");
  15422. a.push("\x3c/tr\x3e\x3c/table\x3e");
  15423. return a.join("")
  15424. }
  15425. function v(a) {
  15426. return "false" ==
  15427. a.getAttribute("contentEditable") || a.getAttribute("data-nostyle")
  15428. }
  15429. function u(a) {
  15430. return CKEDITOR.tools.normalizeHex("#" + CKEDITOR.tools.convertRgbToHex(a || "")).replace(/#/g, "")
  15431. }
  15432. var l = e.config,
  15433. h = e.lang.colorbutton;
  15434. if (!CKEDITOR.env.hc) {
  15435. t("TextColor", "fore", h.textColorTitle, 10, {
  15436. contentTransformations: [
  15437. [{
  15438. element: "font",
  15439. check: "span{color}",
  15440. left: function(a) {
  15441. return !!a.attributes.color
  15442. },
  15443. right: function(a) {
  15444. a.name = "span";
  15445. a.attributes.color && (a.styles.color = a.attributes.color);
  15446. delete a.attributes.color
  15447. }
  15448. }]
  15449. ]
  15450. });
  15451. var w = {},
  15452. x = e.config.colorButton_normalizeBackground;
  15453. if (void 0 === x || x) w.contentTransformations = [
  15454. [{
  15455. element: "span",
  15456. left: function(a) {
  15457. var d = CKEDITOR.tools;
  15458. if ("span" != a.name || !a.styles || !a.styles.background) return !1;
  15459. a = d.style.parse.background(a.styles.background);
  15460. return a.color && 1 === d.objectKeys(a).length
  15461. },
  15462. right: function(a) {
  15463. var d = (new CKEDITOR.style(e.config.colorButton_backStyle, {
  15464. color: a.styles.background
  15465. })).getDefinition();
  15466. a.name = d.element;
  15467. a.styles = d.styles;
  15468. a.attributes = d.attributes || {};
  15469. return a
  15470. }
  15471. }]
  15472. ];
  15473. t("BGColor",
  15474. "back", h.bgColorTitle, 20, w)
  15475. }
  15476. }
  15477. });
  15478. 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";
  15479. CKEDITOR.config.colorButton_foreStyle = {
  15480. element: "span",
  15481. styles: {
  15482. color: "#(color)"
  15483. },
  15484. overrides: [{
  15485. element: "font",
  15486. attributes: {
  15487. color: null
  15488. }
  15489. }]
  15490. };
  15491. CKEDITOR.config.colorButton_backStyle = {
  15492. element: "span",
  15493. styles: {
  15494. "background-color": "#(color)"
  15495. }
  15496. };
  15497. CKEDITOR.plugins.colordialog = {
  15498. requires: "dialog",
  15499. init: function(b) {
  15500. var d = new CKEDITOR.dialogCommand("colordialog");
  15501. d.editorFocus = !1;
  15502. b.addCommand("colordialog", d);
  15503. CKEDITOR.dialog.add("colordialog", this.path + "dialogs/colordialog.js");
  15504. b.getColorFromDialog = function(d, g) {
  15505. var c, f, e;
  15506. c = function(a) {
  15507. f(this);
  15508. a = "ok" == a.name ? this.getValueOf("picker", "selectedColor") : null;
  15509. /^[0-9a-f]{3}([0-9a-f]{3})?$/i.test(a) && (a = "#" + a);
  15510. d.call(g, a)
  15511. };
  15512. f = function(a) {
  15513. a.removeListener("ok", c);
  15514. a.removeListener("cancel", c)
  15515. };
  15516. e = function(a) {
  15517. a.on("ok",
  15518. c);
  15519. a.on("cancel", c)
  15520. };
  15521. b.execCommand("colordialog");
  15522. if (b._.storedDialogs && b._.storedDialogs.colordialog) e(b._.storedDialogs.colordialog);
  15523. else CKEDITOR.on("dialogDefinition", function(a) {
  15524. if ("colordialog" == a.data.name) {
  15525. var b = a.data.definition;
  15526. a.removeListener();
  15527. b.onLoad = CKEDITOR.tools.override(b.onLoad, function(a) {
  15528. return function() {
  15529. e(this);
  15530. b.onLoad = a;
  15531. "function" == typeof a && a.call(this)
  15532. }
  15533. })
  15534. }
  15535. })
  15536. }
  15537. }
  15538. };
  15539. CKEDITOR.plugins.add("colordialog", CKEDITOR.plugins.colordialog);
  15540. (function() {
  15541. CKEDITOR.plugins.add("templates", {
  15542. requires: "dialog",
  15543. init: function(a) {
  15544. CKEDITOR.dialog.add("templates", CKEDITOR.getUrl(this.path + "dialogs/templates.js"));
  15545. a.addCommand("templates", new CKEDITOR.dialogCommand("templates"));
  15546. a.ui.addButton && a.ui.addButton("Templates", {
  15547. label: a.lang.templates.button,
  15548. command: "templates",
  15549. toolbar: "doctools,10"
  15550. })
  15551. }
  15552. });
  15553. var c = {},
  15554. f = {};
  15555. CKEDITOR.addTemplates = function(a, d) {
  15556. c[a] = d
  15557. };
  15558. CKEDITOR.getTemplates = function(a) {
  15559. return c[a]
  15560. };
  15561. CKEDITOR.loadTemplates = function(a, d) {
  15562. for (var e = [], b = 0, c = a.length; b < c; b++) f[a[b]] || (e.push(a[b]), f[a[b]] = 1);
  15563. e.length ? CKEDITOR.scriptLoader.load(e, d) : setTimeout(d, 0)
  15564. }
  15565. })();
  15566. CKEDITOR.config.templates_files = [CKEDITOR.getUrl("plugins/templates/templates/default.js")];
  15567. CKEDITOR.config.templates_replaceContent = !0;
  15568. CKEDITOR.plugins.add("menu", {
  15569. requires: "floatpanel",
  15570. beforeInit: function(l) {
  15571. for (var h = l.config.menu_groups.split(","), r = l._.menuGroups = {}, t = l._.menuItems = {}, n = 0; n < h.length; n++) r[h[n]] = n + 1;
  15572. l.addMenuGroup = function(a, b) {
  15573. r[a] = b || 100
  15574. };
  15575. l.addMenuItem = function(a, b) {
  15576. r[b.group] && (t[a] = new CKEDITOR.menuItem(this, a, b))
  15577. };
  15578. l.addMenuItems = function(a) {
  15579. for (var b in a) this.addMenuItem(b, a[b])
  15580. };
  15581. l.getMenuItem = function(a) {
  15582. return t[a]
  15583. };
  15584. l.removeMenuItem = function(a) {
  15585. delete t[a]
  15586. }
  15587. }
  15588. });
  15589. (function() {
  15590. function l(a) {
  15591. a.sort(function(a, d) {
  15592. return a.group < d.group ? -1 : a.group > d.group ? 1 : a.order < d.order ? -1 : a.order > d.order ? 1 : 0
  15593. })
  15594. }
  15595. var h = '\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"{label}" aria-describedby\x3d"{id}_description" aria-haspopup\x3d"{hasPopup}" aria-disabled\x3d"{disabled}" {ariaChecked} draggable\x3d"false"';
  15596. CKEDITOR.env.gecko && CKEDITOR.env.mac && (h += ' onkeypress\x3d"return false;"');
  15597. CKEDITOR.env.gecko && (h += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;" ondragstart\x3d"return false;"');
  15598. var h = h + (' onmouseover\x3d"CKEDITOR.tools.callFunction({hoverFn},{index});" onmouseout\x3d"CKEDITOR.tools.callFunction({moveOutFn},{index});" ' + (CKEDITOR.env.ie ? 'onclick\x3d"return false;" onmouseup' : "onclick") + '\x3d"CKEDITOR.tools.callFunction({clickFn},{index}); return false;"\x3e'),
  15599. r = CKEDITOR.addTemplate("menuItem",
  15600. h + '\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'),
  15601. t = CKEDITOR.addTemplate("menuArrow", '\x3cspan class\x3d"cke_menuarrow"\x3e\x3cspan\x3e{label}\x3c/span\x3e\x3c/span\x3e'),
  15602. n = CKEDITOR.addTemplate("menuShortcut", '\x3cspan class\x3d"cke_menubutton_label cke_menubutton_shortcut"\x3e{shortcut}\x3c/span\x3e');
  15603. CKEDITOR.menu = CKEDITOR.tools.createClass({
  15604. $: function(a, b) {
  15605. b = this._.definition = b || {};
  15606. this.id = CKEDITOR.tools.getNextId();
  15607. this.editor = a;
  15608. this.items = [];
  15609. this._.listeners = [];
  15610. this._.level = b.level || 1;
  15611. var d = CKEDITOR.tools.extend({}, b.panel, {
  15612. css: [CKEDITOR.skin.getPath("editor")],
  15613. level: this._.level - 1,
  15614. block: {}
  15615. }),
  15616. m = d.block.attributes = d.attributes || {};
  15617. !m.role && (m.role = "menu");
  15618. this._.panelDefinition =
  15619. d
  15620. },
  15621. _: {
  15622. onShow: function() {
  15623. var a = this.editor.getSelection(),
  15624. b = a && a.getStartElement(),
  15625. d = this.editor.elementPath(),
  15626. m = this._.listeners;
  15627. this.removeAll();
  15628. for (var g = 0; g < m.length; g++) {
  15629. var k = m[g](b, a, d);
  15630. if (k)
  15631. for (var e in k) {
  15632. var f = this.editor.getMenuItem(e);
  15633. !f || f.command && !this.editor.getCommand(f.command).state || (f.state = k[e], this.add(f))
  15634. }
  15635. }
  15636. },
  15637. onClick: function(a) {
  15638. this.hide();
  15639. if (a.onClick) a.onClick();
  15640. else a.command && this.editor.execCommand(a.command)
  15641. },
  15642. onEscape: function(a) {
  15643. var b = this.parent;
  15644. b ? b._.panel.hideChild(1) :
  15645. 27 == a && this.hide(1);
  15646. return !1
  15647. },
  15648. onHide: function() {
  15649. this.onHide && this.onHide()
  15650. },
  15651. showSubMenu: function(a) {
  15652. var b = this._.subMenu,
  15653. d = this.items[a];
  15654. if (d = d.getItems && d.getItems()) {
  15655. b ? b.removeAll() : (b = this._.subMenu = new CKEDITOR.menu(this.editor, CKEDITOR.tools.extend({}, this._.definition, {
  15656. level: this._.level + 1
  15657. }, !0)), b.parent = this, b._.onClick = CKEDITOR.tools.bind(this._.onClick, this));
  15658. for (var m in d) {
  15659. var g = this.editor.getMenuItem(m);
  15660. g && (g.state = d[m], b.add(g))
  15661. }
  15662. var k = this._.panel.getBlock(this.id).element.getDocument().getById(this.id +
  15663. String(a));
  15664. setTimeout(function() {
  15665. b.show(k, 2)
  15666. }, 0)
  15667. } else this._.panel.hideChild(1)
  15668. }
  15669. },
  15670. proto: {
  15671. add: function(a) {
  15672. a.order || (a.order = this.items.length);
  15673. this.items.push(a)
  15674. },
  15675. removeAll: function() {
  15676. this.items = []
  15677. },
  15678. show: function(a, b, d, m) {
  15679. if (!this.parent && (this._.onShow(), !this.items.length)) return;
  15680. b = b || ("rtl" == this.editor.lang.dir ? 2 : 1);
  15681. var g = this.items,
  15682. k = this.editor,
  15683. e = this._.panel,
  15684. f = this._.element;
  15685. if (!e) {
  15686. e = this._.panel = new CKEDITOR.ui.floatPanel(this.editor, CKEDITOR.document.getBody(), this._.panelDefinition, this._.level);
  15687. e.onEscape = CKEDITOR.tools.bind(function(a) {
  15688. if (!1 === this._.onEscape(a)) return !1
  15689. }, this);
  15690. e.onShow = function() {
  15691. e._.panel.getHolderElement().getParent().addClass("cke").addClass("cke_reset_all")
  15692. };
  15693. e.onHide = CKEDITOR.tools.bind(function() {
  15694. this._.onHide && this._.onHide()
  15695. }, this);
  15696. f = e.addBlock(this.id, this._.panelDefinition.block);
  15697. f.autoSize = !0;
  15698. var c = f.keys;
  15699. c[40] = "next";
  15700. c[9] = "next";
  15701. c[38] = "prev";
  15702. c[CKEDITOR.SHIFT + 9] = "prev";
  15703. c["rtl" == k.lang.dir ? 37 : 39] = CKEDITOR.env.ie ? "mouseup" : "click";
  15704. c[32] = CKEDITOR.env.ie ? "mouseup" :
  15705. "click";
  15706. CKEDITOR.env.ie && (c[13] = "mouseup");
  15707. f = this._.element = f.element;
  15708. c = f.getDocument();
  15709. c.getBody().setStyle("overflow", "hidden");
  15710. c.getElementsByTag("html").getItem(0).setStyle("overflow", "hidden");
  15711. this._.itemOverFn = CKEDITOR.tools.addFunction(function(a) {
  15712. clearTimeout(this._.showSubTimeout);
  15713. this._.showSubTimeout = CKEDITOR.tools.setTimeout(this._.showSubMenu, k.config.menu_subMenuDelay || 400, this, [a])
  15714. }, this);
  15715. this._.itemOutFn = CKEDITOR.tools.addFunction(function() {
  15716. clearTimeout(this._.showSubTimeout)
  15717. }, this);
  15718. this._.itemClickFn = CKEDITOR.tools.addFunction(function(a) {
  15719. var b = this.items[a];
  15720. if (b.state == CKEDITOR.TRISTATE_DISABLED) this.hide(1);
  15721. else if (b.getItems) this._.showSubMenu(a);
  15722. else this._.onClick(b)
  15723. }, this)
  15724. }
  15725. l(g);
  15726. for (var c = k.elementPath(), c = ['\x3cdiv class\x3d"cke_menu' + (c && c.direction() != k.lang.dir ? " cke_mixed_dir_content" : "") + '" role\x3d"presentation"\x3e'], h = g.length, n = h && g[0].group, q = 0; q < h; q++) {
  15727. var p = g[q];
  15728. n != p.group && (c.push('\x3cdiv class\x3d"cke_menuseparator" role\x3d"separator"\x3e\x3c/div\x3e'),
  15729. n = p.group);
  15730. p.render(this, q, c)
  15731. }
  15732. c.push("\x3c/div\x3e");
  15733. f.setHtml(c.join(""));
  15734. CKEDITOR.ui.fire("ready", this);
  15735. this.parent ? this.parent._.panel.showAsChild(e, this.id, a, b, d, m) : e.showBlock(this.id, a, b, d, m);
  15736. k.fire("menuShow", [e])
  15737. },
  15738. addListener: function(a) {
  15739. this._.listeners.push(a)
  15740. },
  15741. hide: function(a) {
  15742. this._.onHide && this._.onHide();
  15743. this._.panel && this._.panel.hide(a)
  15744. },
  15745. findItemByCommandName: function(a) {
  15746. var b = CKEDITOR.tools.array.filter(this.items, function(b) {
  15747. return a === b.command
  15748. });
  15749. return b.length ? (b = b[0], {
  15750. item: b,
  15751. element: this._.element.findOne("." + b.className)
  15752. }) : null
  15753. }
  15754. }
  15755. });
  15756. CKEDITOR.menuItem = CKEDITOR.tools.createClass({
  15757. $: function(a, b, d) {
  15758. CKEDITOR.tools.extend(this, d, {
  15759. order: 0,
  15760. className: "cke_menubutton__" + b
  15761. });
  15762. this.group = a._.menuGroups[this.group];
  15763. this.editor = a;
  15764. this.name = b
  15765. },
  15766. proto: {
  15767. render: function(a, b, d) {
  15768. var h = a.id + String(b),
  15769. g = "undefined" == typeof this.state ? CKEDITOR.TRISTATE_OFF : this.state,
  15770. k = "",
  15771. e = this.editor,
  15772. f, c, l = g == CKEDITOR.TRISTATE_ON ? "on" : g == CKEDITOR.TRISTATE_DISABLED ? "disabled" : "off";
  15773. this.role in {
  15774. menuitemcheckbox: 1,
  15775. menuitemradio: 1
  15776. } && (k = ' aria-checked\x3d"' + (g == CKEDITOR.TRISTATE_ON ? "true" : "false") + '"');
  15777. var u = this.getItems,
  15778. q = "\x26#" + ("rtl" == this.editor.lang.dir ? "9668" : "9658") + ";",
  15779. p = this.name;
  15780. this.icon && !/\./.test(this.icon) && (p = this.icon);
  15781. this.command && (f = e.getCommand(this.command), (f = e.getCommandKeystroke(f)) && (c = CKEDITOR.tools.keystrokeToString(e.lang.common.keyboard, f)));
  15782. a = {
  15783. id: h,
  15784. name: this.name,
  15785. iconName: p,
  15786. label: this.label,
  15787. cls: this.className || "",
  15788. state: l,
  15789. hasPopup: u ? "true" : "false",
  15790. disabled: g == CKEDITOR.TRISTATE_DISABLED,
  15791. title: this.label + (c ? " (" + c.display + ")" : ""),
  15792. ariaShortcut: c ? e.lang.common.keyboardShortcut + " " + c.aria : "",
  15793. href: "javascript:void('" + (this.label || "").replace("'") + "')",
  15794. hoverFn: a._.itemOverFn,
  15795. moveOutFn: a._.itemOutFn,
  15796. clickFn: a._.itemClickFn,
  15797. index: b,
  15798. iconStyle: CKEDITOR.skin.getIconStyle(p, "rtl" == this.editor.lang.dir, p == this.icon ? null : this.icon, this.iconOffset),
  15799. shortcutHtml: c ? n.output({
  15800. shortcut: c.display
  15801. }) : "",
  15802. arrowHtml: u ? t.output({
  15803. label: q
  15804. }) : "",
  15805. role: this.role ? this.role : "menuitem",
  15806. ariaChecked: k
  15807. };
  15808. r.output(a, d)
  15809. }
  15810. }
  15811. })
  15812. })();
  15813. CKEDITOR.config.menu_groups = "clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div";
  15814. CKEDITOR.plugins.add("contextmenu", {
  15815. requires: "menu",
  15816. onLoad: function() {
  15817. CKEDITOR.plugins.contextMenu = CKEDITOR.tools.createClass({
  15818. base: CKEDITOR.menu,
  15819. $: function(a) {
  15820. this.base.call(this, a, {
  15821. panel: {
  15822. className: "cke_menu_panel",
  15823. attributes: {
  15824. "aria-label": a.lang.contextmenu.options
  15825. }
  15826. }
  15827. })
  15828. },
  15829. proto: {
  15830. addTarget: function(a, e) {
  15831. a.on("contextmenu", function(a) {
  15832. a = a.data;
  15833. var c = CKEDITOR.env.webkit ? f : CKEDITOR.env.mac ? a.$.metaKey : a.$.ctrlKey;
  15834. if (!e || !c) {
  15835. a.preventDefault();
  15836. if (CKEDITOR.env.mac && CKEDITOR.env.webkit) {
  15837. var c = this.editor,
  15838. b = (new CKEDITOR.dom.elementPath(a.getTarget(), c.editable())).contains(function(a) {
  15839. return a.hasAttribute("contenteditable")
  15840. }, !0);
  15841. b && "false" == b.getAttribute("contenteditable") && c.getSelection().fake(b)
  15842. }
  15843. var b = a.getTarget().getDocument(),
  15844. d = a.getTarget().getDocument().getDocumentElement(),
  15845. c = !b.equals(CKEDITOR.document),
  15846. b = b.getWindow().getScrollPosition(),
  15847. g = c ? a.$.clientX : a.$.pageX || b.x + a.$.clientX,
  15848. h = c ? a.$.clientY : a.$.pageY || b.y + a.$.clientY;
  15849. CKEDITOR.tools.setTimeout(function() {
  15850. this.open(d, null, g, h)
  15851. }, CKEDITOR.env.ie ?
  15852. 200 : 0, this)
  15853. }
  15854. }, this);
  15855. if (CKEDITOR.env.webkit) {
  15856. var f, d = function() {
  15857. f = 0
  15858. };
  15859. a.on("keydown", function(a) {
  15860. f = CKEDITOR.env.mac ? a.data.$.metaKey : a.data.$.ctrlKey
  15861. });
  15862. a.on("keyup", d);
  15863. a.on("contextmenu", d)
  15864. }
  15865. },
  15866. open: function(a, e, f, d) {
  15867. !1 !== this.editor.config.enableContextMenu && (this.editor.focus(), a = a || CKEDITOR.document.getDocumentElement(), this.editor.selectionChange(1), this.show(a, e, f, d))
  15868. }
  15869. }
  15870. })
  15871. },
  15872. beforeInit: function(a) {
  15873. var e = a.contextMenu = new CKEDITOR.plugins.contextMenu(a);
  15874. a.on("contentDom", function() {
  15875. e.addTarget(a.editable(),
  15876. !1 !== a.config.browserContextMenuOnCtrl)
  15877. });
  15878. a.addCommand("contextMenu", {
  15879. exec: function() {
  15880. a.contextMenu.open(a.document.getBody())
  15881. }
  15882. });
  15883. a.setKeystroke(CKEDITOR.SHIFT + 121, "contextMenu");
  15884. a.setKeystroke(CKEDITOR.CTRL + CKEDITOR.SHIFT + 121, "contextMenu")
  15885. }
  15886. });
  15887. (function() {
  15888. function k(a, b, d, e) {
  15889. var c = new CKEDITOR.dom.walker(a);
  15890. if (a = a.startContainer.getAscendant(b, !0) || a.endContainer.getAscendant(b, !0))
  15891. if (d(a), e) return;
  15892. for (; a = c.next();)
  15893. if (a = a.getAscendant(b, !0))
  15894. if (d(a), e) break
  15895. }
  15896. function u(a, b) {
  15897. var d = {
  15898. ul: "ol",
  15899. ol: "ul"
  15900. };
  15901. return -1 !== l(b, function(b) {
  15902. return b.element === a || b.element === d[a]
  15903. })
  15904. }
  15905. function q(a) {
  15906. this.styles = null;
  15907. this.sticky = !1;
  15908. this.editor = a;
  15909. this.filter = new CKEDITOR.filter(a.config.copyFormatting_allowRules);
  15910. !0 === a.config.copyFormatting_allowRules && (this.filter.disabled = !0);
  15911. a.config.copyFormatting_disallowRules && this.filter.disallow(a.config.copyFormatting_disallowRules)
  15912. }
  15913. var l = CKEDITOR.tools.indexOf,
  15914. r = CKEDITOR.tools.getMouseButton,
  15915. t = !1;
  15916. CKEDITOR.plugins.add("copyformatting", {
  15917. lang: "az,de,en,it,ja,nb,nl,oc,pl,pt-br,ru,sv,tr,zh,zh-cn",
  15918. icons: "copyformatting",
  15919. hidpi: !0,
  15920. init: function(a) {
  15921. var b = CKEDITOR.plugins.copyformatting;
  15922. b._addScreenReaderContainer();
  15923. t || (CKEDITOR.document.appendStyleSheet(this.path + "styles/copyformatting.css"), t = !0);
  15924. a.addContentsCss && a.addContentsCss(this.path +
  15925. "styles/copyformatting.css");
  15926. a.copyFormatting = new b.state(a);
  15927. a.addCommand("copyFormatting", b.commands.copyFormatting);
  15928. a.addCommand("applyFormatting", b.commands.applyFormatting);
  15929. a.ui.addButton("CopyFormatting", {
  15930. label: a.lang.copyformatting.label,
  15931. command: "copyFormatting",
  15932. toolbar: "cleanup,0"
  15933. });
  15934. a.on("contentDom", function() {
  15935. var d = a.editable(),
  15936. b = d.isInline() ? d : a.document,
  15937. c = a.ui.get("CopyFormatting");
  15938. d.attachListener(b, "mouseup", function(b) {
  15939. r(b) === CKEDITOR.MOUSE_BUTTON_LEFT && a.execCommand("applyFormatting")
  15940. });
  15941. d.attachListener(CKEDITOR.document, "mouseup", function(b) {
  15942. var e = a.getCommand("copyFormatting");
  15943. r(b) !== CKEDITOR.MOUSE_BUTTON_LEFT || e.state !== CKEDITOR.TRISTATE_ON || d.contains(b.data.getTarget()) || a.execCommand("copyFormatting")
  15944. });
  15945. c && (b = CKEDITOR.document.getById(c._.id), d.attachListener(b, "dblclick", function() {
  15946. a.execCommand("copyFormatting", {
  15947. sticky: !0
  15948. })
  15949. }), d.attachListener(b, "mouseup", function(a) {
  15950. a.data.stopPropagation()
  15951. }))
  15952. });
  15953. a.config.copyFormatting_keystrokeCopy && a.setKeystroke(a.config.copyFormatting_keystrokeCopy,
  15954. "copyFormatting");
  15955. a.on("key", function(b) {
  15956. var e = a.getCommand("copyFormatting");
  15957. b = b.data.domEvent;
  15958. b.getKeystroke && 27 === b.getKeystroke() && e.state === CKEDITOR.TRISTATE_ON && a.execCommand("copyFormatting")
  15959. });
  15960. a.copyFormatting.on("extractFormatting", function(d) {
  15961. var e = d.data.element;
  15962. if (e.contains(a.editable()) || e.equals(a.editable())) return d.cancel();
  15963. e = b._convertElementToStyleDef(e);
  15964. if (!a.copyFormatting.filter.check(new CKEDITOR.style(e), !0, !0)) return d.cancel();
  15965. d.data.styleDef = e
  15966. });
  15967. a.copyFormatting.on("applyFormatting",
  15968. function(d) {
  15969. if (!d.data.preventFormatStripping) {
  15970. var e = d.data.range,
  15971. c = b._extractStylesFromRange(a, e),
  15972. f = b._determineContext(e),
  15973. g, h;
  15974. if (a.copyFormatting._isContextAllowed(f))
  15975. for (h = 0; h < c.length; h++) f = c[h], g = e.createBookmark(), -1 === l(b.preservedElements, f.element) ? CKEDITOR.env.webkit && !CKEDITOR.env.chrome ? c[h].removeFromRange(d.data.range, d.editor) : c[h].remove(d.editor) : u(f.element, d.data.styles) && b._removeStylesFromElementInRange(e, f.element), e.moveToBookmark(g)
  15976. }
  15977. });
  15978. a.copyFormatting.on("applyFormatting",
  15979. function(b) {
  15980. var e = CKEDITOR.plugins.copyformatting,
  15981. c = e._determineContext(b.data.range);
  15982. "list" === c && a.copyFormatting._isContextAllowed("list") ? e._applyStylesToListContext(b.editor, b.data.range, b.data.styles) : "table" === c && a.copyFormatting._isContextAllowed("table") ? e._applyStylesToTableContext(b.editor, b.data.range, b.data.styles) : a.copyFormatting._isContextAllowed("text") && e._applyStylesToTextContext(b.editor, b.data.range, b.data.styles)
  15983. }, null, null, 999)
  15984. }
  15985. });
  15986. q.prototype._isContextAllowed = function(a) {
  15987. var b =
  15988. this.editor.config.copyFormatting_allowedContexts;
  15989. return !0 === b || -1 !== l(b, a)
  15990. };
  15991. CKEDITOR.event.implementOn(q.prototype);
  15992. CKEDITOR.plugins.copyformatting = {
  15993. state: q,
  15994. inlineBoundary: "h1 h2 h3 h4 h5 h6 p div".split(" "),
  15995. excludedAttributes: ["id", "style", "href", "data-cke-saved-href", "dir"],
  15996. elementsForInlineTransform: ["li"],
  15997. excludedElementsFromInlineTransform: ["table", "thead", "tbody", "ul", "ol"],
  15998. excludedAttributesFromInlineTransform: ["value", "type"],
  15999. preservedElements: "ul ol li td th tr thead tbody table".split(" "),
  16000. breakOnElements: ["ul", "ol", "table"],
  16001. _initialKeystrokePasteCommand: null,
  16002. commands: {
  16003. copyFormatting: {
  16004. exec: function(a, b) {
  16005. var d = CKEDITOR.plugins.copyformatting,
  16006. e = a.copyFormatting,
  16007. c = b ? "keystrokeHandler" == b.from : !1,
  16008. f = b ? b.sticky || c : !1,
  16009. g = d._getCursorContainer(a),
  16010. h = CKEDITOR.document.getDocumentElement();
  16011. if (this.state === CKEDITOR.TRISTATE_ON) return e.styles = null, e.sticky = !1, g.removeClass("cke_copyformatting_active"), h.removeClass("cke_copyformatting_disabled"), h.removeClass("cke_copyformatting_tableresize_cursor"),
  16012. d._putScreenReaderMessage(a, "canceled"), d._detachPasteKeystrokeHandler(a), this.setState(CKEDITOR.TRISTATE_OFF);
  16013. e.styles = d._extractStylesFromElement(a, a.elementPath().lastElement);
  16014. this.setState(CKEDITOR.TRISTATE_ON);
  16015. c || (g.addClass("cke_copyformatting_active"), h.addClass("cke_copyformatting_tableresize_cursor"), a.config.copyFormatting_outerCursor && h.addClass("cke_copyformatting_disabled"));
  16016. e.sticky = f;
  16017. d._putScreenReaderMessage(a, "copied");
  16018. d._attachPasteKeystrokeHandler(a)
  16019. }
  16020. },
  16021. applyFormatting: {
  16022. editorFocus: CKEDITOR.env.ie &&
  16023. !CKEDITOR.env.edge ? !1 : !0,
  16024. exec: function(a, b) {
  16025. var d = a.getCommand("copyFormatting"),
  16026. e = b ? "keystrokeHandler" == b.from : !1,
  16027. c = CKEDITOR.plugins.copyformatting,
  16028. f = a.copyFormatting,
  16029. g = c._getCursorContainer(a),
  16030. h = CKEDITOR.document.getDocumentElement();
  16031. if (e || d.state === CKEDITOR.TRISTATE_ON) {
  16032. if (e && !f.styles) return c._putScreenReaderMessage(a, "failed"), c._detachPasteKeystrokeHandler(a), !1;
  16033. e = c._applyFormat(a, f.styles);
  16034. f.sticky || (f.styles = null, g.removeClass("cke_copyformatting_active"), h.removeClass("cke_copyformatting_disabled"),
  16035. h.removeClass("cke_copyformatting_tableresize_cursor"), d.setState(CKEDITOR.TRISTATE_OFF), c._detachPasteKeystrokeHandler(a));
  16036. c._putScreenReaderMessage(a, e ? "applied" : "canceled")
  16037. }
  16038. }
  16039. }
  16040. },
  16041. _getCursorContainer: function(a) {
  16042. return a.elementMode === CKEDITOR.ELEMENT_MODE_INLINE ? a.editable() : a.editable().getParent()
  16043. },
  16044. _convertElementToStyleDef: function(a) {
  16045. var b = CKEDITOR.tools,
  16046. d = a.getAttributes(CKEDITOR.plugins.copyformatting.excludedAttributes),
  16047. b = b.parseCssText(a.getAttribute("style"), !0, !0);
  16048. return {
  16049. element: a.getName(),
  16050. type: CKEDITOR.STYLE_INLINE,
  16051. attributes: d,
  16052. styles: b
  16053. }
  16054. },
  16055. _extractStylesFromElement: function(a, b) {
  16056. var d = {},
  16057. e = [];
  16058. do
  16059. if (b.type === CKEDITOR.NODE_ELEMENT && !b.hasAttribute("data-cke-bookmark") && (d.element = b, a.copyFormatting.fire("extractFormatting", d, a) && d.styleDef && e.push(new CKEDITOR.style(d.styleDef)), b.getName && -1 !== l(CKEDITOR.plugins.copyformatting.breakOnElements, b.getName()))) break; while ((b = b.getParent()) && b.type === CKEDITOR.NODE_ELEMENT);
  16060. return e
  16061. },
  16062. _extractStylesFromRange: function(a, b) {
  16063. for (var d = [], e = new CKEDITOR.dom.walker(b),
  16064. c; c = e.next();) d = d.concat(CKEDITOR.plugins.copyformatting._extractStylesFromElement(a, c));
  16065. return d
  16066. },
  16067. _removeStylesFromElementInRange: function(a, b) {
  16068. for (var d = -1 !== l(["ol", "ul", "table"], b), e = new CKEDITOR.dom.walker(a), c; c = e.next();)
  16069. if (c = c.getAscendant(b, !0))
  16070. if (c.removeAttributes(c.getAttributes()), d) break
  16071. },
  16072. _getSelectedWordOffset: function(a) {
  16073. function b(a, b) {
  16074. return a[b ? "getPrevious" : "getNext"](function(a) {
  16075. return a.type !== CKEDITOR.NODE_COMMENT
  16076. })
  16077. }
  16078. function d(a) {
  16079. return a.type == CKEDITOR.NODE_ELEMENT ? (a = a.getHtml().replace(/<span.*?>&nbsp;<\/span>/g,
  16080. ""), a.replace(/<.*?>/g, "")) : a.getText()
  16081. }
  16082. function e(a, c) {
  16083. var f = a,
  16084. g = /\s/g,
  16085. h = "p br ol ul li td th div caption body".split(" "),
  16086. m = !1,
  16087. k = !1,
  16088. p, n;
  16089. do {
  16090. for (p = b(f, c); !p && f.getParent();) {
  16091. f = f.getParent();
  16092. if (-1 !== l(h, f.getName())) {
  16093. k = m = !0;
  16094. break
  16095. }
  16096. p = b(f, c)
  16097. }
  16098. if (p && p.getName && -1 !== l(h, p.getName())) {
  16099. m = !0;
  16100. break
  16101. }
  16102. f = p
  16103. } while (f && f.getStyle && ("none" == f.getStyle("display") || !f.getText()));
  16104. for (f || (f = a); f.type !== CKEDITOR.NODE_TEXT;) f = !m || c || k ? f.getChild(0) : f.getChild(f.getChildCount() - 1);
  16105. for (h = d(f); null != (k = g.exec(h)) && (n = k.index,
  16106. c););
  16107. if ("number" !== typeof n && !m) return e(f, c);
  16108. if (m) c ? n = 0 : (g = /([\.\b]*$)/, n = (k = g.exec(h)) ? k.index : h.length);
  16109. else if (c && (n += 1, n > h.length)) return e(f);
  16110. return {
  16111. node: f,
  16112. offset: n
  16113. }
  16114. }
  16115. var c = /\b\w+\b/ig,
  16116. f, g, h, m, k;
  16117. h = m = k = a.startContainer;
  16118. for (f = d(h); null != (g = c.exec(f));)
  16119. if (g.index + g[0].length >= a.startOffset) return a = g.index, c = g.index + g[0].length, 0 === g.index && (g = e(h, !0), m = g.node, a = g.offset), c >= f.length && (f = e(h), k = f.node, c = f.offset), {
  16120. startNode: m,
  16121. startOffset: a,
  16122. endNode: k,
  16123. endOffset: c
  16124. };
  16125. return null
  16126. },
  16127. _filterStyles: function(a) {
  16128. var b =
  16129. CKEDITOR.tools.isEmpty,
  16130. d = [],
  16131. e, c;
  16132. for (c = 0; c < a.length; c++) e = a[c]._.definition, -1 !== CKEDITOR.tools.indexOf(CKEDITOR.plugins.copyformatting.inlineBoundary, e.element) && (e.element = a[c].element = "span"), "span" === e.element && b(e.attributes) && b(e.styles) || d.push(a[c]);
  16133. return d
  16134. },
  16135. _determineContext: function(a) {
  16136. function b(b) {
  16137. var e = new CKEDITOR.dom.walker(a),
  16138. c;
  16139. if (a.startContainer.getAscendant(b, !0) || a.endContainer.getAscendant(b, !0)) return !0;
  16140. for (; c = e.next();)
  16141. if (c.getAscendant(b, !0)) return !0
  16142. }
  16143. return b({
  16144. ul: 1,
  16145. ol: 1
  16146. }) ?
  16147. "list" : b("table") ? "table" : "text"
  16148. },
  16149. _applyStylesToTextContext: function(a, b, d) {
  16150. var e = CKEDITOR.plugins.copyformatting,
  16151. c = e.excludedAttributesFromInlineTransform,
  16152. f, g;
  16153. CKEDITOR.env.webkit && !CKEDITOR.env.chrome && a.getSelection().selectRanges([b]);
  16154. for (f = 0; f < d.length; f++)
  16155. if (b = d[f], -1 === l(e.excludedElementsFromInlineTransform, b.element)) {
  16156. if (-1 !== l(e.elementsForInlineTransform, b.element))
  16157. for (b.element = b._.definition.element = "span", g = 0; g < c.length; g++) b._.definition.attributes[c[g]] && delete b._.definition.attributes[c[g]];
  16158. b.apply(a)
  16159. }
  16160. },
  16161. _applyStylesToListContext: function(a, b, d) {
  16162. var e, c, f;
  16163. for (f = 0; f < d.length; f++) e = d[f], c = b.createBookmark(), "ol" === e.element || "ul" === e.element ? k(b, {
  16164. ul: 1,
  16165. ol: 1
  16166. }, function(a) {
  16167. var b = e;
  16168. a.getName() !== b.element && a.renameNode(b.element);
  16169. b.applyToObject(a)
  16170. }, !0) : "li" === e.element ? k(b, "li", function(a) {
  16171. e.applyToObject(a)
  16172. }) : CKEDITOR.plugins.copyformatting._applyStylesToTextContext(a, b, [e]), b.moveToBookmark(c)
  16173. },
  16174. _applyStylesToTableContext: function(a, b, d) {
  16175. function e(a, b) {
  16176. a.getName() !== b.element && (b = b.getDefinition(),
  16177. b.element = a.getName(), b = new CKEDITOR.style(b));
  16178. b.applyToObject(a)
  16179. }
  16180. var c, f, g;
  16181. for (g = 0; g < d.length; g++) c = d[g], f = b.createBookmark(), -1 !== l(["table", "tr"], c.element) ? k(b, c.element, function(a) {
  16182. c.applyToObject(a)
  16183. }) : -1 !== l(["td", "th"], c.element) ? k(b, {
  16184. td: 1,
  16185. th: 1
  16186. }, function(a) {
  16187. e(a, c)
  16188. }) : -1 !== l(["thead", "tbody"], c.element) ? k(b, {
  16189. thead: 1,
  16190. tbody: 1
  16191. }, function(a) {
  16192. e(a, c)
  16193. }) : CKEDITOR.plugins.copyformatting._applyStylesToTextContext(a, b, [c]), b.moveToBookmark(f)
  16194. },
  16195. _applyFormat: function(a, b) {
  16196. var d = a.getSelection().getRanges()[0],
  16197. e = CKEDITOR.plugins.copyformatting,
  16198. c, f;
  16199. if (!d) return !1;
  16200. if (d.collapsed) {
  16201. f = a.getSelection().createBookmarks();
  16202. if (!(c = e._getSelectedWordOffset(d))) return;
  16203. d = a.createRange();
  16204. d.setStart(c.startNode, c.startOffset);
  16205. d.setEnd(c.endNode, c.endOffset);
  16206. d.select()
  16207. }
  16208. b = e._filterStyles(b);
  16209. if (!a.copyFormatting.fire("applyFormatting", {
  16210. styles: b,
  16211. range: d,
  16212. preventFormatStripping: !1
  16213. }, a)) return !1;
  16214. f && a.getSelection().selectBookmarks(f);
  16215. return !0
  16216. },
  16217. _putScreenReaderMessage: function(a, b) {
  16218. var d = this._getScreenReaderContainer();
  16219. d && d.setText(a.lang.copyformatting.notification[b])
  16220. },
  16221. _addScreenReaderContainer: function() {
  16222. if (this._getScreenReaderContainer()) return this._getScreenReaderContainer();
  16223. 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)
  16224. },
  16225. _getScreenReaderContainer: function() {
  16226. if (!CKEDITOR.env.ie6Compat && !CKEDITOR.env.ie7Compat) return CKEDITOR.document.getBody().findOne(".cke_copyformatting_notification div[aria-live]")
  16227. },
  16228. _attachPasteKeystrokeHandler: function(a) {
  16229. var b = a.config.copyFormatting_keystrokePaste;
  16230. b && (this._initialKeystrokePasteCommand = a.keystrokeHandler.keystrokes[b], a.setKeystroke(b, "applyFormatting"))
  16231. },
  16232. _detachPasteKeystrokeHandler: function(a) {
  16233. var b = a.config.copyFormatting_keystrokePaste;
  16234. b && a.setKeystroke(b, this._initialKeystrokePasteCommand || !1)
  16235. }
  16236. };
  16237. CKEDITOR.config.copyFormatting_outerCursor = !0;
  16238. CKEDITOR.config.copyFormatting_allowRules = "b s u i em strong span p div td th ol ul li(*)[*]{*}";
  16239. CKEDITOR.config.copyFormatting_disallowRules =
  16240. "*[data-cke-widget*,data-widget*,data-cke-realelement](cke_widget*)";
  16241. CKEDITOR.config.copyFormatting_allowedContexts = !0;
  16242. CKEDITOR.config.copyFormatting_keystrokeCopy = CKEDITOR.CTRL + CKEDITOR.SHIFT + 67;
  16243. CKEDITOR.config.copyFormatting_keystrokePaste = CKEDITOR.CTRL + CKEDITOR.SHIFT + 86
  16244. })();
  16245. (function() {
  16246. CKEDITOR.plugins.add("div", {
  16247. requires: "dialog",
  16248. init: function(a) {
  16249. if (!a.blockless) {
  16250. var c = a.lang.div,
  16251. b = "div(*)";
  16252. CKEDITOR.dialog.isTabEnabled(a, "editdiv", "advanced") && (b += ";div[dir,id,lang,title]{*}");
  16253. a.addCommand("creatediv", new CKEDITOR.dialogCommand("creatediv", {
  16254. allowedContent: b,
  16255. requiredContent: "div",
  16256. contextSensitive: !0,
  16257. contentTransformations: [
  16258. ["div: alignmentToStyle"]
  16259. ],
  16260. refresh: function(a, c) {
  16261. this.setState("div" in (a.config.div_wrapTable ? c.root : c.blockLimit).getDtd() ? CKEDITOR.TRISTATE_OFF :
  16262. CKEDITOR.TRISTATE_DISABLED)
  16263. }
  16264. }));
  16265. a.addCommand("editdiv", new CKEDITOR.dialogCommand("editdiv", {
  16266. requiredContent: "div"
  16267. }));
  16268. a.addCommand("removediv", {
  16269. requiredContent: "div",
  16270. exec: function(a) {
  16271. function c(b) {
  16272. (b = CKEDITOR.plugins.div.getSurroundDiv(a, b)) && !b.data("cke-div-added") && (f.push(b), b.data("cke-div-added"))
  16273. }
  16274. 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());
  16275. for (d = 0; d < f.length; d++) f[d].remove(!0);
  16276. b.selectBookmarks(h)
  16277. }
  16278. });
  16279. a.ui.addButton && a.ui.addButton("CreateDiv", {
  16280. label: c.toolbar,
  16281. command: "creatediv",
  16282. toolbar: "blocks,50"
  16283. });
  16284. a.addMenuItems && (a.addMenuItems({
  16285. editdiv: {
  16286. label: c.edit,
  16287. command: "editdiv",
  16288. group: "div",
  16289. order: 1
  16290. },
  16291. removediv: {
  16292. label: c.remove,
  16293. command: "removediv",
  16294. group: "div",
  16295. order: 5
  16296. }
  16297. }), a.contextMenu && a.contextMenu.addListener(function(b) {
  16298. return !b || b.isReadOnly() ? null : CKEDITOR.plugins.div.getSurroundDiv(a) ? {
  16299. editdiv: CKEDITOR.TRISTATE_OFF,
  16300. removediv: CKEDITOR.TRISTATE_OFF
  16301. } :
  16302. null
  16303. }));
  16304. CKEDITOR.dialog.add("creatediv", this.path + "dialogs/div.js");
  16305. CKEDITOR.dialog.add("editdiv", this.path + "dialogs/div.js")
  16306. }
  16307. }
  16308. });
  16309. CKEDITOR.plugins.div = {
  16310. getSurroundDiv: function(a, c) {
  16311. var b = a.elementPath(c);
  16312. return a.elementPath(b.blockLimit).contains(function(a) {
  16313. return a.is("div") && !a.isReadOnly()
  16314. }, 1)
  16315. }
  16316. }
  16317. })();
  16318. CKEDITOR.plugins.add("resize", {
  16319. init: function(b) {
  16320. function f(d) {
  16321. var e = c.width,
  16322. m = c.height,
  16323. f = e + (d.data.$.screenX - n.x) * ("rtl" == g ? -1 : 1);
  16324. d = m + (d.data.$.screenY - n.y);
  16325. h && (e = Math.max(a.resize_minWidth, Math.min(f, a.resize_maxWidth)));
  16326. p && (m = Math.max(a.resize_minHeight, Math.min(d, a.resize_maxHeight)));
  16327. b.resize(h ? e : null, m)
  16328. }
  16329. function k() {
  16330. CKEDITOR.document.removeListener("mousemove", f);
  16331. CKEDITOR.document.removeListener("mouseup", k);
  16332. b.document && (b.document.removeListener("mousemove", f), b.document.removeListener("mouseup",
  16333. k))
  16334. }
  16335. var a = b.config,
  16336. r = b.ui.spaceId("resizer"),
  16337. g = b.element ? b.element.getDirection(1) : "ltr";
  16338. !a.resize_dir && (a.resize_dir = "vertical");
  16339. void 0 === a.resize_maxWidth && (a.resize_maxWidth = 3E3);
  16340. void 0 === a.resize_maxHeight && (a.resize_maxHeight = 3E3);
  16341. void 0 === a.resize_minWidth && (a.resize_minWidth = 750);
  16342. void 0 === a.resize_minHeight && (a.resize_minHeight = 250);
  16343. if (!1 !== a.resize_enabled) {
  16344. var l = null,
  16345. n, c, h = ("both" == a.resize_dir || "horizontal" == a.resize_dir) && a.resize_minWidth != a.resize_maxWidth,
  16346. p = ("both" == a.resize_dir || "vertical" ==
  16347. a.resize_dir) && a.resize_minHeight != a.resize_maxHeight,
  16348. q = CKEDITOR.tools.addFunction(function(d) {
  16349. l || (l = b.getResizable());
  16350. c = {
  16351. width: l.$.offsetWidth || 0,
  16352. height: l.$.offsetHeight || 0
  16353. };
  16354. n = {
  16355. x: d.screenX,
  16356. y: d.screenY
  16357. };
  16358. a.resize_minWidth > c.width && (a.resize_minWidth = c.width);
  16359. a.resize_minHeight > c.height && (a.resize_minHeight = c.height);
  16360. CKEDITOR.document.on("mousemove", f);
  16361. CKEDITOR.document.on("mouseup", k);
  16362. b.document && (b.document.on("mousemove", f), b.document.on("mouseup", k));
  16363. d.preventDefault && d.preventDefault()
  16364. });
  16365. b.on("destroy",
  16366. function() {
  16367. CKEDITOR.tools.removeFunction(q)
  16368. });
  16369. b.on("uiSpace", function(a) {
  16370. if ("bottom" == a.data.space) {
  16371. var e = "";
  16372. h && !p && (e = " cke_resizer_horizontal");
  16373. !h && p && (e = " cke_resizer_vertical");
  16374. 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' + ("ltr" == g ? "◢" : "◣") + "\x3c/span\x3e";
  16375. "ltr" == g && "ltr" == e ? a.data.html += c : a.data.html = c + a.data.html
  16376. }
  16377. }, b, null, 100);
  16378. b.on("maximize",
  16379. function(a) {
  16380. b.ui.space("resizer")[a.data == CKEDITOR.TRISTATE_ON ? "hide" : "show"]()
  16381. })
  16382. }
  16383. }
  16384. });
  16385. (function() {
  16386. function q(a, c) {
  16387. function k(b) {
  16388. b = h.list[b];
  16389. var e;
  16390. b.equals(a.editable()) || "true" == b.getAttribute("contenteditable") ? (e = a.createRange(), e.selectNodeContents(b), e = e.select()) : (e = a.getSelection(), e.selectElement(b));
  16391. CKEDITOR.env.ie && a.fire("selectionChange", {
  16392. selection: e,
  16393. path: new CKEDITOR.dom.elementPath(b)
  16394. });
  16395. a.focus()
  16396. }
  16397. function l() {
  16398. m && m.setHtml('\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e');
  16399. delete h.list
  16400. }
  16401. var n = a.ui.spaceId("path"),
  16402. m, h = a._.elementsPath,
  16403. q = h.idBase;
  16404. c.html += '\x3cspan id\x3d"' +
  16405. 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';
  16406. a.on("uiReady", function() {
  16407. var b = a.ui.space("path");
  16408. b && a.focusManager.add(b, 1)
  16409. });
  16410. h.onClick = k;
  16411. var v = CKEDITOR.tools.addFunction(k),
  16412. w = CKEDITOR.tools.addFunction(function(b, e) {
  16413. var g = h.idBase,
  16414. d;
  16415. e = new CKEDITOR.dom.event(e);
  16416. d = "rtl" == a.lang.dir;
  16417. switch (e.getKeystroke()) {
  16418. case d ?
  16419. 39:
  16420. 37: case 9: return (d = CKEDITOR.document.getById(g + (b + 1))) || (d = CKEDITOR.document.getById(g + "0")), d.focus(), !1;
  16421. case d ? 37:
  16422. 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;
  16423. case 27:
  16424. return a.focus(), !1;
  16425. case 13:
  16426. case 32:
  16427. return k(b), !1
  16428. }
  16429. return !0
  16430. });
  16431. a.on("selectionChange", function(b) {
  16432. for (var e = [], g = h.list = [], d = [], c = h.filters, p = !0, k = b.data.path.elements, u = k.length; u--;) {
  16433. var f = k[u],
  16434. r = 0;
  16435. b = f.data("cke-display-name") ? f.data("cke-display-name") :
  16436. f.data("cke-real-element-type") ? f.data("cke-real-element-type") : f.getName();
  16437. (p = f.hasAttribute("contenteditable") ? "true" == f.getAttribute("contenteditable") : p) || f.hasAttribute("contenteditable") || (r = 1);
  16438. for (var t = 0; t < c.length; t++) {
  16439. var l = c[t](f, b);
  16440. if (!1 === l) {
  16441. r = 1;
  16442. break
  16443. }
  16444. b = l || b
  16445. }
  16446. r || (g.unshift(f), d.unshift(b))
  16447. }
  16448. g = g.length;
  16449. for (c = 0; c < g; c++) b = d[c], p = a.lang.elementspath.eleTitle.replace(/%1/, b), b = x.output({
  16450. id: q + c,
  16451. label: p,
  16452. text: b,
  16453. jsTitle: "javascript:void('" + b + "')",
  16454. index: c,
  16455. keyDownFn: w,
  16456. clickFn: v
  16457. }), e.unshift(b);
  16458. m ||
  16459. (m = CKEDITOR.document.getById(n));
  16460. d = m;
  16461. d.setHtml(e.join("") + '\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e');
  16462. a.fire("elementsPathUpdate", {
  16463. space: d
  16464. })
  16465. });
  16466. a.on("readOnly", l);
  16467. a.on("contentDomUnload", l);
  16468. a.addCommand("elementsPathFocus", y.toolbarFocus);
  16469. a.setKeystroke(CKEDITOR.ALT + 122, "elementsPathFocus")
  16470. }
  16471. var y = {
  16472. toolbarFocus: {
  16473. editorFocus: !1,
  16474. readOnly: 1,
  16475. exec: function(a) {
  16476. (a = CKEDITOR.document.getById(a._.elementsPath.idBase + "0")) && a.focus(CKEDITOR.env.ie || CKEDITOR.env.air)
  16477. }
  16478. }
  16479. },
  16480. c = "";
  16481. CKEDITOR.env.gecko &&
  16482. CKEDITOR.env.mac && (c += ' onkeypress\x3d"return false;"');
  16483. CKEDITOR.env.gecko && (c += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');
  16484. 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" 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');
  16485. CKEDITOR.plugins.add("elementspath", {
  16486. init: function(a) {
  16487. a._.elementsPath = {
  16488. idBase: "cke_elementspath_" + CKEDITOR.tools.getNextNumber() + "_",
  16489. filters: []
  16490. };
  16491. a.on("uiSpace", function(c) {
  16492. "bottom" == c.data.space && q(a, c.data)
  16493. })
  16494. }
  16495. })
  16496. })();
  16497. (function() {
  16498. function x(a, e, b) {
  16499. b = a.config.forceEnterMode || b;
  16500. if ("wysiwyg" == a.mode) {
  16501. e || (e = a.activeEnterMode);
  16502. var g = a.elementPath();
  16503. g && !g.isContextFor("p") && (e = CKEDITOR.ENTER_BR, b = 1);
  16504. a.fire("saveSnapshot");
  16505. e == CKEDITOR.ENTER_BR ? u(a, e, null, b) : r(a, e, null, b);
  16506. a.fire("saveSnapshot")
  16507. }
  16508. }
  16509. function y(a) {
  16510. a = a.getSelection().getRanges(!0);
  16511. for (var e = a.length - 1; 0 < e; e--) a[e].deleteContents();
  16512. return a[0]
  16513. }
  16514. function z(a) {
  16515. var e = a.startContainer.getAscendant(function(a) {
  16516. return a.type == CKEDITOR.NODE_ELEMENT && "true" == a.getAttribute("contenteditable")
  16517. },
  16518. !0);
  16519. if (a.root.equals(e)) return a;
  16520. e = new CKEDITOR.dom.range(e);
  16521. e.moveToRange(a);
  16522. return e
  16523. }
  16524. CKEDITOR.plugins.add("enterkey", {
  16525. init: function(a) {
  16526. a.addCommand("enter", {
  16527. modes: {
  16528. wysiwyg: 1
  16529. },
  16530. editorFocus: !1,
  16531. exec: function(a) {
  16532. x(a)
  16533. }
  16534. });
  16535. a.addCommand("shiftEnter", {
  16536. modes: {
  16537. wysiwyg: 1
  16538. },
  16539. editorFocus: !1,
  16540. exec: function(a) {
  16541. x(a, a.activeShiftEnterMode, 1)
  16542. }
  16543. });
  16544. a.setKeystroke([
  16545. [13, "enter"],
  16546. [CKEDITOR.SHIFT + 13, "shiftEnter"]
  16547. ])
  16548. }
  16549. });
  16550. var A = CKEDITOR.dom.walker.whitespaces(),
  16551. B = CKEDITOR.dom.walker.bookmark(),
  16552. v, u, r, w;
  16553. CKEDITOR.plugins.enterkey = {
  16554. enterBlock: function(a, e, b, g) {
  16555. function m(a) {
  16556. var b;
  16557. if (a === CKEDITOR.ENTER_BR || -1 === CKEDITOR.tools.indexOf(["td", "th"], p.lastElement.getName()) || 1 !== p.lastElement.getChildCount()) return !1;
  16558. a = p.lastElement.getChild(0).clone(!0);
  16559. (b = a.getBogus()) && b.remove();
  16560. return a.getText().length ? !1 : !0
  16561. }
  16562. if (b = b || y(a)) {
  16563. b = z(b);
  16564. var h = b.document,
  16565. n = b.checkStartOfBlock(),
  16566. f = b.checkEndOfBlock(),
  16567. p = a.elementPath(b.startContainer),
  16568. c = p.block,
  16569. l = e == CKEDITOR.ENTER_DIV ? "div" : "p",
  16570. d;
  16571. if (n && f) {
  16572. if (c && (c.is("li") || c.getParent().is("li"))) {
  16573. c.is("li") ||
  16574. (c = c.getParent());
  16575. b = c.getParent();
  16576. d = b.getParent();
  16577. g = !c.hasPrevious();
  16578. var f = !c.hasNext(),
  16579. l = a.getSelection(),
  16580. n = l.createBookmarks(),
  16581. k = c.getDirection(1),
  16582. t = c.getAttribute("class"),
  16583. q = c.getAttribute("style"),
  16584. r = d.getDirection(1) != k;
  16585. a = a.enterMode != CKEDITOR.ENTER_BR || r || q || t;
  16586. if (d.is("li")) g || f ? (g && f && b.remove(), c[f ? "insertAfter" : "insertBefore"](d)) : c.breakParent(d);
  16587. else {
  16588. if (a)
  16589. if (p.block.is("li") ? (d = h.createElement(e == CKEDITOR.ENTER_P ? "p" : "div"), r && d.setAttribute("dir", k), q && d.setAttribute("style", q), t && d.setAttribute("class",
  16590. t), c.moveChildren(d)) : d = p.block, g || f) d[g ? "insertBefore" : "insertAfter"](b);
  16591. else c.breakParent(b), d.insertAfter(b);
  16592. else if (c.appendBogus(!0), g || f)
  16593. for (; h = c[g ? "getFirst" : "getLast"]();) h[g ? "insertBefore" : "insertAfter"](b);
  16594. else
  16595. for (c.breakParent(b); h = c.getLast();) h.insertAfter(b);
  16596. c.remove()
  16597. }
  16598. l.selectBookmarks(n);
  16599. return
  16600. }
  16601. if (c && c.getParent().is("blockquote")) {
  16602. c.breakParent(c.getParent());
  16603. c.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1)) || c.getPrevious().remove();
  16604. c.getNext().getFirst(CKEDITOR.dom.walker.invisible(1)) ||
  16605. c.getNext().remove();
  16606. b.moveToElementEditStart(c);
  16607. b.select();
  16608. return
  16609. }
  16610. } else if (c && c.is("pre") && !f) {
  16611. u(a, e, b, g);
  16612. return
  16613. }
  16614. if (q = b.splitBlock(l)) {
  16615. a = q.previousBlock;
  16616. c = q.nextBlock;
  16617. n = q.wasStartOfBlock;
  16618. f = q.wasEndOfBlock;
  16619. c ? (k = c.getParent(), k.is("li") && (c.breakParent(k), c.move(c.getNext(), 1))) : a && (k = a.getParent()) && k.is("li") && (a.breakParent(k), k = a.getNext(), b.moveToElementEditStart(k), a.move(a.getPrevious()));
  16620. if (n || f)
  16621. if (m(e)) b.moveToElementEditStart(b.getTouchedStartNode());
  16622. else {
  16623. if (a) {
  16624. if (a.is("li") || !w.test(a.getName()) &&
  16625. !a.is("pre")) d = a.clone()
  16626. } else c && (d = c.clone());
  16627. d ? g && !d.is("li") && d.renameNode(l) : k && k.is("li") ? d = k : (d = h.createElement(l), a && (t = a.getDirection()) && d.setAttribute("dir", t));
  16628. if (h = q.elementPath)
  16629. for (e = 0, g = h.elements.length; e < g; e++) {
  16630. l = h.elements[e];
  16631. if (l.equals(h.block) || l.equals(h.blockLimit)) break;
  16632. CKEDITOR.dtd.$removeEmpty[l.getName()] && (l = l.clone(), d.moveChildren(l), d.append(l))
  16633. }
  16634. d.appendBogus();
  16635. d.getParent() || b.insertNode(d);
  16636. d.is("li") && d.removeAttribute("value");
  16637. !CKEDITOR.env.ie || !n || f && a.getChildCount() ||
  16638. (b.moveToElementEditStart(f ? a : d), b.select());
  16639. b.moveToElementEditStart(n && !f ? c : d)
  16640. }
  16641. else c.is("li") && (d = b.clone(), d.selectNodeContents(c), d = new CKEDITOR.dom.walker(d), d.evaluator = function(a) {
  16642. return !(B(a) || A(a) || a.type == CKEDITOR.NODE_ELEMENT && a.getName() in CKEDITOR.dtd.$inline && !(a.getName() in CKEDITOR.dtd.$empty))
  16643. }, (k = d.next()) && k.type == CKEDITOR.NODE_ELEMENT && k.is("ul", "ol") && (CKEDITOR.env.needsBrFiller ? h.createElement("br") : h.createText(" ")).insertBefore(k)), c && b.moveToElementEditStart(c);
  16644. b.select();
  16645. b.scrollIntoView()
  16646. }
  16647. }
  16648. },
  16649. enterBr: function(a, e, b, g) {
  16650. if (b = b || y(a)) {
  16651. var m = b.document,
  16652. h = b.checkEndOfBlock(),
  16653. n = new CKEDITOR.dom.elementPath(a.getSelection().getStartElement()),
  16654. f = n.block,
  16655. p = f && n.block.getName();
  16656. g || "li" != p ? (!g && h && w.test(p) ? (h = f.getDirection()) ? (m = m.createElement("div"), m.setAttribute("dir", h), m.insertAfter(f), b.setStart(m, 0)) : (m.createElement("br").insertAfter(f), CKEDITOR.env.gecko && m.createText("").insertAfter(f), b.setStartAt(f.getNext(), CKEDITOR.env.ie ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_START)) :
  16657. (a = "pre" == p && CKEDITOR.env.ie && 8 > CKEDITOR.env.version ? m.createText("\r") : m.createElement("br"), b.deleteContents(), b.insertNode(a), CKEDITOR.env.needsBrFiller ? (m.createText("").insertAfter(a), h && (f || n.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, g)
  16658. }
  16659. }
  16660. };
  16661. v = CKEDITOR.plugins.enterkey;
  16662. u = v.enterBr;
  16663. r = v.enterBlock;
  16664. w = /^h[1-6]$/
  16665. })();
  16666. (function() {
  16667. function k(b, f) {
  16668. var g = {},
  16669. c = [],
  16670. e = {
  16671. nbsp: " ",
  16672. shy: "­",
  16673. gt: "\x3e",
  16674. lt: "\x3c",
  16675. amp: "\x26",
  16676. apos: "'",
  16677. quot: '"'
  16678. };
  16679. b = b.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g, function(b, a) {
  16680. var d = f ? "\x26" + a + ";" : e[a];
  16681. g[d] = f ? e[a] : "\x26" + a + ";";
  16682. c.push(d);
  16683. return ""
  16684. });
  16685. if (!f && b) {
  16686. b = b.split(",");
  16687. var a = document.createElement("div"),
  16688. d;
  16689. a.innerHTML = "\x26" + b.join(";\x26") + ";";
  16690. d = a.innerHTML;
  16691. a = null;
  16692. for (a = 0; a < d.length; a++) {
  16693. var h = d.charAt(a);
  16694. g[h] = "\x26" + b[a] + ";";
  16695. c.push(h)
  16696. }
  16697. }
  16698. g.regex = c.join(f ? "|" : "");
  16699. return g
  16700. }
  16701. CKEDITOR.plugins.add("entities", {
  16702. afterInit: function(b) {
  16703. function f(a) {
  16704. return h[a]
  16705. }
  16706. function g(b) {
  16707. return "force" != c.entities_processNumerical && a[b] ? a[b] : "\x26#" + b.charCodeAt(0) + ";"
  16708. }
  16709. var c = b.config;
  16710. if (b = (b = b.dataProcessor) && b.htmlFilter) {
  16711. var e = [];
  16712. !1 !== c.basicEntities && e.push("nbsp,gt,lt,amp");
  16713. 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"),
  16714. 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"),
  16715. c.entities_additional && e.push(c.entities_additional));
  16716. var a = k(e.join(",")),
  16717. d = a.regex ? "[" + a.regex + "]" : "a^";
  16718. delete a.regex;
  16719. c.entities && c.entities_processNumerical && (d = "[^ -~]|" + d);
  16720. var d = new RegExp(d, "g"),
  16721. h = k("nbsp,gt,lt,amp,shy", !0),
  16722. l = new RegExp(h.regex, "g");
  16723. b.addRules({
  16724. text: function(a) {
  16725. return a.replace(l, f).replace(d, g)
  16726. }
  16727. }, {
  16728. applyToAll: !0,
  16729. excludeNestedEditable: !0
  16730. })
  16731. }
  16732. }
  16733. })
  16734. })();
  16735. CKEDITOR.config.basicEntities = !0;
  16736. CKEDITOR.config.entities = !0;
  16737. CKEDITOR.config.entities_latin = !0;
  16738. CKEDITOR.config.entities_greek = !0;
  16739. CKEDITOR.config.entities_additional = "#39";
  16740. CKEDITOR.plugins.add("popup");
  16741. CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
  16742. popup: function(e, a, b, d) {
  16743. a = a || "80%";
  16744. b = b || "70%";
  16745. "string" == typeof a && 1 < a.length && "%" == a.substr(a.length - 1, 1) && (a = parseInt(window.screen.width * parseInt(a, 10) / 100, 10));
  16746. "string" == typeof b && 1 < b.length && "%" == b.substr(b.length - 1, 1) && (b = parseInt(window.screen.height * parseInt(b, 10) / 100, 10));
  16747. 640 > a && (a = 640);
  16748. 420 > b && (b = 420);
  16749. var f = parseInt((window.screen.height - b) / 2, 10),
  16750. g = parseInt((window.screen.width - a) / 2, 10);
  16751. d = (d || "location\x3dno,menubar\x3dno,toolbar\x3dno,dependent\x3dyes,minimizable\x3dno,modal\x3dyes,alwaysRaised\x3dyes,resizable\x3dyes,scrollbars\x3dyes") + ",width\x3d" +
  16752. a + ",height\x3d" + b + ",top\x3d" + f + ",left\x3d" + g;
  16753. var c = window.open("", null, d, !0);
  16754. if (!c) return !1;
  16755. try {
  16756. -1 == navigator.userAgent.toLowerCase().indexOf(" chrome/") && (c.moveTo(g, f), c.resizeTo(a, b)), c.focus(), c.location.href = e
  16757. } catch (h) {
  16758. window.open(e, null, d, !0)
  16759. }
  16760. return !0
  16761. }
  16762. });
  16763. (function() {
  16764. function k(a) {
  16765. this.editor = a;
  16766. this.loaders = []
  16767. }
  16768. function l(a, c, b) {
  16769. var d = a.config.fileTools_defaultFileName;
  16770. this.editor = a;
  16771. this.lang = a.lang;
  16772. "string" === typeof c ? (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);
  16773. 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("."));
  16774. this.uploaded = 0;
  16775. this.responseData = this.uploadTotal = null;
  16776. this.status =
  16777. "created";
  16778. this.abort = function() {
  16779. this.changeStatus("abort")
  16780. }
  16781. }
  16782. function n(a) {
  16783. var c = a.match(m)[1];
  16784. a = a.replace(m, "");
  16785. a = atob(a);
  16786. var b = [],
  16787. d, f, g, e;
  16788. for (d = 0; d < a.length; d += 512) {
  16789. f = a.slice(d, d + 512);
  16790. g = Array(f.length);
  16791. for (e = 0; e < f.length; e++) g[e] = f.charCodeAt(e);
  16792. f = new Uint8Array(g);
  16793. b.push(f)
  16794. }
  16795. return new Blob(b, {
  16796. type: c
  16797. })
  16798. }
  16799. CKEDITOR.plugins.add("filetools", {
  16800. beforeInit: function(a) {
  16801. a.uploadRepository = new k(a);
  16802. a.on("fileUploadRequest", function(a) {
  16803. var b = a.data.fileLoader;
  16804. b.xhr.open("POST", b.uploadUrl, !0);
  16805. a.data.requestData.upload = {
  16806. file: b.file,
  16807. name: b.fileName
  16808. }
  16809. }, null, null, 5);
  16810. a.on("fileUploadRequest", function(c) {
  16811. var b = c.data.fileLoader,
  16812. d = new FormData;
  16813. c = c.data.requestData;
  16814. var f = a.config.fileTools_requestHeaders,
  16815. g, e;
  16816. for (e in c) {
  16817. var h = c[e];
  16818. "object" === typeof h && h.file ? d.append(e, h.file, h.name) : d.append(e, h)
  16819. }
  16820. d.append("ckCsrfToken", CKEDITOR.tools.getCsrfToken());
  16821. if (f)
  16822. for (g in f) b.xhr.setRequestHeader(g, f[g]);
  16823. b.xhr.send(d)
  16824. }, null, null, 999);
  16825. a.on("fileUploadResponse", function(a) {
  16826. var b = a.data.fileLoader,
  16827. d = b.xhr,
  16828. f = a.data;
  16829. try {
  16830. var g = JSON.parse(d.responseText);
  16831. g.error && g.error.message && (f.message = g.error.message);
  16832. if (g.uploaded)
  16833. for (var e in g) f[e] = g[e];
  16834. else a.cancel()
  16835. } catch (h) {
  16836. f.message = b.lang.filetools.responseError, CKEDITOR.warn("filetools-response-error", {
  16837. responseText: d.responseText
  16838. }), a.cancel()
  16839. }
  16840. }, null, null, 999)
  16841. }
  16842. });
  16843. k.prototype = {
  16844. create: function(a, c, b) {
  16845. b = b || l;
  16846. var d = this.loaders.length;
  16847. a = new b(this.editor, a, c);
  16848. a.id = d;
  16849. this.loaders[d] = a;
  16850. this.fire("instanceCreated", a);
  16851. return a
  16852. },
  16853. isFinished: function() {
  16854. for (var a = 0; a < this.loaders.length; ++a)
  16855. if (!this.loaders[a].isFinished()) return !1;
  16856. return !0
  16857. }
  16858. };
  16859. l.prototype = {
  16860. loadAndUpload: function(a, c) {
  16861. var b = this;
  16862. this.once("loaded", function(d) {
  16863. d.cancel();
  16864. b.once("update", function(a) {
  16865. a.cancel()
  16866. }, null, null, 0);
  16867. b.upload(a, c)
  16868. }, null, null, 0);
  16869. this.load()
  16870. },
  16871. load: function() {
  16872. var a = this,
  16873. c = this.reader = new FileReader;
  16874. a.changeStatus("loading");
  16875. this.abort = function() {
  16876. a.reader.abort()
  16877. };
  16878. c.onabort = function() {
  16879. a.changeStatus("abort")
  16880. };
  16881. c.onerror = function() {
  16882. a.message = a.lang.filetools.loadError;
  16883. a.changeStatus("error")
  16884. };
  16885. c.onprogress = function(b) {
  16886. a.loaded = b.loaded;
  16887. a.update()
  16888. };
  16889. c.onload = function() {
  16890. a.loaded = a.total;
  16891. a.data = c.result;
  16892. a.changeStatus("loaded")
  16893. };
  16894. c.readAsDataURL(this.file)
  16895. },
  16896. upload: function(a, c) {
  16897. var b = c || {};
  16898. a ? (this.uploadUrl = a, this.xhr = new XMLHttpRequest, this.attachRequestListeners(), this.editor.fire("fileUploadRequest", {
  16899. fileLoader: this,
  16900. requestData: b
  16901. }) && this.changeStatus("uploading")) : (this.message = this.lang.filetools.noUrlError, this.changeStatus("error"))
  16902. },
  16903. attachRequestListeners: function() {
  16904. function a() {
  16905. "error" != b.status && (b.message = b.lang.filetools.networkError,
  16906. b.changeStatus("error"))
  16907. }
  16908. function c() {
  16909. "abort" != b.status && b.changeStatus("abort")
  16910. }
  16911. var b = this,
  16912. d = this.xhr;
  16913. b.abort = function() {
  16914. d.abort();
  16915. c()
  16916. };
  16917. d.onerror = a;
  16918. d.onabort = c;
  16919. d.upload ? (d.upload.onprogress = function(a) {
  16920. a.lengthComputable && (b.uploadTotal || (b.uploadTotal = a.total), b.uploaded = a.loaded, b.update())
  16921. }, d.upload.onerror = a, d.upload.onabort = c) : (b.uploadTotal = b.total, b.update());
  16922. d.onload = function() {
  16923. b.update();
  16924. if ("abort" != b.status)
  16925. if (b.uploaded = b.uploadTotal, 200 > d.status || 299 < d.status) b.message = b.lang.filetools["httpError" +
  16926. d.status], b.message || (b.message = b.lang.filetools.httpError.replace("%1", d.status)), b.changeStatus("error");
  16927. else {
  16928. for (var a = {
  16929. fileLoader: b
  16930. }, c = ["message", "fileName", "url"], e = b.editor.fire("fileUploadResponse", a), h = 0; h < c.length; h++) {
  16931. var k = c[h];
  16932. "string" === typeof a[k] && (b[k] = a[k])
  16933. }
  16934. b.responseData = a;
  16935. delete b.responseData.fileLoader;
  16936. !1 === e ? b.changeStatus("error") : b.changeStatus("uploaded")
  16937. }
  16938. }
  16939. },
  16940. changeStatus: function(a) {
  16941. this.status = a;
  16942. if ("error" == a || "abort" == a || "loaded" == a || "uploaded" == a) this.abort = function() {};
  16943. this.fire(a);
  16944. this.update()
  16945. },
  16946. update: function() {
  16947. this.fire("update")
  16948. },
  16949. isFinished: function() {
  16950. return !!this.status.match(/^(?:loaded|uploaded|error|abort)$/)
  16951. }
  16952. };
  16953. CKEDITOR.event.implementOn(k.prototype);
  16954. CKEDITOR.event.implementOn(l.prototype);
  16955. var m = /^data:(\S*?);base64,/;
  16956. CKEDITOR.fileTools || (CKEDITOR.fileTools = {});
  16957. CKEDITOR.tools.extend(CKEDITOR.fileTools, {
  16958. uploadRepository: k,
  16959. fileLoader: l,
  16960. getUploadUrl: function(a, c) {
  16961. var b = CKEDITOR.tools.capitalize;
  16962. return c && a[c + "UploadUrl"] ? a[c + "UploadUrl"] : a.uploadUrl ? a.uploadUrl :
  16963. c && a["filebrowser" + b(c, 1) + "UploadUrl"] ? a["filebrowser" + b(c, 1) + "UploadUrl"] + "\x26responseType\x3djson" : a.filebrowserUploadUrl ? a.filebrowserUploadUrl + "\x26responseType\x3djson" : null
  16964. },
  16965. isTypeSupported: function(a, c) {
  16966. return !!a.type.match(c)
  16967. },
  16968. isFileUploadSupported: "function" === typeof FileReader && "function" === typeof(new FileReader).readAsDataURL && "function" === typeof FormData && "function" === typeof(new FormData).append && "function" === typeof XMLHttpRequest && "function" === typeof Blob
  16969. })
  16970. })();
  16971. (function() {
  16972. function g(a, b) {
  16973. var d = [];
  16974. if (b)
  16975. for (var c in b) d.push(c + "\x3d" + encodeURIComponent(b[c]));
  16976. else return a;
  16977. return a + (-1 != a.indexOf("?") ? "\x26" : "?") + d.join("\x26")
  16978. }
  16979. function p(a) {
  16980. return !a.match(/command=QuickUpload/) || a.match(/(\?|&)responseType=json/) ? a : g(a, {
  16981. responseType: "json"
  16982. })
  16983. }
  16984. function k(a) {
  16985. a += "";
  16986. return a.charAt(0).toUpperCase() + a.substr(1)
  16987. }
  16988. function q() {
  16989. var a = this.getDialog(),
  16990. b = a.getParentEditor();
  16991. b._.filebrowserSe = this;
  16992. var d = b.config["filebrowser" + k(a.getName()) + "WindowWidth"] || b.config.filebrowserWindowWidth ||
  16993. "80%",
  16994. a = b.config["filebrowser" + k(a.getName()) + "WindowHeight"] || b.config.filebrowserWindowHeight || "70%",
  16995. c = this.filebrowser.params || {};
  16996. c.CKEditor = b.name;
  16997. c.CKEditorFuncNum = b._.filebrowserFn;
  16998. c.langCode || (c.langCode = b.langCode);
  16999. c = g(this.filebrowser.url, c);
  17000. b.popup(c, d, a, b.config.filebrowserWindowFeatures || b.config.fileBrowserWindowFeatures)
  17001. }
  17002. function r(a) {
  17003. var b = new CKEDITOR.dom.element(a.$.form);
  17004. b && ((a = b.$.elements.ckCsrfToken) ? a = new CKEDITOR.dom.element(a) : (a = new CKEDITOR.dom.element("input"), a.setAttributes({
  17005. name: "ckCsrfToken",
  17006. type: "hidden"
  17007. }), b.append(a)), a.setAttribute("value", CKEDITOR.tools.getCsrfToken()))
  17008. }
  17009. function t() {
  17010. var a = this.getDialog();
  17011. a.getParentEditor()._.filebrowserSe = this;
  17012. return a.getContentElement(this["for"][0], this["for"][1]).getInputElement().$.value && a.getContentElement(this["for"][0], this["for"][1]).getAction() ? !0 : !1
  17013. }
  17014. function u(a, b, d) {
  17015. var c = d.params || {};
  17016. c.CKEditor = a.name;
  17017. c.CKEditorFuncNum = a._.filebrowserFn;
  17018. c.langCode || (c.langCode = a.langCode);
  17019. b.action = g(d.url, c);
  17020. b.filebrowser = d
  17021. }
  17022. function l(a, b, d, c) {
  17023. if (c &&
  17024. c.length)
  17025. for (var e, g = c.length; g--;)
  17026. if (e = c[g], "hbox" != e.type && "vbox" != e.type && "fieldset" != e.type || l(a, b, d, e.children), e.filebrowser)
  17027. if ("string" == typeof e.filebrowser && (e.filebrowser = {
  17028. action: "fileButton" == e.type ? "QuickUpload" : "Browse",
  17029. target: e.filebrowser
  17030. }), "Browse" == e.filebrowser.action) {
  17031. var f = e.filebrowser.url;
  17032. void 0 === f && (f = a.config["filebrowser" + k(b) + "BrowseUrl"], void 0 === f && (f = a.config.filebrowserBrowseUrl));
  17033. f && (e.onClick = q, e.filebrowser.url = f, e.hidden = !1)
  17034. } else if ("QuickUpload" == e.filebrowser.action &&
  17035. e["for"] && (f = e.filebrowser.url, void 0 === f && (f = a.config["filebrowser" + k(b) + "UploadUrl"], void 0 === f && (f = a.config.filebrowserUploadUrl)), f)) {
  17036. var h = e.onClick;
  17037. e.onClick = function(b) {
  17038. var c = b.sender,
  17039. d = c.getDialog().getContentElement(this["for"][0], this["for"][1]).getInputElement(),
  17040. e = CKEDITOR.fileTools && CKEDITOR.fileTools.isFileUploadSupported;
  17041. if (h && !1 === h.call(c, b)) return !1;
  17042. if (t.call(c, b)) {
  17043. if ("form" !== a.config.filebrowserUploadMethod && e) return b = a.uploadRepository.create(d.$.files[0]), b.on("uploaded", function(a) {
  17044. var b =
  17045. a.sender.responseData;
  17046. m.call(a.sender.editor, b.url, b.message)
  17047. }), b.on("error", n.bind(this)), b.on("abort", n.bind(this)), b.loadAndUpload(p(f)), "xhr";
  17048. r(d);
  17049. return !0
  17050. }
  17051. return !1
  17052. };
  17053. e.filebrowser.url = f;
  17054. e.hidden = !1;
  17055. u(a, d.getContents(e["for"][0]).get(e["for"][1]), e.filebrowser)
  17056. }
  17057. }
  17058. function n(a) {
  17059. var b = {};
  17060. try {
  17061. b = JSON.parse(a.sender.xhr.response) || {}
  17062. } catch (d) {}
  17063. this.enable();
  17064. alert(b.error ? b.error.message : a.sender.message)
  17065. }
  17066. function h(a, b, d) {
  17067. if (-1 !== d.indexOf(";")) {
  17068. d = d.split(";");
  17069. for (var c = 0; c < d.length; c++)
  17070. if (h(a, b, d[c])) return !0;
  17071. return !1
  17072. }
  17073. return (a = a.getContents(b).get(d).filebrowser) && a.url
  17074. }
  17075. function m(a, b) {
  17076. var d = this._.filebrowserSe.getDialog(),
  17077. c = this._.filebrowserSe["for"],
  17078. e = this._.filebrowserSe.filebrowser.onSelect;
  17079. c && d.getContentElement(c[0], c[1]).reset();
  17080. if ("function" != typeof b || !1 !== b.call(this._.filebrowserSe))
  17081. if (!e || !1 !== e.call(this._.filebrowserSe, a, b))
  17082. if ("string" == typeof b && b && alert(b), a && (c = this._.filebrowserSe, d = c.getDialog(), c = c.filebrowser.target || null))
  17083. if (c = c.split(":"), e = d.getContentElement(c[0], c[1])) e.setValue(a),
  17084. d.selectPage(c[0])
  17085. }
  17086. CKEDITOR.plugins.add("filebrowser", {
  17087. requires: "popup,filetools",
  17088. init: function(a) {
  17089. a._.filebrowserFn = CKEDITOR.tools.addFunction(m, a);
  17090. a.on("destroy", function() {
  17091. CKEDITOR.tools.removeFunction(this._.filebrowserFn)
  17092. })
  17093. }
  17094. });
  17095. CKEDITOR.on("dialogDefinition", function(a) {
  17096. if (a.editor.plugins.filebrowser)
  17097. for (var b = a.data.definition, d, c = 0; c < b.contents.length; ++c)
  17098. 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))
  17099. })
  17100. })();
  17101. CKEDITOR.plugins.add("find", {
  17102. requires: "dialog",
  17103. init: function(a) {
  17104. var b = a.addCommand("find", new CKEDITOR.dialogCommand("find")),
  17105. c = a.addCommand("replace", new CKEDITOR.dialogCommand("find", {
  17106. tabId: "replace"
  17107. }));
  17108. b.canUndo = !1;
  17109. b.readOnly = 1;
  17110. c.canUndo = !1;
  17111. a.ui.addButton && (a.ui.addButton("Find", {
  17112. label: a.lang.find.find,
  17113. command: "find",
  17114. toolbar: "find,10"
  17115. }), a.ui.addButton("Replace", {
  17116. label: a.lang.find.replace,
  17117. command: "replace",
  17118. toolbar: "find,20"
  17119. }));
  17120. CKEDITOR.dialog.add("find", this.path + "dialogs/find.js")
  17121. }
  17122. });
  17123. CKEDITOR.config.find_highlight = {
  17124. element: "span",
  17125. styles: {
  17126. "background-color": "#004",
  17127. color: "#fff"
  17128. }
  17129. };
  17130. (function() {
  17131. function g(a, b) {
  17132. var c = l.exec(a),
  17133. d = l.exec(b);
  17134. if (c) {
  17135. if (!c[2] && "px" == d[2]) return d[1];
  17136. if ("px" == c[2] && !d[2]) return d[1] + "px"
  17137. }
  17138. return b
  17139. }
  17140. var k = CKEDITOR.htmlParser.cssStyle,
  17141. h = CKEDITOR.tools.cssLength,
  17142. l = /^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i,
  17143. m = {
  17144. elements: {
  17145. $: function(a) {
  17146. var b = a.attributes;
  17147. if ((b = (b = (b = b && b["data-cke-realelement"]) && new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(b))) && b.children[0]) && a.attributes["data-cke-resizable"]) {
  17148. var c = (new k(a)).rules;
  17149. a = b.attributes;
  17150. var d = c.width,
  17151. c = c.height;
  17152. d && (a.width = g(a.width, d));
  17153. c && (a.height = g(a.height, c))
  17154. }
  17155. return b
  17156. }
  17157. }
  17158. };
  17159. CKEDITOR.plugins.add("fakeobjects", {
  17160. init: function(a) {
  17161. a.filter.allow("img[!data-cke-realelement,src,alt,title](*){*}", "fakeobjects")
  17162. },
  17163. afterInit: function(a) {
  17164. (a = (a = a.dataProcessor) && a.htmlFilter) && a.addRules(m, {
  17165. applyToAll: !0
  17166. })
  17167. }
  17168. });
  17169. CKEDITOR.editor.prototype.createFakeElement = function(a, b, c, d) {
  17170. var e = this.lang.fakeobjects,
  17171. e = e[c] || e.unknown;
  17172. b = {
  17173. "class": b,
  17174. "data-cke-realelement": encodeURIComponent(a.getOuterHtml()),
  17175. "data-cke-real-node-type": a.type,
  17176. alt: e,
  17177. title: e,
  17178. align: a.getAttribute("align") || ""
  17179. };
  17180. CKEDITOR.env.hc || (b.src = CKEDITOR.tools.transparentImageData);
  17181. c && (b["data-cke-real-element-type"] = c);
  17182. 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));
  17183. return this.document.createElement("img", {
  17184. attributes: b
  17185. })
  17186. };
  17187. CKEDITOR.editor.prototype.createFakeParserElement = function(a, b, c, d) {
  17188. var e = this.lang.fakeobjects,
  17189. e = e[c] || e.unknown,
  17190. f;
  17191. f = new CKEDITOR.htmlParser.basicWriter;
  17192. a.writeHtml(f);
  17193. f = f.getHtml();
  17194. b = {
  17195. "class": b,
  17196. "data-cke-realelement": encodeURIComponent(f),
  17197. "data-cke-real-node-type": a.type,
  17198. alt: e,
  17199. title: e,
  17200. align: a.attributes.align || ""
  17201. };
  17202. CKEDITOR.env.hc || (b.src = CKEDITOR.tools.transparentImageData);
  17203. c && (b["data-cke-real-element-type"] = c);
  17204. 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));
  17205. return new CKEDITOR.htmlParser.element("img", b)
  17206. };
  17207. CKEDITOR.editor.prototype.restoreRealElement =
  17208. function(a) {
  17209. if (a.data("cke-real-node-type") != CKEDITOR.NODE_ELEMENT) return null;
  17210. var b = CKEDITOR.dom.element.createFromHtml(decodeURIComponent(a.data("cke-realelement")), this.document);
  17211. if (a.data("cke-resizable")) {
  17212. var c = a.getStyle("width");
  17213. a = a.getStyle("height");
  17214. c && b.setAttribute("width", g(b.getAttribute("width"), c));
  17215. a && b.setAttribute("height", g(b.getAttribute("height"), a))
  17216. }
  17217. return b
  17218. }
  17219. })();
  17220. (function() {
  17221. function d(a) {
  17222. a = a.attributes;
  17223. return "application/x-shockwave-flash" == a.type || f.test(a.src || "")
  17224. }
  17225. function e(a, b) {
  17226. return a.createFakeParserElement(b, "cke_flash", "flash", !0)
  17227. }
  17228. var f = /\.swf(?:$|\?)/i;
  17229. CKEDITOR.plugins.add("flash", {
  17230. requires: "dialog,fakeobjects",
  17231. onLoad: function() {
  17232. 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;}")
  17233. },
  17234. init: function(a) {
  17235. var b = "object[classid,codebase,height,hspace,vspace,width];param[name,value];embed[height,hspace,pluginspage,src,type,vspace,width]";
  17236. CKEDITOR.dialog.isTabEnabled(a, "flash", "properties") && (b += ";object[align]; embed[allowscriptaccess,quality,scale,wmode]");
  17237. CKEDITOR.dialog.isTabEnabled(a, "flash", "advanced") && (b += ";object[id]{*}; embed[bgcolor]{*}(*)");
  17238. a.addCommand("flash", new CKEDITOR.dialogCommand("flash", {
  17239. allowedContent: b,
  17240. requiredContent: "embed"
  17241. }));
  17242. a.ui.addButton && a.ui.addButton("Flash", {
  17243. label: a.lang.common.flash,
  17244. command: "flash",
  17245. toolbar: "insert,20"
  17246. });
  17247. CKEDITOR.dialog.add("flash", this.path + "dialogs/flash.js");
  17248. a.addMenuItems && a.addMenuItems({
  17249. flash: {
  17250. label: a.lang.flash.properties,
  17251. command: "flash",
  17252. group: "flash"
  17253. }
  17254. });
  17255. a.on("doubleclick", function(a) {
  17256. var b = a.data.element;
  17257. b.is("img") && "flash" == b.data("cke-real-element-type") && (a.data.dialog = "flash")
  17258. });
  17259. a.contextMenu && a.contextMenu.addListener(function(a) {
  17260. if (a && a.is("img") && !a.isReadOnly() && "flash" == a.data("cke-real-element-type")) return {
  17261. flash: CKEDITOR.TRISTATE_OFF
  17262. }
  17263. })
  17264. },
  17265. afterInit: function(a) {
  17266. var b = a.dataProcessor;
  17267. (b = b && b.dataFilter) && b.addRules({
  17268. elements: {
  17269. "cke:object": function(b) {
  17270. var c = b.attributes;
  17271. if (!(c.classid && String(c.classid).toLowerCase() || d(b))) {
  17272. for (c = 0; c < b.children.length; c++)
  17273. if ("cke:embed" == b.children[c].name) {
  17274. if (!d(b.children[c])) break;
  17275. return e(a, b)
  17276. } return null
  17277. }
  17278. return e(a, b)
  17279. },
  17280. "cke:embed": function(b) {
  17281. return d(b) ? e(a, b) : null
  17282. }
  17283. }
  17284. }, 5)
  17285. }
  17286. })
  17287. })();
  17288. CKEDITOR.tools.extend(CKEDITOR.config, {
  17289. flashEmbedTagOnly: !1,
  17290. flashAddEmbedTag: !0,
  17291. flashConvertOnEdit: !1
  17292. });
  17293. (function() {
  17294. function k(a) {
  17295. var l = a.config,
  17296. p = a.fire("uiSpace", {
  17297. space: "top",
  17298. html: ""
  17299. }).html,
  17300. t = function() {
  17301. function f(a, c, e) {
  17302. b.setStyle(c, w(e));
  17303. b.setStyle("position", a)
  17304. }
  17305. function e(a) {
  17306. var b = k.getDocumentPosition();
  17307. switch (a) {
  17308. case "top":
  17309. f("absolute", "top", b.y - q - r);
  17310. break;
  17311. case "pin":
  17312. f("fixed", "top", x);
  17313. break;
  17314. case "bottom":
  17315. f("absolute", "top", b.y + (c.height || c.bottom - c.top) + r)
  17316. }
  17317. m = a
  17318. }
  17319. var m, k, n, c, h, q, v, p = l.floatSpaceDockedOffsetX || 0,
  17320. r = l.floatSpaceDockedOffsetY || 0,
  17321. u = l.floatSpacePinnedOffsetX || 0,
  17322. x = l.floatSpacePinnedOffsetY ||
  17323. 0;
  17324. return function(d) {
  17325. if (k = a.editable()) {
  17326. var f = d && "focus" == d.name;
  17327. f && b.show();
  17328. a.fire("floatingSpaceLayout", {
  17329. show: f
  17330. });
  17331. b.removeStyle("left");
  17332. b.removeStyle("right");
  17333. n = b.getClientRect();
  17334. c = k.getClientRect();
  17335. h = g.getViewPaneSize();
  17336. q = n.height;
  17337. v = "pageXOffset" in g.$ ? g.$.pageXOffset : CKEDITOR.document.$.documentElement.scrollLeft;
  17338. 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" : 0 < c.left && c.right < h.width && c.width > n.width ? "rtl" == l.contentsLangDirection ?
  17339. "right" : "left" : d - c.left > c.right - d ? "left" : "right", n.width > h.width ? (d = "left", f = 0) : (f = "left" == d ? 0 < c.left ? c.left : 0 : c.right < h.width ? h.width - c.right : 0, f + n.width > h.width && (d = "left" == d ? "right" : "left", f = 0)), b.setStyle(d, w(("pin" == m ? u : p) + f + ("pin" == m ? 0 : "left" == d ? v : -v)))) : (m = "pin", e("pin"), t(d))
  17340. }
  17341. }
  17342. }();
  17343. if (p) {
  17344. 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 ?
  17345. " " : "") + '" 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'),
  17346. b = CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(k.output({
  17347. content: p,
  17348. id: a.id,
  17349. langDir: a.lang.dir,
  17350. langCode: a.langCode,
  17351. name: a.name,
  17352. style: "display:none;z-index:" + (l.baseFloatZIndex - 1),
  17353. topId: a.ui.spaceId("top"),
  17354. voiceLabel: a.title
  17355. }))),
  17356. u = CKEDITOR.tools.eventsBuffer(500, t),
  17357. e = CKEDITOR.tools.eventsBuffer(100, t);
  17358. b.unselectable();
  17359. b.on("mousedown", function(a) {
  17360. a = a.data;
  17361. a.getTarget().hasAscendant("a", 1) || a.preventDefault()
  17362. });
  17363. a.on("focus", function(b) {
  17364. t(b);
  17365. a.on("change", u.input);
  17366. g.on("scroll", e.input);
  17367. g.on("resize", e.input)
  17368. });
  17369. a.on("blur", function() {
  17370. b.hide();
  17371. a.removeListener("change", u.input);
  17372. g.removeListener("scroll",
  17373. e.input);
  17374. g.removeListener("resize", e.input)
  17375. });
  17376. a.on("destroy", function() {
  17377. g.removeListener("scroll", e.input);
  17378. g.removeListener("resize", e.input);
  17379. b.clearCustomData();
  17380. b.remove()
  17381. });
  17382. a.focusManager.hasFocus && b.show();
  17383. a.focusManager.add(b, 1)
  17384. }
  17385. }
  17386. var g = CKEDITOR.document.getWindow(),
  17387. w = CKEDITOR.tools.cssLength;
  17388. CKEDITOR.plugins.add("floatingspace", {
  17389. init: function(a) {
  17390. a.on("loaded", function() {
  17391. k(this)
  17392. }, null, null, 20)
  17393. }
  17394. })
  17395. })();
  17396. CKEDITOR.plugins.add("listblock", {
  17397. requires: "panel",
  17398. onLoad: function() {
  17399. var f = CKEDITOR.addTemplate("panel-list", '\x3cul role\x3d"presentation" class\x3d"cke_panel_list"\x3e{items}\x3c/ul\x3e'),
  17400. 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}" href\x3d"javascript:void(\'{val}\')" {onclick}\x3d"CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role\x3d"option"\x3e{text}\x3c/a\x3e\x3c/li\x3e'),
  17401. h = CKEDITOR.addTemplate("panel-list-group", '\x3ch1 id\x3d"{id}" class\x3d"cke_panel_grouptitle" role\x3d"presentation" \x3e{label}\x3c/h1\x3e'),
  17402. k = /\'/g;
  17403. CKEDITOR.ui.panel.prototype.addListBlock = function(a, b) {
  17404. return this.addBlock(a, new CKEDITOR.ui.listBlock(this.getHolderElement(), b))
  17405. };
  17406. CKEDITOR.ui.listBlock = CKEDITOR.tools.createClass({
  17407. base: CKEDITOR.ui.panel.block,
  17408. $: function(a, b) {
  17409. b = b || {};
  17410. var c = b.attributes || (b.attributes = {});
  17411. (this.multiSelect = !!b.multiSelect) && (c["aria-multiselectable"] = !0);
  17412. !c.role &&
  17413. (c.role = "listbox");
  17414. this.base.apply(this, arguments);
  17415. this.element.setAttribute("role", c.role);
  17416. c = this.keys;
  17417. c[40] = "next";
  17418. c[9] = "next";
  17419. c[38] = "prev";
  17420. c[CKEDITOR.SHIFT + 9] = "prev";
  17421. c[32] = CKEDITOR.env.ie ? "mouseup" : "click";
  17422. CKEDITOR.env.ie && (c[13] = "mouseup");
  17423. this._.pendingHtml = [];
  17424. this._.pendingList = [];
  17425. this._.items = {};
  17426. this._.groups = {}
  17427. },
  17428. _: {
  17429. close: function() {
  17430. if (this._.started) {
  17431. var a = f.output({
  17432. items: this._.pendingList.join("")
  17433. });
  17434. this._.pendingList = [];
  17435. this._.pendingHtml.push(a);
  17436. delete this._.started
  17437. }
  17438. },
  17439. getClick: function() {
  17440. this._.click ||
  17441. (this._.click = CKEDITOR.tools.addFunction(function(a) {
  17442. var b = this.toggle(a);
  17443. if (this.onClick) this.onClick(a, b)
  17444. }, this));
  17445. return this._.click
  17446. }
  17447. },
  17448. proto: {
  17449. add: function(a, b, c) {
  17450. var d = CKEDITOR.tools.getNextId();
  17451. this._.started || (this._.started = 1, this._.size = this._.size || 0);
  17452. this._.items[a] = d;
  17453. var e;
  17454. e = CKEDITOR.tools.htmlEncodeAttr(a).replace(k, "\\'");
  17455. a = {
  17456. id: d,
  17457. val: e,
  17458. onclick: CKEDITOR.env.ie ? 'onclick\x3d"return false;" onmouseup' : "onclick",
  17459. clickFn: this._.getClick(),
  17460. title: CKEDITOR.tools.htmlEncodeAttr(c || a),
  17461. text: b || a
  17462. };
  17463. this._.pendingList.push(g.output(a))
  17464. },
  17465. startGroup: function(a) {
  17466. this._.close();
  17467. var b = CKEDITOR.tools.getNextId();
  17468. this._.groups[a] = b;
  17469. this._.pendingHtml.push(h.output({
  17470. id: b,
  17471. label: a
  17472. }))
  17473. },
  17474. commit: function() {
  17475. this._.close();
  17476. this.element.appendHtml(this._.pendingHtml.join(""));
  17477. delete this._.size;
  17478. this._.pendingHtml = []
  17479. },
  17480. toggle: function(a) {
  17481. var b = this.isMarked(a);
  17482. b ? this.unmark(a) : this.mark(a);
  17483. return !b
  17484. },
  17485. hideGroup: function(a) {
  17486. var b = (a = this.element.getDocument().getById(this._.groups[a])) && a.getNext();
  17487. a && (a.setStyle("display",
  17488. "none"), b && "ul" == b.getName() && b.setStyle("display", "none"))
  17489. },
  17490. hideItem: function(a) {
  17491. this.element.getDocument().getById(this._.items[a]).setStyle("display", "none")
  17492. },
  17493. showAll: function() {
  17494. var a = this._.items,
  17495. b = this._.groups,
  17496. c = this.element.getDocument(),
  17497. d;
  17498. for (d in a) c.getById(a[d]).setStyle("display", "");
  17499. for (var e in b) a = c.getById(b[e]), d = a.getNext(), a.setStyle("display", ""), d && "ul" == d.getName() && d.setStyle("display", "")
  17500. },
  17501. mark: function(a) {
  17502. this.multiSelect || this.unmarkAll();
  17503. a = this._.items[a];
  17504. var b = this.element.getDocument().getById(a);
  17505. b.addClass("cke_selected");
  17506. this.element.getDocument().getById(a + "_option").setAttribute("aria-selected", !0);
  17507. this.onMark && this.onMark(b)
  17508. },
  17509. markFirstDisplayed: function() {
  17510. var a = this;
  17511. this._.markFirstDisplayed(function() {
  17512. a.multiSelect || a.unmarkAll()
  17513. })
  17514. },
  17515. unmark: function(a) {
  17516. var b = this.element.getDocument();
  17517. a = this._.items[a];
  17518. var c = b.getById(a);
  17519. c.removeClass("cke_selected");
  17520. b.getById(a + "_option").removeAttribute("aria-selected");
  17521. this.onUnmark && this.onUnmark(c)
  17522. },
  17523. unmarkAll: function() {
  17524. var a = this._.items,
  17525. b = this.element.getDocument(),
  17526. c;
  17527. for (c in a) {
  17528. var d = a[c];
  17529. b.getById(d).removeClass("cke_selected");
  17530. b.getById(d + "_option").removeAttribute("aria-selected")
  17531. }
  17532. this.onUnmark && this.onUnmark()
  17533. },
  17534. isMarked: function(a) {
  17535. return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected")
  17536. },
  17537. focus: function(a) {
  17538. this._.focusIndex = -1;
  17539. var b = this.element.getElementsByTag("a"),
  17540. c, d = -1;
  17541. if (a)
  17542. for (c = this.element.getDocument().getById(this._.items[a]).getFirst(); a = b.getItem(++d);) {
  17543. if (a.equals(c)) {
  17544. this._.focusIndex = d;
  17545. break
  17546. }
  17547. } else this.element.focus();
  17548. c && setTimeout(function() {
  17549. c.focus()
  17550. }, 0)
  17551. }
  17552. }
  17553. })
  17554. }
  17555. });
  17556. CKEDITOR.plugins.add("richcombo", {
  17557. requires: "floatpanel,listblock,button",
  17558. beforeInit: function(c) {
  17559. c.ui.addHandler(CKEDITOR.UI_RICHCOMBO, CKEDITOR.ui.richCombo.handler)
  17560. }
  17561. });
  17562. (function() {
  17563. var c = '\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"true"';
  17564. CKEDITOR.env.gecko && CKEDITOR.env.mac && (c += ' onkeypress\x3d"return false;"');
  17565. CKEDITOR.env.gecko && (c += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;"');
  17566. var c = c + (' onkeydown\x3d"return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus\x3d"return CKEDITOR.tools.callFunction({focusFn},event);" ' + (CKEDITOR.env.ie ? 'onclick\x3d"return false;" onmouseup' : "onclick") + '\x3d"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' +
  17567. (CKEDITOR.env.hc ? "\x26#9660;" : CKEDITOR.env.air ? "\x26nbsp;" : "") + "\x3c/span\x3e\x3c/span\x3e\x3c/a\x3e\x3c/span\x3e"),
  17568. k = CKEDITOR.addTemplate("combo", c);
  17569. CKEDITOR.UI_RICHCOMBO = "richcombo";
  17570. CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass({
  17571. $: function(a) {
  17572. CKEDITOR.tools.extend(this, a, {
  17573. canGroup: !1,
  17574. title: a.label,
  17575. modes: {
  17576. wysiwyg: 1
  17577. },
  17578. editorFocus: 1
  17579. });
  17580. a = this.panel || {};
  17581. delete this.panel;
  17582. this.id = CKEDITOR.tools.getNextNumber();
  17583. this.document = a.parent && a.parent.getDocument() || CKEDITOR.document;
  17584. a.className = "cke_combopanel";
  17585. a.block = {
  17586. multiSelect: a.multiSelect,
  17587. attributes: a.attributes
  17588. };
  17589. a.toolbarRelated = !0;
  17590. this._ = {
  17591. panelDefinition: a,
  17592. items: {}
  17593. }
  17594. },
  17595. proto: {
  17596. renderHtml: function(a) {
  17597. var b = [];
  17598. this.render(a, b);
  17599. return b.join("")
  17600. },
  17601. render: function(a, b) {
  17602. function f() {
  17603. if (this.getState() != CKEDITOR.TRISTATE_ON) {
  17604. var b = this.modes[a.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
  17605. a.readOnly && !this.readOnly && (b = CKEDITOR.TRISTATE_DISABLED);
  17606. this.setState(b);
  17607. this.setValue("");
  17608. b != CKEDITOR.TRISTATE_DISABLED && this.refresh && this.refresh()
  17609. }
  17610. }
  17611. var c =
  17612. CKEDITOR.env,
  17613. h = "cke_" + this.id,
  17614. e = CKEDITOR.tools.addFunction(function(b) {
  17615. l && (a.unlockSelection(1), l = 0);
  17616. g.execute(b)
  17617. }, this),
  17618. d = this,
  17619. g = {
  17620. id: h,
  17621. combo: this,
  17622. focus: function() {
  17623. CKEDITOR.document.getById(h).getChild(1).focus()
  17624. },
  17625. execute: function(b) {
  17626. var c = d._;
  17627. if (c.state != CKEDITOR.TRISTATE_DISABLED)
  17628. if (d.createPanel(a), c.on) c.panel.hide();
  17629. else {
  17630. d.commit();
  17631. var f = d.getValue();
  17632. f ? c.list.mark(f) : c.list.unmarkAll();
  17633. c.panel.showBlock(d.id, new CKEDITOR.dom.element(b), 4)
  17634. }
  17635. },
  17636. clickFn: e
  17637. };
  17638. a.on("activeFilterChange", f, this);
  17639. a.on("mode",
  17640. f, this);
  17641. a.on("selectionChange", f, this);
  17642. !this.readOnly && a.on("readOnly", f, this);
  17643. var m = CKEDITOR.tools.addFunction(function(a, b) {
  17644. a = new CKEDITOR.dom.event(a);
  17645. var d = a.getKeystroke();
  17646. switch (d) {
  17647. case 13:
  17648. case 32:
  17649. case 40:
  17650. CKEDITOR.tools.callFunction(e, b);
  17651. break;
  17652. default:
  17653. g.onkey(g, d)
  17654. }
  17655. a.preventDefault()
  17656. }),
  17657. n = CKEDITOR.tools.addFunction(function() {
  17658. g.onfocus && g.onfocus()
  17659. }),
  17660. l = 0;
  17661. g.keyDownFn = m;
  17662. c = {
  17663. id: h,
  17664. name: this.name || this.command,
  17665. label: this.label,
  17666. title: this.title,
  17667. cls: this.className || "",
  17668. titleJs: c.gecko && !c.hc ? "" : (this.title ||
  17669. "").replace("'", ""),
  17670. keydownFn: m,
  17671. focusFn: n,
  17672. clickFn: e
  17673. };
  17674. k.output(c, b);
  17675. if (this.onRender) this.onRender();
  17676. return g
  17677. },
  17678. createPanel: function(a) {
  17679. if (!this._.panel) {
  17680. var b = this._.panelDefinition,
  17681. c = this._.panelDefinition.block,
  17682. k = b.parent || CKEDITOR.document.getBody(),
  17683. h = "cke_combopanel__" + this.name,
  17684. e = new CKEDITOR.ui.floatPanel(a, k, b),
  17685. b = e.addListBlock(this.id, c),
  17686. d = this;
  17687. e.onShow = function() {
  17688. this.element.addClass(h);
  17689. d.setState(CKEDITOR.TRISTATE_ON);
  17690. d._.on = 1;
  17691. d.editorFocus && !a.focusManager.hasFocus && a.focus();
  17692. if (d.onOpen) d.onOpen()
  17693. };
  17694. e.onHide = function(b) {
  17695. this.element.removeClass(h);
  17696. d.setState(d.modes && d.modes[a.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
  17697. d._.on = 0;
  17698. if (!b && d.onClose) d.onClose()
  17699. };
  17700. e.onEscape = function() {
  17701. e.hide(1)
  17702. };
  17703. b.onClick = function(a, b) {
  17704. d.onClick && d.onClick.call(d, a, b);
  17705. e.hide()
  17706. };
  17707. this._.panel = e;
  17708. this._.list = b;
  17709. e.getBlock(this.id).onHide = function() {
  17710. d._.on = 0;
  17711. d.setState(CKEDITOR.TRISTATE_OFF)
  17712. };
  17713. this.init && this.init()
  17714. }
  17715. },
  17716. setValue: function(a, b) {
  17717. this._.value = a;
  17718. var c = this.document.getById("cke_" + this.id + "_text");
  17719. c &&
  17720. (a || b ? c.removeClass("cke_combo_inlinelabel") : (b = this.label, c.addClass("cke_combo_inlinelabel")), c.setText("undefined" != typeof b ? b : a))
  17721. },
  17722. getValue: function() {
  17723. return this._.value || ""
  17724. },
  17725. unmarkAll: function() {
  17726. this._.list.unmarkAll()
  17727. },
  17728. mark: function(a) {
  17729. this._.list.mark(a)
  17730. },
  17731. hideItem: function(a) {
  17732. this._.list.hideItem(a)
  17733. },
  17734. hideGroup: function(a) {
  17735. this._.list.hideGroup(a)
  17736. },
  17737. showAll: function() {
  17738. this._.list.showAll()
  17739. },
  17740. add: function(a, b, c) {
  17741. this._.items[a] = c || a;
  17742. this._.list.add(a, b, c)
  17743. },
  17744. startGroup: function(a) {
  17745. this._.list.startGroup(a)
  17746. },
  17747. commit: function() {
  17748. this._.committed || (this._.list.commit(), this._.committed = 1, CKEDITOR.ui.fire("ready", this));
  17749. this._.committed = 1
  17750. },
  17751. setState: function(a) {
  17752. if (this._.state != a) {
  17753. var b = this.document.getById("cke_" + this.id);
  17754. b.setState(a, "cke_combo");
  17755. a == CKEDITOR.TRISTATE_DISABLED ? b.setAttribute("aria-disabled", !0) : b.removeAttribute("aria-disabled");
  17756. this._.state = a
  17757. }
  17758. },
  17759. getState: function() {
  17760. return this._.state
  17761. },
  17762. enable: function() {
  17763. this._.state == CKEDITOR.TRISTATE_DISABLED && this.setState(this._.lastState)
  17764. },
  17765. disable: function() {
  17766. this._.state !=
  17767. CKEDITOR.TRISTATE_DISABLED && (this._.lastState = this._.state, this.setState(CKEDITOR.TRISTATE_DISABLED))
  17768. }
  17769. },
  17770. statics: {
  17771. handler: {
  17772. create: function(a) {
  17773. return new CKEDITOR.ui.richCombo(a)
  17774. }
  17775. }
  17776. }
  17777. });
  17778. CKEDITOR.ui.prototype.addRichCombo = function(a, b) {
  17779. this.add(a, CKEDITOR.UI_RICHCOMBO, b)
  17780. }
  17781. })();
  17782. (function() {
  17783. function p(b, f, e, d, r, p, t, x) {
  17784. var y = b.config,
  17785. u = new CKEDITOR.style(t),
  17786. g = r.split(";");
  17787. r = [];
  17788. for (var k = {}, l = 0; l < g.length; l++) {
  17789. var m = g[l];
  17790. if (m) {
  17791. var m = m.split("/"),
  17792. w = {},
  17793. q = g[l] = m[0];
  17794. w[e] = r[l] = m[1] || q;
  17795. k[q] = new CKEDITOR.style(t, w);
  17796. k[q]._.definition.name = q
  17797. } else g.splice(l--, 1)
  17798. }
  17799. b.ui.addRichCombo(f, {
  17800. label: d.label,
  17801. title: d.panelTitle,
  17802. toolbar: "styles," + x,
  17803. defaultValue: "cke-default",
  17804. allowedContent: u,
  17805. requiredContent: u,
  17806. contentTransformations: "span" === t.element ? [
  17807. [{
  17808. element: "font",
  17809. check: "span",
  17810. left: function(a) {
  17811. return !!a.attributes.size ||
  17812. !!a.attributes.align || !!a.attributes.face
  17813. },
  17814. right: function(a) {
  17815. var b = " x-small small medium large x-large xx-large 48px".split(" ");
  17816. a.name = "span";
  17817. a.attributes.size && (a.styles["font-size"] = b[a.attributes.size], delete a.attributes.size);
  17818. a.attributes.align && (a.styles["text-align"] = a.attributes.align, delete a.attributes.align);
  17819. a.attributes.face && (a.styles["font-family"] = a.attributes.face, delete a.attributes.face)
  17820. }
  17821. }]
  17822. ] : null,
  17823. panel: {
  17824. css: [CKEDITOR.skin.getPath("editor")].concat(y.contentsCss),
  17825. multiSelect: !1,
  17826. attributes: {
  17827. "aria-label": d.panelTitle
  17828. }
  17829. },
  17830. init: function() {
  17831. var a;
  17832. a = "(" + b.lang.common.optionDefault + ")";
  17833. this.startGroup(d.panelTitle);
  17834. this.add(this.defaultValue, a, a);
  17835. for (var c = 0; c < g.length; c++) a = g[c], this.add(a, k[a].buildPreview(), a)
  17836. },
  17837. onClick: function(a) {
  17838. b.focus();
  17839. b.fire("saveSnapshot");
  17840. var c = this.getValue(),
  17841. f = k[a],
  17842. e, n, h, d, g;
  17843. if (c && a != c)
  17844. if (e = k[c], c = b.getSelection().getRanges()[0], c.collapsed) {
  17845. if (n = b.elementPath(), h = n.contains(function(a) {
  17846. return e.checkElementRemovable(a)
  17847. })) {
  17848. d = c.checkBoundaryOfElement(h,
  17849. CKEDITOR.START);
  17850. g = c.checkBoundaryOfElement(h, CKEDITOR.END);
  17851. if (d && g) {
  17852. for (d = c.createBookmark(); n = h.getFirst();) n.insertBefore(h);
  17853. h.remove();
  17854. c.moveToBookmark(d)
  17855. } else d || g ? c.moveToPosition(h, d ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_END) : (c.splitElement(h), c.moveToPosition(h, CKEDITOR.POSITION_AFTER_END)), v(c, n.elements.slice(), h);
  17856. b.getSelection().selectRanges([c])
  17857. }
  17858. } else b.removeStyle(e);
  17859. a === this.defaultValue ? e && b.removeStyle(e) : b.applyStyle(f);
  17860. b.fire("saveSnapshot")
  17861. },
  17862. onRender: function() {
  17863. b.on("selectionChange",
  17864. function(a) {
  17865. var c = this.getValue();
  17866. a = a.data.path.elements;
  17867. for (var d = 0, f; d < a.length; d++) {
  17868. f = a[d];
  17869. for (var e in k)
  17870. if (k[e].checkElementMatch(f, !0, b)) {
  17871. e != c && this.setValue(e);
  17872. return
  17873. }
  17874. }
  17875. this.setValue("", p)
  17876. }, this)
  17877. },
  17878. refresh: function() {
  17879. b.activeFilter.check(u) || this.setState(CKEDITOR.TRISTATE_DISABLED)
  17880. }
  17881. })
  17882. }
  17883. function v(b, f, e) {
  17884. var d = f.pop();
  17885. if (d) {
  17886. if (e) return v(b, f, d.equals(e) ? null : e);
  17887. e = d.clone();
  17888. b.insertNode(e);
  17889. b.moveToPosition(e, CKEDITOR.POSITION_AFTER_START);
  17890. v(b, f)
  17891. }
  17892. }
  17893. CKEDITOR.plugins.add("font", {
  17894. requires: "richcombo",
  17895. init: function(b) {
  17896. var f = b.config;
  17897. p(b, "Font", "family", b.lang.font, f.font_names, f.font_defaultLabel, f.font_style, 30);
  17898. p(b, "FontSize", "size", b.lang.font.fontSize, f.fontSize_sizes, f.fontSize_defaultLabel, f.fontSize_style, 40)
  17899. }
  17900. })
  17901. })();
  17902. 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";
  17903. CKEDITOR.config.font_defaultLabel = "";
  17904. CKEDITOR.config.font_style = {
  17905. element: "span",
  17906. styles: {
  17907. "font-family": "#(family)"
  17908. },
  17909. overrides: [{
  17910. element: "font",
  17911. attributes: {
  17912. face: null
  17913. }
  17914. }]
  17915. };
  17916. 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";
  17917. CKEDITOR.config.fontSize_defaultLabel = "";
  17918. CKEDITOR.config.fontSize_style = {
  17919. element: "span",
  17920. styles: {
  17921. "font-size": "#(size)"
  17922. },
  17923. overrides: [{
  17924. element: "font",
  17925. attributes: {
  17926. size: null
  17927. }
  17928. }]
  17929. };
  17930. CKEDITOR.plugins.add("forms", {
  17931. requires: "dialog,fakeobjects",
  17932. onLoad: function() {
  17933. CKEDITOR.addCss(".cke_editable form{border: 1px dotted #FF0000;padding: 2px;}\n");
  17934. 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;}")
  17935. },
  17936. init: function(a) {
  17937. var b = a.lang,
  17938. g = 0,
  17939. h = {
  17940. email: 1,
  17941. password: 1,
  17942. search: 1,
  17943. tel: 1,
  17944. text: 1,
  17945. url: 1
  17946. },
  17947. l = {
  17948. checkbox: "input[type,name,checked,required]",
  17949. radio: "input[type,name,checked,required]",
  17950. textfield: "input[type,name,value,size,maxlength,required]",
  17951. textarea: "textarea[cols,rows,name,required]",
  17952. select: "select[name,size,multiple,required]; option[value,selected]",
  17953. button: "input[type,name,value]",
  17954. form: "form[action,name,id,enctype,target,method]",
  17955. hiddenfield: "input[type,name,value]",
  17956. imagebutton: "input[type,alt,src]{width,height,border,border-width,border-style,margin,float}"
  17957. },
  17958. m = {
  17959. checkbox: "input",
  17960. radio: "input",
  17961. textfield: "input",
  17962. textarea: "textarea",
  17963. select: "select",
  17964. button: "input",
  17965. form: "form",
  17966. hiddenfield: "input",
  17967. imagebutton: "input"
  17968. },
  17969. e = function(d, c, e) {
  17970. var h = {
  17971. allowedContent: l[c],
  17972. requiredContent: m[c]
  17973. };
  17974. "form" == c && (h.context = "form");
  17975. a.addCommand(c, new CKEDITOR.dialogCommand(c, h));
  17976. a.ui.addButton && a.ui.addButton(d, {
  17977. label: b.common[d.charAt(0).toLowerCase() + d.slice(1)],
  17978. command: c,
  17979. toolbar: "forms," + (g += 10)
  17980. });
  17981. CKEDITOR.dialog.add(c, e)
  17982. },
  17983. f = this.path + "dialogs/";
  17984. !a.blockless && e("Form", "form", f + "form.js");
  17985. e("Checkbox", "checkbox", f + "checkbox.js");
  17986. e("Radio", "radio",
  17987. f + "radio.js");
  17988. e("TextField", "textfield", f + "textfield.js");
  17989. e("Textarea", "textarea", f + "textarea.js");
  17990. e("Select", "select", f + "select.js");
  17991. e("Button", "button", f + "button.js");
  17992. var k = a.plugins.image;
  17993. k && !a.plugins.image2 && e("ImageButton", "imagebutton", CKEDITOR.plugins.getPath("image") + "dialogs/image.js");
  17994. e("HiddenField", "hiddenfield", f + "hiddenfield.js");
  17995. a.addMenuItems && (e = {
  17996. checkbox: {
  17997. label: b.forms.checkboxAndRadio.checkboxTitle,
  17998. command: "checkbox",
  17999. group: "checkbox"
  18000. },
  18001. radio: {
  18002. label: b.forms.checkboxAndRadio.radioTitle,
  18003. command: "radio",
  18004. group: "radio"
  18005. },
  18006. textfield: {
  18007. label: b.forms.textfield.title,
  18008. command: "textfield",
  18009. group: "textfield"
  18010. },
  18011. hiddenfield: {
  18012. label: b.forms.hidden.title,
  18013. command: "hiddenfield",
  18014. group: "hiddenfield"
  18015. },
  18016. button: {
  18017. label: b.forms.button.title,
  18018. command: "button",
  18019. group: "button"
  18020. },
  18021. select: {
  18022. label: b.forms.select.title,
  18023. command: "select",
  18024. group: "select"
  18025. },
  18026. textarea: {
  18027. label: b.forms.textarea.title,
  18028. command: "textarea",
  18029. group: "textarea"
  18030. }
  18031. }, k && (e.imagebutton = {
  18032. label: b.image.titleButton,
  18033. command: "imagebutton",
  18034. group: "imagebutton"
  18035. }), !a.blockless &&
  18036. (e.form = {
  18037. label: b.forms.form.menu,
  18038. command: "form",
  18039. group: "form"
  18040. }), a.addMenuItems(e));
  18041. a.contextMenu && (!a.blockless && a.contextMenu.addListener(function(d, c, a) {
  18042. if ((d = a.contains("form", 1)) && !d.isReadOnly()) return {
  18043. form: CKEDITOR.TRISTATE_OFF
  18044. }
  18045. }), a.contextMenu.addListener(function(d) {
  18046. if (d && !d.isReadOnly()) {
  18047. var c = d.getName();
  18048. if ("select" == c) return {
  18049. select: CKEDITOR.TRISTATE_OFF
  18050. };
  18051. if ("textarea" == c) return {
  18052. textarea: CKEDITOR.TRISTATE_OFF
  18053. };
  18054. if ("input" == c) {
  18055. var a = d.getAttribute("type") || "text";
  18056. switch (a) {
  18057. case "button":
  18058. case "submit":
  18059. case "reset":
  18060. return {
  18061. button: CKEDITOR.TRISTATE_OFF
  18062. };
  18063. case "checkbox":
  18064. return {
  18065. checkbox: CKEDITOR.TRISTATE_OFF
  18066. };
  18067. case "radio":
  18068. return {
  18069. radio: CKEDITOR.TRISTATE_OFF
  18070. };
  18071. case "image":
  18072. return k ? {
  18073. imagebutton: CKEDITOR.TRISTATE_OFF
  18074. } : null
  18075. }
  18076. if (h[a]) return {
  18077. textfield: CKEDITOR.TRISTATE_OFF
  18078. }
  18079. }
  18080. if ("img" == c && "hiddenfield" == d.data("cke-real-element-type")) return {
  18081. hiddenfield: CKEDITOR.TRISTATE_OFF
  18082. }
  18083. }
  18084. }));
  18085. a.on("doubleclick", function(d) {
  18086. var c = d.data.element;
  18087. if (!a.blockless && c.is("form")) d.data.dialog = "form";
  18088. else if (c.is("select")) d.data.dialog = "select";
  18089. else if (c.is("textarea")) d.data.dialog =
  18090. "textarea";
  18091. else if (c.is("img") && "hiddenfield" == c.data("cke-real-element-type")) d.data.dialog = "hiddenfield";
  18092. else if (c.is("input")) {
  18093. c = c.getAttribute("type") || "text";
  18094. switch (c) {
  18095. case "button":
  18096. case "submit":
  18097. case "reset":
  18098. d.data.dialog = "button";
  18099. break;
  18100. case "checkbox":
  18101. d.data.dialog = "checkbox";
  18102. break;
  18103. case "radio":
  18104. d.data.dialog = "radio";
  18105. break;
  18106. case "image":
  18107. d.data.dialog = "imagebutton"
  18108. }
  18109. h[c] && (d.data.dialog = "textfield")
  18110. }
  18111. })
  18112. },
  18113. afterInit: function(a) {
  18114. var b = a.dataProcessor,
  18115. g = b && b.htmlFilter,
  18116. b = b && b.dataFilter;
  18117. CKEDITOR.env.ie &&
  18118. g && g.addRules({
  18119. elements: {
  18120. input: function(a) {
  18121. a = a.attributes;
  18122. var b = a.type;
  18123. b || (a.type = "text");
  18124. "checkbox" != b && "radio" != b || "on" != a.value || delete a.value
  18125. }
  18126. }
  18127. }, {
  18128. applyToAll: !0
  18129. });
  18130. b && b.addRules({
  18131. elements: {
  18132. input: function(b) {
  18133. if ("hidden" == b.attributes.type) return a.createFakeParserElement(b, "cke_hidden", "hiddenfield")
  18134. }
  18135. }
  18136. }, {
  18137. applyToAll: !0
  18138. })
  18139. }
  18140. });
  18141. CKEDITOR.plugins.add("format", {
  18142. requires: "richcombo",
  18143. init: function(a) {
  18144. if (!a.blockless) {
  18145. for (var f = a.config, c = a.lang.format, l = f.format_tags.split(";"), d = {}, m = 0, n = [], g = 0; g < l.length; g++) {
  18146. var h = l[g],
  18147. k = new CKEDITOR.style(f["format_" + h]);
  18148. if (!a.filter.customConfig || a.filter.check(k)) m++, d[h] = k, d[h]._.enterMode = a.config.enterMode, n.push(k)
  18149. }
  18150. 0 !== m && a.ui.addRichCombo("Format", {
  18151. label: c.label,
  18152. title: c.panelTitle,
  18153. toolbar: "styles,20",
  18154. allowedContent: n,
  18155. panel: {
  18156. css: [CKEDITOR.skin.getPath("editor")].concat(f.contentsCss),
  18157. multiSelect: !1,
  18158. attributes: {
  18159. "aria-label": c.panelTitle
  18160. }
  18161. },
  18162. init: function() {
  18163. this.startGroup(c.panelTitle);
  18164. for (var a in d) {
  18165. var e = c["tag_" + a];
  18166. this.add(a, d[a].buildPreview(e), e)
  18167. }
  18168. },
  18169. onClick: function(b) {
  18170. a.focus();
  18171. a.fire("saveSnapshot");
  18172. b = d[b];
  18173. var e = a.elementPath();
  18174. b.checkActive(e, a) || a.applyStyle(b);
  18175. setTimeout(function() {
  18176. a.fire("saveSnapshot")
  18177. }, 0)
  18178. },
  18179. onRender: function() {
  18180. a.on("selectionChange", function(b) {
  18181. var e = this.getValue();
  18182. b = b.data.path;
  18183. this.refresh();
  18184. for (var c in d)
  18185. if (d[c].checkActive(b, a)) {
  18186. c != e && this.setValue(c,
  18187. a.lang.format["tag_" + c]);
  18188. return
  18189. } this.setValue("")
  18190. }, this)
  18191. },
  18192. onOpen: function() {
  18193. this.showAll();
  18194. for (var b in d) a.activeFilter.check(d[b]) || this.hideItem(b)
  18195. },
  18196. refresh: function() {
  18197. var b = a.elementPath();
  18198. if (b) {
  18199. if (b.isContextFor("p"))
  18200. for (var c in d)
  18201. if (a.activeFilter.check(d[c])) return;
  18202. this.setState(CKEDITOR.TRISTATE_DISABLED)
  18203. }
  18204. }
  18205. })
  18206. }
  18207. }
  18208. });
  18209. CKEDITOR.config.format_tags = "p;h1;h2;h3;h4;h5;h6;pre;address;div";
  18210. CKEDITOR.config.format_p = {
  18211. element: "p"
  18212. };
  18213. CKEDITOR.config.format_div = {
  18214. element: "div"
  18215. };
  18216. CKEDITOR.config.format_pre = {
  18217. element: "pre"
  18218. };
  18219. CKEDITOR.config.format_address = {
  18220. element: "address"
  18221. };
  18222. CKEDITOR.config.format_h1 = {
  18223. element: "h1"
  18224. };
  18225. CKEDITOR.config.format_h2 = {
  18226. element: "h2"
  18227. };
  18228. CKEDITOR.config.format_h3 = {
  18229. element: "h3"
  18230. };
  18231. CKEDITOR.config.format_h4 = {
  18232. element: "h4"
  18233. };
  18234. CKEDITOR.config.format_h5 = {
  18235. element: "h5"
  18236. };
  18237. CKEDITOR.config.format_h6 = {
  18238. element: "h6"
  18239. };
  18240. (function() {
  18241. var b = {
  18242. canUndo: !1,
  18243. exec: function(a) {
  18244. var b = a.document.createElement("hr");
  18245. a.insertElement(b)
  18246. },
  18247. allowedContent: "hr",
  18248. requiredContent: "hr"
  18249. };
  18250. CKEDITOR.plugins.add("horizontalrule", {
  18251. init: function(a) {
  18252. a.blockless || (a.addCommand("horizontalrule", b), a.ui.addButton && a.ui.addButton("HorizontalRule", {
  18253. label: a.lang.horizontalrule.toolbar,
  18254. command: "horizontalrule",
  18255. toolbar: "insert,40"
  18256. }))
  18257. }
  18258. })
  18259. })();
  18260. CKEDITOR.plugins.add("htmlwriter", {
  18261. init: function(b) {
  18262. var a = new CKEDITOR.htmlWriter;
  18263. a.forceSimpleAmpersand = b.config.forceSimpleAmpersand;
  18264. a.indentationChars = b.config.dataIndentationChars || "\t";
  18265. b.dataProcessor.writer = a
  18266. }
  18267. });
  18268. CKEDITOR.htmlWriter = CKEDITOR.tools.createClass({
  18269. base: CKEDITOR.htmlParser.basicWriter,
  18270. $: function() {
  18271. this.base();
  18272. this.indentationChars = "\t";
  18273. this.selfClosingEnd = " /\x3e";
  18274. this.lineBreakChars = "\n";
  18275. this.sortAttributes = 1;
  18276. this._.indent = 0;
  18277. this._.indentation = "";
  18278. this._.inPre = 0;
  18279. this._.rules = {};
  18280. var b = CKEDITOR.dtd,
  18281. a;
  18282. for (a in CKEDITOR.tools.extend({}, b.$nonBodyContent, b.$block, b.$listItem, b.$tableContent)) this.setRules(a, {
  18283. indent: !b[a]["#"],
  18284. breakBeforeOpen: 1,
  18285. breakBeforeClose: !b[a]["#"],
  18286. breakAfterClose: 1,
  18287. needsSpace: a in
  18288. b.$block && !(a in {
  18289. li: 1,
  18290. dt: 1,
  18291. dd: 1
  18292. })
  18293. });
  18294. this.setRules("br", {
  18295. breakAfterOpen: 1
  18296. });
  18297. this.setRules("title", {
  18298. indent: 0,
  18299. breakAfterOpen: 0
  18300. });
  18301. this.setRules("style", {
  18302. indent: 0,
  18303. breakBeforeClose: 1
  18304. });
  18305. this.setRules("pre", {
  18306. breakAfterOpen: 1,
  18307. indent: 0
  18308. })
  18309. },
  18310. proto: {
  18311. openTag: function(b) {
  18312. var a = this._.rules[b];
  18313. this._.afterCloser && a && a.needsSpace && this._.needsSpace && this._.output.push("\n");
  18314. this._.indent ? this.indentation() : a && a.breakBeforeOpen && (this.lineBreak(), this.indentation());
  18315. this._.output.push("\x3c", b);
  18316. this._.afterCloser = 0
  18317. },
  18318. openTagClose: function(b, a) {
  18319. var c = this._.rules[b];
  18320. a ? (this._.output.push(this.selfClosingEnd), c && c.breakAfterClose && (this._.needsSpace = c.needsSpace)) : (this._.output.push("\x3e"), c && c.indent && (this._.indentation += this.indentationChars));
  18321. c && c.breakAfterOpen && this.lineBreak();
  18322. "pre" == b && (this._.inPre = 1)
  18323. },
  18324. attribute: function(b, a) {
  18325. "string" == typeof a && (this.forceSimpleAmpersand && (a = a.replace(/&amp;/g, "\x26")), a = CKEDITOR.tools.htmlEncodeAttr(a));
  18326. this._.output.push(" ", b, '\x3d"', a, '"')
  18327. },
  18328. closeTag: function(b) {
  18329. var a =
  18330. this._.rules[b];
  18331. a && a.indent && (this._.indentation = this._.indentation.substr(this.indentationChars.length));
  18332. this._.indent ? this.indentation() : a && a.breakBeforeClose && (this.lineBreak(), this.indentation());
  18333. this._.output.push("\x3c/", b, "\x3e");
  18334. "pre" == b && (this._.inPre = 0);
  18335. a && a.breakAfterClose && (this.lineBreak(), this._.needsSpace = a.needsSpace);
  18336. this._.afterCloser = 1
  18337. },
  18338. text: function(b) {
  18339. this._.indent && (this.indentation(), !this._.inPre && (b = CKEDITOR.tools.ltrim(b)));
  18340. this._.output.push(b)
  18341. },
  18342. comment: function(b) {
  18343. this._.indent &&
  18344. this.indentation();
  18345. this._.output.push("\x3c!--", b, "--\x3e")
  18346. },
  18347. lineBreak: function() {
  18348. !this._.inPre && 0 < this._.output.length && this._.output.push(this.lineBreakChars);
  18349. this._.indent = 1
  18350. },
  18351. indentation: function() {
  18352. !this._.inPre && this._.indentation && this._.output.push(this._.indentation);
  18353. this._.indent = 0
  18354. },
  18355. reset: function() {
  18356. this._.output = [];
  18357. this._.indent = 0;
  18358. this._.indentation = "";
  18359. this._.afterCloser = 0;
  18360. this._.inPre = 0;
  18361. this._.needsSpace = 0
  18362. },
  18363. setRules: function(b, a) {
  18364. var c = this._.rules[b];
  18365. c ? CKEDITOR.tools.extend(c, a, !0) : this._.rules[b] =
  18366. a
  18367. }
  18368. }
  18369. });
  18370. (function() {
  18371. CKEDITOR.plugins.add("iframe", {
  18372. requires: "dialog,fakeobjects",
  18373. onLoad: function() {
  18374. 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;}")
  18375. },
  18376. init: function(a) {
  18377. var b = a.lang.iframe,
  18378. c = "iframe[align,longdesc,frameborder,height,name,scrolling,src,title,width]";
  18379. a.plugins.dialogadvtab && (c += ";iframe" + a.plugins.dialogadvtab.allowedContent({
  18380. id: 1,
  18381. classes: 1,
  18382. styles: 1
  18383. }));
  18384. CKEDITOR.dialog.add("iframe", this.path + "dialogs/iframe.js");
  18385. a.addCommand("iframe", new CKEDITOR.dialogCommand("iframe", {
  18386. allowedContent: c,
  18387. requiredContent: "iframe"
  18388. }));
  18389. a.ui.addButton && a.ui.addButton("Iframe", {
  18390. label: b.toolbar,
  18391. command: "iframe",
  18392. toolbar: "insert,80"
  18393. });
  18394. a.on("doubleclick", function(a) {
  18395. var b = a.data.element;
  18396. b.is("img") && "iframe" == b.data("cke-real-element-type") && (a.data.dialog = "iframe")
  18397. });
  18398. a.addMenuItems && a.addMenuItems({
  18399. iframe: {
  18400. label: b.title,
  18401. command: "iframe",
  18402. group: "image"
  18403. }
  18404. });
  18405. a.contextMenu && a.contextMenu.addListener(function(a) {
  18406. if (a && a.is("img") && "iframe" == a.data("cke-real-element-type")) return {
  18407. iframe: CKEDITOR.TRISTATE_OFF
  18408. }
  18409. })
  18410. },
  18411. afterInit: function(a) {
  18412. var b = a.dataProcessor;
  18413. (b = b && b.dataFilter) && b.addRules({
  18414. elements: {
  18415. iframe: function(b) {
  18416. return a.createFakeParserElement(b, "cke_iframe", "iframe", !0)
  18417. }
  18418. }
  18419. })
  18420. }
  18421. })
  18422. })();
  18423. (function() {
  18424. function m(a) {
  18425. function f(a) {
  18426. var b = !1;
  18427. g.attachListener(g, "keydown", function() {
  18428. var d = c.getBody().getElementsByTag(a);
  18429. if (!b) {
  18430. for (var e = 0; e < d.count(); e++) d.getItem(e).setCustomData("retain", !0);
  18431. b = !0
  18432. }
  18433. }, null, null, 1);
  18434. g.attachListener(g, "keyup", function() {
  18435. var d = c.getElementsByTag(a);
  18436. b && (1 == d.count() && !d.getItem(0).getCustomData("retain") && CKEDITOR.tools.isEmpty(d.getItem(0).getAttributes()) && d.getItem(0).remove(1), b = !1)
  18437. })
  18438. }
  18439. var b = this.editor,
  18440. c = a.document,
  18441. d = c.body,
  18442. e = c.getElementById("cke_actscrpt");
  18443. e && e.parentNode.removeChild(e);
  18444. (e = c.getElementById("cke_shimscrpt")) && e.parentNode.removeChild(e);
  18445. (e = c.getElementById("cke_basetagscrpt")) && e.parentNode.removeChild(e);
  18446. d.contentEditable = !0;
  18447. CKEDITOR.env.ie && (d.hideFocus = !0, d.disabled = !0, d.removeAttribute("disabled"));
  18448. delete this._.isLoadingData;
  18449. this.$ = d;
  18450. c = new CKEDITOR.dom.document(c);
  18451. this.setup();
  18452. this.fixInitialSelection();
  18453. var g = this;
  18454. CKEDITOR.env.ie && !CKEDITOR.env.edge && c.getDocumentElement().addClass(c.$.compatMode);
  18455. CKEDITOR.env.ie && !CKEDITOR.env.edge &&
  18456. b.enterMode != CKEDITOR.ENTER_P ? f("p") : CKEDITOR.env.edge && 15 > CKEDITOR.env.version && b.enterMode != CKEDITOR.ENTER_DIV && f("div");
  18457. if (CKEDITOR.env.webkit || CKEDITOR.env.ie && 10 < CKEDITOR.env.version) c.getDocumentElement().on("mousedown", function(a) {
  18458. a.data.getTarget().is("html") && setTimeout(function() {
  18459. b.editable().focus()
  18460. })
  18461. });
  18462. n(b);
  18463. try {
  18464. b.document.$.execCommand("2D-position", !1, !0)
  18465. } catch (h) {}(CKEDITOR.env.gecko || CKEDITOR.env.ie && "CSS1Compat" == b.document.$.compatMode) && this.attachListener(this, "keydown", function(a) {
  18466. var c =
  18467. a.data.getKeystroke();
  18468. if (33 == c || 34 == c)
  18469. if (CKEDITOR.env.ie) setTimeout(function() {
  18470. b.getSelection().scrollIntoView()
  18471. }, 0);
  18472. else if (b.window.$.innerHeight > this.$.offsetHeight) {
  18473. var d = b.createRange();
  18474. d[33 == c ? "moveToElementEditStart" : "moveToElementEditEnd"](this);
  18475. d.select();
  18476. a.data.preventDefault()
  18477. }
  18478. });
  18479. CKEDITOR.env.ie && this.attachListener(c, "blur", function() {
  18480. try {
  18481. c.$.selection.empty()
  18482. } catch (a) {}
  18483. });
  18484. CKEDITOR.env.iOS && this.attachListener(c, "touchend", function() {
  18485. a.focus()
  18486. });
  18487. d = b.document.getElementsByTag("title").getItem(0);
  18488. d.data("cke-title", d.getText());
  18489. CKEDITOR.env.ie && (b.document.$.title = this._.docTitle);
  18490. CKEDITOR.tools.setTimeout(function() {
  18491. "unloaded" == this.status && (this.status = "ready");
  18492. b.fire("contentDom");
  18493. this._.isPendingFocus && (b.focus(), this._.isPendingFocus = !1);
  18494. setTimeout(function() {
  18495. b.fire("dataReady")
  18496. }, 0)
  18497. }, 0, this)
  18498. }
  18499. function n(a) {
  18500. function f() {
  18501. var c;
  18502. a.editable().attachListener(a, "selectionChange", function() {
  18503. var d = a.getSelection().getSelectedElement();
  18504. d && (c && (c.detachEvent("onresizestart", b), c = null), d.$.attachEvent("onresizestart",
  18505. b), c = d.$)
  18506. })
  18507. }
  18508. function b(a) {
  18509. a.returnValue = !1
  18510. }
  18511. if (CKEDITOR.env.gecko) try {
  18512. var c = a.document.$;
  18513. c.execCommand("enableObjectResizing", !1, !a.config.disableObjectResizing);
  18514. c.execCommand("enableInlineTableEditing", !1, !a.config.disableNativeTableHandles)
  18515. } catch (d) {} else CKEDITOR.env.ie && 11 > CKEDITOR.env.version && a.config.disableObjectResizing && f(a)
  18516. }
  18517. function p() {
  18518. var a = [];
  18519. if (8 <= CKEDITOR.document.$.documentMode) {
  18520. a.push("html.CSS1Compat [contenteditable\x3dfalse]{min-height:0 !important}");
  18521. var f = [],
  18522. b;
  18523. for (b in CKEDITOR.dtd.$removeEmpty) f.push("html.CSS1Compat " +
  18524. b + "[contenteditable\x3dfalse]");
  18525. a.push(f.join(",") + "{display:inline-block}")
  18526. } 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}"));
  18527. a.push("html{cursor:text;*cursor:auto}");
  18528. a.push("img,input,textarea{cursor:default}");
  18529. return a.join("\n")
  18530. }
  18531. var l;
  18532. CKEDITOR.plugins.add("wysiwygarea", {
  18533. init: function(a) {
  18534. a.config.fullPage && a.addFeature({
  18535. allowedContent: "html head title; style [media,type]; body (*)[id]; meta link [*]",
  18536. requiredContent: "body"
  18537. });
  18538. a.addMode("wysiwyg", function(f) {
  18539. function b(b) {
  18540. b && b.removeListener();
  18541. a.editable(new l(a, d.$.contentWindow.document.body));
  18542. a.setData(a.getData(1), f)
  18543. }
  18544. var c = "document.open();" + (CKEDITOR.env.ie ? "(" + CKEDITOR.tools.fixDomain + ")();" : "") + "document.close();",
  18545. c = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie && !CKEDITOR.env.edge ? "javascript:void(function(){" + encodeURIComponent(c) + "}())" : "",
  18546. d = CKEDITOR.dom.element.createFromHtml('\x3ciframe src\x3d"' + c + '" frameBorder\x3d"0"\x3e\x3c/iframe\x3e');
  18547. d.setStyles({
  18548. width: "100%",
  18549. height: "100%"
  18550. });
  18551. d.addClass("cke_wysiwyg_frame").addClass("cke_reset");
  18552. c = a.ui.space("contents");
  18553. c.append(d);
  18554. var e = CKEDITOR.env.ie && !CKEDITOR.env.edge || CKEDITOR.env.gecko;
  18555. if (e) d.on("load", b);
  18556. var g = a.title,
  18557. h = a.fire("ariaEditorHelpLabel", {}).label;
  18558. g && (CKEDITOR.env.ie && h && (g += ", " + h), d.setAttribute("title", g));
  18559. if (h) {
  18560. var g = CKEDITOR.tools.getNextId(),
  18561. k = CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"' + g + '" class\x3d"cke_voice_label"\x3e' + h + "\x3c/span\x3e");
  18562. c.append(k, 1);
  18563. d.setAttribute("aria-describedby",
  18564. g)
  18565. }
  18566. a.on("beforeModeUnload", function(a) {
  18567. a.removeListener();
  18568. k && k.remove()
  18569. });
  18570. d.setAttributes({
  18571. tabIndex: a.tabIndex,
  18572. allowTransparency: "true"
  18573. });
  18574. !e && b();
  18575. a.fire("ariaWidget", d)
  18576. })
  18577. }
  18578. });
  18579. CKEDITOR.editor.prototype.addContentsCss = function(a) {
  18580. var f = this.config,
  18581. b = f.contentsCss;
  18582. CKEDITOR.tools.isArray(b) || (f.contentsCss = b ? [b] : []);
  18583. f.contentsCss.push(a)
  18584. };
  18585. l = CKEDITOR.tools.createClass({
  18586. $: function() {
  18587. this.base.apply(this, arguments);
  18588. this._.frameLoadedHandler = CKEDITOR.tools.addFunction(function(a) {
  18589. CKEDITOR.tools.setTimeout(m,
  18590. 0, this, a)
  18591. }, this);
  18592. this._.docTitle = this.getWindow().getFrame().getAttribute("title")
  18593. },
  18594. base: CKEDITOR.editable,
  18595. proto: {
  18596. setData: function(a, f) {
  18597. var b = this.editor;
  18598. if (f) this.setHtml(a), this.fixInitialSelection(), b.fire("dataReady");
  18599. else {
  18600. this._.isLoadingData = !0;
  18601. b._.dataStore = {
  18602. id: 1
  18603. };
  18604. var c = b.config,
  18605. d = c.fullPage,
  18606. e = c.docType,
  18607. g = CKEDITOR.tools.buildStyleHtml(p()).replace(/<style>/, '\x3cstyle data-cke-temp\x3d"1"\x3e');
  18608. d || (g += CKEDITOR.tools.buildStyleHtml(b.config.contentsCss));
  18609. var h = c.baseHref ? '\x3cbase href\x3d"' +
  18610. c.baseHref + '" data-cke-temp\x3d"1" /\x3e' : "";
  18611. d && (a = a.replace(/<!DOCTYPE[^>]*>/i, function(a) {
  18612. b.docType = e = a;
  18613. return ""
  18614. }).replace(/<\?xml\s[^\?]*\?>/i, function(a) {
  18615. b.xmlDeclaration = a;
  18616. return ""
  18617. }));
  18618. a = b.dataProcessor.toHtml(a);
  18619. d ? (/<body[\s|>]/.test(a) || (a = "\x3cbody\x3e" + a), /<html[\s|>]/.test(a) || (a = "\x3chtml\x3e" + a + "\x3c/html\x3e"), /<head[\s|>]/.test(a) ? /<title[\s|>]/.test(a) || (a = a.replace(/<head[^>]*>/, "$\x26\x3ctitle\x3e\x3c/title\x3e")) : a = a.replace(/<html[^>]*>/, "$\x26\x3chead\x3e\x3ctitle\x3e\x3c/title\x3e\x3c/head\x3e"),
  18620. h && (a = a.replace(/<head[^>]*?>/, "$\x26" + h)), a = a.replace(/<\/head\s*>/, g + "$\x26"), a = e + a) : a = c.docType + '\x3chtml dir\x3d"' + c.contentsLangDirection + '" lang\x3d"' + (c.contentsLanguage || b.langCode) + '"\x3e\x3chead\x3e\x3ctitle\x3e' + this._.docTitle + "\x3c/title\x3e" + h + g + "\x3c/head\x3e\x3cbody" + (c.bodyId ? ' id\x3d"' + c.bodyId + '"' : "") + (c.bodyClass ? ' class\x3d"' + c.bodyClass + '"' : "") + "\x3e" + a + "\x3c/body\x3e\x3c/html\x3e";
  18621. CKEDITOR.env.gecko && (a = a.replace(/<body/, '\x3cbody contenteditable\x3d"true" '), 2E4 > CKEDITOR.env.version &&
  18622. (a = a.replace(/<body[^>]*>/, "$\x26\x3c!-- cke-content-start --\x3e")));
  18623. c = '\x3cscript id\x3d"cke_actscrpt" type\x3d"text/javascript"' + (CKEDITOR.env.ie ? ' defer\x3d"defer" ' : "") + "\x3evar wasLoaded\x3d0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction(" + this._.frameLoadedHandler + ",window);wasLoaded\x3d1;}" + (CKEDITOR.env.ie ? "onload();" : 'document.addEventListener("DOMContentLoaded", onload, false );') + "\x3c/script\x3e";
  18624. CKEDITOR.env.ie && 9 > CKEDITOR.env.version && (c += '\x3cscript id\x3d"cke_shimscrpt"\x3ewindow.parent.CKEDITOR.tools.enableHtml5Elements(document)\x3c/script\x3e');
  18625. h && CKEDITOR.env.ie && 10 > CKEDITOR.env.version && (c += '\x3cscript id\x3d"cke_basetagscrpt"\x3evar baseTag \x3d document.querySelector( "base" );baseTag.href \x3d baseTag.href;\x3c/script\x3e');
  18626. a = a.replace(/(?=\s*<\/(:?head)>)/, c);
  18627. this.clearCustomData();
  18628. this.clearListeners();
  18629. b.fire("contentDomUnload");
  18630. var k = this.getDocument();
  18631. try {
  18632. k.write(a)
  18633. } catch (l) {
  18634. setTimeout(function() {
  18635. k.write(a)
  18636. }, 0)
  18637. }
  18638. }
  18639. },
  18640. getData: function(a) {
  18641. if (a) return this.getHtml();
  18642. a = this.editor;
  18643. var f = a.config,
  18644. b = f.fullPage,
  18645. c = b && a.docType,
  18646. d = b && a.xmlDeclaration,
  18647. e = this.getDocument(),
  18648. b = b ? e.getDocumentElement().getOuterHtml() : e.getBody().getHtml();
  18649. CKEDITOR.env.gecko && f.enterMode != CKEDITOR.ENTER_BR && (b = b.replace(/<br>(?=\s*(:?$|<\/body>))/, ""));
  18650. b = a.dataProcessor.toDataFormat(b);
  18651. d && (b = d + "\n" + b);
  18652. c && (b = c + "\n" + b);
  18653. return b
  18654. },
  18655. focus: function() {
  18656. this._.isLoadingData ? this._.isPendingFocus = !0 : l.baseProto.focus.call(this)
  18657. },
  18658. detach: function() {
  18659. var a = this.editor,
  18660. f = a.document,
  18661. b;
  18662. try {
  18663. b = a.window.getFrame()
  18664. } catch (c) {}
  18665. l.baseProto.detach.call(this);
  18666. this.clearCustomData();
  18667. f.getDocumentElement().clearCustomData();
  18668. CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);
  18669. b && b.getParent() ? (b.clearCustomData(), (a = b.removeCustomData("onResize")) && a.removeListener(), b.remove()) : CKEDITOR.warn("editor-destroy-iframe")
  18670. }
  18671. }
  18672. })
  18673. })();
  18674. CKEDITOR.config.disableObjectResizing = !1;
  18675. CKEDITOR.config.disableNativeTableHandles = !0;
  18676. CKEDITOR.config.disableNativeSpellChecker = !0;
  18677. (function() {
  18678. function e(b, a) {
  18679. a || (a = b.getSelection().getSelectedElement());
  18680. if (a && a.is("img") && !a.data("cke-realelement") && !a.isReadOnly()) return a
  18681. }
  18682. function f(b) {
  18683. var a = b.getStyle("float");
  18684. if ("inherit" == a || "none" == a) a = 0;
  18685. a || (a = b.getAttribute("align"));
  18686. return a
  18687. }
  18688. CKEDITOR.plugins.add("image", {
  18689. requires: "dialog",
  18690. init: function(b) {
  18691. if (!b.plugins.detectConflict("image", ["easyimage", "image2"])) {
  18692. CKEDITOR.dialog.add("image", this.path + "dialogs/image.js");
  18693. var a = "img[alt,!src]{border-style,border-width,float,height,margin,margin-bottom,margin-left,margin-right,margin-top,width}";
  18694. CKEDITOR.dialog.isTabEnabled(b, "image", "advanced") && (a = "img[alt,dir,id,lang,longdesc,!src,title]{*}(*)");
  18695. b.addCommand("image", new CKEDITOR.dialogCommand("image", {
  18696. allowedContent: a,
  18697. requiredContent: "img[alt,src]",
  18698. contentTransformations: [
  18699. ["img{width}: sizeToStyle", "img[width]: sizeToAttribute"],
  18700. ["img{float}: alignmentToStyle", "img[align]: alignmentToAttribute"]
  18701. ]
  18702. }));
  18703. b.ui.addButton && b.ui.addButton("Image", {
  18704. label: b.lang.common.image,
  18705. command: "image",
  18706. toolbar: "insert,10"
  18707. });
  18708. b.on("doubleclick", function(b) {
  18709. var a =
  18710. b.data.element;
  18711. !a.is("img") || a.data("cke-realelement") || a.isReadOnly() || (b.data.dialog = "image")
  18712. });
  18713. b.addMenuItems && b.addMenuItems({
  18714. image: {
  18715. label: b.lang.image.menu,
  18716. command: "image",
  18717. group: "image"
  18718. }
  18719. });
  18720. b.contextMenu && b.contextMenu.addListener(function(a) {
  18721. if (e(b, a)) return {
  18722. image: CKEDITOR.TRISTATE_OFF
  18723. }
  18724. })
  18725. }
  18726. },
  18727. afterInit: function(b) {
  18728. function a(a) {
  18729. var d = b.getCommand("justify" + a);
  18730. if (d) {
  18731. if ("left" == a || "right" == a) d.on("exec", function(d) {
  18732. var c = e(b),
  18733. g;
  18734. c && (g = f(c), g == a ? (c.removeStyle("float"), a == f(c) && c.removeAttribute("align")) :
  18735. c.setStyle("float", a), d.cancel())
  18736. });
  18737. d.on("refresh", function(d) {
  18738. var c = e(b);
  18739. c && (c = f(c), this.setState(c == a ? CKEDITOR.TRISTATE_ON : "right" == a || "left" == a ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED), d.cancel())
  18740. })
  18741. }
  18742. }
  18743. b.plugins.image2 || (a("left"), a("right"), a("center"), a("block"))
  18744. }
  18745. })
  18746. })();
  18747. CKEDITOR.config.image_removeLinkByEmptyURL = !0;
  18748. (function() {
  18749. function m(a, b) {
  18750. var e, f;
  18751. b.on("refresh", function(a) {
  18752. var b = [k],
  18753. c;
  18754. for (c in a.data.states) b.push(a.data.states[c]);
  18755. this.setState(CKEDITOR.tools.search(b, p) ? p : k)
  18756. }, b, null, 100);
  18757. b.on("exec", function(b) {
  18758. e = a.getSelection();
  18759. f = e.createBookmarks(1);
  18760. b.data || (b.data = {});
  18761. b.data.done = !1
  18762. }, b, null, 0);
  18763. b.on("exec", function() {
  18764. a.forceNextSelectionCheck();
  18765. e.selectBookmarks(f)
  18766. }, b, null, 100)
  18767. }
  18768. var k = CKEDITOR.TRISTATE_DISABLED,
  18769. p = CKEDITOR.TRISTATE_OFF;
  18770. CKEDITOR.plugins.add("indent", {
  18771. init: function(a) {
  18772. var b = CKEDITOR.plugins.indent.genericDefinition;
  18773. m(a, a.addCommand("indent", new b(!0)));
  18774. m(a, a.addCommand("outdent", new b));
  18775. a.ui.addButton && (a.ui.addButton("Indent", {
  18776. label: a.lang.indent.indent,
  18777. command: "indent",
  18778. directional: !0,
  18779. toolbar: "indent,20"
  18780. }), a.ui.addButton("Outdent", {
  18781. label: a.lang.indent.outdent,
  18782. command: "outdent",
  18783. directional: !0,
  18784. toolbar: "indent,10"
  18785. }));
  18786. a.on("dirChanged", function(b) {
  18787. var f = a.createRange(),
  18788. l = b.data.node;
  18789. f.setStartBefore(l);
  18790. f.setEndAfter(l);
  18791. for (var n = new CKEDITOR.dom.walker(f), c; c = n.next();)
  18792. if (c.type == CKEDITOR.NODE_ELEMENT)
  18793. if (!c.equals(l) &&
  18794. c.getDirection()) f.setStartAfter(c), n = new CKEDITOR.dom.walker(f);
  18795. else {
  18796. var d = a.config.indentClasses;
  18797. if (d)
  18798. for (var g = "ltr" == b.data.dir ? ["_rtl", ""] : ["", "_rtl"], h = 0; h < d.length; h++) c.hasClass(d[h] + g[0]) && (c.removeClass(d[h] + g[0]), c.addClass(d[h] + g[1]));
  18799. d = c.getStyle("margin-right");
  18800. g = c.getStyle("margin-left");
  18801. d ? c.setStyle("margin-left", d) : c.removeStyle("margin-left");
  18802. g ? c.setStyle("margin-right", g) : c.removeStyle("margin-right")
  18803. }
  18804. })
  18805. }
  18806. });
  18807. CKEDITOR.plugins.indent = {
  18808. genericDefinition: function(a) {
  18809. this.isIndent = !!a;
  18810. this.startDisabled = !this.isIndent
  18811. },
  18812. specificDefinition: function(a, b, e) {
  18813. this.name = b;
  18814. this.editor = a;
  18815. this.jobs = {};
  18816. this.enterBr = a.config.enterMode == CKEDITOR.ENTER_BR;
  18817. this.isIndent = !!e;
  18818. this.relatedGlobal = e ? "indent" : "outdent";
  18819. this.indentKey = e ? 9 : CKEDITOR.SHIFT + 9;
  18820. this.database = {}
  18821. },
  18822. registerCommands: function(a, b) {
  18823. a.on("pluginsLoaded", function() {
  18824. for (var a in b)(function(a, b) {
  18825. var e = a.getCommand(b.relatedGlobal),
  18826. c;
  18827. for (c in b.jobs) e.on("exec", function(d) {
  18828. d.data.done || (a.fire("lockSnapshot"), b.execJob(a, c) && (d.data.done = !0), a.fire("unlockSnapshot"), CKEDITOR.dom.element.clearAllMarkers(b.database))
  18829. }, this, null, c), e.on("refresh", function(d) {
  18830. d.data.states || (d.data.states = {});
  18831. d.data.states[b.name + "@" + c] = b.refreshJob(a, c, d.data.path)
  18832. }, this, null, c);
  18833. a.addFeature(b)
  18834. })(this, b[a])
  18835. })
  18836. }
  18837. };
  18838. CKEDITOR.plugins.indent.genericDefinition.prototype = {
  18839. context: "p",
  18840. exec: function() {}
  18841. };
  18842. CKEDITOR.plugins.indent.specificDefinition.prototype = {
  18843. execJob: function(a, b) {
  18844. var e = this.jobs[b];
  18845. if (e.state != k) return e.exec.call(this, a)
  18846. },
  18847. refreshJob: function(a,
  18848. b, e) {
  18849. b = this.jobs[b];
  18850. a.activeFilter.checkFeature(this) ? b.state = b.refresh.call(this, a, e) : b.state = k;
  18851. return b.state
  18852. },
  18853. getContext: function(a) {
  18854. return a.contains(this.context)
  18855. }
  18856. }
  18857. })();
  18858. (function() {
  18859. function f(b, c, a) {
  18860. if (!b.getCustomData("indent_processed")) {
  18861. var d = this.editor,
  18862. l = this.isIndent;
  18863. if (c) {
  18864. d = b.$.className.match(this.classNameRegex);
  18865. a = 0;
  18866. d && (d = d[1], a = CKEDITOR.tools.indexOf(c, d) + 1);
  18867. if (0 > (a += l ? 1 : -1)) return;
  18868. a = Math.min(a, c.length);
  18869. a = Math.max(a, 0);
  18870. b.$.className = CKEDITOR.tools.ltrim(b.$.className.replace(this.classNameRegex, ""));
  18871. 0 < a && b.addClass(c[a - 1])
  18872. } else {
  18873. c = m(b, a);
  18874. a = parseInt(b.getStyle(c), 10);
  18875. var g = d.config.indentOffset || 40;
  18876. isNaN(a) && (a = 0);
  18877. a += (l ? 1 : -1) * g;
  18878. if (0 > a) return;
  18879. a = Math.max(a,
  18880. 0);
  18881. a = Math.ceil(a / g) * g;
  18882. b.setStyle(c, a ? a + (d.config.indentUnit || "px") : "");
  18883. "" === b.getAttribute("style") && b.removeAttribute("style")
  18884. }
  18885. CKEDITOR.dom.element.setMarker(this.database, b, "indent_processed", 1)
  18886. }
  18887. }
  18888. function m(b, c) {
  18889. return "ltr" == (c || b.getComputedStyle("direction")) ? "margin-left" : "margin-right"
  18890. }
  18891. var h = CKEDITOR.dtd.$listItem,
  18892. p = CKEDITOR.dtd.$list,
  18893. k = CKEDITOR.TRISTATE_DISABLED,
  18894. n = CKEDITOR.TRISTATE_OFF;
  18895. CKEDITOR.plugins.add("indentblock", {
  18896. requires: "indent",
  18897. init: function(b) {
  18898. function c() {
  18899. a.specificDefinition.apply(this,
  18900. arguments);
  18901. this.allowedContent = {
  18902. "div h1 h2 h3 h4 h5 h6 ol p pre ul": {
  18903. propertiesOnly: !0,
  18904. styles: d ? null : "margin-left,margin-right",
  18905. classes: d || null
  18906. }
  18907. };
  18908. this.contentTransformations = [
  18909. ["div: splitMarginShorthand"],
  18910. ["h1: splitMarginShorthand"],
  18911. ["h2: splitMarginShorthand"],
  18912. ["h3: splitMarginShorthand"],
  18913. ["h4: splitMarginShorthand"],
  18914. ["h5: splitMarginShorthand"],
  18915. ["h6: splitMarginShorthand"],
  18916. ["ol: splitMarginShorthand"],
  18917. ["p: splitMarginShorthand"],
  18918. ["pre: splitMarginShorthand"],
  18919. ["ul: splitMarginShorthand"]
  18920. ];
  18921. this.enterBr &&
  18922. (this.allowedContent.div = !0);
  18923. this.requiredContent = (this.enterBr ? "div" : "p") + (d ? "(" + d.join(",") + ")" : "{margin-left}");
  18924. this.jobs = {
  18925. 20: {
  18926. refresh: function(a, b) {
  18927. var e = b.block || b.blockLimit;
  18928. if (!e.is(h)) var c = e.getAscendant(h),
  18929. e = c && b.contains(c) || e;
  18930. e.is(h) && (e = e.getParent());
  18931. if (this.enterBr || this.getContext(b)) {
  18932. if (d) {
  18933. var c = d,
  18934. e = e.$.className.match(this.classNameRegex),
  18935. f = this.isIndent,
  18936. c = e ? f ? e[1] != c.slice(-1) : !0 : f;
  18937. return c ? n : k
  18938. }
  18939. return this.isIndent ? n : e ? CKEDITOR[0 >= (parseInt(e.getStyle(m(e)), 10) || 0) ? "TRISTATE_DISABLED" :
  18940. "TRISTATE_OFF"] : k
  18941. }
  18942. return k
  18943. },
  18944. exec: function(a) {
  18945. var b = a.getSelection(),
  18946. b = b && b.getRanges()[0],
  18947. c;
  18948. if (c = a.elementPath().contains(p)) f.call(this, c, d);
  18949. else
  18950. for (b = b.createIterator(), a = a.config.enterMode, b.enforceRealBlocks = !0, b.enlargeBr = a != CKEDITOR.ENTER_BR; c = b.getNextParagraph(a == CKEDITOR.ENTER_P ? "p" : "div");) c.isReadOnly() || f.call(this, c, d);
  18951. return !0
  18952. }
  18953. }
  18954. }
  18955. }
  18956. var a = CKEDITOR.plugins.indent,
  18957. d = b.config.indentClasses;
  18958. a.registerCommands(b, {
  18959. indentblock: new c(b, "indentblock", !0),
  18960. outdentblock: new c(b, "outdentblock")
  18961. });
  18962. CKEDITOR.tools.extend(c.prototype, a.specificDefinition.prototype, {
  18963. context: {
  18964. div: 1,
  18965. dl: 1,
  18966. h1: 1,
  18967. h2: 1,
  18968. h3: 1,
  18969. h4: 1,
  18970. h5: 1,
  18971. h6: 1,
  18972. ul: 1,
  18973. ol: 1,
  18974. p: 1,
  18975. pre: 1,
  18976. table: 1
  18977. },
  18978. classNameRegex: d ? new RegExp("(?:^|\\s+)(" + d.join("|") + ")(?\x3d$|\\s)") : null
  18979. })
  18980. }
  18981. })
  18982. })();
  18983. (function() {
  18984. function w(f) {
  18985. function g(b) {
  18986. for (var e = c.startContainer, a = c.endContainer; e && !e.getParent().equals(b);) e = e.getParent();
  18987. for (; a && !a.getParent().equals(b);) a = a.getParent();
  18988. if (!e || !a) return !1;
  18989. for (var d = [], h = !1; !h;) e.equals(a) && (h = !0), d.push(e), e = e.getNext();
  18990. if (1 > d.length) return !1;
  18991. e = b.getParents(!0);
  18992. for (a = 0; a < e.length; a++)
  18993. if (e[a].getName && p[e[a].getName()]) {
  18994. b = e[a];
  18995. break
  18996. } for (var e = k.isIndent ? 1 : -1, a = d[0], d = d[d.length - 1], h = CKEDITOR.plugins.list.listToArray(b, q), m = h[d.getCustomData("listarray_index")].indent,
  18997. a = a.getCustomData("listarray_index"); a <= d.getCustomData("listarray_index"); a++)
  18998. if (h[a].indent += e, 0 < e) {
  18999. for (var g = h[a].parent, n = a - 1; 0 <= n; n--)
  19000. if (h[n].indent === e) {
  19001. g = h[n].parent;
  19002. break
  19003. } h[a].parent = new CKEDITOR.dom.element(g.getName(), g.getDocument())
  19004. } for (a = d.getCustomData("listarray_index") + 1; a < h.length && h[a].indent > m; a++) h[a].indent += e;
  19005. e = CKEDITOR.plugins.list.arrayToList(h, q, null, f.config.enterMode, b.getDirection());
  19006. if (!k.isIndent) {
  19007. var t;
  19008. if ((t = b.getParent()) && t.is("li"))
  19009. for (var d = e.listNode.getChildren(),
  19010. r = [], l, a = d.count() - 1; 0 <= a; a--)(l = d.getItem(a)) && l.is && l.is("li") && r.push(l)
  19011. }
  19012. e && e.listNode.replace(b);
  19013. if (r && r.length)
  19014. for (a = 0; a < r.length; a++) {
  19015. for (l = b = r[a];
  19016. (l = l.getNext()) && l.is && l.getName() in p;) CKEDITOR.env.needsNbspFiller && !b.getFirst(x) && b.append(c.document.createText(" ")), b.append(l);
  19017. b.insertAfter(t)
  19018. }
  19019. e && f.fire("contentDomInvalidated");
  19020. return !0
  19021. }
  19022. for (var k = this, q = this.database, p = this.context, c, m = f.getSelection(), m = (m && m.getRanges()).createIterator(); c = m.getNextRange();) {
  19023. for (var b = c.getCommonAncestor(); b &&
  19024. (b.type != CKEDITOR.NODE_ELEMENT || !p[b.getName()]);) {
  19025. if (f.editable().equals(b)) {
  19026. b = !1;
  19027. break
  19028. }
  19029. b = b.getParent()
  19030. }
  19031. b || (b = c.startPath().contains(p)) && c.setEndAt(b, CKEDITOR.POSITION_BEFORE_END);
  19032. if (!b) {
  19033. var d = c.getEnclosedNode();
  19034. d && d.type == CKEDITOR.NODE_ELEMENT && d.getName() in p && (c.setStartAt(d, CKEDITOR.POSITION_AFTER_START), c.setEndAt(d, CKEDITOR.POSITION_BEFORE_END), b = d)
  19035. }
  19036. b && c.startContainer.type == CKEDITOR.NODE_ELEMENT && c.startContainer.getName() in p && (d = new CKEDITOR.dom.walker(c), d.evaluator = n, c.startContainer =
  19037. d.next());
  19038. b && c.endContainer.type == CKEDITOR.NODE_ELEMENT && c.endContainer.getName() in p && (d = new CKEDITOR.dom.walker(c), d.evaluator = n, c.endContainer = d.previous());
  19039. if (b) return g(b)
  19040. }
  19041. return 0
  19042. }
  19043. function n(f) {
  19044. return f.type == CKEDITOR.NODE_ELEMENT && f.is("li")
  19045. }
  19046. function x(f) {
  19047. return y(f) && z(f)
  19048. }
  19049. var y = CKEDITOR.dom.walker.whitespaces(!0),
  19050. z = CKEDITOR.dom.walker.bookmark(!1, !0),
  19051. u = CKEDITOR.TRISTATE_DISABLED,
  19052. v = CKEDITOR.TRISTATE_OFF;
  19053. CKEDITOR.plugins.add("indentlist", {
  19054. requires: "indent",
  19055. init: function(f) {
  19056. function g(f) {
  19057. k.specificDefinition.apply(this,
  19058. arguments);
  19059. this.requiredContent = ["ul", "ol"];
  19060. f.on("key", function(g) {
  19061. var c = f.elementPath();
  19062. if ("wysiwyg" == f.mode && g.data.keyCode == this.indentKey && c) {
  19063. var m = this.getContext(c);
  19064. !m || this.isIndent && CKEDITOR.plugins.indentList.firstItemInPath(this.context, c, m) || (f.execCommand(this.relatedGlobal), g.cancel())
  19065. }
  19066. }, this);
  19067. this.jobs[this.isIndent ? 10 : 30] = {
  19068. refresh: this.isIndent ? function(f, c) {
  19069. var g = this.getContext(c),
  19070. b = CKEDITOR.plugins.indentList.firstItemInPath(this.context, c, g);
  19071. return g && this.isIndent && !b ? v : u
  19072. } : function(f,
  19073. c) {
  19074. return !this.getContext(c) || this.isIndent ? u : v
  19075. },
  19076. exec: CKEDITOR.tools.bind(w, this)
  19077. }
  19078. }
  19079. var k = CKEDITOR.plugins.indent;
  19080. k.registerCommands(f, {
  19081. indentlist: new g(f, "indentlist", !0),
  19082. outdentlist: new g(f, "outdentlist")
  19083. });
  19084. CKEDITOR.tools.extend(g.prototype, k.specificDefinition.prototype, {
  19085. context: {
  19086. ol: 1,
  19087. ul: 1
  19088. }
  19089. })
  19090. }
  19091. });
  19092. CKEDITOR.plugins.indentList = {};
  19093. CKEDITOR.plugins.indentList.firstItemInPath = function(f, g, k) {
  19094. var q = g.contains(n);
  19095. k || (k = g.contains(f));
  19096. return k && q && q.equals(k.getFirst(n))
  19097. }
  19098. })();
  19099. CKEDITOR.plugins.add("smiley", {
  19100. requires: "dialog",
  19101. init: function(a) {
  19102. a.config.smiley_path = a.config.smiley_path || this.path + "images/";
  19103. a.addCommand("smiley", new CKEDITOR.dialogCommand("smiley", {
  19104. allowedContent: "img[alt,height,!src,title,width]",
  19105. requiredContent: "img"
  19106. }));
  19107. a.ui.addButton && a.ui.addButton("Smiley", {
  19108. label: a.lang.smiley.toolbar,
  19109. command: "smiley",
  19110. toolbar: "insert,50"
  19111. });
  19112. CKEDITOR.dialog.add("smiley", this.path + "dialogs/smiley.js")
  19113. }
  19114. });
  19115. CKEDITOR.config.smiley_images = "regular_smile.png sad_smile.png wink_smile.png teeth_smile.png confused_smile.png tongue_smile.png embarrassed_smile.png omg_smile.png whatchutalkingabout_smile.png angry_smile.png angel_smile.png shades_smile.png devil_smile.png cry_smile.png lightbulb.png thumbs_down.png thumbs_up.png heart.png broken_heart.png kiss.png envelope.png".split(" ");
  19116. CKEDITOR.config.smiley_descriptions = "smiley;sad;wink;laugh;frown;cheeky;blush;surprise;indecision;angry;angel;cool;devil;crying;enlightened;no;yes;heart;broken heart;kiss;mail".split(";");
  19117. (function() {
  19118. function q(a, c) {
  19119. c = void 0 === c || c;
  19120. var b;
  19121. if (c) b = a.getComputedStyle("text-align");
  19122. else {
  19123. for (; !a.hasAttribute || !a.hasAttribute("align") && !a.getStyle("text-align");) {
  19124. b = a.getParent();
  19125. if (!b) break;
  19126. a = b
  19127. }
  19128. b = a.getStyle("text-align") || a.getAttribute("align") || ""
  19129. }
  19130. b && (b = b.replace(/(?:-(?:moz|webkit)-)?(?:start|auto)/i, ""));
  19131. !b && c && (b = "rtl" == a.getComputedStyle("direction") ? "right" : "left");
  19132. return b
  19133. }
  19134. function h(a, c, b) {
  19135. this.editor = a;
  19136. this.name = c;
  19137. this.value = b;
  19138. this.context = "p";
  19139. c = a.config.justifyClasses;
  19140. var f = a.config.enterMode ==
  19141. CKEDITOR.ENTER_P ? "p" : "div";
  19142. if (c) {
  19143. switch (b) {
  19144. case "left":
  19145. this.cssClassName = c[0];
  19146. break;
  19147. case "center":
  19148. this.cssClassName = c[1];
  19149. break;
  19150. case "right":
  19151. this.cssClassName = c[2];
  19152. break;
  19153. case "justify":
  19154. this.cssClassName = c[3]
  19155. }
  19156. this.cssClassRegex = new RegExp("(?:^|\\s+)(?:" + c.join("|") + ")(?\x3d$|\\s)");
  19157. this.requiredContent = f + "(" + this.cssClassName + ")"
  19158. } else this.requiredContent = f + "{text-align}";
  19159. this.allowedContent = {
  19160. "caption div h1 h2 h3 h4 h5 h6 p pre td th li": {
  19161. propertiesOnly: !0,
  19162. styles: this.cssClassName ? null : "text-align",
  19163. classes: this.cssClassName || null
  19164. }
  19165. };
  19166. a.config.enterMode == CKEDITOR.ENTER_BR && (this.allowedContent.div = !0)
  19167. }
  19168. function m(a) {
  19169. var c = a.editor,
  19170. b = c.createRange();
  19171. b.setStartBefore(a.data.node);
  19172. b.setEndAfter(a.data.node);
  19173. for (var f = new CKEDITOR.dom.walker(b), d; d = f.next();)
  19174. if (d.type == CKEDITOR.NODE_ELEMENT)
  19175. if (!d.equals(a.data.node) && d.getDirection()) b.setStartAfter(d), f = new CKEDITOR.dom.walker(b);
  19176. else {
  19177. var e = c.config.justifyClasses;
  19178. e && (d.hasClass(e[0]) ? (d.removeClass(e[0]), d.addClass(e[2])) : d.hasClass(e[2]) && (d.removeClass(e[2]),
  19179. d.addClass(e[0])));
  19180. e = d.getStyle("text-align");
  19181. "left" == e ? d.setStyle("text-align", "right") : "right" == e && d.setStyle("text-align", "left")
  19182. }
  19183. }
  19184. h.prototype = {
  19185. exec: function(a) {
  19186. var c = a.getSelection(),
  19187. b = a.config.enterMode;
  19188. if (c) {
  19189. for (var f = c.createBookmarks(), d = c.getRanges(), e = this.cssClassName, h, g, k = a.config.useComputedState, k = void 0 === k || k, n = d.length - 1; 0 <= n; n--)
  19190. for (h = d[n].createIterator(), h.enlargeBr = b != CKEDITOR.ENTER_BR; g = h.getNextParagraph(b == CKEDITOR.ENTER_P ? "p" : "div");)
  19191. if (!g.isReadOnly()) {
  19192. var l = g.getName(),
  19193. p;
  19194. p = a.activeFilter.check(l + "{text-align}");
  19195. if ((l = a.activeFilter.check(l + "(" + e + ")")) || p) {
  19196. g.removeAttribute("align");
  19197. g.removeStyle("text-align");
  19198. var m = e && (g.$.className = CKEDITOR.tools.ltrim(g.$.className.replace(this.cssClassRegex, ""))),
  19199. r = this.state == CKEDITOR.TRISTATE_OFF && (!k || q(g, !0) != this.value);
  19200. e && l ? r ? g.addClass(e) : m || g.removeAttribute("class") : r && p && g.setStyle("text-align", this.value)
  19201. }
  19202. } a.focus();
  19203. a.forceNextSelectionCheck();
  19204. c.selectBookmarks(f)
  19205. }
  19206. },
  19207. refresh: function(a, c) {
  19208. var b = c.block || c.blockLimit,
  19209. f = b.getName(),
  19210. d = b.equals(a.editable()),
  19211. f = this.cssClassName ? a.activeFilter.check(f + "(" + this.cssClassName + ")") : a.activeFilter.check(f + "{text-align}");
  19212. d && 1 === c.elements.length ? this.setState(CKEDITOR.TRISTATE_OFF) : !d && f ? this.setState(q(b, this.editor.config.useComputedState) == this.value ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_DISABLED)
  19213. }
  19214. };
  19215. CKEDITOR.plugins.add("justify", {
  19216. init: function(a) {
  19217. if (!a.blockless) {
  19218. var c = new h(a, "justifyleft", "left"),
  19219. b = new h(a, "justifycenter", "center"),
  19220. f = new h(a, "justifyright", "right"),
  19221. d = new h(a, "justifyblock", "justify");
  19222. a.addCommand("justifyleft", c);
  19223. a.addCommand("justifycenter", b);
  19224. a.addCommand("justifyright", f);
  19225. a.addCommand("justifyblock", d);
  19226. a.ui.addButton && (a.ui.addButton("JustifyLeft", {
  19227. label: a.lang.common.alignLeft,
  19228. command: "justifyleft",
  19229. toolbar: "align,10"
  19230. }), a.ui.addButton("JustifyCenter", {
  19231. label: a.lang.common.center,
  19232. command: "justifycenter",
  19233. toolbar: "align,20"
  19234. }), a.ui.addButton("JustifyRight", {
  19235. label: a.lang.common.alignRight,
  19236. command: "justifyright",
  19237. toolbar: "align,30"
  19238. }), a.ui.addButton("JustifyBlock", {
  19239. label: a.lang.common.justify,
  19240. command: "justifyblock",
  19241. toolbar: "align,40"
  19242. }));
  19243. a.on("dirChanged", m)
  19244. }
  19245. }
  19246. })
  19247. })();
  19248. CKEDITOR.plugins.add("menubutton", {
  19249. requires: "button,menu",
  19250. onLoad: function() {
  19251. var d = function(c) {
  19252. var a = this._,
  19253. b = a.menu;
  19254. a.state !== CKEDITOR.TRISTATE_DISABLED && (a.on && b ? b.hide() : (a.previousState = a.state, b || (b = a.menu = new CKEDITOR.menu(c, {
  19255. panel: {
  19256. className: "cke_menu_panel",
  19257. attributes: {
  19258. "aria-label": c.lang.common.options
  19259. }
  19260. }
  19261. }), b.onHide = CKEDITOR.tools.bind(function() {
  19262. var b = this.command ? c.getCommand(this.command).modes : this.modes;
  19263. this.setState(!b || b[c.mode] ? a.previousState : CKEDITOR.TRISTATE_DISABLED);
  19264. a.on = 0
  19265. }, this),
  19266. this.onMenu && b.addListener(this.onMenu)), this.setState(CKEDITOR.TRISTATE_ON), a.on = 1, setTimeout(function() {
  19267. b.show(CKEDITOR.document.getById(a.id), 4)
  19268. }, 0)))
  19269. };
  19270. CKEDITOR.ui.menuButton = CKEDITOR.tools.createClass({
  19271. base: CKEDITOR.ui.button,
  19272. $: function(c) {
  19273. delete c.panel;
  19274. this.base(c);
  19275. this.hasArrow = !0;
  19276. this.click = d
  19277. },
  19278. statics: {
  19279. handler: {
  19280. create: function(c) {
  19281. return new CKEDITOR.ui.menuButton(c)
  19282. }
  19283. }
  19284. }
  19285. })
  19286. },
  19287. beforeInit: function(d) {
  19288. d.ui.addHandler(CKEDITOR.UI_MENUBUTTON, CKEDITOR.ui.menuButton.handler)
  19289. }
  19290. });
  19291. CKEDITOR.UI_MENUBUTTON = "menubutton";
  19292. (function() {
  19293. CKEDITOR.plugins.add("language", {
  19294. requires: "menubutton",
  19295. init: function(a) {
  19296. var b = a.config.language_list || ["ar:Arabic:rtl", "fr:French", "es:Spanish"],
  19297. c = this,
  19298. d = a.lang.language,
  19299. e = {},
  19300. g, h, k, f;
  19301. a.addCommand("language", {
  19302. allowedContent: "span[!lang,!dir]",
  19303. requiredContent: "span[lang,dir]",
  19304. contextSensitive: !0,
  19305. exec: function(a, b) {
  19306. var c = e["language_" + b];
  19307. if (c) a[c.style.checkActive(a.elementPath(), a) ? "removeStyle" : "applyStyle"](c.style)
  19308. },
  19309. refresh: function(a) {
  19310. this.setState(c.getCurrentLangElement(a) ? CKEDITOR.TRISTATE_ON :
  19311. CKEDITOR.TRISTATE_OFF)
  19312. }
  19313. });
  19314. for (f = 0; f < b.length; f++) g = b[f].split(":"), h = g[0], k = "language_" + h, e[k] = {
  19315. label: g[1],
  19316. langId: h,
  19317. group: "language",
  19318. order: f,
  19319. ltr: "rtl" != ("" + g[2]).toLowerCase(),
  19320. onClick: function() {
  19321. a.execCommand("language", this.langId)
  19322. },
  19323. role: "menuitemcheckbox"
  19324. }, e[k].style = new CKEDITOR.style({
  19325. element: "span",
  19326. attributes: {
  19327. lang: h,
  19328. dir: e[k].ltr ? "ltr" : "rtl"
  19329. }
  19330. });
  19331. e.language_remove = {
  19332. label: d.remove,
  19333. group: "language_remove",
  19334. state: CKEDITOR.TRISTATE_DISABLED,
  19335. order: e.length,
  19336. onClick: function() {
  19337. var b = c.getCurrentLangElement(a);
  19338. b && a.execCommand("language", b.getAttribute("lang"))
  19339. }
  19340. };
  19341. a.addMenuGroup("language", 1);
  19342. a.addMenuGroup("language_remove");
  19343. a.addMenuItems(e);
  19344. a.ui.add("Language", CKEDITOR.UI_MENUBUTTON, {
  19345. label: d.button,
  19346. allowedContent: "span[!lang,!dir]",
  19347. requiredContent: "span[lang,dir]",
  19348. toolbar: "bidi,30",
  19349. command: "language",
  19350. onMenu: function() {
  19351. var b = {},
  19352. d = c.getCurrentLangElement(a),
  19353. f;
  19354. for (f in e) b[f] = CKEDITOR.TRISTATE_OFF;
  19355. b.language_remove = d ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
  19356. d && (b["language_" + d.getAttribute("lang")] =
  19357. CKEDITOR.TRISTATE_ON);
  19358. return b
  19359. }
  19360. });
  19361. a.addRemoveFormatFilter && a.addRemoveFormatFilter(function(a) {
  19362. return !(a.is("span") && a.getAttribute("dir") && a.getAttribute("lang"))
  19363. })
  19364. },
  19365. getCurrentLangElement: function(a) {
  19366. var b = a.elementPath();
  19367. a = b && b.elements;
  19368. var c;
  19369. if (b)
  19370. for (var d = 0; d < a.length; d++) b = a[d], !c && "span" == b.getName() && b.hasAttribute("dir") && b.hasAttribute("lang") && (c = b);
  19371. return c
  19372. }
  19373. })
  19374. })();
  19375. (function() {
  19376. function p(c) {
  19377. return c.replace(/'/g, "\\$\x26")
  19378. }
  19379. function q(c) {
  19380. for (var b, a = c.length, d = [], f = 0; f < a; f++) b = c.charCodeAt(f), d.push(b);
  19381. return "String.fromCharCode(" + d.join(",") + ")"
  19382. }
  19383. function r(c, b) {
  19384. var a = c.plugins.link,
  19385. d = a.compiledProtectionFunction.params,
  19386. f, e;
  19387. e = [a.compiledProtectionFunction.name, "("];
  19388. for (var g = 0; g < d.length; g++) a = d[g].toLowerCase(), f = b[a], 0 < g && e.push(","), e.push("'", f ? p(encodeURIComponent(b[a])) : "", "'");
  19389. e.push(")");
  19390. return e.join("")
  19391. }
  19392. function n(c) {
  19393. c = c.config.emailProtection || "";
  19394. var b;
  19395. c && "encode" != c && (b = {}, c.replace(/^([^(]+)\(([^)]+)\)$/, function(a, c, f) {
  19396. b.name = c;
  19397. b.params = [];
  19398. f.replace(/[^,\s]+/g, function(a) {
  19399. b.params.push(a)
  19400. })
  19401. }));
  19402. return b
  19403. }
  19404. CKEDITOR.plugins.add("link", {
  19405. requires: "dialog,fakeobjects",
  19406. onLoad: function() {
  19407. function c(b) {
  19408. return a.replace(/%1/g, "rtl" == b ? "right" : "left").replace(/%2/g, "cke_contents_" + b)
  19409. }
  19410. var b = "background:url(" + CKEDITOR.getUrl(this.path + "images" + (CKEDITOR.env.hidpi ? "/hidpi" : "") + "/anchor.png") + ") no-repeat %1 center;border:1px dotted #00f;background-size:16px;",
  19411. a = ".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{" + b + "padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{" + b + "width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";
  19412. CKEDITOR.addCss(c("ltr") + c("rtl"))
  19413. },
  19414. init: function(c) {
  19415. var b = "a[!href]";
  19416. CKEDITOR.dialog.isTabEnabled(c, "link", "advanced") && (b = b.replace("]", ",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type,download]{*}(*)"));
  19417. CKEDITOR.dialog.isTabEnabled(c, "link", "target") &&
  19418. (b = b.replace("]", ",target,onclick]"));
  19419. c.addCommand("link", new CKEDITOR.dialogCommand("link", {
  19420. allowedContent: b,
  19421. requiredContent: "a[href]"
  19422. }));
  19423. c.addCommand("anchor", new CKEDITOR.dialogCommand("anchor", {
  19424. allowedContent: "a[!name,id]",
  19425. requiredContent: "a[name]"
  19426. }));
  19427. c.addCommand("unlink", new CKEDITOR.unlinkCommand);
  19428. c.addCommand("removeAnchor", new CKEDITOR.removeAnchorCommand);
  19429. c.setKeystroke(CKEDITOR.CTRL + 76, "link");
  19430. c.ui.addButton && (c.ui.addButton("Link", {
  19431. label: c.lang.link.toolbar,
  19432. command: "link",
  19433. toolbar: "links,10"
  19434. }),
  19435. c.ui.addButton("Unlink", {
  19436. label: c.lang.link.unlink,
  19437. command: "unlink",
  19438. toolbar: "links,20"
  19439. }), c.ui.addButton("Anchor", {
  19440. label: c.lang.link.anchor.toolbar,
  19441. command: "anchor",
  19442. toolbar: "links,30"
  19443. }));
  19444. CKEDITOR.dialog.add("link", this.path + "dialogs/link.js");
  19445. CKEDITOR.dialog.add("anchor", this.path + "dialogs/anchor.js");
  19446. c.on("doubleclick", function(a) {
  19447. var b = a.data.element.getAscendant({
  19448. a: 1,
  19449. img: 1
  19450. }, !0);
  19451. b && !b.isReadOnly() && (b.is("a") ? (a.data.dialog = !b.getAttribute("name") || b.getAttribute("href") && b.getChildCount() ? "link" :
  19452. "anchor", a.data.link = b) : CKEDITOR.plugins.link.tryRestoreFakeAnchor(c, b) && (a.data.dialog = "anchor"))
  19453. }, null, null, 0);
  19454. c.on("doubleclick", function(a) {
  19455. a.data.dialog in {
  19456. link: 1,
  19457. anchor: 1
  19458. } && a.data.link && c.getSelection().selectElement(a.data.link)
  19459. }, null, null, 20);
  19460. c.addMenuItems && c.addMenuItems({
  19461. anchor: {
  19462. label: c.lang.link.anchor.menu,
  19463. command: "anchor",
  19464. group: "anchor",
  19465. order: 1
  19466. },
  19467. removeAnchor: {
  19468. label: c.lang.link.anchor.remove,
  19469. command: "removeAnchor",
  19470. group: "anchor",
  19471. order: 5
  19472. },
  19473. link: {
  19474. label: c.lang.link.menu,
  19475. command: "link",
  19476. group: "link",
  19477. order: 1
  19478. },
  19479. unlink: {
  19480. label: c.lang.link.unlink,
  19481. command: "unlink",
  19482. group: "link",
  19483. order: 5
  19484. }
  19485. });
  19486. c.contextMenu && c.contextMenu.addListener(function(a) {
  19487. if (!a || a.isReadOnly()) return null;
  19488. a = CKEDITOR.plugins.link.tryRestoreFakeAnchor(c, a);
  19489. if (!a && !(a = CKEDITOR.plugins.link.getSelectedLink(c))) return null;
  19490. var b = {};
  19491. a.getAttribute("href") && a.getChildCount() && (b = {
  19492. link: CKEDITOR.TRISTATE_OFF,
  19493. unlink: CKEDITOR.TRISTATE_OFF
  19494. });
  19495. a && a.hasAttribute("name") && (b.anchor = b.removeAnchor = CKEDITOR.TRISTATE_OFF);
  19496. return b
  19497. });
  19498. this.compiledProtectionFunction =
  19499. n(c)
  19500. },
  19501. afterInit: function(c) {
  19502. c.dataProcessor.dataFilter.addRules({
  19503. elements: {
  19504. a: function(a) {
  19505. return a.attributes.name ? a.children.length ? null : c.createFakeParserElement(a, "cke_anchor", "anchor") : null
  19506. }
  19507. }
  19508. });
  19509. var b = c._.elementsPath && c._.elementsPath.filters;
  19510. b && b.push(function(a, b) {
  19511. if ("a" == b && (CKEDITOR.plugins.link.tryRestoreFakeAnchor(c, a) || a.getAttribute("name") && (!a.getAttribute("href") || !a.getChildCount()))) return "anchor"
  19512. })
  19513. }
  19514. });
  19515. var t = /^javascript:/,
  19516. u = /^mailto:([^?]+)(?:\?(.+))?$/,
  19517. v = /subject=([^;?:@&=$,\/]*)/i,
  19518. w = /body=([^;?:@&=$,\/]*)/i,
  19519. x = /^#(.*)$/,
  19520. y = /^((?:http|https|ftp|news):\/\/)?(.*)$/,
  19521. z = /^(_(?:self|top|parent|blank))$/,
  19522. A = /^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,
  19523. B = /^javascript:([^(]+)\(([^)]+)\)$/,
  19524. C = /\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,
  19525. D = /(?:^|,)([^=]+)=(\d+|yes|no)/gi,
  19526. m = {
  19527. id: "advId",
  19528. dir: "advLangDir",
  19529. accessKey: "advAccessKey",
  19530. name: "advName",
  19531. lang: "advLangCode",
  19532. tabindex: "advTabIndex",
  19533. title: "advTitle",
  19534. type: "advContentType",
  19535. "class": "advCSSClasses",
  19536. charset: "advCharset",
  19537. style: "advStyles",
  19538. rel: "advRel"
  19539. };
  19540. CKEDITOR.plugins.link = {
  19541. getSelectedLink: function(c, b) {
  19542. var a = c.getSelection(),
  19543. d = a.getSelectedElement(),
  19544. f = a.getRanges(),
  19545. e = [],
  19546. g;
  19547. if (!b && d && d.is("a")) return d;
  19548. for (d = 0; d < f.length; d++)
  19549. if (g = a.getRanges()[d], g.shrink(CKEDITOR.SHRINK_ELEMENT, !0, {
  19550. skipBogus: !0
  19551. }), (g = c.elementPath(g.getCommonAncestor()).contains("a", 1)) && b) e.push(g);
  19552. else if (g) return g;
  19553. return b ? e : null
  19554. },
  19555. getEditorAnchors: function(c) {
  19556. for (var b =
  19557. c.editable(), a = b.isInline() && !c.plugins.divarea ? c.document : b, b = a.getElementsByTag("a"), a = a.getElementsByTag("img"), d = [], f = 0, e; e = b.getItem(f++);)(e.data("cke-saved-name") || e.hasAttribute("name")) && d.push({
  19558. name: e.data("cke-saved-name") || e.getAttribute("name"),
  19559. id: e.getAttribute("id")
  19560. });
  19561. for (f = 0; e = a.getItem(f++);)(e = this.tryRestoreFakeAnchor(c, e)) && d.push({
  19562. name: e.getAttribute("name"),
  19563. id: e.getAttribute("id")
  19564. });
  19565. return d
  19566. },
  19567. fakeAnchor: !0,
  19568. tryRestoreFakeAnchor: function(c, b) {
  19569. if (b && b.data("cke-real-element-type") &&
  19570. "anchor" == b.data("cke-real-element-type")) {
  19571. var a = c.restoreRealElement(b);
  19572. if (a.data("cke-saved-name")) return a
  19573. }
  19574. },
  19575. parseLinkAttributes: function(c, b) {
  19576. var a = b && (b.data("cke-saved-href") || b.getAttribute("href")) || "",
  19577. d = c.plugins.link.compiledProtectionFunction,
  19578. f = c.config.emailProtection,
  19579. e, g = {};
  19580. a.match(t) && ("encode" == f ? a = a.replace(A, function(a, b, c) {
  19581. c = c || "";
  19582. return "mailto:" + String.fromCharCode.apply(String, b.split(",")) + c.replace(/\\'/g, "'")
  19583. }) : f && a.replace(B, function(a, b, c) {
  19584. if (b == d.name) {
  19585. g.type = "email";
  19586. a = g.email = {};
  19587. b = /(^')|('$)/g;
  19588. c = c.match(/[^,\s]+/g);
  19589. for (var e = c.length, f, h, k = 0; k < e; k++) f = decodeURIComponent, h = c[k].replace(b, "").replace(/\\'/g, "'"), h = f(h), f = d.params[k].toLowerCase(), a[f] = h;
  19590. a.address = [a.name, a.domain].join("@")
  19591. }
  19592. }));
  19593. if (!g.type)
  19594. if (f = a.match(x)) g.type = "anchor", g.anchor = {}, g.anchor.name = g.anchor.id = f[1];
  19595. else if (f = a.match(u)) {
  19596. e = a.match(v);
  19597. a = a.match(w);
  19598. g.type = "email";
  19599. var k = g.email = {};
  19600. k.address = f[1];
  19601. e && (k.subject = decodeURIComponent(e[1]));
  19602. a && (k.body = decodeURIComponent(a[1]))
  19603. } else a && (e = a.match(y)) &&
  19604. (g.type = "url", g.url = {}, g.url.protocol = e[1], g.url.url = e[2]);
  19605. if (b) {
  19606. if (a = b.getAttribute("target")) g.target = {
  19607. type: a.match(z) ? a : "frame",
  19608. name: a
  19609. };
  19610. else if (a = (a = b.data("cke-pa-onclick") || b.getAttribute("onclick")) && a.match(C))
  19611. for (g.target = {
  19612. type: "popup",
  19613. name: a[1]
  19614. }; f = D.exec(a[2]);) "yes" != f[2] && "1" != f[2] || f[1] in {
  19615. height: 1,
  19616. width: 1,
  19617. top: 1,
  19618. left: 1
  19619. } ? isFinite(f[2]) && (g.target[f[1]] = f[2]) : g.target[f[1]] = !0;
  19620. null !== b.getAttribute("download") && (g.download = !0);
  19621. var a = {},
  19622. h;
  19623. for (h in m)(f = b.getAttribute(h)) && (a[m[h]] = f);
  19624. if (h =
  19625. b.data("cke-saved-name") || a.advName) a.advName = h;
  19626. CKEDITOR.tools.isEmpty(a) || (g.advanced = a)
  19627. }
  19628. return g
  19629. },
  19630. getLinkAttributes: function(c, b) {
  19631. var a = c.config.emailProtection || "",
  19632. d = {};
  19633. switch (b.type) {
  19634. case "url":
  19635. var a = b.url && void 0 !== b.url.protocol ? b.url.protocol : "http://",
  19636. f = b.url && CKEDITOR.tools.trim(b.url.url) || "";
  19637. d["data-cke-saved-href"] = 0 === f.indexOf("/") ? f : a + f;
  19638. break;
  19639. case "anchor":
  19640. a = b.anchor && b.anchor.id;
  19641. d["data-cke-saved-href"] = "#" + (b.anchor && b.anchor.name || a || "");
  19642. break;
  19643. case "email":
  19644. var e = b.email,
  19645. f = e.address;
  19646. switch (a) {
  19647. case "":
  19648. case "encode":
  19649. var g = encodeURIComponent(e.subject || ""),
  19650. k = encodeURIComponent(e.body || ""),
  19651. e = [];
  19652. g && e.push("subject\x3d" + g);
  19653. k && e.push("body\x3d" + k);
  19654. e = e.length ? "?" + e.join("\x26") : "";
  19655. "encode" == a ? (a = ["javascript:void(location.href\x3d'mailto:'+", q(f)], e && a.push("+'", p(e), "'"), a.push(")")) : a = ["mailto:", f, e];
  19656. break;
  19657. default:
  19658. a = f.split("@", 2), e.name = a[0], e.domain = a[1], a = ["javascript:", r(c, e)]
  19659. }
  19660. d["data-cke-saved-href"] = a.join("")
  19661. }
  19662. if (b.target)
  19663. if ("popup" == b.target.type) {
  19664. for (var a = ["window.open(this.href, '",
  19665. b.target.name || "", "', '"
  19666. ], h = "resizable status location toolbar menubar fullscreen scrollbars dependent".split(" "), f = h.length, g = function(a) {
  19667. b.target[a] && h.push(a + "\x3d" + b.target[a])
  19668. }, e = 0; e < f; e++) h[e] += b.target[h[e]] ? "\x3dyes" : "\x3dno";
  19669. g("width");
  19670. g("left");
  19671. g("height");
  19672. g("top");
  19673. a.push(h.join(","), "'); return false;");
  19674. d["data-cke-pa-onclick"] = a.join("")
  19675. } else "notSet" != b.target.type && b.target.name && (d.target = b.target.name);
  19676. b.download && (d.download = "");
  19677. if (b.advanced) {
  19678. for (var l in m)(a = b.advanced[m[l]]) &&
  19679. (d[l] = a);
  19680. d.name && (d["data-cke-saved-name"] = d.name)
  19681. }
  19682. d["data-cke-saved-href"] && (d.href = d["data-cke-saved-href"]);
  19683. l = {
  19684. target: 1,
  19685. onclick: 1,
  19686. "data-cke-pa-onclick": 1,
  19687. "data-cke-saved-name": 1,
  19688. download: 1
  19689. };
  19690. b.advanced && CKEDITOR.tools.extend(l, m);
  19691. for (var n in d) delete l[n];
  19692. return {
  19693. set: d,
  19694. removed: CKEDITOR.tools.objectKeys(l)
  19695. }
  19696. },
  19697. showDisplayTextForElement: function(c, b) {
  19698. var a = {
  19699. img: 1,
  19700. table: 1,
  19701. tbody: 1,
  19702. thead: 1,
  19703. tfoot: 1,
  19704. input: 1,
  19705. select: 1,
  19706. textarea: 1
  19707. },
  19708. d = b.getSelection();
  19709. return b.widgets && b.widgets.focused || d && 1 < d.getRanges().length ?
  19710. !1 : !c || !c.getName || !c.is(a)
  19711. }
  19712. };
  19713. CKEDITOR.unlinkCommand = function() {};
  19714. CKEDITOR.unlinkCommand.prototype = {
  19715. exec: function(c) {
  19716. if (CKEDITOR.env.ie) {
  19717. var b = c.getSelection().getRanges()[0],
  19718. a = b.getPreviousEditableNode() && b.getPreviousEditableNode().getAscendant("a", !0) || b.getNextEditableNode() && b.getNextEditableNode().getAscendant("a", !0),
  19719. d;
  19720. b.collapsed && a && (d = b.createBookmark(), b.selectNodeContents(a), b.select())
  19721. }
  19722. a = new CKEDITOR.style({
  19723. element: "a",
  19724. type: CKEDITOR.STYLE_INLINE,
  19725. alwaysRemoveElement: 1
  19726. });
  19727. c.removeStyle(a);
  19728. d && (b.moveToBookmark(d), b.select())
  19729. },
  19730. refresh: function(c, b) {
  19731. var a = b.lastElement && b.lastElement.getAscendant("a", !0);
  19732. a && "a" == a.getName() && a.getAttribute("href") && a.getChildCount() ? this.setState(CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_DISABLED)
  19733. },
  19734. contextSensitive: 1,
  19735. startDisabled: 1,
  19736. requiredContent: "a[href]",
  19737. editorFocus: 1
  19738. };
  19739. CKEDITOR.removeAnchorCommand = function() {};
  19740. CKEDITOR.removeAnchorCommand.prototype = {
  19741. exec: function(c) {
  19742. var b = c.getSelection(),
  19743. a = b.createBookmarks(),
  19744. d;
  19745. if (b && (d = b.getSelectedElement()) &&
  19746. (d.getChildCount() ? d.is("a") : CKEDITOR.plugins.link.tryRestoreFakeAnchor(c, d))) d.remove(1);
  19747. else if (d = CKEDITOR.plugins.link.getSelectedLink(c)) d.hasAttribute("href") ? (d.removeAttributes({
  19748. name: 1,
  19749. "data-cke-saved-name": 1
  19750. }), d.removeClass("cke_anchor")) : d.remove(1);
  19751. b.selectBookmarks(a)
  19752. },
  19753. requiredContent: "a[name]"
  19754. };
  19755. CKEDITOR.tools.extend(CKEDITOR.config, {
  19756. linkShowAdvancedTab: !0,
  19757. linkShowTargetTab: !0
  19758. })
  19759. })();
  19760. (function() {
  19761. function I(b, m, e) {
  19762. function c(c) {
  19763. if (!(!(a = d[c ? "getFirst" : "getLast"]()) || a.is && a.isBlockBoundary() || !(p = m.root[c ? "getPrevious" : "getNext"](CKEDITOR.dom.walker.invisible(!0))) || p.is && p.isBlockBoundary({
  19764. br: 1
  19765. }))) b.document.createElement("br")[c ? "insertBefore" : "insertAfter"](a)
  19766. }
  19767. for (var f = CKEDITOR.plugins.list.listToArray(m.root, e), g = [], k = 0; k < m.contents.length; k++) {
  19768. var h = m.contents[k];
  19769. (h = h.getAscendant("li", !0)) && !h.getCustomData("list_item_processed") && (g.push(h), CKEDITOR.dom.element.setMarker(e,
  19770. h, "list_item_processed", !0))
  19771. }
  19772. h = null;
  19773. for (k = 0; k < g.length; k++) h = g[k].getCustomData("listarray_index"), f[h].indent = -1;
  19774. for (k = h + 1; k < f.length; k++)
  19775. if (f[k].indent > f[k - 1].indent + 1) {
  19776. g = f[k - 1].indent + 1 - f[k].indent;
  19777. for (h = f[k].indent; f[k] && f[k].indent >= h;) f[k].indent += g, k++;
  19778. k--
  19779. } var d = CKEDITOR.plugins.list.arrayToList(f, e, null, b.config.enterMode, m.root.getAttribute("dir")).listNode,
  19780. a, p;
  19781. c(!0);
  19782. c();
  19783. d.replace(m.root);
  19784. b.fire("contentDomInvalidated")
  19785. }
  19786. function B(b, m) {
  19787. this.name = b;
  19788. this.context = this.type = m;
  19789. this.allowedContent =
  19790. m + " li";
  19791. this.requiredContent = m
  19792. }
  19793. function E(b, m, e, c) {
  19794. for (var f, g; f = b[c ? "getLast" : "getFirst"](J);)(g = f.getDirection(1)) !== m.getDirection(1) && f.setAttribute("dir", g), f.remove(), e ? f[c ? "insertBefore" : "insertAfter"](e) : m.append(f, c)
  19795. }
  19796. function F(b) {
  19797. function m(e) {
  19798. var c = b[e ? "getPrevious" : "getNext"](u);
  19799. c && c.type == CKEDITOR.NODE_ELEMENT && c.is(b.getName()) && (E(b, c, null, !e), b.remove(), b = c)
  19800. }
  19801. m();
  19802. m(1)
  19803. }
  19804. function G(b) {
  19805. return b.type == CKEDITOR.NODE_ELEMENT && (b.getName() in CKEDITOR.dtd.$block || b.getName() in CKEDITOR.dtd.$listItem) &&
  19806. CKEDITOR.dtd[b.getName()]["#"]
  19807. }
  19808. function C(b, m, e) {
  19809. b.fire("saveSnapshot");
  19810. e.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);
  19811. var c = e.extractContents();
  19812. m.trim(!1, !0);
  19813. var f = m.createBookmark(),
  19814. g = new CKEDITOR.dom.elementPath(m.startContainer),
  19815. k = g.block,
  19816. g = g.lastElement.getAscendant("li", 1) || k,
  19817. h = new CKEDITOR.dom.elementPath(e.startContainer),
  19818. d = h.contains(CKEDITOR.dtd.$listItem),
  19819. h = h.contains(CKEDITOR.dtd.$list);
  19820. k ? (k = k.getBogus()) && k.remove() : h && (k = h.getPrevious(u)) && z(k) && k.remove();
  19821. (k = c.getLast()) && k.type == CKEDITOR.NODE_ELEMENT &&
  19822. k.is("br") && k.remove();
  19823. (k = m.startContainer.getChild(m.startOffset)) ? c.insertBefore(k): m.startContainer.append(c);
  19824. d && (c = A(d)) && (g.contains(d) ? (E(c, d.getParent(), d), c.remove()) : g.append(c));
  19825. for (; e.checkStartOfBlock() && e.checkEndOfBlock();) {
  19826. h = e.startPath();
  19827. c = h.block;
  19828. if (!c) break;
  19829. c.is("li") && (g = c.getParent(), c.equals(g.getLast(u)) && c.equals(g.getFirst(u)) && (c = g));
  19830. e.moveToPosition(c, CKEDITOR.POSITION_BEFORE_START);
  19831. c.remove()
  19832. }
  19833. e = e.clone();
  19834. c = b.editable();
  19835. e.setEndAt(c, CKEDITOR.POSITION_BEFORE_END);
  19836. e = new CKEDITOR.dom.walker(e);
  19837. e.evaluator = function(a) {
  19838. return u(a) && !z(a)
  19839. };
  19840. (e = e.next()) && e.type == CKEDITOR.NODE_ELEMENT && e.getName() in CKEDITOR.dtd.$list && F(e);
  19841. m.moveToBookmark(f);
  19842. m.select();
  19843. b.fire("saveSnapshot")
  19844. }
  19845. function A(b) {
  19846. return (b = b.getLast(u)) && b.type == CKEDITOR.NODE_ELEMENT && b.getName() in v ? b : null
  19847. }
  19848. var v = {
  19849. ol: 1,
  19850. ul: 1
  19851. },
  19852. K = CKEDITOR.dom.walker.whitespaces(),
  19853. H = CKEDITOR.dom.walker.bookmark(),
  19854. u = function(b) {
  19855. return !(K(b) || H(b))
  19856. },
  19857. z = CKEDITOR.dom.walker.bogus();
  19858. CKEDITOR.plugins.list = {
  19859. listToArray: function(b, m, e, c, f) {
  19860. if (!v[b.getName()]) return [];
  19861. c || (c = 0);
  19862. e || (e = []);
  19863. for (var g = 0, k = b.getChildCount(); g < k; g++) {
  19864. var h = b.getChild(g);
  19865. h.type == CKEDITOR.NODE_ELEMENT && h.getName() in CKEDITOR.dtd.$list && CKEDITOR.plugins.list.listToArray(h, m, e, c + 1);
  19866. if ("li" == h.$.nodeName.toLowerCase()) {
  19867. var d = {
  19868. parent: b,
  19869. indent: c,
  19870. element: h,
  19871. contents: []
  19872. };
  19873. f ? d.grandparent = f : (d.grandparent = b.getParent(), d.grandparent && "li" == d.grandparent.$.nodeName.toLowerCase() && (d.grandparent = d.grandparent.getParent()));
  19874. m && CKEDITOR.dom.element.setMarker(m, h, "listarray_index", e.length);
  19875. e.push(d);
  19876. for (var a = 0, p = h.getChildCount(), l; a < p; a++) l = h.getChild(a), l.type == CKEDITOR.NODE_ELEMENT && v[l.getName()] ? CKEDITOR.plugins.list.listToArray(l, m, e, c + 1, d.grandparent) : d.contents.push(l)
  19877. }
  19878. }
  19879. return e
  19880. },
  19881. arrayToList: function(b, m, e, c, f) {
  19882. e || (e = 0);
  19883. if (!b || b.length < e + 1) return null;
  19884. for (var g, k = b[e].parent.getDocument(), h = new CKEDITOR.dom.documentFragment(k), d = null, a = e, p = Math.max(b[e].indent, 0), l = null, q, n, t = c == CKEDITOR.ENTER_P ? "p" : "div";;) {
  19885. var r = b[a];
  19886. g = r.grandparent;
  19887. q = r.element.getDirection(1);
  19888. if (r.indent == p) {
  19889. d && b[a].parent.getName() ==
  19890. d.getName() || (d = b[a].parent.clone(!1, 1), f && d.setAttribute("dir", f), h.append(d));
  19891. l = d.append(r.element.clone(0, 1));
  19892. q != d.getDirection(1) && l.setAttribute("dir", q);
  19893. for (g = 0; g < r.contents.length; g++) l.append(r.contents[g].clone(1, 1));
  19894. a++
  19895. } else if (r.indent == Math.max(p, 0) + 1) r = b[a - 1].element.getDirection(1), a = CKEDITOR.plugins.list.arrayToList(b, null, a, c, r != q ? q : null), !l.getChildCount() && CKEDITOR.env.needsNbspFiller && 7 >= k.$.documentMode && l.append(k.createText(" ")), l.append(a.listNode), a = a.nextIndex;
  19896. else if (-1 ==
  19897. r.indent && !e && g) {
  19898. v[g.getName()] ? (l = r.element.clone(!1, !0), q != g.getDirection(1) && l.setAttribute("dir", q)) : l = new CKEDITOR.dom.documentFragment(k);
  19899. var d = g.getDirection(1) != q,
  19900. y = r.element,
  19901. D = y.getAttribute("class"),
  19902. z = y.getAttribute("style"),
  19903. A = l.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT && (c != CKEDITOR.ENTER_BR || d || z || D),
  19904. w, B = r.contents.length,
  19905. x;
  19906. for (g = 0; g < B; g++)
  19907. if (w = r.contents[g], H(w) && 1 < B) A ? x = w.clone(1, 1) : l.append(w.clone(1, 1));
  19908. else if (w.type == CKEDITOR.NODE_ELEMENT && w.isBlockBoundary()) {
  19909. d && !w.getDirection() &&
  19910. w.setAttribute("dir", q);
  19911. n = w;
  19912. var C = y.getAttribute("style");
  19913. C && n.setAttribute("style", C.replace(/([^;])$/, "$1;") + (n.getAttribute("style") || ""));
  19914. D && w.addClass(D);
  19915. n = null;
  19916. x && (l.append(x), x = null);
  19917. l.append(w.clone(1, 1))
  19918. } else A ? (n || (n = k.createElement(t), l.append(n), d && n.setAttribute("dir", q)), z && n.setAttribute("style", z), D && n.setAttribute("class", D), x && (n.append(x), x = null), n.append(w.clone(1, 1))) : l.append(w.clone(1, 1));
  19919. x && ((n || l).append(x), x = null);
  19920. l.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT && a != b.length - 1 && (CKEDITOR.env.needsBrFiller &&
  19921. (q = l.getLast()) && q.type == CKEDITOR.NODE_ELEMENT && q.is("br") && q.remove(), (q = l.getLast(u)) && q.type == CKEDITOR.NODE_ELEMENT && q.is(CKEDITOR.dtd.$block) || l.append(k.createElement("br")));
  19922. q = l.$.nodeName.toLowerCase();
  19923. "div" != q && "p" != q || l.appendBogus();
  19924. h.append(l);
  19925. d = null;
  19926. a++
  19927. } else return null;
  19928. n = null;
  19929. if (b.length <= a || Math.max(b[a].indent, 0) < p) break
  19930. }
  19931. if (m)
  19932. for (b = h.getFirst(); b;) {
  19933. if (b.type == CKEDITOR.NODE_ELEMENT && (CKEDITOR.dom.element.clearMarkers(m, b), b.getName() in CKEDITOR.dtd.$listItem && (e = b, k = f = c = void 0, c = e.getDirection()))) {
  19934. for (f =
  19935. e.getParent(); f && !(k = f.getDirection());) f = f.getParent();
  19936. c == k && e.removeAttribute("dir")
  19937. }
  19938. b = b.getNextSourceNode()
  19939. }
  19940. return {
  19941. listNode: h,
  19942. nextIndex: a
  19943. }
  19944. }
  19945. };
  19946. var L = /^h[1-6]$/,
  19947. J = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);
  19948. B.prototype = {
  19949. exec: function(b) {
  19950. this.refresh(b, b.elementPath());
  19951. var m = b.config,
  19952. e = b.getSelection(),
  19953. c = e && e.getRanges();
  19954. if (this.state == CKEDITOR.TRISTATE_OFF) {
  19955. var f = b.editable();
  19956. if (f.getFirst(u)) {
  19957. var g = 1 == c.length && c[0];
  19958. (m = g && g.getEnclosedNode()) && m.is && this.type == m.getName() && this.setState(CKEDITOR.TRISTATE_ON)
  19959. } else m.enterMode ==
  19960. CKEDITOR.ENTER_BR ? f.appendBogus() : c[0].fixBlock(1, m.enterMode == CKEDITOR.ENTER_P ? "p" : "div"), e.selectRanges(c)
  19961. }
  19962. for (var m = e.createBookmarks(!0), f = [], k = {}, c = c.createIterator(), h = 0;
  19963. (g = c.getNextRange()) && ++h;) {
  19964. var d = g.getBoundaryNodes(),
  19965. a = d.startNode,
  19966. p = d.endNode;
  19967. a.type == CKEDITOR.NODE_ELEMENT && "td" == a.getName() && g.setStartAt(d.startNode, CKEDITOR.POSITION_AFTER_START);
  19968. p.type == CKEDITOR.NODE_ELEMENT && "td" == p.getName() && g.setEndAt(d.endNode, CKEDITOR.POSITION_BEFORE_END);
  19969. g = g.createIterator();
  19970. for (g.forceBrBreak =
  19971. this.state == CKEDITOR.TRISTATE_OFF; d = g.getNextParagraph();)
  19972. if (!d.getCustomData("list_block")) {
  19973. CKEDITOR.dom.element.setMarker(k, d, "list_block", 1);
  19974. for (var l = b.elementPath(d), a = l.elements, p = 0, l = l.blockLimit, q, n = a.length - 1; 0 <= n && (q = a[n]); n--)
  19975. if (v[q.getName()] && l.contains(q)) {
  19976. l.removeCustomData("list_group_object_" + h);
  19977. (a = q.getCustomData("list_group_object")) ? a.contents.push(d): (a = {
  19978. root: q,
  19979. contents: [d]
  19980. }, f.push(a), CKEDITOR.dom.element.setMarker(k, q, "list_group_object", a));
  19981. p = 1;
  19982. break
  19983. } p || (p = l, p.getCustomData("list_group_object_" +
  19984. h) ? p.getCustomData("list_group_object_" + h).contents.push(d) : (a = {
  19985. root: p,
  19986. contents: [d]
  19987. }, CKEDITOR.dom.element.setMarker(k, p, "list_group_object_" + h, a), f.push(a)))
  19988. }
  19989. }
  19990. for (q = []; 0 < f.length;)
  19991. if (a = f.shift(), this.state == CKEDITOR.TRISTATE_OFF)
  19992. if (v[a.root.getName()]) {
  19993. c = b;
  19994. h = a;
  19995. a = k;
  19996. g = q;
  19997. p = CKEDITOR.plugins.list.listToArray(h.root, a);
  19998. l = [];
  19999. for (d = 0; d < h.contents.length; d++) n = h.contents[d], (n = n.getAscendant("li", !0)) && !n.getCustomData("list_item_processed") && (l.push(n), CKEDITOR.dom.element.setMarker(a, n, "list_item_processed",
  20000. !0));
  20001. for (var n = h.root.getDocument(), t = void 0, r = void 0, d = 0; d < l.length; d++) {
  20002. var y = l[d].getCustomData("listarray_index"),
  20003. t = p[y].parent;
  20004. t.is(this.type) || (r = n.createElement(this.type), t.copyAttributes(r, {
  20005. start: 1,
  20006. type: 1
  20007. }), r.removeStyle("list-style-type"), p[y].parent = r)
  20008. }
  20009. a = CKEDITOR.plugins.list.arrayToList(p, a, null, c.config.enterMode);
  20010. p = void 0;
  20011. l = a.listNode.getChildCount();
  20012. for (d = 0; d < l && (p = a.listNode.getChild(d)); d++) p.getName() == this.type && g.push(p);
  20013. a.listNode.replace(h.root);
  20014. c.fire("contentDomInvalidated")
  20015. } else {
  20016. p =
  20017. b;
  20018. g = a;
  20019. d = q;
  20020. l = g.contents;
  20021. c = g.root.getDocument();
  20022. h = [];
  20023. 1 == l.length && l[0].equals(g.root) && (a = c.createElement("div"), l[0].moveChildren && l[0].moveChildren(a), l[0].append(a), l[0] = a);
  20024. g = g.contents[0].getParent();
  20025. for (n = 0; n < l.length; n++) g = g.getCommonAncestor(l[n].getParent());
  20026. t = p.config.useComputedState;
  20027. p = a = void 0;
  20028. t = void 0 === t || t;
  20029. for (n = 0; n < l.length; n++)
  20030. for (r = l[n]; y = r.getParent();) {
  20031. if (y.equals(g)) {
  20032. h.push(r);
  20033. !p && r.getDirection() && (p = 1);
  20034. r = r.getDirection(t);
  20035. null !== a && (a = a && a != r ? null : r);
  20036. break
  20037. }
  20038. r = y
  20039. }
  20040. if (!(1 > h.length)) {
  20041. l =
  20042. h[h.length - 1].getNext();
  20043. n = c.createElement(this.type);
  20044. d.push(n);
  20045. for (t = d = void 0; h.length;) d = h.shift(), t = c.createElement("li"), r = d, r.is("pre") || L.test(r.getName()) || "false" == r.getAttribute("contenteditable") ? d.appendTo(t) : (d.copyAttributes(t), a && d.getDirection() && (t.removeStyle("direction"), t.removeAttribute("dir")), d.moveChildren(t), d.remove()), t.appendTo(n);
  20046. a && p && n.setAttribute("dir", a);
  20047. l ? n.insertBefore(l) : n.appendTo(g)
  20048. }
  20049. }
  20050. else this.state == CKEDITOR.TRISTATE_ON && v[a.root.getName()] && I.call(this, b, a, k);
  20051. for (n = 0; n < q.length; n++) F(q[n]);
  20052. CKEDITOR.dom.element.clearAllMarkers(k);
  20053. e.selectBookmarks(m);
  20054. b.focus()
  20055. },
  20056. refresh: function(b, m) {
  20057. var e = m.contains(v, 1),
  20058. c = m.blockLimit || m.root;
  20059. e && c.contains(e) ? this.setState(e.is(this.type) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_OFF)
  20060. }
  20061. };
  20062. CKEDITOR.plugins.add("list", {
  20063. requires: "indentlist",
  20064. init: function(b) {
  20065. b.blockless || (b.addCommand("numberedlist", new B("numberedlist", "ol")), b.addCommand("bulletedlist", new B("bulletedlist", "ul")), b.ui.addButton &&
  20066. (b.ui.addButton("NumberedList", {
  20067. label: b.lang.list.numberedlist,
  20068. command: "numberedlist",
  20069. directional: !0,
  20070. toolbar: "list,10"
  20071. }), b.ui.addButton("BulletedList", {
  20072. label: b.lang.list.bulletedlist,
  20073. command: "bulletedlist",
  20074. directional: !0,
  20075. toolbar: "list,20"
  20076. })), b.on("key", function(m) {
  20077. var e = m.data.domEvent.getKey(),
  20078. c;
  20079. if ("wysiwyg" == b.mode && e in {
  20080. 8: 1,
  20081. 46: 1
  20082. }) {
  20083. var f = b.getSelection().getRanges()[0],
  20084. g = f && f.startPath();
  20085. if (f && f.collapsed) {
  20086. var k = 8 == e,
  20087. h = b.editable(),
  20088. d = new CKEDITOR.dom.walker(f.clone());
  20089. d.evaluator = function(a) {
  20090. return u(a) &&
  20091. !z(a)
  20092. };
  20093. d.guard = function(a, b) {
  20094. return !(b && a.type == CKEDITOR.NODE_ELEMENT && a.is("table"))
  20095. };
  20096. e = f.clone();
  20097. if (k) {
  20098. var a;
  20099. (a = g.contains(v)) && f.checkBoundaryOfElement(a, CKEDITOR.START) && (a = a.getParent()) && a.is("li") && (a = A(a)) ? (c = a, a = a.getPrevious(u), e.moveToPosition(a && z(a) ? a : c, CKEDITOR.POSITION_BEFORE_START)) : (d.range.setStartAt(h, CKEDITOR.POSITION_AFTER_START), d.range.setEnd(f.startContainer, f.startOffset), (a = d.previous()) && a.type == CKEDITOR.NODE_ELEMENT && (a.getName() in v || a.is("li")) && (a.is("li") || (d.range.selectNodeContents(a),
  20100. d.reset(), d.evaluator = G, a = d.previous()), c = a, e.moveToElementEditEnd(c), e.moveToPosition(e.endPath().block, CKEDITOR.POSITION_BEFORE_END)));
  20101. if (c) C(b, e, f), m.cancel();
  20102. else {
  20103. var p = g.contains(v);
  20104. p && f.checkBoundaryOfElement(p, CKEDITOR.START) && (c = p.getFirst(u), f.checkBoundaryOfElement(c, CKEDITOR.START) && (a = p.getPrevious(u), A(c) ? a && (f.moveToElementEditEnd(a), f.select()) : b.execCommand("outdent"), m.cancel()))
  20105. }
  20106. } else if (c = g.contains("li")) {
  20107. if (d.range.setEndAt(h, CKEDITOR.POSITION_BEFORE_END), k = (h = c.getLast(u)) &&
  20108. G(h) ? h : c, g = 0, (a = d.next()) && a.type == CKEDITOR.NODE_ELEMENT && a.getName() in v && a.equals(h) ? (g = 1, a = d.next()) : f.checkBoundaryOfElement(k, CKEDITOR.END) && (g = 2), g && a) {
  20109. f = f.clone();
  20110. f.moveToElementEditStart(a);
  20111. if (1 == g && (e.optimize(), !e.startContainer.equals(c))) {
  20112. for (c = e.startContainer; c.is(CKEDITOR.dtd.$inline);) p = c, c = c.getParent();
  20113. p && e.moveToPosition(p, CKEDITOR.POSITION_AFTER_END)
  20114. }
  20115. 2 == g && (e.moveToPosition(e.endPath().block, CKEDITOR.POSITION_BEFORE_END), f.endPath().block && f.moveToPosition(f.endPath().block, CKEDITOR.POSITION_AFTER_START));
  20116. C(b, e, f);
  20117. m.cancel()
  20118. }
  20119. } else d.range.setEndAt(h, CKEDITOR.POSITION_BEFORE_END), (a = d.next()) && a.type == CKEDITOR.NODE_ELEMENT && a.is(v) && (a = a.getFirst(u), g.block && f.checkStartOfBlock() && f.checkEndOfBlock() ? (g.block.remove(), f.moveToElementEditStart(a), f.select()) : A(a) ? (f.moveToElementEditStart(a), f.select()) : (f = f.clone(), f.moveToElementEditStart(a), C(b, e, f)), m.cancel());
  20120. setTimeout(function() {
  20121. b.selectionChange(1)
  20122. })
  20123. }
  20124. }
  20125. }))
  20126. }
  20127. })
  20128. })();
  20129. (function() {
  20130. CKEDITOR.plugins.liststyle = {
  20131. requires: "dialog,contextmenu",
  20132. init: function(a) {
  20133. if (!a.blockless) {
  20134. var b;
  20135. b = new CKEDITOR.dialogCommand("numberedListStyle", {
  20136. requiredContent: "ol",
  20137. allowedContent: "ol{list-style-type}[start]; li{list-style-type}[value]",
  20138. contentTransformations: [
  20139. ["ol: listTypeToStyle"]
  20140. ]
  20141. });
  20142. b = a.addCommand("numberedListStyle", b);
  20143. a.addFeature(b);
  20144. CKEDITOR.dialog.add("numberedListStyle", this.path + "dialogs/liststyle.js");
  20145. b = new CKEDITOR.dialogCommand("bulletedListStyle", {
  20146. requiredContent: "ul",
  20147. allowedContent: "ul{list-style-type}",
  20148. contentTransformations: [
  20149. ["ul: listTypeToStyle"]
  20150. ]
  20151. });
  20152. b = a.addCommand("bulletedListStyle", b);
  20153. a.addFeature(b);
  20154. CKEDITOR.dialog.add("bulletedListStyle", this.path + "dialogs/liststyle.js");
  20155. a.addMenuGroup("list", 108);
  20156. a.addMenuItems({
  20157. numberedlist: {
  20158. label: a.lang.liststyle.numberedTitle,
  20159. group: "list",
  20160. command: "numberedListStyle"
  20161. },
  20162. bulletedlist: {
  20163. label: a.lang.liststyle.bulletedTitle,
  20164. group: "list",
  20165. command: "bulletedListStyle"
  20166. }
  20167. });
  20168. a.contextMenu.addListener(function(a) {
  20169. if (!a || a.isReadOnly()) return null;
  20170. for (; a;) {
  20171. var b = a.getName();
  20172. if ("ol" == b) return {
  20173. numberedlist: CKEDITOR.TRISTATE_OFF
  20174. };
  20175. if ("ul" == b) return {
  20176. bulletedlist: CKEDITOR.TRISTATE_OFF
  20177. };
  20178. a = a.getParent()
  20179. }
  20180. return null
  20181. })
  20182. }
  20183. }
  20184. };
  20185. CKEDITOR.plugins.add("liststyle", CKEDITOR.plugins.liststyle)
  20186. })();
  20187. (function() {
  20188. function V(a, c, d) {
  20189. return n(c) && n(d) && d.equals(c.getNext(function(a) {
  20190. return !(E(a) || F(a) || u(a))
  20191. }))
  20192. }
  20193. function z(a) {
  20194. this.upper = a[0];
  20195. this.lower = a[1];
  20196. this.set.apply(this, a.slice(2))
  20197. }
  20198. function O(a) {
  20199. var c = a.element;
  20200. if (c && n(c) && (c = c.getAscendant(a.triggers, !0)) && a.editable.contains(c)) {
  20201. var d = P(c);
  20202. if ("true" == d.getAttribute("contenteditable")) return c;
  20203. if (d.is(a.triggers)) return d
  20204. }
  20205. return null
  20206. }
  20207. function ka(a, c, d) {
  20208. r(a, c);
  20209. r(a, d);
  20210. a = c.size.bottom;
  20211. d = d.size.top;
  20212. return a && d ? 0 | (a + d) / 2 : a || d
  20213. }
  20214. function w(a, c, d) {
  20215. return c =
  20216. c[d ? "getPrevious" : "getNext"](function(b) {
  20217. return b && b.type == CKEDITOR.NODE_TEXT && !E(b) || n(b) && !u(b) && !A(a, b)
  20218. })
  20219. }
  20220. function q(a, c, d) {
  20221. return a > c && a < d
  20222. }
  20223. function P(a, c) {
  20224. if (a.data("cke-editable")) return null;
  20225. for (c || (a = a.getParent()); a && !a.data("cke-editable");) {
  20226. if (a.hasAttribute("contenteditable")) return a;
  20227. a = a.getParent()
  20228. }
  20229. return null
  20230. }
  20231. function la(a) {
  20232. var c = a.doc,
  20233. d = G('\x3cspan contenteditable\x3d"false" data-cke-magic-line\x3d"1" style\x3d"' + Q + "position:absolute;border-top:1px dashed " + a.boxColor + '"\x3e\x3c/span\x3e',
  20234. c),
  20235. b = CKEDITOR.getUrl(this.path + "images/" + (t.hidpi ? "hidpi/" : "") + "icon" + (a.rtl ? "-rtl" : "") + ".png");
  20236. v(d, {
  20237. attach: function() {
  20238. this.wrap.getParent() || this.wrap.appendTo(a.editable, !0);
  20239. return this
  20240. },
  20241. lineChildren: [v(G('\x3cspan title\x3d"' + a.editor.lang.magicline.title + '" contenteditable\x3d"false"\x3e\x26#8629;\x3c/span\x3e', c), {
  20242. base: Q + "height:17px;width:17px;" + (a.rtl ? "left" : "right") + ":17px;background:url(" + b + ") center no-repeat " + a.boxColor + ";cursor:pointer;" + (t.hc ? "font-size: 15px;line-height:14px;border:1px solid #fff;text-align:center;" :
  20243. "") + (t.hidpi ? "background-size: 9px 10px;" : ""),
  20244. looks: ["top:-8px; border-radius: 2px;", "top:-17px; border-radius: 2px 2px 0px 0px;", "top:-1px; border-radius: 0px 0px 2px 2px;"]
  20245. }), v(G(W, c), {
  20246. base: X + "left:0px;border-left-color:" + a.boxColor + ";",
  20247. looks: ["border-width:8px 0 8px 8px;top:-8px", "border-width:8px 0 0 8px;top:-8px", "border-width:0 0 8px 8px;top:0px"]
  20248. }), v(G(W, c), {
  20249. base: X + "right:0px;border-right-color:" + a.boxColor + ";",
  20250. looks: ["border-width:8px 8px 8px 0;top:-8px", "border-width:8px 8px 0 0;top:-8px",
  20251. "border-width:0 8px 8px 0;top:0px"
  20252. ]
  20253. })],
  20254. detach: function() {
  20255. this.wrap.getParent() && this.wrap.remove();
  20256. return this
  20257. },
  20258. mouseNear: function() {
  20259. r(a, this);
  20260. var b = a.holdDistance,
  20261. c = this.size;
  20262. return c && q(a.mouse.y, c.top - b, c.bottom + b) && q(a.mouse.x, c.left - b, c.right + b) ? !0 : !1
  20263. },
  20264. place: function() {
  20265. var b = a.view,
  20266. c = a.editable,
  20267. d = a.trigger,
  20268. h = d.upper,
  20269. g = d.lower,
  20270. l = h || g,
  20271. p = l.getParent(),
  20272. m = {};
  20273. this.trigger = d;
  20274. h && r(a, h, !0);
  20275. g && r(a, g, !0);
  20276. r(a, p, !0);
  20277. a.inInlineMode && H(a, !0);
  20278. p.equals(c) ? (m.left = b.scroll.x, m.right = -b.scroll.x, m.width = "") : (m.left =
  20279. l.size.left - l.size.margin.left + b.scroll.x - (a.inInlineMode ? b.editable.left + b.editable.border.left : 0), m.width = l.size.outerWidth + l.size.margin.left + l.size.margin.right + b.scroll.x, m.right = "");
  20280. h && g ? m.top = h.size.margin.bottom === g.size.margin.top ? 0 | h.size.bottom + h.size.margin.bottom / 2 : h.size.margin.bottom < g.size.margin.top ? h.size.bottom + h.size.margin.bottom : h.size.bottom + h.size.margin.bottom - g.size.margin.top : h ? g || (m.top = h.size.bottom + h.size.margin.bottom) : m.top = g.size.top - g.size.margin.top;
  20281. d.is(C) || q(m.top,
  20282. b.scroll.y - 15, b.scroll.y + 5) ? (m.top = a.inInlineMode ? 0 : b.scroll.y, this.look(C)) : d.is(D) || q(m.top, b.pane.bottom - 5, b.pane.bottom + 15) ? (m.top = a.inInlineMode ? b.editable.height + b.editable.padding.top + b.editable.padding.bottom : b.pane.bottom - 1, this.look(D)) : (a.inInlineMode && (m.top -= b.editable.top + b.editable.border.top), this.look(x));
  20283. a.inInlineMode && (m.top--, m.top += b.editable.scroll.top, m.left += b.editable.scroll.left);
  20284. for (var n in m) m[n] = CKEDITOR.tools.cssLength(m[n]);
  20285. this.setStyles(m)
  20286. },
  20287. look: function(a) {
  20288. if (this.oldLook !=
  20289. a) {
  20290. for (var b = this.lineChildren.length, c; b--;)(c = this.lineChildren[b]).setAttribute("style", c.base + c.looks[0 | a / 2]);
  20291. this.oldLook = a
  20292. }
  20293. },
  20294. wrap: new R("span", a.doc)
  20295. });
  20296. for (c = d.lineChildren.length; c--;) d.lineChildren[c].appendTo(d);
  20297. d.look(x);
  20298. d.appendTo(d.wrap);
  20299. d.unselectable();
  20300. d.lineChildren[0].on("mouseup", function(b) {
  20301. d.detach();
  20302. S(a, function(b) {
  20303. var c = a.line.trigger;
  20304. b[c.is(I) ? "insertBefore" : "insertAfter"](c.is(I) ? c.lower : c.upper)
  20305. }, !0);
  20306. a.editor.focus();
  20307. t.ie || a.enterMode == CKEDITOR.ENTER_BR || a.hotNode.scrollIntoView();
  20308. b.data.preventDefault(!0)
  20309. });
  20310. d.on("mousedown", function(a) {
  20311. a.data.preventDefault(!0)
  20312. });
  20313. a.line = d
  20314. }
  20315. function S(a, c, d) {
  20316. var b = new CKEDITOR.dom.range(a.doc),
  20317. e = a.editor,
  20318. f;
  20319. t.ie && a.enterMode == CKEDITOR.ENTER_BR ? f = a.doc.createText(J) : (f = (f = P(a.element, !0)) && f.data("cke-enter-mode") || a.enterMode, f = new R(K[f], a.doc), f.is("br") || a.doc.createText(J).appendTo(f));
  20320. d && e.fire("saveSnapshot");
  20321. c(f);
  20322. b.moveToPosition(f, CKEDITOR.POSITION_AFTER_START);
  20323. e.getSelection().selectRanges([b]);
  20324. a.hotNode = f;
  20325. d && e.fire("saveSnapshot")
  20326. }
  20327. function Y(a, c) {
  20328. return {
  20329. canUndo: !0,
  20330. modes: {
  20331. wysiwyg: 1
  20332. },
  20333. exec: function() {
  20334. function d(b) {
  20335. var d = t.ie && 9 > t.version ? " " : J,
  20336. f = a.hotNode && a.hotNode.getText() == d && a.element.equals(a.hotNode) && a.lastCmdDirection === !!c;
  20337. S(a, function(d) {
  20338. f && a.hotNode && a.hotNode.remove();
  20339. d[c ? "insertAfter" : "insertBefore"](b);
  20340. d.setAttributes({
  20341. "data-cke-magicline-hot": 1,
  20342. "data-cke-magicline-dir": !!c
  20343. });
  20344. a.lastCmdDirection = !!c
  20345. });
  20346. t.ie || a.enterMode == CKEDITOR.ENTER_BR || a.hotNode.scrollIntoView();
  20347. a.line.detach()
  20348. }
  20349. return function(b) {
  20350. b = b.getSelection().getStartElement();
  20351. var e;
  20352. b = b.getAscendant(Z, 1);
  20353. if (!aa(a, b) && b && !b.equals(a.editable) && !b.contains(a.editable)) {
  20354. (e = P(b)) && "false" == e.getAttribute("contenteditable") && (b = e);
  20355. a.element = b;
  20356. e = w(a, b, !c);
  20357. var f;
  20358. n(e) && e.is(a.triggers) && e.is(ma) && (!w(a, e, !c) || (f = w(a, e, !c)) && n(f) && f.is(a.triggers)) ? d(e) : (f = O(a, b), n(f) && (w(a, f, !c) ? (b = w(a, f, !c)) && n(b) && b.is(a.triggers) && d(f) : d(f)))
  20359. }
  20360. }
  20361. }()
  20362. }
  20363. }
  20364. function A(a, c) {
  20365. if (!c || c.type != CKEDITOR.NODE_ELEMENT || !c.$) return !1;
  20366. var d = a.line;
  20367. return d.wrap.equals(c) || d.wrap.contains(c)
  20368. }
  20369. function n(a) {
  20370. return a &&
  20371. a.type == CKEDITOR.NODE_ELEMENT && a.$
  20372. }
  20373. function u(a) {
  20374. if (!n(a)) return !1;
  20375. var c;
  20376. (c = ba(a)) || (n(a) ? (c = {
  20377. left: 1,
  20378. right: 1,
  20379. center: 1
  20380. }, c = !(!c[a.getComputedStyle("float")] && !c[a.getAttribute("align")])) : c = !1);
  20381. return c
  20382. }
  20383. function ba(a) {
  20384. return !!{
  20385. absolute: 1,
  20386. fixed: 1
  20387. } [a.getComputedStyle("position")]
  20388. }
  20389. function L(a, c) {
  20390. return n(c) ? c.is(a.triggers) : null
  20391. }
  20392. function aa(a, c) {
  20393. if (!c) return !1;
  20394. for (var d = c.getParents(1), b = d.length; b--;)
  20395. for (var e = a.tabuList.length; e--;)
  20396. if (d[b].hasAttribute(a.tabuList[e])) return !0;
  20397. return !1
  20398. }
  20399. function na(a,
  20400. c, d) {
  20401. c = c[d ? "getLast" : "getFirst"](function(b) {
  20402. return a.isRelevant(b) && !b.is(oa)
  20403. });
  20404. if (!c) return !1;
  20405. r(a, c);
  20406. return d ? c.size.top > a.mouse.y : c.size.bottom < a.mouse.y
  20407. }
  20408. function ca(a) {
  20409. var c = a.editable,
  20410. d = a.mouse,
  20411. b = a.view,
  20412. e = a.triggerOffset;
  20413. H(a);
  20414. var f = d.y > (a.inInlineMode ? b.editable.top + b.editable.height / 2 : Math.min(b.editable.height, b.pane.height) / 2),
  20415. c = c[f ? "getLast" : "getFirst"](function(a) {
  20416. return !(E(a) || F(a))
  20417. });
  20418. if (!c) return null;
  20419. A(a, c) && (c = a.line.wrap[f ? "getPrevious" : "getNext"](function(a) {
  20420. return !(E(a) || F(a))
  20421. }));
  20422. if (!n(c) || u(c) || !L(a, c)) return null;
  20423. r(a, c);
  20424. return !f && 0 <= c.size.top && q(d.y, 0, c.size.top + e) ? (a = a.inInlineMode || 0 === b.scroll.y ? C : x, new z([null, c, I, M, a])) : f && c.size.bottom <= b.pane.height && q(d.y, c.size.bottom - e, b.pane.height) ? (a = a.inInlineMode || q(c.size.bottom, b.pane.height - e, b.pane.height) ? D : x, new z([c, null, da, M, a])) : null
  20425. }
  20426. function ea(a) {
  20427. var c = a.mouse,
  20428. d = a.view,
  20429. b = a.triggerOffset,
  20430. e = O(a);
  20431. if (!e) return null;
  20432. r(a, e);
  20433. var b = Math.min(b, 0 | e.size.outerHeight / 2),
  20434. f = [],
  20435. k, h;
  20436. if (q(c.y, e.size.top - 1, e.size.top + b)) h = !1;
  20437. else if (q(c.y,
  20438. e.size.bottom - b, e.size.bottom + 1)) h = !0;
  20439. else return null;
  20440. if (u(e) || na(a, e, h) || e.getParent().is(fa)) return null;
  20441. var g = w(a, e, !h);
  20442. if (g) {
  20443. if (g && g.type == CKEDITOR.NODE_TEXT) return null;
  20444. if (n(g)) {
  20445. if (u(g) || !L(a, g) || g.getParent().is(fa)) return null;
  20446. f = [g, e][h ? "reverse" : "concat"]().concat([T, M])
  20447. }
  20448. } else e.equals(a.editable[h ? "getLast" : "getFirst"](a.isRelevant)) ? (H(a), h && q(c.y, e.size.bottom - b, d.pane.height) && q(e.size.bottom, d.pane.height - b, d.pane.height) ? k = D : q(c.y, 0, e.size.top + b) && (k = C)) : k = x, f = [null, e][h ? "reverse" :
  20449. "concat"
  20450. ]().concat([h ? da : I, M, k, e.equals(a.editable[h ? "getLast" : "getFirst"](a.isRelevant)) ? h ? D : C : x]);
  20451. return 0 in f ? new z(f) : null
  20452. }
  20453. function U(a, c, d, b) {
  20454. for (var e = c.getDocumentPosition(), f = {}, k = {}, h = {}, g = {}, l = y.length; l--;) f[y[l]] = parseInt(c.getComputedStyle.call(c, "border-" + y[l] + "-width"), 10) || 0, h[y[l]] = parseInt(c.getComputedStyle.call(c, "padding-" + y[l]), 10) || 0, k[y[l]] = parseInt(c.getComputedStyle.call(c, "margin-" + y[l]), 10) || 0;
  20455. d && !b || N(a, b);
  20456. g.top = e.y - (d ? 0 : a.view.scroll.y);
  20457. g.left = e.x - (d ? 0 : a.view.scroll.x);
  20458. g.outerWidth = c.$.offsetWidth;
  20459. g.outerHeight = c.$.offsetHeight;
  20460. g.height = g.outerHeight - (h.top + h.bottom + f.top + f.bottom);
  20461. g.width = g.outerWidth - (h.left + h.right + f.left + f.right);
  20462. g.bottom = g.top + g.outerHeight;
  20463. g.right = g.left + g.outerWidth;
  20464. a.inInlineMode && (g.scroll = {
  20465. top: c.$.scrollTop,
  20466. left: c.$.scrollLeft
  20467. });
  20468. return v({
  20469. border: f,
  20470. padding: h,
  20471. margin: k,
  20472. ignoreScroll: d
  20473. }, g, !0)
  20474. }
  20475. function r(a, c, d) {
  20476. if (!n(c)) return c.size = null;
  20477. if (!c.size) c.size = {};
  20478. else if (c.size.ignoreScroll == d && c.size.date > new Date - ga) return null;
  20479. return v(c.size,
  20480. U(a, c, d), {
  20481. date: +new Date
  20482. }, !0)
  20483. }
  20484. function H(a, c) {
  20485. a.view.editable = U(a, a.editable, c, !0)
  20486. }
  20487. function N(a, c) {
  20488. a.view || (a.view = {});
  20489. var d = a.view;
  20490. if (!(!c && d && d.date > new Date - ga)) {
  20491. var b = a.win,
  20492. d = b.getScrollPosition(),
  20493. b = b.getViewPaneSize();
  20494. v(a.view, {
  20495. scroll: {
  20496. x: d.x,
  20497. y: d.y,
  20498. width: a.doc.$.documentElement.scrollWidth - b.width,
  20499. height: a.doc.$.documentElement.scrollHeight - b.height
  20500. },
  20501. pane: {
  20502. width: b.width,
  20503. height: b.height,
  20504. bottom: b.height + d.y
  20505. },
  20506. date: +new Date
  20507. }, !0)
  20508. }
  20509. }
  20510. function pa(a, c, d, b) {
  20511. for (var e = b, f = b, k = 0, h = !1, g = !1, l = a.view.pane.height,
  20512. p = a.mouse; p.y + k < l && 0 < p.y - k;) {
  20513. h || (h = c(e, b));
  20514. g || (g = c(f, b));
  20515. !h && 0 < p.y - k && (e = d(a, {
  20516. x: p.x,
  20517. y: p.y - k
  20518. }));
  20519. !g && p.y + k < l && (f = d(a, {
  20520. x: p.x,
  20521. y: p.y + k
  20522. }));
  20523. if (h && g) break;
  20524. k += 2
  20525. }
  20526. return new z([e, f, null, null])
  20527. }
  20528. CKEDITOR.plugins.add("magicline", {
  20529. init: function(a) {
  20530. var c = a.config,
  20531. d = c.magicline_triggerOffset || 30,
  20532. b = {
  20533. editor: a,
  20534. enterMode: c.enterMode,
  20535. triggerOffset: d,
  20536. holdDistance: 0 | d * (c.magicline_holdDistance || .5),
  20537. boxColor: c.magicline_color || "#ff0000",
  20538. rtl: "rtl" == c.contentsLangDirection,
  20539. tabuList: ["data-cke-hidden-sel"].concat(c.magicline_tabuList || []),
  20540. triggers: c.magicline_everywhere ? Z : {
  20541. table: 1,
  20542. hr: 1,
  20543. div: 1,
  20544. ul: 1,
  20545. ol: 1,
  20546. dl: 1,
  20547. form: 1,
  20548. blockquote: 1
  20549. }
  20550. },
  20551. e, f, k;
  20552. b.isRelevant = function(a) {
  20553. return n(a) && !A(b, a) && !u(a)
  20554. };
  20555. a.on("contentDom", function() {
  20556. var d = a.editable(),
  20557. g = a.document,
  20558. l = a.window;
  20559. v(b, {
  20560. editable: d,
  20561. inInlineMode: d.isInline(),
  20562. doc: g,
  20563. win: l,
  20564. hotNode: null
  20565. }, !0);
  20566. b.boundary = b.inInlineMode ? b.editable : b.doc.getDocumentElement();
  20567. d.is(B.$inline) || (b.inInlineMode && !ba(d) && d.setStyles({
  20568. position: "relative",
  20569. top: null,
  20570. left: null
  20571. }), la.call(this, b), N(b), d.attachListener(a, "beforeUndoImage",
  20572. function() {
  20573. b.line.detach()
  20574. }), d.attachListener(a, "beforeGetData", function() {
  20575. b.line.wrap.getParent() && (b.line.detach(), a.once("getData", function() {
  20576. b.line.attach()
  20577. }, null, null, 1E3))
  20578. }, null, null, 0), d.attachListener(b.inInlineMode ? g : g.getWindow().getFrame(), "mouseout", function(c) {
  20579. if ("wysiwyg" == a.mode)
  20580. if (b.inInlineMode) {
  20581. var d = c.data.$.clientX;
  20582. c = c.data.$.clientY;
  20583. N(b);
  20584. H(b, !0);
  20585. var e = b.view.editable,
  20586. f = b.view.scroll;
  20587. d > e.left - f.x && d < e.right - f.x && c > e.top - f.y && c < e.bottom - f.y || (clearTimeout(k), k = null, b.line.detach())
  20588. } else clearTimeout(k),
  20589. k = null, b.line.detach()
  20590. }), d.attachListener(d, "keyup", function() {
  20591. b.hiddenMode = 0
  20592. }), d.attachListener(d, "keydown", function(c) {
  20593. if ("wysiwyg" == a.mode) switch (c.data.getKeystroke()) {
  20594. case 2228240:
  20595. case 16:
  20596. b.hiddenMode = 1, b.line.detach()
  20597. }
  20598. }), d.attachListener(b.inInlineMode ? d : g, "mousemove", function(c) {
  20599. f = !0;
  20600. if ("wysiwyg" == a.mode && !a.readOnly && !k) {
  20601. var d = {
  20602. x: c.data.$.clientX,
  20603. y: c.data.$.clientY
  20604. };
  20605. k = setTimeout(function() {
  20606. b.mouse = d;
  20607. k = b.trigger = null;
  20608. N(b);
  20609. f && !b.hiddenMode && a.focusManager.hasFocus && !b.line.mouseNear() && (b.element =
  20610. ha(b, !0)) && ((b.trigger = ca(b) || ea(b) || ia(b)) && !aa(b, b.trigger.upper || b.trigger.lower) ? b.line.attach().place() : (b.trigger = null, b.line.detach()), f = !1)
  20611. }, 30)
  20612. }
  20613. }), d.attachListener(l, "scroll", function() {
  20614. "wysiwyg" == a.mode && (b.line.detach(), t.webkit && (b.hiddenMode = 1, clearTimeout(e), e = setTimeout(function() {
  20615. b.mouseDown || (b.hiddenMode = 0)
  20616. }, 50)))
  20617. }), d.attachListener(ja ? g : l, "mousedown", function() {
  20618. "wysiwyg" == a.mode && (b.line.detach(), b.hiddenMode = 1, b.mouseDown = 1)
  20619. }), d.attachListener(ja ? g : l, "mouseup", function() {
  20620. b.hiddenMode =
  20621. 0;
  20622. b.mouseDown = 0
  20623. }), a.addCommand("accessPreviousSpace", Y(b)), a.addCommand("accessNextSpace", Y(b, !0)), a.setKeystroke([
  20624. [c.magicline_keystrokePrevious, "accessPreviousSpace"],
  20625. [c.magicline_keystrokeNext, "accessNextSpace"]
  20626. ]), a.on("loadSnapshot", function() {
  20627. var c, d, e, f;
  20628. for (f in {
  20629. p: 1,
  20630. br: 1,
  20631. div: 1
  20632. })
  20633. for (c = a.document.getElementsByTag(f), e = c.count(); e--;)
  20634. if ((d = c.getItem(e)).data("cke-magicline-hot")) {
  20635. b.hotNode = d;
  20636. b.lastCmdDirection = "true" === d.data("cke-magicline-dir") ? !0 : !1;
  20637. return
  20638. }
  20639. }), this.backdoor = {
  20640. accessFocusSpace: S,
  20641. boxTrigger: z,
  20642. isLine: A,
  20643. getAscendantTrigger: O,
  20644. getNonEmptyNeighbour: w,
  20645. getSize: U,
  20646. that: b,
  20647. triggerEdge: ea,
  20648. triggerEditable: ca,
  20649. triggerExpand: ia
  20650. })
  20651. }, this)
  20652. }
  20653. });
  20654. var v = CKEDITOR.tools.extend,
  20655. R = CKEDITOR.dom.element,
  20656. G = R.createFromHtml,
  20657. t = CKEDITOR.env,
  20658. ja = CKEDITOR.env.ie && 9 > CKEDITOR.env.version,
  20659. B = CKEDITOR.dtd,
  20660. K = {},
  20661. I = 128,
  20662. da = 64,
  20663. T = 32,
  20664. M = 16,
  20665. C = 4,
  20666. D = 2,
  20667. x = 1,
  20668. J = " ",
  20669. fa = B.$listItem,
  20670. oa = B.$tableContent,
  20671. ma = v({}, B.$nonEditable, B.$empty),
  20672. Z = B.$block,
  20673. ga = 100,
  20674. Q = "width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",
  20675. X = Q + "border-color:transparent;display:block;border-style:solid;",
  20676. W = "\x3cspan\x3e" + J + "\x3c/span\x3e";
  20677. K[CKEDITOR.ENTER_BR] = "br";
  20678. K[CKEDITOR.ENTER_P] = "p";
  20679. K[CKEDITOR.ENTER_DIV] = "div";
  20680. z.prototype = {
  20681. set: function(a, c, d) {
  20682. this.properties = a + c + (d || x);
  20683. return this
  20684. },
  20685. is: function(a) {
  20686. return (this.properties & a) == a
  20687. }
  20688. };
  20689. var ha = function() {
  20690. function a(a, d) {
  20691. var b = a.$.elementFromPoint(d.x, d.y);
  20692. return b && b.nodeType ? new CKEDITOR.dom.element(b) : null
  20693. }
  20694. return function(c, d, b) {
  20695. if (!c.mouse) return null;
  20696. var e = c.doc,
  20697. f = c.line.wrap;
  20698. b = b || c.mouse;
  20699. var k = a(e, b);
  20700. d && A(c, k) && (f.hide(), k = a(e, b), f.show());
  20701. return !k || k.type != CKEDITOR.NODE_ELEMENT || !k.$ || t.ie && 9 > t.version && !c.boundary.equals(k) && !c.boundary.contains(k) ? null : k
  20702. }
  20703. }(),
  20704. E = CKEDITOR.dom.walker.whitespaces(),
  20705. F = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),
  20706. ia = function() {
  20707. function a(a) {
  20708. var b = a.element,
  20709. e, f, k;
  20710. if (!n(b) || b.contains(a.editable) || b.isReadOnly()) return null;
  20711. k = pa(a, function(a, b) {
  20712. return !b.equals(a)
  20713. }, function(a, b) {
  20714. return ha(a, !0, b)
  20715. }, b);
  20716. e = k.upper;
  20717. f = k.lower;
  20718. if (V(a, e, f)) return k.set(T,
  20719. 8);
  20720. if (e && b.contains(e))
  20721. for (; !e.getParent().equals(b);) e = e.getParent();
  20722. else e = b.getFirst(function(b) {
  20723. return c(a, b)
  20724. });
  20725. if (f && b.contains(f))
  20726. for (; !f.getParent().equals(b);) f = f.getParent();
  20727. else f = b.getLast(function(b) {
  20728. return c(a, b)
  20729. });
  20730. if (!e || !f) return null;
  20731. r(a, e);
  20732. r(a, f);
  20733. if (!q(a.mouse.y, e.size.top, f.size.bottom)) return null;
  20734. for (var b = Number.MAX_VALUE, h, g, l, p; f && !f.equals(e) && (g = e.getNext(a.isRelevant));) h = Math.abs(ka(a, e, g) - a.mouse.y), h < b && (b = h, l = e, p = g), e = g, r(a, e);
  20735. if (!l || !p || !q(a.mouse.y, l.size.top, p.size.bottom)) return null;
  20736. k.upper = l;
  20737. k.lower = p;
  20738. return k.set(T, 8)
  20739. }
  20740. function c(a, b) {
  20741. return !(b && b.type == CKEDITOR.NODE_TEXT || F(b) || u(b) || A(a, b) || b.type == CKEDITOR.NODE_ELEMENT && b.$ && b.is("br"))
  20742. }
  20743. return function(c) {
  20744. var b = a(c),
  20745. e;
  20746. if (e = b) {
  20747. e = b.upper;
  20748. var f = b.lower;
  20749. e = !e || !f || u(f) || u(e) || f.equals(e) || e.equals(f) || f.contains(e) || e.contains(f) ? !1 : L(c, e) && L(c, f) && V(c, e, f) ? !0 : !1
  20750. }
  20751. return e ? b : null
  20752. }
  20753. }(),
  20754. y = ["top", "left", "right", "bottom"]
  20755. })();
  20756. CKEDITOR.config.magicline_keystrokePrevious = CKEDITOR.CTRL + CKEDITOR.SHIFT + 51;
  20757. CKEDITOR.config.magicline_keystrokeNext = CKEDITOR.CTRL + CKEDITOR.SHIFT + 52;
  20758. (function() {
  20759. function n(a) {
  20760. if (!a || a.type != CKEDITOR.NODE_ELEMENT || "form" != a.getName()) return [];
  20761. for (var e = [], f = ["style", "className"], b = 0; b < f.length; b++) {
  20762. var c = a.$.elements.namedItem(f[b]);
  20763. c && (c = new CKEDITOR.dom.element(c), e.push([c, c.nextSibling]), c.remove())
  20764. }
  20765. return e
  20766. }
  20767. function t(a, e) {
  20768. if (a && a.type == CKEDITOR.NODE_ELEMENT && "form" == a.getName() && 0 < e.length)
  20769. for (var f = e.length - 1; 0 <= f; f--) {
  20770. var b = e[f][0],
  20771. c = e[f][1];
  20772. c ? b.insertBefore(c) : b.appendTo(a)
  20773. }
  20774. }
  20775. function r(a, e) {
  20776. var f = n(a),
  20777. b = {},
  20778. c = a.$;
  20779. e || (b["class"] = c.className ||
  20780. "", c.className = "");
  20781. b.inline = c.style.cssText || "";
  20782. e || (c.style.cssText = "position: static; overflow: visible");
  20783. t(f);
  20784. return b
  20785. }
  20786. function u(a, e) {
  20787. var f = n(a),
  20788. b = a.$;
  20789. "class" in e && (b.className = e["class"]);
  20790. "inline" in e && (b.style.cssText = e.inline);
  20791. t(f)
  20792. }
  20793. function v(a) {
  20794. if (!a.editable().isInline()) {
  20795. var e = CKEDITOR.instances,
  20796. f;
  20797. for (f in e) {
  20798. var b = e[f];
  20799. "wysiwyg" != b.mode || b.readOnly || (b = b.document.getBody(), b.setAttribute("contentEditable", !1), b.setAttribute("contentEditable", !0))
  20800. }
  20801. a.editable().hasFocus && (a.toolbox.focus(),
  20802. a.focus())
  20803. }
  20804. }
  20805. CKEDITOR.plugins.add("maximize", {
  20806. init: function(a) {
  20807. function e() {
  20808. var b = c.getViewPaneSize();
  20809. a.resize(b.width, b.height, null, !0)
  20810. }
  20811. if (a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
  20812. var f = a.lang,
  20813. b = CKEDITOR.document,
  20814. c = b.getWindow(),
  20815. l, m, p, n = CKEDITOR.TRISTATE_OFF;
  20816. a.addCommand("maximize", {
  20817. modes: {
  20818. wysiwyg: !CKEDITOR.env.iOS,
  20819. source: !CKEDITOR.env.iOS
  20820. },
  20821. readOnly: 1,
  20822. editorFocus: !1,
  20823. exec: function() {
  20824. var h = a.container.getFirst(function(a) {
  20825. return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_inner")
  20826. }),
  20827. g = a.ui.space("contents");
  20828. if ("wysiwyg" == a.mode) {
  20829. var d = a.getSelection();
  20830. l = d && d.getRanges();
  20831. m = c.getScrollPosition()
  20832. } else {
  20833. var k = a.editable().$;
  20834. l = !CKEDITOR.env.ie && [k.selectionStart, k.selectionEnd];
  20835. m = [k.scrollLeft, k.scrollTop]
  20836. }
  20837. if (this.state == CKEDITOR.TRISTATE_OFF) {
  20838. c.on("resize", e);
  20839. p = c.getScrollPosition();
  20840. for (d = a.container; d = d.getParent();) d.setCustomData("maximize_saved_styles", r(d)), d.setStyle("z-index", a.config.baseFloatZIndex - 5);
  20841. g.setCustomData("maximize_saved_styles", r(g, !0));
  20842. h.setCustomData("maximize_saved_styles", r(h, !0));
  20843. g = {
  20844. overflow: CKEDITOR.env.webkit ? "" : "hidden",
  20845. width: 0,
  20846. height: 0
  20847. };
  20848. b.getDocumentElement().setStyles(g);
  20849. !CKEDITOR.env.gecko && b.getDocumentElement().setStyle("position", "fixed");
  20850. CKEDITOR.env.gecko && CKEDITOR.env.quirks || b.getBody().setStyles(g);
  20851. CKEDITOR.env.ie ? setTimeout(function() {
  20852. c.$.scrollTo(0, 0)
  20853. }, 0) : c.$.scrollTo(0, 0);
  20854. h.setStyle("position", CKEDITOR.env.gecko && CKEDITOR.env.quirks ? "fixed" : "absolute");
  20855. h.$.offsetLeft;
  20856. h.setStyles({
  20857. "z-index": a.config.baseFloatZIndex - 5,
  20858. left: "0px",
  20859. top: "0px"
  20860. });
  20861. h.addClass("cke_maximized");
  20862. e();
  20863. g = h.getDocumentPosition();
  20864. h.setStyles({
  20865. left: -1 * g.x + "px",
  20866. top: -1 * g.y + "px"
  20867. });
  20868. CKEDITOR.env.gecko && v(a)
  20869. } else if (this.state == CKEDITOR.TRISTATE_ON) {
  20870. c.removeListener("resize", e);
  20871. for (var d = [g, h], q = 0; q < d.length; q++) u(d[q], d[q].getCustomData("maximize_saved_styles")), d[q].removeCustomData("maximize_saved_styles");
  20872. for (d = a.container; d = d.getParent();) u(d, d.getCustomData("maximize_saved_styles")), d.removeCustomData("maximize_saved_styles");
  20873. CKEDITOR.env.ie ? setTimeout(function() {
  20874. c.$.scrollTo(p.x, p.y)
  20875. }, 0) : c.$.scrollTo(p.x,
  20876. p.y);
  20877. h.removeClass("cke_maximized");
  20878. CKEDITOR.env.webkit && (h.setStyle("display", "inline"), setTimeout(function() {
  20879. h.setStyle("display", "block")
  20880. }, 0));
  20881. a.fire("resize", {
  20882. outerHeight: a.container.$.offsetHeight,
  20883. contentsHeight: g.$.offsetHeight,
  20884. outerWidth: a.container.$.offsetWidth
  20885. })
  20886. }
  20887. this.toggleState();
  20888. if (d = this.uiItems[0]) g = this.state == CKEDITOR.TRISTATE_OFF ? f.maximize.maximize : f.maximize.minimize, d = CKEDITOR.document.getById(d._.id), d.getChild(1).setHtml(g), d.setAttribute("title", g), d.setAttribute("href", 'javascript:void("' +
  20889. g + '");');
  20890. "wysiwyg" == a.mode ? l ? (CKEDITOR.env.gecko && v(a), a.getSelection().selectRanges(l), (k = a.getSelection().getStartElement()) && k.scrollIntoView(!0)) : c.$.scrollTo(m.x, m.y) : (l && (k.selectionStart = l[0], k.selectionEnd = l[1]), k.scrollLeft = m[0], k.scrollTop = m[1]);
  20891. l = m = null;
  20892. n = this.state;
  20893. a.fire("maximize", this.state)
  20894. },
  20895. canUndo: !1
  20896. });
  20897. a.ui.addButton && a.ui.addButton("Maximize", {
  20898. label: f.maximize.maximize,
  20899. command: "maximize",
  20900. toolbar: "tools,10"
  20901. });
  20902. a.on("mode", function() {
  20903. var b = a.getCommand("maximize");
  20904. b.setState(b.state ==
  20905. CKEDITOR.TRISTATE_DISABLED ? CKEDITOR.TRISTATE_DISABLED : n)
  20906. }, null, null, 100)
  20907. }
  20908. }
  20909. })
  20910. })();
  20911. CKEDITOR.plugins.add("newpage", {
  20912. init: function(a) {
  20913. a.addCommand("newpage", {
  20914. modes: {
  20915. wysiwyg: 1,
  20916. source: 1
  20917. },
  20918. exec: function(b) {
  20919. var a = this;
  20920. b.setData(b.config.newpage_html || "", function() {
  20921. b.focus();
  20922. setTimeout(function() {
  20923. b.fire("afterCommandExec", {
  20924. name: "newpage",
  20925. command: a
  20926. });
  20927. b.selectionChange()
  20928. }, 200)
  20929. })
  20930. },
  20931. async: !0
  20932. });
  20933. a.ui.addButton && a.ui.addButton("NewPage", {
  20934. label: a.lang.newpage.toolbar,
  20935. command: "newpage",
  20936. toolbar: "document,20"
  20937. })
  20938. }
  20939. });
  20940. (function() {
  20941. function e(a) {
  20942. return {
  20943. "aria-label": a,
  20944. "class": "cke_pagebreak",
  20945. contenteditable: "false",
  20946. "data-cke-display-name": "pagebreak",
  20947. "data-cke-pagebreak": 1,
  20948. style: "page-break-after: always",
  20949. title: a
  20950. }
  20951. }
  20952. CKEDITOR.plugins.add("pagebreak", {
  20953. requires: "fakeobjects",
  20954. onLoad: function() {
  20955. var a = ("background:url(" + CKEDITOR.getUrl(this.path + "images/pagebreak.gif") + ") no-repeat center center;clear:both;width:100%;border-top:#999 1px dotted;border-bottom:#999 1px dotted;padding:0;height:7px;cursor:default;").replace(/;/g,
  20956. " !important;");
  20957. CKEDITOR.addCss("div.cke_pagebreak{" + a + "}")
  20958. },
  20959. init: function(a) {
  20960. a.blockless || (a.addCommand("pagebreak", CKEDITOR.plugins.pagebreakCmd), a.ui.addButton && a.ui.addButton("PageBreak", {
  20961. label: a.lang.pagebreak.toolbar,
  20962. command: "pagebreak",
  20963. toolbar: "insert,70"
  20964. }), CKEDITOR.env.webkit && a.on("contentDom", function() {
  20965. a.document.on("click", function(b) {
  20966. b = b.data.getTarget();
  20967. b.is("div") && b.hasClass("cke_pagebreak") && a.getSelection().selectElement(b)
  20968. })
  20969. }))
  20970. },
  20971. afterInit: function(a) {
  20972. function b(f) {
  20973. CKEDITOR.tools.extend(f.attributes,
  20974. e(a.lang.pagebreak.alt), !0);
  20975. f.children.length = 0
  20976. }
  20977. var c = a.dataProcessor,
  20978. g = c && c.dataFilter,
  20979. c = c && c.htmlFilter,
  20980. h = /page-break-after\s*:\s*always/i,
  20981. k = /display\s*:\s*none/i;
  20982. c && c.addRules({
  20983. attributes: {
  20984. "class": function(a, b) {
  20985. var c = a.replace("cke_pagebreak", "");
  20986. if (c != a) {
  20987. var d = CKEDITOR.htmlParser.fragment.fromHtml('\x3cspan style\x3d"display: none;"\x3e\x26nbsp;\x3c/span\x3e').children[0];
  20988. b.children.length = 0;
  20989. b.add(d);
  20990. d = b.attributes;
  20991. delete d["aria-label"];
  20992. delete d.contenteditable;
  20993. delete d.title
  20994. }
  20995. return c
  20996. }
  20997. }
  20998. }, {
  20999. applyToAll: !0,
  21000. priority: 5
  21001. });
  21002. g && g.addRules({
  21003. elements: {
  21004. div: function(a) {
  21005. if (a.attributes["data-cke-pagebreak"]) b(a);
  21006. else if (h.test(a.attributes.style)) {
  21007. var c = a.children[0];
  21008. c && "span" == c.name && k.test(c.attributes.style) && b(a)
  21009. }
  21010. }
  21011. }
  21012. })
  21013. }
  21014. });
  21015. CKEDITOR.plugins.pagebreakCmd = {
  21016. exec: function(a) {
  21017. var b = a.document.createElement("div", {
  21018. attributes: e(a.lang.pagebreak.alt)
  21019. });
  21020. a.insertElement(b)
  21021. },
  21022. context: "div",
  21023. allowedContent: {
  21024. div: {
  21025. styles: "!page-break-after"
  21026. },
  21027. span: {
  21028. match: function(a) {
  21029. return (a = a.parent) && "div" == a.name && a.styles && a.styles["page-break-after"]
  21030. },
  21031. styles: "display"
  21032. }
  21033. },
  21034. requiredContent: "div{page-break-after}"
  21035. }
  21036. })();
  21037. (function() {
  21038. var f = {
  21039. canUndo: !1,
  21040. async: !0,
  21041. exec: function(a, b) {
  21042. var c = a.lang,
  21043. e = CKEDITOR.tools.keystrokeToString(c.common.keyboard, a.getCommandKeystroke(CKEDITOR.env.ie ? a.commands.paste : this)),
  21044. d = b && "undefined" !== typeof b.notification ? b.notification : !b || !b.from || "keystrokeHandler" === b.from && CKEDITOR.env.ie,
  21045. c = d && "string" === typeof d ? d : c.pastetext.pasteNotification.replace(/%1/, '\x3ckbd aria-label\x3d"' + e.aria + '"\x3e' + e.display + "\x3c/kbd\x3e");
  21046. a.execCommand("paste", {
  21047. type: "text",
  21048. notification: d ? c : !1
  21049. })
  21050. }
  21051. };
  21052. CKEDITOR.plugins.add("pastetext", {
  21053. requires: "clipboard",
  21054. init: function(a) {
  21055. var b = CKEDITOR.env.safari ? CKEDITOR.CTRL + CKEDITOR.ALT + CKEDITOR.SHIFT + 86 : CKEDITOR.CTRL + CKEDITOR.SHIFT + 86;
  21056. a.addCommand("pastetext", f);
  21057. a.setKeystroke(b, "pastetext");
  21058. CKEDITOR.plugins.clipboard.addPasteButton(a, "PasteText", {
  21059. label: a.lang.pastetext.button,
  21060. command: "pastetext",
  21061. toolbar: "clipboard,40"
  21062. });
  21063. if (a.config.forcePasteAsPlainText) a.on("beforePaste", function(a) {
  21064. "html" != a.data.type && (a.data.type = "text")
  21065. });
  21066. a.on("pasteState", function(b) {
  21067. a.getCommand("pastetext").setState(b.data)
  21068. })
  21069. }
  21070. })
  21071. })();
  21072. (function() {
  21073. function l(a, f, e) {
  21074. var h = CKEDITOR.cleanWord;
  21075. h ? e() : (a = CKEDITOR.getUrl(a.config.pasteFromWordCleanupFile || f + "filter/default.js"), CKEDITOR.scriptLoader.load(a, e, null, !0));
  21076. return !h
  21077. }
  21078. CKEDITOR.plugins.add("pastefromword", {
  21079. requires: "clipboard",
  21080. init: function(a) {
  21081. function f(a) {
  21082. var b = CKEDITOR.plugins.pastefromword && CKEDITOR.plugins.pastefromword.images,
  21083. c, d = [];
  21084. if (b && a.editor.filter.check("img[src]") && (c = b.extractTagsFromHtml(a.data.dataValue), 0 !== c.length && (b = b.extractFromRtf(a.data.dataTransfer["text/rtf"]),
  21085. 0 !== b.length && (CKEDITOR.tools.array.forEach(b, function(a) {
  21086. d.push(a.type ? "data:" + a.type + ";base64," + CKEDITOR.tools.convertBytesToBase64(CKEDITOR.tools.convertHexStringToBytes(a.hex)) : null)
  21087. }, this), c.length === d.length))))
  21088. for (b = 0; b < c.length; b++) 0 === c[b].indexOf("file://") && d[b] && (a.data.dataValue = a.data.dataValue.replace(c[b], d[b]))
  21089. }
  21090. var e = 0,
  21091. h = this.path,
  21092. m = void 0 === a.config.pasteFromWord_inlineImages ? !0 : a.config.pasteFromWord_inlineImages;
  21093. a.addCommand("pastefromword", {
  21094. canUndo: !1,
  21095. async: !0,
  21096. exec: function(a,
  21097. b) {
  21098. e = 1;
  21099. a.execCommand("paste", {
  21100. type: "html",
  21101. notification: b && "undefined" !== typeof b.notification ? b.notification : !0
  21102. })
  21103. }
  21104. });
  21105. CKEDITOR.plugins.clipboard.addPasteButton(a, "PasteFromWord", {
  21106. label: a.lang.pastefromword.toolbar,
  21107. command: "pastefromword",
  21108. toolbar: "clipboard,50"
  21109. });
  21110. a.on("paste", function(f) {
  21111. var b = f.data,
  21112. c = CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ? b.dataTransfer.getData("text/html", !0) : null,
  21113. d = CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ? b.dataTransfer.getData("text/rtf") : null,
  21114. c = c ||
  21115. b.dataValue,
  21116. g = {
  21117. dataValue: c,
  21118. dataTransfer: {
  21119. "text/rtf": d
  21120. }
  21121. },
  21122. d = /(class=\"?Mso|style=(?:\"|\')[^\"]*?\bmso\-|w:WordDocument|<o:\w+>|<\/font>)/,
  21123. d = /<meta\s*name=(?:\"|\')?generator(?:\"|\')?\s*content=(?:\"|\')?microsoft/gi.test(c) || d.test(c);
  21124. if (c && (e || d) && (!1 !== a.fire("pasteFromWord", g) || e)) {
  21125. b.dontFilter = !0;
  21126. var k = l(a, h, function() {
  21127. if (k) a.fire("paste", b);
  21128. else if (!a.config.pasteFromWordPromptCleanup || e || confirm(a.lang.pastefromword.confirmCleanup)) g.dataValue = CKEDITOR.cleanWord(g.dataValue, a), a.fire("afterPasteFromWord",
  21129. g), b.dataValue = g.dataValue, !0 === a.config.forcePasteAsPlainText ? b.type = "text" : CKEDITOR.plugins.clipboard.isCustomCopyCutSupported || "allow-word" !== a.config.forcePasteAsPlainText || (b.type = "html");
  21130. e = 0
  21131. });
  21132. k && f.cancel()
  21133. }
  21134. }, null, null, 3);
  21135. if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported && m) a.on("afterPasteFromWord", f)
  21136. }
  21137. })
  21138. })();
  21139. (function() {
  21140. var h, k = {
  21141. modes: {
  21142. wysiwyg: 1,
  21143. source: 1
  21144. },
  21145. canUndo: !1,
  21146. readOnly: 1,
  21147. exec: function(a) {
  21148. var g, b = a.config,
  21149. f = b.baseHref ? '\x3cbase href\x3d"' + b.baseHref + '"/\x3e' : "";
  21150. if (b.fullPage) g = a.getData().replace(/<head>/, "$\x26" + f).replace(/[^>]*(?=<\/title>)/, "$\x26 \x26mdash; " + a.lang.preview.preview);
  21151. else {
  21152. var b = "\x3cbody ",
  21153. d = a.document && a.document.getBody();
  21154. d && (d.getAttribute("id") && (b += 'id\x3d"' + d.getAttribute("id") + '" '), d.getAttribute("class") && (b += 'class\x3d"' + d.getAttribute("class") + '" '));
  21155. b += "\x3e";
  21156. g = a.config.docType +
  21157. '\x3chtml dir\x3d"' + a.config.contentsLangDirection + '"\x3e\x3chead\x3e' + f + "\x3ctitle\x3e" + a.lang.preview.preview + "\x3c/title\x3e" + CKEDITOR.tools.buildStyleHtml(a.config.contentsCss) + "\x3c/head\x3e" + b + a.getData() + "\x3c/body\x3e\x3c/html\x3e"
  21158. }
  21159. f = 640;
  21160. b = 420;
  21161. d = 80;
  21162. try {
  21163. var c = window.screen,
  21164. f = Math.round(.8 * c.width),
  21165. b = Math.round(.7 * c.height),
  21166. d = Math.round(.1 * c.width)
  21167. } catch (k) {}
  21168. if (!1 === a.fire("contentPreview", a = {
  21169. dataValue: g
  21170. })) return !1;
  21171. var c = "",
  21172. e;
  21173. CKEDITOR.env.ie && (window._cke_htmlToLoad = a.dataValue, e = "javascript:void( (function(){document.open();" +
  21174. ("(" + CKEDITOR.tools.fixDomain + ")();").replace(/\/\/.*?\n/g, "").replace(/parent\./g, "window.opener.") + "document.write( window.opener._cke_htmlToLoad );document.close();window.opener._cke_htmlToLoad \x3d null;})() )", c = "");
  21175. CKEDITOR.env.gecko && (window._cke_htmlToLoad = a.dataValue, c = CKEDITOR.getUrl(h + "preview.html"));
  21176. c = window.open(c, null, "toolbar\x3dyes,location\x3dno,status\x3dyes,menubar\x3dyes,scrollbars\x3dyes,resizable\x3dyes,width\x3d" + f + ",height\x3d" + b + ",left\x3d" + d);
  21177. CKEDITOR.env.ie && c && (c.location =
  21178. e);
  21179. CKEDITOR.env.ie || CKEDITOR.env.gecko || (e = c.document, e.open(), e.write(a.dataValue), e.close());
  21180. return !0
  21181. }
  21182. };
  21183. CKEDITOR.plugins.add("preview", {
  21184. init: function(a) {
  21185. a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE && (h = this.path, a.addCommand("preview", k), a.ui.addButton && a.ui.addButton("Preview", {
  21186. label: a.lang.preview.preview,
  21187. command: "preview",
  21188. toolbar: "document,40"
  21189. }))
  21190. }
  21191. })
  21192. })();
  21193. CKEDITOR.plugins.add("print", {
  21194. init: function(a) {
  21195. a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE && (a.addCommand("print", CKEDITOR.plugins.print), a.ui.addButton && a.ui.addButton("Print", {
  21196. label: a.lang.print.toolbar,
  21197. command: "print",
  21198. toolbar: "document,50"
  21199. }))
  21200. }
  21201. });
  21202. CKEDITOR.plugins.print = {
  21203. exec: function(a) {
  21204. CKEDITOR.env.gecko ? a.window.$.print() : a.document.$.execCommand("Print")
  21205. },
  21206. canUndo: !1,
  21207. readOnly: 1,
  21208. modes: {
  21209. wysiwyg: 1
  21210. }
  21211. };
  21212. CKEDITOR.plugins.add("removeformat", {
  21213. init: function(a) {
  21214. a.addCommand("removeFormat", CKEDITOR.plugins.removeformat.commands.removeformat);
  21215. a.ui.addButton && a.ui.addButton("RemoveFormat", {
  21216. label: a.lang.removeformat.toolbar,
  21217. command: "removeFormat",
  21218. toolbar: "cleanup,10"
  21219. })
  21220. }
  21221. });
  21222. CKEDITOR.plugins.removeformat = {
  21223. commands: {
  21224. removeformat: {
  21225. exec: function(a) {
  21226. for (var h = a._.removeFormatRegex || (a._.removeFormatRegex = new RegExp("^(?:" + a.config.removeFormatTags.replace(/,/g, "|") + ")$", "i")), e = a._.removeAttributes || (a._.removeAttributes = a.config.removeFormatAttributes.split(",")), f = CKEDITOR.plugins.removeformat.filter, m = a.getSelection().getRanges(), n = m.createIterator(), p = function(a) {
  21227. return a.type == CKEDITOR.NODE_ELEMENT
  21228. }, c; c = n.getNextRange();) {
  21229. c.collapsed || c.enlarge(CKEDITOR.ENLARGE_ELEMENT);
  21230. var l = c.createBookmark(),
  21231. b = l.startNode,
  21232. d = l.endNode,
  21233. k = function(b) {
  21234. for (var c = a.elementPath(b), e = c.elements, d = 1, g;
  21235. (g = e[d]) && !g.equals(c.block) && !g.equals(c.blockLimit); d++) h.test(g.getName()) && f(a, g) && b.breakParent(g)
  21236. };
  21237. k(b);
  21238. if (d)
  21239. for (k(d), b = b.getNextSourceNode(!0, CKEDITOR.NODE_ELEMENT); b && !b.equals(d);)
  21240. if (b.isReadOnly()) {
  21241. if (b.getPosition(d) & CKEDITOR.POSITION_CONTAINS) break;
  21242. b = b.getNext(p)
  21243. } else k = b.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT), "img" == b.getName() && b.data("cke-realelement") || !f(a, b) || (h.test(b.getName()) ?
  21244. b.remove(1) : (b.removeAttributes(e), a.fire("removeFormatCleanup", b))), b = k;
  21245. c.moveToBookmark(l)
  21246. }
  21247. a.forceNextSelectionCheck();
  21248. a.getSelection().selectRanges(m)
  21249. }
  21250. }
  21251. },
  21252. filter: function(a, h) {
  21253. for (var e = a._.removeFormatFilters || [], f = 0; f < e.length; f++)
  21254. if (!1 === e[f](h)) return !1;
  21255. return !0
  21256. }
  21257. };
  21258. CKEDITOR.editor.prototype.addRemoveFormatFilter = function(a) {
  21259. this._.removeFormatFilters || (this._.removeFormatFilters = []);
  21260. this._.removeFormatFilters.push(a)
  21261. };
  21262. CKEDITOR.config.removeFormatTags = "b,big,cite,code,del,dfn,em,font,i,ins,kbd,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var";
  21263. CKEDITOR.config.removeFormatAttributes = "class,style,lang,width,height,align,hspace,valign";
  21264. (function() {
  21265. var b = {
  21266. readOnly: 1,
  21267. modes: {
  21268. wysiwyg: 1,
  21269. source: 1
  21270. },
  21271. exec: function(a) {
  21272. if (a.fire("save") && (a = a.element.$.form)) try {
  21273. a.submit()
  21274. } catch (b) {
  21275. a.submit.click && a.submit.click()
  21276. }
  21277. }
  21278. };
  21279. CKEDITOR.plugins.add("save", {
  21280. init: function(a) {
  21281. a.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && (a.addCommand("save", b).startDisabled = !a.element.$.form, a.ui.addButton && a.ui.addButton("Save", {
  21282. label: a.lang.save.toolbar,
  21283. command: "save",
  21284. toolbar: "document,10"
  21285. }))
  21286. }
  21287. })
  21288. })();
  21289. (function() {
  21290. CKEDITOR.plugins.add("selectall", {
  21291. init: function(b) {
  21292. b.addCommand("selectAll", {
  21293. modes: {
  21294. wysiwyg: 1,
  21295. source: 1
  21296. },
  21297. exec: function(a) {
  21298. var b = a.editable();
  21299. if (b.is("textarea")) a = b.$, CKEDITOR.env.ie && a.createTextRange ? a.createTextRange().execCommand("SelectAll") : (a.selectionStart = 0, a.selectionEnd = a.value.length), a.focus();
  21300. else {
  21301. if (b.is("body")) a.document.$.execCommand("SelectAll", !1, null);
  21302. else {
  21303. var c = a.createRange();
  21304. c.selectNodeContents(b);
  21305. c.select()
  21306. }
  21307. a.forceNextSelectionCheck();
  21308. a.selectionChange()
  21309. }
  21310. },
  21311. canUndo: !1
  21312. });
  21313. b.ui.addButton && b.ui.addButton("SelectAll", {
  21314. label: b.lang.selectall.toolbar,
  21315. command: "selectAll",
  21316. toolbar: "selection,10"
  21317. })
  21318. }
  21319. })
  21320. })();
  21321. (function() {
  21322. var k = {
  21323. readOnly: 1,
  21324. preserveState: !0,
  21325. editorFocus: !1,
  21326. exec: function(a) {
  21327. this.toggleState();
  21328. this.refresh(a)
  21329. },
  21330. refresh: function(a) {
  21331. if (a.document) {
  21332. var c = this.state != CKEDITOR.TRISTATE_ON || a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE && !a.focusManager.hasFocus ? "removeClass" : "attachClass";
  21333. a.editable()[c]("cke_show_blocks")
  21334. }
  21335. }
  21336. };
  21337. CKEDITOR.plugins.add("showblocks", {
  21338. onLoad: function() {
  21339. var a = "p div pre address blockquote h1 h2 h3 h4 h5 h6".split(" "),
  21340. c, b, e, f, k = CKEDITOR.getUrl(this.path),
  21341. l = !(CKEDITOR.env.ie &&
  21342. 9 > CKEDITOR.env.version),
  21343. g = l ? ":not([contenteditable\x3dfalse]):not(.cke_show_blocks_off)" : "",
  21344. d, h;
  21345. for (c = b = e = f = ""; d = a.pop();) h = a.length ? "," : "", c += ".cke_show_blocks " + d + g + h, e += ".cke_show_blocks.cke_contents_ltr " + d + g + h, f += ".cke_show_blocks.cke_contents_rtl " + d + g + h, b += ".cke_show_blocks " + d + g + "{background-image:url(" + CKEDITOR.getUrl(k + "images/block_" + d + ".png") + ")}";
  21346. CKEDITOR.addCss((c + "{background-repeat:no-repeat;border:1px dotted gray;padding-top:8px}").concat(b, e + "{background-position:top left;padding-left:8px}",
  21347. f + "{background-position:top right;padding-right:8px}"));
  21348. l || CKEDITOR.addCss(".cke_show_blocks [contenteditable\x3dfalse],.cke_show_blocks .cke_show_blocks_off{border:none;padding-top:0;background-image:none}.cke_show_blocks.cke_contents_rtl [contenteditable\x3dfalse],.cke_show_blocks.cke_contents_rtl .cke_show_blocks_off{padding-right:0}.cke_show_blocks.cke_contents_ltr [contenteditable\x3dfalse],.cke_show_blocks.cke_contents_ltr .cke_show_blocks_off{padding-left:0}")
  21349. },
  21350. init: function(a) {
  21351. function c() {
  21352. b.refresh(a)
  21353. }
  21354. if (!a.blockless) {
  21355. var b = a.addCommand("showblocks", k);
  21356. b.canUndo = !1;
  21357. a.config.startupOutlineBlocks && b.setState(CKEDITOR.TRISTATE_ON);
  21358. a.ui.addButton && a.ui.addButton("ShowBlocks", {
  21359. label: a.lang.showblocks.toolbar,
  21360. command: "showblocks",
  21361. toolbar: "tools,20"
  21362. });
  21363. a.on("mode", function() {
  21364. b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a)
  21365. });
  21366. a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE && (a.on("focus", c), a.on("blur", c));
  21367. a.on("contentDom", function() {
  21368. b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a)
  21369. })
  21370. }
  21371. }
  21372. })
  21373. })();
  21374. (function() {
  21375. var f = {
  21376. preserveState: !0,
  21377. editorFocus: !1,
  21378. readOnly: 1,
  21379. exec: function(a) {
  21380. this.toggleState();
  21381. this.refresh(a)
  21382. },
  21383. refresh: function(a) {
  21384. if (a.document) {
  21385. var b = this.state == CKEDITOR.TRISTATE_ON ? "attachClass" : "removeClass";
  21386. a.editable()[b]("cke_show_borders")
  21387. }
  21388. }
  21389. };
  21390. CKEDITOR.plugins.add("showborders", {
  21391. modes: {
  21392. wysiwyg: 1
  21393. },
  21394. onLoad: function() {
  21395. var a;
  21396. a = (CKEDITOR.env.ie6Compat ? [".%1 table.%2,", ".%1 table.%2 td, .%1 table.%2 th", "{", "border : #d3d3d3 1px dotted", "}"] : ".%1 table.%2,;.%1 table.%2 \x3e tr \x3e td, .%1 table.%2 \x3e tr \x3e th,;.%1 table.%2 \x3e tbody \x3e tr \x3e td, .%1 table.%2 \x3e tbody \x3e tr \x3e th,;.%1 table.%2 \x3e thead \x3e tr \x3e td, .%1 table.%2 \x3e thead \x3e tr \x3e th,;.%1 table.%2 \x3e tfoot \x3e tr \x3e td, .%1 table.%2 \x3e tfoot \x3e tr \x3e th;{;border : #d3d3d3 1px dotted;}".split(";")).join("").replace(/%2/g,
  21397. "cke_show_border").replace(/%1/g, "cke_show_borders ");
  21398. CKEDITOR.addCss(a)
  21399. },
  21400. init: function(a) {
  21401. var b = a.addCommand("showborders", f);
  21402. b.canUndo = !1;
  21403. !1 !== a.config.startupShowBorders && b.setState(CKEDITOR.TRISTATE_ON);
  21404. a.on("mode", function() {
  21405. b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a)
  21406. }, null, null, 100);
  21407. a.on("contentDom", function() {
  21408. b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a)
  21409. });
  21410. a.on("removeFormatCleanup", function(d) {
  21411. d = d.data;
  21412. a.getCommand("showborders").state == CKEDITOR.TRISTATE_ON && d.is("table") && (!d.hasAttribute("border") ||
  21413. 0 >= parseInt(d.getAttribute("border"), 10)) && d.addClass("cke_show_border")
  21414. })
  21415. },
  21416. afterInit: function(a) {
  21417. var b = a.dataProcessor;
  21418. a = b && b.dataFilter;
  21419. b = b && b.htmlFilter;
  21420. a && a.addRules({
  21421. elements: {
  21422. table: function(a) {
  21423. a = a.attributes;
  21424. var b = a["class"],
  21425. c = parseInt(a.border, 10);
  21426. c && !(0 >= c) || b && -1 != b.indexOf("cke_show_border") || (a["class"] = (b || "") + " cke_show_border")
  21427. }
  21428. }
  21429. });
  21430. b && b.addRules({
  21431. elements: {
  21432. table: function(a) {
  21433. a = a.attributes;
  21434. var b = a["class"];
  21435. b && (a["class"] = b.replace("cke_show_border", "").replace(/\s{2}/, " ").replace(/^\s+|\s+$/,
  21436. ""))
  21437. }
  21438. }
  21439. })
  21440. }
  21441. });
  21442. CKEDITOR.on("dialogDefinition", function(a) {
  21443. var b = a.data.name;
  21444. if ("table" == b || "tableProperties" == b)
  21445. if (a = a.data.definition, b = a.getContents("info").get("txtBorder"), b.commit = CKEDITOR.tools.override(b.commit, function(a) {
  21446. return function(b, c) {
  21447. a.apply(this, arguments);
  21448. var e = parseInt(this.getValue(), 10);
  21449. c[!e || 0 >= e ? "addClass" : "removeClass"]("cke_show_border")
  21450. }
  21451. }), a = (a = a.getContents("advanced")) && a.get("advCSSClasses")) a.setup = CKEDITOR.tools.override(a.setup, function(a) {
  21452. return function() {
  21453. a.apply(this,
  21454. arguments);
  21455. this.setValue(this.getValue().replace(/cke_show_border/, ""))
  21456. }
  21457. }), a.commit = CKEDITOR.tools.override(a.commit, function(a) {
  21458. return function(b, c) {
  21459. a.apply(this, arguments);
  21460. parseInt(c.getAttribute("border"), 10) || c.addClass("cke_show_border")
  21461. }
  21462. })
  21463. })
  21464. })();
  21465. (function() {
  21466. CKEDITOR.plugins.add("sourcearea", {
  21467. init: function(a) {
  21468. function d() {
  21469. var a = e && this.equals(CKEDITOR.document.getActive());
  21470. this.hide();
  21471. this.setStyle("height", this.getParent().$.clientHeight + "px");
  21472. this.setStyle("width", this.getParent().$.clientWidth + "px");
  21473. this.show();
  21474. a && this.focus()
  21475. }
  21476. if (a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
  21477. var f = CKEDITOR.plugins.sourcearea;
  21478. a.addMode("source", function(e) {
  21479. var b = a.ui.space("contents").getDocument().createElement("textarea");
  21480. b.setStyles(CKEDITOR.tools.extend({
  21481. width: CKEDITOR.env.ie7Compat ?
  21482. "99%" : "100%",
  21483. height: "100%",
  21484. resize: "none",
  21485. outline: "none",
  21486. "text-align": "left"
  21487. }, CKEDITOR.tools.cssVendorPrefix("tab-size", a.config.sourceAreaTabSize || 4)));
  21488. b.setAttribute("dir", "ltr");
  21489. b.addClass("cke_source").addClass("cke_reset").addClass("cke_enable_context_menu");
  21490. a.ui.space("contents").append(b);
  21491. b = a.editable(new c(a, b));
  21492. b.setData(a.getData(1));
  21493. CKEDITOR.env.ie && (b.attachListener(a, "resize", d, b), b.attachListener(CKEDITOR.document.getWindow(), "resize", d, b), CKEDITOR.tools.setTimeout(d, 0, b));
  21494. a.fire("ariaWidget",
  21495. this);
  21496. e()
  21497. });
  21498. a.addCommand("source", f.commands.source);
  21499. a.ui.addButton && a.ui.addButton("Source", {
  21500. label: a.lang.sourcearea.toolbar,
  21501. command: "source",
  21502. toolbar: "mode,10"
  21503. });
  21504. a.on("mode", function() {
  21505. a.getCommand("source").setState("source" == a.mode ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF)
  21506. });
  21507. var e = CKEDITOR.env.ie && 9 == CKEDITOR.env.version
  21508. }
  21509. }
  21510. });
  21511. var c = CKEDITOR.tools.createClass({
  21512. base: CKEDITOR.editable,
  21513. proto: {
  21514. setData: function(a) {
  21515. this.setValue(a);
  21516. this.status = "ready";
  21517. this.editor.fire("dataReady")
  21518. },
  21519. getData: function() {
  21520. return this.getValue()
  21521. },
  21522. insertHtml: function() {},
  21523. insertElement: function() {},
  21524. insertText: function() {},
  21525. setReadOnly: function(a) {
  21526. this[(a ? "set" : "remove") + "Attribute"]("readOnly", "readonly")
  21527. },
  21528. detach: function() {
  21529. c.baseProto.detach.call(this);
  21530. this.clearCustomData();
  21531. this.remove()
  21532. }
  21533. }
  21534. })
  21535. })();
  21536. CKEDITOR.plugins.sourcearea = {
  21537. commands: {
  21538. source: {
  21539. modes: {
  21540. wysiwyg: 1,
  21541. source: 1
  21542. },
  21543. editorFocus: !1,
  21544. readOnly: 1,
  21545. exec: function(c) {
  21546. "wysiwyg" == c.mode && c.fire("saveSnapshot");
  21547. c.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);
  21548. c.setMode("source" == c.mode ? "wysiwyg" : "source")
  21549. },
  21550. canUndo: !1
  21551. }
  21552. }
  21553. };
  21554. CKEDITOR.plugins.add("specialchar", {
  21555. availableLangs: {
  21556. af: 1,
  21557. ar: 1,
  21558. az: 1,
  21559. bg: 1,
  21560. ca: 1,
  21561. cs: 1,
  21562. cy: 1,
  21563. da: 1,
  21564. de: 1,
  21565. "de-ch": 1,
  21566. el: 1,
  21567. en: 1,
  21568. "en-au": 1,
  21569. "en-ca": 1,
  21570. "en-gb": 1,
  21571. eo: 1,
  21572. es: 1,
  21573. "es-mx": 1,
  21574. et: 1,
  21575. eu: 1,
  21576. fa: 1,
  21577. fi: 1,
  21578. fr: 1,
  21579. "fr-ca": 1,
  21580. gl: 1,
  21581. he: 1,
  21582. hr: 1,
  21583. hu: 1,
  21584. id: 1,
  21585. it: 1,
  21586. ja: 1,
  21587. km: 1,
  21588. ko: 1,
  21589. ku: 1,
  21590. lt: 1,
  21591. lv: 1,
  21592. nb: 1,
  21593. nl: 1,
  21594. no: 1,
  21595. oc: 1,
  21596. pl: 1,
  21597. pt: 1,
  21598. "pt-br": 1,
  21599. ro: 1,
  21600. ru: 1,
  21601. si: 1,
  21602. sk: 1,
  21603. sl: 1,
  21604. sq: 1,
  21605. sv: 1,
  21606. th: 1,
  21607. tr: 1,
  21608. tt: 1,
  21609. ug: 1,
  21610. uk: 1,
  21611. vi: 1,
  21612. zh: 1,
  21613. "zh-cn": 1
  21614. },
  21615. requires: "dialog",
  21616. init: function(a) {
  21617. var c = this;
  21618. CKEDITOR.dialog.add("specialchar", this.path + "dialogs/specialchar.js");
  21619. a.addCommand("specialchar", {
  21620. exec: function() {
  21621. var b = a.langCode,
  21622. b = c.availableLangs[b] ? b : c.availableLangs[b.replace(/-.*/, "")] ? b.replace(/-.*/, "") : "en";
  21623. CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(c.path + "dialogs/lang/" + b + ".js"), function() {
  21624. CKEDITOR.tools.extend(a.lang.specialchar, c.langEntries[b]);
  21625. a.openDialog("specialchar")
  21626. })
  21627. },
  21628. modes: {
  21629. wysiwyg: 1
  21630. },
  21631. canUndo: !1
  21632. });
  21633. a.ui.addButton && a.ui.addButton("SpecialChar", {
  21634. label: a.lang.specialchar.toolbar,
  21635. command: "specialchar",
  21636. toolbar: "insert,50"
  21637. })
  21638. }
  21639. });
  21640. CKEDITOR.config.specialChars = "! \x26quot; # $ % \x26amp; ' ( ) * + - . / 0 1 2 3 4 5 6 7 8 9 : ; \x26lt; \x3d \x26gt; ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ \x26euro; \x26lsquo; \x26rsquo; \x26ldquo; \x26rdquo; \x26ndash; \x26mdash; \x26iexcl; \x26cent; \x26pound; \x26curren; \x26yen; \x26brvbar; \x26sect; \x26uml; \x26copy; \x26ordf; \x26laquo; \x26not; \x26reg; \x26macr; \x26deg; \x26sup2; \x26sup3; \x26acute; \x26micro; \x26para; \x26middot; \x26cedil; \x26sup1; \x26ordm; \x26raquo; \x26frac14; \x26frac12; \x26frac34; \x26iquest; \x26Agrave; \x26Aacute; \x26Acirc; \x26Atilde; \x26Auml; \x26Aring; \x26AElig; \x26Ccedil; \x26Egrave; \x26Eacute; \x26Ecirc; \x26Euml; \x26Igrave; \x26Iacute; \x26Icirc; \x26Iuml; \x26ETH; \x26Ntilde; \x26Ograve; \x26Oacute; \x26Ocirc; \x26Otilde; \x26Ouml; \x26times; \x26Oslash; \x26Ugrave; \x26Uacute; \x26Ucirc; \x26Uuml; \x26Yacute; \x26THORN; \x26szlig; \x26agrave; \x26aacute; \x26acirc; \x26atilde; \x26auml; \x26aring; \x26aelig; \x26ccedil; \x26egrave; \x26eacute; \x26ecirc; \x26euml; \x26igrave; \x26iacute; \x26icirc; \x26iuml; \x26eth; \x26ntilde; \x26ograve; \x26oacute; \x26ocirc; \x26otilde; \x26ouml; \x26divide; \x26oslash; \x26ugrave; \x26uacute; \x26ucirc; \x26uuml; \x26yacute; \x26thorn; \x26yuml; \x26OElig; \x26oelig; \x26#372; \x26#374 \x26#373 \x26#375; \x26sbquo; \x26#8219; \x26bdquo; \x26hellip; \x26trade; \x26#9658; \x26bull; \x26rarr; \x26rArr; \x26hArr; \x26diams; \x26asymp;".split(" ");
  21641. CKEDITOR.plugins.add("scayt", {
  21642. requires: "menubutton,dialog",
  21643. tabToOpen: null,
  21644. dialogName: "scaytDialog",
  21645. onLoad: function(a) {
  21646. CKEDITOR.plugins.scayt.onLoadTimestamp = (new Date).getTime();
  21647. "moono-lisa" == (CKEDITOR.skinName || a.config.skin) && CKEDITOR.document.appendStyleSheet(this.path + "skins/" + CKEDITOR.skin.name + "/scayt.css");
  21648. CKEDITOR.document.appendStyleSheet(this.path + "dialogs/dialog.css")
  21649. },
  21650. init: function(a) {
  21651. var c = this,
  21652. d = CKEDITOR.plugins.scayt;
  21653. this.bindEvents(a);
  21654. this.parseConfig(a);
  21655. this.addRule(a);
  21656. CKEDITOR.dialog.add(this.dialogName,
  21657. CKEDITOR.getUrl(this.path + "dialogs/options.js"));
  21658. this.addMenuItems(a);
  21659. var b = a.lang.scayt,
  21660. e = CKEDITOR.env;
  21661. a.ui.add("Scayt", CKEDITOR.UI_MENUBUTTON, {
  21662. label: b.text_title,
  21663. title: a.plugins.wsc ? a.lang.wsc.title : b.text_title,
  21664. modes: {
  21665. wysiwyg: !(e.ie && (8 > e.version || e.quirks))
  21666. },
  21667. toolbar: "spellchecker,20",
  21668. refresh: function() {
  21669. var b = a.ui.instances.Scayt.getState();
  21670. a.scayt && (b = d.state.scayt[a.name] ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF);
  21671. a.fire("scaytButtonState", b)
  21672. },
  21673. onRender: function() {
  21674. var b = this;
  21675. a.on("scaytButtonState",
  21676. function(a) {
  21677. void 0 !== typeof a.data && b.setState(a.data)
  21678. })
  21679. },
  21680. onMenu: function() {
  21681. var b = a.scayt;
  21682. a.getMenuItem("scaytToggle").label = a.lang.scayt[b && d.state.scayt[a.name] ? "btn_disable" : "btn_enable"];
  21683. var c = {
  21684. scaytToggle: CKEDITOR.TRISTATE_OFF,
  21685. scaytOptions: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  21686. scaytLangs: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  21687. scaytDict: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  21688. scaytAbout: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  21689. WSC: a.plugins.wsc ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED
  21690. };
  21691. a.config.scayt_uiTabs[0] || delete c.scaytOptions;
  21692. a.config.scayt_uiTabs[1] || delete c.scaytLangs;
  21693. a.config.scayt_uiTabs[2] || delete c.scaytDict;
  21694. b && !CKEDITOR.plugins.scayt.isNewUdSupported(b) && (delete c.scaytDict, a.config.scayt_uiTabs[2] = 0, CKEDITOR.plugins.scayt.alarmCompatibilityMessage());
  21695. return c
  21696. }
  21697. });
  21698. a.contextMenu && a.addMenuItems && (a.contextMenu.addListener(function(b, d) {
  21699. var e = a.scayt,
  21700. l, m;
  21701. e && (m = e.getSelectionNode()) && (l = c.menuGenerator(a, m), e.showBanner("." + a.contextMenu._.definition.panel.className.split(" ").join(" .")));
  21702. return l
  21703. }), a.contextMenu._.onHide = CKEDITOR.tools.override(a.contextMenu._.onHide, function(b) {
  21704. return function() {
  21705. var d = a.scayt;
  21706. d && d.hideBanner();
  21707. return b.apply(this)
  21708. }
  21709. }))
  21710. },
  21711. addMenuItems: function(a) {
  21712. var c = this,
  21713. d = CKEDITOR.plugins.scayt;
  21714. a.addMenuGroup("scaytButton");
  21715. for (var b = a.config.scayt_contextMenuItemsOrder.split("|"), e = 0; e < b.length; e++) b[e] = "scayt_" + b[e];
  21716. if ((b = ["grayt_description", "grayt_suggest", "grayt_control"].concat(b)) && b.length)
  21717. for (e = 0; e < b.length; e++) a.addMenuGroup(b[e], e - 10);
  21718. a.addCommand("scaytToggle", {
  21719. exec: function(a) {
  21720. var b = a.scayt;
  21721. alert(d.state.scayt[a.name] );
  21722. d.state.scayt[a.name] = !d.state.scayt[a.name];
  21723. !0 === d.state.scayt[a.name] ? b || d.createScayt(a) : b && d.destroy(a)
  21724. }
  21725. });
  21726. a.addCommand("scaytAbout", {
  21727. exec: function(a) {
  21728. a.scayt.tabToOpen = "about";
  21729. d.openDialog(c.dialogName, a)
  21730. }
  21731. });
  21732. a.addCommand("scaytOptions", {
  21733. exec: function(a) {
  21734. a.scayt.tabToOpen = "options";
  21735. d.openDialog(c.dialogName, a)
  21736. }
  21737. });
  21738. a.addCommand("scaytLangs", {
  21739. exec: function(a) {
  21740. a.scayt.tabToOpen = "langs";
  21741. d.openDialog(c.dialogName, a)
  21742. }
  21743. });
  21744. a.addCommand("scaytDict", {
  21745. exec: function(a) {
  21746. a.scayt.tabToOpen =
  21747. "dictionaries";
  21748. d.openDialog(c.dialogName, a)
  21749. }
  21750. });
  21751. b = {
  21752. scaytToggle: {
  21753. label: a.lang.scayt.btn_enable,
  21754. group: "scaytButton",
  21755. command: "scaytToggle"
  21756. },
  21757. scaytAbout: {
  21758. label: a.lang.scayt.btn_about,
  21759. group: "scaytButton",
  21760. command: "scaytAbout"
  21761. },
  21762. scaytOptions: {
  21763. label: a.lang.scayt.btn_options,
  21764. group: "scaytButton",
  21765. command: "scaytOptions"
  21766. },
  21767. scaytLangs: {
  21768. label: a.lang.scayt.btn_langs,
  21769. group: "scaytButton",
  21770. command: "scaytLangs"
  21771. },
  21772. scaytDict: {
  21773. label: a.lang.scayt.btn_dictionaries,
  21774. group: "scaytButton",
  21775. command: "scaytDict"
  21776. }
  21777. };
  21778. a.plugins.wsc && (b.WSC = {
  21779. label: a.lang.wsc.toolbar,
  21780. group: "scaytButton",
  21781. onClick: function() {
  21782. var b = CKEDITOR.plugins.scayt,
  21783. d = a.scayt,
  21784. c = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.container.getText() : a.document.getBody().getText();
  21785. (c = c.replace(/\s/g, "")) ? (d && b.state.scayt[a.name] && d.setMarkupPaused && d.setMarkupPaused(!0), a.lockSelection(), a.execCommand("checkspell")) : alert("Nothing to check!")
  21786. }
  21787. });
  21788. a.addMenuItems(b)
  21789. },
  21790. bindEvents: function(a) {
  21791. var c = CKEDITOR.plugins.scayt,
  21792. d = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE,
  21793. b = function() {
  21794. c.destroy(a)
  21795. },
  21796. e = function() {
  21797. !c.state.scayt[a.name] || a.readOnly || a.scayt || c.createScayt(a)
  21798. },
  21799. f = function() {
  21800. var b = a.editable();
  21801. b.attachListener(b, "focus", function(b) {
  21802. CKEDITOR.plugins.scayt && !a.scayt && setTimeout(e, 0);
  21803. b = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[a.name] && a.scayt;
  21804. var c, k;
  21805. if ((d || b) && a._.savedSelection) {
  21806. b = a._.savedSelection.getSelectedElement();
  21807. b = !b && a._.savedSelection.getRanges();
  21808. for (var h = 0; h < b.length; h++) k = b[h], "string" === typeof k.startContainer.$.nodeValue && (c = k.startContainer.getText().length,
  21809. (c < k.startOffset || c < k.endOffset) && a.unlockSelection(!1))
  21810. }
  21811. }, this, null, -10)
  21812. },
  21813. g = function() {
  21814. d ? a.config.scayt_inlineModeImmediateMarkup ? e() : (a.on("blur", function() {
  21815. setTimeout(b, 0)
  21816. }), a.on("focus", e), a.focusManager.hasFocus && e()) : e();
  21817. f();
  21818. var c = a.editable();
  21819. c.attachListener(c, "mousedown", function(b) {
  21820. b = b.data.getTarget();
  21821. var d = a.widgets && a.widgets.getByElement(b);
  21822. d && (d.wrapper = b.getAscendant(function(a) {
  21823. return a.hasAttribute("data-cke-widget-wrapper")
  21824. }, !0))
  21825. }, this, null, -10)
  21826. };
  21827. a.on("contentDom", g);
  21828. a.on("beforeCommandExec",
  21829. function(b) {
  21830. var d = a.scayt,
  21831. e = !1,
  21832. f = !1,
  21833. h = !0;
  21834. b.data.name in c.options.disablingCommandExec && "wysiwyg" == a.mode ? d && (c.destroy(a), a.fire("scaytButtonState", CKEDITOR.TRISTATE_DISABLED)) : "bold" !== b.data.name && "italic" !== b.data.name && "underline" !== b.data.name && "strike" !== b.data.name && "subscript" !== b.data.name && "superscript" !== b.data.name && "enter" !== b.data.name && "cut" !== b.data.name && "language" !== b.data.name || !d || ("cut" === b.data.name && (h = !1, f = !0), "language" === b.data.name && (f = e = !0), a.fire("reloadMarkupScayt", {
  21835. removeOptions: {
  21836. removeInside: h,
  21837. forceBookmark: f,
  21838. language: e
  21839. },
  21840. timeout: 0
  21841. }))
  21842. });
  21843. a.on("beforeSetMode", function(b) {
  21844. if ("source" == b.data) {
  21845. if (b = a.scayt) c.destroy(a), a.fire("scaytButtonState", CKEDITOR.TRISTATE_DISABLED);
  21846. a.document && a.document.getBody().removeAttribute("_jquid")
  21847. }
  21848. });
  21849. a.on("afterCommandExec", function(b) {
  21850. "wysiwyg" != a.mode || "undo" != b.data.name && "redo" != b.data.name || setTimeout(function() {
  21851. c.reloadMarkup(a.scayt)
  21852. }, 250)
  21853. });
  21854. a.on("readOnly", function(b) {
  21855. var d;
  21856. b && (d = a.scayt, !0 === b.editor.readOnly ? d && d.fire("removeMarkupInDocument", {}) : d ? c.reloadMarkup(d) : "wysiwyg" == b.editor.mode && !0 === c.state.scayt[b.editor.name] && (c.createScayt(a), b.editor.fire("scaytButtonState", CKEDITOR.TRISTATE_ON)))
  21857. });
  21858. a.on("beforeDestroy", b);
  21859. a.on("setData", function() {
  21860. b();
  21861. (a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE || a.plugins.divarea) && g()
  21862. }, this, null, 50);
  21863. a.on("reloadMarkupScayt", function(b) {
  21864. var d = b.data && b.data.removeOptions,
  21865. e = b.data && b.data.timeout,
  21866. f = b.data && b.data.language,
  21867. h = a.scayt;
  21868. h && setTimeout(function() {
  21869. f && (d.selectionNode = a.plugins.language.getCurrentLangElement(a),
  21870. d.selectionNode = d.selectionNode && d.selectionNode.$ || null);
  21871. h.removeMarkupInSelectionNode(d);
  21872. c.reloadMarkup(h)
  21873. }, e || 0)
  21874. });
  21875. a.on("insertElement", function() {
  21876. a.fire("reloadMarkupScayt", {
  21877. removeOptions: {
  21878. forceBookmark: !0
  21879. }
  21880. })
  21881. }, this, null, 50);
  21882. a.on("insertHtml", function() {
  21883. a.scayt && a.scayt.setFocused && a.scayt.setFocused(!0);
  21884. a.fire("reloadMarkupScayt")
  21885. }, this, null, 50);
  21886. a.on("insertText", function() {
  21887. a.scayt && a.scayt.setFocused && a.scayt.setFocused(!0);
  21888. a.fire("reloadMarkupScayt")
  21889. }, this, null, 50);
  21890. a.on("scaytDialogShown", function(b) {
  21891. b.data.selectPage(a.scayt.tabToOpen)
  21892. })
  21893. },
  21894. parseConfig: function(a) {
  21895. var c = CKEDITOR.plugins.scayt;
  21896. c.replaceOldOptionsNames(a.config);
  21897. "boolean" !== typeof a.config.scayt_autoStartup && (a.config.scayt_autoStartup = !1);
  21898. c.state.scayt[a.name] = a.config.scayt_autoStartup;
  21899. "boolean" !== typeof a.config.grayt_autoStartup && (a.config.grayt_autoStartup = !1);
  21900. "boolean" !== typeof a.config.scayt_inlineModeImmediateMarkup && (a.config.scayt_inlineModeImmediateMarkup = !1);
  21901. c.state.grayt[a.name] = a.config.grayt_autoStartup;
  21902. a.config.scayt_contextCommands || (a.config.scayt_contextCommands =
  21903. "ignoreall|add");
  21904. a.config.scayt_contextMenuItemsOrder || (a.config.scayt_contextMenuItemsOrder = "suggest|moresuggest|control");
  21905. a.config.scayt_sLang || (a.config.scayt_sLang = "en_US");
  21906. if (void 0 === a.config.scayt_maxSuggestions || "number" != typeof a.config.scayt_maxSuggestions || 0 > a.config.scayt_maxSuggestions) a.config.scayt_maxSuggestions = 3;
  21907. if (void 0 === a.config.scayt_minWordLength || "number" != typeof a.config.scayt_minWordLength || 1 > a.config.scayt_minWordLength) a.config.scayt_minWordLength = 3;
  21908. if (void 0 === a.config.scayt_customDictionaryIds ||
  21909. "string" !== typeof a.config.scayt_customDictionaryIds) a.config.scayt_customDictionaryIds = "";
  21910. if (void 0 === a.config.scayt_userDictionaryName || "string" !== typeof a.config.scayt_userDictionaryName) a.config.scayt_userDictionaryName = null;
  21911. if ("string" === typeof a.config.scayt_uiTabs && 3 === a.config.scayt_uiTabs.split(",").length) {
  21912. var d = [],
  21913. b = [];
  21914. a.config.scayt_uiTabs = a.config.scayt_uiTabs.split(",");
  21915. CKEDITOR.tools.search(a.config.scayt_uiTabs, function(a) {
  21916. 1 === Number(a) || 0 === Number(a) ? (b.push(!0), d.push(Number(a))) :
  21917. b.push(!1)
  21918. });
  21919. null === CKEDITOR.tools.search(b, !1) ? a.config.scayt_uiTabs = d : a.config.scayt_uiTabs = [1, 1, 1]
  21920. } else a.config.scayt_uiTabs = [1, 1, 1];
  21921. "string" != typeof a.config.scayt_serviceProtocol && (a.config.scayt_serviceProtocol = null);
  21922. "string" != typeof a.config.scayt_serviceHost && (a.config.scayt_serviceHost = null);
  21923. "string" != typeof a.config.scayt_servicePort && (a.config.scayt_servicePort = null);
  21924. "string" != typeof a.config.scayt_servicePath && (a.config.scayt_servicePath = null);
  21925. a.config.scayt_moreSuggestions || (a.config.scayt_moreSuggestions =
  21926. "on");
  21927. "string" !== typeof a.config.scayt_customerId && (a.config.scayt_customerId = "1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2");
  21928. "string" !== typeof a.config.scayt_customPunctuation && (a.config.scayt_customPunctuation = "-");
  21929. "string" !== typeof a.config.scayt_srcUrl && (c = document.location.protocol, c = -1 != c.search(/https?:/) ? c : "http:", a.config.scayt_srcUrl = c + "//svc.webspellchecker.net/spellcheck31/wscbundle/wscbundle.js");
  21930. "boolean" !== typeof CKEDITOR.config.scayt_handleCheckDirty && (CKEDITOR.config.scayt_handleCheckDirty = !0);
  21931. "boolean" !== typeof CKEDITOR.config.scayt_handleUndoRedo && (CKEDITOR.config.scayt_handleUndoRedo = !0);
  21932. CKEDITOR.config.scayt_handleUndoRedo = CKEDITOR.plugins.undo ? CKEDITOR.config.scayt_handleUndoRedo : !1;
  21933. "boolean" !== typeof a.config.scayt_multiLanguageMode && (a.config.scayt_multiLanguageMode = !1);
  21934. "object" !== typeof a.config.scayt_multiLanguageStyles && (a.config.scayt_multiLanguageStyles = {});
  21935. a.config.scayt_ignoreAllCapsWords && "boolean" !== typeof a.config.scayt_ignoreAllCapsWords && (a.config.scayt_ignoreAllCapsWords = !1);
  21936. a.config.scayt_ignoreDomainNames && "boolean" !== typeof a.config.scayt_ignoreDomainNames && (a.config.scayt_ignoreDomainNames = !1);
  21937. a.config.scayt_ignoreWordsWithMixedCases && "boolean" !== typeof a.config.scayt_ignoreWordsWithMixedCases && (a.config.scayt_ignoreWordsWithMixedCases = !1);
  21938. a.config.scayt_ignoreWordsWithNumbers && "boolean" !== typeof a.config.scayt_ignoreWordsWithNumbers && (a.config.scayt_ignoreWordsWithNumbers = !1);
  21939. if (a.config.scayt_disableOptionsStorage) {
  21940. var c = CKEDITOR.tools.isArray(a.config.scayt_disableOptionsStorage) ?
  21941. a.config.scayt_disableOptionsStorage : "string" === typeof a.config.scayt_disableOptionsStorage ? [a.config.scayt_disableOptionsStorage] : void 0,
  21942. e = "all options lang ignore-all-caps-words ignore-domain-names ignore-words-with-mixed-cases ignore-words-with-numbers".split(" "),
  21943. f = ["lang", "ignore-all-caps-words", "ignore-domain-names", "ignore-words-with-mixed-cases", "ignore-words-with-numbers"],
  21944. g = CKEDITOR.tools.search,
  21945. k = CKEDITOR.tools.indexOf;
  21946. a.config.scayt_disableOptionsStorage = function(a) {
  21947. for (var b = [], d = 0; d <
  21948. a.length; d++) {
  21949. var c = a[d],
  21950. p = !!g(a, "options");
  21951. if (!g(e, c) || p && g(f, function(a) {
  21952. if ("lang" === a) return !1
  21953. })) return;
  21954. g(f, c) && f.splice(k(f, c), 1);
  21955. if ("all" === c || p && g(a, "lang")) return [];
  21956. "options" === c && (f = ["lang"])
  21957. }
  21958. return b = b.concat(f)
  21959. }(c)
  21960. }
  21961. },
  21962. addRule: function(a) {
  21963. var c = CKEDITOR.plugins.scayt,
  21964. d = a.dataProcessor,
  21965. b = d && d.htmlFilter,
  21966. e = a._.elementsPath && a._.elementsPath.filters,
  21967. d = d && d.dataFilter,
  21968. f = a.addRemoveFormatFilter,
  21969. g = function(b) {
  21970. if (a.scayt && (b.hasAttribute(c.options.data_attribute_name) || b.hasAttribute(c.options.problem_grammar_data_attribute))) return !1
  21971. },
  21972. k = function(b) {
  21973. var d = !0;
  21974. a.scayt && (b.hasAttribute(c.options.data_attribute_name) || b.hasAttribute(c.options.problem_grammar_data_attribute)) && (d = !1);
  21975. return d
  21976. };
  21977. e && e.push(g);
  21978. d && d.addRules({
  21979. elements: {
  21980. span: function(a) {
  21981. var b = a.hasClass(c.options.misspelled_word_class) && a.attributes[c.options.data_attribute_name],
  21982. d = a.hasClass(c.options.problem_grammar_class) && a.attributes[c.options.problem_grammar_data_attribute];
  21983. c && (b || d) && delete a.name;
  21984. return a
  21985. }
  21986. }
  21987. });
  21988. b && b.addRules({
  21989. elements: {
  21990. span: function(a) {
  21991. var b = a.hasClass(c.options.misspelled_word_class) &&
  21992. a.attributes[c.options.data_attribute_name],
  21993. d = a.hasClass(c.options.problem_grammar_class) && a.attributes[c.options.problem_grammar_data_attribute];
  21994. c && (b || d) && delete a.name;
  21995. return a
  21996. }
  21997. }
  21998. });
  21999. f && f.call(a, k)
  22000. },
  22001. scaytMenuDefinition: function(a) {
  22002. var c = this,
  22003. d = CKEDITOR.plugins.scayt;
  22004. a = a.scayt;
  22005. return {
  22006. scayt: {
  22007. scayt_ignore: {
  22008. label: a.getLocal("btn_ignore"),
  22009. group: "scayt_control",
  22010. order: 1,
  22011. exec: function(a) {
  22012. a.scayt.ignoreWord()
  22013. }
  22014. },
  22015. scayt_ignoreall: {
  22016. label: a.getLocal("btn_ignoreAll"),
  22017. group: "scayt_control",
  22018. order: 2,
  22019. exec: function(a) {
  22020. a.scayt.ignoreAllWords()
  22021. }
  22022. },
  22023. scayt_add: {
  22024. label: a.getLocal("btn_addWord"),
  22025. group: "scayt_control",
  22026. order: 3,
  22027. exec: function(a) {
  22028. var d = a.scayt;
  22029. setTimeout(function() {
  22030. d.addWordToUserDictionary()
  22031. }, 10)
  22032. }
  22033. },
  22034. scayt_option: {
  22035. label: a.getLocal("btn_options"),
  22036. group: "scayt_control",
  22037. order: 4,
  22038. exec: function(a) {
  22039. a.scayt.tabToOpen = "options";
  22040. d.openDialog(c.dialogName, a)
  22041. },
  22042. verification: function(a) {
  22043. return 1 == a.config.scayt_uiTabs[0] ? !0 : !1
  22044. }
  22045. },
  22046. scayt_language: {
  22047. label: a.getLocal("btn_langs"),
  22048. group: "scayt_control",
  22049. order: 5,
  22050. exec: function(a) {
  22051. a.scayt.tabToOpen = "langs";
  22052. d.openDialog(c.dialogName,
  22053. a)
  22054. },
  22055. verification: function(a) {
  22056. return 1 == a.config.scayt_uiTabs[1] ? !0 : !1
  22057. }
  22058. },
  22059. scayt_dictionary: {
  22060. label: a.getLocal("btn_dictionaries"),
  22061. group: "scayt_control",
  22062. order: 6,
  22063. exec: function(a) {
  22064. a.scayt.tabToOpen = "dictionaries";
  22065. d.openDialog(c.dialogName, a)
  22066. },
  22067. verification: function(a) {
  22068. return 1 == a.config.scayt_uiTabs[2] ? !0 : !1
  22069. }
  22070. },
  22071. scayt_about: {
  22072. label: a.getLocal("btn_about"),
  22073. group: "scayt_control",
  22074. order: 7,
  22075. exec: function(a) {
  22076. a.scayt.tabToOpen = "about";
  22077. d.openDialog(c.dialogName, a)
  22078. }
  22079. }
  22080. },
  22081. grayt: {
  22082. grayt_problemdescription: {
  22083. label: "Grammar problem description",
  22084. group: "grayt_description",
  22085. order: 1,
  22086. state: CKEDITOR.TRISTATE_DISABLED,
  22087. exec: function(a) {}
  22088. },
  22089. grayt_ignore: {
  22090. label: a.getLocal("btn_ignore"),
  22091. group: "grayt_control",
  22092. order: 2,
  22093. exec: function(a) {
  22094. a.scayt.ignorePhrase()
  22095. }
  22096. },
  22097. grayt_ignoreall: {
  22098. label: a.getLocal("btn_ignoreAll"),
  22099. group: "grayt_control",
  22100. order: 3,
  22101. exec: function(a) {
  22102. a.scayt.ignoreAllPhrases()
  22103. }
  22104. }
  22105. }
  22106. }
  22107. },
  22108. buildSuggestionMenuItems: function(a, c, d) {
  22109. var b = {},
  22110. e = {},
  22111. f = d ? "word" : "phrase",
  22112. g = d ? "startGrammarCheck" : "startSpellCheck",
  22113. k = a.scayt;
  22114. if (0 < c.length && "no_any_suggestions" !== c[0])
  22115. if (d)
  22116. for (d =
  22117. 0; d < c.length; d++) {
  22118. var l = "scayt_suggest_" + CKEDITOR.plugins.scayt.suggestions[d].replace(" ", "_");
  22119. a.addCommand(l, this.createCommand(CKEDITOR.plugins.scayt.suggestions[d], f, g));
  22120. d < a.config.scayt_maxSuggestions ? (a.addMenuItem(l, {
  22121. label: c[d],
  22122. command: l,
  22123. group: "scayt_suggest",
  22124. order: d + 1
  22125. }), b[l] = CKEDITOR.TRISTATE_OFF) : (a.addMenuItem(l, {
  22126. label: c[d],
  22127. command: l,
  22128. group: "scayt_moresuggest",
  22129. order: d + 1
  22130. }), e[l] = CKEDITOR.TRISTATE_OFF, "on" === a.config.scayt_moreSuggestions && (a.addMenuItem("scayt_moresuggest", {
  22131. label: k.getLocal("btn_moreSuggestions"),
  22132. group: "scayt_moresuggest",
  22133. order: 10,
  22134. getItems: function() {
  22135. return e
  22136. }
  22137. }), b.scayt_moresuggest = CKEDITOR.TRISTATE_OFF))
  22138. } else
  22139. for (d = 0; d < c.length; d++) l = "grayt_suggest_" + CKEDITOR.plugins.scayt.suggestions[d].replace(" ", "_"), a.addCommand(l, this.createCommand(CKEDITOR.plugins.scayt.suggestions[d], f, g)), a.addMenuItem(l, {
  22140. label: c[d],
  22141. command: l,
  22142. group: "grayt_suggest",
  22143. order: d + 1
  22144. }), b[l] = CKEDITOR.TRISTATE_OFF;
  22145. else b.no_scayt_suggest = CKEDITOR.TRISTATE_DISABLED, a.addCommand("no_scayt_suggest", {
  22146. exec: function() {}
  22147. }), a.addMenuItem("no_scayt_suggest", {
  22148. label: k.getLocal("btn_noSuggestions") || "no_scayt_suggest",
  22149. command: "no_scayt_suggest",
  22150. group: "scayt_suggest",
  22151. order: 0
  22152. });
  22153. return b
  22154. },
  22155. menuGenerator: function(a, c) {
  22156. var d = a.scayt,
  22157. b = this.scaytMenuDefinition(a),
  22158. e = {},
  22159. f = a.config.scayt_contextCommands.split("|"),
  22160. g = c.getAttribute(d.getLangAttribute()) || d.getLang(),
  22161. k, l, m, n;
  22162. l = d.isScaytNode(c);
  22163. m = d.isGraytNode(c);
  22164. l ? (b = b.scayt, k = c.getAttribute(d.getScaytNodeAttributeName()), d.fire("getSuggestionsList", {
  22165. lang: g,
  22166. word: k
  22167. }), e = this.buildSuggestionMenuItems(a, CKEDITOR.plugins.scayt.suggestions,
  22168. l)) : m && (b = b.grayt, e = c.getAttribute(d.getGraytNodeAttributeName()), d.getGraytNodeRuleAttributeName ? (k = c.getAttribute(d.getGraytNodeRuleAttributeName()), d.getProblemDescriptionText(e, k, g)) : d.getProblemDescriptionText(e, g), n = d.getProblemDescriptionText(e, k, g), b.grayt_problemdescription && n && (n = n.replace(/([.!?])\s/g, "$1\x3cbr\x3e"), b.grayt_problemdescription.label = n), d.fire("getGrammarSuggestionsList", {
  22169. lang: g,
  22170. phrase: e,
  22171. rule: k
  22172. }), e = this.buildSuggestionMenuItems(a, CKEDITOR.plugins.scayt.suggestions, l));
  22173. if (l &&
  22174. "off" == a.config.scayt_contextCommands) return e;
  22175. for (var h in b) l && -1 == CKEDITOR.tools.indexOf(f, h.replace("scayt_", "")) && "all" != a.config.scayt_contextCommands || m && "grayt_problemdescription" !== h && -1 == CKEDITOR.tools.indexOf(f, h.replace("grayt_", "")) && "all" != a.config.scayt_contextCommands || (e[h] = "undefined" != typeof b[h].state ? b[h].state : CKEDITOR.TRISTATE_OFF, "function" !== typeof b[h].verification || b[h].verification(a) || delete e[h], a.addCommand(h, {
  22176. exec: b[h].exec
  22177. }), a.addMenuItem(h, {
  22178. label: a.lang.scayt[b[h].label] ||
  22179. b[h].label,
  22180. command: h,
  22181. group: b[h].group,
  22182. order: b[h].order
  22183. }));
  22184. return e
  22185. },
  22186. createCommand: function(a, c, d) {
  22187. return {
  22188. exec: function(b) {
  22189. b = b.scayt;
  22190. var e = {};
  22191. e[c] = a;
  22192. b.replaceSelectionNode(e);
  22193. "startGrammarCheck" === d && b.removeMarkupInSelectionNode({
  22194. grammarOnly: !0
  22195. });
  22196. b.fire(d)
  22197. }
  22198. }
  22199. }
  22200. });
  22201. CKEDITOR.plugins.scayt = {
  22202. charsToObserve: [{
  22203. charName: "cke-fillingChar",
  22204. charCode: function() {
  22205. var a = CKEDITOR.version.match(/^\d(\.\d*)*/),
  22206. a = a && a[0],
  22207. c;
  22208. if (a) {
  22209. c = "4.5.7";
  22210. var d, a = a.replace(/\./g, "");
  22211. c = c.replace(/\./g, "");
  22212. d = a.length - c.length;
  22213. d = 0 <= d ? d : 0;
  22214. c = parseInt(a) >= parseInt(c) * Math.pow(10, d)
  22215. }
  22216. return c ? Array(7).join(String.fromCharCode(8203)) : String.fromCharCode(8203)
  22217. }()
  22218. }],
  22219. onLoadTimestamp: "",
  22220. state: {
  22221. scayt: {},
  22222. grayt: {}
  22223. },
  22224. warningCounter: 0,
  22225. suggestions: [],
  22226. options: {
  22227. disablingCommandExec: {
  22228. source: !0,
  22229. newpage: !0,
  22230. templates: !0
  22231. },
  22232. data_attribute_name: "data-scayt-word",
  22233. misspelled_word_class: "scayt-misspell-word",
  22234. problem_grammar_data_attribute: "data-grayt-phrase",
  22235. problem_grammar_class: "gramm-problem"
  22236. },
  22237. backCompatibilityMap: {
  22238. scayt_service_protocol: "scayt_serviceProtocol",
  22239. scayt_service_host: "scayt_serviceHost",
  22240. scayt_service_port: "scayt_servicePort",
  22241. scayt_service_path: "scayt_servicePath",
  22242. scayt_customerid: "scayt_customerId"
  22243. },
  22244. openDialog: function(a, c) {
  22245. var d = c.scayt;
  22246. d.isAllModulesReady && !1 === d.isAllModulesReady() || (c.lockSelection(),
  22247. c.openDialog(a))
  22248. },
  22249. alarmCompatibilityMessage: function() {
  22250. 5 > this.warningCounter && (console.warn("You are using the latest version of SCAYT plugin for CKEditor with the old application version. In order to have access to the newest features, it is recommended to upgrade the application version to latest one as well. Contact us for more details at support@webspellchecker.net."), this.warningCounter += 1)
  22251. },
  22252. isNewUdSupported: function(a) {
  22253. return a.getUserDictionary ? !0 : !1
  22254. },
  22255. reloadMarkup: function(a) {
  22256. var c;
  22257. a && (c = a.getScaytLangList(),
  22258. a.reloadMarkup ? a.reloadMarkup() : (this.alarmCompatibilityMessage(), c && c.ltr && c.rtl && a.fire("startSpellCheck, startGrammarCheck")))
  22259. },
  22260. replaceOldOptionsNames: function(a) {
  22261. for (var c in a) c in this.backCompatibilityMap && (a[this.backCompatibilityMap[c]] = a[c], delete a[c])
  22262. },
  22263. createScayt: function(a) {
  22264. var c = this,
  22265. d = CKEDITOR.plugins.scayt;
  22266. this.loadScaytLibrary(a, function(a) {
  22267. function e(a) {
  22268. return new SCAYT.CKSCAYT(a, function() {}, function() {})
  22269. }
  22270. var f;
  22271. a.window && (f = "BODY" == a.editable().$.nodeName ? a.window.getFrame() : a.editable());
  22272. if (f) {
  22273. f = {
  22274. lang: a.config.scayt_sLang,
  22275. container: f.$,
  22276. customDictionary: a.config.scayt_customDictionaryIds,
  22277. userDictionaryName: a.config.scayt_userDictionaryName,
  22278. localization: a.langCode,
  22279. customer_id: a.config.scayt_customerId,
  22280. customPunctuation: a.config.scayt_customPunctuation,
  22281. debug: a.config.scayt_debug,
  22282. data_attribute_name: c.options.data_attribute_name,
  22283. misspelled_word_class: c.options.misspelled_word_class,
  22284. problem_grammar_data_attribute: c.options.problem_grammar_data_attribute,
  22285. problem_grammar_class: c.options.problem_grammar_class,
  22286. "options-to-restore": a.config.scayt_disableOptionsStorage,
  22287. focused: a.editable().hasFocus,
  22288. ignoreElementsRegex: a.config.scayt_elementsToIgnore,
  22289. ignoreGraytElementsRegex: a.config.grayt_elementsToIgnore,
  22290. minWordLength: a.config.scayt_minWordLength,
  22291. multiLanguageMode: a.config.scayt_multiLanguageMode,
  22292. multiLanguageStyles: a.config.scayt_multiLanguageStyles,
  22293. graytAutoStartup: a.config.grayt_autoStartup,
  22294. charsToObserve: d.charsToObserve
  22295. };
  22296. a.config.scayt_serviceProtocol && (f.service_protocol = a.config.scayt_serviceProtocol);
  22297. a.config.scayt_serviceHost && (f.service_host = a.config.scayt_serviceHost);
  22298. a.config.scayt_servicePort && (f.service_port = a.config.scayt_servicePort);
  22299. a.config.scayt_servicePath && (f.service_path = a.config.scayt_servicePath);
  22300. "boolean" === typeof a.config.scayt_ignoreAllCapsWords && (f["ignore-all-caps-words"] = a.config.scayt_ignoreAllCapsWords);
  22301. "boolean" === typeof a.config.scayt_ignoreDomainNames && (f["ignore-domain-names"] = a.config.scayt_ignoreDomainNames);
  22302. "boolean" === typeof a.config.scayt_ignoreWordsWithMixedCases &&
  22303. (f["ignore-words-with-mixed-cases"] = a.config.scayt_ignoreWordsWithMixedCases);
  22304. "boolean" === typeof a.config.scayt_ignoreWordsWithNumbers && (f["ignore-words-with-numbers"] = a.config.scayt_ignoreWordsWithNumbers);
  22305. var g;
  22306. try {
  22307. g = e(f)
  22308. } catch (k) {
  22309. c.alarmCompatibilityMessage(), delete f.charsToObserve, g = e(f)
  22310. }
  22311. g.subscribe("suggestionListSend", function(a) {
  22312. for (var b = {}, d = [], c = 0; c < a.suggestionList.length; c++) b["word_" + a.suggestionList[c]] || (b["word_" + a.suggestionList[c]] = a.suggestionList[c], d.push(a.suggestionList[c]));
  22313. CKEDITOR.plugins.scayt.suggestions = d
  22314. });
  22315. g.subscribe("selectionIsChanged", function(d) {
  22316. a.getSelection().isLocked && "restoreSelection" !== d.action && a.lockSelection();
  22317. "restoreSelection" === d.action && a.selectionChange(!0)
  22318. });
  22319. g.subscribe("graytStateChanged", function(c) {
  22320. d.state.grayt[a.name] = c.state
  22321. });
  22322. g.addMarkupHandler && g.addMarkupHandler(function(d) {
  22323. var c = a.editable(),
  22324. e = c.getCustomData(d.charName);
  22325. e && (e.$ = d.node, c.setCustomData(d.charName, e))
  22326. });
  22327. a.scayt = g;
  22328. a.fire("scaytButtonState", a.readOnly ? CKEDITOR.TRISTATE_DISABLED :
  22329. CKEDITOR.TRISTATE_ON)
  22330. } else d.state.scayt[a.name] = !1
  22331. })
  22332. },
  22333. destroy: function(a) {
  22334. a.scayt && a.scayt.destroy();
  22335. delete a.scayt;
  22336. a.fire("scaytButtonState", CKEDITOR.TRISTATE_OFF)
  22337. },
  22338. loadScaytLibrary: function(a, c) {
  22339. var d, b = function() {
  22340. CKEDITOR.fireOnce("scaytReady");
  22341. a.scayt || "function" === typeof c && c(a)
  22342. };
  22343. "undefined" === typeof window.SCAYT || "function" !== typeof window.SCAYT.CKSCAYT ? (d = a.config.scayt_srcUrl + "?" + this.onLoadTimestamp, CKEDITOR.scriptLoader.load(d, function(a) {
  22344. a && b()
  22345. })) : window.SCAYT && "function" === typeof window.SCAYT.CKSCAYT &&
  22346. b()
  22347. }
  22348. };
  22349. CKEDITOR.on("dialogDefinition", function(a) {
  22350. var c = a.data.name;
  22351. a = a.data.definition.dialog;
  22352. "scaytDialog" !== c && "checkspell" !== c && (a.on("show", function(a) {
  22353. a = a.sender && a.sender.getParentEditor();
  22354. var b = CKEDITOR.plugins.scayt,
  22355. c = a.scayt;
  22356. c && b.state.scayt[a.name] && c.setMarkupPaused && c.setMarkupPaused(!0)
  22357. }), a.on("hide", function(a) {
  22358. a = a.sender && a.sender.getParentEditor();
  22359. var b = CKEDITOR.plugins.scayt,
  22360. c = a.scayt;
  22361. c && b.state.scayt[a.name] && c.setMarkupPaused && c.setMarkupPaused(!1)
  22362. }));
  22363. if ("scaytDialog" === c) a.on("cancel", function(a) {
  22364. return !1
  22365. },
  22366. this, null, -1);
  22367. if ("checkspell" === c) a.on("cancel", function(a) {
  22368. a = a.sender && a.sender.getParentEditor();
  22369. var b = CKEDITOR.plugins.scayt,
  22370. c = a.scayt;
  22371. c && b.state.scayt[a.name] && c.setMarkupPaused && c.setMarkupPaused(!1);
  22372. a.unlockSelection()
  22373. }, this, null, -2);
  22374. if ("link" === c) a.on("ok", function(a) {
  22375. var b = a.sender && a.sender.getParentEditor();
  22376. b && setTimeout(function() {
  22377. b.fire("reloadMarkupScayt", {
  22378. removeOptions: {
  22379. removeInside: !0,
  22380. forceBookmark: !0
  22381. },
  22382. timeout: 0
  22383. })
  22384. }, 0)
  22385. });
  22386. if ("replace" === c) a.on("hide", function(a) {
  22387. a = a.sender && a.sender.getParentEditor();
  22388. var b = CKEDITOR.plugins.scayt,
  22389. c = a.scayt;
  22390. a && setTimeout(function() {
  22391. c && (c.fire("removeMarkupInDocument", {}), b.reloadMarkup(c))
  22392. }, 0)
  22393. })
  22394. });
  22395. CKEDITOR.on("scaytReady", function() {
  22396. if (!0 === CKEDITOR.config.scayt_handleCheckDirty) {
  22397. var a = CKEDITOR.editor.prototype;
  22398. a.checkDirty = CKEDITOR.tools.override(a.checkDirty, function(a) {
  22399. return function() {
  22400. var b = null,
  22401. c = this.scayt;
  22402. if (CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[this.name] && this.scayt) {
  22403. if (b = "ready" == this.status) var f = c.removeMarkupFromString(this.getSnapshot()),
  22404. c = c.removeMarkupFromString(this._.previousValue),
  22405. b = b && c !== f
  22406. } else b = a.call(this);
  22407. return b
  22408. }
  22409. });
  22410. a.resetDirty = CKEDITOR.tools.override(a.resetDirty,
  22411. function(a) {
  22412. return function() {
  22413. var b = this.scayt;
  22414. CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[this.name] && this.scayt ? this._.previousValue = b.removeMarkupFromString(this.getSnapshot()) : a.call(this)
  22415. }
  22416. })
  22417. }
  22418. if (!0 === CKEDITOR.config.scayt_handleUndoRedo) {
  22419. var a = CKEDITOR.plugins.undo.Image.prototype,
  22420. c = "function" == typeof a.equalsContent ? "equalsContent" : "equals";
  22421. a[c] = CKEDITOR.tools.override(a[c], function(a) {
  22422. return function(b) {
  22423. var c = b.editor.scayt,
  22424. f = this.contents,
  22425. g = b.contents,
  22426. k = null;
  22427. CKEDITOR.plugins.scayt &&
  22428. CKEDITOR.plugins.scayt.state.scayt[b.editor.name] && b.editor.scayt && (this.contents = c.removeMarkupFromString(f) || "", b.contents = c.removeMarkupFromString(g) || "");
  22429. k = a.apply(this, arguments);
  22430. this.contents = f;
  22431. b.contents = g;
  22432. return k
  22433. }
  22434. })
  22435. }
  22436. });
  22437. (function() {
  22438. CKEDITOR.plugins.add("stylescombo", {
  22439. requires: "richcombo",
  22440. init: function(c) {
  22441. var l = c.config,
  22442. g = c.lang.stylescombo,
  22443. f = {},
  22444. k = [],
  22445. m = [];
  22446. c.on("stylesSet", function(a) {
  22447. if (a = a.data.styles) {
  22448. for (var b, h, d, e = 0, n = a.length; e < n; e++)(b = a[e], c.blockless && b.element in CKEDITOR.dtd.$block || "string" == typeof b.type && !CKEDITOR.style.customHandlers[b.type] || (h = b.name, b = new CKEDITOR.style(b), c.filter.customConfig && !c.filter.check(b))) || (b._name = h, b._.enterMode = l.enterMode, b._.type = d = b.assignedTo || b.type, b._.weight =
  22449. e + 1E3 * (d == CKEDITOR.STYLE_OBJECT ? 1 : d == CKEDITOR.STYLE_BLOCK ? 2 : 3), f[h] = b, k.push(b), m.push(b));
  22450. k.sort(function(a, b) {
  22451. return a._.weight - b._.weight
  22452. })
  22453. }
  22454. });
  22455. c.ui.addRichCombo("Styles", {
  22456. label: g.label,
  22457. title: g.panelTitle,
  22458. toolbar: "styles,10",
  22459. allowedContent: m,
  22460. panel: {
  22461. css: [CKEDITOR.skin.getPath("editor")].concat(l.contentsCss),
  22462. multiSelect: !0,
  22463. attributes: {
  22464. "aria-label": g.panelTitle
  22465. }
  22466. },
  22467. init: function() {
  22468. var a, b, c, d, e, f;
  22469. e = 0;
  22470. for (f = k.length; e < f; e++) a = k[e], b = a._name, d = a._.type, d != c && (this.startGroup(g["panelTitle" + String(d)]),
  22471. c = d), this.add(b, a.type == CKEDITOR.STYLE_OBJECT ? b : a.buildPreview(), b);
  22472. this.commit()
  22473. },
  22474. onClick: function(a) {
  22475. c.focus();
  22476. c.fire("saveSnapshot");
  22477. a = f[a];
  22478. var b = c.elementPath();
  22479. if (a.group && a.removeStylesFromSameGroup(c)) c.applyStyle(a);
  22480. else c[a.checkActive(b, c) ? "removeStyle" : "applyStyle"](a);
  22481. c.fire("saveSnapshot")
  22482. },
  22483. onRender: function() {
  22484. c.on("selectionChange", function(a) {
  22485. var b = this.getValue();
  22486. a = a.data.path.elements;
  22487. for (var h = 0, d = a.length, e; h < d; h++) {
  22488. e = a[h];
  22489. for (var g in f)
  22490. if (f[g].checkElementRemovable(e, !0, c)) {
  22491. g !=
  22492. b && this.setValue(g);
  22493. return
  22494. }
  22495. }
  22496. this.setValue("")
  22497. }, this)
  22498. },
  22499. onOpen: function() {
  22500. var a = c.getSelection(),
  22501. a = a.getSelectedElement() || a.getStartElement() || c.editable(),
  22502. a = c.elementPath(a),
  22503. b = [0, 0, 0, 0];
  22504. this.showAll();
  22505. this.unmarkAll();
  22506. for (var h in f) {
  22507. var d = f[h],
  22508. e = d._.type;
  22509. d.checkApplicable(a, c, c.activeFilter) ? b[e]++ : this.hideItem(h);
  22510. d.checkActive(a, c) && this.mark(h)
  22511. }
  22512. b[CKEDITOR.STYLE_BLOCK] || this.hideGroup(g["panelTitle" + String(CKEDITOR.STYLE_BLOCK)]);
  22513. b[CKEDITOR.STYLE_INLINE] || this.hideGroup(g["panelTitle" + String(CKEDITOR.STYLE_INLINE)]);
  22514. b[CKEDITOR.STYLE_OBJECT] || this.hideGroup(g["panelTitle" + String(CKEDITOR.STYLE_OBJECT)])
  22515. },
  22516. refresh: function() {
  22517. var a = c.elementPath();
  22518. if (a) {
  22519. for (var b in f)
  22520. if (f[b].checkApplicable(a, c, c.activeFilter)) return;
  22521. this.setState(CKEDITOR.TRISTATE_DISABLED)
  22522. }
  22523. },
  22524. reset: function() {
  22525. f = {};
  22526. k = []
  22527. }
  22528. })
  22529. }
  22530. })
  22531. })();
  22532. (function() {
  22533. function k(c) {
  22534. return {
  22535. editorFocus: !1,
  22536. canUndo: !1,
  22537. modes: {
  22538. wysiwyg: 1
  22539. },
  22540. exec: function(d) {
  22541. if (d.editable().hasFocus) {
  22542. var e = d.getSelection(),
  22543. b;
  22544. if (b = (new CKEDITOR.dom.elementPath(e.getCommonAncestor(), e.root)).contains({
  22545. td: 1,
  22546. th: 1
  22547. }, 1)) {
  22548. var e = d.createRange(),
  22549. a = CKEDITOR.tools.tryThese(function() {
  22550. var a = b.getParent().$.cells[b.$.cellIndex + (c ? -1 : 1)];
  22551. a.parentNode.parentNode;
  22552. return a
  22553. }, function() {
  22554. var a = b.getParent(),
  22555. a = a.getAscendant("table").$.rows[a.$.rowIndex + (c ? -1 : 1)];
  22556. return a.cells[c ? a.cells.length - 1 :
  22557. 0]
  22558. });
  22559. if (a || c)
  22560. if (a) a = new CKEDITOR.dom.element(a), e.moveToElementEditStart(a), e.checkStartOfBlock() && e.checkEndOfBlock() || e.selectNodeContents(a);
  22561. else return !0;
  22562. else {
  22563. for (var f = b.getAscendant("table").$, a = b.getParent().$.cells, f = new CKEDITOR.dom.element(f.insertRow(-1), d.document), g = 0, h = a.length; g < h; g++) f.append((new CKEDITOR.dom.element(a[g], d.document)).clone(!1, !1)).appendBogus();
  22564. e.moveToElementEditStart(f)
  22565. }
  22566. e.select(!0);
  22567. return !0
  22568. }
  22569. }
  22570. return !1
  22571. }
  22572. }
  22573. }
  22574. var h = {
  22575. editorFocus: !1,
  22576. modes: {
  22577. wysiwyg: 1,
  22578. source: 1
  22579. }
  22580. },
  22581. g = {
  22582. exec: function(c) {
  22583. c.container.focusNext(!0,
  22584. c.tabIndex)
  22585. }
  22586. },
  22587. f = {
  22588. exec: function(c) {
  22589. c.container.focusPrevious(!0, c.tabIndex)
  22590. }
  22591. };
  22592. CKEDITOR.plugins.add("tab", {
  22593. init: function(c) {
  22594. for (var d = !1 !== c.config.enableTabKeyTools, e = c.config.tabSpaces || 0, b = ""; e--;) b += " ";
  22595. if (b) c.on("key", function(a) {
  22596. 9 == a.data.keyCode && (c.insertText(b), a.cancel())
  22597. });
  22598. if (d) c.on("key", function(a) {
  22599. (9 == a.data.keyCode && c.execCommand("selectNextCell") || a.data.keyCode == CKEDITOR.SHIFT + 9 && c.execCommand("selectPreviousCell")) && a.cancel()
  22600. });
  22601. c.addCommand("blur", CKEDITOR.tools.extend(g, h));
  22602. c.addCommand("blurBack",
  22603. CKEDITOR.tools.extend(f, h));
  22604. c.addCommand("selectNextCell", k());
  22605. c.addCommand("selectPreviousCell", k(!0))
  22606. }
  22607. })
  22608. })();
  22609. CKEDITOR.dom.element.prototype.focusNext = function(k, h) {
  22610. var g = void 0 === h ? this.getTabIndex() : h,
  22611. f, c, d, e, b, a;
  22612. if (0 >= g)
  22613. for (b = this.getNextSourceNode(k, CKEDITOR.NODE_ELEMENT); b;) {
  22614. if (b.isVisible() && 0 === b.getTabIndex()) {
  22615. d = b;
  22616. break
  22617. }
  22618. b = b.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT)
  22619. } else
  22620. for (b = this.getDocument().getBody().getFirst(); b = b.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT);) {
  22621. if (!f)
  22622. if (!c && b.equals(this)) {
  22623. if (c = !0, k) {
  22624. if (!(b = b.getNextSourceNode(!0, CKEDITOR.NODE_ELEMENT))) break;
  22625. f = 1
  22626. }
  22627. } else c && !this.contains(b) &&
  22628. (f = 1);
  22629. if (b.isVisible() && !(0 > (a = b.getTabIndex()))) {
  22630. if (f && a == g) {
  22631. d = b;
  22632. break
  22633. }
  22634. a > g && (!d || !e || a < e) ? (d = b, e = a) : d || 0 !== a || (d = b, e = a)
  22635. }
  22636. }
  22637. d && d.focus()
  22638. };
  22639. CKEDITOR.dom.element.prototype.focusPrevious = function(k, h) {
  22640. for (var g = void 0 === h ? this.getTabIndex() : h, f, c, d, e = 0, b, a = this.getDocument().getBody().getLast(); a = a.getPreviousSourceNode(!1, CKEDITOR.NODE_ELEMENT);) {
  22641. if (!f)
  22642. if (!c && a.equals(this)) {
  22643. if (c = !0, k) {
  22644. if (!(a = a.getPreviousSourceNode(!0, CKEDITOR.NODE_ELEMENT))) break;
  22645. f = 1
  22646. }
  22647. } else c && !this.contains(a) && (f = 1);
  22648. if (a.isVisible() && !(0 > (b = a.getTabIndex())))
  22649. if (0 >= g) {
  22650. if (f && 0 === b) {
  22651. d = a;
  22652. break
  22653. }
  22654. b > e && (d = a, e = b)
  22655. } else {
  22656. if (f && b == g) {
  22657. d = a;
  22658. break
  22659. }
  22660. b < g && (!d || b > e) && (d = a, e = b)
  22661. }
  22662. }
  22663. d && d.focus()
  22664. };
  22665. CKEDITOR.plugins.add("table", {
  22666. requires: "dialog",
  22667. init: function(a) {
  22668. function f(c) {
  22669. return CKEDITOR.tools.extend(c || {}, {
  22670. contextSensitive: 1,
  22671. refresh: function(c, b) {
  22672. this.setState(b.contains("table", 1) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED)
  22673. }
  22674. })
  22675. }
  22676. if (!a.blockless) {
  22677. var e = a.lang.table;
  22678. a.addCommand("table", new CKEDITOR.dialogCommand("table", {
  22679. context: "table",
  22680. allowedContent: "table{width,height}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr[scope];" + (a.plugins.dialogadvtab ?
  22681. "table" + a.plugins.dialogadvtab.allowedContent() : ""),
  22682. requiredContent: "table",
  22683. contentTransformations: [
  22684. ["table{width}: sizeToStyle", "table[width]: sizeToAttribute"],
  22685. ["td: splitBorderShorthand"],
  22686. [{
  22687. element: "table",
  22688. right: function(c) {
  22689. if (c.styles) {
  22690. var a;
  22691. if (c.styles.border) a = CKEDITOR.tools.style.parse.border(c.styles.border);
  22692. else if (CKEDITOR.env.ie && 8 === CKEDITOR.env.version) {
  22693. var b = c.styles;
  22694. b["border-left"] && b["border-left"] === b["border-right"] && b["border-right"] === b["border-top"] && b["border-top"] === b["border-bottom"] &&
  22695. (a = CKEDITOR.tools.style.parse.border(b["border-top"]))
  22696. }
  22697. a && a.style && "solid" === a.style && a.width && 0 !== parseFloat(a.width) && (c.attributes.border = 1);
  22698. "collapse" == c.styles["border-collapse"] && (c.attributes.cellspacing = 0)
  22699. }
  22700. }
  22701. }]
  22702. ]
  22703. }));
  22704. a.addCommand("tableProperties", new CKEDITOR.dialogCommand("tableProperties", f()));
  22705. a.addCommand("tableDelete", f({
  22706. exec: function(a) {
  22707. var d = a.elementPath().contains("table", 1);
  22708. if (d) {
  22709. var b = d.getParent(),
  22710. e = a.editable();
  22711. 1 != b.getChildCount() || b.is("td", "th") || b.equals(e) || (d = b);
  22712. a = a.createRange();
  22713. a.moveToPosition(d, CKEDITOR.POSITION_BEFORE_START);
  22714. d.remove();
  22715. a.select()
  22716. }
  22717. }
  22718. }));
  22719. a.ui.addButton && a.ui.addButton("Table", {
  22720. label: e.toolbar,
  22721. command: "table",
  22722. toolbar: "insert,30"
  22723. });
  22724. CKEDITOR.dialog.add("table", this.path + "dialogs/table.js");
  22725. CKEDITOR.dialog.add("tableProperties", this.path + "dialogs/table.js");
  22726. a.addMenuItems && a.addMenuItems({
  22727. table: {
  22728. label: e.menu,
  22729. command: "tableProperties",
  22730. group: "table",
  22731. order: 5
  22732. },
  22733. tabledelete: {
  22734. label: e.deleteTable,
  22735. command: "tableDelete",
  22736. group: "table",
  22737. order: 1
  22738. }
  22739. });
  22740. a.on("doubleclick", function(a) {
  22741. a.data.element.is("table") &&
  22742. (a.data.dialog = "tableProperties")
  22743. });
  22744. a.contextMenu && a.contextMenu.addListener(function() {
  22745. return {
  22746. tabledelete: CKEDITOR.TRISTATE_OFF,
  22747. table: CKEDITOR.TRISTATE_OFF
  22748. }
  22749. })
  22750. }
  22751. }
  22752. });
  22753. (function() {
  22754. function q(d, f) {
  22755. function b(a) {
  22756. return f ? f.contains(a) && a.getAscendant("table", !0).equals(f) : !0
  22757. }
  22758. function c(b) {
  22759. 0 < e.length || b.type != CKEDITOR.NODE_ELEMENT || !F.test(b.getName()) || b.getCustomData("selected_cell") || (CKEDITOR.dom.element.setMarker(a, b, "selected_cell", !0), e.push(b))
  22760. }
  22761. var e = [],
  22762. a = {};
  22763. if (!d) return e;
  22764. for (var g = d.getRanges(), k = 0; k < g.length; k++) {
  22765. var h = g[k];
  22766. if (h.collapsed)(h = h.getCommonAncestor().getAscendant({
  22767. td: 1,
  22768. th: 1
  22769. }, !0)) && b(h) && e.push(h);
  22770. else {
  22771. var h = new CKEDITOR.dom.walker(h),
  22772. l;
  22773. for (h.guard =
  22774. c; l = h.next();) l.type == CKEDITOR.NODE_ELEMENT && l.is(CKEDITOR.dtd.table) || (l = l.getAscendant({
  22775. td: 1,
  22776. th: 1
  22777. }, !0)) && !l.getCustomData("selected_cell") && b(l) && (CKEDITOR.dom.element.setMarker(a, l, "selected_cell", !0), e.push(l))
  22778. }
  22779. }
  22780. CKEDITOR.dom.element.clearAllMarkers(a);
  22781. return e
  22782. }
  22783. function r(d, f) {
  22784. for (var b = D(d) ? d : q(d), c = b[0], e = c.getAscendant("table"), c = c.getDocument(), a = b[0].getParent(), g = a.$.rowIndex, b = b[b.length - 1], k = b.getParent().$.rowIndex + b.$.rowSpan - 1, b = new CKEDITOR.dom.element(e.$.rows[k]), g = f ? g : k, a = f ? a : b,
  22785. b = CKEDITOR.tools.buildTableMap(e), e = b[g], g = f ? b[g - 1] : b[g + 1], b = b[0].length, c = c.createElement("tr"), k = 0; e[k] && k < b; k++) {
  22786. var h;
  22787. 1 < e[k].rowSpan && g && e[k] == g[k] ? (h = e[k], h.rowSpan += 1) : (h = (new CKEDITOR.dom.element(e[k])).clone(), h.removeAttribute("rowSpan"), h.appendBogus(), c.append(h), h = h.$);
  22788. k += h.colSpan - 1
  22789. }
  22790. f ? c.insertBefore(a) : c.insertAfter(a);
  22791. return c
  22792. }
  22793. function B(d) {
  22794. if (d instanceof CKEDITOR.dom.selection) {
  22795. var f = d.getRanges(),
  22796. b = q(d),
  22797. c = b[0].getAscendant("table"),
  22798. e = CKEDITOR.tools.buildTableMap(c),
  22799. a = b[0].getParent().$.rowIndex,
  22800. b = b[b.length - 1],
  22801. g = b.getParent().$.rowIndex + b.$.rowSpan - 1,
  22802. b = [];
  22803. d.reset();
  22804. for (d = a; d <= g; d++) {
  22805. for (var k = e[d], h = new CKEDITOR.dom.element(c.$.rows[d]), l = 0; l < k.length; l++) {
  22806. var m = new CKEDITOR.dom.element(k[l]),
  22807. n = m.getParent().$.rowIndex;
  22808. 1 == m.$.rowSpan ? m.remove() : (--m.$.rowSpan, n == d && (n = e[d + 1], n[l - 1] ? m.insertAfter(new CKEDITOR.dom.element(n[l - 1])) : (new CKEDITOR.dom.element(c.$.rows[d + 1])).append(m, 1)));
  22809. l += m.$.colSpan - 1
  22810. }
  22811. b.push(h)
  22812. }
  22813. e = c.$.rows;
  22814. f[0].moveToPosition(c, CKEDITOR.POSITION_BEFORE_START);
  22815. a = new CKEDITOR.dom.element(e[g +
  22816. 1] || (0 < a ? e[a - 1] : null) || c.$.parentNode);
  22817. for (d = b.length; 0 <= d; d--) B(b[d]);
  22818. return c.$.parentNode ? a : (f[0].select(), null)
  22819. }
  22820. d instanceof CKEDITOR.dom.element && (c = d.getAscendant("table"), 1 == c.$.rows.length ? c.remove() : d.remove());
  22821. return null
  22822. }
  22823. function v(d) {
  22824. for (var f = d.getParent().$.cells, b = 0, c = 0; c < f.length; c++) {
  22825. var e = f[c],
  22826. b = b + e.colSpan;
  22827. if (e == d.$) break
  22828. }
  22829. return b - 1
  22830. }
  22831. function w(d, f) {
  22832. for (var b = f ? Infinity : 0, c = 0; c < d.length; c++) {
  22833. var e = v(d[c]);
  22834. if (f ? e < b : e > b) b = e
  22835. }
  22836. return b
  22837. }
  22838. function u(d, f) {
  22839. for (var b = D(d) ? d : q(d), c = b[0].getAscendant("table"),
  22840. e = w(b, 1), b = w(b), a = f ? e : b, g = CKEDITOR.tools.buildTableMap(c), c = [], e = [], b = [], k = g.length, h = 0; h < k; h++) c.push(g[h][a]), e.push(f ? g[h][a - 1] : g[h][a + 1]);
  22841. for (h = 0; h < k; h++) c[h] && (1 < c[h].colSpan && e[h] == c[h] ? (g = c[h], g.colSpan += 1) : (a = new CKEDITOR.dom.element(c[h]), g = a.clone(), g.removeAttribute("colSpan"), g.appendBogus(), g[f ? "insertBefore" : "insertAfter"].call(g, a), b.push(g), g = g.$), h += g.rowSpan - 1);
  22842. return b
  22843. }
  22844. function y(d) {
  22845. function f(a) {
  22846. var b, c, d;
  22847. b = a.getRanges();
  22848. if (1 !== b.length) return a;
  22849. b = b[0];
  22850. if (b.collapsed || 0 !== b.endOffset) return a;
  22851. c = b.endContainer;
  22852. d = c.getName().toLowerCase();
  22853. if ("td" !== d && "th" !== d) return a;
  22854. for ((d = c.getPrevious()) || (d = c.getParent().getPrevious().getLast()); d.type !== CKEDITOR.NODE_TEXT && "br" !== d.getName().toLowerCase();)
  22855. if (d = d.getLast(), !d) return a;
  22856. b.setEndAt(d, CKEDITOR.POSITION_BEFORE_END);
  22857. return b.select()
  22858. }
  22859. CKEDITOR.env.webkit && !d.isFake && (d = f(d));
  22860. var b = d.getRanges(),
  22861. c = q(d),
  22862. e = c[0],
  22863. a = c[c.length - 1],
  22864. c = e.getAscendant("table"),
  22865. g = CKEDITOR.tools.buildTableMap(c),
  22866. k, h, l = [];
  22867. d.reset();
  22868. var m = 0;
  22869. for (d = g.length; m < d; m++)
  22870. for (var n =
  22871. 0, p = g[m].length; n < p; n++) void 0 === k && g[m][n] == e.$ && (k = n), g[m][n] == a.$ && (h = n);
  22872. for (m = k; m <= h; m++)
  22873. for (n = 0; n < g.length; n++) a = g[n], e = new CKEDITOR.dom.element(c.$.rows[n]), a = new CKEDITOR.dom.element(a[m]), a.$ && (1 == a.$.colSpan ? a.remove() : --a.$.colSpan, n += a.$.rowSpan - 1, e.$.cells.length || l.push(e));
  22874. k = g[0].length - 1 > h ? new CKEDITOR.dom.element(g[0][h + 1]) : k && -1 !== g[0][k - 1].cellIndex ? new CKEDITOR.dom.element(g[0][k - 1]) : new CKEDITOR.dom.element(c.$.parentNode);
  22875. l.length == d && (b[0].moveToPosition(c, CKEDITOR.POSITION_AFTER_END),
  22876. b[0].select(), c.remove());
  22877. return k
  22878. }
  22879. function t(d, f) {
  22880. var b = d.getStartElement().getAscendant({
  22881. td: 1,
  22882. th: 1
  22883. }, !0);
  22884. if (b) {
  22885. var c = b.clone();
  22886. c.appendBogus();
  22887. f ? c.insertBefore(b) : c.insertAfter(b)
  22888. }
  22889. }
  22890. function z(d) {
  22891. if (d instanceof CKEDITOR.dom.selection) {
  22892. var f = d.getRanges(),
  22893. b = q(d),
  22894. c = b[0] && b[0].getAscendant("table"),
  22895. e;
  22896. a: {
  22897. var a = 0;e = b.length - 1;
  22898. for (var g = {}, k, h; k = b[a++];) CKEDITOR.dom.element.setMarker(g, k, "delete_cell", !0);
  22899. for (a = 0; k = b[a++];)
  22900. if ((h = k.getPrevious()) && !h.getCustomData("delete_cell") || (h = k.getNext()) && !h.getCustomData("delete_cell")) {
  22901. CKEDITOR.dom.element.clearAllMarkers(g);
  22902. e = h;
  22903. break a
  22904. } CKEDITOR.dom.element.clearAllMarkers(g);a = b[0].getParent();
  22905. (a = a.getPrevious()) ? e = a.getLast() : (a = b[e].getParent(), e = (a = a.getNext()) ? a.getChild(0) : null)
  22906. }
  22907. d.reset();
  22908. for (d = b.length - 1; 0 <= d; d--) z(b[d]);
  22909. e ? p(e, !0) : c && (f[0].moveToPosition(c, CKEDITOR.POSITION_BEFORE_START), f[0].select(), c.remove())
  22910. } else d instanceof CKEDITOR.dom.element && (f = d.getParent(), 1 == f.getChildCount() ? f.remove() : d.remove())
  22911. }
  22912. function p(d, f) {
  22913. var b = d.getDocument(),
  22914. c = CKEDITOR.document;
  22915. CKEDITOR.env.ie && 10 == CKEDITOR.env.version &&
  22916. (c.focus(), b.focus());
  22917. b = new CKEDITOR.dom.range(b);
  22918. b["moveToElementEdit" + (f ? "End" : "Start")](d) || (b.selectNodeContents(d), b.collapse(f ? !1 : !0));
  22919. b.select(!0)
  22920. }
  22921. function A(d, f, b) {
  22922. d = d[f];
  22923. if ("undefined" == typeof b) return d;
  22924. for (f = 0; d && f < d.length; f++) {
  22925. if (b.is && d[f] == b.$) return f;
  22926. if (f == b) return new CKEDITOR.dom.element(d[f])
  22927. }
  22928. return b.is ? -1 : null
  22929. }
  22930. function x(d, f, b) {
  22931. var c = q(d),
  22932. e;
  22933. if ((f ? 1 != c.length : 2 > c.length) || (e = d.getCommonAncestor()) && e.type == CKEDITOR.NODE_ELEMENT && e.is("table")) return !1;
  22934. var a;
  22935. d = c[0];
  22936. e = d.getAscendant("table");
  22937. var g = CKEDITOR.tools.buildTableMap(e),
  22938. k = g.length,
  22939. h = g[0].length,
  22940. l = d.getParent().$.rowIndex,
  22941. m = A(g, l, d);
  22942. if (f) {
  22943. var n;
  22944. try {
  22945. var p = parseInt(d.getAttribute("rowspan"), 10) || 1;
  22946. a = parseInt(d.getAttribute("colspan"), 10) || 1;
  22947. n = g["up" == f ? l - p : "down" == f ? l + p : l]["left" == f ? m - a : "right" == f ? m + a : m]
  22948. } catch (x) {
  22949. return !1
  22950. }
  22951. if (!n || d.$ == n) return !1;
  22952. c["up" == f || "left" == f ? "unshift" : "push"](new CKEDITOR.dom.element(n))
  22953. }
  22954. f = d.getDocument();
  22955. var r = l,
  22956. p = n = 0,
  22957. u = !b && new CKEDITOR.dom.documentFragment(f),
  22958. w = 0;
  22959. for (f = 0; f < c.length; f++) {
  22960. a = c[f];
  22961. var t = a.getParent(),
  22962. y = a.getFirst(),
  22963. v = a.$.colSpan,
  22964. z = a.$.rowSpan,
  22965. t = t.$.rowIndex,
  22966. B = A(g, t, a),
  22967. w = w + v * z,
  22968. p = Math.max(p, B - m + v);
  22969. n = Math.max(n, t - l + z);
  22970. b || (v = a, (z = v.getBogus()) && z.remove(), v.trim(), a.getChildren().count() && (t == r || !y || y.isBlockBoundary && y.isBlockBoundary({
  22971. br: 1
  22972. }) || (r = u.getLast(CKEDITOR.dom.walker.whitespaces(!0)), !r || r.is && r.is("br") || u.append("br")), a.moveChildren(u)), f ? a.remove() : a.setHtml(""));
  22973. r = t
  22974. }
  22975. if (b) return n * p == w;
  22976. u.moveChildren(d);
  22977. d.appendBogus();
  22978. p >= h ? d.removeAttribute("rowSpan") : d.$.rowSpan = n;
  22979. n >= k ? d.removeAttribute("colSpan") :
  22980. d.$.colSpan = p;
  22981. b = new CKEDITOR.dom.nodeList(e.$.rows);
  22982. c = b.count();
  22983. for (f = c - 1; 0 <= f; f--) e = b.getItem(f), e.$.cells.length || (e.remove(), c++);
  22984. return d
  22985. }
  22986. function C(d, f) {
  22987. var b = q(d);
  22988. if (1 < b.length) return !1;
  22989. if (f) return !0;
  22990. var b = b[0],
  22991. c = b.getParent(),
  22992. e = c.getAscendant("table"),
  22993. a = CKEDITOR.tools.buildTableMap(e),
  22994. g = c.$.rowIndex,
  22995. k = A(a, g, b),
  22996. h = b.$.rowSpan,
  22997. l;
  22998. if (1 < h) {
  22999. l = Math.ceil(h / 2);
  23000. for (var h = Math.floor(h / 2), c = g + l, e = new CKEDITOR.dom.element(e.$.rows[c]), a = A(a, c), m, c = b.clone(), g = 0; g < a.length; g++)
  23001. if (m = a[g], m.parentNode == e.$ &&
  23002. g > k) {
  23003. c.insertBefore(new CKEDITOR.dom.element(m));
  23004. break
  23005. } else m = null;
  23006. m || e.append(c)
  23007. } else
  23008. for (h = l = 1, e = c.clone(), e.insertAfter(c), e.append(c = b.clone()), m = A(a, g), k = 0; k < m.length; k++) m[k].rowSpan++;
  23009. c.appendBogus();
  23010. b.$.rowSpan = l;
  23011. c.$.rowSpan = h;
  23012. 1 == l && b.removeAttribute("rowSpan");
  23013. 1 == h && c.removeAttribute("rowSpan");
  23014. return c
  23015. }
  23016. function E(d, f) {
  23017. var b = q(d);
  23018. if (1 < b.length) return !1;
  23019. if (f) return !0;
  23020. var b = b[0],
  23021. c = b.getParent(),
  23022. e = c.getAscendant("table"),
  23023. e = CKEDITOR.tools.buildTableMap(e),
  23024. a = A(e, c.$.rowIndex, b),
  23025. g = b.$.colSpan;
  23026. if (1 < g) c = Math.ceil(g / 2), g = Math.floor(g / 2);
  23027. else {
  23028. for (var g = c = 1, k = [], h = 0; h < e.length; h++) {
  23029. var l = e[h];
  23030. k.push(l[a]);
  23031. 1 < l[a].rowSpan && (h += l[a].rowSpan - 1)
  23032. }
  23033. for (e = 0; e < k.length; e++) k[e].colSpan++
  23034. }
  23035. e = b.clone();
  23036. e.insertAfter(b);
  23037. e.appendBogus();
  23038. b.$.colSpan = c;
  23039. e.$.colSpan = g;
  23040. 1 == c && b.removeAttribute("colSpan");
  23041. 1 == g && e.removeAttribute("colSpan");
  23042. return e
  23043. }
  23044. var F = /^(?:td|th)$/,
  23045. D = CKEDITOR.tools.isArray;
  23046. CKEDITOR.plugins.tabletools = {
  23047. requires: "table,dialog,contextmenu",
  23048. init: function(d) {
  23049. function f(a) {
  23050. return CKEDITOR.tools.extend(a || {}, {
  23051. contextSensitive: 1,
  23052. refresh: function(a, b) {
  23053. this.setState(b.contains({
  23054. td: 1,
  23055. th: 1
  23056. }, 1) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED)
  23057. }
  23058. })
  23059. }
  23060. function b(a, b) {
  23061. var c = d.addCommand(a, b);
  23062. d.addFeature(c)
  23063. }
  23064. var c = d.lang.table,
  23065. e = CKEDITOR.tools.style.parse;
  23066. b("cellProperties", new CKEDITOR.dialogCommand("cellProperties", f({
  23067. allowedContent: "td th{width,height,border-color,background-color,white-space,vertical-align,text-align}[colspan,rowspan]",
  23068. requiredContent: "table",
  23069. contentTransformations: [
  23070. [{
  23071. element: "td",
  23072. left: function(a) {
  23073. return a.styles.background &&
  23074. e.background(a.styles.background).color
  23075. },
  23076. right: function(a) {
  23077. a.styles["background-color"] = e.background(a.styles.background).color
  23078. }
  23079. }, {
  23080. element: "td",
  23081. check: "td{vertical-align}",
  23082. left: function(a) {
  23083. return a.attributes && a.attributes.valign
  23084. },
  23085. right: function(a) {
  23086. a.styles["vertical-align"] = a.attributes.valign;
  23087. delete a.attributes.valign
  23088. }
  23089. }],
  23090. [{
  23091. element: "tr",
  23092. check: "td{height}",
  23093. left: function(a) {
  23094. return a.styles && a.styles.height
  23095. },
  23096. right: function(a) {
  23097. CKEDITOR.tools.array.forEach(a.children, function(b) {
  23098. b.name in {
  23099. td: 1,
  23100. th: 1
  23101. } &&
  23102. (b.attributes["cke-row-height"] = a.styles.height)
  23103. });
  23104. delete a.styles.height
  23105. }
  23106. }],
  23107. [{
  23108. element: "td",
  23109. check: "td{height}",
  23110. left: function(a) {
  23111. return (a = a.attributes) && a["cke-row-height"]
  23112. },
  23113. right: function(a) {
  23114. a.styles.height = a.attributes["cke-row-height"];
  23115. delete a.attributes["cke-row-height"]
  23116. }
  23117. }]
  23118. ]
  23119. })));
  23120. CKEDITOR.dialog.add("cellProperties", this.path + "dialogs/tableCell.js");
  23121. b("rowDelete", f({
  23122. requiredContent: "table",
  23123. exec: function(a) {
  23124. a = a.getSelection();
  23125. (a = B(a)) && p(a)
  23126. }
  23127. }));
  23128. b("rowInsertBefore", f({
  23129. requiredContent: "table",
  23130. exec: function(a) {
  23131. a =
  23132. a.getSelection();
  23133. a = q(a);
  23134. r(a, !0)
  23135. }
  23136. }));
  23137. b("rowInsertAfter", f({
  23138. requiredContent: "table",
  23139. exec: function(a) {
  23140. a = a.getSelection();
  23141. a = q(a);
  23142. r(a)
  23143. }
  23144. }));
  23145. b("columnDelete", f({
  23146. requiredContent: "table",
  23147. exec: function(a) {
  23148. a = a.getSelection();
  23149. (a = y(a)) && p(a, !0)
  23150. }
  23151. }));
  23152. b("columnInsertBefore", f({
  23153. requiredContent: "table",
  23154. exec: function(a) {
  23155. a = a.getSelection();
  23156. a = q(a);
  23157. u(a, !0)
  23158. }
  23159. }));
  23160. b("columnInsertAfter", f({
  23161. requiredContent: "table",
  23162. exec: function(a) {
  23163. a = a.getSelection();
  23164. a = q(a);
  23165. u(a)
  23166. }
  23167. }));
  23168. b("cellDelete", f({
  23169. requiredContent: "table",
  23170. exec: function(a) {
  23171. a =
  23172. a.getSelection();
  23173. z(a)
  23174. }
  23175. }));
  23176. b("cellMerge", f({
  23177. allowedContent: "td[colspan,rowspan]",
  23178. requiredContent: "td[colspan,rowspan]",
  23179. exec: function(a, b) {
  23180. b.cell = x(a.getSelection());
  23181. p(b.cell, !0)
  23182. }
  23183. }));
  23184. b("cellMergeRight", f({
  23185. allowedContent: "td[colspan]",
  23186. requiredContent: "td[colspan]",
  23187. exec: function(a, b) {
  23188. b.cell = x(a.getSelection(), "right");
  23189. p(b.cell, !0)
  23190. }
  23191. }));
  23192. b("cellMergeDown", f({
  23193. allowedContent: "td[rowspan]",
  23194. requiredContent: "td[rowspan]",
  23195. exec: function(a, b) {
  23196. b.cell = x(a.getSelection(), "down");
  23197. p(b.cell, !0)
  23198. }
  23199. }));
  23200. b("cellVerticalSplit",
  23201. f({
  23202. allowedContent: "td[rowspan]",
  23203. requiredContent: "td[rowspan]",
  23204. exec: function(a) {
  23205. p(E(a.getSelection()))
  23206. }
  23207. }));
  23208. b("cellHorizontalSplit", f({
  23209. allowedContent: "td[colspan]",
  23210. requiredContent: "td[colspan]",
  23211. exec: function(a) {
  23212. p(C(a.getSelection()))
  23213. }
  23214. }));
  23215. b("cellInsertBefore", f({
  23216. requiredContent: "table",
  23217. exec: function(a) {
  23218. a = a.getSelection();
  23219. t(a, !0)
  23220. }
  23221. }));
  23222. b("cellInsertAfter", f({
  23223. requiredContent: "table",
  23224. exec: function(a) {
  23225. a = a.getSelection();
  23226. t(a)
  23227. }
  23228. }));
  23229. d.addMenuItems && d.addMenuItems({
  23230. tablecell: {
  23231. label: c.cell.menu,
  23232. group: "tablecell",
  23233. order: 1,
  23234. getItems: function() {
  23235. var a = d.getSelection(),
  23236. b = q(a);
  23237. return {
  23238. tablecell_insertBefore: CKEDITOR.TRISTATE_OFF,
  23239. tablecell_insertAfter: CKEDITOR.TRISTATE_OFF,
  23240. tablecell_delete: CKEDITOR.TRISTATE_OFF,
  23241. tablecell_merge: x(a, null, !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  23242. tablecell_merge_right: x(a, "right", !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  23243. tablecell_merge_down: x(a, "down", !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  23244. tablecell_split_vertical: E(a, !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  23245. tablecell_split_horizontal: C(a, !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
  23246. tablecell_properties: 0 < b.length ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED
  23247. }
  23248. }
  23249. },
  23250. tablecell_insertBefore: {
  23251. label: c.cell.insertBefore,
  23252. group: "tablecell",
  23253. command: "cellInsertBefore",
  23254. order: 5
  23255. },
  23256. tablecell_insertAfter: {
  23257. label: c.cell.insertAfter,
  23258. group: "tablecell",
  23259. command: "cellInsertAfter",
  23260. order: 10
  23261. },
  23262. tablecell_delete: {
  23263. label: c.cell.deleteCell,
  23264. group: "tablecell",
  23265. command: "cellDelete",
  23266. order: 15
  23267. },
  23268. tablecell_merge: {
  23269. label: c.cell.merge,
  23270. group: "tablecell",
  23271. command: "cellMerge",
  23272. order: 16
  23273. },
  23274. tablecell_merge_right: {
  23275. label: c.cell.mergeRight,
  23276. group: "tablecell",
  23277. command: "cellMergeRight",
  23278. order: 17
  23279. },
  23280. tablecell_merge_down: {
  23281. label: c.cell.mergeDown,
  23282. group: "tablecell",
  23283. command: "cellMergeDown",
  23284. order: 18
  23285. },
  23286. tablecell_split_horizontal: {
  23287. label: c.cell.splitHorizontal,
  23288. group: "tablecell",
  23289. command: "cellHorizontalSplit",
  23290. order: 19
  23291. },
  23292. tablecell_split_vertical: {
  23293. label: c.cell.splitVertical,
  23294. group: "tablecell",
  23295. command: "cellVerticalSplit",
  23296. order: 20
  23297. },
  23298. tablecell_properties: {
  23299. label: c.cell.title,
  23300. group: "tablecellproperties",
  23301. command: "cellProperties",
  23302. order: 21
  23303. },
  23304. tablerow: {
  23305. label: c.row.menu,
  23306. group: "tablerow",
  23307. order: 1,
  23308. getItems: function() {
  23309. return {
  23310. tablerow_insertBefore: CKEDITOR.TRISTATE_OFF,
  23311. tablerow_insertAfter: CKEDITOR.TRISTATE_OFF,
  23312. tablerow_delete: CKEDITOR.TRISTATE_OFF
  23313. }
  23314. }
  23315. },
  23316. tablerow_insertBefore: {
  23317. label: c.row.insertBefore,
  23318. group: "tablerow",
  23319. command: "rowInsertBefore",
  23320. order: 5
  23321. },
  23322. tablerow_insertAfter: {
  23323. label: c.row.insertAfter,
  23324. group: "tablerow",
  23325. command: "rowInsertAfter",
  23326. order: 10
  23327. },
  23328. tablerow_delete: {
  23329. label: c.row.deleteRow,
  23330. group: "tablerow",
  23331. command: "rowDelete",
  23332. order: 15
  23333. },
  23334. tablecolumn: {
  23335. label: c.column.menu,
  23336. group: "tablecolumn",
  23337. order: 1,
  23338. getItems: function() {
  23339. return {
  23340. tablecolumn_insertBefore: CKEDITOR.TRISTATE_OFF,
  23341. tablecolumn_insertAfter: CKEDITOR.TRISTATE_OFF,
  23342. tablecolumn_delete: CKEDITOR.TRISTATE_OFF
  23343. }
  23344. }
  23345. },
  23346. tablecolumn_insertBefore: {
  23347. label: c.column.insertBefore,
  23348. group: "tablecolumn",
  23349. command: "columnInsertBefore",
  23350. order: 5
  23351. },
  23352. tablecolumn_insertAfter: {
  23353. label: c.column.insertAfter,
  23354. group: "tablecolumn",
  23355. command: "columnInsertAfter",
  23356. order: 10
  23357. },
  23358. tablecolumn_delete: {
  23359. label: c.column.deleteColumn,
  23360. group: "tablecolumn",
  23361. command: "columnDelete",
  23362. order: 15
  23363. }
  23364. });
  23365. d.contextMenu && d.contextMenu.addListener(function(a, b, c) {
  23366. return (a = c.contains({
  23367. td: 1,
  23368. th: 1
  23369. }, 1)) && !a.isReadOnly() ? {
  23370. tablecell: CKEDITOR.TRISTATE_OFF,
  23371. tablerow: CKEDITOR.TRISTATE_OFF,
  23372. tablecolumn: CKEDITOR.TRISTATE_OFF
  23373. } : null
  23374. })
  23375. },
  23376. getCellColIndex: v,
  23377. insertRow: r,
  23378. insertColumn: u,
  23379. getSelectedCells: q
  23380. };
  23381. CKEDITOR.plugins.add("tabletools", CKEDITOR.plugins.tabletools)
  23382. })();
  23383. CKEDITOR.tools.buildTableMap = function(q, r, B, v, w) {
  23384. q = q.$.rows;
  23385. B = B || 0;
  23386. v = "number" === typeof v ? v : q.length - 1;
  23387. w = "number" === typeof w ? w : -1;
  23388. var u = -1,
  23389. y = [];
  23390. for (r = r || 0; r <= v; r++) {
  23391. u++;
  23392. !y[u] && (y[u] = []);
  23393. for (var t = -1, z = B; z <= (-1 === w ? q[r].cells.length - 1 : w); z++) {
  23394. var p = q[r].cells[z];
  23395. if (!p) break;
  23396. for (t++; y[u][t];) t++;
  23397. for (var A = isNaN(p.colSpan) ? 1 : p.colSpan, p = isNaN(p.rowSpan) ? 1 : p.rowSpan, x = 0; x < p && !(r + x > v); x++) {
  23398. y[u + x] || (y[u + x] = []);
  23399. for (var C = 0; C < A; C++) y[u + x][t + C] = q[r].cells[z]
  23400. }
  23401. t += A - 1;
  23402. if (-1 !== w && t >= w) break
  23403. }
  23404. }
  23405. return y
  23406. };
  23407. (function() {
  23408. function D(a) {
  23409. return CKEDITOR.plugins.widget && CKEDITOR.plugins.widget.isDomWidget(a)
  23410. }
  23411. function z(a, b) {
  23412. var c = a.getAscendant("table"),
  23413. d = b.getAscendant("table"),
  23414. e = CKEDITOR.tools.buildTableMap(c),
  23415. g = r(a),
  23416. h = r(b),
  23417. k = [],
  23418. f = {},
  23419. l, p;
  23420. c.contains(d) && (b = b.getAscendant({
  23421. td: 1,
  23422. th: 1
  23423. }), h = r(b));
  23424. g > h && (c = g, g = h, h = c, c = a, a = b, b = c);
  23425. for (c = 0; c < e[g].length; c++)
  23426. if (a.$ === e[g][c]) {
  23427. l = c;
  23428. break
  23429. } for (c = 0; c < e[h].length; c++)
  23430. if (b.$ === e[h][c]) {
  23431. p = c;
  23432. break
  23433. } l > p && (c = l, l = p, p = c);
  23434. for (c = g; c <= h; c++)
  23435. for (g = l; g <= p; g++) d = new CKEDITOR.dom.element(e[c][g]),
  23436. d.$ && !d.getCustomData("selected_cell") && (k.push(d), CKEDITOR.dom.element.setMarker(f, d, "selected_cell", !0));
  23437. CKEDITOR.dom.element.clearAllMarkers(f);
  23438. return k
  23439. }
  23440. function I(a) {
  23441. if (a) return a = a.clone(), a.enlarge(CKEDITOR.ENLARGE_ELEMENT), (a = a.getEnclosedNode()) && a.is && a.is(CKEDITOR.dtd.$tableContent)
  23442. }
  23443. function J(a) {
  23444. return (a = a.editable().findOne(".cke_table-faked-selection")) && a.getAscendant("table")
  23445. }
  23446. function A(a, b) {
  23447. var c = a.editable().find(".cke_table-faked-selection"),
  23448. d;
  23449. a.fire("lockSnapshot");
  23450. a.editable().removeClass("cke_table-faked-selection-editor");
  23451. for (d = 0; d < c.count(); d++) c.getItem(d).removeClass("cke_table-faked-selection");
  23452. 0 < c.count() && c.getItem(0).getAscendant("table").data("cke-table-faked-selection-table", !1);
  23453. a.fire("unlockSnapshot");
  23454. b && (m = {
  23455. active: !1
  23456. }, a.getSelection().isInTable() && a.getSelection().reset())
  23457. }
  23458. function t(a, b) {
  23459. var c = [],
  23460. d, e;
  23461. for (e = 0; e < b.length; e++) d = a.createRange(), d.setStartBefore(b[e]), d.setEndAfter(b[e]), c.push(d);
  23462. a.getSelection().selectRanges(c)
  23463. }
  23464. function K(a) {
  23465. var b = a.editable().find(".cke_table-faked-selection");
  23466. 1 > b.count() ||
  23467. (b = z(b.getItem(0), b.getItem(b.count() - 1)), t(a, b))
  23468. }
  23469. function L(a, b, c) {
  23470. var d = v(a.getSelection(!0));
  23471. b = b.is("table") ? null : b;
  23472. var e;
  23473. (e = m.active && !m.first) && !(e = b) && (e = a.getSelection().getRanges(), e = 1 < d.length || e[0] && !e[0].collapsed ? !0 : !1);
  23474. if (e) m.first = b || d[0], m.dirty = b ? !1 : 1 !== d.length;
  23475. else if (m.active && b && m.first.getAscendant("table").equals(b.getAscendant("table"))) {
  23476. d = z(m.first, b);
  23477. if (!m.dirty && 1 === d.length && !D(c.data.getTarget())) return A(a, "mouseup" === c.name);
  23478. m.dirty = !0;
  23479. m.last = b;
  23480. t(a, d)
  23481. }
  23482. }
  23483. function M(a) {
  23484. var b =
  23485. (a = a.editor || a.sender.editor) && a.getSelection(),
  23486. c = b && b.getRanges() || [],
  23487. d;
  23488. if (b && (A(a), b.isInTable() && b.isFake)) {
  23489. 1 === c.length && c[0]._getTableElement() && c[0]._getTableElement().is("table") && (d = c[0]._getTableElement());
  23490. d = v(b, d);
  23491. a.fire("lockSnapshot");
  23492. for (b = 0; b < d.length; b++) d[b].addClass("cke_table-faked-selection");
  23493. 0 < d.length && (a.editable().addClass("cke_table-faked-selection-editor"), d[0].getAscendant("table").data("cke-table-faked-selection-table", ""));
  23494. a.fire("unlockSnapshot")
  23495. }
  23496. }
  23497. function r(a) {
  23498. return a.getAscendant("tr",
  23499. !0).$.rowIndex
  23500. }
  23501. function w(a) {
  23502. function b(a, b) {
  23503. return a && b ? a.equals(b) || a.contains(b) || b.contains(a) || a.getCommonAncestor(b).is(l) : !1
  23504. }
  23505. function c(a) {
  23506. return !a.getAscendant("table", !0) && a.getDocument().equals(e.document)
  23507. }
  23508. function d(a, d, e, f) {
  23509. return ("mousedown" !== a.name || CKEDITOR.tools.getMouseButton(a) !== CKEDITOR.MOUSE_BUTTON_LEFT && f) && ("mouseup" !== a.name || c(a.data.getTarget()) || b(e, f)) ? !1 : !0
  23510. }
  23511. if (a.data.getTarget().getName && ("mouseup" === a.name || !D(a.data.getTarget()))) {
  23512. var e = a.editor || a.listenerData.editor,
  23513. g = e.getSelection(1),
  23514. h = J(e),
  23515. k = a.data.getTarget(),
  23516. f = k && k.getAscendant({
  23517. td: 1,
  23518. th: 1
  23519. }, !0),
  23520. k = k && k.getAscendant("table", !0),
  23521. l = {
  23522. table: 1,
  23523. thead: 1,
  23524. tbody: 1,
  23525. tfoot: 1,
  23526. tr: 1,
  23527. td: 1,
  23528. th: 1
  23529. };
  23530. d(a, g, h, k) && A(e, !0);
  23531. !m.active && "mousedown" === a.name && CKEDITOR.tools.getMouseButton(a) === CKEDITOR.MOUSE_BUTTON_LEFT && k && (m = {
  23532. active: !0
  23533. }, CKEDITOR.document.on("mouseup", w, null, {
  23534. editor: e
  23535. }));
  23536. (f || k) && L(e, f || k, a);
  23537. "mouseup" === a.name && (CKEDITOR.tools.getMouseButton(a) === CKEDITOR.MOUSE_BUTTON_LEFT && (c(a.data.getTarget()) || b(h, k)) && K(e), m = {
  23538. active: !1
  23539. },
  23540. CKEDITOR.document.removeListener("mouseup", w))
  23541. }
  23542. }
  23543. function N(a) {
  23544. var b = a.data.getTarget().getAscendant({
  23545. td: 1,
  23546. th: 1
  23547. }, !0);
  23548. b && !b.hasClass("cke_table-faked-selection") && (a.cancel(), a.data.preventDefault())
  23549. }
  23550. function O(a, b) {
  23551. function c(a) {
  23552. a.cancel()
  23553. }
  23554. var d = a.getSelection(),
  23555. e = d.createBookmarks(),
  23556. g = a.document,
  23557. h = a.createRange(),
  23558. k = g.getDocumentElement().$,
  23559. f = CKEDITOR.env.ie && 9 > CKEDITOR.env.version,
  23560. l = a.blockless || CKEDITOR.env.ie ? "span" : "div",
  23561. p, x, n, m;
  23562. g.getById("cke_table_copybin") || (p = g.createElement(l), x = g.createElement(l),
  23563. x.setAttributes({
  23564. id: "cke_table_copybin",
  23565. "data-cke-temp": "1"
  23566. }), p.setStyles({
  23567. position: "absolute",
  23568. width: "1px",
  23569. height: "1px",
  23570. overflow: "hidden"
  23571. }), p.setStyle("ltr" == a.config.contentsLangDirection ? "left" : "right", "-5000px"), p.setHtml(a.getSelectedHtml(!0)), a.fire("lockSnapshot"), x.append(p), a.editable().append(x), m = a.on("selectionChange", c, null, null, 0), f && (n = k.scrollTop), h.selectNodeContents(p), h.select(), f && (k.scrollTop = n), setTimeout(function() {
  23572. x.remove();
  23573. d.selectBookmarks(e);
  23574. m.removeListener();
  23575. a.fire("unlockSnapshot");
  23576. b && (a.extractSelectedHtml(), a.fire("saveSnapshot"))
  23577. }, 100))
  23578. }
  23579. function E(a) {
  23580. var b = a.editor || a.sender.editor;
  23581. b.getSelection().isInTable() && O(b, "cut" === a.name)
  23582. }
  23583. function q(a) {
  23584. this._reset();
  23585. a && this.setSelectedCells(a)
  23586. }
  23587. function B(a, b, c) {
  23588. a.on("beforeCommandExec", function(d) {
  23589. -1 !== CKEDITOR.tools.array.indexOf(b, d.data.name) && (d.data.selectedCells = v(a.getSelection()))
  23590. });
  23591. a.on("afterCommandExec", function(d) {
  23592. -1 !== CKEDITOR.tools.array.indexOf(b, d.data.name) && c(a, d.data)
  23593. })
  23594. }
  23595. var m = {
  23596. active: !1
  23597. },
  23598. y, v, C, F, G;
  23599. q.prototype = {};
  23600. q.prototype._reset = function() {
  23601. this.cells = {
  23602. first: null,
  23603. last: null,
  23604. all: []
  23605. };
  23606. this.rows = {
  23607. first: null,
  23608. last: null
  23609. }
  23610. };
  23611. q.prototype.setSelectedCells = function(a) {
  23612. this._reset();
  23613. a = a.slice(0);
  23614. this._arraySortByDOMOrder(a);
  23615. this.cells.all = a;
  23616. this.cells.first = a[0];
  23617. this.cells.last = a[a.length - 1];
  23618. this.rows.first = a[0].getAscendant("tr");
  23619. this.rows.last = this.cells.last.getAscendant("tr")
  23620. };
  23621. q.prototype.getTableMap = function() {
  23622. var a = C(this.cells.first),
  23623. b;
  23624. a: {
  23625. b = this.cells.last;
  23626. var c = b.getAscendant("table"),
  23627. d = r(b),
  23628. c = CKEDITOR.tools.buildTableMap(c),
  23629. e;
  23630. for (e = 0; e < c[d].length; e++)
  23631. if ((new CKEDITOR.dom.element(c[d][e])).equals(b)) {
  23632. b = e;
  23633. break a
  23634. } b = void 0
  23635. }
  23636. return CKEDITOR.tools.buildTableMap(this._getTable(), r(this.rows.first), a, r(this.rows.last), b)
  23637. };
  23638. q.prototype._getTable = function() {
  23639. return this.rows.first.getAscendant("table")
  23640. };
  23641. q.prototype.insertRow = function(a, b, c) {
  23642. if ("undefined" === typeof a) a = 1;
  23643. else if (0 >= a) return;
  23644. for (var d = this.cells.first.$.cellIndex, e = this.cells.last.$.cellIndex, g = c ? [] : this.cells.all, h, k = 0; k < a; k++) h = F(c ? this.cells.all : g, b), h = CKEDITOR.tools.array.filter(h.find("td, th").toArray(),
  23645. function(a) {
  23646. return c ? !0 : a.$.cellIndex >= d && a.$.cellIndex <= e
  23647. }), g = b ? h.concat(g) : g.concat(h);
  23648. this.setSelectedCells(g)
  23649. };
  23650. q.prototype.insertColumn = function(a) {
  23651. function b(a) {
  23652. a = r(a);
  23653. return a >= e && a <= g
  23654. }
  23655. if ("undefined" === typeof a) a = 1;
  23656. else if (0 >= a) return;
  23657. for (var c = this.cells, d = c.all, e = r(c.first), g = r(c.last), c = 0; c < a; c++) d = d.concat(CKEDITOR.tools.array.filter(G(d), b));
  23658. this.setSelectedCells(d)
  23659. };
  23660. q.prototype.emptyCells = function(a) {
  23661. a = a || this.cells.all;
  23662. for (var b = 0; b < a.length; b++) a[b].setHtml("")
  23663. };
  23664. q.prototype._arraySortByDOMOrder =
  23665. function(a) {
  23666. a.sort(function(a, c) {
  23667. return a.getPosition(c) & CKEDITOR.POSITION_PRECEDING ? -1 : 1
  23668. })
  23669. };
  23670. var H = {
  23671. onPaste: function(a) {
  23672. function b(a) {
  23673. return Math.max.apply(null, CKEDITOR.tools.array.map(a, function(a) {
  23674. return a.length
  23675. }, 0))
  23676. }
  23677. function c(a) {
  23678. var b = d.createRange();
  23679. b.selectNodeContents(a);
  23680. b.select()
  23681. }
  23682. var d = a.editor,
  23683. e = d.getSelection(),
  23684. g = v(e),
  23685. h = this.findTableInPastedContent(d, a.data.dataValue),
  23686. k = e.isInTable(!0) && this.isBoundarySelection(e),
  23687. f, l;
  23688. !g.length || 1 === g.length && !I(e.getRanges()[0]) && !k || k && !h || (g = g[0].getAscendant("table"),
  23689. f = new q(v(e, g)), d.once("afterPaste", function() {
  23690. var a;
  23691. if (l) {
  23692. a = new CKEDITOR.dom.element(l[0][0]);
  23693. var b = l[l.length - 1];
  23694. a = z(a, new CKEDITOR.dom.element(b[b.length - 1]))
  23695. } else a = f.cells.all;
  23696. t(d, a)
  23697. }), h ? (a.stop(), k ? (f.insertRow(1, 1 === k, !0), e.selectElement(f.rows.first)) : (f.emptyCells(), t(d, f.cells.all)), a = f.getTableMap(), l = CKEDITOR.tools.buildTableMap(h), f.insertRow(l.length - a.length), f.insertColumn(b(l) - b(a)), a = f.getTableMap(), this.pasteTable(f, a, l), d.fire("saveSnapshot"), setTimeout(function() {
  23698. d.fire("afterPaste")
  23699. },
  23700. 0)) : (c(f.cells.first), d.once("afterPaste", function() {
  23701. d.fire("lockSnapshot");
  23702. f.emptyCells(f.cells.all.slice(1));
  23703. t(d, f.cells.all);
  23704. d.fire("unlockSnapshot")
  23705. })))
  23706. },
  23707. isBoundarySelection: function(a) {
  23708. a = a.getRanges()[0];
  23709. var b = a.endContainer.getAscendant("tr", !0);
  23710. if (b && a.collapsed) {
  23711. if (a.checkBoundaryOfElement(b, CKEDITOR.START)) return 1;
  23712. if (a.checkBoundaryOfElement(b, CKEDITOR.END)) return 2
  23713. }
  23714. return 0
  23715. },
  23716. findTableInPastedContent: function(a, b) {
  23717. var c = a.dataProcessor,
  23718. d = new CKEDITOR.dom.element("body");
  23719. c || (c = new CKEDITOR.htmlDataProcessor(a));
  23720. d.setHtml(c.toHtml(b), {
  23721. fixForBody: !1
  23722. });
  23723. return 1 < d.getChildCount() ? null : d.findOne("table")
  23724. },
  23725. pasteTable: function(a, b, c) {
  23726. var d, e = C(a.cells.first),
  23727. g = a._getTable(),
  23728. h = {},
  23729. k, f, l, p;
  23730. for (l = 0; l < c.length; l++)
  23731. for (k = new CKEDITOR.dom.element(g.$.rows[a.rows.first.$.rowIndex + l]), p = 0; p < c[l].length; p++)
  23732. if (f = new CKEDITOR.dom.element(c[l][p]), d = b[l] && b[l][p] ? new CKEDITOR.dom.element(b[l][p]) : null, f && !f.getCustomData("processed")) {
  23733. if (d && d.getParent()) f.replace(d);
  23734. else if (0 === p || c[l][p - 1])(d = 0 !== p ? new CKEDITOR.dom.element(c[l][p -
  23735. 1
  23736. ]) : null) && k.equals(d.getParent()) ? f.insertAfter(d) : 0 < e ? k.$.cells[e] ? f.insertAfter(new CKEDITOR.dom.element(k.$.cells[e])) : k.append(f) : k.append(f, !0);
  23737. CKEDITOR.dom.element.setMarker(h, f, "processed", !0)
  23738. } else f.getCustomData("processed") && d && d.remove();
  23739. CKEDITOR.dom.element.clearAllMarkers(h)
  23740. }
  23741. };
  23742. CKEDITOR.plugins.tableselection = {
  23743. getCellsBetween: z,
  23744. keyboardIntegration: function(a) {
  23745. function b(a) {
  23746. var b = a.getEnclosedNode();
  23747. b && "function" === typeof b.is && b.is({
  23748. td: 1,
  23749. th: 1
  23750. }) ? b.setText("") : a.deleteContents();
  23751. CKEDITOR.tools.array.forEach(a._find("td"),
  23752. function(a) {
  23753. a.appendBogus()
  23754. })
  23755. }
  23756. var c = a.editable();
  23757. c.attachListener(c, "keydown", function(a) {
  23758. function c(b, e) {
  23759. if (!e.length) return null;
  23760. var l = a.createRange(),
  23761. g = CKEDITOR.dom.range.mergeRanges(e);
  23762. CKEDITOR.tools.array.forEach(g, function(a) {
  23763. a.enlarge(CKEDITOR.ENLARGE_ELEMENT)
  23764. });
  23765. var m = g[0].getBoundaryNodes(),
  23766. n = m.startNode,
  23767. m = m.endNode;
  23768. if (n && n.is && n.is(h)) {
  23769. for (var q = n.getAscendant("table", !0), u = n.getPreviousSourceNode(!1, CKEDITOR.NODE_ELEMENT, q), r = !1, t = function(a) {
  23770. return !n.contains(a) && a.is && a.is("td", "th")
  23771. }; u &&
  23772. !t(u);) u = u.getPreviousSourceNode(!1, CKEDITOR.NODE_ELEMENT, q);
  23773. !u && m && m.is && !m.is("table") && m.getNext() && (u = m.getNext().findOne("td, th"), r = !0);
  23774. if (u) l["moveToElementEdit" + (r ? "Start" : "End")](u);
  23775. else l.setStartBefore(n.getAscendant("table", !0)), l.collapse(!0);
  23776. g[0].deleteContents();
  23777. return [l]
  23778. }
  23779. if (n) return l.moveToElementEditablePosition(n), [l]
  23780. }
  23781. var g = {
  23782. 37: 1,
  23783. 38: 1,
  23784. 39: 1,
  23785. 40: 1,
  23786. 8: 1,
  23787. 46: 1,
  23788. 13: 1
  23789. },
  23790. h = CKEDITOR.tools.extend({
  23791. table: 1
  23792. }, CKEDITOR.dtd.$tableContent);
  23793. delete h.td;
  23794. delete h.th;
  23795. return function(k) {
  23796. var f = k.data.getKey(),
  23797. l = k.data.getKeystroke(),
  23798. h, m = 37 === f || 38 == f,
  23799. n, q, r;
  23800. if (g[f] && (h = a.getSelection()) && h.isInTable() && h.isFake) {
  23801. n = h.getRanges();
  23802. q = n[0]._getTableElement();
  23803. r = n[n.length - 1]._getTableElement();
  23804. if (13 !== f || a.plugins.enterkey) k.data.preventDefault(), k.cancel();
  23805. if (36 < f && 41 > f) n[0].moveToElementEditablePosition(m ? q : r, !m), h.selectRanges([n[0]]);
  23806. else if (13 !== f || 13 === l || l === CKEDITOR.SHIFT + 13) {
  23807. for (k = 0; k < n.length; k++) b(n[k]);
  23808. (k = c(q, n)) ? n = k: n[0].moveToElementEditablePosition(q);
  23809. h.selectRanges(n);
  23810. 13 === f && a.plugins.enterkey ?
  23811. (a.fire("lockSnapshot"), 13 === l ? a.execCommand("enter") : a.execCommand("shiftEnter"), a.fire("unlockSnapshot"), a.fire("saveSnapshot")) : 13 !== f && a.fire("saveSnapshot")
  23812. }
  23813. }
  23814. }
  23815. }(a), null, null, -1);
  23816. c.attachListener(c, "keypress", function(d) {
  23817. var c = a.getSelection(),
  23818. g = d.data.$.charCode || 13 === d.data.getKey(),
  23819. h;
  23820. if (c && c.isInTable() && c.isFake && g && !(d.data.getKeystroke() & CKEDITOR.CTRL)) {
  23821. d = c.getRanges();
  23822. g = d[0].getEnclosedNode().getAscendant({
  23823. td: 1,
  23824. th: 1
  23825. }, !0);
  23826. for (h = 0; h < d.length; h++) b(d[h]);
  23827. g && (d[0].moveToElementEditablePosition(g),
  23828. c.selectRanges([d[0]]))
  23829. }
  23830. }, null, null, -1)
  23831. },
  23832. isSupportedEnvironment: !(CKEDITOR.env.ie && 11 > CKEDITOR.env.version)
  23833. };
  23834. CKEDITOR.plugins.add("tableselection", {
  23835. requires: "clipboard,tabletools",
  23836. onLoad: function() {
  23837. y = CKEDITOR.plugins.tabletools;
  23838. v = y.getSelectedCells;
  23839. C = y.getCellColIndex;
  23840. F = y.insertRow;
  23841. G = y.insertColumn;
  23842. CKEDITOR.document.appendStyleSheet(this.path + "styles/tableselection.css")
  23843. },
  23844. init: function(a) {
  23845. CKEDITOR.plugins.tableselection.isSupportedEnvironment && (a.addContentsCss && a.addContentsCss(this.path + "styles/tableselection.css"),
  23846. a.on("contentDom", function() {
  23847. var b = a.editable(),
  23848. c = b.isInline() ? b : a.document,
  23849. d = {
  23850. editor: a
  23851. };
  23852. b.attachListener(c, "mousedown", w, null, d);
  23853. b.attachListener(c, "mousemove", w, null, d);
  23854. b.attachListener(c, "mouseup", w, null, d);
  23855. b.attachListener(b, "dragstart", N);
  23856. b.attachListener(a, "selectionCheck", M);
  23857. CKEDITOR.plugins.tableselection.keyboardIntegration(a);
  23858. CKEDITOR.plugins.clipboard && !CKEDITOR.plugins.clipboard.isCustomCopyCutSupported && (b.attachListener(b, "cut", E), b.attachListener(b, "copy", E))
  23859. }), a.on("paste", H.onPaste,
  23860. H), B(a, "rowInsertBefore rowInsertAfter columnInsertBefore columnInsertAfter cellInsertBefore cellInsertAfter".split(" "), function(a, c) {
  23861. t(a, c.selectedCells)
  23862. }), B(a, ["cellMerge", "cellMergeRight", "cellMergeDown"], function(a, c) {
  23863. t(a, [c.commandData.cell])
  23864. }), B(a, ["cellDelete"], function(a) {
  23865. A(a, !0)
  23866. }))
  23867. }
  23868. })
  23869. })();
  23870. (function() {
  23871. var g = [CKEDITOR.CTRL + 90, CKEDITOR.CTRL + 89, CKEDITOR.CTRL + CKEDITOR.SHIFT + 90],
  23872. n = {
  23873. 8: 1,
  23874. 46: 1
  23875. };
  23876. CKEDITOR.plugins.add("undo", {
  23877. init: function(a) {
  23878. function b(a) {
  23879. d.enabled && !1 !== a.data.command.canUndo && d.save()
  23880. }
  23881. function c() {
  23882. d.enabled = a.readOnly ? !1 : "wysiwyg" == a.mode;
  23883. d.onChange()
  23884. }
  23885. var d = a.undoManager = new e(a),
  23886. l = d.editingHandler = new k(d),
  23887. f = a.addCommand("undo", {
  23888. exec: function() {
  23889. d.undo() && (a.selectionChange(), this.fire("afterUndo"))
  23890. },
  23891. startDisabled: !0,
  23892. canUndo: !1
  23893. }),
  23894. h = a.addCommand("redo", {
  23895. exec: function() {
  23896. d.redo() &&
  23897. (a.selectionChange(), this.fire("afterRedo"))
  23898. },
  23899. startDisabled: !0,
  23900. canUndo: !1
  23901. });
  23902. a.setKeystroke([
  23903. [g[0], "undo"],
  23904. [g[1], "redo"],
  23905. [g[2], "redo"]
  23906. ]);
  23907. d.onChange = function() {
  23908. f.setState(d.undoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
  23909. h.setState(d.redoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED)
  23910. };
  23911. a.on("beforeCommandExec", b);
  23912. a.on("afterCommandExec", b);
  23913. a.on("saveSnapshot", function(a) {
  23914. d.save(a.data && a.data.contentOnly)
  23915. });
  23916. a.on("contentDom", l.attachListeners, l);
  23917. a.on("instanceReady", function() {
  23918. a.fire("saveSnapshot")
  23919. });
  23920. a.on("beforeModeUnload", function() {
  23921. "wysiwyg" == a.mode && d.save(!0)
  23922. });
  23923. a.on("mode", c);
  23924. a.on("readOnly", c);
  23925. a.ui.addButton && (a.ui.addButton("Undo", {
  23926. label: a.lang.undo.undo,
  23927. command: "undo",
  23928. toolbar: "undo,10"
  23929. }), a.ui.addButton("Redo", {
  23930. label: a.lang.undo.redo,
  23931. command: "redo",
  23932. toolbar: "undo,20"
  23933. }));
  23934. a.resetUndo = function() {
  23935. d.reset();
  23936. a.fire("saveSnapshot")
  23937. };
  23938. a.on("updateSnapshot", function() {
  23939. d.currentImage && d.update()
  23940. });
  23941. a.on("lockSnapshot", function(a) {
  23942. a = a.data;
  23943. d.lock(a && a.dontUpdate, a && a.forceUpdate)
  23944. });
  23945. a.on("unlockSnapshot",
  23946. d.unlock, d)
  23947. }
  23948. });
  23949. CKEDITOR.plugins.undo = {};
  23950. var e = CKEDITOR.plugins.undo.UndoManager = function(a) {
  23951. this.strokesRecorded = [0, 0];
  23952. this.locked = null;
  23953. this.previousKeyGroup = -1;
  23954. this.limit = a.config.undoStackSize || 20;
  23955. this.strokesLimit = 25;
  23956. this.editor = a;
  23957. this.reset()
  23958. };
  23959. e.prototype = {
  23960. type: function(a, b) {
  23961. var c = e.getKeyGroup(a),
  23962. d = this.strokesRecorded[c] + 1;
  23963. b = b || d >= this.strokesLimit;
  23964. this.typing || (this.hasUndo = this.typing = !0, this.hasRedo = !1, this.onChange());
  23965. b ? (d = 0, this.editor.fire("saveSnapshot")) : this.editor.fire("change");
  23966. this.strokesRecorded[c] =
  23967. d;
  23968. this.previousKeyGroup = c
  23969. },
  23970. keyGroupChanged: function(a) {
  23971. return e.getKeyGroup(a) != this.previousKeyGroup
  23972. },
  23973. reset: function() {
  23974. this.snapshots = [];
  23975. this.index = -1;
  23976. this.currentImage = null;
  23977. this.hasRedo = this.hasUndo = !1;
  23978. this.locked = null;
  23979. this.resetType()
  23980. },
  23981. resetType: function() {
  23982. this.strokesRecorded = [0, 0];
  23983. this.typing = !1;
  23984. this.previousKeyGroup = -1
  23985. },
  23986. refreshState: function() {
  23987. this.hasUndo = !!this.getNextImage(!0);
  23988. this.hasRedo = !!this.getNextImage(!1);
  23989. this.resetType();
  23990. this.onChange()
  23991. },
  23992. save: function(a, b, c) {
  23993. var d = this.editor;
  23994. if (this.locked ||
  23995. "ready" != d.status || "wysiwyg" != d.mode) return !1;
  23996. var e = d.editable();
  23997. if (!e || "ready" != e.status) return !1;
  23998. e = this.snapshots;
  23999. b || (b = new f(d));
  24000. if (!1 === b.contents) return !1;
  24001. if (this.currentImage)
  24002. if (b.equalsContent(this.currentImage)) {
  24003. if (a || b.equalsSelection(this.currentImage)) return !1
  24004. } else !1 !== c && d.fire("change");
  24005. e.splice(this.index + 1, e.length - this.index - 1);
  24006. e.length == this.limit && e.shift();
  24007. this.index = e.push(b) - 1;
  24008. this.currentImage = b;
  24009. !1 !== c && this.refreshState();
  24010. return !0
  24011. },
  24012. restoreImage: function(a) {
  24013. var b = this.editor,
  24014. c;
  24015. a.bookmarks && (b.focus(), c = b.getSelection());
  24016. this.locked = {
  24017. level: 999
  24018. };
  24019. this.editor.loadSnapshot(a.contents);
  24020. a.bookmarks ? c.selectBookmarks(a.bookmarks) : CKEDITOR.env.ie && (c = this.editor.document.getBody().$.createTextRange(), c.collapse(!0), c.select());
  24021. this.locked = null;
  24022. this.index = a.index;
  24023. this.currentImage = this.snapshots[this.index];
  24024. this.update();
  24025. this.refreshState();
  24026. b.fire("change")
  24027. },
  24028. getNextImage: function(a) {
  24029. var b = this.snapshots,
  24030. c = this.currentImage,
  24031. d;
  24032. if (c)
  24033. if (a)
  24034. for (d = this.index - 1; 0 <= d; d--) {
  24035. if (a = b[d], !c.equalsContent(a)) return a.index =
  24036. d, a
  24037. } else
  24038. for (d = this.index + 1; d < b.length; d++)
  24039. if (a = b[d], !c.equalsContent(a)) return a.index = d, a;
  24040. return null
  24041. },
  24042. redoable: function() {
  24043. return this.enabled && this.hasRedo
  24044. },
  24045. undoable: function() {
  24046. return this.enabled && this.hasUndo
  24047. },
  24048. undo: function() {
  24049. if (this.undoable()) {
  24050. this.save(!0);
  24051. var a = this.getNextImage(!0);
  24052. if (a) return this.restoreImage(a), !0
  24053. }
  24054. return !1
  24055. },
  24056. redo: function() {
  24057. if (this.redoable() && (this.save(!0), this.redoable())) {
  24058. var a = this.getNextImage(!1);
  24059. if (a) return this.restoreImage(a), !0
  24060. }
  24061. return !1
  24062. },
  24063. update: function(a) {
  24064. if (!this.locked) {
  24065. a ||
  24066. (a = new f(this.editor));
  24067. for (var b = this.index, c = this.snapshots; 0 < b && this.currentImage.equalsContent(c[b - 1]);) --b;
  24068. c.splice(b, this.index - b + 1, a);
  24069. this.index = b;
  24070. this.currentImage = a
  24071. }
  24072. },
  24073. updateSelection: function(a) {
  24074. if (!this.snapshots.length) return !1;
  24075. var b = this.snapshots,
  24076. c = b[b.length - 1];
  24077. return c.equalsContent(a) && !c.equalsSelection(a) ? (this.currentImage = b[b.length - 1] = a, !0) : !1
  24078. },
  24079. lock: function(a, b) {
  24080. if (this.locked) this.locked.level++;
  24081. else if (a) this.locked = {
  24082. level: 1
  24083. };
  24084. else {
  24085. var c = null;
  24086. if (b) c = !0;
  24087. else {
  24088. var d = new f(this.editor,
  24089. !0);
  24090. this.currentImage && this.currentImage.equalsContent(d) && (c = d)
  24091. }
  24092. this.locked = {
  24093. update: c,
  24094. level: 1
  24095. }
  24096. }
  24097. },
  24098. unlock: function() {
  24099. if (this.locked && !--this.locked.level) {
  24100. var a = this.locked.update;
  24101. this.locked = null;
  24102. if (!0 === a) this.update();
  24103. else if (a) {
  24104. var b = new f(this.editor, !0);
  24105. a.equalsContent(b) || this.update()
  24106. }
  24107. }
  24108. }
  24109. };
  24110. e.navigationKeyCodes = {
  24111. 37: 1,
  24112. 38: 1,
  24113. 39: 1,
  24114. 40: 1,
  24115. 36: 1,
  24116. 35: 1,
  24117. 33: 1,
  24118. 34: 1
  24119. };
  24120. e.keyGroups = {
  24121. PRINTABLE: 0,
  24122. FUNCTIONAL: 1
  24123. };
  24124. e.isNavigationKey = function(a) {
  24125. return !!e.navigationKeyCodes[a]
  24126. };
  24127. e.getKeyGroup = function(a) {
  24128. var b = e.keyGroups;
  24129. return n[a] ? b.FUNCTIONAL : b.PRINTABLE
  24130. };
  24131. e.getOppositeKeyGroup = function(a) {
  24132. var b = e.keyGroups;
  24133. return a == b.FUNCTIONAL ? b.PRINTABLE : b.FUNCTIONAL
  24134. };
  24135. e.ieFunctionalKeysBug = function(a) {
  24136. return CKEDITOR.env.ie && e.getKeyGroup(a) == e.keyGroups.FUNCTIONAL
  24137. };
  24138. var f = CKEDITOR.plugins.undo.Image = function(a, b) {
  24139. this.editor = a;
  24140. a.fire("beforeUndoImage");
  24141. var c = a.getSnapshot();
  24142. CKEDITOR.env.ie && c && (c = c.replace(/\s+data-cke-expando=".*?"/g, ""));
  24143. this.contents = c;
  24144. b || (this.bookmarks = (c = c && a.getSelection()) && c.createBookmarks2(!0));
  24145. a.fire("afterUndoImage")
  24146. },
  24147. h = /\b(?:href|src|name)="[^"]*?"/gi;
  24148. f.prototype = {
  24149. equalsContent: function(a) {
  24150. var b = this.contents;
  24151. a = a.contents;
  24152. CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) && (b = b.replace(h, ""), a = a.replace(h, ""));
  24153. return b != a ? !1 : !0
  24154. },
  24155. equalsSelection: function(a) {
  24156. var b = this.bookmarks;
  24157. a = a.bookmarks;
  24158. if (b || a) {
  24159. if (!b || !a || b.length != a.length) return !1;
  24160. for (var c = 0; c < b.length; c++) {
  24161. var d = b[c],
  24162. e = a[c];
  24163. if (d.startOffset != e.startOffset || d.endOffset != e.endOffset || !CKEDITOR.tools.arrayCompare(d.start, e.start) || !CKEDITOR.tools.arrayCompare(d.end,
  24164. e.end)) return !1
  24165. }
  24166. }
  24167. return !0
  24168. }
  24169. };
  24170. var k = CKEDITOR.plugins.undo.NativeEditingHandler = function(a) {
  24171. this.undoManager = a;
  24172. this.ignoreInputEvent = !1;
  24173. this.keyEventsStack = new m;
  24174. this.lastKeydownImage = null
  24175. };
  24176. k.prototype = {
  24177. onKeydown: function(a) {
  24178. var b = a.data.getKey();
  24179. if (229 !== b)
  24180. if (-1 < CKEDITOR.tools.indexOf(g, a.data.getKeystroke())) a.data.preventDefault();
  24181. else if (this.keyEventsStack.cleanUp(a), a = this.undoManager, this.keyEventsStack.getLast(b) || this.keyEventsStack.push(b), this.lastKeydownImage = new f(a.editor), e.isNavigationKey(b) ||
  24182. this.undoManager.keyGroupChanged(b))
  24183. if (a.strokesRecorded[0] || a.strokesRecorded[1]) a.save(!1, this.lastKeydownImage, !1), a.resetType()
  24184. },
  24185. onInput: function() {
  24186. if (this.ignoreInputEvent) this.ignoreInputEvent = !1;
  24187. else {
  24188. var a = this.keyEventsStack.getLast();
  24189. a || (a = this.keyEventsStack.push(0));
  24190. this.keyEventsStack.increment(a.keyCode);
  24191. this.keyEventsStack.getTotalInputs() >= this.undoManager.strokesLimit && (this.undoManager.type(a.keyCode, !0), this.keyEventsStack.resetInputs())
  24192. }
  24193. },
  24194. onKeyup: function(a) {
  24195. var b = this.undoManager;
  24196. a = a.data.getKey();
  24197. var c = this.keyEventsStack.getTotalInputs();
  24198. this.keyEventsStack.remove(a);
  24199. if (!(e.ieFunctionalKeysBug(a) && this.lastKeydownImage && this.lastKeydownImage.equalsContent(new f(b.editor, !0))))
  24200. if (0 < c) b.type(a);
  24201. else if (e.isNavigationKey(a)) this.onNavigationKey(!0)
  24202. },
  24203. onNavigationKey: function(a) {
  24204. var b = this.undoManager;
  24205. !a && b.save(!0, null, !1) || b.updateSelection(new f(b.editor));
  24206. b.resetType()
  24207. },
  24208. ignoreInputEventListener: function() {
  24209. this.ignoreInputEvent = !0
  24210. },
  24211. activateInputEventListener: function() {
  24212. this.ignoreInputEvent = !1
  24213. },
  24214. attachListeners: function() {
  24215. var a = this.undoManager.editor,
  24216. b = a.editable(),
  24217. c = this;
  24218. b.attachListener(b, "keydown", function(a) {
  24219. c.onKeydown(a);
  24220. if (e.ieFunctionalKeysBug(a.data.getKey())) c.onInput()
  24221. }, null, null, 999);
  24222. b.attachListener(b, CKEDITOR.env.ie ? "keypress" : "input", c.onInput, c, null, 999);
  24223. b.attachListener(b, "keyup", c.onKeyup, c, null, 999);
  24224. b.attachListener(b, "paste", c.ignoreInputEventListener, c, null, 999);
  24225. b.attachListener(b, "drop", c.ignoreInputEventListener, c, null, 999);
  24226. a.on("afterPaste", c.activateInputEventListener,
  24227. c, null, 999);
  24228. b.attachListener(b.isInline() ? b : a.document.getDocumentElement(), "click", function() {
  24229. c.onNavigationKey()
  24230. }, null, null, 999);
  24231. b.attachListener(this.undoManager.editor, "blur", function() {
  24232. c.keyEventsStack.remove(9)
  24233. }, null, null, 999)
  24234. }
  24235. };
  24236. var m = CKEDITOR.plugins.undo.KeyEventsStack = function() {
  24237. this.stack = []
  24238. };
  24239. m.prototype = {
  24240. push: function(a) {
  24241. a = this.stack.push({
  24242. keyCode: a,
  24243. inputs: 0
  24244. });
  24245. return this.stack[a - 1]
  24246. },
  24247. getLastIndex: function(a) {
  24248. if ("number" != typeof a) return this.stack.length - 1;
  24249. for (var b = this.stack.length; b--;)
  24250. if (this.stack[b].keyCode ==
  24251. a) return b;
  24252. return -1
  24253. },
  24254. getLast: function(a) {
  24255. a = this.getLastIndex(a);
  24256. return -1 != a ? this.stack[a] : null
  24257. },
  24258. increment: function(a) {
  24259. this.getLast(a).inputs++
  24260. },
  24261. remove: function(a) {
  24262. a = this.getLastIndex(a); - 1 != a && this.stack.splice(a, 1)
  24263. },
  24264. resetInputs: function(a) {
  24265. if ("number" == typeof a) this.getLast(a).inputs = 0;
  24266. else
  24267. for (a = this.stack.length; a--;) this.stack[a].inputs = 0
  24268. },
  24269. getTotalInputs: function() {
  24270. for (var a = this.stack.length, b = 0; a--;) b += this.stack[a].inputs;
  24271. return b
  24272. },
  24273. cleanUp: function(a) {
  24274. a = a.data.$;
  24275. a.ctrlKey || a.metaKey || this.remove(17);
  24276. a.shiftKey || this.remove(16);
  24277. a.altKey || this.remove(18)
  24278. }
  24279. }
  24280. })();
  24281. (function() {
  24282. function m(a, d) {
  24283. CKEDITOR.tools.extend(this, {
  24284. editor: a,
  24285. editable: a.editable(),
  24286. doc: a.document,
  24287. win: a.window
  24288. }, d, !0);
  24289. this.inline = this.editable.isInline();
  24290. this.inline || (this.frame = this.win.getFrame());
  24291. this.target = this[this.inline ? "editable" : "doc"]
  24292. }
  24293. function n(a, d) {
  24294. CKEDITOR.tools.extend(this, d, {
  24295. editor: a
  24296. }, !0)
  24297. }
  24298. function p(a, d) {
  24299. var b = a.editable();
  24300. CKEDITOR.tools.extend(this, {
  24301. editor: a,
  24302. editable: b,
  24303. inline: b.isInline(),
  24304. doc: a.document,
  24305. win: a.window,
  24306. container: CKEDITOR.document.getBody(),
  24307. winTop: CKEDITOR.document.getWindow()
  24308. },
  24309. d, !0);
  24310. this.hidden = {};
  24311. this.visible = {};
  24312. this.inline || (this.frame = this.win.getFrame());
  24313. this.queryViewport();
  24314. var c = CKEDITOR.tools.bind(this.queryViewport, this),
  24315. e = CKEDITOR.tools.bind(this.hideVisible, this),
  24316. g = CKEDITOR.tools.bind(this.removeAll, this);
  24317. b.attachListener(this.winTop, "resize", c);
  24318. b.attachListener(this.winTop, "scroll", c);
  24319. b.attachListener(this.winTop, "resize", e);
  24320. b.attachListener(this.win, "scroll", e);
  24321. b.attachListener(this.inline ? b : this.frame, "mouseout", function(a) {
  24322. var b = a.data.$.clientX;
  24323. a = a.data.$.clientY;
  24324. this.queryViewport();
  24325. (b <= this.rect.left || b >= this.rect.right || a <= this.rect.top || a >= this.rect.bottom) && this.hideVisible();
  24326. (0 >= b || b >= this.winTopPane.width || 0 >= a || a >= this.winTopPane.height) && this.hideVisible()
  24327. }, this);
  24328. b.attachListener(a, "resize", c);
  24329. b.attachListener(a, "mode", g);
  24330. a.on("destroy", g);
  24331. this.lineTpl = (new CKEDITOR.template('\x3cdiv data-cke-lineutils-line\x3d"1" class\x3d"cke_reset_all" style\x3d"{lineStyle}"\x3e\x3cspan style\x3d"{tipLeftStyle}"\x3e\x26nbsp;\x3c/span\x3e\x3cspan style\x3d"{tipRightStyle}"\x3e\x26nbsp;\x3c/span\x3e\x3c/div\x3e')).output({
  24332. lineStyle: CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({},
  24333. t, this.lineStyle, !0)),
  24334. tipLeftStyle: CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({}, q, {
  24335. left: "0px",
  24336. "border-left-color": "red",
  24337. "border-width": "6px 0 6px 6px"
  24338. }, this.tipCss, this.tipLeftStyle, !0)),
  24339. tipRightStyle: CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({}, q, {
  24340. right: "0px",
  24341. "border-right-color": "red",
  24342. "border-width": "6px 6px 6px 0"
  24343. }, this.tipCss, this.tipRightStyle, !0))
  24344. })
  24345. }
  24346. function l(a) {
  24347. var d;
  24348. if (d = a && a.type == CKEDITOR.NODE_ELEMENT) d = !(r[a.getComputedStyle("float")] || r[a.getAttribute("align")]);
  24349. return d &&
  24350. !u[a.getComputedStyle("position")]
  24351. }
  24352. CKEDITOR.plugins.add("lineutils");
  24353. CKEDITOR.LINEUTILS_BEFORE = 1;
  24354. CKEDITOR.LINEUTILS_AFTER = 2;
  24355. CKEDITOR.LINEUTILS_INSIDE = 4;
  24356. m.prototype = {
  24357. start: function(a) {
  24358. var d = this,
  24359. b = this.editor,
  24360. c = this.doc,
  24361. e, g, f, h, k = CKEDITOR.tools.eventsBuffer(50, function() {
  24362. b.readOnly || "wysiwyg" != b.mode || (d.relations = {}, (g = c.$.elementFromPoint(f, h)) && g.nodeType && (e = new CKEDITOR.dom.element(g), d.traverseSearch(e), isNaN(f + h) || d.pixelSearch(e, f, h), a && a(d.relations, f, h)))
  24363. });
  24364. this.listener = this.editable.attachListener(this.target,
  24365. "mousemove",
  24366. function(a) {
  24367. f = a.data.$.clientX;
  24368. h = a.data.$.clientY;
  24369. k.input()
  24370. });
  24371. this.editable.attachListener(this.inline ? this.editable : this.frame, "mouseout", function() {
  24372. k.reset()
  24373. })
  24374. },
  24375. stop: function() {
  24376. this.listener && this.listener.removeListener()
  24377. },
  24378. getRange: function() {
  24379. var a = {};
  24380. a[CKEDITOR.LINEUTILS_BEFORE] = CKEDITOR.POSITION_BEFORE_START;
  24381. a[CKEDITOR.LINEUTILS_AFTER] = CKEDITOR.POSITION_AFTER_END;
  24382. a[CKEDITOR.LINEUTILS_INSIDE] = CKEDITOR.POSITION_AFTER_START;
  24383. return function(d) {
  24384. var b = this.editor.createRange();
  24385. b.moveToPosition(this.relations[d.uid].element,
  24386. a[d.type]);
  24387. return b
  24388. }
  24389. }(),
  24390. store: function() {
  24391. function a(a, b, c) {
  24392. var e = a.getUniqueId();
  24393. e in c ? c[e].type |= b : c[e] = {
  24394. element: a,
  24395. type: b
  24396. }
  24397. }
  24398. return function(d, b) {
  24399. var c;
  24400. b & CKEDITOR.LINEUTILS_AFTER && l(c = d.getNext()) && c.isVisible() && (a(c, CKEDITOR.LINEUTILS_BEFORE, this.relations), b ^= CKEDITOR.LINEUTILS_AFTER);
  24401. b & CKEDITOR.LINEUTILS_INSIDE && l(c = d.getFirst()) && c.isVisible() && (a(c, CKEDITOR.LINEUTILS_BEFORE, this.relations), b ^= CKEDITOR.LINEUTILS_INSIDE);
  24402. a(d, b, this.relations)
  24403. }
  24404. }(),
  24405. traverseSearch: function(a) {
  24406. var d, b, c;
  24407. do
  24408. if (c = a.$["data-cke-expando"],
  24409. !(c && c in this.relations)) {
  24410. if (a.equals(this.editable)) break;
  24411. if (l(a))
  24412. for (d in this.lookups)(b = this.lookups[d](a)) && this.store(a, b)
  24413. } while ((!a || a.type != CKEDITOR.NODE_ELEMENT || "true" != a.getAttribute("contenteditable")) && (a = a.getParent()))
  24414. },
  24415. pixelSearch: function() {
  24416. function a(a, c, e, g, f) {
  24417. for (var h = 0, k; f(e);) {
  24418. e += g;
  24419. if (25 == ++h) break;
  24420. if (k = this.doc.$.elementFromPoint(c, e))
  24421. if (k == a) h = 0;
  24422. else if (d(a, k) && (h = 0, l(k = new CKEDITOR.dom.element(k)))) return k
  24423. }
  24424. }
  24425. var d = CKEDITOR.env.ie || CKEDITOR.env.webkit ? function(a, c) {
  24426. return a.contains(c)
  24427. } :
  24428. function(a, c) {
  24429. return !!(a.compareDocumentPosition(c) & 16)
  24430. };
  24431. return function(b, c, d) {
  24432. var g = this.win.getViewPaneSize().height,
  24433. f = a.call(this, b.$, c, d, -1, function(a) {
  24434. return 0 < a
  24435. });
  24436. c = a.call(this, b.$, c, d, 1, function(a) {
  24437. return a < g
  24438. });
  24439. if (f)
  24440. for (this.traverseSearch(f); !f.getParent().equals(b);) f = f.getParent();
  24441. if (c)
  24442. for (this.traverseSearch(c); !c.getParent().equals(b);) c = c.getParent();
  24443. for (; f || c;) {
  24444. f && (f = f.getNext(l));
  24445. if (!f || f.equals(c)) break;
  24446. this.traverseSearch(f);
  24447. c && (c = c.getPrevious(l));
  24448. if (!c || c.equals(f)) break;
  24449. this.traverseSearch(c)
  24450. }
  24451. }
  24452. }(),
  24453. greedySearch: function() {
  24454. this.relations = {};
  24455. for (var a = this.editable.getElementsByTag("*"), d = 0, b, c, e; b = a.getItem(d++);)
  24456. if (!b.equals(this.editable) && b.type == CKEDITOR.NODE_ELEMENT && (b.hasAttribute("contenteditable") || !b.isReadOnly()) && l(b) && b.isVisible())
  24457. for (e in this.lookups)(c = this.lookups[e](b)) && this.store(b, c);
  24458. return this.relations
  24459. }
  24460. };
  24461. n.prototype = {
  24462. locate: function() {
  24463. function a(a, b) {
  24464. var c = a.element[b === CKEDITOR.LINEUTILS_BEFORE ? "getPrevious" : "getNext"]();
  24465. return c && l(c) ? (a.siblingRect = c.getClientRect(),
  24466. b == CKEDITOR.LINEUTILS_BEFORE ? (a.siblingRect.bottom + a.elementRect.top) / 2 : (a.elementRect.bottom + a.siblingRect.top) / 2) : b == CKEDITOR.LINEUTILS_BEFORE ? a.elementRect.top : a.elementRect.bottom
  24467. }
  24468. return function(d) {
  24469. var b;
  24470. this.locations = {};
  24471. for (var c in d) b = d[c], b.elementRect = b.element.getClientRect(), b.type & CKEDITOR.LINEUTILS_BEFORE && this.store(c, CKEDITOR.LINEUTILS_BEFORE, a(b, CKEDITOR.LINEUTILS_BEFORE)), b.type & CKEDITOR.LINEUTILS_AFTER && this.store(c, CKEDITOR.LINEUTILS_AFTER, a(b, CKEDITOR.LINEUTILS_AFTER)), b.type &
  24472. CKEDITOR.LINEUTILS_INSIDE && this.store(c, CKEDITOR.LINEUTILS_INSIDE, (b.elementRect.top + b.elementRect.bottom) / 2);
  24473. return this.locations
  24474. }
  24475. }(),
  24476. sort: function() {
  24477. var a, d, b, c;
  24478. return function(e, g) {
  24479. a = this.locations;
  24480. d = [];
  24481. for (var f in a)
  24482. for (var h in a[f])
  24483. if (b = Math.abs(e - a[f][h]), d.length) {
  24484. for (c = 0; c < d.length; c++)
  24485. if (b < d[c].dist) {
  24486. d.splice(c, 0, {
  24487. uid: +f,
  24488. type: h,
  24489. dist: b
  24490. });
  24491. break
  24492. } c == d.length && d.push({
  24493. uid: +f,
  24494. type: h,
  24495. dist: b
  24496. })
  24497. } else d.push({
  24498. uid: +f,
  24499. type: h,
  24500. dist: b
  24501. });
  24502. return "undefined" != typeof g ? d.slice(0, g) : d
  24503. }
  24504. }(),
  24505. store: function(a,
  24506. d, b) {
  24507. this.locations[a] || (this.locations[a] = {});
  24508. this.locations[a][d] = b
  24509. }
  24510. };
  24511. var q = {
  24512. display: "block",
  24513. width: "0px",
  24514. height: "0px",
  24515. "border-color": "transparent",
  24516. "border-style": "solid",
  24517. position: "absolute",
  24518. top: "-6px"
  24519. },
  24520. t = {
  24521. height: "0px",
  24522. "border-top": "1px dashed red",
  24523. position: "absolute",
  24524. "z-index": 9999
  24525. };
  24526. p.prototype = {
  24527. removeAll: function() {
  24528. for (var a in this.hidden) this.hidden[a].remove(), delete this.hidden[a];
  24529. for (a in this.visible) this.visible[a].remove(), delete this.visible[a]
  24530. },
  24531. hideLine: function(a) {
  24532. var d = a.getUniqueId();
  24533. a.hide();
  24534. this.hidden[d] = a;
  24535. delete this.visible[d]
  24536. },
  24537. showLine: function(a) {
  24538. var d = a.getUniqueId();
  24539. a.show();
  24540. this.visible[d] = a;
  24541. delete this.hidden[d]
  24542. },
  24543. hideVisible: function() {
  24544. for (var a in this.visible) this.hideLine(this.visible[a])
  24545. },
  24546. placeLine: function(a, d) {
  24547. var b, c, e;
  24548. if (b = this.getStyle(a.uid, a.type)) {
  24549. for (e in this.visible)
  24550. if (this.visible[e].getCustomData("hash") !== this.hash) {
  24551. c = this.visible[e];
  24552. break
  24553. } if (!c)
  24554. for (e in this.hidden)
  24555. if (this.hidden[e].getCustomData("hash") !== this.hash) {
  24556. this.showLine(c = this.hidden[e]);
  24557. break
  24558. } c || this.showLine(c = this.addLine());
  24559. c.setCustomData("hash", this.hash);
  24560. this.visible[c.getUniqueId()] = c;
  24561. c.setStyles(b);
  24562. d && d(c)
  24563. }
  24564. },
  24565. getStyle: function(a, d) {
  24566. var b = this.relations[a],
  24567. c = this.locations[a][d],
  24568. e = {};
  24569. e.width = b.siblingRect ? Math.max(b.siblingRect.width, b.elementRect.width) : b.elementRect.width;
  24570. e.top = this.inline ? c + this.winTopScroll.y - this.rect.relativeY : this.rect.top + this.winTopScroll.y + c;
  24571. if (e.top - this.winTopScroll.y < this.rect.top || e.top - this.winTopScroll.y > this.rect.bottom) return !1;
  24572. this.inline ?
  24573. e.left = b.elementRect.left - this.rect.relativeX : (0 < b.elementRect.left ? e.left = this.rect.left + b.elementRect.left : (e.width += b.elementRect.left, e.left = this.rect.left), 0 < (b = e.left + e.width - (this.rect.left + this.winPane.width)) && (e.width -= b));
  24574. e.left += this.winTopScroll.x;
  24575. for (var g in e) e[g] = CKEDITOR.tools.cssLength(e[g]);
  24576. return e
  24577. },
  24578. addLine: function() {
  24579. var a = CKEDITOR.dom.element.createFromHtml(this.lineTpl);
  24580. a.appendTo(this.container);
  24581. return a
  24582. },
  24583. prepare: function(a, d) {
  24584. this.relations = a;
  24585. this.locations = d;
  24586. this.hash = Math.random()
  24587. },
  24588. cleanup: function() {
  24589. var a, d;
  24590. for (d in this.visible) a = this.visible[d], a.getCustomData("hash") !== this.hash && this.hideLine(a)
  24591. },
  24592. queryViewport: function() {
  24593. this.winPane = this.win.getViewPaneSize();
  24594. this.winTopScroll = this.winTop.getScrollPosition();
  24595. this.winTopPane = this.winTop.getViewPaneSize();
  24596. this.rect = this.getClientRect(this.inline ? this.editable : this.frame)
  24597. },
  24598. getClientRect: function(a) {
  24599. a = a.getClientRect();
  24600. var d = this.container.getDocumentPosition(),
  24601. b = this.container.getComputedStyle("position");
  24602. a.relativeX = a.relativeY =
  24603. 0;
  24604. "static" != b && (a.relativeY = d.y, a.relativeX = d.x, a.top -= a.relativeY, a.bottom -= a.relativeY, a.left -= a.relativeX, a.right -= a.relativeX);
  24605. return a
  24606. }
  24607. };
  24608. var r = {
  24609. left: 1,
  24610. right: 1,
  24611. center: 1
  24612. },
  24613. u = {
  24614. absolute: 1,
  24615. fixed: 1
  24616. };
  24617. CKEDITOR.plugins.lineutils = {
  24618. finder: m,
  24619. locator: n,
  24620. liner: p
  24621. }
  24622. })();
  24623. (function() {
  24624. function e(a) {
  24625. return a.getName && !a.hasAttribute("data-cke-temp")
  24626. }
  24627. CKEDITOR.plugins.add("widgetselection", {
  24628. init: function(a) {
  24629. if (CKEDITOR.env.webkit) {
  24630. var b = CKEDITOR.plugins.widgetselection;
  24631. a.on("contentDom", function(a) {
  24632. a = a.editor;
  24633. var c = a.editable();
  24634. c.attachListener(c, "keydown", function(a) {
  24635. a.data.getKeystroke() == CKEDITOR.CTRL + 65 && CKEDITOR.tools.setTimeout(function() {
  24636. b.addFillers(c) || b.removeFillers(c)
  24637. }, 0)
  24638. }, null, null, -1);
  24639. a.on("selectionCheck", function(a) {
  24640. b.removeFillers(a.editor.editable())
  24641. });
  24642. a.on("paste", function(a) {
  24643. a.data.dataValue = b.cleanPasteData(a.data.dataValue)
  24644. });
  24645. "selectall" in a.plugins && b.addSelectAllIntegration(a)
  24646. })
  24647. }
  24648. }
  24649. });
  24650. CKEDITOR.plugins.widgetselection = {
  24651. startFiller: null,
  24652. endFiller: null,
  24653. fillerAttribute: "data-cke-filler-webkit",
  24654. fillerContent: "\x26nbsp;",
  24655. fillerTagName: "div",
  24656. addFillers: function(a) {
  24657. var b = a.editor;
  24658. if (!this.isWholeContentSelected(a) && 0 < a.getChildCount()) {
  24659. var d = a.getFirst(e),
  24660. c = a.getLast(e);
  24661. d && d.type == CKEDITOR.NODE_ELEMENT && !d.isEditable() && (this.startFiller = this.createFiller(),
  24662. a.append(this.startFiller, 1));
  24663. c && c.type == CKEDITOR.NODE_ELEMENT && !c.isEditable() && (this.endFiller = this.createFiller(!0), a.append(this.endFiller, 0));
  24664. if (this.hasFiller(a)) return b = b.createRange(), b.selectNodeContents(a), b.select(), !0
  24665. }
  24666. return !1
  24667. },
  24668. removeFillers: function(a) {
  24669. if (this.hasFiller(a) && !this.isWholeContentSelected(a)) {
  24670. var b = a.findOne(this.fillerTagName + "[" + this.fillerAttribute + "\x3dstart]"),
  24671. d = a.findOne(this.fillerTagName + "[" + this.fillerAttribute + "\x3dend]");
  24672. this.startFiller && b && this.startFiller.equals(b) ?
  24673. this.removeFiller(this.startFiller, a) : this.startFiller = b;
  24674. this.endFiller && d && this.endFiller.equals(d) ? this.removeFiller(this.endFiller, a) : this.endFiller = d
  24675. }
  24676. },
  24677. cleanPasteData: function(a) {
  24678. a && a.length && (a = a.replace(this.createFillerRegex(), "").replace(this.createFillerRegex(!0), ""));
  24679. return a
  24680. },
  24681. isWholeContentSelected: function(a) {
  24682. var b = a.editor.getSelection().getRanges()[0];
  24683. return !b || b && b.collapsed ? !1 : (b = b.clone(), b.enlarge(CKEDITOR.ENLARGE_ELEMENT), !!(b && a && b.startContainer && b.endContainer && 0 === b.startOffset &&
  24684. b.endOffset === a.getChildCount() && b.startContainer.equals(a) && b.endContainer.equals(a)))
  24685. },
  24686. hasFiller: function(a) {
  24687. return 0 < a.find(this.fillerTagName + "[" + this.fillerAttribute + "]").count()
  24688. },
  24689. createFiller: function(a) {
  24690. var b = new CKEDITOR.dom.element(this.fillerTagName);
  24691. b.setHtml(this.fillerContent);
  24692. b.setAttribute(this.fillerAttribute, a ? "end" : "start");
  24693. b.setAttribute("data-cke-temp", 1);
  24694. b.setStyles({
  24695. display: "block",
  24696. width: 0,
  24697. height: 0,
  24698. padding: 0,
  24699. border: 0,
  24700. margin: 0,
  24701. position: "absolute",
  24702. top: 0,
  24703. left: "-9999px",
  24704. opacity: 0,
  24705. overflow: "hidden"
  24706. });
  24707. return b
  24708. },
  24709. removeFiller: function(a, b) {
  24710. if (a) {
  24711. var d = b.editor,
  24712. c = b.editor.getSelection().getRanges()[0].startPath(),
  24713. f = d.createRange(),
  24714. g, e;
  24715. c.contains(a) && (g = a.getHtml(), e = !0);
  24716. c = "start" == a.getAttribute(this.fillerAttribute);
  24717. a.remove();
  24718. g && 0 < g.length && g != this.fillerContent ? (b.insertHtmlIntoRange(g, d.getSelection().getRanges()[0]), f.setStartAt(b.getChild(b.getChildCount() - 1), CKEDITOR.POSITION_BEFORE_END), d.getSelection().selectRanges([f])) : e && (c ? f.setStartAt(b.getFirst().getNext(), CKEDITOR.POSITION_AFTER_START) :
  24719. f.setEndAt(b.getLast().getPrevious(), CKEDITOR.POSITION_BEFORE_END), b.editor.getSelection().selectRanges([f]))
  24720. }
  24721. },
  24722. createFillerRegex: function(a) {
  24723. var b = this.createFiller(a).getOuterHtml().replace(/style="[^"]*"/gi, 'style\x3d"[^"]*"').replace(/>[^<]*</gi, "\x3e[^\x3c]*\x3c");
  24724. return new RegExp((a ? "" : "^") + b + (a ? "$" : ""))
  24725. },
  24726. addSelectAllIntegration: function(a) {
  24727. var b = this;
  24728. a.editable().attachListener(a, "beforeCommandExec", function(d) {
  24729. var c = a.editable();
  24730. "selectAll" == d.data.name && c && b.addFillers(c)
  24731. }, null, null, 9999)
  24732. }
  24733. }
  24734. })();
  24735. (function() {
  24736. function p(a) {
  24737. this.editor = a;
  24738. this.registered = {};
  24739. this.instances = {};
  24740. this.selected = [];
  24741. this.widgetHoldingFocusedEditable = this.focused = null;
  24742. this._ = {
  24743. nextId: 0,
  24744. upcasts: [],
  24745. upcastCallbacks: [],
  24746. filters: {}
  24747. };
  24748. I(this);
  24749. J(this);
  24750. this.on("checkWidgets", K);
  24751. this.editor.on("contentDomInvalidated", this.checkWidgets, this);
  24752. L(this);
  24753. M(this);
  24754. N(this);
  24755. O(this);
  24756. P(this)
  24757. }
  24758. function g(a, b, c, d, e) {
  24759. var f = a.editor;
  24760. CKEDITOR.tools.extend(this, d, {
  24761. editor: f,
  24762. id: b,
  24763. inline: "span" == c.getParent().getName(),
  24764. element: c,
  24765. data: CKEDITOR.tools.extend({},
  24766. "function" == typeof d.defaults ? d.defaults() : d.defaults),
  24767. dataReady: !1,
  24768. inited: !1,
  24769. ready: !1,
  24770. edit: g.prototype.edit,
  24771. focusedEditable: null,
  24772. definition: d,
  24773. repository: a,
  24774. draggable: !1 !== d.draggable,
  24775. _: {
  24776. downcastFn: d.downcast && "string" == typeof d.downcast ? d.downcasts[d.downcast] : d.downcast
  24777. }
  24778. }, !0);
  24779. a.fire("instanceCreated", this);
  24780. Q(this, d);
  24781. this.init && this.init();
  24782. this.inited = !0;
  24783. (a = this.element.data("cke-widget-data")) && this.setData(JSON.parse(decodeURIComponent(a)));
  24784. e && this.setData(e);
  24785. this.data.classes || this.setData("classes",
  24786. this.getClasses());
  24787. this.dataReady = !0;
  24788. r(this);
  24789. this.fire("data", this.data);
  24790. this.isInited() && f.editable().contains(this.wrapper) && (this.ready = !0, this.fire("ready"))
  24791. }
  24792. function q(a, b, c) {
  24793. CKEDITOR.dom.element.call(this, b.$);
  24794. this.editor = a;
  24795. this._ = {};
  24796. b = this.filter = c.filter;
  24797. CKEDITOR.dtd[this.getName()].p ? (this.enterMode = b ? b.getAllowedEnterMode(a.enterMode) : a.enterMode, this.shiftEnterMode = b ? b.getAllowedEnterMode(a.shiftEnterMode, !0) : a.shiftEnterMode) : this.enterMode = this.shiftEnterMode = CKEDITOR.ENTER_BR
  24798. }
  24799. function R(a,
  24800. b) {
  24801. a.addCommand(b.name, {
  24802. exec: function(a, d) {
  24803. function e() {
  24804. a.widgets.finalizeCreation(k)
  24805. }
  24806. var f = a.widgets.focused;
  24807. if (f && f.name == b.name) f.edit();
  24808. else if (b.insert) b.insert();
  24809. else if (b.template) {
  24810. var f = "function" == typeof b.defaults ? b.defaults() : b.defaults,
  24811. f = CKEDITOR.dom.element.createFromHtml(b.template.output(f)),
  24812. h, l = a.widgets.wrapElement(f, b.name),
  24813. k = new CKEDITOR.dom.documentFragment(l.getDocument());
  24814. k.append(l);
  24815. (h = a.widgets.initOn(f, b, d && d.startupData)) ? (f = h.once("edit", function(b) {
  24816. if (b.data.dialog) h.once("dialog",
  24817. function(b) {
  24818. b = b.data;
  24819. var d, f;
  24820. d = b.once("ok", e, null, null, 20);
  24821. f = b.once("cancel", function(b) {
  24822. b.data && !1 === b.data.hide || a.widgets.destroy(h, !0)
  24823. });
  24824. b.once("hide", function() {
  24825. d.removeListener();
  24826. f.removeListener()
  24827. })
  24828. });
  24829. else e()
  24830. }, null, null, 999), h.edit(), f.removeListener()) : e()
  24831. }
  24832. },
  24833. allowedContent: b.allowedContent,
  24834. requiredContent: b.requiredContent,
  24835. contentForms: b.contentForms,
  24836. contentTransformations: b.contentTransformations
  24837. })
  24838. }
  24839. function S(a, b) {
  24840. function c(a, c) {
  24841. var d = b.upcast.split(","),
  24842. e, f;
  24843. for (f = 0; f < d.length; f++)
  24844. if (e =
  24845. d[f], e === a.name) return b.upcasts[e].call(this, a, c);
  24846. return !1
  24847. }
  24848. function d(b, c, d) {
  24849. var e = CKEDITOR.tools.getIndex(a._.upcasts, function(a) {
  24850. return a[2] > d
  24851. });
  24852. 0 > e && (e = a._.upcasts.length);
  24853. a._.upcasts.splice(e, 0, [CKEDITOR.tools.bind(b, c), c.name, d])
  24854. }
  24855. var e = b.upcast,
  24856. f = b.upcastPriority || 10;
  24857. e && ("string" == typeof e ? d(c, b, f) : d(e, b, f))
  24858. }
  24859. function t(a, b) {
  24860. a.focused = null;
  24861. if (b.isInited()) {
  24862. var c = b.editor.checkDirty();
  24863. a.fire("widgetBlurred", {
  24864. widget: b
  24865. });
  24866. b.setFocused(!1);
  24867. !c && b.editor.resetDirty()
  24868. }
  24869. }
  24870. function K(a) {
  24871. a = a.data;
  24872. if ("wysiwyg" ==
  24873. this.editor.mode) {
  24874. var b = this.editor.editable(),
  24875. c = this.instances,
  24876. d, e, f, h;
  24877. if (b) {
  24878. for (d in c) c[d].isReady() && !b.contains(c[d].wrapper) && this.destroy(c[d], !0);
  24879. if (a && a.initOnlyNew) c = this.initOnAll();
  24880. else {
  24881. var l = b.find(".cke_widget_wrapper"),
  24882. c = [];
  24883. d = 0;
  24884. for (e = l.count(); d < e; d++) {
  24885. f = l.getItem(d);
  24886. if (h = !this.getByElement(f, !0)) {
  24887. a: {
  24888. h = T;
  24889. for (var k = f; k = k.getParent();)
  24890. if (h(k)) {
  24891. h = !0;
  24892. break a
  24893. } h = !1
  24894. }
  24895. h = !h
  24896. }
  24897. h && b.contains(f) && (f.addClass("cke_widget_new"), c.push(this.initOn(f.getFirst(g.isDomWidgetElement))))
  24898. }
  24899. }
  24900. a && a.focusInited &&
  24901. 1 == c.length && c[0].focus()
  24902. }
  24903. }
  24904. }
  24905. function u(a) {
  24906. if ("undefined" != typeof a.attributes && a.attributes["data-widget"]) {
  24907. var b = v(a),
  24908. c = w(a),
  24909. d = !1;
  24910. b && b.value && b.value.match(/^\s/g) && (b.parent.attributes["data-cke-white-space-first"] = 1, b.value = b.value.replace(/^\s/g, "\x26nbsp;"), d = !0);
  24911. c && c.value && c.value.match(/\s$/g) && (c.parent.attributes["data-cke-white-space-last"] = 1, c.value = c.value.replace(/\s$/g, "\x26nbsp;"), d = !0);
  24912. d && (a.attributes["data-cke-widget-white-space"] = 1)
  24913. }
  24914. }
  24915. function v(a) {
  24916. return a.find(function(a) {
  24917. return 3 ===
  24918. a.type
  24919. }, !0).shift()
  24920. }
  24921. function w(a) {
  24922. return a.find(function(a) {
  24923. return 3 === a.type
  24924. }, !0).pop()
  24925. }
  24926. function x(a, b, c) {
  24927. if (!c.allowedContent && !c.disallowedContent) return null;
  24928. var d = this._.filters[a];
  24929. d || (this._.filters[a] = d = {});
  24930. a = d[b];
  24931. a || (a = c.allowedContent ? new CKEDITOR.filter(c.allowedContent) : this.editor.filter.clone(), d[b] = a, c.disallowedContent && a.disallow(c.disallowedContent));
  24932. return a
  24933. }
  24934. function U(a) {
  24935. var b = [],
  24936. c = a._.upcasts,
  24937. d = a._.upcastCallbacks;
  24938. return {
  24939. toBeWrapped: b,
  24940. iterator: function(a) {
  24941. var f, h, l, k, m;
  24942. if ("data-cke-widget-wrapper" in
  24943. a.attributes) return (a = a.getFirst(g.isParserWidgetElement)) && b.push([a]), !1;
  24944. if ("data-widget" in a.attributes) return b.push([a]), !1;
  24945. if (m = c.length) {
  24946. if (a.attributes["data-cke-widget-upcasted"]) return !1;
  24947. k = 0;
  24948. for (f = d.length; k < f; ++k)
  24949. if (!1 === d[k](a)) return;
  24950. for (k = 0; k < m; ++k)
  24951. if (f = c[k], l = {}, h = f[0](a, l)) return h instanceof CKEDITOR.htmlParser.element && (a = h), a.attributes["data-cke-widget-data"] = encodeURIComponent(JSON.stringify(l)), a.attributes["data-cke-widget-upcasted"] = 1, b.push([a, f[1]]), !1
  24952. }
  24953. }
  24954. }
  24955. }
  24956. function y(a, b) {
  24957. return {
  24958. tabindex: -1,
  24959. contenteditable: "false",
  24960. "data-cke-widget-wrapper": 1,
  24961. "data-cke-filter": "off",
  24962. "class": "cke_widget_wrapper cke_widget_new cke_widget_" + (a ? "inline" : "block") + (b ? " cke_widget_" + b : "")
  24963. }
  24964. }
  24965. function z(a, b, c) {
  24966. if (a.type == CKEDITOR.NODE_ELEMENT) {
  24967. var d = CKEDITOR.dtd[a.name];
  24968. if (d && !d[c.name]) {
  24969. var d = a.split(b),
  24970. e = a.parent;
  24971. b = d.getIndex();
  24972. a.children.length || (--b, a.remove());
  24973. d.children.length || d.remove();
  24974. return z(e, b, c)
  24975. }
  24976. }
  24977. a.add(c, b)
  24978. }
  24979. function A(a, b) {
  24980. return "boolean" == typeof a.inline ? a.inline : !!CKEDITOR.dtd.$inline[b]
  24981. }
  24982. function T(a) {
  24983. return a.hasAttribute("data-cke-temp")
  24984. }
  24985. function n(a, b, c, d) {
  24986. var e = a.editor;
  24987. e.fire("lockSnapshot");
  24988. c ? (d = c.data("cke-widget-editable"), d = b.editables[d], a.widgetHoldingFocusedEditable = b, b.focusedEditable = d, c.addClass("cke_widget_editable_focused"), d.filter && e.setActiveFilter(d.filter), e.setActiveEnterMode(d.enterMode, d.shiftEnterMode)) : (d || b.focusedEditable.removeClass("cke_widget_editable_focused"), b.focusedEditable = null, a.widgetHoldingFocusedEditable = null, e.setActiveFilter(null), e.setActiveEnterMode(null, null));
  24989. e.fire("unlockSnapshot")
  24990. }
  24991. function V(a) {
  24992. a.contextMenu && a.contextMenu.addListener(function(b) {
  24993. if (b = a.widgets.getByElement(b, !0)) return b.fire("contextMenu", {})
  24994. })
  24995. }
  24996. function W(a, b) {
  24997. return CKEDITOR.tools.trim(b)
  24998. }
  24999. function O(a) {
  25000. var b = a.editor,
  25001. c = CKEDITOR.plugins.lineutils;
  25002. b.on("dragstart", function(c) {
  25003. var e = c.data.target;
  25004. g.isDomDragHandler(e) && (e = a.getByElement(e), c.data.dataTransfer.setData("cke/widget-id", e.id), b.focus(), e.focus())
  25005. });
  25006. b.on("drop", function(c) {
  25007. var e = c.data.dataTransfer,
  25008. f = e.getData("cke/widget-id"),
  25009. h = e.getTransferType(b),
  25010. e = b.createRange();
  25011. "" !== f && h === CKEDITOR.DATA_TRANSFER_CROSS_EDITORS ? c.cancel() : "" !== f && h == CKEDITOR.DATA_TRANSFER_INTERNAL && (f = a.instances[f]) && (e.setStartBefore(f.wrapper), e.setEndAfter(f.wrapper), c.data.dragRange = e, delete CKEDITOR.plugins.clipboard.dragStartContainerChildCount, delete CKEDITOR.plugins.clipboard.dragEndContainerChildCount, c.data.dataTransfer.setData("text/html", b.editable().getHtmlFromRange(e).getHtml()), b.widgets.destroy(f, !0))
  25012. });
  25013. b.on("contentDom", function() {
  25014. var d = b.editable();
  25015. CKEDITOR.tools.extend(a, {
  25016. finder: new c.finder(b, {
  25017. lookups: {
  25018. "default": function(b) {
  25019. if (!b.is(CKEDITOR.dtd.$listItem) && b.is(CKEDITOR.dtd.$block) && !g.isDomNestedEditable(b) && !a._.draggedWidget.wrapper.contains(b)) {
  25020. var c = g.getNestedEditable(d, b);
  25021. if (c) {
  25022. b = a._.draggedWidget;
  25023. if (a.getByElement(c) == b) return;
  25024. c = CKEDITOR.filter.instances[c.data("cke-filter")];
  25025. b = b.requiredContent;
  25026. if (c && b && !c.check(b)) return
  25027. }
  25028. return CKEDITOR.LINEUTILS_BEFORE | CKEDITOR.LINEUTILS_AFTER
  25029. }
  25030. }
  25031. }
  25032. }),
  25033. locator: new c.locator(b),
  25034. liner: new c.liner(b, {
  25035. lineStyle: {
  25036. cursor: "move !important",
  25037. "border-top-color": "#666"
  25038. },
  25039. tipLeftStyle: {
  25040. "border-left-color": "#666"
  25041. },
  25042. tipRightStyle: {
  25043. "border-right-color": "#666"
  25044. }
  25045. })
  25046. }, !0)
  25047. })
  25048. }
  25049. function M(a) {
  25050. var b = a.editor;
  25051. b.on("contentDom", function() {
  25052. var c = b.editable(),
  25053. d = c.isInline() ? c : b.document,
  25054. e, f;
  25055. c.attachListener(d, "mousedown", function(c) {
  25056. var d = c.data.getTarget();
  25057. e = d instanceof CKEDITOR.dom.element ? a.getByElement(d) : null;
  25058. f = 0;
  25059. e && (e.inline && d.type == CKEDITOR.NODE_ELEMENT && d.hasAttribute("data-cke-widget-drag-handler") ? (f = 1, a.focused != e && b.getSelection().removeAllRanges()) :
  25060. g.getNestedEditable(e.wrapper, d) ? e = null : (c.data.preventDefault(), CKEDITOR.env.ie || e.focus()))
  25061. });
  25062. c.attachListener(d, "mouseup", function() {
  25063. f && e && e.wrapper && (f = 0, e.focus())
  25064. });
  25065. CKEDITOR.env.ie && c.attachListener(d, "mouseup", function() {
  25066. setTimeout(function() {
  25067. e && e.wrapper && c.contains(e.wrapper) && (e.focus(), e = null)
  25068. })
  25069. })
  25070. });
  25071. b.on("doubleclick", function(b) {
  25072. var d = a.getByElement(b.data.element);
  25073. if (d && !g.getNestedEditable(d.wrapper, b.data.element)) return d.fire("doubleclick", {
  25074. element: b.data.element
  25075. })
  25076. }, null, null, 1)
  25077. }
  25078. function N(a) {
  25079. a.editor.on("key", function(b) {
  25080. var c = a.focused,
  25081. d = a.widgetHoldingFocusedEditable,
  25082. e;
  25083. c ? e = c.fire("key", {
  25084. keyCode: b.data.keyCode
  25085. }) : d && (c = b.data.keyCode, b = d.focusedEditable, c == CKEDITOR.CTRL + 65 ? (c = b.getBogus(), d = d.editor.createRange(), d.selectNodeContents(b), c && d.setEndAt(c, CKEDITOR.POSITION_BEFORE_START), d.select(), e = !1) : 8 == c || 46 == c ? (e = d.editor.getSelection().getRanges(), d = e[0], e = !(1 == e.length && d.collapsed && d.checkBoundaryOfElement(b, CKEDITOR[8 == c ? "START" : "END"]))) : e = void 0);
  25086. return e
  25087. }, null,
  25088. null, 1)
  25089. }
  25090. function P(a) {
  25091. function b(b) {
  25092. a.focused && B(a.focused, "cut" == b.name)
  25093. }
  25094. var c = a.editor;
  25095. c.on("contentDom", function() {
  25096. var a = c.editable();
  25097. a.attachListener(a, "copy", b);
  25098. a.attachListener(a, "cut", b)
  25099. })
  25100. }
  25101. function L(a) {
  25102. var b = a.editor;
  25103. b.on("selectionCheck", function() {
  25104. a.fire("checkSelection")
  25105. });
  25106. a.on("checkSelection", a.checkSelection, a);
  25107. b.on("selectionChange", function(c) {
  25108. var d = (c = g.getNestedEditable(b.editable(), c.data.selection.getStartElement())) && a.getByElement(c),
  25109. e = a.widgetHoldingFocusedEditable;
  25110. e ? e === d &&
  25111. e.focusedEditable.equals(c) || (n(a, e, null), d && c && n(a, d, c)) : d && c && n(a, d, c)
  25112. });
  25113. b.on("dataReady", function() {
  25114. C(a).commit()
  25115. });
  25116. b.on("blur", function() {
  25117. var b;
  25118. (b = a.focused) && t(a, b);
  25119. (b = a.widgetHoldingFocusedEditable) && n(a, b, null)
  25120. })
  25121. }
  25122. function J(a) {
  25123. var b = a.editor,
  25124. c = {};
  25125. b.on("toDataFormat", function(b) {
  25126. var e = CKEDITOR.tools.getNextNumber(),
  25127. f = [];
  25128. b.data.downcastingSessionId = e;
  25129. c[e] = f;
  25130. b.data.dataValue.forEach(function(b) {
  25131. var c = b.attributes,
  25132. d;
  25133. if ("data-cke-widget-white-space" in c) {
  25134. d = v(b);
  25135. var e = w(b);
  25136. d.parent.attributes["data-cke-white-space-first"] &&
  25137. (d.value = d.value.replace(/^&nbsp;/g, " "));
  25138. e.parent.attributes["data-cke-white-space-last"] && (e.value = e.value.replace(/&nbsp;$/g, " "))
  25139. }
  25140. if ("data-cke-widget-id" in c) {
  25141. if (c = a.instances[c["data-cke-widget-id"]]) d = b.getFirst(g.isParserWidgetElement), f.push({
  25142. wrapper: b,
  25143. element: d,
  25144. widget: c,
  25145. editables: {}
  25146. }), "1" != d.attributes["data-cke-widget-keep-attr"] && delete d.attributes["data-widget"]
  25147. } else if ("data-cke-widget-editable" in c) return f[f.length - 1].editables[c["data-cke-widget-editable"]] = b, !1
  25148. }, CKEDITOR.NODE_ELEMENT,
  25149. !0)
  25150. }, null, null, 8);
  25151. b.on("toDataFormat", function(a) {
  25152. if (a.data.downcastingSessionId) {
  25153. a = c[a.data.downcastingSessionId];
  25154. for (var b, f, h, l, g, m; b = a.shift();) {
  25155. f = b.widget;
  25156. h = b.element;
  25157. l = f._.downcastFn && f._.downcastFn.call(f, h);
  25158. for (m in b.editables) g = b.editables[m], delete g.attributes.contenteditable, g.setHtml(f.editables[m].getData());
  25159. l || (l = h);
  25160. b.wrapper.replaceWith(l)
  25161. }
  25162. }
  25163. }, null, null, 13);
  25164. b.on("contentDomUnload", function() {
  25165. a.destroyAll(!0)
  25166. })
  25167. }
  25168. function I(a) {
  25169. var b = a.editor,
  25170. c, d;
  25171. b.on("toHtml", function(b) {
  25172. var d = U(a),
  25173. h;
  25174. for (b.data.dataValue.forEach(d.iterator, CKEDITOR.NODE_ELEMENT, !0); h = d.toBeWrapped.pop();) {
  25175. var l = h[0],
  25176. k = l.parent;
  25177. k.type == CKEDITOR.NODE_ELEMENT && k.attributes["data-cke-widget-wrapper"] && k.replaceWith(l);
  25178. a.wrapElement(h[0], h[1])
  25179. }
  25180. c = b.data.protectedWhitespaces ? 3 == b.data.dataValue.children.length && g.isParserWidgetWrapper(b.data.dataValue.children[1]) : 1 == b.data.dataValue.children.length && g.isParserWidgetWrapper(b.data.dataValue.children[0])
  25181. }, null, null, 8);
  25182. b.on("dataReady", function() {
  25183. if (d)
  25184. for (var c = b.editable().find(".cke_widget_wrapper"),
  25185. f, h, l = 0, k = c.count(); l < k; ++l) f = c.getItem(l), h = f.getFirst(g.isDomWidgetElement), h.type == CKEDITOR.NODE_ELEMENT && h.data("widget") ? (h.replace(f), a.wrapElement(h)) : f.remove();
  25186. d = 0;
  25187. a.destroyAll(!0);
  25188. a.initOnAll()
  25189. });
  25190. b.on("loadSnapshot", function(b) {
  25191. /data-cke-widget/.test(b.data) && (d = 1);
  25192. a.destroyAll(!0)
  25193. }, null, null, 9);
  25194. b.on("paste", function(a) {
  25195. a = a.data;
  25196. a.dataValue = a.dataValue.replace(X, W);
  25197. a.range && (a = g.getNestedEditable(b.editable(), a.range.startContainer)) && (a = CKEDITOR.filter.instances[a.data("cke-filter")]) &&
  25198. b.setActiveFilter(a)
  25199. });
  25200. b.on("afterInsertHtml", function(d) {
  25201. d.data.intoRange ? a.checkWidgets({
  25202. initOnlyNew: !0
  25203. }) : (b.fire("lockSnapshot"), a.checkWidgets({
  25204. initOnlyNew: !0,
  25205. focusInited: c
  25206. }), b.fire("unlockSnapshot"))
  25207. })
  25208. }
  25209. function C(a) {
  25210. var b = a.selected,
  25211. c = [],
  25212. d = b.slice(0),
  25213. e = null;
  25214. return {
  25215. select: function(a) {
  25216. 0 > CKEDITOR.tools.indexOf(b, a) && c.push(a);
  25217. a = CKEDITOR.tools.indexOf(d, a);
  25218. 0 <= a && d.splice(a, 1);
  25219. return this
  25220. },
  25221. focus: function(a) {
  25222. e = a;
  25223. return this
  25224. },
  25225. commit: function() {
  25226. var f = a.focused !== e,
  25227. h, g;
  25228. a.editor.fire("lockSnapshot");
  25229. for (f &&
  25230. (h = a.focused) && t(a, h); h = d.pop();) b.splice(CKEDITOR.tools.indexOf(b, h), 1), h.isInited() && (g = h.editor.checkDirty(), h.setSelected(!1), !g && h.editor.resetDirty());
  25231. f && e && (g = a.editor.checkDirty(), a.focused = e, a.fire("widgetFocused", {
  25232. widget: e
  25233. }), e.setFocused(!0), !g && a.editor.resetDirty());
  25234. for (; h = c.pop();) b.push(h), h.setSelected(!0);
  25235. a.editor.fire("unlockSnapshot")
  25236. }
  25237. }
  25238. }
  25239. function D(a, b, c) {
  25240. var d = 0;
  25241. b = E(b);
  25242. var e = a.data.classes || {},
  25243. f;
  25244. if (b) {
  25245. for (e = CKEDITOR.tools.clone(e); f = b.pop();) c ? e[f] || (d = e[f] = 1) : e[f] && (delete e[f],
  25246. d = 1);
  25247. d && a.setData("classes", e)
  25248. }
  25249. }
  25250. function F(a) {
  25251. a.cancel()
  25252. }
  25253. function B(a, b) {
  25254. var c = a.editor,
  25255. d = c.document,
  25256. e = CKEDITOR.env.edge && 16 <= CKEDITOR.env.version;
  25257. if (!d.getById("cke_copybin")) {
  25258. var f = !c.blockless && !CKEDITOR.env.ie || e ? "div" : "span",
  25259. e = d.createElement(f),
  25260. h = d.createElement(f),
  25261. f = CKEDITOR.env.ie && 9 > CKEDITOR.env.version;
  25262. h.setAttributes({
  25263. id: "cke_copybin",
  25264. "data-cke-temp": "1"
  25265. });
  25266. e.setStyles({
  25267. position: "absolute",
  25268. width: "1px",
  25269. height: "1px",
  25270. overflow: "hidden"
  25271. });
  25272. e.setStyle("ltr" == c.config.contentsLangDirection ? "left" :
  25273. "right", "-5000px");
  25274. var g = c.createRange();
  25275. g.setStartBefore(a.wrapper);
  25276. g.setEndAfter(a.wrapper);
  25277. e.setHtml('\x3cspan data-cke-copybin-start\x3d"1"\x3e​\x3c/span\x3e' + c.editable().getHtmlFromRange(g).getHtml() + '\x3cspan data-cke-copybin-end\x3d"1"\x3e​\x3c/span\x3e');
  25278. c.fire("saveSnapshot");
  25279. c.fire("lockSnapshot");
  25280. h.append(e);
  25281. c.editable().append(h);
  25282. var k = c.on("selectionChange", F, null, null, 0),
  25283. m = a.repository.on("checkSelection", F, null, null, 0);
  25284. if (f) var n = d.getDocumentElement().$,
  25285. p = n.scrollTop;
  25286. g = c.createRange();
  25287. g.selectNodeContents(e);
  25288. g.select();
  25289. f && (n.scrollTop = p);
  25290. setTimeout(function() {
  25291. b || a.focus();
  25292. h.remove();
  25293. k.removeListener();
  25294. m.removeListener();
  25295. c.fire("unlockSnapshot");
  25296. b && !c.readOnly && (a.repository.del(a), c.fire("saveSnapshot"))
  25297. }, 100)
  25298. }
  25299. }
  25300. function E(a) {
  25301. return (a = (a = a.getDefinition().attributes) && a["class"]) ? a.split(/\s+/) : null
  25302. }
  25303. function G() {
  25304. var a = CKEDITOR.document.getActive(),
  25305. b = this.editor,
  25306. c = b.editable();
  25307. (c.isInline() ? c : b.document.getWindow().getFrame()).equals(a) && b.focusManager.focus(c)
  25308. }
  25309. function H() {
  25310. CKEDITOR.env.gecko &&
  25311. this.editor.unlockSelection();
  25312. CKEDITOR.env.webkit || (this.editor.forceNextSelectionCheck(), this.editor.selectionChange(1))
  25313. }
  25314. function Y(a) {
  25315. var b = null;
  25316. a.on("data", function() {
  25317. var a = this.data.classes,
  25318. d;
  25319. if (b != a) {
  25320. for (d in b) a && a[d] || this.removeClass(d);
  25321. for (d in a) this.addClass(d);
  25322. b = a
  25323. }
  25324. })
  25325. }
  25326. function Z(a) {
  25327. a.on("data", function() {
  25328. if (a.wrapper) {
  25329. var b = this.getLabel ? this.getLabel() : this.editor.lang.widget.label.replace(/%1/, this.pathName || this.element.getName());
  25330. a.wrapper.setAttribute("role", "region");
  25331. a.wrapper.setAttribute("aria-label",
  25332. b)
  25333. }
  25334. }, null, null, 9999)
  25335. }
  25336. function aa(a) {
  25337. if (a.draggable) {
  25338. var b = a.editor,
  25339. c = a.wrapper.getLast(g.isDomDragHandlerContainer),
  25340. d;
  25341. c ? d = c.findOne("img") : (c = new CKEDITOR.dom.element("span", b.document), c.setAttributes({
  25342. "class": "cke_reset cke_widget_drag_handler_container",
  25343. style: "background:rgba(220,220,220,0.5);background-image:url(" + b.plugins.widget.path + "images/handle.png)"
  25344. }), d = new CKEDITOR.dom.element("img", b.document), d.setAttributes({
  25345. "class": "cke_reset cke_widget_drag_handler",
  25346. "data-cke-widget-drag-handler": "1",
  25347. src: CKEDITOR.tools.transparentImageData,
  25348. width: 15,
  25349. title: b.lang.widget.move,
  25350. height: 15,
  25351. role: "presentation"
  25352. }), a.inline && d.setAttribute("draggable", "true"), c.append(d), a.wrapper.append(c));
  25353. a.wrapper.on("dragover", function(a) {
  25354. a.data.preventDefault()
  25355. });
  25356. a.wrapper.on("mouseenter", a.updateDragHandlerPosition, a);
  25357. setTimeout(function() {
  25358. a.on("data", a.updateDragHandlerPosition, a)
  25359. }, 50);
  25360. if (!a.inline && (d.on("mousedown", ba, a), CKEDITOR.env.ie && 9 > CKEDITOR.env.version)) d.on("dragstart", function(a) {
  25361. a.data.preventDefault(!0)
  25362. });
  25363. a.dragHandlerContainer = c
  25364. }
  25365. }
  25366. function ba(a) {
  25367. function b() {
  25368. var b;
  25369. for (q.reset(); b = g.pop();) b.removeListener();
  25370. var c = k;
  25371. b = a.sender;
  25372. var d = this.repository.finder,
  25373. e = this.repository.liner,
  25374. f = this.editor,
  25375. h = this.editor.editable();
  25376. CKEDITOR.tools.isEmpty(e.visible) || (c = d.getRange(c[0]), this.focus(), f.fire("drop", {
  25377. dropRange: c,
  25378. target: c.startContainer
  25379. }));
  25380. h.removeClass("cke_widget_dragging");
  25381. e.hideVisible();
  25382. f.fire("dragend", {
  25383. target: b
  25384. })
  25385. }
  25386. if (CKEDITOR.tools.getMouseButton(a) === CKEDITOR.MOUSE_BUTTON_LEFT) {
  25387. var c = this.repository.finder,
  25388. d = this.repository.locator,
  25389. e = this.repository.liner,
  25390. f = this.editor,
  25391. h = f.editable(),
  25392. g = [],
  25393. k = [],
  25394. m, n;
  25395. this.repository._.draggedWidget = this;
  25396. var p = c.greedySearch(),
  25397. q = CKEDITOR.tools.eventsBuffer(50, function() {
  25398. m = d.locate(p);
  25399. k = d.sort(n, 1);
  25400. k.length && (e.prepare(p, m), e.placeLine(k[0]), e.cleanup())
  25401. });
  25402. h.addClass("cke_widget_dragging");
  25403. g.push(h.on("mousemove", function(a) {
  25404. n = a.data.$.clientY;
  25405. q.input()
  25406. }));
  25407. f.fire("dragstart", {
  25408. target: a.sender
  25409. });
  25410. g.push(f.document.once("mouseup", b, this));
  25411. h.isInline() || g.push(CKEDITOR.document.once("mouseup",
  25412. b, this))
  25413. }
  25414. }
  25415. function ca(a) {
  25416. var b, c, d = a.editables;
  25417. a.editables = {};
  25418. if (a.editables)
  25419. for (b in d) c = d[b], a.initEditable(b, "string" == typeof c ? {
  25420. selector: c
  25421. } : c)
  25422. }
  25423. function da(a) {
  25424. if (a.mask) {
  25425. var b = a.wrapper.findOne(".cke_widget_mask");
  25426. b || (b = new CKEDITOR.dom.element("img", a.editor.document), b.setAttributes({
  25427. src: CKEDITOR.tools.transparentImageData,
  25428. "class": "cke_reset cke_widget_mask"
  25429. }), a.wrapper.append(b));
  25430. a.mask = b
  25431. }
  25432. }
  25433. function ea(a) {
  25434. if (a.parts) {
  25435. var b = {},
  25436. c, d;
  25437. for (d in a.parts) c = a.wrapper.findOne(a.parts[d]), b[d] = c;
  25438. a.parts =
  25439. b
  25440. }
  25441. }
  25442. function Q(a, b) {
  25443. fa(a);
  25444. ea(a);
  25445. ca(a);
  25446. da(a);
  25447. aa(a);
  25448. Y(a);
  25449. Z(a);
  25450. if (CKEDITOR.env.ie && 9 > CKEDITOR.env.version) a.wrapper.on("dragstart", function(b) {
  25451. var d = b.data.getTarget();
  25452. g.getNestedEditable(a, d) || a.inline && g.isDomDragHandler(d) || b.data.preventDefault()
  25453. });
  25454. a.wrapper.removeClass("cke_widget_new");
  25455. a.element.addClass("cke_widget_element");
  25456. a.on("key", function(b) {
  25457. b = b.data.keyCode;
  25458. if (13 == b) a.edit();
  25459. else {
  25460. if (b == CKEDITOR.CTRL + 67 || b == CKEDITOR.CTRL + 88) {
  25461. B(a, b == CKEDITOR.CTRL + 88);
  25462. return
  25463. }
  25464. if (b in ga || CKEDITOR.CTRL & b || CKEDITOR.ALT &
  25465. b) return
  25466. }
  25467. return !1
  25468. }, null, null, 999);
  25469. a.on("doubleclick", function(b) {
  25470. a.edit() && b.cancel()
  25471. });
  25472. if (b.data) a.on("data", b.data);
  25473. if (b.edit) a.on("edit", b.edit)
  25474. }
  25475. function fa(a) {
  25476. (a.wrapper = a.element.getParent()).setAttribute("data-cke-widget-id", a.id)
  25477. }
  25478. function r(a) {
  25479. a.element.data("cke-widget-data", encodeURIComponent(JSON.stringify(a.data)))
  25480. }
  25481. function ha() {
  25482. function a() {}
  25483. function b(a, b, c) {
  25484. return c && this.checkElement(a) ? (a = c.widgets.getByElement(a, !0)) && a.checkStyleActive(this) : !1
  25485. }
  25486. var c = {};
  25487. CKEDITOR.style.addCustomHandler({
  25488. type: "widget",
  25489. setup: function(a) {
  25490. this.widget = a.widget;
  25491. if (this.group = "string" == typeof a.group ? [a.group] : a.group) {
  25492. a = this.widget;
  25493. var b;
  25494. c[a] || (c[a] = {});
  25495. for (var f = 0, h = this.group.length; f < h; f++) b = this.group[f], c[a][b] || (c[a][b] = []), c[a][b].push(this)
  25496. }
  25497. },
  25498. apply: function(a) {
  25499. var b;
  25500. a instanceof CKEDITOR.editor && this.checkApplicable(a.elementPath(), a) && (b = a.widgets.focused, this.group && this.removeStylesFromSameGroup(a), b.applyStyle(this))
  25501. },
  25502. remove: function(a) {
  25503. a instanceof CKEDITOR.editor && this.checkApplicable(a.elementPath(),
  25504. a) && a.widgets.focused.removeStyle(this)
  25505. },
  25506. removeStylesFromSameGroup: function(a) {
  25507. var b, f, h = !1;
  25508. if (!(a instanceof CKEDITOR.editor)) return !1;
  25509. f = a.elementPath();
  25510. if (this.checkApplicable(f, a))
  25511. for (var g = 0, k = this.group.length; g < k; g++) {
  25512. b = c[this.widget][this.group[g]];
  25513. for (var m = 0; m < b.length; m++) b[m] !== this && b[m].checkActive(f, a) && (a.widgets.focused.removeStyle(b[m]), h = !0)
  25514. }
  25515. return h
  25516. },
  25517. checkActive: function(a, b) {
  25518. return this.checkElementMatch(a.lastElement, 0, b)
  25519. },
  25520. checkApplicable: function(a, b) {
  25521. return b instanceof CKEDITOR.editor ?
  25522. this.checkElement(a.lastElement) : !1
  25523. },
  25524. checkElementMatch: b,
  25525. checkElementRemovable: b,
  25526. checkElement: function(a) {
  25527. return g.isDomWidgetWrapper(a) ? (a = a.getFirst(g.isDomWidgetElement)) && a.data("widget") == this.widget : !1
  25528. },
  25529. buildPreview: function(a) {
  25530. return a || this._.definition.name
  25531. },
  25532. toAllowedContentRules: function(a) {
  25533. if (!a) return null;
  25534. a = a.widgets.registered[this.widget];
  25535. var b, c = {};
  25536. if (!a) return null;
  25537. if (a.styleableElements) {
  25538. b = this.getClassesArray();
  25539. if (!b) return null;
  25540. c[a.styleableElements] = {
  25541. classes: b,
  25542. propertiesOnly: !0
  25543. };
  25544. return c
  25545. }
  25546. return a.styleToAllowedContentRules ? a.styleToAllowedContentRules(this) : null
  25547. },
  25548. getClassesArray: function() {
  25549. var a = this._.definition.attributes && this._.definition.attributes["class"];
  25550. return a ? CKEDITOR.tools.trim(a).split(/\s+/) : null
  25551. },
  25552. applyToRange: a,
  25553. removeFromRange: a,
  25554. applyToObject: a
  25555. })
  25556. }
  25557. CKEDITOR.plugins.add("widget", {
  25558. requires: "lineutils,clipboard,widgetselection",
  25559. onLoad: function() {
  25560. void 0 !== CKEDITOR.document.$.querySelectorAll && (CKEDITOR.addCss(".cke_widget_wrapper{position:relative;outline:none}.cke_widget_inline{display:inline-block}.cke_widget_wrapper:hover\x3e.cke_widget_element{outline:2px solid #ffd25c;cursor:default}.cke_widget_wrapper:hover .cke_widget_editable{outline:2px solid #ffd25c}.cke_widget_wrapper.cke_widget_focused\x3e.cke_widget_element,.cke_widget_wrapper .cke_widget_editable.cke_widget_editable_focused{outline:2px solid #47a4f5}.cke_widget_editable{cursor:text}.cke_widget_drag_handler_container{position:absolute;width:15px;height:0;display:none;opacity:0.75;transition:height 0s 0.2s;line-height:0}.cke_widget_wrapper:hover\x3e.cke_widget_drag_handler_container{height:15px;transition:none}.cke_widget_drag_handler_container:hover{opacity:1}img.cke_widget_drag_handler{cursor:move;width:15px;height:15px;display:inline-block}.cke_widget_mask{position:absolute;top:0;left:0;width:100%;height:100%;display:block}.cke_editable.cke_widget_dragging, .cke_editable.cke_widget_dragging *{cursor:move !important}"),
  25561. ha())
  25562. },
  25563. beforeInit: function(a) {
  25564. void 0 !== CKEDITOR.document.$.querySelectorAll && (a.widgets = new p(a))
  25565. },
  25566. afterInit: function(a) {
  25567. if (void 0 !== CKEDITOR.document.$.querySelectorAll) {
  25568. var b = a.widgets.registered,
  25569. c, d, e;
  25570. for (d in b) c = b[d], (e = c.button) && a.ui.addButton && a.ui.addButton(CKEDITOR.tools.capitalize(c.name, !0), {
  25571. label: e,
  25572. command: c.name,
  25573. toolbar: "insert,10"
  25574. });
  25575. V(a)
  25576. }
  25577. }
  25578. });
  25579. p.prototype = {
  25580. MIN_SELECTION_CHECK_INTERVAL: 500,
  25581. add: function(a, b) {
  25582. b = CKEDITOR.tools.prototypedCopy(b);
  25583. b.name = a;
  25584. b._ = b._ || {};
  25585. this.editor.fire("widgetDefinition",
  25586. b);
  25587. b.template && (b.template = new CKEDITOR.template(b.template));
  25588. R(this.editor, b);
  25589. S(this, b);
  25590. return this.registered[a] = b
  25591. },
  25592. addUpcastCallback: function(a) {
  25593. this._.upcastCallbacks.push(a)
  25594. },
  25595. checkSelection: function() {
  25596. var a = this.editor.getSelection(),
  25597. b = a.getSelectedElement(),
  25598. c = C(this),
  25599. d;
  25600. if (b && (d = this.getByElement(b, !0))) return c.focus(d).select(d).commit();
  25601. a = a.getRanges()[0];
  25602. if (!a || a.collapsed) return c.commit();
  25603. a = new CKEDITOR.dom.walker(a);
  25604. for (a.evaluator = g.isDomWidgetWrapper; b = a.next();) c.select(this.getByElement(b));
  25605. c.commit()
  25606. },
  25607. checkWidgets: function(a) {
  25608. this.fire("checkWidgets", CKEDITOR.tools.copy(a || {}))
  25609. },
  25610. del: function(a) {
  25611. if (this.focused === a) {
  25612. var b = a.editor,
  25613. c = b.createRange(),
  25614. d;
  25615. (d = c.moveToClosestEditablePosition(a.wrapper, !0)) || (d = c.moveToClosestEditablePosition(a.wrapper, !1));
  25616. d && b.getSelection().selectRanges([c])
  25617. }
  25618. a.wrapper.remove();
  25619. this.destroy(a, !0)
  25620. },
  25621. destroy: function(a, b) {
  25622. this.widgetHoldingFocusedEditable === a && n(this, a, null, b);
  25623. a.destroy(b);
  25624. delete this.instances[a.id];
  25625. this.fire("instanceDestroyed", a)
  25626. },
  25627. destroyAll: function(a,
  25628. b) {
  25629. var c, d, e = this.instances;
  25630. if (b && !a) {
  25631. d = b.find(".cke_widget_wrapper");
  25632. for (var e = d.count(), f = 0; f < e; ++f)(c = this.getByElement(d.getItem(f), !0)) && this.destroy(c)
  25633. } else
  25634. for (d in e) c = e[d], this.destroy(c, a)
  25635. },
  25636. finalizeCreation: function(a) {
  25637. (a = a.getFirst()) && g.isDomWidgetWrapper(a) && (this.editor.insertElement(a), a = this.getByElement(a), a.ready = !0, a.fire("ready"), a.focus())
  25638. },
  25639. getByElement: function() {
  25640. function a(a) {
  25641. return a.is(b) && a.data("cke-widget-id")
  25642. }
  25643. var b = {
  25644. div: 1,
  25645. span: 1
  25646. };
  25647. return function(b, d) {
  25648. if (!b) return null;
  25649. var e = a(b);
  25650. if (!d && !e) {
  25651. var f = this.editor.editable();
  25652. do b = b.getParent(); while (b && !b.equals(f) && !(e = a(b)))
  25653. }
  25654. return this.instances[e] || null
  25655. }
  25656. }(),
  25657. initOn: function(a, b, c) {
  25658. b ? "string" == typeof b && (b = this.registered[b]) : b = this.registered[a.data("widget")];
  25659. if (!b) return null;
  25660. var d = this.wrapElement(a, b.name);
  25661. return d ? d.hasClass("cke_widget_new") ? (a = new g(this, this._.nextId++, a, b, c), a.isInited() ? this.instances[a.id] = a : null) : this.getByElement(a) : null
  25662. },
  25663. initOnAll: function(a) {
  25664. a = (a || this.editor.editable()).find(".cke_widget_new");
  25665. for (var b = [], c, d = a.count(); d--;)(c = this.initOn(a.getItem(d).getFirst(g.isDomWidgetElement))) && b.push(c);
  25666. return b
  25667. },
  25668. onWidget: function(a) {
  25669. var b = Array.prototype.slice.call(arguments);
  25670. b.shift();
  25671. for (var c in this.instances) {
  25672. var d = this.instances[c];
  25673. d.name == a && d.on.apply(d, b)
  25674. }
  25675. this.on("instanceCreated", function(c) {
  25676. c = c.data;
  25677. c.name == a && c.on.apply(c, b)
  25678. })
  25679. },
  25680. parseElementClasses: function(a) {
  25681. if (!a) return null;
  25682. a = CKEDITOR.tools.trim(a).split(/\s+/);
  25683. for (var b, c = {}, d = 0; b = a.pop();) - 1 == b.indexOf("cke_") && (c[b] = d = 1);
  25684. return d ?
  25685. c : null
  25686. },
  25687. wrapElement: function(a, b) {
  25688. var c = null,
  25689. d, e;
  25690. if (a instanceof CKEDITOR.dom.element) {
  25691. b = b || a.data("widget");
  25692. d = this.registered[b];
  25693. if (!d) return null;
  25694. if ((c = a.getParent()) && c.type == CKEDITOR.NODE_ELEMENT && c.data("cke-widget-wrapper")) return c;
  25695. a.hasAttribute("data-cke-widget-keep-attr") || a.data("cke-widget-keep-attr", a.data("widget") ? 1 : 0);
  25696. a.data("widget", b);
  25697. (e = A(d, a.getName())) && u(a);
  25698. c = new CKEDITOR.dom.element(e ? "span" : "div");
  25699. c.setAttributes(y(e, b));
  25700. c.data("cke-display-name", d.pathName ? d.pathName : a.getName());
  25701. a.getParent(!0) && c.replace(a);
  25702. a.appendTo(c)
  25703. } else if (a instanceof CKEDITOR.htmlParser.element) {
  25704. b = b || a.attributes["data-widget"];
  25705. d = this.registered[b];
  25706. if (!d) return null;
  25707. if ((c = a.parent) && c.type == CKEDITOR.NODE_ELEMENT && c.attributes["data-cke-widget-wrapper"]) return c;
  25708. "data-cke-widget-keep-attr" in a.attributes || (a.attributes["data-cke-widget-keep-attr"] = a.attributes["data-widget"] ? 1 : 0);
  25709. b && (a.attributes["data-widget"] = b);
  25710. (e = A(d, a.name)) && u(a);
  25711. c = new CKEDITOR.htmlParser.element(e ? "span" : "div", y(e, b));
  25712. c.attributes["data-cke-display-name"] =
  25713. d.pathName ? d.pathName : a.name;
  25714. d = a.parent;
  25715. var f;
  25716. d && (f = a.getIndex(), a.remove());
  25717. c.add(a);
  25718. d && z(d, f, c)
  25719. }
  25720. return c
  25721. },
  25722. _tests_createEditableFilter: x
  25723. };
  25724. CKEDITOR.event.implementOn(p.prototype);
  25725. g.prototype = {
  25726. addClass: function(a) {
  25727. this.element.addClass(a);
  25728. this.wrapper.addClass(g.WRAPPER_CLASS_PREFIX + a)
  25729. },
  25730. applyStyle: function(a) {
  25731. D(this, a, 1)
  25732. },
  25733. checkStyleActive: function(a) {
  25734. a = E(a);
  25735. var b;
  25736. if (!a) return !1;
  25737. for (; b = a.pop();)
  25738. if (!this.hasClass(b)) return !1;
  25739. return !0
  25740. },
  25741. destroy: function(a) {
  25742. this.fire("destroy");
  25743. if (this.editables)
  25744. for (var b in this.editables) this.destroyEditable(b,
  25745. a);
  25746. a || ("0" == this.element.data("cke-widget-keep-attr") && this.element.removeAttribute("data-widget"), this.element.removeAttributes(["data-cke-widget-data", "data-cke-widget-keep-attr"]), this.element.removeClass("cke_widget_element"), this.element.replace(this.wrapper));
  25747. this.wrapper = null
  25748. },
  25749. destroyEditable: function(a, b) {
  25750. var c = this.editables[a];
  25751. c.removeListener("focus", H);
  25752. c.removeListener("blur", G);
  25753. this.editor.focusManager.remove(c);
  25754. b || (this.repository.destroyAll(!1, c), c.removeClass("cke_widget_editable"),
  25755. c.removeClass("cke_widget_editable_focused"), c.removeAttributes(["contenteditable", "data-cke-widget-editable", "data-cke-enter-mode"]));
  25756. delete this.editables[a]
  25757. },
  25758. edit: function() {
  25759. var a = {
  25760. dialog: this.dialog
  25761. },
  25762. b = this;
  25763. if (!1 === this.fire("edit", a) || !a.dialog) return !1;
  25764. this.editor.openDialog(a.dialog, function(a) {
  25765. var d, e;
  25766. !1 !== b.fire("dialog", a) && (d = a.on("show", function() {
  25767. a.setupContent(b)
  25768. }), e = a.on("ok", function() {
  25769. var d, e = b.on("data", function(a) {
  25770. d = 1;
  25771. a.cancel()
  25772. }, null, null, 0);
  25773. b.editor.fire("saveSnapshot");
  25774. a.commitContent(b);
  25775. e.removeListener();
  25776. d && (b.fire("data", b.data), b.editor.fire("saveSnapshot"))
  25777. }), a.once("hide", function() {
  25778. d.removeListener();
  25779. e.removeListener()
  25780. }))
  25781. });
  25782. return !0
  25783. },
  25784. getClasses: function() {
  25785. return this.repository.parseElementClasses(this.element.getAttribute("class"))
  25786. },
  25787. hasClass: function(a) {
  25788. return this.element.hasClass(a)
  25789. },
  25790. initEditable: function(a, b) {
  25791. var c = this._findOneNotNested(b.selector);
  25792. return c && c.is(CKEDITOR.dtd.$editable) ? (c = new q(this.editor, c, {
  25793. filter: x.call(this.repository, this.name, a, b)
  25794. }), this.editables[a] =
  25795. c, c.setAttributes({
  25796. contenteditable: "true",
  25797. "data-cke-widget-editable": a,
  25798. "data-cke-enter-mode": c.enterMode
  25799. }), c.filter && c.data("cke-filter", c.filter.id), c.addClass("cke_widget_editable"), c.removeClass("cke_widget_editable_focused"), b.pathName && c.data("cke-display-name", b.pathName), this.editor.focusManager.add(c), c.on("focus", H, this), CKEDITOR.env.ie && c.on("blur", G, this), c._.initialSetData = !0, c.setData(c.getHtml()), !0) : !1
  25800. },
  25801. _findOneNotNested: function(a) {
  25802. a = this.wrapper.find(a);
  25803. for (var b, c, d = 0; d < a.count(); d++)
  25804. if (b =
  25805. a.getItem(d), c = b.getAscendant(g.isDomWidgetWrapper), this.wrapper.equals(c)) return b;
  25806. return null
  25807. },
  25808. isInited: function() {
  25809. return !(!this.wrapper || !this.inited)
  25810. },
  25811. isReady: function() {
  25812. return this.isInited() && this.ready
  25813. },
  25814. focus: function() {
  25815. var a = this.editor.getSelection();
  25816. if (a) {
  25817. var b = this.editor.checkDirty();
  25818. a.fake(this.wrapper);
  25819. !b && this.editor.resetDirty()
  25820. }
  25821. this.editor.focus()
  25822. },
  25823. removeClass: function(a) {
  25824. this.element.removeClass(a);
  25825. this.wrapper.removeClass(g.WRAPPER_CLASS_PREFIX + a)
  25826. },
  25827. removeStyle: function(a) {
  25828. D(this,
  25829. a, 0)
  25830. },
  25831. setData: function(a, b) {
  25832. var c = this.data,
  25833. d = 0;
  25834. if ("string" == typeof a) c[a] !== b && (c[a] = b, d = 1);
  25835. else {
  25836. var e = a;
  25837. for (a in e) c[a] !== e[a] && (d = 1, c[a] = e[a])
  25838. }
  25839. d && this.dataReady && (r(this), this.fire("data", c));
  25840. return this
  25841. },
  25842. setFocused: function(a) {
  25843. this.wrapper[a ? "addClass" : "removeClass"]("cke_widget_focused");
  25844. this.fire(a ? "focus" : "blur");
  25845. return this
  25846. },
  25847. setSelected: function(a) {
  25848. this.wrapper[a ? "addClass" : "removeClass"]("cke_widget_selected");
  25849. this.fire(a ? "select" : "deselect");
  25850. return this
  25851. },
  25852. updateDragHandlerPosition: function() {
  25853. var a =
  25854. this.editor,
  25855. b = this.element.$,
  25856. c = this._.dragHandlerOffset,
  25857. b = {
  25858. x: b.offsetLeft,
  25859. y: b.offsetTop - 15
  25860. };
  25861. c && b.x == c.x && b.y == c.y || (c = a.checkDirty(), a.fire("lockSnapshot"), this.dragHandlerContainer.setStyles({
  25862. top: b.y + "px",
  25863. left: b.x + "px",
  25864. display: "block"
  25865. }), a.fire("unlockSnapshot"), !c && a.resetDirty(), this._.dragHandlerOffset = b)
  25866. }
  25867. };
  25868. CKEDITOR.event.implementOn(g.prototype);
  25869. g.getNestedEditable = function(a, b) {
  25870. return !b || b.equals(a) ? null : g.isDomNestedEditable(b) ? b : g.getNestedEditable(a, b.getParent())
  25871. };
  25872. g.isDomDragHandler = function(a) {
  25873. return a.type ==
  25874. CKEDITOR.NODE_ELEMENT && a.hasAttribute("data-cke-widget-drag-handler")
  25875. };
  25876. g.isDomDragHandlerContainer = function(a) {
  25877. return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_widget_drag_handler_container")
  25878. };
  25879. g.isDomNestedEditable = function(a) {
  25880. return a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("data-cke-widget-editable")
  25881. };
  25882. g.isDomWidgetElement = function(a) {
  25883. return a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("data-widget")
  25884. };
  25885. g.isDomWidgetWrapper = function(a) {
  25886. return a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("data-cke-widget-wrapper")
  25887. };
  25888. g.isDomWidget = function(a) {
  25889. return a ? this.isDomWidgetWrapper(a) || this.isDomWidgetElement(a) : !1
  25890. };
  25891. g.isParserWidgetElement = function(a) {
  25892. return a.type == CKEDITOR.NODE_ELEMENT && !!a.attributes["data-widget"]
  25893. };
  25894. g.isParserWidgetWrapper = function(a) {
  25895. return a.type == CKEDITOR.NODE_ELEMENT && !!a.attributes["data-cke-widget-wrapper"]
  25896. };
  25897. g.WRAPPER_CLASS_PREFIX = "cke_widget_wrapper_";
  25898. q.prototype = CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.dom.element.prototype), {
  25899. setData: function(a) {
  25900. this._.initialSetData ||
  25901. this.editor.widgets.destroyAll(!1, this);
  25902. this._.initialSetData = !1;
  25903. a = this.editor.dataProcessor.toHtml(a, {
  25904. context: this.getName(),
  25905. filter: this.filter,
  25906. enterMode: this.enterMode
  25907. });
  25908. this.setHtml(a);
  25909. this.editor.widgets.initOnAll(this)
  25910. },
  25911. getData: function() {
  25912. return this.editor.dataProcessor.toDataFormat(this.getHtml(), {
  25913. context: this.getName(),
  25914. filter: this.filter,
  25915. enterMode: this.enterMode
  25916. })
  25917. }
  25918. });
  25919. var X = /^(?:<(?:div|span)(?: data-cke-temp="1")?(?: id="cke_copybin")?(?: data-cke-temp="1")?>)?(?:<(?:div|span)(?: style="[^"]+")?>)?<span [^>]*data-cke-copybin-start="1"[^>]*>.?<\/span>([\s\S]+)<span [^>]*data-cke-copybin-end="1"[^>]*>.?<\/span>(?:<\/(?:div|span)>)?(?:<\/(?:div|span)>)?$/i,
  25920. ga = {
  25921. 37: 1,
  25922. 38: 1,
  25923. 39: 1,
  25924. 40: 1,
  25925. 8: 1,
  25926. 46: 1
  25927. };
  25928. CKEDITOR.plugins.widget = g;
  25929. g.repository = p;
  25930. g.nestedEditable = q
  25931. })();
  25932. (function() {
  25933. function e(a, b, c) {
  25934. this.editor = a;
  25935. this.notification = null;
  25936. this._message = new CKEDITOR.template(b);
  25937. this._singularMessage = c ? new CKEDITOR.template(c) : null;
  25938. this._tasks = [];
  25939. this._doneTasks = this._doneWeights = this._totalWeights = 0
  25940. }
  25941. function d(a) {
  25942. this._weight = a || 1;
  25943. this._doneWeight = 0;
  25944. this._isCanceled = !1
  25945. }
  25946. CKEDITOR.plugins.add("notificationaggregator", {
  25947. requires: "notification"
  25948. });
  25949. e.prototype = {
  25950. createTask: function(a) {
  25951. a = a || {};
  25952. var b = !this.notification,
  25953. c;
  25954. b && (this.notification = this._createNotification());
  25955. c = this._addTask(a);
  25956. c.on("updated", this._onTaskUpdate, this);
  25957. c.on("done", this._onTaskDone, this);
  25958. c.on("canceled", function() {
  25959. this._removeTask(c)
  25960. }, this);
  25961. this.update();
  25962. b && this.notification.show();
  25963. return c
  25964. },
  25965. update: function() {
  25966. this._updateNotification();
  25967. this.isFinished() && this.fire("finished")
  25968. },
  25969. getPercentage: function() {
  25970. return 0 === this.getTaskCount() ? 1 : this._doneWeights / this._totalWeights
  25971. },
  25972. isFinished: function() {
  25973. return this.getDoneTaskCount() === this.getTaskCount()
  25974. },
  25975. getTaskCount: function() {
  25976. return this._tasks.length
  25977. },
  25978. getDoneTaskCount: function() {
  25979. return this._doneTasks
  25980. },
  25981. _updateNotification: function() {
  25982. this.notification.update({
  25983. message: this._getNotificationMessage(),
  25984. progress: this.getPercentage()
  25985. })
  25986. },
  25987. _getNotificationMessage: function() {
  25988. var a = this.getTaskCount(),
  25989. b = {
  25990. current: this.getDoneTaskCount(),
  25991. max: a,
  25992. percentage: Math.round(100 * this.getPercentage())
  25993. };
  25994. return (1 == a && this._singularMessage ? this._singularMessage : this._message).output(b)
  25995. },
  25996. _createNotification: function() {
  25997. return new CKEDITOR.plugins.notification(this.editor, {
  25998. type: "progress"
  25999. })
  26000. },
  26001. _addTask: function(a) {
  26002. a = new d(a.weight);
  26003. this._tasks.push(a);
  26004. this._totalWeights += a._weight;
  26005. return a
  26006. },
  26007. _removeTask: function(a) {
  26008. var b = CKEDITOR.tools.indexOf(this._tasks, a); - 1 !== b && (a._doneWeight && (this._doneWeights -= a._doneWeight), this._totalWeights -= a._weight, this._tasks.splice(b, 1), this.update())
  26009. },
  26010. _onTaskUpdate: function(a) {
  26011. this._doneWeights += a.data;
  26012. this.update()
  26013. },
  26014. _onTaskDone: function() {
  26015. this._doneTasks += 1;
  26016. this.update()
  26017. }
  26018. };
  26019. CKEDITOR.event.implementOn(e.prototype);
  26020. d.prototype = {
  26021. done: function() {
  26022. this.update(this._weight)
  26023. },
  26024. update: function(a) {
  26025. if (!this.isDone() &&
  26026. !this.isCanceled()) {
  26027. a = Math.min(this._weight, a);
  26028. var b = a - this._doneWeight;
  26029. this._doneWeight = a;
  26030. this.fire("updated", b);
  26031. this.isDone() && this.fire("done")
  26032. }
  26033. },
  26034. cancel: function() {
  26035. this.isDone() || this.isCanceled() || (this._isCanceled = !0, this.fire("canceled"))
  26036. },
  26037. isDone: function() {
  26038. return this._weight === this._doneWeight
  26039. },
  26040. isCanceled: function() {
  26041. return this._isCanceled
  26042. }
  26043. };
  26044. CKEDITOR.event.implementOn(d.prototype);
  26045. CKEDITOR.plugins.notificationAggregator = e;
  26046. CKEDITOR.plugins.notificationAggregator.task = d
  26047. })();
  26048. (function() {
  26049. CKEDITOR.plugins.add("uploadwidget", {
  26050. requires: "widget,clipboard,filetools,notificationaggregator",
  26051. init: function(a) {
  26052. a.filter.allow("*[!data-widget,!data-cke-upload-id]")
  26053. }
  26054. });
  26055. CKEDITOR.fileTools || (CKEDITOR.fileTools = {});
  26056. CKEDITOR.tools.extend(CKEDITOR.fileTools, {
  26057. addUploadWidget: function(a, c, f) {
  26058. var h = CKEDITOR.fileTools,
  26059. b = a.uploadRepository,
  26060. m = f.supportedTypes ? 10 : 20;
  26061. if (f.fileToElement) a.on("paste", function(d) {
  26062. d = d.data;
  26063. var l = a.widgets.registered[c],
  26064. k = d.dataTransfer,
  26065. f = k.getFilesCount(),
  26066. g = l.loadMethod ||
  26067. "loadAndUpload",
  26068. e, n;
  26069. if (!d.dataValue && f)
  26070. for (n = 0; n < f; n++)
  26071. if (e = k.getFile(n), !l.supportedTypes || h.isTypeSupported(e, l.supportedTypes)) {
  26072. var m = l.fileToElement(e);
  26073. e = b.create(e, void 0, l.loaderType);
  26074. m && (e[g](l.uploadUrl, l.additionalRequestParameters), CKEDITOR.fileTools.markElement(m, c, e.id), "loadAndUpload" != g && "upload" != g || l.skipNotifications || CKEDITOR.fileTools.bindNotifications(a, e), d.dataValue += m.getOuterHtml())
  26075. }
  26076. }, null, null, m);
  26077. CKEDITOR.tools.extend(f, {
  26078. downcast: function() {
  26079. return new CKEDITOR.htmlParser.text("")
  26080. },
  26081. init: function() {
  26082. var d = this,
  26083. c = this.wrapper.findOne("[data-cke-upload-id]").data("cke-upload-id"),
  26084. k = b.loaders[c],
  26085. f = CKEDITOR.tools.capitalize,
  26086. g, e;
  26087. k.on("update", function(b) {
  26088. if (d.wrapper && d.wrapper.getParent()) {
  26089. a.fire("lockSnapshot");
  26090. b = "on" + f(k.status);
  26091. if ("function" !== typeof d[b] || !1 !== d[b](k)) e = "cke_upload_" + k.status, d.wrapper && e != g && (g && d.wrapper.removeClass(g), d.wrapper.addClass(e), g = e), "error" != k.status && "abort" != k.status || a.widgets.del(d);
  26092. a.fire("unlockSnapshot")
  26093. } else CKEDITOR.instances[a.name] &&
  26094. a.editable().find('[data-cke-upload-id\x3d"' + c + '"]').count() || k.abort(), b.removeListener()
  26095. });
  26096. k.update()
  26097. },
  26098. replaceWith: function(d, c) {
  26099. if ("" === d.trim()) a.widgets.del(this);
  26100. else {
  26101. var b = this == a.widgets.focused,
  26102. f = a.editable(),
  26103. g = a.createRange(),
  26104. e, h;
  26105. b || (h = a.getSelection().createBookmarks());
  26106. g.setStartBefore(this.wrapper);
  26107. g.setEndAfter(this.wrapper);
  26108. b && (e = g.createBookmark());
  26109. f.insertHtmlIntoRange(d, g, c);
  26110. a.widgets.checkWidgets({
  26111. initOnlyNew: !0
  26112. });
  26113. a.widgets.destroy(this, !0);
  26114. b ? (g.moveToBookmark(e), g.select()) : a.getSelection().selectBookmarks(h)
  26115. }
  26116. },
  26117. _getLoader: function() {
  26118. var a = this.wrapper.findOne("[data-cke-upload-id]");
  26119. return a ? this.editor.uploadRepository.loaders[a.data("cke-upload-id")] : null
  26120. }
  26121. });
  26122. a.widgets.add(c, f)
  26123. },
  26124. markElement: function(a, c, f) {
  26125. a.setAttributes({
  26126. "data-cke-upload-id": f,
  26127. "data-widget": c
  26128. })
  26129. },
  26130. bindNotifications: function(a, c) {
  26131. function f() {
  26132. h = a._.uploadWidgetNotificaionAggregator;
  26133. if (!h || h.isFinished()) h = a._.uploadWidgetNotificaionAggregator = new CKEDITOR.plugins.notificationAggregator(a, a.lang.uploadwidget.uploadMany, a.lang.uploadwidget.uploadOne),
  26134. h.once("finished", function() {
  26135. var b = h.getTaskCount();
  26136. 0 === b ? h.notification.hide() : h.notification.update({
  26137. message: 1 == b ? a.lang.uploadwidget.doneOne : a.lang.uploadwidget.doneMany.replace("%1", b),
  26138. type: "success",
  26139. important: 1
  26140. })
  26141. })
  26142. }
  26143. var h, b = null;
  26144. c.on("update", function() {
  26145. !b && c.uploadTotal && (f(), b = h.createTask({
  26146. weight: c.uploadTotal
  26147. }));
  26148. b && "uploading" == c.status && b.update(c.uploaded)
  26149. });
  26150. c.on("uploaded", function() {
  26151. b && b.done()
  26152. });
  26153. c.on("error", function() {
  26154. b && b.cancel();
  26155. a.showNotification(c.message, "warning")
  26156. });
  26157. c.on("abort",
  26158. function() {
  26159. b && b.cancel();
  26160. CKEDITOR.instances[a.name] && a.showNotification(a.lang.uploadwidget.abort, "info")
  26161. })
  26162. }
  26163. })
  26164. })();
  26165. (function() {
  26166. function l(c) {
  26167. 9 >= c && (c = "0" + c);
  26168. return String(c)
  26169. }
  26170. function n(c) {
  26171. var a = new Date,
  26172. a = [a.getFullYear(), a.getMonth() + 1, a.getDate(), a.getHours(), a.getMinutes(), a.getSeconds()];
  26173. e += 1;
  26174. return "image-" + CKEDITOR.tools.array.map(a, l).join("") + "-" + e + "." + c
  26175. }
  26176. var e = 0;
  26177. CKEDITOR.plugins.add("uploadimage", {
  26178. requires: "uploadwidget",
  26179. onLoad: function() {
  26180. CKEDITOR.addCss(".cke_upload_uploading img{opacity: 0.3}")
  26181. },
  26182. init: function(c) {
  26183. if (CKEDITOR.plugins.clipboard.isFileApiSupported) {
  26184. var a = CKEDITOR.fileTools,
  26185. e = a.getUploadUrl(c.config,
  26186. "image");
  26187. e && (a.addUploadWidget(c, "uploadimage", {
  26188. supportedTypes: /image\/(jpeg|png|gif|bmp)/,
  26189. uploadUrl: e,
  26190. fileToElement: function() {
  26191. var b = new CKEDITOR.dom.element("img");
  26192. b.setAttribute("src", "data:image/gif;base64,R0lGODlhDgAOAIAAAAAAAP///yH5BAAAAAAALAAAAAAOAA4AAAIMhI+py+0Po5y02qsKADs\x3d");
  26193. return b
  26194. },
  26195. parts: {
  26196. img: "img"
  26197. },
  26198. onUploading: function(b) {
  26199. this.parts.img.setAttribute("src", b.data)
  26200. },
  26201. onUploaded: function(b) {
  26202. var a = this.parts.img.$;
  26203. this.replaceWith('\x3cimg src\x3d"' + b.url + '" width\x3d"' + (b.responseData.width ||
  26204. a.naturalWidth) + '" height\x3d"' + (b.responseData.height || a.naturalHeight) + '"\x3e')
  26205. }
  26206. }), c.on("paste", function(b) {
  26207. if (b.data.dataValue.match(/<img[\s\S]+data:/i)) {
  26208. b = b.data;
  26209. var f = document.implementation.createHTMLDocument(""),
  26210. f = new CKEDITOR.dom.element(f.body),
  26211. m, g, k;
  26212. f.data("cke-editable", 1);
  26213. f.appendHtml(b.dataValue);
  26214. m = f.find("img");
  26215. for (k = 0; k < m.count(); k++) {
  26216. g = m.getItem(k);
  26217. var d = g.getAttribute("src"),
  26218. h = d && "data:" == d.substring(0, 5),
  26219. l = null === g.data("cke-realelement");
  26220. h && l && !g.data("cke-upload-id") && !g.isReadOnly(1) &&
  26221. (h = (h = d.match(/image\/([a-z]+?);/i)) && h[1] || "jpg", d = c.uploadRepository.create(d, n(h)), d.upload(e), a.markElement(g, "uploadimage", d.id), a.bindNotifications(c, d))
  26222. }
  26223. b.dataValue = f.getHtml()
  26224. }
  26225. }))
  26226. }
  26227. }
  26228. })
  26229. })();
  26230. CKEDITOR.plugins.add("wsc", {
  26231. requires: "dialog",
  26232. parseApi: function(a) {
  26233. a.config.wsc_onFinish = "function" === typeof a.config.wsc_onFinish ? a.config.wsc_onFinish : function() {};
  26234. a.config.wsc_onClose = "function" === typeof a.config.wsc_onClose ? a.config.wsc_onClose : function() {}
  26235. },
  26236. parseConfig: function(a) {
  26237. a.config.wsc_customerId = a.config.wsc_customerId || CKEDITOR.config.wsc_customerId || "1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk";
  26238. a.config.wsc_customDictionaryIds = a.config.wsc_customDictionaryIds ||
  26239. CKEDITOR.config.wsc_customDictionaryIds || "";
  26240. a.config.wsc_userDictionaryName = a.config.wsc_userDictionaryName || CKEDITOR.config.wsc_userDictionaryName || "";
  26241. a.config.wsc_customLoaderScript = a.config.wsc_customLoaderScript || CKEDITOR.config.wsc_customLoaderScript;
  26242. a.config.wsc_interfaceLang = a.config.wsc_interfaceLang;
  26243. CKEDITOR.config.wsc_cmd = a.config.wsc_cmd || CKEDITOR.config.wsc_cmd || "spell";
  26244. CKEDITOR.config.wsc_version = "v4.3.0-master-d769233";
  26245. CKEDITOR.config.wsc_removeGlobalVariable = !0
  26246. },
  26247. onLoad: function(a) {
  26248. "moono-lisa" ==
  26249. (CKEDITOR.skinName || a.config.skin) && CKEDITOR.document.appendStyleSheet(this.path + "skins/" + CKEDITOR.skin.name + "/wsc.css")
  26250. },
  26251. init: function(a) {
  26252. var b = CKEDITOR.env;
  26253. this.parseConfig(a);
  26254. this.parseApi(a);
  26255. a.addCommand("checkspell", new CKEDITOR.dialogCommand("checkspell")).modes = {
  26256. wysiwyg: !CKEDITOR.env.opera && !CKEDITOR.env.air && document.domain == window.location.hostname && !(b.ie && (8 > b.version || b.quirks))
  26257. };
  26258. "undefined" == typeof a.plugins.scayt && a.ui.addButton && a.ui.addButton("SpellChecker", {
  26259. label: a.lang.wsc.toolbar,
  26260. click: function(a) {
  26261. var b = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.container.getText() : a.document.getBody().getText();
  26262. (b = b.replace(/\s/g, "")) ? a.execCommand("checkspell"): alert("Nothing to check!")
  26263. },
  26264. toolbar: "spellchecker,10"
  26265. });
  26266. CKEDITOR.dialog.add("checkspell", this.path + (CKEDITOR.env.ie && 7 >= CKEDITOR.env.version ? "dialogs/wsc_ie.js" : window.postMessage ? "dialogs/wsc.js" : "dialogs/wsc_ie.js"))
  26267. }
  26268. });
  26269. CKEDITOR.config.plugins = 'dialogui,dialog,about,a11yhelp,dialogadvtab,basicstyles,bidi,blockquote,notification,button,toolbar,clipboard,panelbutton,panel,floatpanel,colorbutton,colordialog,templates,menu,contextmenu,copyformatting,div,resize,elementspath,enterkey,entities,popup,filetools,filebrowser,find,fakeobjects,flash,floatingspace,listblock,richcombo,font,forms,format,horizontalrule,htmlwriter,iframe,wysiwygarea,image,indent,indentblock,indentlist,smiley,justify,menubutton,language,link,list,liststyle,magicline,maximize,newpage,pagebreak,pastetext,pastefromword,preview,print,removeformat,save,selectall,showblocks,showborders,sourcearea,specialchar,scayt,stylescombo,tab,table,tabletools,tableselection,undo,lineutils,widgetselection,widget,notificationaggregator,uploadwidget,uploadimage,wsc';
  26270. CKEDITOR.config.skin = 'moono-lisa';
  26271. (function() {
  26272. var setIcons = function(icons, strip) {
  26273. var path = CKEDITOR.getUrl('plugins/' + strip);
  26274. icons = icons.split(',');
  26275. for (var i = 0; i < icons.length; i++) CKEDITOR.skin.icons[icons[i]] = {
  26276. path: path,
  26277. offset: -icons[++i],
  26278. bgsize: icons[++i]
  26279. };
  26280. };
  26281. if (CKEDITOR.env.hidpi) setIcons('about,0,,bold,24,,italic,48,,strike,72,,subscript,96,,superscript,120,,underline,144,,bidiltr,168,,bidirtl,192,,blockquote,216,,copy-rtl,240,,copy,264,,cut-rtl,288,,cut,312,,paste-rtl,336,,paste,360,,bgcolor,384,,textcolor,408,,templates-rtl,432,,templates,456,,copyformatting,480,,creatediv,504,,find-rtl,528,,find,552,,replace,576,,flash,600,,button,624,,checkbox,648,,form,672,,hiddenfield,696,,imagebutton,720,,radio,744,,select-rtl,768,,select,792,,textarea-rtl,816,,textarea,840,,textfield-rtl,864,,textfield,888,,horizontalrule,912,,iframe,936,,image,960,,indent-rtl,984,,indent,1008,,outdent-rtl,1032,,outdent,1056,,smiley,1080,,justifyblock,1104,,justifycenter,1128,,justifyleft,1152,,justifyright,1176,,language,1200,,anchor-rtl,1224,,anchor,1248,,link,1272,,unlink,1296,,bulletedlist-rtl,1320,,bulletedlist,1344,,numberedlist-rtl,1368,,numberedlist,1392,,maximize,1416,,newpage-rtl,1440,,newpage,1464,,pagebreak-rtl,1488,,pagebreak,1512,,pastetext-rtl,1536,,pastetext,1560,,pastefromword-rtl,1584,,pastefromword,1608,,preview-rtl,1632,,preview,1656,,print,1680,,removeformat,1704,,save,1728,,selectall,1752,,showblocks-rtl,1776,,showblocks,1800,,source-rtl,1824,,source,1848,,specialchar,1872,,scayt,1896,,table,1920,,redo-rtl,1944,,redo,1968,,undo-rtl,1992,,undo,2016,,spellchecker,2040,', 'icons_hidpi.png');
  26282. else setIcons('about,0,auto,bold,24,auto,italic,48,auto,strike,72,auto,subscript,96,auto,superscript,120,auto,underline,144,auto,bidiltr,168,auto,bidirtl,192,auto,blockquote,216,auto,copy-rtl,240,auto,copy,264,auto,cut-rtl,288,auto,cut,312,auto,paste-rtl,336,auto,paste,360,auto,bgcolor,384,auto,textcolor,408,auto,templates-rtl,432,auto,templates,456,auto,copyformatting,480,auto,creatediv,504,auto,find-rtl,528,auto,find,552,auto,replace,576,auto,flash,600,auto,button,624,auto,checkbox,648,auto,form,672,auto,hiddenfield,696,auto,imagebutton,720,auto,radio,744,auto,select-rtl,768,auto,select,792,auto,textarea-rtl,816,auto,textarea,840,auto,textfield-rtl,864,auto,textfield,888,auto,horizontalrule,912,auto,iframe,936,auto,image,960,auto,indent-rtl,984,auto,indent,1008,auto,outdent-rtl,1032,auto,outdent,1056,auto,smiley,1080,auto,justifyblock,1104,auto,justifycenter,1128,auto,justifyleft,1152,auto,justifyright,1176,auto,language,1200,auto,anchor-rtl,1224,auto,anchor,1248,auto,link,1272,auto,unlink,1296,auto,bulletedlist-rtl,1320,auto,bulletedlist,1344,auto,numberedlist-rtl,1368,auto,numberedlist,1392,auto,maximize,1416,auto,newpage-rtl,1440,auto,newpage,1464,auto,pagebreak-rtl,1488,auto,pagebreak,1512,auto,pastetext-rtl,1536,auto,pastetext,1560,auto,pastefromword-rtl,1584,auto,pastefromword,1608,auto,preview-rtl,1632,auto,preview,1656,auto,print,1680,auto,removeformat,1704,auto,save,1728,auto,selectall,1752,auto,showblocks-rtl,1776,auto,showblocks,1800,auto,source-rtl,1824,auto,source,1848,auto,specialchar,1872,auto,scayt,1896,auto,table,1920,auto,redo-rtl,1944,auto,redo,1968,auto,undo-rtl,1992,auto,undo,2016,auto,spellchecker,2040,auto', 'icons.png');
  26283. })();
  26284. CKEDITOR.lang.languages = {
  26285. "af": 1,
  26286. "sq": 1,
  26287. "ar": 1,
  26288. "az": 1,
  26289. "eu": 1,
  26290. "bn": 1,
  26291. "bs": 1,
  26292. "bg": 1,
  26293. "ca": 1,
  26294. "zh-cn": 1,
  26295. "zh": 1,
  26296. "hr": 1,
  26297. "cs": 1,
  26298. "da": 1,
  26299. "nl": 1,
  26300. "en": 1,
  26301. "en-au": 1,
  26302. "en-ca": 1,
  26303. "en-gb": 1,
  26304. "eo": 1,
  26305. "et": 1,
  26306. "fo": 1,
  26307. "fi": 1,
  26308. "fr": 1,
  26309. "fr-ca": 1,
  26310. "gl": 1,
  26311. "ka": 1,
  26312. "de": 1,
  26313. "de-ch": 1,
  26314. "el": 1,
  26315. "gu": 1,
  26316. "he": 1,
  26317. "hi": 1,
  26318. "hu": 1,
  26319. "is": 1,
  26320. "id": 1,
  26321. "it": 1,
  26322. "ja": 1,
  26323. "km": 1,
  26324. "ko": 1,
  26325. "ku": 1,
  26326. "lv": 1,
  26327. "lt": 1,
  26328. "mk": 1,
  26329. "ms": 1,
  26330. "mn": 1,
  26331. "no": 1,
  26332. "nb": 1,
  26333. "oc": 1,
  26334. "fa": 1,
  26335. "pl": 1,
  26336. "pt-br": 1,
  26337. "pt": 1,
  26338. "ro": 1,
  26339. "ru": 1,
  26340. "sr": 1,
  26341. "sr-latn": 1,
  26342. "si": 1,
  26343. "sk": 1,
  26344. "sl": 1,
  26345. "es": 1,
  26346. "es-mx": 1,
  26347. "sv": 1,
  26348. "tt": 1,
  26349. "th": 1,
  26350. "tr": 1,
  26351. "ug": 1,
  26352. "uk": 1,
  26353. "vi": 1,
  26354. "cy": 1
  26355. };
  26356. }());