Skip to content

Commit

Permalink
nuke tab index
Browse files Browse the repository at this point in the history
Signed-off-by: John Rayes <live627@gmail.com>
  • Loading branch information
live627 committed Dec 27, 2023
1 parent 6141af3 commit b7c6385
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 56 deletions.
18 changes: 9 additions & 9 deletions Themes/default/Calendar.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -756,12 +756,12 @@ function template_calendar_top($calendar_data)

echo '
<form action="', Config::$scripturl, '?action=calendar;', Utils::$context['calendar_view'], '" id="', !empty($calendar_data['end_date']) ? 'calendar_range' : 'calendar_navigation', '" method="post" accept-charset="', Utils::$context['character_set'], '">
<input type="text" name="start_date" id="start_date" value="', trim($calendar_data['start_date']), '" tabindex="', Utils::$context['tabindex']++, '" class="date_input start" data-type="date">';
<input type="text" name="start_date" id="start_date" value="', trim($calendar_data['start_date']), '" class="date_input start" data-type="date">';

if (!empty($calendar_data['end_date']))
echo '
<span>', strtolower(Lang::$txt['to']), '</span>
<input type="text" name="end_date" id="end_date" value="', trim($calendar_data['end_date']), '" tabindex="', Utils::$context['tabindex']++, '" class="date_input end" data-type="date">';
<input type="text" name="end_date" id="end_date" value="', trim($calendar_data['end_date']), '" class="date_input end" data-type="date">';

echo '
<input type="submit" class="button" style="float:none" id="view_button" value="', Lang::$txt['view'], '">
Expand Down Expand Up @@ -810,7 +810,7 @@ function template_event_post()
<input type="hidden" name="calendar" value="1">
<div class="event_options_left" id="event_title">
<div>
<input type="text" id="evtitle" name="evtitle" maxlength="255" size="55" value="', Utils::$context['event']['title'], '" tabindex="', Utils::$context['tabindex']++, '">
<input type="text" id="evtitle" name="evtitle" maxlength="255" size="55" value="', Utils::$context['event']['title'], '">
</div>
</div>';

Expand Down Expand Up @@ -849,19 +849,19 @@ function template_event_post()
<div class="event_options_left" id="event_time_input">
<div>
<span class="label">', Lang::$txt['start'], '</span>
<input type="text" name="start_date" id="start_date" value="', trim(Utils::$context['event']['start_date_orig']), '" tabindex="', Utils::$context['tabindex']++, '" class="date_input start" data-type="date">
<input type="text" name="start_time" id="start_time" maxlength="11" value="', Utils::$context['event']['start_time_orig'], '" tabindex="', Utils::$context['tabindex']++, '" class="time_input start" data-type="time"', !empty(Utils::$context['event']['allday']) ? ' disabled' : '', '>
<input type="text" name="start_date" id="start_date" value="', trim(Utils::$context['event']['start_date_orig']), '" class="date_input start" data-type="date">
<input type="text" name="start_time" id="start_time" maxlength="11" value="', Utils::$context['event']['start_time_orig'], '" class="time_input start" data-type="time"', !empty(Utils::$context['event']['allday']) ? ' disabled' : '', '>
</div>
<div>
<span class="label">', Lang::$txt['end'], '</span>
<input type="text" name="end_date" id="end_date" value="', trim(Utils::$context['event']['end_date_orig']), '" tabindex="', Utils::$context['tabindex']++, '" class="date_input end" data-type="date"', Config::$modSettings['cal_maxspan'] == 1 ? ' disabled' : '', '>
<input type="text" name="end_time" id="end_time" maxlength="11" value="', Utils::$context['event']['end_time_orig'], '" tabindex="', Utils::$context['tabindex']++, '" class="time_input end" data-type="time"', !empty(Utils::$context['event']['allday']) ? ' disabled' : '', '>
<input type="text" name="end_date" id="end_date" value="', trim(Utils::$context['event']['end_date_orig']), '" class="date_input end" data-type="date"', Config::$modSettings['cal_maxspan'] == 1 ? ' disabled' : '', '>
<input type="text" name="end_time" id="end_time" maxlength="11" value="', Utils::$context['event']['end_time_orig'], '" class="time_input end" data-type="time"', !empty(Utils::$context['event']['allday']) ? ' disabled' : '', '>
</div>
</div><!-- #event_time_input -->
<div class="event_options_right" id="event_time_options">
<div id="event_allday">
<label for="allday"><span class="label">', Lang::$txt['calendar_allday'], '</span></label>
<input type="checkbox" name="allday" id="allday"', !empty(Utils::$context['event']['allday']) ? ' checked' : '', ' tabindex="', Utils::$context['tabindex']++, '">
<input type="checkbox" name="allday" id="allday"', !empty(Utils::$context['event']['allday']) ? ' checked' : '', '>
</div>
<div id="event_timezone">
<span class="label">', Lang::$txt['calendar_timezone'], '</span>
Expand All @@ -877,7 +877,7 @@ function template_event_post()
</div><!-- #event_time_options -->
<div>
<span class="label">', Lang::$txt['location'], '</span>
<input type="text" name="event_location" id="event_location" maxlength="255" value="', !empty(Utils::$context['event']['location']) ? Utils::$context['event']['location'] : '', '" tabindex="', Utils::$context['tabindex']++, '">
<input type="text" name="event_location" id="event_location" maxlength="255" value="', !empty(Utils::$context['event']['location']) ? Utils::$context['event']['location'] : '', '">
</div>
</fieldset>';

Expand Down
12 changes: 6 additions & 6 deletions Themes/default/Display.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,19 +395,19 @@ function template_main()
sTemplateBodyEdit: ', Utils::JavaScriptEscape('
<div id="quick_edit_body_container">
<div id="error_box" class="error"></div>
<textarea class="editor" name="message" rows="12" tabindex="' . Utils::$context['tabindex']++ . '">%body%</textarea><br>
<textarea class="editor" name="message" rows="12">%body%</textarea><br>
<input type="hidden" name="' . Utils::$context['session_var'] . '" value="' . Utils::$context['session_id'] . '">
<input type="hidden" name="topic" value="' . Utils::$context['current_topic'] . '">
<input type="hidden" name="msg" value="%msg_id%">
<div class="righttext quickModifyMargin">
<input type="submit" name="post" value="' . Lang::$txt['save'] . '" tabindex="' . Utils::$context['tabindex']++ . '" onclick="return oQuickModify.modifySave(\'' . Utils::$context['session_id'] . '\', \'' . Utils::$context['session_var'] . '\');" accesskey="s" class="button">' . (Utils::$context['show_spellchecking'] ? ' <input type="button" value="' . Lang::$txt['spell_check'] . '" tabindex="' . Utils::$context['tabindex']++ . '" onclick="spellCheck(\'quickModForm\', \'message\');" class="button">' : '') . ' <input type="submit" name="cancel" value="' . Lang::$txt['modify_cancel'] . '" tabindex="' . Utils::$context['tabindex']++ . '" onclick="return oQuickModify.modifyCancel();" class="button">
<input type="submit" name="post" value="' . Lang::$txt['save'] . '" onclick="return oQuickModify.modifySave(\'' . Utils::$context['session_id'] . '\', \'' . Utils::$context['session_var'] . '\');" class="button">' . (Utils::$context['show_spellchecking'] ? ' <input type="button" value="' . Lang::$txt['spell_check'] . '" onclick="spellCheck(\'quickModForm\', \'message\');" class="button">' : '') . ' <input type="submit" name="cancel" value="' . Lang::$txt['modify_cancel'] . '" onclick="return oQuickModify.modifyCancel();" class="button">
</div>
</div>'), ',
sTemplateSubjectEdit: ', Utils::JavaScriptEscape('<input type="text" name="subject" value="%subject%" size="80" maxlength="80" tabindex="' . Utils::$context['tabindex']++ . '">'), ',
sTemplateSubjectEdit: ', Utils::JavaScriptEscape('<input type="text" name="subject" value="%subject%" size="80" maxlength="80">'), ',
sTemplateBodyNormal: ', Utils::JavaScriptEscape('%body%'), ',
sTemplateSubjectNormal: ', Utils::JavaScriptEscape('<a href="' . Config::$scripturl . '?topic=' . Utils::$context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ',
sTemplateTopSubject: ', Utils::JavaScriptEscape('%subject%'), ',
sTemplateReasonEdit: ', Utils::JavaScriptEscape(Lang::$txt['reason_for_edit'] . ': <input type="text" name="modify_reason" value="%modify_reason%" size="80" maxlength="80" tabindex="' . Utils::$context['tabindex']++ . '" class="quickModifyMargin">'), ',
sTemplateReasonEdit: ', Utils::JavaScriptEscape(Lang::$txt['reason_for_edit'] . ': <input type="text" name="modify_reason" value="%modify_reason%" size="80" maxlength="80" class="quickModifyMargin">'), ',
sTemplateReasonNormal: ', Utils::JavaScriptEscape('%modify_text'), ',
sErrorBorderStyle: ', Utils::JavaScriptEscape('1px solid red'), (Utils::$context['can_reply']) ? ',
sFormRemoveAccessKeys: \'postmodify\'' : '', '
Expand Down Expand Up @@ -963,7 +963,7 @@ function template_quickreply()
', Lang::$txt['name'], ':
</dt>
<dd>
<input type="text" name="guestname" size="25" value="', Utils::$context['name'], '" tabindex="', Utils::$context['tabindex']++, '" required>
<input type="text" name="guestname" size="25" value="', Utils::$context['name'], '" required>
</dd>';

