Merge branch 'master' into aspect_nav_rework

This commit is contained in:
Gonzalo Rodriguez 2011-09-28 19:52:15 -03:00
commit 74d00d7db4
60 changed files with 1705 additions and 649 deletions

View file

@ -17,7 +17,7 @@ class AspectsController < ApplicationController
def index
aspect_ids = (params[:a_ids] ? params[:a_ids] : [])
@stream = AspectStream.new(current_user, aspect_ids,
:order => session[:sort_order],
:order => sort_order,
:max_time => params[:max_time].to_i)
if params[:only_posts]
@ -148,4 +148,8 @@ class AspectsController < ApplicationController
end
end
def sort_order
is_mobile_device? ? 'created_at' : session[:sort_order]
end
end

View file

@ -6,7 +6,7 @@ class CommentsController < ApplicationController
include ApplicationHelper
before_filter :authenticate_user!
respond_to :html, :mobile, :only => [:create, :destroy]
respond_to :html, :mobile, :except => :show
respond_to :js, :only => [:index]
rescue_from ActiveRecord::RecordNotFound do
@ -28,7 +28,7 @@ class CommentsController < ApplicationController
respond_to do |format|
format.js{ render(:create, :status => 201)}
format.html{ render :nothing => true, :status => 201 }
format.mobile{ redirect_to post_url(@comment.post) }
format.mobile{ render :partial => 'comment', :locals => {:post => @comment.post, :comment => @comment} }
end
else
render :nothing => true, :status => 422
@ -64,4 +64,7 @@ class CommentsController < ApplicationController
end
end
def new
render :layout => false
end
end

View file

@ -21,6 +21,7 @@ class LikesController < ApplicationController
format.js { render 'likes/update', :status => 201 }
format.html { render :nothing => true, :status => 201 }
format.mobile { redirect_to post_path(@like.post_id) }
format.json { render :nothing => true, :status => 201 }
end
else
render :nothing => true, :status => 422
@ -34,13 +35,15 @@ class LikesController < ApplicationController
if @like = Like.where(:id => params[:id], :author_id => current_user.person.id).first
current_user.retract(@like)
respond_to do |format|
format.all { }
format.any { }
format.js { render 'likes/update' }
format.json { render :nothing => true, :status => :ok}
end
else
respond_to do |format|
format.mobile { redirect_to :back }
format.js { render :nothing => true, :status => 403 }
format.json { render :nothing => true, :status => 403}
end
end
end

View file

@ -27,6 +27,10 @@ class PostsController < ApplicationController
notification.save
end
if is_mobile_device?
@comments = @post.comments
end
respond_to do |format|
format.xml{ render :xml => @post.to_diaspora_xml }
format.mobile{render 'posts/show.mobile.haml'}

View file

@ -9,20 +9,22 @@ class StatusMessagesController < ApplicationController
respond_to :mobile
# Called when a user clicks "Mention" on a profile page
# @option [Integer] person_id The id of the person to be mentioned
# @param person_id [Integer] The id of the person to be mentioned
def new
@person = Person.find(params[:person_id])
@aspect = :profile
@contact = current_user.contact_for(@person)
@aspects_with_person = []
if @contact
@aspects_with_person = @contact.aspects
@aspect_ids = @aspects_with_person.map(&:id)
@contacts_of_contact = @contact.contacts
render :layout => nil
if params[:person_id] && @person = Person.where(params[:person_id]).first
@aspect = :profile
@contact = current_user.contact_for(@person)
@aspects_with_person = []
if @contact
@aspects_with_person = @contact.aspects
@aspect_ids = @aspects_with_person.map(&:id)
@contacts_of_contact = @contact.contacts
render :layout => nil
end
else
redirect_to :back
@aspect = :all
@aspects = current_user.aspects
@aspect_ids = @aspects.map{ |a| a.id }
end
end
@ -30,6 +32,9 @@ class StatusMessagesController < ApplicationController
@aspects = current_user.aspects
@selected_contacts = @aspects.map { |aspect| aspect.contacts }.flatten.uniq
@aspect_ids = @aspects.map{|x| x.id}
pp @aspect_ids.inspect
render :layout => nil
end
@ -48,7 +53,14 @@ class StatusMessagesController < ApplicationController
if @status_message.save
Rails.logger.info("event=create type=status_message chars=#{params[:status_message][:text].length}")
aspects = current_user.aspects_from_ids(params[:aspect_ids])
# always send to all aspects if public
if params[:status_message][:public] || params[:status_message][:aspect_ids].first == "all_aspects"
aspect_ids = current_user.aspects.map{|a| a.id}
else
aspect_ids = params[:aspect_ids]
end
aspects = current_user.aspects_from_ids(aspect_ids)
current_user.add_to_streams(@status_message, aspects)
receiving_services = current_user.services.where(:type => params[:services].map{|s| "Services::"+s.titleize}) if params[:services]
current_user.dispatch_post(@status_message, :url => short_post_url(@status_message.guid), :services => receiving_services)
@ -78,7 +90,8 @@ class StatusMessagesController < ApplicationController
end
def normalize_public_flag!
public_flag = params[:status_message][:public]
# mobile || desktop conditions
public_flag = params[:status_message][:aspect_ids].first == 'public' || params[:status_message][:public]
public_flag.to_s.match(/(true)|(on)/) ? public_flag = true : public_flag = false
params[:status_message][:public] = public_flag
public_flag

View file

@ -3,7 +3,7 @@
# the COPYRIGHT file.
module StreamHelper
def next_page_path
def next_page_path(opts ={})
if controller.instance_of?(TagsController)
tag_path(@tag, :max_time => @posts.last.created_at.to_i)
elsif controller.instance_of?(AppsController)
@ -13,7 +13,13 @@ module StreamHelper
elsif controller.instance_of?(TagFollowingsController)
tag_followings_path(:max_time => @stream.posts.last.created_at.to_i)
elsif controller.instance_of?(AspectsController)
aspects_path(:max_time => @stream.posts.last.send(@stream.order.to_sym).to_i, :a_ids => @stream.aspect_ids)
if opts[:ajax_stream]
time = (Time.now() + 1).to_i
else
time = @stream.posts.last.send(@stream.order.to_sym).to_i
end
aspects_path(:max_time => time, :a_ids => @stream.aspect_ids)
else
raise 'in order to use pagination for this new controller, update next_page_path in stream helper'
end

View file

@ -23,7 +23,11 @@
= render 'aspects/no_contacts_message'
#main_stream.stream{:data => {:guids => stream.aspect_ids.join(',')}}
- if stream.posts.length > 0
- if defined?(no_posts) && no_posts
#pagination
=link_to(t('more'), next_page_path(:ajax_stream => true), :class => 'paginate')
- elsif stream.posts.length > 0
= render 'shared/stream', :posts => stream.posts
#pagination
=link_to(t('more'), next_page_path, :class => 'paginate')

View file

@ -26,7 +26,7 @@
.span-13.append-1
#aspect_stream_container.stream_container
= render 'aspects/aspect_stream', :stream => @stream
= render 'aspects/aspect_stream', :stream => @stream, :no_posts => true
.span-5.rightBar.last
= render 'aspects/selected_contacts', :stream => @stream

View file

@ -2,19 +2,17 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
#aspect_header
%h2{:style => "padding:0 10px;display:none;"}
- if @stream.for_all_aspects?
= t('all_aspects')
- else
= @stream.aspect
= link_to t('.post_a_message'), '#publisher_page', :id => 'publisher_button'
#main_stream.stream
= render 'shared/stream', :posts => @stream.posts
-if @stream.posts.length > 0
#pagination
%a.more-link.paginate{:href => next_page_path}
%h2= t("more")
- content_for :subpages do
= render 'shared/publisher', :aspect_ids => @stream.aspect_ids, :selected_aspects => @stream.aspects, :aspect => @stream.aspect
%h1
= t("more")

View file

@ -3,17 +3,14 @@
-# the COPYRIGHT file.
%li.comment{:data=>{:guid=>comment.id}, :class => ("hidden" if(defined? hidden))}
.right
%span.time
= comment.created_at ? time_ago_in_words(comment.created_at) : time_ago_in_words(Time.now)
-#.controls
-#= link_to image_tag('deletelabel.png'), comment, :confirm => t('are_you_sure'), :method => :delete, :class => "delete comment_delete", :title => t('delete')
= person_image_link(comment.author)
.content
.from
= person_image_link(comment.author)
= person_link(comment.author)
%div{ :class => direction_for(comment.text) }
.info
%span.time.timeago{:datetime => comment.created_at}
= comment.created_at ? time_ago_in_words(comment.created_at) : time_ago_in_words(Time.now)
%div{:class => direction_for(comment.text)}
= markdownify(comment, :youtube_maps => comment[:youtube_titles])

View file

