Changes

Jump to: navigation, search

Labs/Ubiquity/Locked-Down Feed Tutorial

1,101 bytes added, 17:23, 17 March 2009
added another section
== Introduction ==
Locked-Down Feeds , or LD Feeds, are just one way to write functionality that can be used from anywhere. The advantage of of this kind of feed is that all code is runin a very restricted sandbox that has minimal access to the outside environment—for instance, it can't access the network or the local filesystem. This means that subscribing to such feeds is worry-free: unlike regular command feeds, there's no [[Media:Warning.PNG|scary warning page]] to read. Instead, subscribing to a Locked-Down LD Feed results in the following unintrusive confirmation:
http://www.toolness.com/images/20090317100145.jpg
The downside, of course, is that this safety comes at the cost of flexibility: put simply, you can't do nearly as much with Locked-Down LD Feeds as you can with regular feeds, but it can still be used to make a variety of useful commands. == A Lot Like Regular Feeds == LD Feeds are best thought of as a strict subset of regular feeds. For instance, commands are created using <code>CmdUtils.CreateCommand()</code> and <code>displayMessage()</code> works too, so the code for our "Hello World" example is exactly the same as in our [[Labs/Ubiquity/Ubiquity_Source_Tip_Author_Tutorial#Using_CreateCommand|Author Tutorial]]: <pre>CmdUtils.CreateCommand({ name: "hello-world", execute: function() { displayMessage("Hello, World!"); }});</pre> The only thing we really need to change is to tell Ubiquity that it should interpret the code as a LD Feed instead of a regular one. You can do this in Ubiquity's built-in command editor by specifying "locked-down-commands" in the feed type drop-down menu. When [[Labs/Ubiquity/Ubiquity_Source_Tip_Author_Tutorial#Sharing_it_with_the_World|sharing it with the world]], you use a value of <code>locked-down-commands</code> for the <code>rel</code> attribute in the <code>link</code> tag: <pre><link rel="locked-down-commands" href="http://path-to-js" name="Title Goes Here" /></pre>
== External Resources ==
874
edits

Navigation menu