From ebaa50ecd81bdf4888661e1d41ef7e38a1bf3521 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Old=C5=99ich=20Jedli=C4=8Dka?= Date: Sat, 24 Oct 2020 19:18:11 +0200 Subject: [PATCH 1/3] luci-base: Replace legend element with h3. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The legend HTML element is allowed only as first element in fieldset, so use h3 instead, which is rendered the same within themes. Fixes #3149. Signed-off-by: Oldřich Jedlička --- modules/luci-base/htdocs/luci-static/resources/form.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js index 568a4abb6a..612c8ff944 100644 --- a/modules/luci-base/htdocs/luci-static/resources/form.js +++ b/modules/luci-base/htdocs/luci-static/resources/form.js @@ -2219,7 +2219,7 @@ var CBITypedSection = CBIAbstractSection.extend(/** @lends LuCI.form.TypedSectio }); if (this.title != null && this.title != '') - sectionEl.appendChild(E('legend', {}, this.title)); + sectionEl.appendChild(E('h3', {}, this.title)); if (this.description != null && this.description != '') sectionEl.appendChild(E('div', { 'class': 'cbi-section-descr' }, this.description)); @@ -3138,7 +3138,7 @@ var CBINamedSection = CBIAbstractSection.extend(/** @lends LuCI.form.NamedSectio }); if (typeof(this.title) === 'string' && this.title !== '') - sectionEl.appendChild(E('legend', {}, this.title)); + sectionEl.appendChild(E('h3', {}, this.title)); if (typeof(this.description) === 'string' && this.description !== '') sectionEl.appendChild(E('div', { 'class': 'cbi-section-descr' }, this.description)); From 4775d1ad226b39eb4b0981c89f2407c91a8c3102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Old=C5=99ich=20Jedli=C4=8Dka?= Date: Sat, 24 Oct 2020 19:18:20 +0200 Subject: [PATCH 2/3] luci-compat: Replace legend element with h3. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The legend HTML element is allowed only as first element in fieldset, so use h3 instead, which is rendered the same within themes. Fixed #3149. Signed-off-by: Oldřich Jedlička --- modules/luci-compat/luasrc/view/cbi/nsection.htm | 4 ++-- modules/luci-compat/luasrc/view/cbi/nullsection.htm | 2 +- modules/luci-compat/luasrc/view/cbi/tsection.htm | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/luci-compat/luasrc/view/cbi/nsection.htm b/modules/luci-compat/luasrc/view/cbi/nsection.htm index faceffeedf..511a59b6f3 100644 --- a/modules/luci-compat/luasrc/view/cbi/nsection.htm +++ b/modules/luci-compat/luasrc/view/cbi/nsection.htm @@ -1,7 +1,7 @@ <% if self:cfgvalue(self.section) then section = self.section %>
<% if self.title and #self.title > 0 then -%> - <%=self.title%> +

<%=self.title%>

<%- end %> <% if self.description and #self.description > 0 then -%>
<%=self.description%>
@@ -19,7 +19,7 @@ <% if self.template_addremove then include(self.template_addremove) else -%>
<% if self.title and #self.title > 0 then -%> - <%=self.title%> +

<%=self.title%>

<%- end %>
<%=self.description%>
diff --git a/modules/luci-compat/luasrc/view/cbi/nullsection.htm b/modules/luci-compat/luasrc/view/cbi/nullsection.htm index 7230719d19..156f29d18c 100644 --- a/modules/luci-compat/luasrc/view/cbi/nullsection.htm +++ b/modules/luci-compat/luasrc/view/cbi/nullsection.htm @@ -1,6 +1,6 @@
<% if self.title and #self.title > 0 then -%> - <%=self.title%> +

<%=self.title%>

<%- end %> <% if self.description and #self.description > 0 then -%>
<%=self.description%>
diff --git a/modules/luci-compat/luasrc/view/cbi/tsection.htm b/modules/luci-compat/luasrc/view/cbi/tsection.htm index b7718fa0f3..45e51cc69f 100644 --- a/modules/luci-compat/luasrc/view/cbi/tsection.htm +++ b/modules/luci-compat/luasrc/view/cbi/tsection.htm @@ -1,6 +1,6 @@
<% if self.title and #self.title > 0 then -%> - <%=self.title%> +

<%=self.title%>

<%- end %> <% if self.error_msg and #self.error_msg > 0 then -%>
From b03a508c6c5923e18ade8e8fce256cefbd5ad302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Old=C5=99ich=20Jedli=C4=8Dka?= Date: Sun, 25 Oct 2020 12:11:24 +0100 Subject: [PATCH 3/3] luci-theme-material: Fix section title padding. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After moving section title from `legend`, which was translated to `span` with style `panel-title`, to `h3`, update also CSS style to match first `h3` in `cbi-section`. Signed-off-by: Oldřich Jedlička --- .../htdocs/luci-static/material/cascade.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/themes/luci-theme-material/htdocs/luci-static/material/cascade.css b/themes/luci-theme-material/htdocs/luci-static/material/cascade.css index f3922c00f9..dfa9c5dc03 100644 --- a/themes/luci-theme-material/htdocs/luci-static/material/cascade.css +++ b/themes/luci-theme-material/htdocs/luci-static/material/cascade.css @@ -754,7 +754,6 @@ fieldset > fieldset, border-bottom: thin solid #eee; } -.cbi-section > h3:first-child, .cbi-section > h4:first-child, .cbi-section > p:first-child, [data-tab-title] > h3:first-child, @@ -2547,6 +2546,7 @@ input[name="nslookup"] { padding: .2rem .5rem; } + .cbi-section > h3:first-child, .panel-title { font-size: 1.1rem; padding-bottom: 1rem; @@ -2951,6 +2951,7 @@ input[name="nslookup"] { display: none; } + .cbi-section > h3:first-child, .panel-title { font-size: 1.4rem; padding-bottom: 1rem;