File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,9 +55,10 @@ function fetchbookmarks() {
5555 <div class="col-9">
5656 <h5>${ bookmarks [ i ] . name } </h5>
5757 </div>
58- <div class="col-3">
59- <a class="btn btn-sm btn-success" href="https://${ bookmarks [ i ] . url } " target="_blank">Visit</a>
60- <a onclick="deletebookmark(${ i } );" class="btn btn-danger text-light btn-sm" >Delete</a>
58+ <div class="col-3 button-container">
59+ <a class="btn btn-sm " href="https://${ bookmarks [ i ] . url } " target="_blank">Visit</a>
60+ <a onclick="copyToClipboard('${ bookmarks [ i ] . url } ')" class="btn btn-sm ">Copy</a>
61+ <a onclick="deletebookmark(${ i } );" class="btn btn-sm" >Delete</a>
6162 </div>
6263 </div>
6364 <small>Created at : ${ Date ( ) . slice ( 4 , 15 ) } </small>
@@ -82,3 +83,14 @@ function validateform(sitename, siteurl) {
8283 }
8384 return true ;
8485}
86+ function copyToClipboard ( url ) {
87+ var input = document . createElement ( 'input' ) ;
88+ input . style . position = 'fixed' ;
89+ input . style . opacity = 0 ;
90+ input . value = url ;
91+ document . body . appendChild ( input ) ;
92+ input . select ( ) ;
93+ document . execCommand ( 'copy' ) ;
94+ document . body . removeChild ( input ) ;
95+ alert ( 'Link Copied!' ) ;
96+ }
Original file line number Diff line number Diff line change @@ -63,7 +63,14 @@ body {
6363 margin-top : 30px ;
6464 background-color : # f1ecec ;
6565}
66+ .button-container {
67+ display : flex;
68+ justify-content : space-between;
69+ }
6670
71+ .button-container a : hover {
72+ color : # d74946 ;
73+ }
6774@media screen and (min-width : 768px ) {
6875
6976 .header ,
You can’t perform that action at this time.
0 commit comments