+
+
+// Called by gotonext() when the march list is empty.
+//
+function load_new_march_list() {
+ fetchm = async() => {
+ response = await fetch("/ctdl/r/");
+ march_list = await(response.json());
+ if (response.ok) {
+ march_list = march_list.filter(function(room) {
+ return room.hasnewmsgs;
+ });
+ march_list = march_list.sort(function(a,b) {
+ if (a.floor != b.floor) {
+ return(a.floor - b.floor);
+ }
+ if (a.rorder != b.rorder) {
+ return(a.rorder - b.rorder);
+ }
+ return(a.name < b.name);
+ });
+ march_list.push({name:"_BASEROOM_",known:true,hasnewmsgs:true,floor:0});
+ gotonext();
+ }
+ }
+ fetchm();
+}
+
+
+// Activate the "Loading..." modal
+function activate_loading_modal() {
+ document.getElementById("ctdl_big_modal_content").innerHTML =
+ "<i class=\"fas fa-spinner fa-spin\"></i> "
+ + _("Loading messages from server, please wait");
+ document.getElementById("ctdl_big_modal").style.display = "block";
+}
+
+
+// Disappear the "Loading..." modal
+function deactivate_loading_modal() {
+ document.getElementById("ctdl_big_modal").style.display = "none";
+}