-// Forum view -- flat or threaded
-// The inner div exists so that if the user clicks away early, the main div doesn't get clobbered when the load completes.
-// The parameter can be set to "flat" or "threads" which is passed directly to the API
-//
-function XX_forum_readmessages(flat_or_threads)
-{
- var innerdivname = randomString(5);
- document.getElementById("main").innerHTML = "<div id=\"" + innerdivname +
- "\"><br><br><br><center><h5><i class=\"fas fa-spinner fa-spin\"></i> "
- + _("Loading messages from server, please wait") + "</h5></center></div>" ;
-
- var request = new XMLHttpRequest();
- request.open("GET", "/ctdl/r/" + escapeHTMLURI(current_room) + "/" + flat_or_threads, true);
- request.onreadystatechange = function()
- {
- if (this.readyState === 4)
- {
- if ((this.status / 100) == 2)
- {
- document.getElementById(innerdivname).outerHTML = this.responseText;
- }
- else
- {
- document.getElementById(innerdivname).outerHTML = "ERROR " + this.status ;
- }
- }
- };
- request.send();
- request = null;
-}
-
-