File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -91,4 +91,21 @@ <h1>Documentation</h1>
9191 < a href ="https://github.com/AsahiLinux/docs/wiki " class ="more "> Visit the Wiki< i class ="fas fa-angle-right more "> </ i > </ a >
9292 </ div >
9393</ section >
94+ < script >
95+ document . addEventListener ( "DOMContentLoaded" , function ( ) {
96+ var btn = document . getElementById ( "copy-button" ) ;
97+ btn . onmouseover = function ( e ) {
98+ btn . firstChild . classList . remove ( "fa-check" ) ;
99+ btn . firstChild . classList . add ( "fa-clipboard" ) ;
100+ }
101+ btn . onclick = function ( e ) {
102+ var text = document . getElementById ( "curl" ) ;
103+ window . getSelection ( ) . selectAllChildren ( text ) ;
104+ navigator . clipboard . writeText ( text . textContent ) ;
105+ btn . firstChild . classList . add ( "fa-check" ) ;
106+ btn . firstChild . classList . remove ( "fa-clipboard" ) ;
107+ e . preventDefault ( ) ;
108+ } ;
109+ } ) ;
110+ </ script >
94111{{ partial "footer.html" . }}
You can’t perform that action at this time.
0 commit comments