Skip to content
Snippets Groups Projects
Commit 7fbb128e authored by deuce's avatar deuce
Browse files

After a block has been loaded, just hide the block rather than removing it

so you don't need to reload the content at any time.
This appears to have "fixed" the IE stuff, so add the <pre></pre> around
the body which IE needs since it apparently doesn't support
white-space: pre; in the CSS.
parent 54e14030
Branches
Tags
No related merge requests found
......@@ -22,6 +22,7 @@ if((!msg_area.sub[sub_code.toLowerCase()].ismoderated) || (hdr.attr & MSG_VALIDA
body=html_encode(body, true, false, true, true);
}
}
?><pre><?xjs
msgbase.close();
writeln(body);
?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</pre>
......@@ -71,13 +71,23 @@ function clean_id(id)
function toggle_replies(sub_code, message_number)
{
var containerid='replies-'+clean_id(sub_code)+'-'+message_number;
var container=document.getElementById(containerid);
var expanderid='reply-expander-'+clean_id(sub_code)+'-'+message_number;
var expander=document.getElementById(expanderid);
if(document.getElementById(containerid).innerHTML=='')
if(container.innerHTML=='') {
ajaxpage(messages_url+"?sub_code="+sub_code+"&msg_number="+message_number+'&user='+user,containerid,expanderid,minus_url);
container.style.display='block';
}
else {
document.getElementById(containerid).innerHTML='';
document.getElementById(expanderid).src=plus_url;
if(container.style.display=='none') {
container.style.display='block';
expander.src=minus_url;
}
else {
container.style.display='none';
expander.src=plus_url;
}
}
}
......@@ -89,6 +99,7 @@ function toggle_body(sub_code, message_number)
if(container.innerHTML=='') {
ajaxpage(body_url+"?sub_code="+sub_code+"&msg_number="+message_number+'&user='+user,containerid);
container.style.display='block';
/* If this is higher than the current read_ptr, update it */
if(read_ptr[sub_code] < message_number)
read_ptr[sub_code] = message_number;
......@@ -118,29 +129,48 @@ function toggle_body(sub_code, message_number)
message.className='message_inherit_new';
}
}
else
container.innerHTML='';
else {
if(container.style.display=='none')
container.style.display='block';
else
container.style.display='none';
}
}
function toggle_messages(sub_code)
{
var containerid='message-list-'+clean_id(sub_code);
if(document.getElementById(containerid).innerHTML=='') {
var container=document.getElementById(containerid);
if(container.innerHTML=='') {
ajaxpage(messages_url+"?sub_code="+sub_code+'&user='+user,containerid);
container.style.display='block';
if(read_ptr[sub_code]==undefined)
read_ptr[sub_code]=0;
}
else
document.getElementById(containerid).innerHTML='';
else {
if(container.style.display=='none')
container.style.display='block';
else
container.style.display='none';
}
}
function toggle_subs(group_code)
{
var containerid='group-subs-'+clean_id(group_code);
if(document.getElementById(containerid).innerHTML=='')
var container=document.getElementById(containerid);
if(container.innerHTML=='') {
ajaxpage(subs_url+"?group_code="+group_code+'&user='+user,containerid);
else
document.getElementById(containerid).innerHTML='';
container.style.display='block';
}
else {
if(container.style.display=='none')
container.style.display='block';
else
container.style.display='none';
}
}
function reload_groups()
......
......@@ -16,7 +16,7 @@ for(group in msg_area.grp_list) {
<div class="group" id="message-group-<?xjs write(clean_id(group_code)) ?>">
<a class="group-description" href="javascript:toggle_subs('<?xjs write(group_code) ?>');"><?xjs write(msg_area.grp[group_code].description) ?></a>
<div class="group-subs" id="group-subs-<?xjs write(clean_id(group_code)) ?>"></div>
<div class="group-subs" style="display: none" id="group-subs-<?xjs write(clean_id(group_code)) ?>"></div>
</div>
<!-- End of groups.xjs -->
......
......@@ -27,8 +27,8 @@ if(new_stats[msg_number].inherit_new)
<span class="post_date"><?xjs write(strftime("%m/%d/%y @ %I:%M %p",headers[msg_number].when_written_time)) ?></span>
<span class="reply_count"><?xjs write(reply_count[msg_number]) ?></span>
<span class="newest_reply_date"><?xjs if(new_stats[msg_number].newest_reply) write(strftime("%m/%d/%y @ %I:%M %p",new_stats[msg_number].newest_reply)); ?></span>
<div class="message-body" id="message-body-<?xjs write(clean_id(sub_code)+'-'+msg_number) ?>"></div>
<div class="replies" id="replies-<?xjs write(clean_id(sub_code)+'-'+msg_number) ?>"><?xjs
<div class="message-body" style="display: none" id="message-body-<?xjs write(clean_id(sub_code)+'-'+msg_number) ?>"></div>
<div class="replies" style="disaply: <?xjs if(new_stats[msg_number].inherit_new) write('block'); else write('none'); ?>" id="replies-<?xjs write(clean_id(sub_code)+'-'+msg_number) ?>"><?xjs
/* Some of the replies are new... expand them! */
if(new_stats[msg_number].inherit_new) {
var moved_back=false;
......
......@@ -16,6 +16,10 @@ if(msg_area.sub[sub_code].index!=-1)
msgbase.open();
// If the If-Modified-Since is greater or equal to the newest import time, we're done!
if(msgbase.total_msgs==0) {
write(' '); // Make != ''
exit(0);
}
var hdr=msgbase.get_msg_header(true, msgbase.total_msgs-1,false);
var last_mod=new Date();
last_mod_time=hdr.when_imported_time;
......
......@@ -13,7 +13,7 @@ if(group!=-1) {
<div class="sub" id="sub-<?xjs write(clean_id(sub_code)) ?>">
<a class="sub-name" href="javascript:toggle_messages('<?xjs write(sub_code)?>')"><?xjs write(msg_area.sub[sub_code].name) ?></a>
<span class="sub-description"><?xjs write(msg_area.sub[sub_code].description) ?></span>
<div class="message-list" id="message-list-<?xjs write(clean_id(sub_code)); ?>"></div>
<div class="message-list" style="display: none" id="message-list-<?xjs write(clean_id(sub_code)); ?>"></div>
</div>
<?xjs
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment