MCPcopy Create free account
hub / github.com/philc/vimium / setForm

Function setForm

pages/exclusion_rules_editor.js:15–27  ·  view source on GitHub ↗
(exclusionRules = [])

Source from the content-addressed store, hash-verified

13
14 // - exclusionRules: the value obtained from settings, with the shape [{pattern, passKeys}].
15 setForm(exclusionRules = []) {
16 const rulesTable = document.querySelector("#exclusion-rules");
17 // Remove any previous rows.
18 const existingRuleEls = rulesTable.querySelectorAll(".rule");
19 for (const el of existingRuleEls) {
20 el.remove();
21 }
22
23 const rowTemplate = document.querySelector("#exclusion-rule-template").content;
24 for (const rule of exclusionRules) {
25 this.addRow(rule.pattern, rule.passKeys);
26 }
27 },
28
29 // `pattern` and `passKeys` are optional.
30 addRow(pattern, passKeys) {

Callers

nothing calls this directly

Calls 1

removeMethod · 0.80

Tested by

no test coverage detected