luci-app-adblock: sync with adblock-4.2.0
authorDirk Brenken <dev@brenken.org>
Sun, 11 Aug 2024 07:46:07 +0000 (09:46 +0200)
committerDirk Brenken <dev@brenken.org>
Sun, 11 Aug 2024 07:46:07 +0000 (09:46 +0200)
* add hagezi support

Signed-off-by: Dirk Brenken <dev@brenken.org>
(cherry picked from commit 257cfac4257571581bd32430757c94a783d4e1e5)
Signed-off-by: Dirk Brenken <dev@brenken.org>
applications/luci-app-adblock/htdocs/luci-static/resources/view/adblock/overview.js

index 9b0aa5bc0dae646023f2947e8875f17d6f590c4e..744d2d51b69037bf9f582ba581bbe882d3adda86 100644 (file)
@@ -597,6 +597,22 @@ return view.extend({
                o.optional = true;
                o.rmempty = true;
 
+               o = s.taboption('sources', form.DummyValue, '_sub');
+               o.rawhtml = true;
+               o.default = '<em><b>Hagezi List Selection</b></em>';
+
+               o = s.taboption('sources', form.DynamicList, 'adb_hag_sources', _('Variants'));
+               for (var i = 0; i < categories.length; i++) {
+                       code = categories[i].match(/^(\w+);/)[1].trim();
+                       if (code === 'hag') {
+                               list = categories[i].match(/^\w+;(.*);/)[1].trim();
+                               path = categories[i].match(/^.*;(.*$)/)[1].trim();
+                               o.value(path, list);
+                       }
+               }
+               o.optional = true;
+               o.rmempty = true;
+
                return m.render();
        },
        handleReset: null