X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit-ng%2Fstatic%2Fjs%2Fviews.js;h=d62af2cb83b1be2312ce5afc28c7670f58456747;hb=a31e747f369e87522b74e867262b7929de4897f9;hp=33da436676fe35ba3e7efcacc5c9058a3aa2c64b;hpb=1de34ae393d0f8bf9c1fb9131765ee50449f4806;p=citadel.git diff --git a/webcit-ng/static/js/views.js b/webcit-ng/static/js/views.js index 33da43667..d62af2cb8 100644 --- a/webcit-ng/static/js/views.js +++ b/webcit-ng/static/js/views.js @@ -1,5 +1,5 @@ // -// Copyright (c) 2016-2017 by the citadel.org team +// Copyright (c) 2016-2018 by the citadel.org team // // This program is open source software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 3. @@ -32,37 +32,71 @@ var views = { // This function is the dispatcher that determines the correct view for a room, // and calls the correct renderer. // -function render_room_view() { - - switch(current_view) { +function render_room_view(min_msg, max_msg) +{ + switch(current_view) + { case views.VIEW_MAILBOX: // FIXME view mail rooms as forums for now case views.VIEW_BBS: - threads_readmessages(); + forum_readmessages("ctdl-main", min_msg, max_msg); break; default: - document.getElementById("main").innerHTML = "The view for " + current_room + " is " + current_view + " but there is no renderer." ; + document.getElementById("ctdl-main").innerHTML = "The view for " + current_room + " is " + current_view + " but there is no renderer." ; break; } } -// bbs "threads" view -// The inner div exists so that if the user clicks away early, the main div doesn't get clobbered when the load completes. +// Forum view (flat) -- let's have another go at this with the rendering done client-side // -function threads_readmessages() { +function forum_readmessages(target_div, min_msg, max_msg) +{ var innerdivname = randomString(5); - document.getElementById("main").innerHTML = "