Skip to content

Commit

Permalink
Item11833: don't use getDisplayValue()
Browse files Browse the repository at this point in the history
... other than getting a mapped value.
  • Loading branch information
MichaelDaum committed Sep 17, 2014
1 parent 92b858e commit 22c5df2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
10 changes: 2 additions & 8 deletions JQueryPlugin/lib/Foswiki/Form/Color.pm
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,14 @@ sub renderForDisplay {

Foswiki::Plugins::JQueryPlugin::createPlugin("farbtastic");

my $displayValue = $this->getDisplayValue($value);
my $displayValue =
"<span class='jqFarbtasticFG' style='background-color:$value;width:$this->{size}em'>$value</span>";
$format =~ s/\$value\(display\)/$displayValue/g;
$format =~ s/\$value/$value/g;

return $this->SUPER::renderForDisplay( $format, $value, $attrs );
}

sub getDisplayValue {
my ( $this, $value ) = @_;

return
"<span class='jqFarbtasticFG' style='background-color:$value;width:$this->{size}em'>$value</span>";
}

1;
__END__
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
Expand Down
6 changes: 3 additions & 3 deletions JQueryPlugin/lib/Foswiki/Form/Rating.pm
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ sub renderForEdit {
sub renderForDisplay {
my ( $this, $format, $value, $attrs ) = @_;

my $displayValue = $this->getDisplayValue($value);
$format =~ s/\$value\(display\)/$displayValue/g;
$format =~ s/\$value\(display\)/$this->renderDisplayValue($value)/ge;
$format =~ s/\$value/$value/g;

return $this->SUPER::renderForDisplay( $format, $value, $attrs );
}

sub getDisplayValue {
sub renderDisplayValue {
my ( $this, $value ) = @_;

Foswiki::Plugins::JQueryPlugin::createPlugin("rating");
Expand Down

0 comments on commit 22c5df2

Please sign in to comment.