CC-3174 : showbuilder

can add items to a playlist with the refactoring.
This commit is contained in:
Naomi Aro 2012-02-04 00:12:06 +01:00
parent 1deebedf11
commit 19f069b602
6 changed files with 286 additions and 197 deletions

View File

@ -231,13 +231,13 @@ class LibraryController extends Zend_Controller_Action
$id = $this->_getParam('id'); $id = $this->_getParam('id');
$type = $this->_getParam('type'); $type = $this->_getParam('type');
if($type == "audioclip") { if ($type == "audioclip") {
$file = Application_Model_StoredFile::Recall($id); $file = Application_Model_StoredFile::Recall($id);
$this->view->type = $type; $this->view->type = $type;
$this->view->md = $file->getMetadata(); $this->view->md = $file->getMetadata();
} }
else if($type == "playlist") { else if ($type == "playlist") {
$file = Application_Model_Playlist::Recall($id); $file = new Application_Model_Playlist($id);
$this->view->type = $type; $this->view->type = $type;
$this->view->md = $file->getAllPLMetaData(); $this->view->md = $file->getAllPLMetaData();
$this->view->contents = $file->getContents(); $this->view->contents = $file->getContents();

View File

@ -8,7 +8,6 @@ class PlaylistController extends Zend_Controller_Action
{ {
$ajaxContext = $this->_helper->getHelper('AjaxContext'); $ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('add-items', 'json') $ajaxContext->addActionContext('add-items', 'json')
->addActionContext('add-item', 'json')
->addActionContext('move-item', 'json') ->addActionContext('move-item', 'json')
->addActionContext('delete-item', 'json') ->addActionContext('delete-item', 'json')
->addActionContext('set-fade', 'json') ->addActionContext('set-fade', 'json')
@ -26,31 +25,17 @@ class PlaylistController extends Zend_Controller_Action
private function getPlaylist() private function getPlaylist()
{ {
$pl_sess = $this->pl_sess; $pl = null;
if(isset($pl_sess->id)) { if (isset($this->pl_sess->id)) {
$pl = new Application_Model_Playlist($this->pl_sess->id);
$pl = Application_Model_Playlist::Recall($pl_sess->id);
if($pl === FALSE) {
unset($pl_sess->id);
return false;
}
return $pl;
}else{
return false;
} }
return $pl;
} }
private function changePlaylist($pl_id) private function changePlaylist($pl_id)
{ {
$pl_sess = $this->pl_sess; $this->pl_sess->id = intval($pl_id);
$pl = Application_Model_Playlist::Recall($pl_id);
if($pl === FALSE) {
return FALSE;
}
$pl_sess->id = $pl_id;
} }
private function createUpdateResponse($pl) private function createUpdateResponse($pl)
@ -68,7 +53,7 @@ class PlaylistController extends Zend_Controller_Action
{ {
if (isset($pl)) { if (isset($pl)) {
$this->view->pl = $pl; $this->view->pl = $pl;
$this->view->pl_id = $pl->getId(); $this->view->id = $pl->getId();
$this->view->html = $this->view->render('playlist/index.phtml'); $this->view->html = $this->view->render('playlist/index.phtml');
unset($this->view->pl); unset($this->view->pl);
} }
@ -86,10 +71,21 @@ class PlaylistController extends Zend_Controller_Action
$this->view->headLink()->appendStylesheet($baseUrl.'/css/playlist_builder.css'); $this->view->headLink()->appendStylesheet($baseUrl.'/css/playlist_builder.css');
$this->_helper->viewRenderer->setResponseSegment('spl'); $this->_helper->viewRenderer->setResponseSegment('spl');
$pl = $this->getPlaylist();
if($pl !== false){ try {
$this->view->pl = $pl; $pl = $this->getPlaylist();
}
if (isset($pl)) {
$this->view->pl = $pl;
}
}
catch (PlaylistNotFoundException $e) {
Logging::log("Playlist not found");
$this->changePlaylist(null);
}
catch (Exception $e) {
Logging::log("{$e->getMessage()}");
}
} }
public function newAction() public function newAction()
@ -98,11 +94,10 @@ class PlaylistController extends Zend_Controller_Action
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$pl = new Application_Model_Playlist(); $pl = new Application_Model_Playlist();
$pl->create("Untitled Playlist"); $pl->setName("Untitled Playlist");
$pl->setPLMetaData('dc:creator', $userInfo->login); $pl->setPLMetaData('dc:creator', $userInfo->login);
$this->changePlaylist($pl->getId()); $this->changePlaylist($pl->getId());
$this->createFullResponse($pl); $this->createFullResponse($pl);
} }
@ -110,134 +105,128 @@ class PlaylistController extends Zend_Controller_Action
{ {
$pl_id = $this->_getParam('id', null); $pl_id = $this->_getParam('id', null);
if(!is_null($pl_id)) { if (!is_null($pl_id)) {
$this->changePlaylist($pl_id); $this->changePlaylist($pl_id);
} }
$pl = $this->getPlaylist(); try {
if($pl === false){ $pl = $this->getPlaylist();
$this->view->playlist_error = true; }
return false; catch (PlaylistNotFoundException $e) {
} Logging::log("Playlist {$pl_id} not found");
$this->changePlaylist(null);
}
catch (Exception $e) {
Logging::log("{$e->getFile()}");
Logging::log("{$e->getLine()}");
Logging::log("{$e->getMessage()}");
$this->changePlaylist(null);
}
$this->createFullResponse($pl); $this->createFullResponse($pl);
} }
public function addItemAction() public function deleteAction()
{ {
$id = $this->_getParam('id'); $ids = $this->_getParam('ids');
$pos = $this->_getParam('pos', null); $ids = (!is_array($ids)) ? array($ids) : $ids;
$pl = null;
if (!is_null($id)) { try {
$pl = $this->getPlaylist(); Logging::log("Currently active playlist {$this->pl_sess->id}");
if($pl === false){ if (in_array($this->pl_sess->id, $ids)) {
$this->view->playlist_error = true; Logging::log("Deleting currently active playlist");
return false; $this->changePlaylist(null);
}
else {
$pl = $this->getPlaylist();
Logging::log("Not deleting currently active playlist");
} }
$res = $pl->addAudioClip($id, $pos);
if (PEAR::isError($res)) { Application_Model_Playlist::DeletePlaylists($ids);
$this->view->message = $res->getMessage(); }
} catch(PlaylistNotFoundException $e) {
Logging::log("Playlist not found");
$this->createUpdateResponse($pl); $this->changePlaylist(null);
return; $pl = null;
} }
$this->view->message = "a file is not chosen"; catch(Exception $e) {
} Logging::log("{$e->getFile()}");
Logging::log("{$e->getLine()}");
public function moveItemAction() Logging::log("{$e->getMessage()}");
{
$oldPos = $this->_getParam('oldPos');
$newPos = $this->_getParam('newPos');
$pl = $this->getPlaylist();
if($pl === false){
$this->view->playlist_error = true;
return false;
} }
$pl->moveAudioClip($oldPos, $newPos); $this->createFullResponse($pl);
$this->createUpdateResponse($pl);
}
public function deleteItemAction()
{
$positions = $this->_getParam('pos', array());
if (!is_array($positions))
$positions = array($positions);
//so the automatic updating of playlist positioning doesn't affect removal.
sort($positions);
$positions = array_reverse($positions);
$pl = $this->getPlaylist();
if($pl === false){
$this->view->playlist_error = true;
return false;
}
foreach ($positions as $pos) {
$pl->delAudioClip($pos);
}
$this->createUpdateResponse($pl);
} }
public function addItemsAction() public function addItemsAction()
{ {
$ids = $this->_getParam('ids'); $ids = $this->_getParam('ids');
$pos = $this->_getParam('pos', null); $ids = (!is_array($ids)) ? array($ids) : $ids;
$afterItem = $this->_getParam('afterItem', null);
if (!is_null($ids)) {
try {
$pl = $this->getPlaylist(); $pl = $this->getPlaylist();
if ($pl === false) { $pl->addAudioClips($ids, $afterItem);
$this->view->playlist_error = true;
return false;
}
foreach ($ids as $key => $value) {
$res = $pl->addAudioClip($value);
if (PEAR::isError($res)) {
$this->view->message = $res->getMessage();
break;
}
}
$this->createUpdateResponse($pl);
return;
} }
$this->view->message = "a file is not chosen"; catch (PlaylistNotFoundException $e) {
Logging::log("Playlist {$pl_id} not found");
$this->changePlaylist(null);
}
catch (Exception $e) {
Logging::log("{$e->getFile()}");
Logging::log("{$e->getLine()}");
Logging::log("{$e->getMessage()}");
}
$this->createUpdateResponse($pl);
} }
public function deleteAction() public function moveItemAction()
{ {
$ids = $this->_getParam('ids', array()); $ids = $this->_getParam('ids');
$active = $this->_getParam('active', false); $ids = (!is_array($ids)) ? array($ids) : $ids;
$afterItem = $this->_getParam('afterItem', null);
if ($active === true) { try {
$ids = array_merge($ids, array($pl_sess->id)); $pl = $this->getPlaylist();
$pl->moveAudioClips($ids, $afterItem);
}
catch (PlaylistNotFoundException $e) {
Logging::log("Playlist {$pl_id} not found");
$this->changePlaylist(null);
}
catch (Exception $e) {
Logging::log("{$e->getFile()}");
Logging::log("{$e->getLine()}");
Logging::log("{$e->getMessage()}");
} }
foreach ($ids as $key => $id) { $this->createUpdateResponse($pl);
$pl = Application_Model_Playlist::Recall($id); }
if ($pl !== FALSE) { public function deleteItemsAction()
Application_Model_Playlist::Delete($id); {
$pl_sess = $this->pl_sess; $ids = $this->_getParam('ids');
if($pl_sess->id === $id){ $ids = (!is_array($ids)) ? array($ids) : $ids;
unset($pl_sess->id);
} try {
} else { $pl = $this->getPlaylist();
$this->view->playlist_error = true; $pl->delAudioClips($ids);
return false; }
} catch (PlaylistNotFoundException $e) {
Logging::log("Playlist {$pl_id} not found");
$this->changePlaylist(null);
}
catch (Exception $e) {
Logging::log("{$e->getFile()}");
Logging::log("{$e->getLine()}");
Logging::log("{$e->getMessage()}");
} }
$this->createFullResponse(null); $this->createUpdateResponse($pl);
} }
public function setCueAction() public function setCueAction()

View File

@ -55,20 +55,25 @@ class Application_Model_Playlist {
if (isset($id)) { if (isset($id)) {
$this->pl = CcPlaylistQuery::create()->findPK($id); $this->pl = CcPlaylistQuery::create()->findPK($id);
if (is_null($this->_pl)){ if (is_null($this->pl)){
throw new Exception(); throw new PlaylistNotFoundException();
} }
} }
else { else {
$this->pl = new CcPlaylist(); $this->pl = new CcPlaylist();
$this->pl->setDbState('ready');
$this->pl->setDbUtime(new DateTime("now"), new DateTimeZone("UTC")); $this->pl->setDbUtime(new DateTime("now"), new DateTimeZone("UTC"));
$this->pl->save();
} }
$this->plItem["fadein"] = Application_Model_Preference::GetDefaultFade(); $defaultFade = Application_Model_Preference::GetDefaultFade();
$this->plItem["fadeout"] = Application_Model_Preference::GetDefaultFade(); if ($defaultFade !== "") {
$this->plItem["fadein"] = $defaultFade;
$this->plItem["fadeout"] = $defaultFade;
}
$this->id = $this->pl->getDbId();
$this->con = isset($con) ? $con : Propel::getConnection(CcPlaylistPeer::DATABASE_NAME); $this->con = isset($con) ? $con : Propel::getConnection(CcPlaylistPeer::DATABASE_NAME);
$this->id = $this->pl->getDbId();
} }
/** /**
@ -124,6 +129,9 @@ class Application_Model_Playlist {
* @return array * @return array
*/ */
public function getContents() { public function getContents() {
Logging::log("Getting contents for playlist {$this->id}");
$files = array(); $files = array();
$rows = CcPlaylistcontentsQuery::create() $rows = CcPlaylistcontentsQuery::create()
->joinWith('CcFiles') ->joinWith('CcFiles')
@ -181,12 +189,13 @@ class Application_Model_Playlist {
*/ */
private function buildEntry($p_item, $pos) private function buildEntry($p_item, $pos)
{ {
$file = CcFilesQuery::create()->findPK($p_item["id"], $this->con); $file = CcFilesQuery::create()->findPK($p_item, $this->con);
$entry = $this->plItem; $entry = $this->plItem;
$entry["id"] = $file->getDbId(); $entry["id"] = $file->getDbId();
$entry["pos"] = $pos; $entry["pos"] = $pos;
$entry["cliplength"] = $file->getDbLength(); $entry["cliplength"] = $file->getDbLength();
$entry["cueout"] = $file->getDbLength();
return $entry; return $entry;
} }
@ -204,35 +213,44 @@ class Application_Model_Playlist {
try { try {
if (isset($p_afterItem)) { if (is_numeric($p_afterItem)) {
Logging::log("Finding playlist content item {$p_afterItem}");
$afterItem = CcPlaylistcontentsQuery::create()->findPK($p_afterItem); $afterItem = CcPlaylistcontentsQuery::create()->findPK($p_afterItem);
$pos = $afterItem->getDbPosition() + 1;
$contentsToUpdate = CcPlaylistcontentsQuery::create() $contentsToUpdate = CcPlaylistcontentsQuery::create()
->filterByDbPlaylistId($this->id) ->filterByDbPlaylistId($this->id)
->filterByDbPosition($pos-1, Criteria::GREATER_THAN)
->orderByDbPosition() ->orderByDbPosition()
->find($this->con); ->find($this->con);
$pos = $afterItem->getDbPosition() + 1; Logging::log("Adding to playlist");
Logging::log("at position {$pos}");
} }
else { else {
$pos = $this->getSize(); $pos = $this->getSize();
Logging::log("Adding to end of playlist");
Logging::log("at position {$pos}");
} }
foreach($p_items as $ac) { foreach($p_items as $ac) {
Logging::log("Adding audio file {$ac}");
$res = $this->insertPlaylistElement($this->buildEntry($ac), $pos); $res = $this->insertPlaylistElement($this->buildEntry($ac, $pos));
$pos = $pos + 1; $pos = $pos + 1;
} }
//reset the positions of the remaining items. //reset the positions of the remaining items.
for ($i = 0; $i < count($contentsToUpdate); $i++) { for ($i = 0; $i < count($contentsToUpdate); $i++) {
$contents[$i]->setDbPosition($pos); $contentsToUpdate[$i]->setDbPosition($pos);
$contents[$i]->save($this->con); $contentsToUpdate[$i]->save($this->con);
$pos = $pos + 1; $pos = $pos + 1;
} }
$pl->setDbMtime(new DateTime("now"), new DateTimeZone("UTC")); $this->pl->setDbMtime(new DateTime("now"), new DateTimeZone("UTC"));
$pl->save($this->con); $this->pl->save($this->con);
$this->con->commit(); $this->con->commit();
} }
@ -245,12 +263,12 @@ class Application_Model_Playlist {
/** /**
* Move audioClip to the new position in the playlist * Move audioClip to the new position in the playlist
* *
* @param array $selectedItems * @param array $p_items
* array of unique ids of the selected items * array of unique ids of the selected items
* @param int $afterItem * @param int $p_afterItem
* unique id of the item to move the clip after * unique id of the item to move the clip after
*/ */
public function moveAudioClip($selectedItems, $afterItem) public function moveAudioClips($p_items, $p_afterItem=NULL)
{ {
$this->con->beginTransaction(); $this->con->beginTransaction();
@ -533,7 +551,6 @@ class Application_Model_Playlist {
public function getAllPLMetaData() public function getAllPLMetaData()
{ {
$categories = $this->categories; $categories = $this->categories;
$row = CcPlaylistQuery::create()->findPK($this->id);
$md = array(); $md = array();
foreach($categories as $key => $val) { foreach($categories as $key => $val) {
@ -543,7 +560,7 @@ class Application_Model_Playlist {
} }
$method = 'get' . $val; $method = 'get' . $val;
$md[$key] = $row->$method(); $md[$key] = $this->pl->$method();
} }
return $md; return $md;
@ -557,21 +574,17 @@ class Application_Model_Playlist {
return $this->getLength(); return $this->getLength();
} }
$row = CcPlaylistQuery::create()->findPK($this->id);
$method = 'get' . $cat; $method = 'get' . $cat;
return $row->$method(); return $this->pl->$method();
} }
public function setPLMetaData($category, $value) public function setPLMetaData($category, $value)
{ {
$cat = $this->categories[$category]; $cat = $this->categories[$category];
$row = CcPlaylistQuery::create()->findPK($this->id);
$method = 'set' . $cat; $method = 'set' . $cat;
$row->$method($value); $this->pl->$method($value);
$row->save(); $this->pl->save($this->con);
return TRUE;
} }
@ -639,4 +652,16 @@ class Application_Model_Playlist {
CcPlaylistcontentsQuery::create()->filterByDbFileId($p_fileId)->delete(); CcPlaylistcontentsQuery::create()->filterByDbFileId($p_fileId)->delete();
} }
/**
* Delete playlists that match the ids..
* @param array $p_ids
*/
public static function DeletePlaylists($p_ids)
{
CcPlaylistQuery::create()->findPKs($p_ids)->delete();
}
} // class Playlist } // class Playlist
class PlaylistNotFoundException extends Exception {}
class OutDatedException extends Exception {}

View File

@ -4,7 +4,7 @@ if (count($items)) : ?>
<?php $i = 0; ?> <?php $i = 0; ?>
<?php foreach($items as $item) : ?> <?php foreach($items as $item) : ?>
<li class="ui-state-default" id="spl_<?php echo $i ?>" unqid="<?php echo $item["CcFiles"]["gunid"]."_".$i; ?>"> <li class="ui-state-default" id="spl_<?php echo $item["id"] ?>" unqid="<?php echo $item["CcFiles"]["gunid"]."_".$i; ?>">
<div class="list-item-container"> <div class="list-item-container">
<a href="javascript:void(0);" class="big_play" <a href="javascript:void(0);" class="big_play"
onclick="audioPreview('<?php echo $item["CcFiles"]["gunid"].".".pathinfo($item["CcFiles"]["filepath"], PATHINFO_EXTENSION);?>', onclick="audioPreview('<?php echo $item["CcFiles"]["gunid"].".".pathinfo($item["CcFiles"]["filepath"], PATHINFO_EXTENSION);?>',

View File

@ -1,6 +1,7 @@
function fnLibraryTableRowCallback( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { function fnLibraryTableRowCallback( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
$(nRow).attr("id", aData["tr_id"]); $(nRow).attr("id", aData["tr_id"]);
$(nRow).data("aData", aData);
$(nRow).find('td') $(nRow).find('td')
.jjmenu("rightClick", .jjmenu("rightClick",
@ -12,8 +13,19 @@ function fnLibraryTableRowCallback( nRow, aData, iDisplayIndex, iDisplayIndexFul
function fnLibraryTableDrawCallback() { function fnLibraryTableDrawCallback() {
$('#library_display tr[id ^= "au"]').draggable({ $('#library_display tr[id ^= "au"]').draggable({
helper: 'clone', //helper: 'clone',
cursor: 'pointer' helper: function(ev, el) {
var data, li;
data = $(ev.currentTarget).data("aData");
li = $("<li></li>");
li.append(data.track_title);
return li;
},
cursor: 'pointer',
connectToSortable: '#spl_sortable'
}); });
} }

View File

@ -219,14 +219,6 @@ function redrawDataTablePage() {
} }
function setSPLContent(json) { function setSPLContent(json) {
if(json.playlist_error == true){
alertPlaylistErrorAndReload();
}
if(json.message) {
alert(json.message);
return;
}
$('#spl_name > a') $('#spl_name > a')
.empty() .empty()
@ -243,8 +235,6 @@ function setSPLContent(json) {
//redraw the library list //redraw the library list
redrawDataTablePage(); redrawDataTablePage();
return false;
} }
function addSPLItem(event, ui){ function addSPLItem(event, ui){
@ -301,12 +291,11 @@ function moveSPLItem(event, ui) {
} }
function noOpenPL(json) { function noOpenPL(json) {
if(json.playlist_error == true){
alertPlaylistErrorAndReload();
}
$("#side_playlist") $("#side_playlist")
.empty() .empty()
.append(json.html); .append(json.html)
.data("id", null);
$("#spl_new") $("#spl_new")
.button() .button()
@ -317,9 +306,9 @@ function newSPL() {
var url; var url;
stopAudioPreview(); stopAudioPreview();
url = '/Playlist/new/format/json'; url = '/Playlist/new';
$.post(url, function(json){ $.post(url, {format: "json"}, function(json){
openDiffSPL(json); openDiffSPL(json);
//redraw the library list //redraw the library list
@ -328,16 +317,16 @@ function newSPL() {
} }
function deleteSPL() { function deleteSPL() {
var url; var url, id;
stopAudioPreview(); stopAudioPreview();
id = $("#side_playlist").data("id");
url = '/Playlist/delete'; url = '/Playlist/delete';
$.post(url, {"format": "json", "active": true}, function(json){ $.post(url, {format: "json", ids: id}, function(json){
if(json.playlist_error == true){
alertPlaylistErrorAndReload();
}
noOpenPL(json); noOpenPL(json);
//redraw the library list //redraw the library list
redrawDataTablePage(); redrawDataTablePage();
@ -346,15 +335,11 @@ function deleteSPL() {
function openDiffSPL(json) { function openDiffSPL(json) {
if(json.playlist_error == true){
alertPlaylistErrorAndReload();
}
$("#side_playlist") $("#side_playlist")
.empty() .empty()
.append(json.html) .append(json.html)
.data("id", json.pl_id); .data("id", json.id);
currentlyOpenedSplId = json.pl_id;
setUpSPL(); setUpSPL();
} }
@ -386,12 +371,102 @@ function editName() {
} }
function setUpSPL() { function setUpSPL() {
var sortableConf = (function(){
var origRow,
iItem,
iAfter,
setSPLContent,
fnAdd,
fnMove,
fnReceive,
fnUpdate;
function redrawDataTablePage() {
var dt;
dt = $("#library_display").dataTable();
dt.fnStandingRedraw();
}
setSPLContent = function(json) {
$("#spl_sortable").sortable({ $('#spl_name > a')
handle: 'div.list-item-container' .empty()
}); .append(json.name);
$("#spl_sortable" ).bind( "sortstop", moveSPLItem); $('#spl_length')
.empty()
.append(json.length);
$('#fieldset-metadate_change textarea')
.empty()
.val(json.description);
$('#spl_sortable')
.empty()
.append(json.html);
//redraw the library list
redrawDataTablePage();
}
fnAdd = function() {
$.post("/playlist/add-items",
{format: "json", "ids": iItem, "afterItem": iAfter},
function(json){
setSPLContent(json);
});
};
fnMove = function() {
$.post("/showbuilder/schedule-move",
{"format": "json", "selectedItem": aSelect, "afterItem": aAfter},
function(json){
oTable.fnDraw();
});
};
fnReceive = function(event, ui) {
origRow = ui.item;
};
fnUpdate = function(event, ui) {
var prev;
prev = ui.item.prev();
if (prev.hasClass("spl_empty") || prev.length === 0) {
iAfter = null;
}
else {
iAfter = prev.attr("id").split("_").pop();
}
//item was dragged in from library datatable
if (origRow !== undefined) {
iItem = origRow.data("aData").id;
origRow = undefined;
fnAdd();
}
//item was reordered.
else {
oItemData = ui.item.data("aData");
fnMove();
}
};
return {
items: 'li',
placeholder: "placeholder lib-placeholder ui-state-highlight",
forcePlaceholderSize: true,
handle: 'div.list-item-container',
receive: fnReceive,
update: fnUpdate
};
}());
$("#spl_sortable").sortable(sortableConf);
$("#spl_remove_selected").click(deleteSPLItem); $("#spl_remove_selected").click(deleteSPLItem);
$("#spl_new") $("#spl_new")
.button() .button()
.click(newSPL); .click(newSPL);
@ -536,10 +611,6 @@ function setUpSPL() {
$("#spl_delete") $("#spl_delete")
.button() .button()
.click(deleteSPL); .click(deleteSPL);
$("#spl_sortable").droppable();
$("#spl_sortable" ).bind( "drop", addSPLItem);
} }
//sets events dynamically for playlist entries (each row in the playlist) //sets events dynamically for playlist entries (each row in the playlist)
@ -579,15 +650,7 @@ function setFadeEvents(el) {
"keydown": submitOnEnter}); "keydown": submitOnEnter});
} }
// Alert the error and reload the page
// this function is used to resolve concurrency issue
function alertPlaylistErrorAndReload(){
alert("The playlist doesn't exist anymore!");
window.location.reload();
}
$(document).ready(function() { $(document).ready(function() {
var currentlyOpenedSplId;
var playlist = $("#side_playlist"); var playlist = $("#side_playlist");
setUpSPL(playlist); setUpSPL(playlist);