summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--data/script.js3
-rw-r--r--lib/VNDB/Handler/Chars.pm2
-rw-r--r--lib/VNDBUtil.pm8
4 files changed, 8 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index a8ce144a..622a84f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
- Added 'select' all to wishlist and moved 'select all' down on notifies
- Added char/tag/trait stats to database statistics box
- Update traits_chars cache daily using Multi::Maintenance
+ - Toggle [spoiler] tag visibility with global setting rather than mouse-over
- Bugfix: don't accidentally remove char traits when editing
- Bugfix: fixed possible SQL table name clash on history browser
- Bugfix: properly announce chars and traits in Multi::IRC
diff --git a/data/script.js b/data/script.js
index 4fc3e49b..c2ede03c 100644
--- a/data/script.js
+++ b/data/script.js
@@ -2738,7 +2738,7 @@ if(byId('expandall')) {
}
-// charspoil handling (ugly)
+// charspoil handling
if(byId('charspoil_sel')) {
var k = byClass('charspoil');
var h = byName(byId('charspoil_sel'), 'a');
@@ -2746,6 +2746,7 @@ if(byId('charspoil_sel')) {
for(var i=0; i<k.length; i++)
setClass(k[i], 'hidden',
hasClass(k[i], 'charspoil_0') ? false :
+ hasClass(k[i], 'charspoil_-1') ? spoil > 1 :
hasClass(k[i], 'charspoil_1') ? spoil < 1 : spoil < 2);
for(var i=0; i<h.length; i++)
setClass(h[i], 'sel', spoil == i);
diff --git a/lib/VNDB/Handler/Chars.pm b/lib/VNDB/Handler/Chars.pm
index dfa289be..9308cecf 100644
--- a/lib/VNDB/Handler/Chars.pm
+++ b/lib/VNDB/Handler/Chars.pm
@@ -233,7 +233,7 @@ sub charTable {
td class => 'chardesc', colspan => 2;
h2 mt '_charp_description';
p;
- lit bb2html $r->{desc};
+ lit bb2html $r->{desc}, 0, 1;
end;
end;
end;
diff --git a/lib/VNDBUtil.pm b/lib/VNDBUtil.pm
index a0469a1c..76290013 100644
--- a/lib/VNDBUtil.pm
+++ b/lib/VNDBUtil.pm
@@ -27,8 +27,7 @@ sub shorten {
# v+, v+.+
# http://../
sub bb2html {
- my $raw = shift;
- my $maxlength = shift;
+ my($raw, $maxlength, $charspoil) = @_;
$raw =~ s/\r//g;
return '' if !$raw && $raw ne "0";
@@ -76,7 +75,8 @@ sub bb2html {
next;
} elsif($tag eq '[spoiler]') {
push @open, 'spoiler';
- $result .= '<b class="spoiler">';
+ $result .= !$charspoil ? '<b class="spoiler">'
+ : '<b class="grayedout charspoil charspoil_-1">&lt;hidden by spoiler settings&gt;</b><span class="charspoil charspoil_2 hidden">';
next;
} elsif($tag eq '[quote]') {
push @open, 'quote';
@@ -89,7 +89,7 @@ sub bb2html {
$rmnewline = 1;
next;
} elsif($tag eq '[/spoiler]' && $open[$#open] eq 'spoiler') {
- $result .= '</b>';
+ $result .= !$charspoil ? '</b>' : '</span>';
pop @open;
next;
} elsif($tag eq '[/quote]' && $open[$#open] eq 'quote') {