⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fckeditorcode_gecko.js

📁 原名JSPackager
💻 JS
📖 第 1 页 / 共 5 页
字号:
C[C.length] = D;}}return C;};FCKTableHandler._CreateTableMap = function (A) {var B = A.rows;var r = -1;var C = new Array();for (var i = 0; i < B.length; i++) {r++;if (!C[r]) {C[r] = new Array();}var c = -1;for (var j = 0; j < B[i].cells.length; j++) {var D = B[i].cells[j];c++;while (C[r][c]) {c++;}var E = isNaN(D.colSpan) ? 1 : D.colSpan;var F = isNaN(D.rowSpan) ? 1 : D.rowSpan;for (var G = 0; G < F; G++) {if (!C[r + G]) {C[r + G] = new Array();}for (var H = 0; H < E; H++) {C[r + G][c + H] = B[i].cells[j];}}c += E - 1;}}return C;};FCKTableHandler.ClearRow = function (A) {var B = A.cells;for (var i = 0; i < B.length; i++) {if (FCKBrowserInfo.IsGecko) {B[i].innerHTML = GECKO_BOGUS;} else {B[i].innerHTML = "";}}};FCKTableHandler.GetSelectedCells = function () {var A = new Array();var B = FCK.EditorWindow.getSelection();if (B.rangeCount == 1 && B.anchorNode.nodeType == 3) {var C = FCKTools.GetElementAscensor(B.anchorNode, "TD,TH");if (C) {A[0] = C;return A;}}for (var i = 0; i < B.rangeCount; i++) {var D = B.getRangeAt(i);var E;if (D.startContainer.tagName.Equals("TD", "TH")) {E = D.startContainer;} else {E = D.startContainer.childNodes[D.startOffset];}if (E.tagName.Equals("TD", "TH")) {A[A.length] = E;}}return A;};var FCKXml = function () {};FCKXml.prototype.LoadUrl = function (A) {var B = this;var C = FCKTools.CreateXmlObject("XmlHttp");C.open("GET", A, false);C.send(null);if (C.status == 200 || C.status == 304) {this.DOMDocument = C.responseXML;} else {if (C.status == 0 && C.readyState == 4) {this.DOMDocument = C.responseXML;} else {alert("Error loading \"" + A + "\"");}}};FCKXml.prototype.SelectNodes = function (A, B) {var C = new Array();var D = this.DOMDocument.evaluate(A, B ? B : this.DOMDocument, this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);if (D) {var E = D.iterateNext();while (E) {C[C.length] = E;E = D.iterateNext();}}return C;};FCKXml.prototype.SelectSingleNode = function (A, B) {var C = this.DOMDocument.evaluate(A, B ? B : this.DOMDocument, this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), 9, null);if (C && C.singleNodeValue) {return C.singleNodeValue;} else {return null;}};var FCKStyleDef = function (A, B) {this.Name = A;this.Element = B.toUpperCase();this.IsObjectElement = FCKRegexLib.ObjectElements.test(this.Element);this.Attributes = new Object();};FCKStyleDef.prototype.AddAttribute = function (A, B) {this.Attributes[A] = B;};FCKStyleDef.prototype.GetOpenerTag = function () {var s = "<" + this.Element;for (var a in this.Attributes) {s += " " + a + "=\"" + this.Attributes[a] + "\"";}return s + ">";};FCKStyleDef.prototype.GetCloserTag = function () {return "</" + this.Element + ">";};FCKStyleDef.prototype.RemoveFromSelection = function () {if (FCKSelection.GetType() == "Control") {this._RemoveMe(FCK.ToolbarSet.CurrentInstance.Selection.GetSelectedElement());} else {this._RemoveMe(FCK.ToolbarSet.CurrentInstance.Selection.GetParentElement());}};FCKStyleDef.prototype.ApplyToSelection = function () {if (FCKSelection.GetType() == "Text" && !this.IsObjectElement) {var A = FCK.ToolbarSet.CurrentInstance.EditorWindow.getSelection();var e = FCK.ToolbarSet.CurrentInstance.EditorDocument.createElement(this.Element);for (var i = 0; i < A.rangeCount; i++) {e.appendChild(A.getRangeAt(i).extractContents());}this._AddAttributes(e);this._RemoveDuplicates(e);var B = A.getRangeAt(0);B.insertNode(e);} else {var C = FCK.ToolbarSet.CurrentInstance.Selection.GetSelectedElement();if (C.tagName == this.Element) {this._AddAttributes(C);}}};FCKStyleDef.prototype._AddAttributes = function (A) {for (var a in this.Attributes) {switch (a.toLowerCase()) {case "src":A.setAttribute("_fcksavedurl", this.Attributes[a], 0);default:A.setAttribute(a, this.Attributes[a], 0);}}};FCKStyleDef.prototype._RemoveDuplicates = function (A) {for (var i = 0; i < A.childNodes.length; i++) {var B = A.childNodes[i];if (B.nodeType != 1) {continue;}this._RemoveDuplicates(B);if (this.IsEqual(B)) {FCKTools.RemoveOuterTags(B);}}};FCKStyleDef.prototype.IsEqual = function (e) {if (e.tagName != this.Element) {return false;}for (var a in this.Attributes) {if (e.getAttribute(a) != this.Attributes[a]) {return false;}}return true;};FCKStyleDef.prototype._RemoveMe = function (A) {if (!A) {return;}var B = A.parentNode;if (A.nodeType == 1 && this.IsEqual(A)) {if (this.IsObjectElement) {for (var a in this.Attributes) {A.removeAttribute(a, 0);}return;} else {FCKTools.RemoveOuterTags(A);}}this._RemoveMe(B);};var FCKStylesLoader = function () {this.Styles = new Object();this.StyleGroups = new Object();this.Loaded = false;this.HasObjectElements = false;};FCKStylesLoader.prototype.Load = function (A) {var B = new FCKXml();B.LoadUrl(A);var C = B.SelectNodes("Styles/Style");for (var i = 0; i < C.length; i++) {var D = C[i].attributes.getNamedItem("element").value.toUpperCase();var E = new FCKStyleDef(C[i].attributes.getNamedItem("name").value, D);if (E.IsObjectElement) {this.HasObjectElements = true;}var F = B.SelectNodes("Attribute", C[i]);for (var j = 0; j < F.length; j++) {var G = F[j].attributes.getNamedItem("name").value;var H = F[j].attributes.getNamedItem("value").value;if (G.toLowerCase() == "style") {var I = document.createElement("SPAN");I.style.cssText = H;H = I.style.cssText;}E.AddAttribute(G, H);}this.Styles[E.Name] = E;var J = this.StyleGroups[D];if (J == null) {this.StyleGroups[D] = new Array();J = this.StyleGroups[D];}J[J.length] = E;}this.Loaded = true;};var FCKNamedCommand = function (A) {this.Name = A;};FCKNamedCommand.prototype.Execute = function () {FCK.ExecuteNamedCommand(this.Name);};FCKNamedCommand.prototype.GetState = function () {return FCK.GetNamedCommandState(this.Name);};var FCKDialogCommand = function (A, B, C, D, E, F, G) {this.Name = A;this.Title = B;this.Url = C;this.Width = D;this.Height = E;this.GetStateFunction = F;this.GetStateParam = G;};FCKDialogCommand.prototype.Execute = function () {FCKDialog.OpenDialog("FCKDialog_" + this.Name, this.Title, this.Url, this.Width, this.Height);};FCKDialogCommand.prototype.GetState = function () {if (this.GetStateFunction) {return this.GetStateFunction(this.GetStateParam);} else {return FCK_TRISTATE_OFF;}};var FCKUndefinedCommand = function () {this.Name = "Undefined";};FCKUndefinedCommand.prototype.Execute = function () {alert(FCKLang.NotImplemented);};FCKUndefinedCommand.prototype.GetState = function () {return FCK_TRISTATE_OFF;};var FCKFontNameCommand = function () {this.Name = "FontName";};FCKFontNameCommand.prototype.Execute = function (A) {if (A == null || A == "") {} else {FCK.ExecuteNamedCommand("FontName", A);}};FCKFontNameCommand.prototype.GetState = function () {return FCK.GetNamedCommandValue("FontName");};var FCKFontSizeCommand = function () {this.Name = "FontSize";};FCKFontSizeCommand.prototype.Execute = function (A) {if (typeof (A) == "string") {A = parseInt(A);}if (A == null || A == "") {FCK.ExecuteNamedCommand("FontSize", 3);} else {FCK.ExecuteNamedCommand("FontSize", A);}};FCKFontSizeCommand.prototype.GetState = function () {return FCK.GetNamedCommandValue("FontSize");};var FCKFormatBlockCommand = function () {this.Name = "FormatBlock";};FCKFormatBlockCommand.prototype.Execute = function (A) {if (A == null || A == "") {FCK.ExecuteNamedCommand("FormatBlock", "<P>");} else {if (A == "div" && FCKBrowserInfo.IsGecko) {FCK.ExecuteNamedCommand("FormatBlock", "div");} else {FCK.ExecuteNamedCommand("FormatBlock", "<" + A + ">");}}};FCKFormatBlockCommand.prototype.GetState = function () {return FCK.GetNamedCommandValue("FormatBlock");};var FCKPreviewCommand = function () {this.Name = "Preview";};FCKPreviewCommand.prototype.Execute = function () {FCK.Preview();};FCKPreviewCommand.prototype.GetState = function () {return FCK_TRISTATE_OFF;};var FCKSaveCommand = function () {this.Name = "Save";};FCKSaveCommand.prototype.Execute = function () {var A = FCK.LinkedField.form;if (typeof (A.onsubmit) == "function") {var B = A.onsubmit();if (B != null && B === false) {return;}}A.submit();};FCKSaveCommand.prototype.GetState = function () {return FCK_TRISTATE_OFF;};var FCKNewPageCommand = function () {this.Name = "NewPage";};FCKNewPageCommand.prototype.Execute = function () {FCKUndo.SaveUndoStep();FCK.SetHTML("");FCKUndo.Typing = true;};FCKNewPageCommand.prototype.GetState = function () {return FCK_TRISTATE_OFF;};var FCKSourceCommand = function () {this.Name = "Source";};FCKSourceCommand.prototype.Execute = function () {if (FCKConfig.SourcePopup) {var A = FCKConfig.ScreenWidth * 0.65;var B = FCKConfig.ScreenHeight * 0.65;FCKDialog.OpenDialog("FCKDialog_Source", FCKLang.Source, "dialog/fck_source.html", A, B, null, null, true);} else {FCK.SwitchEditMode();}};FCKSourceCommand.prototype.GetState = function () {return (FCK.EditMode == FCK_EDITMODE_WYSIWYG ? FCK_TRISTATE_OFF : FCK_TRISTATE_ON);};var FCKUndoCommand = function () {this.Name = "Undo";};FCKUndoCommand.prototype.Execute = function () {if (FCKBrowserInfo.IsIE) {FCKUndo.Undo();} else {FCK.ExecuteNamedCommand("Undo");}};FCKUndoCommand.prototype.GetState = function () {if (FCKBrowserInfo.IsIE) {return (FCKUndo.CheckUndoState() ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED);} else {return FCK.GetNamedCommandState("Undo");}};var FCKRedoCommand = function () {this.Name = "Redo";};FCKRedoCommand.prototype.Execute = function () {if (FCKBrowserInfo.IsIE) {FCKUndo.Redo();} else {FCK.ExecuteNamedCommand("Redo");}};FCKRedoCommand.prototype.GetState = function () {if (FCKBrowserInfo.IsIE) {return (FCKUndo.CheckRedoState() ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED);} else {return FCK.GetNamedCommandState("Redo");}};var FCKPageBreakCommand = function () {this.Name = "PageBreak";};FCKPageBreakCommand.prototype.Execute = function () {var e = FCK.EditorDocument.createElement("DIV");e.style.pageBreakAfter = "always";e.innerHTML = "<span style=\"DISPLA

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -