From 1d0efc758bc9404eebbc8b8d592de9dbb329899e Mon Sep 17 00:00:00 2001 From: François Frisch Date: Sat, 17 Mar 2012 11:21:22 -0700 Subject: Adding feed reader and map --- .../examples/feed-reader/images/07-map-marker.png | Bin 0 -> 3131 bytes .../examples/feed-reader/images/10-medical.png | Bin 0 -> 2915 bytes .../examples/feed-reader/images/100-coffee.png | Bin 0 -> 2958 bytes .../examples/feed-reader/images/107-widescreen.png | Bin 0 -> 2986 bytes .../examples/feed-reader/images/125-food.png | Bin 0 -> 3038 bytes .../feed-reader/images/142-wine-bottle.png | Bin 0 -> 187 bytes .../examples/feed-reader/images/34-coffee.png | Bin 0 -> 3052 bytes .../examples/feed-reader/images/35-shopping.png | Bin 0 -> 2970 bytes .../examples/feed-reader/images/38-airplane.png | Bin 0 -> 3004 bytes .../feed-reader/images/41-picture-frame.png | Bin 0 -> 2928 bytes .../feed-reader/images/48-fork-and-knife.png | Bin 0 -> 2882 bytes .../examples/feed-reader/images/87-wine-glass.png | Bin 0 -> 2983 bytes .../montage/examples/feed-reader/index.html | 81 +++++++++ .../examples/feed-reader/main.reel/main.html | 184 +++++++++++++++++++++ .../montage/examples/feed-reader/main.reel/main.js | 45 +++++ .../examples/feed-reader/map-example.reel/main.css | 2 + .../feed-reader/map-example.reel/main.html | 58 +++++++ .../examples/feed-reader/map-example.reel/main.js | 24 +++ .../montage/examples/feed-reader/package.json | 10 ++ 19 files changed, 404 insertions(+) create mode 100644 node_modules/montage/examples/feed-reader/images/07-map-marker.png create mode 100644 node_modules/montage/examples/feed-reader/images/10-medical.png create mode 100644 node_modules/montage/examples/feed-reader/images/100-coffee.png create mode 100644 node_modules/montage/examples/feed-reader/images/107-widescreen.png create mode 100644 node_modules/montage/examples/feed-reader/images/125-food.png create mode 100644 node_modules/montage/examples/feed-reader/images/142-wine-bottle.png create mode 100644 node_modules/montage/examples/feed-reader/images/34-coffee.png create mode 100644 node_modules/montage/examples/feed-reader/images/35-shopping.png create mode 100644 node_modules/montage/examples/feed-reader/images/38-airplane.png create mode 100644 node_modules/montage/examples/feed-reader/images/41-picture-frame.png create mode 100644 node_modules/montage/examples/feed-reader/images/48-fork-and-knife.png create mode 100644 node_modules/montage/examples/feed-reader/images/87-wine-glass.png create mode 100644 node_modules/montage/examples/feed-reader/index.html create mode 100644 node_modules/montage/examples/feed-reader/main.reel/main.html create mode 100644 node_modules/montage/examples/feed-reader/main.reel/main.js create mode 100644 node_modules/montage/examples/feed-reader/map-example.reel/main.css create mode 100644 node_modules/montage/examples/feed-reader/map-example.reel/main.html create mode 100644 node_modules/montage/examples/feed-reader/map-example.reel/main.js create mode 100644 node_modules/montage/examples/feed-reader/package.json (limited to 'node_modules/montage/examples') diff --git a/node_modules/montage/examples/feed-reader/images/07-map-marker.png b/node_modules/montage/examples/feed-reader/images/07-map-marker.png new file mode 100644 index 00000000..a5d99d69 Binary files /dev/null and b/node_modules/montage/examples/feed-reader/images/07-map-marker.png differ diff --git a/node_modules/montage/examples/feed-reader/images/10-medical.png b/node_modules/montage/examples/feed-reader/images/10-medical.png new file mode 100644 index 00000000..ab78c783 Binary files /dev/null and b/node_modules/montage/examples/feed-reader/images/10-medical.png differ diff --git a/node_modules/montage/examples/feed-reader/images/100-coffee.png b/node_modules/montage/examples/feed-reader/images/100-coffee.png new file mode 100644 index 00000000..4e9c517a Binary files /dev/null and b/node_modules/montage/examples/feed-reader/images/100-coffee.png differ diff --git a/node_modules/montage/examples/feed-reader/images/107-widescreen.png b/node_modules/montage/examples/feed-reader/images/107-widescreen.png new file mode 100644 index 00000000..2e5f1ba7 Binary files /dev/null and b/node_modules/montage/examples/feed-reader/images/107-widescreen.png differ diff --git a/node_modules/montage/examples/feed-reader/images/125-food.png b/node_modules/montage/examples/feed-reader/images/125-food.png new file mode 100644 index 00000000..81afd74a Binary files /dev/null and b/node_modules/montage/examples/feed-reader/images/125-food.png differ diff --git a/node_modules/montage/examples/feed-reader/images/142-wine-bottle.png b/node_modules/montage/examples/feed-reader/images/142-wine-bottle.png new file mode 100644 index 00000000..a7df9e97 Binary files /dev/null and b/node_modules/montage/examples/feed-reader/images/142-wine-bottle.png differ diff --git a/node_modules/montage/examples/feed-reader/images/34-coffee.png b/node_modules/montage/examples/feed-reader/images/34-coffee.png new file mode 100644 index 00000000..4c4bedad Binary files /dev/null and b/node_modules/montage/examples/feed-reader/images/34-coffee.png differ diff --git a/node_modules/montage/examples/feed-reader/images/35-shopping.png b/node_modules/montage/examples/feed-reader/images/35-shopping.png new file mode 100644 index 00000000..03689f99 Binary files /dev/null and b/node_modules/montage/examples/feed-reader/images/35-shopping.png differ diff --git a/node_modules/montage/examples/feed-reader/images/38-airplane.png b/node_modules/montage/examples/feed-reader/images/38-airplane.png new file mode 100644 index 00000000..dfcbbc78 Binary files /dev/null and b/node_modules/montage/examples/feed-reader/images/38-airplane.png differ diff --git a/node_modules/montage/examples/feed-reader/images/41-picture-frame.png b/node_modules/montage/examples/feed-reader/images/41-picture-frame.png new file mode 100644 index 00000000..6deee997 Binary files /dev/null and b/node_modules/montage/examples/feed-reader/images/41-picture-frame.png differ diff --git a/node_modules/montage/examples/feed-reader/images/48-fork-and-knife.png b/node_modules/montage/examples/feed-reader/images/48-fork-and-knife.png new file mode 100644 index 00000000..06d91088 Binary files /dev/null and b/node_modules/montage/examples/feed-reader/images/48-fork-and-knife.png differ diff --git a/node_modules/montage/examples/feed-reader/images/87-wine-glass.png b/node_modules/montage/examples/feed-reader/images/87-wine-glass.png new file mode 100644 index 00000000..b4d34474 Binary files /dev/null and b/node_modules/montage/examples/feed-reader/images/87-wine-glass.png differ diff --git a/node_modules/montage/examples/feed-reader/index.html b/node_modules/montage/examples/feed-reader/index.html new file mode 100644 index 00000000..3b5529b9 --- /dev/null +++ b/node_modules/montage/examples/feed-reader/index.html @@ -0,0 +1,81 @@ + + + + + + Montage Feed Reader + + + + + + + + + + +

+

+ +
+

+ +
+

This is the bootstrapper content which will now be shown for at least 1500ms.

+
+
+

This is the loader content which will now be shown for at least 2000ms.

+
+ + + + diff --git a/node_modules/montage/examples/feed-reader/main.reel/main.html b/node_modules/montage/examples/feed-reader/main.reel/main.html new file mode 100644 index 00000000..8ea9a79b --- /dev/null +++ b/node_modules/montage/examples/feed-reader/main.reel/main.html @@ -0,0 +1,184 @@ + + + + + Feed Reader Example + + + + + + + + + + +
+ + + +
+
+
+

Top Stories Around you

+
+ Feed URL: + +
+
+
+
+ +
+
+

Find your way

+
+ Location: + +
+
+
Map
+
+ +
+ +
+ + +
+ + + diff --git a/node_modules/montage/examples/feed-reader/main.reel/main.js b/node_modules/montage/examples/feed-reader/main.reel/main.js new file mode 100644 index 00000000..bea5f91a --- /dev/null +++ b/node_modules/montage/examples/feed-reader/main.reel/main.js @@ -0,0 +1,45 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; + +exports.Main = Montage.create(Component, { + + feedURL: { + value: 'http://rss.cnn.com/rss/cnn_mostpopular.rss', + distinct: true + }, + + feedReader: {value: null}, + + map: {value: null}, + + mapCenter: {value: null}, + + handleGoAction: { + value: function(event) { + event.preventDefault(); + this.feedReader.feedURL = this.feedURL; + + } + }, + + handleMapButtonAction: { + value: function(event) { + event.preventDefault(); + this.map.center = this.mapCenter; + } + }, + + draw: { + value: function() { + if(this.mapCenter != null) { + this.map.center = this.mapCenter; + } + } + } + +}); diff --git a/node_modules/montage/examples/feed-reader/map-example.reel/main.css b/node_modules/montage/examples/feed-reader/map-example.reel/main.css new file mode 100644 index 00000000..139597f9 --- /dev/null +++ b/node_modules/montage/examples/feed-reader/map-example.reel/main.css @@ -0,0 +1,2 @@ + + diff --git a/node_modules/montage/examples/feed-reader/map-example.reel/main.html b/node_modules/montage/examples/feed-reader/map-example.reel/main.html new file mode 100644 index 00000000..889ca8d6 --- /dev/null +++ b/node_modules/montage/examples/feed-reader/map-example.reel/main.html @@ -0,0 +1,58 @@ + + + + + + Main Component + + + + + + + + +
+

Main component of application

+
+
+
+ +
+ + + diff --git a/node_modules/montage/examples/feed-reader/map-example.reel/main.js b/node_modules/montage/examples/feed-reader/map-example.reel/main.js new file mode 100644 index 00000000..54b84425 --- /dev/null +++ b/node_modules/montage/examples/feed-reader/map-example.reel/main.js @@ -0,0 +1,24 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; + + +exports.Main = Montage.create(Component, { + + templateDidLoad: { + value: function() { + //console.log("main templateDidLoad") + } + }, + + prepareForDraw: { + value: function() { + //console.log("main prepareForDraw") + } + } + +}); diff --git a/node_modules/montage/examples/feed-reader/package.json b/node_modules/montage/examples/feed-reader/package.json new file mode 100644 index 00000000..cbb9365f --- /dev/null +++ b/node_modules/montage/examples/feed-reader/package.json @@ -0,0 +1,10 @@ +{ + "name": "loader", + "version": "0.0.0", + "mappings": { + "montage": "../.." + }, + "directories": { + "lib": "" + } +} -- cgit v1.2.3 From 3070d7b2a3b96609eace60825c721951c85405cc Mon Sep 17 00:00:00 2001 From: François Frisch Date: Sat, 17 Mar 2012 18:05:23 -0700 Subject: Adding the youtube player --- .../examples/youtube-channel-example/index.html | 44 +++++++++ .../examples/youtube-channel-example/package.json | 7 ++ .../examples/youtube-channel-example/style.css | 47 ++++++++++ .../youtube-channel-example.js | 8 ++ .../youtube-channel.reel/youtube-channel.html | 34 +++++++ .../youtube-channel.reel/youtube-channel.js | 101 +++++++++++++++++++++ 6 files changed, 241 insertions(+) create mode 100755 node_modules/montage/examples/youtube-channel-example/index.html create mode 100755 node_modules/montage/examples/youtube-channel-example/package.json create mode 100755 node_modules/montage/examples/youtube-channel-example/style.css create mode 100755 node_modules/montage/examples/youtube-channel-example/youtube-channel-example.js create mode 100644 node_modules/montage/examples/youtube-channel-example/youtube-channel.reel/youtube-channel.html create mode 100644 node_modules/montage/examples/youtube-channel-example/youtube-channel.reel/youtube-channel.js (limited to 'node_modules/montage/examples') diff --git a/node_modules/montage/examples/youtube-channel-example/index.html b/node_modules/montage/examples/youtube-channel-example/index.html new file mode 100755 index 00000000..71baba29 --- /dev/null +++ b/node_modules/montage/examples/youtube-channel-example/index.html @@ -0,0 +1,44 @@ + + + + + Youtube Channel + + + + + +
+
Youtube Channel
+ +
+
+ + diff --git a/node_modules/montage/examples/youtube-channel-example/package.json b/node_modules/montage/examples/youtube-channel-example/package.json new file mode 100755 index 00000000..ecfbdd8a --- /dev/null +++ b/node_modules/montage/examples/youtube-channel-example/package.json @@ -0,0 +1,7 @@ +{ + "name": "youtube-channel-example", + "version": "0.0.0", + "mappings": { + "montage": "../../" + } +} \ No newline at end of file diff --git a/node_modules/montage/examples/youtube-channel-example/style.css b/node_modules/montage/examples/youtube-channel-example/style.css new file mode 100755 index 00000000..c281cd65 --- /dev/null +++ b/node_modules/montage/examples/youtube-channel-example/style.css @@ -0,0 +1,47 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + + +/* Base ----------------------------- */ + +html { + background-color: hsl(0,0%,85%); + height: 100%; +} + +body { + margin: 0; + width: 100%; + height: 100%; + display: -webkit-box; + -webkit-box-align: center; + -webkit-box-pack: center; + + display: -moz-box; + -moz-box-align: center; + -moz-box-pack: center; +} + + +/* Converter ----------------------------- */ + +.youtube-channel-example { + padding: 10px; + text-shadow: #fff 0 1px 0; + border-radius: 8px; + background-color: hsl(0,0%,95%); + box-shadow: inset 0px 1px 2px 1px hsla(0,0%,100%,1), 0px 2px 5px hsla(0,0%,0%,.1); +} + +.youtube-channel-example #title { + margin: 0 0 5px 0; + text-align: center; + font: 24px/40px "Lucida Grande", "Trebuchet MS", Verdana, sans-serif; +} + +.youtube-channel-example-url { + width: 100%; +} diff --git a/node_modules/montage/examples/youtube-channel-example/youtube-channel-example.js b/node_modules/montage/examples/youtube-channel-example/youtube-channel-example.js new file mode 100755 index 00000000..4ca12757 --- /dev/null +++ b/node_modules/montage/examples/youtube-channel-example/youtube-channel-example.js @@ -0,0 +1,8 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +var Montage = require("montage").Montage; + +exports.YoutubeChannelExample = Montage.create(Converter, {}); diff --git a/node_modules/montage/examples/youtube-channel-example/youtube-channel.reel/youtube-channel.html b/node_modules/montage/examples/youtube-channel-example/youtube-channel.reel/youtube-channel.html new file mode 100644 index 00000000..8514f5ce --- /dev/null +++ b/node_modules/montage/examples/youtube-channel-example/youtube-channel.reel/youtube-channel.html @@ -0,0 +1,34 @@ + + + + + + + + +
+
+
+ + diff --git a/node_modules/montage/examples/youtube-channel-example/youtube-channel.reel/youtube-channel.js b/node_modules/montage/examples/youtube-channel-example/youtube-channel.reel/youtube-channel.js new file mode 100644 index 00000000..1f5aa2d1 --- /dev/null +++ b/node_modules/montage/examples/youtube-channel-example/youtube-channel.reel/youtube-channel.js @@ -0,0 +1,101 @@ +/* + This file contains proprietary software owned by Motorola Mobility, Inc.
+ No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+ (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ +/*global require,exports*/ +var Montage = require("montage").Montage, + Component = require("montage/ui/component").Component, + Uuid = require("montage/core/uuid").Uuid; + + +var YoutubeChannel = exports.YoutubeChannel = Montage.create(Component, { + + _userRe: { + enumerable: false, + value: /youtube.com\/(user\/)?([a-z0-9]+)/i + }, + + _channelUrl: { + enumerable: false, + value: null + }, + channelUrl: { + depends: ["channel"], + get: function() { + return this._channelUrl; + }, + set: function(value, fromChannel) { + if (this._channelUrl !== value) { + this._channelUrl = value; + + // prevent infinite loop + if (!fromChannel) { + var match = this._userRe.exec(value); + if (match && match[2]) { + Object.getPropertyDescriptor(this, "channel").set.call(this, match[2], true); + } + } + } + } + }, + + _channel: { + enumerable: false, + value: null + }, + channel: { + get: function() { + return this._channel; + }, + set: function(value, fromUrl) { + if (this._channel !== value) { + this._channel = value; + + // prevent infinite loop + if (!fromUrl) { + Object.getPropertyDescriptor(this, "channelUrl").set.call(this, "http://www.youtube.com/user/" + value, true); + } + + this._loadChannel(); + } + } + }, + + _loadChannel: { + enumerable: false, + value: function() { + var self = this; + + var callbackName = "scriptCallback" + Uuid.generate().replace(/-/g, "_"); + + window[callbackName] = function(data) { + self.handleData(data); + delete window[callbackName]; + }; + + // create url + var url = "http://gdata.youtube.com/feeds/api/users/" + this._channel + "/uploads?v=2&alt=json-in-script&callback=" + callbackName; + + var script = document.createElement("script"); + script.src = url; + this._element.appendChild(script); + } + }, + + handleData: { + value: function(data) { + var entries = data.feed.entry || []; + + var playlist = []; + + for (var i = 0, len = entries.length; i < len; i++) { + var id = entries[i]["media$group"]["yt$videoid"]["$t"]; + playlist.push(id); + } + + this.player.playlist = playlist; + } + } + +}); \ No newline at end of file -- cgit v1.2.3 From 09852e9b9b8e64f003bed5aa57630d8b42c8ac95 Mon Sep 17 00:00:00 2001 From: François Frisch Date: Sat, 17 Mar 2012 19:28:30 -0700 Subject: Integrating picasa carousel and youtube channel --- .../examples/youtube-channel-example/index.html | 2 +- .../youtube-channel.reel/youtube-channel.html | 34 ------- .../youtube-channel.reel/youtube-channel.js | 101 --------------------- 3 files changed, 1 insertion(+), 136 deletions(-) delete mode 100644 node_modules/montage/examples/youtube-channel-example/youtube-channel.reel/youtube-channel.html delete mode 100644 node_modules/montage/examples/youtube-channel-example/youtube-channel.reel/youtube-channel.js (limited to 'node_modules/montage/examples') diff --git a/node_modules/montage/examples/youtube-channel-example/index.html b/node_modules/montage/examples/youtube-channel-example/index.html index 71baba29..b313d5d8 100755 --- a/node_modules/montage/examples/youtube-channel-example/index.html +++ b/node_modules/montage/examples/youtube-channel-example/index.html @@ -12,7 +12,7 @@ - - -
-
-
- - diff --git a/node_modules/montage/examples/youtube-channel-example/youtube-channel.reel/youtube-channel.js b/node_modules/montage/examples/youtube-channel-example/youtube-channel.reel/youtube-channel.js deleted file mode 100644 index 1f5aa2d1..00000000 --- a/node_modules/montage/examples/youtube-channel-example/youtube-channel.reel/youtube-channel.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - This file contains proprietary software owned by Motorola Mobility, Inc.
- No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
- (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. -
*/ -/*global require,exports*/ -var Montage = require("montage").Montage, - Component = require("montage/ui/component").Component, - Uuid = require("montage/core/uuid").Uuid; - - -var YoutubeChannel = exports.YoutubeChannel = Montage.create(Component, { - - _userRe: { - enumerable: false, - value: /youtube.com\/(user\/)?([a-z0-9]+)/i - }, - - _channelUrl: { - enumerable: false, - value: null - }, - channelUrl: { - depends: ["channel"], - get: function() { - return this._channelUrl; - }, - set: function(value, fromChannel) { - if (this._channelUrl !== value) { - this._channelUrl = value; - - // prevent infinite loop - if (!fromChannel) { - var match = this._userRe.exec(value); - if (match && match[2]) { - Object.getPropertyDescriptor(this, "channel").set.call(this, match[2], true); - } - } - } - } - }, - - _channel: { - enumerable: false, - value: null - }, - channel: { - get: function() { - return this._channel; - }, - set: function(value, fromUrl) { - if (this._channel !== value) { - this._channel = value; - - // prevent infinite loop - if (!fromUrl) { - Object.getPropertyDescriptor(this, "channelUrl").set.call(this, "http://www.youtube.com/user/" + value, true); - } - - this._loadChannel(); - } - } - }, - - _loadChannel: { - enumerable: false, - value: function() { - var self = this; - - var callbackName = "scriptCallback" + Uuid.generate().replace(/-/g, "_"); - - window[callbackName] = function(data) { - self.handleData(data); - delete window[callbackName]; - }; - - // create url - var url = "http://gdata.youtube.com/feeds/api/users/" + this._channel + "/uploads?v=2&alt=json-in-script&callback=" + callbackName; - - var script = document.createElement("script"); - script.src = url; - this._element.appendChild(script); - } - }, - - handleData: { - value: function(data) { - var entries = data.feed.entry || []; - - var playlist = []; - - for (var i = 0, len = entries.length; i < len; i++) { - var id = entries[i]["media$group"]["yt$videoid"]["$t"]; - playlist.push(id); - } - - this.player.playlist = playlist; - } - } - -}); \ No newline at end of file -- cgit v1.2.3