-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwiki.view.ts
53 lines (39 loc) · 1.09 KB
/
wiki.view.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
namespace $.$$ {
export class $my_wiki extends $.$my_wiki {
@ $mol_mem_key
note( ref: $hyoo_crus_ref ) {
return this.$.$hyoo_crus_glob.Node( ref, $my_wiki_note )
}
note_current() {
const str = this.$.$mol_state_arg.value( '' )
if( !str ) return null!
const ref = $hyoo_crus_ref( str )
return this.note( ref )
}
note_title( next?: string ) {
return this.note_current()?.title( next ) ?? ''
}
note_body() {
return this.note_current()?.Body( null )!
}
note_changed_moment() {
return this.note_current()?.last_change() ?? null!
}
@ $mol_action
add() {
const land = this.$.$hyoo_crus_glob.land_grab( { '': $hyoo_crus_rank_post( 'just' ) } )
this.$.$mol_dom_context.location.href = '#!=' + land.ref().description
this.editing( true )
}
@ $mol_mem
profile_arg() {
return {
'': this.$.$hyoo_crus_glob.home().hall_by( $my_wiki_note, { '': $hyoo_crus_rank_read } )!.ref().description
}
}
@ $mol_mem
editing( next?: boolean ) {
return this.$.$mol_state_history.value( 'edit', next ) ?? false
}
}
}