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/youtube-channel-example') 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