From 77042f9d479ddec36efc8b442139d2b0182410e7 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sat, 22 Jan 2011 18:48:55 -0800 Subject: [PATCH] publisher always shows textarea. outline publisher textarea in blue --- app/helpers/aspects_helper.rb | 18 ++++++---------- app/views/aspects/index.html.haml | 1 - app/views/shared/_publisher.haml | 7 ++---- config/locales/diaspora/en.yml | 4 +--- public/javascripts/aspect-filters.js | 2 +- public/javascripts/publisher.js | 4 ++-- public/javascripts/stream.js | 7 ++++-- public/stylesheets/sass/application.sass | 27 ++++++++++++++---------- 8 files changed, 34 insertions(+), 36 deletions(-) diff --git a/app/helpers/aspects_helper.rb b/app/helpers/aspects_helper.rb index 7deffb791..c80215209 100644 --- a/app/helpers/aspects_helper.rb +++ b/app/helpers/aspects_helper.rb @@ -1,4 +1,4 @@ -# Copyright (c) 2010, Diaspora Inc. This file is +#/ Copyright (c) 2010, Diaspora Inc. This file is # licensed under the Affero General Public License version 3 or later. See # the COPYRIGHT file. @@ -46,17 +46,13 @@ module AspectsHelper end end - def publisher_description(aspect_count, aspect=nil) - if aspect && aspect == :all - str = t('.share_with_all') + def publisher_description(aspect_count) + str = "#{t('.share_with')} #{aspect_count} " + if aspect_count == 1 + str += t('_aspect').downcase else - str = "#{t('.post_a_message_to', :aspect => aspect_count)} " - if aspect_count == 1 - str += t('_aspect').downcase - else - str += t('_aspects').downcase - end + str += t('_aspects').downcase end - (link_to str, '#', :id => 'expand_publisher').html_safe + ("#{str}").html_safe end end diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index a3d548233..a839b549b 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -22,7 +22,6 @@ = current_user.name .description = link_to current_user.diaspora_handle, person_path(current_user.person) - /= info_text(t('.handle_explanation')) - if @notification_count > 0 || @request_count > 0 #new_requests diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index 2da537dfb..36cfe49d9 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -7,7 +7,7 @@ #click_to_share = image_tag 'icons/doc_edit.png' - = publisher_description(@aspect_ids.count, aspect) + = publisher_description(@aspect_ids.count) .content_creation = form_for(StatusMessage.new, :remote => true) do |status| @@ -31,10 +31,7 @@ .right #fileInfo = image_tag 'ajax-loader.gif', :class => 'hidden', :id => "publisher_spinner" - - if aspect == :all - = status.submit t('.share'), :title => t('.share_with_all'), :disable_with => t('.posting'), :class => 'button' - - else - = status.submit t('.share'), :disable_with => t('.posting'), :class => 'button' + = status.submit t('.share'), :disable_with => t('.posting'), :class => 'button' - if aspect == :all .public_toggle diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 1d33d5818..9753add2e 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -100,12 +100,10 @@ en: share: "Share" post_a_message_to: "Post a message to %{aspect}" make_public: "make public" - share_with_all: "Share with all aspects" - share_with: "Share with %{aspect}" all: "all" add_photos: "add photos" all_contacts: "all contacts" - share_with_all: "share across all of your aspects" + share_with: "share with" add_contact: enter_a_diaspora_username: "Enter a Diaspora username:" your_diaspora_username_is: "Your Diaspora username is: %{diaspora_handle}" diff --git a/public/javascripts/aspect-filters.js b/public/javascripts/aspect-filters.js index d780ae4bd..4b59482c1 100644 --- a/public/javascripts/aspect-filters.js +++ b/public/javascripts/aspect-filters.js @@ -133,7 +133,7 @@ $(document).ready(function(){ var textarea = $("#publisher textarea"); var photozone = $('#photodropzone') - if( textarea.val() == "" ) { + if( post != "" ) { textarea.val(post); textarea.focus(); } diff --git a/public/javascripts/publisher.js b/public/javascripts/publisher.js index a4185c15a..21d9a137a 100644 --- a/public/javascripts/publisher.js +++ b/public/javascripts/publisher.js @@ -18,11 +18,11 @@ $(document).ready(function(){ $("#publisher .options_and_submit").show(); } - $("#publisher textarea, #publisher input").live("focus", function(evt){ + $("#publisher textarea").live("focus", function(evt){ $("#publisher .options_and_submit").show(); }); - $("#click_to_share").find("a").live("click", function(evt){ + $("#publisher textarea").live("click", function(evt){ $("#publisher").removeClass("closed"); $("#publisher").find("textarea").focus(); }); diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js index ea9a754ed..f4a12a80d 100644 --- a/public/javascripts/stream.js +++ b/public/javascripts/stream.js @@ -14,8 +14,11 @@ var Stream = { /* In field labels */ $("label").inFieldLabels(); // publisher textarea reset - $publisher.find("textarea").bind("blur", function() { - $(this).css('height','42px'); + $publisher.find("textarea").bind("focus", function() { + $(this).css('min-height','42px'); + }); + $publisher.find("form").bind("blur", function() { + $("#publisher textarea").css('min-height','2px'); }); // comment link form focus diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index b9a48e753..11a730d22 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -762,16 +762,17 @@ label :top 1px :top 0 - :background - :color rgb(248,248,248) - :border :bottom 2px #777 solid - :top 1px #777 solid &.closed - .content_creation + .options_and_submit + :display none !important + #file-upload :display none + form + textarea + :height 18px !important form :position relative @@ -791,8 +792,11 @@ label textarea :width 435px :margin 0 + textarea + :border 1px solid $blue :height 42px + label :font :size 14px @@ -801,7 +805,7 @@ label :min-height 21px :position relative :padding - :top 8px + :top 6px :margin :bottom -2px input[type='submit'] @@ -826,20 +830,21 @@ label #click_to_share :position relative :padding 1em + :top 0 :margin - :bottom -1em + :bottom -16px - a + span :margin - :left 1em + :left 12px :font :weight bold - :text-shadow 0 1px 0 #fff + :color #444 img :display inline :position absolute - :top 1em + :top 0 :left 0px #file-upload