Merge upstream

This commit is contained in:
2024-12-06 16:44:12 -05:00
parent 14e8771049
commit 913e60acc9
86 changed files with 1987 additions and 1556 deletions

View File

@@ -1,6 +1,6 @@
// Dean Attali / Beautiful Jekyll 2020
// Dean Attali / Beautiful Jekyll 2023
var BeautifulJekyllJS = {
let BeautifulJekyllJS = {
bigImgEl : null,
numImgs : null,
@@ -54,23 +54,23 @@ var BeautifulJekyllJS = {
// 2fc73a3a967e97599c9763d05e564189
// set an initial image
var imgInfo = BeautifulJekyllJS.getImgInfo();
var src = imgInfo.src;
var desc = imgInfo.desc;
const imgInfo = BeautifulJekyllJS.getImgInfo();
const src = imgInfo.src;
const desc = imgInfo.desc;
BeautifulJekyllJS.setImg(src, desc);
// For better UX, prefetch the next image so that it will already be loaded when we want to show it
var getNextImg = function() {
var imgInfo = BeautifulJekyllJS.getImgInfo();
var src = imgInfo.src;
var desc = imgInfo.desc;
const getNextImg = function() {
const imgInfo = BeautifulJekyllJS.getImgInfo();
const src = imgInfo.src;
const desc = imgInfo.desc;
var prefetchImg = new Image();
const prefetchImg = new Image();
prefetchImg.src = src;
// if I want to do something once the image is ready: `prefetchImg.onload = function(){}`
setTimeout(function(){
var img = $("<div></div>").addClass("big-img-transition").css("background-image", 'url(' + src + ')');
const img = $("<div></div>").addClass("big-img-transition").css("background-image", 'url(' + src + ')');
$(".intro-header.big-img").prepend(img);
setTimeout(function(){ img.css("opacity", "1"); }, 50);
@@ -93,9 +93,9 @@ var BeautifulJekyllJS = {
},
getImgInfo : function() {
var randNum = Math.floor((Math.random() * BeautifulJekyllJS.numImgs) + 1);
var src = BeautifulJekyllJS.bigImgEl.attr("data-img-src-" + randNum);
var desc = BeautifulJekyllJS.bigImgEl.attr("data-img-desc-" + randNum);
const randNum = Math.floor((Math.random() * BeautifulJekyllJS.numImgs) + 1);
const src = BeautifulJekyllJS.bigImgEl.attr("data-img-src-" + randNum);
const desc = BeautifulJekyllJS.bigImgEl.attr("data-img-desc-" + randNum);
return {
src : src,

View File

@@ -3,27 +3,25 @@ layout: null
---
(function ($) {
var $comments = $('.js-comments');
$('#new_comment').submit(function () {
var form = this;
const form = this;
$(form).addClass('disabled');
{% assign sm = site.staticman -%}
var endpoint = '{{ sm.endpoint }}';
var repository = '{{ sm.repository }}';
var branch = '{{ sm.branch }}';
let url = endpoint + repository + '/' + branch + '/comments';
let data = $(this).serialize();
const endpoint = '{{ sm.endpoint }}';
const repository = '{{ sm.repository }}';
const branch = '{{ sm.branch }}';
const url = endpoint + repository + '/' + branch + '/comments';
const data = $(this).serialize();
var xhr = new XMLHttpRequest();
const xhr = new XMLHttpRequest();
xhr.open("POST", url);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
xhr.onreadystatechange = function () {
if(xhr.readyState === XMLHttpRequest.DONE) {
var status = xhr.status;
const status = xhr.status;
if (status >= 200 && status < 400) {
formSubmitted();
} else {