Created
September 25, 2009 03:51
-
-
Save mooz/193286 to your computer and use it in GitHub Desktop.
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
key.setGlobalKey(['C-x', '0'], function (ev, arg) { | |
SplitBrowser.activeBrowserCloseWindow(); | |
}, '現在のフレームを閉じる'); | |
key.setGlobalKey(['C-x', '1'], function (ev, arg) { | |
var url = SplitBrowser.activeBrowser != gBrowser ? SplitBrowser.activeSubBrowser.src : null; | |
var browsers = SplitBrowser.browsers; | |
for (var i = 0; i < browsers.length; ++i) | |
browsers[i].close(); | |
if (url) window.loadURI(url); | |
}, '現在のフレームだけを表示'); | |
key.setGlobalKey(['C-x', '2'], function (ev, arg) { | |
SplitBrowser.addSubBrowser(window.content.location.href, | |
SplitBrowser.activeSubBrowser, | |
SplitBrowser.POSITION_BOTTOM); | |
}, 'フレームを横に分割'); | |
key.setGlobalKey(['C-x', '3'], function (ev, arg) { | |
SplitBrowser.addSubBrowser(window.content.location.href, | |
SplitBrowser.activeSubBrowser, | |
SplitBrowser.POSITION_RIGHT); | |
}, 'フレームを縦に分割'); | |
key.setGlobalKey(['C-x', 'k'], function (ev, arg) { | |
var b = SplitBrowser.activeBrowser; | |
if (b.mTabs.length > 1) { | |
b.removeTab(b.mCurrentTab); | |
} else if (b === gBrowser) { | |
gBrowser.removeTab(gBrowser.mCurrentTab); | |
} | |
}, '現在のタブを閉じる'); | |
key.setGlobalKey(['C-x', 'o'], function (ev, arg) { | |
function focusSubBrowserById(aId) { | |
SplitBrowser.getSubBrowserById(aId).browser.contentWindow.focus(); | |
} | |
var browsers = SplitBrowser.browsers; | |
if (SplitBrowser.activeBrowser === gBrowser) { | |
focusSubBrowserById(browsers[(arg == null) ? 0 : browsers.length - 1].id); | |
return; | |
} | |
var id = SplitBrowser.activeSubBrowser.id; | |
for (var i = 0; i < browsers.length; i++) { | |
if (browsers[i].id == id) | |
break; | |
} | |
var nextIndex = (arg == null) ? i + 1 : i - 1; | |
if (nextIndex >= browsers.length || nextIndex < 0) | |
gBrowser.contentWindow.focus(); | |
else | |
focusSubBrowserById(browsers[nextIndex].id); | |
} | |
, '次のフレームを選択', true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment