Merge branch 'master' of dev.sourcefabric.org:airtime
This commit is contained in:
commit
e52d566b83
|
@ -164,11 +164,12 @@ class PlaylistController extends Zend_Controller_Action
|
|||
public function addItemAction()
|
||||
{
|
||||
$id = $this->_getParam('id');
|
||||
$pos = $this->_getParam('pos', null);
|
||||
|
||||
if (!is_null($id)) {
|
||||
|
||||
$pl = $this->getPlaylist();
|
||||
$res = $pl->addAudioClip($id);
|
||||
$res = $pl->addAudioClip($id, $pos);
|
||||
|
||||
if (PEAR::isError($res)) {
|
||||
$this->view->message = $res->getMessage();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php if($this->partialCounter-1 > 0): ?>
|
||||
<li id="crossfade_<?php echo $this->partialCounter-2 ?>-<?php echo $this->partialCounter-1 ?>" class="crossfade" style="display: none"></li>
|
||||
<!--<li id="crossfade_<?php echo $this->partialCounter-2 ?>-<?php echo $this->partialCounter-1 ?>" class="crossfade" style="display: none"></li>-->
|
||||
<?php endif; ?>
|
||||
|
||||
<li class="ui-state-default" id="spl_<?php echo $this->partialCounter-1 ?>">
|
||||
|
@ -17,5 +17,5 @@
|
|||
<span class="ui-icon ui-icon-closethick"></span>
|
||||
</li>
|
||||
|
||||
<li id="cues_<?php echo $this->partialCounter-1 ?>" class="crossfade" style="display: none"></li>
|
||||
<!-- <li id="cues_<?php echo $this->partialCounter-1 ?>" class="crossfade" style="display: none"></li> -->
|
||||
|
||||
|
|
|
@ -255,19 +255,31 @@ function setSPLContent(json) {
|
|||
|
||||
function addSPLItem(event, ui){
|
||||
|
||||
var url, tr, id;
|
||||
var url, tr, id, items, draggableOffset, elOffset, pos;
|
||||
|
||||
tr = ui.helper;
|
||||
|
||||
if(tr.get(0).tagName === 'LI')
|
||||
return;
|
||||
|
||||
items = $(event.currentTarget).children();
|
||||
|
||||
draggableOffset = ui.offset;
|
||||
|
||||
$.each(items, function(i, val){
|
||||
elOffset = $(this).offset();
|
||||
|
||||
if(elOffset.top > draggableOffset.top) {
|
||||
pos = $(this).attr('id').split("_").pop();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
id = tr.attr('id').split("_").pop();
|
||||
|
||||
url = '/Playlist/add-item/format/json';
|
||||
url = url + '/id/'+id;
|
||||
url = '/Playlist/add-item';
|
||||
|
||||
$.post(url, setSPLContent);
|
||||
$.post(url, {format: "json", id: id, pos: pos}, setSPLContent);
|
||||
}
|
||||
|
||||
function deleteSPLItem(event){
|
||||
|
@ -367,8 +379,8 @@ function openDiffSPL(json) {
|
|||
|
||||
function setUpSPL() {
|
||||
|
||||
//$("#spl_sortable").sortable();
|
||||
//$("#spl_sortable" ).bind( "sortstop", moveSPLItem);
|
||||
$("#spl_sortable").sortable();
|
||||
$("#spl_sortable" ).bind( "sortstop", moveSPLItem);
|
||||
$("#spl_remove_selected").click(deleteSPLItem);
|
||||
$("#spl_new")
|
||||
.button()
|
||||
|
|
Loading…
Reference in New Issue