-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·200 lines (175 loc) · 5.15 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Lili Framework</title>
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css"
integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M"
crossorigin="anonymous"
>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"
></script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"
></script>
<script>var API_URL = "http://www.your_domain.com/api/";</script>
<script>
$(document).ready( () => {
$('.row').hide();
$('.config').show();
$.ajax( {
method: "GET",
dataType: "json",
url: API_URL + "?class=help&method=info"
} ).done( ( content ) => {
$('#config').html( content.config );
$('#structure').html( content.structure );
$('#examples').html( content.examples );
$('#post_examples').html( content.post_examples );
$('#image_examples').html( content.image_examples );
$('#services_list').html( content.services_list );
} );
$.ajax( {
method: "GET",
dataType: "json",
url: API_URL + "?class=help&method=menu"
} ).done( ( items ) => {
$('#menu').html( menu(items) );
$('#main-menu li a').on( 'click' , function( e ) {
e.preventDefault();
let item = $(this)[0].href.match(/([^\/]*)\/*$/)[1];
$('.row').hide();
$('.'+item).show();
} );
$('#form_post button').on( 'click' , function( e ) {
e.preventDefault();
$.ajax( {
method: "POST",
dataType: "json",
data: $('#form_post').serialize(),
url: API_URL + "?class=getform&method=post"
} ).done( ( items ) => {
let list = '<ul>';
for ( item in items ) {
list += '<li>'+item+': '+items[item]+'</li>'
}
list += '</ul>';
$('#form_data_posted').html(list);
$('.modal').modal('show');
});
} );
} );
} );
function menu( items ) {
let menu = '<ul class="navbar-nav mr-auto" id="main-menu">';
for ( i in items ) {
menu += '<li class="nav-item active"><a class="nav-link" href="/'+i+'">'+items[i]+'</a></li>'
}
menu += '</ul>';
return menu;
}
</script>
<style>
.mod-post {
margin-bottom: 30px;
}
pre {
border: 1px solid #dad8d8;
border-top: 5px solid #b99a42;
padding: 15px;
}
.fa {
display: block;
margin: 8px 5px;
}
li.fa-file-text-o span {
margin: 0 5px;
}
li.fa span {
margin: 0 5px;
}
.example.fa span {
margin: 5px;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
<a class="navbar-brand" href="#">Lili Framework</a>
<span class="navbar-brand"> | </span>
<ul class="navbar-nav mr-auto">
<span id="menu"></span>
</ul>
</nav>
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<div class="container">
<h1 class="display-3">Lili Framework Help</h1>
<p>Configs, examples, and more</p>
</div>
</div>
<div class="container">
<!-- Config -->
<div class="row justify-content-md-center config">
<div class="col-md-8" >
<div id="config"></div>
</div>
</div>
<!-- Examples -->
<div class="row justify-content-md-center examples">
<div class="col-md-8" >
<div id="examples"></div>
</div>
</div>
<!-- Post Examples -->
<div class="row justify-content-md-center post_examples">
<div class="col-md-8" >
<div id="post_examples"></div>
</div>
</div>
<!-- Post Examples -->
<div class="row justify-content-md-center image_examples">
<div class="col-md-8" >
<div id="image_examples"></div>
</div>
</div>
<!-- Services List -->
<div class="row justify-content-md-center services_list">
<div class="col-md-8" >
<div id="services_list"></div>
</div>
</div>
<!-- Structure -->
<div class="row justify-content-md-center structure">
<div class="col-md-8" >
<div id="structure"></div>
</div>
</div>
<!-- Modal -->
<div class="modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Form data</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<span id="form_data_posted"></span>
</div>
</div>
</div>
</div>
</div>
</body>
</html>