X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-app-adblock%2Fluasrc%2Fmodel%2Fcbi%2Fadblock%2Fconfiguration_tab.lua;h=1607f1440a6c959f4fd927d62138487102f977fe;hp=035b99e5e31c72283a1e06b44aed9e764ac1021f;hb=9b4b1dfebdf6818231898a7f4fb80774bc106e26;hpb=dbc156f40ad5fc7294be7b78cc6eb8a59857197f diff --git a/applications/luci-app-adblock/luasrc/model/cbi/adblock/configuration_tab.lua b/applications/luci-app-adblock/luasrc/model/cbi/adblock/configuration_tab.lua index 035b99e5e..1607f1440 100644 --- a/applications/luci-app-adblock/luasrc/model/cbi/adblock/configuration_tab.lua +++ b/applications/luci-app-adblock/luasrc/model/cbi/adblock/configuration_tab.lua @@ -1,4 +1,3 @@ --- Copyright 2016 Hannu Nyman -- Copyright 2017 Dirk Brenken (dev@brenken.org) -- This is free software, licensed under the Apache License, Version 2.0 @@ -8,29 +7,32 @@ local adbinput = "/etc/config/adblock" if not nixio.fs.access(adbinput) then m = SimpleForm("error", nil, translate("Input file not found, please check your configuration.")) + m.reset = false + m.submit = false return m end m = SimpleForm("input", nil) - m:append(Template("adblock/config_css")) +m:append(Template("adblock/config_css")) +m.reset = false s = m:section(SimpleSection, nil, -translate("This form allows you to modify the content of the main adblock configuration file (/etc/config/adblock).")) + translate("This form allows you to modify the content of the main adblock configuration file (/etc/config/adblock).")) f = s:option(TextValue, "data") - f.rmempty = true - f.rows = 20 +f.rows = 20 +f.rmempty = true - function f.cfgvalue() - return nixio.fs.readfile(adbinput) or "" - end +function f.cfgvalue() + return nixio.fs.readfile(adbinput) or "" +end - function f.write(self, section, data) - return nixio.fs.writefile(adbinput, "\n" .. util.trim(data:gsub("\r\n", "\n")) .. "\n") - end +function f.write(self, section, data) + return nixio.fs.writefile(adbinput, "\n" .. util.trim(data:gsub("\r\n", "\n")) .. "\n") +end - function s.handle(self, state, data) - return true - end +function s.handle(self, state, data) + return true +end return m