Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

Conflicts:
	airtime_mvc/application/common/DateHelper.php
	airtime_mvc/public/js/airtime/library/library.js
This commit is contained in:
Martin Konecny 2012-11-30 18:01:02 -05:00
commit b474035d76
184 changed files with 14239 additions and 1155 deletions

View file

@ -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
@ -104,7 +133,7 @@ function open_show_preview(p_showID, p_showIndex) {
}
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;
}

View file

@ -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);

View file

@ -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;

View file

@ -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.'));
}
}
});

View file

@ -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',

View file

@ -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'>" +
@ -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,
@ -611,7 +612,7 @@ 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
},
@ -664,10 +665,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 +723,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();
@ -812,7 +810,7 @@ var AIRTIME = (function(AIRTIME) {
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){
@ -1009,7 +1007,7 @@ function addQtipToSCIcons(){
if ($(this).hasClass("progress")){
$(this).qtip({
content: {
text: "Uploading in progress..."
text: $.i18n._("Uploading in progress...")
},
position:{
adjust: {
@ -1030,19 +1028,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: 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);
}
}
},
@ -1063,14 +1055,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: 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>");
}
}
},
@ -1173,13 +1166,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>",

View file

@ -56,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");
}
});

View file

@ -74,7 +74,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val();
if (!isTimeValid(cueIn)){
showError(span, "please put in a time '00:00:00 (.0)'");
showError(span, $.i18n("please put in a time '00:00:00 (.0)'"));
return;
}
$.post(url,
@ -111,7 +111,7 @@ var AIRTIME = (function(AIRTIME){
type = $('#obj_type').val();
if (!isTimeValid(cueOut)){
showError(span, "please put in a time '00:00:00 (.0)'");
showError(span, $.i18n("please put in a time '00:00:00 (.0)'"));
return;
}
@ -150,7 +150,7 @@ var AIRTIME = (function(AIRTIME){
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;
}
@ -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;
}
@ -378,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,
@ -402,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,
@ -483,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();
@ -575,7 +575,7 @@ var AIRTIME = (function(AIRTIME){
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;
}
@ -599,7 +599,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;
}
@ -739,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();
@ -1076,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: {

View file

@ -134,7 +134,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 +143,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,8 +160,11 @@ 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);

View file

@ -16,7 +16,7 @@ $(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 = baseUrl+'/Usersettings/remindme';
@ -29,7 +29,7 @@ $(document).ready(function(){
},
{
id: "remind_never",
text: "Remind me never",
text: $.i18n._("Remind me never"),
"class": "btn",
click: function() {
var url =baseUrl+'/Usersettings/remindme-never';
@ -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) {

View file

@ -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
@ -554,7 +550,7 @@ function removeButtonCheck() {
function enableLoadingIcon() {
$("#side_playlist").block({
message: "Processing...",
message: $.i18n._("Processing..."),
theme: true,
allowBodyStretch: true,
applyPlatformOpacityRules: false
@ -595,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")
};

View file

@ -65,12 +65,12 @@ 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,
@ -80,11 +80,9 @@ var AIRTIME = (function(AIRTIME) {
"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",
@ -150,6 +148,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 +159,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();

View file

@ -15,7 +15,7 @@ function setWatchedDirEvents() {
imageUrl: 'img/icons/',
systemImageUrl: baseUrl+'/css/img/',
handlerUrl: baseUrl+'/Preference/server-browse/format/json',
title: 'Choose Storage Folder',
title: $.i18n._('Choose Storage Folder'),
basePath: '',
requestMethod: 'POST',
});
@ -35,7 +35,7 @@ function setWatchedDirEvents() {
imageUrl: 'img/icons/',
systemImageUrl: baseUrl+'/css/img/',
handlerUrl: baseUrl+'/Preference/server-browse/format/json',
title: 'Choose Folder to Watch',
title: $.i18n._('Choose Folder to Watch'),
basePath: '',
requestMethod: 'POST',
});
@ -43,7 +43,7 @@ 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!")){
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();
@ -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();
});
@ -84,7 +84,7 @@ function setWatchedDirEvents() {
});
$('.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();
@ -95,7 +95,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();
});
@ -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: {

View file

@ -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);
}
@ -250,7 +250,9 @@ function setupEventListeners() {
// 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 @@ function setupEventListeners() {
$(".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 @@ function setupEventListeners() {
$("#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 @@ function setupEventListeners() {
$("#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,7 @@ function setupEventListeners() {
$(".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,
@ -355,7 +357,7 @@ function setupEventListeners() {
$(".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,
@ -375,12 +377,7 @@ function setupEventListeners() {
})
$('#stream_save').live('click', function(){
var confirm_pypo_restart_text = "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.";
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';

View file

@ -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) {

View file

@ -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
});
}
@ -53,7 +56,7 @@ function findHosts(request, callback) {
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,11 +305,15 @@ 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({
@ -318,7 +325,10 @@ function setAddShowEvents() {
});
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(){
@ -628,7 +638,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();
}

View file

@ -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;
@ -261,7 +261,7 @@ function eventRender(event, element, view) {
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>');
.before('<span id="'+event.id+'" title="'+$.i18n._("Show is empty")+'" class="small-icon show-empty"></span>');
} else if (event.soundcloud_id > 0) {
} else if (event.soundcloud_id === -2) {
@ -275,7 +275,7 @@ function eventRender(event, element, view) {
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>');
.after('<span id="'+event.id+'" title="'+$.i18n._("Show is empty")+'" class="small-icon show-empty"></span>');
} else if (event.soundcloud_id > 0) {
} else if (event.soundcloud_id === -2) {
@ -424,7 +424,7 @@ function addQtipToSCIcons(ele){
if($(ele).hasClass("progress")){
$(ele).qtip({
content: {
text: "Uploading in progress..."
text: $.i18n._("Uploading in progress...")
},
position:{
adjust: {
@ -442,13 +442,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: baseUrl+"/Library/get-upload-to-soundcloud-status",
type: "post",
data: ({format: "json", id : id, type: "file"}),
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);
}
}
},
@ -468,14 +468,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: 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>");
}
}
},
@ -495,7 +495,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: {
@ -548,7 +548,7 @@ function checkEmptyShowStatus(e) {
//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();
}

View file

@ -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,7 +33,7 @@ function checkShowLength(json) {
}
function confirmCancelShow(show_instance_id){
if (confirm('Cancel Current Show?')) {
if (confirm($.i18n._('Cancel Current Show?'))) {
var url = baseUrl+"/Schedule/cancel-current-show";
$.ajax({
url: url,
@ -46,7 +46,7 @@ function confirmCancelShow(show_instance_id){
}
function confirmCancelRecordedShow(show_instance_id){
if (confirm('Stop recording current show?')) {
if (confirm($.i18n._('Stop recording current show?'))) {
var url = baseUrl+"/Schedule/cancel-current-show";
$.ajax({
url: url,
@ -165,7 +165,7 @@ function buildScheduleDialog (json) {
close: closeDialog,
buttons: [
{
text: "Ok",
text: $.i18n._("Ok"),
"class": "btn",
click: function() {
$(this).dialog("close");
@ -207,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();
@ -262,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,
@ -283,7 +323,7 @@ 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();
}
@ -324,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);
});

View file

@ -283,7 +283,7 @@ var AIRTIME = (function(AIRTIME){
mod.fnRemove = function(aItems) {
mod.disableUI();
if (confirm("Delete selected item(s)?")) {
if (confirm($.i18n._("Delete selected item(s)?"))) {
$.post( baseUrl+"/showbuilder/schedule-remove",
{"items": aItems, "format": "json"},
mod.fnItemCallback
@ -360,17 +360,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,
@ -527,7 +527,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 +539,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 +554,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="'+baseUrl+'/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 +565,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,6 +791,7 @@ var AIRTIME = (function(AIRTIME){
"sDom": 'R<"dt-process-rel"r><"sb-padded"<"H"C>><"dataTables_scrolling sb-padded"t>',
"sAjaxDataProp": "schedule",
"oLanguage": datatables_dict,
"sAjaxSource": baseUrl+"/showbuilder/builder-feed"
});
@ -877,7 +878,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 +933,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 +984,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 +1020,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,7 +1032,7 @@ 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)) {

View file

@ -15,7 +15,7 @@ AIRTIME = (function(AIRTIME) {
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>"),
$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": "#",
@ -30,6 +30,9 @@ AIRTIME = (function(AIRTIME) {
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 );
}
@ -38,8 +41,11 @@ AIRTIME = (function(AIRTIME) {
oBaseTimePickerSettings = {
showPeriodLabels: false,
showCloseButton: true,
closeButtonText: $.i18n._("Done"),
showLeadingZero: false,
defaultTime: '0:00'
defaultTime: '0:00',
hourText: $.i18n._("Hour"),
minuteText: $.i18n._("Minute")
};
function setWidgetSize() {

View file

@ -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>';

View file

@ -45,16 +45,16 @@ 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;
@ -86,9 +86,7 @@ function populateUserTable() {
"bJQueryUI": true,
"bAutoWidth": false,
"bLengthChange": false,
"oLanguage": {
"sSearch": ""
},
"oLanguage": datatables_dict,
"sDom": '<"H"lf<"dt-process-rel"r>>t<"F"ip>',
});

View 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"
}
}

View 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": ": 내림차순으로 정렬"
}
}

View file

@ -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);

View file

@ -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"),

View file

@ -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

View file

@ -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);

View 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);

View file

@ -0,0 +1,26 @@
// 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'
});

View file

@ -0,0 +1,26 @@
// 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개의 파일이 큐 되었습니다'
});

View 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') {

View file

@ -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') {

View 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);