diff options
author | pekepeke | 2008-11-01 04:24:26 +0000 |
---|---|---|
committer | pekepeke | 2008-11-01 04:24:26 +0000 |
commit | 40f13ee987f551cb5bccfa8330e4738f1191c2a9 (patch) | |
tree | bc7e78689711875e384b207bc99eba104bf7cad9 /bookmarktoolbar-hint.js | |
parent | adda95c12d27f64b046a9af4c36c9e40944d4c91 (diff) | |
download | vimperator-plugins-40f13ee987f551cb5bccfa8330e4738f1191c2a9.tar.bz2 |
handling for 2.0pre
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@22491 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'bookmarktoolbar-hint.js')
-rw-r--r-- | bookmarktoolbar-hint.js | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/bookmarktoolbar-hint.js b/bookmarktoolbar-hint.js index 297a7a7..a37ab94 100644 --- a/bookmarktoolbar-hint.js +++ b/bookmarktoolbar-hint.js @@ -18,6 +18,7 @@ // liberator.plugins.bookmarkToolbarHints = (function(){ + if (typeof plugins == 'undefined') plugins = liberator.plugins; // for 2.0 pre function createTooltip(){ var tooltip = document.createElement('tooltip'); tooltip.setAttribute('style','padding:0;margin:0;'); @@ -63,7 +64,7 @@ liberator.plugins.bookmarkToolbarHints = (function(){ liberator.open(target.node.uri, where); } closeMenus(target); - liberator.options.guioptions = manager.go; + liberator.modules.options.guioptions = manager.go; } function folderOpen(target){ target.firstChild.showPopup(); @@ -94,11 +95,11 @@ liberator.plugins.bookmarkToolbarHints = (function(){ this.go = options.guioptions; options.guioptions += "b"; this.where = where; - liberator.modes.setCustomMode('BookmarksToolbar-Hint', function(){return;}, this.quit); + liberator.modules.modes.setCustomMode('BookmarksToolbar-Hint', function(){return;}, this.quit); this.show(); }, show:function(node){ - liberator.modes.set(liberator.modes.CUSTOM, liberator.modes.QUICK_HINT); + liberator.modules.modes.set(liberator.modules.modes.CUSTOM, liberator.modules.modes.QUICK_HINT); hints = []; window.addEventListener('keypress',onKeyPress,true); current = node || getToolbar(); @@ -112,14 +113,15 @@ liberator.plugins.bookmarkToolbarHints = (function(){ updateSelector(); }, onEvent: function(event){ - var key = liberator.events.toString(event); + var key = liberator.modules.events.toString(event); switch(key){ case "<Esc>": case "<C-[>": closeMenus(current); - liberator.options.guioptions = this.go; + liberator.modules.options.guioptions = this.go; break; case "<Return>": + case "<Right>": if (toolbarOpen(hints[currentNum])) return; break; case "f": @@ -131,9 +133,11 @@ liberator.plugins.bookmarkToolbarHints = (function(){ return; case "<Tab>": case "j": + case "<Down>": case "<S-Tab>": case "k": - if (key == "j" || key == "<Tab>"){ + case "<Up>": + if (key == "j" || key == "<Tab>" || key == "<Down>"){ currentNum = hints.length -1 == currentNum ? 0 : currentNum + 1; } else { currentNum = currentNum == 0 ? hints.length -1 : currentNum - 1; @@ -155,7 +159,7 @@ liberator.plugins.bookmarkToolbarHints = (function(){ case "h": if (current == this.toolbar){ closeMenus(current); - liberator.options.guioptions = this.go; + liberator.modules.options.guioptions = this.go; this.quit(); } else { current.hidePopup(); @@ -185,7 +189,7 @@ liberator.plugins.bookmarkToolbarHints = (function(){ currentNum = 0; useShift = false; window.removeEventListener('keypress',onKeyPress,true); - liberator.modes.reset(true); + liberator.modules.modes.reset(true); while(tooltipbox.hasChildNodes()){ tooltipbox.firstChild.hidePopup(); tooltipbox.removeChild(tooltipbox.firstChild); @@ -194,18 +198,19 @@ liberator.plugins.bookmarkToolbarHints = (function(){ }; var tooltipbox = document.createElement('box'); tooltipbox.setAttribute('id','liberator-tooltip-container'); - document.getElementById('liberator-container').appendChild(tooltipbox); + //document.getElementById('liberator-container').appendChild(tooltipbox); + document.getElementById('browser').appendChild(tooltipbox); return manager; })(); -liberator.mappings.addUserMap([liberator.modes.NORMAL], ['<Leader>f'], +liberator.modules.mappings.addUserMap([liberator.modules.modes.NORMAL], ['<Leader>f'], 'Start Toolbar-HINTS (open current tab)', - function(){ plugins.bookmarkToolbarHints.startup(liberator.CURRENT_TAB); }, + function(){ liberator.plugins.bookmarkToolbarHints.startup(liberator.CURRENT_TAB); }, { rhs: 'Bookmarks Toolbar-HINTS (current-tab)'} ); -liberator.mappings.addUserMap([liberator.modes.NORMAL], ['<Leader>F'], +liberator.modules.mappings.addUserMap([liberator.modules.modes.NORMAL], ['<Leader>F'], 'Start Toolbar-HINTS (open new tab)', - function(){ plugins.bookmarkToolbarHints.startup(liberator.NEW_TAB); }, + function(){ liberator.plugins.bookmarkToolbarHints.startup(liberator.NEW_TAB); }, { rhs: 'Bookmarks Toolbar-HINTS (new-tab)' } ); |