/* KindEditor 4.1.10 (2013-11-23), Copyright (C) kindsoft.net, Licence: http://www.kindsoft.net/license.php */ (function (b, d) { function f(a) { if (!a)return!1; return Object.prototype.toString.call(a) === "[object Array]" } function j(a) { if (!a)return!1; return Object.prototype.toString.call(a) === "[object Function]" } function e(a, c) { for (var g = 0, b = c.length; g < b; g++)if (a === c[g])return g; return-1 } function h(a, c) { if (f(a))for (var g = 0, b = a.length; g < b; g++) { if (c.call(a[g], g, a[g]) === !1)break } else for (g in a)if (a.hasOwnProperty(g) && c.call(a[g], g, a[g]) === !1)break } function m(a) { return a.replace(/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, "") } function n(a, c, g) { g = g === d ? "," : g; return(g + c + g).indexOf(g + a + g) >= 0 } function o(a, c) { c = c || "px"; return a && /^\d+$/.test(a) ? a + c : a } function l(a) { var c; return a && (c = /(\d+)/.exec(a)) ? parseInt(c[1], 10) : 0 } function s(a) { return a.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """) } function v(a) { return a.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/&/g, "&") } function p(a) { var c = a.split("-"), a = ""; h(c, function (c, b) { a += c > 0 ? b.charAt(0).toUpperCase() + b.substr(1) : b }); return a } function r(a) { function c(a) { a = parseInt(a, 10).toString(16).toUpperCase(); return a.length > 1 ? a : "0" + a } return a.replace(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/ig, function (a, b, d, k) { return"#" + c(b) + c(d) + c(k) }) } function z(a, c) { var c = c === d ? "," : c, g = {}, b = f(a) ? a : a.split(c), t; h(b, function (a, c) { if (t = /^(\d+)\.\.(\d+)$/.exec(c))for (var b = parseInt(t[1], 10); b <= parseInt(t[2], 10); b++)g[b.toString()] = !0; else g[c] = !0 }); return g } function D(a, c) { return Array.prototype.slice.call(a, c || 0) } function q(a, c) { return a === d ? c : a } function A(a, c, g) { g || (g = c, c = null); var b; if (c) { var d = function () { }; d.prototype = c.prototype; b = new d; h(g, function (a, c) { b[a] = c }) } else b = g; b.constructor = a; a.prototype = b; a.parent = c ? c.prototype : null } function B(a) { var c; if (c = /\{[\s\S]*\}|\[[\s\S]*\]/.exec(a))a = c[0]; c = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; c.lastIndex = 0; c.test(a) && (a = a.replace(c, function (a) { return"\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4) })); if (/^[\],:{}\s]*$/.test(a.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("(" + a + ")"); throw"JSON parse error"; } function G(a, c, g) { a.addEventListener ? a.addEventListener(c, g, fb) : a.attachEvent && a.attachEvent("on" + c, g) } function C(a, c, g) { a.removeEventListener ? a.removeEventListener(c, g, fb) : a.detachEvent && a.detachEvent("on" + c, g) } function u(a, c) { this.init(a, c) } function I(a) { try { delete a[ma] } catch (c) { a.removeAttribute && a.removeAttribute(ma) } } function E(a, c, g) { if (c.indexOf(",") >= 0)h(c.split(","), function () { E(a, this, g) }); else { var b = a[ma] || null; b || (a[ma] = ++gb, b = gb); L[b] === d && (L[b] = {}); var t = L[b][c]; t && t.length > 0 ? C(a, c, t[0]) : (L[b][c] = [], L[b].el = a); t = L[b][c]; t.length === 0 && (t[0] = function (c) { var g = c ? new u(a, c) : d; h(t, function (c, b) { c > 0 && b && b.call(a, g) }) }); e(g, t) < 0 && t.push(g); G(a, c, t[0]) } } function T(a, c, g) { if (c && c.indexOf(",") >= 0)h(c.split(","), function () { T(a, this, g) }); else { var b = a[ma] || null; if (b)if (c === d)b in L && (h(L[b], function (c, g) { c != "el" && g.length > 0 && C(a, c, g[0]) }), delete L[b], I(a)); else if (L[b]) { var t = L[b][c]; if (t && t.length > 0) { g === d ? (C(a, c, t[0]), delete L[b][c]) : (h(t, function (a, c) { a > 0 && c === g && t.splice(a, 1) }), t.length == 1 && (C(a, c, t[0]), delete L[b][c])); var k = 0; h(L[b], function () { k++ }); k < 2 && (delete L[b], I(a)) } } } } function qa(a, c) { if (c.indexOf(",") >= 0)h(c.split(","), function () { qa(a, this) }); else { var g = a[ma] || null; if (g) { var b = L[g][c]; if (L[g] && b && b.length > 0)b[0]() } } } function $(a, c, g) { c = /^\d{2,}$/.test(c) ? c : c.toUpperCase().charCodeAt(0); E(a, "keydown", function (b) { b.ctrlKey && b.which == c && !b.shiftKey && !b.altKey && (g.call(a), b.stop()) }) } function M(a) { for (var c = {}, g = /\s*([\w\-]+)\s*:([^;]*)(;|$)/g, b; b = g.exec(a);) { var d = m(b[1].toLowerCase()); b = m(r(b[2])); c[d] = b } return c } function K(a) { for (var c = {}, g = /\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g, b; b = g.exec(a);) { var d = (b[1] || b[2] || b[4] || b[6]).toLowerCase(); c[d] = (b[2] ? b[3] : b[4] ? b[5] : b[7]) || "" } return c } function O(a, c) { return a = /\s+class\s*=/.test(a) ? a.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/, function (a, b, d, k) { return(" " + d + " ").indexOf(" " + c + " ") < 0 ? d === "" ? b + c + k : b + d + " " + c + k : a }) : a.substr(0, a.length - 1) + ' class="' + c + '">' } function Q(a) { var c = ""; h(M(a), function (a, b) { c += a + ":" + b + ";" }); return c } function R(a, c, g, b) { function t(a) { for (var a = a.split("/"), c = [], g = 0, b = a.length; g < b; g++) { var d = a[g]; d == ".." ? c.length > 0 && c.pop() : d !== "" && d != "." && c.push(d) } return"/" + c.join("/") } function k(c, g) { if (a.substr(0, c.length) === c) { for (var d = [], t = 0; t < g; t++)d.push(".."); t = "."; d.length > 0 && (t += "/" + d.join("/")); b == "/" && (t += "/"); return t + a.substr(c.length) } else if (i = /^(.*)\//.exec(c))return k(i[1], ++g) } c = q(c, "").toLowerCase(); a.substr(0, 5) != "data:" && (a = a.replace(/([^:])\/\//g, "$1/")); if (e(c, ["absolute", "relative", "domain"]) < 0)return a; g = g || location.protocol + "//" + location.host; if (b === d)var w = location.pathname.match(/^(\/.*)\//), b = w ? w[1] : ""; var i; if (i = /^(\w+:\/\/[^\/]*)/.exec(a)) { if (i[1] !== g)return a } else if (/^\w+:/.test(a))return a; /^\//.test(a) ? a = g + t(a.substr(1)) : /^\w+:\/\//.test(a) || (a = g + t(b + "/" + a)); c === "relative" ? a = k(g + b, 0).substr(2) : c === "absolute" && a.substr(0, g.length) === g && (a = a.substr(g.length)); return a } function H(a, c, g, b, d) { a == null && (a = ""); var g = g || "", b = q(b, !1), d = q(d, "\t"), k = "xx-small,x-small,small,medium,large,x-large,xx-large".split(","), a = a.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig, function (a, c, g, b) { return c + g.replace(/<(?:br|br\s[^>]*)>/ig, "\n") + b }), a = a.replace(/<(?:br|br\s[^>]*)\s*\/?>\s*<\/p>/ig, "
"), a = a.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/ig, "$1