-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetabuild.html
executable file
·4126 lines (3548 loc) · 124 KB
/
metabuild.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 http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Security-Policy" content="default-src 'self';script-src 'self' 'unsafe-inline';style-src 'self' 'unsafe-inline';img-src 'self' data:;" />
<meta name="viewport" content="width=device-width" />
<!-- SHORT OVERVIEW ABOUT SUPPORT IN BROWSER -->
<!--
/**
* Firefox 18 (resolved Duration bug in audio/video)
* Firefox 21 (more support for css,html and js attributes)
* Safari 7(theoretical)/SF ios7.1(theoretical)/8+? (FileReader API is in SF8 Buggy)
* IE 10 (if you have 10, favorite 11, because you can^^ http://windows.microsoft.com/en-US/internet-explorer/download-ie)
* Opera 25 (possible earlier but have not tested since a long time, but more support for css,html and js attributes in 25)
* Chrome 31/android 38/4.4.(4|3)/37 (possible earlier but have not tested since a long time)
*
* MAYBE SUPPORT
* Smart TV with NetFront Browser NX greater as v2.1 IN other words: v2.1 is not working
*
* NOT SUPPORTED
* Opera Mini
* Wii
* Wii U (NetFront Browser NX v2.1)
*
**/
-->
<!--
/**
*
* Thanks to M3d1c5 at http://blog.m3d1c5.org and Tim Pritlove at http://metaebene.me for the inspiration or i hate you for the lost time;)
* Sorry for all other dudes thus waste time with my stuff here, too ;)
*
* primary optimized for some podcasts from Tim Pritlove at http://metaebene.me and chatlog from http://streams.xenim.de/
*
* TODO:
* generaly chatlog support from:
* plain irc logs (e.g. from http://streams.xenim.de/ live chat)
* and/or post production by irclog2html.py (http://mg.pov.lt/irclog2html/)
* and/or post post production by podcast_timestamp.py (http://randomprojects.de/stuff/podcast_timestamps.py)
*
* generaly audio/video (minimal web) support (case of used browser) from:
* ogg (container) - ogg,oga,ogv,ogx,opus (file extension) mime: audio/ogg,video/ogg codecs: audio/vorbis,video/theora,audio/opus [metadata: VorbisComment, OpusTags]
* mp3 (container, file extension) mime: audio/mpeg codecs: (no codec defined instead use the mime: audio/mpeg) [metadata: ID3v2 (v2.4.0 and v2.3.0)]
* mp4 (container) - mp4,m4a,m4v (file extension) mime: audio/mp4,video/mp4 codecs: audio/mp4a.40.2 (Low-Complexity AAC), video/avc1.42E01E (H.264 Baseline Profile recommend by iOS), video/mp4v.20.9 (MPEG-4 Visual Simple Profile Level 0) [metadata: Atom]
* webm (container, file extension) codecs: video/vp8 (vp8.0 is the same), audio/vorbis [metadata: not supported yet]
* wav (container, file extension) mime: audio/wave (wave preferred by FF but wav preferred by some others [not verified]) codecs: 1 (WAVE_FORMAT_PCM) [metadata: not supported yet]
*
*
*
*
** realy intersting stuff take a look or two (.js tools):
* http://labs.official.fm/articles/2012/06/15/flac-and-aurora/
* http://badassjs.com/post/14463682242/introducing-alac-js-an-apple-lossless-audio-decoder-in
* https://github.com/aadsm/JavaScript-ID3-Reader/tree/
*
** some file (metadata) specs?
* OGG:
* http://tools.ietf.org/html/draft-terriberry-oggopus-01 <--- BEWARE, the redirect to a newer or older draft is sometimes strange and confusing.
* http://wiki.xiph.org/VorbisComment
* MP3:
* http://id3.org/Developer%20Information
* MP4:
* http://atomicparsley.sourceforge.net/mpeg-4files.html
* http://www.adobe.com/devnet/video/articles/mp4_movie_atom.html
* http://forum.doom9.org/showthread.php?t=62723
* https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html
* http://developer.apple.com/library/mac/documentation/quicktime/qtff/Metadata/Metadata.html
* WEBM:
* http://www.webmproject.org/docs/container/
*
** some test files?
* http://samples.mplayerhq.hu/
* http://media.xiph.org/
* http://media.xiph.org/video/derf/
* http://wiki.xiph.org/TheoraTestsuite
* http://wiki.xiph.org/VorbisComment#Playback_tests
* http://support.apple.com/kb/HT1425
*
*
* https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/srcObject <-- new 2022 :D
**/
-->
<style type="text/css">
html,body,div,audio,video,canvas,textarea,input,p,img {
position:relative;
display:block;
margin:0;
padding:0;
}
canvas, img {
/*
http://stackoverflow.com/questions/7615009/disable-interpolation-when-scaling-a-canvas
https://developer.mozilla.org/en-US/docs/CSS/Image-rendering#Browser_compatibility
http://code.google.com/p/chromium/issues/detail?id=134040
http://phoboslab.org/log/2012/09/drawing-pixels-is-hard
http://phrogz.net/tmp/canvas_image_zoom.html
*/
image-rendering: optimizeSpeed;
image-rendering: -moz-crisp-edges;
image-rendering: -o-crisp-edges;
image-rendering: crisp-edges;
image-rendering: -webkit-optimize-contrast;
image-rendering: optimize-contrast;
-ms-interpolation-mode: nearest-neighbor;
}
html,body {
height:100%;
width:100%;
font:normal bold .9em/1.4 SourceSansPro, "Trebuchet MS", Trebuchet, System, Tahoma, "Tahoma MS", "Arial MS", Verdana, Arial, sans-serif;
}
blink {
color:red;
}
.layer {
/* position:absolute;
top:0;
left:0;
height:100%;
width:100%;
*/
}
#layer_1 {
z-index:10;
}
#layer_2 {
z-index:20;
}
#layer_3 {
z-index:30;
}
.left:after {
content:"◄";
}
.right:after {
content:"►";
}
.top:after,
.close:after {
content:"▲";
}
.bott:after,
.open:after {
content:"▼";
}
.full:after {
content:"■";
font-size:1.4em;
line-height:0.7;
}
.empty:after {
content:"□";
font-size:1.5em;
line-height:0.7;
}
.cross:after {
content:"♦";
/*font-size:1.5em;
line-height:0.7;*/
}
#spc_gui {
width:100%;
height:100%;
}
/* layer 1 zindex 10 img/canvas, metainfo,status */
#spc_cover {
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
}
#metainfo {
position:absolute;
display:block;
background-color:red;
top:3em;
left:0;
width:auto;
height:auto;
padding:1em;
/* font:normal bold 14px/1.4 SourceSansPro, "Trebuchet MS", Trebuchet, System, Tahoma, "Tahoma MS", "Arial MS", Verdana, Arial, sans-serif;
color:#F1F1F1;
text-shadow: 1px 1px 2px #000000;*/
}
#status {
position:fixed;
display:block;
height: auto;
width: 100%;
top:85%;
bottom:auto;
margin-top:-1.5em;
margin-bottom:0;
text-align:center;
vertical-align:middle;
font-size: 3em;
color:rgba(255,255,255,1);
/*
animation-name: none
animation-duration: 0s
animation-timing-function: ease
animation-delay: 0s
animation-iteration-count: 1
animation-direction: normal
animation-fill-mode: none
*/
-o-animation: blend 3s linear 0s infinite alternate;
-ms-animation: blend 3s linear 0s infinite alternate;
-moz-animation: blend 3s linear 0s infinite alternate;
-khtml-animation: blend 3s linear 0s infinite alternate;
-webkit-animation: blend 3s linear 0s infinite alternate;
animation: blend 3s linear 0s infinite alternate;
}
/*
@-o-keyframes blend,
@-ms-keyframes blend,
@-moz-keyframes blend,
@-khtml-keyframes blend,
@-webkit-keyframes blend
*/
@-moz-keyframes blend {
0% {
color:white;
text-shadow: 1px 1px 1px black;
}
100% {
color:transparent;
text-shadow: 1px 1px 1px transparent;
}
}
@-webkit-keyframes blend {
0% {
color:white;
text-shadow: 1px 1px 1px black;
}
100% {
color:transparent;
text-shadow: 1px 1px 1px transparent;
}
}
@-khtml-keyframes blend {
0% {
color:white;
text-shadow: 1px 1px 1px black;
}
100% {
color:transparent;
text-shadow: 1px 1px 1px transparent;
}
}
@-ms-keyframes blend {
0% {
color:white;
text-shadow: 1px 1px 1px black;
}
100% {
color:transparent;
text-shadow: 1px 1px 1px transparent;
}
}
@-o-keyframes blend {
0% {
color:white;
text-shadow: 1px 1px 1px black;
}
100% {
color:transparent;
text-shadow: 1px 1px 1px transparent;
}
}
@keyframes blend {
0% {
color:blue;
text-shadow: 1px 1px 1px black;
}
25% {}
50% {}
75% {}
100% {
color:transparent;
text-shadow: 1px 1px 1px transparent;
}
}
#status.blend-inOLD {
-webkit-transition: all 1s linear;
-moz-transition: all 1s linear;
-o-transition: all 1s linear;
-ms-transition: all 1s linear;
transition: all 1s linear;
color:rgba(255,255,255,1);
}
#status.blend-outOLD {
-webkit-transition: all 1s linear;
-moz-transition: all 1s linear;
-o-transition: all 1s linear;
-ms-transition: all 1s linear;
transition: all 1s linear;
color:rgba(0,0,0,0);
}
/* layer 2 zindex 20 video/audio, controls */
video#podplayer {
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
background-color:transparent;
}
audio#podplayer,#problem_indicate {
position:fixed;
top:auto;
bottom:0;
height:28px; /* FF */
height:25px; /* O */
height:30px; /* webkit/chrome, safari? */
/* IE? */
/*
we will set the height value of this and #chat with javascript because calc(100% - var audioElement.height) working only in webkit (#menue the same)
*/
width:auto;
height:auto;
}
#problem_indicate {
background-color: red;
z-index:1;
}
#controls {
width:100%;
}
#controls *{
float:left;
}
/* CHAT */
#chat {
position:relative;
display:block;
margin:0;
/* problem with chrome/opera(25.0) resize an element smaller than set height and width value not possible --- looks like FF17.0.1, too */
height:100%;
width:100%;
overflow:auto;
overflow-y:scroll;
resize:both;
background-color:#F1F1F1;
background-color:rgba(241,241,241,0.7);
/*padding-top:3px;*/
/*-moz-box-shadow: inset 0px 3px 3px -3px #000;
-webkit-box-shadow: inset 0px 3px 3px -3px #000;
box-shadow: inset 0px 3px 3px -3px #000; */
-moz-box-shadow: inset 3px 3px 3px -3px rgba(0, 0, 0, 0.7), inset -1px -1px 3px -3px rgba(0, 0, 0, 1);
-webkit-box-shadow: inset 3px 3px 3px -3px rgba(0, 0, 0, 0.7), inset -1px -1px 3px -3px rgba(0, 0, 0, 1);
box-shadow: inset 3px 3px 3px -3px rgba(0, 0, 0, 0.7), inset -1px -1px 3px -3px rgba(0, 0, 0, 1);
/* prevent the stupid preselect of all kinds of elements by doubleclick in empty chat */
-webkit-user-select: none; /* Chrome/Safari now opera too */
-moz-user-select: none; /* works in Firefox 21 - don't use -moz-none it makes more problems as resolves it */
-ms-user-select: none; /* IE10+ */
/* Rules below not yet implemented in browsers */
-o-user-select: none;
user-select: none;
}
#chat p {
margin:1em;
-webkit-user-select: text; /* Chrome/Safari */
-moz-user-select: text; /* Firefox */
-ms-user-select: text; /* IE10+ */
/* Rules below not implemented in browsers yet */
-o-user-select: text;
user-select: text;
}
#chat p .nick {
font-weight:bold;
}
#chat p .msg {
color:black;
}
.overlayzzz{
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
}
#menue {
width:100%;
height:auto;
transition: all 1.5s ease 0.1s;
}
#menue:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
#menue.hidew {
overflow:hidden;
width:2.3em;
}
#menue.hideh {
overflow:hidden;
height:2.5em;
}
/*
#busy {
position:absolute;
display:block;
width: 100%;
height: 100%;
color: red;
font-size: 10em;
background-color: black;
}
*/
#dumpmetadata_box dt {
}
#menue ul li {
/*
-webkit-transition: all 1s linear;
-moz-transition: all 1s linear;
-o-transition: all 1s linear;
-ms-transition: all 1s linear;
transition: all 1s linear;
*/
}
#interface {
/*
position:fixed;
left:66%;
border:solid 1px red;
width:33%;
height:99%;
overflow:auto;
overflow-y:scroll;
resize:none;
*/
}
#layer,
#layer_audio {
position:fixed;
height:100%;
width:100%;
background-color:black;
top:0;
left:0;
color:white;
}
#layer_audio {
}
#viewcontent {
}
#playerfield {
}
/*
#inyourface {
position:fixed;
-moz-transition:font-size 1s, color 1s;
margin:auto;
text-align:center;
top:0;
bottom:auto;
right:0;
left:auto;
width:auto;
height:auto;
}
#inyourface a {
display:block;
}
*/
videoxxx,
audioxxx {
position:relative;
display:block;
margin:0;
padding:0;
height:100%;
width:100%;
/*overflow:auto;
overflow-y:scroll;
resize:both;*/
/*-moz-transition:poster 0.5s, video 0.5s linear 0.1s;
-webkit-transition:poster 0.5s, video 0.5s linear 0.1s -webkit-transform 1s;
-o-transition:background-color 0.5s, color 0.5s linear 0.1s;
transition:poster 0.5s, video 0.5s linear 0.1s;*/
}
#metainfo {
/* position:absolute;
display:block;
top:0;
left:0;
width:auto;
height:auto;
padding:1%;
font:normal bold 14px/1.4 SourceSansPro, "Trebuchet MS", Trebuchet, System, Tahoma, "Tahoma MS", "Arial MS", Verdana, Arial, sans-serif;
color:#F1F1F1;
text-shadow: 1px 1px 2px #000000;*/
}
ul.menue {
position:relative;
display:block;
list-style:none;
list-style-position:inside;
padding:0;
margin:0;
height:auto;
width:auto;
color:#F1F1F1;
background-color: #FF0;
}
ul.menue:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
ul.menue li {
position:relative;
display:block;
float:left;
padding:0;
margin:0;
height:auto;
width:auto;
background: -moz-linear-gradient(top, #5A5A5A 90%, #F1F1F1 100%);
background: -webkit-linear-gradient(top, #1F1F1F 90%, #F1F1F1 100%);
background: -ms-linear-gradient(top, #1F1F1F 90%, #F1F1F1 100%);
background: -o-linear-gradient(top, #1F1F1F 90%, #F1F1F1 100%);
background: linear-gradient(to bottom, #1F1F1F 90%, #F1F1F1 100%);
background: linear-gradient(top, #1F1F1F 90%, #F1F1F1 100%);
transition: width 2s;
-moz-transition: width 2s;
}
ul.menue li:hover {
}
ul.menue li:last-child {
clear:right;
/*padding:7px;*/
}
ul.menue li a {
position:relative;
display:block;
text-decoration: none;
padding:7px;
color:#F1F1F1;
border-right:solid 1px #F1F1F1;
}
ul.menue li a:hover {
text-decoration: underline;
}
ul.menue li label {
position:relative;
display:block;
white-space:nowrap;
padding:7px;
margin:0;
}
ul.menue li label input {
position:relative;
display:inline;
border:solid 0px black;
margin:0;
padding:0 3px 0 0;
text-align: right;
width:76px;
height:auto;
-moz-transition:background-color 0.5s, color 0.5s linear 0.1s;
-webkit-transition:background-color 0.5s, color 0.5s linear 0.1s;
-o-transition:background-color 0.5s, color 0.5s linear 0.1s;
transition:background-color 0.5s, color 0.5s linear 0.1s;
background-color:transparent;
color:#F1F1F1;
}
ul.menue li label input:focus,
ul.menue li label input:hover {
background-color:#F1F1F1;
color:#0F0F0F;
}
table#nicklist_table_box {
background-color: #F1F1F1;
}
table#nicklist_table_box tr td {
border-bottom: 1px solid black;
}
table#nicklist_table_box tr td:nth-child(2n) {
text-align:right;
}
table#nicklist_table_box tr td a {
display:block;
text-decoration:none;
}
table#nicklist_table_box tr td a:hover {
text-decoration:underline;
}
</style>
<script type="text/javascript">
// SOME HELPER
// utf8_decode helps for some strange issue (iso to unicode viseversa) in Binary data -- posible other solution with hidden input to paste and read again but this works and without dom manipulation
function utf8_decode (str_data) {
// Converts a UTF-8 encoded string to ISO-8859-1
//
// version: 1109.2015
// discuss at: http://phpjs.org/functions/utf8_decode // + original by: Webtoolkit.info (http://www.webtoolkit.info/)
// + input by: Aman Gupta
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + improved by: Norman "zEh" Fuchs
// + bugfixed by: hitwork // + bugfixed by: Onno Marsman
// + input by: Brett Zamir (http://brett-zamir.me)
// + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// * example 1: utf8_decode('Kevin van Zonneveld');
// * returns 1: 'Kevin van Zonneveld'
var tmp_arr = [],
i = 0,
ac = 0,
c1 = 0,
c2 = 0, c3 = 0;
str_data += '';
while (i < str_data.length) { c1 = str_data.charCodeAt(i);
if (c1 < 128) {
tmp_arr[ac++] = String.fromCharCode(c1);
i++;
} else if (c1 > 191 && c1 < 224) { c2 = str_data.charCodeAt(i + 1);
tmp_arr[ac++] = String.fromCharCode(((c1 & 31) << 6) | (c2 & 63));
i += 2;
} else {
c2 = str_data.charCodeAt(i + 1); c3 = str_data.charCodeAt(i + 2);
tmp_arr[ac++] = String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
i += 3;
}
}
return tmp_arr.join('');
}
/**
Why the uniChars function?
Because i never trust the defined charset in Metadata again!
**/
function uniChars (stringArray) {
/**
UTF-8 Wertebereich Bedeutung
Binär Hexadezimal Dezimal
00000000–01111111 00-7F 0-127 Ein-Byte lange Zeichen, deckungsgleich mit US-ASCII.
10000000–10111111 80-BF 128-191 Zweites, drittes oder viertes Byte einer Bytesequenz.
11000000–11000001 C0-C1 192-193 Start einer 2 Byte langen Sequenz, welche den Codebereich aus 0 bis 127 abbildet, unzulässig
11000010–11011111 C2-DF 194-223 Start einer 2 Byte langen Sequenz
11100000–11101111 E0-EF 224-239 Start einer 3 Byte langen Sequenz
11110000–11110100 F0-F4 240-244 Start einer 4 Byte langen Sequenz (Inklusive der Codebereiche von 110000 bis 13FFFF)
11110101–11110111 F5-F7 245-247 Beschränkt von der RFC 3629: Start einer 4 Byte langen Sequenz für Codebereich über 140000
11111000–11111011 F8-FB 248-251 Beschränkt von der RFC 3629: Start einer 5 Byte langen Sequenz
11111100–11111101 FC-FD 252-253 Beschränkt von der RFC 3629: Start einer 6 Byte langen Sequenz
11111110–11111111 FE-FF 254-255 Ungültig. In der ursprünglichen UTF-8-Spezifikation nicht definiert.
**/
// should works on ascii iso utf8 utf16 as LE and BE with decimal numbers --- NOT WORKING WITH UTF-32 - possible some iso chars wrong - single byte gt 127 (TODO TEST e.g. euro symbol)
var tempchar = [];
var chars = '';
var length = stringArray.length;
for (var i = 0, end = length; i < end; i++)
{
// multi byte LE
if (stringArray[i] > 193 && stringArray[i] < 224)
{// 2 byte
chars += String.fromCharCode(stringArray[i]+stringArray[i+1]);
i = i+2;
continue;
}
if (stringArray[i] > 223 && stringArray[i] < 240)
{// 3 byte
chars += String.fromCharCode(stringArray[i]+stringArray[i+1]+stringArray[i+2]);
i = i+3;
continue;
}
if (stringArray[i] > 239 && stringArray[i] < 245)
{// 4 byte
chars += String.fromCharCode(stringArray[i]+stringArray[i+1]+stringArray[i+2]+stringArray[i+3]);
i = i+4;
continue;
}
// multi byte BE
if (stringArray[i] > 127 && stringArray[i] < 192)
{
tempchar = [];
while (stringArray[i] > 127 && stringArray[i] < 192)
{
tempchar.push(stringArray[i]);
i++;
}
tempchar.push(stringArray[i+1]);
tempchar.reverse();
switch (tempchar.length)
{
case 2:
chars += String.fromCharCode(tempchar[0]+tempchar[1]);
break;
case 3:
chars += String.fromCharCode(tempchar[0]+tempchar[1]+tempchar[2]);
break;
case 4:
chars += String.fromCharCode(tempchar[0]+tempchar[1]+tempchar[2]+tempchar[3]);
break;
}
i = i+2;
continue;
}
// single byte char
// is FF FE Little Endian single char
if (stringArray[i] < 128 && stringArray[i] != 0)
{
chars += String.fromCharCode(stringArray[i]);
//if equal US-ASCII as multybyte (utf-16LE)
while (stringArray[i+1] == 0)
{
i++;
}
continue;
}
// is FE FF Big Endian - beginning 0 equal US-ASCII as 2 bytes (utf-16BE)
if (stringArray[i] == 0)
{
// more as one zero is strange
while (stringArray[i] == 0)
{
i++;
}
if (stringArray[i] < 128)
{ // single byte char
chars += String.fromCharCode(stringArray[i]);
i++;
continue;
}
else if (stringArray[i] > 244)
{ // mostly BOM FF FE or FE FF stuff in the middle of string ;(
//chars += String.fromCharCode(32);
i++;
continue;
}
else
{ // multi byte gt 2 byte with beginning 0 ??? mhhh
alert("OHHHHHHH DAMN, ALL BROKEN - NOT A REGULAR CHARCODE! wrong start position of stringArray? UTF-32? not decimal values [0-255]? check for updates in your taggging tool/software?");
break;
return false;
}
}
// ignore Chars
if (stringArray[i] > 244) //0xF4
{
chars += String.fromCharCode(32);
i++;
continue;
}
} //for end
return chars;
}
if (!String.fromCodePoint) {// NOT USED
/*!
* ES6 Unicode Shims 0.1
* (c) 2012 Steven Levithan <http://slevithan.com/>
* MIT License
*/
String.fromCodePoint = function fromCodePoint () {
var chars = [], point, offset, units, i;
for (i = 0; i < arguments.length; ++i) {
point = arguments[i];
offset = point - 0x10000;
units = point > 0xFFFF ? [0xD800 + (offset >> 10), 0xDC00 + (offset & 0x3FF)] : [point];
chars.push(String.fromCharCode.apply(null, units));
}
return chars.join("");
}
}
// String prototyping stuff
String.prototype.invisibleChars = ' \f\n\r\t\v\u00A0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u2028\u2029\u202f\u205f\u3000';// list for that kind of whitespaces - unicode save
String.prototype.trim = String.prototype.trim || function () {
/**
strange issue on begining of testing with object/string definition (never seen again; to early in the morning?) but for all kind of prolbem again:
Merkwürdiger fehler am Anfang des Testens mit Object/String Definitionen (fehler trat nicht mehr auf; Zu früh am Morgen?) Aber für alle fälle, wenn das Problem wieder auftritt:
1. be sure it is a string not an object
e.g.:
var str = this.toString();
typeof str === string
and:
var str = new Sting(this.toString());
typeof str === object
2. use "str = str.replace..." instead "return str.replace..." in other case posible you lost the replaced stuff becouse the not modifyd object.toString will returned (or something what ever it was)
e.g.:
str = str.replace(/^\s+|\s+$/g,'');
return str;
**/
return this.trimLeft().trimRight();
};
String.prototype.trimLeft = String.prototype.ltrim = String.prototype.trimLeft || function () {
var exp = new RegExp('^['+this.invisibleChars+']+');
return this.replace(exp,'');
};
String.prototype.trimRight = String.prototype.rtrim = String.prototype.trimRight || function () {
var exp = new RegExp('['+this.invisibleChars+']+$');
return this.replace(exp,'');
};
String.prototype.trimNice = String.prototype.nicetrim = function () {
// remove all whitespaces from begin and end of string; change all kind of whitespaces to only one leterspace between none whitespace chars
var exp = new RegExp('['+this.invisibleChars+']+','g');
return this.trim().replace(exp,' ');
};
String.prototype.trimFull = String.prototype.fulltrim = function () {
// remove all kind of whitespaces
var exp = new RegExp('['+this.invisibleChars+']','g');
return this.replace(exp,'');
};
// for preselected choice for input file
function checkFileTypeSupport (tag)
{
var tag = (tag == 'audio' ? 'audio' : 'video');
var suppString = '';
var test = document.createElement(tag);
if ( !!(test.canPlayType(tag+'/mp4;').replace(/no/, '')) ) suppString += ','+tag+'/mp4';
if ( !!(test.canPlayType(tag+'/ogg;').replace(/no/, '')) ) suppString += ','+tag+'/ogg';
if ( !!(test.canPlayType(tag+'/webm;').replace(/no/, '')) ) suppString += ','+tag+'/webm';
if ( !!(test.canPlayType(tag+'/mpeg;').replace(/no/, '')) ) suppString += ','+tag+'/mpeg';
if ( !!(test.canPlayType(tag+'/wav;').replace(/no/, '')) ) suppString += ','+tag+'/wav';
//alert(suppString.replace(',', ''));
return suppString.replace(',', '');
};
// NOW WE CAN!
function syncPodChat ()
{
var that = this;
//this.debugCon = false; // console MSG (no more stats)
// DEFAULT SETTINGS
this.difTime = -61; // value in seconds; for chatLog synchronizing
this.usePlayer = false; // set the player-id from your dom (audio/video tag) you want to sync; or use false for a new player [this version used player with id 'podplayer']
//this.fileType = false;
this.playerArt = 'audio'; // set 'audio' or 'video'; if "usePlayer" has a player-id it will be set for you automatic (in this case i hope you use audio or video -tag) [this version used only audio]
this.podFile = '' || [] || function (){}; // one file as src string or multi sources as array; will be ignored if "usePlayer" has a player-id or function selectPodFile() is used
this.chatlogFile = '' || function (){}; // string of filename from your chatlog or use this.selectChatlogFile()
//chatlog
/* Some ID settings to define where Dom-buildings like table tr td ...,ul li ... will be placed in HTML PAGE */
this.toInsert = {
chatlog: 'chat', // where entrys insert from chatlogObject by syncing audio/video
metadata: 'metadata', // where selected entrys will filled from metadataObject by metadataReady-event from audio/video analyses (audio/video title,date,tracknumber,artists,album see function readMetadata() or metadataReady()-function)
menue: 'menue', // will be there insert ul (li a)*n with all possible stuff see below
// some possilbe menue functions below
// chatlogBuildings
nicklist: 'chat',
linklist: 'chat',
dumplog: 'chat',
// metadataBuildings
chapters: 'chat',
shownotes: 'chat',
dumpmeta: 'chat'
};
var chatlogObject = {}; // will be filled from xxx.log.html in M3d1c5-style for more info see chatlogReady()-function;
/* chatlogObject will looks like this:
{
'nicks': {
nick: { // name in chat
'color': color,
'entrys': [entrys.id,entrys.id,entrys.id,...]
},
...
},
'entrys': {
id: {
'nick': nicks.nick,
'text': text,
'timestamp': timestamp
},
...
},
'timestamps': {
timestamp : { //-00:50 , 00:04 ...
'entrys':[entrys.id,entrys.id,entrys.id,...]