Skip to content

Commit 906f6cf

Browse files
committed
Merge pull request #38 from sethhoward1988/master
Added Google Drive Realtime API Element
2 parents 2d1597b + 26f160e commit 906f6cf

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-1
lines changed

demo.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
<body>
1111

1212
<google-client-api></google-client-api>
13+
<google-jsapi></google-jsapi>
14+
<google-maps-api></google-maps-api>
1315
<google-plusone-api></google-plusone-api>
16+
<google-realtime-api></google-realtime-api>
17+
<google-youtube-api></google-youtube-api>
1418

1519
<div></div>
1620

google-apis.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212
<link rel="import" href="google-jsapi.html">
1313
<link rel="import" href="google-maps-api.html">
1414
<link rel="import" href="google-plusone-api.html">
15+
<link rel="import" href="google-realtime-api.html">
1516
<link rel="import" href="google-youtube-api.html">

google-realtime-api.html

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!--
2+
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
3+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6+
Code distributed by Google as part of the polymer project is also
7+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8+
-->
9+
10+
<link rel="import" href="../polymer/polymer.html">
11+
<link rel="import" href="../core-shared-lib/core-shared-lib.html">
12+
13+
<!--
14+
Dynamically loads the Google Drive Realtime API, firing the `api-load` event when ready.
15+
16+
Any number of components can use `<google-realtime-api>` elements, and the library will only be loaded once.
17+
18+
@element google-realtime-api
19+
@extends core-shared-lib
20+
@homepage https://googlewebcomponents.github.io/google-apis
21+
-->
22+
<polymer-element name="google-realtime-api" extends="core-shared-lib">
23+
<script>
24+
Polymer({
25+
defaultUrl: 'https://apis.google.com/js/drive-realtime.js?onload=%%callback%%',
26+
/**
27+
* Fired when the API library is loaded and available.
28+
* @event api-load
29+
*/
30+
notifyEvent: 'api-load',
31+
32+
/**
33+
* Wrapper for `gapi.drive.realtime` API object.
34+
* @property api
35+
* @type gapi.drive.realtime
36+
*/
37+
get api() {
38+
return gapi.drive.realtime;
39+
}
40+
});
41+
</script>
42+
</polymer-element>

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<core-component-page
1313
moduleName="google-apis"
14-
sources='["google-client-api.html", "google-jsapi.html", "google-maps-api.html", "google-plusone-api.html", "google-youtube-api.html"]'>
14+
sources='["google-client-api.html", "google-jsapi.html", "google-maps-api.html", "google-plusone-api.html", "google-realtime-api.html", "google-youtube-api.html"]'>
1515
</core-component-page>
1616

1717
</body>

0 commit comments

Comments
 (0)