-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNote.mjs
104 lines (94 loc) · 2.85 KB
/
Note.mjs
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import { Location } from './Location.mjs';
//mm # Class: Note
//mm
//mm A simple note that is associated with a location in the Bible.
//mm Notes can be loose (no attachment) but to be useful they usually
//mm are attached to a Book, Chapter, Verse, or even an Xref.
//mm
//mm ## Responsibilities:
//mm * id - A unique number at least unique with a single Bible.
//mm * author - The identification of the person who wrote the note.
//mm * text - the text of the note.
//mm * Location - Where the note should be displayed in the Bible.
//mm
//mm ## Collaborators:
//mm * bible - the Bible the note is associated with.
//mm * book - the Book that the note is assciated with.
//mm * chapter - the chapter that this note belongs in.
//mm * verse - the verse this note belongs in.
//mm * subverse - where in the verse the note belongs.
//mm * xref - the cross-reference that this note describes.
//mm ```mermaid
//mm classDiagram
//mm class Note {
//- - - - - - - - - - - begin Class definition - - - - - - - - - - -
export class Note {
constructor(row) {
//mm +Location location // Location within the Bible.
this.location = new Location();
//mm +integer bibleNumber
this.bibleNumber = 0;
//mm +integer bookNumber
this.bookNumber = 0;
//mm +integer chapterNumber
this.chapterNumber = 0;
//mm +integer verseNumber
this.verseNumber = 0;
//mm *integer subVerse // order within a specific verse
this.subverse = 0;
//mm +String author
this.author = "";
//mm +String title // The title of the note.
this.title = "";
//mm +String text // The actual text of the note.
this.text = "";
//mm +Xref xref // a cross references
this.xref = 0;
if ( row != undefined ) {
this.location.id = row.location;
this.chapterNumber = row.c;
this.verseNumber = row.v;
this.location.path[0] = row.b;
this.location.path[1] = row.c;
this.location.path[2] = row.v;
this.text = row.text;
this.title = row.title;
}
else
{
this.text = '';
this.title = '';
}
}
setTitle(someText) {
this.title = someText;
}
getTitle() {
return this.title;
}
setText(someText) {
this.text = someText;
}
getText() {
return this.text;
}
setAuthor(author) {
this.author = author;
}
getAuthor() {
return this.author;
}
//mm ~loadAll()$ // loads all notes
static loadAll() {
// TBD
}
}
//mm }
//mm Bible *-- Note
//mm Book *-- Note
//mm Chapter *-- Note
//mm Verse *-- Note
//mm Xref *-- Note
//mm ```
//- - - - - - - - - - - end Class definition - - - - - - - - - - -
export default { Note };