MCPcopy
hub / github.com/lengstrom/falcon / add

Function add

extension/js/preferences.js:4–31  ·  view source on GitHub ↗
(type, content)

Source from the content-addressed store, hash-verified

2 var allPageDisplay = null;
3
4 var add = function(type, content) {
5 var tab = document.getElementById("blacklist_tbl")
6 var row = tab.insertRow()
7 var stringCell = row.insertCell()
8 stringCell.innerHTML = content ? content : ""
9 stringCell.contentEditable = true
10 stringCell.setAttribute("placeholder", "Add a site...");
11
12 var typeCell = row.insertCell()
13 var selectCell = document.createElement('select');
14 selectCell.innerHTML = '<option value="PAGE">Specific Page</option> \
15 <option value="SITE">Entire Website</option> \
16 <option value="REGEX">Regex</option>'
17 selectCell.value = type
18
19 typeCell.appendChild(selectCell);
20
21 var enabledCell = row.insertCell()
22 enabledCell.innerHTML = "<input type='checkbox' checked></input>"
23 var deleteThisCell = document.createElement("a");
24 deleteThisCell.classList = ["delete"];
25 deleteThisCell.innerHTML = "Delete"
26 deleteThisCell.onclick = function(e) {
27 var r = e.target.parentElement.parentElement
28 r.parentNode.removeChild(r);
29 }
30 enabledCell.appendChild(deleteThisCell);
31 }
32
33 function cutString(stringToCut) {
34 if (stringToCut.length == 0)

Callers 2

preferences.jsFile · 0.85
saveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected