deleted file mode 100644
--- a/extensions/inspector/Makefile.in
+++ /dev/null
@@ -1,92 +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 code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 2001
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Joe Hewitt <hewitt@netscape.com> (original author)
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-
-DEPTH = ../..
-topsrcdir = @top_srcdir@
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE = inspector
-DOMi_VERSION = 2.0.0
-
-DIRS = \
- base \
- resources \
- $(NULL)
-
-XPI_NAME = inspector
-USE_EXTENSION_MANIFEST = 1
-NO_JAR_AUTO_REG = 1
-INSTALL_EXTENSION_ID = inspector@mozilla.org
-XPI_PKGNAME = inspector-$(DOMi_VERSION)
-
-PREF_JS_EXPORTS = $(srcdir)/resources/content/prefs/inspector.js
-
-DIST_FILES = install.rdf
-
-XULAPP_DEFINES = \
- -DDOMi_VERSION=$(DOMi_VERSION) \
- $(NULL)
-
-include $(topsrcdir)/config/rules.mk
-
-export::
-ifdef MOZ_XUL_APP
- $(NSINSTALL) -D $(FINAL_TARGET)/platform/Linux/chrome/icons/default
- $(INSTALL) $(srcdir)/resources/content/res/winInspectorMain.xpm $(FINAL_TARGET)/platform/Linux/chrome/icons/default
- $(INSTALL) $(srcdir)/resources/content/res/winInspectorMain16.xpm $(FINAL_TARGET)/platform/Linux/chrome/icons/default
- $(NSINSTALL) -D $(FINAL_TARGET)/platform/WINNT/chrome/icons/default
- $(INSTALL) $(srcdir)/resources/content/res/winInspectorMain.ico $(FINAL_TARGET)/platform/WINNT/chrome/icons/default
- $(NSINSTALL) -D $(FINAL_TARGET)/platform/OS2/chrome/icons/default
- cp $(srcdir)/resources/content/res/winInspectorMainOS2.ico $(FINAL_TARGET)/platform/OS2/chrome/icons/default/winInspectorMain.ico
-else
- $(NSINSTALL) -D $(FINAL_TARGET)/chrome/icons/default
-ifeq ($(OS_ARCH),WINNT)
- $(INSTALL) $(srcdir)/resources/content/res/winInspectorMain.ico $(FINAL_TARGET)/chrome/icons/default
-endif
-ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
- $(INSTALL) $(srcdir)/resources/content/res/winInspectorMain.xpm $(FINAL_TARGET)/chrome/icons/default
- $(INSTALL) $(srcdir)/resources/content/res/winInspectorMain16.xpm $(FINAL_TARGET)/chrome/icons/default
-endif
-ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
- cp $(srcdir)/resources/content/res/winInspectorMainOS2.ico $(FINAL_TARGET)/chrome/icons/default/winInspectorMain.ico
-endif
-endif
deleted file mode 100644
--- a/extensions/inspector/base/Makefile.in
+++ /dev/null
@@ -1,50 +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 code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 2001
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Joe Hewitt <hewitt@netscape.com> (original author)
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-
-DEPTH=../../..
-topsrcdir=@top_srcdir@
-srcdir=@srcdir@
-VPATH=@srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-DIRS = js
-
-include $(topsrcdir)/config/rules.mk
-
deleted file mode 100644
--- a/extensions/inspector/base/js/Makefile.in
+++ /dev/null
@@ -1,52 +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 DOM Inspector.
-#
-# The Initial Developer of the Original Code is
-# Christopher A. Aillon <christopher@aillon.com>.
-# Portions created by the Initial Developer are Copyright (C) 2003
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# 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 *****
-
-
-DEPTH=../../../..
-topsrcdir=@top_srcdir@
-srcdir=@srcdir@
-VPATH=@srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-ifdef MOZ_XUL_APP
-XPI_NAME = inspector
-endif
-
-EXTRA_COMPONENTS=inspector-cmdline.js
-
-include $(topsrcdir)/config/rules.mk
-
deleted file mode 100644
--- a/extensions/inspector/base/js/inspector-cmdline.js
+++ /dev/null
@@ -1,179 +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 DOM Inspector.
- *
- * The Initial Developer of the Original Code is
- * Christopher A. Aillon <christopher@aillon.com>.
- * Portions created by the Initial Developer are Copyright (C) 2003
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Christopher A. Aillon <christopher@aillon.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 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 ***** */
-
-// NOTE: this file implements both the seamonkey nsICmdLineHandler and
-// the toolkit nsICommandLineHandler, using runtime detection.
-
-const INSPECTOR_CMDLINE_CONTRACTID = "@mozilla.org/commandlinehandler/general-startup;1?type=inspector";
-const INSPECTOR_CMDLINE_CLSID = Components.ID('{38293526-6b13-4d4f-a075-71939435b408}');
-const CATMAN_CONTRACTID = "@mozilla.org/categorymanager;1";
-const nsISupports = Components.interfaces.nsISupports;
-
-const nsICategoryManager = Components.interfaces.nsICategoryManager;
-const nsICmdLineHandler = Components.interfaces.nsICmdLineHandler;
-const nsICommandLine = Components.interfaces.nsICommandLine;
-const nsICommandLineHandler = Components.interfaces.nsICommandLineHandler;
-const nsIComponentRegistrar = Components.interfaces.nsIComponentRegistrar;
-const nsISupportsString = Components.interfaces.nsISupportsString;
-const nsIWindowWatcher = Components.interfaces.nsIWindowWatcher;
-
-function InspectorCmdLineHandler() {}
-InspectorCmdLineHandler.prototype =
-{
- /* nsISupports */
- QueryInterface : function handler_QI(iid) {
- if (iid.equals(nsISupports))
- return this;
-
- if (nsICmdLineHandler && iid.equals(nsICmdLineHandler))
- return this;
-
- if (nsICommandLineHandler && iid.equals(nsICommandLineHandler))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- /* nsICmdLineHandler */
- commandLineArgument : "-inspector",
- prefNameForStartup : "general.startup.inspector",
- chromeUrlForTask : "chrome://inspector/content/inspector.xul",
- helpText : "Start with the DOM Inspector.",
- handlesArgs : true,
- defaultArgs : "",
- openWindowWithArgs : true,
-
- /* nsICommandLineHandler */
- handle : function handler_handle(cmdLine) {
- var args = Components.classes["@mozilla.org/supports-string;1"]
- .createInstance(nsISupportsString);
- try {
- var uristr = cmdLine.handleFlagWithParam("inspector", false);
- if (uristr == null)
- return;
- try {
- args.data = cmdLine.resolveURI(uristr).spec;
- }
- catch (e) {
- return;
- }
- }
- catch (e) {
- cmdLine.handleFlag("inspector", true);
- }
-
- var wwatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
- .getService(nsIWindowWatcher);
- wwatch.openWindow(null, "chrome://inspector/content/", "_blank",
- "chrome,dialog=no,all", args);
- cmdLine.preventDefault = true;
- },
-
- helpInfo : " -inspector <url> Open the DOM inspector.\n"
-};
-
-
-var InspectorCmdLineFactory =
-{
- createInstance : function(outer, iid)
- {
- if (outer != null) {
- throw Components.results.NS_ERROR_NO_AGGREGATION;
- }
-
- return new InspectorCmdLineHandler().QueryInterface(iid);
- }
-};
-
-
-var InspectorCmdLineModule =
-{
- registerSelf : function(compMgr, fileSpec, location, type)
- {
- compMgr = compMgr.QueryInterface(nsIComponentRegistrar);
-
- compMgr.registerFactoryLocation(INSPECTOR_CMDLINE_CLSID,
- "DOM Inspector CommandLine Service",
- INSPECTOR_CMDLINE_CONTRACTID,
- fileSpec,
- location,
- type);
-
- var catman = Components.classes[CATMAN_CONTRACTID].getService(nsICategoryManager);
- catman.addCategoryEntry("command-line-argument-handlers",
- "inspector command line handler",
- INSPECTOR_CMDLINE_CONTRACTID, true, true);
- catman.addCategoryEntry("command-line-handler",
- "m-inspector",
- INSPECTOR_CMDLINE_CONTRACTID, true, true);
- },
-
- unregisterSelf : function(compMgr, fileSpec, location)
- {
- compMgr = compMgr.QueryInterface(nsIComponentRegistrar);
-
- compMgr.unregisterFactoryLocation(INSPECTOR_CMDLINE_CLSID, fileSpec);
- catman = Components.classes[CATMAN_CONTRACTID].getService(nsICategoryManager);
- catman.deleteCategoryEntry("command-line-argument-handlers",
- "inspector command line handler", true);
- catman.deleteCategoryEntry("command-line-handler",
- "m-inspector", true);
- },
-
- getClassObject : function(compMgr, cid, iid)
- {
- if (cid.equals(INSPECTOR_CMDLINE_CLSID)) {
- return InspectorCmdLineFactory;
- }
-
- if (!iid.equals(Components.interfaces.nsIFactory)) {
- throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
- }
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- canUnload : function(compMgr)
- {
- return true;
- }
-};
-
-
-function NSGetModule(compMgr, fileSpec) {
- return InspectorCmdLineModule;
-}
deleted file mode 100644
--- a/extensions/inspector/build/Makefile.in
+++ /dev/null
@@ -1,49 +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 code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 2001
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Joe Hewitt <hewitt@netscape.com> (original author)
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 2 or later (the "GPL"), or
-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-# in which case the provisions of the GPL or the LGPL are applicable instead
-# of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH=../../..
-topsrcdir=@top_srcdir@
-srcdir=@srcdir@
-VPATH=@srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-DIRS=src
-
-include $(topsrcdir)/config/rules.mk
-
deleted file mode 100644
--- a/extensions/inspector/build/install.js
+++ /dev/null
@@ -1,59 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-var gVersion = "0.5";
-
-var err = initInstall("DOM Inspector", "inspector", gVersion);
-logComment("initInstall: " + err);
-
-var fProgram = getFolder("Program");
-logComment("fProgram: " + fProgram);
-
-err = addDirectory("", gVersion, "bin", fProgram, "", true);
-logComment("addDirectory: " + err);
-
-registerChrome(CONTENT | DELAYED_CHROME, getFolder("Chrome","inspector.jar"), "content/inspector/");
-registerChrome(LOCALE | DELAYED_CHROME, getFolder("Chrome","inspector.jar"), "locale/en-US/inspector/");
-registerChrome(SKIN | DELAYED_CHROME, getFolder("Chrome","inspector.jar"), "skin/modern/inspector/");
-registerChrome(SKIN | DELAYED_CHROME, getFolder("Chrome","inspector.jar"), "skin/classic/inspector/");
-
-if (getLastError() == SUCCESS) {
- err = performInstall();
- logComment("performInstall: " + err);
-} else {
- cancelInstall(err);
-}
deleted file mode 100644
--- a/extensions/inspector/install.rdf
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0"?>
-
-#filter substitution
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
- <Description about="urn:mozilla:install-manifest">
- <em:id>inspector@mozilla.org</em:id>
- <em:version>@DOMi_VERSION@</em:version>
-
- <em:targetApplication>
- <!-- Firefox -->
- <Description>
- <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
- <em:minVersion>3.0a1</em:minVersion>
- <em:maxVersion>3.1a1pre</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <em:targetApplication>
- <!-- Thunderbird -->
- <Description>
- <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
- <em:minVersion>3.0a1pre</em:minVersion>
- <em:maxVersion>3.0.*</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <em:targetApplication>
- <!-- Sunbird -->
- <Description>
- <em:id>{718e30fb-e89b-41dd-9da7-e25a45638b28}</em:id>
- <em:minVersion>0.6a1</em:minVersion>
- <em:maxVersion>0.6a1</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <em:targetApplication>
- <!-- Suite -->
- <Description>
- <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
- <em:minVersion>2.0a</em:minVersion>
- <em:maxVersion>2.0.*</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <em:targetApplication>
- <!-- Toolkit -->
- <Description>
- <em:id>toolkit@mozilla.org</em:id>
- <em:minVersion>1.9a1</em:minVersion>
- <em:maxVersion>1.9</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <!-- front-end metadata -->
- <em:name>DOM Inspector</em:name>
- <em:description>Inspects the structure and properties of a window and its contents.</em:description>
- <em:creator>mozilla.org</em:creator>
- <em:homepageURL>http://www.mozilla.org/projects/inspector/</em:homepageURL>
-
- <em:localized>
- <Description>
- <em:locale>sk</em:locale>
- <em:name>DOM Inspector</em:name>
- <em:description>Umožnà preskúmať štruktúru a vlastnosti okna a jeho obsahu.</em:description>
- </Description>
- </em:localized>
-
- </Description>
-</RDF>
deleted file mode 100644
--- a/extensions/inspector/jar.mn
+++ /dev/null
@@ -1,171 +0,0 @@
-inspector.jar:
-% content inspector %content/inspector/ xpcnativewrappers=no
-% overlay chrome://inspector/content/inspector.xul chrome://communicator/content/utilityOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
-% overlay chrome://inspector/content/inspector.xul chrome://communicator/content/tasksOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
-% overlay chrome://communicator/content/tasksOverlay.xul chrome://inspector/content/tasksOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
-% overlay chrome://communicator/content/pref/preferences.xul chrome://inspector/content/prefs/prefsOverlay.xul application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
-% overlay chrome://browser/content/browser.xul chrome://inspector/content/tasksOverlay-ff.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-% overlay chrome://browser/content/macBrowserOverlay.xul chrome://inspector/content/tasksOverlay-ff.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-% overlay chrome://inspector/content/inspector.xul chrome://browser/content/baseMenuOverlay.xul application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-% overlay chrome://calendar/content/calendar.xul chrome://inspector/content/tasksOverlay-sb.xul application={718e30fb-e89b-41dd-9da7-e25a45638b28}
-% overlay chrome://messenger/content/mailWindowOverlay.xul chrome://inspector/content/tasksOverlay-tb.xul application={3550f703-e582-4d05-9a08-453d09bdfdc6}
-% overlay chrome://inspector/content/commandOverlay.xul chrome://inspector/content/viewers/dom/commandOverlay.xul
-% overlay chrome://inspector/content/commandOverlay.xul chrome://inspector/content/viewers/styleRules/commandOverlay.xul
-% overlay chrome://inspector/content/keysetOverlay.xul chrome://inspector/content/viewers/dom/keysetOverlay.xul
-% overlay chrome://inspector/content/popupOverlay.xul chrome://inspector/content/viewers/dom/popupOverlay.xul
-% overlay chrome://inspector/content/popupOverlay.xul chrome://inspector/content/viewers/styleRules/popupOverlay.xul
- content/inspector/inspector.xul (resources/content/inspector.xul)
- content/inspector/inspector.js (resources/content/inspector.js)
- content/inspector/inspector.css (resources/content/inspector.css)
- content/inspector/inspector.xml (resources/content/inspector.xml)
- content/inspector/sidebar.xul (resources/content/sidebar.xul)
- content/inspector/sidebar.js (resources/content/sidebar.js)
- content/inspector/object.xul (resources/content/object.xul)
- content/inspector/object.js (resources/content/object.js)
- content/inspector/inspectorOverlay.xul (resources/content/inspectorOverlay.xul)
- content/inspector/toolboxOverlay.xul (resources/content/toolboxOverlay.xul)
- content/inspector/commandOverlay.xul (resources/content/commandOverlay.xul)
- content/inspector/keysetOverlay.xul (resources/content/keysetOverlay.xul)
- content/inspector/popupOverlay.xul (resources/content/popupOverlay.xul)
- content/inspector/statusbarOverlay.xul (resources/content/statusbarOverlay.xul)
- content/inspector/tasksOverlay.xul (resources/content/tasksOverlay.xul)
- content/inspector/tasksOverlay-ff.xul (resources/content/tasksOverlay-ff.xul)
- content/inspector/tasksOverlay-sb.xul (resources/content/tasksOverlay-sb.xul)
- content/inspector/tasksOverlay-tb.xul (resources/content/tasksOverlay-tb.xul)
- content/inspector/editingOverlay.xul (resources/content/editingOverlay.xul)
- content/inspector/utilWindow.xul (resources/content/utilWindow.xul)
- content/inspector/Flasher.js (resources/content/Flasher.js)
- content/inspector/ViewerRegistry.js (resources/content/ViewerRegistry.js)
- content/inspector/utils.js (resources/content/utils.js)
- content/inspector/hooks.js (resources/content/hooks.js)
- content/inspector/util.dtd (resources/content/util.dtd)
- content/inspector/res/viewer-registry.rdf (resources/content/res/viewer-registry.rdf)
- content/inspector/extensions/titledSplitter.css (resources/content/extensions/titledSplitter.css)
- content/inspector/extensions/titledSplitter.xml (resources/content/extensions/titledSplitter.xml)
- content/inspector/extensions/treeEditable.css (resources/content/extensions/treeEditable.css)
- content/inspector/extensions/treeEditable.xml (resources/content/extensions/treeEditable.xml)
- content/inspector/extensions/multipanel.css (resources/content/extensions/multipanel.css)
- content/inspector/extensions/multipanel.xml (resources/content/extensions/multipanel.xml)
- content/inspector/extensions/wsm-colorpicker.js (resources/content/extensions/wsm-colorpicker.js)
- content/inspector/jsutil/rdf/RDFArray.js (resources/content/jsutil/rdf/RDFArray.js)
- content/inspector/jsutil/rdf/RDFU.js (resources/content/jsutil/rdf/RDFU.js)
- content/inspector/jsutil/system/DiskSearch.js (resources/content/jsutil/system/DiskSearch.js)
- content/inspector/jsutil/system/FilePickerUtils.js (resources/content/jsutil/system/FilePickerUtils.js)
- content/inspector/jsutil/system/PrefUtils.js (resources/content/jsutil/system/PrefUtils.js)
- content/inspector/jsutil/system/file.js (resources/content/jsutil/system/file.js)
- content/inspector/jsutil/xpcom/XPCU.js (resources/content/jsutil/xpcom/XPCU.js)
- content/inspector/jsutil/xul/DNDUtils.js (resources/content/jsutil/xul/DNDUtils.js)
- content/inspector/jsutil/xul/FrameExchange.js (resources/content/jsutil/xul/FrameExchange.js)
- content/inspector/jsutil/xul/inFormManager.js (resources/content/jsutil/xul/inFormManager.js)
- content/inspector/jsutil/xul/inTreeBuilder.js (resources/content/jsutil/xul/inTreeBuilder.js)
- content/inspector/jsutil/xul/inBaseTreeView.js (resources/content/jsutil/xul/inBaseTreeView.js)
- content/inspector/jsutil/events/ObserverManager.js (resources/content/jsutil/events/ObserverManager.js)
- content/inspector/prefs/pref-inspector.xul (resources/content/prefs/pref-inspector.xul)
- content/inspector/prefs/pref-inspector.js (resources/content/prefs/pref-inspector.js)
- content/inspector/prefs/prefsOverlay.xul (resources/content/prefs/prefsOverlay.xul)
- content/inspector/prefs/pref-sidebar.js (resources/content/prefs/pref-sidebar.js)
- content/inspector/tests/allskin.xul (resources/content/tests/allskin.xul)
- content/inspector/viewers/accessibleEvent/accessibleEvent.js (resources/content/viewers/accessibleEvent/accessibleEvent.js)
- content/inspector/viewers/accessibleEvent/accessibleEvent.xul (resources/content/viewers/accessibleEvent/accessibleEvent.xul)
- content/inspector/viewers/accessibleEvents/accessibleEvents.js (resources/content/viewers/accessibleEvents/accessibleEvents.js)
- content/inspector/viewers/accessibleEvents/accessibleEvents.xul (resources/content/viewers/accessibleEvents/accessibleEvents.xul)
- content/inspector/viewers/accessibleObject/accessibleObject.js (resources/content/viewers/accessibleObject/accessibleObject.js)
- content/inspector/viewers/accessibleObject/accessibleObject.xul (resources/content/viewers/accessibleObject/accessibleObject.xul)
- content/inspector/viewers/accessibleProps/accessibleProps.js (resources/content/viewers/accessibleProps/accessibleProps.js)
- content/inspector/viewers/accessibleProps/accessibleProps.xul (resources/content/viewers/accessibleProps/accessibleProps.xul)
- content/inspector/viewers/accessibleRelations/accessibleRelations.js (resources/content/viewers/accessibleRelations/accessibleRelations.js)
- content/inspector/viewers/accessibleRelations/accessibleRelations.xul (resources/content/viewers/accessibleRelations/accessibleRelations.xul)
- content/inspector/viewers/accessibleTree/accessibleTree.js (resources/content/viewers/accessibleTree/accessibleTree.js)
- content/inspector/viewers/accessibleTree/accessibleTree.xul (resources/content/viewers/accessibleTree/accessibleTree.xul)
- content/inspector/viewers/accessibleTree/evalJSDialog.js (resources/content/viewers/accessibleTree/evalJSDialog.js)
- content/inspector/viewers/accessibleTree/evalJSDialog.xul (resources/content/viewers/accessibleTree/evalJSDialog.xul)
- content/inspector/viewers/computedStyle/computedStyle.js (resources/content/viewers/computedStyle/computedStyle.js)
- content/inspector/viewers/computedStyle/computedStyle.xul (resources/content/viewers/computedStyle/computedStyle.xul)
- content/inspector/viewers/dom/FindDialog.js (resources/content/viewers/dom/FindDialog.js)
- content/inspector/viewers/dom/columnsDialog.js (resources/content/viewers/dom/columnsDialog.js)
- content/inspector/viewers/dom/columnsDialog.xul (resources/content/viewers/dom/columnsDialog.xul)
- content/inspector/viewers/dom/commandOverlay.xul (resources/content/viewers/dom/commandOverlay.xul)
- content/inspector/viewers/dom/insertDialog.js (resources/content/viewers/dom/insertDialog.js)
- content/inspector/viewers/dom/insertDialog.xul (resources/content/viewers/dom/insertDialog.xul)
- content/inspector/viewers/dom/findDialog.xul (resources/content/viewers/dom/findDialog.xul)
- content/inspector/viewers/dom/keysetOverlay.xul (resources/content/viewers/dom/keysetOverlay.xul)
- content/inspector/viewers/dom/popupOverlay.xul (resources/content/viewers/dom/popupOverlay.xul)
- content/inspector/viewers/dom/dom.xul (resources/content/viewers/dom/dom.xul)
- content/inspector/viewers/dom/dom.js (resources/content/viewers/dom/dom.js)
- content/inspector/viewers/dom/pseudoClassDialog.js (resources/content/viewers/dom/pseudoClassDialog.js)
- content/inspector/viewers/dom/pseudoClassDialog.xul (resources/content/viewers/dom/pseudoClassDialog.xul)
- content/inspector/viewers/boxModel/boxModel.js (resources/content/viewers/boxModel/boxModel.js)
- content/inspector/viewers/boxModel/boxModel.xul (resources/content/viewers/boxModel/boxModel.xul)
- content/inspector/viewers/jsObject/jsObject.js (resources/content/viewers/jsObject/jsObject.js)
- content/inspector/viewers/jsObject/jsObject.xul (resources/content/viewers/jsObject/jsObject.xul)
- content/inspector/viewers/jsObject/jsObjectViewer.js (resources/content/viewers/jsObject/jsObjectViewer.js)
- content/inspector/viewers/jsObject/jsObjectViewer.xul (resources/content/viewers/jsObject/jsObjectViewer.xul)
- content/inspector/viewers/jsObject/evalExprDialog.js (resources/content/viewers/jsObject/evalExprDialog.js)
- content/inspector/viewers/jsObject/evalExprDialog.xul (resources/content/viewers/jsObject/evalExprDialog.xul)
- content/inspector/viewers/domNode/domNode.js (resources/content/viewers/domNode/domNode.js)
- content/inspector/viewers/domNode/domNode.xul (resources/content/viewers/domNode/domNode.xul)
- content/inspector/viewers/domNode/domNodeDialog.js (resources/content/viewers/domNode/domNodeDialog.js)
- content/inspector/viewers/domNode/domNodeDialog.xul (resources/content/viewers/domNode/domNodeDialog.xul)
- content/inspector/viewers/styleRules/commandOverlay.xul (resources/content/viewers/styleRules/commandOverlay.xul)
- content/inspector/viewers/styleRules/keysetOverlay.xul (resources/content/viewers/styleRules/keysetOverlay.xul)
- content/inspector/viewers/styleRules/popupOverlay.xul (resources/content/viewers/styleRules/popupOverlay.xul)
- content/inspector/viewers/styleRules/styleRules.js (resources/content/viewers/styleRules/styleRules.js)
- content/inspector/viewers/styleRules/styleRules.xul (resources/content/viewers/styleRules/styleRules.xul)
- content/inspector/viewers/stylesheets/stylesheets.js (resources/content/viewers/stylesheets/stylesheets.js)
- content/inspector/viewers/stylesheets/stylesheets.xul (resources/content/viewers/stylesheets/stylesheets.xul)
- content/inspector/viewers/xblBindings/xblBindings.js (resources/content/viewers/xblBindings/xblBindings.js)
- content/inspector/viewers/xblBindings/xblBindings.xul (resources/content/viewers/xblBindings/xblBindings.xul)
-% skin inspector classic/1.0 %skin/classic/inspector/
- skin/classic/inspector/btnFind.gif (resources/skin/classic/btnFind.gif)
- skin/classic/inspector/btnFind-dis.gif (resources/skin/classic/btnFind-dis.gif)
- skin/classic/inspector/btnSelecting.gif (resources/skin/classic/btnSelecting.gif)
- skin/classic/inspector/btnSelecting-act.gif (resources/skin/classic/btnSelecting-act.gif)
- skin/classic/inspector/btnSelecting-dis.gif (resources/skin/classic/btnSelecting-dis.gif)
- skin/classic/inspector/ImageSearchItem.gif (resources/skin/classic/ImageSearchItem.gif)
- skin/classic/inspector/iconImportant.gif (resources/skin/classic/iconImportant.gif)
- skin/classic/inspector/iconViewerList.gif (resources/skin/classic/iconViewerList.gif)
- skin/classic/inspector/iconViewerMenu-dis.gif (resources/skin/classic/iconViewerMenu-dis.gif)
- skin/classic/inspector/iconViewerMenu.gif (resources/skin/classic/iconViewerMenu.gif)
- skin/classic/inspector/inspector.css (resources/skin/classic/inspector.css)
- skin/classic/inspector/inspectorWindow.css (resources/skin/classic/inspectorWindow.css)
- skin/classic/inspector/titledSplitter.css (resources/skin/classic/titledSplitter.css)
- skin/classic/inspector/titledsplitter-close.gif (resources/skin/classic/titledsplitter-close.gif)
- skin/classic/inspector/treeEditable.css (resources/skin/classic/treeEditable.css)
- skin/classic/inspector/panelset.css (resources/skin/classic/panelset.css)
- skin/classic/inspector/sidebar.css (resources/skin/classic/sidebar.css)
- skin/classic/inspector/multipanel.css (resources/skin/classic/multipanel.css)
- skin/classic/inspector/iconViewerList-dis.gif (resources/skin/classic/iconViewerList-dis.gif)
- skin/classic/inspector/viewers/boxModel/boxModel.css (resources/skin/classic/viewers/boxModel/boxModel.css)
- skin/classic/inspector/viewers/dom/columnsDialog.css (resources/skin/classic/viewers/dom/columnsDialog.css)
- skin/classic/inspector/viewers/dom/dom.css (resources/skin/classic/viewers/dom/dom.css)
- skin/classic/inspector/viewers/dom/findDialog.css (resources/skin/classic/viewers/dom/findDialog.css)
- skin/classic/inspector/viewers/domNode/domNode.css (resources/skin/classic/viewers/domNode/domNode.css)
- skin/classic/inspector/viewers/styleRules/styleRules.css (resources/skin/classic/viewers/styleRules/styleRules.css)
- skin/classic/inspector/viewers/xblBindings/xblBindings.css (resources/skin/classic/viewers/xblBindings/xblBindings.css)
-% skin inspector modern/1.0 %skin/modern/inspector/
- skin/modern/inspector/btnFind.gif (resources/skin/modern/btnFind.gif)
- skin/modern/inspector/btnFind-dis.gif (resources/skin/modern/btnFind-dis.gif)
- skin/modern/inspector/btnSelecting.gif (resources/skin/modern/btnSelecting.gif)
- skin/modern/inspector/btnSelecting-act.gif (resources/skin/modern/btnSelecting-act.gif)
- skin/modern/inspector/btnSelecting-dis.gif (resources/skin/modern/btnSelecting-dis.gif)
- skin/modern/inspector/ImageSearchItem.gif (resources/skin/modern/ImageSearchItem.gif)
- skin/modern/inspector/iconImportant.gif (resources/skin/modern/iconImportant.gif)
- skin/modern/inspector/iconViewerMenu-dis.gif (resources/skin/modern/iconViewerMenu-dis.gif)
- skin/modern/inspector/inspector.css (resources/skin/modern/inspector.css)
- skin/modern/inspector/inspectorWindow.css (resources/skin/modern/inspectorWindow.css)
- skin/modern/inspector/titledSplitter.css (resources/skin/modern/titledSplitter.css)
- skin/modern/inspector/titledsplitter-close.gif (resources/skin/modern/titledsplitter-close.gif)
- skin/modern/inspector/treeEditable.css (resources/skin/modern/treeEditable.css)
- skin/modern/inspector/panelset.css (resources/skin/modern/panelset.css)
- skin/modern/inspector/sidebar.css (resources/skin/modern/sidebar.css)
- skin/modern/inspector/multipanel.css (resources/skin/modern/multipanel.css)
- skin/modern/inspector/iconViewerMenu.gif (resources/skin/modern/iconViewerMenu.gif)
- skin/modern/inspector/iconViewerList.gif (resources/skin/modern/iconViewerList.gif)
- skin/modern/inspector/iconViewerList-dis.gif (resources/skin/modern/iconViewerList-dis.gif)
- skin/modern/inspector/viewers/boxModel/boxModel.css (resources/skin/modern/viewers/boxModel/boxModel.css)
- skin/modern/inspector/viewers/dom/columnsDialog.css (resources/skin/modern/viewers/dom/columnsDialog.css)
- skin/modern/inspector/viewers/dom/dom.css (resources/skin/modern/viewers/dom/dom.css)
- skin/modern/inspector/viewers/dom/findDialog.css (resources/skin/modern/viewers/dom/findDialog.css)
- skin/modern/inspector/viewers/domNode/domNode.css (resources/skin/modern/viewers/domNode/domNode.css)
- skin/modern/inspector/viewers/styleRules/styleRules.css (resources/skin/modern/viewers/styleRules/styleRules.css)
- skin/modern/inspector/viewers/xblBindings/xblBindings.css (resources/skin/modern/viewers/xblBindings/xblBindings.css)
deleted file mode 100755
--- a/extensions/inspector/makefiles.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#! /bin/sh
-# ***** 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 Build System
-#
-# The Initial Developer of the Original Code is
-# Ben Turner <mozilla@songbirdnest.com>
-#
-# Portions created by the Initial Developer are Copyright (C) 2007
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# 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 *****
-
-add_makefiles "
- extensions/inspector/Makefile
- extensions/inspector/base/Makefile
- extensions/inspector/build/Makefile
- extensions/inspector/resources/Makefile
- extensions/inspector/resources/locale/Makefile
-"
deleted file mode 100644
--- a/extensions/inspector/resources/Makefile.in
+++ /dev/null
@@ -1,68 +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 code.
-#
-# The Initial Developer of the Original Code is
-# Benjamin Smedberg <benjamin@smedbergs.us>
-#
-# Portions created by the Initial Developer are Copyright (C) 2005
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#
-# 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 *****
-
-
-DEPTH=../../..
-topsrcdir=@top_srcdir@
-srcdir=@srcdir@
-VPATH=@srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-ALL_LOCALES = \
- en-US \
- $(NULL)
-
-include $(topsrcdir)/config/config.mk
-
-SUBMAKEFILES += locale/Makefile
-
-include $(topsrcdir)/config/rules.mk
-
-libs realchrome:: locale/Makefile
- @$(EXIT_ON_ERROR) \
- for locale in $(ALL_LOCALES); do \
- $(MAKE) -C locale AB_CD=$$locale; \
- done
-
-install::
- @$(EXIT_ON_ERROR) \
- for locale in $(ALL_LOCALES); do \
- $(MAKE) -C locale AB_CD=$$locale install; \
- done
-
deleted file mode 100644
--- a/extensions/inspector/resources/content/Flasher.js
+++ /dev/null
@@ -1,167 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/***************************************************************
-* Flasher ---------------------------------------------------
-* Object for controlling a timed flashing animation which
-* paints a border around an element.
-* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-* REQUIRED IMPORTS:
-****************************************************************/
-
-//////////// global variables /////////////////////
-
-var gFlasherRegistry = [];
-
-//////////// global constants ////////////////////
-
-////////////////////////////////////////////////////////////////////////////
-//// class Flasher
-
-function Flasher(aColor, aThickness, aDuration, aSpeed, aInvert)
-{
- this.mShell = XPCU.getService("@mozilla.org/inspector/flasher;1", "inIFlasher");
- this.mShell.color = aColor;
- this.mShell.thickness = aThickness;
- this.mShell.invert = aInvert;
- this.duration = aDuration;
- this.mSpeed = aSpeed;
-
- this.register();
-}
-
-Flasher.prototype =
-{
- ////////////////////////////////////////////////////////////////////////////
- //// Initialization
-
- mFlashTimeout: null,
- mElement:null,
- mRegistryId: null,
- mFlashes: 0,
- mStartTime: 0,
- mDuration: 0,
- mSpeed: 0,
-
- ////////////////////////////////////////////////////////////////////////////
- //// Properties
-
- get flashing() { return this.mFlashTimeout != null; },
-
- get element() { return this.mElement; },
- set element(val)
- {
- if (val && val.nodeType == Node.ELEMENT_NODE) {
- this.mElement = val;
- this.mShell.scrollElementIntoView(val);
- } else
- throw "Invalid node type.";
- },
-
- get color() { return this.mShell.color; },
- set color(aVal) { return this.mShell.color = aVal; },
-
- get thickness() { return this.mShell.thickness; },
- set thickness(aVal) { this.mShell.thickness = aVal; },
-
- get duration() { return this.mDuration; },
- set duration(aVal) { this.mDuration = aVal; },
-
- get speed() { return this.mSpeed; },
- set speed(aVal) { this.mSpeed = aVal; },
-
- get invert() { return this.mShell.invert; },
- set invert(aVal) { this.mShell.invert = aVal; },
-
- // :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- // :::::::::::::::::::: Methods ::::::::::::::::::::::::::::
- // :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-
- register: function()
- {
- var length = gFlasherRegistry.length;
- gFlasherRegistry[length] = this;
- this.mRegistryId = length;
- },
-
- start: function(aDuration, aSpeed, aHold)
- {
- this.mUDuration = aDuration ? aDuration*1000 : this.mDuration;
- this.mUSpeed = aSpeed ? aSpeed : this.mSpeed
- this.mHold = aHold;
- this.mFlashes = 0;
- this.mStartTime = new Date();
- this.doFlash();
- },
-
- doFlash: function()
- {
- if (this.mHold || this.mFlashes%2) {
- this.paintOn();
- } else {
- this.paintOff();
- }
- this.mFlashes++;
-
- if (this.mUDuration < 0 || new Date() - this.mStartTime < this.mUDuration) {
- this.mFlashTimeout = window.setTimeout("gFlasherRegistry["+this.mRegistryId+"].doFlash()", this.mUSpeed);
- } else {
- this.stop();
- }
-},
-
- stop: function()
- {
- if (this.flashing) {
- window.clearTimeout(this.mFlashTimeout);
- this.mFlashTimeout = null;
- this.paintOff();
- }
- },
-
- paintOn: function()
- {
- this.mShell.drawElementOutline(this.mElement);
- },
-
- paintOff: function()
- {
- this.mShell.repaintElement(this.mElement);
- }
-
-};
-
deleted file mode 100644
--- a/extensions/inspector/resources/content/ViewerRegistry.js
+++ /dev/null
@@ -1,265 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/***************************************************************
-* ViewerRegistry -----------------------------------------------
-* The central registry where information about all installed
-* viewers is kept.
-* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-* REQUIRED IMPORTS:
-* chrome://inspector/content/jsutil/xpcom/XPCU.js
-* chrome://inspector/content/jsutil/rdf/RDFU.js
-****************************************************************/
-
-//////////// global variables /////////////////////
-
-//////////// global constants ////////////////////
-
-const kViewerURLPrefix = "chrome://inspector/content/viewers/";
-const kViewerRegURL = "chrome://inspector/content/res/viewer-registry.rdf";
-
-////////////////////////////////////////////////////////////////////////////
-//// class ViewerRegistry
-
-function ViewerRegistry() // implements inIViewerRegistry
-{
- this.mViewerHash = {};
-}
-
-ViewerRegistry.prototype =
-{
- ////////////////////////////////////////////////////////////////////////////
- //// interface inIViewerRegistry
-
- // not yet formalized...
-
- ////////////////////////////////////////////////////////////////////////////
- //// Initialization
-
- mDS: null,
- mObserver: null,
- mViewerDS: null,
- mViewerHash: null,
- mFilters: null,
-
- get url() { return this.mURL; },
-
- //// Loading Methods
-
- load: function(aURL, aObserver)
- {
- this.mURL = aURL;
- this.mObserver = aObserver;
- RDFU.loadDataSource(aURL, new ViewerRegistryLoadObserver(this));
- },
-
- onError: function(aStatus, aErrorMsg)
- {
- this.mObserver.onViewerRegistryLoadError(aStatus, aErrorMsg);
- },
-
- onLoad: function(aDS)
- {
- this.mDS = aDS;
- this.prepareRegistry();
- this.mObserver.onViewerRegistryLoad();
- },
-
- prepareRegistry: function prepareRegistry()
- {
- this.mViewerDS = RDFArray.fromContainer(this.mDS, "inspector:viewers", kInspectorNSURI);
-
- // create and cache the filter functions
- var js, fn;
- this.mFilters = [];
- for (var i = 0; i < this.mViewerDS.length; ++i) {
- js = this.getEntryProperty(i, "filter");
- try {
- fn = new Function("object", "linkedViewer", js);
- } catch (ex) {
- fn = new Function("return false");
- debug("### ERROR - Syntax error in filter for viewer \"" + this.getEntryProperty(i, "description") + "\"\n");
- }
- this.mFilters.push(fn);
- }
- },
-
- ///////////////////////////////////////////////////////////////////////////
- // Returns the absolute url where the xul file for a viewer can be found.
- //
- // @param long aIndex - the index of the entry representing the viewer
- // @return wstring - the fully cannonized url
- ///////////////////////////////////////////////////////////////////////////
- getEntryURL: function(aIndex)
- {
- var uid = this.getEntryProperty(aIndex, "uid");
- return kViewerURLPrefix + uid + "/" + uid + ".xul";
- },
-
- //// Lookup Methods
-
- /**
- * Searches the viewer registry for all viewers that can view a particular
- * object.
- *
- * @param Object aObject - the object being searched against
- * @param String aPanelId - the id of the panel requesting viewers
- * @param Object aLinkedViewer - the view object of linked panel
- *
- * @return nsIRDFResource[] - array of entries in the viewer registry
- */
- findViewersForObject: function findViewersForObject(aObject, aPanelId,
- aLinkedViewer)
- {
- // check each entry in the registry
- var len = this.mViewerDS.length;
- var entry;
- var urls = [];
- for (var i = 0; i < len; ++i) {
- if (this.getEntryProperty(i, "panels").indexOf(aPanelId) == -1) {
- continue;
- }
- if (this.objectMatchesEntry(aObject, aLinkedViewer, i)) {
- if (this.getEntryProperty(i, "important")) {
- urls.unshift(i);
- } else {
- urls.push(i);
- }
- }
- }
-
- return urls;
- },
-
- /**
- * Determines if an object is eligible to be viewed by a particular viewer.
- *
- * @param Object aObject - the object being checked for eligibility
- * @param Object aLinkedViewer - the view object of linked panel
- * @param long aIndex - the index of the entry
- *
- * @return boolean - true if object can be viewed
- */
- objectMatchesEntry: function objectMatchesEntry(aObject, aLinkedViewer,
- aIndex)
- {
- return this.mFilters[aIndex](aObject, aLinkedViewer);
- },
-
- ///////////////////////////////////////////////////////////////////////////
- // Notifies the registry that a viewer has been instantiated, and that
- // it corresponds to a particular entry in the viewer registry.
- //
- // @param
- ///////////////////////////////////////////////////////////////////////////
- cacheViewer: function(aViewer, aIndex)
- {
- var uid = this.getEntryProperty(aIndex, "uid");
- this.mViewerHash[uid] = { viewer: aViewer, entry: aIndex };
- },
-
- uncacheViewer: function(aViewer)
- {
- delete this.mViewerHash[aViewer.uid];
- },
-
- // for previously loaded viewers only
- getViewerByUID: function(aUID)
- {
- return this.mViewerHash[aUID].viewer;
- },
-
- // for previously loaded viewers only
- getEntryForViewer: function(aViewer)
- {
- return this.mViewerHash[aViewer.uid].entry;
- },
-
- // for previously loaded viewers only
- getEntryByUID: function(aUID)
- {
- return this.mViewerHash[aUID].aIndex;
- },
-
- getEntryProperty: function(aIndex, aProp)
- {
- return this.mViewerDS.get(aIndex, aProp);
- },
-
- getEntryCount: function()
- {
- return this.mViewerDS.length;
- },
-
- ////////////////////////////////////////////////////////////////////////////
- //// Viewer Registration
-
- addNewEntry: function(aUID, aDescription, aFilter)
- {
- },
-
- removeEntry: function(aIndex)
- {
- },
-
- saveRegistry: function()
- {
- }
-
-};
-
-////////////////////////////////////////////////////////////////////////////
-//// Listener Objects
-
-function ViewerRegistryLoadObserver(aTarget)
-{
- this.mTarget = aTarget;
-}
-
-ViewerRegistryLoadObserver.prototype = {
- mTarget: null,
-
- onError: function(aStatus, aErrorMsg)
- {
- this.mTarget.onError(aStatus, aErrorMsg);
- },
-
- onDataSourceReady: function(aDS)
- {
- this.mTarget.onLoad(aDS);
- }
-};
deleted file mode 100644
--- a/extensions/inspector/resources/content/browserOverlay.xul
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE overlay SYSTEM "chrome://inspector/locale/tasksOverlay.dtd" >
-
-<overlay id="ovBrowser"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/x-javascript" src="chrome://inspector/content/hooks.js"/>
-
- <script type="application/x-javascript"><![CDATA[
-
- window.addEventListener("load", inspectorNavOnLoad, true);
-
- function inspectorNavOnLoad()
- {
- var prefService = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefService);
- var pref = prefService.getBranch(null);
-
- var enabled = pref.getBoolPref("inspector.hooks.navigator");
- if (!enabled) {
- document.getElementById("context-inspect").setAttribute("hidden", "true");
- document.getElementById("menu_inspectPage").setAttribute("hidden", "true");
- } else {
- var popup = document.getElementById("contentAreaContextMenu");
- popup.addEventListener("popupshowing", inspectorContextCreate, false);
- }
- }
-
- function inspectorContextCreate()
- {
- var mi = document.getElementById("context-inspect");
- mi.setAttribute("label", "Inspect <"+inspectorGetContextNode().localName+">");
- }
-
- function inspectPopupNode()
- {
- inspectDOMNode(inspectorGetContextNode());
- }
-
- function inspectorGetContextNode()
- {
- var n = document.popupNode;
- while (n && n.nodeType != Node.ELEMENT_NODE)
- n = n.parentNode;
-
- return n;
- }
-
- ]]></script>
-
- <popup id="contentAreaContextMenu">
- <menuitem id="context-inspect"
- insertbefore="context-sep-view"
- oncommand="inspectPopupNode();"/>
- </popup>
-
- <menupopup id="menu_FilePopup">
- <menuitem id="menu_inspectPage" label="&inspectPageTaskCmd.label;" command="Tasks:InspectPage"
- accesskey="&inspectPageTaskCmd.accesskey;" key="key_inspectPage"
- insertbefore="menu_sendPage"/>
- </menupopup>
-
-</overlay>
deleted file mode 100644
--- a/extensions/inspector/resources/content/commandOverlay.xul
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE overlay [
- <!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/inspector.dtd"> %dtd1;
- <!ENTITY % dtd2 SYSTEM "chrome://inspector/content/util.dtd"> %dtd2;
-]>
-
-<overlay id="ovCommandsMain"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <commandset id="cmdsGlobalCommands">
-
- <command id="cmdGotoURL"
- ontextentered="inspector.gotoTypedURL();"
- oncommand="inspector.gotoTypedURL()"/>
-
- <command id="cmdShowOpenURLDialog" oncommand="inspector.showOpenURLDialog()"/>
- <command id="cmdSave" oncommand="inspector.save();"/>
- <command id="cmdClose" oncommand="inspector.exit();"/>
-
- <command id="cmdShowPrefsDialog" oncommand="inspector.showPrefsDialog()"/>
-
- <command id="cmdToggleBrowser" oncommand="inspector.toggleBrowser(true)"/>
-
- <command id="cmdEditUndo" global="true" oncommand="inspector.doViewerCommand('cmdEditUndo');"/>
- <command id="cmdEditRedo" global="true" oncommand="inspector.doViewerCommand('cmdEditRedo');"/>
- <command id="cmdEditCut" global="true" oncommand="inspector.doViewerCommand('cmdEditCut');"/>
- <command id="cmdEditCopy" global="true" oncommand="inspector.doViewerCommand('cmdEditCopy');"/>
- <command id="cmdEditPaste" global="true" oncommand="inspector.doViewerCommand('cmdEditPaste');"/>
- <command id="cmdEditInsert" global="true" oncommand="inspector.doViewerCommand('cmdEditInsert');"/>
- <command id="cmdEditEdit" global="true" oncommand="inspector.doViewerCommand('cmdEditEdit');"/>
- <command id="cmdEditDelete" global="true" oncommand="inspector.doViewerCommand('cmdEditDelete');"/>
-
- <!--
- <command id="cmdRunSearch" oncommand="inspector.runSearch()"/>
- <command id="cmdToggleSearch" oncommand="inspector.toggleSearch(true)"/>
- <command id="cmdViewSearchItem" oncommand="inspector.viewSearchItem()"/>
- <command id="cmdEditSearchItem" oncommand="inspector.editSearchItem()"/>
- <command id="cmdCopySearchItemLine" oncommand="inspector.copySearchItemLine()"/>
- <command id="cmdCopySearchItemAll" oncommand="inspector.copySearchItemAll()"/>
- <command id="cmdSaveSearchItemText" oncommand="inspector.saveSearchItemText()"/>
- <command id="cmdClearSearch" oncommand="inspector.clearSearchResults()"/>
- -->
- </commandset>
-
-</overlay>
deleted file mode 100644
--- a/extensions/inspector/resources/content/editingOverlay.xul
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE overlay SYSTEM "chrome://inspector/locale/editing.dtd">
-
-<overlay id="ovEditing"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <commandset id="cmdsEditing">
- <command id="cmdEditUndo" oncommand="viewer.pane.panelset.undo();"/>
- <command id="cmdEditRedo" oncommand="viewer.pane.panelset.redo();"/>
- <command id="cmdEditCut" oncommand="viewer.pane.panelset.execCommand('cmdEditCut');"/>
- <command id="cmdEditCopy" oncommand="viewer.pane.panelset.execCommand('cmdEditCopy');"/>
- <command id="cmdEditPaste" oncommand="viewer.pane.panelset.execCommand('cmdEditPaste');"/>
- <command id="cmdEditInsert" oncommand="viewer.pane.panelset.execCommand('cmdEditInsert');"/>
- <command id="cmdEditEdit" oncommand="viewer.pane.panelset.execCommand('cmdEditEdit');"/>
- <command id="cmdEditDelete" oncommand="viewer.pane.panelset.execCommand('cmdEditDelete');"/>
- </commandset>
-
- <keyset id="ksGlobalKeyset">
- <key id="keyEditUndo" key="z" modifiers="accel" command="cmdEditUndo"/>
- <key id="keyEditRedo" key="y" modifiers="accel" command="cmdEditRedo"/>
- <key id="keyEditRedo2" key="z" modifiers="accel,shift" command="cmdEditRedo"/>
- <key id="keyEditCut" key="x" modifiers="accel" command="cmdEditCut"/>
- <key id="keyEditCopy" key="c" modifiers="accel" command="cmdEditCopy"/>
- <key id="keyEditPaste" key="v" modifiers="accel" command="cmdEditPaste"/>
- <key id="keyEditDelete" keycode="VK_DELETE" command="cmdEditDelete"/>
- <key id="keyEditDeleteMac" keycode="VK_BACK" command="cmdEditDelete"/>
- </keyset>
-
- <menuitem id="mnEditUndo" label="&mnEditUndo.label;" command="cmdEditUndo"
- accesskey="&mnEditUndo.accesskey;" key="keyEditUndo"/>
- <menuitem id="mnEditRedo" label="&mnEditRedo.label;" command="cmdEditRedo"
- accesskey="&mnEditRedo.accesskey;" key="keyEditRedo"/>
- <menuitem id="mnEditCut" label="&mnEditCut.label;" command="cmdEditCut"
- accesskey="&mnEditCut.accesskey;" key="keyEditCut"/>
- <menuitem id="mnEditCopy" label="&mnEditCopy.label;" command="cmdEditCopy"
- accesskey="&mnEditCopy.accesskey;" key="keyEditCopy"/>
- <menuitem id="mnEditPaste" label="&mnEditPaste.label;" command="cmdEditPaste"
- accesskey="&mnEditPaste.accesskey;" key="keyEditPaste"/>
- <menuitem id="mnEditInsert" label="&mnEditInsert.label;" command="cmdEditInsert"
- accesskey="&mnEditInsert.accesskey;"/>
- <menuitem id="mnEditEdit" label="&mnEditEdit.label;" command="cmdEditEdit"
- accesskey="&mnEditEdit.accesskey;"/>
- <menuitem id="mnEditDelete" label="&mnEditDelete.label;" command="cmdEditDelete"
- accesskey="&mnEditDelete.accesskey;" key="keyEditDelete"/>
-
-</overlay>
deleted file mode 100644
--- a/extensions/inspector/resources/content/extensions/multipanel.css
+++ /dev/null
@@ -1,50 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-
-multipanelset {
- -moz-binding: url("chrome://inspector/content/extensions/multipanel.xml#multipanelset");
- display: -moz-box;
- -moz-box-orient: vertical;
-}
-
-multipanel {
- -moz-binding: url("chrome://inspector/content/extensions/multipanel.xml#multipanel");
- display: -moz-box;
- -moz-box-orient: vertical;
-}
deleted file mode 100644
--- a/extensions/inspector/resources/content/extensions/multipanel.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0"?>
-
-<bindings id="bdsMultipanel"
- xmlns="http://www.mozilla.org/xbl"
- xmlns:xbl="http://www.mozilla.org/xbl"
- xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <binding id="multipanelset">
- <content>
- <xul:vbox class="multipanelset-ibox" flex="1">
- <children/>
- </xul:vbox>
- </content>
-
- <implementation>
- </implementation>
-
- <resources>
- <stylesheet src="chrome://inspector/skin/multipanel.css"/>
- </resources>
- </binding>
-
- <binding id="multipanel">
- <content>
- <xul:box class="multipanel-label-box" onclick="this.parentNode.toggleOpen()">
- <xul:box class="multipanel-label-box-2" flex="1">
- <xul:label class="multipanel-title" xbl:inherits="value=label"/>
- </xul:box>
- </xul:box>
- <xul:box anonid="content-box" class="multipanel-content-box" flex="1">
- <children/>
- </xul:box>
- </content>
-
- <implementation>
- <constructor><![CDATA[
- this.mContentBox = document.getAnonymousElementByAttribute(this, "anonid", "content-box");
- this.mOnOpen = this.hasAttribute("onopen") ? new Function(this.getAttribute("onopen")) : null;
- this.open = this.getAttribute("open") == "true";
- ]]></constructor>
-
- <property name="open" onget="return this.getAttribute('open') == 'true';">
- <setter><![CDATA[
- this.setAttribute("open", val);
- if (val) {
- this.mContentBox.removeAttribute("collapsed");
- this.setAttribute("flex", "1");
- } else {
- this.mContentBox.setAttribute("collapsed", "true");
- this.removeAttribute("flex");
- }
-
- if (val && this.mOnOpen)
- this.mOnOpen();
- ]]></setter>
- </property>
-
- <method name="toggleOpen">
- <body><![CDATA[
- this.open = !this.open;
- ]]></body>
- </method>
-
- </implementation>
-
- <resources>
- <stylesheet src="chrome://inspector/skin/multipanel.css"/>
- </resources>
- </binding>
-
-</bindings>
deleted file mode 100644
--- a/extensions/inspector/resources/content/extensions/titledSplitter.css
+++ /dev/null
@@ -1,42 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-@import url("chrome://inspector/skin/titledSplitter.css");
-
-.titled-splitter {
- -moz-binding: url("titledSplitter.xml#titledSplitter") !important;
-}
deleted file mode 100644
--- a/extensions/inspector/resources/content/extensions/titledSplitter.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0"?>
-
-<bindings id="bdsTitledSplitter"
- xmlns="http://www.mozilla.org/xbl"
- xmlns:xbl="http://www.mozilla.org/xbl"
- xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <binding id="titledSplitter" extends="chrome://global/content/bindings/splitter.xml#splitter">
- <content>
- <xul:vbox class="titledsplitter-container" flex="1">
- <xul:spacer class="titledsplitter-dragbar"/>
- <xul:box class="titledsplitter-titlebox" flex="1" onmousedown="event.stopPropagation()">
- <xul:box align="center">
- <xul:label class="titledsplitter-text" xbl:inherits="value=label"/>
- </xul:box>
- <xul:spacer flex="1"/>
- <xul:button class="titledsplitter-closebutton" align="center" pack="center"
- onclick="this.parentNode.parentNode.parentNode.close();">
- <xul:image class="titledsplitter-closeimage"/>
- </xul:button>
- </xul:box>
- </xul:vbox>
- </content>
-
- <implementation>
- <property name="isOpened">
- <getter><![CDATA[
- return this.mOpened;
- ]]></getter>
- </property>
-
- <property name="collapsee">
- <getter><![CDATA[
- var collapse = this.getAttribute("collapse");
- return collapse == "before" ? this.previousSibling : this.nextSibling;
- ]]></getter>
- </property>
-
- <method name="open">
- <body><![CDATA[
- var collapsee = this.collapsee;
- if (collapsee) {
- this.removeAttribute("closed");
- this.removeAttribute("collapsed");
- collapsee.removeAttribute("collapsed");
- this.mOpened = true;
- this.onopen();
- }
- ]]></body>
- </method>
-
- <method name="close">
- <body><![CDATA[
- var collapsee = this.collapsee;
- if (collapsee) {
- this.setAttribute("closed", "true");
- this.setAttribute("collapsed", "true");
- collapsee.setAttribute("collapsed", "true");
- this.mOpened = false;
- this.onopen();
- }
- ]]></body>
- </method>
-
- <method name="onopen">
- <body><![CDATA[
- if (!this.mOnOpen) {
- var js = this.getAttribute("onopen");
- if (js)
- this.mOnOpen = new Function(js);
- }
-
- return this.mOnOpen ? this.mOnOpen() : null;
- ]]></body>
- </method>
-
- <constructor><![CDATA[
- this.mOpened = false;
- ]]></constructor>
- </implementation>
-
- </binding>
-
-</bindings>
deleted file mode 100644
--- a/extensions/inspector/resources/content/extensions/treeEditable.css
+++ /dev/null
@@ -1,50 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-@import url("chrome://inspector/skin/treeEditable.css");
-
-.tree-editable {
- -moz-binding: url("treeEditable.xml#treeEditable");
-}
-
-.treecell-editable {
- -moz-binding: url("treeEditable.xml#treecellEditable");
-}
-
-treeitem[editing="true"] > treerow {
- background-color: transparent !important;
-}
\ No newline at end of file
deleted file mode 100644
--- a/extensions/inspector/resources/content/extensions/treeEditable.xml
+++ /dev/null
@@ -1,175 +0,0 @@
-<?xml version="1.0"?>
-
-<bindings id="bnsEditableTree"
- xmlns="http://www.mozilla.org/xbl"
- xmlns:xbl="http://www.mozilla.org/xbl"
- xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <binding id="treeEditable" extends="chrome://global/content/bindings/tree.xml#tree">
- <content>
- <children/>
- <xul:treerows class="tree-container-treerows" xbl:inherits="dragover,dragdroptree">
- <children includes="treehead|treechildren"/>
- </xul:treerows>
- </content>
-
- <implementation>
- <property name="onStartEdit" readonly="true">
- new Function("event", this.getAttribute("onstartedit"));
- </property>
-
- <property name="onAfterEdit" readonly="true">
- new Function("event", this.getAttribute("onafteredit"));
- </property>
-
- <method name="getEditorElement">
- <parameter name="aTreecell"/>
- <body><![CDATA[
- var eclass = aTreecell.getAttributeNS("http://www.mozilla.org", "editorclass");
- var cached = this.mEditorCache[eclass];
- var event = {
- editingNode: aTreecell,
- editorCached: cached,
- editorClass: eclass
- };
-
- var userEl = this.onStartEdit(event);
- var el = userEl ? userEl : ( cached ? cached : this.createDefaultEditor() );
- if (userEl || !cached) {
- el.setAttribute("class", el.getAttribute("class") + " treecell-editor");
- this.mEditorCache[eclass] = el;
- }
-
- return el;
- ]]></body>
- </method>
-
- <method name="startEdit">
- <parameter name="aTreecell"/>
- <body><![CDATA[
- // walk up to the treeitem containing the editing cell
- var item = aTreecell
- while (item && item.localName.toLowerCase() != "treeitem")
- item = item.parentNode;
-
- item.setAttribute("editing", "true");
- var editor = this.getEditorElement(aTreecell);
- editor.setAttribute("value", aTreecell.getAttribute("label"));
- aTreecell.parentNode.replaceChild(editor, aTreecell);
-
- this.mEditing = true;
- this.mEditingCell = aTreecell;
- this.mEditingEditor = editor;
- this.mEditingItem = item;
-
- editor.focus();
- // if it proves to be a textbox... select it's text
- if (editor.select) editor.select();
- ]]></body>
- </method>
-
- <method name="stopEdit">
- <parameter name="aCancel"/>
- <body><![CDATA[
- if (this.mEditing) {
- var cell = this.mEditingCell;
- var ed = this.mEditingEditor;
- var ev = ed.value;
- this.mEditingItem.removeAttribute("editing");
- var cancel = this.onAfterEdit({ newValue: ev, editingNode: cell, editingItem: this.mEditingItem });
- if (!aCancel && !cancel) cell.setAttribute("label", ev);
- ed.parentNode.replaceChild(cell, ed);
- this.mEditing = false;
- this.focus();
- }
- ]]></body>
- </method>
-
- <method name="createDefaultEditor">
- <body><![CDATA[
- var el = document.createElement("textbox");
- return el;
- ]]></body>
- </method>
-
- <constructor><![CDATA[
- this.mEditorCache = {};
- this.mEditing = false;
- this.mEditingCell = null;
- this.mEditingEditor = null;
- ]]></constructor>
- </implementation>
-
- <handlers>
- <handler event="mousedown"><![CDATA[
- if (this.mEditing && event.target != this.mEditingEditor
- && event.target != this.mEditingCell)
- {
- this.stopEdit();
- }
- ]]></handler>
-
- <handler event="keypress"><![CDATA[
- if (!this.mEditing && event.keyCode == 113) {
- var sel = this.selectedItems ? this.selectedItems[0] : null;
- if (sel) {
- var cells = sel.getElementsByTagName("treecell");
- for (var i = 0; i < cells.length; ++i) {
- if (cells[i].getAttribute("editable") == "true") {
- this.startEdit(cells[i]);
- break;
- }
- }
- }
- }
- if (this.mEditing && event.keyCode == 13)
- this.stopEdit();
- if (this.mEditing && event.keyCode == 27)
- this.stopEdit(true);
- if (this.mEditing && event.keyCode == 9) {
- event.stopPropagation();
- event.preventDefault();
- }
- ]]></handler>
- </handlers>
- </binding>
-
- <!-- ==================================================================================== -->
- <!-- ==================================================================================== -->
-
- <binding id="treecellEditable" extends="chrome://global/content/bindings/tree.xml#treecell">
- <implementation>
- <property name="parentItem" readonly="true"><![CDATA[
- var parent = this.parentNode;
- while (parent.localName != "treeitem" && parent) {
- parent = parent.parentNode;
- }
- this.mParentItem = parent;
- this.mParentItem;
- ]]></property>
-
- <property name="parentTree" readonly="true"><![CDATA[
- var parent = this.parentNode;
- while (parent.localName != "tree" && parent) {
- parent = parent.parentNode;
- }
- this.mParentTree = parent;
- this.mParentTree;
- ]]></property>
-
- <method name="startEdit">
- <body><![CDATA[
- this.parentTree.startEdit(this);
- ]]></body>
- </method>
- </implementation>
-
- <handlers>
- <handler event="mousedown"><![CDATA[
- if (this.parentItem.getAttribute("selected") == "true" && event.button == 0)
- this.startEdit();
- ]]></handler>
- </handlers>
- </binding>
-
-</bindings>
deleted file mode 100644
--- a/extensions/inspector/resources/content/extensions/wsm-colorpicker.js
+++ /dev/null
@@ -1,84 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/***************************************************************
-* wsm-colorpicker ----------------------------------------------
-* Quick script which adds support for the color picker widget
-* to nsWidgetStateManager in the pref winodw.
-* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-* REQUIRED IMPORTS:
-****************************************************************/
-
-function AddColorPicker(aCallback)
-{
- window.addEventListener("load", AddColorPicker_delayCheck, false);
- window.AddColorPicker_callback = aCallback;
-}
-
-function AddColorPicker_delayCheck()
-{
- if (parent.hPrefWindow)
- AddColorPicker_addColorHandlers()
- else
- setTimeout("AddColorPicker_delayCheck()", 1);
-}
-
-function AddColorPicker_addColorHandlers()
-{
- parent.hPrefWindow.wsm.handlers.colorpicker = {
- set: function (aElementID, aDataObject)
- {
- var wsm = parent.hPrefWindow.wsm;
- var element = wsm.contentArea.document.getElementById( aElementID );
- element.color = aDataObject.color;
- },
-
- get: function (aElementID)
- {
- var wsm = parent.hPrefWindow.wsm;
- var element = wsm.contentArea.document.getElementById( aElementID );
- var dataObject = wsm.generic_Get(element);
- if(dataObject) {
- dataObject.color = element.color;
- return dataObject;
- }
- return null;
- }
- }
-
- window.AddColorPicker_callback();
-}
deleted file mode 100644
--- a/extensions/inspector/resources/content/hooks.js
+++ /dev/null
@@ -1,54 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-function inspectDOMDocument(aDocument, aModal)
-{
- window.openDialog("chrome://inspector/content/", "_blank",
- "chrome,all,dialog=no"+(aModal?",modal":""), aDocument);
-}
-
-function inspectDOMNode(aNode, aModal)
-{
- window.openDialog("chrome://inspector/content/", "_blank",
- "chrome,all,dialog=no"+(aModal?",modal":""), aNode);
-}
-
-function inspectObject(aObject, aModal)
-{
- window.openDialog("chrome://inspector/content/object.xul", "_blank",
- "chrome,all,dialog=no"+(aModal?",modal":""), aObject);
-}
deleted file mode 100644
--- a/extensions/inspector/resources/content/inspector.css
+++ /dev/null
@@ -1,72 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-@import url("chrome://inspector/content/extensions/titledSplitter.css");
-@import url("chrome://inspector/content/extensions/multipanel.css");
-
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-
-*[hide="true"] {
- visibility: hidden;
-}
-
-domi-panelset {
- -moz-binding: url("chrome://inspector/content/inspector.xml#panelset");
- display: -moz-box;
-}
-
-domi-panel {
- -moz-binding: url("chrome://inspector/content/inspector.xml#panel");
- display: -moz-box;
-}
-
-#ppsViewerPopupset {
- display: none;
-}
-
-.tree-list > treecol,
-.tree-list > .tree-columns > treecol {
- -moz-binding: none;
- background-color: transparent !important;
- margin: 0px !important;
- border: none !important;
- padding: 0px !important;
-}
-
-.tree-nocolpicker > .tree-columns > .tree-columnpicker {
- visibility: collapse;
-}
deleted file mode 100644
--- a/extensions/inspector/resources/content/inspector.js
+++ /dev/null
@@ -1,583 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- * Jason Barnabe <jason_barnabe@fastmail.fm>
- * Shawn Wilsher <me@shawnwilsher.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 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 ***** */
-
-/***************************************************************
-* InspectorApp -------------------------------------------------
-* The primary object that controls the Inspector application.
-****************************************************************/
-
-//////////// global variables /////////////////////
-
-var inspector;
-
-//////////// global constants ////////////////////
-
-const kClipboardHelperCID = "@mozilla.org/widget/clipboardhelper;1";
-const kPromptServiceCID = "@mozilla.org/embedcomp/prompt-service;1";
-const kFOStreamCID = "@mozilla.org/network/file-output-stream;1";
-const kEncoderCIDbase = "@mozilla.org/layout/documentEncoder;1?type=";
-const kSerializerCID = "@mozilla.org/xmlextras/xmlserializer;1";
-const nsIWebNavigation = Components.interfaces.nsIWebNavigation;
-const nsIDocShellTreeItem = Components.interfaces.nsIDocShellTreeItem;
-const nsIDocShell = Components.interfaces.nsIDocShell;
-const nsIFileOutputStream = Components.interfaces.nsIFileOutputStream;
-const nsIDocumentEncoder = Components.interfaces.nsIDocumentEncoder;
-const nsIDOMSerializer = Components.interfaces.nsIDOMSerializer;
-
-//////////////////////////////////////////////////
-
-window.addEventListener("load", InspectorApp_initialize, false);
-window.addEventListener("unload", InspectorApp_destroy, false);
-
-function InspectorApp_initialize()
-{
- inspector = new InspectorApp();
-
- // window.arguments may be either a string or a node.
- // If passed via a command line handler, it will be a uri string.
- // If passed via navigator hooks, it will be a dom node to inspect.
- var initNode, initURI;
- if (window.arguments && window.arguments.length) {
- if (typeof window.arguments[0] == "string") {
- initURI = window.arguments[0];
- }
- else if (window.arguments[0] instanceof Components.interfaces.nsIDOMNode) {
- initNode = window.arguments[0];
- }
- }
- inspector.initialize(initNode, initURI);
-
- // Disables the Mac Specific VK_BACK for delete key for non-mac systems
- if (!/Mac/.test(navigator.platform)) {
- document.getElementById("keyEditDeleteMac")
- .setAttribute("disabled", "true");
- }
-}
-
-function InspectorApp_destroy()
-{
- inspector.destroy();
-}
-
-////////////////////////////////////////////////////////////////////////////
-//// class InspectorApp
-
-function InspectorApp()
-{
-}
-
-InspectorApp.prototype =
-{
- ////////////////////////////////////////////////////////////////////////////
- //// Initialization
-
- mShowBrowser: false,
- mClipboardHelper: null,
- mPromptService: null,
-
- get document() { return this.mDocPanel.viewer.subject },
- get panelset() { return this.mPanelSet; },
-
- initialize: function(aTarget, aURI)
- {
- this.mInitTarget = aTarget;
-
- var el = document.getElementById("bxBrowser");
- el.addEventListener("pageshow", BrowserPageShowListener, true);
-
- this.setBrowser(false, true);
-
- this.mClipboardHelper = XPCU.getService(kClipboardHelperCID, "nsIClipboardHelper");
- this.mPromptService = XPCU.getService(kPromptServiceCID, "nsIPromptService");
-
- this.mPanelSet = document.getElementById("bxPanelSet");
- this.mPanelSet.addObserver("panelsetready", this, false);
- this.mPanelSet.initialize();
-
- // check if accessibility service is available
- var cmd = document.getElementById("cmd:toggleAccessibleNodes");
- if (cmd) {
- if (!("@mozilla.org/accessibleRetrieval;1" in Components.classes))
- cmd.setAttribute("disabled", "true");
- }
-
- if (aURI) {
- this.gotoURL(aURI);
- }
- },
-
- destroy: function()
- {
- InsUtil.persistAll("bxDocPanel");
- InsUtil.persistAll("bxObjectPanel");
- },
-
- ////////////////////////////////////////////////////////////////////////////
- //// Viewer Panels
-
- initViewerPanels: function()
- {
- this.mDocPanel = this.mPanelSet.getPanel(0);
- this.mDocPanel.addObserver("subjectChange", this, false);
- this.mObjectPanel = this.mPanelSet.getPanel(1);
-
- if (this.mInitTarget) {
- if (this.mInitTarget.nodeType == Node.DOCUMENT_NODE)
- this.setTargetDocument(this.mInitTarget);
- else if (this.mInitTarget.nodeType == Node.ELEMENT_NODE) {
- this.setTargetDocument(this.mInitTarget.ownerDocument);
- this.mDocPanel.params = this.mInitTarget;
- }
- this.mInitTarget = null;
- }
- },
-
- onEvent: function(aEvent)
- {
- switch (aEvent.type) {
- case "panelsetready":
- this.initViewerPanels();
- break;
- case "subjectChange":
- if (aEvent.target == this.mDocPanel.viewer &&
- aEvent.subject && "location" in aEvent.subject) {
- this.locationText = aEvent.subject.location; // display document url
-
- var docTitle = aEvent.subject.title || aEvent.subject.location;
- if (/Mac/.test(navigator.platform)) {
- document.title = docTitle;
- } else {
- document.title = docTitle + " - " +
- document.documentElement.getAttribute("title");
- }
-
- this.updateCommand("cmdSave");
- }
- break;
- }
- },
-
- ////////////////////////////////////////////////////////////////////////////
- //// UI Commands
-
- updateCommand: function inspector_updateCommand(aCommand)
- {
- var command = document.getElementById(aCommand);
-
- var disabled = false;
- switch (aCommand) {
- case "cmdSave":
- var doc = this.mDocPanel.subject;
- disabled = !((kEncoderCIDbase + doc.contentType) in Components.classes ||
- (kSerializerCID in Components.classes));
- break;
- }
-
- command.setAttribute("disabled", disabled);
- },
-
- doViewerCommand: function(aCommand)
- {
- this.mPanelSet.execCommand(aCommand);
- },
-
- showOpenURLDialog: function()
- {
- var bundle = this.mPanelSet.stringBundle;
- var msg = bundle.getString("inspectURL.message");
- var title = bundle.getString("inspectURL.title");
- var url = { value: "http://" };
- var dummy = { value: false };
- var go = this.mPromptService.prompt(window, title, msg, url, null, dummy);
- if (go) {
- this.gotoURL(url.value);
- }
- },
-
- showPrefsDialog: function()
- {
- goPreferences("advancedItem", "chrome://inspector/content/prefs/pref-inspector.xul", "inspector");
- },
-
- toggleBrowser: function(aToggleSplitter)
- {
- this.setBrowser(!this.mShowBrowser, aToggleSplitter)
- },
-
- setBrowser: function(aValue, aToggleSplitter)
- {
- this.mShowBrowser = aValue;
- if (aToggleSplitter)
- this.openSplitter("Browser", aValue);
- var cmd = document.getElementById("cmdToggleBrowser");
- cmd.setAttribute("checked", aValue);
- },
-
- openSplitter: function(aName, aTruth)
- {
- var splitter = document.getElementById("spl" + aName);
- if (aTruth)
- splitter.open();
- else
- splitter.close();
- },
-
- /**
- * Saves the current document state in the inspector.
- */
- save: function save()
- {
- var picker = Components.classes["@mozilla.org/filepicker;1"]
- .createInstance(nsIFilePicker);
- var title = document.getElementById("mi-save").label;
- picker.init(window, title, picker.modeSave)
- picker.appendFilters(picker.filterHTML | picker.filterXML |
- picker.filterXUL);
- if (picker.show() == picker.returnCancel)
- return;
-
- var fos = Components.classes[kFOStreamCID]
- .createInstance(nsIFileOutputStream);
- const flags = 0x02 | 0x08 | 0x20; // write, create, truncate
-
- var doc = this.mDocPanel.subject;
- if ((kEncoderCIDbase + doc.contentType) in Components.classes) {
- // first we try to use the document encoder for that content type. If
- // that fails, we move on to the xml serializer.
- var encoder = Components.classes[kEncoderCIDbase + doc.contentType]
- .createInstance(nsIDocumentEncoder);
- encoder.init(doc, doc.contentType, encoder.OutputRaw);
- encoder.setCharset(doc.characterSet);
- fos.init(picker.file, flags, 0666, 0);
- try {
- encoder.encodeToStream(fos);
- } finally {
- fos.close();
- }
- } else {
- var serializer = Components.classes[kSerializerCID]
- .createInstance(nsIDOMSerializer);
- fos.init(picker.file, flags, 0666, 0);
- try {
- serializer.serializeToStream(doc, fos);
- } finally {
- fos.close();
- }
- }
- },
-
- exit: function()
- {
- window.close();
- // Todo: remove observer service here
- },
-
- ////////////////////////////////////////////////////////////////////////////
- //// Navigation
-
- gotoTypedURL: function()
- {
- var url = document.getElementById("tfURLBar").value;
- this.gotoURL(url);
- },
-
- gotoURL: function(aURL, aNoSaveHistory)
- {
- this.mPendingURL = aURL;
- this.mPendingNoSave = aNoSaveHistory;
- this.browseToURL(aURL);
- this.setBrowser(true, true);
- },
-
- browseToURL: function(aURL)
- {
- try {
- this.webNavigation.loadURI(aURL, nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null);
- }
- catch(ex) {
- // nsIWebNavigation.loadURI will spit out an appropriate user prompt, so
- // we don't need to do anything here. See nsDocShell::DisplayLoadError()
- }
- },
-
- /**
- * Creates the submenu for Inspect Content/Chrome Document
- */
- showInspectDocumentList: function showInspectDocumentList(aEvent, aChrome)
- {
- const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
- var menu = aEvent.target;
- var ww = Components.classes["@mozilla.org/appshell/window-mediator;1"]
- .getService(Components.interfaces.nsIWindowMediator);
- var windows = ww.getXULWindowEnumerator(null);
- var docs = [];
-
- while (windows.hasMoreElements()) {
- try {
- // Get the window's main docshell
- var windowDocShell = windows.getNext()
- .QueryInterface(Components.interfaces.nsIXULWindow)
- .docShell;
- this.appendContainedDocuments(docs, windowDocShell,
- aChrome ? nsIDocShellTreeItem.typeChrome
- : nsIDocShellTreeItem.typeContent);
- }
- catch (ex) {
- // We've failed with this window somehow, but we're catching the error
- // so the others will still work
- Components.utils.reportError(ex);
- }
- }
-
- // Clear out any previous menu
- this.emptyChildren(menu);
-
- // Now add what we found to the menu
- if (!docs.length) {
- var noneMenuItem = document.createElementNS(XULNS, "menuitem");
- noneMenuItem.setAttribute("label",
- this.mPanelSet.stringBundle
- .getString("inspectWindow.noDocuments.message"));
- noneMenuItem.setAttribute("disabled", true);
- menu.appendChild(noneMenuItem);
- } else {
- for (var i = 0; i < docs.length; i++)
- this.addInspectDocumentMenuItem(menu, docs[i], i + 1);
- }
- },
-
- /**
- * Appends to the array the documents contained in docShell (including the passed
- * docShell itself).
- *
- * @param array the array to append to
- * @param docShell the docshell to look for documents in
- * @param type one of the types defined in nsIDocShellTreeItem
- */
- appendContainedDocuments: function appendContainedDocuments(array, docShell, type)
- {
- // Load all the window's content docShells
- var containedDocShells = docShell.getDocShellEnumerator(type,
- nsIDocShell.ENUMERATE_FORWARDS);
- while (containedDocShells.hasMoreElements()) {
- try {
- // Get the corresponding document for this docshell
- var childDoc = containedDocShells.getNext().QueryInterface(nsIDocShell)
- .contentViewer.DOMDocument;
-
- // Ignore the DOM Insector's browser docshell if it's not being used
- if (docShell.contentViewer.DOMDocument.location.href != document.location.href ||
- childDoc.location.href != "about:blank") {
- array.push(childDoc);
- }
- }
- catch (ex) {
- // We've failed with this document somehow, but we're catching the error so
- // the others will still work
- dump(ex + "\n");
- }
- }
- },
-
- /**
- * Creates a menu item for Inspect Document.
- *
- * @param doc document related to this menu item
- * @param docNumber the position of the document
- */
- addInspectDocumentMenuItem: function addInspectDocumentMenuItem(parent, doc, docNumber)
- {
- const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
- var menuItem = document.createElementNS(XULNS, "menuitem");
- menuItem.doc = doc;
- // Use the URL if there's no title
- var title = doc.title || doc.location.href;
- // The first ten items get numeric access keys
- if (docNumber < 10) {
- menuItem.setAttribute("label", docNumber + " " + title);
- menuItem.setAttribute("accesskey", docNumber);
- } else {
- menuItem.setAttribute("label", title);
- }
- parent.appendChild(menuItem);
- },
-
- setTargetWindow: function(aWindow)
- {
- this.setTargetDocument(aWindow.document);
- },
-
- setTargetDocument: function(aDoc)
- {
- this.mDocPanel.subject = aDoc;
- },
-
- get webNavigation()
- {
- var browser = document.getElementById("ifBrowser");
- return browser.webNavigation;
- },
-
- ////////////////////////////////////////////////////////////////////////////
- //// UI Labels getters and setters
-
- get locationText() { return document.getElementById("tfURLBar").value; },
- set locationText(aText) { document.getElementById("tfURLBar").value = aText; },
-
- get statusText() { return document.getElementById("txStatus").value; },
- set statusText(aText) { document.getElementById("txStatus").value = aText; },
-
- get progress() { return document.getElementById("pmStatus").value; },
- set progress(aPct) { document.getElementById("pmStatus").value = aPct; },
-
- ////////////////////////////////////////////////////////////////////////////
- //// Document Loading
-
- documentLoaded: function()
- {
- this.setTargetWindow(_content);
-
- var url = this.webNavigation.currentURI.spec;
-
- // put the url into the urlbar
- this.locationText = url;
-
- // add url to the history, unless explicity told not to
- if (!this.mPendingNoSave)
- this.addToHistory(url);
-
- this.mPendingURL = null;
- this.mPendingNoSave = null;
- },
-
- ////////////////////////////////////////////////////////////////////////////
- //// History
-
- addToHistory: function(aURL)
- {
- },
-
- ////////////////////////////////////////////////////////////////////////////
- //// Uncategorized
-
- get isViewingContent() { return this.mPanelSet.getPanel(0).subject != null; },
-
- fillInTooltip: function(tipElement)
- {
- var retVal = false;
- var textNode = document.getElementById("txTooltip");
- if (textNode) {
- try {
- var tipText = tipElement.getAttribute("tooltiptext");
- if (tipText != "") {
- textNode.setAttribute("value", tipText);
- retVal = true;
- }
- }
- catch (e) { }
- }
-
- return retVal;
- },
-
- initPopup: function(aPopup)
- {
- var items = aPopup.getElementsByTagName("menuitem");
- var js, fn, item;
- for (var i = 0; i < items.length; i++) {
- item = items[i];
- fn = "isDisabled" in item ? item.isDisabled : null;
- if (!fn) {
- js = item.getAttribute("isDisabled");
- if (js) {
- fn = new Function(js);
- item.isDisabled = fn;
- } else {
- item.isDisabled = null; // to prevent annoying "strict" warning messages
- }
- }
- if (fn) {
- if (item.isDisabled())
- item.setAttribute("disabled", "true");
- else
- item.removeAttribute("disabled");
- }
-
- fn = null;
- }
- },
-
- emptyChildren: function(aNode)
- {
- while (aNode.hasChildNodes()) {
- aNode.removeChild(aNode.lastChild);
- }
- },
-
- onSplitterOpen: function(aSplitter)
- {
- if (aSplitter.id == "splBrowser") {
- this.setBrowser(aSplitter.isOpened, false);
- }
- },
-
- // needed by overlayed commands from viewer to get references to a specific
- // viewer object by name
- getViewer: function(aUID)
- {
- return this.mPanelSet.registry.getViewerByUID(aUID);
- }
-
-};
-
-////////////////////////////////////////////////////////////////////////////
-//// event listeners
-
-function BrowserPageShowListener(aEvent)
-{
- // since we will also get pageshow events for frame documents,
- // make sure we respond to the top-level document load
- if (aEvent.target.defaultView == _content)
- inspector.documentLoaded();
-}
-
-function UtilWindowOpenListener(aWindow)
-{
- inspector.doViewSearchItem(aWindow);
-}
deleted file mode 100644
--- a/extensions/inspector/resources/content/inspector.xml
+++ /dev/null
@@ -1,924 +0,0 @@
-<?xml version="1.0"?>
-
-<bindings id="ViewerPaneBindings"
- xmlns="http://www.mozilla.org/xbl"
- xmlns:xbl="http://www.mozilla.org/xbl"
- xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!-- ***************************************************************
- * Inspector
- * Interface for a set of viewer panels.
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * REQUIRED IMPORTS:
- * chrome://inspector/content/ViewerRegistry.js
- * chrome://inspector/content/jsutil/events/ObserverManager.js
- **************************************************************** -->
-
- <binding id="panelset" extends="chrome://inspector/content/inspector.xml#base">
- <content>
- <xul:stringbundle src="chrome://inspector/locale/inspector.properties"/>
- <children/>
- </content>
-
- <implementation>
- <field name="mFocusedDocument">null</field>
- <field name="mFocusedPanel">null</field>
- <field name="mCommandStack">[]</field>
- <field name="mCommandPtr">-1</field>
- <field name="mStringBundle">null</field>
-
- <property name="registry" readonly="true"
- onget="return this.mRegistry"/>
- <property name="initialized" readonly="true"
- onget="return this.mInitialized"/>
- <property name="focusedPanel" readonly="true"
- onget="return this.mFocusedPanel;"/>
- <property name="stringBundle" readonly="true"
- onget="return this.mStringBundle;"/>
-
- <method name="initialize">
- <body><![CDATA[
- this.mRegistry = new ViewerRegistry();
- this.mRegistry.load(kViewerRegURL, this);
- ]]></body>
- </method>
-
- <method name="onEvent">
- <parameter name="aEvent"/>
- <body><![CDATA[
- if (aEvent.type == "viewerChange")
- this.onViewerChange(aEvent);
-
- // bubble the event up
- this.mObsMan.dispatchEvent(aEvent.type, aEvent);
- ]]></body>
- </method>
-
- <method name="onViewerRegistryLoad">
- <body><![CDATA[
- var panels = this.panels;
- for (var i = 0; i < panels.length; ++i) {
- panels[i].initialize();
- panels[i].addObserver("viewerChange", this);
- panels[i].addObserver("subjectChange", this);
- }
-
- this.setViewerCmdAttributeOnAll("disabled", "true");
- this.updateAllCommands();
-
- this.mInitialized = true;
- this.mObsMan.dispatchEvent("panelsetready", {});
- ]]></body>
- </method>
-
- <method name="onViewerRegistryLoadError">
- <body><![CDATA[
- throw "Unable to load the Viewer Registry";
- ]]></body>
- </method>
-
- <method name="onViewerChange">
- <parameter name="aEvent"/>
- <body><![CDATA[
- if (aEvent.oldViewer)
- // disable all commands for for the old viewer
- this.setViewerCmdAttribute(aEvent.oldViewer.uid,
- "disabled", "true");
-
- if (aEvent.newViewer)
- // enable all commands for for the new viewer
- this.setViewerCmdAttribute(aEvent.newViewer.uid,
- "disabled", "false");
- ]]></body>
- </method>
-
- <property name="panels">
- <getter>
- return this.getElementsByTagName("domi-panel");
- </getter>
- </property>
-
- <property name="panelCount">
- <getter>
- return this.panels.length;
- </getter>
- </property>
-
- <method name="getPanel">
- <parameter name="aIndex"/>
- <body><![CDATA[
- return this.panels[aIndex];
- ]]></body>
- </method>
-
- <!-- ////////////// GLOBAL COMMANDS /////////////////// -->
-
- <method name="updateAllCommands">
- <body><![CDATA[
- var cmds = document.getElementById(this.getAttribute("viewercommandset"));
- if (!cmds) return;
-
- var els = cmds.getElementsByAttribute("global", "true");
- for (var i = 0; i < els.length; i++)
- this.updateCommand(els[i].id);
- ]]></body>
- </method>
-
- <method name="updateCommand">
- <parameter name="aCommand"/>
- <body><![CDATA[
- var enabled;
- if (aCommand == "cmdEditUndo")
- enabled = this.mCommandPtr >= 0;
- else if (aCommand == "cmdEditRedo") {
- enabled = this.mCommandPtr+1 < this.mCommandStack.length;
- if (!enabled && (this.mCommandPtr > -1)) {
- var lastCmd = this.mCommandStack[this.mCommandPtr];
- enabled = ((lastCmd instanceof nsITransactionManager) && (lastCmd.numberOfRedoItems > 0));
- }
- } else {
- if (this.focusedPanel && this.focusedPanel.viewer) {
- enabled = this.focusedPanel.viewer.isCommandEnabled(aCommand);
- }
- }
- this.setCommandAttribute(aCommand, "disabled", !enabled);
- ]]></body>
- </method>
-
- <method name="getCommandAttribute">
- <parameter name="aCommand"/>
- <parameter name="aAttribute"/>
- <body><![CDATA[
- var cmd = document.getElementById(aCommand);
- return cmd ? cmd.getAttribute(aAttribute) : null;
- ]]></body>
- </method>
-
- <method name="setCommandAttribute">
- <parameter name="aCommand"/>
- <parameter name="aAttribute"/>
- <parameter name="aValue"/>
- <body><![CDATA[
- // set attribute on command in our document
- var cmd = document.getElementById(aCommand);
- if (cmd) {
- if (aValue == false || aValue == "false")
- cmd.removeAttribute(aAttribute);
- else
- cmd.setAttribute(aAttribute, aValue);
- }
-
- // set attribute on command in each viewer document
- var panels = this.panels;
- for (var i = 0; i < panels.length; ++i) {
- var doc = panels[i].viewerDocument;
- cmd = doc.getElementById(aCommand);
- if (cmd)
- if (aValue == false || aValue == "false")
- cmd.removeAttribute(aAttribute);
- else
- cmd.setAttribute(aAttribute, aValue);
- }
- ]]></body>
- </method>
-
- <method name="createTransactionManager">
- <body><![CDATA[
- var txmgr = Components.classes["@mozilla.org/transactionmanager;1"].createInstance(nsITransactionManager);
- txmgr = txmgr.QueryInterface(nsITransactionManager);
- return txmgr;
- ]]></body>
- </method>
-
- <!-- ////////////// VIEWER-SPECIFIC COMMANDS /////////////////// -->
-
- <method name="setViewerCmdAttribute">
- <parameter name="aEntryUid"/>
- <parameter name="aAttr"/>
- <parameter name="aValue"/>
- <body><![CDATA[
- var cmds = document.getElementById(this.getAttribute("viewercommandset"));
- if (!cmds) return;
-
- var els = cmds.getElementsByAttribute("viewer", aEntryUid);
- for (var i = 0; i < els.length; i++) {
- if (els[i].hasAttribute("exclusive"))
- if (aValue == false || aValue == "false")
- els[i].removeAttribute(aAttr);
- else
- els[i].setAttribute(aAttr, aValue);
- }
- ]]></body>
- </method>
-
- <method name="setViewerCmdAttributeOnAll">
- <parameter name="aAttr"/>
- <parameter name="aValue"/>
- <body><![CDATA[
- var count = this.mRegistry.getEntryCount();
- for (var i = 0; i < count; i++) {
- this.setViewerCmdAttribute(this.mRegistry.getEntryProperty(i, "uid"), aAttr, aValue);
- }
- ]]></body>
- </method>
-
- <!-- ////////////// COMMAND EXECUTION /////////////////// -->
-
- <method name="execCommand">
- <parameter name="aCommand"/>
- <body><![CDATA[
- if (aCommand == "cmdEditUndo")
- this.undo();
- else if (aCommand == "cmdEditRedo")
- this.redo();
- else {
- if (!this.focusedPanel)
- return;
-
- // if the command is enabled, execute it
- var viewer = this.focusedPanel.viewer;
- if (!viewer.isCommandEnabled(aCommand))
- return;
- var command = viewer.getCommand(aCommand);
- if (!command)
- return;
-
- if (typeof command.txnType == "undefined") {
- var noPush = false;
- //try {
- noPush = command.doCommand();
- //} catch (ex) {
- // dump("Unable to successfully complete command " + aCommand + "\n");
- // return;
- //}
-
- if (!noPush) {
- this.addCommandToStack(command);
- }
- return;
- }
-
- // command.txnType != "undefined"; we have an nsITransaction.
- if (command.isTransient) {
- // command cannot be undone
- command.doTransaction();
- return;
- }
-
- if (command.txnType == "dialog") {
- // transaction executed from dialog box onAcceptDialog event; open dialog.
- command.openDialog();
- return;
- }
-
- // otherwise, command is a standard transaction.
- // Pass control to addCommandToStack function; it will handle TxMgr.
- this.addCommandToStack(command);
- }
- ]]></body>
- </method>
-
- <method name="undo">
- <body><![CDATA[
- if (this.mCommandPtr >= 0) {
- var command = this.mCommandStack[this.mCommandPtr];
- if ((command instanceof nsITransactionManager) && (command.numberOfUndoItems > 0)) {
- command.undoTransaction();
- if (command.numberOfUndoItems == 0) {
- --this.mCommandPtr;
- }
- } else {
- --this.mCommandPtr;
- //try {
- command.undoCommand();
- /*} catch (ex) {
- dump("Unable to successfully undo command.\n");
- return;
- }*/
- }
-
- this.updateCommand("cmdEditUndo");
- this.updateCommand("cmdEditRedo");
- }
- ]]></body>
- </method>
-
- <method name="redo">
- <body><![CDATA[
- if (this.mCommandPtr == -1) {
- var command = null;
- } else {
- command = this.mCommandStack[this.mCommandPtr];
- }
-
- if (this.mCommandPtr >= -1) {
- if (!((command instanceof nsITransactionManager)&&(command.numberOfRedoItems > 0))) {
- ++this.mCommandPtr;
- command = this.mCommandStack[this.mCommandPtr];
- }
-
- if ((command instanceof nsITransactionManager)&&(command.numberOfRedoItems > 0)) {
- command.redoTransaction();
- } else {
- try {
- command.doCommand();
- } catch (ex) {
- dump("Unable to successfully redo command.\n");
- return;
- }
- }
- this.updateCommand("cmdEditUndo");
- this.updateCommand("cmdEditRedo");
- }
- ]]></body>
- </method>
-
- <method name="addCommandToStack">
- <parameter name="command"/>
- <body><![CDATA[
- if (typeof command.txnType == "undefined") {
- // original Inspector-compatible command, not nsITransaction.
- // add new command to the stack
- ++this.mCommandPtr;
- this.mCommandStack[this.mCommandPtr] = command;
-
- // get rid of stack entries ahead of the command pointer (if there were any);
- this.mCommandStack.splice(this.mCommandPtr+1, this.mCommandStack.length - (this.mCommandPtr+1));
-
- this.updateCommand("cmdEditUndo");
- this.updateCommand("cmdEditRedo");
- return;
- }
-
- // command should be treated as a nsITransaction object.
- if (this.mCommandPtr + 1 < this.mCommandStack.length) {
- var nextCmd = this.mCommandStack[this.mCommandPtr + 1];
- if (nextCmd instanceof nsITransactionManager) {
- var mgr = nextCmd;
- mgr.clear();
- // No two Transaction Manager objects are ever adjacent to each other.
- // We simply use the Transaction Manager immediately following, and clear all transactions from it.
- // This gives us a fresh Transaction Manager.
- }
- }
-
- var currentCmd = this.mCommandStack[this.mCommandPtr];
- if (currentCmd instanceof nsITransactionManager) {
- mgr = currentCmd;
- }
- // we need a Transaction Manager, even if we create one.
- if (typeof mgr == "undefined") {
- mgr = this.createTransactionManager();
- }
-
- mgr.doTransaction(command);
-
- if (currentCmd != mgr) {
- // insert Transaction Manager into stack
- ++this.mCommandPtr;
- this.mCommandStack[this.mCommandPtr] = mgr;
- }
-
- // get rid of stack entries ahead of the command pointer (if there were any);
- this.mCommandStack.splice(this.mCommandPtr + 1, this.mCommandStack.length - (this.mCommandPtr + 1));
-
- this.updateCommand("cmdEditUndo");
- this.updateCommand("cmdEditRedo");
- ]]></body>
- </method>
-
- <!-- ////////////// CLIPBOARD /////////////////// -->
-
- <field name="mClipboard">null</field>
- <field name="mClipboardData">null</field>
- <field name="mClipboardFlavor">null</field>
- <field name="mClipboardHelper">null</field>
-
- <property name="clipboardFlavor" readonly="true"
- onget="return this.mClipboardFlavor"/>
-
- <property name="clipboard" readonly="true">
- <getter>
- <![CDATA[
- if (!this.mClipboard) {
- var iid = Components.interfaces.nsIClipboard;
- var cid = "@mozilla.org/widget/clipboard;1";
- this.mClipboard = Components.classes[cid].createInstance(iid);
- }
- return this.mClipboard;
- ]]></getter>
- </property>
-
- <property name="clipboardHelper" readonly="true">
- <getter>
- <![CDATA[
- if (!this.mClipboardHelper) {
- this.mClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
- .getService(Components.interfaces.nsIClipboardHelper);
- }
- return this.mClipboardHelper;
- ]]></getter>
- </property>
-
- <method name="setClipboardData">
- <parameter name="aObject"/>
- <parameter name="aFlavor"/>
- <parameter name="aTextRepresentation"/>
- <body><![CDATA[
- // put the text representation on the system clipboard
- if (aTextRepresentation) {
- this.clipboardHelper.copyString(aTextRepresentation);
- }
-
- // store the real object internally
- this.mClipboardData = aObject;
- this.mClipboardFlavor = aFlavor;
-
- this.updateCommand("cmdEditPaste");
- ]]></body>
- </method>
-
- <method name="getClipboardData">
- <body><![CDATA[
- return this.mClipboardData;
- ]]></body>
- </method>
-
- <constructor><![CDATA[
- this.mStringBundle = document.getAnonymousNodes(this)[0];
- ]]></constructor>
- </implementation>
-
- <handlers>
- <handler event="focus" phase="capturing">
- <![CDATA[
- if (!(event.originalTarget instanceof Element))
- return;
-
- var targetDoc = event.originalTarget.ownerDocument;
- if (targetDoc == this.mFocusedDocument)
- return;
-
- this.mFocusedDocument = targetDoc;
-
- if (targetDoc != this.ownerDocument) {
- var panels = this.panels;
- for (var i = 0; i < panels.length; ++i) {
- if (targetDoc == panels[i].viewerDocument) {
- this.mFocusedPanel = panels[i];
- this.updateAllCommands();
- return;
- }
- }
- }
-
- this.mFocusedPanel = null; // if all else fails
- ]]>
- </handler>
- </handlers>
-
- </binding>
-
-<!-- ***************************************************************
- * ViewerPane
- * Interface for a panel accepts a node and displays all eligible
- * viewers in a list and activates the selected viewer.
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- * REQUIRED IMPORTS:
- * chrome://inspector/content/jsutil/xpcom/XPCU.js
- * chrome://inspector/content/jsutil/events/ObserverManager.js
- **************************************************************** -->
-
- <binding id="panel" extends="chrome://inspector/content/inspector.xml#base">
- <content orient="vertical">
- <xul:toolbox class="viewer-pane-toolbox" xbl:inherits="disabled">
- <xul:toolbar class="viewer-pane-header" align="center" xbl:inherits="disabled" xpfe="false">
- <xul:toolbarbutton type="menu" anonid="viewer-list" class="viewer-list" disabled="true"/>
- <xul:label anonid="viewer-title" class="viewer-title label toolbar" flex="1"/>
- <xul:toolbarbutton type="menu" anonid="viewer-menu" class="viewer-menu" disabled="true"/>
- </xul:toolbar>
- </xul:toolbox>
- <xul:box class="viewer-pane-box-1" flex="1">
- <xul:box class="viewer-pane-box-2" flex="1">
- <xul:browser anonid="viewer-iframe" class="viewer-iframe"
- disablehistory="true" disablesecurity="true" flex="1"/>
- </xul:box>
- </xul:box>
- </content>
-
- <resources>
- <stylesheet src="chrome://inspector/skin/panelset.css"/>
- </resources>
-
- <implementation>
- <field name="mCurrentEntry">null</field>
- <field name="mCurrentViewer">null</field>
- <field name="mSubject">null</field>
- <field name="mParams">null</field>
-
- <constructor><![CDATA[
- // look for panelset parent
- var p = this.parentNode;
- while (p && p.localName != "domi-panelset")
- p = p.parentNode;
-
- this.mPanelSet = p;
-
- this.setAttribute("disabled", "true");
-
- this.mIFrameEl = document.getAnonymousElementByAttribute(this, "anonid", "viewer-iframe");
- ]]></constructor>
-
- <destructor><![CDATA[
- if (this.mCurrentViewer)
- this.destroyViewer();
- ]]></destructor>
-
- <property name="panelset"
- onget="return this.mPanelSet;"/>
-
- <property name="viewer"
- onget="return this.mCurrentViewer;"/>
-
- <property name="subject"
- onget="return this.mSubject;"
- onset="this.setSubject(val);"/>
-
- <property name="params"
- onget="return this.mParams;"
- onset="return this.mParams = val;"/>
-
- <property name="title"
- onget="return this.getAttribute('title');"
- onset="return this.setAttribute('title', val);"/>
-
- <property name="registry"
- onget="return this.panelset.registry;"/>
-
- <property name="viewerDocument"
- onget="return this.mIFrameEl.contentDocument;"/>
-
- <property name="linkedPanel">
- <getter>return this.mLinkedPanel;</getter>
- <setter>
- if (this.mLinkedPanel)
- this.mLinkedPanel.removeObserver("viewerChange", this);
-
- this.mLinkedPanel = val;
-
- if (val)
- val.addObserver("viewerChange", this);
- </setter>
- </property>
-
- <field name="mLinkedPanel">null</field>
- <field name="mLinkedViewer">null</field>
- <field name="mCurrentViewer">null</field>
- <field name="mCurrentEntry">null</field>
-
- <method name="initialize">
- <body><![CDATA[
- this.mListEl = document.getAnonymousElementByAttribute(this, "anonid", "viewer-list");
- this.mTitleEl = document.getAnonymousElementByAttribute(this, "anonid", "viewer-title");
- this.mMenuEl = document.getAnonymousElementByAttribute(this, "anonid", "viewer-menu");
-
- if (this.hasAttribute("linkedpanel"))
- this.linkedPanel = document.getElementById(this.getAttribute("linkedpanel"));
-
- this.fillViewerList();
- ]]></body>
- </method>
-
- <method name="notifyViewerReady">
- <parameter name="aViewer"/>
- <body><![CDATA[
- var old = this.mCurrentViewer;
- this.mCurrentViewer = aViewer;
- var oldEntry = this.mCurrentEntry;
- this.mCurrentEntry = this.mPendingEntry;
-
- if (aViewer) {
- this.registry.cacheViewer(aViewer, this.mCurrentEntry);
- var title = this.registry.getEntryProperty(this.mCurrentEntry, "description");
- this.setTitle(title);
- } else {
- this.setTitle(null);
- }
-
- this.rebuildViewerContextMenu();
-
- // listen for subjectChange so we can bubble it
- if (old)
- old.removeObserver("subjectChange", this);
-
- if (aViewer)
- aViewer.addObserver("subjectChange", this);
-
- this.mObsMan.dispatchEvent("viewerChange",
- { viewerPane: this, oldViewer: old, newViewer: aViewer });
-
- if (aViewer) {
- aViewer.subject = this.mSubject;
- // only give initial focus to panes that are not on the right side of a link
- if (!aViewer.pane.hasAttribute("linkedpanel")) {
- var doc = aViewer.pane.viewerDocument;
- doc.commandDispatcher.advanceFocusIntoSubtree(doc.documentElement);
- }
- }
- ]]></body>
- </method>
-
- <method name="destroyViewer">
- <body><![CDATA[
- this.mCurrentViewer.destroy();
- this.registry.uncacheViewer(this.mCurrentViewer);
- ]]></body>
- </method>
-
- <!-- ////////////// UI Commands /////////////////-->
-
- <!-- ////////////////////////////////////////////////////////////////////////////
- // Sets the new view to the item just selected from the "viewer list"
- //////////////////////////////////////////////////////////////////////// -->
-
- <method name="onViewerListCommand">
- <parameter name="aItem"/>
- <body><![CDATA[
- this.switchViewer(parseInt(aItem.getAttribute("viewerListEntry")));
- ]]></body>
- </method>
-
- <!-- ////////////////////////////////////////////////////////////////////////////
- // Prepares the list of viewers for a node, rebuilds the menulist to display
- // them, and load the default viewer for the node.
- //
- // @param Object aObject - the object to begin viewing
- //////////////////////////////////////////////////////////////////////// -->
-
- <method name="setSubject">
- <parameter name="aObject"/>
- <body><![CDATA[
- this.mSubject = aObject;
- this.mParams = null;
-
- // get the list of viewers which match the node
- var entries = this.registry.findViewersForObject(aObject, this.id,
- this.mLinkedViewer);
- this.rebuildViewerList(entries);
-
- if (entries.length == 0) {
- this.switchViewer(-1);
- this.setAttribute("disabled", "true");
- } else if (!this.entryInList(this.mCurrentEntry, entries)) {
- this.switchViewer(entries[0]);
- this.removeAttribute("disabled");
- } else {
- this.mCurrentViewer.subject = aObject;
- this.removeAttribute("disabled");
- }
-
- ]]></body>
- </method>
-
- <!-- ////////////////////////////////////////////////////////////////////////////
- // Clear out and rebuild the menulist full of the available views
- // for the currently selected node.
- //
- // @param Array aEntries - an array of entries from the viewer registry
- //////////////////////////////////////////////////////////////////////// -->
-
- <method name="rebuildViewerList">
- <parameter name="aEntries"/>
- <body><![CDATA[
- var mpp = this.mListElPopup;
-
- if (aEntries.length <= 0)
- this.mListEl.setAttribute("disabled", true);
- else
- this.mListEl.removeAttribute("disabled");
-
- // empty the list
- while (mpp.childNodes.length)
- mpp.removeChild(mpp.childNodes[0]);
-
- for (var i = 0; i < aEntries.length; i++) {
- var entry = aEntries[i];
- var menuitem = document.createElement("menuitem");
- menuitem.setAttribute("label", this.registry.getEntryProperty(entry, "description"));
- menuitem.setAttribute("viewerListEntry", entry);
- mpp.appendChild(menuitem);
- }
- ]]></body>
- </method>
-
- <!-- ////////////////////////////////////////////////////////////////////////////
- // Loads the viewer described by an entry in the viewer registry.
- //
- // @param nsIRDFNode aEntry - entry in the viewer registry
- //////////////////////////////////////////////////////////////////////// -->
-
- <method name="switchViewer">
- <parameter name="aEntry"/>
- <body><![CDATA[
- if (aEntry < 0) { // -1 is for null viewer
- this.mPendingEntry = -1;
- this.notifyViewerReady(null);
- return;
- }
-
- var url = this.registry.getEntryURL(aEntry);
-
- var loadNew = true;
- if (this.mCurrentViewer) {
- var oldURL = this.registry.getEntryURL(this.mCurrentEntry);
- if (oldURL == url) {
- loadNew = false;
- }
- }
-
- if (loadNew) {
- this.mPendingEntry = aEntry;
- this.loadViewerURL(url);
- }
- ]]></body>
- </method>
-
- <!-- ////////////////////////////////////////////////////////////////////////////
- // Begin loading a new viewer from a given url.
- //
- // @param String aURL - the url of the viewer document
- //////////////////////////////////////////////////////////////////////// -->
-
- <method name="loadViewerURL">
- <parameter name="aURL"/>
- <body><![CDATA[
- if (this.mCurrentViewer) {
- // tell the old viewer it's about to go away
- this.destroyViewer();
- }
-
- // load the new document
- FrameExchange.loadURL(this.mIFrameEl, aURL, this);
- ]]></body>
- </method>
-
- <!-- ////////////////////////////////////////////////////////////////////////////
- // Rebuild the viewer context menu
- //////////////////////////////////////////////////////////////////////// -->
-
- <method name="rebuildViewerContextMenu">
- <body><![CDATA[
- if (!this.mSubject) {
- this.mMenuEl.setAttribute("disabled", "true");
- return;
- } else {
- this.mMenuEl.removeAttribute("disabled");
- }
-
- // remove old context menu
- if (this.mContextMenu) {
- this.mMenuEl.removeChild(this.mContextMenu);
- this.mFormerContextParent.appendChild(this.mContextMenu);
- }
-
- var uid = this.registry.getEntryProperty(this.mCurrentEntry, "uid");
- var ppId = "ppViewerContext-" + uid;
- var pp = document.getElementById(ppId);
- if (pp) {
- this.mMenuEl.removeAttribute("disabled");
- var parent = pp.parentNode;
- parent.removeChild(pp);
- this.mMenuEl.appendChild(pp);
-
- this.mFormerContextParent = parent;
- } else {
- this.mMenuEl.setAttribute("disabled", "true");
- }
- this.mContextMenu = pp;
- ]]></body>
- </method>
-
- <!-- ////////////////////////////////////////////////////////////////////////////
- // Check to see if an entry exists in an arry of entries
- //
- // @param nsIRDFResource aEntry - the entry being searched for
- // @param Array aList - array of entries
- //////////////////////////////////////////////////////////////////////// -->
-
- <method name="entryInList">
- <parameter name="aEntry"/>
- <parameter name="aList"/>
- <body><![CDATA[
- for (var i in aList) {
- if (aList[i] == aEntry) return true;
- }
-
- return false;
- ]]></body>
- </method>
-
- <!-- ////////////////////////////////////////////////////////////////////////////
- // Set the text in the viewer title bar
- //
- // @param String title - the text to use
- //////////////////////////////////////////////////////////////////////// -->
-
- <method name="setTitle">
- <parameter name="aTitle"/>
- <body><![CDATA[
- this.mTitleEl.setAttribute("value", this.title && aTitle ? this.title + " - " + aTitle : "");
- ]]></body>
- </method>
-
- <!-- ////////////////////////////////////////////////////////////////////////////
- // Fill out the content of the "viewer list" menu
- //////////////////////////////////////////////////////////////////////// -->
-
- <method name="fillViewerList">
- <body><![CDATA[
- this.mListEl.pViewer = this;
- this.mListEl.setAttribute("oncommand", "this.pViewer.onViewerListCommand(event.originalTarget)");
-
- var mpp = document.createElement("menupopup");
- this.mListEl.appendChild(mpp);
- this.mListElPopup = mpp;
- ]]></body>
- </method>
-
- <!-- ////////////////////////////////////////////////////////////////////////////
- // Listen for selection changes on the viewer in the linked pane
- //////////////////////////////////////////////////////////////////////// -->
-
- <method name="observerLinkedViewer">
- <body><![CDATA[
- if (this.mLinkedViewer)
- this.mLinkedViewer.removeObserver("selectionChange", this);
-
- this.mLinkedViewer = this.mLinkedPanel.viewer;
- this.mLinkedViewer.addObserver("selectionChange", this);
- ]]></body>
- </method>
-
- <!-- ////////////////////////////////////////////////////////////////////////////
- // Update this pane's subject to be the selection of it's linked pane
- //////////////////////////////////////////////////////////////////////// -->
-
- <method name="updateLinkedSubject">
- <body><![CDATA[
- this.subject = this.mLinkedViewer.selection;
- ]]></body>
- </method>
-
- <!-- ////////////////////////////////////////////////////////////////////////////
- // global event handler
- //////////////////////////////////////////////////////////////////////// -->
-
- <method name="onEvent">
- <parameter name="aEvent"/>
- <body><![CDATA[
- switch (aEvent.type) {
- case "viewerChange":
- this.observerLinkedViewer();
- break;
- case "selectionChange":
- this.updateLinkedSubject();
- break;
- case "subjectChange":
- this.mObsMan.dispatchEvent("subjectChange", aEvent);
- };
- ]]></body>
- </method>
-
- </implementation>
-
- </binding>
-
- <binding id="base">
- <implementation>
- <constructor><![CDATA[
- this.mObsMan = new ObserverManager(this);
- ]]></constructor>
-
- <!-- ////////////// Event Handling /////////////////-->
-
- <method name="addObserver">
- <parameter name="aEvent"/>
- <parameter name="aObserver"/>
- <body><![CDATA[
- this.mObsMan.addObserver(aEvent, aObserver);
- ]]></body>
- </method>
-
- <method name="removeObserver">
- <parameter name="aEvent"/>
- <parameter name="aObserver"/>
- <body><![CDATA[
- this.mObsMan.removeObserver(aEvent, aObserver);
- ]]></body>
- </method>
-
- </implementation>
-
- </binding>
-
-</bindings>
deleted file mode 100644
--- a/extensions/inspector/resources/content/inspector.xul
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.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 DOM Inspector.
- -
- - The Initial Developer of the Original Code is
- - Netscape Communications Corporation.
- - Portions created by the Initial Developer are Copyright (C) 2003
- - the Initial Developer. All Rights Reserved.
- -
- - Contributor(s):
- - Shawn Wilsher <me@shawnwilsher.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 MPL, indicate your
- - decision by deleting the provisions above and replace them with the notice
- - and other provisions required by the LGPL or the GPL. 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 ***** -->
-
-<!DOCTYPE window [
- <!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/inspector.dtd"> %dtd1;
- <!ENTITY % dtd2 SYSTEM "chrome://inspector/content/util.dtd"> %dtd2;
-]>
-
-<?xul-overlay href="chrome://inspector/content/inspectorOverlay.xul"?>
-<?xul-overlay href="chrome://inspector/content/toolboxOverlay.xul"?>
-<?xul-overlay href="chrome://inspector/content/popupOverlay.xul"?>
-<?xul-overlay href="chrome://inspector/content/commandOverlay.xul"?>
-<?xul-overlay href="chrome://inspector/content/keysetOverlay.xul"?>
-<?xul-overlay href="chrome://inspector/content/statusbarOverlay.xul"?>
-
-<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
-
-<?xml-stylesheet href="chrome://inspector/skin/inspectorWindow.css"?>
-
-<window id="winInspectorMain" title="&Inspector.title;"
- width="640" height="480"
- persist="screenX screenY width height sizemode"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <stringbundleset id="stringbundleset">
- <stringbundle id="inspector-bundle"
- src="chrome://inspector/locale/inspector.properties"/>
- </stringbundleset>
- <popupset id="aTooltipSet"/>
-
- <popupset id="ppsGlobalPopupset"/>
- <popupset id="ppsViewerPopupset"/>
-
- <keyset id="ksGlobalKeyset"/>
- <commandset id="cmdsGlobalCommands"/>
-
- <commandset id="tasksCommands">
- <command id="cmd_quit"/>
- </commandset>
-
- <commandset id="baseMenuCommandSet"/>
-
- <keyset id="tasksKeys">
- <key id="key_saveInspector" key="&saveCmd.key;" command="cmdSave"
- modifiers="accel"/>
- <key id="key_closeInspector" key="&closeCmd.key;" command="cmdClose"
- modifiers="accel"/>
- <key id="key_quit"/>
- </keyset>
-
- <keyset id="baseMenuKeyset"/>
-
- <toolbox id="tbxInsToolbox">
- <menubar id="mbrInspectorMain"/>
- <toolbar id="tbInspectorPrimary"/>
- </toolbox>
-
- <vbox id="bxInspectorMain" flex="1"/>
-</window>
deleted file mode 100644
--- a/extensions/inspector/resources/content/inspectorOverlay.xul
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?>
-
-<!DOCTYPE overlay [
- <!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/inspector.dtd"> %dtd1;
- <!ENTITY % dtd2 SYSTEM "chrome://inspector/content/util.dtd"> %dtd2;
-]>
-
-<overlay id="ovInspector"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/x-javascript" src="chrome://inspector/content/inspector.js"/>
- <script type="application/x-javascript" src="chrome://inspector/content/ViewerRegistry.js"/>
- <script type="application/x-javascript" src="chrome://inspector/content/utils.js"/>
- <script type="application/x-javascript" src="chrome://inspector/content/jsutil/xpcom/XPCU.js"/>
- <script type="application/x-javascript" src="chrome://inspector/content/jsutil/rdf/RDFU.js"/>
- <script type="application/x-javascript" src="chrome://inspector/content/jsutil/rdf/RDFArray.js"/>
- <script type="application/x-javascript" src="chrome://inspector/content/jsutil/xul/FrameExchange.js"/>
- <script type="application/x-javascript" src="chrome://inspector/content/jsutil/system/PrefUtils.js"/>
- <script type="application/x-javascript" src="chrome://inspector/content/jsutil/system/FilePickerUtils.js"/>
- <script type="application/x-javascript" src="chrome://inspector/content/jsutil/system/file.js"/>
- <script type="application/x-javascript" src="chrome://inspector/content/jsutil/events/ObserverManager.js"/>
- <vbox id="bxInspectorMain">
-
- <domi-panelset id="bxPanelSet" flex="1"
- viewercommandset="cmdsGlobalCommands">
- <domi-panel id="bxDocPanel" title="&bxDocPanel.title;"
- flex="1" persist="width"/>
-
- <splitter id="splPanels" collapse="after">
- <grippy/>
- </splitter>
-
- <domi-panel id="bxObjectPanel" title="&bxObjectPanel.title;" linkedpanel="bxDocPanel"
- flex="1" persist="width"/>
- </domi-panelset>
-
- <splitter id="splBrowser" class="titled-splitter"
- onopen="inspector.onSplitterOpen(this)"
- label="&browserPanel.label;" closebutton="true" collapse="after"/>
-
- <hbox id="bxBrowser" flex="1">
- <browser id="ifBrowser" type="content-primary"
- disablehistory="true" disablesecurity="true"
- flex="1" src="about:blank"/>
- </hbox>
-
- </vbox>
-
-</overlay>
deleted file mode 100644
--- a/extensions/inspector/resources/content/jsutil/events/ObserverManager.js
+++ /dev/null
@@ -1,95 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/***************************************************************
-* ObserverManager -----------------------------------------------
-* Manages observer and event dispatching for an object.
-* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-* REQUIRED IMPORTS:
-****************************************************************/
-
-////////////////////////////////////////////////////////////////////////////
-//// class ObserverManager
-
-function ObserverManager(aTarget)
-{
- this.mTarget = aTarget;
- this.mObservers = {};
-}
-
-ObserverManager.prototype =
-{
- addObserver: function(aEventName, aObserver)
- {
- var list;
- if (!(aEventName in this.mObservers)) {
- list = [];
- this.mObservers[aEventName] = list;
- } else
- list = this.mObservers[aEventName];
-
-
- list.push(aObserver);
- },
-
- removeObserver: function(aEventName, aObserver)
- {
- if (aEventName in this.mObservers) {
- var list = this.mObservers[aEventName];
- for (var i = 0; i < list.length; ++i) {
- if (list[i] == aObserver) {
- list.splice(i, 1);
- return;
- }
- }
- }
- },
-
- dispatchEvent: function(aEventName, aEventData)
- {
- if (aEventName in this.mObservers) {
- if (!("target" in aEventData))
- aEventData.target = this.mTarget;
- aEventData.type = aEventName;
-
- var list = this.mObservers[aEventName];
- for (var i = 0; i < list.length; ++i)
- list[i].onEvent(aEventData);
- }
- }
-
-};
deleted file mode 100644
--- a/extensions/inspector/resources/content/jsutil/rdf/RDFArray.js
+++ /dev/null
@@ -1,196 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/***************************************************************
-* RDFArray -----------------------------------------------
-* A convenience routine for creating an RDF-based 2d array
-* indexed by number and hashkey.
-* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-* REQUIRED IMPORTS:
-* chrome://inspector/content/utils.js
-* chrome://inspector/content/jsutil/xpcom/XPCU.js
-* chrome://inspector/content/jsutil/rdf/RDFU.js
-****************************************************************/
-
-//////////// global constants ////////////////////
-
-RDFArray.URI = "http://www.joehewitt.com/mozilla/util/RDFArray#";
-RDFArray.RDF_URI = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
-
-///// class RDFArray /////////////////////////
-
-function RDFArray(aNSURI, aRootURN, aArcName)
-{
- this.mNSURI = aNSURI;
- this.mRootURN = aRootURN;
- this.mArcName = aArcName ? aArcName : "list";
-}
-
-RDFArray.prototype = {
- get datasource() { return this.mDS; },
- get length() { return this.mLength } ,
-
- initialize: function()
- {
- this.mLength = 0;
-
- this.mDS = XPCU.createInstance("@mozilla.org/rdf/datasource;1?name=in-memory-datasource", "nsIRDFDataSource");
-
- var root = gRDF.GetResource(this.mRootURN);
- var res = gRDF.GetAnonymousResource();
- this.mDS.Assert(root, gRDF.GetResource(this.mNSURI+this.mArcName), res, true);
-
- this.mSeq = gRDFCU.MakeSeq(this.mDS, res);
- },
-
- add: function(aObject)
- {
- var res = this.createResourceFrom(aObject);
- this.addResource(res);
- },
-
- addResource: function(aResource)
- {
- this.mSeq.AppendElement(aResource);
- this.mLength++;
- },
-
- insertAt: function(aIndex, aObject)
- {
- var res = this.createResourceFrom(aObject);
- this.insertResourceAt(aIndex, res);
- },
-
- insertResourceAt: function(aIndex, aResource)
- {
- },
-
- removeAt: function(aIndex)
- {
- this.mSeq.RemoveElementAt(aIndex+1, true);
- this.mLength--;
- },
-
- removeById: function(aId)
- {
- var proj = gRDF.GetResource(aId);
- proj = XPCU.QI(proj, "nsIRDFNode");
- this.mSeq.RemoveElement(proj, true);
- this.mLength--;
- },
-
- get: function(aIndex, aKey)
- {
- var res = RDFU.getSeqElementAt(this.mSeq, aIndex);
- return RDFU.readAttribute(this.mDS, res, this.mNSURI+aKey);
- },
-
- set: function(aIndex, aKey, aValue)
- {
- var res = RDFU.getSeqElementAt(this.mSeq, aIndex);
- RDFU.writeAttribute(this.mDS, res, this.mNSURI+aKey, aValue);
- },
-
- getResource: function(aIndex)
- {
- return RDFU.getSeqElementAt(this.mSeq, aIndex);
- },
-
- getResourceId: function(aIndex)
- {
- var el = RDFU.getSeqElementAt(this.mSeq, aIndex);
- return el.Value;
- },
-
- save: function()
- {
- RDFU.saveDataSource(this.mDS);
- },
-
-
- clear: function()
- {
- while (this.mLength) {
- this.mSeq.RemoveElementAt(1, true);
- this.mLength--;
- }
- },
-
- createResourceFrom: function(aObject)
- {
- var el = gRDF.GetAnonymousResource();
-
- // add a literal node for each property being added
- for (var name in aObject) {
- this.mDS.Assert(el, gRDF.GetResource(this.mNSURI+name), gRDF.GetLiteral(aObject[name]), true);
- }
-
- return el;
- }
-
-};
-
-/////////// static factory methods /////////////////////////
-
-RDFArray.fromContainer = function(aDS, aResourceID, aNSURI)
-{
- var list = new RDFArray(aNSURI);
-
- list.mDS = aDS;
- var seq = RDFU.findSeq(aDS, aResourceID);
- list.mSeq = seq;
- list.mLength = seq.GetCount();
-
- return list;
-}
-
-RDFArray.fromContainerArc = function(aDS, aSourceId, aTargetId, aNSURI)
-{
- var list = new RDFArray(aNSURI);
- list.mDS = aDS;
-
- var source = gRDF.GetResource(aSourceId);
- var target = gRDF.GetResource(aTargetId);
- var seqRes = aDS.GetTarget(source, target, true);
-
- var seq = RDFU.makeSeq(aDS, seqRes);
- list.mSeq = seq;
- list.mLength = seq.GetCount();
-
- return list;
-}
-
deleted file mode 100644
--- a/extensions/inspector/resources/content/jsutil/rdf/RDFU.js
+++ /dev/null
@@ -1,154 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/***************************************************************
-* RDFU -----------------------------------------------
-* Convenience routines for common RDF commands.
-* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-* REQUIRED IMPORTS:
-* chrome://inspector/content/jsutil/xpcom/XPCU.js
-****************************************************************/
-
-//////////// global constants ////////////////////
-
-try {
-var gRDF = Components.classes['@mozilla.org/rdf/rdf-service;1'].getService();
-gRDF = gRDF.QueryInterface(Components.interfaces.nsIRDFService);
-
-var gRDFCU = Components.classes['@mozilla.org/rdf/container-utils;1'].getService();
-gRDFCU = gRDFCU.QueryInterface(Components.interfaces.nsIRDFContainerUtils);
-} catch (ex) { alert("RDFU: " + ex); }
-///////////////////////////////////////////////////
-
-var RDFU = {
-
- getSeqElementAt: function(aSeq, aIndex)
- {
- var ordinal = gRDFCU.IndexToOrdinalResource(aIndex+1);
- return aSeq.DataSource.GetTarget(aSeq.Resource, ordinal, true);
- },
-
- readAttribute: function(aDS, aRes, aName)
- {
- var attr = aDS.GetTarget(aRes, gRDF.GetResource(aName), true);
- if (attr)
- attr = XPCU.QI(attr, "nsIRDFLiteral");
- return attr ? attr.Value : null;
- },
-
-
- writeAttribute: function(aDS, aRes, aName, aValue)
- {
- var attr = aDS.GetTarget(aRes, gRDF.GetResource(aName), true);
- if (attr)
- aDS.Change(aRes, gRDF.GetResource(aName), attr, gRDF.GetLiteral(aValue));
- },
-
-
- findSeq: function(aDS, aResName)
- {
- try {
- var res = gRDF.GetResource(aResName);
- var seq = this.makeSeq(aDS, res);
- } catch (ex) {
- alert("Unable to find sequence:" + ex);
- }
-
- return seq;
- },
-
- makeSeq: function(aDS, aRes)
- {
- var seq = XPCU.createInstance("@mozilla.org/rdf/container;1", "nsIRDFContainer");
- seq.Init(aDS, aRes);
- return seq;
- },
-
- createSeq: function(aDS, aBaseRes, aArcRes)
- {
- var res = gRDF.GetAnonymousResource();
- aDS.Assert(aBaseRes, aArcRes, res, true);
- var seq = gRDFCU.MakeSeq(aDS, res);
- return seq;
- },
-
- loadDataSource: function(aURL, aListener)
- {
- var ds = gRDF.GetDataSource(aURL);
- var rds = XPCU.QI(ds, "nsIRDFRemoteDataSource");
-
- var observer = new DSLoadObserver(aListener);
-
- if (rds.loaded) {
- observer.onEndLoad(ds);
- } else {
- var sink = XPCU.QI(ds, "nsIRDFXMLSink");
- sink.addXMLSinkObserver(observer);
- }
- },
-
- saveDataSource: function(aDS)
- {
- var ds = XPCU.QI(aDS, "nsIRDFRemoteDataSource");
- ds.Flush();
- }
-};
-
-///////////
-
-function DSLoadObserver(aListener) { this.mListener = aListener; }
-
-DSLoadObserver.prototype =
-{
- onBeginLoad: function(aSink) { },
- onInterrupt: function(aSink) {},
- onResume: function(aSink) {},
- onError: function(aSink, aStatus, aErrorMsg)
- {
- this.mListener.onError(aStatus, aErrorMsg);
- aSink.removeXMLSinkObserver(this);
- },
-
- onEndLoad: function(aSink)
- {
- var ds = XPCU.QI(aSink, "nsIRDFDataSource");
- this.mListener.onDataSourceReady(ds);
- aSink = XPCU.QI(aSink, "nsIRDFXMLSink");
- aSink.removeXMLSinkObserver(this);
- }
-
-};
deleted file mode 100644
--- a/extensions/inspector/resources/content/jsutil/system/DiskSearch.js
+++ /dev/null
@@ -1,99 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/***************************************************************
-* DiskSearch -------------------------------------------------
-* A utility for handily searching the disk for files matching
-* a certain criteria.
-* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-* REQUIRED IMPORTS:
-****************************************************************/
-
-//////////// global variables /////////////////////
-
-//////////// global constants ////////////////////
-
-////////////////////////////////////////////////////////////////////////////
-//// class DiskSearch
-
-var DiskSearch =
-{
- findFiles: function(aRootDir, aExtList, aRecurse)
- {
- // has the file extensions so we don't have to
- // linear search the array every time through
- var extHash = {};
- for (var i = 0; i < aExtList.length; i++) {
- extHash[aExtList[i]] = true;
- }
-
- var ios = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService);
- this.fileHandler = ios.getProtocolHandler("file").QueryInterface(Components.interfaces.nsIFileProtocolHandler);
-
- // recursively build the list of results
- var results = [];
- this.recurseDir(aRootDir, extHash, aRecurse, results);
- return results;
- },
-
- recurseDir: function(aDir, aExtHash, aRecurse, aResults)
- {
- debug("("+aResults.length+") entering " + aDir.path + "\n");
- var entries = aDir.directoryEntries;
- var entry, ext;
- while (entries.hasMoreElements()) {
- entry = XPCU.QI(entries.getNext(), "nsIFile");
- if (aRecurse && entry.isDirectory())
- this.recurseDir(entry, aExtHash, aRecurse, aResults);
- ext = this.getExtension(entry.leafName);
- if (ext) {
- if (aExtHash[ext])
- aResults.push(this.fileHandler.getURLSpecFromFile(entry));
- }
- }
- },
-
- getExtension: function(aFileName)
- {
- var dotpt = aFileName.lastIndexOf(".");
- if (dotpt)
- return aFileName.substr(dotpt+1).toLowerCase();
-
- return null;
- }
-};
-
deleted file mode 100644
--- a/extensions/inspector/resources/content/jsutil/system/FilePickerUtils.js
+++ /dev/null
@@ -1,123 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/***************************************************************
-* FilePickerUtils -------------------------------------------------
-* A utility for easily dealing with the file picker dialog.
-* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-* REQUIRED IMPORTS:
-****************************************************************/
-
-//////////// global constants ////////////////////
-
-const kFilePickerCID = "@mozilla.org/filepicker;1";
-const kLFileCID = "@mozilla.org/file/local;1";
-
-const nsIFilePicker = Components.interfaces.nsIFilePicker;
-
-////////////////////////////////////////////////////////////////////////////
-//// class FilePickerUtils
-
-var FilePickerUtils =
-{
- pickFile: function(aTitle, aInitPath, aFilters, aMode)
- {
- try {
- var modeStr = aMode ? "mode" + aMode : "modeOpen";
- var mode;
- try {
- mode = nsIFilePicker[modeStr];
- } catch (ex) {
- dump("WARNING: Invalid FilePicker mode '"+aMode+"'. Defaulting to 'Open'.\n");
- mode = nsIFilePicker.modeOpen;
- }
-
- var fp = XPCU.createInstance(kFilePickerCID, "nsIFilePicker");
- fp.init(window, aTitle, mode);
-
- // join array of filter names into bit string
- var filters = this.prepareFilters(aFilters);
-
- if (aInitPath) {
- var dir = XPCU.createInstance(kLFileCID, "nsILocalFile");
- dir.initWithPath(aInitPath);
- fp.displayDirectory = dir;
- }
-
- if (fp.show() == nsIFilePicker.returnOK) {
- return fp.file;
- }
- } catch (ex) {
- dump("ERROR: Unable to open file picker.\n" + ex + "\n");
- }
- return null;
- },
-
- pickDir: function(aTitle, aInitPath)
- {
- try {
- var fp = XPCU.createInstance(kFilePickerCID, "nsIFilePicker");
- fp.init(window, aTitle, nsIFilePicker.modeGetFolder);
-
- if (aInitPath) {
- var dir = XPCU.createInstance(kLFileCID, "nsILocalFile");
- dir.initWithPath(aInitPath);
- fp.displayDirectory = dir;
- }
-
- if (fp.show() == nsIFilePicker.returnOK) {
- return fp.file;
- }
- } catch (ex) {
- dump("ERROR: Unable to open directory picker.\n" + ex + "\n");
- }
-
- return null;
- },
-
- prepareFilters: function(aFilters)
- {
- // join array of filter names into bit string
- var filters = 0;
- for (var i = 0; i < aFilters.length; ++i)
- filters = filters | nsIFilePicker[aFilters[i]];
-
- return filters;
- }
-
-};
-
deleted file mode 100644
--- a/extensions/inspector/resources/content/jsutil/system/PrefUtils.js
+++ /dev/null
@@ -1,123 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/***************************************************************
-* PrefUtils -------------------------------------------------
-* Utility for easily using the Mozilla preferences system.
-* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-* REQUIRED IMPORTS:
-****************************************************************/
-
-//////////// global variables /////////////////////
-
-//////////// global constants ////////////////////
-
-const nsIPrefBranch = Components.interfaces.nsIPrefBranch;
-
-////////////////////////////////////////////////////////////////////////////
-//// class PrefUtils
-
-var PrefUtils =
-{
- mPrefs: null,
-
- init: function()
- {
- var prefService = XPCU.getService("@mozilla.org/preferences-service;1", "nsIPrefService");
- this.mPrefs = prefService.getBranch(null);
- },
-
- addObserver: function addObserver(aDomain, aFunction)
- {
- if (!this.mPrefs) this.init();
-
- var pbi = XPCU.QI(this.mPrefs, "nsIPrefBranch2");
- if (pbi)
- pbi.addObserver(aDomain, aFunction, false);
- },
-
- removeObserver: function removeObserver(aDomain, aFunction)
- {
- if (!this.mPrefs) this.init();
-
- var pbi = XPCU.QI(this.mPrefs, "nsIPrefBranch2");
- if (pbi)
- pbi.removeObserver(aDomain, aFunction);
- },
-
- setPref: function(aName, aValue)
- {
- if (!this.mPrefs) this.init();
-
- var type = this.mPrefs.getPrefType(aName);
- try {
- if (type == nsIPrefBranch.PREF_STRING) {
- var str = Components.classes["@mozilla.org/supports-string;1"]
- .createInstance(Components.interfaces.nsISupportsString);
- str.data = aValue;
- this.mPrefs.setComplexValue(aName, Components.interfaces.nsISupportsString, str);
- } else if (type == nsIPrefBranch.PREF_BOOL) {
- this.mPrefs.setBoolPref(aName, aValue);
- } else if (type == nsIPrefBranch.PREF_INT) {
- this.mPrefs.setIntPref(aName, aValue);
- }
- } catch(ex) {
- debug("ERROR: Unable to write pref \"" + aName + "\".\n");
- }
- },
-
- getPref: function(aName)
- {
- if (!this.mPrefs) this.init();
-
- var type = this.mPrefs.getPrefType(aName);
- try {
- if (type == nsIPrefBranch.PREF_STRING) {
- return this.mPrefs.getComplexValue(aName, Components.interfaces.nsISupportsString).data;
- } else if (type == nsIPrefBranch.PREF_BOOL) {
- return this.mPrefs.getBoolPref(aName);
- } else if (type == nsIPrefBranch.PREF_INT) {
- return this.mPrefs.getIntPref(aName);
- }
- } catch(ex) {
- debug("ERROR: Unable to read pref \"" + aName + "\".\n");
- }
- return null;
- }
-
-};
-
deleted file mode 100644
--- a/extensions/inspector/resources/content/jsutil/system/file.js
+++ /dev/null
@@ -1,649 +0,0 @@
-/*** -*- Mode: Javascript; tab-width: 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 Collabnet code. The Initial Developer of the Original Code is Collabnet.
-
- The Initial Developer of the Original Code is
- Collabnet.
- Portions created by the Initial Developer are Copyright (C) 2000
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- Pete Collins, Doug Turner, Brendan Eich, Warren Harris, Eric Plaster
-
- 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 ***** */
-
-/****************** Globals **********************/
-
-const JSLIB_FILE = "file.js";
-
-const JSFILE_LOCAL_CID = "@mozilla.org/file/local;1";
-const JSFILE_F_CHANNEL_CID = "@mozilla.org/network/file-input-stream;1";
-const JSFILE_I_STREAM_CID = "@mozilla.org/scriptableinputstream;1";
-
-const JSFILE_I_LOCAL_FILE = "nsILocalFile";
-const JSFILE_I_FILE_CHANNEL = "nsIFileChannel";
-const JSFILE_I_SCRIPTABLE_IN_STREAM = "nsIScriptableInputStream";
-
-const JSFILE_INIT_W_PATH = "initWithPath";
-
-const JSFILE_READ = 0x01; // 1
-const JSFILE_WRITE = 0x08; // 8
-const JSFILE_APPEND = 0x10; // 16
-
-const JSFILE_READ_MODE = "r";
-const JSFILE_WRITE_MODE = "w";
-const JSFILE_APPEND_MODE = "a";
-
-const JSFILE_FILETYPE = 0x00; // 0
-
-const JSFILE_CHUNK = 1024; // buffer for readline => set to 1k
-
-const JSFILE_OK = true;
-
-const JSFILE_FilePath = new Components.Constructor( JSFILE_LOCAL_CID, JSFILE_I_LOCAL_FILE, JSFILE_INIT_W_PATH);
-const JSFILE_FileChannel = new Components.Constructor( JSFILE_F_CHANNEL_CID, JSFILE_I_FILE_CHANNEL );
-const JSFILE_InputStream = new Components.Constructor( JSFILE_I_STREAM_CID, JSFILE_I_SCRIPTABLE_IN_STREAM );
-
-/****************** Globals **********************/
-
-
-/****************** File Object Class *********************/
-
-function File(aPath) {
- if(aPath)
- this.mPath= aPath;
-} // constructor
-
-File.prototype = {
-
- mPath : null,
- mode : null,
- fileInst : null,
- fileChannel : null,
- inputStream : null,
- lineBuffer : null,
-
-/********************* OPEN *****************************/
-open : function(aSetMode)
-{
-
- if(!this.mPath)
- {
- dump(JSLIB_FILE+":open:ERROR: Missing member path argument\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_NOT_INITIALIZED;
- }
-
- this.close();
- if(!aSetMode)
- aSetMode=JSFILE_READ_MODE;
-
- try { this.fileInst = new JSFILE_FilePath(this.mPath); }
-
- catch (e)
- {
- dump(JSLIB_FILE+":open:ERROR: UNEXPECTED"+e.name+" "+e.message+"\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_UNEXPECTED;
- }
-
-var fileExists = this.exists();
-
- if(fileExists) {
- if(this.fileInst.isDirectory())
- {
- dump(JSLIB_FILE+":open:ERROR: Can't open directory "+this.mPath+" as a file!\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_FAILURE;
- }
- }
-
- var retval;
- switch(aSetMode)
- {
- case JSFILE_WRITE_MODE:
- {
- if(fileExists)
- {
- try
- {
- this.fileInst.remove(false);
- fileExists=false;
- }
-
- catch(e)
- {
- dump(JSLIB_FILE+":open:ERROR: Failed to delete file "+this.mPath+"\nNS_ERROR_NUMBER: ");
- this.close();
- return Components.results.NS_ERROR_FAILURE;
- }
- }
-
- if (!fileExists)
- {
- try
- {
- this.fileInst.create(JSFILE_FILETYPE, 0644);
- fileExists=true;
- }
-
- catch(e)
- {
- dump(JSLIB_FILE+":open:ERROR: Failed to create file "+this.mPath+"\nNS_ERROR_NUMBER: ");
- this.close();
- return Components.results.NS_ERROR_FAILURE;
- }
- }
-
- this.mode=JSFILE_WRITE;
- retval=JSFILE_OK;
- break;
- }
-
- case JSFILE_APPEND_MODE:
- {
- if(!fileExists)
- {
- try
- {
- this.fileInst.create(JSFILE_FILETYPE, 0644);
- fileExists=true;
- }
-
- catch(e)
- {
- dump(JSLIB_FILE+":open:ERROR: Failed to create file "+this.mPath+"\nNS_ERROR_NUMBER: ");
- this.close();
- return Components.results.NS_ERROR_FAILURE;
- }
- }
-
- this.mode=JSFILE_APPEND;
- retval=JSFILE_OK;
- break;
- }
-
- case JSFILE_READ_MODE:
- {
- if(!fileExists)
- {
- dump(JSLIB_FILE+"open:ERROR: "+this.mPath+" doesn't exist!\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_FAILURE
- }
-
- try {
- this.lineBuffer = new Array();
- this.fileChannel = new JSFILE_FileChannel();
- this.inputStream = new JSFILE_InputStream();
-
- try { var perm = this.fileInst.permissions; }
-
- catch(e){ perm=null; }
-
- this.fileChannel.init(this.fileInst, JSFILE_READ, perm);
- this.inputStream.init(this.fileChannel.openInputStream());
- retval=JSFILE_OK;
- }
-
- catch (e)
- {
- dump(JSLIB_FILE+":open:ERROR: reading... "+e.name+" "+e.message+"\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_FAILURE;
- }
-
- break;
- }
-
- default:
- dump(JSLIB_FILE+":open:WARNING: \""+setMode+"\" is an Invalid file mode\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_INVALID_ARG;
- }
-
- return retval;
-},
-
-/********************* EXISTS ***************************/
-exists : function ()
-{
- var retval = null;
-
- try
- {
- var file = new JSFILE_FilePath(this.mPath);
- retval=file.exists();
- }
-
- catch(e)
- {
- dump(JSLIB_FILE+":exists:ERROR: "+e.name+"\n"+e.message+"\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_UNEXPECTED;
- }
-
- return retval;
-},
-
-/********************* WRITE ****************************/
-write : function(aBuffer, aPerms)
-{
- if(!this.fileInst)
- {
- dump(JSLIB_FILE+":write:ERROR: Please open a file handle first\n NS_ERROR_NUMBER:");
- return Components.results.NS_ERROR_NOT_INITIALIZED;
- }
-
- if(!aBuffer)
- throw(JSLIB_FILE+":write:ERROR: must have a buffer to write!\n");
-
- if(this.mode == JSFILE_READ)
- throw(JSLIB_FILE+":write:ERROR: not in write or append mode!\n");
-
- var buffSize = aBuffer.length;
-
- try
- {
- if(!this.fileChannel)
- this.fileChannel = new JSFILE_FileChannel();
-
- if(aPerms)
- {
- var checkPerms = this.validatePermissions(aPerms);
-
- if(!checkPerms)
- {
- dump(JSLIB_FILE+":write:ERROR: invalid permissions set: "+aPerms+"\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_INVALID_ARG
- }
- }
-
- if(!aPerms)
- aPerms=0644;
-
- this.fileChannel.init(this.fileInst, this.mode, aPerms);
- try
- {
- this.fileInst.permissions=aPerms;
- }
-
- catch(e){ }
-
- var outStream = this.fileChannel.openOutputStream();
-
- outStream.write(aBuffer, buffSize);
- outStream.flush();
- outStream.close();
- }
-
- catch (e)
- {
- dump(JSLIB_FILE+":write:ERROR: "+e.name+"\n"+e.message+"\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_UNEXPECTED;
- }
-
- return JSFILE_OK;
-},
-
-/********************* READ *****************************/
-read : function()
-{
- var retval = null;
-
- try
- {
- if(!this.fileInst || !this.inputStream)
- {
- dump(JSLIB_FILE+":read:ERROR: Please open a valid file handle for reading\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_NOT_INITIALIZED;
- }
-
- retval = this.inputStream.read(this.fileInst.fileSize);
- this.inputStream.close();
- }
-
- catch (e)
- {
- dump(JSLIB_FILE+":read:ERROR: "+e.name+"\n"+e.message+"\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_FAILURE;
- }
-
- return retval;
-},
-
-eof : function()
-{
- if(!this.fileInst || !this.inputStream)
- {
- dump(JSLIB_FILE+":readline:ERROR: Please open a valid file handle for reading\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_NOT_INITIALIZED;
- }
-
- if((this.lineBuffer.length > 0) || (this.inputStream.available() > 0))
- return false;
-
- else
- return JSFILE_OK;
-
-},
-
-/********************* READLINE *****************************/
-readline : function()
-{
- var retval = null;
- var buf = null;
-
- try
- {
- if(!this.fileInst || !this.inputStream)
- {
- dump(JSLIB_FILE+":readline:ERROR: Please open a valid file handle for reading\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_NOT_INITIALIZED;
- }
-
- if(this.lineBuffer.length < 2) {
- buf = this.inputStream.read(JSFILE_CHUNK);
- if(buf) {
- var tmp = null;
- if(this.lineBuffer.length == 1) {
- tmp = this.lineBuffer.shift();
- buf = tmp+buf;
- }
- this.lineBuffer = buf.split(/[\n\r]/);
- }
- }
- retval = this.lineBuffer.shift();
- }
-
- catch (e)
- {
- dump(JSLIB_FILE+":readline:ERROR: "+e.name+" "+e.message+"\nNS_ERROR_NUMBER: ");
- throw(e);
- }
-
- return retval;
-},
-
-/********************* PATH *****************************/
-path : function () { return this.mPath; },
-/********************* PATH *****************************/
-
-/********************* LEAF *****************************/
-leaf : function ()
-{
- if(!this.mPath)
- {
- dump(JSLIB_FILE+":leaf:ERROR: Missing path argument\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_INVALID_ARG;
- }
-
- if(!this.exists())
- {
- dump(JSLIB_FILE+":leaf:ERROR: File doesn't exist\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_FAILURE;
- }
-
- var retval;
- try
- {
- var fileInst = new JSFILE_FilePath(this.mPath);
- retval=fileInst.leafName;
- }
-
- catch(e)
- {
- dump(JSLIB_FILE+":leaf:ERROR: "+e.name+"\n"+e.message+"\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_FAILURE;
- }
-
- return retval;
-},
-
-/********************* VALIDATE PERMISSIONS *************/
-validatePermissions : function(aNum)
-{
- if ( parseInt(aNum.toString(10).length) < 3 )
- return false;
-
- return JSFILE_OK;
-},
-
-/********************* PERMISSIONS **********************/
-permissions : function ()
-{
- if(!this.mPath)
- {
- dump(JSLIB_FILE+":permissions:ERROR: Missing path argument\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_XPC_NOT_ENOUGH_ARGS;
- }
-
- if(!this.exists())
- {
- dump(JSLIB_FILE+":permissions:ERROR: File doesn't exist\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_FAILURE;
- }
-
- var retval;
- try
- {
- var fileInst = new JSFILE_FilePath(this.mPath);
- retval=fileInst.permissions.toString(8);
- }
-
- catch(e)
- {
- dump(JSLIB_FILE+":permissions:ERROR: "+e.name+"\n"+e.message+"\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_UNEXPECTED;
- }
-
- return retval;
-},
-
-/********************* MODIFIED *************************/
-dateModified : function ()
-{
- if(!this.mPath)
- {
- dump(JSLIB_FILE+":dateModified:ERROR: Missing path argument\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_XPC_NOT_ENOUGH_ARGS;
- }
-
- if(!this.exists())
- {
- dump(JSLIB_FILE+":dateModified:ERROR: File doesn't exist\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_FAILURE;
- }
-
- var retval;
- try
- {
- var fileInst = new JSFILE_FilePath(this.mPath);
- var date = new Date(fileInst.lastModifiedTime).toLocaleString();
- retval=date;
- }
-
- catch(e)
- {
- dump(JSLIB_FILE+":dateModified:ERROR: "+e.name+"\n"+e.message+"\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_UNEXPECTED;
- }
-
- return retval;
-},
-
-/********************* SIZE *****************************/
-size : function ()
-{
- if(!this.mPath)
- {
- dump(JSLIB_FILE+":size:ERROR: Missing member path argument\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_NOT_INITIALIZED;
- }
-
- if(!this.exists())
- {
- dump(JSLIB_FILE+":size:ERROR: File doesn't exist\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_FAILURE;
- }
-
- var retval;
- try
- {
- var fileInst = new JSFILE_FilePath(this.mPath);
- retval = fileInst.fileSize;
- }
-
- catch(e)
- {
- dump(JSLIB_FILE+":size:ERROR: "+e.name+"\n"+e.message+"\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_UNEXPECTED;
- }
-
- return retval;
-},
-
-/********************* EXTENSION ************************/
-extension : function ()
-{
- if(!this.mPath)
- {
- dump(JSLIB_FILE+":extension:ERROR: Missing member path argument\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_NOT_INITIALIZED;
- }
-
- if(!this.exists())
- {
- dump(JSLIB_FILE+":extension:ERROR: File doesn't exist\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_FAILURE;
- }
-
- var retval;
- try
- {
- var fileInst = new JSFILE_FilePath(this.mPath);
- var leafName = fileInst.leafName;
- var dotIndex = leafName.lastIndexOf('.');
- retval=(dotIndex >= 0) ? leafName.substring(dotIndex+1) : "";
- }
-
- catch(e)
- {
- dump(JSLIB_FILE+":extension:ERROR: "+e.name+"\n"+e.message+"\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_UNEXPECTED;
- }
-
- return retval;
-},
-
-/********************* DIRPATH **************************/
-dirPath : function ()
-{
- if(!this.mPath)
- {
- dump(JSLIB_FILE+":dirPath:ERROR: Missing member path argument\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_NOT_INITIALIZED;
- }
-
- var retval;
- try
- {
- var fileInst = new JSFILE_FilePath(this.mPath);
-
- if(fileInst.isFile())
- retval=fileInst.path.replace(this.leaf(), "");
-
- if(fileInst.isDirectory())
- retval=fileInst.path;
- }
- catch (e)
- {
- dump(JSLIB_FILE+":dirPath:ERROR: "+e.name+"\n"+e.message+"\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_UNEXPECTED;
- }
-
- return retval;
-},
-
-/********************* nsIFILE **************************/
-nsIFile : function ()
-{
- if(!this.mPath)
- {
- dump(JSLIB_FILE+":nsIFile:ERROR: Missing member path argument\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_NOT_INITIALIZED;
- }
-
- var retval;
- try
- {
- retval = new JSFILE_FilePath(this.mPath);
- }
-
- catch (e)
- {
- dump(JSLIB_FILE+":nsIFile:ERROR: "+e.name+"\n"+e.message+"\nNS_ERROR_NUMBER: ");
- return Components.results.NS_ERROR_UNEXPECTED;
- }
-
- return retval;
-},
-
-/********************* HELP *****************************/
-help : function()
-{
- var help =
-
- "\n\nFunction List:\n" +
- "\n" +
- " open(aMode);\n" +
- " exists();\n" +
- " read();\n" +
- " readline(aDone);\n" +
- " write(aContents, aPermissions);\n" +
- " leaf();\n" +
- " permissions();\n" +
- " dateModified();\n" +
- " size();\n" +
- " extension();\n" +
- " dirPath();\n" +
- " nsIFile();\n" +
- " help();\n";
-
- dump(help+"\n");
-
- return "";
-},
-
-/********************* CLOSE ****************************/
-close : function()
-{
- /***************** Destroy Instances *********************/
- if(this.fileInst) delete this.fileInst;
- if(this.fileChannel) delete this.fileChannel;
- if(this.inputStream) delete this.inputStream;
- if(this.mode) this.mode=null;
- /***************** Destroy Instances *********************/
-
- return JSFILE_OK;
-}
-};
-
deleted file mode 100644
--- a/extensions/inspector/resources/content/jsutil/xpcom/XPCU.js
+++ /dev/null
@@ -1,69 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-var XPCU =
-{
- getService: function(aURL, aInterface)
- {
- try {
- return Components.classes[aURL].getService(Components.interfaces[aInterface]);
- } catch (ex) {
- dump("Error getting service: " + aURL + ", " + aInterface + "\n" + ex);
- return null;
- }
- },
-
- createInstance: function (aURL, aInterface)
- {
- try {
- return Components.classes[aURL].createInstance(Components.interfaces[aInterface]);
- } catch (ex) {
- dump("Error creating instance: " + aURL + ", " + aInterface + "\n" + ex);
- return null;
- }
- },
-
- QI: function(aEl, aIName)
- {
- try {
- return aEl.QueryInterface(Components.interfaces[aIName]);
- } catch (ex) {
- throw("Unable to QI " + aEl + " to " + aIName);
- }
- }
-
-};
\ No newline at end of file
deleted file mode 100644
--- a/extensions/inspector/resources/content/jsutil/xul/DNDUtils.js
+++ /dev/null
@@ -1,116 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/***************************************************************
-* DNDUtils -------------------------------------------------
-* Utility functions for common drag and drop tasks.
-* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-* REQUIRED IMPORTS:
-****************************************************************/
-
-//////////// global variables /////////////////////
-
-var app;
-
-//////////// global constants ////////////////////
-
-////////////////////////////////////////////////////////////////////////////
-//// class DNDUtils
-
-var DNDUtils =
-{
- invokeSession: function(aTarget, aTypes, aValues)
- {
- var transData, trans, supports;
- var transArray = XPCU.createInstance("@mozilla.org/supports-array;1", "nsISupportsArray");
- for (var i = 0; i < aTypes.length; ++i) {
- transData = this.createTransferableData(aValues[i]);
- trans = XPCU.createInstance("@mozilla.org/widget/transferable;1", "nsITransferable");
- trans.addDataFlavor(aTypes[i]);
- trans.setTransferData (aTypes[i], transData.data, transData.size);
- supports = trans.QueryInterface(Components.interfaces.nsISupports);
- transArray.AppendElement(supports);
- }
-
- var nsIDragService = Components.interfaces.nsIDragService;
- var dragService = XPCU.getService("@mozilla.org/widget/dragservice;1", "nsIDragService");
- dragService.invokeDragSession(aTarget, transArray, null, nsIDragService.DRAGDROP_ACTION_MOVE);
- },
-
- createTransferableData: function(aValue)
- {
- var obj = {};
- if (typeof(aValue) == "string") {
- obj.data = XPCU.createInstance("@mozilla.org/supports-string;1", "nsISupportsString");
- obj.data.data = aValue;
- obj.size = aValue.length*2;
- } else if (false) {
- // TODO: create data for other primitive types
- }
-
- return obj;
- },
-
- checkCanDrop: function(aType)
- {
- var dragService = XPCU.getService("@mozilla.org/widget/dragservice;1", "nsIDragService");
- var dragSession = dragService.getCurrentSession();
-
- var gotFlavor = false;
- for (var i = 0; i < arguments.length; ++i)
- gotFlavor |= dragSession.isDataFlavorSupported(arguments[i]);
-
- dragSession.canDrop = gotFlavor;
- return gotFlavor;
- },
-
- getData: function(aType, aIndex)
- {
- var dragService = XPCU.getService("@mozilla.org/widget/dragservice;1", "nsIDragService");
- var dragSession = dragService.getCurrentSession();
-
- var trans = XPCU.createInstance("@mozilla.org/widget/transferable;1", "nsITransferable");
- trans.addDataFlavor(aType);
-
- dragSession.getData(trans, aIndex);
- var data = new Object();
- trans.getAnyTransferData ({}, data, {});
- return data.value;
- }
-
-};
-
deleted file mode 100644
--- a/extensions/inspector/resources/content/jsutil/xul/FrameExchange.js
+++ /dev/null
@@ -1,67 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/***************************************************************
-* FrameExchange ----------------------------------------------
-* Utility for passing specific data to a document loaded
-* through an iframe
-* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-* REQUIRED IMPORTS:
-****************************************************************/
-
-//////////// implementation ////////////////////
-
-var FrameExchange = {
- mData: {},
-
- loadURL: function(aFrame, aURL, aData)
- {
- this.mData[aURL] = aData;
- aFrame.setAttribute("src", aURL);
- },
-
- receiveData: function(aWindow)
- {
- var id = aWindow.location.href;
- var data = this.mData[id];
- this.mData[id] = null;
-
- return data;
- }
-};
-
-
deleted file mode 100644
--- a/extensions/inspector/resources/content/jsutil/xul/inBaseTreeView.js
+++ /dev/null
@@ -1,129 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/***************************************************************
-* inBaseTreeView -------------------------------------------------
-* Simple tree view object meant to be extended.
-*
-* Usage example: MyView.prototype = new inBaseTreeView();
-****************************************************************/
-
-//XXX Don't use anonymous functions
-function inBaseTreeView() { }
-
-inBaseTreeView.prototype =
-{
- mRowCount: 0,
- mTree: null,
-
- get rowCount() { return this.mRowCount; },
- setTree: function(aTree) { this.mTree = aTree; },
- getCellText: function(aRow, aCol) { return ""; },
- getRowProperties: function(aIndex, aProperties) {},
- getCellProperties: function(aIndex, aCol, aProperties) {},
- getColumnProperties: function(aCol, aProperties) {},
- getParentIndex: function(aRowIndex) { },
- hasNextSibling: function(aRowIndex, aAfterIndex) { },
- getLevel: function(aIndex) {},
- getImageSrc: function(aRow, aCol) {},
- getProgressMode: function(aRow, aCol) {},
- getCellValue: function(aRow, aCol) {},
- isContainer: function(aIndex) {},
- isContainerOpen: function(aIndex) {},
- isContainerEmpty: function(aIndex) {},
- isSeparator: function(aIndex) {},
- isSorted: function() {},
- toggleOpenState: function(aIndex) {},
- selectionChanged: function() {},
- cycleHeader: function(aCol) {},
- cycleCell: function(aRow, aCol) {},
- isEditable: function(aRow, aCol) {},
- isSelectable: function(aRow, aCol) {},
- setCellValue: function(aRow, aCol, aValue) {},
- setCellText: function(aRow, aCol, aValue) {},
- performAction: function(aAction) {},
- performActionOnRow: function(aAction, aRow) {},
- performActionOnCell: function(aAction, aRow, aCol) {},
-
-
- // extra utility stuff
-
- createAtom: function createAtom(aVal)
- {
- try {
- var i = Components.interfaces.nsIAtomService;
- var svc = Components.classes["@mozilla.org/atom-service;1"].getService(i);
- return svc.getAtom(aVal);
- } catch(ex) {
- return null;
- }
- },
-
- /**
- * Returns an array of selected indices in the tree.
- * @return an array of indices
- */
- getSelectedIndices: function getSelectedIndices()
- {
- var indices = [];
- var rangeCount = this.selection.getRangeCount();
- for (var i = 0; i < rangeCount; i++) {
- var start = {};
- var end = {};
- this.selection.getRangeAt(i,start,end);
- for (var c = start.value; c <= end.value; c++) {
- indices.push(c);
- }
- }
- return indices;
- },
-
- /**
- * Returns an array of row objects selected in the tree.
- * @return an array of row objects
- */
- getSelectedRowObjects: function getSelectedRowObjects()
- {
- var declarations = [];
- var indices = this.getSelectedIndices();
- for (var i = 0; i < indices.length; i++) {
- declarations.push(this.getRowObjectFromIndex(indices[i]));
- }
- return declarations;
- }
-
-};
deleted file mode 100644
--- a/extensions/inspector/resources/content/jsutil/xul/inFormManager.js
+++ /dev/null
@@ -1,144 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/***************************************************************
-* inFormManager -------------------------------------------------
-* Manages the reading and writing of forms via simple maps of
-* attribute/value pairs. A "form" is simply a XUL window which
-* contains "form widgets" such as textboxes and menulists.
-* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-* REQUIRED IMPORTS:
-****************************************************************/
-
-////////////////////////////////////////////////////////////////////////////
-//// class inFormManager
-
-var inFormManager =
-{
- // Object
- readWindow: function(aWindow, aIds)
- {
- var el, fn;
- var doc = aWindow.document;
- var map = {};
- for (var i = 0; i < aIds.length; i++) {
- el = doc.getElementById(aIds[i]);
- if (el) {
- this.persistIf(doc, el);
- fn = this["read_"+el.localName];
- if (fn)
- map[aIds[i]] = fn(el);
- }
- }
-
- return map;
- },
-
- // void
- writeWindow: function(aWindow, aMap)
- {
- var el, fn;
- var doc = aWindow.document;
- for (var i = 0; i < aIds.length; i++) {
- el = doc.getElementById(aIds[i]);
- if (el) {
- fn = this["write_"+el.localName];
- if (fn)
- fn(el, aMap[aIds[i]]);
- }
- }
- },
-
- persistIf: function(aDoc, aEl)
- {
- if (aEl.getAttribute("persist") == "true" && aEl.hasAttribute("id")) {
- aEl.setAttribute("value", aEl.value);
- aDoc.persist(aEl.getAttribute("id"), "value");
- }
- },
-
- read_textbox: function(aEl)
- {
- return aEl.value;
- },
-
- read_menulist: function(aEl)
- {
- return aEl.getAttribute("value");
- },
-
- read_checkbox: function(aEl)
- {
- return aEl.getAttribute("checked") == "true";
- },
-
- read_radiogroup: function(aEl)
- {
- return aEl.getAttribute("value");
- },
-
- read_colorpicker: function(aEl)
- {
- return aEl.getAttribute("color");
- },
-
- write_textbox: function(aEl, aValue)
- {
- aEl.setAttribute("value", aValue);
- },
-
- write_menulist: function(aEl, aValue)
- {
- aEl.setAttribute("value", aValue);
- },
-
- write_checkbox: function(aEl, aValue)
- {
- aEl.setAttribute("checked", aValue);
- },
-
- write_radiogroup: function(aEl, aValue)
- {
- aEl.setAttribute("value", aValue);
- },
-
- write_colorpicker: function(aEl, aValue)
- {
- aEl.color = aValue;
- }
-};
-
deleted file mode 100644
--- a/extensions/inspector/resources/content/jsutil/xul/inTreeBuilder.js
+++ /dev/null
@@ -1,669 +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 code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2001
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- * Joe Hewitt <hewitt@netscape.com> (original author)
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/***************************************************************
-* inTreeBuilder -------------------------------------------------
-* Automatically builds up an tree so that it will display a tabular
-* set of data with titled columns and optionally an icon for each row.
-* The tree that is supplied must have an treechildren with an
-* empty template inside of it.
-* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-* REQUIRED IMPORTS:
-* chrome://inspector/content/jsutil/xul/DNDUtils.js
-****************************************************************/
-
-//////////// global variables /////////////////////
-
-var inTreeBuilderPartCount = 0;
-
-//////////// global constants ////////////////////
-
-////////////////////////////////////////////////////////////////////////////
-//// class inTreeBuilder
-
-function inTreeBuilder(aTree, aNameSpace, aArcName)
-{
- this.tree = aTree;
- this.nameSpace = aNameSpace;
- this.arcName = aArcName;
-
- this.mColumns = [];
- this.mExtras = [];
-}
-
-inTreeBuilder.prototype =
-{
- mTree: null,
- mTreeBody: null,
- // datasource stuff
- mNameSpace: null,
- mArcName: null,
- mIsRefContainer: false,
- mIsContainer: true,
-
- // table structure stuff
- mIsIconic: false,
- mColumns: null,
- mSplitters: true,
- mRowFields: null,
- mRowAttrs: null,
- mAllowDND: false,
- mLastDragCol: null,
- mLastDragColWhere: null,
-
- ////////////////////////////////////////////////////////////////////////////
- //// properties
-
- // the xul tree node we will construct
- get tree() { return this.mTree },
- set tree(aVal)
- {
- this.mTree = aVal;
- if (aVal)
- this.mTreeBody = aVal.getElementsByTagName("treechildren")[0];
- aVal._treeBuilder = this
- },
-
- // the namespace to use for all fields
- get nameSpace() { return this.mNameSpace },
- set nameSpace(aVal) { this.mNameSpace = aVal },
-
- // the name of the arc to the container
- get arcName() { return this.mArcName },
- set arcName(aVal) { this.mArcName = aVal },
-
- // is the datasource ref an arc to a container, or a container itself
- get isRefContainer() { return this.mIsRefContainer },
- set isRefContainer(aVal) { this.mIsRefContainer = aVal },
-
- // is each row a potential container?
- get isContainer() { return this.mIsContainer },
- set isContainer(aVal) { this.mIsContainer = aVal },
-
- // place an icon before the first column of each row
- get isIconic() { return this.mIsIconic },
- set isIconic(aVal) { this.mIsIconic = aVal },
-
- // put splitters between the columns?
- get useSplitters() { return this.mSplitters },
- set useSplitters(aVal) { this.mSplitters = aVal },
-
- // extra attributes to set on the treeitem
- get rowAttributes() { return this.mRowAttrs },
- set rowAttributes(aVal) { this.mRowAttrs = aVal },
-
- // extra data fields to set on the treeitem
- get rowFields() { return this.mRowFields },
- set rowFields(aVal) { this.mRowFields = aVal },
-
- // extra data fields to set on the treeitem
- get allowDragColumns() { return this.mAllowDND },
- set allowDragColumns(aVal) { this.mAllowDND = aVal },
-
- ////////////////////////////////////////////////////////////////////////////
- //// event handlers
-
- get onColumnAdd() { return this.mOnColumnAdd },
- set onColumnAdd(aFn) { this.mOnColumnAdd = aFn },
-
- get onColumnRemove() { return this.mOnColumnRemove },
- set onColumnRemove(aFn) { this.mOnColumnRemove = aFn },
-
- ////////////////////////////////////////////////////////////////////////////
- //// initialization
-
- initialize: function()
- {
- this.initColumns();
- this.initTemplate();
- },
-
- initColumns: function()
- {
- this.initDND();
- },
-
- initTemplate: function()
- {
- var template = this.mTree.getElementsByTagNameNS(kXULNSURI, "template")[0];
- this.mTemplate = template;
- this.clearChildren(template);
-
- var rule = document.createElementNS(kXULNSURI, "rule");
- template.appendChild(rule);
- this.mRule = rule;
-
- this.createDefaultConditions();
-
- var bindings = document.createElementNS(kXULNSURI, "bindings");
- rule.appendChild(bindings);
- this.mBindings = bindings;
-
- this.createDefaultAction();
- },
-
- createDefaultConditions: function()
- {
- var conditions = document.createElementNS(kXULNSURI, "conditions");
- this.mRule.appendChild(conditions);
-
- var content = document.createElementNS(kXULNSURI, "treerow");
- content.setAttribute("uri", "?uri");
- conditions.appendChild(content);
-
- var triple = this.createTriple("?uri", this.mNameSpace+this.mArcName,
- this.mIsRefContainer ? "?table" : "?row");
- conditions.appendChild(triple);
-
- if (this.mIsRefContainer) {
- var member = this.createMember("?table", "?row");
- conditions.appendChild(member);
- }
- },
-
- createDefaultAction: function()
- {
- var action = document.createElementNS(kXULNSURI, "action");
- this.mRule.appendChild(action);
-
- var orow = this.createTemplatePart("treerow");
- orow.setAttribute("uri", "?row");
- action.appendChild(orow);
- this.mTreeRow = orow;
-
- // assign the item attributes
- if (this.mRowAttrs)
- for (key in this.mRowAttrs)
- orow.setAttribute(key, this.mRowAttrs[key]);
- },
-
- createDefaultBindings: function()
- {
- // assign the item fields
- var binding;
- if (this.mRowFields) {
- var props = "";
- for (key in this.mRowFields) {
- binding = this.createBinding(this.mRowFields[key]);
- this.mBindings.appendChild(binding);
- props += key+"-?"+this.mRowFields[key]+" ";
- }
- this.mTreeRow.setAttribute("properties", props);
- }
- },
-
- createTriple: function(aSubject, aPredicate, aObject)
- {
- var triple = document.createElementNS(kXULNSURI, "triple");
- triple.setAttribute("subject", aSubject);
- triple.setAttribute("predicate", aPredicate);
- triple.setAttribute("object", aObject);
-
- return triple;
- },
-
- createMember: function(aContainer, aChild)
- {
- var member = document.createElementNS(kXULNSURI, "member");
- member.setAttribute("container", aContainer);
- member.setAttribute("child", aChild);
-
- return member;
- },
-
- reset: function()
- {
- this.mColumns = [];
- this.mIsIconic = false;
-
- this.resetTree();
- },
-
- resetTree: function()
- {
- var kids = this.mTree.childNodes;
- for (var i = kids.length - 1; i >= 0; --i)
- if (kids[i].localName != "treechildren")
- this.mTree.removeChild(kids[i]);
-
- this.clearChildren(this.mBindings);
- this.clearChildren(this.mTreeRow);
- this.createDefaultBindings();
- },
-
- clearChildren: function(aEl)
- {
- while (aEl.hasChildNodes())
- aEl.removeChild(aEl.lastChild);
- },
-
- ////////////////////////////////////////////////////////////////////////////
- //// column drag and drop
-
- initDND: function()
- {
- if (this.mAllowDND) {
- // addEventListener doesn't work for dnd events, apparently... so we use the attributes
- this.addDNDListener(this.mTree, "ondragenter");
- this.addDNDListener(this.mTree, "ondragover");
- this.addDNDListener(this.mTree, "ondragexit");
- this.addDNDListener(this.mTree, "ondraggesture");
- this.addDNDListener(this.mTree, "ondragdrop");
- }
- },
-
- onDragEnter: function(aEvent)
- {
- },
-
- onDragOver: function(aEvent)
- {
- if (!DNDUtils.checkCanDrop("TreeBuilder/column-add"))
- return;
-
- var idx = this.getColumnIndexFromX(aEvent.clientX, 0.5);
- this.mColumnInsertIndex = idx;
- var col = this.getColumnAt(idx);
-
- if (idx == -1)
- this.markColumnInsert(col, "after");
- else
- this.markColumnInsert(col, "before");
- },
-
- onDragExit: function(aEvent)
- {
- },
-
- onDragDrop: function(aEvent)
- {
- this.markColumnInsert(null);
- var dragService = XPCU.getService("@mozilla.org/widget/dragservice;1", "nsIDragService");
- var dragSession = dragService.getCurrentSession();
-
- if (!dragSession.isDataFlavorSupported("TreeBuilder/column-add"))
- return false;
-
- var trans = XPCU.createInstance("@mozilla.org/widget/transferable;1", "nsITransferable");
- trans.addDataFlavor("TreeBuilder/column-add");
-
- dragSession.getData(trans, 0);
- var data = {};
- trans.getAnyTransferData ({}, data, {});
-