-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
160 lines (142 loc) · 6.19 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html>
<html lang="en_US">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>PushStateTree Demo</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.glyphicon-refresh-animate {
-animation: spin .7s infinite linear;
-webkit-animation: spin2 .7s infinite linear;
}
@-webkit-keyframes spin2 {
from { -webkit-transform: rotate(0deg);}
to { -webkit-transform: rotate(360deg);}
}
@keyframes spin {
from { transform: scale(1) rotate(0deg);}
to { transform: scale(1) rotate(360deg);}
}
#loading-icon {
zoom: 10;
}
</style>
<!-- Place favicon.ico and apple-touch-icon(s) in the root directory -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script>
/* global $ */
var basePath = '/pushStateTree';
if (location.hostname.indexOf('github.io') === -1){
basePath = '';
}
// If no internet found (programming on travels...)
// Load resources from offline folder
if (typeof $ !== 'function' || !$.when){
function loadOffline(src, callback) {
// Load a file and execute the callback, should be used to
// load files in the right order and then boot the system
var type = src.substr(-3) === 'css' ? 'link' : 'script';
var element = document.createElement(type);
var path = location.origin + basePath + '/demo/offline/';
element.onload = callback;
if(type === 'link'){
element.setAttribute('rel', 'stylesheet');
element.setAttribute('href', path + src);
} else {
element.setAttribute('src', path + src);
}
// May not work on old browsers... But it should only be used on development
document.head.appendChild(element);
}
// Load offline jquery and bootstrap
loadOffline('jquery.min.js', function(){
loadOffline('bootstrap.min.css');
loadOffline('bootstrap.min.js');
boot();
});
} else {
boot();
}
function boot(){
// boot the demo page
function load(src){
// Simple script loader based on promises
var defer = $.Deferred();;
if (!$.support.leadingWhitespace) {
$.getScript(location.protocol + '//' + location.host + src)
.then(defer.resolve, defer.reject);
} else {
$('<script>')
.appendTo('head')
// Get the origin compatible with IE8
.attr('src', location.protocol + '//' + location.host + src)
.on('load', defer.resolve)
.on('error', defer.reject);
}
return defer.promise();
}
// Export load as global
window.load = load;
$.when(load(basePath + '/push-state-tree.js'))
.then(function(){
return load(basePath + '/demo/main.js');
})
.done(function (){
$('#loading').on('hidden.bs.modal', function(){
$('#main').toggleClass('in', true);
}).modal('hide');
});
$(function(){
$('#rootLink').attr('href', basePath + '/');
});
}
</script>
<meta content="@github" name="twitter:site">
<meta content="summary" name="twitter:card">
<meta content="gartz/pushStateTree" name="twitter:title">
<meta content="pushStateTree - A standalone powerful library to manage browser routing with nested level support, complex match expressions and on-fly rules change (convenient to lazy module loading)." name="twitter:description">
<meta content="https://avatars2.githubusercontent.com/u/99608?v=3&s=400" name="twitter:image:src">
<meta content="GitHub" property="og:site_name">
<meta content="object" property="og:type">
<meta content="https://avatars2.githubusercontent.com/u/99608?v=3&s=400" property="og:image">
<meta content="gartz/pushStateTree" property="og:title">
<meta content="https://github.com/gartz/pushStateTree" property="og:url">
<meta content="pushStateTree - A standalone powerful library to manage browser routing with nested level support, complex match expressions and on-fly rules change (convenient to lazy module loading)." property="og:description">
<meta name="description" content="pushStateTree - A standalone powerful library to manage browser routing with nested level support, complex match expressions and on-fly rules change (convenient to lazy module loading).">
</head>
<body>
<!--[if lt IE 9]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<div id="main" class="container fade">
<!-- Static navbar -->
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/" id="rootLink">PushStateTree</a>
</div>
<div class="navbar-collapse collapse">
<ul id="navbarMain" class="nav navbar-nav"></ul>
</div><!--/.nav-collapse -->
</div><!--/.container-fluid -->
</div>
<a href="https://github.com/gartz/pushStateTree" class="ribbon bg-green">Fork me on GitHub</a>
<div id="content"></div>
</div>
<div id="loading" class="modal bs-example-modal-sm fade" role="dialog" aria-hidden="false">
<div class="modal-dialog modal-sm">
<span id="loading-icon" class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span>
</div>
</div>
</body>
</html>