Skip to content

Instantly share code, notes, and snippets.

@mcepl
Created March 28, 2011 21:13
Show Gist options
  • Save mcepl/891295 to your computer and use it in GitHub Desktop.
Save mcepl/891295 to your computer and use it in GitHub Desktop.
Demand OpenID on the current (or other) page
CmdUtils.CreateCommand({
names: ["demand"],
description: "Demand OpenID to be used for the current page",
author: {
name: "Matej Cepl",
email: "mcepl@redhat.com"
},
license: "MIT/X11",
icon: "http://www.mozilla.com/favicon.ico",
arguments: [{
role: "object",
nountype: noun_type_url,
label: "URL"
}],
execute: function execute(args) {
var baseURL = 'http://openid-please.appspot.com/add';
var params = {
bookmarklet: true,
v: 2,
k: "your-key", // FIXME!!! You need to fill here hash from the bookmarklet
url: args.object.text
};
jQuery.get(baseURL, params, function(ret, textStatus) {
displayMessage(textStatus);
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment