зеркало из https://github.com/mozilla/pjs.git
Bug 437064 - DOM Inspector should live in its own repository.
This removes all the files in extensions/inspector from mozilla-central. Those who still will to use the DOM Inspector should clone this hg repo: http://hg.mozilla.org/dom-inspector/
This commit is contained in:
Родитель
68e493056e
Коммит
1892dc4e5d
|
@ -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
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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;
|
||||
}
|
|
@ -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
|
||||
|
|
@ -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);
|
||||
}
|
|
@ -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>
|
|
@ -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)
|
|
@ -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
|
||||
"
|
|
@ -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
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
||||
};
|
||||
|
|
@ -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);
|
||||
}
|
||||
};
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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;
|
||||
}
|
|
@ -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>
|
|
@ -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;
|
||||
}
|
|
@ -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>
|
|
@ -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;
|
||||
}
|
|
@ -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>
|
|
@ -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();
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
||||
};
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
};
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
};
|
||||
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
|
@ -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;
|
||||
}
|
||||
|
||||
};
|
||||
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
};
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
@ -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, {});
|
||||
|
||||
var string = XPCU.QI(data.value, "nsISupportsString");
|
||||
|
||||
this.insertColumn(this.mColumnInsertIndex,
|
||||
{
|
||||
name: string.data,
|
||||
title: string.data,
|
||||
flex: 1
|
||||
});
|
||||
|
||||
|
||||
// if we rebuildContent during this thread, it will crash in the dnd service
|
||||
setTimeout(function(me) { me.build(); me.buildContent() }, 1, this);
|
||||
|
||||
// bug 56270 - dragSession.sourceDocument is null --
|
||||
// causes me to code this very temporary, very nasty hack
|
||||
// to tell columnsDialog.js about the drop
|
||||
if (this.mTree.onClientDrop) {
|
||||
this.mTree.onClientDrop();
|
||||
}
|
||||
},
|
||||
|
||||
markColumnInsert: function (aColumn, aWhere)
|
||||
{
|
||||
var col = this.mLastDragCol;
|
||||
var lastWhere = this.mLastDragColWhere;
|
||||
if (col)
|
||||
col.setAttribute("properties", "");
|
||||
|
||||
if (aWhere != "before" && aWhere != "after") {
|
||||
this.mLastDragCol = null;
|
||||
this.mLastDragColWhere = null;
|
||||
return;
|
||||
}
|
||||
|
||||
col = aColumn;
|
||||
if (col) {
|
||||
this.mLastDragCol = col;
|
||||
this.mLastDragColWhere = aWhere;
|
||||
col.setAttribute("properties", "dnd-insert-"+aWhere);
|
||||
}
|
||||
|
||||
var bx = this.mTree.boxObject.QueryInterface(Components.interfaces.nsITreeBoxObject);
|
||||
bx.invalidate();
|
||||
},
|
||||
|
||||
getColumnIndexFromX: function(aX, aThresh)
|
||||
{
|
||||
var width = 0;
|
||||
var col, cw;
|
||||
for (var i = 0; i < this.columnCount; ++i) {
|
||||
col = this.getColumnAt(i);
|
||||
cw = col.boxObject.width;
|
||||
width += cw;
|
||||
if (width-(cw*aThresh) > aX)
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
},
|
||||
|
||||
getColumnIndexFromHeader: function(aHeader)
|
||||
{
|
||||
var headers = this.mTree.getElementsByTagName("treecol");
|
||||
for (var i = 0; i < headers.length; ++i) {
|
||||
if (headers[i] == aHeader)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
},
|
||||
|
||||
//// for drag-n-drop removal/arrangement of columns
|
||||
|
||||
onDragGesture: function(aEvent)
|
||||
{
|
||||
var target = aEvent.target;
|
||||
if (target.parentNode == this.mTree) {
|
||||
var column = target.getAttribute("label");
|
||||
|
||||
var idx = this.getColumnIndexFromHeader(target);
|
||||
if (idx == -1) return;
|
||||
this.mColumnDragging = idx;
|
||||
|
||||
DNDUtils.invokeSession(target, ["TreeBuilder/column-remove"], [column]);
|
||||
}
|
||||
},
|
||||
|
||||
addColumnDropTarget: function(aBox)
|
||||
{
|
||||
aBox._treeBuilderDropTarget = this;
|
||||
this.addDNDListener(aBox, "ondragover", "Target");
|
||||
this.addDNDListener(aBox, "ondragdrop", "Target");
|
||||
},
|
||||
|
||||
removeColumnDropTarget: function(aBox)
|
||||
{
|
||||
aBox._treeBuilderDropTarget = this;
|
||||
this.removeDNDListener(aBox, "ondragover", "Target");
|
||||
this.removeDNDListener(aBox, "ondragdrop", "Target");
|
||||
},
|
||||
|
||||
onDragOverTarget: function(aBox, aEvent)
|
||||
{
|
||||
DNDUtils.checkCanDrop("TreeBuilder/column-remove");
|
||||
},
|
||||
|
||||
onDragDropTarget: function(aBox, aEvent)
|
||||
{
|
||||
this.removeColumn(this.mColumnDragging);
|
||||
this.build();
|
||||
// if we rebuildContent during this thread, it will crash in the dnd service
|
||||
setTimeout(function(aTreeBuilder) { aTreeBuilder.buildContent() }, 1, this);
|
||||
},
|
||||
|
||||
// these are horrible hacks to compensate for the lack of true multiple
|
||||
// listener support for the DND events
|
||||
|
||||
addDNDListener: function(aBox, aType, aModifier)
|
||||
{
|
||||
var js = "inTreeBuilder_"+aType+(aModifier?"_"+aModifier:"")+"(this, event);";
|
||||
|
||||
var attr = aBox.getAttribute(aType);
|
||||
attr = attr ? attr : "";
|
||||
aBox.setAttribute(aType, attr + js);
|
||||
},
|
||||
|
||||
removeDNDListener: function(aBox, aType, aModifier)
|
||||
{
|
||||
var js = "inTreeBuilder_"+aType+(aModifier?"_"+aModifier:"")+"(this, event);";
|
||||
|
||||
var attr = aBox.getAttribute(aType);
|
||||
var idx = attr.indexOf(js);
|
||||
if (idx != -1)
|
||||
attr = attr.substr(0,idx) + attr.substr(idx+1);
|
||||
aBox.setAttribute(aType, attr);
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// column properties
|
||||
|
||||
addColumn: function(aData)
|
||||
{
|
||||
this.mColumns.push(aData);
|
||||
|
||||
if (this.mOnColumnAdd)
|
||||
this.mOnColumnAdd(this.mColumns.length-1)
|
||||
},
|
||||
|
||||
insertColumn: function(aIndex, aData)
|
||||
{
|
||||
var idx;
|
||||
if (aIndex == -1) {
|
||||
this.mColumns.push(aData);
|
||||
idx = this.mColumns.length-1;
|
||||
} else {
|
||||
this.mColumns.splice(aIndex, 0, aData);
|
||||
idx = aIndex;
|
||||
}
|
||||
|
||||
if (this.mOnColumnAdd)
|
||||
this.mOnColumnAdd(idx);
|
||||
},
|
||||
|
||||
removeColumn: function(aIndex)
|
||||
{
|
||||
this.mColumns.splice(aIndex, 1);
|
||||
|
||||
if (this.mOnColumnRemove)
|
||||
this.mOnColumnRemove(aIndex);
|
||||
},
|
||||
|
||||
getColumnAt: function(aIndex)
|
||||
{
|
||||
var kids = this.mTree.getElementsByTagName("treecol");
|
||||
return aIndex < 0 || aIndex >= kids.length ? kids[kids.length-1] : kids[aIndex];
|
||||
},
|
||||
|
||||
get columnCount() { return this.mColumns.length },
|
||||
|
||||
getColumnName: function(aIndex) { return this.mColumns[aIndex].name },
|
||||
setColumnName: function(aIndex, aValue) { this.mColumns[aIndex].name = aValue },
|
||||
|
||||
getColumnTitle: function(aIndex) { return this.mColumns[aIndex].title },
|
||||
setColumnTitle: function(aIndex, aValue) { this.mColumns[aIndex].title = aValue },
|
||||
|
||||
getColumnClassName: function(aIndex) { return this.mColumns[aIndex].className },
|
||||
setColumnClassName: function(aIndex, aValue) { this.mColumns[aIndex].className = aValue },
|
||||
|
||||
getColumnFlex: function(aIndex) { return this.mColumns[aIndex].flex },
|
||||
setColumnFlex: function(aIndex, aValue) { this.mColumns[aIndex].flex = aValue },
|
||||
|
||||
getExtras: function(aIndex) { return this.mColumns[aIndex].extras },
|
||||
setExtras: function(aIndex, aValue) { this.mColumns[aIndex].extras = aExtras },
|
||||
|
||||
getAttrs: function(aIndex) { return this.mColumns[aIndex].attrs },
|
||||
setAttrs: function(aIndex, aValue) { this.mColumns[aIndex].attrs = aExtras },
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// template building
|
||||
|
||||
build: function(aBuildContent)
|
||||
{
|
||||
try {
|
||||
this.resetTree();
|
||||
this.buildColumns();
|
||||
this.buildTemplate();
|
||||
if (aBuildContent)
|
||||
this.buildContent();
|
||||
} catch (ex) {
|
||||
debug("### ERROR - inTreeBuilder::build failed.\n" + ex);
|
||||
}
|
||||
|
||||
//dumpDOM2(this.mTree);
|
||||
|
||||
},
|
||||
|
||||
buildContent: function()
|
||||
{
|
||||
this.mTreeBody.builder.rebuild();
|
||||
},
|
||||
|
||||
buildColumns: function()
|
||||
{
|
||||
var cols = document.createElementNS(kXULNSURI, "treecols");
|
||||
var col, val, split;
|
||||
for (var i = 0; i < this.mColumns.length; i++) {
|
||||
col = document.createElementNS(kXULNSURI, "treecol");
|
||||
col.setAttribute("id", "treecol-"+this.mColumns[i].name);
|
||||
col.setAttribute("persist", "width");
|
||||
col.setAttribute("label", this.mColumns[i].title);
|
||||
|
||||
// mark first node as primary, if necessary
|
||||
if (i == 0 && this.mIsContainer)
|
||||
col.setAttribute("primary", "true");
|
||||
|
||||
val = cols[i].className;
|
||||
if (val)
|
||||
col.setAttribute("class", val);
|
||||
val = cols[i].flex;
|
||||
if (val)
|
||||
col.setAttribute("flex", val);
|
||||
|
||||
cols.appendChild(col);
|
||||
|
||||
if (this.mSplitters && i < this.mColumns.length-1) {
|
||||
split = document.createElementNS(kXULNSURI, "splitter");
|
||||
split.setAttribute("class", "tree-splitter");
|
||||
cols.appendChild(split);
|
||||
}
|
||||
}
|
||||
this.mTree.appendChild(cols);
|
||||
},
|
||||
|
||||
buildTemplate: function()
|
||||
{
|
||||
var cols = this.mColumns;
|
||||
var bindings = this.mBindings;
|
||||
var row = this.mTreeRow;
|
||||
var cell, binding, val, extras, attrs, key, className;
|
||||
|
||||
if (this.mIsIconic) {
|
||||
binding = this.createBinding("_icon");
|
||||
bindings.appendChild(binding);
|
||||
}
|
||||
|
||||
for (var i = 0; i < cols.length; ++i) {
|
||||
val = cols[i].name;
|
||||
if (!val)
|
||||
throw "Column data is incomplete - missing name at index " + i + ".";
|
||||
|
||||
cell = this.createTemplatePart("treecell");
|
||||
className = "";
|
||||
|
||||
// build the default value data field
|
||||
binding = this.createBinding(val);
|
||||
bindings.appendChild(binding);
|
||||
|
||||
cell.setAttribute("label", "?" + val);
|
||||
cell.setAttribute("ref", "treecol-"+cols[i].name);
|
||||
cell.setAttribute("class", className);
|
||||
|
||||
var props = "";
|
||||
for (key in this.mRowFields)
|
||||
props += key+"-?"+this.mRowFields[key]+" ";
|
||||
cell.setAttribute("properties", props);
|
||||
|
||||
row.appendChild(cell);
|
||||
}
|
||||
},
|
||||
|
||||
createBinding: function(aName)
|
||||
{
|
||||
var binding = document.createElementNS(kXULNSURI, "binding");
|
||||
binding.setAttribute("subject", "?row");
|
||||
binding.setAttribute("predicate", this.mNameSpace+aName);
|
||||
binding.setAttribute("object", "?" + aName);
|
||||
return binding;
|
||||
},
|
||||
|
||||
createTemplatePart: function(aTagName)
|
||||
{
|
||||
var el = document.createElementNS(kXULNSURI, aTagName);
|
||||
el.setAttribute("id", "templatePart"+inTreeBuilderPartCount);
|
||||
inTreeBuilderPartCount++;
|
||||
return el;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function inTreeBuilder_ondraggesture(aTree, aEvent)
|
||||
{
|
||||
return aTree._treeBuilder.onDragGesture(aEvent);
|
||||
}
|
||||
|
||||
function inTreeBuilder_ondragenter(aTree, aEvent)
|
||||
{
|
||||
return aTree._treeBuilder.onDragEnter(aEvent);
|
||||
}
|
||||
|
||||
function inTreeBuilder_ondragover(aTree, aEvent)
|
||||
{
|
||||
return aTree._treeBuilder.onDragOver(aEvent);
|
||||
}
|
||||
|
||||
function inTreeBuilder_ondragexit(aTree, aEvent)
|
||||
{
|
||||
return aTree._treeBuilder.onDragExit(aEvent);
|
||||
}
|
||||
|
||||
function inTreeBuilder_ondragdrop(aTree, aEvent)
|
||||
{
|
||||
return aTree._treeBuilder.onDragDrop(aEvent);
|
||||
}
|
||||
|
||||
function inTreeBuilder_ondragover_Target(aBox, aEvent)
|
||||
{
|
||||
return aBox._treeBuilderDropTarget.onDragOverTarget(aBox, aEvent);
|
||||
}
|
||||
|
||||
function inTreeBuilder_ondragdrop_Target(aBox, aEvent)
|
||||
{
|
||||
return aBox._treeBuilderDropTarget.onDragDropTarget(aBox, aEvent);
|
||||
}
|
|
@ -1,15 +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="ovKeyset"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<keyset id="ksGlobalKeyset" xulkey="ctrl"/>
|
||||
|
||||
</overlay>
|
||||
|
||||
|
|
@ -1,124 +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 ***** */
|
||||
|
||||
/***************************************************************
|
||||
* ObjectApp -------------------------------------------------
|
||||
* The primary object that controls the Inspector compact app.
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
* REQUIRED IMPORTS:
|
||||
****************************************************************/
|
||||
|
||||
//////////// global variables /////////////////////
|
||||
|
||||
var inspector;
|
||||
|
||||
//////////// global constants ////////////////////
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
window.addEventListener("load", ObjectApp_initialize, false);
|
||||
window.addEventListener("unload", ObjectApp_destroy, false);
|
||||
|
||||
function ObjectApp_initialize()
|
||||
{
|
||||
inspector = new ObjectApp();
|
||||
inspector.initialize();
|
||||
}
|
||||
|
||||
function ObjectApp_destroy()
|
||||
{
|
||||
inspector.destroy();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// class ObjectApp
|
||||
|
||||
function ObjectApp()
|
||||
{
|
||||
}
|
||||
|
||||
ObjectApp.prototype =
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// Initialization
|
||||
|
||||
initialize: function()
|
||||
{
|
||||
this.mInitTarget = window.arguments && window.arguments.length > 0 ? window.arguments[0] : null;
|
||||
|
||||
this.mPanelSet = document.getElementById("bxPanelSet");
|
||||
this.mPanelSet.addObserver("panelsetready", this, false);
|
||||
this.mPanelSet.initialize();
|
||||
},
|
||||
|
||||
destroy: function()
|
||||
{
|
||||
},
|
||||
|
||||
doViewerCommand: function(aCommand)
|
||||
{
|
||||
this.mPanelSet.execCommand(aCommand);
|
||||
},
|
||||
|
||||
getViewer: function(aUID)
|
||||
{
|
||||
return this.mPanelSet.registry.getViewerByUID(aUID);
|
||||
},
|
||||
|
||||
onEvent: function(aEvent)
|
||||
{
|
||||
switch (aEvent.type) {
|
||||
case "panelsetready":
|
||||
this.initViewerPanels();
|
||||
}
|
||||
},
|
||||
|
||||
initViewerPanels: function()
|
||||
{
|
||||
if (this.mInitTarget)
|
||||
this.target = this.mInitTarget;
|
||||
},
|
||||
|
||||
set target(aObj)
|
||||
{
|
||||
this.mPanelSet.getPanel(0).subject = aObj;
|
||||
}
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// event listeners
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!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/commandOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://inspector/content/keysetOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://inspector/content/popupOverlay.xul"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://inspector/skin/inspectorWindow.css"?>
|
||||
|
||||
<window id="winInspectorMain" class="color-dialog"
|
||||
title="&Inspector.title;"
|
||||
width="400" height="700"
|
||||
persist="screenX screenY width height sizemode"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/object.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/events/ObserverManager.js"/>
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/jsutil/xul/FrameExchange.js"/>
|
||||
|
||||
<commandset id="cmdsGlobalCommands"/>
|
||||
<keyset id="ksGlobalKeyset"/>
|
||||
<popupset id="ppsViewerPopupset"/>
|
||||
|
||||
<domi-panelset id="bxPanelSet" flex="1" viewercommandset="cmdsGlobalCommands">
|
||||
<domi-panel title="&bxObjectPanel.title;" flex="1"/>
|
||||
</domi-panelset>
|
||||
|
||||
</window>
|
||||
|
||||
|
|
@ -1,58 +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;
|
||||
]>
|
||||
|
||||
<?xul-overlay href="chrome://inspector/content/editingOverlay.xul"?>
|
||||
|
||||
<overlay id="ovPopupsMain"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<menupopup id="menu_FilePopup">
|
||||
<menu oncommand="inspector.setTargetDocument(event.target.doc);"
|
||||
id="mnInspectContentDocumentFile"
|
||||
label="&mnInspectContentDocument.label;"
|
||||
accesskey="&mnInspectContentDocument.accesskey;">
|
||||
<menupopup id="list-content-documents-popup"
|
||||
onpopupshowing="inspector.showInspectDocumentList(event, false);"/>
|
||||
</menu>
|
||||
<menu oncommand="inspector.setTargetDocument(event.target.doc);"
|
||||
id="mnInspectChromeDocumentFile"
|
||||
label="&mnInspectChromeDocument.label;"
|
||||
accesskey="&mnInspectChromeDocument.accesskey;">
|
||||
<menupopup id="list-chrome-documents-popup"
|
||||
onpopupshowing="inspector.showInspectDocumentList(event, true);"/>
|
||||
</menu>
|
||||
<menuitem label="&cmdShowOpenURLDialog.label;" accesskey="&cmdShowOpenURLDialog.accesskey;"
|
||||
observes="cmdShowOpenURLDialog"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&cmdSave.label;" accesskey="&cmdSave.accesskey;"
|
||||
observes="cmdSave" key="key_saveInspector" id="mi-save"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&cmdClose.label;" accesskey="&cmdClose.accesskey;"
|
||||
observes="cmdClose" key="key_closeInspector"/>
|
||||
</menupopup>
|
||||
|
||||
<menupopup id="mppEdit">
|
||||
<menuitem id="mnEditUndo"/>
|
||||
<menuitem id="mnEditRedo"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="mnEditCut"/>
|
||||
<menuitem id="mnEditCopy"/>
|
||||
<menuitem id="mnEditPaste"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="mnEditInsert"/>
|
||||
<menuitem id="mnEditDelete"/>
|
||||
</menupopup>
|
||||
|
||||
<menupopup id="mppView">
|
||||
<menuitem class="menuitem-iconic" type="checkbox" label="&cmdToggleBrowser.label;"
|
||||
accesskey="&cmdToggleBrowser.accesskey;" observes="cmdToggleBrowser"/>
|
||||
<menuseparator/>
|
||||
</menupopup>
|
||||
|
||||
<popupset id="ppsViewerPopupset"/>
|
||||
|
||||
</overlay>
|
|
@ -1,47 +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 ***** */
|
||||
|
||||
pref("inspector.blink.border-color", "#CC0000");
|
||||
pref("inspector.blink.border-width", 2);
|
||||
pref("inspector.blink.duration", 1200);
|
||||
pref("inspector.blink.on", true);
|
||||
pref("inspector.blink.speed", 100);
|
||||
pref("inspector.blink.invert", false);
|
||||
pref("inspector.dom.showAnon", true);
|
||||
pref("inspector.dom.showWhitespaceNodes", true);
|
||||
pref("inspector.dom.showAccessibleNodes", false);
|
||||
pref("inspector.dom.showProcessingInstructions", true);
|
|
@ -1,77 +0,0 @@
|
|||
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* vim: ts=2 sw=2 sts=2
|
||||
* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla.org Code.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Bruno Escherl <aqualon@aquachan.de>
|
||||
*
|
||||
* 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 Startup()
|
||||
{
|
||||
SidebarPrefs_initialize();
|
||||
enableBlinkPrefs(document.getElementById("inspector.blink.on").value);
|
||||
}
|
||||
|
||||
function enableBlinkPrefs(aTruth)
|
||||
{
|
||||
/*
|
||||
* define the pair of label and control used in the prefpane to allow
|
||||
* disabling of both elements, if a pref is locked.
|
||||
*/
|
||||
let els = {
|
||||
lbElBorderColor: "cprElBorderColor",
|
||||
lbElBorderWidth: "txfElBorderWidth",
|
||||
lbElDuration: "txfElDuration",
|
||||
lbElSpeed: "txfElSpeed",
|
||||
"": "cbElInvert"
|
||||
};
|
||||
|
||||
for (let [label, control] in Iterator(els)) {
|
||||
let controlElem = document.getElementById(control);
|
||||
|
||||
// only remove disabled attribute, if pref isn't locked
|
||||
if (aTruth && !isPrefLocked(controlElem)) {
|
||||
controlElem.removeAttribute("disabled");
|
||||
if (label)
|
||||
document.getElementById(label).removeAttribute("disabled");
|
||||
} else {
|
||||
controlElem.setAttribute("disabled", true);
|
||||
if (label)
|
||||
document.getElementById(label).setAttribute("disabled", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function isPrefLocked(elem)
|
||||
{
|
||||
if (!elem.hasAttribute("preference"))
|
||||
return false;
|
||||
|
||||
return document.getElementById(elem.getAttribute("preference")).locked;
|
||||
}
|
|
@ -1,165 +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 Mozilla Communicator client code,
|
||||
- released March 31, 1998.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corporation.
|
||||
- Portions created by the Initial Developer are Copyright (C) 1998-1999
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Bruno Escherl <aqualon@aquachan.de>
|
||||
-
|
||||
- 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 overlay SYSTEM "chrome://inspector/locale/prefs.dtd">
|
||||
|
||||
<?xml-stylesheet href="chrome://inspector/skin/"?>
|
||||
|
||||
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<prefpane id="inspector_pane"
|
||||
label="&Inspector.label;"
|
||||
script="chrome://inspector/content/extensions/wsm-colorpicker.js
|
||||
chrome://inspector/content/prefs/pref-inspector.js
|
||||
chrome://inspector/content/prefs/pref-sidebar.js
|
||||
chrome://inspector/content/jsutil/xpcom/XPCU.js
|
||||
chrome://inspector/content/jsutil/rdf/RDFU.js">
|
||||
|
||||
<stringbundle id="inspector-bundle" src="chrome://inspector/locale/inspector.properties"/>
|
||||
|
||||
<preferences id="inspector_preferences">
|
||||
<preference id="inspector.blink.on"
|
||||
name="inspector.blink.on"
|
||||
type="bool"
|
||||
onchange="enableBlinkPrefs(this.value);"/>
|
||||
<preference id="inspector.blink.border-color"
|
||||
name="inspector.blink.border-color"
|
||||
type="string"/>
|
||||
<preference id="inspector.blink.border-width"
|
||||
name="inspector.blink.border-width"
|
||||
type="int"/>
|
||||
<preference id="inspector.blink.duration"
|
||||
name="inspector.blink.duration"
|
||||
type="int"/>
|
||||
<preference id="inspector.blink.speed"
|
||||
name="inspector.blink.speed"
|
||||
type="int"/>
|
||||
<preference id="inspector.blink.invert"
|
||||
name="inspector.blink.invert"
|
||||
type="bool"/>
|
||||
<!-- preference id="inspector.hooks.navigator"
|
||||
name="inspector.hooks.navigator"
|
||||
type="bool"/ -->
|
||||
</preferences>
|
||||
|
||||
<groupbox id="tbxBlink">
|
||||
<caption label="&elementBlinking.label;"/>
|
||||
<vbox>
|
||||
<checkbox id="cbElOn" label="&blinkSelectedElement.label;"
|
||||
preference="inspector.blink.on"
|
||||
accesskey="&blinkSelectedElement.accesskey;"/>
|
||||
<grid>
|
||||
<columns>
|
||||
<column/>
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row align="center">
|
||||
<label id="lbElBorderColor" control="cprElBorderColor"
|
||||
value="&borderColor.label;"
|
||||
accesskey="&borderColor.accesskey;"/>
|
||||
<hbox align="center">
|
||||
<colorpicker id="cprElBorderColor" type="button"
|
||||
preference="inspector.blink.border-color"/>
|
||||
</hbox>
|
||||
</row>
|
||||
<row align="center">
|
||||
<label id="lbElBorderWidth" control="txfElBorderWidth"
|
||||
value="&borderWidth.label;"
|
||||
accesskey="&borderWidth.accesskey;"/>
|
||||
<hbox align="center">
|
||||
<textbox id="txfElBorderWidth" style="width: 4em"
|
||||
preference="inspector.blink.border-width"/>
|
||||
<label value="&px.label;"/>
|
||||
</hbox>
|
||||
</row>
|
||||
<row align="center">
|
||||
<label id="lbElDuration" control="txfElDuration"
|
||||
value="&blinkDuration.label;"
|
||||
accesskey="&blinkDuration.accesskey;"/>
|
||||
<hbox align="center">
|
||||
<textbox id="txfElDuration" style="width: 4em"
|
||||
preference="inspector.blink.duration"/>
|
||||
<label value="&ms.label;"/>
|
||||
</hbox>
|
||||
</row>
|
||||
<row align="center">
|
||||
<label id="lbElSpeed" control="txfElSpeed"
|
||||
value="&blinkSpeed.label;"
|
||||
accesskey="&blinkSpeed.accesskey;"/>
|
||||
<hbox align="center">
|
||||
<textbox id="txfElSpeed" style="width: 4em"
|
||||
preference="inspector.blink.speed"/>
|
||||
<label value="&ms.label;"/>
|
||||
</hbox>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
<vbox align="start">
|
||||
<checkbox id="cbElInvert" label="&invertColors.label;"
|
||||
preference="inspector.blink.invert"
|
||||
accesskey="&invertColors.accesskey;"/>
|
||||
</vbox>
|
||||
</vbox>
|
||||
</groupbox>
|
||||
|
||||
<groupbox id="tbxSidebar">
|
||||
<caption label="&Sidebar.label;"/>
|
||||
<vbox flex="1">
|
||||
<vbox id="bxSidebarInstall" flex="1">
|
||||
<hbox>
|
||||
<description id="txSidebarMsg" flex="1">&installHowTo.label;</description>
|
||||
</hbox>
|
||||
<button id="btnSidebarInstall" label="&install.label;"
|
||||
oncommand="sidebarPref.installSidebar()"
|
||||
accesskey="&install.accesskey;"/>
|
||||
</vbox>
|
||||
</vbox>
|
||||
</groupbox>
|
||||
|
||||
<!--
|
||||
<vbox>
|
||||
<checkbox id="cbxNavIntegration" label="&addNavigatorHooks.label;"
|
||||
preference="inspector.hooks.navigator"
|
||||
accesskey="&addNavigatorHooks.accesskey;"/>
|
||||
</vbox>
|
||||
-->
|
||||
|
||||
</prefpane>
|
||||
</overlay>
|
|
@ -1,169 +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 ***** */
|
||||
|
||||
/***************************************************************
|
||||
* SidebarPrefs -------------------------------------------------
|
||||
* The controller for the lovely sidebar prefs panel.
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
* REQUIRED IMPORTS:
|
||||
* chrome://inspector/content/jsutil/xpcom/XPCU.js
|
||||
* chrome://inspector/content/jsutil/rdf/RDFU.js
|
||||
****************************************************************/
|
||||
|
||||
//////////// global variables /////////////////////
|
||||
|
||||
var sidebarPref;
|
||||
|
||||
//////////// global constants ////////////////////
|
||||
|
||||
const kDirServiceCID = "@mozilla.org/file/directory_service;1"
|
||||
const kNCURI = "http://home.netscape.com/NC-rdf#";
|
||||
const kSidebarPanelId = "UPnls"; // directory services property to find panels.rdf
|
||||
const kSidebarURNPanelList = "urn:sidebar:current-panel-list";
|
||||
const kSidebarURN3rdParty = "urn:sidebar:3rdparty-panel";
|
||||
const kSidebarURL = "chrome://inspector/content/sidebar.xul";
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
function SidebarPrefs_initialize()
|
||||
{
|
||||
sidebarPref = new SidebarPrefs();
|
||||
sidebarPref.initSidebarData();
|
||||
}
|
||||
|
||||
///// class SidebarPrefs /////////////////////////
|
||||
|
||||
function SidebarPrefs()
|
||||
{
|
||||
}
|
||||
|
||||
SidebarPrefs.prototype =
|
||||
{
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Because nsSidebar has been so mean to me, I'm going to re-write it's
|
||||
// addPanel code right here so I don't have to fight with it. Pbbbbt!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
initSidebarData: function()
|
||||
{
|
||||
var file = this.getDirectoryFile(kSidebarPanelId);
|
||||
if (file)
|
||||
RDFU.loadDataSource(file, gSidebarLoadListener);
|
||||
},
|
||||
|
||||
initSidebarData2: function(aDS)
|
||||
{
|
||||
var res = aDS.GetTarget(gRDF.GetResource(kSidebarURNPanelList), gRDF.GetResource(kNCURI + "panel-list"), true);
|
||||
this.mDS = aDS;
|
||||
this.mPanelSeq = RDFU.makeSeq(aDS, res);
|
||||
this.mPanelRes = gRDF.GetResource(kSidebarURN3rdParty + ":" + kSidebarURL);
|
||||
|
||||
if (this.isSidebarInstalled()) {
|
||||
document.getElementById("tbxSidebar").setAttribute("hidden", "true");
|
||||
}
|
||||
},
|
||||
|
||||
isSidebarInstalled: function()
|
||||
{
|
||||
return this.mPanelSeq.IndexOf(this.mPanelRes) != -1;
|
||||
},
|
||||
|
||||
installSidebar: function()
|
||||
{
|
||||
if (this.isSidebarInstalled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var bundle = document.getElementById("inspector-bundle");
|
||||
var kSidebarTitle = bundle.getString("sidebar.title");
|
||||
|
||||
this.mDS.Assert(this.mPanelRes, gRDF.GetResource(kNCURI + "title"), gRDF.GetLiteral(kSidebarTitle), true);
|
||||
this.mDS.Assert(this.mPanelRes, gRDF.GetResource(kNCURI + "content"), gRDF.GetLiteral(kSidebarURL), true);
|
||||
this.mPanelSeq.AppendElement(this.mPanelRes);
|
||||
this.forceSidebarRefresh();
|
||||
|
||||
var msg = document.getElementById("txSidebarMsg");
|
||||
msg.removeChild(msg.firstChild);
|
||||
|
||||
msg.appendChild(document.createTextNode(bundle.getString("sidebarInstalled")));
|
||||
var btn = document.getElementById("btnSidebarInstall");
|
||||
btn.setAttribute("disabled", "true");
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
forceSidebarRefresh: function()
|
||||
{
|
||||
var listRes = gRDF.GetResource(kSidebarURNPanelList);
|
||||
var refreshRes = gRDF.GetResource(kNCURI + "refresh");
|
||||
var trueRes = gRDF.GetLiteral("true");
|
||||
this.mDS.Assert(listRes, refreshRes, trueRes, true);
|
||||
this.mDS.Unassert(listRes, refreshRes, trueRes);
|
||||
},
|
||||
|
||||
getDirectoryFile: function(aFileId)
|
||||
{
|
||||
try {
|
||||
var dirService = XPCU.getService(kDirServiceCID, "nsIProperties");
|
||||
var file = dirService.get(aFileId, Components.interfaces.nsIFile);
|
||||
if (!file.exists())
|
||||
return null;
|
||||
|
||||
var ioService = XPCU.getService("@mozilla.org/network/io-service;1", "nsIIOService");
|
||||
var fileHandler = XPCU.QI(ioService.getProtocolHandler("file"), "nsIFileProtocolHandler");
|
||||
|
||||
return fileHandler.getURLSpecFromFile(file);
|
||||
|
||||
} catch (ex) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var gSidebarLoadListener = {
|
||||
onDataSourceReady: function(aDS)
|
||||
{
|
||||
sidebarPref.initSidebarData2(aDS);
|
||||
},
|
||||
|
||||
onError: function()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://inspector/locale/prefs.dtd">
|
||||
|
||||
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<treechildren id="advancedChildren">
|
||||
<treeitem id="inspectorItem" label="&Inspector.label;"
|
||||
prefpane="inspector_pane" helpTopic="advanced_pref_dom_inspector"
|
||||
url="chrome://inspector/content/prefs/pref-inspector.xul"/>
|
||||
</treechildren>
|
||||
|
||||
</overlay>
|
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:ins="http://www.mozilla.org/inspector#">
|
||||
|
||||
<rdf:Seq about="inspector:search">
|
||||
<rdf:li><rdf:Description
|
||||
ins:uid="findOrphanImages"
|
||||
ins:description="Find Orphan Images"
|
||||
ins:factory="SearchModule_findOrphanImages"/></rdf:li>
|
||||
|
||||
</rdf:Seq>
|
||||
|
||||
</rdf:RDF>
|
|
@ -1,215 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:ins="http://www.mozilla.org/inspector#">
|
||||
|
||||
<!-- Inspector-specific RDF attributes
|
||||
xmlns:ins Sets the ins: prefix to an Inspector-specific namespace URI.
|
||||
|
||||
ins:uid Sets the basic viewer filename Inspector uses to find the viewer XUL file.
|
||||
For example, ins:uid="dom" leads to chrome://inspector/content/viewers/dom/dom.xul
|
||||
(ViewerRegistry.js#getEntryURL())
|
||||
|
||||
ins:panels This determines which DOM Inspector panels, by id, the viewer referenced is valid for.
|
||||
For example, ins:panels="bxObjectPanel bxObjPanel" means the panel id must be
|
||||
bxObjectPanel or bxObjPanel.
|
||||
|
||||
ins:description
|
||||
This sets a title for the viewer.
|
||||
|
||||
ins:icon This sets an icon for the viewer. Currently unused.
|
||||
|
||||
ins:filter This determines which nodes (or in the case of JavaScript Object
|
||||
viewer, values), the viewer referenced is valid for.
|
||||
|
||||
@param object - nsIDOMNode object (or in the case of JavaScript
|
||||
Object viewer, JavaScript object).
|
||||
@param linkedViewer - linked viewer object.
|
||||
|
||||
For example, ins:filter=
|
||||
"return object instanceof Components.interfaces.nsIDOMDocument;"
|
||||
is a JavaScript fragment ViewerRegistry.js uses to define a
|
||||
filter function if the panel's subject node is an instance of
|
||||
nsIDOMDocument.
|
||||
-->
|
||||
|
||||
<rdf:Seq about="inspector:viewers">
|
||||
<rdf:li><rdf:Description
|
||||
ins:uid="dom"
|
||||
ins:panels="bxDocPanel"
|
||||
ins:description="DOM Nodes"
|
||||
ins:icon="chrome://inspector/content/viewers/dom/dom-icon.gif"
|
||||
ins:filter="return object instanceof Components.interfaces.nsIDOMDocument;"/>
|
||||
</rdf:li>
|
||||
|
||||
<rdf:li><rdf:Description
|
||||
ins:uid="stylesheets"
|
||||
ins:panels="bxDocPanel"
|
||||
ins:description="Stylesheets"
|
||||
ins:filter="return object instanceof Components.interfaces.nsIDOMDocument;"/>
|
||||
</rdf:li>
|
||||
|
||||
<rdf:li><rdf:Description
|
||||
ins:uid="domNode"
|
||||
ins:panels="bxObjectPanel bxObjPanel"
|
||||
ins:description="DOM Node"
|
||||
ins:filter="return object instanceof Components.interfaces.nsIDOMNode;"/>
|
||||
</rdf:li>
|
||||
|
||||
<rdf:li><rdf:Description
|
||||
ins:uid="boxModel"
|
||||
ins:panels="bxObjectPanel bxObjPanel"
|
||||
ins:description="Box Model"
|
||||
ins:filter="return object instanceof Components.interfaces.nsIDOMElement;"/>
|
||||
</rdf:li>
|
||||
|
||||
<rdf:li><rdf:Description
|
||||
ins:uid="xblBindings"
|
||||
ins:panels="bxObjectPanel bxObjPanel"
|
||||
ins:description="XBL Bindings"
|
||||
ins:filter="return object instanceof Components.interfaces.nsIDOMElement;"/>
|
||||
</rdf:li>
|
||||
|
||||
<rdf:li><rdf:Description
|
||||
ins:uid="styleRules"
|
||||
ins:panels="bxObjectPanel bxObjPanel"
|
||||
ins:description="CSS Style Rules"
|
||||
ins:filter="return object instanceof Components.interfaces.nsIDOMElement || object instanceof Components.interfaces.nsIDOMCSSStyleSheet;"/>
|
||||
</rdf:li>
|
||||
|
||||
<rdf:li><rdf:Description
|
||||
ins:uid="computedStyle"
|
||||
ins:panels="bxObjectPanel bxObjPanel"
|
||||
ins:description="Computed Style"
|
||||
ins:filter="return object instanceof Components.interfaces.nsIDOMElement;"/>
|
||||
</rdf:li>
|
||||
|
||||
<rdf:li><rdf:Description
|
||||
ins:uid="jsObject"
|
||||
ins:panels="bxDocPanel bxObjectPanel bxObjPanel"
|
||||
ins:description="JavaScript Object"
|
||||
ins:filter="return true;"/>
|
||||
</rdf:li>
|
||||
|
||||
<rdf:li>
|
||||
<rdf:Description ins:uid="accessibleEvent"
|
||||
ins:panels="bxObjectPanel bxObjPanel"
|
||||
ins:description="Accessible Event">
|
||||
<ins:filter><![CDATA[
|
||||
if (!linkedViewer ||
|
||||
!(object instanceof Components.interfaces.nsIDOMNode))
|
||||
return false;
|
||||
|
||||
if (linkedViewer.uid != "accessibleEvents")
|
||||
return false;
|
||||
|
||||
return object.getUserData("accessibleEvent");
|
||||
]]></ins:filter>
|
||||
</rdf:Description>
|
||||
</rdf:li>
|
||||
|
||||
<rdf:li>
|
||||
<rdf:Description ins:uid="accessibleObject"
|
||||
ins:panels="bxObjectPanel bxObjPanel"
|
||||
ins:description="Accessible Object">
|
||||
<ins:filter><![CDATA[
|
||||
if (!linkedViewer ||
|
||||
!(object instanceof Components.interfaces.nsIDOMNode))
|
||||
return false;
|
||||
|
||||
if (linkedViewer.uid != "accessibleEvents" &&
|
||||
linkedViewer.uid != "accessibleTree" &&
|
||||
(linkedViewer.uid != "dom" || !linkedViewer.getAccessibleNodes()))
|
||||
return false;
|
||||
|
||||
try {
|
||||
var accService =
|
||||
Components.classes["@mozilla.org/accessibleRetrieval;1"]
|
||||
.getService(Components.interfaces.nsIAccessibleRetrieval);
|
||||
|
||||
return accService.getAttachedAccessibleFor(object);
|
||||
} catch(e) {
|
||||
return false;
|
||||
}
|
||||
]]></ins:filter>
|
||||
</rdf:Description>
|
||||
</rdf:li>
|
||||
|
||||
<rdf:li>
|
||||
<rdf:Description ins:uid="accessibleProps"
|
||||
ins:panels="bxObjectPanel bxObjPanel"
|
||||
ins:description="Accessible Properties">
|
||||
<ins:filter><![CDATA[
|
||||
if (!linkedViewer ||
|
||||
!(object instanceof Components.interfaces.nsIDOMNode))
|
||||
return false;
|
||||
|
||||
if (linkedViewer.uid != "accessibleEvents" &&
|
||||
linkedViewer.uid != "accessibleTree" &&
|
||||
(linkedViewer.uid != "dom" || !linkedViewer.getAccessibleNodes()))
|
||||
return false;
|
||||
|
||||
try {
|
||||
var accService =
|
||||
Components.classes["@mozilla.org/accessibleRetrieval;1"]
|
||||
.getService(Components.interfaces.nsIAccessibleRetrieval);
|
||||
|
||||
return accService.getAttachedAccessibleFor(object);
|
||||
} catch(e) {
|
||||
return false;
|
||||
}
|
||||
]]></ins:filter>
|
||||
</rdf:Description>
|
||||
</rdf:li>
|
||||
|
||||
<rdf:li>
|
||||
<rdf:Description ins:uid="accessibleRelations"
|
||||
ins:panels="bxObjectPanel bxObjPanel"
|
||||
ins:description="Accessible Relations">
|
||||
<ins:filter><![CDATA[
|
||||
if (!linkedViewer ||
|
||||
!(object instanceof Components.interfaces.nsIDOMNode))
|
||||
return false;
|
||||
|
||||
if (linkedViewer.uid != "accessibleEvents" &&
|
||||
linkedViewer.uid != "accessibleTree" &&
|
||||
(linkedViewer.uid != "dom" || !linkedViewer.getAccessibleNodes()))
|
||||
return false;
|
||||
|
||||
try {
|
||||
var accService =
|
||||
Components.classes["@mozilla.org/accessibleRetrieval;1"]
|
||||
.getService(Components.interfaces.nsIAccessibleRetrieval);
|
||||
|
||||
return accService.getAttachedAccessibleFor(object);
|
||||
} catch(e) {
|
||||
return false;
|
||||
}
|
||||
]]></ins:filter>
|
||||
</rdf:Description>
|
||||
</rdf:li>
|
||||
|
||||
<rdf:li>
|
||||
<rdf:Description ins:uid="accessibleEvents"
|
||||
ins:panels="bxDocPanel"
|
||||
ins:description="Accessible Events">
|
||||
<ins:filter><![CDATA[
|
||||
return object instanceof Components.interfaces.nsIDOMDocument &&
|
||||
"@mozilla.org/accessibleRetrieval;1" in Components.classes;
|
||||
]]></ins:filter>
|
||||
</rdf:Description>
|
||||
</rdf:li>
|
||||
|
||||
<rdf:li>
|
||||
<rdf:Description ins:uid="accessibleTree"
|
||||
ins:panels="bxDocPanel"
|
||||
ins:description="Accessible Tree">
|
||||
<ins:filter><![CDATA[
|
||||
return object instanceof Components.interfaces.nsIDOMDocument &&
|
||||
"@mozilla.org/accessibleRetrieval;1" in Components.classes;
|
||||
]]></ins:filter>
|
||||
</rdf:Description>
|
||||
</rdf:li>
|
||||
</rdf:Seq>
|
||||
|
||||
</rdf:RDF>
|
Двоичные данные
extensions/inspector/resources/content/res/winInspectorMain.ico
Двоичные данные
extensions/inspector/resources/content/res/winInspectorMain.ico
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 3.6 KiB |
|
@ -1,41 +0,0 @@
|
|||
/* XPM */
|
||||
static char * winInspectorMain_xpm[] = {
|
||||
"32 32 6 1",
|
||||
" c None",
|
||||
". c #000000",
|
||||
"+ c #FFB300",
|
||||
"@ c #FF7500",
|
||||
"# c #FF8C00",
|
||||
"$ c #FF0000",
|
||||
"................................",
|
||||
"................................",
|
||||
"..++++++++++++++++++++++++++++..",
|
||||
"..++++++++++++++++++++++++++++..",
|
||||
"..++++++++++........++++++++++..",
|
||||
"..++++++++++........++++++++++..",
|
||||
"..++++++....@@@@@@@@....++++++..",
|
||||
"..++++++....@@@@@@@@....++++++..",
|
||||
"..++++++..@@@@@@@@@@@@..++++++..",
|
||||
"..++++++..@@@@@@@@@@@@..++++++..",
|
||||
"..++++..@@@@@@@@@@@@@@@@..++++..",
|
||||
"..++++..@@@@@@@@@@@@@@@@..++++..",
|
||||
"..++++..@@@@@@@@@@@@@@@@..++++..",
|
||||
"..++++..@@@@@@@@@@@@@@@@..++++..",
|
||||
"..++++..@@@@@@@@@@@@##@@..++++..",
|
||||
"..++++..@@@@@@@@@@@@##@@..++++..",
|
||||
"..++++..@@@@@@@@@@@@##@@..++++..",
|
||||
"..++++..@@@@@@@@@@@@##@@..++++..",
|
||||
"..++++++..@@@@@@####$$..++++++..",
|
||||
"..++++++..@@@@@@####$$..++++++..",
|
||||
"..++++++....@@@@@@@@......++++..",
|
||||
"..++++++....@@@@@@@@......++++..",
|
||||
"..++++++++++........++......++..",
|
||||
"..++++++++++........++......++..",
|
||||
"..++++++++++++++++++++++........",
|
||||
"..++++++++++++++++++++++........",
|
||||
"..++++++++++++++++++++++++......",
|
||||
"..++++++++++++++++++++++++......",
|
||||
"..++++++++++++++++++++++++++....",
|
||||
"..++++++++++++++++++++++++++....",
|
||||
"................................",
|
||||
"................................"};
|
|
@ -1,25 +0,0 @@
|
|||
/* XPM */
|
||||
static char * winInspectorMain16_xpm[] = {
|
||||
"16 16 6 1",
|
||||
" c None",
|
||||
". c #000000",
|
||||
"+ c #FFAD00",
|
||||
"@ c #FF6D00",
|
||||
"# c #FF8500",
|
||||
"$ c #FF0000",
|
||||
"................",
|
||||
".++++++++++++++.",
|
||||
".+++++....+++++.",
|
||||
".+++..@@@@..+++.",
|
||||
".+++.@@@@@@.+++.",
|
||||
".++.@@@@@@@@.++.",
|
||||
".++.@@@@@@@@.++.",
|
||||
".++.@@@@@@#@.++.",
|
||||
".++.@@@@@@#@.++.",
|
||||
".+++.@@@##$.+++.",
|
||||
".+++..@@@@...++.",
|
||||
".+++++....+...+.",
|
||||
".+++++++++++....",
|
||||
".++++++++++++...",
|
||||
".+++++++++++++..",
|
||||
"................"};
|
Двоичный файл не отображается.
|
@ -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 ***** */
|
||||
|
||||
/***************************************************************
|
||||
* InspectorSidebar -------------------------------------------------
|
||||
* The primary object that controls the Inspector sidebar.
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
* REQUIRED IMPORTS:
|
||||
****************************************************************/
|
||||
|
||||
//////////// global variables /////////////////////
|
||||
|
||||
var inspector;
|
||||
|
||||
//////////// global constants ////////////////////
|
||||
|
||||
const kObserverServiceIID = "@mozilla.org/observer-service;1";
|
||||
|
||||
const gNavigator = window._content;
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
function InspectorSidebar_initialize()
|
||||
{
|
||||
inspector = new InspectorSidebar();
|
||||
inspector.initialize();
|
||||
}
|
||||
|
||||
window.addEventListener("load", InspectorSidebar_initialize, false);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// class InspectorSidebar
|
||||
|
||||
function InspectorSidebar()
|
||||
{
|
||||
}
|
||||
|
||||
InspectorSidebar.prototype =
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// Initialization
|
||||
|
||||
get document() { return this.mDocPanel.viewer.subject; },
|
||||
|
||||
initialize: function()
|
||||
{
|
||||
this.installNavObserver();
|
||||
|
||||
this.mPanelSet = document.getElementById("bxPanelSet");
|
||||
this.mPanelSet.addObserver("panelsetready", this, false);
|
||||
this.mPanelSet.initialize();
|
||||
},
|
||||
|
||||
destroy: function()
|
||||
{
|
||||
},
|
||||
|
||||
doViewerCommand: function(aCommand)
|
||||
{
|
||||
this.mPanelSet.execCommand(aCommand);
|
||||
},
|
||||
|
||||
getViewer: function(aUID)
|
||||
{
|
||||
return this.mPanelSet.registry.getViewerByUID(aUID);
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// Viewer Panels
|
||||
|
||||
initViewerPanels: function()
|
||||
{
|
||||
this.mDocPanel = this.mPanelSet.getPanel(0);
|
||||
this.mDocPanel.addObserver("subjectChange", this, false);
|
||||
this.mObjectPanel = this.mPanelSet.getPanel(1);
|
||||
},
|
||||
|
||||
onEvent: function(aEvent)
|
||||
{
|
||||
if (aEvent.type == "panelsetready") {
|
||||
this.initViewerPanels();
|
||||
}
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// Navigation
|
||||
|
||||
setTargetWindow: function(aWindow)
|
||||
{
|
||||
this.setTargetDocument(aWindow.document);
|
||||
},
|
||||
|
||||
setTargetDocument: function(aDoc)
|
||||
{
|
||||
this.mPanelSet.getPanel(0).subject = aDoc;
|
||||
},
|
||||
|
||||
installNavObserver: function()
|
||||
{
|
||||
var observerService = XPCU.getService(kObserverServiceIID, "nsIObserverService");
|
||||
observerService.addObserver(NavLoadObserver, "EndDocumentLoad", false);
|
||||
}
|
||||
};
|
||||
|
||||
var NavLoadObserver = {
|
||||
observe: function(aWindow)
|
||||
{
|
||||
inspector.setTargetWindow(aWindow);
|
||||
}
|
||||
};
|
|
@ -1,48 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!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/commandOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://inspector/content/keysetOverlay.xul"?>
|
||||
<?xul-overlay href="chrome://inspector/content/popupOverlay.xul"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://inspector/skin/sidebar.css"?>
|
||||
|
||||
<window id="winInspectorMain" class="color-dialog"
|
||||
title="&Inspector.title;"
|
||||
width="400" height="700"
|
||||
persist="screenX screenY width height sizemode"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/sidebar.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/events/ObserverManager.js"/>
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/jsutil/xul/FrameExchange.js"/>
|
||||
|
||||
<commandset id="cmdsGlobalCommands"/>
|
||||
<keyset id="ksGlobalKeyset"/>
|
||||
<popupset id="ppsViewerPopupset"/>
|
||||
|
||||
<domi-panelset id="bxPanelSet" flex="1" viewercommandset="cmdsGlobalCommands">
|
||||
<tabbox flex="1" orient="vertical">
|
||||
<tabs>
|
||||
<tab label="&bxDocPanel.title;"/>
|
||||
<tab label="&bxObjectPanel.title;"/>
|
||||
</tabs>
|
||||
<tabpanels flex="1">
|
||||
<domi-panel id="bxDocPanel" title="&bxDocPanel.title;"/>
|
||||
<domi-panel id="bxObjPanel" title="&bxObjectPanel.title;" linkedpanel="bxDocPanel"/>
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
</domi-panelset>
|
||||
|
||||
</window>
|
||||
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<overlay id="ovStatusbar"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<statusbar id="status-bar">
|
||||
<statusbarpanel id="txStatusPanel" flex="1"/>
|
||||
<statusbarpanel class="statusbarpanel-progress">
|
||||
<progressmeter id="pmStatus" mode="normal" value="0" class="progressmeter-statusbar"/>
|
||||
</statusbarpanel>
|
||||
</statusbar>
|
||||
|
||||
</overlay>
|
|
@ -1,43 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://inspector/locale/tasksOverlay.dtd" >
|
||||
|
||||
<overlay id="eInspectorTasksOverlay"
|
||||
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[
|
||||
function inspectorWindowLoad()
|
||||
{
|
||||
setTimeout(initWindowMediator, 0);
|
||||
}
|
||||
|
||||
function initWindowMediator()
|
||||
{
|
||||
// Load the Window DataSource so that browser windows opened subsequent to DOM
|
||||
// Inspector show up in the DOM Inspector's window list.
|
||||
var windowDS = Components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"]
|
||||
.getService(Components.interfaces.nsIWindowDataSource);
|
||||
}
|
||||
|
||||
window.addEventListener("load", inspectorWindowLoad, false);
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<commandset id="mainCommandSet">
|
||||
<command id="Tasks:Inspector" oncommand="inspectDOMDocument();"/>
|
||||
<command id="Tasks:InspectPage" oncommand="inspectDOMDocument(content.document);"/>
|
||||
</commandset>
|
||||
|
||||
<keyset id="mainKeyset">
|
||||
<key id="key_inspectPage" key="&inspectorTaskCmd.commandkey;" modifiers="accel,shift" command="Tasks:InspectPage"/>
|
||||
</keyset>
|
||||
|
||||
<menupopup id="menu_ToolsPopup">
|
||||
<menuitem id="menu_inspector" label="&inspectorTaskCmd.label;"
|
||||
insertafter="javascriptConsole" key="key_inspectPage"
|
||||
accesskey="&inspectorTaskCmd.accesskey.ff;" command="Tasks:InspectPage"/>
|
||||
</menupopup>
|
||||
|
||||
</overlay>
|
|
@ -1,44 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://inspector/locale/tasksOverlay.dtd" >
|
||||
|
||||
<overlay id="eInspectorTasksOverlay"
|
||||
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[
|
||||
function inspectorWindowLoad()
|
||||
{
|
||||
setTimeout(initWindowMediator, 0);
|
||||
}
|
||||
|
||||
function initWindowMediator()
|
||||
{
|
||||
// Load the Window DataSource so that browser windows opened subsequent to DOM
|
||||
// Inspector show up in the DOM Inspector's window list.
|
||||
var windowDS = Components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"]
|
||||
.getService(Components.interfaces.nsIWindowDataSource);
|
||||
}
|
||||
|
||||
window.addEventListener("load", inspectorWindowLoad, false);
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<commandset id="calendar_commands">
|
||||
<command id="Tasks:Inspector" oncommand="inspectDOMDocument();"/>
|
||||
<command id="Tasks:InspectPage" oncommand="inspectDOMDocument(window.document);"/>
|
||||
</commandset>
|
||||
|
||||
<keyset id="tasksKeys">
|
||||
<key id="key_inspectPage" key="&inspectorTaskCmd.commandkey;" modifiers="accel,shift" command="Tasks:InspectPage"/>
|
||||
</keyset>
|
||||
|
||||
<menupopup id="menu_ToolsPopup">
|
||||
<menuitem id="menu_inspector" label="&inspectorTaskCmd.label;"
|
||||
insertafter="javascriptConsole" key="key_inspectPage"
|
||||
accesskey="&inspectorTaskCmd.accesskey;" command="Tasks:InspectPage"/>
|
||||
</menupopup>
|
||||
|
||||
</overlay>
|
|
@ -1,44 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://inspector/locale/tasksOverlay.dtd" >
|
||||
|
||||
<overlay id="eInspectorTasksOverlay"
|
||||
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[
|
||||
function inspectorWindowLoad()
|
||||
{
|
||||
setTimeout("initWindowMediator()", 0);
|
||||
}
|
||||
|
||||
function initWindowMediator()
|
||||
{
|
||||
// Load the Window DataSource so that browser windows opened subsequent to DOM
|
||||
// Inspector show up in the DOM Inspector's window list.
|
||||
var windowDS = Components.classes["@mozilla.org/rdf/datasource;1?name=window-mediator"]
|
||||
.getService(Components.interfaces.nsIWindowDataSource);
|
||||
}
|
||||
|
||||
window.addEventListener("load", inspectorWindowLoad, false);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<commandset id="tasksCommands">
|
||||
<command id="Tasks:Inspector" oncommand="inspectDOMDocument();"/>
|
||||
<command id="Tasks:InspectPage" oncommand="inspectDOMDocument(_content.document);"/>
|
||||
</commandset>
|
||||
|
||||
<keyset id="tasksKeys">
|
||||
<key id="key_inspectPage" key="&inspectorTaskCmd.commandkey;" modifiers="accel,shift" command="Tasks:InspectPage"/>
|
||||
</keyset>
|
||||
|
||||
<menupopup id="taskPopup">
|
||||
<menuitem id="menu_inspector" label="&inspectorTaskCmd.label;" insertafter="javaScriptConsole"
|
||||
accesskey="&inspectorTaskCmd.accesskey;" command="Tasks:Inspector"/>
|
||||
</menupopup>
|
||||
|
||||
</overlay>
|
|
@ -1,24 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://inspector/locale/tasksOverlay.dtd" >
|
||||
|
||||
<overlay id="eInspectorTasksOverlay"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/hooks.js"/>
|
||||
|
||||
<commandset id="tasksCommands">
|
||||
<command id="Tasks:Inspector" oncommand="inspectDOMDocument();"/>
|
||||
<command id="Tasks:InspectPage" oncommand="inspectDOMDocument(_content.document);"/>
|
||||
</commandset>
|
||||
|
||||
<keyset id="tasksKeys">
|
||||
<key id="key_inspectPage" key="i" modifiers="accel,shift" command="Tasks:InspectPage"/>
|
||||
</keyset>
|
||||
|
||||
<menupopup id="toolsPopup">
|
||||
<menuitem id="menu_inspector" label="&inspectorTaskCmd.label;"
|
||||
accesskey="&inspectorTaskCmd.accesskey;" command="Tasks:Inspector"/>
|
||||
</menupopup>
|
||||
|
||||
</overlay>
|
|
@ -1,79 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://communicator/skin/box.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/brand.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/button.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/communicator.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/dialogOverlay.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/menubutton.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/prefpanels.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/securityOverlay.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/splitter.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/tasksOverlay.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/toolbar.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/bookmarks/bookmarks.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/directory/directory.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/profile/profile.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/profile/profileManager.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/regviewer/regviewer.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/related/related.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/search/findresults.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/search/icons.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/search/internet.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/search/internetresults.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/search/search-editor.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/search/search.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/sidebar/customize.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/sidebar/preview.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/sidebar/sidebar.css"?>
|
||||
<?xml-stylesheet href="chrome://communicator/skin/xpinstall/xpinstall.css"?>
|
||||
<?xml-stylesheet href="chrome://editor/skin/EdImageMap.css"?>
|
||||
<?xml-stylesheet href="chrome://editor/skin/EdImageMapPage.css"?>
|
||||
<?xml-stylesheet href="chrome://editor/skin/editor.css"?>
|
||||
<?xml-stylesheet href="chrome://editor/skin/EditorDialog.css"?>
|
||||
<?xml-stylesheet href="chrome://editor/skin/EditorToolbars.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/box.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/button.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/checkbox.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/colorpicker.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/commonDialog.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/console.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/dialogOverlay.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/filepicker.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/formatting.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/global.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/menu.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/menubutton.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/menulist.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/radio.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/scrollbars.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/splitter.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/tabcontrol.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/tasksOverlay.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/textfield.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/toolbar.css"?>
|
||||
<?xml-stylesheet href="chrome://global/skin/tree.css"?>
|
||||
<?xml-stylesheet href="chrome://messenger/skin/AccountManager.css"?>
|
||||
<?xml-stylesheet href="chrome://messenger/skin/fieldMapImport.css"?>
|
||||
<?xml-stylesheet href="chrome://messenger/skin/folderPane.css"?>
|
||||
<?xml-stylesheet href="chrome://messenger/skin/importDialog.css"?>
|
||||
<?xml-stylesheet href="chrome://messenger/skin/mailheader.css"?>
|
||||
<?xml-stylesheet href="chrome://messenger/skin/messenger.css"?>
|
||||
<?xml-stylesheet href="chrome://messenger/skin/msgHdrViewOverlay.css"?>
|
||||
<?xml-stylesheet href="chrome://messenger/skin/pref-mailnews.css"?>
|
||||
<?xml-stylesheet href="chrome://messenger/skin/subscribe.css"?>
|
||||
<?xml-stylesheet href="chrome://messenger/skin/threadPane.css"?>
|
||||
<?xml-stylesheet href="chrome://messenger/skin/wizard.css"?>
|
||||
<?xml-stylesheet href="chrome://messenger/skin/addressbook/addressbook.css"?>
|
||||
<?xml-stylesheet href="chrome://messenger/skin/messengercompose/messengercompose.css"?>
|
||||
<?xml-stylesheet href="chrome://navigator/skin/navigator.css"?>
|
||||
<?xml-stylesheet href="chrome://navigator/skin/NavSecurityOverlay.css"?>
|
||||
|
||||
<window orient="vertical"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<label value="All skin css files are now loaded."/>
|
||||
|
||||
</window>
|
||||
|
||||
|
|
@ -1,66 +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="ovToolbox"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<popupset id="ppsGlobalPopupset"/>
|
||||
|
||||
<menubar id="mbrInspectorMain">
|
||||
|
||||
<menu id="mnFile" label="&mnFile.label;" accesskey="&mnFile.accesskey;">
|
||||
<menupopup id="menu_FilePopup"/>
|
||||
</menu>
|
||||
|
||||
<menu id="mnEdit" label="&mnEdit.label;" accesskey="&mnEdit.accesskey;">
|
||||
<menupopup id="mppEdit"/>
|
||||
</menu>
|
||||
|
||||
<menu id="mnSearch" label="&mnSearch.label;" accesskey="&mnSearch.accesskey;">
|
||||
<menupopup id="mppSearch"/>
|
||||
</menu>
|
||||
|
||||
<menu id="mnView" label="&mnView.label;" accesskey="&mnView.accesskey;">
|
||||
<menupopup id="mppView"/>
|
||||
</menu>
|
||||
|
||||
<menu id="tasksMenu"/> <!-- Seamonkey -->
|
||||
<menu id="windowMenu"/> <!-- Firefox-mac -->
|
||||
<menupopup id="menu_ToolsPopup"/> <!-- Firefox-mac -->
|
||||
<menu id="menu_Help"/> <!-- Seamonkey -->
|
||||
<menu id="helpMenu"/> <!-- Firefox -->
|
||||
|
||||
</menubar>
|
||||
|
||||
<toolbar id="tbInspectorPrimary" class="chromeclass-toolbar">
|
||||
|
||||
<hbox id="bxURLBar" flex="1">
|
||||
<toolbarbutton id="btnSelecting" type="checkbox" observes="cmd:selectByClick"
|
||||
tooltiptext="&btnSelecting.tooltip;"/>
|
||||
|
||||
<toolbarbutton id="btnFind" observes="cmd:find"
|
||||
tooltiptext="&btnFind.tooltip;"/>
|
||||
|
||||
<hbox id="bxURLBarContainer" flex="1">
|
||||
<hbox align="center" flex="1">
|
||||
<!-- request both autocomplete implementations for compatibility -->
|
||||
<textbox id="tfURLBar" type="autocomplete" flex="1"
|
||||
searchSessions="history" timeout="50" maxrows="6"
|
||||
autocompletesearch="history file" observes="cmdGotoURL">
|
||||
<image id="imgURLBarIcon"/>
|
||||
|
||||
</textbox>
|
||||
</hbox>
|
||||
|
||||
</hbox>
|
||||
|
||||
<toolbarbutton label="&btnInspect.label;" accesskey="&btnInspect.accesskey;" observes="cmdGotoURL"/>
|
||||
</hbox>
|
||||
|
||||
</toolbar>
|
||||
|
||||
</overlay>
|
|
@ -1,2 +0,0 @@
|
|||
<!ENTITY INS-rdf "http://www.mozilla.org/inspector#">
|
||||
<!ENTITY NC-rdf "rdf:http://home.netscape.com/NC-rdf#">
|
|
@ -1,20 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<window id="winUtil"
|
||||
width="200" height="200"
|
||||
persist="screenX screenY width height sizemode"
|
||||
onload="opener.UtilWindowOpenListener(window)"
|
||||
orient="vertical"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<spacer flex="1"/>
|
||||
<hbox id="bxOuter" flex="1">
|
||||
<spacer flex="1"/>
|
||||
<hbox id="bxCenter" align="center" pack="center"/>
|
||||
<spacer flex="1"/>
|
||||
</hbox>
|
||||
<spacer flex="1"/>
|
||||
|
||||
</window>
|
||||
|
||||
|
|
@ -1,261 +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 ***** */
|
||||
|
||||
/***************************************************************
|
||||
* Inspector Utils ----------------------------------------------
|
||||
* Common functions and constants used across the app.
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
* REQUIRED IMPORTS:
|
||||
* chrome://inspector/content/jsutil/xpcom/XPCU.js
|
||||
* chrome://inspector/content/jsutil/rdf/RDFU.js
|
||||
****************************************************************/
|
||||
|
||||
//////////// global constants ////////////////////
|
||||
|
||||
const kInspectorNSURI = "http://www.mozilla.org/inspector#";
|
||||
const kXULNSURI = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||
const kHTMLNSURI = "http://www.w3.org/1999/xhtml";
|
||||
const nsITransactionManager = Components.interfaces.nsITransactionManager;
|
||||
var gEntityConverter;
|
||||
const kCharTable = {
|
||||
'&': "&",
|
||||
'<': "<",
|
||||
'>': ">",
|
||||
'"': """
|
||||
};
|
||||
|
||||
var InsUtil = {
|
||||
/******************************************************************************
|
||||
* Convenience function for calling nsIChromeRegistry::convertChromeURL
|
||||
*******************************************************************************/
|
||||
convertChromeURL: function(aURL)
|
||||
{
|
||||
var uri = XPCU.getService("@mozilla.org/network/io-service;1", "nsIIOService")
|
||||
.newURI(aURL, null, null);
|
||||
var reg = XPCU.getService("@mozilla.org/chrome/chrome-registry;1", "nsIChromeRegistry");
|
||||
return reg.convertChromeURL(uri);
|
||||
},
|
||||
|
||||
/******************************************************************************
|
||||
* Convenience function for getting a literal value from nsIRDFDataSource::GetTarget
|
||||
*******************************************************************************/
|
||||
getDSProperty: function(/*nsISupports*/ aDS, /*String*/ aId, /*String*/ aPropName)
|
||||
{
|
||||
var ruleRes = gRDF.GetResource(aId);
|
||||
var ds = XPCU.QI(aDS, "nsIRDFDataSource"); // just to be sure
|
||||
var propRes = ds.GetTarget(ruleRes, gRDF.GetResource(kInspectorNSURI+aPropName), true);
|
||||
propRes = XPCU.QI(propRes, "nsIRDFLiteral");
|
||||
return propRes.Value;
|
||||
},
|
||||
|
||||
/******************************************************************************
|
||||
* Convenience function for persisting an element's persisted attributes.
|
||||
*******************************************************************************/
|
||||
persistAll: function(aId)
|
||||
{
|
||||
var el = document.getElementById(aId);
|
||||
if (el) {
|
||||
var attrs = el.getAttribute("persist").split(" ");
|
||||
for (var i = 0; i < attrs.length; ++i) {
|
||||
document.persist(aId, attrs[i]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/******************************************************************************
|
||||
* Convenience function for escaping HTML strings.
|
||||
*******************************************************************************/
|
||||
unicodeToEntity: function(text)
|
||||
{
|
||||
const entityVersion = Components.interfaces.nsIEntityConverter.entityW3C;
|
||||
|
||||
function charTableLookup(letter) {
|
||||
return kCharTable[letter];
|
||||
}
|
||||
|
||||
function convertEntity(letter) {
|
||||
try {
|
||||
return gEntityConverter.ConvertToEntity(letter, entityVersion);
|
||||
} catch (ex) {
|
||||
return letter;
|
||||
}
|
||||
}
|
||||
|
||||
if (!gEntityConverter) {
|
||||
try {
|
||||
gEntityConverter =
|
||||
Components.classes["@mozilla.org/intl/entityconverter;1"]
|
||||
.createInstance(Components.interfaces.nsIEntityConverter);
|
||||
} catch (ex) { }
|
||||
}
|
||||
|
||||
// replace chars in our charTable
|
||||
text = text.replace(/[<>&"]/g, charTableLookup);
|
||||
|
||||
// replace chars > 0x7f via nsIEntityConverter
|
||||
text = text.replace(/[^\0-\u007f]/g, convertEntity);
|
||||
|
||||
return text;
|
||||
}
|
||||
};
|
||||
|
||||
// ::::::: debugging utilities ::::::
|
||||
|
||||
function debug(aText)
|
||||
{
|
||||
// XX comment out to reduce noise
|
||||
consoleDump(aText);
|
||||
//dump(aText);
|
||||
}
|
||||
|
||||
// dump text to the Error Console
|
||||
function consoleDump(aText)
|
||||
{
|
||||
var csClass = Components.classes['@mozilla.org/consoleservice;1'];
|
||||
var cs = csClass.getService(Components.interfaces.nsIConsoleService);
|
||||
cs.logStringMessage(aText);
|
||||
}
|
||||
|
||||
function dumpDOM(aNode, aIndent)
|
||||
{
|
||||
if (!aIndent) aIndent = "";
|
||||
debug(aIndent + "<" + aNode.localName + "\n");
|
||||
var attrs = aNode.attributes;
|
||||
var attr;
|
||||
for (var a = 0; a < attrs.length; ++a) {
|
||||
attr = attrs[a];
|
||||
debug(aIndent + " " + attr.nodeName + "=\"" + attr.nodeValue + "\"\n");
|
||||
}
|
||||
debug(aIndent + ">\n");
|
||||
|
||||
aIndent += " ";
|
||||
|
||||
for (var i = 0; i < aNode.childNodes.length; ++i)
|
||||
dumpDOM(aNode.childNodes[i], aIndent);
|
||||
}
|
||||
|
||||
// ::::::: nsITransaction helper functions :::::::
|
||||
|
||||
function txnQueryInterface(theUID, theResult)
|
||||
{
|
||||
const nsITransaction = Components.interfaces.nsITransaction;
|
||||
const nsISupports = Components.interfaces.nsISupports;
|
||||
if (theUID == nsITransaction || theUID == nsISupports) {
|
||||
return this;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function txnMerge()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
function txnRedoTransaction() {
|
||||
this.doTransaction();
|
||||
}
|
||||
|
||||
/**
|
||||
* A nsITransaction for clipboard copy.
|
||||
* @param an array of objects that define a clipboard flavor, a delimiter, and
|
||||
* toString().
|
||||
*/
|
||||
function cmdEditCopy(aObjects) {
|
||||
// remove this line for bug 179621, Phase Three
|
||||
this.txnType = "standard";
|
||||
|
||||
// required for nsITransaction
|
||||
this.QueryInterface = txnQueryInterface;
|
||||
this.merge = txnMerge;
|
||||
this.isTransient = true;
|
||||
|
||||
this.objects = aObjects;
|
||||
}
|
||||
|
||||
cmdEditCopy.prototype.doTransaction =
|
||||
function doTransaction() {
|
||||
if (this.objects.length == 1)
|
||||
viewer.pane.panelset.setClipboardData(this.objects[0],
|
||||
this.objects[0].flavor,
|
||||
this.objects.toString());
|
||||
else
|
||||
viewer.pane.panelset.setClipboardData(this.objects,
|
||||
this.objects[0].flavor + "s",
|
||||
this.objects.join(this.objects[0].delimiter));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Represents a CSS declaration.
|
||||
* @param aProperty the property of the declaration
|
||||
* @param aValue the value of the declaration
|
||||
*/
|
||||
function CSSDeclaration(aProperty, aValue, aImportant) {
|
||||
this.flavor = "inspector/css-declaration";
|
||||
this.delimiter = "\n";
|
||||
this.property = aProperty;
|
||||
this.value = aValue;
|
||||
this.important = aImportant == true;
|
||||
}
|
||||
/**
|
||||
* Returns a usable CSS string for the CSSDeclaration.
|
||||
* @return a string in the form "property: value;"
|
||||
*/
|
||||
CSSDeclaration.prototype.toString = function toString() {
|
||||
return this.property + ": " + this.value + (this.important ? " !important" : "") + ";";
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a DOM attribute.
|
||||
* @param aNode the attribute node
|
||||
*/
|
||||
function DOMAttribute(aNode)
|
||||
{
|
||||
this.flavor = "inspector/dom-attribute";
|
||||
this.node = aNode.cloneNode(false);
|
||||
this.delimiter = " ";
|
||||
}
|
||||
/**
|
||||
* Returns a string representing an attribute name/value pair
|
||||
* @return a string in the form of 'name="value"'
|
||||
*/
|
||||
DOMAttribute.prototype.toString = function toString()
|
||||
{
|
||||
return this.node.nodeName + "=\"" + InsUtil.unicodeToEntity(this.node.nodeValue) + "\"";
|
||||
};
|
|
@ -1,34 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<overlay id="ovVenkman"
|
||||
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", InspectorVenkmanOnLoad, false);
|
||||
|
||||
function InspectorVenkmanOnLoad()
|
||||
{
|
||||
console._commands.add("inspect", "onInputInspect", "<object>", "Inspect somethin', yo.");
|
||||
}
|
||||
|
||||
console.onInputInspect = function (e)
|
||||
{
|
||||
var v = evalInTargetScope (e.inputData);
|
||||
|
||||
if (!(v instanceof jsdIValue) || v.jsType != jsdIValue.TYPE_OBJECT)
|
||||
{
|
||||
var str = (v instanceof jsdIValue) ? formatValue(v) : String(v)
|
||||
display (getMsg(MSN_ERR_INVALID_PARAM, [MSG_VAL_EXPR, str]),
|
||||
MT_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
inspectObject(v);
|
||||
}
|
||||
|
||||
]]></script>
|
||||
|
||||
</overlay>
|
|
@ -1,222 +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
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2007
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alexander Surkov <surkov.alexander@gmail.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 ***** */
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Global Variables
|
||||
|
||||
var viewer;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Global Constants
|
||||
|
||||
const kAccessibleRetrievalCID = "@mozilla.org/accessibleRetrieval;1";
|
||||
|
||||
const nsIAccessibleRetrieval = Components.interfaces.nsIAccessibleRetrieval;
|
||||
|
||||
const nsIAccessibleEvent = Components.interfaces.nsIAccessibleEvent;
|
||||
const nsIAccessibleStateChangeEvent =
|
||||
Components.interfaces.nsIAccessibleStateChangeEvent;
|
||||
const nsIAccessibleTextChangeEvent =
|
||||
Components.interfaces.nsIAccessibleTextChangeEvent;
|
||||
const nsIAccessibleCaretMoveEvent =
|
||||
Components.interfaces.nsIAccessibleCaretMoveEvent;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Initialization/Destruction
|
||||
|
||||
window.addEventListener("load", AccessibleEventViewer_initialize, false);
|
||||
|
||||
function AccessibleEventViewer_initialize()
|
||||
{
|
||||
viewer = new AccessibleEventViewer();
|
||||
viewer.initialize(parent.FrameExchange.receiveData(window));
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// class AccessibleEventViewer
|
||||
function AccessibleEventViewer()
|
||||
{
|
||||
this.mURL = window.location;
|
||||
this.mObsMan = new ObserverManager(this);
|
||||
this.mAccService = XPCU.getService(kAccessibleRetrievalCID,
|
||||
nsIAccessibleRetrieval);
|
||||
}
|
||||
|
||||
AccessibleEventViewer.prototype =
|
||||
{
|
||||
mSubject: null,
|
||||
mPane: null,
|
||||
mAccEventSubject: null,
|
||||
mAccService: null,
|
||||
|
||||
get uid() { return "accessibleEvent"; },
|
||||
get pane() { return this.mPane; },
|
||||
|
||||
get subject() { return this.mSubject; },
|
||||
set subject(aObject)
|
||||
{
|
||||
this.mSubject = aObject;
|
||||
this.updateView();
|
||||
this.mObsMan.dispatchEvent("subjectChange", { subject: aObject });
|
||||
},
|
||||
|
||||
initialize: function initialize(aPane)
|
||||
{
|
||||
this.mPane = aPane;
|
||||
aPane.notifyViewerReady(this);
|
||||
},
|
||||
|
||||
isCommandEnabled: function isCommandEnabled(aCommand)
|
||||
{
|
||||
return false;
|
||||
},
|
||||
|
||||
getCommand: function getCommand(aCommand)
|
||||
{
|
||||
return null;
|
||||
},
|
||||
|
||||
destroy: function destroy() {},
|
||||
|
||||
// event dispatching
|
||||
|
||||
addObserver: function addObserver(aEvent, aObserver)
|
||||
{
|
||||
this.mObsMan.addObserver(aEvent, aObserver);
|
||||
},
|
||||
removeObserver: function removeObserver(aEvent, aObserver)
|
||||
{
|
||||
this.mObsMan.removeObserver(aEvent, aObserver);
|
||||
},
|
||||
|
||||
// private
|
||||
updateView: function updateView()
|
||||
{
|
||||
this.clearView();
|
||||
|
||||
this.mAccEventSubject = this.mSubject.getUserData("accessibleEvent");
|
||||
if (!this.mAccEventSubject)
|
||||
return;
|
||||
|
||||
XPCU.QI(this.mAccEventSubject, nsIAccessibleEvent);
|
||||
|
||||
var shownPropsId = "";
|
||||
if (this.mAccEventSubject instanceof nsIAccessibleStateChangeEvent)
|
||||
shownPropsId = "stateChangeEvent";
|
||||
else if (this.mAccEventSubject instanceof nsIAccessibleTextChangeEvent)
|
||||
shownPropsId = "textChangeEvent";
|
||||
else if (this.mAccEventSubject instanceof nsIAccessibleCaretMoveEvent)
|
||||
shownPropsId = "caretMoveEvent";
|
||||
|
||||
var props = document.getElementsByAttribute("prop", "*");
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var propElm = props[i];
|
||||
var isActive = !propElm.hasAttribute("class") ||
|
||||
(propElm.getAttribute("class") == shownPropsId);
|
||||
|
||||
if (isActive) {
|
||||
var prop = propElm.getAttribute("prop");
|
||||
propElm.textContent = this[prop];
|
||||
propElm.parentNode.removeAttribute("hidden");
|
||||
} else {
|
||||
propElm.parentNode.setAttribute("hidden", "true");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
clearView: function clearView()
|
||||
{
|
||||
var containers = document.getElementsByAttribute("prop", "*");
|
||||
for (var i = 0; i < containers.length; ++i)
|
||||
containers[i].textContent = "";
|
||||
},
|
||||
|
||||
get isFromUserInput()
|
||||
{
|
||||
return this.mAccEventSubject.isFromUserInput;
|
||||
},
|
||||
|
||||
get state()
|
||||
{
|
||||
var accessible = this.mAccEventSubject.accessible;
|
||||
|
||||
var stateObj = {value: null};
|
||||
var extStateObj = {value: null};
|
||||
accessible.getFinalState(stateObj, extStateObj);
|
||||
|
||||
var list = [];
|
||||
|
||||
states = this.mAccService.getStringStates(stateObj.value,
|
||||
extStateObj.value);
|
||||
|
||||
for (var i = 0; i < states.length; i++)
|
||||
list.push(states.item(i));
|
||||
return list.join();
|
||||
},
|
||||
|
||||
get isEnabled()
|
||||
{
|
||||
return this.mAccEventSubject.isEnabled();
|
||||
},
|
||||
|
||||
get startOffset()
|
||||
{
|
||||
return this.mAccEventSubject.start;
|
||||
},
|
||||
|
||||
get length()
|
||||
{
|
||||
return this.mAccEventSubject.length;
|
||||
},
|
||||
|
||||
get isInserted()
|
||||
{
|
||||
return this.mAccEventSubject.isInserted();
|
||||
},
|
||||
|
||||
get modifiedText()
|
||||
{
|
||||
return this.mAccEventSubject.modifiedText;
|
||||
},
|
||||
|
||||
get caretOffset()
|
||||
{
|
||||
return this.mAccEventSubject.caretOffset;
|
||||
}
|
||||
};
|
||||
|
|
@ -1,99 +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
|
||||
- Mozilla Foundation.
|
||||
- Portions created by the Initial Developer are Copyright (C) 2007
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Alexander Surkov <surkov.alexander@gmail.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 ***** -->
|
||||
|
||||
<!DOCTYPE page [
|
||||
<!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/inspector.dtd"> %dtd1;
|
||||
<!ENTITY % dtd2 SYSTEM "chrome://inspector/content/util.dtd"> %dtd2;
|
||||
<!ENTITY % dtd3 SYSTEM "chrome://inspector/locale/viewers/accessibleEvent.dtd"> %dtd3;
|
||||
]>
|
||||
|
||||
<?xml-stylesheet href="chrome://inspector/skin"?>
|
||||
|
||||
<page id="winAccessibleEvent"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/jsutil/xpcom/XPCU.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/jsutil/events/ObserverManager.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/viewers/accessibleEvent/accessibleEvent.js"/>
|
||||
|
||||
<grid>
|
||||
<columns>
|
||||
<column/>
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<description>&descIsFromUserInput.label;</description>
|
||||
<description prop="isFromUserInput"/>
|
||||
</row>
|
||||
<row>
|
||||
<description>&descState.label;</description>
|
||||
<description prop="state" class="stateChangeEvent"/>
|
||||
</row>
|
||||
<row>
|
||||
<description>&descIsEnabled.label;</description>
|
||||
<description prop="isEnabled" class="stateChangeEvent"/>
|
||||
</row>
|
||||
<row>
|
||||
<description>&descStartOffset.label;</description>
|
||||
<description prop="startOffset" class="textChangeEvent"/>
|
||||
</row>
|
||||
<row>
|
||||
<description>&descLength.label;</description>
|
||||
<description prop="length" class="textChangeEvent"/>
|
||||
</row>
|
||||
<row>
|
||||
<description>&descIsInserted.label;</description>
|
||||
<description prop="isInserted" class="textChangeEvent"/>
|
||||
</row>
|
||||
<row>
|
||||
<description>&descModifiedText.label;</description>
|
||||
<description prop="modifiedText" class="textChangeEvent"/>
|
||||
</row>
|
||||
<row>
|
||||
<description>&descCaretOffset.label;</description>
|
||||
<description prop="caretOffset" class="caretMoveEvent"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</page>
|
||||
|
|
@ -1,246 +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
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2007
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alexander Surkov <surkov.alexander@gmail.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 ***** */
|
||||
|
||||
/***************************************************************
|
||||
* AccessibleEventsViewer --------------------------------------------
|
||||
* The viewer for the accessible events occured on a document accessible.
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
* REQUIRED IMPORTS:
|
||||
* chrome://inspector/content/jsutil/xpcom/XPCU.js
|
||||
****************************************************************/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Global Variables
|
||||
|
||||
var viewer;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Global Constants
|
||||
|
||||
const kObserverServiceCID = "@mozilla.org/observer-service;1";
|
||||
const kAccessibleRetrievalCID = "@mozilla.org/accessibleRetrieval;1";
|
||||
|
||||
const nsIObserverService = Components.interfaces.nsIObserverService;
|
||||
const nsIAccessibleRetrieval = Components.interfaces.nsIAccessibleRetrieval;
|
||||
const nsIAccessibleEvent = Components.interfaces.nsIAccessibleEvent;
|
||||
const nsIAccessNode = Components.interfaces.nsIAccessNode;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Initialization
|
||||
|
||||
window.addEventListener("load", AccessibleEventsViewer_initialize, false);
|
||||
|
||||
function AccessibleEventsViewer_initialize()
|
||||
{
|
||||
viewer = new AccessibleEventsViewer();
|
||||
viewer.initialize(parent.FrameExchange.receiveData(window));
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// class AccessibleEventsViewer
|
||||
|
||||
function AccessibleEventsViewer()
|
||||
{
|
||||
this.mURL = window.location;
|
||||
this.mObsMan = new ObserverManager(this);
|
||||
|
||||
this.mTree = document.getElementById("olAccessibleEvents");
|
||||
this.mOlBox = this.mTree.treeBoxObject;
|
||||
}
|
||||
|
||||
AccessibleEventsViewer.prototype =
|
||||
{
|
||||
// initialization
|
||||
|
||||
mSubject: null,
|
||||
mPane: null,
|
||||
mView: null,
|
||||
|
||||
// interface inIViewer
|
||||
|
||||
get uid() { return "accessibleEvents"; },
|
||||
get pane() { return this.mPane; },
|
||||
get selection() { return this.mSelection; },
|
||||
|
||||
get subject() { return this.mSubject; },
|
||||
set subject(aObject)
|
||||
{
|
||||
this.mView = new AccessibleEventsView(aObject);
|
||||
this.mOlBox.view = this.mView;
|
||||
this.mObsMan.dispatchEvent("subjectChange", { subject: aObject });
|
||||
},
|
||||
|
||||
initialize: function initialize(aPane)
|
||||
{
|
||||
this.mPane = aPane;
|
||||
aPane.notifyViewerReady(this);
|
||||
},
|
||||
|
||||
destroy: function destroy()
|
||||
{
|
||||
this.mView.destroy();
|
||||
this.mOlBox.view = null;
|
||||
},
|
||||
|
||||
isCommandEnabled: function isCommandEnabled(aCommand)
|
||||
{
|
||||
return false;
|
||||
},
|
||||
|
||||
getCommand: function getCommand(aCommand)
|
||||
{
|
||||
return null;
|
||||
},
|
||||
|
||||
// event dispatching
|
||||
|
||||
addObserver: function addObserver(aEvent, aObserver)
|
||||
{
|
||||
this.mObsMan.addObserver(aEvent, aObserver);
|
||||
},
|
||||
removeObserver: function removeObserver(aEvent, aObserver)
|
||||
{
|
||||
this.mObsMan.removeObserver(aEvent, aObserver);
|
||||
},
|
||||
|
||||
// utils
|
||||
|
||||
onItemSelected: function onItemSelected()
|
||||
{
|
||||
var idx = this.mTree.currentIndex;
|
||||
this.mSelection = this.mView.getDOMNode(idx);
|
||||
this.mObsMan.dispatchEvent("selectionChange",
|
||||
{ selection: this.mSelection } );
|
||||
},
|
||||
|
||||
clearEventsList: function clearEventsList()
|
||||
{
|
||||
this.mView.clear();
|
||||
}
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// AccessibleEventsView
|
||||
|
||||
function AccessibleEventsView(aDocument)
|
||||
{
|
||||
this.mDocument = aDocument;
|
||||
this.mEvents = [];
|
||||
this.mRowCount = 0;
|
||||
|
||||
this.mAccService = XPCU.getService(kAccessibleRetrievalCID,
|
||||
nsIAccessibleRetrieval);
|
||||
|
||||
this.mAccDocument = this.mAccService.getAccessibleFor(this.mDocument);
|
||||
this.mObserverService = XPCU.getService(kObserverServiceCID,
|
||||
nsIObserverService);
|
||||
|
||||
this.mObserverService.addObserver(this, "accessible-event", false);
|
||||
}
|
||||
|
||||
AccessibleEventsView.prototype = new inBaseTreeView();
|
||||
|
||||
AccessibleEventsView.prototype.observe =
|
||||
function observe(aSubject, aTopic, aData)
|
||||
{
|
||||
var event = XPCU.QI(aSubject, nsIAccessibleEvent);
|
||||
var accessible = event.accessible;
|
||||
if (!accessible)
|
||||
return;
|
||||
|
||||
var accessnode = XPCU.QI(accessible, nsIAccessNode);
|
||||
var accDocument = accessnode.accessibleDocument;
|
||||
if (accDocument != this.mAccDocument)
|
||||
return;
|
||||
|
||||
var type = event.eventType;
|
||||
var date = new Date();
|
||||
var node = accessnode.DOMNode;
|
||||
|
||||
var eventObj = {
|
||||
event: event,
|
||||
accessnode: accessnode,
|
||||
node: node,
|
||||
nodename: node ? node.nodeName : "",
|
||||
type: this.mAccService.getStringEventType(type),
|
||||
time: date.toLocaleTimeString()
|
||||
};
|
||||
|
||||
this.mEvents.unshift(eventObj);
|
||||
++this.mRowCount;
|
||||
this.mTree.rowCountChanged(0, 1);
|
||||
}
|
||||
|
||||
AccessibleEventsView.prototype.destroy =
|
||||
function destroy()
|
||||
{
|
||||
this.mObserverService.removeObserver(this, "accessible-event");
|
||||
}
|
||||
|
||||
AccessibleEventsView.prototype.clear =
|
||||
function clear()
|
||||
{
|
||||
var count = this.mRowCount;
|
||||
this.mRowCount = 0;
|
||||
this.mEvents = [];
|
||||
this.mTree.rowCountChanged(0, -count);
|
||||
}
|
||||
|
||||
AccessibleEventsView.prototype.getDOMNode =
|
||||
function getDOMNode(aRow)
|
||||
{
|
||||
var event = this.mEvents[aRow].event;
|
||||
var DOMNode = this.mEvents[aRow].node;
|
||||
var accessNode = this.mEvents[aRow].accessnode;
|
||||
|
||||
DOMNode.setUserData("accessible", accessNode, null);
|
||||
DOMNode.setUserData("accessibleEvent", event, null);
|
||||
return DOMNode;
|
||||
}
|
||||
|
||||
AccessibleEventsView.prototype.getCellText =
|
||||
function getCellText(aRow, aCol)
|
||||
{
|
||||
if (aCol.id == "olcEventType")
|
||||
return this.mEvents[aRow].type;
|
||||
if (aCol.id == "olcEventTime")
|
||||
return this.mEvents[aRow].time;
|
||||
if (aCol.id == "olcEventTargetNodeName")
|
||||
return this.mEvents[aRow].nodename;
|
||||
return "";
|
||||
}
|
||||
|
|
@ -1,90 +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
|
||||
- Mozilla Foundation.
|
||||
- Portions created by the Initial Developer are Copyright (C) 2007
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Alexander Surkov <surkov.alexander@gmail.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 ***** -->
|
||||
|
||||
<!DOCTYPE page [
|
||||
<!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/inspector.dtd"> %dtd1;
|
||||
<!ENTITY % dtd2 SYSTEM "chrome://inspector/content/util.dtd"> %dtd2;
|
||||
<!ENTITY % dtd3 SYSTEM "chrome://inspector/locale/viewers/accessibleEvents.dtd"> %dtd3;
|
||||
]>
|
||||
|
||||
<?xml-stylesheet href="chrome://inspector/skin/"?>
|
||||
|
||||
<page id="winAccessibleEvents"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/jsutil/xul/inBaseTreeView.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/jsutil/xpcom/XPCU.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/jsutil/events/ObserverManager.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/viewers/accessibleEvents/accessibleEvents.js"/>
|
||||
|
||||
<button label="&clearEventList.label;"
|
||||
oncommand="viewer.clearEventsList();"/>
|
||||
|
||||
<tree id="olAccessibleEvents"
|
||||
class="plain"
|
||||
flex="1"
|
||||
onselect="viewer.onItemSelected()">
|
||||
|
||||
<treecols>
|
||||
<treecol id="olcEventType"
|
||||
label="&eventType.label;"
|
||||
primary="true"
|
||||
persist="width,hidden,ordinal"
|
||||
flex="2"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="olcEventTargetNodeName"
|
||||
label="&eventNodeName.label;"
|
||||
persist="width,hidden,ordinal"
|
||||
flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="olcEventTime"
|
||||
label="&eventTime.label;"
|
||||
persist="width,hidden,ordinal"
|
||||
flex="1"/>
|
||||
</treecols>
|
||||
<treechildren id="olbAccessibleEvents"
|
||||
alternatingbackground="true"/>
|
||||
</tree>
|
||||
|
||||
</page>
|
||||
|
|
@ -1,109 +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
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alexander Surkov <surkov.alexander@gmail.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 ***** */
|
||||
|
||||
/***************************************************************
|
||||
* AccessibleObjectViewer --------------------------------------------
|
||||
* The viewer for the accessible object.
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
* REQUIRED IMPORTS:
|
||||
* chrome://inspector/content/jsutil/events/ObserverManager.js
|
||||
****************************************************************/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Global Variables
|
||||
|
||||
var viewer;
|
||||
var bundle;
|
||||
var accService;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Global Constants
|
||||
|
||||
const kAccessibleRetrievalCID = "@mozilla.org/accessibleRetrieval;1";
|
||||
|
||||
const nsIAccessibleRetrieval = Components.interfaces.nsIAccessibleRetrieval;
|
||||
const nsIAccessible = Components.interfaces.nsIAccessible;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Initialization/Destruction
|
||||
|
||||
window.addEventListener("load", AccessibleObjectViewer_initialize, false);
|
||||
|
||||
function AccessibleObjectViewer_initialize()
|
||||
{
|
||||
bundle = document.getElementById("inspector-bundle");
|
||||
accService = XPCU.getService(kAccessibleRetrievalCID, nsIAccessibleRetrieval);
|
||||
|
||||
viewer = new JSObjectViewer();
|
||||
|
||||
viewer.__defineGetter__(
|
||||
"uid",
|
||||
function uidGetter()
|
||||
{
|
||||
return "accessibleObject";
|
||||
}
|
||||
);
|
||||
|
||||
viewer.__defineSetter__(
|
||||
"subject",
|
||||
function subjectSetter(aObject)
|
||||
{
|
||||
var accObject = null;
|
||||
try {
|
||||
accObject = aObject.getUserData("accessible");
|
||||
if (accObject)
|
||||
XPCU.QI(accObject, nsIAccessible);
|
||||
else
|
||||
accObject = accService.getAccessibleFor(aObject);
|
||||
} catch(e) {
|
||||
dump("Failed to get accessible object for node.");
|
||||
}
|
||||
|
||||
this.mSubject = accObject;
|
||||
this.emptyTree(this.mTreeKids);
|
||||
var ti = this.addTreeItem(this.mTreeKids,
|
||||
bundle.getString("root.title"),
|
||||
accObject,
|
||||
accObject);
|
||||
ti.setAttribute("open", "true");
|
||||
|
||||
this.mObsMan.dispatchEvent("subjectChange", { subject: accObject });
|
||||
}
|
||||
);
|
||||
|
||||
viewer.initialize(parent.FrameExchange.receiveData(window));
|
||||
}
|
|
@ -1,53 +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
|
||||
- Mozilla Foundation.
|
||||
- Portions created by the Initial Developer are Copyright (C) 2006
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Alexander Surkov <surkov.alexander@gmail.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 ***** -->
|
||||
|
||||
<?xul-overlay href="chrome://inspector/content/viewers/jsObject/jsObjectViewer.xul"?>
|
||||
|
||||
<page id="winAccessibleObject"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/viewers/accessibleObject/accessibleObject.js"/>
|
||||
|
||||
<stringbundle id="inspector-bundle"/>
|
||||
<commandset id="cmdsJSObjectViewer"/>
|
||||
|
||||
<popup id="popupContext"/>
|
||||
<tree id="treeJSObject"/>
|
||||
</page>
|
|
@ -1,266 +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
|
||||
* Alexander Surkov.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alexander Surkov <surkov.alexander@gmail.com> (original author)
|
||||
* Vasiliy Potapenko <vasiliy.potapenko@gmail.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 ***** */
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Global Variables
|
||||
|
||||
var viewer;
|
||||
var gBundle;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Global Constants
|
||||
|
||||
const kAccessibleRetrievalCID = "@mozilla.org/accessibleRetrieval;1";
|
||||
|
||||
const nsIAccessibleRetrieval = Components.interfaces.nsIAccessibleRetrieval;
|
||||
const nsIAccessible = Components.interfaces.nsIAccessible;
|
||||
|
||||
const nsIPropertyElement = Components.interfaces.nsIPropertyElement;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Initialization/Destruction
|
||||
|
||||
window.addEventListener("load", AccessiblePropsViewer_initialize, false);
|
||||
|
||||
function AccessiblePropsViewer_initialize()
|
||||
{
|
||||
gBundle = document.getElementById("accessiblePropsBundle");
|
||||
|
||||
viewer = new AccessiblePropsViewer();
|
||||
viewer.initialize(parent.FrameExchange.receiveData(window));
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// class AccessiblePropsViewer
|
||||
function AccessiblePropsViewer()
|
||||
{
|
||||
this.mURL = window.location;
|
||||
this.mObsMan = new ObserverManager(this);
|
||||
this.mAccService = XPCU.getService(kAccessibleRetrievalCID,
|
||||
nsIAccessibleRetrieval);
|
||||
}
|
||||
|
||||
AccessiblePropsViewer.prototype =
|
||||
{
|
||||
mSubject: null,
|
||||
mPane: null,
|
||||
mAccSubject: null,
|
||||
mAccService: null,
|
||||
|
||||
get uid() { return "accessibleProps" },
|
||||
get pane() { return this.mPane },
|
||||
|
||||
get subject() { return this.mSubject },
|
||||
set subject(aObject)
|
||||
{
|
||||
this.mSubject = aObject;
|
||||
this.updateView();
|
||||
this.mObsMan.dispatchEvent("subjectChange", { subject: aObject });
|
||||
},
|
||||
|
||||
initialize: function initialize(aPane)
|
||||
{
|
||||
this.mPane = aPane;
|
||||
aPane.notifyViewerReady(this);
|
||||
},
|
||||
|
||||
isCommandEnabled: function isCommandEnabled(aCommand)
|
||||
{
|
||||
return false;
|
||||
},
|
||||
|
||||
getCommand: function getCommand(aCommand)
|
||||
{
|
||||
return null;
|
||||
},
|
||||
|
||||
destroy: function destroy() {},
|
||||
|
||||
// event dispatching
|
||||
|
||||
addObserver: function addObserver(aEvent, aObserver)
|
||||
{
|
||||
this.mObsMan.addObserver(aEvent, aObserver);
|
||||
},
|
||||
removeObserver: function removeObserver(aEvent, aObserver)
|
||||
{
|
||||
this.mObsMan.removeObserver(aEvent, aObserver);
|
||||
},
|
||||
|
||||
// private
|
||||
updateView: function updateView()
|
||||
{
|
||||
this.clearView();
|
||||
|
||||
try {
|
||||
this.mAccSubject = this.mSubject.getUserData("accessible");
|
||||
if (this.mAccSubject)
|
||||
XPCU.QI(this.mAccSubject, nsIAccessible);
|
||||
else
|
||||
this.mAccSubject = this.mAccService.getAccessibleFor(this.mSubject);
|
||||
} catch(e) {
|
||||
dump("Failed to get accessible object for node.");
|
||||
return;
|
||||
}
|
||||
|
||||
// accessible properties.
|
||||
var containers = document.getElementsByAttribute("prop", "*");
|
||||
for (var i = 0; i < containers.length; ++i) {
|
||||
var value = "";
|
||||
try {
|
||||
var prop = containers[i].getAttribute("prop");
|
||||
value = this[prop];
|
||||
} catch (e) {
|
||||
dump("Accessibility " + prop + " property is not available.\n");
|
||||
}
|
||||
|
||||
if (value instanceof Array)
|
||||
containers[i].textContent = value.join(", ");
|
||||
else
|
||||
containers[i].textContent = value;
|
||||
}
|
||||
|
||||
// accessible bounds
|
||||
var x = { value: 0 };
|
||||
var y = { value: 0 };
|
||||
var width = {value: 0 };
|
||||
var height = {value: 0 };
|
||||
this.mAccSubject.getBounds(x, y, width, height);
|
||||
|
||||
document.getElementById("bounds-x").textContent =
|
||||
gBundle.getFormattedString("accBoundsX", [x.value]);
|
||||
document.getElementById("bounds-y").textContent =
|
||||
gBundle.getFormattedString("accBoundsY", [y.value]);
|
||||
document.getElementById("bounds-width").textContent =
|
||||
gBundle.getFormattedString("accBoundsWidth", [width.value]);
|
||||
document.getElementById("bounds-height").textContent =
|
||||
gBundle.getFormattedString("accBoundsHeight", [height.value]);
|
||||
|
||||
// accessible attributes
|
||||
var attrs = this.mAccSubject.attributes;
|
||||
if (attrs) {
|
||||
var enumerate = attrs.enumerate();
|
||||
while (enumerate.hasMoreElements())
|
||||
this.addAccessibleAttribute(enumerate.getNext());
|
||||
}
|
||||
},
|
||||
|
||||
addAccessibleAttribute: function addAccessibleAttribute(aElement)
|
||||
{
|
||||
var prop = XPCU.QI(aElement, nsIPropertyElement);
|
||||
|
||||
var trAttrBody = document.getElementById("trAttrBody");
|
||||
|
||||
var ti = document.createElement("treeitem");
|
||||
var tr = document.createElement("treerow");
|
||||
|
||||
var tc = document.createElement("treecell");
|
||||
tc.setAttribute("label", prop.key);
|
||||
tr.appendChild(tc);
|
||||
|
||||
tc = document.createElement("treecell");
|
||||
tc.setAttribute("label", prop.value);
|
||||
tr.appendChild(tc);
|
||||
|
||||
ti.appendChild(tr);
|
||||
|
||||
trAttrBody.appendChild(ti);
|
||||
},
|
||||
|
||||
removeAccessibleAttributes: function removeAccessibleAttributes()
|
||||
{
|
||||
var trAttrBody = document.getElementById("trAttrBody");
|
||||
while (trAttrBody.hasChildNodes())
|
||||
trAttrBody.removeChild(trAttrBody.lastChild)
|
||||
},
|
||||
|
||||
clearView: function clearView()
|
||||
{
|
||||
var containers = document.getElementsByAttribute("prop", "*");
|
||||
for (var i = 0; i < containers.length; ++i)
|
||||
containers[i].textContent = "";
|
||||
|
||||
this.removeAccessibleAttributes();
|
||||
},
|
||||
|
||||
get role()
|
||||
{
|
||||
return this.mAccService.getStringRole(this.mAccSubject.finalRole);
|
||||
},
|
||||
|
||||
get name()
|
||||
{
|
||||
return this.mAccSubject.name;
|
||||
},
|
||||
|
||||
get description()
|
||||
{
|
||||
return this.mAccSubject.description;
|
||||
},
|
||||
|
||||
get value()
|
||||
{
|
||||
return this.mAccSubject.value;
|
||||
},
|
||||
|
||||
get state()
|
||||
{
|
||||
var stateObj = {value: null};
|
||||
var extStateObj = {value: null};
|
||||
this.mAccSubject.getFinalState(stateObj, extStateObj);
|
||||
|
||||
var list = [];
|
||||
|
||||
states = this.mAccService.getStringStates(stateObj.value, extStateObj.value);
|
||||
|
||||
for (var i = 0; i < states.length; i++)
|
||||
list.push(states.item(i));
|
||||
return list;
|
||||
},
|
||||
|
||||
get actionNames()
|
||||
{
|
||||
var list = [];
|
||||
|
||||
var count = this.mAccSubject.numActions;
|
||||
for (var i = 0; i < count; i++)
|
||||
list.push(this.mAccSubject.getActionName(i));
|
||||
return list;
|
||||
}
|
||||
};
|
|
@ -1,122 +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
|
||||
- Alexander Surkov.
|
||||
- Portions created by the Initial Developer are Copyright (C) 2006
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Alexander Surkov <surkov.alexander@gmail.com> (original author)
|
||||
- Vasiliy Potapenko <vasiliy.potapenko@gmail.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 ***** -->
|
||||
|
||||
<!DOCTYPE page [
|
||||
<!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/inspector.dtd"> %dtd1;
|
||||
<!ENTITY % dtd2 SYSTEM "chrome://inspector/content/util.dtd"> %dtd2;
|
||||
<!ENTITY % dtd3 SYSTEM "chrome://inspector/locale/viewers/accessibleProps.dtd"> %dtd3;
|
||||
]>
|
||||
|
||||
<?xml-stylesheet href="chrome://inspector/skin"?>
|
||||
|
||||
<page id="winAccessibleProps"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/jsutil/xpcom/XPCU.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/jsutil/events/ObserverManager.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/viewers/accessibleProps/accessibleProps.js"/>
|
||||
|
||||
<stringbundle id="accessiblePropsBundle"
|
||||
src="chrome://inspector/locale/viewers/accessibleProps.properties"/>
|
||||
|
||||
<grid>
|
||||
<columns>
|
||||
<column/>
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<description>&descRole.label;</description>
|
||||
<description prop="role"/>
|
||||
</row>
|
||||
<row>
|
||||
<description>&descName.label;</description>
|
||||
<description prop="name"/>
|
||||
</row>
|
||||
<row>
|
||||
<description>&descDescription.label;</description>
|
||||
<description prop="description"/>
|
||||
</row>
|
||||
<row>
|
||||
<description>&descValue.label;</description>
|
||||
<description prop="value"/>
|
||||
</row>
|
||||
<row>
|
||||
<description>&descState.label;</description>
|
||||
<description prop="state"/>
|
||||
</row>
|
||||
<row>
|
||||
<description>&descActionName.label;</description>
|
||||
<description prop="actionNames"/>
|
||||
</row>
|
||||
<row>
|
||||
<description>&descBounds.label;</description>
|
||||
<grid>
|
||||
<columns>
|
||||
<column/>
|
||||
<column/>
|
||||
<column/>
|
||||
<column/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<description id="bounds-x"/>
|
||||
<description id="bounds-y"/>
|
||||
<description id="bounds-width"/>
|
||||
<description id="bounds-height"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<tree flex="1">
|
||||
<treecols>
|
||||
<treecol label="attrKey" flex="1"/>
|
||||
<treecol label="attrValue" flex="2"/>
|
||||
</treecols>
|
||||
<treechildren id="trAttrBody"/>
|
||||
</tree>
|
||||
</page>
|
||||
|
|
@ -1,270 +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
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2007
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alexander Surkov <surkov.alexander@gmail.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 ***** */
|
||||
|
||||
/***************************************************************
|
||||
* AccessibleRelationsViewer --------------------------------------------
|
||||
* The viewer for the accessible relations for the inspected accessible.
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
* REQUIRED IMPORTS:
|
||||
* chrome://inspector/content/jsutil/xpcom/XPCU.js
|
||||
****************************************************************/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Global Variables
|
||||
|
||||
var viewer;
|
||||
var gAccService = null;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Global Constants
|
||||
|
||||
const kAccessibleRetrievalCID = "@mozilla.org/accessibleRetrieval;1";
|
||||
|
||||
const nsIAccessibleRetrieval = Components.interfaces.nsIAccessibleRetrieval;
|
||||
const nsIAccessibleRelation = Components.interfaces.nsIAccessibleRelation;
|
||||
const nsIAccessNode = Components.interfaces.nsIAccessNode;
|
||||
const nsIAccessible = Components.interfaces.nsIAccessible;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Initialization
|
||||
|
||||
window.addEventListener("load", AccessibleRelationsViewer_initialize, false);
|
||||
|
||||
function AccessibleRelationsViewer_initialize()
|
||||
{
|
||||
gAccService = XPCU.getService(kAccessibleRetrievalCID,
|
||||
nsIAccessibleRetrieval);
|
||||
|
||||
viewer = new AccessibleRelationsViewer();
|
||||
viewer.initialize(parent.FrameExchange.receiveData(window));
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// class AccessibleRelationsViewer
|
||||
|
||||
function AccessibleRelationsViewer()
|
||||
{
|
||||
this.mURL = window.location;
|
||||
this.mObsMan = new ObserverManager(this);
|
||||
|
||||
this.mTree = document.getElementById("olAccessibleRelations");
|
||||
this.mTreeBox = this.mTree.treeBoxObject;
|
||||
|
||||
this.mTargetsTree = document.getElementById("olAccessibleTargets");
|
||||
this.mTargetsTreeBox = this.mTargetsTree.treeBoxObject;
|
||||
}
|
||||
|
||||
AccessibleRelationsViewer.prototype =
|
||||
{
|
||||
/////////////////////////
|
||||
//// initialization
|
||||
|
||||
mSubject: null,
|
||||
mPane: null,
|
||||
mView: null,
|
||||
mTargetsView: null,
|
||||
|
||||
/////////////////////////
|
||||
//// interface inIViewer
|
||||
|
||||
get uid() { return "accessibleRelations"; },
|
||||
get pane() { return this.mPane; },
|
||||
get selection() { return this.mSelection; },
|
||||
|
||||
get subject() { return this.mSubject; },
|
||||
set subject(aObject)
|
||||
{
|
||||
this.mView = new AccessibleRelationsView(aObject);
|
||||
this.mTreeBox.view = this.mView;
|
||||
this.mObsMan.dispatchEvent("subjectChange", { subject: aObject });
|
||||
},
|
||||
|
||||
initialize: function initialize(aPane)
|
||||
{
|
||||
this.mPane = aPane;
|
||||
aPane.notifyViewerReady(this);
|
||||
},
|
||||
|
||||
destroy: function destroy()
|
||||
{
|
||||
this.mTreeBox.view = null;
|
||||
this.mTargetsTreeBox.view = null;
|
||||
},
|
||||
|
||||
isCommandEnabled: function isCommandEnabled(aCommand)
|
||||
{
|
||||
return false;
|
||||
},
|
||||
|
||||
getCommand: function getCommand(aCommand)
|
||||
{
|
||||
return null;
|
||||
},
|
||||
|
||||
/////////////////////////
|
||||
//// event dispatching
|
||||
|
||||
addObserver: function addObserver(aEvent, aObserver)
|
||||
{
|
||||
this.mObsMan.addObserver(aEvent, aObserver);
|
||||
},
|
||||
removeObserver: function removeObserver(aEvent, aObserver)
|
||||
{
|
||||
this.mObsMan.removeObserver(aEvent, aObserver);
|
||||
},
|
||||
|
||||
/////////////////////////
|
||||
//// utils
|
||||
|
||||
onItemSelected: function onItemSelected()
|
||||
{
|
||||
var idx = this.mTree.currentIndex;
|
||||
var relation = this.mView.getRelationObject(idx);
|
||||
this.mTargetsView = new AccessibleTargetsView(relation);
|
||||
this.mTargetsTreeBox.view = this.mTargetsView;
|
||||
},
|
||||
|
||||
cmdInspectInNewView: function cmdInspectInNewView()
|
||||
{
|
||||
var idx = this.mTargetsTree.currentIndex;
|
||||
if (idx >= 0) {
|
||||
var node = this.mTargetsView.getDOMNode(idx);
|
||||
if (node)
|
||||
inspectObject(node);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// AccessibleRelationsView
|
||||
|
||||
function AccessibleRelationsView(aNode)
|
||||
{
|
||||
this.mNode = aNode;
|
||||
|
||||
this.mAccessible = aNode.getUserData("accessible");
|
||||
if (this.mAccessible)
|
||||
XPCU.QI(this.mAccessible, nsIAccessible);
|
||||
else
|
||||
this.mAccessible = gAccService.getAccessibleFor(aNode);
|
||||
|
||||
this.mRelations = this.mAccessible.getRelations();
|
||||
}
|
||||
|
||||
AccessibleRelationsView.prototype = new inBaseTreeView();
|
||||
|
||||
AccessibleRelationsView.prototype.__defineGetter__("rowCount",
|
||||
function rowCount()
|
||||
{
|
||||
return this.mRelations.length;
|
||||
});
|
||||
|
||||
AccessibleRelationsView.prototype.getRelationObject =
|
||||
function getRelationObject(aRow)
|
||||
{
|
||||
return this.mRelations.queryElementAt(aRow, nsIAccessibleRelation);
|
||||
}
|
||||
|
||||
AccessibleRelationsView.prototype.getCellText =
|
||||
function getCellText(aRow, aCol)
|
||||
{
|
||||
if (aCol.id == "olcRelationType") {
|
||||
var relation = this.getRelationObject(aRow);
|
||||
if (relation)
|
||||
return gAccService.getStringRelationType(relation.relationType);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// AccessibleTargetsView
|
||||
|
||||
function AccessibleTargetsView(aRelation)
|
||||
{
|
||||
this.mRelation = aRelation;
|
||||
this.mTargets = this.mRelation.getTargets();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// AccessibleTargetsView. nsITreeView
|
||||
|
||||
AccessibleTargetsView.prototype = new inBaseTreeView();
|
||||
|
||||
AccessibleTargetsView.prototype.__defineGetter__("rowCount",
|
||||
function rowCount()
|
||||
{
|
||||
return this.mTargets.length;
|
||||
});
|
||||
|
||||
AccessibleTargetsView.prototype.getCellText =
|
||||
function getCellText(aRow, aCol)
|
||||
{
|
||||
if (aCol.id == "olcRole") {
|
||||
var accessible = this.getAccessible(aRow);
|
||||
if (accessible)
|
||||
return gAccService.getStringRole(accessible.finalRole);
|
||||
} else if (aCol.id == "olcNodeName") {
|
||||
var node = this.getDOMNode(aRow);
|
||||
if (node)
|
||||
return node.nodeName;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// AccessibleTargetsView. Utils
|
||||
|
||||
AccessibleTargetsView.prototype.getAccessible =
|
||||
function getAccessible(aRow)
|
||||
{
|
||||
return this.mTargets.queryElementAt(aRow, nsIAccessible);
|
||||
}
|
||||
|
||||
AccessibleTargetsView.prototype.getDOMNode =
|
||||
function getDOMNode(aRow)
|
||||
{
|
||||
var accessNode = this.mTargets.queryElementAt(aRow, nsIAccessNode);
|
||||
if (!accessNode)
|
||||
return null;
|
||||
|
||||
var DOMNode = accessNode.DOMNode;
|
||||
DOMNode.setUserData("accessible", accessNode, null);
|
||||
return DOMNode;
|
||||
}
|
||||
|
|
@ -1,116 +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
|
||||
- Mozilla Foundation.
|
||||
- Portions created by the Initial Developer are Copyright (C) 2007
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Alexander Surkov <surkov.alexander@gmail.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 ***** -->
|
||||
|
||||
<!DOCTYPE page [
|
||||
<!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/inspector.dtd"> %dtd1;
|
||||
<!ENTITY % dtd2 SYSTEM "chrome://inspector/content/util.dtd"> %dtd2;
|
||||
<!ENTITY % dtd3 SYSTEM "chrome://inspector/locale/viewers/accessibleRelations.dtd"> %dtd3;
|
||||
]>
|
||||
|
||||
<?xml-stylesheet href="chrome://inspector/skin/"?>
|
||||
|
||||
<page id="winAccessibleEvents"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/jsutil/xul/inBaseTreeView.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/jsutil/xpcom/XPCU.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/jsutil/events/ObserverManager.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/hooks.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/viewers/accessibleRelations/accessibleRelations.js"/>
|
||||
|
||||
<commandset id="cmdsJSObjectViewer">
|
||||
<command id="cmdInspectInNewView"
|
||||
oncommand="viewer.cmdInspectInNewView();"/>
|
||||
</commandset>
|
||||
|
||||
<menupopup id="popupContext">
|
||||
<menuitem label="&inspectNewWindow.label;"
|
||||
observes="cmdInspectInNewView"/>
|
||||
</menupopup>
|
||||
|
||||
<label control="olAccessibleRelations"
|
||||
value="&relations.label;"/>
|
||||
|
||||
<tree id="olAccessibleRelations"
|
||||
class="plain"
|
||||
flex="1"
|
||||
onselect="viewer.onItemSelected()">
|
||||
|
||||
<treecols>
|
||||
<treecol id="olcRelationType"
|
||||
label="&relationType.label;"
|
||||
primary="true"
|
||||
flex="1"
|
||||
persist="width,hidden,ordinal"/>
|
||||
</treecols>
|
||||
<treechildren id="olbAccessibleRelations"
|
||||
alternatingbackground="true"/>
|
||||
</tree>
|
||||
|
||||
<label control="olAccessibleTargets"
|
||||
value="&relationTargets.label;"/>
|
||||
|
||||
<tree id="olAccessibleTargets"
|
||||
class="plain"
|
||||
flex="1"
|
||||
context="popupContext">
|
||||
|
||||
<treecols>
|
||||
<treecol id="olcRole"
|
||||
primary="true"
|
||||
label="&role.label;"
|
||||
persist="width,hidden,ordinal"
|
||||
flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="olcNodeName"
|
||||
label="&nodeName.label;"
|
||||
persist="width,hidden,ordinal"
|
||||
flex="1"/>
|
||||
</treecols>
|
||||
<treechildren id="olbAccessibleTargets"
|
||||
alternatingbackground="true"/>
|
||||
</tree>
|
||||
|
||||
</page>
|
||||
|
|
@ -1,468 +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
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2007
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alexander Surkov <surkov.alexander@gmail.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 ***** */
|
||||
|
||||
/***************************************************************
|
||||
* AccessibleEventsViewer --------------------------------------------
|
||||
* The viewer for the accessible tree of a document.
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
* REQUIRED IMPORTS:
|
||||
* chrome://inspector/content/jsutil/xpcom/XPCU.js
|
||||
****************************************************************/
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Global Variables
|
||||
|
||||
var viewer;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Global Constants
|
||||
|
||||
const kAccessibleRetrievalCID = "@mozilla.org/accessibleRetrieval;1";
|
||||
|
||||
const nsIAccessibleRetrieval = Components.interfaces.nsIAccessibleRetrieval;
|
||||
const nsIAccessibleEvent = Components.interfaces.nsIAccessibleEvent;
|
||||
const nsIAccessible = Components.interfaces.nsIAccessible;
|
||||
const nsIAccessNode = Components.interfaces.nsIAccessNode;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Initialization
|
||||
|
||||
window.addEventListener("load", AccessibleTreeViewer_initialize, false);
|
||||
|
||||
function AccessibleTreeViewer_initialize()
|
||||
{
|
||||
viewer = new AccessibleTreeViewer();
|
||||
viewer.initialize(parent.FrameExchange.receiveData(window));
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// AccessibleEventsViewer
|
||||
|
||||
function AccessibleTreeViewer()
|
||||
{
|
||||
this.mURL = window.location;
|
||||
this.mObsMan = new ObserverManager(this);
|
||||
|
||||
this.mTree = document.getElementById("olAccessibleTree");
|
||||
this.mOlBox = this.mTree.treeBoxObject;
|
||||
}
|
||||
|
||||
AccessibleTreeViewer.prototype =
|
||||
{
|
||||
//Initialization
|
||||
|
||||
mSubject: null,
|
||||
mPane: null,
|
||||
mView: null,
|
||||
|
||||
// interface inIViewer
|
||||
|
||||
get uid() { return "accessibleTree"; },
|
||||
get pane() { return this.mPane; },
|
||||
get selection() { return this.mSelection; },
|
||||
|
||||
get subject() { return this.mSubject; },
|
||||
set subject(aObject)
|
||||
{
|
||||
this.mView = new inAccTreeView(aObject);
|
||||
this.mOlBox.view = this.mView;
|
||||
this.mObsMan.dispatchEvent("subjectChange", { subject: aObject });
|
||||
this.mView.selection.select(0);
|
||||
},
|
||||
|
||||
initialize: function initialize(aPane)
|
||||
{
|
||||
this.mPane = aPane;
|
||||
aPane.notifyViewerReady(this);
|
||||
},
|
||||
|
||||
destroy: function destroy()
|
||||
{
|
||||
this.mOlBox.view = null;
|
||||
},
|
||||
|
||||
isCommandEnabled: function isCommandEnabled(aCommand)
|
||||
{
|
||||
return false;
|
||||
},
|
||||
|
||||
getCommand: function getCommand(aCommand)
|
||||
{
|
||||
return null;
|
||||
},
|
||||
|
||||
// event dispatching
|
||||
|
||||
addObserver: function addObserver(aEvent, aObserver)
|
||||
{
|
||||
this.mObsMan.addObserver(aEvent, aObserver);
|
||||
},
|
||||
removeObserver: function removeObserver(aEvent, aObserver)
|
||||
{
|
||||
this.mObsMan.removeObserver(aEvent, aObserver);
|
||||
},
|
||||
|
||||
// UI commands
|
||||
cmdEvalJS: function cmdEvalJS()
|
||||
{
|
||||
var sel = this.getSelectedAccessible();
|
||||
if (sel) {
|
||||
var win = openDialog("chrome://inspector/content/viewers/accessibleTree/evalJSDialog.xul",
|
||||
"_blank", "chrome,resizable=yes", sel);
|
||||
}
|
||||
},
|
||||
|
||||
cmdInspectInNewView: function cmdInspectInNewView()
|
||||
{
|
||||
var sel = this.getSelectedAccessible();
|
||||
if (sel)
|
||||
inspectObject(sel);
|
||||
},
|
||||
|
||||
// stuff
|
||||
|
||||
onItemSelected: function onItemSelected()
|
||||
{
|
||||
var idx = this.mTree.currentIndex;
|
||||
this.mSelection = this.mView.getDOMNode(idx);
|
||||
this.mObsMan.dispatchEvent("selectionChange",
|
||||
{ selection: this.mSelection } );
|
||||
},
|
||||
|
||||
getSelectedAccessible: function getSelectedAccessible()
|
||||
{
|
||||
var idx = this.mTree.currentIndex;
|
||||
return this.mView.getAccessible(idx);
|
||||
}
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// inAccTreeView
|
||||
|
||||
function inAccTreeView(aDocument)
|
||||
{
|
||||
this.mNodes = [];
|
||||
|
||||
this.mAccService = XPCU.getService(kAccessibleRetrievalCID,
|
||||
nsIAccessibleRetrieval);
|
||||
|
||||
this.mDocument = aDocument;
|
||||
this.mAccDocument = this.mAccService.getAccessibleFor(aDocument);
|
||||
|
||||
var node = this.createNode(this.mAccDocument);
|
||||
this.mNodes.push(node);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// inAccTreeView. nsITreeView interface
|
||||
|
||||
inAccTreeView.prototype = new inBaseTreeView();
|
||||
|
||||
inAccTreeView.prototype.__defineGetter__("rowCount",
|
||||
function rowCount()
|
||||
{
|
||||
return this.mNodes.length;
|
||||
});
|
||||
|
||||
inAccTreeView.prototype.getCellText =
|
||||
function getCellText(aRow, aCol)
|
||||
{
|
||||
var node = this.rowToNode(aRow);
|
||||
if (!node)
|
||||
return "";
|
||||
|
||||
var accessible = node.accessible;
|
||||
|
||||
if (aCol.id == "olcRole")
|
||||
return this.mAccService.getStringRole(accessible.finalRole);
|
||||
|
||||
if (aCol.id == "olcName")
|
||||
return accessible.name;
|
||||
|
||||
if (aCol.id == "olcNodeName") {
|
||||
var node = this.getDOMNodeFor(accessible);
|
||||
return node ? node.nodeName : "";
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
inAccTreeView.prototype.isContainer =
|
||||
function isContainer(aRow)
|
||||
{
|
||||
var node = this.rowToNode(aRow);
|
||||
return node ? node.isContainer : false;
|
||||
}
|
||||
|
||||
inAccTreeView.prototype.isContainerOpen =
|
||||
function isContainerOpen(aRow)
|
||||
{
|
||||
var node = this.rowToNode(aRow);
|
||||
return node ? node.isOpen : false;
|
||||
}
|
||||
|
||||
inAccTreeView.prototype.isContainerEmpty =
|
||||
function isContainerEmpty(aRow)
|
||||
{
|
||||
return !this.isContainer(aRow);
|
||||
}
|
||||
|
||||
inAccTreeView.prototype.getLevel =
|
||||
function getLevel(aRow)
|
||||
{
|
||||
var node = this.rowToNode(aRow);
|
||||
return node ? node.level : 0;
|
||||
}
|
||||
|
||||
inAccTreeView.prototype.getParentIndex =
|
||||
function getParentIndex(aRow)
|
||||
{
|
||||
var node = this.rowToNode(aRow);
|
||||
if (!node)
|
||||
return -1;
|
||||
|
||||
var checkNode = null;
|
||||
var i = aRow - 1;
|
||||
do {
|
||||
checkNode = this.rowToNode(i);
|
||||
if (!checkNode)
|
||||
return -1;
|
||||
|
||||
if (checkNode == node.parent)
|
||||
return i;
|
||||
--i;
|
||||
} while (checkNode);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
inAccTreeView.prototype.hasNextSibling =
|
||||
function hasNextSibling(aRow, aAfterRow)
|
||||
{
|
||||
var node = this.rowToNode(aRow);
|
||||
return node && (node.next != null);
|
||||
}
|
||||
|
||||
inAccTreeView.prototype.toggleOpenState =
|
||||
function toggleOpenState(aRow)
|
||||
{
|
||||
var node = this.rowToNode(aRow);
|
||||
if (!node)
|
||||
return;
|
||||
|
||||
var oldCount = this.rowCount;
|
||||
if (node.isOpen)
|
||||
this.collapseNode(aRow);
|
||||
else
|
||||
this.expandNode(aRow);
|
||||
|
||||
this.mTree.invalidateRow(aRow);
|
||||
this.mTree.rowCountChanged(aRow + 1, this.rowCount - oldCount);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// inAccTreeView. Tree utils.
|
||||
|
||||
/**
|
||||
* Expands a tree node on the given row.
|
||||
*
|
||||
* @param aRow - row index.
|
||||
*/
|
||||
inAccTreeView.prototype.expandNode =
|
||||
function expandNode(aRow)
|
||||
{
|
||||
var node = this.rowToNode(aRow);
|
||||
if (!node)
|
||||
return;
|
||||
|
||||
var kids = node.accessible.children;
|
||||
var kidCount = kids.length;
|
||||
|
||||
var newNode = null;
|
||||
var prevNode = null;
|
||||
|
||||
for (var i = 0; i < kidCount; ++i) {
|
||||
var accessible = kids.queryElementAt(i, nsIAccessible);
|
||||
newNode = this.createNode(accessible, node);
|
||||
this.mNodes.splice(aRow + i + 1, 0, newNode);
|
||||
|
||||
if (prevNode)
|
||||
prevNode.next = newNode;
|
||||
newNode.previous = prevNode;
|
||||
prevNode = newNode;
|
||||
}
|
||||
|
||||
node.isOpen = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Collapse a tree node on the given row.
|
||||
*
|
||||
* @param aRow - row index.
|
||||
*/
|
||||
inAccTreeView.prototype.collapseNode =
|
||||
function collapseNode(aRow)
|
||||
{
|
||||
var node = this.rowToNode(aRow);
|
||||
if (!node)
|
||||
return;
|
||||
|
||||
var row = this.getLastDescendantOf(node, aRow);
|
||||
this.mNodes.splice(aRow + 1, row - aRow);
|
||||
|
||||
node.isOpen = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a tree node.
|
||||
*
|
||||
* @param aAccessible - an accessible object associated with created tree node.
|
||||
* @param aParent - parent tree node for the created tree node.
|
||||
* @retrurn - tree node object for the given accesible.
|
||||
*/
|
||||
inAccTreeView.prototype.createNode =
|
||||
function createNode(aAccessible, aParent)
|
||||
{
|
||||
var node = new inAccTreeViewNode(aAccessible);
|
||||
node.level = aParent ? aParent.level + 1 : 0;
|
||||
node.parent = aParent;
|
||||
node.isContainer = aAccessible.children.length > 0;
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return row index of the last node that is a descendant of the given node.
|
||||
* If there is no required node then return the given row.
|
||||
*
|
||||
* @param aNode - tree node for that last descedant is searched.
|
||||
* @param aRow - row index of the given tree node.
|
||||
*/
|
||||
inAccTreeView.prototype.getLastDescendantOf =
|
||||
function getLastDescendantOf(aNode, aRow)
|
||||
{
|
||||
var rowCount = this.rowCount;
|
||||
|
||||
var row = aRow + 1;
|
||||
for (; row < rowCount; ++row) {
|
||||
if (this.mNodes[row].level <= aNode.level)
|
||||
return row - 1;
|
||||
}
|
||||
|
||||
return rowCount - 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a tree node by the given row.
|
||||
*
|
||||
* @param aRow - row index.
|
||||
*/
|
||||
inAccTreeView.prototype.rowToNode =
|
||||
function rowToNode(aRow)
|
||||
{
|
||||
if (aRow < 0 || aRow >= this.rowCount)
|
||||
return null;
|
||||
|
||||
return this.mNodes[aRow];
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// inAccTreeView. Accessibility utils.
|
||||
|
||||
/**
|
||||
* Return DOM node for the given accessible.
|
||||
*
|
||||
* @param aAccessible - an accessible object.
|
||||
*/
|
||||
inAccTreeView.prototype.getDOMNodeFor =
|
||||
function getDOMNodeFor(aAccessible)
|
||||
{
|
||||
var accessNode = XPCU.QI(aAccessible, nsIAccessNode);
|
||||
var DOMNode = accessNode.DOMNode;
|
||||
DOMNode.setUserData("accessible", aAccessible, null);
|
||||
return DOMNode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return DOM node for an accessible of the tree node pointed by the given
|
||||
* row index.
|
||||
*
|
||||
* @param aRow - row index.
|
||||
*/
|
||||
inAccTreeView.prototype.getDOMNode =
|
||||
function getDOMNode(aRow)
|
||||
{
|
||||
var node = this.mNodes[aRow];
|
||||
if (!node)
|
||||
return null;
|
||||
|
||||
return this.getDOMNodeFor(node.accessible);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return accessible of the tree node pointed by the given
|
||||
* row index.
|
||||
*
|
||||
* @param aRow The row index to get the accessible from.
|
||||
* @returns The accessible for the given index.
|
||||
*/
|
||||
inAccTreeView.prototype.getAccessible =
|
||||
function getAccessible(aRow)
|
||||
{
|
||||
var node = this.mNodes[aRow];
|
||||
if (!node)
|
||||
return null;
|
||||
|
||||
return node.accessible;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// inAccTreeViewNode
|
||||
|
||||
function inAccTreeViewNode(aAccessible)
|
||||
{
|
||||
this.accessible = aAccessible;
|
||||
|
||||
this.parent = null;
|
||||
this.next = null;
|
||||
this.previous = null;
|
||||
|
||||
this.level = 0;
|
||||
this.isOpen = false;
|
||||
this.isContainer = false;
|
||||
}
|
||||
|
|
@ -1,97 +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
|
||||
- Mozilla Foundation.
|
||||
- Portions created by the Initial Developer are Copyright (C) 2007
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Alexander Surkov <surkov.alexander@gmail.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 ***** -->
|
||||
|
||||
<!DOCTYPE page [
|
||||
<!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/inspector.dtd"> %dtd1;
|
||||
<!ENTITY % dtd2 SYSTEM "chrome://inspector/content/util.dtd"> %dtd2;
|
||||
<!ENTITY % dtd3 SYSTEM "chrome://inspector/locale/viewers/accessibleTree.dtd"> %dtd3;
|
||||
]>
|
||||
|
||||
<?xml-stylesheet href="chrome://inspector/skin/"?>
|
||||
|
||||
<page id="winAccessibleTree"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/jsutil/xul/inBaseTreeView.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/jsutil/xpcom/XPCU.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/jsutil/events/ObserverManager.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/viewers/accessibleTree/accessibleTree.js"/>
|
||||
|
||||
<commandset id="cmdsAccTreeViewer">
|
||||
<command id="cmdEvalJS" oncommand="viewer.cmdEvalJS();"/>
|
||||
<command id="cmdInspectInNewView"
|
||||
oncommand="viewer.cmdInspectInNewView();"/>
|
||||
</commandset>
|
||||
|
||||
<popup id="popupContext">
|
||||
<menuitem label="&inspectNewWindow.label;" observes="cmdInspectInNewView"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&evaluateJS.label;" observes="cmdEvalJS"/>
|
||||
</popup>
|
||||
|
||||
<tree id="olAccessibleTree" class="plain" flex="1"
|
||||
onselect="viewer.onItemSelected()"
|
||||
context="popupContext">
|
||||
<treecols>
|
||||
<treecol id="olcRole"
|
||||
label="&role.label;"
|
||||
persist="width,hidden,ordinal"
|
||||
primary="true"
|
||||
flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="olcName"
|
||||
label="&name.label;"
|
||||
persist="width,hidden,ordinal"
|
||||
flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="olcNodeName"
|
||||
label="&nodeName.label;"
|
||||
persist="width,hidden,ordinal"
|
||||
flex="1"/>
|
||||
</treecols>
|
||||
<treechildren id="olbAccessibleTree"
|
||||
alternatingbackground="true"/>
|
||||
</tree>
|
||||
|
||||
</page>
|
||||
|
|
@ -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
|
||||
* Mozilla Foundation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2008
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Alexander Surkov <surkov.alexander@gmail.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 gAcc = window.arguments[0];
|
||||
|
||||
var gInputArea = null;
|
||||
var gOutputArea = null;
|
||||
|
||||
function load()
|
||||
{
|
||||
gInputArea = document.getElementById("JSInputArea");
|
||||
gOutputArea = document.getElementById("JSOutputArea");
|
||||
}
|
||||
|
||||
function execute()
|
||||
{
|
||||
if (!gAcc)
|
||||
return;
|
||||
|
||||
gOutputArea.value = "";
|
||||
|
||||
var expr = gInputArea.value;
|
||||
try {
|
||||
var f = Function("accessible", expr);
|
||||
var result = f(gAcc);
|
||||
} catch (ex) {
|
||||
output(ex);
|
||||
}
|
||||
}
|
||||
|
||||
function output(aValue)
|
||||
{
|
||||
gOutputArea.value += aValue;
|
||||
}
|
|
@ -1,75 +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
|
||||
- Mozilla Foundation.
|
||||
- Portions created by the Initial Developer are Copyright (C) 2008
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Alexander Surkov <surkov.alexander@gmail.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 ***** -->
|
||||
|
||||
<!DOCTYPE dialog [
|
||||
<!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/viewers/accessibleTreeEvalJSDialog.dtd"> %dtd1;
|
||||
]>
|
||||
|
||||
<?xml-stylesheet href="chrome://inspector/skin"?>
|
||||
|
||||
<dialog id="winEvalJS"
|
||||
title="&evaluateDialog.title;"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
buttons="accept, extra1"
|
||||
buttonlabelextra1="&btnEvaluateJS.label;"
|
||||
buttonaccesskeyextra1="&btnEvaluateJS.accesskey;"
|
||||
ondialogextra1="return execute();"
|
||||
style="width: 30em;"
|
||||
onload="load();">
|
||||
|
||||
<script type="application/x-javascript"
|
||||
src="chrome://inspector/content/viewers/accessibleTree/evalJSDialog.js"/>
|
||||
|
||||
<label control="JSInputArea"
|
||||
accesskey="&txtInputArea.accesskey;">&txtInputArea.label;</label>
|
||||
<textbox id="JSInputArea"
|
||||
flex="1"
|
||||
multiline="true"
|
||||
rows="10"/>
|
||||
|
||||
<label control="JSOutputArea"
|
||||
value="&txtOutputArea.label;"
|
||||
accesskey="&txtOutputArea.accesskey;"/>
|
||||
<textbox id="JSOutputArea"
|
||||
flex="1"
|
||||
multiline="true"
|
||||
readonly="true"
|
||||
rows="8"/>
|
||||
|
||||
</dialog>
|
|
@ -1,250 +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 ***** */
|
||||
|
||||
/***************************************************************
|
||||
* BoxModelViewer --------------------------------------------
|
||||
* The viewer for the boxModel and visual appearance of an element.
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
* REQUIRED IMPORTS:
|
||||
* chrome://inspector/content/jsutil/xpcom/XPCU.js
|
||||
****************************************************************/
|
||||
|
||||
//////////// global variables /////////////////////
|
||||
|
||||
var viewer;
|
||||
|
||||
//////////// global constants ////////////////////
|
||||
|
||||
const kIMPORT_RULE = Components.interfaces.nsIDOMCSSRule.IMPORT_RULE;
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
window.addEventListener("load", BoxModelViewer_initialize, false);
|
||||
|
||||
function BoxModelViewer_initialize()
|
||||
{
|
||||
viewer = new BoxModelViewer();
|
||||
viewer.initialize(parent.FrameExchange.receiveData(window));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// class BoxModelViewer
|
||||
|
||||
function BoxModelViewer()
|
||||
{
|
||||
this.mURL = window.location;
|
||||
this.mObsMan = new ObserverManager(this);
|
||||
}
|
||||
|
||||
BoxModelViewer.prototype =
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// Initialization
|
||||
|
||||
mSubject: null,
|
||||
mPane: null,
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// interface inIViewer
|
||||
|
||||
get uid() { return "boxModel" },
|
||||
get pane() { return this.mPane },
|
||||
|
||||
get subject() { return this.mSubject },
|
||||
set subject(aObject)
|
||||
{
|
||||
this.mSubject = aObject;
|
||||
this.updateStatGroup();
|
||||
this.mObsMan.dispatchEvent("subjectChange", { subject: aObject });
|
||||
},
|
||||
|
||||
initialize: function(aPane)
|
||||
{
|
||||
this.mPane = aPane;
|
||||
aPane.notifyViewerReady(this);
|
||||
},
|
||||
|
||||
destroy: function()
|
||||
{
|
||||
},
|
||||
|
||||
isCommandEnabled: function(aCommand)
|
||||
{
|
||||
return false;
|
||||
},
|
||||
|
||||
getCommand: function(aCommand)
|
||||
{
|
||||
return null;
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// event dispatching
|
||||
|
||||
addObserver: function(aEvent, aObserver) { this.mObsMan.addObserver(aEvent, aObserver); },
|
||||
removeObserver: function(aEvent, aObserver) { this.mObsMan.removeObserver(aEvent, aObserver); },
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// statistical updates
|
||||
|
||||
updateStatGroup: function()
|
||||
{
|
||||
var ml = document.getElementById("mlStats");
|
||||
this.showStatGroup(ml.value);
|
||||
},
|
||||
|
||||
showStatGroup: function(aGroup)
|
||||
{
|
||||
if (aGroup == "position") {
|
||||
this.showPositionStats();
|
||||
} else if (aGroup == "dimension") {
|
||||
this.showDimensionStats();
|
||||
} else if (aGroup == "margin") {
|
||||
this.showMarginStats();
|
||||
} else if (aGroup == "border") {
|
||||
this.showBorderStats();
|
||||
} else if (aGroup == "padding") {
|
||||
this.showPaddingStats();
|
||||
}
|
||||
},
|
||||
|
||||
showStatistic: function(aCol, aRow, aSide, aSize)
|
||||
{
|
||||
var label = document.getElementById("txR"+aRow+"C"+aCol+"Label");
|
||||
var val = document.getElementById("txR"+aRow+"C"+aCol+"Value");
|
||||
label.setAttribute("value", aSide && aSide.length ? aSide + ":" : "");
|
||||
val.setAttribute("value", aSize);
|
||||
},
|
||||
|
||||
showPositionStats: function()
|
||||
{
|
||||
if ("boxObject" in this.mSubject) { // xul elements
|
||||
var bx = this.mSubject.boxObject;
|
||||
this.showStatistic(1, 1, "x", bx.x);
|
||||
this.showStatistic(1, 2, "y", bx.y);
|
||||
this.showStatistic(2, 1, "screen x", bx.screenX);
|
||||
this.showStatistic(2, 2, "screen y", bx.screenY);
|
||||
} else { // html elements
|
||||
this.showStatistic(1, 1, "x", this.mSubject.offsetLeft);
|
||||
this.showStatistic(1, 2, "y", this.mSubject.offsetTop);
|
||||
this.showStatistic(2, 1, "", "");
|
||||
this.showStatistic(2, 2, "", "");
|
||||
}
|
||||
},
|
||||
|
||||
showDimensionStats: function()
|
||||
{
|
||||
if ("boxObject" in this.mSubject) { // xul elements
|
||||
var bx = this.mSubject.boxObject;
|
||||
this.showStatistic(1, 1, "box width", bx.width);
|
||||
this.showStatistic(1, 2, "box height", bx.height);
|
||||
this.showStatistic(2, 1, "content width", "");
|
||||
this.showStatistic(2, 2, "content height", "");
|
||||
this.showStatistic(3, 1, "", "");
|
||||
this.showStatistic(3, 2, "", "");
|
||||
} else { // html elements
|
||||
this.showStatistic(1, 1, "box width", this.mSubject.offsetWidth);
|
||||
this.showStatistic(1, 2, "box height", this.mSubject.offsetHeight);
|
||||
this.showStatistic(2, 1, "content width", "");
|
||||
this.showStatistic(2, 2, "content height", "");
|
||||
this.showStatistic(3, 1, "", "");
|
||||
this.showStatistic(3, 2, "", "");
|
||||
}
|
||||
},
|
||||
|
||||
getSubjectComputedStyle: function()
|
||||
{
|
||||
var view = this.mSubject.ownerDocument.defaultView;
|
||||
return view.getComputedStyle(this.mSubject, "");
|
||||
},
|
||||
|
||||
showMarginStats: function()
|
||||
{
|
||||
var style = this.getSubjectComputedStyle();
|
||||
var data = [this.readMarginStyle(style, "top"), this.readMarginStyle(style, "right"),
|
||||
this.readMarginStyle(style, "bottom"), this.readMarginStyle(style, "left")];
|
||||
this.showSideStats("margin", data);
|
||||
},
|
||||
|
||||
showBorderStats: function()
|
||||
{
|
||||
var style = this.getSubjectComputedStyle();
|
||||
var data = [this.readBorderStyle(style, "top"), this.readBorderStyle(style, "right"),
|
||||
this.readBorderStyle(style, "bottom"), this.readBorderStyle(style, "left")];
|
||||
this.showSideStats("border", data);
|
||||
},
|
||||
|
||||
showPaddingStats: function()
|
||||
{
|
||||
var style = this.getSubjectComputedStyle();
|
||||
var data = [this.readPaddingStyle(style, "top"), this.readPaddingStyle(style, "right"),
|
||||
this.readPaddingStyle(style, "bottom"), this.readPaddingStyle(style, "left")];
|
||||
this.showSideStats("padding", data);
|
||||
},
|
||||
|
||||
showSideStats: function(aName, aData)
|
||||
{
|
||||
this.showStatistic(1, 1, aName+"-top", aData[0]);
|
||||
this.showStatistic(2, 1, aName+"-right", aData[1]);
|
||||
this.showStatistic(1, 2, aName+"-bottom", aData[2]);
|
||||
this.showStatistic(2, 2, aName+"-left", aData[3]);
|
||||
this.showStatistic(3, 1, "", "");
|
||||
this.showStatistic(3, 2, "", "");
|
||||
},
|
||||
|
||||
readMarginStyle: function(aStyle, aSide)
|
||||
{
|
||||
return aStyle.getPropertyCSSValue("margin-"+aSide).cssText;
|
||||
},
|
||||
|
||||
readPaddingStyle: function(aStyle, aSide)
|
||||
{
|
||||
return aStyle.getPropertyCSSValue("padding-"+aSide).cssText;
|
||||
},
|
||||
|
||||
readBorderStyle: function(aStyle, aSide)
|
||||
{
|
||||
var style = aStyle.getPropertyCSSValue("border-"+aSide+"-style").cssText;
|
||||
if (!style || !style.length) {
|
||||
return "none";
|
||||
} else {
|
||||
return aStyle.getPropertyCSSValue("border-"+aSide+"-width").cssText + " " +
|
||||
style + " " +
|
||||
aStyle.getPropertyCSSValue("border-"+aSide+"-color").cssText;
|
||||
}
|
||||
}
|
||||
};
|
|
@ -1,64 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE page [
|
||||
<!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/inspector.dtd"> %dtd1;
|
||||
<!ENTITY % dtd2 SYSTEM "chrome://inspector/content/util.dtd"> %dtd2;
|
||||
<!ENTITY % dtd3 SYSTEM "chrome://inspector/locale/viewers/boxModel.dtd"> %dtd3;
|
||||
]>
|
||||
|
||||
<?xml-stylesheet href="chrome://inspector/skin/viewers/boxModel/boxModel.css"?>
|
||||
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
|
||||
|
||||
<page id="winBoxModel"
|
||||
orient="vertical"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/viewers/boxModel/boxModel.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/events/ObserverManager.js"/>
|
||||
|
||||
<groupbox>
|
||||
<caption>
|
||||
<menulist id="mlStats" value="position" oncommand="viewer.showStatGroup(this.value)">
|
||||
<menupopup>
|
||||
<menuitem value="position" label="&boxPosition.label;"/>
|
||||
<menuitem value="dimension" label="&boxDimension.label;"/>
|
||||
<menuitem value="margin" label="&boxMargin.label;"/>
|
||||
<menuitem value="border" label="&boxBorder.label;"/>
|
||||
<menuitem value="padding" label="&boxPadding.label;"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</caption>
|
||||
<grid flex="1">
|
||||
<columns>
|
||||
<column/>
|
||||
<column flex="1" class="value-column"/>
|
||||
<column/>
|
||||
<column flex="1" class="value-column"/>
|
||||
<column/>
|
||||
<column flex="1" class="value-column"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row>
|
||||
<label id="txR1C1Label"/>
|
||||
<label id="txR1C1Value"/>
|
||||
<label id="txR1C2Label"/>
|
||||
<label id="txR1C2Value"/>
|
||||
<label id="txR1C3Label"/>
|
||||
<label id="txR1C3Value"/>
|
||||
</row>
|
||||
<row>
|
||||
<label id="txR2C1Label"/>
|
||||
<label id="txR2C1Value"/>
|
||||
<label id="txR2C2Label"/>
|
||||
<label id="txR2C2Value"/>
|
||||
<label id="txR2C3Label"/>
|
||||
<label id="txR2C3Value"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</groupbox>
|
||||
|
||||
</page>
|
|
@ -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 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>
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
/***************************************************************
|
||||
* ComputedStyleViewer --------------------------------------------
|
||||
* The viewer for the computed css styles on a DOM element.
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
* REQUIRED IMPORTS:
|
||||
* chrome://inspector/content/jsutil/xpcom/XPCU.js
|
||||
****************************************************************/
|
||||
|
||||
//////////// global variables /////////////////////
|
||||
|
||||
var viewer;
|
||||
|
||||
//////////// global constants ////////////////////
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
window.addEventListener("load", ComputedStyleViewer_initialize, false);
|
||||
|
||||
function ComputedStyleViewer_initialize()
|
||||
{
|
||||
viewer = new ComputedStyleViewer();
|
||||
viewer.initialize(parent.FrameExchange.receiveData(window));
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// class ComputedStyleViewer
|
||||
|
||||
function ComputedStyleViewer()
|
||||
{
|
||||
this.mObsMan = new ObserverManager(this);
|
||||
this.mURL = window.location;
|
||||
|
||||
this.mTree = document.getElementById("olStyles");
|
||||
}
|
||||
|
||||
//XXX Don't use anonymous functions
|
||||
ComputedStyleViewer.prototype =
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// Initialization
|
||||
|
||||
mSubject: null,
|
||||
mPane: null,
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// interface inIViewer
|
||||
|
||||
get uid() { return "computedStyle" },
|
||||
get pane() { return this.mPane },
|
||||
|
||||
get subject() { return this.mSubject },
|
||||
set subject(aObject)
|
||||
{
|
||||
this.mTreeView = new ComputedStyleView(aObject);
|
||||
this.mTree.view = this.mTreeView;
|
||||
this.mObsMan.dispatchEvent("subjectChange", { subject: aObject });
|
||||
},
|
||||
|
||||
initialize: function(aPane)
|
||||
{
|
||||
this.mPane = aPane;
|
||||
aPane.notifyViewerReady(this);
|
||||
},
|
||||
|
||||
destroy: function()
|
||||
{
|
||||
// We need to remove the view at this time or else it will attempt to
|
||||
// re-paint while the document is being deconstructed, resulting in
|
||||
// some nasty XPConnect assertions
|
||||
this.mTree.view = null;
|
||||
},
|
||||
|
||||
isCommandEnabled: function(aCommand)
|
||||
{
|
||||
if (aCommand == "cmdEditCopy") {
|
||||
return this.mTree.view.selection.count > 0;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
getCommand: function(aCommand)
|
||||
{
|
||||
if (aCommand == "cmdEditCopy") {
|
||||
return new cmdEditCopy(this.mTreeView.getSelectedRowObjects());
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// event dispatching
|
||||
|
||||
addObserver: function(aEvent, aObserver) { this.mObsMan.addObserver(aEvent, aObserver); },
|
||||
removeObserver: function(aEvent, aObserver) { this.mObsMan.removeObserver(aEvent, aObserver); },
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// stuff
|
||||
|
||||
onItemSelected: function()
|
||||
{
|
||||
// This will (eventually) call isCommandEnabled on Copy
|
||||
viewer.pane.panelset.updateAllCommands();
|
||||
}
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// ComputedStyleView
|
||||
|
||||
function ComputedStyleView(aObject)
|
||||
{
|
||||
var view = aObject.ownerDocument.defaultView;
|
||||
this.mStyleList = view.getComputedStyle(aObject, "");
|
||||
this.mRowCount = this.mStyleList.length;
|
||||
}
|
||||
|
||||
ComputedStyleView.prototype = new inBaseTreeView();
|
||||
|
||||
ComputedStyleView.prototype.getCellText =
|
||||
function getCellText(aRow, aCol)
|
||||
{
|
||||
var prop = this.mStyleList.item(aRow);
|
||||
if (aCol.id == "olcStyleName") {
|
||||
return prop;
|
||||
} else if (aCol.id == "olcStyleValue") {
|
||||
return this.mStyleList.getPropertyValue(prop);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a CSSDeclaration for the row in the tree corresponding to the
|
||||
* passed index.
|
||||
* @param aIndex index of the row in the tree
|
||||
* @return a CSSDeclaration
|
||||
*/
|
||||
ComputedStyleView.prototype.getRowObjectFromIndex =
|
||||
function getRowObjectFromIndex(aIndex)
|
||||
{
|
||||
var prop = this.mStyleList.item(aIndex);
|
||||
return new CSSDeclaration(prop, this.mStyleList.getPropertyValue(prop));
|
||||
}
|
|
@ -1,76 +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):
|
||||
- Jason Barnabe <jason_barnabe@fastmail.fm>
|
||||
-
|
||||
- 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 page [
|
||||
<!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/inspector.dtd"> %dtd1;
|
||||
<!ENTITY % dtd2 SYSTEM "chrome://inspector/content/util.dtd"> %dtd2;
|
||||
<!ENTITY % dtd3 SYSTEM "chrome://inspector/locale/viewers/computedStyle.dtd"> %dtd3;
|
||||
]>
|
||||
|
||||
<?xul-overlay href="chrome://inspector/content/editingOverlay.xul"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://inspector/skin/"?>
|
||||
|
||||
<page id="winComputedStyle"
|
||||
orient="vertical"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/utils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/jsutil/xul/inBaseTreeView.js"/>
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/viewers/computedStyle/computedStyle.js"/>
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/jsutil/xpcom/XPCU.js"/>
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/jsutil/events/ObserverManager.js"/>
|
||||
|
||||
<commandset id="cmdsEditing"/>
|
||||
|
||||
<popupset id="psPopups">
|
||||
<popup id="ppComputedStyleContext">
|
||||
<menuitem id="mnEditCopy"/>
|
||||
</popup>
|
||||
</popupset>
|
||||
|
||||
<tree id="olStyles" flex="1" onselect="viewer.onItemSelected()" class="plain" contextmenu="ppComputedStyleContext">
|
||||
<treecols>
|
||||
<treecol id="olcStyleName" label="&propertyName.label;" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="olcStyleValue" label="&propertyValue.label;" flex="1"/>
|
||||
</treecols>
|
||||
<treechildren id="olbStyles"
|
||||
alternatingbackground="true"/>
|
||||
</tree>
|
||||
</page>
|
|
@ -1,169 +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 ***** */
|
||||
|
||||
/***************************************************************
|
||||
* FindDialog ---------------------------------------------------
|
||||
* Controls the dialog box used for searching the DOM.
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
* REQUIRED IMPORTS:
|
||||
* chrome://inspector/content/jsutil/xpcom/XPCU.js
|
||||
* chrome://inspector/content/jsutil/rdf/RDFU.js
|
||||
****************************************************************/
|
||||
|
||||
//////////// global variables /////////////////////
|
||||
|
||||
var dialog;
|
||||
|
||||
//////////// global constants ////////////////////
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
window.addEventListener("load", FindDialog_initialize, false);
|
||||
|
||||
function FindDialog_initialize()
|
||||
{
|
||||
dialog = new FindDialog();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// class FindDialog
|
||||
|
||||
function FindDialog()
|
||||
{
|
||||
this.setDirection(window.arguments[1] ? window.arguments[1] : "down");
|
||||
if (window.arguments[2]) {
|
||||
this.setValue(window.arguments[2][0], window.arguments[2][1])
|
||||
}
|
||||
this.toggleType(window.arguments[0] ? window.arguments[0] : "id");
|
||||
this.mOpener = window.opener.viewer;
|
||||
|
||||
var txf = document.getElementById("tfText1");
|
||||
txf.select();
|
||||
txf.focus();
|
||||
}
|
||||
|
||||
FindDialog.prototype =
|
||||
{
|
||||
mType: null,
|
||||
|
||||
////////// Properties
|
||||
|
||||
|
||||
////////// Methods
|
||||
|
||||
doFind: function()
|
||||
{
|
||||
var el = document.getElementById("tfText1");
|
||||
var dir = document.getElementById("rgDirection").value;
|
||||
if (this.mType == "id") {
|
||||
this.mOpener.startFind("id", dir, el.value);
|
||||
} else if (this.mType == "tag") {
|
||||
this.mOpener.startFind("tag", dir, el.value);
|
||||
} else if (this.mType == "attr") {
|
||||
var el2 = document.getElementById("tfText2");
|
||||
this.mOpener.startFind("attr", dir, el.value, el2.value);
|
||||
}
|
||||
},
|
||||
|
||||
toggleType: function(aType)
|
||||
{
|
||||
this.mType = aType;
|
||||
|
||||
if (aType == "id") {
|
||||
this.showDirection(false);
|
||||
this.setLabel1(0);
|
||||
this.showRow2(false);
|
||||
} else if (aType == "tag") {
|
||||
this.showDirection(true);
|
||||
this.setLabel1(1);
|
||||
this.showRow2(false);
|
||||
} else if (aType == "attr") {
|
||||
this.showDirection(true);
|
||||
this.setLabel1(2);
|
||||
this.showRow2(true);
|
||||
}
|
||||
|
||||
var rd = document.getElementById("rdType_"+aType.toLowerCase());
|
||||
if (rd) {
|
||||
var rg = document.getElementById("rgType");
|
||||
rg.selectedItem = rd;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
setLabel1: function(aIndex)
|
||||
{
|
||||
var deck = document.getElementById("rwRow1Text");
|
||||
deck.setAttribute("selectedIndex", aIndex);
|
||||
},
|
||||
|
||||
showRow2: function(aTruth)
|
||||
{
|
||||
var row = document.getElementById("rwRow2");
|
||||
row.setAttribute("hide", !aTruth);
|
||||
},
|
||||
|
||||
setDirection: function(aMode)
|
||||
{
|
||||
var rd = document.getElementById("rdDir_"+aMode.toLowerCase());
|
||||
if (rd) {
|
||||
var rg = document.getElementById("rgDirection");
|
||||
rg.selectedItem = rd;
|
||||
}
|
||||
},
|
||||
|
||||
setValue: function(aValue1, aValue2)
|
||||
{
|
||||
var txf;
|
||||
if (aValue1) {
|
||||
txf = document.getElementById("tfText1");
|
||||
txf.value = aValue1;
|
||||
}
|
||||
if (aValue2) {
|
||||
txf = document.getElementById("tfText2");
|
||||
txf.value = aValue2;
|
||||
}
|
||||
},
|
||||
|
||||
showDirection: function(aTruth)
|
||||
{
|
||||
document.getElementById("rdDir_up").disabled = !aTruth;
|
||||
document.getElementById("rdDir_down").disabled = !aTruth;
|
||||
}
|
||||
|
||||
};
|
||||
|
|
@ -1,252 +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 ***** */
|
||||
|
||||
/***************************************************************
|
||||
* ColumnsDialog --------------------------------------------
|
||||
* Dialog box for editing the columns in the DOM Viewer tree.
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
* REQUIRED IMPORTS:
|
||||
****************************************************************/
|
||||
|
||||
//////////// global variables /////////////////////
|
||||
|
||||
var dialog;
|
||||
|
||||
var gColumnTitles = [
|
||||
"nodeName",
|
||||
"nodeValue",
|
||||
"nodeType",
|
||||
"prefix",
|
||||
"localName",
|
||||
"namespaceURI"
|
||||
];
|
||||
|
||||
//////////// global constants ////////////////////
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
window.addEventListener("load", ColumnsDialog_initialize, false);
|
||||
window.addEventListener("unload", ColumnsDialog_destroy, false);
|
||||
|
||||
function ColumnsDialog_initialize()
|
||||
{
|
||||
dialog = new ColumnsDialog();
|
||||
dialog.initialize();
|
||||
}
|
||||
|
||||
function ColumnsDialog_destroy()
|
||||
{
|
||||
dialog.destroy();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// class ColumnsDialog
|
||||
|
||||
function ColumnsDialog()
|
||||
{
|
||||
this.mViewer = window.arguments[0];
|
||||
this.mColBoxHash = {};
|
||||
}
|
||||
|
||||
ColumnsDialog.prototype =
|
||||
{
|
||||
mBox: null,
|
||||
mDraggingBox: null,
|
||||
|
||||
get box() { return this.mBox },
|
||||
|
||||
initialize: function()
|
||||
{
|
||||
// bug 56270 - dragSession.sourceDocument is null --
|
||||
// causes me to code this very temporary, very nasty hack
|
||||
// to make sure I get notified when a column is dropped
|
||||
opener.viewer.mDOMTree.onClientDrop = ColumnsDialogDragDropOut;
|
||||
|
||||
this.buildContents();
|
||||
|
||||
// notify the dom viewer that we've opened
|
||||
this.mViewer.onColumnsDialogReady(this);
|
||||
},
|
||||
|
||||
destroy: function()
|
||||
{
|
||||
// notify the dom viewer that we're going away
|
||||
this.mViewer.onColumnsDialogClose(this);
|
||||
},
|
||||
|
||||
buildContents: function()
|
||||
{
|
||||
var box = document.getElementById("bxColumns");
|
||||
this.mBox = box;
|
||||
|
||||
// create the special attribute box
|
||||
var item = this.createAttrItem();
|
||||
box.appendChild(item);
|
||||
|
||||
// add all boxes except those that are already
|
||||
// in the viewer
|
||||
for (var i = 0; i < gColumnTitles.length; ++i)
|
||||
if (!this.mViewer.hasColumn(gColumnTitles[i])) {
|
||||
this.addItem(gColumnTitles[i]);
|
||||
}
|
||||
},
|
||||
|
||||
addItem: function(aValue)
|
||||
{
|
||||
if (!aValue || aValue.charAt(0) == "@")
|
||||
return null;
|
||||
|
||||
item = this.createItem(aValue);
|
||||
this.mColBoxHash[aValue] = item;
|
||||
if (item) {
|
||||
this.mBox.appendChild(item);
|
||||
window.sizeToContent();
|
||||
}
|
||||
},
|
||||
|
||||
removeItem: function(aValue)
|
||||
{
|
||||
if (!aValue || aValue.charAt(0) == "@")
|
||||
return null;
|
||||
|
||||
var colBox = this.mColBoxHash[aValue];
|
||||
if (!colBox._isAttrCol) {
|
||||
this.mBox.removeChild(colBox);
|
||||
window.sizeToContent();
|
||||
}
|
||||
},
|
||||
|
||||
createItem: function(aValue)
|
||||
{
|
||||
var text = document.createElementNS(kXULNSURI, "text");
|
||||
text._ColValue = aValue;
|
||||
text._isColBox = true;
|
||||
text._isAttrCol = false;
|
||||
text.setAttribute("class", "column-selector");
|
||||
text.setAttribute("value", aValue);
|
||||
|
||||
return text;
|
||||
},
|
||||
|
||||
createAttrItem: function(aValue)
|
||||
{
|
||||
var box = document.createElementNS(kXULNSURI, "box");
|
||||
box._isColBox = true;
|
||||
box._isAttrCol = true;
|
||||
box.setAttribute("class", "column-selector");
|
||||
box.setAttribute("align", "center");
|
||||
|
||||
var text = document.createElementNS(kXULNSURI, "text");
|
||||
text.setAttribute("value", "Attr");
|
||||
box.appendChild(text);
|
||||
|
||||
var txf = document.createElementNS(kXULNSURI, "textbox");
|
||||
txf.setAttribute("class", "attr-column-selector");
|
||||
txf.setAttribute("flex", 1);
|
||||
box.appendChild(txf);
|
||||
|
||||
return box;
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// Drag and Drop
|
||||
|
||||
onDragGesture: function(aEvent)
|
||||
{
|
||||
var box = this.getBoxTarget(aEvent.target);
|
||||
this.setDraggingBox(box);
|
||||
if (!box) return false;
|
||||
|
||||
var column = this.getColumnValue(box);
|
||||
if (!column) return false;
|
||||
|
||||
DNDUtils.invokeSession(aEvent.target, ["TreeBuilder/column-add"], [column]);
|
||||
|
||||
return false;
|
||||
},
|
||||
|
||||
onDragDropOut: function()
|
||||
{
|
||||
var box = document.getElementById("bxColumns");
|
||||
var value = this.mDraggingBox._ColValue;
|
||||
this.setDraggingBox(null);
|
||||
this.removeItem(value);
|
||||
},
|
||||
|
||||
onDragDropIn: function(aEvent)
|
||||
{
|
||||
var data = DNDUtils.getData("TreeBuilder/column-remove", 0);
|
||||
var string = XPCU.QI(data, "nsISupportsString");
|
||||
this.addItem(string.data);
|
||||
},
|
||||
|
||||
setDraggingBox: function(aBox)
|
||||
{
|
||||
if (this.mDraggingBox) {
|
||||
this.mDraggingBox.removeAttribute("col-dragging");
|
||||
}
|
||||
|
||||
this.mDraggingBox = aBox;
|
||||
|
||||
if (aBox)
|
||||
aBox.setAttribute("col-dragging", "true");
|
||||
},
|
||||
|
||||
getBoxTarget: function(aNode)
|
||||
{
|
||||
var node = aNode;
|
||||
while (node && !node._isColBox)
|
||||
node = node.parentNode;
|
||||
return node;
|
||||
},
|
||||
|
||||
getColumnValue: function(aColBox)
|
||||
{
|
||||
if (aColBox._isAttrCol) {
|
||||
var txf = aColBox.getElementsByTagName("textbox")[0];
|
||||
return "@" + txf.value;
|
||||
} else {
|
||||
return aColBox._ColValue;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function ColumnsDialogDragDropOut()
|
||||
{
|
||||
dialog.onDragDropOut();
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://inspector/locale/viewers/dom.dtd">
|
||||
|
||||
<?xml-stylesheet href="chrome://inspector/skin/viewers/dom/columnsDialog.css" type="text/css"?>
|
||||
|
||||
<window id="winEditCols" class="color-dialog"
|
||||
title="&ColumnsDialog.title;"
|
||||
persist="screenX screenY"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/viewers/dom/columnsDialog.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/xul/inTreeBuilder.js"/>
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/jsutil/xul/DNDUtils.js"/>
|
||||
|
||||
<vbox id="bxColumns" flex="1"
|
||||
ondragdrop="dialog.onDragDropIn(event);"
|
||||
ondraggesture="dialog.onDragGesture(event);"/>
|
||||
</window>
|
|
@ -1,44 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE overlay [
|
||||
<!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/viewers/dom.dtd"> %dtd1;
|
||||
]>
|
||||
|
||||
<overlay id="ovDOMViewerCommands"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<commandset id="cmdsGlobalCommands">
|
||||
<command id="cmd:selectByClick" viewer="dom"
|
||||
oncommand="inspector.getViewer('dom').selectByClick()"/>
|
||||
|
||||
<command id="cmd:find" viewer="dom"
|
||||
oncommand="inspector.getViewer('dom').showFindDialog()"/>
|
||||
|
||||
<command id="cmd:findNext" viewer="dom"
|
||||
oncommand="inspector.getViewer('dom').findNext()"/>
|
||||
|
||||
<command id="cmd:toggleAnon" viewer="dom"
|
||||
oncommand="inspector.getViewer('dom').toggleAnonContent()"/>
|
||||
|
||||
<command id="cmd:toggleSubDocs" viewer="dom"
|
||||
oncommand="inspector.getViewer('dom').toggleSubDocs()"/>
|
||||
|
||||
<command id="cmd:toggleAccessibleNodes" viewer="dom"
|
||||
oncommand="inspector.getViewer('dom').toggleAccessibleNodes();"/>
|
||||
|
||||
<command id="cmd:toggleWhitespaceNodes" viewer="dom"
|
||||
oncommand="inspector.getViewer('dom').toggleWhitespaceNodes()"/>
|
||||
|
||||
<command id="cmd:toggleProcessingInstructions" viewer="dom"
|
||||
oncommand="inspector.getViewer('dom').toggleProcessingInstructions()"/>
|
||||
|
||||
<command id="cmd:flashSelected" viewer="dom"
|
||||
oncommand="inspector.getViewer('dom').toggleFlashSelected()"/>
|
||||
|
||||
<command id="cmd:toggleAttributes" viewer="dom"
|
||||
oncommand="inspector.getViewer('dom').toggleAttributes()"/>
|
||||
</commandset>
|
||||
|
||||
</overlay>
|
||||
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,173 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE page [
|
||||
<!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/inspector.dtd"> %dtd1;
|
||||
<!ENTITY % dtd2 SYSTEM "chrome://inspector/content/util.dtd"> %dtd2;
|
||||
<!ENTITY % dtd3 SYSTEM "chrome://inspector/locale/viewers/dom.dtd"> %dtd3;
|
||||
<!ENTITY % dtd4 SYSTEM "chrome://inspector/locale/editing.dtd"> %dtd4;
|
||||
]>
|
||||
|
||||
<?xul-overlay href="chrome://inspector/content/editingOverlay.xul"?>
|
||||
|
||||
<?xml-stylesheet href="chrome://inspector/skin/viewers/dom/dom.css"?>
|
||||
|
||||
<page id="winDOMViewer"
|
||||
orient="vertical"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/utils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/hooks.js"/>
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/Flasher.js"/>
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/jsutil/xpcom/XPCU.js"/>
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/jsutil/system/PrefUtils.js"/>
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/jsutil/events/ObserverManager.js"/>
|
||||
<script type="application/x-javascript" src="chrome://global/content/XPCNativeWrapper.js"/>
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/viewers/dom/dom.js"/>
|
||||
|
||||
<!--============================= COMMANDS ============================== -->
|
||||
|
||||
<commandset id="cmdsEditing"/>
|
||||
|
||||
<commandset>
|
||||
<command id="cmdInspectInNewWindow"
|
||||
oncommand="viewer.cmdInspectInNewWindow()"/>
|
||||
|
||||
<command id="cmdInspectBrowser"
|
||||
isvalid="return viewer.cmdInspectBrowserIsValid()"
|
||||
oncommand="viewer.cmdInspectBrowser()"/>
|
||||
|
||||
<command id="cmdCopyXML"
|
||||
oncommand="viewer.cmdCopySelectedXML()"/>
|
||||
|
||||
<command id="cmdBlink"
|
||||
isvalid="return viewer.cmdBlinkIsValid();"
|
||||
oncommand="viewer.cmdBlink()"/>
|
||||
|
||||
<command id="cmdShowPseudoClasses"
|
||||
oncommand="viewer.cmdShowPseudoClasses()"/>
|
||||
|
||||
<command id="cmdEditPasteBefore" oncommand="viewer.pane.panelset.execCommand('cmdEditPasteBefore');"/>
|
||||
<command id="cmdEditPasteReplace" oncommand="viewer.pane.panelset.execCommand('cmdEditPasteReplace');"/>
|
||||
<command id="cmdEditPasteFirstChild" oncommand="viewer.pane.panelset.execCommand('cmdEditPasteFirstChild');"/>
|
||||
<command id="cmdEditPasteLastChild" oncommand="viewer.pane.panelset.execCommand('cmdEditPasteLastChild');"/>
|
||||
<command id="cmdEditPasteAsParent" oncommand="viewer.pane.panelset.execCommand('cmdEditPasteAsParent');"/>
|
||||
|
||||
<command id="cmdEditInsertAfter" oncommand="viewer.pane.panelset.execCommand('cmdEditInsertAfter');"/>
|
||||
<command id="cmdEditInsertBefore" oncommand="viewer.pane.panelset.execCommand('cmdEditInsertBefore');"/>
|
||||
<command id="cmdEditInsertFirstChild" oncommand="viewer.pane.panelset.execCommand('cmdEditInsertFirstChild');"/>
|
||||
<command id="cmdEditInsertLastChild" oncommand="viewer.pane.panelset.execCommand('cmdEditInsertLastChild');"/>
|
||||
|
||||
</commandset>
|
||||
|
||||
<!--============================= POPUPS ============================== -->
|
||||
|
||||
<popupset id="psPopups">
|
||||
<popup id="ppDOMContext" onpopupshowing="viewer.onContextCreate(this)">
|
||||
<menuitem label="&cmdInspectInNewWindow.label;"
|
||||
accesskey="&cmdInspectInNewWindow.accesskey;"
|
||||
observes="cmdInspectInNewWindow"/>
|
||||
<menuitem label="&cmdInspectBrowser.label;"
|
||||
accesskey="&cmdInspectBrowser.accesskey;"
|
||||
observes="cmdInspectBrowser"/>
|
||||
<menuseparator/>
|
||||
<menuitem id="mnEditCut"/>
|
||||
<menuitem id="mnEditCopy"/>
|
||||
<menu id="mnEditPasteMenu"
|
||||
label="&mnEditPasteMenu.label;"
|
||||
accesskey="&mnEditPasteMenu.accesskey;">
|
||||
<menupopup onpopupshowing="viewer.onCommandPopupShowing(this)">
|
||||
<!-- keep older functionality of paste command for paste menu in DOM Nodes viewer -->
|
||||
<menuitem id="mnEditPasteAfter"
|
||||
label="&mnEditPasteAfter.label;"
|
||||
accesskey="&mnEditPasteAfter.accesskey;"
|
||||
command="cmdEditPaste"
|
||||
key="keyEditPaste"/>
|
||||
<!-- other paste commands -->
|
||||
<menuitem id="mnEditPasteBefore"
|
||||
label="&mnEditPasteBefore.label;"
|
||||
accesskey="&mnEditPasteBefore.accesskey;"
|
||||
command="cmdEditPasteBefore"/>
|
||||
<menuitem id="mnEditPasteReplace"
|
||||
label="&mnEditPasteReplace.label;"
|
||||
accesskey="&mnEditPasteReplace.accesskey;"
|
||||
command="cmdEditPasteReplace"/>
|
||||
<menuitem id="mnEditPasteFirstChild"
|
||||
label="&mnEditPasteFirstChild.label;"
|
||||
accesskey="&mnEditPasteFirstChild.accesskey;"
|
||||
command="cmdEditPasteFirstChild"/>
|
||||
<menuitem id="mnEditPasteLastChild"
|
||||
label="&mnEditPasteLastChild.label;"
|
||||
accesskey="&mnEditPasteLastChild.accesskey;"
|
||||
command="cmdEditPasteLastChild"/>
|
||||
<menuitem id="mnEditPasteAsParent"
|
||||
label="&mnEditPasteAsParent.label;"
|
||||
accesskey="&mnEditPasteAsParent.accesskey;"
|
||||
command="cmdEditPasteAsParent"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuseparator/>
|
||||
<menu id="mnEditInsertMenu"
|
||||
label="&mnEditInsertMenu.label;"
|
||||
accesskey="&mnEditInsertMenu.accesskey;">
|
||||
<menupopup onpopupshowing="viewer.onCommandPopupShowing(this)">
|
||||
<menuitem id="mnEditInsertAfter"
|
||||
label="&mnEditInsertAfter.label;"
|
||||
accesskey="&mnEditInsertAfter.accesskey;"
|
||||
command="cmdEditInsertAfter"/>
|
||||
<menuitem id="mnEditInsertBefore"
|
||||
label="&mnEditInsertBefore.label;"
|
||||
accesskey="&mnEditInsertBefore.accesskey;"
|
||||
command="cmdEditInsertBefore"/>
|
||||
<menuitem id="mnEditInsertFirstChild"
|
||||
label="&mnEditInsertFirstChild.label;"
|
||||
accesskey="&mnEditInsertFirstChild.accesskey;"
|
||||
command="cmdEditInsertFirstChild"/>
|
||||
<menuitem id="mnEditInsertLastChild"
|
||||
label="&mnEditInsertLastChild.label;"
|
||||
accesskey="&mnEditInsertLastChild.accesskey;"
|
||||
command="cmdEditInsertLastChild"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menuitem id="mnEditDelete"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&cmdCopyXML.label;"
|
||||
accesskey="&cmdCopyXML.accesskey;"
|
||||
observes="cmdCopyXML"/>
|
||||
<menuseparator/>
|
||||
<menuitem label="&cmdBlink.label;"
|
||||
accesskey="&cmdBlink.accesskey;"
|
||||
observes="cmdBlink"/>
|
||||
<menuitem label="&cmdShowPseudoClasses.label;"
|
||||
accesskey="&cmdShowPseudoClasses.accesskey;"
|
||||
observes="cmdShowPseudoClasses"/>
|
||||
</popup>
|
||||
</popupset>
|
||||
|
||||
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
The template for this tree will be filled in by inTreeBuilder
|
||||
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
|
||||
|
||||
<tree id="trDOMTree" class="plain" flex="1" enableColumnDrag="true"
|
||||
contextmenu="ppDOMContext"
|
||||
onselect="viewer.onItemSelected()">
|
||||
<treecols>
|
||||
<!-- These labels don't need to be localized since they are defined by DOM APIs -->
|
||||
<treecol id="colNodeName" label="nodeName" primary="true" persist="width,hidden,ordinal" flex="3"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="colLocalName" label="localName" hidden="true" persist="width,hidden,ordinal" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="colPrefix" label="prefix" hidden="true" persist="width,hidden,ordinal" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="colNamespaceURI" label="namespaceURI" hidden="true" persist="width,hidden,ordinal" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="colNodeType" label="nodeType" hidden="true" persist="width,hidden,ordinal" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="colNodeValue" label="nodeValue" hidden="true" persist="width,hidden,ordinal" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="col@id" label="id" persist="width,hidden,ordinal" flex="1"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="col@class" label="class" persist="width,hidden,ordinal" flex="1"/>
|
||||
</treecols>
|
||||
<treechildren id="trDOMTreeBody"/>
|
||||
</tree>
|
||||
</page>
|
|
@ -1,129 +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):
|
||||
- Ehsan Akhgari <ehsan.akhgari@gmail.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 dialog [
|
||||
<!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/inspector.dtd"> %dtd1;
|
||||
<!ENTITY % dtd2 SYSTEM "chrome://inspector/locale/viewers/dom.dtd"> %dtd2;
|
||||
]>
|
||||
|
||||
<?xml-stylesheet href="chrome://inspector/skin/viewers/dom/findDialog.css"?>
|
||||
|
||||
<dialog id="winFind" style="width: 30em;"
|
||||
title="&findNodes.title;"
|
||||
ondialogaccept="return dialog.doFind();"
|
||||
persist="screenX screenY"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/viewers/dom/FindDialog.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"/>
|
||||
|
||||
<hbox flex="1">
|
||||
<vbox flex="1">
|
||||
<grid>
|
||||
<columns>
|
||||
<column/>
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row id="rwRow1">
|
||||
<deck id="rwRow1Text">
|
||||
<label id="txText1Id"
|
||||
value="&findNodesById.label;"
|
||||
accesskey="&findNodesById.accesskey;"
|
||||
control="tfText1"/>
|
||||
<label id="txText1Tag"
|
||||
value="&findNodesByTag.label;"
|
||||
accesskey="&findNodesByTag.accesskey;"
|
||||
control="tfText1"/>
|
||||
<label id="txText1Attr"
|
||||
value="&findNodesByAttr.label;"
|
||||
accesskey="&findNodesByAttr.accesskey;"
|
||||
control="tfText1"/>
|
||||
</deck>
|
||||
<textbox id="tfText1"/>
|
||||
</row>
|
||||
<row id="rwRow2">
|
||||
<label id="txText2"
|
||||
value="&findNodesByAttrValue.label;"
|
||||
accesskey="&findNodesByAttrValue.accesskey;"
|
||||
control="tfText2"/>
|
||||
<textbox id="tfText2"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
|
||||
<hbox>
|
||||
<groupbox id="tbxType">
|
||||
<caption label="&findNodesSearchBy.label;"/>
|
||||
<radiogroup id="rgType">
|
||||
<radio id="rdType_id" value="id"
|
||||
label="&findNodesById.label;"
|
||||
accesskey="&findNodesById.accesskey2;"
|
||||
oncommand="dialog.toggleType('id')"/>
|
||||
<radio id="rdType_tag" value="tag"
|
||||
label="&findNodesByTag.label;"
|
||||
accesskey="&findNodesByTag.accesskey2;"
|
||||
oncommand="dialog.toggleType('tag')"/>
|
||||
<radio id="rdType_attr" value="attr"
|
||||
label="&findNodesByAttr.label;"
|
||||
accesskey="&findNodesByAttr.accesskey2;"
|
||||
oncommand="dialog.toggleType('attr')"/>
|
||||
</radiogroup>
|
||||
</groupbox>
|
||||
<groupbox id="tbxDirection" hide="true">
|
||||
<caption label="&findNodesDirection.label;"/>
|
||||
<radiogroup id="rgDirection">
|
||||
<radio id="rdDir_up" value="up"
|
||||
label="&findNodesDirectionUp.label;"
|
||||
accesskey="&findNodesDirectionUp.accesskey;"/>
|
||||
<radio id="rdDir_down" value="down"
|
||||
label="&findNodesDirectionDown.label;"
|
||||
accesskey="&findNodesDirectionDown.accesskey;"/>
|
||||
</radiogroup>
|
||||
</groupbox>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<vbox>
|
||||
<button label="&findNodesFind.label;" dlgtype="accept" default="true"/>
|
||||
<button label="&findNodesCancel.label;" dlgtype="cancel"/>
|
||||
</vbox>
|
||||
</hbox>
|
||||
|
||||
</dialog>
|
|
@ -1,147 +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 for the DOM Inspector.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Shawn Wilsher <me@shawnwilsher.com>
|
||||
*
|
||||
* Portions created by the Initial Developer are Copyright (C) 2006
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Dave Townsend <dave.townsend@blueprintit.co.uk>
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Global Variables
|
||||
|
||||
var dialog;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// Initialization/Destruction
|
||||
|
||||
window.addEventListener("load", InsertDialog_initialize, false);
|
||||
|
||||
function InsertDialog_initialize()
|
||||
{
|
||||
dialog = new InsertDialog();
|
||||
dialog.initialize();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//// class InsertDialog
|
||||
|
||||
function InsertDialog()
|
||||
{
|
||||
this.mDoc = window.arguments[0];
|
||||
this.mData = window.arguments[1];
|
||||
|
||||
this.nodeType = document.getElementById("ml_nodeType");
|
||||
this.tagName = document.getElementById("tx_tagName");
|
||||
this.nodeValue = document.getElementById("tx_nodeValue");
|
||||
this.namespace = document.getElementById("tx_namespace");
|
||||
this.menulist = document.getElementById("ml_namespace");
|
||||
}
|
||||
|
||||
InsertDialog.prototype =
|
||||
{
|
||||
/**
|
||||
* This function initializes the content of the dialog.
|
||||
*/
|
||||
initialize: function initialize()
|
||||
{
|
||||
var menuitems = this.menulist.firstChild.childNodes;
|
||||
var defaultNS = document.getElementById("mi_namespace");
|
||||
var customNS = document.getElementById("mi_custom");
|
||||
var accept = document.documentElement.getButton("accept");
|
||||
|
||||
this.menulist.disabled = !this.mData.enableNamespaces;
|
||||
defaultNS.value = this.mDoc.documentElement.namespaceURI;
|
||||
|
||||
this.toggleNamespace();
|
||||
this.updateType();
|
||||
},
|
||||
|
||||
/**
|
||||
* The function that is called on accept. Sets data.
|
||||
*/
|
||||
accept: function accept()
|
||||
{
|
||||
switch (this.nodeType.value)
|
||||
{
|
||||
case "element":
|
||||
this.mData.type = Components.interfaces.nsIDOMNode.ELEMENT_NODE;
|
||||
this.mData.value = this.tagName.value;
|
||||
break;
|
||||
case "text":
|
||||
this.mData.type = Components.interfaces.nsIDOMNode.TEXT_NODE;
|
||||
this.mData.value = this.nodeValue.value;
|
||||
break;
|
||||
}
|
||||
this.mData.namespaceURI = this.namespace.value;
|
||||
this.mData.accepted = true;
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* updateType changes the visibility of rows based on the node type.
|
||||
*/
|
||||
updateType: function updateType()
|
||||
{
|
||||
switch (dialog.nodeType.value)
|
||||
{
|
||||
case "text":
|
||||
document.getElementById("row_text").hidden = false;
|
||||
document.getElementById("row_element").hidden = true;
|
||||
break;
|
||||
case "element":
|
||||
document.getElementById("row_text").hidden = true;
|
||||
document.getElementById("row_element").hidden = false;
|
||||
break;
|
||||
}
|
||||
dialog.toggleAccept();
|
||||
},
|
||||
|
||||
/**
|
||||
* toggleNamespace toggles the namespace textbox based on the namespace menu.
|
||||
*/
|
||||
toggleNamespace: function toggleNamespace()
|
||||
{
|
||||
dialog.namespace.disabled = dialog.menulist.selectedItem.id != "mi_custom";
|
||||
dialog.namespace.value = dialog.menulist.value;
|
||||
},
|
||||
|
||||
/**
|
||||
* toggleAccept enables/disables the Accept button when there is/isn't an
|
||||
* attribute name.
|
||||
*/
|
||||
toggleAccept: function toggleAccept()
|
||||
{
|
||||
document.documentElement.getButton("accept").disabled =
|
||||
(dialog.tagName.value == "") && (dialog.nodeType.selectedItem.value == "element");
|
||||
}
|
||||
};
|
|
@ -1,145 +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 mozilla.org code for the DOM Inspector.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Shawn Wilsher <me@shawnwilsher.com>
|
||||
-
|
||||
- Portions created by the Initial Developer are Copyright (C) 2006
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Dave Townsend <dave.townsend@blueprintit.co.uk>
|
||||
- Ehsan Akhgari <ehsan.akhgari@gmail.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 *****
|
||||
-->
|
||||
<!DOCTYPE dialog SYSTEM "chrome://inspector/locale/viewers/dom.dtd">
|
||||
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
|
||||
|
||||
<dialog id="InsertNode"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
title="&insertNode.title;"
|
||||
buttons="accept,cancel"
|
||||
ondialogaccept="dialog.accept();">
|
||||
<script type="application/javascript"
|
||||
src="chrome://inspector/content/viewers/dom/insertDialog.js"/>
|
||||
<grid>
|
||||
<columns>
|
||||
<column/>
|
||||
<column flex="1"/>
|
||||
</columns>
|
||||
<rows>
|
||||
<row align="center">
|
||||
<label value="&nodeType.label;"
|
||||
accesskey="&nodeType.accesskey;"
|
||||
control="ml_nodeType"/>
|
||||
<menulist id="ml_nodeType" oncommand="dialog.updateType();">
|
||||
<menupopup id="mp_nodetypes">
|
||||
<menuitem label="&nodeType.element.label;"
|
||||
id="mi_Element"
|
||||
value="element"/>
|
||||
<menuitem label="&nodeType.text.label;"
|
||||
id="mi_Text"
|
||||
value="text"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</row>
|
||||
<rows id="row_element">
|
||||
<row align="center">
|
||||
<label value="&namespaceURI.label;"
|
||||
accesskey="&namespaceURI.accesskey;"
|
||||
control="ml_namespace"/>
|
||||
<menulist id="ml_namespace" oncommand="dialog.toggleNamespace();">
|
||||
<menupopup id="mp_namespaces">
|
||||
<!-- This must be first, and must have a the value attribute set to
|
||||
"" in order for it to work properly -->
|
||||
<menuitem label="&namespaceTitle.null.label;"
|
||||
id="mi_NullNS"
|
||||
value=""/>
|
||||
<menuitem label="&namespaceTitle.XMLNS.label;"
|
||||
id="mi_XMLNSNS"
|
||||
value="http://www.w3.org/2000/xmlns/"/>
|
||||
<menuitem label="&namespaceTitle.XML.label;"
|
||||
id="mi_XMLNS"
|
||||
value="http://www.w3.org/XML/1998/namespace"/>
|
||||
<menuitem label="&namespaceTitle.XHTML.label;"
|
||||
id="mi_XHTMLNS"
|
||||
value="http://www.w3.org/1999/xhtml"/>
|
||||
<menuitem label="&namespaceTitle.XLink.label;"
|
||||
id="mi_XLinkNS"
|
||||
value="http://www.w3.org/1999/xlink"/>
|
||||
<menuitem label="&namespaceTitle.XSLT.label;"
|
||||
id="mi_XSLTNS"
|
||||
value="http://www.w3.org/1999/XSL/Transform"/>
|
||||
<menuitem label="&namespaceTitle.XBL.label;"
|
||||
id="mi_XBLNS"
|
||||
value="http://www.mozilla.org/xbl"/>
|
||||
<menuitem label="&namespaceTitle.MathML.label;"
|
||||
id="mi_MathMLNS"
|
||||
value="http://www.w3.org/1998/Math/MathML"/>
|
||||
<menuitem label="&namespaceTitle.RDF.label;"
|
||||
id="mi_RDFNS"
|
||||
value="http://www.w3.org/1999/02/22-rdf-syntax-ns"/>
|
||||
<menuitem label="&namespaceTitle.XUL.label;"
|
||||
id="mi_XULNS"
|
||||
value="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/>
|
||||
<menuitem label="&namespaceTitle.SVG.label;"
|
||||
id="mi_SVGNS"
|
||||
value="http://www.w3.org/2000/svg"/>
|
||||
<menuitem label="&namespaceTitle.XMLEvents.label;"
|
||||
id="mi_XMLEventsNS"
|
||||
value="http://www.w3.org/2001/xml-events"/>
|
||||
<!-- Value set onload -->
|
||||
<menuitem label="&namespaceTitle.default.label;"
|
||||
id="mi_namespace"/>
|
||||
<!-- Value set onload -->
|
||||
<menuitem label="&namespaceTitle.custom.label;"
|
||||
id="mi_custom"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</row>
|
||||
<row>
|
||||
<spacer/>
|
||||
<textbox id="tx_namespace"/>
|
||||
</row>
|
||||
<row>
|
||||
<label value="&tagName.label;"
|
||||
accesskey="&tagName.accesskey;"
|
||||
control="tx_tagName"/>
|
||||
<textbox id="tx_tagName" oninput="dialog.toggleAccept()"/>
|
||||
</row>
|
||||
</rows>
|
||||
<row id="row_text" flex="1">
|
||||
<label value="&nodeValue.label;"
|
||||
accesskey="&nodeValue.accesskey;"
|
||||
control="tx_nodeValue"/>
|
||||
<textbox id="tx_nodeValue" multiline="true"/>
|
||||
</row>
|
||||
</rows>
|
||||
</grid>
|
||||
</dialog>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://inspector/locale/viewers/dom.dtd">
|
||||
|
||||
<overlay id="ovDOMViewerKeyset"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<keyset id="ksGlobalKeyset">
|
||||
<key id="key:find" xulkey="true" key="&cmdShowFindDialog.accelkey;" observes="cmd:find" modifiers="accel"/>
|
||||
<key id="key:findNext" keycode="VK_F3" observes="cmd:findNext"/>
|
||||
</keyset>
|
||||
|
||||
</overlay>
|
||||
|
||||
|
|
@ -1,123 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE overlay SYSTEM "chrome://inspector/locale/viewers/dom.dtd">
|
||||
|
||||
<overlay id="ovDOMViewerPopup"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<popupset id="ppsViewerPopupset">
|
||||
<menupopup id="ppViewerContext-dom">
|
||||
<menuitem id="item:find"
|
||||
label="&cmdShowFindDialog.label;"
|
||||
accesskey="&cmdShowFindDialog.accesskey;"
|
||||
key="key:find"
|
||||
observes="cmd:find"/>
|
||||
|
||||
<menuitem id="item:findNext"
|
||||
label="&cmdFindNext.label;"
|
||||
accesskey="&cmdFindNext.accesskey;"
|
||||
key="key:findNext"
|
||||
observes="cmd:findNext"/>
|
||||
|
||||
<menuseparator/>
|
||||
|
||||
<menuitem id="item:toggleAttributes" hidden="true"
|
||||
class="menuitem-iconic"
|
||||
type="checkbox"
|
||||
label="&cmdToggleAttributes.label;"
|
||||
accesskey="&cmdToggleAttributes.accesskey;"
|
||||
observes="cmd:toggleAttributes"/>
|
||||
|
||||
<menuitem id="item:toggleAnon"
|
||||
class="menuitem-iconic"
|
||||
type="checkbox"
|
||||
label="&cmdToggleAnonContent.label;"
|
||||
accesskey="&cmdToggleAnonContent.accesskey;"
|
||||
observes="cmd:toggleAnon"/>
|
||||
|
||||
<menuitem id="item:toggleAccessibleNodes"
|
||||
class="menuitem-iconic"
|
||||
type="checkbox"
|
||||
label="&cmdToggleAccessibleNodes.label;"
|
||||
accesskey="&cmdToggleAccessibleNodes.accesskey;"
|
||||
observes="cmd:toggleAccessibleNodes"/>
|
||||
|
||||
<menuitem id="item:toggleWhitespaceNodes"
|
||||
class="menuitem-iconic"
|
||||
type="checkbox"
|
||||
label="&cmdToggleWhitespaceNodes.label;"
|
||||
accesskey="&cmdToggleWhitespaceNodes.accesskey;"
|
||||
observes="cmd:toggleWhitespaceNodes"/>
|
||||
|
||||
<menuitem id="item:toggleProcessingInstructions"
|
||||
class="menuitem-iconic"
|
||||
type="checkbox"
|
||||
label="&cmdToggleProcessingInstructions.label;"
|
||||
accesskey="&cmdToggleProcessingInstructions.accesskey;"
|
||||
observes="cmd:toggleProcessingInstructions"/>
|
||||
|
||||
</menupopup>
|
||||
</popupset>
|
||||
|
||||
<menupopup id="mppSearch">
|
||||
|
||||
<menuitem id="item:find" position="1"
|
||||
label="&cmdShowFindDialog.label;"
|
||||
accesskey="&cmdShowFindDialog.accesskey;"
|
||||
key="key:find"
|
||||
observes="cmd:find"/>
|
||||
|
||||
<menuitem id="item:findNext" position="2"
|
||||
label="&cmdFindNext.label;"
|
||||
accesskey="&cmdFindNext.accesskey;"
|
||||
key="key:findNext"
|
||||
observes="cmd:findNext"/>
|
||||
|
||||
<menuseparator position="3"/>
|
||||
|
||||
<menuitem id="item:selectByClick" position="4"
|
||||
label="&cmdSelectByClick.label;"
|
||||
accesskey="&cmdSelectByClick.accesskey;"
|
||||
observes="cmd:selectByClick"/>
|
||||
</menupopup>
|
||||
|
||||
<menupopup id="mppView">
|
||||
<menuitem id="item:flashSelected"
|
||||
class="menuitem-iconic"
|
||||
type="checkbox"
|
||||
label="&cmdFlashSelected.label;"
|
||||
accesskey="&cmdFlashSelected.accesskey;"
|
||||
observes="cmd:flashSelected"/>
|
||||
|
||||
<menuitem id="item:toggleAnon"
|
||||
class="menuitem-iconic"
|
||||
type="checkbox"
|
||||
label="&cmdToggleAnonContent.label;"
|
||||
accesskey="&cmdToggleAnonContent.accesskey;"
|
||||
observes="cmd:toggleAnon"/>
|
||||
|
||||
<menuitem id="item:toggleAccessibleNodes"
|
||||
class="menuitem-iconic"
|
||||
type="checkbox"
|
||||
label="&cmdToggleAccessibleNodes.label;"
|
||||
accesskey="&cmdToggleAccessibleNodes.accesskey;"
|
||||
observes="cmd:toggleAccessibleNodes"/>
|
||||
|
||||
<menuitem id="item:toggleWhitespaceNodes"
|
||||
class="menuitem-iconic"
|
||||
type="checkbox"
|
||||
label="&cmdToggleWhitespaceNodes.label;"
|
||||
accesskey="&cmdToggleWhitespaceNodes.accesskey;"
|
||||
observes="cmd:toggleWhitespaceNodes"/>
|
||||
|
||||
<menuitem id="item:toggleProcessingInstructions"
|
||||
class="menuitem-iconic"
|
||||
type="checkbox"
|
||||
label="&cmdToggleProcessingInstructions.label;"
|
||||
accesskey="&cmdToggleProcessingInstructions.accesskey;"
|
||||
observes="cmd:toggleProcessingInstructions"/>
|
||||
</menupopup>
|
||||
|
||||
</overlay>
|
||||
|
||||
|
|
@ -1,108 +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 ***** */
|
||||
|
||||
/***************************************************************
|
||||
* PseudoClassDialog --------------------------------------------
|
||||
* A dialog for choosing the pseudo-classes that should be
|
||||
* imitated on the selected element.
|
||||
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
* REQUIRED IMPORTS:
|
||||
****************************************************************/
|
||||
|
||||
//////////// global variables /////////////////////
|
||||
|
||||
var dialog;
|
||||
|
||||
//////////// global constants ////////////////////
|
||||
|
||||
const gCheckBoxIds = {
|
||||
cbxStateHover: 4,
|
||||
cbxStateActive: 1,
|
||||
cbxStateFocus: 2
|
||||
};
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
window.addEventListener("load", PseudoClassDialog_initialize, false);
|
||||
|
||||
function PseudoClassDialog_initialize()
|
||||
{
|
||||
dialog = new PseudoClassDialog();
|
||||
dialog.initialize();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//// class PseudoClassDialog
|
||||
|
||||
function PseudoClassDialog()
|
||||
{
|
||||
this.mOpener = window.opener.viewer;
|
||||
this.mSubject = window.arguments[0];
|
||||
|
||||
this.mDOMUtils = XPCU.getService("@mozilla.org/inspector/dom-utils;1", "inIDOMUtils");
|
||||
}
|
||||
|
||||
PseudoClassDialog.prototype =
|
||||
{
|
||||
|
||||
initialize: function()
|
||||
{
|
||||
var state = this.mDOMUtils.getContentState(this.mSubject);
|
||||
|
||||
for (var key in gCheckBoxIds) {
|
||||
if (gCheckBoxIds[key] & state) {
|
||||
var cbx = document.getElementById(key);
|
||||
cbx.setAttribute("checked", "true");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onOk: function()
|
||||
{
|
||||
var el = this.mSubject;
|
||||
var root = el.ownerDocument.documentElement;
|
||||
|
||||
for (var key in gCheckBoxIds) {
|
||||
var cbx = document.getElementById(key);
|
||||
if (cbx.checked)
|
||||
this.mDOMUtils.setContentState(el, gCheckBoxIds[key]);
|
||||
else
|
||||
this.mDOMUtils.setContentState(root, gCheckBoxIds[key]);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE dialog [
|
||||
<!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/inspector.dtd"> %dtd1;
|
||||
<!ENTITY % dtd2 SYSTEM "chrome://inspector/content/util.dtd"> %dtd2;
|
||||
<!ENTITY % dtd3 SYSTEM "chrome://inspector/locale/viewers/dom.dtd"> %dtd3;
|
||||
]>
|
||||
|
||||
<?xml-stylesheet href="chrome://inspector/skin/viewers/styleRules/styleRules.css"?>
|
||||
|
||||
<dialog id="winPseudoClasses"
|
||||
title="&pseudoClasses.title;"
|
||||
persist="screenX screenY width height"
|
||||
ondialogaccept="return dialog.onOk()"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<!--============================= SCRIPTS ============================= -->
|
||||
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/viewers/dom/pseudoClassDialog.js"/>
|
||||
<script type="application/x-javascript" src="chrome://inspector/content/jsutil/xpcom/XPCU.js"/>
|
||||
|
||||
<keyset id="dialogKeys"/>
|
||||
|
||||
<groupbox style="width: 25em;">
|
||||
<caption label="&pseudoClasses.title;"/>
|
||||
<vbox>
|
||||
<!--
|
||||
The labels don't need to be localized, since they are CSS APIs,
|
||||
but the access keys are localizable, because an English
|
||||
keyboard may not always be available
|
||||
see: https://bugzilla.mozilla.org/show_bug.cgi?id=398704#c1
|
||||
-->
|
||||
<checkbox id="cbxStateHover" label=":hover" accesskey="&cbxStateHover.accesskey;"/>
|
||||
<checkbox id="cbxStateActive" label=":active" accesskey="&cbxStateActive.accesskey;"/>
|
||||
<checkbox id="cbxStateFocus" label=":focus" accesskey="&cbxStateFocus.accesskey;"/>
|
||||
</vbox>
|
||||
</groupbox>
|
||||
|
||||
</dialog>
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче