Labs/Jetpack/JEP/14: Difference between revisions

Jump to navigation Jump to search
→‎Example Usage: Added note about OS X menu platform bug
(→‎id: Not yet implemented)
(→‎Example Usage: Added note about OS X menu platform bug)
Line 501: Line 501:


Add a "Recent Tweets" submenu to the Jetpack menu.  (Assume we've defined a <code>getRecentTweets()</code>, which invokes a callback with an array of strings.)  When the menu is shown, it displays a "Loading..." item.  If the menu remains open when <code>getRecentTweets()</code> receives data from the network and calls <code>done()</code>, the "Loading..." item is replaced with the tweets, one item per tweet.
Add a "Recent Tweets" submenu to the Jetpack menu.  (Assume we've defined a <code>getRecentTweets()</code>, which invokes a callback with an array of strings.)  When the menu is shown, it displays a "Loading..." item.  If the menu remains open when <code>getRecentTweets()</code> receives data from the network and calls <code>done()</code>, the "Loading..." item is replaced with the tweets, one item per tweet.
<span style="background: #fdd">''This example will not work on OS X due to a platform bug in Firefox.  Replace <tt>jetpack.menu.add</tt> with <tt>jetpack.menu.context.page</tt> to see the effect on the content context menu.''</span>


<pre class="brush:js;">
<pre class="brush:js;">
Confirmed users
764

edits

Navigation menu