From 1a6161003c3f79bc564e92a46d50e7f0cbe43fbd Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 28 Oct 2020 23:25:57 +0300 Subject: [PATCH] Choose Linux distro before allowing to change other build options in build instruction generator. GitOrigin-RevId: b3f177e36b5098c55a9c7b32e4f0a2101c97ac16 --- build.html | 113 ++++++++++++++++++++++++++++------------------------- 1 file changed, 60 insertions(+), 53 deletions(-) diff --git a/build.html b/build.html index 98a740bb5..b97a77958 100644 --- a/build.html +++ b/build.html @@ -14,34 +14,32 @@ select.large { font-size: large; }
-
-
-

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

- -
+
+

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

+
@@ -52,24 +50,24 @@ select.large { font-size: large; }

-
-
-

Choose a Linux distro, on which you want to use TDLib:

- -

-
+
+

Choose a Linux distro, on which you want to use TDLib:

+ +

+
+
@@ -335,11 +333,27 @@ function onOsChanged() { document.getElementById('buildText').innerHTML = text; if (!target) { + document.getElementById('linuxSelectDiv').style.display = 'none'; document.getElementById('buildOptionsDiv').style.display = 'none'; document.getElementById('buildCommandsDiv').style.display = 'none'; return; } + var os_linux = os.includes('Linux'); + if (os_linux) { + document.getElementById('linuxSelectDiv').style.display = 'block'; + + var linux_distro = document.getElementById('linuxSelect').value; + if (linux_distro.includes('Choose ')) { + document.getElementById('buildTextDiv').style.display = 'none'; + document.getElementById('buildOptionsDiv').style.display = 'none'; + document.getElementById('buildCommandsDiv').style.display = 'none'; + return; + } + } else { + document.getElementById('linuxSelectDiv').style.display = 'none'; + } + document.getElementById('buildOptionsDiv').style.display = 'block'; onOptionsChanged(); @@ -357,18 +371,11 @@ function onOptionsChanged() { var os_openbsd = os.includes('OpenBSD'); var os_netbsd = os.includes('NetBSD'); - var display_commands = 'block'; var linux_distro = 'none'; if (os_linux) { - document.getElementById('linuxSelectDiv').style.display = 'block'; linux_distro = document.getElementById('linuxSelect').value; - if (linux_distro.indexOf('Choose') === 0) { - display_commands = 'none'; - } - } else { - document.getElementById('linuxSelectDiv').style.display = 'none'; } - document.getElementById('buildCommandsDiv').style.display = display_commands; + document.getElementById('buildCommandsDiv').style.display = 'block'; var use_clang = os_freebsd || os_openbsd; if (os_linux && linux_distro !== 'Alpine') {