./webpack: remove more dead code
The install-row and hide-for-windows were only used for the old installer, they now do not seem to be used anymore.
This commit is contained in:
parent
00a45487da
commit
c31d457506
|
@ -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($('<span class="version"></span>').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();
|
||||
});
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue