@@ -34,8 +34,7 @@ export os="linux" # or macos
34
34
<pre class =" bash " id =" bashCode " >
35
35
curl -Lo hkubectl hkube-domain.com/hkubectl_files/hkubectl-${os} \
36
36
&& chmod +x hkubectl \
37
- && sudo mv hkubectl /usr/local/bin/
38
- <button id =" copyBtn " onclick =" copyToClipboard (' bashCode' )" class =" copy-btn " >Copy</button >
37
+ && sudo mv hkubectl /usr/local/bin/<button id =" copyBtn " onclick =" copyToClipboard (' bashCode' )" class =" copy-btn " >Copy</button >
39
38
</pre >
40
39
41
40
<p >For <strong >Windows</strong >, download <code >hkubectl-win.exe</code > from <a id =" windowsLink " href =" /hkubectl_files/hkubectl-win.exe " >here</a >.</p >
@@ -80,23 +79,27 @@ kubectl get nodes
80
79
<script >
81
80
function copyToClipboard (elementId ) {
82
81
var code = document .getElementById (elementId);
82
+ var copyButton = document .getElementById (" copyBtn" );
83
+
84
+ copyButton .textContent = " " ;
85
+
83
86
var range = document .createRange ();
84
87
range .selectNode (code);
85
88
window .getSelection ().removeAllRanges ();
86
89
window .getSelection ().addRange (range);
87
90
88
91
try {
89
92
document .execCommand (" copy" );
90
- var copyButton = document .getElementById (" copyBtn" );
91
- copyButton .textContent = " Copied!" ;
93
+ copyButton .textContent = " Copied!" ;
94
+
95
+ setTimeout (function () {
96
+ copyButton .textContent = " Copy" ;
97
+ }, 300 );
92
98
93
- setTimeout (function () {
94
- copyButton .textContent = " Copy" ;
95
- }, 300 );
96
99
} catch (err) {
100
+ copyButton .textContent = " Copy" ;
97
101
console .error (" Unable to copy code" , err);
98
102
}
99
-
100
103
window .getSelection ().removeAllRanges ();
101
104
}
102
105
</script >
0 commit comments