MCPcopy
hub / github.com/Tampermonkey/tampermonkey / createOptionsMenu

Function createOptionsMenu

src/options.js:720–792  ·  view source on GitHub ↗
(items, noWarn)

Source from the content-addressed store, hash-verified

718};
719
720var createOptionsMenu = function(items, noWarn) {
721
722 gNoWarn = noWarn;
723
724 if (!items) {
725 console.log("options: items is empty!");
726 return;
727 }
728 allItems = items;
729
730 var o = document.getElementById('options')
731 var main = crc('div', 'main_container p100100', 'options', 'main');
732
733 if (o) {
734 var p = o.parentNode;
735 p.removeChild(o);
736 p.appendChild(main);
737 document.body.setAttribute('class', 'main');
738 }
739
740 if (V) console.log("options: head");
741
742 var head = crc('div', 'head_container', 'opt', 'head_container');
743 var tv = crc('div', 'tv_container', 'opt', 'tv_container');
744
745 var heada = cr('a', 'head_link', 'fire', 'head_link');
746 heada.href="http://tampermonkey.net";
747 heada.target="_blank";
748
749 var head1 = crc('div', 'float margin4', 'fire', 'head1');
750 var image = crc('img', 'banner', 'fire');
751 image.src = chrome.extension.getURL('images/icon128.png');
752
753 var head2 = crc('div', 'float head margin4', 'fire', 'head2');
754 var heading = cr('div', 'fire');
755
756 var ver = crc('div', 'version', 'version', 'version');
757 ver.textContent = ' by Jan Biniok';
758
759 var search = cr('div', 'search', 'box', '');
760
761 heading.textContent = "T" + "amper" + "m" + "onkey";
762
763 head1.appendChild(image);
764 head2.appendChild(heading);
765 head2.appendChild(ver);
766
767 heada.appendChild(head1);
768 heada.appendChild(head2);
769
770 head.appendChild(heada);
771 head.appendChild(search);
772
773 main.appendChild(head);
774 main.appendChild(tv);
775
776 if (V) console.log("options: tabView");
777 var tabv = TabView.create('_main', tv);

Callers 1

scheduleReCreateFunction · 0.85

Calls 4

crcFunction · 0.85
crFunction · 0.85
createUtilTabFunction · 0.85
itemsToMenuFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…