-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
232 lines (206 loc) · 7.13 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="author" content="www.frebsite.nl" />
<meta
name="viewport"
content="width=device-width minimum-scale=1.0 maximum-scale=1.0 user-scalable=no"
/>
<title>PF2.01</title>
<link
rel="stylesheet"
href="http://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<link rel="stylesheet" href="css/demo.css" />
<link rel="stylesheet" href="css/mmenu.css" />
<style>
:root {
--mm-sidebar-expanded-size: 300px;
}
.mm-menu {
--mm-listitem-size: 50px;
--mm-navbar-size: 50px;
}
@media (min-width: 992px) {
.header a {
display: none;
}
}
.mm-navbar_tabs span {
display: inline-block;
margin-left: 8px;
}
@media (max-width: 450px) {
.mm-navbar_tabs span {
display: none;
}
}
</style>
</head>
<body>
<div id="page">
<div class="header">
<a href="#menu"><span></span></a>
<span class="span_title">首页</span>
</div>
<div class="content" style="padding: 2px">
<iframe id="html_content" src="html/page_659.html" frameborder="0" style="height: 1000px;width: 100%">
</iframe>
</div>
<nav id="menu">
<div id="panel-menu">
<ul id="menu_ul">
</ul>
</div>
<div id="panel-account">
<ul >
</ul>
</div>
<div id="panel-cart">
<p style="text-align: center; padding-top: 30px;">
Your shoppingcart is empty.<br />
<a href="#/">Continue shopping.</a>
</p>
</div>
</nav>
</div>
<!-- mmenu scripts -->
<script src="js/mmenu.polyfills.js"></script>
<script src="js/mmenu.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/handlebars.js/4.7.7/handlebars.min.js"></script>
<script id="ul_temp" type="text/x-handlebars-template">
{{#each data}}
<li><a {{#if_neq this.local ""}} data-href="html/{{{this.local}}}" {{else}} href="#/" {{/if_neq}}">{{{this.name}}}</a>
{{#if this.childs.length}}
<ul>
{{#each this.childs}}
<li><a {{#if_neq this.local ""}} data-href="html/{{{this.local}}}" {{else}} href="#/" {{/if_neq}}>{{{this.name}}}</a>
{{#if this.childs.length}}
<ul>
{{#each this.childs}}
<li><a {{#if_neq this.local ""}} data-href="html/{{{this.local}}}" {{else}} href="#/" {{/if_neq}}>{{{this.name}}}</a>
{{#if this.childs.length}}
<ul>
{{#each this.childs}}
<li><a {{#if_neq this.local ""}} data-href="html/{{{this.local}}}" {{else}} href="#/" {{/if_neq}}>{{{this.name}}}</a>
{{#if this.childs.length}}
{{/if}}
</li>
{{/each}}
</ul>
{{/if}}
</li>
{{/each}}
</ul>
{{/if}}
</li>
{{/each}}
</ul>
{{/if}}
</li>
{{/each}}
</script>
<script src="menu.js"></script>
<script>
Handlebars.registerHelper("if_neq",function(v1, v2, opts){
if(v1 != v2){
return opts.fn(this);
}else{
return opts.inverse(this);
}
});
Handlebars.registerHelper("if_eq",function(v1, v2, opts){
if(v1 == v2){
return opts.fn(this);
}else{
return opts.inverse(this);
}
});
data = []
var tpl = $("#ul_temp").html();
var template = Handlebars.compile(tpl);
console.log(json_str)
var temp = template({data:json_str});
// localStorage.setItem("menu", temp);
$("#menu_ul").append(temp)
document.addEventListener(
"DOMContentLoaded", () => {
// Fire the plugin
const menu = new Mmenu(
document.querySelector('#menu'),
{
// slidingSubmenus: false,
extensions: ['theme-dark', "border-full", "position-back",
],
setSelected: true,
counters: true,
"iconPanels": true,
searchfield: {
placeholder: '搜索目录',
},
// sidebar: {
// collapsed: "(min-width: 550px)",
// expanded: "(min-width: 700px)"
// }
sidebar: {
collapsed: {
use: '(min-width: 500px)',
hideNavbar: true,
},
expanded: {
use: '(min-width: 992px)',
hideNavbar: true,
},
},
navbars: [
{
content: ['searchfield'],
},
{
content: ['prev', 'breadcrumbs', 'close'],
},
{
position: 'bottom',
content: [
'<a href="javascript:;" target="_blank">By 木木</a>',
],
},
],
},
{
searchfield: {
clear: true,
},
navbars: {
breadcrumbs: {
removeFirst: true,
},
},
}
);
// Get the API
const api = menu.API;
// Invoke a method
const panel = document.querySelector( "#panel" );
api.openPanel( panel );
$(document).on('click', 'a', function () {
// event.stopPropagation()
$that = $(this)
href = $that.data('href')
if (href == '' || href == '#' || href == 'html/' || href == undefined) {
return false;
}
parent.document.getElementById("html_content").src=href;
$('.header .span_title').text($that.text())
// $("#menu").attr("class", "mm-menu mm-menu_offcanvas mm-menu_iconpanel mm-menu_hidenavbar mm-menu_sidebar-collapsed mm-menu_sidebar-expanded mm-menu_theme-dark mm-menu_border-full mm-menu_position-back mm-menu_position-bottom")
// .attr("aria-hidden", "true")
// $('body').attr("class", "mm-wrapper")
console.log(href);return false;
})
}
);
</script>
</body>
</html>