Skip to content

Commit 2322f68

Browse files
committed
Update quick modify to support Ctrl+Enter
Signed-off-by: John Rayes <[email protected]>
1 parent 1737bf4 commit 2322f68

File tree

3 files changed

+149
-154
lines changed

3 files changed

+149
-154
lines changed

Themes/default/Display.template.php

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -392,27 +392,12 @@ function template_main()
392392
sClassName: \'quick_edit\',
393393
bShowModify: ', Config::$modSettings['show_modify'] ? 'true' : 'false', ',
394394
iTopicId: ', Utils::$context['current_topic'], ',
395-
sTemplateBodyEdit: ', Utils::JavaScriptEscape('
396-
<div id="quick_edit_body_container">
397-
<div id="error_box" class="error"></div>
398-
<textarea class="editor" name="message" rows="12">%body%</textarea><br>
399-
<input type="hidden" name="' . Utils::$context['session_var'] . '" value="' . Utils::$context['session_id'] . '">
400-
<input type="hidden" name="topic" value="' . Utils::$context['current_topic'] . '">
401-
<input type="hidden" name="msg" value="%msg_id%">
402-
<div class="righttext quickModifyMargin">
403-
<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">
404-
</div>
405-
</div>'), ',
406-
sTemplateSubjectEdit: ', Utils::JavaScriptEscape('<input type="text" name="subject" value="%subject%" size="80" maxlength="80">'), ',
407-
sTemplateBodyNormal: ', Utils::JavaScriptEscape('%body%'), ',
408-
sTemplateSubjectNormal: ', Utils::JavaScriptEscape('<a href="' . Config::$scripturl . '?topic=' . Utils::$context['current_topic'] . '.msg%msg_id%#msg%msg_id%" rel="nofollow">%subject%</a>'), ',
409-
sTemplateTopSubject: ', Utils::JavaScriptEscape('%subject%'), ',
410-
sTemplateReasonEdit: ', Utils::JavaScriptEscape(Lang::$txt['reason_for_edit'] . ': <input type="text" name="modify_reason" value="%modify_reason%" size="80" maxlength="80" class="quickModifyMargin">'), ',
411-
sTemplateReasonNormal: ', Utils::JavaScriptEscape('%modify_text'), ',
412-
sErrorBorderStyle: ', Utils::JavaScriptEscape('1px solid red'), (Utils::$context['can_reply']) ? ',
413-
sFormRemoveAccessKeys: \'postmodify\'' : '', '
395+
sSaveButtonText: ', Utils::JavaScriptEscape(Lang::$txt['save']), ',
396+
sCancelButtonText: ', Utils::JavaScriptEscape(Lang::$txt['modify_cancel']), ',
397+
sTemplateReasonEdit: ', Utils::JavaScriptEscape(Lang::$txt['reason_for_edit']) . ',
398+
sErrorBorderStyle: ', Utils::JavaScriptEscape('1px solid red'), '
414399
});
415-
400+
416401
aJumpTo[aJumpTo.length] = new JumpTo({
417402
sContainerId: "display_jump_to",
418403
sJumpToTemplate: "<label class=\"smalltext jump_to\" for=\"%select_id%\">', Utils::$context['jump_to']['label'], '<" + "/label> %dropdown_list%",

Themes/default/css/index.css

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@ textarea {
7474
.monospace, .bbc_code, .phpcode, pre {
7575
font-family: "DejaVu Sans Mono", Menlo, Monaco, Consolas, monospace;
7676
}
77-
78-
#quick_edit_body_container textarea,
77+
#quickModifyForm,
78+
#quickModifyForm label {
79+
display: flex;
80+
flex-direction: column;
81+
gap: .5em;
82+
}
7983
.move_topic textarea,
8084
dd textarea {
8185
width: 100%;
@@ -524,13 +528,6 @@ strong[id^='child_list_']::after {
524528
content: "]";
525529
}
526530

527-
/* Posts and personal messages displayed throughout the forum. */
528-
.post {
529-
overflow: auto;
530-
line-height: 1.4em;
531-
padding: 1px 0;
532-
}
533-
534531
/* Calendar colors for birthdays, events and holidays */
535532
.birthday {
536533
color: var(--birthday_txt_color);
@@ -1062,9 +1059,17 @@ a[class^="mobile_generic_menu_"] {
10621059

10631060
/* Styles for the standard button lists.
10641061
------------------------------------------------------- */
1065-
.buttonlist, .buttonrow, .pagelinks {
1066-
z-index: 100;
1067-
padding: 5px 0 5px 0;
1062+
.buttonlist, .buttonlistend, .buttonrow, .pagelinks, .pagesection {
1063+
align-items: baseline;
1064+
display: flex;
1065+
gap: .5em;
1066+
}
1067+
/* Items in mobile menu must be vertical. */
1068+
.popup_window .buttonlist {
1069+
flex-direction: column;
1070+
}
1071+
.buttonlistend {
1072+
justify-content: end;
10681073
}
10691074
.button, .quickbuttons > li > a, .inline_mod_check {
10701075
display: inline-block;
@@ -1495,11 +1500,6 @@ ul li.greeting {
14951500
width: 29ch;
14961501
}
14971502

1498-
.quickModifyMargin {
1499-
margin: 10px 0 5px 0;
1500-
padding-bottom: 5px;
1501-
}
1502-
15031503
/* Styles for edit event section
15041504
---------------------------------------------------- */
15051505
#post_event .roundframe {

0 commit comments

Comments
 (0)