diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index b15a447c2..d10318101 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -34,7 +34,9 @@ class StatusMessagesController < ApplicationController @aspects = current_user.aspects @selected_contacts = @aspects.map { |aspect| aspect.contacts }.flatten.uniq @aspect_ids = @aspects.map{|x| x.id} - render :layout => nil + if ! is_mobile_device? + render :layout => nil + end end def create diff --git a/app/models/status_message.rb b/app/models/status_message.rb index 1834c56e5..50fd79ea7 100644 --- a/app/models/status_message.rb +++ b/app/models/status_message.rb @@ -14,7 +14,7 @@ class StatusMessage < Post acts_as_taggable_on :tags extract_tags_from :raw_message - validates_length_of :text, :maximum => 10000, :message => I18n.t('status_messages.too_long', :count => 10000) + validates_length_of :text, :maximum => 65535, :message => I18n.t('status_messages.too_long', :count => 65535) xml_name :status_message xml_attr :raw_message diff --git a/app/views/shared/_publisher.html.haml b/app/views/shared/_publisher.html.haml index dd9403586..35f1e63f4 100644 --- a/app/views/shared/_publisher.html.haml +++ b/app/views/shared/_publisher.html.haml @@ -17,7 +17,7 @@ -if publisher_explain :javascript - $(document).ready(function() + $(document).ready(function() { Publisher.triggerGettingStarted(); }); @@ -54,7 +54,6 @@ = image_tag "social_media_logos/#{service.provider}-16x16.png", :title => service.provider.titleize, :class => "service_icon dim", :id =>"#{service.provider}", :maxchar => "#{service.class::MAX_CHARACTERS}" = link_to (image_tag "icons/monotone_wrench_settings.png"), "#question_mark_pane", :class => 'question_mark', :rel => 'facebox', :title => t('shared.public_explain.manage') - // NOTE(dropdown special casing to DRY up -- taken from the aspect_dropdown partial) .dropdown{:class => "hang_right", :title => popover_with_close_html("2. #{t('shared.public_explain.control_your_audience')}"), 'data-content'=> t('shared.public_explain.visibility_dropdown')} .button.toggle.publisher - if publisher_public diff --git a/app/views/shared/_right_sections.html.haml b/app/views/shared/_right_sections.html.haml index 9aebcb4ea..8a13aaa16 100644 --- a/app/views/shared/_right_sections.html.haml +++ b/app/views/shared/_right_sections.html.haml @@ -27,7 +27,7 @@ %h5 = t('aspects.index.new_here.title') .content - != t('aspects.index.new_here.follow', :link => link_to('#NewHere', tag_path(:name => "NewHere"))) + != t('aspects.index.new_here.follow', :link => link_to("#"+t('shared.publisher.new_user_prefill.newhere'), tag_path(:name => "NewHere"))) %br = link_to(t('aspects.index.new_here.learn_more'), "https://github.com/diaspora/diaspora/wiki/Welcoming-Committee") diff --git a/app/views/status_messages/bookmarklet.mobile.haml b/app/views/status_messages/bookmarklet.mobile.haml new file mode 100644 index 000000000..7a3bae975 --- /dev/null +++ b/app/views/status_messages/bookmarklet.mobile.haml @@ -0,0 +1,20 @@ +-# Copyright (c) 2010-2011, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + += include_javascripts :mobile + +:javascript + $(document).ready(function() + { + var contents = "#{params[:title]} - #{params[:url]}"; + if ("#{params[:notes]}".length > 0){ + contents = contents + " - #{params[:notes]}"; + } + if (contents.length > 0) { + $("#status_message_text").val(contents); + } + }); + += render :partial => 'shared/publisher', :locals => { :aspect => :profile, :selected_aspects => @aspects, :aspect_ids => @aspect_ids } + diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index aeb501334..91889a651 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -760,6 +760,7 @@ en: publishing_to: "publishing to: " discard_post: "Discard post" new_user_prefill: + newhere: "NewHere" hello: "Hey everyone, I'm #%{new_user_tag}. " i_like: "I'm interested in %{tags}. " invited_by: "Thanks for the invite, " diff --git a/lib/stream/multi.rb b/lib/stream/multi.rb index 675d0389a..b4963306a 100644 --- a/lib/stream/multi.rb +++ b/lib/stream/multi.rb @@ -49,7 +49,7 @@ class Stream::Multi < Stream::Base # # @return [String] def publisher_prefill - prefill = I18n.t("shared.publisher.new_user_prefill.hello", :new_user_tag => "NewHere") + prefill = I18n.t("shared.publisher.new_user_prefill.hello", :new_user_tag => I18n.t('shared.publisher.new_user_prefill.newhere')) if self.user.followed_tags.size > 0 tag_string = self.user.followed_tags.map{|t| "##{t.name}"}.to_sentence prefill << I18n.t("shared.publisher.new_user_prefill.i_like", :tags => tag_string) diff --git a/spec/models/status_message_spec.rb b/spec/models/status_message_spec.rb index 6773e69c6..5a0319bf3 100644 --- a/spec/models/status_message_spec.rb +++ b/spec/models/status_message_spec.rb @@ -116,9 +116,9 @@ describe StatusMessage do db_status.text.should == message end - it 'should require status messages to be less than 10000 characters' do + it 'should require status messages to be less than 65535 characters' do message = '' - 10001.times{message = message +'1'} + 65535.times{message = message +'1'} status = Factory.build(:status_message, :text => message) status.should_not be_valid