Permalink
Browse files

Allow to bypass the annotation list clearing confirmation (fix for

FBTest)
  • Loading branch information...
1 parent bd97c94 commit faadf97bc5db616866d247e8d2bb53363939dcff @SebastianZ SebastianZ committed May 6, 2013
Showing with 30 additions and 46 deletions.
  1. +11 −8 extension/content/firebug/chrome/panelActivation.js
  2. +19 −38 tests/FBTest/content/FBTestFirebug.js
@@ -221,16 +221,19 @@ Firebug.PanelActivation = Obj.extend(Firebug.Module,
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// UI commands
- clearAnnotations: function()
+ clearAnnotations: function(force)
{
- var check = {value: false};
- var flags = prompts.BUTTON_POS_0 * prompts.BUTTON_TITLE_YES +
- prompts.BUTTON_POS_1 * prompts.BUTTON_TITLE_NO;
-
- if (!prompts.confirmEx(Firebug.chrome.window, Locale.$STR("Firebug"),
- Locale.$STR("annotations.confirm.clear"), flags, "", "", "", null, check) == 0)
+ if (!force)
{
- return;
+ var check = {value: false};
+ var flags = prompts.BUTTON_POS_0 * prompts.BUTTON_TITLE_YES +
+ prompts.BUTTON_POS_1 * prompts.BUTTON_TITLE_NO;
+
+ if (!prompts.confirmEx(Firebug.chrome.window, Locale.$STR("Firebug"),
+ Locale.$STR("annotations.confirm.clear"), flags, "", "", "", null, check) == 0)
+ {
+ return;
+ }
}
Firebug.connection.clearAnnotations();
@@ -219,50 +219,31 @@ this.setToKnownState = function()
{
FBTest.sysout("FBTestFirebug setToKnownState");
- var watcherObserver =
- {
- observe: function(subject, topic, data)
- {
- if (topic == "domwindowopened")
- {
- winWatcher.unregisterNotification(watcherObserver);
- setTimeout(function()
- {
- var dialog = subject.QueryInterface(Ci.nsIDOMWindow);
- // Accept clearing the activation list
- dialog.Dialog.ui.button0.doCommand();
-
- if (Firebug.isDetached())
- Firebug.toggleDetachBar();
-
- // First clear all breakpoints and consequently the reset all options that
- // clears the breakpoints storage.
- Firebug.Debugger.clearAllBreakpoints(null);
- Firebug.resetAllOptions(false);
+ var Firebug = FBTest.FirebugWindow.Firebug;
+ Firebug.PanelActivation.toggleAll("off"); // These should be done with button presses not API calls.
+ Firebug.PanelActivation.toggleAll("none");
+ Firebug.PanelActivation.clearAnnotations(true);
- // Console preview is hidden by default
- if (this.isConsolePreviewVisible())
- this.clickConsolePreviewButton();
+ if (Firebug.isDetached())
+ Firebug.toggleDetachBar();
- // Use default Firebug height and side panel width
- this.setBrowerWindowSize(1024, 768);
- this.setFirebugBarHeight(270);
- this.setSidePanelWidth(350);
+ // First clear all breakpoints and consequently the reset all options that
+ // clears the breakpoints storage.
+ Firebug.Debugger.clearAllBreakpoints(null);
+ Firebug.resetAllOptions(false);
- this.clearSearchField();
+ // Console preview is hiden by default
+ if (this.isConsolePreviewVisible())
+ this.clickConsolePreviewButton();
- // xxxHonza: xxxJJB how clear the persisted panel state?
- }, 50);
- }
- }
- };
+ // Use default Firebug height and side panel width
+ this.setBrowerWindowSize(1024, 768);
+ this.setFirebugBarHeight(270);
+ this.setSidePanelWidth(350);
- winWatcher.registerNotification(watcherObserver);
+ this.clearSearchField();
- var Firebug = FBTest.FirebugWindow.Firebug;
- Firebug.PanelActivation.toggleAll("off"); // These should be done with button presses not API calls.
- Firebug.PanelActivation.toggleAll("none");
- Firebug.PanelActivation.clearAnnotations();
+ // xxxHonza: xxxJJB how clear the persisted panel state?
};
// ********************************************************************************************* //

0 comments on commit faadf97

Please sign in to comment.