[Pkg-mozext-commits] [all-in-one-sidebar] 17/49: Ignore: small code fixes and refactoring

David Prévot taffit at moszumanska.debian.org
Fri Sep 19 16:46:35 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository all-in-one-sidebar.

commit e4cbc3753dc26c3dade2455197e84493ca38bd55
Author: Ingo Wennemaring <github at addonlab.com>
Date:   Mon Apr 21 18:13:04 2014 +0200

    Ignore: small code fixes and refactoring
---
 content/aios.xul    |  9 ++-------
 content/aios_fx.js  | 42 ++++++++++++++++++++++++++++++------------
 content/aios_old.js |  4 ++--
 3 files changed, 34 insertions(+), 21 deletions(-)

diff --git a/content/aios.xul b/content/aios.xul
index ed5ceac..290b249 100644
--- a/content/aios.xul
+++ b/content/aios.xul
@@ -124,7 +124,7 @@
 
     <!-- Sidebar-Status auf Veraenderungen ueberwachen -->
     <vbox id="sidebar-box">
-    <!--
+        <!--
             Darwin: => bei staendiger Ueberwachung der beiden Attribute startet Fx immer mit geoeffneter Sidebar
                     => ohne Ueberwachung und deaktiviertem SidebarCollapsing fehlt die Ausfuehrung der Funktion,
                        was dazu fuehrt, dass u.a. die Grippy-Pfeile nicht korrekt gewechselt werden
@@ -138,16 +138,11 @@
         <!-- CollapseByStyle-Methode <observes id="aios_observeStyle" element="sidebar-box" attribute="style"
             onbroadcast="if(aios_collapseSidebar) aios_observeSidebar('style');" />-->
 
-    <!-- "src"-Status der Sidebar ueberwachen => letzte Sidebar merken -->
+        <!-- "src"-Status der Sidebar ueberwachen => letzte Sidebar merken -->
         <observes element="sidebar" attribute="src" onbroadcast="aios_remLastSidebar();" />
     </vbox>
 
 
-    <!-- Tooltips zuweisen -->
-    <label id="sidebar-title" tooltip="sidebarheader-tooltip" />
-    <image id="sidebar-throbber" tooltip="sidebarheader-tooltip" />
-
-
     <!-- Grippy -->
     <splitter id="sidebar-splitter" orient="horizontal" grippy="false" persist="grippy">
         <grippy id="aios-sidebarGrippy" hidden="true" persist="hidden" onclick="aios_useGrippy();" />
diff --git a/content/aios_fx.js b/content/aios_fx.js
index e1af286..13b20ed 100644
--- a/content/aios_fx.js
+++ b/content/aios_fx.js
@@ -199,15 +199,20 @@ if(aios_collapseSidebar) BrowserStartup = function() {
  *                 it changes the sidebar's visibility.
  *  - group        this attribute must be set to "sidebar".
  */
+// modified by exxile
+//    => original: function toggleSidebar(commandID, forceOpen) {
 if(aios_collapseSidebar) toggleSidebar = function(commandID, forceOpen) {
+// end modified by exxile
 
   var sidebarBox = document.getElementById("sidebar-box");
   if (!commandID)
     commandID = sidebarBox.getAttribute("sidebarcommand");
 
-  //add by exxile => sonst gibt es Fehler bei der 2. Druckvorschau, wenn SidebarCollapsing aktiv ist und die Sidebar zugeklappt
-  // => commandID ist in diesem Fall nicht definiert
+  // added by exxile
+  //    => sonst gibt es Fehler bei der 2. Druckvorschau, wenn SidebarCollapsing aktiv ist und die Sidebar zugeklappt
+  //    => commandID ist in diesem Fall nicht definiert
   if(!commandID) return;
+  // end added by exxile
 
   var sidebarBroadcaster = document.getElementById(commandID);
   var sidebar = document.getElementById("sidebar"); // xul:browser
@@ -227,15 +232,19 @@ if(aios_collapseSidebar) toggleSidebar = function(commandID, forceOpen) {
       sidebarBroadcaster.removeAttribute("checked");
       sidebarBox.setAttribute("sidebarcommand", "");
 
-      //mod by exxile sidebarTitle.value = "";
-      //mod by exxile sidebar.setAttribute("src", "about:blank");
-      //mod by exxile sidebarBox.hidden = true;
+      // commented by exxile
+      // sidebarTitle.value = "";
+      // sidebarBox.hidden = true;
+      // end commented by exxile
+
+      // added by exxile
       sidebarBox.removeAttribute('hidden');
       sidebarBox.collapsed = true;
       // CollapseByStyle-Methode sidebarBox.setAttribute('style', 'display:none;');
+      // end added by exxile
 
       sidebarSplitter.hidden = true;
-      content.focus();
+      gBrowser.selectedBrowser.focus();
     } else {
       fireSidebarFocusedEvent();
     }
@@ -246,22 +255,27 @@ if(aios_collapseSidebar) toggleSidebar = function(commandID, forceOpen) {
 
   // ..but first update the 'checked' state of all sidebar broadcasters
   var broadcasters = document.getElementsByAttribute("group", "sidebar");
-  for (var i = 0; i < broadcasters.length; ++i) {
+  for (let broadcaster of broadcasters) {
     // skip elements that observe sidebar broadcasters and random
     // other elements
-    if (broadcasters[i].localName != "broadcaster")
+    if (broadcaster.localName != "broadcaster")
       continue;
 
-    if (broadcasters[i] != sidebarBroadcaster)
-      broadcasters[i].removeAttribute("checked");
+    if (broadcaster != sidebarBroadcaster)
+      broadcaster.removeAttribute("checked");
     else
       sidebarBroadcaster.setAttribute("checked", "true");
   }
 
-  //mod by exxile sidebarBox.hidden = false;
+  // commented by exxile
+  // sidebarBox.hidden = false;
+  // end commented by exxile
+
+  // added by exxile
   sidebarBox.removeAttribute('hidden');
   sidebarBox.removeAttribute('collapsed');
   // CollapseByStyle-Methode sidebarBox.removeAttribute('style');
+  // end added by exxile
 
   sidebarSplitter.hidden = false;
 
@@ -284,4 +298,8 @@ if(aios_collapseSidebar) toggleSidebar = function(commandID, forceOpen) {
     sidebar.addEventListener("load", sidebarOnLoad, true);
   else // older code handled this case, so we do it too
     fireSidebarFocusedEvent();
-}
\ No newline at end of file
+
+// modified by exxile
+//    => original: }
+};
+// end modified by exxile
\ No newline at end of file
diff --git a/content/aios_old.js b/content/aios_old.js
index fc3d3e6..f07c5a8 100644
--- a/content/aios_old.js
+++ b/content/aios_old.js
@@ -313,9 +313,9 @@ function aios_setSidebarOrient() {
         //document.persist(fx_mainWindow.id, 'aiosOrient');
 
         // Links-Rechts <=> Rechts-Links
-        var cStyleWindow = document.defaultView.getComputedStyle(fx_mainWindow, '');
+        //var cStyleWindow = document.defaultView.getComputedStyle(fx_mainWindow, '');
         fx_mainWindow.setAttribute('aiosMode', 'ltr');
-        if(cStyleWindow.direction == "rtl") fx_mainWindow.setAttribute('aiosMode', 'rtl');
+        //if(typeof cStyleWindow === 'object' && typeof cStyleWindow.direction === 'string' && cStyleWindow.direction == "rtl") fx_mainWindow.setAttribute('aiosMode', 'rtl');
         //document.persist(fx_mainWindow.id, 'aiosMode');
 
         // Fix fuer MileWideBack

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/all-in-one-sidebar.git



More information about the Pkg-mozext-commits mailing list