Merge branch 'devel' into 2.3.x-saas
Conflicts: airtime_mvc/application/controllers/PreferenceController.php airtime_mvc/application/forms/AddShowWhen.php airtime_mvc/application/forms/GeneralPreferences.php airtime_mvc/application/forms/LiveStreamingPreferences.php airtime_mvc/application/forms/SoundcloudPreferences.php airtime_mvc/application/forms/SupportSettings.php airtime_mvc/application/views/scripts/form/preferences.phtml airtime_mvc/application/views/scripts/form/preferences_email_server.phtml airtime_mvc/application/views/scripts/form/preferences_general.phtml airtime_mvc/application/views/scripts/form/preferences_livestream.phtml airtime_mvc/application/views/scripts/form/support-setting.phtml airtime_mvc/application/views/scripts/schedule/add- show-form.phtml airtime_mvc/public/js/airtime/preferences/preferences.js python_apps/api_clients/api_client.py python_apps/pypo/listenerstat.py
This commit is contained in:
commit
8cd6bd9aa4
346 changed files with 48955 additions and 11856 deletions
|
@ -75,8 +75,8 @@ function playAllPlaylist(p_playlistID, p_playlistIndex) {
|
|||
|
||||
if ( _idToPostionLookUp !== undefined && viewsPlaylistID == p_playlistID ) {
|
||||
play(p_playlistIndex);
|
||||
} else {
|
||||
buildplaylist("/audiopreview/get-playlist/playlistID/"+p_playlistID, p_playlistIndex);
|
||||
}else {
|
||||
buildplaylist(baseUrl+"audiopreview/get-playlist/playlistID/"+p_playlistID, p_playlistIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ function playBlock(p_blockId, p_blockIndex)
|
|||
if ( _idToPostionLookUp !== undefined && viewsBlockId == p_blockId ) {
|
||||
play(p_blockIndex);
|
||||
} else {
|
||||
buildplaylist("/audiopreview/get-block/blockId/"+p_blockId, p_blockIndex);
|
||||
buildplaylist(baseUrl+"audiopreview/get-block/blockId/"+p_blockId, p_blockIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ function playAllShow(p_showID, p_index) {
|
|||
if ( _idToPostionLookUp !== undefined && viewsShowID == p_showID ) {
|
||||
play(p_index);
|
||||
}else {
|
||||
buildplaylist("/audiopreview/get-show/showID/"+p_showID, p_index);
|
||||
buildplaylist(baseUrl+"audiopreview/get-show/showID/"+p_showID, p_index);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -124,6 +124,7 @@ function buildplaylist(p_url, p_playIndex) {
|
|||
var index;
|
||||
var total = 0;
|
||||
var skipped = 0;
|
||||
|
||||
for(index in data) {
|
||||
if (data[index]['type'] == 0) {
|
||||
if (data[index]['element_mp3'] != undefined){
|
||||
|
@ -220,7 +221,7 @@ function play(p_playlistIndex){
|
|||
*/
|
||||
function playOne(uri, mime) {
|
||||
var playlist = new Array();
|
||||
|
||||
|
||||
var media = null;
|
||||
var key = null;
|
||||
if (mime.search(/mp3/i) > 0 || mime.search(/mpeg/i) > 0) {
|
||||
|
|
|
@ -11,6 +11,35 @@ $(document).ready(function() {
|
|||
setTimeout(function(){$(".success").fadeOut("slow", function(){$(this).empty()});}, 5000);
|
||||
});
|
||||
|
||||
/*
|
||||
* i18n_months and i18n_days_short are used in jquery datepickers
|
||||
* which we use in multiple places
|
||||
*/
|
||||
var i18n_months = [
|
||||
$.i18n._("January"),
|
||||
$.i18n._("February"),
|
||||
$.i18n._("March"),
|
||||
$.i18n._("April"),
|
||||
$.i18n._("May"),
|
||||
$.i18n._("June"),
|
||||
$.i18n._("July"),
|
||||
$.i18n._("August"),
|
||||
$.i18n._("September"),
|
||||
$.i18n._("October"),
|
||||
$.i18n._("November"),
|
||||
$.i18n._("December")
|
||||
];
|
||||
|
||||
var i18n_days_short = [
|
||||
$.i18n._("Su"),
|
||||
$.i18n._("Mo"),
|
||||
$.i18n._("Tu"),
|
||||
$.i18n._("We"),
|
||||
$.i18n._("Th"),
|
||||
$.i18n._("Fr"),
|
||||
$.i18n._("Sa"),
|
||||
]
|
||||
|
||||
function adjustDateToServerDate(date, serverTimezoneOffset){
|
||||
//date object stores time in the browser's localtime. We need to artificially shift
|
||||
//it to
|
||||
|
@ -53,12 +82,10 @@ function open_audio_preview(type, id, audioFileTitle, audioFileArtist) {
|
|||
if(index != -1){
|
||||
audioFileTitle = audioFileTitle.substring(0,index);
|
||||
}
|
||||
|
||||
// The reason that we need to encode artist and title string is that
|
||||
// sometime they contain '/' or '\' and apache reject %2f or %5f
|
||||
// so the work around is to encode it twice.
|
||||
openPreviewWindow('audiopreview/audio-preview/audioFileID/'+id+'/audioFileArtist/'+encodeURIComponent(encodeURIComponent(audioFileArtist))+'/audioFileTitle/'+encodeURIComponent(encodeURIComponent(audioFileTitle))+'/type/'+type);
|
||||
|
||||
openPreviewWindow(baseUrl+'audiopreview/audio-preview/audioFileID/'+id+'/audioFileArtist/'+encodeURIComponent(encodeURIComponent(audioFileArtist))+'/audioFileTitle/'+encodeURIComponent(encodeURIComponent(audioFileTitle))+'/type/'+type);
|
||||
_preview_window.focus();
|
||||
}
|
||||
|
||||
|
@ -76,7 +103,7 @@ function open_playlist_preview(p_playlistID, p_playlistIndex) {
|
|||
if (_preview_window != null && !_preview_window.closed)
|
||||
_preview_window.playAllPlaylist(p_playlistID, p_playlistIndex);
|
||||
else
|
||||
openPreviewWindow('audiopreview/playlist-preview/playlistIndex/'+p_playlistIndex+'/playlistID/'+p_playlistID);
|
||||
openPreviewWindow(baseUrl+'audiopreview/playlist-preview/playlistIndex/'+p_playlistIndex+'/playlistID/'+p_playlistID);
|
||||
_preview_window.focus();
|
||||
}
|
||||
|
||||
|
@ -87,7 +114,7 @@ function open_block_preview(p_blockId, p_blockIndex) {
|
|||
if (_preview_window != null && !_preview_window.closed)
|
||||
_preview_window.playBlock(p_blockId, p_blockIndex);
|
||||
else
|
||||
openPreviewWindow('audiopreview/block-preview/blockIndex/'+p_blockIndex+'/blockId/'+p_blockId);
|
||||
openPreviewWindow(baseUrl+'audiopreview/block-preview/blockIndex/'+p_blockIndex+'/blockId/'+p_blockId);
|
||||
_preview_window.focus();
|
||||
}
|
||||
|
||||
|
@ -101,15 +128,21 @@ function open_show_preview(p_showID, p_showIndex) {
|
|||
if (_preview_window != null && !_preview_window.closed)
|
||||
_preview_window.playAllShow(p_showID, p_showIndex);
|
||||
else
|
||||
openPreviewWindow('audiopreview/show-preview/showID/'+p_showID+'/showIndex/'+p_showIndex);
|
||||
openPreviewWindow(baseUrl+'audiopreview/show-preview/showID/'+p_showID+'/showIndex/'+p_showIndex);
|
||||
_preview_window.focus();
|
||||
}
|
||||
|
||||
function openPreviewWindow(url) {
|
||||
_preview_window = window.open(url, 'Audio Player', 'width=450,height=100,scrollbars=yes');
|
||||
_preview_window = window.open(url, $.i18n._('Audio Player'), 'width=450,height=100,scrollbars=yes');
|
||||
return false;
|
||||
}
|
||||
|
||||
function pad(number, length) {
|
||||
return sprintf("%'0"+length+"d", number);
|
||||
}
|
||||
|
||||
function removeSuccessMsg() {
|
||||
var $status = $('.success');
|
||||
|
||||
$status.fadeOut("slow", function(){$status.empty()});
|
||||
}
|
||||
|
|
|
@ -143,24 +143,24 @@ function updatePlaybar(){
|
|||
}
|
||||
if (currentSong !== null && !master_dj_on_air && !live_dj_on_air){
|
||||
if (currentSong.record == "1")
|
||||
$('#current').html("<span style='color:red; font-weight:bold'>Recording: </span>"+currentSong.name+",");
|
||||
$('#current').html("<span style='color:red; font-weight:bold'>"+$.i18n._("Recording:")+"</span>"+currentSong.name+",");
|
||||
else
|
||||
$('#current').text(currentSong.name+",");
|
||||
}else{
|
||||
if (master_dj_on_air) {
|
||||
if (showName) {
|
||||
$('#current').html("Current: <span style='color:red; font-weight:bold'>"+showName+" - Master Stream</span>");
|
||||
$('#current').html($.i18n._("Current")+": <span style='color:red; font-weight:bold'>"+showName+" - "+$.i18n._("Master Stream")+"</span>");
|
||||
} else {
|
||||
$('#current').html("Current: <span style='color:red; font-weight:bold'>Master Stream</span>");
|
||||
$('#current').html($.i18n._("Current")+": <span style='color:red; font-weight:bold'>"+$.i18n._("Master Stream")+"</span>");
|
||||
}
|
||||
} else if (live_dj_on_air) {
|
||||
if (showName) {
|
||||
$('#current').html("Current: <span style='color:red; font-weight:bold'>"+showName+" - Live Stream</span>");
|
||||
$('#current').html($.i18n._("Current")+": <span style='color:red; font-weight:bold'>"+showName+" - "+$.i18n._("Live Stream")+"</span>");
|
||||
} else {
|
||||
$('#current').html("Current: <span style='color:red; font-weight:bold'>Live Stream</span>");
|
||||
$('#current').html($.i18n._("Current")+": <span style='color:red; font-weight:bold'>"+$.i18n._("Live Stream")+"</span>");
|
||||
}
|
||||
} else {
|
||||
$('#current').html("Current: <span style='color:red; font-weight:bold'>Nothing Scheduled</span>");
|
||||
$('#current').html($.i18n._("Current")+": <span style='color:red; font-weight:bold'>"+$.i18n._("Nothing Scheduled")+"</span>");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ function updatePlaybar(){
|
|||
$('#song-length').text(convertToHHMMSSmm(currentSong.songLengthMs));
|
||||
}
|
||||
/* Column 1 update */
|
||||
$('#playlist').text("Current Show:");
|
||||
$('#playlist').text($.i18n._("Current Show:"));
|
||||
var recElem = $('.recording-show');
|
||||
if (currentShow.length > 0){
|
||||
$('#playlist').text(currentShow[0].name);
|
||||
|
@ -360,7 +360,7 @@ function controlSwitchLight(){
|
|||
}
|
||||
|
||||
function getScheduleFromServer(){
|
||||
$.ajax({ url: "/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);
|
||||
|
@ -398,7 +398,7 @@ function setSwitchListener(ele){
|
|||
var sourcename = $(ele).attr('id');
|
||||
var status_span = $(ele).find("span");
|
||||
var status = status_span.html();
|
||||
$.get("/Dashboard/switch-source/format/json/sourcename/"+sourcename+"/status/"+status, function(data){
|
||||
$.get(baseUrl+"Dashboard/switch-source/format/json/sourcename/"+sourcename+"/status/"+status, function(data){
|
||||
if(data.error){
|
||||
alert(data.error);
|
||||
}else{
|
||||
|
@ -415,7 +415,7 @@ function setSwitchListener(ele){
|
|||
function kickSource(ele){
|
||||
var sourcename = $(ele).attr('id');
|
||||
|
||||
$.get("/Dashboard/disconnect-source/format/json/sourcename/"+sourcename, function(data){
|
||||
$.get(baseUrl+"Dashboard/disconnect-source/format/json/sourcename/"+sourcename, function(data){
|
||||
if(data.error){
|
||||
alert(data.error);
|
||||
}
|
||||
|
@ -441,7 +441,36 @@ function init() {
|
|||
});
|
||||
}
|
||||
|
||||
/* We never retrieve the user's password from the db
|
||||
* and when we call isValid($params) the form values are cleared
|
||||
* and repopulated with $params which does not have the password
|
||||
* field. Therefore, we fill the password field with 6 x's
|
||||
*/
|
||||
function setCurrentUserPseudoPassword() {
|
||||
$('#cu_password').val("xxxxxx");
|
||||
$('#cu_passwordVerify').val("xxxxxx");
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
if ($('#master-panel').length > 0)
|
||||
init();
|
||||
if ($('.errors').length === 0) {
|
||||
setCurrentUserPseudoPassword();
|
||||
}
|
||||
|
||||
$('#current-user').live('click', function() {
|
||||
$.ajax({
|
||||
url: baseUrl+'user/edit-user/format/json'
|
||||
});
|
||||
});
|
||||
|
||||
$('#cu_save_user').live('click', function() {
|
||||
$.cookie("airtime_locale", $('#cu_locale').val(), {path: '/'});
|
||||
});
|
||||
|
||||
// When the 'Listen' button is clicked we set the width
|
||||
// of the share button to the width of the 'Live Stream'
|
||||
// text. This differs depending on the language setting
|
||||
$('#popup-link').css('width', $('.jp-container h1').css('width'));
|
||||
|
||||
});
|
||||
|
|
|
@ -8,13 +8,13 @@ function getContent() {
|
|||
var msg = "";
|
||||
// See file airtime_mvc/application/views/helpers/VersionNotify.php for more info
|
||||
if(isUpToDate()) {
|
||||
msg = "You are running the latest version";
|
||||
msg = $.i18n._("You are running the latest version");
|
||||
} else if (diff < 20) {
|
||||
msg = "New version available: " + link;
|
||||
msg = $.i18n._("New version available: ") + link;
|
||||
} else if (diff < 30) {
|
||||
msg = "This version will soon be obsolete.<br/>Please upgrade to " + link;
|
||||
msg = $.i18n._("This version will soon be obsolete.")+"<br/>"+$.i18n._("Please upgrade to ") + link;
|
||||
} else {
|
||||
msg = "This version is no longer supported.<br/>Please upgrade to " + link;
|
||||
msg = $.i18n._("This version is no longer supported.")+"<br/>"+$.i18n._("Please upgrade to ") + link;
|
||||
}
|
||||
|
||||
return msg;
|
||||
|
|
|
@ -30,11 +30,11 @@ var AIRTIME = (function(AIRTIME) {
|
|||
var objType = $('#obj_type').val(),
|
||||
btnText;
|
||||
if (objType === 'playlist') {
|
||||
btnText = ' Add to current playlist';
|
||||
btnText = ' '+$.i18n._('Add to current playlist');
|
||||
} else if (objType === 'block') {
|
||||
btnText = ' Add to current smart block';
|
||||
btnText = ' '+$.i18n._('Add to current smart block');
|
||||
} else {
|
||||
btnText = ' Add to current playlist';
|
||||
btnText = ' '+$.i18n._('Add to current playlist');
|
||||
}
|
||||
AIRTIME.library.changeAddButtonText($('.btn-group #library-plus #lib-plus-text'), btnText);
|
||||
};
|
||||
|
@ -86,9 +86,9 @@ var AIRTIME = (function(AIRTIME) {
|
|||
}
|
||||
|
||||
if (selected === 1) {
|
||||
message = "Adding 1 Item.";
|
||||
message = $.i18n._("Adding 1 Item");
|
||||
} else {
|
||||
message = "Adding " + selected + " Items.";
|
||||
message = sprintf($.i18n._("Adding %s Items"), selected);
|
||||
}
|
||||
|
||||
container = $('<div class="helper"/>').append(
|
||||
|
@ -158,9 +158,9 @@ var AIRTIME = (function(AIRTIME) {
|
|||
undefined, 'after');
|
||||
} else {
|
||||
if ($('#obj_type').val() == 'block') {
|
||||
alert('You can only add tracks to smart blocks.');
|
||||
alert($.i18n._('You can only add tracks to smart blocks.'));
|
||||
} else if ($('#obj_type').val() == 'playlist') {
|
||||
alert('You can only add tracks, smart blocks, and webstreams to playlists.');
|
||||
alert($.i18n._('You can only add tracks, smart blocks, and webstreams to playlists.'));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -21,7 +21,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
AIRTIME.button.disableButton("btn-group #library-plus", false);
|
||||
}
|
||||
|
||||
AIRTIME.library.changeAddButtonText($('.btn-group #library-plus #lib-plus-text'), ' Add to selected show');
|
||||
AIRTIME.library.changeAddButtonText($('.btn-group #library-plus #lib-plus-text'), ' '+$.i18n._('Add to selected show'));
|
||||
};
|
||||
|
||||
mod.fnRowCallback = function(nRow, aData, iDisplayIndex, iDisplayIndexFull) {
|
||||
|
@ -66,9 +66,9 @@ var AIRTIME = (function(AIRTIME) {
|
|||
}
|
||||
|
||||
if (selected === 1) {
|
||||
message = "Adding 1 Item.";
|
||||
message = $.i18n._("Adding 1 Item");
|
||||
} else {
|
||||
message = "Adding " + selected + " Items.";
|
||||
message = sprintf($.i18n._("Adding %s Items"), selected);
|
||||
}
|
||||
|
||||
container = $('<div/>').attr('id',
|
||||
|
@ -113,7 +113,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
}
|
||||
|
||||
if (aSchedIds.length == 0) {
|
||||
alert("Please select a cursor position on timeline.");
|
||||
alert($.i18n._("Please select a cursor position on timeline."));
|
||||
return false;
|
||||
}
|
||||
console.log(aMediaIds);
|
||||
|
|
|
@ -109,12 +109,12 @@ var AIRTIME = (function(AIRTIME) {
|
|||
$menu
|
||||
.append("<div class='btn-group'>" +
|
||||
"<button class='btn btn-small dropdown-toggle' data-toggle='dropdown'>" +
|
||||
"Select <span class='caret'></span>" +
|
||||
$.i18n._("Select")+" <span class='caret'></span>" +
|
||||
"</button>" +
|
||||
"<ul class='dropdown-menu'>" +
|
||||
"<li id='sb-select-page'><a href='#'>Select this page</a></li>" +
|
||||
"<li id='sb-dselect-page'><a href='#'>Deselect this page</a></li>" +
|
||||
"<li id='sb-dselect-all'><a href='#'>Deselect all</a></li>" +
|
||||
"<li id='sb-select-page'><a href='#'>"+$.i18n._("Select this page")+"</a></li>" +
|
||||
"<li id='sb-dselect-page'><a href='#'>"+$.i18n._("Deselect this page")+"</a></li>" +
|
||||
"<li id='sb-dselect-all'><a href='#'>"+$.i18n._("Deselect all")+"</a></li>" +
|
||||
"</ul>" +
|
||||
"</div>")
|
||||
.append("<div class='btn-group'>" +
|
||||
|
@ -310,7 +310,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
mod.fnDeleteItems = function(aMedia) {
|
||||
|
||||
$.post("/library/delete",
|
||||
$.post(baseUrl+"library/delete",
|
||||
{"format": "json", "media": aMedia},
|
||||
function(json){
|
||||
if (json.message !== undefined) {
|
||||
|
@ -322,7 +322,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
};
|
||||
|
||||
mod.fnDeleteSelectedItems = function() {
|
||||
if (confirm('Are you sure you want to delete the selected item(s)?')) {
|
||||
if (confirm($.i18n._('Are you sure you want to delete the selected item(s)?'))) {
|
||||
var aData = AIRTIME.library.getSelectedData(),
|
||||
item,
|
||||
temp,
|
||||
|
@ -439,32 +439,33 @@ var AIRTIME = (function(AIRTIME) {
|
|||
/* ftype */ { "sTitle" : "" , "mDataProp" : "ftype" , "bSearchable" : false , "bVisible" : false } ,
|
||||
/* Checkbox */ { "sTitle" : "" , "mDataProp" : "checkbox" , "bSortable" : false , "bSearchable" : false , "sWidth" : "25px" , "sClass" : "library_checkbox" } ,
|
||||
/* Type */ { "sTitle" : "" , "mDataProp" : "image" , "bSearchable" : false , "sWidth" : "25px" , "sClass" : "library_type" , "iDataSort" : 0 } ,
|
||||
/* Title */ { "sTitle" : "Title" , "mDataProp" : "track_title" , "sClass" : "library_title" , "sWidth" : "170px" } ,
|
||||
/* Creator */ { "sTitle" : "Creator" , "mDataProp" : "artist_name" , "sClass" : "library_creator" , "sWidth" : "160px" } ,
|
||||
/* Album */ { "sTitle" : "Album" , "mDataProp" : "album_title" , "sClass" : "library_album" , "sWidth" : "150px" } ,
|
||||
/* Bit Rate */ { "sTitle" : "Bit Rate" , "mDataProp" : "bit_rate" , "bVisible" : false , "sClass" : "library_bitrate" , "sWidth" : "80px" },
|
||||
/* BPM */ { "sTitle" : "BPM" , "mDataProp" : "bpm" , "bVisible" : false , "sClass" : "library_bpm" , "sWidth" : "50px" },
|
||||
/* Composer */ { "sTitle" : "Composer" , "mDataProp" : "composer" , "bVisible" : false , "sClass" : "library_composer" , "sWidth" : "150px" },
|
||||
/* Conductor */ { "sTitle" : "Conductor" , "mDataProp" : "conductor" , "bVisible" : false , "sClass" : "library_conductor" , "sWidth" : "125px" },
|
||||
/* Copyright */ { "sTitle" : "Copyright" , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "sWidth" : "125px" },
|
||||
/* Encoded */ { "sTitle" : "Encoded By" , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" },
|
||||
/* Genre */ { "sTitle" : "Genre" , "mDataProp" : "genre" , "bVisible" : false , "sClass" : "library_genre" , "sWidth" : "100px" },
|
||||
/* ISRC Number */ { "sTitle" : "ISRC" , "mDataProp" : "isrc_number" , "bVisible" : false , "sClass" : "library_isrc" , "sWidth" : "150px" },
|
||||
/* Label */ { "sTitle" : "Label" , "mDataProp" : "label" , "bVisible" : false , "sClass" : "library_label" , "sWidth" : "125px" },
|
||||
/* Language */ { "sTitle" : "Language" , "mDataProp" : "language" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" },
|
||||
/* Last Modified */ { "sTitle" : "Last Modified" , "mDataProp" : "mtime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
|
||||
/* Last Played */ { "sTitle" : "Last Played " , "mDataProp" : "lptime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
|
||||
/* Length */ { "sTitle" : "Length" , "mDataProp" : "length" , "sClass" : "library_length" , "sWidth" : "80px" } ,
|
||||
/* Mime */ { "sTitle" : "Mime" , "mDataProp" : "mime" , "bVisible" : false , "sClass" : "library_mime" , "sWidth" : "80px" },
|
||||
/* Mood */ { "sTitle" : "Mood" , "mDataProp" : "mood" , "bVisible" : false , "sClass" : "library_mood" , "sWidth" : "70px" },
|
||||
/* Owner */ { "sTitle" : "Owner" , "mDataProp" : "owner_id" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" },
|
||||
/* Replay Gain */ { "sTitle" : "Replay Gain" , "mDataProp" : "replay_gain" , "bVisible" : false , "sClass" : "library_replay_gain" , "sWidth" : "80px" },
|
||||
/* Sample Rate */ { "sTitle" : "Sample Rate" , "mDataProp" : "sample_rate" , "bVisible" : false , "sClass" : "library_sr" , "sWidth" : "80px" },
|
||||
/* Track Number */ { "sTitle" : "Track Number" , "mDataProp" : "track_number" , "bVisible" : false , "sClass" : "library_track" , "sWidth" : "65px" },
|
||||
/* Upload Time */ { "sTitle" : "Uploaded" , "mDataProp" : "utime" , "sClass" : "library_upload_time" , "sWidth" : "125px" } ,
|
||||
/* Website */ { "sTitle" : "Website" , "mDataProp" : "info_url" , "bVisible" : false , "sClass" : "library_url" , "sWidth" : "150px" },
|
||||
/* Year */ { "sTitle" : "Year" , "mDataProp" : "year" , "bVisible" : false , "sClass" : "library_year" , "sWidth" : "60px" }
|
||||
/* Title */ { "sTitle" : $.i18n._("Title") , "mDataProp" : "track_title" , "sClass" : "library_title" , "sWidth" : "170px" } ,
|
||||
/* Creator */ { "sTitle" : $.i18n._("Creator") , "mDataProp" : "artist_name" , "sClass" : "library_creator" , "sWidth" : "160px" } ,
|
||||
/* Album */ { "sTitle" : $.i18n._("Album") , "mDataProp" : "album_title" , "sClass" : "library_album" , "sWidth" : "150px" } ,
|
||||
/* Bit Rate */ { "sTitle" : $.i18n._("Bit Rate") , "mDataProp" : "bit_rate" , "bVisible" : false , "sClass" : "library_bitrate" , "sWidth" : "80px" },
|
||||
/* BPM */ { "sTitle" : $.i18n._("BPM") , "mDataProp" : "bpm" , "bVisible" : false , "sClass" : "library_bpm" , "sWidth" : "50px" },
|
||||
/* Composer */ { "sTitle" : $.i18n._("Composer") , "mDataProp" : "composer" , "bVisible" : false , "sClass" : "library_composer" , "sWidth" : "150px" },
|
||||
/* Conductor */ { "sTitle" : $.i18n._("Conductor") , "mDataProp" : "conductor" , "bVisible" : false , "sClass" : "library_conductor" , "sWidth" : "125px" },
|
||||
/* Copyright */ { "sTitle" : $.i18n._("Copyright") , "mDataProp" : "copyright" , "bVisible" : false , "sClass" : "library_copyright" , "sWidth" : "125px" },
|
||||
/* Encoded */ { "sTitle" : $.i18n._("Encoded By") , "mDataProp" : "encoded_by" , "bVisible" : false , "sClass" : "library_encoded" , "sWidth" : "150px" },
|
||||
/* Genre */ { "sTitle" : $.i18n._("Genre") , "mDataProp" : "genre" , "bVisible" : false , "sClass" : "library_genre" , "sWidth" : "100px" },
|
||||
/* ISRC Number */ { "sTitle" : $.i18n._("ISRC") , "mDataProp" : "isrc_number" , "bVisible" : false , "sClass" : "library_isrc" , "sWidth" : "150px" },
|
||||
/* Label */ { "sTitle" : $.i18n._("Label") , "mDataProp" : "label" , "bVisible" : false , "sClass" : "library_label" , "sWidth" : "125px" },
|
||||
/* Language */ { "sTitle" : $.i18n._("Language") , "mDataProp" : "language" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" },
|
||||
/* Last Modified */ { "sTitle" : $.i18n._("Last Modified") , "mDataProp" : "mtime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
|
||||
/* Last Played */ { "sTitle" : $.i18n._("Last Played") , "mDataProp" : "lptime" , "bVisible" : false , "sClass" : "library_modified_time" , "sWidth" : "125px" },
|
||||
/* Length */ { "sTitle" : $.i18n._("Length") , "mDataProp" : "length" , "sClass" : "library_length" , "sWidth" : "80px" } ,
|
||||
/* Mime */ { "sTitle" : $.i18n._("Mime") , "mDataProp" : "mime" , "bVisible" : false , "sClass" : "library_mime" , "sWidth" : "80px" },
|
||||
/* Mood */ { "sTitle" : $.i18n._("Mood") , "mDataProp" : "mood" , "bVisible" : false , "sClass" : "library_mood" , "sWidth" : "70px" },
|
||||
/* Owner */ { "sTitle" : $.i18n._("Owner") , "mDataProp" : "owner_id" , "bVisible" : false , "sClass" : "library_language" , "sWidth" : "125px" },
|
||||
/* Replay Gain */ { "sTitle" : $.i18n._("Replay Gain") , "mDataProp" : "replay_gain" , "bVisible" : false , "sClass" : "library_replay_gain" , "sWidth" : "80px" },
|
||||
/* Sample Rate */ { "sTitle" : $.i18n._("Sample Rate") , "mDataProp" : "sample_rate" , "bVisible" : false , "sClass" : "library_sr" , "sWidth" : "80px" },
|
||||
/* Track Number */ { "sTitle" : $.i18n._("Track Number") , "mDataProp" : "track_number" , "bVisible" : false , "sClass" : "library_track" , "sWidth" : "65px" },
|
||||
/* Upload Time */ { "sTitle" : $.i18n._("Uploaded") , "mDataProp" : "utime" , "sClass" : "library_upload_time" , "sWidth" : "125px" } ,
|
||||
/* Website */ { "sTitle" : $.i18n._("Website") , "mDataProp" : "info_url" , "bVisible" : false , "sClass" : "library_url" , "sWidth" : "150px" },
|
||||
/* Year */ { "sTitle" : $.i18n._("Year") , "mDataProp" : "year" , "bVisible" : false , "sClass" : "library_year" , "sWidth" : "60px" }
|
||||
],
|
||||
|
||||
|
||||
"bProcessing": true,
|
||||
"bServerSide": true,
|
||||
|
@ -480,7 +481,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
"fnStateSave": function (oSettings, oData) {
|
||||
localStorage.setItem('datatables-library', JSON.stringify(oData));
|
||||
$.ajax({
|
||||
url: "/usersettings/set-library-datatable",
|
||||
url: baseUrl+"usersettings/set-library-datatable",
|
||||
type: "POST",
|
||||
data: {settings : oData, format: "json"},
|
||||
dataType: "json"
|
||||
|
@ -521,7 +522,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
oData.iCreate = parseInt(oData.iCreate, 10);
|
||||
},
|
||||
|
||||
"sAjaxSource": "/Library/contents-feed",
|
||||
"sAjaxSource": baseUrl+"Library/contents-feed",
|
||||
"sAjaxDataProp": "files",
|
||||
|
||||
"fnServerData": function ( sSource, aoData, fnCallback ) {
|
||||
|
@ -557,20 +558,18 @@ var AIRTIME = (function(AIRTIME) {
|
|||
// add the play function to the library_type td
|
||||
$(nRow).find('td.library_type').click(function(){
|
||||
if (aData.ftype === 'playlist' && aData.length !== '0.0'){
|
||||
playlistIndex = $(this).parent().attr('id').substring(3); // remove
|
||||
// the
|
||||
// pl_
|
||||
playlistIndex = $(this).parent().attr('id').substring(3);
|
||||
open_playlist_preview(playlistIndex, 0);
|
||||
} else if (aData.ftype === 'audioclip') {
|
||||
if (isAudioSupported(aData.mime)) {
|
||||
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
|
||||
}
|
||||
} else if (aData.ftype == 'stream') {
|
||||
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
|
||||
if (isAudioSupported(aData.mime)) {
|
||||
open_audio_preview(aData.ftype, aData.audioFile, aData.track_title, aData.artist_name);
|
||||
}
|
||||
} else if (aData.ftype == 'block' && aData.bl_type == 'static') {
|
||||
blockIndex = $(this).parent().attr('id').substring(3); // remove
|
||||
// the
|
||||
// bl_
|
||||
blockIndex = $(this).parent().attr('id').substring(3);
|
||||
open_block_preview(blockIndex, 0);
|
||||
}
|
||||
return false;
|
||||
|
@ -611,12 +610,12 @@ var AIRTIME = (function(AIRTIME) {
|
|||
// icon.
|
||||
$(nRow).find("td:not(.library_checkbox, .library_type)").qtip({
|
||||
content: {
|
||||
text: "Loading...",
|
||||
text: $.i18n._("Loading..."),
|
||||
title: {
|
||||
text: aData.track_title
|
||||
},
|
||||
ajax: {
|
||||
url: "/Library/get-file-metadata",
|
||||
url: baseUrl+"Library/get-file-metadata",
|
||||
type: "get",
|
||||
data: ({format: "html", id : aData.id, type: aData.ftype}),
|
||||
success: function(data, status) {
|
||||
|
@ -664,10 +663,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
"sPaginationType": "full_numbers",
|
||||
"bJQueryUI": true,
|
||||
"bAutoWidth": false,
|
||||
"oLanguage": {
|
||||
"sSearch": "",
|
||||
"sLengthMenu": "Show _MENU_"
|
||||
},
|
||||
"oLanguage": datatables_dict,
|
||||
|
||||
// R = ColReorder, C = ColVis
|
||||
"sDom": 'Rl<"#library_display_type">f<"dt-process-rel"r><"H"<"library_toolbar"C>><"dataTables_scrolling"t><"F"ip>',
|
||||
|
@ -725,11 +721,11 @@ var AIRTIME = (function(AIRTIME) {
|
|||
.addClass("dataTables_type")
|
||||
.append('<select name="library_display_type" />')
|
||||
.find("select")
|
||||
.append('<option value="0">All</option>')
|
||||
.append('<option value="1">Files</option>')
|
||||
.append('<option value="2">Playlists</option>')
|
||||
.append('<option value="3">Smart Blocks</option>')
|
||||
.append('<option value="4">Web Streams</option>')
|
||||
.append('<option value="0">'+$.i18n._("All")+'</option>')
|
||||
.append('<option value="1">'+$.i18n._("Files")+'</option>')
|
||||
.append('<option value="2">'+$.i18n._("Playlists")+'</option>')
|
||||
.append('<option value="3">'+$.i18n._("Smart Blocks")+'</option>')
|
||||
.append('<option value="4">'+$.i18n._("Web Streams")+'</option>')
|
||||
.end()
|
||||
.change(function(ev){
|
||||
oTable.fnDraw();
|
||||
|
@ -798,21 +794,23 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
if (data.ftype === "audioclip") {
|
||||
callback = function() {
|
||||
document.location.href = oItems.edit.url;
|
||||
$.get(oItems.edit.url, {format: "json"}, function(json){
|
||||
buildEditMetadataDialog(json);
|
||||
});
|
||||
};
|
||||
} else if (data.ftype === "playlist" || data.ftype === "block") {
|
||||
callback = function() {
|
||||
var url = '/Playlist/edit';
|
||||
var url = baseUrl+'Playlist/edit';
|
||||
AIRTIME.playlist.fnEdit(data.id, data.ftype, url);
|
||||
AIRTIME.playlist.validatePlaylistElements();
|
||||
};
|
||||
} else if (data.ftype === "stream") {
|
||||
callback = function() {
|
||||
var url = '/Webstream/edit';
|
||||
var url = baseUrl+'Webstream/edit';
|
||||
AIRTIME.playlist.fnEdit(data.id, data.ftype, url);
|
||||
}
|
||||
} else {
|
||||
throw new Exception("Unknown type: " + data.ftype);
|
||||
throw new Exception($.i18n._("Unknown type: ") + data.ftype);
|
||||
}
|
||||
oItems.edit.callback = callback;
|
||||
}
|
||||
|
@ -854,7 +852,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
callback = function() {
|
||||
aMedia = [];
|
||||
aMedia.push({"id": data.id, "type": data.ftype});
|
||||
if (confirm('Are you sure you want to delete the selected item?')) {
|
||||
if (confirm($.i18n._('Are you sure you want to delete the selected item?'))) {
|
||||
AIRTIME.library.fnDeleteItems(aMedia);
|
||||
}
|
||||
};
|
||||
|
@ -863,7 +861,7 @@ var AIRTIME = (function(AIRTIME) {
|
|||
callback = function() {
|
||||
var media = [];
|
||||
|
||||
if (confirm('Are you sure you want to delete the selected item?')) {
|
||||
if (confirm($.i18n._('Are you sure you want to delete the selected item?'))) {
|
||||
|
||||
media.push({"id": data.id, "type": data.ftype});
|
||||
$.post(oItems.del.url, {format: "json", media: media }, function(json){
|
||||
|
@ -915,12 +913,26 @@ var AIRTIME = (function(AIRTIME) {
|
|||
soundcloud.view.callback = callback;
|
||||
}
|
||||
}
|
||||
|
||||
// add callbacks for duplicate menu items.
|
||||
if (oItems.duplicate !== undefined) {
|
||||
var url = oItems.duplicate.url;
|
||||
callback = function() {
|
||||
$.post(url, {format: "json", id: data.id }, function(json){
|
||||
oTable.fnStandingRedraw();
|
||||
});
|
||||
};
|
||||
oItems.duplicate.callback = callback;
|
||||
}
|
||||
// remove 'Add to smart block' option if the current
|
||||
// block is dynamic
|
||||
if ($('input:radio[name=sp_type]:checked').val() === "1") {
|
||||
delete oItems.pl_add;
|
||||
}
|
||||
items = oItems;
|
||||
}
|
||||
|
||||
request = $.ajax({
|
||||
url: "/library/context-menu",
|
||||
url: baseUrl+"library/context-menu",
|
||||
type: "GET",
|
||||
data: {id : data.id, type: data.ftype, format: "json", "screen": screen},
|
||||
dataType: "json",
|
||||
|
@ -942,8 +954,27 @@ var AIRTIME = (function(AIRTIME) {
|
|||
|
||||
}(AIRTIME || {}));
|
||||
|
||||
function buildEditMetadataDialog (json){
|
||||
var dialog = $(json.dialog);
|
||||
|
||||
dialog.dialog({
|
||||
autoOpen: false,
|
||||
title: $.i18n._("Edit Metadata"),
|
||||
width: 460,
|
||||
height: 660,
|
||||
modal: true,
|
||||
close: closeDialog
|
||||
});
|
||||
|
||||
dialog.dialog('open');
|
||||
}
|
||||
|
||||
function closeDialog(event, ui) {
|
||||
$(this).remove();
|
||||
}
|
||||
|
||||
function checkImportStatus() {
|
||||
$.getJSON('/Preference/is-import-in-progress', function(data){
|
||||
$.getJSON(baseUrl+'Preference/is-import-in-progress', function(data){
|
||||
var div = $('#import_status');
|
||||
var table = $('#library_display').dataTable();
|
||||
if (data == true){
|
||||
|
@ -975,7 +1006,7 @@ function addProgressIcon(id) {
|
|||
}
|
||||
|
||||
function checkLibrarySCUploadStatus(){
|
||||
var url = '/Library/get-upload-to-soundcloud-status',
|
||||
var url = baseUrl+'Library/get-upload-to-soundcloud-status',
|
||||
span,
|
||||
id;
|
||||
|
||||
|
@ -1009,7 +1040,7 @@ function addQtipToSCIcons(){
|
|||
if ($(this).hasClass("progress")){
|
||||
$(this).qtip({
|
||||
content: {
|
||||
text: "Uploading in progress..."
|
||||
text: $.i18n._("Uploading in progress...")
|
||||
},
|
||||
position:{
|
||||
adjust: {
|
||||
|
@ -1020,6 +1051,9 @@ function addQtipToSCIcons(){
|
|||
my: "left top",
|
||||
viewport: $(window)
|
||||
},
|
||||
style: {
|
||||
classes: "ui-tooltip-dark file-md-long"
|
||||
},
|
||||
show: {
|
||||
ready: true // Needed to make it show on first mouseover
|
||||
// event
|
||||
|
@ -1030,19 +1064,13 @@ function addQtipToSCIcons(){
|
|||
var sc_id = $(this).parent().parent().data("aData").soundcloud_id;
|
||||
$(this).qtip({
|
||||
content: {
|
||||
//text: "The soundcloud id for this file is: "+sc_id
|
||||
text: "Retrieving data from the server...",
|
||||
text: $.i18n._("Retrieving data from the server..."),
|
||||
ajax: {
|
||||
url: "/Library/get-upload-to-soundcloud-status",
|
||||
url: baseUrl+"Library/get-upload-to-soundcloud-status",
|
||||
type: "post",
|
||||
data: ({format: "json", id : id, type: "file"}),
|
||||
success: function(json, status){
|
||||
id = sc_id;
|
||||
if (id == undefined) {
|
||||
id = json.sc_id;
|
||||
}
|
||||
|
||||
this.set('content.text', "The soundcloud id for this file is: "+id);
|
||||
this.set('content.text', $.i18n._("The soundcloud id for this file is: ")+json.sc_id);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -1055,6 +1083,9 @@ function addQtipToSCIcons(){
|
|||
my: "left top",
|
||||
viewport: $(window)
|
||||
},
|
||||
style: {
|
||||
classes: "ui-tooltip-dark file-md-long"
|
||||
},
|
||||
show: {
|
||||
ready: true // Needed to make it show on first mouseover
|
||||
// event
|
||||
|
@ -1063,14 +1094,15 @@ function addQtipToSCIcons(){
|
|||
}else if($(this).hasClass("sc-error")){
|
||||
$(this).qtip({
|
||||
content: {
|
||||
text: "Retreiving data from the server...",
|
||||
text: $.i18n._("Retreiving data from the server..."),
|
||||
ajax: {
|
||||
url: "/Library/get-upload-to-soundcloud-status",
|
||||
url: baseUrl+"Library/get-upload-to-soundcloud-status",
|
||||
type: "post",
|
||||
data: ({format: "json", id : id, type: "file"}),
|
||||
success: function(json, status){
|
||||
this.set('content.text', "There was error while uploading to soundcloud.<br>"+"Error code: "+json.error_code+
|
||||
"<br>"+"Error msg: "+json.error_msg+"<br>");
|
||||
this.set('content.text', $.i18n._("There was an error while uploading to soundcloud.")+"<br>"+
|
||||
$.i18n._("Error code: ")+json.error_code+
|
||||
"<br>"+$.i18n._("Error msg: ")+json.error_msg+"<br>");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -1083,6 +1115,9 @@ function addQtipToSCIcons(){
|
|||
my: "left top",
|
||||
viewport: $(window)
|
||||
},
|
||||
style: {
|
||||
classes: "ui-tooltip-dark file-md-long"
|
||||
},
|
||||
show: {
|
||||
ready: true // Needed to make it show on first mouseover
|
||||
// event
|
||||
|
@ -1173,13 +1208,13 @@ function validateAdvancedSearch(divs) {
|
|||
function addRemoveValidationIcons(valid, field, searchTermType) {
|
||||
var title = '';
|
||||
if (searchTermType === 'i') {
|
||||
title = 'Input must be a positive number';
|
||||
title = $.i18n._('Input must be a positive number');
|
||||
} else if (searchTermType === 'n') {
|
||||
title = 'Input must be a number';
|
||||
title = $.i18n._('Input must be a number');
|
||||
} else if (searchTermType === 't') {
|
||||
title = 'Input must be in the format: yyyy-mm-dd';
|
||||
title = $.i18n._('Input must be in the format: yyyy-mm-dd');
|
||||
} else if (searchTermType === 'l') {
|
||||
title = 'Input must be in the format: hh:mm:ss.t';
|
||||
title = $.i18n._('Input must be in the format: hh:mm:ss.t');
|
||||
}
|
||||
|
||||
var validIndicator = " <span class='checked-icon sp-checked-icon'></span>",
|
||||
|
@ -1241,3 +1276,18 @@ var validationTypes = {
|
|||
"info_url" : "s",
|
||||
"year" : "i"
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#editmdsave').live("click", function() {
|
||||
var file_id = $('#file_id').val(),
|
||||
data = $("#edit-md-dialog form").serializeArray();
|
||||
$.post(baseUrl+'library/edit-file-md', {format: "json", id: file_id, data: data}, function() {
|
||||
$("#edit-md-dialog").dialog().remove();
|
||||
});
|
||||
});
|
||||
|
||||
$('#editmdcancel').live("click", function() {
|
||||
$("#edit-md-dialog").dialog().remove();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
$(document).ready(function() {
|
||||
|
||||
var uploader;
|
||||
|
||||
$("#plupload_files").pluploadQueue({
|
||||
// General settings
|
||||
runtimes : 'gears, html5, html4',
|
||||
url : '/Plupload/upload/format/json',
|
||||
url : baseUrl+'Plupload/upload/format/json',
|
||||
chunk_size : '5mb',
|
||||
unique_names : 'true',
|
||||
multiple_queues : 'true',
|
||||
|
@ -27,9 +28,9 @@ $(document).ready(function() {
|
|||
$("#plupload_error table").css("display", "inline-table");
|
||||
}else{
|
||||
var tempFileName = j.tempfilepath;
|
||||
$.get('/Plupload/copyfile/format/json/name/' +
|
||||
encodeURIComponent(file.name)+'/tempname/' +
|
||||
encodeURIComponent(tempFileName), function(json){
|
||||
$.get(baseUrl+'Plupload/copyfile/format/json/name/'+
|
||||
encodeURIComponent(file.name)+'/tempname/' +
|
||||
encodeURIComponent(tempFileName), function(json){
|
||||
var jr = jQuery.parseJSON(json);
|
||||
if(jr.error !== undefined) {
|
||||
var row = $("<tr/>")
|
||||
|
@ -55,7 +56,8 @@ $(document).ready(function() {
|
|||
|
||||
$(window).bind('beforeunload', function(){
|
||||
if(uploadProgress){
|
||||
return "You are currently uploading files.\nGoing to another screen will cancel the upload process.\nAre you sure you want to leave the page?";
|
||||
return sprintf($.i18n._("You are currently uploading files. %sGoing to another screen will cancel the upload process. %sAre you sure you want to leave the page?"),
|
||||
"\n", "\n");
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -66,121 +66,121 @@ var AIRTIME = (function(AIRTIME){
|
|||
event.stopPropagation();
|
||||
var span = $(this),
|
||||
id = span.parent().attr("id").split("_").pop(),
|
||||
url = "/Playlist/set-cue",
|
||||
url = baseUrl+"Playlist/set-cue",
|
||||
cueIn = $.trim(span.text()),
|
||||
li = span.parents("li"),
|
||||
unqid = li.attr("unqid"),
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
|
||||
if (!isTimeValid(cueIn)){
|
||||
showError(span, "please put in a time '00:00:00 (.0)'");
|
||||
return;
|
||||
}
|
||||
$.post(url,
|
||||
{format: "json", cueIn: cueIn, id: id, modified: lastMod, type: type},
|
||||
function(json){
|
||||
|
||||
if (json.error !== undefined){
|
||||
playlistError(json);
|
||||
|
||||
if (!isTimeValid(cueIn)){
|
||||
showError(span, $.i18n._("please put in a time '00:00:00 (.0)'"));
|
||||
return;
|
||||
}
|
||||
$.post(url,
|
||||
{format: "json", cueIn: cueIn, id: id, modified: lastMod, type: type},
|
||||
function(json){
|
||||
|
||||
if (json.error !== undefined){
|
||||
playlistError(json);
|
||||
return;
|
||||
}
|
||||
if (json.cue_error !== undefined) {
|
||||
showError(span, json.cue_error);
|
||||
return;
|
||||
}
|
||||
|
||||
setPlaylistContent(json);
|
||||
|
||||
li = $('#side_playlist li[unqid='+unqid+']');
|
||||
li.find(".cue-edit").toggle();
|
||||
highlightActive(li);
|
||||
highlightActive(li.find('.spl_cue'));
|
||||
});
|
||||
}
|
||||
if (json.cue_error !== undefined) {
|
||||
showError(span, json.cue_error);
|
||||
return;
|
||||
}
|
||||
|
||||
setPlaylistContent(json);
|
||||
|
||||
li = $('#side_playlist li[unqid='+unqid+']');
|
||||
li.find(".cue-edit").toggle();
|
||||
highlightActive(li);
|
||||
highlightActive(li.find('.spl_cue'));
|
||||
});
|
||||
}
|
||||
|
||||
function changeCueOut(event) {
|
||||
event.stopPropagation();
|
||||
var span = $(this),
|
||||
id = span.parent().attr("id").split("_").pop(),
|
||||
url = "/Playlist/set-cue",
|
||||
url = baseUrl+"Playlist/set-cue",
|
||||
cueOut = $.trim(span.text()),
|
||||
li = span.parents("li"),
|
||||
unqid = li.attr("unqid"),
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
|
||||
if (!isTimeValid(cueOut)){
|
||||
showError(span, "please put in a time '00:00:00 (.0)'");
|
||||
return;
|
||||
}
|
||||
if (!isTimeValid(cueOut)){
|
||||
showError(span, $.i18n._("please put in a time '00:00:00 (.0)'"));
|
||||
return;
|
||||
}
|
||||
|
||||
$.post(url,
|
||||
{format: "json", cueOut: cueOut, id: id, modified: lastMod, type: type},
|
||||
function(json){
|
||||
|
||||
$.post(url,
|
||||
{format: "json", cueOut: cueOut, id: id, modified: lastMod, type: type},
|
||||
function(json){
|
||||
|
||||
if (json.error !== undefined){
|
||||
playlistError(json);
|
||||
return;
|
||||
if (json.error !== undefined){
|
||||
playlistError(json);
|
||||
return;
|
||||
}
|
||||
if (json.cue_error !== undefined) {
|
||||
showError(span, json.cue_error);
|
||||
return;
|
||||
}
|
||||
if (json.cue_error !== undefined) {
|
||||
showError(span, json.cue_error);
|
||||
return;
|
||||
}
|
||||
|
||||
setPlaylistContent(json);
|
||||
|
||||
li = $('#side_playlist li[unqid='+unqid+']');
|
||||
li.find(".cue-edit").toggle();
|
||||
highlightActive(li);
|
||||
highlightActive(li.find('.spl_cue'));
|
||||
});
|
||||
}
|
||||
|
||||
function changeFadeIn(event) {
|
||||
event.preventDefault();
|
||||
setPlaylistContent(json);
|
||||
|
||||
var span = $(this),
|
||||
id = span.parent().attr("id").split("_").pop(),
|
||||
url = "/Playlist/set-fade",
|
||||
fadeIn = $.trim(span.text()),
|
||||
li = span.parents("li"),
|
||||
unqid = li.attr("unqid"),
|
||||
lastMod = getModified(),
|
||||
li = $('#side_playlist li[unqid='+unqid+']');
|
||||
li.find(".cue-edit").toggle();
|
||||
highlightActive(li);
|
||||
highlightActive(li.find('.spl_cue'));
|
||||
});
|
||||
}
|
||||
|
||||
function changeFadeIn(event) {
|
||||
event.preventDefault();
|
||||
|
||||
var span = $(this),
|
||||
id = span.parent().attr("id").split("_").pop(),
|
||||
url = baseUrl+"Playlist/set-fade",
|
||||
fadeIn = $.trim(span.text()),
|
||||
li = span.parents("li"),
|
||||
unqid = li.attr("unqid"),
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
|
||||
if (!isFadeValid(fadeIn)){
|
||||
showError(span, "please put in a time in seconds '00 (.0)'");
|
||||
return;
|
||||
}
|
||||
if (!isFadeValid(fadeIn)){
|
||||
showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
|
||||
return;
|
||||
}
|
||||
|
||||
$.post(url,
|
||||
{format: "json", fadeIn: fadeIn, id: id, modified: lastMod, type: type},
|
||||
function(json){
|
||||
|
||||
if (json.error !== undefined){
|
||||
playlistError(json);
|
||||
return;
|
||||
$.post(url,
|
||||
{format: "json", fadeIn: fadeIn, id: id, modified: lastMod, type: type},
|
||||
function(json){
|
||||
|
||||
if (json.error !== undefined){
|
||||
playlistError(json);
|
||||
return;
|
||||
}
|
||||
if (json.fade_error !== undefined) {
|
||||
showError(span, json.fade_error);
|
||||
return;
|
||||
}
|
||||
|
||||
setPlaylistContent(json);
|
||||
|
||||
li = $('#side_playlist li[unqid='+unqid+']');
|
||||
li.find('.crossfade').toggle();
|
||||
highlightActive(li.find('.spl_fade_control'));
|
||||
});
|
||||
}
|
||||
if (json.fade_error !== undefined) {
|
||||
showError(span, json.fade_error);
|
||||
return;
|
||||
}
|
||||
|
||||
setPlaylistContent(json);
|
||||
|
||||
li = $('#side_playlist li[unqid='+unqid+']');
|
||||
li.find('.crossfade').toggle();
|
||||
highlightActive(li.find('.spl_fade_control'));
|
||||
});
|
||||
}
|
||||
|
||||
function changeFadeOut(event) {
|
||||
event.stopPropagation();
|
||||
|
||||
var span = $(this),
|
||||
id = span.parent().attr("id").split("_").pop(),
|
||||
url = "/Playlist/set-fade",
|
||||
url = baseUrl+"Playlist/set-fade",
|
||||
fadeOut = $.trim(span.text()),
|
||||
li = span.parents("li"),
|
||||
unqid = li.attr("unqid"),
|
||||
|
@ -188,7 +188,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
type = $('#obj_type').val();
|
||||
|
||||
if (!isFadeValid(fadeOut)){
|
||||
showError(span, "please put in a time in seconds '00 (.0)'");
|
||||
showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -264,7 +264,8 @@ var AIRTIME = (function(AIRTIME){
|
|||
nameElement.text(nameElement.text().replace("\n", ""));
|
||||
|
||||
/* --until we decide whether Playlist name should autosave or not
|
||||
url = '/Playlist/set-playlist-name';
|
||||
|
||||
url = baseUrl+'Playlist/set-playlist-name';
|
||||
|
||||
$.post(url,
|
||||
{format: "json", name: nameElement.text(), modified: lastMod, type: type},
|
||||
|
@ -377,7 +378,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
} else {
|
||||
$(value).attr("class", "big_play_disabled dark_class");
|
||||
$(value).qtip({
|
||||
content: 'Your browser does not support playing this file type: "'+ mime +'"',
|
||||
content: $.i18n._("Your browser does not support playing this file type: ")+ mime,
|
||||
show: 'mouseover',
|
||||
hide: {
|
||||
delay: 500,
|
||||
|
@ -401,7 +402,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
if ($(value).attr('blocktype') === 'dynamic') {
|
||||
$(value).attr("class", "big_play_disabled dark_class");
|
||||
$(value).qtip({
|
||||
content: 'Dynamic block is not previewable',
|
||||
content: $.i18n._('Dynamic block is not previewable'),
|
||||
show: 'mouseover',
|
||||
hide: {
|
||||
delay: 500,
|
||||
|
@ -447,7 +448,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
var id = parseInt($(this).attr("id").split("_").pop(), 10);
|
||||
var blockId = parseInt($(this).attr("blockId"), 10);
|
||||
if ($(this).hasClass('close')) {
|
||||
var sUrl = "/playlist/get-block-info";
|
||||
var sUrl = baseUrl+"playlist/get-block-info";
|
||||
mod.disableUI();
|
||||
$.post(sUrl, {format:"json", id:blockId}, function(json){
|
||||
$html = "";
|
||||
|
@ -482,7 +483,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
"</li>";
|
||||
});
|
||||
}
|
||||
$html += "<li><br /><span class='block-item-title'>Limit to: "+data.limit.value+" "+data.limit.modifier+"</span></li>";
|
||||
$html += "<li><br /><span class='block-item-title'>"+$.i18n._("Limit to: ")+data.limit.value+" "+data.limit.modifier+"</span></li>";
|
||||
}
|
||||
$pl.find("#block_"+id+"_info").html($html).show();
|
||||
mod.enableUI();
|
||||
|
@ -530,9 +531,9 @@ var AIRTIME = (function(AIRTIME){
|
|||
else {
|
||||
$(this).addClass("ui-state-active");
|
||||
|
||||
var url = '/Playlist/get-playlist-fades';
|
||||
var url = baseUrl+'Playlist/get-playlist-fades';
|
||||
$.post(url,
|
||||
{format: "json", modified: lastMod, type: type},
|
||||
{format: "json", modified: lastMod, type: type},
|
||||
function(json){
|
||||
if (json.error !== undefined){
|
||||
playlistError(json);
|
||||
|
@ -567,14 +568,14 @@ var AIRTIME = (function(AIRTIME){
|
|||
$pl.on("blur", "span.spl_main_fade_in", function(event){
|
||||
event.stopPropagation();
|
||||
|
||||
var url = "/Playlist/set-playlist-fades",
|
||||
var url = baseUrl+"Playlist/set-playlist-fades",
|
||||
span = $(this),
|
||||
fadeIn = $.trim(span.text()),
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
|
||||
if (!isFadeValid(fadeIn)){
|
||||
showError(span, "please put in a time in seconds '00 (.0)'");
|
||||
showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -591,14 +592,14 @@ var AIRTIME = (function(AIRTIME){
|
|||
$pl.on("blur", "span.spl_main_fade_out", function(event){
|
||||
event.stopPropagation();
|
||||
|
||||
var url = "/Playlist/set-playlist-fades",
|
||||
var url = baseUrl+"Playlist/set-playlist-fades",
|
||||
span = $(this),
|
||||
fadeOut = $.trim(span.text()),
|
||||
lastMod = getModified(),
|
||||
type = $('#obj_type').val();
|
||||
|
||||
if (!isFadeValid(fadeOut)){
|
||||
showError(span, "please put in a time in seconds '00 (.0)'");
|
||||
showError(span, $.i18n._("please put in a time in seconds '00 (.0)'"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -636,6 +637,27 @@ var AIRTIME = (function(AIRTIME){
|
|||
$fs.addClass("closed");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$pl.on("click", 'button[id="playlist_shuffle_button"]', function(){
|
||||
obj_id = $('input[id="obj_id"]').val();
|
||||
url = baseUrl+"Playlist/shuffle";
|
||||
enableLoadingIcon();
|
||||
$.post(url, {format: "json", obj_id: obj_id}, function(data){
|
||||
var json = $.parseJSON(data)
|
||||
|
||||
if (json.error !== undefined) {
|
||||
alert(json.error);
|
||||
}
|
||||
AIRTIME.playlist.fnOpenPlaylist(json);
|
||||
if (json.result == "0") {
|
||||
$pl.find('.success').text($.i18n._('Playlist shuffled'));
|
||||
$pl.find('.success').show();
|
||||
}
|
||||
disableLoadingIcon();
|
||||
setTimeout(removeSuccessMsg, 5000);
|
||||
});
|
||||
})
|
||||
|
||||
$pl.on("click", "#webstream_save", function(){
|
||||
//get all fields and POST to server
|
||||
|
@ -652,7 +674,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
//hide any previous errors (if any)
|
||||
$("#side_playlist .errors").empty().hide();
|
||||
|
||||
var url = 'Webstream/save';
|
||||
var url = baseUrl+'Webstream/save';
|
||||
$.post(url,
|
||||
{format: "json", id:id, description: description, url:streamurl, length: length, name: name},
|
||||
function(json){
|
||||
|
@ -697,7 +719,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
var criteria = $('form').serializeArray(),
|
||||
block_name = $('#playlist_name_display').text(),
|
||||
block_desc = $('textarea[name="description"]').val(),
|
||||
save_action = 'Playlist/save',
|
||||
save_action = baseUrl+'Playlist/save',
|
||||
obj_id = $('input[id="obj_id"]').val(),
|
||||
obj_type = $('#obj_type').val(),
|
||||
lastMod = getModified(),
|
||||
|
@ -717,7 +739,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
if (obj_type == "block") {
|
||||
callback(data, "save");
|
||||
} else {
|
||||
$('.success').text('Playlist saved');
|
||||
$('.success').text($.i18n._('Playlist saved'));
|
||||
$('.success').show();
|
||||
setTimeout(removeSuccessMsg, 5000);
|
||||
dt.fnStandingRedraw();
|
||||
|
@ -822,7 +844,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
mod.fnNew = function() {
|
||||
var url = '/Playlist/new';
|
||||
var url = baseUrl+'Playlist/new';
|
||||
|
||||
stopAudioPreview();
|
||||
|
||||
|
@ -835,7 +857,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
};
|
||||
|
||||
mod.fnWsNew = function() {
|
||||
var url = '/Webstream/new';
|
||||
var url = baseUrl+'Webstream/new';
|
||||
|
||||
stopAudioPreview();
|
||||
|
||||
|
@ -847,8 +869,9 @@ var AIRTIME = (function(AIRTIME){
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
mod.fnNewBlock = function() {
|
||||
var url = '/Playlist/new';
|
||||
var url = baseUrl+'Playlist/new';
|
||||
|
||||
stopAudioPreview();
|
||||
|
||||
|
@ -879,7 +902,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
id = (plid === undefined) ? getId() : plid;
|
||||
lastMod = getModified();
|
||||
type = $('#obj_type').val();
|
||||
url = '/Playlist/delete';
|
||||
url = baseUrl+'Playlist/delete';
|
||||
|
||||
$.post(url,
|
||||
{format: "json", ids: id, modified: lastMod, type: type},
|
||||
|
@ -896,7 +919,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
id = (wsid === undefined) ? getId() : wsid;
|
||||
lastMod = getModified();
|
||||
type = $('#obj_type').val();
|
||||
url = '/Webstream/delete';
|
||||
url = baseUrl+'Webstream/delete';
|
||||
|
||||
$.post(url,
|
||||
{format: "json", ids: id, modified: lastMod, type: type},
|
||||
|
@ -969,20 +992,20 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
mod.fnAddItems = function(aItems, iAfter, sAddType) {
|
||||
var sUrl = "/playlist/add-items";
|
||||
var sUrl = baseUrl+"playlist/add-items";
|
||||
oData = {"aItems": aItems, "afterItem": iAfter, "type": sAddType};
|
||||
playlistRequest(sUrl, oData);
|
||||
};
|
||||
|
||||
mod.fnMoveItems = function(aIds, iAfter) {
|
||||
var sUrl = "/playlist/move-items",
|
||||
var sUrl = baseUrl+"playlist/move-items",
|
||||
oData = {"ids": aIds, "afterItem": iAfter};
|
||||
|
||||
playlistRequest(sUrl, oData);
|
||||
};
|
||||
|
||||
mod.fnDeleteItems = function(aItems) {
|
||||
var sUrl = "/playlist/delete-items",
|
||||
var sUrl = baseUrl+"playlist/delete-items",
|
||||
oData = {"ids": aItems};
|
||||
|
||||
playlistRequest(sUrl, oData);
|
||||
|
@ -1053,7 +1076,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
$pl.find(".ui-icon-alert").qtip({
|
||||
content: {
|
||||
text: "Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't \"watched\" anymore."
|
||||
text: $.i18n._("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore.")
|
||||
},
|
||||
position:{
|
||||
adjust: {
|
||||
|
|
|
@ -5,6 +5,12 @@ $(document).ready(function() {
|
|||
dateEndId = "#his_date_end",
|
||||
timeEndId = "#his_time_end";
|
||||
|
||||
// set width dynamically
|
||||
var width = $("#content").width();
|
||||
width = width - 120;
|
||||
$("#listenerstat_content").find("#flot_placeholder").width(width);
|
||||
$("#listenerstat_content").find("#legend").width(width);
|
||||
|
||||
getDataAndPlot();
|
||||
|
||||
listenerstat_content.find("#his_submit").click(function(){
|
||||
|
@ -16,7 +22,7 @@ $(document).ready(function() {
|
|||
|
||||
function getDataAndPlot(startTimestamp, endTimestamp){
|
||||
// get data
|
||||
$.get('/Listenerstat/get-data', {startTimestamp: startTimestamp, endTimestamp: endTimestamp}, function(data){
|
||||
$.get(baseUrl+'Listenerstat/get-data', {startTimestamp: startTimestamp, endTimestamp: endTimestamp}, function(data){
|
||||
data = JSON.parse(data);
|
||||
out = new Object();
|
||||
$.each(data, function(mpName, v){
|
||||
|
@ -134,7 +140,7 @@ function plot(datasets){
|
|||
var y = item.datapoint[1].toFixed(2);
|
||||
|
||||
showTooltip(item.pageX, item.pageY,
|
||||
"Listener Count on '"+item.series.label + "': " + Math.floor(y));
|
||||
sprintf($.i18n._("Listener Count on %s: %s"), item.series.label, Math.floor(y)));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -143,19 +149,15 @@ function plot(datasets){
|
|||
}
|
||||
});
|
||||
|
||||
$("#placeholder").bind("plotclick", function (event, pos, item) {
|
||||
if (item) {
|
||||
$("#clickdata").text("You clicked point " + item.dataIndex + " in " + item.series.label + ".");
|
||||
plot.highlight(item.series, item.datapoint);
|
||||
}
|
||||
});
|
||||
|
||||
$('#legend').find("input").click(function(){setTimeout(plotByChoice,100);});
|
||||
}
|
||||
|
||||
plotByChoice(true);
|
||||
oBaseDatePickerSettings = {
|
||||
dateFormat: 'yy-mm-dd',
|
||||
//i18n_months, i18n_days_short are in common.js
|
||||
monthNames: i18n_months,
|
||||
dayNamesMin: i18n_days_short,
|
||||
onSelect: function(sDate, oDatePicker) {
|
||||
$(this).datepicker( "setDate", sDate );
|
||||
}
|
||||
|
@ -164,12 +166,15 @@ function plot(datasets){
|
|||
oBaseTimePickerSettings = {
|
||||
showPeriodLabels: false,
|
||||
showCloseButton: true,
|
||||
closeButtonText: $.i18n._("Done"),
|
||||
showLeadingZero: false,
|
||||
defaultTime: '0:00'
|
||||
defaultTime: '0:00',
|
||||
hourText: $.i18n._("Hour"),
|
||||
minuteText: $.i18n._("Minute")
|
||||
};
|
||||
|
||||
listenerstat_content.find(dateStartId).datepicker(oBaseDatePickerSettings);
|
||||
listenerstat_content.find(timeStartId).timepicker(oBaseTimePickerSettings);
|
||||
listenerstat_content.find(dateEndId).datepicker(oBaseDatePickerSettings);
|
||||
listenerstat_content.find(timeEndId).timepicker(oBaseTimePickerSettings);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
$(window).load(function(){
|
||||
$("#username").focus();
|
||||
})
|
||||
$("#locale").val($.cookie("airtime_locale")!== null?$.cookie("airtime_locale"):'en_CA');
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#submit").click(function() {
|
||||
$.cookie("airtime_locale", $("#locale").val(), {path: '/'});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
$(document).ready(function(){
|
||||
|
||||
function doNotShowPopup(){
|
||||
$.get("/Usersettings/donotshowregistrationpopup", {format:"json"});
|
||||
$.get(baseUrl+"Usersettings/donotshowregistrationpopup", {format:"json"});
|
||||
}
|
||||
|
||||
var dialog = $("#register_popup");
|
||||
|
@ -16,10 +16,10 @@ $(document).ready(function(){
|
|||
buttons: [
|
||||
{
|
||||
id: "remind_me",
|
||||
text: "Remind me in 1 week",
|
||||
text: $.i18n._("Remind me in 1 week"),
|
||||
"class": "btn",
|
||||
click: function() {
|
||||
var url = '/Usersettings/remindme';
|
||||
var url = baseUrl+'Usersettings/remindme';
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: {format:"json"}
|
||||
|
@ -29,10 +29,10 @@ $(document).ready(function(){
|
|||
},
|
||||
{
|
||||
id: "remind_never",
|
||||
text: "Remind me never",
|
||||
text: $.i18n._("Remind me never"),
|
||||
"class": "btn",
|
||||
click: function() {
|
||||
var url ='/Usersettings/remindme-never';
|
||||
var url =baseUrl+'Usersettings/remindme-never';
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: {format:"json"}
|
||||
|
@ -42,7 +42,7 @@ $(document).ready(function(){
|
|||
},
|
||||
{
|
||||
id: "help_airtime",
|
||||
text: "Yes, help Airtime",
|
||||
text: $.i18n._("Yes, help Airtime"),
|
||||
"class": "btn",
|
||||
click: function() {
|
||||
$("#register-form").submit();
|
||||
|
@ -129,7 +129,7 @@ $(document).ready(function(){
|
|||
var ul, li;
|
||||
|
||||
ul = logoEl.find('.errors');
|
||||
li = $("<li/>").append("Image must be one of jpg, jpeg, png, or gif");
|
||||
li = $("<li/>").append($.i18n._("Image must be one of jpg, jpeg, png, or gif"));
|
||||
|
||||
//errors ul has already been created.
|
||||
if (ul.length > 0) {
|
||||
|
|
|
@ -351,7 +351,7 @@ function setupUI() {
|
|||
* It is only active if playlist is not empty
|
||||
*/
|
||||
var plContents = $('#spl_sortable').children();
|
||||
var shuffleButton = $('button[id="shuffle_button"]');
|
||||
var shuffleButton = $('button[id="shuffle_button"], button[id="playlist_shuffle_button"]');
|
||||
|
||||
if (!plContents.hasClass('spl_empty')) {
|
||||
if (shuffleButton.hasClass('ui-state-disabled')) {
|
||||
|
@ -378,10 +378,8 @@ function setupUI() {
|
|||
|
||||
$(".playlist_type_help_icon").qtip({
|
||||
content: {
|
||||
text: "A static smart block will save the criteria and generate the block content immediately. " +
|
||||
"This allows you to edit and view it in the Library before adding it to a show.<br /><br />" +
|
||||
"A dynamic smart block will only save the criteria. The block content will get generated upon " +
|
||||
"adding it to a show. You will not be able to view and edit the content in the Library."
|
||||
text: $.i18n._("A static smart block will save the criteria and generate the block content immediately. This allows you to edit and view it in the Library before adding it to a show.")+"<br /><br />" +
|
||||
$.i18n._("A dynamic smart block will only save the criteria. The block content will get generated upon adding it to a show. You will not be able to view and edit the content in the Library.")
|
||||
},
|
||||
hide: {
|
||||
delay: 500,
|
||||
|
@ -402,9 +400,7 @@ function setupUI() {
|
|||
|
||||
$(".repeat_tracks_help_icon").qtip({
|
||||
content: {
|
||||
text: "The desired block length will not be reached if Airtime cannot find " +
|
||||
"enough unique tracks to match your criteria. Enable this option if you wish to allow " +
|
||||
"tracks to be added multiple times to the smart block."
|
||||
text: $.i18n._("The desired block length will not be reached if Airtime cannot find enough unique tracks to match your criteria. Enable this option if you wish to allow tracks to be added multiple times to the smart block.")
|
||||
},
|
||||
hide: {
|
||||
delay: 500,
|
||||
|
@ -496,9 +492,9 @@ function callback(data, type) {
|
|||
var form = $('#smart-block-form');
|
||||
if (json.result == "0") {
|
||||
if (type == 'shuffle') {
|
||||
form.find('.success').text('Smart block shuffled');
|
||||
form.find('.success').text($.i18n._('Smart block shuffled'));
|
||||
} else if (type == 'generate') {
|
||||
form.find('.success').text('Smart block generated and criteria saved');
|
||||
form.find('.success').text($.i18n._('Smart block generated and criteria saved'));
|
||||
//redraw library table so the length gets updated
|
||||
dt.fnStandingRedraw();
|
||||
}
|
||||
|
@ -509,7 +505,7 @@ function callback(data, type) {
|
|||
AIRTIME.playlist.fnOpenPlaylist(json);
|
||||
var form = $('#smart-block-form');
|
||||
if (json.result == "0") {
|
||||
$('#sp-success-saved').text('Smart block saved');
|
||||
$('#sp-success-saved').text($.i18n._('Smart block saved'));
|
||||
$('#sp-success-saved').show();
|
||||
|
||||
//redraw library table so the length gets updated
|
||||
|
@ -521,12 +517,6 @@ function callback(data, type) {
|
|||
setTimeout(removeSuccessMsg, 5000);
|
||||
}
|
||||
|
||||
function removeSuccessMsg() {
|
||||
var $status = $('.success');
|
||||
|
||||
$status.fadeOut("slow", function(){$status.empty()});
|
||||
}
|
||||
|
||||
function appendAddButton() {
|
||||
var add_button = "<a class='btn btn-small' id='criteria_add'>" +
|
||||
"<i class='icon-white icon-plus'></i></a>";
|
||||
|
@ -560,7 +550,7 @@ function removeButtonCheck() {
|
|||
|
||||
function enableLoadingIcon() {
|
||||
$("#side_playlist").block({
|
||||
message: "Processing...",
|
||||
message: $.i18n._("Processing..."),
|
||||
theme: true,
|
||||
allowBodyStretch: true,
|
||||
applyPlatformOpacityRules: false
|
||||
|
@ -601,20 +591,20 @@ var criteriaTypes = {
|
|||
};
|
||||
|
||||
var stringCriteriaOptions = {
|
||||
"0" : "Select modifier",
|
||||
"contains" : "contains",
|
||||
"does not contain" : "does not contain",
|
||||
"is" : "is",
|
||||
"is not" : "is not",
|
||||
"starts with" : "starts with",
|
||||
"ends with" : "ends with"
|
||||
"0" : $.i18n._("Select modifier"),
|
||||
"contains" : $.i18n._("contains"),
|
||||
"does not contain" : $.i18n._("does not contain"),
|
||||
"is" : $.i18n._("is"),
|
||||
"is not" : $.i18n._("is not"),
|
||||
"starts with" : $.i18n._("starts with"),
|
||||
"ends with" : $.i18n._("ends with")
|
||||
};
|
||||
|
||||
var numericCriteriaOptions = {
|
||||
"0" : "Select modifier",
|
||||
"is" : "is",
|
||||
"is not" : "is not",
|
||||
"is greater than" : "is greater than",
|
||||
"is less than" : "is less than",
|
||||
"is in the range" : "is in the range"
|
||||
"0" : $.i18n._("Select modifier"),
|
||||
"is" : $.i18n._("is"),
|
||||
"is not" : $.i18n._("is not"),
|
||||
"is greater than" : $.i18n._("is greater than"),
|
||||
"is less than" : $.i18n._("is less than"),
|
||||
"is in the range" : $.i18n._("is in the range")
|
||||
};
|
||||
|
|
|
@ -65,26 +65,24 @@ var AIRTIME = (function(AIRTIME) {
|
|||
oTable = historyTableDiv.dataTable( {
|
||||
|
||||
"aoColumns": [
|
||||
{"sTitle": "Title", "mDataProp": "title", "sClass": "his_title"}, /* Title */
|
||||
{"sTitle": "Creator", "mDataProp": "artist", "sClass": "his_artist"}, /* Creator */
|
||||
{"sTitle": "Played", "mDataProp": "played", "sClass": "his_artist"}, /* times played */
|
||||
{"sTitle": "Length", "mDataProp": "length", "sClass": "his_length library_length"}, /* Length */
|
||||
{"sTitle": "Composer", "mDataProp": "composer", "sClass": "his_composer"}, /* Composer */
|
||||
{"sTitle": "Copyright", "mDataProp": "copyright", "sClass": "his_copyright"} /* Copyright */
|
||||
{"sTitle": $.i18n._("Title"), "mDataProp": "title", "sClass": "his_title"}, /* Title */
|
||||
{"sTitle": $.i18n._("Creator"), "mDataProp": "artist", "sClass": "his_artist"}, /* Creator */
|
||||
{"sTitle": $.i18n._("Played"), "mDataProp": "played", "sClass": "his_artist"}, /* times played */
|
||||
{"sTitle": $.i18n._("Length"), "mDataProp": "length", "sClass": "his_length library_length"}, /* Length */
|
||||
{"sTitle": $.i18n._("Composer"), "mDataProp": "composer", "sClass": "his_composer"}, /* Composer */
|
||||
{"sTitle": $.i18n._("Copyright"), "mDataProp": "copyright", "sClass": "his_copyright"} /* Copyright */
|
||||
],
|
||||
|
||||
"bProcessing": true,
|
||||
"bServerSide": true,
|
||||
"sAjaxSource": "/Playouthistory/playout-history-feed",
|
||||
"sAjaxSource": baseUrl+"Playouthistory/playout-history-feed",
|
||||
"sAjaxDataProp": "history",
|
||||
|
||||
"fnServerData": fnServerData,
|
||||
|
||||
"oLanguage": {
|
||||
"sSearch": ""
|
||||
},
|
||||
"oLanguage": datatables_dict,
|
||||
|
||||
"aLengthMenu": [[50, 100, 500, -1], [50, 100, 500, "All"]],
|
||||
"aLengthMenu": [[50, 100, 500, -1], [50, 100, 500, $.i18n._("All")]],
|
||||
"iDisplayLength": 50,
|
||||
|
||||
"sPaginationType": "full_numbers",
|
||||
|
@ -94,19 +92,30 @@ var AIRTIME = (function(AIRTIME) {
|
|||
"sDom": 'lf<"dt-process-rel"r><"H"T><"dataTables_scrolling"t><"F"ip>',
|
||||
|
||||
"oTableTools": {
|
||||
"sSwfPath": "/js/datatables/plugin/TableTools/swf/copy_cvs_xls_pdf.swf",
|
||||
"sSwfPath": baseUrl+"js/datatables/plugin/TableTools/swf/copy_cvs_xls_pdf.swf",
|
||||
"aButtons": [
|
||||
"copy",
|
||||
{
|
||||
"sExtends": "csv",
|
||||
"fnClick": setFlashFileName
|
||||
},
|
||||
{
|
||||
"sExtends": "pdf",
|
||||
"fnClick": setFlashFileName
|
||||
},
|
||||
"print"
|
||||
]
|
||||
{
|
||||
"sExtends": "copy",
|
||||
"fnComplete": function(nButton, oConfig, oFlash, text) {
|
||||
var lines = text.split('\n').length,
|
||||
len = this.s.dt.nTFoot === null ? lines-1 : lines-2,
|
||||
plural = (len==1) ? "" : "s";
|
||||
alert(sprintf($.i18n._('Copied %s row%s to the clipboard'), len, plural));
|
||||
}
|
||||
},
|
||||
{
|
||||
"sExtends": "csv",
|
||||
"fnClick": setFlashFileName
|
||||
},
|
||||
{
|
||||
"sExtends": "pdf",
|
||||
"fnClick": setFlashFileName
|
||||
},
|
||||
{
|
||||
"sExtends": "print",
|
||||
"sInfo" : sprintf($.i18n._("%sPrint view%sPlease use your browser's print function to print this table. Press escape when finished."), "<h6>", "</h6><p>")
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
oTable.fnSetFilteringDelay(350);
|
||||
|
@ -150,6 +159,9 @@ $(document).ready(function(){
|
|||
|
||||
oBaseDatePickerSettings = {
|
||||
dateFormat: 'yy-mm-dd',
|
||||
//i18n_months, i18n_days_short are in common.js
|
||||
monthNames: i18n_months,
|
||||
dayNamesMin: i18n_days_short,
|
||||
onSelect: function(sDate, oDatePicker) {
|
||||
$(this).datepicker( "setDate", sDate );
|
||||
}
|
||||
|
@ -158,8 +170,11 @@ $(document).ready(function(){
|
|||
oBaseTimePickerSettings = {
|
||||
showPeriodLabels: false,
|
||||
showCloseButton: true,
|
||||
closeButtonText: $.i18n._("Done"),
|
||||
showLeadingZero: false,
|
||||
defaultTime: '0:00'
|
||||
defaultTime: '0:00',
|
||||
hourText: $.i18n._("Hour"),
|
||||
minuteText: $.i18n._("Minute")
|
||||
};
|
||||
|
||||
oTable = AIRTIME.history.historyTable();
|
||||
|
@ -183,4 +198,4 @@ $(document).ready(function(){
|
|||
oTable.fnDraw();
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
@ -13,9 +13,9 @@ function setWatchedDirEvents() {
|
|||
//knownPaths: [{text:'Desktop', image:'desktop.png', path:'/home'}],
|
||||
knownPaths: [],
|
||||
imageUrl: 'img/icons/',
|
||||
systemImageUrl: '/css/img/',
|
||||
handlerUrl: '/Preference/server-browse/format/json',
|
||||
title: 'Choose Storage Folder',
|
||||
systemImageUrl: baseUrl+'css/img/',
|
||||
handlerUrl: baseUrl+'Preference/server-browse/format/json',
|
||||
title: $.i18n._('Choose Storage Folder'),
|
||||
basePath: '',
|
||||
requestMethod: 'POST',
|
||||
});
|
||||
|
@ -33,9 +33,9 @@ function setWatchedDirEvents() {
|
|||
//knownPaths: [{text:'Desktop', image:'desktop.png', path:'/home'}],
|
||||
knownPaths: [],
|
||||
imageUrl: 'img/icons/',
|
||||
systemImageUrl: '/css/img/',
|
||||
handlerUrl: '/Preference/server-browse/format/json',
|
||||
title: 'Choose Folder to Watch',
|
||||
systemImageUrl: baseUrl+'css/img/',
|
||||
handlerUrl: baseUrl+'Preference/server-browse/format/json',
|
||||
title: $.i18n._('Choose Folder to Watch'),
|
||||
basePath: '',
|
||||
requestMethod: 'POST',
|
||||
});
|
||||
|
@ -43,8 +43,8 @@ function setWatchedDirEvents() {
|
|||
$('#storageFolder-ok').click(function(){
|
||||
var url, chosen;
|
||||
|
||||
if(confirm("Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!")){
|
||||
url = "/Preference/change-stor-directory";
|
||||
if(confirm($.i18n._("Are you sure you want to change the storage folder?\nThis will remove the files from your Airtime library!"))){
|
||||
url = baseUrl+"Preference/change-stor-directory";
|
||||
chosen = $('#storageFolder').val();
|
||||
|
||||
$.post(url,
|
||||
|
@ -64,7 +64,7 @@ function setWatchedDirEvents() {
|
|||
$('#watchedFolder-ok').click(function(){
|
||||
var url, chosen;
|
||||
|
||||
url = "/Preference/reload-watch-directory";
|
||||
url = baseUrl+"Preference/reload-watch-directory";
|
||||
chosen = $('#watchedFolder').val();
|
||||
|
||||
$.post(url,
|
||||
|
@ -72,7 +72,7 @@ function setWatchedDirEvents() {
|
|||
|
||||
function(json) {
|
||||
$("#watched-folder-section").empty();
|
||||
$("#watched-folder-section").append("<h2>Manage Media Folders</h2>");
|
||||
$("#watched-folder-section").append("<h2>"+$.i18n._("Manage Media Folders")+"</h2>");
|
||||
$("#watched-folder-section").append(json.subform);
|
||||
setWatchedDirEvents();
|
||||
});
|
||||
|
@ -80,22 +80,22 @@ function setWatchedDirEvents() {
|
|||
|
||||
$('.selected-item').find('.ui-icon-refresh').click(function(){
|
||||
var folder = $(this).prev().text();
|
||||
$.get("/Preference/rescan-watch-directory", {format: "json", dir: folder});
|
||||
$.get(baseUrl+"Preference/rescan-watch-directory", {format: "json", dir: folder});
|
||||
});
|
||||
|
||||
$('.selected-item').find('.ui-icon-close').click(function(){
|
||||
if(confirm("Are you sure you want to remove the watched folder?")){
|
||||
if(confirm($.i18n._("Are you sure you want to remove the watched folder?"))){
|
||||
var row = $(this).parent();
|
||||
var folder = row.find('#folderPath').text();
|
||||
|
||||
url = "/Preference/remove-watch-directory";
|
||||
url = baseUrl+"Preference/remove-watch-directory";
|
||||
|
||||
$.post(url,
|
||||
{format: "json", dir: folder},
|
||||
|
||||
function(json) {
|
||||
$("#watched-folder-section").empty();
|
||||
$("#watched-folder-section").append("<h2>Manage Media Folders</h2>");
|
||||
$("#watched-folder-section").append("<h2>"+$.i18n._("Manage Media Folders")+"</h2>");
|
||||
$("#watched-folder-section").append(json.subform);
|
||||
setWatchedDirEvents();
|
||||
});
|
||||
|
@ -108,7 +108,7 @@ $(document).ready(function() {
|
|||
setWatchedDirEvents();
|
||||
$(".ui-icon-alert").qtip({
|
||||
content: {
|
||||
text: "This path is currently not accessible."
|
||||
text: $.i18n._("This path is currently not accessible.")
|
||||
},
|
||||
position:{
|
||||
adjust: {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
function showErrorSections() {
|
||||
|
||||
if($("#soundcloud-settings .errors").length > 0) {
|
||||
$("#soundcloud-settings").show();
|
||||
$(window).scrollTop($("#soundcloud-settings .errors").position().top);
|
||||
|
@ -123,6 +122,20 @@ function createWidgetHelpDescription() {
|
|||
},
|
||||
});
|
||||
|
||||
function setSoundCloudCheckBoxListener() {
|
||||
var subCheckBox= $("#UseSoundCloud,#SoundCloudDownloadbleOption");
|
||||
var mainCheckBox= $("#UploadToSoundcloudOption");
|
||||
subCheckBox.change(function(e){
|
||||
if (subCheckBox.is(':checked')) {
|
||||
mainCheckBox.attr("checked", true);
|
||||
}
|
||||
});
|
||||
|
||||
mainCheckBox.change(function(e){
|
||||
if (!mainCheckBox.is(':checked')) {
|
||||
$("#UseSoundCloud,#SoundCloudDownloadbleOption").attr("checked", false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
@ -132,9 +145,22 @@ $(document).ready(function() {
|
|||
$(this).toggleClass("closed");
|
||||
return false;
|
||||
}).next().hide();
|
||||
|
||||
$('#pref_save').live('click', function() {
|
||||
var data = $('#pref_form').serialize();
|
||||
var url = baseUrl+'Preference/index';
|
||||
|
||||
$.post(url, {format: "json", data: data}, function(data){
|
||||
var json = $.parseJSON(data);
|
||||
$('#content').empty().append(json.html);
|
||||
setTimeout(removeSuccessMsg, 5000);
|
||||
showErrorSections();
|
||||
});
|
||||
});
|
||||
|
||||
showErrorSections();
|
||||
|
||||
setSoundCloudCheckBoxListener();
|
||||
setMailServerInputReadonly();
|
||||
setSystemFromEmailReadonly();
|
||||
setConfigureMailServerListener();
|
||||
|
|
|
@ -39,8 +39,8 @@ function restrictOggBitrate(ele, on){
|
|||
div.find("select[id$=data-bitrate]").find("option[value='24']").attr("disabled","disabled");
|
||||
div.find("select[id$=data-bitrate]").find("option[value='32']").attr("disabled","disabled");
|
||||
}else{
|
||||
div.find("select[id$=data-bitrate]").find("option[value='24']").attr("disabled","");
|
||||
div.find("select[id$=data-bitrate]").find("option[value='32']").attr("disabled","");
|
||||
div.find("select[id$=data-bitrate]").find("option[value='24']").removeAttr("disabled");
|
||||
div.find("select[id$=data-bitrate]").find("option[value='32']").removeAttr("disabled");
|
||||
}
|
||||
}
|
||||
function hideForShoutcast(ele){
|
||||
|
@ -75,7 +75,7 @@ function showForIcecast(ele){
|
|||
}
|
||||
|
||||
function checkLiquidsoapStatus(){
|
||||
var url = '/Preference/get-liquidsoap-status/format/json';
|
||||
var url = baseUrl+'Preference/get-liquidsoap-status/format/json';
|
||||
var id = $(this).attr("id");
|
||||
$.post(url, function(json){
|
||||
var json_obj = jQuery.parseJSON(json);
|
||||
|
@ -93,13 +93,13 @@ function checkLiquidsoapStatus(){
|
|||
}
|
||||
var html;
|
||||
if(status == "OK"){
|
||||
html = '<div class="stream-status status-good"><h3>Connected to the streaming server</h3></div>';
|
||||
html = '<div class="stream-status status-good"><h3>'+$.i18n._("Connected to the streaming server")+'</h3></div>';
|
||||
}else if(status == "N/A"){
|
||||
html = '<div class="stream-status status-disabled"><h3>The stream is disabled</h3></div>';
|
||||
html = '<div class="stream-status status-disabled"><h3>'+$.i18n._("The stream is disabled")+'</h3></div>';
|
||||
}else if(status == "waiting"){
|
||||
html = '<div class="stream-status status-info"><h3>Getting information from the server...</h3></div>';
|
||||
html = '<div class="stream-status status-info"><h3>'+$.i18n._("Getting information from the server...")+'</h3></div>';
|
||||
}else{
|
||||
html = '<div class="stream-status status-error"><h3>Can not connect to the streaming server</h3><p>'+status+'</p></div>';
|
||||
html = '<div class="stream-status status-error"><h3>'+$.i18n._("Can not connect to the streaming server")+'</h3><p>'+status+'</p></div>';
|
||||
}
|
||||
$("#s"+id+"Liquidsoap-error-msg-element").html(html);
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ function setLiveSourceConnectionOverrideListener(){
|
|||
live_dj_input.val(url)
|
||||
live_dj_input.attr("readonly", "readonly")
|
||||
live_dj_actions.hide()
|
||||
$.get("/Preference/set-source-connection-url/", {format: "json", type: "livedj", url:encodeURIComponent(url), override: 1});
|
||||
$.get(baseUrl+"Preference/set-source-connection-url/", {format: "json", type: "livedj", url:encodeURIComponent(url), override: 1});
|
||||
event.preventDefault()
|
||||
})
|
||||
|
||||
|
@ -142,7 +142,7 @@ function setLiveSourceConnectionOverrideListener(){
|
|||
live_dj_input.val(url)
|
||||
live_dj_input.attr("readonly", "readonly")
|
||||
live_dj_actions.hide()
|
||||
$.get("/Preference/set-source-connection-url", {format: "json", type: "livedj", url:encodeURIComponent(url), override: 0});
|
||||
$.get(baseUrl+"Preference/set-source-connection-url", {format: "json", type: "livedj", url:encodeURIComponent(url), override: 0});
|
||||
event.preventDefault()
|
||||
})
|
||||
|
||||
|
@ -151,7 +151,7 @@ function setLiveSourceConnectionOverrideListener(){
|
|||
master_dj_input.val(url)
|
||||
master_dj_input.attr("readonly", "readonly")
|
||||
master_dj_actions.hide()
|
||||
$.get("/Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url), override: 1})
|
||||
$.get(baseUrl+"Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url), override: 1})
|
||||
event.preventDefault()
|
||||
})
|
||||
|
||||
|
@ -165,13 +165,13 @@ function setLiveSourceConnectionOverrideListener(){
|
|||
master_dj_input.val(url)
|
||||
master_dj_input.attr("readonly", "readonly")
|
||||
master_dj_actions.hide()
|
||||
$.get("/Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url), override: 0})
|
||||
$.get(baseUrl+"Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url), override: 0})
|
||||
event.preventDefault()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function() {
|
||||
function setupEventListeners() {
|
||||
// initial stream url
|
||||
$("dd[id=outputStreamURL-element]").each(function(){
|
||||
rebuildStreamURL($(this))
|
||||
|
@ -231,7 +231,7 @@ $(document).ready(function() {
|
|||
}
|
||||
})
|
||||
|
||||
$('.toggle legend').live('click',function() {
|
||||
$('.toggle legend').click(function() {
|
||||
$(this).parent().toggleClass('closed');
|
||||
return false;
|
||||
});
|
||||
|
@ -250,7 +250,9 @@ $(document).ready(function() {
|
|||
// qtip for help text
|
||||
$(".override_help_icon").qtip({
|
||||
content: {
|
||||
text: "If Airtime is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151. For more detail, please read the <a target=\"_blank\" href=\"http://www.sourcefabric.org/en/airtime/manuals/\">Airtime manual</a>."
|
||||
text: $.i18n._("If Airtime is behind a router or firewall, you may need to configure port forwarding and this field information will be incorrect. In this case you will need to manually update this field so it shows the correct host/port/mount that your DJ's need to connect to. The allowed range is between 1024 and 49151.")+" "+
|
||||
sprintf($.i18n._(
|
||||
"For more details, please read the %sAirtime Manual%s"), "<a target='_blank' href='http://www.sourcefabric.org/en/airtime/manuals/'>", "</a>")
|
||||
},
|
||||
hide: {
|
||||
delay: 500,
|
||||
|
@ -271,7 +273,7 @@ $(document).ready(function() {
|
|||
|
||||
$(".icecast_metadata_help_icon").qtip({
|
||||
content: {
|
||||
text: "Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option."
|
||||
text: $.i18n._("Check this option to enable metadata for OGG streams (stream metadata is the track title, artist, and show name that is displayed in an audio player). VLC and mplayer have a serious bug when playing an OGG/VORBIS stream that has metadata information enabled: they will disconnect from the stream after every song. If you are using an OGG stream and your listeners do not require support for these audio players, then feel free to enable this option.")
|
||||
},
|
||||
hide: {
|
||||
delay: 500,
|
||||
|
@ -292,7 +294,7 @@ $(document).ready(function() {
|
|||
|
||||
$("#auto_transition_help").qtip({
|
||||
content: {
|
||||
text: "Check this box to automatically switch off Master/Show source upon source disconnection."
|
||||
text: $.i18n._("Check this box to automatically switch off Master/Show source upon source disconnection.")
|
||||
},
|
||||
hide: {
|
||||
delay: 500,
|
||||
|
@ -313,7 +315,7 @@ $(document).ready(function() {
|
|||
|
||||
$("#auto_switch_help").qtip({
|
||||
content: {
|
||||
text: "Check this box to automatically switch on Master/Show source upon source connection."
|
||||
text: $.i18n._("Check this box to automatically switch on Master/Show source upon source connection.")
|
||||
},
|
||||
hide: {
|
||||
delay: 500,
|
||||
|
@ -334,7 +336,28 @@ $(document).ready(function() {
|
|||
|
||||
$(".stream_username_help_icon").qtip({
|
||||
content: {
|
||||
text: "If your Icecast server expects a username of 'source', this field can be left blank."
|
||||
text: $.i18n._("If your Icecast server expects a username of 'source', this field can be left blank.")
|
||||
},
|
||||
hide: {
|
||||
delay: 500,
|
||||
fixed: true
|
||||
},
|
||||
style: {
|
||||
border: {
|
||||
width: 0,
|
||||
radius: 4
|
||||
},
|
||||
classes: "ui-tooltip-dark ui-tooltip-rounded"
|
||||
},
|
||||
position: {
|
||||
my: "left bottom",
|
||||
at: "right center"
|
||||
},
|
||||
})
|
||||
|
||||
$(".admin_username_help_icon").qtip({
|
||||
content: {
|
||||
text: $.i18n._("This is the admin username and password for Icecast/SHOUTcast to get listener statistics.")
|
||||
},
|
||||
hide: {
|
||||
delay: 500,
|
||||
|
@ -355,7 +378,7 @@ $(document).ready(function() {
|
|||
|
||||
$(".master_username_help_icon").qtip({
|
||||
content: {
|
||||
text: "If your live streaming client does not ask for a username, this field should be 'source'."
|
||||
text: $.i18n._("If your live streaming client does not ask for a username, this field should be 'source'.")
|
||||
},
|
||||
hide: {
|
||||
delay: 500,
|
||||
|
@ -373,4 +396,39 @@ $(document).ready(function() {
|
|||
at: "right center"
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
function setSliderForReplayGain(){
|
||||
$( "#slider-range-max" ).slider({
|
||||
range: "max",
|
||||
min: -10,
|
||||
max: 10,
|
||||
value: $("#rg_modifier_value").html(),
|
||||
slide: function( event, ui ) {
|
||||
$( "#replayGainModifier" ).val( ui.value );
|
||||
$("#rg_modifier_value").html(ui.value);
|
||||
}
|
||||
});
|
||||
$( "#replayGainModifier" ).val( $( "#slider-range-max" ).slider( "value" ) );
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
setupEventListeners();
|
||||
setSliderForReplayGain();
|
||||
|
||||
$('#stream_save').live('click', function(){
|
||||
var confirm_pypo_restart_text = $.i18n._("If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted.");
|
||||
if (confirm(confirm_pypo_restart_text)) {
|
||||
var data = $('#stream_form').serialize();
|
||||
var url = baseUrl+'Preference/stream-setting';
|
||||
|
||||
$.post(url, {format:"json", data: data}, function(data){
|
||||
var json = $.parseJSON(data);
|
||||
$('#content').empty().append(json.html);
|
||||
setupEventListeners();
|
||||
setSliderForReplayGain();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ $(document).ready(function() {
|
|||
var ul, li;
|
||||
|
||||
ul = logoEl.find('.errors');
|
||||
li = $("<li/>").append("Image must be one of jpg, jpeg, png, or gif");
|
||||
li = $("<li/>").append($.i18n._("Image must be one of jpg, jpeg, png, or gif"));
|
||||
|
||||
//errors ul has already been created.
|
||||
if (ul.length > 0) {
|
||||
|
|
|
@ -32,8 +32,11 @@ function createDateInput(el, onSelect) {
|
|||
minDate: adjustDateToServerDate(new Date(), timezoneOffset),
|
||||
onSelect: onSelect,
|
||||
dateFormat: 'yy-mm-dd',
|
||||
closeText: 'Close',
|
||||
showButtonPanel: true,
|
||||
//i18n_months, i18n_days_short are in common.js
|
||||
monthNames: i18n_months,
|
||||
dayNamesMin: i18n_days_short,
|
||||
closeText: $.i18n._('Close'),
|
||||
//showButtonPanel: true,
|
||||
firstDay: weekStart
|
||||
});
|
||||
}
|
||||
|
@ -47,13 +50,13 @@ function autoSelect(event, ui) {
|
|||
function findHosts(request, callback) {
|
||||
var search, url;
|
||||
|
||||
url = "/User/get-hosts";
|
||||
url = baseUrl+"User/get-hosts";
|
||||
search = request.term;
|
||||
|
||||
var noResult = new Array();
|
||||
noResult[0] = new Array();
|
||||
noResult[0]['value'] = $("#add_show_hosts_autocomplete").val();
|
||||
noResult[0]['label'] = "No result found";
|
||||
noResult[0]['label'] = $.i18n._("No result found");
|
||||
noResult[0]['index'] = null;
|
||||
|
||||
$.post(url,
|
||||
|
@ -226,7 +229,7 @@ function setAddShowEvents() {
|
|||
|
||||
form.find(".airtime_auth_help_icon").qtip({
|
||||
content: {
|
||||
text: "This follows the same security pattern for the shows: only users assigned to the show can connect."
|
||||
text: $.i18n._("This follows the same security pattern for the shows: only users assigned to the show can connect.")
|
||||
},
|
||||
hide: {
|
||||
delay: 500,
|
||||
|
@ -246,7 +249,7 @@ function setAddShowEvents() {
|
|||
});
|
||||
form.find(".custom_auth_help_icon").qtip({
|
||||
content: {
|
||||
text: "Specify custom authentication which will work only for this show."
|
||||
text: $.i18n._("Specify custom authentication which will work only for this show.")
|
||||
},
|
||||
hide: {
|
||||
delay: 500,
|
||||
|
@ -266,7 +269,7 @@ function setAddShowEvents() {
|
|||
});
|
||||
form.find(".stream_username_help_icon").qtip({
|
||||
content: {
|
||||
text: "If your live streaming client does not ask for a username, this field should be 'source'."
|
||||
text: $.i18n._("If your live streaming client does not ask for a username, this field should be 'source'.")
|
||||
},
|
||||
hide: {
|
||||
delay: 500,
|
||||
|
@ -302,23 +305,33 @@ function setAddShowEvents() {
|
|||
$("#add_show_start_time").timepicker({
|
||||
amPmText: ['', ''],
|
||||
defaultTime: '00:00',
|
||||
onSelect: onStartTimeSelect
|
||||
onSelect: onStartTimeSelect,
|
||||
hourText: $.i18n._("Hour"),
|
||||
minuteText: $.i18n._("Minute")
|
||||
});
|
||||
$("#add_show_end_time").timepicker({
|
||||
amPmText: ['', ''],
|
||||
onSelect: onEndTimeSelect
|
||||
onSelect: onEndTimeSelect,
|
||||
hourText: $.i18n._("Hour"),
|
||||
minuteText: $.i18n._("Minute")
|
||||
});
|
||||
|
||||
form.find('input[name^="add_show_rebroadcast_date_absolute"]').datepicker({
|
||||
minDate: adjustDateToServerDate(new Date(), timezoneOffset),
|
||||
dateFormat: 'yy-mm-dd',
|
||||
closeText: 'Close',
|
||||
showButtonPanel: true,
|
||||
firstDay: weekStart
|
||||
minDate: adjustDateToServerDate(new Date(), timezoneOffset),
|
||||
dateFormat: 'yy-mm-dd',
|
||||
//i18n_months, i18n_days_short are in common.js
|
||||
monthNames: i18n_months,
|
||||
dayNamesMin: i18n_days_short,
|
||||
closeText: 'Close',
|
||||
showButtonPanel: true,
|
||||
firstDay: weekStart
|
||||
});
|
||||
form.find('input[name^="add_show_rebroadcast_time"]').timepicker({
|
||||
amPmText: ['', ''],
|
||||
defaultTime: ''
|
||||
defaultTime: '',
|
||||
closeButtonText: $.i18n._("Done"),
|
||||
hourText: $.i18n._("Hour"),
|
||||
minuteText: $.i18n._("Minute")
|
||||
});
|
||||
|
||||
form.find(".add_absolute_rebroadcast_day").click(function(){
|
||||
|
@ -397,7 +410,7 @@ function setAddShowEvents() {
|
|||
.fullCalendar('render');
|
||||
|
||||
$("#add-show-form").hide();
|
||||
$.get("/Schedule/get-form", {format:"json"}, function(json){
|
||||
$.get(baseUrl+"Schedule/get-form", {format:"json"}, function(json){
|
||||
$("#add-show-form")
|
||||
.empty()
|
||||
.append(json.form);
|
||||
|
@ -443,7 +456,7 @@ function setAddShowEvents() {
|
|||
applyPlatformOpacityRules: false
|
||||
});
|
||||
|
||||
var action = "/Schedule/"+String(addShowButton.attr("data-action"));
|
||||
var action = baseUrl+"Schedule/"+String(addShowButton.attr("data-action"));
|
||||
|
||||
$.post(action, {format: "json", data: data, hosts: hosts, days: days}, function(json){
|
||||
//addShowButton.removeClass("disabled");
|
||||
|
@ -463,7 +476,7 @@ function setAddShowEvents() {
|
|||
.fullCalendar('render');
|
||||
|
||||
$("#add-show-form").hide();
|
||||
$.get("/Schedule/get-form", {format:"json"}, function(json){
|
||||
$.get(baseUrl+"Schedule/get-form", {format:"json"}, function(json){
|
||||
$("#add-show-form")
|
||||
.empty()
|
||||
.append(json.form);
|
||||
|
@ -484,8 +497,8 @@ function setAddShowEvents() {
|
|||
});
|
||||
});
|
||||
|
||||
var regDate = new RegExp(/^[0-9]{4}-[0-1][0-9]-[0-3][0-9]/);
|
||||
var regTime = new RegExp(/^[0-2][0-9]:[0-5][0-9]/);
|
||||
var regDate = new RegExp(/^[0-9]{4}-[0-1][0-9]-[0-3][0-9]$/);
|
||||
var regTime = new RegExp(/^[0-2][0-9]:[0-5][0-9]$/);
|
||||
|
||||
// when start date/time changes, set end date/time to start date/time+1 hr
|
||||
$('#add_show_start_date, #add_show_start_time').bind('input', 'change', function(){
|
||||
|
@ -579,7 +592,7 @@ function setAddShowEvents() {
|
|||
var loadingIcon = $('#icon-loader-small');
|
||||
|
||||
loadingIcon.show();
|
||||
$.post("/Schedule/calculate-duration", {startTime: startDateTime, endTime: endDateTime}, function(data){
|
||||
$.post(baseUrl+"Schedule/calculate-duration", {startTime: startDateTime, endTime: endDateTime}, function(data){
|
||||
$('#add_show_duration').val(JSON.parse(data));
|
||||
loadingIcon.hide();
|
||||
});
|
||||
|
@ -628,7 +641,7 @@ $(document).ready(function() {
|
|||
//Alert the error and reload the page
|
||||
//this function is used to resolve concurrency issue
|
||||
function alertShowErrorAndReload(){
|
||||
alert("The show instance doesn't exist anymore!");
|
||||
alert($.i18n._("The show instance doesn't exist anymore!"));
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
function scheduleRefetchEvents(json) {
|
||||
if(json.show_error == true){
|
||||
alert("The show instance doesn't exist anymore!");
|
||||
alert($.i18n._("The show instance doesn't exist anymore!"));
|
||||
}
|
||||
if(json.show_id) {
|
||||
var dialog_id = parseInt($("#add_show_id").val(), 10);
|
||||
|
@ -41,7 +41,7 @@ function openAddShowForm() {
|
|||
function makeAddShowButton(){
|
||||
$('.fc-header-left')
|
||||
.append('<span class="fc-header-space"></span>')
|
||||
.append('<span class="fc-button"><a href="#" class="add-button"><span class="add-icon"></span>Show</a></span>')
|
||||
.append('<span class="fc-button"><a href="#" class="add-button"><span class="add-icon"></span>'+$.i18n._("Show")+'</a></span>')
|
||||
.find('span.fc-button:last > a')
|
||||
.click(function(){
|
||||
openAddShowForm();
|
||||
|
@ -154,12 +154,12 @@ function viewDisplay( view ) {
|
|||
var calendarEl = this;
|
||||
|
||||
var select = $('<select class="schedule_change_slots input_select"/>')
|
||||
.append('<option value="1">1m</option>')
|
||||
.append('<option value="5">5m</option>')
|
||||
.append('<option value="10">10m</option>')
|
||||
.append('<option value="15">15m</option>')
|
||||
.append('<option value="30">30m</option>')
|
||||
.append('<option value="60">60m</option>')
|
||||
.append('<option value="1">'+$.i18n._("1m")+'</option>')
|
||||
.append('<option value="5">'+$.i18n._("5m")+'</option>')
|
||||
.append('<option value="10">'+$.i18n._("10m")+'</option>')
|
||||
.append('<option value="15">'+$.i18n._("15m")+'</option>')
|
||||
.append('<option value="30">'+$.i18n._("30m")+'</option>')
|
||||
.append('<option value="60">'+$.i18n._("60m")+'</option>')
|
||||
.change(function(){
|
||||
var slotMin = $(this).val();
|
||||
var opt = view.calendar.options;
|
||||
|
@ -176,7 +176,7 @@ function viewDisplay( view ) {
|
|||
.fullCalendar( 'gotoDate', date );
|
||||
|
||||
//save slotMin value to db
|
||||
var url = '/Schedule/set-time-interval/format/json';
|
||||
var url = baseUrl+'Schedule/set-time-interval/format/json';
|
||||
$.post(url, {timeInterval: slotMin});
|
||||
});
|
||||
|
||||
|
@ -201,7 +201,7 @@ function viewDisplay( view ) {
|
|||
}
|
||||
|
||||
//save view name to db
|
||||
var url = '/Schedule/set-time-scale/format/json';
|
||||
var url = baseUrl+'Schedule/set-time-scale/format/json';
|
||||
$.post(url, {timeScale: view.name});
|
||||
}
|
||||
|
||||
|
@ -252,40 +252,28 @@ function eventRender(event, element, view) {
|
|||
} else if (view.name === 'month' && event.record === 1 && event.soundcloud_id === -3) {
|
||||
$(element).find(".fc-event-title").after('<span id="'+event.id+'" class="small-icon recording"></span><span id="'+event.id+'" class="small-icon sc-error"></span>');
|
||||
}
|
||||
|
||||
//add scheduled show content empty icon
|
||||
//addIcon = checkEmptyShowStatus(event);
|
||||
//if (!addIcon) {
|
||||
if (view.name === 'agendaDay' || view.name === 'agendaWeek') {
|
||||
if (event.show_empty === 1 && event.record === 0 && event.rebroadcast === 0) {
|
||||
if (event.soundcloud_id === -1) {
|
||||
$(element)
|
||||
.find(".fc-event-time")
|
||||
.before('<span id="'+event.id+'" title="Show is empty" class="small-icon show-empty"></span>');
|
||||
} else if (event.soundcloud_id > 0) {
|
||||
|
||||
} else if (event.soundcloud_id === -2) {
|
||||
|
||||
} else if (event.soundcloud_id === -3) {
|
||||
|
||||
}
|
||||
}
|
||||
} else if (view.name === 'month') {
|
||||
if (event.show_empty === 1 && event.record === 0 && event.rebroadcast === 0) {
|
||||
if (event.soundcloud_id === -1) {
|
||||
$(element)
|
||||
.find(".fc-event-title")
|
||||
.after('<span id="'+event.id+'" title="Show is empty" class="small-icon show-empty"></span>');
|
||||
} else if (event.soundcloud_id > 0) {
|
||||
|
||||
} else if (event.soundcloud_id === -2) {
|
||||
|
||||
} else if (event.soundcloud_id === -3) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (view.name === 'agendaDay' || view.name === 'agendaWeek') {
|
||||
if (event.show_empty === 1 && event.record === 0 && event.rebroadcast === 0) {
|
||||
$(element)
|
||||
.find(".fc-event-time")
|
||||
.before('<span id="'+event.id+'" class="small-icon show-empty"></span>');
|
||||
} else if (event.show_partial_filled === true) {
|
||||
$(element)
|
||||
.find(".fc-event-time")
|
||||
.before('<span id="'+event.id+'" class="small-icon show-partial-filled"></span>');
|
||||
}
|
||||
//}
|
||||
} else if (view.name === 'month') {
|
||||
if (event.show_empty === 1 && event.record === 0 && event.rebroadcast === 0) {
|
||||
$(element)
|
||||
.find(".fc-event-title")
|
||||
.after('<span id="'+event.id+'" title="'+$.i18n._("Show is empty")+'" class="small-icon show-empty"></span>');
|
||||
} else if (event.show_partial_filled === true) {
|
||||
$(element)
|
||||
.find(".fc-event-title")
|
||||
.after('<span id="'+event.id+'" title="'+$.i18n._("Show is partially filled")+'" class="small-icon show-partial-filled"></span>');
|
||||
}
|
||||
}
|
||||
|
||||
//rebroadcast icon
|
||||
if((view.name === 'agendaDay' || view.name === 'agendaWeek') && event.rebroadcast === 1) {
|
||||
|
@ -300,14 +288,12 @@ function eventRender(event, element, view) {
|
|||
function eventAfterRender( event, element, view ) {
|
||||
|
||||
$(element).find(".small-icon").live('mouseover',function(){
|
||||
addQtipToSCIcons($(this));
|
||||
addQtipsToIcons($(this));
|
||||
});
|
||||
}
|
||||
|
||||
function eventDrop(event, dayDelta, minuteDelta, allDay, revertFunc, jsEvent, ui, view) {
|
||||
var url;
|
||||
|
||||
url = '/Schedule/move-show/format/json';
|
||||
var url = baseUrl+'Schedule/move-show/format/json';
|
||||
|
||||
$.post(url,
|
||||
{day: dayDelta, min: minuteDelta, showInstanceId: event.id},
|
||||
|
@ -323,9 +309,7 @@ function eventDrop(event, dayDelta, minuteDelta, allDay, revertFunc, jsEvent, ui
|
|||
}
|
||||
|
||||
function eventResize( event, dayDelta, minuteDelta, revertFunc, jsEvent, ui, view ) {
|
||||
var url;
|
||||
|
||||
url = '/Schedule/resize-show/format/json';
|
||||
var url = baseUrl+'Schedule/resize-show/format/json';
|
||||
|
||||
$.post(url,
|
||||
{day: dayDelta, min: minuteDelta, showId: event.showId},
|
||||
|
@ -348,7 +332,7 @@ function getFullCalendarEvents(start, end, callback) {
|
|||
start_date = makeTimeStamp(start);
|
||||
end_date = makeTimeStamp(end);
|
||||
|
||||
url = '/Schedule/event-feed';
|
||||
url = baseUrl+'Schedule/event-feed';
|
||||
|
||||
var d = new Date();
|
||||
|
||||
|
@ -358,7 +342,7 @@ function getFullCalendarEvents(start, end, callback) {
|
|||
}
|
||||
|
||||
function checkSCUploadStatus(){
|
||||
var url = '/Library/get-upload-to-soundcloud-status/format/json';
|
||||
var url = baseUrl+'Library/get-upload-to-soundcloud-status/format/json';
|
||||
$("span[class*=progress]").each(function(){
|
||||
var id = $(this).attr("id");
|
||||
$.post(url, {format: "json", id: id, type:"show"}, function(json){
|
||||
|
@ -374,7 +358,7 @@ function checkSCUploadStatus(){
|
|||
* show icon
|
||||
*/
|
||||
function getCurrentShow(){
|
||||
var url = '/Schedule/get-current-show/format/json',
|
||||
var url = baseUrl+'Schedule/get-current-show/format/json',
|
||||
id,
|
||||
$el;
|
||||
$.post(url, {format: "json"}, function(json) {
|
||||
|
@ -422,13 +406,14 @@ function getCurrentShow(){
|
|||
});
|
||||
}
|
||||
|
||||
function addQtipToSCIcons(ele){
|
||||
|
||||
function addQtipsToIcons(ele){
|
||||
var id = $(ele).attr("id");
|
||||
|
||||
if($(ele).hasClass("progress")){
|
||||
$(ele).qtip({
|
||||
content: {
|
||||
text: "Uploading in progress..."
|
||||
text: $.i18n._("Uploading in progress...")
|
||||
},
|
||||
position:{
|
||||
adjust: {
|
||||
|
@ -439,6 +424,9 @@ function addQtipToSCIcons(ele){
|
|||
my: "left top",
|
||||
viewport: $(window)
|
||||
},
|
||||
style: {
|
||||
classes: "ui-tooltip-dark file-md-long"
|
||||
},
|
||||
show: {
|
||||
ready: true // Needed to make it show on first mouseover event
|
||||
}
|
||||
|
@ -446,13 +434,13 @@ function addQtipToSCIcons(ele){
|
|||
}else if($(ele).hasClass("soundcloud")){
|
||||
$(ele).qtip({
|
||||
content: {
|
||||
text: "Retreiving data from the server...",
|
||||
text: $.i18n._("Retreiving data from the server..."),
|
||||
ajax: {
|
||||
url: "/Library/get-upload-to-soundcloud-status",
|
||||
url: baseUrl+"Library/get-upload-to-soundcloud-status",
|
||||
type: "post",
|
||||
data: ({format: "json", id : id, type: "file"}),
|
||||
data: ({format: "json", id : id, type: "show"}),
|
||||
success: function(json, status){
|
||||
this.set('content.text', "The soundcloud id for this file is: "+json.sc_id);
|
||||
this.set('content.text', $.i18n._("The soundcloud id for this file is: ")+json.sc_id);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -465,6 +453,9 @@ function addQtipToSCIcons(ele){
|
|||
my: "left top",
|
||||
viewport: $(window)
|
||||
},
|
||||
style: {
|
||||
classes: "ui-tooltip-dark file-md-long"
|
||||
},
|
||||
show: {
|
||||
ready: true // Needed to make it show on first mouseover event
|
||||
}
|
||||
|
@ -472,14 +463,14 @@ function addQtipToSCIcons(ele){
|
|||
}else if($(ele).hasClass("sc-error")){
|
||||
$(ele).qtip({
|
||||
content: {
|
||||
text: "Retreiving data from the server...",
|
||||
text: $.i18n._("Retreiving data from the server..."),
|
||||
ajax: {
|
||||
url: "/Library/get-upload-to-soundcloud-status",
|
||||
url: baseUrl+"Library/get-upload-to-soundcloud-status",
|
||||
type: "post",
|
||||
data: ({format: "json", id : id, type: "show"}),
|
||||
success: function(json, status){
|
||||
this.set('content.text', "There was error while uploading to soundcloud.<br>"+"Error code: "+json.error_code+
|
||||
"<br>"+"Error msg: "+json.error_msg+"<br>");
|
||||
this.set('content.text', $.i18n._("There was error while uploading to soundcloud.")+"<br>"+$.i18n._("Error code: ")+json.error_code+
|
||||
"<br>"+$.i18n._("Error msg: ")+json.error_msg+"<br>");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -492,6 +483,9 @@ function addQtipToSCIcons(ele){
|
|||
my: "left top",
|
||||
viewport: $(window)
|
||||
},
|
||||
style: {
|
||||
classes: "ui-tooltip-dark file-md-long"
|
||||
},
|
||||
show: {
|
||||
ready: true // Needed to make it show on first mouseover event
|
||||
}
|
||||
|
@ -499,7 +493,7 @@ function addQtipToSCIcons(ele){
|
|||
}else if ($(ele).hasClass("show-empty")){
|
||||
$(ele).qtip({
|
||||
content: {
|
||||
text: "This show has no scheduled content."
|
||||
text: $.i18n._("This show has no scheduled content.")
|
||||
},
|
||||
position:{
|
||||
adjust: {
|
||||
|
@ -510,56 +504,46 @@ function addQtipToSCIcons(ele){
|
|||
my: "left top",
|
||||
viewport: $(window)
|
||||
},
|
||||
style: {
|
||||
classes: "ui-tooltip-dark file-md-long"
|
||||
},
|
||||
show: {
|
||||
ready: true // Needed to make it show on first mouseover event
|
||||
}
|
||||
});
|
||||
} else if ($(ele).hasClass("show-partial-filled")){
|
||||
$(ele).qtip({
|
||||
content: {
|
||||
text: $.i18n._("This show is not completely filled with content.")
|
||||
},
|
||||
position:{
|
||||
adjust: {
|
||||
resize: true,
|
||||
method: "flip flip"
|
||||
},
|
||||
at: "right center",
|
||||
my: "left top",
|
||||
viewport: $(window)
|
||||
},
|
||||
style: {
|
||||
classes: "ui-tooltip-dark file-md-long"
|
||||
},
|
||||
show: {
|
||||
ready: true // Needed to make it show on first mouseover event
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/* This functions does two things:
|
||||
* 1. Checks if each event(i.e. a show) is over and removes the show empty icon if it is
|
||||
* 2. Else, if an event is passed in, it checks if the event(i.e. a show) is over
|
||||
* This gets checked when we are deciding if the show-empty icon should be added
|
||||
* at the beginning of an event render callback.
|
||||
*/
|
||||
/*
|
||||
function checkEmptyShowStatus(e) {
|
||||
var currDate = new Date();
|
||||
var endTime;
|
||||
|
||||
if (e === undefined) {
|
||||
var events = $('#schedule_calendar').fullCalendar('clientEvents');
|
||||
|
||||
$.each(events, function(i, event){
|
||||
endTime = event.end;
|
||||
$emptyIcon = $("span[id="+event.id+"][class='small-icon show-empty']");
|
||||
if (currDate.getTime() > endTime.getTime() && $emptyIcon.length === 1) {
|
||||
$emptyIcon.remove();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
endTime = e.end;
|
||||
var showOver = false;
|
||||
if (currDate.getTime() > endTime.getTime()) {
|
||||
showOver = true;
|
||||
}
|
||||
return showOver;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
//Alert the error and reload the page
|
||||
//this function is used to resolve concurrency issue
|
||||
function alertShowErrorAndReload(){
|
||||
alert("The show instance doesn't exist anymore!");
|
||||
alert($.i18n._("The show instance doesn't exist anymore!"));
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
setInterval( "checkSCUploadStatus()", 5000 );
|
||||
setInterval( "getCurrentShow()", 5000 );
|
||||
//setInterval( "checkEmptyShowStatus()", 5000 );
|
||||
});
|
||||
|
||||
var view_name;
|
||||
|
|
|
@ -22,7 +22,7 @@ function checkShowLength(json) {
|
|||
|
||||
if (percent > 100){
|
||||
$("#show_time_warning")
|
||||
.text("Shows longer than their scheduled time will be cut off by a following show.")
|
||||
.text($.i18n._("Shows longer than their scheduled time will be cut off by a following show."))
|
||||
.show();
|
||||
}
|
||||
else {
|
||||
|
@ -33,8 +33,8 @@ function checkShowLength(json) {
|
|||
}
|
||||
|
||||
function confirmCancelShow(show_instance_id){
|
||||
if (confirm('Cancel Current Show?')) {
|
||||
var url = "/Schedule/cancel-current-show";
|
||||
if (confirm($.i18n._('Cancel Current Show?'))) {
|
||||
var url = baseUrl+"Schedule/cancel-current-show";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: {format: "json", id: show_instance_id},
|
||||
|
@ -46,8 +46,8 @@ function confirmCancelShow(show_instance_id){
|
|||
}
|
||||
|
||||
function confirmCancelRecordedShow(show_instance_id){
|
||||
if (confirm('Stop recording current show?')) {
|
||||
var url = "/Schedule/cancel-current-show";
|
||||
if (confirm($.i18n._('Stop recording current show?'))) {
|
||||
var url = baseUrl+"Schedule/cancel-current-show";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: {format: "json", id: show_instance_id},
|
||||
|
@ -60,7 +60,7 @@ function confirmCancelRecordedShow(show_instance_id){
|
|||
|
||||
function uploadToSoundCloud(show_instance_id){
|
||||
|
||||
var url = "/Schedule/upload-to-sound-cloud";
|
||||
var url = baseUrl+"Schedule/upload-to-sound-cloud";
|
||||
var span = $(window.triggerElement).find(".recording");
|
||||
|
||||
$.post(url,
|
||||
|
@ -80,8 +80,7 @@ function uploadToSoundCloud(show_instance_id){
|
|||
}
|
||||
|
||||
function checkCalendarSCUploadStatus(){
|
||||
|
||||
var url = '/Library/get-upload-to-soundcloud-status',
|
||||
var url = baseUrl+'Library/get-upload-to-soundcloud-status',
|
||||
span,
|
||||
id;
|
||||
|
||||
|
@ -166,7 +165,7 @@ function buildScheduleDialog (json) {
|
|||
close: closeDialog,
|
||||
buttons: [
|
||||
{
|
||||
text: "Ok",
|
||||
text: $.i18n._("Ok"),
|
||||
"class": "btn",
|
||||
click: function() {
|
||||
$(this).dialog("close");
|
||||
|
@ -208,14 +207,14 @@ function buildContentDialog (json){
|
|||
|
||||
dialog.dialog({
|
||||
autoOpen: false,
|
||||
title: "Contents of Show \"" + json.showTitle + "\"",
|
||||
title: $.i18n._("Contents of Show") +" '" + json.showTitle + "'",
|
||||
width: width,
|
||||
height: height,
|
||||
modal: true,
|
||||
close: closeDialog,
|
||||
buttons: [
|
||||
{
|
||||
text: "Ok",
|
||||
text: $.i18n._("Ok"),
|
||||
"class": "btn",
|
||||
click: function() {
|
||||
dialog.remove();
|
||||
|
@ -263,6 +262,46 @@ function createFullCalendar(data){
|
|||
agenda: 'H:mm{ - H:mm}',
|
||||
month: 'H:mm{ - H:mm}'
|
||||
},
|
||||
//i18n_months is in common.js
|
||||
monthNames: i18n_months,
|
||||
monthNamesShort: [
|
||||
$.i18n._('Jan'),
|
||||
$.i18n._('Feb'),
|
||||
$.i18n._('Mar'),
|
||||
$.i18n._('Apr'),
|
||||
$.i18n._('May'),
|
||||
$.i18n._('Jun'),
|
||||
$.i18n._('Jul'),
|
||||
$.i18n._('Aug'),
|
||||
$.i18n._('Sep'),
|
||||
$.i18n._('Oct'),
|
||||
$.i18n._('Nov'),
|
||||
$.i18n._('Dec')
|
||||
],
|
||||
buttonText: {
|
||||
today: $.i18n._('today'),
|
||||
month: $.i18n._('month'),
|
||||
week: $.i18n._('week'),
|
||||
day: $.i18n._('day')
|
||||
},
|
||||
dayNames: [
|
||||
$.i18n._('Sunday'),
|
||||
$.i18n._('Monday'),
|
||||
$.i18n._('Tuesday'),
|
||||
$.i18n._('Wednesday'),
|
||||
$.i18n._('Thursday'),
|
||||
$.i18n._('Friday'),
|
||||
$.i18n._('Saturday')
|
||||
],
|
||||
dayNamesShort: [
|
||||
$.i18n._('Sun'),
|
||||
$.i18n._('Mon'),
|
||||
$.i18n._('Tue'),
|
||||
$.i18n._('Wed'),
|
||||
$.i18n._('Thu'),
|
||||
$.i18n._('Fri'),
|
||||
$.i18n._('Sat')
|
||||
],
|
||||
contentHeight: mainHeight,
|
||||
theme: true,
|
||||
lazyFetching: false,
|
||||
|
@ -284,12 +323,12 @@ function createFullCalendar(data){
|
|||
//Alert the error and reload the page
|
||||
//this function is used to resolve concurrency issue
|
||||
function alertShowErrorAndReload(){
|
||||
alert("The show instance doesn't exist anymore!");
|
||||
alert($.i18n._("The show instance doesn't exist anymore!"));
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$.ajax({ url: "/Api/calendar-init/format/json", dataType:"json", success:createFullCalendar
|
||||
$.ajax({ url: baseUrl+"Api/calendar-init/format/json", dataType:"json", success:createFullCalendar
|
||||
, error:function(jqXHR, textStatus, errorThrown){}});
|
||||
|
||||
setInterval(checkCalendarSCUploadStatus, 5000);
|
||||
|
@ -325,7 +364,7 @@ $(document).ready(function() {
|
|||
if (oItems.clear !== undefined) {
|
||||
|
||||
callback = function() {
|
||||
if (confirm("Remove all content?")) {
|
||||
if (confirm($.i18n._("Remove all content?"))) {
|
||||
$.post(oItems.clear.url, {format: "json", id: data.id}, function(json){
|
||||
scheduleRefetchEvents(json);
|
||||
});
|
||||
|
@ -459,7 +498,7 @@ $(document).ready(function() {
|
|||
}
|
||||
|
||||
$.ajax({
|
||||
url: "/schedule/make-context-menu",
|
||||
url: baseUrl+"schedule/make-context-menu",
|
||||
type: "GET",
|
||||
data: {id : data.id, format: "json"},
|
||||
dataType: "json",
|
||||
|
|
|
@ -38,6 +38,30 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
mod.timestamp = timestamp;
|
||||
};
|
||||
|
||||
mod.updateCalendarStatusIcon = function(json) {
|
||||
|
||||
|
||||
if (window.location.pathname.toLowerCase() != baseUrl+"schedule") {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var instance_id = json.schedule[0].instance;
|
||||
|
||||
var lastElem = json.schedule[json.schedule.length-1];
|
||||
var $elem = $($(".fc-event-inner.fc-event-skin .fc-event-title#"+instance_id).parent());
|
||||
$elem.find(".small-icon").remove();
|
||||
if (json.schedule[1].empty) {
|
||||
$elem
|
||||
.find(".fc-event-title")
|
||||
.after('<span id="'+instance_id+'" title="'+$.i18n._("Show is empty")+'" class="small-icon show-empty"></span>');
|
||||
} else if (lastElem["fRuntime"][0] == "-") {
|
||||
$elem
|
||||
.find(".fc-event-title")
|
||||
.after('<span id="'+instance_id+'" title="'+$.i18n._("Show is partially filled")+'" class="small-icon show-partial-filled"></span>');
|
||||
}
|
||||
}
|
||||
|
||||
mod.getTimestamp = function() {
|
||||
|
||||
|
@ -264,7 +288,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
mod.disableUI();
|
||||
|
||||
$.post("/showbuilder/schedule-add",
|
||||
$.post(baseUrl+"showbuilder/schedule-add",
|
||||
{"format": "json", "mediaIds": aMediaIds, "schedIds": aSchedIds},
|
||||
mod.fnItemCallback
|
||||
);
|
||||
|
@ -274,7 +298,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
|
||||
mod.disableUI();
|
||||
|
||||
$.post("/showbuilder/schedule-move",
|
||||
$.post(baseUrl+"showbuilder/schedule-move",
|
||||
{"format": "json", "selectedItem": aSelect, "afterItem": aAfter},
|
||||
mod.fnItemCallback
|
||||
);
|
||||
|
@ -283,8 +307,8 @@ var AIRTIME = (function(AIRTIME){
|
|||
mod.fnRemove = function(aItems) {
|
||||
|
||||
mod.disableUI();
|
||||
if (confirm("Remove selected scheduled item(s)?")) {
|
||||
$.post( "/showbuilder/schedule-remove",
|
||||
if (confirm($.i18n._("Delete selected item(s)?"))) {
|
||||
$.post( baseUrl+"showbuilder/schedule-remove",
|
||||
{"items": aItems, "format": "json"},
|
||||
mod.fnItemCallback
|
||||
);
|
||||
|
@ -331,6 +355,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
"url": sSource,
|
||||
"data": aoData,
|
||||
"success": function(json) {
|
||||
mod.updateCalendarStatusIcon(json)
|
||||
mod.setTimestamp(json.timestamp);
|
||||
mod.setShowInstances(json.instances);
|
||||
mod.getSelectedCursors();
|
||||
|
@ -360,17 +385,17 @@ var AIRTIME = (function(AIRTIME){
|
|||
"aoColumns": [
|
||||
/* checkbox */ {"mDataProp": "allowed", "sTitle": "", "sWidth": "15px", "sClass": "sb-checkbox"},
|
||||
/* Type */ {"mDataProp": "image", "sTitle": "", "sClass": "library_image sb-image", "sWidth": "16px"},
|
||||
/* starts */ {"mDataProp": "starts", "sTitle": "Start", "sClass": "sb-starts", "sWidth": "60px"},
|
||||
/* ends */ {"mDataProp": "ends", "sTitle": "End", "sClass": "sb-ends", "sWidth": "60px"},
|
||||
/* runtime */ {"mDataProp": "runtime", "sTitle": "Duration", "sClass": "library_length sb-length", "sWidth": "65px"},
|
||||
/* title */ {"mDataProp": "title", "sTitle": "Title", "sClass": "sb-title"},
|
||||
/* creator */ {"mDataProp": "creator", "sTitle": "Creator", "sClass": "sb-creator"},
|
||||
/* album */ {"mDataProp": "album", "sTitle": "Album", "sClass": "sb-album"},
|
||||
/* cue in */ {"mDataProp": "cuein", "sTitle": "Cue In", "bVisible": false, "sClass": "sb-cue-in"},
|
||||
/* cue out */ {"mDataProp": "cueout", "sTitle": "Cue Out", "bVisible": false, "sClass": "sb-cue-out"},
|
||||
/* fade in */ {"mDataProp": "fadein", "sTitle": "Fade In", "bVisible": false, "sClass": "sb-fade-in"},
|
||||
/* fade out */ {"mDataProp": "fadeout", "sTitle": "Fade Out", "bVisible": false, "sClass": "sb-fade-out"},
|
||||
/* Mime */ {"mDataProp" : "mime", "sTitle" : "Mime", "bVisible": false, "sClass": "sb-mime"}
|
||||
/* starts */ {"mDataProp": "starts", "sTitle": $.i18n._("Start"), "sClass": "sb-starts", "sWidth": "60px"},
|
||||
/* ends */ {"mDataProp": "ends", "sTitle": $.i18n._("End"), "sClass": "sb-ends", "sWidth": "60px"},
|
||||
/* runtime */ {"mDataProp": "runtime", "sTitle": $.i18n._("Duration"), "sClass": "library_length sb-length", "sWidth": "65px"},
|
||||
/* title */ {"mDataProp": "title", "sTitle": $.i18n._("Title"), "sClass": "sb-title"},
|
||||
/* creator */ {"mDataProp": "creator", "sTitle": $.i18n._("Creator"), "sClass": "sb-creator"},
|
||||
/* album */ {"mDataProp": "album", "sTitle": $.i18n._("Album"), "sClass": "sb-album"},
|
||||
/* cue in */ {"mDataProp": "cuein", "sTitle": $.i18n._("Cue In"), "bVisible": false, "sClass": "sb-cue-in"},
|
||||
/* cue out */ {"mDataProp": "cueout", "sTitle": $.i18n._("Cue Out"), "bVisible": false, "sClass": "sb-cue-out"},
|
||||
/* fade in */ {"mDataProp": "fadein", "sTitle": $.i18n._("Fade In"), "bVisible": false, "sClass": "sb-fade-in"},
|
||||
/* fade out */ {"mDataProp": "fadeout", "sTitle": $.i18n._("Fade Out"), "bVisible": false, "sClass": "sb-fade-out"},
|
||||
/* Mime */ {"mDataProp" : "mime", "sTitle" : $.i18n._("Mime"), "bVisible": false, "sClass": "sb-mime"}
|
||||
],
|
||||
|
||||
"bJQueryUI": true,
|
||||
|
@ -392,7 +417,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
localStorage.setItem('datatables-timeline', JSON.stringify(oData));
|
||||
|
||||
$.ajax({
|
||||
url: "/usersettings/set-timeline-datatable",
|
||||
url: baseUrl+"usersettings/set-timeline-datatable",
|
||||
type: "POST",
|
||||
data: {settings : oData, format: "json"},
|
||||
dataType: "json"
|
||||
|
@ -527,7 +552,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
$node = $(nRow.children[0]);
|
||||
$node.html('');
|
||||
|
||||
sSeparatorHTML = '<span>Show Empty</span>';
|
||||
sSeparatorHTML = '<span>'+$.i18n._("Show Empty")+'</span>';
|
||||
cl = cl + " sb-empty odd";
|
||||
|
||||
fnPrepareSeparatorRow(sSeparatorHTML, cl, 1);
|
||||
|
@ -539,7 +564,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
$node = $(nRow.children[0]);
|
||||
$node.html('');
|
||||
|
||||
sSeparatorHTML = '<span>Recording From Line In</span>';
|
||||
sSeparatorHTML = '<span>'+$.i18n._("Recording From Line In")+'</span>';
|
||||
cl = cl + " sb-record odd";
|
||||
|
||||
fnPrepareSeparatorRow(sSeparatorHTML, cl, 1);
|
||||
|
@ -554,7 +579,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
if (!isAudioSupported(aData.mime)) {
|
||||
$image.html('<span class="ui-icon ui-icon-locked"></span>');
|
||||
} else {
|
||||
$image.html('<img title="Track preview" src="/css/images/icon_audioclip.png"></img>')
|
||||
$image.html('<img title="'+$.i18n._("Track preview")+'" src="'+baseUrl+'css/images/icon_audioclip.png"></img>')
|
||||
.click(function() {
|
||||
open_show_preview(aData.instance, aData.pos);
|
||||
return false;
|
||||
|
@ -565,7 +590,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
$image.html('<span class="ui-icon ui-icon-alert"></span>');
|
||||
$image.find(".ui-icon-alert").qtip({
|
||||
content: {
|
||||
text: "Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't \"watched\" anymore."
|
||||
text: $.i18n._("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't \"watched\" anymore.")
|
||||
},
|
||||
style: {
|
||||
classes: "ui-tooltip-dark"
|
||||
|
@ -791,7 +816,8 @@ var AIRTIME = (function(AIRTIME){
|
|||
"sDom": 'R<"dt-process-rel"r><"sb-padded"<"H"C>><"dataTables_scrolling sb-padded"t>',
|
||||
|
||||
"sAjaxDataProp": "schedule",
|
||||
"sAjaxSource": "/showbuilder/builder-feed"
|
||||
"oLanguage": datatables_dict,
|
||||
"sAjaxSource": baseUrl+"showbuilder/builder-feed"
|
||||
});
|
||||
|
||||
$sbTable.find("tbody").on("click", "input:checkbox", function(ev) {
|
||||
|
@ -877,7 +903,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
//can't add items outside of shows.
|
||||
if (prev.find("td:first").hasClass("dataTables_empty")
|
||||
|| prev.length === 0) {
|
||||
alert("Cannot schedule outside a show.");
|
||||
alert($.i18n._("Cannot schedule outside a show."));
|
||||
ui.item.remove();
|
||||
return;
|
||||
}
|
||||
|
@ -932,10 +958,10 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
if (selected.length === 1) {
|
||||
message = "Moving "+selected.length+" Item.";
|
||||
message = $.i18n._("Moving 1 Item");
|
||||
}
|
||||
else {
|
||||
message = "Moving "+selected.length+" Items.";
|
||||
message = sprintf($.i18n._("Moving %s Items"), selected.length);
|
||||
}
|
||||
|
||||
draggingContainer = $('<tr/>')
|
||||
|
@ -983,28 +1009,28 @@ var AIRTIME = (function(AIRTIME){
|
|||
$menu = $("<div class='btn-toolbar'/>");
|
||||
$menu.append("<div class='btn-group'>" +
|
||||
"<button class='btn btn-small dropdown-toggle' id='timeline-select' data-toggle='dropdown'>" +
|
||||
"Select <span class='caret'></span>" +
|
||||
$.i18n._("Select")+" <span class='caret'></span>" +
|
||||
"</button>" +
|
||||
"<ul class='dropdown-menu'>" +
|
||||
"<li id='timeline-sa'><a href='#'>Select all</a></li>" +
|
||||
"<li id='timeline-sn'><a href='#'>Select none</a></li>" +
|
||||
"<li id='timeline-sa'><a href='#'>"+$.i18n._("Select all")+"</a></li>" +
|
||||
"<li id='timeline-sn'><a href='#'>"+$.i18n._("Select none")+"</a></li>" +
|
||||
"</ul>" +
|
||||
"</div>")
|
||||
.append("<div class='btn-group'>" +
|
||||
"<button title='Remove overbooked tracks' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
|
||||
"<button title='"+$.i18n._("Remove overbooked tracks")+"' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
|
||||
"<i class='icon-white icon-cut'></i></button></div>")
|
||||
.append("<div class='btn-group'>" +
|
||||
"<button title='Remove selected scheduled items' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
|
||||
"<button title='"+$.i18n._("Remove selected scheduled items")+"' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
|
||||
"<i class='icon-white icon-trash'></i></button></div>");
|
||||
|
||||
//if 'Add/Remove content' was chosen from the context menu
|
||||
//in the Calendar do not append these buttons
|
||||
if ($(".ui-dialog-content").length === 0) {
|
||||
$menu.append("<div class='btn-group'>" +
|
||||
"<button title='Jump to the current playing track' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
|
||||
"<button title='"+$.i18n._("Jump to the current playing track")+"' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
|
||||
"<i class='icon-white icon-step-forward'></i></button></div>")
|
||||
.append("<div class='btn-group'>" +
|
||||
"<button title='Cancel current show' class='ui-state-disabled btn btn-small btn-danger' disabled='disabled'>" +
|
||||
"<button title='"+$.i18n._("Cancel current show")+"' class='ui-state-disabled btn btn-small btn-danger' disabled='disabled'>" +
|
||||
"<i class='icon-white icon-ban-circle'></i></button></div>");
|
||||
}
|
||||
|
||||
|
@ -1019,7 +1045,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
.click(function() {
|
||||
var $tr,
|
||||
data,
|
||||
msg = 'Cancel Current Show?';
|
||||
msg = $.i18n._('Cancel Current Show?');
|
||||
|
||||
if (AIRTIME.button.isDisabled('icon-ban-circle', true) === true) {
|
||||
return;
|
||||
|
@ -1031,11 +1057,11 @@ var AIRTIME = (function(AIRTIME){
|
|||
data = $tr.data("aData");
|
||||
|
||||
if (data.record === true) {
|
||||
msg = 'Stop recording current show?';
|
||||
msg = $.i18n._('Stop recording current show?');
|
||||
}
|
||||
|
||||
if (confirm(msg)) {
|
||||
var url = "/Schedule/cancel-current-show";
|
||||
var url = baseUrl+"Schedule/cancel-current-show";
|
||||
$.ajax({
|
||||
url: url,
|
||||
data: {format: "json", id: data.instance},
|
||||
|
@ -1217,7 +1243,7 @@ var AIRTIME = (function(AIRTIME){
|
|||
}
|
||||
|
||||
request = $.ajax({
|
||||
url: "/showbuilder/context-menu",
|
||||
url: baseUrl+"showbuilder/context-menu",
|
||||
type: "GET",
|
||||
data: {id : data.id, format: "json"},
|
||||
dataType: "json",
|
||||
|
|
|
@ -1,118 +1,124 @@
|
|||
AIRTIME = (function(AIRTIME) {
|
||||
|
||||
var viewport,
|
||||
$lib,
|
||||
$libWrapper,
|
||||
$builder,
|
||||
$fs,
|
||||
widgetHeight,
|
||||
screenWidth,
|
||||
resizeTimeout,
|
||||
oBaseDatePickerSettings,
|
||||
oBaseTimePickerSettings,
|
||||
oRange,
|
||||
dateStartId = "#sb_date_start",
|
||||
timeStartId = "#sb_time_start",
|
||||
dateEndId = "#sb_date_end",
|
||||
timeEndId = "#sb_time_end",
|
||||
$toggleLib = $("<a id='sb_edit' class='btn btn-small' href='#' title='Open library to add or remove content'>Add / Remove Content</a>"),
|
||||
$libClose = $('<a />', {
|
||||
"class": "close-round",
|
||||
"href": "#",
|
||||
"id": "sb_lib_close"
|
||||
}),
|
||||
mod;
|
||||
|
||||
if (AIRTIME.builderMain === undefined) {
|
||||
AIRTIME.builderMain = {};
|
||||
}
|
||||
mod = AIRTIME.builderMain;
|
||||
|
||||
oBaseDatePickerSettings = {
|
||||
dateFormat: 'yy-mm-dd',
|
||||
onClick: function(sDate, oDatePicker) {
|
||||
$(this).datepicker( "setDate", sDate );
|
||||
}
|
||||
};
|
||||
|
||||
oBaseTimePickerSettings = {
|
||||
showPeriodLabels: false,
|
||||
showCloseButton: true,
|
||||
showLeadingZero: false,
|
||||
defaultTime: '0:00'
|
||||
};
|
||||
|
||||
function setWidgetSize() {
|
||||
viewport = AIRTIME.utilities.findViewportDimensions();
|
||||
widgetHeight = viewport.height - 180;
|
||||
screenWidth = Math.floor(viewport.width - 40);
|
||||
|
||||
var libTableHeight = widgetHeight - 130,
|
||||
builderTableHeight = widgetHeight - 95,
|
||||
oTable;
|
||||
|
||||
if ($fs.is(':visible')) {
|
||||
builderTableHeight = builderTableHeight - 40;
|
||||
}
|
||||
|
||||
//set the heights of the main widgets.
|
||||
$builder.height(widgetHeight)
|
||||
.find(".dataTables_scrolling")
|
||||
.css("max-height", builderTableHeight)
|
||||
.end()
|
||||
.width(screenWidth);
|
||||
|
||||
$lib.height(widgetHeight)
|
||||
.find(".dataTables_scrolling")
|
||||
.css("max-height", libTableHeight)
|
||||
.end();
|
||||
|
||||
if ($lib.filter(':visible').length > 0) {
|
||||
|
||||
$lib.width(Math.floor(screenWidth * 0.48));
|
||||
|
||||
$builder.width(Math.floor(screenWidth * 0.48))
|
||||
.find("#sb_edit")
|
||||
.remove()
|
||||
.end()
|
||||
.find("#sb_date_start")
|
||||
.css("margin-left", 0)
|
||||
.end();
|
||||
|
||||
oTable = $('#show_builder_table').dataTable();
|
||||
oTable.fnDraw();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var viewport,
|
||||
$lib,
|
||||
$libWrapper,
|
||||
$builder,
|
||||
$fs,
|
||||
widgetHeight,
|
||||
screenWidth,
|
||||
resizeTimeout,
|
||||
oBaseDatePickerSettings,
|
||||
oBaseTimePickerSettings,
|
||||
oRange,
|
||||
dateStartId = "#sb_date_start",
|
||||
timeStartId = "#sb_time_start",
|
||||
dateEndId = "#sb_date_end",
|
||||
timeEndId = "#sb_time_end",
|
||||
$toggleLib = $("<a id='sb_edit' class='btn btn-small' href='#' title='"+$.i18n._("Open library to add or remove content")+"'>"+$.i18n._("Add / Remove Content")+"</a>"),
|
||||
$libClose = $('<a />', {
|
||||
"class": "close-round",
|
||||
"href": "#",
|
||||
"id": "sb_lib_close"
|
||||
}),
|
||||
mod;
|
||||
|
||||
if (AIRTIME.builderMain === undefined) {
|
||||
AIRTIME.builderMain = {};
|
||||
}
|
||||
mod = AIRTIME.builderMain;
|
||||
|
||||
oBaseDatePickerSettings = {
|
||||
dateFormat: 'yy-mm-dd',
|
||||
//i18n_months, i18n_days_short are in common.js
|
||||
monthNames: i18n_months,
|
||||
dayNamesMin: i18n_days_short,
|
||||
onClick: function(sDate, oDatePicker) {
|
||||
$(this).datepicker( "setDate", sDate );
|
||||
}
|
||||
};
|
||||
|
||||
oBaseTimePickerSettings = {
|
||||
showPeriodLabels: false,
|
||||
showCloseButton: true,
|
||||
closeButtonText: $.i18n._("Done"),
|
||||
showLeadingZero: false,
|
||||
defaultTime: '0:00',
|
||||
hourText: $.i18n._("Hour"),
|
||||
minuteText: $.i18n._("Minute")
|
||||
};
|
||||
|
||||
function setWidgetSize() {
|
||||
viewport = AIRTIME.utilities.findViewportDimensions();
|
||||
widgetHeight = viewport.height - 180;
|
||||
screenWidth = Math.floor(viewport.width - 40);
|
||||
|
||||
var libTableHeight = widgetHeight - 130,
|
||||
builderTableHeight = widgetHeight - 95,
|
||||
oTable;
|
||||
|
||||
if ($fs.is(':visible')) {
|
||||
builderTableHeight = builderTableHeight - 40;
|
||||
}
|
||||
|
||||
//set the heights of the main widgets.
|
||||
$builder.height(widgetHeight)
|
||||
.find(".dataTables_scrolling")
|
||||
.css("max-height", builderTableHeight)
|
||||
.end()
|
||||
.width(screenWidth);
|
||||
|
||||
$lib.height(widgetHeight)
|
||||
.find(".dataTables_scrolling")
|
||||
.css("max-height", libTableHeight)
|
||||
.end();
|
||||
|
||||
if ($lib.filter(':visible').length > 0) {
|
||||
|
||||
$lib.width(Math.floor(screenWidth * 0.48));
|
||||
|
||||
$builder.width(Math.floor(screenWidth * 0.48))
|
||||
.find("#sb_edit")
|
||||
.remove()
|
||||
.end()
|
||||
.find("#sb_date_start")
|
||||
.css("margin-left", 0)
|
||||
.end();
|
||||
|
||||
oTable = $('#show_builder_table').dataTable();
|
||||
oTable.fnDraw();
|
||||
}
|
||||
}
|
||||
|
||||
function showSearchSubmit() {
|
||||
var fn,
|
||||
oRange,
|
||||
op,
|
||||
oTable = $('#show_builder_table').dataTable();
|
||||
|
||||
|
||||
//reset timestamp value since input values could have changed.
|
||||
AIRTIME.showbuilder.resetTimestamp();
|
||||
|
||||
|
||||
oRange = AIRTIME.utilities.fnGetScheduleRange(dateStartId, timeStartId, dateEndId, timeEndId);
|
||||
|
||||
|
||||
fn = oTable.fnSettings().fnServerData;
|
||||
fn.start = oRange.start;
|
||||
fn.end = oRange.end;
|
||||
|
||||
|
||||
op = $("div.sb-advanced-options");
|
||||
if (op.is(":visible")) {
|
||||
|
||||
|
||||
if (fn.ops === undefined) {
|
||||
fn.ops = {};
|
||||
}
|
||||
fn.ops.showFilter = op.find("#sb_show_filter").val();
|
||||
fn.ops.myShows = op.find("#sb_my_shows").is(":checked") ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
oTable.fnDraw();
|
||||
}
|
||||
|
||||
mod.onReady = function() {
|
||||
mod.onReady = function() {
|
||||
// define module vars.
|
||||
$lib = $("#library_content");
|
||||
$builder = $("#show_builder");
|
||||
|
@ -165,7 +171,7 @@ AIRTIME = (function(AIRTIME) {
|
|||
schedTable.fnDraw();
|
||||
|
||||
$.ajax( {
|
||||
url : "/usersettings/set-now-playing-screen-settings",
|
||||
url : baseUrl+"usersettings/set-now-playing-screen-settings",
|
||||
type : "POST",
|
||||
data : {
|
||||
settings : {
|
||||
|
@ -191,7 +197,7 @@ AIRTIME = (function(AIRTIME) {
|
|||
schedTable.fnDraw();
|
||||
|
||||
$.ajax( {
|
||||
url : "/usersettings/set-now-playing-screen-settings",
|
||||
url : baseUrl+"usersettings/set-now-playing-screen-settings",
|
||||
type : "POST",
|
||||
data : {
|
||||
settings : {
|
||||
|
@ -265,7 +271,7 @@ AIRTIME = (function(AIRTIME) {
|
|||
$.ajax( {
|
||||
"dataType" : "json",
|
||||
"type" : "GET",
|
||||
"url" : "/showbuilder/check-builder-feed",
|
||||
"url" : baseUrl+"showbuilder/check-builder-feed",
|
||||
"data" : data,
|
||||
"success" : function(json) {
|
||||
if (json.update === true) {
|
||||
|
|
|
@ -2,7 +2,7 @@ function generatePartitions(partitions){
|
|||
|
||||
var rowTemplate =
|
||||
'<tr class="partition-info">'+
|
||||
'<td><span class="strong">Disk #%s</span>'+
|
||||
'<td><span class="strong">'+$.i18n._("Disk")+' #%s</span>'+
|
||||
'<ul id="watched-dir-list-%s">'+
|
||||
'</ul>'+
|
||||
'</td>'+
|
||||
|
@ -12,7 +12,7 @@ function generatePartitions(partitions){
|
|||
'<div class="diskspace" style="width:%s%%;">'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<div>%s%% in use</div>'+
|
||||
'<div>%s%% '+$.i18n._("in use")+'</div>'+
|
||||
'</td>'+
|
||||
'</tr>';
|
||||
|
||||
|
@ -69,7 +69,7 @@ function success(data, textStatus, jqXHR){
|
|||
}
|
||||
|
||||
function updateStatus(getDiskInfo){
|
||||
$.getJSON( "api/status/format/json/diskinfo/"+getDiskInfo, null, success);
|
||||
$.getJSON( baseUrl+"api/status/format/json/diskinfo/"+getDiskInfo, null, success);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -17,20 +17,22 @@ function populateForm(entries){
|
|||
if (entries.id.length != 0){
|
||||
$('#login').attr('readonly', 'readonly');
|
||||
$('#password').val("xxxxxx");
|
||||
$('#passwordVerify').val("xxxxxx");
|
||||
} else {
|
||||
$('#login').removeAttr('readonly');
|
||||
$('#password').val("");
|
||||
$('#passwordVerify').val("");
|
||||
}
|
||||
}
|
||||
|
||||
function rowClickCallback(row_id){
|
||||
$.ajax({ url: '/User/get-user-data/id/'+ row_id +'/format/json', dataType:"json", success:function(data){
|
||||
$.ajax({ url: baseUrl+'User/get-user-data/id/'+ row_id +'/format/json', dataType:"json", success:function(data){
|
||||
populateForm(data.entries);
|
||||
}});
|
||||
}
|
||||
|
||||
function removeUserCallback(row_id, nRow){
|
||||
$.ajax({ url: '/User/remove-user/id/'+ row_id +'/format/json', dataType:"text", success:function(data){
|
||||
$.ajax({ url: baseUrl+'User/remove-user/id/'+ row_id +'/format/json', dataType:"text", success:function(data){
|
||||
var o = $('#users_datatable').dataTable().fnDeleteRow(nRow);
|
||||
}});
|
||||
}
|
||||
|
@ -45,26 +47,26 @@ function rowCallback( nRow, aData, iDisplayIndex ){
|
|||
|
||||
if ( aData['type'] == "A" )
|
||||
{
|
||||
$('td:eq(3)', nRow).html( 'Admin' );
|
||||
$('td:eq(3)', nRow).html( $.i18n._('Admin') );
|
||||
} else if ( aData['type'] == "H" )
|
||||
{
|
||||
$('td:eq(3)', nRow).html( 'DJ' );
|
||||
$('td:eq(3)', nRow).html( $.i18n._('DJ') );
|
||||
} else if ( aData['type'] == "G" )
|
||||
{
|
||||
$('td:eq(3)', nRow).html( 'Guest' );
|
||||
$('td:eq(3)', nRow).html( $.i18n._('Guest') );
|
||||
} else if ( aData['type'] == "P" )
|
||||
{
|
||||
$('td:eq(3)', nRow).html( 'Program Manager' );
|
||||
$('td:eq(3)', nRow).html( $.i18n._('Program Manager') );
|
||||
}
|
||||
|
||||
return nRow;
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
function populateUserTable() {
|
||||
$('#users_datatable').dataTable( {
|
||||
"bProcessing": true,
|
||||
"bServerSide": true,
|
||||
"sAjaxSource": "/User/get-user-data-table-info/format/json",
|
||||
"sAjaxSource": baseUrl+"User/get-user-data-table-info/format/json",
|
||||
"fnServerData": function ( sSource, aoData, fnCallback ) {
|
||||
$.ajax( {
|
||||
"dataType": 'json',
|
||||
|
@ -86,17 +88,124 @@ $(document).ready(function() {
|
|||
"bJQueryUI": true,
|
||||
"bAutoWidth": false,
|
||||
"bLengthChange": false,
|
||||
"oLanguage": {
|
||||
"sSearch": ""
|
||||
},
|
||||
"oLanguage": datatables_dict,
|
||||
|
||||
"sDom": '<"H"lf<"dt-process-rel"r>>t<"F"ip>',
|
||||
});
|
||||
}
|
||||
|
||||
function sizeFormElements() {
|
||||
$("dt[id$='label']").addClass('user-form-label');
|
||||
$("dd[id$='element']").addClass('user-form-element');
|
||||
}
|
||||
|
||||
function assignUserRightsToUserTypes() {
|
||||
//assign user-rights and id to each user type option so we can
|
||||
//display user rights for each with tipsy tooltip
|
||||
$.each($('#type').children(), function(i, opt) {
|
||||
switch ($(this).val()) {
|
||||
case 'G':
|
||||
$(this).attr('id', 'user-type-G');
|
||||
$(this).attr('user-rights',
|
||||
$.i18n._('Guests can do the following:')+'<br><br>'+
|
||||
$.i18n._('View schedule')+'<br>'+
|
||||
$.i18n._('View show content')
|
||||
);
|
||||
break;
|
||||
case 'H':
|
||||
$(this).attr('id', 'user-type-H');
|
||||
$(this).attr('user-rights',
|
||||
$.i18n._('DJs can do the following:')+'<br><br>'+
|
||||
$.i18n._('View schedule')+'<br>'+
|
||||
$.i18n._('View show content')+'<br>'+
|
||||
$.i18n._('Manage assigned show content')+'<br>'+
|
||||
$.i18n._('Import media files')+'<br>'+
|
||||
$.i18n._('Create playlists, smart blocks, and webstreams')+'<br>'+
|
||||
$.i18n._('Manage their own library content')
|
||||
);
|
||||
break;
|
||||
case 'P':
|
||||
$(this).attr('id', 'user-type-P');
|
||||
$(this).attr('user-rights',
|
||||
$.i18n._('Program Managers can do the following:')+'<br><br>'+
|
||||
$.i18n._('View schedule')+'<br>'+
|
||||
$.i18n._('View and manage show content')+'<br>'+
|
||||
$.i18n._('Schedule shows')+'<br>'+
|
||||
$.i18n._('Import media files')+'<br>'+
|
||||
$.i18n._('Create playlists, smart blocks, and webstreams')+'<br>'+
|
||||
$.i18n._('Manage all library content')
|
||||
);
|
||||
break;
|
||||
case 'A':
|
||||
$(this).attr('id', 'user-type-A');
|
||||
$(this).attr('user-rights',
|
||||
$.i18n._('Admins can do the following:')+'<br><br>'+
|
||||
$.i18n._('Manage preferences')+'<br>'+
|
||||
$.i18n._('Manage users')+'<br>'+
|
||||
$.i18n._('Manage watched folders')+'<br>'+
|
||||
$.i18n._('Send support feedback')+'<br>'+
|
||||
$.i18n._('View system status')+'<br>'+
|
||||
$.i18n._('Access playout history')+'<br>'+
|
||||
$.i18n._('View listener stats')+'<br>'+
|
||||
$.i18n._('View schedule')+'<br>'+
|
||||
$.i18n._('View and manage show content')+'<br>'+
|
||||
$.i18n._('Schedule shows')+'<br>'+
|
||||
$.i18n._('Import media files')+'<br>'+
|
||||
$.i18n._('Create playlists, smart blocks, and webstreams')+'<br>'+
|
||||
$.i18n._('Manage all library content')
|
||||
);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
$(document).ready(function() {
|
||||
populateUserTable();
|
||||
assignUserRightsToUserTypes();
|
||||
|
||||
$('#type').live("change", function(){
|
||||
//when the title changes on live tipsy tooltips the changes take
|
||||
//affect the next time tipsy is shown so we need to hide and re-show it
|
||||
$(this).tipsy('hide').tipsy('show');
|
||||
});
|
||||
|
||||
//$('#user_details').hide();
|
||||
$('#type').tipsy({
|
||||
gravity: 'w',
|
||||
html: true,
|
||||
opacity: 0.9,
|
||||
trigger: 'manual',
|
||||
live: true,
|
||||
title: function() {
|
||||
return $('#user-type-'+$(this).val()).attr('user-rights');
|
||||
}
|
||||
});
|
||||
|
||||
$('#type').tipsy('show');
|
||||
|
||||
var newUser = {login:"", first_name:"", last_name:"", type:"G", id:""};
|
||||
|
||||
$('#add_user_button').click(function(){populateForm(newUser)});
|
||||
$('#add_user_button').live('click', function(){populateForm(newUser)});
|
||||
|
||||
$('#save_user').live('click', function(){
|
||||
var data = $('#user_form').serialize();
|
||||
var url = baseUrl+'User/add-user';
|
||||
|
||||
$.post(url, {format: "json", data: data}, function(data){
|
||||
var json = $.parseJSON(data);
|
||||
if (json.valid === "true") {
|
||||
$('#content').empty().append(json.html);
|
||||
populateUserTable();
|
||||
assignUserRightsToUserTypes();
|
||||
} else {
|
||||
//if form is invalid we only need to redraw the form
|
||||
$('#user_form').empty().append($(json.html).find('#user_form').children());
|
||||
$('#password').val("");
|
||||
$('#passwordVerify').val("");
|
||||
}
|
||||
setTimeout(removeSuccessMsg, 5000);
|
||||
sizeFormElements();
|
||||
});
|
||||
});
|
||||
|
||||
sizeFormElements();
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue