From 3c4bc228a1f7b5731cf464f3f407c9ed9ace3cd2 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 3 Apr 2020 10:00:06 +0200 Subject: treewide: import utility classes explicitly Signed-off-by: Jo-Philipp Wich --- .../htdocs/luci-static/resources/tools/firewall.js | 8 +++++--- .../htdocs/luci-static/resources/view/firewall/custom.js | 3 ++- .../htdocs/luci-static/resources/view/firewall/forwards.js | 3 ++- .../htdocs/luci-static/resources/view/firewall/rules.js | 3 ++- .../htdocs/luci-static/resources/view/firewall/snats.js | 3 ++- .../htdocs/luci-static/resources/view/firewall/zones.js | 3 ++- 6 files changed, 15 insertions(+), 8 deletions(-) (limited to 'applications/luci-app-firewall') diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js b/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js index 640b28cf7..e85b6bc6e 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/tools/firewall.js @@ -1,4 +1,6 @@ 'use strict'; +'require baseclass'; +'require dom'; 'require ui'; 'require uci'; 'require form'; @@ -81,7 +83,7 @@ function lookupProto(x) { return [ -1, x, x ]; } -return L.Class.extend({ +return baseclass.extend({ fmt: function(fmtstr, args, values) { var repl = [], wrap = false, @@ -112,7 +114,7 @@ return L.Class.extend({ }; var isset = function(val) { - if (L.isObject(val) && !L.dom.elem(val)) { + if (L.isObject(val) && !dom.elem(val)) { for (var k in val) if (val.hasOwnProperty(k)) return true; @@ -128,7 +130,7 @@ return L.Class.extend({ }; var parse = function(tokens, text) { - if (L.dom.elem(text)) { + if (dom.elem(text)) { tokens.push(''.format(values.length)); values.push(text); } diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/custom.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/custom.js index 9feafd824..ca870552a 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/custom.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/custom.js @@ -1,8 +1,9 @@ 'use strict'; +'require view'; 'require fs'; 'require ui'; -return L.view.extend({ +return view.extend({ load: function() { return L.resolveDefault(fs.read('/etc/firewall.user'), ''); }, diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js index 916a32fca..82703c320 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require ui'; 'require rpc'; 'require uci'; @@ -84,7 +85,7 @@ function rule_target_txt(s) { }); } -return L.view.extend({ +return view.extend({ callHostHints: rpc.declare({ object: 'luci-rpc', method: 'getHostHints', diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js index ada05f24c..8cb1a1242 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/rules.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require ui'; 'require rpc'; 'require uci'; @@ -136,7 +137,7 @@ function rule_target_txt(s, ctHelpers) { } } -return L.view.extend({ +return view.extend({ callHostHints: rpc.declare({ object: 'luci-rpc', method: 'getHostHints', diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js index 8a1d41e71..859dba3e8 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require ui'; 'require rpc'; 'require uci'; @@ -90,7 +91,7 @@ function rule_target_txt(s) { } } -return L.view.extend({ +return view.extend({ callHostHints: rpc.declare({ object: 'luci-rpc', method: 'getHostHints', diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js index 85c126d7a..85e20a23c 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/zones.js @@ -1,4 +1,5 @@ 'use strict'; +'require view'; 'require rpc'; 'require uci'; 'require form'; @@ -7,7 +8,7 @@ 'require tools.firewall as fwtool'; 'require tools.widgets as widgets'; -return L.view.extend({ +return view.extend({ callConntrackHelpers: rpc.declare({ object: 'luci', method: 'getConntrackHelpers', -- cgit v1.2.3