Difference between revisions of "Widget:Improved Facebook Comments"

From eagle-rock.org
Line 12: Line 12:
 
To use this widget on your site, just install [http://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki as '''{{FULLPAGENAME}}''' article.
 
To use this widget on your site, just install [http://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki as '''{{FULLPAGENAME}}''' article.
 
</noinclude><includeonly><!--{counter assign="fbAPIdivID" name="fbAPIdivID"}--><!--{if $fbAPIdivID eq 1}--><div id="fb-root"></div>
 
</noinclude><includeonly><!--{counter assign="fbAPIdivID" name="fbAPIdivID"}--><!--{if $fbAPIdivID eq 1}--><div id="fb-root"></div>
<script>(function(d, s, id) {
+
<script>
  var js, fjs = d.getElementsByTagName(s)[0];
+
  window.fbAsyncInit = function() {
  if (d.getElementById(id)) return;
+
    FB.init({
  js = d.createElement(s); js.id = id;
+
      appId      : '$appID', // App ID
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=<!--{$appID|escape:'urlpathinfo'}-->";
+
      channelUrl : '//eagle-rock.org/channel.html', // Channel File
  fjs.parentNode.insertBefore(js, fjs);
+
      status    : true, // check login status
}(document, 'script', 'facebook-jssdk'));</script><!--{/if}--><div class="fb-comments" data-href="<!--{$url|escape:'html'}-->" data-num-posts="<!--{$num|escape:'html'|default:5}-->" data-width="<!--{$width|escape:'html'|default:470}-->"<!--{if isset($dark)}--> data-colorscheme="dark"<!--{/if}-->></div></includeonly>
+
      cookie    : true, // enable cookies to allow the server to access the session
 +
      xfbml      : true  // parse XFBML
 +
    });
 +
 
 +
  };
 +
 
 +
  (function(d){
 +
    var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
 +
    if (d.getElementById(id)) {return;}
 +
    js = d.createElement('script'); js.id = id; js.async = true;
 +
    js.src = "//connect.facebook.net/en_US/all.js";
 +
    ref.parentNode.insertBefore(js, ref);
 +
  }(document));
 +
 
 +
</script><!--{/if}--><div class="fb-comments" data-href="<!--{$url|escape:'html'}-->" data-num-posts="<!--{$num|escape:'html'|default:5}-->" data-width="<!--{$width|escape:'html'|default:470}-->"<!--{if isset($dark)}--> data-colorscheme="dark"<!--{/if}-->></div></includeonly>

Revision as of 21:56, 13 June 2012

This widget allows you to add the Improved Facebook Comments widget to your wiki page.

Created by Sergey Chernyshev

Improved by Saill White

Using this widget

For information on how to use this widget, see widget description page on MediaWikiWidgets.org.

Copy to your site

To use this widget on your site, just install MediaWiki Widgets extension and copy full source code of this page to your wiki as Widget:Improved Facebook Comments article.