Skip to content

Instantly share code, notes, and snippets.

@edvakf
Created November 2, 2010 01:14
Show Gist options
  • Select an option

  • Save edvakf/659143 to your computer and use it in GitHub Desktop.

Select an option

Save edvakf/659143 to your computer and use it in GitHub Desktop.
var favstar_user;
(function() {
var initialized = false;
function showFavstar() {
switchTo('favstar');
$('tw2c').innerHTML = '<iframe src="http://favstar.fm/users/'+favstar_user+'/recent" style="display:block;border:none;width:100%;height:600px;"></iframe>';
return false;
}
registerPlugin({
miscTab: function(ele) {
var div = document.createElement('div');
div.innerHTML = '<input id="favstar_user" value="'+favstar_user+'"><button onclick="favstar_user=$(\'favstar_user\').value">favstar user</button>';
var hr = document.createElement('hr');
hr.className = 'spacer';
ele.appendChild(hr);
ele.appendChild(div);
},
update: function() {
if (initialized) return;
initialized = true;
favstar_user = myname;
var a = document.createElement('a');
a.id = 'favstar';
a.innerHTML = 'faved';
a.href = '#';
a.onclick = showFavstar;
$('menu2').appendChild(a);
}
});
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment