Commit 7db1da93 authored by Raphael's avatar Raphael

Stream is a class

parent a3395b6d
......@@ -17,6 +17,7 @@ public/uploads/*
public/assets/*
public/source.tar*
tmp/**/*
tmp/*
db/*.sqlite3
.redcar
......
......@@ -16,13 +16,9 @@
processNotification(obj['notice']);
}else if (obj['class'] == 'people'){
$('#loader').hide();
debug("got a " + obj['class']);
if(obj['status'] == 'fail'){
$('#request_result li:first').show().$('#message').text(obj['response']).show();
}else{
processPerson(obj['html']);
}
processPerson(obj);
}else{
debug("got a " + obj['class'] + " for aspects " + obj['aspect_ids']);
......@@ -46,12 +42,20 @@
};
});
function processPerson(html){
$('.people#stream').prepend(html).slideDown('slow', function(){});
var rr = $('#request_result li:first');
rr.after(html);
$("#request_result [name='into']").val(rr.attr('aspect_id'));
$('#request_result :nth-child(2)').slideDown('fast', function(){});
function processPerson(response){
form = $('.webfinger_form:visible');
form.siblings('.spinner').hide();
result_ul = form.siblings('.webfinger_result');
if(response['status'] == 'fail'){
result_ul.children('.error').show();
result_ul.children('.webfinger_error').text(response['response']).show();
}else{
//result_ul.prepend(response['html']).slideDown('slow', function(){});
var first_li = result_ul.find('li:first');
first_li.after(response['html']);
result_ul.children("[name='into']").val(first_li.attr('aspect_id'));
result_ul.children(':nth-child(2)').slideDown('fast', function(){});
}
}
function processNotification(html){
......@@ -60,7 +64,7 @@
function processRetraction(post_id){
$("*[data-guid='"+post_id+"']").fadeOut(400, function(){$(this).remove()});
if($("#stream")[0].childElementCount == 0){
if($("#main_stream")[0].childElementCount == 0){
$("#no_posts").fadeIn(200);
}
}
......@@ -89,9 +93,9 @@
function processPost(className, html, aspectIds){
if(onPageForAspects(aspectIds)){
var addPostToStream = function (html){
$("#stream:not('.show')").prepend(
$("#main_stream:not('.show')").prepend(
$(html).fadeIn("fast", function(){
$("#stream").find("label").first().inFieldLabels();
$("#main_stream").find("label").first().inFieldLabels();
})
)
};
......
......@@ -7,7 +7,7 @@
=t('.results_for')
%u= params[:q]
%ul#stream.people
%ul{:class => 'stream people', :id => 'people_stream'}
- for person in @people
= render 'people/person', :person => person, :aspects => @aspects
......
......@@ -57,6 +57,6 @@
= link_to t('.delete_photo'), @photo, :confirm => t('are_you_sure'), :method => :delete, :class => 'button'
.span-9.last
#stream.show
%div{id => 'photo_stream', :class => 'stream show'}"
%li.message{:data=>{:guid=>@photo.id}}
= render "comments/comments", :post => @photo
......@@ -30,13 +30,13 @@
= submit_tag t('.create_request')
%br
#loader.hidden= image_tag 'ajax-loader.gif'
%ul#request_result{:aspect_id => aspect.id}
.spinner.hidden= image_tag 'ajax-loader.gif'
%ul{:class => 'webfinger_result stream', :aspect_id => aspect.id}
%li.error.hidden
#message
.webfinger_error
= link_to t('.know_email'), "#invite_user_pane", :class => "invite_user_button"
%br
.yo{ :style => "display:none;"}
#invite_user_pane
.invite_user_pane
= render "invitations/new"
......@@ -2,6 +2,6 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
%ul#stream
%ul{:class => 'stream', :id => 'main_stream'}
- for post in posts
= render 'shared/stream_element', :post => post
......@@ -16,6 +16,6 @@
= link_to t('.destroy'), @status_message, :confirm => t('are_you_sure'), :method => :delete
.span-9.last
#stream.show
%div{:class => 'stream show', :id => 'status_message_stream'}
%li.message{:data=>{:guid=>@status_message.id}}
= render "comments/comments", :post => @status_message
......@@ -7,7 +7,7 @@
= t('.your_services')
.description
= t('.description')
%ul#stream
%ul.stream#service_stream
- for service in @services
%h3
%b= service.provider
......
......@@ -17,7 +17,7 @@ When /^(.*) in the aspect list$/ do |action|
end
Then /^I should see "([^\"]*)" in the main content area$/ do |stuff|
within("#stream") do
within("#main_stream") do
Then "I should see #{stuff}"
end
end
......
......@@ -5,9 +5,9 @@
$(document).ready(function(){
var $stream = $("#stream");
var $stream = $(".stream");
// expand all comments on page load
$("#stream:not('.show')").find('.comments').each(function(index) {
$(".stream:not('.show')").find('.comments').each(function(index) {
var comments = $(this);
if(comments.children("li").length > 1) {
var show_comments_toggle = comments.closest("li").find(".show_post_comments");
......@@ -32,7 +32,7 @@ $(document).ready(function(){
.closest("form").find(".comment_submit").fadeIn(200);
});
$("#stream").delegate("textarea.comment_box", "blur", function(evt){
$(".stream").delegate("textarea.comment_box", "blur", function(evt){
var commentBox = $(this);
if( !commentBox.val() ) {
commentBox.attr("rows", 1)
......
......@@ -46,7 +46,7 @@ $(document).ready(function(){
}
});
$("#stream").delegate("textarea.comment_box", "keydown", function(e){
$(".stream").delegate("textarea.comment_box", "keydown", function(e){
if (e.keyCode === 13) {
$(this).closest("form").submit();
}
......@@ -72,8 +72,9 @@ $(document).ready(function(){
$(".person img", ".dropzone").tipsy({live:true});
$(".avatar", ".aspects").tipsy({live:true});
$('.webfinger_form').submit(function(){
$('#loader').show();
$('.webfinger_form').submit(function(evt){
form = $(evt.currentTarget);
form.siblings('.spinner').show();
$('#request_result li:first').hide();
});
});//end document ready
......
......@@ -189,7 +189,7 @@ header
:margin
:left 432px
#stream
.stream
:margin 0
:padding 0
> li
......@@ -488,7 +488,7 @@ form
:margin
:right 1em
#stream.show
.stream.show
ul.comments
:display block
:margin
......@@ -501,7 +501,7 @@ form
:background none
:border none
#stream ul.comments
.stream ul.comments
:display none
.avatar
......@@ -587,7 +587,7 @@ ul.comments
:bottom 1em
#stream, #profile,
.stream, #profile,
.comments
img.person_picture
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment