pulling back needed partial

This commit is contained in:
maxwell 2010-11-22 17:29:51 -08:00
parent 08aaccbdf1
commit b283f5c579
4 changed files with 19 additions and 14 deletions

View file

@ -2,7 +2,10 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
= form_for Request.new, :remote => true do |request|
= request.hidden_field :into, :value => "changeme"
= request.hidden_field :to, :value => destination_handle
= request.submit '+', :class => 'add', :disable_with => "Sending"
%div{:id => destination_handle}
= form_for Request.new, :remote => true do |request|
= request.hidden_field :into, :value => "changeme"
= request.hidden_field :to, :value => destination_handle
= request.submit '+', :class => 'add', :disable_with => "Sending"
.message.hidden
%i= t('requests.new_request_to_person.sent')

View file

@ -98,7 +98,8 @@ en:
enter_a_diaspora_username: "Enter a Diaspora username:"
your_diaspora_username_is: "Your Diaspora username is: %{diaspora_handle}"
contact_username: "Contact's username"
create_request: "Create request"
create_request: "Find by Diaspora handle"
diaspora_handle: "Diaspora Handle"
invitations:
invite_someone: "Invite someone"
invitations_left: "(%{count} left)"

View file

@ -37,7 +37,7 @@ $(document).ready(function(){
}
);
$('.new_request').submit(function(){
$('.new_request').live("submit", function(){
var foo = $(this).parent();
$(this).hide();
foo.find('.message').removeClass('hidden');
@ -85,7 +85,7 @@ $(document).ready(function(){
$('.webfinger_form').submit(function(evt){
form = $(evt.currentTarget);
form.siblings('.spinner').show();
form.siblings('#loader').show();
$('#request_result li:first').hide();
});

View file

@ -34,23 +34,24 @@ var WebSocketReceiver = {
}
}
},
processPerson: function(response){
form = $('.webfinger_form:visible');
form.siblings('.spinner').hide();
result_ul = form.siblings('.webfinger_result');
processPerson: function(response){
form = $('.webfinger_form');
form.siblings('#loader').hide();
result_ul = form.siblings('#request_result');
if(response['status'] == 'fail'){
result_ul.children('.error').show();
result_ul.children('.webfinger_error').text(response['response']).show();
result_ul.siblings('.error').show();
result_ul.find('.error').text(response['response']).show();
}else{
$('#people_stream').prepend(response['html']).slideDown('slow', function(){});
var first_li = result_ul.find('li:first');
first_li.hide()
first_li.after(response['html']);
result_ul.find("[name='request[into]']").val(result_ul.attr('aspect_id'));
result_ul.children(':nth-child(2)').slideDown('fast', function(){});
}
},
processNotification: function(html){
$('#notification').html(html).fadeIn(200).delay(4000).fadeOut(200, function(){ $(this).html("");});
},