This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var closestvideo = { | |
video: null, | |
difference: Number.MAX_VALUE | |
}; | |
var videos = json.feed.entry; | |
$.each(videos, function () { | |
var duration = this.media$group.yt$duration.seconds; | |
console.log("song duration:", song.duration); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Cross-Origin Resource Sharing unavailable from file:// | |
if(window.location.protocol !== 'file:'){ | |
if(window.location.protocol === 'chrome-extension:') { | |
$.ajax({ | |
url: 'http://www.geoplugin.net/json.gp', | |
success: function(result) { | |
var geoplugin = JSON.parse(result.replace(/^[^\{]+/, '').replace(/\);?$/, '')); | |
countryCode = geoplugin.geoplugin_countryCode; | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM THIS: | |
//Provides an interface to the YouTube iFrame. | |
//Starts up Player object after receiving a ready response from the YouTube API. | |
var onReady_funcs = [], api_isReady = false; | |
define(['onYouTubePlayerAPIReady'],function(){ | |
'use strict'; | |
//This code will trigger onYouTubePlayerAPIReady | |
$(window).load(function(){ | |
//Load YouTube Frame API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var constructor = _.once(function(){ | |
return { | |
//Setup a played recently array! | |
previousSongs: [], | |
nowPlaying: null, | |
comingUp: [], | |
//Is being used when comingUp is empty | |
endQueue: [] | |
}; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// open/close | |
open_node : function (obj, callback, skip_animation) { | |
console.log("Obj:", obj); | |
obj = this._get_node(obj); | |
console.log("calling open node", obj); | |
if(!obj.length) { return false; } | |
if(!obj.hasClass("jstree-closed")) { if(callback) { callback.call(); } return false; } | |
var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation, | |
t = this; | |
if(!this._is_loaded(obj)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// open/close | |
open_node : function (obj, callback, skip_animation) { | |
console.log("Obj:", obj); | |
obj = this._get_node(obj); | |
console.log("calling open node", obj); | |
if(!obj.length) { return false; } | |
if(!obj.hasClass("jstree-closed")) { if(callback) { callback.call(); } return false; } | |
var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation, | |
t = this; | |
if(!this._is_loaded(obj)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Takes a song's UID and returns the index of that song in the playlist if found. | |
var getSongIndexById = function(songs, id) { | |
var songIndex = -1; | |
for (var i = 0; i < songs.length; i++) { | |
if (songs[i] && songs[i].id === id) { | |
songIndex = i; | |
break; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Takes a song's UID and returns the index of that song in the playlist if found. | |
var getSongIndexById = function(songs, id) { | |
var songIndex = -1; | |
for (var i = 0; i < songs.length; i++) { | |
if (songs[i] && songs[i].id === id) { | |
songIndex = i; | |
break; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create a storage location for the tree view dialog. | |
var treeViewDialog = $('<div />', { | |
id: 'TreeViewDialog' | |
}).appendTo(workflowDialog); | |
//Create a storage location for the lookup tree which is about to be created inside of our dialog. | |
var dialogContent = $('<div />', { | |
id: 'TreeViewDialogContent' | |
}); | |
dialogContent.appendTo(treeViewDialog); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
item.destroy({ | |
data: $.param({ | |
playlistId: playlistId, | |
userId: loginManager.get('user').get('id') | |
}), | |
processData: true, | |
success: callback, | |
error: function (error) { | |
console.error(error); | |
} |