share on facebook checkbox instead of broadcast button
This commit is contained in:
parent
db31357172
commit
12bdd1712d
4 changed files with 31 additions and 11 deletions
|
|
@ -11,6 +11,9 @@ class AspectsController < ApplicationController
|
||||||
def index
|
def index
|
||||||
@posts = current_user.visible_posts(:by_members_of => :all).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC'
|
@posts = current_user.visible_posts(:by_members_of => :all).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC'
|
||||||
@aspect = :all
|
@aspect = :all
|
||||||
|
|
||||||
|
@fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create",
|
||||||
|
:scope=>MiniFB.scopes.join(","))
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,18 @@
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
-# the COPYRIGHT file.
|
-# 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
|
#publisher
|
||||||
= owner_image_tag
|
= owner_image_tag
|
||||||
|
|
||||||
|
|
@ -18,13 +30,15 @@
|
||||||
= check_box_tag("aspect_ids[]", aspect.id, @aspect == :all || current_aspect?(aspect) )
|
= check_box_tag("aspect_ids[]", aspect.id, @aspect == :all || current_aspect?(aspect) )
|
||||||
= aspect.name
|
= aspect.name
|
||||||
|
|
||||||
= f.hidden_field( :public, :value => false )
|
|
||||||
|
|
||||||
|
- if @aspect == :all
|
||||||
|
.public_toggle
|
||||||
|
= f.check_box( :public, :value => false )
|
||||||
|
share on facebook
|
||||||
|
|
||||||
.buttons
|
.buttons
|
||||||
- if @aspect == :all
|
- if @aspect == :all
|
||||||
= f.submit t('.share'), :title => "Share with all aspects"
|
= f.submit t('.share'), :title => "Share with all aspects"
|
||||||
- else
|
- else
|
||||||
= f.submit t('.share'), :title => "Share with #{@aspect.name}"
|
= 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"
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ $(document).ready(function(){
|
||||||
);
|
);
|
||||||
|
|
||||||
$("#publisher textarea").keydown( function(e) {
|
$("#publisher textarea").keydown( function(e) {
|
||||||
if (e.shiftKey && e.keyCode == 13) {
|
if (e.keyCode == 13) {
|
||||||
$("#publisher form").submit();
|
$("#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();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
|
||||||
|
|
@ -612,6 +612,16 @@ label
|
||||||
.buttons
|
.buttons
|
||||||
:float right
|
:float right
|
||||||
|
|
||||||
|
.public_toggle
|
||||||
|
:position absolute
|
||||||
|
:top 53px
|
||||||
|
:left 460px
|
||||||
|
:width 300px
|
||||||
|
:font
|
||||||
|
:size smaller
|
||||||
|
:style italic
|
||||||
|
|
||||||
|
|
||||||
#image_picker
|
#image_picker
|
||||||
.small_photo
|
.small_photo
|
||||||
:height 100px
|
:height 100px
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue