X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit-ng%2Fstatic%2Fjs%2Fviews.js;h=35fdbef5bc7f38abce720bd46d93d0824ef9379b;hb=439dbc67ce2cb6923a35efbd4c172ea3f5f83bf4;hp=b569cd6640c1ce73e60bbadea721d36671ceca48;hpb=32fe7887a4fc68e8148f79c4b9ec35ffbb2442d7;p=citadel.git diff --git a/webcit-ng/static/js/views.js b/webcit-ng/static/js/views.js index b569cd664..35fdbef5b 100644 --- a/webcit-ng/static/js/views.js +++ b/webcit-ng/static/js/views.js @@ -1,5 +1,5 @@ // -// Copyright (c) 2016-2018 by the citadel.org team +// Copyright (c) 2016-2019 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. @@ -30,48 +30,115 @@ var views = { // This function is the dispatcher that determines the correct view for a room, -// and calls the correct renderer. +// and calls the correct renderer. Greater/Less than bounds are accepted. // -function render_room_view() +function render_room_view(gt_msg, lt_msg) { - switch(current_view) - { + switch(current_view) { case views.VIEW_MAILBOX: // FIXME view mail rooms as forums for now case views.VIEW_BBS: - forum_readmessages(); + forum_readmessages("ctdl-main", gt_msg, lt_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; } } -// 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 +// Forum view (flat) -- let's have another go at this with the rendering done client-side // -function XX_forum_readmessages(flat_or_threads) +function forum_readmessages(target_div, gt_msg, lt_msg) { - var innerdivname = randomString(5); - document.getElementById("main").innerHTML = "