generated from obsidian-community/obsidian-preact-template
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add default folder and prompt for name settings (#204)
* added option to specify folder * added option for folder * succesfully added prompt for name setting * Changed manifect and package files to original from source --------- Co-authored-by: unxok <anderluke707@gmail.com> Co-authored-by: Sam <sam@sbgood.ca>
- Loading branch information
1 parent
6ceced5
commit 0efb381
Showing
9 changed files
with
2,447 additions
and
514 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
import commonjs from '@rollup/plugin-commonjs' | ||
import json from '@rollup/plugin-json' | ||
import { nodeResolve } from '@rollup/plugin-node-resolve' | ||
import typescript from '@rollup/plugin-typescript' | ||
import commonjs from "@rollup/plugin-commonjs"; | ||
import json from "@rollup/plugin-json"; | ||
import { nodeResolve } from "@rollup/plugin-node-resolve"; | ||
import typescript from "@rollup/plugin-typescript"; | ||
|
||
const banner = `/* | ||
THIS IS A GENERATED/BUNDLED FILE BY ROLLUP | ||
if you want to view the source visit the plugins github repository | ||
*/ | ||
` | ||
`; | ||
|
||
export default { | ||
input: 'src/index.ts', | ||
input: "src/index.ts", | ||
output: { | ||
file: 'main.js', | ||
sourcemap: 'inline', | ||
format: 'cjs', | ||
exports: 'default', | ||
banner | ||
file: "main.js", | ||
sourcemap: "inline", | ||
format: "cjs", | ||
exports: "default", | ||
banner, | ||
}, | ||
external: ['obsidian'], | ||
plugins: [typescript(), nodeResolve({ browser: true }), commonjs(), json()] | ||
} | ||
external: ["obsidian"], | ||
plugins: [typescript(), nodeResolve({ browser: true }), commonjs(), json()], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { App, Modal, Setting } from "obsidian"; | ||
|
||
export class nameModal extends Modal { | ||
result: string; | ||
defaultName: string; | ||
onSubmit: (result: string) => void; | ||
|
||
constructor( | ||
app: App, | ||
onSubmit: (result: string) => void, | ||
defaultName: string | ||
) { | ||
super(app); | ||
this.onSubmit = onSubmit; | ||
this.defaultName = defaultName; | ||
} | ||
|
||
onOpen(): void { | ||
const { contentEl } = this; | ||
|
||
contentEl.createEl("h1", { text: "Name of new note" }); | ||
|
||
new Setting(contentEl).setName("Name").addText((text) => { | ||
text.setPlaceholder(this.defaultName); | ||
text.onChange((value: string) => { | ||
this.result = value; | ||
}); | ||
}); | ||
|
||
new Setting(contentEl).addButton((btn) => | ||
btn | ||
.setButtonText("Create Note") | ||
.setCta() | ||
.onClick(() => { | ||
this.close(); | ||
this.onSubmit(this.result); | ||
}) | ||
); | ||
} | ||
|
||
onClose() { | ||
const { contentEl } = this; | ||
contentEl.empty(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.