forked from mrfatguy/phonegap-bootstrap-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
313 lines (209 loc) · 15.4 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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="assets/style.css" rel="stylesheet" media="screen">
<link href="assets/apprise/apprise.min.css" rel="stylesheet" />
<link href="assets/bootstrap/bootstrap.min.css" rel="stylesheet" media="screen" title="main">
<link href="assets/bootstrap/bootstrap-responsive.min.css" rel="stylesheet">
<link href="assets/font-awesome/font-awesome.min.css" rel="stylesheet">
<link href="assets/bootstrap-slider/bootstrap-slider.min.css" rel="stylesheet" />
<script type="text/javascript" src="assets/other/jquery.min.js"></script>
<script type="text/javascript" src="assets/other/blockui.min.js"></script>
<script type="text/javascript" src="assets/other/i18next.min.js"></script>
<script type="text/javascript" src="assets/other/segment-display.min.js"></script>
<script type="text/javascript" src="assets/other/bootstrap-tabdrop.min.js"></script>
<script type="text/javascript" src="assets/apprise/apprise.min.js"></script>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="assets/ln.js"></script>
<script type="text/javascript" src="assets/app.js"></script>
<script type="text/javascript" src="assets/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="assets/bootstrap-slider/modernizr.min.js"></script>
<script type="text/javascript" src="assets/bootstrap-slider/bootstrap-slider.min.js"></script>
<script type="text/javascript">
$.blockUI.defaults.css.top = '45%';
$.blockUI.defaults.css.border = 'none';
$.blockUI.defaults.css.background = 'none';
$.blockUI.defaults.overlayCSS.opacity = 0.5;
$.blockUI.defaults.message = '<div style="margin: 17px; vertical-align: middle; display: inline-block"><i class="icon-cog icon-spin icon-4x"></i></div>';
$(document).ajaxStart($.blockUI).ajaxStop($.unblockUI);
</script>
<title>PhoneGap Demo Bootstrap</title>
</head>
<body>
<div class="container-fluid">
<div class="row-fluid">
<div class="well well-small" id="menu-buttons">
<div class="pull-left" style="width: 48%">
<div class="btn-group">
<a class="btn dropdown-leader" id="buttonStyle">
<i class="icon-cog"></i>
<span data-i18n="buttons.style">buttons.style</span>
</a>
<a class="btn dropdown-toggle" data-toggle="dropdown">
<span class="icon-caret-down"></span>
</a>
<ul class="dropdown-menu">
<li><a class="change-style-menu-item" rel="assets/bootstrap/bootstrap.amelia.min.css"><i class="icon-fixed-width"></i> bootstrap.amelia.min.css (Amelia)</a></li>
<li><a class="change-style-menu-item" rel="assets/bootstrap/bootstrap.cerulean.min.css"><i class="icon-fixed-width"></i> bootstrap.cerulean.min.css (Cerulean)</a></li>
<li><a class="change-style-menu-item" rel="assets/bootstrap/bootstrap.cosmo.min.css"><i class="icon-fixed-width"></i> bootstrap.cosmo.min.css (Cosmo)</a></li>
<li><a class="change-style-menu-item" rel="assets/bootstrap/bootstrap.cyborg.min.css"><i class="icon-fixed-width"></i> bootstrap.cyborg.min.css (Cyborg)</a></li>
<li><a class="change-style-menu-item" rel="assets/bootstrap/bootstrap.flatly.min.css"><i class="icon-fixed-width"></i> bootstrap.flatly.min.css (Flatly)</a></li>
<li><a class="change-style-menu-item" rel="assets/bootstrap/bootstrap.journal.min.css"><i class="icon-fixed-width"></i> bootstrap.journal.min.css (Journal)</a></li>
<li><a class="change-style-menu-item" rel="assets/bootstrap/bootstrap.readable.min.css"><i class="icon-fixed-width"></i> bootstrap.readable.min.css (Readable)</a></li>
<li><a class="change-style-menu-item" rel="assets/bootstrap/bootstrap.simplex.min.css"><i class="icon-fixed-width"></i> bootstrap.simplex.min.css (Simplex)</a></li>
<li><a class="change-style-menu-item" rel="assets/bootstrap/bootstrap.slate.min.css"><i class="icon-fixed-width"></i> bootstrap.slate.min.css (Slate)</a></li>
<li><a class="change-style-menu-item" rel="assets/bootstrap/bootstrap.spacelab.min.css"><i class="icon-fixed-width"></i> bootstrap.spacelab.min.css (Spacelab)</a></li>
<li><a class="change-style-menu-item" rel="assets/bootstrap/bootstrap.superhero.css"><i class="icon-fixed-width"></i> bootstrap.superhero.css (Superhero)</a></li>
<li><a class="change-style-menu-item" rel="assets/bootstrap/bootstrap.united.min.css"><i class="icon-fixed-width"></i> bootstrap.united.min.css (United)</a></li>
<li class="divider"></li>
<li><a style="font-weight: bold" class="change-style-menu-item" rel="assets/bootstrap/bootstrap.min.css"><i class="icon-fixed-width icon-arrow-right"></i> bootstrap.min.css (Default)</a></li>
</ul>
</div>
<div class="btn-group">
<a class="btn btn-warning dropdown-leader" id="buttonLanguage">
<i class="icon-align-left"></i>
<span data-i18n="buttons.language">buttons.language</span>
</a>
<a class="btn btn-warning dropdown-toggle" data-toggle="dropdown">
<span class="icon-caret-down"></span>
</a>
<ul class="dropdown-menu">
<li><a class="change-language-menu-item" data-language="Deutsch"><i class="icon-fixed-width"></i> Deutsch (de-DE)</a></li>
<li><a class="change-language-menu-item" data-language="中文"><i class="icon-fixed-width"></i> 中文(简体) (zh-CN)</a></li>
<li><a class="change-language-menu-item" data-language="polski"><i class="icon-fixed-width"></i> polski (pl-PL)</a></li>
<li class="divider"></li>
<li><a style="font-weight: bold" class="change-language-menu-item" rel="en" data-language="English"><i class="icon-fixed-width icon-arrow-right"></i> English (en-GB)</a></li>
</ul>
</div>
</div>
<div class="pull-right text-right" style="width: 48%">
<a id="btnInfo" class="btn btn-primary"><i class="icon-info"></i> <span data-i18n="buttons.info">buttons.info</span></a>
<a id="btnAcrid" class="btn btn-info"><i class="icon-hand-right"></i> <span data-i18n="buttons.acrid">buttons.acrid</span></a>
</div>
<div style="clear: both"></div>
</div>
<ul class="nav nav-tabs">
<li class="active"><a href="#bootstrap" data-i18n="tabs.bootstrap" data-toggle="tab">tabs.bootstrap</a></li>
<li><a href="#javascript" data-i18n="tabs.javascript" data-toggle="tab">tabs.javascript</a></li>
<li><a href="#phonegap" data-i18n="tabs.phonegap" data-toggle="tab">tabs.phonegap</a></li>
<li><a href="#other" data-toggle="tab">Other</a></li>
<li><a href="#more" data-toggle="tab">More</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="bootstrap" data-url="_bootstrap.html">Please wait, loading...</div>
<div class="tab-pane" id="javascript" data-url="_javascript.html">Please wait, loading...</div>
<div class="tab-pane" id="phonegap" data-url="_phonegap.html">Please wait, loading...</div>
<div class="tab-pane" id="other" data-url="_other.html">Please wait, loading...</div>
<div class="tab-pane" id="more">This is only a fake tab -- This page is intentionally left blank.</div>
</div>
</div>
</div>
<div id="blockui-animated-content" style="display: none; padding: 15px">
<div style="margin-right: 7px; vertical-align: middle; display: inline-block">
<i class="icon-cog icon-spin icon-3x"></i>
</div>
</div>
<script type="text/javascript">
/*<![CDATA[*/
/**
* jQuery
*/
$(function($)
{
/**
* Device info dialog box.
*
* Gathers device information and displays it as Bootstrap modal.
*/
$('body').on('click', '#btnInfo', function()
{
var info =
'Model: <strong>' + device.model + '</strong>.<br />' +
'UUID: <strong>' + device.uuid + '</strong>.<br />' +
'OS: <strong>' + device.platform + ' ' + device.version + '</strong>.<br />' +
'Screen: <strong>' + screen.availHeight + 'x' + screen.availWidth + '</strong>.';
apprise(info, {});
});
$('body').on('click', '#btnAcrid', function()
{
app.openUrl('http://acrid.pl');
});
$('body').on('click', '.nav-tabs', function()
{
app.updatePhonegapTab();
});
/**
* Dynamic stylesheet changer.
*
* onClick handler for dynamic change of Bootstrap's styles. Based
* on Bootswatch.com's Bootstrap styles and following example:
*
* http://www.cssnewbie.com/simple-jquery-stylesheet-switcher/#.UdusmTv0F0o
*/
$('body').on('click', '#buttonStyle', function()
{
apprise(i18n.t("messages.style"), {});
});
$('body').on('click', '.change-style-menu-item', function()
{
var
item = $(this).text(),
stylesheet = item.substring(1, item.indexOf('(') - 1),
title = item.substring(item.indexOf('(') + 1, item.indexOf(')'));
$('link[title="main"]').attr('href', $(this).attr('rel'));
$('header#overview').find('h1').html(title);
$('header#overview').find('code').html(stylesheet);
$('.change-style-menu-item').css('font-weight', 'normal').find('i').removeClass('icon-arrow-right');
$(this).css('font-weight', 'bold').find('i').addClass('icon-arrow-right');
if(typeof(theClock) !== 'undefined')
{
var colorOff = (title === 'Cyborg' || title === 'Slate' || title === 'Superhero') ? 'rgba(27, 65, 5, 0.3)' : 'rgba(200, 200, 200, 0.3)';
theClock.colorOff = theDisplay.colorOff = colorOff;
theClock.colorOn = theDisplay.colorOn = $('h1').css('color');
}
app.updatePhonegapTab();
app.writeEventLog('Changing style to "' + title + '" (' + stylesheet + ').');
});
/**
* Dynamic language changer.
*
* onClick handler for dynamic change of page's language. Based
* on i18next engine: http://i18next.com/
*
* Note: We're using local language names here (i.e. 中文 -- for Chinese),
* which seems to be way, way harder (more stupid?) than just using
* ISO 639-1 two-letter codes (i.e. zh -- for Chinese). Don't blame
* me -- this is how (stupidly) PhoneGap is build, that it returns
* local language name from navigator.globalization.getPreferredLanguage
* while it SHOULD return code. So, entire mechanism is oriented
* toward this behavior, and that is why, you have to provide real,
* not encoded, not escapsed name in `data-language` attribute. Use:
*
* http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
*
* to get actual local name, for (nearly) any language, you wish.
*/
$('body').on('click', '#buttonLanguage', function()
{
apprise(i18n.t("messages.language"), {});
});
$('body').on('click', '.change-language-menu-item', function()
{
var language = $(this).attr('data-language');
ln.setLanguage(language);
app.writeEventLog('Changing language to: ' + ln.language.international + ' (' + ln.language.local + ').');
});
/**
* Tab drop for Bootstrap
*
* http://www.eyecon.ro/bootstrap-tabdrop/
*/
$('.nav-tabs').tabdrop();
});
/*]]>*/
</script>
</body>
</html>