Improved keyboard-based navigation
authorMarcel Werk <burntime@woltlab.com>
Sun, 31 Aug 2014 22:36:51 +0000 (00:36 +0200)
committerMarcel Werk <burntime@woltlab.com>
Sun, 31 Aug 2014 22:36:51 +0000 (00:36 +0200)
com.woltlab.wcf/templates/messageSidebar.tpl
com.woltlab.wcf/templates/user.tpl
com.woltlab.wcf/templates/userInformationButtons.tpl
com.woltlab.wcf/templates/userSidebar.tpl
wcfsetup/install/files/js/WCF.User.js

index be785a106cf030384aad5c833da3b1cc9eb8facc..7e493711d400947bae2e1987bbe340185e5db451 100644 (file)
@@ -76,7 +76,7 @@
                                                        {/if}
                                                        
                                                        {if MESSAGE_SIDEBAR_ENABLE_ACTIVITY_POINTS && $userProfile->activityPoints}
-                                                               <dt><a class="activityPointsDisplay jsTooltip" title="{lang user=$userProfile}wcf.user.activityPoint.showActivityPoints{/lang}" data-user-id="{@$userProfile->userID}">{lang}wcf.user.activityPoint{/lang}</a></dt>
+                                                               <dt><a href="#" class="activityPointsDisplay jsTooltip" title="{lang user=$userProfile}wcf.user.activityPoint.showActivityPoints{/lang}" data-user-id="{@$userProfile->userID}">{lang}wcf.user.activityPoint{/lang}</a></dt>
                                                                <dd>{#$userProfile->activityPoints}</dd>
                                                        {/if}
                                                        {event name='userCredits'}
index e4be82e01834320535bf19a0dd900038437d3706..55bc7962a726862538f61e2e8bf2d5127d4afe02 100644 (file)
                <ul id="profileButtonContainer" class="buttonGroup">
                        {hascontent}
                                <li class="dropdown">
-                                       <a class="button dropdownToggle jsTooltip" title="{lang}wcf.user.searchUserContent{/lang}"><span class="icon icon16 icon-search"></span> <span class="invisible">{lang}wcf.user.searchUserContent{/lang}</span></a>
+                                       <a href="#" class="button dropdownToggle jsTooltip" title="{lang}wcf.user.searchUserContent{/lang}"><span class="icon icon16 icon-search"></span> <span class="invisible">{lang}wcf.user.searchUserContent{/lang}</span></a>
                                        <ul class="dropdownMenu">
                                                {content}
                                                        {event name='quickSearchItems'}
                        {/hascontent}
                        
                        {if $__wcf->session->getPermission('user.profile.canReportContent')}
-                               <li class="jsReportUser jsOnly" data-object-id="{@$user->userID}"><a title="{lang}wcf.user.profile.report{/lang}" class="button jsTooltip"><span class="icon icon16 icon-warning-sign"></span> <span class="invisible">{lang}wcf.user.profile.report{/lang}</span></a></li>
+                               <li class="jsReportUser jsOnly" data-object-id="{@$user->userID}"><a href="#" title="{lang}wcf.user.profile.report{/lang}" class="button jsTooltip"><span class="icon icon16 icon-warning-sign"></span> <span class="invisible">{lang}wcf.user.profile.report{/lang}</span></a></li>
                        {/if}
                        
                        {if $user->userID != $__wcf->user->userID}
index 6f72153d9add36c3b0bfbaf70c1f96434f471063..9f3adf21c73cfc30192880ed7c2f537996fd61d4 100644 (file)
                                
                                {if $__wcf->user->userID && $user->userID != $__wcf->user->userID}
                                        {if $__wcf->getUserProfileHandler()->isFollowing($user->userID)}
-                                               <li class="jsOnly"><a data-following="1" data-object-id="{@$user->userID}" class="jsFollowButton jsTooltip" title="{lang}wcf.user.button.unfollow{/lang}"><span class="icon icon16 icon-minus"></span> <span class="invisible">{lang}wcf.user.button.unfollow{/lang}</span></a></li>
+                                               <li class="jsOnly"><a href="#" data-following="1" data-object-id="{@$user->userID}" class="jsFollowButton jsTooltip" title="{lang}wcf.user.button.unfollow{/lang}"><span class="icon icon16 icon-minus"></span> <span class="invisible">{lang}wcf.user.button.unfollow{/lang}</span></a></li>
                                        {else}
-                                               <li class="jsOnly"><a data-following="0" data-object-id="{@$user->userID}" class="jsFollowButton jsTooltip" title="{lang}wcf.user.button.follow{/lang}"><span class="icon icon16 icon-plus"></span> <span class="invisible">{lang}wcf.user.button.follow{/lang}</span></a></li>
+                                               <li class="jsOnly"><a href="#" data-following="0" data-object-id="{@$user->userID}" class="jsFollowButton jsTooltip" title="{lang}wcf.user.button.follow{/lang}"><span class="icon icon16 icon-plus"></span> <span class="invisible">{lang}wcf.user.button.follow{/lang}</span></a></li>
                                        {/if}
                                        
                                        {*if !$user->getPermission('user.profile.cannotBeIgnored')*}{*disabled for performance reasons*}
                                                {if $__wcf->getUserProfileHandler()->isIgnoredUser($user->userID)}
-                                                       <li class="jsOnly"><a data-ignored="1" data-object-id="{@$user->userID}" class="jsIgnoreButton jsTooltip" title="{lang}wcf.user.button.unignore{/lang}"><span class="icon icon16 icon-circle-blank"></span> <span class="invisible">{lang}wcf.user.button.unignore{/lang}</span></a></li>
+                                                       <li class="jsOnly"><a href="#" data-ignored="1" data-object-id="{@$user->userID}" class="jsIgnoreButton jsTooltip" title="{lang}wcf.user.button.unignore{/lang}"><span class="icon icon16 icon-circle-blank"></span> <span class="invisible">{lang}wcf.user.button.unignore{/lang}</span></a></li>
                                                {else}
-                                                       <li class="jsOnly"><a data-ignored="0" data-object-id="{@$user->userID}" class="jsIgnoreButton jsTooltip" title="{lang}wcf.user.button.ignore{/lang}"><span class="icon icon16 icon-ban-circle"></span> <span class="invisible">{lang}wcf.user.button.ignore{/lang}</span></a></li>
+                                                       <li class="jsOnly"><a href="#" data-ignored="0" data-object-id="{@$user->userID}" class="jsIgnoreButton jsTooltip" title="{lang}wcf.user.button.ignore{/lang}"><span class="icon icon16 icon-ban-circle"></span> <span class="invisible">{lang}wcf.user.button.ignore{/lang}</span></a></li>
                                                {/if}
                                        {*/if*}
                                {/if}
index 995c653e059fea79fdc2d9a67dc946ec24f5b592..032411f84f3843bb9ac9ed189150274c3ebfb69c 100644 (file)
@@ -24,7 +24,7 @@
                                {/if}
                                
                                {if $user->activityPoints}
-                                       <dt>{if $user->activityPoints}<a class="activityPointsDisplay jsTooltip" title="{lang}wcf.user.activityPoint.showActivityPoints{/lang}" data-user-id="{@$user->userID}">{lang}wcf.user.activityPoint{/lang}</a>{else}{lang}wcf.user.activityPoint{/lang}{/if}</dt>
+                                       <dt>{if $user->activityPoints}<a href="#" class="activityPointsDisplay jsTooltip" title="{lang}wcf.user.activityPoint.showActivityPoints{/lang}" data-user-id="{@$user->userID}">{lang}wcf.user.activityPoint{/lang}</a>{else}{lang}wcf.user.activityPoint{/lang}{/if}</dt>
                                        <dd>{#$user->activityPoints}</dd>
                                {/if}
                                
index 6c3bb8d49e593656d5d1bf78771bbbc930d5e72e..c17e4e63824194cac12591fa4e44f2d235eec4e6 100644 (file)
@@ -237,6 +237,7 @@ WCF.User.Profile.ActivityPointList = {
         * @param       object          event
         */
        _click: function(event) {
+               event.preventDefault();
                var $userID = $(event.currentTarget).data('userID');
                
                if (this._cache[$userID] === undefined) {
@@ -335,14 +336,15 @@ WCF.User.Profile.Follow = Class.extend({
         * Creates the (un-)follow button
         */
        _createButton: function () {
-               this._button = $('<li id="followUser"><a class="button jsTooltip" title="'+WCF.Language.get('wcf.user.button.'+(this._following ? 'un' : '')+'follow')+'"><span class="icon icon16 icon-plus"></span> <span class="invisible">'+WCF.Language.get('wcf.user.button.'+(this._following ? 'un' : '')+'follow')+'</span></a></li>').prependTo($('#profileButtonContainer'));
+               this._button = $('<li id="followUser"><a href="#" class="button jsTooltip" title="'+WCF.Language.get('wcf.user.button.'+(this._following ? 'un' : '')+'follow')+'"><span class="icon icon16 icon-plus"></span> <span class="invisible">'+WCF.Language.get('wcf.user.button.'+(this._following ? 'un' : '')+'follow')+'</span></a></li>').prependTo($('#profileButtonContainer'));
                this._button.click($.proxy(this._execute, this));
        },
        
        /**
         * Follows or unfollows an user.
         */
-       _execute: function () {
+       _execute: function (event) {
+               event.preventDefault();
                var $actionName = (this._following) ? 'unfollow' : 'follow';
                this._proxy.setOption('data', {
                        'actionName': $actionName,
@@ -438,7 +440,8 @@ WCF.User.Profile.IgnoreUser = Class.extend({
        /**
         * Handle clicks, might cause 'ignore' or 'unignore' to be triggered.
         */
-       _click: function() {
+       _click: function(event) {
+               event.preventDefault();
                var $action = (this._isIgnoredUser) ? 'unignore' : 'ignore';
                
                this._proxy.setOption('data', {
@@ -474,7 +477,7 @@ WCF.User.Profile.IgnoreUser = Class.extend({
         */
        _updateButton: function() {
                if (this._button === null) {
-                       this._button = $('<li id="ignoreUser"><a class="button jsTooltip" title="'+WCF.Language.get('wcf.user.button.'+(this._isIgnoredUser ? 'un' : '')+'ignore')+'"><span class="icon icon16 icon-ban-circle"></span> <span class="invisible">'+WCF.Language.get('wcf.user.button.'+(this._isIgnoredUser ? 'un' : '')+'ignore')+'</span></a></li>').prependTo($('#profileButtonContainer'));
+                       this._button = $('<li id="ignoreUser"><a href="#" class="button jsTooltip" title="'+WCF.Language.get('wcf.user.button.'+(this._isIgnoredUser ? 'un' : '')+'ignore')+'"><span class="icon icon16 icon-ban-circle"></span> <span class="invisible">'+WCF.Language.get('wcf.user.button.'+(this._isIgnoredUser ? 'un' : '')+'ignore')+'</span></a></li>').prependTo($('#profileButtonContainer'));
                }
                
                this._button.find('.button').data('tooltip', WCF.Language.get('wcf.user.button.' + (this._isIgnoredUser ? 'un' : '') + 'ignore'));
@@ -2004,6 +2007,7 @@ WCF.User.Action.Follow = Class.extend({
         * @param       object          event
         */
        _click: function(event) {
+               event.preventDefault();
                var link = $(event.target);
                if (!link.is('a')) {
                        link = link.closest('a');
@@ -2116,6 +2120,7 @@ WCF.User.Action.Ignore = Class.extend({
         * @param       object          event
         */
        _click: function(event) {
+               event.preventDefault();
                var link = $(event.target);
                if (!link.is('a')) {
                        link = link.closest('a');