From: yomguy Date: Tue, 13 Mar 2012 10:46:21 +0000 (+0100) Subject: cleanup X-Git-Tag: 1.4.3~11 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=2329add6be52040cac6ce6409e9ac97585e29b26;p=telemeta.git cleanup --- diff --git a/telemeta/htdocs/js/playlist.js b/telemeta/htdocs/js/playlist.js index 81f214e1..b07bdcbe 100644 --- a/telemeta/htdocs/js/playlist.js +++ b/telemeta/htdocs/js/playlist.js @@ -92,10 +92,11 @@ var playlistUtils = { var d = new Date(); return new String(d.getTime() + '' + Math.floor(Math.random() * 1000000)).substr(0, 18); }, + add : function(dictionary){ if(dictionary.public_id===undefined){ - dictionary.public_id = this.uniqid(); //defined in application.js + dictionary.public_id = this.uniqid(); } if(dictionary.user===undefined){ dictionary.user = CURRENT_USER_NAME; @@ -105,7 +106,7 @@ var playlistUtils = { window.location.reload(); }); }, - + remove: function(id){ json([id],'telemeta.del_playlist',function(){ window.location.reload(); @@ -130,7 +131,7 @@ var playlistUtils = { var d = gettrans('description'); var dd = {}; var playlist = this; - + var playlists = this.playlists; for (var i=0; i< playlists.length; i++){ if (playlists[i].id == id){ @@ -138,7 +139,7 @@ var playlistUtils = { dd[d] = playlists[i].description; } } - + new PopupDiv({ 'content':dd, invoker:anchorElement, @@ -156,7 +157,7 @@ var playlistUtils = { } }).show(); }, - + /*shows the popup for adding a resource to a playlist*/ showAddResourceToPlaylist: function(anchorElement, resourceType, objectId, optionalOkMessage){ var ar = []; @@ -165,11 +166,11 @@ var playlistUtils = { ar.push(playlists[i].name); } var pl = this; - + if(!ar.length){ pl.showAdd(anchorElement); } - + //var addFcn = this.addResourceToPlaylist; new PopupDiv({ invoker:anchorElement, @@ -177,7 +178,7 @@ var playlistUtils = { onOk:function(data){ var val = data.selIndex; var callbackok = undefined; - + if(optionalOkMessage){ callbackok = function(){ var p =new PopupDiv({