File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ function copyToClipboard ( e ) {
2+ e . preventDefault ( ) ;
3+ navigator . clipboard . writeText ( e . target . textContent ) ;
4+ alert$ . next ( 'Copied to clipboard' ) ;
5+ }
6+
7+ function enableClipboardElements ( ) {
8+ const copyElements = document . querySelectorAll ( '.copyMe' ) ;
9+ copyElements . forEach ( ( element ) => {
10+ element . addEventListener ( 'click' , copyToClipboard ) ;
11+ } ) ;
12+ }
13+
14+ const attachListeners = ( ) => {
15+ enableSearchOnBlurElement ( ) ;
16+ enableClipboardElements ( ) ;
17+ } ;
18+
19+ const init = ( ) => {
20+ attachListeners ( ) ;
21+ } ;
22+
23+ init ( ) ;
Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ plugins:
140140extra_css :
141141 - stylesheets/extra.css
142142extra_javascript :
143+ - javascript/extra.js
143144 - https://docs.powertools.aws.dev/shared/mermaid.min.js
144145 - https://docs.aws.amazon.com/assets/js/awsdocs-boot.js
145146
You can’t perform that action at this time.
0 commit comments