1/** 2 * Button Component (Vencord-inspired) 3 * Reusable button component 4 */ 5 6window.ChatroomButton = (function() { 7 'use strict'; 8 9 /** 10 * Create a button element 11 */ 12 function create(options = {}) { 13 const { 14 text = '', 15 icon = '', 16 onClick = null, 17 className = '', 18 title = '', 19 variant = 'default', // default, primary, danger, ghost 20 size = 'medium', // small, medium, large 21 disabled = false 22 } = options; 23 24 const button = document.createElement('button'); 25 button.className = `chatroom-btn chatroom-btn-${variant} chatroom-btn-${size} ${className}`; 26 if (title) button.title = title; 27 if (disabled) button.disabled = true; 28 29 if (icon) { 30 const iconSpan = document.createElement('span'); 31 iconSpan.className = 'btn-icon'; 32 iconSpan.textContent = icon; 33 button.appendChild(iconSpan); 34 } 35 36 if (text) { 37 const textSpan = document.createElement('span'); 38 textSpan.className = 'btn-text'; 39 textSpan.textContent = text; 40 button.appendChild(textSpan); 41 } 42 43 if (onClick) { 44 button.addEventListener('click', onClick); 45 } 46 47 return button; 48 } 49 50 return { 51 create 52 }; 53})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.