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()
|
public function addItemAction()
|
||||||
{
|
{
|
||||||
$id = $this->_getParam('id');
|
$id = $this->_getParam('id');
|
||||||
|
$pos = $this->_getParam('pos', null);
|
||||||
|
|
||||||
if (!is_null($id)) {
|
if (!is_null($id)) {
|
||||||
|
|
||||||
$pl = $this->getPlaylist();
|
$pl = $this->getPlaylist();
|
||||||
$res = $pl->addAudioClip($id);
|
$res = $pl->addAudioClip($id, $pos);
|
||||||
|
|
||||||
if (PEAR::isError($res)) {
|
if (PEAR::isError($res)) {
|
||||||
$this->view->message = $res->getMessage();
|
$this->view->message = $res->getMessage();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php if($this->partialCounter-1 > 0): ?>
|
<?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; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<li class="ui-state-default" id="spl_<?php echo $this->partialCounter-1 ?>">
|
<li class="ui-state-default" id="spl_<?php echo $this->partialCounter-1 ?>">
|
||||||
|
@ -17,5 +17,5 @@
|
||||||
<span class="ui-icon ui-icon-closethick"></span>
|
<span class="ui-icon ui-icon-closethick"></span>
|
||||||
</li>
|
</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){
|
function addSPLItem(event, ui){
|
||||||
|
|
||||||
var url, tr, id;
|
var url, tr, id, items, draggableOffset, elOffset, pos;
|
||||||
|
|
||||||
tr = ui.helper;
|
tr = ui.helper;
|
||||||
|
|
||||||
if(tr.get(0).tagName === 'LI')
|
if(tr.get(0).tagName === 'LI')
|
||||||
return;
|
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();
|
id = tr.attr('id').split("_").pop();
|
||||||
|
|
||||||
url = '/Playlist/add-item/format/json';
|
url = '/Playlist/add-item';
|
||||||
url = url + '/id/'+id;
|
|
||||||
|
|
||||||
$.post(url, setSPLContent);
|
$.post(url, {format: "json", id: id, pos: pos}, setSPLContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteSPLItem(event){
|
function deleteSPLItem(event){
|
||||||
|
@ -367,8 +379,8 @@ function openDiffSPL(json) {
|
||||||
|
|
||||||
function setUpSPL() {
|
function setUpSPL() {
|
||||||
|
|
||||||
//$("#spl_sortable").sortable();
|
$("#spl_sortable").sortable();
|
||||||
//$("#spl_sortable" ).bind( "sortstop", moveSPLItem);
|
$("#spl_sortable" ).bind( "sortstop", moveSPLItem);
|
||||||
$("#spl_remove_selected").click(deleteSPLItem);
|
$("#spl_remove_selected").click(deleteSPLItem);
|
||||||
$("#spl_new")
|
$("#spl_new")
|
||||||
.button()
|
.button()
|
||||||
|
|
Loading…
Reference in New Issue