diff --git a/xpfe/browser/resources/.cvsignore b/xpfe/browser/resources/.cvsignore deleted file mode 100644 index f3c7a7c5da68..000000000000 --- a/xpfe/browser/resources/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -Makefile diff --git a/xpfe/browser/resources/content/.cvsignore b/xpfe/browser/resources/content/.cvsignore deleted file mode 100644 index a4f3d06cd679..000000000000 --- a/xpfe/browser/resources/content/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -viewSource.xul.out diff --git a/xpfe/browser/resources/content/browser.js b/xpfe/browser/resources/content/browser.js deleted file mode 100644 index 16fa1c8e2c92..000000000000 --- a/xpfe/browser/resources/content/browser.js +++ /dev/null @@ -1,285 +0,0 @@ -/* -*- Mode: Java; tab-width: 2; 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) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Blake Ross - * Peter Annema - * Samir Gehani - * - * Alternatively, the contents of this file may be used under the terms of - * either of 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 ***** */ - -const nsIWebNavigation = Components.interfaces.nsIWebNavigation; -var gPrintSettingsAreGlobal = true; -var gSavePrintSettings = true; -var gChromeState = null; // chrome state before we went into print preview -var gInPrintPreviewMode = false; - -function getWebNavigation() -{ - try { - return getBrowser().webNavigation; - } catch (e) { - return null; - } -} - -function BrowserReloadWithFlags(reloadFlags) -{ - /* First, we'll try to use the session history object to reload so - * that framesets are handled properly. If we're in a special - * window (such as view-source) that has no session history, fall - * back on using the web navigation's reload method. - */ - - var webNav = getWebNavigation(); - try { - var sh = webNav.sessionHistory; - if (sh) - webNav = sh.QueryInterface(Components.interfaces.nsIWebNavigation); - } catch (e) { - } - - try { - webNav.reload(reloadFlags); - } catch (e) { - } -} - -function toggleAffectedChrome(aHide) -{ - // chrome to toggle includes: - // (*) menubar - // (*) navigation bar - // (*) personal toolbar - // (*) tab browser ``strip'' - // (*) sidebar - // (*) statusbar - - if (!gChromeState) - gChromeState = new Object; - - var statusbar = document.getElementById("status-bar"); - var navToolbox = document.getElementById("navigator-toolbox"); - navToolbox.hidden = aHide; - var theTabbrowser = document.getElementById("content"); - - // sidebar states map as follows: - // was-hidden => hide/show nothing - // was-collapsed => hide/show only the splitter - // was-shown => hide/show the splitter and the box - if (aHide) - { - // going into print preview mode - if (sidebar_is_collapsed()) - { - gChromeState.sidebar = "was-collapsed"; - } - else if (sidebar_is_hidden()) - gChromeState.sidebar = "was-hidden"; - else - { - gChromeState.sidebar = "was-visible"; - } - document.getElementById("sidebar-box").hidden = true; - document.getElementById("sidebar-splitter").hidden = true; - - // deal with tab browser - gChromeState.hadTabStrip = theTabbrowser.getStripVisibility(); - theTabbrowser.setStripVisibilityTo(false); - - // deal with the Status Bar - gChromeState.statusbarWasHidden = statusbar.hidden; - statusbar.hidden = true; - } - else - { - // restoring normal mode (i.e., leaving print preview mode) - if (gChromeState.sidebar == "was-collapsed" || - gChromeState.sidebar == "was-visible") - document.getElementById("sidebar-splitter").hidden = false; - if (gChromeState.sidebar == "was-visible") - document.getElementById("sidebar-box").hidden = false; - - // restore tab browser - theTabbrowser.setStripVisibilityTo(gChromeState.hadTabStrip); - - // restore the Status Bar - statusbar.hidden = gChromeState.statusbarWasHidden; - } - - // if we are unhiding and sidebar used to be there rebuild it - if (!aHide && gChromeState.sidebar == "was-visible") - SidebarRebuild(); -} - -function onEnterPrintPreview() -{ - toggleAffectedChrome(true); - gInPrintPreviewMode = true; -} - -function onExitPrintPreview() -{ - gInPrintPreviewMode = false; - // restore chrome to original state - toggleAffectedChrome(false); -} - -function getEngineWebBrowserPrint() -{ - return content.QueryInterface(Components.interfaces.nsIInterfaceRequestor) - .getInterface(Components.interfaces.nsIWebBrowserPrint); -} - -function getNavToolbox() -{ - return document.getElementById("navigator-toolbox"); -} - -function getPPBrowser() -{ - return document.getElementById("browser"); -} - -function BrowserPrintPreview() -{ - PrintUtils.printPreview(onEnterPrintPreview, onExitPrintPreview); -} - -function BrowserSetDefaultCharacterSet(aCharset) -{ - // no longer needed; set when setting Force; see bug 79608 -} - -function BrowserSetForcedCharacterSet(aCharset) -{ - var docCharset = getBrowser().docShell.QueryInterface( - Components.interfaces.nsIDocCharset); - docCharset.charset = aCharset; - BrowserReloadWithFlags(nsIWebNavigation.LOAD_FLAGS_CHARSET_CHANGE); -} - -function BrowserSetForcedDetector(doReload) -{ - getBrowser().documentCharsetInfo.forcedDetector = true; - if (doReload) - BrowserReloadWithFlags(nsIWebNavigation.LOAD_FLAGS_CHARSET_CHANGE); -} - -var gFindInstData; -function getFindInstData() -{ - if (!gFindInstData) { - gFindInstData = new nsFindInstData(); - gFindInstData.browser = getBrowser(); - // defaults for rootSearchWindow and currentSearchWindow are fine here - } - return gFindInstData; -} - -function BrowserFind() -{ - findInPage(getFindInstData()); -} - -function BrowserFindAgain(reverse) -{ - findAgainInPage(getFindInstData(), reverse); -} - -function BrowserCanFindAgain() -{ - return canFindAgainInPage(); -} - -function getMarkupDocumentViewer() -{ - return getBrowser().markupDocumentViewer; -} - -/** - * Content area tooltip. - * XXX - this must move into XBL binding/equiv! Do not want to pollute - * navigator.js with functionality that can be encapsulated into - * browser widget. TEMPORARY! - * - * NOTE: Any changes to this routine need to be mirrored in ChromeListener::FindTitleText() - * (located in mozilla/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp) - * which performs the same function, but for embedded clients that - * don't use a XUL/JS layer. It is important that the logic of - * these two routines be kept more or less in sync. - * (pinkerton) - **/ -function FillInHTMLTooltip(tipElement) -{ - var retVal = false; - if (tipElement.namespaceURI == "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul") - return retVal; - - const XLinkNS = "http://www.w3.org/1999/xlink"; - - - var titleText = null; - var XLinkTitleText = null; - var direction = tipElement.ownerDocument.dir; - - while (!titleText && !XLinkTitleText && tipElement) { - if (tipElement.nodeType == Node.ELEMENT_NODE) { - titleText = tipElement.getAttribute("title"); - XLinkTitleText = tipElement.getAttributeNS(XLinkNS, "title"); - var defView = tipElement.ownerDocument.defaultView; - // XXX Work around bug 350679: - // "Tooltips can be fired in documents with no view". - if (!defView) - return retVal; - direction = defView.getComputedStyle(tipElement, "") - .getPropertyValue("direction"); - } - tipElement = tipElement.parentNode; - } - - var texts = [titleText, XLinkTitleText]; - var tipNode = document.getElementById("aHTMLTooltip"); - tipNode.style.direction = direction; - - for (var i = 0; i < texts.length; ++i) { - var t = texts[i]; - if (t && t.search(/\S/) >= 0) { - // XXX - Short-term fix to bug 67127: collapse whitespace here - tipNode.setAttribute("label", t.replace(/\s+/g, " ") ); - retVal = true; - } - } - - return retVal; -} diff --git a/xpfe/browser/resources/content/contents-region.rdf b/xpfe/browser/resources/content/contents-region.rdf deleted file mode 100644 index 3bb7284634e4..000000000000 --- a/xpfe/browser/resources/content/contents-region.rdf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - diff --git a/xpfe/browser/resources/content/contents.rdf b/xpfe/browser/resources/content/contents.rdf deleted file mode 100644 index 8882f7d19154..000000000000 --- a/xpfe/browser/resources/content/contents.rdf +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - diff --git a/xpfe/browser/resources/content/languageDictionary.js b/xpfe/browser/resources/content/languageDictionary.js deleted file mode 100644 index 41b93ce4fff6..000000000000 --- a/xpfe/browser/resources/content/languageDictionary.js +++ /dev/null @@ -1,89 +0,0 @@ -/* ***** 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 Eric Hodel's code. - * - * The Initial Developer of the Original Code is - * Eric Hodel. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Christopher Hoess - * Tim Taylor - * - * 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 ***** */ - -/* - * LanguageDictionary is a Singleton for looking up a language name - * given its language code. - */ -function LanguageDictionary() { - this.dictionary = null; -} - -LanguageDictionary.prototype = { - lookupLanguageName: function(languageCode) - { - if (this.getDictionary()[languageCode]) - return this.getDictionary()[languageCode]; - else - // XXX: handle non-standard language code's per - // hixie's spec (see bug 2800) - return ""; - }, - - getDictionary: function() - { - if (!this.dictionary) - this.dictionary = LanguageDictionary.createDictionary(); - - return this.dictionary; - } - -} - -LanguageDictionary.createDictionary = function() -{ - var dictionary = new Array(); - - var e = LanguageDictionary.getLanguageNames().getSimpleEnumeration(); - while (e.hasMoreElements()) { - var property = e.getNext(); - property = property.QueryInterface( - Components.interfaces.nsIPropertyElement); - dictionary[property.key] = property.value; - } - - return dictionary; -} - -LanguageDictionary.getLanguageNames = function() -{ - return srGetStrBundle( - "chrome://global/locale/languageNames.properties"); -} - -const languageDictionary = new LanguageDictionary(); \ No newline at end of file diff --git a/xpfe/browser/resources/content/linkToolbarHandler.js b/xpfe/browser/resources/content/linkToolbarHandler.js deleted file mode 100644 index b76e4d9f2a8b..000000000000 --- a/xpfe/browser/resources/content/linkToolbarHandler.js +++ /dev/null @@ -1,290 +0,0 @@ -/* ***** 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 Eric Hodel's code. - * - * The Initial Developer of the Original Code is - * Eric Hodel. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Christopher Hoess - * Tim Taylor - * Stuart Ballard - * - * 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 ***** */ - -/** - * LinkToolbarHandler is a Singleton that displays LINK elements - * and nodeLists of LINK elements in the Link Toolbar. It - * associates the LINK with a corresponding LinkToolbarItem based - * on it's REL attribute and the toolbar item's ID attribute. - * LinkToolbarHandler is also a Factory and will create - * LinkToolbarItems as necessary. - */ -function LinkToolbarHandler() -{ - this.items = new Array(); - this.hasItems = false; -} - -LinkToolbarHandler.prototype.handle = -function(element) -{ - // XXX: if you're going to re-enable handling of anchor elements, - // you'll want to change this to AnchorElementDecorator - var linkElement = new LinkElementDecorator(element); - - if (linkElement.isIgnored()) return; - - for (var i = 0; i < linkElement.relValues.length; i++) { - var linkType = LinkToolbarHandler.getLinkType(linkElement.relValues[i]); - if (linkType) { - if (!this.hasItems) { - this.hasItems = true; - linkToolbarUI.activate(); - } - this.getItemForLinkType(linkType).displayLink(linkElement); - } - } -} - -LinkToolbarHandler.getLinkType = -function(relAttribute) -{ - switch (relAttribute.toLowerCase()) { - case "start": - case "top": - case "origin": - return "top"; - - case "up": - case "parent": - return "up"; - - case "begin": - case "first": - return "first"; - - case "next": - case "child": - return "next"; - - case "prev": - case "previous": - return "prev"; - - case "end": - case "last": - return "last"; - - case "author": - case "made": - return "author"; - - case "contents": - case "toc": - return "toc"; - - case "prefetch": - return null; - - default: - return relAttribute.toLowerCase(); - } -} - -LinkToolbarHandler.prototype.getItemForLinkType = -function(linkType) { - if (!(linkType in this.items && this.items[linkType])) - this.items[linkType] = LinkToolbarHandler.createItemForLinkType(linkType); - - return this.items[linkType]; -} - -LinkToolbarHandler.createItemForLinkType = -function(linkType) -{ - if (!document.getElementById("link-" + linkType)) - return new LinkToolbarTransientMenu(linkType); - - // XXX: replace switch with polymorphism - switch(document.getElementById("link-" + linkType).localName) { - case "toolbarbutton": - return new LinkToolbarButton(linkType); - - case "menuitem": - return new LinkToolbarItem(linkType); - - case "menu": - return new LinkToolbarMenu(linkType); - - default: - return new LinkToolbarTransientMenu(linkType); - } -} - -LinkToolbarHandler.prototype.clearAllItems = -function() -{ - // Hide the 'miscellaneous' separator - document.getElementById("misc-separator").setAttribute("collapsed", "true"); - - // Disable the individual items - for (var linkType in this.items) - this.items[linkType].clear(); - - // Store the fact that the toolbar is empty - this.hasItems = false; -} - -const linkToolbarHandler = new LinkToolbarHandler(); - - -function LinkElementDecorator(element) { - /* - * XXX: this is an incomplete decorator, because it doesn't implement - * the full Element interface. If you need to use a method - * or member in the Element interface, just add it here and - * have it delegate to this.element - * - * XXX: would rather add some methods to Element.prototype instead of - * using a decorator, but Element.prototype is no longer exposed - * since the XPCDOM landing, see bug 83433 - */ - - if (!element) return; // skip the rest on foo.prototype = new ThisClass calls - - this.element = element; - - this.rel = LinkElementDecorator.convertRevMade(element.rel, element.rev); - if (this.rel) - this.relValues = this.rel.split(" "); - this.rev = element.rev; - this.title = element.title; - this.href = element.href; - this.hreflang = element.hreflang; - this.media = element.media; - this.longTitle = null; -} - -LinkElementDecorator.prototype.isIgnored = -function() -{ - if (!this.rel) return true; - for (var i = 0; i < this.relValues.length; i++) - if (/^stylesheet$|^icon$|^fontdef$|^p3pv|^schema./i.test(this.relValues[i])) - return true; - return false; -} - -LinkElementDecorator.convertRevMade = -function(rel, rev) -{ - if (!rel && rev && /\bmade\b/i.test(rev)) - return rev; - else - return rel; -} - -LinkElementDecorator.prototype.getTooltip = -function() -{ - return this.getLongTitle() != "" ? this.getLongTitle() : this.href; -} - -LinkElementDecorator.prototype.getLabel = -function() -{ - return this.getLongTitle() != "" ? this.getLongTitle() : this.rel; -} - -LinkElementDecorator.prototype.getLongTitle = -function() -{ - if (this.longTitle == null) - this.longTitle = this.makeLongTitle(); - - return this.longTitle; -} - -LinkElementDecorator.prototype.makeLongTitle = -function() -{ - var prefix = ""; - - // XXX: lookup more meaningful and localized version of media, - // i.e. media="print" becomes "Printable" or some such - // XXX: use localized version of ":" separator - if (this.media && !/\ball\b|\bscreen\b/i.test(this.media)) - prefix += this.media + ": "; - if (this.hreflang) - prefix += languageDictionary.lookupLanguageName(this.hreflang) - + ": "; - - return this.title ? prefix + this.title : prefix; -} - -function AnchorElementDecorator(element) { - this.constructor(element); -} -AnchorElementDecorator.prototype = new LinkElementDecorator; - -AnchorElementDecorator.prototype.getLongTitle = -function() -{ - return this.title ? this.__proto__.getLongTitle.apply(this) - : getText(this.element); -} - -AnchorElementDecorator.prototype.getText = -function(element) -{ - return condenseWhitespace(getTextRecursive(element)); -} - -AnchorElementDecorator.prototype.getTextRecursive = -function(node) -{ - var text = ""; - node.normalize(); - if (node.hasChildNodes()) { - for (var i = 0; i < node.childNodes.length; i++) { - if (node.childNodes.item(i).nodeType == Node.TEXT_NODE) - text += node.childNodes.item(i).nodeValue; - else if (node.childNodes.item(i).nodeType == Node.ELEMENT_NODE) - text += getTextRecursive(node.childNodes.item(i)); - } - } - - return text; -} - -AnchorElementDecorator.prototype.condenseWhitespace = -function(text) -{ - return text.replace(/\W*$/, "").replace(/^\W*/, "").replace(/\W+/g, " "); -} \ No newline at end of file diff --git a/xpfe/browser/resources/content/linkToolbarItem.js b/xpfe/browser/resources/content/linkToolbarItem.js deleted file mode 100644 index 17c2a271b933..000000000000 --- a/xpfe/browser/resources/content/linkToolbarItem.js +++ /dev/null @@ -1,254 +0,0 @@ -/* ***** 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 Eric Hodel's code. - * - * The Initial Developer of the Original Code is - * Eric Hodel. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Christopher Hoess - * Tim Taylor - * Stuart Ballard - * - * 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 ***** */ - -/* - * LinkToolbarItem and its subclasses represent the buttons, menuitems, - * and menus that handle the various link types. - */ -function LinkToolbarItem (linkType) { - this.linkType = linkType; - this.xulElementId = "link-" + linkType; - this.xulPopupId = this.xulElementId + "-popup"; - this.parentMenuButton = null; - - this.getXULElement = function() { - return document.getElementById(this.xulElementId); - } - - this.clear = function() { - this.disableParentMenuButton(); - this.getXULElement().setAttribute("disabled", "true"); - this.getXULElement().removeAttribute("href"); - } - - this.displayLink = function(linkElement) { - if (this.getXULElement().hasAttribute("href")) return false; - - this.setItem(linkElement); - this.enableParentMenuButton(); - return true; - } - - this.setItem = function(linkElement) { - this.getXULElement().setAttribute("href", linkElement.href); - this.getXULElement().removeAttribute("disabled"); - } - - this.enableParentMenuButton = function() { - if(this.getParentMenuButton()) - this.getParentMenuButton().removeAttribute("disabled"); - } - - this.disableParentMenuButton = function() { - if (!this.parentMenuButton) return; - - this.parentMenuButton.setAttribute("disabled", "true"); - this.parentMenuButton = null; - } - - this.getParentMenuButton = function() { - if (!this.parentMenuButton) - this.parentMenuButton = getParentMenuButtonRecursive( - this.getXULElement()); - - return this.parentMenuButton; - } - - function getParentMenuButtonRecursive(xulElement) { - if (!xulElement) return null; - - if (xulElement.tagName == "toolbarbutton") - return xulElement; - - return getParentMenuButtonRecursive(xulElement.parentNode) - } -} - - -function LinkToolbarButton (linkType) { - this.constructor(linkType); - - this.clear = function() { - this.__proto__.clear.apply(this); - - this.getXULElement().removeAttribute("tooltiptext"); - } - - this.setItem = function(linkElement) { - this.__proto__.setItem.apply(this, [linkElement]); - - this.getXULElement().setAttribute("tooltiptext", linkElement.getTooltip()); - } - - this.enableParentMenuButton = function() { /* do nothing */ } - this.disableParentMenuButton = function() { /* do nothing */ } -} -LinkToolbarButton.prototype = new LinkToolbarItem; - - -function LinkToolbarMenu (linkType) { - this.constructor(linkType); - - this.clear = function() { - this.disableParentMenuButton(); - this.getXULElement().setAttribute("disabled", "true"); - clearPopup(this.getPopup()); - } - - function clearPopup(popup) { - while (popup.hasChildNodes()) - popup.removeChild(popup.lastChild); - } - - this.getPopup = function() { - return document.getElementById(this.xulPopupId); - } - - this.displayLink = function(linkElement) { - this.addMenuItem(linkElement); - this.getXULElement().removeAttribute("disabled"); - this.enableParentMenuButton(); - return true; - } - - function match(first, second) { - if (!first && !second) return true; - if (!first || !second) return false; - - return first == second; - } - - this.addMenuItem = function(linkElement) { - this.getPopup().appendChild(this.createMenuItem(linkElement)); - } - - this.createMenuItem = function(linkElement) { - // XXX: clone a prototypical XUL element instead of hardcoding these - // attributes - var menuitem = document.createElement("menuitem"); - menuitem.setAttribute("label", linkElement.getLabel()); - menuitem.setAttribute("href", linkElement.href); - menuitem.setAttribute("class", "menuitem-iconic bookmark-item"); - menuitem.setAttribute("rdf:type", - "rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#linkType"); - - return menuitem; - } -} -LinkToolbarMenu.prototype = new LinkToolbarItem; - - -function LinkToolbarTransientMenu (linkType) { - this.constructor(linkType); - - this.getXULElement = function() { - if (this.__proto__.getXULElement.apply(this)) - return this.__proto__.getXULElement.apply(this); - else - return this.createXULElement(); - } - - this.createXULElement = function() { - // XXX: clone a prototypical XUL element instead of hardcoding these - // attributes - var menu = document.createElement("menu"); - menu.setAttribute("id", this.xulElementId); - menu.setAttribute("label", this.linkType); - menu.setAttribute("disabled", "true"); - menu.setAttribute("class", "menu-iconic bookmark-item"); - menu.setAttribute("container", "true"); - menu.setAttribute("type", "rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); - - document.getElementById("more-menu-popup").appendChild(menu); - - return menu; - } - - this.getPopup = function() { - if (!this.__proto__.getPopup.apply(this)) - this.getXULElement().appendChild(this.createPopup()); - - return this.__proto__.getPopup.apply(this) - } - - this.createPopup = function() { - var popup = document.createElement("menupopup"); - popup.setAttribute("id", this.xulPopupId); - - return popup; - } - - this.clear = function() { - this.__proto__.clear.apply(this); - - // XXX: we really want to use this instead of removeXULElement - //this.hideXULElement(); - this.removeXULElement(); - } - - this.hideXULElement = function() { - /* - * XXX: using "hidden" or "collapsed" leads to a crash when you - * open the More menu under certain circumstances. Maybe - * related to bug 83906. As of 0.9.2 I it doesn't seem - * to crash anymore. - */ - this.getXULElement().setAttribute("collapsed", "true"); - } - - this.removeXULElement = function() { - // XXX: stop using this method once it's safe to use hideXULElement - if (this.__proto__.getXULElement.apply(this)) - this.__proto__.getXULElement.apply(this).parentNode.removeChild( - this.__proto__.getXULElement.apply(this)); - } - - this.displayLink = function(linkElement) { - if(!this.__proto__.displayLink.apply(this, [linkElement])) return false; - - this.getXULElement().removeAttribute("collapsed"); - - // Show the 'miscellaneous' separator - document.getElementById("misc-separator").removeAttribute("collapsed"); - return true; - } -} - -LinkToolbarTransientMenu.prototype = new LinkToolbarMenu; - diff --git a/xpfe/browser/resources/content/linkToolbarOverlay.js b/xpfe/browser/resources/content/linkToolbarOverlay.js deleted file mode 100644 index 4ddd96b612b2..000000000000 --- a/xpfe/browser/resources/content/linkToolbarOverlay.js +++ /dev/null @@ -1,257 +0,0 @@ -/* ***** 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 Eric Hodel's code. - * - * The Initial Developer of the Original Code is - * Eric Hodel. - * Portions created by the Initial Developer are Copyright (C) 2001 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Christopher Hoess - * Tim Taylor - * Henri Sivonen - * Stuart Ballard - * - * 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 LinkToolbarUI = function() -{ -} - -LinkToolbarUI.prototype.linkAdded = -function(event) -{ - var element = event.originalTarget; - - if (element.ownerDocument != getBrowser().contentDocument || - !linkToolbarUI.isLinkToolbarEnabled() || - !element instanceof Components.interfaces.nsIDOMHTMLLinkElement || - !element.href || (!element.rel && !element.rev)) - return; - - linkToolbarHandler.handle(element); -} - -LinkToolbarUI.prototype.isLinkToolbarEnabled = -function() -{ - if (document.getElementById("linktoolbar").getAttribute("hidden") == "true") - return false; - else - return true; -} - -LinkToolbarUI.prototype.clear = -function(event) -{ - if (event.originalTarget != getBrowser().contentDocument || - !linkToolbarUI.isLinkToolbarEnabled() || - !linkToolbarHandler.hasItems) - return; - - linkToolbarHandler.clearAllItems(); -} - -LinkToolbarUI.prototype.tabSelected = -function(event) -{ - if (event.originalTarget.localName != "tabs" || - !linkToolbarUI.isLinkToolbarEnabled()) - return; - - linkToolbarHandler.clearAllItems(); - linkToolbarUI.deactivate(); - linkToolbarUI.fullSlowRefresh(); -} - -LinkToolbarUI.prototype.fullSlowRefresh = -function() -{ - var currentNode = getBrowser().contentDocument.documentElement; - if (!(currentNode instanceof Components.interfaces.nsIDOMHTMLHtmlElement)) - return; - currentNode = currentNode.firstChild; - - while(currentNode) - { - if (currentNode instanceof Components.interfaces.nsIDOMHTMLHeadElement) { - currentNode = currentNode.firstChild; - - while(currentNode) - { - if (currentNode instanceof Components.interfaces.nsIDOMHTMLLinkElement) - linkToolbarUI.linkAdded({originalTarget: currentNode}); - currentNode = currentNode.nextSibling; - } - } - else if (currentNode instanceof Components.interfaces.nsIDOMElement) - { - // head is supposed to be the first element inside html. - // Got something else instead. returning - return; - } - else - { - // Got a comment node or something like that. Moving on. - currentNode = currentNode.nextSibling; - } - } -} - -LinkToolbarUI.prototype.toolbarActive = false; - -LinkToolbarUI.prototype.activate = -function() -{ - if (!linkToolbarUI.toolbarActive) { - linkToolbarUI.toolbarActive = true; - document.getElementById("linktoolbar").setAttribute("hasitems", "true"); - var contentArea = document.getElementById("appcontent"); - contentArea.addEventListener("pagehide", linkToolbarUI.clear, true); - contentArea.addEventListener("pageshow", linkToolbarUI.deactivate, true); - contentArea.addEventListener("DOMHeadLoaded", linkToolbarUI.deactivate, - true); - } -} - -LinkToolbarUI.prototype.deactivate = -function() -{ - // This function can never be called unless the toolbar is active, because - // it's a handler that's only activated in that situation, so there's no need - // to check toolbarActive. On the other hand, by the time this method is - // called the toolbar might have been populated again already, in which case - // we don't want to deactivate. - if (!linkToolbarHandler.hasItems) { - linkToolbarUI.toolbarActive = false; - document.getElementById("linktoolbar").setAttribute("hasitems", "false"); - var contentArea = document.getElementById("appcontent"); - contentArea.removeEventListener("pagehide", linkToolbarUI.clear, true); - contentArea.removeEventListener("pageshow", linkToolbarUI.deactivate, true); - contentArea.removeEventListener("DOMHeadLoaded", linkToolbarUI.deactivate, - true); - } -} - -/* called whenever something on the toolbar gets an oncommand event */ -LinkToolbarUI.prototype.commanded = -function(event) -{ - // Return if this is one of the menubuttons. - if (event.target.getAttribute("type") == "menu") return; - - if (!event.target.getAttribute("href")) return; - - var destURL = event.target.getAttribute("href"); - - // We have to do a security check here, because we are loading URIs given - // to us by a web page from chrome, which is privileged. - try { - var ssm = Components.classes["@mozilla.org/scriptsecuritymanager;1"].getService(). - QueryInterface(Components.interfaces.nsIScriptSecurityManager); - ssm.checkLoadURIStr(window.content.location.href, destURL, 0); - var referrer = - Components.classes["@mozilla.org/network/standard-url;1"]. - createInstance(Components.interfaces.nsIURI); - referrer.spec = window.content.location.href; - loadURI(destURL, referrer); - } catch (e) { - dump("Error: it is not permitted to load this URI from a element: " + e); - } -} - -// functions for twiddling XUL elements in the toolbar - -LinkToolbarUI.prototype.toggleLinkToolbar = -function(checkedItem) -{ - this.goToggleTristateToolbar("linktoolbar", checkedItem); - this.initHandlers(); - if (this.isLinkToolbarEnabled()) - this.fullSlowRefresh(); - else - linkToolbarHandler.clearAllItems(); -} - -LinkToolbarUI.prototype.initLinkbarVisibilityMenu = -function() -{ - var state = document.getElementById("linktoolbar").getAttribute("hidden"); - if (!state) - state = "maybe"; - var checkedItem = document.getElementById("cmd_viewlinktoolbar_" + state); - checkedItem.setAttribute("checked", true); - checkedItem.checked = true; -} - -LinkToolbarUI.prototype.goToggleTristateToolbar = -function(id, checkedItem) -{ - var toolbar = document.getElementById(id); - if (toolbar) - { - toolbar.setAttribute("hidden", checkedItem.value); - document.persist(id, "hidden"); - } -} - -LinkToolbarUI.prototype.addHandlerActive = false; - -LinkToolbarUI.prototype.initialized = false; - -LinkToolbarUI.prototype.initHandlers = -function() -{ - var contentArea = document.getElementById("appcontent"); - if (linkToolbarUI.isLinkToolbarEnabled()) - { - if (!linkToolbarUI.addHandlerActive) { - contentArea.addEventListener("select", linkToolbarUI.tabSelected, - false); - contentArea.addEventListener("DOMLinkAdded", linkToolbarUI.linkAdded, - true); - linkToolbarUI.addHandlerActive = true; - } - } else - { - if (linkToolbarUI.addHandlerActive) { - contentArea.removeEventListener("select", linkToolbarUI.tabSelected, - false); - contentArea.removeEventListener("DOMLinkAdded", linkToolbarUI.linkAdded, - true); - linkToolbarUI.addHandlerActive = false; - } - } - if (!linkToolbarUI.initialized) - { - linkToolbarUI.initialized = true; - document.removeEventListener("pageshow", linkToolbarUI.initHandlers, true); - } -} - -const linkToolbarUI = new LinkToolbarUI; - diff --git a/xpfe/browser/resources/content/linkToolbarOverlay.xul b/xpfe/browser/resources/content/linkToolbarOverlay.xul deleted file mode 100644 index ef3e9fd64456..000000000000 --- a/xpfe/browser/resources/content/linkToolbarOverlay.xul +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xpfe/browser/resources/content/mac/.cvsignore b/xpfe/browser/resources/content/mac/.cvsignore deleted file mode 100644 index f3c7a7c5da68..000000000000 --- a/xpfe/browser/resources/content/mac/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -Makefile diff --git a/xpfe/browser/resources/content/mac/contents-platform.rdf b/xpfe/browser/resources/content/mac/contents-platform.rdf deleted file mode 100644 index 56d921bbefa9..000000000000 --- a/xpfe/browser/resources/content/mac/contents-platform.rdf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - diff --git a/xpfe/browser/resources/content/mac/platformMailOverlay.xul b/xpfe/browser/resources/content/mac/platformMailOverlay.xul deleted file mode 100644 index 9d37ed5db0c5..000000000000 --- a/xpfe/browser/resources/content/mac/platformMailOverlay.xul +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - diff --git a/xpfe/browser/resources/content/mac/platformNavigationBindings.xul b/xpfe/browser/resources/content/mac/platformNavigationBindings.xul deleted file mode 100644 index 8937edb60d53..000000000000 --- a/xpfe/browser/resources/content/mac/platformNavigationBindings.xul +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xpfe/browser/resources/content/mailNavigatorOverlay.xul b/xpfe/browser/resources/content/mailNavigatorOverlay.xul deleted file mode 100644 index adc3abf4ed16..000000000000 --- a/xpfe/browser/resources/content/mailNavigatorOverlay.xul +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xpfe/browser/resources/content/metadata.js b/xpfe/browser/resources/content/metadata.js deleted file mode 100644 index 57519bba3bdf..000000000000 --- a/xpfe/browser/resources/content/metadata.js +++ /dev/null @@ -1,548 +0,0 @@ -/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - * ***** 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 this file as it was released on January 3, 2001. - * - * The Initial Developer of the Original Code is - * Jonas Sicking. - * Portions created by the Initial Developer are Copyright (C) 2000 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Jonas Sicking (Original Author) - * Gervase Markham - * Heikki Toivonen - * - * Alternatively, the contents of this file may be used under the terms of - * either of 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 ***** */ - -const XLinkNS = "http://www.w3.org/1999/xlink"; -const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; -const XMLNS = "http://www.w3.org/XML/1998/namespace"; -const XHTMLNS = "http://www.w3.org/1999/xhtml"; -var gMetadataBundle; -var gLangBundle; -var gRegionBundle; -var nodeView; -var htmlMode = false; - -var onLink = false; -var onImage = false; -var onInsDel = false; -var onQuote = false; -var onMisc = false; -var onTable = false; -var onTitle = false; -var onLang = false; - -const nsICacheService = Components.interfaces.nsICacheService; -const cacheService = Components.classes["@mozilla.org/network/cache-service;1"] - .getService(nsICacheService); -var httpCacheSession = cacheService.createSession("HTTP", 0, true); -httpCacheSession.doomEntriesIfExpired = false; -var ftpCacheSession = cacheService.createSession("FTP", 0, true); -ftpCacheSession.doomEntriesIfExpired = false; - - -function onLoad() -{ - gMetadataBundle = document.getElementById("bundle_metadata"); - gLangBundle = document.getElementById("bundle_languages"); - gRegionBundle = document.getElementById("bundle_regions"); - - showMetadataFor(window.arguments[0]); - - nodeView = window.arguments[0].ownerDocument.defaultView; -} - -function showMetadataFor(elem) -{ - // skip past non-element nodes - while (elem && elem.nodeType != Node.ELEMENT_NODE) - elem = elem.parentNode; - - if (!elem) { - alert(gMetadataBundle.getString("unableToShowProps")); - window.close(); - } - - if (elem.ownerDocument.getElementsByName && !elem.ownerDocument.namespaceURI) - htmlMode = true; - - // htmllocalname is "" if it's not an html tag, or the name of the tag if it is. - var htmllocalname = ""; - if (isHTMLElement(elem,"")) { - htmllocalname = elem.localName.toLowerCase(); - } - - // We only look for images once - checkForImage(elem, htmllocalname); - - // Walk up the tree, looking for elements of interest. - // Each of them could be at a different level in the tree, so they each - // need their own boolean to tell us to stop looking. - while (elem && elem.nodeType == Node.ELEMENT_NODE) { - htmllocalname = ""; - if (isHTMLElement(elem,"")) { - htmllocalname = elem.localName.toLowerCase(); - } - - if (!onLink) checkForLink(elem, htmllocalname); - if (!onInsDel) checkForInsDel(elem, htmllocalname); - if (!onQuote) checkForQuote(elem, htmllocalname); - if (!onTable) checkForTable(elem, htmllocalname); - if (!onTitle) checkForTitle(elem, htmllocalname); - if (!onLang) checkForLang(elem, htmllocalname); - - elem = elem.parentNode; - } - - // Decide which sections to show - var onMisc = onTable || onTitle || onLang; - if (!onMisc) hideNode("misc-sec"); - if (!onLink) hideNode("link-sec"); - if (!onImage) hideNode("image-sec"); - if (!onInsDel) hideNode("insdel-sec"); - if (!onQuote) hideNode("quote-sec"); - - // Fix the Misc section visibilities - if (onMisc) { - if (!onTable) hideNode("misc-tblsummary"); - if (!onLang) hideNode("misc-lang"); - if (!onTitle) hideNode("misc-title"); - } - - // Get rid of the "No properties" message. This is a backstop - - // it should really never show, as long as nsContextMenu.js's - // checking doesn't get broken. - if (onLink || onImage || onInsDel || onQuote || onMisc) - hideNode("no-properties") -} - - -function checkForImage(elem, htmllocalname) -{ - var img; - var imgType; // "img" = - // "object" = - // "input" = - // "background" = css background (to be added later) - var ismap = false; - - if (htmllocalname === "img") { - img = elem; - imgType = "img"; - - } else if (htmllocalname === "object" && - elem.type.substring(0,6) == "image/" && - elem.data) { - img = elem; - imgType = "object"; - - } else if (htmllocalname === "input" && - elem.type.toUpperCase() == "IMAGE") { - img = elem; - imgType = "input"; - - } else if (htmllocalname === "area" || htmllocalname === "a") { - - // Clicked in image map? - var map = elem; - ismap = true; - setAlt(map); - - while (map && map.nodeType == Node.ELEMENT_NODE && !isHTMLElement(map,"map") ) - map = map.parentNode; - - if (map && map.nodeType == Node.ELEMENT_NODE) { - img = getImageForMap(map); - var imgLocalName = img && img.localName.toLowerCase(); - if (imgLocalName == "img" || imgLocalName == "object") { - imgType = imgLocalName; - } - } - - } - - if (img) { - - var imgURL = imgType == "object" ? img.data : img.src; - setInfo("image-url", imgURL); - var size = getSize(imgURL); - - if (size != -1) { - var kbSize = size / 1024; - kbSize = Math.round(kbSize*100)/100; - setInfo("image-filesize", gMetadataBundle.getFormattedString("imageSize", [kbSize, size])); - } else { - setInfo("image-filesize", gMetadataBundle.getString("imageSizeUnknown")); - } - if ("width" in img && img.width != "") { - setInfo("image-width", gMetadataBundle.getFormattedString("imageWidth", [ img.width ])); - setInfo("image-height", gMetadataBundle.getFormattedString("imageHeight", [ img.height ])); - } - else { - setInfo("image-width", ""); - setInfo("image-height", ""); - } - - if (imgType == "img") { - setInfo("image-desc", img.longDesc); - } else { - setInfo("image-desc", ""); - } - - onImage = true; - } - - if (!ismap) { - if (imgType == "img" || imgType == "input") { - setAlt(img); - } else { - hideNode("image-alt"); - } - } -} - -function checkForLink(elem, htmllocalname) -{ - if ((htmllocalname === "a" && elem.href != "") || - htmllocalname === "area") { - - setInfo("link-lang", convertLanguageCode(elem.getAttribute("hreflang"))); - setInfo("link-url", elem.href); - setInfo("link-type", elem.getAttribute("type")); - setInfo("link-rel", elem.getAttribute("rel")); - setInfo("link-rev", elem.getAttribute("rev")); - - var target = elem.target; - - switch (target) { - case "_top": - setInfo("link-target", gMetadataBundle.getString("sameWindowText")); - break; - case "_parent": - setInfo("link-target", gMetadataBundle.getString("parentFrameText")); - break; - case "_blank": - setInfo("link-target", gMetadataBundle.getString("newWindowText")); - break; - case "": - case "_self": - if (elem.ownerDocument.defaultView) { - if (elem.ownerDocument != elem.ownerDocument.defaultView.content.document) - setInfo("link-target", gMetadataBundle.getString("sameFrameText")); - else - setInfo("link-target", gMetadataBundle.getString("sameWindowText")); - } else { - hideNode("link-target"); - } - break; - default: - setInfo("link-target", "\"" + target + "\""); - } - - onLink = true; - } - - else if (elem.getAttributeNS(XLinkNS, "href") != "") { - var ioService = Components.classes["@mozilla.org/network/io-service;1"] - .getService(Components.interfaces.nsIIOService); - var url = elem.getAttributeNS(XLinkNS, "href"); - try { - var baseURI = ioService.newURI(elem.baseURI, elem.ownerDocument.characterSet, null); - url = ioService.newURI(url, elem.ownerDocument.characterSet, baseURI).spec; - } catch (e) {} - setInfo("link-url", url); - setInfo("link-lang", ""); - setInfo("link-type", ""); - setInfo("link-rel", ""); - setInfo("link-rev", ""); - - switch (elem.getAttributeNS(XLinkNS,"show")) { - case "embed": - setInfo("link-target", gMetadataBundle.getString("embeddedText")); - break; - case "new": - setInfo("link-target", gMetadataBundle.getString("newWindowText")); - break; - case "": - case "replace": - if (elem.ownerDocument != elem.ownerDocument.defaultView.content.document) - setInfo("link-target", gMetadataBundle.getString("sameFrameText")); - else - setInfo("link-target", gMetadataBundle.getString("sameWindowText")); - break; - default: - setInfo("link-target", ""); - break; - } - - onLink = true; - } -} - -function checkForInsDel(elem, htmllocalname) -{ - if ((htmllocalname === "ins" || htmllocalname === "del") && - (elem.cite || elem.dateTime)) { - setInfo("insdel-cite", elem.cite); - setInfo("insdel-date", elem.dateTime); - onInsDel = true; - } -} - - -function checkForQuote(elem, htmllocalname) -{ - if ((htmllocalname === "q" || htmllocalname === "blockquote") && elem.cite) { - setInfo("quote-cite", elem.cite); - onQuote = true; - } -} - -function checkForTable(elem, htmllocalname) -{ - if (htmllocalname === "table" && elem.summary) { - setInfo("misc-tblsummary", elem.summary); - onTable = true; - } -} - -function checkForLang(elem, htmllocalname) -{ - if ((htmllocalname && elem.lang) || elem.getAttributeNS(XMLNS, "lang")) { - var abbr; - if (htmllocalname && elem.lang) - abbr = elem.lang; - else - abbr = elem.getAttributeNS(XMLNS, "lang"); - - setInfo("misc-lang", convertLanguageCode(abbr)); - onLang = true; - } -} - -function checkForTitle(elem, htmllocalname) -{ - if (htmllocalname && elem.title) { - setInfo("misc-title", elem.title); - onTitle = true; - } -} - -/* - * Set text of node id to value - * if value="" the node with specified id is hidden. - * Node should be have one of these forms - * - * - */ -function setInfo(id, value) -{ - if (!value) { - hideNode(id); - return; - } - - var node = document.getElementById(id+"-text"); - - if (node.namespaceURI == XULNS && node.localName == "label" || - (node.namespaceURI == XULNS && node.localName == "textbox")) { - node.setAttribute("value",value); - - } else if (node.namespaceURI == XULNS && node.localName == "description") { - while (node.hasChildNodes()) - node.removeChild(node.firstChild); - node.appendChild(node.ownerDocument.createTextNode(value)); - } -} - -// Hide node with specified id -function hideNode(id) -{ - var style = document.getElementById(id).getAttribute("style"); - document.getElementById(id).setAttribute("style", "display:none;" + style); -} - -/* - * Find or which uses an imagemap. - * If more then one object is found we can't determine which one - * was clicked. - * - * This code has to be changed once bug 1882 is fixed. - * Once bug 72527 is fixed this code should use the .images collection. - */ -function getImageForMap(map) -{ - var mapuri = "#" + map.getAttribute("name"); - var multipleFound = false; - var img; - - var list = getHTMLElements(map.ownerDocument, "img"); - for (var i=0; i < list.length; i++) { - if (list.item(i).getAttribute("usemap") == mapuri) { - if (img) { - multipleFound = true; - break; - } else { - img = list.item(i); - imgType = "img"; - } - } - } - - list = getHTMLElements(map.ownerDocument, "object"); - for (i = 0; i < list.length; i++) { - if (list.item(i).getAttribute("usemap") == mapuri) { - if (img) { - multipleFound = true; - break; - } else { - img = list.item(i); - imgType = "object"; - } - } - } - - if (multipleFound) - img = null; - - return img; -} - -function getHTMLElements(node, name) -{ - if (htmlMode) - return node.getElementsByTagName(name); - return node.getElementsByTagNameNS(XHTMLNS, name); -} - -// name should be in lower case -function isHTMLElement(node, name) -{ - if (node.nodeType != Node.ELEMENT_NODE) - return false; - - if (htmlMode) - return !name || node.localName.toLowerCase() == name; - - return (!name || node.localName == name) && node.namespaceURI == XHTMLNS; -} - -// This function coded according to the spec at: -// http://www.bath.ac.uk/~py8ieh/internet/discussion/metadata.txt -function convertLanguageCode(abbr) -{ - if (!abbr) return ""; - var result; - var region = ""; - var tokens = abbr.split("-"); - var language = tokens.shift(); - - if (language == "x" || language == "i") - { - // x and i prefixes mean unofficial ones. So we proper-case the next - // word and leave the rest. - if (tokens.length > 0) - { - // Upper-case first letter - language = tokens[0].substr(0, 1).toUpperCase() + tokens[0].substr(1); - tokens.shift(); - - // Add on the rest as space-separated strings inside the brackets - region = tokens.join(" "); - } - } - else - { - // Otherwise we treat the first as a lang, the second as a region - // and the rest as strings. - try - { - language = gLangBundle.getString(language.toLowerCase()); - } - catch (e) - { - } - - if (tokens.length > 0) - { - try - { - tokens[0] = gRegionBundle.getString(tokens[0].toLowerCase()); - } - catch (e) - { - } - region = tokens.join(" "); - } - } - - if (region) { - result = gMetadataBundle.getFormattedString("languageRegionFormat", - [language, region]); - } else { - result = language; - } - return result; -} - -// Returns the size of the URL in bytes; must be cached and therefore an HTTP or FTP URL -function getSize(url) { - try - { - var cacheEntryDescriptor = httpCacheSession.openCacheEntry(url, Components.interfaces.nsICache.ACCESS_READ, false); - if(cacheEntryDescriptor) - return cacheEntryDescriptor.dataSize; - } - catch(ex) {} - try - { - cacheEntryDescriptor = ftpCacheSession.openCacheEntry(url, Components.interfaces.nsICache.ACCESS_READ, false); - if (cacheEntryDescriptor) - return cacheEntryDescriptor.dataSize; - } - catch(ex) {} - return -1; -} - -function setAlt(elem) { - var altText = document.getElementById("image-alt-text"); - if (elem.hasAttribute("alt")) { - if (elem.alt != "") { - altText.value = elem.alt; - altText.setAttribute("style","font-style:inherit"); - } else { - altText.value = gMetadataBundle.getString("altTextBlank"); - altText.setAttribute("style","font-style:italic"); - } - } else { - altText.value = gMetadataBundle.getString("altTextMissing"); - altText.setAttribute("style","font-style:italic"); - } - -} diff --git a/xpfe/browser/resources/content/metadata.xul b/xpfe/browser/resources/content/metadata.xul deleted file mode 100644 index d2609c707458..000000000000 --- a/xpfe/browser/resources/content/metadata.xul +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - - - %metadataDTD; -]> - - - - - - - - - - - - - &exitWarningMsg.label; - - - - - - - - - - - - - - - - - diff --git a/xpfe/browser/resources/content/unix/.cvsignore b/xpfe/browser/resources/content/unix/.cvsignore deleted file mode 100644 index 550bd25cdbab..000000000000 --- a/xpfe/browser/resources/content/unix/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile - diff --git a/xpfe/browser/resources/content/unix/contents-platform.rdf b/xpfe/browser/resources/content/unix/contents-platform.rdf deleted file mode 100644 index 027fec474e51..000000000000 --- a/xpfe/browser/resources/content/unix/contents-platform.rdf +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - diff --git a/xpfe/browser/resources/content/unix/platformMailOverlay.xul b/xpfe/browser/resources/content/unix/platformMailOverlay.xul deleted file mode 100644 index c0e411392394..000000000000 --- a/xpfe/browser/resources/content/unix/platformMailOverlay.xul +++ /dev/null @@ -1,6 +0,0 @@ - - - - - diff --git a/xpfe/browser/resources/content/unix/platformNavigationBindings.xul b/xpfe/browser/resources/content/unix/platformNavigationBindings.xul deleted file mode 100644 index 689df76eb09e..000000000000 --- a/xpfe/browser/resources/content/unix/platformNavigationBindings.xul +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/xpfe/browser/resources/content/urlbarBindings.xml b/xpfe/browser/resources/content/urlbarBindings.xml deleted file mode 100644 index 35220cbf4ff7..000000000000 --- a/xpfe/browser/resources/content/urlbarBindings.xml +++ /dev/null @@ -1,480 +0,0 @@ - - - - - - - - - - - - var svc = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefService); - svc.getBranch(null); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - this.mSelectedIndex = val; - if (val == null) - this.mSearchBox.selectedIndex = null; - - return val; - - - - - - - - - - this.textbox.view.selectedIndex = val; - return val; - - - - - - - document.getAnonymousElementByAttribute(this, "role", "search-box"); - - - - var svc = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefService); - svc.getBranch(null); - - - - - - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0) - this.mSearchBox.selectBy(aDir, aAmount); - else if (this.mSearchBox.selectedIndex != null) - this.mSearchBox.selectedIndex = null; - - return sel; - ]]> - - - - - - - - - - - - - - - - - - // ensure that if a result menuitem is moused-over, any - // search selection is cleared - (function(aEvent) { - if (aEvent.target.nodeName == "menuitem") - this.mSearchBox.selectedIndex = null; - }) - - - - // ensure that if the popup closes, any search selection is cleared - (function(aEvent) { - this.mSearchBox.selectedIndex = null; - }) - - - - - - return this.mSelectedIndex; - - - - - - - - - - - - - - - - - - - - - - - - - this.parentNode.textbox.onResultClick(); - - - - - - - - - - - - - - this.parentNode.selectedIndex = this.getAttribute("engineIndex"); - - - - this.parentNode.selectedIndex = null; - - - - - diff --git a/xpfe/browser/resources/content/viewPartialSource.js b/xpfe/browser/resources/content/viewPartialSource.js deleted file mode 100644 index 7e2512dd087d..000000000000 --- a/xpfe/browser/resources/content/viewPartialSource.js +++ /dev/null @@ -1,508 +0,0 @@ -/* ***** 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 view-source front-end. - * - * The Initial Developer of the Original Code is mozilla.org. - * Portions created by the Initial Developer are Copyright (C) 2002 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Roger B. Sidje (Original Author) - * Steve Swanson - * Doron Rosenberg - * - * 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 gDebug = 0; -var gLineCount = 0; -var gStartTargetLine = 0; -var gEndTargetLine = 0; -var gTargetNode = null; - -var gEntityConverter = null; -var gWrapLongLines = false; -const gViewSourceCSS = 'resource://gre/res/viewsource.css'; -const NS_XHTML = 'http://www.w3.org/1999/xhtml'; - -// These are markers used to delimit the selection during processing. They -// are removed from the final rendering, but we pick space-like characters for -// safety (and futhermore, these are known to be mapped to a 0-length string -// in transliterate.properties). It is okay to set start=end, we use findNext() -// U+200B ZERO WIDTH SPACE -const MARK_SELECTION_START = '\u200B\u200B\u200B\u200B\u200B'; -const MARK_SELECTION_END = '\u200B\u200B\u200B\u200B\u200B'; - -function onLoadViewPartialSource() -{ - // 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'); - gWrapLongLines = true; - } - } catch (e) { } - try { - document.getElementById("menu_highlightSyntax").setAttribute("checked", gPrefs.getBoolPref("view_source.syntax_highlight")); - } catch (e) { - } - } else { - document.getElementById("menu_highlightSyntax").setAttribute("hidden", "true"); - } - - // disable menu items that don't work since the selection is munged and - // the editor doesn't work for MathML - document.getElementById('cmd_savePage').setAttribute('disabled', 'true'); - document.getElementById('cmd_editPage').setAttribute('disabled', 'true'); - - if (window.arguments[3] == 'selection') - viewPartialSourceForSelection(window.arguments[2]); - else - viewPartialSourceForFragment(window.arguments[2], window.arguments[3]); - - window.content.focus(); -} - -//////////////////////////////////////////////////////////////////////////////// -// view-source of a selection with the special effect of remapping the selection -// to the underlying view-source output -function viewPartialSourceForSelection(selection) -{ - var range = selection.getRangeAt(0); - var ancestorContainer = range.commonAncestorContainer; - var doc = ancestorContainer.ownerDocument; - - var startContainer = range.startContainer; - var endContainer = range.endContainer; - var startOffset = range.startOffset; - var endOffset = range.endOffset; - - // let the ancestor be an element - if (ancestorContainer.nodeType == Node.TEXT_NODE || - ancestorContainer.nodeType == Node.CDATA_SECTION_NODE) - ancestorContainer = ancestorContainer.parentNode; - - // for selectAll, let's use the entire document, including ... - // @see DocumentViewerImpl::SelectAll() for how selectAll is implemented - try { - if (ancestorContainer == doc.body) - ancestorContainer = doc.documentElement; - } catch (e) { } - - // each path is a "child sequence" (a.k.a. "tumbler") that - // descends from the ancestor down to the boundary point - var startPath = getPath(ancestorContainer, startContainer); - var endPath = getPath(ancestorContainer, endContainer); - - // clone the fragment of interest and reset everything to be relative to it - // note: it is with the clone that we operate/munge from now on - ancestorContainer = ancestorContainer.cloneNode(true); - startContainer = ancestorContainer; - endContainer = ancestorContainer; - - // Only bother with the selection if it can be remapped. Don't mess with - // leaf elements (such as ) that secretly use anynomous content - // for their display appearance. - var canDrawSelection = ancestorContainer.hasChildNodes(); - if (canDrawSelection) { - var i; - for (i = startPath ? startPath.length-1 : -1; i >= 0; i--) { - startContainer = startContainer.childNodes.item(startPath[i]); - } - for (i = endPath ? endPath.length-1 : -1; i >= 0; i--) { - endContainer = endContainer.childNodes.item(endPath[i]); - } - - // add special markers to record the extent of the selection - // note: |startOffset| and |endOffset| are interpreted either as - // offsets in the text data or as child indices (see the Range spec) - // (here, munging the end point first to keep the start point safe...) - var tmpNode; - if (endContainer.nodeType == Node.TEXT_NODE || - endContainer.nodeType == Node.CDATA_SECTION_NODE) { - // do some extra tweaks to try to avoid the view-source output to look like - // ...]... or ...]... (where ']' marks the end of the selection). - // To get a neat output, the idea here is to remap the end point from: - // 1. ...]... to ...]... - // 2. ...]... to ...]... - if ((endOffset > 0 && endOffset < endContainer.data.length) || - !endContainer.parentNode || !endContainer.parentNode.parentNode) - endContainer.insertData(endOffset, MARK_SELECTION_END); - else { - tmpNode = doc.createTextNode(MARK_SELECTION_END); - endContainer = endContainer.parentNode; - if (endOffset == 0) - endContainer.parentNode.insertBefore(tmpNode, endContainer); - else - endContainer.parentNode.insertBefore(tmpNode, endContainer.nextSibling); - } - } - else { - tmpNode = doc.createTextNode(MARK_SELECTION_END); - endContainer.insertBefore(tmpNode, endContainer.childNodes.item(endOffset)); - } - - if (startContainer.nodeType == Node.TEXT_NODE || - startContainer.nodeType == Node.CDATA_SECTION_NODE) { - // do some extra tweaks to try to avoid the view-source output to look like - // ...[... or ...[... (where '[' marks the start of the selection). - // To get a neat output, the idea here is to remap the start point from: - // 1. ...[... to ...[... - // 2. ...[... to ...[... - if ((startOffset > 0 && startOffset < startContainer.data.length) || - !startContainer.parentNode || !startContainer.parentNode.parentNode || - startContainer != startContainer.parentNode.lastChild) - startContainer.insertData(startOffset, MARK_SELECTION_START); - else { - tmpNode = doc.createTextNode(MARK_SELECTION_START); - startContainer = startContainer.parentNode; - if (startOffset == 0) - startContainer.parentNode.insertBefore(tmpNode, startContainer); - else - startContainer.parentNode.insertBefore(tmpNode, startContainer.nextSibling); - } - } - else { - tmpNode = doc.createTextNode(MARK_SELECTION_START); - startContainer.insertBefore(tmpNode, startContainer.childNodes.item(startOffset)); - } - } - - // now extract and display the syntax highlighted source - tmpNode = doc.createElementNS(NS_XHTML, 'div'); - tmpNode.appendChild(ancestorContainer); - - // the load is aynchronous and so we will wait until the view-source DOM is done - // before drawing the selection. - if (canDrawSelection) { - window.document.getElementById("appcontent").addEventListener("load", drawSelection, true); - } - - // all our content is held by the data:URI and URIs are internally stored as utf-8 (see nsIURI.idl) - var loadFlags = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE; - getBrowser().webNavigation - .loadURI("view-source:data:text/html;charset=utf-8," + encodeURIComponent(tmpNode.innerHTML), - loadFlags, null, null, null); -} - -//////////////////////////////////////////////////////////////////////////////// -// helper to get a path like FIXptr, but with an array instead of the "tumbler" notation -// see FIXptr: http://lists.w3.org/Archives/Public/www-xml-linking-comments/2001AprJun/att-0074/01-NOTE-FIXptr-20010425.htm -function getPath(ancestor, node) -{ - var n = node; - var p = n.parentNode; - if (n == ancestor || !p) - return null; - var path = new Array(); - if (!path) - return null; - do { - for (var i = 0; i < p.childNodes.length; i++) { - if (p.childNodes.item(i) == n) { - path.push(i); - break; - } - } - n = p; - p = n.parentNode; - } while (n != ancestor && p); - return path; -} - -//////////////////////////////////////////////////////////////////////////////// -// using special markers left in the serialized source, this helper makes the -// underlying markup of the selected fragment to automatically appear as selected -// on the inflated view-source DOM -function drawSelection() -{ - // find the special selection markers that we added earlier, and - // draw the selection between the two... - var findService = null; - try { - // get the find service which stores the global find state - findService = Components.classes["@mozilla.org/find/find_service;1"] - .getService(Components.interfaces.nsIFindService); - } catch(e) { } - if (!findService) - return; - - // cache the current global find state - var matchCase = findService.matchCase; - var entireWord = findService.entireWord; - var wrapFind = findService.wrapFind; - var findBackwards = findService.findBackwards; - var searchString = findService.searchString; - var replaceString = findService.replaceString; - - // setup our find instance - var findInst = getBrowser().webBrowserFind; - findInst.matchCase = true; - findInst.entireWord = false; - findInst.wrapFind = true; - findInst.findBackwards = false; - - // ...lookup the start mark - findInst.searchString = MARK_SELECTION_START; - var startLength = MARK_SELECTION_START.length; - findInst.findNext(); - - var contentWindow = getBrowser().contentDocument.defaultView; - var selection = contentWindow.getSelection(); - var range = selection.getRangeAt(0); - - var startContainer = range.startContainer; - var startOffset = range.startOffset; - - // ...lookup the end mark - findInst.searchString = MARK_SELECTION_END; - var endLength = MARK_SELECTION_END.length; - findInst.findNext(); - - var endContainer = selection.anchorNode; - var endOffset = selection.anchorOffset; - - // reset the selection that find has left - selection.removeAllRanges(); - - // delete the special markers now... - endContainer.deleteData(endOffset, endLength); - startContainer.deleteData(startOffset, startLength); - if (startContainer == endContainer) - endOffset -= startLength; // has shrunk if on same text node... - range.setEnd(endContainer, endOffset); - - // show the selection and scroll it into view - selection.addRange(range); - // the default behavior of the selection is to scroll at the end of - // the selection, whereas in this situation, it is more user-friendly - // to scroll at the beginning. So we override the default behavior here - try { - getBrowser().docShell - .QueryInterface(Components.interfaces.nsIInterfaceRequestor) - .getInterface(Components.interfaces.nsISelectionDisplay) - .QueryInterface(Components.interfaces.nsISelectionController) - .scrollSelectionIntoView(Components.interfaces.nsISelectionController.SELECTION_NORMAL, - Components.interfaces.nsISelectionController.SELECTION_ANCHOR_REGION, - true); - } - catch(e) { } - - // restore the current find state - findService.matchCase = matchCase; - findService.entireWord = entireWord; - findService.wrapFind = wrapFind; - findService.findBackwards = findBackwards; - findService.searchString = searchString; - findService.replaceString = replaceString; - - findInst.matchCase = matchCase; - findInst.entireWord = entireWord; - findInst.wrapFind = wrapFind; - findInst.findBackwards = findBackwards; - findInst.searchString = searchString; -} - -//////////////////////////////////////////////////////////////////////////////// -// special handler for markups such as MathML where reformatting the output is -// helpful -function viewPartialSourceForFragment(node, context) -{ - gTargetNode = node; - if (gTargetNode && gTargetNode.nodeType == Node.TEXT_NODE) - gTargetNode = gTargetNode.parentNode; - - // walk up the tree to the top-level element (e.g., , ) - var topTag; - if (context == 'mathml') - topTag = 'math'; - else - throw 'not reached'; - var topNode = gTargetNode; - while (topNode && topNode.localName != topTag) - topNode = topNode.parentNode; - if (!topNode) - return; - - // serialize (note: the main window overrides the title set here) - var wrapClass = gWrapLongLines ? ' class="wrap"' : ''; - var source = - '' - + 'Mozilla' - + '' - + '' - + '' - + '' - + '
'
-  + getOuterMarkup(topNode, 0)
-  + '
' - ; // end - - // display - var doc = getBrowser().contentDocument; - doc.open("text/html", "replace"); - doc.write(source); - doc.close(); -} - -//////////////////////////////////////////////////////////////////////////////// -function getInnerMarkup(node, indent) { - var str = ''; - for (var i = 0; i < node.childNodes.length; i++) { - str += getOuterMarkup(node.childNodes.item(i), indent); - } - return str; -} - -//////////////////////////////////////////////////////////////////////////////// -function getOuterMarkup(node, indent) { - var newline = ''; - var padding = ''; - var str = ''; - if (node == gTargetNode) { - gStartTargetLine = gLineCount; - str += '
';
-  }
-
-  switch (node.nodeType) {
-  case Node.ELEMENT_NODE: // Element
-    // to avoid the wide gap problem, '\n' is not emitted on the first
-    // line and the lines before & after the 
...
- if (gLineCount > 0 && - gLineCount != gStartTargetLine && - gLineCount != gEndTargetLine) { - newline = '\n'; - } - gLineCount++; - if (gDebug) { - newline += gLineCount; - } - for (var k = 0; k < indent; k++) { - padding += ' '; - } - str += newline + padding - + '<' + node.nodeName + ''; - for (var i = 0; i < node.attributes.length; i++) { - var attr = node.attributes.item(i); - if (!gDebug && attr.nodeName.match(/^[-_]moz/)) { - continue; - } - str += ' ' - + attr.nodeName - + '="' - + unicodeTOentity(attr.nodeValue) - + '"'; - } - if (!node.hasChildNodes()) { - str += '/>'; - } - else { - str += '>'; - var oldLine = gLineCount; - str += getInnerMarkup(node, indent + 2); - if (oldLine == gLineCount) { - newline = ''; - padding = ''; - } - else { - newline = (gLineCount == gEndTargetLine) ? '' : '\n'; - gLineCount++; - if (gDebug) { - newline += gLineCount; - } - } - str += newline + padding - + '</' + node.nodeName + '>'; - } - break; - case Node.TEXT_NODE: // Text - var tmp = node.nodeValue; - tmp = tmp.replace(/(\n|\r|\t)+/g, " "); - tmp = tmp.replace(/^ +/, ""); - tmp = tmp.replace(/ +$/, ""); - if (tmp.length != 0) { - str += '' + unicodeTOentity(tmp) + ''; - } - break; - default: - break; - } - - if (node == gTargetNode) { - gEndTargetLine = gLineCount; - str += '
';
-  }
-  return str;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-function unicodeTOentity(text)
-{
-  const charTable = {
-    '&': '&amp;',
-    '<': '&lt;',
-    '>': '&gt;',
-    '"': '&quot;'
-  };
-
-  function charTableLookup(letter) {
-    return charTable[letter];
-  }
-
-  function convertEntity(letter) {
-    try {
-      var unichar = gEntityConverter.ConvertToEntity(letter, entityVersion);
-      var entity = unichar.substring(1); // extract '&'
-      return '&' + entity + '';
-    } catch (ex) {
-      return letter;
-    }
-  }
-
-  if (!gEntityConverter) {
-    try {
-      gEntityConverter =
-        Components.classes["@mozilla.org/intl/entityconverter;1"]
-                  .createInstance(Components.interfaces.nsIEntityConverter);
-    } catch(e) { }
-  }
-
-  const entityVersion = Components.interfaces.nsIEntityConverter.entityW3C;
-
-  var str = text;
-
-  // replace chars in our charTable
-  str = str.replace(/[<>&"]/g, charTableLookup);
-
-  // replace chars > 0x7f via nsIEntityConverter
-  str = str.replace(/[^\0-\u007f]/g, convertEntity);
-
-  return str;
-}
diff --git a/xpfe/browser/resources/content/viewPartialSource.xul b/xpfe/browser/resources/content/viewPartialSource.xul
deleted file mode 100644
index 994baba8957c..000000000000
--- a/xpfe/browser/resources/content/viewPartialSource.xul
+++ /dev/null
@@ -1,105 +0,0 @@
-  
- 
-
-
-
-
-
-
-%brandDTD;
-
-%sourceDTD;
-
-%navigatorDTD;
-
-%contentAreaCommandsDTD;
-]>
-
-
-
-