added the post to services icon on every page added a manage icon and moved the RSS link to the public explain

This commit is contained in:
zhitomirskiyi 2011-02-24 17:09:31 -08:00
parent adfcc59631
commit ec93faa2c4
6 changed files with 55 additions and 22 deletions

View file

@ -10,7 +10,6 @@ class StatusMessagesController < ApplicationController
respond_to :json, :only => :show
def create
pp params
params[:status_message][:aspect_ids] = params[:aspect_ids]
photos = Photo.where(:id => [*params[:photos]], :diaspora_handle => current_user.person.diaspora_handle)

View file

@ -9,7 +9,8 @@
=t('.outside')
%br
%br
= link_to "RSS", current_user.public_url
%br
- if current_user.services
- for service in current_user.services
= t('.logged_in', :service => service.provider)

View file

@ -2,6 +2,10 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
:javascript
$(function() {
$(".question_mark").tipsy({trigger: 'hover', gravity: 'w'});
});
#publisher
@ -41,22 +45,20 @@
= image_tag 'ajax-loader.gif', :class => 'hidden', :id => "publisher_spinner"
= status.submit t('.share'), :disable_with => t('.posting'), :class => 'button'
- if aspect == :all
.public_toggle
%p.checkbox_select
= status.check_box( :public, {:title => t('.make_public')}, true, false)
.public_toggle
%span#publisher_service_icons
- if aspect == :all
= status.hidden_field( :public)
= image_tag "social_media_logos/feed-16x16.png", :title => "RSS", :class => 'public_icon dim'
- if current_user.services
- for service in current_user.services
= image_tag "social_media_logos/#{service.provider}-16x16.png", :title => service.provider, :class => "service_icon dim", :id =>"#{service.provider}"
= link_to (image_tag "icons/monotone_wrench_settings.png"), "#question_mark_pane", :class => 'question_mark', :rel => 'facebox', :title => t('shared.public_explain.manage')#, :style=>"display:none;"
%span#publisher_service_icons
= link_to (image_tag "social_media_logos/feed-16x16.png", :title => "RSS"), current_user.public_url, :class => 'public_icon dim'
- if current_user.services
- for service in current_user.services
= image_tag "social_media_logos/#{service.provider}-16x16.png", :title => service.provider, :class => "service_icon dim", :id =>"#{service.provider}"
= link_to '(?)', "#question_mark_pane", :class => 'question_mark', :style=>"display:none;", :rel => 'facebox'
.facebox_content
#question_mark_pane
= render 'shared/public_explain'
.facebox_content
#question_mark_pane
= render 'shared/public_explain'
#publisher_photo_upload
= render 'photos/new_photo', :aspect_ids => @aspect_ids.join(',')

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

View file

@ -289,6 +289,14 @@ var Publisher = {
Publisher.toggleServiceField($(this).attr('id'));
});
},
bindPublicIcon: function(){
$(".public_icon").bind("click", function(evt){
$(this).toggleClass("dim");
var public_field= $("#publisher #status_message_public");
(public_field.val() == 'false')?(public_field.val('true')):(public_field.val('false'));
});
},
toggleServiceField: function(service){
var hidden_field = $('#publisher [name="services[]"][value="'+service+'"]')
if(hidden_field.length > 0){
@ -305,12 +313,7 @@ var Publisher = {
Publisher.cachedSubmit = false;
Publisher.bindServiceIcons();
$("div.public_toggle input").live("click", function(evt) {
$(".public_icon").toggleClass("dim");
if ($(this).attr('checked') == true) {
$(".question_mark").click();
}
});
Publisher.bindPublicIcon();
if ($("#status_message_fake_message").val() == "") {
Publisher.close();

View file

@ -20,7 +20,35 @@ describe("Publisher", function() {
expect(Publisher.close).wasNotCalled();
});
});
describe("bindPublicIcon", function() {
beforeEach( function(){
spec.loadFixture('aspects_index_services');
});
it('gets called on initialize', function(){
spyOn(Publisher, 'bindPublicIcon');
Publisher.initialize();
expect(Publisher.bindPublicIcon).toHaveBeenCalled();
});
it('toggles dim only on the clicked icon', function(){
expect($(".public_icon").hasClass("dim")).toBeTruthy();
Publisher.bindPublicIcon();
$(".public_icon").click();
expect($(".public_icon").hasClass("dim")).toBeFalsy();
});
it('toggles the hidden field', function(){
Publisher.bindPublicIcon();
expect($('#publisher #status_message_public').val()).toBe('false');
$(".public_icon").click();
expect($('#publisher #status_message_public').val()).toBe('true');
});
});
describe("bindServiceIcons", function() {
beforeEach( function(){
spec.loadFixture('aspects_index_services');