Labs/F1/Modularity: Difference between revisions

Jump to navigation Jump to search
No edit summary
Line 17: Line 17:
=== F1 postMessage APIs ===
=== F1 postMessage APIs ===


F1 will need to define the following javascript postMessage/jschannel based APIs (this is off-the-top-of-my-head and hoping to capture the intent rather than the actual spelling)
[[Labs/F1/Modularity/WebMod-API]]
 
To be implemented by the app (ie, APIs called by F1)
 
getShareCharacteristics()
  Get enough metadata about the application so the necessary UI for the service can be dynamically built.  This is similar to the current F1 "services" global, and allows F1 to offer "send to wall" for facebook versus "send to my contacts" for linkedin.
 
getUserInfos()
  Return a *list* of info for each logged in user to the service.  If the list contains more than 1 item, multiple accounts against that service are being used (eg, 2 twitter accounts are configured).  The user-info will include some pre-defined fields (eg, name, username, avatar) and any other values the service desires.  The full user info (including the service specific "blobs") will be passed back into the service for many future operations.
 
Optionally, the return value will include a URL which can be used for logging in.  Services which only allow one user at a time will only return that URL when the list of logged-in users is zero.  Services which allow multiple users/accounts will return this URL even when there are returned users.
 
When login is required/desired, F1 will open the popup and establish a postMessage channel between the popup and the invisible iframe, so the login screen and the application itself can directly communicate.  When login is complete, the app itself will be able to communicate this back to F1 (which will then re-execute this request and presumably get an extra user in the returned list, and adjust the UI accordingly)
 
getAutocompleteEntries(user_info, send_to, to_prefix)
  Get all the autocomplete entries for the "to" field based on the current setting of the "send to" field for the specified user.  For example, the facebook app might return the list of all groups you are a member of if send_to="group wall", and twitter would send a list of all your followers for send_to="direct".
 
send(user_info, data)
  Send an item as described by "data" - ie, perform the actual share.
 
APIs to be implemented by F1, suitable for being called by any of the services:
 
userInfoChanged()
  Inform F1 that the list of logged-in users for the app has changed. F1 will refresh the service by calling getUserInfo() and adjust itself accordingly - eg, by creating a second visible iframe for the service if a new user appears, or displaying special UI if no logins exist at all.
 
others?


== Deployment Plan ==
== Deployment Plan ==
668

edits

Navigation menu