1/** 2 * @file 3 * Defines ajax throbber theme functions. 4 * Credit to: Pierre Dureau (pdureau) for the initial code. 5 */ 6 7((Drupal) => { 8 /** 9 * An animated progress throbber and container element for AJAX operations. 10 * 11 * @param {string} [message] 12 * (optional) The message shown on the UI. 13 * @return {string} 14 * The HTML markup for the throbber. 15 */ 16 Drupal.theme.ajaxProgressThrobber = (message) => { 17 // Build markup without adding extra white space since it affects rendering. 18 const messageMarkup = 19 typeof message === 'string' 20 ? Drupal.theme('ajaxProgressMessage', message) 21 : ''; 22 23 if (messageMarkup === '') { 24 const defaultMessage = Drupal.t('Loading...'); 25 return `<div class="ajax-progress ajax-progress-throbber"> 26 <div class="spinner-border spinner-border-sm" role="status"> 27 <span class="visually-hidden">${defaultMessage}</span> 28 </div> 29 </div>`; 30 } 31 32 return `<div class="ajax-progress ajax-progress-throbber"> 33 <span class="spinner-border spinner-border-sm" aria-hidden="true"></span> 34 ${messageMarkup} 35 </div>`; 36 }; 37 38 /** 39 * Formats text accompanying the AJAX progress throbber. 40 * 41 * @param {string} message 42 * The message shown on the UI. 43 * @return {string} 44 * The HTML markup for the throbber. 45 */ 46 Drupal.theme.ajaxProgressMessage = (message) => 47 `<span role="status">${message}</span>`; 48})(Drupal);
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.