(function (e, $) { if (window.xheditor)return !1; var I = navigator.userAgent.toLowerCase(), Ba = -1 !== I.indexOf("mobile"), J = e.browser, pa = parseFloat(J.version), h = J.msie, qa = J.mozilla, R = J.safari, Ca = J.opera, eb = -1 < I.indexOf(" adobeair/"), Da = /OS 5(_\d)+ like Mac OS X/i.test(I); e.fn.xheditor = function (h) { if (Ba && !Da)return !1; var o = []; this.each(function () { if (e.nodeName(this, "TEXTAREA"))if (!1 === h) { if (this.xheditor)this.xheditor.remove(), this.xheditor = null } else if (this.xheditor)o.push(this.xheditor); else { var q = /({.*})/.exec(e(this).attr("class")); if (q) { try { q = eval("(" + q[1] + ")") } catch (t) { } h = e.extend({}, q, h) } q = new ra(this, h); if (q.init())this.xheditor = q, o.push(q) } }); 0 === o.length && (o = !1); 1 === o.length && (o = o[0]); return o }; var aa = 0, S = !1, sa = !0, ta = !1, Sa = !1, t, ba, ca, da, K, Ea, ea, Fa, Ga, Ha, A; e("script[src*=xheditor]").each(function () { var e = this.src; if (e.match(/xheditor[^\/]*\.js/i))return A = e.replace(/[\?#].*$/, "").replace(/(^|[\/\\])[^\/]*$/, "$1"), !1 }); if (h) { try { document.execCommand("BackgroundImageCache", !1, !0) } catch (qb) { } (I = e.fn.jquery) && I.match(/^1\.[67]/) && (e.attrHooks.width = e.attrHooks.height = null) } var fb = { 27: "esc", 9: "tab", 32: "space", 13: "enter", 8: "backspace", 145: "scroll", 20: "capslock", 144: "numlock", 19: "pause", 45: "insert", 36: "home", 46: "del", 35: "end", 33: "pageup", 34: "pagedown", 37: "left", 38: "up", 39: "right", 40: "down", 112: "f1", 113: "f2", 114: "f3", 115: "f4", 116: "f5", 117: "f6", 118: "f7", 119: "f8", 120: "f9", 121: "f10", 122: "f11", 123: "f12" }, Ta = "#FFFFFF,#CCCCCC,#C0C0C0,#999999,#666666,#333333,#000000,#FFCCCC,#FF6666,#FF0000,#CC0000,#990000,#660000,#330000,#FFCC99,#FF9966,#FF9900,#FF6600,#CC6600,#993300,#663300,#FFFF99,#FFFF66,#FFCC66,#FFCC33,#CC9933,#996633,#663333,#FFFFCC,#FFFF33,#FFFF00,#FFCC00,#999900,#666600,#333300,#99FF99,#66FF99,#33FF33,#33CC00,#009900,#006600,#003300,#99FFFF,#33FFFF,#66CCCC,#00CCCC,#339999,#336666,#003333,#CCFFFF,#66FFFF,#33CCFF,#3366FF,#3333FF,#000099,#000066,#CCCCFF,#9999FF,#6666CC,#6633FF,#6600CC,#333399,#330099,#FFCCFF,#FF99FF,#CC66CC,#CC33CC,#993399,#663366,#330033".split(","), gb = [{n: "p", t: "\u666e\u901a\u6bb5\u843d"}, {n: "h1", t: "\u6807\u98981"}, {n: "h2", t: "\u6807\u98982"}, {n: "h3", t: "\u6807\u98983"}, {n: "h4", t: "\u6807\u98984"}, {n: "h5", t: "\u6807\u98985"}, {n: "h6", t: "\u6807\u98986"}, {n: "pre", t: "\u5df2\u7f16\u6392\u683c\u5f0f"}, {n: "address", t: "\u5730\u5740"}], hb = [{n: "\u5b8b\u4f53", c: "SimSun"}, { n: "\u4eff\u5b8b\u4f53", c: "FangSong_GB2312" }, {n: "\u9ed1\u4f53", c: "SimHei"}, {n: "\u6977\u4f53", c: "KaiTi_GB2312"}, {n: "\u5fae\u8f6f\u96c5\u9ed1", c: "Microsoft YaHei"}, {n: "Arial"}, {n: "Arial Black"}, {n: "Comic Sans MS"}, {n: "Courier New"}, {n: "System"}, {n: "Times New Roman"}, {n: "Tahoma"}, {n: "Verdana"}], T = [{n: "x-small", s: "10px", t: "\u6781\u5c0f"}, {n: "small", s: "12px", t: "\u7279\u5c0f"}, {n: "medium", s: "16px", t: "\u5c0f"}, {n: "large", s: "18px", t: "\u4e2d"}, {n: "x-large", s: "24px", t: "\u5927"}, {n: "xx-large", s: "32px", t: "\u7279\u5927"}, { n: "-webkit-xxx-large", s: "48px", t: "\u6781\u5927" }], ib = [{s: "\u5de6\u5bf9\u9f50", v: "justifyleft"}, {s: "\u5c45\u4e2d", v: "justifycenter"}, {s: "\u53f3\u5bf9\u9f50", v: "justifyright"}, { s: "\u4e24\u7aef\u5bf9\u9f50", v: "justifyfull" }], jb = [{s: "\u6570\u5b57\u5217\u8868", v: "insertOrderedList"}, {s: "\u7b26\u53f7\u5217\u8868", v: "insertUnorderedList"}], kb = { "default": { name: "\u9ed8\u8ba4", width: 24, height: 24, line: 7, list: { smile: "\u5fae\u7b11", tongue: "\u5410\u820c\u5934", titter: "\u5077\u7b11", laugh: "\u5927\u7b11", sad: "\u96be\u8fc7", wronged: "\u59d4\u5c48", fastcry: "\u5feb\u54ed\u4e86", cry: "\u54ed", wail: "\u5927\u54ed", mad: "\u751f\u6c14", knock: "\u6572\u6253", curse: "\u9a82\u4eba", crazy: "\u6293\u72c2", angry: "\u53d1\u706b", ohmy: "\u60ca\u8bb6", awkward: "\u5c34\u5c2c", panic: "\u60ca\u6050", shy: "\u5bb3\u7f9e", cute: "\u53ef\u601c", envy: "\u7fa1\u6155", proud: "\u5f97\u610f", struggle: "\u594b\u6597", quiet: "\u5b89\u9759", shutup: "\u95ed\u5634", doubt: "\u7591\u95ee", despise: "\u9119\u89c6", sleep: "\u7761\u89c9", bye: "\u518d\u89c1" } } }, ka = { Cut: {t: "\u526a\u5207 (Ctrl+X)"}, Copy: {t: "\u590d\u5236 (Ctrl+C)"}, Paste: {t: "\u7c98\u8d34 (Ctrl+V)"}, Pastetext: {t: "\u7c98\u8d34\u6587\u672c", h: h ? 0 : 1}, Blocktag: {t: "\u6bb5\u843d\u6807\u7b7e", h: 1}, Fontface: { t: "\u5b57\u4f53", h: 1 }, FontSize: {t: "\u5b57\u4f53\u5927\u5c0f", h: 1}, Bold: {t: "\u52a0\u7c97 (Ctrl+B)", s: "Ctrl+B"}, Italic: {t: "\u659c\u4f53 (Ctrl+I)", s: "Ctrl+I"}, Underline: {t: "\u4e0b\u5212\u7ebf (Ctrl+U)", s: "Ctrl+U"}, Strikethrough: {t: "\u5220\u9664\u7ebf"}, FontColor: {t: "\u5b57\u4f53\u989c\u8272", h: 1}, BackColor: {t: "\u80cc\u666f\u989c\u8272", h: 1}, SelectAll: {t: "\u5168\u9009 (Ctrl+A)"}, Removeformat: {t: "\u5220\u9664\u6587\u5b57\u683c\u5f0f"}, Align: {t: "\u5bf9\u9f50", h: 1}, List: {t: "\u5217\u8868", h: 1}, Outdent: {t: "\u51cf\u5c11\u7f29\u8fdb"}, Indent: {t: "\u589e\u52a0\u7f29\u8fdb"}, Link: {t: "\u8d85\u94fe\u63a5 (Ctrl+L)", s: "Ctrl+L", h: 1}, Unlink: {t: "\u53d6\u6d88\u8d85\u94fe\u63a5"}, Anchor: {t: "\u951a\u70b9", h: 1}, Img: {t: "\u56fe\u7247", h: 1}, Flash: {t: "Flash\u52a8\u753b", h: 1}, Media: {t: "\u591a\u5a92\u4f53\u6587\u4ef6", h: 1}, Hr: {t: "\u63d2\u5165\u6c34\u5e73\u7ebf"}, Emot: {t: "\u8868\u60c5", s: "ctrl+e", h: 1}, Table: {t: "\u8868\u683c", h: 1}, Source: {t: "\u6e90\u4ee3\u7801"}, Preview: {t: "\u9884\u89c8"}, Print: {t: "\u6253\u5370 (Ctrl+P)", s: "Ctrl+P"}, Fullscreen: { t: "\u5168\u5c4f\u7f16\u8f91 (Esc)", s: "Esc" }, About: {t: "\u5173\u4e8e xhEditor"} }, Ia = { mini: "Bold,Italic,Underline,Strikethrough,|,Align,List,|,Link,Img", simple: "Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,|,Align,List,Outdent,Indent,|,Img", full: "Cut,Copy,Paste,Pastetext,|,Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,SelectAll,Removeformat,|,Align,List,Outdent,Indent,|,Link,Unlink,Anchor,Img,Flash,Media,Hr,Emot,Table,|,Source,Preview,Print,Fullscreen" }; Ia.mfull = Ia.full.replace(/\|(,Align)/i, "/$1"); var lb = {a: "Link", img: "Img", embed: "Embed"}, mb = {"<": "<", ">": ">", '"': """, "\u00ae": "®", "\u00a9": "©"}, nb = /[<>"\u00ae\u00a9]/g, ra = function (z, o) { function q(a) { var a = a.target, b = lb[a.tagName.toLowerCase()]; b && ("Embed" === b && (b = {"application/x-shockwave-flash": "Flash", "application/x-mplayer2": "Media"}[a.type.toLowerCase()]), d.exec(b)) } function I(a) { if (27 === a.which)return ta ? d.removeModal() : S && d.hidePanel(), !1 } function J() { setTimeout(d.setSource, 10) } function U() { d.getSource() } function Ua(a) { var b, c, f; if (a && (b = a.originalEvent.clipboardData) && (c = b.items) && (f = c[0]) && "file" == f.kind && f.type.match(/^image\//i))return a = f.getAsFile(), b = new FileReader, b.onload = function () { var a = '', a = Va(a); d.pasteHTML(a) }, b.readAsDataURL(a), !1; var i = g.cleanPaste; if (0 === i || x || Ja)return !0; Ja = !0; d.saveBookmark(); var a = h ? "pre" : "div", m = e("<" + a + ' class="xhe-paste">\ufeff\ufeff", l).appendTo(l.body), a = m[0]; b = d.getSel(); c = d.getRng(!0); m.css("top", fa.scrollTop()); h ? (c.moveToElementText(a), c.select()) : (c.selectNodeContents(a), b.removeAllRanges(), b.addRange(c)); setTimeout(function () { var a = 3 === i, b; if (a)b = m.text(); else { var c = []; e(".xhe-paste", l.body).each(function (a, b) { 0 == e(b).find(".xhe-paste").length && c.push(b.innerHTML) }); b = c.join("
") } m.remove(); d.loadBookmark(); if (b = b.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, ""))if (a)d.pasteText(b); else if (b = d.cleanHTML(b), b = d.cleanWord(b), b = d.formatXHTML(b), !g.onPaste || g.onPaste && !1 !== (b = g.onPaste(b)))b = Va(b), d.pasteHTML(b); Ja = !1 }, 0) } function Va(a) { var b = g.localUrlTest, c = g.remoteImgSaveUrl; if (b && c) { var f = [], i = 0, a = a.replace(/(]*?)?(?:\s+src="\s*([^"]+)\s*")(?: [^>]*)?)(\/?>)/ig, function (a, c, d, e, s) { /^(https?|data:image)/i.test(e) && !/_xhe_temp/.test(d) && !b.test(e) && (f[i] = e, d = d.replace(/\s+(width|height)="[^"]*"/ig, "").replace(/\s+src="[^"]*"/ig, ' src="' + ua + 'img/waiting.gif" remoteimg="' + i++ + '"')); return c + d + s }); 0 < f.length && e.post(c, {urls: f.join("|")}, function (a) { a = a.split("|"); e("img[remoteimg]", d.doc).each(function () { var b = e(this); L(b, "src", a[b.attr("remoteimg")]); b.removeAttr("remoteimg") }) }) } return a } function Ka(a) { try { d._exec("styleWithCSS", a, !0) } catch (b) { try { d._exec("useCSS", !a, !0) } catch (c) { } } } function La() { if (Ma && !x) { Ka(!1); try { d._exec("enableObjectResizing", !0, !0) } catch (a) { } if (h)try { d._exec("BackgroundImageCache", !0, !0) } catch (b) { } } } function Ba(a) { if (x || 13 !== a.which || a.shiftKey || a.ctrlKey || a.altKey)return !0; a = d.getParent("p,h1,h2,h3,h4,h5,h6,pre,address,div,li"); if (a.is("li"))return !0; if (g.forcePtag)0 === a.length && d._exec("formatblock", "

"); else return d.pasteHTML("
"), h && 0 < a.length && 2 === d.getRng().parentElement().childNodes.length && d.pasteHTML("
"), !1 } function Na() { !qa && !R && (la && B.height("100%").css("height", B.outerHeight() - n.outerHeight()), h && n.hide().show()) } function Da(a) { a = a.target; if (a.tagName.match(/(img|embed)/i)) { var b = d.getSel(), c = d.getRng(!0); c.selectNode(a); b.removeAllRanges(); b.addRange(c) } } function L(a, b, c) { if (!b)return !1; var d = "_xhe_" + b; c && (va && (c = V(c, va, F)), a.attr(b, F ? V(c, "abs", F) : c).removeAttr(d).attr(d, c)); return a.attr(d) || a.attr(b) } function Oa() { sa && d.hidePanel() } function ob(a) { if (x)return !0; var b = a.which, c = fb[b], b = c ? c : String.fromCharCode(b).toLowerCase(); sKey = ""; sKey += a.ctrlKey ? "ctrl+" : ""; sKey += a.altKey ? "alt+" : ""; sKey += a.shiftKey ? "shift+" : ""; sKey += b; var a = ma[sKey], f; for (f in a)if (f = a[f], e.isFunction(f)) { if (!1 === f.call(d))return !1 } else return d.exec(f), !1 } function M(a, b) { var c = typeof a; return !b ? "undefined" != c : "array" === b && a.hasOwnProperty && a instanceof Array ? !0 : c === b } function V(a, b, c) { if (a.match(/^(\w+):\/\//i) && !a.match(/^https?:/i) || /^#/i.test(a) || /^data:/i.test(a))return a; var d = c ? e('')[0] : location, c = d.protocol, i = d.host, m = d.hostname, j = d.port, d = d.pathname.replace(/\\/g, "/").replace(/[^\/]+$/i, ""); "" === j && (j = "80"); "" === d ? d = "/" : "/" !== d.charAt(0) && (d = "/" + d); a = e.trim(a); "abs" !== b && (a = a.replace(RegExp(c + "\\/\\/" + m.replace(/\./g, "\\.") + "(?::" + j + ")" + ("80" === j ? "?" : "") + "(/|$)", "i"), "/")); "rel" === b && (a = a.replace(RegExp("^" + d.replace(/([\/\.\+\[\]\(\)])/g, "\\$1"), "i"), "")); if ("rel" !== b && (a.match(/^(https?:\/\/|\/)/i) || (a = d + a), "/" === a.charAt(0))) { for (var m = [], a = a.split("/"), p = a.length, d = 0; d < p; d++)j = a[d], ".." === j ? m.pop() : "" !== j && "." !== j && m.push(j); "" === a[p - 1] && m.push(""); a = "/" + m.join("/") } "abs" === b && !a.match(/^https?:\/\//i) && (a = c + "//" + i + a); return a = a.replace(/(https?:\/\/[^:\/?#]+):80(\/|$)/i, "$1$2") } function Wa(a, b) { if ("*" === b || a.match(RegExp(".(" + b.replace(/,/g, "|") + ")$", "i")))return !0; alert("\u4e0a\u4f20\u6587\u4ef6\u6269\u5c55\u540d\u5fc5\u9700\u4e3a: " + b); return !1 } function Xa(a) { var b = Math.floor(Math.log(a) / Math.log(1024)); return (a / Math.pow(1024, Math.floor(b))).toFixed(2) + "Byte,KB,MB,GB,TB,PB".split(",")[b] } function N() { return !1 } var d = this, G = e(z), Ya = G.closest("form"), n, B, W, fa, l, ga, ha, Ma = !1, x = !1, la = !1, Ja = !1, Pa, na = !1, Za = "", v = null, wa, oa = !1, Qa = !1, ia = null, X = null, O = 0, g = d.settings = e.extend({}, ra.settings, o), xa = g.plugins, ya = []; xa && (ka = e.extend({}, ka, xa), e.each(xa, function (a) { ya.push(a) }), ya = ya.join(",")); if (g.tools.match(/^\s*(m?full|simple|mini)\s*$/i)) { var $a = Ia[e.trim(g.tools)]; g.tools = g.tools.match(/m?full/i) && xa ? $a.replace("Table", "Table," + ya) : $a } g.tools.match(/(^|,)\s*About\s*(,|$)/i) || (g.tools += ",About"); g.tools = g.tools.split(","); if (g.editorRoot)A = g.editorRoot; !1 === eb && (A = V(A, "abs")); if (g.urlBase)g.urlBase = V(g.urlBase, "abs"); var ab = "xheCSS_" + g.skin, ja = "xhe" + aa + "_container", bb = "xhe" + aa + "_Tool", cb = "xhe" + aa + "_iframearea", db = "xhe" + aa + "_iframe", za = "xhe" + aa + "_fixffcursor", P = "", Q = "", ua = A + "xheditor_skin/" + g.skin + "/", Aa = kb, va = g.urlType, F = g.urlBase, Y = g.emotPath, Y = Y ? Y : A + "xheditor_emot/", Ra = "", Aa = e.extend({}, Aa, g.emots), Y = V(Y, "rel", F ? F : null); (na = g.showBlocktag) && (Q += " showBlocktag"); var ma = []; this.init = function () { 0 === e("#" + ab).length && e("head").append(''); var a = G.outerWidth(), b = G.outerHeight(), a = g.width || z.style.width || (10 < a ? a : 0); O = g.height || z.style.height || (10 < b ? b : 150); M(a, "number") && (a += "px"); M(O, "string") && (O = O.replace(/[^\d]+/g, "")); var b = g.background || z.style.background, c = [''], f, i, m = /\||\//i; e.each(g.tools, function (a, b) { b.match(m) && c.push(''); if ("|" === b)c.push(''); else if ("/" === b)c.push("
"); else { f = ka[b]; if (!f)return; i = f.c ? f.c : "xheIcon xheBtn" + b; c.push('
' + f.t + ""); f.s && d.addShortcuts(f.s, b) } b.match(m) && c.push('') }); c.push('
'); G.after(e('')); n = e("#" + bb); B = e("#" + cb); P = ''; if (a = g.loadCSS)if (M(a, "array"))for (var j in a)P += ''; else P = a.match(/\s*]*?)?>[\s\S]+?<\/style>\s*/i) ? P + a : P + (''); j = "" + P + "\u53ef\u89c6\u5316\u7f16\u8f91\u5668,alt+1\u52309\u952e,\u5207\u6362\u5230\u5de5\u5177\u533a,tab\u952e,\u9009\u62e9\u6309\u94ae,esc\u952e,\u8fd4\u56de\u7f16\u8f91 " + (g.readTip ? g.readTip : "") + ""; b && (j += ""); j += ''; d.win = W = e("#" + db)[0].contentWindow; fa = e(W); try { this.doc = l = W.document, ga = e(l), l.open(), l.write(j), l.close(), h ? l.body.contentEditable = "true" : l.designMode = "On" } catch (p) { } setTimeout(La, 300); d.setSource(); W.setInterval = null; n.append(c.join("")).bind("mousedown contextmenu", N).click(function (a) { var b = e(a.target).closest("a"); b.is(".xheEnabled") && (clearTimeout(wa), n.find("a").attr("tabindex", "-1"), v = a, d.exec(b.attr("cmd"))); return !1 }); n.find(".xheButton").hover(function (a) { var b = e(this), c = g.hoverExecDelay, k = X; X = null; if (-1 === c || oa || !b.is(".xheEnabled"))return !1; if (k && 10 < k)return oa = !0, setTimeout(function () { oa = !1 }, 100), !1; var f = b.attr("cmd"); if (1 !== ka[f].h)return d.hidePanel(), !1; Qa && (c = 0); 0 <= c && (wa = setTimeout(function () { v = a; ia = {x: v.clientX, y: v.clientY}; d.exec(f) }, c)) }, function () { ia = null; wa && clearTimeout(wa) }).mousemove(function (a) { if (ia) { var b = a.clientX - ia.x, c = a.clientY - ia.y; if (1 < Math.abs(b) || 1 < Math.abs(c))0 < b && 0 < c ? (b = Math.round(Math.atan(c / b) / 0.017453293), X = X ? (X + b) / 2 : b) : X = null, ia = {x: a.clientX, y: a.clientY} } }); t = e("#xhePanel"); ba = e("#xheShadow"); ca = e("#xheCntLine"); 0 === t.length && (t = e('

').mousedown(function (a) { a.stopPropagation() }), ba = e('
'), ca = e('
'), setTimeout(function () { e(document.body).append(t).append(ba).append(ca) }, 10)); e("#" + ja).show(); G.hide(); B.css("height", O - n.outerHeight()); h & 8 > pa && setTimeout(function () { B.css("height", O - n.outerHeight()) }, 1); G.focus(d.focus); Ya.submit(U).bind("reset", J); g.submitID && e("#" + g.submitID).mousedown(U); e(window).bind("unload beforeunload", U).bind("resize", Na); e(document).mousedown(Oa); Sa || (e(document).keydown(I), Sa = !0); fa.focus(function () { g.focus && g.focus() }).blur(function () { g.blur && g.blur() }); R && fa.click(Da); ga.mousedown(Oa).keydown(ob).keypress(Ba).dblclick(q).bind("mousedown click", function (a) { G.trigger(a.type) }); if (h) { ga.keydown(function (a) { var b = d.getRng(); if (8 === a.which && b.item)return e(b.item(0)).remove(), !1 }); var w = function (a) { var a = e(a.target), b; (b = a.css("width")) && a.css("width", "").attr("width", b.replace(/[^0-9%]+/g, "")); (b = a.css("height")) && a.css("height", "").attr("height", b.replace(/[^0-9%]+/g, "")) }; ga.bind("controlselect", function (a) { a = a.target; e.nodeName(a, "IMG") && e(a).unbind("resizeend", w).bind("resizeend", w) }) } ga.keydown(function (a) { var b = a.which; if (a.altKey && 49 <= b && 57 >= b)return n.find("a").attr("tabindex", "0"), n.find(".xheGStart").eq(b - 49).next().find("a").focus(), l.title = "\ufeff\ufeff", !1 }).click(function () { n.find("a").attr("tabindex", "-1") }); n.keydown(function (a) { var b = a.which; if (27 == b)n.find("a").attr("tabindex", "-1"), d.focus(); else if (a.altKey && 49 <= b && 57 >= b)return n.find(".xheGStart").eq(b - 49).next().find("a").focus(), !1 }); j = e(l.documentElement); Ca ? j.bind("keydown", function (a) { a.ctrlKey && 86 === a.which && Ua() }) : j.bind(h ? "beforepaste" : "paste", Ua); g.disableContextmenu && j.bind("contextmenu", N); g.html5Upload && j.bind("dragenter dragover", function (a) { var b; if ((b = a.originalEvent.dataTransfer.types) && -1 !== e.inArray("Files", b))return !1 }).bind("drop", function (a) { var a = a.originalEvent.dataTransfer, b; if (a && (b = a.files) && 0 < b.length) { var c, k, a = ["Link", "Img", "Flash", "Media"], f = [], j; for (c in a)k = a[c], g["up" + k + "Url"] && g["up" + k + "Url"].match(/^[^!].*/i) && f.push(k + ":," + g["up" + k + "Ext"]); if (0 === f.length)return !1; j = f.join(","); k = function (a) { var b, d; for (c = 0; c < a.length; c++)if (b = a[c].name.replace(/.+\./, ""), b = j.match(RegExp("(\\w+):[^:]*," + b + "(?:,|$)", "i")))if (d) { if (d !== b[1])return 2 } else d = b[1]; else return 1; return d }(b); 1 === k ? alert("\u4e0a\u4f20\u6587\u4ef6\u7684\u6269\u5c55\u540d\u5fc5\u9700\u4e3a\uff1a" + j.replace(/\w+:,/g, "")) : 2 === k ? alert("\u6bcf\u6b21\u53ea\u80fd\u62d6\u653e\u4e0a\u4f20\u540c\u4e00\u7c7b\u578b\u6587\u4ef6") : k && d.startUpload(b, g["up" + k + "Url"], "*", function (a) { var b = [], c; (c = g.onUpload) && c(a); for (var f = 0, j = a.length; f < j; f++)c = a[f], url = M(c, "string") ? c : c.url, "!" === url.substr(0, 1) && (url = url.substr(1)), b.push(url); d.exec(k); e("#xhe" + k + "Url").val(b.join(" ")); e("#xheSave").click() }); return !1 } }); (j = g.shortcuts) && e.each(j, function (a, b) { d.addShortcuts(a, b) }); aa++; Ma = !0; g.fullscreen ? d.toggleFullscreen() : g.sourceMode && setTimeout(d.toggleSource, 20); return !0 }; this.remove = function () { d.hidePanel(); U(); G.unbind("focus", d.focus); Ya.unbind("submit", U).unbind("reset", J); g.submitID && e("#" + g.submitID).unbind("mousedown", U); e(window).unbind("unload beforeunload", U).unbind("resize", Na); e(document).unbind("mousedown", Oa); e("#" + ja).remove(); e("#" + za).remove(); G.show(); Ma = !1 }; this.saveBookmark = function () { if (!x) { d.focus(); var a = d.getRng(), a = a.cloneRange ? a.cloneRange() : a; ha = {top: fa.scrollTop(), rng: a} } }; this.loadBookmark = function () { if (!x && ha) { d.focus(); var a = ha.rng; if (h)a.select(); else { var b = d.getSel(); b.removeAllRanges(); b.addRange(a) } fa.scrollTop(ha.top); ha = null } }; this.focus = function () { x ? e("#sourceCode", l).focus() : W.focus(); if (h) { var a = d.getRng(); a.parentElement && a.parentElement().ownerDocument !== l && d.setTextCursor() } return !1 }; this.setTextCursor = function (a) { var b = d.getRng(!0), c = l.body; if (h)b.moveToElementText(c); else { for (var e = a ? "lastChild" : "firstChild"; 3 != c.nodeType && c[e];)c = c[e]; b.selectNode(c) } b.collapse(a ? !1 : !0); h ? b.select() : (a = d.getSel(), a.removeAllRanges(), a.addRange(b)) }; this.getSel = function () { return l.selection ? l.selection : W.getSelection() }; this.getRng = function (a) { var b, c; try { a || (b = d.getSel(), c = b.createRange ? b.createRange() : 0 < b.rangeCount ? b.getRangeAt(0) : null), c || (c = l.body.createTextRange ? l.body.createTextRange() : l.createRange()) } catch (e) { } return c }; this.getParent = function (a) { var b = d.getRng(), c; h ? c = b.item ? b.item(0) : b.parentElement() : (c = b.commonAncestorContainer, b.collapsed || b.startContainer === b.endContainer && 2 > b.startOffset - b.endOffset && b.startContainer.hasChildNodes() && (c = b.startContainer.childNodes[b.startOffset])); a = a ? a : "*"; c = e(c); c.is(a) || (c = e(c).closest(a)); return c }; this.getSelect = function (a) { var b = d.getSel(), c = d.getRng(), f = !0, f = !c || c.item ? !1 : !b || 0 === c.boundingWidth || c.collapsed; if ("text" === a)return f ? "" : c.text || (b.toString ? b.toString() : ""); c.cloneContents ? (a = e("
"), (c = c.cloneContents()) && a.append(c), c = a.html()) : c = M(c.item) ? c.item(0).outerHTML : M(c.htmlText) ? c.htmlText : c.toString(); f && (c = ""); c = d.processHTML(c, "read"); c = d.cleanHTML(c); return c = d.formatXHTML(c) }; this.pasteHTML = function (a, b) { if (x)return !1; d.focus(); var a = d.processHTML(a, "write"), c = d.getSel(), f = d.getRng(); if (b !== $) { if (f.item) { var i = f.item(0), f = d.getRng(!0); f.moveToElementText(i); f.select() } f.collapse(b) } a += "<" + (h ? "img" : "span") + ' id="_xhe_temp" width="0" height="0" />'; if (f.insertNode) { if (0 < e(f.startContainer).closest("style,script").length)return !1; f.deleteContents(); f.insertNode(f.createContextualFragment(a)) } else"control" === c.type.toLowerCase() && (c.clear(), f = d.getRng()), f.pasteHTML(a); var i = e("#_xhe_temp", l), m = i[0]; h ? (f.moveToElementText(m), f.select()) : (f.selectNode(m), c.removeAllRanges(), c.addRange(f)); i.remove() }; this.pasteText = function (a, b) { a || (a = ""); a = d.domEncode(a); a = a.replace(/\r?\n/g, "
"); d.pasteHTML(a, b) }; this.appendHTML = function (a) { if (x)return !1; d.focus(); a = d.processHTML(a, "write"); e(l.body).append(a); d.setTextCursor(!0) }; this.domEncode = function (a) { return a.replace(nb, function (a) { return mb[a] }) }; this.setSource = function (a) { ha = null; if ("string" !== typeof a && "" !== a)a = z.value; x ? e("#sourceCode", l).val(a) : (g.beforeSetSource && (a = g.beforeSetSource(a)), a = d.cleanHTML(a), a = d.formatXHTML(a), a = d.processHTML(a, "write"), h ? (l.body.innerHTML = '' + a, e("#_xhe_temp", l).remove()) : l.body.innerHTML = a) }; this.processHTML = function (a, b) { if ("write" === b) { a = a.replace(/(<(\/?)(\w+))((?:\s+[\w\-:]+\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))*)\s*((\/?)>)/g, function (a, b, c, d, e, f, i) { d = d.toLowerCase(); qa ? "strong" === d ? d = "b" : "em" === d && (d = "i") : R && ("strong" === d ? (d = "span", c || (e += ' class="Apple-style-span" style="font-weight: bold;"')) : "em" === d ? (d = "span", c || (e += ' class="Apple-style-span" style="font-style: italic;"')) : "u" === d ? (d = "span", c || (e += ' class="Apple-style-span" style="text-decoration: underline;"')) : "strike" === d && (d = "span", c || (e += ' class="Apple-style-span" style="text-decoration: line-through;"'))); var k, y = ""; if ("del" === d)d = "strike"; else if ("img" === d)e = e.replace(/\s+emot\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i, function (a, b) { k = b.match(/^(["']?)(.*)\1/)[2]; k = k.split(","); k[1] || (k[1] = k[0], k[0] = ""); "default" === k[0] && (k[0] = ""); return g.emotMark ? a : "" }); else if ("a" === d)!e.match(/ href=[^ ]/i) && e.match(/ name=[^ ]/i) && (y += " xhe-anchor"), i && (f = ">"); else if ("table" === d && !c && (a = e.match(/\s+border\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i), !a || a[1].match(/^(["']?)\s*0\s*\1$/)))y += " xhe-border"; var Z, e = e.replace(/\s+([\w\-:]+)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/g, function (a, b, c) { b = b.toLowerCase(); c = c.match(/^(["']?)(.*)\1/)[2]; aft = ""; if (h && b.match(/^(disabled|checked|readonly|selected)$/) && c.match(/^(false|0)$/i) || "img" === d && k && "src" === b)return ""; b.match(/^(src|href)$/) && (aft = " _xhe_" + b + '="' + c + '"', F && (c = V(c, "abs", F))); y && "class" === b && (c += " " + y, y = ""); R && "style" === b && "span" === d && c.match(/(^|;)\s*(font-family|font-size|color|background-color)\s*:\s*[^;]+\s*(;|$)/i) && (Z = !0); return " " + b + '="' + c + '"' + aft }); k && (a = Y + (k[0] ? k[0] : "default") + "/" + k[1] + ".gif", e += ' src="' + a + '" _xhe_src="' + a + '"'); Z && (e += ' class="Apple-style-span"'); y && (e += ' class="' + y + '"'); return "<" + c + d + e + f }); h && (a = a.replace(/'/ig, "'")); if (!R)var c = function (a, b, c, d, e, f) { var b = "", i, k; (i = d.match(/font-family\s*:\s*([^;"]+)/i)) && (b += ' face="' + i[1] + '"'); if (i = d.match(/font-size\s*:\s*([^;"]+)/i)) { i = i[1].toLowerCase(); for (var y = 0; y < T.length; y++)if (i === T[y].n || i === T[y].s) { k = y + 1; break } k && (b += ' size="' + k + '"', d = d.replace(/(^|;)(\s*font-size\s*:\s*[^;"]+;?)+/ig, "$1")) } if (k = d.match(/(?:^|[\s;])color\s*:\s*([^;"]+)/i)) { if (i = k[1].match(/\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i)) { k[1] = "#"; for (y = 1; 3 >= y; y++)k[1] += ("0" + (i[y] - 0).toString(16)).slice(-2) } k[1] = k[1].replace(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i, "#$1$1$2$2$3$3"); b += ' color="' + k[1] + '"' } d = d.replace(/(^|;)(\s*(font-family|color)\s*:\s*[^;"]+;?)+/ig, "$1"); return "" !== b ? (d && (b += ' style="' + d + '"'), "" + f + "") : a }, a = a.replace(/<(span)(\s+[^>]*?)?\s+style\s*=\s*"((?:[^"]*?;)?\s*(?:font-family|font-size|color)\s*:[^"]*)"( [^>]*)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?<\/\1>)*?)<\/\1>/ig, c), a = a.replace(/<(span)(\s+[^>]*?)?\s+style\s*=\s*"((?:[^"]*?;)?\s*(?:font-family|font-size|color)\s*:[^"]*)"( [^>]*)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?)<\/\1>/ig, c), a = a.replace(/<(span)(\s+[^>]*?)?\s+style\s*=\s*"((?:[^"]*?;)?\s*(?:font-family|font-size|color)\s*:[^"]*)"( [^>]*)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig, c); a = a.replace(/<(td|th)(\s+[^>]*?)?>(\s| )*<\/\1>/ig, "<$1$2>" + (h ? "" : "
") + "") } else { if (R)for (var d = [{ r: /font-weight\s*:\s*bold;?/ig, t: "strong" }, {r: /font-style\s*:\s*italic;?/ig, t: "em"}, {r: /text-decoration\s*:\s*underline;?/ig, t: "u"}, {r: /text-decoration\s*:\s*line-through;?/ig, t: "strike"}], c = function (a, b, c, e, i) { for (var a = (c ? c : "") + (e ? e : ""), g = [], D = [], k, c = 0; c < d.length; c++)b = d[c].r, k = d[c].t, a = a.replace(b, function () { g.push("<" + k + ">"); D.push(""); return "" }); a = a.replace(/\s+style\s*=\s*"\s*"/i, ""); return (a ? "" : "") + g.join("") + i + D.join("") + (a ? "" : "") }, e = 0; 2 > e; e++)a = a.replace(/<(span)(\s+[^>]*?)?\s+class\s*=\s*"Apple-style-span"(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?<\/\1>)*?)<\/\1>/ig, c), a = a.replace(/<(span)(\s+[^>]*?)?\s+class\s*=\s*"Apple-style-span"(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?)<\/\1>/ig, c), a = a.replace(/<(span)(\s+[^>]*?)?\s+class\s*=\s*"Apple-style-span"(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig, c); a = a.replace(/(<(\w+))((?:\s+[\w\-:]+\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))*)\s*(\/?>)/g, function (a, b, c, d, e) { var c = c.toLowerCase(), f, d = d.replace(/\s+_xhe_(?:src|href)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i, function (a, b) { f = b.match(/^(["']?)(.*)\1/)[2]; return "" }); f && va && (f = V(f, va, F)); d = d.replace(/\s+([\w\-:]+)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/g, function (a, b, c) { b = b.toLowerCase(); c = c.match(/^(["']?)(.*)\1/)[2].replace(/"/g, "'"); if ("class" === b) { if (c.match(/^["']?(apple|webkit)/i))return ""; c = c.replace(/\s?xhe-[a-z]+/ig, ""); if ("" === c)return "" } else { if (b.match(/^((_xhe_|_moz_|_webkit_)|jquery\d+)/i))return ""; if (f && b.match(/^(src|href)$/i))return " " + b + '="' + f + '"'; "style" === b && (c = c.replace(/(^|;)\s*(font-size)\s*:\s*([a-z-]+)\s*(;|$)/i, function (a, b, c, d, e) { for (var f, i = 0; i < T.length; i++)if (a = T[i], d === a.n) { f = a.s; break } return b + c + ":" + f + e })) } return " " + b + '="' + c + '"' }); "img" === c && !d.match(/\s+alt\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i) && (d += ' alt=""'); return b + d + e }); a = a.replace(/(<(td|th)(?:\s+[^>]*?)?>)\s*([\s\S]*?)()?\s*<\/\2>/ig, function (a, b, c, d) { return b + (d ? d : " ") + "" }); a = a.replace(/^\s*(?:<(p|div)(?:\s+[^>]*?)?>)?\s*(]*?)?>\s*<\/span>|]*?)?>| )*\s*(?:<\/\1>)?\s*$/i, "") } return a = a.replace(/(]*?)?>)([\s\S]+?)(<\/pre>)/gi, function (a, b, c, d) { return b + c.replace(//ig, "\r\n") + d }) }; this.getSource = function (a) { var b, c = g.beforeGetSource; x ? (b = e("#sourceCode", l).val(), c || (b = d.formatXHTML(b, !1))) : (b = d.processHTML(l.body.innerHTML, "read"), b = d.cleanHTML(b), b = d.formatXHTML(b, a), c && (b = c(b))); return z.value = b }; this.cleanWord = function (a) { var b = g.cleanPaste; if (0 < b && 3 > b && /mso(-|normal)|WordDocument|]*?x:str|\s+class\s*=\s*"?xl[67]\d"/i.test(a)) { a = a.replace(/<\!--[\s\S]*?--\>||]*?)?>[\s\S]*?<\/style>/ig, ""); a = a.replace(/\r?\n/ig, ""); h ? (a = a.replace(/]*)?>[\s\S]*<\/v:shapetype>/ig, ""), a = a.replace(/]+)?>[\s\S]*?]+)?>\s*<\/v:imagedata>[\s\S]*?<\/v:shape>/ig, function (a, b, c) { if (a = c.match(/\s+src\s*=\s*("[^"]+"|'[^']+'|[^>\s]+)/i)) { a[1].match(/^(["']?)(.*)\1/); c = '\s]+)/i))a = a[1].match(/^(["']?)(.*)\1/)[2], c += ' style="' + a + '"'; return c + " />" } return "" })) : a = a.replace(/]*(v:shapes|msohtmlclip)[^<>]*)\/?>/ig, function (a, b) { var c, d = '" }); for (var a = a.replace(/(<(\/?)([\w\-:]+))((?:\s+[\w\-:]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))?)*)\s*(\/?>)/g, function (a, c, d, e, f, g) { e = e.toLowerCase(); if (e.match(/^(link)$/) && f.match(/file:\/\//i) || e.match(/:/) || "span" === e && 2 === b)return ""; d || (f = f.replace(/\s([\w\-:]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^>\s]+))?/ig, function (a, c, d) { c = c.toLowerCase(); if (/:/.test(c))return ""; d = d.match(/^(["']?)(.*)\1/)[2]; if (1 === b)switch (e) { case "p": if ("style" === c)return (d = d.replace(/"|"/ig, "'").replace(/\s*([^:]+)\s*:\s*(.*?)(;|$)/ig, function (a, b, c) { return /^(text-align)$/i.test(b) ? b + ":" + c + ";" : "" }).replace(/^\s+|\s+$/g, "")) ? " " + c + '="' + d + '"' : ""; break; case "span": if ("style" === c)return (d = d.replace(/"|"/ig, "'").replace(/\s*([^:]+)\s*:\s*(.*?)(;|$)/ig, function (a, b, c) { return /^(color|background|font-size|font-family)$/i.test(b) ? b + ":" + c + ";" : "" }).replace(/^\s+|\s+$/g, "")) ? " " + c + '="' + d + '"' : ""; break; case "table": if (c.match(/^(cellspacing|cellpadding|border|width)$/i))return a; break; case "td": if (c.match(/^(rowspan|colspan)$/i))return a; if ("style" === c)return (d = d.replace(/"|"/ig, "'").replace(/\s*([^:]+)\s*:\s*(.*?)(;|$)/ig, function (a, b, c) { return /^(width|height)$/i.test(b) ? b + ":" + c + ";" : "" }).replace(/^\s+|\s+$/g, "")) ? " " + c + '="' + d + '"' : ""; break; case "a": if (c.match(/^(href)$/i))return a; break; case "font": case "img": return a } else if (2 === b)switch (e) { case "td": if (c.match(/^(rowspan|colspan)$/i))return a; break; case "img": return a } return "" })); return c + f + g }), c = 0; 3 > c; c++)a = a.replace(/<([^\s>]+)(\s+[^>]*)?>\s*<\/\1>/g, ""); for (var d = function (a, b, c) { return c }, c = 0; 3 > c; c++)a = a.replace(/<(span|a)>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?<\/\1>)*?)<\/\1>/ig, d); for (c = 0; 3 > c; c++)a = a.replace(/<(span|a)>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?)<\/\1>/ig, d); for (c = 0; 3 > c; c++)a = a.replace(/<(span|a)>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig, d); for (c = 0; 3 > c; c++)a = a.replace(/]+)>]+)>/ig, function (a, b, c) { return "" }); a = a.replace(/(<(\/?)(tr|td)(?:\s+[^>]+)?>)[^<>]+/ig, function (a, b, c, d) { return !c && /^td$/i.test(d) ? a : b }) } return a }; this.cleanHTML = function (a) { var a = a.replace(/]*?)?>/ig, ""), b, a = a.replace(/]*?)?>([\s\S]*?)<\/head>/i, function (a, d) { b = d.match(/<(script|style)(\s+[^>]*?)?>[\s\S]*?<\/\1>/ig); return "" }); b && (a = b.join("") + a); a = a.replace(/<\??xml(:\w+)?(\s+[^>]*?)?>([\s\S]*?<\/xml>)?/ig, ""); g.internalScript || (a = a.replace(/]*?)?>[\s\S]*?<\/script>/ig, "")); g.internalStyle || (a = a.replace(/]*?)?>[\s\S]*?<\/style>/ig, "")); if (!g.linkTag || !g.inlineScript || !g.inlineStyle)a = a.replace(/(<(\w+))((?:\s+[\w-]+\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))*)\s*(\/?>)/ig, function (a, b, d, e, j) { if (!g.linkTag && "link" === d.toLowerCase())return ""; g.inlineScript || (e = e.replace(/\s+on(?:click|dblclick|mouse(down|up|move|over|out|enter|leave|wheel)|key(down|press|up)|change|select|submit|reset|blur|focus|load|unload)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/ig, "")); g.inlineStyle || (e = e.replace(/\s+(style|class)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/ig, "")); return b + e + j }); return a = a.replace(/<\/(strong|b|u|strike|em|i)>((?:\s|| )*?)<\1(\s+[^>]*?)?>/ig, "$2") }; this.formatXHTML = function (a, b) { function c(a) { for (var b = {}, a = a.split(","), c = 0; c < a.length; c++)b[a[c]] = !0; return b } function e(a) { var a = a.toLowerCase(), b = o[a]; return b ? b : a } function i(a, b, c) { if (k[a])for (; E.last() && y[E.last()];)g(E.last()); Z[a] && E.last() === a && g(a); (c = D[a] || !!c) || E.push(a); var d = []; d.push("<" + a); b.replace(x, function (a, b, c, e, f) { b = b.toLowerCase(); d.push(" " + b + '="' + (c ? c : e ? e : f ? f : l[b] ? b : "").replace(/"/g, "'") + '"') }); d.push((c ? " /" : "") + ">"); w(d.join(""), a, !0); "pre" === a && (B = !0) } function g(a) { if (a)for (b = E.length - 1; 0 <= b && !(E[b] === a); b--); else var b = 0; if (0 <= b) { for (var c = E.length - 1; c >= b; c--)w("", E[c]); E.length = b } "pre" === a && (B = !1, v--) } function j(a) { w(d.domEncode(a)) } function p(a) { H.push(a.replace(/^[\s\r\n]+|[\s\r\n]+$/g, "")) } function w(a, c, d) { B || (a = a.replace(/(\t*\r?\n\t*)+/g, "")); if (!B && !0 === b)if (a.match(/^\s*$/))H.push(a); else { var e = k[c]; e ? (d && v++, "" === A && v--) : A && v++; ((e ? c : "") !== A || e) && s(); H.push(a); "br" === c && s(); e && (D[c] || !d) && v--; A = e ? c : "" } else H.push(a) } function s() { H.push("\r\n"); if (0 < v)for (var a = v; a--;)H.push("\t") } function r(a, b, c, d) { if (!c)return d; var e = "", c = c.replace(/ face\s*=\s*"\s*([^"]*)\s*"/i, function (a, b) { b && (e += "font-family:" + b + ";"); return "" }), c = c.replace(/ size\s*=\s*"\s*(\d+)\s*"/i, function (a, b) { e += "font-size:" + T[(7 < b ? 7 : 1 > b ? 1 : b) - 1].s + ";"; return "" }), c = c.replace(/ color\s*=\s*"\s*([^"]*)\s*"/i, function (a, b) { b && (e += "color:" + b + ";"); return "" }), c = c.replace(/ style\s*=\s*"\s*([^"]*)\s*"/i, function (a, b) { b && (e += b); return "" }); return (c += ' style="' + e + '"') ? "" + d + "" : d } var D = c("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed"), k = c("address,applet,blockquote,button,center,dd,dir,div,dl,dt,fieldset,form,frameset,h1,h2,h3,h4,h5,h6,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,p,pre,table,tbody,td,tfoot,th,thead,tr,ul,script"), y = c("a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"), Z = c("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"), l = c("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"), h = c("script,style"), o = { b: "strong", i: "em", s: "del", strike: "del" }, n = /<(?:\/([^\s>]+)|!([^>]*?)|([\w\-:]+)((?:"[^"]*"|'[^']*'|[^"'<>])*)\s*(\/?))>/g, x = /\s*([\w\-:]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s]+)))?/g, H = [], E = []; E.last = function () { return this[this.length - 1] }; for (var u, C, q = 0, t, z, v = -1, A = "body", B = !1; u = n.exec(a);) { C = u.index; C > q && (q = a.substring(q, C), t ? z.push(q) : j(q)); q = n.lastIndex; if (C = u[1])if (C = e(C), t && C === t && (p(z.join("")), z = t = null), !t) { g(C); continue } t ? z.push(u[0]) : (C = u[3]) ? (C = e(C), i(C, u[4], u[5]), h[C] && (t = C, z = [])) : u[2] && H.push(u[0]) } a.length > q && j(a.substring(q, a.length)); g(); a = H.join(""); H = null; a = a.replace(/<(font)(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?<\/\1>)*?)<\/\1>/ig, r); a = a.replace(/<(font)(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?)<\/\1>/ig, r); a = a.replace(/<(font)(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig, r); return a = a.replace(/^(\s*\r?\n)+|(\s*\r?\n)+$/g, "") }; this.toggleShowBlocktag = function (a) { na !== a && (na = !na, a = e(l.body), na ? (Q += " showBlocktag", a.addClass("showBlocktag")) : (Q = Q.replace(" showBlocktag", ""), a.removeClass("showBlocktag"))) }; this.toggleSource = function (a) { if (x !== a) { n.find("[cmd=Source]").toggleClass("xheEnabled").toggleClass("xheActive"); var b = l.body, c = e(b), f, i, a = 0, g = ""; if (x)f = d.getSource(), c.html("").removeAttr("scroll").attr("class", "editMode" + Q), h ? b.contentEditable = "true" : l.designMode = "On", qa && (d._exec("inserthtml", "-"), e("#" + za).show().focus().hide()), g = "\u6e90\u4ee3\u7801"; else { d.pasteHTML('', !0); f = d.getSource(!0); a = f.indexOf(''); if (!Ca)a = f.substring(0, a).replace(/\r/g, "").length; f = f.replace(/(\r?\n\s*|)<\/span>(\s*\r?\n|)/, function (a, b, c) { return b && c ? "\r\n" : b + c }); h ? b.contentEditable = "false" : l.designMode = "Off"; c.attr("scroll", "no").attr("class", "sourceMode").html('