Skip to content

Instantly share code, notes, and snippets.

@jasherai
Created March 3, 2009 15:39
Show Gist options
  • Save jasherai/73372 to your computer and use it in GitHub Desktop.
Save jasherai/73372 to your computer and use it in GitHub Desktop.
//STUMBLEUPON
var window = CmdUtils.getWindow();
function createCustomCommand(name, desc, func){
return CmdUtils.CreateCommand({
name: name,
icon: "http://www.stumbleupon.com/favicon.ico",
homepage: "http://foyrek.com/",
author: { name: "Abimanyu", email: "abimanyuraja@gmail.com"},
license: "GPL",
description: desc,
preview: function( pblock, input ) {
pblock.innerHTML = desc;
},
execute: function() {
func.apply(this);
}
});
}
createCustomCommand("stumble", "Stumbles using StumbleUpon", function(){window.stumble(0);});
createCustomCommand("thumbs-up", "Add to StumbleUpon favorites. Show more like this.", function(){
window.su_rate(1, 0, 0, 0);
});
createCustomCommand("thumbs-down", "Dislikes this page on StumbleUpon. No more like this.", function(){
window.su_rate(0, 0, 0, 0);
displayMessage("You disliked it");
});
createCustomCommand("view-reviews", "View reviews of this page on StumbleUpon", function(){window.su_website_info(0,'', 0);});
createCustomCommand("toggle-toolbar", "Toggle the StumbleUpon toolbar", function(){window.su_toggle_toolbar();});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment