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
This commit is contained in:
chanial%noos.fr
2003-03-01 08:07:13 +00:00
parent 0aa64c9755
commit efb45ba9c7
27 changed files with 152 additions and 106 deletions

View File

@@ -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);
},

View File

@@ -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)

View File

@@ -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

View File

@@ -1 +0,0 @@
jsconsole-clhandler.js

View File

@@ -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)

View File

@@ -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

View File

@@ -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

View File

@@ -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 :::::::::: */

View File

@@ -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 <hewitt@netscape.com>
#
#
# 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;
}

View File

@@ -21,8 +21,8 @@
# Contributor(s): Joe Hewitt <hewitt@netscape.com>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://global/skin/console.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/console/console.css" type="text/css"?>
<?xml-stylesheet href="chrome://global/skin/console/console.css" type="text/css"?>
<?xml-stylesheet href="chrome://global/content/console.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
@@ -43,7 +43,7 @@
persist="screenX screenY width height">
<script type="application/x-javascript" src="chrome://global/content/globalOverlay.js"/>
<script type="application/x-javascript" src="chrome://browser/content/console/console.js"/>
<script type="application/x-javascript" src="chrome://global/content/console.js"/>
<stringbundle id="ConsoleBundle" src="chrome://global/locale/console.properties"/>
<command id="cmd_copy" oncommand="copyItemToClipboard()"/>

View File

@@ -211,8 +211,15 @@
<method name="copySelectedItem">
<body><![CDATA[
if (this.mSelectedItem)
this.copyString(this.mSelectedItem.toString());
if (this.mSelectedItem) try {
const clipURI = "@mozilla.org/widget/clipboardhelper;1";
const clipI = Components.interfaces.nsIClipboardHelper;
var clipboard = Components.classes[clipURI].getService(clipI);
clipboard.copyString(this.mSelectedItem.toString());
} catch (ex) {
// Unable to copy anything, die quietly
}
]]></body>
</method>
@@ -275,31 +282,6 @@
]]></body>
</method>
<method name="copyString">
<parameter name="aString"/>
<body><![CDATA[
try {
const clipURI = "@mozilla.org/widget/clipboard;1";
const clipI = Components.interfaces.nsIClipboard;
var clipboard = Components.classes[clipURI].getService(clipI);
const transURI = "@mozilla.org/widget/transferable;1";
var transferable = Components.classes[transURI].createInstance(Components.interfaces.nsITransferable);
transferable.addDataFlavor("text/unicode");
const strURI = "@mozilla.org/supports-string;1";
var wstring = Components.classes[strURI].createInstance(Components.interfaces.nsISupportsString);
wstring.data = aString;
transferable.setTransferData("text/unicode", wstring, aString.length * 2);
clipboard.setData(transferable, null, clipI.kGlobalClipboard);
} catch (ex) {
// Unable to copy anything, die quietly
}
]]></body>
</method>
<constructor> this.init(); </constructor>
<destructor> this.destroy(); </destructor>
</implementation>
@@ -409,7 +391,7 @@
<handlers>
<handler event="click"><![CDATA[
window.openDialog(
"chrome://browser/content/viewSource.xul", "_blank",
"chrome://global/content/viewSource.xul", "_blank",
"scrollbars,resizable,chrome,dialog=no", this.getAttribute("url"));
]]></handler>
</handlers>

View File

@@ -0,0 +1,14 @@
toolkit.jar:
* content/global/console.js (content/console.js)
* content/global/console.xul (content/console.xul)
content/global/console.css (content/console.css)
content/global/consoleBindings.xml (content/consoleBindings.xml)
classic.jar:
+ skin/classic/global/console/console.css (skin/console.css)
skin/classic/global/console/console-error-caret.gif (skin/console-error-caret.gif)
skin/classic/global/console/console-error-dash.gif (skin/console-error-dash.gif)
en-US.jar:
* locale/en-US/global/console.dtd (locale/console.dtd)
locale/en-US/global/console.properties (locale/console.properties)

View File

@@ -20,18 +20,31 @@
<!ENTITY console.title "JavaScript Console">
<!ENTITY menuBar.tooltip "Menu Bar">
<!ENTITY modeToolbar.tooltip "Mode Toolbar">
<!ENTITY entryToolbar.tooltip "Javascript Entry Toolbar">
<!ENTITY errFile.label "Source File:">
<!ENTITY errLine.label "Line:">
<!ENTITY errColumn.label "Column:">
<!ENTITY all.label "All">
<!ENTITY all.accesskey "A">
<!ENTITY errors.label "Errors">
<!ENTITY errors.accesskey "r">
<!ENTITY warnings.label "Warnings">
<!ENTITY warnings.accesskey "n">
<!ENTITY messages.label "Messages">
<!ENTITY messages.accesskey "M">
<!ENTITY clear.label "Clear">
<!ENTITY clear.accesskey "l">
<!ENTITY evaluate.label "Evaluate">
<!ENTITY sortFirst.label "First > Last Sort Order">
<!ENTITY sortFirst.accesskey "f">
<!ENTITY sortLast.label "Last > First Sort Order">
<!ENTITY sortLast.accesskey "l">
<!ENTITY toolbarsCmd.label "Show/Hide">
<!ENTITY toolbarsCmd.accesskey "w">
<!ENTITY toolbarMode.label "Mode">
<!ENTITY toolbarEval.label "JavaScript Entry">

View File

Before

Width:  |  Height:  |  Size: 55 B

After

Width:  |  Height:  |  Size: 55 B

View File

