forked from yuezhongxin/MessageManager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.html
More file actions
129 lines (126 loc) · 5.43 KB
/
compose.html
File metadata and controls
129 lines (126 loc) · 5.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>撰写短消息</title>
<link rel="stylesheet" href="css/cnblogs.css" type="text/css">
<script type="text/javascript" src="scripts/jquery.js"></script>
<script src="scripts/json2.js" type="text/javascript"></script>
<script type="text/javascript" src="http://space.cnblogs.com/common/ubb.js"></script>
<script type="text/javascript">
<!--
document.domain = 'cnblogs.' + location.hostname.substring(location.hostname.lastIndexOf(".") + 1, location.hostname.length);
function OpenWindow(url, width, height, offset) {
var leftVal = (screen.width - width) / 2 - offset;
var topVal = (screen.height - height) / 2 - offset;
var newwindow = window.open(url, '_blank', 'width=' + width + ',height=' + height + ',toolbars=0,resizable=1,left=' + leftVal + ',top=' + topVal);
newwindow.focus();
}
function InsertUBBImgToEditor(url) {
InsertImgUBB("txtContent", url);
}
function SendMessage() {
var title = document.getElementById("txtTitle").value;
var content = document.getElementById("txtContent").value;
var incept = document.getElementById("txtIncept").value;
if (incept == "") {
alert("收件人是必填的");
$("#txtIncept").focus();
return;
}
if (title == "") {
alert("标题是必填的");
$("#txtTitle").focus();
return;
}
if (content == "") {
alert("内容是必填的");
$("#txtContent").focus();
return;
}
$("#span_msg_tips").html("正在发送...");
var param = {
incept: incept,
title: title,
content: content
};
$.ajax({
url: '/mvcajax/msg/SendMessage',
data: JSON.stringify(param),
contentType: 'application/json; charset=utf-8',
type: 'post',
dataType: 'text',
success: function (data) {
if (data == '1') {
document.getElementById("span_msg").innerHTML = "<div class='center' style='padding:30px;'><span class='red'>您的短消息已发送成功!</span> <a href='/msg/inbox'>返回收信箱</a></div>";
} else {
$("#span_msg_tips").html("抱歉!发送失败!错误:" + data);
}
},
error: function (xhr) {
$("#span_msg_tips").html("抱歉!发送失败!错误:" + xhr.responseText);
}
});
}
function ctlent(eventobject) {
if (eventobject.ctrlKey && eventobject.keyCode == 13) {
SendMessage();
}
}
//-->
</script>
</head>
<body>
<form name="myForm" method="post" id="myForm">
<div id="main_wrapper">
<div id="main_header">
<script type="text/javascript" src="scripts/common.js"></script>
<div id="guide">
<h1>撰写短信</h1>
</div>
</div>
<div id="sideleft">
<div style="padding-left: 10px; width: 95%">
<div id="span_msg">
<table width="100%" border="0">
<tbody>
<tr>
<td align="right" valign="top" class="stitle_green" width="60px">收件人: </td>
<td valign="top">
<input name="txtIncept" type="text" maxlength="90" id="txtIncept" class="text_fixedsys" style="width: 300px"></td>
</tr>
<tr>
<td align="right" valign="top" class="stitle_green">主题: </td>
<td valign="top">
<input name="txtTitle" type="text" id="txtTitle" class="text_fixedsys" style="width: 300px"></td>
</tr>
<tr>
<td align="right" valign="top" class="stitle_green">内容: </td>
<td>
<textarea name="txtContent" rows="2" cols="20" id="txtContent" class="text_fixedsys" onkeydown="ctlent(event)" style="width: 90%; height: 200px"></textarea>
</td>
</tr>
<tr>
<td colspan="2" align="center" height="50">
<input type="button" value=" 发 送 " id="btnSend" onclick="SendMessage()">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="sideright">
> 当前用户:小菜<br />
<br />
> <a href="compose.html" class="big blue">撰写新短信</a><br />
<br>
> <a href="inbox.html" class="big blue">收件箱</a><br />
<br>
> <a href="outbox.html" class="big blue">发件箱</a>
</div>
</div>
</form>
</body>
</html>