From efb45ba9c72234a6182747794af7594bb70e91bc Mon Sep 17 00:00:00 2001 From: "chanial%noos.fr" Date: Sat, 1 Mar 2003 08:07:13 +0000 Subject: [PATCH] Move the js console and dependencies as new extensions in toolkit/components. NPOB git-svn-id: svn://10.0.0.236/trunk@138755 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/browser/base/content/browser.js | 6 +- mozilla/browser/base/jar.mn | 5 -- mozilla/browser/components/Makefile.in | 2 +- mozilla/browser/components/console/MANIFEST | 1 - mozilla/browser/components/console/jar.mn | 9 --- mozilla/toolkit/components/Makefile.in | 2 +- .../components/console/Makefile.in | 8 +-- .../components/console/content/console.css | 8 +-- .../components/console/content/console.js | 24 ++++---- .../components/console/content/console.xul | 6 +- .../console/content/consoleBindings.xml | 38 ++++--------- mozilla/toolkit/components/console/jar.mn | 14 +++++ .../components/console/jsconsole-clhandler.js | 0 .../components/console/locale/console.dtd | 13 +++++ .../console/locale/console.properties | 0 .../console/skin}/console-error-caret.gif | Bin .../console/skin}/console-error-dash.gif | Bin .../console/skin}/console.css | 52 +++++++++++------- .../toolkit/components/viewsource/Makefile.in | 31 +++++++++++ .../viewsource}/content/viewPartialSource.js | 0 .../viewsource}/content/viewPartialSource.xul | 12 ++-- .../viewsource/content/viewSource.js} | 0 .../viewsource}/content/viewSource.xul | 11 ++-- .../viewsource}/content/viewSourceOverlay.xul | 4 +- mozilla/toolkit/components/viewsource/jar.mn | 9 +++ .../viewsource}/locale/viewSource.dtd | 0 mozilla/toolkit/skin/win/jar.mn | 3 - 27 files changed, 152 insertions(+), 106 deletions(-) delete mode 100644 mozilla/browser/components/console/MANIFEST delete mode 100644 mozilla/browser/components/console/jar.mn rename mozilla/{browser => toolkit}/components/console/Makefile.in (88%) rename mozilla/{browser => toolkit}/components/console/content/console.css (75%) rename mozilla/{browser => toolkit}/components/console/content/console.js (95%) rename mozilla/{browser => toolkit}/components/console/content/console.xul (94%) rename mozilla/{browser => toolkit}/components/console/content/consoleBindings.xml (92%) create mode 100644 mozilla/toolkit/components/console/jar.mn rename mozilla/{browser => toolkit}/components/console/jsconsole-clhandler.js (100%) rename mozilla/{browser => toolkit}/components/console/locale/console.dtd (74%) rename mozilla/{browser => toolkit}/components/console/locale/console.properties (100%) rename mozilla/toolkit/{skin/win/console => components/console/skin}/console-error-caret.gif (100%) rename mozilla/toolkit/{skin/win/console => components/console/skin}/console-error-dash.gif (100%) rename mozilla/toolkit/{skin/win => components/console/skin}/console.css (53%) create mode 100644 mozilla/toolkit/components/viewsource/Makefile.in rename mozilla/{browser/base => toolkit/components/viewsource}/content/viewPartialSource.js (100%) rename mozilla/{browser/base => toolkit/components/viewsource}/content/viewPartialSource.xul (88%) rename mozilla/{browser/base/content/viewsource.js => toolkit/components/viewsource/content/viewSource.js} (100%) rename mozilla/{browser/base => toolkit/components/viewsource}/content/viewSource.xul (91%) rename mozilla/{browser/base => toolkit/components/viewsource}/content/viewSourceOverlay.xul (97%) create mode 100644 mozilla/toolkit/components/viewsource/jar.mn rename mozilla/{browser/base => toolkit/components/viewsource}/locale/viewSource.dtd (100%) diff --git a/mozilla/browser/base/content/browser.js b/mozilla/browser/base/content/browser.js index 40cf0e9a4f6..920bc91f3c6 100644 --- a/mozilla/browser/base/content/browser.js +++ b/mozilla/browser/base/content/browser.js @@ -989,7 +989,7 @@ function BrowserViewSourceOfDocument(aDocument) function BrowserViewSourceOfURL(url, charset, pageCookie) { // try to open a view-source window while inheriting the charset (if any) - openDialog("chrome://browser/content/viewSource.xul", + openDialog("chrome://global/content/viewSource.xul", "_blank", "scrollbars,resizable,chrome,dialog=no", url, charset, pageCookie); @@ -2093,7 +2093,7 @@ function deleteHistoryItems(aParent) function toJavaScriptConsole() { - toOpenWindowByType("global:console", "chrome://browser/content/console/console.xul"); + toOpenWindowByType("global:console", "chrome://global/content/console.xul"); } function toOpenWindowByType(inType, uri) @@ -3272,7 +3272,7 @@ nsContextMenu.prototype = { throw "not reached"; var docUrl = null; // unused (and play nice for fragments generated via XSLT too) - window.openDialog("chrome://browser/content/viewPartialSource.xul", + window.openDialog("chrome://global/content/viewPartialSource.xul", "_blank", "scrollbars,resizable,chrome,dialog=no", docUrl, docCharset, reference, context); }, diff --git a/mozilla/browser/base/jar.mn b/mozilla/browser/base/jar.mn index 49f885d0118..ac52b47669c 100644 --- a/mozilla/browser/base/jar.mn +++ b/mozilla/browser/base/jar.mn @@ -6,10 +6,6 @@ browser.jar: * content/browser/utilityOverlay.js (content/utilityOverlay.js) content/browser/about.gif (content/about.gif) * content/browser/aboutDialog.xul (content/aboutDialog.xul) -* content/browser/viewPartialSource.xul (content/viewPartialSource.xul) -* content/browser/viewsource.js (content/viewsource.js) -* content/browser/viewSource.xul (content/viewSource.xul) -* content/browser/viewSourceOverlay.xul (content/viewSourceOverlay.xul) * content/browser/openLocation.xul (content/openLocation.xul) * content/browser/openLocation.js (content/openLocation.js) * content/browser/pageReport.xul (content/pageReport.xul) @@ -46,7 +42,6 @@ en-US.jar: * locale/en-US/browser/browser.dtd (locale/browser.dtd) locale/en-US/browser/browser.properties (locale/browser.properties) locale/en-US/browser/aboutDialog.dtd (locale/aboutDialog.dtd) - locale/en-US/browser/viewSource.dtd (locale/viewSource.dtd) locale/en-US/browser/openLocation.dtd (locale/openLocation.dtd) locale/en-US/browser/openLocation.properties (locale/openLocation.properties) locale/en-US/browser/pageReport.dtd (locale/pageReport.dtd) diff --git a/mozilla/browser/components/Makefile.in b/mozilla/browser/components/Makefile.in index d55ce21ad15..0d1c0491e27 100644 --- a/mozilla/browser/components/Makefile.in +++ b/mozilla/browser/components/Makefile.in @@ -42,6 +42,6 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk -DIRS = prefwindow bookmarks console downloads history build +DIRS = prefwindow bookmarks downloads history build include $(topsrcdir)/config/rules.mk diff --git a/mozilla/browser/components/console/MANIFEST b/mozilla/browser/components/console/MANIFEST deleted file mode 100644 index f112fd12aed..00000000000 --- a/mozilla/browser/components/console/MANIFEST +++ /dev/null @@ -1 +0,0 @@ -jsconsole-clhandler.js diff --git a/mozilla/browser/components/console/jar.mn b/mozilla/browser/components/console/jar.mn deleted file mode 100644 index 862a84731aa..00000000000 --- a/mozilla/browser/components/console/jar.mn +++ /dev/null @@ -1,9 +0,0 @@ -browser.jar: -* content/browser/console/console.js (content/console.js) -* content/browser/console/console.xul (content/console.xul) - content/browser/console/console.css (content/console.css) - content/browser/console/consoleBindings.xml (content/consoleBindings.xml) - -en-US.jar: -* locale/en-US/browser/console/console.dtd (locale/console.dtd) - locale/en-US/browser/console/console.properties (locale/console.properties) diff --git a/mozilla/toolkit/components/Makefile.in b/mozilla/toolkit/components/Makefile.in index a8dbde5ad0d..136cd9fd21b 100644 --- a/mozilla/toolkit/components/Makefile.in +++ b/mozilla/toolkit/components/Makefile.in @@ -5,6 +5,6 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk -DIRS = autocomplete history satchel build +DIRS = autocomplete console history satchel viewsource build include $(topsrcdir)/config/rules.mk diff --git a/mozilla/browser/components/console/Makefile.in b/mozilla/toolkit/components/console/Makefile.in similarity index 88% rename from mozilla/browser/components/console/Makefile.in rename to mozilla/toolkit/components/console/Makefile.in index 7bbdfd93316..82e3c7e82d5 100644 --- a/mozilla/browser/components/console/Makefile.in +++ b/mozilla/toolkit/components/console/Makefile.in @@ -20,10 +20,10 @@ # -DEPTH = ../../.. -topsrcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ +DEPTH = ../../.. +topsrcdir = @top_srcdir@ +srcdir = @srcdir@ +VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk diff --git a/mozilla/browser/components/console/content/console.css b/mozilla/toolkit/components/console/content/console.css similarity index 75% rename from mozilla/browser/components/console/content/console.css rename to mozilla/toolkit/components/console/content/console.css index b6007415249..6b0fadc7ed4 100644 --- a/mozilla/browser/components/console/content/console.css +++ b/mozilla/toolkit/components/console/content/console.css @@ -1,6 +1,6 @@ .console-box { - -moz-binding: url("chrome://browser/content/console/consoleBindings.xml#console-box"); + -moz-binding: url("chrome://global/content/console/consoleBindings.xml#console-box"); overflow: auto; } @@ -10,11 +10,11 @@ .console-row[type="error"], .console-row[type="warning"] { - -moz-binding: url("chrome://browser/content/console/consoleBindings.xml#error"); + -moz-binding: url("chrome://global/content/console/consoleBindings.xml#error"); } .console-row[type="message"] { - -moz-binding: url("chrome://browser/content/console/consoleBindings.xml#message"); + -moz-binding: url("chrome://global/content/console/consoleBindings.xml#message"); } .console-error-msg { @@ -26,7 +26,7 @@ } .console-error-source { - -moz-binding: url("chrome://browser/content/console/consoleBindings.xml#console-error-source"); + -moz-binding: url("chrome://global/content/console/consoleBindings.xml#console-error-source"); } /* :::::::::: hiding and showing of rows for each mode :::::::::: */ diff --git a/mozilla/browser/components/console/content/console.js b/mozilla/toolkit/components/console/content/console.js similarity index 95% rename from mozilla/browser/components/console/content/console.js rename to mozilla/toolkit/components/console/content/console.js index 34bfbdc3b49..8d4622c2513 100644 --- a/mozilla/browser/components/console/content/console.js +++ b/mozilla/toolkit/components/console/content/console.js @@ -1,27 +1,27 @@ # -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- # ***** BEGIN LICENSE BLOCK ***** # Version: NPL 1.1/GPL 2.0/LGPL 2.1 -# +# # 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.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): # Joe Hewitt -# +# # 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"), @@ -33,7 +33,7 @@ # 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 NPL, the GPL or the LGPL. -# +# # ***** END LICENSE BLOCK ***** var gConsole, gConsoleBundle; @@ -140,9 +140,11 @@ function evaluateTypein() function displayResult() { - var result = Evaluator.document.documentElement.lastChild.firstChild; - if (result && result.data) - gConsole.mCService.logStringMessage(result.data); + var resultRange = Evaluator.document.createRange(); + resultRange.selectNode(Evaluator.document.documentElement); + var result = resultRange.toString(); + if (result) + gConsole.mCService.logStringMessage(result); // or could use appendMessage which doesn't persist } @@ -219,5 +221,3 @@ function getStackTrace() return str; } - - diff --git a/mozilla/browser/components/console/content/console.xul b/mozilla/toolkit/components/console/content/console.xul similarity index 94% rename from mozilla/browser/components/console/content/console.xul rename to mozilla/toolkit/components/console/content/console.xul index 7af2122ca4e..03dad496a52 100644 --- a/mozilla/browser/components/console/content/console.xul +++ b/mozilla/toolkit/components/console/content/console.xul @@ -21,8 +21,8 @@ # Contributor(s): Joe Hewitt - - + + @@ -43,7 +43,7 @@ persist="screenX screenY width height">