From dd2abf2ea44b02bff72812de593a9e3976fe7f15 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 15 Oct 2010 21:56:44 +0000 Subject: [PATCH] libs/web: move XHR apply callback into subtemplate --- libs/web/luasrc/view/cbi/apply_xhr.htm | 56 ++++++++++++++++++++++++++++++++++ libs/web/luasrc/view/cbi/map.htm | 45 ++------------------------- 2 files changed, 59 insertions(+), 42 deletions(-) create mode 100644 libs/web/luasrc/view/cbi/apply_xhr.htm diff --git a/libs/web/luasrc/view/cbi/apply_xhr.htm b/libs/web/luasrc/view/cbi/apply_xhr.htm new file mode 100644 index 000000000..30e7a23b5 --- /dev/null +++ b/libs/web/luasrc/view/cbi/apply_xhr.htm @@ -0,0 +1,56 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2010 Jo-Philipp Wich + +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$ + +-%> + +<% export("cbi_apply_xhr", function(id, configs) -%> +
+ <%:Applying changes%> + + + <%:Loading%> + <%:Waiting for router...%> +
+<%- end) %> diff --git a/libs/web/luasrc/view/cbi/map.htm b/libs/web/luasrc/view/cbi/map.htm index be0c37aa7..666763d69 100644 --- a/libs/web/luasrc/view/cbi/map.htm +++ b/libs/web/luasrc/view/cbi/map.htm @@ -13,51 +13,12 @@ $Id$ -%> +<%-+cbi/apply_xhr-%> +
<% if self.title and #self.title > 0 then %>

<%=self.title%>

<% end %> <% if self.description and #self.description > 0 then %>
<%=self.description%>
<% end %> - <%- if self._apply then -%> -
- <%:Applying changes%> - - - <%:Loading%> - <%:Waiting for router...%> -
- <%- end -%> + <%- if self._apply then cbi_apply_xhr(self.config, self.parsechain) end -%> <%- self:render_children() %>
-- 2.11.0