From: Art Cancro Date: Wed, 14 Feb 2018 22:46:03 +0000 (-0500) Subject: javascript X-Git-Tag: v939~416 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=ac21736a1bf75d8a18234d56447c52afb5f236f3 javascript --- diff --git a/webcit-ng/static/js/main.js b/webcit-ng/static/js/main.js index 1e49b2b82..5aac5f8e6 100644 --- a/webcit-ng/static/js/main.js +++ b/webcit-ng/static/js/main.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. diff --git a/webcit-ng/static/js/views.js b/webcit-ng/static/js/views.js index b3b821231..b5d755337 100644 --- a/webcit-ng/static/js/views.js +++ b/webcit-ng/static/js/views.js @@ -54,8 +54,8 @@ function forum_readmessages(target_div, min_msg, max_msg) { var innerdivname = randomString(5); document.getElementById(target_div).innerHTML = "



  " - + _("Loading messages from server, please wait") + "
" ; + "\">  " + + _("Loading messages from server, please wait") + "" ; var request = new XMLHttpRequest(); if (max_msg < 9999999999) @@ -90,19 +90,26 @@ function forum_readmessages(target_div, min_msg, max_msg) msgs = msgs.slice(msgs.length - messages_per_page); } new_old_div_name = randomString(5); + if (msgs.length < 1) + { + newlt = max_msg; + } + else + { + newlt = msgs[0]; + } document.getElementById(innerdivname).innerHTML += "
" + - "" + - "link to msgs less than " + msgs[0] + "
" ; + "" + + "link to msgs less than " + newlt + "" ; } - // It's render time, bitchez! + // Render the divs (we will fill them in later) for (var i in msgs) { if ((msgs[i] > min_msg) && (msgs[i] < max_msg)) { - document.getElementById(innerdivname).innerHTML += - "
message #" + msgs[i] + "
" ; + document.getElementById(innerdivname).innerHTML += "
#" + msgs[i] + "
" ; } } if (max_msg == 9999999999) @@ -121,10 +128,20 @@ function forum_readmessages(target_div, min_msg, max_msg) "" + "link to msgs greater than " + newgt + "" ; } + + // Render the individual messages in the divs + for (var i in msgs) + { + if ((msgs[i] > min_msg) && (msgs[i] < max_msg)) + { + document.getElementById("ctdl_msg_" + msgs[i]).innerHTML = "Message " + msgs[i] + " got rendered!!!"; + } + } + } else { - document.getElementById(innerdivname).innerHTML = this.status ; // error message + document.getElementById(innerdivname).innerHTML = "ERROR " + this.status ; // error message } } };