-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1994 lines (1917 loc) · 74.6 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>
<html>
<head>
<meta charset="utf-8" />
<!-- Sets initial viewport load and disables zooming -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1, height=device-height, width=device-width">
<title>AGScore.se</title>
<!-- Makes your prototype chrome-less once bookmarked to your phone's home screen -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="icon" href="images/favicon.ico">
<link rel="stylesheet" type="text/css" href="vendor/font-awesome/css/font-awesome.css" />
<link rel="stylesheet" type="text/css" href="vendor/open-sans/open-sans.css" />
<link rel="stylesheet" type="text/css" href="vendor/bootstrap/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="vendor/mobility/mobility.css" />
<link rel="stylesheet" type="text/css" href="vendor/dynatable/jquery.dynatable.css" />
<link rel="stylesheet" type="text/css" href="vendor/stacktable/stacktable.css" />
<link rel="stylesheet" href="vendor/easy-autocomplete/easy-autocomplete.min.css" />
<link rel="stylesheet" href="vendor/editablegrid/editablegrid.css" />
<link rel="stylesheet" type="text/css" href="vendor/agscore/agscore.css" />
<!--<script type="text/javascript" src="cordova.js"></script>-->
<script type="text/javascript" src="vendor/jquery/jquery-1.12.3.min.js"></script>
<script type="text/javascript" src="vendor/classified/classified.js"></script>
<script type="text/javascript" src="vendor/doon/doon.js"></script>
<script type="text/javascript" src="vendor/time/time.js"></script>
<script type="text/javascript" src="vendor/mobility/mobility.js"></script>
<script type="text/javascript" src="vendor/acquire/acquire.js"></script>
<script type="text/javascript" src="vendor/handlebars/handlebars.js"></script>
<script type="text/javascript" src="vendor/chops/chops.js"></script>
<script type="text/javascript" src="vendor/cropper/cropper.js"></script>
<script type="text/javascript" src="vendor/password/password.js"></script>
<script type="text/javascript" src="vendor/dynatable/jquery.dynatable.js"></script>
<script src="vendor/stacktable/stacktable.js" type="text/javascript"></script>
<script src="vendor/easy-autocomplete/jquery.easy-autocomplete.js"></script>
<script src="vendor/editablegrid/editablegrid.js"></script>
<!-- [DO NOT DEPLOY] --> <script src="vendor/editablegrid/editablegrid_renderers.js" ></script>
<!-- [DO NOT DEPLOY] --> <script src="vendor/editablegrid/editablegrid_editors.js" ></script>
<!-- [DO NOT DEPLOY] --> <script src="vendor/editablegrid/editablegrid_validators.js" ></script>
<!-- [DO NOT DEPLOY] --> <script src="vendor/editablegrid/editablegrid_utils.js" ></script>
<!-- [DO NOT DEPLOY] --> <script src="vendor/editablegrid/editablegrid_charts.js" ></script>
<script src="vendor/htmlhttpauth/httpauth.js"></script>
<script src="vendor/agscore/agscore.js"></script>
</head>
<body>
<footer class="foot">
<a class="foot-nav-item" data-do="go-back" data-on="click" href="#home">
<i class="foot-nav-icon fa fa-home"></i>
<span class="foot-nav-label">Home</span>
</a>
<a class="foot-nav-item" data-do="modal-open" data-on="click" href="#menu">
<div id=footid><i class="foot-nav-icon fa fa-bars"></i></div>
</a>
<a id="user" class="foot-nav-item" href="#profile">
<i class="foot-nav-icon fa fa-user fa"></i>
<span class="foot-nav-label">Log in</span>
</a>
<!--
<a class="foot-nav-item" data-do="modal-open" data-on="click" href="#profile">
<i class="foot-nav-icon fa fa-user"></i>
<span id="user" class="foot-nav-label">User</span>
</a>
-->
<!-- <a class="foot-nav-item" data-do="modal-open" data-on="click" href="#modal">
<i class="foot-nav-icon fa fa-cog"></i>
<span class="foot-nav-label">Settings</span>
</a>
-->
</nav>
</footer>
<div id="upload" class="modal hide">
<header class="head">
<a class="head-link pull-right" href="#upload" data-do="modal-close" data-on="click">
<i class="fa fa-times"></i>
</a>
<h1 id=upload_title class="title">Upload</h1>
</header>
<section class="body with-head">
<div class="upload">
<div class="focus">
<div id="upload_text">Upload</div>
</div>
<div class="focus focus-group upload_input">
<input id="upload_input" type="file" class="form-control" onchange="uploadFile('gymnast','new')"><br>
</div>
<div class="focus focus-group">
<div class="profile-userpic">
<img id="upload_preview" src="images/blank.gif" alt="">
</div>
<a class="modal_down" href="javascript:void(0)" onclick="$.mobility.modalClose('#upload');"><i class="fa fa-arrow-down fa-2x"></i></a>
</div>
</div>
</section>
<script>
$('.profile-userpic').click(function () {
$("input[id='upload_input']").click();
});
</script>
</div>
<div id="gymnastinfo" class="modal-sm modal hide">
<header class="head">
<a class="head-link pull-right" href="#gymnastinfo" data-do="modal-close" data-on="click">
<i class="fa fa-times"></i>
</a>
<h1 id="gymnasttitle" class="title">None</h1>
</header>
<section class="body with-head">
<div id="gymnastabout"></div>
<a class="modal_down" href="javascript:void(0)" onclick="$.mobility.modalClose('#gymnastinfo');"><i class="fa fa-arrow-down fa-2x"></i></a>
</section>
</div>
<div id="profile" class="modal hide">
<header class="head">
<a class="head-link pull-right" href="#profile" data-do="modal-close" data-on="click">
<i class="fa fa-times"></i>
</a>
<h1 class="title">User</h1>
</header>
<section class="body with-head">
<div class="row pad">
<div class="col-md-1 middle">
<i class="fa fa-user fa-5x"></i>
</div>
<div class="login">
<div class="col-md-11">
<a class="httpauth" id="basic" href="/es/authtest/last">Log in with Basic Auth</a>
</div>
</div>
<a class="modal_down" href="javascript:void(0)" onclick="$.mobility.modalClose('#profile');"><i class="fa fa-arrow-down fa-2x"></i></a>
</div>
</section>
</div>
<div id="popover"
class="popover hide"
data-do="popover-close"
data-on="click"
data-target="#popover">
<nav class="nav-list">
<a data-do="go-forward" data-on="click" href="#typography">Typography</a>
<a data-do="go-forward" data-on="click" href="#tabs">Tabs</a>
<a data-do="go-forward" data-on="click" href="#fields">Fields</a>
<a data-do="go-forward" data-on="click" href="#list">List</a>
<a data-do="go-forward" data-on="click" href="#refresh">Refresh <i class="fa fa-chevron-right"></i></a>
</nav>
</div>
<aside id="aside-startlist" class="aside aside-right">
<a class="btn btn-default pull-left" data-do="aside" data-on="click" href="#aside-startlist"><i class="fa fa-chevron-right"></i></a>
<h2 class="pad">Start List functions</h2>
<h4 class="pad upper">With checked:</h4>
<div class="focus">
<a class="btn btn-default" id="uncheck" data-role="uncheck" href="#">Uncheck all</a>
</div>
<div class="focus">
<a class="btn btn-default" id="check" data-role="check" href="#">Check all</a>
</div>
<div class="focus">
<a class="btn btn-default" id="recheck" data-role="recheck" href="#">Reverse all</a>
</div>
<div class="focus">
<label>to pool:</label>
<input
type="text"
id="startList_table-pool"
class="form-control"
placeholder="Pool..." />
<a class="btn btn-default" id="pool" data-role="pool" href="#">OK</a>
</div>
<div class="focus">
<label>to rule:</label>
<input
type="text"
id="startList_table-rules"
class="form-control"
placeholder="Rule..." />
<a class="btn btn-default" id="rules" data-role="rules" href="#">OK</a>
</div>
<div class="focus">
<label>to class:</label>
<input
type="text"
id="startList_table-class"
class="form-control"
placeholder="Class..." />
<a class="btn btn-default" id="class" data-role="class" href="#">OK</a>
</div>
<div class="focus">
<a class="btn btn-default" id="delete" data-role="delete" href="#">Delete</a>
</div>
</aside>
<div id="menu" class="modal hide">
<header class="head">
<a class="head-link pull-right" href="#menu" data-do="modal-close" data-on="click">
<i class="fa fa-times"></i>
</a>
<h1 class="title">Menu</h1>
</header>
<section class="body with-head">
<h4 id="menucompetition" class="pad upper">Menu</h4>
<div class="row pad">
<div class="focus">
<p id="menudescription"></p>
</div>
<nav class="nav-list">
<a data-do="go-forward" data-on="click" onclick="$.mobility.modalClose('#menu');" href="#results">Results<i class="fa fa-chevron-right"></i></a>
<a data-do="go-forward" data-on="click" onclick="$.mobility.modalClose('#menu');" href="#register">Register points<i class="fa fa-chevron-right"></i></a>
<a data-do="go-forward" data-on="click" onclick="$.mobility.modalClose('#menu');" href="#administration">Administration<i class="fa fa-chevron-right"></i></a>
<a data-do="go-forward" data-on="click" onclick="$.mobility.modalClose('#menu');" href="#pools">Start list<i class="fa fa-chevron-right"></i></a>
</nav>
<a class="modal_down" href="javascript:void(0)" onclick="$.mobility.modalClose('#menu')"><i class="fa fa-arrow-down fa-2x"></i></a>
</div>
</section>
</div>
<script id="results" type="text/html">
<header class="head">
<!-- <a class="head-btn btn btn-default pull-left" data-do="aside" data-on="click" href="#aside-left"><i class="fa fa-bars"></i></a> -->
<a class="head-btn btn btn-default pull-left" data-do="go-back" data-on="click" href="#home"><i class="fa fa-arrow-left"></i></a>
<h1 class="title">Results</h1>
</header>
<section class="body with-head with-foot">
<h4 class="pad upper">Results</h4>
<nav class="nav-list">
<div class="nav-results"></div>
</nav>
<h4 class="pad upper">Start list</h4>
<nav class="nav-list">
<a data-do="go-forward" data-on="click" href="#pools">Start list<i class="fa fa-chevron-right"></i></a>
</nav>
</section>
<script>
var divnavresults = "";
for (var n = 0; n < apps.length; n++) {
divnavresults = divnavresults + '<a data-do="go-forward" data-on="click" href="#' + apps[n] + '">' + appname[apps[n]] + '<i class="fa fa-chevron-right"></i></a>';
}
divnavresults = divnavresults + '<a data-do="go-forward" data-on="click" href="#allaround' + agtype + '">' + appname[agtype] + '<i class="fa fa-chevron-right"></i></a>';
divnavresults = divnavresults + '<a data-do="go-forward" data-on="click" href="#allaroundteam">Team competition<i class="fa fa-chevron-right"></i></a>';
$( "div.nav-results" ).replaceWith(divnavresults);
loadcurrrules();
loadcurrclasses();
</script>
</script>
<script id="pools" type="text/html">
<header class="head">
<!-- <a class="head-btn btn btn-default pull-left" data-do="aside" data-on="click" href="#aside-left"><i class="fa fa-bars"></i></a> -->
<a class="head-btn btn btn-default pull-left" data-do="go-back" data-on="click" href="#results"><i class="fa fa-arrow-left"></i></a>
<h1 class="title">Start list</h1>
</header>
<section class="body with-head with-foot">
<h4 class="pad upper">Start list</h4>
<div class="div-pools"></div>
</section>
<script>
var currpools = new Array();
$.ajax({
'async': false,
url: "/es/" + competition + "/startList/_search?size=1000&sort=pool",
success: function(s){
for (var i = 0; i < s.hits.hits.length; i++) {
currpools.push(s.hits.hits[i]._source.pool);
}
}
});
// currpools.sort();
var lastpool="";
var divpools="";
var localapps = new Array();
for (var o = 0; o < apps.length; o++) {
localapps[o] = apps[o];
}
for (var n = 0; n < currpools.length; n++) {
if (currpools[n] != lastpool) {
localorder = "";
for (var o = 0; o < localapps.length; o++) {
if (localorder == "") {
localorder=appname[localapps[o]];
} else {
localorder=localorder + ' <i class="fa fa-long-arrow-right" aria-hidden="true"></i> ' + appname[localapps[o]];
}
}
localapps.push(localapps.shift());
divpools=divpools + '<h2 class="pad upper">Pool ' + currpools[n] + '</h2><H4>' + localorder + '</H4><table id="pools_table' + currpools[n] + '" class="startList_all_table table table-condensed"><thead><th>Number</th><th>Gymnast</th><th>Team</th><th>Born</th><th>Class</th><th>About</th></thead> <tbody></tbody></table>';
}
lastpool=currpools[n];
}
$( "div.div-pools" ).replaceWith('<div class="div-pools">' + divpools + '</div>');
var lastpool="";
for (var n = 0; n < currpools.length; n++) {
if (currpools[n] != lastpool) {
drawgymtable("/es/" + competition + "/startList/_search?size=100&q=pool:"+currpools[n],"pools_table"+currpools[n],"pools");
}
lastpool=currpools[n];
}
</script>
</script>
<script id="register" type="text/html">
<header class="head">
<!-- <a class="head-btn btn btn-default pull-left" data-do="aside" data-on="click" href="#aside-left"><i class="fa fa-bars"></i></a> -->
<a class="head-btn btn btn-default pull-left" data-do="go-back" data-on="click" href="#home"><i class="fa fa-arrow-left"></i></a>
<h1 class="title">Register points</h1>
</header>
<section class="body with-head with-foot">
<h4 class="pad upper">Register Points</h4>
<nav class="nav-list">
<div class="nav-register"></div>
</nav>
</section>
<script>
var divnavregister = "";
if (username != "User" ) {
for (var n = 0; n < apps.length; n++) {
divnavregister = divnavregister + '<a data-do="go-forward" data-on="click" href="#REG' + apps[n] + '">' + appname[apps[n]] + '<i class="fa fa-chevron-right"></i></a>';
}
$( "div.nav-register" ).replaceWith(divnavregister);
} else {
$( "div.nav-register" ).replaceWith('<div class="focus"><p>Please log in!</p></div>');
}
loadcurrrules();
loadcurrclasses();
</script>
</script>
<script id="scoreboards" type="text/html">
<header class="head">
<a class="head-btn btn btn-default pull-left" data-do="go-back" data-on="click" href="#home"><i class="fa fa-arrow-left"></i></a>
<h1 class="title">Scoreboards</h1>
</header>
<section class="body with-head with-foot">
<h4 class="pad">Scoreboards for projector e.g. Press F11 </h4>
<nav class="nav-list">
<div class="nav-scoreboard"></div>
</nav>
</section>
<script>
var divscoreboard = "";
for (var n = 0; n < apps.length; n++) {
divscoreboard = divscoreboard + '<a href="scoreboard.html?app=' + apps[n] + '">' + appname[apps[n]] + '<i class="fa fa-external-link"></i></a>';
}
divscoreboard = divscoreboard + '<a href="scoreboard.html?app=all">All apparatus<i class="fa fa-external-link"></i></a>';
divscoreboard = divscoreboard + '<a href="scoreboard.html?app=' + agtype + '">' + appname[agtype] + '<i class="fa fa-external-link"></i></a>';
divscoreboard = divscoreboard + '<a href="scoreboard.html">' + appname[agtype] + ' plus all apparatus<i class="fa fa-external-link"></i></a>';
$( "div.nav-scoreboard" ).replaceWith(divscoreboard);
</script>
</script>
<script id="home" type="text/html">
<header class="head">
<!-- <a class="head-btn btn btn-default pull-left" data-do="aside" data-on="click" href="#aside-left"><i class="fa fa-bars"></i></a>-->
<h1 class="title">AGScore.se
</h1>
</header>
<section class="body with-head with-foot">
<h4 class="pad upper">AGscore.se</h4>
<div class="focus">
<label class="top">Select<br>competition</label>
<select id="select-competition" class="form-control">
<option>None</option>
</select>
</div>
<nav class="nav-list">
<a data-do="go-forward" data-on="click" href="#results">Results<i class="fa fa-chevron-right"></i></a>
<a data-do="go-forward" data-on="click" href="#register">Register points<i class="fa fa-chevron-right"></i></a>
<a data-do="go-forward" data-on="click" href="#scoreboards">Scoreboards<i class="fa fa-chevron-right"></i></a>
<a data-do="go-forward" data-on="click" href="#administration">Administration<i class="fa fa-chevron-right"></i></a>
</nav>
<div class="focus">
<p id="pdescription"></p>
</div>
</section>
<script>
setTimeout(function() {
initcompetition();
},500);
</script>
</script>
<script id="teams" type="text/html">
<header class="head">
<a class="head-btn btn btn-default pull-left" data-do="go-back" data-on="click" href="#administration"><i class="fa fa-arrow-left"></i></a>
<h1 class="title">Teams</h1>
</header>
<section class="body with-head with-foot">
<div class="focus">
<div id="divteams"></div>
</div>
<script>
var divteams = "";
var currteams=loadteams();
var option='<option value="default">Grey</option><option value="blue">Blue</option><option value="green">Green</option><option value="orange">Orange</option><option value="pink">Pink</option><option value="purple">Purple</option><option value="red">Red</option><option value="bluered">Blue & red</option>'
var select="";
divteams=divteams+'<table class="table table-condensed"><thead><tr><th>Team</th><th>Color</th><th></th></tr></thead><tbody>';
for (var n = 0; n < currteams.length; n++) {
select='<select onchange="javascript:updatecss(\'' + camelize(currteams[n].id) + '\');" id="css_' + camelize(currteams[n].id) +'" class="form-control">' + option + '</select>';
divteams=divteams+'<tr><td>' + currteams[n].id + '</td><td>' + select + '</td><td><a href="javascript:void(0)" onclick="javascript:uploadimage(\'' + camelize(currteams[n].id) + '\',\'team\',\'' + currteams[n].id + '\');"><i class="fa fa-file-image-o fa-2x"></i></a></td></tr>'
}
divteams=divteams+'</tbody></table>';
$("#divteams").replaceWith('<div id="divteams">' + divteams + '</div>');
$.ajax({
'async': false,
url: "/es/global/team/_search?size=100",
success: function(s){
for (var i = 0; i < s.hits.hits.length; i++) {
$("#css_" + s.hits.hits[i]._source.id).val(s.hits.hits[i]._source.css);
}
}
});
</script>
</section>
</script>
<script id="rule" type="text/html">
<header class="head">
<a class="head-btn btn btn-default pull-left" data-do="go-back" data-on="click" href="#administration"><i class="fa fa-arrow-left"></i></a>
<h1 class="title">Rules</h1>
</header>
<section class="body with-head with-foot">
<div id="comprules"></div>
<script>
var currules = new Array();
$.ajax({
'async': false,
url: "/es/" + competition + "/startList/_search?size=100&sort=rules",
success: function(s){
for (var i = 0; i < s.hits.hits.length; i++) {
currules.push(JSON.parse('{"id":"' + s.hits.hits[i]._source.rules + '"}'));
}
}
});
var lastrule="";
for (var n = 0; n < currules.length; n++) {
if (currules[n].id == lastrule) {
currules.splice(n,1);
n--;
}
lastrule=currules[n].id;
}
var divcomprules="";
var comprules = new Array();
$.ajax({
'async': false,
url: "/es/global/startList/_search?q=agtype:" + agtype + '&size=100&sort=rules',
success: function(s){
for (var i = 0; i < s.hits.hits.length; i++) {
comprules.push(JSON.parse('{"id":"' + s.hits.hits[i]._source.rules + '"}'));
}
lastrule="";
var divclassrow = "";
divcomprules='<div class="focus focus-group">';
var localcomprules = new Array();
var comprow = "";
for (var i = 0; i < comprules.length; i++) {
if ((lastrule != comprules[i].id) && (comprules[i].id !== "undefined" )){
comprow = "";
var camelid=camelize(comprules[i].id);
var esrules = new Array();
divclassrow = "zrulesirrelevant row"
esindex = "global";
for (var n = 0; n < currules.length; n++) {
if (comprules[i].id == currules[n].id) {
divclassrow = "row";
esindex = competition;
}
}
$.ajax({
'async': false,
url: "/es/" + esindex + "/rules/"+agtype + "-" + camelid,
success: function(t){
esrules = t._source;
}
});
comprow = comprow + '<div class="' + divclassrow + '"><div class="col-xs-1 middle"><h1>' + comprules[i].id + '</h1></div><table id="rules_' + comprules[i].id +'"class="table table-condensed">';
var trows1='<tr><td>Results are public</td><td><span class="switch switch-2"><input onchange="changerule(\'public_' + camelid + '\');" id="public_' + camelid + '" type="checkbox" name="check" value="PH" ';
if (esrules.public == "true") {
trows1=trows1 + ' checked="checked" ';
}
trows1=trows1 + '/><span></td>';
var trows2='<tr><td>Extra Bonus in Pommel horse</td><td><span class="switch switch-2"><input onchange="changerule(\'bph_' + camelid + '\');" id="bph_' + camelid + '" type="checkbox" name="check" value="PH" ';
if (esrules.bph == "true") {
trows2=trows2+ ' checked="checked" ';
}
trows2=trows2+ '/><span></td>';
var trows3='<tr><td>Second Pommel horse exercise</td><td><span class="switch switch-2"><input onchange="changerule(\'sph_' + camelid + '\');" id="sph_' + camelid + '" type="checkbox" name="check" value="PH" ';
if (esrules.sph == "true") {
trows3=trows3 + ' checked="checked" ';
}
trows3=trows3 + '/><span></td>';
var trows4='<tr><td>Second vault</td><td><span class="switch switch-2"><input onchange="changerule(\'sv_' + camelid + '\');" id="sv_' + camelid + '" type="checkbox" name="check" value="PH" ';
if (esrules.sv == "true") {
trows4=trows4 + ' checked="checked" ';
}
trows4=trows4 + '/><span></td>';
var trows5='<tr><td>Register only average D</td><td><span class="switch switch-2"><input onchange="changerule(\'st_' + camelid + '\');" id="st_' + camelid + '" type="checkbox" name="check" value="PH" ';
if (esrules.st == "true") {
trows5=trows5 + ' checked="checked" ';
}
trows5=trows5 + '/><span></td>';
var trows6='<tr><td>Count second vault in ' + appname[agtype] + '</td><td><span class="switch switch-2"><input onchange="changerule(\'v2a_' + camelid + '\');" id="v2a_' + camelid + '" type="checkbox" name="check" value="PH" ';
if (esrules.v2a == "true") {
trows6=trows6 + 'checked="checked" ';
}
trows6=trows6 + '/><span></td>';
comprow = comprow + trows1 + '</tr>';
if (agtype == "MAG") {
comprow = comprow + trows2 + '</tr>';
comprow = comprow + trows3 + '</tr>';
comprow = comprow + trows4 + '</tr>';
} else {
comprow = comprow + trows5 + '</tr>';
comprow = comprow + trows6 + '</tr>';
}
comprow = comprow + '</table></div>';
localcomprules.push(comprow);
}
lastrule=comprules[i].id;
}
localcomprules.sort();
for (var i = 0; i < localcomprules.length; i++) {
divcomprules = divcomprules + localcomprules[i];
}
divcomprules = divcomprules + '</div>';
$("#comprules").replaceWith('<div id="comprules">' + divcomprules + '</div>');
}
});
</script>
</section>
</script>
<script id="administration" type="text/html">
<header class="head">
<a class="head-btn btn btn-default pull-left" data-do="go-back" data-on="click" href="#home"><i class="fa fa-arrow-left"></i></a>
<h1 class="title">Administration</h1>
</header>
<section class="body with-head with-foot">
<div id="div-admin">
<div class="focus">
<label class="top">Select<br>competition</label>
<select id="select-competition" class="form-control">
<option>None</option>
</select>
<a data-do="modal-open" id="editcomp" data-on="click" href="#newCompetition">
<i class="fa fa-pencil-square-o fa-2x"></i>
</a>
<a id="delCompetition" onclick="return confirm('Are you sure?! This will clear all scores and the start list of the selected competition')" href="javascript:deletecompetition($('#select-competition').val());">
<i class="fa fa-times fa-2x"></i>
</a>
<a data-do="modal-open" id="newcomp" data-on="click" href="#newCompetition">
<i class="fa fa-plus fa-2x"></i>
</a>
</div>
<nav class="nav-list">
<a data-do="go-forward" data-on="click" href="#startList">Start list<i class="fa fa-chevron-right"></i></a>
<a data-do="go-forward" data-on="click" href="#rule">Rules<i class="fa fa-chevron-right"></i></a>
<a data-do="go-forward" data-on="click" href="#teams">Teams<i class="fa fa-chevron-right"></i></a>
</nav>
</div>
</section>
<script>
if (username == "User" ) {
$( "#div-admin" ).replaceWith('<div id="div-admin"><div class="focus"><p>Please log in!</p></div></div>');
}
$(function() {
$("#editcomp").click( function()
{
$('#name').val(currcompetition.name);
$('#date').val(currcompetition.date);
$('#date2').val(currcompetition.date2);
$('#organizer').val(currcompetition.organizer);
$('#type').val(currcompetition.type);
$('#cid').val(currcompetition.id);
// $('#css').val(currcompetition.css);
$('#description').val(currcompetition.description);
$('#created').val(currcompetition.created);
$('#create').val("Update");
$( "#compsymb" ).replaceWith('<div id="compsymb"><i class="fa fa-pencil-square-o fa-5x"></i></div>');
}
);
});
$(function() {
$("#newcomp").click( function()
{
$('#name').val("");
$('#date').val("");
$('#date2').val("");
$('#organizer').val(currcompetition.organizer);
$('#type').val(currcompetition.type);
$('#cid').val("n");
// $('#css').val("");
$('#description').val("");
$('#created').val("n");
$('#create').val("Create");
$( "#compsymb" ).replaceWith('<div id="compsymb"><i class="fa fa-plus fa-5x"></i></div>');
}
);
});
setTimeout(function() {
initcompetition();
},500);
</script>
</script>
<script id="startList" type="text/html">
<header class="head">
<a class="head-btn btn btn-default pull-right" data-do="aside" data-on="click" href="#aside-startlist"><i class="fa fa-bars"></i></a>
<a class="head-btn btn btn-default pull-right" id="new" data-role="new" href="#"><i class="fa fa-plus"></i></a>
<!-- <a class="head-btn btn btn-default pull-left" data-do="aside" data-on="click" href="#aside-left"><i class="fa fa-bars"></i></a>-->
<a class="head-btn btn btn-default pull-left" data-do="go-back" data-on="click" href="#administration"><i class="fa fa-arrow-left"></i></a>
<h1 class="title">Start list</h1>
</header>
<section class="body with-foot with-head pad">
<h3 class="pad">Start list</h3>
<div class="focus">
<label class="top">Search:</label>
<input id="startList_table-search"
type="text"
class="form-control"
placeholder="Type filter.." />
</div>
<div id="startList_table"></div>
<div class="focus">
<p>
* Mandatory, gymnast will not be updated until filled in.
</div>
<h3 class="pad">Previously registered gymnasts</h3>
<table id="startList_all_table" class="startList_all_table table table-condensed">
<thead>
<th>Team</th>
<th>Gymnast</th>
<th>Born</th>
<th>Class</th>
<th>Rules</th>
<th>About</th>
<th data-dynatable-column="add"></th>
</thead>
<tbody>
</tbody>
</table>
<script>
if ( $(window).width() < 568 ) {
$.mobility.notify("Editing the start list on a small screen is not recommended!, at least tilt your device to landscape!","warning");
} else if ( $(window).width() < 768 ) {
$.mobility.notify("Editing the start list on a small screen is not recommended!","warning");
}
loadcurrrules();
drawgymtable("/es/" + competition + "/startList/_search?size=1000","startList_table","edit");
drawgymtable("/es/global/startList/_search?size=5000&q=agtype:" + agtype,"startList_all_table","global");
$( "#startList_table-search" ).val(editableGrid.currentFilter);
$( "#startList_table-search" ).change(function() {
editableGrid.filter($("#startList_table-search").val());
});
editableGrid.modelChanged = function(rowIndex, columnIndex, oldValue, newValue, row) {
var post = this.getRowValues(rowIndex);
var notify;
var notifytype;
if ((this.getColumnName(columnIndex) != "checked") & (post.gymnast.length > 4 ) & (post.pool.length > 0) & (post.team.length > 1 ) & (post.class.length > 0 ) & (post.number > 0)) {
if (post.id.length < 5 ) {
post.id = camelize(post.gymnast + post.team);
this.setValueAt(rowIndex, 2, post.id, true);
this.setValueAt(rowIndex, 10, '<a href="javascript:void(0)" onclick="javascript:uploadimage(\'' + post.id + '\',\'gymnast\',\'' + post.gymnast + '\');"><i class="fa fa-file-image-o"></i></a>' , true);
this.setValueAt(rowIndex, 11, '<a href="javascript:void(0)" onclick="delgymnast(\'' + post.id + '\');"><i class="fa fa-times"></i></a>', true);
}
var klasssplit = new Array();
klasssplit = post.class.split(" ");
if ((klasssplit[0].toLowerCase() == "steg") && (klasssplit[1] < 5)) {
post.rules = "Steg4-";
}
if ((klasssplit[0].toLowerCase() == "steg") && (klasssplit[1] > 4)) {
post.rules = "Steg5+";
}
if ((post.class.substring(0, 2) == "RM") && (post.class.substring(2, 3) < 9)) {
post.rules = post.class;
}
if (klasssplit[0].toLowerCase() == "cop" ) {
post.rules = "CoP";
}
editableGrid.setValueAt(rowIndex,6,post.rules,true);
startlistedit("POST",post,true);
}
};
$(function() {
var post = new Array();
$("#delete").click( function()
{
for (var i = 0; i < editableGrid.getRowCount(); i++) {
if (editableGrid.getRowValues(i).checked) {
post = editableGrid.getRowValues(i);
startlistedit("DELETE",post,true);
editableGrid.removeRow(editableGrid.getRowId(i));
i = -1;
}
}
}
);
});
$(function() {
$("#uncheck").click( function()
{
for (var i = 0; i < editableGrid.getRowCount(); i++) {
if (editableGrid.getRowValues(i).checked) {
editableGrid.setValueAt(i,9,"false",true);
}
}
}
);
});
$(function() {
$("#check").click( function()
{
for (var i = 0; i < editableGrid.getRowCount(); i++) {
if (!editableGrid.getRowValues(i).checked) {
editableGrid.setValueAt(i,9,"true",true);
}
}
}
);
});
$(function() {
$("#recheck").click( function()
{
for (var i = 0; i < editableGrid.getRowCount(); i++) {
if (editableGrid.getRowValues(i).checked) {
editableGrid.setValueAt(i,9,"false",true);
} else {
editableGrid.setValueAt(i,9,"true",true);
}
}
}
);
});
$(function() {
var post = new Array();
$("#class").click( function()
{
var newKlass=$("#startList_table-class").val();
for (var i = 0; i < editableGrid.getRowCount(); i++) {
if (editableGrid.getRowValues(i).checked) {
editableGrid.setValueAt(i,5,newKlass,true);
post = editableGrid.getRowValues(i);
startlistedit("POST",post,false);
}
}
}
);
});
$(function() {
var post = new Array();
$("#rules").click( function()
{
var newRules=$("#startList_table-rules").val();
for (var i = 0; i < editableGrid.getRowCount(); i++) {
if (editableGrid.getRowValues(i).checked) {
editableGrid.setValueAt(i,6,newRules,true);
post = editableGrid.getRowValues(i);
startlistedit("POST",post,false);
}
}
}
);
});
$(function() {
var post = new Array();
$("#pool").click( function()
{
var newPool=$("#startList_table-pool").val();
for (var i = 0; i < editableGrid.getRowCount(); i++) {
if (editableGrid.getRowValues(i).checked) {
editableGrid.setValueAt(i,7,newPool,true);
post = editableGrid.getRowValues(i);
startlistedit("POST",post,false);
}
}
}
);
});
$(function() {
$("#new").click( function()
{
//var d = new Date();
//var n = d.getTime();
//var new_id = n + "_" + Math.floor((Math.random() * 10000) + 1);
var new_id = "n";
var new_index=editableGrid.getRowCount() + 1;
var new_startnr = 0;
var datalocal=[];
for (var i = 0; i < editableGrid.getRowCount(); i++) {
if (editableGrid.getRowValues(i).number >= new_startnr) {
new_startnr = editableGrid.getRowValues(i).number + 1;
}
}
if (new_startnr < 1) {
new_startnr = 1;
}
datalocal.number = new_startnr;
datalocal.id = new_id;
datalocal.checked = true;
datalocal.agtype = agtype;
datalocal.del = '<a href="javascript:void(0);"><i class="fa fa-times"></i></a>';
datalocal.img = '<a href="javascript:void(0);"><i class="fa fa-file-image-o"></i></a>';
editableGrid.insertAfter(new_index, new_index, datalocal);
}
);
});
</script>
</section>
</script>
<script id="none" type="text/html">
<header class="head">
<!-- <a class="head-btn btn btn-default pull-left" data-do="aside" data-on="click" href="#aside-left"><i class="fa fa-bars"></i></a> -->
<a class="head-btn btn btn-default pull-left" data-do="go-back" data-on="click" href="#administration"><i class="fa fa-arrow-left"></i></a>
<h1 class="title">Nothing yet.</h1>
</header>
<section class="body with-foot with-head pad">
<div class="focus">
<input type="file" class="form-control" onchange="uploadFile('gymnast','new','#uploadimg')" /><br>
</div>
<div class="profile-userpic"><img id="uploadimg" src="images/KFUM.png" alt=""></div>
</section>
</script>
<script id="allaroundMAG" type="text/html">
<header class="head">
<a class="head-btn btn btn-default pull-left" data-do="go-back" data-on="click" href="#results"><i class="fa fa-arrow-left"></i></a>
<h1 class="title"><img src="images/floor.png" \><img src="images/pommelHorse.png" \><img src="images/rings.png" \><img src="images/vault.png" \><img src="images/parallelBars.png" \><img src="images/highBar.png" \></h1>
</header>
<section class="body with-foot with-head pad">
<div class="refresh-pull hide" data-do="refresh-pull"
data-pull="Pull down to refresh"
data-release="Release to refresh"
data-loading="Loading ...">
<i class="fa fa-arrow-up"></i>
<span class="message"></span>
</div>
<div class="focus">
<label class="top">Select class:</label>
<select id="allaround_tableMAG-search-class" class="form-control">
<option></option>
</select>
</div>
<table id="allaround_tableMAG" class="table table-condensed">
<thead>
<th>Class</th>
<th>Rank</th>
<th data-dynatable-column="number">#</th>
<th>Gymnast</th>
<th>Born</th>
<th>Team</th>
<th>Floor</th>
<th>Pommel horse</th>
<th>Rings</th>
<th>Vault</th>
<th>Parallel bars</th>
<th>High bar</th>
<th>Total</th>
</thead>
<tbody>
</tbody>
</table>
<div id="filler"></div>
<script>
jQuery(window).on('mobility-refresh', function(e, target, callback) {
setTimeout(function() {
drawgymtable("/es/" + competition + "/startList/_search?size=1000","allaround_tableMAG","update");
}, 1000);
});
drawgymtable("/es/" + competition + "/startList/_search?size=1000","allaround_tableMAG");
</script>
</section>
</script>
<script id="allaroundteam" type="text/html">
<header class="head">
<a class="head-btn btn btn-default pull-left" data-do="go-back" data-on="click" href="#results"><i class="fa fa-arrow-left"></i></a>
<h1 class="title"><div id="teamhead"></div></h1>
</header>
<section class="body with-foot with-head pad">
<table id="allaround_tableteam" class="table table-condensed">
<caption><b>Top 4 per team</b></caption>
<thead>
<th style="display: none">Dummy</th>
<th data-dynatable-column="id">Team</th>
<th data-dynatable-column="t">Top scores</th>
<th data-dynatable-column="p">Rank score</th>
</thead>
<tbody>
</tbody>
</table>
<script>
$( "#teamhead" ).replaceWith('<div id="teamhead"><img src="images/' + agtype + '.png"/></div>');
drawgymtable("/es/" + competition + "/startList/_search?size=1000","allaround_tableteam","team");
</script>
</section>
</script>
<script id="allaroundWAG" type="text/html">
<header class="head">
<a class="head-btn btn btn-default pull-left" data-do="go-back" data-on="click" href="#results"><i class="fa fa-arrow-left"></i></a>
<h1 class="title"><img src="images/vault.png" \><img src="images/unevenBars.png" \><img src="images/beam.png" \><img src="images/floor.png" \></h1>
</header>
<section class="body with-foot with-head pad">
<div class="refresh-pull hide" data-do="refresh-pull"
data-pull="Pull down to refresh"
data-release="Release to refresh"
data-loading="Loading ...">
<i class="fa fa-arrow-up"></i>
<span class="message"></span>
</div>
<div class="focus">
<label class="top">Select class:</label>
<select id="allaround_tableWAG-search-class" class="form-control">
<option></option>
</select>
</div>
<table id="allaround_tableWAG" class="table table-condensed">
<thead>
<th>Class</th>
<th>Rank</th>
<th data-dynatable-column="number">#</th>
<th>Gymnast</th>
<th>Born</th>
<th>Team</th>
<th>Vault</th>
<th>Uneven Bars</th>
<th>Beam</th>
<th>Floor</th>
<th>Total</th>
</thead>
<tbody>
</tbody>
</table>
<div id="filler"></div>
<script>
jQuery(window).on('mobility-refresh', function(e, target, callback) {
setTimeout(function() {
drawgymtable("/es/" + competition + "/startList/_search?size=1000","allaround_tableWAG","update");
}, 1000);
});
drawgymtable("/es/" + competition + "/startList/_search?size=1000","allaround_tableWAG");
</script>
</section>
</script>
<script id="floor" type="text/html">
<header class="head">
<!-- <a class="head-btn btn btn-default pull-left" data-do="aside" data-on="click" href="#aside-left"><i class="fa fa-bars"></i></a> -->
<a class="head-btn btn btn-default pull-left" data-do="go-back" data-on="click" href="#results"><i class="fa fa-arrow-left"></i></a>
<h1 class="title"><img src="images/floor.png" \> Floor</h1>
</header>
<section class="body with-foot with-head pad">
<div class="refresh-pull hide" data-do="refresh-pull"
data-pull="Pull down to refresh"
data-release="Release to refresh"
data-loading="Loading ...">
<i class="fa fa-arrow-up"></i>
<span class="message"></span>
</div>
<div class="focus">
<label class="top">Select class:</label>
<select id="floor_table-search-class" class="form-control">
<option></option>
</select>
</div>
<table id="floor_table" class="table table-condensed">
<thead>
<th>Class</th>
<th>Rank</th>
<th data-dynatable-column="number">#</th>
<th>Gymnast</th>
<th>Born</th>
<th>Team</th>
<th>Pen</th>