1function fontAwesomeCode() { 2 // Get the Font Awesome Icon field 3 var fontAwesomeIcon = jQuery('.fa-select2'); 4 var changedContent = jQuery('.select2-selection__rendered'); 5 6 // Get the icon preview element 7 var iconPreview = fontAwesomeIcon.find('span.acf-selection i'); 8 9 // Select the <i> tag itself 10 var icon = iconPreview.first(); 11 12 // Get the icon HTML 13 var iconHtml = icon.prop('outerHTML'); 14 15 16 // Get the existing element with the icon HTML 17 var existingElement = jQuery('code.l2-fa-icon'); 18 19 // Append the new element to the Font Awesome Icon field 20 existingElement.text(iconHtml); 21 22 // const iconElement = document.querySelector('.l2-fa-icon'); 23 // iconElement.insertAdjacentHTML('beforeend', iconHtml); 24 25 // Track changes to the Font Awesome Icon field 26 changedContent.on('DOMSubtreeModified', function() { 27 // Get the updated icon HTML 28 29 var newIconPreview = changedContent.find('span.acf-selection i'); 30 var newIcon = newIconPreview.first(); 31 var newIconHtml = newIcon.prop('outerHTML'); 32 var updatedIconHtml = newIconHtml; 33 34 // Update the text content of the new element with the updated icon HTML 35 existingElement.text(updatedIconHtml); 36 }); 37}; 38 39jQuery(document).ready(function() { 40 fontAwesomeCode(); 41 jQuery(document).on('click', '.acf-hl li', function() { 42 fontAwesomeCode(); 43 }); 44});
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.