Created
June 15, 2010 19:33
-
-
Save littlefolk/439597 to your computer and use it in GitHub Desktop.
vimperator plugin patch: bartab-integration.jsをBarTab 2.0でも動くように
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/bartab-integration.js b/bartab-integration.js | |
index 3878e46..69b5c55 100644 | |
--- a/bartab-integration.js | |
+++ b/bartab-integration.js | |
@@ -38,7 +38,7 @@ function barTap_bufferCompletion (context) { | |
<span highlight="Indicator" style="display: inline-block; width: 2em; text-align: center">{item.item.indicator}</span> | |
{ process.call(this, item, text) } | |
</>]; | |
- context.completions = util.map(tabs.browsers, function ([i, browser]) { | |
+ context.completions = util.map(util.Array.iteritems(gBrowser.mTabs), function ([i, browser]) { | |
let indicator = " "; | |
let ontap = browser.hasAttribute("ontap"); | |
if (i == tabs.index()) | |
@@ -49,7 +49,7 @@ function barTap_bufferCompletion (context) { | |
indicator = (ontap ? "*" : " ") + indicator; | |
let tab = tabs.getTab(i); | |
- let url = ontap ? browser.userTypedValue : browser.contentDocument.location.href; | |
+ let url = ontap ? browser.linkedBrowser.userTypedValue : browser.linkedBrowser.contentDocument.location.href; | |
i = i + 1; | |
return { | |
@@ -83,21 +83,21 @@ function tap (arg, isAll) { | |
for (let i=0, len= tabbrowser.mTabs.length; i<len; i++) { | |
let tab = tabbrowser.mTabs[i]; | |
if (tab != tabbrowser.mCurrentTab && !tab.hasAttribute("ontap")) | |
- BarTap.putOnTap(tab, tabbrowser); | |
+ gBrowser.BarTabHandler.unloadTab(tab); | |
} | |
} else if (!arg) { | |
- BarTap.putOnTap(tabs.getTab(), tabbrowser); | |
+ gBrowser.BarTabHandler.unloadTab(tabs.getTab()); | |
} else if (arg == "#") { | |
- BarTap.putOnTap(tabs.alternate, tabbrowser); | |
+ gBrowser.BarTabHandler.unloadTab(tabs.alternate); | |
} else { | |
let matches = arg.match(/^(\d+):?/); | |
if (matches) { | |
- BarTap.putOnTap(tabs.getTab(parseInt(matches[1], 10) - 1), tabbrowser); | |
+ gBrowser.BarTabHandler.unloadTab(tabs.getTab(parseInt(matches[1], 10) - 1)); | |
} | |
} | |
} | |
-commands.addUserCommand(["tap"], "BarTap: tap", | |
+commands.addUserCommand(["tap"], "BarTab: tap", | |
function (args) { | |
tap(args.literalArg, args.bang); | |
}, { | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment