MCPcopy Create free account
hub / github.com/Tampermonkey/tampermonkey / createInput

Function createInput

src/htmlutil.js:127–148  ·  view source on GitHub ↗
(name, i, oc)

Source from the content-addressed store, hash-verified

125};
126
127var createInput = function(name, i, oc) {
128 var s = cr('div', i.name, i.id, 'input');
129 s.key = i.id;
130 var input = cr('input', i.name, i.id, 'input', true);
131 var n = name.split('##');
132 input.name = i.name;
133 input.key = i.id;
134 input.oldvalue = i.value;
135 input.value = (i.value != undefined) ? i.value : '';
136 input.type = "text";
137 if (oc && !input.inserted) input.addEventListener("change", oc);
138 var span1 = crc('span', 'optiondesc', i.name, i.id, 's1');
139 var span2 = cr('span', i.name, i.id, 's2');
140 span1.textContent = n[0] + ':';
141 if (n.length > 1) span2.textContent = n[1];
142 s.appendChild(span1);
143 s.appendChild(input);
144 s.appendChild(span2);
145 if (i.enabledBy) s.setAttribute('name', 'enabled_by_' + i.enabledBy);
146
147 return { elem: s, input: input };
148};
149
150var createCheckbox = function(name, i, oc) {
151 var s = crc('div', 'checkbox', i.name, i.id, 'cb1');

Callers 1

createPasswordFunction · 0.85

Calls 2

crFunction · 0.85
crcFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…