forked from culmat/jsTreeTable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
104 lines (88 loc) · 3.01 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<title>jsTreeTable</title>
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<link rel="stylesheet" type="text/css" href="doc/style.css">
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<link rel="stylesheet" type="text/css" href="style/simple.css">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script src="treeTable.js"></script>
<script src="doc/makeData.js"></script>
</head>
<body>
<div id="chart" >
<svg>
</svg>
</div>
<xmp theme="Cerulean" style="display:none;"></xmp>
<script type="text/javascript">
function buildTOC() {
$('body').append('<div id="toc" class="well sidebar-nav nav"><ol id="toc-list" ></ol></div>');
$("h2, h3, h4").each(function (idx, val) {
var h = $(this)
, title = h.text()
, link = title.toLowerCase().replace(/(\,|\(|\)|\[|\]|\:|\.)/g, '').replace(/\s/g, '-')
h.attr("id", link)
h.html('<a href="#' + link + '">' + title + '</a>');
$("#toc-list").append('<li class="toc-' + this.nodeName.toLowerCase() + '"><a id="" href="#' + link + '">' + title + '</a></li>');
$('.navbar-inner').css('border-radius','0 4px 4px 0')
$('.navbar-inner').css('box-shadow','none')
$('#headline').css('cursor','pointer')
$('#headline').click(function() {
window.scrollTo(0, 0);
})
})
}
</script>
<script type="text/javascript">
function makeLinksLocal(){
$('a').each(function(i, link){
var href = $(link).attr('href')
var prefix = 'http://culmat.github.io/jsTreeTable/'
if(href.indexOf(prefix) == 0)
$(link).attr('href',href.substr(prefix.length))
})
}
var DEV = window.location.protocol == 'file:'
var url = 'http://culmat.github.io/jsTreeTable/README.md'
var markdown_io = url //'http://markdown.io/_raw/' + url
if(DEV)
markdown_io = 'README.md'
$.ajax({
url : markdown_io,
dataType:'text'
}).done(
function(data) {
$('xmp').text(data)
$.getScript('http://strapdownjs.com/v/0.2/strapdown.js',
function() {
buildTOC()
//$('.navbar').first().remove()
$('#content').addClass('well')
var jsTT = {}
com_github_culmat_jsTreeTable.register(jsTT)
var options = {
mountPoint : $('#content p').first(),
idAttr : 'name',
replaceContent : false,
slider :true,
initialExpandLevel : 3,
controls : [$('<br/><br/>')]
}
jsTT.appendTreetable(jsTT.makeTree(makeData(), 'name'), options)
if(DEV) makeLinksLocal()
/*
$('body').scrollspy({ target: '#toc' })
$('#myScrollspy').on('activate.bs.scrollspy', function () {
console.log(this)
})
*/
})
})
</script>
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script type="text/javascript" src="doc/tree.js"></script>
</body>
</html>