Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Issue 2643 (Make Break On ... feature more obvious in panel tabs)

  • Loading branch information...
commit 1fb87ae2ad940cc790673a0a5c03a5116b98c960 1 parent 896ee3c
Sebastian Zartner authored June 18, 2012
14  extension/content/firebug/firebug.css
@@ -337,8 +337,20 @@ panelTab > panelTabMenu .menuPopup:-moz-locale-dir(rtl) {
337 337
 
338 338
 /************************************************************************************************/
339 339
 
  340
+@-moz-keyframes armedBlinking {
  341
+    100% {
  342
+        text-shadow: 1px 1px 2px darkGray, 0px 0px 1em orange, 0px 0px 0.2em orange;
  343
+    }
  344
+}
  345
+
340 346
 panelTab[breakOnNextArmed="true"] > .panelTab-text {
341  
-    text-shadow: 1px 1px 2px darkGray, 0 0 1em orange, 0 0 0.2em orange !important;
  347
+    -moz-animation: armedBlinking 0.8s ease-out infinite alternate;
  348
+}
  349
+
  350
+panelTab.highlighted {
  351
+    text-shadow: 1px 1px 2px darkGray, 0px 0px 1em orange, 0px 0px 0.2em orange !important;
  352
+    -moz-transition-property: text-shadow;
  353
+    -moz-transition-duration: 0.8s;
342 354
 }
343 355
 
344 356
 panelTab[aria-disabled='true'] {
54  extension/content/firebug/js/breakpoint.js
@@ -23,6 +23,11 @@ function(Obj, Firebug, Domplate, FirebugReps, Locale, Events, SourceLink,
23 23
     StackFrame, Css, Dom, Str, Arr, Persist, Menu, FBS) {
24 24
 
25 25
 // ********************************************************************************************* //
  26
+// Constants
  27
+
  28
+const animationDuration = 0.8;
  29
+
  30
+ // ********************************************************************************************* //
26 31
 // Breakpoints
27 32
 
28 33
 Firebug.Breakpoint = Obj.extend(Firebug.Module,
@@ -107,6 +112,26 @@ Firebug.Breakpoint = Obj.extend(Firebug.Module,
107 112
             Menu.createMenuItem(menuPopup, menuItems[i]);
108 113
     },
109 114
 
  115
+    toggleTabHighlighting: function(event)
  116
+    {
  117
+        // Don't continue if it's the wrong animation phase
  118
+        if (Math.floor(event.elapsedTime * 10) % (animationDuration * 20) != 0)
  119
+            return;
  120
+
  121
+        Events.removeEventListener(event.target, "animationiteration",
  122
+            Firebug.Breakpoint.toggleTabHighlighting, true);
  123
+
  124
+        var panel = Firebug.currentContext.getPanel(event.target.panelType.prototype.name);
  125
+        if (!panel)
  126
+            return;
  127
+
  128
+        if (!panel.context.delayedArmedTab)
  129
+            return;
  130
+
  131
+        panel.context.delayedArmedTab.setAttribute("breakOnNextArmed", "true");
  132
+        delete panel.context.delayedArmedTab;
  133
+    },
  134
+
110 135
     updateBreakOnNextTooltips: function(panel)
111 136
     {
112 137
         var breakable = Firebug.chrome.getGlobalAttribute("cmd_toggleBreakOn", "breakable");
@@ -145,7 +170,34 @@ Firebug.Breakpoint = Obj.extend(Firebug.Module,
145 170
         var panelBar = Firebug.chrome.$("fbPanelBar1");
146 171
         var tab = panelBar.getTab(panel.name);
147 172
         if (tab)
148  
-            tab.setAttribute("breakOnNextArmed", armed ? "true" : "false");
  173
+        {
  174
+            if (armed)
  175
+            {
  176
+                // If there is already a panel armed synchronize highlighting of the panel tabs
  177
+                var tabPanel = tab.parentNode;
  178
+                var otherTabIsArmed = false;
  179
+                for (var i = 0; i < tabPanel.children.length; ++i)
  180
+                {
  181
+                    var panelTab = tabPanel.children[i];
  182
+                    if (panelTab !== tab && panelTab.getAttribute("breakOnNextArmed") == "true")
  183
+                    {
  184
+                        panel.context.delayedArmedTab = tab;
  185
+                        Events.addEventListener(panelTab, "animationiteration",
  186
+                            this.toggleTabHighlighting, true);
  187
+                        otherTabIsArmed = true;
  188
+                        break;
  189
+                    }
  190
+                }
  191
+
  192
+                if (!otherTabIsArmed)
  193
+                    tab.setAttribute("breakOnNextArmed", "true");
  194
+            }
  195
+            else
  196
+            {
  197
+                delete panel.context.delayedArmedTab;
  198
+                tab.setAttribute("breakOnNextArmed", "false");
  199
+            }
  200
+        }
149 201
     },
150 202
 
151 203
     updatePanelTabs: function(context)

0 notes on commit 1fb87ae

Please sign in to comment.
Something went wrong with that request. Please try again.