Permalink
Browse files

cosmetic update

  • Loading branch information...
1 parent 063786a commit 0c512c2fe4b714450a13faa2721267c944018cac @thijstriemstra committed Sep 20, 2010
Showing with 13 additions and 11 deletions.
  1. +13 −11 FacebookPlugins.py
View
@@ -6,6 +6,7 @@
@see: http://developers.facebook.com/plugins
@see: http://developers.facebook.com/docs/guides/web#plugins
+
@note: Also support XFBML?
"""
@@ -30,22 +31,23 @@ class FacebookPlugins(Component):
class FBWikiMacro(object):
fb_url = 'http://www.facebook.com/plugins'
-
+
def _abs_href(self, formatter):
"""
Get absolute href for trac resource.
-
+
@param formatter
"""
- return self.env.abs_href.base + get_resource_url(self.env, formatter.resource, formatter.href)
+ return self.env.abs_href.base + get_resource_url(self.env,
+ formatter.resource, formatter.href)
+
-
class LikeButton(WikiMacroBase, FBWikiMacro):
"""
The [http://developers.facebook.com/docs/reference/plugins/like Like button] lets
users share pages from your site back to their [http://facebook.com Facebook]
profile with one click.
-
+
Examples:
{{{
[[LikeButton]] # current page
@@ -70,16 +72,16 @@ def expand_macro(self, formatter, name, args):
height = '80'
colorscheme = 'light' # or 'dark'
action = 'like' # or 'recommend'
-
+
if len(options) > 0 and options[0] != "None":
href = options[0]
-
+
if len(options) > 1:
layout = options[1] + "_count"
iframe_code = '<iframe src="%s/%s.php?href=%s&layout=%s&show_faces=%s&width=%s&action=%s&colorscheme=%s&height=%s" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:%spx; height:%spx;" allowTransparency="true"></iframe>' % (
self.fb_url, self.plugin_name, href, layout, show_faces, width, action, colorscheme, height, width, height)
-
+
return iframe_code
@@ -88,7 +90,7 @@ class ActivityFeed(WikiMacroBase, FBWikiMacro):
The [http://developers.facebook.com/docs/reference/plugins/activity Activity Feed]
plugins displays the most interesting recent [http://facebook.com Facebook] activity
taking place on your site.
-
+
Examples:
{{{
[[ActivityFeed]] # current page
@@ -114,11 +116,11 @@ def expand_macro(self, formatter, name, args):
if len(options) > 0 and options[0] != "None":
href = options[0]
-
+
if len(options) > 1:
recommendations = 'false'
iframe_code = '<iframe src="%s/%s.php?site=%s&width=%s&height=%s&header=%s&colorscheme=%s&recommendations=%s" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:%spx; height:%spx;" allowTransparency="true"></iframe>' % (
self.fb_url, self.plugin_name, href, width, height, header, colorscheme, recommendations, width, height)
-
+
return iframe_code

0 comments on commit 0c512c2

Please sign in to comment.