File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 40
40
var encoded = btoa ( unescape ( encodeURIComponent ( input ) ) ) ;
41
41
output . innerText = encoded ;
42
42
}
43
+
44
+ document . getElementById ( "copy-button" ) . disabled = false ;
43
45
}
44
46
45
47
function copyToClipboard ( ) {
46
48
var output = document . getElementById ( "output" ) . innerText ;
49
+ if ( output === "" ) {
50
+ alert ( "Tidak ada teks untuk disalin!" ) ;
51
+ return ;
52
+ }
47
53
var tempInput = document . createElement ( "input" ) ;
48
54
tempInput . value = output ;
49
55
document . body . appendChild ( tempInput ) ;
@@ -60,7 +66,7 @@ <h2>Base64 Decode & Encode</h2>
60
66
< textarea id ="text-input " placeholder ="Enter text... "> </ textarea > < br >
61
67
< button onclick ="encodeDecodeBase64('decode') "> DECODE</ button >
62
68
< button onclick ="encodeDecodeBase64('encode') "> ENCODE</ button >
63
- < button onclick ="copyToClipboard() "> Salin</ button > < br > < br >
69
+ < button id =" copy-button " onclick ="copyToClipboard() " disabled > Salin</ button > < br > < br >
64
70
< div id ="output "> </ div >
65
71
< footer style ="text-align: center; ">
66
72
< a href ="mailto:yogak@onionmail.org "> yogak@onionmail.org</ a >
You can’t perform that action at this time.
0 commit comments