@ -2,10 +2,11 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
= form_tag( post_comments_path(post_id), :id => "new_comment_on_#{post_id}", :class => 'new_comment') do
= form_tag( post_comments_path(post_id), :id => "new_comment_on_#{post_id}", :class => 'new_comment', :autocomplete => "off") do
= hidden_field_tag :post_id, post_id, :id => "post_id_on_#{post_id}"
= text_area_tag :text, nil, :rows => 2, :class => "comment_box",:id => "comment_text_on_#{post_id}"
= text_area_tag :text, nil, :class => "comment_box",:id => "comment_text_on_#{post_id}", :placeholder => t('.comment'), :autofocus => true
%div{:data => {:inline => 'true'}, :style => 'text-align:right;'}
= submit_tag t('.comment'), :id => "comment_submit_#{post_id}", :disable_with => t('.commenting'), "data-role" => 'button', 'data-theme' => 'b', 'data-inline' => true
.actions
= link_to "Cancel", post_path(post_id), :class => "cancel_new_comment btn"
= submit_tag t('.comment'), :id => "comment_submit_#{post_id}", :disable_with => t('.commenting'), :class => "action"

View file

@ -0,0 +1,14 @@
.comment_container
.post_stats
%span.comment_count
= @post.comments.size
%span.like_count
= @post.likes.size
%ul.comments
= render :partial => 'comments/comment', :collection => @comments, :locals => {:post => @post}
%li.comment.add_comment_bottom_link_container
= link_to "#", :class => "show_comments bottom_collapse active" do
= image_tag 'icons/arrow_up_small.png'
= link_to "Add a comment", new_post_comment_path(@post), :class => 'add_comment_bottom_link btn comment_action inactive'

View file

@ -0,0 +1 @@
= new_comment_form(params[:post_id], current_user)

View file

@ -8,105 +8,76 @@
%title
DIASPORA*
%meta{:name => "description", :content => "Diaspora* Mobile"}
%meta{:name => "author", :content => "Diaspora, Inc."}
%meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
= include_javascripts :mobile
%meta{'name' =>'viewport', 'content' => "width=device-width, minimum-scale=1, maximum-scale=1"}
/ Viewport scale
%meta{:name =>'viewport', :content => "width=device-width, minimum-scale=1 maximum-scale=1"}
%meta{:name => "HandheldFriendly", :content => "True"}
%meta{:name => "MobileOptimized", :content => "320"}
/ Force cleartype on WP7
%meta{'http-equiv' => "cleartype", :content => 'on'}
-if current_user
:javascript
Diaspora.I18n.loadLocale(#{get_javascript_strings_for(current_user.language).to_json}, "#{current_user.language}");
/ Home screen icon (sized for retina displays)
%link{:rel => 'apple-touch-icon', :href => '/apple-touch-icon.png'}
/ For Nokia devices
%link{:rel => 'shortcut icon', :href => '/apple-touch-icon.png'}
/ iOS mobile web app indicator
%meta{:name => "apple-mobile-web-app-capable", :content => "yes"}
%link{:rel => "apple-touch-startup-image", :href => "/images/apple-splash.png"}
/ Stylesheets
= include_stylesheets :mobile
= yield(:custom_css)
%script{:src => "/javascripts/vendor/mbp-modernizr-custom.js"}
/ Media Queries Polyfill https://github.com/shichuan/mobile-html5-boilerplate/wiki/Media-Queries-Polyfill
:javascript
Modernizr.mq('(min-width:0)') || document.write('<script src="javascripts/vendor/mbp-respond.min.js">\x3C/script>')
=include_stylesheets :mobile
= csrf_meta_tag
- if rtl?
= include_stylesheets :rtl, :media => 'all'
= yield(:head)
%body
%header
= link_to(image_tag('white@2x.png', :height => 20, :width => 127, :id => 'header_title'), aspects_path)
- if user_signed_in?
- if yield(:header_action).present?
= yield(:header_action)
- else
= link_to(image_tag('icons/compose_mobile2.png', :height => 28, :width => 28), new_status_message_path, :class => 'compose_icon')
#main{:role => "main"}
= yield
- if user_signed_in?
= render :partial =>'shared/footer'
/ javascripts at the bottom
= include_javascripts :mobile
:javascript
MBP.hideUrlBar();
-if AppConfig[:google_a_site]
:javascript
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '#{AppConfig[:google_a_site]}']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
var _gaq=[["_setAccount","#{AppConfig[:google_a_site]}"],["_trackPageview"]];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;
g.src=("https:"==location.protocol?"//ssl":"//www")+".google-analytics.com/ga.js";
s.parentNode.insertBefore(g,s)}(document,"script"));
-if AppConfig[:piwik_id]
:javascript
var pkBaseURL = (("https:" == document.location.protocol) ? "https://#{AppConfig[:piwik_url]}/" : "http://#{AppConfig[:piwik_url]}/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
:javascript
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", #{AppConfig[:piwik_id]});
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
%body
#content{:data => {:role => 'page', :theme => 'c'}}
#header
- if current_user
.right
= link_to(image_tag('icons/list_white.png'), '#menu', :id => "menu_button")
= link_to(image_tag('icons/search_white.png'), people_path)
= link_to(image_tag('white@2x.png', :height => 22, :width => 136, :id => 'header_title'), aspects_path)
%p
- flash.each do |name, msg|
= content_tag :div, msg, :id => "flash_#{name}"
= yield
= render :partial =>'shared/footer' if user_signed_in?
-if current_user
#menu{:data => {:role => 'page', :theme => 'c'}}
#header
.right
= link_to(image_tag('icons/search_white.png'), people_path)
= link_to(image_tag('white.png'), aspects_path)
#content{:data => {:role => 'content'}}
%h2
= current_user.name
%ul{:data => {:role => 'listview', :inset => 'true'}}
%li
= link_to t('notifications.index.notifications'), notifications_path
.ui-li-count
= @notification_count
%li
= link_to t('conversations.index.message_inbox'), conversations_path
.ui-li-count
= @unread_message_count
- if AppConfig[:open_invitations]
%h4
= t('shared.invitations.invite_your_friends')
%ul{:data => {:role => 'listview', :inset => 'true'}}
%li
= link_to t('.by_email'), new_user_invitation_path
%h4
= t('.your_aspects')
%ul{:data => {:role => 'listview', :inset => 'true'}}
%li
= link_to t('all_aspects'), aspects_path
- for aspect in all_aspects
%li
= link_to aspect, aspects_path('a_ids[]' => aspect.id)
= render :partial =>'shared/footer'
= yield :subpages

View file

@ -8,12 +8,8 @@
#author_info.profile
= person_image_tag @person, :thumb_medium
.content
%h3
= @person.name
.description
= @person.diaspora_handle
%h2
= @person.name
- if user_signed_in? && !(@contact.persisted? || current_user.person == @person)
- if @incoming_request

View file

@ -2,30 +2,7 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
#show_content{:data=>{:guid=>@post.id}}
= render 'shared/author_info', :person => @post.author, :post => @post
- if @post.activity_streams?
= image_tag @post.image_url
- elsif reshare?(@post)
= render 'reshares/reshare', :reshare => @post, :post => @post.root
- else
%p
= markdownify(@post, :youtube_maps => @post[:youtube_titles])
- for photo in @post.photos
= link_to (image_tag photo.url(:thumb_small), :class => 'thumb_small'), photo.url(:thumb_medium)
.info
%span.time
= t('ago', :time => time_ago_in_words(@post.created_at))
%br
- if user_signed_in?
- if current_user.owns? @post
= link_to t('delete'), post_path(@post), :confirm => t('are_you_sure'), :method => :delete
- else
= link_to t('hide'), post_visibility_path(:id => "42", :post_id => @post.id), :confirm => t('are_you_sure'), :method => :put, :remote => true
.stream.show{:data=>{:guid=>@post.id}}
= render "comments/comments", :post => @post, :comments => @post.comments, :comments_expanded => true
.stream
= render :partial => 'shared/stream_element',
:locals => {:post => @post, :commenting_disabled => defined?(@commenting_disabled),
:expanded_info => true}

View file

@ -2,22 +2,41 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
.reshare
- if post
.photo_area
- if post.is_a?(StatusMessage)
-if post.photos.size > 0
.photo_attachments
- if post.photos.size > 1
.additional_photo_count
= "+ #{post.photos.size-1}"
= image_tag post.photos.first.url(:thumb_large), :class => "stream-photo big-stream-photo"
- elsif post.activity_streams?
= image_tag post.image_url
.content
.from
= person_link(post.author, :class => "hovercardable")
= person_image_link(post.author, :size => :thumb_small)
= person_link(post.author)
.info
%span.time{:integer => post.created_at.to_i}
= t('ago', :time => time_ago_in_words(post.created_at))
%span.via
- if post.activity_streams?
= t('shared.stream_element.via', :link => link_to("#{post.provider_display_name}", post.actor_url)).html_safe
&ndash;
%span.scope_scope
- if post.public?
= t('public')
- else
= t('limited')
- if post.activity_streams?
= link_to image_tag(post.image_url, 'data-small-photo' => post.image_url, 'data-full-photo' => post.image_url, :class => 'stream-photo'), post.object_url, :class => "stream-photo-link"
- else
- if !post.activity_streams?
= render 'status_messages/status_message', :post => post, :photos => post.photos
- if defined?(current_user) && current_user && (post.author_id != current_user.person.id) && (post.public?) && !reshare?(post)
.reshare_action
= reshare_link(post)
= link_to t(".show_original"), post_path(post)
- else
= t('.deleted')
.reshare_via
%span
= t('.reshared_via')

View file

@ -2,20 +2,27 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
#login_form
= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
%div{:data => {:role => 'fieldcontain'}}
= f.label :username , t('username')
= f.text_field :username
%p.user_network
="@#{AppConfig[:pod_uri].host}"
= f.label :password , t('password')
= f.password_field :password
= f.submit t('devise.sessions.new.sign_in')
- if devise_mapping.rememberable?
= f.check_box :remember_me
= f.label :remember_me, t('devise.sessions.new.remember_me')
.stream
#login_form
.login-container
%h2
Log in
= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
.row
.row
= f.label :username, t('username')
.centered
= f.text_field :username
.row
.row
= f.label :password , t('password')
.centered
= f.password_field :password
.row
= f.submit t('devise.sessions.new.sign_in'), :class => 'login-submit'
- if devise_mapping.recoverable? && controller_name != 'passwords'
= link_to "Forgot password?", new_password_path(resource_name)
%p
= render :partial => "devise/shared/links"
%footer
- if !AppConfig[:registrations_closed] && devise_mapping.registerable? && controller_name != 'registrations'
= link_to t('.sign_up'), new_registration_path(resource_name)

View file

@ -1,12 +1,5 @@
#footer{:data => {:role => 'footer'}}
.inset
%b= t('.your_aspects')
%div{:data => {:role => 'controlgroup', :type => 'horizontal'}}
- for aspect in all_aspects
= link_to aspect, aspects_path('a_ids[]' => aspect.id)
|
.ui-bar
= link_to t('.logged_in_as', :name => current_user.name), current_user.person
= link_to t('layouts.application.toggle'), toggle_mobile_path
= link_to t('layouts.header.logout'), destroy_user_session_path
%footer
%strong
= link_to current_user.name, current_user.person
= link_to t('layouts.application.toggle'), toggle_mobile_path
= link_to t('layouts.header.logout'), destroy_user_session_path

View file

@ -2,52 +2,29 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
:javascript
$(document).ready(function(){
$("#status_message_text").bind("focus", function(){
$("#publisher fieldset:first").removeClass('hidden');
});
});
- content_for :custom_css do
:css
body {
background-color: #eee;
}
#publisher_page{:data => {:role => 'page', :theme => 'c'}}
#header
- if current_user
.left
= link_to(image_tag('icons/list_white.png'), '/aspects/#menu', :id => "menu_button")
- content_for :header_action do
= submit_tag t('.share'), :class => 'action', :id => "submit_new_message"
.right
= link_to(image_tag('icons/search_white.png'), people_path)
= link_to(image_tag('white.png'), aspects_path)
%div{:data => {:role => 'content'}}
= form_for StatusMessage.new, {:data => {:ajax => false}} do |status|
#publisher_text
= t('.whats_on_your_mind')
= form_for StatusMessage.new, {:data => {:ajax => false}} do |status|
#message_container
= status.text_area :text, :placeholder => t('.whats_on_your_mind'), :style => "width:300px", :rows => 4, :autofocus => "autofocus"
= status.text_area :text
%fieldset
%select{:id => "aspect_ids_", :name => "aspect_ids[]", :style => "float:right;"}
%option{:value => 'public'}
= t('public')
- for aspect_id in aspect_ids
= hidden_field_tag 'aspect_ids[]', aspect_id.to_s
%option{:value => 'all_aspects', :selected => true}
= t('all_aspects')
- current_user.aspects.each do |aspect|
%option{:value => aspect.id}
= "· #{aspect.name}"
%fieldset
- unless aspect_ids
%input{:type => 'checkbox', :name => 'status_message[public]', :id => 'public', :class => 'custom', :value => 'true'}
%label{:for => 'public'}
= t('.make_public')
- unless current_user.services.empty?
%div{:data => {:role => 'fieldcontain'}}
%label{:for => 'services', :class => 'select'}
choose services
- current_user.services.each do |service|
%input{:type => 'checkbox', :name => "services[]", :id => "#{service.provider}", :class => 'custom', :value => "#{service.provider}"}
%label{:for => "#{service.provider}"}
= "#{service.provider}"
-#%select{:name => 'services', :multiple => 'multiple', :id => "services"}
-#%option
-#Choose a Service
-#- current_user.services.each do |service|
-#%option{:value => "#{service.provider}"}
-#= service.provider.titleize
= status.submit t('.share'), 'data-theme' => 'c'

View file

@ -2,7 +2,6 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
= render :partial => 'shared/stream_element',
:collection => posts,
:as => :post,

View file

@ -3,27 +3,69 @@
-# the COPYRIGHT file.
.stream_element{:data=>{:guid=>post.id}}
= person_image_link(post.author, :size => :thumb_small)
- if post.is_a?(Reshare)
= render 'reshares/reshare', :reshare => post, :post => post.root
.photo_area
- if post.is_a?(StatusMessage)
-if post.photos.size > 0
.photo_attachments
- if post.photos.size > 1
.additional_photo_count
= "+ #{post.photos.size-1}"
= image_tag post.photos.first.url(:thumb_large), :class => "stream-photo big-stream-photo"
- elsif post.activity_streams?
= image_tag post.image_url
.content
.from
= person_image_link(post.author, :size => :thumb_small)
= person_link(post.author)
.info
%span.time{:integer => post.created_at.to_i}
= t('ago', :time => time_ago_in_words(post.created_at))
&ndash;
%span.scope_scope
- if post.public?
= t('public')
- else
= t('limited')
- if post.activity_streams?
= image_tag post.image_url
- elsif reshare?(post)
= render 'reshares/reshare', :reshare => post, :post => post.root
- else
%span.via
- if post.activity_streams?
= t('.via', :link => link_to("#{post.provider_display_name}", post.actor_url)).html_safe
- if post.is_a?(StatusMessage)
= render 'status_messages/status_message', :post => post, :photos => post.photos
.info
%span.time{:integer => post.created_at.to_i}
= t('ago', :time => time_ago_in_words(post.created_at))
%span.via
- if post.activity_streams?
= t('.via', :link => link_to("#{post.provider_display_name}", post.actor_url)).html_safe
.bottom_bar
.floater
= link_to '', new_post_comment_path(post), :class => "image_link comment_action inactive"
= link_to "#{t('comments', :count => post.comments.length)} →", post_path(post), :class => 'comment_link right'
- if post.activity_streams?
%br
- if current_user.liked?(post)
= link_to '', post_like_path(post.id, current_user.like_for(post).id), :class => "image_link like_action active"
- else
= link_to '', post_likes_path(post.id), :class => "image_link like_action inactive"
- if post.comments.length + post.likes_count > 0
= link_to "#{t('reactions', :count => (post.comments.length + post.likes_count))}", post_comments_path(post, :format => "mobile"), :class => 'show_comments'
- else
%span.show_comments
= "#{t('reactions', :count => (post.comments.length + post.likes_count))}"
- if defined?(expanded_info) && expanded_info
.comment_container
.post_stats
%span.comment_count
= @post.comments.size
%span.like_count
= @post.likes.size
%ul.comments
= render :partial => 'comments/comment', :collection => @comments, :locals => {:post => @post}
%li.comment.add_comment_bottom_link_container
= link_to "Add a comment", new_post_comment_path(@post), :class => 'add_comment_bottom_link btn comment_action inactive'

View file

@ -0,0 +1,19 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- if photos.size > 0
.photo_attachments
.big_stream_photo
= link_to (image_tag photos.first.url(:scaled_full), :class => "stream-photo", 'data-small-photo' => photos.first.url(:thumb_medium), 'data-full-photo' => photos.first.url), photo_path(photos.first), :class => "stream-photo-link"
- if photos.size > 1
- if photos.size >= 8
- for photo in photos[1..8]
= link_to (image_tag photo.url(:thumb_small), :class => 'stream-photo thumb_small', 'data-small-photo' => photo.url(:thumb_medium), 'data-full-photo' => photo.url), photo_path(photo), :class => 'stream-photo-link'
- else
- for photo in photos[1..photos.size]
= link_to (image_tag photo.url(:thumb_small), :class => 'stream-photo thumb_small', 'data-small-photo' => photo.url(:thumb_medium), 'data-full-photo' => photo.url), photo_path(photo), :class => 'stream-photo-link'
%div{:class => direction_for(post.text)}
!= markdownify(post, :youtube_maps => post[:youtube_titles])

View file

@ -0,0 +1,18 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- if defined?(reshare) && reshare
.photo_area
- if post.is_a?(StatusMessage)
-if post.photos.size > 0
.photo_attachments
- if post.photos.size > 1
.additional_photo_count
= "+ #{post.photos.size-1}"
= image_tag post.photos.first.url(:thumb_large), :class => "stream-photo big-stream-photo"
- elsif post.activity_streams?
= image_tag post.image_url
%div{:class => direction_for(post.text)}
!= markdownify(post, :youtube_maps => post[:youtube_titles])

View file

@ -0,0 +1,5 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
= render :partial => 'shared/publisher', :locals => {:aspect => @aspects.first, :for_all_aspects => true, :aspect_ids => @aspect_ids, :selected_aspects => @aspects}

View file

@ -0,0 +1,15 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
%h1
= "##{params[:name]}"
#main_stream.stream
= render 'shared/stream', :posts => @posts
-if @posts.length > 0
#pagination
%a.more-link.paginate{:href => next_page_path}
%h1
= t("more")

View file

@ -42,14 +42,16 @@ javascripts:
login:
- public/javascripts/login.js
mobile:
#- public/javascripts/custom-mobile-scripting.js
#- public/javascripts/vendor/jquery.mobile-1.0b2.min.js
#- public/javascripts/jquery.infinitescroll-custom.js
#- public/javascripts/diaspora.js
#- public/javascripts/helpers/i18n.js
#- public/javascripts/widgets/infinite-scroll.js
- public/javascripts/vendor/jquery162.min.js
- public/javascripts/custom-mobile-scripting.js
- public/javascripts/vendor/jquery.mobile-1.0b2.min.js
- public/javascripts/jquery.infinitescroll-custom.js
- public/javascripts/diaspora.js
- public/javascripts/helpers/i18n.js
- public/javascripts/widgets/infinite-scroll.js
- public/javascripts/rails.js
- public/javascripts/vendor/mbp-helper.js
- public/javascripts/mobile.js
mailchimp:
- public/javascripts/vendor/mailchimp/jquery.form.js
@ -88,6 +90,7 @@ stylesheets:
- public/stylesheets/rtl.css
mobile:
- public/stylesheets/vendor/jquery.mobile-1.0b2.min.css
#- public/stylesheets/vendor/jquery.mobile-1.0b2.min.css
- public/stylesheets/vendor/html5-boilerplate-mobile.css
- public/stylesheets/mobile.css

View file

@ -210,6 +210,14 @@ en:
comment: "Comment"
commenting: "Commenting..."
reactions:
zero: "0 reactions"
one: "1 reaction"
two: "%{count} reactions"
few: "%{count} reactions"
many: "%{count} reactions"
other: "%{count} reactions"
contacts:
zero: "no contacts"
one: "1 contact"
@ -331,7 +339,7 @@ en:
application:
powered_by: "POWERED BY DIASPORA*"
whats_new: "what's new?"
toggle: "toggle mobile site"
toggle: "toggle mobile"
public_feed: "Public Diaspora Feed for %{name}"
your_aspects: "your aspects"
@ -653,6 +661,7 @@ en:
other: "%{count} new requests!"
reshares:
reshare:
reshared_via: "reshared via"
reshare_original: "Reshare original"
reshare:
zero: "Reshare"

View file

@ -16,7 +16,7 @@ Diaspora::Application.routes.draw do
resources :posts, :only => [:show, :destroy] do
resources :likes, :only => [:create, :destroy, :index]
resources :comments, :only => [:create, :destroy, :index]
resources :comments, :only => [:new, :create, :destroy, :index]
end
get 'p/:id' => 'posts#show', :as => 'short_post'

View file

@ -96,7 +96,7 @@ Feature: following and being followed
Given I sign in as "alice@alice.alice"
And I am on "bob@bob.bob"'s page
Then I should see "Add to aspect"
Then I should see "Add contact"
And I should not see "Mention"
And I should not see "Message"

View file

@ -41,7 +41,8 @@ Feature: infinite scroll
Then I should see "No more"
Scenario: on the main stream post created time
When I follow "posted"
When I wait for the ajax to finish
And I follow "posted"
Then I should see 15 posts
And I should see "alice - 15 - #seeded"

View file

@ -17,7 +17,8 @@ module Postzord
end
notify_mentioned_users if @object.respond_to?(:mentions)
socket_to_users if @object.respond_to?(:socket_to_user)
# 09/27/11 this is slow
#socket_to_users if @object.respond_to?(:socket_to_user)
notify_users
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 837 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 455 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 770 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 871 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 871 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View file

@ -3,6 +3,7 @@
* the COPYRIGHT file.
*/
$(document).bind("mobileinit", function() {
$.extend($.mobile, {
ajaxLinksEnabled: false,
@ -12,3 +13,40 @@ $(document).bind("mobileinit", function() {
});
$.mobile.selectmenu.prototype.options.nativeMenu = false;
});
$(document).ready(function(){
$(".like_action.inactive").bind('tap', function(evt){
evt.preventDefault();
var target = $(this),
postId = target.data('post-id');
$.ajax({
url: '/posts/'+postId+'/likes.json',
type: 'POST',
complete: function(data){
target.addClass('inactive')
.removeClass('active')
.data('post-id', postId);
}
});
});
$(".like_action.active").bind('tap', function(evt){
evt.preventDefault();
var target = $(this),
postId = $(this).data('post-id'),
likeId = $(this).data('like-id');
$.ajax({
url: '/posts/'+postId+'/likes/'+likeId+'.json',
type: 'DELETE',
complete: function(data){
target.addClass('inactive')
.removeClass('active')
.data('like-id', '');
}
});
});
});

View file

@ -0,0 +1,198 @@
$(document).ready(function(){
$(".stream").delegate(".like_action.inactive", "tap click", function(evt){
evt.preventDefault();
var link = $(this),
likeCounter = $(this).closest(".stream_element").find("like_count"),
postId = link.closest(".stream_element").data("post-guid");
$.ajax({
url: link.attr("href"),
dataType: 'json',
type: 'POST',
beforeSend: function(){
link.removeClass('inactive')
.addClass('loading');
},
complete: function(data){
link.removeClass('loading')
.removeClass('inactive')
.addClass('active')
.data('post-id', postId);
if(likeCounter){
likeCounter.text(parseInt(likeCounter.text) + 1);
}
}
});
});
$(".stream").delegate(".like_action.active", "tap click", function(evt){
evt.preventDefault();
var link = $(this);
likeCounter = $(this).closest(".stream_element").find("like_count");
$.ajax({
url: link.attr("href"),
dataType: 'json',
type: 'DELETE',
beforeSend: function(){
link.removeClass('active')
.addClass('loading');
},
complete: function(data){
link.removeClass('loading')
.removeClass('active')
.addClass('inactive')
.data('like-id', '');
if(likeCounter){
likeCounter.text(parseInt(likeCounter.text) - 1);
}
}
});
});
$(".stream").delegate(".show_comments", "tap click", function(evt){
evt.preventDefault();
var link = $(this),
parent = link.closest(".bottom_bar").first(),
commentsContainer = function(){ return parent.find(".comment_container").first(); }
existingCommentsContainer = commentsContainer();
if( link.hasClass('active') ) {
existingCommentsContainer.hide();
if(!link.hasClass('bottom_collapse')){
link.removeClass('active');
} else {
parent.find(".show_comments").first().removeClass('active');
}
$('html,body').scrollTop(parent.offset().top - parent.closest(".stream_element").height() - 8);
} else if( existingCommentsContainer.length > 0) {
if(!existingCommentsContainer.hasClass('noComments')) {
$.ajax({
url: link.attr('href'),
success: function(data){
parent.append($(data).find('.comments_container').html());
link.addClass('active');
existingCommentsContainer.show();
scrollToOffset(parent, commentsContainer());
}
});
} else {
existingCommentsContainer.show();
}
link.addClass('active');
} else {
$.ajax({
url: link.attr('href'),
success: function(data){
parent.append(data);
link.addClass('active');
scrollToOffset(parent, commentsContainer());
}
});
}
});
var scrollToOffset = function(parent, commentsContainer){
var commentCount = commentsContainer.find("li.comment").length;
if( commentCount > 3 ) {
var lastComment = commentsContainer.find("li:nth-child("+(commentCount-4)+")");
$('html,body').animate({
scrollTop: lastComment.offset().top
}, 1000);
}
};
$(".stream").delegate("a.comment_action", "tap click", function(evt){
evt.preventDefault();
var link = $(this);
if(link.hasClass('inactive')) {
var parent = link.closest(".bottom_bar").first(),
container = link.closest('.bottom_bar').find('.add_comment_bottom_link_container').first();
$.ajax({
url: link.attr('href'),
beforeSend: function(){
link.addClass('loading');
},
context: link,
success: function(data){
var textarea = function(target) { return target.closest(".stream_element").find('textarea.comment_box').first()[0] };
link.removeClass('loading')
if(!link.hasClass("add_comment_bottom_link")){
link.removeClass('inactive');
}
container.hide();
parent.append(data);
console.log($(this).closest(".stream_element").find('textarea'));
MBP.autogrow(textarea($(this)));
}
});
}
});
$(".stream").delegate("a.cancel_new_comment", "tap click", function(evt){
evt.preventDefault();
var link = $(this);
form = link.closest("form"),
commentActionLink = link.closest(".bottom_bar").find("a.comment_action").first();
container = link.closest('.bottom_bar').find('.add_comment_bottom_link_container');
if(container.length > 0 ){
container.first().show();
}
commentActionLink.addClass("inactive");
form.remove();
});
$(".new_comment").live("submit", function(evt){
evt.preventDefault();
var form = $(this);
$.post(form.attr('action')+"?format=mobile", form.serialize(), function(data){
var bottomBar = form.closest('.bottom_bar').first(),
container = bottomBar.find('.add_comment_bottom_link_container'),
commentActionLink = bottomBar.find("a.comment_action").first();
reactionLink = bottomBar.find(".show_comments").first(),
commentCount = bottomBar.find(".comment_count");
if(container.length > 0) {
container.before(data);
form.remove();
container.show();
} else {
var container = $("<div class='comments_container not_all_present'></div>"),
comments = $("<ul class='comments'></ul>");
comments.html(data);
container.append(comments);
form.remove();
container.appendTo(bottomBar)
}
reactionLink.text(reactionLink.text().replace(/(\d+)/, function(match){ return parseInt(match) + 1; }));
commentCount.text(commentCount.text().replace(/(\d+)/, function(match){ return parseInt(match) + 1; }));
commentActionLink.addClass("inactive");
}, 'html');
});
$("#submit_new_message").bind("tap click", function(evt){
evt.preventDefault();
$("#new_status_message").submit();
});
});

171
public/javascripts/vendor/mbp-helper.js vendored Normal file
View file

@ -0,0 +1,171 @@
/*
* MBP - Mobile boilerplate helper functions
*/
(function(document){
window.MBP = window.MBP || {};
// Fix for iPhone viewport scale bug
// http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/
MBP.viewportmeta = document.querySelector && document.querySelector('meta[name="viewport"]');
MBP.ua = navigator.userAgent;
MBP.scaleFix = function () {
if (MBP.viewportmeta && /iPhone|iPad/.test(MBP.ua) && !/Opera Mini/.test(MBP.ua)) {
MBP.viewportmeta.content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
document.addEventListener("gesturestart", MBP.gestureStart, false);
}
};
MBP.gestureStart = function () {
MBP.viewportmeta.content = "width=device-width, minimum-scale=0.25, maximum-scale=1.6";
};
// Hide URL Bar for iOS and Android by Scott Jehl
// https://gist.github.com/1183357
MBP.hideUrlBar = function () {
var win = window,
doc = win.document;
// If there's a hash, or addEventListener is undefined, stop here
if( !location.hash || !win.addEventListener ){
//scroll to 1
window.scrollTo( 0, 1 );
var scrollTop = 1,
//reset to 0 on bodyready, if needed
bodycheck = setInterval(function(){
if( doc.body ){
clearInterval( bodycheck );
scrollTop = "scrollTop" in doc.body ? doc.body.scrollTop : 1;
win.scrollTo( 0, scrollTop === 1 ? 0 : 1 );
}
}, 15 );
win.addEventListener( "load", function(){
setTimeout(function(){
//reset to hide addr bar at onload
win.scrollTo( 0, scrollTop === 1 ? 0 : 1 );
}, 0);
}, false );
}
};
// Fast Buttons - read wiki below before using
// https://github.com/shichuan/mobile-html5-boilerplate/wiki/JavaScript-Helper
MBP.fastButton = function (element, handler) {
this.element = element;
this.handler = handler;
if (element.addEventListener) {
element.addEventListener('touchstart', this, false);
element.addEventListener('click', this, false);
}
};
MBP.fastButton.prototype.handleEvent = function(event) {
switch (event.type) {
case 'touchstart': this.onTouchStart(event); break;
case 'touchmove': this.onTouchMove(event); break;
case 'touchend': this.onClick(event); break;
case 'click': this.onClick(event); break;
}
};
MBP.fastButton.prototype.onTouchStart = function(event) {
event.stopPropagation();
this.element.addEventListener('touchend', this, false);
document.body.addEventListener('touchmove', this, false);
this.startX = event.touches[0].clientX;
this.startY = event.touches[0].clientY;
this.element.style.backgroundColor = "rgba(0,0,0,.7)";
};
MBP.fastButton.prototype.onTouchMove = function(event) {
if(Math.abs(event.touches[0].clientX - this.startX) > 10 ||
Math.abs(event.touches[0].clientY - this.startY) > 10 ) {
this.reset();
}
};
MBP.fastButton.prototype.onClick = function(event) {
event.stopPropagation();
this.reset();
this.handler(event);
if(event.type == 'touchend') {
MBP.preventGhostClick(this.startX, this.startY);
}
this.element.style.backgroundColor = "";
};
MBP.fastButton.prototype.reset = function() {
this.element.removeEventListener('touchend', this, false);
document.body.removeEventListener('touchmove', this, false);
this.element.style.backgroundColor = "";
};
MBP.preventGhostClick = function (x, y) {
MBP.coords.push(x, y);
window.setTimeout(function (){
MBP.coords.splice(0, 2);
}, 2500);
};
MBP.ghostClickHandler = function (event) {
for(var i = 0, len = MBP.coords.length; i < len; i += 2) {
var x = MBP.coords[i];
var y = MBP.coords[i + 1];
if(Math.abs(event.clientX - x) < 25 && Math.abs(event.clientY - y) < 25) {
event.stopPropagation();
event.preventDefault();
}
}
};
if (document.addEventListener) {
document.addEventListener('click', MBP.ghostClickHandler, true);
}
MBP.coords = [];
// iOS Startup Image
// https://github.com/shichuan/mobile-html5-boilerplate/issues#issue/2
MBP.splash = function () {
var filename = navigator.platform === 'iPad' ? 'h/' : 'l/';
document.write('<link rel="apple-touch-startup-image" href="/img/' + filename + 'splash.png" />' );
};
// Autogrow
// http://googlecode.blogspot.com/2009/07/gmail-for-mobile-html5-series.html
MBP.autogrow = function (element, lh) {
function handler(e){
var newHeight = this.scrollHeight,
currentHeight = this.clientHeight;
if (newHeight > currentHeight) {
this.style.height = newHeight + 3 * textLineHeight + "px";
}
}
var setLineHeight = (lh) ? lh : 12,
textLineHeight = element.currentStyle ? element.currentStyle.lineHeight :
getComputedStyle(element, null).lineHeight;
textLineHeight = (textLineHeight.indexOf("px") == -1) ? setLineHeight :
parseInt(textLineHeight, 10);
element.style.overflow = "hidden";
element.addEventListener ? element.addEventListener('keyup', handler, false) :
element.attachEvent('onkeyup', handler);
};
})(document);

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,7 @@
/*
* respond.js - A small and fast polyfill for min/max-width CSS3 Media Queries
* Copyright 2011, Scott Jehl, scottjehl.com
* Dual licensed under the MIT or GPL Version 2 licenses.
* Usage: Check out the readme file or github.com/scottjehl/respond
*/
(function(e,h){e.respond={};respond.update=function(){};respond.mediaQueriesSupported=h;if(h){return}var u=e.document,r=u.documentElement,i=[],k=[],p=[],o={},g=30,f=u.getElementsByTagName("head")[0]||r,b=f.getElementsByTagName("link"),d=[],a=function(){var B=b,w=B.length;for(var z=0;z<w;z++){var y=B[z],x=y.href,A=y.media,v=y.rel&&y.rel.toLowerCase()==="stylesheet";if(!!x&&v&&!o[x]){if(!/^([a-zA-Z]+?:(\/\/)?(www\.)?)/.test(x)||x.replace(RegExp.$1,"").split("/")[0]===e.location.host){d.push({href:x,media:A})}else{o[x]=true}}}t()},t=function(){if(d.length){var v=d.shift();n(v.href,function(w){m(w,v.href,v.media);o[v.href]=true;t()})}},m=function(G,v,x){var E=G.match(/@media ([^\{]+)\{([\S\s]+?)(?=\}[\s]*\/\*\/mediaquery\*\/)/gmi),H=E&&E.length||0,v=v.substring(0,v.lastIndexOf("/")),w=function(I){return I.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+v+"$2$3")},y=!H&&x;if(v.length){v+="/"}if(y){H=1}for(var B=0;B<H;B++){var C;if(y){C=x;k.push(w(G))}else{C=E[B].match(/@media ([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1;k.push(RegExp.$2&&w(RegExp.$2))}var z=C.split(","),F=z.length;for(var A=0;A<F;A++){var D=z[A];i.push({media:D.match(/(only\s+)?([a-zA-Z]+)(\sand)?/)&&RegExp.$2,rules:k.length-1,minw:D.match(/\(min\-width:[\s]*([\s]*[0-9]+)px[\s]*\)/)&&parseFloat(RegExp.$1),maxw:D.match(/\(max\-width:[\s]*([\s]*[0-9]+)px[\s]*\)/)&&parseFloat(RegExp.$1)})}}j()},l,q,j=function(E){var v="clientWidth",x=r[v],D=u.compatMode==="CSS1Compat"&&x||u.body[v]||x,z={},C=u.createDocumentFragment(),B=b[b.length-1],w=(new Date()).getTime();if(E&&l&&w-l<g){clearTimeout(q);q=setTimeout(j,g);return}else{l=w}for(var y in i){var F=i[y];if(!F.minw&&!F.maxw||(!F.minw||F.minw&&D>=F.minw)&&(!F.maxw||F.maxw&&D<=F.maxw)){if(!z[F.media]){z[F.media]=[]}z[F.media].push(k[F.rules])}}for(var y in p){if(p[y]&&p[y].parentNode===f){f.removeChild(p[y])}}for(var y in z){var G=u.createElement("style"),A=z[y].join("\n");G.type="text/css";G.media=y;if(G.styleSheet){G.styleSheet.cssText=A}else{G.appendChild(u.createTextNode(A))}C.appendChild(G);p.push(G)}f.insertBefore(C,B.nextSibling)},n=function(v,x){var w=c();if(!w){return}w.open("GET",v,true);w.onreadystatechange=function(){if(w.readyState!=4||w.status!=200&&w.status!=304){return}x(w.responseText)};if(w.readyState==4){return}w.send()},c=(function(){var v=false,w=[function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new XMLHttpRequest()}],y=w.length;while(y--){try{v=w[y]()}catch(x){continue}break}return function(){return v}})();a();respond.update=a;function s(){j(true)}if(e.addEventListener){e.addEventListener("resize",s,false)}else{if(e.attachEvent){e.attachEvent("onresize",s)}}})(this,(function(f){if(f.matchMedia){return true}var e,i=document,c=i.documentElement,g=c.firstElementChild||c.firstChild,h=!i.body,d=i.body||i.createElement("body"),b=i.createElement("div"),a="only all";b.id="mq-test-1";b.style.cssText="position:absolute;top:-99em";d.appendChild(b);b.innerHTML='_<style media="'+a+'"> #mq-test-1 { width: 9px; }</style>';if(h){c.insertBefore(d,g)}b.removeChild(b.firstChild);e=b.offsetWidth==9;if(h){c.removeChild(d)}else{d.removeChild(b)}return e})(this));

View file

@ -19,6 +19,12 @@
var newPath = pathStr.replace("?", "?only_posts=true&"),
lastTime = $('#main_stream .stream_element').last().find(".time").attr("integer");
if(lastTime === undefined){
var currentTime = new Date,
unixtimeMs = currentTime.getTime(),
lastTime = parseInt(unixtimeMs / 1000);
}
return newPath.replace(/max_time=\d+/, "max_time=" + lastTime);
}
};

View file

@ -1,368 +0,0 @@
// Copyright (c) 2010-2011, Diaspora Inc. This file is
// licensed under the Affero General Public License version 3 or later. See
// the COPYRIGHT file.
@import "mixins"
$blue: #3F8FBA
a:not([role='button']):not(.arrow)
:text
:decoration none
:font
:weight normal !important
:-webkit-tap-highlight-color rgba(200, 200, 200, 1) !important
a.ui-link-inherit
:font
:weight bold !important
:color #000 !important
.ui-body-c a
:color #2489CE
#landing_content
:text-align center
.info_pane
:text-align left
#login_form
:padding 15px
:padding-top 0px
#diaspora_description
:background
:image url('../images/ball_small.png')
:repeat no-repeat
:position top center
:padding
:top 195px
:margin
:top -18px
:font
:size 1.3em
:weight bold
:text-shadow 0 1px 3px #999
:line-height 1.5
p
:padding 12px
:background
:color #fff
:-webkit-box-shadow 0 1px 3px #ccc
:-moz-box-shadow 0 1px 3px #ccc
:box-shadow 0 1px 3px #ccc
.tapped
:background
:color rgba(100, 103, 103, .2)
:border-radius 5px
a
:padding 2px
.alpha-warning
@include mobile-box
.login_form
@include mobile-box
:padding 10px
label
:font-weight bold
.message
:padding
:left 2px
.stream_element,
.comment
:overflow auto
:position relative
:background
:color #fff
*
:max-width 100%
:min-height 34px
.avatar
:float left
:height 48px
:width 48px
.from
a
:margin
:left -2px
:color #000 !important
:font
:weight bold !important
:margin-bottom 2px
.content
:padding
:left 58px
:border
:bottom 1px solid #eee
:padding 10px
.info
:margin
:top 0.5em
:font
:size smaller
.photo_attachments
:margin
:top 6px
.time
:font
:weight normal
p
:margin 0 auto
:line-height 1.4em
.black
:color #333
.reshare
.content
:padding
:left 15px
:top 10px
.from
:font
:style italic
.reshare_action
:font
:size 0.8em
.comment
:padding
:top 12px
:bottom 12px
#main_stream
:font
:size 0.95em
.stream_element.person
.from
:font
:size larger
.more-link
:line-height 4em
:text-align center
.time, .via
:color #ccc
:font
:size smaller
:weight bold
a
:color #ccc
.info
:font
:size smaller
#show_content
:padding 12px
:bottom 24px
:border
:bottom 1px solid #bbb
:background
:color #fff
:font
:size larger
img
:max-width 100%
.photo
:text-align center
.controls
:font
:size smaller
&.photo
:background
:color #000
#photo_controls
:margin
:bottom -42px
.arrow
:color white !important
:font
:size 26pt
:text
:shadow 0 1px 2px #333
:decoration none
:padding 0
ul
:margin 0
:padding 0
:list
:style none
#author_info.show
:margin
:bottom 24px
a
:color #000
:font
:weight bold !important
img
:float left
:height 36px
:width 36px
:margin
:right 6px
:font
:size smaller
.diaspora_handle
:font
:size 14px
:color #999
#author_info.profile
:background
:color #eee
:border
:bottom 2px solid #ccc
:height 90px
:padding 6px
:margin
:bottom 6px
img
:float left
:height 90px
:width 90px
.content
:padding
:left 100px
.description
:font
:weight normal
:size small
:color #999
.comments
:border
:top 2px solid #D2DBE1
:background
:color #EDF5FB
:font
:size smaller
.comment
:background
:color #EDF5FB
.stream_marker
:background
:color #eee
:border
:bottom 1px solid #aaa
:top 1px solid #ccc
:font
:weight bold
:size smaller
:color #666
:padding 3px 6px
.right
:float right
.hidden
:display none
.grey_back
:background
:color #eee
:border
:bottom 1px solid #999
:padding 8px
:top 3px
:margin
:bottom 12px
#publisher
:text
:align center
#publisher_text
:text
:align left
:font
:weight bold
:margin
:bottom 3px
#aspect_title
:padding 0 6px
:bottom 6px
:font
:weight bold
:text
:align left
#header
@include linear-gradient(#222, #000)
:padding 11px 5px
:bottom 7px
:border
:bottom 1px solid #444
.right
:position absolute
:top 0px
:padding 6px
:top 4px
:right 0
#footer
:background
:color #ccc
.inset
:padding 10px
.notification_day_header
:padding 6px
:background
:color #eee
:border
:top 1px solid #ddd
:bottom 1px solid #ccc
:font
:weight bold
:color #666
#aspect_header
:padding 4px 7px
:bottom 7px
:font
:weight bold
:text
:shadow none
:background
:color #eee
:color #999

View file

@ -0,0 +1,581 @@
// Copyright (c) 2010-2011, Diaspora Inc. This file is
// licensed under the Affero General Public License version 3 or later. See
// the COPYRIGHT file.
@import "mixins";
$blue: #3f8fba;
a {
color: #2489ce;
text: {
decoration: none; };
}
body {
background: #555555;
max-width: 100%;
margin-top: 55px;
}
.message {
padding: {
left: 2px; };
}
#main {
text-align: center;
}
.stream {
text-align: left;
max-width: 700px;
}
.stream_element,
.comments {
overflow: auto;
position: relative;
* {
max-width: 100%; }
min-height: 34px;
.avatar {
float: left;
height: 35px;
width: 35px;
margin: {
right: 10px; }; }
.from {
a {
margin: {
left: -2px; };
color: #aaaaaa !important;
font: {
weight: bold !important; }; }
margin-bottom: 2px;
height: 45px; }
> .content,
.reshare > .content {
padding: 10px {
bottom: 0; }; }
padding: 10px 0;
.info {
margin: {
top: 0; }; }
.photo_attachments {
margin: {
top: 6px; }; }
.time {
font: {
weight: normal; }; }
p {
margin: 0 auto;
font-size: 14px;
line-height: 19px; }
margin: 10px {
top: 10px;
bottom: 0; };
padding: 0 !important; }
.new_comment {
padding: 10px;
}
.stream_element .comments {
padding: 0;
margin: 0;
top: 8px;
width: 100%;
.content {
padding: 0;
}
.comment {
padding: {
top: 10px;
bottom: 5px;
}
}
}
.comment {
border: {
top: 1px solid #ccc; };
}
#login_form {
@include border-radius(3px);
@include box-shadow(0, 1px, 5px, rgba(0, 0, 0, 1));
padding: 0;
padding-bottom: 10px;
background: {
color: #fff;
}
margin: auto 20px;
.login-container {
padding: 10px;
}
.row {
margin-bottom: 10px;
.login-submit {
float: right;
}
}
.centered{
text-align: center;
}
label {
color: #ccc;
font-size: larger;
font-weight: bold;
}
input[type='text'],
input[type='password'] {
font-size: 18px;
font-weight: bold;
max-width:90%;
}
}
.stream_element {
@include border-radius(3px);
@include box-shadow(0, 1px, 5px, rgba(0, 0, 0, 1));
background: {
color: #fff; };
border: {
bottom: 1px solid black; };
}
.photo_attachments {
position: relative;
left: 0;
top: 0;
padding: 0;
margin: 0;
img {
@include border-radius(3px);
margin: 0;
padding: 0; } }
#main_stream {
font: {
size: 0.95em; }; }
.from {
font: {
size: larger; }; }
.more-link {
-webkit-box-shadow: inset 0 1px 5px #111, 0 1px 1px #999;
display: block;
text-align: center;
padding: 0 10px;
margin: 0 10px;
border-radius: 3px;
background: {
color: #333333; };
h1 {
color: #cccccc;
padding: 20px;
text-shadow: 0 -2px 0 black; } }
.info {
color: #ccc;
font: {
size: smaller;
};
}
.via {
font: {
weight: bold;
}
}
.via {
a {
color: #ccc; } }
.comment {
.time {
color: #777; } }
.info {
margin: {
top: -2px; }; }
#author_info.profile {
box-shadow: inset 0 -1px 3px #111;
margin-top: -10px;
text-align: left;
h2 {
color: #ccc;
}
background: {
color: #333; };
border: {
bottom: 1px solid black; };
height: 90px;
padding: 10px;
margin: {
bottom: 6px; };
img {
float: left;
height: 90px;
width: 90px;
margin: {
right: 10px;
}
}
.content {
padding: {
left: 100px; }; }
.description {
font: {
weight: normal;
size: small; };
color: #999999; } }
.right {
float: right; }
header {
@include linear-gradient(#444444, black);
@include box-shadow(0,1px,1px,rgba(0,0,0,0.7));
width: 100%;
position: fixed;
z-index: 10;
top: 0;
border: {
bottom: 1px solid #222;
}
padding: 12px 5px;
.right {
float: right; } }
footer {
text-align: center;
a,
a:visited {
color: #999;
margin: 10px;
}
padding: {
top: 20px;
bottom: 30px;
}
}
.bottom_bar {
@include border-radius(0, 0, 3px, 3px);
display: block;
position: relative;
padding: 10px;
background: #eeeeee;
margin: {
top: 10px; };
border: {
top: 1px solid #dddddd; };
min-height: 24px;
> a,
.show_comments {
@include transition(color);
color: #999;
font-weight: bold;
}
.show_comments {
position: relative;
top: 3px;
font: {
size: larger;
}
color: #ccc;
}
a.show_comments {
color: #999;
&.active:not(.bottom_collapse) {
color: #444;
padding: {
right: 14px;
}
background: {
image: url("/images/icons/arrow_down_small.png");
position: center right;
repeat: no-repeat;
}
}
}
.show_comments.bottom_collapse {
position: absolute;
right: 10px;
top: 14px;
padding: 5px 10px;
}
#bottom_bar_tabs {
display: table;
width: 100%;
text: {
align: center;
}
border: {
bottom: 1px solid #ccc;
}
font: {
size: 28px;
}
color: #ccc;
.tab {
display: table-cell;
position:relative;
top: -5px;
border: {
right: 1px solid #ccc;
}
&:last-child {
border: none;
}
}
}
}
.floater {
float: right; }
.stream_element .photo_attachments {
@include border-radius(3px);
background: {
color: #999;
}
border: {
bottom: 1px solid #ccc;
}
img.big-stream-photo {
@include border-radius(3px, 3px, 0, 0);
width: 100%;
}
a {
padding: 0; }
margin-top: 0; }
.photo_area {
@include border-radius(3px);
text-align: center; }
.image_link {
display: inline-block;
background: {
size: 24px;
repeat: no-repeat;
position: center; };
height: 16px;
width: 24px;
padding: 5px;
margin: {
left: 5px; }; }
.like_action {
&.inactive{
background-image: url("/images/icons/heart_mobile_grey.png");
}
&.active {
background-image: url("/images/icons/heart_mobile_red.png");
}
&.loading {
background-image: url("/images/mobile-spinner.gif");
}
}
.comment_action.image_link {
background-image: url("/images/icons/pencil_mobile_grey_active.png");
&.inactive {
background-image: url("/images/icons/pencil_mobile_grey.png");
}
&.loading {
background-image: url("/images/mobile-spinner.gif");
}
}
.compose_icon {
position: absolute;
top: 8px;
right: 15px;
}
#new_status_message {
text-align: left;
position: absolute;
left: 0;
top: 40px;
width: 100%;
fieldset {
padding: 10px;
}
#message_container {
@include box-shadow(0, 2px, 3px, #999);
background-color: #fff;
padding: 5px;
border: {
bottom: 1px solid #999;
}
}
textarea {
@include border-radius(0);
left: 0;
border: none;
margin: 10px 0;
font-size: larger;
padding: 0;
min-width: 100%;
}
}
textarea {
font-size: larger !important;
}
form {
input:not([type='checkbox']),
textarea {
-webkit-appearance: none;
text-size: larger;
}
}
.btn,
input[type=submit] {
@include border-radius(3px);
background-color: #ddd;
color: #666;
font-weight: bold;
padding: 10px;
border: 1px solid #ccc;
min-width: 100px;
&.action {
color: #fff;
background-color: green;
border: 1px solid #888;
}
}
select {
font-size: larger;
padding: 7px;
}
.new_comment {
padding: 10px 0;
padding-top: 20px;
textarea {
width: 98%;
}
.actions {
text-align: right;
margin-top: 10px;
}
}
.comment.add_comment_bottom_link_container {
position: relative;
text-align: center;
padding: 25px !important;
}
.post_stats {
position: absolute;
font-size: larger;
right: 10px;
top: 36px;
z-index: 2;
span {
color: #666;
font-weight: bold;
padding: 2px 7px;
margin: 5px 6px;
background: {
color: #eee;
}
}
}
.additional_photo_count {
@include opacity(0.5);
position: absolute;
padding: 3px 8px;
font-weight: bold;
background: #fff;
border: 1px solid #222;
border-bottom: 2px solid #111;
bottom: 10px;
right: 10px;
line-height: 16px;
}
header {
input {
position: absolute;
top: 8px;
right: 15px;
padding: 5px !important;
min-width: 75px !important;
border: 1px solid #444 !important;
}
}
.new_status_message {
min-height: 300px;
}
.reshare {
border-bottom: 1px solid #ccc;
padding: {
bottom: 10px;
}
position: relative;
.reshare_via {
width: 100%;
position: absolute;
bottom: -7px;
text-align: center;
span {
padding: 2px 10px;
font-weight: bold;
color: #999;
background: {
color: #fff;
}
}
}
}

View file

@ -0,0 +1,315 @@
/*
* HTML5 Boilerplate
*
* What follows is the result of much research on cross-browser styling.
* Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
* Kroc Camen, and the H5BP dev community and team.
*
* Detailed information about this CSS: h5bp.com/css
*
* ==|== normalize ==========================================================
*/
/* =============================================================================
HTML5 display definitions
========================================================================== */
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section { display: block; }
audio, canvas, video { display: inline-block; *display: inline; *zoom: 1; }
audio:not([controls]) { display: none; }
[hidden] { display: none; }
/* =============================================================================
Base
========================================================================== */
/*
* 1. Correct text resizing oddly in IE6/7 when body font-size is set using em units
* 2. Force vertical scrollbar in non-IE
* 3. Prevent iOS text size adjust on device orientation change, without disabling user zoom: h5bp.com/g
*/
html { font-size: 100%; overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
body { margin: 0; font-size: 13px; line-height: 1.231; }
body, button, input, select, textarea { font-family: sans-serif; color: #222; }
/*
* Remove text-shadow in selection highlight: h5bp.com/i
* These selection declarations have to be separate
* Also: hot pink! (or customize the background color to match your design)
*/
::-moz-selection { background: #fe57a1; color: #fff; text-shadow: none; }
::selection { background: #fe57a1; color: #fff; text-shadow: none; }
/* =============================================================================
Links
========================================================================== */
a { color: #00e; }
a:visited { color: #551a8b; }
a:hover { color: #06e; }
a:focus { outline: thin dotted; }
/* Improve readability when focused and hovered in all browsers: h5bp.com/h */
a:hover, a:active { outline: 0; }
/* =============================================================================
Typography
========================================================================== */
abbr[title] { border-bottom: 1px dotted; }
b, strong { font-weight: bold; }
blockquote { margin: 1em 40px; }
dfn { font-style: italic; }
hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
ins { background: #ff9; color: #000; text-decoration: none; }
mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; }
/* Redeclare monospace font family: h5bp.com/j */
pre, code, kbd, samp { font-family: monospace, serif; _font-family: 'courier new', monospace; font-size: 1em; }
/* Improve readability of pre-formatted text in all browsers */
pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; }
q { quotes: none; }
q:before, q:after { content: ""; content: none; }
small { font-size: 85%; }
/* Position subscript and superscript content without affecting line-height: h5bp.com/k */
sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
sup { top: -0.5em; }
sub { bottom: -0.25em; }
/* =============================================================================
Lists
========================================================================== */
ul, ol { margin: 1em 0; padding: 0 0 0 40px; }
dd { margin: 0 0 0 40px; }
nav ul, nav ol { list-style: none; list-style-image: none; margin: 0; padding: 0; }
/* =============================================================================
Embedded content
========================================================================== */
/*
* 1. Improve image quality when scaled in IE7: h5bp.com/d
* 2. Remove the gap between images and borders on image containers: h5bp.com/e
*/
img { border: 0; -ms-interpolation-mode: bicubic; vertical-align: middle; }
/*
* Correct overflow not hidden in IE9
*/
svg:not(:root) { overflow: hidden; }
/* =============================================================================
Figures
========================================================================== */
figure { margin: 0; }
/* =============================================================================
Forms
========================================================================== */
form { margin: 0; }
fieldset { border: 0; margin: 0; padding: 0; }
/* Indicate that 'label' will shift focus to the associated form element */
label { cursor: pointer; }
/*
* 1. Correct color not inheriting in IE6/7/8/9
* 2. Correct alignment displayed oddly in IE6/7
*/
legend { border: 0; *margin-left: -7px; padding: 0; }
/*
* 1. Correct font-size not inheriting in all browsers
* 2. Remove margins in FF3/4 S5 Chrome
* 3. Define consistent vertical alignment display in all browsers
*/
button, input, select, textarea { font-size: 100%; margin: 0; vertical-align: baseline; *vertical-align: middle; }
/*
* 1. Define line-height as normal to match FF3/4 (set using !important in the UA stylesheet)
* 2. Correct inner spacing displayed oddly in IE6/7
*/
button, input { line-height: normal; *overflow: visible; }
/*
* Reintroduce inner spacing in 'table' to avoid overlap and whitespace issues in IE6/7
*/
table button, table input { *overflow: auto; }
/*
* 1. Display hand cursor for clickable form elements
* 2. Allow styling of clickable form elements in iOS
*/
button, input[type="button"], input[type="reset"], input[type="submit"], [role="button"] { cursor: pointer; -webkit-appearance: button; }
/*
* Consistent box sizing and appearance
*/
input[type="checkbox"], input[type="radio"] { box-sizing: border-box; padding: 0; }
input[type="search"] { -webkit-appearance: textfield; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; }
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
/*
* Remove inner padding and border in FF3/4: h5bp.com/l
*/
button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; }
/*
* 1. Remove default vertical scrollbar in IE6/7/8/9
* 2. Allow only vertical resizing
*/
textarea { overflow: auto; vertical-align: top; resize: vertical; }
/* Colors for form validity */
input:valid, textarea:valid { }
input:invalid, textarea:invalid { background-color: #f0dddd; }
/* =============================================================================
Tables
========================================================================== */
table { border-collapse: collapse; border-spacing: 0; }
td { vertical-align: top; }
/* ==|== primary styles =====================================================
Author:
========================================================================== */
/*
* Media queries for responsive design https://github.com/shichuan/mobile-html5-boilerplate/wiki/The-Style
*/
/* Styles for desktop and large screen ----------- */
/*styles for 800px and up!*/
@media only screen and (min-width: 800px) {
/* Styles */
}/*/mediaquery*/
/* iPhone 4, Opera Mobile 11 and other high pixel ratio devices ----------- */
@media
only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) {
/* Styles */
}
/* ==|== non-semantic helper classes ========================================
Please define your styles before this section.
========================================================================== */
/* prevent callout */
.nocallout {-webkit-touch-callout: none;}
/* Text overflow with ellipsis */
.ellipsis {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
/* A hack for HTML5 contenteditable attribute on mobile */
textarea[contenteditable] {-webkit-appearance: none;}
/* A workaround for S60 3.x and 5.0 devices which do not animated gif images if they have been set as display: none */
.gifhidden {position: absolute; left: -100%;}
/* For image replacement */
.ir { display: block; border: 0; text-indent: -999em; overflow: hidden; background-color: transparent; background-repeat: no-repeat; text-align: left; direction: ltr; }
.ir br { display: none; }
/* Hide from both screenreaders and browsers: h5bp.com/u */
.hidden { display: none !important; visibility: hidden; }
/* Hide only visually, but have it available for screenreaders: h5bp.com/v */
.visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
/* Extends the .visuallyhidden class to allow the element to be focusable when navigated to via the keyboard: h5bp.com/p */
.visuallyhidden.focusable:active, .visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; }
/* Hide visually and from screenreaders, but maintain layout */
.invisible { visibility: hidden; }
/* Contain floats: h5bp.com/q */
.clearfix:before, .clearfix:after { content: ""; display: table; }
.clearfix:after { clear: both; }
.clearfix { *zoom: 1; }
/* ==|== print styles =======================================================
Print styles.
Inlined to avoid required HTTP connection: h5bp.com/r
========================================================================== */
@media print {
* { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important; -ms-filter: none !important; } /* Black prints faster: h5bp.com/s */
a, a:visited { text-decoration: underline; }
a[href]:after { content: " (" attr(href) ")"; }
abbr[title]:after { content: " (" attr(title) ")"; }
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links */
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
thead { display: table-header-group; } /* h5bp.com/t */
tr, img { page-break-inside: avoid; }
img { max-width: 100% !important; }
@page { margin: 0.5cm; }
p, h2, h3 { orphans: 3; widows: 3; }
h2, h3 { page-break-after: avoid; }
}

View file

@ -154,18 +154,6 @@ describe AspectsController do
end
end
context "mobile" do
it "renders a share button when you don't pass aspect IDs" do
get :index, :format => :mobile
response.body.should =~ /#{Regexp.escape('id="status_message_submit"')}/
end
it "renders a share button when you pass aspect IDs" do
get :index, :a_ids => [@alices_aspect_1], :format => :mobile
response.body.should =~ /#{Regexp.escape('id="status_message_submit"')}/
end
end
describe 'performance', :performance => true do
before do
require 'benchmark'
@ -357,7 +345,6 @@ describe AspectsController do
it 'should not 500' do
get :index, :format => :mobile
response.should be_success
end
end
end

View file

@ -29,7 +29,7 @@ describe CommentsController do
end
it 'responds to format mobile' do
post :create, comment_hash.merge(:format => 'mobile')
response.should be_redirect
response.should be_success
end
end

View file

@ -65,7 +65,6 @@ describe StatusMessagesController do
post :create, status_message_hash.merge(:format => 'js')
json = JSON.parse(response.body)
save_fixture(json['html'], "created_status_message")
end
it 'escapes XSS' do
@ -76,6 +75,14 @@ describe StatusMessagesController do
end
end
it 'takes public in aspect ids' do
post :create, status_message_hash.merge(:aspect_ids => ['public'])
end
it 'takes all_aspects in aspect ids' do
post :create, status_message_hash.merge(:aspect_ids => ['all_aspects'])
end
it "dispatches the post to the specified services" do
s1 = Services::Facebook.new
alice.services << s1