GET /ctdl/r/ROOMNAME/msgs.new JSON array of message list in room (new messages)
GET /ctdl/r/ROOMNAME/MSGNUM Retrieve the content of an individual message (message headers are HTTP headers)
PUT /ctdl/r/ROOMNAME/xxx DAV operation to insert a new message into a room
+ (The returned ETag will be the new message number)
GET /ctdl/r/ROOMNAME/MSGNUM/json Retrieve an individual message in a room, encapsulated in JSON
GET /ctdl/c/info Returns a JSON representation of the output of an INFO server command
POST /ctdl/a/login Send it a your credentials and it will log you in
"</div><br>" // end header
- + "<div class=\"ctdl-msg-body\" id=\"ctdl-editor-body\" style=\"height:30vh; padding:5px;\" contenteditable=\"true\">" // begin body
- + "This is where the reply text will go."
+ + "<div class=\"ctdl-msg-body\" id=\"ctdl-editor-body\" style=\"padding:5px;\" contenteditable=\"true\">" // begin body
+ + "\n" // empty initial content
+ "</div>" // end body
request.setRequestHeader("Content-type", "text/html");
request.setRequestHeader("Content-length", msg_text.length);
request.onreadystatechange = function() {
- alert("well, something happened");
+ if (request.readyState == 4) {
+ if (Math.trunc(request.status / 100) == 2) {
+ alert("headers: " + request.getAllResponseHeaders());
+ document.getElementById(div_name).outerHTML = ""; // close the editor
+ }
+ else {
+ alert(_("An error has occurred.")); // inelegant but hopefully infrequent
+ }
+ }
};
request.send(msg_text);
- request = null;
-
}
#define DEFAULT_SSL_CIPHER_LIST "DEFAULT" // See http://openssl.org/docs/apps/ciphers.html
#define WEBSERVER_PORT 80
#define WEBSERVER_INTERFACE "*"
-#define CTDLHOST "uncensored.citadel.org"
+#define CTDLHOST "dev.citadel.org"
#define CTDLPORT "504"
#define DEVELOPER_ID 0
#define CLIENT_ID 4