Created
July 27, 2009 14:28
-
-
Save jyt/156389 to your computer and use it in GitHub Desktop.
This file contains 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
//This is a ubiquity command | |
//to view a map and diections for places specified by you in India. | |
CmdUtils.CreateCommand({ | |
names: ["view directions","map directions"], | |
icon: "chrome://ubiquity/skin/icons/map.png", | |
description: "This command will open a map which show the directions about how to reach from a given place to a given destination in India", | |
help: "To view the directions type the name of places whose direction map you want to see", | |
author: {name: "Jyoti", email: "mail2jyoti88@gmail.com"}, | |
homepage: "http://jyzyy.blogspot.com/", | |
arguments: [{role: 'source', nountype: noun_arb_text}, | |
{role: 'goal', nountype: noun_arb_text} | |
], | |
preview: function preview(pblock, args) { | |
pblock.innerHTML = "view a map depiccting the directions from <b>" + args.source.html + "</b> to <b>"+args.goal.html+"</b>."; | |
}, | |
execute: function(args) | |
{ | |
if(args.source.text=="") | |
{ | |
displayMessage("You havent specified the source"); | |
return; | |
} | |
else if(args.goal.text=="") | |
{ | |
displayMessage("You havent specified the destination"); | |
return; | |
} | |
else | |
{ | |
Utils.openUrlInBrowser("http://maps.mapmyindia.com/?where=from:"+args.source.text+" to:"+args.goal.text+"&q=search") | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment