buftab.jsをPanoramaに対応


追記 : [Vimperator - buftabs.jsをFirefox29.1に対応 - Qiita](http://qiita.com/tigberd/items/9ff9e313dd5d1db9f31d)

## 概要
buftab.jsがPanoramaに対応しておらず、別のタブグループのタブもまとめて表示されていました。
そのためタブを切り替える際に表示順の切り替えができず不便だったので現在使っているPanoramaのタブのみを表示するように変更しました。

## パッチ
https://github.com/tigberd/buftabs.js

```diff
 $ diff -u buftabs.js.old buftabs.js
--- buftabs.js.old
+++ buftabs.js
@@ -1,5 +1,5 @@
 // {{{ Information
-var INFO =
+let INFO = xml`
 <plugin name="buftabs" version="1.0"
     href="http://git.glacicle.org/vimperator-buftabs/"
     summary="Buftabs: show the tabbar in the statusline"
@@ -34,7 +34,7 @@
             Set to 0 for unlimited.
         </description>
     </item>
-</plugin>;
+</plugin>;`;
 // }}}

 buftabs = {
@@ -48,12 +48,12 @@
         var position=0, selpos;

         // Make sure we have an appropriate amount of labels
-        while (btabs.childNodes.length > browsers.length)
+        while (btabs.childNodes.length > window.gBrowser.visibleTabs.length)
         {
             btabs.removeChild(btabs.lastChild);
         }

-        while (btabs.childNodes.length < browsers.length)
+        while (btabs.childNodes.length < window.gBrowser.visibleTabs.length)
         {
             var label = document.createElement("label");
             btabs.appendChild(label);
@@ -68,10 +68,11 @@
         }

         // Create the new tabs
-        for (let i=0; i < browsers.length; i++)
+        for (let i=0; i < window.gBrowser.visibleTabs.length; i++)
         {
+            var tabnum = window.gBrowser.tabContainer.getIndexOfItem(window.gBrowser.visibleTabs[i]);
             // Create label
-            var browser = browsers[i];
+            var browser = browsers[tabnum];
             var label = btabs.childNodes[i];

             // Hook on load
@@ -85,10 +86,11 @@
             }

             // Fill label
-            label.tabpos = i;
+            label.tabpos = tabnum;
+            label.num = i;
             buftabs.fillLabel(label, browser);

-            if (tabs.index() == label.tabpos)
+            if (tabs.index() == tabnum)
             {
                 selpos = [position, label.clientWidth+position];
             }
@@ -105,7 +107,8 @@
             btabs.scrollLeft = 0;

         // Empty url label
-        urlWidget.value = "";
+        statusline.updateField("location","");
+        liberator.echo(buffer.URL,2);
     },

     // Fill a label with browser content
@@ -131,7 +134,7 @@
             tabvalue += "\u2764";

         // Brackets and index
-        tabvalue = "["+(label.tabpos+1)+"-"+tabvalue+"]";
+        tabvalue = "["+(label.num+1)+"-"+tabvalue+"]";

         label.setAttribute("value", tabvalue);

@@ -140,28 +143,23 @@
             label.setAttributeNS(NS.uri, "highlight", "BufTabSelected");
         else
             label.setAttributeNS(NS.uri, "highlight", "BufTab");
-
-
     },

     // Create the horizontal box for adding the tabs to
     createBar: function()
     {
-        var statusline = document.getElementById("liberator-statusline");
+        var addonbar = document.getElementById("addon-bar");
         var buftabs = document.getElementById("liberator-statusline-buftabs");
-        var urlWidget = document.getElementById("liberator-statusline-field-url");
-
         // Only create if it doesn't exist yet
         if (!buftabs)
         {
             buftabs = document.createElement("hbox");
             buftabs.setAttribute("id", "liberator-statusline-buftabs");
             buftabs.setAttribute("flex", "1");
-            buftabs.style.overflow = "hidden"
-
-            statusline.insertBefore(buftabs, urlWidget);
+            buftabs.style.overflow = "hidden";
+            addonbar.insertBefore(buftabs, addonbar.firstChild);
         }
-    },
+    },

     destroyBar: function()
     {
@@ -197,13 +195,12 @@
 window.getBrowser().addEventListener("load", function (event) {
     if (options.get("buftabs").get())
         statusline.updateUrl();
-}, false);
+}, true);

 /// Initialise highlight groups
-highlight.loadCSS(String(<![CDATA[
-    BufTab
-    BufTabSelected   font-weight: bold;
-]]>));
+highlight.loadCSS(['BufTab',
+                   'BufTabSelected   font-weight: bold;'
+].join("\n"));

 /// Options
 options.add(["buftabs"],
```