projects
/
citadel
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6f0e261
)
Capture the new message number from the etag of the post transaction
author
Art Cancro
<ajc@citadel.org>
Fri, 26 Nov 2021 05:51:12 +0000
(
00:51
-0500)
committer
Art Cancro
<ajc@citadel.org>
Fri, 26 Nov 2021 05:51:12 +0000
(
00:51
-0500)
webcit-ng/static/js/view_forum.js
patch
|
blob
|
history
diff --git
a/webcit-ng/static/js/view_forum.js
b/webcit-ng/static/js/view_forum.js
index
aacb883
..
8d13b10
100644
(file)
--- a/
webcit-ng/static/js/view_forum.js
+++ b/
webcit-ng/static/js/view_forum.js
@@
-333,7
+333,13
@@
function forum_save_message(div_name, reply_to_msgnum) {
if (request.readyState == 4) {
document.body.style.cursor = "default";
if (Math.trunc(request.status / 100) == 2) {
- alert("headers: " + request.getAllResponseHeaders());
+ headers = request.getAllResponseHeaders().split("\n");
+ for (var i in headers) {
+ if (headers[i].startsWith("etag: ")) {
+ new_msg_num = headers[i].split(" ")[1];
+ alert(new_msg_num);
+ }
+ }
document.getElementById(div_name).outerHTML = ""; // close the editor
}
else {