Before

Width:  |  Height:  |  Size: 48 B

After

Width:  |  Height:  |  Size: 48 B

View File

@@ -1,29 +1,43 @@
/*
* 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/
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* 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 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/
*
* The Original Code is Mozilla Communicator client code, released
* March 31, 1998.
* 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 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.
* 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 <hewitt@netscape.com>
*
*/
* 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 NPL, 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 NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
/* ===== console.css ====================================================
== Styles used by the JavaScript Console window.
======================================================================= */
== Styles used by the JavaScript Console window.
====================================================================== */
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
@@ -109,7 +123,7 @@ toolbarbutton[observes="Console:modeMessages"] {
/* ::::: toolbars ::::: */
#TextfieldEval {
#TextboxEval {
margin: 2px !important;
}

View File

@@ -0,0 +1,31 @@
#
# 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 Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk

View File

@@ -1,6 +1,5 @@
<?xml version="1.0"?> <!-- -*- Mode: HTML -*- -->
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?>
<?xml version="1.0"?>
# -*- Mode: HTML -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
@@ -34,12 +33,13 @@
# may use your version of this file under either the MPL or the
# GPL.
<?xul-overlay href="chrome://browser/content/viewSourceOverlay.xul"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/viewSourceOverlay.xul"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
%brandDTD;
<!ENTITY % sourceDTD SYSTEM "chrome://browser/locale/viewSource.dtd" >
<!ENTITY % sourceDTD SYSTEM "chrome://global/locale/viewSource.dtd" >
%sourceDTD;
]>
@@ -56,7 +56,7 @@
screenX="10" screenY="10"
persist="screenX screenY width height sizemode">
<script type="application/x-javascript" src="chrome://navigator/content/viewPartialSource.js"/>
<script type="application/x-javascript" src="chrome://global/content/viewPartialSource.js"/>
<commandset id="commands"/>
<keyset id="viewSourceKeys"/>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0"?> <!-- -*- Mode: HTML -*- -->
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?>
<?xml version="1.0"?>
# -*- Mode: HTML -*-
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
@@ -35,12 +34,13 @@
# may use your version of this file under either the MPL or the
# GPL.
<?xul-overlay href="chrome://browser/content/viewSourceOverlay.xul"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/viewSourceOverlay.xul"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
%brandDTD;
<!ENTITY % sourceDTD SYSTEM "chrome://browser/locale/viewSource.dtd" >
<!ENTITY % sourceDTD SYSTEM "chrome://global/locale/viewSource.dtd" >
%sourceDTD;
]>
@@ -57,6 +57,7 @@
screenX="10" screenY="10"
persist="screenX screenY width height sizemode">
<commandset id="commands"/>
<keyset id="viewSourceKeys"/>
<stringbundleset id="viewSource-stringbundleset"/>

View File

@@ -39,7 +39,7 @@
<!DOCTYPE overlay [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
%brandDTD;
<!ENTITY % sourceDTD SYSTEM "chrome://browser/locale/viewSource.dtd" >
<!ENTITY % sourceDTD SYSTEM "chrome://global/locale/viewsource/viewSource.dtd" >
%sourceDTD;
<!ENTITY % navigatorDTD SYSTEM "chrome://navigator/locale/navigator.dtd" >
%navigatorDTD;
@@ -54,7 +54,7 @@
<script type="application/x-javascript" src="chrome://global/content/nsDragAndDrop.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/contentAreaDD.js"/>
<script type="application/x-javascript" src="chrome://navigator/content/browser.js"/>
<script type="application/x-javascript" src="chrome://browser/content/viewsource.js"/>
<script type="application/x-javascript" src="chrome://global/content/viewSource.js"/>
<script type="application/x-javascript" src="chrome://communicator/content/findUtils.js"/>
<script type="application/x-javascript" src="chrome://browser/content/contentAreaUtils.js"/>

View File

@@ -0,0 +1,9 @@
toolkit.jar:
* content/global/viewSource.xul (content/viewSource.xul)
* content/global/viewSource.js (content/viewSource.js)
* content/global/viewPartialSource.xul (content/viewPartialSource.xul)
* content/global/viewPartialSource.js (content/viewPartialSource.js)
* content/global/viewSourceOverlay.xul (content/viewSourceOverlay.xul)
en-US.jar:
locale/en-US/global/viewSource.dtd (locale/viewSource.dtd)

View File

@@ -4,7 +4,6 @@ classic.jar:
+ skin/classic/global/checkbox.css
+ skin/classic/global/colorpicker.css
+ skin/classic/global/customizeToolbar.css
+ skin/classic/global/console.css
+ skin/classic/global/contents.rdf
+ skin/classic/global/dialog.css
+ skin/classic/global/filepicker.css
@@ -53,8 +52,6 @@ classic.jar:
+ skin/classic/global/arrow/arrow-up.gif (arrow/arrow-up.gif)
+ skin/classic/global/checkbox/cbox-check-dis.gif (checkbox/cbox-check-dis.gif)
+ skin/classic/global/checkbox/cbox-check.gif (checkbox/cbox-check.gif)
+ skin/classic/global/console/console-error-caret.gif (console/console-error-caret.gif)
+ skin/classic/global/console/console-error-dash.gif (console/console-error-dash.gif)
+ skin/classic/global/filepicker/folder-home.gif (filepicker/folder-home.gif)
+ skin/classic/global/filepicker/folder-new.gif (filepicker/folder-new.gif)
+ skin/classic/global/filepicker/folder-up.gif (filepicker/folder-up.gif)