From 68152dcf3acca51b85fc80e5549718c8123f943c Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 4 Feb 2009 22:33:50 +0000 Subject: Facebook app - reorganized some stuff; better HTML output --- lib/facebookaction.php | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'lib/facebookaction.php') diff --git a/lib/facebookaction.php b/lib/facebookaction.php index f42427540..b6481011f 100644 --- a/lib/facebookaction.php +++ b/lib/facebookaction.php @@ -129,7 +129,7 @@ class FacebookAction extends Action * Start an Facebook ready HTML document * * For Facebook we don't want to actually output any headers, - * DTD info, etc. + * DTD info, etc. Just Stylesheet and JavaScript links. * * If $type isn't specified, will attempt to do content negotiation. * @@ -140,6 +140,9 @@ class FacebookAction extends Action function startHTML($type=null) { + $this->showStylesheets(); + $this->showScripts(); + $this->elementStart('div', array('class' => 'facebook-page')); } @@ -181,8 +184,6 @@ class FacebookAction extends Action function showHead($error, $success) { - $this->showStylesheets(); - $this->showScripts(); if ($error) { $this->element("h1", null, $error); @@ -204,7 +205,6 @@ class FacebookAction extends Action // Make this into a widget later function showLocalNav() { - $this->elementStart('ul', array('class' => 'nav')); $this->elementStart('li', array('class' => @@ -229,18 +229,7 @@ class FacebookAction extends Action $this->elementEnd('li'); $this->elementEnd('ul'); - } - - /** - * Show primary navigation. - * - * @return nothing - */ - function showPrimaryNav() - { - // we don't want to show anything for this - } /** * Show header of the page. @@ -254,7 +243,6 @@ class FacebookAction extends Action $this->elementStart('div', array('id' => 'header')); $this->showLogo(); $this->showNoticeForm(); - $this->showPrimaryNav(); $this->elementEnd('div'); } -- cgit v1.2.3-54-g00ecf From e5b075b912e1fb416e73988547e2ece8f89e6453 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 5 Feb 2009 04:54:42 +0000 Subject: Matching Facebook app UI to identi.ca. Fixed tabs, add to profile, widths, font-size, and some HTML markup. --- actions/facebookinvite.php | 8 ++-- lib/facebookaction.php | 9 +++-- theme/base/css/facebookapp.css | 84 ++++++++++++++++++++++++++++++++++++++---- 3 files changed, 86 insertions(+), 15 deletions(-) (limited to 'lib/facebookaction.php') diff --git a/actions/facebookinvite.php b/actions/facebookinvite.php index b7224783a..3c872f94b 100644 --- a/actions/facebookinvite.php +++ b/actions/facebookinvite.php @@ -73,7 +73,7 @@ class FacebookinviteAction extends FacebookAction $friend_ids = $_POST['ids']; // XXX: Hmm... is this the best way to acces the list? - $this->elementStart("ul"); + $this->elementStart('ul', array('id' => 'facebook-friends')); foreach ($friend_ids as $friend) { $this->elementStart('li'); @@ -112,11 +112,11 @@ class FacebookinviteAction extends FacebookAction $this->element('h2', null, sprintf(_('Friends already using %s:'), common_config('site', 'name'))); - $this->elementStart("ul"); - + $this->elementStart('ul', array('id' => 'facebook-friends')); + foreach ($exclude_ids as $friend) { $this->elementStart('li'); - $this->element('fb:profile-pic', array('uid' => $friend)); + $this->element('fb:profile-pic', array('uid' => $friend, 'size' => 'square')); $this->element('fb:name', array('uid' => $friend, 'capitalize' => 'true')); $this->elementEnd('li'); diff --git a/lib/facebookaction.php b/lib/facebookaction.php index b6481011f..d369cc385 100644 --- a/lib/facebookaction.php +++ b/lib/facebookaction.php @@ -270,7 +270,6 @@ class FacebookAction extends Action $loginmsg_part1 = _('To use the %s Facebook Application you need to login ' . 'with your username and password. Don\'t have a username yet? '); - $loginmsg_part2 = _(' a new account.'); $this->elementStart('dd'); @@ -279,18 +278,18 @@ class FacebookAction extends Action $this->element('a', array('href' => common_local_url('register')), _('Register')); $this->text($loginmsg_part2); + $this->elementEnd('p'); $this->elementEnd('dd'); + $this->elementEnd('dl'); - $this->elementEnd('div'); - } function showLoginForm($msg = null) { - $this->elementStart('div', array('class' => 'content')); + $this->elementStart('div', array('id' => 'content')); $this->element('h1', null, _('Login')); if ($msg) { @@ -318,6 +317,7 @@ class FacebookAction extends Action $this->elementEnd('ul'); $this->submit('submit', _('Login')); + $this->elementEnd('fieldset'); $this->elementEnd('form'); $this->elementStart('p'); @@ -326,6 +326,7 @@ class FacebookAction extends Action $this->elementEnd('p'); $this->elementEnd('div'); + $this->elementEnd('div'); } diff --git a/theme/base/css/facebookapp.css b/theme/base/css/facebookapp.css index af188ad7a..163b41fb4 100644 --- a/theme/base/css/facebookapp.css +++ b/theme/base/css/facebookapp.css @@ -1,10 +1,86 @@ @import url("display.css"); @import url("../../identica/css/display.css"); -span.facebook-button { border: 2px solid #777; padding: 5px; display: block; float: left; margin-right: 20px; -moz-border-radius: 4px; border-radius:4px; -webkit-border-radius:4px; font-weight: bold; background-color:#A9BF4F; color:#fff; font-size:1.2em } +* { +font-size:14px; +font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif; +} + +#wrap { +background-color:#F0F2F5; +padding-left:18px; +padding-right:18px; +width:auto; +} + +p,label, +h1,h2,h3,h4,h5,h6 { +color:#000; +} + +#content { +width:95%; +} + +#site_nav_local_views a { +background-color:#D0DFE7; +} +#site_nav_local_views a:hover { +background-color:#FAFBFC; +} + +span.facebook-button { +border: 2px solid #aaa; +padding: 3px; +display: block; +float: left; +margin-right: 20px; +-moz-border-radius: 4px; +border-radius:4px; +-webkit-border-radius:4px; +font-weight: bold; +background-color:#A9BF4F; +color:#fff; +font-size:1.2em +} span.facebook-button a { color:#fff } +.facebook_guide { +margin-bottom:18px; +} +.facebook_guide p { +font-weight:bold; +} + + +input { +height:auto !important; +} + +#facebook-friends { +float:left; +width:100%; +} + +#facebook-friends li { +float:left; +margin-right:2%; +margin-bottom:11px; +width:18%; +height:115px; +} +#facebook-friends li a { +float:left; +} + +#add_to_profile { +position:absolute; +right:18px; +top:10px; +z-index:2; +} + .notice div.entry-content dl, .notice div.entry-content dt, .notice div.entry-content dd { @@ -19,12 +95,6 @@ margin-bottom:18px; list-style-type:none; } -.facebook_guide p { -margin-bottom:18px; -font-size:1.3em; -font-weight:bold; -} - .form_settings label { margin-right:18px; } -- cgit v1.2.3-54-g00ecf From 7bc764fdc0b2bfc2f74df1174f9369c98bc9605b Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Thu, 5 Feb 2009 07:07:36 +0000 Subject: Facebook profile box CSS and a link back to the app page. --- lib/facebookaction.php | 140 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 127 insertions(+), 13 deletions(-) (limited to 'lib/facebookaction.php') diff --git a/lib/facebookaction.php b/lib/facebookaction.php index d369cc385..043a078cd 100644 --- a/lib/facebookaction.php +++ b/lib/facebookaction.php @@ -336,42 +336,70 @@ class FacebookAction extends Action // Need to include inline CSS for styling the Profile box + $app_props = $this->facebook->api_client->Admin_getAppProperties(array('icon_url')); + $icon_url = $app_props['icon_url']; + $style = ''; $this->xw->openMemory(); - $item = new FacebookNoticeListItem($notice, $this); + $item = new FacebookProfileBoxNotice($notice, $this); $item->show(); $fbml = "$style " . $this->xw->outputMemory(false) . ""; @@ -454,8 +482,6 @@ class FacebookAction extends Action $content_shortened = common_shorten_links($content); if (mb_strlen($content_shortened) > 140) { - common_debug("Content = '$content_shortened'", __FILE__); - common_debug("mb_strlen(\$content) = " . mb_strlen($content_shortened), __FILE__); $this->showPage(_('That\'s too long. Max notice size is 140 chars.')); return; } @@ -528,6 +554,18 @@ class FacebookNoticeForm extends NoticeForm class FacebookNoticeList extends NoticeList { + + /** + * constructor + * + * @param Notice $notice stream of notices from DB_DataObject + */ + + function __construct($notice, $out=null) + { + parent::__construct($notice, $out); + } + /** * show the list of notices * @@ -582,6 +620,20 @@ class FacebookNoticeList extends NoticeList class FacebookNoticeListItem extends NoticeListItem { + + /** + * constructor + * + * Also initializes the profile attribute. + * + * @param Notice $notice The notice we'll display + */ + + function __construct($notice, $out=null) + { + parent::__construct($notice, $out); + } + /** * recipe function for displaying a single notice in the Facebook App. * @@ -634,3 +686,65 @@ class FacebookNoticeListItem extends NoticeListItem } } + + +class FacebookProfileBoxNotice extends FacebookNoticeListItem +{ + + /** + * constructor + * + * Also initializes the profile attribute. + * + * @param Notice $notice The notice we'll display + */ + + function __construct($notice, $out=null) + { + parent::__construct($notice, $out); + } + + /** + * Recipe function for displaying a single notice in the + * Facebook App's Profile + * + * @return void + */ + + function show() + { + + $this->out->elementStart('div', 'entry-title'); + $this->showAuthor(); + $this->showContent(); + $this->out->elementEnd('div'); + + $this->out->elementStart('div', 'entry-content'); + + $this->showNoticeLink(); + $this->showNoticeSource(); + $this->showReplyTo(); + $this->out->elementEnd('div'); + + $this->showAppLink(); + + } + + function showAppLink() + { + + $this->facebook = getFacebook(); + + $app_props = $this->facebook->api_client->Admin_getAppProperties( + array('canvas_name', 'application_name')); + + $this->app_uri = 'http://apps.facebook.com/' . $app_props['canvas_name']; + $this->app_name = $app_props['application_name']; + + $this->out->elementStart('a', array('id' => 'facebook_laconica_app', + 'href' => $this->app_uri)); + $this->out->text($this->app_name); + $this->out->elementEnd('a'); + } + +} -- cgit v1.2.3-54-g00ecf