1
- // v0.1.0 https://github.com/jamesgreenblue/obsidian-quicknote is licensed under the MIT License
1
+ // https://github.com/jamesgreenblue/obsidian-quicknote is licensed under the MIT License
2
2
3
3
const LOG_PREFIX = "obsidian-quicknote" ,
4
4
LOG_LOADING = "hello" ,
@@ -11,7 +11,7 @@ const obsidian = require("obsidian"),
11
11
const dockMenu = Menu . buildFromTemplate ( [
12
12
{
13
13
label : 'New quick note' ,
14
- click ( ) { this . app . commands . executeCommandById ( 'quicknote:jgb- create-quick-note' ) ; }
14
+ click ( ) { this . app . commands . executeCommandById ( 'quicknote:create-quick-note' ) ; }
15
15
}
16
16
] )
17
17
@@ -25,7 +25,7 @@ class QuickNotePlugin extends obsidian.Plugin {
25
25
}
26
26
27
27
this . addCommand ( {
28
- id : "jgb- create-quick-note" ,
28
+ id : "create-quick-note" ,
29
29
name : "New quick note" ,
30
30
icon : "popup-open" ,
31
31
callback : async ( ) => {
@@ -70,6 +70,11 @@ class QuickNotePlugin extends obsidian.Plugin {
70
70
71
71
}
72
72
73
+ htmlToFragment = ( html ) =>
74
+ document
75
+ . createRange ( )
76
+ . createContextualFragment ( ( html ?? "" ) . replace ( / \s + / g, " " ) ) ;
77
+
73
78
var DEFAULT_SETTINGS = {
74
79
quickNoteTitle : "YYYY-MM-DD [Quick note]"
75
80
} ;
@@ -78,10 +83,7 @@ var SettingTab = class extends obsidian.PluginSettingTab {
78
83
display ( ) {
79
84
const { containerEl } = this ;
80
85
containerEl . empty ( ) ;
81
- containerEl . createEl ( "h1" , {
82
- text : `${ this . plugin . manifest . name } ${ this . plugin . manifest . version } `
83
- } ) ;
84
- new obsidian . Setting ( this . containerEl ) . setName ( "Quick note title" ) . setDesc ( "See Moment.js documentation for instructions" ) . addText ( ( text ) => {
86
+ new obsidian . Setting ( this . containerEl ) . setName ( "Quick note title" ) . setDesc ( htmlToFragment ( `See Moment.js <a href="https://momentjs.com/docs/#/displaying/format/" target="_blank" rel="noopener">Format docs</a> for options` ) ) . addText ( ( text ) => {
85
87
text . setPlaceholder ( DEFAULT_SETTINGS . quickNoteTitle ) . setValue ( this . plugin . settings . quickNoteTitle ) . onChange ( ( newTitle ) => {
86
88
this . plugin . settings . quickNoteTitle = newTitle ;
87
89
this . plugin . saveSettings ( ) ;
0 commit comments