mirror of
https://github.com/comatory/fb2iCal
synced 2025-06-05 22:09:25 +02:00
remove manual "no javascript" switch
This was a stupid checkbox made only as an experiment. The page can still be loaded without JavaScript and works, no need to trigger it manually.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { noJS, uuidv4, parseStartTimeFromiCalString, useStorage } from './app/utils'
|
||||
import { uuidv4, parseStartTimeFromiCalString, useStorage } from './app/utils'
|
||||
import {
|
||||
migrateRecord,
|
||||
getStorage,
|
||||
@@ -199,19 +199,8 @@ import generateICS from '../../lib/services/ics-generator'
|
||||
const link = document.querySelector("#current-download")
|
||||
const table = document.querySelector('#list')
|
||||
const tableBody = table.querySelector('tbody')
|
||||
const noJScheckbox = document.querySelector('#nojs')
|
||||
|
||||
const loadNoJS = () => {
|
||||
if (!useStorage()) {
|
||||
return
|
||||
}
|
||||
const value = localStorage.getItem('fb-to-ical-nojs')
|
||||
noJScheckbox.checked = value ? JSON.parse(value) : false
|
||||
}
|
||||
|
||||
loadNoJS()
|
||||
|
||||
if (window.navigator && window.navigator.serviceWorker && !noJS()) {
|
||||
if (window.navigator && window.navigator.serviceWorker) {
|
||||
const serviceWorker = window.navigator.serviceWorker
|
||||
serviceWorker.register('sw.js', {
|
||||
scope: './',
|
||||
@@ -245,18 +234,7 @@ import generateICS from '../../lib/services/ics-generator'
|
||||
})
|
||||
}
|
||||
|
||||
if (!noJS()) {
|
||||
hydrateList()
|
||||
}
|
||||
|
||||
noJScheckbox.addEventListener('click', (event) => {
|
||||
if (!useStorage()) {
|
||||
return
|
||||
}
|
||||
|
||||
localStorage.setItem('fb-to-ical-nojs', event.target.checked)
|
||||
})
|
||||
|
||||
hydrateList()
|
||||
|
||||
const handleHTMLResponse = (html) => {
|
||||
try {
|
||||
@@ -295,10 +273,6 @@ import generateICS from '../../lib/services/ics-generator'
|
||||
}
|
||||
|
||||
submitButton.addEventListener('click', (event) => {
|
||||
if (noJS()) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!form.reportValidity()) {
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user