Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 85dbbaea1f
Fetching contributors…

Cannot retrieve contributors at this time

68 lines (57 sloc) 2.272 kb
<h2>Wave: <%=h @wave.name %> (from <%=h @wave.server || (@remote.provider.local).domain %>)</h2>
<% unless @wave.complete? -%>
<div class="error box">This wave currently has incomplete data. <%= @wave.complete? %></div>
<% end -%>
<p><em>Participants:</em>
<% @wave.participants.each do |address| -%>
<%=mail_to address %> (<%=link_to 'remove', wave_remove_path(@wave.name, address) %>)
<% end -%>
<%= form_tag wave_add_path(@wave.name) %>
<%= text_field_tag "who" %><%= submit_tag "Add participant" %>
</form>
</p>
<hr/>
<p><strong><a name="contents">Contents</a></strong></p>
<blockquote id="contents2">
<%= @html %>
<!--<% @wave.blips.flatten.each do |blip| -%>
<p><strong><%=h blip %></strong></p>
<p><em>by <%=h @wave.blip(blip).authors.join(', ') %></em></p>
<%= @wave.blip(blip).to_xml %>
<hr/>
<% end -%>-->
</blockquote>
<%= link_to_remote "Update", :update => "contents2", :url => "/waves/#{@wave.name}/ajax" %>
<%= form_remote_tag :url => wave_update_path(@wave.name), :complete => "submitted();", :html => {'id' => 'add-form'} %>
Message: <%= text_field_tag 'message' %><br/>
Add under: <%= text_field_tag 'parent' %> (leave blank unless you know what you are doing)<br/>
<%= submit_tag "Add new blip" %>
</form>
<script type="text/javascript" src="/javascripts/prototype.js"></script>
<script type="text/javascript">
var timer = 0;
function queueUpdate() {
timer = setTimeout('update()', 1000);
}
function submitted() {
document.getElementById('message').value = '';
if (timer != 0) clearTimeout(timer);
update();
}
function update() {
timer = 0;
new Ajax.Updater('contents2', '<%=wave_ajax_path @wave.name %>', {asynchronous:true, evalScripts:true, onSuccess:queueUpdate, onFailure:function(){alert('Error!');}, parameters:Form.serialize(document.getElementById('add-form'))});
/*new Ajax.Request('<%=wave_ajax_path @wave.name %>', {
method: 'get',
onSuccess: function(transport) {
alert(transport.responseText);
//var notice = $('data');
if (transport.responseText.match(/href="http:\/\/prototypejs.org/))
notice.update('Yeah! You are in the Top 10!').setStyle({ background: '#dfd' });
else
notice.update('Damn! You are beyond #10...').setStyle({ background: '#fdd' });
}
});*/
}
update();
</script>
Jump to Line
Something went wrong with that request. Please try again.