diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 484cab55e8da70a54fa51caae3eca98d81999ddb..ec22b9f32be6c8fc64d35746b37981c82d916af3 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -11,6 +11,9 @@ class AspectsController < ApplicationController def index @posts = current_user.visible_posts(:by_members_of => :all).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' @aspect = :all + + @fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create", + :scope=>MiniFB.scopes.join(",")) end def create diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index f14873e75d32d02d692c50a4e030cd415b6fbc78..b514a5e1e1bb4d738ff77f0cd04cef244980edad 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -2,6 +2,18 @@ -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. +:javascript + + $("div.public_toggle input").live("click", function(evt){ + if("#{@logged_in}" == "false" && $(this).attr('checked') == true){ + if(confirm("You are currently not connected to facebook. Sign in to facebook?")){ + window.location = "#{@fb_access_url}"; + } else { + $(this).attr('checked', false); + } + }; + }); + #publisher = owner_image_tag @@ -18,13 +30,15 @@ = check_box_tag("aspect_ids[]", aspect.id, @aspect == :all || current_aspect?(aspect) ) = aspect.name - = f.hidden_field( :public, :value => false ) + - if @aspect == :all + .public_toggle + = f.check_box( :public, :value => false ) + share on facebook + .buttons - if @aspect == :all = f.submit t('.share'), :title => "Share with all aspects" - else = f.submit t('.share'), :title => "Share with #{@aspect.name}" - - if defined? broadcast - = f.submit "Broadcast", :class => "broadcast", :name => "broadcast", :title => "Publish to Diaspora and Facebook" diff --git a/public/javascripts/view.js b/public/javascripts/view.js index f79cace4df8c4af46859974a13efe96d6e86d736..94874358befd2c1b47f303a5086d2c3aa3bf52fc 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -47,7 +47,7 @@ $(document).ready(function(){ ); $("#publisher textarea").keydown( function(e) { - if (e.shiftKey && e.keyCode == 13) { + if (e.keyCode == 13) { $("#publisher form").submit(); } }); @@ -71,10 +71,3 @@ $.fn.clearForm = function() { }); }; -$("#publisher .broadcast").live("click", function(evt){ - evt.preventDefault(); - if( confirm("Publish to Diaspora and Facebook?") ) { - $("#status_message_public").val("true"); - $(this).submit(); - } -}); diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index f1b8bee9415001296481816f38b2fc483862a377..feb23b897e8b9dca9871228fe787e284efc81ce6 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -612,6 +612,16 @@ label .buttons :float right + .public_toggle + :position absolute + :top 53px + :left 460px + :width 300px + :font + :size smaller + :style italic + + #image_picker .small_photo :height 100px