mirror of
				https://git.openwrt.org/project/luci.git
				synced 2025-10-31 10:49:03 +08:00 
			
		
		
		
	 ae8bbb814f
			
		
	
	ae8bbb814f
	
	
	
		
			
			* HTML Cleanup: Meta tags. * Converted charset to shorthand. * Removed meta tags with `Content-Script-Type` attribute. (Invalid in HTML5 spec.) * HTML Cleanup: CSS tags. * Removed `type` attribute with CSS files from link tags. (HTML5 spec recommends omitting it.) * Removed `type` attribute from style tags. (Deprecated in HTML5 spec.) https://html.spec.whatwg.org/#attr-link-type https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style * HTML Cleanup: Convert from XHTML to HTML5 * Removed XML declaration. * Removed XML namespace. * Changed doctype to HTML5. * HTML Cleanup: CDATA tags. * CDATA sections should not be used within HTML they are considered as comments and not displayed. https://developer.mozilla.org/en-US/docs/Web/API/CDATASection * HTML Cleanup: Script tags. * Removed `language` attribute from script tags. (No longer valid in HTML5) * Removed `type` attribute with JavaScript MIME type from script tags. (HTML5 spec recommends omitting it.) https://html.spec.whatwg.org/multipage/scripting.html#attr-script-type https://mimesniff.spec.whatwg.org/#javascript-mime-type Signed-off-by: Mustafa Can Elmacı <mustafacan@elmaci.net>
		
			
				
	
	
		
			60 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			60 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <%- if firstmap and messages then local msg; for _, msg in ipairs(messages) do -%>
 | |
| 	<div class="errorbox"><%=pcdata(msg)%></div>
 | |
| <%- end end -%>
 | |
| 
 | |
| <div class="cbi-map" id="cbi-<%=self.config%>">
 | |
| 	<% if self.title and #self.title > 0 then %>
 | |
| 		<h2 name="content"><%=self.title%></h2>
 | |
| 	<% end %>
 | |
| 	<% if self.description and #self.description > 0 then %>
 | |
| 		<div class="cbi-map-descr"><%=self.description%></div>
 | |
| 	<% end %>
 | |
| 	<%- if firstmap and (applymap or confirmmap) then -%>
 | |
| 		<%+cbi/apply_widget%>
 | |
| 		<% cbi_apply_widget() %>
 | |
| 		<div class="alert-message" id="cbi_apply_status" style="display:none"></div>
 | |
| 		<script>
 | |
| 			document.addEventListener("DOMContentLoaded", function() {
 | |
| 				<% if confirmmap then -%>
 | |
| 					uci_confirm(true, Date.now() + <%=confirmmap%> * 1000);
 | |
| 				<%- else -%>
 | |
| 					uci_apply(true);
 | |
| 				<%- end %>
 | |
| 			});
 | |
| 		</script>
 | |
| 	<%- end -%>
 | |
| 
 | |
| 	<% if self.tabbed then %>
 | |
| 		<div>
 | |
| 			<% for i, section in ipairs(self.children) do
 | |
| 			       tab = section.section or section.sectiontype %>
 | |
| 				<div class="cbi-tabcontainer"<%=
 | |
| 					attr("id", "container.m-%s.%s" %{ self.config, tab }) ..
 | |
| 					attr("data-tab", tab) ..
 | |
| 					attr("data-tab-title", section.title or tab)
 | |
| 				%>>
 | |
| 					<% section:render() %>
 | |
| 				</div>
 | |
| 			<% end %>
 | |
| 		</div>
 | |
| 
 | |
| 	<% else %>
 | |
| 		<%- self:render_children() %>
 | |
| 	<% end %>
 | |
| 
 | |
| 	<% if not self.save then -%>
 | |
| 		<div class="cbi-section-error">
 | |
| 			<% for _, section in ipairs(self.children) do %>
 | |
| 				<% if section.error and section.error[section.section] then -%>
 | |
| 					<ul><li>
 | |
| 						<%:One or more missing/invalid fields on tab%>: <%=section.title or section.section or section.sectiontype%>
 | |
| 					</li></ul>
 | |
| 				<%- end %>
 | |
| 			<% end %>
 | |
| 		</div>
 | |
| 	<%- end %>
 | |
| 
 | |
| 	<br />
 | |
| 
 | |
| </div>
 |