2008-07-07 22:00:56 +00:00
< %#
LuCI - Lua Configuration Interface
Copyright 2008 Steven Barth < steven @ midlink . org >
2010-04-26 21:42:10 +00:00
Copyright 2008-2010 Jo-Philipp Wich < xm @ subsignal . org >
2008-07-07 22:00:56 +00:00
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
$Id$
-%>
2008-04-11 18:29:19 +00:00
< %+cbi/valueheader%>
2009-10-10 14:47:37 +00:00
< input type = "<%=self.password and 'password" class = "cbi-input-password' or 'text" class = "cbi-input-text' %>" onchange = "cbi_d_update(this.id)" < % = attr ( " name " , cbid ) . . attr ( " id " , cbid ) . . attr ( " value " , self:cfgvalue ( section ) or self . default ) . . ifattr ( self . size , " size " ) % > />
2009-11-10 01:42:18 +00:00
< % if self.password then %>< img src = "<%=resource%>/cbi/reload.gif" style = "vertical-align:middle" title = "<%:Reveal/hide password%>" onclick = "var e = document.getElementById('<%=cbid%>'); e.type = (e.type=='password') ? 'text' : 'password';" / > < % end %>
2010-04-26 21:42:10 +00:00
< % if #self.keylist > 0 or self.datatype then -%>
2008-08-04 17:16:27 +00:00
< script type = "text/javascript" >
2010-04-26 21:42:10 +00:00
< % if #self.keylist > 0 then -%>
2008-08-04 17:16:27 +00:00
cbi_combobox_init('< %=cbid%>', {
< %-
for i, k in ipairs(self.keylist) do
-%>
2008-09-16 10:08:20 +00:00
< %-=string.format("%q", k) .. ":" .. string.format("%q", self.vallist[i])-%>
< %-if i< #self.keylist then-%>,< %-end-%>
2008-08-04 17:16:27 +00:00
< %-
end
-%>
2008-08-06 10:41:47 +00:00
}, '< %- if not self.rmempty and not self.optional then -%>
2009-11-22 20:33:16 +00:00
< %-: -- Please choose -- -%>
2008-08-19 17:02:40 +00:00
< %- end -%>', '
< %- if self.combobox_manual then -%>
< %-=self.combobox_manual-%>
< %- else -%>
2009-10-31 20:03:27 +00:00
< %-: -- custom -- -%>
2008-08-19 17:02:40 +00:00
< %- end -%>');
2010-04-26 21:42:10 +00:00
< %- end %>
< % if self.datatype then -%>
cbi_validate_field('< %=cbid%>', < %=tostring(self.optional == true)%>, '< %=self.datatype%>');
< %- end %>
2008-08-04 17:16:27 +00:00
< / script >
< % end -%>
2008-04-11 18:29:19 +00:00
< %+cbi/valuefooter%>