Merge branch 'saas-dev' of github.com:sourcefabric/Airtime into saas-dev
This commit is contained in:
commit
f05157c376
10 changed files with 110 additions and 37 deletions
|
@ -77,6 +77,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
cb.append("<input id='super-checkbox' type='checkbox'>");
|
||||
}
|
||||
|
||||
var libEmpty = $('#library_empty');
|
||||
if (emptyRow.length > 0) {
|
||||
emptyRow.hide();
|
||||
var mediaType = parseInt($('.media_type_selector.selected').attr('data-selection-id')),
|
||||
|
@ -92,13 +93,13 @@ var AIRTIME = (function(AIRTIME) {
|
|||
$('#library_empty_text').html(
|
||||
$.i18n._("You haven't added any " + opts.media + ".")
|
||||
+ "<br/>" + $.i18n._(opts.subtext)
|
||||
+ "<br/><a href='" + opts.href + "'>" + $.i18n._("Learn about " + opts.media) + "</a>"
|
||||
+ "<br/><a target='_blank' href='" + opts.href + "'>" + $.i18n._("Learn about " + opts.media) + "</a>"
|
||||
);
|
||||
}) ;
|
||||
});
|
||||
|
||||
$('#library_empty').show();
|
||||
libEmpty.show();
|
||||
} else {
|
||||
$('#library_empty').hide();
|
||||
libEmpty.hide();
|
||||
}
|
||||
|
||||
if ($("#show_builder_table").is(":visible")) {
|
||||
|
|
|
@ -421,17 +421,19 @@ var AIRTIME = (function(AIRTIME){
|
|||
$('.zend_form + .spl-no-margin > div:has(*:visible):last').css('margin-left', 0);
|
||||
}
|
||||
|
||||
function getId() {
|
||||
return parseInt($pl.find(".obj_id").val(), 10);
|
||||
function getId(pl) {
|
||||
pl = (pl === undefined) ? $pl : pl;
|
||||
return parseInt(pl.find(".obj_id").val(), 10);
|
||||
}
|
||||
|
||||
mod.getModified = function() {
|
||||
return parseInt($pl.find(".obj_lastMod").val(), 10);
|
||||
}
|
||||
mod.getModified = function(pl) {
|
||||
pl = (pl === undefined) ? $pl : pl;
|
||||
return parseInt(pl.find(".obj_lastMod").val(), 10);
|
||||
};
|
||||
|
||||
mod.setModified = function(modified) {
|
||||
$pl.find(".obj_lastMod").val(modified);
|
||||
}
|
||||
};
|
||||
|
||||
function setTitleLabel(title) {
|
||||
$pl.find(".title_obj_name").text(title);
|
||||
|
@ -569,6 +571,10 @@ var AIRTIME = (function(AIRTIME){
|
|||
if (pane.get(0) == curr.get(0)) { // Closing the current tab, otherwise we don't need to switch tabs
|
||||
AIRTIME.showbuilder.switchTab(toPane, toTab);
|
||||
}
|
||||
|
||||
// If we close a tab that was causing tabs to wrap to the next row, we need to resize to change the
|
||||
// margin for the tab nav
|
||||
AIRTIME.playlist.onResize();
|
||||
}
|
||||
|
||||
mod.closeTab = function(id) {
|
||||
|
@ -1208,8 +1214,8 @@ var AIRTIME = (function(AIRTIME){
|
|||
var url, id, lastMod, type, pl = (tabId === undefined) ? $pl : $('#pl-tab-content-' + tabId);
|
||||
|
||||
stopAudioPreview();
|
||||
id = (plid === undefined) ? getId() : plid;
|
||||
lastMod = mod.getModified();
|
||||
id = (plid === undefined) ? getId(pl) : plid;
|
||||
lastMod = mod.getModified(pl);
|
||||
type = pl.find('.obj_type').val();
|
||||
url = baseUrl+'playlist/delete';
|
||||
|
||||
|
@ -1558,6 +1564,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
mod.setAsActive = function() {
|
||||
$pl = $(".active-tab");
|
||||
$.post(baseUrl + "playlist/change-playlist", {"id": getId(), "type": $pl.find('.obj_type').val()});
|
||||
};
|
||||
|
||||
mod.init = function() {
|
||||
|
|
|
@ -10,7 +10,7 @@ $(document).ready(function() {
|
|||
width = width * .91;
|
||||
$("#listenerstat_content").find("#flot_placeholder").width(width);
|
||||
$("#listenerstat_content").find("#legend").width(width);
|
||||
|
||||
|
||||
getDataAndPlot();
|
||||
|
||||
listenerstat_content.find("#his_submit").click(function(){
|
||||
|
@ -21,7 +21,17 @@ $(document).ready(function() {
|
|||
});
|
||||
});
|
||||
|
||||
function getDataAndPlot(startTimestamp, endTimestamp){
|
||||
/**
|
||||
* Toggle a spinner overlay so the user knows the page is processing
|
||||
*/
|
||||
function toggleOverlay() {
|
||||
$('#flot_placeholder').toggleClass('processing');
|
||||
}
|
||||
|
||||
function getDataAndPlot(startTimestamp, endTimestamp) {
|
||||
// Turn on the processing overlay
|
||||
toggleOverlay();
|
||||
|
||||
// get data
|
||||
$.get(baseUrl+'Listenerstat/get-data', {start: startTimestamp, end: endTimestamp}, function(data){
|
||||
out = new Object();
|
||||
|
@ -37,6 +47,8 @@ function getDataAndPlot(startTimestamp, endTimestamp){
|
|||
out[mpName] = plotData;
|
||||
});
|
||||
plot(out);
|
||||
// Turn off the processing overlay
|
||||
toggleOverlay();
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -43,10 +43,16 @@ function rowClickCallback(row_id){
|
|||
}});
|
||||
}
|
||||
|
||||
function removeUserCallback(row_id, nRow){
|
||||
$.ajax({ url: baseUrl+'User/remove-user/id/'+ row_id +'/format/json', dataType:"text", success:function(data){
|
||||
var o = $('#users_datatable').dataTable().fnDeleteRow(nRow);
|
||||
}});
|
||||
function removeUserCallback(row_id, nRow) {
|
||||
if (confirm($.i18n._("Are you sure you want to delete this user?"))) {
|
||||
$.ajax({
|
||||
url: baseUrl + 'User/remove-user/id/' + row_id + '/format/json',
|
||||
dataType: "text",
|
||||
success: function (data) {
|
||||
var o = $('#users_datatable').dataTable().fnDeleteRow(nRow);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function rowCallback( nRow, aData, iDisplayIndex ){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue