Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CmdUtils.CreateCommand({
- name: "alc",
- description: "英辞郎検索",
- help: "英辞郎検索",
- query_url: "http://eow.alc.co.jp//UTF-8",
- icon: "http://eow.alc.co.jp/favicon.ico",
- stand: "tsukkee",
- takes: {parameter: noun_arb_text},
- _getQuery: function(directObject) {
- var query = this.name;
- if (directObject.text != "")
- query += " " + directObject.text;
- return encodeURI(query);
- },
- preview: function( pblock, directObject ) {
- var shot_url = "http://mozshot.nemui.org/shot?";
- var img_url = "<img src='" + shot_url + this.query_url + "'/>";
- var help = "<p>" + this.help + "</p>";
- pblock.innerHTML = help + img_url;
- },
- execute: function(directObject) {
- var url = "http://www.startcommand.com/stand/" + this.stand + "?cmd={QUERY}";
- var query = this._getQuery(directObject);
- var urlString = url.replace("{QUERY}", query);
- Utils.openUrlInBrowser(urlString);
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment