forked from intel/appframework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
2192 lines (2001 loc) · 95 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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html><!--HTML5 doctype-->
<html>
<head>
<title>jqMobi Kitchen Sink</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes" />
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<link rel="stylesheet" type="text/css" href="kitchensink/icons.css" />
<link rel="stylesheet" type="text/css" href="kitchensink/jq.ui.css" title="default"/>
<!--<link rel="stylesheet" type="text/css" href="plugins/css/jq.8tiles.css" title="8tiles"/>-->
<style>
.scrollBar{background:white;}
h3 {text-align:center; font-size:35px;}
ul.iconLinks li {font-size:12px; font-weight:normal;}
.listbutton {
display:block;
border:1px solid black;
color:black;
background:orange;
border-radius:5px;
width:80%;
text-decoration:none;
text-align:center;
margin:auto;
margin-bottom:10px;
height:30px;
line-height:30px;
}
.class16 {
background:green;
color:red;
}
.jqmscrollBar {background:white !important;}
</style>
<!-- uncomment for AppMobi apps
<script type="text/javascript" charset="utf-8" src="http://localhost:58888/_appMobi/appmobi.js"></script>
<script type="text/javascript" charset="utf-8" src="http://localhost:58888/_appMobi/xhr.js"></script>
-->
<script type="text/javascript" charset="utf-8" src="./jq.mobi.js"></script>
<!-- include jq.desktopBrowsers.js on desktop browsers only -->
<script>
function loadedPanel(what){
//We are going to set the badge as the number of li elements inside the target
$.ui.updateBadge("#jqmlink",$("#jqm").find("li").length);
}
function unloadedPanel(what){
console.log("unloaded "+what.id);
}
if(!(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch)) {
console.log("adding");
var script=document.createElement("script");
script.src="plugins/jq.desktopBrowsers.js";
var tag=$("head").append(script);
if(!$.os.ie){
// $.os.desktop=true;
// $.feat.nativeTouchScroll=true;
}
}
var oldElem="default";
function setActiveStyleSheet(title) {
var a = document.getElementsByTagName("link");
var currElem;
if(title==oldElem.getAttribute("title")||oldElem=="default")
return;
for(i=0; i<a.length; i++) {
if(a[i].getAttribute("title")==title){
currElem=a[i];
}
else if(!a[i].getAttribute("disabled")&&a[i].getAttribute("title"))
oldElem=a[i];
}
currElem.removeAttribute("disabled");
jq.ui.showMask();
window.setTimeout(function(){
jq.ui.hideMask();
oldElem.setAttribute("disabled","true");
},500);
}
$(document).ready(function(){
oldElem=document.getElementsByTagName("link")[0];
});
</script>
<script type="text/javascript" charset="utf-8" src="./plugins/jq.debug.js"></script>
<script type="text/javascript" charset="utf-8" src="./plugins/jq.swipe.js"></script>
<script type="text/javascript" charset="utf-8" src="./plugins/jq.carousel.js"></script>
<script type="text/javascript" charset="utf-8" src="./plugins/jq.drawer.js"></script>
<script type="text/javascript" charset="utf-8" src="./plugins/jq.shake.js"></script>
<script type="text/javascript" charset="utf-8" src="./plugins/jq.alphatable.js"></script>
<script type="text/javascript" charset="utf-8" src="./plugins/jq.template.js"></script>
<script type="text/javascript" charset="utf-8" src="./ui/jq.ui.js"></script>
<script type="text/javascript">
/* This function runs once the page is loaded, but appMobi is not yet active */
var webRoot="./kitchensink/";
$.ui.autoLaunch=false;
$.ui.openLinksNewTab=false;
$.ui.resetScrollers=false;
//$.ui.nativeTouchScroll=false;
var init = function(){
$.ui.backButtonText="Back";
window.setTimeout(function(){$.ui.launch();},1500);
//$.ui.removeFooterMenu(); This would remove the bottom nav menu
};
document.addEventListener("DOMContentLoaded",init,false);
$.ui.ready(function(){
//$.ui.enableDragMenu();
});
/* This code is used to run as soon as appMobi activates */
var onDeviceReady=function(){
AppMobi.device.setRotateOrientation("portrait");
AppMobi.device.setAutoRotate(false);
webRoot=AppMobi.webRoot+"kitchensink/";
//hide splash screen
AppMobi.device.hideSplashScreen();
$.ui.blockPageScroll(); //block the page from scrolling at the header/footer
};
document.addEventListener("appMobi.device.ready",onDeviceReady,false);
function showHide(obj,objToHide){
var el=$("#"+objToHide)[0];
if(obj.className=="expanded"){
obj.className="collapsed";
}
else{
obj.className="expanded";
}
$(el).toggle();
}
</script>
</head>
<body>
<div id="jQUi">
<!-- this is the splashscreen you see. -->
<div id="splashscreen" class='ui-loader'>
<img src="kitchensink/images/splash.png">
<br><br>
<span class='ui-icon ui-icon-loading spin'></span><h1 >Starting app</h1>
</div>
<div id="header">
<a id='menubadge' onclick='jq.ui.toggleSideMenu()' style='float:right;margin-top:0px' class='menuButton'></a>
</div>
<div id="content">
<div title='Welcome' id="main" class="panel" selected="true" data-load="loadedPanel" data-unload="unloadedPanel" data-tab="navbar_home" data-header="testheader">
<h2 class='expanded' onclick='showHide(this,"main_info");'>Welcome</h2>
<p id='main_info'>Welcome to the kitchen sink demo for jqMobi. Here you will find samples of how to use the jqMobi libraries. Please select an option from below.</p>
<ul>
<li class='red'><a href="#jqm" id='jqmlink' class='icon home big'>jqMobi</a></li>
<li class="blue"><a href="#jqmui" >jqUi</a></li>
<li class="teal"><a href="#jqmweb" >jqPlugins</a></li>
</ul>
</div>
<!---------------------------------------------->
<div title="jqMobi" id="jqm" class="panel" data-nav="menu_jqmobi" data-header="testheader">
<!-- <header><span>This is an inline header in a panel. Below is an inline footer</span></header>-->
<h2 class='expanded' onclick='showHide(this,"jqmobi_info");'>jqMobi</h2>
<p id='jqmobi_info'>jqMobi is a blazingly fast query selector tool that is optmimized for HTML5 browsers.</p>
<ul>
<li><a id="tester" href="javascript:;" onClick="$.ui.scrollToBottom('jqm')" class='flipAnimation'>Go To Bottom</a></li>
<li><a href="#jqm1" >$ Selector</a></li>
<li><a href="#jqm2" >$().length()</a></li>
<li><a href="#jqm3" >$().find()</a></li>
<li><a href="#jqm4" >$().html()</a></li>
<li><a href="#jqm5" >$().text()</a></li>
<li><a href="#jqm6" >$().css()</a></li>
<li><a href="#jqm7" >$().empty()</a></li>
<li><a href="#jqm8" >$().hide()</a></li>
<li><a href="#jqm9" >$().show()</a></li>
<li><a href="#jqm10" >$().toggle()</a></li>
<li><a href="#jqm11" >$().val()</a></li>
<li><a href="#jqm12" >$().attr()</a></li>
<li><a href="#jqm13" >$().removeAttr()</a></li>
<li><a href="#jqm14" >$().remove()</a></li>
<li><a href="#jqm15" >$().addClass()</a></li>
<li><a href="#jqm16" >$().removeClass()</a></li>
<li><a href="#jqm17" >$().hasClass()</a></li>
<li><a href="#jqm18" >$().bind()</a></li>
<li><a href="#jqm19" >$().unbind()</a></li>
<li><a href="#jqm20" >$().trigger()</a></li>
<li><a href="#jqm21" >$().append()</a></li>
<li><a href="#jqm22" >$().prepend()</a></li>
<li><a href="#jqm32" >$().get()</a></li>
<li><a href="#jqm31" >$().offset()</a></li>
<li><a href="#jqmparent" >$().parent()</a></li>
<li><a href="#jqmserialize" >$().serialize()</a></li>
<li><a href="#jqm33" >$.isArray()</a></li>
<li><a href="#jqm34" >$.isFunction()</a></li>
<li><a href="#jqm23" >$.jsonP()</a></li>
<li><a href="#jqm24" >$.ajax()</a></li>
<li><a href="#jqm25" >$.get()</a></li>
<li><a href="#jqm26" >$.post()</a></li>
<li><a href="#jqm27" >$.getJSON()</a></li>
<li><a href="#jqm28" >$.param()</a></li>
<li><a href="#jqm29" >$.parseJSON()</a></li>
<li><a href="#jqm30" >$.os</a></li>
<li><a href="javascript:;" onClick="$.ui.scrollToTop('jqm')" >Go To Top</a></li>
</ul>
<br/><br/>
<footer >
<a href="#main" id='navbar_home' class='icon home' >Home <span class='jq-badge lr'>12</span></a>
</footer>
</div>
<div id="jqmserialize" class="panel" title="$().serialize" data-nav="menu_jqmobi" >
<script>
function serializeForm(){
alert($("#form").serialize());
}
</script>
$("#form").serialize() - will return a key/value pair string of the form elements<br><Br>
<form id="form" onsubmit="return false">
Name: <input type='text' class='jq-ui-forms' name='name' value='John Smith'><br>
<input type='checkbox' class='jq-ui-forms' value='yes' checked name='human'><label for='human'>Are you human?</label><br><br>
Gender: <span><select id='serialize_gender' name="gender"><option value='m'>Male</option><option value='f'>Female</option></select></span><br><br>
<br>
<input type="button" onclick="serializeForm()" value="Serialize">
</form>
</div>
<!-- jqm > jqm Selector -->
<div id="jqm1" class="panel" title="$()" data-nav="menu_jqmobi">
<span id="jqmtest2">This is some html</span><br /><br />
<a class="button" href="javascript:;" onclick="alert($('#jqmtest2')[0])">Click to get Object</a><br /><br />
<a class="button" href="javascript:;" onclick="alert($('#jqmtest2').html())">Click to get Content</a>
</div>
<!-- jqm > jqm length() -->
<div id="jqm2" class="panel" title=".length()" data-nav="menu_jqmobi">
<div class='jqm2'>Div 1 (class="jqm2")</div>
<div class='jqm2'>Div 2 (class="jqm2")</div>
<div class='jqm2'>Div 3 (class="jqm2")</div>
<div class='jqm4'>Div 4 (class="jqm4")</div>
<br />
<a class="button" href="javascript:;" onclick="alert($('.jqm2').length)">Click to get the Length by classname</a>
</div>
<!-- jqm > jqm find() -->
<div id="jqm3" class="panel" title=".find()" data-nav="menu_jqmobi">
$("#div").find("li") find all element(s) inside a container<br /><br />
<ul>
<li id='find1'>Item 1</li>
<li>Item 2</li>
</ul>
<a class="button" href="javascript:;" onclick="alert($('#jqm3').find('li').length)">Click to get the count of li's in the div</a><br /><br />
</div>
<!-- jqm > jqm html() -->
<div id="jqm4" class="panel" title=".html()" data-nav="menu_jqmobi">
$("#div").html() allows you to get or set a contents HTML.<br /><br />
<div id="jqm4_content" style='border:1px solid black'>This is some content</div><br /><br />
<a class="button" href='javascript:;' onclick='alert($("#jqm4_content").html())'>Get Content</a> | <a href='javascript:;' class="button" onclick='$("#jqm4_content").html("New Content")'>Set Content</a>
</div>
<!-- jqm > jqm text() -->
<div id="jqm5" class="panel" title=".text()" data-nav="menu_jqmobi">
$("#div").text() allows you to get or set a contents text.<br /><br />
<div id="jqm5_content" style='border:1px solid black'><span>This is some text</span> other text</div><br /><br />
<a class="button" href='javascript:;' onclick='alert($("#jqm5_content").text())'>Get Text</a> | <a class="button" href='javascript:;' onclick='$("#jqm5_content").text("New Text")'>Set Text</a>
</div>
<!-- jqm > jqm css() -->
<div id="jqm6" class="panel" title=".css()" data-nav="menu_jqmobi">
$("#div").css() - allows you to get or set a CSS property.<br /><br />
<div style="background:red;color:white;border:1px solid black" id="jqm6_content">This is some content</div><br /><br />
<a class="button" href='javascript:;' onclick='alert($("#jqm6_content").css("background"))'>Get background color</a><br />
<a class="button" href='javascript:;' onclick='$("#jqm6_content").css("background","green")'>Set background color</a>
</div>
<!-- jqm > jqm empty() -->
<div id="jqm7" class="panel" title=".empty()" data-nav="menu_jqmobi">
$("#div").empty() - will empty out the contents of the element.<br /><br />
<div id="jqm7_content" style="border:1px solid black">This is some content</div><br/><br/>
<a class="button" href='javascript:;' onclick='$("#jqm7_content").empty()'>$().empty()</a>
</div>
<!-- jqm > jqm hide() -->
<div id="jqm8" class="panel" title=".hide()" data-nav="menu_jqmobi">
$("#div").hide() - will set the elements display property to "none".<br /><br />
<div id="jqm8_content" style="border:1px solid black">This is some content</div><br/>
<a class="button" href='javascript:;' onclick='$("#jqm8_content").hide()'>Hide the div</a>
</div>
<!-- jqm > jqm show() -->
<div id="jqm9" class="panel" title=".show()" data-nav="menu_jqmobi">
$("#div").show() - will set the elements display property to "block".<br /><br />
<div id="jqm9_content" style="border:1px solid black;display:none;">This is some content</div><br/>
<a class="button" href='javascript:;' onclick='$("#jqm9_content").show()'>Show the div</a>
</div>
<!-- jqm > jqm toggle() -->
<div id="jqm10" class="panel" title=".toggle()" data-nav="menu_jqmobi">
$("#div").toggle() - will toggle the elements display property.<br /><br />
<div id="jqm10_content" style="border:1px solid black;display:block;">This is some content</div><br/><br />
<a class="button" href='javascript:;' onclick='$("#jqm10_content").toggle()'>Toggle a div</a>
</div>
<!-- jqm > jqm val() -->
<div id="jqm11" class="panel" title=".val()" data-nav="menu_jqmobi">
$("#div").val() - will get or set the value of an HTML element.<br /><br />
<input type="text" id="jqm11_input" size=15><br /><br />
<a class="button" href='javascript:;' onclick='alert($("#jqm11_input").val())'>Get Value</a><br />
<a class="button" href='javascript:;' onclick='($("#jqm11_input").val("set value"))'>Set Value</a>
</div>
<!-- jqm > jqm attr() -->
<div id="jqm12" class="panel" title=".attr()" data-nav="menu_jqmobi">
$("#div").attr() - will get or set an attribute of an HTML element.<br /><br />
<div id="jqm12_content" data-test="foo">The data-test attribute is set to "foo" - data-test="foo"</div><br /><br />
<a class="button" href='javascript:;' onclick='alert($("#jqm12_content").attr("data-test"))'>Get Attribute Value</a><br />
<a class="button" href='javascript:;' onclick='($("#jqm12_content").attr("data-test","bar"))'>Set Attribute Value</a>
</div>
<!-- jqm > jqm removeAttr() -->
<div id="jqm13" class="panel" title=".removeAttr()" data-nav="menu_jqmobi">
$("#div").removeAttr() - will remove an attribute of an HTML element.<br /><br />
<div id="jqm13_content" data-test="foo">The data-test attribute is set to "foo" - data-test="foo"</div><br />
<a class="button" href='javascript:;' onclick='alert($("#jqm13_content").attr("data-test"))'>Get Attribute Value</a><br />
<a class="button" href='javascript:;' onclick='($("#jqm13_content").removeAttr("data-test"))'>Remove Attribute Value</a>
</div>
<!-- jqm > jqm remove() -->
<div id="jqm14" class="panel" title=".remove()" data-nav="menu_jqmobi">
$("#div").remove() - will remove an element from the parent container.<br /><br />
<div id="jqm14_content" style="border:1px solid black">This is content that will be removed from the DOM.</div><br />
<a class="button" href='javascript:;' onclick='$("#jqm14_content").remove()'>Remove the Element</a>
</div>
<!-- jqm > jqm addClass() -->
<div id="jqm15" class="panel" title=".addClass()" data-nav="menu_jqmobi">
$("#div").addClass() - adds a css class to the element.<br /><br />
<div style='border:1px solid black' id="jqm15_content">This is some content</div><br /><br />
<a class="button" href='javascript:;' onclick='($("#jqm15_content").addClass("class16"))'>Add a Class</a>
</div>
<!-- jqm > jqm removeClass() -->
<div id="jqm16" class="panel" title=".removeClass()" data-nav="menu_jqmobi">
$("#div").removeClass() - removes a css class to the element.<br /><br />
<div style='border:1px solid black' id="jqm16_content" class="class16">This is some content</div><br />
<a class="button" href='javascript:;' onclick='($("#jqm16_content").removeClass("class16"))'>Remove the Class</a>
</div>
<!-- jqm > jqm hasClass() -->
<div id="jqm17" class="panel" title=".hasClass()" data-nav="menu_jqmobi">
$("#div").hasClass() - returns a boolean if an element has a class.<br /><br />
<div style='border:1px solid black' id="jqm17_content" class="class16">This is some content</div><br />
<a class="button" href='javascript:;' onclick='alert($("#jqm17_content").hasClass("class16"))'>Check if it has the class</a>
</div>
<!-- jqm > jqm bind() -->
<div id="jqm18" class="panel" title=".bind()" data-nav="menu_jqmobi">
$("#div").bind() - binds an event to an element.<br /><br />
<a class="button" href="javascript:;" id="jqm18_content">Test Link to bind event to</a><br /><br />
<a class="button" href='javascript:;' onclick='$("#jqm18_content").bind("click",function(evt){alert("I was clicked");});alert("click event is bound");'>Bind Event</a><br />
</div>
<!-- jqm > jqm unbind() -->
<div id="jqm19" class="panel" title=".unbind()" data-nav="menu_jqmobi">
$("#div").unbind() - unbinds an event from an element.<br /><br />
<a class="button" href="javascript:;" id="jqm19_content">This is a test link</a><br /><br />
<a class="button" href='javascript:;' onclick='$("#jqm19_content").bind("click",function(){alert("I was clicked");});alert("click event is bound");'>Bind Event</a><br />
<a class="button" href="javascript:;" onclick='$("#jqm19_content").unbind("click")'>Unbind Event</a>
</div>
<!-- jqm > jqm trigger() -->
<div id="jqm20" class="panel" title=".trigger()" data-nav="menu_jqmobi">
$("#div").trigger() - triggers an event on an element.<br /><br />
<a id="jqm20_content" href="javascript:;" onclick="alert('I was clicked')">Click to test me</a><br /><br />
<a class="button" href="javascript:;" onclick='$("#jqm20_content").trigger("click")'>Trigger Event</a>
</div>
<!-- jqm > jqm append() -->
<div id="jqm21" class="panel" title=".append()" data-nav="menu_jqmobi">
$("#div").append() - appends an element or content.<br /><br />
<div id="jqm21_content">I'll append content after the <hr> <hr>
</div><br /><br />
<a class="button" href="javascript:;" onclick='$("#jqm21_content").append("<span>Some more content<br /></span>");'>Append Content</a>
</div>
<!-- jqm > jqm prepend() -->
<div id="jqm22" class="panel" title=".prepend()" data-nav="menu_jqmobi">
$("#div").prepend() - prepends an element or content.<br /><br />
<div id="jqm22_content"><hr>I'll prepend content before the <hr>
</div><br /><br />
<a class="button" href="javascript:;" onclick='$("#jqm22_content").prepend("<span>Some more content<br /></span>");'>Prepend Content</a>
</div>
<!-- jqm > jqm offset() -->
<div id="jqm31" class="panel" title=".offset()" data-nav="menu_jqmobi">
<script>
function getElementOffset(){
var data=$("#jqm31").offset();
alert("Top: "+data.top+" - Left: "+data.left);
}
</script>
$("#div").offset() - Gets the left and top offset of an element.<br /><br />
<a class="button" href="javascript:;" onclick='getElementOffset()'>Get Offsett</a>
</div>
<!-- jqm > jqm get() -->
<div id="jqm32" class="panel" title=".get()" data-nav="menu_jqmobi">
$("#div").get() - Get's an individual element by index.<br /><br />
<script>
function getElementByIndex(){
var obj=$(".panel").get(0);
alert("This is the first panel = "+obj.id);
}
</script>
<a class="button" href="javascript:;" onclick='getElementByIndex();'>Get first panel</a>
</div>
<!-- jqm > jqm jsonP() -->
<div id="jqm23" class="panel" title=".jsonP()" data-nav="menu_jqmobi">
$.jsonP(url:"URL",
success:function(){},
timeout:"1000",
error:function(){}
) - makes a jsonP call for cross domain scripting<br /><br />
<div id="jqm23_content" style="border:1px solid black;">This will get updated with content from the jsonP call</div><br /><br />
<a class="button" href="javascript:;" onclick="$.jsonP({url:'http://jsfiddle.net/echo/jsonp/?test=some+html+content&callback=?',success:function(data){$('#jqm23_content').html(data.test)}});">
Make jsonP call</a>
</div>
<!-- jqm > jqm ajax() -->
<div id="jqm24" class="panel" title=".ajax()" data-nav="menu_jqmobi">
$.ajax(url:"URL",
success:function(){},
timeout:"1000",
error:function(){}
) - makes an Ajax call<br /><br />
<script type="text/javascript">
function doAjax(){
$.ajax({url:webRoot+'ajax.html',success:function(data){$('#jqm24_content').html(data)}});
}
</script>
<div id="jqm24_content" style="border:1px solid black;">This will get updated with content from the ajax call</div><br /><br />
<a class="button" href="javascript:;" onclick="doAjax()">
Make Ajax Call</a>
</div>
<!-- jqm > jqm get() -->
<div id="jqm25" class="panel" title=".get()" data-nav="menu_jqmobi">
$.get(url:"URL",
success:function(){},
timeout:"1000",
error:function(){}
) - makes an Ajax call<br /><br />
<script type="text/javascript">
function doGet(){
$.get(webRoot+'ajax.html',function(data){$('#jqm25_content').html(data)});
}
</script>
<div id="jqm25_content" style="border:1px solid black;">This will get updated with content from the ajax call</div><br /><br />
<a class="button" href="javascript:;" onclick="doGet()">
Make Get Call</a>
</div>
<!-- jqm > jqm post() -->
<div id="jqm26" class="panel" title=".post()" data-nav="menu_jqmobi">
$.post(url,data:{foo:"bar"},
success:function(){},
timeout:"1000",error:
function(){}
) - makes an Ajax call<br /><br />
<script type="text/javascript">
function doPost(){
$.post(webRoot+'ajax.html',{foo:"bar"},function(data){$('#jqm26_content').html(data)});
}
</script>
<div id="jqm26_content" style="border:1px solid black;">This will get updated with content from the ajax call</div><br /><br />
<a class="button" href="javascript:;" onclick="doPost()">
Make Post Call</a>
</div>
<!-- jqm > jqm getJSON() -->
<div id="jqm27" class="panel" title=".getJSON()" data-nav="menu_jqmobi">
$.getJSON(url,data,success); - Makes a XMLHttpRequest GET request and returns a JSON object.<br /><br />
<script>
function doJSON(){
$.getJSON(webRoot+'json.html',function(data){$('#jqm27_content').html(JSON.stringify(data))});
}
</script>
<div style="border:1px solid black" id="jqm27_content">Returned object</div><br />
<a class="button" href="javascript:;" onclick="doJSON()">Make GetJson Call</a>
</div>
<!-- jqm > jqm serialize() -->
<div id="jqm28" class="panel" title=".param()">
$.param() - serializes an object into key/value pairs for a querystring.<br /><br />
<code>
var obj= {foo:"foo",bar:"bar"};
</code><br /><br />
<script>
function doSerialize(){
var obj= {foo:"foo",bar:"bar"};
$("#jqm28_content").html($.param(obj));
}
</script>
<div id="jqm28_content" style="border:1px solid black">Serialized parameters will show here.</div><br /><br />
<a class="button" href='javascript:;' onclick="doSerialize()">Make param Call</a>
</div>
<!-- jqm > jqm parseJSON() -->
<div id="jqm29" class="panel" title=".parseJSON()" data-nav="menu_jqmobi">
$.parseJSON() - parses a string and converts it into a JSON object. Uses the native JSON parser, but is added for backwards compatibility.<br><br>
<code>
var obj='{"foo":"bar"}';
</code>
<script>
function doParseJson(){
var obj='{"foo":"bar"}';
alert($.parseJSON(obj));
}
</script>
<br>
<a class="button" href='javascript:;' onclick="doParseJson()">Parse JSON string</a>
</div>
<!-- jqm > os -->
<div id="jqm30" class="panel" title=".os" data-nav="menu_jqmobi">
$.os - holds information about the OS of the device, and if it is a webkit browser<br><br>
<pre style="padding-left:15px">
$.os.webkit = <script>document.write($.os.webkit);</script>
$.os.android = <script>document.write($.os.android);</script>
$.os.ipad = <script>document.write($.os.ipad);</script>
$.os.iphone = <script>document.write($.os.iphone);</script>
$.os.ios = <script>document.write($.os.ios);</script>
$.os.webos = <script>document.write($.os.webos);</script>
$.os.touchpad = <script>document.write($.os.touchpad);</script>
$.os.blackberry = <script>document.write($.os.blackberry);</script>
$.os.opera = <script>document.write($.os.opera);</script>
$.os.fennec = <script>document.write($.os.fennec);</script>
</pre>
</div>
<!-- jqm > isArray -->
<div id="jqm33" class="panel" title=".isArray()" data-nav="menu_jqmobi">
$.isArray(param) - returns a boolean if the parameter is an array.<br><br>
<pre>
var notArrayTest="foo";
var isArrayTest=[];
</pre>
<script>
var notArrayTest="foo";
var isArrayTest=[];
function isNotAnArray(){
alert($.isArray(notArrayTest));
}
function isAnArray(){
alert($.isArray(isArrayTest));
}
</script>
<br>
<a class="button" href="javascript:;" onclick="isNotAnArray()">test notArrayTest</a><br>
<a class="button" href="javascript:;" onclick="isAnArray()">test isArrayTest</a><br>
</div>
<!-- jqm > isFunction -->
<div id="jqm34" class="panel" title=".isFunction()" data-nav="menu_jqmobi">
$.isFunction(param) - returns a boolean if the parameter is a function.<br><br>
<pre>
var notFunctionTest="foo";
var isFunctionTest=function(){};
</pre>
<script>
var notFunctionTest="foo";
var isFunctionTest=[];
function notAFunction(){
alert($.isArray(notFunctionTest));
}
function isAFunction(){
alert($.isArray(isFunctionTest));
}
</script>
<br>
<a class="button" href="javascript:;" onclick="notAFunction()">test notFunctionTest</a><br>
<a class="button" href="javascript:;" onclick="isAFunction()">test isFunctionTest</a><br>
</div>
<div id="jqmparent" class="panel" title=".parent()" data-nav="menu_jqmobi">
This returns the parent elements for the previously found elements in the container
<pre>
$("#jqmparent").parent();
</pre>
The parent id for this div is "content". Let's verify it.<br>
<a href="javascript:;" onclick="alert($('#jqmparent').parent().get().id);" class="button">Get Parent ID</a>
</div>
<!-- ------------------------------------------ -->
<!-- ------------------------------------------ -->
<!-- jqUi -->
<div title="jqUi" id="jqmui" class="panel" data-footer='footerui' data-tab="navbar_ui">
<h2 class='expanded' onclick='showHide(this,"jqui_info");'>jqUi</h2><p id='jqui_info'>
jqUi is AppMobi's User Interface/User Experience library for mobile applications. It uses HTML5 and CSS3 for animations and transitions.
We built the kitchen sink using jqUi. It is comprised of components from the jqPlugins library and additional features.
<br>
* Fixed navigation bar<br>
* Auto scrolling content panels<br>
* Optional footer to segment your application<br>
</p>
<ul >
<li><a href="#jqmtransitions" >Transitions</a></li>
<li><a href="#jqmforms" >Form Styles</a></li>
<li><a href="#uiapi" >$.ui API</a></li>
<li><a href="#uifooter">Custom Footers</a></li>
<li><a href="#uiside">Side Navigation Menu</a></li>
<li><a href="#uiicons">SVG Icons</a></li>
<li><a href="kitchensink/external.html" data-persist-ajax="true" data-refresh-ajax="true" data-pull-scroller="true">Load External Content</a></li>
<li><a href="http://www.jqmobi.com" target="_blank" >Open a new page</a></li>
<li><a href="#uidefer">Defer loading</a></li>
</ul>
</div>
<div id="uiicons" title="SVG Icons" class="panel">
<h2 class='expanded' onclick='showHide(this,"icons_info");'>SVG Icons</h2><p id='icons_info'>jqUi provides SVG icons to use throughout your app. Simply add the icon class, along with the image class name and additional sizes you want.
<br>
.mini - 20 pixels high<br>
.big - 40 pixels high<br>
The default is 28 pixels.<br>
</p>
<ul>
<li ><a href="#" class="icon home">Home</a></li>
<li><a href="#" class="icon home mini">Home Mini</a></li>
<li ><a href="#" class="icon pencil big">Pencil</a></li>
<li ><a href="#" class="icon picture big">Picture</a></li>
<li ><a href="#" class="icon camera big">Camera</a></li>
<li ><a href="#" class="icon headset big">Headset</a></li>
<li ><a href="#" class="icon paper big">Paper</a></li>
<li ><a href="#" class="icon stack big">Stack</a></li>
<li ><a href="#" class="icon folder big">Folder</a></li>
<li ><a href="#" class="icon tag big">Tag</a></li>
<li ><a href="#" class="icon basket big">Basket</a></li>
<li ><a href="#" class="icon phone big">Phone</a></li>
<li ><a href="#" class="icon mail big">Mail</a></li>
<li ><a href="#" class="icon location big">Location</a></li>
<li ><a href="#" class="icon clock big">Clock</a></li>
<li ><a href="#" class="icon calendar big">Calendar</a></li>
<li ><a href="#" class="icon message big">Message</a></li>
<li ><a href="#" class="icon chat big">Chat</a></li>
<li ><a href="#" class="icon user big">User</a></li>
<li ><a href="#" class="icon loading big">Loading</a></li>
<li ><a href="#" class="icon refresh big">Refresh</a></li>
<li ><a href="#" class="icon magnifier big">Magnifier</a></li>
<li ><a href="#" class="icon key big">Key</a></li>
<li ><a href="#" class="icon settings big">Settings</a></li>
<li ><a href="#" class="icon graph big">Graph</a></li>
<li ><a href="#" class="icon trash big">Trash</a></li>
<li ><a href="#" class="icon pin big">Pin</a></li>
<li ><a href="#" class="icon target big">Target</a></li>
<li ><a href="#" class="icon download big">Download</a></li>
<li ><a href="#" class="icon upload big">Upload</a></li>
<li ><a href="#" class="icon star big">Star</a></li>
<li ><a href="#" class="icon heart big">Heart</a></li>
<li ><a href="#" class="icon warning big">Warning</a></li>
<li ><a href="#" class="icon add big">Add</a></li>
<li ><a href="#" class="icon remove big">Remove</a></li>
<li ><a href="#" class="icon question big">Question</a></li>
<li ><a href="#" class="icon info big">Info</a></li>
<li ><a href="#" class="icon error big">Error</a></li>
<li ><a href="#" class="icon check big">Check</a></li>
<li ><a href="#" class="icon minimize big">Minimize</a></li>
<li ><a href="#" class="icon close big">Close</a></li>
<li ><a href="#" class="icon up big">Up</a></li>
<li ><a href="#" class="icon down big">Down</a></li>
<li ><a href="#" class="icon left big">Left</a></li>
<li ><a href="#" class="icon right big">Right</a></li>
<li ><a href="#" class="icon tools big">Tools</a></li>
<li ><a href="#" class="icon html5 big">HTML5</a></li>
<li ><a href="#" class="icon css big">CSS</a></li>
<li><a href="#" class="icon js big">JS</a></li>
<li ><a href="#" class="icon cloud big">Cloud</a></li>
<li ><a href="#" class="icon tv big">TV</a></li>
<li ><a href="#" class="icon wifi big">Wifi</a></li>
<li ><a href="#" class="icon new big">New</a></li>
<li><a href="#" class="icon mic big">Mic</a></li>
<li ><a href="#" class="icon database big">Database</a></li>
<li ><a href="#" class="icon busy big">Busy</a></li>
<li ><a href="#" class="icon bug big">Bug</a></li>
<li ><a href="#" class="icon lamp big">Lamp</a></li>
</ul>
</div>
<div id="uidefer" title="Defer Loading" class="panel" data-defer="defer/index.html">
Deferred loading requires a web browser for Ajax to work. What we do is load the html after $.ui.ready is called, so you can speed up the initial loading time of your app.
</div>
<div id="uiside" title="Side Menu Navigation" class="panel" data-footer="footerui">
<b>Side Menu Navigation</b><br>
If you are on a tablet, you'll already see the side menu. If you are on a phone, click the "Powered by jqMobi" button to expand it.<br><Br>
Side menu's are created using the <nav> tags. You can set the id and then refer to them on each panel by setting the data-menu='id' property. The side menu's
will only show if you have <nav> defined.
</div>
<div id="uifooter" title="Custom Footers" class="panel" data-footer='footerui'>
<p>You should notice that the footer is no longer the default. It is specific to jqUi, with options for Transitions, UI and API</p>
You can create custom footers using the <footer> tag. You then set the id on each panel to change them using the data-footer='id' property.
</div>
<div id="jqmforms" title="Form Styles" class="panel" data-footer='footerui'>
<form>
<fieldset>
<legend>Field elements</legend>
<label for="name">Full Name</label>
<br/>
<input type="text" id="name" class='jq-ui-forms' />
<br/>
<label for="email">E-mail</label>
<br/>
<input type="text" id="email" class='jq-ui-forms' />
<br/>
<label for="password">Password</label>
<br/> <span><input type="password" id="password" class='jq-ui-forms' /></span>
<br/>
<!-- span is needed for android password fix -->
<label for="country">Country</label>
<br/> <span><!-- span is needed for android select box fix -->
<select id="country" class='jq-ui-forms'>
<option value='1'>USA 1</option>
<option value='2'>USA 2</option>
<option value='3'>USA 3</option>
<option value='4'>USA 4</option>
<option value='5'>USA 5</option>
<option value='6'>USA 6</option>
<option value='7'>USA 7</option>
<option value='8'>USA 8</option>
<option value='9'>USA 9</option>
<option value='10'>USA 10</option>
</select>
</span>
<br/>
<br/>
<label for="web">Comments</label>
<textarea name="web" class='jq-ui-forms'></textarea>
<br/>
</fieldset>
<fieldset>
<legend>Radios and checkboxes</legend>
<h4>Gender:</h4>
<br>
<p>
<input type="radio" value="male" id="male" name="gender" class="jq-ui-forms"
/>
<label for="male">Male</label>
</p>
<p>
<input type="radio" value="Female" id="female" name="gender" class="jq-ui-forms"
/>
<label for="female">Female</label>
</p>
<h4>Stuff you like:</h4>
<br>
<p>
<input type="checkbox" value="CSS3" id="css3" class="jq-ui-forms" />
<label for="css3">CSS3</label>
</p>
<p>
<input type="checkbox" value="HTML5" id="html5" class="jq-ui-forms" />
<label for="html5">HTML5</label>
</p>
<p>
<input type="checkbox" value="JavaScript" id="javascript" class="jq-ui-forms"
/>
<label for="javascript">JavaScript</label>
</p>
<p>
<input type="checkbox" value="Other" id="other" class="jq-ui-forms" />
<label for="other">Other</label>
</p>
</fieldset>
<fieldset>
<legend>Disabled and pre-selected</legend>
<h4>Disabling and checking radio inputs:</h4>
<br>
<p>
<input type="radio" value="disabled" id="disabled" name="disabled" disabled
class="jq-ui-forms" />
<label for="disabled">This is disabled</label>
</p>
<p>
<input type="radio" value="check" id="check" name="check" checked class="jq-ui-forms"
/>
<label for="check">This is checked</label>
</p>
<h4>Disabling and checking checkbox inputs:</h4>
<br>
<p>
<input type="checkbox" value="disabled" id="disabled2" disabled class="jq-ui-forms"
/>
<label for="disabled2">This is disabled</label>
</p>
<p>
<input type="checkbox" value="check" id="check2" checked class="jq-ui-forms"
/>
<label for="check2">This is checked</label>
</p>
<p>
<input type="checkbox" value="Stop" id="disablecheck" disabled checked
class="jq-ui-forms" />
<label for="disablecheck">This is checked and disabled</label>
</p>
<p>
<input type="checkbox" value="Other" id="other2" class="jq-ui-forms" />
<label for="other2">Other</label>
</p>
</fieldset>
<fieldset>
<legend>Sliders</legend>
<h4>Gender:</h4>
<p>
<input type="radio" value="maleslider" id="slidermale" name="gender" class="jq-ui-slider"
/>
<label for="slidermale">Male</label>
</p>
<p>
<input type="radio" value="femaleslider" id="sliderfemale" name="gender"
class="jq-ui-slider" />
<label for="sliderfemale">Female</label>
</p>
<h4>Stuff you like:</h4>
<p>
<input type="checkbox" value="CSS3" id="css3slider" class="jq-ui-slider"
/>
<label for="css3slider">CSS3</label>
</p>
<p>
<input type="checkbox" value="HTML5" id="html5slider" class="jq-ui-slider"
/>
<label for="html5slider">HTML5</label>
</p>
<p>
<input type="checkbox" value="JavaScript" id="javascriptslider" class="jq-ui-slider"
/>
<label for="javascriptslider">JavaScript</label>
</p>
<p>
<input type="checkbox" value="Other" id="otherslider" class="jq-ui-slider"
/>
<label for="otherslider">Other</label>
</p>
<p>
<input type="checkbox" value="Other" id="otherd" class="jq-ui-slider"
disabled />
<label for="otherd">Disabled</label>
</p>
<p>
<input type="checkbox" value="Other" id="otherdc" class="jq-ui-slider"
disabled checked />
<label for="otherdc">Disabled</label>
</p>
</fieldset>
<fieldset>
<legend>HTML5 input</legend>
<label for="date">Date</label>
<br/>
<input type="date" id="date" class='jq-ui-forms' />
<br/>
<label for="month">Month</label>
<br/>
<input type="month" id="month" class='jq-ui-forms' />
<br/>
<label for="datetime">Date/Time</label>
<br/>
<input type="datetime" id="datetime" class='jq-ui-forms' />
<br/>
<label for="datetime-local">Date/Time Local</label>
<br/>
<input type="datetime-local" id="datetime-local" class='jq-ui-forms' />
<br/>
<label for="time">Time</label>
<br/>
<input type="time" id="time" class='jq-ui-forms' />
<br/>
<label for="range">Range</label>
<br/>
<input type="range" id="range" class='jq-ui-forms' />
<br/>
</form>
<br>
<br>
<br>
</div>
<div title="Transitions" id="jqmtransitions" class="panel" data-footer='footerui'>
<h2 class='expanded' onclick='showHide(this,"jqui_transitions");'>jqUi</h2><p id='jqui_transitions'>
<strong>jq.ui transitions</strong> the following are transitions built in. You can easily add/extend with your own. Set the data-transition attribute on an anchor to change the transition.</p>
<ul>
<li><a href="#transition1" data-transition="slide">Slide</a></li>
<li><a href="#transition2" data-transition="up">Slide Up</a></li>
<li><a href="#transition3" data-transition="down">Slide Down</a></li>
<li><a href="#transition4" data-transition="pop">Pop</a></li>
<li><a href="#transition5" data-transition="flip">Flip</a></li>
<li><a href="#transition6" data-transition="fade">Fade</a></li>
<li><a href="#transition7" >Modal</a></li>
</ul>
<br/><br/>
</div>
<div id="uiapi" title="jqUi API" class="panel" data-pull-scroller='true' data-footer='footerui'>
<ul>
<li><a href="#uigoback">.goBack()</a></li>
<li><a href="#uiclearhistory">.clearHistory()</a></li>
<li><a href="#uiaddcontentdiv">.addContentDiv()</a></li>
<li><a href="#uisettitle">.setTitle(text) </a></li>
<li><a href="#uisetbackbutton">.setBackButtonText() </a></li>
<li><a href="#uishowmask">.showMask() </a></li>
<li><a href="#uihidemask">.hideMask() </a></li>
<li><a href="#uiloadcontent">.loadContent(); </a></li>
<li><a href="#uilaunch">.launch(); </a></li>
<li><a href="#uiready">.ready(); </a></li>
<li><a href="#uibadge">.updateBadge(); </a></li>
<li><a href="#uiremovebadge">.removeBadge(); </a></li>
<li><a href="#uitoggleheader">.toggleHeaderMenu(); </a></li>
<li><a href="#uitoggleside">.toggleSideMenu(); </a></li>
<li><a href="#uitogglenav">.toggleNavMenu(); </a></li>
<li><a href="#uiactionsheet">.actionsheet() </a></li>
<li><a href="#uiscrolltotop">.scrollToTop() </a></li>
<li><a href="#uiscrolltobottom">.scrollToBottom() </a></li>
</ul>
</div>
<div id="uibadge" title="updateBadge" class="panel" data-footer='footerui'>
Updates a badge with the given value or creates one.<br>
Position can be
<pre>
bl - bottom left
tl - top left
br - bottom right
tr - top right (default)
</pre>
<ul>
<li id='libadge'><a href="javascript:;">Badge</a></li>
</ul>
<pre>
$.ui.updateBadge("#libadge","Badge Created","bl");
</pre>
<a href="javascript:;" onclick="$.ui.updateBadge('#libadge','Badge Created','tl');" class="button">Create Badge</a>
<br>
</div>
<div id="uiremovebadge" title="removeBadge" class="panel" data-footer='footerui'>
Removes a badge.
<ul>
<li id='libadge2'><a href="javascript:;">Badge</a></li>
</ul>
<pre>
$.ui.removeBadge("#target");