Created
September 4, 2010 05:11
-
-
Save azu/564921 to your computer and use it in GitHub Desktop.
検索結果のタブを一覧表示するタブを作るtwicli plugin
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
/* twicli plugin (http://twicli.neocat.jp/) | |
* switchViewedSearches.js | |
* 検索結果のタブを一覧表示するタブを作る - サイドバーなど狭い場所で使ってる人向け | |
* Pluginsに http://gist.github.com/564921.txt を読み込む | |
*/ | |
registerPlugin({ | |
switchTo: function(tab) { | |
if (tws_list.length > 1 && !$('viewed_searches')) { | |
var newTab = document.createElement('a'); | |
newTab.href = 'javascript:void switchViewedSearches()'; | |
newTab.id = 'viewed_searches'; | |
newTab.innerHTML = '▶' | |
$("misc").parentNode.insertBefore(newTab, $("misc").nextSibling); | |
} | |
} | |
}) | |
function switchViewedSearches() { | |
switchTo("viewed_searches"); | |
$("tw2h").innerHTML = tws_list.reverse().map(function(word) { | |
return '<p style="margin-left:10px;"><a href="http://pcod.no-ip.org/yats/search?query=' + word.replace("#","") + '" onclick="twsSearch(\'' + word + '\'); return false;">' + word + '</a></p>'; | |
}).join(''); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment