Compare commits

..

5 commits

Author SHA1 Message Date
Daniel Stirba
eb148b6105 chore: Bump version to 1.2.4 in manifest.json and package.json 2025-01-12 16:29:14 +11:00
Daniel Stirba
a4e15ad385 style: Update OFCGDetails styles for light and dark themes 2025-01-12 16:28:08 +11:00
Daniel Stirba
8476645fb1 Forgot Package.json 2024-05-27 23:15:22 +10:00
Daniel Stirba
a0594d757e Updated Versioning 2024-05-27 23:15:18 +10:00
Daniel Stirba
3f5606ff2e Added a Command to "Open Fantasy Generator" 2024-05-27 22:50:15 +10:00
5 changed files with 45 additions and 5 deletions

27
main.ts
View file

@ -30,6 +30,33 @@ export default class FantasyPlugin extends Plugin {
}
});
//Command to open Modal dialog
this.addCommand({
id: 'open-fantasy-generator',
name: 'Open Fantasy Generator',
callback: () => {
new GeneratorModal(this.app, (result) => {
const copyContent = async () => {
//Try to see if any generators spit out an Error or if copying the string fails.
try {
if (result instanceof Error) {
new Notice(`${result}`);
} else {
await navigator.clipboard.writeText(result);
new Notice(`${result} was copied to the clipboard.`);
}
} catch (err) {
console.error('Failed to copy: ', err);
new Notice("Failed to copy, Check error in console.");
}
}
copyContent();
}, this).open();
},
});
//Register the InlineGeneratorSuggester to the Editor suggester.
this.registerEditorSuggest(new InlineGeneratorSuggester(this.getOptionsForSuggest, this));

View file

@ -1,7 +1,7 @@
{
"id": "fantasy-content-generator",
"name": "Fantasy Content Generator",
"version": "1.2.2",
"version": "1.2.4",
"minAppVersion": "0.15.0",
"description": "A Fantasy Content Generator for Obsidian for All Your TTRPG / World Building Needs",
"author": "Gregory Jagermeister ",

View file

@ -1,6 +1,6 @@
{
"name": "fantasy-content-generator",
"version": "1.2.2",
"version": "1.2.4",
"description": "A Fantasy Content Generator For all your TTRPG Needs",
"main": "main.js",
"scripts": {

View file

@ -1,4 +1,15 @@
.OFCGDetails {
.theme-light .OFCGDetails {
border: 1px solid #ccc;
box-shadow: 0px 12px 0px 0px rgba(255, 255, 255, 0.37);
background-color: #f0f0f0;
}
.theme-light .OFCGDetails[open] summary {
border-bottom: 1px solid #666;
margin-bottom: 0.5em;
}
.theme-dark .OFCGDetails {
border: 1px solid #272727;
box-shadow: 0px 12px 0px 0px rgba(0, 0, 0, 0.37);
background-color: #313131;
@ -16,7 +27,7 @@
padding: 0.5em;
}
.OFCGDetails[open] summary {
.theme-dark .OFCGDetails[open] summary {
border-bottom: 1px solid #aaa;
margin-bottom: 0.5em;
}

View file

@ -1,3 +1,5 @@
{
"1.2.2": "0.15.0"
"1.2.3": "0.15.0",
"1.2.2": "0.15.0",
"1.2.4": "0.15.0"
}