diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index 2b3850b6f..368e6e3cd 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -42,8 +42,9 @@ class ApiController extends Zend_Controller_Action ->addActionContext('reload-metadata-group' , 'json') ->addActionContext('notify-webstream-data' , 'json') ->addActionContext('get-stream-parameters' , 'json') - ->addActionContext('push-stream-stats' , 'json') - ->addActionContext('update-stream-setting-table' , 'json') + ->addActionContext('push-stream-stats' , 'json') + ->addActionContext('update-stream-setting-table' , 'json') + ->addActionContext('update-replay-gain-value' , 'json') ->initContext(); } @@ -947,10 +948,6 @@ class ApiController extends Zend_Controller_Action public function updateReplayGainValueAction() { - // disable layout - $this->view->layout()->disableLayout(); - $this->_helper->viewRenderer->setNoRender(true); - $request = $this->getRequest(); $data = json_decode($request->getParam('data')); @@ -961,6 +958,8 @@ class ApiController extends Zend_Controller_Action $file->setDbReplayGain($gain); $file->save(); } + + $this->view->msg = "OK"; } public function updateCueValuesBySilanAction() diff --git a/airtime_mvc/locale/el_GR/LC_MESSAGES/airtime.mo b/airtime_mvc/locale/el_GR/LC_MESSAGES/airtime.mo index 98a3e9ae6..81ea07d40 100644 Binary files a/airtime_mvc/locale/el_GR/LC_MESSAGES/airtime.mo and b/airtime_mvc/locale/el_GR/LC_MESSAGES/airtime.mo differ diff --git a/airtime_mvc/locale/el_GR/LC_MESSAGES/airtime.po b/airtime_mvc/locale/el_GR/LC_MESSAGES/airtime.po index d1e21abc7..ee90431eb 100644 --- a/airtime_mvc/locale/el_GR/LC_MESSAGES/airtime.po +++ b/airtime_mvc/locale/el_GR/LC_MESSAGES/airtime.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Airtime 2.3\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2013-02-07 16:22-0500\n" -"PO-Revision-Date: 2013-02-08 11:13+0100\n" +"PO-Revision-Date: 2013-02-14 17:18+0100\n" "Last-Translator: Daniel James \n" "Language-Team: Greek Localization \n" "Language: el_GR\n" @@ -2867,7 +2867,7 @@ msgstr "Εμφάνιση Πηγής " #: airtime_mvc/application/views/scripts/partialviews/header.phtml:45 msgid "Scheduled Play" -msgstr "Προγραμματισμένη Αναπαραγωγή" +msgstr "Πρόγραμμα" #: airtime_mvc/application/views/scripts/partialviews/header.phtml:54 msgid "ON AIR" diff --git a/airtime_mvc/public/js/airtime/dashboard/dashboard.js b/airtime_mvc/public/js/airtime/dashboard/dashboard.js index 3b2cad458..38d357523 100644 --- a/airtime_mvc/public/js/airtime/dashboard/dashboard.js +++ b/airtime_mvc/public/js/airtime/dashboard/dashboard.js @@ -360,13 +360,15 @@ function controlSwitchLight(){ } function getScheduleFromServer(){ - $.ajax({ url: baseUrl+"Schedule/get-current-playlist/format/json", dataType:"json", success:function(data){ + $.ajax({ url: baseUrl+"Schedule/get-current-playlist/format/json", + dataType:"json", + success:function(data){ parseItems(data.entries); parseSourceStatus(data.source_status); parseSwitchStatus(data.switch_status); showName = data.show_name; + setTimeout(getScheduleFromServer, serverUpdateInterval); }, error:function(jqXHR, textStatus, errorThrown){}}); - setTimeout(getScheduleFromServer, serverUpdateInterval); } function setupQtip(){ diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index 3c29baeda..89a03a90f 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -511,9 +511,11 @@ var AIRTIME = (function(AIRTIME) { }, "fnStateLoad": function fnLibStateLoad(oSettings) { var settings = localStorage.getItem('datatables-library'); - - if (settings !== "") { + + try { return JSON.parse(settings); + } catch (e) { + return null; } }, "fnStateLoadParams": function (oSettings, oData) { @@ -521,18 +523,22 @@ var AIRTIME = (function(AIRTIME) { length, a = oData.abVisCols; - // putting serialized data back into the correct js type to make - // sure everything works properly. - for (i = 0, length = a.length; i < length; i++) { - if (typeof(a[i]) === "string") { - a[i] = (a[i] === "true") ? true : false; - } + if (a) { + // putting serialized data back into the correct js type to make + // sure everything works properly. + for (i = 0, length = a.length; i < length; i++) { + if (typeof(a[i]) === "string") { + a[i] = (a[i] === "true") ? true : false; + } + } } - + a = oData.ColReorder; - for (i = 0, length = a.length; i < length; i++) { - if (typeof(a[i]) === "string") { - a[i] = parseInt(a[i], 10); + if (a) { + for (i = 0, length = a.length; i < length; i++) { + if (typeof(a[i]) === "string") { + a[i] = parseInt(a[i], 10); + } } } @@ -842,8 +848,7 @@ var AIRTIME = (function(AIRTIME) { }); checkImportStatus(); - setInterval(checkImportStatus, 5000); - setInterval(checkLibrarySCUploadStatus, 5000); + checkLibrarySCUploadStatus(); addQtipToSCIcons(); @@ -1071,6 +1076,7 @@ function checkImportStatus() { } div.hide(); } + setTimeout(checkImportStatus, 5000); }); } @@ -1104,6 +1110,7 @@ function checkLibrarySCUploadStatus(){ else if (json.sc_id == "-3") { span.removeClass("progress").addClass("sc-error"); } + setTimeout(checkLibrarySCUploadStatus, 5000); } function checkSCUploadStatusRequest() { diff --git a/airtime_mvc/public/js/airtime/preferences/streamsetting.js b/airtime_mvc/public/js/airtime/preferences/streamsetting.js index 0fdd82f2c..5399ed2d0 100644 --- a/airtime_mvc/public/js/airtime/preferences/streamsetting.js +++ b/airtime_mvc/public/js/airtime/preferences/streamsetting.js @@ -102,6 +102,8 @@ function checkLiquidsoapStatus(){ } $("#s"+id+"Liquidsoap-error-msg-element").html(html); } + + setTimeout(checkLiquidsoapStatus, 2000); }); } @@ -241,10 +243,10 @@ function setupEventListeners() { return false; }) - setLiveSourceConnectionOverrideListener() + setLiveSourceConnectionOverrideListener(); - showErrorSections() - setInterval('checkLiquidsoapStatus()', 1000) + showErrorSections(); + checkLiquidsoapStatus(); // qtip for help text $(".override_help_icon").qtip({ diff --git a/airtime_mvc/public/js/airtime/schedule/add-show.js b/airtime_mvc/public/js/airtime/schedule/add-show.js index 4f33ccdc7..a1f053699 100644 --- a/airtime_mvc/public/js/airtime/schedule/add-show.js +++ b/airtime_mvc/public/js/airtime/schedule/add-show.js @@ -406,10 +406,9 @@ function setAddShowEvents() { event.stopPropagation(); event.preventDefault(); - $("#schedule_calendar").removeAttr("style") - .fullCalendar('render'); - $("#add-show-form").hide(); + windowResize(); + $.get(baseUrl+"Schedule/get-form", {format:"json"}, function(json){ $("#add-show-form") .empty() @@ -652,13 +651,14 @@ function windowResize() { var calendarWidth = 100-(($("#schedule-add-show").width() + (16 * 4))/windowWidth*100); var widthPercent = parseInt(calendarWidth)+"%"; $("#schedule_calendar").css("width", widthPercent); + } else { + $("#schedule_calendar").css("width", 98.5+"%"); } // 200 px for top dashboard and 50 for padding on main content // this calculation was copied from schedule.js line 326 var mainHeight = document.documentElement.clientHeight - 200 - 50; - $('#schedule_calendar').fullCalendar('option', 'contentHeight', mainHeight) - $("#schedule_calendar").fullCalendar('render'); + $('#schedule_calendar').fullCalendar('option', 'contentHeight', mainHeight); } diff --git a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js index 192d811fe..4fa3c81fd 100644 --- a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js +++ b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js @@ -28,7 +28,11 @@ function openAddShowForm() { var calendarWidth = 100-(($("#schedule-add-show").width() + (16 * 4))/windowWidth*100); var widthPercent = parseInt(calendarWidth)+"%"; $("#schedule_calendar").css("width", widthPercent); - $("#schedule_calendar").fullCalendar('render'); + + // 200 px for top dashboard and 50 for padding on main content + // this calculation was copied from schedule.js line 326 + var mainHeight = document.documentElement.clientHeight - 200 - 50; + $('#schedule_calendar').fullCalendar('option', 'contentHeight', mainHeight); } $("#schedule-show-what").show(0, function(){ $add_show_name = $("#add_show_name"); @@ -372,6 +376,7 @@ function checkSCUploadStatus(){ }else if(json.sc_id == "-3"){ $("span[id="+id+"]:not(.recording)").removeClass("progress").addClass("sc-error"); } + setTimeout(checkSCUploadStatus, 5000); }); }); } @@ -424,6 +429,7 @@ function getCurrentShow(){ $(this).remove("span[small-icon now-playing]"); } }); + setTimeout(getCurrentShow, 5000); }); } @@ -564,8 +570,8 @@ function alertShowErrorAndReload(){ preloadEventFeed(); $(document).ready(function(){ - setInterval( "checkSCUploadStatus()", 5000 ); - setInterval( "getCurrentShow()", 5000 ); + checkSCUploadStatus(); + getCurrentShow(); }); var view_name; diff --git a/airtime_mvc/public/js/airtime/schedule/schedule.js b/airtime_mvc/public/js/airtime/schedule/schedule.js index d31cbb1c3..57dc8def5 100644 --- a/airtime_mvc/public/js/airtime/schedule/schedule.js +++ b/airtime_mvc/public/js/airtime/schedule/schedule.js @@ -93,6 +93,8 @@ function checkCalendarSCUploadStatus(){ else if (json.sc_id == "-3") { span.removeClass("progress").addClass("sc-error"); } + + setTimeout(checkCalendarSCUploadStatus, 5000); } function checkSCUploadStatusRequest() { @@ -328,7 +330,7 @@ function alertShowErrorAndReload(){ } $(document).ready(function() { - setInterval(checkCalendarSCUploadStatus, 5000); + checkCalendarSCUploadStatus(); $.contextMenu({ selector: 'div.fc-event', diff --git a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js index 214bc9714..ee19e85fd 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js @@ -86,7 +86,7 @@ AIRTIME = (function(AIRTIME) { .end(); oTable = $('#show_builder_table').dataTable(); - oTable.fnDraw(); + //oTable.fnDraw(); } } @@ -277,12 +277,13 @@ AIRTIME = (function(AIRTIME) { if (json.update === true) { oTable.fnDraw(); } + setTimeout(checkScheduleUpdates, 5000); } }); } //check if the timeline view needs updating. - setInterval(checkScheduleUpdates, 5 * 1000); //need refresh in milliseconds + checkScheduleUpdates(); }; mod.onResize = function() { diff --git a/airtime_mvc/public/js/airtime/status/status.js b/airtime_mvc/public/js/airtime/status/status.js index 9b5e4d3ea..ef3358e7a 100644 --- a/airtime_mvc/public/js/airtime/status/status.js +++ b/airtime_mvc/public/js/airtime/status/status.js @@ -66,6 +66,7 @@ function success(data, textStatus, jqXHR){ if (data.status.partitions){ generatePartitions(data.status.partitions); } + setTimeout(function(){updateStatus(false);}, 5000); } function updateStatus(getDiskInfo){ @@ -75,5 +76,4 @@ function updateStatus(getDiskInfo){ $(document).ready(function() { updateStatus(true); - setInterval(function(){updateStatus(false);}, 5000); }); diff --git a/airtime_mvc/public/js/datatables/js/jquery.dataTables.js b/airtime_mvc/public/js/datatables/js/jquery.dataTables.js index ab61ea58e..02694a4a5 100644 --- a/airtime_mvc/public/js/datatables/js/jquery.dataTables.js +++ b/airtime_mvc/public/js/datatables/js/jquery.dataTables.js @@ -1,12 +1,10 @@ -/** - * @summary DataTables - * @description Paginate, search and sort HTML tables - * @version 1.9.1 - * @file jquery.dataTables.js - * @author Allan Jardine (www.sprymedia.co.uk) - * @contact www.sprymedia.co.uk/contact - * - * @copyright Copyright 2008-2012 Allan Jardine, all rights reserved. +/* + * File: jquery.dataTables.min.js + * Version: 1.9.4 + * Author: Allan Jardine (www.sprymedia.co.uk) + * Info: www.datatables.net + * + * Copyright 2008-2012 Allan Jardine, all rights reserved. * * This source file is free software, under either the GPL v2 license or a * BSD style license, available at: @@ -16,11823 +14,142 @@ * This source file is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. - * - * For details please refer to: http://www.datatables.net */ - -/*jslint evil: true, undef: true, browser: true */ -/*globals $, jQuery,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnReOrderIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnJsonString,_fnRender,_fnNodeToColumnIndex,_fnInfoMacros*/ - -(/** @lends */function($, window, document, undefined) { - /** - * DataTables is a plug-in for the jQuery Javascript library. It is a - * highly flexible tool, based upon the foundations of progressive - * enhancement, which will add advanced interaction controls to any - * HTML table. For a full list of features please refer to - * DataTables.net. - * - * Note that the DataTable object is not a global variable but is - * aliased to jQuery.fn.DataTable and jQuery.fn.dataTable through which - * it may be accessed. - * - * @class - * @param {object} [oInit={}] Configuration object for DataTables. Options - * are defined by {@link DataTable.defaults} - * @requires jQuery 1.3+ - * - * @example - * // Basic initialisation - * $(document).ready( function { - * $('#example').dataTable(); - * } ); - * - * @example - * // Initialisation with configuration options - in this case, disable - * // pagination and sorting. - * $(document).ready( function { - * $('#example').dataTable( { - * "bPaginate": false, - * "bSort": false - * } ); - * } ); - */ - var DataTable = function( oInit ) - { - - - /** - * Add a column to the list used for the table with default values - * @param {object} oSettings dataTables settings object - * @param {node} nTh The th element for this column - * @memberof DataTable#oApi - */ - function _fnAddColumn( oSettings, nTh ) - { - var oDefaults = DataTable.defaults.columns; - var iCol = oSettings.aoColumns.length; - var oCol = $.extend( {}, DataTable.models.oColumn, oDefaults, { - "sSortingClass": oSettings.oClasses.sSortable, - "sSortingClassJUI": oSettings.oClasses.sSortJUI, - "nTh": nTh ? nTh : document.createElement('th'), - "sTitle": oDefaults.sTitle ? oDefaults.sTitle : nTh ? nTh.innerHTML : '', - "aDataSort": oDefaults.aDataSort ? oDefaults.aDataSort : [iCol], - "mDataProp": oDefaults.mDataProp ? oDefaults.oDefaults : iCol - } ); - oSettings.aoColumns.push( oCol ); - - /* Add a column specific filter */ - if ( oSettings.aoPreSearchCols[ iCol ] === undefined || oSettings.aoPreSearchCols[ iCol ] === null ) - { - oSettings.aoPreSearchCols[ iCol ] = $.extend( {}, DataTable.models.oSearch ); - } - else - { - var oPre = oSettings.aoPreSearchCols[ iCol ]; - - /* Don't require that the user must specify bRegex, bSmart or bCaseInsensitive */ - if ( oPre.bRegex === undefined ) - { - oPre.bRegex = true; - } - - if ( oPre.bSmart === undefined ) - { - oPre.bSmart = true; - } - - if ( oPre.bCaseInsensitive === undefined ) - { - oPre.bCaseInsensitive = true; - } - } - - /* Use the column options function to initialise classes etc */ - _fnColumnOptions( oSettings, iCol, null ); - } - - - /** - * Apply options for a column - * @param {object} oSettings dataTables settings object - * @param {int} iCol column index to consider - * @param {object} oOptions object with sType, bVisible and bSearchable - * @memberof DataTable#oApi - */ - function _fnColumnOptions( oSettings, iCol, oOptions ) - { - var oCol = oSettings.aoColumns[ iCol ]; - - /* User specified column options */ - if ( oOptions !== undefined && oOptions !== null ) - { - if ( oOptions.sType !== undefined ) - { - oCol.sType = oOptions.sType; - oCol._bAutoType = false; - } - - $.extend( oCol, oOptions ); - _fnMap( oCol, oOptions, "sWidth", "sWidthOrig" ); - - /* iDataSort to be applied (backwards compatibility), but aDataSort will take - * priority if defined - */ - if ( oOptions.iDataSort !== undefined ) - { - oCol.aDataSort = [ oOptions.iDataSort ]; - } - _fnMap( oCol, oOptions, "aDataSort" ); - } - - /* Cache the data get and set functions for speed */ - oCol.fnGetData = _fnGetObjectDataFn( oCol.mDataProp ); - oCol.fnSetData = _fnSetObjectDataFn( oCol.mDataProp ); - - /* Feature sorting overrides column specific when off */ - if ( !oSettings.oFeatures.bSort ) - { - oCol.bSortable = false; - } - - /* Check that the class assignment is correct for sorting */ - if ( !oCol.bSortable || - ($.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1) ) - { - oCol.sSortingClass = oSettings.oClasses.sSortableNone; - oCol.sSortingClassJUI = ""; - } - else if ( oCol.bSortable || - ($.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1) ) - { - oCol.sSortingClass = oSettings.oClasses.sSortable; - oCol.sSortingClassJUI = oSettings.oClasses.sSortJUI; - } - else if ( $.inArray('asc', oCol.asSorting) != -1 && $.inArray('desc', oCol.asSorting) == -1 ) - { - oCol.sSortingClass = oSettings.oClasses.sSortableAsc; - oCol.sSortingClassJUI = oSettings.oClasses.sSortJUIAscAllowed; - } - else if ( $.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) != -1 ) - { - oCol.sSortingClass = oSettings.oClasses.sSortableDesc; - oCol.sSortingClassJUI = oSettings.oClasses.sSortJUIDescAllowed; - } - } - - - /** - * Adjust the table column widths for new data. Note: you would probably want to - * do a redraw after calling this function! - * @param {object} oSettings dataTables settings object - * @memberof DataTable#oApi - */ - function _fnAdjustColumnSizing ( oSettings ) - { - /* Not interested in doing column width calculation if autowidth is disabled */ - if ( oSettings.oFeatures.bAutoWidth === false ) - { - return false; - } - - _fnCalculateColumnWidths( oSettings ); - for ( var i=0 , iLen=oSettings.aoColumns.length ; i