diff --git a/airtime_mvc/public/js/airtime/dashboard/dashboard.js b/airtime_mvc/public/js/airtime/dashboard/dashboard.js index 759f458a4..7e0770bc0 100644 --- a/airtime_mvc/public/js/airtime/dashboard/dashboard.js +++ b/airtime_mvc/public/js/airtime/dashboard/dashboard.js @@ -48,20 +48,12 @@ function secondsTimer(){ function newSongStart(){ nextSongPrepare = true; currentSong = nextSong; - nextSong = null; - - if (typeof notifySongStart == "function") - notifySongStart(); - + nextSong = null; } function nextShowStart(){ nextShowPrepare = true; currentShow[0] = nextShow.shift(); - - //call function in nowplayingdatagrid.js - if (typeof notifyShowStart == "function") - notifyShowStart(currentShow[0]); } /* Called every "uiUpdateInterval" mseconds. */ @@ -78,18 +70,16 @@ function updateProgressBarValue(){ $('#progress-show').attr("style", "width:"+showPercentDone+"%"); var songPercentDone = 0; - var songElapsedTime = 0; var scheduled_play_div = $("#scheduled_play_div"); var scheduled_play_line_to_switch = scheduled_play_div.parent().find(".line-to-switch"); - if (currentSong !== null){ + if (currentSong !== null){ songPercentDone = (estimatedSchedulePosixTime - currentSong.songStartPosixTime)/currentSong.songLengthMs*100; - songElapsedTime = estimatedSchedulePosixTime - currentSong.songStartPosixTime; if (songPercentDone < 0 || songPercentDone > 100){ songPercentDone = 0; currentSong = null; } else { - if ( (currentSong.media_item_played == true && currentShow.length > 0) || songElapsedTime < 5000 ){ + if (currentSong.media_item_played == true && currentShow.length > 0) { scheduled_play_line_to_switch.attr("class", "line-to-switch on"); scheduled_play_div.addClass("ready"); scheduled_play_source = true; diff --git a/airtime_mvc/public/js/airtime/nowplaying/nowplayingdatagrid.js b/airtime_mvc/public/js/airtime/nowplaying/nowplayingdatagrid.js deleted file mode 100644 index 2eea84acb..000000000 --- a/airtime_mvc/public/js/airtime/nowplaying/nowplayingdatagrid.js +++ /dev/null @@ -1,213 +0,0 @@ -var datagridData = null; -var currentShowInstanceID = -1; - -function getDateText(obj){ - var str = obj.aData[ obj.iDataColumn ].toString(); - datetime = str.split(" "); - if (datetime.length == 2) - return datetime[0]; - return str; -} - -function getTimeText(obj){ - var str = obj.aData[ obj.iDataColumn ].toString(); - datetime = str.split(" "); - if (datetime.length == 2) - return changeTimePrecision(datetime[1]); - return str; -} - -function changeTimePrecisionInit(obj){ - var str = obj.aData[ obj.iDataColumn ].toString(); - return changeTimePrecision(str); -} - -function changeTimePrecision(str){ - - var temp = str.split(".") - if (temp.length == 2){ - if (temp[1].length > 2) - return temp[0]+"."+temp[1].substr(0, 2); - } - return str; -} - -function notifySongStart(){ - for (var i=0; i 0) - currentShowInstanceID = datagridData.currentShow[0].instance_id; - updateDataTable(); - }}); -} - -function init2(){ - getData(); - - setTimeout(init2, 5000); -} - -function redirect(url){ - document.location.href = url; -} - -function createDataGrid(){ - - columns[1]["fnRender"] = getDateText; - columns[2]["fnRender"] = getTimeText; - columns[3]["fnRender"] = getTimeText; - columns[4]["fnRender"] = changeTimePrecisionInit; - - $('#nowplayingtable').dataTable( { - "bSort" : false, - "bJQueryUI": true, - "bFilter": false, - "bInfo": false, - "bLengthChange": false, - "bPaginate": false, - "aoColumns": columns, - "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { - //if (aData[aData.length-2] == currentShowInstanceID) - // $(nRow).addClass("playing-list"); - if (aData[0].indexOf("c") != -1) - $(nRow).attr("class", "playing-song"); - return nRow; - }, - "fnDrawCallback": function(oSettings){ - //check if there are any rows to display - if (oSettings.aiDisplay.length == 0) - return; - - var nTrs = $('#nowplayingtable tbody tr'); - var iColspan = nTrs[0].getElementsByTagName('td').length; - - for (var i=0; i