Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Martin Konecny 2012-07-30 21:48:25 -04:00
commit ab85ab59d9
11 changed files with 223 additions and 131 deletions

View file

@ -88,8 +88,7 @@ var AIRTIME = (function(AIRTIME){
});
};
mod.dblClickAdd = function(id, type) {
mod.dblClickAdd = function(data, type) {
var i,
length,
temp,
@ -98,7 +97,7 @@ var AIRTIME = (function(AIRTIME){
aData = [];
//process selected files/playlists.
aMediaIds.push({"id": id, "type": type});
aMediaIds.push({"id": data.id, "type": type});
$("#show_builder_table tr.cursor-selected-row").each(function(i, el){
aData.push($(el).prev().data("aData"));
@ -114,6 +113,7 @@ var AIRTIME = (function(AIRTIME){
alert("Please select a cursor position on timeline.");
return false;
}
console.log(aMediaIds);
AIRTIME.showbuilder.fnAdd(aMediaIds, aSchedIds);
};

View file

@ -352,6 +352,40 @@ var AIRTIME = (function(AIRTIME){
//add the play function to the play icon
$pl.delegate(".big_play",
{"click": openAudioPreview});
$pl.delegate(".spl_block_expand",
{"click": function(ev){
var id = parseInt($(this).attr("id").split("_").pop(), 10);
if ($(this).hasClass('close')) {
var sUrl = "/playlist/get-block-info";
mod.disableUI();
$.post(sUrl, {format:"json", id:id}, function(json){
$html = "";
var data = $.parseJSON(json);
var isStatic = data.isStatic;
delete data.type;
if (isStatic) {
$.each(data, function(index, ele){
$html += "<div>"+ele.track_title+" "+ele.creator+" "+ele.length+"</div>";
})
} else {
for (var key in data.crit){
$.each(data.crit[key], function(index, ele){
var extra = (ele['extra']==null)?"":ele['extra'];
$html += "<div>"+ele['display_name']+" "+ele['modifier']+" "+ele['value']+" "+extra+"</div>";
});
}
$html += "<div>"+data.limit.value+" "+data.limit.modifier;
}
$pl.find("#block_"+id+"_info").html($html);
mod.enableUI();
});
$(this).removeClass('close');
} else {
$pl.find("#block_"+id+"_info").html("");
$(this).addClass('close');
}
}});
}
//sets events dynamically for the cue editor.
@ -384,7 +418,7 @@ var AIRTIME = (function(AIRTIME){
//main playlist fades events
$pl.on("click", "#spl_crossfade", function() {
var lastMod = getModified(),
type = $('#obj_type');
type = $('#obj_type').val();
if ($(this).hasClass("ui-state-active")) {
$(this).removeClass("ui-state-active");
@ -394,8 +428,7 @@ var AIRTIME = (function(AIRTIME){
$(this).addClass("ui-state-active");
var url = '/Playlist/get-playlist-fades';
$.get(url,
$.post(url,
{format: "json", modified: lastMod, type: type},
function(json){
if (json.error !== undefined){

View file

@ -108,8 +108,12 @@ function setSmartPlaylistEvents() {
var criteria_value = next.find('[name^="sp_criteria_value"]').val();
curr.find('[name^="sp_criteria_value"]').val(criteria_value);
var id = curr.find('[name^="sp_criteria"]').attr('id');
var index = id.charAt(id.length-1);
var id = curr.find('[name^="sp_criteria"]').attr('id'),
delimiter = '_',
start = 3,
tokens = id.split(delimiter).slice(start),
index = tokens.join(delimiter);
/* if current and next row have the extra criteria value
* (for 'is in the range' modifier), then assign the next
* extra value to current and remove that element from
@ -162,6 +166,7 @@ function setSmartPlaylistEvents() {
// always put '+' button on the last enabled row
appendAddButton();
// always put '+' button on the last modifier row
appendModAddButton();
// remove the 'x' button if only one row is enabled
removeButtonCheck();
@ -219,7 +224,10 @@ function setSmartPlaylistEvents() {
form.find('select[id^="sp_criteria_modifier"]').live("change", function(){
var criteria_value = $(this).next(),
index_name = criteria_value.attr('id'),
index_num = index_name.charAt(index_name.length-1);
delimiter = '_',
start = 3,
tokens = index_name.split(delimiter).slice(start),
index_num = tokens.join(delimiter);
if ($(this).val() == 'is in the range') {
enableAndShowExtraField(criteria_value, index_num);
@ -254,13 +262,14 @@ function appendModAddButton() {
if ($(div).find('select[name^="sp_criteria_field"]').val() == $(div).prev().find('select[name^="sp_criteria_field"]').val()) {
$(div).prev().find('a[id^="modifier_add"]').addClass('sp-invisible');
if (i+1 == divs.length) {
$(div).find('a[id^="modifier_add"]').removeClass('sp-invisible');
}
} else {
$(div).prev().find('a[id^="modifier_add"]').removeClass('sp-invisible');
}
}
}
if (i+1 == divs.length) {
$(div).find('a[id^="modifier_add"]').removeClass('sp-invisible');
}
});
}