%= content_for :javascript do%>
<%if @event.authorize?(:update, :to => current_user)%>
$('#streaming_url_value').editable('<%=space_event_path(@space, @event, :format => 'js')%>',{
method : 'PUT',
tooltip : '<%= t('dblclick')%>',
cancel : '<%= t('cancel')%>',
onblur : 'ignore',
submit : '<%= t('ok')%>',
indicator : '
',
placeholder: '<%=t("event.streaming.none")%> <%=link_to_function t('event.streaming.add'), "edit_streaming()", :id => "add_streaming_link"%>',
type : 'textarea',
name : 'event[other_streaming_url]',
width : 635,
height: 150,
event : "dblclick",
submitdata : {authenticity_token: "<%=form_authenticity_token()%>"},
});
$('#streaming_url_value form input').livequery("blur",function(){
$('#edit_streaming_icon').show();
});
edit_streaming = function(){
$('#streaming_url_value').dblclick();
};
<%end%>
request_participation = function(){
var route = "<%= space_event_path(@space, @event) %>" + "?participation_by_ajax=true";
$.get(route,{
authenticity_token: "<%=form_authenticity_token()%>"
}, function(data){
$("#title_content").html("<%=t('event.video_part')%>");
$("#streaming_url_value").html(data);
$("#req_participation_link").html('<%=link_to_function ('' + t('event.streaming.back') + ''),"request_streaming()", {:id=>"view_streaming", :class=>"grey_button basic_button",:title => t('event.view_participation')} %>');
});
};
request_streaming = function(){
var route = "<%= space_event_path(@space, @event) %>" + "?streaming_by_ajax=true";
$.get(route,{
authenticity_token: "<%=form_authenticity_token()%>"
}, function(data){
$("#title_content").html("<%=t('event.streaming.title')%>");
$("#streaming_url_value").html(data);
$("#req_participation_link").html('<%=link_to_function ('' + t('join_cam') + ''), "request_participation()", {:id=>"view_streaming", :class=>"grey_button basic_button",:title => t('event.view_participation')} %>');
});
};
<%end%>