Merge branch 'cc-84-smart-playlist' of dev.sourcefabric.org:airtime into cc-84-smart-playlist

This commit is contained in:
Martin Konecny 2012-07-11 10:47:14 -04:00
commit 646e028037
3 changed files with 2 additions and 49 deletions

View File

@ -137,7 +137,7 @@ class PlaylistController extends Zend_Controller_Action
$this->view->headLink()->appendStylesheet($baseUrl.'/css/datatables/css/ColReorder.css?'.$CC_CONFIG['airtime_version']);
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/spl.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/library/smart_playlistbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/playlist/smart_playlistbuilder.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->headLink()->appendStylesheet($baseUrl.'/css/playlist_builder.css?'.$CC_CONFIG['airtime_version']);
try {

View File

@ -36,8 +36,8 @@
<label>
<?php echo $this->element->getElement('sp_limit_check') ?>
<?php echo $this->element->getElement('sp_limit_check')->getLabel() ?>
<?php echo $this->element->getElement('sp_limit_options') ?>
<?php echo $this->element->getElement('sp_limit_value')?>
<?php echo $this->element->getElement('sp_limit_options') ?>
</label>
</dd>

View File

@ -1,47 +0,0 @@
$(document).ready(function() {
setSmartPlaylistEvents();
});
function setSmartPlaylistEvents() {
var form = $('#smart-playlist-form');
form.find('a[id="criteria_add"]').click(function(){
var div = $('dd[id="sp_criteria-element"]').children('div:visible:last').next();
div.show();
div = div.next();
if(div.length === 0) {
$(this).hide();
}
});
form.find('a[id^="criteria_remove"]').click(function(){
var curr = $(this).parent();
var curr_pos = curr.index();
var list = curr.parent();
var list_length = list.find("div:visible").length;
var count = list_length - curr_pos;
var next = curr.next();
for(var i=0; i<=count; i++) {
var criteria = next.find('[name^="sp_criteria"]').val();
curr.find('[name^="sp_criteria"]').val(criteria);
var modifier = next.find('[name^="sp_criteria_modifier"]').val();
curr.find('[name^="sp_criteria_modifier"]').val(modifier);
var criteria_value = next.find('[name^="sp_criteria_value"]').val();
curr.find('[name^="sp_criteria_value"]').val(criteria_value);
curr = next;
next = curr.next();
}
list.find("div:visible:last")
.find('[name^="sp_criteria"]').val('').end()
.find('[name^="sp_criteria_modifier"]').val('').end()
.find('[name^="sp_criteria_value"]').val('')
.end().hide();
list.next().show();
});
}