From d4940fe148002bfd6619bcbef95763395bb6d9cc Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 3 Apr 2010 10:26:43 -0700 Subject: Ticket #2272: Block confirmation form should let enter trigger the 'yes' button Setting focus into the form to make it easier to submit by keyboard. Enter or space will now trigger the button right off without having to mouse around to find the button after we've clicked into the conf form, and keyboarders can also get to the 'no' button more easily. --- actions/block.php | 7 +++++++ actions/groupblock.php | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'actions') diff --git a/actions/block.php b/actions/block.php index 5fae45dff..fe4ec0088 100644 --- a/actions/block.php +++ b/actions/block.php @@ -168,4 +168,11 @@ class BlockAction extends ProfileFormAction return; } } + + function showScripts() + { + parent::showScripts(); + $this->autofocus('form_action-yes'); + } + } diff --git a/actions/groupblock.php b/actions/groupblock.php index ec673358e..88d7634a2 100644 --- a/actions/groupblock.php +++ b/actions/groupblock.php @@ -214,5 +214,12 @@ class GroupblockAction extends Action 303); } } + + function showScripts() + { + parent::showScripts(); + $this->autofocus('form_action-yes'); + } + } -- cgit v1.2.3-54-g00ecf From ffc1ac02c3f1f566088c8bef7c54d1ae97e56a36 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 5 Apr 2010 10:12:27 -0400 Subject: add an event for group members minilist --- actions/showgroup.php | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'actions') diff --git a/actions/showgroup.php b/actions/showgroup.php index a0d05ba37..6e0666690 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -388,18 +388,23 @@ class ShowgroupAction extends GroupDesignAction $this->elementStart('div', array('id' => 'entity_members', 'class' => 'section')); - $this->element('h2', null, _('Members')); + if (Event::handle('StartShowGroupMembersMiniList', array($this))) { - $pml = new ProfileMiniList($member, $this); - $cnt = $pml->show(); - if ($cnt == 0) { - $this->element('p', null, _('(None)')); - } + $this->element('h2', null, _('Members')); + + $pml = new ProfileMiniList($member, $this); + $cnt = $pml->show(); + if ($cnt == 0) { + $this->element('p', null, _('(None)')); + } + + if ($cnt > MEMBERS_PER_SECTION) { + $this->element('a', array('href' => common_local_url('groupmembers', + array('nickname' => $this->group->nickname))), + _('All members')); + } - if ($cnt > MEMBERS_PER_SECTION) { - $this->element('a', array('href' => common_local_url('groupmembers', - array('nickname' => $this->group->nickname))), - _('All members')); + Event::handle('EndShowGroupMembersMiniList', array($this)); } $this->elementEnd('div'); -- cgit v1.2.3-54-g00ecf From 96761c14eafc5933119c95021da4bd8d89b4dd61 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 5 Apr 2010 10:47:07 -0400 Subject: override linkAttributes() method for groupmembersminilist --- actions/showgroup.php | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'actions') diff --git a/actions/showgroup.php b/actions/showgroup.php index 6e0666690..3d369e9eb 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -392,8 +392,8 @@ class ShowgroupAction extends GroupDesignAction $this->element('h2', null, _('Members')); - $pml = new ProfileMiniList($member, $this); - $cnt = $pml->show(); + $gmml = new GroupMembersMiniList($member, $this); + $cnt = $gmml->show(); if ($cnt == 0) { $this->element('p', null, _('(None)')); } @@ -507,3 +507,26 @@ class GroupAdminSection extends ProfileSection return null; } } + +class GroupMembersMiniList extends ProfileMiniList +{ + function newListItem($profile) + { + return new GroupMembersMiniListItem($profile, $this->action); + } +} + +class GroupMembersMiniListItem extends ProfileMiniListItem +{ + function linkAttributes() + { + $aAttrs = parent::linkAttributes(); + + if (common_config('nofollow', 'members')) { + $aAttrs['rel'] .= ' nofollow'; + } + + return $aAttrs; + } +} + -- cgit v1.2.3-54-g00ecf From 2882e40540b6ca0aaeb7b9e1841622cf0442ae3d Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 5 Apr 2010 11:03:14 -0400 Subject: nofollow for peopletag pages --- actions/peopletag.php | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) (limited to 'actions') diff --git a/actions/peopletag.php b/actions/peopletag.php index 4ba1dc0f1..af40b9d82 100644 --- a/actions/peopletag.php +++ b/actions/peopletag.php @@ -32,8 +32,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -require_once INSTALLDIR.'/lib/profilelist.php'; - /** * This class outputs a paginated list of profiles self-tagged with a given tag * @@ -124,8 +122,8 @@ class PeopletagAction extends Action $profile->query(sprintf($qry, $this->tag, $lim)); - $pl = new ProfileList($profile, $this); - $cnt = $pl->show(); + $ptl = new PeopleTagList($profile, $this); // pass the ammunition + $cnt = $ptl->show(); $this->pagination($this->page > 1, $cnt > PROFILES_PER_PAGE, @@ -146,3 +144,41 @@ class PeopletagAction extends Action } } + +class PeopleTagList extends ProfileList +{ + function newListItem($profile) + { + return new PeopleTagListItem($profile, $this->action); + } +} + +class PeopleTagListItem extends ProfileListItem +{ + function linkAttributes() + { + $aAttrs = parent::linkAttributes(); + + if (common_config('nofollow', 'peopletag')) { + $aAttrs['rel'] .= ' nofollow'; + } + + return $aAttrs; + } + + function showHomepage() + { + if (!empty($this->profile->homepage)) { + $this->out->text(' '); + $aAttrs = array('href' => $this->profile->homepage, + 'class' => 'url'); + if (common_config('nofollow', 'peopletag')) { + $aAttrs['rel'] = 'nofollow'; + } + $this->out->elementStart('a', $aAttrs); + $this->out->raw($this->highlight($this->profile->homepage)); + $this->out->elementEnd('a'); + } + } +} + -- cgit v1.2.3-54-g00ecf From 95229bc7a060bb6289aa9b7950f4e69acd96a1e7 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 5 Apr 2010 11:17:36 -0400 Subject: use homepage link attributes method for peopletaglist --- actions/peopletag.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'actions') diff --git a/actions/peopletag.php b/actions/peopletag.php index af40b9d82..456cc21c4 100644 --- a/actions/peopletag.php +++ b/actions/peopletag.php @@ -166,18 +166,10 @@ class PeopleTagListItem extends ProfileListItem return $aAttrs; } - function showHomepage() + function homepageAttributes() { - if (!empty($this->profile->homepage)) { - $this->out->text(' '); - $aAttrs = array('href' => $this->profile->homepage, - 'class' => 'url'); - if (common_config('nofollow', 'peopletag')) { - $aAttrs['rel'] = 'nofollow'; - } - $this->out->elementStart('a', $aAttrs); - $this->out->raw($this->highlight($this->profile->homepage)); - $this->out->elementEnd('a'); + if (common_config('nofollow', 'peopletag')) { + $aAttrs['rel'] = 'nofollow'; } } } -- cgit v1.2.3-54-g00ecf From 16827a66bab59964f315d39a305ddac19a8f2f18 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 5 Apr 2010 11:17:51 -0400 Subject: use nofollow for group members list --- actions/groupmembers.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'actions') diff --git a/actions/groupmembers.php b/actions/groupmembers.php index a16debd7b..fb4e46dbc 100644 --- a/actions/groupmembers.php +++ b/actions/groupmembers.php @@ -212,6 +212,7 @@ class GroupMemberListItem extends ProfileListItem } } + function showGroupBlockForm() { $user = common_current_user(); @@ -224,7 +225,24 @@ class GroupMemberListItem extends ProfileListItem $bf->show(); $this->out->elementEnd('li'); } + } + + function linkAttributes() + { + $aAttrs = parent::linkAttributes(); + + if (common_config('nofollow', 'members')) { + $aAttrs['rel'] .= ' nofollow'; + } + + return $aAttrs; + } + function homepageAttributes() + { + if (common_config('nofollow', 'members')) { + $aAttrs['rel'] = 'nofollow'; + } } } -- cgit v1.2.3-54-g00ecf From 2a489018b11838280ef0c74f6727d5b9c0c10a0f Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 5 Apr 2010 11:18:03 -0400 Subject: use nofollow for subscribers list --- actions/subscribers.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'actions') diff --git a/actions/subscribers.php b/actions/subscribers.php index 4bced6284..6dda7312d 100644 --- a/actions/subscribers.php +++ b/actions/subscribers.php @@ -163,4 +163,22 @@ class SubscribersListItem extends SubscriptionListItem $bf->show(); } } + + function linkAttributes() + { + $aAttrs = parent::linkAttributes(); + + if (common_config('nofollow', 'subscribers')) { + $aAttrs['rel'] .= ' nofollow'; + } + + return $aAttrs; + } + + function homepageAttributes() + { + if (common_config('nofollow', 'subscribers')) { + $aAttrs['rel'] = 'nofollow'; + } + } } -- cgit v1.2.3-54-g00ecf