"Try it" buttons #165

Merged
merged 2 commits into from May 26, 2012
@@ -29,6 +29,21 @@
<h2>Invocation</h2>
<pre>var intent = new Intent("http://webintents.org/edit");
window.navigator.startActivity(intent);</pre>
+
+<h3>Try it!</h3>
+<script>
+function invoke() {
+ var intent = new WebKitIntent("http://webintents.org/edit", "image/jpeg", "");
+
+ var onSuccess = function(data) { /* woot */ };
+ var onError = function(data) { /* boooo */ };
+
+ window.navigator.webkitStartActivity(intent, onSuccess, onError);
+}
+</script>
+<p><button onclick="invoke()">Edit</button></p>
+
+
<h2>Data Formats</h2>
<p>Clients and services can only interact with each other if the both support the same intent AND the same data type. Data-types can be any arbitary string, but it is expected that client and service will pass the same data if they both agree to support the protocol.</p>
<p>Advisory data-schemes are described below based off <a href="http://en.wikipedia.org/wiki/Internet_media_type" target="_blank">MIME-Types</a> or <a href="http://activitystrea.ms/head/activity-schema.html#object-types" target="_blank">Activity Streams</a></p>
@@ -29,6 +29,20 @@
<h2>Invocation</h2>
<pre>var intent = new Intent("http://webintents.org/pick");
window.navigator.startActivity(intent);</pre>
+
+<h3>Try it!</h3>
+<script>
+function invoke() {
+ var intent = new WebKitIntent("http://webintents.org/pick", "image/jpeg", "");
+
+ var onSuccess = function(data) { /* woot */ };
+ var onError = function(data) { /* boooo */ };
+
+ window.navigator.webkitStartActivity(intent, onSuccess, onError);
+}
+</script>
+<p><button onclick="invoke()">Pick</button></p>
+
<h2>Data Formats</h2>
<p>Clients and services can only interact with each other if the both support the same intent AND the same data type. Data-types can be any arbitary string, but it is expected that client and service will pass the same data if they both agree to support the protocol.</p>
<p>Advisory data-schemes are described below based off <a href="http://en.wikipedia.org/wiki/Internet_media_type" target="_blank">MIME-Types</a> or <a href="http://activitystrea.ms/head/activity-schema.html#object-types" target="_blank">Activity Streams</a></p>
@@ -29,6 +29,21 @@
<h2>Invocation</h2>
<pre>var intent = new Intent("http://webintents.org/save");
window.navigator.startActivity(intent);</pre>
+
+<h3>Try it!</h3>
+<script>
+function invoke() {
+ var intent = new WebKitIntent("http://webintents.org/save", "image/jpeg", "");
+
+ var onSuccess = function(data) { /* woot */ };
+ var onError = function(data) { /* boooo */ };
+
+ window.navigator.webkitStartActivity(intent, onSuccess, onError);
+}
+</script>
+<p><button onclick="invoke()">Save</button></p>
+
+
<h2>Data Formats</h2>
<p>Clients and services can only interact with each other if the both support the same intent AND the same data type. Data-types can be any arbitary string, but it is expected that client and service will pass the same data if they both agree to support the protocol.</p>
<p>Advisory data-schemes are described below based off <a href="http://en.wikipedia.org/wiki/Internet_media_type" target="_blank">MIME-Types</a> or <a href="http://activitystrea.ms/head/activity-schema.html#object-types" target="_blank">Activity Streams</a></p>
@@ -29,6 +29,23 @@
<h2>Invocation</h2>
<pre>var intent = new Intent("http://webintents.org/share");
window.navigator.startActivity(intent);</pre>
+
+
+<h3>Try it!</h3>
+<script>
+function invoke() {
+ var intent = new WebKitIntent("http://webintents.org/share", "text/uri-list", "http://http://webintents.org/");
+
+ var onSuccess = function(data) { /* woot */ };
+ var onError = function(data) { /* boooo */ };
+
+ window.navigator.webkitStartActivity(intent, onSuccess, onError);
+}
+</script>
+<p><button onclick="invoke()">Share</button></p>
+
+
+
<h2>Data Formats</h2>
<p>Clients and services can only interact with each other if the both support the same intent AND the same data type. Data-types can be any arbitary string, but it is expected that client and service will pass the same data if they both agree to support the protocol.</p>
<p>Advisory data-schemes are described below based off <a href="http://en.wikipedia.org/wiki/Internet_media_type" target="_blank">MIME-Types</a> or <a href="http://activitystrea.ms/head/activity-schema.html#object-types" target="_blank">Activity Streams</a></p>
@@ -26,6 +26,18 @@
<h2>Invocation</h2>
<pre>var intent = new Intent("http://webintents.org/subscribe");
window.navigator.startActivity(intent);</pre>
+ <h3>Try it!</h3>
+ <script>
+ function invoke() {
+ var intent = new WebKitIntent("http://webintents.org/subscribe", "application/rss+xml", "http://paul.kinlan.me/atom.xml");
+
+ var onSuccess = function(data) { /* woot */ };
+ var onError = function(data) { /* boooo */ };
+
+ window.navigator.webkitStartActivity(intent, onSuccess, onError);
+ }
+ </script>
+ <p><button onclick="invoke()">Subscribe</button></p>
<h2>Data Formats</h2>
<p>Clients and services can only interact with each other if the both support the same intent AND the same data type. Data-types can be any arbitary string, but it is expected that client and service will pass the same data if they both agree to support the protocol.</p>
<p>Advisory data-schemes are described below based off <a href="http://en.wikipedia.org/wiki/Internet_media_type" target="_blank">MIME-Types</a> or <a href="http://activitystrea.ms/head/activity-schema.html#object-types" target="_blank">Activity Streams</a></p>
@@ -29,6 +29,20 @@
<h2>Invocation</h2>
<pre>var intent = new Intent("http://webintents.org/view");
window.navigator.startActivity(intent);</pre>
+
+<h3>Try it!</h3>
+<script>
+function invoke() {
+ var intent = new WebKitIntent("http://webintents.org/view", "application/atom+xml", "http://paul.kinlan.me/atom.xml");
+
+ var onSuccess = function(data) { /* woot */ };
+ var onError = function(data) { /* boooo */ };
+
+ window.navigator.webkitStartActivity(intent, onSuccess, onError);
+}
+</script>
+<p><button onclick="invoke()">View</button></p>
+
<h2>Data Formats</h2>
<p>Clients and services can only interact with each other if the both support the same intent AND the same data type. Data-types can be any arbitary string, but it is expected that client and service will pass the same data if they both agree to support the protocol.</p>
<p>Advisory data-schemes are described below based off <a href="http://en.wikipedia.org/wiki/Internet_media_type" target="_blank">MIME-Types</a> or <a href="http://activitystrea.ms/head/activity-schema.html#object-types" target="_blank">Activity Streams</a></p>