CC-1708 added x instead of input to remove items. Merging side playlist and playlist into one.
This commit is contained in:
parent
da85a5ad26
commit
01df8d8d6b
15 changed files with 78 additions and 230 deletions
|
@ -76,10 +76,6 @@
|
|||
<controllerFile controllerName="SidePlaylist">
|
||||
<actionMethod actionName="index"/>
|
||||
</controllerFile>
|
||||
<controllerFile controllerName="Sideplaylist">
|
||||
<actionMethod actionName="index"/>
|
||||
<actionMethod actionName="addItem"/>
|
||||
</controllerFile>
|
||||
</controllersDirectory>
|
||||
<formsDirectory>
|
||||
<formFile formName="Login"/>
|
||||
|
@ -220,15 +216,6 @@
|
|||
<viewControllerScriptsDirectory forControllerName="User">
|
||||
<viewScriptFile forActionName="addUser"/>
|
||||
</viewControllerScriptsDirectory>
|
||||
<viewControllerScriptsDirectory forControllerName="SidePlaylist">
|
||||
<viewScriptFile forActionName="index"/>
|
||||
</viewControllerScriptsDirectory>
|
||||
<viewControllerScriptsDirectory forControllerName="Sideplaylist">
|
||||
<viewScriptFile forActionName="index"/>
|
||||
</viewControllerScriptsDirectory>
|
||||
<viewControllerScriptsDirectory forControllerName="Sideplaylist">
|
||||
<viewScriptFile forActionName="addItem"/>
|
||||
</viewControllerScriptsDirectory>
|
||||
<viewControllerScriptsDirectory forControllerName="Playlist">
|
||||
<viewScriptFile forActionName="close"/>
|
||||
</viewControllerScriptsDirectory>
|
||||
|
@ -292,8 +279,6 @@
|
|||
<testApplicationControllerFile filesystemName="ScheduleControllerTest.php"/>
|
||||
<testApplicationControllerFile filesystemName="ApiControllerTest.php"/>
|
||||
<testApplicationControllerFile filesystemName="UserControllerTest.php"/>
|
||||
<testApplicationControllerFile filesystemName="SidePlaylistControllerTest.php"/>
|
||||
<testApplicationControllerFile filesystemName="SideplaylistControllerTest.php"/>
|
||||
</testApplicationControllerDirectory>
|
||||
</testApplicationDirectory>
|
||||
<testLibraryDirectory>
|
||||
|
|
|
@ -22,31 +22,6 @@ $pages = array(
|
|||
'action' => 'add-user',
|
||||
'resource' => 'user'
|
||||
),
|
||||
array(
|
||||
'label' => 'Playlists',
|
||||
'module' => 'default',
|
||||
'controller' => 'Playlist',
|
||||
'action' => 'index',
|
||||
'resource' => 'playlist',
|
||||
'pages' => array(
|
||||
array(
|
||||
'label' => 'New',
|
||||
'module' => 'default',
|
||||
'controller' => 'Playlist',
|
||||
'action' => 'new',
|
||||
'resource' => 'playlist',
|
||||
'visible' => false
|
||||
),
|
||||
array(
|
||||
'label' => 'Edit',
|
||||
'module' => 'default',
|
||||
'controller' => 'Playlist',
|
||||
'action' => 'edit',
|
||||
'resource' => 'playlist',
|
||||
'visible' => false
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'label' => 'Media Library',
|
||||
'module' => 'default',
|
||||
|
|
|
@ -32,6 +32,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
$this->view->headScript()->appendFile('/js/airtime/onready/library.js','text/javascript');
|
||||
$this->view->headScript()->appendFile('/js/contextmenu/jjmenu.js','text/javascript');
|
||||
$this->view->headLink()->appendStylesheet('/css/contextmenu.css');
|
||||
$this->view->headLink()->appendStylesheet('/css/media_library.css');
|
||||
|
||||
$this->_helper->layout->setLayout('library');
|
||||
|
||||
|
@ -40,7 +41,7 @@ class LibraryController extends Zend_Controller_Action
|
|||
|
||||
$this->_helper->actionStack('contents', 'library');
|
||||
$this->_helper->actionStack('quick-search', 'library');
|
||||
$this->_helper->actionStack('index', 'sideplaylist');
|
||||
$this->_helper->actionStack('index', 'playlist');
|
||||
}
|
||||
|
||||
public function contextMenuAction()
|
||||
|
|
|
@ -80,7 +80,19 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
public function indexAction()
|
||||
{
|
||||
$this->view->headScript()->appendFile('/js/airtime/library/spl.js','text/javascript');
|
||||
$this->view->headLink()->appendStylesheet('/css/playlist_builder.css');
|
||||
|
||||
$this->_helper->viewRenderer->setResponseSegment('spl');
|
||||
|
||||
$pl_sess = $this->pl_sess;
|
||||
|
||||
if(isset($pl_sess->id)) {
|
||||
|
||||
$pl = $this->getPlaylist();
|
||||
|
||||
$this->view->pl = $pl;
|
||||
}
|
||||
}
|
||||
|
||||
public function newAction()
|
||||
|
@ -139,7 +151,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$this->view->headScript()->appendFile('/js/airtime/playlist/playlist.js','text/javascript');
|
||||
|
||||
$pl_id = $this->_getParam('id', null);
|
||||
$display = $this->_getParam('view', null);
|
||||
|
||||
if(!is_null($pl_id)) {
|
||||
$this->changePlaylist($pl_id);
|
||||
}
|
||||
|
@ -147,12 +159,9 @@ class PlaylistController extends Zend_Controller_Action
|
|||
$pl = $this->getPlaylist();
|
||||
|
||||
$this->view->pl = $pl;
|
||||
|
||||
if($display === 'spl') {
|
||||
$this->view->html = $this->view->render('sideplaylist/index.phtml');
|
||||
$this->view->html = $this->view->render('playlist/index.phtml');
|
||||
unset($this->view->pl);
|
||||
}
|
||||
}
|
||||
|
||||
public function addItemAction()
|
||||
{
|
||||
|
@ -168,7 +177,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
$this->view->pl = $pl;
|
||||
$this->view->html = $this->view->render('sideplaylist/update.phtml');
|
||||
$this->view->html = $this->view->render('playlist/update.phtml');
|
||||
$this->view->name = $pl->getName();
|
||||
$this->view->length = $pl->getLength();
|
||||
|
||||
|
@ -182,20 +191,13 @@ class PlaylistController extends Zend_Controller_Action
|
|||
{
|
||||
$oldPos = $this->_getParam('oldPos');
|
||||
$newPos = $this->_getParam('newPos');
|
||||
$display = $this->_getParam('view');
|
||||
|
||||
$pl = $this->getPlaylist();
|
||||
|
||||
$pl->moveAudioClip($oldPos, $newPos);
|
||||
|
||||
$this->view->pl = $pl;
|
||||
|
||||
if($display === 'pl') {
|
||||
$this->view->html = $this->view->render('playlist/update.phtml');
|
||||
}
|
||||
else {
|
||||
$this->view->html = $this->view->render('sideplaylist/update.phtml');
|
||||
}
|
||||
$this->view->name = $pl->getName();
|
||||
$this->view->length = $pl->getLength();
|
||||
|
||||
|
@ -205,7 +207,6 @@ class PlaylistController extends Zend_Controller_Action
|
|||
public function deleteItemAction()
|
||||
{
|
||||
$positions = $this->_getParam('pos', array());
|
||||
$display = $this->_getParam('view');
|
||||
|
||||
if (!is_array($positions))
|
||||
$positions = array($positions);
|
||||
|
@ -221,13 +222,7 @@ class PlaylistController extends Zend_Controller_Action
|
|||
}
|
||||
|
||||
$this->view->pl = $pl;
|
||||
|
||||
if($display === 'pl') {
|
||||
$this->view->html = $this->view->render('playlist/update.phtml');
|
||||
}
|
||||
else {
|
||||
$this->view->html = $this->view->render('sideplaylist/update.phtml');
|
||||
}
|
||||
$this->view->name = $pl->getName();
|
||||
$this->view->length = $pl->getLength();
|
||||
|
||||
|
@ -280,35 +275,21 @@ class PlaylistController extends Zend_Controller_Action
|
|||
|
||||
public function deleteActiveAction()
|
||||
{
|
||||
$display = $this->_getParam('view');
|
||||
|
||||
$pl = $this->getPlaylist();
|
||||
Playlist::Delete($pl->getId());
|
||||
|
||||
$pl_sess = $this->pl_sess;
|
||||
unset($pl_sess->id);
|
||||
|
||||
if($display === 'spl') {
|
||||
$this->view->html = $this->view->render('sideplaylist/index.phtml');
|
||||
return;
|
||||
}
|
||||
|
||||
$this->_helper->redirector('index');
|
||||
$this->view->html = $this->view->render('playlist/index.phtml');
|
||||
}
|
||||
|
||||
public function closeAction()
|
||||
{
|
||||
$display = $this->_getParam('view');
|
||||
|
||||
$pl = $this->getPlaylist();
|
||||
$this->closePlaylist($pl);
|
||||
|
||||
if($display === 'spl') {
|
||||
$this->view->html = $this->view->render('sideplaylist/index.phtml');
|
||||
return;
|
||||
}
|
||||
|
||||
$this->_helper->redirector('index');
|
||||
$this->view->html = $this->view->render('playlist/index.phtml');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ class SearchController extends Zend_Controller_Action
|
|||
|
||||
$this->_helper->actionStack('contents', 'library');
|
||||
$this->_helper->actionStack('display', 'search');
|
||||
$this->_helper->actionStack('index', 'sideplaylist');
|
||||
$this->_helper->actionStack('index', 'playlist');
|
||||
}
|
||||
|
||||
public function displayAction()
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
<?php
|
||||
|
||||
class SideplaylistController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
protected $pl_sess = null;
|
||||
|
||||
public function init()
|
||||
{
|
||||
if(!Zend_Auth::getInstance()->hasIdentity())
|
||||
{
|
||||
$this->_redirect('login/index');
|
||||
}
|
||||
|
||||
$this->pl_sess = new Zend_Session_Namespace(UI_PLAYLIST_SESSNAME);
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$this->view->headScript()->appendFile('/js/airtime/library/spl.js','text/javascript');
|
||||
|
||||
$this->_helper->viewRenderer->setResponseSegment('spl');
|
||||
|
||||
$pl_sess = $this->pl_sess;
|
||||
|
||||
if(isset($pl_sess->id)) {
|
||||
|
||||
$pl = Playlist::Recall($pl_sess->id);
|
||||
if($pl === FALSE) {
|
||||
unset($pl_sess->id);
|
||||
return;
|
||||
}
|
||||
|
||||
$this->view->pl = $pl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,19 +1,22 @@
|
|||
<div><a href="<?php echo $this->url(
|
||||
array(
|
||||
'controller' => 'Playlist',
|
||||
'action' => 'new'
|
||||
),
|
||||
'default',
|
||||
true) ?>"> New Playlist</a></div>
|
||||
<span id="spl_new">New</span>
|
||||
<?php if (isset($this->pl)) : ?>
|
||||
<span id="spl_delete">Delete</span>
|
||||
<span id="spl_close">Close</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<div><a href="<?php echo $this->url(
|
||||
array(
|
||||
'controller' => 'Playlist',
|
||||
'action' => 'edit'
|
||||
),
|
||||
'default',
|
||||
true) ?>"> Edit Playlist</a></div>
|
||||
<?php if (isset($this->pl)) : ?>
|
||||
|
||||
<?php
|
||||
<div id="spl_name"><?php echo $this->pl->getName(); ?></div>
|
||||
<div id="spl_length"><?php echo $this->pl->getLength(); ?></div>
|
||||
|
||||
echo $this->form;
|
||||
<ul id="spl_sortable">
|
||||
<?php if (count($this->pl->getContents())) : ?>
|
||||
<?php echo $this->partialLoop('sideplaylist/sidebarcontent.phtml', $this->pl->getContents()); ?>
|
||||
<?php else : ?>
|
||||
<li class="spl_empty">Empty playlist</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
||||
<?php else : ?>
|
||||
<div>No open playlist</div>
|
||||
<?php endif; ?>
|
||||
|
|
6
application/views/scripts/playlist/sidebarcontent.phtml
Normal file
6
application/views/scripts/playlist/sidebarcontent.phtml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<li class="spl_row" id="spl_<?php echo $this->partialCounter-1 ?>">
|
||||
<span class="spl_title"><?php echo $this->CcFiles['track_title'] ?></span>
|
||||
<span class="spl_playlength"><?php echo $this->cliplength ?></span>
|
||||
<span class="ui-icon ui-icon-close"></span>
|
||||
<span class="spl_artist"><?php echo $this->CcFiles['artist_name'] ?></span>
|
||||
</li>
|
|
@ -1,8 +1,7 @@
|
|||
<?php
|
||||
if (count($this->pl->getContents())) {
|
||||
echo $this->partialLoop('playlist/playlistEditorTable.phtml', $this->pl->getContents());
|
||||
echo $this->partialLoop('sideplaylist/sidebarcontent.phtml', $this->pl->getContents());
|
||||
}
|
||||
else {
|
||||
echo '<div class="pl_empty">Empty playlist</div>';
|
||||
echo '<li class="pl_empty">Empty playlist</li>';
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
<form name="SPL">
|
||||
<div>
|
||||
<span id="spl_new">
|
||||
<a href="<?php echo $this->url(
|
||||
array(
|
||||
'controller' => 'Playlist',
|
||||
'action' => 'new'
|
||||
),
|
||||
'default',
|
||||
true) ?>">New</a>
|
||||
</span>
|
||||
<?php if (isset($this->pl)) { echo '<span id="spl_delete">Delete</span>';} ?>
|
||||
<?php if (isset($this->pl)) { echo '<span id="spl_close">Close</span>';} ?>
|
||||
<div>
|
||||
<div id="spl_name"><?php if (isset($this->pl)) { echo $this->pl->getName(); } ?></div>
|
||||
<div id="spl_length"><?php if (isset($this->pl)) { echo $this->pl->getLength(); } ?></div>
|
||||
<div class="spl_main">
|
||||
<?php
|
||||
if (isset($this->pl)) {
|
||||
|
||||
echo '<div class="spl_head">';
|
||||
echo '<span class="spl_input"><input type="checkbox" name="all"></span>';
|
||||
echo '<span class="spl_title">Title</span>';
|
||||
echo '<span class="spl_artist">Creator</span>';
|
||||
echo '<span class="spl_playlength">Playlength</span>';
|
||||
echo '</div>';
|
||||
|
||||
echo '<ul id="spl_sortable">';
|
||||
|
||||
if (count($this->pl->getContents())) {
|
||||
echo $this->partialLoop('sideplaylist/sidebarcontent.phtml', $this->pl->getContents());
|
||||
}
|
||||
else {
|
||||
echo '<li class="spl_empty">Empty playlist</li>';
|
||||
}
|
||||
|
||||
echo '</ul></div>';
|
||||
}
|
||||
else {
|
||||
echo '<div>No open playlist</div>';
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
<div class="spl_footer">
|
||||
<?php if (isset($this->pl)) { echo '<span id="spl_remove_selected">Remove</span>';} ?>
|
||||
</div>
|
|
@ -1,14 +0,0 @@
|
|||
<li class="spl_row" id="spl_<?php echo $this->partialCounter-1 ?>">
|
||||
<span class="spl_input">
|
||||
<input type="checkbox" class="checkbox" name="<?php echo $this->partialCounter-1 ?>"/>
|
||||
</span>
|
||||
<span class="spl_title">
|
||||
<?php echo $this->CcFiles['track_title'] ?>
|
||||
</span>
|
||||
<span class="spl_artist">
|
||||
<?php echo $this->CcFiles['artist_name'] ?>
|
||||
</span>
|
||||
<span class="spl_playlength">
|
||||
<?php echo $this->cliplength ?>
|
||||
</span>
|
||||
</li>
|
|
@ -1,7 +0,0 @@
|
|||
<?php
|
||||
if (count($this->pl->getContents())) {
|
||||
echo $this->partialLoop('sideplaylist/sidebarcontent.phtml', $this->pl->getContents());
|
||||
}
|
||||
else {
|
||||
echo '<li class="pl_empty">Empty playlist</li>';
|
||||
}
|
0
public/css/media_library.css
Normal file
0
public/css/media_library.css
Normal file
8
public/css/playlist_builder.css
Normal file
8
public/css/playlist_builder.css
Normal file
|
@ -0,0 +1,8 @@
|
|||
#side_playlist div, #side_playlist span, #side_playlist ul, #side_playlist li {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#spl_sortable, #spl_sortable > li, .spl_artist, #side_playlist > div{
|
||||
clear: left;
|
||||
}
|
||||
|
|
@ -9,14 +9,14 @@ function setSPLContent(json) {
|
|||
return;
|
||||
}
|
||||
|
||||
$('input[name="all"]').attr("checked", false);
|
||||
|
||||
$('#spl_name').empty()
|
||||
.append(json.name);
|
||||
$('#spl_length').empty()
|
||||
.append(json.length);
|
||||
$('#spl_sortable').empty()
|
||||
.append(json.html);
|
||||
|
||||
$(".ui-icon-close").click(deleteSPLItem);
|
||||
}
|
||||
|
||||
function addSPLItem(event, ui){
|
||||
|
@ -37,16 +37,12 @@ function addSPLItem(event, ui){
|
|||
}
|
||||
|
||||
function deleteSPLItem(){
|
||||
|
||||
var url, pos;
|
||||
|
||||
url = '/Playlist/delete-item/format/json/view/spl';
|
||||
pos = $(this).parent().attr("id").split("_").pop();
|
||||
|
||||
pos = $('form[name="SPL"]').find(':checked').not('input[name="all"]').map(function() {
|
||||
return "/pos/" + $(this).attr('name');
|
||||
}).get().join("");
|
||||
|
||||
url = url + pos;
|
||||
url = '/Playlist/delete-item/format/json';
|
||||
url = url + '/pos/' + pos;
|
||||
|
||||
$.post(url, setSPLContent);
|
||||
}
|
||||
|
@ -61,7 +57,6 @@ function moveSPLItem(event, ui) {
|
|||
|
||||
url = '/Playlist/move-item'
|
||||
url = url + '/format/json';
|
||||
url = url + '/view/spl';
|
||||
url = url + '/oldPos/' + oldPos;
|
||||
url = url + '/newPos/' + newPos;
|
||||
|
||||
|
@ -77,15 +72,19 @@ function noOpenPL(json) {
|
|||
function closeSPL() {
|
||||
var url;
|
||||
|
||||
url = '/Playlist/close/format/json/view/spl';
|
||||
url = '/Playlist/close/format/json';
|
||||
|
||||
$.post(url, noOpenPL);
|
||||
}
|
||||
|
||||
function newSPL() {
|
||||
|
||||
}
|
||||
|
||||
function deleteSPL() {
|
||||
var url;
|
||||
|
||||
url = '/Playlist/delete-active/format/json/view/spl';
|
||||
url = '/Playlist/delete-active/format/json';
|
||||
|
||||
$.post(url, noOpenPL);
|
||||
}
|
||||
|
@ -106,12 +105,10 @@ function setUpSPL() {
|
|||
$("#spl_remove_selected").click(deleteSPLItem);
|
||||
$("#spl_close").click(closeSPL);
|
||||
$("#spl_delete").click(deleteSPL);
|
||||
$(".ui-icon-close").click(deleteSPLItem);
|
||||
|
||||
$("#spl_sortable").droppable();
|
||||
$("#spl_sortable" ).bind( "drop", addSPLItem);
|
||||
|
||||
$('input[name="all"]').click(function(){
|
||||
$('form[name="SPL"]').find('input').attr("checked", $(this).attr("checked"));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue