Browse Source

Move DOMi to its own repo to be used with binoc-build

https://github.com/binaryoutcast/inspector.git
master
Matt A. Tobin 2 years ago committed by Roy Tam
parent
commit
9b301c855c
  1. 14
      inspector/addon/inspector.js
  2. 36
      inspector/addon/install.rdf
  3. 14
      inspector/addon/moz.build
  4. BIN
      inspector/addon/winInspectorMain.ico
  5. 45
      inspector/addon/winInspectorMain.xpm
  6. 29
      inspector/addon/winInspectorMain16.xpm
  7. 12
      inspector/app.mozbuild
  8. 7
      inspector/build.mk
  9. 56
      inspector/components/initializer.js
  10. 60
      inspector/components/inspector-cmdline.js
  11. 12
      inspector/components/jar.mn
  12. 15
      inspector/components/moz.build
  13. 30
      inspector/confvars.configure
  14. 391
      inspector/content/Flasher.js
  15. 251
      inspector/content/ViewerRegistry.js
  16. 58
      inspector/content/commandOverlay.xul
  17. 90
      inspector/content/editingOverlay.xul
  18. 9
      inspector/content/extensions/titledSplitter.css
  19. 88
      inspector/content/extensions/titledSplitter.xml
  20. 51
      inspector/content/extensions/wsm-colorpicker.js
  21. 21
      inspector/content/hooks.js
  22. 38
      inspector/content/inspector.css
  23. 746
      inspector/content/inspector.js
  24. 926
      inspector/content/inspector.xml
  25. 58
      inspector/content/inspector.xul
  26. 61
      inspector/content/inspectorOverlay.xul
  27. 135
      inspector/content/jar.mn
  28. 164
      inspector/content/jsutil/commands/baseCommands.js
  29. 62
      inspector/content/jsutil/events/ObserverManager.js
  30. 163
      inspector/content/jsutil/rdf/RDFArray.js
  31. 121
      inspector/content/jsutil/rdf/RDFU.js
  32. 66
      inspector/content/jsutil/system/DiskSearch.js
  33. 90
      inspector/content/jsutil/system/FilePickerUtils.js
  34. 90
      inspector/content/jsutil/system/PrefUtils.js
  35. 62
      inspector/content/jsutil/system/clipboardFlavors.js
  36. 36
      inspector/content/jsutil/xpcom/XPCU.js
  37. 83
      inspector/content/jsutil/xul/DNDUtils.js
  38. 34
      inspector/content/jsutil/xul/FrameExchange.js
  39. 96
      inspector/content/jsutil/xul/inBaseTreeView.js
  40. 243
      inspector/content/jsutil/xul/inDataTreeView.js
  41. 111
      inspector/content/jsutil/xul/inFormManager.js
  42. 636
      inspector/content/jsutil/xul/inTreeBuilder.js
  43. 21
      inspector/content/keysetOverlay.xul
  44. 6
      inspector/content/moz.build
  45. 91
      inspector/content/object.js
  46. 44
      inspector/content/object.xul
  47. 102
      inspector/content/popupOverlay.xul
  48. 49
      inspector/content/prefs/pref-inspector.js
  49. 131
      inspector/content/prefs/pref-inspector.xul
  50. 136
      inspector/content/prefs/pref-sidebar.js
  51. 17
      inspector/content/prefs/prefsOverlay.xul
  52. 336
      inspector/content/res/viewer-registry.rdf
  53. 117
      inspector/content/sidebar.js
  54. 61
      inspector/content/sidebar.xul
  55. 17
      inspector/content/statusbarOverlay.xul
  56. 55
      inspector/content/tasksOverlay-cz.xul
  57. 76
      inspector/content/tasksOverlay-ff.xul
  58. 45
      inspector/content/tasksOverlay-mobile.xul
  59. 48
      inspector/content/tasksOverlay-sb.xul
  60. 57
      inspector/content/tasksOverlay-tb.xul
  61. 32
      inspector/content/tasksOverlay.xul
  62. 77
      inspector/content/tests/allskin.xul
  63. 68
      inspector/content/toolboxOverlay.xul
  64. 194
      inspector/content/utils.js
  65. 255
      inspector/content/viewers/accessibleEvent/accessibleEvent.js
  66. 70
      inspector/content/viewers/accessibleEvent/accessibleEvent.xul
  67. 1200
      inspector/content/viewers/accessibleEvents/accessibleEvents.js
  68. 150
      inspector/content/viewers/accessibleEvents/accessibleEvents.xul
  69. 69
      inspector/content/viewers/accessibleEvents/handlerHelpDialog.xul
  70. 59
      inspector/content/viewers/accessibleObject/accessibleObject.js
  71. 22
      inspector/content/viewers/accessibleObject/accessibleObject.xul
  72. 619
      inspector/content/viewers/accessibleProps/accessiblePropViewerMgr.js
  73. 241
      inspector/content/viewers/accessibleProps/accessibleProps.js
  74. 226
      inspector/content/viewers/accessibleProps/accessibleProps.xul
  75. 256
      inspector/content/viewers/accessibleRelations/accessibleRelations.js
  76. 86
      inspector/content/viewers/accessibleRelations/accessibleRelations.xul
  77. 599
      inspector/content/viewers/accessibleTree/accessibleTree.js
  78. 72
      inspector/content/viewers/accessibleTree/accessibleTree.xul
  79. 89
      inspector/content/viewers/accessibleTree/evalJSDialog.js
  80. 43
      inspector/content/viewers/accessibleTree/evalJSDialog.xul
  81. 244
      inspector/content/viewers/boxModel/boxModel.js
  82. 176
      inspector/content/viewers/boxModel/boxModel.xul
  83. 197
      inspector/content/viewers/computedStyle/computedStyle.js
  84. 51
      inspector/content/viewers/computedStyle/computedStyle.xul
  85. 144
      inspector/content/viewers/dom/FindDialog.js
  86. 219
      inspector/content/viewers/dom/columnsDialog.js
  87. 26
      inspector/content/viewers/dom/columnsDialog.xul
  88. 44
      inspector/content/viewers/dom/commandOverlay.xul
  89. 2272
      inspector/content/viewers/dom/dom.js
  90. 198
      inspector/content/viewers/dom/dom.xul
  91. 96
      inspector/content/viewers/dom/findDialog.xul
  92. 136
      inspector/content/viewers/dom/insertDialog.js
  93. 110
      inspector/content/viewers/dom/insertDialog.xul
  94. 20
      inspector/content/viewers/dom/keysetOverlay.xul
  95. 122
      inspector/content/viewers/dom/popupOverlay.xul
  96. 97
      inspector/content/viewers/dom/pseudoClassDialog.js
  97. 42
      inspector/content/viewers/dom/pseudoClassDialog.xul
  98. 549
      inspector/content/viewers/domNode/domNode.js
  99. 135
      inspector/content/viewers/domNode/domNode.xul
  100. 101
      inspector/content/viewers/domNode/domNodeDialog.js
  101. Some files were not shown because too many files have changed in this diff Show More

14
inspector/addon/inspector.js

@ -1,14 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
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);

36
inspector/addon/install.rdf

@ -1,36 +0,0 @@
<?xml version="1.0"?>
<!-- This Source Code is subject to the terms of the Mozilla Public License
- version 2.0 (the "License"). You can obtain a copy of the License at
- http://mozilla.org/MPL/2.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_ID@"
em:version="@INSPECTOR_VERSION@"
em:name="@INSPECTOR_NAME@"
em:description="@INSPECTOR_SHORT_DESC@"
em:creator="@INSPECTOR_AUTHOR@"
em:type="2"
em:unpack="true">
<em:targetApplication name="Pale Moon">
<Description em:id="{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}"
em:minVersion="28.0.0a1"
em:maxVersion="28.*"/>
</em:targetApplication>
<em:targetApplication name="Borealis Navigator">
<Description em:id="{a3210b97-8e8a-4737-9aa0-aa0e607640b9}"
em:minVersion="1.0.0a1"
em:maxVersion="1.*"/>
</em:targetApplication>
<em:targetApplication name="Unified XUL Platform">
<Description em:id="toolkit@mozilla.org"
em:minVersion="4.1.0a1"
em:maxVersion="4.*"/>
</em:targetApplication>
</Description>
</RDF>

14
inspector/addon/moz.build

@ -1,14 +0,0 @@
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
FINAL_TARGET_PP_FILES += ['install.rdf']
FINAL_TARGET_FILES.chrome.icons.default += [
'winInspectorMain.ico',
'winInspectorMain.xpm',
'winInspectorMain16.xpm',
]
FINAL_TARGET_FILES.defaults.preferences += ['inspector.js']

BIN
inspector/addon/winInspectorMain.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

45
inspector/addon/winInspectorMain.xpm

@ -1,45 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* XPM */
static char * winInspectorMain_xpm[] = {
"32 32 6 1",
" c None",
". c #000000",
"+ c #FFB300",
"@ c #FF7500",
"# c #FF8C00",
"$ c #FF0000",
"................................",
"................................",
"..++++++++++++++++++++++++++++..",
"..++++++++++++++++++++++++++++..",
"..++++++++++........++++++++++..",
"..++++++++++........++++++++++..",
"..++++++....@@@@@@@@....++++++..",
"..++++++....@@@@@@@@....++++++..",
"..++++++..@@@@@@@@@@@@..++++++..",
"..++++++..@@@@@@@@@@@@..++++++..",
"..++++..@@@@@@@@@@@@@@@@..++++..",
"..++++..@@@@@@@@@@@@@@@@..++++..",
"..++++..@@@@@@@@@@@@@@@@..++++..",
"..++++..@@@@@@@@@@@@@@@@..++++..",
"..++++..@@@@@@@@@@@@##@@..++++..",
"..++++..@@@@@@@@@@@@##@@..++++..",
"..++++..@@@@@@@@@@@@##@@..++++..",
"..++++..@@@@@@@@@@@@##@@..++++..",
"..++++++..@@@@@@####$$..++++++..",
"..++++++..@@@@@@####$$..++++++..",
"..++++++....@@@@@@@@......++++..",
"..++++++....@@@@@@@@......++++..",
"..++++++++++........++......++..",
"..++++++++++........++......++..",
"..++++++++++++++++++++++........",
"..++++++++++++++++++++++........",
"..++++++++++++++++++++++++......",
"..++++++++++++++++++++++++......",
"..++++++++++++++++++++++++++....",
"..++++++++++++++++++++++++++....",
"................................",
"................................"};

29
inspector/addon/winInspectorMain16.xpm

@ -1,29 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* XPM */
static char * winInspectorMain16_xpm[] = {
"16 16 6 1",
" c None",
". c #000000",
"+ c #FFAD00",
"@ c #FF6D00",
"# c #FF8500",
"$ c #FF0000",
"................",
".++++++++++++++.",
".+++++....+++++.",
".+++..@@@@..+++.",
".+++.@@@@@@.+++.",
".++.@@@@@@@@.++.",
".++.@@@@@@@@.++.",
".++.@@@@@@#@.++.",
".++.@@@@@@#@.++.",
".+++.@@@##$.+++.",
".+++..@@@@...++.",
".+++++....+...+.",
".+++++++++++....",
".++++++++++++...",
".+++++++++++++..",
"................"};

12
inspector/app.mozbuild

@ -1,12 +0,0 @@
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
if not CONFIG['MOZ_DISABLE_PLATFORM']:
error('Please add --disable-platform to your mozconfig')
#include('/toolkit/toolkit.mozbuild')
# Never add tier dirs after the application srcdir because they
# apparently won't get packaged properly on Mac.
DIRS += ['/projects/inspector']

7
inspector/build.mk

@ -1,7 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
package:
cd $(DIST)/bin; \
zip -Dr9X ../${INSPECTOR_XPI_NAME}-${INSPECTOR_VERSION}.xpi * -x \*/.mkdir.done; \

56
inspector/components/initializer.js

