mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/13713] Do not show user's own name in the dropdown list
PHPBB3-13713
This commit is contained in:
parent
aee1dfd837
commit
6f8467a2fa
5 changed files with 16 additions and 7 deletions
|
@ -13,7 +13,7 @@
|
|||
<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/editor.js -->
|
||||
|
||||
<!-- EVENT acp_posting_buttons_before -->
|
||||
<div id="format-buttons"<!-- IF S_ALLOW_MENTIONS --> data-mention-url="{U_MENTION_URL}" data-mention-names-limit="{S_MENTION_NAMES_LIMIT}" data-mention-batch-size="{S_MENTION_BATCH_SIZE}" data-topic-id="{S_TOPIC_ID}"<!-- ENDIF -->>
|
||||
<div id="format-buttons"<!-- IF S_ALLOW_MENTIONS --> data-mention-url="{U_MENTION_URL}" data-mention-names-limit="{S_MENTION_NAMES_LIMIT}" data-mention-batch-size="{S_MENTION_BATCH_SIZE}" data-topic-id="{S_TOPIC_ID}" data-user-id="{S_USER_ID}"<!-- ENDIF -->>
|
||||
<input type="button" class="button2" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onclick="bbstyle(0)" title="{L_BBCODE_B_HELP}" />
|
||||
<input type="button" class="button2" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onclick="bbstyle(2)" title="{L_BBCODE_I_HELP}" />
|
||||
<input type="button" class="button2" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onclick="bbstyle(4)" title="{L_BBCODE_U_HELP}" />
|
||||
|
|
|
@ -391,6 +391,7 @@ function getCaretPosition(txtarea) {
|
|||
let mentionBatchSize = $mentionDataContainer.data('mentionBatchSize');
|
||||
let mentionNamesLimit = $mentionDataContainer.data('mentionNamesLimit');
|
||||
let mentionTopicId = $mentionDataContainer.data('topicId');
|
||||
let mentionUserId = $mentionDataContainer.data('userId');
|
||||
let queryInProgress = null;
|
||||
let cachedNames = [];
|
||||
let cachedSearchKey = 'name';
|
||||
|
@ -505,14 +506,20 @@ function getCaretPosition(txtarea) {
|
|||
for (i = 0, len = items.length; i < len; i++) {
|
||||
let item = items[i];
|
||||
|
||||
// Exact matches should not be prioritised - they always come first
|
||||
if (item.name === query) {
|
||||
_exactMatch.push(items[i]);
|
||||
// Check for unsupported type - in general, this should never happen
|
||||
if (!_unsorted[item.type]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check for unsupported type - in general, this should never happen
|
||||
if (!_unsorted[item.type]) {
|
||||
// Current user doesn't want to mention themselves with "@" in most cases -
|
||||
// do not waste list space with their own name
|
||||
if (item.type === 'u' && item.id === String(mentionUserId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Exact matches should not be prioritised - they always come first
|
||||
if (item.name === query) {
|
||||
_exactMatch.push(items[i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -3972,6 +3972,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
|
|||
'S_REGISTER_ENABLED' => ($config['require_activation'] != USER_ACTIVATION_DISABLE) ? true : false,
|
||||
'S_FORUM_ID' => $forum_id,
|
||||
'S_TOPIC_ID' => $topic_id,
|
||||
'S_USER_ID' => $user->data['user_id'],
|
||||
|
||||
'S_LOGIN_ACTION' => ((!defined('ADMIN_START')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') : append_sid("{$phpbb_admin_path}index.$phpEx", false, true, $user->session_id)),
|
||||
'S_LOGIN_REDIRECT' => $s_login_redirect,
|
||||
|
|
|
@ -116,6 +116,7 @@ function adm_page_header($page_title)
|
|||
'ICON_SYNC' => '<i class="icon acp-icon acp-icon-resync fa-refresh fa-fw" title="' . $user->lang('RESYNC') . '"></i>',
|
||||
'ICON_SYNC_DISABLED' => '<i class="icon acp-icon acp-icon-disabled fa-refresh fa-fw" title="' . $user->lang('RESYNC') . '"></i>',
|
||||
|
||||
'S_USER_ID' => $user->data['user_id'],
|
||||
'S_USER_LANG' => $user->lang['USER_LANG'],
|
||||
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
|
||||
'S_CONTENT_ENCODING' => 'UTF-8',
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
</div>
|
||||
|
||||
<!-- EVENT posting_editor_buttons_before -->
|
||||
<div id="format-buttons" class="format-buttons"<!-- IF S_ALLOW_MENTIONS --> data-mention-url="{U_MENTION_URL}" data-mention-names-limit="{S_MENTION_NAMES_LIMIT}" data-mention-batch-size="{S_MENTION_BATCH_SIZE}" data-topic-id="{S_TOPIC_ID}"<!-- ENDIF -->>
|
||||
<div id="format-buttons" class="format-buttons"<!-- IF S_ALLOW_MENTIONS --> data-mention-url="{U_MENTION_URL}" data-mention-names-limit="{S_MENTION_NAMES_LIMIT}" data-mention-batch-size="{S_MENTION_BATCH_SIZE}" data-topic-id="{S_TOPIC_ID}" data-user-id="{S_USER_ID}"<!-- ENDIF -->>
|
||||
<button type="button" class="button button-icon-only bbcode-b" accesskey="b" name="addbbcode0" value=" B " onclick="bbstyle(0)" title="{L_BBCODE_B_HELP}">
|
||||
{{ Icon('iconify', 'mdi:format-bold', '', true, 'c-button-icon') }}
|
||||
</button>
|
||||
|
|
Loading…
Add table
Reference in a new issue