Created
August 5, 2009 00:37
-
-
Save jasonong/162401 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
names: ["objectliteral"], | |
icon: "http://www.blogger.com/favicon.ico", | |
description: "Shortcut to my blog.", | |
help: "list, create or search", | |
author: {name: "Jason Ong", email: "[email protected]"}, | |
license: "GPL", | |
homepage: "http://objectliteral.blogspot.com", | |
arguments: [{role: 'object', nountype: noun_arb_text}], | |
urls: { | |
home: "http://objectliteral.blogspot.com/", | |
list: "http://www.blogger.com/posts.g?blogID=3898581946541844969", | |
create: "http://www.blogger.com/post-create.g?blogID=3898581946541844969", | |
template: "http://www.blogger.com/html?blogID=3898581946541844969", | |
search: "http://objectliteral.blogspot.com/search?q=" | |
}, | |
preview: function preview(pblock, args) { | |
pblock.innerHTML = "objectliteral: <b>" + args.object.html + "</b>."; | |
}, | |
execute: function execute(args) { | |
var words = args.object.text; | |
var queries = words.split(' '); | |
var key = queries[0]; | |
var query = queries[1]; | |
var link = this.urls[key]; | |
if (link != null) { | |
var url = link; | |
if (query != null) { | |
url += query; | |
}; | |
Utils.openUrlInBrowser(url); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment