diff options
author | Jose Antonio Marquez | 2012-06-01 09:59:30 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-06-01 09:59:30 -0700 |
commit | 2986e229ae939fe38be6417b1aee52a4646af0a5 (patch) | |
tree | 4551bdeddd41e47350a7ce9956844110cfaa98eb /node_modules/montage-google/feed-reader/feed-reader.reel | |
parent | e88e42ec2b4fdf1bbd04765b56d17c7cbcdbc4ee (diff) | |
parent | 8bbabd61e600e0a4aee72377c962d9147db1d8e1 (diff) | |
download | ninja-2986e229ae939fe38be6417b1aee52a4646af0a5.tar.gz |
Merge branch 'refs/heads/Ninja-Internal' into Components
Diffstat (limited to 'node_modules/montage-google/feed-reader/feed-reader.reel')
-rw-r--r-- | node_modules/montage-google/feed-reader/feed-reader.reel/feed-reader.html | 43 | ||||
-rw-r--r-- | node_modules/montage-google/feed-reader/feed-reader.reel/feed-reader.js | 14 |
2 files changed, 32 insertions, 25 deletions
diff --git a/node_modules/montage-google/feed-reader/feed-reader.reel/feed-reader.html b/node_modules/montage-google/feed-reader/feed-reader.reel/feed-reader.html index 28c0ed1f..99a353b9 100644 --- a/node_modules/montage-google/feed-reader/feed-reader.reel/feed-reader.html +++ b/node_modules/montage-google/feed-reader/feed-reader.reel/feed-reader.html | |||
@@ -3,17 +3,16 @@ | |||
3 | <head> | 3 | <head> |
4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
5 | <title>Feed Reader</title> | 5 | <title>Feed Reader</title> |
6 | 6 | ||
7 | <script type="text/javascript" src="https://www.google.com/jsapi?callback=initGoogleAPI"></script> | 7 | <script type="text/javascript" src="https://www.google.com/jsapi?callback=initGoogleAPI"></script> |
8 | 8 | ||
9 | <script type="text/montage-serialization"> | 9 | <script type="text/montage-serialization"> |
10 | { | 10 | { |
11 | "entriesController": { | 11 | "entriesController": { |
12 | "name": "ArrayController", | 12 | "prototype": "montage/ui/controller/array-controller", |
13 | "module": "montage/ui/controller/array-controller", | ||
14 | "properties": { | 13 | "properties": { |
15 | "selectObjectsOnAddition": true, | 14 | "selectObjectsOnAddition": true, |
16 | "automaticallyOrganizeObjects": true | 15 | "automaticallyOrganizeObjects": true |
17 | }, | 16 | }, |
18 | "bindings": { | 17 | "bindings": { |
19 | "content": { | 18 | "content": { |
@@ -23,10 +22,9 @@ | |||
23 | } | 22 | } |
24 | } | 23 | } |
25 | }, | 24 | }, |
26 | 25 | ||
27 | "feedEntry": { | 26 | "feedEntry": { |
28 | "module": "montage-google/feed-reader/feed-entry.reel", | 27 | "prototype": "montage-google/feed-reader/feed-entry.reel", |
29 | "name": "FeedEntry", | ||
30 | "properties": { | 28 | "properties": { |
31 | "element": {"#": "feed-entry"} | 29 | "element": {"#": "feed-entry"} |
32 | }, | 30 | }, |
@@ -36,17 +34,16 @@ | |||
36 | "boundObjectPropertyPath": "activeFeedEntry", | 34 | "boundObjectPropertyPath": "activeFeedEntry", |
37 | "oneway": true | 35 | "oneway": true |
38 | } | 36 | } |
39 | } | 37 | } |
40 | }, | 38 | }, |
41 | 39 | ||
42 | "owner": { | 40 | "owner": { |
43 | "module": "montage-google/feed-reader/feed-reader.reel", | 41 | "prototype": "montage-google/feed-reader/feed-reader.reel", |
44 | "name": "FeedReader", | ||
45 | "properties": { | 42 | "properties": { |
46 | "element": {"#": "feed-reader"} | 43 | "element": {"#": "feed-reader"} |
47 | } | 44 | } |
48 | } | 45 | } |
49 | 46 | ||
50 | } | 47 | } |
51 | </script> | 48 | </script> |
52 | 49 | ||
@@ -56,23 +53,23 @@ | |||
56 | height: 120px; | 53 | height: 120px; |
57 | width: 380px; | 54 | width: 380px; |
58 | } | 55 | } |
59 | 56 | ||
60 | .feed-entry { | 57 | .feed-entry { |
61 | } | 58 | } |
62 | 59 | ||
63 | 60 | ||
64 | </style> | 61 | </style> |
65 | 62 | ||
66 | 63 | ||
67 | </head> | 64 | </head> |
68 | <body> | 65 | <body> |
69 | <div class="feed-reader" id="feed-reader"> | 66 | <div class="feed-reader" data-montage-id="feed-reader"> |
70 | 67 | ||
71 | <div id="entries"> | 68 | <div data-montage-id="entries"> |
72 | <div class="feed-entry" id="feed-entry"></div> | 69 | <div class="feed-entry" data-montage-id="feed-entry"></div> |
73 | </div> | 70 | </div> |
74 | 71 | ||
75 | 72 | ||
76 | </div> | 73 | </div> |
77 | 74 | ||
78 | </body> | 75 | </body> |
diff --git a/node_modules/montage-google/feed-reader/feed-reader.reel/feed-reader.js b/node_modules/montage-google/feed-reader/feed-reader.reel/feed-reader.js index 47a831eb..c066220e 100644 --- a/node_modules/montage-google/feed-reader/feed-reader.reel/feed-reader.js +++ b/node_modules/montage-google/feed-reader/feed-reader.reel/feed-reader.js | |||
@@ -8,6 +8,10 @@ var Montage = require("montage").Montage, | |||
8 | 8 | ||
9 | exports.FeedReader = Montage.create(Component, { | 9 | exports.FeedReader = Montage.create(Component, { |
10 | 10 | ||
11 | _apiLoaded: { | ||
12 | value: false | ||
13 | }, | ||
14 | |||
11 | didCreate: { | 15 | didCreate: { |
12 | value: function() { | 16 | value: function() { |
13 | var self = this; | 17 | var self = this; |
@@ -17,6 +21,8 @@ exports.FeedReader = Montage.create(Component, { | |||
17 | google.load("feeds", "1", { | 21 | google.load("feeds", "1", { |
18 | callback: function() { | 22 | callback: function() { |
19 | console.log('google feeds api loaded'); | 23 | console.log('google feeds api loaded'); |
24 | self._apiLoaded = true; | ||
25 | self.feedURL = self._feedURL; | ||
20 | self.needsDraw = true; | 26 | self.needsDraw = true; |
21 | window.initGoogleAPI = null; | 27 | window.initGoogleAPI = null; |
22 | } | 28 | } |
@@ -30,13 +36,16 @@ exports.FeedReader = Montage.create(Component, { | |||
30 | 36 | ||
31 | _feedURL: {value: null}, | 37 | _feedURL: {value: null}, |
32 | feedURL: { | 38 | feedURL: { |
39 | serializable: true, | ||
33 | get: function() { | 40 | get: function() { |
34 | return this._feedURL; | 41 | return this._feedURL; |
35 | }, | 42 | }, |
36 | set: function(value) { | 43 | set: function(value) { |
37 | this._feedURL = value; | 44 | this._feedURL = value; |
38 | // execute the search and get the entries | 45 | // execute the search and get the entries |
39 | this._fetchFeed(); | 46 | if (this._apiLoaded) { |
47 | this._fetchFeed(); | ||
48 | } | ||
40 | } | 49 | } |
41 | }, | 50 | }, |
42 | 51 | ||
@@ -49,6 +58,7 @@ exports.FeedReader = Montage.create(Component, { | |||
49 | 58 | ||
50 | _feedDisplayMode: {value: null}, | 59 | _feedDisplayMode: {value: null}, |
51 | feedDisplayMode: { | 60 | feedDisplayMode: { |
61 | serializable: true, | ||
52 | get: function() { | 62 | get: function() { |
53 | return this._feedDisplayMode; | 63 | return this._feedDisplayMode; |
54 | }, | 64 | }, |
@@ -107,7 +117,7 @@ exports.FeedReader = Montage.create(Component, { | |||
107 | self.addEntryAnimation(); | 117 | self.addEntryAnimation(); |
108 | self.entries = result.feed.entries; | 118 | self.entries = result.feed.entries; |
109 | self.activeIndex = 0; | 119 | self.activeIndex = 0; |
110 | 120 | ||
111 | } | 121 | } |
112 | 122 | ||
113 | 123 | ||