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

This commit is contained in:
martin 2011-08-18 15:44:57 -04:00
commit fc66b1d1ba
18 changed files with 701 additions and 104 deletions

View file

@ -1,6 +1,6 @@
function showErrorSections() {
if($("soundcloud-settings .errors").length > 0) {
if($("#soundcloud-settings .errors").length > 0) {
$("#soundcloud-settings").show();
$(window).scrollTop($("soundcloud-settings .errors").position().top);
}

View file

@ -1,13 +1,38 @@
$(document).ready(function() {
function showErrorSections() {
$('#change_setting').click(function(){
var url;
url = "/Preference/change-stream-setting";
$.post(url,
{format: "json"}
);
$(".errors").each(function(i){
if($(this).length > 0){
$(this).closest("div").show();
$(window).scrollTop($(this).position().top);
return false;
}
});
}
function buildStreamUrl(){
$("input:[id$=-host], input:[id$=-port], input:[id$=-mount], select:[id$=-type]").change(function(){
div = $(this).closest("div")
host = div.find("input:[id$=-host]").val()
port = div.find("input:[id$=-port]").val()
mount = div.find("input:[id$=-mount]").val()
type = div.find("select:[id$=-type]").val()
div.find("#stream_url").html("http://"+host+":"+port+"/"+mount+"."+type)
if($(this).attr('id').indexOf('type') != -1){
div.find("#mount_ext").html("."+type)
}
})
}
$(document).ready(function() {
$('.collapsible-header').click(function() {
$(this).next().toggle('fast');
$(this).toggleClass("close");
return false;
}).next().hide();
showErrorSections()
buildStreamUrl()
});