side playlist box and gui changes

This commit is contained in:
naomiaro 2010-10-06 10:40:46 -04:00
parent d1fce69e64
commit e4cf1a6fcf
12 changed files with 190 additions and 93 deletions

View File

@ -55,12 +55,11 @@
} }
.pl_main { .pl_main {
clear: left;
} }
.pl_row { .pl_row {
background-color: #d5e2ee; background-color: #d5e2ee;
clear:left;
cursor:move; cursor:move;
} }
@ -154,3 +153,29 @@
text-align: right; text-align: right;
padding: 6px; padding: 6px;
} }
#spl_sortable {
list-style-type: none;
padding: 0;
margin: 0;
}
#spl_head {
background-color: #8BAED1;
font-weight: bold;
color: #ffffff;
}
.spl_title {
width: 73px;
}
.spl_artist {
width: 83px;
}
.spl_empty {
height: 30px;
text-align: center;
padding-top: 10px;
}

View File

@ -1,21 +1,37 @@
$(document).ready(function() { $(document).ready(function() {
$("#pl_sortable").sortable(); $('#search_results').find('tr').not('.blue_head').draggable({
connectToSortable: 'ul#spl_sortable',
helper: 'clone'
});
$('#cc_right_panel').find('h1').click(function(){
$(this).siblings().toggle();
});
$("#pl_sortable" ).bind( "sortstop", function(event, ui) { function movePLItem(event, ui) {
var li, newPos, oldPos; var ul, li, newPos, oldPos, id_prefix, tag;
tag = ui.item.get(0).tagName
if( tag === "TR")
return;
ul = $(this);
li = ui.item; li = ui.item;
newPos = $(this).children().index(li);
oldPos = li.attr('id').split("_").pop(); var temp = li.attr('id').split("_");
newPos = ul.children().index(li);
oldPos = temp[1];
id_prefix = temp[0];
$.post("ui_handler.php", $.post('ui_handler.php',
{ 'act': 'PL.moveItem', 'oldPos': oldPos, 'newPos': newPos }, { 'act': 'PL.moveItem', 'oldPos': oldPos, 'newPos': newPos },
function(data){ function(data){
var ul = $("#pl_sortable");
if(data.error) { if(data.error) {
var size, var size,
@ -23,10 +39,10 @@ $(document).ready(function() {
size = $(ul).children().size(); size = $(ul).children().size();
tmp_ul = $("<ul/>"); tmp_ul = $('<ul/>');
for(var i=0; i<size; i++) for(var i=0; i<size; i++)
{ {
tmp_ul.append(ul.find("#pl_"+i)); tmp_ul.append(ul.find('#'+id_prefix+'_'+i));
} }
//restore the UI to the previous order. //restore the UI to the previous order.
@ -38,15 +54,44 @@ $(document).ready(function() {
//redo playlist positional ids, input names. //redo playlist positional ids, input names.
$(ul).children().each(function(index){ $(ul).children().each(function(index){
var li = $(this); var li = $(this);
li.attr('id', 'pl_'+index); li.attr('id', id_prefix+'_'+index);
li.find(".pl_input").find("input").attr('name', index); li.find('.'+id_prefix+'_input').find('input').attr('name', index);
}); });
} }
}, },
"json" "json"
); );
}); }
function addPLItem(event, ui){
var tr, id, ul;
ul = $(this);
tr = ui.item;
id = tr.find("input").attr('name');
ul.find('tr').remove();
location.href='ui_handler.php?act=PL.addItem&id='+id;
}
/*
function test(event, ui){
alert('out');
}
*/
//PL main editor.
$("#pl_sortable").sortable();
$("#pl_sortable" ).bind( "sortstop", movePLItem);
//PL side bar editor.
$("#spl_sortable").sortable();
$("#spl_sortable" ).bind( "sortstop", movePLItem);
$("#spl_sortable" ).bind( "sortreceive", addPLItem);
//$("#spl_sortable" ).bind( "sortout", test);
function removeCueInput(){ function removeCueInput(){
var span = $(this).parent(); var span = $(this).parent();

View File

@ -53,7 +53,6 @@ form {
background-color: #F7F9FB; background-color: #F7F9FB;
padding: 0 25px 0 25px; padding: 0 25px 0 25px;
cursor: pointer; cursor: pointer;
width: 100px;
} }
.button_wide { .button_wide {
@ -321,6 +320,7 @@ input, select {
border: 1px solid #cfcfcf; border: 1px solid #cfcfcf;
padding: 6px; padding: 6px;
margin-bottom: 21px; margin-bottom: 21px;
width: 250px;
} }
.container_elements h1 { .container_elements h1 {
@ -335,6 +335,14 @@ input, select {
color: #666; color: #666;
} }
.container_elements table {
width: 100%;
}
.container_elements .button {
width: 80px;
}
.head { .head {
font-size: 12px; font-size: 12px;
background-color: #5286ba; background-color: #5286ba;
@ -359,7 +367,6 @@ input, select {
.container_table { .container_table {
font-size: 12px; font-size: 12px;
/*height: 275px;*/
overflow: auto; overflow: auto;
} }
@ -372,9 +379,8 @@ table {
table td { table td {
font-size: 12px; font-size: 12px;
padding: 2px 6px 0px 6px; padding: 2px 6px 0px 6px;
border-right: 1px solid #333;
height: 19px; height: 19px;
vertical-align: top; vertical-align: middle;
} }
table tr.blue_head td { table tr.blue_head td {
@ -385,7 +391,7 @@ table tr.blue_head td {
} }
A#blue_head { .blue_head a, .footer a {
font-size: 12px; font-size: 12px;
color:#fff; color:#fff;
} }
@ -1026,4 +1032,12 @@ table.masterpalette td{
.sp_tool_tip table td { .sp_tool_tip table td {
border: 0; border: 0;
}
#cc_right_panel h1 {
cursor: pointer;
}
.active_pl {
font-weight: bold;
} }

View File

@ -7,45 +7,45 @@
{if $_results.cnt > 0} {if $_results.cnt > 0}
<form name="SEARCHRESULTS"> <form name="SEARCHRESULTS">
<div class="head" style="width:600px; height: 21px;">&nbsp;</div> <div class="container_table">
<div class="container_table" style="width: 600px; height: auto;"> <table id="search_results">
<table style="width: 600px;">
<tr class="blue_head"> <tr class="blue_head">
<td style="width: 20px"><input type="checkbox" name="all" onClick="collector_switchAll('SEARCHRESULTS')"></td> <td><input type="checkbox" name="all" onClick="collector_switchAll('SEARCHRESULTS')"></td>
<td style="width: 200px;"><a href="{$UI_HANDLER}?act={$_act_prefix}.reorder&by=dc:title" id="blue_head">##Title##</a></td> <td><a href="{$UI_HANDLER}?act={$_act_prefix}.reorder&by=dc:title" >##Title##</a></td>
<td style="width: 195px"><a href="{$UI_HANDLER}?act={$_act_prefix}.reorder&by=dc:creator" id="blue_head">##Creator##</a></td> <td><a href="{$UI_HANDLER}?act={$_act_prefix}.reorder&by=dc:creator" >##Creator##</a></td>
<td style="width: 195px"><a href="{$UI_HANDLER}?act={$_act_prefix}.reorder&by=dc:source" id="blue_head">##Album##</a></td> <td><a href="{$UI_HANDLER}?act={$_act_prefix}.reorder&by=dc:source" >##Album##</a></td>
<td style="width: 25px"><a href="{$UI_HANDLER}?act={$_act_prefix}.reorder&by=ls:track_num" id="blue_head">##Track##</a></td> <td><a href="{$UI_HANDLER}?act={$_act_prefix}.reorder&by=ls:track_num" >##Track##</a></td>
<td><a href="{$UI_HANDLER}?act={$_act_prefix}.reorder&by=dcterms:extent" id="blue_head">##Duration##</a></td> <td><a href="{$UI_HANDLER}?act={$_act_prefix}.reorder&by=dcterms:extent" >##Length##</a></td>
<td style="width: 41px; border: 0; text-align: center">{*<a href="{$UI_HANDLER}?act={$_act_prefix}.reorder&by=type" id="blue_head">*}##Type##{*</a>*}</td> <td><a href="{$UI_HANDLER}?act={$_act_prefix}.reorder&by=type" >##Type##</a></td>
</tr> </tr>
{foreach from=$_results.items item=i} {foreach from=$_results.items item=i}
<!-- start item --> <!-- start item -->
<tr class="background-color: {cycle values='blue1, blue2'}"> <tr class="{cycle values='blue1, blue2'}">
<td><input type="checkbox" class="checkbox" name="{$i.id}"/></td> <td><input type="checkbox" class="checkbox" name="{$i.id}"/></td>
<td {include file=$action_handler} style="cursor: pointer"> <td {include file=$action_handler}>
{if $i.type == 'playlist' && $PL->isAvailable($i.id) == false} {if $i.type == 'playlist' && $PL->isAvailable($i.id) == false}
<b>{$i.title|truncate:30:"...":true}</b> <b>{$i.title|truncate:30:"...":true}</b>
{else} {else}
{$i.title|truncate:30:"...":true} {$i.title|truncate:30:"...":true}
{/if} {/if}
</td> </td>
<td {include file=$action_handler} style="cursor: pointer"> <td {include file=$action_handler}>
{$i.creator} {$i.creator}
{if $i.type == 'playlist' && $PL->isAvailable($i.id) == false} {if $i.type == 'playlist' && $PL->isAvailable($i.id) == false}
(editing: {$PL->isUsedBy($i.id)}) (editing: {$PL->isUsedBy($i.id)})
{/if} {/if}
</td> </td>
<td {include file=$action_handler} style="cursor: pointer">{$i.source}</td> <td {include file=$action_handler}>{$i.source}</td>
<td {include file=$action_handler} style="cursor: pointer" align="center">{$i.track_num}</td> <td {include file=$action_handler}>{$i.track_num}</td>
<td {include file=$action_handler} style="text-align: right; cursor: pointer">{assign var="_duration" value=$i.duration}{niceTime in=$_duration}</td> <td {include file=$action_handler}>{assign var="_duration" value=$i.duration}{niceTime in=$_duration}</td>
<td {include file=$action_handler} style="border: 0; text-align: center; cursor: pointer"> <td {include file=$action_handler}>
{if $i.type == 'playlist' && $PL->isAvailable($i.id) == false} {if $i.type == 'playlist' && $PL->isAvailable($i.id) == false}
<div align="left"><img src="html/img/ico_lock.png"> <div>
<img src="html/img/{$i.type|lower}.png" border="0" alt="{$i.type|lower|capitalize}" {* include file="sub/alttext.tpl" *} /></div> <img src="html/img/{$i.type|lower}.png" border="0" alt="{$i.type|lower|capitalize}"/>
<img src="html/img/ico_lock.png">
</div>
{else} {else}
<img src="html/img/{$i.type|lower}.png" border="0" alt="{$i.type|lower|capitalize}" {* include file="sub/alttext.tpl" *} /> <img src="html/img/{$i.type|lower}.png" border="0" alt="{$i.type|lower|capitalize}"/>
{/if} {/if}
</td> </td>
</tr> </tr>
@ -54,7 +54,7 @@
</table> </table>
</div> </div>
<div class="footer" style="width: 595px;"> <div class="footer">
<div class="counter"> <div class="counter">
{* {if $_results.prev}<a href="{$UI_HANDLER}?act={$_act_prefix}.setOffset&page=prev" id="blue_head">##previous##</a>{/if} *} {* {if $_results.prev}<a href="{$UI_HANDLER}?act={$_act_prefix}.setOffset&page=prev" id="blue_head">##previous##</a>{/if} *}

View File

@ -4,7 +4,7 @@
<h1>##Library Search##</h1> <h1>##Library Search##</h1>
<form action="ui_handler.php" method="post" name="simplesearch" id="simplesearch"><input name="act" type="hidden" value="SEARCH.simpleSearch" /> <form action="ui_handler.php" method="post" name="simplesearch" id="simplesearch"><input name="act" type="hidden" value="SEARCH.simpleSearch" />
<div> <div>
<input size="20" maxlength="50" name="criterium" type="text" style="width: 184px;" /> <input size="27" maxlength="50" name="criterium" type="text"/>
<input type="button" class="button_small" value="##Go##" onClick="submit()"/> <input type="button" class="button_small" value="##Go##" onClick="submit()"/>
</div> </div>
</form> </form>

View File

@ -77,7 +77,7 @@
{include file="twitter/settings.tpl"} {include file="twitter/settings.tpl"}
{/if} {/if}
<div class="content"> <div class="content" id="cc_right_panel">
{if $simpleSearchForm} {if $simpleSearchForm}
{include file="library/simpleSearchForm.tpl"} {include file="library/simpleSearchForm.tpl"}
{/if} {/if}
@ -85,6 +85,10 @@
{if $SCRATCHPAD} {if $SCRATCHPAD}
{include file="scratchpad/main.tpl"} {include file="scratchpad/main.tpl"}
{/if} {/if}
{if $showSidePL && !$PL_simpleManagement}
{include file="playlist/sidebar.tpl"}
{/if}
</div> </div>
{/if} {/if}

View File

@ -20,34 +20,34 @@
{foreach from=$PL->getActiveArr($PL->activeId) key='pos' item='i'} {foreach from=$PL->getActiveArr($PL->activeId) key='pos' item='i'}
<li class="pl_row" id="pl_{$pos}"> <li class="pl_row" id="pl_{$pos}">
<div class="pl_fade_in"><span>Fade in: </span><span class="pl_time">{$i.fadein}</span></div> <div class="pl_fade_in"><span>Fade in: </span><span class="pl_time">{$i.fadein}</span></div>
<span class="pl_input"> <span class="pl_input">
<input type="checkbox" class="checkbox" name="{$pos}"/> <input type="checkbox" class="checkbox" name="{$pos}"/>
</span> </span>
<span class="pl_title"> <span class="pl_title">
{$i.track_title} {$i.track_title}
</span> </span>
<span class="pl_artist"> <span class="pl_artist">
{$i.artist_name} {$i.artist_name}
</span> </span>
<span class="pl_length" > <span class="pl_length" >
{$i.length} {$i.length}
</span> </span>
<span class="pl_cue_in pl_time"> <span class="pl_cue_in pl_time">
{$i.cuein} {$i.cuein}
</span> </span>
<span class="pl_cue_out pl_time"> <span class="pl_cue_out pl_time">
{$i.cueout} {$i.cueout}
</span> </span>
<span class="pl_playlength"> <span class="pl_playlength">
{$i.cliplength} {$i.cliplength}
</span> </span>
<div class="pl_fade_out"><span>Fade out: </span><span class="pl_time">{$i.fadeout}</span></div> <div class="pl_fade_out"><span>Fade out: </span><span class="pl_time">{$i.fadeout}</span></div>
</li> </li>
{/foreach} {/foreach}
{if is_null($pos)}
<li class="pl_empty">##Empty playlist##</li>
{/if}
</ul> </ul>
{if is_null($pos)}
<div class="pl_empty">##Empty playlist##</div>
{/if}
</div> </div>
</form> </form>
@ -57,7 +57,7 @@
<input type="button" class="button_large" onClick="collector_clearAll('PL', 'PL.removeItem')" value="##Clear Playlist##" /> <input type="button" class="button_large" onClick="collector_clearAll('PL', 'PL.removeItem')" value="##Clear Playlist##" />
</div> </div>
<div class="pl_container_button"> <div class="pl_container_button">
<input type="button" class="button_large" value="##Close Playlist##" onClick="popup('{$UI_BROWSER}?popup[]=PL.confirmRelease', 'PL.confirmRelease', 400, 50)"> <input type="button" class="button_large" onClick="location.href='{$UI_HANDLER}?act=PL.release'" value="##Close Playlist##">
<input type="button" class="button_large" value="##Description##" onClick="location.href='{$UI_BROWSER}?act=PL.editMetaData'"> <input type="button" class="button_large" value="##Description##" onClick="location.href='{$UI_BROWSER}?act=PL.editMetaData'">
<input type="button" class="button_large" value="##Delete Playlist##" onClick="popup('{$UI_BROWSER}?popup[]=PL.confirmDelete', 'PL.deleteActive', 400, 50)"> <input type="button" class="button_large" value="##Delete Playlist##" onClick="popup('{$UI_BROWSER}?popup[]=PL.confirmDelete', 'PL.deleteActive', 400, 50)">
</div> </div>

View File

@ -5,16 +5,15 @@
<form name="SP"> <form name="SP">
<div class="container_elements"> <div class="container_elements">
<h1>##ScratchPad##</h1> <h1>##ScratchPad##</h1>
<div class="head" style="width:255px; height: 21px;">&nbsp;</div> <div class="container_table">
<div class="container_table" style="width:275px;"> <table id="SP_table">
<table style="width:255px;">
<!-- start table header --> <!-- start table header -->
<tr class="blue_head"> <tr class="blue_head">
<td style="width: 1px"><input type="checkbox" name="all" onClick="collector_switchAll('SP')"></td> <td><input type="checkbox" name="all" onClick="collector_switchAll('SP')"></td>
<td style="width: *"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SP.reorder&by=title', 'order');" id="blue_head">##Title##</a></td> <td><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SP.reorder&by=title', 'order');">##Title##</a></td>
<td style="width: 1px"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SP.reorder&by=title', 'order');" id="blue_head">##Duration##</td> <td><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SP.reorder&by=title', 'order');">##Length##</td>
<td style="width: 1px; border: 0; text-align: center"><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SP.reorder&by=title', 'order');" id="blue_head">##Type##</td> <td><a href="#" onClick="hpopup('{$UI_HANDLER}?act=SP.reorder&by=title', 'order');">##Type##</td>
</tr> </tr>
<!-- end table header --> <!-- end table header -->
@ -23,13 +22,13 @@
<!-- start item --> <!-- start item -->
<tr class="{cycle values='blue1, blue2'}" id="scratchpad_item_{$i.id}"> <tr class="{cycle values='blue1, blue2'}" id="scratchpad_item_{$i.id}">
<td><input type="checkbox" class="checkbox" name="{$i.id}"/></td> <td><input type="checkbox" class="checkbox" name="{$i.id}"/></td>
<td {include file="scratchpad/actionhandler.tpl"} style="cursor: pointer"> <td {include file="scratchpad/actionhandler.tpl"}>
{if $i.type|lower == "playlist"} {if $i.type|lower == "playlist"}
{if $i.type == 'playlist' && $PL->isAvailable($i.id) == false} {if $i.type == 'playlist' && $PL->isAvailable($i.id) == false}
<div style="font-weight: bold; cursor: pointer"> <div class="active_pl">
{else} {else}
<div style="cursor: pointer"> <div>
{/if} {/if}
{$i.title|truncate:14:"...":true} {$i.title|truncate:14:"...":true}
</div> </div>
@ -38,13 +37,15 @@
{/if} {* for some reason object call doesn't like usage of array *} {/if} {* for some reason object call doesn't like usage of array *}
</td> </td>
{assign var="_duration" value=$i.duration} {assign var="_duration" value=$i.duration}
<td {include file="scratchpad/actionhandler.tpl"} style="text-align: right; cursor: pointer">{niceTime in=$_duration}</td> <td {include file="scratchpad/actionhandler.tpl"}>{niceTime in=$_duration}</td>
<td {include file="scratchpad/actionhandler.tpl"} style="border: 0; text-align: center; cursor: pointer"> <td {include file="scratchpad/actionhandler.tpl"}>
{if $i.type == 'playlist' && $PL->isAvailable($i.id) == false} {if $i.type == 'playlist' && $PL->isAvailable($i.id) == false}
<div align="left"><img src="html/img/ico_lock.png"> <div>
<img src="html/img/{$i.type}.png" border="0" alt="{$i.type|capitalize}" {* include file="sub/alttext.tpl"*} /></div> <img src="html/img/{$i.type}.png" border="0" alt="{$i.type|capitalize}" />
<img src="html/img/ico_lock.png">
</div>
{else} {else}
<img src="html/img/{$i.type}.png" border="0" alt="{$i.type|capitalize}" {* include file="sub/alttext.tpl" *} /> {/if} <img src="html/img/{$i.type}.png" border="0" alt="{$i.type|capitalize}" /> {/if}
</td> </td>
</tr> </tr>
<!-- end item --> <!-- end item -->
@ -57,7 +58,7 @@
</table> </table>
</div> </div>
<div class="footer" style="width:250px;"> <div class="footer">
<select name="SP_multiaction" onChange="collector_submit('SP', this.value)"> <select name="SP_multiaction" onChange="collector_submit('SP', this.value)">
<option>##Multiple Action:##</option> <option>##Multiple Action:##</option>
<option value="SP.removeItem">##Remove files##</option> <option value="SP.removeItem">##Remove files##</option>
@ -73,7 +74,7 @@
document.forms['SP'].elements['all'].checked = false; document.forms['SP'].elements['all'].checked = false;
collector_switchAll('SP'); collector_switchAll('SP');
</script> </script>
<a href="#" onClick="collector_clearAll('SP', 'SP.removeItem')" id="blue_head">##Clear##</a> <a href="#" onClick="collector_clearAll('SP', 'SP.removeItem')">##Clear##</a>
</div> </div>
</div> </div>

View File

@ -17,7 +17,11 @@ function collector_submit(formname, action, script, name, width, height)
} }
if (href == '') return false; if (href == '') return false;
if (action === 'PL.addItem') {
location.href='ui_handler.php?act='+ action + href;
return;
}
if (action == 'delete') { if (action == 'delete') {
{/literal} {/literal}

View File

@ -17,6 +17,7 @@ $Smarty->assign('editItem', null);
$Smarty->assign('changeStationPrefs', FALSE); $Smarty->assign('changeStationPrefs', FALSE);
$Smarty->assign('PL_simpleManagement', FALSE); $Smarty->assign('PL_simpleManagement', FALSE);
$Smarty->assign('showBackup', FALSE); $Smarty->assign('showBackup', FALSE);
$Smarty->assign('showSidePL', TRUE);
if (isset($_REQUEST['popup']) && is_array($_REQUEST['popup'])){ if (isset($_REQUEST['popup']) && is_array($_REQUEST['popup'])){
if (isset($WHITE_SCREEN_OF_DEATH) && ($WHITE_SCREEN_OF_DEATH == TRUE)) { if (isset($WHITE_SCREEN_OF_DEATH) && ($WHITE_SCREEN_OF_DEATH == TRUE)) {

View File

@ -315,11 +315,11 @@ switch ($_REQUEST['act']) {
case "PL.addItem": case "PL.addItem":
if (isset($_REQUEST['id'])) { if (isset($_REQUEST['id'])) {
if ($uiHandler->PLAYLIST->addItem($_REQUEST['id'], $_REQUEST['playlength']) !== FALSE) { if ($uiHandler->PLAYLIST->addItem($_REQUEST['id']) !== FALSE) {
$uiHandler->SCRATCHPAD->addItem($_REQUEST['id']); $uiHandler->SCRATCHPAD->addItem($_REQUEST['id']);
} }
} }
$uiHandler->PLAYLIST->setReload(); $uiHandler->PLAYLIST->setReload("ui_browser.php?id=&act=BROWSE");
break; break;
case "PL.setClipLength": case "PL.setClipLength":
@ -337,7 +337,7 @@ switch ($_REQUEST['act']) {
case "PL.release": case "PL.release":
$uiHandler->PLAYLIST->release(); $uiHandler->PLAYLIST->release();
$uiHandler->PLAYLIST->setReload(); $uiHandler->PLAYLIST->setReturn();
break; break;
case "PL.save": case "PL.save":
@ -391,7 +391,7 @@ switch ($_REQUEST['act']) {
case "PL.deleteActive": case "PL.deleteActive":
if (($ui_tmpid = $uiHandler->PLAYLIST->deleteActive()) !== FALSE) { if (($ui_tmpid = $uiHandler->PLAYLIST->deleteActive()) !== FALSE) {
//$uiHandler->SCRATCHPAD->removeItems($ui_tmpid); $uiHandler->SCRATCHPAD->removeItems($ui_tmpid);
} }
$uiHandler->PLAYLIST->setReload(); $uiHandler->PLAYLIST->setReload();
break; break;

View File

@ -30,9 +30,12 @@ class uiPlaylist
} // constructor } // constructor
public function setReload() public function setReload($url=NULL)
{ {
$this->Base->redirUrl = $this->reloadUrl; if($url)
$this->Base->redirUrl = $url;
else
$this->Base->redirUrl = $this->reloadUrl;
} // fn setReload } // fn setReload