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

Function createSearchBox

src/htmlutil.js:332–363  ·  view source on GitHub ↗
(tabURL)

Source from the content-addressed store, hash-verified

330};
331
332var createSearchBox = function(tabURL) {
333 var search = crc('div', 'searchbox', 'search_inner');
334 var search_mv = crc('div', 'searchbox_mv tv_tab', 'search_inner_mv');
335 var search_input = crc('input', 'searchbox_input', 'search_input');
336 var search_button = crc('input', 'searchbox_button', 'search_button');
337
338 search_input.type = "text";
339 search_input.value = tabURL;
340 search_button.type = "button";
341 search_button.value = "Go";
342
343 var onC = function() {
344 var v = search_input.value;
345 // if (v.split('/').length < 4) v += '/';
346 window.location = window.location.origin + window.location.pathname + "?url=" + encodeURI(v);
347 };
348
349 var onK = function(e) {
350 if (e && e.keyCode == 13) {
351 onC();
352 }
353 };
354
355 search_button.addEventListener('click', onC);
356 search_input.addEventListener('keyup', onK);
357
358 search_mv.appendChild(search_input);
359 search_mv.appendChild(search_button);
360
361 search.appendChild(search_mv);
362 return search;
363};
364
365Registry.register('htmlutil', {
366 createImageText : createImageText,

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…