diff --git a/web/root/sajax-forum/body.xjs b/web/root/sajax-forum/body.xjs index d6b7394072efde26d0167dc54300ec2372ade611..e1dfedda20e92d9607920abd4d8b059b50b784c6 100644 --- a/web/root/sajax-forum/body.xjs +++ b/web/root/sajax-forum/body.xjs @@ -52,6 +52,9 @@ if(ANSI_formatted) { } } else { + var blockquote_start='<div class="quote"><a href="#" onclick="toggle_quote(this);return false">Show quote</a><blockquote style="display: none">'; + var blockquote_end='</blockquote></div>'; + writeln("<div class=\"ansi_toggle\"><a href=\"#\" onclick=\"load_ansi(this.parentNode.parentNode, "+html_sub_code_string+");return false\">ANSI Mode</a></div>"); // Strip CTRL-A body=body.replace(/\1./g,''); @@ -87,7 +90,7 @@ else { // If the new length is smaller than the old one, close the extras for(p=new_prefixes.length; p<prefixes.length; p++) { if(quote_depth > 0) { - line_prefix = line_prefix + '</blockquote>'; + line_prefix = line_prefix + blockquote_end; quote_depth--; } else { @@ -100,11 +103,11 @@ else { if(prefixes[p]==undefined) { /* New depth */ - line_prefix = line_prefix + '<blockquote>'; + line_prefix = line_prefix + blockquote_start; quote_depth++; } else if(broken) { - line_prefix = line_prefix + '<blockquote>'; + line_prefix = line_prefix + blockquote_start; quote_depth++; } else if(prefixes[p].replace(/^\s*(.*?)\s*$/,"$1") != new_prefixes[p].replace(/^\s*(.*?)\s*$/,"$1")) { @@ -112,14 +115,14 @@ else { var o; for(o=p; o<prefixes.length && o<new_prefixes.length; o++) { if(quote_depth > 0) { - line_prefix = '</blockquote>'+line_prefix; + line_prefix = blockquote_end+line_prefix; quote_depth--; } else { log("BODY: Depth problem 2"); } } - line_prefix = '<blockquote>'+line_prefix; + line_prefix = blockquote_start+line_prefix; quote_depth++; broken=true; } @@ -130,7 +133,7 @@ else { else { for(p=0; p<prefixes.length; p++) { if(quote_depth > 0) { - line_prefix = line_prefix + '</blockquote>'; + line_prefix = line_prefix + blockquote_end; quote_depth--; } else { @@ -145,7 +148,7 @@ else { if(quote_depth != 0) { log("BODY: Depth problem 4"); for(;quote_depth > 0; quote_depth--) { - body += "</blockquote>"; + body += blockquote_end; } } diff --git a/web/root/sajax-forum/client_functions.xjs b/web/root/sajax-forum/client_functions.xjs index 3db9d339b16c41c02d59ac3657cf676e0b77c953..3b727b8d0d6541910643ccf091702a4f8379794c 100644 --- a/web/root/sajax-forum/client_functions.xjs +++ b/web/root/sajax-forum/client_functions.xjs @@ -91,6 +91,25 @@ function toggle_replies(sub_code, message_number) } } +function toggle_quote(container) +{ + for(child in container.parentNode.childNodes) { + if(container.parentNode.childNodes[child].nodeName=='BLOCKQUOTE') { + switch(container.parentNode.childNodes[child].style.display) { + case 'none': + container.parentNode.childNodes[child].style.display='block'; + container.innerHTML="Hide quote"; + break; + default: + container.parentNode.childNodes[child].style.display='none'; + container.innerHTML="Show quote"; + break; + } + break; + } + } +} + function load_ansi(container, sub_code) { var message=container.parentNode.parentNode; diff --git a/web/root/sajax-forum/style.css b/web/root/sajax-forum/style.css index 6b3d73d842b0409cfbaa4645504e0f062d9bf7c3..aa5ee45821e18a2d9c77864d3d4be3c2bab50900 100644 --- a/web/root/sajax-forum/style.css +++ b/web/root/sajax-forum/style.css @@ -93,8 +93,23 @@ body { background-color: #999; } -blockquote { +.ansi_toggle { +} + +.quote { +} + +.quote a { + font-size: 25%; + margin: 0px; + margin-left: 20px; +} + +.quote blockquote { border-width: 1px; border-color: black; border-style: dashed; + margin: 5px; + margin-left: 20px; + margin-top: 0px; }