<span id="ctdl_banner_title" class="w3-bar-item">XXX</span>
</span>
<span class="w3-right">
- <button class="w3-bar-item w3-button" onclick="entmsg_dispatcher();" style="display:none" id="ctdl-newmsg-button">enter</button>
- <button class="w3-bar-item w3-button" onclick="gotonext(0);">ungoto</button>
- <button class="w3-bar-item w3-button" onclick="gotonext(1);">skip</button>
- <button class="w3-bar-item w3-button" onclick="gotonext(2);">goto</button>
+ <button id="ctdl-newmsg-button" style="display:none" class="w3-bar-item w3-button" onclick="entmsg_dispatcher();">enter</button>
+ <button id="ctdl-skip-button" style="display:none" class="w3-bar-item w3-button" onclick="gotonext(0);">ungoto</button>
+ <button id="ctdl-skip-button" style="display:none" class="w3-bar-item w3-button" onclick="gotonext(1);">skip</button>
+ <button id="ctdl-goto-button" style="display:none" class="w3-bar-item w3-button" onclick="gotonext(2);">goto</button>
<span id="lilo" class="w3-bar-item">Login</span>
</span>
</div>
}
document.getElementById("current_user").innerHTML = current_user ;
if (logged_in) {
- document.getElementById("lilo").innerHTML = "<a href=\"/ctdl/a/logout\">" + _("Log off") + "</a>" ;
+ document.getElementById("lilo").innerHTML = "<a href=\"/ctdl/a/logout\"><i class=\"fa-regular fa-right-from-bracket\"></i>" + _("Log off") + "</a>" ;
}
else {
document.getElementById("lilo").innerHTML = "<a href=\"javascript:display_login_screen('')\">" + _("Log in") + "</a>" ;
// Goto next room with unread messages
// which_oper is 0=ungoto, 1=skip, 2=goto
function gotonext(which_oper) {
- if ((which_oper == 1) || (which_oper == 2)) {
+
+ if (which_oper == 2) { // Goto needs to mark messages as seen
+ console.log("FIXME set lrp to " + last_seen);
+ }
+
+ if ((which_oper == 1) || (which_oper == 2)) { // Skip or Goto both take us to the "next" room
if (march_list.length == 0) {
console.log("Loading march list");
load_new_march_list(which_oper); // we will recurse back here
}
fetch_msg_list();
- // make the new message button appear
- document.getElementById("ctdl-newmsg-button").innerHTML = "<i class=\"far fa-edit\"></i>" + _("Post message");
+ // make the nav buttons appear (post a new message, skip this room, goto next room)
+
+ document.getElementById("ctdl-newmsg-button").innerHTML = "<i class=\"fa fa-edit\"></i>" + _("Post message");
document.getElementById("ctdl-newmsg-button").style.display = "block";
+
+ document.getElementById("ctdl-skip-button").innerHTML = "<i class=\"fa fa-arrow-alt-circle-right\"></i>" + _("Skip this room");
+ document.getElementById("ctdl-skip-button").style.display = "block";
+
+ document.getElementById("ctdl-goto-button").innerHTML = "<i class=\"fa fa-arrow-circle-right\"></i>" + _("Goto next room");
+ document.getElementById("ctdl-goto-button").style.display = "block";
}
}
fetch_msg_list();
+
+ // Make a note of the highest message number we saw, so we can mark it when we "Goto next room"
+ // (Compared to the text client, this is actually more like <A>bandon than <G>oto)
+ if ((num_msgs > 0) && (message_numbers[num_msgs-1] > last_seen)) {
+ last_seen = message_numbers[num_msgs-1];
+ }
}