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() {
|
||||
$val = self::GetValue("calendar_time_scale", true /* user specific */);
|
||||
if(strlen($val) == 0) {
|
||||
$val = 'month';
|
||||
$val = "month";
|
||||
}
|
||||
return $val;
|
||||
}
|
||||
|
@ -590,9 +590,14 @@ class Application_Model_Preference
|
|||
|
||||
/**
|
||||
* Retrieves the number of entries to show preference in library under Playlist Builder.
|
||||
* Defaults to 10 if no entry exists
|
||||
*/
|
||||
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() {
|
||||
addLibraryItemEvents();
|
||||
addMetadataQtip();
|
||||
saveNumEntriesSetting();
|
||||
}
|
||||
|
||||
function addProgressIcon(id) {
|
||||
|
@ -280,19 +281,24 @@ function addMetadataQtip(){
|
|||
}
|
||||
|
||||
/**
|
||||
* Use user preference for number of entries to show;
|
||||
* defaults to 10 if preference was never set
|
||||
* Updates pref db when user changes the # of entries to show
|
||||
*/
|
||||
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) {
|
||||
var numEntries = data.libraryInit.numEntries;
|
||||
if(numEntries == '') {
|
||||
numEntries = '10';
|
||||
}
|
||||
return parseInt(numEntries);
|
||||
return parseInt(data.libraryInit.numEntries);
|
||||
}
|
||||
|
||||
function createDataTable(data) {
|
||||
var dTable = $('#library_display').dataTable( {
|
||||
var dTable = $('#library_display').dataTable( {
|
||||
"bProcessing": true,
|
||||
"bServerSide": true,
|
||||
"sAjaxSource": "/Library/contents/format/json",
|
||||
|
@ -320,35 +326,24 @@ function createDataTable(data) {
|
|||
"sPaginationType": "full_numbers",
|
||||
"bJQueryUI": true,
|
||||
"bAutoWidth": false,
|
||||
"oLanguage": {
|
||||
"sSearch": ""
|
||||
},
|
||||
"iDisplayLength": getNumEntriesPreference(data),
|
||||
"bStateSave": true
|
||||
});
|
||||
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);
|
||||
}
|
||||
});
|
||||
});
|
||||
"oLanguage": {
|
||||
"sSearch": ""
|
||||
},
|
||||
"iDisplayLength": getNumEntriesPreference(data),
|
||||
"bStateSave": true
|
||||
});
|
||||
dTable.fnSetFilteringDelay(350);
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('.tabs').tabs();
|
||||
|
||||
$.ajax({ url: "/Api/library-init/format/json", dataType:"json", success:createDataTable
|
||||
, error:function(jqXHR, textStatus, errorThrown){}});
|
||||
|
||||
checkImportStatus()
|
||||
setInterval( "checkImportStatus()", 5000 );
|
||||
setInterval( "checkSCUploadStatus()", 5000 );
|
||||
|
||||
addQtipToSCIcons()
|
||||
$('.tabs').tabs();
|
||||
|
||||
$.ajax({ url: "/Api/library-init/format/json", dataType:"json", success:createDataTable,
|
||||
error:function(jqXHR, textStatus, errorThrown){}});
|
||||
|
||||
checkImportStatus()
|
||||
setInterval( "checkImportStatus()", 5000 );
|
||||
setInterval( "checkSCUploadStatus()", 5000 );
|
||||
|
||||
addQtipToSCIcons()
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue