From 42993de7391a4f28b02f940d39d60bfa3959bf1d Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sun, 6 Feb 2011 09:26:24 -0800 Subject: [PATCH] added back to comments; avatar. --- app/views/comments/_new_comment.haml | 9 +-- config/locales/diaspora/en.yml | 3 - public/javascripts/stream.js | 18 ++---- public/stylesheets/sass/application.sass | 78 +++++++++++++++--------- 4 files changed, 55 insertions(+), 53 deletions(-) diff --git a/app/views/comments/_new_comment.haml b/app/views/comments/_new_comment.haml index 68483aa92..5f0b7a307 100644 --- a/app/views/comments/_new_comment.haml +++ b/app/views/comments/_new_comment.haml @@ -3,14 +3,11 @@ -# the COPYRIGHT file. = form_tag( comments_path, :id => "new_comment_on_#{post_id}", :class => 'new_comment', :remote => true) do + = owner_image_tag %p = label_tag "comment_text_on_#{post_id}", t('.comment') = text_area_tag :text, nil, :rows => 2, :class => "comment_box",:id => "comment_text_on_#{post_id}" = hidden_field_tag :post_id, post_id, :id => "post_id_on_#{post_id}" - = submit_tag t('.comment'), :id => "comment_submit_#{post_id}", :class => "comment_submit button", :disable_with => t('.commenting') - -.submit_instructions.hidden - = t('.press') - %b= t('.enter') - = t('.to_comment') + .submit_button + = submit_tag t('.comment'), :id => "comment_submit_#{post_id}", :class => "comment_submit button", :disable_with => t('.commenting') diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 8c8f25753..bc9539410 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -266,9 +266,6 @@ en: new_comment: comment: "Comment" commenting: "Commenting..." - press: "press" - enter: "enter" - to_comment: "to comment" photos: show: delete_photo: "Delete Photo" diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js index ae6e9b3dc..8b0a2e34d 100644 --- a/public/javascripts/stream.js +++ b/public/javascripts/stream.js @@ -16,22 +16,12 @@ var Stream = { Stream.focusNewComment($(this), e); }); - // comment submit action - $stream.delegate("textarea.comment_box", "keydown", function(e){ - if (e.keyCode === 13) { - if(!e.shiftKey) { - $(this).blur(); - $(this).closest("form").submit(); - } - } - }); - $stream.delegate("textarea.comment_box", "focus", function(evt) { var commentBox = $(this); commentBox .attr('rows',2) - .addClass('force_open') - .closest("li").find(".submit_instructions").removeClass('hidden'); + .parent().parent() + .addClass('open'); }); $stream.delegate("textarea.comment_box", "blur", function(evt) { @@ -39,9 +29,9 @@ var Stream = { if (!commentBox.val()) { commentBox .attr('rows',1) - .removeClass('force_open') .css('height','1.4em') - .closest("li").find(".submit_instructions").addClass('hidden'); + .parent().parent() + .removeClass('open'); } }); diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index b8dcb350f..12aa5f544 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -521,31 +521,20 @@ header :right 1em .stream.show - ul.comments - :display block - :margin - :top 0 - > li - :border none - :padding 0 - :word-wrap break-word &:hover > li :background none :border none - ul.comments - textarea - :width 425px - :max-width 97% .stream ul.comments .avatar :width 30px :height 30px -input.comment_submit - :display none +.submit_button + :text + :align right ul.comments, ul.show_comments @@ -559,13 +548,10 @@ ul.show_comments :width 100% :height 1.4em - .force_open - :min-height 2.4em - li :list :style none - :padding 0.5em + :padding 0.4em :border :bottom 1px solid #ddd :top 1px solid #fff @@ -587,7 +573,7 @@ ul.show_comments :top 0px :bottom -2px :padding - :left 38px + :left 37px :right 20px .from a @@ -599,23 +585,54 @@ ul.show_comments form :margin :top -5px - :bottom 0.2em + :bottom -4px :font :size 1em + + .submit_button + :display none + input + :margin + :right 0 + textarea :font :size 1em - :width 478px + :margin + :bottom -3px + :width 482px - .submit_instructions - :text-align center - :font - :size smaller - :color #999 - :margin - :bottom -0.8em - :top -0.7em - :padding 0 + .avatar + :display none + + form.open + .submit_button + :display block + :margin + :bottom 2px + :right 2px + + textarea + :min-height 2.4em + :width 445px + + p + :position relative + :left 36px + + .avatar + :position absolute + :display inline + +.stream.show + ul.comments + li + :padding + :right 135px + + textarea + :margin + :bottom 2px .profile_photo img @@ -625,6 +642,7 @@ ul.show_comments :-webkit-box-shadow 0 2px 2px #333 :-moz-box-shadow 0 2px 2px #333 :box-shadow 0 2px 2px #333 + #profile h3 :margin