Skip to content

Commit 0bb3c44

Browse files
author
Henrik jJaven
committed
DooHTML-v0.70.1
1 parent 5e5547f commit 0bb3c44

File tree

6 files changed

+40
-350
lines changed

6 files changed

+40
-350
lines changed

frameworks/keyed/doohtml/index.html

Lines changed: 36 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,59 +5,50 @@
55
<title>DooHTML</title>
66
<link href="/css/currentStyle.css" rel="preload" as="style"/>
77
<link href="/css/currentStyle.css" rel="stylesheet"/>
8-
<!-- <link href="./js/doo.html.js" rel="preload" as="script"/> -->
9-
<!-- <link href="./js/doo.html.0.60.1.js" rel="preload" as="script"/> -->
10-
<!-- <script type="module" src="./js/doo.html.js"></script> -->
11-
<!-- <script type="module" src="./js/doo.html.0.60.1.js"></script> -->
12-
13-
<script type="module" src="http://localhost:8001/src/js/doo.html.js"></script>
14-
<!-- <script type="module" src="./js/Main.class.timer.js" defer ></script> -->
8+
<link href="./js/doo.html.js" rel="preload" as="script"/>
9+
<script type="module" src="./js/doo.html.js"></script>
1510
<script type="module" src="./js/Main.class.js" defer ></script>
16-
17-
</head>
18-
11+
</head>
1912
<body>
20-
2113
<div id="main">
2214
<div class="container">
2315
<div class="jumbotron">
2416
<div class="row">
2517
<div class="col-md-6">
26-
<h1>DooHTML - keyed</h1><span class="ver"></span>
18+
<h1>DooHTML - keyed</h1><span class="ver"></span>
2719
</div>
28-
<div class="col-md-6">
29-
<div class="row">
30-
<div class="col-sm-6 smallpad">
31-
<button type="button" class="btn btn-primary btn-block" id="run">Create 1,000 rows</button>
32-
</div>
33-
<div class="col-sm-6 smallpad">
34-
<button type="button" class="btn btn-primary btn-block" id="runlots">Create 10,000 rows</button>
35-
</div>
36-
<div class="col-sm-6 smallpad">
37-
<button type="button" class="btn btn-primary btn-block" id="add">Append 1,000 rows</button>
38-
</div>
39-
<div class="col-sm-6 smallpad">
40-
<button type="button" class="btn btn-primary btn-block" id="update">Update every 10th row</button>
41-
</div>
42-
<div class="col-sm-6 smallpad">
43-
<button type="button" class="btn btn-primary btn-block" id="clear">Clear</button>
44-
</div>
45-
<div class="col-sm-6 smallpad">
46-
<button type="button" class="btn btn-primary btn-block" id="swaprows">Swap Rows</button>
47-
</div>
48-
</div>
49-
</div>
50-
</div>
51-
</div>
52-
<doo-main
53-
context="shadow"
54-
link="/css/currentStyle.css"
55-
bind="rows"
56-
template="./templates/main.html"
57-
></doo-main>
58-
</div>
59-
<span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true"></span>
60-
20+
<div class="col-md-6">
21+
<div class="row">
22+
<div class="col-sm-6 smallpad">
23+
<button type="button" class="btn btn-primary btn-block" id="run">Create 1,000 rows</button>
24+
</div>
25+
<div class="col-sm-6 smallpad">
26+
<button type="button" class="btn btn-primary btn-block" id="runlots">Create 10,000 rows</button>
27+
</div>
28+
<div class="col-sm-6 smallpad">
29+
<button type="button" class="btn btn-primary btn-block" id="add">Append 1,000 rows</button>
30+
</div>
31+
<div class="col-sm-6 smallpad">
32+
<button type="button" class="btn btn-primary btn-block" id="update">Update every 10th row</button>
33+
</div>
34+
<div class="col-sm-6 smallpad">
35+
<button type="button" class="btn btn-primary btn-block" id="clear">Clear</button>
36+
</div>
37+
<div class="col-sm-6 smallpad">
38+
<button type="button" class="btn btn-primary btn-block" id="swaprows">Swap Rows</button>
39+
</div>
40+
</div>
41+
</div>
42+
</div>
43+
</div>
44+
<doo-main
45+
context="shadow"
46+
link="/css/currentStyle.css"
47+
bind="rows"
48+
template="./templates/main.html"
49+
></doo-main>
50+
</div>
51+
<span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true"></span>
6152
</div>
6253
</body>
6354
</html>

frameworks/keyed/doohtml/js/Main.class.js

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,9 @@ Doo.define(
8888

8989
}
9090

91-
run(e) {
92-
Timer.start('tot')
93-
this.clear()
94-
this.data.rows = this.buildData()
95-
this.renderTable()
96-
// e.target.blur()
97-
Timer.stop('tot')
98-
}
99-
100-
10191
add() {
10292
this.data.rows = this.data.rows.concat(this.buildData())
103-
this.renderTable(this.data.rows)
93+
this.renderTable(this.data.rows, this.data.rows.length)
10494
}
10595
// add() {
10696
// // let startRow = this.data.rows.length
@@ -112,42 +102,10 @@ Doo.define(
112102

113103

114104
runLots() {
115-
116105
this.clear()
117106
this.data.rows = this.buildData(10000)
118107
this.renderTable()
119108
}
120-
runLots(e) {
121-
Timer.start('tot')
122-
this.clear()
123-
this.data.rows = this.buildData(10000)
124-
this.renderTable()
125-
e.target.blur()
126-
Timer.stop('tot')
127-
}
128-
renderTable(dataSet=this.data[this.defaultDataSet], start=0) {
129-
let len = dataSet.length - start,
130-
elem = document.createElement('tbody')
131-
elem.innerHTML = this.renderNode(this.place[0], dataSet, start , len)
132-
let tableRows = elem.querySelectorAll('tr'),
133-
newElem
134-
for (let i=0;i<len;i++) {
135-
newElem = this.place[0].appendChild(tableRows.item(i))
136-
newElem.key = dataSet[i].id
137-
}
138-
// newElem = this.place[0].appendChild(tableRows.item(len-1))
139-
// newElem.key = dataSet[len-1].id
140-
141-
// for (let i=len-2;i>=0;i--) {
142-
// newElem = this.place[0].insertBefore(tableRows.item(i), this.place[0].firstChild)
143-
// newElem.key = dataSet[i].id
144-
// }
145-
146-
147-
}
148-
149-
150-
151109

152110
update() {
153111
for (let i=0, len = this.data.rows.length;i<len;i+=10) {
@@ -197,9 +155,9 @@ Doo.define(
197155
document.getElementById("main").addEventListener('click', e => {
198156
e.preventDefault()
199157
if (e.target.matches('#runlots')) {
200-
this.runLots(e)
158+
this.runLots()
201159
} else if (e.target.matches('#run')) {
202-
this.run(e)
160+
this.run()
203161
} else if (e.target.matches('#add')) {
204162
this.add()
205163
} else if (e.target.matches('#update')) {

frameworks/keyed/doohtml/js/Main.class.timer.js

Lines changed: 0 additions & 206 deletions
This file was deleted.

0 commit comments

Comments
 (0)