diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 785aa141f0..02fb3ed08d 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -1301,6 +1301,20 @@ phpbb.toggleDropdown = function() { if (direction == 'left') { options.dropdown.css('margin-left', '-' + freeSpace + 'px'); + + // Try to position the notification dropdown correctly in RTL-responsive mode + if (options.dropdown.hasClass('dropdown-extended')) { + var contentWidth, + fullFreeSpace = freeSpace + parent.outerWidth(); + + options.dropdown.find('.dropdown-contents').each(function() { + contentWidth = parseInt($(this).outerWidth()); + $(this).css({marginLeft: 0, left: 0}); + }); + + var maxOffset = Math.min(contentWidth, fullFreeSpace) + 'px'; + options.dropdown.css({'width': maxOffset, 'margin-left': '-' + maxOffset}); + } } else { options.dropdown.css('margin-right', '-' + (windowWidth + freeSpace) + 'px'); } diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 34f2c4b6ec..f1c03672c3 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -246,21 +246,21 @@ index_body_block_stats_prepend * Since: 3.1.0-b3 * Purpose: Prepend content to the statistics list on the Board index -index_body_linklist_after +index_body_markforums_after === * Locations: + styles/prosilver/template/index_body.html + styles/subsilver2/template/index_body.html -* Since: 3.1.0-a3 -* Purpose: Add content after the linklist above the forum list on Board index +* Since: 3.1.0-RC2 +* Purpose: Add content after the mark-read link above the forum list on Board index -index_body_linklist_before +index_body_markforums_before === * Locations: + styles/prosilver/template/index_body.html + styles/subsilver2/template/index_body.html -* Since: 3.1.0-a3 -* Purpose: Add content before the linklist above the forum list on Board index +* Since: 3.1.0-RC2 +* Purpose: Add content before the mark-read link above the forum list on Board index index_body_stat_blocks_after === @@ -344,25 +344,54 @@ memberlist_view_user_statistics_before * Since: 3.1.0-a1 * Purpose: Add entries before the user statistics part of any user profile -navbar_header_username_append -=== -* Locations: - + styles/prosilver/template/navbar_header.html -* Since: 3.1.0-b4 -* Purpose: Add text and HTMl after the username shown in the navbar. - navbar_header_logged_out_content === * Locations: + styles/prosilver/template/navbar_header.html -* Since: 3.1.0-b4 +* Since: 3.1.0-RC1 * Purpose: Add text and HTML in place of the username when not logged in. +navbar_header_profile_list_after +=== +* Locations: + + styles/prosilver/template/navbar_header.html +* Since: 3.1.0-RC2 +* Purpose: Add links to the bottom of the profile drop-down menu in the header navbar + +navbar_header_profile_list_before +=== +* Locations: + + styles/prosilver/template/navbar_header.html +* Since: 3.1.0-RC2 +* Purpose: Add links to the top of the profile drop-down menu in the header navbar + +navbar_header_quick_links_after +=== +* Locations: + + styles/prosilver/template/navbar_header.html +* Since: 3.1.0-RC2 +* Purpose: Add links to the bottom of the quick-links drop-down menu in the header + +navbar_header_quick_links_before +=== +* Locations: + + styles/prosilver/template/navbar_header.html +* Since: 3.1.0-RC2 +* Purpose: Add links to the top of the quick-links drop-down menu in the header + +navbar_header_username_append +=== +* Locations: + + styles/prosilver/template/navbar_header.html +* Since: 3.1.0-RC1 +* Purpose: Add text and HTMl after the username shown in the navbar. + navbar_header_username_prepend === * Locations: + styles/prosilver/template/navbar_header.html -* Since: 3.1.0-b4 +* Since: 3.1.0-RC1 +* Purpose: Add text and HTMl before the username shown in the navbar. overall_footer_after === diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 0838f2008e..48cd30e0a4 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4912,6 +4912,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id = 'PRIVATE_MESSAGE_COUNT' => (!empty($user->data['user_unread_privmsg'])) ? $user->data['user_unread_privmsg'] : 0, 'CURRENT_USER_AVATAR' => phpbb_get_user_avatar($user->data), + 'CURRENT_USERNAME_SIMPLE' => get_username_string('no_profile', $user->data['user_id'], $user->data['username'], $user->data['user_colour']), 'CURRENT_USERNAME_FULL' => get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']), 'UNREAD_NOTIFICATIONS_COUNT' => ($notifications !== false) ? $notifications['unread_count'] : '', 'NOTIFICATIONS_COUNT' => ($notifications !== false) ? $notifications['unread_count'] : '', diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 74b3e0c70f..09bd3e6cdb 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1334,9 +1334,9 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', global $phpbb_root_path, $phpEx; $_profile_cache['base_url'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u={USER_ID}'); - $_profile_cache['tpl_noprofile'] = '{USERNAME}'; + $_profile_cache['tpl_noprofile'] = '{USERNAME}'; $_profile_cache['tpl_noprofile_colour'] = '{USERNAME}'; - $_profile_cache['tpl_profile'] = '{USERNAME}'; + $_profile_cache['tpl_profile'] = '{USERNAME}'; $_profile_cache['tpl_profile_colour'] = '{USERNAME}'; } diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 61baef663b..dbef16c5f2 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -64,7 +64,7 @@ $lang = array_merge($lang, array( 'ACCOUNT_DEACTIVATED' => 'Your account has been manually deactivated and is only able to be reactivated by an administrator.', 'ACCOUNT_NOT_ACTIVATED' => 'Your account has not been activated yet.', 'ACP' => 'Administration Control Panel', - 'ACP_SHORT' => 'Administer', + 'ACP_SHORT' => 'ACP', 'ACTIVE' => 'active', 'ACTIVE_ERROR' => 'The specified username is currently inactive. If you have problems activating your account, please contact a board administrator.', 'ADMINISTRATOR' => 'Administrator', @@ -393,7 +393,7 @@ $lang = array_merge($lang, array( 'MB' => 'MB', 'MIB' => 'MiB', 'MCP' => 'Moderator Control Panel', - 'MCP_SHORT' => 'Moderate', + 'MCP_SHORT' => 'MCP', 'MEMBERLIST' => 'Members', 'MEMBERLIST_EXPLAIN' => 'View complete list of members', 'MERGE' => 'Merge', @@ -595,6 +595,8 @@ $lang = array_merge($lang, array( 'PRIVATE_MESSAGING' => 'Private messaging', 'PROFILE' => 'User Control Panel', + 'QUICK_LINKS' => 'Quick links', + 'RANK' => 'Rank', 'READING_FORUM' => 'Viewing topics in %s', 'READING_GLOBAL_ANNOUNCE' => 'Reading global announcement', @@ -661,15 +663,15 @@ $lang = array_merge($lang, array( 'SEARCH_ADV_EXPLAIN' => 'View the advanced search options', 'SEARCH_KEYWORDS' => 'Search for keywords', 'SEARCHING_FORUMS' => 'Searching forums', - 'SEARCH_ACTIVE_TOPICS' => 'View active topics', + 'SEARCH_ACTIVE_TOPICS' => 'Active topics', 'SEARCH_FOR' => 'Search for', 'SEARCH_FORUM' => 'Search this forum…', - 'SEARCH_NEW' => 'View new posts', + 'SEARCH_NEW' => 'New posts', 'SEARCH_POSTS_BY' => 'Search posts by', - 'SEARCH_SELF' => 'View your posts', + 'SEARCH_SELF' => 'Your posts', 'SEARCH_TOPIC' => 'Search this topic…', - 'SEARCH_UNANSWERED' => 'View unanswered posts', - 'SEARCH_UNREAD' => 'View unread posts', + 'SEARCH_UNANSWERED' => 'Unanswered posts', + 'SEARCH_UNREAD' => 'Unread posts', 'SEARCH_USER_POSTS' => 'Search user’s posts', 'SECONDS' => 'Seconds', 'SEE_ALL' => 'See All', diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index ea2b815e77..4929e14ef7 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -382,10 +382,7 @@ function parse_document(container) */ if (oldBrowser) { // Fix .linklist.bulletin lists - container.find('ul.linklist.bulletin li:first-child, ul.linklist.bulletin li.rightside:last-child').addClass('no-bulletin'); - - // Do not run functions below for old browsers - return; + container.find('ul.linklist.bulletin > li:first-child, ul.linklist.bulletin > li.rightside:last-child').addClass('no-bulletin'); } /** @@ -482,6 +479,167 @@ function parse_document(container) $(window).resize(check); }); + /** + * Responsive link lists + */ + container.find('.linklist:not(.navlinks, [data-skip-responsive]), .postbody .post-buttons:not([data-skip-responsive])').each(function() { + var $this = $(this), + $body = $('body'), + filterSkip = '.breadcrumbs, [data-skip-responsive]', + filterLast = '.edit-icon, .quote-icon, [data-last-responsive]', + persist = $this.attr('id') == 'nav-main', + allLinks = $this.children(), + links = allLinks.not(filterSkip), + html = '', + filterLastList = links.filter(filterLast), + slack = 1; // Vertical slack space (in pixels). Determines how sensitive the script is in determining whether a line-break has occured. + + if (!persist) { + if (links.is('.rightside')) + { + links.filter('.rightside:first').before(html); + $this.children('.responsive-menu').addClass('rightside'); + } + else + { + $this.append(html); + } + } + + var item = $this.children('.responsive-menu'), + menu = item.find('.dropdown-contents'), + lastWidth = false, + compact = false, + responsive = false, + copied = false; + + function check() { + var width = $body.width(); + if (responsive && width <= lastWidth) { + return; + } + + // Unhide the quick-links menu if it has content + if (persist) { + item.addClass('hidden'); + if (menu.find('li:not(.separator, .clone)').length || (responsive && menu.find('li.clone').length)) { + item.removeClass('hidden'); + } + } + + // Reset responsive and compact layout + if (responsive) { + responsive = false; + $this.removeClass('responsive'); + links.css('display', ''); + if (!persist) item.css('display', 'none'); + } + + if (compact) { + compact = false; + $this.removeClass('compact'); + } + + // Find tallest element + var maxHeight = 0; + allLinks.each(function() { + if (!$(this).height()) return; + maxHeight = Math.max(maxHeight, $(this).outerHeight(true)); + }); + + if (maxHeight < 1) { + return; + } + + // Nothing to resize if block's height is not bigger than tallest element's height + if ($this.height() <= (maxHeight + slack)) { + return; + } + + // Enable compact layout, find tallest element, compare to height of whole block + compact = true; + $this.addClass('compact'); + + var compactMaxHeight = 0; + allLinks.each(function() { + if (!$(this).height()) return; + compactMaxHeight = Math.max(compactMaxHeight, $(this).outerHeight(true)); + }); + + if ($this.height() <= (maxHeight + slack)) { + return; + } + + // Compact layout did not resize block enough, switch to responsive layout + compact = false; + $this.removeClass('compact'); + responsive = true; + + if (!copied) { + var clone = links.clone(true); + clone.filter('.rightside').each(function() { + if (persist) $(this).addClass('clone'); + menu.prepend(this); + }); + + if (persist) { + menu.prepend(clone.not('.rightside').addClass('clone')); + } else { + menu.prepend(clone.not('.rightside')); + } + + menu.find('li.leftside, li.rightside').removeClass('leftside rightside'); + menu.find('.inputbox').parents('li:first').css('white-space', 'normal'); + + if ($this.hasClass('post-buttons')) { + $('.button', menu).removeClass('button icon-button'); + $('.responsive-menu-link', item).addClass('button icon-button').prepend(''); + } + copied = true; + } + else { + menu.children().css('display', ''); + } + + item.css('display', ''); + $this.addClass('responsive'); + + // Try to not hide filtered items + if (filterLastList.length) { + links.not(filterLast).css('display', 'none'); + + maxHeight = 0; + filterLastList.each(function() { + if (!$(this).height()) return; + maxHeight = Math.max(maxHeight, $(this).outerHeight(true)); + }); + + if ($this.height() <= (maxHeight + slack)) { + menu.children().filter(filterLast).css('display', 'none'); + return; + } + } + + // If even responsive isn't enough, use both responsive and compact at same time + compact = true; + $this.addClass('compact'); + + links.css('display', 'none'); + } + + if (!persist) phpbb.registerDropdown(item.find('a.responsive-menu-link'), item.find('.dropdown')); + + check(); + $(window).resize(check); + }); + + /** + * Do not run functions below for old browsers + */ + if (oldBrowser) { + return; + } + /** * Adjust topiclist lists with check boxes */ @@ -666,136 +824,6 @@ function parse_document(container) } }); - /** - * Responsive link lists - */ - container.find('.linklist:not(.navlinks, [data-skip-responsive]), .postbody .post-buttons:not([data-skip-responsive])').each(function() { - var $this = $(this), - $body = $('body'), - filterSkip = '.breadcrumbs, [data-skip-responsive]', - filterLast = '.pagination, .icon-notifications, .icon-pm, .icon-logout, .icon-login, .mark-read, .edit-icon, .quote-icon', - allLinks = $this.children(), - links = allLinks.not(filterSkip), - html = '', - filterLastList = links.filter(filterLast); - - if (links.is('.rightside')) - { - links.filter('.rightside:first').before(html); - } - else - { - $this.append(html); - } - - var item = $this.children('.responsive-menu'), - menu = item.find('.dropdown-contents'), - lastWidth = false, - compact = false, - responsive = false, - copied = false; - - function check() { - var width = $body.width(); - if (responsive && width <= lastWidth) { - return; - } - - // Reset responsive and compact layout - if (responsive) { - responsive = false; - $this.removeClass('responsive'); - links.css('display', ''); - item.css('display', 'none'); - } - - if (compact) { - compact = false; - $this.removeClass('compact'); - } - - // Find tallest element - var maxHeight = 0; - allLinks.each(function() { - if (!$(this).height()) return; - maxHeight = Math.max(maxHeight, $(this).outerHeight(true)); - }); - - if (maxHeight < 1) { - return; - } - - // Nothing to resize if block's height is not bigger than tallest element's height - if ($this.height() <= maxHeight) { - return; - } - - // Enable compact layout, find tallest element, compare to height of whole block - compact = true; - $this.addClass('compact'); - - var compactMaxHeight = 0; - allLinks.each(function() { - if (!$(this).height()) return; - compactMaxHeight = Math.max(compactMaxHeight, $(this).outerHeight(true)); - }); - - if ($this.height() <= maxHeight) { - return; - } - - // Compact layout did not resize block enough, switch to responsive layout - compact = false; - $this.removeClass('compact'); - responsive = true; - - if (!copied) { - var clone = links.clone(true); - clone.filter('.rightside').each(function() { - menu.prepend(this); - }); - menu.prepend(clone.not('.rightside')); - menu.find('li.leftside, li.rightside').removeClass('leftside rightside'); - menu.find('.inputbox').parents('li:first').css('white-space', 'normal'); - - if ($this.hasClass('post-buttons')) { - $('.button', menu).removeClass('button icon-button'); - $('.responsive-menu-link', item).addClass('button icon-button').prepend(''); - } - copied = true; - } - else { - menu.children().css('display', ''); - } - - item.css('display', ''); - $this.addClass('responsive'); - - // Try to not hide filtered items - if (filterLastList.length) { - links.not(filterLast).css('display', 'none'); - - maxHeight = 0; - filterLastList.each(function() { - if (!$(this).height()) return; - maxHeight = Math.max(maxHeight, $(this).outerHeight(true)); - }); - - if ($this.height() <= maxHeight) { - menu.children().filter(filterLast).css('display', 'none'); - return; - } - } - - links.css('display', 'none'); - } - - phpbb.registerDropdown(item.find('a.responsive-menu-link'), item.find('.dropdown')); - - check(); - $(window).resize(check); - }); - /** * Responsive tabs */ diff --git a/phpBB/styles/prosilver/template/index_body.html b/phpBB/styles/prosilver/template/index_body.html index f9c5b4cf20..1e1eb22c6f 100644 --- a/phpBB/styles/prosilver/template/index_body.html +++ b/phpBB/styles/prosilver/template/index_body.html @@ -1,27 +1,15 @@ -

{LAST_VISIT_DATE}{CURRENT_TIME}

-

{CURRENT_TIME}
{L_ACP} | {L_MCP} ]

+

{LAST_VISIT_DATE}{CURRENT_TIME}

+

{CURRENT_TIME}

- - - - + + +
+ {L_MARK_FORUMS_READ} +
- - + diff --git a/phpBB/styles/prosilver/template/navbar_footer.html b/phpBB/styles/prosilver/template/navbar_footer.html index e2259e8712..65a7cdddba 100644 --- a/phpBB/styles/prosilver/template/navbar_footer.html +++ b/phpBB/styles/prosilver/template/navbar_footer.html @@ -1,23 +1,25 @@