-
Notifications
You must be signed in to change notification settings - Fork 1
/
index2.html
executable file
·120 lines (86 loc) · 2.95 KB
/
index2.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html manifest="pwiki.appcache">
<head>
<title>pWiki</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel="manifest" href="manifest.json">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-Bold.ttf">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-BoldItalic.ttf">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-ExtraBold.ttf">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-ExtraBoldItalic.ttf">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-Italic.ttf">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-Light.ttf">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-LightItalic.ttf">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-Regular.ttf">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-Semibold.ttf">
<link rel="prefetch" href="css/fonts/Open_Sans/OpenSans-SemiboldItalic.ttf">
<link rel="stylesheet" href="css/fonts.css">
</head>
<style>
</style>
<script src="ext-lib/jquery.js"></script>
<script src="ext-lib/jquery-ui.min.js"></script>
<script src="ext-lib/jquery.ui.touch.js"></script>
<script src="ext-lib/showdown.min.js"></script>
<script src="ext-lib/FileSaver.js"></script>
<script src="ext-lib/jszip.min.js"></script>
<script src="ext-lib/pouchdb.min.js"></script>
<script src="ext-lib/peer.min.js"></script>
<script src="bootstrap.js"></script>
<script data-main="ui" src="ext-lib/require.js"></script>
<script>
var exportZip = function(){
var zip = new JSZip()
var pwiki = zip.folder("pWiki")
pwiki.file("data.json", JSON.stringify(Wiki.__wiki_data))
zip.generateAsync({type:"blob"})
.then(function(content) {
// see FileSaver.js
saveAs(content, "pWiki.zip") }) }
$(function(){requirejs(['pwiki'], function(pwiki){
var wiki = Object.create(pwiki.pWikiData)
var page = window.page =
new pwiki.pWikiPage({
wiki: wiki,
})
// XXX load data...
var data = wiki.__data = {}
// load bootstrap data...
if(window.Bootstrap){
Bootstrap.__proto__ = pwiki.BaseData
// XXX
var data = wiki.__data = Bootstrap
//data.__proto__ = Bootstrap
}
var client = window.client =
new pwiki.pWikiClient()
client.page = page
client.dom = $('.wiki')
// get the base url...
var url = window.location.hash.slice(1)
url = url != '' ?
url
// XXX get and load page location...
// XXX
: 'WikiHome'
// go to base location...
client.location(url)
// handle hash change...
// XXX move to client setup...
$(window).on('hashchange', function(evt){
evt.preventDefault()
var path = location.hash.slice(1)
// expand the path...
if(page.get(path).path() != path){
location.hash = client.get(path).path()
// open page...
} else {
client.location(path) } })
})})
</script>
<body>
<div class="wiki" />
</body>
</html>
<!-- vim:set sw=4 ts=4 : -->