Skip to content

Commit 0525507

Browse files
save file
1 parent 1f534c8 commit 0525507

File tree

1 file changed

+66
-41
lines changed

1 file changed

+66
-41
lines changed
Lines changed: 66 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
## Description
22

3-
The web-console provides a console ( like dev tools ) in a webpage
3+
Produces a file listing in a webpage
44

55

66
## Include
77

88
```
99
10-
<web-console component></web-console>
10+
<dir-tree component></dir-trere>
1111
1212
```
1313

@@ -16,11 +16,6 @@ The web-console provides a console ( like dev tools ) in a webpage
1616

1717
name | description
1818
----------|------------
19-
$ | the dom helper library
20-
ace | a global reference to ace editor, otherwise each instance of the web-console will load its own ace editor, specifying this ensures its only loaded once
21-
embed | allows reading the supported attributes from another node
22-
config | config parameters, see below
23-
echo | whether to echo the output to the dev tools console
2419

2520

2621
## api
@@ -31,14 +26,10 @@ these attribute can be defined on the html tag itself
3126

3227
attribute | description
3328
--------- |-----------
34-
fullsize | the console will keep expanding to show all content
35-
h \| height | sets the height of the console
3629

3730

3831
### module
3932

40-
methods without a description are not currently implmented and are passed through to dev tools
41-
4233

4334
name|description
4435
---|---
@@ -47,33 +38,67 @@ initmod|standard function for importing local dependencies
4738
init|standard initialisation function
4839
initdom|standard function to setup the dom
4940
|
50-
**console** |
51-
assert|
52-
clear|clear the console
53-
count|
54-
countReset|
55-
debug|write debug information to the console
56-
dir|
57-
dirxml|
58-
error|display error information in the console
59-
group|
60-
groupCollapsed|
61-
groupEnd|
62-
info|
63-
log|log data to the console
64-
profile|
65-
profileEnd|
66-
table|
67-
time|
68-
timeEnd|
69-
timeLog|
70-
timeStamp|
71-
trace|
72-
warn|display warn information in the console
73-
|
74-
**extended** |
75-
write|write to the console, without adding a newline character at the end of the output
76-
json|write json stringified output to the console
77-
|
78-
|
79-
test|display test data in the console, for quick tests
41+
build(data)|takes a simple object structure and return a structure that dirtree can use ( see below )
42+
display(data,options)|display the directory structure
43+
clear|clear the directory tree
44+
find(path)|find the object representing the directory
45+
open(path)|expand the directory
46+
close(path)|collapse the directory
47+
test()|display test data
48+
49+
50+
### api
51+
52+
53+
#### build(data)
54+
55+
takes a simple, easy to represent object structure representing a directory
56+
57+
```
58+
59+
var data = {
60+
'tmp' : {
61+
'tmp-1' : {
62+
'test.txt':null,
63+
},
64+
'my-file-1.bin':null,
65+
'my-file-2.bin':null,
66+
},
67+
'hello-1.txt':null,
68+
'hello-2.txt':null,
69+
};
70+
71+
```
72+
73+
and produces a ibject structure that can be used by dir-tree to display the directory
74+
75+
```
76+
77+
var data = [
78+
{
79+
parent : null,
80+
type : 'dir',
81+
name : 'tmp',
82+
list : [
83+
{
84+
parent : {object},
85+
type : 'dir',
86+
name : 'tmp-1',
87+
list : [
88+
{
89+
parent : 'object',
90+
type : 'file',
91+
name : 'test.txt'
92+
}
93+
]
94+
},
95+
{
96+
parent : {object},
97+
type : 'file',
98+
name : 'hello.txt'
99+
}
100+
]
101+
}
102+
];
103+
104+
```

0 commit comments

Comments
 (0)