Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MarekZeman91 committed Oct 19, 2024
1 parent 07df698 commit 51c8db3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
33 changes: 18 additions & 15 deletions misc/dist/html/editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
</div>
</div>
<script>
const byId = sel => document.getElementById(sel);
function byId(sel) {
return document.getElementById(sel);
}

window.addEventListener('load', () => {
function notifyUpdate(sw) {
const btn = byId('btn-tab-update');
Expand All @@ -166,7 +169,7 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
btn.style.display = '';
}
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service.worker.js').then(reg => {
navigator.serviceWorker.register('service.worker.js').then((reg) => {
if (reg.waiting) {
notifyUpdate(reg.waiting);
}
Expand Down Expand Up @@ -215,9 +218,7 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
localStorage.setItem('welcomeModalDismissed', 'true');
}
}
</script>
<script src="redot.editor.js"></script>
<script>

let editor = null;
let game = null;
let setStatusMode;
Expand All @@ -229,8 +230,8 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
return new Promise((resolve, reject) => {
const req = indexedDB.deleteDatabase(path);
req.onsuccess = () => resolve();
req.onerror = err => reject(err);
req.onblocked = err => reject(err);
req.onerror = (err) => reject(err);
req.onblocked = (err) => reject(err);
});
}
if (!window.confirm('Are you sure you want to delete all the locally stored files?\nClicking "OK" will permanently remove your projects and editor settings!')) {
Expand All @@ -257,11 +258,11 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
byId('tab-game'),
];
function showTab(name) {
tabsLink.forEach(elem => {
tabsLink.forEach((elem) => {
elem.parentElement.classList.toggle('active', elem.id === `btn-tab-${name}`);
});

tabsContent.forEach(elem => {
tabsContent.forEach((elem) => {
if (elem.id === `tab-${name}`) {
elem.style.display = '';

Expand Down Expand Up @@ -367,14 +368,14 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
}
}

setStatusMode = mode => {
setStatusMode = (mode) => {
if (statusMode === mode || !initializing) {
return;
}
[statusProgress, statusIndeterminate, statusNotice].forEach((elem) => {
elem.style.display = 'none';
});
animationCallbacks = animationCallbacks.filter(value => (value !== animateStatusIndeterminate));
animationCallbacks = animationCallbacks.filter((value) => (value !== animateStatusIndeterminate));
switch (mode) {
case 'progress':
statusProgress.style.display = 'block';
Expand Down Expand Up @@ -423,8 +424,8 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
setLoaderEnabled(true);
};
function Execute(args) {
const is_editor = args.filter(v => v === '--editor' || v === '-e').length !== 0;
const is_project_manager = args.filter(v => v === '--project-manager').length !== 0;
const is_editor = args.filter((v) => v === '--editor' || v === '-e').length !== 0;
const is_project_manager = args.filter((v) => v === '--project-manager').length !== 0;
const is_game = !is_editor && !is_project_manager;
if (video_driver) {
args.push('--rendering-driver', video_driver);
Expand Down Expand Up @@ -534,17 +535,19 @@ <h2 id="welcome-modal-title" class="welcome-modal-title">Important - Please read
}
}

async function preloadZip(target) {
function preloadZip(target) {
if (target.files.length > 0) {
return target.files[0].arrayBuffer();
}
return Promise.resolve(null);
}

byId('startButton').onclick = () => {
preloadZip(byId('zip-file')).then(zip => {
preloadZip(byId('zip-file')).then((zip) => {
startEditor(zip);
});
};
</script>
<script src="redot.editor.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion misc/dist/html/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ self.addEventListener('message', (event) => {
if (msg === 'claim') {
self.skipWaiting().then(() => self.clients.claim());
} else if (msg === 'clear') {
void caches.delete(CACHE_NAME);
caches.delete(CACHE_NAME);
} else if (msg === 'update') {
self.skipWaiting().then(() => self.clients.claim()).then(() => self.clients.matchAll()).then((all) => all.forEach((c) => c.navigate(c.url)));
}
Expand Down
4 changes: 3 additions & 1 deletion platform/web/js/libs/library_godot_input.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ const GodotIME = {

ime_active: function (active) {
function focus_timer() {
if (!GodotIME.ime) return;
if (!GodotIME.ime) {
return;
}
GodotIME.active = true;
GodotIME.ime.focus();
}
Expand Down

0 comments on commit 51c8db3

Please sign in to comment.