Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
blurymind committed Apr 8, 2024
1 parent f229b34 commit b7e14df
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 31 deletions.
4 changes: 2 additions & 2 deletions index.html

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion js/main.a2e715db32c2c6a3cf85.js

This file was deleted.

1 change: 1 addition & 0 deletions js/main.c2933f1125f8eefc8061.js

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
60 changes: 34 additions & 26 deletions public/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,33 +273,41 @@ export var Plugins = function(app) {
if (gistFile.language === 'JavaScript') {
console.log({ gistFile });
try {
importModuleWeb(gistFile.content, gistFile.filename).then(
importedPlugin => {
const newPlugin = importedPlugin(pluginApiMethods);
newPlugin.name = newPlugin.name || gistFile.filename;
console.log({ newPlugin }, 'loaded from ', gistFile.raw_url);
if ('dependencies' in newPlugin) {
newPlugin.dependencies.forEach(dependency => {
const scriptEle = document.createElement('script');
scriptEle.setAttribute('src', dependency);
document.body.appendChild(scriptEle);
scriptEle.addEventListener('load', () => {
console.log('File loaded', dependency);
});
app.gists
.getContentOrRaw(gistFile.content, gistFile.raw_url)
.then(content => {
importModuleWeb(content, gistFile.filename).then(
importedPlugin => {
const newPlugin = importedPlugin(pluginApiMethods);
newPlugin.name = newPlugin.name || gistFile.filename;
console.log(
{ newPlugin },
'loaded from ',
gistFile.raw_url
);
if ('dependencies' in newPlugin) {
newPlugin.dependencies.forEach(dependency => {
const scriptEle = document.createElement('script');
scriptEle.setAttribute('src', dependency);
document.body.appendChild(scriptEle);
scriptEle.addEventListener('load', () => {
console.log('File loaded', dependency);
});

scriptEle.addEventListener('error', ev => {
console.log('Error on loading file', ev);
});
});
}
registerPlugin(newPlugin);
}
);
} catch (e) {
console.error(gistFile.filename, 'Plugin failed to load', e);
scriptEle.addEventListener('error', ev => {
console.log('Error on loading file', ev);
});
});
}
registerPlugin(newPlugin);
}
);
});
} catch (e) {
console.error(gistFile.filename, 'Plugin failed to load', e);
}
}
}
});
});
});
}
}
};
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.265"
"version": "0.4.266"
}
2 changes: 1 addition & 1 deletion sw.js

Large diffs are not rendered by default.

0 comments on commit b7e14df

Please sign in to comment.