diff -arcN kuttukibbs-1.0rc2/kuttukibbs.cgi kuttukibbs-1.0rc2-dom/kuttukibbs.cgi *** kuttukibbs-1.0rc2/kuttukibbs.cgi Mon Apr 12 21:29:09 2004 --- kuttukibbs-1.0rc2-dom/kuttukibbs.cgi Sun Nov 28 01:03:36 2004 *************** *** 231,236 **** --- 231,240 ---- # my $jsfn = "$fn_pref.js"; my $str = ""; my $cnt = $kb_js_display_max; + my $authors = ""; + my $comments = ""; + my $idx = 0; + for (my $i = $latest_id; $i >= 0; $i--) { next unless defined $com_hash{$i}; *************** *** 250,274 **** $m .= "..."; } # URL to anchor ! $m =~ s/((s?https?|ftp):\/\/$URLCHARS+)/$1<\/a>/ig; ! ! $str .= << "JS"; ! document.writeln('

_'); ! document.writeln('$n'); ! document.writeln(' [$m]

'); ! JS ; $cnt--; last if ($cnt <= 0); } if ((keys %com_hash) > $kb_js_display_max) { ! $str .= << "JS"; ! document.writeln('

_'); ! document.writeln('...

'); ! JS ! ; } save_file($jsfn, \$str); } --- 254,299 ---- $m .= "..."; } # URL to anchor ! # $m =~ s/((s?https?|ftp):\/\/$URLCHARS+)/
$1<\/a>/ig; ! # anchor to URL ! $n =~ s/(.*)<\/a>/$1/; ! ! $authors .= "\'$n\', "; ! $comments .= "\' \[$m\]\', "; ! $idx++; ; $cnt--; last if ($cnt <= 0); } if ((keys %com_hash) > $kb_js_display_max) { ! $authors .= "\' \', "; ! $comments .= "\'...\', "; ! $idx++; ! ; } + + $str .= << "JS"; + elem=document.getElementById('$logid'); + var ah = new Array($authors 0); + var cm = new Array($comments 0); + for (i = 0; i < $idx; i++) { + cc = document.createElement('p'); + sc = document.createElement('span'); + sc.setAttribute('class', 'canchor'); + ca = document.createTextNode('_ '); + cs = document.createElement('span'); + cs.setAttribute('class', 'commentator'); + ct = document.createTextNode(ah[i]); + c = document.createTextNode(cm[i]); + sc.appendChild(ca); + cs.appendChild(ct); + cc.appendChild(sc); + cc.appendChild(cs); + cc.appendChild(c); + elem.appendChild(cc); + } + JS save_file($jsfn, \$str); }