Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
6b4964b24d
|
@ -184,44 +184,16 @@ function setSmartPlaylistEvents() {
|
||||||
});
|
});
|
||||||
|
|
||||||
/********** SAVE ACTION **********/
|
/********** SAVE ACTION **********/
|
||||||
/* moved to spl.js
|
// moved to spl.js
|
||||||
$('#save_button').live("click", function(event){
|
|
||||||
var criteria = $('form').serializeArray(),
|
|
||||||
block_name = $('#playlist_name_display').text(),
|
|
||||||
block_desc = $('textarea[name="description"]').val(),
|
|
||||||
save_action = 'Playlist/save',
|
|
||||||
obj_id = $('input[id="obj_id"]').val();
|
|
||||||
enableLoadingIcon();
|
|
||||||
$.post(save_action, {format: "json", criteria: criteria, name: block_name, desc: block_desc, obj_id: obj_id}, function(data){
|
|
||||||
callback(data, "save");
|
|
||||||
setFadeIcon();
|
|
||||||
disableLoadingIcon();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
|
|
||||||
/********** GENERATE ACTION **********/
|
/********** GENERATE ACTION **********/
|
||||||
form.find('button[id="generate_button"]').live("click", function(event){
|
$('button[id="generate_button"]').live("click", function(){
|
||||||
var data = $('form').serializeArray(),
|
buttonClickAction('generate', 'Playlist/smart-block-generate');
|
||||||
generate_action = 'Playlist/smart-block-generate',
|
|
||||||
obj_id = $('input[id="obj_id"]').val();
|
|
||||||
enableLoadingIcon();
|
|
||||||
$.post(generate_action, {format: "json", data: data, obj_id: obj_id}, function(data){
|
|
||||||
callback(data, "generate");
|
|
||||||
disableLoadingIcon();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/********** SHUFFLE ACTION **********/
|
/********** SHUFFLE ACTION **********/
|
||||||
form.find('button[id="shuffle_button"]').live("click", function(event){
|
$('button[id="shuffle_button"]').live("click", function(){
|
||||||
var data = $('form').serializeArray(),
|
buttonClickAction('shuffle', 'Playlist/smart-block-shuffle');
|
||||||
shuffle_action = 'Playlist/smart-block-shuffle',
|
|
||||||
obj_id = $('input[id="obj_id"]').val();
|
|
||||||
enableLoadingIcon();
|
|
||||||
$.post(shuffle_action, {format: "json", data: data, obj_id: obj_id}, function(data){
|
|
||||||
callback(data, "shuffle");
|
|
||||||
disableLoadingIcon();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/********** CHANGE PLAYLIST TYPE **********/
|
/********** CHANGE PLAYLIST TYPE **********/
|
||||||
|
@ -339,6 +311,17 @@ function reindexElements() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function buttonClickAction(clickType, url){
|
||||||
|
var data = $('#smart-playlist-form').serializeArray(),
|
||||||
|
obj_id = $('input[id="obj_id"]').val();
|
||||||
|
|
||||||
|
enableLoadingIcon();
|
||||||
|
$.post(url, {format: "json", data: data, obj_id: obj_id}, function(data){
|
||||||
|
callback(data, clickType);
|
||||||
|
disableLoadingIcon();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function setupUI() {
|
function setupUI() {
|
||||||
var playlist_type = $('input:radio[name=sp_type]:checked').val();
|
var playlist_type = $('input:radio[name=sp_type]:checked').val();
|
||||||
var target_length = $('input[name="sp_limit_value"]').val();
|
var target_length = $('input[name="sp_limit_value"]').val();
|
||||||
|
@ -346,6 +329,24 @@ function setupUI() {
|
||||||
target_length = '0.0';
|
target_length = '0.0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Activate or Deactivate shuffle button
|
||||||
|
* It is only active if playlist is not empty
|
||||||
|
*/
|
||||||
|
var plContents = $('#spl_sortable').children();
|
||||||
|
var shuffleButton = $('button[id="shuffle_button"]');
|
||||||
|
|
||||||
|
if (plContents.length > 1) {
|
||||||
|
if (shuffleButton.hasClass('ui-state-disabled')) {
|
||||||
|
shuffleButton.removeClass('ui-state-disabled');
|
||||||
|
}
|
||||||
|
shuffleButton.live('click', function(){
|
||||||
|
buttonClickAction('shuffle', 'Playlist/smart-block-shuffle');
|
||||||
|
});
|
||||||
|
} else if (!shuffleButton.hasClass('ui-state-disabled')) {
|
||||||
|
shuffleButton.addClass('ui-state-disabled');
|
||||||
|
shuffleButton.die('click');
|
||||||
|
}
|
||||||
|
|
||||||
var dynamic_length = target_length;
|
var dynamic_length = target_length;
|
||||||
if ($('#obj_type').val() == 'block') {
|
if ($('#obj_type').val() == 'block') {
|
||||||
if (playlist_type == "0") {
|
if (playlist_type == "0") {
|
||||||
|
|
Loading…
Reference in New Issue