From 5264cbf1175e3ea73cf9bcf5087c5028e6cf3b1c Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sat, 4 Jan 2014 16:23:54 -0800 Subject: svc_conferencing, RT#24389 --- httemplate/elements/duration.html | 74 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 httemplate/elements/duration.html (limited to 'httemplate/elements/duration.html') diff --git a/httemplate/elements/duration.html b/httemplate/elements/duration.html new file mode 100644 index 000000000..106e56ba0 --- /dev/null +++ b/httemplate/elements/duration.html @@ -0,0 +1,74 @@ +<% $opt{'prefix'} %> + <% $maxlength %> + <% $style %> + <% $opt{autocomplete} ? 'autocomplete="off"' : '' %> + <% $opt{disabled} %> + <% $onchange %> + ><% $opt{'postfix'} %> + +<%init> + +my %opt = @_; + +my $value = length($opt{curr_value}) ? $opt{curr_value} : $opt{value}; +$value = $value / 60; + +my $onchange = $opt{'onchange'} + ? join(' ', map $_.'="'. $opt{'onchange'}. '(this)"', + qw( onChange onKeyDown onKeyUp onKeyPress ) + ) + : ''; + +$opt{'size'} ||= 4; +my $size = 'SIZE="'. $opt{'size'}. '"'; + +$opt{'maxlength'} ||= 3; +my $maxlength = 'MAXLENGTH="'. $opt{'maxlength'}. '"'; + +$opt{'disabled'} = &{ $opt{'disabled'} }( \%opt ) + if ref($opt{'disabled'}) eq 'CODE'; +$opt{'disabled'} = 'DISABLED' + if $opt{'disabled'} && $opt{'disabled'} !~ /disabled/i; # uuh... yeah? + +my @style = ref($opt{'style'}) + ? @{ $opt{'style'} } + : $opt{'style'} + ? ( $opt{'style'} ) + : (); + +push @style, 'text-align: '. $opt{'text-align'} + if $opt{'text-align'}; + +push @style, 'background-color: #dddddd' + if $opt{'disabled'} && ! $opt{'nodarken_disabled'}; + +my $style = scalar(@style) ? 'STYLE="'. join(';', @style). '"' : ''; + + -- cgit v1.2.1