Skip to content

Instantly share code, notes, and snippets.

@perigrin
Forked from codewzrd/delicious.js
Created January 19, 2009 04:08
Show Gist options
  • Save perigrin/48867 to your computer and use it in GitHub Desktop.
Save perigrin/48867 to your computer and use it in GitHub Desktop.
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