~ubuntu-branches/ubuntu/vivid/unity-webapps-qml/vivid

« back to all changes in this revision

Viewing changes to examples/api-bindings/online-accounts/www/js/app.js

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Ubuntu daily release, Alexandre Abreu
  • Date: 2014-05-14 22:31:22 UTC
  • mfrom: (1.1.30)
  • Revision ID: package-import@ubuntu.com-20140514223122-ln3ei1hz5je1tkc6
Tags: 0.1+14.10.20140514.2-0ubuntu1
[ Ubuntu daily release ]
* New rebuild forced

[ Alexandre Abreu ]
* Cleanup the structure of the QML bindings to make it clearer. No
  Changes in functionality all features are still working & same, This
  is an updated version of: https://code.launchpad.net/~abreu-
  alexandre/unity-webapps-qml/restructure-cleanup-bindings-qml-
  structure/+merge/208148 with the latest changes that got in in
  between (LP: #1288801)
* Simplifies the manifest.json handling in some instances. More
  precisely when one is using a custom model search path for the
  webapp lookup, some restrictions are being put on what is expected
  to be found in the folder among which: a common/ subfolder (even if
  the webapp doesnt require one),. one or more unity-webapps-* folders
  with manifest.json & *.user.js files in it,. More over the manifest
  files do require user scripts to be defined. This imposes a set of
  constraints over a given webapp that simply wants to use the
  container (w/o js injection). This simplifies it an allows one to
  define a manifest.json file (still with some required elements, but
  a smaller set), directly in the model search path. E.g. something
  like: {     "name": "MyWebApp",     "homepage":
  "http://www.bbc.co.uk/news/",     "domain": "bbc.co.uk",
      "includes": [] } will do, or to avoid any confusion w/ the click
  manifest.json file, one also searches for a webapp-properties.json
  w/ the same content as above.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
    var api = external.getUnityObject('1.0');
5
5
    var oa = api.OnlineAccounts;
6
6
 
 
7
    oa.api.getProviders({"applicationId": "webbrowser-app"}, function(providers) {
 
8
        var ul = document.querySelector('#providers ul');
 
9
 
 
10
        for (var i = 0; i < providers.length; ++i) {
 
11
            var li = document.createElement('li');
 
12
            li.innerHTML = 'displayName: ' + providers[i].displayName
 
13
                    + ', providerId: ' + providers[i].providerId;
 
14
            ul.appendChild(li);
 
15
        }
 
16
    });
 
17
 
7
18
    function listAccounts() {
8
19
        var filters = {};
9
20
        var service = document.getElementById('service').value;