Skip to content

Instantly share code, notes, and snippets.

@brandwaffle
Created April 21, 2011 00:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandwaffle/933407 to your computer and use it in GitHub Desktop.
Save brandwaffle/933407 to your computer and use it in GitHub Desktop.
switches betwixt fb and wp comments
jQuery('.switch-to-fb-comments').live('click', function(){
window.wp_comm_form = jQuery('#respond').html();
jQuery('#facebook_comments').remove();
jQuery('#respond').html('<a href="#" class="switch-to-wp-comments">Switch to WP</a><fb:comments id="facebook_comments" href="url_to_comment"></fb:comments>');
fbAsyncInit();
event.preventDefault();
});
jQuery('.switch-to-wp-comments').live('click', function(){
jQuery('#respond').html(window.wp_comm_form);
event.preventDefault();
});
jQuery('#cancel-comment-reply-link').live('click', function() {
var t = addComment, temp = t.I('wp-temp-form-div'), respond = t.I(t.respondId);
if ( ! temp || ! respond )
return;
t.I('comment_parent').value = '0';
temp.parentNode.insertBefore(respond, temp);
temp.parentNode.removeChild(temp);
this.style.display = 'none';
this.onclick = null;
return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment