mirror of
https://github.com/mue/mue.git
synced 2026-07-13 20:13:47 +02:00
style: codacy fixes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// since there is so much code in the component, we have moved it to a separate file
|
||||
export function videoCheck(url) {
|
||||
return url.startsWith('data:video/') || url.endsWith('.mp4') || url.endsWith('.webm') || url.endsWith('.ogg');
|
||||
};
|
||||
}
|
||||
|
||||
export function offlineBackground() {
|
||||
const offlineImages = require('./offlineImages.json');
|
||||
@@ -20,7 +20,7 @@ export function offlineBackground() {
|
||||
offline: true,
|
||||
credit: photographer
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
localStorage.setItem('currentBackground', JSON.stringify(object));
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export function nth(d) {
|
||||
default:
|
||||
return d + 'th';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function convertTimezone(date, tz) {
|
||||
return new Date((typeof date === 'string' ? new Date(date) : date).toLocaleString('en-US', { timeZone: tz }));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// based on https://stackoverflow.com/a/47009962
|
||||
export default function Interval(callback, interval, name) {
|
||||
export default function interval(callback, interval, name) {
|
||||
const key = name + 'interval';
|
||||
const timeInMs = localStorage.getItem(key);
|
||||
|
||||
@@ -8,7 +8,7 @@ export default function Interval(callback, interval, name) {
|
||||
const executeCallback = () => {
|
||||
localStorage.setItem(key, Date.now());
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
if (timeInMs) {
|
||||
const delta = now - parseInt(timeInMs);
|
||||
|
||||
@@ -25,7 +25,7 @@ export function setDefaultSettings(reset) {
|
||||
|
||||
// Finally we set this to true so it doesn't run the function on every load
|
||||
localStorage.setItem('firstRun', true);
|
||||
};
|
||||
}
|
||||
|
||||
export function loadSettings(hotreload) {
|
||||
document.getElementById('widgets').style.zoom = localStorage.getItem('widgetzoom') + '%';
|
||||
|
||||
@@ -15,7 +15,7 @@ export function saveFile(data, filename = 'file') {
|
||||
|
||||
e.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
|
||||
a.dispatchEvent(e);
|
||||
};
|
||||
}
|
||||
|
||||
export function exportSettings() {
|
||||
let settings = {};
|
||||
|
||||
Reference in New Issue
Block a user