[bugfix] edit document form empty and comment edit form to multiline

This commit is contained in:
Amberstone 2024-12-11 15:26:39 +09:00
parent be7d60fbde
commit 6f8ed103ae
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
3 changed files with 10 additions and 27 deletions

View file

@ -1,4 +1,4 @@
<?php
<textarea?php
if (!defined("_GNUBOARD_"))
exit;
?>
@ -93,19 +93,16 @@ if (!defined("_GNUBOARD_"))
</p>
<?php } ?>
<span id="edit_<?php echo $comment_id ?>"></span><!-- 수정 -->
<input type="hidden" value="<?php echo strstr($list[$i]['wr_option'], "secret") ?>"
id="secret_comment_<?php echo $comment_id ?>">
<input type="text" id="save_comment_<?php echo $comment_id ?>" style="display:none"
value="<?php echo get_text($list[$i]['content1'], 0) ?>">
<input type="hidden" value="<?php echo strstr($list[$i]['wr_option'], "secret") ?>" id="secret_comment_<?php echo $comment_id ?>">
<textarea name="wr_content" required class="frm-input full" value="<?= $list[$i]['wr_content'] ?>" oninput="wr_resize(this);" id="save_comment_<?php echo $comment_id ?>" style="display:none; resize: vertical !important; transition: none; min-height: 1em;"><?php echo get_text($list[$i]['content1'], 0) ?></textarea>
</div>
<?php if ($list[$i]['is_edit']) { ?>
<div class="modify_area ui-text-area" id="save_comment_<?php echo $comment_id ?>" style="display:none;">
<input type="text" id="save_co_comment_<?php echo $comment_id ?>"
value="<?php echo get_text($list[$i]['wr_content'], 0) ?>" class="full">
<p class="txt-right"><button type="button" class="mod_comment ui-btn"
onclick="mod_comment('<?php echo $comment_id ?>')">수정</button></p>
<textarea type="text" id="save_co_comment_<?php echo $comment_id ?>" oninput="wr_resize(this);" style="resize: vertical !important; transition: none; min-height: 1em;"><?php echo get_text($list[$i]['wr_content'], 0) ?></textarea>
<p class="txt-right">
<button type="button" class="mod_comment ui-btn" onclick="mod_comment('<?php echo $comment_id ?>')">수정</button>
</p>
</div>
<?php } ?> </li>
<?php } ?>
@ -113,7 +110,7 @@ if (!defined("_GNUBOARD_"))
<script>
function wr_resize(e) {
e.style.height = 'auto';
e.style.height = e.scrollHeight + 'px';
e.style.height = `calc(${e.scrollHeight}px + 0.25em)`;
}
</script>
<?php

View file

@ -237,14 +237,6 @@ if ($member['mb_level'] >= $board['bo_html_level'])
$is_secret = $board['bo_use_secret'];
//$is_mail = false;
//if ($config['cf_email_use'] && $board['bo_use_email'])
// $is_mail = true;
//$recv_email_checked = '';
//if ($w == '' || strstr($write['wr_option'], 'mail'))
// $recv_email_checked = 'checked';
$is_name = false;
$is_password = false;
$is_email = false;
@ -291,8 +283,6 @@ if ($w == "" || $w == "r") {
if (isset($write['wr_name'])) {
$name = get_text(cut_str(stripslashes($write['wr_name']), 20));
}
//$email = get_email_address($member['mb_email']);
//$homepage = get_text(stripslashes($member['mb_homepage']));
}
}

View file

@ -26,10 +26,6 @@ if ($is_notice || $is_html || $is_secret || $is_mail) {
$option_hidden .= '<input type="hidden" name="secret" value="secret">';
}
}
//if ($is_mail) {
// $option .= "\n".'<input type="checkbox" id="mail" name="mail" value="mail" '.$recv_email_checked.'>'."\n".'<label for="mail">답변메일받기</label>';
//}
}
echo $option_hidden;
@ -53,7 +49,7 @@ echo $option_hidden;
<div class="ui-write-box ui-text-area<?= $w == 'u' ? " update" : ""; ?>">
<a href="#" class="write_open ui-btn point">+</a>
<p>
<textarea name="wr_content" id="content" class="frm-input full" required value="<?= $content ?>" style="resize: vertical !important; transition: none; min-height: 1em;"></textarea>
<textarea name="wr_content" id="content" class="frm-input full" required value="<?= $content ?>" style="resize: vertical !important; transition: none; min-height: 1em;"><?=$content?></textarea>
<button type="submit" id="btn_submit" class="ui-btn" accesskey='s'>입력</button><?php if ($w == 'u') { ?><a
href="<?= G5_BBS_URL ?>/board.php?bo_table=<?= $bo_table ?>" class="ui-btn etc">뒤로</a><?php } ?>
<?php if (!$is_member) { ?>
@ -90,6 +86,6 @@ echo $option_hidden;
document.getElementById("content").addEventListener("input", function() {
this.style.height = 'auto';
this.style.height = this.scrollHeight + 'px';
this.style.height = `calc(${this.scrollHeight}px + 0.25em)`;
});
</script>