Loading src/Plugin/CKEditorPlugin/AnchorLink.php +4 −4 Changes for src/Plugin/CKEditorPlugin/AnchorLink.php: 4 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -51,12 +51,12 @@ class AnchorLink extends CKEditorPluginBase { */ public function getButtons() { return [ 'Link' => [ 'label' => $this->t('Link'), 'LinkToAnchor' => [ 'label' => $this->t('Link to anchor'), 'image' => drupal_get_path('module', 'anchor_link') . '/js/plugins/link/icons/link.png', ], 'Unlink' => [ 'label' => $this->t('Unlink'), 'UnlinkAnchor' => [ 'label' => $this->t('Unlink Anchor'), 'image' => drupal_get_path('module', 'anchor_link') . '/js/plugins/link/icons/unlink.png', ], 'Anchor' => [ Loading src/Plugin/Linkit/Matcher/CKEditorAnchorLinkMatcher.php 0 → 100644 +38 −0 Changes for src/Plugin/Linkit/Matcher/CKEditorAnchorLinkMatcher.php: 38 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Drupal\anchor_link\Plugin\Linkit\Matcher; use Drupal\Component\Utility\Html; use Drupal\linkit\MatcherBase; use Drupal\linkit\Suggestion\DescriptionSuggestion; use Drupal\linkit\Suggestion\SuggestionCollection; /** * Provides specific linkit matchers for Anchor links. * * @Matcher( * id = "ckeditor_anchor_link", * label = @Translation("CKEditor Anchor link"), * ) */ class CKEditorAnchorLinkMatcher extends MatcherBase { /** * {@inheritdoc} */ public function execute($string) { $suggestions = new SuggestionCollection(); $string = ltrim($string, '#'); $suggestion = new DescriptionSuggestion(); $suggestion->setLabel($this->t('#@anchor_link', ['@anchor_link' => $string])) ->setPath('#' . $string) ->setGroup($this->t('Anchor links (within the same page)')); $suggestions->addSuggestion($suggestion); return $suggestions; } } Loading
src/Plugin/CKEditorPlugin/AnchorLink.php +4 −4 Changes for src/Plugin/CKEditorPlugin/AnchorLink.php: 4 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -51,12 +51,12 @@ class AnchorLink extends CKEditorPluginBase { */ public function getButtons() { return [ 'Link' => [ 'label' => $this->t('Link'), 'LinkToAnchor' => [ 'label' => $this->t('Link to anchor'), 'image' => drupal_get_path('module', 'anchor_link') . '/js/plugins/link/icons/link.png', ], 'Unlink' => [ 'label' => $this->t('Unlink'), 'UnlinkAnchor' => [ 'label' => $this->t('Unlink Anchor'), 'image' => drupal_get_path('module', 'anchor_link') . '/js/plugins/link/icons/unlink.png', ], 'Anchor' => [ Loading
src/Plugin/Linkit/Matcher/CKEditorAnchorLinkMatcher.php 0 → 100644 +38 −0 Changes for src/Plugin/Linkit/Matcher/CKEditorAnchorLinkMatcher.php: 38 added lines, 0 removed lines. Original line number Diff line number Diff line <?php namespace Drupal\anchor_link\Plugin\Linkit\Matcher; use Drupal\Component\Utility\Html; use Drupal\linkit\MatcherBase; use Drupal\linkit\Suggestion\DescriptionSuggestion; use Drupal\linkit\Suggestion\SuggestionCollection; /** * Provides specific linkit matchers for Anchor links. * * @Matcher( * id = "ckeditor_anchor_link", * label = @Translation("CKEditor Anchor link"), * ) */ class CKEditorAnchorLinkMatcher extends MatcherBase { /** * {@inheritdoc} */ public function execute($string) { $suggestions = new SuggestionCollection(); $string = ltrim($string, '#'); $suggestion = new DescriptionSuggestion(); $suggestion->setLabel($this->t('#@anchor_link', ['@anchor_link' => $string])) ->setPath('#' . $string) ->setGroup($this->t('Anchor links (within the same page)')); $suggestions->addSuggestion($suggestion); return $suggestions; } }