* luci/libs/cbi: add css classes to input fields - needed for IE compat
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 7 Oct 2008 15:41:15 +0000 (15:41 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 7 Oct 2008 15:41:15 +0000 (15:41 +0000)
libs/cbi/luasrc/view/cbi/button.htm
libs/cbi/luasrc/view/cbi/dynlist.htm
libs/cbi/luasrc/view/cbi/fvalue.htm
libs/cbi/luasrc/view/cbi/lvalue.htm
libs/cbi/luasrc/view/cbi/mvalue.htm
libs/cbi/luasrc/view/cbi/tvalue.htm
libs/cbi/luasrc/view/cbi/upload.htm
libs/cbi/luasrc/view/cbi/value.htm

index c2a0d43..c660662 100644 (file)
@@ -14,7 +14,7 @@ $Id$
 -%>
 <%+cbi/valueheader%>
        <% if self:cfgvalue(section) ~= false then %>
-               <input<% if self.inputstyle then %> class="cbi-input-<%=self.inputstyle%>"<% end %> type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.title)%> />
+               <input class="cbi-input-<% self.inputstyle or "button" %>" type="submit"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self.title)%> />
        <% else %>
                -
        <% end %>
index 6068314..a23a4eb 100644 (file)
@@ -18,11 +18,11 @@ $Id$
        for i=1, #vals + 1 do
                local val = vals[i]
 %>
-       <input value="<%=val%>" onchange="cbi_d_update(this.id)" type="text"<%= attr("id", cbid .. "." .. i) .. attr("name", cbid) .. ifattr(self.size, "size")%> />
+       <input class="cbi-input-text" value="<%=val%>" onchange="cbi_d_update(this.id)" type="text"<%= attr("id", cbid .. "." .. i) .. attr("name", cbid) .. ifattr(self.size, "size")%> />
        <% if i <= #vals then %>
-               <input type="image" value="<%:cbi_del%>" name="cbi.rle.<%=section .. "." .. self.option .. "." .. i%>" alt="<%:cbi_del%>" title="<%:cbi_del%>" src="<%=resource%>/cbi/remove.gif" />
+               <input class="cbi-input-image" type="image" value="<%:cbi_del%>" name="cbi.rle.<%=section .. "." .. self.option .. "." .. i%>" alt="<%:cbi_del%>" title="<%:cbi_del%>" src="<%=resource%>/cbi/remove.gif" />
        <% else %>
-               <input type="image" value="<%:cbi_add%>" name="cbi.ale.<%=section .. "." .. self.option%>" alt="<%:cbi_add%>" title="<%:cbi_add%>" src="<%=resource%>/cbi/add.gif" />
+               <input class="cbi-input-image" type="image" value="<%:cbi_add%>" name="cbi.ale.<%=section .. "." .. self.option%>" alt="<%:cbi_add%>" title="<%:cbi_add%>" src="<%=resource%>/cbi/add.gif" />
        <% end %>
        <% if #self.keylist > 0 then -%>
                <script type="text/javascript">
index 4c977e2..b46817c 100644 (file)
@@ -13,5 +13,5 @@ $Id$
 
 -%>
 <%+cbi/valueheader%>
-       <input onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="checkbox"<%= attr("id", cbid) .. attr("name", cbid) .. ifattr(self:cfgvalue(section) == self.enabled, "checked", "checked") %> value="1" />
+       <input class="cbi-input-checkbox" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="checkbox"<%= attr("id", cbid) .. attr("name", cbid) .. ifattr(self:cfgvalue(section) == self.enabled, "checked", "checked") %> value="1" />
 <%+cbi/valuefooter%>
index 6d658c2..c6b5412 100644 (file)
@@ -14,7 +14,7 @@ $Id$
 -%>
 <%+cbi/valueheader%>
 <% if self.widget == "select" then %>
-       <select onchange="cbi_d_update(this.id)"<%= attr("id", cbid) .. attr("name", cbid) .. ifattr(self.size, "size") %>>
+       <select class="cbi-input-select" onchange="cbi_d_update(this.id)"<%= attr("id", cbid) .. attr("name", cbid) .. ifattr(self.size, "size") %>>
        <% for i, key in pairs(self.keylist) do -%>
                <option id="cbi-<%=self.config.."-"..section.."-"..self.option.."-"..key%>"<%= attr("value", key) .. ifattr(self:cfgvalue(section) == key, "selected", "selected") %>><%=striptags(self.vallist[i])%></option>
        <%- end %>
@@ -24,7 +24,7 @@ $Id$
        for i, key in pairs(self.keylist) do
        c = c + 1
 %>
-       <input onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="radio"<%= attr("id", cbid..c) .. attr("name", cbid) .. attr("value", key) .. ifattr(self:cfgvalue(section) == key, "checked", "checked") %> />
+       <input class="cbi-input-radio" onclick="cbi_d_update(this.id)" onchange="cbi_d_update(this.id)" type="radio"<%= attr("id", cbid..c) .. attr("name", cbid) .. attr("value", key) .. ifattr(self:cfgvalue(section) == key, "checked", "checked") %> />
        <label<%= attr("for", cbid..c) %>><%=self.vallist[i]%></label><br />
 <% if c == self.size then c = 0 %><br />
 <% end end %>
index 414089f..3812a3f 100644 (file)
@@ -17,7 +17,7 @@ local v = self:valuelist(section) or {}
 %>
 <%+cbi/valueheader%>
 <% if self.widget == "select" then %>
-       <select multiple="multiple"<%= attr("name", cbid) .. ifattr(self.size, "size") %>>
+       <select class="cbi-input-select" multiple="multiple"<%= attr("name", cbid) .. ifattr(self.size, "size") %>>
        <% for i, key in pairs(self.keylist) do -%>
                <option<%= attr("value", key) .. ifattr(luci.util.contains(v, key), "selected", "selected") %>><%=striptags(self.vallist[i])%></option>
        <%- end %>
@@ -27,7 +27,7 @@ local v = self:valuelist(section) or {}
        for i, key in pairs(self.keylist) do
        c = c + 1
 %>
-       <input type="checkbox"<%= attr("id", cbid..c) .. attr("name", cbid) .. attr("value", key) .. ifattr(luci.util.contains(v, key), "checked", "checked") %> />
+       <input class="cbi-input-checkbox" type="checkbox"<%= attr("id", cbid..c) .. attr("name", cbid) .. attr("value", key) .. ifattr(luci.util.contains(v, key), "checked", "checked") %> />
        <label<%= attr("for", cbid..c) %>><%=self.vallist[i]%></label><br />
 <% if c == self.size then c = 0 %><br />
 <% end end %>
index 4d92545..36782d8 100644 (file)
@@ -13,7 +13,7 @@ $Id$
 
 -%>
 <%+cbi/valueheader%>
-       <textarea<% if not self.size then %> style="width: 100%"<% else %> cols="<%=self.size%>"<% end %> onchange="cbi_d_update(this.id)"<%= attr("name", cbid) .. attr("id", cbid) .. ifattr(self.rows, "rows") .. ifattr(self.wrap, "wrap") %>>
+       <textarea class="cbi-input-textarea" <% if not self.size then %> style="width: 100%"<% else %> cols="<%=self.size%>"<% end %> onchange="cbi_d_update(this.id)"<%= attr("name", cbid) .. attr("id", cbid) .. ifattr(self.rows, "rows") .. ifattr(self.wrap, "wrap") %>>
        <%-=luci.util.pcdata(self:cfgvalue(section))-%>
        </textarea>
 <%+cbi/valuefooter%>
index 7e0ab1b..2c293cb 100644 (file)
@@ -21,8 +21,8 @@ $Id$
        <% if v then %>
                <%:cbi_upload Uploaded File%> (<%=t.byte_format(luci.fs.stat(v).size or 0)%>)
                <input type="hidden"<%= attr("value", v) .. attr("name", cbid) .. attr("id", cbid) %> />
-               <input type="image" value="<%:cbi_replace%>" name="cbi.rlf.<%=section .. "." .. self.option%>" alt="<%:cbi_replace%>" title="<%:cbi_replace%>" src="<%=resource%>/cbi/reload.gif" />
+               <input class="cbi-input-image" type="image" value="<%:cbi_replace%>" name="cbi.rlf.<%=section .. "." .. self.option%>" alt="<%:cbi_replace%>" title="<%:cbi_replace%>" src="<%=resource%>/cbi/reload.gif" />
        <% else %>
-               <input type="file"<%= attr("name", cbid) .. attr("id", cbid) %> />
+               <input class="cbi-input-file" type="file"<%= attr("name", cbid) .. attr("id", cbid) %> />
        <% end %>
 <%+cbi/valuefooter%>
index 9ffefc4..e6a7ab6 100644 (file)
@@ -13,7 +13,7 @@ $Id$
 
 -%>
 <%+cbi/valueheader%>
-       <input type="<%=self.password and 'password" class="cbi-input-key' or "text"%>" onchange="cbi_d_update(this.id)"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self:cfgvalue(section)) .. ifattr(self.size, "size")%> />
+       <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)) .. ifattr(self.size, "size")%> />
        <% if #self.keylist > 0 then -%>
        <script type="text/javascript">
                cbi_combobox_init('<%=cbid%>', {