diff --git a/build.html b/build.html index cd2770703..546b32c3c 100644 --- a/build.html +++ b/build.html @@ -2,18 +2,208 @@ -TDLib build instructions - + TDLib build instructions +
-
+

Choose a programming language, from which you want to use TDLib:

-
+

Choose an operating system, on which you want to use TDLib:

@@ -71,7 +261,7 @@ select.large { font-size: large; }

-
+
@@ -133,14 +323,18 @@ select.large { font-size: large; }

-
+

Hidden text

-
-

Here is complete instruction for TDLib binaries building:

+
+

Here is complete instruction for TDLib binaries building:

Hidden text

Empty commands +
@@ -902,7 +1096,26 @@ function onOptionsChanged() { } commands.push((use_powershell ? 'dir ' : 'ls -l ') + install_dir); } - document.getElementById('buildCommands').innerHTML = '
  • ' + commands.join('
  • ') + '
'; + document.getElementById('buildCommands').innerHTML = '
  • ' + commands.join('
  • ') + '
' +} + +function copyBuildInstructions() { + var text= document.getElementById('buildCommands').innerText; + + function resetButtonState (state) { + document.getElementById('copyBuildCommandsButton').classList.remove(state); + document.getElementById('copyBuildCommandsText').innerText= "Copy" + } + + navigator.clipboard.writeText(text).then(result => { + document.getElementById('copyBuildCommandsButton').classList.add('success'); + document.getElementById('copyBuildCommandsText').innerText= "Copied!" + setTimeout(()=> resetButtonState('success'), 5000); + }, error => { + document.getElementById('copyBuildCommandsButton').classList.add('fail'); + document.getElementById('copyBuildCommandsText').innerText= "Couldn't copy :(" + setTimeout(()=> resetButtonState('fail'), 5000); + }) }