Commit 99b3f108 authored by Ben Myrgorod's avatar Ben Myrgorod Committed by Ivan Trokhanenko
Browse files

Issue #3304604 by dealancer, jasonmce, i-trokhanenko: Super patch...

Issue #3304604 by dealancer, jasonmce, i-trokhanenko: Super patch (accessibility, new tab, custom external link icon)
parent 631f0c44
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
elf_domains: []
elf_icon_class: 'elf-icon'
elf_window: false
elf_accessible: false
elf_redirect: false
+7 −1
Original line number Diff line number Diff line
@@ -9,9 +9,15 @@ elf.settings:
      type: sequence
      sequence:
        type: string
    elf_icon_class:
      type: text
      label: 'Icon class to be applied for external links'
    elf_window:
      type: boolean
      label: 'Use JavaScript to open external links in a new window'
      label: 'Open external links in a new tab'
    elf_accessible:
      type: boolean
      label: 'Provide an accessible indication of external links'
    elf_redirect:
      type: boolean
      label: 'Redirect users to external websites via !url_path'
+7 −0
Original line number Diff line number Diff line
@@ -6,3 +6,10 @@ a.elf-mailto.elf-icon {
  background: url(../images/mail.png) right center no-repeat;
  padding-right: 12px;
}
a.elf-external .screen-reader-only {
  position: absolute;
  width: 1px;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}
+20 −0
Original line number Diff line number Diff line
@@ -32,3 +32,23 @@ function elf_requirements($phase) {

  return $requirements;
}

/**
 * Add icon class setting to the schema.
 */
function elf_update_8001() {
  $config_factory = \Drupal::configFactory();
  $config = $config_factory->getEditable('elf.settings');
  $config->set('elf_icon_class', 'elf-icon');
  $config->save(TRUE);
}

/**
 * Add accessible setting to the schema.
 */
function elf_update_8002() {
  $config_factory = \Drupal::configFactory();
  $config = $config_factory->getEditable('elf.settings');
  $config->set('elf_accessible', false);
  $config->save(TRUE);
}
+0 −6
Original line number Diff line number Diff line
@@ -2,9 +2,3 @@ elf_css:
  css:
    theme:
      css/styles.css: {}

elf_js:
  js:
    js/elf.js: {}
  dependencies:
    - core/jquery
Loading