Guest User

Untitled

a guest
Feb 12th, 2012
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. CmdUtils.CreateCommand({
  2. name: "alc",
  3. description: "英辞郎検索",
  4. help: "英辞郎検索",
  5. query_url: "http://eow.alc.co.jp//UTF-8",
  6. icon: "http://eow.alc.co.jp/favicon.ico",
  7. stand: "tsukkee",
  8. takes: {parameter: noun_arb_text},
  9.  
  10. _getQuery: function(directObject) {
  11. var query = this.name;
  12. if (directObject.text != "")
  13. query += " " + directObject.text;
  14. return encodeURI(query);
  15. },
  16.  
  17. preview: function( pblock, directObject ) {
  18. var shot_url = "http://mozshot.nemui.org/shot?";
  19. var img_url = "<img src='" + shot_url + this.query_url + "'/>";
  20. var help = "<p>" + this.help + "</p>";
  21. pblock.innerHTML = help + img_url;
  22. },
  23.  
  24. execute: function(directObject) {
  25. var url = "http://www.startcommand.com/stand/" + this.stand + "?cmd={QUERY}";
  26. var query = this._getQuery(directObject);
  27. var urlString = url.replace("{QUERY}", query);
  28. Utils.openUrlInBrowser(urlString);
  29. }
  30. })
Advertisement
Add Comment
Please, Sign In to add comment