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

Function createImageButton

src/htmlutil.js:240–265  ·  view source on GitHub ↗
(name, id, text, img, oc)

Source from the content-addressed store, hash-verified

238};
239
240var createImageButton = function(name, id, text, img, oc) {
241 var b = null;
242 var c = null;
243 var i = null;
244
245 b = crc('input', 'imgbutton button', name, id, 'bu', true);
246 c = crc('div', 'imgbutton_container', name, id, 'bu_container');
247 c.appendChild(b);
248
249 b.name = name;
250 b.key = id;
251 b.type = "button";
252
253 i = crc('img', 'imgbutton_image', name, id, 'bu_img', true);
254 i.src = img;
255 c.appendChild(i);
256 b.setAttribute('title', text);
257 i.setAttribute('title', text);
258
259 if (!b.inserted && oc) {
260 b.addEventListener("click", oc);
261 i.addEventListener("click", oc);
262 }
263
264 return c;
265};
266
267var createItemButton = function(name, i, oc) {
268 var b = null;

Callers

nothing calls this directly

Calls 1

crcFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…