if (empty(Config::$modSettings['guest_post_no_email']))
Expand All @@ -973,7 +973,7 @@ function template_quickreply()
', Lang::$txt['email'], ':
</dt>
<dd>
<input type="email" name="email" size="25" value="', Utils::$context['email'], '" tabindex="', Utils::$context['tabindex']++, '" required>
<input type="email" name="email" size="25" value="', Utils::$context['email'], '" required>
</dd>';
}

Expand Down
24 changes: 4 additions & 20 deletions Themes/default/GenericControls.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,7 @@ function template_control_richedit_buttons($editor_id)
</span>
<span class="post_button_container">';

$tempTab = Utils::$context['tabindex'];

if (!empty(Utils::$context['drafts_save']))
$tempTab++;
elseif ($editor_context['preview_type'])
$tempTab++;
elseif (Utils::$context['show_spellchecking'])
$tempTab++;

$tempTab++;
Utils::$context['tabindex'] = $tempTab;

foreach (Utils::$context['richedit_buttons'] as $name => $button) {
if ($name == 'spell_check') {
$button['onclick'] = 'oEditorHandle_' . $editor_id . '.spellCheckStart();';
}

if ($name == 'preview') {
$button['value'] = isset($editor_context['labels']['preview_button']) ? $editor_context['labels']['preview_button'] : $button['value'];
$button['onclick'] = $editor_context['preview_type'] == Editor::PREVIEW_XML ? '' : 'return submitThisOnce(this);';
Expand All @@ -115,12 +99,12 @@ function template_control_richedit_buttons($editor_id)

if ($button['show']) {
echo '
<input type="', $button['type'], '"', $button['type'] == 'hidden' ? ' id="' . $name . '"' : '', ' name="', $name, '" value="', $button['value'], '"', $button['type'] != 'hidden' ? ' tabindex="' . --$tempTab . '"' : '', !empty($button['onclick']) ? ' onclick="' . $button['onclick'] . '"' : '', !empty($button['accessKey']) ? ' accesskey="' . $button['accessKey'] . '"' : '', $button['type'] != 'hidden' ? ' class="button"' : '', '>';
<input type="', $button['type'], '"', $button['type'] == 'hidden' ? ' id="' . $name . '"' : '', ' name="', $name, '" value="', $button['value'], '"', !empty($button['onclick']) ? ' onclick="' . $button['onclick'] . '"' : '', !empty($button['accessKey']) ? ' accesskey="' . $button['accessKey'] . '"' : '', $button['type'] != 'hidden' ? ' class="button"' : '', '>';
}
}

echo '
<input type="submit" value="', isset($editor_context['labels']['post_button']) ? $editor_context['labels']['post_button'] : Lang::$txt['post'], '" name="post" tabindex="', --$tempTab, '" onclick="return submitThisOnce(this);" accesskey="s" class="button">
<input type="submit" value="', isset($editor_context['labels']['post_button']) ? $editor_context['labels']['post_button'] : Lang::$txt['post'], '" name="post" accesskey="s" class="button">
</span>';

// Start an instance of the auto saver if its enabled
Expand Down Expand Up @@ -206,7 +190,7 @@ function template_control_verification($verify_id, $display_type = 'all', $reset
<div class="smalltext" style="margin: 4px 0 8px 0;">
<a href="', $verify_context->image_href, ';sound" id="visual_verification_', $verify_id, '_sound" rel="nofollow">', Lang::$txt['visual_verification_sound'], '</a> / <a href="#visual_verification_', $verify_id, '_refresh" id="visual_verification_', $verify_id, '_refresh">', Lang::$txt['visual_verification_request_new'], '</a>', $display_type != 'quick_reply' ? '<br>' : '', '<br>
', Lang::$txt['visual_verification_description'], ':', $display_type != 'quick_reply' ? '<br>' : '', '
<input type="text" name="', $verify_id, '_vv[code]" value="" size="30" tabindex="', Utils::$context['tabindex']++, '" autocomplete="off" required>
<input type="text" name="', $verify_id, '_vv[code]" value="" size="30" autocomplete="off" required>
</div>';
}

Expand All @@ -228,7 +212,7 @@ function template_control_verification($verify_id, $display_type = 'all', $reset
echo '
<div class="smalltext">
', $verify_context->questions[$qIndex]['q'], ':<br>
<input type="text" name="', $verify_id, '_vv[q][', $verify_context->questions[$qIndex]['id'], ']" size="30" value="', $verify_context->questions[$qIndex]['a'], '" ', $verify_context->questions[$qIndex]['is_error'] ? 'style="border: 1px red solid;"' : '', ' tabindex="', Utils::$context['tabindex']++, '" required>
<input type="text" name="', $verify_id, '_vv[q][', $verify_context->questions[$qIndex]['id'], ']" size="30" value="', $verify_context->questions[$qIndex]['a'], '" ', $verify_context->questions[$qIndex]['is_error'] ? 'style="border: 1px red solid;"' : '', ' required>
</div>';
}

Expand Down
8 changes: 4 additions & 4 deletions Themes/default/ManageBoards.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function template_modify_category()
<span class="smalltext">', Lang::$txt['name_on_display'], '</span>
</dt>
<dd>
<input type="text" name="cat_name" value="', Utils::$context['category']['editable_name'], '" size="30" tabindex="', Utils::$context['tabindex']++, '">
<input type="text" name="cat_name" value="', Utils::$context['category']['editable_name'], '" size="30">
</dd>
<dt>
<strong>', Lang::$txt['mboards_description'], '</strong><br>
Expand All @@ -160,7 +160,7 @@ function template_modify_category()
<span class="smalltext">', Lang::$txt['collapse_desc'], '</span>
</dt>
<dd>
<input type="checkbox" name="collapse"', Utils::$context['category']['can_collapse'] ? ' checked' : '', ' tabindex="', Utils::$context['tabindex']++, '">
<input type="checkbox" name="collapse"', Utils::$context['category']['can_collapse'] ? ' checked' : '', '>
</dd>';

// Show any category settings added by mods using the 'integrate_edit_category' hook.
Expand All @@ -185,10 +185,10 @@ function template_modify_category()

if (isset(Utils::$context['category']['is_new']))
echo '
<input type="submit" name="add" value="', Lang::$txt['mboards_add_cat_button'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', Utils::$context['tabindex']++, '" class="button">';
<input type="submit" name="add" value="', Lang::$txt['mboards_add_cat_button'], '" onclick="return !isEmptyText(this.form.cat_name);" class="button">';
else
echo '
<input type="submit" name="edit" value="', Lang::$txt['modify'], '" onclick="return !isEmptyText(this.form.cat_name);" tabindex="', Utils::$context['tabindex']++, '" class="button">
<input type="submit" name="edit" value="', Lang::$txt['modify'], '" onclick="return !isEmptyText(this.form.cat_name);" class="button">
<input type="submit" name="delete" value="', Lang::$txt['mboards_delete_cat'], '" data-confirm="', Lang::$txt['cat_delete_confirm'], '" class="button you_sure">';
echo '
<input type="hidden" name="', Utils::$context['session_var'], '" value="', Utils::$context['session_id'], '">
Expand Down
2 changes: 1 addition & 1 deletion Themes/default/ManageNews.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function template_email_members_compose()
<label', (isset(Utils::$context['post_error']['no_subject']) ? ' class="error"' : ''), ' for="subject" id="caption_subject">', Lang::$txt['subject'], '</label>
</dt>
<dd id="pm_subject">
<input type="text" id="subject" name="subject" value="', Utils::$context['subject'], '" tabindex="', Utils::$context['tabindex']++, '" size="80" maxlength="84"', isset(Utils::$context['post_error']['no_subject']) ? ' class="error"' : '', '>
<input type="text" id="subject" name="subject" value="', Utils::$context['subject'], '" size="80" maxlength="84"', isset(Utils::$context['post_error']['no_subject']) ? ' class="error"' : '', '>
</dd>
</dl>
<div id="bbcBox_message"></div>';
Expand Down
6 changes: 3 additions & 3 deletions Themes/default/PersonalMessage.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ function template_send()
// Autosuggest will be added by the JavaScript later on.
echo '
<dd id="pm_to" class="clear_right">
<input type="text" name="to" id="to_control" value="', Utils::$context['to_value'], '" tabindex="', Utils::$context['tabindex']++, '" size="20">';
<input type="text" name="to" id="to_control" value="', Utils::$context['to_value'], '" size="20">';

// A link to add BCC, only visible with JavaScript enabled.
echo '
Expand All @@ -1045,7 +1045,7 @@ function template_send()
<span', (isset(Utils::$context['post_error']['no_to']) || isset(Utils::$context['post_error']['bad_bcc']) ? ' class="error"' : ''), ' id="caption_bbc">', Lang::$txt['pm_bcc'], ':</span>
</dt>
<dd id="bcc_div2">
<input type="text" name="bcc" id="bcc_control" value="', Utils::$context['bcc_value'], '" tabindex="', Utils::$context['tabindex']++, '" size="20">
<input type="text" name="bcc" id="bcc_control" value="', Utils::$context['bcc_value'], '" size="20">
<div id="bcc_item_list_container"></div>
</dd>';

Expand All @@ -1055,7 +1055,7 @@ function template_send()
<span', (isset(Utils::$context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', Lang::$txt['subject'], ':</span>
</dt>
<dd id="pm_subject">
<input type="text" name="subject" value="', Utils::$context['subject'], '" tabindex="', Utils::$context['tabindex']++, '" size="80" maxlength="80"', isset(Utils::$context['post_error']['no_subject']) ? ' class="error"' : '', '>
<input type="text" name="subject" value="', Utils::$context['subject'], '" size="80" maxlength="80"', isset(Utils::$context['post_error']['no_subject']) ? ' class="error"' : '', '>
</dd>
</dl>';

Expand Down
Loading

0 comments on commit b7c6385

Please sign in to comment.