'+$.i18n._("Can not connect to the streaming server")+'
'+status+'
';
}
$("#s"+id+"Liquidsoap-error-msg-element").html(html);
}
setTimeout(checkLiquidsoapStatus, 2000);
});
}
function setLiveSourceConnectionOverrideListener(){
$("[id=connection_url_override]").click(function(event){
var url_input = $(this).parent().find("dd[id$='_source_host-element']").children();
url_input.removeAttr("readonly");
$(this).parent().find("div[id$='_dj_connection_url_actions']").show();
event.preventDefault();
});
// set action for "OK" and "X"
var live_dj_actions = $("#live_dj_connection_url_actions");
var live_dj_input = live_dj_actions.parent().find("dd[id$='_source_host-element']").children();
var master_dj_actions = $("#master_dj_connection_url_actions");
var master_dj_input = master_dj_actions.parent().find("dd[id$='_source_host-element']").children();
live_dj_actions.find("#ok").click(function(event){
event.preventDefault();
var url = live_dj_input.val();
live_dj_input.val(url);
live_dj_input.attr("readonly", "readonly");
live_dj_actions.hide();
$.get(baseUrl+"Preference/set-source-connection-url/", {format: "json", type: "livedj", url:encodeURIComponent(url), override: 1});
event.preventDefault();
});
live_dj_actions.find("#reset").click(function(event){
event.preventDefault();
var port = $("#show_source_port").val();
var mount = $("#show_source_mount").val();
var url = "http://"+location.hostname+":"+port+"/"+mount;
if (port == '' || mount == '') {
url = 'N/A';
}
live_dj_input.val(url);
live_dj_input.attr("readonly", "readonly");
live_dj_actions.hide();
$.get(baseUrl+"Preference/set-source-connection-url", {format: "json", type: "livedj", url:encodeURIComponent(url), override: 0});
event.preventDefault();
});
master_dj_actions.find("#ok").click(function(event){
var url = master_dj_input.val();
master_dj_input.val(url);
master_dj_input.attr("readonly", "readonly");
master_dj_actions.hide();
$.get(baseUrl+"Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url), override: 1});
event.preventDefault();
});
master_dj_actions.find("#reset").click(function(event){
var port = $("#master_source_port").val();
var mount = $("#master_source_mount").val();
var url = "http://"+location.hostname+":"+port+"/"+mount;
if (port == '' || mount == '') {
url = 'N/A';
}
master_dj_input.val(url);
master_dj_input.attr("readonly", "readonly");
master_dj_actions.hide();
$.get(baseUrl+"Preference/set-source-connection-url", {format: "json", type: "masterdj", url:encodeURIComponent(url), override: 0});
event.preventDefault();
});
}
function setupEventListeners() {
// initial stream url
$("dd[id=outputStreamURL-element]").each(function(){
rebuildStreamURL($(this));
})
$("input[id$=-host], input[id$=-port], input[id$=-mount]").keyup(function(){
rebuildStreamURL($(this));
});
$("input[id$=-port]").keypress(function(e){
validate($(this),e);
});
$("select[id$=-output]").change(function(){
rebuildStreamURL($(this));
});
if(!$("#output_sound_device").is(':checked')){
$("select[id=output_sound_device_type]").attr('disabled', 'disabled');
}else{
$("select[id=output_sound_device_type]").removeAttr('disabled');
}
$("#output_sound_device").change(function(){
if($(this).is(':checked')){
$("select[id=output_sound_device_type]").removeAttr('disabled');
}else{
$("select[id=output_sound_device_type]").attr('disabled', 'disabled');
}
});
$("select[id$=data-type]").change(function(){
if($(this).val() == 'ogg'){
restrictOggBitrate($(this), true);
}else{
restrictOggBitrate($(this), false);
}
});
$("select[id$=data-type]").each(function(){
if($(this).val() == 'ogg'){
restrictOggBitrate($(this), true);
}
});
$("select[id$=data-output]").change(function(){
if($(this).val() == 'shoutcast'){
hideForShoutcast($(this));
}else{
showForIcecast($(this));
}
});
$("select[id$=data-output]").each(function(){
if($(this).val() == 'shoutcast'){
hideForShoutcast($(this));
}
});
$('.toggle legend').click(function() {
$(this).parent().toggleClass('closed');
return false;
});
$('.collapsible-header').click(function() {
$(this).next().toggle('fast');
$(this).toggleClass("closed");
return false;
});
setLiveSourceConnectionOverrideListener();
showErrorSections();
checkLiquidsoapStatus();
var userManualAnchorOpen = "