Plugin Name: Facebook Share - Comments Plugin Description: After posting a comment your commenters can click to have the option to post their comment to Facebook. This will use Facebook Connect if that is enabled for your site or a Facebook Share link if it is not. Plugin URL: http://facebook.com Author: Jon Author URL: https://www.intensedebate.com/people/jon Date Added: May 7th, 2010 Code: IDC.ui = { "add_message": function( comment_id, html_msg ) { var msg_div = IDC.c_object( 'div', { 'className':'idc-message', 'id': 'idc-comment-msg-div-' + comment_id } ); msg_div.innerHTML = 'Close Message

Comment posted.

' + html_msg + '

'; IDC.$( 'IDComment-CommentText' + comment_id ).insertBefore( msg_div, IDC.$( 'IDComment-CommentText' + comment_id ).firstChild ); }, "close_message": function( comment_id ) { IDC.$( 'idc-comment-msg-div-' + comment_id ).parentNode.removeChild( IDC.$( 'idc-comment-msg-div-' + comment_id ) ); }, "add_post_comment_message" : function ( comment_id ) { IDC.ui.last_comment_html = IDC.$( 'IDComment-CommentText' + comment_id ).innerHTML; if( window.FB !== undefined && FB.Connect ) { IDC.ui.add_message( comment_id, 'Share on Facebook or Close Message' ); } else { IDC.ui.add_message( comment_id, 'Share on Facebook or Close Message' ); } }, "fb_wrapper" : function ( comment_id ) { FB.Connect.streamPublish( "I just commented on " + document.title + ": \n" + IDC.ui.last_comment_html.replace(/^\s*/, "").replace(/\s*$/, "").replace(//g, "\n").replace(/(<([^>]+)>)/ig,""), {"name":document.title,"href":location.href + "#IDComment" + comment_id,"caption":"Originally posted as a comment using IntenseDebate", "description": ""}, null, null, "Tell your friends about your comment?", IDC.ui.close_message(comment_id) ); } }; id_add_action( 'comment_post', function(args) { IDC.ui.add_post_comment_message( args['comment_id'] ); } ); CSS: #idc-container .idc-share-facebook { text-decoration: none; } #idc-container .idc-share-facebook .idc-share-inner { background:url(http://s.intensedebate.com/images/idc-facebook-share-sprite.png?=1) no-repeat 0 0 #365891; font-size:10px; line-height:10px; display:inline-block; padding: 0 0 0 1px; } #idc-container .idc-share-facebook .idc-share-inner span { margin: 1px 1px 0 17px !important; padding: 2px 6px 3px; background: url(http://s.intensedebate.com/images/idc-facebook-share-sprite.png?=1) repeat 0 -36px #5F78AB; border-bottom: 1px solid #214781; border-top: 1px solid #99accc; color: #fff; height:10px; display:inline-block; font-family:"lucida grande",tahoma,verdana,arial,sans-serif; font-weight:bold !important; text-shadow:none; } #idc-container .idc-share-facebook:active .idc-share-inner { background-position: 0 -18px; } #idc-container .idc-share-facebook:active .idc-share-inner span { background: #4f6aa3; border-top-color: #4f6aa3; }