Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

for recovering previous changes

  • Loading branch information...
commit 07e66a10fa622f718c77796259d1f8014d25b0f7 1 parent 959fca5
Farshid Beheshti authored June 20, 2012

Showing 1 changed file with 44 additions and 84 deletions. Show diff stats Hide diff stats

  1. 128  extension/content/firebug/firebug.js
128  extension/content/firebug/firebug.js
@@ -75,6 +75,18 @@ var defaultFuncRep = null;
75 75
 var menuItemControllers = [];
76 76
 var panelTypeMap = {};
77 77
 
  78
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
  79
+
  80
+try
  81
+{
  82
+    // Register default Firebug string bundle (yet before domplate templates).
  83
+    Locale.registerStringBundle("chrome://firebug/locale/firebug.properties");
  84
+}
  85
+catch (exc)
  86
+{
  87
+    dump("Register default string bundle FAILS: "+exc+"\n");
  88
+}
  89
+
78 90
 // ********************************************************************************************* //
79 91
 
80 92
 if (window.Firebug)
@@ -777,55 +789,28 @@ window.Firebug =
777 789
         if (panelName)
778 790
             Firebug.chrome.selectPanel(panelName);
779 791
 
780  
-        if (!Firebug.currentContext)
781  
-        {
782  
-            var context = Firebug.getContext();
783  
-            // Be sure the UI is open for a newly created context.
784  
-            forceOpen = true;
785  
-        }
786  
-
787  
-        if (Firebug.isDetached())
  792
+        var webApp = Firebug.connection.getCurrentSelectedWebApp();
  793
+        var context = Firebug.connection.getContextByWebApp(webApp);
  794
+        if (!context)  // then we are not debugging the selected tab
788 795
         {
789  
-            if ( !Firebug.chrome.hasFocus() || forceOpen)
790  
-            {
791  
-                Firebug.chrome.focus();
792  
-            } else
793  
-            {
794  
-                Firebug.minimizeBar();
795  
-            }
  796
+            context = Firebug.connection.getOrCreateContextByWebApp(webApp);
  797
+            forceOpen = true;  // Be sure the UI is open for a newly created context
796 798
         }
797  
-        // toggle minimize
798  
-        else if (Firebug.isMinimized())
  799
+        else  // we were debugging
799 800
         {
800  
-            // be careful, unMinimize func always sets placement to
801  
-            // inbrowser first then unminimizes. when we want to
802  
-            // unminimize in detached mode must call detachBar func.
803  
-            if (Firebug.framePosition == "detached")
804  
-                this.detachBar();
805  
-            else
806  
-                Firebug.unMinimize();
  801
+
807 802
         }
808  
-        // else isInBrowser
809  
-        else if (!forceOpen)
810  
-        {
  803
+
  804
+        if (Firebug.isDetached()) // if we are out of the browser focus the window
  805
+            Firebug.chrome.focus();
  806
+        else if (Firebug.framePosition == "detached")
  807
+            this.detachBar();
  808
+        else if (Firebug.isMinimized()) // toggle minimize
  809
+            Firebug.unMinimize();
  810
+        else if (!forceOpen)  // else isInBrowser
811 811
             Firebug.minimizeBar();
812  
-        }
813  
-        return true;
814  
-    },
815 812
 
816  
-    /**
817  
-     * Get context for the current website
818  
-     */
819  
-    getContext: function()
820  
-    {
821  
-        var webApp = Firebug.connection.getCurrentSelectedWebApp();
822  
-        var context = Firebug.connection.getContextByWebApp(webApp);
823  
-        // we are not debugging the selected tab.
824  
-        if (!context)
825  
-        {
826  
-            context = Firebug.connection.getOrCreateContextByWebApp(webApp);
827  
-        }
828  
-        return context;
  813
+        return true;
829 814
     },
830 815
 
831 816
     /**
@@ -854,20 +839,10 @@ window.Firebug =
854 839
 
855 840
     minimizeBar: function()  // just pull down the UI, but don't deactivate the context
856 841
     {
857  
-        if (Firebug.isDetached())
  842
+        if (Firebug.isDetached())  // TODO disable minimize on externalMode
858 843
         {
859 844
             // TODO reattach
860  
-
861  
-            // window is closing in detached mode
862  
-            if (Firebug.chrome.window.top)
863  
-            {
864  
-                topWindow = Firebug.chrome.window.top;
865  
-                topWindow.exportFirebug();
866  
-                topWindow.close();
867  
-            }
868  
-
869  
-            Firebug.setPlacement("minimized");
870  
-            this.showBar(false);
  845
+            Firebug.toggleDetachBar(false, false);
871 846
             Firebug.chrome.focus();
872 847
         }
873 848
         else // inBrowser -> minimized
@@ -897,39 +872,24 @@ window.Firebug =
897 872
     // detached -> closed; inBrowser -> detached TODO reattach
898 873
     toggleDetachBar: function(forceOpen, reopenInBrowser)
899 874
     {
900  
-    
901  
-        //detached -> inbrowser
902  
-        if (!forceOpen && Firebug.isDetached())
  875
+        if(Firebug.isDetached()) {
  876
+            Firebug.chrome.$("fbMinimizeButton").setAttribute("disabled","false");
  877
+        } else {
  878
+            Firebug.chrome.$("fbMinimizeButton").setAttribute("disabled","true");
  879
+        }
  880
+
  881
+        if (!forceOpen && Firebug.isDetached())  // detached -> minimized
903 882
         {
904 883
             var topWin = Firebug.chrome.window.top;
905 884
             topWin.exportFirebug();
906 885
             topWin.close();
907 886
 
908 887
             if (reopenInBrowser)
909  
-            {
910  
-                // Is Firebug deactivated ? if yes, should be
911  
-                // activated first, then unminimize.
912  
-                if (!Firebug.currentContext)
913  
-                {
914  
-                    var context = Firebug.getContext();
915  
-                }
916 888
                 Firebug.unMinimize();
917  
-            }
918 889
             else
919  
-            {
920 890
                 Firebug.minimizeBar();
921  
-            }
922  
-                
923  
-            Firebug.chrome.syncPositionPref();
924  
-        }
925  
-        // is minimized now but the last time that has been closed, was in detached mode,
926  
-        // so it should be returned to in browser mode because the user has pressed CTRL+F12.
927  
-        else if (Firebug.framePosition == "detached" && Firebug.isMinimized())
928  
-        {
929  
-            Firebug.unMinimize();
930 891
             Firebug.chrome.syncPositionPref();
931 892
         }
932  
-        // else is in browser mode, then switch to detached mode
933 893
         else
934 894
         {
935 895
             this.detachBar();
@@ -957,7 +917,7 @@ window.Firebug =
957 917
             return null;
958 918
         }
959 919
 
960  
-        if (Firebug.chrome.waitingForDetach)
  920
+        if(Firebug.chrome.waitingForDetach)
961 921
             return null;
962 922
         Firebug.chrome.waitingForDetach = true;
963 923
 
@@ -1011,7 +971,7 @@ window.Firebug =
1011 971
         // Dispatch to non-module objects.
1012 972
         Options.resetAllOptions(confirm);
1013 973
 
1014  
-        // Dispatch to all modules so that additional settings can be reset.
  974
+        // Dispatch to all modules so, additional settings can be reset.
1015 975
         Events.dispatch(modules, "resetAllOptions", []);
1016 976
     },
1017 977
 
@@ -1371,7 +1331,7 @@ window.Firebug =
1371 1331
     {
1372 1332
         testLists.push({
1373 1333
             extension: "Firebug",
1374  
-            testListURL: "http://getfirebug.com/tests/head/firebug.html"
  1334
+            testListURL: "http://getfirebug.com/tests/content/testlists/firebug1.10.html"
1375 1335
         });
1376 1336
     }
1377 1337
 };
@@ -1418,10 +1378,10 @@ Firebug.getConsoleByGlobal = function getConsoleByGlobal(global)
1418 1378
 // ********************************************************************************************* //
1419 1379
 
1420 1380
 /**
1421  
- * Support for listeners registration. This object is also extended by Firebug.Module,
1422  
- * so all modules supports listening automatically. Note that an array of listeners is
1423  
- * created for each intance of a module within the initialize method. Thus all derived
1424  
- * module classes must ensure that the Firebug.Module.initialize method is called for the
  1381
+ * Support for listeners registration. This object also extended by Firebug.Module so,
  1382
+ * all modules supports listening automatically. Notice that array of listeners
  1383
+ * is created for each intance of a module within initialize method. Thus all derived
  1384
+ * module classes must ensure that Firebug.Module.initialize method is called for the
1425 1385
  * super class.
1426 1386
  */
1427 1387
 Firebug.Listener = function()

0 notes on commit 07e66a1

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