var albumstolistento = function() {
var atl = null;
var maxwidth = 640;
var holder;
var spinner;
function getListenLater() {
metaHandlers.genericAction('getlistenlater', gotListenLater, notGotListenLater);
}
function notGotListenLater() {
debug.error("LISTENLATER","Failed to get list");
}
function gotListenLater(data) {
spinner.remove();
if (data.length == 0) {
holder.append('
', {id: 'albumstolistento', class: 'holdingcell masonified2 helpfulholder noselection'}).appendTo('#atlfoldup');
}
return {
open: function() {
if (atl == null) {
debug.log("LISTENLATER","Opening....");
atl = browser.registerExtraPlugin("atl", language.gettext("label_albumstolistento"), albumstolistento, 'https://fatg3erman.github.io/RompR/Albums-To-Listen-To');
spinner = $('
').appendTo('#atlfoldup');
spinner.append('');
makeHolder();
getListenLater();
atl.slideToggle('fast');
browser.goToPlugin("atl");
browser.rePoint();
} else {
browser.goToPlugin('atl');
}
},
close: function() {
holder.remove();
atl = null;
},
handleClick: function(element, event) {
if (element.hasClass('clickspotifywidget')) {
holder.spotifyAlbumThing('handleClick', element);
}
},
update: function() {
holder.remove();
makeHolder();
getListenLater();
},
removeId: function(id) {
metaHandlers.genericAction([{action: 'removelistenlater', index: id}], function() {
debug.log("LISTENLATER", "Listen Later ID",id,"removed");
}, function() {
debug.error("LISTENLATER", "Failed To Remove ID",id);
});
}
}
}();
pluginManager.setAction(language.gettext("label_albumstolistento"), albumstolistento.open);
albumstolistento.open();