📄 modcp_editpost.jsp
字号:
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c"%>
<c:choose>
<c:when test="${param.action=='editsubject'}">
<input type="text" id="subject_${tid}" name="subject_${tid}" value="${subject}" size="60" maxlength="80" ondblclick="doane(event)" />
<script type="text/javascript" reload="1">
$('subject_${tid}').focus();
$('subject_${tid}').onblur = function() {
ajaxget('modcp.jsp?action=editsubject&tid=${tid}&fid=${fid}&editsubjectsubmit=yes&subjectnew=' + encodeURI(encodeURI($('subject_${tid}').value)), 'thread_${tid}', 'thread_${tid}', '正在提交数据...');
}
$('subject_${tid}').onkeydown = function(e) {
e = e ? e : window.event;
actualCode = e.keyCode ? e.keyCode : e.charCode;
if(actualCode == 13) {
ajaxget('modcp.jsp?action=editsubject&tid=${tid}&fid=${fid}&editsubjectsubmit=yes&subjectnew=' + encodeURI(encodeURI($('subject_${tid}').value)), 'thread_${tid}', 'thread_${tid}', '正在提交数据...');
doane(e);
} else if(actualCode == 27) {
ajaxget('modcp.jsp?action=editsubject&tid=${tid}&fid=${fid}&editsubjectsubmit=yes&subjectnew=' + encodeURI(encodeURI($('subject_${tid}').value)), 'thread_${tid}', 'thread_${tid}', '正在提交数据...');
}
}
</script>
</c:when>
<c:otherwise>
<textarea type="text" id="message_${post.pid}" name="message_${post.pid}" style="width: 80%; height: 200px; overflow: visible" ondblclick="doane(event)">${post.message}</textarea>
<p style="margin: 5px; text-align: center;">
<button type="button" value="true" class="submit" onclick="submitmessage('${post.pid}');">提交</button>
<button type="button" class="submit" onclick="ajaxget('modcp.jsp?action=editmessage&pid=${post.pid}&tid=${post.tid}&editmessagesubmit=yes&inajax=1&do=notupdate&rand='+Math.random(), 'postmessage_${post.pid}')">取消</button>
</p>
<script type="text/javascript">
document.getElementById('message_${post.pid}').focus();
function submitmessage(pid) {
if(!$('messageform_'+pid)) {
var messageform = document.createElement("form");
messageform.id = 'messageform_'+pid;
messageform.method = 'post';
messageform.action = 'modcp.jsp?action=editmessage&pid='+pid+'&tid=${post.tid}&editmessagesubmit=yes&inajax=1';
var messageforminput = document.createElement('input');
messageforminput.id= 'messageforminput_'+pid;
messageforminput.type= 'hidden';
messageforminput.name = 'message';
messageforminput.value = $('message_'+pid).value;
messageform.appendChild(messageforminput);
document.body.appendChild(messageform);
} else {
$('messageforminput_'+pid).value = $('message_'+pid).value;
}
ajaxpost('messageform_'+pid, 'postmessage_'+pid);
}
</script>
</c:otherwise>
</c:choose>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -