1class SpipSelect2Loader { 2 3 static on_select = function() { 4 let selector = 'select.select2'; 5 if (spipConfig?.select2?.selector) { 6 selector += ', ' + spipConfig.select2.selector; 7 } 8 // Select2 avec quelques options en plus... 9 document.querySelectorAll(selector).forEach(select => SpipSelect2.on_select(select)); 10 }; 11 12 static on_input = function() { 13 document.querySelectorAll('input.select2').forEach(input => SpipSelect2.on_input(input)); 14 }; 15 16 static fix_focus = function () { 17 jQuery(document).on('select2:open', () => { 18 (list => list[list.length - 1])(document.querySelectorAll('.select2-container--open .select2-search__field')).focus() 19 }); 20 }; 21 22 static onReady(fn) { 23 if (document.readyState !== 'loading') { 24 fn(); 25 } else { 26 document.addEventListener('DOMContentLoaded', fn); 27 } 28 } 29 30 static load() { 31 SpipSelect2Loader.on_select(); 32 SpipSelect2Loader.on_input(); 33 } 34} 35 36SpipSelect2Loader.onReady(SpipSelect2Loader.load); 37onAjaxLoad(SpipSelect2Loader.load); 38SpipSelect2Loader.onReady(SpipSelect2Loader.fix_focus);
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.