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

Function createImageText

src/htmlutil.js:15–43  ·  view source on GitHub ↗
(src, name, id, append, title, oc, text)

Source from the content-addressed store, hash-verified

13 var Helper = Registry.get('helper');
14
15var createImageText = function(src, name, id, append, title, oc, text) {
16 var wrap = cr('div', name, id, append, 'wrap', true);
17 var image = cr('image', name, id, append, true);
18 var spos;
19
20 image.setAttribute("width", "16px");
21 image.setAttribute("height", "16px");
22 image.setAttribute("src", src);
23 wrap.setAttribute("style", "cursor: pointer;");
24 if (title) wrap.title = title;
25 wrap.key = id;
26 wrap.name = name;
27 wrap.alt = ' ?';
28
29 wrap.appendChild(image);
30 spos = crc('span', 'scriptpos', name, id, 'spos');
31 spos.textContent = text;
32 wrap.appendChild(spos);
33
34 if (oc && !wrap.inserted) {
35 var oco = function(evt) {
36 oc.apply(wrap, [ evt ]);
37 };
38 wrap.addEventListener("click", oco);
39 }
40 image.href = 'javascript://nop/';
41
42 return wrap;
43}
44
45var createFavicon = function(srcs, name, id, title) {
46 var image = cr('image', name, id, title.match(/[a-zA-Z0-9]/g).join(''));

Callers

nothing calls this directly

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…