Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>From what I can gather this is Twitters own implementation of <a href="http://webintents.org/" rel="nofollow">Web Intents</a> which is a Web API loosely based on Androids Intents functionality. It looks like that Twitter are using a JavaScript implementation of Web Intents <a href="https://github.com/PaulKinlan/webintents" rel="nofollow">(possibly similar to this</a>).</p> <p>In this scenario, the Twitter JavaScript registers an <code>intent</code> with the browser. The <code>intent</code> being you sharing a URL. When the user clicks the tweet button the <code>intent</code> activity is started and a new pop-up windows is displayed.</p> <p>The user clicks the tweet button from the pop-up window and the browser posts back the event data to a callback specified when starting the activity. The callback is specified in the <code>widget.js</code> and you hook up to this event using the <code>twttr.events.bind</code> method.</p> <p>There is a really good example of how this works on the <a href="https://github.com/PaulKinlan/webintents" rel="nofollow">JavaScript github</a> implementation of WebIntents.</p> <blockquote> <p><strong>Usage</strong></p> <p><strong>To use today</strong></p> <p>No browsers currently support this API natively. To use this system simple drop the following code in to your site:</p> <pre><code>&lt;script src="http://webintents.org/webintents.min.js"&gt;&lt;/script&gt; </code></pre> <p>When browsers start to implement this natively the Shim will defer all its functionality to the native interface.</p> <p><strong>Declaration</strong></p> <p>To register your service application to be able to handle image sharing simply declare an intent tag.</p> <pre><code>&lt;intent action="http://webintents.org/share" type="image/*" /&gt; </code></pre> <p>This will register the current page's ability to share images.</p> <p><strong>Invocation</strong></p> <p>To build a client application that can use the share functionality, it is as simple as using the following code:</p> <pre><code>var intent = new Intent( "http://webintents.org/share", "image/*", "http://upload.wikimedia.org/wikipedia/commons/thumb/f/f8/Three_jolly_kittens.png/800px-Three_jolly_kittens.png" ); window.navigator.startActivity(intent); </code></pre> <p><strong>Service</strong></p> <p>When a service is invoked via startActivity, the "intent" object on window will be populated with the data provided by the client.</p> <pre><code>window.intent </code></pre> <p>That's it.</p> <p>To send data back to the client that invoked it, it is as simple as calling postResult() on the intent.</p> <pre><code>window.intent.postResult("something cool"); </code></pre> </blockquote> <p>The example is obviously slightly different to the Twitter implementation but the general process is the same.</p> <p>Here are few other references for the WebIntents API:</p> <ul> <li><a href="http://www.chromium.org/developers/design-documents/webintentsapi" rel="nofollow">Chromium Project - Web Intents</a></li> <li><a href="http://blog.chromium.org/2011/08/connecting-web-apps-with-web-intents.html" rel="nofollow">Another Example of how WebIntents is used from the Chromium blog</a></li> <li><a href="https://dev.twitter.com/docs/intents" rel="nofollow">Twitter Web Intents API Documentation</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload