Blame view

bower_components/google-apis/demo/index.html 1.48 KB
73bcce88   luigser   COMPONENTS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
  <!doctype html>
  <!-- Copyright (c) 2015 Google Inc. All rights reserved. -->
  <html>
  <head>
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
    <title>google-apis Demo</title>
    <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
    <link rel="import" href="../google-apis.html">
  </head>
  <body>
    <div id="messages"></div>
  
    <template  id="t" is="dom-bind">
  
      <google-client-loader id="shortener"
        name="urlshortener"
        version="v1"
        on-google-api-load="loadedShortener"></google-client-loader>
      <google-js-api on-js-api-load="loaded"></google-js-api>
      <google-plusone-api on-api-load="loaded"></google-plusone-api>
      <google-realtime-api on-api-load="loaded"></google-realtime-api>
      <google-maps-api on-api-load="loaded"></google-maps-api>
      <google-youtube-api on-api-load="loaded"></google-youtube-api>
      <google-legacy-loader on-api-load="loaded"></google-legacy-loader>
  
    </template>
  
    <script>
      var t = document.querySelector('#t');
  
      t.loadedShortener = function(event) {
        var request = event.target.api.url.get({
          shortUrl: 'http://goo.gl/fbsS'
        })
        request.execute(function(resp) {
          console.log(resp);
        });
      };
  
      t.loaded = function(e) {
        document.querySelector('#messages').innerHTML +=
          e.target.localName + ' loaded' + '<br>';
        console.log(e.target.localName + ' loaded', event.target.api);
      };
    </script>
  </body>
  </html>