forked from quiet2/network-weathermap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
new-dom-structure.txt
54 lines (42 loc) · 1.3 KB
/
new-dom-structure.txt
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
_DEFAULT_ link and node are built-in - the default defaults
All others are initially empty, with just a reference to the parent.
Per node:
list of properties
for each:
name
value
config filename (if any)
config line number (if any)
type? (so we can use a standard parser/writer)
special name/type for comments
editor has set/get functions to alter the config.
all map fns need to use the getter to get config info
seperate array of nodes and links (as now) for *runtime* info
- e.g. the width of the image, the calculated position, the ReadData results
- also store some kind of reference to the appropriate place in the DOM
To avoid PHP4 reference rubbish, each DOM item is just stored in an array with a UID. The UID is used as a reference whenever one is needed. No circular references, no accidental pass-by-value. Use uniqid().
WriteConfig then just enumerates the DOM.
Maybe need a function to optimise the tree, making sure that the property value doesn't match the parent's value (i.e. it's redundant)
LINK _DEFAULT_
LINK DEFAULT
LINK l1
LINK l2
LINK l3
LINK template1
LINK l4
LINK l5
LINK l6
NODE _DEFAULT_
NODE DEFAULT
NODE n1
NODE n2
NODE n3
NODE template1
NODE n4
NODE n5
NODE n6
NODE template2
NODE n7
NODE template2a
NODE n8
NODE template3