mirror of
https://github.com/gregory-jagermeister/Fantasy-Content-Generator.git
synced 2026-07-22 07:30:31 +00:00
Compare commits
5 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb148b6105 | ||
|
|
a4e15ad385 | ||
|
|
8476645fb1 | ||
|
|
a0594d757e | ||
|
|
3f5606ff2e |
5 changed files with 45 additions and 5 deletions
27
main.ts
27
main.ts
|
|
@ -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));
|
||||
|
||||
|
|
|
|||
|
|
@ -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 ",
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
15
styles.css
15
styles.css
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
}
|
||||
Loading…
Reference in a new issue