111 |
|
|
112 |
$diff = $self->html_escape( $diff ); |
$diff = $self->html_escape( $diff ); |
113 |
$self->add_css( qq| |
$self->add_css( qq| |
114 |
|
pre span.add, |
115 |
|
pre span.del { |
116 |
|
float: left; |
117 |
|
width: 100%; |
118 |
|
} |
119 |
pre span.add { background: #dfd } |
pre span.add { background: #dfd } |
120 |
pre span.del { background: #fdd } |
pre span.del { background: #fdd } |
121 |
pre form.inline { display: inline } |
pre form.inline { display: inline } |
122 |
| ); |
| ); |
123 |
$diff =~ s{^(\+.+?)$}{<span class="add">$1</span>}gm; |
$diff =~ s{^(\+.*?)$}{<span class="add">$1</span>}gm; |
124 |
$diff =~ s{^(\-.+?)$}{<span class="del">$1</span>}gm; |
$diff =~ s{^(\-.*?)$}{<span class="del">$1</span>}gm; |
125 |
sub form { |
sub form { |
126 |
my ( $path, $action ) = @_; |
my ( $path, $action ) = @_; |
127 |
qq|<form class="inline" method="post"><input type="hidden" name="path" value="$path"><input type="submit" name="action" value="$action"></form>|; |
qq|<form class="inline" method="post"><input type="hidden" name="path" value="$path"><input type="submit" name="action" value="$action"></form>|; |
171 |
return qq| |
return qq| |
172 |
Command <tt>$cmd</tt> produced output: |
Command <tt>$cmd</tt> produced output: |
173 |
<pre style="background: #ff8;">$out</pre> |
<pre style="background: #ff8;">$out</pre> |
174 |
|
<a href="">reload page</a> to prevent this post from triggering again |
175 |
|; |
|; |
176 |
} |
} |
177 |
|
|