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();
|
||||
|
||||
});
|
||||
|
|
1
airtime_mvc/public/js/bootstrap/bootstrap.js
vendored
1
airtime_mvc/public/js/bootstrap/bootstrap.js
vendored
|
@ -715,7 +715,6 @@
|
|||
* =================================== */
|
||||
|
||||
$(document)
|
||||
|
||||
// menu options don't work on tablet so trying this hack for now:
|
||||
// https://github.com/twitter/bootstrap/issues/4550
|
||||
//.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
|
||||
|
|
72
airtime_mvc/public/js/cookie/jquery.cookie.js
Normal file
72
airtime_mvc/public/js/cookie/jquery.cookie.js
Normal file
|
@ -0,0 +1,72 @@
|
|||
/*!
|
||||
* jQuery Cookie Plugin v1.3
|
||||
* https://github.com/carhartl/jquery-cookie
|
||||
*
|
||||
* Copyright 2011, Klaus Hartl
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.opensource.org/licenses/GPL-2.0
|
||||
*/
|
||||
(function ($, document, undefined) {
|
||||
|
||||
var pluses = /\+/g;
|
||||
|
||||
function raw(s) {
|
||||
return s;
|
||||
}
|
||||
|
||||
function decoded(s) {
|
||||
return decodeURIComponent(s.replace(pluses, ' '));
|
||||
}
|
||||
|
||||
var config = $.cookie = function (key, value, options) {
|
||||
|
||||
// write
|
||||
if (value !== undefined) {
|
||||
options = $.extend({}, config.defaults, options);
|
||||
|
||||
if (value === null) {
|
||||
options.expires = -1;
|
||||
}
|
||||
|
||||
if (typeof options.expires === 'number') {
|
||||
var days = options.expires, t = options.expires = new Date();
|
||||
t.setDate(t.getDate() + days);
|
||||
}
|
||||
|
||||
value = config.json ? JSON.stringify(value) : String(value);
|
||||
|
||||
return (document.cookie = [
|
||||
encodeURIComponent(key), '=', config.raw ? value : encodeURIComponent(value),
|
||||
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
||||
options.path ? '; path=' + options.path : '',
|
||||
options.domain ? '; domain=' + options.domain : '',
|
||||
options.secure ? '; secure' : ''
|
||||
].join(''));
|
||||
}
|
||||
|
||||
// read
|
||||
var decode = config.raw ? raw : decoded;
|
||||
var cookies = document.cookie.split('; ');
|
||||
for (var i = 0, l = cookies.length; i < l; i++) {
|
||||
var parts = cookies[i].split('=');
|
||||
if (decode(parts.shift()) === key) {
|
||||
var cookie = decode(parts.join('='));
|
||||
return config.json ? JSON.parse(cookie) : cookie;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
config.defaults = {};
|
||||
|
||||
$.removeCookie = function (key, options) {
|
||||
if ($.cookie(key) !== null) {
|
||||
$.cookie(key, null, options);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
})(jQuery, document);
|
17
airtime_mvc/public/js/datatables/i18n/de_DE.txt
Normal file
17
airtime_mvc/public/js/datatables/i18n/de_DE.txt
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"sProcessing": "Bitte warten...",
|
||||
"sLengthMenu": "_MENU_ Einträge anzeigen",
|
||||
"sZeroRecords": "Keine Einträge vorhanden.",
|
||||
"sInfo": "_START_ bis _END_ von _TOTAL_ Einträgen",
|
||||
"sInfoEmpty": "0 bis 0 von 0 Einträgen",
|
||||
"sInfoFiltered": "(gefiltert von _MAX_ Einträgen)",
|
||||
"sInfoPostFix": "",
|
||||
"sSearch": "",
|
||||
"sUrl": "",
|
||||
"oPaginate": {
|
||||
"sFirst": "Erster",
|
||||
"sPrevious": "Zurück",
|
||||
"sNext": "Nächster",
|
||||
"sLast": "Letzter"
|
||||
}
|
||||
}
|
23
airtime_mvc/public/js/datatables/i18n/en_CA.txt
Normal file
23
airtime_mvc/public/js/datatables/i18n/en_CA.txt
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"sEmptyTable": "No data available in table",
|
||||
"sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
|
||||
"sInfoEmpty": "Showing 0 to 0 of 0 entries",
|
||||
"sInfoFiltered": "(filtered from _MAX_ total entries)",
|
||||
"sInfoPostFix": "",
|
||||
"sInfoThousands": ",",
|
||||
"sLengthMenu": "Show _MENU_",
|
||||
"sLoadingRecords": "Loading...",
|
||||
"sProcessing": "Processing...",
|
||||
"sSearch": "",
|
||||
"sZeroRecords": "No matching records found",
|
||||
"oPaginate": {
|
||||
"sFirst": "First",
|
||||
"sLast": "Last",
|
||||
"sNext": "Next",
|
||||
"sPrevious": "Previous"
|
||||
},
|
||||
"oAria": {
|
||||
"sSortAscending": ": activate to sort column ascending",
|
||||
"sSortDescending": ": activate to sort column descending"
|
||||
}
|
||||
}
|
23
airtime_mvc/public/js/datatables/i18n/en_US.txt
Normal file
23
airtime_mvc/public/js/datatables/i18n/en_US.txt
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"sEmptyTable": "No data available in table",
|
||||
"sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
|
||||
"sInfoEmpty": "Showing 0 to 0 of 0 entries",
|
||||
"sInfoFiltered": "(filtered from _MAX_ total entries)",
|
||||
"sInfoPostFix": "",
|
||||
"sInfoThousands": ",",
|
||||
"sLengthMenu": "Show _MENU_",
|
||||
"sLoadingRecords": "Loading...",
|
||||
"sProcessing": "Processing...",
|
||||
"sSearch": "",
|
||||
"sZeroRecords": "No matching records found",
|
||||
"oPaginate": {
|
||||
"sFirst": "First",
|
||||
"sLast": "Last",
|
||||
"sNext": "Next",
|
||||
"sPrevious": "Previous"
|
||||
},
|
||||
"oAria": {
|
||||
"sSortAscending": ": activate to sort column ascending",
|
||||
"sSortDescending": ": activate to sort column descending"
|
||||
}
|
||||
}
|
25
airtime_mvc/public/js/datatables/i18n/es_ES.txt
Normal file
25
airtime_mvc/public/js/datatables/i18n/es_ES.txt
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"sProcessing": "Procesando...",
|
||||
"sLengthMenu": "Mostrar _MENU_ registros",
|
||||
"sZeroRecords": "No se encontraron resultados",
|
||||
"sEmptyTable": "Ningún dato disponible en esta tabla",
|
||||
"sInfo": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros",
|
||||
"sInfoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros",
|
||||
"sInfoFiltered": "(filtrado de un total de _MAX_ registros)",
|
||||
"sInfoPostFix": "",
|
||||
"sSearch": "",
|
||||
"sUrl": "",
|
||||
"sInfoThousands": ",",
|
||||
"sLoadingRecords": "Cargando...",
|
||||
"oPaginate": {
|
||||
"sFirst": "Primero",
|
||||
"sLast": "Último",
|
||||
"sNext": "Siguiente",
|
||||
"sPrevious": "Anterior"
|
||||
},
|
||||
"fnInfoCallback": null,
|
||||
"oAria": {
|
||||
"sSortAscending": ": Activar para ordernar la columna de manera ascendente",
|
||||
"sSortDescending": ": Activar para ordernar la columna de manera descendente"
|
||||
}
|
||||
}
|
22
airtime_mvc/public/js/datatables/i18n/fr_FR.txt
Normal file
22
airtime_mvc/public/js/datatables/i18n/fr_FR.txt
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"sProcessing": "Traitement en cours...",
|
||||
"sSearch": "",
|
||||
"sLengthMenu": "Afficher _MENU_ éléments",
|
||||
"sInfo": "Affichage de l'élement _START_ à _END_ sur _TOTAL_ éléments",
|
||||
"sInfoEmpty": "Affichage de l'élement 0 à 0 sur 0 éléments",
|
||||
"sInfoFiltered": "(filtré de _MAX_ éléments au total)",
|
||||
"sInfoPostFix": "",
|
||||
"sLoadingRecords": "Chargement en cours...",
|
||||
"sZeroRecords": "Aucun élément à afficher",
|
||||
"sEmptyTable": "Aucune donnée disponible dans le tableau",
|
||||
"oPaginate": {
|
||||
"sFirst": "Premier",
|
||||
"sPrevious": "Précédent",
|
||||
"sNext": "Suivant",
|
||||
"sLast": "Dernier"
|
||||
},
|
||||
"oAria": {
|
||||
"sSortAscending": ": activer pour trier la colonne par ordre croissant",
|
||||
"sSortDescending": ": activer pour trier la colonne par ordre décroissant"
|
||||
}
|
||||
}
|
23
airtime_mvc/public/js/datatables/i18n/it_IT.txt
Normal file
23
airtime_mvc/public/js/datatables/i18n/it_IT.txt
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"sEmptyTable": "Nessun dato presente nella tabella",
|
||||
"sInfo": "Vista da _START_ a _END_ di _TOTAL_ elementi",
|
||||
"sInfoEmpty": "Vista da 0 a 0 di 0 elementi",
|
||||
"sInfoFiltered": "(filtrati da _MAX_ elementi totali)",
|
||||
"sInfoPostFix": "",
|
||||
"sInfoThousands": ",",
|
||||
"sLengthMenu": "Visualizza _MENU_ elementi",
|
||||
"sLoadingRecords": "Caricamento...",
|
||||
"sProcessing": "Elaborazione...",
|
||||
"sSearch": "",
|
||||
"sZeroRecords": "La ricerca non ha portato alcun risultato.",
|
||||
"oPaginate": {
|
||||
"sFirst": "Inizio",
|
||||
"sPrevious": "Precedente",
|
||||
"sNext": "Successivo",
|
||||
"sLast": "Fine"
|
||||
},
|
||||
"oAria": {
|
||||
"sSortAscending": ": attiva per ordinare la colonna in ordine crescente",
|
||||
"sSortDescending": ": attiva per ordinare la colonna in ordine decrescente"
|
||||
}
|
||||
}
|
23
airtime_mvc/public/js/datatables/i18n/ko_KR.txt
Normal file
23
airtime_mvc/public/js/datatables/i18n/ko_KR.txt
Normal file
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"sEmptyTable": "데이터가 존재 하지 않습니다",
|
||||
"sInfo": "총_TOTAL_개의 결과 중 _START_ 부터 _END_",
|
||||
"sInfoEmpty": "총0개의 결과 중 0 부터 0",
|
||||
"sInfoFiltered": "(총_MAX_개의 결과 중 필터 되었습니다)",
|
||||
"sInfoPostFix": "",
|
||||
"sInfoThousands": ",",
|
||||
"sLengthMenu": "_MENU_개 보기",
|
||||
"sLoadingRecords": "로디중...",
|
||||
"sProcessing": "진행중...",
|
||||
"sSearch": "",
|
||||
"sZeroRecords": "기록을 찾지 못하였습니다",
|
||||
"oPaginate": {
|
||||
"sFirst": "처음",
|
||||
"sLast": "마지막",
|
||||
"sNext": "다음",
|
||||
"sPrevious": "이전"
|
||||
},
|
||||
"oAria": {
|
||||
"sSortAscending": ": 오름차순으로 정렬",
|
||||
"sSortDescending": ": 내림차순으로 정렬"
|
||||
}
|
||||
}
|
17
airtime_mvc/public/js/datatables/i18n/ru_RU.txt
Normal file
17
airtime_mvc/public/js/datatables/i18n/ru_RU.txt
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"sProcessing": "Подождите...",
|
||||
"sLengthMenu": "Показать _MENU_ записей",
|
||||
"sZeroRecords": "Записи отсутствуют.",
|
||||
"sInfo": "Записи с _START_ до _END_ из _TOTAL_ записей",
|
||||
"sInfoEmpty": "Записи с 0 до 0 из 0 записей",
|
||||
"sInfoFiltered": "(отфильтровано из _MAX_ записей)",
|
||||
"sInfoPostFix": "",
|
||||
"sSearch": "",
|
||||
"sUrl": "",
|
||||
"oPaginate": {
|
||||
"sFirst": "Первая",
|
||||
"sPrevious": "Предыдущая",
|
||||
"sNext": "Следующая",
|
||||
"sLast": "Последняя"
|
||||
}
|
||||
}
|
17
airtime_mvc/public/js/datatables/i18n/zh_CN.txt
Normal file
17
airtime_mvc/public/js/datatables/i18n/zh_CN.txt
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"sProcessing": "处理中...",
|
||||
"sLengthMenu": "显示 _MENU_ 项结果",
|
||||
"sZeroRecords": "没有匹配结果",
|
||||
"sInfo": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项",
|
||||
"sInfoEmpty": "显示第 0 至 0 项结果,共 0 项",
|
||||
"sInfoFiltered": "(由 _MAX_ 项结果过滤)",
|
||||
"sInfoPostFix": "",
|
||||
"sSearch": "",
|
||||
"sUrl": "",
|
||||
"oPaginate": {
|
||||
"sFirst": "首页",
|
||||
"sPrevious": "上页",
|
||||
"sNext": "下页",
|
||||
"sLast": "末页"
|
||||
}
|
||||
}
|
|
@ -5,8 +5,8 @@ Running a diff between the original column filter plugin (dataTables.columnFilte
|
|||
our modified one (dataTables.columnFilter.js):
|
||||
|
||||
denise@denise-DX4860:~/airtime/airtime_mvc/public/js/datatables/plugin$ diff -u dataTables.columnFilter_orig.js dataTables.columnFilter.js
|
||||
--- dataTables.columnFilter_orig.js 2012-09-11 11:53:16.476101955 -0400
|
||||
+++ dataTables.columnFilter.js 2012-10-04 12:15:13.270199949 -0400
|
||||
--- dataTables.columnFilter_orig.js 2012-10-17 11:41:05.000000000 -0400
|
||||
+++ dataTables.columnFilter.js 2012-11-22 12:20:03.997107451 -0500
|
||||
@@ -103,7 +103,8 @@
|
||||
label = label.replace(/(^\s*)|(\s*$)/g, "");
|
||||
var currentFilter = oTable.fnSettings().aoPreSearchCols[i].sSearch;
|
||||
|
@ -88,13 +88,13 @@ denise@denise-DX4860:~/airtime/airtime_mvc/public/js/datatables/plugin$ diff -u
|
|||
+
|
||||
+ var label = "";
|
||||
+ if (th.attr('id') == "bit_rate") {
|
||||
+ label = " bps";
|
||||
+ label = $.i18n._("kbps");
|
||||
+ } else if (th.attr('id') == "utime" || th.attr('id') == "mtime" || th.attr('id') == "lptime") {
|
||||
+ label = " yyyy-mm-dd";
|
||||
+ label = $.i18n._("yyyy-mm-dd");
|
||||
+ } else if (th.attr('id') == "length") {
|
||||
+ label = " hh:mm:ss.t";
|
||||
+ label = $.i18n._("hh:mm:ss.t");
|
||||
+ } else if (th.attr('id') == "sample_rate") {
|
||||
+ label = " Hz";
|
||||
+ label = $.i18n._("kHz");
|
||||
+ }
|
||||
+
|
||||
th.html(_fnRangeLabelPart(0));
|
||||
|
@ -133,7 +133,20 @@ denise@denise-DX4860:~/airtime/airtime_mvc/public/js/datatables/plugin$ diff -u
|
|||
+ }
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -566,7 +585,7 @@
|
||||
sRangeSeparator: "~",
|
||||
iFilteringDelay: 500,
|
||||
aoColumns: null,
|
||||
- sRangeFormat: "From {from} to {to}"
|
||||
+ sRangeFormat: $.i18n._("From {from} to {to}")
|
||||
};
|
||||
|
||||
properties = $.extend(defaults, options);
|
||||
@@ -730,4 +749,4 @@
|
||||
|
||||
|
||||
|
||||
-})(jQuery);
|
||||
\ No newline at end of file
|
||||
+})(jQuery);
|
|
@ -30,4 +30,8 @@ The new _fnDomBaseButton looks like this:
|
|||
|
||||
return nButton;
|
||||
},
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
* Line 96 has changed
|
||||
- "buttonText": "Show / hide columns",
|
||||
+ "buttonText": $.i18n._("Show / hide columns"),
|
|
@ -95,7 +95,7 @@ ColVis = function( oDTSettings, oInit )
|
|||
* @type String
|
||||
* @default Show / hide columns
|
||||
*/
|
||||
"buttonText": "Show / hide columns",
|
||||
"buttonText": $.i18n._("Show / hide columns"),
|
||||
|
||||
/**
|
||||
* Flag to say if the collection is hidden
|
||||
|
|
|
@ -184,13 +184,13 @@
|
|||
|
||||
var label = "";
|
||||
if (th.attr('id') == "bit_rate") {
|
||||
label = " kbps";
|
||||
label = $.i18n._("kbps");
|
||||
} else if (th.attr('id') == "utime" || th.attr('id') == "mtime" || th.attr('id') == "lptime") {
|
||||
label = " yyyy-mm-dd";
|
||||
label = $.i18n._("yyyy-mm-dd");
|
||||
} else if (th.attr('id') == "length") {
|
||||
label = " hh:mm:ss.t";
|
||||
label = $.i18n._("hh:mm:ss.t");
|
||||
} else if (th.attr('id') == "sample_rate") {
|
||||
label = " kHz";
|
||||
label = $.i18n._("kHz");
|
||||
}
|
||||
|
||||
th.html(_fnRangeLabelPart(0));
|
||||
|
@ -585,7 +585,7 @@
|
|||
sRangeSeparator: "~",
|
||||
iFilteringDelay: 500,
|
||||
aoColumns: null,
|
||||
sRangeFormat: "From {from} to {to}"
|
||||
sRangeFormat: $.i18n._("From {from} to {to}")
|
||||
};
|
||||
|
||||
properties = $.extend(defaults, options);
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
Copyright (c) 2007-2009 IOLA and Ole Laursen
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
8316
airtime_mvc/public/js/flot/jquery.js
vendored
8316
airtime_mvc/public/js/flot/jquery.js
vendored
File diff suppressed because it is too large
Load diff
117
airtime_mvc/public/js/i18n/jquery.i18n.js
Normal file
117
airtime_mvc/public/js/i18n/jquery.i18n.js
Normal file
|
@ -0,0 +1,117 @@
|
|||
/*
|
||||
* jQuery i18n plugin
|
||||
* @requires jQuery v1.1 or later
|
||||
*
|
||||
* See http://recursive-design.com/projects/jquery-i18n/
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* Version: 1.0.0 (201210141329)
|
||||
*/
|
||||
(function($) {
|
||||
/**
|
||||
* i18n provides a mechanism for translating strings using a jscript dictionary.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* i18n property list
|
||||
*/
|
||||
$.i18n = {
|
||||
|
||||
dict: null,
|
||||
|
||||
/**
|
||||
* setDictionary()
|
||||
*
|
||||
* Initialises the dictionary.
|
||||
*
|
||||
* @param property_list i18n_dict : The dictionary to use for translation.
|
||||
*/
|
||||
setDictionary: function(i18n_dict) {
|
||||
this.dict = i18n_dict;
|
||||
},
|
||||
|
||||
/**
|
||||
* _()
|
||||
*
|
||||
* Looks the given string up in the dictionary and returns the translation if
|
||||
* one exists. If a translation is not found, returns the original word.
|
||||
*
|
||||
* @param string str : The string to translate.
|
||||
* @param property_list params : params for using printf() on the string.
|
||||
*
|
||||
* @return string : Translated word.
|
||||
*/
|
||||
_: function (str, params) {
|
||||
var result = str;
|
||||
if (this.dict && this.dict[str]) {
|
||||
result = this.dict[str];
|
||||
}
|
||||
|
||||
// Substitute any params.
|
||||
return this.printf(result, params);
|
||||
},
|
||||
|
||||
/*
|
||||
* printf()
|
||||
*
|
||||
* Substitutes %s with parameters given in list. %%s is used to escape %s.
|
||||
*
|
||||
* @param string str : String to perform printf on.
|
||||
* @param string args : Array of arguments for printf.
|
||||
*
|
||||
* @return string result : Substituted string
|
||||
*/
|
||||
printf: function(str, args) {
|
||||
if (!args) return str;
|
||||
|
||||
var result = '';
|
||||
var search = /%(\d+)\$s/g;
|
||||
|
||||
// Replace %n1$ where n is a number.
|
||||
var matches = search.exec(str);
|
||||
while (matches) {
|
||||
var index = parseInt(matches[1], 10) - 1;
|
||||
str = str.replace('%' + matches[1] + '\$s', (args[index]));
|
||||
matches = search.exec(str);
|
||||
}
|
||||
var parts = str.split('%s');
|
||||
|
||||
if (parts.length > 1) {
|
||||
for(var i = 0; i < args.length; i++) {
|
||||
// If the part ends with a '%' chatacter, we've encountered a literal
|
||||
// '%%s', which we should output as a '%s'. To achieve this, add an
|
||||
// 's' on the end and merge it with the next part.
|
||||
if (parts[i].length > 0 && parts[i].lastIndexOf('%') == (parts[i].length - 1)) {
|
||||
parts[i] += 's' + parts.splice(i + 1, 1)[0];
|
||||
}
|
||||
|
||||
// Append the part and the substitution to the result.
|
||||
result += parts[i] + args[i];
|
||||
}
|
||||
}
|
||||
|
||||
return result + parts[parts.length - 1];
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
* _t()
|
||||
*
|
||||
* Allows you to translate a jQuery selector.
|
||||
*
|
||||
* eg $('h1')._t('some text')
|
||||
*
|
||||
* @param string str : The string to translate .
|
||||
* @param property_list params : Params for using printf() on the string.
|
||||
*
|
||||
* @return element : Chained and translated element(s).
|
||||
*/
|
||||
$.fn._t = function(str, params) {
|
||||
return $(this).text($.i18n._(str, params));
|
||||
};
|
||||
|
||||
})(jQuery);
|
25
airtime_mvc/public/js/plupload/i18n/de_DE.js
Normal file
25
airtime_mvc/public/js/plupload/i18n/de_DE.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
// German
|
||||
plupload.addI18n({
|
||||
'Select files' : 'Dateien hochladen',
|
||||
'Add files to the upload queue and click the start button.' : 'Dateien hinzufügen und auf \'Hochladen\' klicken.',
|
||||
'Filename' : 'Dateiname',
|
||||
'Status' : 'Status',
|
||||
'Size' : 'Größe',
|
||||
'Add files' : 'Dateien', // hinzufügen',
|
||||
'Stop current upload' : 'Aktuelles Hochladen stoppen',
|
||||
'Start uploading queue' : 'Hochladen starten',
|
||||
'Uploaded %d/%d files': '%d/%d Dateien sind hochgeladen',
|
||||
'N/A' : 'Nicht verfügbar',
|
||||
'Drag files here.' : 'Ziehen Sie die Dateien hier hin',
|
||||
'File extension error.': 'Fehler bei Dateiendung',
|
||||
'File size error.': 'Fehler bei Dateigröße',
|
||||
'Init error.': 'Initialisierungsfehler',
|
||||
'HTTP Error.': 'HTTP-Fehler',
|
||||
'Security error.': 'Sicherheitsfehler',
|
||||
'Generic error.': 'Typischer Fehler',
|
||||
'IO error.': 'Ein/Ausgabe-Fehler',
|
||||
'Stop Upload': 'Hochladen stoppen',
|
||||
'Start upload': 'Hochladen',
|
||||
'%d files queued': '%d Dateien in der Warteschlange',
|
||||
"Error: Invalid file extension: " : $.i18n._("Error: Invalid file extension: ")
|
||||
});
|
27
airtime_mvc/public/js/plupload/i18n/en_CA.js
Normal file
27
airtime_mvc/public/js/plupload/i18n/en_CA.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
// English
|
||||
plupload.addI18n({
|
||||
'Select files' : 'Select files',
|
||||
'Add files to the upload queue and click the start button.' : 'Add files to the upload queue and click the start button.',
|
||||
'Filename' : 'Filename',
|
||||
'Status' : 'Status',
|
||||
'Size' : 'Size',
|
||||
'Add files' : 'Add files',
|
||||
'Stop current upload' : 'Stop current upload',
|
||||
'Start uploading queue' : 'Start uploading queue',
|
||||
'Uploaded %d/%d files': 'Uploaded %d/%d files',
|
||||
'N/A' : 'N/A',
|
||||
'Drag files here.' : 'Drag files here.',
|
||||
'File extension error.': 'File extension error.',
|
||||
'File size error.': 'File size error.',
|
||||
'Init error.': 'Init error.',
|
||||
'HTTP Error.': 'HTTP Error.',
|
||||
'Security error.': 'Security error.',
|
||||
'Generic error.': 'Generic error.',
|
||||
'IO error.': 'IO error.',
|
||||
'Stop Upload': 'Stop Upload',
|
||||
'Add Files': 'Add Files',
|
||||
'Start Upload': 'Start Upload',
|
||||
'Start upload': 'Start upload',
|
||||
'%d files queued': '%d files queued',
|
||||
"Error: Invalid file extension: " : $.i18n._("Error: Invalid file extension: ")
|
||||
});
|
27
airtime_mvc/public/js/plupload/i18n/en_US.js
Normal file
27
airtime_mvc/public/js/plupload/i18n/en_US.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
// English - US
|
||||
plupload.addI18n({
|
||||
'Select files' : 'Select files',
|
||||
'Add files to the upload queue and click the start button.' : 'Add files to the upload queue and click the start button.',
|
||||
'Filename' : 'Filename',
|
||||
'Status' : 'Status',
|
||||
'Size' : 'Size',
|
||||
'Add files' : 'Add files',
|
||||
'Stop current upload' : 'Stop current upload',
|
||||
'Start uploading queue' : 'Start uploading queue',
|
||||
'Uploaded %d/%d files': 'Uploaded %d/%d files',
|
||||
'N/A' : 'N/A',
|
||||
'Drag files here.' : 'Drag files here.',
|
||||
'File extension error.': 'File extension error.',
|
||||
'File size error.': 'File size error.',
|
||||
'Init error.': 'Init error.',
|
||||
'HTTP Error.': 'HTTP Error.',
|
||||
'Security error.': 'Security error.',
|
||||
'Generic error.': 'Generic error.',
|
||||
'IO error.': 'IO error.',
|
||||
'Stop Upload': 'Stop Upload',
|
||||
'Add Files': 'Add Files',
|
||||
'Start Upload': 'Start Upload',
|
||||
'Start upload': 'Start upload',
|
||||
'%d files queued': '%d files queued',
|
||||
"Error: Invalid file extension: " : $.i18n._("Error: Invalid file extension: ")
|
||||
});
|
26
airtime_mvc/public/js/plupload/i18n/es_ES.js
Normal file
26
airtime_mvc/public/js/plupload/i18n/es_ES.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
// Spanish
|
||||
plupload.addI18n({
|
||||
'Select files' : 'Elija archivos:',
|
||||
'Add files to the upload queue and click the start button.' : 'Agregue archivos a la cola de subida y haga click en el boton de iniciar.',
|
||||
'Filename' : 'Nombre de archivo',
|
||||
'Status' : 'Estado',
|
||||
'Size' : 'Tamaño',
|
||||
'Add files' : 'Agregue archivos',
|
||||
'Stop current upload' : 'Detener subida actual',
|
||||
'Start uploading queue' : 'Iniciar subida de cola',
|
||||
'Uploaded %d/%d files': 'Subidos %d/%d archivos',
|
||||
'N/A' : 'No disponible',
|
||||
'Drag files here.' : 'Arrastre archivos aquí',
|
||||
'File extension error.': 'Error de extensión de archivo.',
|
||||
'File size error.': 'Error de tamaño de archivo.',
|
||||
'Init error.': 'Error de inicialización.',
|
||||
'HTTP Error.': 'Error de HTTP.',
|
||||
'Security error.': 'Error de seguridad.',
|
||||
'Generic error.': 'Error genérico.',
|
||||
'IO error.': 'Error de entrada/salida.',
|
||||
'Stop Upload': 'Detener Subida.',
|
||||
'Add Files': 'Agregar Archivos',
|
||||
'Start upload': 'Comenzar Subida',
|
||||
'%d files queued': '%d archivos en cola.',
|
||||
"Error: Invalid file extension: " : $.i18n._("Error: Invalid file extension: ")
|
||||
});
|
26
airtime_mvc/public/js/plupload/i18n/fr_FR.js
Normal file
26
airtime_mvc/public/js/plupload/i18n/fr_FR.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
// French
|
||||
plupload.addI18n({
|
||||
'Select files' : 'Sélectionnez les fichiers',
|
||||
'Add files to the upload queue and click the start button.' : 'Ajoutez des fichiers à la file et appuyez sur le bouton démarrer.',
|
||||
'Filename' : 'Nom de fichier',
|
||||
'Status' : 'Status',
|
||||
'Size' : 'Taille',
|
||||
'Add files' : 'Ajouter Fichiers',
|
||||
'Stop current upload' : 'Arrêter l\'envoi en cours',
|
||||
'Start uploading queue' : 'Démarrer l\'envoi',
|
||||
'Uploaded %d/%d files': '%d/%d fichiers envoyés',
|
||||
'N/A' : 'Non applicable',
|
||||
'Drag files here.' : 'Déposer les fichiers ici.',
|
||||
'File extension error.': 'Erreur extension fichier',
|
||||
'File size error.': 'Erreur taille fichier.',
|
||||
'Init error.': 'Erreur d\'initialisation.',
|
||||
'HTTP Error.': 'Erreur HTTP.',
|
||||
'Security error.': 'Erreur de sécurité.',
|
||||
'Generic error.': 'Erreur générique.',
|
||||
'IO error.': 'Erreur E/S.',
|
||||
'Stop Upload': 'Arrêter les envois.',
|
||||
'Add Files': 'Ajouter des fichiers',
|
||||
'Start upload': 'Démarrer les envois.',
|
||||
'%d files queued': '%d fichiers en attente.',
|
||||
"Error: Invalid file extension: " : $.i18n._("Error: Invalid file extension: ")
|
||||
});
|
25
airtime_mvc/public/js/plupload/i18n/it_IT.js
Normal file
25
airtime_mvc/public/js/plupload/i18n/it_IT.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Italian
|
||||
plupload.addI18n({
|
||||
'Select files' : 'Seleziona i files',
|
||||
'Add files to the upload queue and click the start button.' : 'Aggiungi i file alla coda di caricamento e clicca il pulsante di avvio.',
|
||||
'Filename' : 'Nome file',
|
||||
'Status' : 'Stato',
|
||||
'Size' : 'Dimensione',
|
||||
'Add files' : 'Aggiungi file',
|
||||
'Stop current upload' : 'Interrompi il caricamento',
|
||||
'Start uploading queue' : 'Avvia il caricamento',
|
||||
'Uploaded %d/%d files': 'Caricati %d/%d file',
|
||||
'N/A' : 'N/D',
|
||||
'Drag files here.' : 'Trascina i file qui.',
|
||||
'File extension error.': 'Errore estensione file.',
|
||||
'File size error.': 'Errore dimensione file.',
|
||||
'Init error.': 'Errore inizializzazione.',
|
||||
'HTTP Error.': 'Errore HTTP.',
|
||||
'Security error.': 'Errore sicurezza.',
|
||||
'Generic error.': 'Errore generico.',
|
||||
"Error: Invalid file extension: " : $.i18n._("Error: Invalid file extension: "),
|
||||
'IO error.': 'Errore IO.',
|
||||
'Stop Upload': 'Ferma Upload',
|
||||
'Start upload': 'Inizia Upload',
|
||||
'%d files queued': '%d file in lista'
|
||||
});
|
27
airtime_mvc/public/js/plupload/i18n/ko_KR.js
Normal file
27
airtime_mvc/public/js/plupload/i18n/ko_KR.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
// Korean
|
||||
plupload.addI18n({
|
||||
'Select files' : '파일 선택',
|
||||
'Add files to the upload queue and click the start button.' : '파일을 업로드 큐에 추가 하신후 업로드 시작 버튼을 클릭해주세요',
|
||||
'Filename' : '파일 이름',
|
||||
'Status' : '상황',
|
||||
'Size' : '크기',
|
||||
'Add files' : '파일 추가',
|
||||
'Stop current upload' : '현제 업로드 정지',
|
||||
'Start uploading queue' : '업로드 시작',
|
||||
'Uploaded %d/%d files': '%d/%d개의 파일 업로드 됨',
|
||||
'N/A' : 'N/A',
|
||||
'Drag files here.' : '파일을 여기로 드래그 앤 드랍 하세요',
|
||||
'File extension error.': '파일 확장자 에러',
|
||||
'File size error.': '파일 크기 에러.',
|
||||
'Init error.': '초기화 에러.',
|
||||
'HTTP Error.': 'HTTP 에러.',
|
||||
'Security error.': '보안 에러.',
|
||||
'Generic error.': 'Generic 에러.',
|
||||
'IO error.': 'IO 에러.',
|
||||
'Stop Upload': '업로드 정지',
|
||||
'Add Files': '파일 추가',
|
||||
'Start Upload': '업로드 시작',
|
||||
'Start upload': '업로드 시작',
|
||||
'%d files queued': '%d개의 파일이 큐 되었습니다',
|
||||
"Error: Invalid file extension: " : $.i18n._("Error: Invalid file extension: ")
|
||||
});
|
22
airtime_mvc/public/js/plupload/i18n/ru_RU.js
Normal file
22
airtime_mvc/public/js/plupload/i18n/ru_RU.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
// Russian
|
||||
plupload.addI18n({
|
||||
'Select files' : 'Выберите файлы',
|
||||
'Add files to the upload queue and click the start button.' : 'Добавьте файлы в очередь и нажмите кнопку "Загрузить файлы".',
|
||||
'Filename' : 'Имя файла',
|
||||
'Status' : 'Статус',
|
||||
'Size' : 'Размер',
|
||||
'Add files' : 'Добавить файлы',
|
||||
'Stop current upload' : 'Остановить загрузку',
|
||||
'Start upload' : 'Загрузить файлы',
|
||||
'Uploaded %d/%d files': 'Загружено %d из %d файлов',
|
||||
'N/A' : 'N/D',
|
||||
'Drag files here.' : 'Перетащите файлы сюда.',
|
||||
'File extension error.': 'Неправильное расширение файла.',
|
||||
'File size error.': 'Неправильный размер файла.',
|
||||
'Init error.': 'Ошибка инициализации.',
|
||||
'HTTP Error.': 'Ошибка HTTP.',
|
||||
'Security error.': 'Ошибка безопасности.',
|
||||
'Generic error.': 'Общая ошибка.',
|
||||
'IO error.': 'Ошибка ввода-вывода.',
|
||||
"Error: Invalid file extension: " : $.i18n._("Error: Invalid file extension: ")
|
||||
});
|
27
airtime_mvc/public/js/plupload/i18n/zh_CN.js
Normal file
27
airtime_mvc/public/js/plupload/i18n/zh_CN.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
// Chinese
|
||||
plupload.addI18n({
|
||||
'Select files' : '选择文件',
|
||||
'Add files to the upload queue and click the start button.' : '往上传队列中添加文件,并且点击按钮开始上传。',
|
||||
'Filename' : '文件名',
|
||||
'Status' : '上传状态',
|
||||
'Size' : '大小',
|
||||
'Add files' : '添加文件',
|
||||
'Stop current upload' : '中断当前上传',
|
||||
'Start uploading queue' : '启动上传队列',
|
||||
'Uploaded %d/%d files': '已经上传%d/%d',
|
||||
'N/A' : '未知',
|
||||
'Drag files here.' : '拖拽文件至此处。',
|
||||
'File extension error.': '文件后缀名不符合要求。',
|
||||
'File size error.': '文件大小错误。',
|
||||
'Init error.': '初始化出错。',
|
||||
'HTTP Error.': 'HTTP错误。',
|
||||
'Security error.': '安全性错误',
|
||||
'Generic error.': '系统错误。',
|
||||
'IO error.': '输入输出错误。',
|
||||
'Stop Upload': '停止上传',
|
||||
'Add Files': '添加文件',
|
||||
'Start Upload': '开始上传',
|
||||
'Start upload': '开始上传',
|
||||
'%d files queued': '%d个文件在队列中',
|
||||
"Error: Invalid file extension: " : $.i18n._("Error: Invalid file extension: ")
|
||||
});
|
File diff suppressed because one or more lines are too long
34
airtime_mvc/public/js/serverbrowse/AIRTIME_DEV_README
Normal file
34
airtime_mvc/public/js/serverbrowse/AIRTIME_DEV_README
Normal file
|
@ -0,0 +1,34 @@
|
|||
Before you overwrite serverbrowser.js, note that we have changed a few lines
|
||||
in this file.
|
||||
|
||||
Running a diff between the original serverbrowser.js and our modified one:
|
||||
|
||||
denise@denise-DX4860:~/airtime/airtime_mvc/public/js/serverbrowse$ diff -u serverbrowser_orig.js serverbrowser.js
|
||||
--- serverbrowser_orig.js 2012-11-28 11:42:43.250237696 -0500
|
||||
+++ serverbrowser.js 2012-11-28 11:44:57.738242930 -0500
|
||||
@@ -65,14 +65,14 @@
|
||||
modal: true,
|
||||
buttons: [
|
||||
{
|
||||
- text: "Cancel",
|
||||
+ text: $.i18n._("Cancel"),
|
||||
"class": "btn",
|
||||
click: function() {
|
||||
browserDlg.dialog("close");
|
||||
}
|
||||
},
|
||||
{
|
||||
- text: "Open",
|
||||
+ text: $.i18n._("Open"),
|
||||
"class": "btn",
|
||||
click: function() {
|
||||
doneOk();
|
||||
@@ -123,7 +123,7 @@
|
||||
function() { $(this).removeClass('ui-state-hover'); }
|
||||
);
|
||||
|
||||
- var enterLabel = $('<span></span>').text('Look in: ').appendTo(enterButton.clone(false).appendTo(enterPathDiv));
|
||||
+ var enterLabel = $('<span></span>').text($.i18n._('Look in')+': ').appendTo(enterButton.clone(false).appendTo(enterPathDiv));
|
||||
|
||||
var enterText = $('<input type="text">').keypress(function(e) {
|
||||
if (e.keyCode == '13') {
|
|
@ -65,14 +65,14 @@
|
|||
modal: true,
|
||||
buttons: [
|
||||
{
|
||||
text: "Cancel",
|
||||
text: $.i18n._("Cancel"),
|
||||
"class": "btn",
|
||||
click: function() {
|
||||
browserDlg.dialog("close");
|
||||
}
|
||||
},
|
||||
{
|
||||
text: "Open",
|
||||
text: $.i18n._("Open"),
|
||||
"class": "btn",
|
||||
click: function() {
|
||||
doneOk();
|
||||
|
@ -123,7 +123,7 @@
|
|||
function() { $(this).removeClass('ui-state-hover'); }
|
||||
);
|
||||
|
||||
var enterLabel = $('<span></span>').text('Look in: ').appendTo(enterButton.clone(false).appendTo(enterPathDiv));
|
||||
var enterLabel = $('<span></span>').text($.i18n._('Look in')+': ').appendTo(enterButton.clone(false).appendTo(enterPathDiv));
|
||||
|
||||
var enterText = $('<input type="text">').keypress(function(e) {
|
||||
if (e.keyCode == '13') {
|
||||
|
|
378
airtime_mvc/public/js/serverbrowse/serverbrowser_orig.js
Normal file
378
airtime_mvc/public/js/serverbrowse/serverbrowser_orig.js
Normal file
|
@ -0,0 +1,378 @@
|
|||
/*
|
||||
author: ApmeM (artem.votincev@gmail.com)
|
||||
date: 9-June-2010
|
||||
version: 1.4
|
||||
download: http://code.google.com/p/jq-serverbrowse/
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
$.fn.serverBrowser = function(settings) {
|
||||
this.each(function() {
|
||||
|
||||
var config = {
|
||||
// Event function
|
||||
// Appear when user click 'Ok' button, or doubleclick on file
|
||||
onSelect: function(file) {
|
||||
alert('You select: ' + file);
|
||||
},
|
||||
onLoad: function() {
|
||||
return config.basePath;
|
||||
},
|
||||
multiselect: false,
|
||||
// Image parameters
|
||||
// System images (loading.gif, unknown.png, folder.png and images from knownPaths) will be referenced to systemImageUrl
|
||||
// if systemImageUrl is empty or not specified - imageUrl will be taken
|
||||
// All other images (like images for extension) will be taken from imageUrl
|
||||
imageUrl: 'img/',
|
||||
systemImageUrl: '',
|
||||
showUpInList: false,
|
||||
// Path properties
|
||||
// Base path, that links should start from.
|
||||
// If opened path is not under this path, alert will be shown and nothing will be opened
|
||||
// Path separator, that will be used to split specified paths and join paths to a string
|
||||
basePath: 'C:',
|
||||
separatorPath: '/',
|
||||
// Paths, that will be displayed on the left side of the dialog
|
||||
// This is a link to specified paths on the server
|
||||
useKnownPaths: true,
|
||||
knownPaths: [{text:'Desktop', image:'desktop.png', path:'C:/Users/All Users/Desktop'},
|
||||
{text:'Documents', image:'documents.png', path:'C:/Users/All Users/Documents'}],
|
||||
// Images for known extension (like 'png', 'exe', 'zip'), that will be displayed with its real names
|
||||
// Images, that is not in this list will be referenced to 'unknown.png' image
|
||||
// If list is empty - all images is known.
|
||||
knownExt: [],
|
||||
// Server path to this plugin handler
|
||||
handlerUrl: 'browserDlg.txt',
|
||||
// JQuery-ui dialog settings
|
||||
title: 'Browse',
|
||||
width: 300,
|
||||
height: 300,
|
||||
position: ['center', 'top'],
|
||||
|
||||
// Administrative parameters used to
|
||||
// help programmer or system administrator
|
||||
requestMethod: 'POST',
|
||||
};
|
||||
|
||||
if (settings) $.extend(config, settings);
|
||||
// Required configuration elements
|
||||
// We need to set some configuration elements without user
|
||||
// For example there should be 2 buttons on the bottom,
|
||||
// And dialog should be opened after button is pressed, not when it created
|
||||
// Also we need to know about dialog resizing
|
||||
$.extend(config, {
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
buttons: [
|
||||
{
|
||||
text: "Cancel",
|
||||
"class": "btn",
|
||||
click: function() {
|
||||
browserDlg.dialog("close");
|
||||
}
|
||||
},
|
||||
{
|
||||
text: "Open",
|
||||
"class": "btn",
|
||||
click: function() {
|
||||
doneOk();
|
||||
}
|
||||
}
|
||||
],
|
||||
resize: function(event, ui) {
|
||||
recalculateSize(event, ui);
|
||||
},
|
||||
});
|
||||
|
||||
function systemImageUrl()
|
||||
{
|
||||
if (config.systemImageUrl.length == 0) {
|
||||
return config.imageUrl;
|
||||
} else{
|
||||
return config.systemImageUrl;
|
||||
}
|
||||
}
|
||||
|
||||
var privateConfig = {
|
||||
// This stack array will store history navigation data
|
||||
// When user open new directory, old directory will be added to this list
|
||||
// If user want, he will be able to move back by this history
|
||||
browserHistory: [],
|
||||
|
||||
// This array contains all currently selected items
|
||||
// When user select element, it will add associated path into this array
|
||||
// When user deselect element - associated path will be removed
|
||||
// Exception: if 'config.multiselect' is false, only one element will be stored in this array.
|
||||
selectedItems: [],
|
||||
}
|
||||
|
||||
// Main dialog div
|
||||
// It will be converted into jQuery-ui dialog box using my configuration parameters
|
||||
// It contains 3 divs
|
||||
var browserDlg = $('<div title="' + config.title + '"></div>').css({'overflow': 'hidden'}).appendTo(document.body);
|
||||
browserDlg.dialog(config);
|
||||
|
||||
// First div on the top
|
||||
// It contains textbox field and buttons
|
||||
// User can enter any paths he want to open in this textbox and press enter
|
||||
// There is 3 buttons on the panel:
|
||||
var enterPathDiv = $('<div></div>').addClass('ui-widget-content').appendTo(browserDlg).css({'height': '30px', 'width': '100%', 'padding-top': '7px'});
|
||||
|
||||
var enterButton = $('<div></div>').css({'float': 'left', 'vertical-align': 'middle', 'margin-left': '6px'}).addClass('ui-corner-all').hover(
|
||||
function() { $(this).addClass('ui-state-hover'); },
|
||||
function() { $(this).removeClass('ui-state-hover'); }
|
||||
);
|
||||
|
||||
var enterLabel = $('<span></span>').text('Look in: ').appendTo(enterButton.clone(false).appendTo(enterPathDiv));
|
||||
|
||||
var enterText = $('<input type="text">').keypress(function(e) {
|
||||
if (e.keyCode == '13') {
|
||||
e.preventDefault();
|
||||
loadPath(enterText.val());
|
||||
}
|
||||
}).appendTo(enterButton.clone(false).appendTo(enterPathDiv));
|
||||
|
||||
|
||||
// Back button.
|
||||
// When user click on it, 2 last elements of the history pop from the list, and reload second of them.
|
||||
var enterBack = $('<div></div>').addClass('ui-corner-all ui-icon ui-icon-circle-arrow-w').click(function(){
|
||||
privateConfig.browserHistory.pop(); // Remove current element. It is not required now.
|
||||
var backPath = config.basePath;
|
||||
if(privateConfig.browserHistory.length > 0){
|
||||
backPath = privateConfig.browserHistory.pop();
|
||||
}
|
||||
loadPath(backPath);
|
||||
}).appendTo(enterButton.clone(true).appendTo(enterPathDiv));
|
||||
|
||||
// Level Up Button
|
||||
// When user click on it, last element of the history will be taken, and '..' will be applied to the end of the array.
|
||||
var enterUp = $('<div></div>').addClass('ui-corner-all ui-icon ui-icon-arrowreturnthick-1-n').click(function(){
|
||||
backPath = privateConfig.browserHistory[privateConfig.browserHistory.length - 1];
|
||||
if(backPath != config.basePath){
|
||||
loadPath(backPath + config.separatorPath + '..');
|
||||
}
|
||||
}).appendTo(enterButton.clone(true).appendTo(enterPathDiv));
|
||||
|
||||
// Second div is on the left
|
||||
// It contains images and texts for pre-defined paths
|
||||
// User just click on them and it will open pre-defined path
|
||||
var knownPathDiv = $('<div></div>').addClass('ui-widget-content').css({'text-align':'center', 'overflow': 'auto', 'float': 'left', 'width': '100px'});
|
||||
if(config.useKnownPaths){
|
||||
knownPathDiv.appendTo(browserDlg);
|
||||
$.each(config.knownPaths, function(index, path) {
|
||||
var knownDiv = $('<div></div>').css({'margin':'10px'}).hover(
|
||||
function() { $(this).addClass('ui-state-hover'); },
|
||||
function() { $(this).removeClass('ui-state-hover'); }
|
||||
).click(function() {
|
||||
loadPath(path.path);
|
||||
}).appendTo(knownPathDiv);
|
||||
|
||||
$('<img />').attr({ src: systemImageUrl() + config.separatorPath + path.image }).css({ width: '32px', margin: '5px 10px 5px 5px' }).appendTo(knownDiv);
|
||||
$('<br/>').appendTo(knownDiv);
|
||||
$('<span></span>').text(path.text).appendTo(knownDiv);
|
||||
});
|
||||
}
|
||||
|
||||
// Third div is everywhere :)
|
||||
// It show files and folders in the current path
|
||||
// User can click on path to select or deselect it
|
||||
// Doubleclick on path will open it
|
||||
// Also doubleclick on file will select this file and close dialog
|
||||
var browserPathDiv = $('<div></div>').addClass('ui-widget-content').css({'float': 'right', 'overflow': 'auto'}).appendTo(browserDlg);
|
||||
|
||||
// Now everything is done
|
||||
// When user will be ready - he just click on the area you select for this plugin and dialog will appear
|
||||
$(this).click(function() {
|
||||
privateConfig.browserHistory = [];
|
||||
var startpath = removeBackPath(config.onLoad());
|
||||
|
||||
startpath = startpath.split(config.separatorPath);
|
||||
startpath.pop();
|
||||
startpath = startpath.join(config.separatorPath);
|
||||
|
||||
if(!checkBasePath(startpath)){
|
||||
startpath = config.basePath;
|
||||
}
|
||||
loadPath(startpath);
|
||||
browserDlg.dialog('open');
|
||||
recalculateSize();
|
||||
});
|
||||
|
||||
// Function check if specified path is a child path of a 'config.basePath'
|
||||
// If it is not - user should see message, that path invalid, or path should be changed to valid.
|
||||
function checkBasePath(path){
|
||||
if(config.basePath == '')
|
||||
return true;
|
||||
var confPath = config.basePath.split(config.separatorPath);
|
||||
var curPath = path.split(config.separatorPath);
|
||||
if(confPath.length > curPath.length)
|
||||
return false;
|
||||
var result = true;
|
||||
$.each(confPath, function(index, partConfPath) {
|
||||
if(partConfPath != curPath[index]){
|
||||
result = false;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
// Function remove '..' parts of the path
|
||||
// Process depend on config.separatorPath option
|
||||
// On the server side you need to check / or \ separators
|
||||
function removeBackPath(path){
|
||||
var confPath = config.basePath.split(config.separatorPath);
|
||||
var curPath = path.split(config.separatorPath);
|
||||
var newcurPath = [];
|
||||
$.each(curPath, function(index, partCurPath) {
|
||||
if(partCurPath == ".."){
|
||||
newcurPath.pop();
|
||||
}else{
|
||||
newcurPath.push(partCurPath);
|
||||
}
|
||||
});
|
||||
return newcurPath.join(config.separatorPath);
|
||||
}
|
||||
|
||||
// This function will be called when user click 'Open'
|
||||
// It check if any path is selected, and call config.onSelect function with path list
|
||||
function doneOk(){
|
||||
var newCurPath = [];
|
||||
$.each(privateConfig.selectedItems, function(index, item) {
|
||||
newCurPath.push($.data(item, 'path'));
|
||||
});
|
||||
if(newCurPath.length == 0) {
|
||||
newCurPath.push(privateConfig.browserHistory.pop());
|
||||
}
|
||||
|
||||
if(config.multiselect)
|
||||
config.onSelect(newCurPath);
|
||||
else {
|
||||
if(newCurPath.length == 1) {
|
||||
config.onSelect(newCurPath[0]);
|
||||
} else if(newCurPath.length > 1){
|
||||
alert('Plugin work incorrectly. If error repeat, please add issue into http://code.google.com/p/jq-serverbrowse/issues/list with steps to reproduce.');
|
||||
return;
|
||||
}
|
||||
}
|
||||
browserDlg.dialog("close");
|
||||
}
|
||||
|
||||
// Function recalculate and set new width and height for left and right div elements
|
||||
// height have '-2' because of the borders
|
||||
// width have '-4' because of a border an 2 pixels space between divs
|
||||
function recalculateSize(event, ui){
|
||||
knownPathDiv.css({'height' : browserDlg.height() - enterPathDiv.outerHeight(true) - 2});
|
||||
browserPathDiv.css({'height' : browserDlg.height() - enterPathDiv.outerHeight(true) - 2,
|
||||
'width' : browserDlg.width() - knownPathDiv.outerWidth(true) - 4});
|
||||
}
|
||||
|
||||
// Function adds new element into browserPathDiv element depends on file parameters
|
||||
// If file.isError is set, error message will be displayed instead of clickable area
|
||||
// Clickable div contain image from extension and text from file parameter
|
||||
function addElement(file){
|
||||
var itemDiv = $('<div></div>').css({ margin: '2px' }).appendTo(browserPathDiv);
|
||||
if(file.isError)
|
||||
{
|
||||
itemDiv.addClass('ui-state-error ui-corner-all').css({padding: '0pt 0.7em'});
|
||||
var p = $('<p></p>').appendTo(itemDiv);
|
||||
$('<span></span>').addClass('ui-icon ui-icon-alert').css({'float': 'left', 'margin-right': '0.3em'}).appendTo(p);
|
||||
$('<span></span>').text(file.name).appendTo(p);
|
||||
}else
|
||||
{
|
||||
var fullPath = file.path + config.separatorPath + file.name;
|
||||
itemDiv.hover(
|
||||
function() { $(this).addClass('ui-state-hover'); },
|
||||
function() { $(this).removeClass('ui-state-hover'); }
|
||||
);
|
||||
var itemImage = $('<img />').css({ width: '16px', margin: '0 5px 0 0' }).appendTo(itemDiv);
|
||||
var itemText = $('<span></span>').text(file.name).appendTo(itemDiv);
|
||||
if (file.isFolder)
|
||||
itemImage.attr({ src: systemImageUrl() + 'folder.png' });
|
||||
else {
|
||||
ext = file.name.split('.').pop();
|
||||
var res = '';
|
||||
if (ext == '' || ext == file.name || (config.knownExt.length > 0 && $.inArray(ext, config.knownExt) < 0))
|
||||
itemImage.attr({ src: systemImageUrl() + 'unknown.png' });
|
||||
else
|
||||
itemImage.attr({ src: config.imageUrl + ext + '.png' });
|
||||
}
|
||||
$.data(itemDiv, 'path', fullPath);
|
||||
itemDiv.unbind('click').bind('click', function(e) {
|
||||
if(!$(this).hasClass('ui-state-active')) {
|
||||
if(!config.multiselect && privateConfig.selectedItems.length > 0) {
|
||||
$(privateConfig.selectedItems[0]).click();
|
||||
}
|
||||
privateConfig.selectedItems.push(itemDiv);
|
||||
}else{
|
||||
var newCurPath = [];
|
||||
$.each(privateConfig.selectedItems, function(index, item) {
|
||||
if($.data(item, 'path') != fullPath)
|
||||
newCurPath.push(item);
|
||||
});
|
||||
privateConfig.selectedItems = newCurPath;
|
||||
}
|
||||
$(this).toggleClass('ui-state-active');
|
||||
});
|
||||
|
||||
itemDiv.unbind('dblclick').bind('dblclick', function(e) {
|
||||
if (file.isFolder){
|
||||
loadPath(fullPath);
|
||||
} else {
|
||||
privateConfig.selectedItems = [itemDiv];
|
||||
doneOk();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Main plugin function
|
||||
// When user enter path manually, select it from pre-defined path, or doubleclick in browser this function will call
|
||||
// It send a request on the server to retrieve child directories and files of the specified path
|
||||
// If path is not under 'config.basePath', alert will be shown and nothing will be opened
|
||||
function loadPath(path) {
|
||||
privateConfig.selectedItems = [];
|
||||
|
||||
// First we need to remove all '..' parts of the path
|
||||
path = removeBackPath(path);
|
||||
|
||||
// Then we need to check, if path based on 'config.basePath'
|
||||
if(!checkBasePath(path)) {
|
||||
alert('Path should be based from ' + config.basePath);
|
||||
return;
|
||||
}
|
||||
|
||||
// Then we can put this path into history
|
||||
privateConfig.browserHistory.push(path);
|
||||
|
||||
// Show it to user
|
||||
enterText.val(path);
|
||||
|
||||
// And load
|
||||
$.ajax({
|
||||
url: config.handlerUrl,
|
||||
type: config.requestMethod,
|
||||
data: {
|
||||
action: 'browse',
|
||||
path: path,
|
||||
time: new Date().getTime()
|
||||
},
|
||||
beforeSend: function() {
|
||||
browserPathDiv.empty().css({ 'text-align': 'center' });
|
||||
$('<img />').attr({ src: systemImageUrl() + 'loading.gif' }).css({ width: '32px' }).appendTo(browserPathDiv);
|
||||
},
|
||||
success: function(files) {
|
||||
browserPathDiv.empty().css({ 'text-align': 'left' });
|
||||
if(path != config.basePath && config.showUpInList){
|
||||
addElement({name: '..', isFolder: true, isError: false, path: path});
|
||||
}
|
||||
$.each(files, function(index, file) {
|
||||
addElement($.extend(file, {path: path}));
|
||||
});
|
||||
},
|
||||
dataType: 'json'
|
||||
});
|
||||
}
|
||||
});
|
||||
return this;
|
||||
};
|
||||
})(jQuery);
|
23
airtime_mvc/public/js/tipsy/AIRTIME_DEV_README
Normal file
23
airtime_mvc/public/js/tipsy/AIRTIME_DEV_README
Normal file
|
@ -0,0 +1,23 @@
|
|||
Before overwriting jquery.tipsy.js, please note we have changed a few lines to
|
||||
support manual triggering with live tipsy tooltips
|
||||
|
||||
|
||||
denise@denise-DX4860:~/airtime/airtime_mvc/public/js/tipsy$ diff -u jquery.tipsy_orig.js jquery.tipsy.js
|
||||
--- jquery.tipsy_orig.js 2012-12-13 12:03:48.780751104 -0500
|
||||
+++ jquery.tipsy.js 2012-12-13 12:08:15.564761493 -0500
|
||||
@@ -173,12 +173,10 @@
|
||||
|
||||
if (!options.live) this.each(function() { get(this); });
|
||||
|
||||
- if (options.trigger != 'manual') {
|
||||
- var binder = options.live ? 'live' : 'bind',
|
||||
- eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
|
||||
- eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
|
||||
- this[binder](eventIn, enter)[binder](eventOut, leave);
|
||||
- }
|
||||
+ var binder = options.live ? 'live' : 'bind',
|
||||
+ eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
|
||||
+ eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
|
||||
+ this[binder](eventIn, enter)[binder](eventOut, leave);
|
||||
|
||||
return this;
|
256
airtime_mvc/public/js/tipsy/jquery.tipsy.js
Normal file
256
airtime_mvc/public/js/tipsy/jquery.tipsy.js
Normal file
|
@ -0,0 +1,256 @@
|
|||
// tipsy, facebook style tooltips for jquery
|
||||
// version 1.0.0a
|
||||
// (c) 2008-2010 jason frame [jason@onehackoranother.com]
|
||||
// released under the MIT license
|
||||
|
||||
(function($) {
|
||||
|
||||
function maybeCall(thing, ctx) {
|
||||
return (typeof thing == 'function') ? (thing.call(ctx)) : thing;
|
||||
};
|
||||
|
||||
function isElementInDOM(ele) {
|
||||
while (ele = ele.parentNode) {
|
||||
if (ele == document) return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
function Tipsy(element, options) {
|
||||
this.$element = $(element);
|
||||
this.options = options;
|
||||
this.enabled = true;
|
||||
this.fixTitle();
|
||||
};
|
||||
|
||||
Tipsy.prototype = {
|
||||
show: function() {
|
||||
var title = this.getTitle();
|
||||
if (title && this.enabled) {
|
||||
var $tip = this.tip();
|
||||
|
||||
$tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
|
||||
$tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
|
||||
$tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
|
||||
|
||||
var pos = $.extend({}, this.$element.offset(), {
|
||||
width: this.$element[0].offsetWidth,
|
||||
height: this.$element[0].offsetHeight
|
||||
});
|
||||
|
||||
var actualWidth = $tip[0].offsetWidth,
|
||||
actualHeight = $tip[0].offsetHeight,
|
||||
gravity = maybeCall(this.options.gravity, this.$element[0]);
|
||||
|
||||
var tp;
|
||||
switch (gravity.charAt(0)) {
|
||||
case 'n':
|
||||
tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
|
||||
break;
|
||||
case 's':
|
||||
tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
|
||||
break;
|
||||
case 'e':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
|
||||
break;
|
||||
case 'w':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
|
||||
break;
|
||||
}
|
||||
|
||||
if (gravity.length == 2) {
|
||||
if (gravity.charAt(1) == 'w') {
|
||||
tp.left = pos.left + pos.width / 2 - 15;
|
||||
} else {
|
||||
tp.left = pos.left + pos.width / 2 - actualWidth + 15;
|
||||
}
|
||||
}
|
||||
|
||||
$tip.css(tp).addClass('tipsy-' + gravity);
|
||||
$tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0);
|
||||
if (this.options.className) {
|
||||
$tip.addClass(maybeCall(this.options.className, this.$element[0]));
|
||||
}
|
||||
|
||||
if (this.options.fade) {
|
||||
$tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
|
||||
} else {
|
||||
$tip.css({visibility: 'visible', opacity: this.options.opacity});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
if (this.options.fade) {
|
||||
this.tip().stop().fadeOut(function() { $(this).remove(); });
|
||||
} else {
|
||||
this.tip().remove();
|
||||
}
|
||||
},
|
||||
|
||||
fixTitle: function() {
|
||||
var $e = this.$element;
|
||||
if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') {
|
||||
$e.attr('original-title', $e.attr('title') || '').removeAttr('title');
|
||||
}
|
||||
},
|
||||
|
||||
getTitle: function() {
|
||||
var title, $e = this.$element, o = this.options;
|
||||
this.fixTitle();
|
||||
var title, o = this.options;
|
||||
if (typeof o.title == 'string') {
|
||||
title = $e.attr(o.title == 'title' ? 'original-title' : o.title);
|
||||
} else if (typeof o.title == 'function') {
|
||||
title = o.title.call($e[0]);
|
||||
}
|
||||
title = ('' + title).replace(/(^\s*|\s*$)/, "");
|
||||
return title || o.fallback;
|
||||
},
|
||||
|
||||
tip: function() {
|
||||
if (!this.$tip) {
|
||||
this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');
|
||||
this.$tip.data('tipsy-pointee', this.$element[0]);
|
||||
}
|
||||
return this.$tip;
|
||||
},
|
||||
|
||||
validate: function() {
|
||||
if (!this.$element[0].parentNode) {
|
||||
this.hide();
|
||||
this.$element = null;
|
||||
this.options = null;
|
||||
}
|
||||
},
|
||||
|
||||
enable: function() { this.enabled = true; },
|
||||
disable: function() { this.enabled = false; },
|
||||
toggleEnabled: function() { this.enabled = !this.enabled; }
|
||||
};
|
||||
|
||||
$.fn.tipsy = function(options) {
|
||||
|
||||
if (options === true) {
|
||||
return this.data('tipsy');
|
||||
} else if (typeof options == 'string') {
|
||||
var tipsy = this.data('tipsy');
|
||||
if (tipsy) tipsy[options]();
|
||||
return this;
|
||||
}
|
||||
|
||||
options = $.extend({}, $.fn.tipsy.defaults, options);
|
||||
|
||||
function get(ele) {
|
||||
var tipsy = $.data(ele, 'tipsy');
|
||||
if (!tipsy) {
|
||||
tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options));
|
||||
$.data(ele, 'tipsy', tipsy);
|
||||
}
|
||||
return tipsy;
|
||||
}
|
||||
|
||||
function enter() {
|
||||
var tipsy = get(this);
|
||||
tipsy.hoverState = 'in';
|
||||
if (options.delayIn == 0) {
|
||||
tipsy.show();
|
||||
} else {
|
||||
tipsy.fixTitle();
|
||||
setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn);
|
||||
}
|
||||
};
|
||||
|
||||
function leave() {
|
||||
var tipsy = get(this);
|
||||
tipsy.hoverState = 'out';
|
||||
if (options.delayOut == 0) {
|
||||
tipsy.hide();
|
||||
} else {
|
||||
setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut);
|
||||
}
|
||||
};
|
||||
|
||||
if (!options.live) this.each(function() { get(this); });
|
||||
|
||||
var binder = options.live ? 'live' : 'bind',
|
||||
eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
|
||||
eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
|
||||
this[binder](eventIn, enter)[binder](eventOut, leave);
|
||||
|
||||
return this;
|
||||
|
||||
};
|
||||
|
||||
$.fn.tipsy.defaults = {
|
||||
className: null,
|
||||
delayIn: 0,
|
||||
delayOut: 0,
|
||||
fade: false,
|
||||
fallback: '',
|
||||
gravity: 'n',
|
||||
html: false,
|
||||
live: false,
|
||||
offset: 0,
|
||||
opacity: 0.8,
|
||||
title: 'title',
|
||||
trigger: 'hover'
|
||||
};
|
||||
|
||||
$.fn.tipsy.revalidate = function() {
|
||||
$('.tipsy').each(function() {
|
||||
var pointee = $.data(this, 'tipsy-pointee');
|
||||
if (!pointee || !isElementInDOM(pointee)) {
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Overwrite this method to provide options on a per-element basis.
|
||||
// For example, you could store the gravity in a 'tipsy-gravity' attribute:
|
||||
// return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
|
||||
// (remember - do not modify 'options' in place!)
|
||||
$.fn.tipsy.elementOptions = function(ele, options) {
|
||||
return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
|
||||
};
|
||||
|
||||
$.fn.tipsy.autoNS = function() {
|
||||
return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
|
||||
};
|
||||
|
||||
$.fn.tipsy.autoWE = function() {
|
||||
return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
|
||||
};
|
||||
|
||||
/**
|
||||
* yields a closure of the supplied parameters, producing a function that takes
|
||||
* no arguments and is suitable for use as an autogravity function like so:
|
||||
*
|
||||
* @param margin (int) - distance from the viewable region edge that an
|
||||
* element should be before setting its tooltip's gravity to be away
|
||||
* from that edge.
|
||||
* @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer
|
||||
* if there are no viewable region edges effecting the tooltip's
|
||||
* gravity. It will try to vary from this minimally, for example,
|
||||
* if 'sw' is preferred and an element is near the right viewable
|
||||
* region edge, but not the top edge, it will set the gravity for
|
||||
* that element's tooltip to be 'se', preserving the southern
|
||||
* component.
|
||||
*/
|
||||
$.fn.tipsy.autoBounds = function(margin, prefer) {
|
||||
return function() {
|
||||
var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)},
|
||||
boundTop = $(document).scrollTop() + margin,
|
||||
boundLeft = $(document).scrollLeft() + margin,
|
||||
$this = $(this);
|
||||
|
||||
if ($this.offset().top < boundTop) dir.ns = 'n';
|
||||
if ($this.offset().left < boundLeft) dir.ew = 'w';
|
||||
if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e';
|
||||
if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's';
|
||||
|
||||
return dir.ns + (dir.ew ? dir.ew : '');
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
258
airtime_mvc/public/js/tipsy/jquery.tipsy_orig.js
Normal file
258
airtime_mvc/public/js/tipsy/jquery.tipsy_orig.js
Normal file
|
@ -0,0 +1,258 @@
|
|||
// tipsy, facebook style tooltips for jquery
|
||||
// version 1.0.0a
|
||||
// (c) 2008-2010 jason frame [jason@onehackoranother.com]
|
||||
// released under the MIT license
|
||||
|
||||
(function($) {
|
||||
|
||||
function maybeCall(thing, ctx) {
|
||||
return (typeof thing == 'function') ? (thing.call(ctx)) : thing;
|
||||
};
|
||||
|
||||
function isElementInDOM(ele) {
|
||||
while (ele = ele.parentNode) {
|
||||
if (ele == document) return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
function Tipsy(element, options) {
|
||||
this.$element = $(element);
|
||||
this.options = options;
|
||||
this.enabled = true;
|
||||
this.fixTitle();
|
||||
};
|
||||
|
||||
Tipsy.prototype = {
|
||||
show: function() {
|
||||
var title = this.getTitle();
|
||||
if (title && this.enabled) {
|
||||
var $tip = this.tip();
|
||||
|
||||
$tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
|
||||
$tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
|
||||
$tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body);
|
||||
|
||||
var pos = $.extend({}, this.$element.offset(), {
|
||||
width: this.$element[0].offsetWidth,
|
||||
height: this.$element[0].offsetHeight
|
||||
});
|
||||
|
||||
var actualWidth = $tip[0].offsetWidth,
|
||||
actualHeight = $tip[0].offsetHeight,
|
||||
gravity = maybeCall(this.options.gravity, this.$element[0]);
|
||||
|
||||
var tp;
|
||||
switch (gravity.charAt(0)) {
|
||||
case 'n':
|
||||
tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
|
||||
break;
|
||||
case 's':
|
||||
tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
|
||||
break;
|
||||
case 'e':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
|
||||
break;
|
||||
case 'w':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
|
||||
break;
|
||||
}
|
||||
|
||||
if (gravity.length == 2) {
|
||||
if (gravity.charAt(1) == 'w') {
|
||||
tp.left = pos.left + pos.width / 2 - 15;
|
||||
} else {
|
||||
tp.left = pos.left + pos.width / 2 - actualWidth + 15;
|
||||
}
|
||||
}
|
||||
|
||||
$tip.css(tp).addClass('tipsy-' + gravity);
|
||||
$tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0);
|
||||
if (this.options.className) {
|
||||
$tip.addClass(maybeCall(this.options.className, this.$element[0]));
|
||||
}
|
||||
|
||||
if (this.options.fade) {
|
||||
$tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
|
||||
} else {
|
||||
$tip.css({visibility: 'visible', opacity: this.options.opacity});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
if (this.options.fade) {
|
||||
this.tip().stop().fadeOut(function() { $(this).remove(); });
|
||||
} else {
|
||||
this.tip().remove();
|
||||
}
|
||||
},
|
||||
|
||||
fixTitle: function() {
|
||||
var $e = this.$element;
|
||||
if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') {
|
||||
$e.attr('original-title', $e.attr('title') || '').removeAttr('title');
|
||||
}
|
||||
},
|
||||
|
||||
getTitle: function() {
|
||||
var title, $e = this.$element, o = this.options;
|
||||
this.fixTitle();
|
||||
var title, o = this.options;
|
||||
if (typeof o.title == 'string') {
|
||||
title = $e.attr(o.title == 'title' ? 'original-title' : o.title);
|
||||
} else if (typeof o.title == 'function') {
|
||||
title = o.title.call($e[0]);
|
||||
}
|
||||
title = ('' + title).replace(/(^\s*|\s*$)/, "");
|
||||
return title || o.fallback;
|
||||
},
|
||||
|
||||
tip: function() {
|
||||
if (!this.$tip) {
|
||||
this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');
|
||||
this.$tip.data('tipsy-pointee', this.$element[0]);
|
||||
}
|
||||
return this.$tip;
|
||||
},
|
||||
|
||||
validate: function() {
|
||||
if (!this.$element[0].parentNode) {
|
||||
this.hide();
|
||||
this.$element = null;
|
||||
this.options = null;
|
||||
}
|
||||
},
|
||||
|
||||
enable: function() { this.enabled = true; },
|
||||
disable: function() { this.enabled = false; },
|
||||
toggleEnabled: function() { this.enabled = !this.enabled; }
|
||||
};
|
||||
|
||||
$.fn.tipsy = function(options) {
|
||||
|
||||
if (options === true) {
|
||||
return this.data('tipsy');
|
||||
} else if (typeof options == 'string') {
|
||||
var tipsy = this.data('tipsy');
|
||||
if (tipsy) tipsy[options]();
|
||||
return this;
|
||||
}
|
||||
|
||||
options = $.extend({}, $.fn.tipsy.defaults, options);
|
||||
|
||||
function get(ele) {
|
||||
var tipsy = $.data(ele, 'tipsy');
|
||||
if (!tipsy) {
|
||||
tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options));
|
||||
$.data(ele, 'tipsy', tipsy);
|
||||
}
|
||||
return tipsy;
|
||||
}
|
||||
|
||||
function enter() {
|
||||
var tipsy = get(this);
|
||||
tipsy.hoverState = 'in';
|
||||
if (options.delayIn == 0) {
|
||||
tipsy.show();
|
||||
} else {
|
||||
tipsy.fixTitle();
|
||||
setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn);
|
||||
}
|
||||
};
|
||||
|
||||
function leave() {
|
||||
var tipsy = get(this);
|
||||
tipsy.hoverState = 'out';
|
||||
if (options.delayOut == 0) {
|
||||
tipsy.hide();
|
||||
} else {
|
||||
setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut);
|
||||
}
|
||||
};
|
||||
|
||||
if (!options.live) this.each(function() { get(this); });
|
||||
|
||||
if (options.trigger != 'manual') {
|
||||
var binder = options.live ? 'live' : 'bind',
|
||||
eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
|
||||
eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
|
||||
this[binder](eventIn, enter)[binder](eventOut, leave);
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
};
|
||||
|
||||
$.fn.tipsy.defaults = {
|
||||
className: null,
|
||||
delayIn: 0,
|
||||
delayOut: 0,
|
||||
fade: false,
|
||||
fallback: '',
|
||||
gravity: 'n',
|
||||
html: false,
|
||||
live: false,
|
||||
offset: 0,
|
||||
opacity: 0.8,
|
||||
title: 'title',
|
||||
trigger: 'hover'
|
||||
};
|
||||
|
||||
$.fn.tipsy.revalidate = function() {
|
||||
$('.tipsy').each(function() {
|
||||
var pointee = $.data(this, 'tipsy-pointee');
|
||||
if (!pointee || !isElementInDOM(pointee)) {
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Overwrite this method to provide options on a per-element basis.
|
||||
// For example, you could store the gravity in a 'tipsy-gravity' attribute:
|
||||
// return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
|
||||
// (remember - do not modify 'options' in place!)
|
||||
$.fn.tipsy.elementOptions = function(ele, options) {
|
||||
return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
|
||||
};
|
||||
|
||||
$.fn.tipsy.autoNS = function() {
|
||||
return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
|
||||
};
|
||||
|
||||
$.fn.tipsy.autoWE = function() {
|
||||
return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
|
||||
};
|
||||
|
||||
/**
|
||||
* yields a closure of the supplied parameters, producing a function that takes
|
||||
* no arguments and is suitable for use as an autogravity function like so:
|
||||
*
|
||||
* @param margin (int) - distance from the viewable region edge that an
|
||||
* element should be before setting its tooltip's gravity to be away
|
||||
* from that edge.
|
||||
* @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer
|
||||
* if there are no viewable region edges effecting the tooltip's
|
||||
* gravity. It will try to vary from this minimally, for example,
|
||||
* if 'sw' is preferred and an element is near the right viewable
|
||||
* region edge, but not the top edge, it will set the gravity for
|
||||
* that element's tooltip to be 'se', preserving the southern
|
||||
* component.
|
||||
*/
|
||||
$.fn.tipsy.autoBounds = function(margin, prefer) {
|
||||
return function() {
|
||||
var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)},
|
||||
boundTop = $(document).scrollTop() + margin,
|
||||
boundLeft = $(document).scrollLeft() + margin,
|
||||
$this = $(this);
|
||||
|
||||
if ($this.offset().top < boundTop) dir.ns = 'n';
|
||||
if ($this.offset().left < boundLeft) dir.ew = 'w';
|
||||
if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e';
|
||||
if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's';
|
||||
|
||||
return dir.ns + (dir.ew ? dir.ew : '');
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
Loading…
Add table
Add a link
Reference in a new issue