PK ?,igcontent/necko/redirect_loop.xulUT IY<ԻBUx PK {D0?Ԅ))content/necko/contents.rdfUT !@ԻBUx PK ,l?b content/xbl-marquee/contents.rdfUT A={׻BUx PK 91?5555#content/xbl-marquee/xbl-marquee.xmlUT 5UA{׻BUx 6 if (this.hasAttribute("scrollamount")) return this.getAttribute("scrollamount"); return this.defaultScrollAmount; //default value is 6 pixels this.setAttribute("scrollamount", val); 85 this.setAttribute("scrolldelay", val); // since we changed the scrolldelay, restart the marquee this._doMove(false); "left" return this.directionField; // if val is false, don't change anything if (val) { // in case direction is swapped between horizontal/vertical, use // setAttribute to make the xbl bindings change. this.setAttribute("direction", val); // since we changed the direction, set startNewDirection to true this.startNewDirection = true; this.directionField = val.toLowerCase(); // pass in aSkipSettingNewPosition as true this._doMove(true); } "left" "scroll" return this.behaviorField; this.behaviorField = val ? val.toLowerCase() : this.defaultBehavior; "scroll" 1 0 0 0 0 0 true "0.9.7" this.stopAt) || (this.dirsign == -1 && this.newPosition < this.stopAt)) { if (this.behaviorField == "alternate") { // lets start afresh this.startNewDirection = true; // swap direction const swap = {left: "right", down: "up", up: "down", right: "left"}; this.directionField = swap[this.directionField]; } else { this.newPosition = this.startAt; } } if (!this.startNewDirection) { if ((this.directionField == "up") || (this.directionField == "down")) this.outerDiv.scrollTop = this.newPosition; else this.outerDiv.scrollLeft = this.newPosition; } var myThis = this; var lambda = function myTimeOutFunction(){myThis.start();} this.runId = window.setTimeout(lambda, this.scrollDelay); ]]> PK S2)Axxcontent/editor/editor.xulUT UBoڻBUx %editorDTD; %editorOverlayDTD; %brandDTD; ]> PK XT2WN  content/editor/pref-editing.xulUT BvڻBUx PK q.ו)content/editor/editorNavigatorOverlay.xulUT hRv>ػBUx PK #Zn23}P*content/editor/editorApplicationOverlay.jsUT d5BoڻBUx/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Mozilla.org * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998-2004 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Daniel Glazman (glazman@disruptive-innovations.com), on behalf of Linspire Inc. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /* Implementations of nsIControllerCommand for composer commands */ function initEditorContextMenuItems(aEvent) { var shouldShowEditPage = !gContextMenu.onImage && !gContextMenu.onLink && !gContextMenu.onTextInput && !gContextMenu.inDirList; gContextMenu.showItem( "context-editpage", shouldShowEditPage ); var shouldShowEditLink = gContextMenu.onSaveableLink; gContextMenu.showItem( "context-editlink", shouldShowEditLink ); // Hide the applications separator if there's no add-on apps present. gContextMenu.showItem("context-sep-apps", gContextMenu.shouldShowSeparator("context-sep-apps")); } function initEditorContextMenuListener(aEvent) { var popup = document.getElementById("contentAreaContextMenu"); if (popup) popup.addEventListener("popupshowing", initEditorContextMenuItems, false); } addEventListener("load", initEditorContextMenuListener, false); /* GLAZOU: this function seems unused. Commenting out */ /* function editDocument(aDocument) { if (!aDocument) aDocument = window._content.document; editPage(aDocument.URL, window, false); } */ /* GLAZOU: this function seems unused in stdalone editor. Commenting out */ /* function editPageOrFrame() { var focusedWindow = document.commandDispatcher.focusedWindow; // if the uri is a specific frame, grab it, else use the frameset uri // and let Composer handle error if necessary var url = getContentFrameURI(focusedWindow); editPage(url, window, false) } */ function NewEditorTab() { var prefs = GetPrefs(); var preferredDoctype = "html"; var strictness = false; try { preferredDoctype= pref.getCharPref("editor.default.doctype"); } catch(e) { } try { strictness = pref.getBoolPref("editor.default.strictness"); } catch(e) { } document.getElementById("tabeditor").newBlankTab(preferredDoctype, strictness); } // Any non-editor window wanting to create an editor with a URL // should use this instead of "window.openDialog..." // We must always find an existing window with requested URL // (When calling from a dialog, "launchWindow" is dialog's "opener" // and we need a delay to let dialog close) function editPage(url, launchWindow, delay, newTab) { // Always strip off "view-source:" and #anchors url = url.replace(/^view-source:/, "").replace(/#.*/, ""); // User may not have supplied a window if (!launchWindow) { if (window) { launchWindow = window; } else { dump("No window to launch an editor from!\n"); return; } } // if the current window is a browser window, then extract the current charset menu setting from the current // document and use it to initialize the new composer window... var wintype = document.firstChild.getAttribute('windowtype'); var charsetArg; if (launchWindow && (wintype == "navigator:browser") && launchWindow.content.document) charsetArg = "charset=" + launchWindow.content.document.characterSet; try { var uri = createURI(url, null, null); var windowManager = Components.classes['@mozilla.org/appshell/window-mediator;1'].getService(); var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator); var enumerator = windowManagerInterface.getEnumerator( "composer:html" ); var emptyWindow; while ( enumerator.hasMoreElements() ) { var win = enumerator.getNext().QueryInterface(Components.interfaces.nsIDOMWindowInternal); if ( win && win.IsWebComposer()) { if (!newTab && CheckOpenWindowForURIMatch(uri, win)) { // We found an editor with our url win.focus(); return; } if (!emptyWindow && win.PageIsEmptyAndUntouched()) { emptyWindow = win; } } } if (newTab && win) { win.document.getElementById("tabeditor").editURL(url, false, false, false); win.focus(); return; } if (emptyWindow) { // we have an empty window we can use if (emptyWindow.IsInHTMLSourceMode()) emptyWindow.SetEditMode(emptyWindow.PreviousNonSourceDisplayMode); emptyWindow.EditorLoadUrl(url); emptyWindow.focus(); emptyWindow.SetSaveAndPublishUI(url); return; } // Create new Composer window if (delay) { launchWindow.delayedOpenWindow("chrome://editor/content", "chrome,all,dialog=no", url); } else launchWindow.openDialog("chrome://editor/content", "_blank", "chrome,all,dialog=no", url, charsetArg); } catch(e) {} } function createURI(urlstring) { try { var ioserv = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); return ioserv.newURI(urlstring, null, null); } catch (e) {} return null; } function CheckOpenWindowForURIMatch(uri, win) { try { var contentWindow = win.content; // need to QI win to nsIDOMWindowInternal? var contentDoc = contentWindow.document; var htmlDoc = contentDoc.QueryInterface(Components.interfaces.nsIDOMHTMLDocument); var winuri = createURI(htmlDoc.URL); return winuri.equals(uri); } catch (e) {} return false; } function NewTemplate() { document.getElementById("tabeditor").newTemplateTab(); } function NewEditorFromTemplate() { // XXX not implemented } function NewEditorFromDraft() { // XXX not implemented } PK O92Z$0$0&content/editor/StructBarContextMenu.jsUT  AoڻBUx/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Mozilla.org code. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 2002-2004 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Daniel Glazman (glazman@netscape.com), original author * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ var gContextMenuNode; var gContextMenuFiringDocumentElement; function InitStructBarContextMenu(button, docElement) { gContextMenuFiringDocumentElement = docElement; gContextMenuNode = button; var tag = docElement.nodeName.toLowerCase(); var isNvuNs = (docElement.namespaceURI == NVU_NS); var enableRemove; switch (tag) { case "body": case "tbody": case "thead": case "tfoot": case "col": case "colgroup": case "tr": case "th": case "td": case "caption": enableRemove = false; break; default: enableRemove = true; break; } SetElementEnabledById("structRemoveTag", enableRemove); var isNotBody = (tag != "body"); SetElementEnabledById("structChangeTag", isNotBody && !isNvuNs); var rootElement = docElement.ownerDocument.documentElement; var isTemplate = rootElement.getAttribute("template"); SetElementEnabledById("templateElementsContextMenu", isTemplate && !isNvuNs); SetElementEnabledById("changeInlineStylesContextMenu", !isNvuNs) SetElementEnabledById("idSelectMenu", !isNvuNs) SetElementEnabledById("classSelectMenu", !isNvuNs) } function TableCellFilter(node) { switch (node.nodeName.toLowerCase()) { case "td": case "th": case "caption": return NodeFilter.FILTER_ACCEPT; break; default: return NodeFilter.FILTER_SKIP; break; } return NodeFilter.FILTER_SKIP; } function StructRemoveTag() { var editor = GetCurrentEditor(); if (!editor) return; var element = gContextMenuFiringDocumentElement; var offset = 0; var childNodes = element.parentNode.childNodes; while (childNodes[offset] != element) { ++offset; } editor.beginTransaction(); try { if (element.namespaceURI != NVU_NS) { var tag = element.nodeName.toLowerCase(); if (tag != "table") { MoveChildNodesAfterElement(editor, element, element, offset); } else { var nodeIterator = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT, TableCellFilter, true); var node = nodeIterator.lastChild(); while (node) { MoveChildNodesAfterElement(editor, node, element, offset); node = nodeIterator.previousSibling(); } } } editor.deleteNode(element); } catch (e) {}; editor.endTransaction(); } function MoveChildNodesAfterElement(editor, element, targetElement, targetOffset) { var childNodes = element.childNodes; var childNodesLength = childNodes.length; var i; for (i = childNodesLength - 1; i >= 0; i--) { var clone = childNodes.item(i).cloneNode(true); editor.insertNode(clone, targetElement.parentNode, targetOffset + 1); } } function StructChangeTag() { var textbox = document.createElementNS(XUL_NS, "textbox"); textbox.setAttribute("value", gContextMenuNode.getAttribute("value")); textbox.setAttribute("width", gContextMenuNode.boxObject.width); textbox.className = "struct-textbox"; gContextMenuNode.parentNode.replaceChild(textbox, gContextMenuNode); textbox.addEventListener("keypress", OnKeyPress, false); textbox.addEventListener("blur", ResetStructToolbar, true); textbox.select(); } function StructSelectTag() { SelectFocusNodeAncestor(gContextMenuFiringDocumentElement); } function OpenAdvancedProperties() { if (gContextMenuFiringDocumentElement.namespaceURI == NVU_NS) EditPIorComment(gContextMenuFiringDocumentElement); else doAdvancedProperties(gContextMenuFiringDocumentElement); } function OnKeyPress(event) { var editor = GetCurrentEditor(); var keyCode = event.keyCode; if (keyCode == 13) { var newTag = event.target.value; var element = gContextMenuFiringDocumentElement; var offset = 0; var childNodes = element.parentNode.childNodes; while (childNodes.item(offset) != element) { offset++; } editor.beginTransaction(); try { var newElt = editor.document.createElement(newTag); if (newElt) { childNodes = element.childNodes; var childNodesLength = childNodes.length; var i; for (i = 0; i < childNodesLength; i++) { var clone = childNodes.item(i).cloneNode(true); newElt.appendChild(clone); } editor.insertNode(newElt, element.parentNode, offset+1); editor.deleteNode(element); editor.selectElement(newElt); window.content.focus(); } } catch (e) {} editor.endTransaction(); } else if (keyCode == 27) { // if the user hits Escape, we discard the changes window.content.focus(); } } function openCSSPropsDialog(tab, title, selectionBased) { window.openDialog("chrome://cascades/content/" + tab + "Props.xul","_blank", "chrome,close,modal,titlebar", tab, title, selectionBased); window._content.focus(); } function EnableExtractInlineStyles() { var elt = gContextMenuFiringDocumentElement; var style = elt.getAttribute("style"); var hasInlineStyle = !style; SetElementEnabledById("makeCSSRule", style); } function ExtractInlineStyles() { window.openDialog("chrome://editor/content/ExtractStyles.xul","_blank", "chrome,close,modal,titlebar", gContextMenuFiringDocumentElement); window._content.focus(); } function cleanPopup(menuPopup) { var child = menuPopup.lastChild; while (child) { var tmp = child.previousSibling; menuPopup.removeChild(child); child = tmp; } } function InitIDSelectMenu(menuPopup) { cleanPopup(menuPopup); var id = gContextMenuFiringDocumentElement.getAttribute("id"); if (id) { var menuEntry = document.createElementNS(XUL_NS, "menuitem"); menuEntry.setAttribute("type", "radio"); menuEntry.setAttribute("checked", "true"); menuEntry.setAttribute("label", id); menuEntry.setAttribute("value", id); menuPopup.appendChild(menuEntry); } var idList = GetCurrentEditor().document.getSelectorList(CSSSelectorQuery.SHOW_ID_SELECTOR); if (idList && idList.length) { if (id) { var menuSep = document.createElementNS(XUL_NS, "menuseparator"); menuPopup.appendChild(menuSep); } var idListArray = new Array(); var idListLength = idList.length; for (index = 0; index < idListLength; index++) idListArray.push(idList.item(index).substr(1)); idListArray.sort(); var previousId = ""; for (index = 0; index < idListLength; index++) { var idEntry = idListArray[index]; if (idEntry != previousId) { previousId = idEntry; if (idEntry != id) { menuEntry = document.createElementNS(XUL_NS, "menuitem"); menuEntry.setAttribute("type", "radio"); menuEntry.setAttribute("label", idEntry); menuEntry.setAttribute("value", idEntry); menuPopup.appendChild(menuEntry); } } } } } function InitClassSelectMenu(menuPopup) { cleanPopup(menuPopup); var classes = gContextMenuFiringDocumentElement.getAttribute("class"); var classesArray, classesArrayLength; if (classes) { classesArray = classes.split(" "); classesArray.sort(); classesArrayLength = classesArray.length; var index; for (index = 0; index < classesArrayLength; index++) { var menuEntry = document.createElementNS(XUL_NS, "menuitem"); menuEntry.setAttribute("type", "checkbox"); menuEntry.setAttribute("checked", "true"); menuEntry.setAttribute("label", classesArray[index]); menuEntry.setAttribute("value", classesArray[index]); menuPopup.appendChild(menuEntry); } } var classList = GetCurrentEditor().document.getSelectorList(CSSSelectorQuery.SHOW_CLASS_SELECTOR); if (classList && classList.length) { if (classesArrayLength) { var menuSep = document.createElementNS(XUL_NS, "menuseparator"); menuPopup.appendChild(menuSep); } var classListArray = new Array(); var classListLength = classList.length; for (index = 0; index < classListLength; index++) classListArray.push(classList.item(index).substr(1)); classListArray.sort(); var previousClass = ""; for (index = 0; index < classListLength; index++) { var classEntry = classListArray[index]; if (classEntry != previousClass) { previousClass = classEntry; var found = false; if (classesArrayLength) { var existingClassesIndex; for (existingClassesIndex = 0; existingClassesIndex < classesArrayLength; existingClassesIndex++) if (classesArray[existingClassesIndex] == classEntry) { found = true; break; } } if (!found) { menuEntry = document.createElementNS(XUL_NS, "menuitem"); menuEntry.setAttribute("type", "checkbox"); menuEntry.setAttribute("label", classEntry); menuEntry.setAttribute("value", classEntry); menuPopup.appendChild(menuEntry); } } } } } function onClassSelectChange() { var menuPopup = document.getElementById("classSelectMenuPopup"); var resultingClassAttribute = ""; var classEntry = menuPopup.firstChild; while (classEntry) { if (classEntry.nodeName.toLowerCase() == "menuitem" && classEntry.getAttribute("checked")) { var value = classEntry.getAttribute("value"); if (resultingClassAttribute) resultingClassAttribute += " "; resultingClassAttribute += value; } classEntry = classEntry.nextSibling; } GetCurrentEditor().setAttribute(gContextMenuFiringDocumentElement, "class", resultingClassAttribute); } function onIDSelectChange() { var menuPopup = document.getElementById("idSelectMenuPopup"); var classEntry = menuPopup.firstChild; var resultingID; var idEntry = menuPopup.firstChild; while (idEntry) { if (idEntry.nodeName.toLowerCase() == "menuitem" && idEntry.getAttribute("checked")) { var value = idEntry.getAttribute("value"); resultingID = value; break; } idEntry = idEntry.nextSibling; } if (resultingID) GetCurrentEditor().setAttribute(gContextMenuFiringDocumentElement, "id", resultingID); } PK Z.[^$content/editor/images/sendtoback.gifUT Gi>ػBUxGIF89a!,APH@q(cU#9Cy-`s ś c(w42 $Ӥed;PK Z.W-content/editor/images/sendtoback-disabled.gifUT Gi>ػBUxGIF89a!,^@06d 8‏*^dH9ʕ5r̐ѡΕ$E 4ƞ-,eҦs;PK Z.&content/editor/images/bringtofront.gifUT Gi>ػBUxGIF89a!,>PH@q(UZny+@m9lnA*T\jT)i2NgpuF;PK Z.-ݾ}}/content/editor/images/bringtofront-disabled.gifUT Gi>ػBUxGIF89a!,Z@p6d3H1Ǐ+^ȑJHPeH)]d2“1UbXsB)Z8QБ Oxh@;PK ((̽$content/editor/images/tag-anchor.gifUT i9ػBUxGIF89a````@!,DZ%I "Z6TTaኦ/WDfn*],ո Ac 9 PA@Zdz;PK ((A8k!content/editor/images/tag-abr.gifUT i9ػBUxGIF89a"@````@@ !,"8`hue EU.)@`(KzEh J*!owSbji9-#5V=VUJ5=3,)(212cX"Jd W ;PK s.!~!content/editor/images/tag-acr.gifUT Lw>ػBUxGIF89a8@````@@ !,8@0s" gp^av,Aw< +dB",EZ,6 z`+7Bba51'b҂)d{0 )J~ $-cdab)~z]*L.wn<*lt3-'% *c5>1THBmmmh x9>H0E;@mڷ)?6Ş8 ;PK s.?!content/editor/images/tag-adr.gifUT Lw>ػBUxGIF89a,@````@@ !,,@wH`(B1*fa7vƒN>#T,jD> *iOliQ1EE 1 ti[z2$=Oq`Xy&HJl!D7pu(*cCXgZ"!H.nDIOslj)l.|*q6xNwPF)~%  ;PK s.ޟҥ!content/editor/images/tag-ara.gifUT Mw>ػBUxGIF89a&@````@@ !,&@*"cA1f]H iU5nk;Ab@)NZ&.KR J:n𸼈yW\ޓ8`@J?&Q1;U"#LN#%M(;T!gZt.5gv?J+ ;PK s.(PP!content/editor/images/tag-bas.gifUT Mw>ػBUxGIF89a$@````@@ !,$@wт((i}flrUNJޤg]j5Tސޯ9aHxe Q`;ǵ@fѳQCE@Imop` {OBK ;%c,R_\8aL(]`fP y~/r ;PK s.A!content/editor/images/tag-blq.gifUT Nw>ػBUxGIF89a,```UU*@U@@ `Gq99rr9! ,,@0IRhi%*z58oij&ӱHB! B=SǸ$i Al %&P @8ZrR2 f =-_?u14n/q,6kiu#e,  tIKu4f{~NwqRQvnM!;PK s.U$!content/editor/images/tag-bsf.gifUT Ow>ػBUxGIF89a8@````@@ !,8@0s h\]iBrG Z(=E`+#(dvbШtJUլv<-+~N2`<^%PLp!}vM4\pr(yhBt{f]+('?l*)26-87limB/W+=?D&=n^Z3 ;PK s.m!content/editor/images/tag-btn.gifUT Ow>ػBUxGIF89a8@````@@ !,2@0.!0vix&aapd+hQ׷6h ШtJeʪجvP˒&G KӒk,sC#z^WZ#0qx$J;?tn,pzV3b9bKe) `9l @Iaf htIM6^ddDG9AcYl} ;PK s.œ!content/editor/images/tag-cit.gifUT Ow>ػBUxGIF89a&@````@@ !,&@j-TA Z$U gk䙖|:oHKr(!p<8@l5xL.ϻHXvǡi ILlyR/KNػBUxGIF89a2@```@@ `!,2@0s0 l)֑&'I XvVEƞ:/:&0ŞШTʤMl;BoH-9̺1$5dA=DtJb=1W[U ;PK s.wu!content/editor/images/tag-cod.gifUT Pw>ػBUxGIF89a&@````@@ !,&@@ jLUWU]gy@P˕*ʪl:SKרx=ORS` 5\Apy |Ng>,i~\k_< S%YFQ`XU[^v 1469;J?jDx, ;PK s.9!content/editor/images/tag-cpt.gifUT Qw>ػBUxGIF89a6@````@@ !,6@0s%+0YWٙa*@mW`/ NPnz[iJZXj zӭ#e4`gdgKG&!&ػBUxGIF89a,@````@@ !,,@wIe #:oB ThZXumW~zKƛHm&DfҸn -M2 Hૌтa$Yi(Cs xuy 3m`G^e ػBUxGIF89a,@````@@ !,,@wH!eh)%e[eԨq@!iҕ|cJj,SC 5Tmؙ5rYeafZhY;[flHc035Uu:BT&,NXBbrx`nh:sqMS )l4  ;PK s.|!content/editor/images/tag-fnt.gifUT Sw>ػBUxGIF89a&@````@@ !,&@P.We(Y dU@ p p7GppHXŤulz5 Ht4Wp<zn8Q5bSY9(: U&e7w7L4<-Xp(36Qar+ ;PK s.!content/editor/images/tag-for.gifUT Sw>ػBUxGIF89a$@````@@ !,$@w8g qalJzM8v4Ku:2 V-S(|˦e '(g_DL8m- @hWR N_ZŘgYU`jrM>(&^gaGvw%'Wbz>@"[?xD}W/Ryk ;PK s.A!content/editor/images/tag-frm.gifUT Sw>ػBUxGIF89a(@````@@ !,(@w$#fA$tBqevfaz`*,eQ!3VkTt+ iYgV1`֜N6UUt_ǰL;Cs x}qQTSc\WO->sqJe @M+g\^jp/V#!2iS.t ;PK s.`  !content/editor/images/tag-fst.gifUT Sw>ػBUxGIF89a,@````@@ H!,,@0I9h! C eX|B[<0ȀMs q@SB8*H]OΪ %2LШq]{-b, `|OQ),l\B?HZ@htD)lm/hKb_[pm;r?Lx;.?sa^SIXX8Wn$;PK s.!content/editor/images/tag-ifr.gifUT Tw>ػBUxGIF89a.@````@@ !,.@BT 5ec\Bq"1le&Zf%ya*YbȤpYD2P첤ut 4VڂFf)7&,~URRMgthB9d\X9fVO"C9]@FT0aX575 5`U%o]$'#PT ;PK s.AF!content/editor/images/tag-inp.gifUT Uw>ػBUxGIF89a&@````@@ !,&@@@U}veHeXКYXj`@``,DKV2+$ S lB/lEznǸq8zUp#l1}W*1MOS4<&:pP8O%UTe1LcPR'pr>f ;PK s.Jm!content/editor/images/tag-lbl.gifUT Uw>ػBUxGIF89a&@````@@ !,&@͛&d"a`g\ E@),MJk)e/S 7\@eov4<znpiplfc*K6\++:#V,13O3\57UI1X=1R79SdIqH)( ;PK ((C!content/editor/images/tag-lgn.gifUT i9ػBUxGIF89a0@````@@ !,0@0shaWRjEPpa[`xކ[@i`rl:I6Ix`ke,/7c; RV[z`oqmz{wyl8|YS^!Z>$(eHg\%*a9$!&j?979;8BA,EBTj} ;PK s.l!content/editor/images/tag-lnk.gifUT Uw>ػBUxGIF89a@````@@ !,@w"-2 M AکZEp8Mvh20s Ub*Ԙj[q5v)ZegbQ(.NYcu w|3y_Lodz: %? ;PK ((^Š!content/editor/images/tag-lst.gifUT i9ػBUxGIF89a2@````@@ !,2@0s0[  `W@h ˅ӡ 6l:PflZSr R׳Kŀٯv[pHvTW{j$qoxlHmwyRJ-[0&!%b +{5`g.+.")ZEA]^BIUYS ;PK s.V$!content/editor/images/tag-men.gifUT Uw>ػBUxGIF89a&@````@@ !,&@И aiՑ]V]]BGE'`Cm#3bK!4:' (,ߨL-1@h|^Dڏ9%\g~;u,d. ,_7=&+.NLd$%YJ c8S-"%w?Z) ;PK s.QQ!content/editor/images/tag-nbr.gifUT Vw>ػBUxGIF87a&cccBB!Zc))B!!s11RkJJ!ss9cc1kk1B,&` di(@p,x.k WXHDB@j,̑cGk8d p0 |VHPlb%~K~Us YT,. ,P  prWu/P[q>,CWJ-{}~A-u\^`ydfv-tEDF QH-:90U((q * ;PK s.x!content/editor/images/tag-nfr.gifUT Vw>ػBUxGIF89a,```UU*Uc@rr9@@ 99Gq! ,,@0IZh@H[0V("ږG#bX@\bqgsc?N4 Fez@ES pD}r}4>8s>?bZ- ~m/ w2ncf]wjjvu)~p|0@5'+8! ,ǥ7 ԡ3#;PK s.!content/editor/images/tag-nsc.gifUT Vw>ػBUxGIF89a,@````@@ !,,@wH 蔁8Y'`vE ŕmj "P-O&#I3KarMe @Ft%=֯V"!ػBUxGIF89a2@````@@ !,2@0s(A[聜}I1!B+[+իi~ƓL%j:h36ZX%!; Iu&m3\^^|*;UX!1kmr=swvunj&a%caKoL:{c >fA>8]!ػBUxGIF89a.@````@@ !,.@@ X `iޕmPB AL籞@8\`rl:;ȧt<Ɗ/Iʤz]5)iݧt|dY~gTTG rn4o4ouCvQ&h?^"(*ePW$>=kba`,8FQ@;6_t?:ػBUxGIF89a*@```@@ `!,*@ZQ`yaButiyڜ-̥)dol:S\J`%]Z_alc A9Ѡ&Q;:8~OOQpigm&/!_"[` \ RY9!:SAb2-m)a++Ht0 ;PK s.Nz!content/editor/images/tag-scr.gifUT Xw>ػBUxGIF89a,@```@@ `!,,@Н( PtPfCehmW`YX Ȥr (ٚ)b;U)xzn?0qZN~URN(jih3jp[oj+U )"<`'muFl^/mo^)=0rZT.42eL, ;PK s.*!content/editor/images/tag-slc.gifUT Xw>ػBUxGIF89a.@````@@ !,.@0 !j޷}iB֑1TE`\Xݡ6sE[8<@*eNVG ;PK s.Ջ"c!content/editor/images/tag-sml.gifUT Xw>ػBUxGIF89a(@````@@ !,(@P0 灙U@@ UiʢpوdoR )J< B w |Nwx¥Y^~^db((FW)) 0`GY)[b.3'?.0_#yEL+¼ ;PK s.D!content/editor/images/tag-smp.gifUT Xw>ػBUxGIF89a&@````@@ !,&@0qRe1@Vż"^ApH,VƤBV\;LSۀD3 8S Su |Nw.D1eej]X3O2 :~7G^d[07V ;3@;[%#Cxk+l ;PK s.Px!content/editor/images/tag-spn.gifUT Yw>ػBUxGIF89a&@````@@ !,&@0!h\yE`\al_@.H,TKPmf,*tb 9ΠznpqDMz!nlXa+RW/MN^2e"%Q/%VػBUxGIF89a,@````@@ !,,@Н0 Ae,I j\F!|oWjyZȤr ( rU'|\սia+ *6k]aURNdwvY6CZrZpuvEU8,G%+[aYc-ho=g]_ ABf1X_\ (ewSF/ ;PK s.!content/editor/images/tag-stl.gifUT Yw>ػBUxGIF89a(@````@@ !,(@wт('\I#`\)Uɕ{5ҮTҕ£XKJ0 * 2\!v5NkA]UU@dOu}0a "fGg S@KI^~+~Dd@T`[[W"[4mn ;PK s.`Q*!content/editor/images/tag-stn.gifUT Yw>ػBUxGIF89a2@````@@ !,2@0s v`dEPhe!"fںUSb"4iШtJ6C֬6%'h=93:c> z>sɟio[3O>y;~({nfXl gsLj '2#O^{Ab KHPh#k+.N7Kaf%CG.GXVn ;PK s.7!content/editor/images/tag-tbd.gifUT Zw>ػBUxGIF89a*@```@@ `!,*@w#x̛灜PAlۆRV9RW /YNd&a4j8Y9J!js\ݐW_<k vk~yRs~kCFKQihWd%Y1?VO o=3C:0aG@GI$\ ;PK s.͍C!content/editor/images/tag-tbl.gifUT Zw>ػBUxGIF89a(@````@@ !,(@w"-2e-F`HƑ2f'4m\wI<.'A`g9'k+`nm`dTJ OY9@TiO0ZA7^0cRXNjl{h KUf8(\epGqg!Ger_[CT0 ;PK s.YZ!content/editor/images/tag-tft.gifUT Zw>ػBUxGIF89a*@```@@ `!,*@w!(MQimu]At]Sd[\݊#Y<v4jN')$`h9qScgUV h&S|>vdA)LYqM8c^DOi\zS%LEY{jrEE_rV1 ;PK s.7!!content/editor/images/tag-thd.gifUT [w>ػBUxGIF89a*@````@@ !,*@wт(Bi& !4Jct/'Z]X,@#ޒ-e1ʜB'-*@iG ! 姑jUSejuBػBUxGIF89a$@````@@ !,$@waB2}ui ga(YdgM˔:.LBAUzI%~p9ixܐb`΁nݸ" %PiW^Fcv:TGq{_V}WAv? dv*-a_&^j ;PK s. ɾ  !content/editor/images/tag-isx.gifUT Uw>ػBUxGIF89a(```UUU*q`rr9@99G! ,(@0I)chC4A BuZeܸ,Ү黖P(3!U&PiXѐzZėN;V!Q-xh\ek osqI z#Z 0 O Ene!gUi]RJDFx~Kog@FGK yY]  ʑe$;PK s."!content/editor/images/tag-met.gifUT Uw>ػBUxGIF89a$@````@@ !,$@wHPL0b2"SuR!h!^k**yRiQ 4<Hcp:c Ђ"'6@΁nrn'3q!hwZ:SgiPd/S*dZf -r%4]U`g# ;PK s.Ik!content/editor/images/tag-ttl.gifUT [w>ػBUxGIF89a(@````@@ !,(@f!f2g qPuX;vnqtP=K-,KF20悩):@(QY%6TǺ:aïQOj)RCT[>CXE_t@UY 47VuDI;[9TPb+ ;PK P(!content/editor/images/tag-pln.gifUT D9ػBUxGIF89a#̙ffff333!,#XIK ]6)(VyJ l3 켐:phn!) >K4"x+ MʹYD w`FH@]^UoE#@g;xqhz=ػBUxGIF89a:@````@@ !,:@0pN@\1.ae @ `y1+_6@J-2 ex*ȓѮجv˽VOݰxmfO[ D򠇸ScHaymw0~?n4?H48:fdX9?jH~nQ|On`IB z5&4)meV@k oL.I7&jiBh+uCh{CyPMµa_  ;PK ((V4}content/editor/images/tag-a.gifUT i9ػBUxGIF89a```@`@@ !,Oz'I "]QlXA fرTHE[0Z a ZXd#Y!c`x @zN;PK s.!p!content/editor/images/tag-app.gifUT Mw>ػBUxGIF89a.@````@@ !,.@"+zFrd@ ! oPݖtϙjw*H0l"U,Kn :h@Ȟ#2sju ~G*eh.mlAjeopB:h&Y!8D&)`!]nYf=K#]r(aDEP t ;PK s.+content/editor/images/tag-b.gifUT Mw>ػBUxGIF89a```@@@ `!,@OZ% PEy榞겦HjR8W pzMN.!xFVŽMczN;PK s.r!content/editor/images/tag-bdo.gifUT Mw>ػBUxGIF89a@```@@ `!,@ĤALK~1\ WP.,|_`/`BeV$Ne\bJu n88xL [$jYUlɶ4|' ]X2JuMu?v1/35h\ & ;PK s.AR!content/editor/images/tag-big.gifUT Mw>ػBUxGIF89a@````@@ !,@u@4K(VqĀQ Ȫ1lxPxoJj%|@^AYKկt XجvyC(*EAӮs<(9@6Gr.yws;_4 T ;PK s.;s"content/editor/images/tag-body.gifUT Nw>ػBUxGIF89a$@````@@ !,$@w2['`]}iWƉ``~p裭f!kQL i+r tq^']Fsp p8|,j=]HstF/96^@?kB J%2dNb_<5[QSw2h97XB:D^$VA ;PK s.ӝ content/editor/images/tag-br.gifUT Ow>ػBUxGIF89a@````@@ !,@c}' Nc&`U!Y\ q #vҀB&z O@h:P(fE&!v(H*ɅJ!$kMzpuQc8ޱ< ;PK s.Է!content/editor/images/tag-col.gifUT Pw>ػBUxGIF89a```@`@@ !,@|J(Lc(@@x^0efĊ$euw^W CFS 0gR,vzqr !5$i:[OGաՖq&2:}+N02!0U6'Db@= W ;PK s.֞ϟ content/editor/images/tag-dd.gifUT Qw>ػBUxGIF89a@```@@ `!,@d}', L0S@ \PŧU[$K8-ޔ!ߎ#( @v 8hˉ"%Ҡ fA~{YLN)ЦhcA ;PK s.=7!content/editor/images/tag-del.gifUT Qw>ػBUxGIF89a@````@@ !,@t@A fUG`w 09ػBUxGIF89a@````@@ !,@~@K-UT*\ ivx끽Q&˒}K&E@zx,z4k\ Xk4G{+[S3 4s}(*K4u*Pff $ ;PK ((L .!content/editor/images/tag-dir.gifUT i9ػBUxGIF89a```@@@ `!,@u@i @F`T0LdPyk&Jx^zETd x0''98جv4ɍd[j"mwfYFwn|k`?5 & ;PK s.zJҨ!content/editor/images/tag-div.gifUT Rw>ػBUxGIF89a```@`@@ !,@mwH8 'qRAƕmc Ư|0+ P@j\7tJl䷛ 12{( ^d$N:HGj2m, P ;PK s."a͑ content/editor/images/tag-dl.gifUT Rw>ػBUxGIF89a```@@@ `!,@VfIe"}aaZH@}*a\)3QF1 dAX('j UaJ ʅ5fS%lc|>O;PK s.A content/editor/images/tag-dt.gifUT Rw>ػBUxGIF89a```@@@ `!,@^}',eUE`vp_(߮R5M*eal:F!(ݴ0Q~٨SA+~';PK s.  content/editor/images/tag-em.gifUT Sw>ػBUxGIF89a@````@@ !,@`m&ĜUd!biW^naHi{js`APX0l:mL$ґVZ A, :F2kZ[9a ;PK s.z4 content/editor/images/tag-h1.gifUT Sw>ػBUxGIF89a```@`@@ !,@NfIe"},D(M'jnlD0P7n Pc FӰR^ekJVf ؤI<Z;PK s.]j; content/editor/images/tag-h2.gifUT Sw>ػBUxGIF89a```@@@ `!,@\wIe"}4QAX6kqnY^m& tBȤR{ BT:s&({UI?DDذ),ư3|gzH7^;PK s.c~˕ content/editor/images/tag-h3.gifUT Tw>ػBUxGIF89a```@@@ `!,@ZwIe"}4KAiD3azA;QͨabrĵVn(qSa18)Q.fxx|;PK s.fhpC content/editor/images/tag-h4.gifUT Tw>ػBUxGIF89a```@`@@ !,@Vf CD%mPTVmcHdH ;]79O;PK s.bT content/editor/images/tag-h5.gifUT Tw>ػBUxGIF89a```@`@@ !,@YfIe"}$DAaaڔƵqAP`kgHdłHv1U`$p`崌r`oJfR8!;PK s.zi# content/editor/images/tag-h6.gifUT Tw>ػBUxGIF89a```@`@@ !,@ZfIe"}$A`aaڔƵHdxz1 tPp3 dbA&=ш>,vXF nnTx|;PK s. content/editor/images/tag-hr.gifUT Tw>ػBUxGIF89a@````@@ !,@]fIe #} ib@ eJ Գ3 @h:OϦr|fXR V\$8j&:8񶪩// ~O;PK s.^9q"content/editor/images/tag-html.gifUT Tw>ػBUxGIF89a&@````@@ !,&@fт8&hwz _+ ̦p|&Fc H$p1m?N.'OFЯsJFse2wjrɼZvf1N3[~5^{]T@a7igXn`mb@d0k! ;PK ((L~~content/editor/images/tag-i.gifUT i9ػBUxGIF89a```@`!,@Cz'I8!1ޤqa)niulHxx8C^@_1/qX`z ;PK s.P$J!content/editor/images/tag-img.gifUT Tw>ػBUxGIF89a@````@@ !,@{@Ab*+1UVY0UWv*]cPcm@`06 -3Jvz*i>1p\(ŕT(x2*UDC5H-/H yaccC X ;PK s."Z!content/editor/images/tag-ins.gifUT Uw>ػBUxGIF89a```@`@@ !,@w@i d@(TVYUWf}Wqm|{nGI|4P TX: جv񾣜$6uFRN~DF6< -wB-)|k^``H U ;PK s.!content/editor/images/tag-kbd.gifUT Uw>ػBUxGIF89a@````@@ !,@@%`m1LՕ!|Rxy`` EgJ o z@zఘ(,\TĬ 3Eҝѳ_HMw%sG-,2v7fe>' [ ;PK ((૶= content/editor/images/tag-li.gifUT i9ػBUxGIF89a```@`!,@T}' Ÿir(iK&RFۃ`H,1Wk8R2t^7:, XUb?x<;PK s.D`!content/editor/images/tag-map.gifUT Uw>ػBUxGIF89a@````@@ !,@T j0E1Lic`T`d?)( Lf1¦\R@z ,t h 6Cy,,LqB(",3Z>f & ;PK s.5X!content/editor/images/tag-obj.gifUT Vw>ػBUxGIF89a0@````@@ !,0@0s(݁'mfn@ȶg@\ 4@kl:HtJ+Vfz5QriSҿESE~hUW,lkqKDsnq*WR)(%_n'fQJ[94+>bZrA68:@[v0RT1 ;PK p,(c content/editor/images/tag-ol.gifUT ,9ػBUxGIF89a$@````@@ !,$nx0I8;$X $@i0( B;Ԁ-/~Aػ p$B@2BWg<9fdyal▀7  ;PK s.(content/editor/images/tag-p.gifUT Ww>ػBUxGIF89a```@@@ `!,@MUB$2 @ؑi(+NeQkp84^TM7Lbj3v+t:;PK s.Q\'!content/editor/images/tag-pre.gifUT Ww>ػBUxGIF89a@````@@ !,@iwHD2"fi(m]jJaX-¶S\1#h`ztJj2*[CwUQHRncpX%KN ;PK s.$|9content/editor/images/tag-q.gifUT Ww>ػBUxGIF89a```@`@@ !,@Tz' J(ĐKlm[JtLaDaa@,UL6xlǩTIs X"]r;;PK s. "content/editor/images/tag-s.gifUT Xw>ػBUxGIF89a```@@@ `!,@Pz' HPֵuߦ(&*1zNs*'ǹ2X6 5D+`O[c(/zzn;PK s.!content/editor/images/tag-sub.gifUT Yw>ػBUxGIF89a@```@@ `!,@|@E 1CAa]}&f=y< *%0Zצp֎F CazoܦUL`LIUn[wBDz*1G0Nd% Y ;PK s.=T !content/editor/images/tag-sup.gifUT Zw>ػBUxGIF89a@```@@ `!,@z@E 1FPX7^yxg$&ػBUxGIF89a@````@@ !,@Yf!2gƁU[hp,#kjpEeNLv[2Q'80-"]eIY+=q1;PK s.fF content/editor/images/tag-th.gifUT Zw>ػBUxGIF89a```@`@@ !,@Wfaʕ qTeD|(C,s(7*`+A$|!*n'%8Yl95|N';PK s.Bܵ| content/editor/images/tag-tr.gifUT [w>ػBUxGIF89a```@@@ `!,@\fRh%G!"8$['A!PzD;j1xsJI Cx>=k4JPKVR#e3(RüL^;PK s.z[ content/editor/images/tag-tt.gifUT [w>ػBUxGIF89a```@`@@ !,@X]% qha!xr*Y-`) ȤR)Vɯ k nnL5IJsrł`N ;PK ((xhcontent/editor/images/tag-u.gifUT i9ػBUxGIF89a```@`!,@Lz'9D Qhj~ڱe8nojjq"FZd,gڬ28KXܽE2(r;PK p,(ޚ content/editor/images/tag-ul.gifUT ,9ػBUxGIF89a$@````@@ !,$_x0I8ͻA(hp+*@q@0+j>tp?$l99 κu݂"0Z̸0w ;PK s.w!content/editor/images/tag-var.gifUT \w>ػBUxGIF89a@````@@ !,@@A T,Q1 T6zVxobY&,3,F "(D ށz0H$ԩR]X;m'<:ػ.S02Jfc$*sz|6e)6 & ;PK ((YI()content/editor/images/tag-userdefined.gifUT i9ػBUxGIF89a```@`@@ !,@Jz'II8!i \ahɥ줭ha{V$BDbK̈́ !eƲՠK)erx`L. ;PK s.g]]content/editor/images/smile.gifUT Lw>ػBUxGIF89a!,.-Ǒb"ZyI <!hnV~-+s)ev|jdC;PK s.([[!content/editor/images/s_smile.gifUT Kw>ػBUxGIF89a!,,-Ǒb"ZyI <!hnV~-r%)3v^g);PK s.dw]]&content/editor/images/smile_active.gifUT Lw>ػBUxGIF87aU,6&{)AsMXktR%F`yzkolp{hLa0&;PK s.0m]](content/editor/images/smile_disabled.gifUT Lw>ػBUxGIF87aԪU,6&{)AsMXktR%F`yzkolp{hLa0&;PK s.Wb^^%content/editor/images/smile_hover.gifUT Lw>ػBUxGIF87a,7&{)AsMXkq TE)tǼ[[f~7rX*A¥Q;PK s.^^content/editor/images/frown.gifUT Kw>ػBUxGIF89a3!,/-Ǒb"ZyI <!hnV~-JF4ߡ;PK T0ªeecontent/editor/images/wink.gifUT o6@ػBUxGIF89a!,6&{)AsMXktR% 5^f/+q'@qfEa8Lɦ;PK s.c|\\content/editor/images/sick.gifUT Lw>ػBUxGIF89a!,--Ǒb"ZyI <!hnV~-*JIfWwidd;PK s.\\\!content/editor/images/s_frown.gifUT Kw>ػBUxGIF89a!,--Ǒb"ZyI <!hnV~-JVY|j;PK T0wjcc content/editor/images/s_wink.gifUT o6@ػBUxGIF89a!,4&{)AsMXktR% 5^f/+19cl !;PK Q2h|| content/editor/EdDialogCommon.jsUT BoڻBUx/* * The contents of this file are subject to the Netscape Public * License Version 1.1 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.mozilla.org/NPL/ * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. * * The Original Code is Mozilla Communicator client code, released * March 31, 1998. * * The Initial Developer of the Original Code is Netscape * Communications Corporation. Portions created by Netscape are * Copyright (C) 1998-1999 Netscape Communications Corporation. All * Rights Reserved. * * Contributor(s): * Pete Collins * Brian King * Charles Manske (cmanske@netscape.com) * Neil Rashbrook (neil@parkwaycc.co.uk) */ // Each editor window must include this file // Object to attach commonly-used widgets (all dialogs should use this) var gDialog = {}; var gValidationError = false; // Use for 'defaultIndex' param in InitPixelOrPercentMenulist const gPixel = 0; const gPercent = 1; const gMaxPixels = 100000; // Used for image size, borders, spacing, and padding // Gecko code uses 1000 for maximum rowspan, colspan // Also, editing performance is really bad above this const gMaxRows = 1000; const gMaxColumns = 1000; const gMaxTableSize = 1000000; // Width or height of table or cells // For dialogs that expand in size. Default is smaller size see "onMoreFewer()" below var SeeMore = false; // A XUL element with id="location" for managing // dialog location relative to parent window var gLocation; // The element being edited - so AdvancedEdit can have access to it var globalElement; /* Validate contents of an input field * * inputWidget The 'textbox' XUL element for text input of the attribute's value * listWidget The 'menulist' XUL element for choosing "pixel" or "percent" * May be null when no pixel/percent is used. * minVal minimum allowed for input widget's value * maxVal maximum allowed for input widget's value * (when "listWidget" is used, maxVal is used for "pixel" maximum, * 100% is assumed if "percent" is the user's choice) * element The DOM element that we set the attribute on. May be null. * attName Name of the attribute to set. May be null or ignored if "element" is null * mustHaveValue If true, error dialog is displayed if "value" is empty string * * This calls "ValidateNumberRange()", which puts up an error dialog to inform the user. * If error, we also: * Shift focus and select contents of the inputWidget, * Switch to appropriate panel of tabbed dialog if user implements "SwitchToValidate()", * and/or will expand the dialog to full size if "More / Fewer" feature is implemented * * Returns the "value" as a string, or "" if error or input contents are empty * The global "gValidationError" variable is set true if error was found */ function ValidateNumber(inputWidget, listWidget, minVal, maxVal, element, attName, mustHaveValue, mustShowMoreSection) { if (!inputWidget) { gValidationError = true; return ""; } // Global error return value gValidationError = false; var maxLimit = maxVal; var isPercent = false; var numString = TrimString(inputWidget.value); if (numString || mustHaveValue) { if (listWidget) isPercent = (listWidget.selectedIndex == 1); if (isPercent) maxLimit = 100; // This method puts up the error message numString = ValidateNumberRange(numString, minVal, maxLimit, mustHaveValue); if(!numString) { // Switch to appropriate panel for error reporting SwitchToValidatePanel(); // or expand dialog for users of "More / Fewer" button if ("dialog" in window && dialog && "MoreSection" in gDialog && gDialog.MoreSection) { if ( !SeeMore ) onMoreFewer(); } // Error - shift to offending input widget SetTextboxFocus(inputWidget); gValidationError = true; } else { if (isPercent) numString += "%"; if (element) GetCurrentEditor().setAttributeOrEquivalent(element, attName, numString, true); } } else if (element) { GetCurrentEditor().removeAttributeOrEquivalent(element, attName, true) } return numString; } /* Validate contents of an input field * * value number to validate * minVal minimum allowed for input widget's value * maxVal maximum allowed for input widget's value * (when "listWidget" is used, maxVal is used for "pixel" maximum, * 100% is assumed if "percent" is the user's choice) * mustHaveValue If true, error dialog is displayed if "value" is empty string * * If inputWidget's value is outside of range, or is empty when "mustHaveValue" = true, * an error dialog is popuped up to inform the user. The focus is shifted * to the inputWidget. * * Returns the "value" as a string, or "" if error or input contents are empty * The global "gValidationError" variable is set true if error was found */ function ValidateNumberRange(value, minValue, maxValue, mustHaveValue) { // Initialize global error flag gValidationError = false; value = TrimString(String(value)); // We don't show error for empty string unless caller wants to if (!value && !mustHaveValue) return ""; var numberStr = ""; if (value.length > 0) { // Extract just numeric characters var number = Number(value.replace(/\D+/g, "")); if (number >= minValue && number <= maxValue ) { // Return string version of the number return String(number); } numberStr = String(number); } var message = ""; if (numberStr.length > 0) { // We have a number from user outside of allowed range message = GetString( "ValidateRangeMsg"); message = message.replace(/%n%/, numberStr); message += "\n "; } message += GetString( "ValidateNumberMsg"); // Replace variable placeholders in message with number values message = message.replace(/%min%/, minValue).replace(/%max%/, maxValue); ShowInputErrorMessage(message); // Return an empty string to indicate error gValidationError = true; return ""; } function SetTextboxFocusById(id) { SetTextboxFocus(document.getElementById(id)); } function SetTextboxFocus(textbox) { if (textbox) { //XXX Using the setTimeout is hacky workaround for bug 103197 // Must create a new function to keep "textbox" in scope setTimeout( function(textbox) { textbox.focus(); textbox.select(); }, 0, textbox ); } } function ShowInputErrorMessage(message) { AlertWithTitle(GetString("InputError"), message); window.focus(); } // Get the text appropriate to parent container // to determine what a "%" value is referring to. // elementForAtt is element we are actually setting attributes on // (a temporary copy of element in the doc to allow canceling), // but elementInDoc is needed to find parent context in document function GetAppropriatePercentString(elementForAtt, elementInDoc) { var editor = GetCurrentEditor(); try { var name = elementForAtt.nodeName.toLowerCase(); if ( name == "td" || name == "th") return GetString("PercentOfTable"); // Check if element is within a table cell if (editor.getElementOrParentByTagName("td", elementInDoc)) return GetString("PercentOfCell"); else return GetString("PercentOfWindow"); } catch (e) { return "";} } function ClearListbox(listbox) { if (listbox) { listbox.clearSelection(); while (listbox.firstChild) listbox.removeChild(listbox.firstChild); } } function forceInteger(elementID) { var editField = document.getElementById( elementID ); if ( !editField ) return; var stringIn = editField.value; if (stringIn && stringIn.length > 0) { // Strip out all nonnumeric characters stringIn = stringIn.replace(/\D+/g,""); if (!stringIn) stringIn = ""; // Write back only if changed if (stringIn != editField.value) editField.value = stringIn; } } function LimitStringLength(elementID, length) { var editField = document.getElementById( elementID ); if ( !editField ) return; var stringIn = editField.value; if (stringIn && stringIn.length > length) editField.value = stringIn.slice(0,length); } function InitPixelOrPercentMenulist(elementForAtt, elementInDoc, attribute, menulistID, defaultIndex) { if (!defaultIndex) defaultIndex = gPixel; // var size = elementForAtt.getAttribute(attribute); var size = GetHTMLOrCSSStyleValue(elementForAtt, attribute, attribute) var menulist = document.getElementById(menulistID); var pixelItem; var percentItem; if (!menulist) { dump("NO MENULIST found for ID="+menulistID+"\n"); return size; } menulist.removeAllItems(); pixelItem = menulist.appendItem(GetString("Pixels")); pixelItem.value = "px"; if (!pixelItem) return 0; percentItem = menulist.appendItem(GetAppropriatePercentString(elementForAtt, elementInDoc)); percentItem.value = "pc"; if (size && size.length > 0) { // Search for a "%" or "px" if (/%/.test(size)) { // Strip out the % size = RegExp.leftContext; if (percentItem) menulist.selectedItem = percentItem; } else { if (/px/.test(size)) // Strip out the px size = RegExp.leftContext; menulist.selectedItem = pixelItem; } } else menulist.selectedIndex = defaultIndex; return size; } function onAdvancedEdit() { // First validate data from widgets in the "simpler" property dialog if (ValidateData()) { // Set true if OK is clicked in the Advanced Edit dialog window.AdvancedEditOK = false; // Open the AdvancedEdit dialog, passing in the element to be edited // (the copy named "globalElement") window.openDialog("chrome://editor/content/EdAdvancedEdit.xul", "_blank", "chrome,close,titlebar,modal,resizable=yes", "", globalElement); window.focus(); if (window.AdvancedEditOK) { // Copy edited attributes to the dialog widgets: InitDialog(); } } } function getColor(ColorPickerID) { var colorPicker = document.getElementById(ColorPickerID); var color; if (colorPicker) { // Extract color from colorPicker and assign to colorWell. color = colorPicker.getAttribute("color"); if (color && color == "") return null; // Clear color so next if it's called again before // color picker is actually used, we dedect the "don't set color" state colorPicker.setAttribute("color",""); } return color; } function setColorWell(ColorWellID, color) { var colorWell = document.getElementById(ColorWellID); if (colorWell) { if (!color || color == "") { // Don't set color (use default) // Trigger change to not show color swatch colorWell.setAttribute("default","true"); // Style in CSS sets "background-color", // but color won't clear unless we do this: colorWell.removeAttribute("style"); } else { colorWell.removeAttribute("default"); // Use setAttribute so colorwell can be a XUL element, such as button colorWell.setAttribute("style", "background-color:"+color); } } } function getColorAndSetColorWell(ColorPickerID, ColorWellID) { var color = getColor(ColorPickerID); setColorWell(ColorWellID, color); return color; } function InitMoreFewer() { // Set SeeMore bool to the OPPOSITE of the current state, // which is automatically saved by using the 'persist="more"' // attribute on the gDialog.MoreFewerButton button // onMoreFewer will toggle it and redraw the dialog SeeMore = (gDialog.MoreFewerButton.getAttribute("more") != "1"); onMoreFewer(); gDialog.MoreFewerButton.setAttribute("accesskey",GetString("PropertiesAccessKey")); } function onMoreFewer() { if (SeeMore) { gDialog.MoreSection.collapsed = true; gDialog.MoreFewerButton.setAttribute("more","0"); gDialog.MoreFewerButton.setAttribute("label",GetString("MoreProperties")); SeeMore = false; } else { gDialog.MoreSection.collapsed = false; gDialog.MoreFewerButton.setAttribute("more","1"); gDialog.MoreFewerButton.setAttribute("label",GetString("FewerProperties")); SeeMore = true; } window.sizeToContent(); } function SwitchToValidatePanel() { // no default implementation // Only EdTableProps.js currently implements this } const nsIFilePicker = Components.interfaces.nsIFilePicker; function GetLocalFileURL(filterType) { var fp = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker); var fileType = "html"; if (filterType == "img") { fp.init(window, GetString("SelectImageFile"), nsIFilePicker.modeOpen); fp.appendFilters(nsIFilePicker.filterImages); fileType = "image"; } // Current usage of this is in Link dialog, // where we always want HTML first else if (filterType.indexOf("html") == 0) { fp.init(window, GetString("OpenHTMLFile"), nsIFilePicker.modeOpen); // When loading into Composer, direct user to prefer HTML files and text files, // so we call separately to control the order of the filter list fp.appendFilters(nsIFilePicker.filterHTML); fp.appendFilters(nsIFilePicker.filterText); // Link dialog also allows linking to images if (filterType.indexOf("img") > 0) fp.appendFilters(nsIFilePicker.filterImages); } // Default or last filter is "All Files" fp.appendFilters(nsIFilePicker.filterAll); // set the file picker's current directory to last-opened location saved in prefs SetFilePickerDirectory(fp, fileType); /* doesn't handle *.shtml files */ try { var ret = fp.show(); if (ret == nsIFilePicker.returnCancel) return null; } catch (ex) { dump("filePicker.chooseInputFile threw an exception\n"); return null; } SaveFilePickerDirectory(fp, fileType); var fileHandler = GetFileProtocolHandler(); return fp.file ? fileHandler.getURLSpecFromFile(fp.file) : null; } function GetMetaElement(name) { if (name) { name = name.toLowerCase(); if (name != "") { var editor = GetCurrentEditor(); try { var metaNodes = editor.document.getElementsByTagName("meta"); for (var i = 0; i < metaNodes.length; i++) { var metaNode = metaNodes.item(i); if (metaNode && metaNode.getAttribute("name") == name) return metaNode; } } catch (e) {} } } return null; } function CreateMetaElement(name) { var editor = GetCurrentEditor(); try { var metaElement = editor.createElementWithDefaults("meta"); metaElement.setAttribute("name", name); return metaElement; } catch (e) {} return null; } function GetHTTPEquivMetaElement(name) { if (name) { name = name.toLowerCase(); if (name != "") { var editor = GetCurrentEditor(); try { var metaNodes = editor.document.getElementsByTagName("meta"); for (var i = 0; i < metaNodes.length; i++) { var metaNode = metaNodes.item(i); if (metaNode) { var httpEquiv = metaNode.getAttribute("http-equiv"); if (httpEquiv && httpEquiv.toLowerCase() == name) return metaNode; } } } catch (e) {} } } return null; } function CreateHTTPEquivMetaElement(name) { var editor = GetCurrentEditor(); try { var metaElement = editor.createElementWithDefaults("meta"); metaElement.setAttribute("http-equiv", name); return metaElement; } catch (e) {} return null; } function CreateHTTPEquivElement(name) { var editor = GetCurrentEditor(); try { var metaElement = editor.createElementWithDefaults("meta"); metaElement.setAttribute("http-equiv", name); return metaElement; } catch (e) {} return null; } // Change "content" attribute on a META element, // or delete entire element it if content is empty // This uses undoable editor transactions function SetMetaElementContent(metaElement, content, insertNew, prepend) { if (metaElement) { var editor = GetCurrentEditor(); try { if(!content || content == "") { if (!insertNew) editor.deleteNode(metaElement); } else { if (insertNew) { metaElement.setAttribute("content", content); if (prepend) PrependHeadElement(metaElement); else AppendHeadElement(metaElement); } else editor.setAttribute(metaElement, "content", content); } } catch (e) {} } } function GetHeadElement() { var editor = GetCurrentEditor(); try { var headList = editor.document.getElementsByTagName("head"); return headList.item(0); } catch (e) {} return null; } function PrependHeadElement(element) { var head = GetHeadElement(); if (head) { var editor = GetCurrentEditor(); try { // Use editor's undoable transaction // Last param "true" says "don't change the selection" editor.insertNode(element, head, 0, true); } catch (e) {} } } function AppendHeadElement(element) { var head = GetHeadElement(); if (head) { var position = 0; if (head.hasChildNodes()) position = head.childNodes.length; var editor = GetCurrentEditor(); try { // Use editor's undoable transaction // Last param "true" says "don't change the selection" editor.insertNode(element, head, position, true); } catch (e) {} } } function SetWindowLocation() { gLocation = document.getElementById("location"); if (gLocation) { window.screenX = Math.max(0, Math.min(window.opener.screenX + Number(gLocation.getAttribute("offsetX")), screen.availWidth - window.outerWidth)); window.screenY = Math.max(0, Math.min(window.opener.screenY + Number(gLocation.getAttribute("offsetY")), screen.availHeight - window.outerHeight)); } } function SaveWindowLocation() { if (gLocation) { var newOffsetX = window.screenX - window.opener.screenX; var newOffsetY = window.screenY - window.opener.screenY; gLocation.setAttribute("offsetX", window.screenX - window.opener.screenX); gLocation.setAttribute("offsetY", window.screenY - window.opener.screenY); } } function CenterWindowLocation() { window.screenX = Math.max(0, Math.min(window.opener.screenX + (window.opener.outerWidth / 2) - (window.document.width / 2), screen.availWidth - window.document.width )); window.screenY = Math.max(0, Math.min(window.opener.screenY + (window.opener.outerHeight / 2) - (window.document.height / 2), screen.availHeight - window.document.height)); } function onCancel() { SaveWindowLocation(); // Close dialog by returning true return true; } function SetRelativeCheckbox(checkbox) { if (!checkbox) { checkbox = document.getElementById("MakeRelativeCheckbox"); if (!checkbox) return; } var editor = GetCurrentEditor(); // Mail never allows relative URLs, so hide the checkbox if (editor && (editor.flags & Components.interfaces.nsIPlaintextEditor.eEditorMailMask)) { checkbox.collapsed = true; return; } var input = document.getElementById(checkbox.getAttribute("for")); if (!input) return; var url = TrimString(input.value); var urlScheme = GetScheme(url); // Check it if url is relative (no scheme). checkbox.checked = url.length > 0 && !urlScheme; // Now do checkbox enabling: var enable = false; var docUrl = GetDocumentBaseUrl(); var docScheme = GetScheme(docUrl); if (url && docUrl && docScheme) { if (urlScheme) { // Url is absolute // If we can make a relative URL, then enable must be true! // (this lets the smarts of MakeRelativeUrl do all the hard work) enable = (GetScheme(MakeRelativeUrl(url)).length == 0); } else { // Url is relative // Check if url is a named anchor // but document doesn't have a filename // (it's probably "index.html" or "index.htm", // but we don't want to allow a malformed URL) if (url[0] == "#") { var docFilename = GetFilename(docUrl); enable = docFilename.length > 0; } else { // Any other url is assumed // to be ok to try to make absolute enable = true; } } } SetElementEnabled(checkbox, enable); } // oncommand handler for the Relativize checkbox in EditorOverlay.xul function MakeInputValueRelativeOrAbsolute(checkbox) { var input = document.getElementById(checkbox.getAttribute("for")); if (!input) return; var docUrl = GetDocumentBaseUrl(); if (!docUrl) { // Checkbox should be disabled if not saved, // but keep this error message in case we change that AlertWithTitle("", GetString("SaveToUseRelativeUrl")); window.focus(); } else { // Note that "checked" is opposite of its last state, // which determines what we want to do here if (checkbox.checked) input.value = MakeRelativeUrl(input.value); else input.value = MakeAbsoluteUrl(input.value); // Reset checkbox to reflect url state SetRelativeCheckbox(checkbox); } } var IsBlockParent = { applet: true, blockquote: true, body: true, center: true, dd: true, div: true, form: true, li: true, noscript: true, object: true, td: true, th: true }; var NotAnInlineParent = { col: true, colgroup: true, dl: true, dir: true, menu: true, ol: true, table: true, tbody: true, tfoot: true, thead: true, tr: true, ul: true }; function cleanToLowerCase(s) { return s ? s.toLowerCase() : null; } function nodeIsBreak(editor, node) { return !node || cleanToLowerCase(node.localName) == 'br' || editor.nodeIsBlock(node); } function InsertElementAroundSelection(element) { var editor = GetCurrentEditor(); editor.beginTransaction(); try { // First get the selection as a single range var range, start, end, offset; var count = editor.selection.rangeCount; if (count == 1) range = editor.selection.getRangeAt(0).cloneRange(); else { range = editor.document.createRange(); start = editor.selection.getRangeAt(0) range.setStart(start.startContainer, start.startOffset); end = editor.selection.getRangeAt(--count); range.setEnd(end.endContainer, end.endOffset); } // Flatten the selection to child nodes of the common ancestor while (range.startContainer != range.commonAncestorContainer) range.setStartBefore(range.startContainer); while (range.endContainer != range.commonAncestorContainer) range.setEndAfter(range.endContainer); if (editor.nodeIsBlock(element)) // Block element parent must be a valid block while (!(cleanToLowerCase(range.commonAncestorContainer.localName) in IsBlockParent)) range.selectNode(range.commonAncestorContainer); else { // Fail if we're not inserting a block (use setInlineProperty instead) if (!nodeIsBreak(editor, range.commonAncestorContainer)) return false; else if (cleanToLowerCase(range.commonAncestorContainer.localName) in NotAnInlineParent) // Inline element parent must not be an invalid block do range.selectNode(range.commonAncestorContainer); while (cleanToLowerCase(range.commonAncestorContainer.localName) in NotAnInlineParent); else // Further insert block check for (var i = range.startOffset; ; i++) if (i == range.endOffset) return false; else if (nodeIsBreak(editor, range.commonAncestorContainer.childNodes[i])) break; } // The range may be contained by body text, which should all be selected. offset = range.startOffset; start = range.startContainer.childNodes[offset]; if (!nodeIsBreak(editor, start)) { while (!nodeIsBreak(editor, start.previousSibling)) { start = start.previousSibling; offset--; } } end = range.endContainer.childNodes[range.endOffset]; if (end && !nodeIsBreak(editor, end.previousSibling)) { while (!nodeIsBreak(editor, end)) end = end.nextSibling; } // Now insert the node editor.insertNode(element, range.commonAncestorContainer, offset, true); offset = element.childNodes.length; if (!editor.nodeIsBlock(element)) editor.setShouldTxnSetSelection(false); // Move all the old child nodes to the element var empty = true; while (start != end) { var next = start.nextSibling; editor.deleteNode(start); editor.insertNode(start, element, element.childNodes.length); empty = false; start = next; } if (!editor.nodeIsBlock(element)) editor.setShouldTxnSetSelection(true); else { // Also move a trailing
if (start && start.localName.toLowerCase() == 'br') { editor.deleteNode(start); editor.insertNode(start, element, element.childNodes.length); empty = false; } // Still nothing? Insert a
so the node is not empty if (empty) editor.insertNode(editor.createElementWithDefaults("br"), element, element.childNodes.length); // Hack to set the selection just inside the element editor.insertNode(editor.document.createTextNode(""), element, offset); } } finally { editor.endTransaction(); } return true; } function nodeIsBlank(node) { return node && node.nodeType == Node.TEXT_NODE && !/\S/.test(node.data); } function nodeBeginsBlock(editor, node) { while (nodeIsBlank(node)) node = node.nextSibling; return nodeIsBreak(editor, node); } function nodeEndsBlock(editor, node) { while (nodeIsBlank(node)) node = node.previousSibling; return nodeIsBreak(editor, node); } // C++ function isn't exposed to JS :-( function RemoveBlockContainer(element) { var editor = GetCurrentEditor(); editor.beginTransaction(); try { var range = editor.document.createRange(); range.selectNode(element); var offset = range.startOffset; var parent = element.parentNode; // May need to insert a break after the removed element if (!nodeBeginsBlock(editor, element.nextSibling) && !nodeEndsBlock(editor, element.lastChild)) editor.insertNode(editor.createElementWithDefaults("br"), parent, range.endOffset); // May need to insert a break before the removed element, or if it was empty if (!nodeEndsBlock(editor, element.previousSibling) && !nodeBeginsBlock(editor, element.firstChild || element.nextSibling)) editor.insertNode(editor.createElementWithDefaults("br"), parent, offset++); // Now remove the element editor.deleteNode(element); // Need to copy the contained nodes? for (var i = 0; i < element.childNodes.length; i++) editor.insertNode(element.childNodes[i].cloneNode(true), parent, offset++); } finally { editor.endTransaction(); } } // C++ function isn't exposed to JS :-( function RemoveContainer(element) { var editor = GetCurrentEditor(); editor.beginTransaction(); try { var range = editor.document.createRange(); var parent = element.parentNode; // Allow for automatic joining of text nodes // so we can't delete the container yet // so we need to copy the contained nodes for (var i = 0; i < element.childNodes.length; i++) { range.selectNode(element); editor.insertNode(element.childNodes[i].cloneNode(true), parent, range.startOffset); } // Now remove the element editor.deleteNode(element); } finally { editor.endTransaction(); } } function FillLinkMenulist(linkMenulist, headingsArray) { var menupopup = linkMenulist.firstChild; var editor = GetCurrentEditor(); try { var treeWalker = editor.document.createTreeWalker(editor.document, 1, null, true); var headingList = []; var anchorList = []; // for sorting var anchorMap = {}; // for weeding out duplicates and making heading anchors unique var anchor; var i; for (var element = treeWalker.nextNode(); element; element = treeWalker.nextNode()) { // grab headings // Skip headings that already have a named anchor as their first child // (this may miss nearby anchors, but at least we don't insert another // under the same heading) if (element instanceof HTMLHeadingElement && element.textContent && !(element.firstChild instanceof HTMLAnchorElement && element.firstChild.name)) headingList.push(element); // grab named anchors if (element instanceof HTMLAnchorElement && element.name) { anchor = '#' + element.name; if (!(anchor in anchorMap)) { anchorList.push({anchor: anchor, sortkey: anchor.toLowerCase()}); anchorMap[anchor] = true; } } // grab IDs if (element.id) { anchor = '#' + element.id; if (!(anchor in anchorMap)) { anchorList.push({anchor: anchor, sortkey: anchor.toLowerCase()}); anchorMap[anchor] = true; } } } // add anchor for headings for (i = 0; i < headingList.length; i++) { var heading = headingList[i]; // Use just first 40 characters, don't add "...", // and replace whitespace with "_" and strip non-word characters anchor = '#' + ConvertToCDATAString(TruncateStringAtWordEnd(heading.textContent, 40, false)); // Append "_" to any name already in the list while (anchor in anchorMap) anchor += "_"; anchorList.push({anchor: anchor, sortkey: anchor.toLowerCase()}); anchorMap[anchor] = true; // Save nodes in an array so we can create anchor node under it later headingsArray[anchor] = heading; } if (anchorList.length) { // case insensitive sort function compare(a, b) { if(a.sortkey < b.sortkey) return -1; if(a.sortkey > b.sortkey) return 1; return 0; } anchorList.sort(compare); for (i = 0; i < anchorList.length; i++) createMenuItem(menupopup,anchorList[i].anchor); } else { var item = createMenuItem(menupopup, GetString("NoNamedAnchorsOrHeadings")); item.setAttribute("disabled", "true"); } } catch (e) {} } function createMenuItem(aMenuPopup, aLabel) { var menuitem = document.createElement("menuitem"); menuitem.setAttribute("label", aLabel); aMenuPopup.appendChild(menuitem); return menuitem; } // Shared by Image and Link dialogs for the "Choose" button for links function chooseLinkFile() { // Get a local file, converted into URL format var fileName = GetLocalFileURL("html, img"); if (fileName) { // Always try to relativize local file URLs if (gHaveDocumentUrl) fileName = MakeRelativeUrl(fileName); gDialog.hrefInput.value = fileName; // Do stuff specific to a particular dialog // (This is defined separately in Image and Link dialogs) ChangeLinkLocation(); } // Put focus into the input field SetTextboxFocus(gDialog.hrefInput); } PK (_2XŸU%U%content/editor/EdLinkProps.xulUT BoڻBUx PK l,"-~R !content/navigator/turboDialog.xulUT {r=ٻBUx %turboDialogDTD; %dialogOverlayDTD; %brandDTD; ]> &exitWarningMsg.label; PK X+/u A Acontent/navigator/viewsource.jsUT ;`?ٻBUx/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. * * The Original Code is mozilla.org code. * * The Initial Developer of the Original Code is Netscape * Communications Corporation. Portions created by Netscape are * Copyright (C) Netscape Communications Corporation. All * Rights Reserved. * * Contributor(s): * Doron Rosenberg (doronr@naboonline.com) * Neil Rashbrook (neil@parkwaycc.co.uk) */ const pageLoaderIface = Components.interfaces.nsIWebPageDescriptor; const nsISelectionPrivate = Components.interfaces.nsISelectionPrivate; const nsISelectionController = Components.interfaces.nsISelectionController; var gBrowser = null; var gViewSourceBundle = null; var gPrefs = null; var gLastLineFound = ''; var gGoToLine = 0; try { var prefService = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); gPrefs = prefService.getBranch(null); } catch (ex) { } var gSelectionListener = { timeout: 0, notifySelectionChanged: function(doc, sel, reason) { // Coalesce notifications within 100ms intervals. if (!this.timeout) this.timeout = setTimeout(updateStatusBar, 100); } } function onLoadViewSource() { viewSource(window.arguments[0]); document.commandDispatcher.focusedWindow = content; } function getBrowser() { if (!gBrowser) gBrowser = document.getElementById("content"); return gBrowser; } function getSelectionController() { return getBrowser().docShell .QueryInterface(Components.interfaces.nsIInterfaceRequestor) .getInterface(Components.interfaces.nsISelectionDisplay) .QueryInterface(nsISelectionController); } function getViewSourceBundle() { if (!gViewSourceBundle) gViewSourceBundle = document.getElementById("viewSourceBundle"); return gViewSourceBundle; } function viewSource(url) { if (!url) return false; // throw Components.results.NS_ERROR_FAILURE; getBrowser().addEventListener("unload", onUnloadContent, true); getBrowser().addEventListener("load", onLoadContent, true); var loadFromURL = true; // // Parse the 'arguments' supplied with the dialog. // arg[0] - URL string. // arg[1] - Charset value in the form 'charset=xxx'. // arg[2] - Page descriptor used to load content from the cache. // arg[3] - Line number to go to. // if ("arguments" in window) { var arg; // // Set the charset of the viewsource window... // if (window.arguments.length >= 2) { arg = window.arguments[1]; try { if (typeof(arg) == "string" && arg.indexOf('charset=') != -1) { var arrayArgComponents = arg.split('='); if (arrayArgComponents) { //we should "inherit" the charset menu setting in a new window getMarkupDocumentViewer().defaultCharacterSet = arrayArgComponents[1]; } } } catch (ex) { // Ignore the failure and keep processing arguments... } } // // Get any specified line to jump to. // if (window.arguments.length >= 4) { arg = window.arguments[3]; gGoToLine = parseInt(arg); } // // Use the page descriptor to load the content from the cache (if // available). // if (window.arguments.length >= 3) { arg = window.arguments[2]; try { if (typeof(arg) == "object" && arg != null) { var PageLoader = getBrowser().webNavigation.QueryInterface(pageLoaderIface); // // Load the page using the page descriptor rather than the URL. // This allows the content to be fetched from the cache (if // possible) rather than the network... // PageLoader.LoadPage(arg, pageLoaderIface.DISPLAY_AS_SOURCE); // The content was successfully loaded from the page cookie. loadFromURL = false; } } catch(ex) { // Ignore the failure. The content will be loaded via the URL // that was supplied in arg[0]. } } } if (loadFromURL) { // // Currently, an exception is thrown if the URL load fails... // var loadFlags = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE; var viewSrcUrl = "view-source:" + url; getBrowser().webNavigation.loadURI(viewSrcUrl, loadFlags, null, null, null); } //check the view_source.wrap_long_lines pref and set the menuitem's checked attribute accordingly if (gPrefs) { try { var wraplonglinesPrefValue = gPrefs.getBoolPref("view_source.wrap_long_lines"); if (wraplonglinesPrefValue) document.getElementById('menu_wrapLongLines').setAttribute("checked", "true"); } catch (ex) { } try { document.getElementById("menu_highlightSyntax").setAttribute("checked", gPrefs.getBoolPref("view_source.syntax_highlight")); } catch (ex) { } } else { document.getElementById("menu_highlightSyntax").setAttribute("hidden", "true"); } window._content.focus(); return true; } function onLoadContent() { // // If the view source was opened with a "go to line" argument. // if (gGoToLine > 0) { goToLine(gGoToLine); gGoToLine = 0; } document.getElementById('cmd_goToLine').removeAttribute('disabled'); // Register a listener so that we can show the caret position on the status bar. window._content.getSelection() .QueryInterface(nsISelectionPrivate) .addSelectionListener(gSelectionListener); } function onUnloadContent() { // // Disable "go to line" while reloading due to e.g. change of charset // or toggling of syntax highlighting. // document.getElementById('cmd_goToLine').setAttribute('disabled', 'true'); } function ViewSourceClose() { window.close(); } function BrowserReload() { // Reload will always reload from cache which is probably not what's wanted BrowserReloadSkipCache(); } function BrowserReloadSkipCache() { const webNavigation = getBrowser().webNavigation; webNavigation.reload(webNavigation.LOAD_FLAGS_BYPASS_PROXY | webNavigation.LOAD_FLAGS_BYPASS_CACHE); } // Strips the |view-source:| for editPage() function ViewSourceEditPage() { editPage(window.content.location.href.substring(12), window, false); } // Strips the |view-source:| for saveURL() function ViewSourceSavePage() { saveURL(window.content.location.href.substring(12), null, "SaveLinkTitle"); } function ViewSourceGoToLine() { var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); var viewSourceBundle = getViewSourceBundle(); var input = {value:gLastLineFound}; for (;;) { var ok = promptService.prompt( window, viewSourceBundle.getString("goToLineTitle"), viewSourceBundle.getString("goToLineText"), input, null, {value:0}); if (!ok) return; var line = parseInt(input.value); if (!(line > 0)) { promptService.alert(window, viewSourceBundle.getString("invalidInputTitle"), viewSourceBundle.getString("invalidInputText")); continue; } var found = goToLine(line); if (found) { break; } promptService.alert(window, viewSourceBundle.getString("outOfRangeTitle"), viewSourceBundle.getString("outOfRangeText")); } } function goToLine(line) { var viewsource = window._content.document.body; // // The source document is made up of a number of pre elements with // id attributes in the format
, meaning that
  // the first line in the pre element is number 123.
  // Do binary search to find the pre element containing the line.
  //
  var pre;
  for (var lbound = 0, ubound = viewsource.childNodes.length; ; ) {
    var middle = (lbound + ubound) >> 1;
    pre = viewsource.childNodes[middle];

    var firstLine = parseInt(pre.id.substring(4));

    if (lbound == ubound - 1) {
      break;
    }

    if (line >= firstLine) {
      lbound = middle;
    } else {
      ubound = middle;
    }
  }

  var result = {};
  var found = findLocation(pre, line, null, -1, false, result);

  if (!found) {
    return false;
  }

  var selection = window._content.getSelection();
  selection.removeAllRanges();

  // In our case, the range's startOffset is after "\n" on the previous line.
  // Tune the selection at the beginning of the next line and do some tweaking
  // to position the focusNode and the caret at the beginning of the line.

  selection.QueryInterface(nsISelectionPrivate)
    .interlinePosition = true;	

  selection.addRange(result.range);

  if (!selection.isCollapsed) {
    selection.collapseToEnd();

    var offset = result.range.startOffset;
    var node = result.range.startContainer;
    if (offset < node.data.length) {
      // The same text node spans across the "\n", just focus where we were.
      selection.extend(node, offset);
    }
    else {
      // There is another tag just after the "\n", hook there. We need
      // to focus a safe point because there are edgy cases such as
      // ...\n... vs.
      // ...\n......
      node = node.nextSibling ? node.nextSibling : node.parentNode.nextSibling;
      selection.extend(node, 0);
    }
  }

  var selCon = getSelectionController();
  selCon.setDisplaySelection(nsISelectionController.SELECTION_ON);
  selCon.setCaretEnabled(true);
  selCon.setCaretVisibilityDuringSelection(true);

  // Scroll the beginning of the line into view.
  selCon.scrollSelectionIntoView(
    nsISelectionController.SELECTION_NORMAL,
    nsISelectionController.SELECTION_FOCUS_REGION,
    true);

  gLastLineFound = line;

  document.getElementById("statusbar-line-col").label = getViewSourceBundle()
      .getFormattedString("statusBarLineCol", [line, 1]);

  return true;
}

function updateStatusBar()
{
  // Reset the coalesce flag.
  gSelectionListener.timeout = 0;

  var statusBarField = document.getElementById("statusbar-line-col");

  var selection = window._content.getSelection();
  if (!selection.focusNode) {
    statusBarField.label = '';
    return;
  }
  if (selection.focusNode.nodeType != Node.TEXT_NODE) {
    return;
  }

  var selCon = getSelectionController();
  selCon.setDisplaySelection(nsISelectionController.SELECTION_ON);
  selCon.setCaretEnabled(true);
  selCon.setCaretVisibilityDuringSelection(true);

  var interlinePosition = selection
      .QueryInterface(nsISelectionPrivate).interlinePosition;

  var result = {};
  findLocation(null, -1, 
      selection.focusNode, selection.focusOffset, interlinePosition, result);

  statusBarField.label = getViewSourceBundle()
      .getFormattedString("statusBarLineCol", [result.line, result.col]);
}

//
// Loops through the text lines in the pre element. The arguments are either
// (pre, line) or (node, offset, interlinePosition). result is an out
// argument. If (pre, line) are specified (and node == null), result.range is
// a range spanning the specified line. If the (node, offset,
// interlinePosition) are specified, result.line and result.col are the line
// and column number of the specified offset in the specified node relative to
// the whole file.
//
function findLocation(pre, line, node, offset, interlinePosition, result)
{
  if (node && !pre) {
    //
    // Look upwards to find the current pre element.
    //
    for (pre = node;
         pre.nodeName != "PRE";
         pre = pre.parentNode);
  }

  //
  // The source document is made up of a number of pre elements with
  // id attributes in the format 
, meaning that
  // the first line in the pre element is number 123.
  //
  var curLine = parseInt(pre.id.substring(4));

  //
  // Walk through each of the text nodes and count newlines.
  //
  var treewalker = window._content.document
      .createTreeWalker(pre, NodeFilter.SHOW_TEXT, null, false);

  //
  // The column number of the first character in the current text node.
  //
  var firstCol = 1;

  var found = false;
  for (var textNode = treewalker.firstChild();
       textNode && !found;
       textNode = treewalker.nextNode()) {

    //
    // \r is not a valid character in the DOM, so we only check for \n.
    //
    var lineArray = textNode.data.split(/\n/);
    var lastLineInNode = curLine + lineArray.length - 1;

    //
    // Check if we can skip the text node without further inspection.
    //
    if (node ? (textNode != node) : (lastLineInNode < line)) {
      if (lineArray.length > 1) {
        firstCol = 1;
      }
      firstCol += lineArray[lineArray.length - 1].length;
      curLine = lastLineInNode;
      continue;
    }

    //
    // curPos is the offset within the current text node of the first
    // character in the current line.
    //
    for (var i = 0, curPos = 0;
         i < lineArray.length;
         curPos += lineArray[i++].length + 1) {

      if (i > 0) {
        curLine++;
      }

      if (node) {
        if (offset >= curPos && offset <= curPos + lineArray[i].length) {
          //
          // If we are right after the \n of a line and interlinePosition is
          // false, the caret looks as if it were at the end of the previous
          // line, so we display that line and column instead.
          //
          if (i > 0 && offset == curPos && !interlinePosition) {
            result.line = curLine - 1;
            var prevPos = curPos - lineArray[i - 1].length;
            result.col = (i == 1 ? firstCol : 1) + offset - prevPos;

          } else {
            result.line = curLine;
            result.col = (i == 0 ? firstCol : 1) + offset - curPos;
          }
          found = true;

          break;
        }

      } else {
        if (curLine == line && !("range" in result)) {
          result.range = document.createRange();
          result.range.setStart(textNode, curPos);

          //
          // This will always be overridden later, except when we look for
          // the very last line in the file (this is the only line that does
          // not end with \n).
          //
          result.range.setEndAfter(pre.lastChild);

        } else if (curLine == line + 1) {
          result.range.setEnd(textNode, curPos - 1);
          found = true;
          break;
        }
      }
    }
  }

  return found;
}

//function to toggle long-line wrapping and set the view_source.wrap_long_lines 
//pref to persist the last state
function wrapLongLines()
{
  var myWrap = window._content.document.body;

  if (myWrap.className == '')
    myWrap.className = 'wrap';
  else myWrap.className = '';

  //since multiple viewsource windows are possible, another window could have 
  //affected the pref, so instead of determining the new pref value via the current
  //pref value, we use myWrap.className  
  if (gPrefs){
    try {
      if (myWrap.className == '') {
        gPrefs.setBoolPref("view_source.wrap_long_lines", false);
      }
      else {
        gPrefs.setBoolPref("view_source.wrap_long_lines", true);
      }
    } catch (ex) {
    }
  }
}

//function to toggle syntax highlighting and set the view_source.syntax_highlight
//pref to persist the last state
function highlightSyntax()
{
  var highlightSyntaxMenu = document.getElementById("menu_highlightSyntax");
  var highlightSyntax = (highlightSyntaxMenu.getAttribute("checked") == "true");
  gPrefs.setBoolPref("view_source.syntax_highlight", highlightSyntax);

  var PageLoader = getBrowser().webNavigation.QueryInterface(pageLoaderIface);
  PageLoader.LoadPage(PageLoader.currentDescriptor, pageLoaderIface.DISPLAY_NORMAL);
}

// Fix for bug 136322: this function overrides the function in
// browser.js to call PageLoader.LoadPage() instead of BrowserReloadWithFlags()
function BrowserSetForcedCharacterSet(aCharset)
{
  var docCharset = getBrowser().docShell.QueryInterface(
                            Components.interfaces.nsIDocCharset);
  docCharset.charset = aCharset;
  var PageLoader = getBrowser().webNavigation.QueryInterface(pageLoaderIface);
  PageLoader.LoadPage(PageLoader.currentDescriptor, pageLoaderIface.DISPLAY_NORMAL);
}
PK
j%0fyn
n
 content/navigator/viewSource.xulUT	?ٻBUx  
 






%brandDTD;

%sourceDTD;

%navigatorDTD;

%contentAreaCommandsDTD;
]>



  
  
  
  
  

  

  

    

   

  
    
  

PK
X+/Hd|$|$'content/navigator/viewSourceOverlay.xulUT	;`?ٻBUx  
 






%brandDTD;

%sourceDTD;

%navigatorDTD;

%contentAreaCommandsDTD;
]>


           

  
  
    
    
    
    
  
  
    
  
         
  
  
    
    
  

  
    
    
  

  
    
    
    
    
      
    
    
  
  


PK
	L1F]u)content/navigator/searchconfig.propertiesUT	kAٻBUx# Do NOT localize or otherwise change these values
browser.search.param.Google.1.custom=client=mozilla
browser.search.param.Google.1.default=client=mozilla
browser.search.param.Google.release=rls=%S:%S:unofficial

PK
wE1LƢ'content/navigator-platform/contents.rdfUT	QbAٻBUx


  
  
    
  

  
  

PK
m?0:=content/navigator-platform/win/platformNavigationBindings.xulUT	ģ@ٻBUx





  
    
    
    

    
    
    
    

    
    
    

    

    
    
    
    

  


PK
9.i™6content/navigator-platform/win/platformMailOverlay.xulUT	]>ٻBUx




PK
m?0U=content/navigator-platform/mac/platformNavigationBindings.xulUT	ģ@ٻBUx





  
    
    
    
    
    
    
    
    
    




PK
9.zz6content/navigator-platform/mac/platformMailOverlay.xulUT	X>ٻBUx





  
    
  


PK
$g0255>content/navigator-platform/unix/platformNavigationBindings.xulUT	PJ@ٻBUx





  
    
    
    

    
    
    

    
    

    
    
    
    
  

  


PK
9.i™7content/navigator-platform/unix/platformMailOverlay.xulUT	Z>ٻBUx




PK
f[0`+llcontent/navigator/contents.rdfUT	/?@ٻBUx


  
  
    
  

  
  
  



PK
{D0 11%content/navigator-region/contents.rdfUT	!@ٻBUx


  
  
    
  

  
  
  


PK
)c+4_0content/communicator/platformBrowserBindings.xulUT	#o;ٻBUx 












    








PK
)c+{p%%/content/communicator/platformEditorBindings.xulUT	#o;ٻBUx 







 





















PK
#n.T<4content/communicator/platformCommunicatorOverlay.xulUT	;q>ٻBUx 



%platformCommunicationDTD;

%utilityDTD;

]>



    
    
    
    

    
    
      
      
    
    
    
  
    
    
    
    
	
	
  

  
  
  

    
PK
wa,}Ť%content/communicator/communicator.cssUT	~<ٻBUx/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is mozilla.org code.
 *
 * The Initial Developer of the Original Code is
 * Netscape Communications Corporation.
 * Portions created by the Initial Developer are Copyright (C) 2002
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *   Samir Gehani 
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); 

/* ::::: print preview toolbar ::::: */

toolbar[printpreview="true"] {
  -moz-binding: url("chrome://communicator/content/printPreviewBindings.xml#printpreviewtoolbar");
}
PK
9(2~,content/communicator/communicatorOverlay.xulUT	09ٻBUx




PK
Rd0Z!(!('content/communicator/utilityOverlay.xulUT	>F@ٻBUx




%brandDTD;

%globalRegionDTD;

%utilityDTD;

]>



  
  

  

  &popupDesc.label;
  &popupDescAlt.label;
  
    
  
  &popupNote1.label;
  
  &popupNote2.label;
  
  
    
PK 2jG1 ӻ((*content/communicator-platform/contents.rdfUT %eAٻBUx PK {D0\ ʏAA(content/communicator-region/contents.rdfUT !@ٻBUx PK f[0,:!content/communicator/contents.rdfUT /?@ٻBUx PK fn?22(5 5 %content/communicator/RealTimeSpell.jsUT )AٻBUxvar RealTimeSpell = { editor : null, editorRTS: null, Init : function (editor, enable) { this.editor = editor; this.editorRTS = editor.enableRealTimeSpell(enable); }, getMispelledWord : function() { if (!this.editorRTS) return null; var selection = this.editor.selection; return this.editorRTS.getMispelledWord(selection.anchorNode,selection.anchorOffset); }, updateMenu : function(menuid, separatorid) { var word = this.getMispelledWord(); var suggestionsMenu = document.getElementById(menuid); var suggestionsMenuSeparator = document.getElementById(separatorid); if (word){ suggestionsMenu.removeAttribute("hidden"); suggestionsMenuSeparator.removeAttribute("hidden"); } else { suggestionsMenu.setAttribute("hidden","true"); suggestionsMenuSeparator.setAttribute("hidden","true"); } }, updateSuggestionsMenu : function (menupopup, addtodictionaryid, addtodictionaryseparatorid, word) { if (!this.editorRTS) return false; var addSeparator = document.getElementById(addtodictionaryseparatorid); var addToDictionary = document.getElementById(addtodictionaryid); var child = menupopup.firstChild; while (child){ var next = child.nextSibling; if ((child != addSeparator) && (child != addToDictionary)){ menupopup.removeChild(child); } child = next; } if (!word){ word = this.getMispelledWord(); if (!word) return false; } var spellChecker = this.editorRTS.spellChecker; if (!spellChecker) return false; var found = false; var isIncorrect = spellChecker.CheckCurrentWord(word.toString()); if (isIncorrect){ do { var suggestion = spellChecker.GetSuggestedWord(); if (!suggestion.length) break; found = true; var item = document.createElement("menuitem"); item.setAttribute("label",suggestion); item.setAttribute("value",suggestion); menupopup.appendChild(item); } while(1); } if (addSeparator){ if (found) addSeparator.removeAttribute("hidden"); else addSeparator.setAttribute("hidden","true"); } return isIncorrect; }, selectSuggestion : function (newword, node, offset) { if (!this.editorRTS) return null; if (!node){ var selection = this.editor.selection; node = selection.anchorNode; offset = selection.anchorOffset; } this.editorRTS.replaceWord(node,offset,newword); }, addToDictionary : function (node, offset) { if (!this.editorRTS) return null; if (!node){ var selection = this.editor.selection; node = selection.anchorNode; offset = selection.anchorOffset; } var word = this.editorRTS.getMispelledWord(node,offset); if (word) this.editorRTS.addWordToDictionary(word); } } PK f[0Ɂ*1content/communicator/downloadmanager/contents.rdfUT /?@ٻBUx chrome://communicator/content/tasksOverlay.xul chrome://communicator/content/utilityOverlay.xul PK |U/z̦))8content/communicator/downloadmanager/downloadmanager.xulUT \R?ٻBUx %downloadManagerDTD; %downloadProgressDTD; ]> &perfdescription.label; &systemPrefDescription.label;
PK wB0lPe e -content/communicator/pref/pref-appearance.xulUT B~@ٻBUx %brandDTD; %prefAppearanceDTD; ]> PK o0/content/communicator/pref/pref-applications.xulUT a@ٻBUx