1/* 2Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. 3For 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 46 function b() { 47 for (var a; a = c.shift();) a() 48 } 49 var c = []; 50 return function(b) { 51 function n() { 52 try { 53 document.documentElement.doScroll("left") 54 } catch (e) { 55 setTimeout(n, 1); 56 return 57 } 58 a() 59 } 60 c.push(b); 61 "complete" === document.readyState && setTimeout(a, 1); 62 if (1 == c.length) 63 if (document.addEventListener) document.addEventListener("DOMContentLoaded", a, !1), window.addEventListener("load", a, !1); 64 else if (document.attachEvent) { 65 document.attachEvent("onreadystatechange", 66 a); 67 window.attachEvent("onload", a); 68 b = !1; 69 try { 70 b = !window.frameElement 71 } catch (r) {} 72 document.documentElement.doScroll && b && n() 73 } 74 } 75 }() 76 }, 77 b = window.CKEDITOR_GETURL; 78 if (b) { 79 var c = d.getUrl; 80 d.getUrl = function(a) { 81 return b.call(d, a) || c.call(d, a) 82 } 83 } 84 return d 85 }()); 86 CKEDITOR.event || (CKEDITOR.event = function() {}, CKEDITOR.event.implementOn = function(a) { 87 var d = CKEDITOR.event.prototype, 88 b; 89 for (b in d) null == a[b] && (a[b] = d[b]) 90 }, CKEDITOR.event.prototype = function() { 91 function a(a) { 92 var f = d(this); 93 return f[a] || (f[a] = new b(a)) 94 } 95 var d = function(a) { 96 a = a.getPrivate && a.getPrivate() || a._ || (a._ = {}); 97 return a.events || (a.events = {}) 98 }, 99 b = function(a) { 100 this.name = a; 101 this.listeners = [] 102 }; 103 b.prototype = { 104 getListenerIndex: function(a) { 105 for (var b = 0, d = this.listeners; b < d.length; b++) 106 if (d[b].fn == a) return b; 107 return -1 108 } 109 }; 110 return { 111 define: function(b, d) { 112 var h = a.call(this, b); 113 CKEDITOR.tools.extend(h, d, !0) 114 }, 115 on: function(b, d, h, k, g) { 116 function n(e, a, y, v) { 117 e = { 118 name: b, 119 sender: this, 120 editor: e, 121 data: a, 122 listenerData: k, 123 stop: y, 124 cancel: v, 125 removeListener: r 126 }; 127 return !1 === d.call(h, e) ? !1 : e.data 128 } 129 130 function r() { 131 y.removeListener(b, d) 132 } 133 var e = a.call(this, b); 134 if (0 > e.getListenerIndex(d)) { 135 e = e.listeners; 136 h || (h = this); 137 isNaN(g) && (g = 10); 138 var y = this; 139 n.fn = d; 140 n.priority = g; 141 for (var v = e.length - 1; 0 <= v; v--) 142 if (e[v].priority <= g) return e.splice(v + 1, 0, n), { 143 removeListener: r 144 }; 145 e.unshift(n) 146 } 147 return { 148 removeListener: r 149 } 150 }, 151 once: function() { 152 var a = Array.prototype.slice.call(arguments), 153 b = a[1]; 154 a[1] = function(a) { 155 a.removeListener(); 156 return b.apply(this, arguments) 157 }; 158 return this.on.apply(this, a) 159 }, 160 capture: function() { 161 CKEDITOR.event.useCapture = 1; 162 var a = this.on.apply(this, arguments); 163 CKEDITOR.event.useCapture = 0; 164 return a 165 }, 166 fire: function() { 167 var a = 0, 168 b = function() { 169 a = 1 170 }, 171 h = 0, 172 k = function() { 173 h = 1 174 }; 175 return function(g, n, r) { 176 var e = d(this)[g]; 177 g = a; 178 var y = h; 179 a = h = 0; 180 if (e) { 181 var v = e.listeners; 182 if (v.length) 183 for (var v = v.slice(0), B, D = 0; D < v.length; D++) { 184 if (e.errorProof) try { 185 B = 186 v[D].call(this, r, n, b, k) 187 } catch (x) {} else B = v[D].call(this, r, n, b, k); 188 !1 === B ? h = 1 : "undefined" != typeof B && (n = B); 189 if (a || h) break 190 } 191 } 192 n = h ? !1 : "undefined" == typeof n ? !0 : n; 193 a = g; 194 h = y; 195 return n 196 } 197 }(), 198 fireOnce: function(a, b, h) { 199 b = this.fire(a, b, h); 200 delete d(this)[a]; 201 return b 202 }, 203 removeListener: function(a, b) { 204 var h = d(this)[a]; 205 if (h) { 206 var k = h.getListenerIndex(b); 207 0 <= k && h.listeners.splice(k, 1) 208 } 209 }, 210 removeAllListeners: function() { 211 var a = d(this), 212 b; 213 for (b in a) delete a[b] 214 }, 215 hasListeners: function(a) { 216 return (a = d(this)[a]) && 0 < a.listeners.length 217 } 218 } 219 }()); 220 CKEDITOR.editor || (CKEDITOR.editor = function() { 221 CKEDITOR._.pending.push([this, arguments]); 222 CKEDITOR.event.call(this) 223 }, CKEDITOR.editor.prototype.fire = function(a, d) { 224 a in { 225 instanceReady: 1, 226 loaded: 1 227 } && (this[a] = !0); 228 return CKEDITOR.event.prototype.fire.call(this, a, d, this) 229 }, CKEDITOR.editor.prototype.fireOnce = function(a, d) { 230 a in { 231 instanceReady: 1, 232 loaded: 1 233 } && (this[a] = !0); 234 return CKEDITOR.event.prototype.fireOnce.call(this, a, d, this) 235 }, CKEDITOR.event.implementOn(CKEDITOR.editor.prototype)); 236 CKEDITOR.env || (CKEDITOR.env = function() { 237 var a = navigator.userAgent.toLowerCase(), 238 d = a.match(/edge[ \/](\d+.?\d*)/), 239 b = -1 < a.indexOf("trident/"), 240 b = !(!d && !b), 241 b = { 242 ie: b, 243 edge: !!d, 244 webkit: !b && -1 < a.indexOf(" applewebkit/"), 245 air: -1 < a.indexOf(" adobeair/"), 246 mac: -1 < a.indexOf("macintosh"), 247 quirks: "BackCompat" == document.compatMode && (!document.documentMode || 10 > document.documentMode), 248 mobile: -1 < a.indexOf("mobile"), 249 iOS: /(ipad|iphone|ipod)/.test(a), 250 isCustomDomain: function() { 251 if (!this.ie) return !1; 252 var a = document.domain, 253 b = window.location.hostname; 254 return a != b && a != "[" + b + "]" 255 }, 256 secure: "https:" == location.protocol 257 }; 258 b.gecko = "Gecko" == navigator.product && !b.webkit && !b.ie; 259 b.webkit && (-1 < a.indexOf("chrome") ? b.chrome = !0 : b.safari = !0); 260 var c = 0; 261 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); 262 b.gecko && (d = a.match(/rv:([\d\.]+)/)) && (d = d[1].split("."), c = 1E4 * d[0] + 100 * (d[1] || 0) + 1 * (d[2] || 0)); 263 b.air && (c = parseFloat(a.match(/ adobeair\/(\d+)/)[1])); 264 b.webkit && (c = parseFloat(a.match(/ applewebkit\/(\d+)/)[1])); 265 b.version = c; 266 b.isCompatible = !(b.ie && 7 > c) && !(b.gecko && 4E4 > c) && !(b.webkit && 534 > c); 267 b.hidpi = 2 <= window.devicePixelRatio; 268 b.needsBrFiller = b.gecko || b.webkit || b.ie && 10 < c; 269 b.needsNbspFiller = b.ie && 11 > c; 270 b.cssClass = "cke_browser_" + (b.ie ? "ie" : b.gecko ? "gecko" : b.webkit ? "webkit" : "unknown"); 271 b.quirks && (b.cssClass += " cke_browser_quirks"); 272 b.ie && (b.cssClass += " cke_browser_ie" + (b.quirks ? "6 cke_browser_iequirks" : b.version)); 273 b.air && (b.cssClass += " cke_browser_air"); 274 b.iOS && (b.cssClass += " cke_browser_ios"); 275 b.hidpi && (b.cssClass += " cke_hidpi"); 276 return b 277 }()); 278 "unloaded" == CKEDITOR.status && function() { 279 CKEDITOR.event.implementOn(CKEDITOR); 280 CKEDITOR.loadFullCore = function() { 281 if ("basic_ready" != CKEDITOR.status) CKEDITOR.loadFullCore._load = 1; 282 else { 283 delete CKEDITOR.loadFullCore; 284 var a = document.createElement("script"); 285 a.type = "text/javascript"; 286 a.src = CKEDITOR.basePath + "ckeditor.js"; 287 document.getElementsByTagName("head")[0].appendChild(a) 288 } 289 }; 290 CKEDITOR.loadFullCoreTimeout = 0; 291 CKEDITOR.add = function(a) { 292 (this._.pending || (this._.pending = [])).push(a) 293 }; 294 (function() { 295 CKEDITOR.domReady(function() { 296 var a = 297 CKEDITOR.loadFullCore, 298 d = CKEDITOR.loadFullCoreTimeout; 299 a && (CKEDITOR.status = "basic_ready", a && a._load ? a() : d && setTimeout(function() { 300 CKEDITOR.loadFullCore && CKEDITOR.loadFullCore() 301 }, 1E3 * d)) 302 }) 303 })(); 304 CKEDITOR.status = "basic_loaded" 305 }(); 306 "use strict"; 307 CKEDITOR.VERBOSITY_WARN = 1; 308 CKEDITOR.VERBOSITY_ERROR = 2; 309 CKEDITOR.verbosity = CKEDITOR.VERBOSITY_WARN | CKEDITOR.VERBOSITY_ERROR; 310 CKEDITOR.warn = function(a, d) { 311 CKEDITOR.verbosity & CKEDITOR.VERBOSITY_WARN && CKEDITOR.fire("log", { 312 type: "warn", 313 errorCode: a, 314 additionalData: d 315 }) 316 }; 317 CKEDITOR.error = function(a, d) { 318 CKEDITOR.verbosity & CKEDITOR.VERBOSITY_ERROR && CKEDITOR.fire("log", { 319 type: "error", 320 errorCode: a, 321 additionalData: d 322 }) 323 }; 324 CKEDITOR.on("log", function(a) { 325 if (window.console && window.console.log) { 326 var d = console[a.data.type] ? a.data.type : "log", 327 b = a.data.errorCode; 328 if (a = a.data.additionalData) console[d]("[CKEDITOR] Error code: " + b + ".", a); 329 else console[d]("[CKEDITOR] Error code: " + b + "."); 330 console[d]("[CKEDITOR] For more information about this error go to https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#" + b) 331 } 332 }, null, null, 999); 333 CKEDITOR.dom = {}; 334 (function() { 335 var a = [], 336 d = CKEDITOR.env.gecko ? "-moz-" : CKEDITOR.env.webkit ? "-webkit-" : CKEDITOR.env.ie ? "-ms-" : "", 337 b = /&/g, 338 c = />/g, 339 f = /</g, 340 h = /"/g, 341 k = /&(lt|gt|amp|quot|nbsp|shy|#\d{1,5});/g, 342 g = { 343 lt: "\x3c", 344 gt: "\x3e", 345 amp: "\x26", 346 quot: '"', 347 nbsp: " ", 348 shy: "" 349 }, 350 n = function(a, e) { 351 return "#" == e[0] ? String.fromCharCode(parseInt(e.slice(1), 10)) : g[e] 352 }; 353 CKEDITOR.on("reset", function() { 354 a = [] 355 }); 356 CKEDITOR.tools = { 357 arrayCompare: function(a, e) { 358 if (!a && !e) return !0; 359 if (!a || !e || a.length != e.length) return !1; 360 for (var b = 0; b < a.length; b++) 361 if (a[b] != e[b]) return !1; 362 return !0 363 }, 364 getIndex: function(a, e) { 365 for (var b = 0; b < a.length; ++b) 366 if (e(a[b])) return b; 367 return -1 368 }, 369 clone: function(a) { 370 var e; 371 if (a && a instanceof Array) { 372 e = []; 373 for (var b = 0; b < a.length; b++) e[b] = CKEDITOR.tools.clone(a[b]); 374 return e 375 } 376 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; 377 e = new a.constructor; 378 for (b in a) e[b] = CKEDITOR.tools.clone(a[b]); 379 return e 380 }, 381 capitalize: function(a, e) { 382 return a.charAt(0).toUpperCase() + 383 (e ? a.slice(1) : a.slice(1).toLowerCase()) 384 }, 385 extend: function(a) { 386 var e = arguments.length, 387 b, v; 388 "boolean" == typeof(b = arguments[e - 1]) ? e-- : "boolean" == typeof(b = arguments[e - 2]) && (v = arguments[e - 1], e -= 2); 389 for (var c = 1; c < e; c++) { 390 var g = arguments[c], 391 d; 392 for (d in g) 393 if (!0 === b || null == a[d]) 394 if (!v || d in v) a[d] = g[d] 395 } 396 return a 397 }, 398 prototypedCopy: function(a) { 399 var e = function() {}; 400 e.prototype = a; 401 return new e 402 }, 403 copy: function(a) { 404 var e = {}, 405 b; 406 for (b in a) e[b] = a[b]; 407 return e 408 }, 409 isArray: function(a) { 410 return "[object Array]" == Object.prototype.toString.call(a) 411 }, 412 isEmpty: function(a) { 413 for (var e in a) 414 if (a.hasOwnProperty(e)) return !1; 415 return !0 416 }, 417 cssVendorPrefix: function(a, e, b) { 418 if (b) return d + a + ":" + e + ";" + a + ":" + e; 419 b = {}; 420 b[a] = e; 421 b[d + a] = e; 422 return b 423 }, 424 cssStyleToDomStyle: function() { 425 var a = document.createElement("div").style, 426 e = "undefined" != typeof a.cssFloat ? "cssFloat" : "undefined" != typeof a.styleFloat ? "styleFloat" : "float"; 427 return function(a) { 428 return "float" == a ? e : a.replace(/-./g, function(a) { 429 return a.substr(1).toUpperCase() 430 }) 431 } 432 }(), 433 buildStyleHtml: function(a) { 434 a = [].concat(a); 435 for (var e, 436 b = [], v = 0; v < a.length; v++) 437 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'); 438 return b.join("") 439 }, 440 htmlEncode: function(a) { 441 return void 0 === a || null === a ? "" : String(a).replace(b, "\x26amp;").replace(c, "\x26gt;").replace(f, "\x26lt;") 442 }, 443 htmlDecode: function(a) { 444 return a.replace(k, n) 445 }, 446 htmlEncodeAttr: function(a) { 447 return CKEDITOR.tools.htmlEncode(a).replace(h, "\x26quot;") 448 }, 449 htmlDecodeAttr: function(a) { 450 return CKEDITOR.tools.htmlDecode(a) 451 }, 452 transformPlainTextToHtml: function(a, e) { 453 var b = e == CKEDITOR.ENTER_BR, 454 v = this.htmlEncode(a.replace(/\r\n/g, "\n")), 455 v = v.replace(/\t/g, "\x26nbsp;\x26nbsp; \x26nbsp;"), 456 c = e == CKEDITOR.ENTER_P ? "p" : "div"; 457 if (!b) { 458 var g = /\n{2}/g; 459 if (g.test(v)) var d = "\x3c" + c + "\x3e", 460 m = "\x3c/" + c + "\x3e", 461 v = d + v.replace(g, function() { 462 return m + d 463 }) + m 464 } 465 v = v.replace(/\n/g, "\x3cbr\x3e"); 466 b || (v = v.replace(new RegExp("\x3cbr\x3e(?\x3d\x3c/" + c + "\x3e)"), function(a) { 467 return CKEDITOR.tools.repeat(a, 2) 468 })); 469 v = v.replace(/^ | $/g, "\x26nbsp;"); 470 return v = v.replace(/(>|\s) /g, 471 function(a, e) { 472 return e + "\x26nbsp;" 473 }).replace(/ (?=<)/g, "\x26nbsp;") 474 }, 475 getNextNumber: function() { 476 var a = 0; 477 return function() { 478 return ++a 479 } 480 }(), 481 getNextId: function() { 482 return "cke_" + this.getNextNumber() 483 }, 484 getUniqueId: function() { 485 for (var a = "e", e = 0; 8 > e; e++) a += Math.floor(65536 * (1 + Math.random())).toString(16).substring(1); 486 return a 487 }, 488 override: function(a, e) { 489 var b = e(a); 490 b.prototype = a.prototype; 491 return b 492 }, 493 setTimeout: function(a, e, b, c, g) { 494 g || (g = window); 495 b || (b = g); 496 return g.setTimeout(function() { 497 c ? a.apply(b, [].concat(c)) : a.apply(b) 498 }, 499 e || 0) 500 }, 501 throttle: function(a, e, b) { 502 var c, g = 0; 503 b = b || {}; 504 return { 505 input: function() { 506 function d() { 507 g = (new Date).getTime(); 508 c = !1; 509 e.apply(b, n) 510 } 511 var n = Array.prototype.slice.call(arguments); 512 c && (clearTimeout(c), c = 0); 513 var m = (new Date).getTime() - g; 514 m < a ? c = setTimeout(d, a - m) : d() 515 }, 516 reset: function() { 517 c && (clearTimeout(c), c = g = 0) 518 } 519 } 520 }, 521 trim: function() { 522 var a = /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g; 523 return function(e) { 524 return e.replace(a, "") 525 } 526 }(), 527 ltrim: function() { 528 var a = /^[ \t\n\r]+/g; 529 return function(e) { 530 return e.replace(a, "") 531 } 532 }(), 533 rtrim: function() { 534 var a = 535 /[ \t\n\r]+$/g; 536 return function(e) { 537 return e.replace(a, "") 538 } 539 }(), 540 indexOf: function(a, e) { 541 if ("function" == typeof e) 542 for (var b = 0, c = a.length; b < c; b++) { 543 if (e(a[b])) return b 544 } else { 545 if (a.indexOf) return a.indexOf(e); 546 b = 0; 547 for (c = a.length; b < c; b++) 548 if (a[b] === e) return b 549 } 550 return -1 551 }, 552 search: function(a, e) { 553 var b = CKEDITOR.tools.indexOf(a, e); 554 return 0 <= b ? a[b] : null 555 }, 556 bind: function(a, e) { 557 return function() { 558 return a.apply(e, arguments) 559 } 560 }, 561 createClass: function(a) { 562 var e = a.$, 563 b = a.base, 564 c = a.privates || a._, 565 g = a.proto; 566 a = a.statics; 567 !e && (e = function() { 568 b && 569 this.base.apply(this, arguments) 570 }); 571 if (c) var d = e, 572 e = function() { 573 var a = this._ || (this._ = {}), 574 e; 575 for (e in c) { 576 var b = c[e]; 577 a[e] = "function" == typeof b ? CKEDITOR.tools.bind(b, this) : b 578 } 579 d.apply(this, arguments) 580 }; 581 b && (e.prototype = this.prototypedCopy(b.prototype), e.prototype.constructor = e, e.base = b, e.baseProto = b.prototype, e.prototype.base = function() { 582 this.base = b.prototype.base; 583 b.apply(this, arguments); 584 this.base = arguments.callee 585 }); 586 g && this.extend(e.prototype, g, !0); 587 a && this.extend(e, a, !0); 588 return e 589 }, 590 addFunction: function(b, e) { 591 return a.push(function() { 592 return b.apply(e || 593 this, arguments) 594 }) - 1 595 }, 596 removeFunction: function(b) { 597 a[b] = null 598 }, 599 callFunction: function(b) { 600 var e = a[b]; 601 return e && e.apply(window, Array.prototype.slice.call(arguments, 1)) 602 }, 603 cssLength: function() { 604 var a = /^-?\d+\.?\d*px$/, 605 e; 606 return function(b) { 607 e = CKEDITOR.tools.trim(b + "") + "px"; 608 return a.test(e) ? e : b || "" 609 } 610 }(), 611 convertToPx: function() { 612 var a; 613 return function(e) { 614 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), 615 CKEDITOR.document.getBody().append(a)); 616 return /%$/.test(e) ? e : (a.setStyle("width", e), a.$.clientWidth) 617 } 618 }(), 619 repeat: function(a, e) { 620 return Array(e + 1).join(a) 621 }, 622 tryThese: function() { 623 for (var a, e = 0, b = arguments.length; e < b; e++) { 624 var c = arguments[e]; 625 try { 626 a = c(); 627 break 628 } catch (g) {} 629 } 630 return a 631 }, 632 genKey: function() { 633 return Array.prototype.slice.call(arguments).join("-") 634 }, 635 defer: function(a) { 636 return function() { 637 var e = arguments, 638 b = this; 639 window.setTimeout(function() { 640 a.apply(b, e) 641 }, 0) 642 } 643 }, 644 normalizeCssText: function(a, e) { 645 var b = [], 646 c, g = CKEDITOR.tools.parseCssText(a, 647 !0, e); 648 for (c in g) b.push(c + ":" + g[c]); 649 b.sort(); 650 return b.length ? b.join(";") + ";" : "" 651 }, 652 convertRgbToHex: function(a) { 653 return a.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi, function(a, b, c, g) { 654 a = [b, c, g]; 655 for (b = 0; 3 > b; b++) a[b] = ("0" + parseInt(a[b], 10).toString(16)).slice(-2); 656 return "#" + a.join("") 657 }) 658 }, 659 normalizeHex: function(a) { 660 return a.replace(/#(([0-9a-f]{3}){1,2})($|;|\s+)/gi, function(a, b, c, g) { 661 a = b.toLowerCase(); 662 3 == a.length && (a = a.split(""), a = [a[0], a[0], a[1], a[1], a[2], a[2]].join("")); 663 return "#" + a + g 664 }) 665 }, 666 parseCssText: function(a, 667 e, b) { 668 var c = {}; 669 b && (a = (new CKEDITOR.dom.element("span")).setAttribute("style", a).getAttribute("style") || ""); 670 a && (a = CKEDITOR.tools.normalizeHex(CKEDITOR.tools.convertRgbToHex(a))); 671 if (!a || ";" == a) return c; 672 a.replace(/"/g, '"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function(a, b, g) { 673 e && (b = b.toLowerCase(), "font-family" == b && (g = g.replace(/\s*,\s*/g, ",")), g = CKEDITOR.tools.trim(g)); 674 c[b] = g 675 }); 676 return c 677 }, 678 writeCssText: function(a, e) { 679 var b, c = []; 680 for (b in a) c.push(b + ":" + a[b]); 681 e && c.sort(); 682 return c.join("; ") 683 }, 684 objectCompare: function(a, e, b) { 685 var c; 686 if (!a && !e) return !0; 687 if (!a || !e) return !1; 688 for (c in a) 689 if (a[c] != e[c]) return !1; 690 if (!b) 691 for (c in e) 692 if (a[c] != e[c]) return !1; 693 return !0 694 }, 695 objectKeys: function(a) { 696 var e = [], 697 b; 698 for (b in a) e.push(b); 699 return e 700 }, 701 convertArrayToObject: function(a, e) { 702 var b = {}; 703 1 == arguments.length && (e = !0); 704 for (var c = 0, g = a.length; c < g; ++c) b[a[c]] = e; 705 return b 706 }, 707 fixDomain: function() { 708 for (var a;;) try { 709 a = window.parent.document.domain; 710 break 711 } catch (e) { 712 a = a ? a.replace(/.+?(?:\.|$)/, "") : document.domain; 713 if (!a) break; 714 document.domain = 715 a 716 } 717 return !!a 718 }, 719 eventsBuffer: function(a, e, b) { 720 function c() { 721 d = (new Date).getTime(); 722 g = !1; 723 b ? e.call(b) : e() 724 } 725 var g, d = 0; 726 return { 727 input: function() { 728 if (!g) { 729 var e = (new Date).getTime() - d; 730 e < a ? g = setTimeout(c, a - e) : c() 731 } 732 }, 733 reset: function() { 734 g && clearTimeout(g); 735 g = d = 0 736 } 737 } 738 }, 739 enableHtml5Elements: function(a, e) { 740 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]), 741 e && a.appendChild(g) 742 }, 743 checkIfAnyArrayItemMatches: function(a, e) { 744 for (var b = 0, c = a.length; b < c; ++b) 745 if (a[b].match(e)) return !0; 746 return !1 747 }, 748 checkIfAnyObjectPropertyMatches: function(a, e) { 749 for (var b in a) 750 if (b.match(e)) return !0; 751 return !1 752 }, 753 keystrokeToString: function(a, e) { 754 var b = this.keystrokeToArray(a, e); 755 b.display = b.display.join("+"); 756 b.aria = b.aria.join("+"); 757 return b 758 }, 759 keystrokeToArray: function(a, e) { 760 var b = e & 16711680, 761 c = e & 65535, 762 g = CKEDITOR.env.mac, 763 d = [], 764 n = []; 765 b & CKEDITOR.CTRL && (d.push(g ? "⌘" : a[17]), n.push(g ? a[224] : a[17])); 766 b & CKEDITOR.ALT && (d.push(g ? "⌥" : a[18]), n.push(a[18])); 767 b & CKEDITOR.SHIFT && (d.push(g ? "⇧" : a[16]), n.push(a[16])); 768 c && (a[c] ? (d.push(a[c]), n.push(a[c])) : (d.push(String.fromCharCode(c)), n.push(String.fromCharCode(c)))); 769 return { 770 display: d, 771 aria: n 772 } 773 }, 774 transparentImageData: "data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw\x3d\x3d", 775 getCookie: function(a) { 776 a = a.toLowerCase(); 777 for (var e = document.cookie.split(";"), b, c, g = 0; g < e.length; g++) 778 if (b = e[g].split("\x3d"), c = decodeURIComponent(CKEDITOR.tools.trim(b[0]).toLowerCase()), 779 c === a) return decodeURIComponent(1 < b.length ? b[1] : ""); 780 return null 781 }, 782 setCookie: function(a, e) { 783 document.cookie = encodeURIComponent(a) + "\x3d" + encodeURIComponent(e) + ";path\x3d/" 784 }, 785 getCsrfToken: function() { 786 var a = CKEDITOR.tools.getCookie("ckCsrfToken"); 787 if (!a || 40 != a.length) { 788 var a = [], 789 e = ""; 790 if (window.crypto && window.crypto.getRandomValues) a = new Uint8Array(40), window.crypto.getRandomValues(a); 791 else 792 for (var b = 0; 40 > b; b++) a.push(Math.floor(256 * Math.random())); 793 for (b = 0; b < a.length; b++) var c = "abcdefghijklmnopqrstuvwxyz0123456789".charAt(a[b] % 794 36), 795 e = e + (.5 < Math.random() ? c.toUpperCase() : c); 796 a = e; 797 CKEDITOR.tools.setCookie("ckCsrfToken", a) 798 } 799 return a 800 }, 801 escapeCss: function(a) { 802 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) : "" 803 }, 804 getMouseButton: function(a) { 805 var b = (a = a.data) && a.$; 806 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 807 }, 808 convertHexStringToBytes: function(a) { 809 var b = [], 810 c = a.length / 2, 811 g; 812 for (g = 0; g < c; g++) b.push(parseInt(a.substr(2 * g, 2), 16)); 813 return b 814 }, 815 convertBytesToBase64: function(a) { 816 var b = "", 817 c = a.length, 818 g; 819 for (g = 0; g < c; g += 3) { 820 var d = a.slice(g, g + 3), 821 n = d.length, 822 f = [], 823 m; 824 if (3 > n) 825 for (m = n; 3 > m; m++) d[m] = 0; 826 f[0] = (d[0] & 252) >> 2; 827 f[1] = (d[0] & 3) << 4 | d[1] >> 4; 828 f[2] = (d[1] & 15) << 2 | (d[2] & 192) >> 6; 829 f[3] = d[2] & 63; 830 for (m = 0; 4 > m; m++) b = m <= n ? b + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f[m]) : b + "\x3d" 831 } 832 return b 833 }, 834 style: { 835 parse: { 836 _colors: { 837 aliceblue: "#F0F8FF", 838 antiquewhite: "#FAEBD7", 839 aqua: "#00FFFF", 840 aquamarine: "#7FFFD4", 841 azure: "#F0FFFF", 842 beige: "#F5F5DC", 843 bisque: "#FFE4C4", 844 black: "#000000", 845 blanchedalmond: "#FFEBCD", 846 blue: "#0000FF", 847 blueviolet: "#8A2BE2", 848 brown: "#A52A2A", 849 burlywood: "#DEB887", 850 cadetblue: "#5F9EA0", 851 chartreuse: "#7FFF00", 852 chocolate: "#D2691E", 853 coral: "#FF7F50", 854 cornflowerblue: "#6495ED", 855 cornsilk: "#FFF8DC", 856 crimson: "#DC143C", 857 cyan: "#00FFFF", 858 darkblue: "#00008B", 859 darkcyan: "#008B8B", 860 darkgoldenrod: "#B8860B", 861 darkgray: "#A9A9A9", 862 darkgreen: "#006400", 863 darkgrey: "#A9A9A9", 864 darkkhaki: "#BDB76B", 865 darkmagenta: "#8B008B", 866 darkolivegreen: "#556B2F", 867 darkorange: "#FF8C00", 868 darkorchid: "#9932CC", 869 darkred: "#8B0000", 870 darksalmon: "#E9967A", 871 darkseagreen: "#8FBC8F", 872 darkslateblue: "#483D8B", 873 darkslategray: "#2F4F4F", 874 darkslategrey: "#2F4F4F", 875 darkturquoise: "#00CED1", 876 darkviolet: "#9400D3", 877 deeppink: "#FF1493", 878 deepskyblue: "#00BFFF", 879 dimgray: "#696969", 880 dimgrey: "#696969", 881 dodgerblue: "#1E90FF", 882 firebrick: "#B22222", 883 floralwhite: "#FFFAF0", 884 forestgreen: "#228B22", 885 fuchsia: "#FF00FF", 886 gainsboro: "#DCDCDC", 887 ghostwhite: "#F8F8FF", 888 gold: "#FFD700", 889 goldenrod: "#DAA520", 890 gray: "#808080", 891 green: "#008000", 892 greenyellow: "#ADFF2F", 893 grey: "#808080", 894 honeydew: "#F0FFF0", 895 hotpink: "#FF69B4", 896 indianred: "#CD5C5C", 897 indigo: "#4B0082", 898 ivory: "#FFFFF0", 899 khaki: "#F0E68C", 900 lavender: "#E6E6FA", 901 lavenderblush: "#FFF0F5", 902 lawngreen: "#7CFC00", 903 lemonchiffon: "#FFFACD", 904 lightblue: "#ADD8E6", 905 lightcoral: "#F08080", 906 lightcyan: "#E0FFFF", 907 lightgoldenrodyellow: "#FAFAD2", 908 lightgray: "#D3D3D3", 909 lightgreen: "#90EE90", 910 lightgrey: "#D3D3D3", 911 lightpink: "#FFB6C1", 912 lightsalmon: "#FFA07A", 913 lightseagreen: "#20B2AA", 914 lightskyblue: "#87CEFA", 915 lightslategray: "#778899", 916 lightslategrey: "#778899", 917 lightsteelblue: "#B0C4DE", 918 lightyellow: "#FFFFE0", 919 lime: "#00FF00", 920 limegreen: "#32CD32", 921 linen: "#FAF0E6", 922 magenta: "#FF00FF", 923 maroon: "#800000", 924 mediumaquamarine: "#66CDAA", 925 mediumblue: "#0000CD", 926 mediumorchid: "#BA55D3", 927 mediumpurple: "#9370DB", 928 mediumseagreen: "#3CB371", 929 mediumslateblue: "#7B68EE", 930 mediumspringgreen: "#00FA9A", 931 mediumturquoise: "#48D1CC", 932 mediumvioletred: "#C71585", 933 midnightblue: "#191970", 934 mintcream: "#F5FFFA", 935 mistyrose: "#FFE4E1", 936 moccasin: "#FFE4B5", 937 navajowhite: "#FFDEAD", 938 navy: "#000080", 939 oldlace: "#FDF5E6", 940 olive: "#808000", 941 olivedrab: "#6B8E23", 942 orange: "#FFA500", 943 orangered: "#FF4500", 944 orchid: "#DA70D6", 945 palegoldenrod: "#EEE8AA", 946 palegreen: "#98FB98", 947 paleturquoise: "#AFEEEE", 948 palevioletred: "#DB7093", 949 papayawhip: "#FFEFD5", 950 peachpuff: "#FFDAB9", 951 peru: "#CD853F", 952 pink: "#FFC0CB", 953 plum: "#DDA0DD", 954 powderblue: "#B0E0E6", 955 purple: "#800080", 956 rebeccapurple: "#663399", 957 red: "#FF0000", 958 rosybrown: "#BC8F8F", 959 royalblue: "#4169E1", 960 saddlebrown: "#8B4513", 961 salmon: "#FA8072", 962 sandybrown: "#F4A460", 963 seagreen: "#2E8B57", 964 seashell: "#FFF5EE", 965 sienna: "#A0522D", 966 silver: "#C0C0C0", 967 skyblue: "#87CEEB", 968 slateblue: "#6A5ACD", 969 slategray: "#708090", 970 slategrey: "#708090", 971 snow: "#FFFAFA", 972 springgreen: "#00FF7F", 973 steelblue: "#4682B4", 974 tan: "#D2B48C", 975 teal: "#008080", 976 thistle: "#D8BFD8", 977 tomato: "#FF6347", 978 turquoise: "#40E0D0", 979 violet: "#EE82EE", 980 wheat: "#F5DEB3", 981 white: "#FFFFFF", 982 whitesmoke: "#F5F5F5", 983 yellow: "#FFFF00", 984 yellowgreen: "#9ACD32" 985 }, 986 _borderStyle: "none hidden dotted dashed solid double groove ridge inset outset".split(" "), 987 _widthRegExp: /^(thin|medium|thick|[\+-]?\d+(\.\d+)?[a-z%]+|[\+-]?0+(\.0+)?|\.\d+[a-z%]+)$/, 988 _rgbaRegExp: /rgba?\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*(?:,\s*[0-9.]+\s*)?\)/gi, 989 _hslaRegExp: /hsla?\(\s*[0-9.]+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi, 990 background: function(a) { 991 var b = {}, 992 c = this._findColor(a); 993 c.length && (b.color = c[0], CKEDITOR.tools.array.forEach(c, function(b) { 994 a = a.replace(b, "") 995 })); 996 if (a = CKEDITOR.tools.trim(a)) b.unprocessed = a; 997 return b 998 }, 999 margin: function(a) { 1000 function b(a) { 1001 c.top = g[a[0]]; 1002 c.right = g[a[1]]; 1003 c.bottom = g[a[2]]; 1004 c.left = g[a[3]] 1005 } 1006 var c = {}, 1007 g = a.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset)/g) || ["0px"]; 1008 switch (g.length) { 1009 case 1: 1010 b([0, 0, 0, 0]); 1011 break; 1012 case 2: 1013 b([0, 1, 0, 1]); 1014 break; 1015 case 3: 1016 b([0, 1, 2, 1]); 1017 break; 1018 case 4: 1019 b([0, 1, 2, 3]) 1020 } 1021 return c 1022 }, 1023 border: function(a) { 1024 var b = {}, 1025 c = a.split(/\s+/g); 1026 a = CKEDITOR.tools.style.parse._findColor(a); 1027 a.length && (b.color = a[0]); 1028 CKEDITOR.tools.array.forEach(c, function(a) { 1029 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 1030 }); 1031 return b 1032 }, 1033 _findColor: function(a) { 1034 var b = [], 1035 c = CKEDITOR.tools.array, 1036 b = b.concat(a.match(this._rgbaRegExp) || []), 1037 b = b.concat(a.match(this._hslaRegExp) || []); 1038 return b = b.concat(c.filter(a.split(/\s+/), function(a) { 1039 return a.match(/^\#[a-f0-9]{3}(?:[a-f0-9]{3})?$/gi) ? !0 : a.toLowerCase() in CKEDITOR.tools.style.parse._colors 1040 })) 1041 } 1042 } 1043 }, 1044 array: { 1045 filter: function(a, b, c) { 1046 var g = []; 1047 this.forEach(a, function(d, n) { 1048 b.call(c, d, n, a) && g.push(d) 1049 }); 1050 return g 1051 }, 1052 forEach: function(a, b, c) { 1053 var g = a.length, 1054 d; 1055 for (d = 0; d < g; d++) b.call(c, a[d], d, a) 1056 }, 1057 map: function(a, b, c) { 1058 for (var g = [], d = 0; d < a.length; d++) g.push(b.call(c, 1059 a[d], d, a)); 1060 return g 1061 }, 1062 reduce: function(a, b, c, g) { 1063 for (var d = 0; d < a.length; d++) c = b.call(g, c, a[d], d, a); 1064 return c 1065 }, 1066 every: function(a, b, c) { 1067 if (!a.length) return !0; 1068 b = this.filter(a, b, c); 1069 return a.length === b.length 1070 } 1071 }, 1072 object: { 1073 findKey: function(a, b) { 1074 if ("object" !== typeof a) return null; 1075 for (var c in a) 1076 if (a[c] === b) return c; 1077 return null 1078 }, 1079 merge: function(a, b) { 1080 var c = CKEDITOR.tools, 1081 g = c.clone(a), 1082 d = c.clone(b); 1083 c.array.forEach(c.objectKeys(d), function(a) { 1084 g[a] = "object" === typeof d[a] && "object" === typeof g[a] ? c.object.merge(g[a], d[a]) : 1085 d[a] 1086 }); 1087 return g 1088 } 1089 }, 1090 getAbsoluteRectPosition: function(a, b) { 1091 function c(a) { 1092 if (a) { 1093 var b = a.getClientRect(); 1094 g.top += b.top; 1095 g.left += b.left; 1096 "x" in g && "y" in g && (g.x += b.x, g.y += b.y); 1097 c(a.getWindow().getFrame()) 1098 } 1099 } 1100 var g = CKEDITOR.tools.copy(b); 1101 c(a.getFrame()); 1102 var d = CKEDITOR.document.getWindow().getScrollPosition(); 1103 g.top += d.y; 1104 g.left += d.x; 1105 "x" in g && "y" in g && (g.y += d.y, g.x += d.x); 1106 g.right = g.left + g.width; 1107 g.bottom = g.top + g.height; 1108 return g 1109 } 1110 }; 1111 CKEDITOR.tools.array.indexOf = CKEDITOR.tools.indexOf; 1112 CKEDITOR.tools.array.isArray = CKEDITOR.tools.isArray; 1113 CKEDITOR.MOUSE_BUTTON_LEFT = 0; 1114 CKEDITOR.MOUSE_BUTTON_MIDDLE = 1; 1115 CKEDITOR.MOUSE_BUTTON_RIGHT = 2 1116 })(); 1117 CKEDITOR.dtd = function() { 1118 var a = CKEDITOR.tools.extend, 1119 d = function(a, b) { 1120 for (var c = CKEDITOR.tools.clone(a), g = 1; g < arguments.length; g++) { 1121 b = arguments[g]; 1122 for (var d in b) delete c[d] 1123 } 1124 return c 1125 }, 1126 b = {}, 1127 c = {}, 1128 f = { 1129 address: 1, 1130 article: 1, 1131 aside: 1, 1132 blockquote: 1, 1133 details: 1, 1134 div: 1, 1135 dl: 1, 1136 fieldset: 1, 1137 figure: 1, 1138 footer: 1, 1139 form: 1, 1140 h1: 1, 1141 h2: 1, 1142 h3: 1, 1143 h4: 1, 1144 h5: 1, 1145 h6: 1, 1146 header: 1, 1147 hgroup: 1, 1148 hr: 1, 1149 main: 1, 1150 menu: 1, 1151 nav: 1, 1152 ol: 1, 1153 p: 1, 1154 pre: 1, 1155 section: 1, 1156 table: 1, 1157 ul: 1 1158 }, 1159 h = { 1160 command: 1, 1161 link: 1, 1162 meta: 1, 1163 noscript: 1, 1164 script: 1, 1165 style: 1 1166 }, 1167 k = {}, 1168 g = { 1169 "#": 1 1170 }, 1171 n = { 1172 center: 1, 1173 dir: 1, 1174 noframes: 1 1175 }; 1176 a(b, { 1177 a: 1, 1178 abbr: 1, 1179 area: 1, 1180 audio: 1, 1181 b: 1, 1182 bdi: 1, 1183 bdo: 1, 1184 br: 1, 1185 button: 1, 1186 canvas: 1, 1187 cite: 1, 1188 code: 1, 1189 command: 1, 1190 datalist: 1, 1191 del: 1, 1192 dfn: 1, 1193 em: 1, 1194 embed: 1, 1195 i: 1, 1196 iframe: 1, 1197 img: 1, 1198 input: 1, 1199 ins: 1, 1200 kbd: 1, 1201 keygen: 1, 1202 label: 1, 1203 map: 1, 1204 mark: 1, 1205 meter: 1, 1206 noscript: 1, 1207 object: 1, 1208 output: 1, 1209 progress: 1, 1210 q: 1, 1211 ruby: 1, 1212 s: 1, 1213 samp: 1, 1214 script: 1, 1215 select: 1, 1216 small: 1, 1217 span: 1, 1218 strong: 1, 1219 sub: 1, 1220 sup: 1, 1221 textarea: 1, 1222 time: 1, 1223 u: 1, 1224 "var": 1, 1225 video: 1, 1226 wbr: 1 1227 }, g, { 1228 acronym: 1, 1229 applet: 1, 1230 basefont: 1, 1231 big: 1, 1232 font: 1, 1233 isindex: 1, 1234 strike: 1, 1235 style: 1, 1236 tt: 1 1237 }); 1238 a(c, f, b, n); 1239 d = { 1240 a: d(b, { 1241 a: 1, 1242 button: 1 1243 }), 1244 abbr: b, 1245 address: c, 1246 area: k, 1247 article: c, 1248 aside: c, 1249 audio: a({ 1250 source: 1, 1251 track: 1 1252 }, c), 1253 b: b, 1254 base: k, 1255 bdi: b, 1256 bdo: b, 1257 blockquote: c, 1258 body: c, 1259 br: k, 1260 button: d(b, { 1261 a: 1, 1262 button: 1 1263 }), 1264 canvas: b, 1265 caption: c, 1266 cite: b, 1267 code: b, 1268 col: k, 1269 colgroup: { 1270 col: 1 1271 }, 1272 command: k, 1273 datalist: a({ 1274 option: 1 1275 }, b), 1276 dd: c, 1277 del: b, 1278 details: a({ 1279 summary: 1 1280 }, c), 1281 dfn: b, 1282 div: c, 1283 dl: { 1284 dt: 1, 1285 dd: 1 1286 }, 1287 dt: c, 1288 em: b, 1289 embed: k, 1290 fieldset: a({ 1291 legend: 1 1292 }, c), 1293 figcaption: c, 1294 figure: a({ 1295 figcaption: 1 1296 }, c), 1297 footer: c, 1298 form: c, 1299 h1: b, 1300 h2: b, 1301 h3: b, 1302 h4: b, 1303 h5: b, 1304 h6: b, 1305 head: a({ 1306 title: 1, 1307 base: 1 1308 }, h), 1309 header: c, 1310 hgroup: { 1311 h1: 1, 1312 h2: 1, 1313 h3: 1, 1314 h4: 1, 1315 h5: 1, 1316 h6: 1 1317 }, 1318 hr: k, 1319 html: a({ 1320 head: 1, 1321 body: 1 1322 }, c, h), 1323 i: b, 1324 iframe: g, 1325 img: k, 1326 input: k, 1327 ins: b, 1328 kbd: b, 1329 keygen: k, 1330 label: b, 1331 legend: b, 1332 li: c, 1333 link: k, 1334 main: c, 1335 map: c, 1336 mark: b, 1337 menu: a({ 1338 li: 1 1339 }, c), 1340 meta: k, 1341 meter: d(b, { 1342 meter: 1 1343 }), 1344 nav: c, 1345 noscript: a({ 1346 link: 1, 1347 meta: 1, 1348 style: 1 1349 }, b), 1350 object: a({ 1351 param: 1 1352 }, b), 1353 ol: { 1354 li: 1 1355 }, 1356 optgroup: { 1357 option: 1 1358 }, 1359 option: g, 1360 output: b, 1361 p: b, 1362 param: k, 1363 pre: b, 1364 progress: d(b, { 1365 progress: 1 1366 }), 1367 q: b, 1368 rp: b, 1369 rt: b, 1370 ruby: a({ 1371 rp: 1, 1372 rt: 1 1373 }, b), 1374 s: b, 1375 samp: b, 1376 script: g, 1377 section: c, 1378 select: { 1379 optgroup: 1, 1380 option: 1 1381 }, 1382 small: b, 1383 source: k, 1384 span: b, 1385 strong: b, 1386 style: g, 1387 sub: b, 1388 summary: a({ 1389 h1: 1, 1390 h2: 1, 1391 h3: 1, 1392 h4: 1, 1393 h5: 1, 1394 h6: 1 1395 }, b), 1396 sup: b, 1397 table: { 1398 caption: 1, 1399 colgroup: 1, 1400 thead: 1, 1401 tfoot: 1, 1402 tbody: 1, 1403 tr: 1 1404 }, 1405 tbody: { 1406 tr: 1 1407 }, 1408 td: c, 1409 textarea: g, 1410 tfoot: { 1411 tr: 1 1412 }, 1413 th: c, 1414 thead: { 1415 tr: 1 1416 }, 1417 time: d(b, { 1418 time: 1 1419 }), 1420 title: g, 1421 tr: { 1422 th: 1, 1423 td: 1 1424 }, 1425 track: k, 1426 u: b, 1427 ul: { 1428 li: 1 1429 }, 1430 "var": b, 1431 video: a({ 1432 source: 1, 1433 track: 1 1434 }, c), 1435 wbr: k, 1436 acronym: b, 1437 applet: a({ 1438 param: 1 1439 }, c), 1440 basefont: k, 1441 big: b, 1442 center: c, 1443 dialog: k, 1444 dir: { 1445 li: 1 1446 }, 1447 font: b, 1448 isindex: k, 1449 noframes: c, 1450 strike: b, 1451 tt: b 1452 }; 1453 a(d, { 1454 $block: a({ 1455 audio: 1, 1456 dd: 1, 1457 dt: 1, 1458 figcaption: 1, 1459 li: 1, 1460 video: 1 1461 }, f, n), 1462 $blockLimit: { 1463 article: 1, 1464 aside: 1, 1465 audio: 1, 1466 body: 1, 1467 caption: 1, 1468 details: 1, 1469 dir: 1, 1470 div: 1, 1471 dl: 1, 1472 fieldset: 1, 1473 figcaption: 1, 1474 figure: 1, 1475 footer: 1, 1476 form: 1, 1477 header: 1, 1478 hgroup: 1, 1479 main: 1, 1480 menu: 1, 1481 nav: 1, 1482 ol: 1, 1483 section: 1, 1484 table: 1, 1485 td: 1, 1486 th: 1, 1487 tr: 1, 1488 ul: 1, 1489 video: 1 1490 }, 1491 $cdata: { 1492 script: 1, 1493 style: 1 1494 }, 1495 $editable: { 1496 address: 1, 1497 article: 1, 1498 aside: 1, 1499 blockquote: 1, 1500 body: 1, 1501 details: 1, 1502 div: 1, 1503 fieldset: 1, 1504 figcaption: 1, 1505 footer: 1, 1506 form: 1, 1507 h1: 1, 1508 h2: 1, 1509 h3: 1, 1510 h4: 1, 1511 h5: 1, 1512 h6: 1, 1513 header: 1, 1514 hgroup: 1, 1515 main: 1, 1516 nav: 1, 1517 p: 1, 1518 pre: 1, 1519 section: 1 1520 }, 1521 $empty: { 1522 area: 1, 1523 base: 1, 1524 basefont: 1, 1525 br: 1, 1526 col: 1, 1527 command: 1, 1528 dialog: 1, 1529 embed: 1, 1530 hr: 1, 1531 img: 1, 1532 input: 1, 1533 isindex: 1, 1534 keygen: 1, 1535 link: 1, 1536 meta: 1, 1537 param: 1, 1538 source: 1, 1539 track: 1, 1540 wbr: 1 1541 }, 1542 $inline: b, 1543 $list: { 1544 dl: 1, 1545 ol: 1, 1546 ul: 1 1547 }, 1548 $listItem: { 1549 dd: 1, 1550 dt: 1, 1551 li: 1 1552 }, 1553 $nonBodyContent: a({ 1554 body: 1, 1555 head: 1, 1556 html: 1 1557 }, d.head), 1558 $nonEditable: { 1559 applet: 1, 1560 audio: 1, 1561 button: 1, 1562 embed: 1, 1563 iframe: 1, 1564 map: 1, 1565 object: 1, 1566 option: 1, 1567 param: 1, 1568 script: 1, 1569 textarea: 1, 1570 video: 1 1571 }, 1572 $object: { 1573 applet: 1, 1574 audio: 1, 1575 button: 1, 1576 hr: 1, 1577 iframe: 1, 1578 img: 1, 1579 input: 1, 1580 object: 1, 1581 select: 1, 1582 table: 1, 1583 textarea: 1, 1584 video: 1 1585 }, 1586 $removeEmpty: { 1587 abbr: 1, 1588 acronym: 1, 1589 b: 1, 1590 bdi: 1, 1591 bdo: 1, 1592 big: 1, 1593 cite: 1, 1594 code: 1, 1595 del: 1, 1596 dfn: 1, 1597 em: 1, 1598 font: 1, 1599 i: 1, 1600 ins: 1, 1601 label: 1, 1602 kbd: 1, 1603 mark: 1, 1604 meter: 1, 1605 output: 1, 1606 q: 1, 1607 ruby: 1, 1608 s: 1, 1609 samp: 1, 1610 small: 1, 1611 span: 1, 1612 strike: 1, 1613 strong: 1, 1614 sub: 1, 1615 sup: 1, 1616 time: 1, 1617 tt: 1, 1618 u: 1, 1619 "var": 1 1620 }, 1621 $tabIndex: { 1622 a: 1, 1623 area: 1, 1624 button: 1, 1625 input: 1, 1626 object: 1, 1627 select: 1, 1628 textarea: 1 1629 }, 1630 $tableContent: { 1631 caption: 1, 1632 col: 1, 1633 colgroup: 1, 1634 tbody: 1, 1635 td: 1, 1636 tfoot: 1, 1637 th: 1, 1638 thead: 1, 1639 tr: 1 1640 }, 1641 $transparent: { 1642 a: 1, 1643 audio: 1, 1644 canvas: 1, 1645 del: 1, 1646 ins: 1, 1647 map: 1, 1648 noscript: 1, 1649 object: 1, 1650 video: 1 1651 }, 1652 $intermediate: { 1653 caption: 1, 1654 colgroup: 1, 1655 dd: 1, 1656 dt: 1, 1657 figcaption: 1, 1658 legend: 1, 1659 li: 1, 1660 optgroup: 1, 1661 option: 1, 1662 rp: 1, 1663 rt: 1, 1664 summary: 1, 1665 tbody: 1, 1666 td: 1, 1667 tfoot: 1, 1668 th: 1, 1669 thead: 1, 1670 tr: 1 1671 } 1672 }); 1673 return d 1674 }(); 1675 CKEDITOR.dom.event = function(a) { 1676 this.$ = a 1677 }; 1678 CKEDITOR.dom.event.prototype = { 1679 getKey: function() { 1680 return this.$.keyCode || this.$.which 1681 }, 1682 getKeystroke: function() { 1683 var a = this.getKey(); 1684 if (this.$.ctrlKey || this.$.metaKey) a += CKEDITOR.CTRL; 1685 this.$.shiftKey && (a += CKEDITOR.SHIFT); 1686 this.$.altKey && (a += CKEDITOR.ALT); 1687 return a 1688 }, 1689 preventDefault: function(a) { 1690 var d = this.$; 1691 d.preventDefault ? d.preventDefault() : d.returnValue = !1; 1692 a && this.stopPropagation() 1693 }, 1694 stopPropagation: function() { 1695 var a = this.$; 1696 a.stopPropagation ? a.stopPropagation() : a.cancelBubble = !0 1697 }, 1698 getTarget: function() { 1699 var a = 1700 this.$.target || this.$.srcElement; 1701 return a ? new CKEDITOR.dom.node(a) : null 1702 }, 1703 getPhase: function() { 1704 return this.$.eventPhase || 2 1705 }, 1706 getPageOffset: function() { 1707 var a = this.getTarget().getDocument().$; 1708 return { 1709 x: this.$.pageX || this.$.clientX + (a.documentElement.scrollLeft || a.body.scrollLeft), 1710 y: this.$.pageY || this.$.clientY + (a.documentElement.scrollTop || a.body.scrollTop) 1711 } 1712 } 1713 }; 1714 CKEDITOR.CTRL = 1114112; 1715 CKEDITOR.SHIFT = 2228224; 1716 CKEDITOR.ALT = 4456448; 1717 CKEDITOR.EVENT_PHASE_CAPTURING = 1; 1718 CKEDITOR.EVENT_PHASE_AT_TARGET = 2; 1719 CKEDITOR.EVENT_PHASE_BUBBLING = 3; 1720 CKEDITOR.dom.domObject = function(a) { 1721 a && (this.$ = a) 1722 }; 1723 CKEDITOR.dom.domObject.prototype = function() { 1724 var a = function(a, b) { 1725 return function(c) { 1726 "undefined" != typeof CKEDITOR && a.fire(b, new CKEDITOR.dom.event(c)) 1727 } 1728 }; 1729 return { 1730 getPrivate: function() { 1731 var a; 1732 (a = this.getCustomData("_")) || this.setCustomData("_", a = {}); 1733 return a 1734 }, 1735 on: function(d) { 1736 var b = this.getCustomData("_cke_nativeListeners"); 1737 b || (b = {}, this.setCustomData("_cke_nativeListeners", b)); 1738 b[d] || (b = b[d] = a(this, d), this.$.addEventListener ? this.$.addEventListener(d, b, !!CKEDITOR.event.useCapture) : this.$.attachEvent && this.$.attachEvent("on" + 1739 d, b)); 1740 return CKEDITOR.event.prototype.on.apply(this, arguments) 1741 }, 1742 removeListener: function(a) { 1743 CKEDITOR.event.prototype.removeListener.apply(this, arguments); 1744 if (!this.hasListeners(a)) { 1745 var b = this.getCustomData("_cke_nativeListeners"), 1746 c = b && b[a]; 1747 c && (this.$.removeEventListener ? this.$.removeEventListener(a, c, !1) : this.$.detachEvent && this.$.detachEvent("on" + a, c), delete b[a]) 1748 } 1749 }, 1750 removeAllListeners: function() { 1751 var a = this.getCustomData("_cke_nativeListeners"), 1752 b; 1753 for (b in a) { 1754 var c = a[b]; 1755 this.$.detachEvent ? this.$.detachEvent("on" + 1756 b, c) : this.$.removeEventListener && this.$.removeEventListener(b, c, !1); 1757 delete a[b] 1758 } 1759 CKEDITOR.event.prototype.removeAllListeners.call(this) 1760 } 1761 } 1762 }(); 1763 (function(a) { 1764 var d = {}; 1765 CKEDITOR.on("reset", function() { 1766 d = {} 1767 }); 1768 a.equals = function(a) { 1769 try { 1770 return a && a.$ === this.$ 1771 } catch (c) { 1772 return !1 1773 } 1774 }; 1775 a.setCustomData = function(a, c) { 1776 var f = this.getUniqueId(); 1777 (d[f] || (d[f] = {}))[a] = c; 1778 return this 1779 }; 1780 a.getCustomData = function(a) { 1781 var c = this.$["data-cke-expando"]; 1782 return (c = c && d[c]) && a in c ? c[a] : null 1783 }; 1784 a.removeCustomData = function(a) { 1785 var c = this.$["data-cke-expando"], 1786 c = c && d[c], 1787 f, h; 1788 c && (f = c[a], h = a in c, delete c[a]); 1789 return h ? f : null 1790 }; 1791 a.clearCustomData = function() { 1792 this.removeAllListeners(); 1793 var a = 1794 this.$["data-cke-expando"]; 1795 a && delete d[a] 1796 }; 1797 a.getUniqueId = function() { 1798 return this.$["data-cke-expando"] || (this.$["data-cke-expando"] = CKEDITOR.tools.getNextNumber()) 1799 }; 1800 CKEDITOR.event.implementOn(a) 1801 })(CKEDITOR.dom.domObject.prototype); 1802 CKEDITOR.dom.node = function(a) { 1803 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 1804 }; 1805 CKEDITOR.dom.node.prototype = new CKEDITOR.dom.domObject; 1806 CKEDITOR.NODE_ELEMENT = 1; 1807 CKEDITOR.NODE_DOCUMENT = 9; 1808 CKEDITOR.NODE_TEXT = 3; 1809 CKEDITOR.NODE_COMMENT = 8; 1810 CKEDITOR.NODE_DOCUMENT_FRAGMENT = 11; 1811 CKEDITOR.POSITION_IDENTICAL = 0; 1812 CKEDITOR.POSITION_DISCONNECTED = 1; 1813 CKEDITOR.POSITION_FOLLOWING = 2; 1814 CKEDITOR.POSITION_PRECEDING = 4; 1815 CKEDITOR.POSITION_IS_CONTAINED = 8; 1816 CKEDITOR.POSITION_CONTAINS = 16; 1817 CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype, { 1818 appendTo: function(a, d) { 1819 a.append(this, d); 1820 return a 1821 }, 1822 clone: function(a, d) { 1823 function b(c) { 1824 c["data-cke-expando"] && (c["data-cke-expando"] = !1); 1825 if (c.nodeType == CKEDITOR.NODE_ELEMENT || c.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT) 1826 if (d || c.nodeType != CKEDITOR.NODE_ELEMENT || c.removeAttribute("id", !1), a) { 1827 c = c.childNodes; 1828 for (var f = 0; f < c.length; f++) b(c[f]) 1829 } 1830 } 1831 1832 function c(b) { 1833 if (b.type == CKEDITOR.NODE_ELEMENT || b.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT) { 1834 if (b.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) { 1835 var d = 1836 b.getName(); 1837 ":" == d[0] && b.renameNode(d.substring(1)) 1838 } 1839 if (a) 1840 for (d = 0; d < b.getChildCount(); d++) c(b.getChild(d)) 1841 } 1842 } 1843 var f = this.$.cloneNode(a); 1844 b(f); 1845 f = new CKEDITOR.dom.node(f); 1846 CKEDITOR.env.ie && 9 > CKEDITOR.env.version && (this.type == CKEDITOR.NODE_ELEMENT || this.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT) && c(f); 1847 return f 1848 }, 1849 hasPrevious: function() { 1850 return !!this.$.previousSibling 1851 }, 1852 hasNext: function() { 1853 return !!this.$.nextSibling 1854 }, 1855 insertAfter: function(a) { 1856 a.$.parentNode.insertBefore(this.$, a.$.nextSibling); 1857 return a 1858 }, 1859 insertBefore: function(a) { 1860 a.$.parentNode.insertBefore(this.$, 1861 a.$); 1862 return a 1863 }, 1864 insertBeforeMe: function(a) { 1865 this.$.parentNode.insertBefore(a.$, this.$); 1866 return a 1867 }, 1868 getAddress: function(a) { 1869 for (var d = [], b = this.getDocument().$.documentElement, c = this.$; c && c != b;) { 1870 var f = c.parentNode; 1871 f && d.unshift(this.getIndex.call({ 1872 $: c 1873 }, a)); 1874 c = f 1875 } 1876 return d 1877 }, 1878 getDocument: function() { 1879 return new CKEDITOR.dom.document(this.$.ownerDocument || this.$.parentNode.ownerDocument) 1880 }, 1881 getIndex: function(a) { 1882 function d(a, c) { 1883 var n = c ? a.nextSibling : a.previousSibling; 1884 return n && n.nodeType == CKEDITOR.NODE_TEXT ? b(n) ? d(n, 1885 c) : n : null 1886 } 1887 1888 function b(a) { 1889 return !a.nodeValue || a.nodeValue == CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE 1890 } 1891 var c = this.$, 1892 f = -1, 1893 h; 1894 if (!this.$.parentNode || a && c.nodeType == CKEDITOR.NODE_TEXT && b(c) && !d(c) && !d(c, !0)) return -1; 1895 do a && c != this.$ && c.nodeType == CKEDITOR.NODE_TEXT && (h || b(c)) || (f++, h = c.nodeType == CKEDITOR.NODE_TEXT); while (c = c.previousSibling); 1896 return f 1897 }, 1898 getNextSourceNode: function(a, d, b) { 1899 if (b && !b.call) { 1900 var c = b; 1901 b = function(a) { 1902 return !a.equals(c) 1903 } 1904 } 1905 a = !a && this.getFirst && this.getFirst(); 1906 var f; 1907 if (!a) { 1908 if (this.type == 1909 CKEDITOR.NODE_ELEMENT && b && !1 === b(this, !0)) return null; 1910 a = this.getNext() 1911 } 1912 for (; !a && (f = (f || this).getParent());) { 1913 if (b && !1 === b(f, !0)) return null; 1914 a = f.getNext() 1915 } 1916 return !a || b && !1 === b(a) ? null : d && d != a.type ? a.getNextSourceNode(!1, d, b) : a 1917 }, 1918 getPreviousSourceNode: function(a, d, b) { 1919 if (b && !b.call) { 1920 var c = b; 1921 b = function(a) { 1922 return !a.equals(c) 1923 } 1924 } 1925 a = !a && this.getLast && this.getLast(); 1926 var f; 1927 if (!a) { 1928 if (this.type == CKEDITOR.NODE_ELEMENT && b && !1 === b(this, !0)) return null; 1929 a = this.getPrevious() 1930 } 1931 for (; !a && (f = (f || this).getParent());) { 1932 if (b && !1 === 1933 b(f, !0)) return null; 1934 a = f.getPrevious() 1935 } 1936 return !a || b && !1 === b(a) ? null : d && a.type != d ? a.getPreviousSourceNode(!1, d, b) : a 1937 }, 1938 getPrevious: function(a) { 1939 var d = this.$, 1940 b; 1941 do b = (d = d.previousSibling) && 10 != d.nodeType && new CKEDITOR.dom.node(d); while (b && a && !a(b)); 1942 return b 1943 }, 1944 getNext: function(a) { 1945 var d = this.$, 1946 b; 1947 do b = (d = d.nextSibling) && new CKEDITOR.dom.node(d); while (b && a && !a(b)); 1948 return b 1949 }, 1950 getParent: function(a) { 1951 var d = this.$.parentNode; 1952 return d && (d.nodeType == CKEDITOR.NODE_ELEMENT || a && d.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT) ? 1953 new CKEDITOR.dom.node(d) : null 1954 }, 1955 getParents: function(a) { 1956 var d = this, 1957 b = []; 1958 do b[a ? "push" : "unshift"](d); while (d = d.getParent()); 1959 return b 1960 }, 1961 getCommonAncestor: function(a) { 1962 if (a.equals(this)) return this; 1963 if (a.contains && a.contains(this)) return a; 1964 var d = this.contains ? this : this.getParent(); 1965 do 1966 if (d.contains(a)) return d; while (d = d.getParent()); 1967 return null 1968 }, 1969 getPosition: function(a) { 1970 var d = this.$, 1971 b = a.$; 1972 if (d.compareDocumentPosition) return d.compareDocumentPosition(b); 1973 if (d == b) return CKEDITOR.POSITION_IDENTICAL; 1974 if (this.type == 1975 CKEDITOR.NODE_ELEMENT && a.type == CKEDITOR.NODE_ELEMENT) { 1976 if (d.contains) { 1977 if (d.contains(b)) return CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING; 1978 if (b.contains(d)) return CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING 1979 } 1980 if ("sourceIndex" in d) return 0 > d.sourceIndex || 0 > b.sourceIndex ? CKEDITOR.POSITION_DISCONNECTED : d.sourceIndex < b.sourceIndex ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING 1981 } 1982 d = this.getAddress(); 1983 a = a.getAddress(); 1984 for (var b = Math.min(d.length, a.length), c = 0; c < b; c++) 1985 if (d[c] != 1986 a[c]) return d[c] < a[c] ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING; 1987 return d.length < a.length ? CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING 1988 }, 1989 getAscendant: function(a, d) { 1990 var b = this.$, 1991 c, f; 1992 d || (b = b.parentNode); 1993 "function" == typeof a ? (f = !0, c = a) : (f = !1, c = function(b) { 1994 b = "string" == typeof b.nodeName ? b.nodeName.toLowerCase() : ""; 1995 return "string" == typeof a ? b == a : b in a 1996 }); 1997 for (; b;) { 1998 if (c(f ? new CKEDITOR.dom.node(b) : b)) return new CKEDITOR.dom.node(b); 1999 try { 2000 b = b.parentNode 2001 } catch (h) { 2002 b = null 2003 } 2004 } 2005 return null 2006 }, 2007 hasAscendant: function(a, d) { 2008 var b = this.$; 2009 d || (b = b.parentNode); 2010 for (; b;) { 2011 if (b.nodeName && b.nodeName.toLowerCase() == a) return !0; 2012 b = b.parentNode 2013 } 2014 return !1 2015 }, 2016 move: function(a, d) { 2017 a.append(this.remove(), d) 2018 }, 2019 remove: function(a) { 2020 var d = this.$, 2021 b = d.parentNode; 2022 if (b) { 2023 if (a) 2024 for (; a = d.firstChild;) b.insertBefore(d.removeChild(a), d); 2025 b.removeChild(d) 2026 } 2027 return this 2028 }, 2029 replace: function(a) { 2030 this.insertBefore(a); 2031 a.remove() 2032 }, 2033 trim: function() { 2034 this.ltrim(); 2035 this.rtrim() 2036 }, 2037 ltrim: function() { 2038 for (var a; this.getFirst && 2039 (a = this.getFirst());) { 2040 if (a.type == CKEDITOR.NODE_TEXT) { 2041 var d = CKEDITOR.tools.ltrim(a.getText()), 2042 b = a.getLength(); 2043 if (d) d.length < b && (a.split(b - d.length), this.$.removeChild(this.$.firstChild)); 2044 else { 2045 a.remove(); 2046 continue 2047 } 2048 } 2049 break 2050 } 2051 }, 2052 rtrim: function() { 2053 for (var a; this.getLast && (a = this.getLast());) { 2054 if (a.type == CKEDITOR.NODE_TEXT) { 2055 var d = CKEDITOR.tools.rtrim(a.getText()), 2056 b = a.getLength(); 2057 if (d) d.length < b && (a.split(d.length), this.$.lastChild.parentNode.removeChild(this.$.lastChild)); 2058 else { 2059 a.remove(); 2060 continue 2061 } 2062 } 2063 break 2064 } 2065 CKEDITOR.env.needsBrFiller && 2066 (a = this.$.lastChild) && 1 == a.type && "br" == a.nodeName.toLowerCase() && a.parentNode.removeChild(a) 2067 }, 2068 isReadOnly: function(a) { 2069 var d = this; 2070 this.type != CKEDITOR.NODE_ELEMENT && (d = this.getParent()); 2071 CKEDITOR.env.edge && d && d.is("textarea", "input") && (a = !0); 2072 if (!a && d && "undefined" != typeof d.$.isContentEditable) return !(d.$.isContentEditable || d.data("cke-editable")); 2073 for (; d;) { 2074 if (d.data("cke-editable")) return !1; 2075 if (d.hasAttribute("contenteditable")) return "false" == d.getAttribute("contenteditable"); 2076 d = d.getParent() 2077 } 2078 return !0 2079 } 2080 }); 2081 CKEDITOR.dom.window = function(a) { 2082 CKEDITOR.dom.domObject.call(this, a) 2083 }; 2084 CKEDITOR.dom.window.prototype = new CKEDITOR.dom.domObject; 2085 CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype, { 2086 focus: function() { 2087 this.$.focus() 2088 }, 2089 getViewPaneSize: function() { 2090 var a = this.$.document, 2091 d = "CSS1Compat" == a.compatMode; 2092 return { 2093 width: (d ? a.documentElement.clientWidth : a.body.clientWidth) || 0, 2094 height: (d ? a.documentElement.clientHeight : a.body.clientHeight) || 0 2095 } 2096 }, 2097 getScrollPosition: function() { 2098 var a = this.$; 2099 if ("pageXOffset" in a) return { 2100 x: a.pageXOffset || 0, 2101 y: a.pageYOffset || 0 2102 }; 2103 a = a.document; 2104 return { 2105 x: a.documentElement.scrollLeft || a.body.scrollLeft || 0, 2106 y: a.documentElement.scrollTop || 2107 a.body.scrollTop || 0 2108 } 2109 }, 2110 getFrame: function() { 2111 var a = this.$.frameElement; 2112 return a ? new CKEDITOR.dom.element.get(a) : null 2113 } 2114 }); 2115 CKEDITOR.dom.document = function(a) { 2116 CKEDITOR.dom.domObject.call(this, a) 2117 }; 2118 CKEDITOR.dom.document.prototype = new CKEDITOR.dom.domObject; 2119 CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype, { 2120 type: CKEDITOR.NODE_DOCUMENT, 2121 appendStyleSheet: function(a) { 2122 if (this.$.createStyleSheet) this.$.createStyleSheet(a); 2123 else { 2124 var d = new CKEDITOR.dom.element("link"); 2125 d.setAttributes({ 2126 rel: "stylesheet", 2127 type: "text/css", 2128 href: a 2129 }); 2130 this.getHead().append(d) 2131 } 2132 }, 2133 appendStyleText: function(a) { 2134 if (this.$.createStyleSheet) { 2135 var d = this.$.createStyleSheet(""); 2136 d.cssText = a 2137 } else { 2138 var b = new CKEDITOR.dom.element("style", this); 2139 b.append(new CKEDITOR.dom.text(a, this)); 2140 this.getHead().append(b) 2141 } 2142 return d || 2143 b.$.sheet 2144 }, 2145 createElement: function(a, d) { 2146 var b = new CKEDITOR.dom.element(a, this); 2147 d && (d.attributes && b.setAttributes(d.attributes), d.styles && b.setStyles(d.styles)); 2148 return b 2149 }, 2150 createText: function(a) { 2151 return new CKEDITOR.dom.text(a, this) 2152 }, 2153 focus: function() { 2154 this.getWindow().focus() 2155 }, 2156 getActive: function() { 2157 var a; 2158 try { 2159 a = this.$.activeElement 2160 } catch (d) { 2161 return null 2162 } 2163 return new CKEDITOR.dom.element(a) 2164 }, 2165 getById: function(a) { 2166 return (a = this.$.getElementById(a)) ? new CKEDITOR.dom.element(a) : null 2167 }, 2168 getByAddress: function(a, d) { 2169 for (var b = 2170 this.$.documentElement, c = 0; b && c < a.length; c++) { 2171 var f = a[c]; 2172 if (d) 2173 for (var h = -1, k = 0; k < b.childNodes.length; k++) { 2174 var g = b.childNodes[k]; 2175 if (!0 !== d || 3 != g.nodeType || !g.previousSibling || 3 != g.previousSibling.nodeType) 2176 if (h++, h == f) { 2177 b = g; 2178 break 2179 } 2180 } else b = b.childNodes[f] 2181 } 2182 return b ? new CKEDITOR.dom.node(b) : null 2183 }, 2184 getElementsByTag: function(a, d) { 2185 CKEDITOR.env.ie && 8 >= document.documentMode || !d || (a = d + ":" + a); 2186 return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a)) 2187 }, 2188 getHead: function() { 2189 var a = this.$.getElementsByTagName("head")[0]; 2190 return a = a ? new CKEDITOR.dom.element(a) : this.getDocumentElement().append(new CKEDITOR.dom.element("head"), !0) 2191 }, 2192 getBody: function() { 2193 return new CKEDITOR.dom.element(this.$.body) 2194 }, 2195 getDocumentElement: function() { 2196 return new CKEDITOR.dom.element(this.$.documentElement) 2197 }, 2198 getWindow: function() { 2199 return new CKEDITOR.dom.window(this.$.parentWindow || this.$.defaultView) 2200 }, 2201 write: function(a) { 2202 this.$.open("text/html", "replace"); 2203 CKEDITOR.env.ie && (a = a.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i, '$\x26\n\x3cscript data-cke-temp\x3d"1"\x3e(' + 2204 CKEDITOR.tools.fixDomain + ")();\x3c/script\x3e")); 2205 this.$.write(a); 2206 this.$.close() 2207 }, 2208 find: function(a) { 2209 return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(a)) 2210 }, 2211 findOne: function(a) { 2212 return (a = this.$.querySelector(a)) ? new CKEDITOR.dom.element(a) : null 2213 }, 2214 _getHtml5ShivFrag: function() { 2215 var a = this.getCustomData("html5ShivFrag"); 2216 a || (a = this.$.createDocumentFragment(), CKEDITOR.tools.enableHtml5Elements(a, !0), this.setCustomData("html5ShivFrag", a)); 2217 return a 2218 } 2219 }); 2220 CKEDITOR.dom.nodeList = function(a) { 2221 this.$ = a 2222 }; 2223 CKEDITOR.dom.nodeList.prototype = { 2224 count: function() { 2225 return this.$.length 2226 }, 2227 getItem: function(a) { 2228 return 0 > a || a >= this.$.length ? null : (a = this.$[a]) ? new CKEDITOR.dom.node(a) : null 2229 }, 2230 toArray: function() { 2231 return CKEDITOR.tools.array.map(this.$, function(a) { 2232 return new CKEDITOR.dom.node(a) 2233 }) 2234 } 2235 }; 2236 CKEDITOR.dom.element = function(a, d) { 2237 "string" == typeof a && (a = (d ? d.$ : document).createElement(a)); 2238 CKEDITOR.dom.domObject.call(this, a) 2239 }; 2240 CKEDITOR.dom.element.get = function(a) { 2241 return (a = "string" == typeof a ? document.getElementById(a) || document.getElementsByName(a)[0] : a) && (a.$ ? a : new CKEDITOR.dom.element(a)) 2242 }; 2243 CKEDITOR.dom.element.prototype = new CKEDITOR.dom.node; 2244 CKEDITOR.dom.element.createFromHtml = function(a, d) { 2245 var b = new CKEDITOR.dom.element("div", d); 2246 b.setHtml(a); 2247 return b.getFirst().remove() 2248 }; 2249 CKEDITOR.dom.element.setMarker = function(a, d, b, c) { 2250 var f = d.getCustomData("list_marker_id") || d.setCustomData("list_marker_id", CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"), 2251 h = d.getCustomData("list_marker_names") || d.setCustomData("list_marker_names", {}).getCustomData("list_marker_names"); 2252 a[f] = d; 2253 h[b] = 1; 2254 return d.setCustomData(b, c) 2255 }; 2256 CKEDITOR.dom.element.clearAllMarkers = function(a) { 2257 for (var d in a) CKEDITOR.dom.element.clearMarkers(a, a[d], 1) 2258 }; 2259 CKEDITOR.dom.element.clearMarkers = function(a, d, b) { 2260 var c = d.getCustomData("list_marker_names"), 2261 f = d.getCustomData("list_marker_id"), 2262 h; 2263 for (h in c) d.removeCustomData(h); 2264 d.removeCustomData("list_marker_names"); 2265 b && (d.removeCustomData("list_marker_id"), delete a[f]) 2266 }; 2267 (function() { 2268 function a(a, b) { 2269 return -1 < (" " + a + " ").replace(h, " ").indexOf(" " + b + " ") 2270 } 2271 2272 function d(a) { 2273 var b = !0; 2274 a.$.id || (a.$.id = "cke_tmp_" + CKEDITOR.tools.getNextNumber(), b = !1); 2275 return function() { 2276 b || a.removeAttribute("id") 2277 } 2278 } 2279 2280 function b(a, b) { 2281 var c = CKEDITOR.tools.escapeCss(a.$.id); 2282 return "#" + c + " " + b.split(/,\s*/).join(", #" + c + " ") 2283 } 2284 2285 function c(a) { 2286 for (var b = 0, c = 0, e = k[a].length; c < e; c++) b += parseFloat(this.getComputedStyle(k[a][c]) || 0, 10) || 0; 2287 return b 2288 } 2289 var f = document.createElement("_").classList, 2290 f = "undefined" !== typeof f && 2291 null !== String(f.add).match(/\[Native code\]/gi), 2292 h = /[\n\t\r]/g; 2293 CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype, { 2294 type: CKEDITOR.NODE_ELEMENT, 2295 addClass: f ? function(a) { 2296 this.$.classList.add(a); 2297 return this 2298 } : function(b) { 2299 var c = this.$.className; 2300 c && (a(c, b) || (c += " " + b)); 2301 this.$.className = c || b; 2302 return this 2303 }, 2304 removeClass: f ? function(a) { 2305 var b = this.$; 2306 b.classList.remove(a); 2307 b.className || b.removeAttribute("class"); 2308 return this 2309 } : function(b) { 2310 var c = this.getAttribute("class"); 2311 c && a(c, b) && ((c = c.replace(new RegExp("(?:^|\\s+)" + 2312 b + "(?\x3d\\s|$)"), "").replace(/^\s+/, "")) ? this.setAttribute("class", c) : this.removeAttribute("class")); 2313 return this 2314 }, 2315 hasClass: function(b) { 2316 return a(this.$.className, b) 2317 }, 2318 append: function(a, b) { 2319 "string" == typeof a && (a = this.getDocument().createElement(a)); 2320 b ? this.$.insertBefore(a.$, this.$.firstChild) : this.$.appendChild(a.$); 2321 return a 2322 }, 2323 appendHtml: function(a) { 2324 if (this.$.childNodes.length) { 2325 var b = new CKEDITOR.dom.element("div", this.getDocument()); 2326 b.setHtml(a); 2327 b.moveChildren(this) 2328 } else this.setHtml(a) 2329 }, 2330 appendText: function(a) { 2331 null != 2332 this.$.text && CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? this.$.text += a : this.append(new CKEDITOR.dom.text(a)) 2333 }, 2334 appendBogus: function(a) { 2335 if (a || CKEDITOR.env.needsBrFiller) { 2336 for (a = this.getLast(); a && a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.rtrim(a.getText());) a = a.getPrevious(); 2337 a && a.is && a.is("br") || (a = this.getDocument().createElement("br"), CKEDITOR.env.gecko && a.setAttribute("type", "_moz"), this.append(a)) 2338 } 2339 }, 2340 breakParent: function(a, b) { 2341 var c = new CKEDITOR.dom.range(this.getDocument()); 2342 c.setStartAfter(this); 2343 c.setEndAfter(a); 2344 var e = c.extractContents(!1, b || !1), 2345 d; 2346 c.insertNode(this.remove()); 2347 if (CKEDITOR.env.ie && !CKEDITOR.env.edge) { 2348 for (c = new CKEDITOR.dom.element("div"); d = e.getFirst();) d.$.style.backgroundColor && (d.$.style.backgroundColor = d.$.style.backgroundColor), c.append(d); 2349 c.insertAfter(this); 2350 c.remove(!0) 2351 } else e.insertAfterNode(this) 2352 }, 2353 contains: document.compareDocumentPosition ? function(a) { 2354 return !!(this.$.compareDocumentPosition(a.$) & 16) 2355 } : function(a) { 2356 var b = this.$; 2357 return a.type != CKEDITOR.NODE_ELEMENT ? b.contains(a.getParent().$) : 2358 b != a.$ && b.contains(a.$) 2359 }, 2360 focus: function() { 2361 function a() { 2362 try { 2363 this.$.focus() 2364 } catch (b) {} 2365 } 2366 return function(b) { 2367 b ? CKEDITOR.tools.setTimeout(a, 100, this) : a.call(this) 2368 } 2369 }(), 2370 getHtml: function() { 2371 var a = this.$.innerHTML; 2372 return CKEDITOR.env.ie ? a.replace(/<\?[^>]*>/g, "") : a 2373 }, 2374 getOuterHtml: function() { 2375 if (this.$.outerHTML) return this.$.outerHTML.replace(/<\?[^>]*>/, ""); 2376 var a = this.$.ownerDocument.createElement("div"); 2377 a.appendChild(this.$.cloneNode(!0)); 2378 return a.innerHTML 2379 }, 2380 getClientRect: function(a) { 2381 var b = CKEDITOR.tools.extend({}, 2382 this.$.getBoundingClientRect()); 2383 !b.width && (b.width = b.right - b.left); 2384 !b.height && (b.height = b.bottom - b.top); 2385 return a ? CKEDITOR.tools.getAbsoluteRectPosition(this.getWindow(), b) : b 2386 }, 2387 setHtml: CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? function(a) { 2388 try { 2389 var b = this.$; 2390 if (this.getParent()) return b.innerHTML = a; 2391 var c = this.getDocument()._getHtml5ShivFrag(); 2392 c.appendChild(b); 2393 b.innerHTML = a; 2394 c.removeChild(b); 2395 return a 2396 } catch (e) { 2397 this.$.innerHTML = ""; 2398 b = new CKEDITOR.dom.element("body", this.getDocument()); 2399 b.$.innerHTML = a; 2400 for (b = b.getChildren(); b.count();) this.append(b.getItem(0)); 2401 return a 2402 } 2403 } : function(a) { 2404 return this.$.innerHTML = a 2405 }, 2406 setText: function() { 2407 var a = document.createElement("p"); 2408 a.innerHTML = "x"; 2409 a = a.textContent; 2410 return function(b) { 2411 this.$[a ? "textContent" : "innerText"] = b 2412 } 2413 }(), 2414 getAttribute: function() { 2415 var a = function(a) { 2416 return this.$.getAttribute(a, 2) 2417 }; 2418 return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(a) { 2419 switch (a) { 2420 case "class": 2421 a = "className"; 2422 break; 2423 case "http-equiv": 2424 a = "httpEquiv"; 2425 break; 2426 case "name": 2427 return this.$.name; 2428 case "tabindex": 2429 return a = this.$.getAttribute(a, 2430 2), 0 !== a && 0 === this.$.tabIndex && (a = null), a; 2431 case "checked": 2432 return a = this.$.attributes.getNamedItem(a), (a.specified ? a.nodeValue : this.$.checked) ? "checked" : null; 2433 case "hspace": 2434 case "value": 2435 return this.$[a]; 2436 case "style": 2437 return this.$.style.cssText; 2438 case "contenteditable": 2439 case "contentEditable": 2440 return this.$.attributes.getNamedItem("contentEditable").specified ? this.$.getAttribute("contentEditable") : null 2441 } 2442 return this.$.getAttribute(a, 2) 2443 } : a 2444 }(), 2445 getAttributes: function(a) { 2446 var b = {}, 2447 c = this.$.attributes, 2448 e; 2449 a = CKEDITOR.tools.isArray(a) ? 2450 a : []; 2451 for (e = 0; e < c.length; e++) - 1 === CKEDITOR.tools.indexOf(a, c[e].name) && (b[c[e].name] = c[e].value); 2452 return b 2453 }, 2454 getChildren: function() { 2455 return new CKEDITOR.dom.nodeList(this.$.childNodes) 2456 }, 2457 getComputedStyle: document.defaultView && document.defaultView.getComputedStyle ? function(a) { 2458 var b = this.getWindow().$.getComputedStyle(this.$, null); 2459 return b ? b.getPropertyValue(a) : "" 2460 } : function(a) { 2461 return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(a)] 2462 }, 2463 getDtd: function() { 2464 var a = CKEDITOR.dtd[this.getName()]; 2465 this.getDtd = 2466 function() { 2467 return a 2468 }; 2469 return a 2470 }, 2471 getElementsByTag: CKEDITOR.dom.document.prototype.getElementsByTag, 2472 getTabIndex: function() { 2473 var a = this.$.tabIndex; 2474 return 0 !== a || CKEDITOR.dtd.$tabIndex[this.getName()] || 0 === parseInt(this.getAttribute("tabindex"), 10) ? a : -1 2475 }, 2476 getText: function() { 2477 return this.$.textContent || this.$.innerText || "" 2478 }, 2479 getWindow: function() { 2480 return this.getDocument().getWindow() 2481 }, 2482 getId: function() { 2483 return this.$.id || null 2484 }, 2485 getNameAtt: function() { 2486 return this.$.name || null 2487 }, 2488 getName: function() { 2489 var a = this.$.nodeName.toLowerCase(); 2490 if (CKEDITOR.env.ie && 8 >= document.documentMode) { 2491 var b = this.$.scopeName; 2492 "HTML" != b && (a = b.toLowerCase() + ":" + a) 2493 } 2494 this.getName = function() { 2495 return a 2496 }; 2497 return this.getName() 2498 }, 2499 getValue: function() { 2500 return this.$.value 2501 }, 2502 getFirst: function(a) { 2503 var b = this.$.firstChild; 2504 (b = b && new CKEDITOR.dom.node(b)) && a && !a(b) && (b = b.getNext(a)); 2505 return b 2506 }, 2507 getLast: function(a) { 2508 var b = this.$.lastChild; 2509 (b = b && new CKEDITOR.dom.node(b)) && a && !a(b) && (b = b.getPrevious(a)); 2510 return b 2511 }, 2512 getStyle: function(a) { 2513 return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)] 2514 }, 2515 is: function() { 2516 var a = this.getName(); 2517 if ("object" == typeof arguments[0]) return !!arguments[0][a]; 2518 for (var b = 0; b < arguments.length; b++) 2519 if (arguments[b] == a) return !0; 2520 return !1 2521 }, 2522 isEditable: function(a) { 2523 var b = this.getName(); 2524 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] || 2525 CKEDITOR.dtd.span, !(!a || !a["#"])) : !0 2526 }, 2527 isIdentical: function(a) { 2528 var b = this.clone(0, 1); 2529 a = a.clone(0, 1); 2530 b.removeAttributes(["_moz_dirty", "data-cke-expando", "data-cke-saved-href", "data-cke-saved-name"]); 2531 a.removeAttributes(["_moz_dirty", "data-cke-expando", "data-cke-saved-href", "data-cke-saved-name"]); 2532 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.$); 2533 b = b.getOuterHtml(); 2534 a = 2535 a.getOuterHtml(); 2536 if (CKEDITOR.env.ie && 9 > CKEDITOR.env.version && this.is("a")) { 2537 var c = this.getParent(); 2538 c.type == CKEDITOR.NODE_ELEMENT && (c = c.clone(), c.setHtml(b), b = c.getHtml(), c.setHtml(a), a = c.getHtml()) 2539 } 2540 return b == a 2541 }, 2542 isVisible: function() { 2543 var a = (this.$.offsetHeight || this.$.offsetWidth) && "hidden" != this.getComputedStyle("visibility"), 2544 b, c; 2545 a && CKEDITOR.env.webkit && (b = this.getWindow(), !b.equals(CKEDITOR.document.getWindow()) && (c = b.$.frameElement) && (a = (new CKEDITOR.dom.element(c)).isVisible())); 2546 return !!a 2547 }, 2548 isEmptyInlineRemoveable: function() { 2549 if (!CKEDITOR.dtd.$removeEmpty[this.getName()]) return !1; 2550 for (var a = this.getChildren(), b = 0, c = a.count(); b < c; b++) { 2551 var e = a.getItem(b); 2552 if (e.type != CKEDITOR.NODE_ELEMENT || !e.data("cke-bookmark")) 2553 if (e.type == CKEDITOR.NODE_ELEMENT && !e.isEmptyInlineRemoveable() || e.type == CKEDITOR.NODE_TEXT && CKEDITOR.tools.trim(e.getText())) return !1 2554 } 2555 return !0 2556 }, 2557 hasAttributes: CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function() { 2558 for (var a = this.$.attributes, b = 0; b < a.length; b++) { 2559 var c = a[b]; 2560 switch (c.nodeName) { 2561 case "class": 2562 if (this.getAttribute("class")) return !0; 2563 case "data-cke-expando": 2564 continue; 2565 default: 2566 if (c.specified) return !0 2567 } 2568 } 2569 return !1 2570 } : function() { 2571 var a = this.$.attributes, 2572 b = a.length, 2573 c = { 2574 "data-cke-expando": 1, 2575 _moz_dirty: 1 2576 }; 2577 return 0 < b && (2 < b || !c[a[0].nodeName] || 2 == b && !c[a[1].nodeName]) 2578 }, 2579 hasAttribute: function() { 2580 function a(b) { 2581 var c = this.$.attributes.getNamedItem(b); 2582 if ("input" == this.getName()) switch (b) { 2583 case "class": 2584 return 0 < this.$.className.length; 2585 case "checked": 2586 return !!this.$.checked; 2587 case "value": 2588 return b = this.getAttribute("type"), "checkbox" == b || "radio" == b ? "on" != this.$.value : !!this.$.value 2589 } 2590 return c ? 2591 c.specified : !1 2592 } 2593 return CKEDITOR.env.ie ? 8 > CKEDITOR.env.version ? function(b) { 2594 return "name" == b ? !!this.$.name : a.call(this, b) 2595 } : a : function(a) { 2596 return !!this.$.attributes.getNamedItem(a) 2597 } 2598 }(), 2599 hide: function() { 2600 this.setStyle("display", "none") 2601 }, 2602 moveChildren: function(a, b) { 2603 var c = this.$; 2604 a = a.$; 2605 if (c != a) { 2606 var e; 2607 if (b) 2608 for (; e = c.lastChild;) a.insertBefore(c.removeChild(e), a.firstChild); 2609 else 2610 for (; e = c.firstChild;) a.appendChild(c.removeChild(e)) 2611 } 2612 }, 2613 mergeSiblings: function() { 2614 function a(b, c, e) { 2615 if (c && c.type == CKEDITOR.NODE_ELEMENT) { 2616 for (var d = []; c.data("cke-bookmark") || c.isEmptyInlineRemoveable();) 2617 if (d.push(c), c = e ? c.getNext() : c.getPrevious(), !c || c.type != CKEDITOR.NODE_ELEMENT) return; 2618 if (b.isIdentical(c)) { 2619 for (var g = e ? b.getLast() : b.getFirst(); d.length;) d.shift().move(b, !e); 2620 c.moveChildren(b, !e); 2621 c.remove(); 2622 g && g.type == CKEDITOR.NODE_ELEMENT && g.mergeSiblings() 2623 } 2624 } 2625 } 2626 return function(b) { 2627 if (!1 === b || CKEDITOR.dtd.$removeEmpty[this.getName()] || this.is("a")) a(this, this.getNext(), !0), a(this, this.getPrevious()) 2628 } 2629 }(), 2630 show: function() { 2631 this.setStyles({ 2632 display: "", 2633 visibility: "" 2634 }) 2635 }, 2636 setAttribute: function() { 2637 var a = function(a, b) { 2638 this.$.setAttribute(a, b); 2639 return this 2640 }; 2641 return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(b, c) { 2642 "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); 2643 return this 2644 } : CKEDITOR.env.ie8Compat && CKEDITOR.env.secure ? function(b, c) { 2645 if ("src" == b && c.match(/^http:\/\//)) try { 2646 a.apply(this, 2647 arguments) 2648 } catch (e) {} else a.apply(this, arguments); 2649 return this 2650 } : a 2651 }(), 2652 setAttributes: function(a) { 2653 for (var b in a) this.setAttribute(b, a[b]); 2654 return this 2655 }, 2656 setValue: function(a) { 2657 this.$.value = a; 2658 return this 2659 }, 2660 removeAttribute: function() { 2661 var a = function(a) { 2662 this.$.removeAttribute(a) 2663 }; 2664 return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(a) { 2665 "class" == a ? a = "className" : "tabindex" == a ? a = "tabIndex" : "contenteditable" == a && (a = "contentEditable"); 2666 this.$.removeAttribute(a) 2667 } : a 2668 }(), 2669 removeAttributes: function(a) { 2670 if (CKEDITOR.tools.isArray(a)) 2671 for (var b = 2672 0; b < a.length; b++) this.removeAttribute(a[b]); 2673 else 2674 for (b in a = a || this.getAttributes(), a) a.hasOwnProperty(b) && this.removeAttribute(b) 2675 }, 2676 removeStyle: function(a) { 2677 var b = this.$.style; 2678 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"); 2679 else { 2680 var c = ["top", "left", "right", "bottom"], 2681 e; 2682 "border" == a && (e = ["color", "style", "width"]); 2683 for (var b = [], d = 0; d < c.length; d++) 2684 if (e) 2685 for (var v = 2686 0; v < e.length; v++) b.push([a, c[d], e[v]].join("-")); 2687 else b.push([a, c[d]].join("-")); 2688 for (a = 0; a < b.length; a++) this.removeStyle(b[a]) 2689 } 2690 }, 2691 setStyle: function(a, b) { 2692 this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)] = b; 2693 return this 2694 }, 2695 setStyles: function(a) { 2696 for (var b in a) this.setStyle(b, a[b]); 2697 return this 2698 }, 2699 setOpacity: function(a) { 2700 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) 2701 }, 2702 unselectable: function() { 2703 this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select", 2704 "none")); 2705 if (CKEDITOR.env.ie) { 2706 this.setAttribute("unselectable", "on"); 2707 for (var a, b = this.getElementsByTag("*"), c = 0, e = b.count(); c < e; c++) a = b.getItem(c), a.setAttribute("unselectable", "on") 2708 } 2709 }, 2710 getPositionedAncestor: function() { 2711 for (var a = this; 2712 "html" != a.getName();) { 2713 if ("static" != a.getComputedStyle("position")) return a; 2714 a = a.getParent() 2715 } 2716 return null 2717 }, 2718 getDocumentPosition: function(a) { 2719 var b = 0, 2720 c = 0, 2721 e = this.getDocument(), 2722 d = e.getBody(), 2723 v = "BackCompat" == e.$.compatMode; 2724 if (document.documentElement.getBoundingClientRect && (CKEDITOR.env.ie ? 2725 8 !== CKEDITOR.env.version : 1)) { 2726 var f = this.$.getBoundingClientRect(), 2727 h = e.$.documentElement, 2728 x = h.clientTop || d.$.clientTop || 0, 2729 m = h.clientLeft || d.$.clientLeft || 0, 2730 k = !0; 2731 CKEDITOR.env.ie && (k = e.getDocumentElement().contains(this), e = e.getBody().contains(this), k = v && e || !v && k); 2732 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) 2733 } else 2734 for (x = this, m = null; x && "body" != x.getName() && 2735 "html" != x.getName();) { 2736 b += x.$.offsetLeft - x.$.scrollLeft; 2737 c += x.$.offsetTop - x.$.scrollTop; 2738 x.equals(this) || (b += x.$.clientLeft || 0, c += x.$.clientTop || 0); 2739 for (; m && !m.equals(x);) b -= m.$.scrollLeft, c -= m.$.scrollTop, m = m.getParent(); 2740 m = x; 2741 x = (f = x.$.offsetParent) ? new CKEDITOR.dom.element(f) : null 2742 } 2743 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)); 2744 document.documentElement.getBoundingClientRect || !CKEDITOR.env.gecko || 2745 v || (b += this.$.clientLeft ? 1 : 0, c += this.$.clientTop ? 1 : 0); 2746 return { 2747 x: b, 2748 y: c 2749 } 2750 }, 2751 scrollIntoView: function(a) { 2752 var b = this.getParent(); 2753 if (b) { 2754 do 2755 if ((b.$.clientWidth && b.$.clientWidth < b.$.scrollWidth || b.$.clientHeight && b.$.clientHeight < b.$.scrollHeight) && !b.is("body") && this.scrollIntoParent(b, a, 1), b.is("html")) { 2756 var c = b.getWindow(); 2757 try { 2758 var e = c.$.frameElement; 2759 e && (b = new CKEDITOR.dom.element(e)) 2760 } catch (d) {} 2761 } while (b = b.getParent()) 2762 } 2763 }, 2764 scrollIntoParent: function(a, b, c) { 2765 var e, d, v, f; 2766 2767 function h(b, c) { 2768 /body|html/.test(a.getName()) ? 2769 a.getWindow().$.scrollBy(b, c) : (a.$.scrollLeft += b, a.$.scrollTop += c) 2770 } 2771 2772 function x(a, b) { 2773 var c = { 2774 x: 0, 2775 y: 0 2776 }; 2777 if (!a.is(k ? "body" : "html")) { 2778 var e = a.$.getBoundingClientRect(); 2779 c.x = e.left; 2780 c.y = e.top 2781 } 2782 e = a.getWindow(); 2783 e.equals(b) || (e = x(CKEDITOR.dom.element.get(e.$.frameElement), b), c.x += e.x, c.y += e.y); 2784 return c 2785 } 2786 2787 function m(a, b) { 2788 return parseInt(a.getComputedStyle("margin-" + b) || 0, 10) || 0 2789 }!a && (a = this.getWindow()); 2790 v = a.getDocument(); 2791 var k = "BackCompat" == v.$.compatMode; 2792 a instanceof CKEDITOR.dom.window && (a = k ? v.getBody() : v.getDocumentElement()); 2793 CKEDITOR.env.webkit && (v = this.getEditor(!1)) && (v._.previousScrollTop = null); 2794 v = a.getWindow(); 2795 d = x(this, v); 2796 var u = x(a, v), 2797 K = this.$.offsetHeight; 2798 e = this.$.offsetWidth; 2799 var l = a.$.clientHeight, 2800 t = a.$.clientWidth; 2801 v = d.x - m(this, "left") - u.x || 0; 2802 f = d.y - m(this, "top") - u.y || 0; 2803 e = d.x + e + m(this, "right") - (u.x + t) || 0; 2804 d = d.y + K + m(this, "bottom") - (u.y + l) || 0; 2805 (0 > f || 0 < d) && h(0, !0 === b ? f : !1 === b ? d : 0 > f ? f : d); 2806 c && (0 > v || 0 < e) && h(0 > v ? v : e, 0) 2807 }, 2808 setState: function(a, b, c) { 2809 b = b || "cke"; 2810 switch (a) { 2811 case CKEDITOR.TRISTATE_ON: 2812 this.addClass(b + "_on"); 2813 this.removeClass(b + 2814 "_off"); 2815 this.removeClass(b + "_disabled"); 2816 c && this.setAttribute("aria-pressed", !0); 2817 c && this.removeAttribute("aria-disabled"); 2818 break; 2819 case CKEDITOR.TRISTATE_DISABLED: 2820 this.addClass(b + "_disabled"); 2821 this.removeClass(b + "_off"); 2822 this.removeClass(b + "_on"); 2823 c && this.setAttribute("aria-disabled", !0); 2824 c && this.removeAttribute("aria-pressed"); 2825 break; 2826 default: 2827 this.addClass(b + "_off"), this.removeClass(b + "_on"), this.removeClass(b + "_disabled"), c && this.removeAttribute("aria-pressed"), c && this.removeAttribute("aria-disabled") 2828 } 2829 }, 2830 getFrameDocument: function() { 2831 var a = this.$; 2832 try { 2833 a.contentWindow.document 2834 } catch (b) { 2835 a.src = a.src 2836 } 2837 return a && new CKEDITOR.dom.document(a.contentWindow.document) 2838 }, 2839 copyAttributes: function(a, b) { 2840 var c = this.$.attributes; 2841 b = b || {}; 2842 for (var e = 0; e < c.length; e++) { 2843 var d = c[e], 2844 v = d.nodeName.toLowerCase(), 2845 f; 2846 if (!(v in b)) 2847 if ("checked" == v && (f = this.getAttribute(v))) a.setAttribute(v, f); 2848 else if (!CKEDITOR.env.ie || this.hasAttribute(v)) f = this.getAttribute(v), null === f && (f = d.nodeValue), a.setAttribute(v, f) 2849 } 2850 "" !== this.$.style.cssText && 2851 (a.$.style.cssText = this.$.style.cssText) 2852 }, 2853 renameNode: function(a) { 2854 if (this.getName() != a) { 2855 var b = this.getDocument(); 2856 a = new CKEDITOR.dom.element(a, b); 2857 this.copyAttributes(a); 2858 this.moveChildren(a); 2859 this.getParent(!0) && this.$.parentNode.replaceChild(a.$, this.$); 2860 a.$["data-cke-expando"] = this.$["data-cke-expando"]; 2861 this.$ = a.$; 2862 delete this.getName 2863 } 2864 }, 2865 getChild: function() { 2866 function a(b, c) { 2867 var e = b.childNodes; 2868 if (0 <= c && c < e.length) return e[c] 2869 } 2870 return function(b) { 2871 var c = this.$; 2872 if (b.slice) 2873 for (b = b.slice(); 0 < b.length && c;) c = a(c, 2874 b.shift()); 2875 else c = a(c, b); 2876 return c ? new CKEDITOR.dom.node(c) : null 2877 } 2878 }(), 2879 getChildCount: function() { 2880 return this.$.childNodes.length 2881 }, 2882 disableContextMenu: function() { 2883 function a(b) { 2884 return b.type == CKEDITOR.NODE_ELEMENT && b.hasClass("cke_enable_context_menu") 2885 } 2886 this.on("contextmenu", function(b) { 2887 b.data.getTarget().getAscendant(a, !0) || b.data.preventDefault() 2888 }) 2889 }, 2890 getDirection: function(a) { 2891 return a ? this.getComputedStyle("direction") || this.getDirection() || this.getParent() && this.getParent().getDirection(1) || this.getDocument().$.dir || 2892 "ltr" : this.getStyle("direction") || this.getAttribute("dir") 2893 }, 2894 data: function(a, b) { 2895 a = "data-" + a; 2896 if (void 0 === b) return this.getAttribute(a); 2897 !1 === b ? this.removeAttribute(a) : this.setAttribute(a, b); 2898 return null 2899 }, 2900 getEditor: function(a) { 2901 var b = CKEDITOR.instances, 2902 c, e, d; 2903 a = a || void 0 === a; 2904 for (c in b) 2905 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; 2906 return null 2907 }, 2908 find: function(a) { 2909 var c = d(this); 2910 a = new CKEDITOR.dom.nodeList(this.$.querySelectorAll(b(this, 2911 a))); 2912 c(); 2913 return a 2914 }, 2915 findOne: function(a) { 2916 var c = d(this); 2917 a = this.$.querySelector(b(this, a)); 2918 c(); 2919 return a ? new CKEDITOR.dom.element(a) : null 2920 }, 2921 forEach: function(a, b, c) { 2922 if (!(c || b && this.type != b)) var e = a(this); 2923 if (!1 !== e) { 2924 c = this.getChildren(); 2925 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) 2926 } 2927 } 2928 }); 2929 var k = { 2930 width: ["border-left-width", "border-right-width", "padding-left", "padding-right"], 2931 height: ["border-top-width", "border-bottom-width", "padding-top", "padding-bottom"] 2932 }; 2933 CKEDITOR.dom.element.prototype.setSize = function(a, b, d) { 2934 "number" == typeof b && (!d || CKEDITOR.env.ie && CKEDITOR.env.quirks || (b -= c.call(this, a)), this.setStyle(a, b + "px")) 2935 }; 2936 CKEDITOR.dom.element.prototype.getSize = function(a, b) { 2937 var d = Math.max(this.$["offset" + CKEDITOR.tools.capitalize(a)], this.$["client" + CKEDITOR.tools.capitalize(a)]) || 0; 2938 b && (d -= c.call(this, a)); 2939 return d 2940 } 2941 })(); 2942 CKEDITOR.dom.documentFragment = function(a) { 2943 a = a || CKEDITOR.document; 2944 this.$ = a.type == CKEDITOR.NODE_DOCUMENT ? a.$.createDocumentFragment() : a 2945 }; 2946 CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype, CKEDITOR.dom.element.prototype, { 2947 type: CKEDITOR.NODE_DOCUMENT_FRAGMENT, 2948 insertAfterNode: function(a) { 2949 a = a.$; 2950 a.parentNode.insertBefore(this.$, a.nextSibling) 2951 }, 2952 getHtml: function() { 2953 var a = new CKEDITOR.dom.element("div"); 2954 this.clone(1, 1).appendTo(a); 2955 return a.getHtml().replace(/\s*data-cke-expando=".*?"/g, "") 2956 } 2957 }, !0, { 2958 append: 1, 2959 appendBogus: 1, 2960 clone: 1, 2961 getFirst: 1, 2962 getHtml: 1, 2963 getLast: 1, 2964 getParent: 1, 2965 getNext: 1, 2966 getPrevious: 1, 2967 appendTo: 1, 2968 moveChildren: 1, 2969 insertBefore: 1, 2970 insertAfterNode: 1, 2971 replace: 1, 2972 trim: 1, 2973 type: 1, 2974 ltrim: 1, 2975 rtrim: 1, 2976 getDocument: 1, 2977 getChildCount: 1, 2978 getChild: 1, 2979 getChildren: 1 2980 }); 2981 (function() { 2982 function a(a, b) { 2983 var c = this.range; 2984 if (this._.end) return null; 2985 if (!this._.start) { 2986 this._.start = 1; 2987 if (c.collapsed) return this.end(), null; 2988 c.optimize() 2989 } 2990 var e, d = c.startContainer; 2991 e = c.endContainer; 2992 var f = c.startOffset, 2993 y = c.endOffset, 2994 h, l = this.guard, 2995 t = this.type, 2996 g = a ? "getPreviousSourceNode" : "getNextSourceNode"; 2997 if (!a && !this._.guardLTR) { 2998 var L = e.type == CKEDITOR.NODE_ELEMENT ? e : e.getParent(), 2999 C = e.type == CKEDITOR.NODE_ELEMENT ? e.getChild(y) : e.getNext(); 3000 this._.guardLTR = function(a, b) { 3001 return (!b || !L.equals(a)) && (!C || 3002 !a.equals(C)) && (a.type != CKEDITOR.NODE_ELEMENT || !b || !a.equals(c.root)) 3003 } 3004 } 3005 if (a && !this._.guardRTL) { 3006 var k = d.type == CKEDITOR.NODE_ELEMENT ? d : d.getParent(), 3007 q = d.type == CKEDITOR.NODE_ELEMENT ? f ? d.getChild(f - 1) : null : d.getPrevious(); 3008 this._.guardRTL = function(a, b) { 3009 return (!b || !k.equals(a)) && (!q || !a.equals(q)) && (a.type != CKEDITOR.NODE_ELEMENT || !b || !a.equals(c.root)) 3010 } 3011 } 3012 var E = a ? this._.guardRTL : this._.guardLTR; 3013 h = l ? function(a, b) { 3014 return !1 === E(a, b) ? !1 : l(a, b) 3015 } : E; 3016 this.current ? e = this.current[g](!1, t, h) : (a ? e.type == CKEDITOR.NODE_ELEMENT && 3017 (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)); 3018 for (; e && !this._.end;) { 3019 this.current = e; 3020 if (!this.evaluator || !1 !== this.evaluator(e)) { 3021 if (!b) return e 3022 } else if (b && this.evaluator) return !1; 3023 e = e[g](!1, t, h) 3024 } 3025 this.end(); 3026 return this.current = null 3027 } 3028 3029 function d(b) { 3030 for (var c, e = null; c = a.call(this, b);) e = c; 3031 return e 3032 } 3033 CKEDITOR.dom.walker = CKEDITOR.tools.createClass({ 3034 $: function(a) { 3035 this.range = 3036 a; 3037 this._ = {} 3038 }, 3039 proto: { 3040 end: function() { 3041 this._.end = 1 3042 }, 3043 next: function() { 3044 return a.call(this) 3045 }, 3046 previous: function() { 3047 return a.call(this, 1) 3048 }, 3049 checkForward: function() { 3050 return !1 !== a.call(this, 0, 1) 3051 }, 3052 checkBackward: function() { 3053 return !1 !== a.call(this, 1, 1) 3054 }, 3055 lastForward: function() { 3056 return d.call(this) 3057 }, 3058 lastBackward: function() { 3059 return d.call(this, 1) 3060 }, 3061 reset: function() { 3062 delete this.current; 3063 this._ = {} 3064 } 3065 } 3066 }); 3067 var b = { 3068 block: 1, 3069 "list-item": 1, 3070 table: 1, 3071 "table-row-group": 1, 3072 "table-header-group": 1, 3073 "table-footer-group": 1, 3074 "table-row": 1, 3075 "table-column-group": 1, 3076 "table-column": 1, 3077 "table-cell": 1, 3078 "table-caption": 1 3079 }, 3080 c = { 3081 absolute: 1, 3082 fixed: 1 3083 }; 3084 CKEDITOR.dom.element.prototype.isBlockBoundary = function(a) { 3085 return "none" != this.getComputedStyle("float") || this.getComputedStyle("position") in c || !b[this.getComputedStyle("display")] ? !!(this.is(CKEDITOR.dtd.$block) || a && this.is(a)) : !0 3086 }; 3087 CKEDITOR.dom.walker.blockBoundary = function(a) { 3088 return function(b) { 3089 return !(b.type == CKEDITOR.NODE_ELEMENT && b.isBlockBoundary(a)) 3090 } 3091 }; 3092 CKEDITOR.dom.walker.listItemBoundary = function() { 3093 return this.blockBoundary({ 3094 br: 1 3095 }) 3096 }; 3097 CKEDITOR.dom.walker.bookmark = function(a, b) { 3098 function c(a) { 3099 return a && a.getName && "span" == a.getName() && a.data("cke-bookmark") 3100 } 3101 return function(e) { 3102 var d, f; 3103 d = e && e.type != CKEDITOR.NODE_ELEMENT && (f = e.getParent()) && c(f); 3104 d = a ? d : d || c(e); 3105 return !!(b ^ d) 3106 } 3107 }; 3108 CKEDITOR.dom.walker.whitespaces = function(a) { 3109 return function(b) { 3110 var c; 3111 b && b.type == CKEDITOR.NODE_TEXT && (c = !CKEDITOR.tools.trim(b.getText()) || CKEDITOR.env.webkit && b.getText() == CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE); 3112 return !!(a ^ c) 3113 } 3114 }; 3115 CKEDITOR.dom.walker.invisible = 3116 function(a) { 3117 var b = CKEDITOR.dom.walker.whitespaces(), 3118 c = CKEDITOR.env.webkit ? 1 : 0; 3119 return function(e) { 3120 b(e) ? e = 1 : (e.type == CKEDITOR.NODE_TEXT && (e = e.getParent()), e = e.$.offsetWidth <= c); 3121 return !!(a ^ e) 3122 } 3123 }; 3124 CKEDITOR.dom.walker.nodeType = function(a, b) { 3125 return function(c) { 3126 return !!(b ^ c.type == a) 3127 } 3128 }; 3129 CKEDITOR.dom.walker.bogus = function(a) { 3130 function b(a) { 3131 return !h(a) && !k(a) 3132 } 3133 return function(c) { 3134 var e = CKEDITOR.env.needsBrFiller ? c.is && c.is("br") : c.getText && f.test(c.getText()); 3135 e && (e = c.getParent(), c = c.getNext(b), e = e.isBlockBoundary() && 3136 (!c || c.type == CKEDITOR.NODE_ELEMENT && c.isBlockBoundary())); 3137 return !!(a ^ e) 3138 } 3139 }; 3140 CKEDITOR.dom.walker.temp = function(a) { 3141 return function(b) { 3142 b.type != CKEDITOR.NODE_ELEMENT && (b = b.getParent()); 3143 b = b && b.hasAttribute("data-cke-temp"); 3144 return !!(a ^ b) 3145 } 3146 }; 3147 var f = /^[\t\r\n ]*(?: |\xa0)$/, 3148 h = CKEDITOR.dom.walker.whitespaces(), 3149 k = CKEDITOR.dom.walker.bookmark(), 3150 g = CKEDITOR.dom.walker.temp(), 3151 n = function(a) { 3152 return k(a) || h(a) || a.type == CKEDITOR.NODE_ELEMENT && a.is(CKEDITOR.dtd.$inline) && !a.is(CKEDITOR.dtd.$empty) 3153 }; 3154 CKEDITOR.dom.walker.ignored = 3155 function(a) { 3156 return function(b) { 3157 b = h(b) || k(b) || g(b); 3158 return !!(a ^ b) 3159 } 3160 }; 3161 var r = CKEDITOR.dom.walker.ignored(); 3162 CKEDITOR.dom.walker.empty = function(a) { 3163 return function(b) { 3164 for (var c = 0, e = b.getChildCount(); c < e; ++c) 3165 if (!r(b.getChild(c))) return !!a; 3166 return !a 3167 } 3168 }; 3169 var e = CKEDITOR.dom.walker.empty(), 3170 y = CKEDITOR.dom.walker.validEmptyBlockContainers = CKEDITOR.tools.extend(function(a) { 3171 var b = {}, 3172 c; 3173 for (c in a) CKEDITOR.dtd[c]["#"] && (b[c] = 1); 3174 return b 3175 }(CKEDITOR.dtd.$block), { 3176 caption: 1, 3177 td: 1, 3178 th: 1 3179 }); 3180 CKEDITOR.dom.walker.editable = function(a) { 3181 return function(b) { 3182 b = 3183 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; 3184 return !!(a ^ b) 3185 } 3186 }; 3187 CKEDITOR.dom.element.prototype.getBogus = function() { 3188 var a = this; 3189 do a = a.getPreviousSourceNode(); while (n(a)); 3190 return a && (CKEDITOR.env.needsBrFiller ? a.is && a.is("br") : a.getText && f.test(a.getText())) ? a : !1 3191 } 3192 })(); 3193 CKEDITOR.dom.range = function(a) { 3194 this.endOffset = this.endContainer = this.startOffset = this.startContainer = null; 3195 this.collapsed = !0; 3196 var d = a instanceof CKEDITOR.dom.document; 3197 this.document = d ? a : a.getDocument(); 3198 this.root = d ? a.getBody() : a 3199 }; 3200 (function() { 3201 function a(a) { 3202 a.collapsed = a.startContainer && a.endContainer && a.startContainer.equals(a.endContainer) && a.startOffset == a.endOffset 3203 } 3204 3205 function d(a, b, c, d, f) { 3206 function h(a, b, c, e) { 3207 var d = c ? a.getPrevious() : a.getNext(); 3208 if (e && k) return d; 3209 l || e ? b.append(a.clone(!0, f), c) : (a.remove(), r && b.append(a, c)); 3210 return d 3211 } 3212 3213 function m() { 3214 var a, b, c, e = Math.min(O.length, p.length); 3215 for (a = 0; a < e; a++) 3216 if (b = O[a], c = p[a], !b.equals(c)) return a; 3217 return a - 1 3218 } 3219 3220 function g() { 3221 var b = N - 1, 3222 c = E && z && !t.equals(F); 3223 b < w - 1 || b < A - 1 || c ? (c ? a.moveToPosition(F, 3224 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({ 3225 startNode: c 3226 }))) : a.collapse(!0) 3227 } 3228 a.optimizeBookmark(); 3229 var k = 0 === b, 3230 r = 1 == b, 3231 l = 2 == b; 3232 b = l || r; 3233 var t = a.startContainer, 3234 F = a.endContainer, 3235 L = a.startOffset, 3236 C = a.endOffset, 3237 M, q, E, z, H, P; 3238 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))); 3239 else { 3240 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; 3241 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; 3242 for (var O = t.getParents(), p = F.getParents(), N = m(), 3243 w = O.length - 1, A = p.length - 1, G = c, I, X, V, da = -1, Q = N; Q <= w; Q++) { 3244 X = O[Q]; 3245 V = X.getNext(); 3246 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;) { 3247 if (V.equals(p[Q])) { 3248 da = Q; 3249 break 3250 } 3251 V = h(V, G) 3252 } 3253 G = I 3254 } 3255 G = c; 3256 for (Q = N; Q <= A; Q++) 3257 if (c = p[Q], V = c.getPrevious(), c.equals(O[Q])) b && (G = G.getChild(0)); 3258 else { 3259 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))); 3260 if (Q > da) 3261 for (; V;) V = h(V, G, !0); 3262 G = I 3263 } l || g() 3264 } 3265 } 3266 3267 function b() { 3268 var a = !1, 3269 b = CKEDITOR.dom.walker.whitespaces(), 3270 c = CKEDITOR.dom.walker.bookmark(!0), 3271 d = CKEDITOR.dom.walker.bogus(); 3272 return function(f) { 3273 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 3274 } 3275 } 3276 3277 function c(a) { 3278 var b = CKEDITOR.dom.walker.whitespaces(), 3279 c = CKEDITOR.dom.walker.bookmark(1); 3280 return function(d) { 3281 return c(d) || b(d) ? !0 : !a && k(d) || d.type == CKEDITOR.NODE_ELEMENT && d.is(CKEDITOR.dtd.$removeEmpty) 3282 } 3283 } 3284 3285 function f(a) { 3286 return function() { 3287 var b; 3288 return this[a ? "getPreviousNode" : "getNextNode"](function(a) { 3289 !b && r(a) && (b = a); 3290 return n(a) && !(k(a) && a.equals(b)) 3291 }) 3292 } 3293 } 3294 var h = { 3295 abbr: 1, 3296 acronym: 1, 3297 b: 1, 3298 bdo: 1, 3299 big: 1, 3300 cite: 1, 3301 code: 1, 3302 del: 1, 3303 dfn: 1, 3304 em: 1, 3305 font: 1, 3306 i: 1, 3307 ins: 1, 3308 label: 1, 3309 kbd: 1, 3310 q: 1, 3311 samp: 1, 3312 small: 1, 3313 span: 1, 3314 strike: 1, 3315 strong: 1, 3316 sub: 1, 3317 sup: 1, 3318 tt: 1, 3319 u: 1, 3320 "var": 1 3321 }, 3322 k = CKEDITOR.dom.walker.bogus(), 3323 g = /^[\t\r\n ]*(?: |\xa0)$/, 3324 n = CKEDITOR.dom.walker.editable(), 3325 r = CKEDITOR.dom.walker.ignored(!0); 3326 CKEDITOR.dom.range.prototype = { 3327 clone: function() { 3328 var a = 3329 new CKEDITOR.dom.range(this.root); 3330 a._setStartContainer(this.startContainer); 3331 a.startOffset = this.startOffset; 3332 a._setEndContainer(this.endContainer); 3333 a.endOffset = this.endOffset; 3334 a.collapsed = this.collapsed; 3335 return a 3336 }, 3337 collapse: function(a) { 3338 a ? (this._setEndContainer(this.startContainer), this.endOffset = this.startOffset) : (this._setStartContainer(this.endContainer), this.startOffset = this.endOffset); 3339 this.collapsed = !0 3340 }, 3341 cloneContents: function(a) { 3342 var b = new CKEDITOR.dom.documentFragment(this.document); 3343 this.collapsed || 3344 d(this, 2, b, !1, "undefined" == typeof a ? !0 : a); 3345 return b 3346 }, 3347 deleteContents: function(a) { 3348 this.collapsed || d(this, 0, null, a) 3349 }, 3350 extractContents: function(a, b) { 3351 var c = new CKEDITOR.dom.documentFragment(this.document); 3352 this.collapsed || d(this, 1, c, a, "undefined" == typeof b ? !0 : b); 3353 return c 3354 }, 3355 createBookmark: function(a) { 3356 var b, c, d, f, h = this.collapsed; 3357 b = this.document.createElement("span"); 3358 b.data("cke-bookmark", 1); 3359 b.setStyle("display", "none"); 3360 b.setHtml("\x26nbsp;"); 3361 a && (d = "cke_bm_" + CKEDITOR.tools.getNextNumber(), b.setAttribute("id", 3362 d + (h ? "C" : "S"))); 3363 h || (c = b.clone(), c.setHtml("\x26nbsp;"), a && c.setAttribute("id", d + "E"), f = this.clone(), f.collapse(), f.insertNode(c)); 3364 f = this.clone(); 3365 f.collapse(!0); 3366 f.insertNode(b); 3367 c ? (this.setStartAfter(b), this.setEndBefore(c)) : this.moveToPosition(b, CKEDITOR.POSITION_AFTER_END); 3368 return { 3369 startNode: a ? d + (h ? "C" : "S") : b, 3370 endNode: a ? d + "E" : c, 3371 serializable: a, 3372 collapsed: h 3373 } 3374 }, 3375 createBookmark2: function() { 3376 function a(b) { 3377 var e = b.container, 3378 d = b.offset, 3379 m; 3380 m = e; 3381 var f = d; 3382 m = m.type != CKEDITOR.NODE_ELEMENT || 0 === f || f == m.getChildCount() ? 3383 0 : m.getChild(f - 1).type == CKEDITOR.NODE_TEXT && m.getChild(f).type == CKEDITOR.NODE_TEXT; 3384 m && (e = e.getChild(d - 1), d = e.getLength()); 3385 if (e.type == CKEDITOR.NODE_ELEMENT && 0 < d) { 3386 a: { 3387 for (m = e; d--;) 3388 if (f = m.getChild(d).getIndex(!0), 0 <= f) { 3389 d = f; 3390 break a 3391 } d = -1 3392 } 3393 d += 1 3394 } 3395 if (e.type == CKEDITOR.NODE_TEXT) { 3396 m = e; 3397 for (f = 0; 3398 (m = m.getPrevious()) && m.type == CKEDITOR.NODE_TEXT;) f += m.getText().replace(CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE, "").length; 3399 m = f; 3400 e.getText() ? d += m : (f = e.getPrevious(c), m ? (d = m, e = f ? f.getNext() : e.getParent().getFirst()) : (e = 3401 e.getParent(), d = f ? f.getIndex(!0) + 1 : 0)) 3402 } 3403 b.container = e; 3404 b.offset = d 3405 } 3406 3407 function b(a, c) { 3408 var e = c.getCustomData("cke-fillingChar"); 3409 if (e) { 3410 var d = a.container; 3411 e.equals(d) && (a.offset -= CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE.length, 0 >= a.offset && (a.offset = d.getIndex(), a.container = d.getParent())) 3412 } 3413 } 3414 var c = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT, !0); 3415 return function(c) { 3416 var d = this.collapsed, 3417 f = { 3418 container: this.startContainer, 3419 offset: this.startOffset 3420 }, 3421 m = { 3422 container: this.endContainer, 3423 offset: this.endOffset 3424 }; 3425 c && (a(f), 3426 b(f, this.root), d || (a(m), b(m, this.root))); 3427 return { 3428 start: f.container.getAddress(c), 3429 end: d ? null : m.container.getAddress(c), 3430 startOffset: f.offset, 3431 endOffset: m.offset, 3432 normalized: c, 3433 collapsed: d, 3434 is2: !0 3435 } 3436 } 3437 }(), 3438 moveToBookmark: function(a) { 3439 if (a.is2) { 3440 var b = this.document.getByAddress(a.start, a.normalized), 3441 c = a.startOffset, 3442 d = a.end && this.document.getByAddress(a.end, a.normalized); 3443 a = a.endOffset; 3444 this.setStart(b, c); 3445 d ? this.setEnd(d, a) : this.collapse(!0) 3446 } else b = (c = a.serializable) ? this.document.getById(a.startNode) : a.startNode, 3447 a = c ? this.document.getById(a.endNode) : a.endNode, this.setStartBefore(b), b.remove(), a ? (this.setEndBefore(a), a.remove()) : this.collapse(!0) 3448 }, 3449 getBoundaryNodes: function() { 3450 var a = this.startContainer, 3451 b = this.endContainer, 3452 c = this.startOffset, 3453 d = this.endOffset, 3454 f; 3455 if (a.type == CKEDITOR.NODE_ELEMENT) 3456 if (f = a.getChildCount(), f > c) a = a.getChild(c); 3457 else if (1 > f) a = a.getPreviousSourceNode(); 3458 else { 3459 for (a = a.$; a.lastChild;) a = a.lastChild; 3460 a = new CKEDITOR.dom.node(a); 3461 a = a.getNextSourceNode() || a 3462 } 3463 if (b.type == CKEDITOR.NODE_ELEMENT) 3464 if (f = b.getChildCount(), 3465 f > d) b = b.getChild(d).getPreviousSourceNode(!0); 3466 else if (1 > f) b = b.getPreviousSourceNode(); 3467 else { 3468 for (b = b.$; b.lastChild;) b = b.lastChild; 3469 b = new CKEDITOR.dom.node(b) 3470 } 3471 a.getPosition(b) & CKEDITOR.POSITION_FOLLOWING && (a = b); 3472 return { 3473 startNode: a, 3474 endNode: b 3475 } 3476 }, 3477 getCommonAncestor: function(a, b) { 3478 var c = this.startContainer, 3479 d = this.endContainer, 3480 c = c.equals(d) ? a && c.type == CKEDITOR.NODE_ELEMENT && this.startOffset == this.endOffset - 1 ? c.getChild(this.startOffset) : c : c.getCommonAncestor(d); 3481 return b && !c.is ? c.getParent() : c 3482 }, 3483 optimize: function() { 3484 var a = 3485 this.startContainer, 3486 b = this.startOffset; 3487 a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setStartAfter(a) : this.setStartBefore(a)); 3488 a = this.endContainer; 3489 b = this.endOffset; 3490 a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setEndAfter(a) : this.setEndBefore(a)) 3491 }, 3492 optimizeBookmark: function() { 3493 var a = this.startContainer, 3494 b = this.endContainer; 3495 a.is && a.is("span") && a.data("cke-bookmark") && this.setStartAt(a, CKEDITOR.POSITION_BEFORE_START); 3496 b && b.is && b.is("span") && b.data("cke-bookmark") && this.setEndAt(b, CKEDITOR.POSITION_AFTER_END) 3497 }, 3498 trim: function(a, b) { 3499 var c = this.startContainer, 3500 d = this.startOffset, 3501 f = this.collapsed; 3502 if ((!a || f) && c && c.type == CKEDITOR.NODE_TEXT) { 3503 if (d) 3504 if (d >= c.getLength()) d = c.getIndex() + 1, c = c.getParent(); 3505 else { 3506 var h = c.split(d), 3507 d = c.getIndex() + 1, 3508 c = c.getParent(); 3509 this.startContainer.equals(this.endContainer) ? this.setEnd(h, this.endOffset - this.startOffset) : c.equals(this.endContainer) && (this.endOffset += 1) 3510 } 3511 else d = c.getIndex(), c = c.getParent(); 3512 this.setStart(c, d); 3513 if (f) { 3514 this.collapse(!0); 3515 return 3516 } 3517 } 3518 c = this.endContainer; 3519 d = this.endOffset; 3520 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)) 3521 }, 3522 enlarge: function(a, b) { 3523 function c(a) { 3524 return a && a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("contenteditable") ? null : a 3525 } 3526 var d = new RegExp(/[^\s\ufeff]/); 3527 switch (a) { 3528 case CKEDITOR.ENLARGE_INLINE: 3529 var f = 1; 3530 case CKEDITOR.ENLARGE_ELEMENT: 3531 var h = function(a, b) { 3532 var c = new CKEDITOR.dom.range(g); 3533 c.setStart(a, b); 3534 c.setEndAt(g, CKEDITOR.POSITION_BEFORE_END); 3535 var c = new CKEDITOR.dom.walker(c), 3536 e; 3537 for (c.guard = function(a) { 3538 return !(a.type == CKEDITOR.NODE_ELEMENT && a.isBlockBoundary()) 3539 }; e = c.next();) { 3540 if (e.type != CKEDITOR.NODE_TEXT) return !1; 3541 M = e != a ? e.getText() : e.substring(b); 3542 if (d.test(M)) return !1 3543 } 3544 return !0 3545 }; 3546 if (this.collapsed) break; 3547 var m = this.getCommonAncestor(), 3548 g = this.root, 3549 k, r, l, t, F, L = !1, 3550 C, M; 3551 C = this.startContainer; 3552 var q = this.startOffset; 3553 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()), 3554 t || (l = C)); 3555 for (l = c(l); l || t;) { 3556 if (l && !t) { 3557 !F && l.equals(m) && (F = !0); 3558 if (f ? l.isBlockBoundary() : !g.contains(l)) break; 3559 L && "inline" == l.getComputedStyle("display") || (L = !1, F ? k = l : this.setStartBefore(l)); 3560 t = l.getPrevious() 3561 } 3562 for (; t;) 3563 if (C = !1, t.type == CKEDITOR.NODE_COMMENT) t = t.getPrevious(); 3564 else { 3565 if (t.type == CKEDITOR.NODE_TEXT) M = t.getText(), d.test(M) && (t = null), C = /[\s\ufeff]$/.test(M); 3566 else if ((t.$.offsetWidth > (CKEDITOR.env.webkit ? 1 : 0) || b && t.is("br")) && !t.data("cke-bookmark")) 3567 if (L && CKEDITOR.dtd.$removeEmpty[t.getName()]) { 3568 M = 3569 t.getText(); 3570 if (d.test(M)) t = null; 3571 else 3572 for (var q = t.$.getElementsByTagName("*"), E = 0, z; z = q[E++];) 3573 if (!CKEDITOR.dtd.$removeEmpty[z.nodeName.toLowerCase()]) { 3574 t = null; 3575 break 3576 } t && (C = !!M.length) 3577 } else t = null; 3578 C && (L ? F ? k = l : l && this.setStartBefore(l) : L = !0); 3579 if (t) { 3580 C = t.getPrevious(); 3581 if (!l && !C) { 3582 l = t; 3583 t = null; 3584 break 3585 } 3586 t = C 3587 } else l = null 3588 } l && (l = c(l.getParent())) 3589 } 3590 C = this.endContainer; 3591 q = this.endOffset; 3592 l = t = null; 3593 F = L = !1; 3594 C.type == CKEDITOR.NODE_TEXT ? CKEDITOR.tools.trim(C.substring(q)).length ? L = !0 : (L = !C.getLength(), q == C.getLength() ? (t = C.getNext()) || 3595 (l = C.getParent()) : h(C, q) && (l = C.getParent())) : (t = C.getChild(q)) || (l = C); 3596 for (; l || t;) { 3597 if (l && !t) { 3598 !F && l.equals(m) && (F = !0); 3599 if (f ? l.isBlockBoundary() : !g.contains(l)) break; 3600 L && "inline" == l.getComputedStyle("display") || (L = !1, F ? r = l : l && this.setEndAfter(l)); 3601 t = l.getNext() 3602 } 3603 for (; t;) { 3604 C = !1; 3605 if (t.type == CKEDITOR.NODE_TEXT) M = t.getText(), h(t, 0) || (t = null), C = /^[\s\ufeff]/.test(M); 3606 else if (t.type == CKEDITOR.NODE_ELEMENT) { 3607 if ((0 < t.$.offsetWidth || b && t.is("br")) && !t.data("cke-bookmark")) 3608 if (L && CKEDITOR.dtd.$removeEmpty[t.getName()]) { 3609 M = 3610 t.getText(); 3611 if (d.test(M)) t = null; 3612 else 3613 for (q = t.$.getElementsByTagName("*"), E = 0; z = q[E++];) 3614 if (!CKEDITOR.dtd.$removeEmpty[z.nodeName.toLowerCase()]) { 3615 t = null; 3616 break 3617 } t && (C = !!M.length) 3618 } else t = null 3619 } else C = 1; 3620 C && L && (F ? r = l : this.setEndAfter(l)); 3621 if (t) { 3622 C = t.getNext(); 3623 if (!l && !C) { 3624 l = t; 3625 t = null; 3626 break 3627 } 3628 t = C 3629 } else l = null 3630 } 3631 l && (l = c(l.getParent())) 3632 } 3633 k && r && (m = k.contains(r) ? r : k, this.setStartBefore(m), this.setEndAfter(m)); 3634 break; 3635 case CKEDITOR.ENLARGE_BLOCK_CONTENTS: 3636 case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS: 3637 l = new CKEDITOR.dom.range(this.root); 3638 g = this.root; 3639 l.setStartAt(g, CKEDITOR.POSITION_AFTER_START); 3640 l.setEnd(this.startContainer, this.startOffset); 3641 l = new CKEDITOR.dom.walker(l); 3642 var H, P, O = CKEDITOR.dom.walker.blockBoundary(a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? { 3643 br: 1 3644 } : null), 3645 p = null, 3646 N = function(a) { 3647 if (a.type == CKEDITOR.NODE_ELEMENT && "false" == a.getAttribute("contenteditable")) 3648 if (p) { 3649 if (p.equals(a)) { 3650 p = null; 3651 return 3652 } 3653 } else p = a; 3654 else if (p) return; 3655 var b = O(a); 3656 b || (H = a); 3657 return b 3658 }, 3659 f = function(a) { 3660 var b = N(a); 3661 !b && a.is && a.is("br") && (P = a); 3662 return b 3663 }; 3664 l.guard = N; 3665 l = l.lastBackward(); 3666 H = H || g; 3667 this.setStartAt(H, !H.is("br") && (!l && this.checkStartOfBlock() || l && H.contains(l)) ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_AFTER_END); 3668 if (a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS) { 3669 l = this.clone(); 3670 l = new CKEDITOR.dom.walker(l); 3671 var w = CKEDITOR.dom.walker.whitespaces(), 3672 A = CKEDITOR.dom.walker.bookmark(); 3673 l.evaluator = function(a) { 3674 return !w(a) && !A(a) 3675 }; 3676 if ((l = l.previous()) && l.type == CKEDITOR.NODE_ELEMENT && l.is("br")) break 3677 } 3678 l = this.clone(); 3679 l.collapse(); 3680 l.setEndAt(g, CKEDITOR.POSITION_BEFORE_END); 3681 l = new CKEDITOR.dom.walker(l); 3682 l.guard = a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? f : N; 3683 H = p = P = null; 3684 l = l.lastForward(); 3685 H = H || g; 3686 this.setEndAt(H, !l && this.checkEndOfBlock() || l && H.contains(l) ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_BEFORE_START); 3687 P && this.setEndAfter(P) 3688 } 3689 }, 3690 shrink: function(a, b, c) { 3691 var d = "boolean" === typeof c ? c : c && "boolean" === typeof c.shrinkOnBlockBoundary ? c.shrinkOnBlockBoundary : !0, 3692 f = c && c.skipBogus; 3693 if (!this.collapsed) { 3694 a = a || CKEDITOR.SHRINK_TEXT; 3695 var h = this.clone(), 3696 m = this.startContainer, 3697 g = this.endContainer, 3698 k = this.startOffset, 3699 r = this.endOffset, 3700 l = c = 1; 3701 m && m.type == CKEDITOR.NODE_TEXT && (k ? k >= m.getLength() ? h.setStartAfter(m) : (h.setStartBefore(m), c = 0) : h.setStartBefore(m)); 3702 g && g.type == CKEDITOR.NODE_TEXT && (r ? r >= g.getLength() ? h.setEndAfter(g) : (h.setEndAfter(g), l = 0) : h.setEndBefore(g)); 3703 var h = new CKEDITOR.dom.walker(h), 3704 t = CKEDITOR.dom.walker.bookmark(), 3705 F = CKEDITOR.dom.walker.bogus(); 3706 h.evaluator = function(b) { 3707 return b.type == (a == CKEDITOR.SHRINK_ELEMENT ? CKEDITOR.NODE_ELEMENT : CKEDITOR.NODE_TEXT) 3708 }; 3709 var L; 3710 h.guard = function(b, c) { 3711 if (f && F(b) || t(b)) return !0; 3712 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; 3713 c || b.type != CKEDITOR.NODE_ELEMENT || (L = b); 3714 return !0 3715 }; 3716 c && (m = h[a == CKEDITOR.SHRINK_ELEMENT ? "lastForward" : "next"]()) && this.setStartAt(m, b ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_START); 3717 l && (h.reset(), (h = h[a == CKEDITOR.SHRINK_ELEMENT ? "lastBackward" : "previous"]()) && this.setEndAt(h, b ? CKEDITOR.POSITION_BEFORE_END : 3718 CKEDITOR.POSITION_AFTER_END)); 3719 return !(!c && !l) 3720 } 3721 }, 3722 insertNode: function(a) { 3723 this.optimizeBookmark(); 3724 this.trim(!1, !0); 3725 var b = this.startContainer, 3726 c = b.getChild(this.startOffset); 3727 c ? a.insertBefore(c) : b.append(a); 3728 a.getParent() && a.getParent().equals(this.endContainer) && this.endOffset++; 3729 this.setStartBefore(a) 3730 }, 3731 moveToPosition: function(a, b) { 3732 this.setStartAt(a, b); 3733 this.collapse(!0) 3734 }, 3735 moveToRange: function(a) { 3736 this.setStart(a.startContainer, a.startOffset); 3737 this.setEnd(a.endContainer, a.endOffset) 3738 }, 3739 selectNodeContents: function(a) { 3740 this.setStart(a, 3741 0); 3742 this.setEnd(a, a.type == CKEDITOR.NODE_TEXT ? a.getLength() : a.getChildCount()) 3743 }, 3744 setStart: function(b, c) { 3745 b.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[b.getName()] && (c = b.getIndex(), b = b.getParent()); 3746 this._setStartContainer(b); 3747 this.startOffset = c; 3748 this.endContainer || (this._setEndContainer(b), this.endOffset = c); 3749 a(this) 3750 }, 3751 setEnd: function(b, c) { 3752 b.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[b.getName()] && (c = b.getIndex() + 1, b = b.getParent()); 3753 this._setEndContainer(b); 3754 this.endOffset = c; 3755 this.startContainer || 3756 (this._setStartContainer(b), this.startOffset = c); 3757 a(this) 3758 }, 3759 setStartAfter: function(a) { 3760 this.setStart(a.getParent(), a.getIndex() + 1) 3761 }, 3762 setStartBefore: function(a) { 3763 this.setStart(a.getParent(), a.getIndex()) 3764 }, 3765 setEndAfter: function(a) { 3766 this.setEnd(a.getParent(), a.getIndex() + 1) 3767 }, 3768 setEndBefore: function(a) { 3769 this.setEnd(a.getParent(), a.getIndex()) 3770 }, 3771 setStartAt: function(b, c) { 3772 switch (c) { 3773 case CKEDITOR.POSITION_AFTER_START: 3774 this.setStart(b, 0); 3775 break; 3776 case CKEDITOR.POSITION_BEFORE_END: 3777 b.type == CKEDITOR.NODE_TEXT ? this.setStart(b, 3778 b.getLength()) : this.setStart(b, b.getChildCount()); 3779 break; 3780 case CKEDITOR.POSITION_BEFORE_START: 3781 this.setStartBefore(b); 3782 break; 3783 case CKEDITOR.POSITION_AFTER_END: 3784 this.setStartAfter(b) 3785 } 3786 a(this) 3787 }, 3788 setEndAt: function(b, c) { 3789 switch (c) { 3790 case CKEDITOR.POSITION_AFTER_START: 3791 this.setEnd(b, 0); 3792 break; 3793 case CKEDITOR.POSITION_BEFORE_END: 3794 b.type == CKEDITOR.NODE_TEXT ? this.setEnd(b, b.getLength()) : this.setEnd(b, b.getChildCount()); 3795 break; 3796 case CKEDITOR.POSITION_BEFORE_START: 3797 this.setEndBefore(b); 3798 break; 3799 case CKEDITOR.POSITION_AFTER_END: 3800 this.setEndAfter(b) 3801 } 3802 a(this) 3803 }, 3804 fixBlock: function(a, b) { 3805 var c = this.createBookmark(), 3806 d = this.document.createElement(b); 3807 this.collapse(a); 3808 this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS); 3809 this.extractContents().appendTo(d); 3810 d.trim(); 3811 this.insertNode(d); 3812 var f = d.getBogus(); 3813 f && f.remove(); 3814 d.appendBogus(); 3815 this.moveToBookmark(c); 3816 return d 3817 }, 3818 splitBlock: function(a, b) { 3819 var c = new CKEDITOR.dom.elementPath(this.startContainer, this.root), 3820 d = new CKEDITOR.dom.elementPath(this.endContainer, this.root), 3821 f = c.block, 3822 h = d.block, 3823 m = null; 3824 if (!c.blockLimit.equals(d.blockLimit)) return null; 3825 "br" != a && (f || (f = this.fixBlock(!0, a), h = (new CKEDITOR.dom.elementPath(this.endContainer, this.root)).block), h || (h = this.fixBlock(!1, a))); 3826 c = f && this.checkStartOfBlock(); 3827 d = h && this.checkEndOfBlock(); 3828 this.deleteContents(); 3829 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, 3830 b || !1), f.is("ul", "ol") || f.appendBogus())); 3831 return { 3832 previousBlock: f, 3833 nextBlock: h, 3834 wasStartOfBlock: c, 3835 wasEndOfBlock: d, 3836 elementPath: m 3837 } 3838 }, 3839 splitElement: function(a, b) { 3840 if (!this.collapsed) return null; 3841 this.setEndAt(a, CKEDITOR.POSITION_BEFORE_END); 3842 var c = this.extractContents(!1, b || !1), 3843 d = a.clone(!1, b || !1); 3844 c.appendTo(d); 3845 d.insertAfter(a); 3846 this.moveToPosition(a, CKEDITOR.POSITION_AFTER_END); 3847 return d 3848 }, 3849 removeEmptyBlocksAtEnd: function() { 3850 function a(d) { 3851 return function(a) { 3852 return b(a) || c(a) || a.type == CKEDITOR.NODE_ELEMENT && a.isEmptyInlineRemoveable() || 3853 d.is("table") && a.is("caption") ? !1 : !0 3854 } 3855 } 3856 var b = CKEDITOR.dom.walker.whitespaces(), 3857 c = CKEDITOR.dom.walker.bookmark(!1); 3858 return function(b) { 3859 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; 3860 this.moveToBookmark(c) 3861 } 3862 }(), 3863 startPath: function() { 3864 return new CKEDITOR.dom.elementPath(this.startContainer, this.root) 3865 }, 3866 endPath: function() { 3867 return new CKEDITOR.dom.elementPath(this.endContainer, 3868 this.root) 3869 }, 3870 checkBoundaryOfElement: function(a, b) { 3871 var d = b == CKEDITOR.START, 3872 f = this.clone(); 3873 f.collapse(d); 3874 f[d ? "setStartAt" : "setEndAt"](a, d ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END); 3875 f = new CKEDITOR.dom.walker(f); 3876 f.evaluator = c(d); 3877 return f[d ? "checkBackward" : "checkForward"]() 3878 }, 3879 checkStartOfBlock: function() { 3880 var a = this.startContainer, 3881 c = this.startOffset; 3882 CKEDITOR.env.ie && c && a.type == CKEDITOR.NODE_TEXT && (a = CKEDITOR.tools.ltrim(a.substring(0, c)), g.test(a) && this.trim(0, 1)); 3883 this.trim(); 3884 a = new CKEDITOR.dom.elementPath(this.startContainer, 3885 this.root); 3886 c = this.clone(); 3887 c.collapse(!0); 3888 c.setStartAt(a.block || a.blockLimit, CKEDITOR.POSITION_AFTER_START); 3889 a = new CKEDITOR.dom.walker(c); 3890 a.evaluator = b(); 3891 return a.checkBackward() 3892 }, 3893 checkEndOfBlock: function() { 3894 var a = this.endContainer, 3895 c = this.endOffset; 3896 CKEDITOR.env.ie && a.type == CKEDITOR.NODE_TEXT && (a = CKEDITOR.tools.rtrim(a.substring(c)), g.test(a) && this.trim(1, 0)); 3897 this.trim(); 3898 a = new CKEDITOR.dom.elementPath(this.endContainer, this.root); 3899 c = this.clone(); 3900 c.collapse(!1); 3901 c.setEndAt(a.block || a.blockLimit, CKEDITOR.POSITION_BEFORE_END); 3902 a = new CKEDITOR.dom.walker(c); 3903 a.evaluator = b(); 3904 return a.checkForward() 3905 }, 3906 getPreviousNode: function(a, b, c) { 3907 var d = this.clone(); 3908 d.collapse(1); 3909 d.setStartAt(c || this.root, CKEDITOR.POSITION_AFTER_START); 3910 c = new CKEDITOR.dom.walker(d); 3911 c.evaluator = a; 3912 c.guard = b; 3913 return c.previous() 3914 }, 3915 getNextNode: function(a, b, c) { 3916 var d = this.clone(); 3917 d.collapse(); 3918 d.setEndAt(c || this.root, CKEDITOR.POSITION_BEFORE_END); 3919 c = new CKEDITOR.dom.walker(d); 3920 c.evaluator = a; 3921 c.guard = b; 3922 return c.next() 3923 }, 3924 checkReadOnly: function() { 3925 function a(b, c) { 3926 for (; b;) { 3927 if (b.type == 3928 CKEDITOR.NODE_ELEMENT) { 3929 if ("false" == b.getAttribute("contentEditable") && !b.data("cke-editable")) return 0; 3930 if (b.is("html") || "true" == b.getAttribute("contentEditable") && (b.contains(c) || b.equals(c))) break 3931 } 3932 b = b.getParent() 3933 } 3934 return 1 3935 } 3936 return function() { 3937 var b = this.startContainer, 3938 c = this.endContainer; 3939 return !(a(b, c) && a(c, b)) 3940 } 3941 }(), 3942 moveToElementEditablePosition: function(a, b) { 3943 if (a.type == CKEDITOR.NODE_ELEMENT && !a.isEditable(!1)) return this.moveToPosition(a, b ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START), 3944 !0; 3945 for (var c = 0; a;) { 3946 if (a.type == CKEDITOR.NODE_TEXT) { 3947 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); 3948 c = 1; 3949 break 3950 } 3951 if (a.type == CKEDITOR.NODE_ELEMENT) 3952 if (a.isEditable()) this.moveToPosition(a, b ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_START), c = 1; 3953 else if (b && a.is("br") && this.endContainer && this.checkEndOfBlock()) this.moveToPosition(a, CKEDITOR.POSITION_BEFORE_START); 3954 else if ("false" == a.getAttribute("contenteditable") && a.is(CKEDITOR.dtd.$block)) return this.setStartBefore(a), this.setEndAfter(a), !0; 3955 var d = a, 3956 f = c, 3957 h = void 0; 3958 d.type == CKEDITOR.NODE_ELEMENT && d.isEditable(!1) && (h = d[b ? "getLast" : "getFirst"](r)); 3959 f || h || (h = d[b ? "getPrevious" : "getNext"](r)); 3960 a = h 3961 } 3962 return !!c 3963 }, 3964 moveToClosestEditablePosition: function(a, b) { 3965 var c, d = 0, 3966 f, h, m = [CKEDITOR.POSITION_AFTER_END, CKEDITOR.POSITION_BEFORE_START]; 3967 a ? (c = new CKEDITOR.dom.range(this.root), c.moveToPosition(a, m[b ? 0 : 1])) : c = this.clone(); 3968 if (a && 3969 !a.is(CKEDITOR.dtd.$block)) d = 1; 3970 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]); 3971 d && this.moveToRange(c); 3972 return !!d 3973 }, 3974 moveToElementEditStart: function(a) { 3975 return this.moveToElementEditablePosition(a) 3976 }, 3977 moveToElementEditEnd: function(a) { 3978 return this.moveToElementEditablePosition(a, !0) 3979 }, 3980 getEnclosedNode: function() { 3981 var a = this.clone(); 3982 a.optimize(); 3983 if (a.startContainer.type != CKEDITOR.NODE_ELEMENT || a.endContainer.type != CKEDITOR.NODE_ELEMENT) return null; 3984 var a = new CKEDITOR.dom.walker(a), 3985 b = CKEDITOR.dom.walker.bookmark(!1, !0), 3986 c = CKEDITOR.dom.walker.whitespaces(!0); 3987 a.evaluator = function(a) { 3988 return c(a) && b(a) 3989 }; 3990 var d = a.next(); 3991 a.reset(); 3992 return d && d.equals(a.previous()) ? d : null 3993 }, 3994 getTouchedStartNode: function() { 3995 var a = this.startContainer; 3996 return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.startOffset) || a 3997 }, 3998 getTouchedEndNode: function() { 3999 var a = this.endContainer; 4000 return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.endOffset - 1) || a 4001 }, 4002 getNextEditableNode: f(), 4003 getPreviousEditableNode: f(1), 4004 _getTableElement: function(a) { 4005 a = a || { 4006 td: 1, 4007 th: 1, 4008 tr: 1, 4009 tbody: 1, 4010 thead: 1, 4011 tfoot: 1, 4012 table: 1 4013 }; 4014 var b = this.startContainer, 4015 c = this.endContainer, 4016 d = b.getAscendant("table", !0), 4017 f = c.getAscendant("table", !0); 4018 return CKEDITOR.env.safari && d && c.equals(this.root) ? 4019 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 4020 }, 4021 scrollIntoView: function() { 4022 var a = new CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e", this.document), 4023 b, c, d, f = this.clone(); 4024 f.optimize(); 4025 (d = f.startContainer.type == CKEDITOR.NODE_TEXT) ? (c = f.startContainer.getText(), b = f.startContainer.split(f.startOffset), a.insertAfter(f.startContainer)) : f.insertNode(a); 4026 a.scrollIntoView(); 4027 d && (f.startContainer.setText(c), b.remove()); 4028 a.remove() 4029 }, 4030 getClientRects: function() { 4031 function a(b, c) { 4032 var d = CKEDITOR.tools.array.map(b, function(a) { 4033 return a 4034 }), 4035 e = new CKEDITOR.dom.range(c.root), 4036 f, h, l; 4037 c.startContainer instanceof CKEDITOR.dom.element && (h = 0 === c.startOffset && c.startContainer.hasAttribute("data-widget")); 4038 c.endContainer instanceof CKEDITOR.dom.element && (l = (l = c.endOffset === (c.endContainer.getChildCount ? c.endContainer.getChildCount() : c.endContainer.length)) && c.endContainer.hasAttribute("data-widget")); 4039 h && e.setStart(c.startContainer.getParent(), c.startContainer.getIndex()); 4040 l && e.setEnd(c.endContainer.getParent(), c.endContainer.getIndex() + 1); 4041 if (h || l) c = e; 4042 e = c.cloneContents(); 4043 e = CKEDITOR.dom.document.prototype.find.call(e, "[data-cke-widget-id]").toArray(); 4044 if (e = CKEDITOR.tools.array.map(e, function(a) { 4045 var b = c.root.editor; 4046 a = a.getAttribute("data-cke-widget-id"); 4047 return b.widgets.instances[a].element 4048 })) return e = CKEDITOR.tools.array.map(e, function(a) { 4049 var b; 4050 b = a.getParent().hasClass("cke_widget_wrapper") ? a.getParent() : 4051 a; 4052 f = this.root.getDocument().$.createRange(); 4053 f.setStart(b.getParent().$, b.getIndex()); 4054 f.setEnd(b.getParent().$, b.getIndex() + 1); 4055 b = f.getClientRects(); 4056 b.widgetRect = a.getClientRect(); 4057 return b 4058 }, c), CKEDITOR.tools.array.forEach(e, function(a) { 4059 function b(e) { 4060 CKEDITOR.tools.array.forEach(d, function(b, f) { 4061 var l = CKEDITOR.tools.objectCompare(a[e], b); 4062 l || (l = CKEDITOR.tools.objectCompare(a.widgetRect, b)); 4063 l && (Array.prototype.splice.call(d, f, a.length - e, a.widgetRect), c = !0) 4064 }); 4065 c || (e < d.length - 1 ? b(e + 1) : d.push(a.widgetRect)) 4066 } 4067 var c; 4068 b(0) 4069 }), d 4070 } 4071 4072 function b(a, c, e) { 4073 var f; 4074 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(""), 4075 a = c.getClientRects(), e.startContainer.setText("")) : a = [d(e.createBookmark())]) : a = [d(e.createBookmark())]; 4076 return a 4077 } 4078 4079 function c(a, b, d) { 4080 a = CKEDITOR.tools.extend({}, a); 4081 b && (a = CKEDITOR.tools.getAbsoluteRectPosition(d.document.getWindow(), a)); 4082 !a.width && (a.width = a.right - a.left); 4083 !a.height && (a.height = a.bottom - a.top); 4084 return a 4085 } 4086 4087 function d(a) { 4088 var b = a.startNode; 4089 a = a.endNode; 4090 var c; 4091 b.setText(""); 4092 b.removeStyle("display"); 4093 a ? (a.setText(""), a.removeStyle("display"), c = [b.getClientRect(), a.getClientRect()], a.remove()) : c = [b.getClientRect(), b.getClientRect()]; 4094 b.remove(); 4095 return { 4096 right: Math.max(c[0].right, c[1].right), 4097 bottom: Math.max(c[0].bottom, c[1].bottom), 4098 left: Math.min(c[0].left, c[1].left), 4099 top: Math.min(c[0].top, c[1].top), 4100 width: Math.abs(c[0].left - c[1].left), 4101 height: Math.max(c[0].bottom, c[1].bottom) - Math.min(c[0].top, c[1].top) 4102 } 4103 } 4104 return void 0 !== this.document.getSelection ? function(d) { 4105 var f = this.root.getDocument().$.createRange(), 4106 m; 4107 f.setStart(this.startContainer.$, this.startOffset); 4108 f.setEnd(this.endContainer.$, this.endOffset); 4109 m = f.getClientRects(); 4110 m = a(m, this); 4111 m.length || (m = b(m, f, this)); 4112 return CKEDITOR.tools.array.map(m, function(a) { 4113 return c(a, d, this) 4114 }, this) 4115 } : function(a) { 4116 return [c(d(this.createBookmark()), a, this)] 4117 } 4118 }(), 4119 _setStartContainer: function(a) { 4120 this.startContainer = a 4121 }, 4122 _setEndContainer: function(a) { 4123 this.endContainer = a 4124 }, 4125 _find: function(a, b) { 4126 var c = this.getCommonAncestor(), 4127 d = this.getBoundaryNodes(), 4128 f = [], 4129 h, m, g, k; 4130 if (c && c.find) 4131 for (m = c.find(a), h = 0; h < m.count(); h++) 4132 if (c = m.getItem(h), b || !c.isReadOnly()) g = c.getPosition(d.startNode) & CKEDITOR.POSITION_FOLLOWING || 4133 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); 4134 return f 4135 } 4136 }; 4137 CKEDITOR.dom.range.mergeRanges = function(a) { 4138 return CKEDITOR.tools.array.reduce(a, function(a, b) { 4139 var c = a[a.length - 1], 4140 d = !1; 4141 b = b.clone(); 4142 b.enlarge(CKEDITOR.ENLARGE_ELEMENT); 4143 if (c) { 4144 var e = new CKEDITOR.dom.range(b.root), 4145 d = new CKEDITOR.dom.walker(e), 4146 f = CKEDITOR.dom.walker.whitespaces(); 4147 e.setStart(c.endContainer, c.endOffset); 4148 e.setEnd(b.startContainer, b.startOffset); 4149 for (e = d.next(); f(e) || b.endContainer.equals(e);) e = d.next(); 4150 d = !e 4151 } 4152 d ? c.setEnd(b.endContainer, b.endOffset) : a.push(b); 4153 return a 4154 }, []) 4155 } 4156 })(); 4157 CKEDITOR.POSITION_AFTER_START = 1; 4158 CKEDITOR.POSITION_BEFORE_END = 2; 4159 CKEDITOR.POSITION_BEFORE_START = 3; 4160 CKEDITOR.POSITION_AFTER_END = 4; 4161 CKEDITOR.ENLARGE_ELEMENT = 1; 4162 CKEDITOR.ENLARGE_BLOCK_CONTENTS = 2; 4163 CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS = 3; 4164 CKEDITOR.ENLARGE_INLINE = 4; 4165 CKEDITOR.START = 1; 4166 CKEDITOR.END = 2; 4167 CKEDITOR.SHRINK_ELEMENT = 1; 4168 CKEDITOR.SHRINK_TEXT = 2; 4169 "use strict"; 4170 (function() { 4171 function a(a) { 4172 1 > arguments.length || (this.range = a, this.forceBrBreak = 0, this.enlargeBr = 1, this.enforceRealBlocks = 0, this._ || (this._ = {})) 4173 } 4174 4175 function d(a) { 4176 var b = []; 4177 a.forEach(function(a) { 4178 if ("true" == a.getAttribute("contenteditable")) return b.push(a), !1 4179 }, CKEDITOR.NODE_ELEMENT, !0); 4180 return b 4181 } 4182 4183 function b(a, c, f, h) { 4184 a: { 4185 null == h && (h = d(f)); 4186 for (var g; g = h.shift();) 4187 if (g.getDtd().p) { 4188 h = { 4189 element: g, 4190 remaining: h 4191 }; 4192 break a 4193 } h = null 4194 } 4195 if (!h) return 0; 4196 if ((g = CKEDITOR.filter.instances[h.element.data("cke-filter")]) && !g.check(c)) return b(a, 4197 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 = { 4198 element: h.element, 4199 container: f, 4200 remaining: h.remaining, 4201 iterator: c 4202 }; 4203 return 1 4204 } 4205 4206 function c(a, b, c) { 4207 if (!b) return !1; 4208 a = a.clone(); 4209 a.collapse(!c); 4210 return a.checkBoundaryOfElement(b, c ? CKEDITOR.START : CKEDITOR.END) 4211 } 4212 var f = /^[\r\n\t ]+$/, 4213 h = CKEDITOR.dom.walker.bookmark(!1, !0), 4214 k = CKEDITOR.dom.walker.whitespaces(!0), 4215 g = function(a) { 4216 return h(a) && k(a) 4217 }, 4218 n = { 4219 dd: 1, 4220 dt: 1, 4221 li: 1 4222 }; 4223 a.prototype = { 4224 getNextParagraph: function(a) { 4225 var d, k, v, B, D; 4226 a = a || "p"; 4227 if (this._.nestedEditable) { 4228 if (d = this._.nestedEditable.iterator.getNextParagraph(a)) return this.activeFilter = this._.nestedEditable.iterator.activeFilter, d; 4229 this.activeFilter = this.filter; 4230 if (b(this, a, this._.nestedEditable.container, this._.nestedEditable.remaining)) return this.activeFilter = this._.nestedEditable.iterator.activeFilter, this._.nestedEditable.iterator.getNextParagraph(a); 4231 this._.nestedEditable = 4232 null 4233 } 4234 if (!this.range.root.getDtd()[a]) return null; 4235 if (!this._.started) { 4236 var x = this.range.clone(); 4237 k = x.startPath(); 4238 var m = x.endPath(), 4239 J = !x.collapsed && c(x, k.block), 4240 u = !x.collapsed && c(x, m.block, 1); 4241 x.shrink(CKEDITOR.SHRINK_ELEMENT, !0); 4242 J && x.setStartAt(k.block, CKEDITOR.POSITION_BEFORE_END); 4243 u && x.setEndAt(m.block, CKEDITOR.POSITION_AFTER_START); 4244 k = x.endContainer.hasAscendant("pre", !0) || x.startContainer.hasAscendant("pre", !0); 4245 x.enlarge(this.forceBrBreak && !k || !this.enlargeBr ? CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS); 4246 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() && 4247 (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); 4248 this._.started = 1; 4249 k = x 4250 } 4251 m = this._.nextNode; 4252 x = this._.lastNode; 4253 for (this._.nextNode = null; m;) { 4254 var J = 0, 4255 u = m.hasAscendant("pre"), 4256 K = m.type != CKEDITOR.NODE_ELEMENT, 4257 l = 0; 4258 if (K) m.type == CKEDITOR.NODE_TEXT && f.test(m.getText()) && (K = 0); 4259 else { 4260 var t = m.getName(); 4261 if (CKEDITOR.dtd.$block[t] && "false" == m.getAttribute("contenteditable")) { 4262 d = m; 4263 b(this, a, d); 4264 break 4265 } else if (m.isBlockBoundary(this.forceBrBreak && !u && { 4266 br: 1 4267 })) { 4268 if ("br" == t) K = 1; 4269 else if (!k && !m.getChildCount() && "hr" != t) { 4270 d = m; 4271 v = m.equals(x); 4272 break 4273 } 4274 k && (k.setEndAt(m, CKEDITOR.POSITION_BEFORE_START), "br" != t && (this._.nextNode = m)); 4275 J = 1 4276 } else { 4277 if (m.getFirst()) { 4278 k || (k = this.range.clone(), k.setStartAt(m, CKEDITOR.POSITION_BEFORE_START)); 4279 m = m.getFirst(); 4280 continue 4281 } 4282 K = 1 4283 } 4284 } 4285 K && !k && (k = this.range.clone(), k.setStartAt(m, CKEDITOR.POSITION_BEFORE_START)); 4286 v = (!J || K) && m.equals(x); 4287 if (k && !J) 4288 for (; !m.getNext(g) && !v;) { 4289 t = m.getParent(); 4290 if (t.isBlockBoundary(this.forceBrBreak && !u && { 4291 br: 1 4292 })) { 4293 J = 1; 4294 K = 0; 4295 v || t.equals(x); 4296 k.setEndAt(t, CKEDITOR.POSITION_BEFORE_END); 4297 break 4298 } 4299 m = t; 4300 K = 1; 4301 v = m.equals(x); 4302 l = 1 4303 } 4304 K && k.setEndAt(m, CKEDITOR.POSITION_AFTER_END); 4305 m = this._getNextSourceNode(m, l, x); 4306 if ((v = !m) || J && k) break 4307 } 4308 if (!d) { 4309 if (!k) return this._.docEndMarker && this._.docEndMarker.remove(), this._.nextNode = null; 4310 d = new CKEDITOR.dom.elementPath(k.startContainer, k.root); 4311 m = d.blockLimit; 4312 J = { 4313 div: 1, 4314 th: 1, 4315 td: 1 4316 }; 4317 d = d.block; 4318 !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, 4319 1, x)) 4320 } 4321 B && (B = d.getPrevious()) && B.type == CKEDITOR.NODE_ELEMENT && ("br" == B.getName() ? B.remove() : B.getLast() && "br" == B.getLast().$.nodeName.toLowerCase() && B.getLast().remove()); 4322 D && (B = d.getLast()) && B.type == CKEDITOR.NODE_ELEMENT && "br" == B.getName() && (!CKEDITOR.env.needsBrFiller || B.getPrevious(h) || B.getNext(h)) && B.remove(); 4323 this._.nextNode || (this._.nextNode = v || d.equals(x) || !x ? null : this._getNextSourceNode(d, 1, x)); 4324 return d 4325 }, 4326 _getNextSourceNode: function(a, b, c) { 4327 function d(a) { 4328 return !(a.equals(c) || a.equals(f)) 4329 } 4330 var f = 4331 this.range.root; 4332 for (a = a.getNextSourceNode(b, null, d); !h(a);) a = a.getNextSourceNode(b, null, d); 4333 return a 4334 } 4335 }; 4336 CKEDITOR.dom.range.prototype.createIterator = function() { 4337 return new a(this) 4338 } 4339 })(); 4340 CKEDITOR.command = function(a, d) { 4341 this.uiItems = []; 4342 this.exec = function(b) { 4343 if (this.state == CKEDITOR.TRISTATE_DISABLED || !this.checkAllowed()) return !1; 4344 this.editorFocus && a.focus(); 4345 return !1 === this.fire("exec") ? !0 : !1 !== d.exec.call(this, a, b) 4346 }; 4347 this.refresh = function(a, b) { 4348 if (!this.readOnly && a.readOnly) return !0; 4349 if (this.context && !b.isContextFor(this.context) || !this.checkAllowed(!0)) return this.disable(), !0; 4350 this.startDisabled || this.enable(); 4351 this.modes && !this.modes[a.mode] && this.disable(); 4352 return !1 === this.fire("refresh", { 4353 editor: a, 4354 path: b 4355 }) ? !0 : d.refresh && !1 !== d.refresh.apply(this, arguments) 4356 }; 4357 var b; 4358 this.checkAllowed = function(c) { 4359 return c || "boolean" != typeof b ? b = a.activeFilter.checkFeature(this) : b 4360 }; 4361 CKEDITOR.tools.extend(this, d, { 4362 modes: { 4363 wysiwyg: 1 4364 }, 4365 editorFocus: 1, 4366 contextSensitive: !!d.context, 4367 state: CKEDITOR.TRISTATE_DISABLED 4368 }); 4369 CKEDITOR.event.call(this) 4370 }; 4371 CKEDITOR.command.prototype = { 4372 enable: function() { 4373 this.state == CKEDITOR.TRISTATE_DISABLED && this.checkAllowed() && this.setState(this.preserveState && "undefined" != typeof this.previousState ? this.previousState : CKEDITOR.TRISTATE_OFF) 4374 }, 4375 disable: function() { 4376 this.setState(CKEDITOR.TRISTATE_DISABLED) 4377 }, 4378 setState: function(a) { 4379 if (this.state == a || a != CKEDITOR.TRISTATE_DISABLED && !this.checkAllowed()) return !1; 4380 this.previousState = this.state; 4381 this.state = a; 4382 this.fire("state"); 4383 return !0 4384 }, 4385 toggleState: function() { 4386 this.state == CKEDITOR.TRISTATE_OFF ? 4387 this.setState(CKEDITOR.TRISTATE_ON) : this.state == CKEDITOR.TRISTATE_ON && this.setState(CKEDITOR.TRISTATE_OFF) 4388 } 4389 }; 4390 CKEDITOR.event.implementOn(CKEDITOR.command.prototype); 4391 CKEDITOR.ENTER_P = 1; 4392 CKEDITOR.ENTER_BR = 2; 4393 CKEDITOR.ENTER_DIV = 3; 4394 CKEDITOR.config = { 4395 customConfig: "config.js", 4396 autoUpdateElement: !0, 4397 language: "", 4398 defaultLanguage: "en", 4399 contentsLangDirection: "", 4400 enterMode: CKEDITOR.ENTER_P, 4401 forceEnterMode: !1, 4402 shiftEnterMode: CKEDITOR.ENTER_BR, 4403 docType: "\x3c!DOCTYPE html\x3e", 4404 bodyId: "", 4405 bodyClass: "", 4406 fullPage: !1, 4407 height: 200, 4408 contentsCss: CKEDITOR.getUrl("contents.css"), 4409 extraPlugins: "", 4410 removePlugins: "", 4411 protectedSource: [], 4412 tabIndex: 0, 4413 width: "", 4414 baseFloatZIndex: 1E4, 4415 blockedKeystrokes: [CKEDITOR.CTRL + 66, CKEDITOR.CTRL + 73, CKEDITOR.CTRL + 85] 4416 }; 4417 (function() { 4418 function a(a, b, c, d, f) { 4419 var e, w; 4420 a = []; 4421 for (e in b) { 4422 w = b[e]; 4423 w = "boolean" == typeof w ? {} : "function" == typeof w ? { 4424 match: w 4425 } : E(w); 4426 "$" != e.charAt(0) && (w.elements = e); 4427 c && (w.featureName = c.toLowerCase()); 4428 var l = w; 4429 l.elements = k(l.elements, /\s+/) || null; 4430 l.propertiesOnly = l.propertiesOnly || !0 === l.elements; 4431 var p = /\s*,\s*/, 4432 m = void 0; 4433 for (m in P) { 4434 l[m] = k(l[m], p) || null; 4435 var h = l, 4436 t = O[m], 4437 q = k(l[O[m]], p), 4438 A = l[m], 4439 z = [], 4440 g = !0, 4441 H = void 0; 4442 q ? g = !1 : q = {}; 4443 for (H in A) "!" == H.charAt(0) && (H = H.slice(1), z.push(H), q[H] = !0, g = !1); 4444 for (; H = z.pop();) A[H] = 4445 A["!" + H], delete A["!" + H]; 4446 h[t] = (g ? !1 : q) || null 4447 } 4448 l.match = l.match || null; 4449 d.push(w); 4450 a.push(w) 4451 } 4452 b = f.elements; 4453 f = f.generic; 4454 var F; 4455 c = 0; 4456 for (d = a.length; c < d; ++c) { 4457 e = E(a[c]); 4458 w = !0 === e.classes || !0 === e.styles || !0 === e.attributes; 4459 l = e; 4460 m = t = p = void 0; 4461 for (p in P) l[p] = J(l[p]); 4462 h = !0; 4463 for (m in O) { 4464 p = O[m]; 4465 t = l[p]; 4466 q = []; 4467 A = void 0; 4468 for (A in t) - 1 < A.indexOf("*") ? q.push(new RegExp("^" + A.replace(/\*/g, ".*") + "$")) : q.push(A); 4469 t = q; 4470 t.length && (l[p] = t, h = !1) 4471 } 4472 l.nothingRequired = h; 4473 l.noProperties = !(l.attributes || l.classes || l.styles); 4474 if (!0 === e.elements || 4475 null === e.elements) f[w ? "unshift" : "push"](e); 4476 else 4477 for (F in l = e.elements, delete e.elements, l) 4478 if (b[F]) b[F][w ? "unshift" : "push"](e); 4479 else b[F] = [e] 4480 } 4481 } 4482 4483 function d(a, c, d, f) { 4484 if (!a.match || a.match(c)) 4485 if (f || g(a, c)) 4486 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) { 4487 a = a.classes; 4488 c = c.classes; 4489 f = d.validClasses; 4490 if (a) 4491 if (!0 === a) a = !0; 4492 else { 4493 for (var e = 0, w = c.length, l; e < w; ++e) l = c[e], f[l] || 4494 (f[l] = a(l)); 4495 a = !1 4496 } 4497 else a = !1; 4498 d.allClasses = a 4499 } 4500 } 4501 4502 function b(a, b, c) { 4503 if (!a) return !1; 4504 if (!0 === a) return !0; 4505 for (var d in b) c[d] || (c[d] = a(d)); 4506 return !1 4507 } 4508 4509 function c(a, b, c) { 4510 if (!a.match || a.match(b)) { 4511 if (a.noProperties) return !1; 4512 c.hadInvalidAttribute = f(a.attributes, b.attributes) || c.hadInvalidAttribute; 4513 c.hadInvalidStyle = f(a.styles, b.styles) || c.hadInvalidStyle; 4514 a = a.classes; 4515 b = b.classes; 4516 if (a) { 4517 for (var d = !1, e = !0 === a, l = b.length; l--;) 4518 if (e || a(b[l])) b.splice(l, 1), d = !0; 4519 a = d 4520 } else a = !1; 4521 c.hadInvalidClass = a || c.hadInvalidClass 4522 } 4523 } 4524 4525 function f(a, 4526 b) { 4527 if (!a) return !1; 4528 var c = !1, 4529 d = !0 === a, 4530 f; 4531 for (f in b) 4532 if (d || a(f)) delete b[f], c = !0; 4533 return c 4534 } 4535 4536 function h(a, b, c) { 4537 if (a.disabled || a.customConfig && !c || !b) return !1; 4538 a._.cachedChecks = {}; 4539 return !0 4540 } 4541 4542 function k(a, b) { 4543 if (!a) return !1; 4544 if (!0 === a) return a; 4545 if ("string" == typeof a) return a = z(a), "*" == a ? !0 : CKEDITOR.tools.convertArrayToObject(a.split(b)); 4546 if (CKEDITOR.tools.isArray(a)) return a.length ? CKEDITOR.tools.convertArrayToObject(a) : !1; 4547 var c = {}, 4548 d = 0, 4549 f; 4550 for (f in a) c[f] = a[f], d++; 4551 return d ? c : !1 4552 } 4553 4554 function g(a, b) { 4555 if (a.nothingRequired) return !0; 4556 var c, d, f, e; 4557 if (f = a.requiredClasses) 4558 for (e = b.classes, c = 0; c < f.length; ++c) 4559 if (d = f[c], "string" == typeof d) { 4560 if (-1 == CKEDITOR.tools.indexOf(e, d)) return !1 4561 } else if (!CKEDITOR.tools.checkIfAnyArrayItemMatches(e, d)) return !1; 4562 return n(b.styles, a.requiredStyles) && n(b.attributes, a.requiredAttributes) 4563 } 4564 4565 function n(a, b) { 4566 if (!b) return !0; 4567 for (var c = 0, d; c < b.length; ++c) 4568 if (d = b[c], "string" == typeof d) { 4569 if (!(d in a)) return !1 4570 } else if (!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a, d)) return !1; 4571 return !0 4572 } 4573 4574 function r(a) { 4575 if (!a) return {}; 4576 a = a.split(/\s*,\s*/).sort(); 4577 for (var b = {}; a.length;) b[a.shift()] = "cke-test"; 4578 return b 4579 } 4580 4581 function e(a) { 4582 var b, c, d, f, e = {}, 4583 l = 1; 4584 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++] = { 4585 elements: b[1], 4586 classes: c, 4587 styles: d, 4588 attributes: f 4589 }, a = a.slice(b[0].length); 4590 return e 4591 } 4592 4593 function y(a, b) { 4594 var c = a.match(N[b]); 4595 return c ? z(c[1]) : null 4596 } 4597 4598 function v(a) { 4599 var b = a.styleBackup = a.attributes.style, 4600 c = a.classBackup = a.attributes["class"]; 4601 a.styles || (a.styles = CKEDITOR.tools.parseCssText(b || 4602 "", 1)); 4603 a.classes || (a.classes = c ? c.split(/\s+/) : []) 4604 } 4605 4606 function B(a, b, f, e) { 4607 var l = 0, 4608 p; 4609 e.toHtml && (b.name = b.name.replace(w, "$1")); 4610 if (e.doCallbacks && a.elementCallbacks) { 4611 a: { 4612 p = a.elementCallbacks; 4613 for (var h = 0, q = p.length, E; h < q; ++h) 4614 if (E = p[h](b)) { 4615 p = E; 4616 break a 4617 } p = void 0 4618 } 4619 if (p) return p 4620 } 4621 if (e.doTransform && (p = a._.transformations[b.name])) { 4622 v(b); 4623 for (h = 0; h < p.length; ++h) t(a, b, p[h]); 4624 x(b) 4625 } 4626 if (e.doFilter) { 4627 a: { 4628 h = b.name;q = a._;a = q.allowedRules.elements[h];p = q.allowedRules.generic;h = q.disallowedRules.elements[h];q = q.disallowedRules.generic; 4629 E = e.skipRequired; 4630 var z = { 4631 valid: !1, 4632 validAttributes: {}, 4633 validClasses: {}, 4634 validStyles: {}, 4635 allAttributes: !1, 4636 allClasses: !1, 4637 allStyles: !1, 4638 hadInvalidAttribute: !1, 4639 hadInvalidClass: !1, 4640 hadInvalidStyle: !1 4641 }, 4642 g, k; 4643 if (a || p) { 4644 v(b); 4645 if (h) 4646 for (g = 0, k = h.length; g < k; ++g) 4647 if (!1 === c(h[g], b, z)) { 4648 a = null; 4649 break a 4650 } if (q) 4651 for (g = 0, k = q.length; g < k; ++g) c(q[g], b, z); 4652 if (a) 4653 for (g = 0, k = a.length; g < k; ++g) d(a[g], b, z, E); 4654 if (p) 4655 for (g = 0, k = p.length; g < k; ++g) d(p[g], b, z, E); 4656 a = z 4657 } else a = null 4658 } 4659 if (!a || !a.valid) return f.push(b), 4660 1;k = a.validAttributes; 4661 var H = a.validStyles; 4662 p = a.validClasses; 4663 var h = b.attributes, 4664 F = b.styles, 4665 q = b.classes;E = b.classBackup; 4666 var L = b.styleBackup, 4667 G, N, C = [], 4668 z = [], 4669 O = /^data-cke-/;g = !1;delete h.style;delete h["class"];delete b.classBackup;delete b.styleBackup; 4670 if (!a.allAttributes) 4671 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)); 4672 if (!a.allStyles || a.hadInvalidStyle) { 4673 for (G in F) a.allStyles || H[G] ? C.push(G + ":" + F[G]) : g = !0; 4674 C.length && (h.style = C.sort().join("; ")) 4675 } else L && (h.style = L); 4676 if (!a.allClasses || 4677 a.hadInvalidClass) { 4678 for (G = 0; G < q.length; ++G)(a.allClasses || p[q[G]]) && z.push(q[G]); 4679 z.length && (h["class"] = z.sort().join(" ")); 4680 E && z.length < E.split(/\s+/).length && (g = !0) 4681 } else E && (h["class"] = E);g && (l = 1); 4682 if (!e.skipFinalValidation && !m(b)) return f.push(b), 4683 1 4684 } 4685 e.toHtml && (b.name = b.name.replace(A, "cke:$1")); 4686 return l 4687 } 4688 4689 function D(a) { 4690 var b = [], 4691 c; 4692 for (c in a) - 1 < c.indexOf("*") && b.push(c.replace(/\*/g, ".*")); 4693 return b.length ? new RegExp("^(?:" + b.join("|") + ")$") : null 4694 } 4695 4696 function x(a) { 4697 var b = a.attributes, 4698 c; 4699 delete b.style; 4700 delete b["class"]; 4701 if (c = CKEDITOR.tools.writeCssText(a.styles, !0)) b.style = c; 4702 a.classes.length && (b["class"] = a.classes.sort().join(" ")) 4703 } 4704 4705 function m(a) { 4706 switch (a.name) { 4707 case "a": 4708 if (!(a.children.length || a.attributes.name || a.attributes.id)) return !1; 4709 break; 4710 case "img": 4711 if (!a.attributes.src) return !1 4712 } 4713 return !0 4714 } 4715 4716 function J(a) { 4717 if (!a) return !1; 4718 if (!0 === a) return !0; 4719 var b = D(a); 4720 return function(c) { 4721 return c in a || b && c.match(b) 4722 } 4723 } 4724 4725 function u() { 4726 return new CKEDITOR.htmlParser.element("br") 4727 } 4728 4729 function K(a) { 4730 return a.type == CKEDITOR.NODE_ELEMENT && ("br" == 4731 a.name || q.$block[a.name]) 4732 } 4733 4734 function l(a, b, c) { 4735 var d = a.name; 4736 if (q.$empty[d] || !a.children.length) "hr" == d && "br" == b ? a.replaceWith(u()) : (a.parent && c.push({ 4737 check: "it", 4738 el: a.parent 4739 }), a.remove()); 4740 else if (q.$block[d] || "tr" == d) 4741 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(); 4742 else { 4743 var d = a.children, 4744 f; 4745 b: { 4746 f = q[b]; 4747 for (var e = 0, l = d.length, w; e < l; ++e) 4748 if (w = d[e], w.type == CKEDITOR.NODE_ELEMENT && !f[w.name]) { 4749 f = !1; 4750 break b 4751 } f = !0 4752 } 4753 if (f) a.name = b, a.attributes = {}, c.push({ 4754 check: "parent-down", 4755 el: a 4756 }); 4757 else { 4758 f = a.parent; 4759 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({ 4760 check: "parent-down", 4761 el: p 4762 })), 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({ 4763 check: "el-up", 4764 el: w 4765 })); 4766 a.remove() 4767 } 4768 } 4769 else d in { 4770 style: 1, 4771 script: 1 4772 } ? a.remove() : (a.parent && c.push({ 4773 check: "it", 4774 el: a.parent 4775 }), a.replaceWithChildren()) 4776 } 4777 4778 function t(a, b, c) { 4779 var d, f; 4780 for (d = 0; d < c.length; ++d) 4781 if (f = c[d], !(f.check && !a.check(f.check, !1) || f.left && !f.left(b))) { 4782 f.right(b, G); 4783 break 4784 } 4785 } 4786 4787 function F(a, b) { 4788 var c = b.getDefinition(), 4789 d = c.attributes, 4790 f = c.styles, 4791 e, l, w, p; 4792 if (a.name != c.element) return !1; 4793 for (e in d) 4794 if ("class" == e) 4795 for (c = d[e].split(/\s+/), w = a.classes.join("|"); p = c.pop();) { 4796 if (-1 == w.indexOf(p)) return !1 4797 } else if (a.attributes[e] != d[e]) return !1; 4798 for (l in f) 4799 if (a.styles[l] != 4800 f[l]) return !1; 4801 return !0 4802 } 4803 4804 function L(a, b) { 4805 var c, d; 4806 "string" == typeof a ? c = a : a instanceof CKEDITOR.style ? d = a : (c = a[0], d = a[1]); 4807 return [{ 4808 element: c, 4809 left: d, 4810 right: function(a, c) { 4811 c.transform(a, b) 4812 } 4813 }] 4814 } 4815 4816 function C(a) { 4817 return function(b) { 4818 return F(b, a) 4819 } 4820 } 4821 4822 function M(a) { 4823 return function(b, c) { 4824 c[a](b) 4825 } 4826 } 4827 var q = CKEDITOR.dtd, 4828 E = CKEDITOR.tools.copy, 4829 z = CKEDITOR.tools.trim, 4830 H = ["", "p", "br", "div"]; 4831 CKEDITOR.FILTER_SKIP_TREE = 2; 4832 CKEDITOR.filter = function(a) { 4833 this.allowedContent = []; 4834 this.disallowedContent = []; 4835 this.elementCallbacks = null; 4836 this.disabled = !1; 4837 this.editor = null; 4838 this.id = CKEDITOR.tools.getNextNumber(); 4839 this._ = { 4840 allowedRules: { 4841 elements: {}, 4842 generic: [] 4843 }, 4844 disallowedRules: { 4845 elements: {}, 4846 generic: [] 4847 }, 4848 transformations: {}, 4849 cachedTests: {}, 4850 cachedChecks: {} 4851 }; 4852 CKEDITOR.filter.instances[this.id] = this; 4853 if (a instanceof CKEDITOR.editor) { 4854 a = this.editor = a; 4855 this.customConfig = !0; 4856 var b = a.config.allowedContent; 4857 !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], 4858 "default", 1), this.disallow(a.config.disallowedContent)) 4859 } else this.customConfig = !1, this.allow(a, "default", 1) 4860 }; 4861 CKEDITOR.filter.instances = {}; 4862 CKEDITOR.filter.prototype = { 4863 allow: function(b, c, d) { 4864 if (!h(this, b, d)) return !1; 4865 var f, l; 4866 if ("string" == typeof b) b = e(b); 4867 else if (b instanceof CKEDITOR.style) { 4868 if (b.toAllowedContentRules) return this.allow(b.toAllowedContentRules(this.editor), c, d); 4869 f = b.getDefinition(); 4870 b = {}; 4871 d = f.attributes; 4872 b[f.element] = f = { 4873 styles: f.styles, 4874 requiredStyles: f.styles && CKEDITOR.tools.objectKeys(f.styles) 4875 }; 4876 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)) 4877 } else if (CKEDITOR.tools.isArray(b)) { 4878 for (f = 0; f < b.length; ++f) l = this.allow(b[f], c, d); 4879 return l 4880 } 4881 a(this, b, c, this.allowedContent, this._.allowedRules); 4882 return !0 4883 }, 4884 applyTo: function(a, b, c, d) { 4885 if (this.disabled) return !1; 4886 var f = this, 4887 e = [], 4888 w = this.editor && this.editor.config.protectedSource, 4889 p, h = !1, 4890 t = { 4891 doFilter: !c, 4892 doTransform: !0, 4893 doCallbacks: !0, 4894 toHtml: b 4895 }; 4896 a.forEach(function(a) { 4897 if (a.type == CKEDITOR.NODE_ELEMENT) { 4898 if ("off" == a.attributes["data-cke-filter"]) return !1; 4899 if (!b || "span" != a.name || !~CKEDITOR.tools.objectKeys(a.attributes).join("|").indexOf("data-cke-")) 4900 if (p = B(f, a, e, t), p & 1) h = !0; 4901 else if (p & 2) return !1 4902 } else if (a.type == CKEDITOR.NODE_COMMENT && a.value.match(/^\{cke_protected\}(?!\{C\})/)) { 4903 var c; 4904 a: { 4905 var d = decodeURIComponent(a.value.replace(/^\{cke_protected\}/, ""));c = []; 4906 var l, m, q; 4907 if (w) 4908 for (m = 0; m < w.length; ++m) 4909 if ((q = d.match(w[m])) && q[0].length == d.length) { 4910 c = !0; 4911 break a 4912 } 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 4913 } 4914 c || e.push(a) 4915 } 4916 }, null, !0); 4917 e.length && (h = !0); 4918 var E; 4919 a = []; 4920 d = H[d || (this.editor ? this.editor.enterMode : CKEDITOR.ENTER_P)]; 4921 for (var z; c = e.pop();) c.type == CKEDITOR.NODE_ELEMENT ? l(c, d, a) : c.remove(); 4922 for (; E = a.pop();) 4923 if (c = E.el, c.parent) switch (z = q[c.parent.name] || q.span, E.check) { 4924 case "it": 4925 q.$removeEmpty[c.name] && !c.children.length ? l(c, d, a) : m(c) || l(c, d, a); 4926 break; 4927 case "el-up": 4928 c.parent.type == 4929 CKEDITOR.NODE_DOCUMENT_FRAGMENT || z[c.name] || l(c, d, a); 4930 break; 4931 case "parent-down": 4932 c.parent.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || z[c.name] || l(c.parent, d, a) 4933 } 4934 return h 4935 }, 4936 checkFeature: function(a) { 4937 if (this.disabled || !a) return !0; 4938 a.toFeature && (a = a.toFeature(this.editor)); 4939 return !a.requiredContent || this.check(a.requiredContent) 4940 }, 4941 disable: function() { 4942 this.disabled = !0 4943 }, 4944 disallow: function(b) { 4945 if (!h(this, b, !0)) return !1; 4946 "string" == typeof b && (b = e(b)); 4947 a(this, b, null, this.disallowedContent, this._.disallowedRules); 4948 return !0 4949 }, 4950 addContentForms: function(a) { 4951 if (!this.disabled && a) { 4952 var b, c, d = [], 4953 f; 4954 for (b = 0; b < a.length && !f; ++b) c = a[b], ("string" == typeof c || c instanceof CKEDITOR.style) && this.check(c) && (f = c); 4955 if (f) { 4956 for (b = 0; b < a.length; ++b) d.push(L(a[b], f)); 4957 this.addTransformations(d) 4958 } 4959 } 4960 }, 4961 addElementCallback: function(a) { 4962 this.elementCallbacks || (this.elementCallbacks = []); 4963 this.elementCallbacks.push(a) 4964 }, 4965 addFeature: function(a) { 4966 if (this.disabled || !a) return !0; 4967 a.toFeature && (a = a.toFeature(this.editor)); 4968 this.allow(a.allowedContent, a.name); 4969 this.addTransformations(a.contentTransformations); 4970 this.addContentForms(a.contentForms); 4971 return a.requiredContent && (this.customConfig || this.disallowedContent.length) ? this.check(a.requiredContent) : !0 4972 }, 4973 addTransformations: function(a) { 4974 var b, c; 4975 if (!this.disabled && a) { 4976 var d = this._.transformations, 4977 f; 4978 for (f = 0; f < a.length; ++f) { 4979 b = a[f]; 4980 var e = void 0, 4981 l = void 0, 4982 w = void 0, 4983 p = void 0, 4984 h = void 0, 4985 m = void 0; 4986 c = []; 4987 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] : 4988 e.left.getDefinition().element), h instanceof CKEDITOR.style && (h = C(h)), c.push({ 4989 check: p == e ? null : p, 4990 left: h, 4991 right: "string" == typeof m ? M(m) : m 4992 }); 4993 b = e; 4994 d[b] || (d[b] = []); 4995 d[b].push(c) 4996 } 4997 } 4998 }, 4999 check: function(a, b, c) { 5000 if (this.disabled) return !0; 5001 if (CKEDITOR.tools.isArray(a)) { 5002 for (var d = a.length; d--;) 5003 if (this.check(a[d], b, c)) return !0; 5004 return !1 5005 } 5006 var f, w; 5007 if ("string" == typeof a) { 5008 w = a + "\x3c" + (!1 === b ? "0" : "1") + (c ? "1" : "0") + "\x3e"; 5009 if (w in this._.cachedChecks) return this._.cachedChecks[w]; 5010 f = e(a).$1; 5011 var l = f.styles, 5012 d = f.classes; 5013 f.name = f.elements; 5014 f.classes = d = d ? d.split(/\s*,\s*/) : []; 5015 f.styles = r(l); 5016 f.attributes = r(f.attributes); 5017 f.children = []; 5018 d.length && (f.attributes["class"] = d.join(" ")); 5019 l && (f.attributes.style = CKEDITOR.tools.writeCssText(f.styles)) 5020 } 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 = { 5021 name: f.element, 5022 attributes: d, 5023 classes: d["class"] ? d["class"].split(/\s+/) : [], 5024 styles: l, 5025 children: [] 5026 }; 5027 var l = CKEDITOR.tools.clone(f), 5028 p = [], 5029 h; 5030 if (!1 !== b && (h = this._.transformations[f.name])) { 5031 for (d = 5032 0; d < h.length; ++d) t(this, f, h[d]); 5033 x(f) 5034 } 5035 B(this, l, p, { 5036 doFilter: !0, 5037 doTransform: !1 !== b, 5038 skipRequired: !c, 5039 skipFinalValidation: !c 5040 }); 5041 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)); 5042 "string" == typeof a && (this._.cachedChecks[w] = c); 5043 return c 5044 }, 5045 getAllowedEnterMode: function() { 5046 var a = ["p", "div", "br"], 5047 b = { 5048 p: CKEDITOR.ENTER_P, 5049 div: CKEDITOR.ENTER_DIV, 5050 br: CKEDITOR.ENTER_BR 5051 }; 5052 return function(c, d) { 5053 var f = a.slice(), 5054 e; 5055 if (this.check(H[c])) return c; 5056 for (d || (f = f.reverse()); e = f.pop();) 5057 if (this.check(e)) return b[e]; 5058 return CKEDITOR.ENTER_BR 5059 } 5060 }(), 5061 clone: function() { 5062 var a = new CKEDITOR.filter, 5063 b = CKEDITOR.tools.clone; 5064 a.allowedContent = b(this.allowedContent); 5065 a._.allowedRules = b(this._.allowedRules); 5066 a.disallowedContent = b(this.disallowedContent); 5067 a._.disallowedRules = b(this._.disallowedRules); 5068 a._.transformations = b(this._.transformations); 5069 a.disabled = this.disabled; 5070 a.editor = this.editor; 5071 return a 5072 }, 5073 destroy: function() { 5074 delete CKEDITOR.filter.instances[this.id]; 5075 delete this._; 5076 delete this.allowedContent; 5077 delete this.disallowedContent 5078 } 5079 }; 5080 var P = { 5081 styles: 1, 5082 attributes: 1, 5083 classes: 1 5084 }, 5085 O = { 5086 styles: "requiredStyles", 5087 attributes: "requiredAttributes", 5088 classes: "requiredClasses" 5089 }, 5090 p = /^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i, 5091 N = { 5092 styles: /{([^}]+)}/, 5093 attrs: /\[([^\]]+)\]/, 5094 classes: /\(([^\)]+)\)/ 5095 }, 5096 w = /^cke:(object|embed|param)$/, 5097 A = /^(object|embed|param)$/, 5098 G; 5099 G = CKEDITOR.filter.transformationsTools = { 5100 sizeToStyle: function(a) { 5101 this.lengthToStyle(a, 5102 "width"); 5103 this.lengthToStyle(a, "height") 5104 }, 5105 sizeToAttribute: function(a) { 5106 this.lengthToAttribute(a, "width"); 5107 this.lengthToAttribute(a, "height") 5108 }, 5109 lengthToStyle: function(a, b, c) { 5110 c = c || b; 5111 if (!(c in a.styles)) { 5112 var d = a.attributes[b]; 5113 d && (/^\d+$/.test(d) && (d += "px"), a.styles[c] = d) 5114 } 5115 delete a.attributes[b] 5116 }, 5117 lengthToAttribute: function(a, b, c) { 5118 c = c || b; 5119 if (!(c in a.attributes)) { 5120 var d = a.styles[b], 5121 f = d && d.match(/^(\d+)(?:\.\d*)?px$/); 5122 f ? a.attributes[c] = f[1] : "cke-test" == d && (a.attributes[c] = "cke-test") 5123 } 5124 delete a.styles[b] 5125 }, 5126 alignmentToStyle: function(a) { 5127 if (!("float" in 5128 a.styles)) { 5129 var b = a.attributes.align; 5130 if ("left" == b || "right" == b) a.styles["float"] = b 5131 } 5132 delete a.attributes.align 5133 }, 5134 alignmentToAttribute: function(a) { 5135 if (!("align" in a.attributes)) { 5136 var b = a.styles["float"]; 5137 if ("left" == b || "right" == b) a.attributes.align = b 5138 } 5139 delete a.styles["float"] 5140 }, 5141 splitBorderShorthand: function(a) { 5142 if (a.styles.border) { 5143 var b = CKEDITOR.tools.style.parse.border(a.styles.border); 5144 b.color && (a.styles["border-color"] = b.color); 5145 b.style && (a.styles["border-style"] = b.style); 5146 b.width && (a.styles["border-width"] = b.width); 5147 delete a.styles.border 5148 } 5149 }, 5150 listTypeToStyle: function(a) { 5151 if (a.attributes.type) switch (a.attributes.type) { 5152 case "a": 5153 a.styles["list-style-type"] = "lower-alpha"; 5154 break; 5155 case "A": 5156 a.styles["list-style-type"] = "upper-alpha"; 5157 break; 5158 case "i": 5159 a.styles["list-style-type"] = "lower-roman"; 5160 break; 5161 case "I": 5162 a.styles["list-style-type"] = "upper-roman"; 5163 break; 5164 case "1": 5165 a.styles["list-style-type"] = "decimal"; 5166 break; 5167 default: 5168 a.styles["list-style-type"] = a.attributes.type 5169 } 5170 }, 5171 splitMarginShorthand: function(a) { 5172 function b(d) { 5173 a.styles["margin-top"] = 5174 c[d[0]]; 5175 a.styles["margin-right"] = c[d[1]]; 5176 a.styles["margin-bottom"] = c[d[2]]; 5177 a.styles["margin-left"] = c[d[3]] 5178 } 5179 if (a.styles.margin) { 5180 var c = a.styles.margin.match(/(\-?[\.\d]+\w+)/g) || ["0px"]; 5181 switch (c.length) { 5182 case 1: 5183 b([0, 0, 0, 0]); 5184 break; 5185 case 2: 5186 b([0, 1, 0, 1]); 5187 break; 5188 case 3: 5189 b([0, 1, 2, 1]); 5190 break; 5191 case 4: 5192 b([0, 1, 2, 3]) 5193 } 5194 delete a.styles.margin 5195 } 5196 }, 5197 matchesStyle: F, 5198 transform: function(a, b) { 5199 if ("string" == typeof b) a.name = b; 5200 else { 5201 var c = b.getDefinition(), 5202 d = c.styles, 5203 f = c.attributes, 5204 e, l, w, p; 5205 a.name = c.element; 5206 for (e in f) 5207 if ("class" == e) 5208 for (c = 5209 a.classes.join("|"), w = f[e].split(/\s+/); p = w.pop();) - 1 == c.indexOf(p) && a.classes.push(p); 5210 else a.attributes[e] = f[e]; 5211 for (l in d) a.styles[l] = d[l] 5212 } 5213 } 5214 } 5215 })(); 5216 (function() { 5217 CKEDITOR.focusManager = function(a) { 5218 if (a.focusManager) return a.focusManager; 5219 this.hasFocus = !1; 5220 this.currentActive = null; 5221 this._ = { 5222 editor: a 5223 }; 5224 return this 5225 }; 5226 CKEDITOR.focusManager._ = { 5227 blurDelay: 200 5228 }; 5229 CKEDITOR.focusManager.prototype = { 5230 focus: function(a) { 5231 this._.timer && clearTimeout(this._.timer); 5232 a && (this.currentActive = a); 5233 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")) 5234 }, 5235 lock: function() { 5236 this._.locked = 5237 1 5238 }, 5239 unlock: function() { 5240 delete this._.locked 5241 }, 5242 blur: function(a) { 5243 function d() { 5244 if (this.hasFocus) { 5245 this.hasFocus = !1; 5246 var a = this._.editor.container; 5247 a && a.removeClass("cke_focus"); 5248 this._.editor.fire("blur") 5249 } 5250 } 5251 if (!this._.locked) { 5252 this._.timer && clearTimeout(this._.timer); 5253 var b = CKEDITOR.focusManager._.blurDelay; 5254 a || !b ? d.call(this) : this._.timer = CKEDITOR.tools.setTimeout(function() { 5255 delete this._.timer; 5256 d.call(this) 5257 }, b, this) 5258 } 5259 }, 5260 add: function(a, d) { 5261 var b = a.getCustomData("focusmanager"); 5262 if (!b || b != this) { 5263 b && b.remove(a); 5264 var b = 5265 "focus", 5266 c = "blur"; 5267 d && (CKEDITOR.env.ie ? (b = "focusin", c = "focusout") : CKEDITOR.event.useCapture = 1); 5268 var f = { 5269 blur: function() { 5270 a.equals(this.currentActive) && this.blur() 5271 }, 5272 focus: function() { 5273 this.focus(a) 5274 } 5275 }; 5276 a.on(b, f.focus, this); 5277 a.on(c, f.blur, this); 5278 d && (CKEDITOR.event.useCapture = 0); 5279 a.setCustomData("focusmanager", this); 5280 a.setCustomData("focusmanager_handlers", f) 5281 } 5282 }, 5283 remove: function(a) { 5284 a.removeCustomData("focusmanager"); 5285 var d = a.removeCustomData("focusmanager_handlers"); 5286 a.removeListener("blur", d.blur); 5287 a.removeListener("focus", 5288 d.focus) 5289 } 5290 } 5291 })(); 5292 CKEDITOR.keystrokeHandler = function(a) { 5293 if (a.keystrokeHandler) return a.keystrokeHandler; 5294 this.keystrokes = {}; 5295 this.blockedKeystrokes = {}; 5296 this._ = { 5297 editor: a 5298 }; 5299 return this 5300 }; 5301 (function() { 5302 var a, d = function(b) { 5303 b = b.data; 5304 var d = b.getKeystroke(), 5305 h = this.keystrokes[d], 5306 k = this._.editor; 5307 a = !1 === k.fire("key", { 5308 keyCode: d, 5309 domEvent: b 5310 }); 5311 a || (h && (a = !1 !== k.execCommand(h, { 5312 from: "keystrokeHandler" 5313 })), a || (a = !!this.blockedKeystrokes[d])); 5314 a && b.preventDefault(!0); 5315 return !a 5316 }, 5317 b = function(b) { 5318 a && (a = !1, b.data.preventDefault(!0)) 5319 }; 5320 CKEDITOR.keystrokeHandler.prototype = { 5321 attach: function(a) { 5322 a.on("keydown", d, this); 5323 if (CKEDITOR.env.gecko && CKEDITOR.env.mac) a.on("keypress", b, this) 5324 } 5325 } 5326 })(); 5327 (function() { 5328 CKEDITOR.lang = { 5329 languages: { 5330 af: 1, 5331 ar: 1, 5332 az: 1, 5333 bg: 1, 5334 bn: 1, 5335 bs: 1, 5336 ca: 1, 5337 cs: 1, 5338 cy: 1, 5339 da: 1, 5340 de: 1, 5341 "de-ch": 1, 5342 el: 1, 5343 "en-au": 1, 5344 "en-ca": 1, 5345 "en-gb": 1, 5346 en: 1, 5347 eo: 1, 5348 es: 1, 5349 "es-mx": 1, 5350 et: 1, 5351 eu: 1, 5352 fa: 1, 5353 fi: 1, 5354 fo: 1, 5355 "fr-ca": 1, 5356 fr: 1, 5357 gl: 1, 5358 gu: 1, 5359 he: 1, 5360 hi: 1, 5361 hr: 1, 5362 hu: 1, 5363 id: 1, 5364 is: 1, 5365 it: 1, 5366 ja: 1, 5367 ka: 1, 5368 km: 1, 5369 ko: 1, 5370 ku: 1, 5371 lt: 1, 5372 lv: 1, 5373 mk: 1, 5374 mn: 1, 5375 ms: 1, 5376 nb: 1, 5377 nl: 1, 5378 no: 1, 5379 oc: 1, 5380 pl: 1, 5381 "pt-br": 1, 5382 pt: 1, 5383 ro: 1, 5384 ru: 1, 5385 si: 1, 5386 sk: 1, 5387 sl: 1, 5388 sq: 1, 5389 "sr-latn": 1, 5390 sr: 1, 5391 sv: 1, 5392 th: 1, 5393 tr: 1, 5394 tt: 1, 5395 ug: 1, 5396 uk: 1, 5397 vi: 1, 5398 "zh-cn": 1, 5399 zh: 1 5400 }, 5401 rtl: { 5402 ar: 1, 5403 fa: 1, 5404 he: 1, 5405 ku: 1, 5406 ug: 1 5407 }, 5408 load: function(a, d, b) { 5409 a && CKEDITOR.lang.languages[a] || 5410 (a = this.detect(d, a)); 5411 var c = this; 5412 d = function() { 5413 c[a].dir = c.rtl[a] ? "rtl" : "ltr"; 5414 b(a, c[a]) 5415 }; 5416 this[a] ? d() : CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/" + a + ".js"), d, this) 5417 }, 5418 detect: function(a, d) { 5419 var b = this.languages; 5420 d = d || navigator.userLanguage || navigator.language || a; 5421 var c = d.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/), 5422 f = c[1], 5423 c = c[2]; 5424 b[f + "-" + c] ? f = f + "-" + c : b[f] || (f = null); 5425 CKEDITOR.lang.detect = f ? function() { 5426 return f 5427 } : function(a) { 5428 return a 5429 }; 5430 return f || a 5431 } 5432 } 5433 })(); 5434 CKEDITOR.scriptLoader = function() { 5435 var a = {}, 5436 d = {}; 5437 return { 5438 load: function(b, c, f, h) { 5439 var k = "string" == typeof b; 5440 k && (b = [b]); 5441 f || (f = CKEDITOR); 5442 var g = b.length, 5443 n = [], 5444 r = [], 5445 e = function(a) { 5446 c && (k ? c.call(f, a) : c.call(f, n, r)) 5447 }; 5448 if (0 === g) e(!0); 5449 else { 5450 var y = function(a, b) { 5451 (b ? n : r).push(a); 5452 0 >= --g && (h && CKEDITOR.document.getDocumentElement().removeStyle("cursor"), e(b)) 5453 }, 5454 v = function(b, c) { 5455 a[b] = 1; 5456 var f = d[b]; 5457 delete d[b]; 5458 for (var e = 0; e < f.length; e++) f[e](b, c) 5459 }, 5460 B = function(b) { 5461 if (a[b]) y(b, !0); 5462 else { 5463 var f = d[b] || (d[b] = []); 5464 f.push(y); 5465 if (!(1 < f.length)) { 5466 var e = 5467 new CKEDITOR.dom.element("script"); 5468 e.setAttributes({ 5469 type: "text/javascript", 5470 src: b 5471 }); 5472 c && (CKEDITOR.env.ie && (8 >= CKEDITOR.env.version || CKEDITOR.env.ie9Compat) ? e.$.onreadystatechange = function() { 5473 if ("loaded" == e.$.readyState || "complete" == e.$.readyState) e.$.onreadystatechange = null, v(b, !0) 5474 } : (e.$.onload = function() { 5475 setTimeout(function() { 5476 v(b, !0) 5477 }, 0) 5478 }, e.$.onerror = function() { 5479 v(b, !1) 5480 })); 5481 e.appendTo(CKEDITOR.document.getHead()) 5482 } 5483 } 5484 }; 5485 h && CKEDITOR.document.getDocumentElement().setStyle("cursor", "wait"); 5486 for (var D = 0; D < g; D++) B(b[D]) 5487 } 5488 }, 5489 queue: function() { 5490 function a() { 5491 var b; 5492 (b = c[0]) && this.load(b.scriptUrl, b.callback, CKEDITOR, 0) 5493 } 5494 var c = []; 5495 return function(d, h) { 5496 var k = this; 5497 c.push({ 5498 scriptUrl: d, 5499 callback: function() { 5500 h && h.apply(this, arguments); 5501 c.shift(); 5502 a.call(k) 5503 } 5504 }); 5505 1 == c.length && a.call(this) 5506 } 5507 }() 5508 } 5509 }(); 5510 CKEDITOR.resourceManager = function(a, d) { 5511 this.basePath = a; 5512 this.fileName = d; 5513 this.registered = {}; 5514 this.loaded = {}; 5515 this.externals = {}; 5516 this._ = { 5517 waitingList: {} 5518 } 5519 }; 5520 CKEDITOR.resourceManager.prototype = { 5521 add: function(a, d) { 5522 if (this.registered[a]) throw Error('[CKEDITOR.resourceManager.add] The resource name "' + a + '" is already registered.'); 5523 var b = this.registered[a] = d || {}; 5524 b.name = a; 5525 b.path = this.getPath(a); 5526 CKEDITOR.fire(a + CKEDITOR.tools.capitalize(this.fileName) + "Ready", b); 5527 return this.get(a) 5528 }, 5529 get: function(a) { 5530 return this.registered[a] || null 5531 }, 5532 getPath: function(a) { 5533 var d = this.externals[a]; 5534 return CKEDITOR.getUrl(d && d.dir || this.basePath + a + "/") 5535 }, 5536 getFilePath: function(a) { 5537 var d = this.externals[a]; 5538 return CKEDITOR.getUrl(this.getPath(a) + (d ? d.file : this.fileName + ".js")) 5539 }, 5540 addExternal: function(a, d, b) { 5541 a = a.split(","); 5542 for (var c = 0; c < a.length; c++) { 5543 var f = a[c]; 5544 b || (d = d.replace(/[^\/]+$/, function(a) { 5545 b = a; 5546 return "" 5547 })); 5548 this.externals[f] = { 5549 dir: d, 5550 file: b || this.fileName + ".js" 5551 } 5552 } 5553 }, 5554 load: function(a, d, b) { 5555 CKEDITOR.tools.isArray(a) || (a = a ? [a] : []); 5556 for (var c = this.loaded, f = this.registered, h = [], k = {}, g = {}, n = 0; n < a.length; n++) { 5557 var r = a[n]; 5558 if (r) 5559 if (c[r] || f[r]) g[r] = this.get(r); 5560 else { 5561 var e = this.getFilePath(r); 5562 h.push(e); 5563 e in k || (k[e] = []); 5564 k[e].push(r) 5565 } 5566 } 5567 CKEDITOR.scriptLoader.load(h, function(a, f) { 5568 if (f.length) throw Error('[CKEDITOR.resourceManager.load] Resource name "' + k[f[0]].join(",") + '" was not found at "' + f[0] + '".'); 5569 for (var e = 0; e < a.length; e++) 5570 for (var h = k[a[e]], n = 0; n < h.length; n++) { 5571 var m = h[n]; 5572 g[m] = this.get(m); 5573 c[m] = 1 5574 } 5575 d.call(b, g) 5576 }, this) 5577 } 5578 }; 5579 CKEDITOR.plugins = new CKEDITOR.resourceManager("plugins/", "plugin"); 5580 CKEDITOR.plugins.load = CKEDITOR.tools.override(CKEDITOR.plugins.load, function(a) { 5581 var d = {}; 5582 return function(b, c, f) { 5583 var h = {}, 5584 k = function(b) { 5585 a.call(this, b, function(a) { 5586 CKEDITOR.tools.extend(h, a); 5587 var b = [], 5588 e; 5589 for (e in a) { 5590 var g = a[e], 5591 v = g && g.requires; 5592 if (!d[e]) { 5593 if (g.icons) 5594 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"); 5595 d[e] = 1 5596 } 5597 if (v) 5598 for (v.split && (v = v.split(",")), g = 0; g < v.length; g++) h[v[g]] || b.push(v[g]) 5599 } 5600 if (b.length) k.call(this, 5601 b); 5602 else { 5603 for (e in h) g = h[e], g.onLoad && !g.onLoad._called && (!1 === g.onLoad() && delete h[e], g.onLoad._called = 1); 5604 c && c.call(f || window, h) 5605 } 5606 }, this) 5607 }; 5608 k.call(this, b) 5609 } 5610 }); 5611 CKEDITOR.plugins.setLang = function(a, d, b) { 5612 var c = this.get(a); 5613 a = c.langEntries || (c.langEntries = {}); 5614 c = c.lang || (c.lang = []); 5615 c.split && (c = c.split(",")); - 1 == CKEDITOR.tools.indexOf(c, d) && c.push(d); 5616 a[d] = b 5617 }; 5618 CKEDITOR.ui = function(a) { 5619 if (a.ui) return a.ui; 5620 this.items = {}; 5621 this.instances = {}; 5622 this.editor = a; 5623 this._ = { 5624 handlers: {} 5625 }; 5626 return this 5627 }; 5628 CKEDITOR.ui.prototype = { 5629 add: function(a, d, b) { 5630 b.name = a.toLowerCase(); 5631 var c = this.items[a] = { 5632 type: d, 5633 command: b.command || null, 5634 args: Array.prototype.slice.call(arguments, 2) 5635 }; 5636 CKEDITOR.tools.extend(c, b) 5637 }, 5638 get: function(a) { 5639 return this.instances[a] 5640 }, 5641 create: function(a) { 5642 var d = this.items[a], 5643 b = d && this._.handlers[d.type], 5644 c = d && d.command && this.editor.getCommand(d.command), 5645 b = b && b.create.apply(this, d.args); 5646 this.instances[a] = b; 5647 c && c.uiItems.push(b); 5648 b && !b.type && (b.type = d.type); 5649 return b 5650 }, 5651 addHandler: function(a, d) { 5652 this._.handlers[a] = 5653 d 5654 }, 5655 space: function(a) { 5656 return CKEDITOR.document.getById(this.spaceId(a)) 5657 }, 5658 spaceId: function(a) { 5659 return this.editor.id + "_" + a 5660 } 5661 }; 5662 CKEDITOR.event.implementOn(CKEDITOR.ui); 5663 (function() { 5664 function a(a, f, e) { 5665 CKEDITOR.event.call(this); 5666 a = a && CKEDITOR.tools.clone(a); 5667 if (void 0 !== f) { 5668 if (!(f instanceof CKEDITOR.dom.element)) throw Error("Expect element of type CKEDITOR.dom.element."); 5669 if (!e) throw Error("One of the element modes must be specified."); 5670 if (CKEDITOR.env.ie && CKEDITOR.env.quirks && e == CKEDITOR.ELEMENT_MODE_INLINE) throw Error("Inline element mode is not supported on IE quirks."); 5671 if (!b(f, e)) throw Error('The specified element mode is not supported on element: "' + f.getName() + '".'); 5672 this.element = f; 5673 this.elementMode = e; 5674 this.name = this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO && (f.getId() || f.getNameAtt()) 5675 } else this.elementMode = CKEDITOR.ELEMENT_MODE_NONE; 5676 this._ = {}; 5677 this.commands = {}; 5678 this.templates = {}; 5679 this.name = this.name || d(); 5680 this.id = CKEDITOR.tools.getNextId(); 5681 this.status = "unloaded"; 5682 this.config = CKEDITOR.tools.prototypedCopy(CKEDITOR.config); 5683 this.ui = new CKEDITOR.ui(this); 5684 this.focusManager = new CKEDITOR.focusManager(this); 5685 this.keystrokeHandler = new CKEDITOR.keystrokeHandler(this); 5686 this.on("readOnly", 5687 c); 5688 this.on("selectionChange", function(a) { 5689 h(this, a.data.path) 5690 }); 5691 this.on("activeFilterChange", function() { 5692 h(this, this.elementPath(), !0) 5693 }); 5694 this.on("mode", c); 5695 this.on("instanceReady", function() { 5696 if (this.config.startupFocus) { 5697 if ("end" === this.config.startupFocus) { 5698 var a = this.createRange(); 5699 a.selectNodeContents(this.editable()); 5700 a.shrink(CKEDITOR.SHRINK_ELEMENT, !0); 5701 a.collapse(); 5702 this.getSelection().selectRanges([a]) 5703 } 5704 this.focus() 5705 } 5706 }); 5707 CKEDITOR.fire("instanceCreated", null, this); 5708 CKEDITOR.add(this); 5709 CKEDITOR.tools.setTimeout(function() { 5710 "destroyed" !== 5711 this.status ? g(this, a) : CKEDITOR.warn("editor-incorrect-destroy") 5712 }, 0, this) 5713 } 5714 5715 function d() { 5716 do var a = "editor" + ++D; while (CKEDITOR.instances[a]); 5717 return a 5718 } 5719 5720 function b(a, b) { 5721 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 5722 } 5723 5724 function c() { 5725 var a = this.commands, 5726 b; 5727 for (b in a) f(this, a[b]) 5728 } 5729 5730 function f(a, b) { 5731 b[b.startDisabled ? "disable" : a.readOnly && !b.readOnly ? "disable" : b.modes[a.mode] ? "enable" : "disable"]() 5732 } 5733 5734 function h(a, 5735 b, c) { 5736 if (b) { 5737 var d, f, e = a.commands; 5738 for (f in e) d = e[f], (c || d.contextSensitive) && d.refresh(a, b) 5739 } 5740 } 5741 5742 function k(a) { 5743 var b = a.config.customConfig; 5744 if (!b) return !1; 5745 var b = CKEDITOR.getUrl(b), 5746 c = x[b] || (x[b] = {}); 5747 c.fn ? (c.fn.call(a, a.config), CKEDITOR.getUrl(a.config.customConfig) != b && k(a) || a.fireOnce("customConfigLoaded")) : CKEDITOR.scriptLoader.queue(b, function() { 5748 c.fn = CKEDITOR.editorConfig ? CKEDITOR.editorConfig : function() {}; 5749 k(a) 5750 }); 5751 return !0 5752 } 5753 5754 function g(a, b) { 5755 a.on("customConfigLoaded", function() { 5756 if (b) { 5757 if (b.on) 5758 for (var c in b.on) a.on(c, 5759 b.on[c]); 5760 CKEDITOR.tools.extend(a.config, b, !0); 5761 delete a.config.on 5762 } 5763 c = a.config; 5764 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; 5765 a.blockless = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? !(a.element.is("textarea") || CKEDITOR.dtd[a.element.getName()].p) : 5766 !1; 5767 a.tabIndex = c.tabIndex || a.element && a.element.getAttribute("tabindex") || 0; 5768 a.activeEnterMode = a.enterMode = a.blockless ? CKEDITOR.ENTER_BR : c.enterMode; 5769 a.activeShiftEnterMode = a.shiftEnterMode = a.blockless ? CKEDITOR.ENTER_BR : c.shiftEnterMode; 5770 c.skin && (CKEDITOR.skinName = c.skin); 5771 a.fireOnce("configLoaded"); 5772 a.dataProcessor = new CKEDITOR.htmlDataProcessor(a); 5773 a.filter = a.activeFilter = new CKEDITOR.filter(a); 5774 n(a) 5775 }); 5776 b && null != b.customConfig && (a.config.customConfig = b.customConfig); 5777 k(a) || a.fireOnce("customConfigLoaded") 5778 } 5779 5780 function n(a) { 5781 CKEDITOR.skin.loadPart("editor", function() { 5782 r(a) 5783 }) 5784 } 5785 5786 function r(a) { 5787 CKEDITOR.lang.load(a.config.language, a.config.defaultLanguage, function(b, c) { 5788 var d = a.config.title; 5789 a.langCode = b; 5790 a.lang = CKEDITOR.tools.prototypedCopy(c); 5791 a.title = "string" == typeof d || !1 === d ? d : [a.lang.editor, a.name].join(", "); 5792 a.config.contentsLangDirection || (a.config.contentsLangDirection = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.element.getDirection(1) : a.lang.dir); 5793 a.fire("langLoaded"); 5794 e(a) 5795 }) 5796 } 5797 5798 function e(a) { 5799 a.getStylesSet(function(b) { 5800 a.once("loaded", 5801 function() { 5802 a.fire("stylesSet", { 5803 styles: b 5804 }) 5805 }, null, null, 1); 5806 y(a) 5807 }) 5808 } 5809 5810 function y(a) { 5811 function b(a) { 5812 if (!a) return ""; 5813 CKEDITOR.tools.isArray(a) && (a = a.join(",")); 5814 return a.replace(/\s/g, "") 5815 } 5816 var c = a.config, 5817 d = b(c.plugins), 5818 f = b(c.extraPlugins), 5819 e = b(c.removePlugins); 5820 if (f) var h = new RegExp("(?:^|,)(?:" + f.replace(/,/g, "|") + ")(?\x3d,|$)", "g"), 5821 d = d.replace(h, ""), 5822 d = d + ("," + f); 5823 if (e) var g = new RegExp("(?:^|,)(?:" + e.replace(/,/g, "|") + ")(?\x3d,|$)", "g"), 5824 d = d.replace(g, ""); 5825 CKEDITOR.env.air && (d += ",adobeair"); 5826 CKEDITOR.plugins.load(d.split(","), 5827 function(b) { 5828 var d = [], 5829 f = [], 5830 e = []; 5831 a.plugins = CKEDITOR.tools.extend({}, a.plugins, b); 5832 for (var l in b) { 5833 var h = b[l], 5834 t = h.lang, 5835 k = null, 5836 p = h.requires, 5837 F; 5838 CKEDITOR.tools.isArray(p) && (p = p.join(",")); 5839 if (p && (F = p.match(g))) 5840 for (; p = F.pop();) CKEDITOR.error("editor-plugin-required", { 5841 plugin: p.replace(",", ""), 5842 requiredBy: l 5843 }); 5844 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, 5845 "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"))); 5846 f.push(k); 5847 d.push(h) 5848 } 5849 CKEDITOR.scriptLoader.load(e, function() { 5850 for (var b = ["beforeInit", "init", "afterInit"], e = 0; e < b.length; e++) 5851 for (var l = 0; l < d.length; l++) { 5852 var p = d[l]; 5853 0 === e && f[l] && p.lang && p.langEntries && (a.lang[p.name] = p.langEntries[f[l]]); 5854 if (p[b[e]]) p[b[e]](a) 5855 } 5856 a.fireOnce("pluginsLoaded"); 5857 c.keystrokes && a.setKeystroke(a.config.keystrokes); 5858 for (l = 0; l < a.config.blockedKeystrokes.length; l++) a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[l]] = 5859 1; 5860 a.status = "loaded"; 5861 a.fireOnce("loaded"); 5862 CKEDITOR.fire("instanceLoaded", null, a) 5863 }) 5864 }) 5865 } 5866 5867 function v() { 5868 var a = this.element; 5869 if (a && this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO) { 5870 var b = this.getData(); 5871 this.config.htmlEncodeOutput && (b = CKEDITOR.tools.htmlEncode(b)); 5872 a.is("textarea") ? a.setValue(b) : a.setHtml(b); 5873 return !0 5874 } 5875 return !1 5876 } 5877 5878 function B(a, b) { 5879 function c(a) { 5880 var b = a.startContainer, 5881 d = a.endContainer; 5882 return b.is && (b.is("tr") || b.is("td") && b.equals(d) && a.endOffset === b.getChildCount()) ? !0 : !1 5883 } 5884 5885 function d(a) { 5886 var b = a.startContainer; 5887 return b.is("tr") ? a.cloneContents() : b.clone(!0) 5888 } 5889 for (var f = new CKEDITOR.dom.documentFragment, e, h, g, k = 0; k < a.length; k++) { 5890 var M = a[k], 5891 q = M.startContainer.getAscendant("tr", !0); 5892 c(M) ? (e || (e = q.getAscendant("table").clone(), e.append(q.getAscendant({ 5893 thead: 1, 5894 tbody: 1, 5895 tfoot: 1 5896 }).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()) 5897 } 5898 return e ? f : b.getHtmlFromRange(a[0]) 5899 } 5900 a.prototype = CKEDITOR.editor.prototype; 5901 CKEDITOR.editor = 5902 a; 5903 var D = 0, 5904 x = {}; 5905 CKEDITOR.tools.extend(CKEDITOR.editor.prototype, { 5906 plugins: { 5907 detectConflict: function(a, b) { 5908 for (var c = 0; c < b.length; c++) { 5909 var d = b[c]; 5910 if (this[d]) return CKEDITOR.warn("editor-plugin-conflict", { 5911 plugin: a, 5912 replacedWith: d 5913 }), !0 5914 } 5915 return !1 5916 } 5917 }, 5918 addCommand: function(a, b) { 5919 b.name = a.toLowerCase(); 5920 var c = b instanceof CKEDITOR.command ? b : new CKEDITOR.command(this, b); 5921 this.mode && f(this, c); 5922 return this.commands[a] = c 5923 }, 5924 _attachToForm: function() { 5925 function a(b) { 5926 c.updateElement(); 5927 c._.required && !d.getValue() && !1 === c.fire("required") && 5928 b.data.preventDefault() 5929 } 5930 5931 function b(a) { 5932 return !!(a && a.call && a.apply) 5933 } 5934 var c = this, 5935 d = c.element, 5936 f = new CKEDITOR.dom.element(d.$.form); 5937 d.is("textarea") && f && (f.on("submit", a), b(f.$.submit) && (f.$.submit = CKEDITOR.tools.override(f.$.submit, function(b) { 5938 return function() { 5939 a(); 5940 b.apply ? b.apply(this) : b() 5941 } 5942 })), c.on("destroy", function() { 5943 f.removeListener("submit", a) 5944 })) 5945 }, 5946 destroy: function(a) { 5947 this.fire("beforeDestroy"); 5948 !a && v.call(this); 5949 this.editable(null); 5950 this.filter && (this.filter.destroy(), delete this.filter); 5951 delete this.activeFilter; 5952 this.status = "destroyed"; 5953 this.fire("destroy"); 5954 this.removeAllListeners(); 5955 CKEDITOR.remove(this); 5956 CKEDITOR.fire("instanceDestroyed", null, this) 5957 }, 5958 elementPath: function(a) { 5959 if (!a) { 5960 a = this.getSelection(); 5961 if (!a) return null; 5962 a = a.getStartElement() 5963 } 5964 return a ? new CKEDITOR.dom.elementPath(a, this.editable()) : null 5965 }, 5966 createRange: function() { 5967 var a = this.editable(); 5968 return a ? new CKEDITOR.dom.range(a) : null 5969 }, 5970 execCommand: function(a, b) { 5971 var c = this.getCommand(a), 5972 d = { 5973 name: a, 5974 commandData: b || {}, 5975 command: c 5976 }; 5977 return c && c.state != CKEDITOR.TRISTATE_DISABLED && 5978 !1 !== this.fire("beforeCommandExec", d) && (d.returnValue = c.exec(d.commandData), !c.async && !1 !== this.fire("afterCommandExec", d)) ? d.returnValue : !1 5979 }, 5980 getCommand: function(a) { 5981 return this.commands[a] 5982 }, 5983 getData: function(a) { 5984 !a && this.fire("beforeGetData"); 5985 var b = this._.data; 5986 "string" != typeof b && (b = (b = this.element) && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? b.is("textarea") ? b.getValue() : b.getHtml() : ""); 5987 b = { 5988 dataValue: b 5989 }; 5990 !a && this.fire("getData", b); 5991 return b.dataValue 5992 }, 5993 getSnapshot: function() { 5994 var a = this.fire("getSnapshot"); 5995 "string" != typeof a && (a = (a = this.element) && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? a.is("textarea") ? a.getValue() : a.getHtml() : ""); 5996 return a 5997 }, 5998 loadSnapshot: function(a) { 5999 this.fire("loadSnapshot", a) 6000 }, 6001 setData: function(a, b, c) { 6002 var d = !0, 6003 f = b; 6004 b && "object" == typeof b && (c = b.internal, f = b.callback, d = !b.noSnapshot); 6005 !c && d && this.fire("saveSnapshot"); 6006 if (f || !c) this.once("dataReady", function(a) { 6007 !c && d && this.fire("saveSnapshot"); 6008 f && f.call(a.editor) 6009 }); 6010 a = { 6011 dataValue: a 6012 }; 6013 !c && this.fire("setData", a); 6014 this._.data = a.dataValue; 6015 !c && this.fire("afterSetData", a) 6016 }, 6017 setReadOnly: function(a) { 6018 a = null == a || a; 6019 this.readOnly != a && (this.readOnly = a, this.keystrokeHandler.blockedKeystrokes[8] = +a, this.editable().setReadOnly(a), this.fire("readOnly")) 6020 }, 6021 insertHtml: function(a, b, c) { 6022 this.fire("insertHtml", { 6023 dataValue: a, 6024 mode: b, 6025 range: c 6026 }) 6027 }, 6028 insertText: function(a) { 6029 this.fire("insertText", a) 6030 }, 6031 insertElement: function(a) { 6032 this.fire("insertElement", a) 6033 }, 6034 getSelectedHtml: function(a) { 6035 var b = this.editable(), 6036 c = this.getSelection(), 6037 c = c && c.getRanges(); 6038 if (!b || !c || 0 === c.length) return null; 6039 b = B(c, b); 6040 return a ? b.getHtml() : b 6041 }, 6042 extractSelectedHtml: function(a, b) { 6043 var c = this.editable(), 6044 d = this.getSelection().getRanges(), 6045 f = new CKEDITOR.dom.documentFragment, 6046 e; 6047 if (!c || 0 === d.length) return null; 6048 for (e = 0; e < d.length; e++) f.append(c.extractHtmlFromRange(d[e], b)); 6049 b || this.getSelection().selectRanges([d[0]]); 6050 return a ? f.getHtml() : f 6051 }, 6052 focus: function() { 6053 this.fire("beforeFocus") 6054 }, 6055 checkDirty: function() { 6056 return "ready" == this.status && this._.previousValue !== this.getSnapshot() 6057 }, 6058 resetDirty: function() { 6059 this._.previousValue = 6060 this.getSnapshot() 6061 }, 6062 updateElement: function() { 6063 return v.call(this) 6064 }, 6065 setKeystroke: function() { 6066 for (var a = this.keystrokeHandler.keystrokes, b = CKEDITOR.tools.isArray(arguments[0]) ? arguments[0] : [ 6067 [].slice.call(arguments, 0) 6068 ], 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] 6069 }, 6070 getCommandKeystroke: function(a) { 6071 if (a = "string" === typeof a ? this.getCommand(a) : a) { 6072 var b = CKEDITOR.tools.object.findKey(this.commands, a), 6073 c = this.keystrokeHandler.keystrokes, 6074 d; 6075 if (a.fakeKeystroke) return a.fakeKeystroke; 6076 for (d in c) 6077 if (c.hasOwnProperty(d) && c[d] == b) return d 6078 } 6079 return null 6080 }, 6081 addFeature: function(a) { 6082 return this.filter.addFeature(a) 6083 }, 6084 setActiveFilter: function(a) { 6085 a || (a = this.filter); 6086 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))) 6087 }, 6088 setActiveEnterMode: function(a, b) { 6089 a = a ? this.blockless ? CKEDITOR.ENTER_BR : a : this.enterMode; 6090 b = b ? this.blockless ? 6091 CKEDITOR.ENTER_BR : b : this.shiftEnterMode; 6092 if (this.activeEnterMode != a || this.activeShiftEnterMode != b) this.activeEnterMode = a, this.activeShiftEnterMode = b, this.fire("activeEnterModeChange") 6093 }, 6094 showNotification: function(a) { 6095 alert(a) 6096 } 6097 }) 6098 })(); 6099 CKEDITOR.ELEMENT_MODE_NONE = 0; 6100 CKEDITOR.ELEMENT_MODE_REPLACE = 1; 6101 CKEDITOR.ELEMENT_MODE_APPENDTO = 2; 6102 CKEDITOR.ELEMENT_MODE_INLINE = 3; 6103 CKEDITOR.htmlParser = function() { 6104 this._ = { 6105 htmlPartsRegex: /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\x3e)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g 6106 } 6107 }; 6108 (function() { 6109 var a = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g, 6110 d = { 6111 checked: 1, 6112 compact: 1, 6113 declare: 1, 6114 defer: 1, 6115 disabled: 1, 6116 ismap: 1, 6117 multiple: 1, 6118 nohref: 1, 6119 noresize: 1, 6120 noshade: 1, 6121 nowrap: 1, 6122 readonly: 1, 6123 selected: 1 6124 }; 6125 CKEDITOR.htmlParser.prototype = { 6126 onTagOpen: function() {}, 6127 onTagClose: function() {}, 6128 onText: function() {}, 6129 onCDATA: function() {}, 6130 onComment: function() {}, 6131 parse: function(b) { 6132 for (var c, f, h = 0, k; c = this._.htmlPartsRegex.exec(b);) { 6133 f = c.index; 6134 if (f > h) 6135 if (h = b.substring(h, f), k) k.push(h); 6136 else this.onText(h); 6137 h = this._.htmlPartsRegex.lastIndex; 6138 if (f = c[1]) 6139 if (f = f.toLowerCase(), k && CKEDITOR.dtd.$cdata[f] && (this.onCDATA(k.join("")), k = null), !k) { 6140 this.onTagClose(f); 6141 continue 6142 } if (k) k.push(c[0]); 6143 else if (f = c[3]) { 6144 if (f = f.toLowerCase(), !/="/.test(f)) { 6145 var g = {}, 6146 n, r = c[4]; 6147 c = !!c[5]; 6148 if (r) 6149 for (; n = a.exec(r);) { 6150 var e = n[1].toLowerCase(); 6151 n = n[2] || n[3] || n[4] || ""; 6152 g[e] = !n && d[e] ? e : CKEDITOR.tools.htmlDecodeAttr(n) 6153 } 6154 this.onTagOpen(f, g, c); 6155 !k && CKEDITOR.dtd.$cdata[f] && (k = []) 6156 } 6157 } else if (f = c[2]) this.onComment(f) 6158 } 6159 if (b.length > h) this.onText(b.substring(h, 6160 b.length)) 6161 } 6162 } 6163 })(); 6164 CKEDITOR.htmlParser.basicWriter = CKEDITOR.tools.createClass({ 6165 $: function() { 6166 this._ = { 6167 output: [] 6168 } 6169 }, 6170 proto: { 6171 openTag: function(a) { 6172 this._.output.push("\x3c", a) 6173 }, 6174 openTagClose: function(a, d) { 6175 d ? this._.output.push(" /\x3e") : this._.output.push("\x3e") 6176 }, 6177 attribute: function(a, d) { 6178 "string" == typeof d && (d = CKEDITOR.tools.htmlEncodeAttr(d)); 6179 this._.output.push(" ", a, '\x3d"', d, '"') 6180 }, 6181 closeTag: function(a) { 6182 this._.output.push("\x3c/", a, "\x3e") 6183 }, 6184 text: function(a) { 6185 this._.output.push(a) 6186 }, 6187 comment: function(a) { 6188 this._.output.push("\x3c!--", a, 6189 "--\x3e") 6190 }, 6191 write: function(a) { 6192 this._.output.push(a) 6193 }, 6194 reset: function() { 6195 this._.output = []; 6196 this._.indent = !1 6197 }, 6198 getHtml: function(a) { 6199 var d = this._.output.join(""); 6200 a && this.reset(); 6201 return d 6202 } 6203 } 6204 }); 6205 "use strict"; 6206 (function() { 6207 CKEDITOR.htmlParser.node = function() {}; 6208 CKEDITOR.htmlParser.node.prototype = { 6209 remove: function() { 6210 var a = this.parent.children, 6211 d = CKEDITOR.tools.indexOf(a, this), 6212 b = this.previous, 6213 c = this.next; 6214 b && (b.next = c); 6215 c && (c.previous = b); 6216 a.splice(d, 1); 6217 this.parent = null 6218 }, 6219 replaceWith: function(a) { 6220 var d = this.parent.children, 6221 b = CKEDITOR.tools.indexOf(d, this), 6222 c = a.previous = this.previous, 6223 f = a.next = this.next; 6224 c && (c.next = a); 6225 f && (f.previous = a); 6226 d[b] = a; 6227 a.parent = this.parent; 6228 this.parent = null 6229 }, 6230 insertAfter: function(a) { 6231 var d = a.parent.children, 6232 b = CKEDITOR.tools.indexOf(d, a), 6233 c = a.next; 6234 d.splice(b + 1, 0, this); 6235 this.next = a.next; 6236 this.previous = a; 6237 a.next = this; 6238 c && (c.previous = this); 6239 this.parent = a.parent 6240 }, 6241 insertBefore: function(a) { 6242 var d = a.parent.children, 6243 b = CKEDITOR.tools.indexOf(d, a); 6244 d.splice(b, 0, this); 6245 this.next = a; 6246 (this.previous = a.previous) && (a.previous.next = this); 6247 a.previous = this; 6248 this.parent = a.parent 6249 }, 6250 getAscendant: function(a) { 6251 var d = "function" == typeof a ? a : "string" == typeof a ? function(b) { 6252 return b.name == a 6253 } : function(b) { 6254 return b.name in a 6255 }, 6256 b = this.parent; 6257 for (; b && 6258 b.type == CKEDITOR.NODE_ELEMENT;) { 6259 if (d(b)) return b; 6260 b = b.parent 6261 } 6262 return null 6263 }, 6264 wrapWith: function(a) { 6265 this.replaceWith(a); 6266 a.add(this); 6267 return a 6268 }, 6269 getIndex: function() { 6270 return CKEDITOR.tools.indexOf(this.parent.children, this) 6271 }, 6272 getFilterContext: function(a) { 6273 return a || {} 6274 } 6275 } 6276 })(); 6277 "use strict"; 6278 CKEDITOR.htmlParser.comment = function(a) { 6279 this.value = a; 6280 this._ = { 6281 isBlockLike: !1 6282 } 6283 }; 6284 CKEDITOR.htmlParser.comment.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, { 6285 type: CKEDITOR.NODE_COMMENT, 6286 filter: function(a, d) { 6287 var b = this.value; 6288 if (!(b = a.onComment(d, b, this))) return this.remove(), !1; 6289 if ("string" != typeof b) return this.replaceWith(b), !1; 6290 this.value = b; 6291 return !0 6292 }, 6293 writeHtml: function(a, d) { 6294 d && this.filter(d); 6295 a.comment(this.value) 6296 } 6297 }); 6298 "use strict"; 6299 (function() { 6300 CKEDITOR.htmlParser.text = function(a) { 6301 this.value = a; 6302 this._ = { 6303 isBlockLike: !1 6304 } 6305 }; 6306 CKEDITOR.htmlParser.text.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, { 6307 type: CKEDITOR.NODE_TEXT, 6308 filter: function(a, d) { 6309 if (!(this.value = a.onText(d, this.value, this))) return this.remove(), !1 6310 }, 6311 writeHtml: function(a, d) { 6312 d && this.filter(d); 6313 a.text(this.value) 6314 } 6315 }) 6316 })(); 6317 "use strict"; 6318 (function() { 6319 CKEDITOR.htmlParser.cdata = function(a) { 6320 this.value = a 6321 }; 6322 CKEDITOR.htmlParser.cdata.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, { 6323 type: CKEDITOR.NODE_TEXT, 6324 filter: function() {}, 6325 writeHtml: function(a) { 6326 a.write(this.value) 6327 } 6328 }) 6329 })(); 6330 "use strict"; 6331 CKEDITOR.htmlParser.fragment = function() { 6332 this.children = []; 6333 this.parent = null; 6334 this._ = { 6335 isBlockLike: !0, 6336 hasInlineStarted: !1 6337 } 6338 }; 6339 (function() { 6340 function a(a) { 6341 return a.attributes["data-cke-survive"] ? !1 : "a" == a.name && a.attributes.href || CKEDITOR.dtd.$removeEmpty[a.name] 6342 } 6343 var d = CKEDITOR.tools.extend({ 6344 table: 1, 6345 ul: 1, 6346 ol: 1, 6347 dl: 1 6348 }, CKEDITOR.dtd.table, CKEDITOR.dtd.ul, CKEDITOR.dtd.ol, CKEDITOR.dtd.dl), 6349 b = { 6350 ol: 1, 6351 ul: 1 6352 }, 6353 c = CKEDITOR.tools.extend({}, { 6354 html: 1 6355 }, CKEDITOR.dtd.html, CKEDITOR.dtd.body, CKEDITOR.dtd.head, { 6356 style: 1, 6357 script: 1 6358 }), 6359 f = { 6360 ul: "li", 6361 ol: "li", 6362 dl: "dd", 6363 table: "tbody", 6364 tbody: "tr", 6365 thead: "tr", 6366 tfoot: "tr", 6367 tr: "td" 6368 }; 6369 CKEDITOR.htmlParser.fragment.fromHtml = 6370 function(h, k, g) { 6371 function n(a) { 6372 var b; 6373 if (0 < m.length) 6374 for (var c = 0; c < m.length; c++) { 6375 var d = m[c], 6376 f = d.name, 6377 e = CKEDITOR.dtd[f], 6378 l = u.name && CKEDITOR.dtd[u.name]; 6379 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--) 6380 } 6381 } 6382 6383 function r() { 6384 for (; J.length;) y(J.shift(), u) 6385 } 6386 6387 function e(a) { 6388 if (a._.isBlockLike && "pre" != a.name && "textarea" != a.name) { 6389 var b = a.children.length, 6390 c = a.children[b - 1], 6391 d; 6392 c && c.type == CKEDITOR.NODE_TEXT && ((d = CKEDITOR.tools.rtrim(c.value)) ? 6393 c.value = d : a.children.length = b - 1) 6394 } 6395 } 6396 6397 function y(b, c, d) { 6398 c = c || u || x; 6399 var f = u; 6400 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)); 6401 b.returnPoint ? (u = b.returnPoint, delete b.returnPoint) : u = d ? c : f 6402 } 6403 6404 function v(a, b) { 6405 if ((a == x || "body" == a.name) && g && (!a.name || CKEDITOR.dtd[a.name][g])) { 6406 var c, d; 6407 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) && 6408 !b.isOrphan || b.type == CKEDITOR.NODE_TEXT 6409 } 6410 } 6411 6412 function B(a, b) { 6413 return a in CKEDITOR.dtd.$listItem || a in CKEDITOR.dtd.$tableContent ? a == b || "dt" == a && "dd" == b || "dd" == a && "dt" == b : !1 6414 } 6415 var D = new CKEDITOR.htmlParser, 6416 x = k instanceof CKEDITOR.htmlParser.element ? k : "string" == typeof k ? new CKEDITOR.htmlParser.element(k) : new CKEDITOR.htmlParser.fragment, 6417 m = [], 6418 J = [], 6419 u = x, 6420 K = "textarea" == x.name, 6421 l = "pre" == x.name; 6422 D.onTagOpen = function(f, e, h, g) { 6423 e = new CKEDITOR.htmlParser.element(f, e); 6424 e.isUnknown && h && (e.isEmpty = !0); 6425 e.isOptionalClose = g; 6426 if (a(e)) m.push(e); 6427 else { 6428 if ("pre" == f) l = !0; 6429 else { 6430 if ("br" == f && l) { 6431 u.add(new CKEDITOR.htmlParser.text("\n")); 6432 return 6433 } 6434 "textarea" == f && (K = !0) 6435 } 6436 if ("br" == f) J.push(e); 6437 else { 6438 for (; !(g = (h = u.name) ? CKEDITOR.dtd[h] || (u._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) : c, e.isUnknown || u.isUnknown || g[f]);) 6439 if (u.isOptionalClose) D.onTagClose(h); 6440 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; 6441 else if (f in CKEDITOR.dtd.$listItem && 6442 !B(f, h)) D.onTagOpen("li" == f ? "ul" : "dl", {}, 0, 1); 6443 else if (h in d && !B(f, h)) !e.returnPoint && (e.returnPoint = u), u = u.parent; 6444 else if (h in CKEDITOR.dtd.$inline && m.unshift(u), u.parent) y(u, u.parent, 1); 6445 else { 6446 e.isOrphan = 1; 6447 break 6448 } 6449 n(f); 6450 r(); 6451 e.parent = u; 6452 e.isEmpty ? y(e) : u = e 6453 } 6454 } 6455 }; 6456 D.onTagClose = function(a) { 6457 for (var b = m.length - 1; 0 <= b; b--) 6458 if (a == m[b].name) { 6459 m.splice(b, 1); 6460 return 6461 } for (var c = [], d = [], f = u; f != x && f.name != a;) f._.isBlockLike || d.unshift(f), c.push(f), f = f.returnPoint || f.parent; 6462 if (f != x) { 6463 for (b = 0; b < c.length; b++) { 6464 var e = c[b]; 6465 y(e, e.parent) 6466 } 6467 u = 6468 f; 6469 f._.isBlockLike && r(); 6470 y(f, f.parent); 6471 f == u && (u = u.parent); 6472 m = m.concat(d) 6473 } 6474 "body" == a && (g = !1) 6475 }; 6476 D.onText = function(a) { 6477 if (!(u._.hasInlineStarted && !J.length || l || K) && (a = CKEDITOR.tools.ltrim(a), 0 === a.length)) return; 6478 var b = u.name, 6479 e = b ? CKEDITOR.dtd[b] || (u._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) : c; 6480 if (!K && !e["#"] && b in d) D.onTagOpen(f[b] || ""), D.onText(a); 6481 else { 6482 r(); 6483 n(); 6484 l || K || (a = a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g, " ")); 6485 a = new CKEDITOR.htmlParser.text(a); 6486 if (v(u, a)) this.onTagOpen(g, {}, 0, 1); 6487 u.add(a) 6488 } 6489 }; 6490 D.onCDATA = 6491 function(a) { 6492 u.add(new CKEDITOR.htmlParser.cdata(a)) 6493 }; 6494 D.onComment = function(a) { 6495 r(); 6496 n(); 6497 u.add(new CKEDITOR.htmlParser.comment(a)) 6498 }; 6499 D.parse(h); 6500 for (r(); u != x;) y(u, u.parent, 1); 6501 e(x); 6502 return x 6503 }; 6504 CKEDITOR.htmlParser.fragment.prototype = { 6505 type: CKEDITOR.NODE_DOCUMENT_FRAGMENT, 6506 add: function(a, b) { 6507 isNaN(b) && (b = this.children.length); 6508 var c = 0 < b ? this.children[b - 1] : null; 6509 if (c) { 6510 if (a._.isBlockLike && c.type == CKEDITOR.NODE_TEXT && (c.value = CKEDITOR.tools.rtrim(c.value), 0 === c.value.length)) { 6511 this.children.pop(); 6512 this.add(a); 6513 return 6514 } 6515 c.next = 6516 a 6517 } 6518 a.previous = c; 6519 a.parent = this; 6520 this.children.splice(b, 0, a); 6521 this._.hasInlineStarted || (this._.hasInlineStarted = a.type == CKEDITOR.NODE_TEXT || a.type == CKEDITOR.NODE_ELEMENT && !a._.isBlockLike) 6522 }, 6523 filter: function(a, b) { 6524 b = this.getFilterContext(b); 6525 a.onRoot(b, this); 6526 this.filterChildren(a, !1, b) 6527 }, 6528 filterChildren: function(a, b, c) { 6529 if (this.childrenFilteredBy != a.id) { 6530 c = this.getFilterContext(c); 6531 if (b && !this.parent) a.onRoot(c, this); 6532 this.childrenFilteredBy = a.id; 6533 for (b = 0; b < this.children.length; b++) !1 === this.children[b].filter(a, 6534 c) && b-- 6535 } 6536 }, 6537 writeHtml: function(a, b) { 6538 b && this.filter(b); 6539 this.writeChildrenHtml(a) 6540 }, 6541 writeChildrenHtml: function(a, b, c) { 6542 var d = this.getFilterContext(); 6543 if (c && !this.parent && b) b.onRoot(d, this); 6544 b && this.filterChildren(b, !1, d); 6545 b = 0; 6546 c = this.children; 6547 for (d = c.length; b < d; b++) c[b].writeHtml(a) 6548 }, 6549 forEach: function(a, b, c) { 6550 if (!(c || b && this.type != b)) var d = a(this); 6551 if (!1 !== d) { 6552 c = this.children; 6553 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) 6554 } 6555 }, 6556 getFilterContext: function(a) { 6557 return a || {} 6558 } 6559 } 6560 })(); 6561 "use strict"; 6562 (function() { 6563 function a() { 6564 this.rules = [] 6565 } 6566 6567 function d(b, c, d, h) { 6568 var k, g; 6569 for (k in c)(g = b[k]) || (g = b[k] = new a), g.add(c[k], d, h) 6570 } 6571 CKEDITOR.htmlParser.filter = CKEDITOR.tools.createClass({ 6572 $: function(b) { 6573 this.id = CKEDITOR.tools.getNextNumber(); 6574 this.elementNameRules = new a; 6575 this.attributeNameRules = new a; 6576 this.elementsRules = {}; 6577 this.attributesRules = {}; 6578 this.textRules = new a; 6579 this.commentRules = new a; 6580 this.rootRules = new a; 6581 b && this.addRules(b, 10) 6582 }, 6583 proto: { 6584 addRules: function(a, c) { 6585 var f; 6586 "number" == typeof c ? f = c : c && "priority" in c && (f = 6587 c.priority); 6588 "number" != typeof f && (f = 10); 6589 "object" != typeof c && (c = {}); 6590 a.elementNames && this.elementNameRules.addMany(a.elementNames, f, c); 6591 a.attributeNames && this.attributeNameRules.addMany(a.attributeNames, f, c); 6592 a.elements && d(this.elementsRules, a.elements, f, c); 6593 a.attributes && d(this.attributesRules, a.attributes, f, c); 6594 a.text && this.textRules.add(a.text, f, c); 6595 a.comment && this.commentRules.add(a.comment, f, c); 6596 a.root && this.rootRules.add(a.root, f, c) 6597 }, 6598 applyTo: function(a) { 6599 a.filter(this) 6600 }, 6601 onElementName: function(a, c) { 6602 return this.elementNameRules.execOnName(a, 6603 c) 6604 }, 6605 onAttributeName: function(a, c) { 6606 return this.attributeNameRules.execOnName(a, c) 6607 }, 6608 onText: function(a, c, d) { 6609 return this.textRules.exec(a, c, d) 6610 }, 6611 onComment: function(a, c, d) { 6612 return this.commentRules.exec(a, c, d) 6613 }, 6614 onRoot: function(a, c) { 6615 return this.rootRules.exec(a, c) 6616 }, 6617 onElement: function(a, c) { 6618 for (var d = [this.elementsRules["^"], this.elementsRules[c.name], this.elementsRules.$], h, k = 0; 3 > k; k++) 6619 if (h = d[k]) { 6620 h = h.exec(a, c, this); 6621 if (!1 === h) return null; 6622 if (h && h != c) return this.onNode(a, h); 6623 if (c.parent && !c.name) break 6624 } return c 6625 }, 6626 onNode: function(a, c) { 6627 var d = c.type; 6628 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 6629 }, 6630 onAttribute: function(a, c, d, h) { 6631 return (d = this.attributesRules[d]) ? d.exec(a, h, c, this) : h 6632 } 6633 } 6634 }); 6635 CKEDITOR.htmlParser.filterRulesGroup = a; 6636 a.prototype = { 6637 add: function(a, c, d) { 6638 this.rules.splice(this.findIndex(c), 0, { 6639 value: a, 6640 priority: c, 6641 options: d 6642 }) 6643 }, 6644 addMany: function(a, 6645 c, d) { 6646 for (var h = [this.findIndex(c), 0], k = 0, g = a.length; k < g; k++) h.push({ 6647 value: a[k], 6648 priority: c, 6649 options: d 6650 }); 6651 this.rules.splice.apply(this.rules, h) 6652 }, 6653 findIndex: function(a) { 6654 for (var c = this.rules, d = c.length - 1; 0 <= d && a < c[d].priority;) d--; 6655 return d + 1 6656 }, 6657 exec: function(a, c) { 6658 var d = c instanceof CKEDITOR.htmlParser.node || c instanceof CKEDITOR.htmlParser.fragment, 6659 h = Array.prototype.slice.call(arguments, 1), 6660 k = this.rules, 6661 g = k.length, 6662 n, r, e, y; 6663 for (y = 0; y < g; y++) 6664 if (d && (n = c.type, r = c.name), e = k[y], !(a.nonEditable && !e.options.applyToAll || 6665 a.nestedEditable && e.options.excludeNestedEditable)) { 6666 e = e.value.apply(null, h); 6667 if (!1 === e || d && e && (e.name != r || e.type != n)) return e; 6668 null != e && (h[0] = c = e) 6669 } return c 6670 }, 6671 execOnName: function(a, c) { 6672 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])); 6673 return c 6674 } 6675 } 6676 })(); 6677 (function() { 6678 function a(a, d) { 6679 function e(a) { 6680 return a || CKEDITOR.env.needsNbspFiller ? new CKEDITOR.htmlParser.text(" ") : new CKEDITOR.htmlParser.element("br", { 6681 "data-cke-bogus": 1 6682 }) 6683 } 6684 6685 function p(a, d) { 6686 return function(f) { 6687 if (f.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) { 6688 var l = [], 6689 w = b(f), 6690 p, E; 6691 if (w) 6692 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; 6693 for (w = 0; w < l.length; w++) l[w].remove(); 6694 if (l = !a || !1 !== ("function" == typeof d ? d(f) : d)) z || CKEDITOR.env.needsBrFiller || 6695 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; 6696 l && f.add(e(a)) 6697 } 6698 } 6699 } 6700 6701 function q(a, b) { 6702 if ((!z || CKEDITOR.env.needsBrFiller) && a.type == CKEDITOR.NODE_ELEMENT && "br" == a.name && !a.attributes["data-cke-eol"]) return !0; 6703 var c; 6704 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), 6705 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 6706 } 6707 var E = { 6708 elements: {} 6709 }, 6710 z = "html" == d, 6711 g = CKEDITOR.tools.extend({}, l), 6712 t; 6713 for (t in g) "#" in u[t] || delete g[t]; 6714 for (t in g) E.elements[t] = p(z, a.config.fillEmptyBlocks); 6715 E.root = p(z, !1); 6716 E.elements.br = function(a) { 6717 return function(b) { 6718 if (b.parent.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) { 6719 var d = b.attributes; 6720 if ("data-cke-bogus" in d || "data-cke-eol" in d) delete d["data-cke-bogus"]; 6721 else { 6722 for (d = b.next; d && f(d);) d = 6723 d.next; 6724 var l = c(b); 6725 !d && h(b.parent) ? k(b.parent, e(a)) : h(d) && l && !h(l) && e(a).insertBefore(d) 6726 } 6727 } 6728 } 6729 }(z); 6730 return E 6731 } 6732 6733 function d(a, b) { 6734 return a != CKEDITOR.ENTER_BR && !1 !== b ? a == CKEDITOR.ENTER_DIV ? "div" : "p" : !1 6735 } 6736 6737 function b(a) { 6738 for (a = a.children[a.children.length - 1]; a && f(a);) a = a.previous; 6739 return a 6740 } 6741 6742 function c(a) { 6743 for (a = a.previous; a && f(a);) a = a.previous; 6744 return a 6745 } 6746 6747 function f(a) { 6748 return a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(a.value) || a.type == CKEDITOR.NODE_ELEMENT && a.attributes["data-cke-bookmark"] 6749 } 6750 6751 function h(a) { 6752 return a && 6753 (a.type == CKEDITOR.NODE_ELEMENT && a.name in l || a.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT) 6754 } 6755 6756 function k(a, b) { 6757 var c = a.children[a.children.length - 1]; 6758 a.children.push(b); 6759 b.parent = a; 6760 c && (c.next = b, b.previous = c) 6761 } 6762 6763 function g(a) { 6764 a = a.attributes; 6765 "false" != a.contenteditable && (a["data-cke-editable"] = a.contenteditable ? "true" : 1); 6766 a.contenteditable = "false" 6767 } 6768 6769 function n(a) { 6770 a = a.attributes; 6771 switch (a["data-cke-editable"]) { 6772 case "true": 6773 a.contenteditable = "true"; 6774 break; 6775 case "1": 6776 delete a.contenteditable 6777 } 6778 } 6779 6780 function r(a) { 6781 return a.replace(M, 6782 function(a, b, c) { 6783 return "\x3c" + b + c.replace(q, function(a, b) { 6784 return E.test(b) && -1 == c.indexOf("data-cke-saved-" + b) ? " data-cke-saved-" + a + " data-cke-" + CKEDITOR.rnd + "-" + a : a 6785 }) + "\x3e" 6786 }) 6787 } 6788 6789 function e(a, b) { 6790 return a.replace(b, function(a, b, c) { 6791 0 === a.indexOf("\x3ctextarea") && (a = b + B(c).replace(/</g, "\x26lt;").replace(/>/g, "\x26gt;") + "\x3c/textarea\x3e"); 6792 return "\x3ccke:encoded\x3e" + encodeURIComponent(a) + "\x3c/cke:encoded\x3e" 6793 }) 6794 } 6795 6796 function y(a) { 6797 return a.replace(P, function(a, b) { 6798 return decodeURIComponent(b) 6799 }) 6800 } 6801 6802 function v(a) { 6803 return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g, 6804 function(a) { 6805 return "\x3c!--" + J + "{C}" + encodeURIComponent(a).replace(/--/g, "%2D%2D") + "--\x3e" 6806 }) 6807 } 6808 6809 function B(a) { 6810 return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g, function(a, b) { 6811 return decodeURIComponent(b) 6812 }) 6813 } 6814 6815 function D(a, b) { 6816 var c = b._.dataStore; 6817 return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g, function(a, b) { 6818 return decodeURIComponent(b) 6819 }).replace(/\{cke_protected_(\d+)\}/g, function(a, b) { 6820 return c && c[b] || "" 6821 }) 6822 } 6823 6824 function x(a, b) { 6825 var c = [], 6826 d = b.config.protectedSource, 6827 f = b._.dataStore || (b._.dataStore = { 6828 id: 1 6829 }), 6830 e = /<\!--\{cke_temp(comment)?\}(\d*?)--\x3e/g, 6831 d = [/<script[\s\S]*?(<\/script>|$)/gi, /<noscript[\s\S]*?<\/noscript>/gi, /<meta[\s\S]*?\/?>/gi].concat(d); 6832 a = a.replace(/\x3c!--[\s\S]*?--\x3e/g, function(a) { 6833 return "\x3c!--{cke_tempcomment}" + (c.push(a) - 1) + "--\x3e" 6834 }); 6835 for (var l = 0; l < d.length; l++) a = a.replace(d[l], function(a) { 6836 a = a.replace(e, function(a, b, d) { 6837 return c[d] 6838 }); 6839 return /cke_temp(comment)?/.test(a) ? a : "\x3c!--{cke_temp}" + (c.push(a) - 1) + "--\x3e" 6840 }); 6841 a = a.replace(e, function(a, b, d) { 6842 return "\x3c!--" + J + (b ? "{C}" : 6843 "") + encodeURIComponent(c[d]).replace(/--/g, "%2D%2D") + "--\x3e" 6844 }); 6845 a = a.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g, function(a) { 6846 return a.replace(/\x3c!--\{cke_protected\}([^>]*)--\x3e/g, function(a, b) { 6847 f[f.id] = decodeURIComponent(b); 6848 return "{cke_protected_" + f.id++ + "}" 6849 }) 6850 }); 6851 return a = a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g, function(a, c, d, f) { 6852 return "\x3c" + c + d + "\x3e" + D(B(f), b) + "\x3c/" + c + "\x3e" 6853 }) 6854 } 6855 CKEDITOR.htmlDataProcessor = function(b) { 6856 var c, 6857 f, l = this; 6858 this.editor = b; 6859 this.dataFilter = c = new CKEDITOR.htmlParser.filter; 6860 this.htmlFilter = f = new CKEDITOR.htmlParser.filter; 6861 this.writer = new CKEDITOR.htmlParser.basicWriter; 6862 c.addRules(t); 6863 c.addRules(F, { 6864 applyToAll: !0 6865 }); 6866 c.addRules(a(b, "data"), { 6867 applyToAll: !0 6868 }); 6869 f.addRules(L); 6870 f.addRules(C, { 6871 applyToAll: !0 6872 }); 6873 f.addRules(a(b, "html"), { 6874 applyToAll: !0 6875 }); 6876 b.on("toHtml", function(a) { 6877 a = a.data; 6878 var c = a.dataValue, 6879 f, c = x(c, b), 6880 c = e(c, H), 6881 c = r(c), 6882 c = e(c, z), 6883 c = c.replace(O, "$1cke:$2"), 6884 c = c.replace(N, "\x3ccke:$1$2\x3e\x3c/cke:$1\x3e"), 6885 c = c.replace(/(<pre\b[^>]*>)(\r\n|\n)/g, "$1$2$2"), 6886 c = c.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi, "$1data-cke-" + CKEDITOR.rnd + "-$2"); 6887 f = a.context || b.editable().getName(); 6888 var l; 6889 CKEDITOR.env.ie && 9 > CKEDITOR.env.version && "pre" == f && (f = "div", c = "\x3cpre\x3e" + c + "\x3c/pre\x3e", l = 1); 6890 f = b.document.createElement(f); 6891 f.setHtml("a" + c); 6892 c = f.getHtml().substr(1); 6893 c = c.replace(new RegExp("data-cke-" + CKEDITOR.rnd + "-", "ig"), ""); 6894 l && (c = c.replace(/^<pre>|<\/pre>$/gi, "")); 6895 c = c.replace(p, "$1$2"); 6896 c = y(c); 6897 c = B(c); 6898 f = !1 === a.fixForBody ? !1 : 6899 d(a.enterMode, b.config.autoParagraph); 6900 c = CKEDITOR.htmlParser.fragment.fromHtml(c, a.context, f); 6901 f && (l = c, !l.children.length && CKEDITOR.dtd[l.name][f] && (f = new CKEDITOR.htmlParser.element(f), l.add(f))); 6902 a.dataValue = c 6903 }, null, null, 5); 6904 b.on("toHtml", function(a) { 6905 a.data.filter.applyTo(a.data.dataValue, !0, a.data.dontFilter, a.data.enterMode) && b.fire("dataFiltered") 6906 }, null, null, 6); 6907 b.on("toHtml", function(a) { 6908 a.data.dataValue.filterChildren(l.dataFilter, !0) 6909 }, null, null, 10); 6910 b.on("toHtml", function(a) { 6911 a = a.data; 6912 var b = a.dataValue, 6913 c = new CKEDITOR.htmlParser.basicWriter; 6914 b.writeChildrenHtml(c); 6915 b = c.getHtml(!0); 6916 a.dataValue = v(b) 6917 }, null, null, 15); 6918 b.on("toDataFormat", function(a) { 6919 var c = a.data.dataValue; 6920 a.data.enterMode != CKEDITOR.ENTER_BR && (c = c.replace(/^<br *\/?>/i, "")); 6921 a.data.dataValue = CKEDITOR.htmlParser.fragment.fromHtml(c, a.data.context, d(a.data.enterMode, b.config.autoParagraph)) 6922 }, null, null, 5); 6923 b.on("toDataFormat", function(a) { 6924 a.data.dataValue.filterChildren(l.htmlFilter, !0) 6925 }, null, null, 10); 6926 b.on("toDataFormat", function(a) { 6927 a.data.filter.applyTo(a.data.dataValue, 6928 !1, !0) 6929 }, null, null, 11); 6930 b.on("toDataFormat", function(a) { 6931 var c = a.data.dataValue, 6932 d = l.writer; 6933 d.reset(); 6934 c.writeChildrenHtml(d); 6935 c = d.getHtml(!0); 6936 c = B(c); 6937 c = D(c, b); 6938 a.data.dataValue = c 6939 }, null, null, 15) 6940 }; 6941 CKEDITOR.htmlDataProcessor.prototype = { 6942 toHtml: function(a, b, c, d) { 6943 var f = this.editor, 6944 e, l, p, h; 6945 b && "object" == typeof b ? (e = b.context, c = b.fixForBody, d = b.dontFilter, l = b.filter, p = b.enterMode, h = b.protectedWhitespaces) : e = b; 6946 e || null === e || (e = f.editable().getName()); 6947 return f.fire("toHtml", { 6948 dataValue: a, 6949 context: e, 6950 fixForBody: c, 6951 dontFilter: d, 6952 filter: l || f.filter, 6953 enterMode: p || f.enterMode, 6954 protectedWhitespaces: h 6955 }).dataValue 6956 }, 6957 toDataFormat: function(a, b) { 6958 var c, d, f; 6959 b && (c = b.context, d = b.filter, f = b.enterMode); 6960 c || null === c || (c = this.editor.editable().getName()); 6961 return this.editor.fire("toDataFormat", { 6962 dataValue: a, 6963 filter: d || this.editor.filter, 6964 context: c, 6965 enterMode: f || this.editor.enterMode 6966 }).dataValue 6967 } 6968 }; 6969 var m = /(?: |\xa0)$/, 6970 J = "{cke_protected}", 6971 u = CKEDITOR.dtd, 6972 K = "caption colgroup col thead tfoot tbody".split(" "), 6973 l = CKEDITOR.tools.extend({}, u.$blockLimit, 6974 u.$block), 6975 t = { 6976 elements: { 6977 input: g, 6978 textarea: g 6979 } 6980 }, 6981 F = { 6982 attributeNames: [ 6983 [/^on/, "data-cke-pa-on"], 6984 [/^srcdoc/, "data-cke-pa-srcdoc"], 6985 [/^data-cke-expando$/, ""] 6986 ], 6987 elements: { 6988 iframe: function(a) { 6989 if (a.attributes && a.attributes.src) { 6990 var b = a.attributes.src.toLowerCase().replace(/[^a-z]/gi, ""); 6991 if (0 === b.indexOf("javascript") || 0 === b.indexOf("data")) a.attributes["data-cke-pa-src"] = a.attributes.src, delete a.attributes.src 6992 } 6993 } 6994 } 6995 }, 6996 L = { 6997 elements: { 6998 embed: function(a) { 6999 var b = a.parent; 7000 if (b && "object" == b.name) { 7001 var c = b.attributes.width, 7002 b = b.attributes.height; 7003 c && (a.attributes.width = c); 7004 b && (a.attributes.height = b) 7005 } 7006 }, 7007 a: function(a) { 7008 var b = a.attributes; 7009 if (!(a.children.length || b.name || b.id || a.attributes["data-cke-saved-name"])) return !1 7010 } 7011 } 7012 }, 7013 C = { 7014 elementNames: [ 7015 [/^cke:/, ""], 7016 [/^\?xml:namespace$/, ""] 7017 ], 7018 attributeNames: [ 7019 [/^data-cke-(saved|pa)-/, ""], 7020 [/^data-cke-.*/, ""], 7021 ["hidefocus", ""] 7022 ], 7023 elements: { 7024 $: function(a) { 7025 var b = a.attributes; 7026 if (b) { 7027 if (b["data-cke-temp"]) return !1; 7028 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]] 7029 } 7030 return a 7031 }, 7032 table: function(a) { 7033 a.children.slice(0).sort(function(a, b) { 7034 var c, d; 7035 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); 7036 return c > d ? 1 : -1 7037 }) 7038 }, 7039 param: function(a) { 7040 a.children = []; 7041 a.isEmpty = !0; 7042 return a 7043 }, 7044 span: function(a) { 7045 "Apple-style-span" == a.attributes["class"] && delete a.name 7046 }, 7047 html: function(a) { 7048 delete a.attributes.contenteditable; 7049 delete a.attributes["class"] 7050 }, 7051 body: function(a) { 7052 delete a.attributes.spellcheck; 7053 delete a.attributes.contenteditable 7054 }, 7055 style: function(a) { 7056 var b = a.children[0]; 7057 b && b.value && (b.value = CKEDITOR.tools.trim(b.value)); 7058 a.attributes.type || (a.attributes.type = "text/css") 7059 }, 7060 title: function(a) { 7061 var b = a.children[0]; 7062 !b && k(a, b = new CKEDITOR.htmlParser.text); 7063 b.value = a.attributes["data-cke-title"] || "" 7064 }, 7065 input: n, 7066 textarea: n 7067 }, 7068 attributes: { 7069 "class": function(a) { 7070 return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g, "")) || !1 7071 } 7072 } 7073 }; 7074 CKEDITOR.env.ie && (C.attributes.style = function(a) { 7075 return a.replace(/(^|;)([^\:]+)/g, 7076 function(a) { 7077 return a.toLowerCase() 7078 }) 7079 }); 7080 var M = /<(a|area|img|input|source)\b([^>]*)>/gi, 7081 q = /([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi, 7082 E = /^(href|src|name)$/i, 7083 z = /(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi, 7084 H = /(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi, 7085 P = /<cke:encoded>([^<]*)<\/cke:encoded>/gi, 7086 O = /(<\/?)((?:object|embed|param|html|body|head|title)([\s][^>]*)?>)/gi, 7087 p = /(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi, 7088 N = /<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi 7089 })(); 7090 "use strict"; 7091 CKEDITOR.htmlParser.element = function(a, d) { 7092 this.name = a; 7093 this.attributes = d || {}; 7094 this.children = []; 7095 var b = a || "", 7096 c = b.match(/^cke:(.*)/); 7097 c && (b = c[1]); 7098 b = !!(CKEDITOR.dtd.$nonBodyContent[b] || CKEDITOR.dtd.$block[b] || CKEDITOR.dtd.$listItem[b] || CKEDITOR.dtd.$tableContent[b] || CKEDITOR.dtd.$nonEditable[b] || "br" == b); 7099 this.isEmpty = !!CKEDITOR.dtd.$empty[a]; 7100 this.isUnknown = !CKEDITOR.dtd[a]; 7101 this._ = { 7102 isBlockLike: b, 7103 hasInlineStarted: this.isEmpty || !b 7104 } 7105 }; 7106 CKEDITOR.htmlParser.cssStyle = function(a) { 7107 var d = {}; 7108 ((a instanceof CKEDITOR.htmlParser.element ? a.attributes.style : a) || "").replace(/"/g, '"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function(a, c, f) { 7109 "font-family" == c && (f = f.replace(/["']/g, "")); 7110 d[c.toLowerCase()] = f 7111 }); 7112 return { 7113 rules: d, 7114 populate: function(a) { 7115 var c = this.toString(); 7116 c && (a instanceof CKEDITOR.dom.element ? a.setAttribute("style", c) : a instanceof CKEDITOR.htmlParser.element ? a.attributes.style = c : a.style = c) 7117 }, 7118 toString: function() { 7119 var a = [], 7120 c; 7121 for (c in d) d[c] && a.push(c, ":", d[c], ";"); 7122 return a.join("") 7123 } 7124 } 7125 }; 7126 (function() { 7127 function a(a) { 7128 return function(b) { 7129 return b.type == CKEDITOR.NODE_ELEMENT && ("string" == typeof a ? b.name == a : b.name in a) 7130 } 7131 } 7132 var d = function(a, b) { 7133 a = a[0]; 7134 b = b[0]; 7135 return a < b ? -1 : a > b ? 1 : 0 7136 }, 7137 b = CKEDITOR.htmlParser.fragment.prototype; 7138 CKEDITOR.htmlParser.element.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, { 7139 type: CKEDITOR.NODE_ELEMENT, 7140 add: b.add, 7141 clone: function() { 7142 return new CKEDITOR.htmlParser.element(this.name, this.attributes) 7143 }, 7144 filter: function(a, b) { 7145 var d = this, 7146 k, g; 7147 b = d.getFilterContext(b); 7148 if (b.off) return !0; 7149 if (!d.parent) a.onRoot(b, d); 7150 for (;;) { 7151 k = d.name; 7152 if (!(g = a.onElementName(b, k))) return this.remove(), !1; 7153 d.name = g; 7154 if (!(d = a.onElement(b, d))) return this.remove(), !1; 7155 if (d !== this) return this.replaceWith(d), !1; 7156 if (d.name == k) break; 7157 if (d.type != CKEDITOR.NODE_ELEMENT) return this.replaceWith(d), !1; 7158 if (!d.name) return this.replaceWithChildren(), !1 7159 } 7160 k = d.attributes; 7161 var n, r; 7162 for (n in k) { 7163 for (g = k[n];;) 7164 if (r = a.onAttributeName(b, n)) 7165 if (r != n) delete k[n], n = r; 7166 else break; 7167 else { 7168 delete k[n]; 7169 break 7170 } 7171 r && (!1 === (g = a.onAttribute(b, d, r, g)) ? delete k[r] : 7172 k[r] = g) 7173 } 7174 d.isEmpty || this.filterChildren(a, !1, b); 7175 return !0 7176 }, 7177 filterChildren: b.filterChildren, 7178 writeHtml: function(a, b) { 7179 b && this.filter(b); 7180 var h = this.name, 7181 k = [], 7182 g = this.attributes, 7183 n, r; 7184 a.openTag(h, g); 7185 for (n in g) k.push([n, g[n]]); 7186 a.sortAttributes && k.sort(d); 7187 n = 0; 7188 for (r = k.length; n < r; n++) g = k[n], a.attribute(g[0], g[1]); 7189 a.openTagClose(h, this.isEmpty); 7190 this.writeChildrenHtml(a); 7191 this.isEmpty || a.closeTag(h) 7192 }, 7193 writeChildrenHtml: b.writeChildrenHtml, 7194 replaceWithChildren: function() { 7195 for (var a = this.children, b = a.length; b;) a[--b].insertAfter(this); 7196 this.remove() 7197 }, 7198 forEach: b.forEach, 7199 getFirst: function(b) { 7200 if (!b) return this.children.length ? this.children[0] : null; 7201 "function" != typeof b && (b = a(b)); 7202 for (var d = 0, h = this.children.length; d < h; ++d) 7203 if (b(this.children[d])) return this.children[d]; 7204 return null 7205 }, 7206 getHtml: function() { 7207 var a = new CKEDITOR.htmlParser.basicWriter; 7208 this.writeChildrenHtml(a); 7209 return a.getHtml() 7210 }, 7211 setHtml: function(a) { 7212 a = this.children = CKEDITOR.htmlParser.fragment.fromHtml(a).children; 7213 for (var b = 0, d = a.length; b < d; ++b) a[b].parent = this 7214 }, 7215 getOuterHtml: function() { 7216 var a = 7217 new CKEDITOR.htmlParser.basicWriter; 7218 this.writeHtml(a); 7219 return a.getHtml() 7220 }, 7221 split: function(a) { 7222 for (var b = this.children.splice(a, this.children.length - a), d = this.clone(), k = 0; k < b.length; ++k) b[k].parent = d; 7223 d.children = b; 7224 b[0] && (b[0].previous = null); 7225 0 < a && (this.children[a - 1].next = null); 7226 this.parent.add(d, this.getIndex() + 1); 7227 return d 7228 }, 7229 find: function(a, b) { 7230 void 0 === b && (b = !1); 7231 var d = [], 7232 k; 7233 for (k = 0; k < this.children.length; k++) { 7234 var g = this.children[k]; 7235 "function" == typeof a && a(g) ? d.push(g) : "string" == typeof a && g.name === a && d.push(g); 7236 b && g.find && (d = d.concat(g.find(a, b))) 7237 } 7238 return d 7239 }, 7240 addClass: function(a) { 7241 if (!this.hasClass(a)) { 7242 var b = this.attributes["class"] || ""; 7243 this.attributes["class"] = b + (b ? " " : "") + a 7244 } 7245 }, 7246 removeClass: function(a) { 7247 var b = this.attributes["class"]; 7248 b && ((b = CKEDITOR.tools.trim(b.replace(new RegExp("(?:\\s+|^)" + a + "(?:\\s+|$)"), " "))) ? this.attributes["class"] = b : delete this.attributes["class"]) 7249 }, 7250 hasClass: function(a) { 7251 var b = this.attributes["class"]; 7252 return b ? (new RegExp("(?:^|\\s)" + a + "(?\x3d\\s|$)")).test(b) : !1 7253 }, 7254 getFilterContext: function(a) { 7255 var b = []; 7256 a || (a = { 7257 off: !1, 7258 nonEditable: !1, 7259 nestedEditable: !1 7260 }); 7261 a.off || "off" != this.attributes["data-cke-processor"] || b.push("off", !0); 7262 a.nonEditable || "false" != this.attributes.contenteditable ? a.nonEditable && !a.nestedEditable && "true" == this.attributes.contenteditable && b.push("nestedEditable", !0) : b.push("nonEditable", !0); 7263 if (b.length) { 7264 a = CKEDITOR.tools.copy(a); 7265 for (var d = 0; d < b.length; d += 2) a[b[d]] = b[d + 1] 7266 } 7267 return a 7268 } 7269 }, !0) 7270 })(); 7271 (function() { 7272 var a = /{([^}]+)}/g; 7273 CKEDITOR.template = function(a) { 7274 this.source = String(a) 7275 }; 7276 CKEDITOR.template.prototype.output = function(d, b) { 7277 var c = this.source.replace(a, function(a, b) { 7278 return void 0 !== d[b] ? d[b] : a 7279 }); 7280 return b ? b.push(c) : c 7281 } 7282 })(); 7283 delete CKEDITOR.loadFullCore; 7284 CKEDITOR.instances = {}; 7285 CKEDITOR.document = new CKEDITOR.dom.document(document); 7286 CKEDITOR.add = function(a) { 7287 CKEDITOR.instances[a.name] = a; 7288 a.on("focus", function() { 7289 CKEDITOR.currentInstance != a && (CKEDITOR.currentInstance = a, CKEDITOR.fire("currentInstance")) 7290 }); 7291 a.on("blur", function() { 7292 CKEDITOR.currentInstance == a && (CKEDITOR.currentInstance = null, CKEDITOR.fire("currentInstance")) 7293 }); 7294 CKEDITOR.fire("instance", null, a) 7295 }; 7296 CKEDITOR.remove = function(a) { 7297 delete CKEDITOR.instances[a.name] 7298 }; 7299 (function() { 7300 var a = {}; 7301 CKEDITOR.addTemplate = function(d, b) { 7302 var c = a[d]; 7303 if (c) return c; 7304 c = { 7305 name: d, 7306 source: b 7307 }; 7308 CKEDITOR.fire("template", c); 7309 return a[d] = new CKEDITOR.template(c.source) 7310 }; 7311 CKEDITOR.getTemplate = function(d) { 7312 return a[d] 7313 } 7314 })(); 7315 (function() { 7316 var a = []; 7317 CKEDITOR.addCss = function(d) { 7318 a.push(d) 7319 }; 7320 CKEDITOR.getCss = function() { 7321 return a.join("\n") 7322 } 7323 })(); 7324 CKEDITOR.on("instanceDestroyed", function() { 7325 CKEDITOR.tools.isEmpty(this.instances) && CKEDITOR.fire("reset") 7326 }); 7327 CKEDITOR.TRISTATE_ON = 1; 7328 CKEDITOR.TRISTATE_OFF = 2; 7329 CKEDITOR.TRISTATE_DISABLED = 0; 7330 (function() { 7331 CKEDITOR.inline = function(a, d) { 7332 if (!CKEDITOR.env.isCompatible) return null; 7333 a = CKEDITOR.dom.element.get(a); 7334 if (a.getEditor()) throw 'The editor instance "' + a.getEditor().name + '" is already attached to the provided element.'; 7335 var b = new CKEDITOR.editor(d, a, CKEDITOR.ELEMENT_MODE_INLINE), 7336 c = a.is("textarea") ? a : null; 7337 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), 7338 a.insertAfter(c), c.hide(), c.$.form && b._attachToForm()) : b.setData(a.getHtml(), null, !0); 7339 b.on("loaded", function() { 7340 b.fire("uiReady"); 7341 b.editable(a); 7342 b.container = a; 7343 b.ui.contentsElement = a; 7344 b.setData(b.getData(1)); 7345 b.resetDirty(); 7346 b.fire("contentDom"); 7347 b.mode = "wysiwyg"; 7348 b.fire("mode"); 7349 b.status = "ready"; 7350 b.fireOnce("instanceReady"); 7351 CKEDITOR.fire("instanceReady", null, b) 7352 }, null, null, 1E4); 7353 b.on("destroy", function() { 7354 c && (b.container.clearCustomData(), b.container.remove(), c.show()); 7355 b.element.clearCustomData(); 7356 delete b.element 7357 }); 7358 return b 7359 }; 7360 CKEDITOR.inlineAll = function() { 7361 var a, d, b; 7362 for (b in CKEDITOR.dtd.$editable) 7363 for (var c = CKEDITOR.document.getElementsByTag(b), f = 0, h = c.count(); f < h; f++) a = c.getItem(f), "true" == a.getAttribute("contenteditable") && (d = { 7364 element: a, 7365 config: {} 7366 }, !1 !== CKEDITOR.fire("inline", d) && CKEDITOR.inline(a, d.config)) 7367 }; 7368 CKEDITOR.domReady(function() { 7369 !CKEDITOR.disableAutoInline && CKEDITOR.inlineAll() 7370 }) 7371 })(); 7372 CKEDITOR.replaceClass = "ckeditor"; 7373 (function() { 7374 function a(a, f, h, k) { 7375 if (!CKEDITOR.env.isCompatible) return null; 7376 a = CKEDITOR.dom.element.get(a); 7377 if (a.getEditor()) throw 'The editor instance "' + a.getEditor().name + '" is already attached to the provided element.'; 7378 var g = new CKEDITOR.editor(f, a, k); 7379 k == CKEDITOR.ELEMENT_MODE_REPLACE && (a.setStyle("visibility", "hidden"), g._.required = a.hasAttribute("required"), a.removeAttribute("required")); 7380 h && g.setData(h, null, !0); 7381 g.on("loaded", function() { 7382 b(g); 7383 k == CKEDITOR.ELEMENT_MODE_REPLACE && g.config.autoUpdateElement && 7384 a.$.form && g._attachToForm(); 7385 g.setMode(g.config.startupMode, function() { 7386 g.resetDirty(); 7387 g.status = "ready"; 7388 g.fireOnce("instanceReady"); 7389 CKEDITOR.fire("instanceReady", null, g) 7390 }) 7391 }); 7392 g.on("destroy", d); 7393 return g 7394 } 7395 7396 function d() { 7397 var a = this.container, 7398 b = this.element; 7399 a && (a.clearCustomData(), a.remove()); 7400 b && (b.clearCustomData(), this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && (b.show(), this._.required && b.setAttribute("required", "required")), delete this.element) 7401 } 7402 7403 function b(a) { 7404 var b = a.name, 7405 d = a.element, 7406 k = a.elementMode, 7407 g = 7408 a.fire("uiSpace", { 7409 space: "top", 7410 html: "" 7411 }).html, 7412 n = a.fire("uiSpace", { 7413 space: "bottom", 7414 html: "" 7415 }).html, 7416 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'), 7417 b = CKEDITOR.dom.element.createFromHtml(r.output({ 7418 id: a.id, 7419 name: b, 7420 langDir: a.lang.dir, 7421 langCode: a.langCode, 7422 voiceLabel: a.title, 7423 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" : "", 7424 contentId: a.ui.spaceId("contents"), 7425 bottomHtml: n ? '\x3cspan id\x3d"' + a.ui.spaceId("bottom") + '" class\x3d"cke_bottom cke_reset_all" role\x3d"presentation"\x3e' + n + "\x3c/span\x3e" : "", 7426 outerEl: CKEDITOR.env.ie ? "span" : "div" 7427 })); 7428 k == CKEDITOR.ELEMENT_MODE_REPLACE ? 7429 (d.hide(), b.insertAfter(d)) : d.append(b); 7430 a.container = b; 7431 a.ui.contentsElement = a.ui.space("contents"); 7432 g && a.ui.space("top").unselectable(); 7433 n && a.ui.space("bottom").unselectable(); 7434 d = a.config.width; 7435 k = a.config.height; 7436 d && b.setStyle("width", CKEDITOR.tools.cssLength(d)); 7437 k && a.ui.space("contents").setStyle("height", CKEDITOR.tools.cssLength(k)); 7438 b.disableContextMenu(); 7439 CKEDITOR.env.webkit && b.on("focus", function() { 7440 a.focus() 7441 }); 7442 a.fireOnce("uiReady") 7443 } 7444 CKEDITOR.replace = function(b, d) { 7445 return a(b, d, null, CKEDITOR.ELEMENT_MODE_REPLACE) 7446 }; 7447 CKEDITOR.appendTo = function(b, d, h) { 7448 return a(b, d, h, CKEDITOR.ELEMENT_MODE_APPENDTO) 7449 }; 7450 CKEDITOR.replaceAll = function() { 7451 for (var a = document.getElementsByTagName("textarea"), b = 0; b < a.length; b++) { 7452 var d = null, 7453 k = a[b]; 7454 if (k.name || k.id) { 7455 if ("string" == typeof arguments[0]) { 7456 if (!(new RegExp("(?:^|\\s)" + arguments[0] + "(?:$|\\s)")).test(k.className)) continue 7457 } else if ("function" == typeof arguments[0] && (d = {}, !1 === arguments[0](k, d))) continue; 7458 this.replace(k, d) 7459 } 7460 } 7461 }; 7462 CKEDITOR.editor.prototype.addMode = function(a, b) { 7463 (this._.modes || (this._.modes = {}))[a] = b 7464 }; 7465 CKEDITOR.editor.prototype.setMode = function(a, b) { 7466 var d = this, 7467 k = this._.modes; 7468 if (a != d.mode && k && k[a]) { 7469 d.fire("beforeSetMode", a); 7470 if (d.mode) { 7471 var g = d.checkDirty(), 7472 k = d._.previousModeData, 7473 n, r = 0; 7474 d.fire("beforeModeUnload"); 7475 d.editable(0); 7476 d._.previousMode = d.mode; 7477 d._.previousModeData = n = d.getData(1); 7478 "source" == d.mode && k == n && (d.fire("lockSnapshot", { 7479 forceUpdate: !0 7480 }), r = 1); 7481 d.ui.space("contents").setHtml(""); 7482 d.mode = "" 7483 } else d._.previousModeData = d.getData(1); 7484 this._.modes[a](function() { 7485 d.mode = a; 7486 void 0 !== g && !g && 7487 d.resetDirty(); 7488 r ? d.fire("unlockSnapshot") : "wysiwyg" == a && d.fire("saveSnapshot"); 7489 setTimeout(function() { 7490 d.fire("mode"); 7491 b && b.call(d) 7492 }, 0) 7493 }) 7494 } 7495 }; 7496 CKEDITOR.editor.prototype.resize = function(a, b, d, k) { 7497 var g = this.container, 7498 n = this.ui.space("contents"), 7499 r = CKEDITOR.env.webkit && this.document && this.document.getWindow().$.frameElement; 7500 k = k ? this.container.getFirst(function(a) { 7501 return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_inner") 7502 }) : g; 7503 k.setSize("width", a, !0); 7504 r && (r.style.width = "1%"); 7505 var e = (k.$.offsetHeight || 0) - (n.$.clientHeight || 7506 0), 7507 g = Math.max(b - (d ? 0 : e), 0); 7508 b = d ? b + e : b; 7509 n.setStyle("height", g + "px"); 7510 r && (r.style.width = "100%"); 7511 this.fire("resize", { 7512 outerHeight: b, 7513 contentsHeight: g, 7514 outerWidth: a || k.getSize("width") 7515 }) 7516 }; 7517 CKEDITOR.editor.prototype.getResizable = function(a) { 7518 return a ? this.ui.space("contents") : this.container 7519 }; 7520 CKEDITOR.domReady(function() { 7521 CKEDITOR.replaceClass && CKEDITOR.replaceAll(CKEDITOR.replaceClass) 7522 }) 7523 })(); 7524 CKEDITOR.config.startupMode = "wysiwyg"; 7525 (function() { 7526 function a(a) { 7527 var b = a.editor, 7528 e = a.data.path, 7529 f = e.blockLimit, 7530 g = a.data.selection, 7531 h = g.getRanges()[0], 7532 q; 7533 if (CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller) 7534 if (g = d(g, e)) g.appendBogus(), q = CKEDITOR.env.ie; 7535 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) { 7536 return !c(a) || a.type == CKEDITOR.NODE_COMMENT || a.isReadOnly() 7537 }, !f.checkForward() || e.checkStartOfBlock() && e.checkEndOfBlock()) && 7538 (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(/^(?: |\xa0)$/) && b.remove(), q = 1, a.cancel()); 7539 q && h.select() 7540 } 7541 7542 function d(a, b) { 7543 if (a.isFake) return 0; 7544 var d = b.block || b.blockLimit, 7545 e = d && d.getLast(c); 7546 if (!(!d || !d.isBlockBoundary() || e && e.type == CKEDITOR.NODE_ELEMENT && e.isBlockBoundary() || d.is("pre") || d.getBogus())) return d 7547 } 7548 7549 function b(a) { 7550 var b = a.data.getTarget(); 7551 b.is("input") && 7552 (b = b.getAttribute("type"), "submit" != b && "reset" != b || a.data.preventDefault()) 7553 } 7554 7555 function c(a) { 7556 return e(a) && y(a) 7557 } 7558 7559 function f(a, b) { 7560 return function(c) { 7561 var d = c.data.$.toElement || c.data.$.fromElement || c.data.$.relatedTarget; 7562 (d = d && d.nodeType == CKEDITOR.NODE_ELEMENT ? new CKEDITOR.dom.element(d) : null) && (b.equals(d) || b.contains(d)) || a.call(this, c) 7563 } 7564 } 7565 7566 function h(a) { 7567 function b(a) { 7568 return function(b, e) { 7569 e && b.type == CKEDITOR.NODE_ELEMENT && b.is(f) && (d = b); 7570 if (!(e || !c(b) || a && B(b))) return !1 7571 } 7572 } 7573 var d, e = a.getRanges()[0]; 7574 a = a.root; 7575 var f = { 7576 table: 1, 7577 ul: 1, 7578 ol: 1, 7579 dl: 1 7580 }; 7581 if (e.startPath().contains(f)) { 7582 var g = e.clone(); 7583 g.collapse(1); 7584 g.setStartAt(a, CKEDITOR.POSITION_AFTER_START); 7585 a = new CKEDITOR.dom.walker(g); 7586 a.guard = b(); 7587 a.checkBackward(); 7588 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 7589 } 7590 return null 7591 } 7592 7593 function k(a, b, c) { 7594 return !1 !== a.config.autoParagraph && a.activeEnterMode != CKEDITOR.ENTER_BR && (a.editable().equals(c) && !b || b && "true" == b.getAttribute("contenteditable")) 7595 } 7596 7597 function g(a) { 7598 return a.activeEnterMode != CKEDITOR.ENTER_BR && !1 !== a.config.autoParagraph ? a.activeEnterMode == CKEDITOR.ENTER_DIV ? "div" : "p" : !1 7599 } 7600 7601 function n(a) { 7602 var b = a.editor; 7603 b.getSelection().scrollIntoView(); 7604 setTimeout(function() { 7605 b.fire("saveSnapshot") 7606 }, 0) 7607 } 7608 7609 function r(a, b, c) { 7610 var d = a.getCommonAncestor(b); 7611 for (b = a = c ? b : a; 7612 (a = a.getParent()) && !d.equals(a) && 1 == a.getChildCount();) b = a; 7613 b.remove() 7614 } 7615 var e, y, v, B, D, x, m, J, u, K; 7616 CKEDITOR.editable = CKEDITOR.tools.createClass({ 7617 base: CKEDITOR.dom.element, 7618 $: function(a, b) { 7619 this.base(b.$ || 7620 b); 7621 this.editor = a; 7622 this.status = "unloaded"; 7623 this.hasFocus = !1; 7624 this.setup() 7625 }, 7626 proto: { 7627 focus: function() { 7628 var a; 7629 if (CKEDITOR.env.webkit && !this.hasFocus && (a = this.editor._.previousActive || this.getDocument().getActive(), this.contains(a))) { 7630 a.focus(); 7631 return 7632 } 7633 CKEDITOR.env.edge && 14 < CKEDITOR.env.version && !this.hasFocus && this.getDocument().equals(CKEDITOR.document) && (this.editor._.previousScrollTop = this.$.scrollTop); 7634 try { 7635 if (!CKEDITOR.env.ie || CKEDITOR.env.edge && 14 < CKEDITOR.env.version || !this.getDocument().equals(CKEDITOR.document)) 7636 if (CKEDITOR.env.chrome) { 7637 var b = 7638 this.$.scrollTop; 7639 this.$.focus(); 7640 this.$.scrollTop = b 7641 } else this.$.focus(); 7642 else this.$.setActive() 7643 } catch (c) { 7644 if (!CKEDITOR.env.ie) throw c; 7645 } 7646 CKEDITOR.env.safari && !this.isInline() && (a = CKEDITOR.document.getActive(), a.equals(this.getWindow().getFrame()) || this.getWindow().focus()) 7647 }, 7648 on: function(a, b) { 7649 var c = Array.prototype.slice.call(arguments, 0); 7650 CKEDITOR.env.ie && /^focus|blur$/.exec(a) && (a = "focus" == a ? "focusin" : "focusout", b = f(b, this), c[0] = a, c[1] = b); 7651 return CKEDITOR.dom.element.prototype.on.apply(this, c) 7652 }, 7653 attachListener: function(a) { 7654 !this._.listeners && 7655 (this._.listeners = []); 7656 var b = Array.prototype.slice.call(arguments, 1), 7657 b = a.on.apply(a, b); 7658 this._.listeners.push(b); 7659 return b 7660 }, 7661 clearListeners: function() { 7662 var a = this._.listeners; 7663 try { 7664 for (; a.length;) a.pop().removeListener() 7665 } catch (b) {} 7666 }, 7667 restoreAttrs: function() { 7668 var a = this._.attrChanges, 7669 b, c; 7670 for (c in a) a.hasOwnProperty(c) && (b = a[c], null !== b ? this.setAttribute(c, b) : this.removeAttribute(c)) 7671 }, 7672 attachClass: function(a) { 7673 var b = this.getCustomData("classes"); 7674 this.hasClass(a) || (!b && (b = []), b.push(a), this.setCustomData("classes", 7675 b), this.addClass(a)) 7676 }, 7677 changeAttr: function(a, b) { 7678 var c = this.getAttribute(a); 7679 b !== c && (!this._.attrChanges && (this._.attrChanges = {}), a in this._.attrChanges || (this._.attrChanges[a] = c), this.setAttribute(a, b)) 7680 }, 7681 insertText: function(a) { 7682 this.editor.focus(); 7683 this.insertHtml(this.transformPlainTextToHtml(a), "text") 7684 }, 7685 transformPlainTextToHtml: function(a) { 7686 var b = this.editor.getSelection().getStartElement().hasAscendant("pre", !0) ? CKEDITOR.ENTER_BR : this.editor.activeEnterMode; 7687 return CKEDITOR.tools.transformPlainTextToHtml(a, 7688 b) 7689 }, 7690 insertHtml: function(a, b, c) { 7691 var d = this.editor; 7692 d.focus(); 7693 d.fire("saveSnapshot"); 7694 c || (c = d.getSelection().getRanges()[0]); 7695 x(this, b || "html", a, c); 7696 c.select(); 7697 n(this); 7698 this.editor.fire("afterInsertHtml", {}) 7699 }, 7700 insertHtmlIntoRange: function(a, b, c) { 7701 x(this, c || "html", a, b); 7702 this.editor.fire("afterInsertHtml", { 7703 intoRange: b 7704 }) 7705 }, 7706 insertElement: function(a, b) { 7707 var d = this.editor; 7708 d.focus(); 7709 d.fire("saveSnapshot"); 7710 var e = d.activeEnterMode, 7711 d = d.getSelection(), 7712 f = a.getName(), 7713 f = CKEDITOR.dtd.$block[f]; 7714 b || (b = d.getRanges()[0]); 7715 this.insertElementIntoRange(a, 7716 b) && (b.moveToPosition(a, CKEDITOR.POSITION_AFTER_END), f && ((f = a.getNext(function(a) { 7717 return c(a) && !B(a) 7718 })) && 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)))); 7719 d.selectRanges([b]); 7720 n(this) 7721 }, 7722 insertElementIntoSelection: function(a) { 7723 this.insertElement(a) 7724 }, 7725 insertElementIntoRange: function(a, b) { 7726 var c = this.editor, 7727 d = c.config.enterMode, 7728 e = a.getName(), 7729 f = CKEDITOR.dtd.$block[e]; 7730 if (b.checkReadOnly()) return !1; 7731 b.deleteContents(1); 7732 b.startContainer.type == CKEDITOR.NODE_ELEMENT && (b.startContainer.is({ 7733 tr: 1, 7734 table: 1, 7735 tbody: 1, 7736 thead: 1, 7737 tfoot: 1 7738 }) ? m(b) : b.startContainer.is(CKEDITOR.dtd.$list) && J(b)); 7739 var q, g; 7740 if (f) 7741 for (; 7742 (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 ? 7743 "div" : "p", c.editable()); 7744 b.insertNode(a); 7745 return !0 7746 }, 7747 setData: function(a, b) { 7748 b || (a = this.editor.dataProcessor.toHtml(a)); 7749 this.setHtml(a); 7750 this.fixInitialSelection(); 7751 "unloaded" == this.status && (this.status = "ready"); 7752 this.editor.fire("dataReady") 7753 }, 7754 getData: function(a) { 7755 var b = this.getHtml(); 7756 a || (b = this.editor.dataProcessor.toDataFormat(b)); 7757 return b 7758 }, 7759 setReadOnly: function(a) { 7760 this.setAttribute("contenteditable", !a) 7761 }, 7762 detach: function() { 7763 this.removeClass("cke_editable"); 7764 this.status = "detached"; 7765 var a = this.editor; 7766 this._.detach(); 7767 delete a.document; 7768 delete a.window 7769 }, 7770 isInline: function() { 7771 return this.getDocument().equals(CKEDITOR.document) 7772 }, 7773 fixInitialSelection: function() { 7774 function a() { 7775 var b = c.getDocument().$, 7776 d = b.getSelection(), 7777 e; 7778 a: if (d.anchorNode && d.anchorNode == c.$) e = !0; 7779 else { 7780 if (CKEDITOR.env.webkit && (e = c.getDocument().getActive()) && e.equals(c) && !d.anchorNode) { 7781 e = !0; 7782 break a 7783 } 7784 e = void 0 7785 } e && (e = new CKEDITOR.dom.range(c), e.moveToElementEditStart(c), b = b.createRange(), b.setStart(e.startContainer.$, e.startOffset), b.collapse(!0), d.removeAllRanges(), 7786 d.addRange(b)) 7787 } 7788 7789 function b() { 7790 var a = c.getDocument().$, 7791 d = a.selection, 7792 e = c.getDocument().getActive(); 7793 "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()) 7794 } 7795 var c = this; 7796 if (CKEDITOR.env.ie && (9 > CKEDITOR.env.version || CKEDITOR.env.quirks)) this.hasFocus && (this.focus(), b()); 7797 else if (this.hasFocus) this.focus(), a(); 7798 else this.once("focus", 7799 function() { 7800 a() 7801 }, null, null, -999) 7802 }, 7803 getHtmlFromRange: function(a) { 7804 if (a.collapsed) return new CKEDITOR.dom.documentFragment(a.document); 7805 a = { 7806 doc: this.getDocument(), 7807 range: a.clone() 7808 }; 7809 u.eol.detect(a, this); 7810 u.bogus.exclude(a); 7811 u.cell.shrink(a); 7812 a.fragment = a.range.cloneContents(); 7813 u.tree.rebuild(a, this); 7814 u.eol.fix(a, this); 7815 return new CKEDITOR.dom.documentFragment(a.fragment.$) 7816 }, 7817 extractHtmlFromRange: function(a, b) { 7818 var c = K, 7819 d = { 7820 range: a, 7821 doc: a.document 7822 }, 7823 e = this.getHtmlFromRange(a); 7824 if (a.collapsed) return a.optimize(), e; 7825 a.enlarge(CKEDITOR.ENLARGE_INLINE, 7826 1); 7827 c.table.detectPurge(d); 7828 d.bookmark = a.createBookmark(); 7829 delete d.range; 7830 var f = this.editor.createRange(); 7831 f.moveToPosition(d.bookmark.startNode, CKEDITOR.POSITION_BEFORE_START); 7832 d.targetBookmark = f.createBookmark(); 7833 c.list.detectMerge(d, this); 7834 c.table.detectRanges(d, this); 7835 c.block.detectMerge(d, this); 7836 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))); 7837 a.moveToBookmark(d.targetBookmark); 7838 a.optimize(); 7839 c.fixUneditableRangePosition(a); 7840 c.list.merge(d, this); 7841 c.table.purge(d, this); 7842 c.block.merge(d, this); 7843 if (b) { 7844 c = a.startPath(); 7845 if (d = a.checkStartOfBlock() && a.checkEndOfBlock() && c.block && !a.root.equals(c.block)) { 7846 a: { 7847 var d = c.block.getElementsByTag("span"), 7848 f = 0, 7849 q; 7850 if (d) 7851 for (; q = d.getItem(f++);) 7852 if (!y(q)) { 7853 d = !0; 7854 break a 7855 } d = !1 7856 } 7857 d = !d 7858 } 7859 d && (a.moveToPosition(c.block, CKEDITOR.POSITION_BEFORE_START), c.block.remove()) 7860 } else c.autoParagraph(this.editor, a), v(a.startContainer) && a.startContainer.appendBogus(); 7861 a.startContainer.mergeSiblings(); 7862 return e 7863 }, 7864 setup: function() { 7865 var a = this.editor; 7866 this.attachListener(a, "beforeGetData", function() { 7867 var b = this.getData(); 7868 this.is("textarea") || !1 !== a.config.ignoreEmptyParagraph && (b = b.replace(D, function(a, b) { 7869 return b 7870 })); 7871 a.setData(b, null, 1) 7872 }, this); 7873 this.attachListener(a, "getSnapshot", function(a) { 7874 a.data = this.getData(1) 7875 }, this); 7876 this.attachListener(a, "afterSetData", function() { 7877 this.setData(a.getData(1)) 7878 }, this); 7879 this.attachListener(a, "loadSnapshot", function(a) { 7880 this.setData(a.data, 1) 7881 }, this); 7882 this.attachListener(a, 7883 "beforeFocus", 7884 function() { 7885 var b = a.getSelection(); 7886 (b = b && b.getNative()) && "Control" == b.type || this.focus() 7887 }, this); 7888 this.attachListener(a, "insertHtml", function(a) { 7889 this.insertHtml(a.data.dataValue, a.data.mode, a.data.range) 7890 }, this); 7891 this.attachListener(a, "insertElement", function(a) { 7892 this.insertElement(a.data) 7893 }, this); 7894 this.attachListener(a, "insertText", function(a) { 7895 this.insertText(a.data) 7896 }, this); 7897 this.setReadOnly(a.readOnly); 7898 this.attachClass("cke_editable"); 7899 a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? this.attachClass("cke_editable_inline") : 7900 a.elementMode != CKEDITOR.ELEMENT_MODE_REPLACE && a.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO || this.attachClass("cke_editable_themed"); 7901 this.attachClass("cke_contents_" + a.config.contentsLangDirection); 7902 a.keystrokeHandler.blockedKeystrokes[8] = +a.readOnly; 7903 a.keystrokeHandler.attach(this); 7904 this.on("blur", function() { 7905 this.hasFocus = !1 7906 }, null, null, -1); 7907 this.on("focus", function() { 7908 this.hasFocus = !0 7909 }, null, null, -1); 7910 if (CKEDITOR.env.webkit) this.on("scroll", function() { 7911 a._.previousScrollTop = a.editable().$.scrollTop 7912 }, null, 7913 null, -1); 7914 if (CKEDITOR.env.edge && 14 < CKEDITOR.env.version) { 7915 var d = function() { 7916 var b = a.editable(); 7917 null != a._.previousScrollTop && b.getDocument().equals(CKEDITOR.document) && (b.$.scrollTop = a._.previousScrollTop, a._.previousScrollTop = null, this.removeListener("scroll", d)) 7918 }; 7919 this.on("scroll", d) 7920 } 7921 a.focusManager.add(this); 7922 this.equals(CKEDITOR.document.getActive()) && (this.hasFocus = !0, a.once("contentDom", function() { 7923 a.focusManager.focus(this) 7924 }, this)); 7925 this.isInline() && this.changeAttr("tabindex", a.tabIndex); 7926 if (!this.is("textarea")) { 7927 a.document = 7928 this.getDocument(); 7929 a.window = this.getWindow(); 7930 var f = a.document; 7931 this.changeAttr("spellcheck", !a.config.disableNativeSpellChecker); 7932 var g = a.config.contentsLangDirection; 7933 this.getDirection(1) != g && this.changeAttr("dir", g); 7934 var k = CKEDITOR.getCss(); 7935 if (k) { 7936 var g = f.getHead(), 7937 m = g.getCustomData("stylesheet"); 7938 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", 7939 k), k.data("cke-temp", 1)) 7940 } 7941 g = f.getCustomData("stylesheet_ref") || 0; 7942 f.setCustomData("stylesheet_ref", g + 1); 7943 this.setCustomData("cke_includeReadonly", !a.config.disableReadonlyStyling); 7944 this.attachListener(this, "click", function(a) { 7945 a = a.data; 7946 var b = (new CKEDITOR.dom.elementPath(a.getTarget(), this)).contains("a"); 7947 b && 2 != a.$.button && b.isReadOnly() && a.preventDefault() 7948 }); 7949 var q = { 7950 8: 1, 7951 46: 1 7952 }; 7953 this.attachListener(a, "key", function(b) { 7954 if (a.readOnly) return !0; 7955 var c = b.data.domEvent.getKey(), 7956 d; 7957 b = a.getSelection(); 7958 if (0 !== b.getRanges().length) { 7959 if (c in 7960 q) { 7961 var f, g = b.getRanges()[0], 7962 p = g.startPath(), 7963 k, w, A, c = 8 == c; 7964 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" + 7965 (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)) 7966 } 7967 return !d 7968 } 7969 }); 7970 a.blockless && CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller && this.attachListener(this, "keyup", function(b) { 7971 b.data.getKeystroke() in q && !this.getFirst(c) && (this.appendBogus(), b = a.createRange(), b.moveToPosition(this, CKEDITOR.POSITION_AFTER_START), b.select()) 7972 }); 7973 this.attachListener(this, "dblclick", function(b) { 7974 if (a.readOnly) return !1; 7975 b = { 7976 element: b.data.getTarget() 7977 }; 7978 a.fire("doubleclick", b) 7979 }); 7980 CKEDITOR.env.ie && this.attachListener(this, "click", b); 7981 CKEDITOR.env.ie && !CKEDITOR.env.edge || this.attachListener(this, "mousedown", 7982 function(b) { 7983 var c = b.data.getTarget(); 7984 c.is("img", "hr", "input", "textarea", "select") && !c.isReadOnly() && (a.getSelection().selectElement(c), c.is("input", "textarea", "select") && b.data.preventDefault()) 7985 }); 7986 CKEDITOR.env.edge && this.attachListener(this, "mouseup", function(b) { 7987 (b = b.data.getTarget()) && b.is("img") && !b.isReadOnly() && a.getSelection().selectElement(b) 7988 }); 7989 CKEDITOR.env.gecko && this.attachListener(this, "mouseup", function(b) { 7990 if (2 == b.data.$.button && (b = b.data.getTarget(), !b.getAscendant("table") && !b.getOuterHtml().replace(D, 7991 ""))) { 7992 var c = a.createRange(); 7993 c.moveToElementEditStart(b); 7994 c.select(!0) 7995 } 7996 }); 7997 CKEDITOR.env.webkit && (this.attachListener(this, "click", function(a) { 7998 a.data.getTarget().is("input", "select") && a.data.preventDefault() 7999 }), this.attachListener(this, "mouseup", function(a) { 8000 a.data.getTarget().is("input", "textarea") && a.data.preventDefault() 8001 })); 8002 CKEDITOR.env.webkit && this.attachListener(a, "key", function(b) { 8003 if (a.readOnly) return !0; 8004 var c = b.data.domEvent.getKey(); 8005 if (c in q && (b = a.getSelection(), 0 !== b.getRanges().length)) { 8006 var c = 8007 8 == c, 8008 d = b.getRanges()[0]; 8009 b = d.startPath(); 8010 if (d.collapsed) a: { 8011 var e = b.block; 8012 if (e && d[c ? "checkStartOfBlock" : "checkEndOfBlock"]() && d.moveToClosestEditablePosition(e, !c) && d.collapsed) { 8013 if (d.startContainer.type == CKEDITOR.NODE_ELEMENT) { 8014 var f = d.startContainer.getChild(d.startOffset - (c ? 1 : 0)); 8015 if (f && f.type == CKEDITOR.NODE_ELEMENT && f.is("hr")) { 8016 a.fire("saveSnapshot"); 8017 f.remove(); 8018 b = !0; 8019 break a 8020 } 8021 } 8022 d = d.startPath().block; 8023 if (!d || d && d.contains(e)) b = void 0; 8024 else { 8025 a.fire("saveSnapshot"); 8026 var p; 8027 (p = (c ? d : e).getBogus()) && p.remove(); 8028 p = a.getSelection(); 8029 f = p.createBookmarks(); 8030 (c ? e : d).moveChildren(c ? d : e, !1); 8031 b.lastElement.mergeSiblings(); 8032 r(e, d, !c); 8033 p.selectBookmarks(f); 8034 b = !0 8035 } 8036 } else b = !1 8037 } 8038 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(), 8039 c.select(), b = !0) : b = !1; 8040 if (!b) return; 8041 a.getSelection().scrollIntoView(); 8042 a.fire("saveSnapshot"); 8043 return !1 8044 } 8045 }, this, null, 100) 8046 } 8047 } 8048 }, 8049 _: { 8050 detach: function() { 8051 this.editor.setData(this.editor.getData(), 0, 1); 8052 this.clearListeners(); 8053 this.restoreAttrs(); 8054 var a; 8055 if (a = this.removeCustomData("classes")) 8056 for (; a.length;) this.removeClass(a.pop()); 8057 if (!this.is("textarea")) { 8058 a = this.getDocument(); 8059 var b = a.getHead(); 8060 if (b.getCustomData("stylesheet")) { 8061 var c = a.getCustomData("stylesheet_ref"); 8062 --c ? a.setCustomData("stylesheet_ref", c) : (a.removeCustomData("stylesheet_ref"), 8063 b.removeCustomData("stylesheet").remove()) 8064 } 8065 } 8066 this.editor.fire("contentDomUnload"); 8067 delete this.editor 8068 } 8069 } 8070 }); 8071 CKEDITOR.editor.prototype.editable = function(a) { 8072 var b = this._.editable; 8073 if (b && a) return 0; 8074 arguments.length && (b = this._.editable = a ? a instanceof CKEDITOR.editable ? a : new CKEDITOR.editable(this, a) : (b && b.detach(), null)); 8075 return b 8076 }; 8077 CKEDITOR.on("instanceLoaded", function(b) { 8078 var c = b.editor; 8079 c.on("insertElement", function(a) { 8080 a = a.data; 8081 a.type == CKEDITOR.NODE_ELEMENT && (a.is("input") || a.is("textarea")) && ("false" != a.getAttribute("contentEditable") && 8082 a.data("cke-editable", a.hasAttribute("contenteditable") ? "true" : "1"), a.setAttribute("contentEditable", !1)) 8083 }); 8084 c.on("selectionChange", function(b) { 8085 if (!c.readOnly) { 8086 var d = c.getSelection(); 8087 d && !d.isLocked && (d = c.checkDirty(), c.fire("lockSnapshot"), a(b), c.fire("unlockSnapshot"), !d && c.resetDirty()) 8088 } 8089 }) 8090 }); 8091 CKEDITOR.on("instanceCreated", function(a) { 8092 var b = a.editor; 8093 b.on("mode", function() { 8094 var a = b.editable(); 8095 if (a && a.isInline()) { 8096 var c = b.title; 8097 a.changeAttr("role", "textbox"); 8098 a.changeAttr("aria-multiline", "true"); 8099 a.changeAttr("aria-label", 8100 c); 8101 c && a.changeAttr("title", c); 8102 var d = b.fire("ariaEditorHelpLabel", {}).label; 8103 if (d && (c = this.ui.space(this.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? "top" : "contents"))) { 8104 var e = CKEDITOR.tools.getNextId(), 8105 d = CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"' + e + '" class\x3d"cke_voice_label"\x3e' + d + "\x3c/span\x3e"); 8106 c.append(d); 8107 a.changeAttr("aria-describedby", e) 8108 } 8109 } 8110 }) 8111 }); 8112 CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}"); 8113 e = CKEDITOR.dom.walker.whitespaces(!0); 8114 y = CKEDITOR.dom.walker.bookmark(!1, !0); 8115 v = CKEDITOR.dom.walker.empty(); 8116 B = CKEDITOR.dom.walker.bogus(); 8117 D = /(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>| |\u00A0| )?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi; 8118 x = function() { 8119 function a(b) { 8120 return b.type == CKEDITOR.NODE_ELEMENT 8121 } 8122 8123 function b(c, d) { 8124 var e, f, g, q, h = [], 8125 z = d.range.startContainer; 8126 e = d.range.startPath(); 8127 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 = 8128 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({ 8129 isElement: 1, 8130 isLineBreak: C, 8131 isBlock: e.isBlockBoundary(), 8132 hasBlockSibling: f, 8133 node: e, 8134 name: g, 8135 allowed: q 8136 }), f = C = 0)) : h.push({ 8137 isElement: 0, 8138 node: e, 8139 allowed: 1 8140 }); - 1 < n && (h[n].firstNotAllowed = 1); - 1 < r && (h[r].lastNotAllowed = 1); 8141 return h 8142 } 8143 8144 function d(b, c) { 8145 var e = [], 8146 f = b.getChildren(), 8147 g = f.count(), 8148 q, h = 0, 8149 z = E[c], 8150 k = !b.is(E.$inline) || b.is("br"); 8151 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); 8152 k && e.push(" "); 8153 return e 8154 } 8155 8156 function e(b) { 8157 return a(b.startContainer) && b.startContainer.getChild(b.startOffset - 1) 8158 } 8159 8160 function f(b) { 8161 return b && a(b) && (b.is(E.$removeEmpty) || b.is("a") && !b.isBlockBoundary()) 8162 } 8163 8164 function h(b, c, d, e) { 8165 var f = b.clone(), 8166 g, q; 8167 f.setEndAt(c, CKEDITOR.POSITION_BEFORE_END); 8168 (g = (new CKEDITOR.dom.walker(f)).next()) && a(g) && z[g.getName()] && (q = g.getPrevious()) && a(q) && !q.getParent().equals(b.startContainer) && 8169 d.contains(q) && e.contains(g) && g.isIdentical(q) && (g.moveChildren(q), g.remove(), h(b, c, d, e)) 8170 } 8171 8172 function q(b, c) { 8173 function d(b, c) { 8174 if (c.isBlock && c.isElement && !c.node.is("br") && a(b) && b.is("br")) return b.remove(), 1 8175 } 8176 var e = c.endContainer.getChild(c.endOffset), 8177 f = c.endContainer.getChild(c.endOffset - 1); 8178 e && d(e, b[b.length - 1]); 8179 f && d(f, b[0]) && (c.setEnd(c.endContainer, c.endOffset - 1), c.collapse()) 8180 } 8181 var E = CKEDITOR.dtd, 8182 z = { 8183 p: 1, 8184 div: 1, 8185 h1: 1, 8186 h2: 1, 8187 h3: 1, 8188 h4: 1, 8189 h5: 1, 8190 h6: 1, 8191 ul: 1, 8192 ol: 1, 8193 li: 1, 8194 pre: 1, 8195 dl: 1, 8196 blockquote: 1 8197 }, 8198 H = { 8199 p: 1, 8200 div: 1, 8201 h1: 1, 8202 h2: 1, 8203 h3: 1, 8204 h4: 1, 8205 h5: 1, 8206 h6: 1 8207 }, 8208 m = CKEDITOR.tools.extend({}, E.$inline); 8209 delete m.br; 8210 return function(z, p, N, w) { 8211 var A = z.editor, 8212 G = !1; 8213 "unfiltered_html" == p && (p = "html", G = !0); 8214 if (!w.checkReadOnly()) { 8215 var I = (new CKEDITOR.dom.elementPath(w.startContainer, w.root)).blockLimit || w.root; 8216 z = { 8217 type: p, 8218 dontFilter: G, 8219 editable: z, 8220 editor: A, 8221 range: w, 8222 blockLimit: I, 8223 mergeCandidates: [], 8224 zombies: [] 8225 }; 8226 p = z.range; 8227 w = z.mergeCandidates; 8228 var n, r; 8229 "text" == z.type && p.shrink(CKEDITOR.SHRINK_ELEMENT, !0, !1) && (n = CKEDITOR.dom.element.createFromHtml("\x3cspan\x3e\x26nbsp;\x3c/span\x3e", 8230 p.document), p.insertNode(n), p.setStartAfter(n)); 8231 G = new CKEDITOR.dom.elementPath(p.startContainer); 8232 z.endPath = I = new CKEDITOR.dom.elementPath(p.endContainer); 8233 if (!p.collapsed) { 8234 var A = I.block || I.blockLimit, 8235 v = p.getCommonAncestor(); 8236 A && !A.equals(v) && !A.contains(v) && p.checkEndOfBlock() && z.zombies.push(A); 8237 p.deleteContents() 8238 } 8239 for (; 8240 (r = e(p)) && a(r) && r.isBlockBoundary() && G.contains(r);) p.moveToPosition(r, CKEDITOR.POSITION_BEFORE_END); 8241 h(p, z.blockLimit, G, I); 8242 n && (p.setEndBefore(n), p.collapse(), n.remove()); 8243 n = p.startPath(); 8244 if (A = n.contains(f, !1, 1)) p.splitElement(A), z.inlineStylesRoot = A, z.inlineStylesPeak = n.lastElement; 8245 n = p.createBookmark(); 8246 (A = n.startNode.getPrevious(c)) && a(A) && f(A) && w.push(A); 8247 (A = n.startNode.getNext(c)) && a(A) && f(A) && w.push(A); 8248 for (A = n.startNode; 8249 (A = A.getParent()) && f(A);) w.push(A); 8250 p.moveToBookmark(n); 8251 if (n = N) { 8252 n = z.range; 8253 if ("text" == z.type && z.inlineStylesRoot) { 8254 r = z.inlineStylesPeak; 8255 p = r.getDocument().createText("{cke-peak}"); 8256 for (w = z.inlineStylesRoot.getParent(); !r.equals(w);) p = p.appendTo(r.clone()), r = r.getParent(); 8257 N = p.getOuterHtml().split("{cke-peak}").join(N) 8258 } 8259 r = z.blockLimit.getName(); 8260 if (/^\s+|\s+$/.test(N) && "span" in CKEDITOR.dtd[r]) { 8261 var x = '\x3cspan data-cke-marker\x3d"1"\x3e\x26nbsp;\x3c/span\x3e'; 8262 N = x + N + x 8263 } 8264 N = z.editor.dataProcessor.toHtml(N, { 8265 context: null, 8266 fixForBody: !1, 8267 protectedWhitespaces: !!x, 8268 dontFilter: z.dontFilter, 8269 filter: z.editor.activeFilter, 8270 enterMode: z.editor.activeEnterMode 8271 }); 8272 r = n.document.createElement("body"); 8273 r.setHtml(N); 8274 x && (r.getFirst().remove(), r.getLast().remove()); 8275 if ((x = n.startPath().block) && (1 != 8276 x.getChildCount() || !x.getBogus())) a: { 8277 var y; 8278 if (1 == r.getChildCount() && a(y = r.getFirst()) && y.is(H) && !y.hasAttribute("contenteditable")) { 8279 x = y.getElementsByTag("*"); 8280 n = 0; 8281 for (w = x.count(); n < w; n++) 8282 if (p = x.getItem(n), !p.is(m)) break a; 8283 y.moveChildren(y.getParent(1)); 8284 y.remove() 8285 } 8286 } 8287 z.dataWrapper = r; 8288 n = N 8289 } 8290 if (n) { 8291 y = z.range; 8292 n = y.document; 8293 var u; 8294 r = z.blockLimit; 8295 w = 0; 8296 var B, x = [], 8297 D, T; 8298 N = A = 0; 8299 var J, K; 8300 p = y.startContainer; 8301 var G = z.endPath.elements[0], 8302 W, I = G.getPosition(p), 8303 v = !!G.getCommonAncestor(p) && I != CKEDITOR.POSITION_IDENTICAL && !(I & CKEDITOR.POSITION_CONTAINS + 8304 CKEDITOR.POSITION_IS_CONTAINED); 8305 p = b(z.dataWrapper, z); 8306 for (q(p, y); w < p.length; w++) { 8307 I = p[w]; 8308 if (u = I.isLineBreak) { 8309 u = y; 8310 J = r; 8311 var S = void 0, 8312 Y = void 0; 8313 I.hasBlockSibling ? u = 1 : (S = u.startContainer.getAscendant(E.$block, 1)) && S.is({ 8314 div: 1, 8315 p: 1 8316 }) ? (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 8317 } 8318 if (u) N = 0 < w; 8319 else { 8320 u = y.startPath(); 8321 !I.isBlock && k(z.editor, u.block, u.blockLimit) && (T = g(z.editor)) && (T = n.createElement(T), 8322 T.appendBogus(), y.insertNode(T), CKEDITOR.env.needsBrFiller && (B = T.getBogus()) && B.remove(), y.moveToPosition(T, CKEDITOR.POSITION_BEFORE_END)); 8323 if ((u = y.startPath().block) && !u.equals(D)) { 8324 if (B = u.getBogus()) B.remove(), x.push(u); 8325 D = u 8326 } 8327 I.firstNotAllowed && (A = 1); 8328 if (A && I.isElement) { 8329 u = y.startContainer; 8330 for (J = null; u && !E[u.getName()][I.name];) { 8331 if (u.equals(r)) { 8332 u = null; 8333 break 8334 } 8335 J = u; 8336 u = u.getParent() 8337 } 8338 if (u) J && (K = y.splitElement(J), z.zombies.push(K), z.zombies.push(J)); 8339 else { 8340 J = r.getName(); 8341 W = !w; 8342 u = w == p.length - 1; 8343 J = d(I.node, J); 8344 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); 8345 u && U == S.length && S.pop(); 8346 W = S 8347 } 8348 } 8349 if (W) { 8350 for (; u = W.pop();) y.insertNode(u); 8351 W = 0 8352 } else y.insertNode(I.node); 8353 I.lastNotAllowed && w < p.length - 1 && ((K = v ? G : K) && y.setEndAt(K, CKEDITOR.POSITION_AFTER_START), A = 0); 8354 y.collapse() 8355 } 8356 } 8357 1 != p.length ? B = !1 : (B = p[0], B = B.isElement && "false" == B.node.getAttribute("contenteditable")); 8358 B && (N = !0, u = p[0].node, y.setStartAt(u, CKEDITOR.POSITION_BEFORE_START), 8359 y.setEndAt(u, CKEDITOR.POSITION_AFTER_END)); 8360 z.dontMoveCaret = N; 8361 z.bogusNeededBlocks = x 8362 } 8363 B = z.range; 8364 var R; 8365 K = z.bogusNeededBlocks; 8366 for (W = B.createBookmark(); D = z.zombies.pop();) D.getParent() && (T = B.clone(), T.moveToElementEditStart(D), T.removeEmptyBlocksAtEnd()); 8367 if (K) 8368 for (; D = K.pop();) CKEDITOR.env.needsBrFiller ? D.appendBogus() : D.append(B.document.createText(" ")); 8369 for (; D = z.mergeCandidates.pop();) D.mergeSiblings(); 8370 B.moveToBookmark(W); 8371 if (!z.dontMoveCaret) { 8372 for (D = e(B); D && a(D) && !D.is(E.$empty);) { 8373 if (D.isBlockBoundary()) B.moveToPosition(D, 8374 CKEDITOR.POSITION_BEFORE_END); 8375 else { 8376 if (f(D) && D.getHtml().match(/(\s| )$/g)) { 8377 R = null; 8378 break 8379 } 8380 R = B.clone(); 8381 R.moveToPosition(D, CKEDITOR.POSITION_BEFORE_END) 8382 } 8383 D = D.getLast(c) 8384 } 8385 R && B.moveToRange(R) 8386 } 8387 } 8388 } 8389 }(); 8390 m = function() { 8391 function a(b) { 8392 b = new CKEDITOR.dom.walker(b); 8393 b.guard = function(a, b) { 8394 if (b) return !1; 8395 if (a.type == CKEDITOR.NODE_ELEMENT) return a.is(CKEDITOR.dtd.$tableContent) 8396 }; 8397 b.evaluator = function(a) { 8398 return a.type == CKEDITOR.NODE_ELEMENT 8399 }; 8400 return b 8401 } 8402 8403 function b(a, c, d) { 8404 c = a.getDocument().createElement(c); 8405 a.append(c, d); 8406 return c 8407 } 8408 8409 function c(a) { 8410 var b = a.count(), 8411 d; 8412 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()) 8413 } 8414 return function(d) { 8415 var e = d.startContainer, 8416 f = e.getAscendant("table", 1), 8417 g = !1; 8418 c(f.getElementsByTag("td")); 8419 c(f.getElementsByTag("th")); 8420 f = d.clone(); 8421 f.setStart(e, 0); 8422 f = a(f).lastBackward(); 8423 f || (f = d.clone(), f.setEndAt(e, CKEDITOR.POSITION_BEFORE_END), f = a(f).lastForward(), g = !0); 8424 f || (f = e); 8425 f.is("table") ? (d.setStartAt(f, CKEDITOR.POSITION_BEFORE_START), 8426 d.collapse(!0), f.remove()) : (f.is({ 8427 tbody: 1, 8428 thead: 1, 8429 tfoot: 1 8430 }) && (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)) 8431 } 8432 }(); 8433 J = function() { 8434 function a(b) { 8435 b = new CKEDITOR.dom.walker(b); 8436 b.guard = function(a, b) { 8437 if (b) return !1; 8438 if (a.type == CKEDITOR.NODE_ELEMENT) return a.is(CKEDITOR.dtd.$list) || a.is(CKEDITOR.dtd.$listItem) 8439 }; 8440 b.evaluator = function(a) { 8441 return a.type == CKEDITOR.NODE_ELEMENT && 8442 a.is(CKEDITOR.dtd.$listItem) 8443 }; 8444 return b 8445 } 8446 return function(b) { 8447 var c = b.startContainer, 8448 d = !1, 8449 e; 8450 e = b.clone(); 8451 e.setStart(c, 0); 8452 e = a(e).lastBackward(); 8453 e || (e = b.clone(), e.setEndAt(c, CKEDITOR.POSITION_BEFORE_END), e = a(e).lastForward(), d = !0); 8454 e || (e = c); 8455 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()) 8456 } 8457 }(); 8458 u = { 8459 eol: { 8460 detect: function(a, b) { 8461 var c = a.range, 8462 d = c.clone(), 8463 e = c.clone(), 8464 f = new CKEDITOR.dom.elementPath(c.startContainer, b), 8465 g = new CKEDITOR.dom.elementPath(c.endContainer, b); 8466 d.collapse(1); 8467 e.collapse(); 8468 f.block && d.checkBoundaryOfElement(f.block, CKEDITOR.END) && (c.setStartAfter(f.block), a.prependEolBr = 1); 8469 g.block && e.checkBoundaryOfElement(g.block, CKEDITOR.START) && (c.setEndBefore(g.block), a.appendEolBr = 1) 8470 }, 8471 fix: function(a, b) { 8472 var c = b.getDocument(), 8473 d; 8474 a.appendEolBr && (d = this.createEolBr(c), a.fragment.append(d)); 8475 !a.prependEolBr || d && !d.getPrevious() || a.fragment.append(this.createEolBr(c), 8476 1) 8477 }, 8478 createEolBr: function(a) { 8479 return a.createElement("br", { 8480 attributes: { 8481 "data-cke-eol": 1 8482 } 8483 }) 8484 } 8485 }, 8486 bogus: { 8487 exclude: function(a) { 8488 var b = a.range.getBoundaryNodes(), 8489 c = b.startNode, 8490 b = b.endNode; 8491 !b || !B(b) || c && c.equals(b) || a.range.setEndBefore(b) 8492 } 8493 }, 8494 tree: { 8495 rebuild: function(a, b) { 8496 var c = a.range, 8497 d = c.getCommonAncestor(), 8498 e = new CKEDITOR.dom.elementPath(d, b), 8499 f = new CKEDITOR.dom.elementPath(c.startContainer, b), 8500 c = new CKEDITOR.dom.elementPath(c.endContainer, b), 8501 g; 8502 d.type == CKEDITOR.NODE_TEXT && (d = d.getParent()); 8503 if (e.blockLimit.is({ 8504 tr: 1, 8505 table: 1 8506 })) { 8507 var h = e.contains("table").getParent(); 8508 g = function(a) { 8509 return !a.equals(h) 8510 } 8511 } 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))) { 8512 var z = e.contains(CKEDITOR.dtd.$list).getParent(); 8513 g = function(a) { 8514 return !a.equals(z) 8515 } 8516 } 8517 g || (g = function(a) { 8518 return !a.equals(e.block) && !a.equals(e.blockLimit) 8519 }); 8520 this.rebuildFragment(a, b, d, g) 8521 }, 8522 rebuildFragment: function(a, b, c, d) { 8523 for (var e; c && !c.equals(b) && d(c);) e = c.clone(0, 1), a.fragment.appendTo(e), 8524 a.fragment = e, c = c.getParent() 8525 } 8526 }, 8527 cell: { 8528 shrink: function(a) { 8529 a = a.range; 8530 var b = a.startContainer, 8531 c = a.endContainer, 8532 d = a.startOffset, 8533 e = a.endOffset; 8534 b.type == CKEDITOR.NODE_ELEMENT && b.equals(c) && b.is("tr") && ++d == e && a.shrink(CKEDITOR.SHRINK_TEXT) 8535 } 8536 } 8537 }; 8538 K = function() { 8539 function a(b, c) { 8540 var d = b.getParent(); 8541 if (d.is(CKEDITOR.dtd.$inline)) b[c ? "insertBefore" : "insertAfter"](d) 8542 } 8543 8544 function b(c, d, e) { 8545 a(d); 8546 a(e, 1); 8547 for (var f; f = e.getNext();) f.insertAfter(d), d = f; 8548 v(c) && c.remove() 8549 } 8550 8551 function c(a, b) { 8552 var d = new CKEDITOR.dom.range(a); 8553 d.setStartAfter(b.startNode); 8554 d.setEndBefore(b.endNode); 8555 return d 8556 } 8557 return { 8558 list: { 8559 detectMerge: function(a, b) { 8560 var d = c(b, a.bookmark), 8561 e = d.startPath(), 8562 f = d.endPath(), 8563 g = e.contains(CKEDITOR.dtd.$list), 8564 h = f.contains(CKEDITOR.dtd.$list); 8565 a.mergeList = g && h && g.getParent().equals(h.getParent()) && !g.equals(h); 8566 a.mergeListItems = e.block && f.block && e.block.is(CKEDITOR.dtd.$listItem) && f.block.is(CKEDITOR.dtd.$listItem); 8567 if (a.mergeList || a.mergeListItems) d = d.clone(), d.setStartBefore(a.bookmark.startNode), d.setEndAfter(a.bookmark.endNode), a.mergeListBookmark = 8568 d.createBookmark() 8569 }, 8570 merge: function(a, c) { 8571 if (a.mergeListBookmark) { 8572 var d = a.mergeListBookmark.startNode, 8573 e = a.mergeListBookmark.endNode, 8574 f = new CKEDITOR.dom.elementPath(d, c), 8575 g = new CKEDITOR.dom.elementPath(e, c); 8576 if (a.mergeList) { 8577 var h = f.contains(CKEDITOR.dtd.$list), 8578 k = g.contains(CKEDITOR.dtd.$list); 8579 h.equals(k) || (k.moveChildren(h), k.remove()) 8580 } 8581 a.mergeListItems && (f = f.contains(CKEDITOR.dtd.$listItem), g = g.contains(CKEDITOR.dtd.$listItem), f.equals(g) || b(g, d, e)); 8582 d.remove(); 8583 e.remove() 8584 } 8585 } 8586 }, 8587 block: { 8588 detectMerge: function(a, 8589 b) { 8590 if (!a.tableContentsRanges && !a.mergeListBookmark) { 8591 var c = new CKEDITOR.dom.range(b); 8592 c.setStartBefore(a.bookmark.startNode); 8593 c.setEndAfter(a.bookmark.endNode); 8594 a.mergeBlockBookmark = c.createBookmark() 8595 } 8596 }, 8597 merge: function(a, c) { 8598 if (a.mergeBlockBookmark && !a.purgeTableBookmark) { 8599 var d = a.mergeBlockBookmark.startNode, 8600 e = a.mergeBlockBookmark.endNode, 8601 f = new CKEDITOR.dom.elementPath(d, c), 8602 g = new CKEDITOR.dom.elementPath(e, c), 8603 f = f.block, 8604 g = g.block; 8605 f && g && !f.equals(g) && b(g, d, e); 8606 d.remove(); 8607 e.remove() 8608 } 8609 } 8610 }, 8611 table: function() { 8612 function a(c) { 8613 var e = [], 8614 f, g = new CKEDITOR.dom.walker(c), 8615 h = c.startPath().contains(d), 8616 k = c.endPath().contains(d), 8617 p = {}; 8618 g.guard = function(a, g) { 8619 if (a.type == CKEDITOR.NODE_ELEMENT) { 8620 var A = "visited_" + (g ? "out" : "in"); 8621 if (a.getCustomData(A)) return; 8622 CKEDITOR.dom.element.setMarker(p, a, A, 1) 8623 } 8624 if (g && h && a.equals(h)) f = c.clone(), f.setEndAt(h, CKEDITOR.POSITION_BEFORE_END), e.push(f); 8625 else if (!g && k && a.equals(k)) f = c.clone(), f.setStartAt(k, CKEDITOR.POSITION_AFTER_START), e.push(f); 8626 else { 8627 if (A = !g) A = a.type == CKEDITOR.NODE_ELEMENT && a.is(d) && (!h || b(a, h)) && (!k || 8628 b(a, k)); 8629 if (!A && (A = g)) 8630 if (a.is(d)) var A = h && h.getAscendant("table", !0), 8631 l = k && k.getAscendant("table", !0), 8632 H = a.getAscendant("table", !0), 8633 A = A && A.contains(H) || l && l.contains(H); 8634 else A = void 0; 8635 A && (f = c.clone(), f.selectNodeContents(a), e.push(f)) 8636 } 8637 }; 8638 g.lastForward(); 8639 CKEDITOR.dom.element.clearAllMarkers(p); 8640 return e 8641 } 8642 8643 function b(a, c) { 8644 var d = CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_IS_CONTAINED, 8645 e = a.getPosition(c); 8646 return e === CKEDITOR.POSITION_IDENTICAL ? !1 : 0 === (e & d) 8647 } 8648 var d = { 8649 td: 1, 8650 th: 1, 8651 caption: 1 8652 }; 8653 return { 8654 detectPurge: function(a) { 8655 var b = 8656 a.range, 8657 c = b.clone(); 8658 c.enlarge(CKEDITOR.ENLARGE_ELEMENT); 8659 var c = new CKEDITOR.dom.walker(c), 8660 e = 0; 8661 c.evaluator = function(a) { 8662 a.type == CKEDITOR.NODE_ELEMENT && a.is(d) && ++e 8663 }; 8664 c.checkForward(); 8665 if (1 < e) { 8666 var c = b.startPath().contains("table"), 8667 f = b.endPath().contains("table"); 8668 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()) 8669 } 8670 }, 8671 detectRanges: function(e, f) { 8672 var g = c(f, e.bookmark), 8673 h = g.clone(), 8674 k, l, p = g.getCommonAncestor(); 8675 p.is(CKEDITOR.dtd.$tableContent) && !p.is(d) && (p = p.getAscendant("table", !0)); 8676 l = p; 8677 p = new CKEDITOR.dom.elementPath(g.startContainer, l); 8678 l = new CKEDITOR.dom.elementPath(g.endContainer, l); 8679 p = p.contains("table"); 8680 l = l.contains("table"); 8681 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), 8682 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) 8683 }, 8684 deleteRanges: function(a) { 8685 for (var b; b = a.tableContentsRanges.pop();) b.extractContents(), v(b.startContainer) && b.startContainer.appendBogus(); 8686 a.tableSurroundingRange && a.tableSurroundingRange.extractContents() 8687 }, 8688 purge: function(a) { 8689 if (a.purgeTableBookmark) { 8690 var b = 8691 a.doc, 8692 c = a.range.clone(), 8693 b = b.createElement("p"); 8694 b.insertBefore(a.purgeTableBookmark.startNode); 8695 c.moveToBookmark(a.purgeTableBookmark); 8696 c.deleteContents(); 8697 a.range.moveToPosition(b, CKEDITOR.POSITION_AFTER_START) 8698 } 8699 } 8700 } 8701 }(), 8702 detectExtractMerge: function(a) { 8703 return !(a.range.startPath().contains(CKEDITOR.dtd.$listItem) && a.range.endPath().contains(CKEDITOR.dtd.$listItem)) 8704 }, 8705 fixUneditableRangePosition: function(a) { 8706 a.startContainer.getDtd()["#"] || a.moveToClosestEditablePosition(null, !0) 8707 }, 8708 autoParagraph: function(a, b) { 8709 var c = 8710 b.startPath(), 8711 d; 8712 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)) 8713 } 8714 } 8715 }() 8716 })(); 8717 (function() { 8718 function a(a) { 8719 return CKEDITOR.plugins.widget && CKEDITOR.plugins.widget.isDomWidget(a) 8720 } 8721 8722 function d(b, c) { 8723 if (0 === b.length || a(b[0].getEnclosedNode())) return !1; 8724 var d, e; 8725 if ((d = !c && 1 === b.length) && !(d = b[0].collapsed)) { 8726 var f = b[0]; 8727 d = f.startContainer.getAscendant({ 8728 td: 1, 8729 th: 1 8730 }, !0); 8731 var g = f.endContainer.getAscendant({ 8732 td: 1, 8733 th: 1 8734 }, !0); 8735 e = CKEDITOR.tools.trim; 8736 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 8737 } 8738 if (d) return !1; 8739 for (e = 0; e < b.length; e++) 8740 if (d = b[e]._getTableElement(), !d) return !1; 8741 return !0 8742 } 8743 8744 function b(a) { 8745 function b(a) { 8746 a = a.find("td, th"); 8747 var c = [], 8748 d; 8749 for (d = 0; d < a.count(); d++) c.push(a.getItem(d)); 8750 return c 8751 } 8752 var c = [], 8753 d, e; 8754 for (e = 0; e < a.length; e++) d = a[e]._getTableElement(), d.is && d.is({ 8755 td: 1, 8756 th: 1 8757 }) ? c.push(d) : c = c.concat(b(d)); 8758 return c 8759 } 8760 8761 function c(a) { 8762 a = b(a); 8763 var c = "", 8764 d = [], 8765 e, f; 8766 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()); 8767 return c += d.join("\t") 8768 } 8769 8770 function f(a) { 8771 var b = this.root.editor, 8772 d = b.getSelection(1); 8773 this.reset(); 8774 l = !0; 8775 d.root.once("selectionchange", function(a) { 8776 a.cancel() 8777 }, null, null, 0); 8778 d.selectRanges([a[0]]); 8779 d = this._.cache; 8780 d.ranges = new CKEDITOR.dom.rangeList(a); 8781 d.type = CKEDITOR.SELECTION_TEXT; 8782 d.selectedElement = a[0]._getTableElement(); 8783 d.selectedText = c(a); 8784 d.nativeSel = null; 8785 this.isFake = 1; 8786 this.rev = J++; 8787 b._.fakeSelection = this; 8788 l = !1; 8789 this.root.fire("selectionchange") 8790 } 8791 8792 function h() { 8793 var b = this._.fakeSelection, 8794 c; 8795 if (b) { 8796 c = this.getSelection(1); 8797 var e; 8798 if (!(e = !c) && (e = !c.isHidden())) { 8799 e = b; 8800 var f = c.getRanges(), 8801 g = e.getRanges(), 8802 h = f.length && f[0]._getTableElement() && f[0]._getTableElement().getAscendant("table", !0), 8803 p = g.length && g[0]._getTableElement() && g[0]._getTableElement().getAscendant("table", !0), 8804 k = 1 === f.length && f[0]._getTableElement() && f[0]._getTableElement().is("table"), 8805 w = 1 === g.length && g[0]._getTableElement() && g[0]._getTableElement().is("table"); 8806 if (a(e.getSelectedElement())) e = !1; 8807 else { 8808 var l = 1 === f.length && f[0].collapsed, 8809 g = d(f, !!CKEDITOR.env.webkit) && 8810 d(g); 8811 h = h && p ? h.equals(p) || p.contains(h) : !1; 8812 h && (l || g) ? (k && !w && e.selectRanges(f), e = !0) : e = !1 8813 } 8814 e = !e 8815 } 8816 e && (b.reset(), b = 0) 8817 } 8818 if (!b && (b = c || this.getSelection(1), !b || b.getType() == CKEDITOR.SELECTION_NONE)) return; 8819 this.fire("selectionCheck", b); 8820 c = this.elementPath(); 8821 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", { 8822 selection: b, 8823 path: c 8824 })) 8825 } 8826 8827 function k() { 8828 F = !0; 8829 t || (g.call(this), t = CKEDITOR.tools.setTimeout(g, 200, this)) 8830 } 8831 8832 function g() { 8833 t = null; 8834 F && (CKEDITOR.tools.setTimeout(h, 0, this), F = !1) 8835 } 8836 8837 function n(a) { 8838 return L(a) || a.type == CKEDITOR.NODE_ELEMENT && !a.is(CKEDITOR.dtd.$empty) ? !0 : !1 8839 } 8840 8841 function r(a) { 8842 function b(c, d) { 8843 return c && c.type != CKEDITOR.NODE_TEXT ? a.clone()["moveToElementEdit" + (d ? "End" : "Start")](c) : !1 8844 } 8845 if (!(a.root instanceof CKEDITOR.editable)) return !1; 8846 var c = a.startContainer, 8847 d = a.getPreviousNode(n, null, c), 8848 e = a.getNextNode(n, null, 8849 c); 8850 return b(d) || b(e, 1) || !(d || e || c.type == CKEDITOR.NODE_ELEMENT && c.isBlockBoundary() && c.getBogus()) ? !0 : !1 8851 } 8852 8853 function e(a) { 8854 y(a, !1); 8855 var b = a.getDocument().createText(u); 8856 a.setCustomData("cke-fillingChar", b); 8857 return b 8858 } 8859 8860 function y(a, b) { 8861 var c = a && a.removeCustomData("cke-fillingChar"); 8862 if (c) { 8863 if (!1 !== b) { 8864 var d = a.getDocument().getSelection().getNative(), 8865 e = d && "None" != d.type && d.getRangeAt(0), 8866 f = u.length; 8867 if (c.getLength() > f && e && e.intersectsNode(c.$)) { 8868 var g = [{ 8869 node: d.anchorNode, 8870 offset: d.anchorOffset 8871 }, { 8872 node: d.focusNode, 8873 offset: d.focusOffset 8874 }]; 8875 d.anchorNode == c.$ && d.anchorOffset > f && (g[0].offset -= f); 8876 d.focusNode == c.$ && d.focusOffset > f && (g[1].offset -= f) 8877 } 8878 } 8879 c.setText(v(c.getText(), 1)); 8880 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)) 8881 } 8882 } 8883 8884 function v(a, b) { 8885 return b ? a.replace(K, function(a, b) { 8886 return b ? " " : "" 8887 }) : a.replace(u, "") 8888 } 8889 8890 function B(a, b) { 8891 var c = b && CKEDITOR.tools.htmlEncode(b) || "\x26nbsp;", 8892 c = CKEDITOR.dom.element.createFromHtml('\x3cdiv data-cke-hidden-sel\x3d"1" data-cke-temp\x3d"1" style\x3d"' + 8893 (CKEDITOR.env.ie && 14 > CKEDITOR.env.version ? "display:none" : "position:fixed;top:0;left:-1000px") + '"\x3e' + c + "\x3c/div\x3e", a.document); 8894 a.fire("lockSnapshot"); 8895 a.editable().append(c); 8896 var d = a.getSelection(1), 8897 e = a.createRange(), 8898 f = d.root.on("selectionchange", function(a) { 8899 a.cancel() 8900 }, null, null, 0); 8901 e.setStartAt(c, CKEDITOR.POSITION_AFTER_START); 8902 e.setEndAt(c, CKEDITOR.POSITION_BEFORE_END); 8903 d.selectRanges([e]); 8904 f.removeListener(); 8905 a.fire("unlockSnapshot"); 8906 a._.hiddenSelectionContainer = c 8907 } 8908 8909 function D(a) { 8910 var b = { 8911 37: 1, 8912 39: 1, 8913 8: 1, 8914 46: 1 8915 }; 8916 return function(c) { 8917 var d = c.data.getKeystroke(); 8918 if (b[d]) { 8919 var e = a.getSelection().getRanges(), 8920 f = e[0]; 8921 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()) 8922 } 8923 } 8924 } 8925 8926 function x(a) { 8927 for (var b = 0; b < a.length; b++) { 8928 var c = a[b]; 8929 c.getCommonAncestor().isReadOnly() && a.splice(b, 1); 8930 if (!c.collapsed) { 8931 if (c.startContainer.isReadOnly()) 8932 for (var d = c.startContainer, 8933 e; d && !((e = d.type == CKEDITOR.NODE_ELEMENT) && d.is("body") || !d.isReadOnly());) e && "false" == d.getAttribute("contentEditable") && c.setStartAfter(d), d = d.getParent(); 8934 d = c.startContainer; 8935 e = c.endContainer; 8936 var f = c.startOffset, 8937 g = c.endOffset, 8938 h = c.clone(); 8939 d && d.type == CKEDITOR.NODE_TEXT && (f >= d.getLength() ? h.setStartAfter(d) : h.setStartBefore(d)); 8940 e && e.type == CKEDITOR.NODE_TEXT && (g ? h.setEndAfter(e) : h.setEndBefore(e)); 8941 d = new CKEDITOR.dom.walker(h); 8942 d.evaluator = function(d) { 8943 if (d.type == CKEDITOR.NODE_ELEMENT && d.isReadOnly()) { 8944 var e = 8945 c.clone(); 8946 c.setEndBefore(d); 8947 c.collapsed && a.splice(b--, 1); 8948 d.getPosition(h.endContainer) & CKEDITOR.POSITION_CONTAINS || (e.setStartAfter(d), e.collapsed || a.splice(b + 1, 0, e)); 8949 return !0 8950 } 8951 return !1 8952 }; 8953 d.next() 8954 } 8955 } 8956 return a 8957 } 8958 var m = "function" != typeof window.getSelection, 8959 J = 1, 8960 u = CKEDITOR.tools.repeat("", 7), 8961 K = new RegExp(u + "( )?", "g"), 8962 l, t, F, L = CKEDITOR.dom.walker.invisible(1), 8963 C = function() { 8964 function a(b) { 8965 return function(a) { 8966 var c = a.editor.createRange(); 8967 c.moveToClosestEditablePosition(a.selected, b) && a.editor.getSelection().selectRanges([c]); 8968 return !1 8969 } 8970 } 8971 8972 function b(a) { 8973 return function(b) { 8974 var c = b.editor, 8975 d = c.createRange(), 8976 e; 8977 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 8978 } 8979 } 8980 var c = a(), 8981 d = a(1); 8982 return { 8983 37: c, 8984 38: c, 8985 39: d, 8986 40: d, 8987 8: b(), 8988 46: b(1) 8989 } 8990 }(); 8991 CKEDITOR.on("instanceCreated", function(a) { 8992 function b() { 8993 var a = 8994 c.getSelection(); 8995 a && a.removeAllRanges() 8996 } 8997 var c = a.editor; 8998 c.on("contentDom", function() { 8999 function a() { 9000 r = new CKEDITOR.dom.selection(c.getSelection()); 9001 r.lock() 9002 } 9003 9004 function b() { 9005 f.removeListener("mouseup", b); 9006 q.removeListener("mouseup", b); 9007 var a = CKEDITOR.document.$.selection, 9008 c = a.createRange(); 9009 "None" != a.type && c.parentElement() && c.parentElement().ownerDocument == e.$ && c.select() 9010 } 9011 9012 function d(a) { 9013 a = a.getRanges()[0]; 9014 return a ? (a = a.startContainer.getAscendant(function(a) { 9015 return a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("contenteditable") 9016 }, 9017 !0)) && "false" === a.getAttribute("contenteditable") ? a : null : null 9018 } 9019 var e = c.document, 9020 f = CKEDITOR.document, 9021 g = c.editable(), 9022 l = e.getBody(), 9023 q = e.getDocumentElement(), 9024 E = g.isInline(), 9025 n, r; 9026 CKEDITOR.env.gecko && g.attachListener(g, "focus", function(a) { 9027 a.removeListener(); 9028 0 !== n && (a = c.getSelection().getNative()) && a.isCollapsed && a.anchorNode == g.$ && (a = c.createRange(), a.moveToElementEditStart(g), a.select()) 9029 }, null, null, -2); 9030 g.attachListener(g, CKEDITOR.env.webkit ? "DOMFocusIn" : "focus", function() { 9031 n && CKEDITOR.env.webkit && (n = c._.previousActive && 9032 c._.previousActive.equals(e.getActive())) && null != c._.previousScrollTop && c._.previousScrollTop != g.$.scrollTop && (g.$.scrollTop = c._.previousScrollTop); 9033 c.unlockSelection(n); 9034 n = 0 9035 }, null, null, -1); 9036 g.attachListener(g, "mousedown", function() { 9037 n = 0 9038 }); 9039 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() { 9040 c.lockSelection(r); 9041 n = 1 9042 }, null, null, -1), g.attachListener(g, "mousedown", 9043 function() { 9044 n = 0 9045 }); 9046 if (CKEDITOR.env.ie && !E) { 9047 var v; 9048 g.attachListener(g, "mousedown", function(a) { 9049 2 == a.data.$.button && ((a = c.document.getSelection()) && a.getType() != CKEDITOR.SELECTION_NONE || (v = c.window.getScrollPosition())) 9050 }); 9051 g.attachListener(g, "mouseup", function(a) { 9052 2 == a.data.$.button && v && (c.document.$.documentElement.scrollLeft = v.x, c.document.$.documentElement.scrollTop = v.y); 9053 v = null 9054 }); 9055 if ("BackCompat" != e.$.compatMode) { 9056 if (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) { 9057 var t, u; 9058 q.on("mousedown", function(a) { 9059 function b(a) { 9060 a = 9061 a.data.$; 9062 if (t) { 9063 var c = l.$.createTextRange(); 9064 try { 9065 c.moveToPoint(a.clientX, a.clientY) 9066 } catch (d) {} 9067 t.setEndPoint(0 > u.compareEndPoints("StartToStart", c) ? "EndToEnd" : "StartToStart", c); 9068 t.select() 9069 } 9070 } 9071 9072 function c() { 9073 q.removeListener("mousemove", b); 9074 f.removeListener("mouseup", c); 9075 q.removeListener("mouseup", c); 9076 t.select() 9077 } 9078 a = a.data; 9079 if (a.getTarget().is("html") && a.$.y < q.$.clientHeight && a.$.x < q.$.clientWidth) { 9080 t = l.$.createTextRange(); 9081 try { 9082 t.moveToPoint(a.$.clientX, a.$.clientY) 9083 } catch (d) {} 9084 u = t.duplicate(); 9085 q.on("mousemove", b); 9086 f.on("mouseup", 9087 c); 9088 q.on("mouseup", c) 9089 } 9090 }) 9091 } 9092 if (7 < CKEDITOR.env.version && 11 > CKEDITOR.env.version) q.on("mousedown", function(a) { 9093 a.data.getTarget().is("html") && (f.on("mouseup", b), q.on("mouseup", b)) 9094 }) 9095 } 9096 } 9097 g.attachListener(g, "selectionchange", h, c); 9098 g.attachListener(g, "keyup", k, c); 9099 CKEDITOR.env.ie && g.attachListener(g, "keydown", function(a) { 9100 var b = this.getSelection(1), 9101 c = d(b); 9102 c && !c.equals(g) && (b.selectElement(c), a.data.preventDefault()) 9103 }, c); 9104 g.attachListener(g, CKEDITOR.env.webkit ? "DOMFocusIn" : "focus", function() { 9105 c.forceNextSelectionCheck(); 9106 c.selectionChange(1) 9107 }); 9108 if (E && (CKEDITOR.env.webkit || CKEDITOR.env.gecko)) { 9109 var x; 9110 g.attachListener(g, "mousedown", function() { 9111 x = 1 9112 }); 9113 g.attachListener(e.getDocumentElement(), "mouseup", function() { 9114 x && k.call(c); 9115 x = 0 9116 }) 9117 } else g.attachListener(CKEDITOR.env.ie ? g : e.getDocumentElement(), "mouseup", k, c); 9118 CKEDITOR.env.webkit && g.attachListener(e, "keydown", function(a) { 9119 switch (a.data.getKey()) { 9120 case 13: 9121 case 33: 9122 case 34: 9123 case 35: 9124 case 36: 9125 case 37: 9126 case 39: 9127 case 8: 9128 case 45: 9129 case 46: 9130 g.hasFocus && y(g) 9131 } 9132 }, null, null, -1); 9133 g.attachListener(g, 9134 "keydown", D(c), null, null, -1) 9135 }); 9136 c.on("setData", function() { 9137 c.unlockSelection(); 9138 CKEDITOR.env.webkit && b() 9139 }); 9140 c.on("contentDomUnload", function() { 9141 c.unlockSelection() 9142 }); 9143 if (CKEDITOR.env.ie9Compat) c.on("beforeDestroy", b, null, null, 9); 9144 c.on("dataReady", function() { 9145 delete c._.fakeSelection; 9146 delete c._.hiddenSelectionContainer; 9147 c.selectionChange(1) 9148 }); 9149 c.on("loadSnapshot", function() { 9150 var a = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT), 9151 b = c.editable().getLast(a); 9152 b && b.hasAttribute("data-cke-hidden-sel") && (b.remove(), 9153 CKEDITOR.env.gecko && (a = c.editable().getFirst(a)) && a.is("br") && a.getAttribute("_moz_editor_bogus_node") && a.remove()) 9154 }, null, null, 100); 9155 c.on("key", function(a) { 9156 if ("wysiwyg" == c.mode) { 9157 var b = c.getSelection(); 9158 if (b.isFake) { 9159 var d = C[a.data.keyCode]; 9160 if (d) return d({ 9161 editor: c, 9162 selected: b.getSelectedElement(), 9163 selection: b, 9164 keyEvent: a 9165 }) 9166 } 9167 } 9168 }) 9169 }); 9170 if (CKEDITOR.env.webkit) CKEDITOR.on("instanceReady", function(a) { 9171 var b = a.editor; 9172 b.on("selectionChange", function() { 9173 var a = b.editable(), 9174 c = a.getCustomData("cke-fillingChar"); 9175 c && (c.getCustomData("ready") ? 9176 (y(a), a.editor.fire("selectionCheck")) : c.setCustomData("ready", 1)) 9177 }, null, null, -1); 9178 b.on("beforeSetMode", function() { 9179 y(b.editable()) 9180 }, null, null, -1); 9181 b.on("getSnapshot", function(a) { 9182 a.data && (a.data = v(a.data)) 9183 }, b, null, 20); 9184 b.on("toDataFormat", function(a) { 9185 a.data.dataValue = v(a.data.dataValue) 9186 }, null, null, 0) 9187 }); 9188 CKEDITOR.editor.prototype.selectionChange = function(a) { 9189 (a ? h : k).call(this) 9190 }; 9191 CKEDITOR.editor.prototype.getSelection = function(a) { 9192 return !this._.savedSelection && !this._.fakeSelection || a ? (a = this.editable()) && 9193 "wysiwyg" == this.mode ? new CKEDITOR.dom.selection(a) : null : this._.savedSelection || this._.fakeSelection 9194 }; 9195 CKEDITOR.editor.prototype.lockSelection = function(a) { 9196 a = a || this.getSelection(1); 9197 return a.getType() != CKEDITOR.SELECTION_NONE ? (!a.isLocked && a.lock(), this._.savedSelection = a, !0) : !1 9198 }; 9199 CKEDITOR.editor.prototype.unlockSelection = function(a) { 9200 var b = this._.savedSelection; 9201 return b ? (b.unlock(a), delete this._.savedSelection, !0) : !1 9202 }; 9203 CKEDITOR.editor.prototype.forceNextSelectionCheck = function() { 9204 delete this._.selectionPreviousPath 9205 }; 9206 CKEDITOR.dom.document.prototype.getSelection = function() { 9207 return new CKEDITOR.dom.selection(this) 9208 }; 9209 CKEDITOR.dom.range.prototype.select = function() { 9210 var a = this.root instanceof CKEDITOR.editable ? this.root.editor.getSelection() : new CKEDITOR.dom.selection(this.root); 9211 a.selectRanges([this]); 9212 return a 9213 }; 9214 CKEDITOR.SELECTION_NONE = 1; 9215 CKEDITOR.SELECTION_TEXT = 2; 9216 CKEDITOR.SELECTION_ELEMENT = 3; 9217 CKEDITOR.dom.selection = function(a) { 9218 if (a instanceof CKEDITOR.dom.selection) { 9219 var b = a; 9220 a = a.root 9221 } 9222 var c = a instanceof CKEDITOR.dom.element; 9223 this.rev = b ? b.rev : J++; 9224 this.document = a instanceof CKEDITOR.dom.document ? a : a.getDocument(); 9225 this.root = c ? a : this.document.getBody(); 9226 this.isLocked = 0; 9227 this._ = { 9228 cache: {} 9229 }; 9230 if (b) return CKEDITOR.tools.extend(this._.cache, b._.cache), this.isFake = b.isFake, this.isLocked = b.isLocked, this; 9231 a = this.getNative(); 9232 var d, e; 9233 if (a) 9234 if (a.getRangeAt) d = (e = a.rangeCount && a.getRangeAt(0)) && new CKEDITOR.dom.node(e.commonAncestorContainer); 9235 else { 9236 try { 9237 e = a.createRange() 9238 } catch (f) {} 9239 d = e && CKEDITOR.dom.element.get(e.item && e.item(0) || e.parentElement()) 9240 } if (!d || 9241 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; 9242 return this 9243 }; 9244 var M = { 9245 img: 1, 9246 hr: 1, 9247 li: 1, 9248 table: 1, 9249 tr: 1, 9250 td: 1, 9251 th: 1, 9252 embed: 1, 9253 object: 1, 9254 ol: 1, 9255 ul: 1, 9256 a: 1, 9257 input: 1, 9258 form: 1, 9259 select: 1, 9260 textarea: 1, 9261 button: 1, 9262 fieldset: 1, 9263 thead: 1, 9264 tfoot: 1 9265 }; 9266 CKEDITOR.tools.extend(CKEDITOR.dom.selection, { 9267 _removeFillingCharSequenceString: v, 9268 _createFillingCharSequenceNode: e, 9269 FILLING_CHAR_SEQUENCE: u 9270 }); 9271 CKEDITOR.dom.selection.prototype = { 9272 getNative: function() { 9273 return void 0 !== this._.cache.nativeSel ? this._.cache.nativeSel : this._.cache.nativeSel = m ? this.document.$.selection : this.document.getWindow().$.getSelection() 9274 }, 9275 getType: m ? function() { 9276 var a = this._.cache; 9277 if (a.type) return a.type; 9278 var b = CKEDITOR.SELECTION_NONE; 9279 try { 9280 var c = this.getNative(), 9281 d = c.type; 9282 "Text" == d && (b = CKEDITOR.SELECTION_TEXT); 9283 "Control" == d && (b = CKEDITOR.SELECTION_ELEMENT); 9284 c.createRange().parentElement() && 9285 (b = CKEDITOR.SELECTION_TEXT) 9286 } catch (e) {} 9287 return a.type = b 9288 } : function() { 9289 var a = this._.cache; 9290 if (a.type) return a.type; 9291 var b = CKEDITOR.SELECTION_TEXT, 9292 c = this.getNative(); 9293 if (!c || !c.rangeCount) b = CKEDITOR.SELECTION_NONE; 9294 else if (1 == c.rangeCount) { 9295 var c = c.getRangeAt(0), 9296 d = c.startContainer; 9297 d == c.endContainer && 1 == d.nodeType && 1 == c.endOffset - c.startOffset && M[d.childNodes[c.startOffset].nodeName.toLowerCase()] && (b = CKEDITOR.SELECTION_ELEMENT) 9298 } 9299 return a.type = b 9300 }, 9301 getRanges: function() { 9302 var a = m ? function() { 9303 function a(b) { 9304 return (new CKEDITOR.dom.node(b)).getIndex() 9305 } 9306 var b = function(b, c) { 9307 b = b.duplicate(); 9308 b.collapse(c); 9309 var d = b.parentElement(); 9310 if (!d.hasChildNodes()) return { 9311 container: d, 9312 offset: 0 9313 }; 9314 for (var e = d.children, f, g, h = b.duplicate(), k = 0, l = e.length - 1, q = -1, m, n; k <= l;) 9315 if (q = Math.floor((k + l) / 2), f = e[q], h.moveToElementText(f), m = h.compareEndPoints("StartToStart", b), 0 < m) l = q - 1; 9316 else if (0 > m) k = q + 1; 9317 else return { 9318 container: d, 9319 offset: a(f) 9320 }; 9321 if (-1 == q || q == e.length - 1 && 0 > m) { 9322 h.moveToElementText(d); 9323 h.setEndPoint("StartToStart", b); 9324 h = h.text.replace(/(\r\n|\r)/g, "\n").length; 9325 e = d.childNodes; 9326 if (!h) return f = 9327 e[e.length - 1], f.nodeType != CKEDITOR.NODE_TEXT ? { 9328 container: d, 9329 offset: e.length 9330 } : { 9331 container: f, 9332 offset: f.nodeValue.length 9333 }; 9334 for (d = e.length; 0 < h && 0 < d;) g = e[--d], g.nodeType == CKEDITOR.NODE_TEXT && (n = g, h -= g.nodeValue.length); 9335 return { 9336 container: n, 9337 offset: -h 9338 } 9339 } 9340 h.collapse(0 < m ? !0 : !1); 9341 h.setEndPoint(0 < m ? "StartToStart" : "EndToStart", b); 9342 h = h.text.replace(/(\r\n|\r)/g, "\n").length; 9343 if (!h) return { 9344 container: d, 9345 offset: a(f) + (0 < m ? 0 : 1) 9346 }; 9347 for (; 0 < h;) try { 9348 g = f[0 < m ? "previousSibling" : "nextSibling"], g.nodeType == CKEDITOR.NODE_TEXT && (h -= g.nodeValue.length, 9349 n = g), f = g 9350 } catch (r) { 9351 return { 9352 container: d, 9353 offset: a(f) 9354 } 9355 } 9356 return { 9357 container: n, 9358 offset: 0 < m ? -h : n.nodeValue.length + h 9359 } 9360 }; 9361 return function() { 9362 var a = this.getNative(), 9363 c = a && a.createRange(), 9364 d = this.getType(); 9365 if (!a) return []; 9366 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() && 9367 a.collapse(), [a]; 9368 if (d == CKEDITOR.SELECTION_ELEMENT) { 9369 for (var d = [], e = 0; e < c.length; e++) { 9370 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++); 9371 a.setStart(new CKEDITOR.dom.node(g), h); 9372 a.setEnd(new CKEDITOR.dom.node(g), h + 1); 9373 d.push(a) 9374 } 9375 return d 9376 } 9377 return [] 9378 } 9379 }() : function() { 9380 var a = [], 9381 b, c = this.getNative(); 9382 if (!c) return a; 9383 for (var d = 0; d < c.rangeCount; d++) { 9384 var e = c.getRangeAt(d); 9385 b = new CKEDITOR.dom.range(this.root); 9386 b.setStart(new CKEDITOR.dom.node(e.startContainer), 9387 e.startOffset); 9388 b.setEnd(new CKEDITOR.dom.node(e.endContainer), e.endOffset); 9389 a.push(b) 9390 } 9391 return a 9392 }; 9393 return function(b) { 9394 var c = this._.cache, 9395 d = c.ranges; 9396 d || (c.ranges = d = new CKEDITOR.dom.rangeList(a.call(this))); 9397 return b ? x(new CKEDITOR.dom.rangeList(d.slice())) : d 9398 } 9399 }(), 9400 getStartElement: function() { 9401 var a = this._.cache; 9402 if (void 0 !== a.startElement) return a.startElement; 9403 var b; 9404 switch (this.getType()) { 9405 case CKEDITOR.SELECTION_ELEMENT: 9406 return this.getSelectedElement(); 9407 case CKEDITOR.SELECTION_TEXT: 9408 var c = this.getRanges()[0]; 9409 if (c) { 9410 if (c.collapsed) b = c.startContainer, b.type != CKEDITOR.NODE_ELEMENT && (b = b.getParent()); 9411 else { 9412 for (c.optimize(); b = c.startContainer, c.startOffset == (b.getChildCount ? b.getChildCount() : b.getLength()) && !b.isBlockBoundary();) c.setStartAfter(b); 9413 b = c.startContainer; 9414 if (b.type != CKEDITOR.NODE_ELEMENT) return b.getParent(); 9415 if ((b = b.getChild(c.startOffset)) && b.type == CKEDITOR.NODE_ELEMENT) 9416 for (c = b.getFirst(); c && c.type == CKEDITOR.NODE_ELEMENT;) b = c, c = c.getFirst(); 9417 else b = c.startContainer 9418 } 9419 b = b.$ 9420 } 9421 } 9422 return a.startElement = b ? 9423 new CKEDITOR.dom.element(b) : null 9424 }, 9425 getSelectedElement: function() { 9426 var a = this._.cache; 9427 if (void 0 !== a.selectedElement) return a.selectedElement; 9428 var b = this, 9429 c = CKEDITOR.tools.tryThese(function() { 9430 return b.getNative().createRange().item(0) 9431 }, function() { 9432 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); 9433 return d && d.$ 9434 }); 9435 return a.selectedElement = c ? new CKEDITOR.dom.element(c) : null 9436 }, 9437 getSelectedText: function() { 9438 var a = 9439 this._.cache; 9440 if (void 0 !== a.selectedText) return a.selectedText; 9441 var b = this.getNative(), 9442 b = m ? "Control" == b.type ? "" : b.createRange().text : b.toString(); 9443 return a.selectedText = b 9444 }, 9445 lock: function() { 9446 this.getRanges(); 9447 this.getStartElement(); 9448 this.getSelectedElement(); 9449 this.getSelectedText(); 9450 this._.cache.nativeSel = null; 9451 this.isLocked = 1 9452 }, 9453 unlock: function(a) { 9454 if (this.isLocked) { 9455 if (a) var b = this.getSelectedElement(), 9456 c = this.getRanges(), 9457 e = this.isFake; 9458 this.isLocked = 0; 9459 this.reset(); 9460 a && (a = b || c[0] && c[0].getCommonAncestor()) && a.getAscendant("body", 9461 1) && (d(c) ? f.call(this, c) : e ? this.fake(b) : b ? this.selectElement(b) : this.selectRanges(c)) 9462 } 9463 }, 9464 reset: function() { 9465 this._.cache = {}; 9466 this.isFake = 0; 9467 var a = this.root.editor; 9468 if (a && a._.fakeSelection) 9469 if (this.rev == a._.fakeSelection.rev) { 9470 delete a._.fakeSelection; 9471 var b = a._.hiddenSelectionContainer; 9472 if (b) { 9473 var c = a.checkDirty(); 9474 a.fire("lockSnapshot"); 9475 b.remove(); 9476 a.fire("unlockSnapshot"); 9477 !c && a.resetDirty() 9478 } 9479 delete a._.hiddenSelectionContainer 9480 } else CKEDITOR.warn("selection-fake-reset"); 9481 this.rev = J++ 9482 }, 9483 selectElement: function(a) { 9484 var b = 9485 new CKEDITOR.dom.range(this.root); 9486 b.setStartBefore(a); 9487 b.setEndAfter(a); 9488 this.selectRanges([b]) 9489 }, 9490 selectRanges: function(a) { 9491 var b = this.root.editor, 9492 c = b && b._.hiddenSelectionContainer; 9493 this.reset(); 9494 if (c) 9495 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())); 9496 if (a.length) 9497 if (this.isLocked) { 9498 var k = CKEDITOR.document.getActive(); 9499 this.unlock(); 9500 this.selectRanges(a); 9501 this.lock(); 9502 k && !k.equals(this.root) && k.focus() 9503 } else { 9504 var p; 9505 a: { 9506 var n, w; 9507 if (1 == a.length && 9508 !(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 9509 } 9510 if (p) this.fake(p); 9511 else if (b && b.plugins.tableselection && CKEDITOR.plugins.tableselection.isSupportedEnvironment && d(a) && !l) f.call(this, a); 9512 else { 9513 if (m) { 9514 n = CKEDITOR.dom.walker.whitespaces(!0); 9515 p = /\ufeff|\u00a0/; 9516 w = { 9517 table: 1, 9518 tbody: 1, 9519 tr: 1 9520 }; 9521 1 < a.length && (b = a[a.length - 9522 1], a[0].setEnd(b.endContainer, b.endOffset)); 9523 b = a[0]; 9524 a = b.collapsed; 9525 var A, G, I; 9526 if ((c = b.getEnclosedNode()) && c.type == CKEDITOR.NODE_ELEMENT && c.getName() in M && (!c.is("a") || !c.getText())) try { 9527 I = c.$.createControlRange(); 9528 I.addElement(c.$); 9529 I.select(); 9530 return 9531 } catch (v) {} 9532 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; 9533 I = b.createBookmark(); 9534 w = I.startNode; 9535 a || (k = I.endNode); 9536 I = b.document.$.body.createTextRange(); 9537 I.moveToElementText(w.$); 9538 I.moveStart("character", 1); 9539 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)); 9540 b.setStartBefore(w); 9541 w.remove(); 9542 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()) 9543 } else { 9544 k = this.getNative(); 9545 if (!k) return; 9546 this.removeAllRanges(); 9547 for (I = 0; I < a.length; I++) { 9548 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(), 9549 b.isReadOnly() || p && p.isReadOnly()))) { 9550 G.setStart(A.startContainer, A.startOffset); 9551 a.splice(I--, 1); 9552 continue 9553 } 9554 b = a[I]; 9555 G = this.document.$.createRange(); 9556 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)); 9557 G.setStart(b.startContainer.$, b.startOffset); 9558 try { 9559 G.setEnd(b.endContainer.$, b.endOffset) 9560 } catch (t) { 9561 if (0 <= 9562 t.toString().indexOf("NS_ERROR_ILLEGAL_VALUE")) b.collapse(1), G.setEnd(b.endContainer.$, b.endOffset); 9563 else throw t; 9564 } 9565 k.addRange(G) 9566 } 9567 } 9568 this.reset(); 9569 this.root.fire("selectionchange") 9570 } 9571 } 9572 }, 9573 fake: function(a, b) { 9574 var c = this.root.editor; 9575 void 0 === b && a.hasAttribute("aria-label") && (b = a.getAttribute("aria-label")); 9576 this.reset(); 9577 B(c, b); 9578 var d = this._.cache, 9579 e = new CKEDITOR.dom.range(this.root); 9580 e.setStartBefore(a); 9581 e.setEndAfter(a); 9582 d.ranges = new CKEDITOR.dom.rangeList(e); 9583 d.selectedElement = d.startElement = a; 9584 d.type = CKEDITOR.SELECTION_ELEMENT; 9585 d.selectedText = d.nativeSel = null; 9586 this.isFake = 1; 9587 this.rev = J++; 9588 c._.fakeSelection = this; 9589 this.root.fire("selectionchange") 9590 }, 9591 isHidden: function() { 9592 var a = this.getCommonAncestor(); 9593 a && a.type == CKEDITOR.NODE_TEXT && (a = a.getParent()); 9594 return !(!a || !a.data("cke-hidden-sel")) 9595 }, 9596 isInTable: function(a) { 9597 return d(this.getRanges(), a) 9598 }, 9599 isCollapsed: function() { 9600 var a = this.getRanges(); 9601 return 1 === a.length && a[0].collapsed 9602 }, 9603 createBookmarks: function(a) { 9604 a = this.getRanges().createBookmarks(a); 9605 this.isFake && (a.isFake = 1); 9606 return a 9607 }, 9608 createBookmarks2: function(a) { 9609 a = 9610 this.getRanges().createBookmarks2(a); 9611 this.isFake && (a.isFake = 1); 9612 return a 9613 }, 9614 selectBookmarks: function(a) { 9615 for (var b = [], c, e = 0; e < a.length; e++) { 9616 var f = new CKEDITOR.dom.range(this.root); 9617 f.moveToBookmark(a[e]); 9618 b.push(f) 9619 } 9620 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)); 9621 a.isFake && !d(b) ? this.fake(c) : this.selectRanges(b); 9622 return this 9623 }, 9624 getCommonAncestor: function() { 9625 var a = this.getRanges(); 9626 return a.length ? a[0].startContainer.getCommonAncestor(a[a.length - 9627 1].endContainer) : null 9628 }, 9629 scrollIntoView: function() { 9630 this.type != CKEDITOR.SELECTION_NONE && this.getRanges()[0].scrollIntoView() 9631 }, 9632 removeAllRanges: function() { 9633 if (this.getType() != CKEDITOR.SELECTION_NONE) { 9634 var a = this.getNative(); 9635 try { 9636 a && a[m ? "empty" : "removeAllRanges"]() 9637 } catch (b) {} 9638 this.reset() 9639 } 9640 } 9641 } 9642 })(); 9643 "use strict"; 9644 CKEDITOR.STYLE_BLOCK = 1; 9645 CKEDITOR.STYLE_INLINE = 2; 9646 CKEDITOR.STYLE_OBJECT = 3; 9647 (function() { 9648 function a(a, b) { 9649 for (var c, d; 9650 (a = a.getParent()) && !a.equals(b);) 9651 if (a.getAttribute("data-nostyle")) c = a; 9652 else if (!d) { 9653 var e = a.getAttribute("contentEditable"); 9654 "false" == e ? c = a : "true" == e && (d = 1) 9655 } 9656 return c 9657 } 9658 9659 function d(a, b, c, d) { 9660 return (a.getPosition(b) | d) == d && (!c.childRule || c.childRule(a)) 9661 } 9662 9663 function b(c) { 9664 var e = c.document; 9665 if (c.collapsed) e = J(this, e), c.insertNode(e), c.moveToPosition(e, CKEDITOR.POSITION_BEFORE_END); 9666 else { 9667 var g = this.element, 9668 h = this._.definition, 9669 k, l = h.ignoreReadonly, 9670 m = l || h.includeReadonly; 9671 null == 9672 m && (m = c.root.getCustomData("cke_includeReadonly")); 9673 var n = CKEDITOR.dtd[g]; 9674 n || (k = !0, n = CKEDITOR.dtd.span); 9675 c.enlarge(CKEDITOR.ENLARGE_INLINE, 1); 9676 c.trim(); 9677 var r = c.createBookmark(), 9678 v = r.startNode, 9679 t = r.endNode, 9680 q = v, 9681 u; 9682 if (!l) { 9683 var x = c.getCommonAncestor(), 9684 l = a(v, x), 9685 x = a(t, x); 9686 l && (q = l.getNextSourceNode(!0)); 9687 x && (t = x) 9688 } 9689 for (q.getPosition(t) == CKEDITOR.POSITION_FOLLOWING && (q = 0); q;) { 9690 l = !1; 9691 if (q.equals(t)) q = null, l = !0; 9692 else { 9693 var y = q.type == CKEDITOR.NODE_ELEMENT ? q.getName() : null, 9694 x = y && "false" == q.getAttribute("contentEditable"), 9695 B = y && 9696 q.getAttribute("data-nostyle"); 9697 if (y && q.data("cke-bookmark")) { 9698 q = q.getNextSourceNode(!0); 9699 continue 9700 } 9701 if (x && m && CKEDITOR.dtd.$block[y]) 9702 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) { 9703 var F = E[K], 9704 L = CKEDITOR.filter.instances[F.data("cke-filter")]; 9705 if (L ? L.check(this) : 1) C.selectNodeContents(F), b.call(this, C) 9706 } 9707 E = y ? !n[y] || B ? 0 : x && !m ? 0 : d(q, t, h, P) : 1; 9708 if (E) 9709 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; 9710 else { 9711 if (u || 9712 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()) { 9713 for (var y = q, M; 9714 (l = !y.getNext(z)) && (M = y.getParent(), n[M.getName()]) && d(M, v, h, O);) y = M; 9715 u.setEndAfter(y) 9716 } 9717 } 9718 else l = !0; 9719 q = q.getNextSourceNode(B || x) 9720 } 9721 if (l && u && !u.collapsed) { 9722 for (var l = J(this, e), x = l.hasAttributes(), B = u.getCommonAncestor(), y = {}, E = {}, F = {}, H = {}, U, R, aa; l && B;) { 9723 if (B.getName() == g) { 9724 for (U in h.attributes) !H[U] && (aa = B.getAttribute(R)) && 9725 (l.getAttribute(U) == aa ? E[U] = 1 : H[U] = 1); 9726 for (R in h.styles) !F[R] && (aa = B.getStyle(R)) && (l.getStyle(R) == aa ? y[R] = 1 : F[R] = 1) 9727 } 9728 B = B.getParent() 9729 } 9730 for (U in E) l.removeAttribute(U); 9731 for (R in y) l.removeStyle(R); 9732 x && !l.hasAttributes() && (l = null); 9733 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)); 9734 u = null 9735 } 9736 } 9737 c.moveToBookmark(r); 9738 c.shrink(CKEDITOR.SHRINK_TEXT); 9739 c.shrink(CKEDITOR.NODE_ELEMENT, !0) 9740 } 9741 } 9742 9743 function c(a) { 9744 function b() { 9745 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++) { 9746 var h = a.elements[g]; 9747 if (h == a.block || h == a.blockLimit) break; 9748 r.checkElementRemovable(h, !0) && (e = h) 9749 } 9750 for (g = 0; g < c.elements.length; g++) { 9751 h = c.elements[g]; 9752 if (h == c.block || h == c.blockLimit) break; 9753 r.checkElementRemovable(h, !0) && (f = h) 9754 } 9755 f && n.breakParent(f); 9756 e && d.breakParent(e) 9757 } 9758 a.enlarge(CKEDITOR.ENLARGE_INLINE, 1); 9759 var c = 9760 a.createBookmark(), 9761 d = c.startNode, 9762 e = this._.definition.alwaysRemoveElement; 9763 if (a.collapsed) { 9764 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++) 9765 if (this.checkElementRemovable(k)) { 9766 var m; 9767 !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()])) 9768 } if (g) { 9769 e = d; 9770 for (h = 9771 0;; h++) { 9772 k = f.elements[h]; 9773 if (k.equals(g)) break; 9774 else if (k.match) continue; 9775 else k = k.clone(); 9776 k.append(e); 9777 e = k 9778 } 9779 e["start" == g.match ? "insertBefore" : "insertAfter"](g) 9780 } 9781 } else { 9782 var n = c.endNode, 9783 r = this; 9784 b(); 9785 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 9786 } 9787 a.moveToBookmark(c); 9788 a.shrink(CKEDITOR.NODE_ELEMENT, !0) 9789 } 9790 9791 function f(a) { 9792 var b = []; 9793 a.forEach(function(a) { 9794 if ("true" == a.getAttribute("contenteditable")) return b.push(a), !1 9795 }, CKEDITOR.NODE_ELEMENT, !0); 9796 return b 9797 } 9798 9799 function h(a) { 9800 var b = a.getEnclosedNode() || a.getCommonAncestor(!1, !0); 9801 (a = (new CKEDITOR.dom.elementPath(b, a.root)).contains(this.element, 1)) && !a.isReadOnly() && u(a, this) 9802 } 9803 9804 function k(a) { 9805 var b = a.getCommonAncestor(!0, !0); 9806 if (a = (new CKEDITOR.dom.elementPath(b, a.root)).contains(this.element, 1)) { 9807 var b = this._.definition, 9808 c = b.attributes; 9809 if (c) 9810 for (var d in c) a.removeAttribute(d, c[d]); 9811 if (b.styles) 9812 for (var e in b.styles) b.styles.hasOwnProperty(e) && 9813 a.removeStyle(e) 9814 } 9815 } 9816 9817 function g(a) { 9818 var b = a.createBookmark(!0), 9819 c = a.createIterator(); 9820 c.enforceRealBlocks = !0; 9821 this._.enterMode && (c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR); 9822 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)); 9823 a.moveToBookmark(b) 9824 } 9825 9826 function n(a) { 9827 var b = a.createBookmark(1), 9828 c = a.createIterator(); 9829 c.enforceRealBlocks = !0; 9830 c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR; 9831 for (var d, e; d = c.getNextParagraph();) this.checkElementRemovable(d) && 9832 (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)); 9833 a.moveToBookmark(b) 9834 } 9835 9836 function r(a, b) { 9837 var c = !b; 9838 c && (b = a.getDocument().createElement("div"), a.copyAttributes(b)); 9839 var d = b && b.is("pre"), 9840 f = a.is("pre"), 9841 g = !d && f; 9842 if (d && !f) { 9843 f = b; 9844 (g = a.getBogus()) && g.remove(); 9845 g = a.getHtml(); 9846 g = y(g, /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, ""); 9847 g = g.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi, "$1"); 9848 g = g.replace(/([ \t\n\r]+| )/g, 9849 " "); 9850 g = g.replace(/<br\b[^>]*>/gi, "\n"); 9851 if (CKEDITOR.env.ie) { 9852 var h = a.getDocument().createElement("div"); 9853 h.append(f); 9854 f.$.outerHTML = "\x3cpre\x3e" + g + "\x3c/pre\x3e"; 9855 f.copyAttributes(h.getFirst()); 9856 f = h.getFirst().remove() 9857 } else f.setHtml(g); 9858 b = f 9859 } else g ? b = v(c ? [a.getHtml()] : e(a), b) : a.moveChildren(b); 9860 b.replace(a); 9861 if (d) { 9862 var c = b, 9863 k; 9864 (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" : 9865 c.setHtml(d), k.remove()) 9866 } else c && m(b) 9867 } 9868 9869 function e(a) { 9870 var b = []; 9871 y(a.getOuterHtml(), /(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi, function(a, b, c) { 9872 return b + "\x3c/pre\x3e" + c + "\x3cpre\x3e" 9873 }).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi, function(a, c) { 9874 b.push(c) 9875 }); 9876 return b 9877 } 9878 9879 function y(a, b, c) { 9880 var d = "", 9881 e = ""; 9882 a = a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi, function(a, b, c) { 9883 b && (d = b); 9884 c && (e = c); 9885 return "" 9886 }); 9887 return d + a.replace(b, c) + e 9888 } 9889 9890 function v(a, b) { 9891 var c; 9892 1 < a.length && (c = new CKEDITOR.dom.documentFragment(b.getDocument())); 9893 for (var d = 0; d < a.length; d++) { 9894 var e = a[d], 9895 e = e.replace(/(\r\n|\r)/g, "\n"), 9896 e = y(e, /^[ \t]*\n/, ""), 9897 e = y(e, /\n$/, ""), 9898 e = y(e, /^[ \t]+|[ \t]+$/g, function(a, b) { 9899 return 1 == a.length ? "\x26nbsp;" : b ? " " + CKEDITOR.tools.repeat("\x26nbsp;", a.length - 1) : CKEDITOR.tools.repeat("\x26nbsp;", a.length - 1) + " " 9900 }), 9901 e = e.replace(/\n/g, "\x3cbr\x3e"), 9902 e = e.replace(/[ \t]{2,}/g, function(a) { 9903 return CKEDITOR.tools.repeat("\x26nbsp;", a.length - 1) + " " 9904 }); 9905 if (c) { 9906 var f = b.clone(); 9907 f.setHtml(e); 9908 c.append(f) 9909 } else b.setHtml(e) 9910 } 9911 return c || b 9912 } 9913 9914 function B(a, b) { 9915 var c = this._.definition, 9916 d = c.attributes, 9917 c = c.styles, 9918 e = l(this)[a.getName()], 9919 f = CKEDITOR.tools.isEmpty(d) && CKEDITOR.tools.isEmpty(c), 9920 g; 9921 for (g in d) 9922 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)); 9923 for (var h in c) this._.definition.fullMatch && a.getStyle(h) != t(h, c[h], !0) || (f = f || !!a.getStyle(h), a.removeStyle(h)); 9924 x(a, e, C[a.getName()]); 9925 f && (this._.definition.alwaysRemoveElement ? 9926 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")) 9927 } 9928 9929 function D(a) { 9930 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); 9931 for (var f in b) 9932 if (f != this.element) 9933 for (c = a.getElementsByTag(f), e = c.count() - 1; 0 <= e; e--) d = c.getItem(e), d.isReadOnly() || x(d, b[f]) 9934 } 9935 9936 function x(a, b, c) { 9937 if (b = b && b.attributes) 9938 for (var d = 0; d < b.length; d++) { 9939 var e = b[d][0], 9940 f; 9941 if (f = a.getAttribute(e)) { 9942 var g = b[d][1]; 9943 (null === g || g.test && g.test(f) || "string" == typeof g && f == g) && a.removeAttribute(e) 9944 } 9945 } 9946 c || m(a) 9947 } 9948 9949 function m(a, b) { 9950 if (!a.hasAttributes() || b) 9951 if (CKEDITOR.dtd.$block[a.getName()]) { 9952 var c = a.getPrevious(H), 9953 d = a.getNext(H); 9954 !c || c.type != CKEDITOR.NODE_TEXT && c.isBlockBoundary({ 9955 br: 1 9956 }) || a.append("br", 1); 9957 !d || d.type != CKEDITOR.NODE_TEXT && d.isBlockBoundary({ 9958 br: 1 9959 }) || a.append("br"); 9960 a.remove(!0) 9961 } else c = a.getFirst(), d = a.getLast(), a.remove(!0), c && (c.type == CKEDITOR.NODE_ELEMENT && c.mergeSiblings(), 9962 d && !c.equals(d) && d.type == CKEDITOR.NODE_ELEMENT && d.mergeSiblings()) 9963 } 9964 9965 function J(a, b, c) { 9966 var d; 9967 d = a.element; 9968 "*" == d && (d = "span"); 9969 d = new CKEDITOR.dom.element(d, b); 9970 c && c.copyAttributes(d); 9971 d = u(d, a); 9972 b.getCustomData("doc_processing_style") && d.hasAttribute("id") ? d.removeAttribute("id") : b.setCustomData("doc_processing_style", 1); 9973 return d 9974 } 9975 9976 function u(a, b) { 9977 var c = b._.definition, 9978 d = c.attributes, 9979 c = CKEDITOR.style.getStyleText(c); 9980 if (d) 9981 for (var e in d) a.setAttribute(e, d[e]); 9982 c && a.setAttribute("style", c); 9983 a.getDocument().removeCustomData("doc_processing_style"); 9984 return a 9985 } 9986 9987 function K(a, b) { 9988 for (var c in a) a[c] = a[c].replace(E, function(a, c) { 9989 return b[c] 9990 }) 9991 } 9992 9993 function l(a) { 9994 if (a._.overrides) return a._.overrides; 9995 var b = a._.overrides = {}, 9996 c = a._.definition.overrides; 9997 if (c) { 9998 CKEDITOR.tools.isArray(c) || (c = [c]); 9999 for (var d = 0; d < c.length; d++) { 10000 var e = c[d], 10001 f, g; 10002 "string" == typeof e ? f = e.toLowerCase() : (f = e.element ? e.element.toLowerCase() : a.element, g = e.attributes); 10003 e = b[f] || (b[f] = {}); 10004 if (g) { 10005 var e = e.attributes = e.attributes || [], 10006 h; 10007 for (h in g) e.push([h.toLowerCase(), g[h]]) 10008 } 10009 } 10010 } 10011 return b 10012 } 10013 10014 function t(a, 10015 b, c) { 10016 var d = new CKEDITOR.dom.element("span"); 10017 d[c ? "setStyle" : "setAttribute"](a, b); 10018 return d[c ? "getStyle" : "getAttribute"](a) 10019 } 10020 10021 function F(a, b) { 10022 function c(a, b) { 10023 return "font-family" == b.toLowerCase() ? a.replace(/["']/g, "") : a 10024 } 10025 "string" == typeof a && (a = CKEDITOR.tools.parseCssText(a)); 10026 "string" == typeof b && (b = CKEDITOR.tools.parseCssText(b, !0)); 10027 for (var d in a) 10028 if (!(d in b) || c(b[d], d) != c(a[d], d) && "inherit" != a[d] && "inherit" != b[d]) return !1; 10029 return !0 10030 } 10031 10032 function L(a, b, c) { 10033 var d = a.getRanges(); 10034 b = b ? this.removeFromRange : this.applyToRange; 10035 var e, f; 10036 if (a.isFake && a.isInTable()) 10037 for (e = [], f = 0; f < d.length; f++) e.push(d[f].clone()); 10038 for (var g = d.createIterator(); f = g.getNextRange();) b.call(this, f, c); 10039 a.selectRanges(e || d) 10040 } 10041 var C = { 10042 address: 1, 10043 div: 1, 10044 h1: 1, 10045 h2: 1, 10046 h3: 1, 10047 h4: 1, 10048 h5: 1, 10049 h6: 1, 10050 p: 1, 10051 pre: 1, 10052 section: 1, 10053 header: 1, 10054 footer: 1, 10055 nav: 1, 10056 article: 1, 10057 aside: 1, 10058 figure: 1, 10059 dialog: 1, 10060 hgroup: 1, 10061 time: 1, 10062 meter: 1, 10063 menu: 1, 10064 command: 1, 10065 keygen: 1, 10066 output: 1, 10067 progress: 1, 10068 details: 1, 10069 datagrid: 1, 10070 datalist: 1 10071 }, 10072 M = { 10073 a: 1, 10074 blockquote: 1, 10075 embed: 1, 10076 hr: 1, 10077 img: 1, 10078 li: 1, 10079 object: 1, 10080 ol: 1, 10081 table: 1, 10082 td: 1, 10083 tr: 1, 10084 th: 1, 10085 ul: 1, 10086 dl: 1, 10087 dt: 1, 10088 dd: 1, 10089 form: 1, 10090 audio: 1, 10091 video: 1 10092 }, 10093 q = /\s*(?:;\s*|$)/, 10094 E = /#\((.+?)\)/g, 10095 z = CKEDITOR.dom.walker.bookmark(0, 1), 10096 H = CKEDITOR.dom.walker.whitespaces(1); 10097 CKEDITOR.style = function(a, b) { 10098 if ("string" == typeof a.type) return new CKEDITOR.style.customHandlers[a.type](a); 10099 var c = a.attributes; 10100 c && c.style && (a.styles = CKEDITOR.tools.extend({}, a.styles, CKEDITOR.tools.parseCssText(c.style)), delete c.style); 10101 b && (a = CKEDITOR.tools.clone(a), K(a.attributes, b), K(a.styles, b)); 10102 c = this.element = a.element ? "string" == typeof a.element ? a.element.toLowerCase() : 10103 a.element : "*"; 10104 this.type = a.type || (C[c] ? CKEDITOR.STYLE_BLOCK : M[c] ? CKEDITOR.STYLE_OBJECT : CKEDITOR.STYLE_INLINE); 10105 "object" == typeof this.element && (this.type = CKEDITOR.STYLE_OBJECT); 10106 this._ = { 10107 definition: a 10108 } 10109 }; 10110 CKEDITOR.style.prototype = { 10111 apply: function(a) { 10112 if (a instanceof CKEDITOR.dom.document) return L.call(this, a.getSelection()); 10113 if (this.checkApplicable(a.elementPath(), a)) { 10114 var b = this._.enterMode; 10115 b || (this._.enterMode = a.activeEnterMode); 10116 L.call(this, a.getSelection(), 0, a); 10117 this._.enterMode = b 10118 } 10119 }, 10120 remove: function(a) { 10121 if (a instanceof CKEDITOR.dom.document) return L.call(this, a.getSelection(), 1); 10122 if (this.checkApplicable(a.elementPath(), a)) { 10123 var b = this._.enterMode; 10124 b || (this._.enterMode = a.activeEnterMode); 10125 L.call(this, a.getSelection(), 1, a); 10126 this._.enterMode = b 10127 } 10128 }, 10129 applyToRange: function(a) { 10130 this.applyToRange = this.type == CKEDITOR.STYLE_INLINE ? b : this.type == CKEDITOR.STYLE_BLOCK ? g : this.type == CKEDITOR.STYLE_OBJECT ? h : null; 10131 return this.applyToRange(a) 10132 }, 10133 removeFromRange: function(a) { 10134 this.removeFromRange = this.type == CKEDITOR.STYLE_INLINE ? c : this.type == CKEDITOR.STYLE_BLOCK ? 10135 n : this.type == CKEDITOR.STYLE_OBJECT ? k : null; 10136 return this.removeFromRange(a) 10137 }, 10138 applyToObject: function(a) { 10139 u(a, this) 10140 }, 10141 checkActive: function(a, b) { 10142 switch (this.type) { 10143 case CKEDITOR.STYLE_BLOCK: 10144 return this.checkElementRemovable(a.block || a.blockLimit, !0, b); 10145 case CKEDITOR.STYLE_OBJECT: 10146 case CKEDITOR.STYLE_INLINE: 10147 for (var c = a.elements, d = 0, e; d < c.length; d++) 10148 if (e = c[d], this.type != CKEDITOR.STYLE_INLINE || e != a.block && e != a.blockLimit) { 10149 if (this.type == CKEDITOR.STYLE_OBJECT) { 10150 var f = e.getName(); 10151 if (!("string" == typeof this.element ? 10152 f == this.element : f in this.element)) continue 10153 } 10154 if (this.checkElementRemovable(e, !0, b)) return !0 10155 } 10156 } 10157 return !1 10158 }, 10159 checkApplicable: function(a, b, c) { 10160 b && b instanceof CKEDITOR.filter && (c = b); 10161 if (c && !c.check(this)) return !1; 10162 switch (this.type) { 10163 case CKEDITOR.STYLE_OBJECT: 10164 return !!a.contains(this.element); 10165 case CKEDITOR.STYLE_BLOCK: 10166 return !!a.blockLimit.getDtd()[this.element] 10167 } 10168 return !0 10169 }, 10170 checkElementMatch: function(a, b) { 10171 var c = this._.definition; 10172 if (!a || !c.ignoreReadonly && a.isReadOnly()) return !1; 10173 var d = a.getName(); 10174 if ("string" == typeof this.element ? 10175 d == this.element : d in this.element) { 10176 if (!b && !a.hasAttributes()) return !0; 10177 if (d = c._AC) c = d; 10178 else { 10179 var d = {}, 10180 e = 0, 10181 f = c.attributes; 10182 if (f) 10183 for (var g in f) e++, d[g] = f[g]; 10184 if (g = CKEDITOR.style.getStyleText(c)) d.style || e++, d.style = g; 10185 d._length = e; 10186 c = c._AC = d 10187 } 10188 if (c._length) { 10189 for (var h in c) 10190 if ("_length" != h) 10191 if (d = a.getAttribute(h) || "", "style" == h ? F(c[h], d) : c[h] == d) { 10192 if (!b) return !0 10193 } else if (b) return !1; 10194 if (b) return !0 10195 } else return !0 10196 } 10197 return !1 10198 }, 10199 checkElementRemovable: function(a, b, c) { 10200 if (this.checkElementMatch(a, b, c)) return !0; 10201 if (b = l(this)[a.getName()]) { 10202 var d; 10203 if (!(b = b.attributes)) return !0; 10204 for (c = 0; c < b.length; c++) 10205 if (d = b[c][0], d = a.getAttribute(d)) { 10206 var e = b[c][1]; 10207 if (null === e) return !0; 10208 if ("string" == typeof e) { 10209 if (d == e) return !0 10210 } else if (e.test(d)) return !0 10211 } 10212 } 10213 return !1 10214 }, 10215 buildPreview: function(a) { 10216 var b = this._.definition, 10217 c = [], 10218 d = b.element; 10219 "bdo" == d && (d = "span"); 10220 var c = ["\x3c", d], 10221 e = b.attributes; 10222 if (e) 10223 for (var f in e) c.push(" ", f, '\x3d"', e[f], '"'); 10224 (e = CKEDITOR.style.getStyleText(b)) && c.push(' style\x3d"', e, '"'); 10225 c.push("\x3e", a || b.name, "\x3c/", d, "\x3e"); 10226 return c.join("") 10227 }, 10228 getDefinition: function() { 10229 return this._.definition 10230 } 10231 }; 10232 CKEDITOR.style.getStyleText = function(a) { 10233 var b = a._ST; 10234 if (b) return b; 10235 var b = a.styles, 10236 c = a.attributes && a.attributes.style || "", 10237 d = ""; 10238 c.length && (c = c.replace(q, ";")); 10239 for (var e in b) { 10240 var f = b[e], 10241 g = (e + ":" + f).replace(q, ";"); 10242 "inherit" == f ? d += g : c += g 10243 } 10244 c.length && (c = CKEDITOR.tools.normalizeCssText(c, !0)); 10245 return a._ST = c + d 10246 }; 10247 CKEDITOR.style.customHandlers = {}; 10248 CKEDITOR.style.addCustomHandler = function(a) { 10249 var b = function(a) { 10250 this._ = { 10251 definition: a 10252 }; 10253 this.setup && this.setup(a) 10254 }; 10255 b.prototype = CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype), { 10256 assignedTo: CKEDITOR.STYLE_OBJECT 10257 }, a, !0); 10258 return this.customHandlers[a.type] = b 10259 }; 10260 var P = CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED, 10261 O = CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED 10262 })(); 10263 CKEDITOR.styleCommand = function(a, d) { 10264 this.requiredContent = this.allowedContent = this.style = a; 10265 CKEDITOR.tools.extend(this, d, !0) 10266 }; 10267 CKEDITOR.styleCommand.prototype.exec = function(a) { 10268 a.focus(); 10269 this.state == CKEDITOR.TRISTATE_OFF ? a.applyStyle(this.style) : this.state == CKEDITOR.TRISTATE_ON && a.removeStyle(this.style) 10270 }; 10271 CKEDITOR.stylesSet = new CKEDITOR.resourceManager("", "stylesSet"); 10272 CKEDITOR.addStylesSet = CKEDITOR.tools.bind(CKEDITOR.stylesSet.add, CKEDITOR.stylesSet); 10273 CKEDITOR.loadStylesSet = function(a, d, b) { 10274 CKEDITOR.stylesSet.addExternal(a, d, ""); 10275 CKEDITOR.stylesSet.load(a, b) 10276 }; 10277 CKEDITOR.tools.extend(CKEDITOR.editor.prototype, { 10278 attachStyleStateChange: function(a, d) { 10279 var b = this._.styleStateChangeCallbacks; 10280 b || (b = this._.styleStateChangeCallbacks = [], this.on("selectionChange", function(a) { 10281 for (var d = 0; d < b.length; d++) { 10282 var h = b[d], 10283 k = h.style.checkActive(a.data.path, this) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF; 10284 h.fn.call(this, k) 10285 } 10286 })); 10287 b.push({ 10288 style: a, 10289 fn: d 10290 }) 10291 }, 10292 applyStyle: function(a) { 10293 a.apply(this) 10294 }, 10295 removeStyle: function(a) { 10296 a.remove(this) 10297 }, 10298 getStylesSet: function(a) { 10299 if (this._.stylesDefinitions) a(this._.stylesDefinitions); 10300 else { 10301 var d = this, 10302 b = d.config.stylesCombo_stylesSet || d.config.stylesSet; 10303 if (!1 === b) a(null); 10304 else if (b instanceof Array) d._.stylesDefinitions = b, a(b); 10305 else { 10306 b || (b = "default"); 10307 var b = b.split(":"), 10308 c = b[0]; 10309 CKEDITOR.stylesSet.addExternal(c, b[1] ? b.slice(1).join(":") : CKEDITOR.getUrl("styles.js"), ""); 10310 CKEDITOR.stylesSet.load(c, function(b) { 10311 d._.stylesDefinitions = b[c]; 10312 a(d._.stylesDefinitions) 10313 }) 10314 } 10315 } 10316 } 10317 }); 10318 CKEDITOR.dom.comment = function(a, d) { 10319 "string" == typeof a && (a = (d ? d.$ : document).createComment(a)); 10320 CKEDITOR.dom.domObject.call(this, a) 10321 }; 10322 CKEDITOR.dom.comment.prototype = new CKEDITOR.dom.node; 10323 CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype, { 10324 type: CKEDITOR.NODE_COMMENT, 10325 getOuterHtml: function() { 10326 return "\x3c!--" + this.$.nodeValue + "--\x3e" 10327 } 10328 }); 10329 "use strict"; 10330 (function() { 10331 var a = {}, 10332 d = {}, 10333 b; 10334 for (b in CKEDITOR.dtd.$blockLimit) b in CKEDITOR.dtd.$list || (a[b] = 1); 10335 for (b in CKEDITOR.dtd.$block) b in CKEDITOR.dtd.$blockLimit || b in CKEDITOR.dtd.$empty || (d[b] = 1); 10336 CKEDITOR.dom.elementPath = function(b, f) { 10337 var h = null, 10338 k = null, 10339 g = [], 10340 n = b, 10341 r; 10342 f = f || b.getDocument().getBody(); 10343 n || (n = f); 10344 do 10345 if (n.type == CKEDITOR.NODE_ELEMENT) { 10346 g.push(n); 10347 if (!this.lastElement && (this.lastElement = n, n.is(CKEDITOR.dtd.$object) || "false" == n.getAttribute("contenteditable"))) continue; 10348 if (n.equals(f)) break; 10349 if (!k && (r = n.getName(), 10350 "true" == n.getAttribute("contenteditable") ? k = n : !h && d[r] && (h = n), a[r])) { 10351 if (r = !h && "div" == r) { 10352 a: { 10353 r = n.getChildren(); 10354 for (var e = 0, y = r.count(); e < y; e++) { 10355 var v = r.getItem(e); 10356 if (v.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$block[v.getName()]) { 10357 r = !0; 10358 break a 10359 } 10360 } 10361 r = !1 10362 } 10363 r = !r 10364 } 10365 r ? h = n : k = n 10366 } 10367 } while (n = n.getParent()); 10368 k || (k = f); 10369 this.block = h; 10370 this.blockLimit = k; 10371 this.root = f; 10372 this.elements = g 10373 } 10374 })(); 10375 CKEDITOR.dom.elementPath.prototype = { 10376 compare: function(a) { 10377 var d = this.elements; 10378 a = a && a.elements; 10379 if (!a || d.length != a.length) return !1; 10380 for (var b = 0; b < d.length; b++) 10381 if (!d[b].equals(a[b])) return !1; 10382 return !0 10383 }, 10384 contains: function(a, d, b) { 10385 var c = 0, 10386 f; 10387 "string" == typeof a && (f = function(b) { 10388 return b.getName() == a 10389 }); 10390 a instanceof CKEDITOR.dom.element ? f = function(b) { 10391 return b.equals(a) 10392 } : CKEDITOR.tools.isArray(a) ? f = function(b) { 10393 return -1 < CKEDITOR.tools.indexOf(a, b.getName()) 10394 } : "function" == typeof a ? f = a : "object" == typeof a && (f = function(b) { 10395 return b.getName() in 10396 a 10397 }); 10398 var h = this.elements, 10399 k = h.length; 10400 d && (b ? c += 1 : --k); 10401 b && (h = Array.prototype.slice.call(h, 0), h.reverse()); 10402 for (; c < k; c++) 10403 if (f(h[c])) return h[c]; 10404 return null 10405 }, 10406 isContextFor: function(a) { 10407 var d; 10408 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 10409 }, 10410 direction: function() { 10411 return (this.block || this.blockLimit || this.root).getDirection(1) 10412 } 10413 }; 10414 CKEDITOR.dom.text = function(a, d) { 10415 "string" == typeof a && (a = (d ? d.$ : document).createTextNode(a)); 10416 this.$ = a 10417 }; 10418 CKEDITOR.dom.text.prototype = new CKEDITOR.dom.node; 10419 CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype, { 10420 type: CKEDITOR.NODE_TEXT, 10421 getLength: function() { 10422 return this.$.nodeValue.length 10423 }, 10424 getText: function() { 10425 return this.$.nodeValue 10426 }, 10427 setText: function(a) { 10428 this.$.nodeValue = a 10429 }, 10430 split: function(a) { 10431 var d = this.$.parentNode, 10432 b = d.childNodes.length, 10433 c = this.getLength(), 10434 f = this.getDocument(), 10435 h = new CKEDITOR.dom.text(this.$.splitText(a), f); 10436 d.childNodes.length == b && (a >= c ? (h = f.createText(""), h.insertAfter(this)) : (a = f.createText(""), a.insertAfter(h), a.remove())); 10437 return h 10438 }, 10439 substring: function(a, 10440 d) { 10441 return "number" != typeof d ? this.$.nodeValue.substr(a) : this.$.nodeValue.substring(a, d) 10442 } 10443 }); 10444 (function() { 10445 function a(a, c, d) { 10446 var h = a.serializable, 10447 k = c[d ? "endContainer" : "startContainer"], 10448 g = d ? "endOffset" : "startOffset", 10449 n = h ? c.document.getById(a.startNode) : a.startNode; 10450 a = h ? c.document.getById(a.endNode) : a.endNode; 10451 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()); 10452 k.equals(n.getParent()) && c[g]++; 10453 k.equals(a.getParent()) && c[g]++; 10454 c[d ? "endContainer" : "startContainer"] = k; 10455 return c 10456 } 10457 CKEDITOR.dom.rangeList = function(a) { 10458 if (a instanceof CKEDITOR.dom.rangeList) return a; 10459 a ? a instanceof CKEDITOR.dom.range && (a = [a]) : a = []; 10460 return CKEDITOR.tools.extend(a, d) 10461 }; 10462 var d = { 10463 createIterator: function() { 10464 var a = this, 10465 c = CKEDITOR.dom.walker.bookmark(), 10466 d = [], 10467 h; 10468 return { 10469 getNextRange: function(k) { 10470 h = void 0 === h ? 0 : h + 1; 10471 var g = a[h]; 10472 if (g && 1 < a.length) { 10473 if (!h) 10474 for (var n = a.length - 1; 0 <= n; n--) d.unshift(a[n].createBookmark(!0)); 10475 if (k) 10476 for (var r = 0; a[h + r + 1];) { 10477 var e = g.document; 10478 k = 0; 10479 n = e.getById(d[r].endNode); 10480 for (e = e.getById(d[r + 1].startNode);;) { 10481 n = 10482 n.getNextSourceNode(!1); 10483 if (e.equals(n)) k = 1; 10484 else if (c(n) || n.type == CKEDITOR.NODE_ELEMENT && n.isBlockBoundary()) continue; 10485 break 10486 } 10487 if (!k) break; 10488 r++ 10489 } 10490 for (g.moveToBookmark(d.shift()); r--;) n = a[++h], n.moveToBookmark(d.shift()), g.setEnd(n.endContainer, n.endOffset) 10491 } 10492 return g 10493 } 10494 } 10495 }, 10496 createBookmarks: function(b) { 10497 for (var c = [], d, h = 0; h < this.length; h++) { 10498 c.push(d = this[h].createBookmark(b, !0)); 10499 for (var k = h + 1; k < this.length; k++) this[k] = a(d, this[k]), this[k] = a(d, this[k], !0) 10500 } 10501 return c 10502 }, 10503 createBookmarks2: function(a) { 10504 for (var c = [], d = 0; d < 10505 this.length; d++) c.push(this[d].createBookmark2(a)); 10506 return c 10507 }, 10508 moveToBookmarks: function(a) { 10509 for (var c = 0; c < this.length; c++) this[c].moveToBookmark(a[c]) 10510 } 10511 } 10512 })(); 10513 (function() { 10514 function a() { 10515 return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1] || "skins/" + CKEDITOR.skinName.split(",")[0] + "/") 10516 } 10517 10518 function d(b) { 10519 var c = CKEDITOR.skin["ua_" + b], 10520 d = CKEDITOR.env; 10521 if (c) 10522 for (var c = c.split(",").sort(function(a, b) { 10523 return a > b ? -1 : 1 10524 }), f = 0, g; f < c.length; f++) 10525 if (g = c[f], d.ie && (g.replace(/^ie/, "") == d.version || d.quirks && "iequirks" == g) && (g = "ie"), d[g]) { 10526 b += "_" + c[f]; 10527 break 10528 } return CKEDITOR.getUrl(a() + b + ".css") 10529 } 10530 10531 function b(a, b) { 10532 h[a] || (CKEDITOR.document.appendStyleSheet(d(a)), h[a] = 1); 10533 b && b() 10534 } 10535 10536 function c(a) { 10537 var b = 10538 a.getById(k); 10539 b || (b = a.getHead().append("style"), b.setAttribute("id", k), b.setAttribute("type", "text/css")); 10540 return b 10541 } 10542 10543 function f(a, b, c) { 10544 var d, f, g; 10545 if (CKEDITOR.env.webkit) 10546 for (b = b.split("}").slice(0, -1), f = 0; f < b.length; f++) b[f] = b[f].split("{"); 10547 for (var h = 0; h < a.length; h++) 10548 if (CKEDITOR.env.webkit) 10549 for (f = 0; f < b.length; f++) { 10550 g = b[f][1]; 10551 for (d = 0; d < c.length; d++) g = g.replace(c[d][0], c[d][1]); 10552 a[h].$.sheet.addRule(b[f][0], g) 10553 } else { 10554 g = b; 10555 for (d = 0; d < c.length; d++) g = g.replace(c[d][0], c[d][1]); 10556 CKEDITOR.env.ie && 11 > CKEDITOR.env.version ? 10557 a[h].$.styleSheet.cssText += g : a[h].$.innerHTML += g 10558 } 10559 } 10560 var h = {}; 10561 CKEDITOR.skin = { 10562 path: a, 10563 loadPart: function(c, d) { 10564 CKEDITOR.skin.name != CKEDITOR.skinName.split(",")[0] ? CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a() + "skin.js"), function() { 10565 b(c, d) 10566 }) : b(c, d) 10567 }, 10568 getPath: function(a) { 10569 return CKEDITOR.getUrl(d(a)) 10570 }, 10571 icons: {}, 10572 addIcon: function(a, b, c, d) { 10573 a = a.toLowerCase(); 10574 this.icons[a] || (this.icons[a] = { 10575 path: b, 10576 offset: c || 0, 10577 bgsize: d || "16px" 10578 }) 10579 }, 10580 getIconStyle: function(a, b, c, d, f) { 10581 var g; 10582 a && (a = a.toLowerCase(), b && (g = this.icons[a + "-rtl"]), 10583 g || (g = this.icons[a])); 10584 a = c || g && g.path || ""; 10585 d = d || g && g.offset; 10586 f = f || g && g.bgsize || "16px"; 10587 a && (a = a.replace(/'/g, "\\'")); 10588 return a && "background-image:url('" + CKEDITOR.getUrl(a) + "');background-position:0 " + d + "px;background-size:" + f + ";" 10589 } 10590 }; 10591 CKEDITOR.tools.extend(CKEDITOR.editor.prototype, { 10592 getUiColor: function() { 10593 return this.uiColor 10594 }, 10595 setUiColor: function(a) { 10596 var b = c(CKEDITOR.document); 10597 return (this.setUiColor = function(a) { 10598 this.uiColor = a; 10599 var c = CKEDITOR.skin.chameleon, 10600 d = "", 10601 h = ""; 10602 "function" == typeof c && (d = c(this, "editor"), h = 10603 c(this, "panel")); 10604 a = [ 10605 [n, a] 10606 ]; 10607 f([b], d, a); 10608 f(g, h, a) 10609 }).call(this, a) 10610 } 10611 }); 10612 var k = "cke_ui_color", 10613 g = [], 10614 n = /\$color/g; 10615 CKEDITOR.on("instanceLoaded", function(a) { 10616 if (!CKEDITOR.env.ie || !CKEDITOR.env.quirks) { 10617 var b = a.editor; 10618 a = function(a) { 10619 a = (a.data[0] || a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument(); 10620 if (!a.getById("cke_ui_color")) { 10621 a = c(a); 10622 g.push(a); 10623 var d = b.getUiColor(); 10624 d && f([a], CKEDITOR.skin.chameleon(b, "panel"), [ 10625 [n, d] 10626 ]) 10627 } 10628 }; 10629 b.on("panelShow", a); 10630 b.on("menuShow", a); 10631 b.config.uiColor && b.setUiColor(b.config.uiColor) 10632 } 10633 }) 10634 })(); 10635 (function() { 10636 if (CKEDITOR.env.webkit) CKEDITOR.env.hc = !1; 10637 else { 10638 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); 10639 a.appendTo(CKEDITOR.document.getHead()); 10640 try { 10641 var d = a.getComputedStyle("border-top-color"), 10642 b = a.getComputedStyle("border-right-color"); 10643 CKEDITOR.env.hc = !(!d || d != b) 10644 } catch (c) { 10645 CKEDITOR.env.hc = !1 10646 } 10647 a.remove() 10648 } 10649 CKEDITOR.env.hc && (CKEDITOR.env.cssClass += " cke_hc"); 10650 CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}"); 10651 CKEDITOR.status = "loaded"; 10652 CKEDITOR.fireOnce("loaded"); 10653 if (a = CKEDITOR._.pending) 10654 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]) 10655 })(); 10656 /* 10657 Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. 10658 For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license 10659 */ 10660 CKEDITOR.skin.name = "moono-lisa"; 10661 CKEDITOR.skin.ua_editor = "ie,iequirks,ie8,gecko"; 10662 CKEDITOR.skin.ua_dialog = "ie,iequirks,ie8"; 10663 CKEDITOR.skin.chameleon = function() { 10664 var b = function() { 10665 return function(b, d) { 10666 for (var a = b.match(/[^#]./g), e = 0; 3 > e; e++) { 10667 var f = e, 10668 c; 10669 c = parseInt(a[e], 16); 10670 c = ("0" + (0 > d ? 0 | c * (1 + d) : 0 | c + (255 - c) * d).toString(16)).slice(-2); 10671 a[f] = c 10672 } 10673 return "#" + a.join("") 10674 } 10675 }(), 10676 f = { 10677 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};] "), 10678 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};] ") 10679 }; 10680 return function(g, d) { 10681 var a = b(g.uiColor, .4), 10682 a = { 10683 id: "." + g.id, 10684 defaultBorder: b(a, -.2), 10685 toolbarElementsBorder: b(a, -.25), 10686 defaultBackground: a, 10687 lightBackground: b(a, .8), 10688 darkBackground: b(a, -.15), 10689 ckeButtonOn: b(a, .4), 10690 ckeResizer: b(a, -.4), 10691 ckeColorauto: b(a, .8), 10692 dialogBody: b(a, .7), 10693 dialogTab: b(a, .65), 10694 dialogTabSelected: "#FFF", 10695 dialogTabSelectedBorder: "#FFF", 10696 elementsPathColor: b(a, -.6), 10697 menubuttonHover: b(a, .1), 10698 menubuttonIcon: b(a, .5), 10699 menubuttonIconHover: b(a, .3) 10700 }; 10701 return f[d].output(a).replace(/\[/g, "{").replace(/\]/g, "}") 10702 } 10703 }(); 10704 CKEDITOR.plugins.add("dialogui", { 10705 onLoad: function() { 10706 var h = function(b) { 10707 this._ || (this._ = {}); 10708 this._["default"] = this._.initValue = b["default"] || ""; 10709 this._.required = b.required || !1; 10710 for (var a = [this._], d = 1; d < arguments.length; d++) a.push(arguments[d]); 10711 a.push(!0); 10712 CKEDITOR.tools.extend.apply(CKEDITOR.tools, a); 10713 return this._ 10714 }, 10715 v = { 10716 build: function(b, a, d) { 10717 return new CKEDITOR.ui.dialog.textInput(b, a, d) 10718 } 10719 }, 10720 n = { 10721 build: function(b, a, d) { 10722 return new CKEDITOR.ui.dialog[a.type](b, a, d) 10723 } 10724 }, 10725 q = { 10726 isChanged: function() { 10727 return this.getValue() != 10728 this.getInitValue() 10729 }, 10730 reset: function(b) { 10731 this.setValue(this.getInitValue(), b) 10732 }, 10733 setInitValue: function() { 10734 this._.initValue = this.getValue() 10735 }, 10736 resetInitValue: function() { 10737 this._.initValue = this._["default"] 10738 }, 10739 getInitValue: function() { 10740 return this._.initValue 10741 } 10742 }, 10743 r = CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, { 10744 onChange: function(b, a) { 10745 this._.domOnChangeRegistered || (b.on("load", function() { 10746 this.getInputElement().on("change", function() { 10747 b.parts.dialog.isVisible() && this.fire("change", { 10748 value: this.getValue() 10749 }) 10750 }, 10751 this) 10752 }, this), this._.domOnChangeRegistered = !0); 10753 this.on("change", a) 10754 } 10755 }, !0), 10756 x = /^on([A-Z]\w+)/, 10757 t = function(b) { 10758 for (var a in b)(x.test(a) || "title" == a || "type" == a) && delete b[a]; 10759 return b 10760 }, 10761 w = function(b) { 10762 b = b.data.getKeystroke(); 10763 b == CKEDITOR.SHIFT + CKEDITOR.ALT + 36 ? this.setDirectionMarker("ltr") : b == CKEDITOR.SHIFT + CKEDITOR.ALT + 35 && this.setDirectionMarker("rtl") 10764 }; 10765 CKEDITOR.tools.extend(CKEDITOR.ui.dialog, { 10766 labeledElement: function(b, a, d, f) { 10767 if (!(4 > arguments.length)) { 10768 var c = h.call(this, a); 10769 c.labelId = CKEDITOR.tools.getNextId() + 10770 "_label"; 10771 this._.children = []; 10772 var e = { 10773 role: a.role || "presentation" 10774 }; 10775 a.includeLabel && (e["aria-labelledby"] = c.labelId); 10776 CKEDITOR.ui.dialog.uiElement.call(this, b, a, d, "div", null, e, function() { 10777 var e = [], 10778 g = a.required ? " cke_required" : ""; 10779 "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"', 10780 a.controlStyle ? ' style\x3d"' + a.controlStyle + '"' : "", ' role\x3d"presentation"\x3e', f.call(this, b, a), "\x3c/div\x3e") : (g = { 10781 type: "hbox", 10782 widths: a.widths, 10783 padding: 0, 10784 children: [{ 10785 type: "html", 10786 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" 10787 }, { 10788 type: "html", 10789 html: '\x3cspan class\x3d"cke_dialog_ui_labeled_content"' + (a.controlStyle ? ' style\x3d"' + a.controlStyle + 10790 '"' : "") + "\x3e" + f.call(this, b, a) + "\x3c/span\x3e" 10791 }] 10792 }, CKEDITOR.dialog._.uiElementBuilders.hbox.build(b, g, e)); 10793 return e.join("") 10794 }) 10795 } 10796 }, 10797 textInput: function(b, a, d) { 10798 if (!(3 > arguments.length)) { 10799 h.call(this, a); 10800 var f = this._.inputId = CKEDITOR.tools.getNextId() + "_textInput", 10801 c = { 10802 "class": "cke_dialog_ui_input_" + a.type, 10803 id: f, 10804 type: a.type 10805 }; 10806 a.validate && (this.validate = a.validate); 10807 a.maxLength && (c.maxlength = a.maxLength); 10808 a.size && (c.size = a.size); 10809 a.inputStyle && (c.style = a.inputStyle); 10810 var e = this, 10811 m = !1; 10812 b.on("load", function() { 10813 e.getInputElement().on("keydown", 10814 function(a) { 10815 13 == a.data.getKeystroke() && (m = !0) 10816 }); 10817 e.getInputElement().on("keyup", function(a) { 10818 13 == a.data.getKeystroke() && m && (b.getButton("ok") && setTimeout(function() { 10819 b.getButton("ok").click() 10820 }, 0), m = !1); 10821 e.bidi && w.call(e, a) 10822 }, null, null, 1E3) 10823 }); 10824 CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function() { 10825 var b = ['\x3cdiv class\x3d"cke_dialog_ui_input_', a.type, '" role\x3d"presentation"']; 10826 a.width && b.push('style\x3d"width:' + a.width + '" '); 10827 b.push("\x3e\x3cinput "); 10828 c["aria-labelledby"] = this._.labelId; 10829 this._.required && 10830 (c["aria-required"] = this._.required); 10831 for (var e in c) b.push(e + '\x3d"' + c[e] + '" '); 10832 b.push(" /\x3e\x3c/div\x3e"); 10833 return b.join("") 10834 }) 10835 } 10836 }, 10837 textarea: function(b, a, d) { 10838 if (!(3 > arguments.length)) { 10839 h.call(this, a); 10840 var f = this, 10841 c = this._.inputId = CKEDITOR.tools.getNextId() + "_textarea", 10842 e = {}; 10843 a.validate && (this.validate = a.validate); 10844 e.rows = a.rows || 5; 10845 e.cols = a.cols || 20; 10846 e["class"] = "cke_dialog_ui_input_textarea " + (a["class"] || ""); 10847 "undefined" != typeof a.inputStyle && (e.style = a.inputStyle); 10848 a.dir && (e.dir = a.dir); 10849 if (f.bidi) b.on("load", 10850 function() { 10851 f.getInputElement().on("keyup", w) 10852 }, f); 10853 CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function() { 10854 e["aria-labelledby"] = this._.labelId; 10855 this._.required && (e["aria-required"] = this._.required); 10856 var a = ['\x3cdiv class\x3d"cke_dialog_ui_input_textarea" role\x3d"presentation"\x3e\x3ctextarea id\x3d"', c, '" '], 10857 b; 10858 for (b in e) a.push(b + '\x3d"' + CKEDITOR.tools.htmlEncode(e[b]) + '" '); 10859 a.push("\x3e", CKEDITOR.tools.htmlEncode(f._["default"]), "\x3c/textarea\x3e\x3c/div\x3e"); 10860 return a.join("") 10861 }) 10862 } 10863 }, 10864 checkbox: function(b, 10865 a, d) { 10866 if (!(3 > arguments.length)) { 10867 var f = h.call(this, a, { 10868 "default": !!a["default"] 10869 }); 10870 a.validate && (this.validate = a.validate); 10871 CKEDITOR.ui.dialog.uiElement.call(this, b, a, d, "span", null, null, function() { 10872 var c = CKEDITOR.tools.extend({}, a, { 10873 id: a.id ? a.id + "_checkbox" : CKEDITOR.tools.getNextId() + "_checkbox" 10874 }, !0), 10875 e = [], 10876 d = CKEDITOR.tools.getNextId() + "_label", 10877 g = { 10878 "class": "cke_dialog_ui_checkbox_input", 10879 type: "checkbox", 10880 "aria-labelledby": d 10881 }; 10882 t(c); 10883 a["default"] && (g.checked = "checked"); 10884 "undefined" != typeof c.inputStyle && (c.style = c.inputStyle); 10885 f.checkbox = new CKEDITOR.ui.dialog.uiElement(b, c, e, "input", null, g); 10886 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"); 10887 return e.join("") 10888 }) 10889 } 10890 }, 10891 radio: function(b, a, d) { 10892 if (!(3 > arguments.length)) { 10893 h.call(this, a); 10894 this._["default"] || (this._["default"] = this._.initValue = a.items[0][1]); 10895 a.validate && (this.validate = a.validate); 10896 var f = [], 10897 c = this; 10898 a.role = "radiogroup"; 10899 a.includeLabel = !0; 10900 CKEDITOR.ui.dialog.labeledElement.call(this, 10901 b, a, d, 10902 function() { 10903 for (var e = [], d = [], g = (a.id ? a.id : CKEDITOR.tools.getNextId()) + "_radio", k = 0; k < a.items.length; k++) { 10904 var l = a.items[k], 10905 h = void 0 !== l[2] ? l[2] : l[0], 10906 n = void 0 !== l[1] ? l[1] : l[0], 10907 p = CKEDITOR.tools.getNextId() + "_radio_input", 10908 q = p + "_label", 10909 p = CKEDITOR.tools.extend({}, a, { 10910 id: p, 10911 title: null, 10912 type: null 10913 }, !0), 10914 h = CKEDITOR.tools.extend({}, p, { 10915 title: h 10916 }, !0), 10917 r = { 10918 type: "radio", 10919 "class": "cke_dialog_ui_radio_input", 10920 name: g, 10921 value: n, 10922 "aria-labelledby": q 10923 }, 10924 u = []; 10925 c._["default"] == n && (r.checked = "checked"); 10926 t(p); 10927 t(h); 10928 "undefined" != typeof p.inputStyle && 10929 (p.style = p.inputStyle); 10930 p.keyboardFocusable = !0; 10931 f.push(new CKEDITOR.ui.dialog.uiElement(b, p, u, "input", null, r)); 10932 u.push(" "); 10933 new CKEDITOR.ui.dialog.uiElement(b, h, u, "label", null, { 10934 id: q, 10935 "for": r.id 10936 }, l[0]); 10937 e.push(u.join("")) 10938 } 10939 new CKEDITOR.ui.dialog.hbox(b, f, e, d); 10940 return d.join("") 10941 }); 10942 this._.children = f 10943 } 10944 }, 10945 button: function(b, a, d) { 10946 if (arguments.length) { 10947 "function" == typeof a && (a = a(b.getParentEditor())); 10948 h.call(this, a, { 10949 disabled: a.disabled || !1 10950 }); 10951 CKEDITOR.event.implementOn(this); 10952 var f = this; 10953 b.on("load", function() { 10954 var a = this.getElement(); 10955 (function() { 10956 a.on("click", function(a) { 10957 f.click(); 10958 a.data.preventDefault() 10959 }); 10960 a.on("keydown", function(a) { 10961 a.data.getKeystroke() in { 10962 32: 1 10963 } && (f.click(), a.data.preventDefault()) 10964 }) 10965 })(); 10966 a.unselectable() 10967 }, this); 10968 var c = CKEDITOR.tools.extend({}, a); 10969 delete c.style; 10970 var e = CKEDITOR.tools.getNextId() + "_label"; 10971 CKEDITOR.ui.dialog.uiElement.call(this, b, c, d, "a", null, { 10972 style: a.style, 10973 href: "javascript:void(0)", 10974 title: a.label, 10975 hidefocus: "true", 10976 "class": a["class"], 10977 role: "button", 10978 "aria-labelledby": e 10979 }, '\x3cspan id\x3d"' + e + '" class\x3d"cke_dialog_ui_button"\x3e' + 10980 CKEDITOR.tools.htmlEncode(a.label) + "\x3c/span\x3e") 10981 } 10982 }, 10983 select: function(b, a, d) { 10984 if (!(3 > arguments.length)) { 10985 var f = h.call(this, a); 10986 a.validate && (this.validate = a.validate); 10987 f.inputId = CKEDITOR.tools.getNextId() + "_select"; 10988 CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function() { 10989 var c = CKEDITOR.tools.extend({}, a, { 10990 id: a.id ? a.id + "_select" : CKEDITOR.tools.getNextId() + "_select" 10991 }, !0), 10992 e = [], 10993 d = [], 10994 g = { 10995 id: f.inputId, 10996 "class": "cke_dialog_ui_input_select", 10997 "aria-labelledby": this._.labelId 10998 }; 10999 e.push('\x3cdiv class\x3d"cke_dialog_ui_input_', 11000 a.type, '" role\x3d"presentation"'); 11001 a.width && e.push('style\x3d"width:' + a.width + '" '); 11002 e.push("\x3e"); 11003 void 0 !== a.size && (g.size = a.size); 11004 void 0 !== a.multiple && (g.multiple = a.multiple); 11005 t(c); 11006 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])); 11007 "undefined" != typeof c.inputStyle && (c.style = c.inputStyle); 11008 f.select = new CKEDITOR.ui.dialog.uiElement(b, c, e, "select", null, 11009 g, d.join("")); 11010 e.push("\x3c/div\x3e"); 11011 return e.join("") 11012 }) 11013 } 11014 }, 11015 file: function(b, a, d) { 11016 if (!(3 > arguments.length)) { 11017 void 0 === a["default"] && (a["default"] = ""); 11018 var f = CKEDITOR.tools.extend(h.call(this, a), { 11019 definition: a, 11020 buttons: [] 11021 }); 11022 a.validate && (this.validate = a.validate); 11023 b.on("load", function() { 11024 CKEDITOR.document.getById(f.frameId).getParent().addClass("cke_dialog_ui_input_file") 11025 }); 11026 CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function() { 11027 f.frameId = CKEDITOR.tools.getNextId() + "_fileInput"; 11028 var b = ['\x3ciframe frameborder\x3d"0" allowtransparency\x3d"0" class\x3d"cke_dialog_ui_input_file" role\x3d"presentation" id\x3d"', 11029 f.frameId, '" title\x3d"', a.label, '" src\x3d"javascript:void(' 11030 ]; 11031 b.push(CKEDITOR.env.ie ? "(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "})()" : "0"); 11032 b.push(')"\x3e\x3c/iframe\x3e'); 11033 return b.join("") 11034 }) 11035 } 11036 }, 11037 fileButton: function(b, a, d) { 11038 var f = this; 11039 if (!(3 > arguments.length)) { 11040 h.call(this, a); 11041 a.validate && (this.validate = a.validate); 11042 var c = CKEDITOR.tools.extend({}, a), 11043 e = c.onClick; 11044 c.className = (c.className ? c.className + " " : "") + "cke_dialog_ui_button"; 11045 c.onClick = function(c) { 11046 var d = 11047 a["for"]; 11048 c = e ? e.call(this, c) : !1; 11049 !1 !== c && ("xhr" !== c && b.getContentElement(d[0], d[1]).submit(), this.disable()) 11050 }; 11051 b.on("load", function() { 11052 b.getContentElement(a["for"][0], a["for"][1])._.buttons.push(f) 11053 }); 11054 CKEDITOR.ui.dialog.button.call(this, b, c, d) 11055 } 11056 }, 11057 html: function() { 11058 var b = /^\s*<[\w:]+\s+([^>]*)?>/, 11059 a = /^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/, 11060 d = /\/$/; 11061 return function(f, c, e) { 11062 if (!(3 > arguments.length)) { 11063 var m = [], 11064 g = c.html; 11065 "\x3c" != g.charAt(0) && (g = "\x3cspan\x3e" + g + "\x3c/span\x3e"); 11066 var k = c.focus; 11067 if (k) { 11068 var l = this.focus; 11069 this.focus = function() { 11070 ("function" == typeof k ? k : l).call(this); 11071 this.fire("focus") 11072 }; 11073 c.isFocusable && (this.isFocusable = this.isFocusable); 11074 this.keyboardFocusable = !0 11075 } 11076 CKEDITOR.ui.dialog.uiElement.call(this, f, c, m, "span", null, null, ""); 11077 m = m.join("").match(b); 11078 g = g.match(a) || ["", "", ""]; 11079 d.test(g[1]) && (g[1] = g[1].slice(0, -1), g[2] = "/" + g[2]); 11080 e.push([g[1], " ", m[1] || "", g[2]].join("")) 11081 } 11082 } 11083 }(), 11084 fieldset: function(b, a, d, f, c) { 11085 var e = c.label; 11086 this._ = { 11087 children: a 11088 }; 11089 CKEDITOR.ui.dialog.uiElement.call(this, b, c, f, "fieldset", null, null, function() { 11090 var a = []; 11091 e && a.push("\x3clegend" + (c.labelStyle ? ' style\x3d"' + c.labelStyle + '"' : "") + "\x3e" + e + "\x3c/legend\x3e"); 11092 for (var b = 0; b < d.length; b++) a.push(d[b]); 11093 return a.join("") 11094 }) 11095 } 11096 }, !0); 11097 CKEDITOR.ui.dialog.html.prototype = new CKEDITOR.ui.dialog.uiElement; 11098 CKEDITOR.ui.dialog.labeledElement.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, { 11099 setLabel: function(b) { 11100 var a = CKEDITOR.document.getById(this._.labelId); 11101 1 > a.getChildCount() ? (new CKEDITOR.dom.text(b, CKEDITOR.document)).appendTo(a) : a.getChild(0).$.nodeValue = 11102 b; 11103 return this 11104 }, 11105 getLabel: function() { 11106 var b = CKEDITOR.document.getById(this._.labelId); 11107 return !b || 1 > b.getChildCount() ? "" : b.getChild(0).getText() 11108 }, 11109 eventProcessors: r 11110 }, !0); 11111 CKEDITOR.ui.dialog.button.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, { 11112 click: function() { 11113 return this._.disabled ? !1 : this.fire("click", { 11114 dialog: this._.dialog 11115 }) 11116 }, 11117 enable: function() { 11118 this._.disabled = !1; 11119 var b = this.getElement(); 11120 b && b.removeClass("cke_disabled") 11121 }, 11122 disable: function() { 11123 this._.disabled = !0; 11124 this.getElement().addClass("cke_disabled") 11125 }, 11126 isVisible: function() { 11127 return this.getElement().getFirst().isVisible() 11128 }, 11129 isEnabled: function() { 11130 return !this._.disabled 11131 }, 11132 eventProcessors: CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, { 11133 onClick: function(b, a) { 11134 this.on("click", function() { 11135 a.apply(this, arguments) 11136 }) 11137 } 11138 }, !0), 11139 accessKeyUp: function() { 11140 this.click() 11141 }, 11142 accessKeyDown: function() { 11143 this.focus() 11144 }, 11145 keyboardFocusable: !0 11146 }, !0); 11147 CKEDITOR.ui.dialog.textInput.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, { 11148 getInputElement: function() { 11149 return CKEDITOR.document.getById(this._.inputId) 11150 }, 11151 focus: function() { 11152 var b = this.selectParentTab(); 11153 setTimeout(function() { 11154 var a = b.getInputElement(); 11155 a && a.$.focus() 11156 }, 0) 11157 }, 11158 select: function() { 11159 var b = this.selectParentTab(); 11160 setTimeout(function() { 11161 var a = b.getInputElement(); 11162 a && (a.$.focus(), a.$.select()) 11163 }, 0) 11164 }, 11165 accessKeyUp: function() { 11166 this.select() 11167 }, 11168 setValue: function(b) { 11169 if (this.bidi) { 11170 var a = b && b.charAt(0); 11171 (a = "" == a ? "ltr" : "" == a ? "rtl" : null) && (b = b.slice(1)); 11172 this.setDirectionMarker(a) 11173 } 11174 b || (b = ""); 11175 return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this, arguments) 11176 }, 11177 getValue: function() { 11178 var b = CKEDITOR.ui.dialog.uiElement.prototype.getValue.call(this); 11179 if (this.bidi && b) { 11180 var a = this.getDirectionMarker(); 11181 a && (b = ("ltr" == a ? "" : "") + b) 11182 } 11183 return b 11184 }, 11185 setDirectionMarker: function(b) { 11186 var a = this.getInputElement(); 11187 b ? a.setAttributes({ 11188 dir: b, 11189 "data-cke-dir-marker": b 11190 }) : this.getDirectionMarker() && a.removeAttributes(["dir", "data-cke-dir-marker"]) 11191 }, 11192 getDirectionMarker: function() { 11193 return this.getInputElement().data("cke-dir-marker") 11194 }, 11195 keyboardFocusable: !0 11196 }, q, !0); 11197 CKEDITOR.ui.dialog.textarea.prototype = 11198 new CKEDITOR.ui.dialog.textInput; 11199 CKEDITOR.ui.dialog.select.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, { 11200 getInputElement: function() { 11201 return this._.select.getElement() 11202 }, 11203 add: function(b, a, d) { 11204 var f = new CKEDITOR.dom.element("option", this.getDialog().getParentEditor().document), 11205 c = this.getInputElement().$; 11206 f.$.text = b; 11207 f.$.value = void 0 === a || null === a ? b : a; 11208 void 0 === d || null === d ? CKEDITOR.env.ie ? c.add(f.$) : c.add(f.$, null) : c.add(f.$, d); 11209 return this 11210 }, 11211 remove: function(b) { 11212 this.getInputElement().$.remove(b); 11213 return this 11214 }, 11215 clear: function() { 11216 for (var b = this.getInputElement().$; 0 < b.length;) b.remove(0); 11217 return this 11218 }, 11219 keyboardFocusable: !0 11220 }, q, !0); 11221 CKEDITOR.ui.dialog.checkbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, { 11222 getInputElement: function() { 11223 return this._.checkbox.getElement() 11224 }, 11225 setValue: function(b, a) { 11226 this.getInputElement().$.checked = b; 11227 !a && this.fire("change", { 11228 value: b 11229 }) 11230 }, 11231 getValue: function() { 11232 return this.getInputElement().$.checked 11233 }, 11234 accessKeyUp: function() { 11235 this.setValue(!this.getValue()) 11236 }, 11237 eventProcessors: { 11238 onChange: function(b, 11239 a) { 11240 if (!CKEDITOR.env.ie || 8 < CKEDITOR.env.version) return r.onChange.apply(this, arguments); 11241 b.on("load", function() { 11242 var a = this._.checkbox.getElement(); 11243 a.on("propertychange", function(b) { 11244 b = b.data.$; 11245 "checked" == b.propertyName && this.fire("change", { 11246 value: a.$.checked 11247 }) 11248 }, this) 11249 }, this); 11250 this.on("change", a); 11251 return null 11252 } 11253 }, 11254 keyboardFocusable: !0 11255 }, q, !0); 11256 CKEDITOR.ui.dialog.radio.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, { 11257 setValue: function(b, a) { 11258 for (var d = this._.children, f, c = 0; c < d.length && (f = d[c]); c++) f.getElement().$.checked = 11259 f.getValue() == b; 11260 !a && this.fire("change", { 11261 value: b 11262 }) 11263 }, 11264 getValue: function() { 11265 for (var b = this._.children, a = 0; a < b.length; a++) 11266 if (b[a].getElement().$.checked) return b[a].getValue(); 11267 return null 11268 }, 11269 accessKeyUp: function() { 11270 var b = this._.children, 11271 a; 11272 for (a = 0; a < b.length; a++) 11273 if (b[a].getElement().$.checked) { 11274 b[a].getElement().focus(); 11275 return 11276 } b[0].getElement().focus() 11277 }, 11278 eventProcessors: { 11279 onChange: function(b, a) { 11280 if (!CKEDITOR.env.ie || 8 < CKEDITOR.env.version) return r.onChange.apply(this, arguments); 11281 b.on("load", function() { 11282 for (var a = 11283 this._.children, b = this, c = 0; c < a.length; c++) a[c].getElement().on("propertychange", function(a) { 11284 a = a.data.$; 11285 "checked" == a.propertyName && this.$.checked && b.fire("change", { 11286 value: this.getAttribute("value") 11287 }) 11288 }) 11289 }, this); 11290 this.on("change", a); 11291 return null 11292 } 11293 } 11294 }, q, !0); 11295 CKEDITOR.ui.dialog.file.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, q, { 11296 getInputElement: function() { 11297 var b = CKEDITOR.document.getById(this._.frameId).getFrameDocument(); 11298 return 0 < b.$.forms.length ? new CKEDITOR.dom.element(b.$.forms[0].elements[0]) : 11299 this.getElement() 11300 }, 11301 submit: function() { 11302 this.getInputElement().getParent().$.submit(); 11303 return this 11304 }, 11305 getAction: function() { 11306 return this.getInputElement().getParent().$.action 11307 }, 11308 registerEvents: function(b) { 11309 var a = /^on([A-Z]\w+)/, 11310 d, f = function(a, b, c, d) { 11311 a.on("formLoaded", function() { 11312 a.getInputElement().on(c, d, a) 11313 }) 11314 }, 11315 c; 11316 for (c in b) 11317 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]); 11318 return this 11319 }, 11320 reset: function() { 11321 function b() { 11322 d.$.open(); 11323 var b = ""; 11324 f.size && (b = f.size - (CKEDITOR.env.ie ? 7 : 0)); 11325 var h = a.frameId + "_input"; 11326 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), 11327 '\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" 11328 ].join("")); 11329 d.$.close(); 11330 for (b = 0; b < c.length; b++) c[b].enable() 11331 } 11332 var a = this._, 11333 d = CKEDITOR.document.getById(a.frameId).getFrameDocument(), 11334 f = a.definition, 11335 c = a.buttons, 11336 e = this.formLoadedNumber, 11337 m = this.formUnloadNumber, 11338 g = a.dialog._.editor.lang.dir, 11339 k = a.dialog._.editor.langCode; 11340 e || (e = this.formLoadedNumber = CKEDITOR.tools.addFunction(function() { 11341 this.fire("formLoaded") 11342 }, this), m = this.formUnloadNumber = CKEDITOR.tools.addFunction(function() { 11343 this.getInputElement().clearCustomData() 11344 }, this), this.getDialog()._.editor.on("destroy", function() { 11345 CKEDITOR.tools.removeFunction(e); 11346 CKEDITOR.tools.removeFunction(m) 11347 })); 11348 CKEDITOR.env.gecko ? setTimeout(b, 500) : b() 11349 }, 11350 getValue: function() { 11351 return this.getInputElement().$.value || "" 11352 }, 11353 setInitValue: function() { 11354 this._.initValue = "" 11355 }, 11356 eventProcessors: { 11357 onChange: function(b, a) { 11358 this._.domOnChangeRegistered || (this.on("formLoaded", function() { 11359 this.getInputElement().on("change", function() { 11360 this.fire("change", { 11361 value: this.getValue() 11362 }) 11363 }, this) 11364 }, this), this._.domOnChangeRegistered = !0); 11365 this.on("change", a) 11366 } 11367 }, 11368 keyboardFocusable: !0 11369 }, !0); 11370 CKEDITOR.ui.dialog.fileButton.prototype = 11371 new CKEDITOR.ui.dialog.button; 11372 CKEDITOR.ui.dialog.fieldset.prototype = CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype); 11373 CKEDITOR.dialog.addUIElement("text", v); 11374 CKEDITOR.dialog.addUIElement("password", v); 11375 CKEDITOR.dialog.addUIElement("textarea", n); 11376 CKEDITOR.dialog.addUIElement("checkbox", n); 11377 CKEDITOR.dialog.addUIElement("radio", n); 11378 CKEDITOR.dialog.addUIElement("button", n); 11379 CKEDITOR.dialog.addUIElement("select", n); 11380 CKEDITOR.dialog.addUIElement("file", n); 11381 CKEDITOR.dialog.addUIElement("fileButton", n); 11382 CKEDITOR.dialog.addUIElement("html", 11383 n); 11384 CKEDITOR.dialog.addUIElement("fieldset", { 11385 build: function(b, a, d) { 11386 for (var f = a.children, c, e = [], h = [], g = 0; g < f.length && (c = f[g]); g++) { 11387 var k = []; 11388 e.push(k); 11389 h.push(CKEDITOR.dialog._.uiElementBuilders[c.type].build(b, c, k)) 11390 } 11391 return new CKEDITOR.ui.dialog[a.type](b, h, e, d, a) 11392 } 11393 }) 11394 } 11395 }); 11396 CKEDITOR.DIALOG_RESIZE_NONE = 0; 11397 CKEDITOR.DIALOG_RESIZE_WIDTH = 1; 11398 CKEDITOR.DIALOG_RESIZE_HEIGHT = 2; 11399 CKEDITOR.DIALOG_RESIZE_BOTH = 3; 11400 CKEDITOR.DIALOG_STATE_IDLE = 1; 11401 CKEDITOR.DIALOG_STATE_BUSY = 2; 11402 (function() { 11403 function x() { 11404 for (var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId) + a, c = b - 1; c > b - a; c--) 11405 if (this._.tabs[this._.tabIdList[c % a]][0].$.offsetHeight) return this._.tabIdList[c % a]; 11406 return null 11407 } 11408 11409 function A() { 11410 for (var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId), c = b + 1; c < b + a; c++) 11411 if (this._.tabs[this._.tabIdList[c % a]][0].$.offsetHeight) return this._.tabIdList[c % a]; 11412 return null 11413 } 11414 11415 function K(a, b) { 11416 for (var c = a.$.getElementsByTagName("input"), 11417 e = 0, d = c.length; e < d; e++) { 11418 var f = new CKEDITOR.dom.element(c[e]); 11419 "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", ""))) 11420 } 11421 } 11422 11423 function T(a, b) { 11424 var c = this.getInputElement(); 11425 c && (a ? c.removeAttribute("aria-invalid") : c.setAttribute("aria-invalid", !0)); 11426 a || (this.select ? this.select() : this.focus()); 11427 b && alert(b); 11428 this.fire("validated", { 11429 valid: a, 11430 msg: b 11431 }) 11432 } 11433 11434 function U() { 11435 var a = this.getInputElement(); 11436 a && a.removeAttribute("aria-invalid") 11437 } 11438 11439 function V(a) { 11440 var b = CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog", W).output({ 11441 id: CKEDITOR.tools.getNextNumber(), 11442 editorId: a.id, 11443 langDir: a.lang.dir, 11444 langCode: a.langCode, 11445 editorDialogClass: "cke_editor_" + a.name.replace(/\./g, "\\.") + "_dialog", 11446 closeTitle: a.lang.common.close, 11447 hidpi: CKEDITOR.env.hidpi ? "cke_hidpi" : "" 11448 })), 11449 c = b.getChild([0, 0, 0, 0, 0]), 11450 e = c.getChild(0), 11451 d = c.getChild(1); 11452 a.plugins.clipboard && CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(c); 11453 !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())); 11454 e.unselectable(); 11455 d.unselectable(); 11456 return { 11457 element: b, 11458 parts: { 11459 dialog: b.getChild(0), 11460 title: e, 11461 close: d, 11462 tabs: c.getChild(2), 11463 contents: c.getChild([3, 0, 0, 0]), 11464 footer: c.getChild([3, 0, 1, 0]) 11465 } 11466 } 11467 } 11468 11469 function L(a, b, c) { 11470 this.element = b; 11471 this.focusIndex = c; 11472 this.tabIndex = 0; 11473 this.isFocusable = function() { 11474 return !b.getAttribute("disabled") && b.isVisible() 11475 }; 11476 this.focus = function() { 11477 a._.currentFocusIndex = this.focusIndex; 11478 this.element.focus() 11479 }; 11480 b.on("keydown", function(a) { 11481 a.data.getKeystroke() in { 11482 32: 1, 11483 13: 1 11484 } && this.fire("click") 11485 }); 11486 b.on("focus", function() { 11487 this.fire("mouseover") 11488 }); 11489 b.on("blur", function() { 11490 this.fire("mouseout") 11491 }) 11492 } 11493 11494 function X(a) { 11495 function b() { 11496 a.layout() 11497 } 11498 var c = CKEDITOR.document.getWindow(); 11499 c.on("resize", b); 11500 a.on("hide", function() { 11501 c.removeListener("resize", b) 11502 }) 11503 } 11504 11505 function M(a, b) { 11506 this._ = { 11507 dialog: a 11508 }; 11509 CKEDITOR.tools.extend(this, b) 11510 } 11511 11512 function Y(a) { 11513 function b(b) { 11514 var c = a.getSize(), 11515 k = CKEDITOR.document.getWindow().getViewPaneSize(), 11516 q = b.data.$.screenX, 11517 n = b.data.$.screenY, 11518 r = q - e.x, 11519 l = n - e.y; 11520 e = { 11521 x: q, 11522 y: n 11523 }; 11524 d.x += r; 11525 d.y += l; 11526 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); 11527 b.data.preventDefault() 11528 } 11529 11530 function c() { 11531 CKEDITOR.document.removeListener("mousemove", b); 11532 CKEDITOR.document.removeListener("mouseup", c); 11533 if (CKEDITOR.env.ie6Compat) { 11534 var a = u.getChild(0).getFrameDocument(); 11535 a.removeListener("mousemove", b); 11536 a.removeListener("mouseup", c) 11537 } 11538 } 11539 var e = null, 11540 d = null, 11541 f = a.getParentEditor(), 11542 g = f.config.dialog_magnetDistance, 11543 h = CKEDITOR.skin.margins || [0, 0, 0, 0]; 11544 "undefined" == typeof g && (g = 20); 11545 a.parts.title.on("mousedown", function(g) { 11546 e = { 11547 x: g.data.$.screenX, 11548 y: g.data.$.screenY 11549 }; 11550 CKEDITOR.document.on("mousemove", b); 11551 CKEDITOR.document.on("mouseup", 11552 c); 11553 d = a.getPosition(); 11554 if (CKEDITOR.env.ie6Compat) { 11555 var f = u.getChild(0).getFrameDocument(); 11556 f.on("mousemove", b); 11557 f.on("mouseup", c) 11558 } 11559 g.data.preventDefault() 11560 }, a) 11561 } 11562 11563 function Z(a) { 11564 function b(b) { 11565 var c = "rtl" == f.lang.dir, 11566 n = k.width, 11567 q = k.height, 11568 G = n + (b.data.$.screenX - m.x) * (c ? -1 : 1) * (a._.moved ? 1 : 2), 11569 H = q + (b.data.$.screenY - m.y) * (a._.moved ? 1 : 2), 11570 B = a._.element.getFirst(), 11571 B = c && B.getComputedStyle("right"), 11572 C = a.getPosition(); 11573 C.y + H > p.height && (H = p.height - C.y); 11574 (c ? B : C.x) + G > p.width && (G = p.width - (c ? B : C.x)); 11575 if (d == CKEDITOR.DIALOG_RESIZE_WIDTH || 11576 d == CKEDITOR.DIALOG_RESIZE_BOTH) n = Math.max(e.minWidth || 0, G - g); 11577 if (d == CKEDITOR.DIALOG_RESIZE_HEIGHT || d == CKEDITOR.DIALOG_RESIZE_BOTH) q = Math.max(e.minHeight || 0, H - h); 11578 a.resize(n, q); 11579 a._.moved || a.layout(); 11580 b.data.preventDefault() 11581 } 11582 11583 function c() { 11584 CKEDITOR.document.removeListener("mouseup", c); 11585 CKEDITOR.document.removeListener("mousemove", b); 11586 q && (q.remove(), q = null); 11587 if (CKEDITOR.env.ie6Compat) { 11588 var a = u.getChild(0).getFrameDocument(); 11589 a.removeListener("mouseup", c); 11590 a.removeListener("mousemove", b) 11591 } 11592 } 11593 var e = a.definition, 11594 d = e.resizable; 11595 if (d != CKEDITOR.DIALOG_RESIZE_NONE) { 11596 var f = a.getParentEditor(), 11597 g, h, p, m, k, q, n = CKEDITOR.tools.addFunction(function(d) { 11598 k = a.getSize(); 11599 var e = a.parts.contents; 11600 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)); 11601 h = k.height - a.parts.contents.getSize("height", !(CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.quirks)); 11602 g = k.width - a.parts.contents.getSize("width", 11603 1); 11604 m = { 11605 x: d.screenX, 11606 y: d.screenY 11607 }; 11608 p = CKEDITOR.document.getWindow().getViewPaneSize(); 11609 CKEDITOR.document.on("mousemove", b); 11610 CKEDITOR.document.on("mouseup", c); 11611 CKEDITOR.env.ie6Compat && (e = u.getChild(0).getFrameDocument(), e.on("mousemove", b), e.on("mouseup", c)); 11612 d.preventDefault && d.preventDefault() 11613 }); 11614 a.on("load", function() { 11615 var b = ""; 11616 d == CKEDITOR.DIALOG_RESIZE_WIDTH ? b = " cke_resizer_horizontal" : d == CKEDITOR.DIALOG_RESIZE_HEIGHT && (b = " cke_resizer_vertical"); 11617 b = CKEDITOR.dom.element.createFromHtml('\x3cdiv class\x3d"cke_resizer' + 11618 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"); 11619 a.parts.footer.append(b, 1) 11620 }); 11621 f.on("destroy", function() { 11622 CKEDITOR.tools.removeFunction(n) 11623 }) 11624 } 11625 } 11626 11627 function I(a) { 11628 a.data.preventDefault(1) 11629 } 11630 11631 function N(a) { 11632 var b = CKEDITOR.document.getWindow(), 11633 c = a.config, 11634 e = CKEDITOR.skinName || a.config.skin, 11635 d = c.dialog_backgroundCoverColor || ("moono-lisa" == e ? "black" : "white"), 11636 e = c.dialog_backgroundCoverOpacity, 11637 f = c.baseFloatZIndex, 11638 c = CKEDITOR.tools.genKey(d, e, f), 11639 g = z[c]; 11640 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:'), 11641 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()), 11642 z[c] = g); 11643 a.focusManager.add(g); 11644 u = g; 11645 a = function() { 11646 var a = b.getViewPaneSize(); 11647 g.setStyles({ 11648 width: a.width + "px", 11649 height: a.height + "px" 11650 }) 11651 }; 11652 var h = function() { 11653 var a = b.getScrollPosition(), 11654 c = CKEDITOR.dialog._.currentTop; 11655 g.setStyles({ 11656 left: a.x + "px", 11657 top: a.y + "px" 11658 }); 11659 if (c) { 11660 do a = c.getPosition(), c.move(a.x, a.y); while (c = c._.parentDialog) 11661 } 11662 }; 11663 J = a; 11664 b.on("resize", a); 11665 a(); 11666 CKEDITOR.env.mac && CKEDITOR.env.webkit || g.focus(); 11667 if (CKEDITOR.env.ie6Compat) { 11668 var p = function() { 11669 h(); 11670 arguments.callee.prevScrollHandler.apply(this, arguments) 11671 }; 11672 b.$.setTimeout(function() { 11673 p.prevScrollHandler = 11674 window.onscroll || function() {}; 11675 window.onscroll = p 11676 }, 0); 11677 h() 11678 } 11679 } 11680 11681 function O(a) { 11682 u && (a.focusManager.remove(u), a = CKEDITOR.document.getWindow(), u.hide(), a.removeListener("resize", J), CKEDITOR.env.ie6Compat && a.$.setTimeout(function() { 11683 window.onscroll = window.onscroll && window.onscroll.prevScrollHandler || null 11684 }, 0), J = null) 11685 } 11686 var v = CKEDITOR.tools.cssLength, 11687 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 ' + 11688 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'; 11689 CKEDITOR.dialog = function(a, b) { 11690 function c() { 11691 var a = l._.focusList; 11692 a.sort(function(a, b) { 11693 return a.tabIndex != b.tabIndex ? b.tabIndex - a.tabIndex : a.focusIndex - b.focusIndex 11694 }); 11695 for (var b = a.length, c = 0; c < b; c++) a[c].focusIndex = c 11696 } 11697 11698 function e(a) { 11699 var b = l._.focusList; 11700 a = a || 0; 11701 if (!(1 > b.length)) { 11702 var c = l._.currentFocusIndex; 11703 l._.tabBarMode && 0 > a && (c = 0); 11704 try { 11705 b[c].getInputElement().$.blur() 11706 } catch (d) {} 11707 var e = c, 11708 g = 1 < l._.pageCount; 11709 do { 11710 e += a; 11711 if (g && !l._.tabBarMode && (e == b.length || -1 == e)) { 11712 l._.tabBarMode = !0; 11713 l._.tabs[l._.currentTabId][0].focus(); 11714 l._.currentFocusIndex = -1; 11715 return 11716 } 11717 e = (e + b.length) % b.length; 11718 if (e == c) break 11719 } while (a && !b[e].isFocusable()); 11720 b[e].focus(); 11721 "text" == b[e].type && b[e].select() 11722 } 11723 } 11724 11725 function d(b) { 11726 if (l == CKEDITOR.dialog._.currentTop) { 11727 var c = b.data.getKeystroke(), 11728 d = "rtl" == a.lang.dir, 11729 g = [37, 38, 39, 40]; 11730 q = n = 0; 11731 if (9 == c || c == CKEDITOR.SHIFT + 9) e(c == CKEDITOR.SHIFT + 9 ? -1 : 1), q = 1; 11732 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; 11733 else if (-1 != CKEDITOR.tools.indexOf(g, 11734 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; 11735 else if (13 != c && 32 != c || !l._.tabBarMode) 11736 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; 11737 else if (27 == c)(c = this.getButton("cancel")) ? CKEDITOR.tools.setTimeout(c.click, 0, c) : !1 !== this.fire("cancel", { 11738 hide: !0 11739 }).hide && this.hide(), n = 1; 11740 else return; 11741 else this.selectPage(this._.currentTabId), 11742 this._.tabBarMode = !1, this._.currentFocusIndex = -1, e(1), q = 1; 11743 f(b) 11744 } 11745 } 11746 11747 function f(a) { 11748 q ? a.data.preventDefault(1) : n && a.data.stopPropagation() 11749 } 11750 var g = CKEDITOR.dialog._.dialogDefinitions[b], 11751 h = CKEDITOR.tools.clone(aa), 11752 p = a.config.dialog_buttonsOrder || "OS", 11753 m = a.lang.dir, 11754 k = {}, 11755 q, n; 11756 ("OS" == p && CKEDITOR.env.mac || "rtl" == p && "ltr" == m || "ltr" == p && "rtl" == m) && h.buttons.reverse(); 11757 g = CKEDITOR.tools.extend(g(a), h); 11758 g = CKEDITOR.tools.clone(g); 11759 g = new P(this, g); 11760 h = V(a); 11761 this._ = { 11762 editor: a, 11763 element: h.element, 11764 name: b, 11765 contentSize: { 11766 width: 0, 11767 height: 0 11768 }, 11769 size: { 11770 width: 0, 11771 height: 0 11772 }, 11773 contents: {}, 11774 buttons: {}, 11775 accessKeyMap: {}, 11776 tabs: {}, 11777 tabIdList: [], 11778 currentTabId: null, 11779 currentTabIndex: null, 11780 pageCount: 0, 11781 lastTab: null, 11782 tabBarMode: !1, 11783 focusList: [], 11784 currentFocusIndex: 0, 11785 hasFocus: !1 11786 }; 11787 this.parts = h.parts; 11788 CKEDITOR.tools.setTimeout(function() { 11789 a.fire("ariaWidget", this.parts.contents) 11790 }, 0, this); 11791 h = { 11792 position: CKEDITOR.env.ie6Compat ? "absolute" : "fixed", 11793 top: 0, 11794 visibility: "hidden" 11795 }; 11796 h["rtl" == m ? "right" : "left"] = 0; 11797 this.parts.dialog.setStyles(h); 11798 CKEDITOR.event.call(this); 11799 this.definition = g = CKEDITOR.fire("dialogDefinition", { 11800 name: b, 11801 definition: g 11802 }, a).definition; 11803 if (!("removeDialogTabs" in a._) && a.config.removeDialogTabs) { 11804 h = a.config.removeDialogTabs.split(";"); 11805 for (m = 0; m < h.length; m++) 11806 if (p = h[m].split(":"), 2 == p.length) { 11807 var r = p[0]; 11808 k[r] || (k[r] = []); 11809 k[r].push(p[1]) 11810 } a._.removeDialogTabs = k 11811 } 11812 if (a._.removeDialogTabs && (k = a._.removeDialogTabs[b])) 11813 for (m = 0; m < k.length; m++) g.removeContents(k[m]); 11814 if (g.onLoad) this.on("load", g.onLoad); 11815 if (g.onShow) this.on("show", g.onShow); 11816 if (g.onHide) this.on("hide", g.onHide); 11817 if (g.onOk) this.on("ok", function(b) { 11818 a.fire("saveSnapshot"); 11819 setTimeout(function() { 11820 a.fire("saveSnapshot") 11821 }, 0); 11822 !1 === g.onOk.call(this, b) && (b.data.hide = !1) 11823 }); 11824 this.state = CKEDITOR.DIALOG_STATE_IDLE; 11825 if (g.onCancel) this.on("cancel", function(a) { 11826 !1 === g.onCancel.call(this, a) && (a.data.hide = !1) 11827 }); 11828 var l = this, 11829 t = function(a) { 11830 var b = l._.contents, 11831 c = !1, 11832 d; 11833 for (d in b) 11834 for (var e in b[d]) 11835 if (c = a.call(this, b[d][e])) return 11836 }; 11837 this.on("ok", function(a) { 11838 t(function(b) { 11839 if (b.validate) { 11840 var c = b.validate(this), 11841 d = "string" == typeof c || !1 === c; 11842 d && (a.data.hide = !1, a.stop()); 11843 T.call(b, !d, "string" == typeof c ? 11844 c : void 0); 11845 return d 11846 } 11847 }) 11848 }, this, null, 0); 11849 this.on("cancel", function(b) { 11850 t(function(c) { 11851 if (c.isChanged()) return a.config.dialog_noConfirmCancel || confirm(a.lang.common.confirmCancel) || (b.data.hide = !1), !0 11852 }) 11853 }, this, null, 0); 11854 this.parts.close.on("click", function(a) { 11855 !1 !== this.fire("cancel", { 11856 hide: !0 11857 }).hide && this.hide(); 11858 a.data.preventDefault() 11859 }, this); 11860 this.changeFocus = e; 11861 var y = this._.element; 11862 a.focusManager.add(y, 1); 11863 this.on("show", function() { 11864 y.on("keydown", d, this); 11865 if (CKEDITOR.env.gecko) y.on("keypress", f, this) 11866 }); 11867 this.on("hide", 11868 function() { 11869 y.removeListener("keydown", d); 11870 CKEDITOR.env.gecko && y.removeListener("keypress", f); 11871 t(function(a) { 11872 U.apply(a) 11873 }) 11874 }); 11875 this.on("iframeAdded", function(a) { 11876 (new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document)).on("keydown", d, this, null, 0) 11877 }); 11878 this.on("show", function() { 11879 c(); 11880 var b = 1 < l._.pageCount; 11881 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 ? 11882 (b = g.onFocus.call(this)) && b.focus() : e(1)) 11883 }, this, null, 4294967295); 11884 if (CKEDITOR.env.ie6Compat) this.on("load", function() { 11885 var a = this.getElement(), 11886 b = a.getFirst(); 11887 b.remove(); 11888 b.appendTo(a) 11889 }, this); 11890 Y(this); 11891 Z(this); 11892 (new CKEDITOR.dom.text(g.title, CKEDITOR.document)).appendTo(this.parts.title); 11893 for (m = 0; m < g.contents.length; m++)(k = g.contents[m]) && this.addPage(k); 11894 this.parts.tabs.on("click", function(a) { 11895 var b = a.data.getTarget(); 11896 b.hasClass("cke_dialog_tab") && (b = b.$.id, this.selectPage(b.substring(4, b.lastIndexOf("_"))), 11897 this._.tabBarMode && (this._.tabBarMode = !1, this._.currentFocusIndex = -1, e(1)), a.data.preventDefault()) 11898 }, this); 11899 m = []; 11900 k = CKEDITOR.dialog._.uiElementBuilders.hbox.build(this, { 11901 type: "hbox", 11902 className: "cke_dialog_footer_buttons", 11903 widths: [], 11904 children: g.buttons 11905 }, m).getChild(); 11906 this.parts.footer.setHtml(m.join("")); 11907 for (m = 0; m < k.length; m++) this._.buttons[k[m].id] = k[m] 11908 }; 11909 CKEDITOR.dialog.prototype = { 11910 destroy: function() { 11911 this.hide(); 11912 this._.element.remove() 11913 }, 11914 resize: function() { 11915 return function(a, b) { 11916 this._.contentSize && this._.contentSize.width == 11917 a && this._.contentSize.height == b || (CKEDITOR.dialog.fire("resize", { 11918 dialog: this, 11919 width: a, 11920 height: b 11921 }, this._.editor), this.fire("resize", { 11922 width: a, 11923 height: b 11924 }, this._.editor), this.parts.contents.setStyles({ 11925 width: a + "px", 11926 height: b + "px" 11927 }), "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 = { 11928 width: a, 11929 height: b 11930 }) 11931 } 11932 }(), 11933 getSize: function() { 11934 var a = this._.element.getFirst(); 11935 return { 11936 width: a.$.offsetWidth || 0, 11937 height: a.$.offsetHeight || 0 11938 } 11939 }, 11940 move: function(a, b, c) { 11941 var e = this._.element.getFirst(), 11942 d = "rtl" == this._.editor.lang.dir, 11943 f = "fixed" == e.getComputedStyle("position"); 11944 CKEDITOR.env.ie && e.setStyle("zoom", "100%"); 11945 f && this._.position && this._.position.x == a && this._.position.y == b || (this._.position = { 11946 x: a, 11947 y: b 11948 }, 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 = { 11949 top: (0 < b ? b : 0) + "px" 11950 }, 11951 b[d ? "right" : "left"] = (0 < a ? a : 0) + "px", e.setStyles(b), c && (this._.moved = 1)) 11952 }, 11953 getPosition: function() { 11954 return CKEDITOR.tools.extend({}, this._.position) 11955 }, 11956 show: function() { 11957 var a = this._.element, 11958 b = this.definition; 11959 a.getParent() && a.getParent().equals(CKEDITOR.document.getBody()) ? a.setStyle("display", "block") : a.appendTo(CKEDITOR.document.getBody()); 11960 this.resize(this._.contentSize && this._.contentSize.width || b.width || b.minWidth, this._.contentSize && this._.contentSize.height || b.height || b.minHeight); 11961 this.reset(); 11962 null === 11963 this._.currentTabId && this.selectPage(this.definition.contents[0].id); 11964 null === CKEDITOR.dialog._.currentZIndex && (CKEDITOR.dialog._.currentZIndex = this._.editor.config.baseFloatZIndex); 11965 this._.element.getFirst().setStyle("z-index", CKEDITOR.dialog._.currentZIndex += 10); 11966 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 / 11967 2), CKEDITOR.dialog._.currentTop = this); 11968 a.on("keydown", Q); 11969 a.on("keyup", R); 11970 this._.hasFocus = !1; 11971 for (var c in b.contents) 11972 if (b.contents[c]) { 11973 var a = b.contents[c], 11974 e = this._.tabs[a.id], 11975 d = a.requiredContent, 11976 f = 0; 11977 if (e) { 11978 for (var g in this._.contents[a.id]) { 11979 var h = this._.contents[a.id][g]; 11980 "hbox" != h.type && "vbox" != h.type && h.getInputElement() && (h.requiredContent && !this._.editor.activeFilter.check(h.requiredContent) ? h.disable() : (h.enable(), f++)) 11981 }!f || d && !this._.editor.activeFilter.check(d) ? e[0].addClass("cke_dialog_tab_disabled") : 11982 e[0].removeClass("cke_dialog_tab_disabled") 11983 } 11984 } CKEDITOR.tools.setTimeout(function() { 11985 this.layout(); 11986 X(this); 11987 this.parts.dialog.setStyle("visibility", ""); 11988 this.fireOnce("load", {}); 11989 CKEDITOR.ui.fire("ready", this); 11990 this.fire("show", {}); 11991 this._.editor.fire("dialogShow", this); 11992 this._.parentDialog || this._.editor.focusManager.lock(); 11993 this.foreach(function(a) { 11994 a.setInitValue && a.setInitValue() 11995 }) 11996 }, 100, this) 11997 }, 11998 layout: function() { 11999 var a = this.parts.dialog, 12000 b = this.getSize(), 12001 c = CKEDITOR.document.getWindow().getViewPaneSize(), 12002 e = 12003 (c.width - b.width) / 2, 12004 d = (c.height - b.height) / 2; 12005 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")); 12006 this.move(this._.moved ? this._.position.x : e, this._.moved ? this._.position.y : d) 12007 }, 12008 foreach: function(a) { 12009 for (var b in this._.contents) 12010 for (var c in this._.contents[b]) a.call(this, this._.contents[b][c]); 12011 return this 12012 }, 12013 reset: function() { 12014 var a = function(a) { 12015 a.reset && a.reset(1) 12016 }; 12017 return function() { 12018 this.foreach(a); 12019 return this 12020 } 12021 }(), 12022 setupContent: function() { 12023 var a = arguments; 12024 this.foreach(function(b) { 12025 b.setup && b.setup.apply(b, a) 12026 }) 12027 }, 12028 commitContent: function() { 12029 var a = arguments; 12030 this.foreach(function(b) { 12031 CKEDITOR.env.ie && this._.currentFocusIndex == b.focusIndex && b.getInputElement().$.blur(); 12032 b.commit && b.commit.apply(b, a) 12033 }) 12034 }, 12035 hide: function() { 12036 if (this.parts.dialog.isVisible()) { 12037 this.fire("hide", {}); 12038 this._.editor.fire("dialogHide", this); 12039 this.selectPage(this._.tabIdList[0]); 12040 var a = this._.element; 12041 a.setStyle("display", "none"); 12042 this.parts.dialog.setStyle("visibility", 12043 "hidden"); 12044 for (ba(this); CKEDITOR.dialog._.currentTop != this;) CKEDITOR.dialog._.currentTop.hide(); 12045 if (this._.parentDialog) { 12046 var b = this._.parentDialog.getElement().getFirst(); 12047 b.setStyle("z-index", parseInt(b.$.style.zIndex, 10) + Math.floor(this._.editor.config.baseFloatZIndex / 2)) 12048 } else O(this._.editor); 12049 if (CKEDITOR.dialog._.currentTop = this._.parentDialog) CKEDITOR.dialog._.currentZIndex -= 10; 12050 else { 12051 CKEDITOR.dialog._.currentZIndex = null; 12052 a.removeListener("keydown", Q); 12053 a.removeListener("keyup", R); 12054 var c = this._.editor; 12055 c.focus(); 12056 setTimeout(function() { 12057 c.focusManager.unlock(); 12058 CKEDITOR.env.iOS && c.window.focus() 12059 }, 0) 12060 } 12061 delete this._.parentDialog; 12062 this.foreach(function(a) { 12063 a.resetInitValue && a.resetInitValue() 12064 }); 12065 this.setState(CKEDITOR.DIALOG_STATE_IDLE) 12066 } 12067 }, 12068 addPage: function(a) { 12069 if (!a.requiredContent || this._.editor.filter.check(a.requiredContent)) { 12070 for (var b = [], c = a.label ? ' title\x3d"' + CKEDITOR.tools.htmlEncode(a.label) + '"' : "", e = CKEDITOR.dialog._.uiElementBuilders.vbox.build(this, { 12071 type: "vbox", 12072 className: "cke_dialog_page_contents", 12073 children: a.elements, 12074 expand: !!a.expand, 12075 padding: a.padding, 12076 style: a.style || "width: 100%;" 12077 }, 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()); 12078 g || (a.hidden = !0); 12079 b = CKEDITOR.dom.element.createFromHtml(b.join("")); 12080 b.setAttribute("role", "tabpanel"); 12081 e = CKEDITOR.env; 12082 d = "cke_" + a.id + "_" + CKEDITOR.tools.getNextNumber(); 12083 c = CKEDITOR.dom.element.createFromHtml(['\x3ca class\x3d"cke_dialog_tab"', 12084 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" 12085 ].join("")); 12086 b.setAttribute("aria-labelledby", d); 12087 this._.tabs[a.id] = [c, b]; 12088 this._.tabIdList.push(a.id); 12089 !a.hidden && this._.pageCount++; 12090 this._.lastTab = c; 12091 this.updateStyle(); 12092 b.setAttribute("name", a.id); 12093 b.appendTo(this.parts.contents); 12094 c.unselectable(); 12095 this.parts.tabs.append(c); 12096 a.accessKey && 12097 (S(this, this, "CTRL+" + a.accessKey, ca, da), this._.accessKeyMap["CTRL+" + a.accessKey] = a.id) 12098 } 12099 }, 12100 selectPage: function(a) { 12101 if (this._.currentTabId != a && !this._.tabs[a][0].hasClass("cke_dialog_tab_disabled") && !1 !== this.fire("selectPage", { 12102 page: a, 12103 currentPage: this._.currentTabId 12104 })) { 12105 for (var b in this._.tabs) { 12106 var c = this._.tabs[b][0], 12107 e = this._.tabs[b][1]; 12108 b != a && (c.removeClass("cke_dialog_tab_selected"), e.hide()); 12109 e.setAttribute("aria-hidden", b != a) 12110 } 12111 var d = this._.tabs[a]; 12112 d[0].addClass("cke_dialog_tab_selected"); 12113 CKEDITOR.env.ie6Compat || 12114 CKEDITOR.env.ie7Compat ? (K(d[1]), d[1].show(), setTimeout(function() { 12115 K(d[1], 1) 12116 }, 0)) : d[1].show(); 12117 this._.currentTabId = a; 12118 this._.currentTabIndex = CKEDITOR.tools.indexOf(this._.tabIdList, a) 12119 } 12120 }, 12121 updateStyle: function() { 12122 this.parts.dialog[(1 === this._.pageCount ? "add" : "remove") + "Class"]("cke_single_page") 12123 }, 12124 hidePage: function(a) { 12125 var b = this._.tabs[a] && this._.tabs[a][0]; 12126 b && 1 != this._.pageCount && b.isVisible() && (a == this._.currentTabId && this.selectPage(x.call(this)), b.hide(), this._.pageCount--, this.updateStyle()) 12127 }, 12128 showPage: function(a) { 12129 if (a = 12130 this._.tabs[a] && this._.tabs[a][0]) a.show(), this._.pageCount++, this.updateStyle() 12131 }, 12132 getElement: function() { 12133 return this._.element 12134 }, 12135 getName: function() { 12136 return this._.name 12137 }, 12138 getContentElement: function(a, b) { 12139 var c = this._.contents[a]; 12140 return c && c[b] 12141 }, 12142 getValueOf: function(a, b) { 12143 return this.getContentElement(a, b).getValue() 12144 }, 12145 setValueOf: function(a, b, c) { 12146 return this.getContentElement(a, b).setValue(c) 12147 }, 12148 getButton: function(a) { 12149 return this._.buttons[a] 12150 }, 12151 click: function(a) { 12152 return this._.buttons[a].click() 12153 }, 12154 disableButton: function(a) { 12155 return this._.buttons[a].disable() 12156 }, 12157 enableButton: function(a) { 12158 return this._.buttons[a].enable() 12159 }, 12160 getPageCount: function() { 12161 return this._.pageCount 12162 }, 12163 getParentEditor: function() { 12164 return this._.editor 12165 }, 12166 getSelectedElement: function() { 12167 return this.getParentEditor().getSelection().getSelectedElement() 12168 }, 12169 addFocusable: function(a, b) { 12170 if ("undefined" == typeof b) b = this._.focusList.length, this._.focusList.push(new L(this, a, b)); 12171 else { 12172 this._.focusList.splice(b, 0, new L(this, a, b)); 12173 for (var c = b + 1; c < this._.focusList.length; c++) this._.focusList[c].focusIndex++ 12174 } 12175 }, 12176 setState: function(a) { 12177 if (this.state != a) { 12178 this.state = a; 12179 if (a == CKEDITOR.DIALOG_STATE_BUSY) { 12180 if (!this.parts.spinner) { 12181 var b = this.getParentEditor().lang.dir, 12182 c = { 12183 attributes: { 12184 "class": "cke_dialog_spinner" 12185 }, 12186 styles: { 12187 "float": "rtl" == b ? "right" : "left" 12188 } 12189 }; 12190 c.styles["margin-" + ("rtl" == b ? "left" : "right")] = "8px"; 12191 this.parts.spinner = CKEDITOR.document.createElement("div", c); 12192 this.parts.spinner.setHtml("\x26#8987;"); 12193 this.parts.spinner.appendTo(this.parts.title, 1) 12194 } 12195 this.parts.spinner.show(); 12196 this.getButton("ok").disable() 12197 } else a == 12198 CKEDITOR.DIALOG_STATE_IDLE && (this.parts.spinner && this.parts.spinner.hide(), this.getButton("ok").enable()); 12199 this.fire("state", a) 12200 } 12201 } 12202 }; 12203 CKEDITOR.tools.extend(CKEDITOR.dialog, { 12204 add: function(a, b) { 12205 this._.dialogDefinitions[a] && "function" != typeof b || (this._.dialogDefinitions[a] = b) 12206 }, 12207 exists: function(a) { 12208 return !!this._.dialogDefinitions[a] 12209 }, 12210 getCurrent: function() { 12211 return CKEDITOR.dialog._.currentTop 12212 }, 12213 isTabEnabled: function(a, b, c) { 12214 a = a.config.removeDialogTabs; 12215 return !(a && a.match(new RegExp("(?:^|;)" + b + ":" + c + "(?:$|;)", 12216 "i"))) 12217 }, 12218 okButton: function() { 12219 var a = function(a, c) { 12220 c = c || {}; 12221 return CKEDITOR.tools.extend({ 12222 id: "ok", 12223 type: "button", 12224 label: a.lang.common.ok, 12225 "class": "cke_dialog_ui_button_ok", 12226 onClick: function(a) { 12227 a = a.data.dialog; 12228 !1 !== a.fire("ok", { 12229 hide: !0 12230 }).hide && a.hide() 12231 } 12232 }, c, !0) 12233 }; 12234 a.type = "button"; 12235 a.override = function(b) { 12236 return CKEDITOR.tools.extend(function(c) { 12237 return a(c, b) 12238 }, { 12239 type: "button" 12240 }, !0) 12241 }; 12242 return a 12243 }(), 12244 cancelButton: function() { 12245 var a = function(a, c) { 12246 c = c || {}; 12247 return CKEDITOR.tools.extend({ 12248 id: "cancel", 12249 type: "button", 12250 label: a.lang.common.cancel, 12251 "class": "cke_dialog_ui_button_cancel", 12252 onClick: function(a) { 12253 a = a.data.dialog; 12254 !1 !== a.fire("cancel", { 12255 hide: !0 12256 }).hide && a.hide() 12257 } 12258 }, c, !0) 12259 }; 12260 a.type = "button"; 12261 a.override = function(b) { 12262 return CKEDITOR.tools.extend(function(c) { 12263 return a(c, b) 12264 }, { 12265 type: "button" 12266 }, !0) 12267 }; 12268 return a 12269 }(), 12270 addUIElement: function(a, b) { 12271 this._.uiElementBuilders[a] = b 12272 } 12273 }); 12274 CKEDITOR.dialog._ = { 12275 uiElementBuilders: {}, 12276 dialogDefinitions: {}, 12277 currentTop: null, 12278 currentZIndex: null 12279 }; 12280 CKEDITOR.event.implementOn(CKEDITOR.dialog); 12281 CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype); 12282 var aa = { 12283 resizable: CKEDITOR.DIALOG_RESIZE_BOTH, 12284 minWidth: 600, 12285 minHeight: 400, 12286 buttons: [CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton] 12287 }, 12288 D = function(a, b, c) { 12289 for (var e = 0, d; d = a[e]; e++) 12290 if (d.id == b || c && d[c] && (d = D(d[c], b, c))) return d; 12291 return null 12292 }, 12293 E = function(a, b, c, e, d) { 12294 if (c) { 12295 for (var f = 0, g; g = a[f]; f++) { 12296 if (g.id == c) return a.splice(f, 0, b), b; 12297 if (e && g[e] && (g = E(g[e], b, c, e, !0))) return g 12298 } 12299 if (d) return null 12300 } 12301 a.push(b); 12302 return b 12303 }, 12304 F = function(a, b, c) { 12305 for (var e = 0, d; d = a[e]; e++) { 12306 if (d.id == b) return a.splice(e, 1); 12307 if (c && d[c] && (d = F(d[c], 12308 b, c))) return d 12309 } 12310 return null 12311 }, 12312 P = function(a, b) { 12313 this.dialog = a; 12314 for (var c = b.contents, e = 0, d; d = c[e]; e++) c[e] = d && new M(a, d); 12315 CKEDITOR.tools.extend(this, b) 12316 }; 12317 P.prototype = { 12318 getContents: function(a) { 12319 return D(this.contents, a) 12320 }, 12321 getButton: function(a) { 12322 return D(this.buttons, a) 12323 }, 12324 addContents: function(a, b) { 12325 return E(this.contents, a, b) 12326 }, 12327 addButton: function(a, b) { 12328 return E(this.buttons, a, b) 12329 }, 12330 removeContents: function(a) { 12331 F(this.contents, a) 12332 }, 12333 removeButton: function(a) { 12334 F(this.buttons, a) 12335 } 12336 }; 12337 M.prototype = { 12338 get: function(a) { 12339 return D(this.elements, 12340 a, "children") 12341 }, 12342 add: function(a, b) { 12343 return E(this.elements, a, b, "children") 12344 }, 12345 remove: function(a) { 12346 F(this.elements, a, "children") 12347 } 12348 }; 12349 var J, z = {}, 12350 u, w = {}, 12351 Q = function(a) { 12352 var b = a.data.$.ctrlKey || a.data.$.metaKey, 12353 c = a.data.$.altKey, 12354 e = a.data.$.shiftKey, 12355 d = String.fromCharCode(a.data.$.keyCode); 12356 (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()) 12357 }, 12358 R = function(a) { 12359 var b = a.data.$.ctrlKey || a.data.$.metaKey, 12360 c = a.data.$.altKey, 12361 e = a.data.$.shiftKey, 12362 d = String.fromCharCode(a.data.$.keyCode); 12363 (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())) 12364 }, 12365 S = function(a, b, c, e, d) { 12366 (w[c] || (w[c] = [])).push({ 12367 uiElement: a, 12368 dialog: b, 12369 key: c, 12370 keyup: d || a.accessKeyUp, 12371 keydown: e || a.accessKeyDown 12372 }) 12373 }, 12374 ba = function(a) { 12375 for (var b in w) { 12376 for (var c = w[b], e = c.length - 1; 0 <= e; e--) c[e].dialog != a && c[e].uiElement != a || c.splice(e, 1); 12377 0 === c.length && delete w[b] 12378 } 12379 }, 12380 da = function(a, 12381 b) { 12382 a._.accessKeyMap[b] && a.selectPage(a._.accessKeyMap[b]) 12383 }, 12384 ca = function() {}; 12385 (function() { 12386 CKEDITOR.ui.dialog = { 12387 uiElement: function(a, b, c, e, d, f, g) { 12388 if (!(4 > arguments.length)) { 12389 var h = (e.call ? e(b) : e) || "div", 12390 p = ["\x3c", h, " "], 12391 m = (d && d.call ? d(b) : d) || {}, 12392 k = (f && f.call ? f(b) : f) || {}, 12393 q = (g && g.call ? g.call(this, a, b) : g) || "", 12394 n = this.domId = k.id || CKEDITOR.tools.getNextId() + "_uiElement"; 12395 b.requiredContent && !a.getParentEditor().filter.check(b.requiredContent) && (m.display = "none", this.notAllowed = !0); 12396 k.id = n; 12397 var r = {}; 12398 b.type && (r["cke_dialog_ui_" + 12399 b.type] = 1); 12400 b.className && (r[b.className] = 1); 12401 b.disabled && (r.cke_disabled = 1); 12402 for (var l = k["class"] && k["class"].split ? k["class"].split(" ") : [], n = 0; n < l.length; n++) l[n] && (r[l[n]] = 1); 12403 l = []; 12404 for (n in r) l.push(n); 12405 k["class"] = l.join(" "); 12406 b.title && (k.title = b.title); 12407 r = (b.style || "").split(";"); 12408 b.align && (l = b.align, m["margin-left"] = "left" == l ? 0 : "auto", m["margin-right"] = "right" == l ? 0 : "auto"); 12409 for (n in m) r.push(n + ":" + m[n]); 12410 b.hidden && r.push("display:none"); 12411 for (n = r.length - 1; 0 <= n; n--) "" === r[n] && r.splice(n, 1); 12412 0 < r.length && (k.style = 12413 (k.style ? k.style + "; " : "") + r.join("; ")); 12414 for (n in k) p.push(n + '\x3d"' + CKEDITOR.tools.htmlEncode(k[n]) + '" '); 12415 p.push("\x3e", q, "\x3c/", h, "\x3e"); 12416 c.push(p.join("")); 12417 (this._ || (this._ = {})).dialog = a; 12418 "boolean" == typeof b.isChanged && (this.isChanged = function() { 12419 return b.isChanged 12420 }); 12421 "function" == typeof b.isChanged && (this.isChanged = b.isChanged); 12422 "function" == typeof b.setValue && (this.setValue = CKEDITOR.tools.override(this.setValue, function(a) { 12423 return function(c) { 12424 a.call(this, b.setValue.call(this, c)) 12425 } 12426 })); 12427 "function" == typeof b.getValue && 12428 (this.getValue = CKEDITOR.tools.override(this.getValue, function(a) { 12429 return function() { 12430 return b.getValue.call(this, a.call(this)) 12431 } 12432 })); 12433 CKEDITOR.event.implementOn(this); 12434 this.registerEvents(b); 12435 this.accessKeyUp && this.accessKeyDown && b.accessKey && S(this, a, "CTRL+" + b.accessKey); 12436 var t = this; 12437 a.on("load", function() { 12438 var b = t.getInputElement(); 12439 if (b) { 12440 var c = t.type in { 12441 checkbox: 1, 12442 ratio: 1 12443 } && CKEDITOR.env.ie && 8 > CKEDITOR.env.version ? "cke_dialog_ui_focused" : ""; 12444 b.on("focus", function() { 12445 a._.tabBarMode = !1; 12446 a._.hasFocus = !0; 12447 t.fire("focus"); 12448 c && this.addClass(c) 12449 }); 12450 b.on("blur", function() { 12451 t.fire("blur"); 12452 c && this.removeClass(c) 12453 }) 12454 } 12455 }); 12456 CKEDITOR.tools.extend(this, b); 12457 this.keyboardFocusable && (this.tabIndex = b.tabIndex || 0, this.focusIndex = a._.focusList.push(this) - 1, this.on("focus", function() { 12458 a._.currentFocusIndex = t.focusIndex 12459 })) 12460 } 12461 }, 12462 hbox: function(a, b, c, e, d) { 12463 if (!(4 > arguments.length)) { 12464 this._ || (this._ = {}); 12465 var f = this._.children = b, 12466 g = d && d.widths || null, 12467 h = d && d.height || null, 12468 p, m = { 12469 role: "presentation" 12470 }; 12471 d && d.align && (m.align = d.align); 12472 CKEDITOR.ui.dialog.uiElement.call(this, 12473 a, d || { 12474 type: "hbox" 12475 }, e, "table", {}, m, 12476 function() { 12477 var a = ['\x3ctbody\x3e\x3ctr class\x3d"cke_dialog_ui_hbox"\x3e']; 12478 for (p = 0; p < c.length; p++) { 12479 var b = "cke_dialog_ui_hbox_child", 12480 e = []; 12481 0 === p && (b = "cke_dialog_ui_hbox_first"); 12482 p == c.length - 1 && (b = "cke_dialog_ui_hbox_last"); 12483 a.push('\x3ctd class\x3d"', b, '" role\x3d"presentation" '); 12484 g ? g[p] && e.push("width:" + v(g[p])) : e.push("width:" + Math.floor(100 / c.length) + "%"); 12485 h && e.push("height:" + v(h)); 12486 d && void 0 !== d.padding && e.push("padding:" + v(d.padding)); 12487 CKEDITOR.env.ie && CKEDITOR.env.quirks && 12488 f[p].align && e.push("text-align:" + f[p].align); 12489 0 < e.length && a.push('style\x3d"' + e.join("; ") + '" '); 12490 a.push("\x3e", c[p], "\x3c/td\x3e") 12491 } 12492 a.push("\x3c/tr\x3e\x3c/tbody\x3e"); 12493 return a.join("") 12494 }) 12495 } 12496 }, 12497 vbox: function(a, b, c, e, d) { 12498 if (!(3 > arguments.length)) { 12499 this._ || (this._ = {}); 12500 var f = this._.children = b, 12501 g = d && d.width || null, 12502 h = d && d.heights || null; 12503 CKEDITOR.ui.dialog.uiElement.call(this, a, d || { 12504 type: "vbox" 12505 }, e, "div", null, { 12506 role: "presentation" 12507 }, function() { 12508 var b = ['\x3ctable role\x3d"presentation" cellspacing\x3d"0" border\x3d"0" ']; 12509 b.push('style\x3d"'); 12510 d && d.expand && b.push("height:100%;"); 12511 b.push("width:" + v(g || "100%"), ";"); 12512 CKEDITOR.env.webkit && b.push("float:none;"); 12513 b.push('"'); 12514 b.push('align\x3d"', CKEDITOR.tools.htmlEncode(d && d.align || ("ltr" == a.getParentEditor().lang.dir ? "left" : "right")), '" '); 12515 b.push("\x3e\x3ctbody\x3e"); 12516 for (var e = 0; e < c.length; e++) { 12517 var k = []; 12518 b.push('\x3ctr\x3e\x3ctd role\x3d"presentation" '); 12519 g && k.push("width:" + v(g || "100%")); 12520 h ? k.push("height:" + v(h[e])) : d && d.expand && k.push("height:" + Math.floor(100 / c.length) + "%"); 12521 d && void 0 !== d.padding && k.push("padding:" + v(d.padding)); 12522 CKEDITOR.env.ie && CKEDITOR.env.quirks && f[e].align && k.push("text-align:" + f[e].align); 12523 0 < k.length && b.push('style\x3d"', k.join("; "), '" '); 12524 b.push(' class\x3d"cke_dialog_ui_vbox_child"\x3e', c[e], "\x3c/td\x3e\x3c/tr\x3e") 12525 } 12526 b.push("\x3c/tbody\x3e\x3c/table\x3e"); 12527 return b.join("") 12528 }) 12529 } 12530 } 12531 } 12532 })(); 12533 CKEDITOR.ui.dialog.uiElement.prototype = { 12534 getElement: function() { 12535 return CKEDITOR.document.getById(this.domId) 12536 }, 12537 getInputElement: function() { 12538 return this.getElement() 12539 }, 12540 getDialog: function() { 12541 return this._.dialog 12542 }, 12543 setValue: function(a, b) { 12544 this.getInputElement().setValue(a); 12545 !b && this.fire("change", { 12546 value: a 12547 }); 12548 return this 12549 }, 12550 getValue: function() { 12551 return this.getInputElement().getValue() 12552 }, 12553 isChanged: function() { 12554 return !1 12555 }, 12556 selectParentTab: function() { 12557 for (var a = this.getInputElement(); 12558 (a = a.getParent()) && -1 == a.$.className.search("cke_dialog_page_contents");); 12559 if (!a) return this; 12560 a = a.getAttribute("name"); 12561 this._.dialog._.currentTabId != a && this._.dialog.selectPage(a); 12562 return this 12563 }, 12564 focus: function() { 12565 this.selectParentTab().getInputElement().focus(); 12566 return this 12567 }, 12568 registerEvents: function(a) { 12569 var b = /^on([A-Z]\w+)/, 12570 c, e = function(a, b, c, d) { 12571 b.on("load", function() { 12572 a.getInputElement().on(c, d, a) 12573 }) 12574 }, 12575 d; 12576 for (d in a) 12577 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]); 12578 return this 12579 }, 12580 eventProcessors: { 12581 onLoad: function(a, b) { 12582 a.on("load", b, this) 12583 }, 12584 onShow: function(a, b) { 12585 a.on("show", b, this) 12586 }, 12587 onHide: function(a, b) { 12588 a.on("hide", b, this) 12589 } 12590 }, 12591 accessKeyDown: function() { 12592 this.focus() 12593 }, 12594 accessKeyUp: function() {}, 12595 disable: function() { 12596 var a = this.getElement(); 12597 this.getInputElement().setAttribute("disabled", "true"); 12598 a.addClass("cke_disabled") 12599 }, 12600 enable: function() { 12601 var a = this.getElement(); 12602 this.getInputElement().removeAttribute("disabled"); 12603 a.removeClass("cke_disabled") 12604 }, 12605 isEnabled: function() { 12606 return !this.getElement().hasClass("cke_disabled") 12607 }, 12608 isVisible: function() { 12609 return this.getInputElement().isVisible() 12610 }, 12611 isFocusable: function() { 12612 return this.isEnabled() && this.isVisible() ? !0 : !1 12613 } 12614 }; 12615 CKEDITOR.ui.dialog.hbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, { 12616 getChild: function(a) { 12617 if (1 > arguments.length) return this._.children.concat(); 12618 a.splice || (a = [a]); 12619 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 12620 } 12621 }, !0); 12622 CKEDITOR.ui.dialog.vbox.prototype = new CKEDITOR.ui.dialog.hbox; 12623 (function() { 12624 var a = { 12625 build: function(a, c, e) { 12626 for (var d = c.children, f, g = [], h = [], p = 0; p < d.length && (f = d[p]); p++) { 12627 var m = []; 12628 g.push(m); 12629 h.push(CKEDITOR.dialog._.uiElementBuilders[f.type].build(a, f, m)) 12630 } 12631 return new CKEDITOR.ui.dialog[c.type](a, 12632 h, g, e, c) 12633 } 12634 }; 12635 CKEDITOR.dialog.addUIElement("hbox", a); 12636 CKEDITOR.dialog.addUIElement("vbox", a) 12637 })(); 12638 CKEDITOR.dialogCommand = function(a, b) { 12639 this.dialogName = a; 12640 CKEDITOR.tools.extend(this, b, !0) 12641 }; 12642 CKEDITOR.dialogCommand.prototype = { 12643 exec: function(a) { 12644 var b = this.tabId; 12645 a.openDialog(this.dialogName, function(a) { 12646 b && a.selectPage(b) 12647 }) 12648 }, 12649 canUndo: !1, 12650 editorFocus: 1 12651 }; 12652 (function() { 12653 var a = /^([a]|[^a])+$/, 12654 b = /^\d*$/, 12655 c = /^\d*(?:\.\d+)?$/, 12656 e = /^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/, 12657 d = /^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i, 12658 f = /^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/; 12659 CKEDITOR.VALIDATE_OR = 1; 12660 CKEDITOR.VALIDATE_AND = 2; 12661 CKEDITOR.dialog.validate = { 12662 functions: function() { 12663 var a = arguments; 12664 return function() { 12665 var b = this && this.getValue ? this.getValue() : a[0], 12666 c, d = CKEDITOR.VALIDATE_AND, 12667 e = [], 12668 f; 12669 for (f = 0; f < a.length; f++) 12670 if ("function" == typeof a[f]) e.push(a[f]); 12671 else break; 12672 f < a.length && "string" == typeof a[f] && (c = a[f], f++); 12673 f < a.length && "number" == typeof a[f] && (d = a[f]); 12674 var n = d == CKEDITOR.VALIDATE_AND ? !0 : !1; 12675 for (f = 0; f < e.length; f++) n = d == CKEDITOR.VALIDATE_AND ? n && 12676 e[f](b) : n || e[f](b); 12677 return n ? !0 : c 12678 } 12679 }, 12680 regex: function(a, b) { 12681 return function(c) { 12682 c = this && this.getValue ? this.getValue() : c; 12683 return a.test(c) ? !0 : b 12684 } 12685 }, 12686 notEmpty: function(b) { 12687 return this.regex(a, b) 12688 }, 12689 integer: function(a) { 12690 return this.regex(b, a) 12691 }, 12692 number: function(a) { 12693 return this.regex(c, a) 12694 }, 12695 cssLength: function(a) { 12696 return this.functions(function(a) { 12697 return d.test(CKEDITOR.tools.trim(a)) 12698 }, a) 12699 }, 12700 htmlLength: function(a) { 12701 return this.functions(function(a) { 12702 return e.test(CKEDITOR.tools.trim(a)) 12703 }, a) 12704 }, 12705 inlineStyle: function(a) { 12706 return this.functions(function(a) { 12707 return f.test(CKEDITOR.tools.trim(a)) 12708 }, 12709 a) 12710 }, 12711 equals: function(a, b) { 12712 return this.functions(function(b) { 12713 return b == a 12714 }, b) 12715 }, 12716 notEqual: function(a, b) { 12717 return this.functions(function(b) { 12718 return b != a 12719 }, b) 12720 } 12721 }; 12722 CKEDITOR.on("instanceDestroyed", function(a) { 12723 if (CKEDITOR.tools.isEmpty(CKEDITOR.instances)) { 12724 for (var b; b = CKEDITOR.dialog._.currentTop;) b.hide(); 12725 for (var c in z) z[c].remove(); 12726 z = {} 12727 } 12728 a = a.editor._.storedDialogs; 12729 for (var d in a) a[d].destroy() 12730 }) 12731 })(); 12732 CKEDITOR.tools.extend(CKEDITOR.editor.prototype, { 12733 openDialog: function(a, b) { 12734 var c = null, 12735 e = CKEDITOR.dialog._.dialogDefinitions[a]; 12736 null === CKEDITOR.dialog._.currentTop && N(this); 12737 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(); 12738 else { 12739 if ("failed" == e) throw O(this), Error('[CKEDITOR.dialog.openDialog] Dialog "' + a + '" failed when loading definition.'); 12740 "string" == typeof e && CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(e), function() { 12741 "function" != typeof CKEDITOR.dialog._.dialogDefinitions[a] && (CKEDITOR.dialog._.dialogDefinitions[a] = "failed"); 12742 this.openDialog(a, 12743 b) 12744 }, this, 0, 1) 12745 } 12746 CKEDITOR.skin.loadPart("dialog"); 12747 return c 12748 } 12749 }) 12750 })(); 12751 CKEDITOR.plugins.add("dialog", { 12752 requires: "dialogui", 12753 init: function(x) { 12754 x.on("doubleclick", function(A) { 12755 A.data.dialog && x.openDialog(A.data.dialog) 12756 }, null, null, 999) 12757 } 12758 }); 12759 CKEDITOR.plugins.add("about", { 12760 requires: "dialog", 12761 init: function(a) { 12762 var b = a.addCommand("about", new CKEDITOR.dialogCommand("about")); 12763 b.modes = { 12764 wysiwyg: 1, 12765 source: 1 12766 }; 12767 b.canUndo = !1; 12768 b.readOnly = 1; 12769 a.ui.addButton && a.ui.addButton("About", { 12770 label: a.lang.about.dlgTitle, 12771 command: "about", 12772 toolbar: "about" 12773 }); 12774 CKEDITOR.dialog.add("about", this.path + "dialogs/about.js") 12775 } 12776 }); 12777 (function() { 12778 CKEDITOR.plugins.add("a11yhelp", { 12779 requires: "dialog", 12780 availableLangs: { 12781 af: 1, 12782 ar: 1, 12783 az: 1, 12784 bg: 1, 12785 ca: 1, 12786 cs: 1, 12787 cy: 1, 12788 da: 1, 12789 de: 1, 12790 "de-ch": 1, 12791 el: 1, 12792 en: 1, 12793 "en-au": 1, 12794 "en-gb": 1, 12795 eo: 1, 12796 es: 1, 12797 "es-mx": 1, 12798 et: 1, 12799 eu: 1, 12800 fa: 1, 12801 fi: 1, 12802 fo: 1, 12803 fr: 1, 12804 "fr-ca": 1, 12805 gl: 1, 12806 gu: 1, 12807 he: 1, 12808 hi: 1, 12809 hr: 1, 12810 hu: 1, 12811 id: 1, 12812 it: 1, 12813 ja: 1, 12814 km: 1, 12815 ko: 1, 12816 ku: 1, 12817 lt: 1, 12818 lv: 1, 12819 mk: 1, 12820 mn: 1, 12821 nb: 1, 12822 nl: 1, 12823 no: 1, 12824 oc: 1, 12825 pl: 1, 12826 pt: 1, 12827 "pt-br": 1, 12828 ro: 1, 12829 ru: 1, 12830 si: 1, 12831 sk: 1, 12832 sl: 1, 12833 sq: 1, 12834 sr: 1, 12835 "sr-latn": 1, 12836 sv: 1, 12837 th: 1, 12838 tr: 1, 12839 tt: 1, 12840 ug: 1, 12841 uk: 1, 12842 vi: 1, 12843 zh: 1, 12844 "zh-cn": 1 12845 }, 12846 init: function(b) { 12847 var c = this; 12848 b.addCommand("a11yHelp", { 12849 exec: function() { 12850 var a = 12851 b.langCode, 12852 a = c.availableLangs[a] ? a : c.availableLangs[a.replace(/-.*/, "")] ? a.replace(/-.*/, "") : "en"; 12853 CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(c.path + "dialogs/lang/" + a + ".js"), function() { 12854 b.lang.a11yhelp = c.langEntries[a]; 12855 b.openDialog("a11yHelp") 12856 }) 12857 }, 12858 modes: { 12859 wysiwyg: 1, 12860 source: 1 12861 }, 12862 readOnly: 1, 12863 canUndo: !1 12864 }); 12865 b.setKeystroke(CKEDITOR.ALT + 48, "a11yHelp"); 12866 CKEDITOR.dialog.add("a11yHelp", this.path + "dialogs/a11yhelp.js"); 12867 b.on("ariaEditorHelpLabel", function(a) { 12868 a.data.label = b.lang.common.editorHelp 12869 }) 12870 } 12871 }) 12872 })(); 12873 (function() { 12874 function f(c) { 12875 var a = this.att; 12876 c = c && c.hasAttribute(a) && c.getAttribute(a) || ""; 12877 void 0 !== c && this.setValue(c) 12878 } 12879 12880 function g() { 12881 for (var c, a = 0; a < arguments.length; a++) 12882 if (arguments[a] instanceof CKEDITOR.dom.element) { 12883 c = arguments[a]; 12884 break 12885 } if (c) { 12886 var a = this.att, 12887 b = this.getValue(); 12888 b ? c.setAttribute(a, b) : c.removeAttribute(a, b) 12889 } 12890 } 12891 var k = { 12892 id: 1, 12893 dir: 1, 12894 classes: 1, 12895 styles: 1 12896 }; 12897 CKEDITOR.plugins.add("dialogadvtab", { 12898 requires: "dialog", 12899 allowedContent: function(c) { 12900 c || (c = k); 12901 var a = []; 12902 c.id && a.push("id"); 12903 c.dir && a.push("dir"); 12904 var b = 12905 ""; 12906 a.length && (b += "[" + a.join(",") + "]"); 12907 c.classes && (b += "(*)"); 12908 c.styles && (b += "{*}"); 12909 return b 12910 }, 12911 createAdvancedTab: function(c, a, b) { 12912 a || (a = k); 12913 var d = c.lang.common, 12914 h = { 12915 id: "advanced", 12916 label: d.advancedTab, 12917 title: d.advancedTab, 12918 elements: [{ 12919 type: "vbox", 12920 padding: 1, 12921 children: [] 12922 }] 12923 }, 12924 e = []; 12925 if (a.id || a.dir) a.id && e.push({ 12926 id: "advId", 12927 att: "id", 12928 type: "text", 12929 requiredContent: b ? b + "[id]" : null, 12930 label: d.id, 12931 setup: f, 12932 commit: g 12933 }), a.dir && e.push({ 12934 id: "advLangDir", 12935 att: "dir", 12936 type: "select", 12937 requiredContent: b ? b + "[dir]" : null, 12938 label: d.langDir, 12939 "default": "", 12940 style: "width:100%", 12941 items: [ 12942 [d.notSet, ""], 12943 [d.langDirLTR, "ltr"], 12944 [d.langDirRTL, "rtl"] 12945 ], 12946 setup: f, 12947 commit: g 12948 }), h.elements[0].children.push({ 12949 type: "hbox", 12950 widths: ["50%", "50%"], 12951 children: [].concat(e) 12952 }); 12953 if (a.styles || a.classes) e = [], a.styles && e.push({ 12954 id: "advStyles", 12955 att: "style", 12956 type: "text", 12957 requiredContent: b ? b + "{cke-xyz}" : null, 12958 label: d.styles, 12959 "default": "", 12960 validate: CKEDITOR.dialog.validate.inlineStyle(d.invalidInlineStyle), 12961 onChange: function() {}, 12962 getStyle: function(a, c) { 12963 var b = this.getValue().match(new RegExp("(?:^|;)\\s*" + 12964 a + "\\s*:\\s*([^;]*)", "i")); 12965 return b ? b[1] : c 12966 }, 12967 updateStyle: function(a, b) { 12968 var d = this.getValue(), 12969 e = c.document.createElement("span"); 12970 e.setAttribute("style", d); 12971 e.setStyle(a, b); 12972 d = CKEDITOR.tools.normalizeCssText(e.getAttribute("style")); 12973 this.setValue(d, 1) 12974 }, 12975 setup: f, 12976 commit: g 12977 }), a.classes && e.push({ 12978 type: "hbox", 12979 widths: ["45%", "55%"], 12980 children: [{ 12981 id: "advCSSClasses", 12982 att: "class", 12983 type: "text", 12984 requiredContent: b ? b + "(cke-xyz)" : null, 12985 label: d.cssClasses, 12986 "default": "", 12987 setup: f, 12988 commit: g 12989 }] 12990 }), h.elements[0].children.push({ 12991 type: "hbox", 12992 widths: ["50%", "50%"], 12993 children: [].concat(e) 12994 }); 12995 return h 12996 } 12997 }) 12998 })(); 12999 CKEDITOR.plugins.add("basicstyles", { 13000 init: function(c) { 13001 var e = 0, 13002 d = function(g, d, b, a) { 13003 if (a) { 13004 a = new CKEDITOR.style(a); 13005 var f = h[b]; 13006 f.unshift(a); 13007 c.attachStyleStateChange(a, function(a) { 13008 !c.readOnly && c.getCommand(b).setState(a) 13009 }); 13010 c.addCommand(b, new CKEDITOR.styleCommand(a, { 13011 contentForms: f 13012 })); 13013 c.ui.addButton && c.ui.addButton(g, { 13014 label: d, 13015 command: b, 13016 toolbar: "basicstyles," + (e += 10) 13017 }) 13018 } 13019 }, 13020 h = { 13021 bold: ["strong", "b", ["span", function(a) { 13022 a = a.styles["font-weight"]; 13023 return "bold" == a || 700 <= +a 13024 }]], 13025 italic: ["em", "i", ["span", function(a) { 13026 return "italic" == 13027 a.styles["font-style"] 13028 }]], 13029 underline: ["u", ["span", function(a) { 13030 return "underline" == a.styles["text-decoration"] 13031 }]], 13032 strike: ["s", "strike", ["span", function(a) { 13033 return "line-through" == a.styles["text-decoration"] 13034 }]], 13035 subscript: ["sub"], 13036 superscript: ["sup"] 13037 }, 13038 b = c.config, 13039 a = c.lang.basicstyles; 13040 d("Bold", a.bold, "bold", b.coreStyles_bold); 13041 d("Italic", a.italic, "italic", b.coreStyles_italic); 13042 d("Underline", a.underline, "underline", b.coreStyles_underline); 13043 d("Strike", a.strike, "strike", b.coreStyles_strike); 13044 d("Subscript", a.subscript, 13045 "subscript", b.coreStyles_subscript); 13046 d("Superscript", a.superscript, "superscript", b.coreStyles_superscript); 13047 c.setKeystroke([ 13048 [CKEDITOR.CTRL + 66, "bold"], 13049 [CKEDITOR.CTRL + 73, "italic"], 13050 [CKEDITOR.CTRL + 85, "underline"] 13051 ]) 13052 } 13053 }); 13054 CKEDITOR.config.coreStyles_bold = { 13055 element: "strong", 13056 overrides: "b" 13057 }; 13058 CKEDITOR.config.coreStyles_italic = { 13059 element: "em", 13060 overrides: "i" 13061 }; 13062 CKEDITOR.config.coreStyles_underline = { 13063 element: "u" 13064 }; 13065 CKEDITOR.config.coreStyles_strike = { 13066 element: "s", 13067 overrides: "strike" 13068 }; 13069 CKEDITOR.config.coreStyles_subscript = { 13070 element: "sub" 13071 }; 13072 CKEDITOR.config.coreStyles_superscript = { 13073 element: "sup" 13074 }; 13075 (function() { 13076 function q(a, f, d, b) { 13077 if (!a.isReadOnly() && !a.equals(d.editable())) { 13078 CKEDITOR.dom.element.setMarker(b, a, "bidi_processed", 1); 13079 b = a; 13080 for (var c = d.editable(); 13081 (b = b.getParent()) && !b.equals(c);) 13082 if (b.getCustomData("bidi_processed")) { 13083 a.removeStyle("direction"); 13084 a.removeAttribute("dir"); 13085 return 13086 } b = "useComputedState" in d.config ? d.config.useComputedState : 1; 13087 (b ? a.getComputedStyle("direction") : a.getStyle("direction") || a.hasAttribute("dir")) != f && (a.removeStyle("direction"), b ? (a.removeAttribute("dir"), f != a.getComputedStyle("direction") && 13088 a.setAttribute("dir", f)) : a.setAttribute("dir", f), d.forceNextSelectionCheck()) 13089 } 13090 } 13091 13092 function v(a, f, d) { 13093 var b = a.getCommonAncestor(!1, !0); 13094 a = a.clone(); 13095 a.enlarge(d == CKEDITOR.ENTER_BR ? CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS); 13096 if (a.checkBoundaryOfElement(b, CKEDITOR.START) && a.checkBoundaryOfElement(b, CKEDITOR.END)) { 13097 for (var c; b && b.type == CKEDITOR.NODE_ELEMENT && (c = b.getParent()) && 1 == c.getChildCount() && !(b.getName() in f);) b = c; 13098 return b.type == CKEDITOR.NODE_ELEMENT && b.getName() in f && b 13099 } 13100 } 13101 13102 function p(a) { 13103 return { 13104 context: "p", 13105 allowedContent: { 13106 "h1 h2 h3 h4 h5 h6 table ul ol blockquote div tr p div li td": { 13107 propertiesOnly: !0, 13108 attributes: "dir" 13109 } 13110 }, 13111 requiredContent: "p[dir]", 13112 refresh: function(a, d) { 13113 var b = a.config.useComputedState, 13114 c, b = void 0 === b || b; 13115 if (!b) { 13116 c = d.lastElement; 13117 for (var h = a.editable(); c && !(c.getName() in u || c.equals(h));) { 13118 var e = c.getParent(); 13119 if (!e) break; 13120 c = e 13121 } 13122 } 13123 c = c || d.block || d.blockLimit; 13124 c.equals(a.editable()) && (h = a.getSelection().getRanges()[0].getEnclosedNode()) && h.type == CKEDITOR.NODE_ELEMENT && (c = h); 13125 c && (b = b ? c.getComputedStyle("direction") : 13126 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)); 13127 b = (d.block || d.blockLimit || a.editable()).getDirection(1); 13128 b != (a._.selDir || a.lang.dir) && (a._.selDir = b, a.fire("contentDirChanged", b)) 13129 }, 13130 exec: function(f) { 13131 var d = f.getSelection(), 13132 b = f.config.enterMode, 13133 c = d.getRanges(); 13134 if (c && c.length) { 13135 for (var h = {}, e = d.createBookmarks(), c = c.createIterator(), g, 13136 l = 0; g = c.getNextRange(1);) { 13137 var k = g.getEnclosedNode(); 13138 k && (!k || k.type == CKEDITOR.NODE_ELEMENT && k.getName() in r) || (k = v(g, t, b)); 13139 k && q(k, a, f, h); 13140 var m = new CKEDITOR.dom.walker(g), 13141 n = e[l].startNode, 13142 p = e[l++].endNode; 13143 m.evaluator = function(a) { 13144 var c = b == CKEDITOR.ENTER_P ? "p" : "div", 13145 d; 13146 if (d = (a ? a.type == CKEDITOR.NODE_ELEMENT : !1) && a.getName() in t) { 13147 if (c = a.is(c)) c = (c = a.getParent()) ? c.type == CKEDITOR.NODE_ELEMENT : !1; 13148 d = !(c && a.getParent().is("blockquote")) 13149 } 13150 return !!(d && a.getPosition(n) & CKEDITOR.POSITION_FOLLOWING && (a.getPosition(p) & 13151 CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_CONTAINS) == CKEDITOR.POSITION_PRECEDING) 13152 }; 13153 for (; k = m.next();) q(k, a, f, h); 13154 g = g.createIterator(); 13155 for (g.enlargeBr = b != CKEDITOR.ENTER_BR; k = g.getNextParagraph(b == CKEDITOR.ENTER_P ? "p" : "div");) q(k, a, f, h) 13156 } 13157 CKEDITOR.dom.element.clearAllMarkers(h); 13158 f.forceNextSelectionCheck(); 13159 d.selectBookmarks(e); 13160 f.focus() 13161 } 13162 } 13163 } 13164 } 13165 13166 function w(a) { 13167 var f = a == l.setAttribute, 13168 d = a == l.removeAttribute, 13169 b = /\bdirection\s*:\s*(.*?)\s*(:?$|;)/; 13170 return function(c, h) { 13171 if (!this.isReadOnly()) { 13172 var e; 13173 if (e = c == (f || d ? 13174 "dir" : "direction") || "style" == c && (d || b.test(h))) { 13175 a: { 13176 e = this; 13177 for (var g = e.getDocument().getBody().getParent(); e;) { 13178 if (e.equals(g)) { 13179 e = !1; 13180 break a 13181 } 13182 e = e.getParent() 13183 } 13184 e = !0 13185 } 13186 e = !e 13187 } 13188 if (e && (e = this.getDirection(1), g = a.apply(this, arguments), e != this.getDirection(1))) return this.getDocument().fire("dirChanged", this), g 13189 } 13190 return a.apply(this, arguments) 13191 } 13192 } 13193 var t = { 13194 table: 1, 13195 ul: 1, 13196 ol: 1, 13197 blockquote: 1, 13198 div: 1 13199 }, 13200 r = {}, 13201 u = {}; 13202 CKEDITOR.tools.extend(r, t, { 13203 tr: 1, 13204 p: 1, 13205 div: 1, 13206 li: 1 13207 }); 13208 CKEDITOR.tools.extend(u, r, { 13209 td: 1 13210 }); 13211 CKEDITOR.plugins.add("bidi", { 13212 init: function(a) { 13213 function f(b, 13214 c, d, e, f) { 13215 a.addCommand(d, new CKEDITOR.command(a, e)); 13216 a.ui.addButton && a.ui.addButton(b, { 13217 label: c, 13218 command: d, 13219 toolbar: "bidi," + f 13220 }) 13221 } 13222 if (!a.blockless) { 13223 var d = a.lang.bidi; 13224 f("BidiLtr", d.ltr, "bidiltr", p("ltr"), 10); 13225 f("BidiRtl", d.rtl, "bidirtl", p("rtl"), 20); 13226 a.on("contentDom", function() { 13227 a.document.on("dirChanged", function(b) { 13228 a.fire("dirChanged", { 13229 node: b.data, 13230 dir: b.data.getDirection(1) 13231 }) 13232 }) 13233 }); 13234 a.on("contentDirChanged", function(b) { 13235 b = (a.lang.dir != b.data ? "add" : "remove") + "Class"; 13236 var c = a.ui.space(a.config.toolbarLocation); 13237 if (c) c[b]("cke_mixed_dir_content") 13238 }) 13239 } 13240 } 13241 }); 13242 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) 13243 })(); 13244 (function() { 13245 var m = { 13246 exec: function(g) { 13247 var a = g.getCommand("blockquote").state, 13248 k = g.getSelection(), 13249 c = k && k.getRanges()[0]; 13250 if (c) { 13251 var h = k.createBookmarks(); 13252 if (CKEDITOR.env.ie) { 13253 var e = h[0].startNode, 13254 b = h[0].endNode, 13255 d; 13256 if (e && "blockquote" == e.getParent().getName()) 13257 for (d = e; d = d.getNext();) 13258 if (d.type == CKEDITOR.NODE_ELEMENT && d.isBlockBoundary()) { 13259 e.move(d, !0); 13260 break 13261 } if (b && "blockquote" == b.getParent().getName()) 13262 for (d = b; d = d.getPrevious();) 13263 if (d.type == CKEDITOR.NODE_ELEMENT && d.isBlockBoundary()) { 13264 b.move(d); 13265 break 13266 } 13267 } 13268 var f = c.createIterator(); 13269 f.enlargeBr = g.config.enterMode != CKEDITOR.ENTER_BR; 13270 if (a == CKEDITOR.TRISTATE_OFF) { 13271 for (e = []; a = f.getNextParagraph();) e.push(a); 13272 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)); 13273 d = e[0].getParent(); 13274 c = []; 13275 for (b = 0; b < e.length; b++) a = e[b], d = d.getCommonAncestor(a.getParent()); 13276 for (a = { 13277 table: 1, 13278 tbody: 1, 13279 tr: 1, 13280 ol: 1, 13281 ul: 1 13282 }; a[d.getName()];) d = d.getParent(); 13283 for (b = null; 0 < e.length;) { 13284 for (a = e.shift(); !a.getParent().equals(d);) a = a.getParent(); 13285 a.equals(b) || c.push(a); 13286 b = a 13287 } 13288 for (; 0 < c.length;) 13289 if (a = c.shift(), "blockquote" == a.getName()) { 13290 for (b = new CKEDITOR.dom.documentFragment(g.document); a.getFirst();) b.append(a.getFirst().remove()), e.push(b.getLast()); 13291 b.replace(a) 13292 } else e.push(a); 13293 c = g.document.createElement("blockquote"); 13294 for (c.insertBefore(e[0]); 0 < e.length;) a = e.shift(), c.append(a) 13295 } else if (a == CKEDITOR.TRISTATE_ON) { 13296 b = []; 13297 for (d = {}; a = f.getNextParagraph();) { 13298 for (e = c = null; a.getParent();) { 13299 if ("blockquote" == a.getParent().getName()) { 13300 c = a.getParent(); 13301 e = a; 13302 break 13303 } 13304 a = a.getParent() 13305 } 13306 c && e && !e.getCustomData("blockquote_moveout") && (b.push(e), CKEDITOR.dom.element.setMarker(d, e, "blockquote_moveout", !0)) 13307 } 13308 CKEDITOR.dom.element.clearAllMarkers(d); 13309 a = []; 13310 e = []; 13311 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") || 13312 (e.push(c), CKEDITOR.dom.element.setMarker(d, c, "blockquote_processed", !0)), a.push(f); 13313 CKEDITOR.dom.element.clearAllMarkers(d); 13314 for (b = e.length - 1; 0 <= b; b--) { 13315 c = e[b]; 13316 a: { 13317 d = c; 13318 for (var f = 0, m = d.getChildCount(), l = void 0; f < m && (l = d.getChild(f)); f++) 13319 if (l.type == CKEDITOR.NODE_ELEMENT && l.isBlockBoundary()) { 13320 d = !1; 13321 break a 13322 } d = !0 13323 } 13324 d && c.remove() 13325 } 13326 if (g.config.enterMode == CKEDITOR.ENTER_BR) 13327 for (c = !0; a.length;) 13328 if (f = a.shift(), "div" == f.getName()) { 13329 b = new CKEDITOR.dom.documentFragment(g.document); 13330 !c || !f.getPrevious() || f.getPrevious().type == 13331 CKEDITOR.NODE_ELEMENT && f.getPrevious().isBlockBoundary() || b.append(g.document.createElement("br")); 13332 for (c = f.getNext() && !(f.getNext().type == CKEDITOR.NODE_ELEMENT && f.getNext().isBlockBoundary()); f.getFirst();) f.getFirst().remove().appendTo(b); 13333 c && b.append(g.document.createElement("br")); 13334 b.replace(f); 13335 c = !1 13336 } 13337 } 13338 k.selectBookmarks(h); 13339 g.focus() 13340 } 13341 }, 13342 refresh: function(g, a) { 13343 this.setState(g.elementPath(a.block || a.blockLimit).contains("blockquote", 1) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF) 13344 }, 13345 context: "blockquote", 13346 allowedContent: "blockquote", 13347 requiredContent: "blockquote" 13348 }; 13349 CKEDITOR.plugins.add("blockquote", { 13350 init: function(g) { 13351 g.blockless || (g.addCommand("blockquote", m), g.ui.addButton && g.ui.addButton("Blockquote", { 13352 label: g.lang.blockquote.toolbar, 13353 command: "blockquote", 13354 toolbar: "blocks,10" 13355 })) 13356 } 13357 }) 13358 })(); 13359 (function() { 13360 function q(b, a) { 13361 CKEDITOR.tools.extend(this, a, { 13362 editor: b, 13363 id: "cke-" + CKEDITOR.tools.getUniqueId(), 13364 area: b._.notificationArea 13365 }); 13366 a.type || (this.type = "info"); 13367 this.element = this._createElement(); 13368 b.plugins.clipboard && CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(this.element) 13369 } 13370 13371 function r(b) { 13372 var a = this; 13373 this.editor = b; 13374 this.notifications = []; 13375 this.element = this._createElement(); 13376 this._uiBuffer = CKEDITOR.tools.eventsBuffer(10, this._layout, this); 13377 this._changeBuffer = CKEDITOR.tools.eventsBuffer(500, this._layout, 13378 this); 13379 b.on("destroy", function() { 13380 a._removeListeners(); 13381 a.element.remove() 13382 }) 13383 } 13384 CKEDITOR.plugins.add("notification", { 13385 init: function(b) { 13386 function a(b) { 13387 var a = new CKEDITOR.dom.element("div"); 13388 a.setStyles({ 13389 position: "fixed", 13390 "margin-left": "-9999px" 13391 }); 13392 a.setAttributes({ 13393 "aria-live": "assertive", 13394 "aria-atomic": "true" 13395 }); 13396 a.setText(b); 13397 CKEDITOR.document.getBody().append(a); 13398 setTimeout(function() { 13399 a.remove() 13400 }, 100) 13401 } 13402 b._.notificationArea = new r(b); 13403 b.showNotification = function(a, d, e) { 13404 var f, l; 13405 "progress" == d ? f = e : l = e; 13406 a = new CKEDITOR.plugins.notification(b, { 13407 message: a, 13408 type: d, 13409 progress: f, 13410 duration: l 13411 }); 13412 a.show(); 13413 return a 13414 }; 13415 b.on("key", function(c) { 13416 if (27 == c.data.keyCode) { 13417 var d = b._.notificationArea.notifications; 13418 d.length && (a(b.lang.notification.closed), d[d.length - 1].hide(), c.cancel()) 13419 } 13420 }) 13421 } 13422 }); 13423 q.prototype = { 13424 show: function() { 13425 !1 !== this.editor.fire("notificationShow", { 13426 notification: this 13427 }) && (this.area.add(this), this._hideAfterTimeout()) 13428 }, 13429 update: function(b) { 13430 var a = !0; 13431 !1 === this.editor.fire("notificationUpdate", { 13432 notification: this, 13433 options: b 13434 }) && (a = !1); 13435 var c = this.element, 13436 d = c.findOne(".cke_notification_message"), 13437 e = c.findOne(".cke_notification_progress"), 13438 f = b.type; 13439 c.removeAttribute("role"); 13440 b.progress && "progress" != this.type && (f = "progress"); 13441 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))); 13442 void 0 !== b.message && (this.message = b.message, d.setHtml(this.message)); 13443 void 0 !== b.progress && (this.progress = b.progress, 13444 e && e.setStyle("width", this._getPercentageProgress())); 13445 a && b.important && (c.setAttribute("role", "alert"), this.isVisible() || this.area.add(this)); 13446 this.duration = b.duration; 13447 this._hideAfterTimeout() 13448 }, 13449 hide: function() { 13450 !1 !== this.editor.fire("notificationHide", { 13451 notification: this 13452 }) && this.area.remove(this) 13453 }, 13454 isVisible: function() { 13455 return 0 <= CKEDITOR.tools.indexOf(this.area.notifications, this) 13456 }, 13457 _createElement: function() { 13458 var b = this, 13459 a, c, d = this.editor.lang.common.close; 13460 a = new CKEDITOR.dom.element("div"); 13461 a.addClass("cke_notification"); 13462 a.addClass(this._getClass()); 13463 a.setAttributes({ 13464 id: this.id, 13465 role: "alert", 13466 "aria-label": this.type 13467 }); 13468 "progress" == this.type && a.append(this._createProgressElement()); 13469 c = new CKEDITOR.dom.element("p"); 13470 c.addClass("cke_notification_message"); 13471 c.setHtml(this.message); 13472 a.append(c); 13473 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'); 13474 a.append(c); 13475 c.on("click", 13476 function() { 13477 b.editor.focus(); 13478 b.hide() 13479 }); 13480 return a 13481 }, 13482 _getClass: function() { 13483 return "progress" == this.type ? "cke_notification_info" : "cke_notification_" + this.type 13484 }, 13485 _createProgressElement: function() { 13486 var b = new CKEDITOR.dom.element("span"); 13487 b.addClass("cke_notification_progress"); 13488 b.setStyle("width", this._getPercentageProgress()); 13489 return b 13490 }, 13491 _getPercentageProgress: function() { 13492 return Math.round(100 * (this.progress || 0)) + "%" 13493 }, 13494 _hideAfterTimeout: function() { 13495 var b = this, 13496 a; 13497 this._hideTimeoutId && clearTimeout(this._hideTimeoutId); 13498 if ("number" == typeof this.duration) a = this.duration; 13499 else if ("info" == this.type || "success" == this.type) a = "number" == typeof this.editor.config.notification_duration ? this.editor.config.notification_duration : 5E3; 13500 a && (b._hideTimeoutId = setTimeout(function() { 13501 b.hide() 13502 }, a)) 13503 } 13504 }; 13505 r.prototype = { 13506 add: function(b) { 13507 this.notifications.push(b); 13508 this.element.append(b.element); 13509 1 == this.element.getChildCount() && (CKEDITOR.document.getBody().append(this.element), this._attachListeners()); 13510 this._layout() 13511 }, 13512 remove: function(b) { 13513 var a = CKEDITOR.tools.indexOf(this.notifications, 13514 b); 13515 0 > a || (this.notifications.splice(a, 1), b.element.remove(), this.element.getChildCount() || (this._removeListeners(), this.element.remove())) 13516 }, 13517 _createElement: function() { 13518 var b = this.editor, 13519 a = b.config, 13520 c = new CKEDITOR.dom.element("div"); 13521 c.addClass("cke_notifications_area"); 13522 c.setAttribute("id", "cke_notifications_area_" + b.name); 13523 c.setStyle("z-index", a.baseFloatZIndex - 2); 13524 return c 13525 }, 13526 _attachListeners: function() { 13527 var b = CKEDITOR.document.getWindow(), 13528 a = this.editor; 13529 b.on("scroll", this._uiBuffer.input); 13530 b.on("resize", this._uiBuffer.input); 13531 a.on("change", this._changeBuffer.input); 13532 a.on("floatingSpaceLayout", this._layout, this, null, 20); 13533 a.on("blur", this._layout, this, null, 20) 13534 }, 13535 _removeListeners: function() { 13536 var b = CKEDITOR.document.getWindow(), 13537 a = this.editor; 13538 b.removeListener("scroll", this._uiBuffer.input); 13539 b.removeListener("resize", this._uiBuffer.input); 13540 a.removeListener("change", this._changeBuffer.input); 13541 a.removeListener("floatingSpaceLayout", this._layout); 13542 a.removeListener("blur", this._layout) 13543 }, 13544 _layout: function() { 13545 function b() { 13546 a.setStyle("left", 13547 k(n + d.width - g - h)) 13548 } 13549 var a = this.element, 13550 c = this.editor, 13551 d = c.ui.contentsElement.getClientRect(), 13552 e = c.ui.contentsElement.getDocumentPosition(), 13553 f, l, u = a.getClientRect(), 13554 m, g = this._notificationWidth, 13555 h = this._notificationMargin; 13556 m = CKEDITOR.document.getWindow(); 13557 var p = m.getScrollPosition(), 13558 t = m.getViewPaneSize(), 13559 q = CKEDITOR.document.getBody(), 13560 r = q.getDocumentPosition(), 13561 k = CKEDITOR.tools.cssLength; 13562 g && h || (m = this.element.getChild(0), g = this._notificationWidth = m.getClientRect().width, h = this._notificationMargin = parseInt(m.getComputedStyle("margin-left"), 13563 10) + parseInt(m.getComputedStyle("margin-right"), 10)); 13564 c.toolbar && (f = c.ui.space("top"), l = f.getClientRect()); 13565 f && f.isVisible() && l.bottom > d.top && l.bottom < d.bottom - u.height ? a.setStyles({ 13566 position: "fixed", 13567 top: k(l.bottom) 13568 }) : 0 < d.top ? a.setStyles({ 13569 position: "absolute", 13570 top: k(e.y) 13571 }) : e.y + d.height - u.height > p.y ? a.setStyles({ 13572 position: "fixed", 13573 top: 0 13574 }) : a.setStyles({ 13575 position: "absolute", 13576 top: k(e.y + d.height - u.height) 13577 }); 13578 var n = "fixed" == a.getStyle("position") ? d.left : "static" != q.getComputedStyle("position") ? e.x - r.x : e.x; 13579 d.width < 13580 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)) 13581 } 13582 }; 13583 CKEDITOR.plugins.notification = q 13584 })(); 13585 (function() { 13586 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}"'; 13587 CKEDITOR.env.gecko && CKEDITOR.env.mac && (c += ' onkeypress\x3d"return false;"'); 13588 CKEDITOR.env.gecko && (c += 13589 ' onblur\x3d"this.style.cssText \x3d this.style.cssText;"'); 13590 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}"'), 13591 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', 13592 v = CKEDITOR.addTemplate("buttonArrow", '\x3cspan class\x3d"cke_button_arrow"\x3e' + (CKEDITOR.env.hc ? "\x26#9660;" : "") + "\x3c/span\x3e"), 13593 w = CKEDITOR.addTemplate("button", c); 13594 CKEDITOR.plugins.add("button", { 13595 beforeInit: function(a) { 13596 a.ui.addHandler(CKEDITOR.UI_BUTTON, CKEDITOR.ui.button.handler) 13597 } 13598 }); 13599 CKEDITOR.UI_BUTTON = "button"; 13600 CKEDITOR.ui.button = function(a) { 13601 CKEDITOR.tools.extend(this, a, { 13602 title: a.label, 13603 click: a.click || function(b) { 13604 b.execCommand(a.command) 13605 } 13606 }); 13607 this._ = {} 13608 }; 13609 CKEDITOR.ui.button.handler = { 13610 create: function(a) { 13611 return new CKEDITOR.ui.button(a) 13612 } 13613 }; 13614 CKEDITOR.ui.button.prototype = { 13615 render: function(a, b) { 13616 function c() { 13617 var f = a.mode; 13618 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()) 13619 } 13620 var n = null, 13621 p = CKEDITOR.env, 13622 q = this._.id = CKEDITOR.tools.getNextId(), 13623 g = "", 13624 d = this.command, 13625 t, k, l; 13626 this._.editor = a; 13627 var e = { 13628 id: q, 13629 button: this, 13630 editor: a, 13631 focus: function() { 13632 CKEDITOR.document.getById(q).focus() 13633 }, 13634 execute: function() { 13635 this.button.click(a) 13636 }, 13637 attach: function(a) { 13638 this.button.attach(a) 13639 } 13640 }, 13641 x = CKEDITOR.tools.addFunction(function(a) { 13642 if (e.onkey) return a = new CKEDITOR.dom.event(a), !1 !== e.onkey(e, a.getKeystroke()) 13643 }), 13644 y = CKEDITOR.tools.addFunction(function(a) { 13645 var b; 13646 e.onfocus && (b = !1 !== e.onfocus(e, new CKEDITOR.dom.event(a))); 13647 return b 13648 }), 13649 u = 0; 13650 e.clickFn = t = CKEDITOR.tools.addFunction(function() { 13651 u && (a.unlockSelection(1), u = 0); 13652 e.execute(); 13653 p.iOS && a.focus() 13654 }); 13655 this.modes ? (n = {}, a.on("beforeModeUnload", function() { 13656 a.mode && this._.state != CKEDITOR.TRISTATE_DISABLED && (n[a.mode] = 13657 this._.state) 13658 }, 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() { 13659 this.setState(d.state) 13660 }, this), g += d.state == CKEDITOR.TRISTATE_ON ? "on" : d.state == CKEDITOR.TRISTATE_DISABLED ? "disabled" : "off"); 13661 var m; 13662 if (this.directional) a.on("contentDirChanged", function(b) { 13663 var c = CKEDITOR.document.getById(this._.id), 13664 d = c.getFirst(); 13665 b = b.data; 13666 b != a.lang.dir ? c.addClass("cke_" + b) : c.removeClass("cke_ltr").removeClass("cke_rtl"); 13667 d.setAttribute("style", 13668 CKEDITOR.skin.getIconStyle(m, "rtl" == b, this.icon, this.iconOffset)) 13669 }, this); 13670 d ? (k = a.getCommandKeystroke(d)) && (l = CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard, k)) : g += "off"; 13671 k = this.name || this.command; 13672 var h = null, 13673 r = this.icon; 13674 m = k; 13675 this.icon && !/\./.test(this.icon) ? (m = this.icon, r = null) : (this.icon && (h = this.icon), CKEDITOR.env.hidpi && this.iconHiDpi && (h = this.iconHiDpi)); 13676 h ? (CKEDITOR.skin.addIcon(h, h), r = null) : h = m; 13677 g = { 13678 id: q, 13679 name: k, 13680 iconName: m, 13681 label: this.label, 13682 cls: this.className || "", 13683 state: g, 13684 ariaDisabled: "disabled" == 13685 g ? "true" : "false", 13686 title: this.title + (l ? " (" + l.display + ")" : ""), 13687 ariaShortcut: l ? a.lang.common.keyboardShortcut + " " + l.aria : "", 13688 titleJs: p.gecko && !p.hc ? "" : (this.title || "").replace("'", ""), 13689 hasArrow: this.hasArrow ? "true" : "false", 13690 keydownFn: x, 13691 focusFn: y, 13692 clickFn: t, 13693 style: CKEDITOR.skin.getIconStyle(h, "rtl" == a.lang.dir, r, this.iconOffset), 13694 arrowHtml: this.hasArrow ? v.output() : "" 13695 }; 13696 w.output(g, b); 13697 if (this.onRender) this.onRender(); 13698 return e 13699 }, 13700 setState: function(a) { 13701 if (this._.state == a) return !1; 13702 this._.state = a; 13703 var b = CKEDITOR.document.getById(this._.id); 13704 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 13705 }, 13706 getState: function() { 13707 return this._.state 13708 }, 13709 toFeature: function(a) { 13710 if (this._.feature) return this._.feature; 13711 var b = this; 13712 this.allowedContent || this.requiredContent || !this.command || (b = a.getCommand(this.command) || b); 13713 return this._.feature = b 13714 } 13715 }; 13716 CKEDITOR.ui.prototype.addButton = function(a, b) { 13717 this.add(a, CKEDITOR.UI_BUTTON, b) 13718 } 13719 })(); 13720 (function() { 13721 function D(a) { 13722 function d() { 13723 for (var b = f(), e = CKEDITOR.tools.clone(a.config.toolbarGroups) || v(a), n = 0; n < e.length; n++) { 13724 var g = e[n]; 13725 if ("/" != g) { 13726 "string" == typeof g && (g = e[n] = { 13727 name: g 13728 }); 13729 var l, d = g.groups; 13730 if (d) 13731 for (var h = 0; h < d.length; h++) l = d[h], (l = b[l]) && c(g, l); 13732 (l = b[g.name]) && c(g, l) 13733 } 13734 } 13735 return e 13736 } 13737 13738 function f() { 13739 var b = {}, 13740 c, e, g; 13741 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({ 13742 name: c, 13743 order: g 13744 }); 13745 for (e in b) b[e] = b[e].sort(function(b, 13746 a) { 13747 return b.order == a.order ? 0 : 0 > a.order ? -1 : 0 > b.order ? 1 : b.order < a.order ? -1 : 1 13748 }); 13749 return b 13750 } 13751 13752 function c(c, e) { 13753 if (e.length) { 13754 c.items ? c.items.push(a.ui.create("-")) : c.items = []; 13755 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) 13756 } 13757 } 13758 13759 function h(b) { 13760 var a = [], 13761 e, d, h; 13762 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)), 13763 h.name = d.name, a.push(h)); 13764 return a 13765 } 13766 var b = a.config.removeButtons, 13767 b = b && b.split(","), 13768 e = a.config.toolbar; 13769 "string" == typeof e && (e = a.config["toolbar_" + e]); 13770 return a.toolbar = e ? h(e) : d() 13771 } 13772 13773 function v(a) { 13774 return a._.toolbarGroups || (a._.toolbarGroups = [{ 13775 name: "document", 13776 groups: ["mode", "document", "doctools"] 13777 }, { 13778 name: "clipboard", 13779 groups: ["clipboard", "undo"] 13780 }, { 13781 name: "editing", 13782 groups: ["find", "selection", "spellchecker"] 13783 }, { 13784 name: "forms" 13785 }, "/", { 13786 name: "basicstyles", 13787 groups: ["basicstyles", "cleanup"] 13788 }, { 13789 name: "paragraph", 13790 groups: ["list", 13791 "indent", "blocks", "align", "bidi" 13792 ] 13793 }, { 13794 name: "links" 13795 }, { 13796 name: "insert" 13797 }, "/", { 13798 name: "styles" 13799 }, { 13800 name: "colors" 13801 }, { 13802 name: "tools" 13803 }, { 13804 name: "others" 13805 }, { 13806 name: "about" 13807 }]) 13808 } 13809 var z = function() { 13810 this.toolbars = []; 13811 this.focusCommandExecuted = !1 13812 }; 13813 z.prototype.focus = function() { 13814 for (var a = 0, d; d = this.toolbars[a++];) 13815 for (var f = 0, c; c = d.items[f++];) 13816 if (c.focus) { 13817 c.focus(); 13818 return 13819 } 13820 }; 13821 var E = { 13822 modes: { 13823 wysiwyg: 1, 13824 source: 1 13825 }, 13826 readOnly: 1, 13827 exec: function(a) { 13828 a.toolbox && (a.toolbox.focusCommandExecuted = !0, CKEDITOR.env.ie || CKEDITOR.env.air ? setTimeout(function() { 13829 a.toolbox.focus() 13830 }, 13831 100) : a.toolbox.focus()) 13832 } 13833 }; 13834 CKEDITOR.plugins.add("toolbar", { 13835 requires: "button", 13836 init: function(a) { 13837 var d, f = function(c, h) { 13838 var b, e = "rtl" == a.lang.dir, 13839 k = a.config.toolbarGroupCycling, 13840 q = e ? 37 : 39, 13841 e = e ? 39 : 37, 13842 k = void 0 === k || k; 13843 switch (h) { 13844 case 9: 13845 case CKEDITOR.SHIFT + 9: 13846 for (; !b || !b.items.length;) 13847 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) 13848 for (c = b.items[d ? b.items.length - 1 : 0]; c && !c.focus;)(c = d ? c.previous : c.next) || 13849 (b = 0); 13850 c && c.focus(); 13851 return !1; 13852 case q: 13853 b = c; 13854 do b = b.next, !b && k && (b = c.toolbar.items[0]); while (b && !b.focus); 13855 b ? b.focus() : f(c, 9); 13856 return !1; 13857 case 40: 13858 return c.button && c.button.hasArrow ? c.execute() : f(c, 40 == h ? q : e), !1; 13859 case e: 13860 case 38: 13861 b = c; 13862 do b = b.previous, !b && k && (b = c.toolbar.items[c.toolbar.items.length - 1]); while (b && !b.focus); 13863 b ? b.focus() : (d = 1, f(c, CKEDITOR.SHIFT + 9), d = 0); 13864 return !1; 13865 case 27: 13866 return a.focus(), !1; 13867 case 13: 13868 case 32: 13869 return c.execute(), !1 13870 } 13871 return !0 13872 }; 13873 a.on("uiSpace", function(c) { 13874 if (c.data.space == a.config.toolbarLocation) { 13875 c.removeListener(); 13876 a.toolbox = new z; 13877 var d = CKEDITOR.tools.getNextId(), 13878 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'], 13879 d = !1 !== a.config.toolbarStartupExpanded, 13880 e, k; 13881 a.config.toolbarCanCollapse && a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE && b.push('\x3cspan class\x3d"cke_toolbox_main"' + (d ? "\x3e" : ' style\x3d"display:none"\x3e')); 13882 for (var q = a.toolbox.toolbars, n = D(a), g = n.length, l = 0; l < g; l++) { 13883 var r, m = 0, 13884 w, p = n[l], 13885 v = "/" !== p && ("/" === n[l + 1] || l == g - 1), 13886 x; 13887 if (p) 13888 if (e && (b.push("\x3c/span\x3e"), k = e = 0), "/" === p) b.push('\x3cspan class\x3d"cke_toolbar_break"\x3e\x3c/span\x3e'); 13889 else { 13890 x = p.items || p; 13891 for (var y = 0; y < x.length; y++) { 13892 var t = x[y], 13893 A; 13894 if (t) { 13895 var B = function(c) { 13896 c = c.render(a, b); 13897 u = m.items.push(c) - 1; 13898 0 < u && (c.previous = m.items[u - 1], c.previous.next = c); 13899 c.toolbar = m; 13900 c.onkey = f; 13901 c.onfocus = function() { 13902 a.toolbox.focusCommandExecuted || a.focus() 13903 } 13904 }; 13905 if (t.type == CKEDITOR.UI_SEPARATOR) k = 13906 e && t; 13907 else { 13908 A = !1 !== t.canGroup; 13909 if (!m) { 13910 r = CKEDITOR.tools.getNextId(); 13911 m = { 13912 id: r, 13913 items: [] 13914 }; 13915 w = p.name && (a.lang.toolbar.toolbarGroups[p.name] || p.name); 13916 b.push('\x3cspan id\x3d"', r, '" class\x3d"cke_toolbar' + (v ? ' cke_toolbar_last"' : '"'), w ? ' aria-labelledby\x3d"' + r + '_label"' : "", ' role\x3d"toolbar"\x3e'); 13917 w && b.push('\x3cspan id\x3d"', r, '_label" class\x3d"cke_voice_label"\x3e', w, "\x3c/span\x3e"); 13918 b.push('\x3cspan class\x3d"cke_toolbar_start"\x3e\x3c/span\x3e'); 13919 var u = q.push(m) - 1; 13920 0 < u && (m.previous = q[u - 1], m.previous.next = 13921 m) 13922 } 13923 A ? e || (b.push('\x3cspan class\x3d"cke_toolgroup" role\x3d"presentation"\x3e'), e = 1) : e && (b.push("\x3c/span\x3e"), e = 0); 13924 k && (B(k), k = 0); 13925 B(t) 13926 } 13927 } 13928 } 13929 e && (b.push("\x3c/span\x3e"), k = e = 0); 13930 m && b.push('\x3cspan class\x3d"cke_toolbar_end"\x3e\x3c/span\x3e\x3c/span\x3e') 13931 } 13932 } 13933 a.config.toolbarCanCollapse && b.push("\x3c/span\x3e"); 13934 if (a.config.toolbarCanCollapse && a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) { 13935 var C = CKEDITOR.tools.addFunction(function() { 13936 a.execCommand("toolbarCollapse") 13937 }); 13938 a.on("destroy", function() { 13939 CKEDITOR.tools.removeFunction(C) 13940 }); 13941 a.addCommand("toolbarCollapse", { 13942 readOnly: 1, 13943 exec: function(b) { 13944 var a = b.ui.space("toolbar_collapser"), 13945 c = a.getPrevious(), 13946 d = b.ui.space("contents"), 13947 e = c.getParent(), 13948 h = parseInt(d.$.style.height, 10), 13949 g = e.$.offsetHeight, 13950 f = a.hasClass("cke_toolbox_collapser_min"); 13951 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)); 13952 a.getFirst().setText(f ? "▲" : "◀"); 13953 d.setStyle("height", 13954 h - (e.$.offsetHeight - g) + "px"); 13955 b.fire("resize", { 13956 outerHeight: b.container.$.offsetHeight, 13957 contentsHeight: d.$.offsetHeight, 13958 outerWidth: b.container.$.offsetWidth 13959 }) 13960 }, 13961 modes: { 13962 wysiwyg: 1, 13963 source: 1 13964 } 13965 }); 13966 a.setKeystroke(CKEDITOR.ALT + (CKEDITOR.env.ie || CKEDITOR.env.webkit ? 189 : 109), "toolbarCollapse"); 13967 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'); 13968 d || b.push(" cke_toolbox_collapser_min"); 13969 b.push('" onclick\x3d"CKEDITOR.tools.callFunction(' + C + ')"\x3e', '\x3cspan class\x3d"cke_arrow"\x3e\x26#9650;\x3c/span\x3e', "\x3c/a\x3e") 13970 } 13971 b.push("\x3c/span\x3e"); 13972 c.data.html += b.join("") 13973 } 13974 }); 13975 a.on("destroy", function() { 13976 if (this.toolbox) { 13977 var a, d = 0, 13978 b, e, f; 13979 for (a = this.toolbox.toolbars; d < a.length; d++) 13980 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) 13981 } 13982 }); 13983 a.on("uiReady", function() { 13984 var c = a.ui.space("toolbox"); 13985 c && a.focusManager.add(c, 13986 1) 13987 }); 13988 a.addCommand("toolbarFocus", E); 13989 a.setKeystroke(CKEDITOR.ALT + 121, "toolbarFocus"); 13990 a.ui.add("-", CKEDITOR.UI_SEPARATOR, {}); 13991 a.ui.addHandler(CKEDITOR.UI_SEPARATOR, { 13992 create: function() { 13993 return { 13994 render: function(a, d) { 13995 d.push('\x3cspan class\x3d"cke_toolbar_separator" role\x3d"separator"\x3e\x3c/span\x3e'); 13996 return {} 13997 } 13998 } 13999 } 14000 }) 14001 } 14002 }); 14003 CKEDITOR.ui.prototype.addToolbarGroup = function(a, d, f) { 14004 var c = v(this.editor), 14005 h = 0 === d, 14006 b = { 14007 name: a 14008 }; 14009 if (f) { 14010 if (f = CKEDITOR.tools.search(c, function(a) { 14011 return a.name == f 14012 })) { 14013 !f.groups && (f.groups = []); 14014 if (d && 14015 (d = CKEDITOR.tools.indexOf(f.groups, d), 0 <= d)) { 14016 f.groups.splice(d + 1, 0, a); 14017 return 14018 } 14019 h ? f.groups.splice(0, 0, a) : f.groups.push(a); 14020 return 14021 } 14022 d = null 14023 } 14024 d && (d = CKEDITOR.tools.indexOf(c, function(a) { 14025 return a.name == d 14026 })); 14027 h ? c.splice(0, 0, a) : "number" == typeof d ? c.splice(d + 1, 0, b) : c.push(a) 14028 } 14029 })(); 14030 CKEDITOR.UI_SEPARATOR = "separator"; 14031 CKEDITOR.config.toolbarLocation = "top"; 14032 (function() { 14033 function r(a, b, c) { 14034 b.type || (b.type = "auto"); 14035 if (c && !1 === a.fire("beforePaste", b) || !b.dataValue && b.dataTransfer.isEmpty()) return !1; 14036 b.dataValue || (b.dataValue = ""); 14037 if (CKEDITOR.env.gecko && "drop" == b.method && a.toolbox) a.once("afterPaste", function() { 14038 a.toolbox.focus() 14039 }); 14040 return a.fire("paste", b) 14041 } 14042 14043 function x(a) { 14044 function b() { 14045 var b = a.editable(); 14046 if (CKEDITOR.plugins.clipboard.isCustomCopyCutSupported) { 14047 var c = function(b) { 14048 a.getSelection().isCollapsed() || (a.readOnly && "cut" == b.name || p.initPasteDataTransfer(b, 14049 a), b.data.preventDefault()) 14050 }; 14051 b.on("copy", c); 14052 b.on("cut", c); 14053 b.on("cut", function() { 14054 a.readOnly || a.extractSelectedHtml() 14055 }, null, null, 999) 14056 } 14057 b.on(p.mainPasteEvent, function(a) { 14058 "beforepaste" == p.mainPasteEvent && m || k(a) 14059 }); 14060 "beforepaste" == p.mainPasteEvent && (b.on("paste", function(a) { 14061 u || (g(), a.data.preventDefault(), k(a), e("paste")) 14062 }), b.on("contextmenu", h, null, null, 0), b.on("beforepaste", function(a) { 14063 !a.data || a.data.$.ctrlKey || a.data.$.shiftKey || h() 14064 }, null, null, 0)); 14065 b.on("beforecut", function() { 14066 !m && f(a) 14067 }); 14068 var d; 14069 b.attachListener(CKEDITOR.env.ie ? 14070 b : a.document.getDocumentElement(), "mouseup", 14071 function() { 14072 d = setTimeout(function() { 14073 t() 14074 }, 0) 14075 }); 14076 a.on("destroy", function() { 14077 clearTimeout(d) 14078 }); 14079 b.on("keyup", t) 14080 } 14081 14082 function c(b) { 14083 return { 14084 type: b, 14085 canUndo: "cut" == b, 14086 startDisabled: !0, 14087 fakeKeystroke: "cut" == b ? CKEDITOR.CTRL + 88 : CKEDITOR.CTRL + 67, 14088 exec: function() { 14089 "cut" == this.type && f(); 14090 var b; 14091 var c = this.type; 14092 if (CKEDITOR.env.ie) b = e(c); 14093 else try { 14094 b = a.document.$.execCommand(c, !1, null) 14095 } catch (d) { 14096 b = !1 14097 } 14098 b || a.showNotification(a.lang.clipboard[this.type + "Error"]); 14099 return b 14100 } 14101 } 14102 } 14103 14104 function d() { 14105 return { 14106 canUndo: !1, 14107 async: !0, 14108 fakeKeystroke: CKEDITOR.CTRL + 86, 14109 exec: function(a, b) { 14110 function c(b, h) { 14111 h = "undefined" !== typeof h ? h : !0; 14112 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); 14113 a._.forcePasteDialog = !1; 14114 a.fire("afterCommandExec", { 14115 name: "paste", 14116 command: d, 14117 returnValue: !!b 14118 }) 14119 } 14120 b = "undefined" !== typeof b && null !== b ? b : {}; 14121 var d = this, 14122 e = "undefined" !== typeof b.notification ? b.notification : !0, 14123 h = b.type, 14124 f = CKEDITOR.tools.keystrokeToString(a.lang.common.keyboard, 14125 a.getCommandKeystroke(this)), 14126 n = "string" === typeof e ? e : a.lang.clipboard.pasteNotification.replace(/%1/, '\x3ckbd aria-label\x3d"' + f.aria + '"\x3e' + f.display + "\x3c/kbd\x3e"), 14127 f = "string" === typeof b ? b : b.dataValue; 14128 h && !0 !== a.config.forcePasteAsPlainText && "allow-word" !== a.config.forcePasteAsPlainText ? a._.nextPasteType = h : delete a._.nextPasteType; 14129 "string" === typeof f ? c({ 14130 dataValue: f 14131 }) : a.getClipboardData(c) 14132 } 14133 } 14134 } 14135 14136 function g() { 14137 u = 1; 14138 setTimeout(function() { 14139 u = 0 14140 }, 100) 14141 } 14142 14143 function h() { 14144 m = 1; 14145 setTimeout(function() { 14146 m = 0 14147 }, 10) 14148 } 14149 14150 function e(b) { 14151 var c = 14152 a.document, 14153 d = c.getBody(), 14154 e = !1, 14155 h = function() { 14156 e = !0 14157 }; 14158 d.on(b, h); 14159 7 < CKEDITOR.env.version ? c.$.execCommand(b) : c.$.selection.createRange().execCommand(b); 14160 d.removeListener(b, h); 14161 return e 14162 } 14163 14164 function f() { 14165 if (CKEDITOR.env.ie && !CKEDITOR.env.quirks) { 14166 var b = a.getSelection(), 14167 c, d, e; 14168 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() { 14169 c.getParent() && (e.remove(), b.selectElement(c)) 14170 }, 14171 0)) 14172 } 14173 } 14174 14175 function l(b, c) { 14176 var d = a.document, 14177 e = a.editable(), 14178 h = function(a) { 14179 a.cancel() 14180 }, 14181 f; 14182 if (!d.getById("cke_pastebin")) { 14183 var n = a.getSelection(), 14184 g = n.createBookmarks(); 14185 CKEDITOR.env.ie && n.root.fire("selectionchange"); 14186 var k = new CKEDITOR.dom.element(!CKEDITOR.env.webkit && !e.is("body") || CKEDITOR.env.ie ? "div" : "body", d); 14187 k.setAttributes({ 14188 id: "cke_pastebin", 14189 "data-cke-temp": "1" 14190 }); 14191 var l = 0, 14192 d = d.getWindow(); 14193 CKEDITOR.env.webkit ? (e.append(k), k.addClass("cke_editable"), e.is("body") || (l = "static" != e.getComputedStyle("position") ? 14194 e : CKEDITOR.dom.element.get(e.$.offsetParent), l = l.getDocumentPosition().y)) : e.getAscendant(CKEDITOR.env.ie ? "body" : "html", 1).append(k); 14195 k.setStyles({ 14196 position: "absolute", 14197 top: d.getScrollPosition().y - l + 10 + "px", 14198 width: "1px", 14199 height: Math.max(1, d.getViewPaneSize().height - 20) + "px", 14200 overflow: "hidden", 14201 margin: 0, 14202 padding: 0 14203 }); 14204 CKEDITOR.env.safari && k.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select", "text")); 14205 (l = k.getParent().isReadOnly()) ? (k.setOpacity(0), k.setAttribute("contenteditable", !0)) : k.setStyle("ltr" == a.config.contentsLangDirection ? 14206 "left" : "right", "-10000px"); 14207 a.on("selectionChange", h, null, null, 0); 14208 if (CKEDITOR.env.webkit || CKEDITOR.env.gecko) f = e.once("blur", h, null, null, -100); 14209 l && k.focus(); 14210 l = new CKEDITOR.dom.range(k); 14211 l.selectNodeContents(k); 14212 var t = l.select(); 14213 CKEDITOR.env.ie && (f = e.once("blur", function() { 14214 a.lockSelection(t) 14215 })); 14216 var q = CKEDITOR.document.getWindow().getScrollPosition().y; 14217 setTimeout(function() { 14218 CKEDITOR.env.webkit && (CKEDITOR.document.getBody().$.scrollTop = q); 14219 f && f.removeListener(); 14220 CKEDITOR.env.ie && e.focus(); 14221 n.selectBookmarks(g); 14222 k.remove(); 14223 var b; 14224 CKEDITOR.env.webkit && (b = k.getFirst()) && b.is && b.hasClass("Apple-style-span") && (k = b); 14225 a.removeListener("selectionChange", h); 14226 c(k.getHtml()) 14227 }, 0) 14228 } 14229 } 14230 14231 function y() { 14232 if ("paste" == p.mainPasteEvent) return a.fire("beforePaste", { 14233 type: "auto", 14234 method: "paste" 14235 }), !1; 14236 a.focus(); 14237 g(); 14238 var b = a.focusManager; 14239 b.lock(); 14240 if (a.editable().fire(p.mainPasteEvent) && !e("paste")) return b.unlock(), !1; 14241 b.unlock(); 14242 return !0 14243 } 14244 14245 function n(b) { 14246 if ("wysiwyg" == a.mode) switch (b.data.keyCode) { 14247 case CKEDITOR.CTRL + 86: 14248 case CKEDITOR.SHIFT + 45: 14249 b = 14250 a.editable(); 14251 g(); 14252 "paste" == p.mainPasteEvent && b.fire("beforepaste"); 14253 break; 14254 case CKEDITOR.CTRL + 88: 14255 case CKEDITOR.SHIFT + 46: 14256 a.fire("saveSnapshot"), setTimeout(function() { 14257 a.fire("saveSnapshot") 14258 }, 50) 14259 } 14260 } 14261 14262 function k(b) { 14263 var c = { 14264 type: "auto", 14265 method: "paste", 14266 dataTransfer: p.initPasteDataTransfer(b) 14267 }; 14268 c.dataTransfer.cacheData(); 14269 var d = !1 !== a.fire("beforePaste", c); 14270 d && p.canClipboardApiBeTrusted(c.dataTransfer, a) ? (b.data.preventDefault(), setTimeout(function() { 14271 r(a, c) 14272 }, 0)) : l(b, function(b) { 14273 c.dataValue = b.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/ig, 14274 ""); 14275 d && r(a, c) 14276 }) 14277 } 14278 14279 function t() { 14280 if ("wysiwyg" == a.mode) { 14281 var b = q("paste"); 14282 a.getCommand("cut").setState(q("cut")); 14283 a.getCommand("copy").setState(q("copy")); 14284 a.getCommand("paste").setState(b); 14285 a.fire("pasteState", b) 14286 } 14287 } 14288 14289 function q(b) { 14290 if (v && b in { 14291 paste: 1, 14292 cut: 1 14293 }) return CKEDITOR.TRISTATE_DISABLED; 14294 if ("paste" == b) return CKEDITOR.TRISTATE_OFF; 14295 b = a.getSelection(); 14296 var c = b.getRanges(); 14297 return b.getType() == CKEDITOR.SELECTION_NONE || 1 == c.length && c[0].collapsed ? CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_OFF 14298 } 14299 var p = CKEDITOR.plugins.clipboard, 14300 m = 0, 14301 u = 0, 14302 v = 0; 14303 (function() { 14304 a.on("key", n); 14305 a.on("contentDom", b); 14306 a.on("selectionChange", function(a) { 14307 v = a.data.selection.getRanges()[0].checkReadOnly(); 14308 t() 14309 }); 14310 if (a.contextMenu) { 14311 a.contextMenu.addListener(function(a, b) { 14312 v = b.getRanges()[0].checkReadOnly(); 14313 return { 14314 cut: q("cut"), 14315 copy: q("copy"), 14316 paste: q("paste") 14317 } 14318 }); 14319 var c = null; 14320 a.on("menuShow", function() { 14321 c && (c.removeListener(), c = null); 14322 var b = a.contextMenu.findItemByCommandName("paste"); 14323 b && b.element && (c = b.element.on("touchend", function() { 14324 a._.forcePasteDialog = !0 14325 })) 14326 }) 14327 } 14328 if (a.ui.addButton) a.once("instanceReady", 14329 function() { 14330 a._.pasteButtons && CKEDITOR.tools.array.forEach(a._.pasteButtons, function(b) { 14331 if (b = a.ui.get(b)) 14332 if (b = CKEDITOR.document.getById(b._.id)) b.on("touchend", function() { 14333 a._.forcePasteDialog = !0 14334 }) 14335 }) 14336 }) 14337 })(); 14338 (function() { 14339 function b(c, d, e, h, f) { 14340 var n = a.lang.clipboard[d]; 14341 a.addCommand(d, e); 14342 a.ui.addButton && a.ui.addButton(c, { 14343 label: n, 14344 command: d, 14345 toolbar: "clipboard," + h 14346 }); 14347 a.addMenuItems && a.addMenuItem(d, { 14348 label: n, 14349 command: d, 14350 group: "clipboard", 14351 order: f 14352 }) 14353 } 14354 b("Cut", "cut", c("cut"), 10, 1); 14355 b("Copy", "copy", c("copy"), 20, 4); 14356 b("Paste", 14357 "paste", d(), 30, 8); 14358 a._.pasteButtons || (a._.pasteButtons = []); 14359 a._.pasteButtons.push("Paste") 14360 })(); 14361 a.getClipboardData = function(b, c) { 14362 function d(a) { 14363 a.removeListener(); 14364 a.cancel(); 14365 c(a.data) 14366 } 14367 14368 function e(a) { 14369 a.removeListener(); 14370 a.cancel(); 14371 c({ 14372 type: f, 14373 dataValue: a.data.dataValue, 14374 dataTransfer: a.data.dataTransfer, 14375 method: "paste" 14376 }) 14377 } 14378 var h = !1, 14379 f = "auto"; 14380 c || (c = b, b = null); 14381 a.on("beforePaste", function(a) { 14382 a.removeListener(); 14383 h = !0; 14384 f = a.data.type 14385 }, null, null, 1E3); 14386 a.on("paste", d, null, null, 0); 14387 !1 === y() && (a.removeListener("paste", d), a._.forcePasteDialog && 14388 h && a.fire("pasteDialog") ? (a.on("pasteDialogCommit", e), a.on("dialogHide", function(a) { 14389 a.removeListener(); 14390 a.data.removeListener("pasteDialogCommit", e); 14391 a.data._.committed || c(null) 14392 })) : c(null)) 14393 } 14394 } 14395 14396 function z(a) { 14397 if (CKEDITOR.env.webkit) { 14398 if (!a.match(/^[^<]*$/g) && !a.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi)) return "html" 14399 } else if (CKEDITOR.env.ie) { 14400 if (!a.match(/^([^<]|<br( ?\/)?>)*$/gi) && !a.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi)) return "html" 14401 } else if (CKEDITOR.env.gecko) { 14402 if (!a.match(/^([^<]|<br( ?\/)?>)*$/gi)) return "html" 14403 } else return "html"; 14404 return "htmlifiedtext" 14405 } 14406 14407 function A(a, b) { 14408 function c(a) { 14409 return CKEDITOR.tools.repeat("\x3c/p\x3e\x3cp\x3e", ~~(a / 2)) + (1 == a % 2 ? "\x3cbr\x3e" : "") 14410 } 14411 b = b.replace(/(?!\u3000)\s+/g, " ").replace(/> +</g, "\x3e\x3c").replace(/<br ?\/>/gi, "\x3cbr\x3e"); 14412 b = b.replace(/<\/?[A-Z]+>/g, function(a) { 14413 return a.toLowerCase() 14414 }); 14415 if (b.match(/^[^<]$/)) return b; 14416 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"), 14417 b.match(/<div>(<br>|)<\/div>/) && (b = "\x3cp\x3e" + b.replace(/(<div>(<br>|)<\/div>)+/g, function(a) { 14418 return c(a.split("\x3c/div\x3e\x3cdiv\x3e").length + 1) 14419 }) + "\x3c/p\x3e"), b = b.replace(/<\/div><div>/g, "\x3cbr\x3e"), b = b.replace(/<\/?div>/g, "")); 14420 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) { 14421 return c(a.length / 4) 14422 }) + "\x3c/p\x3e")); 14423 return B(a, b) 14424 } 14425 14426 function C() { 14427 function a() { 14428 var a = {}, 14429 b; 14430 for (b in CKEDITOR.dtd) "$" != b.charAt(0) && "div" != b && "span" != b && (a[b] = 1); 14431 return a 14432 } 14433 var b = {}; 14434 return { 14435 get: function(c) { 14436 return "plain-text" == c ? b.plainText || (b.plainText = new CKEDITOR.filter("br")) : "semantic-content" == c ? ((c = b.semanticContent) || (c = new CKEDITOR.filter, c.allow({ 14437 $1: { 14438 elements: a(), 14439 attributes: !0, 14440 styles: !1, 14441 classes: !1 14442 } 14443 }), c = b.semanticContent = c), c) : c ? new CKEDITOR.filter(c) : null 14444 } 14445 } 14446 } 14447 14448 function w(a, b, c) { 14449 b = CKEDITOR.htmlParser.fragment.fromHtml(b); 14450 var d = new CKEDITOR.htmlParser.basicWriter; 14451 c.applyTo(b, !0, !1, 14452 a.activeEnterMode); 14453 b.writeHtml(d); 14454 return d.getHtml() 14455 } 14456 14457 function B(a, b) { 14458 a.enterMode == CKEDITOR.ENTER_BR ? b = b.replace(/(<\/p><p>)+/g, function(a) { 14459 return CKEDITOR.tools.repeat("\x3cbr\x3e", a.length / 7 * 2) 14460 }).replace(/<\/?p>/g, "") : a.enterMode == CKEDITOR.ENTER_DIV && (b = b.replace(/<(\/)?p>/g, "\x3c$1div\x3e")); 14461 return b 14462 } 14463 14464 function D(a) { 14465 a.data.preventDefault(); 14466 a.data.$.dataTransfer.dropEffect = "none" 14467 } 14468 14469 function E(a) { 14470 var b = CKEDITOR.plugins.clipboard; 14471 a.on("contentDom", function() { 14472 function c(b, c, e) { 14473 c.select(); 14474 r(a, { 14475 dataTransfer: e, 14476 method: "drop" 14477 }, 1); 14478 e.sourceEditor.fire("saveSnapshot"); 14479 e.sourceEditor.editable().extractHtmlFromRange(b); 14480 e.sourceEditor.getSelection().selectRanges([b]); 14481 e.sourceEditor.fire("saveSnapshot") 14482 } 14483 14484 function d(c, e) { 14485 c.select(); 14486 r(a, { 14487 dataTransfer: e, 14488 method: "drop" 14489 }, 1); 14490 b.resetDragDataTransfer() 14491 } 14492 14493 function g(b, c, e) { 14494 var d = { 14495 $: b.data.$, 14496 target: b.data.getTarget() 14497 }; 14498 c && (d.dragRange = c); 14499 e && (d.dropRange = e); 14500 !1 === a.fire(b.name, d) && b.data.preventDefault() 14501 } 14502 14503 function h(a) { 14504 a.type != CKEDITOR.NODE_ELEMENT && (a = a.getParent()); 14505 return a.getChildCount() 14506 } 14507 var e = a.editable(), 14508 f = CKEDITOR.plugins.clipboard.getDropTarget(a), 14509 l = a.ui.space("top"), 14510 m = a.ui.space("bottom"); 14511 b.preventDefaultDropOnElement(l); 14512 b.preventDefaultDropOnElement(m); 14513 e.attachListener(f, "dragstart", g); 14514 e.attachListener(a, "dragstart", b.resetDragDataTransfer, b, null, 1); 14515 e.attachListener(a, "dragstart", function(c) { 14516 b.initDragDataTransfer(c, a) 14517 }, null, null, 2); 14518 e.attachListener(a, "dragstart", function() { 14519 var c = b.dragRange = a.getSelection().getRanges()[0]; 14520 CKEDITOR.env.ie && 10 > CKEDITOR.env.version && (b.dragStartContainerChildCount = 14521 c ? h(c.startContainer) : null, b.dragEndContainerChildCount = c ? h(c.endContainer) : null) 14522 }, null, null, 100); 14523 e.attachListener(f, "dragend", g); 14524 e.attachListener(a, "dragend", b.initDragDataTransfer, b, null, 1); 14525 e.attachListener(a, "dragend", b.resetDragDataTransfer, b, null, 100); 14526 e.attachListener(f, "dragover", function(a) { 14527 if (CKEDITOR.env.edge) a.data.preventDefault(); 14528 else { 14529 var b = a.data.getTarget(); 14530 b && b.is && b.is("html") ? a.data.preventDefault() : CKEDITOR.env.ie && CKEDITOR.plugins.clipboard.isFileApiSupported && a.data.$.dataTransfer.types.contains("Files") && 14531 a.data.preventDefault() 14532 } 14533 }); 14534 e.attachListener(f, "drop", function(c) { 14535 if (!c.data.$.defaultPrevented) { 14536 c.data.preventDefault(); 14537 var e = c.data.getTarget(); 14538 if (!e.isReadOnly() || e.type == CKEDITOR.NODE_ELEMENT && e.is("html")) { 14539 var e = b.getRangeAtDropPosition(c, a), 14540 d = b.dragRange; 14541 e && g(c, d, e) 14542 } 14543 } 14544 }, null, null, 9999); 14545 e.attachListener(a, "drop", b.initDragDataTransfer, b, null, 1); 14546 e.attachListener(a, "drop", function(e) { 14547 if (e = e.data) { 14548 var h = e.dropRange, 14549 f = e.dragRange, 14550 g = e.dataTransfer; 14551 g.getTransferType(a) == CKEDITOR.DATA_TRANSFER_INTERNAL ? 14552 setTimeout(function() { 14553 b.internalDrop(f, h, g, a) 14554 }, 0) : g.getTransferType(a) == CKEDITOR.DATA_TRANSFER_CROSS_EDITORS ? c(f, h, g) : d(h, g) 14555 } 14556 }, null, null, 9999) 14557 }) 14558 } 14559 var m; 14560 CKEDITOR.plugins.add("clipboard", { 14561 requires: "dialog,notification,toolbar", 14562 init: function(a) { 14563 var b, c = C(); 14564 a.config.forcePasteAsPlainText ? b = "plain-text" : a.config.pasteFilter ? b = a.config.pasteFilter : !CKEDITOR.env.webkit || "pasteFilter" in a.config || (b = "semantic-content"); 14565 a.pasteFilter = c.get(b); 14566 x(a); 14567 E(a); 14568 CKEDITOR.dialog.add("paste", CKEDITOR.getUrl(this.path + 14569 "dialogs/paste.js")); 14570 if (CKEDITOR.env.gecko) { 14571 var d = ["image/png", "image/jpeg", "image/gif"], 14572 g; 14573 a.on("paste", function(b) { 14574 var c = b.data, 14575 f = c.dataTransfer; 14576 if (!c.dataValue && "paste" == c.method && f && 1 == f.getFilesCount() && g != f.id && (f = f.getFile(0), -1 != CKEDITOR.tools.indexOf(d, f.type))) { 14577 var l = new FileReader; 14578 l.addEventListener("load", function() { 14579 b.data.dataValue = '\x3cimg src\x3d"' + l.result + '" /\x3e'; 14580 a.fire("paste", b.data) 14581 }, !1); 14582 l.addEventListener("abort", function() { 14583 a.fire("paste", b.data) 14584 }, !1); 14585 l.addEventListener("error", 14586 function() { 14587 a.fire("paste", b.data) 14588 }, !1); 14589 l.readAsDataURL(f); 14590 g = c.dataTransfer.id; 14591 b.stop() 14592 } 14593 }, null, null, 1) 14594 } 14595 a.on("paste", function(b) { 14596 b.data.dataTransfer || (b.data.dataTransfer = new CKEDITOR.plugins.clipboard.dataTransfer); 14597 if (!b.data.dataValue) { 14598 var c = b.data.dataTransfer, 14599 d = c.getData("text/html"); 14600 if (d) b.data.dataValue = d, b.data.type = "html"; 14601 else if (d = c.getData("text/plain")) b.data.dataValue = a.editable().transformPlainTextToHtml(d), b.data.type = "text" 14602 } 14603 }, null, null, 1); 14604 a.on("paste", function(a) { 14605 var b = a.data.dataValue, 14606 c = CKEDITOR.dtd.$block; - 1 < b.indexOf("Apple-") && (b = b.replace(/<span class="Apple-converted-space"> <\/span>/gi, " "), "html" != a.data.type && (b = b.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi, function(a, b) { 14607 return b.replace(/\t/g, "\x26nbsp;\x26nbsp; \x26nbsp;") 14608 })), -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")); 14609 if (b.match(/^<[^<]+cke_(editable|contents)/i)) { 14610 var d, g, n = new CKEDITOR.dom.element("div"); 14611 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; 14612 g && (b = g.getHtml().replace(/<br>$/i, "")) 14613 } 14614 CKEDITOR.env.ie ? b = b.replace(/^ (?: |\r\n)?<(\w+)/g, function(b, d) { 14615 return d.toLowerCase() in c ? (a.data.preSniffing = "html", "\x3c" + d) : b 14616 }) : CKEDITOR.env.webkit ? b = b.replace(/<\/(\w+)><div><br><\/div>$/, function(b, d) { 14617 return d in 14618 c ? (a.data.endsWithEOL = 1, "\x3c/" + d + "\x3e") : b 14619 }) : CKEDITOR.env.gecko && (b = b.replace(/(\s)<br>$/, "$1")); 14620 a.data.dataValue = b 14621 }, null, null, 3); 14622 a.on("paste", function(b) { 14623 b = b.data; 14624 var d = a._.nextPasteType || b.type, 14625 f = b.dataValue, 14626 g, m = a.config.clipboard_defaultContentType || "html", 14627 n = b.dataTransfer.getTransferType(a) == CKEDITOR.DATA_TRANSFER_EXTERNAL, 14628 k = !0 === a.config.forcePasteAsPlainText; 14629 g = "html" == d || "html" == b.preSniffing ? "html" : z(f); 14630 delete a._.nextPasteType; 14631 "htmlifiedtext" == g && (f = A(a.config, f)); 14632 if ("text" == d && "html" == g) f = 14633 w(a, f, c.get("plain-text")); 14634 else if (n && a.pasteFilter && !b.dontFilter || k) f = w(a, f, a.pasteFilter); 14635 b.startsWithEOL && (f = '\x3cbr data-cke-eol\x3d"1"\x3e' + f); 14636 b.endsWithEOL && (f += '\x3cbr data-cke-eol\x3d"1"\x3e'); 14637 "auto" == d && (d = "html" == g || "html" == m ? "html" : "text"); 14638 b.type = d; 14639 b.dataValue = f; 14640 delete b.preSniffing; 14641 delete b.startsWithEOL; 14642 delete b.endsWithEOL 14643 }, null, null, 6); 14644 a.on("paste", function(b) { 14645 b = b.data; 14646 b.dataValue && (a.insertHtml(b.dataValue, b.type, b.range), setTimeout(function() { 14647 a.fire("afterPaste") 14648 }, 0)) 14649 }, null, null, 14650 1E3); 14651 a.on("pasteDialog", function(b) { 14652 setTimeout(function() { 14653 a.openDialog("paste", b.data) 14654 }, 0) 14655 }) 14656 } 14657 }); 14658 CKEDITOR.plugins.clipboard = { 14659 isCustomCopyCutSupported: (!CKEDITOR.env.ie || 16 <= CKEDITOR.env.version) && !CKEDITOR.env.iOS, 14660 isCustomDataTypesSupported: !CKEDITOR.env.ie || 16 <= CKEDITOR.env.version, 14661 isFileApiSupported: !CKEDITOR.env.ie || 9 < CKEDITOR.env.version, 14662 mainPasteEvent: CKEDITOR.env.ie && !CKEDITOR.env.edge ? "beforepaste" : "paste", 14663 addPasteButton: function(a, b, c) { 14664 a.ui.addButton && (a.ui.addButton(b, c), a._.pasteButtons || 14665 (a._.pasteButtons = []), a._.pasteButtons.push(b)) 14666 }, 14667 canClipboardApiBeTrusted: function(a, b) { 14668 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 14669 }, 14670 getDropTarget: function(a) { 14671 var b = a.editable(); 14672 return CKEDITOR.env.ie && 9 > CKEDITOR.env.version || b.isInline() ? b : a.document 14673 }, 14674 fixSplitNodesAfterDrop: function(a, 14675 b, c, d) { 14676 function g(a, c, d) { 14677 var g = a; 14678 g.type == CKEDITOR.NODE_TEXT && (g = a.getParent()); 14679 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 14680 } 14681 var h = b.startContainer; 14682 "number" == typeof d && "number" == typeof c && h.type == CKEDITOR.NODE_ELEMENT && (g(a.startContainer, h, c) || g(a.endContainer, 14683 h, d)) 14684 }, 14685 isDropRangeAffectedByDragRange: function(a, b) { 14686 var c = b.startContainer, 14687 d = b.endOffset; 14688 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 14689 }, 14690 internalDrop: function(a, b, c, d) { 14691 var g = CKEDITOR.plugins.clipboard, 14692 h = d.editable(), 14693 e, f; 14694 d.fire("saveSnapshot"); 14695 d.fire("lockSnapshot", { 14696 dontUpdate: 1 14697 }); 14698 CKEDITOR.env.ie && 10 > CKEDITOR.env.version && this.fixSplitNodesAfterDrop(a, b, g.dragStartContainerChildCount, 14699 g.dragEndContainerChildCount); 14700 (f = this.isDropRangeAffectedByDragRange(a, b)) || (e = a.createBookmark(!1)); 14701 g = b.clone().createBookmark(!1); 14702 f && (e = a.createBookmark(!1)); 14703 a = e.startNode; 14704 b = e.endNode; 14705 f = g.startNode; 14706 b && a.getPosition(f) & CKEDITOR.POSITION_PRECEDING && b.getPosition(f) & CKEDITOR.POSITION_FOLLOWING && f.insertBefore(a); 14707 a = d.createRange(); 14708 a.moveToBookmark(e); 14709 h.extractHtmlFromRange(a, 1); 14710 b = d.createRange(); 14711 b.moveToBookmark(g); 14712 r(d, { 14713 dataTransfer: c, 14714 method: "drop", 14715 range: b 14716 }, 1); 14717 d.fire("unlockSnapshot") 14718 }, 14719 getRangeAtDropPosition: function(a, 14720 b) { 14721 var c = a.data.$, 14722 d = c.clientX, 14723 g = c.clientY, 14724 h = b.getSelection(!0).getRanges()[0], 14725 e = b.createRange(); 14726 if (a.data.testRange) return a.data.testRange; 14727 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); 14728 else if (c.rangeParent) e.setStart(CKEDITOR.dom.node(c.rangeParent), c.rangeOffset), e.collapse(!0); 14729 else { 14730 if (CKEDITOR.env.ie && 8 < CKEDITOR.env.version && h && b.editable().hasFocus) return h; 14731 if (document.body.createTextRange) { 14732 b.focus(); 14733 c = b.document.getBody().$.createTextRange(); 14734 try { 14735 for (var f = !1, l = 0; 20 > l && !f; l++) { 14736 if (!f) try { 14737 c.moveToPoint(d, g - l), f = !0 14738 } catch (m) {} 14739 if (!f) try { 14740 c.moveToPoint(d, g + l), f = !0 14741 } catch (n) {} 14742 } 14743 if (f) { 14744 var k = "cke-temp-" + (new Date).getTime(); 14745 c.pasteHTML('\x3cspan id\x3d"' + k + '"\x3e\x3c/span\x3e'); 14746 var t = b.document.getById(k); 14747 e.moveToPosition(t, CKEDITOR.POSITION_BEFORE_START); 14748 t.remove() 14749 } else { 14750 var q = b.document.$.elementFromPoint(d, g), 14751 p = new CKEDITOR.dom.element(q), 14752 r; 14753 if (p.equals(b.editable()) || 14754 "html" == p.getName()) return h && h.startContainer && !h.startContainer.equals(b.editable()) ? h : null; 14755 r = p.getClientRect(); 14756 d < r.left ? e.setStartAt(p, CKEDITOR.POSITION_AFTER_START) : e.setStartAt(p, CKEDITOR.POSITION_BEFORE_END); 14757 e.collapse(!0) 14758 } 14759 } catch (u) { 14760 return null 14761 } 14762 } else return null 14763 } 14764 return e 14765 }, 14766 initDragDataTransfer: function(a, b) { 14767 var c = a.data.$ ? a.data.$.dataTransfer : null, 14768 d = new this.dataTransfer(c, b); 14769 "dragstart" === a.name && d.storeId(); 14770 c ? this.dragData && d.id == this.dragData.id ? d = this.dragData : this.dragData = d : this.dragData ? 14771 d = this.dragData : this.dragData = d; 14772 a.data.dataTransfer = d 14773 }, 14774 resetDragDataTransfer: function() { 14775 this.dragData = null 14776 }, 14777 initPasteDataTransfer: function(a, b) { 14778 if (this.isCustomCopyCutSupported) { 14779 if (a && a.data && a.data.$) { 14780 var c = a.data.$.clipboardData, 14781 d = new this.dataTransfer(c, b); 14782 "copy" !== a.name && "cut" !== a.name || d.storeId(); 14783 this.copyCutData && d.id == this.copyCutData.id ? (d = this.copyCutData, d.$ = c) : this.copyCutData = d; 14784 return d 14785 } 14786 return new this.dataTransfer(null, b) 14787 } 14788 return new this.dataTransfer(CKEDITOR.env.edge && a && a.data.$ && 14789 a.data.$.clipboardData || null, b) 14790 }, 14791 preventDefaultDropOnElement: function(a) { 14792 a && a.on("dragover", D) 14793 } 14794 }; 14795 m = CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ? "cke/id" : "Text"; 14796 CKEDITOR.plugins.clipboard.dataTransfer = function(a, b) { 14797 a && (this.$ = a); 14798 this._ = { 14799 metaRegExp: /^<meta.*?>/i, 14800 bodyRegExp: /<body(?:[\s\S]*?)>([\s\S]*)<\/body>/i, 14801 fragmentRegExp: /\x3c!--(?:Start|End)Fragment--\x3e/g, 14802 data: {}, 14803 files: [], 14804 nativeHtmlCache: "", 14805 normalizeType: function(a) { 14806 a = a.toLowerCase(); 14807 return "text" == a || "text/plain" == a ? "Text" : "url" == a ? 14808 "URL" : a 14809 } 14810 }; 14811 this._.fallbackDataTransfer = new CKEDITOR.plugins.clipboard.fallbackDataTransfer(this); 14812 this.id = this.getData(m); 14813 this.id || (this.id = "Text" == m ? "" : "cke-" + CKEDITOR.tools.getUniqueId()); 14814 b && (this.sourceEditor = b, this.setData("text/html", b.getSelectedHtml(1)), "Text" == m || this.getData("text/plain") || this.setData("text/plain", b.getSelection().getSelectedText())) 14815 }; 14816 CKEDITOR.DATA_TRANSFER_INTERNAL = 1; 14817 CKEDITOR.DATA_TRANSFER_CROSS_EDITORS = 2; 14818 CKEDITOR.DATA_TRANSFER_EXTERNAL = 3; 14819 CKEDITOR.plugins.clipboard.dataTransfer.prototype = { 14820 getData: function(a, b) { 14821 a = this._.normalizeType(a); 14822 var c = "text/html" == a && b ? this._.nativeHtmlCache : this._.data[a]; 14823 if (void 0 === c || null === c || "" === c) { 14824 if (this._.fallbackDataTransfer.isRequired()) c = this._.fallbackDataTransfer.getData(a, b); 14825 else try { 14826 c = this.$.getData(a) || "" 14827 } catch (d) { 14828 c = "" 14829 } 14830 "text/html" != a || b || (c = this._stripHtml(c)) 14831 } 14832 "Text" == a && CKEDITOR.env.gecko && this.getFilesCount() && "file://" == c.substring(0, 7) && (c = ""); 14833 if ("string" === typeof c) var g = c.indexOf("\x3c/html\x3e"), 14834 c = -1 !== g ? c.substring(0, g + 7) : c; 14835 return c 14836 }, 14837 setData: function(a, b) { 14838 a = this._.normalizeType(a); 14839 "text/html" == a ? (this._.data[a] = this._stripHtml(b), this._.nativeHtmlCache = b) : this._.data[a] = b; 14840 if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported || "URL" == a || "Text" == a) 14841 if ("Text" == m && "Text" == a && (this.id = b), this._.fallbackDataTransfer.isRequired()) this._.fallbackDataTransfer.setData(a, b); 14842 else try { 14843 this.$.setData(a, b) 14844 } catch (c) {} 14845 }, 14846 storeId: function() { 14847 "Text" !== m && this.setData(m, this.id) 14848 }, 14849 getTransferType: function(a) { 14850 return this.sourceEditor ? this.sourceEditor == 14851 a ? CKEDITOR.DATA_TRANSFER_INTERNAL : CKEDITOR.DATA_TRANSFER_CROSS_EDITORS : CKEDITOR.DATA_TRANSFER_EXTERNAL 14852 }, 14853 cacheData: function() { 14854 function a(a) { 14855 a = b._.normalizeType(a); 14856 var c = b.getData(a); 14857 "text/html" == a && (b._.nativeHtmlCache = b.getData(a, !0), c = b._stripHtml(c)); 14858 c && (b._.data[a] = c) 14859 } 14860 if (this.$) { 14861 var b = this, 14862 c, d; 14863 if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported) { 14864 if (this.$.types) 14865 for (c = 0; c < this.$.types.length; c++) a(this.$.types[c]) 14866 } else a("Text"), a("URL"); 14867 d = this._getImageFromClipboard(); 14868 if (this.$ && this.$.files || 14869 d) { 14870 this._.files = []; 14871 if (this.$.files && this.$.files.length) 14872 for (c = 0; c < this.$.files.length; c++) this._.files.push(this.$.files[c]); 14873 0 === this._.files.length && d && this._.files.push(d) 14874 } 14875 } 14876 }, 14877 getFilesCount: function() { 14878 return this._.files.length ? this._.files.length : this.$ && this.$.files && this.$.files.length ? this.$.files.length : this._getImageFromClipboard() ? 1 : 0 14879 }, 14880 getFile: function(a) { 14881 return this._.files.length ? this._.files[a] : this.$ && this.$.files && this.$.files.length ? this.$.files[a] : 0 === a ? this._getImageFromClipboard() : 14882 void 0 14883 }, 14884 isEmpty: function() { 14885 var a = {}, 14886 b; 14887 if (this.getFilesCount()) return !1; 14888 CKEDITOR.tools.array.forEach(CKEDITOR.tools.objectKeys(this._.data), function(b) { 14889 a[b] = 1 14890 }); 14891 if (this.$) 14892 if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported) { 14893 if (this.$.types) 14894 for (var c = 0; c < this.$.types.length; c++) a[this.$.types[c]] = 1 14895 } else a.Text = 1, a.URL = 1; 14896 "Text" != m && (a[m] = 0); 14897 for (b in a) 14898 if (a[b] && "" !== this.getData(b)) return !1; 14899 return !0 14900 }, 14901 _getImageFromClipboard: function() { 14902 var a; 14903 if (this.$ && this.$.items && this.$.items[0]) try { 14904 if ((a = this.$.items[0].getAsFile()) && 14905 a.type) return a 14906 } catch (b) {} 14907 }, 14908 _stripHtml: function(a) { 14909 if (a && a.length) { 14910 a = a.replace(this._.metaRegExp, ""); 14911 var b = this._.bodyRegExp.exec(a); 14912 b && b.length && (a = b[1], a = a.replace(this._.fragmentRegExp, "")) 14913 } 14914 return a 14915 } 14916 }; 14917 CKEDITOR.plugins.clipboard.fallbackDataTransfer = function(a) { 14918 this._dataTransfer = a; 14919 this._customDataFallbackType = "text/html" 14920 }; 14921 CKEDITOR.plugins.clipboard.fallbackDataTransfer._isCustomMimeTypeSupported = null; 14922 CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes = []; 14923 CKEDITOR.plugins.clipboard.fallbackDataTransfer.prototype = { 14924 isRequired: function() { 14925 var a = CKEDITOR.plugins.clipboard.fallbackDataTransfer, 14926 b = this._dataTransfer.$; 14927 if (null === a._isCustomMimeTypeSupported) 14928 if (b) { 14929 a._isCustomMimeTypeSupported = !1; 14930 if (CKEDITOR.env.edge && 17 <= CKEDITOR.env.version) return !0; 14931 try { 14932 b.setData("cke/mimetypetest", "cke test value"), a._isCustomMimeTypeSupported = "cke test value" === b.getData("cke/mimetypetest"), b.clearData("cke/mimetypetest") 14933 } catch (c) {} 14934 } else return !1; 14935 return !a._isCustomMimeTypeSupported 14936 }, 14937 getData: function(a, b) { 14938 var c = this._getData(this._customDataFallbackType, 14939 !0); 14940 if (b) return c; 14941 var c = this._extractDataComment(c), 14942 d = null, 14943 d = a === this._customDataFallbackType ? c.content : c.data && c.data[a] ? c.data[a] : this._getData(a, !0); 14944 return null !== d ? d : "" 14945 }, 14946 setData: function(a, b) { 14947 var c = a === this._customDataFallbackType; 14948 c && (b = this._applyDataComment(b, this._getFallbackTypeData())); 14949 var d = b, 14950 g = this._dataTransfer.$; 14951 try { 14952 g.setData(a, d), c && (this._dataTransfer._.nativeHtmlCache = d) 14953 } catch (h) { 14954 if (this._isUnsupportedMimeTypeError(h)) { 14955 c = CKEDITOR.plugins.clipboard.fallbackDataTransfer; - 1 === CKEDITOR.tools.indexOf(c._customTypes, 14956 a) && c._customTypes.push(a); 14957 var c = this._getFallbackTypeContent(), 14958 e = this._getFallbackTypeData(); 14959 e[a] = d; 14960 try { 14961 d = this._applyDataComment(c, e), g.setData(this._customDataFallbackType, d), this._dataTransfer._.nativeHtmlCache = d 14962 } catch (f) { 14963 d = "" 14964 } 14965 } 14966 } 14967 return d 14968 }, 14969 _getData: function(a, b) { 14970 var c = this._dataTransfer._.data; 14971 if (!b && c[a]) return c[a]; 14972 try { 14973 return this._dataTransfer.$.getData(a) 14974 } catch (d) { 14975 return null 14976 } 14977 }, 14978 _getFallbackTypeContent: function() { 14979 var a = this._dataTransfer._.data[this._customDataFallbackType]; 14980 a || (a = this._extractDataComment(this._getData(this._customDataFallbackType, 14981 !0)).content); 14982 return a 14983 }, 14984 _getFallbackTypeData: function() { 14985 var a = CKEDITOR.plugins.clipboard.fallbackDataTransfer._customTypes, 14986 b = this._extractDataComment(this._getData(this._customDataFallbackType, !0)).data || {}, 14987 c = this._dataTransfer._.data; 14988 CKEDITOR.tools.array.forEach(a, function(a) { 14989 void 0 !== c[a] ? b[a] = c[a] : void 0 !== b[a] && (b[a] = b[a]) 14990 }, this); 14991 return b 14992 }, 14993 _isUnsupportedMimeTypeError: function(a) { 14994 return a.message && -1 !== a.message.search(/element not found/gi) 14995 }, 14996 _extractDataComment: function(a) { 14997 var b = { 14998 data: null, 14999 content: a || 15000 "" 15001 }; 15002 if (a && 16 < a.length) { 15003 var c; 15004 (c = /\x3c!--cke-data:(.*?)--\x3e/g.exec(a)) && c[1] && (b.data = JSON.parse(decodeURIComponent(c[1])), b.content = a.replace(c[0], "")) 15005 } 15006 return b 15007 }, 15008 _applyDataComment: function(a, b) { 15009 var c = ""; 15010 b && CKEDITOR.tools.objectKeys(b).length && (c = "\x3c!--cke-data:" + encodeURIComponent(JSON.stringify(b)) + "--\x3e"); 15011 return c + (a && a.length ? a : "") 15012 } 15013 } 15014 })(); 15015 CKEDITOR.config.clipboard_notificationDuration = 1E4; 15016 CKEDITOR.plugins.add("panelbutton", { 15017 requires: "button", 15018 onLoad: function() { 15019 function e(c) { 15020 var a = this._; 15021 a.state != CKEDITOR.TRISTATE_DISABLED && (this.createPanel(c), a.on ? a.panel.hide() : a.panel.showBlock(this._.id, this.document.getById(this._.id), 4)) 15022 } 15023 CKEDITOR.ui.panelButton = CKEDITOR.tools.createClass({ 15024 base: CKEDITOR.ui.button, 15025 $: function(c) { 15026 var a = c.panel || {}; 15027 delete c.panel; 15028 this.base(c); 15029 this.document = a.parent && a.parent.getDocument() || CKEDITOR.document; 15030 a.block = { 15031 attributes: a.attributes 15032 }; 15033 this.hasArrow = a.toolbarRelated = !0; 15034 this.click = e; 15035 this._ = { 15036 panelDefinition: a 15037 } 15038 }, 15039 statics: { 15040 handler: { 15041 create: function(c) { 15042 return new CKEDITOR.ui.panelButton(c) 15043 } 15044 } 15045 }, 15046 proto: { 15047 createPanel: function(c) { 15048 var a = this._; 15049 if (!a.panel) { 15050 var f = this._.panelDefinition, 15051 e = this._.panelDefinition.block, 15052 g = f.parent || CKEDITOR.document.getBody(), 15053 d = this._.panel = new CKEDITOR.ui.floatPanel(c, g, f), 15054 f = d.addBlock(a.id, e), 15055 b = this; 15056 d.onShow = function() { 15057 b.className && this.element.addClass(b.className + "_panel"); 15058 b.setState(CKEDITOR.TRISTATE_ON); 15059 a.on = 1; 15060 b.editorFocus && c.focus(); 15061 if (b.onOpen) b.onOpen() 15062 }; 15063 d.onHide = function(d) { 15064 b.className && this.element.getFirst().removeClass(b.className + "_panel"); 15065 b.setState(b.modes && b.modes[c.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED); 15066 a.on = 0; 15067 if (!d && b.onClose) b.onClose() 15068 }; 15069 d.onEscape = function() { 15070 d.hide(1); 15071 b.document.getById(a.id).focus() 15072 }; 15073 if (this.onBlock) this.onBlock(d, f); 15074 f.onHide = function() { 15075 a.on = 0; 15076 b.setState(CKEDITOR.TRISTATE_OFF) 15077 } 15078 } 15079 } 15080 } 15081 }) 15082 }, 15083 beforeInit: function(e) { 15084 e.ui.addHandler(CKEDITOR.UI_PANELBUTTON, CKEDITOR.ui.panelButton.handler) 15085 } 15086 }); 15087 CKEDITOR.UI_PANELBUTTON = "panelbutton"; 15088 (function() { 15089 CKEDITOR.plugins.add("panel", { 15090 beforeInit: function(a) { 15091 a.ui.addHandler(CKEDITOR.UI_PANEL, CKEDITOR.ui.panel.handler) 15092 } 15093 }); 15094 CKEDITOR.UI_PANEL = "panel"; 15095 CKEDITOR.ui.panel = function(a, b) { 15096 b && CKEDITOR.tools.extend(this, b); 15097 CKEDITOR.tools.extend(this, { 15098 className: "", 15099 css: [] 15100 }); 15101 this.id = CKEDITOR.tools.getNextId(); 15102 this.document = a; 15103 this.isFramed = this.forceIFrame || this.css.length; 15104 this._ = { 15105 blocks: {} 15106 } 15107 }; 15108 CKEDITOR.ui.panel.handler = { 15109 create: function(a) { 15110 return new CKEDITOR.ui.panel(a) 15111 } 15112 }; 15113 var g = CKEDITOR.addTemplate("panel", 15114 '\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'), 15115 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'), 15116 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'); 15117 CKEDITOR.ui.panel.prototype = { 15118 render: function(a, b) { 15119 this.getHolderElement = function() { 15120 var a = this._.holder; 15121 if (!a) { 15122 if (this.isFramed) { 15123 var a = this.document.getById(this.id + "_frame"), 15124 b = a.getParent(), 15125 a = a.getFrameDocument(); 15126 CKEDITOR.env.iOS && b.setStyles({ 15127 overflow: "scroll", 15128 "-webkit-overflow-scrolling": "touch" 15129 }); 15130 b = CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function() { 15131 this.isLoaded = !0; 15132 if (this.onLoad) this.onLoad() 15133 }, this)); 15134 a.write(k.output(CKEDITOR.tools.extend({ 15135 css: CKEDITOR.tools.buildStyleHtml(this.css), 15136 onload: "window.parent.CKEDITOR.tools.callFunction(" + 15137 b + ");" 15138 }, e))); 15139 a.getWindow().$.CKEDITOR = CKEDITOR; 15140 a.on("keydown", function(a) { 15141 var b = a.data.getKeystroke(), 15142 c = this.document.getById(this.id).getAttribute("dir"); 15143 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() 15144 }, this); 15145 a = a.getBody(); 15146 a.unselectable(); 15147 CKEDITOR.env.air && CKEDITOR.tools.callFunction(b) 15148 } else a = this.document.getById(this.id); 15149 this._.holder = a 15150 } 15151 return a 15152 }; 15153 var e = { 15154 editorId: a.id, 15155 id: this.id, 15156 langCode: a.langCode, 15157 dir: a.lang.dir, 15158 cls: this.className, 15159 frame: "", 15160 env: CKEDITOR.env.cssClass, 15161 "z-index": a.config.baseFloatZIndex + 1 15162 }; 15163 if (this.isFramed) { 15164 var d = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie ? "javascript:void(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "}())" : ""; 15165 e.frame = h.output({ 15166 id: this.id + "_frame", 15167 src: d 15168 }) 15169 } 15170 d = g.output(e); 15171 b && b.push(d); 15172 return d 15173 }, 15174 addBlock: function(a, b) { 15175 b = this._.blocks[a] = b instanceof CKEDITOR.ui.panel.block ? b : new CKEDITOR.ui.panel.block(this.getHolderElement(), 15176 b); 15177 this._.currentBlock || this.showBlock(a); 15178 return b 15179 }, 15180 getBlock: function(a) { 15181 return this._.blocks[a] 15182 }, 15183 showBlock: function(a) { 15184 a = this._.blocks[a]; 15185 var b = this._.currentBlock, 15186 e = !this.forceIFrame || CKEDITOR.env.ie ? this._.holder : this.document.getById(this.id + "_frame"); 15187 b && b.hide(); 15188 this._.currentBlock = a; 15189 CKEDITOR.fire("ariaWidget", e); 15190 a._.focusIndex = -1; 15191 this._.onKeyDown = a.onKeyDown && CKEDITOR.tools.bind(a.onKeyDown, a); 15192 a.show(); 15193 return a 15194 }, 15195 destroy: function() { 15196 this.element && this.element.remove() 15197 } 15198 }; 15199 CKEDITOR.ui.panel.block = 15200 CKEDITOR.tools.createClass({ 15201 $: function(a, b) { 15202 this.element = a.append(a.getDocument().createElement("div", { 15203 attributes: { 15204 tabindex: -1, 15205 "class": "cke_panel_block" 15206 }, 15207 styles: { 15208 display: "none" 15209 } 15210 })); 15211 b && CKEDITOR.tools.extend(this, b); 15212 this.element.setAttributes({ 15213 role: this.attributes.role || "presentation", 15214 "aria-label": this.attributes["aria-label"], 15215 title: this.attributes.title || this.attributes["aria-label"] 15216 }); 15217 this.keys = {}; 15218 this._.focusIndex = -1; 15219 this.element.disableContextMenu() 15220 }, 15221 _: { 15222 markItem: function(a) { 15223 -1 != a && (a = this.element.getElementsByTag("a").getItem(this._.focusIndex = 15224 a), CKEDITOR.env.webkit && a.getDocument().getWindow().focus(), a.focus(), this.onMark && this.onMark(a)) 15225 }, 15226 markFirstDisplayed: function(a) { 15227 for (var b = function(a) { 15228 return a.type == CKEDITOR.NODE_ELEMENT && "none" == a.getStyle("display") 15229 }, e = this._.getItems(), d, c, f = e.count() - 1; 0 <= f; f--) 15230 if (d = e.getItem(f), d.getAscendant(b) || (c = d, this._.focusIndex = f), "true" == d.getAttribute("aria-selected")) { 15231 c = d; 15232 this._.focusIndex = f; 15233 break 15234 } c && (a && a(), CKEDITOR.env.webkit && c.getDocument().getWindow().focus(), c.focus(), this.onMark && this.onMark(c)) 15235 }, 15236 getItems: function() { 15237 return this.element.getElementsByTag("a") 15238 } 15239 }, 15240 proto: { 15241 show: function() { 15242 this.element.setStyle("display", "") 15243 }, 15244 hide: function() { 15245 this.onHide && !0 === this.onHide.call(this) || this.element.setStyle("display", "none") 15246 }, 15247 onKeyDown: function(a, b) { 15248 var e = this.keys[a]; 15249 switch (e) { 15250 case "next": 15251 for (var d = this._.focusIndex, e = this.element.getElementsByTag("a"), c; c = e.getItem(++d);) 15252 if (c.getAttribute("_cke_focus") && c.$.offsetWidth) { 15253 this._.focusIndex = d; 15254 c.focus(); 15255 break 15256 } return c || b ? !1 : (this._.focusIndex = -1, this.onKeyDown(a, 15257 1)); 15258 case "prev": 15259 d = this._.focusIndex; 15260 for (e = this.element.getElementsByTag("a"); 0 < d && (c = e.getItem(--d));) { 15261 if (c.getAttribute("_cke_focus") && c.$.offsetWidth) { 15262 this._.focusIndex = d; 15263 c.focus(); 15264 break 15265 } 15266 c = null 15267 } 15268 return c || b ? !1 : (this._.focusIndex = e.count(), this.onKeyDown(a, 1)); 15269 case "click": 15270 case "mouseup": 15271 return d = this._.focusIndex, (c = 0 <= d && this.element.getElementsByTag("a").getItem(d)) && (c.$[e] ? c.$[e]() : c.$["on" + e]()), !1 15272 } 15273 return !0 15274 } 15275 } 15276 }) 15277 })(); 15278 CKEDITOR.plugins.add("floatpanel", { 15279 requires: "panel" 15280 }); 15281 (function() { 15282 function v(a, b, c, m, h) { 15283 h = CKEDITOR.tools.genKey(b.getUniqueId(), c.getUniqueId(), a.lang.dir, a.uiColor || "", m.css || "", h || ""); 15284 var g = f[h]; 15285 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({ 15286 display: "none", 15287 position: "absolute" 15288 })); 15289 return g 15290 } 15291 var f = {}; 15292 CKEDITOR.ui.floatPanel = CKEDITOR.tools.createClass({ 15293 $: function(a, b, c, m) { 15294 function h() { 15295 e.hide() 15296 } 15297 c.forceIFrame = 1; 15298 c.toolbarRelated && a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE && 15299 (b = CKEDITOR.document.getById("cke_" + a.name)); 15300 var g = b.getDocument(); 15301 m = v(a, g, b, c, m || 0); 15302 var n = m.element, 15303 k = n.getFirst(), 15304 e = this; 15305 n.disableContextMenu(); 15306 this.element = n; 15307 this._ = { 15308 editor: a, 15309 panel: m, 15310 parentElement: b, 15311 definition: c, 15312 document: g, 15313 iframe: k, 15314 children: [], 15315 dir: a.lang.dir, 15316 showBlockParams: null 15317 }; 15318 a.on("mode", h); 15319 a.on("resize", h); 15320 g.getWindow().on("resize", function() { 15321 this.reposition() 15322 }, this) 15323 }, 15324 proto: { 15325 addBlock: function(a, b) { 15326 return this._.panel.addBlock(a, b) 15327 }, 15328 addListBlock: function(a, b) { 15329 return this._.panel.addListBlock(a, 15330 b) 15331 }, 15332 getBlock: function(a) { 15333 return this._.panel.getBlock(a) 15334 }, 15335 showBlock: function(a, b, c, m, h, g) { 15336 var n = this._.panel, 15337 k = n.showBlock(a); 15338 this._.showBlockParams = [].slice.call(arguments); 15339 this.allowBlur(!1); 15340 var e = this._.editor.editable(); 15341 this._.returnFocus = e.hasFocus ? e : new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement); 15342 this._.hideTimeout = 0; 15343 var l = this.element, 15344 e = this._.iframe, 15345 e = CKEDITOR.env.ie && !CKEDITOR.env.edge ? e : new CKEDITOR.dom.window(e.$.contentWindow), 15346 f = l.getDocument(), 15347 r = this._.parentElement.getPositionedAncestor(), 15348 t = b.getDocumentPosition(f), 15349 f = r ? r.getDocumentPosition(f) : { 15350 x: 0, 15351 y: 0 15352 }, 15353 q = "rtl" == this._.dir, 15354 d = t.x + (m || 0) - f.x, 15355 p = t.y + (h || 0) - f.y; 15356 !q || 1 != c && 4 != c ? q || 2 != c && 3 != c || (d += b.$.offsetWidth - 1) : d += b.$.offsetWidth; 15357 if (3 == c || 4 == c) p += b.$.offsetHeight - 1; 15358 this._.panel._.offsetParentId = b.getId(); 15359 l.setStyles({ 15360 top: p + "px", 15361 left: 0, 15362 display: "" 15363 }); 15364 l.setOpacity(0); 15365 l.getFirst().removeStyle("width"); 15366 this._.editor.focusManager.add(e); 15367 this._.blurSet || (CKEDITOR.event.useCapture = !0, e.on("blur", function(a) { 15368 function u() { 15369 delete this._.returnFocus; 15370 this.hide() 15371 } 15372 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)) 15373 }, this), e.on("focus", function() { 15374 this._.focused = !0; 15375 this.hideChild(); 15376 this.allowBlur(!0) 15377 }, this), CKEDITOR.env.iOS && (e.on("touchstart", function() { 15378 clearTimeout(this._.hideTimeout) 15379 }, this), e.on("touchend", function() { 15380 this._.hideTimeout = 0; 15381 this.focus() 15382 }, this)), CKEDITOR.event.useCapture = !1, 15383 this._.blurSet = 1); 15384 n.onEscape = CKEDITOR.tools.bind(function(a) { 15385 if (this.onEscape && !1 === this.onEscape(a)) return !1 15386 }, this); 15387 CKEDITOR.tools.setTimeout(function() { 15388 var a = CKEDITOR.tools.bind(function() { 15389 var a = l; 15390 a.removeStyle("width"); 15391 if (k.autoSize) { 15392 var b = k.element.getDocument(), 15393 b = (CKEDITOR.env.webkit || CKEDITOR.env.edge ? k.element : b.getBody()).$.scrollWidth; 15394 CKEDITOR.env.ie && CKEDITOR.env.quirks && 0 < b && (b += (a.$.offsetWidth || 0) - (a.$.clientWidth || 0) + 3); 15395 a.setStyle("width", b + 10 + "px"); 15396 b = k.element.$.scrollHeight; 15397 CKEDITOR.env.ie && 15398 CKEDITOR.env.quirks && 0 < b && (b += (a.$.offsetHeight || 0) - (a.$.clientHeight || 0) + 3); 15399 a.setStyle("height", b + "px"); 15400 n._.currentBlock.element.setStyle("display", "none").removeStyle("display") 15401 } else a.removeStyle("height"); 15402 q && (d -= l.$.offsetWidth); 15403 l.setStyle("left", d + "px"); 15404 var b = n.element.getWindow(), 15405 a = l.$.getBoundingClientRect(), 15406 b = b.getViewPaneSize(), 15407 c = a.width || a.right - a.left, 15408 e = a.height || a.bottom - a.top, 15409 m = q ? a.right : b.width - a.left, 15410 h = q ? b.width - a.right : a.left; 15411 q ? m < c && (d = h > c ? d + c : b.width > c ? d - a.left : d - a.right + b.width) : 15412 m < c && (d = h > c ? d - c : b.width > c ? d - a.right + b.width : d - a.left); 15413 c = a.top; 15414 b.height - a.top < e && (p = c > e ? p - e : b.height > e ? p - a.bottom + b.height : p - a.top); 15415 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))); 15416 var a = l.getFirst(), 15417 f; 15418 (f = a.getCustomData("activePanel")) && f.onHide && f.onHide.call(this, 1); 15419 a.setCustomData("activePanel", 15420 this); 15421 l.setStyles({ 15422 top: p + "px", 15423 left: d + "px" 15424 }); 15425 l.setOpacity(1); 15426 g && g() 15427 }, this); 15428 n.isLoaded ? a() : n.onLoad = a; 15429 CKEDITOR.tools.setTimeout(function() { 15430 var a = CKEDITOR.env.webkit && CKEDITOR.document.getWindow().getScrollPosition().y; 15431 this.focus(); 15432 k.element.focus(); 15433 CKEDITOR.env.webkit && (CKEDITOR.document.getBody().$.scrollTop = a); 15434 this.allowBlur(!0); 15435 CKEDITOR.env.ie ? CKEDITOR.tools.setTimeout(function() { 15436 k.markFirstDisplayed ? k.markFirstDisplayed() : k._.markFirstDisplayed() 15437 }, 0) : k.markFirstDisplayed ? k.markFirstDisplayed() : 15438 k._.markFirstDisplayed(); 15439 this._.editor.fire("panelShow", this) 15440 }, 0, this) 15441 }, CKEDITOR.env.air ? 200 : 0, this); 15442 this.visible = 1; 15443 this.onShow && this.onShow.call(this) 15444 }, 15445 reposition: function() { 15446 var a = this._.showBlockParams; 15447 this.visible && this._.showBlockParams && (this.hide(), this.showBlock.apply(this, a)) 15448 }, 15449 focus: function() { 15450 if (CKEDITOR.env.webkit) { 15451 var a = CKEDITOR.document.getActive(); 15452 a && !a.equals(this._.iframe) && a.$.blur() 15453 }(this._.lastFocused || this._.iframe.getFrameDocument().getWindow()).focus() 15454 }, 15455 blur: function() { 15456 var a = 15457 this._.iframe.getFrameDocument().getActive(); 15458 a && a.is("a") && (this._.lastFocused = a) 15459 }, 15460 hide: function(a) { 15461 if (this.visible && (!this.onHide || !0 !== this.onHide.call(this))) { 15462 this.hideChild(); 15463 CKEDITOR.env.gecko && this._.iframe.getFrameDocument().$.activeElement.blur(); 15464 this.element.setStyle("display", "none"); 15465 this.visible = 0; 15466 this.element.getFirst().removeCustomData("activePanel"); 15467 if (a = a && this._.returnFocus) CKEDITOR.env.webkit && a.type && a.getWindow().$.focus(), a.focus(); 15468 delete this._.lastFocused; 15469 this._.showBlockParams = 15470 null; 15471 this._.editor.fire("panelHide", this) 15472 } 15473 }, 15474 allowBlur: function(a) { 15475 var b = this._.panel; 15476 void 0 !== a && (b.allowBlur = a); 15477 return b.allowBlur 15478 }, 15479 showAsChild: function(a, b, c, f, h, g) { 15480 if (this._.activeChild != a || a._.panel._.offsetParentId != c.getId()) this.hideChild(), a.onHide = CKEDITOR.tools.bind(function() { 15481 CKEDITOR.tools.setTimeout(function() { 15482 this._.focused || this.hide() 15483 }, 0, this) 15484 }, this), this._.activeChild = a, this._.focused = !1, a.showBlock(b, c, f, h, g), this.blur(), (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) && setTimeout(function() { 15485 a.element.getChild(0).$.style.cssText += 15486 "" 15487 }, 100) 15488 }, 15489 hideChild: function(a) { 15490 var b = this._.activeChild; 15491 b && (delete b.onHide, delete this._.activeChild, b.hide(), a && this.focus()) 15492 } 15493 } 15494 }); 15495 CKEDITOR.on("instanceDestroyed", function() { 15496 var a = CKEDITOR.tools.isEmpty(CKEDITOR.instances), 15497 b; 15498 for (b in f) { 15499 var c = f[b]; 15500 a ? c.destroy() : c.element.hide() 15501 } 15502 a && (f = {}) 15503 }) 15504 })(); 15505 CKEDITOR.plugins.add("colorbutton", { 15506 requires: "panelbutton,floatpanel", 15507 init: function(e) { 15508 function t(a, d, g, r, k) { 15509 var p = new CKEDITOR.style(l["colorButton_" + d + "Style"]), 15510 m = CKEDITOR.tools.getNextId() + "_colorBox", 15511 q; 15512 k = k || {}; 15513 e.ui.add(a, CKEDITOR.UI_PANELBUTTON, { 15514 label: g, 15515 title: g, 15516 modes: { 15517 wysiwyg: 1 15518 }, 15519 editorFocus: 0, 15520 toolbar: "colors," + r, 15521 allowedContent: p, 15522 requiredContent: p, 15523 contentTransformations: k.contentTransformations, 15524 panel: { 15525 css: CKEDITOR.skin.getPath("editor"), 15526 attributes: { 15527 role: "listbox", 15528 "aria-label": h.panelTitle 15529 } 15530 }, 15531 onBlock: function(a, 15532 b) { 15533 q = b; 15534 b.autoSize = !0; 15535 b.element.addClass("cke_colorblock"); 15536 b.element.setHtml(y(a, d, m)); 15537 b.element.getDocument().getBody().setStyle("overflow", "hidden"); 15538 CKEDITOR.ui.fire("ready", this); 15539 var c = b.keys, 15540 f = "rtl" == e.lang.dir; 15541 c[f ? 37 : 39] = "next"; 15542 c[40] = "next"; 15543 c[9] = "next"; 15544 c[f ? 39 : 37] = "prev"; 15545 c[38] = "prev"; 15546 c[CKEDITOR.SHIFT + 9] = "prev"; 15547 c[32] = "click" 15548 }, 15549 refresh: function() { 15550 e.activeFilter.check(p) || this.setState(CKEDITOR.TRISTATE_DISABLED) 15551 }, 15552 onOpen: function() { 15553 var a = e.getSelection(), 15554 b = a && a.getStartElement(), 15555 c = e.elementPath(b); 15556 if (c) { 15557 b = c.block || c.blockLimit || e.document.getBody(); 15558 do c = b && b.getComputedStyle("back" == d ? "background-color" : "color") || "transparent"; while ("back" == d && "transparent" == c && b && (b = b.getParent())); 15559 c && "transparent" != c || (c = "#ffffff"); 15560 !1 !== l.colorButton_enableAutomatic && this._.panel._.iframe.getFrameDocument().getById(m).setStyle("background-color", c); 15561 if (b = a && a.getRanges()[0]) { 15562 for (var a = new CKEDITOR.dom.walker(b), f = b.collapsed ? b.startContainer : a.next(), b = ""; f;) { 15563 f.type !== CKEDITOR.NODE_ELEMENT && (f = f.getParent()); 15564 f = u(f.getComputedStyle("back" == d ? "background-color" : "color")); 15565 b = b || f; 15566 if (b !== f) { 15567 b = ""; 15568 break 15569 } 15570 f = a.next() 15571 } 15572 a = b; 15573 b = q._.getItems(); 15574 for (f = 0; f < b.count(); f++) { 15575 var g = b.getItem(f); 15576 g.removeAttribute("aria-selected"); 15577 a && a == u(g.getAttribute("data-value")) && g.setAttribute("aria-selected", !0) 15578 } 15579 } 15580 return c 15581 } 15582 } 15583 }) 15584 } 15585 15586 function y(a, d, g) { 15587 a = []; 15588 var r = l.colorButton_colors.split(","), 15589 k = l.colorButton_colorsPerRow || 6, 15590 p = e.plugins.colordialog && !1 !== l.colorButton_enableMore, 15591 m = r.length + (p ? 2 : 1), 15592 q = CKEDITOR.tools.addFunction(function(a, b) { 15593 function c(a) { 15594 var d = 15595 l["colorButton_" + b + "Style"]; 15596 e.removeStyle(new CKEDITOR.style(d, { 15597 color: "inherit" 15598 })); 15599 d.childRule = "back" == b ? function(a) { 15600 return v(a) 15601 } : function(a) { 15602 return !(a.is("a") || a.getElementsByTag("a").count()) || v(a) 15603 }; 15604 e.focus(); 15605 a && e.applyStyle(new CKEDITOR.style(d, { 15606 color: a 15607 })); 15608 e.fire("saveSnapshot") 15609 } 15610 e.focus(); 15611 e.fire("saveSnapshot"); 15612 if ("?" == a) e.getColorFromDialog(function(a) { 15613 if (a) return c(a) 15614 }); 15615 else return c(a) 15616 }); 15617 !1 !== l.colorButton_enableAutomatic && a.push('\x3ca class\x3d"cke_colorauto" _cke_focus\x3d1 hidefocus\x3dtrue title\x3d"', 15618 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"); 15619 a.push('\x3ctable role\x3d"presentation" cellspacing\x3d0 cellpadding\x3d0 width\x3d"100%"\x3e'); 15620 for (g = 0; g < r.length; g++) { 15621 0 === g % k && a.push("\x3c/tr\x3e\x3ctr\x3e"); 15622 var n = r[g].split("/"), 15623 b = n[0], 15624 c = n[1] || b; 15625 n[1] ? n = b : (b = "#" + b.replace(/^(.)(.)(.)$/, "$1$1$2$2$3$3"), n = e.lang.colorbutton.colors[c] || c); 15626 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:#', 15627 c, '"\x3e\x3c/span\x3e\x3c/a\x3e\x3c/td\x3e') 15628 } 15629 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"); 15630 a.push("\x3c/tr\x3e\x3c/table\x3e"); 15631 return a.join("") 15632 } 15633 15634 function v(a) { 15635 return "false" == 15636 a.getAttribute("contentEditable") || a.getAttribute("data-nostyle") 15637 } 15638 15639 function u(a) { 15640 return CKEDITOR.tools.normalizeHex("#" + CKEDITOR.tools.convertRgbToHex(a || "")).replace(/#/g, "") 15641 } 15642 var l = e.config, 15643 h = e.lang.colorbutton; 15644 if (!CKEDITOR.env.hc) { 15645 t("TextColor", "fore", h.textColorTitle, 10, { 15646 contentTransformations: [ 15647 [{ 15648 element: "font", 15649 check: "span{color}", 15650 left: function(a) { 15651 return !!a.attributes.color 15652 }, 15653 right: function(a) { 15654 a.name = "span"; 15655 a.attributes.color && (a.styles.color = a.attributes.color); 15656 delete a.attributes.color 15657 } 15658 }] 15659 ] 15660 }); 15661 var w = {}, 15662 x = e.config.colorButton_normalizeBackground; 15663 if (void 0 === x || x) w.contentTransformations = [ 15664 [{ 15665 element: "span", 15666 left: function(a) { 15667 var d = CKEDITOR.tools; 15668 if ("span" != a.name || !a.styles || !a.styles.background) return !1; 15669 a = d.style.parse.background(a.styles.background); 15670 return a.color && 1 === d.objectKeys(a).length 15671 }, 15672 right: function(a) { 15673 var d = (new CKEDITOR.style(e.config.colorButton_backStyle, { 15674 color: a.styles.background 15675 })).getDefinition(); 15676 a.name = d.element; 15677 a.styles = d.styles; 15678 a.attributes = d.attributes || {}; 15679 return a 15680 } 15681 }] 15682 ]; 15683 t("BGColor", 15684 "back", h.bgColorTitle, 20, w) 15685 } 15686 } 15687 }); 15688 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"; 15689 CKEDITOR.config.colorButton_foreStyle = { 15690 element: "span", 15691 styles: { 15692 color: "#(color)" 15693 }, 15694 overrides: [{ 15695 element: "font", 15696 attributes: { 15697 color: null 15698 } 15699 }] 15700 }; 15701 CKEDITOR.config.colorButton_backStyle = { 15702 element: "span", 15703 styles: { 15704 "background-color": "#(color)" 15705 } 15706 }; 15707 CKEDITOR.plugins.colordialog = { 15708 requires: "dialog", 15709 init: function(b) { 15710 var d = new CKEDITOR.dialogCommand("colordialog"); 15711 d.editorFocus = !1; 15712 b.addCommand("colordialog", d); 15713 CKEDITOR.dialog.add("colordialog", this.path + "dialogs/colordialog.js"); 15714 b.getColorFromDialog = function(d, g) { 15715 var c, f, e; 15716 c = function(a) { 15717 f(this); 15718 a = "ok" == a.name ? this.getValueOf("picker", "selectedColor") : null; 15719 /^[0-9a-f]{3}([0-9a-f]{3})?$/i.test(a) && (a = "#" + a); 15720 d.call(g, a) 15721 }; 15722 f = function(a) { 15723 a.removeListener("ok", c); 15724 a.removeListener("cancel", c) 15725 }; 15726 e = function(a) { 15727 a.on("ok", 15728 c); 15729 a.on("cancel", c) 15730 }; 15731 b.execCommand("colordialog"); 15732 if (b._.storedDialogs && b._.storedDialogs.colordialog) e(b._.storedDialogs.colordialog); 15733 else CKEDITOR.on("dialogDefinition", function(a) { 15734 if ("colordialog" == a.data.name) { 15735 var b = a.data.definition; 15736 a.removeListener(); 15737 b.onLoad = CKEDITOR.tools.override(b.onLoad, function(a) { 15738 return function() { 15739 e(this); 15740 b.onLoad = a; 15741 "function" == typeof a && a.call(this) 15742 } 15743 }) 15744 } 15745 }) 15746 } 15747 } 15748 }; 15749 CKEDITOR.plugins.add("colordialog", CKEDITOR.plugins.colordialog); 15750 (function() { 15751 CKEDITOR.plugins.add("templates", { 15752 requires: "dialog", 15753 init: function(a) { 15754 CKEDITOR.dialog.add("templates", CKEDITOR.getUrl(this.path + "dialogs/templates.js")); 15755 a.addCommand("templates", new CKEDITOR.dialogCommand("templates")); 15756 a.ui.addButton && a.ui.addButton("Templates", { 15757 label: a.lang.templates.button, 15758 command: "templates", 15759 toolbar: "doctools,10" 15760 }) 15761 } 15762 }); 15763 var c = {}, 15764 f = {}; 15765 CKEDITOR.addTemplates = function(a, d) { 15766 c[a] = d 15767 }; 15768 CKEDITOR.getTemplates = function(a) { 15769 return c[a] 15770 }; 15771 CKEDITOR.loadTemplates = function(a, d) { 15772 for (var e = [], b = 0, c = a.length; b < c; b++) f[a[b]] || (e.push(a[b]), f[a[b]] = 1); 15773 e.length ? CKEDITOR.scriptLoader.load(e, d) : setTimeout(d, 0) 15774 } 15775 })(); 15776 CKEDITOR.config.templates_files = [CKEDITOR.getUrl("plugins/templates/templates/default.js")]; 15777 CKEDITOR.config.templates_replaceContent = !0; 15778 CKEDITOR.plugins.add("menu", { 15779 requires: "floatpanel", 15780 beforeInit: function(l) { 15781 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; 15782 l.addMenuGroup = function(a, b) { 15783 r[a] = b || 100 15784 }; 15785 l.addMenuItem = function(a, b) { 15786 r[b.group] && (t[a] = new CKEDITOR.menuItem(this, a, b)) 15787 }; 15788 l.addMenuItems = function(a) { 15789 for (var b in a) this.addMenuItem(b, a[b]) 15790 }; 15791 l.getMenuItem = function(a) { 15792 return t[a] 15793 }; 15794 l.removeMenuItem = function(a) { 15795 delete t[a] 15796 } 15797 } 15798 }); 15799 (function() { 15800 function l(a) { 15801 a.sort(function(a, d) { 15802 return a.group < d.group ? -1 : a.group > d.group ? 1 : a.order < d.order ? -1 : a.order > d.order ? 1 : 0 15803 }) 15804 } 15805 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"'; 15806 CKEDITOR.env.gecko && CKEDITOR.env.mac && (h += ' onkeypress\x3d"return false;"'); 15807 CKEDITOR.env.gecko && (h += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;" ondragstart\x3d"return false;"'); 15808 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'), 15809 r = CKEDITOR.addTemplate("menuItem", 15810 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'), 15811 t = CKEDITOR.addTemplate("menuArrow", '\x3cspan class\x3d"cke_menuarrow"\x3e\x3cspan\x3e{label}\x3c/span\x3e\x3c/span\x3e'), 15812 n = CKEDITOR.addTemplate("menuShortcut", '\x3cspan class\x3d"cke_menubutton_label cke_menubutton_shortcut"\x3e{shortcut}\x3c/span\x3e'); 15813 CKEDITOR.menu = CKEDITOR.tools.createClass({ 15814 $: function(a, b) { 15815 b = this._.definition = b || {}; 15816 this.id = CKEDITOR.tools.getNextId(); 15817 this.editor = a; 15818 this.items = []; 15819 this._.listeners = []; 15820 this._.level = b.level || 1; 15821 var d = CKEDITOR.tools.extend({}, b.panel, { 15822 css: [CKEDITOR.skin.getPath("editor")], 15823 level: this._.level - 1, 15824 block: {} 15825 }), 15826 m = d.block.attributes = d.attributes || {}; 15827 !m.role && (m.role = "menu"); 15828 this._.panelDefinition = 15829 d 15830 }, 15831 _: { 15832 onShow: function() { 15833 var a = this.editor.getSelection(), 15834 b = a && a.getStartElement(), 15835 d = this.editor.elementPath(), 15836 m = this._.listeners; 15837 this.removeAll(); 15838 for (var g = 0; g < m.length; g++) { 15839 var k = m[g](b, a, d); 15840 if (k) 15841 for (var e in k) { 15842 var f = this.editor.getMenuItem(e); 15843 !f || f.command && !this.editor.getCommand(f.command).state || (f.state = k[e], this.add(f)) 15844 } 15845 } 15846 }, 15847 onClick: function(a) { 15848 this.hide(); 15849 if (a.onClick) a.onClick(); 15850 else a.command && this.editor.execCommand(a.command) 15851 }, 15852 onEscape: function(a) { 15853 var b = this.parent; 15854 b ? b._.panel.hideChild(1) : 15855 27 == a && this.hide(1); 15856 return !1 15857 }, 15858 onHide: function() { 15859 this.onHide && this.onHide() 15860 }, 15861 showSubMenu: function(a) { 15862 var b = this._.subMenu, 15863 d = this.items[a]; 15864 if (d = d.getItems && d.getItems()) { 15865 b ? b.removeAll() : (b = this._.subMenu = new CKEDITOR.menu(this.editor, CKEDITOR.tools.extend({}, this._.definition, { 15866 level: this._.level + 1 15867 }, !0)), b.parent = this, b._.onClick = CKEDITOR.tools.bind(this._.onClick, this)); 15868 for (var m in d) { 15869 var g = this.editor.getMenuItem(m); 15870 g && (g.state = d[m], b.add(g)) 15871 } 15872 var k = this._.panel.getBlock(this.id).element.getDocument().getById(this.id + 15873 String(a)); 15874 setTimeout(function() { 15875 b.show(k, 2) 15876 }, 0) 15877 } else this._.panel.hideChild(1) 15878 } 15879 }, 15880 proto: { 15881 add: function(a) { 15882 a.order || (a.order = this.items.length); 15883 this.items.push(a) 15884 }, 15885 removeAll: function() { 15886 this.items = [] 15887 }, 15888 show: function(a, b, d, m) { 15889 if (!this.parent && (this._.onShow(), !this.items.length)) return; 15890 b = b || ("rtl" == this.editor.lang.dir ? 2 : 1); 15891 var g = this.items, 15892 k = this.editor, 15893 e = this._.panel, 15894 f = this._.element; 15895 if (!e) { 15896 e = this._.panel = new CKEDITOR.ui.floatPanel(this.editor, CKEDITOR.document.getBody(), this._.panelDefinition, this._.level); 15897 e.onEscape = CKEDITOR.tools.bind(function(a) { 15898 if (!1 === this._.onEscape(a)) return !1 15899 }, this); 15900 e.onShow = function() { 15901 e._.panel.getHolderElement().getParent().addClass("cke").addClass("cke_reset_all") 15902 }; 15903 e.onHide = CKEDITOR.tools.bind(function() { 15904 this._.onHide && this._.onHide() 15905 }, this); 15906 f = e.addBlock(this.id, this._.panelDefinition.block); 15907 f.autoSize = !0; 15908 var c = f.keys; 15909 c[40] = "next"; 15910 c[9] = "next"; 15911 c[38] = "prev"; 15912 c[CKEDITOR.SHIFT + 9] = "prev"; 15913 c["rtl" == k.lang.dir ? 37 : 39] = CKEDITOR.env.ie ? "mouseup" : "click"; 15914 c[32] = CKEDITOR.env.ie ? "mouseup" : 15915 "click"; 15916 CKEDITOR.env.ie && (c[13] = "mouseup"); 15917 f = this._.element = f.element; 15918 c = f.getDocument(); 15919 c.getBody().setStyle("overflow", "hidden"); 15920 c.getElementsByTag("html").getItem(0).setStyle("overflow", "hidden"); 15921 this._.itemOverFn = CKEDITOR.tools.addFunction(function(a) { 15922 clearTimeout(this._.showSubTimeout); 15923 this._.showSubTimeout = CKEDITOR.tools.setTimeout(this._.showSubMenu, k.config.menu_subMenuDelay || 400, this, [a]) 15924 }, this); 15925 this._.itemOutFn = CKEDITOR.tools.addFunction(function() { 15926 clearTimeout(this._.showSubTimeout) 15927 }, this); 15928 this._.itemClickFn = CKEDITOR.tools.addFunction(function(a) { 15929 var b = this.items[a]; 15930 if (b.state == CKEDITOR.TRISTATE_DISABLED) this.hide(1); 15931 else if (b.getItems) this._.showSubMenu(a); 15932 else this._.onClick(b) 15933 }, this) 15934 } 15935 l(g); 15936 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++) { 15937 var p = g[q]; 15938 n != p.group && (c.push('\x3cdiv class\x3d"cke_menuseparator" role\x3d"separator"\x3e\x3c/div\x3e'), 15939 n = p.group); 15940 p.render(this, q, c) 15941 } 15942 c.push("\x3c/div\x3e"); 15943 f.setHtml(c.join("")); 15944 CKEDITOR.ui.fire("ready", this); 15945 this.parent ? this.parent._.panel.showAsChild(e, this.id, a, b, d, m) : e.showBlock(this.id, a, b, d, m); 15946 k.fire("menuShow", [e]) 15947 }, 15948 addListener: function(a) { 15949 this._.listeners.push(a) 15950 }, 15951 hide: function(a) { 15952 this._.onHide && this._.onHide(); 15953 this._.panel && this._.panel.hide(a) 15954 }, 15955 findItemByCommandName: function(a) { 15956 var b = CKEDITOR.tools.array.filter(this.items, function(b) { 15957 return a === b.command 15958 }); 15959 return b.length ? (b = b[0], { 15960 item: b, 15961 element: this._.element.findOne("." + b.className) 15962 }) : null 15963 } 15964 } 15965 }); 15966 CKEDITOR.menuItem = CKEDITOR.tools.createClass({ 15967 $: function(a, b, d) { 15968 CKEDITOR.tools.extend(this, d, { 15969 order: 0, 15970 className: "cke_menubutton__" + b 15971 }); 15972 this.group = a._.menuGroups[this.group]; 15973 this.editor = a; 15974 this.name = b 15975 }, 15976 proto: { 15977 render: function(a, b, d) { 15978 var h = a.id + String(b), 15979 g = "undefined" == typeof this.state ? CKEDITOR.TRISTATE_OFF : this.state, 15980 k = "", 15981 e = this.editor, 15982 f, c, l = g == CKEDITOR.TRISTATE_ON ? "on" : g == CKEDITOR.TRISTATE_DISABLED ? "disabled" : "off"; 15983 this.role in { 15984 menuitemcheckbox: 1, 15985 menuitemradio: 1 15986 } && (k = ' aria-checked\x3d"' + (g == CKEDITOR.TRISTATE_ON ? "true" : "false") + '"'); 15987 var u = this.getItems, 15988 q = "\x26#" + ("rtl" == this.editor.lang.dir ? "9668" : "9658") + ";", 15989 p = this.name; 15990 this.icon && !/\./.test(this.icon) && (p = this.icon); 15991 this.command && (f = e.getCommand(this.command), (f = e.getCommandKeystroke(f)) && (c = CKEDITOR.tools.keystrokeToString(e.lang.common.keyboard, f))); 15992 a = { 15993 id: h, 15994 name: this.name, 15995 iconName: p, 15996 label: this.label, 15997 cls: this.className || "", 15998 state: l, 15999 hasPopup: u ? "true" : "false", 16000 disabled: g == CKEDITOR.TRISTATE_DISABLED, 16001 title: this.label + (c ? " (" + c.display + ")" : ""), 16002 ariaShortcut: c ? e.lang.common.keyboardShortcut + " " + c.aria : "", 16003 href: "javascript:void('" + (this.label || "").replace("'") + "')", 16004 hoverFn: a._.itemOverFn, 16005 moveOutFn: a._.itemOutFn, 16006 clickFn: a._.itemClickFn, 16007 index: b, 16008 iconStyle: CKEDITOR.skin.getIconStyle(p, "rtl" == this.editor.lang.dir, p == this.icon ? null : this.icon, this.iconOffset), 16009 shortcutHtml: c ? n.output({ 16010 shortcut: c.display 16011 }) : "", 16012 arrowHtml: u ? t.output({ 16013 label: q 16014 }) : "", 16015 role: this.role ? this.role : "menuitem", 16016 ariaChecked: k 16017 }; 16018 r.output(a, d) 16019 } 16020 } 16021 }) 16022 })(); 16023 CKEDITOR.config.menu_groups = "clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div"; 16024 CKEDITOR.plugins.add("contextmenu", { 16025 requires: "menu", 16026 onLoad: function() { 16027 CKEDITOR.plugins.contextMenu = CKEDITOR.tools.createClass({ 16028 base: CKEDITOR.menu, 16029 $: function(a) { 16030 this.base.call(this, a, { 16031 panel: { 16032 className: "cke_menu_panel", 16033 attributes: { 16034 "aria-label": a.lang.contextmenu.options 16035 } 16036 } 16037 }) 16038 }, 16039 proto: { 16040 addTarget: function(a, e) { 16041 a.on("contextmenu", function(a) { 16042 a = a.data; 16043 var c = CKEDITOR.env.webkit ? f : CKEDITOR.env.mac ? a.$.metaKey : a.$.ctrlKey; 16044 if (!e || !c) { 16045 a.preventDefault(); 16046 if (CKEDITOR.env.mac && CKEDITOR.env.webkit) { 16047 var c = this.editor, 16048 b = (new CKEDITOR.dom.elementPath(a.getTarget(), c.editable())).contains(function(a) { 16049 return a.hasAttribute("contenteditable") 16050 }, !0); 16051 b && "false" == b.getAttribute("contenteditable") && c.getSelection().fake(b) 16052 } 16053 var b = a.getTarget().getDocument(), 16054 d = a.getTarget().getDocument().getDocumentElement(), 16055 c = !b.equals(CKEDITOR.document), 16056 b = b.getWindow().getScrollPosition(), 16057 g = c ? a.$.clientX : a.$.pageX || b.x + a.$.clientX, 16058 h = c ? a.$.clientY : a.$.pageY || b.y + a.$.clientY; 16059 CKEDITOR.tools.setTimeout(function() { 16060 this.open(d, null, g, h) 16061 }, CKEDITOR.env.ie ? 16062 200 : 0, this) 16063 } 16064 }, this); 16065 if (CKEDITOR.env.webkit) { 16066 var f, d = function() { 16067 f = 0 16068 }; 16069 a.on("keydown", function(a) { 16070 f = CKEDITOR.env.mac ? a.data.$.metaKey : a.data.$.ctrlKey 16071 }); 16072 a.on("keyup", d); 16073 a.on("contextmenu", d) 16074 } 16075 }, 16076 open: function(a, e, f, d) { 16077 !1 !== this.editor.config.enableContextMenu && (this.editor.focus(), a = a || CKEDITOR.document.getDocumentElement(), this.editor.selectionChange(1), this.show(a, e, f, d)) 16078 } 16079 } 16080 }) 16081 }, 16082 beforeInit: function(a) { 16083 var e = a.contextMenu = new CKEDITOR.plugins.contextMenu(a); 16084 a.on("contentDom", function() { 16085 e.addTarget(a.editable(), 16086 !1 !== a.config.browserContextMenuOnCtrl) 16087 }); 16088 a.addCommand("contextMenu", { 16089 exec: function() { 16090 a.contextMenu.open(a.document.getBody()) 16091 } 16092 }); 16093 a.setKeystroke(CKEDITOR.SHIFT + 121, "contextMenu"); 16094 a.setKeystroke(CKEDITOR.CTRL + CKEDITOR.SHIFT + 121, "contextMenu") 16095 } 16096 }); 16097 (function() { 16098 function k(a, b, d, e) { 16099 var c = new CKEDITOR.dom.walker(a); 16100 if (a = a.startContainer.getAscendant(b, !0) || a.endContainer.getAscendant(b, !0)) 16101 if (d(a), e) return; 16102 for (; a = c.next();) 16103 if (a = a.getAscendant(b, !0)) 16104 if (d(a), e) break 16105 } 16106 16107 function u(a, b) { 16108 var d = { 16109 ul: "ol", 16110 ol: "ul" 16111 }; 16112 return -1 !== l(b, function(b) { 16113 return b.element === a || b.element === d[a] 16114 }) 16115 } 16116 16117 function q(a) { 16118 this.styles = null; 16119 this.sticky = !1; 16120 this.editor = a; 16121 this.filter = new CKEDITOR.filter(a.config.copyFormatting_allowRules); 16122 !0 === a.config.copyFormatting_allowRules && (this.filter.disabled = !0); 16123 a.config.copyFormatting_disallowRules && this.filter.disallow(a.config.copyFormatting_disallowRules) 16124 } 16125 var l = CKEDITOR.tools.indexOf, 16126 r = CKEDITOR.tools.getMouseButton, 16127 t = !1; 16128 CKEDITOR.plugins.add("copyformatting", { 16129 lang: "az,de,en,it,ja,nb,nl,oc,pl,pt-br,ru,sv,tr,zh,zh-cn", 16130 icons: "copyformatting", 16131 hidpi: !0, 16132 init: function(a) { 16133 var b = CKEDITOR.plugins.copyformatting; 16134 b._addScreenReaderContainer(); 16135 t || (CKEDITOR.document.appendStyleSheet(this.path + "styles/copyformatting.css"), t = !0); 16136 a.addContentsCss && a.addContentsCss(this.path + 16137 "styles/copyformatting.css"); 16138 a.copyFormatting = new b.state(a); 16139 a.addCommand("copyFormatting", b.commands.copyFormatting); 16140 a.addCommand("applyFormatting", b.commands.applyFormatting); 16141 a.ui.addButton("CopyFormatting", { 16142 label: a.lang.copyformatting.label, 16143 command: "copyFormatting", 16144 toolbar: "cleanup,0" 16145 }); 16146 a.on("contentDom", function() { 16147 var d = a.editable(), 16148 b = d.isInline() ? d : a.document, 16149 c = a.ui.get("CopyFormatting"); 16150 d.attachListener(b, "mouseup", function(b) { 16151 r(b) === CKEDITOR.MOUSE_BUTTON_LEFT && a.execCommand("applyFormatting") 16152 }); 16153 d.attachListener(CKEDITOR.document, "mouseup", function(b) { 16154 var e = a.getCommand("copyFormatting"); 16155 r(b) !== CKEDITOR.MOUSE_BUTTON_LEFT || e.state !== CKEDITOR.TRISTATE_ON || d.contains(b.data.getTarget()) || a.execCommand("copyFormatting") 16156 }); 16157 c && (b = CKEDITOR.document.getById(c._.id), d.attachListener(b, "dblclick", function() { 16158 a.execCommand("copyFormatting", { 16159 sticky: !0 16160 }) 16161 }), d.attachListener(b, "mouseup", function(a) { 16162 a.data.stopPropagation() 16163 })) 16164 }); 16165 a.config.copyFormatting_keystrokeCopy && a.setKeystroke(a.config.copyFormatting_keystrokeCopy, 16166 "copyFormatting"); 16167 a.on("key", function(b) { 16168 var e = a.getCommand("copyFormatting"); 16169 b = b.data.domEvent; 16170 b.getKeystroke && 27 === b.getKeystroke() && e.state === CKEDITOR.TRISTATE_ON && a.execCommand("copyFormatting") 16171 }); 16172 a.copyFormatting.on("extractFormatting", function(d) { 16173 var e = d.data.element; 16174 if (e.contains(a.editable()) || e.equals(a.editable())) return d.cancel(); 16175 e = b._convertElementToStyleDef(e); 16176 if (!a.copyFormatting.filter.check(new CKEDITOR.style(e), !0, !0)) return d.cancel(); 16177 d.data.styleDef = e 16178 }); 16179 a.copyFormatting.on("applyFormatting", 16180 function(d) { 16181 if (!d.data.preventFormatStripping) { 16182 var e = d.data.range, 16183 c = b._extractStylesFromRange(a, e), 16184 f = b._determineContext(e), 16185 g, h; 16186 if (a.copyFormatting._isContextAllowed(f)) 16187 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) 16188 } 16189 }); 16190 a.copyFormatting.on("applyFormatting", 16191 function(b) { 16192 var e = CKEDITOR.plugins.copyformatting, 16193 c = e._determineContext(b.data.range); 16194 "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) 16195 }, null, null, 999) 16196 } 16197 }); 16198 q.prototype._isContextAllowed = function(a) { 16199 var b = 16200 this.editor.config.copyFormatting_allowedContexts; 16201 return !0 === b || -1 !== l(b, a) 16202 }; 16203 CKEDITOR.event.implementOn(q.prototype); 16204 CKEDITOR.plugins.copyformatting = { 16205 state: q, 16206 inlineBoundary: "h1 h2 h3 h4 h5 h6 p div".split(" "), 16207 excludedAttributes: ["id", "style", "href", "data-cke-saved-href", "dir"], 16208 elementsForInlineTransform: ["li"], 16209 excludedElementsFromInlineTransform: ["table", "thead", "tbody", "ul", "ol"], 16210 excludedAttributesFromInlineTransform: ["value", "type"], 16211 preservedElements: "ul ol li td th tr thead tbody table".split(" "), 16212 breakOnElements: ["ul", "ol", "table"], 16213 _initialKeystrokePasteCommand: null, 16214 commands: { 16215 copyFormatting: { 16216 exec: function(a, b) { 16217 var d = CKEDITOR.plugins.copyformatting, 16218 e = a.copyFormatting, 16219 c = b ? "keystrokeHandler" == b.from : !1, 16220 f = b ? b.sticky || c : !1, 16221 g = d._getCursorContainer(a), 16222 h = CKEDITOR.document.getDocumentElement(); 16223 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"), 16224 d._putScreenReaderMessage(a, "canceled"), d._detachPasteKeystrokeHandler(a), this.setState(CKEDITOR.TRISTATE_OFF); 16225 e.styles = d._extractStylesFromElement(a, a.elementPath().lastElement); 16226 this.setState(CKEDITOR.TRISTATE_ON); 16227 c || (g.addClass("cke_copyformatting_active"), h.addClass("cke_copyformatting_tableresize_cursor"), a.config.copyFormatting_outerCursor && h.addClass("cke_copyformatting_disabled")); 16228 e.sticky = f; 16229 d._putScreenReaderMessage(a, "copied"); 16230 d._attachPasteKeystrokeHandler(a) 16231 } 16232 }, 16233 applyFormatting: { 16234 editorFocus: CKEDITOR.env.ie && 16235 !CKEDITOR.env.edge ? !1 : !0, 16236 exec: function(a, b) { 16237 var d = a.getCommand("copyFormatting"), 16238 e = b ? "keystrokeHandler" == b.from : !1, 16239 c = CKEDITOR.plugins.copyformatting, 16240 f = a.copyFormatting, 16241 g = c._getCursorContainer(a), 16242 h = CKEDITOR.document.getDocumentElement(); 16243 if (e || d.state === CKEDITOR.TRISTATE_ON) { 16244 if (e && !f.styles) return c._putScreenReaderMessage(a, "failed"), c._detachPasteKeystrokeHandler(a), !1; 16245 e = c._applyFormat(a, f.styles); 16246 f.sticky || (f.styles = null, g.removeClass("cke_copyformatting_active"), h.removeClass("cke_copyformatting_disabled"), 16247 h.removeClass("cke_copyformatting_tableresize_cursor"), d.setState(CKEDITOR.TRISTATE_OFF), c._detachPasteKeystrokeHandler(a)); 16248 c._putScreenReaderMessage(a, e ? "applied" : "canceled") 16249 } 16250 } 16251 } 16252 }, 16253 _getCursorContainer: function(a) { 16254 return a.elementMode === CKEDITOR.ELEMENT_MODE_INLINE ? a.editable() : a.editable().getParent() 16255 }, 16256 _convertElementToStyleDef: function(a) { 16257 var b = CKEDITOR.tools, 16258 d = a.getAttributes(CKEDITOR.plugins.copyformatting.excludedAttributes), 16259 b = b.parseCssText(a.getAttribute("style"), !0, !0); 16260 return { 16261 element: a.getName(), 16262 type: CKEDITOR.STYLE_INLINE, 16263 attributes: d, 16264 styles: b 16265 } 16266 }, 16267 _extractStylesFromElement: function(a, b) { 16268 var d = {}, 16269 e = []; 16270 do 16271 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); 16272 return e 16273 }, 16274 _extractStylesFromRange: function(a, b) { 16275 for (var d = [], e = new CKEDITOR.dom.walker(b), 16276 c; c = e.next();) d = d.concat(CKEDITOR.plugins.copyformatting._extractStylesFromElement(a, c)); 16277 return d 16278 }, 16279 _removeStylesFromElementInRange: function(a, b) { 16280 for (var d = -1 !== l(["ol", "ul", "table"], b), e = new CKEDITOR.dom.walker(a), c; c = e.next();) 16281 if (c = c.getAscendant(b, !0)) 16282 if (c.removeAttributes(c.getAttributes()), d) break 16283 }, 16284 _getSelectedWordOffset: function(a) { 16285 function b(a, b) { 16286 return a[b ? "getPrevious" : "getNext"](function(a) { 16287 return a.type !== CKEDITOR.NODE_COMMENT 16288 }) 16289 } 16290 16291 function d(a) { 16292 return a.type == CKEDITOR.NODE_ELEMENT ? (a = a.getHtml().replace(/<span.*?> <\/span>/g, 16293 ""), a.replace(/<.*?>/g, "")) : a.getText() 16294 } 16295 16296 function e(a, c) { 16297 var f = a, 16298 g = /\s/g, 16299 h = "p br ol ul li td th div caption body".split(" "), 16300 m = !1, 16301 k = !1, 16302 p, n; 16303 do { 16304 for (p = b(f, c); !p && f.getParent();) { 16305 f = f.getParent(); 16306 if (-1 !== l(h, f.getName())) { 16307 k = m = !0; 16308 break 16309 } 16310 p = b(f, c) 16311 } 16312 if (p && p.getName && -1 !== l(h, p.getName())) { 16313 m = !0; 16314 break 16315 } 16316 f = p 16317 } while (f && f.getStyle && ("none" == f.getStyle("display") || !f.getText())); 16318 for (f || (f = a); f.type !== CKEDITOR.NODE_TEXT;) f = !m || c || k ? f.getChild(0) : f.getChild(f.getChildCount() - 1); 16319 for (h = d(f); null != (k = g.exec(h)) && (n = k.index, 16320 c);); 16321 if ("number" !== typeof n && !m) return e(f, c); 16322 if (m) c ? n = 0 : (g = /([\.\b]*$)/, n = (k = g.exec(h)) ? k.index : h.length); 16323 else if (c && (n += 1, n > h.length)) return e(f); 16324 return { 16325 node: f, 16326 offset: n 16327 } 16328 } 16329 var c = /\b\w+\b/ig, 16330 f, g, h, m, k; 16331 h = m = k = a.startContainer; 16332 for (f = d(h); null != (g = c.exec(f));) 16333 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), { 16334 startNode: m, 16335 startOffset: a, 16336 endNode: k, 16337 endOffset: c 16338 }; 16339 return null 16340 }, 16341 _filterStyles: function(a) { 16342 var b = 16343 CKEDITOR.tools.isEmpty, 16344 d = [], 16345 e, c; 16346 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]); 16347 return d 16348 }, 16349 _determineContext: function(a) { 16350 function b(b) { 16351 var e = new CKEDITOR.dom.walker(a), 16352 c; 16353 if (a.startContainer.getAscendant(b, !0) || a.endContainer.getAscendant(b, !0)) return !0; 16354 for (; c = e.next();) 16355 if (c.getAscendant(b, !0)) return !0 16356 } 16357 return b({ 16358 ul: 1, 16359 ol: 1 16360 }) ? 16361 "list" : b("table") ? "table" : "text" 16362 }, 16363 _applyStylesToTextContext: function(a, b, d) { 16364 var e = CKEDITOR.plugins.copyformatting, 16365 c = e.excludedAttributesFromInlineTransform, 16366 f, g; 16367 CKEDITOR.env.webkit && !CKEDITOR.env.chrome && a.getSelection().selectRanges([b]); 16368 for (f = 0; f < d.length; f++) 16369 if (b = d[f], -1 === l(e.excludedElementsFromInlineTransform, b.element)) { 16370 if (-1 !== l(e.elementsForInlineTransform, b.element)) 16371 for (b.element = b._.definition.element = "span", g = 0; g < c.length; g++) b._.definition.attributes[c[g]] && delete b._.definition.attributes[c[g]]; 16372 b.apply(a) 16373 } 16374 }, 16375 _applyStylesToListContext: function(a, b, d) { 16376 var e, c, f; 16377 for (f = 0; f < d.length; f++) e = d[f], c = b.createBookmark(), "ol" === e.element || "ul" === e.element ? k(b, { 16378 ul: 1, 16379 ol: 1 16380 }, function(a) { 16381 var b = e; 16382 a.getName() !== b.element && a.renameNode(b.element); 16383 b.applyToObject(a) 16384 }, !0) : "li" === e.element ? k(b, "li", function(a) { 16385 e.applyToObject(a) 16386 }) : CKEDITOR.plugins.copyformatting._applyStylesToTextContext(a, b, [e]), b.moveToBookmark(c) 16387 }, 16388 _applyStylesToTableContext: function(a, b, d) { 16389 function e(a, b) { 16390 a.getName() !== b.element && (b = b.getDefinition(), 16391 b.element = a.getName(), b = new CKEDITOR.style(b)); 16392 b.applyToObject(a) 16393 } 16394 var c, f, g; 16395 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) { 16396 c.applyToObject(a) 16397 }) : -1 !== l(["td", "th"], c.element) ? k(b, { 16398 td: 1, 16399 th: 1 16400 }, function(a) { 16401 e(a, c) 16402 }) : -1 !== l(["thead", "tbody"], c.element) ? k(b, { 16403 thead: 1, 16404 tbody: 1 16405 }, function(a) { 16406 e(a, c) 16407 }) : CKEDITOR.plugins.copyformatting._applyStylesToTextContext(a, b, [c]), b.moveToBookmark(f) 16408 }, 16409 _applyFormat: function(a, b) { 16410 var d = a.getSelection().getRanges()[0], 16411 e = CKEDITOR.plugins.copyformatting, 16412 c, f; 16413 if (!d) return !1; 16414 if (d.collapsed) { 16415 f = a.getSelection().createBookmarks(); 16416 if (!(c = e._getSelectedWordOffset(d))) return; 16417 d = a.createRange(); 16418 d.setStart(c.startNode, c.startOffset); 16419 d.setEnd(c.endNode, c.endOffset); 16420 d.select() 16421 } 16422 b = e._filterStyles(b); 16423 if (!a.copyFormatting.fire("applyFormatting", { 16424 styles: b, 16425 range: d, 16426 preventFormatStripping: !1 16427 }, a)) return !1; 16428 f && a.getSelection().selectBookmarks(f); 16429 return !0 16430 }, 16431 _putScreenReaderMessage: function(a, b) { 16432 var d = this._getScreenReaderContainer(); 16433 d && d.setText(a.lang.copyformatting.notification[b]) 16434 }, 16435 _addScreenReaderContainer: function() { 16436 if (this._getScreenReaderContainer()) return this._getScreenReaderContainer(); 16437 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) 16438 }, 16439 _getScreenReaderContainer: function() { 16440 if (!CKEDITOR.env.ie6Compat && !CKEDITOR.env.ie7Compat) return CKEDITOR.document.getBody().findOne(".cke_copyformatting_notification div[aria-live]") 16441 }, 16442 _attachPasteKeystrokeHandler: function(a) { 16443 var b = a.config.copyFormatting_keystrokePaste; 16444 b && (this._initialKeystrokePasteCommand = a.keystrokeHandler.keystrokes[b], a.setKeystroke(b, "applyFormatting")) 16445 }, 16446 _detachPasteKeystrokeHandler: function(a) { 16447 var b = a.config.copyFormatting_keystrokePaste; 16448 b && a.setKeystroke(b, this._initialKeystrokePasteCommand || !1) 16449 } 16450 }; 16451 CKEDITOR.config.copyFormatting_outerCursor = !0; 16452 CKEDITOR.config.copyFormatting_allowRules = "b s u i em strong span p div td th ol ul li(*)[*]{*}"; 16453 CKEDITOR.config.copyFormatting_disallowRules = 16454 "*[data-cke-widget*,data-widget*,data-cke-realelement](cke_widget*)"; 16455 CKEDITOR.config.copyFormatting_allowedContexts = !0; 16456 CKEDITOR.config.copyFormatting_keystrokeCopy = CKEDITOR.CTRL + CKEDITOR.SHIFT + 67; 16457 CKEDITOR.config.copyFormatting_keystrokePaste = CKEDITOR.CTRL + CKEDITOR.SHIFT + 86 16458 })(); 16459 (function() { 16460 CKEDITOR.plugins.add("div", { 16461 requires: "dialog", 16462 init: function(a) { 16463 if (!a.blockless) { 16464 var c = a.lang.div, 16465 b = "div(*)"; 16466 CKEDITOR.dialog.isTabEnabled(a, "editdiv", "advanced") && (b += ";div[dir,id,lang,title]{*}"); 16467 a.addCommand("creatediv", new CKEDITOR.dialogCommand("creatediv", { 16468 allowedContent: b, 16469 requiredContent: "div", 16470 contextSensitive: !0, 16471 contentTransformations: [ 16472 ["div: alignmentToStyle"] 16473 ], 16474 refresh: function(a, c) { 16475 this.setState("div" in (a.config.div_wrapTable ? c.root : c.blockLimit).getDtd() ? CKEDITOR.TRISTATE_OFF : 16476 CKEDITOR.TRISTATE_DISABLED) 16477 } 16478 })); 16479 a.addCommand("editdiv", new CKEDITOR.dialogCommand("editdiv", { 16480 requiredContent: "div" 16481 })); 16482 a.addCommand("removediv", { 16483 requiredContent: "div", 16484 exec: function(a) { 16485 function c(b) { 16486 (b = CKEDITOR.plugins.div.getSurroundDiv(a, b)) && !b.data("cke-div-added") && (f.push(b), b.data("cke-div-added")) 16487 } 16488 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()); 16489 for (d = 0; d < f.length; d++) f[d].remove(!0); 16490 b.selectBookmarks(h) 16491 } 16492 }); 16493 a.ui.addButton && a.ui.addButton("CreateDiv", { 16494 label: c.toolbar, 16495 command: "creatediv", 16496 toolbar: "blocks,50" 16497 }); 16498 a.addMenuItems && (a.addMenuItems({ 16499 editdiv: { 16500 label: c.edit, 16501 command: "editdiv", 16502 group: "div", 16503 order: 1 16504 }, 16505 removediv: { 16506 label: c.remove, 16507 command: "removediv", 16508 group: "div", 16509 order: 5 16510 } 16511 }), a.contextMenu && a.contextMenu.addListener(function(b) { 16512 return !b || b.isReadOnly() ? null : CKEDITOR.plugins.div.getSurroundDiv(a) ? { 16513 editdiv: CKEDITOR.TRISTATE_OFF, 16514 removediv: CKEDITOR.TRISTATE_OFF 16515 } : 16516 null 16517 })); 16518 CKEDITOR.dialog.add("creatediv", this.path + "dialogs/div.js"); 16519 CKEDITOR.dialog.add("editdiv", this.path + "dialogs/div.js") 16520 } 16521 } 16522 }); 16523 CKEDITOR.plugins.div = { 16524 getSurroundDiv: function(a, c) { 16525 var b = a.elementPath(c); 16526 return a.elementPath(b.blockLimit).contains(function(a) { 16527 return a.is("div") && !a.isReadOnly() 16528 }, 1) 16529 } 16530 } 16531 })(); 16532 CKEDITOR.plugins.add("resize", { 16533 init: function(b) { 16534 function f(d) { 16535 var e = c.width, 16536 m = c.height, 16537 f = e + (d.data.$.screenX - n.x) * ("rtl" == g ? -1 : 1); 16538 d = m + (d.data.$.screenY - n.y); 16539 h && (e = Math.max(a.resize_minWidth, Math.min(f, a.resize_maxWidth))); 16540 p && (m = Math.max(a.resize_minHeight, Math.min(d, a.resize_maxHeight))); 16541 b.resize(h ? e : null, m) 16542 } 16543 16544 function k() { 16545 CKEDITOR.document.removeListener("mousemove", f); 16546 CKEDITOR.document.removeListener("mouseup", k); 16547 b.document && (b.document.removeListener("mousemove", f), b.document.removeListener("mouseup", 16548 k)) 16549 } 16550 var a = b.config, 16551 r = b.ui.spaceId("resizer"), 16552 g = b.element ? b.element.getDirection(1) : "ltr"; 16553 !a.resize_dir && (a.resize_dir = "vertical"); 16554 void 0 === a.resize_maxWidth && (a.resize_maxWidth = 3E3); 16555 void 0 === a.resize_maxHeight && (a.resize_maxHeight = 3E3); 16556 void 0 === a.resize_minWidth && (a.resize_minWidth = 750); 16557 void 0 === a.resize_minHeight && (a.resize_minHeight = 250); 16558 if (!1 !== a.resize_enabled) { 16559 var l = null, 16560 n, c, h = ("both" == a.resize_dir || "horizontal" == a.resize_dir) && a.resize_minWidth != a.resize_maxWidth, 16561 p = ("both" == a.resize_dir || "vertical" == 16562 a.resize_dir) && a.resize_minHeight != a.resize_maxHeight, 16563 q = CKEDITOR.tools.addFunction(function(d) { 16564 l || (l = b.getResizable()); 16565 c = { 16566 width: l.$.offsetWidth || 0, 16567 height: l.$.offsetHeight || 0 16568 }; 16569 n = { 16570 x: d.screenX, 16571 y: d.screenY 16572 }; 16573 a.resize_minWidth > c.width && (a.resize_minWidth = c.width); 16574 a.resize_minHeight > c.height && (a.resize_minHeight = c.height); 16575 CKEDITOR.document.on("mousemove", f); 16576 CKEDITOR.document.on("mouseup", k); 16577 b.document && (b.document.on("mousemove", f), b.document.on("mouseup", k)); 16578 d.preventDefault && d.preventDefault() 16579 }); 16580 b.on("destroy", 16581 function() { 16582 CKEDITOR.tools.removeFunction(q) 16583 }); 16584 b.on("uiSpace", function(a) { 16585 if ("bottom" == a.data.space) { 16586 var e = ""; 16587 h && !p && (e = " cke_resizer_horizontal"); 16588 !h && p && (e = " cke_resizer_vertical"); 16589 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"; 16590 "ltr" == g && "ltr" == e ? a.data.html += c : a.data.html = c + a.data.html 16591 } 16592 }, b, null, 100); 16593 b.on("maximize", 16594 function(a) { 16595 b.ui.space("resizer")[a.data == CKEDITOR.TRISTATE_ON ? "hide" : "show"]() 16596 }) 16597 } 16598 } 16599 }); 16600 (function() { 16601 function q(a, c) { 16602 function k(b) { 16603 b = h.list[b]; 16604 var e; 16605 b.equals(a.editable()) || "true" == b.getAttribute("contenteditable") ? (e = a.createRange(), e.selectNodeContents(b), e = e.select()) : (e = a.getSelection(), e.selectElement(b)); 16606 CKEDITOR.env.ie && a.fire("selectionChange", { 16607 selection: e, 16608 path: new CKEDITOR.dom.elementPath(b) 16609 }); 16610 a.focus() 16611 } 16612 16613 function l() { 16614 m && m.setHtml('\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e'); 16615 delete h.list 16616 } 16617 var n = a.ui.spaceId("path"), 16618 m, h = a._.elementsPath, 16619 q = h.idBase; 16620 c.html += '\x3cspan id\x3d"' + 16621 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'; 16622 a.on("uiReady", function() { 16623 var b = a.ui.space("path"); 16624 b && a.focusManager.add(b, 1) 16625 }); 16626 h.onClick = k; 16627 var v = CKEDITOR.tools.addFunction(k), 16628 w = CKEDITOR.tools.addFunction(function(b, e) { 16629 var g = h.idBase, 16630 d; 16631 e = new CKEDITOR.dom.event(e); 16632 d = "rtl" == a.lang.dir; 16633 switch (e.getKeystroke()) { 16634 case d ? 16635 39: 16636 37: case 9: return (d = CKEDITOR.document.getById(g + (b + 1))) || (d = CKEDITOR.document.getById(g + "0")), d.focus(), !1; 16637 case d ? 37: 16638 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; 16639 case 27: 16640 return a.focus(), !1; 16641 case 13: 16642 case 32: 16643 return k(b), !1 16644 } 16645 return !0 16646 }); 16647 a.on("selectionChange", function(b) { 16648 for (var e = [], g = h.list = [], d = [], c = h.filters, p = !0, k = b.data.path.elements, u = k.length; u--;) { 16649 var f = k[u], 16650 r = 0; 16651 b = f.data("cke-display-name") ? f.data("cke-display-name") : 16652 f.data("cke-real-element-type") ? f.data("cke-real-element-type") : f.getName(); 16653 (p = f.hasAttribute("contenteditable") ? "true" == f.getAttribute("contenteditable") : p) || f.hasAttribute("contenteditable") || (r = 1); 16654 for (var t = 0; t < c.length; t++) { 16655 var l = c[t](f, b); 16656 if (!1 === l) { 16657 r = 1; 16658 break 16659 } 16660 b = l || b 16661 } 16662 r || (g.unshift(f), d.unshift(b)) 16663 } 16664 g = g.length; 16665 for (c = 0; c < g; c++) b = d[c], p = a.lang.elementspath.eleTitle.replace(/%1/, b), b = x.output({ 16666 id: q + c, 16667 label: p, 16668 text: b, 16669 jsTitle: "javascript:void('" + b + "')", 16670 index: c, 16671 keyDownFn: w, 16672 clickFn: v 16673 }), e.unshift(b); 16674 m || 16675 (m = CKEDITOR.document.getById(n)); 16676 d = m; 16677 d.setHtml(e.join("") + '\x3cspan class\x3d"cke_path_empty"\x3e\x26nbsp;\x3c/span\x3e'); 16678 a.fire("elementsPathUpdate", { 16679 space: d 16680 }) 16681 }); 16682 a.on("readOnly", l); 16683 a.on("contentDomUnload", l); 16684 a.addCommand("elementsPathFocus", y.toolbarFocus); 16685 a.setKeystroke(CKEDITOR.ALT + 122, "elementsPathFocus") 16686 } 16687 var y = { 16688 toolbarFocus: { 16689 editorFocus: !1, 16690 readOnly: 1, 16691 exec: function(a) { 16692 (a = CKEDITOR.document.getById(a._.elementsPath.idBase + "0")) && a.focus(CKEDITOR.env.ie || CKEDITOR.env.air) 16693 } 16694 } 16695 }, 16696 c = ""; 16697 CKEDITOR.env.gecko && 16698 CKEDITOR.env.mac && (c += ' onkeypress\x3d"return false;"'); 16699 CKEDITOR.env.gecko && (c += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;"'); 16700 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'); 16701 CKEDITOR.plugins.add("elementspath", { 16702 init: function(a) { 16703 a._.elementsPath = { 16704 idBase: "cke_elementspath_" + CKEDITOR.tools.getNextNumber() + "_", 16705 filters: [] 16706 }; 16707 a.on("uiSpace", function(c) { 16708 "bottom" == c.data.space && q(a, c.data) 16709 }) 16710 } 16711 }) 16712 })(); 16713 (function() { 16714 function x(a, e, b) { 16715 b = a.config.forceEnterMode || b; 16716 if ("wysiwyg" == a.mode) { 16717 e || (e = a.activeEnterMode); 16718 var g = a.elementPath(); 16719 g && !g.isContextFor("p") && (e = CKEDITOR.ENTER_BR, b = 1); 16720 a.fire("saveSnapshot"); 16721 e == CKEDITOR.ENTER_BR ? u(a, e, null, b) : r(a, e, null, b); 16722 a.fire("saveSnapshot") 16723 } 16724 } 16725 16726 function y(a) { 16727 a = a.getSelection().getRanges(!0); 16728 for (var e = a.length - 1; 0 < e; e--) a[e].deleteContents(); 16729 return a[0] 16730 } 16731 16732 function z(a) { 16733 var e = a.startContainer.getAscendant(function(a) { 16734 return a.type == CKEDITOR.NODE_ELEMENT && "true" == a.getAttribute("contenteditable") 16735 }, 16736 !0); 16737 if (a.root.equals(e)) return a; 16738 e = new CKEDITOR.dom.range(e); 16739 e.moveToRange(a); 16740 return e 16741 } 16742 CKEDITOR.plugins.add("enterkey", { 16743 init: function(a) { 16744 a.addCommand("enter", { 16745 modes: { 16746 wysiwyg: 1 16747 }, 16748 editorFocus: !1, 16749 exec: function(a) { 16750 x(a) 16751 } 16752 }); 16753 a.addCommand("shiftEnter", { 16754 modes: { 16755 wysiwyg: 1 16756 }, 16757 editorFocus: !1, 16758 exec: function(a) { 16759 x(a, a.activeShiftEnterMode, 1) 16760 } 16761 }); 16762 a.setKeystroke([ 16763 [13, "enter"], 16764 [CKEDITOR.SHIFT + 13, "shiftEnter"] 16765 ]) 16766 } 16767 }); 16768 var A = CKEDITOR.dom.walker.whitespaces(), 16769 B = CKEDITOR.dom.walker.bookmark(), 16770 v, u, r, w; 16771 CKEDITOR.plugins.enterkey = { 16772 enterBlock: function(a, e, b, g) { 16773 function m(a) { 16774 var b; 16775 if (a === CKEDITOR.ENTER_BR || -1 === CKEDITOR.tools.indexOf(["td", "th"], p.lastElement.getName()) || 1 !== p.lastElement.getChildCount()) return !1; 16776 a = p.lastElement.getChild(0).clone(!0); 16777 (b = a.getBogus()) && b.remove(); 16778 return a.getText().length ? !1 : !0 16779 } 16780 if (b = b || y(a)) { 16781 b = z(b); 16782 var h = b.document, 16783 n = b.checkStartOfBlock(), 16784 f = b.checkEndOfBlock(), 16785 p = a.elementPath(b.startContainer), 16786 c = p.block, 16787 l = e == CKEDITOR.ENTER_DIV ? "div" : "p", 16788 d; 16789 if (n && f) { 16790 if (c && (c.is("li") || c.getParent().is("li"))) { 16791 c.is("li") || 16792 (c = c.getParent()); 16793 b = c.getParent(); 16794 d = b.getParent(); 16795 g = !c.hasPrevious(); 16796 var f = !c.hasNext(), 16797 l = a.getSelection(), 16798 n = l.createBookmarks(), 16799 k = c.getDirection(1), 16800 t = c.getAttribute("class"), 16801 q = c.getAttribute("style"), 16802 r = d.getDirection(1) != k; 16803 a = a.enterMode != CKEDITOR.ENTER_BR || r || q || t; 16804 if (d.is("li")) g || f ? (g && f && b.remove(), c[f ? "insertAfter" : "insertBefore"](d)) : c.breakParent(d); 16805 else { 16806 if (a) 16807 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", 16808 t), c.moveChildren(d)) : d = p.block, g || f) d[g ? "insertBefore" : "insertAfter"](b); 16809 else c.breakParent(b), d.insertAfter(b); 16810 else if (c.appendBogus(!0), g || f) 16811 for (; h = c[g ? "getFirst" : "getLast"]();) h[g ? "insertBefore" : "insertAfter"](b); 16812 else 16813 for (c.breakParent(b); h = c.getLast();) h.insertAfter(b); 16814 c.remove() 16815 } 16816 l.selectBookmarks(n); 16817 return 16818 } 16819 if (c && c.getParent().is("blockquote")) { 16820 c.breakParent(c.getParent()); 16821 c.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1)) || c.getPrevious().remove(); 16822 c.getNext().getFirst(CKEDITOR.dom.walker.invisible(1)) || 16823 c.getNext().remove(); 16824 b.moveToElementEditStart(c); 16825 b.select(); 16826 return 16827 } 16828 } else if (c && c.is("pre") && !f) { 16829 u(a, e, b, g); 16830 return 16831 } 16832 if (q = b.splitBlock(l)) { 16833 a = q.previousBlock; 16834 c = q.nextBlock; 16835 n = q.wasStartOfBlock; 16836 f = q.wasEndOfBlock; 16837 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())); 16838 if (n || f) 16839 if (m(e)) b.moveToElementEditStart(b.getTouchedStartNode()); 16840 else { 16841 if (a) { 16842 if (a.is("li") || !w.test(a.getName()) && 16843 !a.is("pre")) d = a.clone() 16844 } else c && (d = c.clone()); 16845 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)); 16846 if (h = q.elementPath) 16847 for (e = 0, g = h.elements.length; e < g; e++) { 16848 l = h.elements[e]; 16849 if (l.equals(h.block) || l.equals(h.blockLimit)) break; 16850 CKEDITOR.dtd.$removeEmpty[l.getName()] && (l = l.clone(), d.moveChildren(l), d.append(l)) 16851 } 16852 d.appendBogus(); 16853 d.getParent() || b.insertNode(d); 16854 d.is("li") && d.removeAttribute("value"); 16855 !CKEDITOR.env.ie || !n || f && a.getChildCount() || 16856 (b.moveToElementEditStart(f ? a : d), b.select()); 16857 b.moveToElementEditStart(n && !f ? c : d) 16858 } 16859 else c.is("li") && (d = b.clone(), d.selectNodeContents(c), d = new CKEDITOR.dom.walker(d), d.evaluator = function(a) { 16860 return !(B(a) || A(a) || a.type == CKEDITOR.NODE_ELEMENT && a.getName() in CKEDITOR.dtd.$inline && !(a.getName() in CKEDITOR.dtd.$empty)) 16861 }, (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); 16862 b.select(); 16863 b.scrollIntoView() 16864 } 16865 } 16866 }, 16867 enterBr: function(a, e, b, g) { 16868 if (b = b || y(a)) { 16869 var m = b.document, 16870 h = b.checkEndOfBlock(), 16871 n = new CKEDITOR.dom.elementPath(a.getSelection().getStartElement()), 16872 f = n.block, 16873 p = f && n.block.getName(); 16874 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)) : 16875 (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) 16876 } 16877 } 16878 }; 16879 v = CKEDITOR.plugins.enterkey; 16880 u = v.enterBr; 16881 r = v.enterBlock; 16882 w = /^h[1-6]$/ 16883 })(); 16884 (function() { 16885 function k(b, f) { 16886 var g = {}, 16887 c = [], 16888 e = { 16889 nbsp: " ", 16890 shy: "", 16891 gt: "\x3e", 16892 lt: "\x3c", 16893 amp: "\x26", 16894 apos: "'", 16895 quot: '"' 16896 }; 16897 b = b.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g, function(b, a) { 16898 var d = f ? "\x26" + a + ";" : e[a]; 16899 g[d] = f ? e[a] : "\x26" + a + ";"; 16900 c.push(d); 16901 return "" 16902 }); 16903 if (!f && b) { 16904 b = b.split(","); 16905 var a = document.createElement("div"), 16906 d; 16907 a.innerHTML = "\x26" + b.join(";\x26") + ";"; 16908 d = a.innerHTML; 16909 a = null; 16910 for (a = 0; a < d.length; a++) { 16911 var h = d.charAt(a); 16912 g[h] = "\x26" + b[a] + ";"; 16913 c.push(h) 16914 } 16915 } 16916 g.regex = c.join(f ? "|" : ""); 16917 return g 16918 } 16919 CKEDITOR.plugins.add("entities", { 16920 afterInit: function(b) { 16921 function f(a) { 16922 return h[a] 16923 } 16924 16925 function g(b) { 16926 return "force" != c.entities_processNumerical && a[b] ? a[b] : "\x26#" + b.charCodeAt(0) + ";" 16927 } 16928 var c = b.config; 16929 if (b = (b = b.dataProcessor) && b.htmlFilter) { 16930 var e = []; 16931 !1 !== c.basicEntities && e.push("nbsp,gt,lt,amp"); 16932 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"), 16933 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"), 16934 c.entities_additional && e.push(c.entities_additional)); 16935 var a = k(e.join(",")), 16936 d = a.regex ? "[" + a.regex + "]" : "a^"; 16937 delete a.regex; 16938 c.entities && c.entities_processNumerical && (d = "[^ -~]|" + d); 16939 var d = new RegExp(d, "g"), 16940 h = k("nbsp,gt,lt,amp,shy", !0), 16941 l = new RegExp(h.regex, "g"); 16942 b.addRules({ 16943 text: function(a) { 16944 return a.replace(l, f).replace(d, g) 16945 } 16946 }, { 16947 applyToAll: !0, 16948 excludeNestedEditable: !0 16949 }) 16950 } 16951 } 16952 }) 16953 })(); 16954 CKEDITOR.config.basicEntities = !0; 16955 CKEDITOR.config.entities = !0; 16956 CKEDITOR.config.entities_latin = !0; 16957 CKEDITOR.config.entities_greek = !0; 16958 CKEDITOR.config.entities_additional = "#39"; 16959 CKEDITOR.plugins.add("popup"); 16960 CKEDITOR.tools.extend(CKEDITOR.editor.prototype, { 16961 popup: function(e, a, b, d) { 16962 a = a || "80%"; 16963 b = b || "70%"; 16964 "string" == typeof a && 1 < a.length && "%" == a.substr(a.length - 1, 1) && (a = parseInt(window.screen.width * parseInt(a, 10) / 100, 10)); 16965 "string" == typeof b && 1 < b.length && "%" == b.substr(b.length - 1, 1) && (b = parseInt(window.screen.height * parseInt(b, 10) / 100, 10)); 16966 640 > a && (a = 640); 16967 420 > b && (b = 420); 16968 var f = parseInt((window.screen.height - b) / 2, 10), 16969 g = parseInt((window.screen.width - a) / 2, 10); 16970 d = (d || "location\x3dno,menubar\x3dno,toolbar\x3dno,dependent\x3dyes,minimizable\x3dno,modal\x3dyes,alwaysRaised\x3dyes,resizable\x3dyes,scrollbars\x3dyes") + ",width\x3d" + 16971 a + ",height\x3d" + b + ",top\x3d" + f + ",left\x3d" + g; 16972 var c = window.open("", null, d, !0); 16973 if (!c) return !1; 16974 try { 16975 -1 == navigator.userAgent.toLowerCase().indexOf(" chrome/") && (c.moveTo(g, f), c.resizeTo(a, b)), c.focus(), c.location.href = e 16976 } catch (h) { 16977 window.open(e, null, d, !0) 16978 } 16979 return !0 16980 } 16981 }); 16982 (function() { 16983 function k(a) { 16984 this.editor = a; 16985 this.loaders = [] 16986 } 16987 16988 function l(a, c, b) { 16989 var d = a.config.fileTools_defaultFileName; 16990 this.editor = a; 16991 this.lang = a.lang; 16992 "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); 16993 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(".")); 16994 this.uploaded = 0; 16995 this.responseData = this.uploadTotal = null; 16996 this.status = 16997 "created"; 16998 this.abort = function() { 16999 this.changeStatus("abort") 17000 } 17001 } 17002 17003 function n(a) { 17004 var c = a.match(m)[1]; 17005 a = a.replace(m, ""); 17006 a = atob(a); 17007 var b = [], 17008 d, f, g, e; 17009 for (d = 0; d < a.length; d += 512) { 17010 f = a.slice(d, d + 512); 17011 g = Array(f.length); 17012 for (e = 0; e < f.length; e++) g[e] = f.charCodeAt(e); 17013 f = new Uint8Array(g); 17014 b.push(f) 17015 } 17016 return new Blob(b, { 17017 type: c 17018 }) 17019 } 17020 CKEDITOR.plugins.add("filetools", { 17021 beforeInit: function(a) { 17022 a.uploadRepository = new k(a); 17023 a.on("fileUploadRequest", function(a) { 17024 var b = a.data.fileLoader; 17025 b.xhr.open("POST", b.uploadUrl, !0); 17026 a.data.requestData.upload = { 17027 file: b.file, 17028 name: b.fileName 17029 } 17030 }, null, null, 5); 17031 a.on("fileUploadRequest", function(c) { 17032 var b = c.data.fileLoader, 17033 d = new FormData; 17034 c = c.data.requestData; 17035 var f = a.config.fileTools_requestHeaders, 17036 g, e; 17037 for (e in c) { 17038 var h = c[e]; 17039 "object" === typeof h && h.file ? d.append(e, h.file, h.name) : d.append(e, h) 17040 } 17041 d.append("ckCsrfToken", CKEDITOR.tools.getCsrfToken()); 17042 if (f) 17043 for (g in f) b.xhr.setRequestHeader(g, f[g]); 17044 b.xhr.send(d) 17045 }, null, null, 999); 17046 a.on("fileUploadResponse", function(a) { 17047 var b = a.data.fileLoader, 17048 d = b.xhr, 17049 f = a.data; 17050 try { 17051 var g = JSON.parse(d.responseText); 17052 g.error && g.error.message && (f.message = g.error.message); 17053 if (g.uploaded) 17054 for (var e in g) f[e] = g[e]; 17055 else a.cancel() 17056 } catch (h) { 17057 f.message = b.lang.filetools.responseError, CKEDITOR.warn("filetools-response-error", { 17058 responseText: d.responseText 17059 }), a.cancel() 17060 } 17061 }, null, null, 999) 17062 } 17063 }); 17064 k.prototype = { 17065 create: function(a, c, b) { 17066 b = b || l; 17067 var d = this.loaders.length; 17068 a = new b(this.editor, a, c); 17069 a.id = d; 17070 this.loaders[d] = a; 17071 this.fire("instanceCreated", a); 17072 return a 17073 }, 17074 isFinished: function() { 17075 for (var a = 0; a < this.loaders.length; ++a) 17076 if (!this.loaders[a].isFinished()) return !1; 17077 return !0 17078 } 17079 }; 17080 l.prototype = { 17081 loadAndUpload: function(a, c) { 17082 var b = this; 17083 this.once("loaded", function(d) { 17084 d.cancel(); 17085 b.once("update", function(a) { 17086 a.cancel() 17087 }, null, null, 0); 17088 b.upload(a, c) 17089 }, null, null, 0); 17090 this.load() 17091 }, 17092 load: function() { 17093 var a = this, 17094 c = this.reader = new FileReader; 17095 a.changeStatus("loading"); 17096 this.abort = function() { 17097 a.reader.abort() 17098 }; 17099 c.onabort = function() { 17100 a.changeStatus("abort") 17101 }; 17102 c.onerror = function() { 17103 a.message = a.lang.filetools.loadError; 17104 a.changeStatus("error") 17105 }; 17106 c.onprogress = function(b) { 17107 a.loaded = b.loaded; 17108 a.update() 17109 }; 17110 c.onload = function() { 17111 a.loaded = a.total; 17112 a.data = c.result; 17113 a.changeStatus("loaded") 17114 }; 17115 c.readAsDataURL(this.file) 17116 }, 17117 upload: function(a, c) { 17118 var b = c || {}; 17119 a ? (this.uploadUrl = a, this.xhr = new XMLHttpRequest, this.attachRequestListeners(), this.editor.fire("fileUploadRequest", { 17120 fileLoader: this, 17121 requestData: b 17122 }) && this.changeStatus("uploading")) : (this.message = this.lang.filetools.noUrlError, this.changeStatus("error")) 17123 }, 17124 attachRequestListeners: function() { 17125 function a() { 17126 "error" != b.status && (b.message = b.lang.filetools.networkError, 17127 b.changeStatus("error")) 17128 } 17129 17130 function c() { 17131 "abort" != b.status && b.changeStatus("abort") 17132 } 17133 var b = this, 17134 d = this.xhr; 17135 b.abort = function() { 17136 d.abort(); 17137 c() 17138 }; 17139 d.onerror = a; 17140 d.onabort = c; 17141 d.upload ? (d.upload.onprogress = function(a) { 17142 a.lengthComputable && (b.uploadTotal || (b.uploadTotal = a.total), b.uploaded = a.loaded, b.update()) 17143 }, d.upload.onerror = a, d.upload.onabort = c) : (b.uploadTotal = b.total, b.update()); 17144 d.onload = function() { 17145 b.update(); 17146 if ("abort" != b.status) 17147 if (b.uploaded = b.uploadTotal, 200 > d.status || 299 < d.status) b.message = b.lang.filetools["httpError" + 17148 d.status], b.message || (b.message = b.lang.filetools.httpError.replace("%1", d.status)), b.changeStatus("error"); 17149 else { 17150 for (var a = { 17151 fileLoader: b 17152 }, c = ["message", "fileName", "url"], e = b.editor.fire("fileUploadResponse", a), h = 0; h < c.length; h++) { 17153 var k = c[h]; 17154 "string" === typeof a[k] && (b[k] = a[k]) 17155 } 17156 b.responseData = a; 17157 delete b.responseData.fileLoader; 17158 !1 === e ? b.changeStatus("error") : b.changeStatus("uploaded") 17159 } 17160 } 17161 }, 17162 changeStatus: function(a) { 17163 this.status = a; 17164 if ("error" == a || "abort" == a || "loaded" == a || "uploaded" == a) this.abort = function() {}; 17165 this.fire(a); 17166 this.update() 17167 }, 17168 update: function() { 17169 this.fire("update") 17170 }, 17171 isFinished: function() { 17172 return !!this.status.match(/^(?:loaded|uploaded|error|abort)$/) 17173 } 17174 }; 17175 CKEDITOR.event.implementOn(k.prototype); 17176 CKEDITOR.event.implementOn(l.prototype); 17177 var m = /^data:(\S*?);base64,/; 17178 CKEDITOR.fileTools || (CKEDITOR.fileTools = {}); 17179 CKEDITOR.tools.extend(CKEDITOR.fileTools, { 17180 uploadRepository: k, 17181 fileLoader: l, 17182 getUploadUrl: function(a, c) { 17183 var b = CKEDITOR.tools.capitalize; 17184 return c && a[c + "UploadUrl"] ? a[c + "UploadUrl"] : a.uploadUrl ? a.uploadUrl : 17185 c && a["filebrowser" + b(c, 1) + "UploadUrl"] ? a["filebrowser" + b(c, 1) + "UploadUrl"] + "\x26responseType\x3djson" : a.filebrowserUploadUrl ? a.filebrowserUploadUrl + "\x26responseType\x3djson" : null 17186 }, 17187 isTypeSupported: function(a, c) { 17188 return !!a.type.match(c) 17189 }, 17190 isFileUploadSupported: "function" === typeof FileReader && "function" === typeof(new FileReader).readAsDataURL && "function" === typeof FormData && "function" === typeof(new FormData).append && "function" === typeof XMLHttpRequest && "function" === typeof Blob 17191 }) 17192 })(); 17193 (function() { 17194 function g(a, b) { 17195 var d = []; 17196 if (b) 17197 for (var c in b) d.push(c + "\x3d" + encodeURIComponent(b[c])); 17198 else return a; 17199 return a + (-1 != a.indexOf("?") ? "\x26" : "?") + d.join("\x26") 17200 } 17201 17202 function p(a) { 17203 return !a.match(/command=QuickUpload/) || a.match(/(\?|&)responseType=json/) ? a : g(a, { 17204 responseType: "json" 17205 }) 17206 } 17207 17208 function k(a) { 17209 a += ""; 17210 return a.charAt(0).toUpperCase() + a.substr(1) 17211 } 17212 17213 function q() { 17214 var a = this.getDialog(), 17215 b = a.getParentEditor(); 17216 b._.filebrowserSe = this; 17217 var d = b.config["filebrowser" + k(a.getName()) + "WindowWidth"] || b.config.filebrowserWindowWidth || 17218 "80%", 17219 a = b.config["filebrowser" + k(a.getName()) + "WindowHeight"] || b.config.filebrowserWindowHeight || "70%", 17220 c = this.filebrowser.params || {}; 17221 c.CKEditor = b.name; 17222 c.CKEditorFuncNum = b._.filebrowserFn; 17223 c.langCode || (c.langCode = b.langCode); 17224 c = g(this.filebrowser.url, c); 17225 b.popup(c, d, a, b.config.filebrowserWindowFeatures || b.config.fileBrowserWindowFeatures) 17226 } 17227 17228 function r(a) { 17229 var b = new CKEDITOR.dom.element(a.$.form); 17230 b && ((a = b.$.elements.ckCsrfToken) ? a = new CKEDITOR.dom.element(a) : (a = new CKEDITOR.dom.element("input"), a.setAttributes({ 17231 name: "ckCsrfToken", 17232 type: "hidden" 17233 }), b.append(a)), a.setAttribute("value", CKEDITOR.tools.getCsrfToken())) 17234 } 17235 17236 function t() { 17237 var a = this.getDialog(); 17238 a.getParentEditor()._.filebrowserSe = this; 17239 return a.getContentElement(this["for"][0], this["for"][1]).getInputElement().$.value && a.getContentElement(this["for"][0], this["for"][1]).getAction() ? !0 : !1 17240 } 17241 17242 function u(a, b, d) { 17243 var c = d.params || {}; 17244 c.CKEditor = a.name; 17245 c.CKEditorFuncNum = a._.filebrowserFn; 17246 c.langCode || (c.langCode = a.langCode); 17247 b.action = g(d.url, c); 17248 b.filebrowser = d 17249 } 17250 17251 function l(a, b, d, c) { 17252 if (c && 17253 c.length) 17254 for (var e, g = c.length; g--;) 17255 if (e = c[g], "hbox" != e.type && "vbox" != e.type && "fieldset" != e.type || l(a, b, d, e.children), e.filebrowser) 17256 if ("string" == typeof e.filebrowser && (e.filebrowser = { 17257 action: "fileButton" == e.type ? "QuickUpload" : "Browse", 17258 target: e.filebrowser 17259 }), "Browse" == e.filebrowser.action) { 17260 var f = e.filebrowser.url; 17261 void 0 === f && (f = a.config["filebrowser" + k(b) + "BrowseUrl"], void 0 === f && (f = a.config.filebrowserBrowseUrl)); 17262 f && (e.onClick = q, e.filebrowser.url = f, e.hidden = !1) 17263 } else if ("QuickUpload" == e.filebrowser.action && 17264 e["for"] && (f = e.filebrowser.url, void 0 === f && (f = a.config["filebrowser" + k(b) + "UploadUrl"], void 0 === f && (f = a.config.filebrowserUploadUrl)), f)) { 17265 var h = e.onClick; 17266 e.onClick = function(b) { 17267 var c = b.sender, 17268 d = c.getDialog().getContentElement(this["for"][0], this["for"][1]).getInputElement(), 17269 e = CKEDITOR.fileTools && CKEDITOR.fileTools.isFileUploadSupported; 17270 if (h && !1 === h.call(c, b)) return !1; 17271 if (t.call(c, b)) { 17272 if ("form" !== a.config.filebrowserUploadMethod && e) return b = a.uploadRepository.create(d.$.files[0]), b.on("uploaded", function(a) { 17273 var b = 17274 a.sender.responseData; 17275 m.call(a.sender.editor, b.url, b.message) 17276 }), b.on("error", n.bind(this)), b.on("abort", n.bind(this)), b.loadAndUpload(p(f)), "xhr"; 17277 r(d); 17278 return !0 17279 } 17280 return !1 17281 }; 17282 e.filebrowser.url = f; 17283 e.hidden = !1; 17284 u(a, d.getContents(e["for"][0]).get(e["for"][1]), e.filebrowser) 17285 } 17286 } 17287 17288 function n(a) { 17289 var b = {}; 17290 try { 17291 b = JSON.parse(a.sender.xhr.response) || {} 17292 } catch (d) {} 17293 this.enable(); 17294 alert(b.error ? b.error.message : a.sender.message) 17295 } 17296 17297 function h(a, b, d) { 17298 if (-1 !== d.indexOf(";")) { 17299 d = d.split(";"); 17300 for (var c = 0; c < d.length; c++) 17301 if (h(a, b, d[c])) return !0; 17302 return !1 17303 } 17304 return (a = a.getContents(b).get(d).filebrowser) && a.url 17305 } 17306 17307 function m(a, b) { 17308 var d = this._.filebrowserSe.getDialog(), 17309 c = this._.filebrowserSe["for"], 17310 e = this._.filebrowserSe.filebrowser.onSelect; 17311 c && d.getContentElement(c[0], c[1]).reset(); 17312 if ("function" != typeof b || !1 !== b.call(this._.filebrowserSe)) 17313 if (!e || !1 !== e.call(this._.filebrowserSe, a, b)) 17314 if ("string" == typeof b && b && alert(b), a && (c = this._.filebrowserSe, d = c.getDialog(), c = c.filebrowser.target || null)) 17315 if (c = c.split(":"), e = d.getContentElement(c[0], c[1])) e.setValue(a), 17316 d.selectPage(c[0]) 17317 } 17318 CKEDITOR.plugins.add("filebrowser", { 17319 requires: "popup,filetools", 17320 init: function(a) { 17321 a._.filebrowserFn = CKEDITOR.tools.addFunction(m, a); 17322 a.on("destroy", function() { 17323 CKEDITOR.tools.removeFunction(this._.filebrowserFn) 17324 }) 17325 } 17326 }); 17327 CKEDITOR.on("dialogDefinition", function(a) { 17328 if (a.editor.plugins.filebrowser) 17329 for (var b = a.data.definition, d, c = 0; c < b.contents.length; ++c) 17330 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)) 17331 }) 17332 })(); 17333 CKEDITOR.plugins.add("find", { 17334 requires: "dialog", 17335 init: function(a) { 17336 var b = a.addCommand("find", new CKEDITOR.dialogCommand("find")), 17337 c = a.addCommand("replace", new CKEDITOR.dialogCommand("find", { 17338 tabId: "replace" 17339 })); 17340 b.canUndo = !1; 17341 b.readOnly = 1; 17342 c.canUndo = !1; 17343 a.ui.addButton && (a.ui.addButton("Find", { 17344 label: a.lang.find.find, 17345 command: "find", 17346 toolbar: "find,10" 17347 }), a.ui.addButton("Replace", { 17348 label: a.lang.find.replace, 17349 command: "replace", 17350 toolbar: "find,20" 17351 })); 17352 CKEDITOR.dialog.add("find", this.path + "dialogs/find.js") 17353 } 17354 }); 17355 CKEDITOR.config.find_highlight = { 17356 element: "span", 17357 styles: { 17358 "background-color": "#004", 17359 color: "#fff" 17360 } 17361 }; 17362 (function() { 17363 function g(a, b) { 17364 var c = l.exec(a), 17365 d = l.exec(b); 17366 if (c) { 17367 if (!c[2] && "px" == d[2]) return d[1]; 17368 if ("px" == c[2] && !d[2]) return d[1] + "px" 17369 } 17370 return b 17371 } 17372 var k = CKEDITOR.htmlParser.cssStyle, 17373 h = CKEDITOR.tools.cssLength, 17374 l = /^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i, 17375 m = { 17376 elements: { 17377 $: function(a) { 17378 var b = a.attributes; 17379 if ((b = (b = (b = b && b["data-cke-realelement"]) && new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(b))) && b.children[0]) && a.attributes["data-cke-resizable"]) { 17380 var c = (new k(a)).rules; 17381 a = b.attributes; 17382 var d = c.width, 17383 c = c.height; 17384 d && (a.width = g(a.width, d)); 17385 c && (a.height = g(a.height, c)) 17386 } 17387 return b 17388 } 17389 } 17390 }; 17391 CKEDITOR.plugins.add("fakeobjects", { 17392 init: function(a) { 17393 a.filter.allow("img[!data-cke-realelement,src,alt,title](*){*}", "fakeobjects") 17394 }, 17395 afterInit: function(a) { 17396 (a = (a = a.dataProcessor) && a.htmlFilter) && a.addRules(m, { 17397 applyToAll: !0 17398 }) 17399 } 17400 }); 17401 CKEDITOR.editor.prototype.createFakeElement = function(a, b, c, d) { 17402 var e = this.lang.fakeobjects, 17403 e = e[c] || e.unknown; 17404 b = { 17405 "class": b, 17406 "data-cke-realelement": encodeURIComponent(a.getOuterHtml()), 17407 "data-cke-real-node-type": a.type, 17408 alt: e, 17409 title: e, 17410 align: a.getAttribute("align") || "" 17411 }; 17412 CKEDITOR.env.hc || (b.src = CKEDITOR.tools.transparentImageData); 17413 c && (b["data-cke-real-element-type"] = c); 17414 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)); 17415 return this.document.createElement("img", { 17416 attributes: b 17417 }) 17418 }; 17419 CKEDITOR.editor.prototype.createFakeParserElement = function(a, b, c, d) { 17420 var e = this.lang.fakeobjects, 17421 e = e[c] || e.unknown, 17422 f; 17423 f = new CKEDITOR.htmlParser.basicWriter; 17424 a.writeHtml(f); 17425 f = f.getHtml(); 17426 b = { 17427 "class": b, 17428 "data-cke-realelement": encodeURIComponent(f), 17429 "data-cke-real-node-type": a.type, 17430 alt: e, 17431 title: e, 17432 align: a.attributes.align || "" 17433 }; 17434 CKEDITOR.env.hc || (b.src = CKEDITOR.tools.transparentImageData); 17435 c && (b["data-cke-real-element-type"] = c); 17436 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)); 17437 return new CKEDITOR.htmlParser.element("img", b) 17438 }; 17439 CKEDITOR.editor.prototype.restoreRealElement = 17440 function(a) { 17441 if (a.data("cke-real-node-type") != CKEDITOR.NODE_ELEMENT) return null; 17442 var b = CKEDITOR.dom.element.createFromHtml(decodeURIComponent(a.data("cke-realelement")), this.document); 17443 if (a.data("cke-resizable")) { 17444 var c = a.getStyle("width"); 17445 a = a.getStyle("height"); 17446 c && b.setAttribute("width", g(b.getAttribute("width"), c)); 17447 a && b.setAttribute("height", g(b.getAttribute("height"), a)) 17448 } 17449 return b 17450 } 17451 })(); 17452 (function() { 17453 function d(a) { 17454 a = a.attributes; 17455 return "application/x-shockwave-flash" == a.type || f.test(a.src || "") 17456 } 17457 17458 function e(a, b) { 17459 return a.createFakeParserElement(b, "cke_flash", "flash", !0) 17460 } 17461 var f = /\.swf(?:$|\?)/i; 17462 CKEDITOR.plugins.add("flash", { 17463 requires: "dialog,fakeobjects", 17464 onLoad: function() { 17465 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;}") 17466 }, 17467 init: function(a) { 17468 var b = "object[classid,codebase,height,hspace,vspace,width];param[name,value];embed[height,hspace,pluginspage,src,type,vspace,width]"; 17469 CKEDITOR.dialog.isTabEnabled(a, "flash", "properties") && (b += ";object[align]; embed[allowscriptaccess,quality,scale,wmode]"); 17470 CKEDITOR.dialog.isTabEnabled(a, "flash", "advanced") && (b += ";object[id]{*}; embed[bgcolor]{*}(*)"); 17471 a.addCommand("flash", new CKEDITOR.dialogCommand("flash", { 17472 allowedContent: b, 17473 requiredContent: "embed" 17474 })); 17475 a.ui.addButton && a.ui.addButton("Flash", { 17476 label: a.lang.common.flash, 17477 command: "flash", 17478 toolbar: "insert,20" 17479 }); 17480 CKEDITOR.dialog.add("flash", this.path + "dialogs/flash.js"); 17481 a.addMenuItems && a.addMenuItems({ 17482 flash: { 17483 label: a.lang.flash.properties, 17484 command: "flash", 17485 group: "flash" 17486 } 17487 }); 17488 a.on("doubleclick", function(a) { 17489 var b = a.data.element; 17490 b.is("img") && "flash" == b.data("cke-real-element-type") && (a.data.dialog = "flash") 17491 }); 17492 a.contextMenu && a.contextMenu.addListener(function(a) { 17493 if (a && a.is("img") && !a.isReadOnly() && "flash" == a.data("cke-real-element-type")) return { 17494 flash: CKEDITOR.TRISTATE_OFF 17495 } 17496 }) 17497 }, 17498 afterInit: function(a) { 17499 var b = a.dataProcessor; 17500 (b = b && b.dataFilter) && b.addRules({ 17501 elements: { 17502 "cke:object": function(b) { 17503 var c = b.attributes; 17504 if (!(c.classid && String(c.classid).toLowerCase() || d(b))) { 17505 for (c = 0; c < b.children.length; c++) 17506 if ("cke:embed" == b.children[c].name) { 17507 if (!d(b.children[c])) break; 17508 return e(a, b) 17509 } return null 17510 } 17511 return e(a, b) 17512 }, 17513 "cke:embed": function(b) { 17514 return d(b) ? e(a, b) : null 17515 } 17516 } 17517 }, 5) 17518 } 17519 }) 17520 })(); 17521 CKEDITOR.tools.extend(CKEDITOR.config, { 17522 flashEmbedTagOnly: !1, 17523 flashAddEmbedTag: !0, 17524 flashConvertOnEdit: !1 17525 }); 17526 (function() { 17527 function k(a) { 17528 var l = a.config, 17529 p = a.fire("uiSpace", { 17530 space: "top", 17531 html: "" 17532 }).html, 17533 t = function() { 17534 function f(a, c, e) { 17535 b.setStyle(c, w(e)); 17536 b.setStyle("position", a) 17537 } 17538 17539 function e(a) { 17540 var b = k.getDocumentPosition(); 17541 switch (a) { 17542 case "top": 17543 f("absolute", "top", b.y - q - r); 17544 break; 17545 case "pin": 17546 f("fixed", "top", x); 17547 break; 17548 case "bottom": 17549 f("absolute", "top", b.y + (c.height || c.bottom - c.top) + r) 17550 } 17551 m = a 17552 } 17553 var m, k, n, c, h, q, v, p = l.floatSpaceDockedOffsetX || 0, 17554 r = l.floatSpaceDockedOffsetY || 0, 17555 u = l.floatSpacePinnedOffsetX || 0, 17556 x = l.floatSpacePinnedOffsetY || 17557 0; 17558 return function(d) { 17559 if (k = a.editable()) { 17560 var f = d && "focus" == d.name; 17561 f && b.show(); 17562 a.fire("floatingSpaceLayout", { 17563 show: f 17564 }); 17565 b.removeStyle("left"); 17566 b.removeStyle("right"); 17567 n = b.getClientRect(); 17568 c = k.getClientRect(); 17569 h = g.getViewPaneSize(); 17570 q = n.height; 17571 v = "pageXOffset" in g.$ ? g.$.pageXOffset : CKEDITOR.document.$.documentElement.scrollLeft; 17572 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 ? 17573 "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)) 17574 } 17575 } 17576 }(); 17577 if (p) { 17578 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 ? 17579 " " : "") + '" 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'), 17580 b = CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(k.output({ 17581 content: p, 17582 id: a.id, 17583 langDir: a.lang.dir, 17584 langCode: a.langCode, 17585 name: a.name, 17586 style: "display:none;z-index:" + (l.baseFloatZIndex - 1), 17587 topId: a.ui.spaceId("top"), 17588 voiceLabel: a.title 17589 }))), 17590 u = CKEDITOR.tools.eventsBuffer(500, t), 17591 e = CKEDITOR.tools.eventsBuffer(100, t); 17592 b.unselectable(); 17593 b.on("mousedown", function(a) { 17594 a = a.data; 17595 a.getTarget().hasAscendant("a", 1) || a.preventDefault() 17596 }); 17597 a.on("focus", function(b) { 17598 t(b); 17599 a.on("change", u.input); 17600 g.on("scroll", e.input); 17601 g.on("resize", e.input) 17602 }); 17603 a.on("blur", function() { 17604 b.hide(); 17605 a.removeListener("change", u.input); 17606 g.removeListener("scroll", 17607 e.input); 17608 g.removeListener("resize", e.input) 17609 }); 17610 a.on("destroy", function() { 17611 g.removeListener("scroll", e.input); 17612 g.removeListener("resize", e.input); 17613 b.clearCustomData(); 17614 b.remove() 17615 }); 17616 a.focusManager.hasFocus && b.show(); 17617 a.focusManager.add(b, 1) 17618 } 17619 } 17620 var g = CKEDITOR.document.getWindow(), 17621 w = CKEDITOR.tools.cssLength; 17622 CKEDITOR.plugins.add("floatingspace", { 17623 init: function(a) { 17624 a.on("loaded", function() { 17625 k(this) 17626 }, null, null, 20) 17627 } 17628 }) 17629 })(); 17630 CKEDITOR.plugins.add("listblock", { 17631 requires: "panel", 17632 onLoad: function() { 17633 var f = CKEDITOR.addTemplate("panel-list", '\x3cul role\x3d"presentation" class\x3d"cke_panel_list"\x3e{items}\x3c/ul\x3e'), 17634 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'), 17635 h = CKEDITOR.addTemplate("panel-list-group", '\x3ch1 id\x3d"{id}" class\x3d"cke_panel_grouptitle" role\x3d"presentation" \x3e{label}\x3c/h1\x3e'), 17636 k = /\'/g; 17637 CKEDITOR.ui.panel.prototype.addListBlock = function(a, b) { 17638 return this.addBlock(a, new CKEDITOR.ui.listBlock(this.getHolderElement(), b)) 17639 }; 17640 CKEDITOR.ui.listBlock = CKEDITOR.tools.createClass({ 17641 base: CKEDITOR.ui.panel.block, 17642 $: function(a, b) { 17643 b = b || {}; 17644 var c = b.attributes || (b.attributes = {}); 17645 (this.multiSelect = !!b.multiSelect) && (c["aria-multiselectable"] = !0); 17646 !c.role && 17647 (c.role = "listbox"); 17648 this.base.apply(this, arguments); 17649 this.element.setAttribute("role", c.role); 17650 c = this.keys; 17651 c[40] = "next"; 17652 c[9] = "next"; 17653 c[38] = "prev"; 17654 c[CKEDITOR.SHIFT + 9] = "prev"; 17655 c[32] = CKEDITOR.env.ie ? "mouseup" : "click"; 17656 CKEDITOR.env.ie && (c[13] = "mouseup"); 17657 this._.pendingHtml = []; 17658 this._.pendingList = []; 17659 this._.items = {}; 17660 this._.groups = {} 17661 }, 17662 _: { 17663 close: function() { 17664 if (this._.started) { 17665 var a = f.output({ 17666 items: this._.pendingList.join("") 17667 }); 17668 this._.pendingList = []; 17669 this._.pendingHtml.push(a); 17670 delete this._.started 17671 } 17672 }, 17673 getClick: function() { 17674 this._.click || 17675 (this._.click = CKEDITOR.tools.addFunction(function(a) { 17676 var b = this.toggle(a); 17677 if (this.onClick) this.onClick(a, b) 17678 }, this)); 17679 return this._.click 17680 } 17681 }, 17682 proto: { 17683 add: function(a, b, c) { 17684 var d = CKEDITOR.tools.getNextId(); 17685 this._.started || (this._.started = 1, this._.size = this._.size || 0); 17686 this._.items[a] = d; 17687 var e; 17688 e = CKEDITOR.tools.htmlEncodeAttr(a).replace(k, "\\'"); 17689 a = { 17690 id: d, 17691 val: e, 17692 onclick: CKEDITOR.env.ie ? 'onclick\x3d"return false;" onmouseup' : "onclick", 17693 clickFn: this._.getClick(), 17694 title: CKEDITOR.tools.htmlEncodeAttr(c || a), 17695 text: b || a 17696 }; 17697 this._.pendingList.push(g.output(a)) 17698 }, 17699 startGroup: function(a) { 17700 this._.close(); 17701 var b = CKEDITOR.tools.getNextId(); 17702 this._.groups[a] = b; 17703 this._.pendingHtml.push(h.output({ 17704 id: b, 17705 label: a 17706 })) 17707 }, 17708 commit: function() { 17709 this._.close(); 17710 this.element.appendHtml(this._.pendingHtml.join("")); 17711 delete this._.size; 17712 this._.pendingHtml = [] 17713 }, 17714 toggle: function(a) { 17715 var b = this.isMarked(a); 17716 b ? this.unmark(a) : this.mark(a); 17717 return !b 17718 }, 17719 hideGroup: function(a) { 17720 var b = (a = this.element.getDocument().getById(this._.groups[a])) && a.getNext(); 17721 a && (a.setStyle("display", 17722 "none"), b && "ul" == b.getName() && b.setStyle("display", "none")) 17723 }, 17724 hideItem: function(a) { 17725 this.element.getDocument().getById(this._.items[a]).setStyle("display", "none") 17726 }, 17727 showAll: function() { 17728 var a = this._.items, 17729 b = this._.groups, 17730 c = this.element.getDocument(), 17731 d; 17732 for (d in a) c.getById(a[d]).setStyle("display", ""); 17733 for (var e in b) a = c.getById(b[e]), d = a.getNext(), a.setStyle("display", ""), d && "ul" == d.getName() && d.setStyle("display", "") 17734 }, 17735 mark: function(a) { 17736 this.multiSelect || this.unmarkAll(); 17737 a = this._.items[a]; 17738 var b = this.element.getDocument().getById(a); 17739 b.addClass("cke_selected"); 17740 this.element.getDocument().getById(a + "_option").setAttribute("aria-selected", !0); 17741 this.onMark && this.onMark(b) 17742 }, 17743 markFirstDisplayed: function() { 17744 var a = this; 17745 this._.markFirstDisplayed(function() { 17746 a.multiSelect || a.unmarkAll() 17747 }) 17748 }, 17749 unmark: function(a) { 17750 var b = this.element.getDocument(); 17751 a = this._.items[a]; 17752 var c = b.getById(a); 17753 c.removeClass("cke_selected"); 17754 b.getById(a + "_option").removeAttribute("aria-selected"); 17755 this.onUnmark && this.onUnmark(c) 17756 }, 17757 unmarkAll: function() { 17758 var a = this._.items, 17759 b = this.element.getDocument(), 17760 c; 17761 for (c in a) { 17762 var d = a[c]; 17763 b.getById(d).removeClass("cke_selected"); 17764 b.getById(d + "_option").removeAttribute("aria-selected") 17765 } 17766 this.onUnmark && this.onUnmark() 17767 }, 17768 isMarked: function(a) { 17769 return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected") 17770 }, 17771 focus: function(a) { 17772 this._.focusIndex = -1; 17773 var b = this.element.getElementsByTag("a"), 17774 c, d = -1; 17775 if (a) 17776 for (c = this.element.getDocument().getById(this._.items[a]).getFirst(); a = b.getItem(++d);) { 17777 if (a.equals(c)) { 17778 this._.focusIndex = d; 17779 break 17780 } 17781 } else this.element.focus(); 17782 c && setTimeout(function() { 17783 c.focus() 17784 }, 0) 17785 } 17786 } 17787 }) 17788 } 17789 }); 17790 CKEDITOR.plugins.add("richcombo", { 17791 requires: "floatpanel,listblock,button", 17792 beforeInit: function(c) { 17793 c.ui.addHandler(CKEDITOR.UI_RICHCOMBO, CKEDITOR.ui.richCombo.handler) 17794 } 17795 }); 17796 (function() { 17797 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"'; 17798 CKEDITOR.env.gecko && CKEDITOR.env.mac && (c += ' onkeypress\x3d"return false;"'); 17799 CKEDITOR.env.gecko && (c += ' onblur\x3d"this.style.cssText \x3d this.style.cssText;"'); 17800 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' + 17801 (CKEDITOR.env.hc ? "\x26#9660;" : CKEDITOR.env.air ? "\x26nbsp;" : "") + "\x3c/span\x3e\x3c/span\x3e\x3c/a\x3e\x3c/span\x3e"), 17802 k = CKEDITOR.addTemplate("combo", c); 17803 CKEDITOR.UI_RICHCOMBO = "richcombo"; 17804 CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass({ 17805 $: function(a) { 17806 CKEDITOR.tools.extend(this, a, { 17807 canGroup: !1, 17808 title: a.label, 17809 modes: { 17810 wysiwyg: 1 17811 }, 17812 editorFocus: 1 17813 }); 17814 a = this.panel || {}; 17815 delete this.panel; 17816 this.id = CKEDITOR.tools.getNextNumber(); 17817 this.document = a.parent && a.parent.getDocument() || CKEDITOR.document; 17818 a.className = "cke_combopanel"; 17819 a.block = { 17820 multiSelect: a.multiSelect, 17821 attributes: a.attributes 17822 }; 17823 a.toolbarRelated = !0; 17824 this._ = { 17825 panelDefinition: a, 17826 items: {} 17827 } 17828 }, 17829 proto: { 17830 renderHtml: function(a) { 17831 var b = []; 17832 this.render(a, b); 17833 return b.join("") 17834 }, 17835 render: function(a, b) { 17836 function f() { 17837 if (this.getState() != CKEDITOR.TRISTATE_ON) { 17838 var b = this.modes[a.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED; 17839 a.readOnly && !this.readOnly && (b = CKEDITOR.TRISTATE_DISABLED); 17840 this.setState(b); 17841 this.setValue(""); 17842 b != CKEDITOR.TRISTATE_DISABLED && this.refresh && this.refresh() 17843 } 17844 } 17845 var c = 17846 CKEDITOR.env, 17847 h = "cke_" + this.id, 17848 e = CKEDITOR.tools.addFunction(function(b) { 17849 l && (a.unlockSelection(1), l = 0); 17850 g.execute(b) 17851 }, this), 17852 d = this, 17853 g = { 17854 id: h, 17855 combo: this, 17856 focus: function() { 17857 CKEDITOR.document.getById(h).getChild(1).focus() 17858 }, 17859 execute: function(b) { 17860 var c = d._; 17861 if (c.state != CKEDITOR.TRISTATE_DISABLED) 17862 if (d.createPanel(a), c.on) c.panel.hide(); 17863 else { 17864 d.commit(); 17865 var f = d.getValue(); 17866 f ? c.list.mark(f) : c.list.unmarkAll(); 17867 c.panel.showBlock(d.id, new CKEDITOR.dom.element(b), 4) 17868 } 17869 }, 17870 clickFn: e 17871 }; 17872 a.on("activeFilterChange", f, this); 17873 a.on("mode", 17874 f, this); 17875 a.on("selectionChange", f, this); 17876 !this.readOnly && a.on("readOnly", f, this); 17877 var m = CKEDITOR.tools.addFunction(function(a, b) { 17878 a = new CKEDITOR.dom.event(a); 17879 var d = a.getKeystroke(); 17880 switch (d) { 17881 case 13: 17882 case 32: 17883 case 40: 17884 CKEDITOR.tools.callFunction(e, b); 17885 break; 17886 default: 17887 g.onkey(g, d) 17888 } 17889 a.preventDefault() 17890 }), 17891 n = CKEDITOR.tools.addFunction(function() { 17892 g.onfocus && g.onfocus() 17893 }), 17894 l = 0; 17895 g.keyDownFn = m; 17896 c = { 17897 id: h, 17898 name: this.name || this.command, 17899 label: this.label, 17900 title: this.title, 17901 cls: this.className || "", 17902 titleJs: c.gecko && !c.hc ? "" : (this.title || 17903 "").replace("'", ""), 17904 keydownFn: m, 17905 focusFn: n, 17906 clickFn: e 17907 }; 17908 k.output(c, b); 17909 if (this.onRender) this.onRender(); 17910 return g 17911 }, 17912 createPanel: function(a) { 17913 if (!this._.panel) { 17914 var b = this._.panelDefinition, 17915 c = this._.panelDefinition.block, 17916 k = b.parent || CKEDITOR.document.getBody(), 17917 h = "cke_combopanel__" + this.name, 17918 e = new CKEDITOR.ui.floatPanel(a, k, b), 17919 b = e.addListBlock(this.id, c), 17920 d = this; 17921 e.onShow = function() { 17922 this.element.addClass(h); 17923 d.setState(CKEDITOR.TRISTATE_ON); 17924 d._.on = 1; 17925 d.editorFocus && !a.focusManager.hasFocus && a.focus(); 17926 if (d.onOpen) d.onOpen() 17927 }; 17928 e.onHide = function(b) { 17929 this.element.removeClass(h); 17930 d.setState(d.modes && d.modes[a.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED); 17931 d._.on = 0; 17932 if (!b && d.onClose) d.onClose() 17933 }; 17934 e.onEscape = function() { 17935 e.hide(1) 17936 }; 17937 b.onClick = function(a, b) { 17938 d.onClick && d.onClick.call(d, a, b); 17939 e.hide() 17940 }; 17941 this._.panel = e; 17942 this._.list = b; 17943 e.getBlock(this.id).onHide = function() { 17944 d._.on = 0; 17945 d.setState(CKEDITOR.TRISTATE_OFF) 17946 }; 17947 this.init && this.init() 17948 } 17949 }, 17950 setValue: function(a, b) { 17951 this._.value = a; 17952 var c = this.document.getById("cke_" + this.id + "_text"); 17953 c && 17954 (a || b ? c.removeClass("cke_combo_inlinelabel") : (b = this.label, c.addClass("cke_combo_inlinelabel")), c.setText("undefined" != typeof b ? b : a)) 17955 }, 17956 getValue: function() { 17957 return this._.value || "" 17958 }, 17959 unmarkAll: function() { 17960 this._.list.unmarkAll() 17961 }, 17962 mark: function(a) { 17963 this._.list.mark(a) 17964 }, 17965 hideItem: function(a) { 17966 this._.list.hideItem(a) 17967 }, 17968 hideGroup: function(a) { 17969 this._.list.hideGroup(a) 17970 }, 17971 showAll: function() { 17972 this._.list.showAll() 17973 }, 17974 add: function(a, b, c) { 17975 this._.items[a] = c || a; 17976 this._.list.add(a, b, c) 17977 }, 17978 startGroup: function(a) { 17979 this._.list.startGroup(a) 17980 }, 17981 commit: function() { 17982 this._.committed || (this._.list.commit(), this._.committed = 1, CKEDITOR.ui.fire("ready", this)); 17983 this._.committed = 1 17984 }, 17985 setState: function(a) { 17986 if (this._.state != a) { 17987 var b = this.document.getById("cke_" + this.id); 17988 b.setState(a, "cke_combo"); 17989 a == CKEDITOR.TRISTATE_DISABLED ? b.setAttribute("aria-disabled", !0) : b.removeAttribute("aria-disabled"); 17990 this._.state = a 17991 } 17992 }, 17993 getState: function() { 17994 return this._.state 17995 }, 17996 enable: function() { 17997 this._.state == CKEDITOR.TRISTATE_DISABLED && this.setState(this._.lastState) 17998 }, 17999 disable: function() { 18000 this._.state != 18001 CKEDITOR.TRISTATE_DISABLED && (this._.lastState = this._.state, this.setState(CKEDITOR.TRISTATE_DISABLED)) 18002 } 18003 }, 18004 statics: { 18005 handler: { 18006 create: function(a) { 18007 return new CKEDITOR.ui.richCombo(a) 18008 } 18009 } 18010 } 18011 }); 18012 CKEDITOR.ui.prototype.addRichCombo = function(a, b) { 18013 this.add(a, CKEDITOR.UI_RICHCOMBO, b) 18014 } 18015 })(); 18016 (function() { 18017 function p(b, f, e, d, r, p, t, x) { 18018 var y = b.config, 18019 u = new CKEDITOR.style(t), 18020 g = r.split(";"); 18021 r = []; 18022 for (var k = {}, l = 0; l < g.length; l++) { 18023 var m = g[l]; 18024 if (m) { 18025 var m = m.split("/"), 18026 w = {}, 18027 q = g[l] = m[0]; 18028 w[e] = r[l] = m[1] || q; 18029 k[q] = new CKEDITOR.style(t, w); 18030 k[q]._.definition.name = q 18031 } else g.splice(l--, 1) 18032 } 18033 b.ui.addRichCombo(f, { 18034 label: d.label, 18035 title: d.panelTitle, 18036 toolbar: "styles," + x, 18037 defaultValue: "cke-default", 18038 allowedContent: u, 18039 requiredContent: u, 18040 contentTransformations: "span" === t.element ? [ 18041 [{ 18042 element: "font", 18043 check: "span", 18044 left: function(a) { 18045 return !!a.attributes.size || 18046 !!a.attributes.align || !!a.attributes.face 18047 }, 18048 right: function(a) { 18049 var b = " x-small small medium large x-large xx-large 48px".split(" "); 18050 a.name = "span"; 18051 a.attributes.size && (a.styles["font-size"] = b[a.attributes.size], delete a.attributes.size); 18052 a.attributes.align && (a.styles["text-align"] = a.attributes.align, delete a.attributes.align); 18053 a.attributes.face && (a.styles["font-family"] = a.attributes.face, delete a.attributes.face) 18054 } 18055 }] 18056 ] : null, 18057 panel: { 18058 css: [CKEDITOR.skin.getPath("editor")].concat(y.contentsCss), 18059 multiSelect: !1, 18060 attributes: { 18061 "aria-label": d.panelTitle 18062 } 18063 }, 18064 init: function() { 18065 var a; 18066 a = "(" + b.lang.common.optionDefault + ")"; 18067 this.startGroup(d.panelTitle); 18068 this.add(this.defaultValue, a, a); 18069 for (var c = 0; c < g.length; c++) a = g[c], this.add(a, k[a].buildPreview(), a) 18070 }, 18071 onClick: function(a) { 18072 b.focus(); 18073 b.fire("saveSnapshot"); 18074 var c = this.getValue(), 18075 f = k[a], 18076 e, n, h, d, g; 18077 if (c && a != c) 18078 if (e = k[c], c = b.getSelection().getRanges()[0], c.collapsed) { 18079 if (n = b.elementPath(), h = n.contains(function(a) { 18080 return e.checkElementRemovable(a) 18081 })) { 18082 d = c.checkBoundaryOfElement(h, 18083 CKEDITOR.START); 18084 g = c.checkBoundaryOfElement(h, CKEDITOR.END); 18085 if (d && g) { 18086 for (d = c.createBookmark(); n = h.getFirst();) n.insertBefore(h); 18087 h.remove(); 18088 c.moveToBookmark(d) 18089 } 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); 18090 b.getSelection().selectRanges([c]) 18091 } 18092 } else b.removeStyle(e); 18093 a === this.defaultValue ? e && b.removeStyle(e) : b.applyStyle(f); 18094 b.fire("saveSnapshot") 18095 }, 18096 onRender: function() { 18097 b.on("selectionChange", 18098 function(a) { 18099 var c = this.getValue(); 18100 a = a.data.path.elements; 18101 for (var d = 0, f; d < a.length; d++) { 18102 f = a[d]; 18103 for (var e in k) 18104 if (k[e].checkElementMatch(f, !0, b)) { 18105 e != c && this.setValue(e); 18106 return 18107 } 18108 } 18109 this.setValue("", p) 18110 }, this) 18111 }, 18112 refresh: function() { 18113 b.activeFilter.check(u) || this.setState(CKEDITOR.TRISTATE_DISABLED) 18114 } 18115 }) 18116 } 18117 18118 function v(b, f, e) { 18119 var d = f.pop(); 18120 if (d) { 18121 if (e) return v(b, f, d.equals(e) ? null : e); 18122 e = d.clone(); 18123 b.insertNode(e); 18124 b.moveToPosition(e, CKEDITOR.POSITION_AFTER_START); 18125 v(b, f) 18126 } 18127 } 18128 CKEDITOR.plugins.add("font", { 18129 requires: "richcombo", 18130 init: function(b) { 18131 var f = b.config; 18132 p(b, "Font", "family", b.lang.font, f.font_names, f.font_defaultLabel, f.font_style, 30); 18133 p(b, "FontSize", "size", b.lang.font.fontSize, f.fontSize_sizes, f.fontSize_defaultLabel, f.fontSize_style, 40) 18134 } 18135 }) 18136 })(); 18137 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"; 18138 CKEDITOR.config.font_defaultLabel = ""; 18139 CKEDITOR.config.font_style = { 18140 element: "span", 18141 styles: { 18142 "font-family": "#(family)" 18143 }, 18144 overrides: [{ 18145 element: "font", 18146 attributes: { 18147 face: null 18148 } 18149 }] 18150 }; 18151 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"; 18152 CKEDITOR.config.fontSize_defaultLabel = ""; 18153 CKEDITOR.config.fontSize_style = { 18154 element: "span", 18155 styles: { 18156 "font-size": "#(size)" 18157 }, 18158 overrides: [{ 18159 element: "font", 18160 attributes: { 18161 size: null 18162 } 18163 }] 18164 }; 18165 CKEDITOR.plugins.add("forms", { 18166 requires: "dialog,fakeobjects", 18167 onLoad: function() { 18168 CKEDITOR.addCss(".cke_editable form{border: 1px dotted #FF0000;padding: 2px;}\n"); 18169 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;}") 18170 }, 18171 init: function(a) { 18172 var b = a.lang, 18173 g = 0, 18174 h = { 18175 email: 1, 18176 password: 1, 18177 search: 1, 18178 tel: 1, 18179 text: 1, 18180 url: 1 18181 }, 18182 l = { 18183 checkbox: "input[type,name,checked,required]", 18184 radio: "input[type,name,checked,required]", 18185 textfield: "input[type,name,value,size,maxlength,required]", 18186 textarea: "textarea[cols,rows,name,required]", 18187 select: "select[name,size,multiple,required]; option[value,selected]", 18188 button: "input[type,name,value]", 18189 form: "form[action,name,id,enctype,target,method]", 18190 hiddenfield: "input[type,name,value]", 18191 imagebutton: "input[type,alt,src]{width,height,border,border-width,border-style,margin,float}" 18192 }, 18193 m = { 18194 checkbox: "input", 18195 radio: "input", 18196 textfield: "input", 18197 textarea: "textarea", 18198 select: "select", 18199 button: "input", 18200 form: "form", 18201 hiddenfield: "input", 18202 imagebutton: "input" 18203 }, 18204 e = function(d, c, e) { 18205 var h = { 18206 allowedContent: l[c], 18207 requiredContent: m[c] 18208 }; 18209 "form" == c && (h.context = "form"); 18210 a.addCommand(c, new CKEDITOR.dialogCommand(c, h)); 18211 a.ui.addButton && a.ui.addButton(d, { 18212 label: b.common[d.charAt(0).toLowerCase() + d.slice(1)], 18213 command: c, 18214 toolbar: "forms," + (g += 10) 18215 }); 18216 CKEDITOR.dialog.add(c, e) 18217 }, 18218 f = this.path + "dialogs/"; 18219 !a.blockless && e("Form", "form", f + "form.js"); 18220 e("Checkbox", "checkbox", f + "checkbox.js"); 18221 e("Radio", "radio", 18222 f + "radio.js"); 18223 e("TextField", "textfield", f + "textfield.js"); 18224 e("Textarea", "textarea", f + "textarea.js"); 18225 e("Select", "select", f + "select.js"); 18226 e("Button", "button", f + "button.js"); 18227 var k = a.plugins.image; 18228 k && !a.plugins.image2 && e("ImageButton", "imagebutton", CKEDITOR.plugins.getPath("image") + "dialogs/image.js"); 18229 e("HiddenField", "hiddenfield", f + "hiddenfield.js"); 18230 a.addMenuItems && (e = { 18231 checkbox: { 18232 label: b.forms.checkboxAndRadio.checkboxTitle, 18233 command: "checkbox", 18234 group: "checkbox" 18235 }, 18236 radio: { 18237 label: b.forms.checkboxAndRadio.radioTitle, 18238 command: "radio", 18239 group: "radio" 18240 }, 18241 textfield: { 18242 label: b.forms.textfield.title, 18243 command: "textfield", 18244 group: "textfield" 18245 }, 18246 hiddenfield: { 18247 label: b.forms.hidden.title, 18248 command: "hiddenfield", 18249 group: "hiddenfield" 18250 }, 18251 button: { 18252 label: b.forms.button.title, 18253 command: "button", 18254 group: "button" 18255 }, 18256 select: { 18257 label: b.forms.select.title, 18258 command: "select", 18259 group: "select" 18260 }, 18261 textarea: { 18262 label: b.forms.textarea.title, 18263 command: "textarea", 18264 group: "textarea" 18265 } 18266 }, k && (e.imagebutton = { 18267 label: b.image.titleButton, 18268 command: "imagebutton", 18269 group: "imagebutton" 18270 }), !a.blockless && 18271 (e.form = { 18272 label: b.forms.form.menu, 18273 command: "form", 18274 group: "form" 18275 }), a.addMenuItems(e)); 18276 a.contextMenu && (!a.blockless && a.contextMenu.addListener(function(d, c, a) { 18277 if ((d = a.contains("form", 1)) && !d.isReadOnly()) return { 18278 form: CKEDITOR.TRISTATE_OFF 18279 } 18280 }), a.contextMenu.addListener(function(d) { 18281 if (d && !d.isReadOnly()) { 18282 var c = d.getName(); 18283 if ("select" == c) return { 18284 select: CKEDITOR.TRISTATE_OFF 18285 }; 18286 if ("textarea" == c) return { 18287 textarea: CKEDITOR.TRISTATE_OFF 18288 }; 18289 if ("input" == c) { 18290 var a = d.getAttribute("type") || "text"; 18291 switch (a) { 18292 case "button": 18293 case "submit": 18294 case "reset": 18295 return { 18296 button: CKEDITOR.TRISTATE_OFF 18297 }; 18298 case "checkbox": 18299 return { 18300 checkbox: CKEDITOR.TRISTATE_OFF 18301 }; 18302 case "radio": 18303 return { 18304 radio: CKEDITOR.TRISTATE_OFF 18305 }; 18306 case "image": 18307 return k ? { 18308 imagebutton: CKEDITOR.TRISTATE_OFF 18309 } : null 18310 } 18311 if (h[a]) return { 18312 textfield: CKEDITOR.TRISTATE_OFF 18313 } 18314 } 18315 if ("img" == c && "hiddenfield" == d.data("cke-real-element-type")) return { 18316 hiddenfield: CKEDITOR.TRISTATE_OFF 18317 } 18318 } 18319 })); 18320 a.on("doubleclick", function(d) { 18321 var c = d.data.element; 18322 if (!a.blockless && c.is("form")) d.data.dialog = "form"; 18323 else if (c.is("select")) d.data.dialog = "select"; 18324 else if (c.is("textarea")) d.data.dialog = 18325 "textarea"; 18326 else if (c.is("img") && "hiddenfield" == c.data("cke-real-element-type")) d.data.dialog = "hiddenfield"; 18327 else if (c.is("input")) { 18328 c = c.getAttribute("type") || "text"; 18329 switch (c) { 18330 case "button": 18331 case "submit": 18332 case "reset": 18333 d.data.dialog = "button"; 18334 break; 18335 case "checkbox": 18336 d.data.dialog = "checkbox"; 18337 break; 18338 case "radio": 18339 d.data.dialog = "radio"; 18340 break; 18341 case "image": 18342 d.data.dialog = "imagebutton" 18343 } 18344 h[c] && (d.data.dialog = "textfield") 18345 } 18346 }) 18347 }, 18348 afterInit: function(a) { 18349 var b = a.dataProcessor, 18350 g = b && b.htmlFilter, 18351 b = b && b.dataFilter; 18352 CKEDITOR.env.ie && 18353 g && g.addRules({ 18354 elements: { 18355 input: function(a) { 18356 a = a.attributes; 18357 var b = a.type; 18358 b || (a.type = "text"); 18359 "checkbox" != b && "radio" != b || "on" != a.value || delete a.value 18360 } 18361 } 18362 }, { 18363 applyToAll: !0 18364 }); 18365 b && b.addRules({ 18366 elements: { 18367 input: function(b) { 18368 if ("hidden" == b.attributes.type) return a.createFakeParserElement(b, "cke_hidden", "hiddenfield") 18369 } 18370 } 18371 }, { 18372 applyToAll: !0 18373 }) 18374 } 18375 }); 18376 CKEDITOR.plugins.add("format", { 18377 requires: "richcombo", 18378 init: function(a) { 18379 if (!a.blockless) { 18380 for (var f = a.config, c = a.lang.format, l = f.format_tags.split(";"), d = {}, m = 0, n = [], g = 0; g < l.length; g++) { 18381 var h = l[g], 18382 k = new CKEDITOR.style(f["format_" + h]); 18383 if (!a.filter.customConfig || a.filter.check(k)) m++, d[h] = k, d[h]._.enterMode = a.config.enterMode, n.push(k) 18384 } 18385 0 !== m && a.ui.addRichCombo("Format", { 18386 label: c.label, 18387 title: c.panelTitle, 18388 toolbar: "styles,20", 18389 allowedContent: n, 18390 panel: { 18391 css: [CKEDITOR.skin.getPath("editor")].concat(f.contentsCss), 18392 multiSelect: !1, 18393 attributes: { 18394 "aria-label": c.panelTitle 18395 } 18396 }, 18397 init: function() { 18398 this.startGroup(c.panelTitle); 18399 for (var a in d) { 18400 var e = c["tag_" + a]; 18401 this.add(a, d[a].buildPreview(e), e) 18402 } 18403 }, 18404 onClick: function(b) { 18405 a.focus(); 18406 a.fire("saveSnapshot"); 18407 b = d[b]; 18408 var e = a.elementPath(); 18409 b.checkActive(e, a) || a.applyStyle(b); 18410 setTimeout(function() { 18411 a.fire("saveSnapshot") 18412 }, 0) 18413 }, 18414 onRender: function() { 18415 a.on("selectionChange", function(b) { 18416 var e = this.getValue(); 18417 b = b.data.path; 18418 this.refresh(); 18419 for (var c in d) 18420 if (d[c].checkActive(b, a)) { 18421 c != e && this.setValue(c, 18422 a.lang.format["tag_" + c]); 18423 return 18424 } this.setValue("") 18425 }, this) 18426 }, 18427 onOpen: function() { 18428 this.showAll(); 18429 for (var b in d) a.activeFilter.check(d[b]) || this.hideItem(b) 18430 }, 18431 refresh: function() { 18432 var b = a.elementPath(); 18433 if (b) { 18434 if (b.isContextFor("p")) 18435 for (var c in d) 18436 if (a.activeFilter.check(d[c])) return; 18437 this.setState(CKEDITOR.TRISTATE_DISABLED) 18438 } 18439 } 18440 }) 18441 } 18442 } 18443 }); 18444 CKEDITOR.config.format_tags = "p;h1;h2;h3;h4;h5;h6;pre;address;div"; 18445 CKEDITOR.config.format_p = { 18446 element: "p" 18447 }; 18448 CKEDITOR.config.format_div = { 18449 element: "div" 18450 }; 18451 CKEDITOR.config.format_pre = { 18452 element: "pre" 18453 }; 18454 CKEDITOR.config.format_address = { 18455 element: "address" 18456 }; 18457 CKEDITOR.config.format_h1 = { 18458 element: "h1" 18459 }; 18460 CKEDITOR.config.format_h2 = { 18461 element: "h2" 18462 }; 18463 CKEDITOR.config.format_h3 = { 18464 element: "h3" 18465 }; 18466 CKEDITOR.config.format_h4 = { 18467 element: "h4" 18468 }; 18469 CKEDITOR.config.format_h5 = { 18470 element: "h5" 18471 }; 18472 CKEDITOR.config.format_h6 = { 18473 element: "h6" 18474 }; 18475 (function() { 18476 var b = { 18477 canUndo: !1, 18478 exec: function(a) { 18479 var b = a.document.createElement("hr"); 18480 a.insertElement(b) 18481 }, 18482 allowedContent: "hr", 18483 requiredContent: "hr" 18484 }; 18485 CKEDITOR.plugins.add("horizontalrule", { 18486 init: function(a) { 18487 a.blockless || (a.addCommand("horizontalrule", b), a.ui.addButton && a.ui.addButton("HorizontalRule", { 18488 label: a.lang.horizontalrule.toolbar, 18489 command: "horizontalrule", 18490 toolbar: "insert,40" 18491 })) 18492 } 18493 }) 18494 })(); 18495 CKEDITOR.plugins.add("htmlwriter", { 18496 init: function(b) { 18497 var a = new CKEDITOR.htmlWriter; 18498 a.forceSimpleAmpersand = b.config.forceSimpleAmpersand; 18499 a.indentationChars = b.config.dataIndentationChars || "\t"; 18500 b.dataProcessor.writer = a 18501 } 18502 }); 18503 CKEDITOR.htmlWriter = CKEDITOR.tools.createClass({ 18504 base: CKEDITOR.htmlParser.basicWriter, 18505 $: function() { 18506 this.base(); 18507 this.indentationChars = "\t"; 18508 this.selfClosingEnd = " /\x3e"; 18509 this.lineBreakChars = "\n"; 18510 this.sortAttributes = 1; 18511 this._.indent = 0; 18512 this._.indentation = ""; 18513 this._.inPre = 0; 18514 this._.rules = {}; 18515 var b = CKEDITOR.dtd, 18516 a; 18517 for (a in CKEDITOR.tools.extend({}, b.$nonBodyContent, b.$block, b.$listItem, b.$tableContent)) this.setRules(a, { 18518 indent: !b[a]["#"], 18519 breakBeforeOpen: 1, 18520 breakBeforeClose: !b[a]["#"], 18521 breakAfterClose: 1, 18522 needsSpace: a in 18523 b.$block && !(a in { 18524 li: 1, 18525 dt: 1, 18526 dd: 1 18527 }) 18528 }); 18529 this.setRules("br", { 18530 breakAfterOpen: 1 18531 }); 18532 this.setRules("title", { 18533 indent: 0, 18534 breakAfterOpen: 0 18535 }); 18536 this.setRules("style", { 18537 indent: 0, 18538 breakBeforeClose: 1 18539 }); 18540 this.setRules("pre", { 18541 breakAfterOpen: 1, 18542 indent: 0 18543 }) 18544 }, 18545 proto: { 18546 openTag: function(b) { 18547 var a = this._.rules[b]; 18548 this._.afterCloser && a && a.needsSpace && this._.needsSpace && this._.output.push("\n"); 18549 this._.indent ? this.indentation() : a && a.breakBeforeOpen && (this.lineBreak(), this.indentation()); 18550 this._.output.push("\x3c", b); 18551 this._.afterCloser = 0 18552 }, 18553 openTagClose: function(b, a) { 18554 var c = this._.rules[b]; 18555 a ? (this._.output.push(this.selfClosingEnd), c && c.breakAfterClose && (this._.needsSpace = c.needsSpace)) : (this._.output.push("\x3e"), c && c.indent && (this._.indentation += this.indentationChars)); 18556 c && c.breakAfterOpen && this.lineBreak(); 18557 "pre" == b && (this._.inPre = 1) 18558 }, 18559 attribute: function(b, a) { 18560 "string" == typeof a && (this.forceSimpleAmpersand && (a = a.replace(/&/g, "\x26")), a = CKEDITOR.tools.htmlEncodeAttr(a)); 18561 this._.output.push(" ", b, '\x3d"', a, '"') 18562 }, 18563 closeTag: function(b) { 18564 var a = 18565 this._.rules[b]; 18566 a && a.indent && (this._.indentation = this._.indentation.substr(this.indentationChars.length)); 18567 this._.indent ? this.indentation() : a && a.breakBeforeClose && (this.lineBreak(), this.indentation()); 18568 this._.output.push("\x3c/", b, "\x3e"); 18569 "pre" == b && (this._.inPre = 0); 18570 a && a.breakAfterClose && (this.lineBreak(), this._.needsSpace = a.needsSpace); 18571 this._.afterCloser = 1 18572 }, 18573 text: function(b) { 18574 this._.indent && (this.indentation(), !this._.inPre && (b = CKEDITOR.tools.ltrim(b))); 18575 this._.output.push(b) 18576 }, 18577 comment: function(b) { 18578 this._.indent && 18579 this.indentation(); 18580 this._.output.push("\x3c!--", b, "--\x3e") 18581 }, 18582 lineBreak: function() { 18583 !this._.inPre && 0 < this._.output.length && this._.output.push(this.lineBreakChars); 18584 this._.indent = 1 18585 }, 18586 indentation: function() { 18587 !this._.inPre && this._.indentation && this._.output.push(this._.indentation); 18588 this._.indent = 0 18589 }, 18590 reset: function() { 18591 this._.output = []; 18592 this._.indent = 0; 18593 this._.indentation = ""; 18594 this._.afterCloser = 0; 18595 this._.inPre = 0; 18596 this._.needsSpace = 0 18597 }, 18598 setRules: function(b, a) { 18599 var c = this._.rules[b]; 18600 c ? CKEDITOR.tools.extend(c, a, !0) : this._.rules[b] = 18601 a 18602 } 18603 } 18604 }); 18605 (function() { 18606 CKEDITOR.plugins.add("iframe", { 18607 requires: "dialog,fakeobjects", 18608 onLoad: function() { 18609 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;}") 18610 }, 18611 init: function(a) { 18612 var b = a.lang.iframe, 18613 c = "iframe[align,longdesc,frameborder,height,name,scrolling,src,title,width]"; 18614 a.plugins.dialogadvtab && (c += ";iframe" + a.plugins.dialogadvtab.allowedContent({ 18615 id: 1, 18616 classes: 1, 18617 styles: 1 18618 })); 18619 CKEDITOR.dialog.add("iframe", this.path + "dialogs/iframe.js"); 18620 a.addCommand("iframe", new CKEDITOR.dialogCommand("iframe", { 18621 allowedContent: c, 18622 requiredContent: "iframe" 18623 })); 18624 a.ui.addButton && a.ui.addButton("Iframe", { 18625 label: b.toolbar, 18626 command: "iframe", 18627 toolbar: "insert,80" 18628 }); 18629 a.on("doubleclick", function(a) { 18630 var b = a.data.element; 18631 b.is("img") && "iframe" == b.data("cke-real-element-type") && (a.data.dialog = "iframe") 18632 }); 18633 a.addMenuItems && a.addMenuItems({ 18634 iframe: { 18635 label: b.title, 18636 command: "iframe", 18637 group: "image" 18638 } 18639 }); 18640 a.contextMenu && a.contextMenu.addListener(function(a) { 18641 if (a && a.is("img") && "iframe" == a.data("cke-real-element-type")) return { 18642 iframe: CKEDITOR.TRISTATE_OFF 18643 } 18644 }) 18645 }, 18646 afterInit: function(a) { 18647 var b = a.dataProcessor; 18648 (b = b && b.dataFilter) && b.addRules({ 18649 elements: { 18650 iframe: function(b) { 18651 return a.createFakeParserElement(b, "cke_iframe", "iframe", !0) 18652 } 18653 } 18654 }) 18655 } 18656 }) 18657 })(); 18658 (function() { 18659 function m(a) { 18660 function f(a) { 18661 var b = !1; 18662 g.attachListener(g, "keydown", function() { 18663 var d = c.getBody().getElementsByTag(a); 18664 if (!b) { 18665 for (var e = 0; e < d.count(); e++) d.getItem(e).setCustomData("retain", !0); 18666 b = !0 18667 } 18668 }, null, null, 1); 18669 g.attachListener(g, "keyup", function() { 18670 var d = c.getElementsByTag(a); 18671 b && (1 == d.count() && !d.getItem(0).getCustomData("retain") && CKEDITOR.tools.isEmpty(d.getItem(0).getAttributes()) && d.getItem(0).remove(1), b = !1) 18672 }) 18673 } 18674 var b = this.editor, 18675 c = a.document, 18676 d = c.body, 18677 e = c.getElementById("cke_actscrpt"); 18678 e && e.parentNode.removeChild(e); 18679 (e = c.getElementById("cke_shimscrpt")) && e.parentNode.removeChild(e); 18680 (e = c.getElementById("cke_basetagscrpt")) && e.parentNode.removeChild(e); 18681 d.contentEditable = !0; 18682 CKEDITOR.env.ie && (d.hideFocus = !0, d.disabled = !0, d.removeAttribute("disabled")); 18683 delete this._.isLoadingData; 18684 this.$ = d; 18685 c = new CKEDITOR.dom.document(c); 18686 this.setup(); 18687 this.fixInitialSelection(); 18688 var g = this; 18689 CKEDITOR.env.ie && !CKEDITOR.env.edge && c.getDocumentElement().addClass(c.$.compatMode); 18690 CKEDITOR.env.ie && !CKEDITOR.env.edge && 18691 b.enterMode != CKEDITOR.ENTER_P ? f("p") : CKEDITOR.env.edge && 15 > CKEDITOR.env.version && b.enterMode != CKEDITOR.ENTER_DIV && f("div"); 18692 if (CKEDITOR.env.webkit || CKEDITOR.env.ie && 10 < CKEDITOR.env.version) c.getDocumentElement().on("mousedown", function(a) { 18693 a.data.getTarget().is("html") && setTimeout(function() { 18694 b.editable().focus() 18695 }) 18696 }); 18697 n(b); 18698 try { 18699 b.document.$.execCommand("2D-position", !1, !0) 18700 } catch (h) {}(CKEDITOR.env.gecko || CKEDITOR.env.ie && "CSS1Compat" == b.document.$.compatMode) && this.attachListener(this, "keydown", function(a) { 18701 var c = 18702 a.data.getKeystroke(); 18703 if (33 == c || 34 == c) 18704 if (CKEDITOR.env.ie) setTimeout(function() { 18705 b.getSelection().scrollIntoView() 18706 }, 0); 18707 else if (b.window.$.innerHeight > this.$.offsetHeight) { 18708 var d = b.createRange(); 18709 d[33 == c ? "moveToElementEditStart" : "moveToElementEditEnd"](this); 18710 d.select(); 18711 a.data.preventDefault() 18712 } 18713 }); 18714 CKEDITOR.env.ie && this.attachListener(c, "blur", function() { 18715 try { 18716 c.$.selection.empty() 18717 } catch (a) {} 18718 }); 18719 CKEDITOR.env.iOS && this.attachListener(c, "touchend", function() { 18720 a.focus() 18721 }); 18722 d = b.document.getElementsByTag("title").getItem(0); 18723 d.data("cke-title", d.getText()); 18724 CKEDITOR.env.ie && (b.document.$.title = this._.docTitle); 18725 CKEDITOR.tools.setTimeout(function() { 18726 "unloaded" == this.status && (this.status = "ready"); 18727 b.fire("contentDom"); 18728 this._.isPendingFocus && (b.focus(), this._.isPendingFocus = !1); 18729 setTimeout(function() { 18730 b.fire("dataReady") 18731 }, 0) 18732 }, 0, this) 18733 } 18734 18735 function n(a) { 18736 function f() { 18737 var c; 18738 a.editable().attachListener(a, "selectionChange", function() { 18739 var d = a.getSelection().getSelectedElement(); 18740 d && (c && (c.detachEvent("onresizestart", b), c = null), d.$.attachEvent("onresizestart", 18741 b), c = d.$) 18742 }) 18743 } 18744 18745 function b(a) { 18746 a.returnValue = !1 18747 } 18748 if (CKEDITOR.env.gecko) try { 18749 var c = a.document.$; 18750 c.execCommand("enableObjectResizing", !1, !a.config.disableObjectResizing); 18751 c.execCommand("enableInlineTableEditing", !1, !a.config.disableNativeTableHandles) 18752 } catch (d) {} else CKEDITOR.env.ie && 11 > CKEDITOR.env.version && a.config.disableObjectResizing && f(a) 18753 } 18754 18755 function p() { 18756 var a = []; 18757 if (8 <= CKEDITOR.document.$.documentMode) { 18758 a.push("html.CSS1Compat [contenteditable\x3dfalse]{min-height:0 !important}"); 18759 var f = [], 18760 b; 18761 for (b in CKEDITOR.dtd.$removeEmpty) f.push("html.CSS1Compat " + 18762 b + "[contenteditable\x3dfalse]"); 18763 a.push(f.join(",") + "{display:inline-block}") 18764 } 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}")); 18765 a.push("html{cursor:text;*cursor:auto}"); 18766 a.push("img,input,textarea{cursor:default}"); 18767 return a.join("\n") 18768 } 18769 var l; 18770 CKEDITOR.plugins.add("wysiwygarea", { 18771 init: function(a) { 18772 a.config.fullPage && a.addFeature({ 18773 allowedContent: "html head title; style [media,type]; body (*)[id]; meta link [*]", 18774 requiredContent: "body" 18775 }); 18776 a.addMode("wysiwyg", function(f) { 18777 function b(b) { 18778 b && b.removeListener(); 18779 a.editable(new l(a, d.$.contentWindow.document.body)); 18780 a.setData(a.getData(1), f) 18781 } 18782 var c = "document.open();" + (CKEDITOR.env.ie ? "(" + CKEDITOR.tools.fixDomain + ")();" : "") + "document.close();", 18783 c = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie && !CKEDITOR.env.edge ? "javascript:void(function(){" + encodeURIComponent(c) + "}())" : "", 18784 d = CKEDITOR.dom.element.createFromHtml('\x3ciframe src\x3d"' + c + '" frameBorder\x3d"0"\x3e\x3c/iframe\x3e'); 18785 d.setStyles({ 18786 width: "100%", 18787 height: "100%" 18788 }); 18789 d.addClass("cke_wysiwyg_frame").addClass("cke_reset"); 18790 c = a.ui.space("contents"); 18791 c.append(d); 18792 var e = CKEDITOR.env.ie && !CKEDITOR.env.edge || CKEDITOR.env.gecko; 18793 if (e) d.on("load", b); 18794 var g = a.title, 18795 h = a.fire("ariaEditorHelpLabel", {}).label; 18796 g && (CKEDITOR.env.ie && h && (g += ", " + h), d.setAttribute("title", g)); 18797 if (h) { 18798 var g = CKEDITOR.tools.getNextId(), 18799 k = CKEDITOR.dom.element.createFromHtml('\x3cspan id\x3d"' + g + '" class\x3d"cke_voice_label"\x3e' + h + "\x3c/span\x3e"); 18800 c.append(k, 1); 18801 d.setAttribute("aria-describedby", 18802 g) 18803 } 18804 a.on("beforeModeUnload", function(a) { 18805 a.removeListener(); 18806 k && k.remove() 18807 }); 18808 d.setAttributes({ 18809 tabIndex: a.tabIndex, 18810 allowTransparency: "true" 18811 }); 18812 !e && b(); 18813 a.fire("ariaWidget", d) 18814 }) 18815 } 18816 }); 18817 CKEDITOR.editor.prototype.addContentsCss = function(a) { 18818 var f = this.config, 18819 b = f.contentsCss; 18820 CKEDITOR.tools.isArray(b) || (f.contentsCss = b ? [b] : []); 18821 f.contentsCss.push(a) 18822 }; 18823 l = CKEDITOR.tools.createClass({ 18824 $: function() { 18825 this.base.apply(this, arguments); 18826 this._.frameLoadedHandler = CKEDITOR.tools.addFunction(function(a) { 18827 CKEDITOR.tools.setTimeout(m, 18828 0, this, a) 18829 }, this); 18830 this._.docTitle = this.getWindow().getFrame().getAttribute("title") 18831 }, 18832 base: CKEDITOR.editable, 18833 proto: { 18834 setData: function(a, f) { 18835 var b = this.editor; 18836 if (f) this.setHtml(a), this.fixInitialSelection(), b.fire("dataReady"); 18837 else { 18838 this._.isLoadingData = !0; 18839 b._.dataStore = { 18840 id: 1 18841 }; 18842 var c = b.config, 18843 d = c.fullPage, 18844 e = c.docType, 18845 g = CKEDITOR.tools.buildStyleHtml(p()).replace(/<style>/, '\x3cstyle data-cke-temp\x3d"1"\x3e'); 18846 d || (g += CKEDITOR.tools.buildStyleHtml(b.config.contentsCss)); 18847 var h = c.baseHref ? '\x3cbase href\x3d"' + 18848 c.baseHref + '" data-cke-temp\x3d"1" /\x3e' : ""; 18849 d && (a = a.replace(/<!DOCTYPE[^>]*>/i, function(a) { 18850 b.docType = e = a; 18851 return "" 18852 }).replace(/<\?xml\s[^\?]*\?>/i, function(a) { 18853 b.xmlDeclaration = a; 18854 return "" 18855 })); 18856 a = b.dataProcessor.toHtml(a); 18857 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"), 18858 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"; 18859 CKEDITOR.env.gecko && (a = a.replace(/<body/, '\x3cbody contenteditable\x3d"true" '), 2E4 > CKEDITOR.env.version && 18860 (a = a.replace(/<body[^>]*>/, "$\x26\x3c!-- cke-content-start --\x3e"))); 18861 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"; 18862 CKEDITOR.env.ie && 9 > CKEDITOR.env.version && (c += '\x3cscript id\x3d"cke_shimscrpt"\x3ewindow.parent.CKEDITOR.tools.enableHtml5Elements(document)\x3c/script\x3e'); 18863 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'); 18864 a = a.replace(/(?=\s*<\/(:?head)>)/, c); 18865 this.clearCustomData(); 18866 this.clearListeners(); 18867 b.fire("contentDomUnload"); 18868 var k = this.getDocument(); 18869 try { 18870 k.write(a) 18871 } catch (l) { 18872 setTimeout(function() { 18873 k.write(a) 18874 }, 0) 18875 } 18876 } 18877 }, 18878 getData: function(a) { 18879 if (a) return this.getHtml(); 18880 a = this.editor; 18881 var f = a.config, 18882 b = f.fullPage, 18883 c = b && a.docType, 18884 d = b && a.xmlDeclaration, 18885 e = this.getDocument(), 18886 b = b ? e.getDocumentElement().getOuterHtml() : e.getBody().getHtml(); 18887 CKEDITOR.env.gecko && f.enterMode != CKEDITOR.ENTER_BR && (b = b.replace(/<br>(?=\s*(:?$|<\/body>))/, "")); 18888 b = a.dataProcessor.toDataFormat(b); 18889 d && (b = d + "\n" + b); 18890 c && (b = c + "\n" + b); 18891 return b 18892 }, 18893 focus: function() { 18894 this._.isLoadingData ? this._.isPendingFocus = !0 : l.baseProto.focus.call(this) 18895 }, 18896 detach: function() { 18897 var a = this.editor, 18898 f = a.document, 18899 b; 18900 try { 18901 b = a.window.getFrame() 18902 } catch (c) {} 18903 l.baseProto.detach.call(this); 18904 this.clearCustomData(); 18905 f.getDocumentElement().clearCustomData(); 18906 CKEDITOR.tools.removeFunction(this._.frameLoadedHandler); 18907 b && b.getParent() ? (b.clearCustomData(), (a = b.removeCustomData("onResize")) && a.removeListener(), b.remove()) : CKEDITOR.warn("editor-destroy-iframe") 18908 } 18909 } 18910 }) 18911 })(); 18912 CKEDITOR.config.disableObjectResizing = !1; 18913 CKEDITOR.config.disableNativeTableHandles = !0; 18914 CKEDITOR.config.disableNativeSpellChecker = !0; 18915 (function() { 18916 function e(b, a) { 18917 a || (a = b.getSelection().getSelectedElement()); 18918 if (a && a.is("img") && !a.data("cke-realelement") && !a.isReadOnly()) return a 18919 } 18920 18921 function f(b) { 18922 var a = b.getStyle("float"); 18923 if ("inherit" == a || "none" == a) a = 0; 18924 a || (a = b.getAttribute("align")); 18925 return a 18926 } 18927 CKEDITOR.plugins.add("image", { 18928 requires: "dialog", 18929 init: function(b) { 18930 if (!b.plugins.detectConflict("image", ["easyimage", "image2"])) { 18931 CKEDITOR.dialog.add("image", this.path + "dialogs/image.js"); 18932 var a = "img[alt,!src]{border-style,border-width,float,height,margin,margin-bottom,margin-left,margin-right,margin-top,width}"; 18933 CKEDITOR.dialog.isTabEnabled(b, "image", "advanced") && (a = "img[alt,dir,id,lang,longdesc,!src,title]{*}(*)"); 18934 b.addCommand("image", new CKEDITOR.dialogCommand("image", { 18935 allowedContent: a, 18936 requiredContent: "img[alt,src]", 18937 contentTransformations: [ 18938 ["img{width}: sizeToStyle", "img[width]: sizeToAttribute"], 18939 ["img{float}: alignmentToStyle", "img[align]: alignmentToAttribute"] 18940 ] 18941 })); 18942 b.ui.addButton && b.ui.addButton("Image", { 18943 label: b.lang.common.image, 18944 command: "image", 18945 toolbar: "insert,10" 18946 }); 18947 b.on("doubleclick", function(b) { 18948 var a = 18949 b.data.element; 18950 !a.is("img") || a.data("cke-realelement") || a.isReadOnly() || (b.data.dialog = "image") 18951 }); 18952 b.addMenuItems && b.addMenuItems({ 18953 image: { 18954 label: b.lang.image.menu, 18955 command: "image", 18956 group: "image" 18957 } 18958 }); 18959 b.contextMenu && b.contextMenu.addListener(function(a) { 18960 if (e(b, a)) return { 18961 image: CKEDITOR.TRISTATE_OFF 18962 } 18963 }) 18964 } 18965 }, 18966 afterInit: function(b) { 18967 function a(a) { 18968 var d = b.getCommand("justify" + a); 18969 if (d) { 18970 if ("left" == a || "right" == a) d.on("exec", function(d) { 18971 var c = e(b), 18972 g; 18973 c && (g = f(c), g == a ? (c.removeStyle("float"), a == f(c) && c.removeAttribute("align")) : 18974 c.setStyle("float", a), d.cancel()) 18975 }); 18976 d.on("refresh", function(d) { 18977 var c = e(b); 18978 c && (c = f(c), this.setState(c == a ? CKEDITOR.TRISTATE_ON : "right" == a || "left" == a ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED), d.cancel()) 18979 }) 18980 } 18981 } 18982 b.plugins.image2 || (a("left"), a("right"), a("center"), a("block")) 18983 } 18984 }) 18985 })(); 18986 CKEDITOR.config.image_removeLinkByEmptyURL = !0; 18987 (function() { 18988 function m(a, b) { 18989 var e, f; 18990 b.on("refresh", function(a) { 18991 var b = [k], 18992 c; 18993 for (c in a.data.states) b.push(a.data.states[c]); 18994 this.setState(CKEDITOR.tools.search(b, p) ? p : k) 18995 }, b, null, 100); 18996 b.on("exec", function(b) { 18997 e = a.getSelection(); 18998 f = e.createBookmarks(1); 18999 b.data || (b.data = {}); 19000 b.data.done = !1 19001 }, b, null, 0); 19002 b.on("exec", function() { 19003 a.forceNextSelectionCheck(); 19004 e.selectBookmarks(f) 19005 }, b, null, 100) 19006 } 19007 var k = CKEDITOR.TRISTATE_DISABLED, 19008 p = CKEDITOR.TRISTATE_OFF; 19009 CKEDITOR.plugins.add("indent", { 19010 init: function(a) { 19011 var b = CKEDITOR.plugins.indent.genericDefinition; 19012 m(a, a.addCommand("indent", new b(!0))); 19013 m(a, a.addCommand("outdent", new b)); 19014 a.ui.addButton && (a.ui.addButton("Indent", { 19015 label: a.lang.indent.indent, 19016 command: "indent", 19017 directional: !0, 19018 toolbar: "indent,20" 19019 }), a.ui.addButton("Outdent", { 19020 label: a.lang.indent.outdent, 19021 command: "outdent", 19022 directional: !0, 19023 toolbar: "indent,10" 19024 })); 19025 a.on("dirChanged", function(b) { 19026 var f = a.createRange(), 19027 l = b.data.node; 19028 f.setStartBefore(l); 19029 f.setEndAfter(l); 19030 for (var n = new CKEDITOR.dom.walker(f), c; c = n.next();) 19031 if (c.type == CKEDITOR.NODE_ELEMENT) 19032 if (!c.equals(l) && 19033 c.getDirection()) f.setStartAfter(c), n = new CKEDITOR.dom.walker(f); 19034 else { 19035 var d = a.config.indentClasses; 19036 if (d) 19037 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])); 19038 d = c.getStyle("margin-right"); 19039 g = c.getStyle("margin-left"); 19040 d ? c.setStyle("margin-left", d) : c.removeStyle("margin-left"); 19041 g ? c.setStyle("margin-right", g) : c.removeStyle("margin-right") 19042 } 19043 }) 19044 } 19045 }); 19046 CKEDITOR.plugins.indent = { 19047 genericDefinition: function(a) { 19048 this.isIndent = !!a; 19049 this.startDisabled = !this.isIndent 19050 }, 19051 specificDefinition: function(a, b, e) { 19052 this.name = b; 19053 this.editor = a; 19054 this.jobs = {}; 19055 this.enterBr = a.config.enterMode == CKEDITOR.ENTER_BR; 19056 this.isIndent = !!e; 19057 this.relatedGlobal = e ? "indent" : "outdent"; 19058 this.indentKey = e ? 9 : CKEDITOR.SHIFT + 9; 19059 this.database = {} 19060 }, 19061 registerCommands: function(a, b) { 19062 a.on("pluginsLoaded", function() { 19063 for (var a in b)(function(a, b) { 19064 var e = a.getCommand(b.relatedGlobal), 19065 c; 19066 for (c in b.jobs) e.on("exec", function(d) { 19067 d.data.done || (a.fire("lockSnapshot"), b.execJob(a, c) && (d.data.done = !0), a.fire("unlockSnapshot"), CKEDITOR.dom.element.clearAllMarkers(b.database)) 19068 }, this, null, c), e.on("refresh", function(d) { 19069 d.data.states || (d.data.states = {}); 19070 d.data.states[b.name + "@" + c] = b.refreshJob(a, c, d.data.path) 19071 }, this, null, c); 19072 a.addFeature(b) 19073 })(this, b[a]) 19074 }) 19075 } 19076 }; 19077 CKEDITOR.plugins.indent.genericDefinition.prototype = { 19078 context: "p", 19079 exec: function() {} 19080 }; 19081 CKEDITOR.plugins.indent.specificDefinition.prototype = { 19082 execJob: function(a, b) { 19083 var e = this.jobs[b]; 19084 if (e.state != k) return e.exec.call(this, a) 19085 }, 19086 refreshJob: function(a, 19087 b, e) { 19088 b = this.jobs[b]; 19089 a.activeFilter.checkFeature(this) ? b.state = b.refresh.call(this, a, e) : b.state = k; 19090 return b.state 19091 }, 19092 getContext: function(a) { 19093 return a.contains(this.context) 19094 } 19095 } 19096 })(); 19097 (function() { 19098 function f(b, c, a) { 19099 if (!b.getCustomData("indent_processed")) { 19100 var d = this.editor, 19101 l = this.isIndent; 19102 if (c) { 19103 d = b.$.className.match(this.classNameRegex); 19104 a = 0; 19105 d && (d = d[1], a = CKEDITOR.tools.indexOf(c, d) + 1); 19106 if (0 > (a += l ? 1 : -1)) return; 19107 a = Math.min(a, c.length); 19108 a = Math.max(a, 0); 19109 b.$.className = CKEDITOR.tools.ltrim(b.$.className.replace(this.classNameRegex, "")); 19110 0 < a && b.addClass(c[a - 1]) 19111 } else { 19112 c = m(b, a); 19113 a = parseInt(b.getStyle(c), 10); 19114 var g = d.config.indentOffset || 40; 19115 isNaN(a) && (a = 0); 19116 a += (l ? 1 : -1) * g; 19117 if (0 > a) return; 19118 a = Math.max(a, 19119 0); 19120 a = Math.ceil(a / g) * g; 19121 b.setStyle(c, a ? a + (d.config.indentUnit || "px") : ""); 19122 "" === b.getAttribute("style") && b.removeAttribute("style") 19123 } 19124 CKEDITOR.dom.element.setMarker(this.database, b, "indent_processed", 1) 19125 } 19126 } 19127 19128 function m(b, c) { 19129 return "ltr" == (c || b.getComputedStyle("direction")) ? "margin-left" : "margin-right" 19130 } 19131 var h = CKEDITOR.dtd.$listItem, 19132 p = CKEDITOR.dtd.$list, 19133 k = CKEDITOR.TRISTATE_DISABLED, 19134 n = CKEDITOR.TRISTATE_OFF; 19135 CKEDITOR.plugins.add("indentblock", { 19136 requires: "indent", 19137 init: function(b) { 19138 function c() { 19139 a.specificDefinition.apply(this, 19140 arguments); 19141 this.allowedContent = { 19142 "div h1 h2 h3 h4 h5 h6 ol p pre ul": { 19143 propertiesOnly: !0, 19144 styles: d ? null : "margin-left,margin-right", 19145 classes: d || null 19146 } 19147 }; 19148 this.contentTransformations = [ 19149 ["div: splitMarginShorthand"], 19150 ["h1: splitMarginShorthand"], 19151 ["h2: splitMarginShorthand"], 19152 ["h3: splitMarginShorthand"], 19153 ["h4: splitMarginShorthand"], 19154 ["h5: splitMarginShorthand"], 19155 ["h6: splitMarginShorthand"], 19156 ["ol: splitMarginShorthand"], 19157 ["p: splitMarginShorthand"], 19158 ["pre: splitMarginShorthand"], 19159 ["ul: splitMarginShorthand"] 19160 ]; 19161 this.enterBr && 19162 (this.allowedContent.div = !0); 19163 this.requiredContent = (this.enterBr ? "div" : "p") + (d ? "(" + d.join(",") + ")" : "{margin-left}"); 19164 this.jobs = { 19165 20: { 19166 refresh: function(a, b) { 19167 var e = b.block || b.blockLimit; 19168 if (!e.is(h)) var c = e.getAscendant(h), 19169 e = c && b.contains(c) || e; 19170 e.is(h) && (e = e.getParent()); 19171 if (this.enterBr || this.getContext(b)) { 19172 if (d) { 19173 var c = d, 19174 e = e.$.className.match(this.classNameRegex), 19175 f = this.isIndent, 19176 c = e ? f ? e[1] != c.slice(-1) : !0 : f; 19177 return c ? n : k 19178 } 19179 return this.isIndent ? n : e ? CKEDITOR[0 >= (parseInt(e.getStyle(m(e)), 10) || 0) ? "TRISTATE_DISABLED" : 19180 "TRISTATE_OFF"] : k 19181 } 19182 return k 19183 }, 19184 exec: function(a) { 19185 var b = a.getSelection(), 19186 b = b && b.getRanges()[0], 19187 c; 19188 if (c = a.elementPath().contains(p)) f.call(this, c, d); 19189 else 19190 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); 19191 return !0 19192 } 19193 } 19194 } 19195 } 19196 var a = CKEDITOR.plugins.indent, 19197 d = b.config.indentClasses; 19198 a.registerCommands(b, { 19199 indentblock: new c(b, "indentblock", !0), 19200 outdentblock: new c(b, "outdentblock") 19201 }); 19202 CKEDITOR.tools.extend(c.prototype, a.specificDefinition.prototype, { 19203 context: { 19204 div: 1, 19205 dl: 1, 19206 h1: 1, 19207 h2: 1, 19208 h3: 1, 19209 h4: 1, 19210 h5: 1, 19211 h6: 1, 19212 ul: 1, 19213 ol: 1, 19214 p: 1, 19215 pre: 1, 19216 table: 1 19217 }, 19218 classNameRegex: d ? new RegExp("(?:^|\\s+)(" + d.join("|") + ")(?\x3d$|\\s)") : null 19219 }) 19220 } 19221 }) 19222 })(); 19223 (function() { 19224 function w(f) { 19225 function g(b) { 19226 for (var e = c.startContainer, a = c.endContainer; e && !e.getParent().equals(b);) e = e.getParent(); 19227 for (; a && !a.getParent().equals(b);) a = a.getParent(); 19228 if (!e || !a) return !1; 19229 for (var d = [], h = !1; !h;) e.equals(a) && (h = !0), d.push(e), e = e.getNext(); 19230 if (1 > d.length) return !1; 19231 e = b.getParents(!0); 19232 for (a = 0; a < e.length; a++) 19233 if (e[a].getName && p[e[a].getName()]) { 19234 b = e[a]; 19235 break 19236 } 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, 19237 a = a.getCustomData("listarray_index"); a <= d.getCustomData("listarray_index"); a++) 19238 if (h[a].indent += e, 0 < e) { 19239 for (var g = h[a].parent, n = a - 1; 0 <= n; n--) 19240 if (h[n].indent === e) { 19241 g = h[n].parent; 19242 break 19243 } h[a].parent = new CKEDITOR.dom.element(g.getName(), g.getDocument()) 19244 } for (a = d.getCustomData("listarray_index") + 1; a < h.length && h[a].indent > m; a++) h[a].indent += e; 19245 e = CKEDITOR.plugins.list.arrayToList(h, q, null, f.config.enterMode, b.getDirection()); 19246 if (!k.isIndent) { 19247 var t; 19248 if ((t = b.getParent()) && t.is("li")) 19249 for (var d = e.listNode.getChildren(), 19250 r = [], l, a = d.count() - 1; 0 <= a; a--)(l = d.getItem(a)) && l.is && l.is("li") && r.push(l) 19251 } 19252 e && e.listNode.replace(b); 19253 if (r && r.length) 19254 for (a = 0; a < r.length; a++) { 19255 for (l = b = r[a]; 19256 (l = l.getNext()) && l.is && l.getName() in p;) CKEDITOR.env.needsNbspFiller && !b.getFirst(x) && b.append(c.document.createText(" ")), b.append(l); 19257 b.insertAfter(t) 19258 } 19259 e && f.fire("contentDomInvalidated"); 19260 return !0 19261 } 19262 for (var k = this, q = this.database, p = this.context, c, m = f.getSelection(), m = (m && m.getRanges()).createIterator(); c = m.getNextRange();) { 19263 for (var b = c.getCommonAncestor(); b && 19264 (b.type != CKEDITOR.NODE_ELEMENT || !p[b.getName()]);) { 19265 if (f.editable().equals(b)) { 19266 b = !1; 19267 break 19268 } 19269 b = b.getParent() 19270 } 19271 b || (b = c.startPath().contains(p)) && c.setEndAt(b, CKEDITOR.POSITION_BEFORE_END); 19272 if (!b) { 19273 var d = c.getEnclosedNode(); 19274 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) 19275 } 19276 b && c.startContainer.type == CKEDITOR.NODE_ELEMENT && c.startContainer.getName() in p && (d = new CKEDITOR.dom.walker(c), d.evaluator = n, c.startContainer = 19277 d.next()); 19278 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()); 19279 if (b) return g(b) 19280 } 19281 return 0 19282 } 19283 19284 function n(f) { 19285 return f.type == CKEDITOR.NODE_ELEMENT && f.is("li") 19286 } 19287 19288 function x(f) { 19289 return y(f) && z(f) 19290 } 19291 var y = CKEDITOR.dom.walker.whitespaces(!0), 19292 z = CKEDITOR.dom.walker.bookmark(!1, !0), 19293 u = CKEDITOR.TRISTATE_DISABLED, 19294 v = CKEDITOR.TRISTATE_OFF; 19295 CKEDITOR.plugins.add("indentlist", { 19296 requires: "indent", 19297 init: function(f) { 19298 function g(f) { 19299 k.specificDefinition.apply(this, 19300 arguments); 19301 this.requiredContent = ["ul", "ol"]; 19302 f.on("key", function(g) { 19303 var c = f.elementPath(); 19304 if ("wysiwyg" == f.mode && g.data.keyCode == this.indentKey && c) { 19305 var m = this.getContext(c); 19306 !m || this.isIndent && CKEDITOR.plugins.indentList.firstItemInPath(this.context, c, m) || (f.execCommand(this.relatedGlobal), g.cancel()) 19307 } 19308 }, this); 19309 this.jobs[this.isIndent ? 10 : 30] = { 19310 refresh: this.isIndent ? function(f, c) { 19311 var g = this.getContext(c), 19312 b = CKEDITOR.plugins.indentList.firstItemInPath(this.context, c, g); 19313 return g && this.isIndent && !b ? v : u 19314 } : function(f, 19315 c) { 19316 return !this.getContext(c) || this.isIndent ? u : v 19317 }, 19318 exec: CKEDITOR.tools.bind(w, this) 19319 } 19320 } 19321 var k = CKEDITOR.plugins.indent; 19322 k.registerCommands(f, { 19323 indentlist: new g(f, "indentlist", !0), 19324 outdentlist: new g(f, "outdentlist") 19325 }); 19326 CKEDITOR.tools.extend(g.prototype, k.specificDefinition.prototype, { 19327 context: { 19328 ol: 1, 19329 ul: 1 19330 } 19331 }) 19332 } 19333 }); 19334 CKEDITOR.plugins.indentList = {}; 19335 CKEDITOR.plugins.indentList.firstItemInPath = function(f, g, k) { 19336 var q = g.contains(n); 19337 k || (k = g.contains(f)); 19338 return k && q && q.equals(k.getFirst(n)) 19339 } 19340 })(); 19341 CKEDITOR.plugins.add("smiley", { 19342 requires: "dialog", 19343 init: function(a) { 19344 a.config.smiley_path = a.config.smiley_path || this.path + "images/"; 19345 a.addCommand("smiley", new CKEDITOR.dialogCommand("smiley", { 19346 allowedContent: "img[alt,height,!src,title,width]", 19347 requiredContent: "img" 19348 })); 19349 a.ui.addButton && a.ui.addButton("Smiley", { 19350 label: a.lang.smiley.toolbar, 19351 command: "smiley", 19352 toolbar: "insert,50" 19353 }); 19354 CKEDITOR.dialog.add("smiley", this.path + "dialogs/smiley.js") 19355 } 19356 }); 19357 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(" "); 19358 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(";"); 19359 (function() { 19360 function q(a, c) { 19361 c = void 0 === c || c; 19362 var b; 19363 if (c) b = a.getComputedStyle("text-align"); 19364 else { 19365 for (; !a.hasAttribute || !a.hasAttribute("align") && !a.getStyle("text-align");) { 19366 b = a.getParent(); 19367 if (!b) break; 19368 a = b 19369 } 19370 b = a.getStyle("text-align") || a.getAttribute("align") || "" 19371 } 19372 b && (b = b.replace(/(?:-(?:moz|webkit)-)?(?:start|auto)/i, "")); 19373 !b && c && (b = "rtl" == a.getComputedStyle("direction") ? "right" : "left"); 19374 return b 19375 } 19376 19377 function h(a, c, b) { 19378 this.editor = a; 19379 this.name = c; 19380 this.value = b; 19381 this.context = "p"; 19382 c = a.config.justifyClasses; 19383 var f = a.config.enterMode == 19384 CKEDITOR.ENTER_P ? "p" : "div"; 19385 if (c) { 19386 switch (b) { 19387 case "left": 19388 this.cssClassName = c[0]; 19389 break; 19390 case "center": 19391 this.cssClassName = c[1]; 19392 break; 19393 case "right": 19394 this.cssClassName = c[2]; 19395 break; 19396 case "justify": 19397 this.cssClassName = c[3] 19398 } 19399 this.cssClassRegex = new RegExp("(?:^|\\s+)(?:" + c.join("|") + ")(?\x3d$|\\s)"); 19400 this.requiredContent = f + "(" + this.cssClassName + ")" 19401 } else this.requiredContent = f + "{text-align}"; 19402 this.allowedContent = { 19403 "caption div h1 h2 h3 h4 h5 h6 p pre td th li": { 19404 propertiesOnly: !0, 19405 styles: this.cssClassName ? null : "text-align", 19406 classes: this.cssClassName || null 19407 } 19408 }; 19409 a.config.enterMode == CKEDITOR.ENTER_BR && (this.allowedContent.div = !0) 19410 } 19411 19412 function m(a) { 19413 var c = a.editor, 19414 b = c.createRange(); 19415 b.setStartBefore(a.data.node); 19416 b.setEndAfter(a.data.node); 19417 for (var f = new CKEDITOR.dom.walker(b), d; d = f.next();) 19418 if (d.type == CKEDITOR.NODE_ELEMENT) 19419 if (!d.equals(a.data.node) && d.getDirection()) b.setStartAfter(d), f = new CKEDITOR.dom.walker(b); 19420 else { 19421 var e = c.config.justifyClasses; 19422 e && (d.hasClass(e[0]) ? (d.removeClass(e[0]), d.addClass(e[2])) : d.hasClass(e[2]) && (d.removeClass(e[2]), 19423 d.addClass(e[0]))); 19424 e = d.getStyle("text-align"); 19425 "left" == e ? d.setStyle("text-align", "right") : "right" == e && d.setStyle("text-align", "left") 19426 } 19427 } 19428 h.prototype = { 19429 exec: function(a) { 19430 var c = a.getSelection(), 19431 b = a.config.enterMode; 19432 if (c) { 19433 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--) 19434 for (h = d[n].createIterator(), h.enlargeBr = b != CKEDITOR.ENTER_BR; g = h.getNextParagraph(b == CKEDITOR.ENTER_P ? "p" : "div");) 19435 if (!g.isReadOnly()) { 19436 var l = g.getName(), 19437 p; 19438 p = a.activeFilter.check(l + "{text-align}"); 19439 if ((l = a.activeFilter.check(l + "(" + e + ")")) || p) { 19440 g.removeAttribute("align"); 19441 g.removeStyle("text-align"); 19442 var m = e && (g.$.className = CKEDITOR.tools.ltrim(g.$.className.replace(this.cssClassRegex, ""))), 19443 r = this.state == CKEDITOR.TRISTATE_OFF && (!k || q(g, !0) != this.value); 19444 e && l ? r ? g.addClass(e) : m || g.removeAttribute("class") : r && p && g.setStyle("text-align", this.value) 19445 } 19446 } a.focus(); 19447 a.forceNextSelectionCheck(); 19448 c.selectBookmarks(f) 19449 } 19450 }, 19451 refresh: function(a, c) { 19452 var b = c.block || c.blockLimit, 19453 f = b.getName(), 19454 d = b.equals(a.editable()), 19455 f = this.cssClassName ? a.activeFilter.check(f + "(" + this.cssClassName + ")") : a.activeFilter.check(f + "{text-align}"); 19456 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) 19457 } 19458 }; 19459 CKEDITOR.plugins.add("justify", { 19460 init: function(a) { 19461 if (!a.blockless) { 19462 var c = new h(a, "justifyleft", "left"), 19463 b = new h(a, "justifycenter", "center"), 19464 f = new h(a, "justifyright", "right"), 19465 d = new h(a, "justifyblock", "justify"); 19466 a.addCommand("justifyleft", c); 19467 a.addCommand("justifycenter", b); 19468 a.addCommand("justifyright", f); 19469 a.addCommand("justifyblock", d); 19470 a.ui.addButton && (a.ui.addButton("JustifyLeft", { 19471 label: a.lang.common.alignLeft, 19472 command: "justifyleft", 19473 toolbar: "align,10" 19474 }), a.ui.addButton("JustifyCenter", { 19475 label: a.lang.common.center, 19476 command: "justifycenter", 19477 toolbar: "align,20" 19478 }), a.ui.addButton("JustifyRight", { 19479 label: a.lang.common.alignRight, 19480 command: "justifyright", 19481 toolbar: "align,30" 19482 }), a.ui.addButton("JustifyBlock", { 19483 label: a.lang.common.justify, 19484 command: "justifyblock", 19485 toolbar: "align,40" 19486 })); 19487 a.on("dirChanged", m) 19488 } 19489 } 19490 }) 19491 })(); 19492 CKEDITOR.plugins.add("menubutton", { 19493 requires: "button,menu", 19494 onLoad: function() { 19495 var d = function(c) { 19496 var a = this._, 19497 b = a.menu; 19498 a.state !== CKEDITOR.TRISTATE_DISABLED && (a.on && b ? b.hide() : (a.previousState = a.state, b || (b = a.menu = new CKEDITOR.menu(c, { 19499 panel: { 19500 className: "cke_menu_panel", 19501 attributes: { 19502 "aria-label": c.lang.common.options 19503 } 19504 } 19505 }), b.onHide = CKEDITOR.tools.bind(function() { 19506 var b = this.command ? c.getCommand(this.command).modes : this.modes; 19507 this.setState(!b || b[c.mode] ? a.previousState : CKEDITOR.TRISTATE_DISABLED); 19508 a.on = 0 19509 }, this), 19510 this.onMenu && b.addListener(this.onMenu)), this.setState(CKEDITOR.TRISTATE_ON), a.on = 1, setTimeout(function() { 19511 b.show(CKEDITOR.document.getById(a.id), 4) 19512 }, 0))) 19513 }; 19514 CKEDITOR.ui.menuButton = CKEDITOR.tools.createClass({ 19515 base: CKEDITOR.ui.button, 19516 $: function(c) { 19517 delete c.panel; 19518 this.base(c); 19519 this.hasArrow = !0; 19520 this.click = d 19521 }, 19522 statics: { 19523 handler: { 19524 create: function(c) { 19525 return new CKEDITOR.ui.menuButton(c) 19526 } 19527 } 19528 } 19529 }) 19530 }, 19531 beforeInit: function(d) { 19532 d.ui.addHandler(CKEDITOR.UI_MENUBUTTON, CKEDITOR.ui.menuButton.handler) 19533 } 19534 }); 19535 CKEDITOR.UI_MENUBUTTON = "menubutton"; 19536 (function() { 19537 CKEDITOR.plugins.add("language", { 19538 requires: "menubutton", 19539 init: function(a) { 19540 var b = a.config.language_list || ["ar:Arabic:rtl", "fr:French", "es:Spanish"], 19541 c = this, 19542 d = a.lang.language, 19543 e = {}, 19544 g, h, k, f; 19545 a.addCommand("language", { 19546 allowedContent: "span[!lang,!dir]", 19547 requiredContent: "span[lang,dir]", 19548 contextSensitive: !0, 19549 exec: function(a, b) { 19550 var c = e["language_" + b]; 19551 if (c) a[c.style.checkActive(a.elementPath(), a) ? "removeStyle" : "applyStyle"](c.style) 19552 }, 19553 refresh: function(a) { 19554 this.setState(c.getCurrentLangElement(a) ? CKEDITOR.TRISTATE_ON : 19555 CKEDITOR.TRISTATE_OFF) 19556 } 19557 }); 19558 for (f = 0; f < b.length; f++) g = b[f].split(":"), h = g[0], k = "language_" + h, e[k] = { 19559 label: g[1], 19560 langId: h, 19561 group: "language", 19562 order: f, 19563 ltr: "rtl" != ("" + g[2]).toLowerCase(), 19564 onClick: function() { 19565 a.execCommand("language", this.langId) 19566 }, 19567 role: "menuitemcheckbox" 19568 }, e[k].style = new CKEDITOR.style({ 19569 element: "span", 19570 attributes: { 19571 lang: h, 19572 dir: e[k].ltr ? "ltr" : "rtl" 19573 } 19574 }); 19575 e.language_remove = { 19576 label: d.remove, 19577 group: "language_remove", 19578 state: CKEDITOR.TRISTATE_DISABLED, 19579 order: e.length, 19580 onClick: function() { 19581 var b = c.getCurrentLangElement(a); 19582 b && a.execCommand("language", b.getAttribute("lang")) 19583 } 19584 }; 19585 a.addMenuGroup("language", 1); 19586 a.addMenuGroup("language_remove"); 19587 a.addMenuItems(e); 19588 a.ui.add("Language", CKEDITOR.UI_MENUBUTTON, { 19589 label: d.button, 19590 allowedContent: "span[!lang,!dir]", 19591 requiredContent: "span[lang,dir]", 19592 toolbar: "bidi,30", 19593 command: "language", 19594 onMenu: function() { 19595 var b = {}, 19596 d = c.getCurrentLangElement(a), 19597 f; 19598 for (f in e) b[f] = CKEDITOR.TRISTATE_OFF; 19599 b.language_remove = d ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED; 19600 d && (b["language_" + d.getAttribute("lang")] = 19601 CKEDITOR.TRISTATE_ON); 19602 return b 19603 } 19604 }); 19605 a.addRemoveFormatFilter && a.addRemoveFormatFilter(function(a) { 19606 return !(a.is("span") && a.getAttribute("dir") && a.getAttribute("lang")) 19607 }) 19608 }, 19609 getCurrentLangElement: function(a) { 19610 var b = a.elementPath(); 19611 a = b && b.elements; 19612 var c; 19613 if (b) 19614 for (var d = 0; d < a.length; d++) b = a[d], !c && "span" == b.getName() && b.hasAttribute("dir") && b.hasAttribute("lang") && (c = b); 19615 return c 19616 } 19617 }) 19618 })(); 19619 (function() { 19620 function p(c) { 19621 return c.replace(/'/g, "\\$\x26") 19622 } 19623 19624 function q(c) { 19625 for (var b, a = c.length, d = [], f = 0; f < a; f++) b = c.charCodeAt(f), d.push(b); 19626 return "String.fromCharCode(" + d.join(",") + ")" 19627 } 19628 19629 function r(c, b) { 19630 var a = c.plugins.link, 19631 d = a.compiledProtectionFunction.params, 19632 f, e; 19633 e = [a.compiledProtectionFunction.name, "("]; 19634 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])) : "", "'"); 19635 e.push(")"); 19636 return e.join("") 19637 } 19638 19639 function n(c) { 19640 c = c.config.emailProtection || ""; 19641 var b; 19642 c && "encode" != c && (b = {}, c.replace(/^([^(]+)\(([^)]+)\)$/, function(a, c, f) { 19643 b.name = c; 19644 b.params = []; 19645 f.replace(/[^,\s]+/g, function(a) { 19646 b.params.push(a) 19647 }) 19648 })); 19649 return b 19650 } 19651 CKEDITOR.plugins.add("link", { 19652 requires: "dialog,fakeobjects", 19653 onLoad: function() { 19654 function c(b) { 19655 return a.replace(/%1/g, "rtl" == b ? "right" : "left").replace(/%2/g, "cke_contents_" + b) 19656 } 19657 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;", 19658 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;}"; 19659 CKEDITOR.addCss(c("ltr") + c("rtl")) 19660 }, 19661 init: function(c) { 19662 var b = "a[!href]"; 19663 CKEDITOR.dialog.isTabEnabled(c, "link", "advanced") && (b = b.replace("]", ",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type,download]{*}(*)")); 19664 CKEDITOR.dialog.isTabEnabled(c, "link", "target") && 19665 (b = b.replace("]", ",target,onclick]")); 19666 c.addCommand("link", new CKEDITOR.dialogCommand("link", { 19667 allowedContent: b, 19668 requiredContent: "a[href]" 19669 })); 19670 c.addCommand("anchor", new CKEDITOR.dialogCommand("anchor", { 19671 allowedContent: "a[!name,id]", 19672 requiredContent: "a[name]" 19673 })); 19674 c.addCommand("unlink", new CKEDITOR.unlinkCommand); 19675 c.addCommand("removeAnchor", new CKEDITOR.removeAnchorCommand); 19676 c.setKeystroke(CKEDITOR.CTRL + 76, "link"); 19677 c.ui.addButton && (c.ui.addButton("Link", { 19678 label: c.lang.link.toolbar, 19679 command: "link", 19680 toolbar: "links,10" 19681 }), 19682 c.ui.addButton("Unlink", { 19683 label: c.lang.link.unlink, 19684 command: "unlink", 19685 toolbar: "links,20" 19686 }), c.ui.addButton("Anchor", { 19687 label: c.lang.link.anchor.toolbar, 19688 command: "anchor", 19689 toolbar: "links,30" 19690 })); 19691 CKEDITOR.dialog.add("link", this.path + "dialogs/link.js"); 19692 CKEDITOR.dialog.add("anchor", this.path + "dialogs/anchor.js"); 19693 c.on("doubleclick", function(a) { 19694 var b = a.data.element.getAscendant({ 19695 a: 1, 19696 img: 1 19697 }, !0); 19698 b && !b.isReadOnly() && (b.is("a") ? (a.data.dialog = !b.getAttribute("name") || b.getAttribute("href") && b.getChildCount() ? "link" : 19699 "anchor", a.data.link = b) : CKEDITOR.plugins.link.tryRestoreFakeAnchor(c, b) && (a.data.dialog = "anchor")) 19700 }, null, null, 0); 19701 c.on("doubleclick", function(a) { 19702 a.data.dialog in { 19703 link: 1, 19704 anchor: 1 19705 } && a.data.link && c.getSelection().selectElement(a.data.link) 19706 }, null, null, 20); 19707 c.addMenuItems && c.addMenuItems({ 19708 anchor: { 19709 label: c.lang.link.anchor.menu, 19710 command: "anchor", 19711 group: "anchor", 19712 order: 1 19713 }, 19714 removeAnchor: { 19715 label: c.lang.link.anchor.remove, 19716 command: "removeAnchor", 19717 group: "anchor", 19718 order: 5 19719 }, 19720 link: { 19721 label: c.lang.link.menu, 19722 command: "link", 19723 group: "link", 19724 order: 1 19725 }, 19726 unlink: { 19727 label: c.lang.link.unlink, 19728 command: "unlink", 19729 group: "link", 19730 order: 5 19731 } 19732 }); 19733 c.contextMenu && c.contextMenu.addListener(function(a) { 19734 if (!a || a.isReadOnly()) return null; 19735 a = CKEDITOR.plugins.link.tryRestoreFakeAnchor(c, a); 19736 if (!a && !(a = CKEDITOR.plugins.link.getSelectedLink(c))) return null; 19737 var b = {}; 19738 a.getAttribute("href") && a.getChildCount() && (b = { 19739 link: CKEDITOR.TRISTATE_OFF, 19740 unlink: CKEDITOR.TRISTATE_OFF 19741 }); 19742 a && a.hasAttribute("name") && (b.anchor = b.removeAnchor = CKEDITOR.TRISTATE_OFF); 19743 return b 19744 }); 19745 this.compiledProtectionFunction = 19746 n(c) 19747 }, 19748 afterInit: function(c) { 19749 c.dataProcessor.dataFilter.addRules({ 19750 elements: { 19751 a: function(a) { 19752 return a.attributes.name ? a.children.length ? null : c.createFakeParserElement(a, "cke_anchor", "anchor") : null 19753 } 19754 } 19755 }); 19756 var b = c._.elementsPath && c._.elementsPath.filters; 19757 b && b.push(function(a, b) { 19758 if ("a" == b && (CKEDITOR.plugins.link.tryRestoreFakeAnchor(c, a) || a.getAttribute("name") && (!a.getAttribute("href") || !a.getChildCount()))) return "anchor" 19759 }) 19760 } 19761 }); 19762 var t = /^javascript:/, 19763 u = /^mailto:([^?]+)(?:\?(.+))?$/, 19764 v = /subject=([^;?:@&=$,\/]*)/i, 19765 w = /body=([^;?:@&=$,\/]*)/i, 19766 x = /^#(.*)$/, 19767 y = /^((?:http|https|ftp|news):\/\/)?(.*)$/, 19768 z = /^(_(?:self|top|parent|blank))$/, 19769 A = /^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/, 19770 B = /^javascript:([^(]+)\(([^)]+)\)$/, 19771 C = /\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/, 19772 D = /(?:^|,)([^=]+)=(\d+|yes|no)/gi, 19773 m = { 19774 id: "advId", 19775 dir: "advLangDir", 19776 accessKey: "advAccessKey", 19777 name: "advName", 19778 lang: "advLangCode", 19779 tabindex: "advTabIndex", 19780 title: "advTitle", 19781 type: "advContentType", 19782 "class": "advCSSClasses", 19783 charset: "advCharset", 19784 style: "advStyles", 19785 rel: "advRel" 19786 }; 19787 CKEDITOR.plugins.link = { 19788 getSelectedLink: function(c, b) { 19789 var a = c.getSelection(), 19790 d = a.getSelectedElement(), 19791 f = a.getRanges(), 19792 e = [], 19793 g; 19794 if (!b && d && d.is("a")) return d; 19795 for (d = 0; d < f.length; d++) 19796 if (g = a.getRanges()[d], g.shrink(CKEDITOR.SHRINK_ELEMENT, !0, { 19797 skipBogus: !0 19798 }), (g = c.elementPath(g.getCommonAncestor()).contains("a", 1)) && b) e.push(g); 19799 else if (g) return g; 19800 return b ? e : null 19801 }, 19802 getEditorAnchors: function(c) { 19803 for (var b = 19804 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({ 19805 name: e.data("cke-saved-name") || e.getAttribute("name"), 19806 id: e.getAttribute("id") 19807 }); 19808 for (f = 0; e = a.getItem(f++);)(e = this.tryRestoreFakeAnchor(c, e)) && d.push({ 19809 name: e.getAttribute("name"), 19810 id: e.getAttribute("id") 19811 }); 19812 return d 19813 }, 19814 fakeAnchor: !0, 19815 tryRestoreFakeAnchor: function(c, b) { 19816 if (b && b.data("cke-real-element-type") && 19817 "anchor" == b.data("cke-real-element-type")) { 19818 var a = c.restoreRealElement(b); 19819 if (a.data("cke-saved-name")) return a 19820 } 19821 }, 19822 parseLinkAttributes: function(c, b) { 19823 var a = b && (b.data("cke-saved-href") || b.getAttribute("href")) || "", 19824 d = c.plugins.link.compiledProtectionFunction, 19825 f = c.config.emailProtection, 19826 e, g = {}; 19827 a.match(t) && ("encode" == f ? a = a.replace(A, function(a, b, c) { 19828 c = c || ""; 19829 return "mailto:" + String.fromCharCode.apply(String, b.split(",")) + c.replace(/\\'/g, "'") 19830 }) : f && a.replace(B, function(a, b, c) { 19831 if (b == d.name) { 19832 g.type = "email"; 19833 a = g.email = {}; 19834 b = /(^')|('$)/g; 19835 c = c.match(/[^,\s]+/g); 19836 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; 19837 a.address = [a.name, a.domain].join("@") 19838 } 19839 })); 19840 if (!g.type) 19841 if (f = a.match(x)) g.type = "anchor", g.anchor = {}, g.anchor.name = g.anchor.id = f[1]; 19842 else if (f = a.match(u)) { 19843 e = a.match(v); 19844 a = a.match(w); 19845 g.type = "email"; 19846 var k = g.email = {}; 19847 k.address = f[1]; 19848 e && (k.subject = decodeURIComponent(e[1])); 19849 a && (k.body = decodeURIComponent(a[1])) 19850 } else a && (e = a.match(y)) && 19851 (g.type = "url", g.url = {}, g.url.protocol = e[1], g.url.url = e[2]); 19852 if (b) { 19853 if (a = b.getAttribute("target")) g.target = { 19854 type: a.match(z) ? a : "frame", 19855 name: a 19856 }; 19857 else if (a = (a = b.data("cke-pa-onclick") || b.getAttribute("onclick")) && a.match(C)) 19858 for (g.target = { 19859 type: "popup", 19860 name: a[1] 19861 }; f = D.exec(a[2]);) "yes" != f[2] && "1" != f[2] || f[1] in { 19862 height: 1, 19863 width: 1, 19864 top: 1, 19865 left: 1 19866 } ? isFinite(f[2]) && (g.target[f[1]] = f[2]) : g.target[f[1]] = !0; 19867 null !== b.getAttribute("download") && (g.download = !0); 19868 var a = {}, 19869 h; 19870 for (h in m)(f = b.getAttribute(h)) && (a[m[h]] = f); 19871 if (h = 19872 b.data("cke-saved-name") || a.advName) a.advName = h; 19873 CKEDITOR.tools.isEmpty(a) || (g.advanced = a) 19874 } 19875 return g 19876 }, 19877 getLinkAttributes: function(c, b) { 19878 var a = c.config.emailProtection || "", 19879 d = {}; 19880 switch (b.type) { 19881 case "url": 19882 var a = b.url && void 0 !== b.url.protocol ? b.url.protocol : "http://", 19883 f = b.url && CKEDITOR.tools.trim(b.url.url) || ""; 19884 d["data-cke-saved-href"] = 0 === f.indexOf("/") ? f : a + f; 19885 break; 19886 case "anchor": 19887 a = b.anchor && b.anchor.id; 19888 d["data-cke-saved-href"] = "#" + (b.anchor && b.anchor.name || a || ""); 19889 break; 19890 case "email": 19891 var e = b.email, 19892 f = e.address; 19893 switch (a) { 19894 case "": 19895 case "encode": 19896 var g = encodeURIComponent(e.subject || ""), 19897 k = encodeURIComponent(e.body || ""), 19898 e = []; 19899 g && e.push("subject\x3d" + g); 19900 k && e.push("body\x3d" + k); 19901 e = e.length ? "?" + e.join("\x26") : ""; 19902 "encode" == a ? (a = ["javascript:void(location.href\x3d'mailto:'+", q(f)], e && a.push("+'", p(e), "'"), a.push(")")) : a = ["mailto:", f, e]; 19903 break; 19904 default: 19905 a = f.split("@", 2), e.name = a[0], e.domain = a[1], a = ["javascript:", r(c, e)] 19906 } 19907 d["data-cke-saved-href"] = a.join("") 19908 } 19909 if (b.target) 19910 if ("popup" == b.target.type) { 19911 for (var a = ["window.open(this.href, '", 19912 b.target.name || "", "', '" 19913 ], h = "resizable status location toolbar menubar fullscreen scrollbars dependent".split(" "), f = h.length, g = function(a) { 19914 b.target[a] && h.push(a + "\x3d" + b.target[a]) 19915 }, e = 0; e < f; e++) h[e] += b.target[h[e]] ? "\x3dyes" : "\x3dno"; 19916 g("width"); 19917 g("left"); 19918 g("height"); 19919 g("top"); 19920 a.push(h.join(","), "'); return false;"); 19921 d["data-cke-pa-onclick"] = a.join("") 19922 } else "notSet" != b.target.type && b.target.name && (d.target = b.target.name); 19923 b.download && (d.download = ""); 19924 if (b.advanced) { 19925 for (var l in m)(a = b.advanced[m[l]]) && 19926 (d[l] = a); 19927 d.name && (d["data-cke-saved-name"] = d.name) 19928 } 19929 d["data-cke-saved-href"] && (d.href = d["data-cke-saved-href"]); 19930 l = { 19931 target: 1, 19932 onclick: 1, 19933 "data-cke-pa-onclick": 1, 19934 "data-cke-saved-name": 1, 19935 download: 1 19936 }; 19937 b.advanced && CKEDITOR.tools.extend(l, m); 19938 for (var n in d) delete l[n]; 19939 return { 19940 set: d, 19941 removed: CKEDITOR.tools.objectKeys(l) 19942 } 19943 }, 19944 showDisplayTextForElement: function(c, b) { 19945 var a = { 19946 img: 1, 19947 table: 1, 19948 tbody: 1, 19949 thead: 1, 19950 tfoot: 1, 19951 input: 1, 19952 select: 1, 19953 textarea: 1 19954 }, 19955 d = b.getSelection(); 19956 return b.widgets && b.widgets.focused || d && 1 < d.getRanges().length ? 19957 !1 : !c || !c.getName || !c.is(a) 19958 } 19959 }; 19960 CKEDITOR.unlinkCommand = function() {}; 19961 CKEDITOR.unlinkCommand.prototype = { 19962 exec: function(c) { 19963 if (CKEDITOR.env.ie) { 19964 var b = c.getSelection().getRanges()[0], 19965 a = b.getPreviousEditableNode() && b.getPreviousEditableNode().getAscendant("a", !0) || b.getNextEditableNode() && b.getNextEditableNode().getAscendant("a", !0), 19966 d; 19967 b.collapsed && a && (d = b.createBookmark(), b.selectNodeContents(a), b.select()) 19968 } 19969 a = new CKEDITOR.style({ 19970 element: "a", 19971 type: CKEDITOR.STYLE_INLINE, 19972 alwaysRemoveElement: 1 19973 }); 19974 c.removeStyle(a); 19975 d && (b.moveToBookmark(d), b.select()) 19976 }, 19977 refresh: function(c, b) { 19978 var a = b.lastElement && b.lastElement.getAscendant("a", !0); 19979 a && "a" == a.getName() && a.getAttribute("href") && a.getChildCount() ? this.setState(CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_DISABLED) 19980 }, 19981 contextSensitive: 1, 19982 startDisabled: 1, 19983 requiredContent: "a[href]", 19984 editorFocus: 1 19985 }; 19986 CKEDITOR.removeAnchorCommand = function() {}; 19987 CKEDITOR.removeAnchorCommand.prototype = { 19988 exec: function(c) { 19989 var b = c.getSelection(), 19990 a = b.createBookmarks(), 19991 d; 19992 if (b && (d = b.getSelectedElement()) && 19993 (d.getChildCount() ? d.is("a") : CKEDITOR.plugins.link.tryRestoreFakeAnchor(c, d))) d.remove(1); 19994 else if (d = CKEDITOR.plugins.link.getSelectedLink(c)) d.hasAttribute("href") ? (d.removeAttributes({ 19995 name: 1, 19996 "data-cke-saved-name": 1 19997 }), d.removeClass("cke_anchor")) : d.remove(1); 19998 b.selectBookmarks(a) 19999 }, 20000 requiredContent: "a[name]" 20001 }; 20002 CKEDITOR.tools.extend(CKEDITOR.config, { 20003 linkShowAdvancedTab: !0, 20004 linkShowTargetTab: !0 20005 }) 20006 })(); 20007 (function() { 20008 function I(b, m, e) { 20009 function c(c) { 20010 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({ 20011 br: 1 20012 }))) b.document.createElement("br")[c ? "insertBefore" : "insertAfter"](a) 20013 } 20014 for (var f = CKEDITOR.plugins.list.listToArray(m.root, e), g = [], k = 0; k < m.contents.length; k++) { 20015 var h = m.contents[k]; 20016 (h = h.getAscendant("li", !0)) && !h.getCustomData("list_item_processed") && (g.push(h), CKEDITOR.dom.element.setMarker(e, 20017 h, "list_item_processed", !0)) 20018 } 20019 h = null; 20020 for (k = 0; k < g.length; k++) h = g[k].getCustomData("listarray_index"), f[h].indent = -1; 20021 for (k = h + 1; k < f.length; k++) 20022 if (f[k].indent > f[k - 1].indent + 1) { 20023 g = f[k - 1].indent + 1 - f[k].indent; 20024 for (h = f[k].indent; f[k] && f[k].indent >= h;) f[k].indent += g, k++; 20025 k-- 20026 } var d = CKEDITOR.plugins.list.arrayToList(f, e, null, b.config.enterMode, m.root.getAttribute("dir")).listNode, 20027 a, p; 20028 c(!0); 20029 c(); 20030 d.replace(m.root); 20031 b.fire("contentDomInvalidated") 20032 } 20033 20034 function B(b, m) { 20035 this.name = b; 20036 this.context = this.type = m; 20037 this.allowedContent = 20038 m + " li"; 20039 this.requiredContent = m 20040 } 20041 20042 function E(b, m, e, c) { 20043 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) 20044 } 20045 20046 function F(b) { 20047 function m(e) { 20048 var c = b[e ? "getPrevious" : "getNext"](u); 20049 c && c.type == CKEDITOR.NODE_ELEMENT && c.is(b.getName()) && (E(b, c, null, !e), b.remove(), b = c) 20050 } 20051 m(); 20052 m(1) 20053 } 20054 20055 function G(b) { 20056 return b.type == CKEDITOR.NODE_ELEMENT && (b.getName() in CKEDITOR.dtd.$block || b.getName() in CKEDITOR.dtd.$listItem) && 20057 CKEDITOR.dtd[b.getName()]["#"] 20058 } 20059 20060 function C(b, m, e) { 20061 b.fire("saveSnapshot"); 20062 e.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS); 20063 var c = e.extractContents(); 20064 m.trim(!1, !0); 20065 var f = m.createBookmark(), 20066 g = new CKEDITOR.dom.elementPath(m.startContainer), 20067 k = g.block, 20068 g = g.lastElement.getAscendant("li", 1) || k, 20069 h = new CKEDITOR.dom.elementPath(e.startContainer), 20070 d = h.contains(CKEDITOR.dtd.$listItem), 20071 h = h.contains(CKEDITOR.dtd.$list); 20072 k ? (k = k.getBogus()) && k.remove() : h && (k = h.getPrevious(u)) && z(k) && k.remove(); 20073 (k = c.getLast()) && k.type == CKEDITOR.NODE_ELEMENT && 20074 k.is("br") && k.remove(); 20075 (k = m.startContainer.getChild(m.startOffset)) ? c.insertBefore(k): m.startContainer.append(c); 20076 d && (c = A(d)) && (g.contains(d) ? (E(c, d.getParent(), d), c.remove()) : g.append(c)); 20077 for (; e.checkStartOfBlock() && e.checkEndOfBlock();) { 20078 h = e.startPath(); 20079 c = h.block; 20080 if (!c) break; 20081 c.is("li") && (g = c.getParent(), c.equals(g.getLast(u)) && c.equals(g.getFirst(u)) && (c = g)); 20082 e.moveToPosition(c, CKEDITOR.POSITION_BEFORE_START); 20083 c.remove() 20084 } 20085 e = e.clone(); 20086 c = b.editable(); 20087 e.setEndAt(c, CKEDITOR.POSITION_BEFORE_END); 20088 e = new CKEDITOR.dom.walker(e); 20089 e.evaluator = function(a) { 20090 return u(a) && !z(a) 20091 }; 20092 (e = e.next()) && e.type == CKEDITOR.NODE_ELEMENT && e.getName() in CKEDITOR.dtd.$list && F(e); 20093 m.moveToBookmark(f); 20094 m.select(); 20095 b.fire("saveSnapshot") 20096 } 20097 20098 function A(b) { 20099 return (b = b.getLast(u)) && b.type == CKEDITOR.NODE_ELEMENT && b.getName() in v ? b : null 20100 } 20101 var v = { 20102 ol: 1, 20103 ul: 1 20104 }, 20105 K = CKEDITOR.dom.walker.whitespaces(), 20106 H = CKEDITOR.dom.walker.bookmark(), 20107 u = function(b) { 20108 return !(K(b) || H(b)) 20109 }, 20110 z = CKEDITOR.dom.walker.bogus(); 20111 CKEDITOR.plugins.list = { 20112 listToArray: function(b, m, e, c, f) { 20113 if (!v[b.getName()]) return []; 20114 c || (c = 0); 20115 e || (e = []); 20116 for (var g = 0, k = b.getChildCount(); g < k; g++) { 20117 var h = b.getChild(g); 20118 h.type == CKEDITOR.NODE_ELEMENT && h.getName() in CKEDITOR.dtd.$list && CKEDITOR.plugins.list.listToArray(h, m, e, c + 1); 20119 if ("li" == h.$.nodeName.toLowerCase()) { 20120 var d = { 20121 parent: b, 20122 indent: c, 20123 element: h, 20124 contents: [] 20125 }; 20126 f ? d.grandparent = f : (d.grandparent = b.getParent(), d.grandparent && "li" == d.grandparent.$.nodeName.toLowerCase() && (d.grandparent = d.grandparent.getParent())); 20127 m && CKEDITOR.dom.element.setMarker(m, h, "listarray_index", e.length); 20128 e.push(d); 20129 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) 20130 } 20131 } 20132 return e 20133 }, 20134 arrayToList: function(b, m, e, c, f) { 20135 e || (e = 0); 20136 if (!b || b.length < e + 1) return null; 20137 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";;) { 20138 var r = b[a]; 20139 g = r.grandparent; 20140 q = r.element.getDirection(1); 20141 if (r.indent == p) { 20142 d && b[a].parent.getName() == 20143 d.getName() || (d = b[a].parent.clone(!1, 1), f && d.setAttribute("dir", f), h.append(d)); 20144 l = d.append(r.element.clone(0, 1)); 20145 q != d.getDirection(1) && l.setAttribute("dir", q); 20146 for (g = 0; g < r.contents.length; g++) l.append(r.contents[g].clone(1, 1)); 20147 a++ 20148 } 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; 20149 else if (-1 == 20150 r.indent && !e && g) { 20151 v[g.getName()] ? (l = r.element.clone(!1, !0), q != g.getDirection(1) && l.setAttribute("dir", q)) : l = new CKEDITOR.dom.documentFragment(k); 20152 var d = g.getDirection(1) != q, 20153 y = r.element, 20154 D = y.getAttribute("class"), 20155 z = y.getAttribute("style"), 20156 A = l.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT && (c != CKEDITOR.ENTER_BR || d || z || D), 20157 w, B = r.contents.length, 20158 x; 20159 for (g = 0; g < B; g++) 20160 if (w = r.contents[g], H(w) && 1 < B) A ? x = w.clone(1, 1) : l.append(w.clone(1, 1)); 20161 else if (w.type == CKEDITOR.NODE_ELEMENT && w.isBlockBoundary()) { 20162 d && !w.getDirection() && 20163 w.setAttribute("dir", q); 20164 n = w; 20165 var C = y.getAttribute("style"); 20166 C && n.setAttribute("style", C.replace(/([^;])$/, "$1;") + (n.getAttribute("style") || "")); 20167 D && w.addClass(D); 20168 n = null; 20169 x && (l.append(x), x = null); 20170 l.append(w.clone(1, 1)) 20171 } 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)); 20172 x && ((n || l).append(x), x = null); 20173 l.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT && a != b.length - 1 && (CKEDITOR.env.needsBrFiller && 20174 (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"))); 20175 q = l.$.nodeName.toLowerCase(); 20176 "div" != q && "p" != q || l.appendBogus(); 20177 h.append(l); 20178 d = null; 20179 a++ 20180 } else return null; 20181 n = null; 20182 if (b.length <= a || Math.max(b[a].indent, 0) < p) break 20183 } 20184 if (m) 20185 for (b = h.getFirst(); b;) { 20186 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()))) { 20187 for (f = 20188 e.getParent(); f && !(k = f.getDirection());) f = f.getParent(); 20189 c == k && e.removeAttribute("dir") 20190 } 20191 b = b.getNextSourceNode() 20192 } 20193 return { 20194 listNode: h, 20195 nextIndex: a 20196 } 20197 } 20198 }; 20199 var L = /^h[1-6]$/, 20200 J = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT); 20201 B.prototype = { 20202 exec: function(b) { 20203 this.refresh(b, b.elementPath()); 20204 var m = b.config, 20205 e = b.getSelection(), 20206 c = e && e.getRanges(); 20207 if (this.state == CKEDITOR.TRISTATE_OFF) { 20208 var f = b.editable(); 20209 if (f.getFirst(u)) { 20210 var g = 1 == c.length && c[0]; 20211 (m = g && g.getEnclosedNode()) && m.is && this.type == m.getName() && this.setState(CKEDITOR.TRISTATE_ON) 20212 } else m.enterMode == 20213 CKEDITOR.ENTER_BR ? f.appendBogus() : c[0].fixBlock(1, m.enterMode == CKEDITOR.ENTER_P ? "p" : "div"), e.selectRanges(c) 20214 } 20215 for (var m = e.createBookmarks(!0), f = [], k = {}, c = c.createIterator(), h = 0; 20216 (g = c.getNextRange()) && ++h;) { 20217 var d = g.getBoundaryNodes(), 20218 a = d.startNode, 20219 p = d.endNode; 20220 a.type == CKEDITOR.NODE_ELEMENT && "td" == a.getName() && g.setStartAt(d.startNode, CKEDITOR.POSITION_AFTER_START); 20221 p.type == CKEDITOR.NODE_ELEMENT && "td" == p.getName() && g.setEndAt(d.endNode, CKEDITOR.POSITION_BEFORE_END); 20222 g = g.createIterator(); 20223 for (g.forceBrBreak = 20224 this.state == CKEDITOR.TRISTATE_OFF; d = g.getNextParagraph();) 20225 if (!d.getCustomData("list_block")) { 20226 CKEDITOR.dom.element.setMarker(k, d, "list_block", 1); 20227 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--) 20228 if (v[q.getName()] && l.contains(q)) { 20229 l.removeCustomData("list_group_object_" + h); 20230 (a = q.getCustomData("list_group_object")) ? a.contents.push(d): (a = { 20231 root: q, 20232 contents: [d] 20233 }, f.push(a), CKEDITOR.dom.element.setMarker(k, q, "list_group_object", a)); 20234 p = 1; 20235 break 20236 } p || (p = l, p.getCustomData("list_group_object_" + 20237 h) ? p.getCustomData("list_group_object_" + h).contents.push(d) : (a = { 20238 root: p, 20239 contents: [d] 20240 }, CKEDITOR.dom.element.setMarker(k, p, "list_group_object_" + h, a), f.push(a))) 20241 } 20242 } 20243 for (q = []; 0 < f.length;) 20244 if (a = f.shift(), this.state == CKEDITOR.TRISTATE_OFF) 20245 if (v[a.root.getName()]) { 20246 c = b; 20247 h = a; 20248 a = k; 20249 g = q; 20250 p = CKEDITOR.plugins.list.listToArray(h.root, a); 20251 l = []; 20252 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", 20253 !0)); 20254 for (var n = h.root.getDocument(), t = void 0, r = void 0, d = 0; d < l.length; d++) { 20255 var y = l[d].getCustomData("listarray_index"), 20256 t = p[y].parent; 20257 t.is(this.type) || (r = n.createElement(this.type), t.copyAttributes(r, { 20258 start: 1, 20259 type: 1 20260 }), r.removeStyle("list-style-type"), p[y].parent = r) 20261 } 20262 a = CKEDITOR.plugins.list.arrayToList(p, a, null, c.config.enterMode); 20263 p = void 0; 20264 l = a.listNode.getChildCount(); 20265 for (d = 0; d < l && (p = a.listNode.getChild(d)); d++) p.getName() == this.type && g.push(p); 20266 a.listNode.replace(h.root); 20267 c.fire("contentDomInvalidated") 20268 } else { 20269 p = 20270 b; 20271 g = a; 20272 d = q; 20273 l = g.contents; 20274 c = g.root.getDocument(); 20275 h = []; 20276 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); 20277 g = g.contents[0].getParent(); 20278 for (n = 0; n < l.length; n++) g = g.getCommonAncestor(l[n].getParent()); 20279 t = p.config.useComputedState; 20280 p = a = void 0; 20281 t = void 0 === t || t; 20282 for (n = 0; n < l.length; n++) 20283 for (r = l[n]; y = r.getParent();) { 20284 if (y.equals(g)) { 20285 h.push(r); 20286 !p && r.getDirection() && (p = 1); 20287 r = r.getDirection(t); 20288 null !== a && (a = a && a != r ? null : r); 20289 break 20290 } 20291 r = y 20292 } 20293 if (!(1 > h.length)) { 20294 l = 20295 h[h.length - 1].getNext(); 20296 n = c.createElement(this.type); 20297 d.push(n); 20298 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); 20299 a && p && n.setAttribute("dir", a); 20300 l ? n.insertBefore(l) : n.appendTo(g) 20301 } 20302 } 20303 else this.state == CKEDITOR.TRISTATE_ON && v[a.root.getName()] && I.call(this, b, a, k); 20304 for (n = 0; n < q.length; n++) F(q[n]); 20305 CKEDITOR.dom.element.clearAllMarkers(k); 20306 e.selectBookmarks(m); 20307 b.focus() 20308 }, 20309 refresh: function(b, m) { 20310 var e = m.contains(v, 1), 20311 c = m.blockLimit || m.root; 20312 e && c.contains(e) ? this.setState(e.is(this.type) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_OFF) 20313 } 20314 }; 20315 CKEDITOR.plugins.add("list", { 20316 requires: "indentlist", 20317 init: function(b) { 20318 b.blockless || (b.addCommand("numberedlist", new B("numberedlist", "ol")), b.addCommand("bulletedlist", new B("bulletedlist", "ul")), b.ui.addButton && 20319 (b.ui.addButton("NumberedList", { 20320 label: b.lang.list.numberedlist, 20321 command: "numberedlist", 20322 directional: !0, 20323 toolbar: "list,10" 20324 }), b.ui.addButton("BulletedList", { 20325 label: b.lang.list.bulletedlist, 20326 command: "bulletedlist", 20327 directional: !0, 20328 toolbar: "list,20" 20329 })), b.on("key", function(m) { 20330 var e = m.data.domEvent.getKey(), 20331 c; 20332 if ("wysiwyg" == b.mode && e in { 20333 8: 1, 20334 46: 1 20335 }) { 20336 var f = b.getSelection().getRanges()[0], 20337 g = f && f.startPath(); 20338 if (f && f.collapsed) { 20339 var k = 8 == e, 20340 h = b.editable(), 20341 d = new CKEDITOR.dom.walker(f.clone()); 20342 d.evaluator = function(a) { 20343 return u(a) && 20344 !z(a) 20345 }; 20346 d.guard = function(a, b) { 20347 return !(b && a.type == CKEDITOR.NODE_ELEMENT && a.is("table")) 20348 }; 20349 e = f.clone(); 20350 if (k) { 20351 var a; 20352 (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), 20353 d.reset(), d.evaluator = G, a = d.previous()), c = a, e.moveToElementEditEnd(c), e.moveToPosition(e.endPath().block, CKEDITOR.POSITION_BEFORE_END))); 20354 if (c) C(b, e, f), m.cancel(); 20355 else { 20356 var p = g.contains(v); 20357 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())) 20358 } 20359 } else if (c = g.contains("li")) { 20360 if (d.range.setEndAt(h, CKEDITOR.POSITION_BEFORE_END), k = (h = c.getLast(u)) && 20361 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) { 20362 f = f.clone(); 20363 f.moveToElementEditStart(a); 20364 if (1 == g && (e.optimize(), !e.startContainer.equals(c))) { 20365 for (c = e.startContainer; c.is(CKEDITOR.dtd.$inline);) p = c, c = c.getParent(); 20366 p && e.moveToPosition(p, CKEDITOR.POSITION_AFTER_END) 20367 } 20368 2 == g && (e.moveToPosition(e.endPath().block, CKEDITOR.POSITION_BEFORE_END), f.endPath().block && f.moveToPosition(f.endPath().block, CKEDITOR.POSITION_AFTER_START)); 20369 C(b, e, f); 20370 m.cancel() 20371 } 20372 } 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()); 20373 setTimeout(function() { 20374 b.selectionChange(1) 20375 }) 20376 } 20377 } 20378 })) 20379 } 20380 }) 20381 })(); 20382 (function() { 20383 CKEDITOR.plugins.liststyle = { 20384 requires: "dialog,contextmenu", 20385 init: function(a) { 20386 if (!a.blockless) { 20387 var b; 20388 b = new CKEDITOR.dialogCommand("numberedListStyle", { 20389 requiredContent: "ol", 20390 allowedContent: "ol{list-style-type}[start]; li{list-style-type}[value]", 20391 contentTransformations: [ 20392 ["ol: listTypeToStyle"] 20393 ] 20394 }); 20395 b = a.addCommand("numberedListStyle", b); 20396 a.addFeature(b); 20397 CKEDITOR.dialog.add("numberedListStyle", this.path + "dialogs/liststyle.js"); 20398 b = new CKEDITOR.dialogCommand("bulletedListStyle", { 20399 requiredContent: "ul", 20400 allowedContent: "ul{list-style-type}", 20401 contentTransformations: [ 20402 ["ul: listTypeToStyle"] 20403 ] 20404 }); 20405 b = a.addCommand("bulletedListStyle", b); 20406 a.addFeature(b); 20407 CKEDITOR.dialog.add("bulletedListStyle", this.path + "dialogs/liststyle.js"); 20408 a.addMenuGroup("list", 108); 20409 a.addMenuItems({ 20410 numberedlist: { 20411 label: a.lang.liststyle.numberedTitle, 20412 group: "list", 20413 command: "numberedListStyle" 20414 }, 20415 bulletedlist: { 20416 label: a.lang.liststyle.bulletedTitle, 20417 group: "list", 20418 command: "bulletedListStyle" 20419 } 20420 }); 20421 a.contextMenu.addListener(function(a) { 20422 if (!a || a.isReadOnly()) return null; 20423 for (; a;) { 20424 var b = a.getName(); 20425 if ("ol" == b) return { 20426 numberedlist: CKEDITOR.TRISTATE_OFF 20427 }; 20428 if ("ul" == b) return { 20429 bulletedlist: CKEDITOR.TRISTATE_OFF 20430 }; 20431 a = a.getParent() 20432 } 20433 return null 20434 }) 20435 } 20436 } 20437 }; 20438 CKEDITOR.plugins.add("liststyle", CKEDITOR.plugins.liststyle) 20439 })(); 20440 (function() { 20441 function V(a, c, d) { 20442 return n(c) && n(d) && d.equals(c.getNext(function(a) { 20443 return !(E(a) || F(a) || u(a)) 20444 })) 20445 } 20446 20447 function z(a) { 20448 this.upper = a[0]; 20449 this.lower = a[1]; 20450 this.set.apply(this, a.slice(2)) 20451 } 20452 20453 function O(a) { 20454 var c = a.element; 20455 if (c && n(c) && (c = c.getAscendant(a.triggers, !0)) && a.editable.contains(c)) { 20456 var d = P(c); 20457 if ("true" == d.getAttribute("contenteditable")) return c; 20458 if (d.is(a.triggers)) return d 20459 } 20460 return null 20461 } 20462 20463 function ka(a, c, d) { 20464 r(a, c); 20465 r(a, d); 20466 a = c.size.bottom; 20467 d = d.size.top; 20468 return a && d ? 0 | (a + d) / 2 : a || d 20469 } 20470 20471 function w(a, c, d) { 20472 return c = 20473 c[d ? "getPrevious" : "getNext"](function(b) { 20474 return b && b.type == CKEDITOR.NODE_TEXT && !E(b) || n(b) && !u(b) && !A(a, b) 20475 }) 20476 } 20477 20478 function q(a, c, d) { 20479 return a > c && a < d 20480 } 20481 20482 function P(a, c) { 20483 if (a.data("cke-editable")) return null; 20484 for (c || (a = a.getParent()); a && !a.data("cke-editable");) { 20485 if (a.hasAttribute("contenteditable")) return a; 20486 a = a.getParent() 20487 } 20488 return null 20489 } 20490 20491 function la(a) { 20492 var c = a.doc, 20493 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', 20494 c), 20495 b = CKEDITOR.getUrl(this.path + "images/" + (t.hidpi ? "hidpi/" : "") + "icon" + (a.rtl ? "-rtl" : "") + ".png"); 20496 v(d, { 20497 attach: function() { 20498 this.wrap.getParent() || this.wrap.appendTo(a.editable, !0); 20499 return this 20500 }, 20501 lineChildren: [v(G('\x3cspan title\x3d"' + a.editor.lang.magicline.title + '" contenteditable\x3d"false"\x3e\x26#8629;\x3c/span\x3e', c), { 20502 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;" : 20503 "") + (t.hidpi ? "background-size: 9px 10px;" : ""), 20504 looks: ["top:-8px; border-radius: 2px;", "top:-17px; border-radius: 2px 2px 0px 0px;", "top:-1px; border-radius: 0px 0px 2px 2px;"] 20505 }), v(G(W, c), { 20506 base: X + "left:0px;border-left-color:" + a.boxColor + ";", 20507 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"] 20508 }), v(G(W, c), { 20509 base: X + "right:0px;border-right-color:" + a.boxColor + ";", 20510 looks: ["border-width:8px 8px 8px 0;top:-8px", "border-width:8px 8px 0 0;top:-8px", 20511 "border-width:0 8px 8px 0;top:0px" 20512 ] 20513 })], 20514 detach: function() { 20515 this.wrap.getParent() && this.wrap.remove(); 20516 return this 20517 }, 20518 mouseNear: function() { 20519 r(a, this); 20520 var b = a.holdDistance, 20521 c = this.size; 20522 return c && q(a.mouse.y, c.top - b, c.bottom + b) && q(a.mouse.x, c.left - b, c.right + b) ? !0 : !1 20523 }, 20524 place: function() { 20525 var b = a.view, 20526 c = a.editable, 20527 d = a.trigger, 20528 h = d.upper, 20529 g = d.lower, 20530 l = h || g, 20531 p = l.getParent(), 20532 m = {}; 20533 this.trigger = d; 20534 h && r(a, h, !0); 20535 g && r(a, g, !0); 20536 r(a, p, !0); 20537 a.inInlineMode && H(a, !0); 20538 p.equals(c) ? (m.left = b.scroll.x, m.right = -b.scroll.x, m.width = "") : (m.left = 20539 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 = ""); 20540 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; 20541 d.is(C) || q(m.top, 20542 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)); 20543 a.inInlineMode && (m.top--, m.top += b.editable.scroll.top, m.left += b.editable.scroll.left); 20544 for (var n in m) m[n] = CKEDITOR.tools.cssLength(m[n]); 20545 this.setStyles(m) 20546 }, 20547 look: function(a) { 20548 if (this.oldLook != 20549 a) { 20550 for (var b = this.lineChildren.length, c; b--;)(c = this.lineChildren[b]).setAttribute("style", c.base + c.looks[0 | a / 2]); 20551 this.oldLook = a 20552 } 20553 }, 20554 wrap: new R("span", a.doc) 20555 }); 20556 for (c = d.lineChildren.length; c--;) d.lineChildren[c].appendTo(d); 20557 d.look(x); 20558 d.appendTo(d.wrap); 20559 d.unselectable(); 20560 d.lineChildren[0].on("mouseup", function(b) { 20561 d.detach(); 20562 S(a, function(b) { 20563 var c = a.line.trigger; 20564 b[c.is(I) ? "insertBefore" : "insertAfter"](c.is(I) ? c.lower : c.upper) 20565 }, !0); 20566 a.editor.focus(); 20567 t.ie || a.enterMode == CKEDITOR.ENTER_BR || a.hotNode.scrollIntoView(); 20568 b.data.preventDefault(!0) 20569 }); 20570 d.on("mousedown", function(a) { 20571 a.data.preventDefault(!0) 20572 }); 20573 a.line = d 20574 } 20575 20576 function S(a, c, d) { 20577 var b = new CKEDITOR.dom.range(a.doc), 20578 e = a.editor, 20579 f; 20580 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)); 20581 d && e.fire("saveSnapshot"); 20582 c(f); 20583 b.moveToPosition(f, CKEDITOR.POSITION_AFTER_START); 20584 e.getSelection().selectRanges([b]); 20585 a.hotNode = f; 20586 d && e.fire("saveSnapshot") 20587 } 20588 20589 function Y(a, c) { 20590 return { 20591 canUndo: !0, 20592 modes: { 20593 wysiwyg: 1 20594 }, 20595 exec: function() { 20596 function d(b) { 20597 var d = t.ie && 9 > t.version ? " " : J, 20598 f = a.hotNode && a.hotNode.getText() == d && a.element.equals(a.hotNode) && a.lastCmdDirection === !!c; 20599 S(a, function(d) { 20600 f && a.hotNode && a.hotNode.remove(); 20601 d[c ? "insertAfter" : "insertBefore"](b); 20602 d.setAttributes({ 20603 "data-cke-magicline-hot": 1, 20604 "data-cke-magicline-dir": !!c 20605 }); 20606 a.lastCmdDirection = !!c 20607 }); 20608 t.ie || a.enterMode == CKEDITOR.ENTER_BR || a.hotNode.scrollIntoView(); 20609 a.line.detach() 20610 } 20611 return function(b) { 20612 b = b.getSelection().getStartElement(); 20613 var e; 20614 b = b.getAscendant(Z, 1); 20615 if (!aa(a, b) && b && !b.equals(a.editable) && !b.contains(a.editable)) { 20616 (e = P(b)) && "false" == e.getAttribute("contenteditable") && (b = e); 20617 a.element = b; 20618 e = w(a, b, !c); 20619 var f; 20620 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))) 20621 } 20622 } 20623 }() 20624 } 20625 } 20626 20627 function A(a, c) { 20628 if (!c || c.type != CKEDITOR.NODE_ELEMENT || !c.$) return !1; 20629 var d = a.line; 20630 return d.wrap.equals(c) || d.wrap.contains(c) 20631 } 20632 20633 function n(a) { 20634 return a && 20635 a.type == CKEDITOR.NODE_ELEMENT && a.$ 20636 } 20637 20638 function u(a) { 20639 if (!n(a)) return !1; 20640 var c; 20641 (c = ba(a)) || (n(a) ? (c = { 20642 left: 1, 20643 right: 1, 20644 center: 1 20645 }, c = !(!c[a.getComputedStyle("float")] && !c[a.getAttribute("align")])) : c = !1); 20646 return c 20647 } 20648 20649 function ba(a) { 20650 return !!{ 20651 absolute: 1, 20652 fixed: 1 20653 } [a.getComputedStyle("position")] 20654 } 20655 20656 function L(a, c) { 20657 return n(c) ? c.is(a.triggers) : null 20658 } 20659 20660 function aa(a, c) { 20661 if (!c) return !1; 20662 for (var d = c.getParents(1), b = d.length; b--;) 20663 for (var e = a.tabuList.length; e--;) 20664 if (d[b].hasAttribute(a.tabuList[e])) return !0; 20665 return !1 20666 } 20667 20668 function na(a, 20669 c, d) { 20670 c = c[d ? "getLast" : "getFirst"](function(b) { 20671 return a.isRelevant(b) && !b.is(oa) 20672 }); 20673 if (!c) return !1; 20674 r(a, c); 20675 return d ? c.size.top > a.mouse.y : c.size.bottom < a.mouse.y 20676 } 20677 20678 function ca(a) { 20679 var c = a.editable, 20680 d = a.mouse, 20681 b = a.view, 20682 e = a.triggerOffset; 20683 H(a); 20684 var f = d.y > (a.inInlineMode ? b.editable.top + b.editable.height / 2 : Math.min(b.editable.height, b.pane.height) / 2), 20685 c = c[f ? "getLast" : "getFirst"](function(a) { 20686 return !(E(a) || F(a)) 20687 }); 20688 if (!c) return null; 20689 A(a, c) && (c = a.line.wrap[f ? "getPrevious" : "getNext"](function(a) { 20690 return !(E(a) || F(a)) 20691 })); 20692 if (!n(c) || u(c) || !L(a, c)) return null; 20693 r(a, c); 20694 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 20695 } 20696 20697 function ea(a) { 20698 var c = a.mouse, 20699 d = a.view, 20700 b = a.triggerOffset, 20701 e = O(a); 20702 if (!e) return null; 20703 r(a, e); 20704 var b = Math.min(b, 0 | e.size.outerHeight / 2), 20705 f = [], 20706 k, h; 20707 if (q(c.y, e.size.top - 1, e.size.top + b)) h = !1; 20708 else if (q(c.y, 20709 e.size.bottom - b, e.size.bottom + 1)) h = !0; 20710 else return null; 20711 if (u(e) || na(a, e, h) || e.getParent().is(fa)) return null; 20712 var g = w(a, e, !h); 20713 if (g) { 20714 if (g && g.type == CKEDITOR.NODE_TEXT) return null; 20715 if (n(g)) { 20716 if (u(g) || !L(a, g) || g.getParent().is(fa)) return null; 20717 f = [g, e][h ? "reverse" : "concat"]().concat([T, M]) 20718 } 20719 } 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" : 20720 "concat" 20721 ]().concat([h ? da : I, M, k, e.equals(a.editable[h ? "getLast" : "getFirst"](a.isRelevant)) ? h ? D : C : x]); 20722 return 0 in f ? new z(f) : null 20723 } 20724 20725 function U(a, c, d, b) { 20726 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; 20727 d && !b || N(a, b); 20728 g.top = e.y - (d ? 0 : a.view.scroll.y); 20729 g.left = e.x - (d ? 0 : a.view.scroll.x); 20730 g.outerWidth = c.$.offsetWidth; 20731 g.outerHeight = c.$.offsetHeight; 20732 g.height = g.outerHeight - (h.top + h.bottom + f.top + f.bottom); 20733 g.width = g.outerWidth - (h.left + h.right + f.left + f.right); 20734 g.bottom = g.top + g.outerHeight; 20735 g.right = g.left + g.outerWidth; 20736 a.inInlineMode && (g.scroll = { 20737 top: c.$.scrollTop, 20738 left: c.$.scrollLeft 20739 }); 20740 return v({ 20741 border: f, 20742 padding: h, 20743 margin: k, 20744 ignoreScroll: d 20745 }, g, !0) 20746 } 20747 20748 function r(a, c, d) { 20749 if (!n(c)) return c.size = null; 20750 if (!c.size) c.size = {}; 20751 else if (c.size.ignoreScroll == d && c.size.date > new Date - ga) return null; 20752 return v(c.size, 20753 U(a, c, d), { 20754 date: +new Date 20755 }, !0) 20756 } 20757 20758 function H(a, c) { 20759 a.view.editable = U(a, a.editable, c, !0) 20760 } 20761 20762 function N(a, c) { 20763 a.view || (a.view = {}); 20764 var d = a.view; 20765 if (!(!c && d && d.date > new Date - ga)) { 20766 var b = a.win, 20767 d = b.getScrollPosition(), 20768 b = b.getViewPaneSize(); 20769 v(a.view, { 20770 scroll: { 20771 x: d.x, 20772 y: d.y, 20773 width: a.doc.$.documentElement.scrollWidth - b.width, 20774 height: a.doc.$.documentElement.scrollHeight - b.height 20775 }, 20776 pane: { 20777 width: b.width, 20778 height: b.height, 20779 bottom: b.height + d.y 20780 }, 20781 date: +new Date 20782 }, !0) 20783 } 20784 } 20785 20786 function pa(a, c, d, b) { 20787 for (var e = b, f = b, k = 0, h = !1, g = !1, l = a.view.pane.height, 20788 p = a.mouse; p.y + k < l && 0 < p.y - k;) { 20789 h || (h = c(e, b)); 20790 g || (g = c(f, b)); 20791 !h && 0 < p.y - k && (e = d(a, { 20792 x: p.x, 20793 y: p.y - k 20794 })); 20795 !g && p.y + k < l && (f = d(a, { 20796 x: p.x, 20797 y: p.y + k 20798 })); 20799 if (h && g) break; 20800 k += 2 20801 } 20802 return new z([e, f, null, null]) 20803 } 20804 CKEDITOR.plugins.add("magicline", { 20805 init: function(a) { 20806 var c = a.config, 20807 d = c.magicline_triggerOffset || 30, 20808 b = { 20809 editor: a, 20810 enterMode: c.enterMode, 20811 triggerOffset: d, 20812 holdDistance: 0 | d * (c.magicline_holdDistance || .5), 20813 boxColor: c.magicline_color || "#ff0000", 20814 rtl: "rtl" == c.contentsLangDirection, 20815 tabuList: ["data-cke-hidden-sel"].concat(c.magicline_tabuList || []), 20816 triggers: c.magicline_everywhere ? Z : { 20817 table: 1, 20818 hr: 1, 20819 div: 1, 20820 ul: 1, 20821 ol: 1, 20822 dl: 1, 20823 form: 1, 20824 blockquote: 1 20825 } 20826 }, 20827 e, f, k; 20828 b.isRelevant = function(a) { 20829 return n(a) && !A(b, a) && !u(a) 20830 }; 20831 a.on("contentDom", function() { 20832 var d = a.editable(), 20833 g = a.document, 20834 l = a.window; 20835 v(b, { 20836 editable: d, 20837 inInlineMode: d.isInline(), 20838 doc: g, 20839 win: l, 20840 hotNode: null 20841 }, !0); 20842 b.boundary = b.inInlineMode ? b.editable : b.doc.getDocumentElement(); 20843 d.is(B.$inline) || (b.inInlineMode && !ba(d) && d.setStyles({ 20844 position: "relative", 20845 top: null, 20846 left: null 20847 }), la.call(this, b), N(b), d.attachListener(a, "beforeUndoImage", 20848 function() { 20849 b.line.detach() 20850 }), d.attachListener(a, "beforeGetData", function() { 20851 b.line.wrap.getParent() && (b.line.detach(), a.once("getData", function() { 20852 b.line.attach() 20853 }, null, null, 1E3)) 20854 }, null, null, 0), d.attachListener(b.inInlineMode ? g : g.getWindow().getFrame(), "mouseout", function(c) { 20855 if ("wysiwyg" == a.mode) 20856 if (b.inInlineMode) { 20857 var d = c.data.$.clientX; 20858 c = c.data.$.clientY; 20859 N(b); 20860 H(b, !0); 20861 var e = b.view.editable, 20862 f = b.view.scroll; 20863 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()) 20864 } else clearTimeout(k), 20865 k = null, b.line.detach() 20866 }), d.attachListener(d, "keyup", function() { 20867 b.hiddenMode = 0 20868 }), d.attachListener(d, "keydown", function(c) { 20869 if ("wysiwyg" == a.mode) switch (c.data.getKeystroke()) { 20870 case 2228240: 20871 case 16: 20872 b.hiddenMode = 1, b.line.detach() 20873 } 20874 }), d.attachListener(b.inInlineMode ? d : g, "mousemove", function(c) { 20875 f = !0; 20876 if ("wysiwyg" == a.mode && !a.readOnly && !k) { 20877 var d = { 20878 x: c.data.$.clientX, 20879 y: c.data.$.clientY 20880 }; 20881 k = setTimeout(function() { 20882 b.mouse = d; 20883 k = b.trigger = null; 20884 N(b); 20885 f && !b.hiddenMode && a.focusManager.hasFocus && !b.line.mouseNear() && (b.element = 20886 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) 20887 }, 30) 20888 } 20889 }), d.attachListener(l, "scroll", function() { 20890 "wysiwyg" == a.mode && (b.line.detach(), t.webkit && (b.hiddenMode = 1, clearTimeout(e), e = setTimeout(function() { 20891 b.mouseDown || (b.hiddenMode = 0) 20892 }, 50))) 20893 }), d.attachListener(ja ? g : l, "mousedown", function() { 20894 "wysiwyg" == a.mode && (b.line.detach(), b.hiddenMode = 1, b.mouseDown = 1) 20895 }), d.attachListener(ja ? g : l, "mouseup", function() { 20896 b.hiddenMode = 20897 0; 20898 b.mouseDown = 0 20899 }), a.addCommand("accessPreviousSpace", Y(b)), a.addCommand("accessNextSpace", Y(b, !0)), a.setKeystroke([ 20900 [c.magicline_keystrokePrevious, "accessPreviousSpace"], 20901 [c.magicline_keystrokeNext, "accessNextSpace"] 20902 ]), a.on("loadSnapshot", function() { 20903 var c, d, e, f; 20904 for (f in { 20905 p: 1, 20906 br: 1, 20907 div: 1 20908 }) 20909 for (c = a.document.getElementsByTag(f), e = c.count(); e--;) 20910 if ((d = c.getItem(e)).data("cke-magicline-hot")) { 20911 b.hotNode = d; 20912 b.lastCmdDirection = "true" === d.data("cke-magicline-dir") ? !0 : !1; 20913 return 20914 } 20915 }), this.backdoor = { 20916 accessFocusSpace: S, 20917 boxTrigger: z, 20918 isLine: A, 20919 getAscendantTrigger: O, 20920 getNonEmptyNeighbour: w, 20921 getSize: U, 20922 that: b, 20923 triggerEdge: ea, 20924 triggerEditable: ca, 20925 triggerExpand: ia 20926 }) 20927 }, this) 20928 } 20929 }); 20930 var v = CKEDITOR.tools.extend, 20931 R = CKEDITOR.dom.element, 20932 G = R.createFromHtml, 20933 t = CKEDITOR.env, 20934 ja = CKEDITOR.env.ie && 9 > CKEDITOR.env.version, 20935 B = CKEDITOR.dtd, 20936 K = {}, 20937 I = 128, 20938 da = 64, 20939 T = 32, 20940 M = 16, 20941 C = 4, 20942 D = 2, 20943 x = 1, 20944 J = " ", 20945 fa = B.$listItem, 20946 oa = B.$tableContent, 20947 ma = v({}, B.$nonEditable, B.$empty), 20948 Z = B.$block, 20949 ga = 100, 20950 Q = "width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;", 20951 X = Q + "border-color:transparent;display:block;border-style:solid;", 20952 W = "\x3cspan\x3e" + J + "\x3c/span\x3e"; 20953 K[CKEDITOR.ENTER_BR] = "br"; 20954 K[CKEDITOR.ENTER_P] = "p"; 20955 K[CKEDITOR.ENTER_DIV] = "div"; 20956 z.prototype = { 20957 set: function(a, c, d) { 20958 this.properties = a + c + (d || x); 20959 return this 20960 }, 20961 is: function(a) { 20962 return (this.properties & a) == a 20963 } 20964 }; 20965 var ha = function() { 20966 function a(a, d) { 20967 var b = a.$.elementFromPoint(d.x, d.y); 20968 return b && b.nodeType ? new CKEDITOR.dom.element(b) : null 20969 } 20970 return function(c, d, b) { 20971 if (!c.mouse) return null; 20972 var e = c.doc, 20973 f = c.line.wrap; 20974 b = b || c.mouse; 20975 var k = a(e, b); 20976 d && A(c, k) && (f.hide(), k = a(e, b), f.show()); 20977 return !k || k.type != CKEDITOR.NODE_ELEMENT || !k.$ || t.ie && 9 > t.version && !c.boundary.equals(k) && !c.boundary.contains(k) ? null : k 20978 } 20979 }(), 20980 E = CKEDITOR.dom.walker.whitespaces(), 20981 F = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT), 20982 ia = function() { 20983 function a(a) { 20984 var b = a.element, 20985 e, f, k; 20986 if (!n(b) || b.contains(a.editable) || b.isReadOnly()) return null; 20987 k = pa(a, function(a, b) { 20988 return !b.equals(a) 20989 }, function(a, b) { 20990 return ha(a, !0, b) 20991 }, b); 20992 e = k.upper; 20993 f = k.lower; 20994 if (V(a, e, f)) return k.set(T, 20995 8); 20996 if (e && b.contains(e)) 20997 for (; !e.getParent().equals(b);) e = e.getParent(); 20998 else e = b.getFirst(function(b) { 20999 return c(a, b) 21000 }); 21001 if (f && b.contains(f)) 21002 for (; !f.getParent().equals(b);) f = f.getParent(); 21003 else f = b.getLast(function(b) { 21004 return c(a, b) 21005 }); 21006 if (!e || !f) return null; 21007 r(a, e); 21008 r(a, f); 21009 if (!q(a.mouse.y, e.size.top, f.size.bottom)) return null; 21010 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); 21011 if (!l || !p || !q(a.mouse.y, l.size.top, p.size.bottom)) return null; 21012 k.upper = l; 21013 k.lower = p; 21014 return k.set(T, 8) 21015 } 21016 21017 function c(a, b) { 21018 return !(b && b.type == CKEDITOR.NODE_TEXT || F(b) || u(b) || A(a, b) || b.type == CKEDITOR.NODE_ELEMENT && b.$ && b.is("br")) 21019 } 21020 return function(c) { 21021 var b = a(c), 21022 e; 21023 if (e = b) { 21024 e = b.upper; 21025 var f = b.lower; 21026 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 21027 } 21028 return e ? b : null 21029 } 21030 }(), 21031 y = ["top", "left", "right", "bottom"] 21032 })(); 21033 CKEDITOR.config.magicline_keystrokePrevious = CKEDITOR.CTRL + CKEDITOR.SHIFT + 51; 21034 CKEDITOR.config.magicline_keystrokeNext = CKEDITOR.CTRL + CKEDITOR.SHIFT + 52; 21035 (function() { 21036 function n(a) { 21037 if (!a || a.type != CKEDITOR.NODE_ELEMENT || "form" != a.getName()) return []; 21038 for (var e = [], f = ["style", "className"], b = 0; b < f.length; b++) { 21039 var c = a.$.elements.namedItem(f[b]); 21040 c && (c = new CKEDITOR.dom.element(c), e.push([c, c.nextSibling]), c.remove()) 21041 } 21042 return e 21043 } 21044 21045 function t(a, e) { 21046 if (a && a.type == CKEDITOR.NODE_ELEMENT && "form" == a.getName() && 0 < e.length) 21047 for (var f = e.length - 1; 0 <= f; f--) { 21048 var b = e[f][0], 21049 c = e[f][1]; 21050 c ? b.insertBefore(c) : b.appendTo(a) 21051 } 21052 } 21053 21054 function r(a, e) { 21055 var f = n(a), 21056 b = {}, 21057 c = a.$; 21058 e || (b["class"] = c.className || 21059 "", c.className = ""); 21060 b.inline = c.style.cssText || ""; 21061 e || (c.style.cssText = "position: static; overflow: visible"); 21062 t(f); 21063 return b 21064 } 21065 21066 function u(a, e) { 21067 var f = n(a), 21068 b = a.$; 21069 "class" in e && (b.className = e["class"]); 21070 "inline" in e && (b.style.cssText = e.inline); 21071 t(f) 21072 } 21073 21074 function v(a) { 21075 if (!a.editable().isInline()) { 21076 var e = CKEDITOR.instances, 21077 f; 21078 for (f in e) { 21079 var b = e[f]; 21080 "wysiwyg" != b.mode || b.readOnly || (b = b.document.getBody(), b.setAttribute("contentEditable", !1), b.setAttribute("contentEditable", !0)) 21081 } 21082 a.editable().hasFocus && (a.toolbox.focus(), 21083 a.focus()) 21084 } 21085 } 21086 CKEDITOR.plugins.add("maximize", { 21087 init: function(a) { 21088 function e() { 21089 var b = c.getViewPaneSize(); 21090 a.resize(b.width, b.height, null, !0) 21091 } 21092 if (a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) { 21093 var f = a.lang, 21094 b = CKEDITOR.document, 21095 c = b.getWindow(), 21096 l, m, p, n = CKEDITOR.TRISTATE_OFF; 21097 a.addCommand("maximize", { 21098 modes: { 21099 wysiwyg: !CKEDITOR.env.iOS, 21100 source: !CKEDITOR.env.iOS 21101 }, 21102 readOnly: 1, 21103 editorFocus: !1, 21104 exec: function() { 21105 var h = a.container.getFirst(function(a) { 21106 return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_inner") 21107 }), 21108 g = a.ui.space("contents"); 21109 if ("wysiwyg" == a.mode) { 21110 var d = a.getSelection(); 21111 l = d && d.getRanges(); 21112 m = c.getScrollPosition() 21113 } else { 21114 var k = a.editable().$; 21115 l = !CKEDITOR.env.ie && [k.selectionStart, k.selectionEnd]; 21116 m = [k.scrollLeft, k.scrollTop] 21117 } 21118 if (this.state == CKEDITOR.TRISTATE_OFF) { 21119 c.on("resize", e); 21120 p = c.getScrollPosition(); 21121 for (d = a.container; d = d.getParent();) d.setCustomData("maximize_saved_styles", r(d)), d.setStyle("z-index", a.config.baseFloatZIndex - 5); 21122 g.setCustomData("maximize_saved_styles", r(g, !0)); 21123 h.setCustomData("maximize_saved_styles", r(h, !0)); 21124 g = { 21125 overflow: CKEDITOR.env.webkit ? "" : "hidden", 21126 width: 0, 21127 height: 0 21128 }; 21129 b.getDocumentElement().setStyles(g); 21130 !CKEDITOR.env.gecko && b.getDocumentElement().setStyle("position", "fixed"); 21131 CKEDITOR.env.gecko && CKEDITOR.env.quirks || b.getBody().setStyles(g); 21132 CKEDITOR.env.ie ? setTimeout(function() { 21133 c.$.scrollTo(0, 0) 21134 }, 0) : c.$.scrollTo(0, 0); 21135 h.setStyle("position", CKEDITOR.env.gecko && CKEDITOR.env.quirks ? "fixed" : "absolute"); 21136 h.$.offsetLeft; 21137 h.setStyles({ 21138 "z-index": a.config.baseFloatZIndex - 5, 21139 left: "0px", 21140 top: "0px" 21141 }); 21142 h.addClass("cke_maximized"); 21143 e(); 21144 g = h.getDocumentPosition(); 21145 h.setStyles({ 21146 left: -1 * g.x + "px", 21147 top: -1 * g.y + "px" 21148 }); 21149 CKEDITOR.env.gecko && v(a) 21150 } else if (this.state == CKEDITOR.TRISTATE_ON) { 21151 c.removeListener("resize", e); 21152 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"); 21153 for (d = a.container; d = d.getParent();) u(d, d.getCustomData("maximize_saved_styles")), d.removeCustomData("maximize_saved_styles"); 21154 CKEDITOR.env.ie ? setTimeout(function() { 21155 c.$.scrollTo(p.x, p.y) 21156 }, 0) : c.$.scrollTo(p.x, 21157 p.y); 21158 h.removeClass("cke_maximized"); 21159 CKEDITOR.env.webkit && (h.setStyle("display", "inline"), setTimeout(function() { 21160 h.setStyle("display", "block") 21161 }, 0)); 21162 a.fire("resize", { 21163 outerHeight: a.container.$.offsetHeight, 21164 contentsHeight: g.$.offsetHeight, 21165 outerWidth: a.container.$.offsetWidth 21166 }) 21167 } 21168 this.toggleState(); 21169 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("' + 21170 g + '");'); 21171 "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]); 21172 l = m = null; 21173 n = this.state; 21174 a.fire("maximize", this.state) 21175 }, 21176 canUndo: !1 21177 }); 21178 a.ui.addButton && a.ui.addButton("Maximize", { 21179 label: f.maximize.maximize, 21180 command: "maximize", 21181 toolbar: "tools,10" 21182 }); 21183 a.on("mode", function() { 21184 var b = a.getCommand("maximize"); 21185 b.setState(b.state == 21186 CKEDITOR.TRISTATE_DISABLED ? CKEDITOR.TRISTATE_DISABLED : n) 21187 }, null, null, 100) 21188 } 21189 } 21190 }) 21191 })(); 21192 CKEDITOR.plugins.add("newpage", { 21193 init: function(a) { 21194 a.addCommand("newpage", { 21195 modes: { 21196 wysiwyg: 1, 21197 source: 1 21198 }, 21199 exec: function(b) { 21200 var a = this; 21201 b.setData(b.config.newpage_html || "", function() { 21202 b.focus(); 21203 setTimeout(function() { 21204 b.fire("afterCommandExec", { 21205 name: "newpage", 21206 command: a 21207 }); 21208 b.selectionChange() 21209 }, 200) 21210 }) 21211 }, 21212 async: !0 21213 }); 21214 a.ui.addButton && a.ui.addButton("NewPage", { 21215 label: a.lang.newpage.toolbar, 21216 command: "newpage", 21217 toolbar: "document,20" 21218 }) 21219 } 21220 }); 21221 (function() { 21222 function e(a) { 21223 return { 21224 "aria-label": a, 21225 "class": "cke_pagebreak", 21226 contenteditable: "false", 21227 "data-cke-display-name": "pagebreak", 21228 "data-cke-pagebreak": 1, 21229 style: "page-break-after: always", 21230 title: a 21231 } 21232 } 21233 CKEDITOR.plugins.add("pagebreak", { 21234 requires: "fakeobjects", 21235 onLoad: function() { 21236 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, 21237 " !important;"); 21238 CKEDITOR.addCss("div.cke_pagebreak{" + a + "}") 21239 }, 21240 init: function(a) { 21241 a.blockless || (a.addCommand("pagebreak", CKEDITOR.plugins.pagebreakCmd), a.ui.addButton && a.ui.addButton("PageBreak", { 21242 label: a.lang.pagebreak.toolbar, 21243 command: "pagebreak", 21244 toolbar: "insert,70" 21245 }), CKEDITOR.env.webkit && a.on("contentDom", function() { 21246 a.document.on("click", function(b) { 21247 b = b.data.getTarget(); 21248 b.is("div") && b.hasClass("cke_pagebreak") && a.getSelection().selectElement(b) 21249 }) 21250 })) 21251 }, 21252 afterInit: function(a) { 21253 function b(f) { 21254 CKEDITOR.tools.extend(f.attributes, 21255 e(a.lang.pagebreak.alt), !0); 21256 f.children.length = 0 21257 } 21258 var c = a.dataProcessor, 21259 g = c && c.dataFilter, 21260 c = c && c.htmlFilter, 21261 h = /page-break-after\s*:\s*always/i, 21262 k = /display\s*:\s*none/i; 21263 c && c.addRules({ 21264 attributes: { 21265 "class": function(a, b) { 21266 var c = a.replace("cke_pagebreak", ""); 21267 if (c != a) { 21268 var d = CKEDITOR.htmlParser.fragment.fromHtml('\x3cspan style\x3d"display: none;"\x3e\x26nbsp;\x3c/span\x3e').children[0]; 21269 b.children.length = 0; 21270 b.add(d); 21271 d = b.attributes; 21272 delete d["aria-label"]; 21273 delete d.contenteditable; 21274 delete d.title 21275 } 21276 return c 21277 } 21278 } 21279 }, { 21280 applyToAll: !0, 21281 priority: 5 21282 }); 21283 g && g.addRules({ 21284 elements: { 21285 div: function(a) { 21286 if (a.attributes["data-cke-pagebreak"]) b(a); 21287 else if (h.test(a.attributes.style)) { 21288 var c = a.children[0]; 21289 c && "span" == c.name && k.test(c.attributes.style) && b(a) 21290 } 21291 } 21292 } 21293 }) 21294 } 21295 }); 21296 CKEDITOR.plugins.pagebreakCmd = { 21297 exec: function(a) { 21298 var b = a.document.createElement("div", { 21299 attributes: e(a.lang.pagebreak.alt) 21300 }); 21301 a.insertElement(b) 21302 }, 21303 context: "div", 21304 allowedContent: { 21305 div: { 21306 styles: "!page-break-after" 21307 }, 21308 span: { 21309 match: function(a) { 21310 return (a = a.parent) && "div" == a.name && a.styles && a.styles["page-break-after"] 21311 }, 21312 styles: "display" 21313 } 21314 }, 21315 requiredContent: "div{page-break-after}" 21316 } 21317 })(); 21318 (function() { 21319 var f = { 21320 canUndo: !1, 21321 async: !0, 21322 exec: function(a, b) { 21323 var c = a.lang, 21324 e = CKEDITOR.tools.keystrokeToString(c.common.keyboard, a.getCommandKeystroke(CKEDITOR.env.ie ? a.commands.paste : this)), 21325 d = b && "undefined" !== typeof b.notification ? b.notification : !b || !b.from || "keystrokeHandler" === b.from && CKEDITOR.env.ie, 21326 c = d && "string" === typeof d ? d : c.pastetext.pasteNotification.replace(/%1/, '\x3ckbd aria-label\x3d"' + e.aria + '"\x3e' + e.display + "\x3c/kbd\x3e"); 21327 a.execCommand("paste", { 21328 type: "text", 21329 notification: d ? c : !1 21330 }) 21331 } 21332 }; 21333 CKEDITOR.plugins.add("pastetext", { 21334 requires: "clipboard", 21335 init: function(a) { 21336 var b = CKEDITOR.env.safari ? CKEDITOR.CTRL + CKEDITOR.ALT + CKEDITOR.SHIFT + 86 : CKEDITOR.CTRL + CKEDITOR.SHIFT + 86; 21337 a.addCommand("pastetext", f); 21338 a.setKeystroke(b, "pastetext"); 21339 CKEDITOR.plugins.clipboard.addPasteButton(a, "PasteText", { 21340 label: a.lang.pastetext.button, 21341 command: "pastetext", 21342 toolbar: "clipboard,40" 21343 }); 21344 if (a.config.forcePasteAsPlainText) a.on("beforePaste", function(a) { 21345 "html" != a.data.type && (a.data.type = "text") 21346 }); 21347 a.on("pasteState", function(b) { 21348 a.getCommand("pastetext").setState(b.data) 21349 }) 21350 } 21351 }) 21352 })(); 21353 (function() { 21354 function l(a, f, e) { 21355 var h = CKEDITOR.cleanWord; 21356 h ? e() : (a = CKEDITOR.getUrl(a.config.pasteFromWordCleanupFile || f + "filter/default.js"), CKEDITOR.scriptLoader.load(a, e, null, !0)); 21357 return !h 21358 } 21359 CKEDITOR.plugins.add("pastefromword", { 21360 requires: "clipboard", 21361 init: function(a) { 21362 function f(a) { 21363 var b = CKEDITOR.plugins.pastefromword && CKEDITOR.plugins.pastefromword.images, 21364 c, d = []; 21365 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"]), 21366 0 !== b.length && (CKEDITOR.tools.array.forEach(b, function(a) { 21367 d.push(a.type ? "data:" + a.type + ";base64," + CKEDITOR.tools.convertBytesToBase64(CKEDITOR.tools.convertHexStringToBytes(a.hex)) : null) 21368 }, this), c.length === d.length)))) 21369 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])) 21370 } 21371 var e = 0, 21372 h = this.path, 21373 m = void 0 === a.config.pasteFromWord_inlineImages ? !0 : a.config.pasteFromWord_inlineImages; 21374 a.addCommand("pastefromword", { 21375 canUndo: !1, 21376 async: !0, 21377 exec: function(a, 21378 b) { 21379 e = 1; 21380 a.execCommand("paste", { 21381 type: "html", 21382 notification: b && "undefined" !== typeof b.notification ? b.notification : !0 21383 }) 21384 } 21385 }); 21386 CKEDITOR.plugins.clipboard.addPasteButton(a, "PasteFromWord", { 21387 label: a.lang.pastefromword.toolbar, 21388 command: "pastefromword", 21389 toolbar: "clipboard,50" 21390 }); 21391 a.on("paste", function(f) { 21392 var b = f.data, 21393 c = CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ? b.dataTransfer.getData("text/html", !0) : null, 21394 d = CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ? b.dataTransfer.getData("text/rtf") : null, 21395 c = c || 21396 b.dataValue, 21397 g = { 21398 dataValue: c, 21399 dataTransfer: { 21400 "text/rtf": d 21401 } 21402 }, 21403 d = /(class=\"?Mso|style=(?:\"|\')[^\"]*?\bmso\-|w:WordDocument|<o:\w+>|<\/font>)/, 21404 d = /<meta\s*name=(?:\"|\')?generator(?:\"|\')?\s*content=(?:\"|\')?microsoft/gi.test(c) || d.test(c); 21405 if (c && (e || d) && (!1 !== a.fire("pasteFromWord", g) || e)) { 21406 b.dontFilter = !0; 21407 var k = l(a, h, function() { 21408 if (k) a.fire("paste", b); 21409 else if (!a.config.pasteFromWordPromptCleanup || e || confirm(a.lang.pastefromword.confirmCleanup)) g.dataValue = CKEDITOR.cleanWord(g.dataValue, a), a.fire("afterPasteFromWord", 21410 g), b.dataValue = g.dataValue, !0 === a.config.forcePasteAsPlainText ? b.type = "text" : CKEDITOR.plugins.clipboard.isCustomCopyCutSupported || "allow-word" !== a.config.forcePasteAsPlainText || (b.type = "html"); 21411 e = 0 21412 }); 21413 k && f.cancel() 21414 } 21415 }, null, null, 3); 21416 if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported && m) a.on("afterPasteFromWord", f) 21417 } 21418 }) 21419 })(); 21420 (function() { 21421 var h, k = { 21422 modes: { 21423 wysiwyg: 1, 21424 source: 1 21425 }, 21426 canUndo: !1, 21427 readOnly: 1, 21428 exec: function(a) { 21429 var g, b = a.config, 21430 f = b.baseHref ? '\x3cbase href\x3d"' + b.baseHref + '"/\x3e' : ""; 21431 if (b.fullPage) g = a.getData().replace(/<head>/, "$\x26" + f).replace(/[^>]*(?=<\/title>)/, "$\x26 \x26mdash; " + a.lang.preview.preview); 21432 else { 21433 var b = "\x3cbody ", 21434 d = a.document && a.document.getBody(); 21435 d && (d.getAttribute("id") && (b += 'id\x3d"' + d.getAttribute("id") + '" '), d.getAttribute("class") && (b += 'class\x3d"' + d.getAttribute("class") + '" ')); 21436 b += "\x3e"; 21437 g = a.config.docType + 21438 '\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" 21439 } 21440 f = 640; 21441 b = 420; 21442 d = 80; 21443 try { 21444 var c = window.screen, 21445 f = Math.round(.8 * c.width), 21446 b = Math.round(.7 * c.height), 21447 d = Math.round(.1 * c.width) 21448 } catch (k) {} 21449 if (!1 === a.fire("contentPreview", a = { 21450 dataValue: g 21451 })) return !1; 21452 var c = "", 21453 e; 21454 CKEDITOR.env.ie && (window._cke_htmlToLoad = a.dataValue, e = "javascript:void( (function(){document.open();" + 21455 ("(" + 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 = ""); 21456 CKEDITOR.env.gecko && (window._cke_htmlToLoad = a.dataValue, c = CKEDITOR.getUrl(h + "preview.html")); 21457 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); 21458 CKEDITOR.env.ie && c && (c.location = 21459 e); 21460 CKEDITOR.env.ie || CKEDITOR.env.gecko || (e = c.document, e.open(), e.write(a.dataValue), e.close()); 21461 return !0 21462 } 21463 }; 21464 CKEDITOR.plugins.add("preview", { 21465 init: function(a) { 21466 a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE && (h = this.path, a.addCommand("preview", k), a.ui.addButton && a.ui.addButton("Preview", { 21467 label: a.lang.preview.preview, 21468 command: "preview", 21469 toolbar: "document,40" 21470 })) 21471 } 21472 }) 21473 })(); 21474 CKEDITOR.plugins.add("print", { 21475 init: function(a) { 21476 a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE && (a.addCommand("print", CKEDITOR.plugins.print), a.ui.addButton && a.ui.addButton("Print", { 21477 label: a.lang.print.toolbar, 21478 command: "print", 21479 toolbar: "document,50" 21480 })) 21481 } 21482 }); 21483 CKEDITOR.plugins.print = { 21484 exec: function(a) { 21485 CKEDITOR.env.gecko ? a.window.$.print() : a.document.$.execCommand("Print") 21486 }, 21487 canUndo: !1, 21488 readOnly: 1, 21489 modes: { 21490 wysiwyg: 1 21491 } 21492 }; 21493 CKEDITOR.plugins.add("removeformat", { 21494 init: function(a) { 21495 a.addCommand("removeFormat", CKEDITOR.plugins.removeformat.commands.removeformat); 21496 a.ui.addButton && a.ui.addButton("RemoveFormat", { 21497 label: a.lang.removeformat.toolbar, 21498 command: "removeFormat", 21499 toolbar: "cleanup,10" 21500 }) 21501 } 21502 }); 21503 CKEDITOR.plugins.removeformat = { 21504 commands: { 21505 removeformat: { 21506 exec: function(a) { 21507 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) { 21508 return a.type == CKEDITOR.NODE_ELEMENT 21509 }, c; c = n.getNextRange();) { 21510 c.collapsed || c.enlarge(CKEDITOR.ENLARGE_ELEMENT); 21511 var l = c.createBookmark(), 21512 b = l.startNode, 21513 d = l.endNode, 21514 k = function(b) { 21515 for (var c = a.elementPath(b), e = c.elements, d = 1, g; 21516 (g = e[d]) && !g.equals(c.block) && !g.equals(c.blockLimit); d++) h.test(g.getName()) && f(a, g) && b.breakParent(g) 21517 }; 21518 k(b); 21519 if (d) 21520 for (k(d), b = b.getNextSourceNode(!0, CKEDITOR.NODE_ELEMENT); b && !b.equals(d);) 21521 if (b.isReadOnly()) { 21522 if (b.getPosition(d) & CKEDITOR.POSITION_CONTAINS) break; 21523 b = b.getNext(p) 21524 } else k = b.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT), "img" == b.getName() && b.data("cke-realelement") || !f(a, b) || (h.test(b.getName()) ? 21525 b.remove(1) : (b.removeAttributes(e), a.fire("removeFormatCleanup", b))), b = k; 21526 c.moveToBookmark(l) 21527 } 21528 a.forceNextSelectionCheck(); 21529 a.getSelection().selectRanges(m) 21530 } 21531 } 21532 }, 21533 filter: function(a, h) { 21534 for (var e = a._.removeFormatFilters || [], f = 0; f < e.length; f++) 21535 if (!1 === e[f](h)) return !1; 21536 return !0 21537 } 21538 }; 21539 CKEDITOR.editor.prototype.addRemoveFormatFilter = function(a) { 21540 this._.removeFormatFilters || (this._.removeFormatFilters = []); 21541 this._.removeFormatFilters.push(a) 21542 }; 21543 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"; 21544 CKEDITOR.config.removeFormatAttributes = "class,style,lang,width,height,align,hspace,valign"; 21545 (function() { 21546 var b = { 21547 readOnly: 1, 21548 modes: { 21549 wysiwyg: 1, 21550 source: 1 21551 }, 21552 exec: function(a) { 21553 if (a.fire("save") && (a = a.element.$.form)) try { 21554 a.submit() 21555 } catch (b) { 21556 a.submit.click && a.submit.click() 21557 } 21558 } 21559 }; 21560 CKEDITOR.plugins.add("save", { 21561 init: function(a) { 21562 a.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && (a.addCommand("save", b).startDisabled = !a.element.$.form, a.ui.addButton && a.ui.addButton("Save", { 21563 label: a.lang.save.toolbar, 21564 command: "save", 21565 toolbar: "document,10" 21566 })) 21567 } 21568 }) 21569 })(); 21570 (function() { 21571 CKEDITOR.plugins.add("selectall", { 21572 init: function(b) { 21573 b.addCommand("selectAll", { 21574 modes: { 21575 wysiwyg: 1, 21576 source: 1 21577 }, 21578 exec: function(a) { 21579 var b = a.editable(); 21580 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(); 21581 else { 21582 if (b.is("body")) a.document.$.execCommand("SelectAll", !1, null); 21583 else { 21584 var c = a.createRange(); 21585 c.selectNodeContents(b); 21586 c.select() 21587 } 21588 a.forceNextSelectionCheck(); 21589 a.selectionChange() 21590 } 21591 }, 21592 canUndo: !1 21593 }); 21594 b.ui.addButton && b.ui.addButton("SelectAll", { 21595 label: b.lang.selectall.toolbar, 21596 command: "selectAll", 21597 toolbar: "selection,10" 21598 }) 21599 } 21600 }) 21601 })(); 21602 (function() { 21603 var k = { 21604 readOnly: 1, 21605 preserveState: !0, 21606 editorFocus: !1, 21607 exec: function(a) { 21608 this.toggleState(); 21609 this.refresh(a) 21610 }, 21611 refresh: function(a) { 21612 if (a.document) { 21613 var c = this.state != CKEDITOR.TRISTATE_ON || a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE && !a.focusManager.hasFocus ? "removeClass" : "attachClass"; 21614 a.editable()[c]("cke_show_blocks") 21615 } 21616 } 21617 }; 21618 CKEDITOR.plugins.add("showblocks", { 21619 onLoad: function() { 21620 var a = "p div pre address blockquote h1 h2 h3 h4 h5 h6".split(" "), 21621 c, b, e, f, k = CKEDITOR.getUrl(this.path), 21622 l = !(CKEDITOR.env.ie && 21623 9 > CKEDITOR.env.version), 21624 g = l ? ":not([contenteditable\x3dfalse]):not(.cke_show_blocks_off)" : "", 21625 d, h; 21626 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") + ")}"; 21627 CKEDITOR.addCss((c + "{background-repeat:no-repeat;border:1px dotted gray;padding-top:8px}").concat(b, e + "{background-position:top left;padding-left:8px}", 21628 f + "{background-position:top right;padding-right:8px}")); 21629 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}") 21630 }, 21631 init: function(a) { 21632 function c() { 21633 b.refresh(a) 21634 } 21635 if (!a.blockless) { 21636 var b = a.addCommand("showblocks", k); 21637 b.canUndo = !1; 21638 a.config.startupOutlineBlocks && b.setState(CKEDITOR.TRISTATE_ON); 21639 a.ui.addButton && a.ui.addButton("ShowBlocks", { 21640 label: a.lang.showblocks.toolbar, 21641 command: "showblocks", 21642 toolbar: "tools,20" 21643 }); 21644 a.on("mode", function() { 21645 b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a) 21646 }); 21647 a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE && (a.on("focus", c), a.on("blur", c)); 21648 a.on("contentDom", function() { 21649 b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a) 21650 }) 21651 } 21652 } 21653 }) 21654 })(); 21655 (function() { 21656 var f = { 21657 preserveState: !0, 21658 editorFocus: !1, 21659 readOnly: 1, 21660 exec: function(a) { 21661 this.toggleState(); 21662 this.refresh(a) 21663 }, 21664 refresh: function(a) { 21665 if (a.document) { 21666 var b = this.state == CKEDITOR.TRISTATE_ON ? "attachClass" : "removeClass"; 21667 a.editable()[b]("cke_show_borders") 21668 } 21669 } 21670 }; 21671 CKEDITOR.plugins.add("showborders", { 21672 modes: { 21673 wysiwyg: 1 21674 }, 21675 onLoad: function() { 21676 var a; 21677 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, 21678 "cke_show_border").replace(/%1/g, "cke_show_borders "); 21679 CKEDITOR.addCss(a) 21680 }, 21681 init: function(a) { 21682 var b = a.addCommand("showborders", f); 21683 b.canUndo = !1; 21684 !1 !== a.config.startupShowBorders && b.setState(CKEDITOR.TRISTATE_ON); 21685 a.on("mode", function() { 21686 b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a) 21687 }, null, null, 100); 21688 a.on("contentDom", function() { 21689 b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a) 21690 }); 21691 a.on("removeFormatCleanup", function(d) { 21692 d = d.data; 21693 a.getCommand("showborders").state == CKEDITOR.TRISTATE_ON && d.is("table") && (!d.hasAttribute("border") || 21694 0 >= parseInt(d.getAttribute("border"), 10)) && d.addClass("cke_show_border") 21695 }) 21696 }, 21697 afterInit: function(a) { 21698 var b = a.dataProcessor; 21699 a = b && b.dataFilter; 21700 b = b && b.htmlFilter; 21701 a && a.addRules({ 21702 elements: { 21703 table: function(a) { 21704 a = a.attributes; 21705 var b = a["class"], 21706 c = parseInt(a.border, 10); 21707 c && !(0 >= c) || b && -1 != b.indexOf("cke_show_border") || (a["class"] = (b || "") + " cke_show_border") 21708 } 21709 } 21710 }); 21711 b && b.addRules({ 21712 elements: { 21713 table: function(a) { 21714 a = a.attributes; 21715 var b = a["class"]; 21716 b && (a["class"] = b.replace("cke_show_border", "").replace(/\s{2}/, " ").replace(/^\s+|\s+$/, 21717 "")) 21718 } 21719 } 21720 }) 21721 } 21722 }); 21723 CKEDITOR.on("dialogDefinition", function(a) { 21724 var b = a.data.name; 21725 if ("table" == b || "tableProperties" == b) 21726 if (a = a.data.definition, b = a.getContents("info").get("txtBorder"), b.commit = CKEDITOR.tools.override(b.commit, function(a) { 21727 return function(b, c) { 21728 a.apply(this, arguments); 21729 var e = parseInt(this.getValue(), 10); 21730 c[!e || 0 >= e ? "addClass" : "removeClass"]("cke_show_border") 21731 } 21732 }), a = (a = a.getContents("advanced")) && a.get("advCSSClasses")) a.setup = CKEDITOR.tools.override(a.setup, function(a) { 21733 return function() { 21734 a.apply(this, 21735 arguments); 21736 this.setValue(this.getValue().replace(/cke_show_border/, "")) 21737 } 21738 }), a.commit = CKEDITOR.tools.override(a.commit, function(a) { 21739 return function(b, c) { 21740 a.apply(this, arguments); 21741 parseInt(c.getAttribute("border"), 10) || c.addClass("cke_show_border") 21742 } 21743 }) 21744 }) 21745 })(); 21746 (function() { 21747 CKEDITOR.plugins.add("sourcearea", { 21748 init: function(a) { 21749 function d() { 21750 var a = e && this.equals(CKEDITOR.document.getActive()); 21751 this.hide(); 21752 this.setStyle("height", this.getParent().$.clientHeight + "px"); 21753 this.setStyle("width", this.getParent().$.clientWidth + "px"); 21754 this.show(); 21755 a && this.focus() 21756 } 21757 if (a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) { 21758 var f = CKEDITOR.plugins.sourcearea; 21759 a.addMode("source", function(e) { 21760 var b = a.ui.space("contents").getDocument().createElement("textarea"); 21761 b.setStyles(CKEDITOR.tools.extend({ 21762 width: CKEDITOR.env.ie7Compat ? 21763 "99%" : "100%", 21764 height: "100%", 21765 resize: "none", 21766 outline: "none", 21767 "text-align": "left" 21768 }, CKEDITOR.tools.cssVendorPrefix("tab-size", a.config.sourceAreaTabSize || 4))); 21769 b.setAttribute("dir", "ltr"); 21770 b.addClass("cke_source").addClass("cke_reset").addClass("cke_enable_context_menu"); 21771 a.ui.space("contents").append(b); 21772 b = a.editable(new c(a, b)); 21773 b.setData(a.getData(1)); 21774 CKEDITOR.env.ie && (b.attachListener(a, "resize", d, b), b.attachListener(CKEDITOR.document.getWindow(), "resize", d, b), CKEDITOR.tools.setTimeout(d, 0, b)); 21775 a.fire("ariaWidget", 21776 this); 21777 e() 21778 }); 21779 a.addCommand("source", f.commands.source); 21780 a.ui.addButton && a.ui.addButton("Source", { 21781 label: a.lang.sourcearea.toolbar, 21782 command: "source", 21783 toolbar: "mode,10" 21784 }); 21785 a.on("mode", function() { 21786 a.getCommand("source").setState("source" == a.mode ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF) 21787 }); 21788 var e = CKEDITOR.env.ie && 9 == CKEDITOR.env.version 21789 } 21790 } 21791 }); 21792 var c = CKEDITOR.tools.createClass({ 21793 base: CKEDITOR.editable, 21794 proto: { 21795 setData: function(a) { 21796 this.setValue(a); 21797 this.status = "ready"; 21798 this.editor.fire("dataReady") 21799 }, 21800 getData: function() { 21801 return this.getValue() 21802 }, 21803 insertHtml: function() {}, 21804 insertElement: function() {}, 21805 insertText: function() {}, 21806 setReadOnly: function(a) { 21807 this[(a ? "set" : "remove") + "Attribute"]("readOnly", "readonly") 21808 }, 21809 detach: function() { 21810 c.baseProto.detach.call(this); 21811 this.clearCustomData(); 21812 this.remove() 21813 } 21814 } 21815 }) 21816 })(); 21817 CKEDITOR.plugins.sourcearea = { 21818 commands: { 21819 source: { 21820 modes: { 21821 wysiwyg: 1, 21822 source: 1 21823 }, 21824 editorFocus: !1, 21825 readOnly: 1, 21826 exec: function(c) { 21827 "wysiwyg" == c.mode && c.fire("saveSnapshot"); 21828 c.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED); 21829 c.setMode("source" == c.mode ? "wysiwyg" : "source") 21830 }, 21831 canUndo: !1 21832 } 21833 } 21834 }; 21835 CKEDITOR.plugins.add("specialchar", { 21836 availableLangs: { 21837 af: 1, 21838 ar: 1, 21839 az: 1, 21840 bg: 1, 21841 ca: 1, 21842 cs: 1, 21843 cy: 1, 21844 da: 1, 21845 de: 1, 21846 "de-ch": 1, 21847 el: 1, 21848 en: 1, 21849 "en-au": 1, 21850 "en-ca": 1, 21851 "en-gb": 1, 21852 eo: 1, 21853 es: 1, 21854 "es-mx": 1, 21855 et: 1, 21856 eu: 1, 21857 fa: 1, 21858 fi: 1, 21859 fr: 1, 21860 "fr-ca": 1, 21861 gl: 1, 21862 he: 1, 21863 hr: 1, 21864 hu: 1, 21865 id: 1, 21866 it: 1, 21867 ja: 1, 21868 km: 1, 21869 ko: 1, 21870 ku: 1, 21871 lt: 1, 21872 lv: 1, 21873 nb: 1, 21874 nl: 1, 21875 no: 1, 21876 oc: 1, 21877 pl: 1, 21878 pt: 1, 21879 "pt-br": 1, 21880 ro: 1, 21881 ru: 1, 21882 si: 1, 21883 sk: 1, 21884 sl: 1, 21885 sq: 1, 21886 sv: 1, 21887 th: 1, 21888 tr: 1, 21889 tt: 1, 21890 ug: 1, 21891 uk: 1, 21892 vi: 1, 21893 zh: 1, 21894 "zh-cn": 1 21895 }, 21896 requires: "dialog", 21897 init: function(a) { 21898 var c = this; 21899 CKEDITOR.dialog.add("specialchar", this.path + "dialogs/specialchar.js"); 21900 a.addCommand("specialchar", { 21901 exec: function() { 21902 var b = a.langCode, 21903 b = c.availableLangs[b] ? b : c.availableLangs[b.replace(/-.*/, "")] ? b.replace(/-.*/, "") : "en"; 21904 CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(c.path + "dialogs/lang/" + b + ".js"), function() { 21905 CKEDITOR.tools.extend(a.lang.specialchar, c.langEntries[b]); 21906 a.openDialog("specialchar") 21907 }) 21908 }, 21909 modes: { 21910 wysiwyg: 1 21911 }, 21912 canUndo: !1 21913 }); 21914 a.ui.addButton && a.ui.addButton("SpecialChar", { 21915 label: a.lang.specialchar.toolbar, 21916 command: "specialchar", 21917 toolbar: "insert,50" 21918 }) 21919 } 21920 }); 21921 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(" "); 21922 CKEDITOR.plugins.add("scayt", { 21923 requires: "menubutton,dialog", 21924 tabToOpen: null, 21925 dialogName: "scaytDialog", 21926 onLoad: function(a) { 21927 CKEDITOR.plugins.scayt.onLoadTimestamp = (new Date).getTime(); 21928 "moono-lisa" == (CKEDITOR.skinName || a.config.skin) && CKEDITOR.document.appendStyleSheet(this.path + "skins/" + CKEDITOR.skin.name + "/scayt.css"); 21929 CKEDITOR.document.appendStyleSheet(this.path + "dialogs/dialog.css") 21930 }, 21931 init: function(a) { 21932 var c = this, 21933 d = CKEDITOR.plugins.scayt; 21934 this.bindEvents(a); 21935 this.parseConfig(a); 21936 this.addRule(a); 21937 CKEDITOR.dialog.add(this.dialogName, 21938 CKEDITOR.getUrl(this.path + "dialogs/options.js")); 21939 this.addMenuItems(a); 21940 var b = a.lang.scayt, 21941 e = CKEDITOR.env; 21942 a.ui.add("Scayt", CKEDITOR.UI_MENUBUTTON, { 21943 label: b.text_title, 21944 title: a.plugins.wsc ? a.lang.wsc.title : b.text_title, 21945 modes: { 21946 wysiwyg: !(e.ie && (8 > e.version || e.quirks)) 21947 }, 21948 toolbar: "spellchecker,20", 21949 refresh: function() { 21950 var b = a.ui.instances.Scayt.getState(); 21951 a.scayt && (b = d.state.scayt[a.name] ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF); 21952 a.fire("scaytButtonState", b) 21953 }, 21954 onRender: function() { 21955 var b = this; 21956 a.on("scaytButtonState", 21957 function(a) { 21958 void 0 !== typeof a.data && b.setState(a.data) 21959 }) 21960 }, 21961 onMenu: function() { 21962 var b = a.scayt; 21963 a.getMenuItem("scaytToggle").label = a.lang.scayt[b && d.state.scayt[a.name] ? "btn_disable" : "btn_enable"]; 21964 var c = { 21965 scaytToggle: CKEDITOR.TRISTATE_OFF, 21966 scaytOptions: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, 21967 scaytLangs: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, 21968 scaytDict: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, 21969 scaytAbout: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, 21970 WSC: a.plugins.wsc ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED 21971 }; 21972 a.config.scayt_uiTabs[0] || delete c.scaytOptions; 21973 a.config.scayt_uiTabs[1] || delete c.scaytLangs; 21974 a.config.scayt_uiTabs[2] || delete c.scaytDict; 21975 b && !CKEDITOR.plugins.scayt.isNewUdSupported(b) && (delete c.scaytDict, a.config.scayt_uiTabs[2] = 0, CKEDITOR.plugins.scayt.alarmCompatibilityMessage()); 21976 return c 21977 } 21978 }); 21979 a.contextMenu && a.addMenuItems && (a.contextMenu.addListener(function(b, d) { 21980 var e = a.scayt, 21981 l, m; 21982 e && (m = e.getSelectionNode()) && (l = c.menuGenerator(a, m), e.showBanner("." + a.contextMenu._.definition.panel.className.split(" ").join(" ."))); 21983 return l 21984 }), a.contextMenu._.onHide = CKEDITOR.tools.override(a.contextMenu._.onHide, function(b) { 21985 return function() { 21986 var d = a.scayt; 21987 d && d.hideBanner(); 21988 return b.apply(this) 21989 } 21990 })) 21991 }, 21992 addMenuItems: function(a) { 21993 var c = this, 21994 d = CKEDITOR.plugins.scayt; 21995 a.addMenuGroup("scaytButton"); 21996 for (var b = a.config.scayt_contextMenuItemsOrder.split("|"), e = 0; e < b.length; e++) b[e] = "scayt_" + b[e]; 21997 if ((b = ["grayt_description", "grayt_suggest", "grayt_control"].concat(b)) && b.length) 21998 for (e = 0; e < b.length; e++) a.addMenuGroup(b[e], e - 10); 21999 a.addCommand("scaytToggle", { 22000 exec: function(a) { 22001 var b = a.scayt; 22002 alert(d.state.scayt[a.name] ); 22003 22004 d.state.scayt[a.name] = !d.state.scayt[a.name]; 22005 !0 === d.state.scayt[a.name] ? b || d.createScayt(a) : b && d.destroy(a) 22006 } 22007 }); 22008 a.addCommand("scaytAbout", { 22009 exec: function(a) { 22010 a.scayt.tabToOpen = "about"; 22011 d.openDialog(c.dialogName, a) 22012 } 22013 }); 22014 a.addCommand("scaytOptions", { 22015 exec: function(a) { 22016 a.scayt.tabToOpen = "options"; 22017 d.openDialog(c.dialogName, a) 22018 } 22019 }); 22020 a.addCommand("scaytLangs", { 22021 exec: function(a) { 22022 a.scayt.tabToOpen = "langs"; 22023 d.openDialog(c.dialogName, a) 22024 } 22025 }); 22026 a.addCommand("scaytDict", { 22027 exec: function(a) { 22028 a.scayt.tabToOpen = 22029 "dictionaries"; 22030 d.openDialog(c.dialogName, a) 22031 } 22032 }); 22033 b = { 22034 scaytToggle: { 22035 label: a.lang.scayt.btn_enable, 22036 group: "scaytButton", 22037 command: "scaytToggle" 22038 }, 22039 scaytAbout: { 22040 label: a.lang.scayt.btn_about, 22041 group: "scaytButton", 22042 command: "scaytAbout" 22043 }, 22044 scaytOptions: { 22045 label: a.lang.scayt.btn_options, 22046 group: "scaytButton", 22047 command: "scaytOptions" 22048 }, 22049 scaytLangs: { 22050 label: a.lang.scayt.btn_langs, 22051 group: "scaytButton", 22052 command: "scaytLangs" 22053 }, 22054 scaytDict: { 22055 label: a.lang.scayt.btn_dictionaries, 22056 group: "scaytButton", 22057 command: "scaytDict" 22058 } 22059 }; 22060 a.plugins.wsc && (b.WSC = { 22061 label: a.lang.wsc.toolbar, 22062 group: "scaytButton", 22063 onClick: function() { 22064 var b = CKEDITOR.plugins.scayt, 22065 d = a.scayt, 22066 c = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.container.getText() : a.document.getBody().getText(); 22067 (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!") 22068 } 22069 }); 22070 a.addMenuItems(b) 22071 }, 22072 bindEvents: function(a) { 22073 var c = CKEDITOR.plugins.scayt, 22074 d = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE, 22075 b = function() { 22076 c.destroy(a) 22077 }, 22078 e = function() { 22079 !c.state.scayt[a.name] || a.readOnly || a.scayt || c.createScayt(a) 22080 }, 22081 f = function() { 22082 var b = a.editable(); 22083 b.attachListener(b, "focus", function(b) { 22084 CKEDITOR.plugins.scayt && !a.scayt && setTimeout(e, 0); 22085 b = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[a.name] && a.scayt; 22086 var c, k; 22087 if ((d || b) && a._.savedSelection) { 22088 b = a._.savedSelection.getSelectedElement(); 22089 b = !b && a._.savedSelection.getRanges(); 22090 for (var h = 0; h < b.length; h++) k = b[h], "string" === typeof k.startContainer.$.nodeValue && (c = k.startContainer.getText().length, 22091 (c < k.startOffset || c < k.endOffset) && a.unlockSelection(!1)) 22092 } 22093 }, this, null, -10) 22094 }, 22095 g = function() { 22096 d ? a.config.scayt_inlineModeImmediateMarkup ? e() : (a.on("blur", function() { 22097 setTimeout(b, 0) 22098 }), a.on("focus", e), a.focusManager.hasFocus && e()) : e(); 22099 f(); 22100 var c = a.editable(); 22101 c.attachListener(c, "mousedown", function(b) { 22102 b = b.data.getTarget(); 22103 var d = a.widgets && a.widgets.getByElement(b); 22104 d && (d.wrapper = b.getAscendant(function(a) { 22105 return a.hasAttribute("data-cke-widget-wrapper") 22106 }, !0)) 22107 }, this, null, -10) 22108 }; 22109 a.on("contentDom", g); 22110 a.on("beforeCommandExec", 22111 function(b) { 22112 var d = a.scayt, 22113 e = !1, 22114 f = !1, 22115 h = !0; 22116 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", { 22117 removeOptions: { 22118 removeInside: h, 22119 forceBookmark: f, 22120 language: e 22121 }, 22122 timeout: 0 22123 })) 22124 }); 22125 a.on("beforeSetMode", function(b) { 22126 if ("source" == b.data) { 22127 if (b = a.scayt) c.destroy(a), a.fire("scaytButtonState", CKEDITOR.TRISTATE_DISABLED); 22128 a.document && a.document.getBody().removeAttribute("_jquid") 22129 } 22130 }); 22131 a.on("afterCommandExec", function(b) { 22132 "wysiwyg" != a.mode || "undo" != b.data.name && "redo" != b.data.name || setTimeout(function() { 22133 c.reloadMarkup(a.scayt) 22134 }, 250) 22135 }); 22136 a.on("readOnly", function(b) { 22137 var d; 22138 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))) 22139 }); 22140 a.on("beforeDestroy", b); 22141 a.on("setData", function() { 22142 b(); 22143 (a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE || a.plugins.divarea) && g() 22144 }, this, null, 50); 22145 a.on("reloadMarkupScayt", function(b) { 22146 var d = b.data && b.data.removeOptions, 22147 e = b.data && b.data.timeout, 22148 f = b.data && b.data.language, 22149 h = a.scayt; 22150 h && setTimeout(function() { 22151 f && (d.selectionNode = a.plugins.language.getCurrentLangElement(a), 22152 d.selectionNode = d.selectionNode && d.selectionNode.$ || null); 22153 h.removeMarkupInSelectionNode(d); 22154 c.reloadMarkup(h) 22155 }, e || 0) 22156 }); 22157 a.on("insertElement", function() { 22158 a.fire("reloadMarkupScayt", { 22159 removeOptions: { 22160 forceBookmark: !0 22161 } 22162 }) 22163 }, this, null, 50); 22164 a.on("insertHtml", function() { 22165 a.scayt && a.scayt.setFocused && a.scayt.setFocused(!0); 22166 a.fire("reloadMarkupScayt") 22167 }, this, null, 50); 22168 a.on("insertText", function() { 22169 a.scayt && a.scayt.setFocused && a.scayt.setFocused(!0); 22170 a.fire("reloadMarkupScayt") 22171 }, this, null, 50); 22172 a.on("scaytDialogShown", function(b) { 22173 b.data.selectPage(a.scayt.tabToOpen) 22174 }) 22175 }, 22176 parseConfig: function(a) { 22177 var c = CKEDITOR.plugins.scayt; 22178 c.replaceOldOptionsNames(a.config); 22179 "boolean" !== typeof a.config.scayt_autoStartup && (a.config.scayt_autoStartup = !1); 22180 c.state.scayt[a.name] = a.config.scayt_autoStartup; 22181 "boolean" !== typeof a.config.grayt_autoStartup && (a.config.grayt_autoStartup = !1); 22182 "boolean" !== typeof a.config.scayt_inlineModeImmediateMarkup && (a.config.scayt_inlineModeImmediateMarkup = !1); 22183 c.state.grayt[a.name] = a.config.grayt_autoStartup; 22184 a.config.scayt_contextCommands || (a.config.scayt_contextCommands = 22185 "ignoreall|add"); 22186 a.config.scayt_contextMenuItemsOrder || (a.config.scayt_contextMenuItemsOrder = "suggest|moresuggest|control"); 22187 a.config.scayt_sLang || (a.config.scayt_sLang = "en_US"); 22188 if (void 0 === a.config.scayt_maxSuggestions || "number" != typeof a.config.scayt_maxSuggestions || 0 > a.config.scayt_maxSuggestions) a.config.scayt_maxSuggestions = 3; 22189 if (void 0 === a.config.scayt_minWordLength || "number" != typeof a.config.scayt_minWordLength || 1 > a.config.scayt_minWordLength) a.config.scayt_minWordLength = 3; 22190 if (void 0 === a.config.scayt_customDictionaryIds || 22191 "string" !== typeof a.config.scayt_customDictionaryIds) a.config.scayt_customDictionaryIds = ""; 22192 if (void 0 === a.config.scayt_userDictionaryName || "string" !== typeof a.config.scayt_userDictionaryName) a.config.scayt_userDictionaryName = null; 22193 if ("string" === typeof a.config.scayt_uiTabs && 3 === a.config.scayt_uiTabs.split(",").length) { 22194 var d = [], 22195 b = []; 22196 a.config.scayt_uiTabs = a.config.scayt_uiTabs.split(","); 22197 CKEDITOR.tools.search(a.config.scayt_uiTabs, function(a) { 22198 1 === Number(a) || 0 === Number(a) ? (b.push(!0), d.push(Number(a))) : 22199 b.push(!1) 22200 }); 22201 null === CKEDITOR.tools.search(b, !1) ? a.config.scayt_uiTabs = d : a.config.scayt_uiTabs = [1, 1, 1] 22202 } else a.config.scayt_uiTabs = [1, 1, 1]; 22203 "string" != typeof a.config.scayt_serviceProtocol && (a.config.scayt_serviceProtocol = null); 22204 "string" != typeof a.config.scayt_serviceHost && (a.config.scayt_serviceHost = null); 22205 "string" != typeof a.config.scayt_servicePort && (a.config.scayt_servicePort = null); 22206 "string" != typeof a.config.scayt_servicePath && (a.config.scayt_servicePath = null); 22207 a.config.scayt_moreSuggestions || (a.config.scayt_moreSuggestions = 22208 "on"); 22209 "string" !== typeof a.config.scayt_customerId && (a.config.scayt_customerId = "1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2"); 22210 "string" !== typeof a.config.scayt_customPunctuation && (a.config.scayt_customPunctuation = "-"); 22211 "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"); 22212 "boolean" !== typeof CKEDITOR.config.scayt_handleCheckDirty && (CKEDITOR.config.scayt_handleCheckDirty = !0); 22213 "boolean" !== typeof CKEDITOR.config.scayt_handleUndoRedo && (CKEDITOR.config.scayt_handleUndoRedo = !0); 22214 CKEDITOR.config.scayt_handleUndoRedo = CKEDITOR.plugins.undo ? CKEDITOR.config.scayt_handleUndoRedo : !1; 22215 "boolean" !== typeof a.config.scayt_multiLanguageMode && (a.config.scayt_multiLanguageMode = !1); 22216 "object" !== typeof a.config.scayt_multiLanguageStyles && (a.config.scayt_multiLanguageStyles = {}); 22217 a.config.scayt_ignoreAllCapsWords && "boolean" !== typeof a.config.scayt_ignoreAllCapsWords && (a.config.scayt_ignoreAllCapsWords = !1); 22218 a.config.scayt_ignoreDomainNames && "boolean" !== typeof a.config.scayt_ignoreDomainNames && (a.config.scayt_ignoreDomainNames = !1); 22219 a.config.scayt_ignoreWordsWithMixedCases && "boolean" !== typeof a.config.scayt_ignoreWordsWithMixedCases && (a.config.scayt_ignoreWordsWithMixedCases = !1); 22220 a.config.scayt_ignoreWordsWithNumbers && "boolean" !== typeof a.config.scayt_ignoreWordsWithNumbers && (a.config.scayt_ignoreWordsWithNumbers = !1); 22221 if (a.config.scayt_disableOptionsStorage) { 22222 var c = CKEDITOR.tools.isArray(a.config.scayt_disableOptionsStorage) ? 22223 a.config.scayt_disableOptionsStorage : "string" === typeof a.config.scayt_disableOptionsStorage ? [a.config.scayt_disableOptionsStorage] : void 0, 22224 e = "all options lang ignore-all-caps-words ignore-domain-names ignore-words-with-mixed-cases ignore-words-with-numbers".split(" "), 22225 f = ["lang", "ignore-all-caps-words", "ignore-domain-names", "ignore-words-with-mixed-cases", "ignore-words-with-numbers"], 22226 g = CKEDITOR.tools.search, 22227 k = CKEDITOR.tools.indexOf; 22228 a.config.scayt_disableOptionsStorage = function(a) { 22229 for (var b = [], d = 0; d < 22230 a.length; d++) { 22231 var c = a[d], 22232 p = !!g(a, "options"); 22233 if (!g(e, c) || p && g(f, function(a) { 22234 if ("lang" === a) return !1 22235 })) return; 22236 g(f, c) && f.splice(k(f, c), 1); 22237 if ("all" === c || p && g(a, "lang")) return []; 22238 "options" === c && (f = ["lang"]) 22239 } 22240 return b = b.concat(f) 22241 }(c) 22242 } 22243 }, 22244 addRule: function(a) { 22245 var c = CKEDITOR.plugins.scayt, 22246 d = a.dataProcessor, 22247 b = d && d.htmlFilter, 22248 e = a._.elementsPath && a._.elementsPath.filters, 22249 d = d && d.dataFilter, 22250 f = a.addRemoveFormatFilter, 22251 g = function(b) { 22252 if (a.scayt && (b.hasAttribute(c.options.data_attribute_name) || b.hasAttribute(c.options.problem_grammar_data_attribute))) return !1 22253 }, 22254 k = function(b) { 22255 var d = !0; 22256 a.scayt && (b.hasAttribute(c.options.data_attribute_name) || b.hasAttribute(c.options.problem_grammar_data_attribute)) && (d = !1); 22257 return d 22258 }; 22259 e && e.push(g); 22260 d && d.addRules({ 22261 elements: { 22262 span: function(a) { 22263 var b = a.hasClass(c.options.misspelled_word_class) && a.attributes[c.options.data_attribute_name], 22264 d = a.hasClass(c.options.problem_grammar_class) && a.attributes[c.options.problem_grammar_data_attribute]; 22265 c && (b || d) && delete a.name; 22266 return a 22267 } 22268 } 22269 }); 22270 b && b.addRules({ 22271 elements: { 22272 span: function(a) { 22273 var b = a.hasClass(c.options.misspelled_word_class) && 22274 a.attributes[c.options.data_attribute_name], 22275 d = a.hasClass(c.options.problem_grammar_class) && a.attributes[c.options.problem_grammar_data_attribute]; 22276 c && (b || d) && delete a.name; 22277 return a 22278 } 22279 } 22280 }); 22281 f && f.call(a, k) 22282 }, 22283 scaytMenuDefinition: function(a) { 22284 var c = this, 22285 d = CKEDITOR.plugins.scayt; 22286 a = a.scayt; 22287 return { 22288 scayt: { 22289 scayt_ignore: { 22290 label: a.getLocal("btn_ignore"), 22291 group: "scayt_control", 22292 order: 1, 22293 exec: function(a) { 22294 a.scayt.ignoreWord() 22295 } 22296 }, 22297 scayt_ignoreall: { 22298 label: a.getLocal("btn_ignoreAll"), 22299 group: "scayt_control", 22300 order: 2, 22301 exec: function(a) { 22302 a.scayt.ignoreAllWords() 22303 } 22304 }, 22305 scayt_add: { 22306 label: a.getLocal("btn_addWord"), 22307 group: "scayt_control", 22308 order: 3, 22309 exec: function(a) { 22310 var d = a.scayt; 22311 setTimeout(function() { 22312 d.addWordToUserDictionary() 22313 }, 10) 22314 } 22315 }, 22316 scayt_option: { 22317 label: a.getLocal("btn_options"), 22318 group: "scayt_control", 22319 order: 4, 22320 exec: function(a) { 22321 a.scayt.tabToOpen = "options"; 22322 d.openDialog(c.dialogName, a) 22323 }, 22324 verification: function(a) { 22325 return 1 == a.config.scayt_uiTabs[0] ? !0 : !1 22326 } 22327 }, 22328 scayt_language: { 22329 label: a.getLocal("btn_langs"), 22330 group: "scayt_control", 22331 order: 5, 22332 exec: function(a) { 22333 a.scayt.tabToOpen = "langs"; 22334 d.openDialog(c.dialogName, 22335 a) 22336 }, 22337 verification: function(a) { 22338 return 1 == a.config.scayt_uiTabs[1] ? !0 : !1 22339 } 22340 }, 22341 scayt_dictionary: { 22342 label: a.getLocal("btn_dictionaries"), 22343 group: "scayt_control", 22344 order: 6, 22345 exec: function(a) { 22346 a.scayt.tabToOpen = "dictionaries"; 22347 d.openDialog(c.dialogName, a) 22348 }, 22349 verification: function(a) { 22350 return 1 == a.config.scayt_uiTabs[2] ? !0 : !1 22351 } 22352 }, 22353 scayt_about: { 22354 label: a.getLocal("btn_about"), 22355 group: "scayt_control", 22356 order: 7, 22357 exec: function(a) { 22358 a.scayt.tabToOpen = "about"; 22359 d.openDialog(c.dialogName, a) 22360 } 22361 } 22362 }, 22363 grayt: { 22364 grayt_problemdescription: { 22365 label: "Grammar problem description", 22366 group: "grayt_description", 22367 order: 1, 22368 state: CKEDITOR.TRISTATE_DISABLED, 22369 exec: function(a) {} 22370 }, 22371 grayt_ignore: { 22372 label: a.getLocal("btn_ignore"), 22373 group: "grayt_control", 22374 order: 2, 22375 exec: function(a) { 22376 a.scayt.ignorePhrase() 22377 } 22378 }, 22379 grayt_ignoreall: { 22380 label: a.getLocal("btn_ignoreAll"), 22381 group: "grayt_control", 22382 order: 3, 22383 exec: function(a) { 22384 a.scayt.ignoreAllPhrases() 22385 } 22386 } 22387 } 22388 } 22389 }, 22390 buildSuggestionMenuItems: function(a, c, d) { 22391 var b = {}, 22392 e = {}, 22393 f = d ? "word" : "phrase", 22394 g = d ? "startGrammarCheck" : "startSpellCheck", 22395 k = a.scayt; 22396 if (0 < c.length && "no_any_suggestions" !== c[0]) 22397 if (d) 22398 for (d = 22399 0; d < c.length; d++) { 22400 var l = "scayt_suggest_" + CKEDITOR.plugins.scayt.suggestions[d].replace(" ", "_"); 22401 a.addCommand(l, this.createCommand(CKEDITOR.plugins.scayt.suggestions[d], f, g)); 22402 d < a.config.scayt_maxSuggestions ? (a.addMenuItem(l, { 22403 label: c[d], 22404 command: l, 22405 group: "scayt_suggest", 22406 order: d + 1 22407 }), b[l] = CKEDITOR.TRISTATE_OFF) : (a.addMenuItem(l, { 22408 label: c[d], 22409 command: l, 22410 group: "scayt_moresuggest", 22411 order: d + 1 22412 }), e[l] = CKEDITOR.TRISTATE_OFF, "on" === a.config.scayt_moreSuggestions && (a.addMenuItem("scayt_moresuggest", { 22413 label: k.getLocal("btn_moreSuggestions"), 22414 group: "scayt_moresuggest", 22415 order: 10, 22416 getItems: function() { 22417 return e 22418 } 22419 }), b.scayt_moresuggest = CKEDITOR.TRISTATE_OFF)) 22420 } else 22421 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, { 22422 label: c[d], 22423 command: l, 22424 group: "grayt_suggest", 22425 order: d + 1 22426 }), b[l] = CKEDITOR.TRISTATE_OFF; 22427 else b.no_scayt_suggest = CKEDITOR.TRISTATE_DISABLED, a.addCommand("no_scayt_suggest", { 22428 exec: function() {} 22429 }), a.addMenuItem("no_scayt_suggest", { 22430 label: k.getLocal("btn_noSuggestions") || "no_scayt_suggest", 22431 command: "no_scayt_suggest", 22432 group: "scayt_suggest", 22433 order: 0 22434 }); 22435 return b 22436 }, 22437 menuGenerator: function(a, c) { 22438 var d = a.scayt, 22439 b = this.scaytMenuDefinition(a), 22440 e = {}, 22441 f = a.config.scayt_contextCommands.split("|"), 22442 g = c.getAttribute(d.getLangAttribute()) || d.getLang(), 22443 k, l, m, n; 22444 l = d.isScaytNode(c); 22445 m = d.isGraytNode(c); 22446 l ? (b = b.scayt, k = c.getAttribute(d.getScaytNodeAttributeName()), d.fire("getSuggestionsList", { 22447 lang: g, 22448 word: k 22449 }), e = this.buildSuggestionMenuItems(a, CKEDITOR.plugins.scayt.suggestions, 22450 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", { 22451 lang: g, 22452 phrase: e, 22453 rule: k 22454 }), e = this.buildSuggestionMenuItems(a, CKEDITOR.plugins.scayt.suggestions, l)); 22455 if (l && 22456 "off" == a.config.scayt_contextCommands) return e; 22457 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, { 22458 exec: b[h].exec 22459 }), a.addMenuItem(h, { 22460 label: a.lang.scayt[b[h].label] || 22461 b[h].label, 22462 command: h, 22463 group: b[h].group, 22464 order: b[h].order 22465 })); 22466 return e 22467 }, 22468 createCommand: function(a, c, d) { 22469 return { 22470 exec: function(b) { 22471 b = b.scayt; 22472 var e = {}; 22473 e[c] = a; 22474 b.replaceSelectionNode(e); 22475 "startGrammarCheck" === d && b.removeMarkupInSelectionNode({ 22476 grammarOnly: !0 22477 }); 22478 b.fire(d) 22479 } 22480 } 22481 } 22482 }); 22483 CKEDITOR.plugins.scayt = { 22484 charsToObserve: [{ 22485 charName: "cke-fillingChar", 22486 charCode: function() { 22487 var a = CKEDITOR.version.match(/^\d(\.\d*)*/), 22488 a = a && a[0], 22489 c; 22490 if (a) { 22491 c = "4.5.7"; 22492 var d, a = a.replace(/\./g, ""); 22493 c = c.replace(/\./g, ""); 22494 d = a.length - c.length; 22495 d = 0 <= d ? d : 0; 22496 c = parseInt(a) >= parseInt(c) * Math.pow(10, d) 22497 } 22498 return c ? Array(7).join(String.fromCharCode(8203)) : String.fromCharCode(8203) 22499 }() 22500 }], 22501 onLoadTimestamp: "", 22502 state: { 22503 scayt: {}, 22504 grayt: {} 22505 }, 22506 warningCounter: 0, 22507 suggestions: [], 22508 options: { 22509 disablingCommandExec: { 22510 source: !0, 22511 newpage: !0, 22512 templates: !0 22513 }, 22514 data_attribute_name: "data-scayt-word", 22515 misspelled_word_class: "scayt-misspell-word", 22516 problem_grammar_data_attribute: "data-grayt-phrase", 22517 problem_grammar_class: "gramm-problem" 22518 }, 22519 backCompatibilityMap: { 22520 scayt_service_protocol: "scayt_serviceProtocol", 22521 scayt_service_host: "scayt_serviceHost", 22522 scayt_service_port: "scayt_servicePort", 22523 scayt_service_path: "scayt_servicePath", 22524 scayt_customerid: "scayt_customerId" 22525 }, 22526 openDialog: function(a, c) { 22527 var d = c.scayt; 22528 d.isAllModulesReady && !1 === d.isAllModulesReady() || (c.lockSelection(), 22529 c.openDialog(a)) 22530 }, 22531 alarmCompatibilityMessage: function() { 22532 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) 22533 }, 22534 isNewUdSupported: function(a) { 22535 return a.getUserDictionary ? !0 : !1 22536 }, 22537 reloadMarkup: function(a) { 22538 var c; 22539 a && (c = a.getScaytLangList(), 22540 a.reloadMarkup ? a.reloadMarkup() : (this.alarmCompatibilityMessage(), c && c.ltr && c.rtl && a.fire("startSpellCheck, startGrammarCheck"))) 22541 }, 22542 replaceOldOptionsNames: function(a) { 22543 for (var c in a) c in this.backCompatibilityMap && (a[this.backCompatibilityMap[c]] = a[c], delete a[c]) 22544 }, 22545 createScayt: function(a) { 22546 var c = this, 22547 d = CKEDITOR.plugins.scayt; 22548 this.loadScaytLibrary(a, function(a) { 22549 function e(a) { 22550 return new SCAYT.CKSCAYT(a, function() {}, function() {}) 22551 } 22552 var f; 22553 a.window && (f = "BODY" == a.editable().$.nodeName ? a.window.getFrame() : a.editable()); 22554 if (f) { 22555 f = { 22556 lang: a.config.scayt_sLang, 22557 container: f.$, 22558 customDictionary: a.config.scayt_customDictionaryIds, 22559 userDictionaryName: a.config.scayt_userDictionaryName, 22560 localization: a.langCode, 22561 customer_id: a.config.scayt_customerId, 22562 customPunctuation: a.config.scayt_customPunctuation, 22563 debug: a.config.scayt_debug, 22564 data_attribute_name: c.options.data_attribute_name, 22565 misspelled_word_class: c.options.misspelled_word_class, 22566 problem_grammar_data_attribute: c.options.problem_grammar_data_attribute, 22567 problem_grammar_class: c.options.problem_grammar_class, 22568 "options-to-restore": a.config.scayt_disableOptionsStorage, 22569 focused: a.editable().hasFocus, 22570 ignoreElementsRegex: a.config.scayt_elementsToIgnore, 22571 ignoreGraytElementsRegex: a.config.grayt_elementsToIgnore, 22572 minWordLength: a.config.scayt_minWordLength, 22573 multiLanguageMode: a.config.scayt_multiLanguageMode, 22574 multiLanguageStyles: a.config.scayt_multiLanguageStyles, 22575 graytAutoStartup: a.config.grayt_autoStartup, 22576 charsToObserve: d.charsToObserve 22577 }; 22578 a.config.scayt_serviceProtocol && (f.service_protocol = a.config.scayt_serviceProtocol); 22579 a.config.scayt_serviceHost && (f.service_host = a.config.scayt_serviceHost); 22580 a.config.scayt_servicePort && (f.service_port = a.config.scayt_servicePort); 22581 a.config.scayt_servicePath && (f.service_path = a.config.scayt_servicePath); 22582 "boolean" === typeof a.config.scayt_ignoreAllCapsWords && (f["ignore-all-caps-words"] = a.config.scayt_ignoreAllCapsWords); 22583 "boolean" === typeof a.config.scayt_ignoreDomainNames && (f["ignore-domain-names"] = a.config.scayt_ignoreDomainNames); 22584 "boolean" === typeof a.config.scayt_ignoreWordsWithMixedCases && 22585 (f["ignore-words-with-mixed-cases"] = a.config.scayt_ignoreWordsWithMixedCases); 22586 "boolean" === typeof a.config.scayt_ignoreWordsWithNumbers && (f["ignore-words-with-numbers"] = a.config.scayt_ignoreWordsWithNumbers); 22587 var g; 22588 try { 22589 g = e(f) 22590 } catch (k) { 22591 c.alarmCompatibilityMessage(), delete f.charsToObserve, g = e(f) 22592 } 22593 g.subscribe("suggestionListSend", function(a) { 22594 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])); 22595 CKEDITOR.plugins.scayt.suggestions = d 22596 }); 22597 g.subscribe("selectionIsChanged", function(d) { 22598 a.getSelection().isLocked && "restoreSelection" !== d.action && a.lockSelection(); 22599 "restoreSelection" === d.action && a.selectionChange(!0) 22600 }); 22601 g.subscribe("graytStateChanged", function(c) { 22602 d.state.grayt[a.name] = c.state 22603 }); 22604 g.addMarkupHandler && g.addMarkupHandler(function(d) { 22605 var c = a.editable(), 22606 e = c.getCustomData(d.charName); 22607 e && (e.$ = d.node, c.setCustomData(d.charName, e)) 22608 }); 22609 a.scayt = g; 22610 a.fire("scaytButtonState", a.readOnly ? CKEDITOR.TRISTATE_DISABLED : 22611 CKEDITOR.TRISTATE_ON) 22612 } else d.state.scayt[a.name] = !1 22613 }) 22614 }, 22615 destroy: function(a) { 22616 a.scayt && a.scayt.destroy(); 22617 delete a.scayt; 22618 a.fire("scaytButtonState", CKEDITOR.TRISTATE_OFF) 22619 }, 22620 loadScaytLibrary: function(a, c) { 22621 var d, b = function() { 22622 CKEDITOR.fireOnce("scaytReady"); 22623 a.scayt || "function" === typeof c && c(a) 22624 }; 22625 "undefined" === typeof window.SCAYT || "function" !== typeof window.SCAYT.CKSCAYT ? (d = a.config.scayt_srcUrl + "?" + this.onLoadTimestamp, CKEDITOR.scriptLoader.load(d, function(a) { 22626 a && b() 22627 })) : window.SCAYT && "function" === typeof window.SCAYT.CKSCAYT && 22628 b() 22629 } 22630 }; 22631 CKEDITOR.on("dialogDefinition", function(a) { 22632 var c = a.data.name; 22633 a = a.data.definition.dialog; 22634 "scaytDialog" !== c && "checkspell" !== c && (a.on("show", function(a) { 22635 a = a.sender && a.sender.getParentEditor(); 22636 var b = CKEDITOR.plugins.scayt, 22637 c = a.scayt; 22638 c && b.state.scayt[a.name] && c.setMarkupPaused && c.setMarkupPaused(!0) 22639 }), a.on("hide", function(a) { 22640 a = a.sender && a.sender.getParentEditor(); 22641 var b = CKEDITOR.plugins.scayt, 22642 c = a.scayt; 22643 c && b.state.scayt[a.name] && c.setMarkupPaused && c.setMarkupPaused(!1) 22644 })); 22645 if ("scaytDialog" === c) a.on("cancel", function(a) { 22646 return !1 22647 }, 22648 this, null, -1); 22649 if ("checkspell" === c) a.on("cancel", function(a) { 22650 a = a.sender && a.sender.getParentEditor(); 22651 var b = CKEDITOR.plugins.scayt, 22652 c = a.scayt; 22653 c && b.state.scayt[a.name] && c.setMarkupPaused && c.setMarkupPaused(!1); 22654 a.unlockSelection() 22655 }, this, null, -2); 22656 if ("link" === c) a.on("ok", function(a) { 22657 var b = a.sender && a.sender.getParentEditor(); 22658 b && setTimeout(function() { 22659 b.fire("reloadMarkupScayt", { 22660 removeOptions: { 22661 removeInside: !0, 22662 forceBookmark: !0 22663 }, 22664 timeout: 0 22665 }) 22666 }, 0) 22667 }); 22668 if ("replace" === c) a.on("hide", function(a) { 22669 a = a.sender && a.sender.getParentEditor(); 22670 var b = CKEDITOR.plugins.scayt, 22671 c = a.scayt; 22672 a && setTimeout(function() { 22673 c && (c.fire("removeMarkupInDocument", {}), b.reloadMarkup(c)) 22674 }, 0) 22675 }) 22676 }); 22677 CKEDITOR.on("scaytReady", function() { 22678 if (!0 === CKEDITOR.config.scayt_handleCheckDirty) { 22679 var a = CKEDITOR.editor.prototype; 22680 a.checkDirty = CKEDITOR.tools.override(a.checkDirty, function(a) { 22681 return function() { 22682 var b = null, 22683 c = this.scayt; 22684 if (CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[this.name] && this.scayt) { 22685 if (b = "ready" == this.status) var f = c.removeMarkupFromString(this.getSnapshot()), 22686 c = c.removeMarkupFromString(this._.previousValue), 22687 b = b && c !== f 22688 } else b = a.call(this); 22689 return b 22690 } 22691 }); 22692 a.resetDirty = CKEDITOR.tools.override(a.resetDirty, 22693 function(a) { 22694 return function() { 22695 var b = this.scayt; 22696 CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[this.name] && this.scayt ? this._.previousValue = b.removeMarkupFromString(this.getSnapshot()) : a.call(this) 22697 } 22698 }) 22699 } 22700 if (!0 === CKEDITOR.config.scayt_handleUndoRedo) { 22701 var a = CKEDITOR.plugins.undo.Image.prototype, 22702 c = "function" == typeof a.equalsContent ? "equalsContent" : "equals"; 22703 a[c] = CKEDITOR.tools.override(a[c], function(a) { 22704 return function(b) { 22705 var c = b.editor.scayt, 22706 f = this.contents, 22707 g = b.contents, 22708 k = null; 22709 CKEDITOR.plugins.scayt && 22710 CKEDITOR.plugins.scayt.state.scayt[b.editor.name] && b.editor.scayt && (this.contents = c.removeMarkupFromString(f) || "", b.contents = c.removeMarkupFromString(g) || ""); 22711 k = a.apply(this, arguments); 22712 this.contents = f; 22713 b.contents = g; 22714 return k 22715 } 22716 }) 22717 } 22718 }); 22719 (function() { 22720 CKEDITOR.plugins.add("stylescombo", { 22721 requires: "richcombo", 22722 init: function(c) { 22723 var l = c.config, 22724 g = c.lang.stylescombo, 22725 f = {}, 22726 k = [], 22727 m = []; 22728 c.on("stylesSet", function(a) { 22729 if (a = a.data.styles) { 22730 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 = 22731 e + 1E3 * (d == CKEDITOR.STYLE_OBJECT ? 1 : d == CKEDITOR.STYLE_BLOCK ? 2 : 3), f[h] = b, k.push(b), m.push(b)); 22732 k.sort(function(a, b) { 22733 return a._.weight - b._.weight 22734 }) 22735 } 22736 }); 22737 c.ui.addRichCombo("Styles", { 22738 label: g.label, 22739 title: g.panelTitle, 22740 toolbar: "styles,10", 22741 allowedContent: m, 22742 panel: { 22743 css: [CKEDITOR.skin.getPath("editor")].concat(l.contentsCss), 22744 multiSelect: !0, 22745 attributes: { 22746 "aria-label": g.panelTitle 22747 } 22748 }, 22749 init: function() { 22750 var a, b, c, d, e, f; 22751 e = 0; 22752 for (f = k.length; e < f; e++) a = k[e], b = a._name, d = a._.type, d != c && (this.startGroup(g["panelTitle" + String(d)]), 22753 c = d), this.add(b, a.type == CKEDITOR.STYLE_OBJECT ? b : a.buildPreview(), b); 22754 this.commit() 22755 }, 22756 onClick: function(a) { 22757 c.focus(); 22758 c.fire("saveSnapshot"); 22759 a = f[a]; 22760 var b = c.elementPath(); 22761 if (a.group && a.removeStylesFromSameGroup(c)) c.applyStyle(a); 22762 else c[a.checkActive(b, c) ? "removeStyle" : "applyStyle"](a); 22763 c.fire("saveSnapshot") 22764 }, 22765 onRender: function() { 22766 c.on("selectionChange", function(a) { 22767 var b = this.getValue(); 22768 a = a.data.path.elements; 22769 for (var h = 0, d = a.length, e; h < d; h++) { 22770 e = a[h]; 22771 for (var g in f) 22772 if (f[g].checkElementRemovable(e, !0, c)) { 22773 g != 22774 b && this.setValue(g); 22775 return 22776 } 22777 } 22778 this.setValue("") 22779 }, this) 22780 }, 22781 onOpen: function() { 22782 var a = c.getSelection(), 22783 a = a.getSelectedElement() || a.getStartElement() || c.editable(), 22784 a = c.elementPath(a), 22785 b = [0, 0, 0, 0]; 22786 this.showAll(); 22787 this.unmarkAll(); 22788 for (var h in f) { 22789 var d = f[h], 22790 e = d._.type; 22791 d.checkApplicable(a, c, c.activeFilter) ? b[e]++ : this.hideItem(h); 22792 d.checkActive(a, c) && this.mark(h) 22793 } 22794 b[CKEDITOR.STYLE_BLOCK] || this.hideGroup(g["panelTitle" + String(CKEDITOR.STYLE_BLOCK)]); 22795 b[CKEDITOR.STYLE_INLINE] || this.hideGroup(g["panelTitle" + String(CKEDITOR.STYLE_INLINE)]); 22796 b[CKEDITOR.STYLE_OBJECT] || this.hideGroup(g["panelTitle" + String(CKEDITOR.STYLE_OBJECT)]) 22797 }, 22798 refresh: function() { 22799 var a = c.elementPath(); 22800 if (a) { 22801 for (var b in f) 22802 if (f[b].checkApplicable(a, c, c.activeFilter)) return; 22803 this.setState(CKEDITOR.TRISTATE_DISABLED) 22804 } 22805 }, 22806 reset: function() { 22807 f = {}; 22808 k = [] 22809 } 22810 }) 22811 } 22812 }) 22813 })(); 22814 (function() { 22815 function k(c) { 22816 return { 22817 editorFocus: !1, 22818 canUndo: !1, 22819 modes: { 22820 wysiwyg: 1 22821 }, 22822 exec: function(d) { 22823 if (d.editable().hasFocus) { 22824 var e = d.getSelection(), 22825 b; 22826 if (b = (new CKEDITOR.dom.elementPath(e.getCommonAncestor(), e.root)).contains({ 22827 td: 1, 22828 th: 1 22829 }, 1)) { 22830 var e = d.createRange(), 22831 a = CKEDITOR.tools.tryThese(function() { 22832 var a = b.getParent().$.cells[b.$.cellIndex + (c ? -1 : 1)]; 22833 a.parentNode.parentNode; 22834 return a 22835 }, function() { 22836 var a = b.getParent(), 22837 a = a.getAscendant("table").$.rows[a.$.rowIndex + (c ? -1 : 1)]; 22838 return a.cells[c ? a.cells.length - 1 : 22839 0] 22840 }); 22841 if (a || c) 22842 if (a) a = new CKEDITOR.dom.element(a), e.moveToElementEditStart(a), e.checkStartOfBlock() && e.checkEndOfBlock() || e.selectNodeContents(a); 22843 else return !0; 22844 else { 22845 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(); 22846 e.moveToElementEditStart(f) 22847 } 22848 e.select(!0); 22849 return !0 22850 } 22851 } 22852 return !1 22853 } 22854 } 22855 } 22856 var h = { 22857 editorFocus: !1, 22858 modes: { 22859 wysiwyg: 1, 22860 source: 1 22861 } 22862 }, 22863 g = { 22864 exec: function(c) { 22865 c.container.focusNext(!0, 22866 c.tabIndex) 22867 } 22868 }, 22869 f = { 22870 exec: function(c) { 22871 c.container.focusPrevious(!0, c.tabIndex) 22872 } 22873 }; 22874 CKEDITOR.plugins.add("tab", { 22875 init: function(c) { 22876 for (var d = !1 !== c.config.enableTabKeyTools, e = c.config.tabSpaces || 0, b = ""; e--;) b += " "; 22877 if (b) c.on("key", function(a) { 22878 9 == a.data.keyCode && (c.insertText(b), a.cancel()) 22879 }); 22880 if (d) c.on("key", function(a) { 22881 (9 == a.data.keyCode && c.execCommand("selectNextCell") || a.data.keyCode == CKEDITOR.SHIFT + 9 && c.execCommand("selectPreviousCell")) && a.cancel() 22882 }); 22883 c.addCommand("blur", CKEDITOR.tools.extend(g, h)); 22884 c.addCommand("blurBack", 22885 CKEDITOR.tools.extend(f, h)); 22886 c.addCommand("selectNextCell", k()); 22887 c.addCommand("selectPreviousCell", k(!0)) 22888 } 22889 }) 22890 })(); 22891 CKEDITOR.dom.element.prototype.focusNext = function(k, h) { 22892 var g = void 0 === h ? this.getTabIndex() : h, 22893 f, c, d, e, b, a; 22894 if (0 >= g) 22895 for (b = this.getNextSourceNode(k, CKEDITOR.NODE_ELEMENT); b;) { 22896 if (b.isVisible() && 0 === b.getTabIndex()) { 22897 d = b; 22898 break 22899 } 22900 b = b.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT) 22901 } else 22902 for (b = this.getDocument().getBody().getFirst(); b = b.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT);) { 22903 if (!f) 22904 if (!c && b.equals(this)) { 22905 if (c = !0, k) { 22906 if (!(b = b.getNextSourceNode(!0, CKEDITOR.NODE_ELEMENT))) break; 22907 f = 1 22908 } 22909 } else c && !this.contains(b) && 22910 (f = 1); 22911 if (b.isVisible() && !(0 > (a = b.getTabIndex()))) { 22912 if (f && a == g) { 22913 d = b; 22914 break 22915 } 22916 a > g && (!d || !e || a < e) ? (d = b, e = a) : d || 0 !== a || (d = b, e = a) 22917 } 22918 } 22919 d && d.focus() 22920 }; 22921 CKEDITOR.dom.element.prototype.focusPrevious = function(k, h) { 22922 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);) { 22923 if (!f) 22924 if (!c && a.equals(this)) { 22925 if (c = !0, k) { 22926 if (!(a = a.getPreviousSourceNode(!0, CKEDITOR.NODE_ELEMENT))) break; 22927 f = 1 22928 } 22929 } else c && !this.contains(a) && (f = 1); 22930 if (a.isVisible() && !(0 > (b = a.getTabIndex()))) 22931 if (0 >= g) { 22932 if (f && 0 === b) { 22933 d = a; 22934 break 22935 } 22936 b > e && (d = a, e = b) 22937 } else { 22938 if (f && b == g) { 22939 d = a; 22940 break 22941 } 22942 b < g && (!d || b > e) && (d = a, e = b) 22943 } 22944 } 22945 d && d.focus() 22946 }; 22947 CKEDITOR.plugins.add("table", { 22948 requires: "dialog", 22949 init: function(a) { 22950 function f(c) { 22951 return CKEDITOR.tools.extend(c || {}, { 22952 contextSensitive: 1, 22953 refresh: function(c, b) { 22954 this.setState(b.contains("table", 1) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED) 22955 } 22956 }) 22957 } 22958 if (!a.blockless) { 22959 var e = a.lang.table; 22960 a.addCommand("table", new CKEDITOR.dialogCommand("table", { 22961 context: "table", 22962 allowedContent: "table{width,height}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr[scope];" + (a.plugins.dialogadvtab ? 22963 "table" + a.plugins.dialogadvtab.allowedContent() : ""), 22964 requiredContent: "table", 22965 contentTransformations: [ 22966 ["table{width}: sizeToStyle", "table[width]: sizeToAttribute"], 22967 ["td: splitBorderShorthand"], 22968 [{ 22969 element: "table", 22970 right: function(c) { 22971 if (c.styles) { 22972 var a; 22973 if (c.styles.border) a = CKEDITOR.tools.style.parse.border(c.styles.border); 22974 else if (CKEDITOR.env.ie && 8 === CKEDITOR.env.version) { 22975 var b = c.styles; 22976 b["border-left"] && b["border-left"] === b["border-right"] && b["border-right"] === b["border-top"] && b["border-top"] === b["border-bottom"] && 22977 (a = CKEDITOR.tools.style.parse.border(b["border-top"])) 22978 } 22979 a && a.style && "solid" === a.style && a.width && 0 !== parseFloat(a.width) && (c.attributes.border = 1); 22980 "collapse" == c.styles["border-collapse"] && (c.attributes.cellspacing = 0) 22981 } 22982 } 22983 }] 22984 ] 22985 })); 22986 a.addCommand("tableProperties", new CKEDITOR.dialogCommand("tableProperties", f())); 22987 a.addCommand("tableDelete", f({ 22988 exec: function(a) { 22989 var d = a.elementPath().contains("table", 1); 22990 if (d) { 22991 var b = d.getParent(), 22992 e = a.editable(); 22993 1 != b.getChildCount() || b.is("td", "th") || b.equals(e) || (d = b); 22994 a = a.createRange(); 22995 a.moveToPosition(d, CKEDITOR.POSITION_BEFORE_START); 22996 d.remove(); 22997 a.select() 22998 } 22999 } 23000 })); 23001 a.ui.addButton && a.ui.addButton("Table", { 23002 label: e.toolbar, 23003 command: "table", 23004 toolbar: "insert,30" 23005 }); 23006 CKEDITOR.dialog.add("table", this.path + "dialogs/table.js"); 23007 CKEDITOR.dialog.add("tableProperties", this.path + "dialogs/table.js"); 23008 a.addMenuItems && a.addMenuItems({ 23009 table: { 23010 label: e.menu, 23011 command: "tableProperties", 23012 group: "table", 23013 order: 5 23014 }, 23015 tabledelete: { 23016 label: e.deleteTable, 23017 command: "tableDelete", 23018 group: "table", 23019 order: 1 23020 } 23021 }); 23022 a.on("doubleclick", function(a) { 23023 a.data.element.is("table") && 23024 (a.data.dialog = "tableProperties") 23025 }); 23026 a.contextMenu && a.contextMenu.addListener(function() { 23027 return { 23028 tabledelete: CKEDITOR.TRISTATE_OFF, 23029 table: CKEDITOR.TRISTATE_OFF 23030 } 23031 }) 23032 } 23033 } 23034 }); 23035 (function() { 23036 function q(d, f) { 23037 function b(a) { 23038 return f ? f.contains(a) && a.getAscendant("table", !0).equals(f) : !0 23039 } 23040 23041 function c(b) { 23042 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)) 23043 } 23044 var e = [], 23045 a = {}; 23046 if (!d) return e; 23047 for (var g = d.getRanges(), k = 0; k < g.length; k++) { 23048 var h = g[k]; 23049 if (h.collapsed)(h = h.getCommonAncestor().getAscendant({ 23050 td: 1, 23051 th: 1 23052 }, !0)) && b(h) && e.push(h); 23053 else { 23054 var h = new CKEDITOR.dom.walker(h), 23055 l; 23056 for (h.guard = 23057 c; l = h.next();) l.type == CKEDITOR.NODE_ELEMENT && l.is(CKEDITOR.dtd.table) || (l = l.getAscendant({ 23058 td: 1, 23059 th: 1 23060 }, !0)) && !l.getCustomData("selected_cell") && b(l) && (CKEDITOR.dom.element.setMarker(a, l, "selected_cell", !0), e.push(l)) 23061 } 23062 } 23063 CKEDITOR.dom.element.clearAllMarkers(a); 23064 return e 23065 } 23066 23067 function r(d, f) { 23068 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, 23069 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++) { 23070 var h; 23071 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.$); 23072 k += h.colSpan - 1 23073 } 23074 f ? c.insertBefore(a) : c.insertAfter(a); 23075 return c 23076 } 23077 23078 function B(d) { 23079 if (d instanceof CKEDITOR.dom.selection) { 23080 var f = d.getRanges(), 23081 b = q(d), 23082 c = b[0].getAscendant("table"), 23083 e = CKEDITOR.tools.buildTableMap(c), 23084 a = b[0].getParent().$.rowIndex, 23085 b = b[b.length - 1], 23086 g = b.getParent().$.rowIndex + b.$.rowSpan - 1, 23087 b = []; 23088 d.reset(); 23089 for (d = a; d <= g; d++) { 23090 for (var k = e[d], h = new CKEDITOR.dom.element(c.$.rows[d]), l = 0; l < k.length; l++) { 23091 var m = new CKEDITOR.dom.element(k[l]), 23092 n = m.getParent().$.rowIndex; 23093 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))); 23094 l += m.$.colSpan - 1 23095 } 23096 b.push(h) 23097 } 23098 e = c.$.rows; 23099 f[0].moveToPosition(c, CKEDITOR.POSITION_BEFORE_START); 23100 a = new CKEDITOR.dom.element(e[g + 23101 1] || (0 < a ? e[a - 1] : null) || c.$.parentNode); 23102 for (d = b.length; 0 <= d; d--) B(b[d]); 23103 return c.$.parentNode ? a : (f[0].select(), null) 23104 } 23105 d instanceof CKEDITOR.dom.element && (c = d.getAscendant("table"), 1 == c.$.rows.length ? c.remove() : d.remove()); 23106 return null 23107 } 23108 23109 function v(d) { 23110 for (var f = d.getParent().$.cells, b = 0, c = 0; c < f.length; c++) { 23111 var e = f[c], 23112 b = b + e.colSpan; 23113 if (e == d.$) break 23114 } 23115 return b - 1 23116 } 23117 23118 function w(d, f) { 23119 for (var b = f ? Infinity : 0, c = 0; c < d.length; c++) { 23120 var e = v(d[c]); 23121 if (f ? e < b : e > b) b = e 23122 } 23123 return b 23124 } 23125 23126 function u(d, f) { 23127 for (var b = D(d) ? d : q(d), c = b[0].getAscendant("table"), 23128 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]); 23129 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); 23130 return b 23131 } 23132 23133 function y(d) { 23134 function f(a) { 23135 var b, c, d; 23136 b = a.getRanges(); 23137 if (1 !== b.length) return a; 23138 b = b[0]; 23139 if (b.collapsed || 0 !== b.endOffset) return a; 23140 c = b.endContainer; 23141 d = c.getName().toLowerCase(); 23142 if ("td" !== d && "th" !== d) return a; 23143 for ((d = c.getPrevious()) || (d = c.getParent().getPrevious().getLast()); d.type !== CKEDITOR.NODE_TEXT && "br" !== d.getName().toLowerCase();) 23144 if (d = d.getLast(), !d) return a; 23145 b.setEndAt(d, CKEDITOR.POSITION_BEFORE_END); 23146 return b.select() 23147 } 23148 CKEDITOR.env.webkit && !d.isFake && (d = f(d)); 23149 var b = d.getRanges(), 23150 c = q(d), 23151 e = c[0], 23152 a = c[c.length - 1], 23153 c = e.getAscendant("table"), 23154 g = CKEDITOR.tools.buildTableMap(c), 23155 k, h, l = []; 23156 d.reset(); 23157 var m = 0; 23158 for (d = g.length; m < d; m++) 23159 for (var n = 23160 0, p = g[m].length; n < p; n++) void 0 === k && g[m][n] == e.$ && (k = n), g[m][n] == a.$ && (h = n); 23161 for (m = k; m <= h; m++) 23162 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)); 23163 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); 23164 l.length == d && (b[0].moveToPosition(c, CKEDITOR.POSITION_AFTER_END), 23165 b[0].select(), c.remove()); 23166 return k 23167 } 23168 23169 function t(d, f) { 23170 var b = d.getStartElement().getAscendant({ 23171 td: 1, 23172 th: 1 23173 }, !0); 23174 if (b) { 23175 var c = b.clone(); 23176 c.appendBogus(); 23177 f ? c.insertBefore(b) : c.insertAfter(b) 23178 } 23179 } 23180 23181 function z(d) { 23182 if (d instanceof CKEDITOR.dom.selection) { 23183 var f = d.getRanges(), 23184 b = q(d), 23185 c = b[0] && b[0].getAscendant("table"), 23186 e; 23187 a: { 23188 var a = 0;e = b.length - 1; 23189 for (var g = {}, k, h; k = b[a++];) CKEDITOR.dom.element.setMarker(g, k, "delete_cell", !0); 23190 for (a = 0; k = b[a++];) 23191 if ((h = k.getPrevious()) && !h.getCustomData("delete_cell") || (h = k.getNext()) && !h.getCustomData("delete_cell")) { 23192 CKEDITOR.dom.element.clearAllMarkers(g); 23193 e = h; 23194 break a 23195 } CKEDITOR.dom.element.clearAllMarkers(g);a = b[0].getParent(); 23196 (a = a.getPrevious()) ? e = a.getLast() : (a = b[e].getParent(), e = (a = a.getNext()) ? a.getChild(0) : null) 23197 } 23198 d.reset(); 23199 for (d = b.length - 1; 0 <= d; d--) z(b[d]); 23200 e ? p(e, !0) : c && (f[0].moveToPosition(c, CKEDITOR.POSITION_BEFORE_START), f[0].select(), c.remove()) 23201 } else d instanceof CKEDITOR.dom.element && (f = d.getParent(), 1 == f.getChildCount() ? f.remove() : d.remove()) 23202 } 23203 23204 function p(d, f) { 23205 var b = d.getDocument(), 23206 c = CKEDITOR.document; 23207 CKEDITOR.env.ie && 10 == CKEDITOR.env.version && 23208 (c.focus(), b.focus()); 23209 b = new CKEDITOR.dom.range(b); 23210 b["moveToElementEdit" + (f ? "End" : "Start")](d) || (b.selectNodeContents(d), b.collapse(f ? !1 : !0)); 23211 b.select(!0) 23212 } 23213 23214 function A(d, f, b) { 23215 d = d[f]; 23216 if ("undefined" == typeof b) return d; 23217 for (f = 0; d && f < d.length; f++) { 23218 if (b.is && d[f] == b.$) return f; 23219 if (f == b) return new CKEDITOR.dom.element(d[f]) 23220 } 23221 return b.is ? -1 : null 23222 } 23223 23224 function x(d, f, b) { 23225 var c = q(d), 23226 e; 23227 if ((f ? 1 != c.length : 2 > c.length) || (e = d.getCommonAncestor()) && e.type == CKEDITOR.NODE_ELEMENT && e.is("table")) return !1; 23228 var a; 23229 d = c[0]; 23230 e = d.getAscendant("table"); 23231 var g = CKEDITOR.tools.buildTableMap(e), 23232 k = g.length, 23233 h = g[0].length, 23234 l = d.getParent().$.rowIndex, 23235 m = A(g, l, d); 23236 if (f) { 23237 var n; 23238 try { 23239 var p = parseInt(d.getAttribute("rowspan"), 10) || 1; 23240 a = parseInt(d.getAttribute("colspan"), 10) || 1; 23241 n = g["up" == f ? l - p : "down" == f ? l + p : l]["left" == f ? m - a : "right" == f ? m + a : m] 23242 } catch (x) { 23243 return !1 23244 } 23245 if (!n || d.$ == n) return !1; 23246 c["up" == f || "left" == f ? "unshift" : "push"](new CKEDITOR.dom.element(n)) 23247 } 23248 f = d.getDocument(); 23249 var r = l, 23250 p = n = 0, 23251 u = !b && new CKEDITOR.dom.documentFragment(f), 23252 w = 0; 23253 for (f = 0; f < c.length; f++) { 23254 a = c[f]; 23255 var t = a.getParent(), 23256 y = a.getFirst(), 23257 v = a.$.colSpan, 23258 z = a.$.rowSpan, 23259 t = t.$.rowIndex, 23260 B = A(g, t, a), 23261 w = w + v * z, 23262 p = Math.max(p, B - m + v); 23263 n = Math.max(n, t - l + z); 23264 b || (v = a, (z = v.getBogus()) && z.remove(), v.trim(), a.getChildren().count() && (t == r || !y || y.isBlockBoundary && y.isBlockBoundary({ 23265 br: 1 23266 }) || (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("")); 23267 r = t 23268 } 23269 if (b) return n * p == w; 23270 u.moveChildren(d); 23271 d.appendBogus(); 23272 p >= h ? d.removeAttribute("rowSpan") : d.$.rowSpan = n; 23273 n >= k ? d.removeAttribute("colSpan") : 23274 d.$.colSpan = p; 23275 b = new CKEDITOR.dom.nodeList(e.$.rows); 23276 c = b.count(); 23277 for (f = c - 1; 0 <= f; f--) e = b.getItem(f), e.$.cells.length || (e.remove(), c++); 23278 return d 23279 } 23280 23281 function C(d, f) { 23282 var b = q(d); 23283 if (1 < b.length) return !1; 23284 if (f) return !0; 23285 var b = b[0], 23286 c = b.getParent(), 23287 e = c.getAscendant("table"), 23288 a = CKEDITOR.tools.buildTableMap(e), 23289 g = c.$.rowIndex, 23290 k = A(a, g, b), 23291 h = b.$.rowSpan, 23292 l; 23293 if (1 < h) { 23294 l = Math.ceil(h / 2); 23295 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++) 23296 if (m = a[g], m.parentNode == e.$ && 23297 g > k) { 23298 c.insertBefore(new CKEDITOR.dom.element(m)); 23299 break 23300 } else m = null; 23301 m || e.append(c) 23302 } else 23303 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++; 23304 c.appendBogus(); 23305 b.$.rowSpan = l; 23306 c.$.rowSpan = h; 23307 1 == l && b.removeAttribute("rowSpan"); 23308 1 == h && c.removeAttribute("rowSpan"); 23309 return c 23310 } 23311 23312 function E(d, f) { 23313 var b = q(d); 23314 if (1 < b.length) return !1; 23315 if (f) return !0; 23316 var b = b[0], 23317 c = b.getParent(), 23318 e = c.getAscendant("table"), 23319 e = CKEDITOR.tools.buildTableMap(e), 23320 a = A(e, c.$.rowIndex, b), 23321 g = b.$.colSpan; 23322 if (1 < g) c = Math.ceil(g / 2), g = Math.floor(g / 2); 23323 else { 23324 for (var g = c = 1, k = [], h = 0; h < e.length; h++) { 23325 var l = e[h]; 23326 k.push(l[a]); 23327 1 < l[a].rowSpan && (h += l[a].rowSpan - 1) 23328 } 23329 for (e = 0; e < k.length; e++) k[e].colSpan++ 23330 } 23331 e = b.clone(); 23332 e.insertAfter(b); 23333 e.appendBogus(); 23334 b.$.colSpan = c; 23335 e.$.colSpan = g; 23336 1 == c && b.removeAttribute("colSpan"); 23337 1 == g && e.removeAttribute("colSpan"); 23338 return e 23339 } 23340 var F = /^(?:td|th)$/, 23341 D = CKEDITOR.tools.isArray; 23342 CKEDITOR.plugins.tabletools = { 23343 requires: "table,dialog,contextmenu", 23344 init: function(d) { 23345 function f(a) { 23346 return CKEDITOR.tools.extend(a || {}, { 23347 contextSensitive: 1, 23348 refresh: function(a, b) { 23349 this.setState(b.contains({ 23350 td: 1, 23351 th: 1 23352 }, 1) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED) 23353 } 23354 }) 23355 } 23356 23357 function b(a, b) { 23358 var c = d.addCommand(a, b); 23359 d.addFeature(c) 23360 } 23361 var c = d.lang.table, 23362 e = CKEDITOR.tools.style.parse; 23363 b("cellProperties", new CKEDITOR.dialogCommand("cellProperties", f({ 23364 allowedContent: "td th{width,height,border-color,background-color,white-space,vertical-align,text-align}[colspan,rowspan]", 23365 requiredContent: "table", 23366 contentTransformations: [ 23367 [{ 23368 element: "td", 23369 left: function(a) { 23370 return a.styles.background && 23371 e.background(a.styles.background).color 23372 }, 23373 right: function(a) { 23374 a.styles["background-color"] = e.background(a.styles.background).color 23375 } 23376 }, { 23377 element: "td", 23378 check: "td{vertical-align}", 23379 left: function(a) { 23380 return a.attributes && a.attributes.valign 23381 }, 23382 right: function(a) { 23383 a.styles["vertical-align"] = a.attributes.valign; 23384 delete a.attributes.valign 23385 } 23386 }], 23387 [{ 23388 element: "tr", 23389 check: "td{height}", 23390 left: function(a) { 23391 return a.styles && a.styles.height 23392 }, 23393 right: function(a) { 23394 CKEDITOR.tools.array.forEach(a.children, function(b) { 23395 b.name in { 23396 td: 1, 23397 th: 1 23398 } && 23399 (b.attributes["cke-row-height"] = a.styles.height) 23400 }); 23401 delete a.styles.height 23402 } 23403 }], 23404 [{ 23405 element: "td", 23406 check: "td{height}", 23407 left: function(a) { 23408 return (a = a.attributes) && a["cke-row-height"] 23409 }, 23410 right: function(a) { 23411 a.styles.height = a.attributes["cke-row-height"]; 23412 delete a.attributes["cke-row-height"] 23413 } 23414 }] 23415 ] 23416 }))); 23417 CKEDITOR.dialog.add("cellProperties", this.path + "dialogs/tableCell.js"); 23418 b("rowDelete", f({ 23419 requiredContent: "table", 23420 exec: function(a) { 23421 a = a.getSelection(); 23422 (a = B(a)) && p(a) 23423 } 23424 })); 23425 b("rowInsertBefore", f({ 23426 requiredContent: "table", 23427 exec: function(a) { 23428 a = 23429 a.getSelection(); 23430 a = q(a); 23431 r(a, !0) 23432 } 23433 })); 23434 b("rowInsertAfter", f({ 23435 requiredContent: "table", 23436 exec: function(a) { 23437 a = a.getSelection(); 23438 a = q(a); 23439 r(a) 23440 } 23441 })); 23442 b("columnDelete", f({ 23443 requiredContent: "table", 23444 exec: function(a) { 23445 a = a.getSelection(); 23446 (a = y(a)) && p(a, !0) 23447 } 23448 })); 23449 b("columnInsertBefore", f({ 23450 requiredContent: "table", 23451 exec: function(a) { 23452 a = a.getSelection(); 23453 a = q(a); 23454 u(a, !0) 23455 } 23456 })); 23457 b("columnInsertAfter", f({ 23458 requiredContent: "table", 23459 exec: function(a) { 23460 a = a.getSelection(); 23461 a = q(a); 23462 u(a) 23463 } 23464 })); 23465 b("cellDelete", f({ 23466 requiredContent: "table", 23467 exec: function(a) { 23468 a = 23469 a.getSelection(); 23470 z(a) 23471 } 23472 })); 23473 b("cellMerge", f({ 23474 allowedContent: "td[colspan,rowspan]", 23475 requiredContent: "td[colspan,rowspan]", 23476 exec: function(a, b) { 23477 b.cell = x(a.getSelection()); 23478 p(b.cell, !0) 23479 } 23480 })); 23481 b("cellMergeRight", f({ 23482 allowedContent: "td[colspan]", 23483 requiredContent: "td[colspan]", 23484 exec: function(a, b) { 23485 b.cell = x(a.getSelection(), "right"); 23486 p(b.cell, !0) 23487 } 23488 })); 23489 b("cellMergeDown", f({ 23490 allowedContent: "td[rowspan]", 23491 requiredContent: "td[rowspan]", 23492 exec: function(a, b) { 23493 b.cell = x(a.getSelection(), "down"); 23494 p(b.cell, !0) 23495 } 23496 })); 23497 b("cellVerticalSplit", 23498 f({ 23499 allowedContent: "td[rowspan]", 23500 requiredContent: "td[rowspan]", 23501 exec: function(a) { 23502 p(E(a.getSelection())) 23503 } 23504 })); 23505 b("cellHorizontalSplit", f({ 23506 allowedContent: "td[colspan]", 23507 requiredContent: "td[colspan]", 23508 exec: function(a) { 23509 p(C(a.getSelection())) 23510 } 23511 })); 23512 b("cellInsertBefore", f({ 23513 requiredContent: "table", 23514 exec: function(a) { 23515 a = a.getSelection(); 23516 t(a, !0) 23517 } 23518 })); 23519 b("cellInsertAfter", f({ 23520 requiredContent: "table", 23521 exec: function(a) { 23522 a = a.getSelection(); 23523 t(a) 23524 } 23525 })); 23526 d.addMenuItems && d.addMenuItems({ 23527 tablecell: { 23528 label: c.cell.menu, 23529 group: "tablecell", 23530 order: 1, 23531 getItems: function() { 23532 var a = d.getSelection(), 23533 b = q(a); 23534 return { 23535 tablecell_insertBefore: CKEDITOR.TRISTATE_OFF, 23536 tablecell_insertAfter: CKEDITOR.TRISTATE_OFF, 23537 tablecell_delete: CKEDITOR.TRISTATE_OFF, 23538 tablecell_merge: x(a, null, !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, 23539 tablecell_merge_right: x(a, "right", !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, 23540 tablecell_merge_down: x(a, "down", !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, 23541 tablecell_split_vertical: E(a, !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, 23542 tablecell_split_horizontal: C(a, !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, 23543 tablecell_properties: 0 < b.length ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED 23544 } 23545 } 23546 }, 23547 tablecell_insertBefore: { 23548 label: c.cell.insertBefore, 23549 group: "tablecell", 23550 command: "cellInsertBefore", 23551 order: 5 23552 }, 23553 tablecell_insertAfter: { 23554 label: c.cell.insertAfter, 23555 group: "tablecell", 23556 command: "cellInsertAfter", 23557 order: 10 23558 }, 23559 tablecell_delete: { 23560 label: c.cell.deleteCell, 23561 group: "tablecell", 23562 command: "cellDelete", 23563 order: 15 23564 }, 23565 tablecell_merge: { 23566 label: c.cell.merge, 23567 group: "tablecell", 23568 command: "cellMerge", 23569 order: 16 23570 }, 23571 tablecell_merge_right: { 23572 label: c.cell.mergeRight, 23573 group: "tablecell", 23574 command: "cellMergeRight", 23575 order: 17 23576 }, 23577 tablecell_merge_down: { 23578 label: c.cell.mergeDown, 23579 group: "tablecell", 23580 command: "cellMergeDown", 23581 order: 18 23582 }, 23583 tablecell_split_horizontal: { 23584 label: c.cell.splitHorizontal, 23585 group: "tablecell", 23586 command: "cellHorizontalSplit", 23587 order: 19 23588 }, 23589 tablecell_split_vertical: { 23590 label: c.cell.splitVertical, 23591 group: "tablecell", 23592 command: "cellVerticalSplit", 23593 order: 20 23594 }, 23595 tablecell_properties: { 23596 label: c.cell.title, 23597 group: "tablecellproperties", 23598 command: "cellProperties", 23599 order: 21 23600 }, 23601 tablerow: { 23602 label: c.row.menu, 23603 group: "tablerow", 23604 order: 1, 23605 getItems: function() { 23606 return { 23607 tablerow_insertBefore: CKEDITOR.TRISTATE_OFF, 23608 tablerow_insertAfter: CKEDITOR.TRISTATE_OFF, 23609 tablerow_delete: CKEDITOR.TRISTATE_OFF 23610 } 23611 } 23612 }, 23613 tablerow_insertBefore: { 23614 label: c.row.insertBefore, 23615 group: "tablerow", 23616 command: "rowInsertBefore", 23617 order: 5 23618 }, 23619 tablerow_insertAfter: { 23620 label: c.row.insertAfter, 23621 group: "tablerow", 23622 command: "rowInsertAfter", 23623 order: 10 23624 }, 23625 tablerow_delete: { 23626 label: c.row.deleteRow, 23627 group: "tablerow", 23628 command: "rowDelete", 23629 order: 15 23630 }, 23631 tablecolumn: { 23632 label: c.column.menu, 23633 group: "tablecolumn", 23634 order: 1, 23635 getItems: function() { 23636 return { 23637 tablecolumn_insertBefore: CKEDITOR.TRISTATE_OFF, 23638 tablecolumn_insertAfter: CKEDITOR.TRISTATE_OFF, 23639 tablecolumn_delete: CKEDITOR.TRISTATE_OFF 23640 } 23641 } 23642 }, 23643 tablecolumn_insertBefore: { 23644 label: c.column.insertBefore, 23645 group: "tablecolumn", 23646 command: "columnInsertBefore", 23647 order: 5 23648 }, 23649 tablecolumn_insertAfter: { 23650 label: c.column.insertAfter, 23651 group: "tablecolumn", 23652 command: "columnInsertAfter", 23653 order: 10 23654 }, 23655 tablecolumn_delete: { 23656 label: c.column.deleteColumn, 23657 group: "tablecolumn", 23658 command: "columnDelete", 23659 order: 15 23660 } 23661 }); 23662 d.contextMenu && d.contextMenu.addListener(function(a, b, c) { 23663 return (a = c.contains({ 23664 td: 1, 23665 th: 1 23666 }, 1)) && !a.isReadOnly() ? { 23667 tablecell: CKEDITOR.TRISTATE_OFF, 23668 tablerow: CKEDITOR.TRISTATE_OFF, 23669 tablecolumn: CKEDITOR.TRISTATE_OFF 23670 } : null 23671 }) 23672 }, 23673 getCellColIndex: v, 23674 insertRow: r, 23675 insertColumn: u, 23676 getSelectedCells: q 23677 }; 23678 CKEDITOR.plugins.add("tabletools", CKEDITOR.plugins.tabletools) 23679 })(); 23680 CKEDITOR.tools.buildTableMap = function(q, r, B, v, w) { 23681 q = q.$.rows; 23682 B = B || 0; 23683 v = "number" === typeof v ? v : q.length - 1; 23684 w = "number" === typeof w ? w : -1; 23685 var u = -1, 23686 y = []; 23687 for (r = r || 0; r <= v; r++) { 23688 u++; 23689 !y[u] && (y[u] = []); 23690 for (var t = -1, z = B; z <= (-1 === w ? q[r].cells.length - 1 : w); z++) { 23691 var p = q[r].cells[z]; 23692 if (!p) break; 23693 for (t++; y[u][t];) t++; 23694 for (var A = isNaN(p.colSpan) ? 1 : p.colSpan, p = isNaN(p.rowSpan) ? 1 : p.rowSpan, x = 0; x < p && !(r + x > v); x++) { 23695 y[u + x] || (y[u + x] = []); 23696 for (var C = 0; C < A; C++) y[u + x][t + C] = q[r].cells[z] 23697 } 23698 t += A - 1; 23699 if (-1 !== w && t >= w) break 23700 } 23701 } 23702 return y 23703 }; 23704 (function() { 23705 function D(a) { 23706 return CKEDITOR.plugins.widget && CKEDITOR.plugins.widget.isDomWidget(a) 23707 } 23708 23709 function z(a, b) { 23710 var c = a.getAscendant("table"), 23711 d = b.getAscendant("table"), 23712 e = CKEDITOR.tools.buildTableMap(c), 23713 g = r(a), 23714 h = r(b), 23715 k = [], 23716 f = {}, 23717 l, p; 23718 c.contains(d) && (b = b.getAscendant({ 23719 td: 1, 23720 th: 1 23721 }), h = r(b)); 23722 g > h && (c = g, g = h, h = c, c = a, a = b, b = c); 23723 for (c = 0; c < e[g].length; c++) 23724 if (a.$ === e[g][c]) { 23725 l = c; 23726 break 23727 } for (c = 0; c < e[h].length; c++) 23728 if (b.$ === e[h][c]) { 23729 p = c; 23730 break 23731 } l > p && (c = l, l = p, p = c); 23732 for (c = g; c <= h; c++) 23733 for (g = l; g <= p; g++) d = new CKEDITOR.dom.element(e[c][g]), 23734 d.$ && !d.getCustomData("selected_cell") && (k.push(d), CKEDITOR.dom.element.setMarker(f, d, "selected_cell", !0)); 23735 CKEDITOR.dom.element.clearAllMarkers(f); 23736 return k 23737 } 23738 23739 function I(a) { 23740 if (a) return a = a.clone(), a.enlarge(CKEDITOR.ENLARGE_ELEMENT), (a = a.getEnclosedNode()) && a.is && a.is(CKEDITOR.dtd.$tableContent) 23741 } 23742 23743 function J(a) { 23744 return (a = a.editable().findOne(".cke_table-faked-selection")) && a.getAscendant("table") 23745 } 23746 23747 function A(a, b) { 23748 var c = a.editable().find(".cke_table-faked-selection"), 23749 d; 23750 a.fire("lockSnapshot"); 23751 a.editable().removeClass("cke_table-faked-selection-editor"); 23752 for (d = 0; d < c.count(); d++) c.getItem(d).removeClass("cke_table-faked-selection"); 23753 0 < c.count() && c.getItem(0).getAscendant("table").data("cke-table-faked-selection-table", !1); 23754 a.fire("unlockSnapshot"); 23755 b && (m = { 23756 active: !1 23757 }, a.getSelection().isInTable() && a.getSelection().reset()) 23758 } 23759 23760 function t(a, b) { 23761 var c = [], 23762 d, e; 23763 for (e = 0; e < b.length; e++) d = a.createRange(), d.setStartBefore(b[e]), d.setEndAfter(b[e]), c.push(d); 23764 a.getSelection().selectRanges(c) 23765 } 23766 23767 function K(a) { 23768 var b = a.editable().find(".cke_table-faked-selection"); 23769 1 > b.count() || 23770 (b = z(b.getItem(0), b.getItem(b.count() - 1)), t(a, b)) 23771 } 23772 23773 function L(a, b, c) { 23774 var d = v(a.getSelection(!0)); 23775 b = b.is("table") ? null : b; 23776 var e; 23777 (e = m.active && !m.first) && !(e = b) && (e = a.getSelection().getRanges(), e = 1 < d.length || e[0] && !e[0].collapsed ? !0 : !1); 23778 if (e) m.first = b || d[0], m.dirty = b ? !1 : 1 !== d.length; 23779 else if (m.active && b && m.first.getAscendant("table").equals(b.getAscendant("table"))) { 23780 d = z(m.first, b); 23781 if (!m.dirty && 1 === d.length && !D(c.data.getTarget())) return A(a, "mouseup" === c.name); 23782 m.dirty = !0; 23783 m.last = b; 23784 t(a, d) 23785 } 23786 } 23787 23788 function M(a) { 23789 var b = 23790 (a = a.editor || a.sender.editor) && a.getSelection(), 23791 c = b && b.getRanges() || [], 23792 d; 23793 if (b && (A(a), b.isInTable() && b.isFake)) { 23794 1 === c.length && c[0]._getTableElement() && c[0]._getTableElement().is("table") && (d = c[0]._getTableElement()); 23795 d = v(b, d); 23796 a.fire("lockSnapshot"); 23797 for (b = 0; b < d.length; b++) d[b].addClass("cke_table-faked-selection"); 23798 0 < d.length && (a.editable().addClass("cke_table-faked-selection-editor"), d[0].getAscendant("table").data("cke-table-faked-selection-table", "")); 23799 a.fire("unlockSnapshot") 23800 } 23801 } 23802 23803 function r(a) { 23804 return a.getAscendant("tr", 23805 !0).$.rowIndex 23806 } 23807 23808 function w(a) { 23809 function b(a, b) { 23810 return a && b ? a.equals(b) || a.contains(b) || b.contains(a) || a.getCommonAncestor(b).is(l) : !1 23811 } 23812 23813 function c(a) { 23814 return !a.getAscendant("table", !0) && a.getDocument().equals(e.document) 23815 } 23816 23817 function d(a, d, e, f) { 23818 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 23819 } 23820 if (a.data.getTarget().getName && ("mouseup" === a.name || !D(a.data.getTarget()))) { 23821 var e = a.editor || a.listenerData.editor, 23822 g = e.getSelection(1), 23823 h = J(e), 23824 k = a.data.getTarget(), 23825 f = k && k.getAscendant({ 23826 td: 1, 23827 th: 1 23828 }, !0), 23829 k = k && k.getAscendant("table", !0), 23830 l = { 23831 table: 1, 23832 thead: 1, 23833 tbody: 1, 23834 tfoot: 1, 23835 tr: 1, 23836 td: 1, 23837 th: 1 23838 }; 23839 d(a, g, h, k) && A(e, !0); 23840 !m.active && "mousedown" === a.name && CKEDITOR.tools.getMouseButton(a) === CKEDITOR.MOUSE_BUTTON_LEFT && k && (m = { 23841 active: !0 23842 }, CKEDITOR.document.on("mouseup", w, null, { 23843 editor: e 23844 })); 23845 (f || k) && L(e, f || k, a); 23846 "mouseup" === a.name && (CKEDITOR.tools.getMouseButton(a) === CKEDITOR.MOUSE_BUTTON_LEFT && (c(a.data.getTarget()) || b(h, k)) && K(e), m = { 23847 active: !1 23848 }, 23849 CKEDITOR.document.removeListener("mouseup", w)) 23850 } 23851 } 23852 23853 function N(a) { 23854 var b = a.data.getTarget().getAscendant({ 23855 td: 1, 23856 th: 1 23857 }, !0); 23858 b && !b.hasClass("cke_table-faked-selection") && (a.cancel(), a.data.preventDefault()) 23859 } 23860 23861 function O(a, b) { 23862 function c(a) { 23863 a.cancel() 23864 } 23865 var d = a.getSelection(), 23866 e = d.createBookmarks(), 23867 g = a.document, 23868 h = a.createRange(), 23869 k = g.getDocumentElement().$, 23870 f = CKEDITOR.env.ie && 9 > CKEDITOR.env.version, 23871 l = a.blockless || CKEDITOR.env.ie ? "span" : "div", 23872 p, x, n, m; 23873 g.getById("cke_table_copybin") || (p = g.createElement(l), x = g.createElement(l), 23874 x.setAttributes({ 23875 id: "cke_table_copybin", 23876 "data-cke-temp": "1" 23877 }), p.setStyles({ 23878 position: "absolute", 23879 width: "1px", 23880 height: "1px", 23881 overflow: "hidden" 23882 }), 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() { 23883 x.remove(); 23884 d.selectBookmarks(e); 23885 m.removeListener(); 23886 a.fire("unlockSnapshot"); 23887 b && (a.extractSelectedHtml(), a.fire("saveSnapshot")) 23888 }, 100)) 23889 } 23890 23891 function E(a) { 23892 var b = a.editor || a.sender.editor; 23893 b.getSelection().isInTable() && O(b, "cut" === a.name) 23894 } 23895 23896 function q(a) { 23897 this._reset(); 23898 a && this.setSelectedCells(a) 23899 } 23900 23901 function B(a, b, c) { 23902 a.on("beforeCommandExec", function(d) { 23903 -1 !== CKEDITOR.tools.array.indexOf(b, d.data.name) && (d.data.selectedCells = v(a.getSelection())) 23904 }); 23905 a.on("afterCommandExec", function(d) { 23906 -1 !== CKEDITOR.tools.array.indexOf(b, d.data.name) && c(a, d.data) 23907 }) 23908 } 23909 var m = { 23910 active: !1 23911 }, 23912 y, v, C, F, G; 23913 q.prototype = {}; 23914 q.prototype._reset = function() { 23915 this.cells = { 23916 first: null, 23917 last: null, 23918 all: [] 23919 }; 23920 this.rows = { 23921 first: null, 23922 last: null 23923 } 23924 }; 23925 q.prototype.setSelectedCells = function(a) { 23926 this._reset(); 23927 a = a.slice(0); 23928 this._arraySortByDOMOrder(a); 23929 this.cells.all = a; 23930 this.cells.first = a[0]; 23931 this.cells.last = a[a.length - 1]; 23932 this.rows.first = a[0].getAscendant("tr"); 23933 this.rows.last = this.cells.last.getAscendant("tr") 23934 }; 23935 q.prototype.getTableMap = function() { 23936 var a = C(this.cells.first), 23937 b; 23938 a: { 23939 b = this.cells.last; 23940 var c = b.getAscendant("table"), 23941 d = r(b), 23942 c = CKEDITOR.tools.buildTableMap(c), 23943 e; 23944 for (e = 0; e < c[d].length; e++) 23945 if ((new CKEDITOR.dom.element(c[d][e])).equals(b)) { 23946 b = e; 23947 break a 23948 } b = void 0 23949 } 23950 return CKEDITOR.tools.buildTableMap(this._getTable(), r(this.rows.first), a, r(this.rows.last), b) 23951 }; 23952 q.prototype._getTable = function() { 23953 return this.rows.first.getAscendant("table") 23954 }; 23955 q.prototype.insertRow = function(a, b, c) { 23956 if ("undefined" === typeof a) a = 1; 23957 else if (0 >= a) return; 23958 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(), 23959 function(a) { 23960 return c ? !0 : a.$.cellIndex >= d && a.$.cellIndex <= e 23961 }), g = b ? h.concat(g) : g.concat(h); 23962 this.setSelectedCells(g) 23963 }; 23964 q.prototype.insertColumn = function(a) { 23965 function b(a) { 23966 a = r(a); 23967 return a >= e && a <= g 23968 } 23969 if ("undefined" === typeof a) a = 1; 23970 else if (0 >= a) return; 23971 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)); 23972 this.setSelectedCells(d) 23973 }; 23974 q.prototype.emptyCells = function(a) { 23975 a = a || this.cells.all; 23976 for (var b = 0; b < a.length; b++) a[b].setHtml("") 23977 }; 23978 q.prototype._arraySortByDOMOrder = 23979 function(a) { 23980 a.sort(function(a, c) { 23981 return a.getPosition(c) & CKEDITOR.POSITION_PRECEDING ? -1 : 1 23982 }) 23983 }; 23984 var H = { 23985 onPaste: function(a) { 23986 function b(a) { 23987 return Math.max.apply(null, CKEDITOR.tools.array.map(a, function(a) { 23988 return a.length 23989 }, 0)) 23990 } 23991 23992 function c(a) { 23993 var b = d.createRange(); 23994 b.selectNodeContents(a); 23995 b.select() 23996 } 23997 var d = a.editor, 23998 e = d.getSelection(), 23999 g = v(e), 24000 h = this.findTableInPastedContent(d, a.data.dataValue), 24001 k = e.isInTable(!0) && this.isBoundarySelection(e), 24002 f, l; 24003 !g.length || 1 === g.length && !I(e.getRanges()[0]) && !k || k && !h || (g = g[0].getAscendant("table"), 24004 f = new q(v(e, g)), d.once("afterPaste", function() { 24005 var a; 24006 if (l) { 24007 a = new CKEDITOR.dom.element(l[0][0]); 24008 var b = l[l.length - 1]; 24009 a = z(a, new CKEDITOR.dom.element(b[b.length - 1])) 24010 } else a = f.cells.all; 24011 t(d, a) 24012 }), 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() { 24013 d.fire("afterPaste") 24014 }, 24015 0)) : (c(f.cells.first), d.once("afterPaste", function() { 24016 d.fire("lockSnapshot"); 24017 f.emptyCells(f.cells.all.slice(1)); 24018 t(d, f.cells.all); 24019 d.fire("unlockSnapshot") 24020 }))) 24021 }, 24022 isBoundarySelection: function(a) { 24023 a = a.getRanges()[0]; 24024 var b = a.endContainer.getAscendant("tr", !0); 24025 if (b && a.collapsed) { 24026 if (a.checkBoundaryOfElement(b, CKEDITOR.START)) return 1; 24027 if (a.checkBoundaryOfElement(b, CKEDITOR.END)) return 2 24028 } 24029 return 0 24030 }, 24031 findTableInPastedContent: function(a, b) { 24032 var c = a.dataProcessor, 24033 d = new CKEDITOR.dom.element("body"); 24034 c || (c = new CKEDITOR.htmlDataProcessor(a)); 24035 d.setHtml(c.toHtml(b), { 24036 fixForBody: !1 24037 }); 24038 return 1 < d.getChildCount() ? null : d.findOne("table") 24039 }, 24040 pasteTable: function(a, b, c) { 24041 var d, e = C(a.cells.first), 24042 g = a._getTable(), 24043 h = {}, 24044 k, f, l, p; 24045 for (l = 0; l < c.length; l++) 24046 for (k = new CKEDITOR.dom.element(g.$.rows[a.rows.first.$.rowIndex + l]), p = 0; p < c[l].length; p++) 24047 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")) { 24048 if (d && d.getParent()) f.replace(d); 24049 else if (0 === p || c[l][p - 1])(d = 0 !== p ? new CKEDITOR.dom.element(c[l][p - 24050 1 24051 ]) : 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); 24052 CKEDITOR.dom.element.setMarker(h, f, "processed", !0) 24053 } else f.getCustomData("processed") && d && d.remove(); 24054 CKEDITOR.dom.element.clearAllMarkers(h) 24055 } 24056 }; 24057 CKEDITOR.plugins.tableselection = { 24058 getCellsBetween: z, 24059 keyboardIntegration: function(a) { 24060 function b(a) { 24061 var b = a.getEnclosedNode(); 24062 b && "function" === typeof b.is && b.is({ 24063 td: 1, 24064 th: 1 24065 }) ? b.setText("") : a.deleteContents(); 24066 CKEDITOR.tools.array.forEach(a._find("td"), 24067 function(a) { 24068 a.appendBogus() 24069 }) 24070 } 24071 var c = a.editable(); 24072 c.attachListener(c, "keydown", function(a) { 24073 function c(b, e) { 24074 if (!e.length) return null; 24075 var l = a.createRange(), 24076 g = CKEDITOR.dom.range.mergeRanges(e); 24077 CKEDITOR.tools.array.forEach(g, function(a) { 24078 a.enlarge(CKEDITOR.ENLARGE_ELEMENT) 24079 }); 24080 var m = g[0].getBoundaryNodes(), 24081 n = m.startNode, 24082 m = m.endNode; 24083 if (n && n.is && n.is(h)) { 24084 for (var q = n.getAscendant("table", !0), u = n.getPreviousSourceNode(!1, CKEDITOR.NODE_ELEMENT, q), r = !1, t = function(a) { 24085 return !n.contains(a) && a.is && a.is("td", "th") 24086 }; u && 24087 !t(u);) u = u.getPreviousSourceNode(!1, CKEDITOR.NODE_ELEMENT, q); 24088 !u && m && m.is && !m.is("table") && m.getNext() && (u = m.getNext().findOne("td, th"), r = !0); 24089 if (u) l["moveToElementEdit" + (r ? "Start" : "End")](u); 24090 else l.setStartBefore(n.getAscendant("table", !0)), l.collapse(!0); 24091 g[0].deleteContents(); 24092 return [l] 24093 } 24094 if (n) return l.moveToElementEditablePosition(n), [l] 24095 } 24096 var g = { 24097 37: 1, 24098 38: 1, 24099 39: 1, 24100 40: 1, 24101 8: 1, 24102 46: 1, 24103 13: 1 24104 }, 24105 h = CKEDITOR.tools.extend({ 24106 table: 1 24107 }, CKEDITOR.dtd.$tableContent); 24108 delete h.td; 24109 delete h.th; 24110 return function(k) { 24111 var f = k.data.getKey(), 24112 l = k.data.getKeystroke(), 24113 h, m = 37 === f || 38 == f, 24114 n, q, r; 24115 if (g[f] && (h = a.getSelection()) && h.isInTable() && h.isFake) { 24116 n = h.getRanges(); 24117 q = n[0]._getTableElement(); 24118 r = n[n.length - 1]._getTableElement(); 24119 if (13 !== f || a.plugins.enterkey) k.data.preventDefault(), k.cancel(); 24120 if (36 < f && 41 > f) n[0].moveToElementEditablePosition(m ? q : r, !m), h.selectRanges([n[0]]); 24121 else if (13 !== f || 13 === l || l === CKEDITOR.SHIFT + 13) { 24122 for (k = 0; k < n.length; k++) b(n[k]); 24123 (k = c(q, n)) ? n = k: n[0].moveToElementEditablePosition(q); 24124 h.selectRanges(n); 24125 13 === f && a.plugins.enterkey ? 24126 (a.fire("lockSnapshot"), 13 === l ? a.execCommand("enter") : a.execCommand("shiftEnter"), a.fire("unlockSnapshot"), a.fire("saveSnapshot")) : 13 !== f && a.fire("saveSnapshot") 24127 } 24128 } 24129 } 24130 }(a), null, null, -1); 24131 c.attachListener(c, "keypress", function(d) { 24132 var c = a.getSelection(), 24133 g = d.data.$.charCode || 13 === d.data.getKey(), 24134 h; 24135 if (c && c.isInTable() && c.isFake && g && !(d.data.getKeystroke() & CKEDITOR.CTRL)) { 24136 d = c.getRanges(); 24137 g = d[0].getEnclosedNode().getAscendant({ 24138 td: 1, 24139 th: 1 24140 }, !0); 24141 for (h = 0; h < d.length; h++) b(d[h]); 24142 g && (d[0].moveToElementEditablePosition(g), 24143 c.selectRanges([d[0]])) 24144 } 24145 }, null, null, -1) 24146 }, 24147 isSupportedEnvironment: !(CKEDITOR.env.ie && 11 > CKEDITOR.env.version) 24148 }; 24149 CKEDITOR.plugins.add("tableselection", { 24150 requires: "clipboard,tabletools", 24151 onLoad: function() { 24152 y = CKEDITOR.plugins.tabletools; 24153 v = y.getSelectedCells; 24154 C = y.getCellColIndex; 24155 F = y.insertRow; 24156 G = y.insertColumn; 24157 CKEDITOR.document.appendStyleSheet(this.path + "styles/tableselection.css") 24158 }, 24159 init: function(a) { 24160 CKEDITOR.plugins.tableselection.isSupportedEnvironment && (a.addContentsCss && a.addContentsCss(this.path + "styles/tableselection.css"), 24161 a.on("contentDom", function() { 24162 var b = a.editable(), 24163 c = b.isInline() ? b : a.document, 24164 d = { 24165 editor: a 24166 }; 24167 b.attachListener(c, "mousedown", w, null, d); 24168 b.attachListener(c, "mousemove", w, null, d); 24169 b.attachListener(c, "mouseup", w, null, d); 24170 b.attachListener(b, "dragstart", N); 24171 b.attachListener(a, "selectionCheck", M); 24172 CKEDITOR.plugins.tableselection.keyboardIntegration(a); 24173 CKEDITOR.plugins.clipboard && !CKEDITOR.plugins.clipboard.isCustomCopyCutSupported && (b.attachListener(b, "cut", E), b.attachListener(b, "copy", E)) 24174 }), a.on("paste", H.onPaste, 24175 H), B(a, "rowInsertBefore rowInsertAfter columnInsertBefore columnInsertAfter cellInsertBefore cellInsertAfter".split(" "), function(a, c) { 24176 t(a, c.selectedCells) 24177 }), B(a, ["cellMerge", "cellMergeRight", "cellMergeDown"], function(a, c) { 24178 t(a, [c.commandData.cell]) 24179 }), B(a, ["cellDelete"], function(a) { 24180 A(a, !0) 24181 })) 24182 } 24183 }) 24184 })(); 24185 (function() { 24186 var g = [CKEDITOR.CTRL + 90, CKEDITOR.CTRL + 89, CKEDITOR.CTRL + CKEDITOR.SHIFT + 90], 24187 n = { 24188 8: 1, 24189 46: 1 24190 }; 24191 CKEDITOR.plugins.add("undo", { 24192 init: function(a) { 24193 function b(a) { 24194 d.enabled && !1 !== a.data.command.canUndo && d.save() 24195 } 24196 24197 function c() { 24198 d.enabled = a.readOnly ? !1 : "wysiwyg" == a.mode; 24199 d.onChange() 24200 } 24201 var d = a.undoManager = new e(a), 24202 l = d.editingHandler = new k(d), 24203 f = a.addCommand("undo", { 24204 exec: function() { 24205 d.undo() && (a.selectionChange(), this.fire("afterUndo")) 24206 }, 24207 startDisabled: !0, 24208 canUndo: !1 24209 }), 24210 h = a.addCommand("redo", { 24211 exec: function() { 24212 d.redo() && 24213 (a.selectionChange(), this.fire("afterRedo")) 24214 }, 24215 startDisabled: !0, 24216 canUndo: !1 24217 }); 24218 a.setKeystroke([ 24219 [g[0], "undo"], 24220 [g[1], "redo"], 24221 [g[2], "redo"] 24222 ]); 24223 d.onChange = function() { 24224 f.setState(d.undoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED); 24225 h.setState(d.redoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED) 24226 }; 24227 a.on("beforeCommandExec", b); 24228 a.on("afterCommandExec", b); 24229 a.on("saveSnapshot", function(a) { 24230 d.save(a.data && a.data.contentOnly) 24231 }); 24232 a.on("contentDom", l.attachListeners, l); 24233 a.on("instanceReady", function() { 24234 a.fire("saveSnapshot") 24235 }); 24236 a.on("beforeModeUnload", function() { 24237 "wysiwyg" == a.mode && d.save(!0) 24238 }); 24239 a.on("mode", c); 24240 a.on("readOnly", c); 24241 a.ui.addButton && (a.ui.addButton("Undo", { 24242 label: a.lang.undo.undo, 24243 command: "undo", 24244 toolbar: "undo,10" 24245 }), a.ui.addButton("Redo", { 24246 label: a.lang.undo.redo, 24247 command: "redo", 24248 toolbar: "undo,20" 24249 })); 24250 a.resetUndo = function() { 24251 d.reset(); 24252 a.fire("saveSnapshot") 24253 }; 24254 a.on("updateSnapshot", function() { 24255 d.currentImage && d.update() 24256 }); 24257 a.on("lockSnapshot", function(a) { 24258 a = a.data; 24259 d.lock(a && a.dontUpdate, a && a.forceUpdate) 24260 }); 24261 a.on("unlockSnapshot", 24262 d.unlock, d) 24263 } 24264 }); 24265 CKEDITOR.plugins.undo = {}; 24266 var e = CKEDITOR.plugins.undo.UndoManager = function(a) { 24267 this.strokesRecorded = [0, 0]; 24268 this.locked = null; 24269 this.previousKeyGroup = -1; 24270 this.limit = a.config.undoStackSize || 20; 24271 this.strokesLimit = 25; 24272 this.editor = a; 24273 this.reset() 24274 }; 24275 e.prototype = { 24276 type: function(a, b) { 24277 var c = e.getKeyGroup(a), 24278 d = this.strokesRecorded[c] + 1; 24279 b = b || d >= this.strokesLimit; 24280 this.typing || (this.hasUndo = this.typing = !0, this.hasRedo = !1, this.onChange()); 24281 b ? (d = 0, this.editor.fire("saveSnapshot")) : this.editor.fire("change"); 24282 this.strokesRecorded[c] = 24283 d; 24284 this.previousKeyGroup = c 24285 }, 24286 keyGroupChanged: function(a) { 24287 return e.getKeyGroup(a) != this.previousKeyGroup 24288 }, 24289 reset: function() { 24290 this.snapshots = []; 24291 this.index = -1; 24292 this.currentImage = null; 24293 this.hasRedo = this.hasUndo = !1; 24294 this.locked = null; 24295 this.resetType() 24296 }, 24297 resetType: function() { 24298 this.strokesRecorded = [0, 0]; 24299 this.typing = !1; 24300 this.previousKeyGroup = -1 24301 }, 24302 refreshState: function() { 24303 this.hasUndo = !!this.getNextImage(!0); 24304 this.hasRedo = !!this.getNextImage(!1); 24305 this.resetType(); 24306 this.onChange() 24307 }, 24308 save: function(a, b, c) { 24309 var d = this.editor; 24310 if (this.locked || 24311 "ready" != d.status || "wysiwyg" != d.mode) return !1; 24312 var e = d.editable(); 24313 if (!e || "ready" != e.status) return !1; 24314 e = this.snapshots; 24315 b || (b = new f(d)); 24316 if (!1 === b.contents) return !1; 24317 if (this.currentImage) 24318 if (b.equalsContent(this.currentImage)) { 24319 if (a || b.equalsSelection(this.currentImage)) return !1 24320 } else !1 !== c && d.fire("change"); 24321 e.splice(this.index + 1, e.length - this.index - 1); 24322 e.length == this.limit && e.shift(); 24323 this.index = e.push(b) - 1; 24324 this.currentImage = b; 24325 !1 !== c && this.refreshState(); 24326 return !0 24327 }, 24328 restoreImage: function(a) { 24329 var b = this.editor, 24330 c; 24331 a.bookmarks && (b.focus(), c = b.getSelection()); 24332 this.locked = { 24333 level: 999 24334 }; 24335 this.editor.loadSnapshot(a.contents); 24336 a.bookmarks ? c.selectBookmarks(a.bookmarks) : CKEDITOR.env.ie && (c = this.editor.document.getBody().$.createTextRange(), c.collapse(!0), c.select()); 24337 this.locked = null; 24338 this.index = a.index; 24339 this.currentImage = this.snapshots[this.index]; 24340 this.update(); 24341 this.refreshState(); 24342 b.fire("change") 24343 }, 24344 getNextImage: function(a) { 24345 var b = this.snapshots, 24346 c = this.currentImage, 24347 d; 24348 if (c) 24349 if (a) 24350 for (d = this.index - 1; 0 <= d; d--) { 24351 if (a = b[d], !c.equalsContent(a)) return a.index = 24352 d, a 24353 } else 24354 for (d = this.index + 1; d < b.length; d++) 24355 if (a = b[d], !c.equalsContent(a)) return a.index = d, a; 24356 return null 24357 }, 24358 redoable: function() { 24359 return this.enabled && this.hasRedo 24360 }, 24361 undoable: function() { 24362 return this.enabled && this.hasUndo 24363 }, 24364 undo: function() { 24365 if (this.undoable()) { 24366 this.save(!0); 24367 var a = this.getNextImage(!0); 24368 if (a) return this.restoreImage(a), !0 24369 } 24370 return !1 24371 }, 24372 redo: function() { 24373 if (this.redoable() && (this.save(!0), this.redoable())) { 24374 var a = this.getNextImage(!1); 24375 if (a) return this.restoreImage(a), !0 24376 } 24377 return !1 24378 }, 24379 update: function(a) { 24380 if (!this.locked) { 24381 a || 24382 (a = new f(this.editor)); 24383 for (var b = this.index, c = this.snapshots; 0 < b && this.currentImage.equalsContent(c[b - 1]);) --b; 24384 c.splice(b, this.index - b + 1, a); 24385 this.index = b; 24386 this.currentImage = a 24387 } 24388 }, 24389 updateSelection: function(a) { 24390 if (!this.snapshots.length) return !1; 24391 var b = this.snapshots, 24392 c = b[b.length - 1]; 24393 return c.equalsContent(a) && !c.equalsSelection(a) ? (this.currentImage = b[b.length - 1] = a, !0) : !1 24394 }, 24395 lock: function(a, b) { 24396 if (this.locked) this.locked.level++; 24397 else if (a) this.locked = { 24398 level: 1 24399 }; 24400 else { 24401 var c = null; 24402 if (b) c = !0; 24403 else { 24404 var d = new f(this.editor, 24405 !0); 24406 this.currentImage && this.currentImage.equalsContent(d) && (c = d) 24407 } 24408 this.locked = { 24409 update: c, 24410 level: 1 24411 } 24412 } 24413 }, 24414 unlock: function() { 24415 if (this.locked && !--this.locked.level) { 24416 var a = this.locked.update; 24417 this.locked = null; 24418 if (!0 === a) this.update(); 24419 else if (a) { 24420 var b = new f(this.editor, !0); 24421 a.equalsContent(b) || this.update() 24422 } 24423 } 24424 } 24425 }; 24426 e.navigationKeyCodes = { 24427 37: 1, 24428 38: 1, 24429 39: 1, 24430 40: 1, 24431 36: 1, 24432 35: 1, 24433 33: 1, 24434 34: 1 24435 }; 24436 e.keyGroups = { 24437 PRINTABLE: 0, 24438 FUNCTIONAL: 1 24439 }; 24440 e.isNavigationKey = function(a) { 24441 return !!e.navigationKeyCodes[a] 24442 }; 24443 e.getKeyGroup = function(a) { 24444 var b = e.keyGroups; 24445 return n[a] ? b.FUNCTIONAL : b.PRINTABLE 24446 }; 24447 e.getOppositeKeyGroup = function(a) { 24448 var b = e.keyGroups; 24449 return a == b.FUNCTIONAL ? b.PRINTABLE : b.FUNCTIONAL 24450 }; 24451 e.ieFunctionalKeysBug = function(a) { 24452 return CKEDITOR.env.ie && e.getKeyGroup(a) == e.keyGroups.FUNCTIONAL 24453 }; 24454 var f = CKEDITOR.plugins.undo.Image = function(a, b) { 24455 this.editor = a; 24456 a.fire("beforeUndoImage"); 24457 var c = a.getSnapshot(); 24458 CKEDITOR.env.ie && c && (c = c.replace(/\s+data-cke-expando=".*?"/g, "")); 24459 this.contents = c; 24460 b || (this.bookmarks = (c = c && a.getSelection()) && c.createBookmarks2(!0)); 24461 a.fire("afterUndoImage") 24462 }, 24463 h = /\b(?:href|src|name)="[^"]*?"/gi; 24464 f.prototype = { 24465 equalsContent: function(a) { 24466 var b = this.contents; 24467 a = a.contents; 24468 CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) && (b = b.replace(h, ""), a = a.replace(h, "")); 24469 return b != a ? !1 : !0 24470 }, 24471 equalsSelection: function(a) { 24472 var b = this.bookmarks; 24473 a = a.bookmarks; 24474 if (b || a) { 24475 if (!b || !a || b.length != a.length) return !1; 24476 for (var c = 0; c < b.length; c++) { 24477 var d = b[c], 24478 e = a[c]; 24479 if (d.startOffset != e.startOffset || d.endOffset != e.endOffset || !CKEDITOR.tools.arrayCompare(d.start, e.start) || !CKEDITOR.tools.arrayCompare(d.end, 24480 e.end)) return !1 24481 } 24482 } 24483 return !0 24484 } 24485 }; 24486 var k = CKEDITOR.plugins.undo.NativeEditingHandler = function(a) { 24487 this.undoManager = a; 24488 this.ignoreInputEvent = !1; 24489 this.keyEventsStack = new m; 24490 this.lastKeydownImage = null 24491 }; 24492 k.prototype = { 24493 onKeydown: function(a) { 24494 var b = a.data.getKey(); 24495 if (229 !== b) 24496 if (-1 < CKEDITOR.tools.indexOf(g, a.data.getKeystroke())) a.data.preventDefault(); 24497 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) || 24498 this.undoManager.keyGroupChanged(b)) 24499 if (a.strokesRecorded[0] || a.strokesRecorded[1]) a.save(!1, this.lastKeydownImage, !1), a.resetType() 24500 }, 24501 onInput: function() { 24502 if (this.ignoreInputEvent) this.ignoreInputEvent = !1; 24503 else { 24504 var a = this.keyEventsStack.getLast(); 24505 a || (a = this.keyEventsStack.push(0)); 24506 this.keyEventsStack.increment(a.keyCode); 24507 this.keyEventsStack.getTotalInputs() >= this.undoManager.strokesLimit && (this.undoManager.type(a.keyCode, !0), this.keyEventsStack.resetInputs()) 24508 } 24509 }, 24510 onKeyup: function(a) { 24511 var b = this.undoManager; 24512 a = a.data.getKey(); 24513 var c = this.keyEventsStack.getTotalInputs(); 24514 this.keyEventsStack.remove(a); 24515 if (!(e.ieFunctionalKeysBug(a) && this.lastKeydownImage && this.lastKeydownImage.equalsContent(new f(b.editor, !0)))) 24516 if (0 < c) b.type(a); 24517 else if (e.isNavigationKey(a)) this.onNavigationKey(!0) 24518 }, 24519 onNavigationKey: function(a) { 24520 var b = this.undoManager; 24521 !a && b.save(!0, null, !1) || b.updateSelection(new f(b.editor)); 24522 b.resetType() 24523 }, 24524 ignoreInputEventListener: function() { 24525 this.ignoreInputEvent = !0 24526 }, 24527 activateInputEventListener: function() { 24528 this.ignoreInputEvent = !1 24529 }, 24530 attachListeners: function() { 24531 var a = this.undoManager.editor, 24532 b = a.editable(), 24533 c = this; 24534 b.attachListener(b, "keydown", function(a) { 24535 c.onKeydown(a); 24536 if (e.ieFunctionalKeysBug(a.data.getKey())) c.onInput() 24537 }, null, null, 999); 24538 b.attachListener(b, CKEDITOR.env.ie ? "keypress" : "input", c.onInput, c, null, 999); 24539 b.attachListener(b, "keyup", c.onKeyup, c, null, 999); 24540 b.attachListener(b, "paste", c.ignoreInputEventListener, c, null, 999); 24541 b.attachListener(b, "drop", c.ignoreInputEventListener, c, null, 999); 24542 a.on("afterPaste", c.activateInputEventListener, 24543 c, null, 999); 24544 b.attachListener(b.isInline() ? b : a.document.getDocumentElement(), "click", function() { 24545 c.onNavigationKey() 24546 }, null, null, 999); 24547 b.attachListener(this.undoManager.editor, "blur", function() { 24548 c.keyEventsStack.remove(9) 24549 }, null, null, 999) 24550 } 24551 }; 24552 var m = CKEDITOR.plugins.undo.KeyEventsStack = function() { 24553 this.stack = [] 24554 }; 24555 m.prototype = { 24556 push: function(a) { 24557 a = this.stack.push({ 24558 keyCode: a, 24559 inputs: 0 24560 }); 24561 return this.stack[a - 1] 24562 }, 24563 getLastIndex: function(a) { 24564 if ("number" != typeof a) return this.stack.length - 1; 24565 for (var b = this.stack.length; b--;) 24566 if (this.stack[b].keyCode == 24567 a) return b; 24568 return -1 24569 }, 24570 getLast: function(a) { 24571 a = this.getLastIndex(a); 24572 return -1 != a ? this.stack[a] : null 24573 }, 24574 increment: function(a) { 24575 this.getLast(a).inputs++ 24576 }, 24577 remove: function(a) { 24578 a = this.getLastIndex(a); - 1 != a && this.stack.splice(a, 1) 24579 }, 24580 resetInputs: function(a) { 24581 if ("number" == typeof a) this.getLast(a).inputs = 0; 24582 else 24583 for (a = this.stack.length; a--;) this.stack[a].inputs = 0 24584 }, 24585 getTotalInputs: function() { 24586 for (var a = this.stack.length, b = 0; a--;) b += this.stack[a].inputs; 24587 return b 24588 }, 24589 cleanUp: function(a) { 24590 a = a.data.$; 24591 a.ctrlKey || a.metaKey || this.remove(17); 24592 a.shiftKey || this.remove(16); 24593 a.altKey || this.remove(18) 24594 } 24595 } 24596 })(); 24597 (function() { 24598 function m(a, d) { 24599 CKEDITOR.tools.extend(this, { 24600 editor: a, 24601 editable: a.editable(), 24602 doc: a.document, 24603 win: a.window 24604 }, d, !0); 24605 this.inline = this.editable.isInline(); 24606 this.inline || (this.frame = this.win.getFrame()); 24607 this.target = this[this.inline ? "editable" : "doc"] 24608 } 24609 24610 function n(a, d) { 24611 CKEDITOR.tools.extend(this, d, { 24612 editor: a 24613 }, !0) 24614 } 24615 24616 function p(a, d) { 24617 var b = a.editable(); 24618 CKEDITOR.tools.extend(this, { 24619 editor: a, 24620 editable: b, 24621 inline: b.isInline(), 24622 doc: a.document, 24623 win: a.window, 24624 container: CKEDITOR.document.getBody(), 24625 winTop: CKEDITOR.document.getWindow() 24626 }, 24627 d, !0); 24628 this.hidden = {}; 24629 this.visible = {}; 24630 this.inline || (this.frame = this.win.getFrame()); 24631 this.queryViewport(); 24632 var c = CKEDITOR.tools.bind(this.queryViewport, this), 24633 e = CKEDITOR.tools.bind(this.hideVisible, this), 24634 g = CKEDITOR.tools.bind(this.removeAll, this); 24635 b.attachListener(this.winTop, "resize", c); 24636 b.attachListener(this.winTop, "scroll", c); 24637 b.attachListener(this.winTop, "resize", e); 24638 b.attachListener(this.win, "scroll", e); 24639 b.attachListener(this.inline ? b : this.frame, "mouseout", function(a) { 24640 var b = a.data.$.clientX; 24641 a = a.data.$.clientY; 24642 this.queryViewport(); 24643 (b <= this.rect.left || b >= this.rect.right || a <= this.rect.top || a >= this.rect.bottom) && this.hideVisible(); 24644 (0 >= b || b >= this.winTopPane.width || 0 >= a || a >= this.winTopPane.height) && this.hideVisible() 24645 }, this); 24646 b.attachListener(a, "resize", c); 24647 b.attachListener(a, "mode", g); 24648 a.on("destroy", g); 24649 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({ 24650 lineStyle: CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({}, 24651 t, this.lineStyle, !0)), 24652 tipLeftStyle: CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({}, q, { 24653 left: "0px", 24654 "border-left-color": "red", 24655 "border-width": "6px 0 6px 6px" 24656 }, this.tipCss, this.tipLeftStyle, !0)), 24657 tipRightStyle: CKEDITOR.tools.writeCssText(CKEDITOR.tools.extend({}, q, { 24658 right: "0px", 24659 "border-right-color": "red", 24660 "border-width": "6px 6px 6px 0" 24661 }, this.tipCss, this.tipRightStyle, !0)) 24662 }) 24663 } 24664 24665 function l(a) { 24666 var d; 24667 if (d = a && a.type == CKEDITOR.NODE_ELEMENT) d = !(r[a.getComputedStyle("float")] || r[a.getAttribute("align")]); 24668 return d && 24669 !u[a.getComputedStyle("position")] 24670 } 24671 CKEDITOR.plugins.add("lineutils"); 24672 CKEDITOR.LINEUTILS_BEFORE = 1; 24673 CKEDITOR.LINEUTILS_AFTER = 2; 24674 CKEDITOR.LINEUTILS_INSIDE = 4; 24675 m.prototype = { 24676 start: function(a) { 24677 var d = this, 24678 b = this.editor, 24679 c = this.doc, 24680 e, g, f, h, k = CKEDITOR.tools.eventsBuffer(50, function() { 24681 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))) 24682 }); 24683 this.listener = this.editable.attachListener(this.target, 24684 "mousemove", 24685 function(a) { 24686 f = a.data.$.clientX; 24687 h = a.data.$.clientY; 24688 k.input() 24689 }); 24690 this.editable.attachListener(this.inline ? this.editable : this.frame, "mouseout", function() { 24691 k.reset() 24692 }) 24693 }, 24694 stop: function() { 24695 this.listener && this.listener.removeListener() 24696 }, 24697 getRange: function() { 24698 var a = {}; 24699 a[CKEDITOR.LINEUTILS_BEFORE] = CKEDITOR.POSITION_BEFORE_START; 24700 a[CKEDITOR.LINEUTILS_AFTER] = CKEDITOR.POSITION_AFTER_END; 24701 a[CKEDITOR.LINEUTILS_INSIDE] = CKEDITOR.POSITION_AFTER_START; 24702 return function(d) { 24703 var b = this.editor.createRange(); 24704 b.moveToPosition(this.relations[d.uid].element, 24705 a[d.type]); 24706 return b 24707 } 24708 }(), 24709 store: function() { 24710 function a(a, b, c) { 24711 var e = a.getUniqueId(); 24712 e in c ? c[e].type |= b : c[e] = { 24713 element: a, 24714 type: b 24715 } 24716 } 24717 return function(d, b) { 24718 var c; 24719 b & CKEDITOR.LINEUTILS_AFTER && l(c = d.getNext()) && c.isVisible() && (a(c, CKEDITOR.LINEUTILS_BEFORE, this.relations), b ^= CKEDITOR.LINEUTILS_AFTER); 24720 b & CKEDITOR.LINEUTILS_INSIDE && l(c = d.getFirst()) && c.isVisible() && (a(c, CKEDITOR.LINEUTILS_BEFORE, this.relations), b ^= CKEDITOR.LINEUTILS_INSIDE); 24721 a(d, b, this.relations) 24722 } 24723 }(), 24724 traverseSearch: function(a) { 24725 var d, b, c; 24726 do 24727 if (c = a.$["data-cke-expando"], 24728 !(c && c in this.relations)) { 24729 if (a.equals(this.editable)) break; 24730 if (l(a)) 24731 for (d in this.lookups)(b = this.lookups[d](a)) && this.store(a, b) 24732 } while ((!a || a.type != CKEDITOR.NODE_ELEMENT || "true" != a.getAttribute("contenteditable")) && (a = a.getParent())) 24733 }, 24734 pixelSearch: function() { 24735 function a(a, c, e, g, f) { 24736 for (var h = 0, k; f(e);) { 24737 e += g; 24738 if (25 == ++h) break; 24739 if (k = this.doc.$.elementFromPoint(c, e)) 24740 if (k == a) h = 0; 24741 else if (d(a, k) && (h = 0, l(k = new CKEDITOR.dom.element(k)))) return k 24742 } 24743 } 24744 var d = CKEDITOR.env.ie || CKEDITOR.env.webkit ? function(a, c) { 24745 return a.contains(c) 24746 } : 24747 function(a, c) { 24748 return !!(a.compareDocumentPosition(c) & 16) 24749 }; 24750 return function(b, c, d) { 24751 var g = this.win.getViewPaneSize().height, 24752 f = a.call(this, b.$, c, d, -1, function(a) { 24753 return 0 < a 24754 }); 24755 c = a.call(this, b.$, c, d, 1, function(a) { 24756 return a < g 24757 }); 24758 if (f) 24759 for (this.traverseSearch(f); !f.getParent().equals(b);) f = f.getParent(); 24760 if (c) 24761 for (this.traverseSearch(c); !c.getParent().equals(b);) c = c.getParent(); 24762 for (; f || c;) { 24763 f && (f = f.getNext(l)); 24764 if (!f || f.equals(c)) break; 24765 this.traverseSearch(f); 24766 c && (c = c.getPrevious(l)); 24767 if (!c || c.equals(f)) break; 24768 this.traverseSearch(c) 24769 } 24770 } 24771 }(), 24772 greedySearch: function() { 24773 this.relations = {}; 24774 for (var a = this.editable.getElementsByTag("*"), d = 0, b, c, e; b = a.getItem(d++);) 24775 if (!b.equals(this.editable) && b.type == CKEDITOR.NODE_ELEMENT && (b.hasAttribute("contenteditable") || !b.isReadOnly()) && l(b) && b.isVisible()) 24776 for (e in this.lookups)(c = this.lookups[e](b)) && this.store(b, c); 24777 return this.relations 24778 } 24779 }; 24780 n.prototype = { 24781 locate: function() { 24782 function a(a, b) { 24783 var c = a.element[b === CKEDITOR.LINEUTILS_BEFORE ? "getPrevious" : "getNext"](); 24784 return c && l(c) ? (a.siblingRect = c.getClientRect(), 24785 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 24786 } 24787 return function(d) { 24788 var b; 24789 this.locations = {}; 24790 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 & 24791 CKEDITOR.LINEUTILS_INSIDE && this.store(c, CKEDITOR.LINEUTILS_INSIDE, (b.elementRect.top + b.elementRect.bottom) / 2); 24792 return this.locations 24793 } 24794 }(), 24795 sort: function() { 24796 var a, d, b, c; 24797 return function(e, g) { 24798 a = this.locations; 24799 d = []; 24800 for (var f in a) 24801 for (var h in a[f]) 24802 if (b = Math.abs(e - a[f][h]), d.length) { 24803 for (c = 0; c < d.length; c++) 24804 if (b < d[c].dist) { 24805 d.splice(c, 0, { 24806 uid: +f, 24807 type: h, 24808 dist: b 24809 }); 24810 break 24811 } c == d.length && d.push({ 24812 uid: +f, 24813 type: h, 24814 dist: b 24815 }) 24816 } else d.push({ 24817 uid: +f, 24818 type: h, 24819 dist: b 24820 }); 24821 return "undefined" != typeof g ? d.slice(0, g) : d 24822 } 24823 }(), 24824 store: function(a, 24825 d, b) { 24826 this.locations[a] || (this.locations[a] = {}); 24827 this.locations[a][d] = b 24828 } 24829 }; 24830 var q = { 24831 display: "block", 24832 width: "0px", 24833 height: "0px", 24834 "border-color": "transparent", 24835 "border-style": "solid", 24836 position: "absolute", 24837 top: "-6px" 24838 }, 24839 t = { 24840 height: "0px", 24841 "border-top": "1px dashed red", 24842 position: "absolute", 24843 "z-index": 9999 24844 }; 24845 p.prototype = { 24846 removeAll: function() { 24847 for (var a in this.hidden) this.hidden[a].remove(), delete this.hidden[a]; 24848 for (a in this.visible) this.visible[a].remove(), delete this.visible[a] 24849 }, 24850 hideLine: function(a) { 24851 var d = a.getUniqueId(); 24852 a.hide(); 24853 this.hidden[d] = a; 24854 delete this.visible[d] 24855 }, 24856 showLine: function(a) { 24857 var d = a.getUniqueId(); 24858 a.show(); 24859 this.visible[d] = a; 24860 delete this.hidden[d] 24861 }, 24862 hideVisible: function() { 24863 for (var a in this.visible) this.hideLine(this.visible[a]) 24864 }, 24865 placeLine: function(a, d) { 24866 var b, c, e; 24867 if (b = this.getStyle(a.uid, a.type)) { 24868 for (e in this.visible) 24869 if (this.visible[e].getCustomData("hash") !== this.hash) { 24870 c = this.visible[e]; 24871 break 24872 } if (!c) 24873 for (e in this.hidden) 24874 if (this.hidden[e].getCustomData("hash") !== this.hash) { 24875 this.showLine(c = this.hidden[e]); 24876 break 24877 } c || this.showLine(c = this.addLine()); 24878 c.setCustomData("hash", this.hash); 24879 this.visible[c.getUniqueId()] = c; 24880 c.setStyles(b); 24881 d && d(c) 24882 } 24883 }, 24884 getStyle: function(a, d) { 24885 var b = this.relations[a], 24886 c = this.locations[a][d], 24887 e = {}; 24888 e.width = b.siblingRect ? Math.max(b.siblingRect.width, b.elementRect.width) : b.elementRect.width; 24889 e.top = this.inline ? c + this.winTopScroll.y - this.rect.relativeY : this.rect.top + this.winTopScroll.y + c; 24890 if (e.top - this.winTopScroll.y < this.rect.top || e.top - this.winTopScroll.y > this.rect.bottom) return !1; 24891 this.inline ? 24892 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)); 24893 e.left += this.winTopScroll.x; 24894 for (var g in e) e[g] = CKEDITOR.tools.cssLength(e[g]); 24895 return e 24896 }, 24897 addLine: function() { 24898 var a = CKEDITOR.dom.element.createFromHtml(this.lineTpl); 24899 a.appendTo(this.container); 24900 return a 24901 }, 24902 prepare: function(a, d) { 24903 this.relations = a; 24904 this.locations = d; 24905 this.hash = Math.random() 24906 }, 24907 cleanup: function() { 24908 var a, d; 24909 for (d in this.visible) a = this.visible[d], a.getCustomData("hash") !== this.hash && this.hideLine(a) 24910 }, 24911 queryViewport: function() { 24912 this.winPane = this.win.getViewPaneSize(); 24913 this.winTopScroll = this.winTop.getScrollPosition(); 24914 this.winTopPane = this.winTop.getViewPaneSize(); 24915 this.rect = this.getClientRect(this.inline ? this.editable : this.frame) 24916 }, 24917 getClientRect: function(a) { 24918 a = a.getClientRect(); 24919 var d = this.container.getDocumentPosition(), 24920 b = this.container.getComputedStyle("position"); 24921 a.relativeX = a.relativeY = 24922 0; 24923 "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); 24924 return a 24925 } 24926 }; 24927 var r = { 24928 left: 1, 24929 right: 1, 24930 center: 1 24931 }, 24932 u = { 24933 absolute: 1, 24934 fixed: 1 24935 }; 24936 CKEDITOR.plugins.lineutils = { 24937 finder: m, 24938 locator: n, 24939 liner: p 24940 } 24941 })(); 24942 (function() { 24943 function e(a) { 24944 return a.getName && !a.hasAttribute("data-cke-temp") 24945 } 24946 CKEDITOR.plugins.add("widgetselection", { 24947 init: function(a) { 24948 if (CKEDITOR.env.webkit) { 24949 var b = CKEDITOR.plugins.widgetselection; 24950 a.on("contentDom", function(a) { 24951 a = a.editor; 24952 var c = a.editable(); 24953 c.attachListener(c, "keydown", function(a) { 24954 a.data.getKeystroke() == CKEDITOR.CTRL + 65 && CKEDITOR.tools.setTimeout(function() { 24955 b.addFillers(c) || b.removeFillers(c) 24956 }, 0) 24957 }, null, null, -1); 24958 a.on("selectionCheck", function(a) { 24959 b.removeFillers(a.editor.editable()) 24960 }); 24961 a.on("paste", function(a) { 24962 a.data.dataValue = b.cleanPasteData(a.data.dataValue) 24963 }); 24964 "selectall" in a.plugins && b.addSelectAllIntegration(a) 24965 }) 24966 } 24967 } 24968 }); 24969 CKEDITOR.plugins.widgetselection = { 24970 startFiller: null, 24971 endFiller: null, 24972 fillerAttribute: "data-cke-filler-webkit", 24973 fillerContent: "\x26nbsp;", 24974 fillerTagName: "div", 24975 addFillers: function(a) { 24976 var b = a.editor; 24977 if (!this.isWholeContentSelected(a) && 0 < a.getChildCount()) { 24978 var d = a.getFirst(e), 24979 c = a.getLast(e); 24980 d && d.type == CKEDITOR.NODE_ELEMENT && !d.isEditable() && (this.startFiller = this.createFiller(), 24981 a.append(this.startFiller, 1)); 24982 c && c.type == CKEDITOR.NODE_ELEMENT && !c.isEditable() && (this.endFiller = this.createFiller(!0), a.append(this.endFiller, 0)); 24983 if (this.hasFiller(a)) return b = b.createRange(), b.selectNodeContents(a), b.select(), !0 24984 } 24985 return !1 24986 }, 24987 removeFillers: function(a) { 24988 if (this.hasFiller(a) && !this.isWholeContentSelected(a)) { 24989 var b = a.findOne(this.fillerTagName + "[" + this.fillerAttribute + "\x3dstart]"), 24990 d = a.findOne(this.fillerTagName + "[" + this.fillerAttribute + "\x3dend]"); 24991 this.startFiller && b && this.startFiller.equals(b) ? 24992 this.removeFiller(this.startFiller, a) : this.startFiller = b; 24993 this.endFiller && d && this.endFiller.equals(d) ? this.removeFiller(this.endFiller, a) : this.endFiller = d 24994 } 24995 }, 24996 cleanPasteData: function(a) { 24997 a && a.length && (a = a.replace(this.createFillerRegex(), "").replace(this.createFillerRegex(!0), "")); 24998 return a 24999 }, 25000 isWholeContentSelected: function(a) { 25001 var b = a.editor.getSelection().getRanges()[0]; 25002 return !b || b && b.collapsed ? !1 : (b = b.clone(), b.enlarge(CKEDITOR.ENLARGE_ELEMENT), !!(b && a && b.startContainer && b.endContainer && 0 === b.startOffset && 25003 b.endOffset === a.getChildCount() && b.startContainer.equals(a) && b.endContainer.equals(a))) 25004 }, 25005 hasFiller: function(a) { 25006 return 0 < a.find(this.fillerTagName + "[" + this.fillerAttribute + "]").count() 25007 }, 25008 createFiller: function(a) { 25009 var b = new CKEDITOR.dom.element(this.fillerTagName); 25010 b.setHtml(this.fillerContent); 25011 b.setAttribute(this.fillerAttribute, a ? "end" : "start"); 25012 b.setAttribute("data-cke-temp", 1); 25013 b.setStyles({ 25014 display: "block", 25015 width: 0, 25016 height: 0, 25017 padding: 0, 25018 border: 0, 25019 margin: 0, 25020 position: "absolute", 25021 top: 0, 25022 left: "-9999px", 25023 opacity: 0, 25024 overflow: "hidden" 25025 }); 25026 return b 25027 }, 25028 removeFiller: function(a, b) { 25029 if (a) { 25030 var d = b.editor, 25031 c = b.editor.getSelection().getRanges()[0].startPath(), 25032 f = d.createRange(), 25033 g, e; 25034 c.contains(a) && (g = a.getHtml(), e = !0); 25035 c = "start" == a.getAttribute(this.fillerAttribute); 25036 a.remove(); 25037 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) : 25038 f.setEndAt(b.getLast().getPrevious(), CKEDITOR.POSITION_BEFORE_END), b.editor.getSelection().selectRanges([f])) 25039 } 25040 }, 25041 createFillerRegex: function(a) { 25042 var b = this.createFiller(a).getOuterHtml().replace(/style="[^"]*"/gi, 'style\x3d"[^"]*"').replace(/>[^<]*</gi, "\x3e[^\x3c]*\x3c"); 25043 return new RegExp((a ? "" : "^") + b + (a ? "$" : "")) 25044 }, 25045 addSelectAllIntegration: function(a) { 25046 var b = this; 25047 a.editable().attachListener(a, "beforeCommandExec", function(d) { 25048 var c = a.editable(); 25049 "selectAll" == d.data.name && c && b.addFillers(c) 25050 }, null, null, 9999) 25051 } 25052 } 25053 })(); 25054 (function() { 25055 function p(a) { 25056 this.editor = a; 25057 this.registered = {}; 25058 this.instances = {}; 25059 this.selected = []; 25060 this.widgetHoldingFocusedEditable = this.focused = null; 25061 this._ = { 25062 nextId: 0, 25063 upcasts: [], 25064 upcastCallbacks: [], 25065 filters: {} 25066 }; 25067 I(this); 25068 J(this); 25069 this.on("checkWidgets", K); 25070 this.editor.on("contentDomInvalidated", this.checkWidgets, this); 25071 L(this); 25072 M(this); 25073 N(this); 25074 O(this); 25075 P(this) 25076 } 25077 25078 function g(a, b, c, d, e) { 25079 var f = a.editor; 25080 CKEDITOR.tools.extend(this, d, { 25081 editor: f, 25082 id: b, 25083 inline: "span" == c.getParent().getName(), 25084 element: c, 25085 data: CKEDITOR.tools.extend({}, 25086 "function" == typeof d.defaults ? d.defaults() : d.defaults), 25087 dataReady: !1, 25088 inited: !1, 25089 ready: !1, 25090 edit: g.prototype.edit, 25091 focusedEditable: null, 25092 definition: d, 25093 repository: a, 25094 draggable: !1 !== d.draggable, 25095 _: { 25096 downcastFn: d.downcast && "string" == typeof d.downcast ? d.downcasts[d.downcast] : d.downcast 25097 } 25098 }, !0); 25099 a.fire("instanceCreated", this); 25100 Q(this, d); 25101 this.init && this.init(); 25102 this.inited = !0; 25103 (a = this.element.data("cke-widget-data")) && this.setData(JSON.parse(decodeURIComponent(a))); 25104 e && this.setData(e); 25105 this.data.classes || this.setData("classes", 25106 this.getClasses()); 25107 this.dataReady = !0; 25108 r(this); 25109 this.fire("data", this.data); 25110 this.isInited() && f.editable().contains(this.wrapper) && (this.ready = !0, this.fire("ready")) 25111 } 25112 25113 function q(a, b, c) { 25114 CKEDITOR.dom.element.call(this, b.$); 25115 this.editor = a; 25116 this._ = {}; 25117 b = this.filter = c.filter; 25118 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 25119 } 25120 25121 function R(a, 25122 b) { 25123 a.addCommand(b.name, { 25124 exec: function(a, d) { 25125 function e() { 25126 a.widgets.finalizeCreation(k) 25127 } 25128 var f = a.widgets.focused; 25129 if (f && f.name == b.name) f.edit(); 25130 else if (b.insert) b.insert(); 25131 else if (b.template) { 25132 var f = "function" == typeof b.defaults ? b.defaults() : b.defaults, 25133 f = CKEDITOR.dom.element.createFromHtml(b.template.output(f)), 25134 h, l = a.widgets.wrapElement(f, b.name), 25135 k = new CKEDITOR.dom.documentFragment(l.getDocument()); 25136 k.append(l); 25137 (h = a.widgets.initOn(f, b, d && d.startupData)) ? (f = h.once("edit", function(b) { 25138 if (b.data.dialog) h.once("dialog", 25139 function(b) { 25140 b = b.data; 25141 var d, f; 25142 d = b.once("ok", e, null, null, 20); 25143 f = b.once("cancel", function(b) { 25144 b.data && !1 === b.data.hide || a.widgets.destroy(h, !0) 25145 }); 25146 b.once("hide", function() { 25147 d.removeListener(); 25148 f.removeListener() 25149 }) 25150 }); 25151 else e() 25152 }, null, null, 999), h.edit(), f.removeListener()) : e() 25153 } 25154 }, 25155 allowedContent: b.allowedContent, 25156 requiredContent: b.requiredContent, 25157 contentForms: b.contentForms, 25158 contentTransformations: b.contentTransformations 25159 }) 25160 } 25161 25162 function S(a, b) { 25163 function c(a, c) { 25164 var d = b.upcast.split(","), 25165 e, f; 25166 for (f = 0; f < d.length; f++) 25167 if (e = 25168 d[f], e === a.name) return b.upcasts[e].call(this, a, c); 25169 return !1 25170 } 25171 25172 function d(b, c, d) { 25173 var e = CKEDITOR.tools.getIndex(a._.upcasts, function(a) { 25174 return a[2] > d 25175 }); 25176 0 > e && (e = a._.upcasts.length); 25177 a._.upcasts.splice(e, 0, [CKEDITOR.tools.bind(b, c), c.name, d]) 25178 } 25179 var e = b.upcast, 25180 f = b.upcastPriority || 10; 25181 e && ("string" == typeof e ? d(c, b, f) : d(e, b, f)) 25182 } 25183 25184 function t(a, b) { 25185 a.focused = null; 25186 if (b.isInited()) { 25187 var c = b.editor.checkDirty(); 25188 a.fire("widgetBlurred", { 25189 widget: b 25190 }); 25191 b.setFocused(!1); 25192 !c && b.editor.resetDirty() 25193 } 25194 } 25195 25196 function K(a) { 25197 a = a.data; 25198 if ("wysiwyg" == 25199 this.editor.mode) { 25200 var b = this.editor.editable(), 25201 c = this.instances, 25202 d, e, f, h; 25203 if (b) { 25204 for (d in c) c[d].isReady() && !b.contains(c[d].wrapper) && this.destroy(c[d], !0); 25205 if (a && a.initOnlyNew) c = this.initOnAll(); 25206 else { 25207 var l = b.find(".cke_widget_wrapper"), 25208 c = []; 25209 d = 0; 25210 for (e = l.count(); d < e; d++) { 25211 f = l.getItem(d); 25212 if (h = !this.getByElement(f, !0)) { 25213 a: { 25214 h = T; 25215 for (var k = f; k = k.getParent();) 25216 if (h(k)) { 25217 h = !0; 25218 break a 25219 } h = !1 25220 } 25221 h = !h 25222 } 25223 h && b.contains(f) && (f.addClass("cke_widget_new"), c.push(this.initOn(f.getFirst(g.isDomWidgetElement)))) 25224 } 25225 } 25226 a && a.focusInited && 25227 1 == c.length && c[0].focus() 25228 } 25229 } 25230 } 25231 25232 function u(a) { 25233 if ("undefined" != typeof a.attributes && a.attributes["data-widget"]) { 25234 var b = v(a), 25235 c = w(a), 25236 d = !1; 25237 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); 25238 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); 25239 d && (a.attributes["data-cke-widget-white-space"] = 1) 25240 } 25241 } 25242 25243 function v(a) { 25244 return a.find(function(a) { 25245 return 3 === 25246 a.type 25247 }, !0).shift() 25248 } 25249 25250 function w(a) { 25251 return a.find(function(a) { 25252 return 3 === a.type 25253 }, !0).pop() 25254 } 25255 25256 function x(a, b, c) { 25257 if (!c.allowedContent && !c.disallowedContent) return null; 25258 var d = this._.filters[a]; 25259 d || (this._.filters[a] = d = {}); 25260 a = d[b]; 25261 a || (a = c.allowedContent ? new CKEDITOR.filter(c.allowedContent) : this.editor.filter.clone(), d[b] = a, c.disallowedContent && a.disallow(c.disallowedContent)); 25262 return a 25263 } 25264 25265 function U(a) { 25266 var b = [], 25267 c = a._.upcasts, 25268 d = a._.upcastCallbacks; 25269 return { 25270 toBeWrapped: b, 25271 iterator: function(a) { 25272 var f, h, l, k, m; 25273 if ("data-cke-widget-wrapper" in 25274 a.attributes) return (a = a.getFirst(g.isParserWidgetElement)) && b.push([a]), !1; 25275 if ("data-widget" in a.attributes) return b.push([a]), !1; 25276 if (m = c.length) { 25277 if (a.attributes["data-cke-widget-upcasted"]) return !1; 25278 k = 0; 25279 for (f = d.length; k < f; ++k) 25280 if (!1 === d[k](a)) return; 25281 for (k = 0; k < m; ++k) 25282 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 25283 } 25284 } 25285 } 25286 } 25287 25288 function y(a, b) { 25289 return { 25290 tabindex: -1, 25291 contenteditable: "false", 25292 "data-cke-widget-wrapper": 1, 25293 "data-cke-filter": "off", 25294 "class": "cke_widget_wrapper cke_widget_new cke_widget_" + (a ? "inline" : "block") + (b ? " cke_widget_" + b : "") 25295 } 25296 } 25297 25298 function z(a, b, c) { 25299 if (a.type == CKEDITOR.NODE_ELEMENT) { 25300 var d = CKEDITOR.dtd[a.name]; 25301 if (d && !d[c.name]) { 25302 var d = a.split(b), 25303 e = a.parent; 25304 b = d.getIndex(); 25305 a.children.length || (--b, a.remove()); 25306 d.children.length || d.remove(); 25307 return z(e, b, c) 25308 } 25309 } 25310 a.add(c, b) 25311 } 25312 25313 function A(a, b) { 25314 return "boolean" == typeof a.inline ? a.inline : !!CKEDITOR.dtd.$inline[b] 25315 } 25316 25317 function T(a) { 25318 return a.hasAttribute("data-cke-temp") 25319 } 25320 25321 function n(a, b, c, d) { 25322 var e = a.editor; 25323 e.fire("lockSnapshot"); 25324 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)); 25325 e.fire("unlockSnapshot") 25326 } 25327 25328 function V(a) { 25329 a.contextMenu && a.contextMenu.addListener(function(b) { 25330 if (b = a.widgets.getByElement(b, !0)) return b.fire("contextMenu", {}) 25331 }) 25332 } 25333 25334 function W(a, b) { 25335 return CKEDITOR.tools.trim(b) 25336 } 25337 25338 function O(a) { 25339 var b = a.editor, 25340 c = CKEDITOR.plugins.lineutils; 25341 b.on("dragstart", function(c) { 25342 var e = c.data.target; 25343 g.isDomDragHandler(e) && (e = a.getByElement(e), c.data.dataTransfer.setData("cke/widget-id", e.id), b.focus(), e.focus()) 25344 }); 25345 b.on("drop", function(c) { 25346 var e = c.data.dataTransfer, 25347 f = e.getData("cke/widget-id"), 25348 h = e.getTransferType(b), 25349 e = b.createRange(); 25350 "" !== 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)) 25351 }); 25352 b.on("contentDom", function() { 25353 var d = b.editable(); 25354 CKEDITOR.tools.extend(a, { 25355 finder: new c.finder(b, { 25356 lookups: { 25357 "default": function(b) { 25358 if (!b.is(CKEDITOR.dtd.$listItem) && b.is(CKEDITOR.dtd.$block) && !g.isDomNestedEditable(b) && !a._.draggedWidget.wrapper.contains(b)) { 25359 var c = g.getNestedEditable(d, b); 25360 if (c) { 25361 b = a._.draggedWidget; 25362 if (a.getByElement(c) == b) return; 25363 c = CKEDITOR.filter.instances[c.data("cke-filter")]; 25364 b = b.requiredContent; 25365 if (c && b && !c.check(b)) return 25366 } 25367 return CKEDITOR.LINEUTILS_BEFORE | CKEDITOR.LINEUTILS_AFTER 25368 } 25369 } 25370 } 25371 }), 25372 locator: new c.locator(b), 25373 liner: new c.liner(b, { 25374 lineStyle: { 25375 cursor: "move !important", 25376 "border-top-color": "#666" 25377 }, 25378 tipLeftStyle: { 25379 "border-left-color": "#666" 25380 }, 25381 tipRightStyle: { 25382 "border-right-color": "#666" 25383 } 25384 }) 25385 }, !0) 25386 }) 25387 } 25388 25389 function M(a) { 25390 var b = a.editor; 25391 b.on("contentDom", function() { 25392 var c = b.editable(), 25393 d = c.isInline() ? c : b.document, 25394 e, f; 25395 c.attachListener(d, "mousedown", function(c) { 25396 var d = c.data.getTarget(); 25397 e = d instanceof CKEDITOR.dom.element ? a.getByElement(d) : null; 25398 f = 0; 25399 e && (e.inline && d.type == CKEDITOR.NODE_ELEMENT && d.hasAttribute("data-cke-widget-drag-handler") ? (f = 1, a.focused != e && b.getSelection().removeAllRanges()) : 25400 g.getNestedEditable(e.wrapper, d) ? e = null : (c.data.preventDefault(), CKEDITOR.env.ie || e.focus())) 25401 }); 25402 c.attachListener(d, "mouseup", function() { 25403 f && e && e.wrapper && (f = 0, e.focus()) 25404 }); 25405 CKEDITOR.env.ie && c.attachListener(d, "mouseup", function() { 25406 setTimeout(function() { 25407 e && e.wrapper && c.contains(e.wrapper) && (e.focus(), e = null) 25408 }) 25409 }) 25410 }); 25411 b.on("doubleclick", function(b) { 25412 var d = a.getByElement(b.data.element); 25413 if (d && !g.getNestedEditable(d.wrapper, b.data.element)) return d.fire("doubleclick", { 25414 element: b.data.element 25415 }) 25416 }, null, null, 1) 25417 } 25418 25419 function N(a) { 25420 a.editor.on("key", function(b) { 25421 var c = a.focused, 25422 d = a.widgetHoldingFocusedEditable, 25423 e; 25424 c ? e = c.fire("key", { 25425 keyCode: b.data.keyCode 25426 }) : 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); 25427 return e 25428 }, null, 25429 null, 1) 25430 } 25431 25432 function P(a) { 25433 function b(b) { 25434 a.focused && B(a.focused, "cut" == b.name) 25435 } 25436 var c = a.editor; 25437 c.on("contentDom", function() { 25438 var a = c.editable(); 25439 a.attachListener(a, "copy", b); 25440 a.attachListener(a, "cut", b) 25441 }) 25442 } 25443 25444 function L(a) { 25445 var b = a.editor; 25446 b.on("selectionCheck", function() { 25447 a.fire("checkSelection") 25448 }); 25449 a.on("checkSelection", a.checkSelection, a); 25450 b.on("selectionChange", function(c) { 25451 var d = (c = g.getNestedEditable(b.editable(), c.data.selection.getStartElement())) && a.getByElement(c), 25452 e = a.widgetHoldingFocusedEditable; 25453 e ? e === d && 25454 e.focusedEditable.equals(c) || (n(a, e, null), d && c && n(a, d, c)) : d && c && n(a, d, c) 25455 }); 25456 b.on("dataReady", function() { 25457 C(a).commit() 25458 }); 25459 b.on("blur", function() { 25460 var b; 25461 (b = a.focused) && t(a, b); 25462 (b = a.widgetHoldingFocusedEditable) && n(a, b, null) 25463 }) 25464 } 25465 25466 function J(a) { 25467 var b = a.editor, 25468 c = {}; 25469 b.on("toDataFormat", function(b) { 25470 var e = CKEDITOR.tools.getNextNumber(), 25471 f = []; 25472 b.data.downcastingSessionId = e; 25473 c[e] = f; 25474 b.data.dataValue.forEach(function(b) { 25475 var c = b.attributes, 25476 d; 25477 if ("data-cke-widget-white-space" in c) { 25478 d = v(b); 25479 var e = w(b); 25480 d.parent.attributes["data-cke-white-space-first"] && 25481 (d.value = d.value.replace(/^ /g, " ")); 25482 e.parent.attributes["data-cke-white-space-last"] && (e.value = e.value.replace(/ $/g, " ")) 25483 } 25484 if ("data-cke-widget-id" in c) { 25485 if (c = a.instances[c["data-cke-widget-id"]]) d = b.getFirst(g.isParserWidgetElement), f.push({ 25486 wrapper: b, 25487 element: d, 25488 widget: c, 25489 editables: {} 25490 }), "1" != d.attributes["data-cke-widget-keep-attr"] && delete d.attributes["data-widget"] 25491 } else if ("data-cke-widget-editable" in c) return f[f.length - 1].editables[c["data-cke-widget-editable"]] = b, !1 25492 }, CKEDITOR.NODE_ELEMENT, 25493 !0) 25494 }, null, null, 8); 25495 b.on("toDataFormat", function(a) { 25496 if (a.data.downcastingSessionId) { 25497 a = c[a.data.downcastingSessionId]; 25498 for (var b, f, h, l, g, m; b = a.shift();) { 25499 f = b.widget; 25500 h = b.element; 25501 l = f._.downcastFn && f._.downcastFn.call(f, h); 25502 for (m in b.editables) g = b.editables[m], delete g.attributes.contenteditable, g.setHtml(f.editables[m].getData()); 25503 l || (l = h); 25504 b.wrapper.replaceWith(l) 25505 } 25506 } 25507 }, null, null, 13); 25508 b.on("contentDomUnload", function() { 25509 a.destroyAll(!0) 25510 }) 25511 } 25512 25513 function I(a) { 25514 var b = a.editor, 25515 c, d; 25516 b.on("toHtml", function(b) { 25517 var d = U(a), 25518 h; 25519 for (b.data.dataValue.forEach(d.iterator, CKEDITOR.NODE_ELEMENT, !0); h = d.toBeWrapped.pop();) { 25520 var l = h[0], 25521 k = l.parent; 25522 k.type == CKEDITOR.NODE_ELEMENT && k.attributes["data-cke-widget-wrapper"] && k.replaceWith(l); 25523 a.wrapElement(h[0], h[1]) 25524 } 25525 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]) 25526 }, null, null, 8); 25527 b.on("dataReady", function() { 25528 if (d) 25529 for (var c = b.editable().find(".cke_widget_wrapper"), 25530 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(); 25531 d = 0; 25532 a.destroyAll(!0); 25533 a.initOnAll() 25534 }); 25535 b.on("loadSnapshot", function(b) { 25536 /data-cke-widget/.test(b.data) && (d = 1); 25537 a.destroyAll(!0) 25538 }, null, null, 9); 25539 b.on("paste", function(a) { 25540 a = a.data; 25541 a.dataValue = a.dataValue.replace(X, W); 25542 a.range && (a = g.getNestedEditable(b.editable(), a.range.startContainer)) && (a = CKEDITOR.filter.instances[a.data("cke-filter")]) && 25543 b.setActiveFilter(a) 25544 }); 25545 b.on("afterInsertHtml", function(d) { 25546 d.data.intoRange ? a.checkWidgets({ 25547 initOnlyNew: !0 25548 }) : (b.fire("lockSnapshot"), a.checkWidgets({ 25549 initOnlyNew: !0, 25550 focusInited: c 25551 }), b.fire("unlockSnapshot")) 25552 }) 25553 } 25554 25555 function C(a) { 25556 var b = a.selected, 25557 c = [], 25558 d = b.slice(0), 25559 e = null; 25560 return { 25561 select: function(a) { 25562 0 > CKEDITOR.tools.indexOf(b, a) && c.push(a); 25563 a = CKEDITOR.tools.indexOf(d, a); 25564 0 <= a && d.splice(a, 1); 25565 return this 25566 }, 25567 focus: function(a) { 25568 e = a; 25569 return this 25570 }, 25571 commit: function() { 25572 var f = a.focused !== e, 25573 h, g; 25574 a.editor.fire("lockSnapshot"); 25575 for (f && 25576 (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()); 25577 f && e && (g = a.editor.checkDirty(), a.focused = e, a.fire("widgetFocused", { 25578 widget: e 25579 }), e.setFocused(!0), !g && a.editor.resetDirty()); 25580 for (; h = c.pop();) b.push(h), h.setSelected(!0); 25581 a.editor.fire("unlockSnapshot") 25582 } 25583 } 25584 } 25585 25586 function D(a, b, c) { 25587 var d = 0; 25588 b = E(b); 25589 var e = a.data.classes || {}, 25590 f; 25591 if (b) { 25592 for (e = CKEDITOR.tools.clone(e); f = b.pop();) c ? e[f] || (d = e[f] = 1) : e[f] && (delete e[f], 25593 d = 1); 25594 d && a.setData("classes", e) 25595 } 25596 } 25597 25598 function F(a) { 25599 a.cancel() 25600 } 25601 25602 function B(a, b) { 25603 var c = a.editor, 25604 d = c.document, 25605 e = CKEDITOR.env.edge && 16 <= CKEDITOR.env.version; 25606 if (!d.getById("cke_copybin")) { 25607 var f = !c.blockless && !CKEDITOR.env.ie || e ? "div" : "span", 25608 e = d.createElement(f), 25609 h = d.createElement(f), 25610 f = CKEDITOR.env.ie && 9 > CKEDITOR.env.version; 25611 h.setAttributes({ 25612 id: "cke_copybin", 25613 "data-cke-temp": "1" 25614 }); 25615 e.setStyles({ 25616 position: "absolute", 25617 width: "1px", 25618 height: "1px", 25619 overflow: "hidden" 25620 }); 25621 e.setStyle("ltr" == c.config.contentsLangDirection ? "left" : 25622 "right", "-5000px"); 25623 var g = c.createRange(); 25624 g.setStartBefore(a.wrapper); 25625 g.setEndAfter(a.wrapper); 25626 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'); 25627 c.fire("saveSnapshot"); 25628 c.fire("lockSnapshot"); 25629 h.append(e); 25630 c.editable().append(h); 25631 var k = c.on("selectionChange", F, null, null, 0), 25632 m = a.repository.on("checkSelection", F, null, null, 0); 25633 if (f) var n = d.getDocumentElement().$, 25634 p = n.scrollTop; 25635 g = c.createRange(); 25636 g.selectNodeContents(e); 25637 g.select(); 25638 f && (n.scrollTop = p); 25639 setTimeout(function() { 25640 b || a.focus(); 25641 h.remove(); 25642 k.removeListener(); 25643 m.removeListener(); 25644 c.fire("unlockSnapshot"); 25645 b && !c.readOnly && (a.repository.del(a), c.fire("saveSnapshot")) 25646 }, 100) 25647 } 25648 } 25649 25650 function E(a) { 25651 return (a = (a = a.getDefinition().attributes) && a["class"]) ? a.split(/\s+/) : null 25652 } 25653 25654 function G() { 25655 var a = CKEDITOR.document.getActive(), 25656 b = this.editor, 25657 c = b.editable(); 25658 (c.isInline() ? c : b.document.getWindow().getFrame()).equals(a) && b.focusManager.focus(c) 25659 } 25660 25661 function H() { 25662 CKEDITOR.env.gecko && 25663 this.editor.unlockSelection(); 25664 CKEDITOR.env.webkit || (this.editor.forceNextSelectionCheck(), this.editor.selectionChange(1)) 25665 } 25666 25667 function Y(a) { 25668 var b = null; 25669 a.on("data", function() { 25670 var a = this.data.classes, 25671 d; 25672 if (b != a) { 25673 for (d in b) a && a[d] || this.removeClass(d); 25674 for (d in a) this.addClass(d); 25675 b = a 25676 } 25677 }) 25678 } 25679 25680 function Z(a) { 25681 a.on("data", function() { 25682 if (a.wrapper) { 25683 var b = this.getLabel ? this.getLabel() : this.editor.lang.widget.label.replace(/%1/, this.pathName || this.element.getName()); 25684 a.wrapper.setAttribute("role", "region"); 25685 a.wrapper.setAttribute("aria-label", 25686 b) 25687 } 25688 }, null, null, 9999) 25689 } 25690 25691 function aa(a) { 25692 if (a.draggable) { 25693 var b = a.editor, 25694 c = a.wrapper.getLast(g.isDomDragHandlerContainer), 25695 d; 25696 c ? d = c.findOne("img") : (c = new CKEDITOR.dom.element("span", b.document), c.setAttributes({ 25697 "class": "cke_reset cke_widget_drag_handler_container", 25698 style: "background:rgba(220,220,220,0.5);background-image:url(" + b.plugins.widget.path + "images/handle.png)" 25699 }), d = new CKEDITOR.dom.element("img", b.document), d.setAttributes({ 25700 "class": "cke_reset cke_widget_drag_handler", 25701 "data-cke-widget-drag-handler": "1", 25702 src: CKEDITOR.tools.transparentImageData, 25703 width: 15, 25704 title: b.lang.widget.move, 25705 height: 15, 25706 role: "presentation" 25707 }), a.inline && d.setAttribute("draggable", "true"), c.append(d), a.wrapper.append(c)); 25708 a.wrapper.on("dragover", function(a) { 25709 a.data.preventDefault() 25710 }); 25711 a.wrapper.on("mouseenter", a.updateDragHandlerPosition, a); 25712 setTimeout(function() { 25713 a.on("data", a.updateDragHandlerPosition, a) 25714 }, 50); 25715 if (!a.inline && (d.on("mousedown", ba, a), CKEDITOR.env.ie && 9 > CKEDITOR.env.version)) d.on("dragstart", function(a) { 25716 a.data.preventDefault(!0) 25717 }); 25718 a.dragHandlerContainer = c 25719 } 25720 } 25721 25722 function ba(a) { 25723 function b() { 25724 var b; 25725 for (q.reset(); b = g.pop();) b.removeListener(); 25726 var c = k; 25727 b = a.sender; 25728 var d = this.repository.finder, 25729 e = this.repository.liner, 25730 f = this.editor, 25731 h = this.editor.editable(); 25732 CKEDITOR.tools.isEmpty(e.visible) || (c = d.getRange(c[0]), this.focus(), f.fire("drop", { 25733 dropRange: c, 25734 target: c.startContainer 25735 })); 25736 h.removeClass("cke_widget_dragging"); 25737 e.hideVisible(); 25738 f.fire("dragend", { 25739 target: b 25740 }) 25741 } 25742 if (CKEDITOR.tools.getMouseButton(a) === CKEDITOR.MOUSE_BUTTON_LEFT) { 25743 var c = this.repository.finder, 25744 d = this.repository.locator, 25745 e = this.repository.liner, 25746 f = this.editor, 25747 h = f.editable(), 25748 g = [], 25749 k = [], 25750 m, n; 25751 this.repository._.draggedWidget = this; 25752 var p = c.greedySearch(), 25753 q = CKEDITOR.tools.eventsBuffer(50, function() { 25754 m = d.locate(p); 25755 k = d.sort(n, 1); 25756 k.length && (e.prepare(p, m), e.placeLine(k[0]), e.cleanup()) 25757 }); 25758 h.addClass("cke_widget_dragging"); 25759 g.push(h.on("mousemove", function(a) { 25760 n = a.data.$.clientY; 25761 q.input() 25762 })); 25763 f.fire("dragstart", { 25764 target: a.sender 25765 }); 25766 g.push(f.document.once("mouseup", b, this)); 25767 h.isInline() || g.push(CKEDITOR.document.once("mouseup", 25768 b, this)) 25769 } 25770 } 25771 25772 function ca(a) { 25773 var b, c, d = a.editables; 25774 a.editables = {}; 25775 if (a.editables) 25776 for (b in d) c = d[b], a.initEditable(b, "string" == typeof c ? { 25777 selector: c 25778 } : c) 25779 } 25780 25781 function da(a) { 25782 if (a.mask) { 25783 var b = a.wrapper.findOne(".cke_widget_mask"); 25784 b || (b = new CKEDITOR.dom.element("img", a.editor.document), b.setAttributes({ 25785 src: CKEDITOR.tools.transparentImageData, 25786 "class": "cke_reset cke_widget_mask" 25787 }), a.wrapper.append(b)); 25788 a.mask = b 25789 } 25790 } 25791 25792 function ea(a) { 25793 if (a.parts) { 25794 var b = {}, 25795 c, d; 25796 for (d in a.parts) c = a.wrapper.findOne(a.parts[d]), b[d] = c; 25797 a.parts = 25798 b 25799 } 25800 } 25801 25802 function Q(a, b) { 25803 fa(a); 25804 ea(a); 25805 ca(a); 25806 da(a); 25807 aa(a); 25808 Y(a); 25809 Z(a); 25810 if (CKEDITOR.env.ie && 9 > CKEDITOR.env.version) a.wrapper.on("dragstart", function(b) { 25811 var d = b.data.getTarget(); 25812 g.getNestedEditable(a, d) || a.inline && g.isDomDragHandler(d) || b.data.preventDefault() 25813 }); 25814 a.wrapper.removeClass("cke_widget_new"); 25815 a.element.addClass("cke_widget_element"); 25816 a.on("key", function(b) { 25817 b = b.data.keyCode; 25818 if (13 == b) a.edit(); 25819 else { 25820 if (b == CKEDITOR.CTRL + 67 || b == CKEDITOR.CTRL + 88) { 25821 B(a, b == CKEDITOR.CTRL + 88); 25822 return 25823 } 25824 if (b in ga || CKEDITOR.CTRL & b || CKEDITOR.ALT & 25825 b) return 25826 } 25827 return !1 25828 }, null, null, 999); 25829 a.on("doubleclick", function(b) { 25830 a.edit() && b.cancel() 25831 }); 25832 if (b.data) a.on("data", b.data); 25833 if (b.edit) a.on("edit", b.edit) 25834 } 25835 25836 function fa(a) { 25837 (a.wrapper = a.element.getParent()).setAttribute("data-cke-widget-id", a.id) 25838 } 25839 25840 function r(a) { 25841 a.element.data("cke-widget-data", encodeURIComponent(JSON.stringify(a.data))) 25842 } 25843 25844 function ha() { 25845 function a() {} 25846 25847 function b(a, b, c) { 25848 return c && this.checkElement(a) ? (a = c.widgets.getByElement(a, !0)) && a.checkStyleActive(this) : !1 25849 } 25850 var c = {}; 25851 CKEDITOR.style.addCustomHandler({ 25852 type: "widget", 25853 setup: function(a) { 25854 this.widget = a.widget; 25855 if (this.group = "string" == typeof a.group ? [a.group] : a.group) { 25856 a = this.widget; 25857 var b; 25858 c[a] || (c[a] = {}); 25859 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) 25860 } 25861 }, 25862 apply: function(a) { 25863 var b; 25864 a instanceof CKEDITOR.editor && this.checkApplicable(a.elementPath(), a) && (b = a.widgets.focused, this.group && this.removeStylesFromSameGroup(a), b.applyStyle(this)) 25865 }, 25866 remove: function(a) { 25867 a instanceof CKEDITOR.editor && this.checkApplicable(a.elementPath(), 25868 a) && a.widgets.focused.removeStyle(this) 25869 }, 25870 removeStylesFromSameGroup: function(a) { 25871 var b, f, h = !1; 25872 if (!(a instanceof CKEDITOR.editor)) return !1; 25873 f = a.elementPath(); 25874 if (this.checkApplicable(f, a)) 25875 for (var g = 0, k = this.group.length; g < k; g++) { 25876 b = c[this.widget][this.group[g]]; 25877 for (var m = 0; m < b.length; m++) b[m] !== this && b[m].checkActive(f, a) && (a.widgets.focused.removeStyle(b[m]), h = !0) 25878 } 25879 return h 25880 }, 25881 checkActive: function(a, b) { 25882 return this.checkElementMatch(a.lastElement, 0, b) 25883 }, 25884 checkApplicable: function(a, b) { 25885 return b instanceof CKEDITOR.editor ? 25886 this.checkElement(a.lastElement) : !1 25887 }, 25888 checkElementMatch: b, 25889 checkElementRemovable: b, 25890 checkElement: function(a) { 25891 return g.isDomWidgetWrapper(a) ? (a = a.getFirst(g.isDomWidgetElement)) && a.data("widget") == this.widget : !1 25892 }, 25893 buildPreview: function(a) { 25894 return a || this._.definition.name 25895 }, 25896 toAllowedContentRules: function(a) { 25897 if (!a) return null; 25898 a = a.widgets.registered[this.widget]; 25899 var b, c = {}; 25900 if (!a) return null; 25901 if (a.styleableElements) { 25902 b = this.getClassesArray(); 25903 if (!b) return null; 25904 c[a.styleableElements] = { 25905 classes: b, 25906 propertiesOnly: !0 25907 }; 25908 return c 25909 } 25910 return a.styleToAllowedContentRules ? a.styleToAllowedContentRules(this) : null 25911 }, 25912 getClassesArray: function() { 25913 var a = this._.definition.attributes && this._.definition.attributes["class"]; 25914 return a ? CKEDITOR.tools.trim(a).split(/\s+/) : null 25915 }, 25916 applyToRange: a, 25917 removeFromRange: a, 25918 applyToObject: a 25919 }) 25920 } 25921 CKEDITOR.plugins.add("widget", { 25922 requires: "lineutils,clipboard,widgetselection", 25923 onLoad: function() { 25924 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}"), 25925 ha()) 25926 }, 25927 beforeInit: function(a) { 25928 void 0 !== CKEDITOR.document.$.querySelectorAll && (a.widgets = new p(a)) 25929 }, 25930 afterInit: function(a) { 25931 if (void 0 !== CKEDITOR.document.$.querySelectorAll) { 25932 var b = a.widgets.registered, 25933 c, d, e; 25934 for (d in b) c = b[d], (e = c.button) && a.ui.addButton && a.ui.addButton(CKEDITOR.tools.capitalize(c.name, !0), { 25935 label: e, 25936 command: c.name, 25937 toolbar: "insert,10" 25938 }); 25939 V(a) 25940 } 25941 } 25942 }); 25943 p.prototype = { 25944 MIN_SELECTION_CHECK_INTERVAL: 500, 25945 add: function(a, b) { 25946 b = CKEDITOR.tools.prototypedCopy(b); 25947 b.name = a; 25948 b._ = b._ || {}; 25949 this.editor.fire("widgetDefinition", 25950 b); 25951 b.template && (b.template = new CKEDITOR.template(b.template)); 25952 R(this.editor, b); 25953 S(this, b); 25954 return this.registered[a] = b 25955 }, 25956 addUpcastCallback: function(a) { 25957 this._.upcastCallbacks.push(a) 25958 }, 25959 checkSelection: function() { 25960 var a = this.editor.getSelection(), 25961 b = a.getSelectedElement(), 25962 c = C(this), 25963 d; 25964 if (b && (d = this.getByElement(b, !0))) return c.focus(d).select(d).commit(); 25965 a = a.getRanges()[0]; 25966 if (!a || a.collapsed) return c.commit(); 25967 a = new CKEDITOR.dom.walker(a); 25968 for (a.evaluator = g.isDomWidgetWrapper; b = a.next();) c.select(this.getByElement(b)); 25969 c.commit() 25970 }, 25971 checkWidgets: function(a) { 25972 this.fire("checkWidgets", CKEDITOR.tools.copy(a || {})) 25973 }, 25974 del: function(a) { 25975 if (this.focused === a) { 25976 var b = a.editor, 25977 c = b.createRange(), 25978 d; 25979 (d = c.moveToClosestEditablePosition(a.wrapper, !0)) || (d = c.moveToClosestEditablePosition(a.wrapper, !1)); 25980 d && b.getSelection().selectRanges([c]) 25981 } 25982 a.wrapper.remove(); 25983 this.destroy(a, !0) 25984 }, 25985 destroy: function(a, b) { 25986 this.widgetHoldingFocusedEditable === a && n(this, a, null, b); 25987 a.destroy(b); 25988 delete this.instances[a.id]; 25989 this.fire("instanceDestroyed", a) 25990 }, 25991 destroyAll: function(a, 25992 b) { 25993 var c, d, e = this.instances; 25994 if (b && !a) { 25995 d = b.find(".cke_widget_wrapper"); 25996 for (var e = d.count(), f = 0; f < e; ++f)(c = this.getByElement(d.getItem(f), !0)) && this.destroy(c) 25997 } else 25998 for (d in e) c = e[d], this.destroy(c, a) 25999 }, 26000 finalizeCreation: function(a) { 26001 (a = a.getFirst()) && g.isDomWidgetWrapper(a) && (this.editor.insertElement(a), a = this.getByElement(a), a.ready = !0, a.fire("ready"), a.focus()) 26002 }, 26003 getByElement: function() { 26004 function a(a) { 26005 return a.is(b) && a.data("cke-widget-id") 26006 } 26007 var b = { 26008 div: 1, 26009 span: 1 26010 }; 26011 return function(b, d) { 26012 if (!b) return null; 26013 var e = a(b); 26014 if (!d && !e) { 26015 var f = this.editor.editable(); 26016 do b = b.getParent(); while (b && !b.equals(f) && !(e = a(b))) 26017 } 26018 return this.instances[e] || null 26019 } 26020 }(), 26021 initOn: function(a, b, c) { 26022 b ? "string" == typeof b && (b = this.registered[b]) : b = this.registered[a.data("widget")]; 26023 if (!b) return null; 26024 var d = this.wrapElement(a, b.name); 26025 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 26026 }, 26027 initOnAll: function(a) { 26028 a = (a || this.editor.editable()).find(".cke_widget_new"); 26029 for (var b = [], c, d = a.count(); d--;)(c = this.initOn(a.getItem(d).getFirst(g.isDomWidgetElement))) && b.push(c); 26030 return b 26031 }, 26032 onWidget: function(a) { 26033 var b = Array.prototype.slice.call(arguments); 26034 b.shift(); 26035 for (var c in this.instances) { 26036 var d = this.instances[c]; 26037 d.name == a && d.on.apply(d, b) 26038 } 26039 this.on("instanceCreated", function(c) { 26040 c = c.data; 26041 c.name == a && c.on.apply(c, b) 26042 }) 26043 }, 26044 parseElementClasses: function(a) { 26045 if (!a) return null; 26046 a = CKEDITOR.tools.trim(a).split(/\s+/); 26047 for (var b, c = {}, d = 0; b = a.pop();) - 1 == b.indexOf("cke_") && (c[b] = d = 1); 26048 return d ? 26049 c : null 26050 }, 26051 wrapElement: function(a, b) { 26052 var c = null, 26053 d, e; 26054 if (a instanceof CKEDITOR.dom.element) { 26055 b = b || a.data("widget"); 26056 d = this.registered[b]; 26057 if (!d) return null; 26058 if ((c = a.getParent()) && c.type == CKEDITOR.NODE_ELEMENT && c.data("cke-widget-wrapper")) return c; 26059 a.hasAttribute("data-cke-widget-keep-attr") || a.data("cke-widget-keep-attr", a.data("widget") ? 1 : 0); 26060 a.data("widget", b); 26061 (e = A(d, a.getName())) && u(a); 26062 c = new CKEDITOR.dom.element(e ? "span" : "div"); 26063 c.setAttributes(y(e, b)); 26064 c.data("cke-display-name", d.pathName ? d.pathName : a.getName()); 26065 a.getParent(!0) && c.replace(a); 26066 a.appendTo(c) 26067 } else if (a instanceof CKEDITOR.htmlParser.element) { 26068 b = b || a.attributes["data-widget"]; 26069 d = this.registered[b]; 26070 if (!d) return null; 26071 if ((c = a.parent) && c.type == CKEDITOR.NODE_ELEMENT && c.attributes["data-cke-widget-wrapper"]) return c; 26072 "data-cke-widget-keep-attr" in a.attributes || (a.attributes["data-cke-widget-keep-attr"] = a.attributes["data-widget"] ? 1 : 0); 26073 b && (a.attributes["data-widget"] = b); 26074 (e = A(d, a.name)) && u(a); 26075 c = new CKEDITOR.htmlParser.element(e ? "span" : "div", y(e, b)); 26076 c.attributes["data-cke-display-name"] = 26077 d.pathName ? d.pathName : a.name; 26078 d = a.parent; 26079 var f; 26080 d && (f = a.getIndex(), a.remove()); 26081 c.add(a); 26082 d && z(d, f, c) 26083 } 26084 return c 26085 }, 26086 _tests_createEditableFilter: x 26087 }; 26088 CKEDITOR.event.implementOn(p.prototype); 26089 g.prototype = { 26090 addClass: function(a) { 26091 this.element.addClass(a); 26092 this.wrapper.addClass(g.WRAPPER_CLASS_PREFIX + a) 26093 }, 26094 applyStyle: function(a) { 26095 D(this, a, 1) 26096 }, 26097 checkStyleActive: function(a) { 26098 a = E(a); 26099 var b; 26100 if (!a) return !1; 26101 for (; b = a.pop();) 26102 if (!this.hasClass(b)) return !1; 26103 return !0 26104 }, 26105 destroy: function(a) { 26106 this.fire("destroy"); 26107 if (this.editables) 26108 for (var b in this.editables) this.destroyEditable(b, 26109 a); 26110 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)); 26111 this.wrapper = null 26112 }, 26113 destroyEditable: function(a, b) { 26114 var c = this.editables[a]; 26115 c.removeListener("focus", H); 26116 c.removeListener("blur", G); 26117 this.editor.focusManager.remove(c); 26118 b || (this.repository.destroyAll(!1, c), c.removeClass("cke_widget_editable"), 26119 c.removeClass("cke_widget_editable_focused"), c.removeAttributes(["contenteditable", "data-cke-widget-editable", "data-cke-enter-mode"])); 26120 delete this.editables[a] 26121 }, 26122 edit: function() { 26123 var a = { 26124 dialog: this.dialog 26125 }, 26126 b = this; 26127 if (!1 === this.fire("edit", a) || !a.dialog) return !1; 26128 this.editor.openDialog(a.dialog, function(a) { 26129 var d, e; 26130 !1 !== b.fire("dialog", a) && (d = a.on("show", function() { 26131 a.setupContent(b) 26132 }), e = a.on("ok", function() { 26133 var d, e = b.on("data", function(a) { 26134 d = 1; 26135 a.cancel() 26136 }, null, null, 0); 26137 b.editor.fire("saveSnapshot"); 26138 a.commitContent(b); 26139 e.removeListener(); 26140 d && (b.fire("data", b.data), b.editor.fire("saveSnapshot")) 26141 }), a.once("hide", function() { 26142 d.removeListener(); 26143 e.removeListener() 26144 })) 26145 }); 26146 return !0 26147 }, 26148 getClasses: function() { 26149 return this.repository.parseElementClasses(this.element.getAttribute("class")) 26150 }, 26151 hasClass: function(a) { 26152 return this.element.hasClass(a) 26153 }, 26154 initEditable: function(a, b) { 26155 var c = this._findOneNotNested(b.selector); 26156 return c && c.is(CKEDITOR.dtd.$editable) ? (c = new q(this.editor, c, { 26157 filter: x.call(this.repository, this.name, a, b) 26158 }), this.editables[a] = 26159 c, c.setAttributes({ 26160 contenteditable: "true", 26161 "data-cke-widget-editable": a, 26162 "data-cke-enter-mode": c.enterMode 26163 }), 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 26164 }, 26165 _findOneNotNested: function(a) { 26166 a = this.wrapper.find(a); 26167 for (var b, c, d = 0; d < a.count(); d++) 26168 if (b = 26169 a.getItem(d), c = b.getAscendant(g.isDomWidgetWrapper), this.wrapper.equals(c)) return b; 26170 return null 26171 }, 26172 isInited: function() { 26173 return !(!this.wrapper || !this.inited) 26174 }, 26175 isReady: function() { 26176 return this.isInited() && this.ready 26177 }, 26178 focus: function() { 26179 var a = this.editor.getSelection(); 26180 if (a) { 26181 var b = this.editor.checkDirty(); 26182 a.fake(this.wrapper); 26183 !b && this.editor.resetDirty() 26184 } 26185 this.editor.focus() 26186 }, 26187 removeClass: function(a) { 26188 this.element.removeClass(a); 26189 this.wrapper.removeClass(g.WRAPPER_CLASS_PREFIX + a) 26190 }, 26191 removeStyle: function(a) { 26192 D(this, 26193 a, 0) 26194 }, 26195 setData: function(a, b) { 26196 var c = this.data, 26197 d = 0; 26198 if ("string" == typeof a) c[a] !== b && (c[a] = b, d = 1); 26199 else { 26200 var e = a; 26201 for (a in e) c[a] !== e[a] && (d = 1, c[a] = e[a]) 26202 } 26203 d && this.dataReady && (r(this), this.fire("data", c)); 26204 return this 26205 }, 26206 setFocused: function(a) { 26207 this.wrapper[a ? "addClass" : "removeClass"]("cke_widget_focused"); 26208 this.fire(a ? "focus" : "blur"); 26209 return this 26210 }, 26211 setSelected: function(a) { 26212 this.wrapper[a ? "addClass" : "removeClass"]("cke_widget_selected"); 26213 this.fire(a ? "select" : "deselect"); 26214 return this 26215 }, 26216 updateDragHandlerPosition: function() { 26217 var a = 26218 this.editor, 26219 b = this.element.$, 26220 c = this._.dragHandlerOffset, 26221 b = { 26222 x: b.offsetLeft, 26223 y: b.offsetTop - 15 26224 }; 26225 c && b.x == c.x && b.y == c.y || (c = a.checkDirty(), a.fire("lockSnapshot"), this.dragHandlerContainer.setStyles({ 26226 top: b.y + "px", 26227 left: b.x + "px", 26228 display: "block" 26229 }), a.fire("unlockSnapshot"), !c && a.resetDirty(), this._.dragHandlerOffset = b) 26230 } 26231 }; 26232 CKEDITOR.event.implementOn(g.prototype); 26233 g.getNestedEditable = function(a, b) { 26234 return !b || b.equals(a) ? null : g.isDomNestedEditable(b) ? b : g.getNestedEditable(a, b.getParent()) 26235 }; 26236 g.isDomDragHandler = function(a) { 26237 return a.type == 26238 CKEDITOR.NODE_ELEMENT && a.hasAttribute("data-cke-widget-drag-handler") 26239 }; 26240 g.isDomDragHandlerContainer = function(a) { 26241 return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_widget_drag_handler_container") 26242 }; 26243 g.isDomNestedEditable = function(a) { 26244 return a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("data-cke-widget-editable") 26245 }; 26246 g.isDomWidgetElement = function(a) { 26247 return a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("data-widget") 26248 }; 26249 g.isDomWidgetWrapper = function(a) { 26250 return a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("data-cke-widget-wrapper") 26251 }; 26252 g.isDomWidget = function(a) { 26253 return a ? this.isDomWidgetWrapper(a) || this.isDomWidgetElement(a) : !1 26254 }; 26255 g.isParserWidgetElement = function(a) { 26256 return a.type == CKEDITOR.NODE_ELEMENT && !!a.attributes["data-widget"] 26257 }; 26258 g.isParserWidgetWrapper = function(a) { 26259 return a.type == CKEDITOR.NODE_ELEMENT && !!a.attributes["data-cke-widget-wrapper"] 26260 }; 26261 g.WRAPPER_CLASS_PREFIX = "cke_widget_wrapper_"; 26262 q.prototype = CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.dom.element.prototype), { 26263 setData: function(a) { 26264 this._.initialSetData || 26265 this.editor.widgets.destroyAll(!1, this); 26266 this._.initialSetData = !1; 26267 a = this.editor.dataProcessor.toHtml(a, { 26268 context: this.getName(), 26269 filter: this.filter, 26270 enterMode: this.enterMode 26271 }); 26272 this.setHtml(a); 26273 this.editor.widgets.initOnAll(this) 26274 }, 26275 getData: function() { 26276 return this.editor.dataProcessor.toDataFormat(this.getHtml(), { 26277 context: this.getName(), 26278 filter: this.filter, 26279 enterMode: this.enterMode 26280 }) 26281 } 26282 }); 26283 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, 26284 ga = { 26285 37: 1, 26286 38: 1, 26287 39: 1, 26288 40: 1, 26289 8: 1, 26290 46: 1 26291 }; 26292 CKEDITOR.plugins.widget = g; 26293 g.repository = p; 26294 g.nestedEditable = q 26295 })(); 26296 (function() { 26297 function e(a, b, c) { 26298 this.editor = a; 26299 this.notification = null; 26300 this._message = new CKEDITOR.template(b); 26301 this._singularMessage = c ? new CKEDITOR.template(c) : null; 26302 this._tasks = []; 26303 this._doneTasks = this._doneWeights = this._totalWeights = 0 26304 } 26305 26306 function d(a) { 26307 this._weight = a || 1; 26308 this._doneWeight = 0; 26309 this._isCanceled = !1 26310 } 26311 CKEDITOR.plugins.add("notificationaggregator", { 26312 requires: "notification" 26313 }); 26314 e.prototype = { 26315 createTask: function(a) { 26316 a = a || {}; 26317 var b = !this.notification, 26318 c; 26319 b && (this.notification = this._createNotification()); 26320 c = this._addTask(a); 26321 c.on("updated", this._onTaskUpdate, this); 26322 c.on("done", this._onTaskDone, this); 26323 c.on("canceled", function() { 26324 this._removeTask(c) 26325 }, this); 26326 this.update(); 26327 b && this.notification.show(); 26328 return c 26329 }, 26330 update: function() { 26331 this._updateNotification(); 26332 this.isFinished() && this.fire("finished") 26333 }, 26334 getPercentage: function() { 26335 return 0 === this.getTaskCount() ? 1 : this._doneWeights / this._totalWeights 26336 }, 26337 isFinished: function() { 26338 return this.getDoneTaskCount() === this.getTaskCount() 26339 }, 26340 getTaskCount: function() { 26341 return this._tasks.length 26342 }, 26343 getDoneTaskCount: function() { 26344 return this._doneTasks 26345 }, 26346 _updateNotification: function() { 26347 this.notification.update({ 26348 message: this._getNotificationMessage(), 26349 progress: this.getPercentage() 26350 }) 26351 }, 26352 _getNotificationMessage: function() { 26353 var a = this.getTaskCount(), 26354 b = { 26355 current: this.getDoneTaskCount(), 26356 max: a, 26357 percentage: Math.round(100 * this.getPercentage()) 26358 }; 26359 return (1 == a && this._singularMessage ? this._singularMessage : this._message).output(b) 26360 }, 26361 _createNotification: function() { 26362 return new CKEDITOR.plugins.notification(this.editor, { 26363 type: "progress" 26364 }) 26365 }, 26366 _addTask: function(a) { 26367 a = new d(a.weight); 26368 this._tasks.push(a); 26369 this._totalWeights += a._weight; 26370 return a 26371 }, 26372 _removeTask: function(a) { 26373 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()) 26374 }, 26375 _onTaskUpdate: function(a) { 26376 this._doneWeights += a.data; 26377 this.update() 26378 }, 26379 _onTaskDone: function() { 26380 this._doneTasks += 1; 26381 this.update() 26382 } 26383 }; 26384 CKEDITOR.event.implementOn(e.prototype); 26385 d.prototype = { 26386 done: function() { 26387 this.update(this._weight) 26388 }, 26389 update: function(a) { 26390 if (!this.isDone() && 26391 !this.isCanceled()) { 26392 a = Math.min(this._weight, a); 26393 var b = a - this._doneWeight; 26394 this._doneWeight = a; 26395 this.fire("updated", b); 26396 this.isDone() && this.fire("done") 26397 } 26398 }, 26399 cancel: function() { 26400 this.isDone() || this.isCanceled() || (this._isCanceled = !0, this.fire("canceled")) 26401 }, 26402 isDone: function() { 26403 return this._weight === this._doneWeight 26404 }, 26405 isCanceled: function() { 26406 return this._isCanceled 26407 } 26408 }; 26409 CKEDITOR.event.implementOn(d.prototype); 26410 CKEDITOR.plugins.notificationAggregator = e; 26411 CKEDITOR.plugins.notificationAggregator.task = d 26412 })(); 26413 (function() { 26414 CKEDITOR.plugins.add("uploadwidget", { 26415 requires: "widget,clipboard,filetools,notificationaggregator", 26416 init: function(a) { 26417 a.filter.allow("*[!data-widget,!data-cke-upload-id]") 26418 } 26419 }); 26420 CKEDITOR.fileTools || (CKEDITOR.fileTools = {}); 26421 CKEDITOR.tools.extend(CKEDITOR.fileTools, { 26422 addUploadWidget: function(a, c, f) { 26423 var h = CKEDITOR.fileTools, 26424 b = a.uploadRepository, 26425 m = f.supportedTypes ? 10 : 20; 26426 if (f.fileToElement) a.on("paste", function(d) { 26427 d = d.data; 26428 var l = a.widgets.registered[c], 26429 k = d.dataTransfer, 26430 f = k.getFilesCount(), 26431 g = l.loadMethod || 26432 "loadAndUpload", 26433 e, n; 26434 if (!d.dataValue && f) 26435 for (n = 0; n < f; n++) 26436 if (e = k.getFile(n), !l.supportedTypes || h.isTypeSupported(e, l.supportedTypes)) { 26437 var m = l.fileToElement(e); 26438 e = b.create(e, void 0, l.loaderType); 26439 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()) 26440 } 26441 }, null, null, m); 26442 CKEDITOR.tools.extend(f, { 26443 downcast: function() { 26444 return new CKEDITOR.htmlParser.text("") 26445 }, 26446 init: function() { 26447 var d = this, 26448 c = this.wrapper.findOne("[data-cke-upload-id]").data("cke-upload-id"), 26449 k = b.loaders[c], 26450 f = CKEDITOR.tools.capitalize, 26451 g, e; 26452 k.on("update", function(b) { 26453 if (d.wrapper && d.wrapper.getParent()) { 26454 a.fire("lockSnapshot"); 26455 b = "on" + f(k.status); 26456 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); 26457 a.fire("unlockSnapshot") 26458 } else CKEDITOR.instances[a.name] && 26459 a.editable().find('[data-cke-upload-id\x3d"' + c + '"]').count() || k.abort(), b.removeListener() 26460 }); 26461 k.update() 26462 }, 26463 replaceWith: function(d, c) { 26464 if ("" === d.trim()) a.widgets.del(this); 26465 else { 26466 var b = this == a.widgets.focused, 26467 f = a.editable(), 26468 g = a.createRange(), 26469 e, h; 26470 b || (h = a.getSelection().createBookmarks()); 26471 g.setStartBefore(this.wrapper); 26472 g.setEndAfter(this.wrapper); 26473 b && (e = g.createBookmark()); 26474 f.insertHtmlIntoRange(d, g, c); 26475 a.widgets.checkWidgets({ 26476 initOnlyNew: !0 26477 }); 26478 a.widgets.destroy(this, !0); 26479 b ? (g.moveToBookmark(e), g.select()) : a.getSelection().selectBookmarks(h) 26480 } 26481 }, 26482 _getLoader: function() { 26483 var a = this.wrapper.findOne("[data-cke-upload-id]"); 26484 return a ? this.editor.uploadRepository.loaders[a.data("cke-upload-id")] : null 26485 } 26486 }); 26487 a.widgets.add(c, f) 26488 }, 26489 markElement: function(a, c, f) { 26490 a.setAttributes({ 26491 "data-cke-upload-id": f, 26492 "data-widget": c 26493 }) 26494 }, 26495 bindNotifications: function(a, c) { 26496 function f() { 26497 h = a._.uploadWidgetNotificaionAggregator; 26498 if (!h || h.isFinished()) h = a._.uploadWidgetNotificaionAggregator = new CKEDITOR.plugins.notificationAggregator(a, a.lang.uploadwidget.uploadMany, a.lang.uploadwidget.uploadOne), 26499 h.once("finished", function() { 26500 var b = h.getTaskCount(); 26501 0 === b ? h.notification.hide() : h.notification.update({ 26502 message: 1 == b ? a.lang.uploadwidget.doneOne : a.lang.uploadwidget.doneMany.replace("%1", b), 26503 type: "success", 26504 important: 1 26505 }) 26506 }) 26507 } 26508 var h, b = null; 26509 c.on("update", function() { 26510 !b && c.uploadTotal && (f(), b = h.createTask({ 26511 weight: c.uploadTotal 26512 })); 26513 b && "uploading" == c.status && b.update(c.uploaded) 26514 }); 26515 c.on("uploaded", function() { 26516 b && b.done() 26517 }); 26518 c.on("error", function() { 26519 b && b.cancel(); 26520 a.showNotification(c.message, "warning") 26521 }); 26522 c.on("abort", 26523 function() { 26524 b && b.cancel(); 26525 CKEDITOR.instances[a.name] && a.showNotification(a.lang.uploadwidget.abort, "info") 26526 }) 26527 } 26528 }) 26529 })(); 26530 (function() { 26531 function l(c) { 26532 9 >= c && (c = "0" + c); 26533 return String(c) 26534 } 26535 26536 function n(c) { 26537 var a = new Date, 26538 a = [a.getFullYear(), a.getMonth() + 1, a.getDate(), a.getHours(), a.getMinutes(), a.getSeconds()]; 26539 e += 1; 26540 return "image-" + CKEDITOR.tools.array.map(a, l).join("") + "-" + e + "." + c 26541 } 26542 var e = 0; 26543 CKEDITOR.plugins.add("uploadimage", { 26544 requires: "uploadwidget", 26545 onLoad: function() { 26546 CKEDITOR.addCss(".cke_upload_uploading img{opacity: 0.3}") 26547 }, 26548 init: function(c) { 26549 if (CKEDITOR.plugins.clipboard.isFileApiSupported) { 26550 var a = CKEDITOR.fileTools, 26551 e = a.getUploadUrl(c.config, 26552 "image"); 26553 e && (a.addUploadWidget(c, "uploadimage", { 26554 supportedTypes: /image\/(jpeg|png|gif|bmp)/, 26555 uploadUrl: e, 26556 fileToElement: function() { 26557 var b = new CKEDITOR.dom.element("img"); 26558 b.setAttribute("src", "data:image/gif;base64,R0lGODlhDgAOAIAAAAAAAP///yH5BAAAAAAALAAAAAAOAA4AAAIMhI+py+0Po5y02qsKADs\x3d"); 26559 return b 26560 }, 26561 parts: { 26562 img: "img" 26563 }, 26564 onUploading: function(b) { 26565 this.parts.img.setAttribute("src", b.data) 26566 }, 26567 onUploaded: function(b) { 26568 var a = this.parts.img.$; 26569 this.replaceWith('\x3cimg src\x3d"' + b.url + '" width\x3d"' + (b.responseData.width || 26570 a.naturalWidth) + '" height\x3d"' + (b.responseData.height || a.naturalHeight) + '"\x3e') 26571 } 26572 }), c.on("paste", function(b) { 26573 if (b.data.dataValue.match(/<img[\s\S]+data:/i)) { 26574 b = b.data; 26575 var f = document.implementation.createHTMLDocument(""), 26576 f = new CKEDITOR.dom.element(f.body), 26577 m, g, k; 26578 f.data("cke-editable", 1); 26579 f.appendHtml(b.dataValue); 26580 m = f.find("img"); 26581 for (k = 0; k < m.count(); k++) { 26582 g = m.getItem(k); 26583 var d = g.getAttribute("src"), 26584 h = d && "data:" == d.substring(0, 5), 26585 l = null === g.data("cke-realelement"); 26586 h && l && !g.data("cke-upload-id") && !g.isReadOnly(1) && 26587 (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)) 26588 } 26589 b.dataValue = f.getHtml() 26590 } 26591 })) 26592 } 26593 } 26594 }) 26595 })(); 26596 CKEDITOR.plugins.add("wsc", { 26597 requires: "dialog", 26598 parseApi: function(a) { 26599 a.config.wsc_onFinish = "function" === typeof a.config.wsc_onFinish ? a.config.wsc_onFinish : function() {}; 26600 a.config.wsc_onClose = "function" === typeof a.config.wsc_onClose ? a.config.wsc_onClose : function() {} 26601 }, 26602 parseConfig: function(a) { 26603 a.config.wsc_customerId = a.config.wsc_customerId || CKEDITOR.config.wsc_customerId || "1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk"; 26604 a.config.wsc_customDictionaryIds = a.config.wsc_customDictionaryIds || 26605 CKEDITOR.config.wsc_customDictionaryIds || ""; 26606 a.config.wsc_userDictionaryName = a.config.wsc_userDictionaryName || CKEDITOR.config.wsc_userDictionaryName || ""; 26607 a.config.wsc_customLoaderScript = a.config.wsc_customLoaderScript || CKEDITOR.config.wsc_customLoaderScript; 26608 a.config.wsc_interfaceLang = a.config.wsc_interfaceLang; 26609 CKEDITOR.config.wsc_cmd = a.config.wsc_cmd || CKEDITOR.config.wsc_cmd || "spell"; 26610 CKEDITOR.config.wsc_version = "v4.3.0-master-d769233"; 26611 CKEDITOR.config.wsc_removeGlobalVariable = !0 26612 }, 26613 onLoad: function(a) { 26614 "moono-lisa" == 26615 (CKEDITOR.skinName || a.config.skin) && CKEDITOR.document.appendStyleSheet(this.path + "skins/" + CKEDITOR.skin.name + "/wsc.css") 26616 }, 26617 init: function(a) { 26618 var b = CKEDITOR.env; 26619 this.parseConfig(a); 26620 this.parseApi(a); 26621 a.addCommand("checkspell", new CKEDITOR.dialogCommand("checkspell")).modes = { 26622 wysiwyg: !CKEDITOR.env.opera && !CKEDITOR.env.air && document.domain == window.location.hostname && !(b.ie && (8 > b.version || b.quirks)) 26623 }; 26624 "undefined" == typeof a.plugins.scayt && a.ui.addButton && a.ui.addButton("SpellChecker", { 26625 label: a.lang.wsc.toolbar, 26626 click: function(a) { 26627 var b = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.container.getText() : a.document.getBody().getText(); 26628 (b = b.replace(/\s/g, "")) ? a.execCommand("checkspell"): alert("Nothing to check!") 26629 }, 26630 toolbar: "spellchecker,10" 26631 }); 26632 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")) 26633 } 26634 }); 26635 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'; 26636 CKEDITOR.config.skin = 'moono-lisa'; 26637 (function() { 26638 var setIcons = function(icons, strip) { 26639 var path = CKEDITOR.getUrl('plugins/' + strip); 26640 icons = icons.split(','); 26641 for (var i = 0; i < icons.length; i++) CKEDITOR.skin.icons[icons[i]] = { 26642 path: path, 26643 offset: -icons[++i], 26644 bgsize: icons[++i] 26645 }; 26646 }; 26647 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'); 26648 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'); 26649 })(); 26650 CKEDITOR.lang.languages = { 26651 "af": 1, 26652 "sq": 1, 26653 "ar": 1, 26654 "az": 1, 26655 "eu": 1, 26656 "bn": 1, 26657 "bs": 1, 26658 "bg": 1, 26659 "ca": 1, 26660 "zh-cn": 1, 26661 "zh": 1, 26662 "hr": 1, 26663 "cs": 1, 26664 "da": 1, 26665 "nl": 1, 26666 "en": 1, 26667 "en-au": 1, 26668 "en-ca": 1, 26669 "en-gb": 1, 26670 "eo": 1, 26671 "et": 1, 26672 "fo": 1, 26673 "fi": 1, 26674 "fr": 1, 26675 "fr-ca": 1, 26676 "gl": 1, 26677 "ka": 1, 26678 "de": 1, 26679 "de-ch": 1, 26680 "el": 1, 26681 "gu": 1, 26682 "he": 1, 26683 "hi": 1, 26684 "hu": 1, 26685 "is": 1, 26686 "id": 1, 26687 "it": 1, 26688 "ja": 1, 26689 "km": 1, 26690 "ko": 1, 26691 "ku": 1, 26692 "lv": 1, 26693 "lt": 1, 26694 "mk": 1, 26695 "ms": 1, 26696 "mn": 1, 26697 "no": 1, 26698 "nb": 1, 26699 "oc": 1, 26700 "fa": 1, 26701 "pl": 1, 26702 "pt-br": 1, 26703 "pt": 1, 26704 "ro": 1, 26705 "ru": 1, 26706 "sr": 1, 26707 "sr-latn": 1, 26708 "si": 1, 26709 "sk": 1, 26710 "sl": 1, 26711 "es": 1, 26712 "es-mx": 1, 26713 "sv": 1, 26714 "tt": 1, 26715 "th": 1, 26716 "tr": 1, 26717 "ug": 1, 26718 "uk": 1, 26719 "vi": 1, 26720 "cy": 1 26721 }; 26722}());