Permalink
Browse files

Merge branch 'dev_firebug-1.10'

Conflicts:
	dojofirebugextension/content/dojo/ui/gfxreps.js
	dojofirebugextension/content/dojo/ui/panels/gfxInfoSidePanel.js
	dojofirebugextension/content/dojo/ui/panels/gfxMainPanel.js
	dojofirebugextension/content/dojo/ui/panels/gfxShapePropertiesSidePanel.js
	dojofirebugextension/locale/en-US/dojo.dtd
  • Loading branch information...
2 parents 05013a0 + 52b195b commit 690ed9cd64c82de4c8dc975b6b880db382d2b59d @patricioreyna committed Oct 7, 2012
@@ -139,6 +139,9 @@ DojoExtension.dojofirebugextensionModel = Obj.extend(Firebug.ActivableModule,
return;
}
+ //call super
+ Firebug.ActivableModule.loadedContext.apply(this, arguments);
+
//TODO here use fbListeners to decouple from main panel
var panel = this._getDojoPanel(context);
@@ -157,8 +160,7 @@ DojoExtension.dojofirebugextensionModel = Obj.extend(Firebug.ActivableModule,
}
},
- destroyContext: function(context, persistedState) {
- Firebug.ActivableModule.destroyContext.apply(this, arguments);
+ destroyContext: function(context, persistedState) {
//destroy what we created on initContext
context.tracker.destroy();
@@ -169,12 +171,17 @@ DojoExtension.dojofirebugextensionModel = Obj.extend(Firebug.ActivableModule,
DojoHooks.destroyInContext(context);
delete context.tracker;
+
+ //super destroy must be last sentence
+ Firebug.ActivableModule.destroyContext.apply(this, arguments);
},
/**
* invoked whenever the user selects a tab.
*/
showPanel: function(browser, panel) {
+ Firebug.ActivableModule.showPanel.apply(this, arguments);
+
//(multi-process) is this code right (to be here)?
// this test on name is a sign that this code belongs in panel.show()
@@ -7,7 +7,6 @@
<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/x-javascript" src="chrome://firebug/content/moduleConfig.js"/>
<script type="application/x-javascript" src="chrome://dojofirebugextension/content/loader.js" />
<stringbundleset id="stringbundleset">
@@ -24,7 +23,7 @@
<toolbar id="fbToolbar" align="center" role="toolbar">
<hbox id="fbToolbarInner" insertbefore="fbDetachButton" flex="1" align="center">
- <hbox id="fbDojo_firebugextensionButtons" insertafter="fbNetButtons">
+ <hbox id="fbDojo_firebugextensionButtons">
<!-- <toolbarseparator/> -->
<toolbarbutton id="fbDojo_widgetsButton"
label="&dojo.widgets.label;" class="toolbar-text-button"
@@ -1,100 +1,30 @@
/* See license.txt for terms of usage */
-(function() {
-
-// ********************************************************************************************* //
-// Use this file in case your extension uses an overlay and you want to load
-// its main.js module. You just need to include this file into the overlay
-// as follows:
+// Content of the mainOverlay.xul overlay should look like as follows:
//
-// <script type="application/x-javascript" src="chrome://<ext-id>/content/mainOverlay.js"/>
-
-// <ext-id>
-var extensionName = "dojofirebugextension";
+// <?xml version="1.0"?>
+// <overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+// <script type="application/x-javascript" src="chrome://<ext-name>/content/mainOverlay.js"/>
+// </overlay>
+//
+// The mainOverlay.xul file is used only to load the extension. The loading proces can be
+// also done through bootstrap.js (restartless Firefox support), but it needs additional
+// Firebug APIs support.
+//
+// Do not use XUL for any UI (you wouldn't be able to use restartless add-on support later).
+// Firebug UI should be extended only through Firebug related API.
-var fbDojo_debugLogEnabled = false;
-var waits = 0;
// ********************************************************************************************* //
+// Registration
-if (!Firebug || !Firebug.getModuleLoaderConfig)
-{
- if(FBTrace) {
- FBTrace.sysout("Firebug Overlay; 'chrome://firebug/content/moduleConfig.js' must be included!");
- }
-
- Components.utils.reportError("Firebug Overlay; 'chrome://firebug/content/moduleConfig.js' must be included!");
- return;
-}
-
-var config = Firebug.getModuleLoaderConfig();
-config.paths[extensionName] = "dojo";
-/*
-config.debug = true;
-config.onDebug = function() {
- FBTrace.sysout.apply(FBTrace, arguments);
-}
-*/
+// Notice that <ext-name> is used to build chrome paths like: chrome://<ext-name>/content/main.js
+// The <ext-name> should comd from chrome.manifest: resource helloamd chrome/
-fbDojo_logMsg = function(aMessage) {
- if(!fbDojo_debugLogEnabled) {
- return;
- }
- var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
- .getService(Components.interfaces.nsIConsoleService);
- consoleService.logStringMessage("DojoFirebugExtension AMD Loader - " + aMessage);
-};
-
-fbDojo_checkFirebugRequireIsLoaded = function() {
- //Components.utils.reportError("DojoExtensionAsynchLoader - executing checkFirebugRequireIsLoaded . Times: " + waits);
- fbDojo_logMsg("executing checkFirebugRequireIsLoaded . Times: " + waits);
- waits += 1;
- if (!Firebug.require || !Firebug.connection) {
- setTimeout(fbDojo_checkFirebugRequireIsLoaded, 10);
- } else {
- fbDojo_loadExtension();
- }
-
-};
-
-fbDojo_loadExtension = function() {
-
- //Components.utils.reportError("DojoExtensionAsynchLoader - executing loadExtension");
- fbDojo_logMsg("executing loadExtension");
-
- // Load main.js module (the entry point of the extension) + a support for tracing.
- Firebug.require(config, [
- extensionName + "/main",
- "firebug/lib/trace"/*,
- "dojo/core/trace-error-log" //must be the last item always */
- ],
- function(Extension, FBTrace)
- {
- try
- {
- // Initialize the extension object. Extension intialization procedure
- // should be within this method (in main.js).
- Extension.initialize();
-
- if (FBTrace.DBG_INITIALIZE)
- FBTrace.sysout("Firebug Overlay; Extension '" + extensionName + "' loaded!");
- }
- catch (err)
- {
- if (FBTrace.DBG_DOJO) {
- FBTrace.sysout(err);
- }
-
- if (FBTrace.DBG_ERRORS) {
- FBTrace.sysout("Firebug Overlay; ERROR " + err);
- }
- }
- }
- );
-};
+// The registration process will automatically look for 'main' module and load it.
+// ********************************************************************************************* //
-fbDojo_checkFirebugRequireIsLoaded();
-return {};
+//firebug 1.10+
+var config = {id: "dojo@silvergate.ar.ibm.com"};
+Firebug.registerExtension("dojofirebugextension", config);
-// ********************************************************************************************* //
-})();
@@ -226,10 +226,12 @@ DojoReps.DijitRep = domplate(FirebugReps.Obj,
return;
}
-
+ var label = UI.$STRF("panel.Inspect_In_Panel", ["HTML"]);
+ var tooltiptext = UI.$STRF("panel.tip.Inspect_In_Panel", ["HTML"]);
+
return [
"-",
- {label: UI.$STRF("InspectInTab", ["HTML"]), nol10n: true, command: Obj.bindFixed(this._inspectHtml, this, widget, context) }
+ {label: label, tooltiptext: tooltiptext, nol10n: true, command: Obj.bindFixed(this._inspectHtml, this, widget, context) }
];
},
@@ -1,6 +1,6 @@
/* Released under BSD license (see license.txt) */
-
+
/**
* dojo GFX specific Reps.
* @author patricioreyna
@@ -220,10 +220,11 @@ GfxReps.ShapeRep = domplate(FirebugReps.Obj,
return;
}
-
+ var label = UI.$STRF("panel.Inspect_In_Panel", ["HTML"]);
+ var tooltiptext = UI.$STRF("panel.tip.Inspect_In_Panel", ["HTML"]);
return [
"-",
- {label: UI.$STRF("InspectInTab", ["HTML"]), nol10n: true, command: Obj.bindFixed(this._inspectHtml, this, shape, context) }
+ {label: label, tooltiptext: tooltiptext, nol10n: true, command: Obj.bindFixed(this._inspectHtml, this, shape, context) }
];
},
@@ -414,4 +415,4 @@ GfxReps.unregisterReps = function() {
return GfxReps;
-}});
+}});
@@ -13,8 +13,8 @@
*/
define([
"firebug/firebug",
- "firebug/firefox/firefox",
- "firebug/firefox/menu",
+ "firebug/chrome/firefox",
+ "firebug/chrome/menu",
"firebug/lib/object",
"firebug/lib/trace",
"dojo/core/dojoaccess",
@@ -70,7 +70,7 @@ define([
FBTrace.sysout("DOJO - registering Firefox ContextMenu listener");
}
- var contextMenu = Firefox.$("contentAreaContextMenu");
+ var contextMenu = Firebug.GlobalUI.$("contentAreaContextMenu");
if (contextMenu) {
if(!this._boundOnContentAreaContextMenuShowing) {
this._boundOnContentAreaContextMenuShowing = Obj.bind(this._onContentAreaContextMenuShowing, this);
@@ -88,15 +88,15 @@ define([
FBTrace.sysout("DOJO - unregistering Firefox ContextMenu listener");
}
- var contextMenu = Firefox.$("contentAreaContextMenu");
+ var contextMenu = Firebug.GlobalUI.$("contentAreaContextMenu");
if (contextMenu) {
contextMenu.removeEventListener("popupshowing", this._boundOnContentAreaContextMenuShowing, false);
}
if(FBTrace.DBG_DOJO_CONTEXTMENU) {
FBTrace.sysout("DOJO - Firefox ContextMenu listener " + ((contextMenu) ? "FOUND!" : "NOT FOUND!"));
}
- var inspectItem = Firefox.$("fbDojo_menu_dojofirebugextension_inspect");
+ var inspectItem = Firebug.GlobalUI.$("fbDojo_menu_dojofirebugextension_inspect");
if(FBTrace.DBG_DOJO_CONTEXTMENU) {
FBTrace.sysout("DOJO - contextMenu InspectItem " + ((inspectItem) ? "FOUND!" : "NOT FOUND!"));
}
@@ -106,7 +106,7 @@ define([
}
//GFX
- var inspectItemGFX = Firefox.$("fbDojo_menu_dojofirebugextension_inspect_GFX");
+ var inspectItemGFX = Firebug.GlobalUI.$("fbDojo_menu_dojofirebugextension_inspect_GFX");
if(FBTrace.DBG_DOJO_CONTEXTMENU) {
FBTrace.sysout("DOJO - contextMenu InspectItem GFX" + ((inspectItemGFX) ? "FOUND!" : "NOT FOUND!"));
}
@@ -127,23 +127,23 @@ define([
var doc = event.target.ownerDocument;
var elt = doc.popupNode;
- var inspectItem = Firefox.$("fbDojo_menu_dojofirebugextension_inspect");
+ var inspectItem = Firebug.GlobalUI.$("fbDojo_menu_dojofirebugextension_inspect");
if(!inspectItem) {
if(FBTrace.DBG_DOJO_CONTEXTMENU) {
FBTrace.sysout("DOJO - creating Dojo Inspect menu item: ", elt);
}
- var contextMenu = Firefox.$("contentAreaContextMenu");
+ var contextMenu = Firebug.GlobalUI.$("contentAreaContextMenu");
var itemToCreate = { id: "fbDojo_menu_dojofirebugextension_inspect", label: UI.$STR("window.contextmenuitem.inspect"), nol10n: true, command: this.inspectFromContextMenu, hidden: true };
- inspectItem = Menu.createMenuItem(contextMenu, itemToCreate);
+ inspectItem = Menu.createMenuItem(contextMenu, itemToCreate);
}
- var gfxInspectItem = Firefox.$("fbDojo_menu_dojofirebugextension_inspect_GFX");
+ var gfxInspectItem = Firebug.GlobalUI.$("fbDojo_menu_dojofirebugextension_inspect_GFX");
if(!gfxInspectItem) {
if(FBTrace.DBG_DOJO_CONTEXTMENU) {
FBTrace.sysout("DOJO - creating Dojo Inspect GFX menu item: ", elt);
}
- var contextMenu = Firefox.$("contentAreaContextMenu");
+ var contextMenu = Firebug.GlobalUI.$("contentAreaContextMenu");
var itemToCreateGFX = { id: "fbDojo_menu_dojofirebugextension_inspect_GFX", label: UI.$STR("window.contextmenuitem..gfx.inspect"), nol10n: true, command: this.inspectFromContextMenuGFX, hidden: true };
gfxInspectItem = Menu.createMenuItem(contextMenu, itemToCreateGFX);
}
@@ -97,6 +97,8 @@ DojoInfoSidePanel.prototype = Obj.extend(Firebug.Panel,
},
show: function(state) {
+ Firebug.Panel.show.apply(this, arguments);
+
var ctx = DojoPanels._safeGetContext(this);
this.showInfo(ctx);
if (ctx.infoPanelCoutersRefreshEventsReg){
@@ -117,6 +119,8 @@ DojoInfoSidePanel.prototype = Obj.extend(Firebug.Panel,
if (ctx.infoPanelCoutersRefreshEventsReg){
ctx.infoPanelCoutersRefreshEventsReg.removeAllListeners();
}
+
+ Firebug.Panel.hide.apply(this, arguments);
},
_getCounterNode: function(counterId){
@@ -1,5 +1,5 @@
/* Released under BSD license (see license.txt) */
-
+
/**
* DojoInfo side panel
@@ -37,32 +37,6 @@ GfxInfoSidePanel.prototype = Obj.extend(Firebug.Panel,
DojoPanels.addStyleSheet(this.document);
},
- // show: function(state) {
- // var ctx = DojoPanels._safeGetContext(this);
- // },
-
- // hide: function(state) {
- // var ctx = DojoPanels._safeGetContext(this);
- // },
-
- // /**
- // * added custom method (this one) instead of updateSelection to avoid changing the contents of
- // * this panel when not needed.
- // */
- // showInfo: function(context) {
-
- // },
-
- // refresh: function() {
- // this.showInfo(DojoPanels._safeGetContext(this));
- // },
-
- // getOptionsMenuItems: function() {
- // return [
- // {label: DojoPanels.$STR('label.Refresh'), nol10n: true, command: Obj.bind(this.refresh, this) }
- // ];
- // },
-
/**
* Returns a number indicating the view's ability to inspect the object.
* Zero means not supported, and higher numbers indicate specificity.
@@ -1,13 +1,12 @@
/* Released under BSD license (see license.txt) */
-
+
/**
* The main panel (UI) of this extension
* @author preyna@ar.ibm.com
*/
define([
"firebug/firebug",
- "firebug/firefox/xpcom",
"firebug/lib/css",
"firebug/lib/json",
"firebug/lib/locale",
@@ -26,7 +25,7 @@ define([
"dojo/ui/panels/gfxInfoSidePanel",
"dojo/ui/panels/gfxShapePropertiesSidePanel",
"dojo/ui/panels/panelCommons"
- ], function gfxPanelsFactory(Firebug, Xpcom, Css, Json, Locale, Obj, Search, Str, FBTrace, DojoExtension,
+ ], function gfxPanelsFactory(Firebug, Css, Json, Locale, Obj, Search, Str, FBTrace, DojoExtension,
DojoModel, DojoPrefs, Collections, GfxReps, UI, MessageBox, UiHelpers, GfxInfoSidePanel, GfxShapePropertiesSidePanel, DojoPanels)
{
@@ -178,15 +177,6 @@ gfxMainPanel.prototype = Obj.extend(Firebug.ActivablePanel,
return node;
}
return null;
-
- // while (node) {
- // var shape = dojoAccessor.getShapeFromNode(node, context);
- // if (shape) {
- // return node;
- // }
- // node = node.parentNode;
- // }
- // return null;
},
Oops, something went wrong.

0 comments on commit 690ed9c

Please sign in to comment.