diff --git a/app/views/albums/index.html.haml b/app/views/albums/index.html.haml index 81455b85b93ab919a57db57f9fb03dce1edb37fc..b9e62113f9f97ae2a63168acf71671797cd42b58 100644 --- a/app/views/albums/index.html.haml +++ b/app/views/albums/index.html.haml @@ -8,10 +8,14 @@ $("#add_album_button").fancybox(); }); -.span-4.append-1.last - = render "shared/aspect_friends" +%h2 + = @aspect + .friend_pictures.horizontal + = owner_image_link + - for friend in @friends + = person_image_link(friend) -.span-15.last +.span-24.last %h3 = @aspect Albums diff --git a/app/views/js/_websocket_js.haml b/app/views/js/_websocket_js.haml index 78312f5feedbdddf95c05d0a1c4e74b3b923c8ca..ec7381bf42ac91144ee032086aa2541dc18073d2 100644 --- a/app/views/js/_websocket_js.haml +++ b/app/views/js/_websocket_js.haml @@ -44,17 +44,19 @@ } function processComment(post_id, html){ - post = $('#' + post_id)[0] + post = $("*[data-guid='"+post_id+"']'"); $(' .comment_set li:last', post ).before( $(html).fadeIn("fast", function(){}) ); toggler = $('.show_post_comments', post) - toggler.html( - toggler.html().replace(/\d+/,$('.comment_set', post)[0].childElementCount -1)); + if(toggler.length > 0){ + toggler.html( + toggler.html().replace(/\d+/,$('.comment_set', post)[0].childElementCount -1)); - if( !$(".comments", post).is(':visible') ){ - toggler.click(); + if( !$(".comments", post).is(':visible') ){ + toggler.click(); + } } } diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index afdf1ebf3b0c1e753c6dbcc0d1f08ce7b80b2aac..e4ae231709d9b8c0ae86189d580e5f8daa9fc68f 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -2,57 +2,58 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -:javascript - $(document).keydown(function(e){ - switch(e.keyCode) { - case 37: - if(!$("textarea").hasClass("hasfocus")){//prevent redirect if textarea has focus - window.location.replace( "#{url_to_prev(@photo,@album)}" ); +- content_for :head do + :javascript + $(document).keydown(function(e){ + switch(e.keyCode) { + case 37: + if(!$("textarea").hasClass("hasfocus")){//prevent redirect if textarea has focus + window.location.replace( "#{url_to_prev(@photo,@album)}" ); + } + break; + case 39: + if(!$("textarea").hasClass("hasfocus")){ + window.location.replace( "#{url_to_next(@photo,@album)}" ); + } + break; } - break; - case 39: - if(!$("textarea").hasClass("hasfocus")){ - window.location.replace( "#{url_to_next(@photo,@album)}" ); - } - break; - } - }); - - $(document).ready(function(){ - //add a clas to verify if a textarea has focus - $("textarea").live('focus',function(){ - $(this).addClass("hasfocus"); - }); - $("textarea").live('blur',function(){ - $(this).removeClass("hasfocus"); }); - //show form to add description - $(".edit-desc").click(function(){ - $(".edit_photo").toggle(); - }); + $(document).ready(function(){ + //add a clas to verify if a textarea has focus + $("textarea").live('focus',function(){ + $(this).addClass("hasfocus"); + }); + $("textarea").live('blur',function(){ + $(this).removeClass("hasfocus"); + }); - //Add a description with ajax request - $("#photo_submit").click(function(evenet){ - event.preventDefault(); - var method = $(".edit_photo").attr("method"); - var url = $(".edit_photo").attr("action"); - var data = $(".edit_photo").serialize(); - $(".description").text($("#photo_caption").val()); - $(".edit_photo").toggle(); - - $.ajax({ - type: method, - url: url, - data: data, - success: function(response){ - $("#add-description").remove(); - } - }); + //show form to add description + $(".edit-desc").click(function(){ + $(".edit_photo").toggle(); + }); - }); + //Add a description with ajax request + $("#photo_submit").click(function(evenet){ + event.preventDefault(); + var method = $(".edit_photo").attr("method"); + var url = $(".edit_photo").attr("action"); + var data = $(".edit_photo").serialize(); + $(".description").text($("#photo_caption").val()); + $(".edit_photo").toggle(); + + $.ajax({ + type: method, + url: url, + data: data, + success: function(response){ + $("#add-description").remove(); + } + }); - });//end document ready + }); + + });//end document ready %h2 = @aspect @@ -64,6 +65,12 @@ %h3 = link_to @photo.album.name, @photo.album += link_to "<< #{t('.prev')}", url_to_prev(@photo, @album), :rel => 'prefetch' +| += link_to "#{t('.full_size')}", @photo.url +| += link_to "#{t('.next')} >>", url_to_next(@photo, @album), :rel => 'prefetch' + .span-14.append-1.last %div{:data=>{:guid=>@photo.id}} #show_photo @@ -72,8 +79,6 @@ .edit_pane .controls{:data=>{:actor=>"#{@photo.person.owner.id}",:actor_person=>"#{@photo.person.id}",:image_url=>"#{@photo.url(:thumb_medium)}"}} = link_to 'make profile photo', '#', :class => "make_profile_photo" - | - = link_to 'edit', '#', :class => "make_profile_photo" = linked_scaled_photo @photo, @album -else = linked_scaled_photo @photo, @album @@ -100,13 +105,6 @@ = link_to t('.delete_photo'), @photo, :confirm => t('.are_you_sure'), :method => :delete, :class => 'button' .span-9.last - = link_to "<< #{t('.prev')}", url_to_prev(@photo, @album), :rel => 'prefetch' - | - = link_to "#{t('.full_size')}", @photo.url - | - = link_to "#{t('.next')} >>", url_to_next(@photo, @album), :rel => 'prefetch' - %br - %br #stream.show - %li.message{:id => @photo.id} + %li.message{:data=>{:guid=>@photo.id}} = render "comments/comments", :post => @photo diff --git a/app/views/status_messages/show.html.haml b/app/views/status_messages/show.html.haml index e9dbd481680335f2a2f84eb50889720cc8e60834..398b3a5369f8a16f6ec7cab3844a2e1ca934147b 100644 --- a/app/views/status_messages/show.html.haml +++ b/app/views/status_messages/show.html.haml @@ -26,5 +26,5 @@ .span-9.last #stream.show - %li.message{:id => @status_message.id} + %li.message{:data=>{:guid=>@status_message.id}} = render "comments/comments", :post => @status_message diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 907602743f03340b79e6fc4b969f8f698b46c771..7e809f9782f697a5b28f018a922709f1da6f1299 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -47,7 +47,7 @@ $(document).ready(function(){ } ); - $("#publisher textarea, .comment textarea").keydown( function(e) { + $("#publisher textarea, .comment_box").keydown( function(e) { if (e.keyCode == 13) { $(this).closest("form").submit(); } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 7bbaeea4b46bc891a8e237a189302d8e3cfadfff..f2f0959e31ccaef3aeedc52423d71d567f83cefb 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -180,7 +180,7 @@ header #global_search :margin - :left 425px + :left 432px #stream :margin 0 @@ -1015,8 +1015,8 @@ ul#settings_nav :left 20px img - :width 20px - :height 20px + :width 30px + :height 30px :margin-right -4px #thumbnails @@ -1070,7 +1070,7 @@ input[type="search"] header input[type="search"] - :width 200px + :width 192px .fancybox_content :display none