summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-12-28 17:45:47 +0100
committerYorhel <git@yorhel.nl>2009-12-28 17:45:47 +0100
commitc5bf1eec6899e143753d470f433df5f5bb980a4b (patch)
treef530aa7697c73b25d2766274e5f5d635037ebc95
parent31508415ce5eb6cd5c3de48a60e8a211dea22803 (diff)
Highlight opened VN/producer in relation graphs
The warnbg and warnborder colors from the skins are used for highlighting.
-rw-r--r--ChangeLog1
-rw-r--r--data/style.css2
-rw-r--r--lib/Multi/RG.pm11
-rw-r--r--lib/VNDB/Handler/Producers.pm1
-rw-r--r--lib/VNDB/Handler/VNPage.pm1
5 files changed, 11 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index c9816fe5..f99eb467 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,7 @@ git - ?
- Allow earlier selecting of release on screenshot upload
- Fixed bug with zero strings ("0") in the diff viewer
- Rewrote POE::Filter::VNDBAPI to be more generic
+ - Highlight opened VN/producer in relation graphs
2.9 - 2009-11-16
- Fixed another bug with the calculation of tags_vn_bayesian.spoiler
diff --git a/data/style.css b/data/style.css
index b926421e..7221459f 100644
--- a/data/style.css
+++ b/data/style.css
@@ -1212,4 +1212,6 @@ svg .edge polygon.border { fill: $border$ }
svg .nodebg { fill: $tabbg$; stroke: $tabbg$ }
svg text { fill: $maintext$ }
svg .edge text { font: 8px "Tahoma" }
+#graph_current .border { stroke: $warnborder$ }
+#graph_current .nodebg { stroke: $warnborder$; fill: $warnbg$ }
diff --git a/lib/Multi/RG.pm b/lib/Multi/RG.pm
index b3f9bb46..76408d92 100644
--- a/lib/Multi/RG.pm
+++ b/lib/Multi/RG.pm
@@ -158,7 +158,8 @@ sub savegraph {
$attr{class} = 'border' if $attr{stroke} && $attr{stroke} eq '#111111';
$attr{class} = 'nodebg' if $attr{fill} && $attr{fill} eq '#222222';
- delete @attr{qw|stroke fill id xmlns xmlns:xlink|};
+ delete @attr{qw|stroke fill xmlns xmlns:xlink|};
+ delete $attr{id} if $attr{id} && $attr{id} !~ /^node_[vp]\d+$/;
$el eq 'path' || $el eq 'polygon'
? $w->emptyTag("svg:$el", %attr)
: $w->startTag("svg:$el", %attr);
@@ -246,12 +247,12 @@ sub _vnnode {
$tooltip =~ s/"/\\"/g;
return sprintf
- qq|\tv%d [ URL = "/v%d", tooltip = "%s", label=<|.
+ qq|\tv%d [ id = "node_v%1\$d", URL = "/v%1\$d", tooltip = "%s", label=<|.
q|<TABLE CELLSPACING="0" CELLPADDING="1" BORDER="0" CELLBORDER="1" BGCOLOR="#222222">|.
q|<TR><TD COLSPAN="2" ALIGN="CENTER" CELLPADDING="2"><FONT POINT-SIZE="%d"> %s </FONT></TD></TR>|.
q|<TR><TD> %s </TD><TD> %s </TD></TR>|.
qq|</TABLE>> ]\n|,
- $_->{id}, $_->{id}, encode_utf8($tooltip), $heap->{fsize}[2], encode_utf8($title), $date, $n->{lang}||'N/A';
+ $_->{id}, encode_utf8($tooltip), $heap->{fsize}[2], encode_utf8($title), $date, $n->{lang}||'N/A';
}
@@ -298,12 +299,12 @@ sub _prodnode {
$tooltip =~ s/"/\\"/g;
return sprintf
- qq|\tp%d [ URL = "/p%d", tooltip = "%s", label=<|.
+ qq|\tp%d [ id = "node_p%1\$d", URL = "/p%1\$d", tooltip = "%s", label=<|.
q|<TABLE CELLSPACING="0" CELLPADDING="1" BORDER="0" CELLBORDER="1" BGCOLOR="#222222">|.
q|<TR><TD COLSPAN="2" ALIGN="CENTER" CELLPADDING="2"><FONT POINT-SIZE="%d"> %s </FONT></TD></TR>|.
q|<TR><TD ALIGN="CENTER"> $_lang_%s_$ </TD><TD ALIGN="CENTER"> $_ptype_%s_$ </TD></TR>|.
qq|</TABLE>> ]\n|,
- $_->{id}, $_->{id}, encode_utf8($tooltip), $heap->{fsize}[2], encode_utf8($name), $n->{lang}, $n->{type};
+ $_->{id}, encode_utf8($tooltip), $heap->{fsize}[2], encode_utf8($name), $n->{lang}, $n->{type};
}
diff --git a/lib/VNDB/Handler/Producers.pm b/lib/VNDB/Handler/Producers.pm
index d3f570ab..339fe8e0 100644
--- a/lib/VNDB/Handler/Producers.pm
+++ b/lib/VNDB/Handler/Producers.pm
@@ -26,6 +26,7 @@ sub rg {
my $title = mt '_prodrg_title', $p->{name};
return if $self->htmlRGHeader($title, 'p', $p);
+ $p->{svg} =~ s/id="node_p$pid"/id="graph_current"/;
$p->{svg} =~ s/\$___(_prodrel_[a-z]+)____\$/mt $1/eg;
$p->{svg} =~ s/\$(_lang_[a-z]+)_\$/mt $1/eg;
$p->{svg} =~ s/\$(_ptype_[a-z]+)_\$/mt $1/eg;
diff --git a/lib/VNDB/Handler/VNPage.pm b/lib/VNDB/Handler/VNPage.pm
index 6b1c6697..ff690c6b 100644
--- a/lib/VNDB/Handler/VNPage.pm
+++ b/lib/VNDB/Handler/VNPage.pm
@@ -29,6 +29,7 @@ sub rg {
my $title = mt '_vnrg_title', $v->{title};
return if $self->htmlRGHeader($title, 'v', $v);
+ $v->{svg} =~ s/id="node_v$vid"/id="graph_current"/;
$v->{svg} =~ s/\$___(_vnrel_[a-z]+)____\$/mt $1/eg;
div class => 'mainbox';