CC-84: Smart Playlists
-moved smart_playlistbuilder.js into playlist folder
This commit is contained in:
parent
4301a221b7
commit
4bed5e647e
|
@ -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->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/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']);
|
$this->view->headLink()->appendStylesheet($baseUrl.'/css/playlist_builder.css?'.$CC_CONFIG['airtime_version']);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -36,8 +36,8 @@
|
||||||
<label>
|
<label>
|
||||||
<?php echo $this->element->getElement('sp_limit_check') ?>
|
<?php echo $this->element->getElement('sp_limit_check') ?>
|
||||||
<?php echo $this->element->getElement('sp_limit_check')->getLabel() ?>
|
<?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_value')?>
|
||||||
|
<?php echo $this->element->getElement('sp_limit_options') ?>
|
||||||
</label>
|
</label>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
|
|
|
@ -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();
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue