chore: Reformat jshint stuff

- Remove comments from jshint
- Replace " with '
- Replace var with const
This commit is contained in:
sthag 2026-02-09 21:17:53 +01:00
parent 7912b002a2
commit 9ce027285c
2 changed files with 106 additions and 122 deletions

View file

@ -1,5 +1,5 @@
// TODO: Inhalte angleichen nach Zusammenfassung von app.js und function.js.
// Bennung und Beschreibungen verbessern.
// Benennung und Beschreibungen verbessern.
// This is called everytime
function setup() {
@ -56,7 +56,7 @@ function HippieScroll($tp, $dn) {
});
$dn.click(function (event) {
event.preventDefault();
var pos = Math.max(hippie.screen.dh, hippie.body.h) - hippie.screen.vh;
const pos = Math.max(hippie.screen.dh, hippie.body.h) - hippie.screen.vh;
$('html').scrollTop(pos);
// document.documentElement.scrollTop = pos;
console.info('Scrolled down to', pos);
@ -91,7 +91,7 @@ function HippieMeta($ma, $pp) {
let metaOn = false;
$ma.click(function () {
var $wrap, $pop;
const $wrap, $pop;
// if (metaOn !== true) {
if (!metaOn) {
@ -162,23 +162,25 @@ function HippieMeta($ma, $pp) {
// Sets the href attribute to mailto: with given information
function composeMail(tag, name, prov, suffix, text, topic) {
let trigger = tag.indexOf(".");
'use strict';
let trigger = tag.indexOf('.');
let mailString = name + '@' + prov + '.' + suffix;
let textString = mailString.replace(/@/g, "(at)");
let descString = "Nachricht an " + mailString;
let textString = mailString.replace(/@/g, '(at)');
let descString = 'Nachricht an ' + mailString;
if (!text) {
text = mailString;
} else if (text === "at") {
} else if (text === 'at') {
text = textString;
} else if (text === "to") {
} else if (text === 'to') {
text = descString;
}
if (topic) {
topic = "?subject=" + topic;
topic = '?subject=' + topic;
} else {
topic = "";
topic = '';
}
if (trigger === -1) {
@ -186,7 +188,7 @@ function composeMail(tag, name, prov, suffix, text, topic) {
const elContent = el.innerHTML;
el.innerHTML = elContent + text;
el.setAttribute("href", "mailto:" + mailString + topic);
el.setAttribute('href', 'mailto:' + mailString + topic);
} else {
const els = document.getElementsByClassName(tag.slice(1));
@ -194,7 +196,7 @@ function composeMail(tag, name, prov, suffix, text, topic) {
const elContent = el.innerHTML;
el.innerHTML = elContent + text;
el.setAttribute("href", "mailto:" + mailString + topic);
el.setAttribute('href', 'mailto:' + mailString + topic);
}
}
}
@ -378,6 +380,8 @@ function getClosestEdgeToMouse(event) {
}
function centerElementUnderCursor(event, element) {
'use strict';
const offsetX = element.getBoundingClientRect().width / 2;
const offsetY = element.getBoundingClientRect().height / 2;
const x = event.clientX - offsetX;
@ -388,6 +392,8 @@ function centerElementUnderCursor(event, element) {
}
function setAttributesAccordingToPosition(element, position, attributes) {
'use strict';
element.classList.remove(...Object.values(attributes).map(pos => pos.className));
Object.keys(attributes[position].styles).forEach(key => {
element.style[key] = '';
@ -457,17 +463,15 @@ Clock.prototype.formatDigits = function (val) {
return val;
};
var floor = Math.floor;
function ongoing() {
var now = new Date();
var w = Math.floor(now.getDay());
var D = new Array("Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag");
var D = ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'];
var DNumb = Math.floor(now.getDate());
var MNumb = Math.floor(now.getMonth());
var M = new Array("Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember");
var M = ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'MaiOktober', 'November', 'Dezember'];
var y = Math.floor(now.getYear());
if (y < 999) y += 1900;
@ -518,23 +522,22 @@ function ongoing() {
var moonPosX = 0;
var moonPosY = 0;
var sun = $("#sun").css({
"left": (s / 60) * travelWidth,
"top": (m / 60) * travelHeight
var sun = $('#sun').css({
'left': (s / 60) * travelWidth,
'top': (m / 60) * travelHeight
});
$("#day").text(D[w]);
$("#dayNumb").text(DNumb);
$("#month").text(M[MNumb]);
$("#year").text(y);
$("#time").text('' + zeroFill(h, 2) + ':' + zeroFill(m, 2) + ':' + zeroFill(s, 2));
$("#julian").text(jd.toFixed(6));
//$("#star").text(stH + ':' + stM + ':' + stS);
$("#star").text(stH + ':' + stM);
$("#star1").text(stGMT);
$("#star2").text(stGMT2);
$('#day').text(D[w]);
$('#dayNumb').text(DNumb);
$('#month').text(M[MNumb]);
$('#year').text(y);
$('#time').text('' + zeroFill(h, 2) + ':' + zeroFill(m, 2) + ':' + zeroFill(s, 2));
$('#julian').text(jd.toFixed(6));
//$('#star').text(stH + ':' + stM + ':' + stS);
$('#star').text(stH + ':' + stM);
$('#star1').text(stGMT);
$('#star2').text(stGMT2);
}
function zeroFill(number, width) {
@ -542,7 +545,7 @@ function zeroFill(number, width) {
if (width > 0) {
return new Array(width + (/\./.test(number) ? 2 : 1)).join('0') + number;
}
return number + ""; // always return a string
return number + ''; // always return a string
}
//Länge der Balken im Diagram berechnen
@ -562,7 +565,7 @@ String.prototype.transform = function () {
}
//Array Element erweitern
Array.prototype.arrayAdd = function () {
return eval(this.join("+"));
return eval(this.join('+'));
}
//Speicherplatz in Prozent berechnen