diff --git a/src/Form/SelectCslForm.php b/src/Form/SelectCslForm.php index 96f331b..fc3a9ee 100644 --- a/src/Form/SelectCslForm.php +++ b/src/Form/SelectCslForm.php @@ -110,6 +110,21 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#theme_wrappers' => [], ]; + $form['actions']['submit'] = [ + '#type' => 'button', + '#value' => $this->t('Copy to Clipboard'), + '#attributes' => [ + 'onclick' => 'return false;', + 'class' => ['clipboard-button'], + 'data-clipboard-target' => '#formatted-citation', + ], + '#attached' => [ + 'library' => [ + 'islandora_citations/drupal', + ], + ], + ]; + $form['#cache']['contexts'][] = 'url'; $form['#theme'] = 'display_citations'; return $form;