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
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
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 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
//Responsible for showing options when interacting with a song list or play list | |
define(function(){ | |
'use strict'; | |
var selector = $('#ContextMenu'); | |
//Hide the context menu whenever any click occurs not just when selecting an item. | |
$(document).click(function(){ | |
selector.offset({top:0, left:0}).hide(); | |
}); |
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
//Responsible for showing options when interacting with a song list or play list | |
define(function(){ | |
'use strict'; | |
var selector = $('#ContextMenu'); | |
//Hide the context menu whenever any click occurs not just when selecting an item. | |
$(document).click(function(){ | |
selector.offset({top:0, left:0}).hide(); | |
}); |
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
function OrdersEditDisplay() { | |
$('#OrdersEditTabs').tabs(); | |
var onDisplayLoadSuccess = function () { | |
$.each(arguments, function() { | |
$($(this).selector).off('click').on('click', 'fieldset legend', function () { | |
var fieldset = $(this).parent(); | |
var isWrappedInDiv = $(fieldset.children()[0]).is('div'); | |
if (isWrappedInDiv) { |
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
for (var i = 0; i < songs.length; i++){ | |
//Wrap in a closure to preserve song index for each iteration. | |
//If you don't do this the contextmenu method will always have the last song. | |
(function(i){ | |
var listItem = $('<li/>').appendTo(songList); | |
var song = songs[i]; | |
var link = $('<a/>', { |