Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
blurymind committed Sep 6, 2024
1 parent 80d1b99 commit 4bf9d78
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 6 deletions.
4 changes: 2 additions & 2 deletions index.html

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion js/main.7df991b6e7cde8867382.js

This file was deleted.

1 change: 1 addition & 0 deletions js/main.833dbcb798e26a943600.js

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
9 changes: 8 additions & 1 deletion public/plugins/resources-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export var ResourcesEditor = function({

this.onCommitResourceFiles = newContent => {
this.isBusy('Uploading changes to gist...');
document.querySelector('resources-component').setIsLocked(true);
app.data.storage.editGistFile('resources.json', newContent).then(({ok, gistId, file}) => {
if(ok){
ToastWc.show({
Expand All @@ -136,6 +137,7 @@ export var ResourcesEditor = function({
time: 3000,
});
}
document.querySelector('resources-component').setIsLocked(false);
this.isBusy('')
});
};
Expand All @@ -147,7 +149,12 @@ export var ResourcesEditor = function({
title: '',
html:`
<div id="resourcesEditorWrapper" style="height:${HEIGHT}">
<spinner-component></spinner-component>
<spinner-component style="
position: absolute;
top: 50%;
left: 50%;
z-index: 999;
"></spinner-component>
<resources-component>
<span slot="header-area">Files in</span>
</resources-component>
Expand Down
2 changes: 1 addition & 1 deletion public/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.4.352"
"version": "0.4.353"
}
6 changes: 6 additions & 0 deletions public/web-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,12 @@ class ResourcesComponent extends HTMLElement {
this.updateRawUrl = (newUrl) => {
shadowRoot.getElementById('resourcesFileLink').href = newUrl || 'unknown';
}
this.setIsLocked = isLocked => {//todo make it a class
shadowRoot.getElementById('header-buttons').style.pointerEvents = isLocked ? 'none' : 'auto';
shadowRoot.getElementById('header-buttons').style.opacity = isLocked ? '0.8' : '1';
shadowRoot.getElementById('resource-file-buttons').style.pointerEvents = isLocked ? 'none' : 'auto';
shadowRoot.getElementById('resource-file-buttons').style.opacity = isLocked ? '0.8' : '1';
}
}

init({ file, darkMode, headerButtons, gistId }) {//todo you cannot pass functions to web components, but can use events?
Expand Down
2 changes: 1 addition & 1 deletion sw.js

Large diffs are not rendered by default.

0 comments on commit 4bf9d78

Please sign in to comment.