@ -1,56 +0,0 @@
/*
* This Source Code is subject to the terms of the Mozilla Public License
* version 2.0 (the "License"). You can obtain a copy of the License at
* http://mozilla.org/MPL/2.0/.
*/
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
const Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
/**
* Application startup/shutdown observer, triggers init()/uninit() methods
* @constructor
*/
function Initializer() {}
Initializer.prototype =
{
classDescription: "DOMi initializer",
contractID: "@mozilla.org/domi/startup;1",
classID: Components.ID("{87fcf1f0-959f-4ee7-abba-889478e93775}"),
_xpcom_categories: [{ category: "app-startup", service: true }],
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
observe: function(subject, topic, data)
{
let observerService = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
switch (topic)
{
case "app-startup":
observerService.addObserver(this, "profile-after-change", true);
break;
case "profile-after-change":
observerService.addObserver(this, "quit-application", true);
Cu.import("resource://inspector/InspectElement.jsm");
InspectElement.init();
break;
case "quit-application":
try {
// This will fail if component was added via chrome.manifest (Gecko 2.0)
observerService.removeObserver(this, "profile-after-change");
}catch(e) {}
observerService.removeObserver(this, "quit-application");
InspectElement.uninit();
break;
}
}
};
if (XPCOMUtils.generateNSGetFactory)
var NSGetFactory = XPCOMUtils.generateNSGetFactory([Initializer]);
else
var NSGetModule = XPCOMUtils.generateNSGetModule([Initializer]);

60
inspector/components/inspector-cmdline.js

@ -1,60 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
const nsICommandLineHandler = Components.interfaces.nsICommandLineHandler;
const nsISupportsString = Components.interfaces.nsISupportsString;
const nsIWindowWatcher = Components.interfaces.nsIWindowWatcher;
function InspectorCmdLineHandler() {}
InspectorCmdLineHandler.prototype =
{
classDescription: "DOM Inspector Command Line Handler",
classID: Components.ID("{38293526-6b13-4d4f-a075-71939435b408}"),
contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=inspector",
/* Needed for XPCOMUtils NSGetModule */
_xpcom_categories: [{category: "command-line-handler",
entry: "m-inspector"}],
/* nsISupports */
QueryInterface: XPCOMUtils.generateQI([nsICommandLineHandler]),
/* 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);
},
helpInfo : " -inspector <url> Open the DOM inspector.\n"
};
/**
* XPCOMUtils.generateNSGetFactory was introduced in Mozilla 2 (Firefox 4).
* XPCOMUtils.generateNSGetModule is for Mozilla 1.9.0 (Firefox 3.0).
*/
if (XPCOMUtils.generateNSGetFactory)
var NSGetFactory = XPCOMUtils.generateNSGetFactory([InspectorCmdLineHandler]);
else
var NSGetModule = XPCOMUtils.generateNSGetModule([InspectorCmdLineHandler]);

12
inspector/components/jar.mn

@ -1,12 +0,0 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
[.] chrome.jar:
% category command-line-handler m-inspector @mozilla.org/commandlinehandler/general-startup;1?type=inspector
% component {38293526-6b13-4d4f-a075-71939435b408} components/inspector-cmdline.js
% contract @mozilla.org/commandlinehandler/general-startup;1?type=inspector {38293526-6b13-4d4f-a075-71939435b408}
% component {87fcf1f0-959f-4ee7-abba-889478e93775} components/initializer.js
% contract @mozilla.org/domi/startup;1 {87fcf1f0-959f-4ee7-abba-889478e93775}
% category profile-after-change @mozilla.org/domi/startup;1 @mozilla.org/domi/startup;1

15
inspector/components/moz.build

@ -1,15 +0,0 @@
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
EXTRA_COMPONENTS += [
'initializer.js',
'inspector-cmdline.js',
]
# We don't want component sub-manifest files for extensions..
# They don't always work correctly
NO_JS_MANIFEST = True
JAR_MANIFESTS += ['jar.mn']

30
inspector/confvars.configure vendored

@ -1,30 +0,0 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Templates apperently ARE allowed to use set_config and set_define and can use loops
# so take advantage of that to apply the old axion_cmake defines without the need of
# confvars.sh or configure.in
@template
def ConfVars(mode='moz.configure'):
confvars = {
'INSPECTOR_NAME': 'DOM Inspector',
'INSPECTOR_ID': 'inspector@mozilla.org',
'INSPECTOR_VERSION': '3.0.2',
'INSPECTOR_AUTHOR': 'Binary Outcast',
'INSPECTOR_SHORT_DESC': 'DOM Inspector is a tool that can be used to inspect and edit the live DOM of any web document or XUL application.',
'INSPECTOR_XPI_NAME': 'domi',
'INSPECTOR_CHROME_NAME': 'inspector',
}
if mode == 'moz.configure':
for key, value in confvars.iteritems():
set_config(key, value)
set_define(key, value)
elif mode == 'moz.build':
for key, value in confvars.iteritems():
DEFINES[key] = value
elif mode == 'id':
return confvars['INSPECTOR_ID']

391
inspector/content/Flasher.js

@ -1,391 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/***************************************************************
* Flasher ---------------------------------------------------
* Object for controlling a timed flashing animation which
* paints a border around an element.
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* REQUIRED IMPORTS:
****************************************************************/
//////////// global variables /////////////////////
//////////// global constants ////////////////////
const HIGHLIGHTED_PSEUDO_CLASS = ":-moz-devtools-highlighted";
const INVERT = "filter: url(\"data:image/svg+xml;charset=utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='invert'><feColorMatrix in='SourceGraphic' type='matrix' values='-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0'/></filter></svg>%23invert\") !important; "
////////////////////////////////////////////////////////////////////////////
//// class Flasher
function Flasher(aColor, aThickness, aDuration, aSpeed, aInvert)
{
document.querySelector(HIGHLIGHTED_PSEUDO_CLASS);
this.mIOService = XPCU.getService("@mozilla.org/network/io-service;1", "nsIIOService");
this.mDOMUtils = XPCU.getService("@mozilla.org/inspector/dom-utils;1", "inIDOMUtils");
this.mShell = XPCU.getService("@mozilla.org/inspector/flasher;1", "inIFlasher") || this.mDOMUtils;
this.color = aColor;
this.thickness = aThickness;
this.invert = aInvert;
this.duration = aDuration;
this.mSpeed = aSpeed;
}
Flasher.prototype =
{
////////////////////////////////////////////////////////////////////////////
//// Initialization
mFlashTimeout: null,
mElement: null,
mRegistryId: null,
mFlashes: 0,
mStartTime: 0,
mDOMUtils: null,
mWinUtils: null,
mStyleURI: null,
mColor: "#000000",
mInvert: false,
mThickness: 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);
this.mWinUtils = val.ownerDocument.defaultView
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils);
} else {
throw "Invalid node type.";
}
},
get color() { return this.mColor; },
set color(aVal)
{
var spacer = document.createElement("spacer");
spacer.style.color = aVal;
if (spacer.style.color) {
this.mStyleURI = null;
this.mColor = aVal;
}
return aVal;
},
get thickness() { return this.mThickness | 0; },
set thickness(aVal) { this.mStyleURI = null; return this.mThickness = 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.mInvert; },
set invert(aVal) { this.mStyleURI = null; return this.mInvert = aVal; },
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
// :::::::::::::::::::: Methods ::::::::::::::::::::::::::::
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
start: function(aDuration, aSpeed, aHold)
{
if (!this.mStyleURI) {
var styleURI = "data:text/css;charset=utf-8," + HIGHLIGHTED_PSEUDO_CLASS +
" { outline: " + this.thickness + "px solid " +
encodeURIComponent(this.color) +
" !important; outline-offset: " + -this.thickness +
"px !important; " + (this.invert ? INVERT : "") + "}";
this.mStyleURI = this.mIOService.newURI(styleURI, null, null);
}
this.mWinUtils.loadSheet(this.mStyleURI, this.mWinUtils.AGENT_SHEET);
this.mUDuration = aDuration ? aDuration * 1000 : this.mDuration;
this.mUSpeed = aSpeed ? aSpeed : this.mSpeed;
this.mHold = aHold;
this.mFlashes = 0;
this.mStartTime = Date.now();
this.doFlash();
},
doFlash: function()
{
if (this.mHold || this.mFlashes & 1) {
this.paintOn();
} else {
this.paintOff();
}
this.mFlashes++;
if (this.mUDuration < 0 || Date.now() - this.mStartTime < this.mUDuration) {
this.mFlashTimeout = window.setTimeout(this.timeout, this.mUSpeed, this);
} else {
this.stop();
}
},
timeout: function(self)
{
self.doFlash();
},
stop: function()
{
if (this.flashing) {
this.mWinUtils.removeSheet(this.mStyleURI, this.mWinUtils.AGENT_SHEET);
window.clearTimeout(this.mFlashTimeout);
this.mFlashTimeout = null;
this.paintOff();
}
},
paintOn: function()
{
this.mDOMUtils.addPseudoClassLock(this.mElement, HIGHLIGHTED_PSEUDO_CLASS);
},
paintOff: function()
{
this.mDOMUtils.removePseudoClassLock(this.mElement, HIGHLIGHTED_PSEUDO_CLASS);
}
};
////////////////////////////////////////////////////////////////////////////
//// class LegacyFlasher
function LegacyFlasher(aColor, aThickness, aDuration, aSpeed, aInvert)
{
this.mShell = XPCU.getService("@mozilla.org/inspector/flasher;1", "inIFlasher");
this.color = aColor;
this.mShell.thickness = aThickness;
this.mShell.invert = aInvert;
this.duration = aDuration;
this.mSpeed = aSpeed;
}
LegacyFlasher.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)
{
try {
this.mShell.color = aVal;
}
catch (e) { // Catch exception in case aVal is an invalid or empty value.
Components.utils.reportError(e);
}
return 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 ::::::::::::::::::::::::::::
// :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
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(this.timeout, this.mUSpeed, this);
} else {
this.stop();
}
},
timeout: function(self)
{
self.doFlash();
},
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);
}
};
////////////////////////////////////////////////////////////////////////////////
//// DOMIFlasher
/**
* The special version of the flasher operating with DOM Inspector flasher
* preferences.
*/
function DOMIFlasher()
{
this.init();
}
DOMIFlasher.prototype =
{
//////////////////////////////////////////////////////////////////////////////
//// Public
get flashOnSelect() { return PrefUtils.getPref("inspector.blink.on"); },
set flashOnSelect(aVal) { PrefUtils.setPref("inspector.blink.on", aVal); },
get color() { return PrefUtils.getPref("inspector.blink.border-color"); },
set color(aVal) { PrefUtils.setPref("inspector.blink.border-color", aVal); },
get thickness() { return PrefUtils.getPref("inspector.blink.border-width"); },
set thickness(aVal) { PrefUtils.setPref("inspector.blink.border-width", aVal); },
get duration() { return PrefUtils.getPref("inspector.blink.duration"); },
set duration(aVal) { PrefUtils.setPref("inspector.blink.duration", aVal); },
get speed() { return PrefUtils.getPref("inspector.blink.speed"); },
set speed(aVal) { PrefUtils.setPref("inspector.blink.speed", aVal); },
get invert() { return PrefUtils.getPref("inspector.blink.invert"); },
set invert(aVal) { PrefUtils.setPref("inspector.blink.invert", aVal); },
flashElement: function DOMIFlasher_flashElement(aElement)
{
if (this.mFlasher.flashing)
this.mFlasher.stop();
this.mFlasher.element = aElement;
this.mFlasher.start();
},
flashElementOnSelect: function DOMIFlasher_flashElementOnSelect(aElement)
{
if (this.flashOnSelect) {
this.flashElement(aElement);
}
},
destroy: function DOMIFlasher_destroy()
{
PrefUtils.removeObserver("inspector.blink.", this);
},
//////////////////////////////////////////////////////////////////////////////
//// Private
init: function DOMIFlasher_init()
{
try {
this.mFlasher = new Flasher(this.color, this.thickness, this.duration,
this.speed, this.invert);
} catch (e) {
this.mFlasher = new LegacyFlasher(this.color, this.thickness,
this.duration, this.speed, this.invert);
}
PrefUtils.addObserver("inspector.blink.", this);
this.updateFlashOnSelectCommand();
},
updateFlashOnSelectCommand: function DOMIFlasher_updateFlashOnSelectCommand()
{
var cmdEl = document.getElementById("cmdFlashOnSelect");
if (this.flashOnSelect) {
cmdEl.setAttribute("checked", "true");
} else {
cmdEl.removeAttribute("checked");
}
},
observe: function DOMIFlasher_observe(aSubject, aTopic, aData)
{
if (aData == "inspector.blink.on") {
this.updateFlashOnSelectCommand();
return;
}
var value = PrefUtils.getPref(aData);
if (aData == "inspector.blink.border-color") {
this.mFlasher.color = value;
} else if (aData == "inspector.blink.border-width") {
this.mFlasher.thickness = value;
} else if (aData == "inspector.blink.duration") {
this.mFlasher.duration = value;
} else if (aData == "inspector.blink.speed") {
this.mFlasher.speed = value;
} else if (aData == "inspector.blink.invert") {
this.mFlasher.invert = value;
}
}
}

251
inspector/content/ViewerRegistry.js

@ -1,251 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*****************************************************************************
* 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 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 VR_Load(aURL, aObserver)
{
this.mURL = aURL;
this.mObserver = aObserver;
RDFU.loadDataSource(aURL, new ViewerRegistryLoadObserver(this));
},
onError: function VR_OnError(aStatus, aErrorMsg)
{
this.mObserver.onViewerRegistryLoadError(aStatus, aErrorMsg);
},
onLoad: function VR_OnLoad(aDS)
{
this.mDS = aDS;
this.prepareRegistry();
this.mObserver.onViewerRegistryLoad();
},
prepareRegistry: function VR_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 aIndex
* The numerical index of the entry representing the viewer.
* @return A string of the fully canonized url.
*/
getEntryURL: function VR_GetEntryURL(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 aObject
* The object being searched against.
* @param aPanelId
* A string containing the id of the panel requesting viewers.
* @param aLinkedViewer
* The view object of linked panel.
* @return An array of nsIRDFResource entries in the viewer registry.
*/
findViewersForObject:
function VR_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 aObject
* The object being checked for eligibility.
* @param aLinkedViewer
* The view object of linked panel.
* @param aIndex
* The numerical index of the entry.
* @return true if object can be viewed.
*/
objectMatchesEntry:
function VR_ObjectMatchesEntry(aObject, aLinkedViewer, aIndex)
{
try {
return this.mFilters[aIndex](aObject, aLinkedViewer);
}
catch (ex) {
Components.utils.reportError(ex);
}
return false;
},
/**
* Notifies the registry that a viewer has been instantiated, and that it
* corresponds to a particular entry in the viewer registry.
*
* @param aViewer
* The inIViewer object to cache.
* @param aIndex
* The numerical index of the entry.
*/
cacheViewer: function VR_CacheViewer(aViewer, aIndex)
{
var uid = this.getEntryProperty(aIndex, "uid");
this.mViewerHash[uid] = { viewer: aViewer, entry: aIndex };
},
uncacheViewer: function VR_UncacheViewer(aViewer)
{
delete this.mViewerHash[aViewer.uid];
},
// for previously loaded viewers only
getViewerByUID: function VR_GetViewerByUID(aUID)
{
return this.mViewerHash[aUID].viewer;
},
// for previously loaded viewers only
getEntryForViewer: function VR_GetEntryForViewer(aViewer)
{
return this.mViewerHash[aViewer.uid].entry;
},
// for previously loaded viewers only
getEntryByUID: function VR_GetEntryByUID(aUID)
{
return this.mViewerHash[aUID].aIndex;
},
getEntryProperty: function VR_GetEntryProperty(aIndex, aProp)
{
return this.mViewerDS.get(aIndex, aProp);
},
getEntryCount: function VR_GetEntryCount()
{
return this.mViewerDS.length;
},
////////////////////////////////////////////////////////////////////////////
//// Viewer Registration
addNewEntry: function VR_AddNewEntry(aUID, aDescription, aFilter)
{
},
removeEntry: function VR_RemoveEntry(aIndex)
{
},
saveRegistry: function VR_SaveRegistry()
{
}
};
////////////////////////////////////////////////////////////////////////////
//// Listener Objects
function ViewerRegistryLoadObserver(aTarget)
{
this.mTarget = aTarget;
}
ViewerRegistryLoadObserver.prototype =
{
mTarget: null,
onError: function VRLO_OnError(aStatus, aErrorMsg)
{
this.mTarget.onError(aStatus, aErrorMsg);
},
onDataSourceReady: function VRLO_OnDataSourceReady(aDS)
{
this.mTarget.onLoad(aDS);
}
};

58
inspector/content/commandOverlay.xul

@ -1,58 +0,0 @@
<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE overlay [
<!ENTITY % dtd1 SYSTEM "chrome://inspector/locale/inspector.dtd"> %dtd1;
]>
<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="cmdEnterLocation"
oncommand="inspector.enterLocation();"/>
<command id="cmdSave" oncommand="inspector.save();"/>
<command id="cmdClose" oncommand="inspector.exit();"/>
<command id="cmdShowPrefsDialog"
oncommand="inspector.showPrefsDialog();"/>
<command id="cmdToggleDocument"
oncommand="inspector.toggleBrowser(true);"/>
<command id="cmdFlashOnSelect"
viewer="dom accessibleTree"
oncommand="inspector.toggleFlashOnSelect();"/>
<!-- These implement the editing commands needed by the top-level
inspectors. See editingOverlay.xul for more information. -->
<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="cmdEditInspectInNewWindow" global="true"
oncommand="inspector.doViewerCommand('cmdEditInspectInNewWindow');"/>
</commandset>
</overlay>

90
inspector/content/editingOverlay.xul

@ -1,90 +0,0 @@
<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE overlay SYSTEM "chrome://inspector/locale/editing.dtd">
<overlay id="ovEditing"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- This overlay is pulled in by popupOverlay.xul, which is itself pulled in
by the top-level inspectors (inspector.xul, object.xul, and sidebar.xul),
to add these items to its menus. Additionally, this overlay is suitable
for use by viewers which want to offer any of these items (e.g., for
their context menus). Note that the cmdsEditing commandset is used only
by viewers due to scoping differences; the implementation of the commands
used in the top-level inspectors can be found in commandOverlay.xul. -->
<commandset id="cmdsEditing">
<command id="cmdEditUndo"
oncommand="viewer.pane.panelset.execCommand('cmdEditUndo');"/>
<command id="cmdEditRedo"
oncommand="viewer.pane.panelset.execCommand('cmdEditRedo');"/>
<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>
<commandset id="cmdsEditingExtras">
<command id="cmdEditInspectInNewWindow"
oncommand="viewer.pane.panelset.execCommand('cmdEditInspectInNewWindow');"/>
<command id="cmdEditCopyFileURI"
oncommand="viewer.pane.panelset.execCommand('cmdEditCopyFileURI');"/>
<command id="cmdEditViewFileURI"
oncommand="viewer.pane.panelset.execCommand('cmdEditViewFileURI');"/>
</commandset>
<keyset id="ksGlobalKeyset">
<key id="keyEditUndo" key="z" modifiers="accel" command="cmdEditUndo"/>
<key id="keyEditRedo" key="z" modifiers="accel,shift"
command="cmdEditRedo"/>
<key id="keyEditRedo2" key="y" modifiers="accel" 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"/>
<key id="keyEditInspectInNewWindow" key="&mnEditInspectInNewWindow.key;"
modifiers="accel" command="cmdEditInspectInNewWindow"/>
</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"/>
<menuitem id="mnEditInspectInNewWindow"
label="&mnEditInspectInNewWindow.label;"
command="cmdEditInspectInNewWindow"
accesskey="&mnEditInspectInNewWindow.accesskey;"
key="keyEditInspectInNewWindow"/>
<menuitem id="mnEditCopyFileURI" label="&mnEditCopyFileURI.label;"
command="cmdEditCopyFileURI"
accesskey="&mnEditCopyFileURI.accesskey;"/>
<menuitem id="mnEditViewFileURI" label="&mnEditViewFileURI.label;"
command="cmdEditViewFileURI"
accesskey="&mnEditViewFileURI.accesskey;"/>
</overlay>

9
inspector/content/extensions/titledSplitter.css

@ -1,9 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@import url("chrome://inspector/skin/titledSplitter.css");
.titled-splitter {
-moz-binding: url("titledSplitter.xml#titledSplitter") !important;
}

88
inspector/content/extensions/titledSplitter.xml

@ -1,88 +0,0 @@
<?xml version="1.0"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.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>

51
inspector/content/extensions/wsm-colorpicker.js

@ -1,51 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/***************************************************************
* 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();
}

21
inspector/content/hooks.js

@ -1,21 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
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);
}

38
inspector/content/inspector.css

@ -1,38 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@import url("chrome://inspector/content/extensions/titledSplitter.css");
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
*[hide="true"