📄 fckeditorcode_ie.js
字号:
o.Source = A;o.Params = D || [];o.Listener = function (ev) {return C.apply(o.Source, [ev].concat(o.Params));};if (FCK.IECleanup) {FCK.IECleanup.AddItem(null, function () {o.Source = null;o.Params = null;});}A.attachEvent("on" + B, o.Listener);A = null;D = null;};FCKTools.GetViewPaneSize = function (A) {var B;var C = A.document.documentElement;if (C && C.clientWidth) {B = C;} else {B = top.document.body;}if (B) {return {Width:B.clientWidth, Height:B.clientHeight};} else {return {Width:0, Height:0};}};FCKTools.SaveStyles = function (A) {var B = new Object();if (A.className.length > 0) {B.Class = A.className;A.className = "";}var C = A.style.cssText;if (C.length > 0) {B.Inline = C;A.style.cssText = "";}return B;};FCKTools.RestoreStyles = function (A, B) {A.className = B.Class || "";A.style.cssText = B.Inline || "";};FCKTools.RegisterDollarFunction = function (A) {A.$ = A.document.getElementById;};FCKTools.AppendElement = function (A, B) {return A.appendChild(this.GetElementDocument(A).createElement(B));};var FCKeditorAPI;function InitializeAPI() {if (!(FCKeditorAPI = window.parent.FCKeditorAPI)) {var sScript = " var FCKeditorAPI={ Version:'2.3.1', VersionBuild:'1062', __Instances:new Object(), GetInstance:function(instanceName){ return this.__Instances[instanceName];}, _FunctionQueue:{ Functions:new Array(), IsRunning:false, Add:function(functionToAdd){ this.Functions.push(functionToAdd); if (!this.IsRunning) this.StartNext();}, StartNext:function(){ var aQueue=this.Functions; if (aQueue.length>0){ this.IsRunning=true; aQueue[0].call();} else this.IsRunning=false;}, Remove:function(func){ var aQueue=this.Functions; var i=0,fFunc; while(fFunc=aQueue[i]){ if (fFunc==func) aQueue.splice(i,1); i++;} this.StartNext();}}}";if (window.parent.execScript) {window.parent.execScript(sScript, "JavaScript");} else {window.parent.eval(sScript);}FCKeditorAPI = window.parent.FCKeditorAPI;}FCKeditorAPI.__Instances[FCK.Name] = FCK;}function FCKeditorAPI_Cleanup() {FCKeditorAPI.__Instances[FCK.Name] = null;}FCKTools.AddEventListener(window, "unload", FCKeditorAPI_Cleanup);var FCKRegexLib = new Object();FCKRegexLib.AposEntity = /'/gi;FCKRegexLib.ObjectElements = /^(?:IMG|TABLE|TR|TD|TH|INPUT|SELECT|TEXTAREA|HR|OBJECT|A|UL|OL|LI)$/i;FCKRegexLib.BlockElements = /^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TD|TH)$/i;FCKRegexLib.EmptyElements = /^(?:BASE|META|LINK|HR|BR|PARAM|IMG|AREA|INPUT)$/i;FCKRegexLib.NamedCommands = /^(?:Cut|Copy|Paste|Print|SelectAll|RemoveFormat|Unlink|Undo|Redo|Bold|Italic|Underline|StrikeThrough|Subscript|Superscript|JustifyLeft|JustifyCenter|JustifyRight|JustifyFull|Outdent|Indent|InsertOrderedList|InsertUnorderedList|InsertHorizontalRule)$/i;FCKRegexLib.BodyContents = /([\s\S]*\<body[^\>]*\>)([\s\S]*)(\<\/body\>[\s\S]*)/i;FCKRegexLib.ToReplace = /___fcktoreplace:([\w]+)/ig;FCKRegexLib.MetaHttpEquiv = /http-equiv\s*=\s*["']?([^"' ]+)/i;FCKRegexLib.HasBaseTag = /<base /i;FCKRegexLib.HeadOpener = /<head\s?[^>]*>/i;FCKRegexLib.HeadCloser = /<\/head\s*>/i;FCKRegexLib.TableBorderClass = /\s*FCK__ShowTableBorders\s*/;FCKRegexLib.ElementName = /(^[A-Za-z_:][\w.\-:]*\w$)|(^[A-Za-z_]$)/;FCKRegexLib.ForceSimpleAmpersand = /___FCKAmp___/g;FCKRegexLib.SpaceNoClose = /\/>/g;FCKRegexLib.EmptyParagraph = /^<(p|div)>\s*<\/\1>$/i;FCKRegexLib.TagBody = /></;FCKRegexLib.StrongOpener = /<STRONG([ \>])/gi;FCKRegexLib.StrongCloser = /<\/STRONG>/gi;FCKRegexLib.EmOpener = /<EM([ \>])/gi;FCKRegexLib.EmCloser = /<\/EM>/gi;FCKRegexLib.GeckoEntitiesMarker = /#\?-\:/g;FCKRegexLib.ProtectUrlsAApo = /(<a\s.*?href=)("|')(.+?)\2/gi;FCKRegexLib.ProtectUrlsANoApo = /(<a\s.*?href=)([^"'][^ >]+)/gi;FCKRegexLib.ProtectUrlsImgApo = /(<img\s.*?src=)("|')(.+?)\2/gi;FCKRegexLib.ProtectUrlsImgNoApo = /(<img\s.*?src=)([^"'][^ >]+)/gi;FCKRegexLib.Html4DocType = /HTML 4\.0 Transitional/i;var FCKLanguageManager = FCK.Language = new Object();FCKLanguageManager.AvailableLanguages = {"ar":"Arabic", "bg":"Bulgarian", "bn":"Bengali/Bangla", "bs":"Bosnian", "ca":"Catalan", "cs":"Czech", "da":"Danish", "de":"German", "el":"Greek", "en":"English", "en-au":"English (Australia)", "en-ca":"English (Canadian)", "en-uk":"English (United Kingdom)", "eo":"Esperanto", "es":"Spanish", "et":"Estonian", "eu":"Basque", "fa":"Persian", "fi":"Finnish", "fo":"Faroese", "fr":"French", "gl":"Galician", "he":"Hebrew", "hi":"Hindi", "hr":"Croatian", "hu":"Hungarian", "it":"Italian", "ja":"Japanese", "km":"Khmer", "ko":"Korean", "lt":"Lithuanian", "lv":"Latvian", "mn":"Mongolian", "ms":"Malay", "nl":"Dutch", "no":"Norwegian", "pl":"Polish", "pt":"Portuguese (Portugal)", "pt-br":"Portuguese (Brazil)", "ro":"Romanian", "ru":"Russian", "sk":"Slovak", "sl":"Slovenian", "sr":"Serbian (Cyrillic)", "sr-latn":"Serbian (Latin)", "sv":"Swedish", "th":"Thai", "tr":"Turkish", "uk":"Ukrainian", "vi":"Vietnamese", "zh":"Chinese Traditional", "zh-cn":"Chinese Simplified"};FCKLanguageManager.GetActiveLanguage = function () {if (FCKConfig.AutoDetectLanguage) {var A;if (navigator.userLanguage) {A = navigator.userLanguage.toLowerCase();} else {if (navigator.language) {A = navigator.language.toLowerCase();} else {return FCKConfig.DefaultLanguage;}}if (A.length >= 5) {A = A.substr(0, 5);if (this.AvailableLanguages[A]) {return A;}}if (A.length >= 2) {A = A.substr(0, 2);if (this.AvailableLanguages[A]) {return A;}}}return this.DefaultLanguage;};FCKLanguageManager.TranslateElements = function (A, B, C, D) {var e = A.getElementsByTagName(B);var E, s;for (var i = 0; i < e.length; i++) {if (E = e[i].getAttribute("fckLang")) {if (s = FCKLang[E]) {if (D) {s = FCKTools.HTMLEncode(s);}eval("e[i]." + C + " = s");}}}};FCKLanguageManager.TranslatePage = function (A) {this.TranslateElements(A, "INPUT", "value");this.TranslateElements(A, "SPAN", "innerHTML");this.TranslateElements(A, "LABEL", "innerHTML");this.TranslateElements(A, "OPTION", "innerHTML", true);};FCKLanguageManager.Initialize = function () {if (this.AvailableLanguages[FCKConfig.DefaultLanguage]) {this.DefaultLanguage = FCKConfig.DefaultLanguage;} else {this.DefaultLanguage = "en";}this.ActiveLanguage = new Object();this.ActiveLanguage.Code = this.GetActiveLanguage();this.ActiveLanguage.Name = this.AvailableLanguages[this.ActiveLanguage.Code];};var FCKEvents;FCKEvents = function (A) {this.Owner = A;this.RegisteredEvents = new Object();};FCKEvents.prototype.AttachEvent = function (A, B) {var C;if (!(C = this.RegisteredEvents[A])) {this.RegisteredEvents[A] = [B];} else {C.push(B);}};FCKEvents.prototype.FireEvent = function (A, B) {var C = true;var D = this.RegisteredEvents[A];if (D) {for (var i = 0; i < D.length; i++) {C = (D[i](this.Owner, B) && C);}}return C;};var FCKXHtmlEntities = new Object();FCKXHtmlEntities.Initialize = function () {if (FCKXHtmlEntities.Entities) {return;}if (FCKConfig.ProcessHTMLEntities) {FCKXHtmlEntities.Entities = {"\xa0":"nbsp", "\xa1":"iexcl", "\xa2":"cent", "\xa3":"pound", "\xa4":"curren", "\xa5":"yen", "\xa6":"brvbar", "\xa7":"sect", "\xa8":"uml", "\xa9":"copy", "\xaa":"ordf", "\xab":"laquo", "\xac":"not", "":"shy", "\xae":"reg", "\xaf":"macr", "\xb0":"deg", "\xb1":"plusmn", "\xb2":"sup2", "\xb3":"sup3", "\xb4":"acute", "\xb5":"micro", "\xb6":"para", "\xb7":"middot", "\xb8":"cedil", "\xb9":"sup1", "\xba":"ordm", "\xbb":"raquo", "\xbc":"frac14", "\xbd":"frac12", "\xbe":"frac34", "\xbf":"iquest", "\xd7":"times", "\xf7":"divide", "\u0192":"fnof", "\u2022":"bull", "\u2026":"hellip", "\u2032":"prime", "\u2033":"Prime", "\u203e":"oline", "\u2044":"frasl", "\u2118":"weierp", "\u2111":"image", "\u211c":"real", "\u2122":"trade", "\u2135":"alefsym", "\u2190":"larr", "\u2191":"uarr", "\u2192":"rarr", "\u2193":"darr", "\u2194":"harr", "\u21b5":"crarr", "\u21d0":"lArr", "\u21d1":"uArr", "\u21d2":"rArr", "\u21d3":"dArr", "\u21d4":"hArr", "\u2200":"forall", "\u2202":"part", "\u2203":"exist", "\u2205":"empty", "\u2207":"nabla", "\u2208":"isin", "\u2209":"notin", "\u220b":"ni", "\u220f":"prod", "\u2211":"sum", "\u2212":"minus", "\u2217":"lowast", "\u221a":"radic", "\u221d":"prop", "\u221e":"infin", "\u2220":"ang", "\u2227":"and", "\u2228":"or", "\u2229":"cap", "\u222a":"cup", "\u222b":"int", "\u2234":"there4", "\u223c":"sim", "\u2245":"cong", "\u2248":"asymp", "\u2260":"ne", "\u2261":"equiv", "\u2264":"le", "\u2265":"ge", "\u2282":"sub", "\u2283":"sup", "\u2284":"nsub", "\u2286":"sube", "\u2287":"supe", "\u2295":"oplus", "\u2297":"otimes", "\u22a5":"perp", "\u22c5":"sdot", "\u25ca":"loz", "\u2660":"spades", "\u2663":"clubs", "\u2665":"hearts", "\u2666":"diams", "\"":"quot", "\u02c6":"circ", "\u02dc":"tilde", "\u2002":"ensp", "\u2003":"emsp", "\u2009":"thinsp", "":"zwnj", "":"zwj", "":"lrm", "":"rlm", "\u2013":"ndash", "\u2014":"mdash", "\u2018":"lsquo", "\u2019":"rsquo", "\u201a":"sbquo", "\u201c":"ldquo", "\u201d":"rdquo", "\u201e":"bdquo", "\u2020":"dagger", "\u2021":"Dagger", "\u2030":"permil", "\u2039":"lsaquo", "\u203a":"rsaquo", "\u20ac":"euro"};FCKXHtmlEntities.Chars = "";for (var e in FCKXHtmlEntities.Entities) {FCKXHtmlEntities.Chars += e;}if (FCKConfig.IncludeLatinEntities) {var A = {"\xc0":"Agrave", "\xc1":"Aacute", "\xc2":"Acirc", "\xc3":"Atilde", "\xc4":"Auml", "\xc5":"Aring", "\xc6":"AElig", "\xc7":"Ccedil", "\xc8":"Egrave", "\xc9":"Eacute", "\xca":"Ecirc", "\xcb":"Euml", "\xcc":"Igrave", "\xcd":"Iacute", "\xce":"Icirc", "\xcf":"Iuml", "\xd0":"ETH", "\xd1":"Ntilde", "\xd2":"Ograve", "\xd3":"Oacute", "\xd4":"Ocirc", "\xd5":"Otilde", "\xd6":"Ouml", "\xd8":"Oslash", "\xd9":"Ugrave", "\xda":"Uacute", "\xdb":"Ucirc", "\xdc":"Uuml", "\xdd":"Yacute", "\xde":"THORN", "\xdf":"szlig", "\xe0":"agrave", "\xe1":"aacute", "\xe2":"acirc", "\xe3":"atilde", "\xe4":"auml", "\xe5":"aring", "\xe6":"aelig", "\xe7":"ccedil", "\xe8":"egrave", "\xe9":"eacute", "\xea":"ecirc", "\xeb":"euml", "\xec":"igrave", "\xed":"iacute", "\xee":"icirc", "\xef":"iuml", "\xf0":"eth", "\xf1":"ntilde", "\xf2":"ograve", "\xf3":"oacute", "\xf4":"ocirc", "\xf5":"otilde", "\xf6":"ouml", "\xf8":"oslash", "\xf9":"ugrave", "\xfa":"uacute", "\xfb":"ucirc", "\xfc":"uuml", "\xfd":"yacute", "\xfe":"thorn", "\xff":"yuml", "\u0152":"OElig", "\u0153":"oelig", "\u0160":"Scaron", "\u0161":"scaron", "\u0178":"Yuml"};for (var e in A) {FCKXHtmlEntities.Entities[e] = A[e];FCKXHtmlEntities.Chars += e;}A = null;}if (FCKConfig.IncludeGreekEntities) {var A = {"\u0391":"Alpha", "\u0392":"Beta", "\u0393":"Gamma", "\u0394":"Delta", "\u0395":"Epsilon", "\u0396":"Zeta", "\u0397":"Eta", "\u0398":"Theta", "\u0399":"Iota", "\u039a":"Kappa", "\u039b":"Lambda", "\u039c":"Mu", "\u039d":"Nu", "\u039e":"Xi", "\u039f":"Omicron", "\u03a0":"Pi", "\u03a1":"Rho", "\u03a3":"Sigma", "\u03a4":"Tau", "\u03a5":"Upsilon", "\u03a6":"Phi", "\u03a7":"Chi", "\u03a8":"Psi", "\u03a9":"Omega", "\u03b1":"alpha", "\u03b2":"beta", "\u03b3":"gamma", "\u03b4":"delta", "\u03b5":"epsilon", "\u03b6":"zeta", "\u03b7":"eta", "\u03b8":"theta", "\u03b9":"iota", "\u03ba":"kappa", "\u03bb":"lambda", "\u03bc":"mu", "\u03bd":"nu", "\u03be":"xi", "\u03bf":"omicron", "\u03c0":"pi", "\u03c1":"rho", "\u03c2":"sigmaf", "\u03c3":"sigma", "\u03c4":"tau", "\u03c5":"upsilon", "\u03c6":"phi", "\u03c7":"chi", "\u03c8":"psi", "\u03c9":"omega"};for (var e in A) {FCKXHtmlEntities.Entities[e] = A[e];FCKXHtmlEntities.Chars += e;}A = null;}FCKXHtmlEntities.EntitiesRegex = new RegExp("[" + FCKXHtmlEntities.Chars + "]|[^" + FCKXHtmlEntities.Chars + "]+", "g");} else {FCKXHtmlEntities.Entities = {"\xa0":"nbsp"};FCKXHtmlEntities.EntitiesRegex = /[\u00a0]|[^\u00a0]+/g;}};var FCKXHtml = new Object();FCKXHtml.CurrentJobNum = 0;FCKXHtml.GetXHTML = function (A, B, C) {FCKXHtmlEntities.Initialize();this._CreateNode = FCKConfig.ForceStrongEm ? FCKXHtml_CreateNode_StrongEm : FCKXHtml_CreateNode_Normal;FCKXHtml.SpecialBlocks = new Array();this.XML = FCKTools.CreateXmlObject("DOMDocument");this.MainNode = this.XML.appendChild(this.XML.createElement("xhtml"));FCKXHtml.CurrentJobNum++;if (B) {this._AppendNode(this.MainNode, A);} else {this._AppendChildNodes(this.MainNode, A, false);}var D = this._GetMainXmlString();D = D.substr(7, D.length - 15).trim();if (FCKBrowserInfo.IsGecko) {D = D.replace(/<br\/>$/, "");}D = D.replace(FCKRegexLib.SpaceNoClose, " />");if (FCKConfig.ForceSimpleAmpersand) {D = D.replace(FCKRegexLib.ForceSimpleAmpersand, "&");}if (C) {D = FCKCodeFormatter.Format(D);}for (var i = 0; i < FCKXHtml.SpecialBlocks.length; i++) {var E = new RegExp("___FCKsi___" + i);D = D.replace(E, FCKXHtml.SpecialBlocks[i]);}this.XML = null;return D;};FCKXHtml._AppendAttribute = function (A, B, C) {try {var D = this.XML.createAttribute(B);D.value = C ? C : "";A.attributes.setNamedItem(D);}catch (e) {}};FCKXHtml._AppendChildNodes = function (A, B, C) {var D = 0;var E = B.firstChild;while (E) {if (this._AppendNode(A, E)) {D++;}E = E.nextSibling;}if (D == 0) {if (C && FCKConfig.FillEmptyBlocks) {this._AppendEntity(A, "nbsp");return;}if (!FCKRegexLib.EmptyElements.test(B.nodeName)) {A.appendChild(this.XML.createTextNode(""));}}};FCKXHtml._AppendNode = function (A, B) {if (!B) {return;}switch (B.nodeType) {case 1:if (B.getAttribute("_fckfakelement")) {return FCKXHtml._AppendNode(A, FCK.GetRealElement(B));}if (FCKBrowserInfo.IsGecko && B.hasAttribute("_moz_editor_bogus_node")) {return false;}if (B.getAttribute("_fcktemp")) {return false;}var C = B.nodeName;if (FCKBrowserInfo.IsIE && B.scopeName && B.scopeName != "HTML") {C = B.scopeName + ":" + C;}if (!FCKRegexLib.ElementName.test(C)) {return false;}C = C.toLowerCase();if (FCKBrowserInfo.IsGecko && C == "br" && B.hasAttribute("type") && B.getAttribute("type", 2) == "_moz") {return false;}if (B._fckxhtmljob && B._fckxhtmljob == FCKXHtml.CurrentJobNum) {return false;}var D = this._CreateNode(C);FCKXHtml._AppendAttributes(A, B, D, C);B._fckxhtmljob = FCKXHtml.CurrentJobNum;var E = FCKXHtml.TagProcessors[C];if (E) {D = E(D, B, A);if (!D) {break;}} else {this._AppendChildNodes(D, B, FCKRegexLib.BlockElements.test(C));}A.appendChild(D);break;case 3:this._AppendTextNode(A, B.nodeValue.replaceNewLineChars(" "));break;case 8:try {A.appendChild(this.XML.createComment(B.nodeValue));}catch (e) {}break;default:A.appendChild(this.XML.createComment("Element not supported - Type: " + B.nodeType + " Name: " + B.nodeName));break;}return true;};function FCKXHtml_CreateNode_StrongEm(nodeName) {switch (nodeName) {case "b":nodeName = "strong";break;case "i":nodeName = "em";break;}return this.XML.createElement(nodeName);}function FCKXHtml_CreateNode_Normal(nodeName) {return this.XML.createElement(nodeName);}FCKXHtml._AppendSpecialItem = function (A) {return "___FCKsi___" + FCKXHtml.SpecialBlocks.AddItem(A);};FCKXHtml._AppendTextNode = function (A, B) {var C = B.match(FCKXHtmlEntities.EntitiesRegex);if (C) {for (var i = 0; i < C.length; i++) {if (C[i].length == 1) {var D = FCKXHtmlEntities.Entities[C[i]];if (D != null) {this._AppendEntity(A, D);continue;}}A.appendChild(this.XML.createTextNode(C[i]));}}};FCKXHtml.TagProcessors = new Object();FCKXHtml.TagProcessors["img"] = function (A, B) {if (!A.attributes.getNamedItem("alt")) {FCKXHtml._AppendAttribute(A, "alt", "");}var C = B.getAttribute("_fcksavedurl");if (C && C.length > 0) {FCKXHtml._AppendAttribute(A, "src", C);}return A;};FCKXHtml.TagProcessors["a"] = function (A, B) {var C = B.getAttribute("_fcksavedurl");if (C && C.length > 0) {FCKXHtml._AppendAttribute(A, "href", C);}FCKXHtml._AppendChildNodes(A, B, false);return A;};FCKXHtml.TagProcessors["script"] = function (A, B) {if (!A.attributes.getNamedItem("type")) {FCKXHtml._AppendAttribute(A, "type", "text/javascript");}A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.text)));return A;};FCKXHtml.TagProcessors["style"] = function (A, B) {if (!A.attributes.getNamedItem("type")) {FCKXHtml._AppendAttribute(A, "type", "text/css");}A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.innerHTML)));return A;};FCKXHtml.TagProcessors["title"] = function (A, B) {A.appendChild(FCKXHtml.XML.createTextNode(FCK.EditorDocument.title));return A;};FCKXHtml.TagProcessors["table"] = function (A, B) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -