Commit 6ec68e0e authored by Daniel Moberly's avatar Daniel Moberly Committed by Daniel Moberly
Browse files

Issue #3179775 by Daniel.Moberly: Font Awesome 6 Prep

parent f4a4ba80
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10,5 +10,6 @@ use_regular_file: true
use_light_file: true
use_brands_file: true
use_duotone_file: true
use_thin_file: true
external_svg_integrity: null
bypass_validation: false
+3 −0
Original line number Diff line number Diff line
@@ -41,6 +41,9 @@ fontawesome.settings:
    use_duotone_file:
      type: boolean
      label: 'Use the Font Awesome duotone icons file'
    use_thin_file:
      type: boolean
      label: 'Use the Font Awesome thin icons file'
    external_svg_integrity:
      type: string
      label: 'Integrity value of the external CDN for Font Awesome'
+3 −3
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ function fontawesome_requirements($phase) {
  // Report the version of Font Awesome.
  if ($phase == 'runtime') {
    $requirements['fontawesome'] = [
      'title' => t('Font Awesome 5'),
      'title' => t('Font Awesome'),
    ];

    // Load the configuration settings.
@@ -68,7 +68,7 @@ function fontawesome_requirements($phase) {
      }

      $requirements['fontawesome']['severity'] = REQUIREMENT_OK;
      $requirements['fontawesome']['value'] = t('Font Awesome 5 library is installed. Using %version version. (@moreInfoLink)', [
      $requirements['fontawesome']['value'] = t('Font Awesome library is installed. Using %version version. (@moreInfoLink)', [
        '%version' => $version,
        '@moreInfoLink' => Link::createFromRoute(t('more information'), 'fontawesome.admin_settings')->toString(),
      ]);
@@ -83,7 +83,7 @@ function fontawesome_requirements($phase) {
    else {
      $requirements['fontawesome']['severity'] = REQUIREMENT_ERROR;
      $requirements['fontawesome']['value'] = t('Not installed');
      $requirements['fontawesome']['description'] = t('The Font Awesome 5 library could not be found. If you want this module to handle loading your FontAwesome assets, please verify Font Awesome 5 is installed correctly or that the CDN has been activated and properly configured. Please see the @adminPage and the Font Awesome module README file for more details.', [
      $requirements['fontawesome']['description'] = t('The Font Awesome library could not be found. If you want this module to handle loading your FontAwesome assets, please verify Font Awesome is installed correctly or that the CDN has been activated and properly configured. Please see the @adminPage and the Font Awesome module README file for more details.', [
        '@adminPage' => Link::createFromRoute(t('admin page'), 'fontawesome.admin_settings')->toString(),
      ]);
    }
+20 −2
Original line number Diff line number Diff line
fontawesome.svg:
  remote: &fontawesome_remote https://use.fontawesome.com/releases/v5.15.4/fontawesome-free-5.15.4-web.zip
  remote: &fontawesome_remote https://use.fontawesome.com/releases/v6.1.0/fontawesome-free-6.1.0-web.zip
  license: &fontawesome_svg_license
    name: CC BY 4.0
    url: https://fontawesome.com/license
    gpl-compatible: true
  version: &fontawesome_version "5.15.4"
  version: &fontawesome_version "6.1.0"
  header: true
  js:
    /libraries/fontawesome/js/all.min.js: { minified: true, attributes: { defer: true } }
@@ -70,6 +70,15 @@ fontawesome.svg.duotone:
  dependencies:
    - fontawesome/fontawesome.svg.base

fontawesome.svg.thin:
  version: *fontawesome_version
  license: *fontawesome_svg_license
  header: true
  js:
    /libraries/fontawesome/js/thin.min.js: { minified: true, attributes: { defer: true } }
  dependencies:
    - fontawesome/fontawesome.svg.base

fontawesome.webfonts:
  remote: *fontawesome_remote
  license: &fontawesome_webfonts_license
@@ -133,6 +142,15 @@ fontawesome.webfonts.duotone:
  dependencies:
    - fontawesome/fontawesome.webfonts.base

fontawesome.webfonts.thin:
  version: *fontawesome_version
  license: *fontawesome_webfonts_license
  css:
    theme:
      /libraries/fontawesome/css/thin.min.css: { minified: true }
  dependencies:
    - fontawesome/fontawesome.webfonts.base

fontawesome.webfonts.shim:
  version: *fontawesome_version
  license: *fontawesome_webfonts_license
+4 −0
Original line number Diff line number Diff line
@@ -249,6 +249,7 @@ function fontawesome_page_attachments(array &$page) {
    'use_light_file' => is_null($configuration_settings->get('use_light_file')) === TRUE ? TRUE : $configuration_settings->get('use_light_file'),
    'use_brands_file' => is_null($configuration_settings->get('use_brands_file')) === TRUE ? TRUE : $configuration_settings->get('use_brands_file'),
    'use_duotone_file' => is_null($configuration_settings->get('use_duotone_file')) === TRUE ? TRUE : $configuration_settings->get('use_duotone_file'),
    'use_thin_file' => is_null($configuration_settings->get('use_thin_file')) === TRUE ? TRUE : $configuration_settings->get('use_thin_file'),
  ];

  // First check if we're using everything.
@@ -273,6 +274,9 @@ function fontawesome_page_attachments(array &$page) {
    if ($activeFiles['use_duotone_file']) {
      $page['#attached']['library'][] = 'fontawesome/fontawesome.' . $configuration_settings->get('method') . '.duotone';
    }
    if ($activeFiles['use_thin_file']) {
      $page['#attached']['library'][] = 'fontawesome/fontawesome.' . $configuration_settings->get('method') . '.thin';
    }
  }

  // Attach the shim file if needed.
Loading