/* KindEditor 4.1.11 (2016-03-31), Copyright (C) kindsoft.net, Licence: http://kindeditor.net/license.php */ ! function(window, undefined) { function _isArray(a) { return a ? "[object Array]" === Object.prototype.toString.call(a) : !1 } function _isFunction(a) { return a ? "[object Function]" === Object.prototype.toString.call(a) : !1 } function _inArray(a, b) { for (var c = 0, d = b.length; d > c; c++) if (a === b[c]) return c; return - 1 } function _each(a, b) { if (_isArray(a)) for (var c = 0, d = a.length; d > c && b.call(a[c], c, a[c]) !== !1; c++); else for (var e in a) if (a.hasOwnProperty(e) && b.call(a[e], e, a[e]) === !1) break } function _trim(a) { return a.replace(/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, "") } function _inString(a, b, c) { return c = c === undefined ? ",": c, (c + b + c).indexOf(c + a + c) >= 0 } function _addUnit(a, b) { return b = b || "px", a && /^-?\d+(?:\.\d+)?$/.test(a) ? a + b: a } function _removeUnit(a) { var b; return a && (b = /(\d+)/.exec(a)) ? parseInt(b[1], 10) : 0 } function _escape(a) { return a.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """) } function _unescape(a) { return a.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/&/g, "&") } function _toCamel(a) { var b = a.split("-"); return a = "", _each(b, function(b, c) { a += b > 0 ? c.charAt(0).toUpperCase() + c.substr(1) : c }), a } function _toHex(a) { function b(a) { var b = parseInt(a, 10).toString(16).toUpperCase(); return b.length > 1 ? b: "0" + b } return a.replace(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/gi, function(a, c, d, e) { return "#" + b(c) + b(d) + b(e) }) } function _toMap(a, b) { b = b === undefined ? ",": b; var c, d = {}, e = _isArray(a) ? a: a.split(b); return _each(e, function(a, b) { if (c = /^(\d+)\.\.(\d+)$/.exec(b)) for (var e = parseInt(c[1], 10); e <= parseInt(c[2], 10); e++) d[e.toString()] = !0; else d[b] = !0 }), d } function _toArray(a, b) { return Array.prototype.slice.call(a, b || 0) } function _undef(a, b) { return a === undefined ? b: a } function _invalidUrl(a) { return ! a || /[<>"]/.test(a) } function _addParam(a, b) { return a.indexOf("?") >= 0 ? a + "&" + b: a + "?" + b } function _extend(a, b, c) { c || (c = b, b = null); var d; if (b) { var e = function() {}; e.prototype = b.prototype, d = new e, _each(c, function(a, b) { d[a] = b }) } else d = c; d.constructor = a, a.prototype = d, a.parent = b ? b.prototype: null } function _json(text) { var match; (match = /\{[\s\S]*\}|\[[\s\S]*\]/.exec(text)) && (text = match[0]); var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; if (cx.lastIndex = 0, cx.test(text) && (text = text.replace(cx, function(a) { return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice( - 4) })), /^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return eval("(" + text + ")"); throw "JSON parse error" } function _getBasePath() { for (var a, b = document.getElementsByTagName("script"), c = 0, d = b.length; d > c; c++) if (a = b[c].src || "", /kindeditor[\w\-\.]*\.js/.test(a)) return a.substring(0, a.lastIndexOf("/") + 1); return "" } function _bindEvent(a, b, c) { a.addEventListener ? a.addEventListener(b, c, _useCapture) : a.attachEvent && a.attachEvent("on" + b, c) } function _unbindEvent(a, b, c) { a.removeEventListener ? a.removeEventListener(b, c, _useCapture) : a.detachEvent && a.detachEvent("on" + b, c) } function KEvent(a, b) { this.init(a, b) } function _getId(a) { return a[_eventExpendo] || null } function _setId(a) { return a[_eventExpendo] = ++_eventId, _eventId } function _removeId(a) { try { delete a[_eventExpendo] } catch(b) { a.removeAttribute && a.removeAttribute(_eventExpendo) } } function _bind(a, b, c) { if (b.indexOf(",") >= 0) return void _each(b.split(","), function() { _bind(a, this, c) }); var d = _getId(a); d || (d = _setId(a)), _eventData[d] === undefined && (_eventData[d] = {}); var e = _eventData[d][b]; e && e.length > 0 ? _unbindEvent(a, b, e[0]) : (_eventData[d][b] = [], _eventData[d].el = a), e = _eventData[d][b], 0 === e.length && (e[0] = function(b) { var c = b ? new KEvent(a, b) : undefined; _each(e, function(b, d) { b > 0 && d && d.call(a, c) }) }), _inArray(c, e) < 0 && e.push(c), _bindEvent(a, b, e[0]) } function _unbind(a, b, c) { if (b && b.indexOf(",") >= 0) return void _each(b.split(","), function() { _unbind(a, this, c) }); var d = _getId(a); if (d) { if (b === undefined) return void(d in _eventData && (_each(_eventData[d], function(b, c) { "el" != b && c.length > 0 && _unbindEvent(a, b, c[0]) }), delete _eventData[d], _removeId(a))); if (_eventData[d]) { var e = _eventData[d][b]; if (e && e.length > 0) { c === undefined ? (_unbindEvent(a, b, e[0]), delete _eventData[d][b]) : (_each(e, function(a, b) { a > 0 && b === c && e.splice(a, 1) }), 1 == e.length && (_unbindEvent(a, b, e[0]), delete _eventData[d][b])); var f = 0; _each(_eventData[d], function() { f++ }), 2 > f && (delete _eventData[d], _removeId(a)) } } } } function _fire(a, b) { if (b.indexOf(",") >= 0) return void _each(b.split(","), function() { _fire(a, this) }); var c = _getId(a); if (c) { var d = _eventData[c][b]; _eventData[c] && d && d.length > 0 && d[0]() } } function _ctrl(a, b, c) { b = /^\d{2,}$/.test(b) ? b: b.toUpperCase().charCodeAt(0), _bind(a, "keydown", function(d) { ! d.ctrlKey || d.which != b || d.shiftKey || d.altKey || (c.call(a), d.stop()) }) } function _ready(a) { function b() { e || (e = !0, a(KindEditor), _readyFinished = !0) } function c() { if (!e) { try { document.documentElement.doScroll("left") } catch(a) { return void setTimeout(c, 100) } b() } } function d() { "complete" === document.readyState && b() } if (_readyFinished) return void a(KindEditor); var e = !1; if (document.addEventListener) _bind(document, "DOMContentLoaded", b); else if (document.attachEvent) { _bind(document, "readystatechange", d); var f = !1; try { f = null == window.frameElement } catch(g) {} document.documentElement.doScroll && f && c() } _bind(window, "load", b) } function _getCssList(a) { for (var b, c = {}, d = /\s*([\w\-]+)\s*:([^;]*)(;|$)/g; b = d.exec(a);) { var e = _trim(b[1].toLowerCase()), f = _trim(_toHex(b[2])); c[e] = f } return c } function _getAttrList(a) { for (var b, c = {}, d = /\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g; b = d.exec(a);) { var e = (b[1] || b[2] || b[4] || b[6]).toLowerCase(), f = (b[2] ? b[3] : b[4] ? b[5] : b[7]) || ""; c[e] = f } return c } function _addClassToTag(a, b) { return a = /\s+class\s*=/.test(a) ? a.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/, function(a, c, d, e) { return (" " + d + " ").indexOf(" " + b + " ") < 0 ? "" === d ? c + b + e: c + d + " " + b + e: a }) : a.substr(0, a.length - 1) + ' class="' + b + '">' } function _formatCss(a) { var b = ""; return _each(_getCssList(a), function(a, c) { b += a + ":" + c + ";" }), b } function _formatUrl(a, b, c, d) { function e(a) { for (var b = a.split("/"), c = [], d = 0, e = b.length; e > d; d++) { var f = b[d]; ".." == f ? c.length > 0 && c.pop() : "" !== f && "." != f && c.push(f) } return "/" + c.join("/") } function f(b, c) { if (a.substr(0, b.length) === b) { for (var e = [], g = 0; c > g; g++) e.push(".."); var i = "."; return e.length > 0 && (i += "/" + e.join("/")), "/" == d && (i += "/"), i + a.substr(b.length) } return (h = /^(.*)\//.exec(b)) ? f(h[1], ++c) : void 0 } if (b = _undef(b, "").toLowerCase(), "data:" != a.substr(0, 5) && (a = a.replace(/([^:])\/\//g, "$1/")), _inArray(b, ["absolute", "relative", "domain"]) < 0) return a; if (c = c || location.protocol + "//" + location.host, d === undefined) { var g = location.pathname.match(/^(\/.*)\//); d = g ? g[1] : "" } var h; if (h = /^(\w+:\/\/[^\/]*)/.exec(a)) { if (h[1] !== c) return a } else if (/^\w+:/.test(a)) return a; return /^\//.test(a) ? a = c + e(a.substr(1)) : /^\w+:\/\//.test(a) || (a = c + e(d + "/" + a)), "relative" === b ? a = f(c + d, 0).substr(2) : "absolute" === b && a.substr(0, c.length) === c && (a = a.substr(c.length)), a } function // _formatHtml(a,b,c,d,e){null==a&&(a=""),c=c||"",d=_undef(d,!1),e=_undef(e," // ");var // f="xx-small,x-small,small,medium,large,x-large,xx-large".split(",");a=a.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/gi,function(a,b,c,d){return // b+c.replace(/<(?:br|br\s[^>]*)>/gi,"\n")+d}),a=a.replace(/<(?:br|br\s[^>]*)\s*\/?>\s*<\/p>/gi,"
"),a=a.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/gi,"$1