Skip to content

Instantly share code, notes, and snippets.

@codewzrd
Created September 8, 2008 18:09
Show Gist options
  • Save codewzrd/9499 to your computer and use it in GitHub Desktop.
Save codewzrd/9499 to your computer and use it in GitHub Desktop.
delicious
CmdUtils.CreateCommand({
name: "delicious",
description: "It is equivalent to the Delicious.com bookmarklet.",
icon: "http://delicious.com/favicon.ico",
homepage: "http://www.makadia.com",
author: { name: "Svapan Makadia", email: "codewzrd@hotmail.com"},
help: "If you select some text, it will be placed in the notes field.",
preview: "Bookmark the current page to Delicious.com",
execute: function(){
var document = Application.activeWindow.activeTab.document;
var windowName = 'deliciousuiv5';
var windowFeature = 'location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550';
var addr = 'http://delicious.com/save?url=' +
encodeURIComponent(document.location.href) +
'&title=' +
encodeURIComponent(document.title) +
'&v=5&notes=' +
CmdUtils.getSelection() +
'&';
if(!window.open(addr + 'noui=1&jump=doclose', windowName, windowFeature))
{
location.href=addr + 'jump=yes';
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment