diff --git a/webpack/js/app.js b/webpack/js/app.js index 586fbb06..14d6e31c 100644 --- a/webpack/js/app.js +++ b/webpack/js/app.js @@ -2,39 +2,19 @@ require("bootstrap"); -function selectText(text) { - if (document.body.createTextRange) { - let range = document.body.createTextRange(); - range.moveToElementText(text); - range.select(); - } else if (window.getSelection) { - let selection = window.getSelection(); - let range = document.createRange(); - range.selectNodeContents(text); - selection.removeAllRanges(); - selection.addRange(range); - } -} - function initDownloadButton() { const buttons = $(".download-btn"); if (buttons.length <= 0) { return; } - buttons.hide(); $.ajax({ method: "GET", url: "https://api.github.com/repos/lektor/lektor/releases", crossDomain: true, - }).then( - (releases) => { - updateDownloadButtons(buttons.toArray(), releases); - }, - () => { - buttons.show(); - } - ); + }).then((releases) => { + updateDownloadButtons(buttons.toArray(), releases); + }); } function updateDownloadButtons(buttons, releases) { @@ -45,20 +25,9 @@ function updateDownloadButtons(buttons, releases) { link.attr("href", "/downloads/"); link.append($('').text(tag)); - - $(button).fadeIn("slow"); }); } -function initInstallRow() { - let code = $(".install-row pre"); - if (code.length > 0) { - code.on("dblclick", function () { - selectText(this); - }); - } -} - function initGoogleSearch() { var container = $(".google-custom-search"); if (container.length == 0) { @@ -109,15 +78,7 @@ function initGoogleSearch() { } } -function hideThingsForWindows() { - if (navigator.appVersion.indexOf("Win") >= 0) { - $(".hide-for-windows").hide(); - } -} - $(function () { initDownloadButton(); - initInstallRow(); initGoogleSearch(); - hideThingsForWindows(); }); diff --git a/webpack/scss/main.scss b/webpack/scss/main.scss index 4ec0b332..0ebb9d2c 100644 --- a/webpack/scss/main.scss +++ b/webpack/scss/main.scss @@ -538,29 +538,6 @@ div.lektor-intro { font-weight: bold; text-decoration: underline; } - - div.install-row { - background: rgba(40, 30, 30, 0.8); - position: absolute; - bottom: 0; - left: 120px; - right: 120px; - - pre { - margin: 0; - background: transparent; - color: white; - } - - @media (max-width: $screen-md-max) { - left: 10px; - right: 10px; - } - - @media (max-width: $screen-sm-max) { - display: none; - } - } } div.download-btn {