Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
5711d25bad
|
@ -574,7 +574,7 @@ class Application_Model_Preference
|
||||||
public static function GetCalendarTimeScale() {
|
public static function GetCalendarTimeScale() {
|
||||||
$val = self::GetValue("calendar_time_scale", true /* user specific */);
|
$val = self::GetValue("calendar_time_scale", true /* user specific */);
|
||||||
if(strlen($val) == 0) {
|
if(strlen($val) == 0) {
|
||||||
$val = 'month';
|
$val = "month";
|
||||||
}
|
}
|
||||||
return $val;
|
return $val;
|
||||||
}
|
}
|
||||||
|
@ -590,9 +590,14 @@ class Application_Model_Preference
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the number of entries to show preference in library under Playlist Builder.
|
* Retrieves the number of entries to show preference in library under Playlist Builder.
|
||||||
|
* Defaults to 10 if no entry exists
|
||||||
*/
|
*/
|
||||||
public static function GetLibraryNumEntries() {
|
public static function GetLibraryNumEntries() {
|
||||||
return self::GetValue("library_num_entries", true /* user specific */);
|
$val = self::GetValue("library_num_entries", true /* user specific */);
|
||||||
|
if(strlen($val) == 0) {
|
||||||
|
$val = "10";
|
||||||
|
}
|
||||||
|
return $val;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -122,6 +122,7 @@ function dtRowCallback( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
|
||||||
function dtDrawCallback() {
|
function dtDrawCallback() {
|
||||||
addLibraryItemEvents();
|
addLibraryItemEvents();
|
||||||
addMetadataQtip();
|
addMetadataQtip();
|
||||||
|
saveNumEntriesSetting();
|
||||||
}
|
}
|
||||||
|
|
||||||
function addProgressIcon(id) {
|
function addProgressIcon(id) {
|
||||||
|
@ -280,19 +281,24 @@ function addMetadataQtip(){
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use user preference for number of entries to show;
|
* Updates pref db when user changes the # of entries to show
|
||||||
* defaults to 10 if preference was never set
|
*/
|
||||||
|
function saveNumEntriesSetting() {
|
||||||
|
$('select[name=library_display_length]').change(function() {
|
||||||
|
var url = '/Library/set-num-entries/format/json';
|
||||||
|
$.post(url, {numEntries: $(this).val()});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use user preference for number of entries to show
|
||||||
*/
|
*/
|
||||||
function getNumEntriesPreference(data) {
|
function getNumEntriesPreference(data) {
|
||||||
var numEntries = data.libraryInit.numEntries;
|
return parseInt(data.libraryInit.numEntries);
|
||||||
if(numEntries == '') {
|
|
||||||
numEntries = '10';
|
|
||||||
}
|
|
||||||
return parseInt(numEntries);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createDataTable(data) {
|
function createDataTable(data) {
|
||||||
var dTable = $('#library_display').dataTable( {
|
var dTable = $('#library_display').dataTable( {
|
||||||
"bProcessing": true,
|
"bProcessing": true,
|
||||||
"bServerSide": true,
|
"bServerSide": true,
|
||||||
"sAjaxSource": "/Library/contents/format/json",
|
"sAjaxSource": "/Library/contents/format/json",
|
||||||
|
@ -320,35 +326,24 @@ function createDataTable(data) {
|
||||||
"sPaginationType": "full_numbers",
|
"sPaginationType": "full_numbers",
|
||||||
"bJQueryUI": true,
|
"bJQueryUI": true,
|
||||||
"bAutoWidth": false,
|
"bAutoWidth": false,
|
||||||
"oLanguage": {
|
"oLanguage": {
|
||||||
"sSearch": ""
|
"sSearch": ""
|
||||||
},
|
},
|
||||||
"iDisplayLength": getNumEntriesPreference(data),
|
"iDisplayLength": getNumEntriesPreference(data),
|
||||||
"bStateSave": true
|
"bStateSave": true
|
||||||
});
|
});
|
||||||
dTable.fnSetFilteringDelay(350);
|
dTable.fnSetFilteringDelay(350);
|
||||||
|
|
||||||
// Updates pref db when user changes the # of entries to show
|
|
||||||
$('select[name=library_display_length]').change(function() {
|
|
||||||
var url = '/Library/set-num-entries/format/json';
|
|
||||||
$.post(url, {numEntries: $(this).val()},
|
|
||||||
function(json){
|
|
||||||
if(json.error) {
|
|
||||||
alert(json.error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('.tabs').tabs();
|
$('.tabs').tabs();
|
||||||
|
|
||||||
$.ajax({ url: "/Api/library-init/format/json", dataType:"json", success:createDataTable
|
$.ajax({ url: "/Api/library-init/format/json", dataType:"json", success:createDataTable,
|
||||||
, error:function(jqXHR, textStatus, errorThrown){}});
|
error:function(jqXHR, textStatus, errorThrown){}});
|
||||||
|
|
||||||
checkImportStatus()
|
checkImportStatus()
|
||||||
setInterval( "checkImportStatus()", 5000 );
|
setInterval( "checkImportStatus()", 5000 );
|
||||||
setInterval( "checkSCUploadStatus()", 5000 );
|
setInterval( "checkSCUploadStatus()", 5000 );
|
||||||
|
|
||||||
addQtipToSCIcons()
|
addQtipToSCIcons()
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue