Skip to content

Commit

Permalink
Update quick modify to support Ctrl+Enter
Browse files Browse the repository at this point in the history
Signed-off-by: John Rayes <[email protected]>
  • Loading branch information
live627 committed Dec 29, 2023
1 parent 1737bf4 commit ada494b
Show file tree
Hide file tree
Showing 3 changed files with 148 additions and 153 deletions.
23 changes: 4 additions & 19 deletions Themes/default/Display.template.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,25 +392,10 @@ function template_main()
sClassName: \'quick_edit\',
bShowModify: ', Config::$modSettings['show_modify'] ? 'true' : 'false', ',
iTopicId: ', Utils::$context['current_topic'], ',
sTemplateBodyEdit: ', Utils::JavaScriptEscape('
<div id="quick_edit_body_container">
<div id="error_box" class="error"></div>
<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'] . '" 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">'), ',
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" class="quickModifyMargin">'), ',
sTemplateReasonNormal: ', Utils::JavaScriptEscape('%modify_text'), ',
sErrorBorderStyle: ', Utils::JavaScriptEscape('1px solid red'), (Utils::$context['can_reply']) ? ',
sFormRemoveAccessKeys: \'postmodify\'' : '', '
sSaveButtonText: ', Utils::JavaScriptEscape(Lang::$txt['save']), ',
sCancelButtonText: ', Utils::JavaScriptEscape(Lang::$txt['modify_cancel']), ',
sTemplateReasonEdit: ', Utils::JavaScriptEscape(Lang::$txt['reason_for_edit']) . ',
sErrorBorderStyle: ', Utils::JavaScriptEscape('1px solid red'), '
});
aJumpTo[aJumpTo.length] = new JumpTo({
Expand Down
34 changes: 17 additions & 17 deletions Themes/default/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ textarea {
.monospace, .bbc_code, .phpcode, pre {
font-family: "DejaVu Sans Mono", Menlo, Monaco, Consolas, monospace;
}

#quick_edit_body_container textarea,
#quickModifyForm,
#quickModifyForm label {
display: flex;
flex-direction: column;
gap: .5em;
}
.move_topic textarea,
dd textarea {
width: 100%;
Expand Down Expand Up @@ -524,13 +528,6 @@ strong[id^='child_list_']::after {
content: "]";
}

/* Posts and personal messages displayed throughout the forum. */
.post {
overflow: auto;
line-height: 1.4em;
padding: 1px 0;
}

/* Calendar colors for birthdays, events and holidays */
.birthday {
color: var(--birthday_txt_color);
Expand Down Expand Up @@ -1062,9 +1059,17 @@ a[class^="mobile_generic_menu_"] {

/* Styles for the standard button lists.
------------------------------------------------------- */
.buttonlist, .buttonrow, .pagelinks {
z-index: 100;
padding: 5px 0 5px 0;
.buttonlist, .buttonlistend, .buttonrow, .pagelinks, .pagesection {
align-items: baseline;
display: flex;
gap: .5em;
}
/* Items in mobile menu must be vertical. */
.popup_window .buttonlist {
flex-direction: column;
}
.buttonlistend {
justify-content: end;
}
.button, .quickbuttons > li > a, .inline_mod_check {
display: inline-block;
Expand Down Expand Up @@ -1495,11 +1500,6 @@ ul li.greeting {
width: 29ch;
}

.quickModifyMargin {
margin: 10px 0 5px 0;
padding-bottom: 5px;
}

/* Styles for edit event section
---------------------------------------------------- */
#post_event .roundframe {
Expand Down
Loading

0 comments on commit ada494b

Please sign in to comment.